{
  "version": 3,
  "sources": ["../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/prism.js", "../../../node_modules/.pnpm/@rails+activestorage@8.1.400/node_modules/@rails/activestorage/app/assets/javascripts/activestorage.esm.js", "../../../node_modules/.pnpm/@37signals+lexxy@1.0.1_@rails+activestorage@8.1.400/node_modules/@37signals/lexxy/dist/lexxy_helpers.esm.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-clike.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-diff.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-javascript.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-markup.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-markdown.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-c.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-css.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-objectivec.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-sql.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-powershell.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-python.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-rust.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-swift.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-typescript.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-java.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-cpp.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-markup-templating.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-ruby.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-php.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-go.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-bash.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-json.js", "../../../node_modules/.pnpm/prismjs@1.30.0/node_modules/prismjs/components/prism-kotlin.js", "../../../node_modules/.pnpm/dompurify@3.4.14/node_modules/dompurify/src/utils.ts", "../../../node_modules/.pnpm/dompurify@3.4.14/node_modules/dompurify/src/tags.ts", "../../../node_modules/.pnpm/dompurify@3.4.14/node_modules/dompurify/src/attrs.ts", "../../../node_modules/.pnpm/dompurify@3.4.14/node_modules/dompurify/src/regexp.ts", "../../../node_modules/.pnpm/dompurify@3.4.14/node_modules/dompurify/src/purify.ts", "../../../node_modules/.pnpm/@lexical+selection@0.44.0/node_modules/@lexical/selection/LexicalSelection.dev.mjs", "../../../node_modules/.pnpm/lexical@0.44.0/node_modules/lexical/Lexical.dev.mjs", "../../../node_modules/.pnpm/lexical@0.44.0/node_modules/lexical/Lexical.mjs", "../../../node_modules/.pnpm/@lexical+selection@0.44.0/node_modules/@lexical/selection/LexicalSelection.mjs", "../../../node_modules/.pnpm/@lexical+link@0.44.0/node_modules/@lexical/link/LexicalLink.dev.mjs", "../../../node_modules/.pnpm/@lexical+utils@0.44.0/node_modules/@lexical/utils/LexicalUtils.dev.mjs", "../../../node_modules/.pnpm/@lexical+utils@0.44.0/node_modules/@lexical/utils/LexicalUtils.mjs", "../../../node_modules/.pnpm/@lexical+extension@0.44.0/node_modules/@lexical/extension/LexicalExtension.dev.mjs", "../../../node_modules/.pnpm/@lexical+extension@0.44.0/node_modules/@lexical/extension/LexicalExtension.mjs", "../../../node_modules/.pnpm/@lexical+link@0.44.0/node_modules/@lexical/link/LexicalLink.mjs", "../../../node_modules/.pnpm/@lexical+list@0.44.0/node_modules/@lexical/list/LexicalList.dev.mjs", "../../../node_modules/.pnpm/@lexical+list@0.44.0/node_modules/@lexical/list/LexicalList.mjs", "../../../node_modules/.pnpm/@lexical+plain-text@0.44.0/node_modules/@lexical/plain-text/LexicalPlainText.dev.mjs", "../../../node_modules/.pnpm/@lexical+clipboard@0.44.0/node_modules/@lexical/clipboard/LexicalClipboard.dev.mjs", "../../../node_modules/.pnpm/@lexical+html@0.44.0/node_modules/@lexical/html/LexicalHtml.dev.mjs", "../../../node_modules/.pnpm/@lexical+html@0.44.0/node_modules/@lexical/html/LexicalHtml.mjs", "../../../node_modules/.pnpm/@lexical+clipboard@0.44.0/node_modules/@lexical/clipboard/LexicalClipboard.mjs", "../../../node_modules/.pnpm/@lexical+dragon@0.44.0/node_modules/@lexical/dragon/LexicalDragon.dev.mjs", "../../../node_modules/.pnpm/@lexical+dragon@0.44.0/node_modules/@lexical/dragon/LexicalDragon.mjs", "../../../node_modules/.pnpm/@lexical+plain-text@0.44.0/node_modules/@lexical/plain-text/LexicalPlainText.mjs", "../../../node_modules/.pnpm/@lexical+rich-text@0.44.0/node_modules/@lexical/rich-text/LexicalRichText.dev.mjs", "../../../node_modules/.pnpm/@lexical+rich-text@0.44.0/node_modules/@lexical/rich-text/LexicalRichText.mjs", "../../../node_modules/.pnpm/@lexical+history@0.44.0/node_modules/@lexical/history/LexicalHistory.dev.mjs", "../../../node_modules/.pnpm/@lexical+history@0.44.0/node_modules/@lexical/history/LexicalHistory.mjs", "../../../node_modules/.pnpm/@lexical+code@0.44.0/node_modules/@lexical/code/LexicalCode.dev.mjs", "../../../node_modules/.pnpm/@lexical+code-prism@0.44.0/node_modules/@lexical/code-prism/LexicalCodePrism.dev.mjs", "../../../node_modules/.pnpm/@lexical+code-core@0.44.0/node_modules/@lexical/code-core/LexicalCodeCore.dev.mjs", "../../../node_modules/.pnpm/@lexical+code-core@0.44.0/node_modules/@lexical/code-core/LexicalCodeCore.mjs", "../../../node_modules/.pnpm/@lexical+code-prism@0.44.0/node_modules/@lexical/code-prism/LexicalCodePrism.prod.mjs", "../../../node_modules/.pnpm/@lexical+code-prism@0.44.0/node_modules/@lexical/code-prism/LexicalCodePrism.mjs", "../../../node_modules/.pnpm/@lexical+code@0.44.0/node_modules/@lexical/code/LexicalCode.mjs", "../../../node_modules/.pnpm/@lexical+markdown@0.44.0/node_modules/@lexical/markdown/LexicalMarkdown.dev.mjs", "../../../node_modules/.pnpm/@lexical+markdown@0.44.0/node_modules/@lexical/markdown/LexicalMarkdown.mjs", "../../../node_modules/.pnpm/@lexical+table@0.44.0/node_modules/@lexical/table/LexicalTable.dev.mjs", "../../../node_modules/.pnpm/@lexical+table@0.44.0/node_modules/@lexical/table/LexicalTable.mjs", "../../../node_modules/.pnpm/marked@16.4.2/node_modules/marked/src/defaults.ts", "../../../node_modules/.pnpm/marked@16.4.2/node_modules/marked/src/rules.ts", "../../../node_modules/.pnpm/marked@16.4.2/node_modules/marked/src/helpers.ts", "../../../node_modules/.pnpm/marked@16.4.2/node_modules/marked/src/Tokenizer.ts", "../../../node_modules/.pnpm/marked@16.4.2/node_modules/marked/src/Lexer.ts", "../../../node_modules/.pnpm/marked@16.4.2/node_modules/marked/src/Renderer.ts", "../../../node_modules/.pnpm/marked@16.4.2/node_modules/marked/src/TextRenderer.ts", "../../../node_modules/.pnpm/marked@16.4.2/node_modules/marked/src/Parser.ts", "../../../node_modules/.pnpm/marked@16.4.2/node_modules/marked/src/Hooks.ts", "../../../node_modules/.pnpm/marked@16.4.2/node_modules/marked/src/Instance.ts", "../../../node_modules/.pnpm/marked@16.4.2/node_modules/marked/src/marked.ts", "../../../node_modules/.pnpm/@37signals+lexxy@1.0.1_@rails+activestorage@8.1.400/node_modules/@37signals/lexxy/dist/lexxy.esm.js"],
  "sourcesContent": ["\n/* **********************************************\n     Begin prism-core.js\n********************************************** */\n\n/// <reference lib=\"WebWorker\"/>\n\nvar _self = (typeof window !== 'undefined')\n\t? window   // if in browser\n\t: (\n\t\t(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)\n\t\t\t? self // if in worker\n\t\t\t: {}   // if in node js\n\t);\n\n/**\n * Prism: Lightweight, robust, elegant syntax highlighting\n *\n * @license MIT <https://opensource.org/licenses/MIT>\n * @author Lea Verou <https://lea.verou.me>\n * @namespace\n * @public\n */\nvar Prism = (function (_self) {\n\n\t// Private helper vars\n\tvar lang = /(?:^|\\s)lang(?:uage)?-([\\w-]+)(?=\\s|$)/i;\n\tvar uniqueId = 0;\n\n\t// The grammar object for plaintext\n\tvar plainTextGrammar = {};\n\n\n\tvar _ = {\n\t\t/**\n\t\t * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the\n\t\t * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load\n\t\t * additional languages or plugins yourself.\n\t\t *\n\t\t * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.\n\t\t *\n\t\t * You obviously have to change this value before the automatic highlighting started. To do this, you can add an\n\t\t * empty Prism object into the global scope before loading the Prism script like this:\n\t\t *\n\t\t * ```js\n\t\t * window.Prism = window.Prism || {};\n\t\t * Prism.manual = true;\n\t\t * // add a new <script> to load Prism's script\n\t\t * ```\n\t\t *\n\t\t * @default false\n\t\t * @type {boolean}\n\t\t * @memberof Prism\n\t\t * @public\n\t\t */\n\t\tmanual: _self.Prism && _self.Prism.manual,\n\t\t/**\n\t\t * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses\n\t\t * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your\n\t\t * own worker, you don't want it to do this.\n\t\t *\n\t\t * By setting this value to `true`, Prism will not add its own listeners to the worker.\n\t\t *\n\t\t * You obviously have to change this value before Prism executes. To do this, you can add an\n\t\t * empty Prism object into the global scope before loading the Prism script like this:\n\t\t *\n\t\t * ```js\n\t\t * window.Prism = window.Prism || {};\n\t\t * Prism.disableWorkerMessageHandler = true;\n\t\t * // Load Prism's script\n\t\t * ```\n\t\t *\n\t\t * @default false\n\t\t * @type {boolean}\n\t\t * @memberof Prism\n\t\t * @public\n\t\t */\n\t\tdisableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,\n\n\t\t/**\n\t\t * A namespace for utility methods.\n\t\t *\n\t\t * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may\n\t\t * change or disappear at any time.\n\t\t *\n\t\t * @namespace\n\t\t * @memberof Prism\n\t\t */\n\t\tutil: {\n\t\t\tencode: function encode(tokens) {\n\t\t\t\tif (tokens instanceof Token) {\n\t\t\t\t\treturn new Token(tokens.type, encode(tokens.content), tokens.alias);\n\t\t\t\t} else if (Array.isArray(tokens)) {\n\t\t\t\t\treturn tokens.map(encode);\n\t\t\t\t} else {\n\t\t\t\t\treturn tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\\u00a0/g, ' ');\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Returns the name of the type of the given value.\n\t\t\t *\n\t\t\t * @param {any} o\n\t\t\t * @returns {string}\n\t\t\t * @example\n\t\t\t * type(null)      === 'Null'\n\t\t\t * type(undefined) === 'Undefined'\n\t\t\t * type(123)       === 'Number'\n\t\t\t * type('foo')     === 'String'\n\t\t\t * type(true)      === 'Boolean'\n\t\t\t * type([1, 2])    === 'Array'\n\t\t\t * type({})        === 'Object'\n\t\t\t * type(String)    === 'Function'\n\t\t\t * type(/abc+/)    === 'RegExp'\n\t\t\t */\n\t\t\ttype: function (o) {\n\t\t\t\treturn Object.prototype.toString.call(o).slice(8, -1);\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Returns a unique number for the given object. Later calls will still return the same number.\n\t\t\t *\n\t\t\t * @param {Object} obj\n\t\t\t * @returns {number}\n\t\t\t */\n\t\t\tobjId: function (obj) {\n\t\t\t\tif (!obj['__id']) {\n\t\t\t\t\tObject.defineProperty(obj, '__id', { value: ++uniqueId });\n\t\t\t\t}\n\t\t\t\treturn obj['__id'];\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Creates a deep clone of the given object.\n\t\t\t *\n\t\t\t * The main intended use of this function is to clone language definitions.\n\t\t\t *\n\t\t\t * @param {T} o\n\t\t\t * @param {Record<number, any>} [visited]\n\t\t\t * @returns {T}\n\t\t\t * @template T\n\t\t\t */\n\t\t\tclone: function deepClone(o, visited) {\n\t\t\t\tvisited = visited || {};\n\n\t\t\t\tvar clone; var id;\n\t\t\t\tswitch (_.util.type(o)) {\n\t\t\t\t\tcase 'Object':\n\t\t\t\t\t\tid = _.util.objId(o);\n\t\t\t\t\t\tif (visited[id]) {\n\t\t\t\t\t\t\treturn visited[id];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclone = /** @type {Record<string, any>} */ ({});\n\t\t\t\t\t\tvisited[id] = clone;\n\n\t\t\t\t\t\tfor (var key in o) {\n\t\t\t\t\t\t\tif (o.hasOwnProperty(key)) {\n\t\t\t\t\t\t\t\tclone[key] = deepClone(o[key], visited);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn /** @type {any} */ (clone);\n\n\t\t\t\t\tcase 'Array':\n\t\t\t\t\t\tid = _.util.objId(o);\n\t\t\t\t\t\tif (visited[id]) {\n\t\t\t\t\t\t\treturn visited[id];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclone = [];\n\t\t\t\t\t\tvisited[id] = clone;\n\n\t\t\t\t\t\t(/** @type {Array} */(/** @type {any} */(o))).forEach(function (v, i) {\n\t\t\t\t\t\t\tclone[i] = deepClone(v, visited);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn /** @type {any} */ (clone);\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn o;\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.\n\t\t\t *\n\t\t\t * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.\n\t\t\t *\n\t\t\t * @param {Element} element\n\t\t\t * @returns {string}\n\t\t\t */\n\t\t\tgetLanguage: function (element) {\n\t\t\t\twhile (element) {\n\t\t\t\t\tvar m = lang.exec(element.className);\n\t\t\t\t\tif (m) {\n\t\t\t\t\t\treturn m[1].toLowerCase();\n\t\t\t\t\t}\n\t\t\t\t\telement = element.parentElement;\n\t\t\t\t}\n\t\t\t\treturn 'none';\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Sets the Prism `language-xxxx` class of the given element.\n\t\t\t *\n\t\t\t * @param {Element} element\n\t\t\t * @param {string} language\n\t\t\t * @returns {void}\n\t\t\t */\n\t\t\tsetLanguage: function (element, language) {\n\t\t\t\t// remove all `language-xxxx` classes\n\t\t\t\t// (this might leave behind a leading space)\n\t\t\t\telement.className = element.className.replace(RegExp(lang, 'gi'), '');\n\n\t\t\t\t// add the new `language-xxxx` class\n\t\t\t\t// (using `classList` will automatically clean up spaces for us)\n\t\t\t\telement.classList.add('language-' + language);\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Returns the script element that is currently executing.\n\t\t\t *\n\t\t\t * This does __not__ work for line script element.\n\t\t\t *\n\t\t\t * @returns {HTMLScriptElement | null}\n\t\t\t */\n\t\t\tcurrentScript: function () {\n\t\t\t\tif (typeof document === 'undefined') {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tif (document.currentScript && document.currentScript.tagName === 'SCRIPT' && 1 < 2 /* hack to trip TS' flow analysis */) {\n\t\t\t\t\treturn /** @type {any} */ (document.currentScript);\n\t\t\t\t}\n\n\t\t\t\t// IE11 workaround\n\t\t\t\t// we'll get the src of the current script by parsing IE11's error stack trace\n\t\t\t\t// this will not work for inline scripts\n\n\t\t\t\ttry {\n\t\t\t\t\tthrow new Error();\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// Get file src url from stack. Specifically works with the format of stack traces in IE.\n\t\t\t\t\t// A stack will look like this:\n\t\t\t\t\t//\n\t\t\t\t\t// Error\n\t\t\t\t\t//    at _.util.currentScript (http://localhost/components/prism-core.js:119:5)\n\t\t\t\t\t//    at Global code (http://localhost/components/prism-core.js:606:1)\n\n\t\t\t\t\tvar src = (/at [^(\\r\\n]*\\((.*):[^:]+:[^:]+\\)$/i.exec(err.stack) || [])[1];\n\t\t\t\t\tif (src) {\n\t\t\t\t\t\tvar scripts = document.getElementsByTagName('script');\n\t\t\t\t\t\tfor (var i in scripts) {\n\t\t\t\t\t\t\tif (scripts[i].src == src) {\n\t\t\t\t\t\t\t\treturn scripts[i];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Returns whether a given class is active for `element`.\n\t\t\t *\n\t\t\t * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated\n\t\t\t * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the\n\t\t\t * given class is just the given class with a `no-` prefix.\n\t\t\t *\n\t\t\t * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is\n\t\t\t * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its\n\t\t\t * ancestors have the given class or the negated version of it, then the default activation will be returned.\n\t\t\t *\n\t\t\t * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated\n\t\t\t * version of it, the class is considered active.\n\t\t\t *\n\t\t\t * @param {Element} element\n\t\t\t * @param {string} className\n\t\t\t * @param {boolean} [defaultActivation=false]\n\t\t\t * @returns {boolean}\n\t\t\t */\n\t\t\tisActive: function (element, className, defaultActivation) {\n\t\t\t\tvar no = 'no-' + className;\n\n\t\t\t\twhile (element) {\n\t\t\t\t\tvar classList = element.classList;\n\t\t\t\t\tif (classList.contains(className)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\tif (classList.contains(no)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\telement = element.parentElement;\n\t\t\t\t}\n\t\t\t\treturn !!defaultActivation;\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.\n\t\t *\n\t\t * @namespace\n\t\t * @memberof Prism\n\t\t * @public\n\t\t */\n\t\tlanguages: {\n\t\t\t/**\n\t\t\t * The grammar for plain, unformatted text.\n\t\t\t */\n\t\t\tplain: plainTextGrammar,\n\t\t\tplaintext: plainTextGrammar,\n\t\t\ttext: plainTextGrammar,\n\t\t\ttxt: plainTextGrammar,\n\n\t\t\t/**\n\t\t\t * Creates a deep copy of the language with the given id and appends the given tokens.\n\t\t\t *\n\t\t\t * If a token in `redef` also appears in the copied language, then the existing token in the copied language\n\t\t\t * will be overwritten at its original position.\n\t\t\t *\n\t\t\t * ## Best practices\n\t\t\t *\n\t\t\t * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)\n\t\t\t * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to\n\t\t\t * understand the language definition because, normally, the order of tokens matters in Prism grammars.\n\t\t\t *\n\t\t\t * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.\n\t\t\t * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.\n\t\t\t *\n\t\t\t * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.\n\t\t\t * @param {Grammar} redef The new tokens to append.\n\t\t\t * @returns {Grammar} The new language created.\n\t\t\t * @public\n\t\t\t * @example\n\t\t\t * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {\n\t\t\t *     // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token\n\t\t\t *     // at its original position\n\t\t\t *     'comment': { ... },\n\t\t\t *     // CSS doesn't have a 'color' token, so this token will be appended\n\t\t\t *     'color': /\\b(?:red|green|blue)\\b/\n\t\t\t * });\n\t\t\t */\n\t\t\textend: function (id, redef) {\n\t\t\t\tvar lang = _.util.clone(_.languages[id]);\n\n\t\t\t\tfor (var key in redef) {\n\t\t\t\t\tlang[key] = redef[key];\n\t\t\t\t}\n\n\t\t\t\treturn lang;\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Inserts tokens _before_ another token in a language definition or any other grammar.\n\t\t\t *\n\t\t\t * ## Usage\n\t\t\t *\n\t\t\t * This helper method makes it easy to modify existing languages. For example, the CSS language definition\n\t\t\t * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded\n\t\t\t * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the\n\t\t\t * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do\n\t\t\t * this:\n\t\t\t *\n\t\t\t * ```js\n\t\t\t * Prism.languages.markup.style = {\n\t\t\t *     // token\n\t\t\t * };\n\t\t\t * ```\n\t\t\t *\n\t\t\t * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens\n\t\t\t * before existing tokens. For the CSS example above, you would use it like this:\n\t\t\t *\n\t\t\t * ```js\n\t\t\t * Prism.languages.insertBefore('markup', 'cdata', {\n\t\t\t *     'style': {\n\t\t\t *         // token\n\t\t\t *     }\n\t\t\t * });\n\t\t\t * ```\n\t\t\t *\n\t\t\t * ## Special cases\n\t\t\t *\n\t\t\t * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar\n\t\t\t * will be ignored.\n\t\t\t *\n\t\t\t * This behavior can be used to insert tokens after `before`:\n\t\t\t *\n\t\t\t * ```js\n\t\t\t * Prism.languages.insertBefore('markup', 'comment', {\n\t\t\t *     'comment': Prism.languages.markup.comment,\n\t\t\t *     // tokens after 'comment'\n\t\t\t * });\n\t\t\t * ```\n\t\t\t *\n\t\t\t * ## Limitations\n\t\t\t *\n\t\t\t * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object\n\t\t\t * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave\n\t\t\t * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily\n\t\t\t * deleting properties which is necessary to insert at arbitrary positions.\n\t\t\t *\n\t\t\t * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.\n\t\t\t * Instead, it will create a new object and replace all references to the target object with the new one. This\n\t\t\t * can be done without temporarily deleting properties, so the iteration order is well-defined.\n\t\t\t *\n\t\t\t * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if\n\t\t\t * you hold the target object in a variable, then the value of the variable will not change.\n\t\t\t *\n\t\t\t * ```js\n\t\t\t * var oldMarkup = Prism.languages.markup;\n\t\t\t * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });\n\t\t\t *\n\t\t\t * assert(oldMarkup !== Prism.languages.markup);\n\t\t\t * assert(newMarkup === Prism.languages.markup);\n\t\t\t * ```\n\t\t\t *\n\t\t\t * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the\n\t\t\t * object to be modified.\n\t\t\t * @param {string} before The key to insert before.\n\t\t\t * @param {Grammar} insert An object containing the key-value pairs to be inserted.\n\t\t\t * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the\n\t\t\t * object to be modified.\n\t\t\t *\n\t\t\t * Defaults to `Prism.languages`.\n\t\t\t * @returns {Grammar} The new grammar object.\n\t\t\t * @public\n\t\t\t */\n\t\t\tinsertBefore: function (inside, before, insert, root) {\n\t\t\t\troot = root || /** @type {any} */ (_.languages);\n\t\t\t\tvar grammar = root[inside];\n\t\t\t\t/** @type {Grammar} */\n\t\t\t\tvar ret = {};\n\n\t\t\t\tfor (var token in grammar) {\n\t\t\t\t\tif (grammar.hasOwnProperty(token)) {\n\n\t\t\t\t\t\tif (token == before) {\n\t\t\t\t\t\t\tfor (var newToken in insert) {\n\t\t\t\t\t\t\t\tif (insert.hasOwnProperty(newToken)) {\n\t\t\t\t\t\t\t\t\tret[newToken] = insert[newToken];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Do not insert token which also occur in insert. See #1525\n\t\t\t\t\t\tif (!insert.hasOwnProperty(token)) {\n\t\t\t\t\t\t\tret[token] = grammar[token];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar old = root[inside];\n\t\t\t\troot[inside] = ret;\n\n\t\t\t\t// Update references in other language definitions\n\t\t\t\t_.languages.DFS(_.languages, function (key, value) {\n\t\t\t\t\tif (value === old && key != inside) {\n\t\t\t\t\t\tthis[key] = ret;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn ret;\n\t\t\t},\n\n\t\t\t// Traverse a language definition with Depth First Search\n\t\t\tDFS: function DFS(o, callback, type, visited) {\n\t\t\t\tvisited = visited || {};\n\n\t\t\t\tvar objId = _.util.objId;\n\n\t\t\t\tfor (var i in o) {\n\t\t\t\t\tif (o.hasOwnProperty(i)) {\n\t\t\t\t\t\tcallback.call(o, i, o[i], type || i);\n\n\t\t\t\t\t\tvar property = o[i];\n\t\t\t\t\t\tvar propertyType = _.util.type(property);\n\n\t\t\t\t\t\tif (propertyType === 'Object' && !visited[objId(property)]) {\n\t\t\t\t\t\t\tvisited[objId(property)] = true;\n\t\t\t\t\t\t\tDFS(property, callback, null, visited);\n\t\t\t\t\t\t} else if (propertyType === 'Array' && !visited[objId(property)]) {\n\t\t\t\t\t\t\tvisited[objId(property)] = true;\n\t\t\t\t\t\t\tDFS(property, callback, i, visited);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tplugins: {},\n\n\t\t/**\n\t\t * This is the most high-level function in Prism\u2019s API.\n\t\t * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on\n\t\t * each one of them.\n\t\t *\n\t\t * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.\n\t\t *\n\t\t * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.\n\t\t * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.\n\t\t * @memberof Prism\n\t\t * @public\n\t\t */\n\t\thighlightAll: function (async, callback) {\n\t\t\t_.highlightAllUnder(document, async, callback);\n\t\t},\n\n\t\t/**\n\t\t * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls\n\t\t * {@link Prism.highlightElement} on each one of them.\n\t\t *\n\t\t * The following hooks will be run:\n\t\t * 1. `before-highlightall`\n\t\t * 2. `before-all-elements-highlight`\n\t\t * 3. All hooks of {@link Prism.highlightElement} for each element.\n\t\t *\n\t\t * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.\n\t\t * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.\n\t\t * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.\n\t\t * @memberof Prism\n\t\t * @public\n\t\t */\n\t\thighlightAllUnder: function (container, async, callback) {\n\t\t\tvar env = {\n\t\t\t\tcallback: callback,\n\t\t\t\tcontainer: container,\n\t\t\t\tselector: 'code[class*=\"language-\"], [class*=\"language-\"] code, code[class*=\"lang-\"], [class*=\"lang-\"] code'\n\t\t\t};\n\n\t\t\t_.hooks.run('before-highlightall', env);\n\n\t\t\tenv.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));\n\n\t\t\t_.hooks.run('before-all-elements-highlight', env);\n\n\t\t\tfor (var i = 0, element; (element = env.elements[i++]);) {\n\t\t\t\t_.highlightElement(element, async === true, env.callback);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Highlights the code inside a single element.\n\t\t *\n\t\t * The following hooks will be run:\n\t\t * 1. `before-sanity-check`\n\t\t * 2. `before-highlight`\n\t\t * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.\n\t\t * 4. `before-insert`\n\t\t * 5. `after-highlight`\n\t\t * 6. `complete`\n\t\t *\n\t\t * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for\n\t\t * the element's language.\n\t\t *\n\t\t * @param {Element} element The element containing the code.\n\t\t * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.\n\t\t * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers\n\t\t * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is\n\t\t * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).\n\t\t *\n\t\t * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for\n\t\t * asynchronous highlighting to work. You can build your own bundle on the\n\t\t * [Download page](https://prismjs.com/download.html).\n\t\t * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.\n\t\t * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.\n\t\t * @memberof Prism\n\t\t * @public\n\t\t */\n\t\thighlightElement: function (element, async, callback) {\n\t\t\t// Find language\n\t\t\tvar language = _.util.getLanguage(element);\n\t\t\tvar grammar = _.languages[language];\n\n\t\t\t// Set language on the element, if not present\n\t\t\t_.util.setLanguage(element, language);\n\n\t\t\t// Set language on the parent, for styling\n\t\t\tvar parent = element.parentElement;\n\t\t\tif (parent && parent.nodeName.toLowerCase() === 'pre') {\n\t\t\t\t_.util.setLanguage(parent, language);\n\t\t\t}\n\n\t\t\tvar code = element.textContent;\n\n\t\t\tvar env = {\n\t\t\t\telement: element,\n\t\t\t\tlanguage: language,\n\t\t\t\tgrammar: grammar,\n\t\t\t\tcode: code\n\t\t\t};\n\n\t\t\tfunction insertHighlightedCode(highlightedCode) {\n\t\t\t\tenv.highlightedCode = highlightedCode;\n\n\t\t\t\t_.hooks.run('before-insert', env);\n\n\t\t\t\tenv.element.innerHTML = env.highlightedCode;\n\n\t\t\t\t_.hooks.run('after-highlight', env);\n\t\t\t\t_.hooks.run('complete', env);\n\t\t\t\tcallback && callback.call(env.element);\n\t\t\t}\n\n\t\t\t_.hooks.run('before-sanity-check', env);\n\n\t\t\t// plugins may change/add the parent/element\n\t\t\tparent = env.element.parentElement;\n\t\t\tif (parent && parent.nodeName.toLowerCase() === 'pre' && !parent.hasAttribute('tabindex')) {\n\t\t\t\tparent.setAttribute('tabindex', '0');\n\t\t\t}\n\n\t\t\tif (!env.code) {\n\t\t\t\t_.hooks.run('complete', env);\n\t\t\t\tcallback && callback.call(env.element);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_.hooks.run('before-highlight', env);\n\n\t\t\tif (!env.grammar) {\n\t\t\t\tinsertHighlightedCode(_.util.encode(env.code));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (async && _self.Worker) {\n\t\t\t\tvar worker = new Worker(_.filename);\n\n\t\t\t\tworker.onmessage = function (evt) {\n\t\t\t\t\tinsertHighlightedCode(evt.data);\n\t\t\t\t};\n\n\t\t\t\tworker.postMessage(JSON.stringify({\n\t\t\t\t\tlanguage: env.language,\n\t\t\t\t\tcode: env.code,\n\t\t\t\t\timmediateClose: true\n\t\t\t\t}));\n\t\t\t} else {\n\t\t\t\tinsertHighlightedCode(_.highlight(env.code, env.grammar, env.language));\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Low-level function, only use if you know what you\u2019re doing. It accepts a string of text as input\n\t\t * and the language definitions to use, and returns a string with the HTML produced.\n\t\t *\n\t\t * The following hooks will be run:\n\t\t * 1. `before-tokenize`\n\t\t * 2. `after-tokenize`\n\t\t * 3. `wrap`: On each {@link Token}.\n\t\t *\n\t\t * @param {string} text A string with the code to be highlighted.\n\t\t * @param {Grammar} grammar An object containing the tokens to use.\n\t\t *\n\t\t * Usually a language definition like `Prism.languages.markup`.\n\t\t * @param {string} language The name of the language definition passed to `grammar`.\n\t\t * @returns {string} The highlighted HTML.\n\t\t * @memberof Prism\n\t\t * @public\n\t\t * @example\n\t\t * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');\n\t\t */\n\t\thighlight: function (text, grammar, language) {\n\t\t\tvar env = {\n\t\t\t\tcode: text,\n\t\t\t\tgrammar: grammar,\n\t\t\t\tlanguage: language\n\t\t\t};\n\t\t\t_.hooks.run('before-tokenize', env);\n\t\t\tif (!env.grammar) {\n\t\t\t\tthrow new Error('The language \"' + env.language + '\" has no grammar.');\n\t\t\t}\n\t\t\tenv.tokens = _.tokenize(env.code, env.grammar);\n\t\t\t_.hooks.run('after-tokenize', env);\n\t\t\treturn Token.stringify(_.util.encode(env.tokens), env.language);\n\t\t},\n\n\t\t/**\n\t\t * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input\n\t\t * and the language definitions to use, and returns an array with the tokenized code.\n\t\t *\n\t\t * When the language definition includes nested tokens, the function is called recursively on each of these tokens.\n\t\t *\n\t\t * This method could be useful in other contexts as well, as a very crude parser.\n\t\t *\n\t\t * @param {string} text A string with the code to be highlighted.\n\t\t * @param {Grammar} grammar An object containing the tokens to use.\n\t\t *\n\t\t * Usually a language definition like `Prism.languages.markup`.\n\t\t * @returns {TokenStream} An array of strings and tokens, a token stream.\n\t\t * @memberof Prism\n\t\t * @public\n\t\t * @example\n\t\t * let code = `var foo = 0;`;\n\t\t * let tokens = Prism.tokenize(code, Prism.languages.javascript);\n\t\t * tokens.forEach(token => {\n\t\t *     if (token instanceof Prism.Token && token.type === 'number') {\n\t\t *         console.log(`Found numeric literal: ${token.content}`);\n\t\t *     }\n\t\t * });\n\t\t */\n\t\ttokenize: function (text, grammar) {\n\t\t\tvar rest = grammar.rest;\n\t\t\tif (rest) {\n\t\t\t\tfor (var token in rest) {\n\t\t\t\t\tgrammar[token] = rest[token];\n\t\t\t\t}\n\n\t\t\t\tdelete grammar.rest;\n\t\t\t}\n\n\t\t\tvar tokenList = new LinkedList();\n\t\t\taddAfter(tokenList, tokenList.head, text);\n\n\t\t\tmatchGrammar(text, tokenList, grammar, tokenList.head, 0);\n\n\t\t\treturn toArray(tokenList);\n\t\t},\n\n\t\t/**\n\t\t * @namespace\n\t\t * @memberof Prism\n\t\t * @public\n\t\t */\n\t\thooks: {\n\t\t\tall: {},\n\n\t\t\t/**\n\t\t\t * Adds the given callback to the list of callbacks for the given hook.\n\t\t\t *\n\t\t\t * The callback will be invoked when the hook it is registered for is run.\n\t\t\t * Hooks are usually directly run by a highlight function but you can also run hooks yourself.\n\t\t\t *\n\t\t\t * One callback function can be registered to multiple hooks and the same hook multiple times.\n\t\t\t *\n\t\t\t * @param {string} name The name of the hook.\n\t\t\t * @param {HookCallback} callback The callback function which is given environment variables.\n\t\t\t * @public\n\t\t\t */\n\t\t\tadd: function (name, callback) {\n\t\t\t\tvar hooks = _.hooks.all;\n\n\t\t\t\thooks[name] = hooks[name] || [];\n\n\t\t\t\thooks[name].push(callback);\n\t\t\t},\n\n\t\t\t/**\n\t\t\t * Runs a hook invoking all registered callbacks with the given environment variables.\n\t\t\t *\n\t\t\t * Callbacks will be invoked synchronously and in the order in which they were registered.\n\t\t\t *\n\t\t\t * @param {string} name The name of the hook.\n\t\t\t * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.\n\t\t\t * @public\n\t\t\t */\n\t\t\trun: function (name, env) {\n\t\t\t\tvar callbacks = _.hooks.all[name];\n\n\t\t\t\tif (!callbacks || !callbacks.length) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfor (var i = 0, callback; (callback = callbacks[i++]);) {\n\t\t\t\t\tcallback(env);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tToken: Token\n\t};\n\t_self.Prism = _;\n\n\n\t// Typescript note:\n\t// The following can be used to import the Token type in JSDoc:\n\t//\n\t//   @typedef {InstanceType<import(\"./prism-core\")[\"Token\"]>} Token\n\n\t/**\n\t * Creates a new token.\n\t *\n\t * @param {string} type See {@link Token#type type}\n\t * @param {string | TokenStream} content See {@link Token#content content}\n\t * @param {string|string[]} [alias] The alias(es) of the token.\n\t * @param {string} [matchedStr=\"\"] A copy of the full string this token was created from.\n\t * @class\n\t * @global\n\t * @public\n\t */\n\tfunction Token(type, content, alias, matchedStr) {\n\t\t/**\n\t\t * The type of the token.\n\t\t *\n\t\t * This is usually the key of a pattern in a {@link Grammar}.\n\t\t *\n\t\t * @type {string}\n\t\t * @see GrammarToken\n\t\t * @public\n\t\t */\n\t\tthis.type = type;\n\t\t/**\n\t\t * The strings or tokens contained by this token.\n\t\t *\n\t\t * This will be a token stream if the pattern matched also defined an `inside` grammar.\n\t\t *\n\t\t * @type {string | TokenStream}\n\t\t * @public\n\t\t */\n\t\tthis.content = content;\n\t\t/**\n\t\t * The alias(es) of the token.\n\t\t *\n\t\t * @type {string|string[]}\n\t\t * @see GrammarToken\n\t\t * @public\n\t\t */\n\t\tthis.alias = alias;\n\t\t// Copy of the full string this token was created from\n\t\tthis.length = (matchedStr || '').length | 0;\n\t}\n\n\t/**\n\t * A token stream is an array of strings and {@link Token Token} objects.\n\t *\n\t * Token streams have to fulfill a few properties that are assumed by most functions (mostly internal ones) that process\n\t * them.\n\t *\n\t * 1. No adjacent strings.\n\t * 2. No empty strings.\n\t *\n\t *    The only exception here is the token stream that only contains the empty string and nothing else.\n\t *\n\t * @typedef {Array<string | Token>} TokenStream\n\t * @global\n\t * @public\n\t */\n\n\t/**\n\t * Converts the given token or token stream to an HTML representation.\n\t *\n\t * The following hooks will be run:\n\t * 1. `wrap`: On each {@link Token}.\n\t *\n\t * @param {string | Token | TokenStream} o The token or token stream to be converted.\n\t * @param {string} language The name of current language.\n\t * @returns {string} The HTML representation of the token or token stream.\n\t * @memberof Token\n\t * @static\n\t */\n\tToken.stringify = function stringify(o, language) {\n\t\tif (typeof o == 'string') {\n\t\t\treturn o;\n\t\t}\n\t\tif (Array.isArray(o)) {\n\t\t\tvar s = '';\n\t\t\to.forEach(function (e) {\n\t\t\t\ts += stringify(e, language);\n\t\t\t});\n\t\t\treturn s;\n\t\t}\n\n\t\tvar env = {\n\t\t\ttype: o.type,\n\t\t\tcontent: stringify(o.content, language),\n\t\t\ttag: 'span',\n\t\t\tclasses: ['token', o.type],\n\t\t\tattributes: {},\n\t\t\tlanguage: language\n\t\t};\n\n\t\tvar aliases = o.alias;\n\t\tif (aliases) {\n\t\t\tif (Array.isArray(aliases)) {\n\t\t\t\tArray.prototype.push.apply(env.classes, aliases);\n\t\t\t} else {\n\t\t\t\tenv.classes.push(aliases);\n\t\t\t}\n\t\t}\n\n\t\t_.hooks.run('wrap', env);\n\n\t\tvar attributes = '';\n\t\tfor (var name in env.attributes) {\n\t\t\tattributes += ' ' + name + '=\"' + (env.attributes[name] || '').replace(/\"/g, '&quot;') + '\"';\n\t\t}\n\n\t\treturn '<' + env.tag + ' class=\"' + env.classes.join(' ') + '\"' + attributes + '>' + env.content + '</' + env.tag + '>';\n\t};\n\n\t/**\n\t * @param {RegExp} pattern\n\t * @param {number} pos\n\t * @param {string} text\n\t * @param {boolean} lookbehind\n\t * @returns {RegExpExecArray | null}\n\t */\n\tfunction matchPattern(pattern, pos, text, lookbehind) {\n\t\tpattern.lastIndex = pos;\n\t\tvar match = pattern.exec(text);\n\t\tif (match && lookbehind && match[1]) {\n\t\t\t// change the match to remove the text matched by the Prism lookbehind group\n\t\t\tvar lookbehindLength = match[1].length;\n\t\t\tmatch.index += lookbehindLength;\n\t\t\tmatch[0] = match[0].slice(lookbehindLength);\n\t\t}\n\t\treturn match;\n\t}\n\n\t/**\n\t * @param {string} text\n\t * @param {LinkedList<string | Token>} tokenList\n\t * @param {any} grammar\n\t * @param {LinkedListNode<string | Token>} startNode\n\t * @param {number} startPos\n\t * @param {RematchOptions} [rematch]\n\t * @returns {void}\n\t * @private\n\t *\n\t * @typedef RematchOptions\n\t * @property {string} cause\n\t * @property {number} reach\n\t */\n\tfunction matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {\n\t\tfor (var token in grammar) {\n\t\t\tif (!grammar.hasOwnProperty(token) || !grammar[token]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar patterns = grammar[token];\n\t\t\tpatterns = Array.isArray(patterns) ? patterns : [patterns];\n\n\t\t\tfor (var j = 0; j < patterns.length; ++j) {\n\t\t\t\tif (rematch && rematch.cause == token + ',' + j) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar patternObj = patterns[j];\n\t\t\t\tvar inside = patternObj.inside;\n\t\t\t\tvar lookbehind = !!patternObj.lookbehind;\n\t\t\t\tvar greedy = !!patternObj.greedy;\n\t\t\t\tvar alias = patternObj.alias;\n\n\t\t\t\tif (greedy && !patternObj.pattern.global) {\n\t\t\t\t\t// Without the global flag, lastIndex won't work\n\t\t\t\t\tvar flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];\n\t\t\t\t\tpatternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g');\n\t\t\t\t}\n\n\t\t\t\t/** @type {RegExp} */\n\t\t\t\tvar pattern = patternObj.pattern || patternObj;\n\n\t\t\t\tfor ( // iterate the token list and keep track of the current token/string position\n\t\t\t\t\tvar currentNode = startNode.next, pos = startPos;\n\t\t\t\t\tcurrentNode !== tokenList.tail;\n\t\t\t\t\tpos += currentNode.value.length, currentNode = currentNode.next\n\t\t\t\t) {\n\n\t\t\t\t\tif (rematch && pos >= rematch.reach) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar str = currentNode.value;\n\n\t\t\t\t\tif (tokenList.length > text.length) {\n\t\t\t\t\t\t// Something went terribly wrong, ABORT, ABORT!\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (str instanceof Token) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar removeCount = 1; // this is the to parameter of removeBetween\n\t\t\t\t\tvar match;\n\n\t\t\t\t\tif (greedy) {\n\t\t\t\t\t\tmatch = matchPattern(pattern, pos, text, lookbehind);\n\t\t\t\t\t\tif (!match || match.index >= text.length) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar from = match.index;\n\t\t\t\t\t\tvar to = match.index + match[0].length;\n\t\t\t\t\t\tvar p = pos;\n\n\t\t\t\t\t\t// find the node that contains the match\n\t\t\t\t\t\tp += currentNode.value.length;\n\t\t\t\t\t\twhile (from >= p) {\n\t\t\t\t\t\t\tcurrentNode = currentNode.next;\n\t\t\t\t\t\t\tp += currentNode.value.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// adjust pos (and p)\n\t\t\t\t\t\tp -= currentNode.value.length;\n\t\t\t\t\t\tpos = p;\n\n\t\t\t\t\t\t// the current node is a Token, then the match starts inside another Token, which is invalid\n\t\t\t\t\t\tif (currentNode.value instanceof Token) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// find the last node which is affected by this match\n\t\t\t\t\t\tfor (\n\t\t\t\t\t\t\tvar k = currentNode;\n\t\t\t\t\t\t\tk !== tokenList.tail && (p < to || typeof k.value === 'string');\n\t\t\t\t\t\t\tk = k.next\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tremoveCount++;\n\t\t\t\t\t\t\tp += k.value.length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tremoveCount--;\n\n\t\t\t\t\t\t// replace with the new match\n\t\t\t\t\t\tstr = text.slice(pos, p);\n\t\t\t\t\t\tmatch.index -= pos;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmatch = matchPattern(pattern, 0, str, lookbehind);\n\t\t\t\t\t\tif (!match) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// eslint-disable-next-line no-redeclare\n\t\t\t\t\tvar from = match.index;\n\t\t\t\t\tvar matchStr = match[0];\n\t\t\t\t\tvar before = str.slice(0, from);\n\t\t\t\t\tvar after = str.slice(from + matchStr.length);\n\n\t\t\t\t\tvar reach = pos + str.length;\n\t\t\t\t\tif (rematch && reach > rematch.reach) {\n\t\t\t\t\t\trematch.reach = reach;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar removeFrom = currentNode.prev;\n\n\t\t\t\t\tif (before) {\n\t\t\t\t\t\tremoveFrom = addAfter(tokenList, removeFrom, before);\n\t\t\t\t\t\tpos += before.length;\n\t\t\t\t\t}\n\n\t\t\t\t\tremoveRange(tokenList, removeFrom, removeCount);\n\n\t\t\t\t\tvar wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);\n\t\t\t\t\tcurrentNode = addAfter(tokenList, removeFrom, wrapped);\n\n\t\t\t\t\tif (after) {\n\t\t\t\t\t\taddAfter(tokenList, currentNode, after);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (removeCount > 1) {\n\t\t\t\t\t\t// at least one Token object was removed, so we have to do some rematching\n\t\t\t\t\t\t// this can only happen if the current pattern is greedy\n\n\t\t\t\t\t\t/** @type {RematchOptions} */\n\t\t\t\t\t\tvar nestedRematch = {\n\t\t\t\t\t\t\tcause: token + ',' + j,\n\t\t\t\t\t\t\treach: reach\n\t\t\t\t\t\t};\n\t\t\t\t\t\tmatchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);\n\n\t\t\t\t\t\t// the reach might have been extended because of the rematching\n\t\t\t\t\t\tif (rematch && nestedRematch.reach > rematch.reach) {\n\t\t\t\t\t\t\trematch.reach = nestedRematch.reach;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @typedef LinkedListNode\n\t * @property {T} value\n\t * @property {LinkedListNode<T> | null} prev The previous node.\n\t * @property {LinkedListNode<T> | null} next The next node.\n\t * @template T\n\t * @private\n\t */\n\n\t/**\n\t * @template T\n\t * @private\n\t */\n\tfunction LinkedList() {\n\t\t/** @type {LinkedListNode<T>} */\n\t\tvar head = { value: null, prev: null, next: null };\n\t\t/** @type {LinkedListNode<T>} */\n\t\tvar tail = { value: null, prev: head, next: null };\n\t\thead.next = tail;\n\n\t\t/** @type {LinkedListNode<T>} */\n\t\tthis.head = head;\n\t\t/** @type {LinkedListNode<T>} */\n\t\tthis.tail = tail;\n\t\tthis.length = 0;\n\t}\n\n\t/**\n\t * Adds a new node with the given value to the list.\n\t *\n\t * @param {LinkedList<T>} list\n\t * @param {LinkedListNode<T>} node\n\t * @param {T} value\n\t * @returns {LinkedListNode<T>} The added node.\n\t * @template T\n\t */\n\tfunction addAfter(list, node, value) {\n\t\t// assumes that node != list.tail && values.length >= 0\n\t\tvar next = node.next;\n\n\t\tvar newNode = { value: value, prev: node, next: next };\n\t\tnode.next = newNode;\n\t\tnext.prev = newNode;\n\t\tlist.length++;\n\n\t\treturn newNode;\n\t}\n\t/**\n\t * Removes `count` nodes after the given node. The given node will not be removed.\n\t *\n\t * @param {LinkedList<T>} list\n\t * @param {LinkedListNode<T>} node\n\t * @param {number} count\n\t * @template T\n\t */\n\tfunction removeRange(list, node, count) {\n\t\tvar next = node.next;\n\t\tfor (var i = 0; i < count && next !== list.tail; i++) {\n\t\t\tnext = next.next;\n\t\t}\n\t\tnode.next = next;\n\t\tnext.prev = node;\n\t\tlist.length -= i;\n\t}\n\t/**\n\t * @param {LinkedList<T>} list\n\t * @returns {T[]}\n\t * @template T\n\t */\n\tfunction toArray(list) {\n\t\tvar array = [];\n\t\tvar node = list.head.next;\n\t\twhile (node !== list.tail) {\n\t\t\tarray.push(node.value);\n\t\t\tnode = node.next;\n\t\t}\n\t\treturn array;\n\t}\n\n\n\tif (!_self.document) {\n\t\tif (!_self.addEventListener) {\n\t\t\t// in Node.js\n\t\t\treturn _;\n\t\t}\n\n\t\tif (!_.disableWorkerMessageHandler) {\n\t\t\t// In worker\n\t\t\t_self.addEventListener('message', function (evt) {\n\t\t\t\tvar message = JSON.parse(evt.data);\n\t\t\t\tvar lang = message.language;\n\t\t\t\tvar code = message.code;\n\t\t\t\tvar immediateClose = message.immediateClose;\n\n\t\t\t\t_self.postMessage(_.highlight(code, _.languages[lang], lang));\n\t\t\t\tif (immediateClose) {\n\t\t\t\t\t_self.close();\n\t\t\t\t}\n\t\t\t}, false);\n\t\t}\n\n\t\treturn _;\n\t}\n\n\t// Get current script and highlight\n\tvar script = _.util.currentScript();\n\n\tif (script) {\n\t\t_.filename = script.src;\n\n\t\tif (script.hasAttribute('data-manual')) {\n\t\t\t_.manual = true;\n\t\t}\n\t}\n\n\tfunction highlightAutomaticallyCallback() {\n\t\tif (!_.manual) {\n\t\t\t_.highlightAll();\n\t\t}\n\t}\n\n\tif (!_.manual) {\n\t\t// If the document state is \"loading\", then we'll use DOMContentLoaded.\n\t\t// If the document state is \"interactive\" and the prism.js script is deferred, then we'll also use the\n\t\t// DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they\n\t\t// might take longer one animation frame to execute which can create a race condition where only some plugins have\n\t\t// been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.\n\t\t// See https://github.com/PrismJS/prism/issues/2102\n\t\tvar readyState = document.readyState;\n\t\tif (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {\n\t\t\tdocument.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);\n\t\t} else {\n\t\t\tif (window.requestAnimationFrame) {\n\t\t\t\twindow.requestAnimationFrame(highlightAutomaticallyCallback);\n\t\t\t} else {\n\t\t\t\twindow.setTimeout(highlightAutomaticallyCallback, 16);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn _;\n\n}(_self));\n\nif (typeof module !== 'undefined' && module.exports) {\n\tmodule.exports = Prism;\n}\n\n// hack for components to work correctly in node.js\nif (typeof global !== 'undefined') {\n\tglobal.Prism = Prism;\n}\n\n// some additional documentation/types\n\n/**\n * The expansion of a simple `RegExp` literal to support additional properties.\n *\n * @typedef GrammarToken\n * @property {RegExp} pattern The regular expression of the token.\n * @property {boolean} [lookbehind=false] If `true`, then the first capturing group of `pattern` will (effectively)\n * behave as a lookbehind group meaning that the captured text will not be part of the matched text of the new token.\n * @property {boolean} [greedy=false] Whether the token is greedy.\n * @property {string|string[]} [alias] An optional alias or list of aliases.\n * @property {Grammar} [inside] The nested grammar of this token.\n *\n * The `inside` grammar will be used to tokenize the text value of each token of this kind.\n *\n * This can be used to make nested and even recursive language definitions.\n *\n * Note: This can cause infinite recursion. Be careful when you embed different languages or even the same language into\n * each another.\n * @global\n * @public\n */\n\n/**\n * @typedef Grammar\n * @type {Object<string, RegExp | GrammarToken | Array<RegExp | GrammarToken>>}\n * @property {Grammar} [rest] An optional grammar object that will be appended to this grammar.\n * @global\n * @public\n */\n\n/**\n * A function which will invoked after an element was successfully highlighted.\n *\n * @callback HighlightCallback\n * @param {Element} element The element successfully highlighted.\n * @returns {void}\n * @global\n * @public\n */\n\n/**\n * @callback HookCallback\n * @param {Object<string, any>} env The environment variables of the hook.\n * @returns {void}\n * @global\n * @public\n */\n\n\n/* **********************************************\n     Begin prism-markup.js\n********************************************** */\n\nPrism.languages.markup = {\n\t'comment': {\n\t\tpattern: /<!--(?:(?!<!--)[\\s\\S])*?-->/,\n\t\tgreedy: true\n\t},\n\t'prolog': {\n\t\tpattern: /<\\?[\\s\\S]+?\\?>/,\n\t\tgreedy: true\n\t},\n\t'doctype': {\n\t\t// https://www.w3.org/TR/xml/#NT-doctypedecl\n\t\tpattern: /<!DOCTYPE(?:[^>\"'[\\]]|\"[^\"]*\"|'[^']*')+(?:\\[(?:[^<\"'\\]]|\"[^\"]*\"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\\]\\s*)?>/i,\n\t\tgreedy: true,\n\t\tinside: {\n\t\t\t'internal-subset': {\n\t\t\t\tpattern: /(^[^\\[]*\\[)[\\s\\S]+(?=\\]>$)/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: null // see below\n\t\t\t},\n\t\t\t'string': {\n\t\t\t\tpattern: /\"[^\"]*\"|'[^']*'/,\n\t\t\t\tgreedy: true\n\t\t\t},\n\t\t\t'punctuation': /^<!|>$|[[\\]]/,\n\t\t\t'doctype-tag': /^DOCTYPE/i,\n\t\t\t'name': /[^\\s<>'\"]+/\n\t\t}\n\t},\n\t'cdata': {\n\t\tpattern: /<!\\[CDATA\\[[\\s\\S]*?\\]\\]>/i,\n\t\tgreedy: true\n\t},\n\t'tag': {\n\t\tpattern: /<\\/?(?!\\d)[^\\s>\\/=$<%]+(?:\\s(?:\\s*[^\\s>\\/=]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))|(?=[\\s/>])))+)?\\s*\\/?>/,\n\t\tgreedy: true,\n\t\tinside: {\n\t\t\t'tag': {\n\t\t\t\tpattern: /^<\\/?[^\\s>\\/]+/,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': /^<\\/?/,\n\t\t\t\t\t'namespace': /^[^\\s>\\/:]+:/\n\t\t\t\t}\n\t\t\t},\n\t\t\t'special-attr': [],\n\t\t\t'attr-value': {\n\t\t\t\tpattern: /=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+)/,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: /^=/,\n\t\t\t\t\t\t\talias: 'attr-equals'\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: /^(\\s*)[\"']|[\"']$/,\n\t\t\t\t\t\t\tlookbehind: true\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t'punctuation': /\\/?>/,\n\t\t\t'attr-name': {\n\t\t\t\tpattern: /[^\\s>\\/]+/,\n\t\t\t\tinside: {\n\t\t\t\t\t'namespace': /^[^\\s>\\/:]+:/\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t},\n\t'entity': [\n\t\t{\n\t\t\tpattern: /&[\\da-z]{1,8};/i,\n\t\t\talias: 'named-entity'\n\t\t},\n\t\t/&#x?[\\da-f]{1,8};/i\n\t]\n};\n\nPrism.languages.markup['tag'].inside['attr-value'].inside['entity'] =\n\tPrism.languages.markup['entity'];\nPrism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;\n\n// Plugin to make entity title show the real entity, idea by Roman Komarov\nPrism.hooks.add('wrap', function (env) {\n\n\tif (env.type === 'entity') {\n\t\tenv.attributes['title'] = env.content.replace(/&amp;/, '&');\n\t}\n});\n\nObject.defineProperty(Prism.languages.markup.tag, 'addInlined', {\n\t/**\n\t * Adds an inlined language to markup.\n\t *\n\t * An example of an inlined language is CSS with `<style>` tags.\n\t *\n\t * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as\n\t * case insensitive.\n\t * @param {string} lang The language key.\n\t * @example\n\t * addInlined('style', 'css');\n\t */\n\tvalue: function addInlined(tagName, lang) {\n\t\tvar includedCdataInside = {};\n\t\tincludedCdataInside['language-' + lang] = {\n\t\t\tpattern: /(^<!\\[CDATA\\[)[\\s\\S]+?(?=\\]\\]>$)/i,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages[lang]\n\t\t};\n\t\tincludedCdataInside['cdata'] = /^<!\\[CDATA\\[|\\]\\]>$/i;\n\n\t\tvar inside = {\n\t\t\t'included-cdata': {\n\t\t\t\tpattern: /<!\\[CDATA\\[[\\s\\S]*?\\]\\]>/i,\n\t\t\t\tinside: includedCdataInside\n\t\t\t}\n\t\t};\n\t\tinside['language-' + lang] = {\n\t\t\tpattern: /[\\s\\S]+/,\n\t\t\tinside: Prism.languages[lang]\n\t\t};\n\n\t\tvar def = {};\n\t\tdef[tagName] = {\n\t\t\tpattern: RegExp(/(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: inside\n\t\t};\n\n\t\tPrism.languages.insertBefore('markup', 'cdata', def);\n\t}\n});\nObject.defineProperty(Prism.languages.markup.tag, 'addAttribute', {\n\t/**\n\t * Adds an pattern to highlight languages embedded in HTML attributes.\n\t *\n\t * An example of an inlined language is CSS with `style` attributes.\n\t *\n\t * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as\n\t * case insensitive.\n\t * @param {string} lang The language key.\n\t * @example\n\t * addAttribute('style', 'css');\n\t */\n\tvalue: function (attrName, lang) {\n\t\tPrism.languages.markup.tag.inside['special-attr'].push({\n\t\t\tpattern: RegExp(\n\t\t\t\t/(^|[\"'\\s])/.source + '(?:' + attrName + ')' + /\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))/.source,\n\t\t\t\t'i'\n\t\t\t),\n\t\t\tlookbehind: true,\n\t\t\tinside: {\n\t\t\t\t'attr-name': /^[^\\s=]+/,\n\t\t\t\t'attr-value': {\n\t\t\t\t\tpattern: /=[\\s\\S]+/,\n\t\t\t\t\tinside: {\n\t\t\t\t\t\t'value': {\n\t\t\t\t\t\t\tpattern: /(^=\\s*([\"']|(?![\"'])))\\S[\\s\\S]*(?=\\2$)/,\n\t\t\t\t\t\t\tlookbehind: true,\n\t\t\t\t\t\t\talias: [lang, 'language-' + lang],\n\t\t\t\t\t\t\tinside: Prism.languages[lang]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'punctuation': [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpattern: /^=/,\n\t\t\t\t\t\t\t\talias: 'attr-equals'\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t/\"|'/\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n});\n\nPrism.languages.html = Prism.languages.markup;\nPrism.languages.mathml = Prism.languages.markup;\nPrism.languages.svg = Prism.languages.markup;\n\nPrism.languages.xml = Prism.languages.extend('markup', {});\nPrism.languages.ssml = Prism.languages.xml;\nPrism.languages.atom = Prism.languages.xml;\nPrism.languages.rss = Prism.languages.xml;\n\n\n/* **********************************************\n     Begin prism-css.js\n********************************************** */\n\n(function (Prism) {\n\n\tvar string = /(?:\"(?:\\\\(?:\\r\\n|[\\s\\S])|[^\"\\\\\\r\\n])*\"|'(?:\\\\(?:\\r\\n|[\\s\\S])|[^'\\\\\\r\\n])*')/;\n\n\tPrism.languages.css = {\n\t\t'comment': /\\/\\*[\\s\\S]*?\\*\\//,\n\t\t'atrule': {\n\t\t\tpattern: RegExp('@[\\\\w-](?:' + /[^;{\\s\"']|\\s+(?!\\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\\s*\\{))/.source),\n\t\t\tinside: {\n\t\t\t\t'rule': /^@[\\w-]+/,\n\t\t\t\t'selector-function-argument': {\n\t\t\t\t\tpattern: /(\\bselector\\s*\\(\\s*(?![\\s)]))(?:[^()\\s]|\\s+(?![\\s)])|\\((?:[^()]|\\([^()]*\\))*\\))+(?=\\s*\\))/,\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\talias: 'selector'\n\t\t\t\t},\n\t\t\t\t'keyword': {\n\t\t\t\t\tpattern: /(^|[^\\w-])(?:and|not|only|or)(?![\\w-])/,\n\t\t\t\t\tlookbehind: true\n\t\t\t\t}\n\t\t\t\t// See rest below\n\t\t\t}\n\t\t},\n\t\t'url': {\n\t\t\t// https://drafts.csswg.org/css-values-3/#urls\n\t\t\tpattern: RegExp('\\\\burl\\\\((?:' + string.source + '|' + /(?:[^\\\\\\r\\n()\"']|\\\\[\\s\\S])*/.source + ')\\\\)', 'i'),\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'function': /^url/i,\n\t\t\t\t'punctuation': /^\\(|\\)$/,\n\t\t\t\t'string': {\n\t\t\t\t\tpattern: RegExp('^' + string.source + '$'),\n\t\t\t\t\talias: 'url'\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t'selector': {\n\t\t\tpattern: RegExp('(^|[{}\\\\s])[^{}\\\\s](?:[^{};\"\\'\\\\s]|\\\\s+(?![\\\\s{])|' + string.source + ')*(?=\\\\s*\\\\{)'),\n\t\t\tlookbehind: true\n\t\t},\n\t\t'string': {\n\t\t\tpattern: string,\n\t\t\tgreedy: true\n\t\t},\n\t\t'property': {\n\t\t\tpattern: /(^|[^-\\w\\xA0-\\uFFFF])(?!\\s)[-_a-z\\xA0-\\uFFFF](?:(?!\\s)[-\\w\\xA0-\\uFFFF])*(?=\\s*:)/i,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'important': /!important\\b/i,\n\t\t'function': {\n\t\t\tpattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\\()/i,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'punctuation': /[(){};:,]/\n\t};\n\n\tPrism.languages.css['atrule'].inside.rest = Prism.languages.css;\n\n\tvar markup = Prism.languages.markup;\n\tif (markup) {\n\t\tmarkup.tag.addInlined('style', 'css');\n\t\tmarkup.tag.addAttribute('style', 'css');\n\t}\n\n}(Prism));\n\n\n/* **********************************************\n     Begin prism-clike.js\n********************************************** */\n\nPrism.languages.clike = {\n\t'comment': [\n\t\t{\n\t\t\tpattern: /(^|[^\\\\])\\/\\*[\\s\\S]*?(?:\\*\\/|$)/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true\n\t\t},\n\t\t{\n\t\t\tpattern: /(^|[^\\\\:])\\/\\/.*/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true\n\t\t}\n\t],\n\t'string': {\n\t\tpattern: /([\"'])(?:\\\\(?:\\r\\n|[\\s\\S])|(?!\\1)[^\\\\\\r\\n])*\\1/,\n\t\tgreedy: true\n\t},\n\t'class-name': {\n\t\tpattern: /(\\b(?:class|extends|implements|instanceof|interface|new|trait)\\s+|\\bcatch\\s+\\()[\\w.\\\\]+/i,\n\t\tlookbehind: true,\n\t\tinside: {\n\t\t\t'punctuation': /[.\\\\]/\n\t\t}\n\t},\n\t'keyword': /\\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\\b/,\n\t'boolean': /\\b(?:false|true)\\b/,\n\t'function': /\\b\\w+(?=\\()/,\n\t'number': /\\b0x[\\da-f]+\\b|(?:\\b\\d+(?:\\.\\d*)?|\\B\\.\\d+)(?:e[+-]?\\d+)?/i,\n\t'operator': /[<>]=?|[!=]=?=?|--?|\\+\\+?|&&?|\\|\\|?|[?*/~^%]/,\n\t'punctuation': /[{}[\\];(),.:]/\n};\n\n\n/* **********************************************\n     Begin prism-javascript.js\n********************************************** */\n\nPrism.languages.javascript = Prism.languages.extend('clike', {\n\t'class-name': [\n\t\tPrism.languages.clike['class-name'],\n\t\t{\n\t\t\tpattern: /(^|[^$\\w\\xA0-\\uFFFF])(?!\\s)[_$A-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\.(?:constructor|prototype))/,\n\t\t\tlookbehind: true\n\t\t}\n\t],\n\t'keyword': [\n\t\t{\n\t\t\tpattern: /((?:^|\\})\\s*)catch\\b/,\n\t\t\tlookbehind: true\n\t\t},\n\t\t{\n\t\t\tpattern: /(^|[^.]|\\.\\.\\.\\s*)\\b(?:as|assert(?=\\s*\\{)|async(?=\\s*(?:function\\b|\\(|[$\\w\\xA0-\\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\\s*(?:\\{|$))|for|from(?=\\s*(?:['\"]|$))|function|(?:get|set)(?=\\s*(?:[#\\[$\\w\\xA0-\\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\\b/,\n\t\t\tlookbehind: true\n\t\t},\n\t],\n\t// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)\n\t'function': /#?(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\s*(?:\\.\\s*(?:apply|bind|call)\\s*)?\\()/,\n\t'number': {\n\t\tpattern: RegExp(\n\t\t\t/(^|[^\\w$])/.source +\n\t\t\t'(?:' +\n\t\t\t(\n\t\t\t\t// constant\n\t\t\t\t/NaN|Infinity/.source +\n\t\t\t\t'|' +\n\t\t\t\t// binary integer\n\t\t\t\t/0[bB][01]+(?:_[01]+)*n?/.source +\n\t\t\t\t'|' +\n\t\t\t\t// octal integer\n\t\t\t\t/0[oO][0-7]+(?:_[0-7]+)*n?/.source +\n\t\t\t\t'|' +\n\t\t\t\t// hexadecimal integer\n\t\t\t\t/0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?/.source +\n\t\t\t\t'|' +\n\t\t\t\t// decimal bigint\n\t\t\t\t/\\d+(?:_\\d+)*n/.source +\n\t\t\t\t'|' +\n\t\t\t\t// decimal number (integer or float) but no bigint\n\t\t\t\t/(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?/.source\n\t\t\t) +\n\t\t\t')' +\n\t\t\t/(?![\\w$])/.source\n\t\t),\n\t\tlookbehind: true\n\t},\n\t'operator': /--|\\+\\+|\\*\\*=?|=>|&&=?|\\|\\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\\.{3}|\\?\\?=?|\\?\\.?|[~:]/\n});\n\nPrism.languages.javascript['class-name'][0].pattern = /(\\b(?:class|extends|implements|instanceof|interface|new)\\s+)[\\w.\\\\]+/;\n\nPrism.languages.insertBefore('javascript', 'keyword', {\n\t'regex': {\n\t\tpattern: RegExp(\n\t\t\t// lookbehind\n\t\t\t// eslint-disable-next-line regexp/no-dupe-characters-character-class\n\t\t\t/((?:^|[^$\\w\\xA0-\\uFFFF.\"'\\])\\s]|\\b(?:return|yield))\\s*)/.source +\n\t\t\t// Regex pattern:\n\t\t\t// There are 2 regex patterns here. The RegExp set notation proposal added support for nested character\n\t\t\t// classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible\n\t\t\t// with the only syntax, so we have to define 2 different regex patterns.\n\t\t\t/\\//.source +\n\t\t\t'(?:' +\n\t\t\t/(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}/.source +\n\t\t\t'|' +\n\t\t\t// `v` flag syntax. This supports 3 levels of nested character classes.\n\t\t\t/(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source +\n\t\t\t')' +\n\t\t\t// lookahead\n\t\t\t/(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))/.source\n\t\t),\n\t\tlookbehind: true,\n\t\tgreedy: true,\n\t\tinside: {\n\t\t\t'regex-source': {\n\t\t\t\tpattern: /^(\\/)[\\s\\S]+(?=\\/[a-z]*$)/,\n\t\t\t\tlookbehind: true,\n\t\t\t\talias: 'language-regex',\n\t\t\t\tinside: Prism.languages.regex\n\t\t\t},\n\t\t\t'regex-delimiter': /^\\/|\\/$/,\n\t\t\t'regex-flags': /^[a-z]+$/,\n\t\t}\n\t},\n\t// This must be declared before keyword because we use \"function\" inside the look-forward\n\t'function-variable': {\n\t\tpattern: /#?(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\s*[=:]\\s*(?:async\\s*)?(?:\\bfunction\\b|(?:\\((?:[^()]|\\([^()]*\\))*\\)|(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*)\\s*=>))/,\n\t\talias: 'function'\n\t},\n\t'parameter': [\n\t\t{\n\t\t\tpattern: /(function(?:\\s+(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*)?\\s*\\(\\s*)(?!\\s)(?:[^()\\s]|\\s+(?![\\s)])|\\([^()]*\\))+(?=\\s*\\))/,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages.javascript\n\t\t},\n\t\t{\n\t\t\tpattern: /(^|[^$\\w\\xA0-\\uFFFF])(?!\\s)[_$a-z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\s*=>)/i,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages.javascript\n\t\t},\n\t\t{\n\t\t\tpattern: /(\\(\\s*)(?!\\s)(?:[^()\\s]|\\s+(?![\\s)])|\\([^()]*\\))+(?=\\s*\\)\\s*=>)/,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages.javascript\n\t\t},\n\t\t{\n\t\t\tpattern: /((?:\\b|\\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\\w\\xA0-\\uFFFF]))(?:(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*\\s*)\\(\\s*|\\]\\s*\\(\\s*)(?!\\s)(?:[^()\\s]|\\s+(?![\\s)])|\\([^()]*\\))+(?=\\s*\\)\\s*\\{)/,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages.javascript\n\t\t}\n\t],\n\t'constant': /\\b[A-Z](?:[A-Z_]|\\dx?)*\\b/\n});\n\nPrism.languages.insertBefore('javascript', 'string', {\n\t'hashbang': {\n\t\tpattern: /^#!.*/,\n\t\tgreedy: true,\n\t\talias: 'comment'\n\t},\n\t'template-string': {\n\t\tpattern: /`(?:\\\\[\\s\\S]|\\$\\{(?:[^{}]|\\{(?:[^{}]|\\{[^}]*\\})*\\})+\\}|(?!\\$\\{)[^\\\\`])*`/,\n\t\tgreedy: true,\n\t\tinside: {\n\t\t\t'template-punctuation': {\n\t\t\t\tpattern: /^`|`$/,\n\t\t\t\talias: 'string'\n\t\t\t},\n\t\t\t'interpolation': {\n\t\t\t\tpattern: /((?:^|[^\\\\])(?:\\\\{2})*)\\$\\{(?:[^{}]|\\{(?:[^{}]|\\{[^}]*\\})*\\})+\\}/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'interpolation-punctuation': {\n\t\t\t\t\t\tpattern: /^\\$\\{|\\}$/,\n\t\t\t\t\t\talias: 'punctuation'\n\t\t\t\t\t},\n\t\t\t\t\trest: Prism.languages.javascript\n\t\t\t\t}\n\t\t\t},\n\t\t\t'string': /[\\s\\S]+/\n\t\t}\n\t},\n\t'string-property': {\n\t\tpattern: /((?:^|[,{])[ \\t]*)([\"'])(?:\\\\(?:\\r\\n|[\\s\\S])|(?!\\2)[^\\\\\\r\\n])*\\2(?=\\s*:)/m,\n\t\tlookbehind: true,\n\t\tgreedy: true,\n\t\talias: 'property'\n\t}\n});\n\nPrism.languages.insertBefore('javascript', 'operator', {\n\t'literal-property': {\n\t\tpattern: /((?:^|[,{])[ \\t]*)(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\s*:)/m,\n\t\tlookbehind: true,\n\t\talias: 'property'\n\t},\n});\n\nif (Prism.languages.markup) {\n\tPrism.languages.markup.tag.addInlined('script', 'javascript');\n\n\t// add attribute support for all DOM events.\n\t// https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events\n\tPrism.languages.markup.tag.addAttribute(\n\t\t/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,\n\t\t'javascript'\n\t);\n}\n\nPrism.languages.js = Prism.languages.javascript;\n\n\n/* **********************************************\n     Begin prism-file-highlight.js\n********************************************** */\n\n(function () {\n\n\tif (typeof Prism === 'undefined' || typeof document === 'undefined') {\n\t\treturn;\n\t}\n\n\t// https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill\n\tif (!Element.prototype.matches) {\n\t\tElement.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\n\t}\n\n\tvar LOADING_MESSAGE = 'Loading\u2026';\n\tvar FAILURE_MESSAGE = function (status, message) {\n\t\treturn '\u2716 Error ' + status + ' while fetching file: ' + message;\n\t};\n\tvar FAILURE_EMPTY_MESSAGE = '\u2716 Error: File does not exist or is empty';\n\n\tvar EXTENSIONS = {\n\t\t'js': 'javascript',\n\t\t'py': 'python',\n\t\t'rb': 'ruby',\n\t\t'ps1': 'powershell',\n\t\t'psm1': 'powershell',\n\t\t'sh': 'bash',\n\t\t'bat': 'batch',\n\t\t'h': 'c',\n\t\t'tex': 'latex'\n\t};\n\n\tvar STATUS_ATTR = 'data-src-status';\n\tvar STATUS_LOADING = 'loading';\n\tvar STATUS_LOADED = 'loaded';\n\tvar STATUS_FAILED = 'failed';\n\n\tvar SELECTOR = 'pre[data-src]:not([' + STATUS_ATTR + '=\"' + STATUS_LOADED + '\"])'\n\t\t+ ':not([' + STATUS_ATTR + '=\"' + STATUS_LOADING + '\"])';\n\n\t/**\n\t * Loads the given file.\n\t *\n\t * @param {string} src The URL or path of the source file to load.\n\t * @param {(result: string) => void} success\n\t * @param {(reason: string) => void} error\n\t */\n\tfunction loadFile(src, success, error) {\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open('GET', src, true);\n\t\txhr.onreadystatechange = function () {\n\t\t\tif (xhr.readyState == 4) {\n\t\t\t\tif (xhr.status < 400 && xhr.responseText) {\n\t\t\t\t\tsuccess(xhr.responseText);\n\t\t\t\t} else {\n\t\t\t\t\tif (xhr.status >= 400) {\n\t\t\t\t\t\terror(FAILURE_MESSAGE(xhr.status, xhr.statusText));\n\t\t\t\t\t} else {\n\t\t\t\t\t\terror(FAILURE_EMPTY_MESSAGE);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\txhr.send(null);\n\t}\n\n\t/**\n\t * Parses the given range.\n\t *\n\t * This returns a range with inclusive ends.\n\t *\n\t * @param {string | null | undefined} range\n\t * @returns {[number, number | undefined] | undefined}\n\t */\n\tfunction parseRange(range) {\n\t\tvar m = /^\\s*(\\d+)\\s*(?:(,)\\s*(?:(\\d+)\\s*)?)?$/.exec(range || '');\n\t\tif (m) {\n\t\t\tvar start = Number(m[1]);\n\t\t\tvar comma = m[2];\n\t\t\tvar end = m[3];\n\n\t\t\tif (!comma) {\n\t\t\t\treturn [start, start];\n\t\t\t}\n\t\t\tif (!end) {\n\t\t\t\treturn [start, undefined];\n\t\t\t}\n\t\t\treturn [start, Number(end)];\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tPrism.hooks.add('before-highlightall', function (env) {\n\t\tenv.selector += ', ' + SELECTOR;\n\t});\n\n\tPrism.hooks.add('before-sanity-check', function (env) {\n\t\tvar pre = /** @type {HTMLPreElement} */ (env.element);\n\t\tif (pre.matches(SELECTOR)) {\n\t\t\tenv.code = ''; // fast-path the whole thing and go to complete\n\n\t\t\tpre.setAttribute(STATUS_ATTR, STATUS_LOADING); // mark as loading\n\n\t\t\t// add code element with loading message\n\t\t\tvar code = pre.appendChild(document.createElement('CODE'));\n\t\t\tcode.textContent = LOADING_MESSAGE;\n\n\t\t\tvar src = pre.getAttribute('data-src');\n\n\t\t\tvar language = env.language;\n\t\t\tif (language === 'none') {\n\t\t\t\t// the language might be 'none' because there is no language set;\n\t\t\t\t// in this case, we want to use the extension as the language\n\t\t\t\tvar extension = (/\\.(\\w+)$/.exec(src) || [, 'none'])[1];\n\t\t\t\tlanguage = EXTENSIONS[extension] || extension;\n\t\t\t}\n\n\t\t\t// set language classes\n\t\t\tPrism.util.setLanguage(code, language);\n\t\t\tPrism.util.setLanguage(pre, language);\n\n\t\t\t// preload the language\n\t\t\tvar autoloader = Prism.plugins.autoloader;\n\t\t\tif (autoloader) {\n\t\t\t\tautoloader.loadLanguages(language);\n\t\t\t}\n\n\t\t\t// load file\n\t\t\tloadFile(\n\t\t\t\tsrc,\n\t\t\t\tfunction (text) {\n\t\t\t\t\t// mark as loaded\n\t\t\t\t\tpre.setAttribute(STATUS_ATTR, STATUS_LOADED);\n\n\t\t\t\t\t// handle data-range\n\t\t\t\t\tvar range = parseRange(pre.getAttribute('data-range'));\n\t\t\t\t\tif (range) {\n\t\t\t\t\t\tvar lines = text.split(/\\r\\n?|\\n/g);\n\n\t\t\t\t\t\t// the range is one-based and inclusive on both ends\n\t\t\t\t\t\tvar start = range[0];\n\t\t\t\t\t\tvar end = range[1] == null ? lines.length : range[1];\n\n\t\t\t\t\t\tif (start < 0) { start += lines.length; }\n\t\t\t\t\t\tstart = Math.max(0, Math.min(start - 1, lines.length));\n\t\t\t\t\t\tif (end < 0) { end += lines.length; }\n\t\t\t\t\t\tend = Math.max(0, Math.min(end, lines.length));\n\n\t\t\t\t\t\ttext = lines.slice(start, end).join('\\n');\n\n\t\t\t\t\t\t// add data-start for line numbers\n\t\t\t\t\t\tif (!pre.hasAttribute('data-start')) {\n\t\t\t\t\t\t\tpre.setAttribute('data-start', String(start + 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// highlight code\n\t\t\t\t\tcode.textContent = text;\n\t\t\t\t\tPrism.highlightElement(code);\n\t\t\t\t},\n\t\t\t\tfunction (error) {\n\t\t\t\t\t// mark as failed\n\t\t\t\t\tpre.setAttribute(STATUS_ATTR, STATUS_FAILED);\n\n\t\t\t\t\tcode.textContent = error;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t});\n\n\tPrism.plugins.fileHighlight = {\n\t\t/**\n\t\t * Executes the File Highlight plugin for all matching `pre` elements under the given container.\n\t\t *\n\t\t * Note: Elements which are already loaded or currently loading will not be touched by this method.\n\t\t *\n\t\t * @param {ParentNode} [container=document]\n\t\t */\n\t\thighlight: function highlight(container) {\n\t\t\tvar elements = (container || document).querySelectorAll(SELECTOR);\n\n\t\t\tfor (var i = 0, element; (element = elements[i++]);) {\n\t\t\t\tPrism.highlightElement(element);\n\t\t\t}\n\t\t}\n\t};\n\n\tvar logged = false;\n\t/** @deprecated Use `Prism.plugins.fileHighlight.highlight` instead. */\n\tPrism.fileHighlight = function () {\n\t\tif (!logged) {\n\t\t\tconsole.warn('Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead.');\n\t\t\tlogged = true;\n\t\t}\n\t\tPrism.plugins.fileHighlight.highlight.apply(this, arguments);\n\t};\n\n}());\n", "var sparkMd5 = {\n  exports: {}\n};\n\n(function(module, exports) {\n  (function(factory) {\n    {\n      module.exports = factory();\n    }\n  })((function(undefined$1) {\n    var hex_chr = [ \"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\" ];\n    function md5cycle(x, k) {\n      var a = x[0], b = x[1], c = x[2], d = x[3];\n      a += (b & c | ~b & d) + k[0] - 680876936 | 0;\n      a = (a << 7 | a >>> 25) + b | 0;\n      d += (a & b | ~a & c) + k[1] - 389564586 | 0;\n      d = (d << 12 | d >>> 20) + a | 0;\n      c += (d & a | ~d & b) + k[2] + 606105819 | 0;\n      c = (c << 17 | c >>> 15) + d | 0;\n      b += (c & d | ~c & a) + k[3] - 1044525330 | 0;\n      b = (b << 22 | b >>> 10) + c | 0;\n      a += (b & c | ~b & d) + k[4] - 176418897 | 0;\n      a = (a << 7 | a >>> 25) + b | 0;\n      d += (a & b | ~a & c) + k[5] + 1200080426 | 0;\n      d = (d << 12 | d >>> 20) + a | 0;\n      c += (d & a | ~d & b) + k[6] - 1473231341 | 0;\n      c = (c << 17 | c >>> 15) + d | 0;\n      b += (c & d | ~c & a) + k[7] - 45705983 | 0;\n      b = (b << 22 | b >>> 10) + c | 0;\n      a += (b & c | ~b & d) + k[8] + 1770035416 | 0;\n      a = (a << 7 | a >>> 25) + b | 0;\n      d += (a & b | ~a & c) + k[9] - 1958414417 | 0;\n      d = (d << 12 | d >>> 20) + a | 0;\n      c += (d & a | ~d & b) + k[10] - 42063 | 0;\n      c = (c << 17 | c >>> 15) + d | 0;\n      b += (c & d | ~c & a) + k[11] - 1990404162 | 0;\n      b = (b << 22 | b >>> 10) + c | 0;\n      a += (b & c | ~b & d) + k[12] + 1804603682 | 0;\n      a = (a << 7 | a >>> 25) + b | 0;\n      d += (a & b | ~a & c) + k[13] - 40341101 | 0;\n      d = (d << 12 | d >>> 20) + a | 0;\n      c += (d & a | ~d & b) + k[14] - 1502002290 | 0;\n      c = (c << 17 | c >>> 15) + d | 0;\n      b += (c & d | ~c & a) + k[15] + 1236535329 | 0;\n      b = (b << 22 | b >>> 10) + c | 0;\n      a += (b & d | c & ~d) + k[1] - 165796510 | 0;\n      a = (a << 5 | a >>> 27) + b | 0;\n      d += (a & c | b & ~c) + k[6] - 1069501632 | 0;\n      d = (d << 9 | d >>> 23) + a | 0;\n      c += (d & b | a & ~b) + k[11] + 643717713 | 0;\n      c = (c << 14 | c >>> 18) + d | 0;\n      b += (c & a | d & ~a) + k[0] - 373897302 | 0;\n      b = (b << 20 | b >>> 12) + c | 0;\n      a += (b & d | c & ~d) + k[5] - 701558691 | 0;\n      a = (a << 5 | a >>> 27) + b | 0;\n      d += (a & c | b & ~c) + k[10] + 38016083 | 0;\n      d = (d << 9 | d >>> 23) + a | 0;\n      c += (d & b | a & ~b) + k[15] - 660478335 | 0;\n      c = (c << 14 | c >>> 18) + d | 0;\n      b += (c & a | d & ~a) + k[4] - 405537848 | 0;\n      b = (b << 20 | b >>> 12) + c | 0;\n      a += (b & d | c & ~d) + k[9] + 568446438 | 0;\n      a = (a << 5 | a >>> 27) + b | 0;\n      d += (a & c | b & ~c) + k[14] - 1019803690 | 0;\n      d = (d << 9 | d >>> 23) + a | 0;\n      c += (d & b | a & ~b) + k[3] - 187363961 | 0;\n      c = (c << 14 | c >>> 18) + d | 0;\n      b += (c & a | d & ~a) + k[8] + 1163531501 | 0;\n      b = (b << 20 | b >>> 12) + c | 0;\n      a += (b & d | c & ~d) + k[13] - 1444681467 | 0;\n      a = (a << 5 | a >>> 27) + b | 0;\n      d += (a & c | b & ~c) + k[2] - 51403784 | 0;\n      d = (d << 9 | d >>> 23) + a | 0;\n      c += (d & b | a & ~b) + k[7] + 1735328473 | 0;\n      c = (c << 14 | c >>> 18) + d | 0;\n      b += (c & a | d & ~a) + k[12] - 1926607734 | 0;\n      b = (b << 20 | b >>> 12) + c | 0;\n      a += (b ^ c ^ d) + k[5] - 378558 | 0;\n      a = (a << 4 | a >>> 28) + b | 0;\n      d += (a ^ b ^ c) + k[8] - 2022574463 | 0;\n      d = (d << 11 | d >>> 21) + a | 0;\n      c += (d ^ a ^ b) + k[11] + 1839030562 | 0;\n      c = (c << 16 | c >>> 16) + d | 0;\n      b += (c ^ d ^ a) + k[14] - 35309556 | 0;\n      b = (b << 23 | b >>> 9) + c | 0;\n      a += (b ^ c ^ d) + k[1] - 1530992060 | 0;\n      a = (a << 4 | a >>> 28) + b | 0;\n      d += (a ^ b ^ c) + k[4] + 1272893353 | 0;\n      d = (d << 11 | d >>> 21) + a | 0;\n      c += (d ^ a ^ b) + k[7] - 155497632 | 0;\n      c = (c << 16 | c >>> 16) + d | 0;\n      b += (c ^ d ^ a) + k[10] - 1094730640 | 0;\n      b = (b << 23 | b >>> 9) + c | 0;\n      a += (b ^ c ^ d) + k[13] + 681279174 | 0;\n      a = (a << 4 | a >>> 28) + b | 0;\n      d += (a ^ b ^ c) + k[0] - 358537222 | 0;\n      d = (d << 11 | d >>> 21) + a | 0;\n      c += (d ^ a ^ b) + k[3] - 722521979 | 0;\n      c = (c << 16 | c >>> 16) + d | 0;\n      b += (c ^ d ^ a) + k[6] + 76029189 | 0;\n      b = (b << 23 | b >>> 9) + c | 0;\n      a += (b ^ c ^ d) + k[9] - 640364487 | 0;\n      a = (a << 4 | a >>> 28) + b | 0;\n      d += (a ^ b ^ c) + k[12] - 421815835 | 0;\n      d = (d << 11 | d >>> 21) + a | 0;\n      c += (d ^ a ^ b) + k[15] + 530742520 | 0;\n      c = (c << 16 | c >>> 16) + d | 0;\n      b += (c ^ d ^ a) + k[2] - 995338651 | 0;\n      b = (b << 23 | b >>> 9) + c | 0;\n      a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;\n      a = (a << 6 | a >>> 26) + b | 0;\n      d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;\n      d = (d << 10 | d >>> 22) + a | 0;\n      c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;\n      c = (c << 15 | c >>> 17) + d | 0;\n      b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;\n      b = (b << 21 | b >>> 11) + c | 0;\n      a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;\n      a = (a << 6 | a >>> 26) + b | 0;\n      d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;\n      d = (d << 10 | d >>> 22) + a | 0;\n      c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;\n      c = (c << 15 | c >>> 17) + d | 0;\n      b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;\n      b = (b << 21 | b >>> 11) + c | 0;\n      a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;\n      a = (a << 6 | a >>> 26) + b | 0;\n      d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;\n      d = (d << 10 | d >>> 22) + a | 0;\n      c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;\n      c = (c << 15 | c >>> 17) + d | 0;\n      b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;\n      b = (b << 21 | b >>> 11) + c | 0;\n      a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;\n      a = (a << 6 | a >>> 26) + b | 0;\n      d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;\n      d = (d << 10 | d >>> 22) + a | 0;\n      c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;\n      c = (c << 15 | c >>> 17) + d | 0;\n      b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;\n      b = (b << 21 | b >>> 11) + c | 0;\n      x[0] = a + x[0] | 0;\n      x[1] = b + x[1] | 0;\n      x[2] = c + x[2] | 0;\n      x[3] = d + x[3] | 0;\n    }\n    function md5blk(s) {\n      var md5blks = [], i;\n      for (i = 0; i < 64; i += 4) {\n        md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);\n      }\n      return md5blks;\n    }\n    function md5blk_array(a) {\n      var md5blks = [], i;\n      for (i = 0; i < 64; i += 4) {\n        md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);\n      }\n      return md5blks;\n    }\n    function md51(s) {\n      var n = s.length, state = [ 1732584193, -271733879, -1732584194, 271733878 ], i, length, tail, tmp, lo, hi;\n      for (i = 64; i <= n; i += 64) {\n        md5cycle(state, md5blk(s.substring(i - 64, i)));\n      }\n      s = s.substring(i - 64);\n      length = s.length;\n      tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\n      for (i = 0; i < length; i += 1) {\n        tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);\n      }\n      tail[i >> 2] |= 128 << (i % 4 << 3);\n      if (i > 55) {\n        md5cycle(state, tail);\n        for (i = 0; i < 16; i += 1) {\n          tail[i] = 0;\n        }\n      }\n      tmp = n * 8;\n      tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n      lo = parseInt(tmp[2], 16);\n      hi = parseInt(tmp[1], 16) || 0;\n      tail[14] = lo;\n      tail[15] = hi;\n      md5cycle(state, tail);\n      return state;\n    }\n    function md51_array(a) {\n      var n = a.length, state = [ 1732584193, -271733879, -1732584194, 271733878 ], i, length, tail, tmp, lo, hi;\n      for (i = 64; i <= n; i += 64) {\n        md5cycle(state, md5blk_array(a.subarray(i - 64, i)));\n      }\n      a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0);\n      length = a.length;\n      tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\n      for (i = 0; i < length; i += 1) {\n        tail[i >> 2] |= a[i] << (i % 4 << 3);\n      }\n      tail[i >> 2] |= 128 << (i % 4 << 3);\n      if (i > 55) {\n        md5cycle(state, tail);\n        for (i = 0; i < 16; i += 1) {\n          tail[i] = 0;\n        }\n      }\n      tmp = n * 8;\n      tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n      lo = parseInt(tmp[2], 16);\n      hi = parseInt(tmp[1], 16) || 0;\n      tail[14] = lo;\n      tail[15] = hi;\n      md5cycle(state, tail);\n      return state;\n    }\n    function rhex(n) {\n      var s = \"\", j;\n      for (j = 0; j < 4; j += 1) {\n        s += hex_chr[n >> j * 8 + 4 & 15] + hex_chr[n >> j * 8 & 15];\n      }\n      return s;\n    }\n    function hex(x) {\n      var i;\n      for (i = 0; i < x.length; i += 1) {\n        x[i] = rhex(x[i]);\n      }\n      return x.join(\"\");\n    }\n    if (hex(md51(\"hello\")) !== \"5d41402abc4b2a76b9719d911017c592\") ;\n    if (typeof ArrayBuffer !== \"undefined\" && !ArrayBuffer.prototype.slice) {\n      (function() {\n        function clamp(val, length) {\n          val = val | 0 || 0;\n          if (val < 0) {\n            return Math.max(val + length, 0);\n          }\n          return Math.min(val, length);\n        }\n        ArrayBuffer.prototype.slice = function(from, to) {\n          var length = this.byteLength, begin = clamp(from, length), end = length, num, target, targetArray, sourceArray;\n          if (to !== undefined$1) {\n            end = clamp(to, length);\n          }\n          if (begin > end) {\n            return new ArrayBuffer(0);\n          }\n          num = end - begin;\n          target = new ArrayBuffer(num);\n          targetArray = new Uint8Array(target);\n          sourceArray = new Uint8Array(this, begin, num);\n          targetArray.set(sourceArray);\n          return target;\n        };\n      })();\n    }\n    function toUtf8(str) {\n      if (/[\\u0080-\\uFFFF]/.test(str)) {\n        str = unescape(encodeURIComponent(str));\n      }\n      return str;\n    }\n    function utf8Str2ArrayBuffer(str, returnUInt8Array) {\n      var length = str.length, buff = new ArrayBuffer(length), arr = new Uint8Array(buff), i;\n      for (i = 0; i < length; i += 1) {\n        arr[i] = str.charCodeAt(i);\n      }\n      return returnUInt8Array ? arr : buff;\n    }\n    function arrayBuffer2Utf8Str(buff) {\n      return String.fromCharCode.apply(null, new Uint8Array(buff));\n    }\n    function concatenateArrayBuffers(first, second, returnUInt8Array) {\n      var result = new Uint8Array(first.byteLength + second.byteLength);\n      result.set(new Uint8Array(first));\n      result.set(new Uint8Array(second), first.byteLength);\n      return returnUInt8Array ? result : result.buffer;\n    }\n    function hexToBinaryString(hex) {\n      var bytes = [], length = hex.length, x;\n      for (x = 0; x < length - 1; x += 2) {\n        bytes.push(parseInt(hex.substr(x, 2), 16));\n      }\n      return String.fromCharCode.apply(String, bytes);\n    }\n    function SparkMD5() {\n      this.reset();\n    }\n    SparkMD5.prototype.append = function(str) {\n      this.appendBinary(toUtf8(str));\n      return this;\n    };\n    SparkMD5.prototype.appendBinary = function(contents) {\n      this._buff += contents;\n      this._length += contents.length;\n      var length = this._buff.length, i;\n      for (i = 64; i <= length; i += 64) {\n        md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));\n      }\n      this._buff = this._buff.substring(i - 64);\n      return this;\n    };\n    SparkMD5.prototype.end = function(raw) {\n      var buff = this._buff, length = buff.length, i, tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], ret;\n      for (i = 0; i < length; i += 1) {\n        tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3);\n      }\n      this._finish(tail, length);\n      ret = hex(this._hash);\n      if (raw) {\n        ret = hexToBinaryString(ret);\n      }\n      this.reset();\n      return ret;\n    };\n    SparkMD5.prototype.reset = function() {\n      this._buff = \"\";\n      this._length = 0;\n      this._hash = [ 1732584193, -271733879, -1732584194, 271733878 ];\n      return this;\n    };\n    SparkMD5.prototype.getState = function() {\n      return {\n        buff: this._buff,\n        length: this._length,\n        hash: this._hash.slice()\n      };\n    };\n    SparkMD5.prototype.setState = function(state) {\n      this._buff = state.buff;\n      this._length = state.length;\n      this._hash = state.hash;\n      return this;\n    };\n    SparkMD5.prototype.destroy = function() {\n      delete this._hash;\n      delete this._buff;\n      delete this._length;\n    };\n    SparkMD5.prototype._finish = function(tail, length) {\n      var i = length, tmp, lo, hi;\n      tail[i >> 2] |= 128 << (i % 4 << 3);\n      if (i > 55) {\n        md5cycle(this._hash, tail);\n        for (i = 0; i < 16; i += 1) {\n          tail[i] = 0;\n        }\n      }\n      tmp = this._length * 8;\n      tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n      lo = parseInt(tmp[2], 16);\n      hi = parseInt(tmp[1], 16) || 0;\n      tail[14] = lo;\n      tail[15] = hi;\n      md5cycle(this._hash, tail);\n    };\n    SparkMD5.hash = function(str, raw) {\n      return SparkMD5.hashBinary(toUtf8(str), raw);\n    };\n    SparkMD5.hashBinary = function(content, raw) {\n      var hash = md51(content), ret = hex(hash);\n      return raw ? hexToBinaryString(ret) : ret;\n    };\n    SparkMD5.ArrayBuffer = function() {\n      this.reset();\n    };\n    SparkMD5.ArrayBuffer.prototype.append = function(arr) {\n      var buff = concatenateArrayBuffers(this._buff.buffer, arr, true), length = buff.length, i;\n      this._length += arr.byteLength;\n      for (i = 64; i <= length; i += 64) {\n        md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));\n      }\n      this._buff = i - 64 < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);\n      return this;\n    };\n    SparkMD5.ArrayBuffer.prototype.end = function(raw) {\n      var buff = this._buff, length = buff.length, tail = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], i, ret;\n      for (i = 0; i < length; i += 1) {\n        tail[i >> 2] |= buff[i] << (i % 4 << 3);\n      }\n      this._finish(tail, length);\n      ret = hex(this._hash);\n      if (raw) {\n        ret = hexToBinaryString(ret);\n      }\n      this.reset();\n      return ret;\n    };\n    SparkMD5.ArrayBuffer.prototype.reset = function() {\n      this._buff = new Uint8Array(0);\n      this._length = 0;\n      this._hash = [ 1732584193, -271733879, -1732584194, 271733878 ];\n      return this;\n    };\n    SparkMD5.ArrayBuffer.prototype.getState = function() {\n      var state = SparkMD5.prototype.getState.call(this);\n      state.buff = arrayBuffer2Utf8Str(state.buff);\n      return state;\n    };\n    SparkMD5.ArrayBuffer.prototype.setState = function(state) {\n      state.buff = utf8Str2ArrayBuffer(state.buff, true);\n      return SparkMD5.prototype.setState.call(this, state);\n    };\n    SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;\n    SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;\n    SparkMD5.ArrayBuffer.hash = function(arr, raw) {\n      var hash = md51_array(new Uint8Array(arr)), ret = hex(hash);\n      return raw ? hexToBinaryString(ret) : ret;\n    };\n    return SparkMD5;\n  }));\n})(sparkMd5);\n\nvar SparkMD5 = sparkMd5.exports;\n\nconst fileSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;\n\nclass FileChecksum {\n  static create(file, callback) {\n    const instance = new FileChecksum(file);\n    instance.create(callback);\n  }\n  constructor(file) {\n    this.file = file;\n    this.chunkSize = 2097152;\n    this.chunkCount = Math.ceil(this.file.size / this.chunkSize);\n    this.chunkIndex = 0;\n  }\n  create(callback) {\n    this.callback = callback;\n    this.md5Buffer = new SparkMD5.ArrayBuffer;\n    this.fileReader = new FileReader;\n    this.fileReader.addEventListener(\"load\", (event => this.fileReaderDidLoad(event)));\n    this.fileReader.addEventListener(\"error\", (event => this.fileReaderDidError(event)));\n    this.readNextChunk();\n  }\n  fileReaderDidLoad(event) {\n    this.md5Buffer.append(event.target.result);\n    if (!this.readNextChunk()) {\n      const binaryDigest = this.md5Buffer.end(true);\n      const base64digest = btoa(binaryDigest);\n      this.callback(null, base64digest);\n    }\n  }\n  fileReaderDidError(event) {\n    this.callback(`Error reading ${this.file.name}`);\n  }\n  readNextChunk() {\n    if (this.chunkIndex < this.chunkCount || this.chunkIndex == 0 && this.chunkCount == 0) {\n      const start = this.chunkIndex * this.chunkSize;\n      const end = Math.min(start + this.chunkSize, this.file.size);\n      const bytes = fileSlice.call(this.file, start, end);\n      this.fileReader.readAsArrayBuffer(bytes);\n      this.chunkIndex++;\n      return true;\n    } else {\n      return false;\n    }\n  }\n}\n\nfunction getMetaValue(name) {\n  const element = findElement(document.head, `meta[name=\"${name}\"]`);\n  if (element) {\n    return element.getAttribute(\"content\");\n  }\n}\n\nfunction findElements(root, selector) {\n  if (typeof root == \"string\") {\n    selector = root;\n    root = document;\n  }\n  const elements = root.querySelectorAll(selector);\n  return toArray(elements);\n}\n\nfunction findElement(root, selector) {\n  if (typeof root == \"string\") {\n    selector = root;\n    root = document;\n  }\n  return root.querySelector(selector);\n}\n\nfunction dispatchEvent(element, type, eventInit = {}) {\n  const {disabled: disabled} = element;\n  const {bubbles: bubbles, cancelable: cancelable, detail: detail} = eventInit;\n  const event = document.createEvent(\"Event\");\n  event.initEvent(type, bubbles || true, cancelable || true);\n  event.detail = detail || {};\n  try {\n    element.disabled = false;\n    element.dispatchEvent(event);\n  } finally {\n    element.disabled = disabled;\n  }\n  return event;\n}\n\nfunction toArray(value) {\n  if (Array.isArray(value)) {\n    return value;\n  } else if (Array.from) {\n    return Array.from(value);\n  } else {\n    return [].slice.call(value);\n  }\n}\n\nclass BlobRecord {\n  constructor(file, checksum, url, customHeaders = {}) {\n    this.file = file;\n    this.attributes = {\n      filename: file.name,\n      content_type: file.type || \"application/octet-stream\",\n      byte_size: file.size,\n      checksum: checksum\n    };\n    this.xhr = new XMLHttpRequest;\n    this.xhr.open(\"POST\", url, true);\n    this.xhr.responseType = \"json\";\n    this.xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n    this.xhr.setRequestHeader(\"Accept\", \"application/json\");\n    this.xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n    Object.keys(customHeaders).forEach((headerKey => {\n      this.xhr.setRequestHeader(headerKey, customHeaders[headerKey]);\n    }));\n    const csrfToken = getMetaValue(\"csrf-token\");\n    if (csrfToken != undefined) {\n      this.xhr.setRequestHeader(\"X-CSRF-Token\", csrfToken);\n    }\n    this.xhr.addEventListener(\"load\", (event => this.requestDidLoad(event)));\n    this.xhr.addEventListener(\"error\", (event => this.requestDidError(event)));\n  }\n  get status() {\n    return this.xhr.status;\n  }\n  get response() {\n    const {responseType: responseType, response: response} = this.xhr;\n    if (responseType == \"json\") {\n      return response;\n    } else {\n      return JSON.parse(response);\n    }\n  }\n  create(callback) {\n    this.callback = callback;\n    this.xhr.send(JSON.stringify({\n      blob: this.attributes\n    }));\n  }\n  requestDidLoad(event) {\n    if (this.status >= 200 && this.status < 300) {\n      const {response: response} = this;\n      const {direct_upload: direct_upload} = response;\n      delete response.direct_upload;\n      this.attributes = response;\n      this.directUploadData = direct_upload;\n      this.callback(null, this.toJSON());\n    } else {\n      this.requestDidError(event);\n    }\n  }\n  requestDidError(event) {\n    this.callback(`Error creating Blob for \"${this.file.name}\". Status: ${this.status}`);\n  }\n  toJSON() {\n    const result = {};\n    for (const key in this.attributes) {\n      result[key] = this.attributes[key];\n    }\n    return result;\n  }\n}\n\nclass BlobUpload {\n  constructor(blob) {\n    this.blob = blob;\n    this.file = blob.file;\n    const {url: url, headers: headers} = blob.directUploadData;\n    this.xhr = new XMLHttpRequest;\n    this.xhr.open(\"PUT\", url, true);\n    this.xhr.responseType = \"text\";\n    for (const key in headers) {\n      this.xhr.setRequestHeader(key, headers[key]);\n    }\n    this.xhr.addEventListener(\"load\", (event => this.requestDidLoad(event)));\n    this.xhr.addEventListener(\"error\", (event => this.requestDidError(event)));\n  }\n  create(callback) {\n    this.callback = callback;\n    this.xhr.send(this.file.slice());\n  }\n  requestDidLoad(event) {\n    const {status: status, response: response} = this.xhr;\n    if (status >= 200 && status < 300) {\n      this.callback(null, response);\n    } else {\n      this.requestDidError(event);\n    }\n  }\n  requestDidError(event) {\n    this.callback(`Error storing \"${this.file.name}\". Status: ${this.xhr.status}`);\n  }\n}\n\nlet id = 0;\n\nclass DirectUpload {\n  constructor(file, url, delegate, customHeaders = {}) {\n    this.id = ++id;\n    this.file = file;\n    this.url = url;\n    this.delegate = delegate;\n    this.customHeaders = customHeaders;\n  }\n  create(callback) {\n    FileChecksum.create(this.file, ((error, checksum) => {\n      if (error) {\n        callback(error);\n        return;\n      }\n      const blob = new BlobRecord(this.file, checksum, this.url, this.customHeaders);\n      notify(this.delegate, \"directUploadWillCreateBlobWithXHR\", blob.xhr);\n      blob.create((error => {\n        if (error) {\n          callback(error);\n        } else {\n          const upload = new BlobUpload(blob);\n          notify(this.delegate, \"directUploadWillStoreFileWithXHR\", upload.xhr);\n          upload.create((error => {\n            if (error) {\n              callback(error);\n            } else {\n              callback(null, blob.toJSON());\n            }\n          }));\n        }\n      }));\n    }));\n  }\n}\n\nfunction notify(object, methodName, ...messages) {\n  if (object && typeof object[methodName] == \"function\") {\n    return object[methodName](...messages);\n  }\n}\n\nclass DirectUploadController {\n  constructor(input, file) {\n    this.input = input;\n    this.file = file;\n    this.directUpload = new DirectUpload(this.file, this.url, this);\n    this.dispatch(\"initialize\");\n  }\n  start(callback) {\n    const hiddenInput = document.createElement(\"input\");\n    hiddenInput.type = \"hidden\";\n    hiddenInput.name = this.input.name;\n    this.input.insertAdjacentElement(\"beforebegin\", hiddenInput);\n    this.dispatch(\"start\");\n    this.directUpload.create(((error, attributes) => {\n      if (error) {\n        hiddenInput.parentNode.removeChild(hiddenInput);\n        this.dispatchError(error);\n      } else {\n        hiddenInput.value = attributes.signed_id;\n      }\n      this.dispatch(\"end\");\n      callback(error);\n    }));\n  }\n  uploadRequestDidProgress(event) {\n    const progress = event.loaded / event.total * 90;\n    if (progress) {\n      this.dispatch(\"progress\", {\n        progress: progress\n      });\n    }\n  }\n  get url() {\n    return this.input.getAttribute(\"data-direct-upload-url\");\n  }\n  dispatch(name, detail = {}) {\n    detail.file = this.file;\n    detail.id = this.directUpload.id;\n    return dispatchEvent(this.input, `direct-upload:${name}`, {\n      detail: detail\n    });\n  }\n  dispatchError(error) {\n    const event = this.dispatch(\"error\", {\n      error: error\n    });\n    if (!event.defaultPrevented) {\n      alert(error);\n    }\n  }\n  directUploadWillCreateBlobWithXHR(xhr) {\n    this.dispatch(\"before-blob-request\", {\n      xhr: xhr\n    });\n  }\n  directUploadWillStoreFileWithXHR(xhr) {\n    this.dispatch(\"before-storage-request\", {\n      xhr: xhr\n    });\n    xhr.upload.addEventListener(\"progress\", (event => this.uploadRequestDidProgress(event)));\n    xhr.upload.addEventListener(\"loadend\", (() => {\n      this.simulateResponseProgress(xhr);\n    }));\n  }\n  simulateResponseProgress(xhr) {\n    let progress = 90;\n    const startTime = Date.now();\n    const updateProgress = () => {\n      const elapsed = Date.now() - startTime;\n      const estimatedResponseTime = this.estimateResponseTime();\n      const responseProgress = Math.min(elapsed / estimatedResponseTime, 1);\n      progress = 90 + responseProgress * 9;\n      this.dispatch(\"progress\", {\n        progress: progress\n      });\n      if (xhr.readyState !== XMLHttpRequest.DONE && progress < 99) {\n        requestAnimationFrame(updateProgress);\n      }\n    };\n    xhr.addEventListener(\"loadend\", (() => {\n      this.dispatch(\"progress\", {\n        progress: 100\n      });\n    }));\n    requestAnimationFrame(updateProgress);\n  }\n  estimateResponseTime() {\n    const fileSize = this.file.size;\n    const MB = 1024 * 1024;\n    if (fileSize < MB) {\n      return 1e3;\n    } else if (fileSize < 10 * MB) {\n      return 2e3;\n    } else {\n      return 3e3 + fileSize / MB * 50;\n    }\n  }\n}\n\nconst inputSelector = \"input[type=file][data-direct-upload-url]:not([disabled])\";\n\nclass DirectUploadsController {\n  constructor(form) {\n    this.form = form;\n    this.inputs = findElements(form, inputSelector).filter((input => input.files.length));\n  }\n  start(callback) {\n    const controllers = this.createDirectUploadControllers();\n    const startNextController = () => {\n      const controller = controllers.shift();\n      if (controller) {\n        controller.start((error => {\n          if (error) {\n            callback(error);\n            this.dispatch(\"end\");\n          } else {\n            startNextController();\n          }\n        }));\n      } else {\n        callback();\n        this.dispatch(\"end\");\n      }\n    };\n    this.dispatch(\"start\");\n    startNextController();\n  }\n  createDirectUploadControllers() {\n    const controllers = [];\n    this.inputs.forEach((input => {\n      toArray(input.files).forEach((file => {\n        const controller = new DirectUploadController(input, file);\n        controllers.push(controller);\n      }));\n    }));\n    return controllers;\n  }\n  dispatch(name, detail = {}) {\n    return dispatchEvent(this.form, `direct-uploads:${name}`, {\n      detail: detail\n    });\n  }\n}\n\nconst processingAttribute = \"data-direct-uploads-processing\";\n\nconst submitButtonsByForm = new WeakMap;\n\nlet started = false;\n\nfunction start() {\n  if (!started) {\n    started = true;\n    document.addEventListener(\"click\", didClick, true);\n    document.addEventListener(\"submit\", didSubmitForm, true);\n    document.addEventListener(\"ajax:before\", didSubmitRemoteElement);\n  }\n}\n\nfunction didClick(event) {\n  const button = event.target.closest(\"button, input\");\n  if (button && button.type === \"submit\" && button.form) {\n    submitButtonsByForm.set(button.form, button);\n  }\n}\n\nfunction didSubmitForm(event) {\n  handleFormSubmissionEvent(event);\n}\n\nfunction didSubmitRemoteElement(event) {\n  if (event.target.tagName == \"FORM\") {\n    handleFormSubmissionEvent(event);\n  }\n}\n\nfunction handleFormSubmissionEvent(event) {\n  const form = event.target;\n  if (form.hasAttribute(processingAttribute)) {\n    event.preventDefault();\n    return;\n  }\n  const controller = new DirectUploadsController(form);\n  const {inputs: inputs} = controller;\n  if (inputs.length) {\n    event.preventDefault();\n    form.setAttribute(processingAttribute, \"\");\n    inputs.forEach(disable);\n    controller.start((error => {\n      form.removeAttribute(processingAttribute);\n      if (error) {\n        inputs.forEach(enable);\n      } else {\n        submitForm(form);\n      }\n    }));\n  }\n}\n\nfunction submitForm(form) {\n  let button = submitButtonsByForm.get(form) || findElement(form, \"input[type=submit], button[type=submit]\");\n  if (button) {\n    const {disabled: disabled} = button;\n    button.disabled = false;\n    button.focus();\n    button.click();\n    button.disabled = disabled;\n  } else {\n    button = document.createElement(\"input\");\n    button.type = \"submit\";\n    button.style.display = \"none\";\n    form.appendChild(button);\n    button.click();\n    form.removeChild(button);\n  }\n  submitButtonsByForm.delete(form);\n}\n\nfunction disable(input) {\n  input.disabled = true;\n}\n\nfunction enable(input) {\n  input.disabled = false;\n}\n\nfunction autostart() {\n  if (window.ActiveStorage) {\n    start();\n  }\n}\n\nsetTimeout(autostart, 1);\n\nexport { DirectUpload, DirectUploadController, DirectUploadsController, dispatchEvent, start };\n", "import Prism from 'prismjs';\nimport 'prismjs/components/prism-clike';\nimport 'prismjs/components/prism-diff';\nimport 'prismjs/components/prism-javascript';\nimport 'prismjs/components/prism-markup';\nimport 'prismjs/components/prism-markdown';\nimport 'prismjs/components/prism-c';\nimport 'prismjs/components/prism-css';\nimport 'prismjs/components/prism-objectivec';\nimport 'prismjs/components/prism-sql';\nimport 'prismjs/components/prism-powershell';\nimport 'prismjs/components/prism-python';\nimport 'prismjs/components/prism-rust';\nimport 'prismjs/components/prism-swift';\nimport 'prismjs/components/prism-typescript';\nimport 'prismjs/components/prism-java';\nimport 'prismjs/components/prism-cpp';\nimport 'prismjs/components/prism-markup-templating';\nimport 'prismjs/components/prism-ruby';\nimport 'prismjs/components/prism-php';\nimport 'prismjs/components/prism-go';\nimport 'prismjs/components/prism-bash';\nimport 'prismjs/components/prism-json';\nimport 'prismjs/components/prism-kotlin';\n\n// Configure Prism for manual highlighting mode\n// This must be set before importing prismjs\nwindow.Prism ||= {};\nwindow.Prism.manual = true;\n\nfunction highlightCode(root = document) {\n  const elements = root.querySelectorAll(\"pre[data-language]:not([data-highlighted])\");\n\n  elements.forEach(preElement => {\n    highlightElement(preElement);\n  });\n}\n\nfunction highlightElement(preElement) {\n  if (preElement.dataset.highlighted === \"true\") return\n\n  const language = preElement.getAttribute(\"data-language\");\n\n  const grammar = Prism.languages?.[language];\n  if (!grammar) return\n\n  // Read the source text and the <mark> and <a> ranges in a single walk,\n  // before Prism rewrites the element. Sharing one traversal keeps the range\n  // offsets aligned with the code string and preserves leading whitespace \u2014\n  // deriving either of them separately (e.g. textContent through DOMParser)\n  // collapses leading whitespace and shifts every range, re-indenting the\n  // rendered block.\n  const { code, highlights, links } = extractCodeAndMarkup(preElement);\n\n  const highlightedHtml = Prism.highlight(code, grammar, language);\n  preElement.innerHTML = highlightedHtml;\n\n  if (highlights.length > 0) {\n    applyHighlightRanges(preElement, highlights);\n  }\n\n  if (links.length > 0) {\n    applyLinkRanges(preElement, links);\n  }\n\n  preElement.dataset.highlighted = \"true\";\n}\n\n// Walk the <pre> once, building Prism's source text and the <mark> and <a>\n// ranges together: a text node contributes its text verbatim, a <br>\n// contributes a newline, and a <mark> or <a> records the slice of code it\n// covers. Because all outputs come from the same walk, every range offset is\n// just a position in `code` \u2014 so the markup can't drift out of sync with the\n// source, and the block's leading whitespace survives (HTML parsing would\n// collapse it).\nfunction extractCodeAndMarkup(preElement) {\n  const root = preElement.querySelector(\"code\") || preElement;\n  const highlights = [];\n  const links = [];\n  let code = \"\";\n\n  function walk(node) {\n    if (node.nodeType === Node.TEXT_NODE) {\n      code += node.textContent;\n    } else if (node.nodeType === Node.ELEMENT_NODE) {\n      if (node.tagName === \"BR\") {\n        code += \"\\n\";\n      } else if (node.tagName === \"MARK\") {\n        const start = code.length;\n        for (const child of node.childNodes) {\n          walk(child);\n        }\n        const style = extractStyle(node);\n        if (style) {\n          highlights.push({ start, end: code.length, style });\n        }\n      } else if (node.tagName === \"A\" && node.getAttribute(\"href\")) {\n        const start = code.length;\n        for (const child of node.childNodes) {\n          walk(child);\n        }\n        links.push({ start, end: code.length, attributes: linkAttributes(node) });\n      } else {\n        for (const child of node.childNodes) {\n          walk(child);\n        }\n      }\n    }\n  }\n\n  for (const child of root.childNodes) {\n    walk(child);\n  }\n\n  return { code, highlights, links }\n}\n\nfunction linkAttributes(element) {\n  const attributes = { href: element.getAttribute(\"href\") };\n  for (const name of [ \"target\", \"rel\", \"title\" ]) {\n    if (element.getAttribute(name)) {\n      attributes[name] = element.getAttribute(name);\n    }\n  }\n  return attributes\n}\n\nfunction extractStyle(element) {\n  const parts = [];\n  if (element.style?.color) parts.push(`color: ${element.style.color};`);\n  if (element.style?.backgroundColor) parts.push(`background-color: ${element.style.backgroundColor};`);\n  return parts.length > 0 ? parts.join(\" \") : null\n}\n\n// Wrap character ranges in <mark> or <a> elements within a Prism-highlighted\n// DOM tree. Each range is applied independently, re-collecting text nodes\n// each time to account for splits from previous ranges.\nfunction applyHighlightRanges(element, highlights) {\n  for (const { start, end, style } of highlights) {\n    wrapRange(element, start, end, () => {\n      const mark = document.createElement(\"mark\");\n      mark.setAttribute(\"style\", style);\n      return mark\n    });\n  }\n}\n\nfunction applyLinkRanges(element, links) {\n  for (const { start, end, attributes } of links) {\n    wrapRange(element, start, end, () => {\n      const anchor = document.createElement(\"a\");\n      for (const [ name, value ] of Object.entries(attributes)) {\n        anchor.setAttribute(name, value);\n      }\n      return anchor\n    });\n  }\n}\n\nfunction wrapRange(container, rangeStart, rangeEnd, createWrapper) {\n  const textNodes = collectTextNodes(container);\n\n  // Process in reverse so DOM mutations don't shift earlier text node offsets\n  for (let i = textNodes.length - 1; i >= 0; i--) {\n    const { node, start: nodeStart, end: nodeEnd } = textNodes[i];\n    const overlapStart = Math.max(rangeStart, nodeStart);\n    const overlapEnd = Math.min(rangeEnd, nodeEnd);\n    if (overlapStart >= overlapEnd) continue\n\n    const relStart = overlapStart - nodeStart;\n    const relEnd = overlapEnd - nodeStart;\n    const text = node.textContent;\n    const parent = node.parentNode;\n\n    const wrapper = createWrapper();\n    wrapper.textContent = text.slice(relStart, relEnd);\n\n    if (relEnd < text.length) {\n      parent.insertBefore(document.createTextNode(text.slice(relEnd)), node.nextSibling);\n    }\n    parent.insertBefore(wrapper, node.nextSibling);\n\n    if (relStart > 0) {\n      node.textContent = text.slice(0, relStart);\n    } else {\n      parent.removeChild(node);\n    }\n  }\n}\n\nfunction collectTextNodes(root) {\n  const nodes = [];\n  let offset = 0;\n  const walker = document.createTreeWalker(root, 4 /* NodeFilter.SHOW_TEXT */);\n\n  let node;\n  while ((node = walker.nextNode())) {\n    const length = node.textContent.length;\n    nodes.push({ node, start: offset, end: offset + length });\n    offset += length;\n  }\n\n  return nodes\n}\n\nexport { highlightCode, highlightElement };\n", "Prism.languages.clike = {\n\t'comment': [\n\t\t{\n\t\t\tpattern: /(^|[^\\\\])\\/\\*[\\s\\S]*?(?:\\*\\/|$)/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true\n\t\t},\n\t\t{\n\t\t\tpattern: /(^|[^\\\\:])\\/\\/.*/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true\n\t\t}\n\t],\n\t'string': {\n\t\tpattern: /([\"'])(?:\\\\(?:\\r\\n|[\\s\\S])|(?!\\1)[^\\\\\\r\\n])*\\1/,\n\t\tgreedy: true\n\t},\n\t'class-name': {\n\t\tpattern: /(\\b(?:class|extends|implements|instanceof|interface|new|trait)\\s+|\\bcatch\\s+\\()[\\w.\\\\]+/i,\n\t\tlookbehind: true,\n\t\tinside: {\n\t\t\t'punctuation': /[.\\\\]/\n\t\t}\n\t},\n\t'keyword': /\\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\\b/,\n\t'boolean': /\\b(?:false|true)\\b/,\n\t'function': /\\b\\w+(?=\\()/,\n\t'number': /\\b0x[\\da-f]+\\b|(?:\\b\\d+(?:\\.\\d*)?|\\B\\.\\d+)(?:e[+-]?\\d+)?/i,\n\t'operator': /[<>]=?|[!=]=?=?|--?|\\+\\+?|&&?|\\|\\|?|[?*/~^%]/,\n\t'punctuation': /[{}[\\];(),.:]/\n};\n", "(function (Prism) {\n\n\tPrism.languages.diff = {\n\t\t'coord': [\n\t\t\t// Match all kinds of coord lines (prefixed by \"+++\", \"---\" or \"***\").\n\t\t\t/^(?:\\*{3}|-{3}|\\+{3}).*$/m,\n\t\t\t// Match \"@@ ... @@\" coord lines in unified diff.\n\t\t\t/^@@.*@@$/m,\n\t\t\t// Match coord lines in normal diff (starts with a number).\n\t\t\t/^\\d.*$/m\n\t\t]\n\n\t\t// deleted, inserted, unchanged, diff\n\t};\n\n\t/**\n\t * A map from the name of a block to its line prefix.\n\t *\n\t * @type {Object<string, string>}\n\t */\n\tvar PREFIXES = {\n\t\t'deleted-sign': '-',\n\t\t'deleted-arrow': '<',\n\t\t'inserted-sign': '+',\n\t\t'inserted-arrow': '>',\n\t\t'unchanged': ' ',\n\t\t'diff': '!',\n\t};\n\n\t// add a token for each prefix\n\tObject.keys(PREFIXES).forEach(function (name) {\n\t\tvar prefix = PREFIXES[name];\n\n\t\tvar alias = [];\n\t\tif (!/^\\w+$/.test(name)) { // \"deleted-sign\" -> \"deleted\"\n\t\t\talias.push(/\\w+/.exec(name)[0]);\n\t\t}\n\t\tif (name === 'diff') {\n\t\t\talias.push('bold');\n\t\t}\n\n\t\tPrism.languages.diff[name] = {\n\t\t\tpattern: RegExp('^(?:[' + prefix + '].*(?:\\r\\n?|\\n|(?![\\\\s\\\\S])))+', 'm'),\n\t\t\talias: alias,\n\t\t\tinside: {\n\t\t\t\t'line': {\n\t\t\t\t\tpattern: /(.)(?=[\\s\\S]).*(?:\\r\\n?|\\n)?/,\n\t\t\t\t\tlookbehind: true\n\t\t\t\t},\n\t\t\t\t'prefix': {\n\t\t\t\t\tpattern: /[\\s\\S]/,\n\t\t\t\t\talias: /\\w+/.exec(name)[0]\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t});\n\n\t// make prefixes available to Diff plugin\n\tObject.defineProperty(Prism.languages.diff, 'PREFIXES', {\n\t\tvalue: PREFIXES\n\t});\n\n}(Prism));\n", "Prism.languages.javascript = Prism.languages.extend('clike', {\n\t'class-name': [\n\t\tPrism.languages.clike['class-name'],\n\t\t{\n\t\t\tpattern: /(^|[^$\\w\\xA0-\\uFFFF])(?!\\s)[_$A-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\.(?:constructor|prototype))/,\n\t\t\tlookbehind: true\n\t\t}\n\t],\n\t'keyword': [\n\t\t{\n\t\t\tpattern: /((?:^|\\})\\s*)catch\\b/,\n\t\t\tlookbehind: true\n\t\t},\n\t\t{\n\t\t\tpattern: /(^|[^.]|\\.\\.\\.\\s*)\\b(?:as|assert(?=\\s*\\{)|async(?=\\s*(?:function\\b|\\(|[$\\w\\xA0-\\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\\s*(?:\\{|$))|for|from(?=\\s*(?:['\"]|$))|function|(?:get|set)(?=\\s*(?:[#\\[$\\w\\xA0-\\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\\b/,\n\t\t\tlookbehind: true\n\t\t},\n\t],\n\t// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)\n\t'function': /#?(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\s*(?:\\.\\s*(?:apply|bind|call)\\s*)?\\()/,\n\t'number': {\n\t\tpattern: RegExp(\n\t\t\t/(^|[^\\w$])/.source +\n\t\t\t'(?:' +\n\t\t\t(\n\t\t\t\t// constant\n\t\t\t\t/NaN|Infinity/.source +\n\t\t\t\t'|' +\n\t\t\t\t// binary integer\n\t\t\t\t/0[bB][01]+(?:_[01]+)*n?/.source +\n\t\t\t\t'|' +\n\t\t\t\t// octal integer\n\t\t\t\t/0[oO][0-7]+(?:_[0-7]+)*n?/.source +\n\t\t\t\t'|' +\n\t\t\t\t// hexadecimal integer\n\t\t\t\t/0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?/.source +\n\t\t\t\t'|' +\n\t\t\t\t// decimal bigint\n\t\t\t\t/\\d+(?:_\\d+)*n/.source +\n\t\t\t\t'|' +\n\t\t\t\t// decimal number (integer or float) but no bigint\n\t\t\t\t/(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?/.source\n\t\t\t) +\n\t\t\t')' +\n\t\t\t/(?![\\w$])/.source\n\t\t),\n\t\tlookbehind: true\n\t},\n\t'operator': /--|\\+\\+|\\*\\*=?|=>|&&=?|\\|\\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\\.{3}|\\?\\?=?|\\?\\.?|[~:]/\n});\n\nPrism.languages.javascript['class-name'][0].pattern = /(\\b(?:class|extends|implements|instanceof|interface|new)\\s+)[\\w.\\\\]+/;\n\nPrism.languages.insertBefore('javascript', 'keyword', {\n\t'regex': {\n\t\tpattern: RegExp(\n\t\t\t// lookbehind\n\t\t\t// eslint-disable-next-line regexp/no-dupe-characters-character-class\n\t\t\t/((?:^|[^$\\w\\xA0-\\uFFFF.\"'\\])\\s]|\\b(?:return|yield))\\s*)/.source +\n\t\t\t// Regex pattern:\n\t\t\t// There are 2 regex patterns here. The RegExp set notation proposal added support for nested character\n\t\t\t// classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible\n\t\t\t// with the only syntax, so we have to define 2 different regex patterns.\n\t\t\t/\\//.source +\n\t\t\t'(?:' +\n\t\t\t/(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}/.source +\n\t\t\t'|' +\n\t\t\t// `v` flag syntax. This supports 3 levels of nested character classes.\n\t\t\t/(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source +\n\t\t\t')' +\n\t\t\t// lookahead\n\t\t\t/(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))/.source\n\t\t),\n\t\tlookbehind: true,\n\t\tgreedy: true,\n\t\tinside: {\n\t\t\t'regex-source': {\n\t\t\t\tpattern: /^(\\/)[\\s\\S]+(?=\\/[a-z]*$)/,\n\t\t\t\tlookbehind: true,\n\t\t\t\talias: 'language-regex',\n\t\t\t\tinside: Prism.languages.regex\n\t\t\t},\n\t\t\t'regex-delimiter': /^\\/|\\/$/,\n\t\t\t'regex-flags': /^[a-z]+$/,\n\t\t}\n\t},\n\t// This must be declared before keyword because we use \"function\" inside the look-forward\n\t'function-variable': {\n\t\tpattern: /#?(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\s*[=:]\\s*(?:async\\s*)?(?:\\bfunction\\b|(?:\\((?:[^()]|\\([^()]*\\))*\\)|(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*)\\s*=>))/,\n\t\talias: 'function'\n\t},\n\t'parameter': [\n\t\t{\n\t\t\tpattern: /(function(?:\\s+(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*)?\\s*\\(\\s*)(?!\\s)(?:[^()\\s]|\\s+(?![\\s)])|\\([^()]*\\))+(?=\\s*\\))/,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages.javascript\n\t\t},\n\t\t{\n\t\t\tpattern: /(^|[^$\\w\\xA0-\\uFFFF])(?!\\s)[_$a-z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\s*=>)/i,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages.javascript\n\t\t},\n\t\t{\n\t\t\tpattern: /(\\(\\s*)(?!\\s)(?:[^()\\s]|\\s+(?![\\s)])|\\([^()]*\\))+(?=\\s*\\)\\s*=>)/,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages.javascript\n\t\t},\n\t\t{\n\t\t\tpattern: /((?:\\b|\\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\\w\\xA0-\\uFFFF]))(?:(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*\\s*)\\(\\s*|\\]\\s*\\(\\s*)(?!\\s)(?:[^()\\s]|\\s+(?![\\s)])|\\([^()]*\\))+(?=\\s*\\)\\s*\\{)/,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages.javascript\n\t\t}\n\t],\n\t'constant': /\\b[A-Z](?:[A-Z_]|\\dx?)*\\b/\n});\n\nPrism.languages.insertBefore('javascript', 'string', {\n\t'hashbang': {\n\t\tpattern: /^#!.*/,\n\t\tgreedy: true,\n\t\talias: 'comment'\n\t},\n\t'template-string': {\n\t\tpattern: /`(?:\\\\[\\s\\S]|\\$\\{(?:[^{}]|\\{(?:[^{}]|\\{[^}]*\\})*\\})+\\}|(?!\\$\\{)[^\\\\`])*`/,\n\t\tgreedy: true,\n\t\tinside: {\n\t\t\t'template-punctuation': {\n\t\t\t\tpattern: /^`|`$/,\n\t\t\t\talias: 'string'\n\t\t\t},\n\t\t\t'interpolation': {\n\t\t\t\tpattern: /((?:^|[^\\\\])(?:\\\\{2})*)\\$\\{(?:[^{}]|\\{(?:[^{}]|\\{[^}]*\\})*\\})+\\}/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'interpolation-punctuation': {\n\t\t\t\t\t\tpattern: /^\\$\\{|\\}$/,\n\t\t\t\t\t\talias: 'punctuation'\n\t\t\t\t\t},\n\t\t\t\t\trest: Prism.languages.javascript\n\t\t\t\t}\n\t\t\t},\n\t\t\t'string': /[\\s\\S]+/\n\t\t}\n\t},\n\t'string-property': {\n\t\tpattern: /((?:^|[,{])[ \\t]*)([\"'])(?:\\\\(?:\\r\\n|[\\s\\S])|(?!\\2)[^\\\\\\r\\n])*\\2(?=\\s*:)/m,\n\t\tlookbehind: true,\n\t\tgreedy: true,\n\t\talias: 'property'\n\t}\n});\n\nPrism.languages.insertBefore('javascript', 'operator', {\n\t'literal-property': {\n\t\tpattern: /((?:^|[,{])[ \\t]*)(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?=\\s*:)/m,\n\t\tlookbehind: true,\n\t\talias: 'property'\n\t},\n});\n\nif (Prism.languages.markup) {\n\tPrism.languages.markup.tag.addInlined('script', 'javascript');\n\n\t// add attribute support for all DOM events.\n\t// https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events\n\tPrism.languages.markup.tag.addAttribute(\n\t\t/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,\n\t\t'javascript'\n\t);\n}\n\nPrism.languages.js = Prism.languages.javascript;\n", "Prism.languages.markup = {\n\t'comment': {\n\t\tpattern: /<!--(?:(?!<!--)[\\s\\S])*?-->/,\n\t\tgreedy: true\n\t},\n\t'prolog': {\n\t\tpattern: /<\\?[\\s\\S]+?\\?>/,\n\t\tgreedy: true\n\t},\n\t'doctype': {\n\t\t// https://www.w3.org/TR/xml/#NT-doctypedecl\n\t\tpattern: /<!DOCTYPE(?:[^>\"'[\\]]|\"[^\"]*\"|'[^']*')+(?:\\[(?:[^<\"'\\]]|\"[^\"]*\"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\\]\\s*)?>/i,\n\t\tgreedy: true,\n\t\tinside: {\n\t\t\t'internal-subset': {\n\t\t\t\tpattern: /(^[^\\[]*\\[)[\\s\\S]+(?=\\]>$)/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: null // see below\n\t\t\t},\n\t\t\t'string': {\n\t\t\t\tpattern: /\"[^\"]*\"|'[^']*'/,\n\t\t\t\tgreedy: true\n\t\t\t},\n\t\t\t'punctuation': /^<!|>$|[[\\]]/,\n\t\t\t'doctype-tag': /^DOCTYPE/i,\n\t\t\t'name': /[^\\s<>'\"]+/\n\t\t}\n\t},\n\t'cdata': {\n\t\tpattern: /<!\\[CDATA\\[[\\s\\S]*?\\]\\]>/i,\n\t\tgreedy: true\n\t},\n\t'tag': {\n\t\tpattern: /<\\/?(?!\\d)[^\\s>\\/=$<%]+(?:\\s(?:\\s*[^\\s>\\/=]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))|(?=[\\s/>])))+)?\\s*\\/?>/,\n\t\tgreedy: true,\n\t\tinside: {\n\t\t\t'tag': {\n\t\t\t\tpattern: /^<\\/?[^\\s>\\/]+/,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': /^<\\/?/,\n\t\t\t\t\t'namespace': /^[^\\s>\\/:]+:/\n\t\t\t\t}\n\t\t\t},\n\t\t\t'special-attr': [],\n\t\t\t'attr-value': {\n\t\t\t\tpattern: /=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+)/,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: /^=/,\n\t\t\t\t\t\t\talias: 'attr-equals'\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: /^(\\s*)[\"']|[\"']$/,\n\t\t\t\t\t\t\tlookbehind: true\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t},\n\t\t\t'punctuation': /\\/?>/,\n\t\t\t'attr-name': {\n\t\t\t\tpattern: /[^\\s>\\/]+/,\n\t\t\t\tinside: {\n\t\t\t\t\t'namespace': /^[^\\s>\\/:]+:/\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t},\n\t'entity': [\n\t\t{\n\t\t\tpattern: /&[\\da-z]{1,8};/i,\n\t\t\talias: 'named-entity'\n\t\t},\n\t\t/&#x?[\\da-f]{1,8};/i\n\t]\n};\n\nPrism.languages.markup['tag'].inside['attr-value'].inside['entity'] =\n\tPrism.languages.markup['entity'];\nPrism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;\n\n// Plugin to make entity title show the real entity, idea by Roman Komarov\nPrism.hooks.add('wrap', function (env) {\n\n\tif (env.type === 'entity') {\n\t\tenv.attributes['title'] = env.content.replace(/&amp;/, '&');\n\t}\n});\n\nObject.defineProperty(Prism.languages.markup.tag, 'addInlined', {\n\t/**\n\t * Adds an inlined language to markup.\n\t *\n\t * An example of an inlined language is CSS with `<style>` tags.\n\t *\n\t * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as\n\t * case insensitive.\n\t * @param {string} lang The language key.\n\t * @example\n\t * addInlined('style', 'css');\n\t */\n\tvalue: function addInlined(tagName, lang) {\n\t\tvar includedCdataInside = {};\n\t\tincludedCdataInside['language-' + lang] = {\n\t\t\tpattern: /(^<!\\[CDATA\\[)[\\s\\S]+?(?=\\]\\]>$)/i,\n\t\t\tlookbehind: true,\n\t\t\tinside: Prism.languages[lang]\n\t\t};\n\t\tincludedCdataInside['cdata'] = /^<!\\[CDATA\\[|\\]\\]>$/i;\n\n\t\tvar inside = {\n\t\t\t'included-cdata': {\n\t\t\t\tpattern: /<!\\[CDATA\\[[\\s\\S]*?\\]\\]>/i,\n\t\t\t\tinside: includedCdataInside\n\t\t\t}\n\t\t};\n\t\tinside['language-' + lang] = {\n\t\t\tpattern: /[\\s\\S]+/,\n\t\t\tinside: Prism.languages[lang]\n\t\t};\n\n\t\tvar def = {};\n\t\tdef[tagName] = {\n\t\t\tpattern: RegExp(/(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: inside\n\t\t};\n\n\t\tPrism.languages.insertBefore('markup', 'cdata', def);\n\t}\n});\nObject.defineProperty(Prism.languages.markup.tag, 'addAttribute', {\n\t/**\n\t * Adds an pattern to highlight languages embedded in HTML attributes.\n\t *\n\t * An example of an inlined language is CSS with `style` attributes.\n\t *\n\t * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as\n\t * case insensitive.\n\t * @param {string} lang The language key.\n\t * @example\n\t * addAttribute('style', 'css');\n\t */\n\tvalue: function (attrName, lang) {\n\t\tPrism.languages.markup.tag.inside['special-attr'].push({\n\t\t\tpattern: RegExp(\n\t\t\t\t/(^|[\"'\\s])/.source + '(?:' + attrName + ')' + /\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))/.source,\n\t\t\t\t'i'\n\t\t\t),\n\t\t\tlookbehind: true,\n\t\t\tinside: {\n\t\t\t\t'attr-name': /^[^\\s=]+/,\n\t\t\t\t'attr-value': {\n\t\t\t\t\tpattern: /=[\\s\\S]+/,\n\t\t\t\t\tinside: {\n\t\t\t\t\t\t'value': {\n\t\t\t\t\t\t\tpattern: /(^=\\s*([\"']|(?![\"'])))\\S[\\s\\S]*(?=\\2$)/,\n\t\t\t\t\t\t\tlookbehind: true,\n\t\t\t\t\t\t\talias: [lang, 'language-' + lang],\n\t\t\t\t\t\t\tinside: Prism.languages[lang]\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'punctuation': [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpattern: /^=/,\n\t\t\t\t\t\t\t\talias: 'attr-equals'\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t/\"|'/\n\t\t\t\t\t\t]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n});\n\nPrism.languages.html = Prism.languages.markup;\nPrism.languages.mathml = Prism.languages.markup;\nPrism.languages.svg = Prism.languages.markup;\n\nPrism.languages.xml = Prism.languages.extend('markup', {});\nPrism.languages.ssml = Prism.languages.xml;\nPrism.languages.atom = Prism.languages.xml;\nPrism.languages.rss = Prism.languages.xml;\n", "(function (Prism) {\n\n\t// Allow only one line break\n\tvar inner = /(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))/.source;\n\n\t/**\n\t * This function is intended for the creation of the bold or italic pattern.\n\t *\n\t * This also adds a lookbehind group to the given pattern to ensure that the pattern is not backslash-escaped.\n\t *\n\t * _Note:_ Keep in mind that this adds a capturing group.\n\t *\n\t * @param {string} pattern\n\t * @returns {RegExp}\n\t */\n\tfunction createInline(pattern) {\n\t\tpattern = pattern.replace(/<inner>/g, function () { return inner; });\n\t\treturn RegExp(/((?:^|[^\\\\])(?:\\\\{2})*)/.source + '(?:' + pattern + ')');\n\t}\n\n\n\tvar tableCell = /(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+/.source;\n\tvar tableRow = /\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))/.source.replace(/__/g, function () { return tableCell; });\n\tvar tableLine = /\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)/.source;\n\n\n\tPrism.languages.markdown = Prism.languages.extend('markup', {});\n\tPrism.languages.insertBefore('markdown', 'prolog', {\n\t\t'front-matter-block': {\n\t\t\tpattern: /(^(?:\\s*[\\r\\n])?)---(?!.)[\\s\\S]*?[\\r\\n]---(?!.)/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'punctuation': /^---|---$/,\n\t\t\t\t'front-matter': {\n\t\t\t\t\tpattern: /\\S+(?:\\s+\\S+)*/,\n\t\t\t\t\talias: ['yaml', 'language-yaml'],\n\t\t\t\t\tinside: Prism.languages.yaml\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t'blockquote': {\n\t\t\t// > ...\n\t\t\tpattern: /^>(?:[\\t ]*>)*/m,\n\t\t\talias: 'punctuation'\n\t\t},\n\t\t'table': {\n\t\t\tpattern: RegExp('^' + tableRow + tableLine + '(?:' + tableRow + ')*', 'm'),\n\t\t\tinside: {\n\t\t\t\t'table-data-rows': {\n\t\t\t\t\tpattern: RegExp('^(' + tableRow + tableLine + ')(?:' + tableRow + ')*$'),\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\tinside: {\n\t\t\t\t\t\t'table-data': {\n\t\t\t\t\t\t\tpattern: RegExp(tableCell),\n\t\t\t\t\t\t\tinside: Prism.languages.markdown\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'punctuation': /\\|/\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t'table-line': {\n\t\t\t\t\tpattern: RegExp('^(' + tableRow + ')' + tableLine + '$'),\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\tinside: {\n\t\t\t\t\t\t'punctuation': /\\||:?-{3,}:?/\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t'table-header-row': {\n\t\t\t\t\tpattern: RegExp('^' + tableRow + '$'),\n\t\t\t\t\tinside: {\n\t\t\t\t\t\t'table-header': {\n\t\t\t\t\t\t\tpattern: RegExp(tableCell),\n\t\t\t\t\t\t\talias: 'important',\n\t\t\t\t\t\t\tinside: Prism.languages.markdown\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'punctuation': /\\|/\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t'code': [\n\t\t\t{\n\t\t\t\t// Prefixed by 4 spaces or 1 tab and preceded by an empty line\n\t\t\t\tpattern: /((?:^|\\n)[ \\t]*\\n|(?:^|\\r\\n?)[ \\t]*\\r\\n?)(?: {4}|\\t).+(?:(?:\\n|\\r\\n?)(?: {4}|\\t).+)*/,\n\t\t\t\tlookbehind: true,\n\t\t\t\talias: 'keyword'\n\t\t\t},\n\t\t\t{\n\t\t\t\t// ```optional language\n\t\t\t\t// code block\n\t\t\t\t// ```\n\t\t\t\tpattern: /^```[\\s\\S]*?^```$/m,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'code-block': {\n\t\t\t\t\t\tpattern: /^(```.*(?:\\n|\\r\\n?))[\\s\\S]+?(?=(?:\\n|\\r\\n?)^```$)/m,\n\t\t\t\t\t\tlookbehind: true\n\t\t\t\t\t},\n\t\t\t\t\t'code-language': {\n\t\t\t\t\t\tpattern: /^(```).+/,\n\t\t\t\t\t\tlookbehind: true\n\t\t\t\t\t},\n\t\t\t\t\t'punctuation': /```/\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t'title': [\n\t\t\t{\n\t\t\t\t// title 1\n\t\t\t\t// =======\n\n\t\t\t\t// title 2\n\t\t\t\t// -------\n\t\t\t\tpattern: /\\S.*(?:\\n|\\r\\n?)(?:==+|--+)(?=[ \\t]*$)/m,\n\t\t\t\talias: 'important',\n\t\t\t\tinside: {\n\t\t\t\t\tpunctuation: /==+$|--+$/\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\t// # title 1\n\t\t\t\t// ###### title 6\n\t\t\t\tpattern: /(^\\s*)#.+/m,\n\t\t\t\tlookbehind: true,\n\t\t\t\talias: 'important',\n\t\t\t\tinside: {\n\t\t\t\t\tpunctuation: /^#+|#+$/\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t'hr': {\n\t\t\t// ***\n\t\t\t// ---\n\t\t\t// * * *\n\t\t\t// -----------\n\t\t\tpattern: /(^\\s*)([*-])(?:[\\t ]*\\2){2,}(?=\\s*$)/m,\n\t\t\tlookbehind: true,\n\t\t\talias: 'punctuation'\n\t\t},\n\t\t'list': {\n\t\t\t// * item\n\t\t\t// + item\n\t\t\t// - item\n\t\t\t// 1. item\n\t\t\tpattern: /(^\\s*)(?:[*+-]|\\d+\\.)(?=[\\t ].)/m,\n\t\t\tlookbehind: true,\n\t\t\talias: 'punctuation'\n\t\t},\n\t\t'url-reference': {\n\t\t\t// [id]: http://example.com \"Optional title\"\n\t\t\t// [id]: http://example.com 'Optional title'\n\t\t\t// [id]: http://example.com (Optional title)\n\t\t\t// [id]: <http://example.com> \"Optional title\"\n\t\t\tpattern: /!?\\[[^\\]]+\\]:[\\t ]+(?:\\S+|<(?:\\\\.|[^>\\\\])+>)(?:[\\t ]+(?:\"(?:\\\\.|[^\"\\\\])*\"|'(?:\\\\.|[^'\\\\])*'|\\((?:\\\\.|[^)\\\\])*\\)))?/,\n\t\t\tinside: {\n\t\t\t\t'variable': {\n\t\t\t\t\tpattern: /^(!?\\[)[^\\]]+/,\n\t\t\t\t\tlookbehind: true\n\t\t\t\t},\n\t\t\t\t'string': /(?:\"(?:\\\\.|[^\"\\\\])*\"|'(?:\\\\.|[^'\\\\])*'|\\((?:\\\\.|[^)\\\\])*\\))$/,\n\t\t\t\t'punctuation': /^[\\[\\]!:]|[<>]/\n\t\t\t},\n\t\t\talias: 'url'\n\t\t},\n\t\t'bold': {\n\t\t\t// **strong**\n\t\t\t// __strong__\n\n\t\t\t// allow one nested instance of italic text using the same delimiter\n\t\t\tpattern: createInline(/\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*/.source),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'content': {\n\t\t\t\t\tpattern: /(^..)[\\s\\S]+(?=..$)/,\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\tinside: {} // see below\n\t\t\t\t},\n\t\t\t\t'punctuation': /\\*\\*|__/\n\t\t\t}\n\t\t},\n\t\t'italic': {\n\t\t\t// *em*\n\t\t\t// _em_\n\n\t\t\t// allow one nested instance of bold text using the same delimiter\n\t\t\tpattern: createInline(/\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*/.source),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'content': {\n\t\t\t\t\tpattern: /(^.)[\\s\\S]+(?=.$)/,\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\tinside: {} // see below\n\t\t\t\t},\n\t\t\t\t'punctuation': /[*_]/\n\t\t\t}\n\t\t},\n\t\t'strike': {\n\t\t\t// ~~strike through~~\n\t\t\t// ~strike~\n\t\t\t// eslint-disable-next-line regexp/strict\n\t\t\tpattern: createInline(/(~~?)(?:(?!~)<inner>)+\\2/.source),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'content': {\n\t\t\t\t\tpattern: /(^~~?)[\\s\\S]+(?=\\1$)/,\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\tinside: {} // see below\n\t\t\t\t},\n\t\t\t\t'punctuation': /~~?/\n\t\t\t}\n\t\t},\n\t\t'code-snippet': {\n\t\t\t// `code`\n\t\t\t// ``code``\n\t\t\tpattern: /(^|[^\\\\`])(?:``[^`\\r\\n]+(?:`[^`\\r\\n]+)*``(?!`)|`[^`\\r\\n]+`(?!`))/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\talias: ['code', 'keyword']\n\t\t},\n\t\t'url': {\n\t\t\t// [example](http://example.com \"Optional title\")\n\t\t\t// [example][id]\n\t\t\t// [example] [id]\n\t\t\tpattern: createInline(/!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+\"(?:\\\\.|[^\"\\\\])*\")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])/.source),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'operator': /^!/,\n\t\t\t\t'content': {\n\t\t\t\t\tpattern: /(^\\[)[^\\]]+(?=\\])/,\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\tinside: {} // see below\n\t\t\t\t},\n\t\t\t\t'variable': {\n\t\t\t\t\tpattern: /(^\\][ \\t]?\\[)[^\\]]+(?=\\]$)/,\n\t\t\t\t\tlookbehind: true\n\t\t\t\t},\n\t\t\t\t'url': {\n\t\t\t\t\tpattern: /(^\\]\\()[^\\s)]+/,\n\t\t\t\t\tlookbehind: true\n\t\t\t\t},\n\t\t\t\t'string': {\n\t\t\t\t\tpattern: /(^[ \\t]+)\"(?:\\\\.|[^\"\\\\])*\"(?=\\)$)/,\n\t\t\t\t\tlookbehind: true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\t['url', 'bold', 'italic', 'strike'].forEach(function (token) {\n\t\t['url', 'bold', 'italic', 'strike', 'code-snippet'].forEach(function (inside) {\n\t\t\tif (token !== inside) {\n\t\t\t\tPrism.languages.markdown[token].inside.content.inside[inside] = Prism.languages.markdown[inside];\n\t\t\t}\n\t\t});\n\t});\n\n\tPrism.hooks.add('after-tokenize', function (env) {\n\t\tif (env.language !== 'markdown' && env.language !== 'md') {\n\t\t\treturn;\n\t\t}\n\n\t\tfunction walkTokens(tokens) {\n\t\t\tif (!tokens || typeof tokens === 'string') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (var i = 0, l = tokens.length; i < l; i++) {\n\t\t\t\tvar token = tokens[i];\n\n\t\t\t\tif (token.type !== 'code') {\n\t\t\t\t\twalkTokens(token.content);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * Add the correct `language-xxxx` class to this code block. Keep in mind that the `code-language` token\n\t\t\t\t * is optional. But the grammar is defined so that there is only one case we have to handle:\n\t\t\t\t *\n\t\t\t\t * token.content = [\n\t\t\t\t *     <span class=\"punctuation\">```</span>,\n\t\t\t\t *     <span class=\"code-language\">xxxx</span>,\n\t\t\t\t *     '\\n', // exactly one new lines (\\r or \\n or \\r\\n)\n\t\t\t\t *     <span class=\"code-block\">...</span>,\n\t\t\t\t *     '\\n', // exactly one new lines again\n\t\t\t\t *     <span class=\"punctuation\">```</span>\n\t\t\t\t * ];\n\t\t\t\t */\n\n\t\t\t\tvar codeLang = token.content[1];\n\t\t\t\tvar codeBlock = token.content[3];\n\n\t\t\t\tif (codeLang && codeBlock &&\n\t\t\t\t\tcodeLang.type === 'code-language' && codeBlock.type === 'code-block' &&\n\t\t\t\t\ttypeof codeLang.content === 'string') {\n\n\t\t\t\t\t// this might be a language that Prism does not support\n\n\t\t\t\t\t// do some replacements to support C++, C#, and F#\n\t\t\t\t\tvar lang = codeLang.content.replace(/\\b#/g, 'sharp').replace(/\\b\\+\\+/g, 'pp');\n\t\t\t\t\t// only use the first word\n\t\t\t\t\tlang = (/[a-z][\\w-]*/i.exec(lang) || [''])[0].toLowerCase();\n\t\t\t\t\tvar alias = 'language-' + lang;\n\n\t\t\t\t\t// add alias\n\t\t\t\t\tif (!codeBlock.alias) {\n\t\t\t\t\t\tcodeBlock.alias = [alias];\n\t\t\t\t\t} else if (typeof codeBlock.alias === 'string') {\n\t\t\t\t\t\tcodeBlock.alias = [codeBlock.alias, alias];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcodeBlock.alias.push(alias);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\twalkTokens(env.tokens);\n\t});\n\n\tPrism.hooks.add('wrap', function (env) {\n\t\tif (env.type !== 'code-block') {\n\t\t\treturn;\n\t\t}\n\n\t\tvar codeLang = '';\n\t\tfor (var i = 0, l = env.classes.length; i < l; i++) {\n\t\t\tvar cls = env.classes[i];\n\t\t\tvar match = /language-(.+)/.exec(cls);\n\t\t\tif (match) {\n\t\t\t\tcodeLang = match[1];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tvar grammar = Prism.languages[codeLang];\n\n\t\tif (!grammar) {\n\t\t\tif (codeLang && codeLang !== 'none' && Prism.plugins.autoloader) {\n\t\t\t\tvar id = 'md-' + new Date().valueOf() + '-' + Math.floor(Math.random() * 1e16);\n\t\t\t\tenv.attributes['id'] = id;\n\n\t\t\t\tPrism.plugins.autoloader.loadLanguages(codeLang, function () {\n\t\t\t\t\tvar ele = document.getElementById(id);\n\t\t\t\t\tif (ele) {\n\t\t\t\t\t\tele.innerHTML = Prism.highlight(ele.textContent, Prism.languages[codeLang], codeLang);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tenv.content = Prism.highlight(textContent(env.content), grammar, codeLang);\n\t\t}\n\t});\n\n\tvar tagPattern = RegExp(Prism.languages.markup.tag.pattern.source, 'gi');\n\n\t/**\n\t * A list of known entity names.\n\t *\n\t * This will always be incomplete to save space. The current list is the one used by lowdash's unescape function.\n\t *\n\t * @see {@link https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/unescape.js#L2}\n\t */\n\tvar KNOWN_ENTITY_NAMES = {\n\t\t'amp': '&',\n\t\t'lt': '<',\n\t\t'gt': '>',\n\t\t'quot': '\"',\n\t};\n\n\t// IE 11 doesn't support `String.fromCodePoint`\n\tvar fromCodePoint = String.fromCodePoint || String.fromCharCode;\n\n\t/**\n\t * Returns the text content of a given HTML source code string.\n\t *\n\t * @param {string} html\n\t * @returns {string}\n\t */\n\tfunction textContent(html) {\n\t\t// remove all tags\n\t\tvar text = html.replace(tagPattern, '');\n\n\t\t// decode known entities\n\t\ttext = text.replace(/&(\\w{1,8}|#x?[\\da-f]{1,8});/gi, function (m, code) {\n\t\t\tcode = code.toLowerCase();\n\n\t\t\tif (code[0] === '#') {\n\t\t\t\tvar value;\n\t\t\t\tif (code[1] === 'x') {\n\t\t\t\t\tvalue = parseInt(code.slice(2), 16);\n\t\t\t\t} else {\n\t\t\t\t\tvalue = Number(code.slice(1));\n\t\t\t\t}\n\n\t\t\t\treturn fromCodePoint(value);\n\t\t\t} else {\n\t\t\t\tvar known = KNOWN_ENTITY_NAMES[code];\n\t\t\t\tif (known) {\n\t\t\t\t\treturn known;\n\t\t\t\t}\n\n\t\t\t\t// unable to decode\n\t\t\t\treturn m;\n\t\t\t}\n\t\t});\n\n\t\treturn text;\n\t}\n\n\tPrism.languages.md = Prism.languages.markdown;\n\n}(Prism));\n", "Prism.languages.c = Prism.languages.extend('clike', {\n\t'comment': {\n\t\tpattern: /\\/\\/(?:[^\\r\\n\\\\]|\\\\(?:\\r\\n?|\\n|(?![\\r\\n])))*|\\/\\*[\\s\\S]*?(?:\\*\\/|$)/,\n\t\tgreedy: true\n\t},\n\t'string': {\n\t\t// https://en.cppreference.com/w/c/language/string_literal\n\t\tpattern: /\"(?:\\\\(?:\\r\\n|[\\s\\S])|[^\"\\\\\\r\\n])*\"/,\n\t\tgreedy: true\n\t},\n\t'class-name': {\n\t\tpattern: /(\\b(?:enum|struct)\\s+(?:__attribute__\\s*\\(\\([\\s\\S]*?\\)\\)\\s*)?)\\w+|\\b[a-z]\\w*_t\\b/,\n\t\tlookbehind: true\n\t},\n\t'keyword': /\\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\\b/,\n\t'function': /\\b[a-z_]\\w*(?=\\s*\\()/i,\n\t'number': /(?:\\b0x(?:[\\da-f]+(?:\\.[\\da-f]*)?|\\.[\\da-f]+)(?:p[+-]?\\d+)?|(?:\\b\\d+(?:\\.\\d*)?|\\B\\.\\d+)(?:e[+-]?\\d+)?)[ful]{0,4}/i,\n\t'operator': />>=?|<<=?|->|([-+&|:])\\1|[?:~]|[-+*/%&|^!=<>]=?/\n});\n\nPrism.languages.insertBefore('c', 'string', {\n\t'char': {\n\t\t// https://en.cppreference.com/w/c/language/character_constant\n\t\tpattern: /'(?:\\\\(?:\\r\\n|[\\s\\S])|[^'\\\\\\r\\n]){0,32}'/,\n\t\tgreedy: true\n\t}\n});\n\nPrism.languages.insertBefore('c', 'string', {\n\t'macro': {\n\t\t// allow for multiline macro definitions\n\t\t// spaces after the # character compile fine with gcc\n\t\tpattern: /(^[\\t ]*)#\\s*[a-z](?:[^\\r\\n\\\\/]|\\/(?!\\*)|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|\\\\(?:\\r\\n|[\\s\\S]))*/im,\n\t\tlookbehind: true,\n\t\tgreedy: true,\n\t\talias: 'property',\n\t\tinside: {\n\t\t\t'string': [\n\t\t\t\t{\n\t\t\t\t\t// highlight the path of the include statement as a string\n\t\t\t\t\tpattern: /^(#\\s*include\\s*)<[^>]+>/,\n\t\t\t\t\tlookbehind: true\n\t\t\t\t},\n\t\t\t\tPrism.languages.c['string']\n\t\t\t],\n\t\t\t'char': Prism.languages.c['char'],\n\t\t\t'comment': Prism.languages.c['comment'],\n\t\t\t'macro-name': [\n\t\t\t\t{\n\t\t\t\t\tpattern: /(^#\\s*define\\s+)\\w+\\b(?!\\()/i,\n\t\t\t\t\tlookbehind: true\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tpattern: /(^#\\s*define\\s+)\\w+\\b(?=\\()/i,\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\talias: 'function'\n\t\t\t\t}\n\t\t\t],\n\t\t\t// highlight macro directives as keywords\n\t\t\t'directive': {\n\t\t\t\tpattern: /^(#\\s*)[a-z]+/,\n\t\t\t\tlookbehind: true,\n\t\t\t\talias: 'keyword'\n\t\t\t},\n\t\t\t'directive-hash': /^#/,\n\t\t\t'punctuation': /##|\\\\(?=[\\r\\n])/,\n\t\t\t'expression': {\n\t\t\t\tpattern: /\\S[\\s\\S]*/,\n\t\t\t\tinside: Prism.languages.c\n\t\t\t}\n\t\t}\n\t}\n});\n\nPrism.languages.insertBefore('c', 'function', {\n\t// highlight predefined macros as constants\n\t'constant': /\\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\\b/\n});\n\ndelete Prism.languages.c['boolean'];\n", "(function (Prism) {\n\n\tvar string = /(?:\"(?:\\\\(?:\\r\\n|[\\s\\S])|[^\"\\\\\\r\\n])*\"|'(?:\\\\(?:\\r\\n|[\\s\\S])|[^'\\\\\\r\\n])*')/;\n\n\tPrism.languages.css = {\n\t\t'comment': /\\/\\*[\\s\\S]*?\\*\\//,\n\t\t'atrule': {\n\t\t\tpattern: RegExp('@[\\\\w-](?:' + /[^;{\\s\"']|\\s+(?!\\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\\s*\\{))/.source),\n\t\t\tinside: {\n\t\t\t\t'rule': /^@[\\w-]+/,\n\t\t\t\t'selector-function-argument': {\n\t\t\t\t\tpattern: /(\\bselector\\s*\\(\\s*(?![\\s)]))(?:[^()\\s]|\\s+(?![\\s)])|\\((?:[^()]|\\([^()]*\\))*\\))+(?=\\s*\\))/,\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\talias: 'selector'\n\t\t\t\t},\n\t\t\t\t'keyword': {\n\t\t\t\t\tpattern: /(^|[^\\w-])(?:and|not|only|or)(?![\\w-])/,\n\t\t\t\t\tlookbehind: true\n\t\t\t\t}\n\t\t\t\t// See rest below\n\t\t\t}\n\t\t},\n\t\t'url': {\n\t\t\t// https://drafts.csswg.org/css-values-3/#urls\n\t\t\tpattern: RegExp('\\\\burl\\\\((?:' + string.source + '|' + /(?:[^\\\\\\r\\n()\"']|\\\\[\\s\\S])*/.source + ')\\\\)', 'i'),\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'function': /^url/i,\n\t\t\t\t'punctuation': /^\\(|\\)$/,\n\t\t\t\t'string': {\n\t\t\t\t\tpattern: RegExp('^' + string.source + '$'),\n\t\t\t\t\talias: 'url'\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t'selector': {\n\t\t\tpattern: RegExp('(^|[{}\\\\s])[^{}\\\\s](?:[^{};\"\\'\\\\s]|\\\\s+(?![\\\\s{])|' + string.source + ')*(?=\\\\s*\\\\{)'),\n\t\t\tlookbehind: true\n\t\t},\n\t\t'string': {\n\t\t\tpattern: string,\n\t\t\tgreedy: true\n\t\t},\n\t\t'property': {\n\t\t\tpattern: /(^|[^-\\w\\xA0-\\uFFFF])(?!\\s)[-_a-z\\xA0-\\uFFFF](?:(?!\\s)[-\\w\\xA0-\\uFFFF])*(?=\\s*:)/i,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'important': /!important\\b/i,\n\t\t'function': {\n\t\t\tpattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\\()/i,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'punctuation': /[(){};:,]/\n\t};\n\n\tPrism.languages.css['atrule'].inside.rest = Prism.languages.css;\n\n\tvar markup = Prism.languages.markup;\n\tif (markup) {\n\t\tmarkup.tag.addInlined('style', 'css');\n\t\tmarkup.tag.addAttribute('style', 'css');\n\t}\n\n}(Prism));\n", "Prism.languages.objectivec = Prism.languages.extend('c', {\n\t'string': {\n\t\tpattern: /@?\"(?:\\\\(?:\\r\\n|[\\s\\S])|[^\"\\\\\\r\\n])*\"/,\n\t\tgreedy: true\n\t},\n\t'keyword': /\\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\\b/,\n\t'operator': /-[->]?|\\+\\+?|!=?|<<?=?|>>?=?|==?|&&?|\\|\\|?|[~^%?*\\/@]/\n});\n\ndelete Prism.languages.objectivec['class-name'];\n\nPrism.languages.objc = Prism.languages.objectivec;\n", "Prism.languages.sql = {\n\t'comment': {\n\t\tpattern: /(^|[^\\\\])(?:\\/\\*[\\s\\S]*?\\*\\/|(?:--|\\/\\/|#).*)/,\n\t\tlookbehind: true\n\t},\n\t'variable': [\n\t\t{\n\t\t\tpattern: /@([\"'`])(?:\\\\[\\s\\S]|(?!\\1)[^\\\\])+\\1/,\n\t\t\tgreedy: true\n\t\t},\n\t\t/@[\\w.$]+/\n\t],\n\t'string': {\n\t\tpattern: /(^|[^@\\\\])(\"|')(?:\\\\[\\s\\S]|(?!\\2)[^\\\\]|\\2\\2)*\\2/,\n\t\tgreedy: true,\n\t\tlookbehind: true\n\t},\n\t'identifier': {\n\t\tpattern: /(^|[^@\\\\])`(?:\\\\[\\s\\S]|[^`\\\\]|``)*`/,\n\t\tgreedy: true,\n\t\tlookbehind: true,\n\t\tinside: {\n\t\t\t'punctuation': /^`|`$/\n\t\t}\n\t},\n\t'function': /\\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\\s*\\()/i, // Should we highlight user defined functions too?\n\t'keyword': /\\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\\b/i,\n\t'boolean': /\\b(?:FALSE|NULL|TRUE)\\b/i,\n\t'number': /\\b0x[\\da-f]+\\b|\\b\\d+(?:\\.\\d*)?|\\B\\.\\d+\\b/i,\n\t'operator': /[-+*\\/=%^~]|&&?|\\|\\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\\b/i,\n\t'punctuation': /[;[\\]()`,.]/\n};\n", "(function (Prism) {\n\n\tvar powershell = Prism.languages.powershell = {\n\t\t'comment': [\n\t\t\t{\n\t\t\t\tpattern: /(^|[^`])<#[\\s\\S]*?#>/,\n\t\t\t\tlookbehind: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(^|[^`])#.*/,\n\t\t\t\tlookbehind: true\n\t\t\t}\n\t\t],\n\t\t'string': [\n\t\t\t{\n\t\t\t\tpattern: /\"(?:`[\\s\\S]|[^`\"])*\"/,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: null // see below\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /'(?:[^']|'')*'/,\n\t\t\t\tgreedy: true\n\t\t\t}\n\t\t],\n\t\t// Matches name spaces as well as casts, attribute decorators. Force starting with letter to avoid matching array indices\n\t\t// Supports two levels of nested brackets (e.g. `[OutputType([System.Collections.Generic.List[int]])]`)\n\t\t'namespace': /\\[[a-z](?:\\[(?:\\[[^\\]]*\\]|[^\\[\\]])*\\]|[^\\[\\]])*\\]/i,\n\t\t'boolean': /\\$(?:false|true)\\b/i,\n\t\t'variable': /\\$\\w+\\b/,\n\t\t// Cmdlets and aliases. Aliases should come last, otherwise \"write\" gets preferred over \"write-host\" for example\n\t\t// Get-Command | ?{ $_.ModuleName -match \"Microsoft.PowerShell.(Util|Core|Management)\" }\n\t\t// Get-Alias | ?{ $_.ReferencedCommand.Module.Name -match \"Microsoft.PowerShell.(Util|Core|Management)\" }\n\t\t'function': [\n\t\t\t/\\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\\b/i,\n\t\t\t/\\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\\b/i\n\t\t],\n\t\t// per http://technet.microsoft.com/en-us/library/hh847744.aspx\n\t\t'keyword': /\\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\\b/i,\n\t\t'operator': {\n\t\t\tpattern: /(^|\\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\\b|-[-=]?|\\+[+=]?|[*\\/%]=?)/i,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'punctuation': /[|{}[\\];(),.]/\n\t};\n\n\t// Variable interpolation inside strings, and nested expressions\n\tpowershell.string[0].inside = {\n\t\t'function': {\n\t\t\t// Allow for one level of nesting\n\t\t\tpattern: /(^|[^`])\\$\\((?:\\$\\([^\\r\\n()]*\\)|(?!\\$\\()[^\\r\\n)])*\\)/,\n\t\t\tlookbehind: true,\n\t\t\tinside: powershell\n\t\t},\n\t\t'boolean': powershell.boolean,\n\t\t'variable': powershell.variable,\n\t};\n\n}(Prism));\n", "Prism.languages.python = {\n\t'comment': {\n\t\tpattern: /(^|[^\\\\])#.*/,\n\t\tlookbehind: true,\n\t\tgreedy: true\n\t},\n\t'string-interpolation': {\n\t\tpattern: /(?:f|fr|rf)(?:(\"\"\"|''')[\\s\\S]*?\\1|(\"|')(?:\\\\.|(?!\\2)[^\\\\\\r\\n])*\\2)/i,\n\t\tgreedy: true,\n\t\tinside: {\n\t\t\t'interpolation': {\n\t\t\t\t// \"{\" <expression> <optional \"!s\", \"!r\", or \"!a\"> <optional \":\" format specifier> \"}\"\n\t\t\t\tpattern: /((?:^|[^{])(?:\\{\\{)*)\\{(?!\\{)(?:[^{}]|\\{(?!\\{)(?:[^{}]|\\{(?!\\{)(?:[^{}])+\\})+\\})+\\}/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'format-spec': {\n\t\t\t\t\t\tpattern: /(:)[^:(){}]+(?=\\}$)/,\n\t\t\t\t\t\tlookbehind: true\n\t\t\t\t\t},\n\t\t\t\t\t'conversion-option': {\n\t\t\t\t\t\tpattern: /![sra](?=[:}]$)/,\n\t\t\t\t\t\talias: 'punctuation'\n\t\t\t\t\t},\n\t\t\t\t\trest: null\n\t\t\t\t}\n\t\t\t},\n\t\t\t'string': /[\\s\\S]+/\n\t\t}\n\t},\n\t'triple-quoted-string': {\n\t\tpattern: /(?:[rub]|br|rb)?(\"\"\"|''')[\\s\\S]*?\\1/i,\n\t\tgreedy: true,\n\t\talias: 'string'\n\t},\n\t'string': {\n\t\tpattern: /(?:[rub]|br|rb)?(\"|')(?:\\\\.|(?!\\1)[^\\\\\\r\\n])*\\1/i,\n\t\tgreedy: true\n\t},\n\t'function': {\n\t\tpattern: /((?:^|\\s)def[ \\t]+)[a-zA-Z_]\\w*(?=\\s*\\()/g,\n\t\tlookbehind: true\n\t},\n\t'class-name': {\n\t\tpattern: /(\\bclass\\s+)\\w+/i,\n\t\tlookbehind: true\n\t},\n\t'decorator': {\n\t\tpattern: /(^[\\t ]*)@\\w+(?:\\.\\w+)*/m,\n\t\tlookbehind: true,\n\t\talias: ['annotation', 'punctuation'],\n\t\tinside: {\n\t\t\t'punctuation': /\\./\n\t\t}\n\t},\n\t'keyword': /\\b(?:_(?=\\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\\b/,\n\t'builtin': /\\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\\b/,\n\t'boolean': /\\b(?:False|None|True)\\b/,\n\t'number': /\\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\\b|(?:\\b\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\B\\.\\d+(?:_\\d+)*)(?:e[+-]?\\d+(?:_\\d+)*)?j?(?!\\w)/i,\n\t'operator': /[-+%=]=?|!=|:=|\\*\\*?=?|\\/\\/?=?|<[<=>]?|>[=>]?|[&|^~]/,\n\t'punctuation': /[{}[\\];(),.:]/\n};\n\nPrism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python;\n\nPrism.languages.py = Prism.languages.python;\n", "(function (Prism) {\n\n\tvar multilineComment = /\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\//.source;\n\tfor (var i = 0; i < 2; i++) {\n\t\t// support 4 levels of nested comments\n\t\tmultilineComment = multilineComment.replace(/<self>/g, function () { return multilineComment; });\n\t}\n\tmultilineComment = multilineComment.replace(/<self>/g, function () { return /[^\\s\\S]/.source; });\n\n\n\tPrism.languages.rust = {\n\t\t'comment': [\n\t\t\t{\n\t\t\t\tpattern: RegExp(/(^|[^\\\\])/.source + multilineComment),\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(^|[^\\\\:])\\/\\/.*/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true\n\t\t\t}\n\t\t],\n\t\t'string': {\n\t\t\tpattern: /b?\"(?:\\\\[\\s\\S]|[^\\\\\"])*\"|b?r(#*)\"(?:[^\"]|\"(?!\\1))*\"\\1/,\n\t\t\tgreedy: true\n\t\t},\n\t\t'char': {\n\t\t\tpattern: /b?'(?:\\\\(?:x[0-7][\\da-fA-F]|u\\{(?:[\\da-fA-F]_*){1,6}\\}|.)|[^\\\\\\r\\n\\t'])'/,\n\t\t\tgreedy: true\n\t\t},\n\t\t'attribute': {\n\t\t\tpattern: /#!?\\[(?:[^\\[\\]\"]|\"(?:\\\\[\\s\\S]|[^\\\\\"])*\")*\\]/,\n\t\t\tgreedy: true,\n\t\t\talias: 'attr-name',\n\t\t\tinside: {\n\t\t\t\t'string': null // see below\n\t\t\t}\n\t\t},\n\n\t\t// Closure params should not be confused with bitwise OR |\n\t\t'closure-params': {\n\t\t\tpattern: /([=(,:]\\s*|\\bmove\\s*)\\|[^|]*\\||\\|[^|]*\\|(?=\\s*(?:\\{|->))/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'closure-punctuation': {\n\t\t\t\t\tpattern: /^\\||\\|$/,\n\t\t\t\t\talias: 'punctuation'\n\t\t\t\t},\n\t\t\t\trest: null // see below\n\t\t\t}\n\t\t},\n\n\t\t'lifetime-annotation': {\n\t\t\tpattern: /'\\w+/,\n\t\t\talias: 'symbol'\n\t\t},\n\n\t\t'fragment-specifier': {\n\t\t\tpattern: /(\\$\\w+:)[a-z]+/,\n\t\t\tlookbehind: true,\n\t\t\talias: 'punctuation'\n\t\t},\n\t\t'variable': /\\$\\w+/,\n\n\t\t'function-definition': {\n\t\t\tpattern: /(\\bfn\\s+)\\w+/,\n\t\t\tlookbehind: true,\n\t\t\talias: 'function'\n\t\t},\n\t\t'type-definition': {\n\t\t\tpattern: /(\\b(?:enum|struct|trait|type|union)\\s+)\\w+/,\n\t\t\tlookbehind: true,\n\t\t\talias: 'class-name'\n\t\t},\n\t\t'module-declaration': [\n\t\t\t{\n\t\t\t\tpattern: /(\\b(?:crate|mod)\\s+)[a-z][a-z_\\d]*/,\n\t\t\t\tlookbehind: true,\n\t\t\t\talias: 'namespace'\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(\\b(?:crate|self|super)\\s*)::\\s*[a-z][a-z_\\d]*\\b(?:\\s*::(?:\\s*[a-z][a-z_\\d]*\\s*::)*)?/,\n\t\t\t\tlookbehind: true,\n\t\t\t\talias: 'namespace',\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': /::/\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t'keyword': [\n\t\t\t// https://github.com/rust-lang/reference/blob/master/src/keywords.md\n\t\t\t/\\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\\b/,\n\t\t\t// primitives and str\n\t\t\t// https://doc.rust-lang.org/stable/rust-by-example/primitives.html\n\t\t\t/\\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\\b/\n\t\t],\n\n\t\t// functions can technically start with an upper-case letter, but this will introduce a lot of false positives\n\t\t// and Rust's naming conventions recommend snake_case anyway.\n\t\t// https://doc.rust-lang.org/1.0.0/style/style/naming/README.html\n\t\t'function': /\\b[a-z_]\\w*(?=\\s*(?:::\\s*<|\\())/,\n\t\t'macro': {\n\t\t\tpattern: /\\b\\w+!/,\n\t\t\talias: 'property'\n\t\t},\n\t\t'constant': /\\b[A-Z_][A-Z_\\d]+\\b/,\n\t\t'class-name': /\\b[A-Z]\\w*\\b/,\n\n\t\t'namespace': {\n\t\t\tpattern: /(?:\\b[a-z][a-z_\\d]*\\s*::\\s*)*\\b[a-z][a-z_\\d]*\\s*::(?!\\s*<)/,\n\t\t\tinside: {\n\t\t\t\t'punctuation': /::/\n\t\t\t}\n\t\t},\n\n\t\t// Hex, oct, bin, dec numbers with visual separators and type suffix\n\t\t'number': /\\b(?:0x[\\dA-Fa-f](?:_?[\\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\\d(?:_?\\d)*)?\\.)?\\d(?:_?\\d)*(?:[Ee][+-]?\\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\\b/,\n\t\t'boolean': /\\b(?:false|true)\\b/,\n\t\t'punctuation': /->|\\.\\.=|\\.{1,3}|::|[{}[\\];(),:]/,\n\t\t'operator': /[-+*\\/%!^]=?|=[=>]?|&[&=]?|\\|[|=]?|<<?=?|>>?=?|[@?]/\n\t};\n\n\tPrism.languages.rust['closure-params'].inside.rest = Prism.languages.rust;\n\tPrism.languages.rust['attribute'].inside['string'] = Prism.languages.rust['string'];\n\n}(Prism));\n", "Prism.languages.swift = {\n\t'comment': {\n\t\t// Nested comments are supported up to 2 levels\n\t\tpattern: /(^|[^\\\\:])(?:\\/\\/.*|\\/\\*(?:[^/*]|\\/(?!\\*)|\\*(?!\\/)|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*\\*\\/)/,\n\t\tlookbehind: true,\n\t\tgreedy: true\n\t},\n\t'string-literal': [\n\t\t// https://docs.swift.org/swift-book/LanguageGuide/StringsAndCharacters.html\n\t\t{\n\t\t\tpattern: RegExp(\n\t\t\t\t/(^|[^\"#])/.source\n\t\t\t\t+ '(?:'\n\t\t\t\t// single-line string\n\t\t\t\t+ /\"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^(])|[^\\\\\\r\\n\"])*\"/.source\n\t\t\t\t+ '|'\n\t\t\t\t// multi-line string\n\t\t\t\t+ /\"\"\"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\\"]|\"(?!\"\"))*\"\"\"/.source\n\t\t\t\t+ ')'\n\t\t\t\t+ /(?![\"#])/.source\n\t\t\t),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'interpolation': {\n\t\t\t\t\tpattern: /(\\\\\\()(?:[^()]|\\([^()]*\\))*(?=\\))/,\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\tinside: null // see below\n\t\t\t\t},\n\t\t\t\t'interpolation-punctuation': {\n\t\t\t\t\tpattern: /^\\)|\\\\\\($/,\n\t\t\t\t\talias: 'punctuation'\n\t\t\t\t},\n\t\t\t\t'punctuation': /\\\\(?=[\\r\\n])/,\n\t\t\t\t'string': /[\\s\\S]+/\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpattern: RegExp(\n\t\t\t\t/(^|[^\"#])(#+)/.source\n\t\t\t\t+ '(?:'\n\t\t\t\t// single-line string\n\t\t\t\t+ /\"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^#])|[^\\\\\\r\\n])*?\"/.source\n\t\t\t\t+ '|'\n\t\t\t\t// multi-line string\n\t\t\t\t+ /\"\"\"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?\"\"\"/.source\n\t\t\t\t+ ')'\n\t\t\t\t+ '\\\\2'\n\t\t\t),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'interpolation': {\n\t\t\t\t\tpattern: /(\\\\#+\\()(?:[^()]|\\([^()]*\\))*(?=\\))/,\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\tinside: null // see below\n\t\t\t\t},\n\t\t\t\t'interpolation-punctuation': {\n\t\t\t\t\tpattern: /^\\)|\\\\#+\\($/,\n\t\t\t\t\talias: 'punctuation'\n\t\t\t\t},\n\t\t\t\t'string': /[\\s\\S]+/\n\t\t\t}\n\t\t},\n\t],\n\n\t'directive': {\n\t\t// directives with conditions\n\t\tpattern: RegExp(\n\t\t\t/#/.source\n\t\t\t+ '(?:'\n\t\t\t+ (\n\t\t\t\t/(?:elseif|if)\\b/.source\n\t\t\t\t+ '(?:[ \\t]*'\n\t\t\t\t// This regex is a little complex. It's equivalent to this:\n\t\t\t\t//   (?:![ \\t]*)?(?:\\b\\w+\\b(?:[ \\t]*<round>)?|<round>)(?:[ \\t]*(?:&&|\\|\\|))?\n\t\t\t\t// where <round> is a general parentheses expression.\n\t\t\t\t+ /(?:![ \\t]*)?(?:\\b\\w+\\b(?:[ \\t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \\t]*(?:&&|\\|\\|))?/.source\n\t\t\t\t+ ')+'\n\t\t\t)\n\t\t\t+ '|'\n\t\t\t+ /(?:else|endif)\\b/.source\n\t\t\t+ ')'\n\t\t),\n\t\talias: 'property',\n\t\tinside: {\n\t\t\t'directive-name': /^#\\w+/,\n\t\t\t'boolean': /\\b(?:false|true)\\b/,\n\t\t\t'number': /\\b\\d+(?:\\.\\d+)*\\b/,\n\t\t\t'operator': /!|&&|\\|\\||[<>]=?/,\n\t\t\t'punctuation': /[(),]/\n\t\t}\n\t},\n\t'literal': {\n\t\tpattern: /#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\\b/,\n\t\talias: 'constant'\n\t},\n\t'other-directive': {\n\t\tpattern: /#\\w+\\b/,\n\t\talias: 'property'\n\t},\n\n\t'attribute': {\n\t\tpattern: /@\\w+/,\n\t\talias: 'atrule'\n\t},\n\n\t'function-definition': {\n\t\tpattern: /(\\bfunc\\s+)\\w+/,\n\t\tlookbehind: true,\n\t\talias: 'function'\n\t},\n\t'label': {\n\t\t// https://docs.swift.org/swift-book/LanguageGuide/ControlFlow.html#ID141\n\t\tpattern: /\\b(break|continue)\\s+\\w+|\\b[a-zA-Z_]\\w*(?=\\s*:\\s*(?:for|repeat|while)\\b)/,\n\t\tlookbehind: true,\n\t\talias: 'important'\n\t},\n\n\t'keyword': /\\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\\b/,\n\t'boolean': /\\b(?:false|true)\\b/,\n\t'nil': {\n\t\tpattern: /\\bnil\\b/,\n\t\talias: 'constant'\n\t},\n\n\t'short-argument': /\\$\\d+\\b/,\n\t'omit': {\n\t\tpattern: /\\b_\\b/,\n\t\talias: 'keyword'\n\t},\n\t'number': /\\b(?:[\\d_]+(?:\\.[\\de_]+)?|0x[a-f0-9_]+(?:\\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\\b/i,\n\n\t// A class name must start with an upper-case letter and be either 1 letter long or contain a lower-case letter.\n\t'class-name': /\\b[A-Z](?:[A-Z_\\d]*[a-z]\\w*)?\\b/,\n\t'function': /\\b[a-z_]\\w*(?=\\s*\\()/i,\n\t'constant': /\\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\\b/,\n\n\t// Operators are generic in Swift. Developers can even create new operators (e.g. +++).\n\t// https://docs.swift.org/swift-book/ReferenceManual/zzSummaryOfTheGrammar.html#ID481\n\t// This regex only supports ASCII operators.\n\t'operator': /[-+*/%=!<>&|^~?]+|\\.[.\\-+*/%=!<>&|^~?]+/,\n\t'punctuation': /[{}[\\]();,.:\\\\]/\n};\n\nPrism.languages.swift['string-literal'].forEach(function (rule) {\n\trule.inside['interpolation'].inside = Prism.languages.swift;\n});\n", "(function (Prism) {\n\n\tPrism.languages.typescript = Prism.languages.extend('javascript', {\n\t\t'class-name': {\n\t\t\tpattern: /(\\b(?:class|extends|implements|instanceof|interface|new|type)\\s+)(?!keyof\\b)(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*(?:\\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: null // see below\n\t\t},\n\t\t'builtin': /\\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\\b/,\n\t});\n\n\t// The keywords TypeScript adds to JavaScript\n\tPrism.languages.typescript.keyword.push(\n\t\t/\\b(?:abstract|declare|is|keyof|readonly|require)\\b/,\n\t\t// keywords that have to be followed by an identifier\n\t\t/\\b(?:asserts|infer|interface|module|namespace|type)\\b(?=\\s*(?:[{_$a-zA-Z\\xA0-\\uFFFF]|$))/,\n\t\t// This is for `import type *, {}`\n\t\t/\\btype\\b(?=\\s*(?:[\\{*]|$))/\n\t);\n\n\t// doesn't work with TS because TS is too complex\n\tdelete Prism.languages.typescript['parameter'];\n\tdelete Prism.languages.typescript['literal-property'];\n\n\t// a version of typescript specifically for highlighting types\n\tvar typeInside = Prism.languages.extend('typescript', {});\n\tdelete typeInside['class-name'];\n\n\tPrism.languages.typescript['class-name'].inside = typeInside;\n\n\tPrism.languages.insertBefore('typescript', 'function', {\n\t\t'decorator': {\n\t\t\tpattern: /@[$\\w\\xA0-\\uFFFF]+/,\n\t\t\tinside: {\n\t\t\t\t'at': {\n\t\t\t\t\tpattern: /^@/,\n\t\t\t\t\talias: 'operator'\n\t\t\t\t},\n\t\t\t\t'function': /^[\\s\\S]+/\n\t\t\t}\n\t\t},\n\t\t'generic-function': {\n\t\t\t// e.g. foo<T extends \"bar\" | \"baz\">( ...\n\t\t\tpattern: /#?(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*\\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\\s*\\()/,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'function': /^#?(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*/,\n\t\t\t\t'generic': {\n\t\t\t\t\tpattern: /<[\\s\\S]+/, // everything after the first <\n\t\t\t\t\talias: 'class-name',\n\t\t\t\t\tinside: typeInside\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tPrism.languages.ts = Prism.languages.typescript;\n\n}(Prism));\n", "(function (Prism) {\n\n\tvar keywords = /\\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\\s*[(){}[\\]<>=%~.:,;?+\\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\\b/;\n\n\t// full package (optional) + parent classes (optional)\n\tvar classNamePrefix = /(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*/.source;\n\n\t// based on the java naming conventions\n\tvar className = {\n\t\tpattern: RegExp(/(^|[^\\w.])/.source + classNamePrefix + /[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b/.source),\n\t\tlookbehind: true,\n\t\tinside: {\n\t\t\t'namespace': {\n\t\t\t\tpattern: /^[a-z]\\w*(?:\\s*\\.\\s*[a-z]\\w*)*(?:\\s*\\.)?/,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': /\\./\n\t\t\t\t}\n\t\t\t},\n\t\t\t'punctuation': /\\./\n\t\t}\n\t};\n\n\tPrism.languages.java = Prism.languages.extend('clike', {\n\t\t'string': {\n\t\t\tpattern: /(^|[^\\\\])\"(?:\\\\.|[^\"\\\\\\r\\n])*\"/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true\n\t\t},\n\t\t'class-name': [\n\t\t\tclassName,\n\t\t\t{\n\t\t\t\t// variables, parameters, and constructor references\n\t\t\t\t// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)\n\t\t\t\tpattern: RegExp(/(^|[^\\w.])/.source + classNamePrefix + /[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)/.source),\n\t\t\t\tlookbehind: true,\n\t\t\t\tinside: className.inside\n\t\t\t},\n\t\t\t{\n\t\t\t\t// class names based on keyword\n\t\t\t\t// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)\n\t\t\t\tpattern: RegExp(/(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)/.source + classNamePrefix + /[A-Z]\\w*\\b/.source),\n\t\t\t\tlookbehind: true,\n\t\t\t\tinside: className.inside\n\t\t\t}\n\t\t],\n\t\t'keyword': keywords,\n\t\t'function': [\n\t\t\tPrism.languages.clike.function,\n\t\t\t{\n\t\t\t\tpattern: /(::\\s*)[a-z_]\\w*/,\n\t\t\t\tlookbehind: true\n\t\t\t}\n\t\t],\n\t\t'number': /\\b0b[01][01_]*L?\\b|\\b0x(?:\\.[\\da-f_p+-]+|[\\da-f_]+(?:\\.[\\da-f_p+-]+)?)\\b|(?:\\b\\d[\\d_]*(?:\\.[\\d_]*)?|\\B\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[dfl]?/i,\n\t\t'operator': {\n\t\t\tpattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\\+\\+|&&|\\|\\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'constant': /\\b[A-Z][A-Z_\\d]+\\b/\n\t});\n\n\tPrism.languages.insertBefore('java', 'string', {\n\t\t'triple-quoted-string': {\n\t\t\t// http://openjdk.java.net/jeps/355#Description\n\t\t\tpattern: /\"\"\"[ \\t]*[\\r\\n](?:(?:\"|\"\")?(?:\\\\.|[^\"\\\\]))*\"\"\"/,\n\t\t\tgreedy: true,\n\t\t\talias: 'string'\n\t\t},\n\t\t'char': {\n\t\t\tpattern: /'(?:\\\\.|[^'\\\\\\r\\n]){1,6}'/,\n\t\t\tgreedy: true\n\t\t}\n\t});\n\n\tPrism.languages.insertBefore('java', 'class-name', {\n\t\t'annotation': {\n\t\t\tpattern: /(^|[^.])@\\w+(?:\\s*\\.\\s*\\w+)*/,\n\t\t\tlookbehind: true,\n\t\t\talias: 'punctuation'\n\t\t},\n\t\t'generics': {\n\t\t\tpattern: /<(?:[\\w\\s,.?]|&(?!&)|<(?:[\\w\\s,.?]|&(?!&)|<(?:[\\w\\s,.?]|&(?!&)|<(?:[\\w\\s,.?]|&(?!&))*>)*>)*>)*>/,\n\t\t\tinside: {\n\t\t\t\t'class-name': className,\n\t\t\t\t'keyword': keywords,\n\t\t\t\t'punctuation': /[<>(),.:]/,\n\t\t\t\t'operator': /[?&|]/\n\t\t\t}\n\t\t},\n\t\t'import': [\n\t\t\t{\n\t\t\t\tpattern: RegExp(/(\\bimport\\s+)/.source + classNamePrefix + /(?:[A-Z]\\w*|\\*)(?=\\s*;)/.source),\n\t\t\t\tlookbehind: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'namespace': className.inside.namespace,\n\t\t\t\t\t'punctuation': /\\./,\n\t\t\t\t\t'operator': /\\*/,\n\t\t\t\t\t'class-name': /\\w+/\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: RegExp(/(\\bimport\\s+static\\s+)/.source + classNamePrefix + /(?:\\w+|\\*)(?=\\s*;)/.source),\n\t\t\t\tlookbehind: true,\n\t\t\t\talias: 'static',\n\t\t\t\tinside: {\n\t\t\t\t\t'namespace': className.inside.namespace,\n\t\t\t\t\t'static': /\\b\\w+$/,\n\t\t\t\t\t'punctuation': /\\./,\n\t\t\t\t\t'operator': /\\*/,\n\t\t\t\t\t'class-name': /\\w+/\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t'namespace': {\n\t\t\tpattern: RegExp(\n\t\t\t\t/(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?/\n\t\t\t\t\t.source.replace(/<keyword>/g, function () { return keywords.source; })),\n\t\t\tlookbehind: true,\n\t\t\tinside: {\n\t\t\t\t'punctuation': /\\./,\n\t\t\t}\n\t\t}\n\t});\n}(Prism));\n", "(function (Prism) {\n\n\tvar keyword = /\\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\\b/;\n\tvar modName = /\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b/.source.replace(/<keyword>/g, function () { return keyword.source; });\n\n\tPrism.languages.cpp = Prism.languages.extend('c', {\n\t\t'class-name': [\n\t\t\t{\n\t\t\t\tpattern: RegExp(/(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+/.source\n\t\t\t\t\t.replace(/<keyword>/g, function () { return keyword.source; })),\n\t\t\t\tlookbehind: true\n\t\t\t},\n\t\t\t// This is intended to capture the class name of method implementations like:\n\t\t\t//   void foo::bar() const {}\n\t\t\t// However! The `foo` in the above example could also be a namespace, so we only capture the class name if\n\t\t\t// it starts with an uppercase letter. This approximation should give decent results.\n\t\t\t/\\b[A-Z]\\w*(?=\\s*::\\s*\\w+\\s*\\()/,\n\t\t\t// This will capture the class name before destructors like:\n\t\t\t//   Foo::~Foo() {}\n\t\t\t/\\b[A-Z_]\\w*(?=\\s*::\\s*~\\w+\\s*\\()/i,\n\t\t\t// This also intends to capture the class name of method implementations but here the class has template\n\t\t\t// parameters, so it can't be a namespace (until C++ adds generic namespaces).\n\t\t\t/\\b\\w+(?=\\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\\s*::\\s*\\w+\\s*\\()/\n\t\t],\n\t\t'keyword': keyword,\n\t\t'number': {\n\t\t\tpattern: /(?:\\b0b[01']+|\\b0x(?:[\\da-f']+(?:\\.[\\da-f']*)?|\\.[\\da-f']+)(?:p[+-]?[\\d']+)?|(?:\\b[\\d']+(?:\\.[\\d']*)?|\\B\\.[\\d']+)(?:e[+-]?[\\d']+)?)[ful]{0,4}/i,\n\t\t\tgreedy: true\n\t\t},\n\t\t'operator': />>=?|<<=?|->|--|\\+\\+|&&|\\|\\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\\b/,\n\t\t'boolean': /\\b(?:false|true)\\b/\n\t});\n\n\tPrism.languages.insertBefore('cpp', 'string', {\n\t\t'module': {\n\t\t\t// https://en.cppreference.com/w/cpp/language/modules\n\t\t\tpattern: RegExp(\n\t\t\t\t/(\\b(?:import|module)\\s+)/.source +\n\t\t\t\t'(?:' +\n\t\t\t\t// header-name\n\t\t\t\t/\"(?:\\\\(?:\\r\\n|[\\s\\S])|[^\"\\\\\\r\\n])*\"|<[^<>\\r\\n]*>/.source +\n\t\t\t\t'|' +\n\t\t\t\t// module name or partition or both\n\t\t\t\t/<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>/.source.replace(/<mod-name>/g, function () { return modName; }) +\n\t\t\t\t')'\n\t\t\t),\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'string': /^[<\"][\\s\\S]+/,\n\t\t\t\t'operator': /:/,\n\t\t\t\t'punctuation': /\\./\n\t\t\t}\n\t\t},\n\t\t'raw-string': {\n\t\t\tpattern: /R\"([^()\\\\ ]{0,16})\\([\\s\\S]*?\\)\\1\"/,\n\t\t\talias: 'string',\n\t\t\tgreedy: true\n\t\t}\n\t});\n\n\tPrism.languages.insertBefore('cpp', 'keyword', {\n\t\t'generic-function': {\n\t\t\tpattern: /\\b(?!operator\\b)[a-z_]\\w*\\s*<(?:[^<>]|<[^<>]*>)*>(?=\\s*\\()/i,\n\t\t\tinside: {\n\t\t\t\t'function': /^\\w+/,\n\t\t\t\t'generic': {\n\t\t\t\t\tpattern: /<[\\s\\S]+/,\n\t\t\t\t\talias: 'class-name',\n\t\t\t\t\tinside: Prism.languages.cpp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tPrism.languages.insertBefore('cpp', 'operator', {\n\t\t'double-colon': {\n\t\t\tpattern: /::/,\n\t\t\talias: 'punctuation'\n\t\t}\n\t});\n\n\tPrism.languages.insertBefore('cpp', 'class-name', {\n\t\t// the base clause is an optional list of parent classes\n\t\t// https://en.cppreference.com/w/cpp/language/class\n\t\t'base-clause': {\n\t\t\tpattern: /(\\b(?:class|struct)\\s+\\w+\\s*:\\s*)[^;{}\"'\\s]+(?:\\s+[^;{}\"'\\s]+)*(?=\\s*[;{])/,\n\t\t\tlookbehind: true,\n\t\t\tgreedy: true,\n\t\t\tinside: Prism.languages.extend('cpp', {})\n\t\t}\n\t});\n\n\tPrism.languages.insertBefore('inside', 'double-colon', {\n\t\t// All untokenized words that are not namespaces should be class names\n\t\t'class-name': /\\b[a-z_]\\w*\\b(?!\\s*::)/i\n\t}, Prism.languages.cpp['base-clause']);\n\n}(Prism));\n", "(function (Prism) {\n\n\t/**\n\t * Returns the placeholder for the given language id and index.\n\t *\n\t * @param {string} language\n\t * @param {string|number} index\n\t * @returns {string}\n\t */\n\tfunction getPlaceholder(language, index) {\n\t\treturn '___' + language.toUpperCase() + index + '___';\n\t}\n\n\tObject.defineProperties(Prism.languages['markup-templating'] = {}, {\n\t\tbuildPlaceholders: {\n\t\t\t/**\n\t\t\t * Tokenize all inline templating expressions matching `placeholderPattern`.\n\t\t\t *\n\t\t\t * If `replaceFilter` is provided, only matches of `placeholderPattern` for which `replaceFilter` returns\n\t\t\t * `true` will be replaced.\n\t\t\t *\n\t\t\t * @param {object} env The environment of the `before-tokenize` hook.\n\t\t\t * @param {string} language The language id.\n\t\t\t * @param {RegExp} placeholderPattern The matches of this pattern will be replaced by placeholders.\n\t\t\t * @param {(match: string) => boolean} [replaceFilter]\n\t\t\t */\n\t\t\tvalue: function (env, language, placeholderPattern, replaceFilter) {\n\t\t\t\tif (env.language !== language) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar tokenStack = env.tokenStack = [];\n\n\t\t\t\tenv.code = env.code.replace(placeholderPattern, function (match) {\n\t\t\t\t\tif (typeof replaceFilter === 'function' && !replaceFilter(match)) {\n\t\t\t\t\t\treturn match;\n\t\t\t\t\t}\n\t\t\t\t\tvar i = tokenStack.length;\n\t\t\t\t\tvar placeholder;\n\n\t\t\t\t\t// Check for existing strings\n\t\t\t\t\twhile (env.code.indexOf(placeholder = getPlaceholder(language, i)) !== -1) {\n\t\t\t\t\t\t++i;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Create a sparse array\n\t\t\t\t\ttokenStack[i] = match;\n\n\t\t\t\t\treturn placeholder;\n\t\t\t\t});\n\n\t\t\t\t// Switch the grammar to markup\n\t\t\t\tenv.grammar = Prism.languages.markup;\n\t\t\t}\n\t\t},\n\t\ttokenizePlaceholders: {\n\t\t\t/**\n\t\t\t * Replace placeholders with proper tokens after tokenizing.\n\t\t\t *\n\t\t\t * @param {object} env The environment of the `after-tokenize` hook.\n\t\t\t * @param {string} language The language id.\n\t\t\t */\n\t\t\tvalue: function (env, language) {\n\t\t\t\tif (env.language !== language || !env.tokenStack) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Switch the grammar back\n\t\t\t\tenv.grammar = Prism.languages[language];\n\n\t\t\t\tvar j = 0;\n\t\t\t\tvar keys = Object.keys(env.tokenStack);\n\n\t\t\t\tfunction walkTokens(tokens) {\n\t\t\t\t\tfor (var i = 0; i < tokens.length; i++) {\n\t\t\t\t\t\t// all placeholders are replaced already\n\t\t\t\t\t\tif (j >= keys.length) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar token = tokens[i];\n\t\t\t\t\t\tif (typeof token === 'string' || (token.content && typeof token.content === 'string')) {\n\t\t\t\t\t\t\tvar k = keys[j];\n\t\t\t\t\t\t\tvar t = env.tokenStack[k];\n\t\t\t\t\t\t\tvar s = typeof token === 'string' ? token : token.content;\n\t\t\t\t\t\t\tvar placeholder = getPlaceholder(language, k);\n\n\t\t\t\t\t\t\tvar index = s.indexOf(placeholder);\n\t\t\t\t\t\t\tif (index > -1) {\n\t\t\t\t\t\t\t\t++j;\n\n\t\t\t\t\t\t\t\tvar before = s.substring(0, index);\n\t\t\t\t\t\t\t\tvar middle = new Prism.Token(language, Prism.tokenize(t, env.grammar), 'language-' + language, t);\n\t\t\t\t\t\t\t\tvar after = s.substring(index + placeholder.length);\n\n\t\t\t\t\t\t\t\tvar replacement = [];\n\t\t\t\t\t\t\t\tif (before) {\n\t\t\t\t\t\t\t\t\treplacement.push.apply(replacement, walkTokens([before]));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treplacement.push(middle);\n\t\t\t\t\t\t\t\tif (after) {\n\t\t\t\t\t\t\t\t\treplacement.push.apply(replacement, walkTokens([after]));\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (typeof token === 'string') {\n\t\t\t\t\t\t\t\t\ttokens.splice.apply(tokens, [i, 1].concat(replacement));\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\ttoken.content = replacement;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (token.content /* && typeof token.content !== 'string' */) {\n\t\t\t\t\t\t\twalkTokens(token.content);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn tokens;\n\t\t\t\t}\n\n\t\t\t\twalkTokens(env.tokens);\n\t\t\t}\n\t\t}\n\t});\n\n}(Prism));\n", "/**\n * Original by Samuel Flores\n *\n * Adds the following new token classes:\n *     constant, builtin, variable, symbol, regex\n */\n(function (Prism) {\n\tPrism.languages.ruby = Prism.languages.extend('clike', {\n\t\t'comment': {\n\t\t\tpattern: /#.*|^=begin\\s[\\s\\S]*?^=end/m,\n\t\t\tgreedy: true\n\t\t},\n\t\t'class-name': {\n\t\t\tpattern: /(\\b(?:class|module)\\s+|\\bcatch\\s+\\()[\\w.\\\\]+|\\b[A-Z_]\\w*(?=\\s*\\.\\s*new\\b)/,\n\t\t\tlookbehind: true,\n\t\t\tinside: {\n\t\t\t\t'punctuation': /[.\\\\]/\n\t\t\t}\n\t\t},\n\t\t'keyword': /\\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\\b/,\n\t\t'operator': /\\.{2,3}|&\\.|===|<?=>|[!=]?~|(?:&&|\\|\\||<<|>>|\\*\\*|[+\\-*/%<>!^&|=])=?|[?:]/,\n\t\t'punctuation': /[(){}[\\].,;]/,\n\t});\n\n\tPrism.languages.insertBefore('ruby', 'operator', {\n\t\t'double-colon': {\n\t\t\tpattern: /::/,\n\t\t\talias: 'punctuation'\n\t\t},\n\t});\n\n\tvar interpolation = {\n\t\tpattern: /((?:^|[^\\\\])(?:\\\\{2})*)#\\{(?:[^{}]|\\{[^{}]*\\})*\\}/,\n\t\tlookbehind: true,\n\t\tinside: {\n\t\t\t'content': {\n\t\t\t\tpattern: /^(#\\{)[\\s\\S]+(?=\\}$)/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tinside: Prism.languages.ruby\n\t\t\t},\n\t\t\t'delimiter': {\n\t\t\t\tpattern: /^#\\{|\\}$/,\n\t\t\t\talias: 'punctuation'\n\t\t\t}\n\t\t}\n\t};\n\n\tdelete Prism.languages.ruby.function;\n\n\tvar percentExpression = '(?:' + [\n\t\t/([^a-zA-Z0-9\\s{(\\[<=])(?:(?!\\1)[^\\\\]|\\\\[\\s\\S])*\\1/.source,\n\t\t/\\((?:[^()\\\\]|\\\\[\\s\\S]|\\((?:[^()\\\\]|\\\\[\\s\\S])*\\))*\\)/.source,\n\t\t/\\{(?:[^{}\\\\]|\\\\[\\s\\S]|\\{(?:[^{}\\\\]|\\\\[\\s\\S])*\\})*\\}/.source,\n\t\t/\\[(?:[^\\[\\]\\\\]|\\\\[\\s\\S]|\\[(?:[^\\[\\]\\\\]|\\\\[\\s\\S])*\\])*\\]/.source,\n\t\t/<(?:[^<>\\\\]|\\\\[\\s\\S]|<(?:[^<>\\\\]|\\\\[\\s\\S])*>)*>/.source\n\t].join('|') + ')';\n\n\tvar symbolName = /(?:\"(?:\\\\.|[^\"\\\\\\r\\n])*\"|(?:\\b[a-zA-Z_]\\w*|[^\\s\\0-\\x7F]+)[?!]?|\\$.)/.source;\n\n\tPrism.languages.insertBefore('ruby', 'keyword', {\n\t\t'regex-literal': [\n\t\t\t{\n\t\t\t\tpattern: RegExp(/%r/.source + percentExpression + /[egimnosux]{0,6}/.source),\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'interpolation': interpolation,\n\t\t\t\t\t'regex': /[\\s\\S]+/\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(^|[^/])\\/(?!\\/)(?:\\[[^\\r\\n\\]]+\\]|\\\\.|[^[/\\\\\\r\\n])+\\/[egimnosux]{0,6}(?=\\s*(?:$|[\\r\\n,.;})#]))/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'interpolation': interpolation,\n\t\t\t\t\t'regex': /[\\s\\S]+/\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t'variable': /[@$]+[a-zA-Z_]\\w*(?:[?!]|\\b)/,\n\t\t'symbol': [\n\t\t\t{\n\t\t\t\tpattern: RegExp(/(^|[^:]):/.source + symbolName),\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: RegExp(/([\\r\\n{(,][ \\t]*)/.source + symbolName + /(?=:(?!:))/.source),\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true\n\t\t\t},\n\t\t],\n\t\t'method-definition': {\n\t\t\tpattern: /(\\bdef\\s+)\\w+(?:\\s*\\.\\s*\\w+)?/,\n\t\t\tlookbehind: true,\n\t\t\tinside: {\n\t\t\t\t'function': /\\b\\w+$/,\n\t\t\t\t'keyword': /^self\\b/,\n\t\t\t\t'class-name': /^\\w+/,\n\t\t\t\t'punctuation': /\\./\n\t\t\t}\n\t\t}\n\t});\n\n\tPrism.languages.insertBefore('ruby', 'string', {\n\t\t'string-literal': [\n\t\t\t{\n\t\t\t\tpattern: RegExp(/%[qQiIwWs]?/.source + percentExpression),\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'interpolation': interpolation,\n\t\t\t\t\t'string': /[\\s\\S]+/\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(\"|')(?:#\\{[^}]+\\}|#(?!\\{)|\\\\(?:\\r\\n|[\\s\\S])|(?!\\1)[^\\\\#\\r\\n])*\\1/,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'interpolation': interpolation,\n\t\t\t\t\t'string': /[\\s\\S]+/\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /<<[-~]?([a-z_]\\w*)[\\r\\n](?:.*[\\r\\n])*?[\\t ]*\\1/i,\n\t\t\t\talias: 'heredoc-string',\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'delimiter': {\n\t\t\t\t\t\tpattern: /^<<[-~]?[a-z_]\\w*|\\b[a-z_]\\w*$/i,\n\t\t\t\t\t\tinside: {\n\t\t\t\t\t\t\t'symbol': /\\b\\w+/,\n\t\t\t\t\t\t\t'punctuation': /^<<[-~]?/\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t'interpolation': interpolation,\n\t\t\t\t\t'string': /[\\s\\S]+/\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /<<[-~]?'([a-z_]\\w*)'[\\r\\n](?:.*[\\r\\n])*?[\\t ]*\\1/i,\n\t\t\t\talias: 'heredoc-string',\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'delimiter': {\n\t\t\t\t\t\tpattern: /^<<[-~]?'[a-z_]\\w*'|\\b[a-z_]\\w*$/i,\n\t\t\t\t\t\tinside: {\n\t\t\t\t\t\t\t'symbol': /\\b\\w+/,\n\t\t\t\t\t\t\t'punctuation': /^<<[-~]?'|'$/,\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t'string': /[\\s\\S]+/\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t'command-literal': [\n\t\t\t{\n\t\t\t\tpattern: RegExp(/%x/.source + percentExpression),\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'interpolation': interpolation,\n\t\t\t\t\t'command': {\n\t\t\t\t\t\tpattern: /[\\s\\S]+/,\n\t\t\t\t\t\talias: 'string'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /`(?:#\\{[^}]+\\}|#(?!\\{)|\\\\(?:\\r\\n|[\\s\\S])|[^\\\\`#\\r\\n])*`/,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'interpolation': interpolation,\n\t\t\t\t\t'command': {\n\t\t\t\t\t\tpattern: /[\\s\\S]+/,\n\t\t\t\t\t\talias: 'string'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t});\n\n\tdelete Prism.languages.ruby.string;\n\n\tPrism.languages.insertBefore('ruby', 'number', {\n\t\t'builtin': /\\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\\b/,\n\t\t'constant': /\\b[A-Z][A-Z0-9_]*(?:[?!]|\\b)/\n\t});\n\n\tPrism.languages.rb = Prism.languages.ruby;\n}(Prism));\n", "/**\n * Original by Aaron Harun: http://aahacreative.com/2012/07/31/php-syntax-highlighting-prism/\n * Modified by Miles Johnson: http://milesj.me\n * Rewritten by Tom Pavelec\n *\n * Supports PHP 5.3 - 8.0\n */\n(function (Prism) {\n\tvar comment = /\\/\\*[\\s\\S]*?\\*\\/|\\/\\/.*|#(?!\\[).*/;\n\tvar constant = [\n\t\t{\n\t\t\tpattern: /\\b(?:false|true)\\b/i,\n\t\t\talias: 'boolean'\n\t\t},\n\t\t{\n\t\t\tpattern: /(::\\s*)\\b[a-z_]\\w*\\b(?!\\s*\\()/i,\n\t\t\tgreedy: true,\n\t\t\tlookbehind: true,\n\t\t},\n\t\t{\n\t\t\tpattern: /(\\b(?:case|const)\\s+)\\b[a-z_]\\w*(?=\\s*[;=])/i,\n\t\t\tgreedy: true,\n\t\t\tlookbehind: true,\n\t\t},\n\t\t/\\b(?:null)\\b/i,\n\t\t/\\b[A-Z_][A-Z0-9_]*\\b(?!\\s*\\()/,\n\t];\n\tvar number = /\\b0b[01]+(?:_[01]+)*\\b|\\b0o[0-7]+(?:_[0-7]+)*\\b|\\b0x[\\da-f]+(?:_[\\da-f]+)*\\b|(?:\\b\\d+(?:_\\d+)*\\.?(?:\\d+(?:_\\d+)*)?|\\B\\.\\d+)(?:e[+-]?\\d+)?/i;\n\tvar operator = /<?=>|\\?\\?=?|\\.{3}|\\??->|[!=]=?=?|::|\\*\\*=?|--|\\+\\+|&&|\\|\\||<<|>>|[?~]|[/^|%*&<>.+-]=?/;\n\tvar punctuation = /[{}\\[\\](),:;]/;\n\n\tPrism.languages.php = {\n\t\t'delimiter': {\n\t\t\tpattern: /\\?>$|^<\\?(?:php(?=\\s)|=)?/i,\n\t\t\talias: 'important'\n\t\t},\n\t\t'comment': comment,\n\t\t'variable': /\\$+(?:\\w+\\b|(?=\\{))/,\n\t\t'package': {\n\t\t\tpattern: /(namespace\\s+|use\\s+(?:function\\s+)?)(?:\\\\?\\b[a-z_]\\w*)+\\b(?!\\\\)/i,\n\t\t\tlookbehind: true,\n\t\t\tinside: {\n\t\t\t\t'punctuation': /\\\\/\n\t\t\t}\n\t\t},\n\t\t'class-name-definition': {\n\t\t\tpattern: /(\\b(?:class|enum|interface|trait)\\s+)\\b[a-z_]\\w*(?!\\\\)\\b/i,\n\t\t\tlookbehind: true,\n\t\t\talias: 'class-name'\n\t\t},\n\t\t'function-definition': {\n\t\t\tpattern: /(\\bfunction\\s+)[a-z_]\\w*(?=\\s*\\()/i,\n\t\t\tlookbehind: true,\n\t\t\talias: 'function'\n\t\t},\n\t\t'keyword': [\n\t\t\t{\n\t\t\t\tpattern: /(\\(\\s*)\\b(?:array|bool|boolean|float|int|integer|object|string)\\b(?=\\s*\\))/i,\n\t\t\t\talias: 'type-casting',\n\t\t\t\tgreedy: true,\n\t\t\t\tlookbehind: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /([(,?]\\s*)\\b(?:array(?!\\s*\\()|bool|callable|(?:false|null)(?=\\s*\\|)|float|int|iterable|mixed|object|self|static|string)\\b(?=\\s*\\$)/i,\n\t\t\t\talias: 'type-hint',\n\t\t\t\tgreedy: true,\n\t\t\t\tlookbehind: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(\\)\\s*:\\s*(?:\\?\\s*)?)\\b(?:array(?!\\s*\\()|bool|callable|(?:false|null)(?=\\s*\\|)|float|int|iterable|mixed|never|object|self|static|string|void)\\b/i,\n\t\t\t\talias: 'return-type',\n\t\t\t\tgreedy: true,\n\t\t\t\tlookbehind: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /\\b(?:array(?!\\s*\\()|bool|float|int|iterable|mixed|object|string|void)\\b/i,\n\t\t\t\talias: 'type-declaration',\n\t\t\t\tgreedy: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(\\|\\s*)(?:false|null)\\b|\\b(?:false|null)(?=\\s*\\|)/i,\n\t\t\t\talias: 'type-declaration',\n\t\t\t\tgreedy: true,\n\t\t\t\tlookbehind: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /\\b(?:parent|self|static)(?=\\s*::)/i,\n\t\t\t\talias: 'static-context',\n\t\t\t\tgreedy: true\n\t\t\t},\n\t\t\t{\n\t\t\t\t// yield from\n\t\t\t\tpattern: /(\\byield\\s+)from\\b/i,\n\t\t\t\tlookbehind: true\n\t\t\t},\n\t\t\t// `class` is always a keyword unlike other keywords\n\t\t\t/\\bclass\\b/i,\n\t\t\t{\n\t\t\t\t// https://www.php.net/manual/en/reserved.keywords.php\n\t\t\t\t//\n\t\t\t\t// keywords cannot be preceded by \"->\"\n\t\t\t\t// the complex lookbehind means `(?<!(?:->|::)\\s*)`\n\t\t\t\tpattern: /((?:^|[^\\s>:]|(?:^|[^-])>|(?:^|[^:]):)\\s*)\\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\\b/i,\n\t\t\t\tlookbehind: true\n\t\t\t}\n\t\t],\n\t\t'argument-name': {\n\t\t\tpattern: /([(,]\\s*)\\b[a-z_]\\w*(?=\\s*:(?!:))/i,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'class-name': [\n\t\t\t{\n\t\t\t\tpattern: /(\\b(?:extends|implements|instanceof|new(?!\\s+self|\\s+static))\\s+|\\bcatch\\s*\\()\\b[a-z_]\\w*(?!\\\\)\\b/i,\n\t\t\t\tgreedy: true,\n\t\t\t\tlookbehind: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(\\|\\s*)\\b[a-z_]\\w*(?!\\\\)\\b/i,\n\t\t\t\tgreedy: true,\n\t\t\t\tlookbehind: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /\\b[a-z_]\\w*(?!\\\\)\\b(?=\\s*\\|)/i,\n\t\t\t\tgreedy: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(\\|\\s*)(?:\\\\?\\b[a-z_]\\w*)+\\b/i,\n\t\t\t\talias: 'class-name-fully-qualified',\n\t\t\t\tgreedy: true,\n\t\t\t\tlookbehind: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': /\\\\/\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(?:\\\\?\\b[a-z_]\\w*)+\\b(?=\\s*\\|)/i,\n\t\t\t\talias: 'class-name-fully-qualified',\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': /\\\\/\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(\\b(?:extends|implements|instanceof|new(?!\\s+self\\b|\\s+static\\b))\\s+|\\bcatch\\s*\\()(?:\\\\?\\b[a-z_]\\w*)+\\b(?!\\\\)/i,\n\t\t\t\talias: 'class-name-fully-qualified',\n\t\t\t\tgreedy: true,\n\t\t\t\tlookbehind: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': /\\\\/\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /\\b[a-z_]\\w*(?=\\s*\\$)/i,\n\t\t\t\talias: 'type-declaration',\n\t\t\t\tgreedy: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(?:\\\\?\\b[a-z_]\\w*)+(?=\\s*\\$)/i,\n\t\t\t\talias: ['class-name-fully-qualified', 'type-declaration'],\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': /\\\\/\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /\\b[a-z_]\\w*(?=\\s*::)/i,\n\t\t\t\talias: 'static-context',\n\t\t\t\tgreedy: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(?:\\\\?\\b[a-z_]\\w*)+(?=\\s*::)/i,\n\t\t\t\talias: ['class-name-fully-qualified', 'static-context'],\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': /\\\\/\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /([(,?]\\s*)[a-z_]\\w*(?=\\s*\\$)/i,\n\t\t\t\talias: 'type-hint',\n\t\t\t\tgreedy: true,\n\t\t\t\tlookbehind: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /([(,?]\\s*)(?:\\\\?\\b[a-z_]\\w*)+(?=\\s*\\$)/i,\n\t\t\t\talias: ['class-name-fully-qualified', 'type-hint'],\n\t\t\t\tgreedy: true,\n\t\t\t\tlookbehind: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': /\\\\/\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(\\)\\s*:\\s*(?:\\?\\s*)?)\\b[a-z_]\\w*(?!\\\\)\\b/i,\n\t\t\t\talias: 'return-type',\n\t\t\t\tgreedy: true,\n\t\t\t\tlookbehind: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(\\)\\s*:\\s*(?:\\?\\s*)?)(?:\\\\?\\b[a-z_]\\w*)+\\b(?!\\\\)/i,\n\t\t\t\talias: ['class-name-fully-qualified', 'return-type'],\n\t\t\t\tgreedy: true,\n\t\t\t\tlookbehind: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'punctuation': /\\\\/\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t'constant': constant,\n\t\t'function': {\n\t\t\tpattern: /(^|[^\\\\\\w])\\\\?[a-z_](?:[\\w\\\\]*\\w)?(?=\\s*\\()/i,\n\t\t\tlookbehind: true,\n\t\t\tinside: {\n\t\t\t\t'punctuation': /\\\\/\n\t\t\t}\n\t\t},\n\t\t'property': {\n\t\t\tpattern: /(->\\s*)\\w+/,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'number': number,\n\t\t'operator': operator,\n\t\t'punctuation': punctuation\n\t};\n\n\tvar string_interpolation = {\n\t\tpattern: /\\{\\$(?:\\{(?:\\{[^{}]+\\}|[^{}]+)\\}|[^{}])+\\}|(^|[^\\\\{])\\$+(?:\\w+(?:\\[[^\\r\\n\\[\\]]+\\]|->\\w+)?)/,\n\t\tlookbehind: true,\n\t\tinside: Prism.languages.php\n\t};\n\n\tvar string = [\n\t\t{\n\t\t\tpattern: /<<<'([^']+)'[\\r\\n](?:.*[\\r\\n])*?\\1;/,\n\t\t\talias: 'nowdoc-string',\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'delimiter': {\n\t\t\t\t\tpattern: /^<<<'[^']+'|[a-z_]\\w*;$/i,\n\t\t\t\t\talias: 'symbol',\n\t\t\t\t\tinside: {\n\t\t\t\t\t\t'punctuation': /^<<<'?|[';]$/\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpattern: /<<<(?:\"([^\"]+)\"[\\r\\n](?:.*[\\r\\n])*?\\1;|([a-z_]\\w*)[\\r\\n](?:.*[\\r\\n])*?\\2;)/i,\n\t\t\talias: 'heredoc-string',\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'delimiter': {\n\t\t\t\t\tpattern: /^<<<(?:\"[^\"]+\"|[a-z_]\\w*)|[a-z_]\\w*;$/i,\n\t\t\t\t\talias: 'symbol',\n\t\t\t\t\tinside: {\n\t\t\t\t\t\t'punctuation': /^<<<\"?|[\";]$/\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t'interpolation': string_interpolation\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tpattern: /`(?:\\\\[\\s\\S]|[^\\\\`])*`/,\n\t\t\talias: 'backtick-quoted-string',\n\t\t\tgreedy: true\n\t\t},\n\t\t{\n\t\t\tpattern: /'(?:\\\\[\\s\\S]|[^\\\\'])*'/,\n\t\t\talias: 'single-quoted-string',\n\t\t\tgreedy: true\n\t\t},\n\t\t{\n\t\t\tpattern: /\"(?:\\\\[\\s\\S]|[^\\\\\"])*\"/,\n\t\t\talias: 'double-quoted-string',\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'interpolation': string_interpolation\n\t\t\t}\n\t\t}\n\t];\n\n\tPrism.languages.insertBefore('php', 'variable', {\n\t\t'string': string,\n\t\t'attribute': {\n\t\t\tpattern: /#\\[(?:[^\"'\\/#]|\\/(?![*/])|\\/\\/.*$|#(?!\\[).*$|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/|\"(?:\\\\[\\s\\S]|[^\\\\\"])*\"|'(?:\\\\[\\s\\S]|[^\\\\'])*')+\\](?=\\s*[a-z$#])/im,\n\t\t\tgreedy: true,\n\t\t\tinside: {\n\t\t\t\t'attribute-content': {\n\t\t\t\t\tpattern: /^(#\\[)[\\s\\S]+(?=\\]$)/,\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\t// inside can appear subset of php\n\t\t\t\t\tinside: {\n\t\t\t\t\t\t'comment': comment,\n\t\t\t\t\t\t'string': string,\n\t\t\t\t\t\t'attribute-class-name': [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpattern: /([^:]|^)\\b[a-z_]\\w*(?!\\\\)\\b/i,\n\t\t\t\t\t\t\t\talias: 'class-name',\n\t\t\t\t\t\t\t\tgreedy: true,\n\t\t\t\t\t\t\t\tlookbehind: true\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tpattern: /([^:]|^)(?:\\\\?\\b[a-z_]\\w*)+/i,\n\t\t\t\t\t\t\t\talias: [\n\t\t\t\t\t\t\t\t\t'class-name',\n\t\t\t\t\t\t\t\t\t'class-name-fully-qualified'\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t\tgreedy: true,\n\t\t\t\t\t\t\t\tlookbehind: true,\n\t\t\t\t\t\t\t\tinside: {\n\t\t\t\t\t\t\t\t\t'punctuation': /\\\\/\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t\t'constant': constant,\n\t\t\t\t\t\t'number': number,\n\t\t\t\t\t\t'operator': operator,\n\t\t\t\t\t\t'punctuation': punctuation\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t'delimiter': {\n\t\t\t\t\tpattern: /^#\\[|\\]$/,\n\t\t\t\t\talias: 'punctuation'\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t});\n\n\tPrism.hooks.add('before-tokenize', function (env) {\n\t\tif (!/<\\?/.test(env.code)) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar phpPattern = /<\\?(?:[^\"'/#]|\\/(?![*/])|(\"|')(?:\\\\[\\s\\S]|(?!\\1)[^\\\\])*\\1|(?:\\/\\/|#(?!\\[))(?:[^?\\n\\r]|\\?(?!>))*(?=$|\\?>|[\\r\\n])|#\\[|\\/\\*(?:[^*]|\\*(?!\\/))*(?:\\*\\/|$))*?(?:\\?>|$)/g;\n\t\tPrism.languages['markup-templating'].buildPlaceholders(env, 'php', phpPattern);\n\t});\n\n\tPrism.hooks.add('after-tokenize', function (env) {\n\t\tPrism.languages['markup-templating'].tokenizePlaceholders(env, 'php');\n\t});\n\n}(Prism));\n", "Prism.languages.go = Prism.languages.extend('clike', {\n\t'string': {\n\t\tpattern: /(^|[^\\\\])\"(?:\\\\.|[^\"\\\\\\r\\n])*\"|`[^`]*`/,\n\t\tlookbehind: true,\n\t\tgreedy: true\n\t},\n\t'keyword': /\\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\\b/,\n\t'boolean': /\\b(?:_|false|iota|nil|true)\\b/,\n\t'number': [\n\t\t// binary and octal integers\n\t\t/\\b0(?:b[01_]+|o[0-7_]+)i?\\b/i,\n\t\t// hexadecimal integers and floats\n\t\t/\\b0x(?:[a-f\\d_]+(?:\\.[a-f\\d_]*)?|\\.[a-f\\d_]+)(?:p[+-]?\\d+(?:_\\d+)*)?i?(?!\\w)/i,\n\t\t// decimal integers and floats\n\t\t/(?:\\b\\d[\\d_]*(?:\\.[\\d_]*)?|\\B\\.\\d[\\d_]*)(?:e[+-]?[\\d_]+)?i?(?!\\w)/i\n\t],\n\t'operator': /[*\\/%^!=]=?|\\+[=+]?|-[=-]?|\\|[=|]?|&(?:=|&|\\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\\.\\.\\./,\n\t'builtin': /\\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\\b/\n});\n\nPrism.languages.insertBefore('go', 'string', {\n\t'char': {\n\t\tpattern: /'(?:\\\\.|[^'\\\\\\r\\n]){0,10}'/,\n\t\tgreedy: true\n\t}\n});\n\ndelete Prism.languages.go['class-name'];\n", "(function (Prism) {\n\t// $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\\n' '|'\n\t// + LC_ALL, RANDOM, REPLY, SECONDS.\n\t// + make sure PS1..4 are here as they are not always set,\n\t// - some useless things.\n\tvar envVars = '\\\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\\\b';\n\n\tvar commandAfterHeredoc = {\n\t\tpattern: /(^([\"']?)\\w+\\2)[ \\t]+\\S.*/,\n\t\tlookbehind: true,\n\t\talias: 'punctuation', // this looks reasonably well in all themes\n\t\tinside: null // see below\n\t};\n\n\tvar insideString = {\n\t\t'bash': commandAfterHeredoc,\n\t\t'environment': {\n\t\t\tpattern: RegExp('\\\\$' + envVars),\n\t\t\talias: 'constant'\n\t\t},\n\t\t'variable': [\n\t\t\t// [0]: Arithmetic Environment\n\t\t\t{\n\t\t\t\tpattern: /\\$?\\(\\([\\s\\S]+?\\)\\)/,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t// If there is a $ sign at the beginning highlight $(( and )) as variable\n\t\t\t\t\t'variable': [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpattern: /(^\\$\\(\\([\\s\\S]+)\\)\\)/,\n\t\t\t\t\t\t\tlookbehind: true\n\t\t\t\t\t\t},\n\t\t\t\t\t\t/^\\$\\(\\(/\n\t\t\t\t\t],\n\t\t\t\t\t'number': /\\b0x[\\dA-Fa-f]+\\b|(?:\\b\\d+(?:\\.\\d*)?|\\B\\.\\d+)(?:[Ee]-?\\d+)?/,\n\t\t\t\t\t// Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic\n\t\t\t\t\t'operator': /--|\\+\\+|\\*\\*=?|<<=?|>>=?|&&|\\|\\||[=!+\\-*/%<>^&|]=?|[?~:]/,\n\t\t\t\t\t// If there is no $ sign at the beginning highlight (( and )) as punctuation\n\t\t\t\t\t'punctuation': /\\(\\(?|\\)\\)?|,|;/\n\t\t\t\t}\n\t\t\t},\n\t\t\t// [1]: Command Substitution\n\t\t\t{\n\t\t\t\tpattern: /\\$\\((?:\\([^)]+\\)|[^()])+\\)|`[^`]+`/,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'variable': /^\\$\\(|^`|\\)$|`$/\n\t\t\t\t}\n\t\t\t},\n\t\t\t// [2]: Brace expansion\n\t\t\t{\n\t\t\t\tpattern: /\\$\\{[^}]+\\}/,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'operator': /:[-=?+]?|[!\\/]|##?|%%?|\\^\\^?|,,?/,\n\t\t\t\t\t'punctuation': /[\\[\\]]/,\n\t\t\t\t\t'environment': {\n\t\t\t\t\t\tpattern: RegExp('(\\\\{)' + envVars),\n\t\t\t\t\t\tlookbehind: true,\n\t\t\t\t\t\talias: 'constant'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\t/\\$(?:\\w+|[#?*!@$])/\n\t\t],\n\t\t// Escape sequences from echo and printf's manuals, and escaped quotes.\n\t\t'entity': /\\\\(?:[abceEfnrtv\\\\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/\n\t};\n\n\tPrism.languages.bash = {\n\t\t'shebang': {\n\t\t\tpattern: /^#!\\s*\\/.*/,\n\t\t\talias: 'important'\n\t\t},\n\t\t'comment': {\n\t\t\tpattern: /(^|[^\"{\\\\$])#.*/,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'function-name': [\n\t\t\t// a) function foo {\n\t\t\t// b) foo() {\n\t\t\t// c) function foo() {\n\t\t\t// but not \u201Cfoo {\u201D\n\t\t\t{\n\t\t\t\t// a) and c)\n\t\t\t\tpattern: /(\\bfunction\\s+)[\\w-]+(?=(?:\\s*\\(?:\\s*\\))?\\s*\\{)/,\n\t\t\t\tlookbehind: true,\n\t\t\t\talias: 'function'\n\t\t\t},\n\t\t\t{\n\t\t\t\t// b)\n\t\t\t\tpattern: /\\b[\\w-]+(?=\\s*\\(\\s*\\)\\s*\\{)/,\n\t\t\t\talias: 'function'\n\t\t\t}\n\t\t],\n\t\t// Highlight variable names as variables in for and select beginnings.\n\t\t'for-or-select': {\n\t\t\tpattern: /(\\b(?:for|select)\\s+)\\w+(?=\\s+in\\s)/,\n\t\t\talias: 'variable',\n\t\t\tlookbehind: true\n\t\t},\n\t\t// Highlight variable names as variables in the left-hand part\n\t\t// of assignments (\u201C=\u201D and \u201C+=\u201D).\n\t\t'assign-left': {\n\t\t\tpattern: /(^|[\\s;|&]|[<>]\\()\\w+(?:\\.\\w+)*(?=\\+?=)/,\n\t\t\tinside: {\n\t\t\t\t'environment': {\n\t\t\t\t\tpattern: RegExp('(^|[\\\\s;|&]|[<>]\\\\()' + envVars),\n\t\t\t\t\tlookbehind: true,\n\t\t\t\t\talias: 'constant'\n\t\t\t\t}\n\t\t\t},\n\t\t\talias: 'variable',\n\t\t\tlookbehind: true\n\t\t},\n\t\t// Highlight parameter names as variables\n\t\t'parameter': {\n\t\t\tpattern: /(^|\\s)-{1,2}(?:\\w+:[+-]?)?\\w+(?:\\.\\w+)*(?=[=\\s]|$)/,\n\t\t\talias: 'variable',\n\t\t\tlookbehind: true\n\t\t},\n\t\t'string': [\n\t\t\t// Support for Here-documents https://en.wikipedia.org/wiki/Here_document\n\t\t\t{\n\t\t\t\tpattern: /((?:^|[^<])<<-?\\s*)(\\w+)\\s[\\s\\S]*?(?:\\r?\\n|\\r)\\2/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: insideString\n\t\t\t},\n\t\t\t// Here-document with quotes around the tag\n\t\t\t// \u2192 No expansion (so no \u201Cinside\u201D).\n\t\t\t{\n\t\t\t\tpattern: /((?:^|[^<])<<-?\\s*)([\"'])(\\w+)\\2\\s[\\s\\S]*?(?:\\r?\\n|\\r)\\3/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'bash': commandAfterHeredoc\n\t\t\t\t}\n\t\t\t},\n\t\t\t// \u201CNormal\u201D string\n\t\t\t{\n\t\t\t\t// https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html\n\t\t\t\tpattern: /(^|[^\\\\](?:\\\\\\\\)*)\"(?:\\\\[\\s\\S]|\\$\\([^)]+\\)|\\$(?!\\()|`[^`]+`|[^\"\\\\`$])*\"/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: insideString\n\t\t\t},\n\t\t\t{\n\t\t\t\t// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html\n\t\t\t\tpattern: /(^|[^$\\\\])'[^']*'/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true\n\t\t\t},\n\t\t\t{\n\t\t\t\t// https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html\n\t\t\t\tpattern: /\\$'(?:[^'\\\\]|\\\\[\\s\\S])*'/,\n\t\t\t\tgreedy: true,\n\t\t\t\tinside: {\n\t\t\t\t\t'entity': insideString.entity\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t'environment': {\n\t\t\tpattern: RegExp('\\\\$?' + envVars),\n\t\t\talias: 'constant'\n\t\t},\n\t\t'variable': insideString.variable,\n\t\t'function': {\n\t\t\tpattern: /(^|[\\s;|&]|[<>]\\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\\s;|&])/,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'keyword': {\n\t\t\tpattern: /(^|[\\s;|&]|[<>]\\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\\s;|&])/,\n\t\t\tlookbehind: true\n\t\t},\n\t\t// https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html\n\t\t'builtin': {\n\t\t\tpattern: /(^|[\\s;|&]|[<>]\\()(?:\\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\\s;|&])/,\n\t\t\tlookbehind: true,\n\t\t\t// Alias added to make those easier to distinguish from strings.\n\t\t\talias: 'class-name'\n\t\t},\n\t\t'boolean': {\n\t\t\tpattern: /(^|[\\s;|&]|[<>]\\()(?:false|true)(?=$|[)\\s;|&])/,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'file-descriptor': {\n\t\t\tpattern: /\\B&\\d\\b/,\n\t\t\talias: 'important'\n\t\t},\n\t\t'operator': {\n\t\t\t// Lots of redirections here, but not just that.\n\t\t\tpattern: /\\d?<>|>\\||\\+=|=[=~]?|!=?|<<[<-]?|[&\\d]?>>|\\d[<>]&?|[<>][&=]?|&[>&]?|\\|[&|]?/,\n\t\t\tinside: {\n\t\t\t\t'file-descriptor': {\n\t\t\t\t\tpattern: /^\\d/,\n\t\t\t\t\talias: 'important'\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t'punctuation': /\\$?\\(\\(?|\\)\\)?|\\.\\.|[{}[\\];\\\\]/,\n\t\t'number': {\n\t\t\tpattern: /(^|\\s)(?:[1-9]\\d*|0)(?:[.,]\\d+)?\\b/,\n\t\t\tlookbehind: true\n\t\t}\n\t};\n\n\tcommandAfterHeredoc.inside = Prism.languages.bash;\n\n\t/* Patterns in command substitution. */\n\tvar toBeCopied = [\n\t\t'comment',\n\t\t'function-name',\n\t\t'for-or-select',\n\t\t'assign-left',\n\t\t'parameter',\n\t\t'string',\n\t\t'environment',\n\t\t'function',\n\t\t'keyword',\n\t\t'builtin',\n\t\t'boolean',\n\t\t'file-descriptor',\n\t\t'operator',\n\t\t'punctuation',\n\t\t'number'\n\t];\n\tvar inside = insideString.variable[1].inside;\n\tfor (var i = 0; i < toBeCopied.length; i++) {\n\t\tinside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]];\n\t}\n\n\tPrism.languages.sh = Prism.languages.bash;\n\tPrism.languages.shell = Prism.languages.bash;\n}(Prism));\n", "// https://www.json.org/json-en.html\nPrism.languages.json = {\n\t'property': {\n\t\tpattern: /(^|[^\\\\])\"(?:\\\\.|[^\\\\\"\\r\\n])*\"(?=\\s*:)/,\n\t\tlookbehind: true,\n\t\tgreedy: true\n\t},\n\t'string': {\n\t\tpattern: /(^|[^\\\\])\"(?:\\\\.|[^\\\\\"\\r\\n])*\"(?!\\s*:)/,\n\t\tlookbehind: true,\n\t\tgreedy: true\n\t},\n\t'comment': {\n\t\tpattern: /\\/\\/.*|\\/\\*[\\s\\S]*?(?:\\*\\/|$)/,\n\t\tgreedy: true\n\t},\n\t'number': /-?\\b\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?\\b/i,\n\t'punctuation': /[{}[\\],]/,\n\t'operator': /:/,\n\t'boolean': /\\b(?:false|true)\\b/,\n\t'null': {\n\t\tpattern: /\\bnull\\b/,\n\t\talias: 'keyword'\n\t}\n};\n\nPrism.languages.webmanifest = Prism.languages.json;\n", "(function (Prism) {\n\tPrism.languages.kotlin = Prism.languages.extend('clike', {\n\t\t'keyword': {\n\t\t\t// The lookbehind prevents wrong highlighting of e.g. kotlin.properties.get\n\t\t\tpattern: /(^|[^.])\\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\\b/,\n\t\t\tlookbehind: true\n\t\t},\n\t\t'function': [\n\t\t\t{\n\t\t\t\tpattern: /(?:`[^\\r\\n`]+`|\\b\\w+)(?=\\s*\\()/,\n\t\t\t\tgreedy: true\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /(\\.)(?:`[^\\r\\n`]+`|\\w+)(?=\\s*\\{)/,\n\t\t\t\tlookbehind: true,\n\t\t\t\tgreedy: true\n\t\t\t}\n\t\t],\n\t\t'number': /\\b(?:0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\\d+(?:_\\d+)*(?:\\.\\d+(?:_\\d+)*)?(?:[eE][+-]?\\d+(?:_\\d+)*)?[fFL]?)\\b/,\n\t\t'operator': /\\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\\/*%<>]=?|[?:]:?|\\.\\.|&&|\\|\\||\\b(?:and|inv|or|shl|shr|ushr|xor)\\b/\n\t});\n\n\tdelete Prism.languages.kotlin['class-name'];\n\n\tvar interpolationInside = {\n\t\t'interpolation-punctuation': {\n\t\t\tpattern: /^\\$\\{?|\\}$/,\n\t\t\talias: 'punctuation'\n\t\t},\n\t\t'expression': {\n\t\t\tpattern: /[\\s\\S]+/,\n\t\t\tinside: Prism.languages.kotlin\n\t\t}\n\t};\n\n\tPrism.languages.insertBefore('kotlin', 'string', {\n\t\t// https://kotlinlang.org/spec/expressions.html#string-interpolation-expressions\n\t\t'string-literal': [\n\t\t\t{\n\t\t\t\tpattern: /\"\"\"(?:[^$]|\\$(?:(?!\\{)|\\{[^{}]*\\}))*?\"\"\"/,\n\t\t\t\talias: 'multiline',\n\t\t\t\tinside: {\n\t\t\t\t\t'interpolation': {\n\t\t\t\t\t\tpattern: /\\$(?:[a-z_]\\w*|\\{[^{}]*\\})/i,\n\t\t\t\t\t\tinside: interpolationInside\n\t\t\t\t\t},\n\t\t\t\t\t'string': /[\\s\\S]+/\n\t\t\t\t}\n\t\t\t},\n\t\t\t{\n\t\t\t\tpattern: /\"(?:[^\"\\\\\\r\\n$]|\\\\.|\\$(?:(?!\\{)|\\{[^{}]*\\}))*\"/,\n\t\t\t\talias: 'singleline',\n\t\t\t\tinside: {\n\t\t\t\t\t'interpolation': {\n\t\t\t\t\t\tpattern: /((?:^|[^\\\\])(?:\\\\{2})*)\\$(?:[a-z_]\\w*|\\{[^{}]*\\})/i,\n\t\t\t\t\t\tlookbehind: true,\n\t\t\t\t\t\tinside: interpolationInside\n\t\t\t\t\t},\n\t\t\t\t\t'string': /[\\s\\S]+/\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\t'char': {\n\t\t\t// https://kotlinlang.org/spec/expressions.html#character-literals\n\t\t\tpattern: /'(?:[^'\\\\\\r\\n]|\\\\(?:.|u[a-fA-F0-9]{0,4}))'/,\n\t\t\tgreedy: true\n\t\t}\n\t});\n\n\tdelete Prism.languages.kotlin['string'];\n\n\tPrism.languages.insertBefore('kotlin', 'keyword', {\n\t\t'annotation': {\n\t\t\tpattern: /\\B@(?:\\w+:)?(?:[A-Z]\\w*|\\[[^\\]]+\\])/,\n\t\t\talias: 'builtin'\n\t\t}\n\t});\n\n\tPrism.languages.insertBefore('kotlin', 'function', {\n\t\t'label': {\n\t\t\tpattern: /\\b\\w+@|@\\w+\\b/,\n\t\t\talias: 'symbol'\n\t\t}\n\t});\n\n\tPrism.languages.kt = Prism.languages.kotlin;\n\tPrism.languages.kts = Prism.languages.kotlin;\n}(Prism));\n", "const {\n  entries,\n  setPrototypeOf,\n  isFrozen,\n  getPrototypeOf,\n  getOwnPropertyDescriptor,\n} = Object;\n\nlet { freeze, seal, create } = Object; // eslint-disable-line import/no-mutable-exports\nlet { apply, construct } = typeof Reflect !== 'undefined' && Reflect;\n\nif (!freeze) {\n  freeze = function <T>(x: T): T {\n    return x;\n  };\n}\n\nif (!seal) {\n  seal = function <T>(x: T): T {\n    return x;\n  };\n}\n\nif (!apply) {\n  apply = function <T>(\n    func: (thisArg: any, ...args: any[]) => T,\n    thisArg: any,\n    ...args: any[]\n  ): T {\n    return func.apply(thisArg, args);\n  };\n}\n\nif (!construct) {\n  construct = function <T>(Func: new (...args: any[]) => T, ...args: any[]): T {\n    return new Func(...args);\n  };\n}\n\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayIndexOf = unapply(Array.prototype.indexOf);\nconst arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySlice = unapply(Array.prototype.slice);\nconst arraySplice = unapply(Array.prototype.splice);\nconst arrayIsArray = Array.isArray;\n\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\n\nconst numberToString = unapply(Number.prototype.toString);\nconst booleanToString = unapply(Boolean.prototype.toString);\nconst bigintToString =\n  typeof BigInt === 'undefined' ? null : unapply(BigInt.prototype.toString);\nconst symbolToString =\n  typeof Symbol === 'undefined' ? null : unapply(Symbol.prototype.toString);\n\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst objectToString = unapply(Object.prototype.toString);\n\nconst regExpTest = unapply(RegExp.prototype.test);\n\nconst typeErrorCreate = unconstruct(TypeError);\n\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param func - The function to be wrapped and called.\n * @returns A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply<T>(\n  func: (thisArg: any, ...args: any[]) => T\n): (thisArg: any, ...args: any[]) => T {\n  return (thisArg: any, ...args: any[]): T => {\n    if (thisArg instanceof RegExp) {\n      thisArg.lastIndex = 0;\n    }\n\n    return apply(func, thisArg, args);\n  };\n}\n\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param func - The constructor function to be wrapped and called.\n * @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct<T>(\n  Func: new (...args: any[]) => T\n): (...args: any[]) => T {\n  return (...args: any[]): T => construct(Func, args);\n}\n\n/**\n * Add properties to a lookup table\n *\n * @param set - The set to which elements will be added.\n * @param array - The array containing elements to be added to the set.\n * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns The modified set with added elements.\n */\nfunction addToSet(\n  set: Record<string, boolean>,\n  array: readonly unknown[],\n  transformCaseFunc: ReturnType<typeof unapply<string>> = stringToLowerCase\n): Record<string, boolean> {\n  if (setPrototypeOf) {\n    // Make 'in' and truthy checks like Boolean(set.constructor)\n    // independent of any properties defined on Object.prototype.\n    // Prevent prototype setters from intercepting set as a this value.\n    setPrototypeOf(set, null);\n  }\n\n  if (!arrayIsArray(array)) {\n    return set;\n  }\n\n  let l = array.length;\n  while (l--) {\n    let element = array[l];\n\n    if (typeof element === 'string') {\n      const lcElement = transformCaseFunc(element);\n\n      if (lcElement !== element) {\n        // Config presets (e.g. tags.js, attrs.js) are immutable.\n        if (!isFrozen(array)) {\n          (array as unknown[])[l] = lcElement;\n        }\n\n        element = lcElement;\n      }\n    }\n\n    set[element as string] = true;\n  }\n\n  return set;\n}\n\n/**\n * Clean up an array to harden against CSPP\n *\n * @param array - The array to be cleaned.\n * @returns The cleaned version of the array\n */\nfunction cleanArray<T>(array: T[]): Array<T | null> {\n  for (let index = 0; index < array.length; index++) {\n    const isPropertyExist = objectHasOwnProperty(array, index);\n\n    if (!isPropertyExist) {\n      array[index] = null;\n    }\n  }\n\n  return array;\n}\n\n/**\n * Shallow clone an object\n *\n * @param object - The object to be cloned.\n * @returns A new object that copies the original.\n */\nfunction clone<T extends Record<string, any>>(object: T): T {\n  const newObject = create(null);\n\n  for (const [property, value] of entries(object)) {\n    const isPropertyExist = objectHasOwnProperty(object, property);\n\n    if (isPropertyExist) {\n      if (arrayIsArray(value)) {\n        newObject[property] = cleanArray(value);\n      } else if (\n        value &&\n        typeof value === 'object' &&\n        value.constructor === Object\n      ) {\n        newObject[property] = clone(value);\n      } else {\n        newObject[property] = value;\n      }\n    }\n  }\n\n  return newObject;\n}\n\n/**\n * Convert non-node values into strings without depending on direct property access.\n *\n * @param value - The value to stringify.\n * @returns A string representation of the provided value.\n */\nfunction stringifyValue(value: unknown): string {\n  switch (typeof value) {\n    case 'string': {\n      return value;\n    }\n\n    case 'number': {\n      return numberToString(value);\n    }\n\n    case 'boolean': {\n      return booleanToString(value);\n    }\n\n    case 'bigint': {\n      return bigintToString ? bigintToString(value) : '0';\n    }\n\n    case 'symbol': {\n      return symbolToString ? symbolToString(value) : 'Symbol()';\n    }\n\n    case 'undefined': {\n      return objectToString(value);\n    }\n\n    case 'function':\n    case 'object': {\n      if (value === null) {\n        return objectToString(value);\n      }\n\n      const valueAsRecord = value as Record<string, any>;\n      const valueToString = lookupGetter(valueAsRecord, 'toString');\n\n      if (typeof valueToString === 'function') {\n        const stringified = valueToString(valueAsRecord);\n\n        return typeof stringified === 'string'\n          ? stringified\n          : objectToString(stringified);\n      }\n\n      return objectToString(value);\n    }\n\n    default: {\n      return objectToString(value);\n    }\n  }\n}\n\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param object - The object to look up the getter function in its prototype chain.\n * @param prop - The property name for which to find the getter function.\n * @returns The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter<T extends Record<string, any>>(\n  object: T,\n  prop: string\n): ReturnType<typeof unapply<any>> | (() => null) {\n  while (object !== null) {\n    const desc = getOwnPropertyDescriptor(object, prop);\n\n    if (desc) {\n      if (desc.get) {\n        return unapply(desc.get);\n      }\n\n      if (typeof desc.value === 'function') {\n        return unapply(desc.value);\n      }\n    }\n\n    object = getPrototypeOf(object);\n  }\n\n  function fallbackValue(): null {\n    return null;\n  }\n\n  return fallbackValue;\n}\n\nfunction isRegex(value: unknown): value is RegExp {\n  try {\n    regExpTest(value as RegExp, '');\n    return true;\n  } catch {\n    return false;\n  }\n}\n\nexport {\n  // Array\n  arrayForEach,\n  arrayIndexOf,\n  arrayIsArray,\n  arrayLastIndexOf,\n  arrayPop,\n  arrayPush,\n  arraySlice,\n  arraySplice,\n  // Object\n  entries,\n  freeze,\n  getPrototypeOf,\n  getOwnPropertyDescriptor,\n  isFrozen,\n  setPrototypeOf,\n  seal,\n  clone,\n  create,\n  objectHasOwnProperty,\n  objectToString,\n  // RegExp\n  regExpTest,\n  isRegex,\n  // String\n  stringIndexOf,\n  stringMatch,\n  stringReplace,\n  stringToLowerCase,\n  stringToString,\n  stringTrim,\n  // Other conversion\n  stringifyValue,\n  // Errors\n  typeErrorCreate,\n  // Other\n  lookupGetter,\n  addToSet,\n  // Reflect\n  unapply,\n  unconstruct,\n};\n", "import { freeze } from './utils.js';\n\nexport const html = freeze([\n  'a',\n  'abbr',\n  'acronym',\n  'address',\n  'area',\n  'article',\n  'aside',\n  'audio',\n  'b',\n  'bdi',\n  'bdo',\n  'big',\n  'blink',\n  'blockquote',\n  'body',\n  'br',\n  'button',\n  'canvas',\n  'caption',\n  'center',\n  'cite',\n  'code',\n  'col',\n  'colgroup',\n  'content',\n  'data',\n  'datalist',\n  'dd',\n  'decorator',\n  'del',\n  'details',\n  'dfn',\n  'dialog',\n  'dir',\n  'div',\n  'dl',\n  'dt',\n  'element',\n  'em',\n  'fieldset',\n  'figcaption',\n  'figure',\n  'font',\n  'footer',\n  'form',\n  'h1',\n  'h2',\n  'h3',\n  'h4',\n  'h5',\n  'h6',\n  'head',\n  'header',\n  'hgroup',\n  'hr',\n  'html',\n  'i',\n  'img',\n  'input',\n  'ins',\n  'kbd',\n  'label',\n  'legend',\n  'li',\n  'main',\n  'map',\n  'mark',\n  'marquee',\n  'menu',\n  'menuitem',\n  'meter',\n  'nav',\n  'nobr',\n  'ol',\n  'optgroup',\n  'option',\n  'output',\n  'p',\n  'picture',\n  'pre',\n  'progress',\n  'q',\n  'rp',\n  'rt',\n  'ruby',\n  's',\n  'samp',\n  'search',\n  'section',\n  'select',\n  'shadow',\n  'slot',\n  'small',\n  'source',\n  'spacer',\n  'span',\n  'strike',\n  'strong',\n  'style',\n  'sub',\n  'summary',\n  'sup',\n  'table',\n  'tbody',\n  'td',\n  'template',\n  'textarea',\n  'tfoot',\n  'th',\n  'thead',\n  'time',\n  'tr',\n  'track',\n  'tt',\n  'u',\n  'ul',\n  'var',\n  'video',\n  'wbr',\n] as const);\n\nexport const svg = freeze([\n  'svg',\n  'a',\n  'altglyph',\n  'altglyphdef',\n  'altglyphitem',\n  'animatecolor',\n  'animatemotion',\n  'animatetransform',\n  'circle',\n  'clippath',\n  'defs',\n  'desc',\n  'ellipse',\n  'enterkeyhint',\n  'exportparts',\n  'filter',\n  'font',\n  'g',\n  'glyph',\n  'glyphref',\n  'hkern',\n  'image',\n  'inputmode',\n  'line',\n  'lineargradient',\n  'marker',\n  'mask',\n  'metadata',\n  'mpath',\n  'part',\n  'path',\n  'pattern',\n  'polygon',\n  'polyline',\n  'radialgradient',\n  'rect',\n  'stop',\n  'style',\n  'switch',\n  'symbol',\n  'text',\n  'textpath',\n  'title',\n  'tref',\n  'tspan',\n  'view',\n  'vkern',\n] as const);\n\nexport const svgFilters = freeze([\n  'feBlend',\n  'feColorMatrix',\n  'feComponentTransfer',\n  'feComposite',\n  'feConvolveMatrix',\n  'feDiffuseLighting',\n  'feDisplacementMap',\n  'feDistantLight',\n  'feDropShadow',\n  'feFlood',\n  'feFuncA',\n  'feFuncB',\n  'feFuncG',\n  'feFuncR',\n  'feGaussianBlur',\n  'feImage',\n  'feMerge',\n  'feMergeNode',\n  'feMorphology',\n  'feOffset',\n  'fePointLight',\n  'feSpecularLighting',\n  'feSpotLight',\n  'feTile',\n  'feTurbulence',\n] as const);\n\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nexport const svgDisallowed = freeze([\n  'animate',\n  'color-profile',\n  'cursor',\n  'discard',\n  'font-face',\n  'font-face-format',\n  'font-face-name',\n  'font-face-src',\n  'font-face-uri',\n  'foreignobject',\n  'hatch',\n  'hatchpath',\n  'mesh',\n  'meshgradient',\n  'meshpatch',\n  'meshrow',\n  'missing-glyph',\n  'script',\n  'set',\n  'solidcolor',\n  'unknown',\n  'use',\n] as const);\n\nexport const mathMl = freeze([\n  'math',\n  'menclose',\n  'merror',\n  'mfenced',\n  'mfrac',\n  'mglyph',\n  'mi',\n  'mlabeledtr',\n  'mmultiscripts',\n  'mn',\n  'mo',\n  'mover',\n  'mpadded',\n  'mphantom',\n  'mroot',\n  'mrow',\n  'ms',\n  'mspace',\n  'msqrt',\n  'mstyle',\n  'msub',\n  'msup',\n  'msubsup',\n  'mtable',\n  'mtd',\n  'mtext',\n  'mtr',\n  'munder',\n  'munderover',\n  'mprescripts',\n] as const);\n\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nexport const mathMlDisallowed = freeze([\n  'maction',\n  'maligngroup',\n  'malignmark',\n  'mlongdiv',\n  'mscarries',\n  'mscarry',\n  'msgroup',\n  'mstack',\n  'msline',\n  'msrow',\n  'semantics',\n  'annotation',\n  'annotation-xml',\n  'mprescripts',\n  'none',\n] as const);\n\nexport const text = freeze(['#text'] as const);\n", "import { freeze } from './utils.js';\n\nexport const html = freeze([\n  'accept',\n  'action',\n  'align',\n  'alt',\n  'autocapitalize',\n  'autocomplete',\n  'autopictureinpicture',\n  'autoplay',\n  'background',\n  'bgcolor',\n  'border',\n  'capture',\n  'cellpadding',\n  'cellspacing',\n  'checked',\n  'cite',\n  'class',\n  'clear',\n  'color',\n  'cols',\n  'colspan',\n  'command',\n  'commandfor',\n  'controls',\n  'controlslist',\n  'coords',\n  'crossorigin',\n  'datetime',\n  'decoding',\n  'default',\n  'dir',\n  'disabled',\n  'disablepictureinpicture',\n  'disableremoteplayback',\n  'download',\n  'draggable',\n  'enctype',\n  'enterkeyhint',\n  'exportparts',\n  'face',\n  'for',\n  'headers',\n  'height',\n  'hidden',\n  'high',\n  'href',\n  'hreflang',\n  'id',\n  'inert',\n  'inputmode',\n  'integrity',\n  'ismap',\n  'kind',\n  'label',\n  'lang',\n  'list',\n  'loading',\n  'loop',\n  'low',\n  'max',\n  'maxlength',\n  'media',\n  'method',\n  'min',\n  'minlength',\n  'multiple',\n  'muted',\n  'name',\n  'nonce',\n  'noshade',\n  'novalidate',\n  'nowrap',\n  'open',\n  'optimum',\n  'part',\n  'pattern',\n  'placeholder',\n  'playsinline',\n  'popover',\n  'popovertarget',\n  'popovertargetaction',\n  'poster',\n  'preload',\n  'pubdate',\n  'radiogroup',\n  'readonly',\n  'rel',\n  'required',\n  'rev',\n  'reversed',\n  'role',\n  'rows',\n  'rowspan',\n  'spellcheck',\n  'scope',\n  'selected',\n  'shape',\n  'size',\n  'sizes',\n  'slot',\n  'span',\n  'srclang',\n  'start',\n  'src',\n  'srcset',\n  'step',\n  'style',\n  'summary',\n  'tabindex',\n  'title',\n  'translate',\n  'type',\n  'usemap',\n  'valign',\n  'value',\n  'width',\n  'wrap',\n  'xmlns',\n] as const);\n\nexport const svg = freeze([\n  'accent-height',\n  'accumulate',\n  'additive',\n  'alignment-baseline',\n  'amplitude',\n  'ascent',\n  'attributename',\n  'attributetype',\n  'azimuth',\n  'basefrequency',\n  'baseline-shift',\n  'begin',\n  'bias',\n  'by',\n  'class',\n  'clip',\n  'clippathunits',\n  'clip-path',\n  'clip-rule',\n  'color',\n  'color-interpolation',\n  'color-interpolation-filters',\n  'color-profile',\n  'color-rendering',\n  'cx',\n  'cy',\n  'd',\n  'dx',\n  'dy',\n  'diffuseconstant',\n  'direction',\n  'display',\n  'divisor',\n  'dominant-baseline',\n  'dur',\n  'edgemode',\n  'elevation',\n  'end',\n  'exponent',\n  'fill',\n  'fill-opacity',\n  'fill-rule',\n  'filter',\n  'filterunits',\n  'flood-color',\n  'flood-opacity',\n  'font-family',\n  'font-size',\n  'font-size-adjust',\n  'font-stretch',\n  'font-style',\n  'font-variant',\n  'font-weight',\n  'fx',\n  'fy',\n  'g1',\n  'g2',\n  'glyph-name',\n  'glyphref',\n  'gradientunits',\n  'gradienttransform',\n  'height',\n  'href',\n  'id',\n  'image-rendering',\n  'in',\n  'in2',\n  'intercept',\n  'k',\n  'k1',\n  'k2',\n  'k3',\n  'k4',\n  'kerning',\n  'keypoints',\n  'keysplines',\n  'keytimes',\n  'lang',\n  'lengthadjust',\n  'letter-spacing',\n  'kernelmatrix',\n  'kernelunitlength',\n  'lighting-color',\n  'local',\n  'marker-end',\n  'marker-mid',\n  'marker-start',\n  'markerheight',\n  'markerunits',\n  'markerwidth',\n  'maskcontentunits',\n  'maskunits',\n  'max',\n  'mask',\n  'mask-type',\n  'media',\n  'method',\n  'mode',\n  'min',\n  'name',\n  'numoctaves',\n  'offset',\n  'operator',\n  'opacity',\n  'order',\n  'orient',\n  'orientation',\n  'origin',\n  'overflow',\n  'paint-order',\n  'path',\n  'pathlength',\n  'patterncontentunits',\n  'patterntransform',\n  'patternunits',\n  'pointer-events',\n  'points',\n  'preservealpha',\n  'preserveaspectratio',\n  'primitiveunits',\n  'r',\n  'rx',\n  'ry',\n  'radius',\n  'refx',\n  'refy',\n  'repeatcount',\n  'repeatdur',\n  'restart',\n  'result',\n  'rotate',\n  'scale',\n  'seed',\n  'shape-rendering',\n  'slope',\n  'specularconstant',\n  'specularexponent',\n  'spreadmethod',\n  'startoffset',\n  'stddeviation',\n  'stitchtiles',\n  'stop-color',\n  'stop-opacity',\n  'stroke-dasharray',\n  'stroke-dashoffset',\n  'stroke-linecap',\n  'stroke-linejoin',\n  'stroke-miterlimit',\n  'stroke-opacity',\n  'stroke',\n  'stroke-width',\n  'style',\n  'surfacescale',\n  'systemlanguage',\n  'tabindex',\n  'tablevalues',\n  'targetx',\n  'targety',\n  'transform',\n  'transform-origin',\n  'text-anchor',\n  'text-decoration',\n  'text-orientation',\n  'text-rendering',\n  'textlength',\n  'type',\n  'u1',\n  'u2',\n  'unicode',\n  'values',\n  'vector-effect',\n  'viewbox',\n  'visibility',\n  'version',\n  'vert-adv-y',\n  'vert-origin-x',\n  'vert-origin-y',\n  'width',\n  'word-spacing',\n  'wrap',\n  'writing-mode',\n  'xchannelselector',\n  'ychannelselector',\n  'x',\n  'x1',\n  'x2',\n  'xmlns',\n  'y',\n  'y1',\n  'y2',\n  'z',\n  'zoomandpan',\n] as const);\n\nexport const mathMl = freeze([\n  'accent',\n  'accentunder',\n  'align',\n  'bevelled',\n  'close',\n  'columnalign',\n  'columnlines',\n  'columnspacing',\n  'columnspan',\n  'denomalign',\n  'depth',\n  'dir',\n  'display',\n  'displaystyle',\n  'encoding',\n  'fence',\n  'frame',\n  'height',\n  'href',\n  'id',\n  'largeop',\n  'length',\n  'linethickness',\n  'lquote',\n  'lspace',\n  'mathbackground',\n  'mathcolor',\n  'mathsize',\n  'mathvariant',\n  'maxsize',\n  'minsize',\n  'movablelimits',\n  'notation',\n  'numalign',\n  'open',\n  'rowalign',\n  'rowlines',\n  'rowspacing',\n  'rowspan',\n  'rspace',\n  'rquote',\n  'scriptlevel',\n  'scriptminsize',\n  'scriptsizemultiplier',\n  'selection',\n  'separator',\n  'separators',\n  'stretchy',\n  'subscriptshift',\n  'supscriptshift',\n  'symmetric',\n  'voffset',\n  'width',\n  'xmlns',\n]);\n\nexport const xml = freeze([\n  'xlink:href',\n  'xml:id',\n  'xlink:title',\n  'xml:space',\n  'xmlns:xlink',\n] as const);\n", "import { seal } from './utils.js';\n\nexport const MUSTACHE_EXPR = seal(/{{[\\w\\W]*|^[\\w\\W]*}}/g);\nexport const ERB_EXPR = seal(/<%[\\w\\W]*|^[\\w\\W]*%>/g);\nexport const TMPLIT_EXPR = seal(/\\${[\\w\\W]*/g);\nexport const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/); // eslint-disable-line no-useless-escape\nexport const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nexport const IS_ALLOWED_URI = seal(\n  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nexport const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nexport const ATTR_WHITESPACE = seal(\n  /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nexport const DOCTYPE_NAME = seal(/^html$/i);\nexport const CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n\n// Markup-significant character probes used by _sanitizeElements.\n// Shared module-level instances are safe despite the sticky /g flags:\n// unapply() resets lastIndex for RegExp receivers before every call.\nexport const ELEMENT_MARKUP_PROBE = seal(/<[/\\w!]/g);\nexport const COMMENT_MARKUP_PROBE = seal(/<[/\\w]/g);\nexport const FALLBACK_TAG_CLOSE = seal(/<\\/no(script|embed|frames)/i);\nexport const SELF_CLOSING_TAG = seal(/\\/>/i);\n", "import type { Config, UseProfilesConfig } from './config';\nimport type { DOMPurify, HooksMap, HookFunction, WindowLike } from './types';\nimport * as TAGS from './tags.js';\nimport * as ATTRS from './attrs.js';\nimport * as EXPRESSIONS from './regexp.js';\nimport {\n  addToSet,\n  clone,\n  entries,\n  freeze,\n  seal,\n  arrayForEach,\n  arrayIsArray,\n  arrayLastIndexOf,\n  arrayPop,\n  arrayPush,\n  arraySplice,\n  stringMatch,\n  stringReplace,\n  stringToLowerCase,\n  stringToString,\n  stringIndexOf,\n  stringTrim,\n  regExpTest,\n  isRegex,\n  typeErrorCreate,\n  lookupGetter,\n  create,\n  objectHasOwnProperty,\n  stringifyValue,\n} from './utils.js';\n\nexport type { Config } from './config';\n\nexport type {\n  DOMPurify,\n  RemovedElement,\n  RemovedAttribute,\n  HookName,\n  NodeHook,\n  ElementHook,\n  DocumentFragmentHook,\n  UponSanitizeElementHook,\n  UponSanitizeAttributeHook,\n  UponSanitizeElementHookEvent,\n  UponSanitizeAttributeHookEvent,\n  WindowLike,\n} from './types';\n\ndeclare const VERSION: string;\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n  element: 1,\n  attribute: 2,\n  text: 3,\n  cdataSection: 4,\n  entityReference: 5, // Deprecated\n  entityNode: 6, // Deprecated\n  processingInstruction: 7,\n  comment: 8,\n  document: 9,\n  documentType: 10,\n  documentFragment: 11,\n  notation: 12, // Deprecated\n};\n\n/* HTML-namespace elements whose child text nodes are serialized *literally*\n   (unescaped) by the HTML fragment-serialization algorithm. Two reparse-mXSS\n   shapes ride on that literal serialization:\n     (a) an element child - a tree the HTML parser can never build, but the DOM\n         API and an XML/XHTML parse can - after which a `</tag>`-bearing text\n         sibling breaks the element open on reparse; and\n     (b) text-only content that already carries the element's OWN end tag, e.g.\n         `<style>...</style><img onerror=x>` built as a node, which the literal\n         serializer emits verbatim for the HTML parser to re-open.\n   Shape (a) is handled by the firstElementChild branch in _isUnsafeNode; shape\n   (b) by the LITERAL_TEXT_CLOSE probe. Both read textContent (the raw-serialized\n   form for these elements) rather than innerHTML, because an XML/XHTML working\n   document serializes innerHTML with `<` escaped, which silently blinds the\n   innerHTML-based probes (rule 1's second probe and FALLBACK_TAG_CLOSE) there.\n   `script` is never allow-listed, but is kept here so the guard matches the\n   serializer's own literal-text list exactly. */\nconst LITERAL_TEXT_ELEMENT_NAMES = [\n  'style',\n  'script',\n  'xmp',\n  'iframe',\n  'noembed',\n  'noframes',\n  'plaintext',\n  'noscript',\n];\nconst LITERAL_TEXT_ELEMENTS = freeze(addToSet({}, LITERAL_TEXT_ELEMENT_NAMES));\n\n/* Per-element end-tag matcher. On an HTML reparse the ONLY token that\n   terminates a literal-text element's raw content is its own end tag; a foreign\n   literal-text close (e.g. `</xmp>` sitting inside `<style>`) does not break\n   out, so matching is per-element, not a shared alternation. The lookahead\n   requires an HTML tag-name terminator (whitespace, `/` or `>`) so a longer\n   name such as `</styles` is not mistaken for `</style`. */\nconst LITERAL_TEXT_CLOSE = (function (): Record<string, RegExp> {\n  const map: Record<string, RegExp> = {};\n  arrayForEach(LITERAL_TEXT_ELEMENT_NAMES, (name) => {\n    map[name] = seal(new RegExp('</' + name + '(?=[\\\\t\\\\n\\\\f\\\\r />])', 'i'));\n  });\n  return freeze(map);\n})();\n\nconst getGlobal = function (): WindowLike {\n  return typeof window === 'undefined' ? null : window;\n};\n\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param trustedTypes The policy factory.\n * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function (\n  trustedTypes: TrustedTypePolicyFactory,\n  purifyHostElement: HTMLScriptElement\n) {\n  if (\n    typeof trustedTypes !== 'object' ||\n    typeof trustedTypes.createPolicy !== 'function'\n  ) {\n    return null;\n  }\n\n  // Allow the callers to control the unique policy name\n  // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n  // Policy creation with duplicate names throws in Trusted Types.\n  let suffix = null;\n  const ATTR_NAME = 'data-tt-policy-suffix';\n  if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n    suffix = purifyHostElement.getAttribute(ATTR_NAME);\n  }\n\n  const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n\n  try {\n    return trustedTypes.createPolicy(policyName, {\n      createHTML(html) {\n        return html;\n      },\n      createScriptURL(scriptUrl) {\n        return scriptUrl;\n      },\n    });\n  } catch (_) {\n    // Policy creation failed (most likely another DOMPurify script has\n    // already run). Skip creating the policy, as this will only cause errors\n    // if TT are enforced.\n    console.warn(\n      'TrustedTypes policy ' + policyName + ' could not be created.'\n    );\n    return null;\n  }\n};\n\nconst _createHooksMap = function (): HooksMap {\n  return {\n    afterSanitizeAttributes: [],\n    afterSanitizeElements: [],\n    afterSanitizeShadowDOM: [],\n    beforeSanitizeAttributes: [],\n    beforeSanitizeElements: [],\n    beforeSanitizeShadowDOM: [],\n    uponSanitizeAttribute: [],\n    uponSanitizeElement: [],\n    uponSanitizeShadowNode: [],\n  };\n};\n\n/**\n * Resolve a set-valued configuration option: a fresh set built from\n * cfg[key] when it is an own array property (seeded with a clone of\n * options.base when given, case-normalized via options.transform),\n * the fallback set otherwise.\n *\n * @param cfg the cloned, prototype-free configuration object\n * @param key the configuration property to read\n * @param fallback the set to use when the option is absent or not an array\n * @param options transform and optional base set to merge into\n * @returns the resolved set\n */\nconst _resolveSetOption = function (\n  cfg: Config,\n  key: keyof Config,\n  fallback: Record<string, boolean>,\n  options: {\n    transform: Parameters<typeof addToSet>[2];\n    base?: Record<string, boolean>;\n  }\n): Record<string, boolean> {\n  return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key])\n    ? addToSet(\n        options.base ? clone(options.base) : {},\n        cfg[key] as readonly unknown[],\n        options.transform\n      )\n    : fallback;\n};\n\n/**\n * Resolve an object-valued configuration option: a prototype-free clone\n * of cfg[key] when it is an own, truthy object property, else a fresh\n * fallback built by makeFallback (fresh on every parse, so a previous\n * parse can never leak state into the next one).\n *\n * @param cfg the cloned, prototype-free configuration object\n * @param key the configuration property to read\n * @param makeFallback builds the fallback value when the option is absent\n * @returns the resolved object\n */\nconst _resolveObjectOption = function <T extends Record<string, any>>(\n  cfg: Config,\n  key: keyof Config,\n  makeFallback: () => T\n): T {\n  const value = objectHasOwnProperty(cfg, key) ? cfg[key] : undefined;\n  return value && typeof value === 'object'\n    ? clone(value as T)\n    : makeFallback();\n};\n\nfunction createDOMPurify(window: WindowLike = getGlobal()): DOMPurify {\n  const DOMPurify: DOMPurify = (root: WindowLike) => createDOMPurify(root);\n\n  DOMPurify.version = VERSION;\n\n  DOMPurify.removed = [];\n\n  if (\n    !window ||\n    !window.document ||\n    window.document.nodeType !== NODE_TYPE.document ||\n    !window.Element\n  ) {\n    // Not running in a browser, provide a factory function\n    // so that you can pass your own Window\n    DOMPurify.isSupported = false;\n\n    return DOMPurify;\n  }\n\n  let { document } = window;\n\n  const originalDocument = document;\n  const currentScript: HTMLScriptElement =\n    originalDocument.currentScript as HTMLScriptElement;\n  const {\n    DocumentFragment,\n    HTMLTemplateElement,\n    Node,\n    Element,\n    NodeFilter,\n    NamedNodeMap = window.NamedNodeMap || (window as any).MozNamedAttrMap,\n    HTMLFormElement,\n    DOMParser,\n    trustedTypes,\n  } = window;\n\n  const ElementPrototype = Element.prototype;\n\n  const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n  const remove = lookupGetter(ElementPrototype, 'remove');\n  const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n  const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n  const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n  const getShadowRoot = lookupGetter(ElementPrototype, 'shadowRoot');\n  const getAttributes = lookupGetter(ElementPrototype, 'attributes');\n  const getNodeType =\n    Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeType') : null;\n  const getNodeName =\n    Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeName') : null;\n  const getOwnerDocument =\n    Node && Node.prototype\n      ? lookupGetter(Node.prototype, 'ownerDocument')\n      : null;\n\n  /* Clobber-safe nodeType / nodeName reads through the cached Node.prototype\n     getters, with a direct-property fallback for environments that lack\n     Node.prototype. Sites that need a different fallback (e.g. _isClobbered\n     returns early on a null name) intentionally keep their own reads. */\n  const _readNodeType = function (node: Node): number {\n    return getNodeType ? getNodeType(node) : (node as any).nodeType;\n  };\n\n  const _readNodeName = function (node: Node): string {\n    return getNodeName ? getNodeName(node) : (node as any).nodeName;\n  };\n\n  // As per issue #47, the web-components registry is inherited by a\n  // new document created via createHTMLDocument. As per the spec\n  // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n  // a new empty registry is used when creating a template contents owner\n  // document, so we use that as our parent document to ensure nothing\n  // is inherited.\n  if (typeof HTMLTemplateElement === 'function') {\n    const template = document.createElement('template');\n    if (template.content && template.content.ownerDocument) {\n      document = template.content.ownerDocument;\n    }\n  }\n\n  let trustedTypesPolicy;\n  let emptyHTML = '';\n\n  // The instance's own internal Trusted Types policy. Unlike a caller-supplied\n  // `TRUSTED_TYPES_POLICY`, this is created at most once \u2014 Trusted Types throws\n  // on duplicate policy names \u2014 and is the only policy allowed to persist\n  // across configurations and survive `clearConfig()`.\n  let defaultTrustedTypesPolicy;\n  let defaultTrustedTypesPolicyResolved = false;\n\n  // Tracks whether we are already inside a call to the configured Trusted Types\n  // policy (`createHTML` or `createScriptURL`). If a supplied policy callback\n  // itself calls `DOMPurify.sanitize` (the cause of #1422), `sanitize` would\n  // re-enter the policy and recurse until the stack overflows. We detect that\n  // re-entry and throw a clear, actionable error instead. The guard is shared\n  // across both callbacks, because either one re-entering `sanitize` triggers\n  // the same unbounded recursion.\n  let IN_TRUSTED_TYPES_POLICY = 0;\n  const _assertNotInTrustedTypesPolicy = function (): void {\n    if (IN_TRUSTED_TYPES_POLICY > 0) {\n      throw typeErrorCreate(\n        'A configured TRUSTED_TYPES_POLICY callback (createHTML or ' +\n          'createScriptURL) must not call DOMPurify.sanitize, as that causes ' +\n          'infinite recursion. Do not pass a policy whose callbacks wrap ' +\n          'DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted ' +\n          'Types\" section of the README.'\n      );\n    }\n  };\n\n  const _createTrustedHTML = function (html: string): string {\n    _assertNotInTrustedTypesPolicy();\n\n    IN_TRUSTED_TYPES_POLICY++;\n    try {\n      return trustedTypesPolicy.createHTML(html);\n    } finally {\n      IN_TRUSTED_TYPES_POLICY--;\n    }\n  };\n\n  const _createTrustedScriptURL = function (scriptUrl: string): string {\n    _assertNotInTrustedTypesPolicy();\n\n    IN_TRUSTED_TYPES_POLICY++;\n    try {\n      return trustedTypesPolicy.createScriptURL(scriptUrl);\n    } finally {\n      IN_TRUSTED_TYPES_POLICY--;\n    }\n  };\n\n  // Lazily resolve (and cache) the instance's internal default policy.\n  // Resolution is attempted at most once: a successful `createPolicy` cannot be\n  // repeated (Trusted Types throws on duplicate names), and a failed or\n  // unsupported attempt must not be retried on every parse.\n  const _getDefaultTrustedTypesPolicy = function () {\n    if (!defaultTrustedTypesPolicyResolved) {\n      defaultTrustedTypesPolicy = _createTrustedTypesPolicy(\n        trustedTypes,\n        currentScript\n      );\n      defaultTrustedTypesPolicyResolved = true;\n    }\n\n    return defaultTrustedTypesPolicy;\n  };\n\n  const {\n    implementation,\n    createNodeIterator,\n    createDocumentFragment,\n    getElementsByTagName,\n  } = document;\n  const { importNode } = originalDocument;\n\n  let hooks = _createHooksMap();\n\n  /**\n   * Expose whether this browser supports running the full DOMPurify.\n   */\n  DOMPurify.isSupported =\n    typeof entries === 'function' &&\n    typeof getParentNode === 'function' &&\n    implementation &&\n    implementation.createHTMLDocument !== undefined;\n\n  const {\n    MUSTACHE_EXPR,\n    ERB_EXPR,\n    TMPLIT_EXPR,\n    DATA_ATTR,\n    ARIA_ATTR,\n    IS_SCRIPT_OR_DATA,\n    ATTR_WHITESPACE,\n    CUSTOM_ELEMENT,\n  } = EXPRESSIONS;\n\n  let { IS_ALLOWED_URI } = EXPRESSIONS;\n\n  /**\n   * We consider the elements and attributes below to be safe. Ideally\n   * don't add any new ones but feel free to remove unwanted ones.\n   */\n\n  /* allowed element names */\n  let ALLOWED_TAGS = null;\n  const DEFAULT_ALLOWED_TAGS = addToSet({}, [\n    ...TAGS.html,\n    ...TAGS.svg,\n    ...TAGS.svgFilters,\n    ...TAGS.mathMl,\n    ...TAGS.text,\n  ]);\n\n  /* Allowed attribute names */\n  let ALLOWED_ATTR = null;\n  const DEFAULT_ALLOWED_ATTR = addToSet({}, [\n    ...ATTRS.html,\n    ...ATTRS.svg,\n    ...ATTRS.mathMl,\n    ...ATTRS.xml,\n  ]);\n\n  /*\n   * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.\n   * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n   * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n   * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n   */\n  let CUSTOM_ELEMENT_HANDLING = Object.seal(\n    create(null, {\n      tagNameCheck: {\n        writable: true,\n        configurable: false,\n        enumerable: true,\n        value: null,\n      },\n      attributeNameCheck: {\n        writable: true,\n        configurable: false,\n        enumerable: true,\n        value: null,\n      },\n      allowCustomizedBuiltInElements: {\n        writable: true,\n        configurable: false,\n        enumerable: true,\n        value: false,\n      },\n    })\n  );\n\n  /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n  let FORBID_TAGS = null;\n\n  /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n  let FORBID_ATTR = null;\n\n  /* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */\n  const EXTRA_ELEMENT_HANDLING = Object.seal(\n    create(null, {\n      tagCheck: {\n        writable: true,\n        configurable: false,\n        enumerable: true,\n        value: null,\n      },\n      attributeCheck: {\n        writable: true,\n        configurable: false,\n        enumerable: true,\n        value: null,\n      },\n    })\n  );\n\n  /* Decide if ARIA attributes are okay */\n  let ALLOW_ARIA_ATTR = true;\n\n  /* Decide if custom data attributes are okay */\n  let ALLOW_DATA_ATTR = true;\n\n  /* Decide if unknown protocols are okay */\n  let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n  /* Decide if self-closing tags in attributes are allowed.\n   * Usually removed due to a mXSS issue in jQuery 3.0 */\n  let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n  /* Output should be safe for common template engines.\n   * This means, DOMPurify removes data attributes, mustaches and ERB\n   */\n  let SAFE_FOR_TEMPLATES = false;\n\n  /* Output should be safe even for XML used within HTML and alike.\n   * This means, DOMPurify removes comments when containing risky content.\n   */\n  let SAFE_FOR_XML = true;\n\n  /* Decide if document with <html>... should be returned */\n  let WHOLE_DOCUMENT = false;\n\n  /* Track whether config is already set on this instance of DOMPurify. */\n  let SET_CONFIG = false;\n\n  /* Pristine allowlist bindings captured at setConfig() time. On the\n   * persistent-config path sanitize() restores the sets from these before\n   * the per-walk hook clone-guard, so a hook's in-call widening cannot\n   * carry across calls. Null until setConfig() is called; reset by\n   * clearConfig(). */\n  let SET_CONFIG_ALLOWED_TAGS = null;\n  let SET_CONFIG_ALLOWED_ATTR = null;\n\n  /* Decide if all elements (e.g. style, script) must be children of\n   * document.body. By default, browsers might move them to document.head */\n  let FORCE_BODY = false;\n\n  /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n   * string (or a TrustedHTML object if Trusted Types are supported).\n   * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n   */\n  let RETURN_DOM = false;\n\n  /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n   * string  (or a TrustedHTML object if Trusted Types are supported) */\n  let RETURN_DOM_FRAGMENT = false;\n\n  /* Try to return a Trusted Type object instead of a string, return a string in\n   * case Trusted Types are not supported  */\n  let RETURN_TRUSTED_TYPE = false;\n\n  /* Output should be free from DOM clobbering attacks?\n   * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n   */\n  let SANITIZE_DOM = true;\n\n  /* Achieve full DOM Clobbering protection by isolating the namespace of named\n   * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n   *\n   * HTML/DOM spec rules that enable DOM Clobbering:\n   *   - Named Access on Window (\u00A77.3.3)\n   *   - DOM Tree Accessors (\u00A73.1.5)\n   *   - Form Element Parent-Child Relations (\u00A74.10.3)\n   *   - Iframe srcdoc / Nested WindowProxies (\u00A74.8.5)\n   *   - HTMLCollection (\u00A74.2.10.2)\n   *\n   * Namespace isolation is implemented by prefixing `id` and `name` attributes\n   * with a constant string, i.e., `user-content-`\n   */\n  let SANITIZE_NAMED_PROPS = false;\n  const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n  /* Keep element content when removing element? */\n  let KEEP_CONTENT = true;\n\n  /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n   * of importing it into a new Document and returning a sanitized copy */\n  let IN_PLACE = false;\n\n  /* Allow usage of profiles like html, svg and mathMl */\n  let USE_PROFILES: UseProfilesConfig | false = {};\n\n  /* Tags to ignore content of when KEEP_CONTENT is true */\n  let FORBID_CONTENTS = null;\n  const DEFAULT_FORBID_CONTENTS = addToSet({}, [\n    'annotation-xml',\n    'audio',\n    'colgroup',\n    'desc',\n    'foreignobject',\n    'head',\n    'iframe',\n    'math',\n    'mi',\n    'mn',\n    'mo',\n    'ms',\n    'mtext',\n    'noembed',\n    'noframes',\n    'noscript',\n    'plaintext',\n    'script',\n    // <selectedcontent> mirrors the selected <option>'s subtree, cloned by\n    // the UA (customizable <select>) \u2014 including any on* handlers \u2014 and the\n    // engine re-mirrors synchronously whenever a removal changes which\n    // option/selectedcontent is current, even inside DOMPurify's inert\n    // DOMParser document. Hoisting its children on removal re-inserts a fresh\n    // mirror target ahead of the walk, which the engine refills, looping\n    // forever (DoS) and amplifying output. Dropping its content on removal\n    // (rather than hoisting) breaks that cascade; the content is a duplicate\n    // of the option, which is sanitized on its own. See campaign-3 F1/F6.\n    'selectedcontent',\n    'style',\n    'svg',\n    'template',\n    'thead',\n    'title',\n    'video',\n    'xmp',\n  ]);\n\n  /* Tags that are safe for data: URIs */\n  let DATA_URI_TAGS = null;\n  const DEFAULT_DATA_URI_TAGS = addToSet({}, [\n    'audio',\n    'video',\n    'img',\n    'source',\n    'image',\n    'track',\n  ]);\n\n  /* Attributes safe for values like \"javascript:\" */\n  let URI_SAFE_ATTRIBUTES = null;\n  const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, [\n    'alt',\n    'class',\n    'for',\n    'id',\n    'label',\n    'name',\n    'pattern',\n    'placeholder',\n    'role',\n    'summary',\n    'title',\n    'value',\n    'style',\n    'xmlns',\n  ]);\n\n  const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n  const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n  const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n  /* Document namespace */\n  let NAMESPACE = HTML_NAMESPACE;\n  let IS_EMPTY_INPUT = false;\n\n  /* Allowed XHTML+XML namespaces */\n  let ALLOWED_NAMESPACES = null;\n  const DEFAULT_ALLOWED_NAMESPACES = addToSet(\n    {},\n    [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE],\n    stringToString\n  );\n\n  const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze([\n    'mi',\n    'mo',\n    'mn',\n    'ms',\n    'mtext',\n  ]);\n  let MATHML_TEXT_INTEGRATION_POINTS = addToSet(\n    {},\n    DEFAULT_MATHML_TEXT_INTEGRATION_POINTS\n  );\n\n  const DEFAULT_HTML_INTEGRATION_POINTS = freeze(['annotation-xml']);\n  let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);\n\n  // Certain elements are allowed in both SVG and HTML\n  // namespace. We need to specify them explicitly\n  // so that they don't get erroneously deleted from\n  // HTML namespace.\n  const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, [\n    'title',\n    'style',\n    'font',\n    'a',\n    'script',\n  ]);\n\n  /* Parsing of strict XHTML documents */\n  let PARSER_MEDIA_TYPE: null | DOMParserSupportedType = null;\n  const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n  const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n  let transformCaseFunc: null | Parameters<typeof addToSet>[2] = null;\n\n  /* Keep a reference to config to pass to hooks */\n  let CONFIG: Config | null = null;\n\n  /* Ideally, do not touch anything below this line */\n  /* ______________________________________________ */\n\n  const formElement = document.createElement('form');\n\n  const isRegexOrFunction = function (\n    testValue: unknown\n  ): testValue is Function | RegExp {\n    return testValue instanceof RegExp || testValue instanceof Function;\n  };\n\n  /**\n   * _parseConfig\n   *\n   * @param cfg optional config literal\n   */\n  // eslint-disable-next-line complexity\n  const _parseConfig = function (cfg: Config = {}): void {\n    if (CONFIG && CONFIG === cfg) {\n      return;\n    }\n\n    /* Shield configuration object from tampering */\n    if (!cfg || typeof cfg !== 'object') {\n      cfg = {};\n    }\n\n    /* Shield configuration object from prototype pollution */\n    cfg = clone(cfg);\n\n    PARSER_MEDIA_TYPE =\n      // eslint-disable-next-line unicorn/prefer-includes\n      SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1\n        ? DEFAULT_PARSER_MEDIA_TYPE\n        : cfg.PARSER_MEDIA_TYPE;\n\n    // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n    transformCaseFunc =\n      PARSER_MEDIA_TYPE === 'application/xhtml+xml'\n        ? stringToString\n        : stringToLowerCase;\n\n    /* Set configuration parameters */\n    ALLOWED_TAGS = _resolveSetOption(\n      cfg,\n      'ALLOWED_TAGS',\n      DEFAULT_ALLOWED_TAGS,\n      { transform: transformCaseFunc }\n    );\n    ALLOWED_ATTR = _resolveSetOption(\n      cfg,\n      'ALLOWED_ATTR',\n      DEFAULT_ALLOWED_ATTR,\n      { transform: transformCaseFunc }\n    );\n    ALLOWED_NAMESPACES = _resolveSetOption(\n      cfg,\n      'ALLOWED_NAMESPACES',\n      DEFAULT_ALLOWED_NAMESPACES,\n      { transform: stringToString }\n    );\n    URI_SAFE_ATTRIBUTES = _resolveSetOption(\n      cfg,\n      'ADD_URI_SAFE_ATTR',\n      DEFAULT_URI_SAFE_ATTRIBUTES,\n      { transform: transformCaseFunc, base: DEFAULT_URI_SAFE_ATTRIBUTES }\n    );\n    DATA_URI_TAGS = _resolveSetOption(\n      cfg,\n      'ADD_DATA_URI_TAGS',\n      DEFAULT_DATA_URI_TAGS,\n      { transform: transformCaseFunc, base: DEFAULT_DATA_URI_TAGS }\n    );\n    FORBID_CONTENTS = _resolveSetOption(\n      cfg,\n      'FORBID_CONTENTS',\n      DEFAULT_FORBID_CONTENTS,\n      { transform: transformCaseFunc }\n    );\n    FORBID_TAGS = _resolveSetOption(cfg, 'FORBID_TAGS', clone({}), {\n      transform: transformCaseFunc,\n    });\n    FORBID_ATTR = _resolveSetOption(cfg, 'FORBID_ATTR', clone({}), {\n      transform: transformCaseFunc,\n    });\n    USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES')\n      ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === 'object'\n        ? clone(cfg.USE_PROFILES)\n        : cfg.USE_PROFILES\n      : false;\n\n    ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n    ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n    ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n    ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n    SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n    SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n    WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n    RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n    RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n    RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n    FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n    SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n    SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n    KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n    IN_PLACE = cfg.IN_PLACE || false; // Default false\n    IS_ALLOWED_URI = isRegex(cfg.ALLOWED_URI_REGEXP)\n      ? cfg.ALLOWED_URI_REGEXP\n      : EXPRESSIONS.IS_ALLOWED_URI; // Default regexp\n\n    NAMESPACE =\n      typeof cfg.NAMESPACE === 'string' ? cfg.NAMESPACE : HTML_NAMESPACE; // Default HTML namespace\n\n    MATHML_TEXT_INTEGRATION_POINTS = _resolveObjectOption(\n      cfg,\n      'MATHML_TEXT_INTEGRATION_POINTS',\n      () => addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS) // Default built-in map\n    );\n\n    HTML_INTEGRATION_POINTS = _resolveObjectOption(\n      cfg,\n      'HTML_INTEGRATION_POINTS',\n      () => addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS) // Default built-in map\n    );\n\n    const customElementHandling = _resolveObjectOption(\n      cfg,\n      'CUSTOM_ELEMENT_HANDLING',\n      () => create(null)\n    );\n\n    CUSTOM_ELEMENT_HANDLING = create(null);\n\n    if (\n      objectHasOwnProperty(customElementHandling, 'tagNameCheck') &&\n      isRegexOrFunction(customElementHandling.tagNameCheck)\n    ) {\n      CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck; // Default undefined\n    }\n\n    if (\n      objectHasOwnProperty(customElementHandling, 'attributeNameCheck') &&\n      isRegexOrFunction(customElementHandling.attributeNameCheck)\n    ) {\n      CUSTOM_ELEMENT_HANDLING.attributeNameCheck =\n        customElementHandling.attributeNameCheck; // Default undefined\n    }\n\n    if (\n      objectHasOwnProperty(\n        customElementHandling,\n        'allowCustomizedBuiltInElements'\n      ) &&\n      typeof customElementHandling.allowCustomizedBuiltInElements === 'boolean'\n    ) {\n      CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements =\n        customElementHandling.allowCustomizedBuiltInElements; // Default undefined\n    }\n\n    seal(CUSTOM_ELEMENT_HANDLING);\n\n    if (SAFE_FOR_TEMPLATES) {\n      ALLOW_DATA_ATTR = false;\n    }\n\n    if (RETURN_DOM_FRAGMENT) {\n      RETURN_DOM = true;\n    }\n\n    /* Parse profile info */\n    if (USE_PROFILES) {\n      ALLOWED_TAGS = addToSet({}, TAGS.text);\n      ALLOWED_ATTR = create(null);\n      if (USE_PROFILES.html === true) {\n        addToSet(ALLOWED_TAGS, TAGS.html);\n        addToSet(ALLOWED_ATTR, ATTRS.html);\n      }\n\n      if (USE_PROFILES.svg === true) {\n        addToSet(ALLOWED_TAGS, TAGS.svg);\n        addToSet(ALLOWED_ATTR, ATTRS.svg);\n        addToSet(ALLOWED_ATTR, ATTRS.xml);\n      }\n\n      if (USE_PROFILES.svgFilters === true) {\n        addToSet(ALLOWED_TAGS, TAGS.svgFilters);\n        addToSet(ALLOWED_ATTR, ATTRS.svg);\n        addToSet(ALLOWED_ATTR, ATTRS.xml);\n      }\n\n      if (USE_PROFILES.mathMl === true) {\n        addToSet(ALLOWED_TAGS, TAGS.mathMl);\n        addToSet(ALLOWED_ATTR, ATTRS.mathMl);\n        addToSet(ALLOWED_ATTR, ATTRS.xml);\n      }\n    }\n\n    /* Always reset function-based ADD_TAGS / ADD_ATTR checks to prevent\n     * leaking across calls when switching from function to array config */\n    EXTRA_ELEMENT_HANDLING.tagCheck = null;\n    EXTRA_ELEMENT_HANDLING.attributeCheck = null;\n\n    /* Merge configuration parameters */\n    if (objectHasOwnProperty(cfg, 'ADD_TAGS')) {\n      if (typeof cfg.ADD_TAGS === 'function') {\n        EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;\n      } else if (arrayIsArray(cfg.ADD_TAGS)) {\n        if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n          ALLOWED_TAGS = clone(ALLOWED_TAGS);\n        }\n\n        addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n      }\n    }\n\n    if (objectHasOwnProperty(cfg, 'ADD_ATTR')) {\n      if (typeof cfg.ADD_ATTR === 'function') {\n        EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;\n      } else if (arrayIsArray(cfg.ADD_ATTR)) {\n        if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n          ALLOWED_ATTR = clone(ALLOWED_ATTR);\n        }\n\n        addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n      }\n    }\n\n    if (\n      objectHasOwnProperty(cfg, 'ADD_FORBID_CONTENTS') &&\n      arrayIsArray(cfg.ADD_FORBID_CONTENTS)\n    ) {\n      if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n        FORBID_CONTENTS = clone(FORBID_CONTENTS);\n      }\n\n      addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);\n    }\n\n    /* Add #text in case KEEP_CONTENT is set to true */\n    if (KEEP_CONTENT) {\n      ALLOWED_TAGS['#text'] = true;\n    }\n\n    /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n    if (WHOLE_DOCUMENT) {\n      addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n    }\n\n    /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n    if (ALLOWED_TAGS.table) {\n      addToSet(ALLOWED_TAGS, ['tbody']);\n      delete FORBID_TAGS.tbody;\n    }\n\n    // Re-derive the active Trusted Types policy from this configuration on\n    // every parse. The active policy must never be sticky closure state that\n    // outlives the config that set it: a caller-supplied policy left in place\n    // after `clearConfig()` \u2014 or after a later call that supplied none, or\n    // `TRUSTED_TYPES_POLICY: null` \u2014 could sign a subsequent \"default\"\n    // `RETURN_TRUSTED_TYPE` result with a foreign, possibly unsafe policy.\n    // See GHSA-vxr8-fq34-vvx9.\n    if (cfg.TRUSTED_TYPES_POLICY) {\n      if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n        throw typeErrorCreate(\n          'TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.'\n        );\n      }\n\n      if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n        throw typeErrorCreate(\n          'TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.'\n        );\n      }\n\n      // A caller-supplied policy applies to this configuration only.\n      const previousTrustedTypesPolicy = trustedTypesPolicy;\n      trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n      // Sign local variables required by `sanitize`. If the supplied policy's\n      // `createHTML` is circular (i.e. it calls `DOMPurify.sanitize`), this\n      // throws via the re-entrancy guard. Restore the previous policy first so\n      // the instance is not left in a poisoned state. See #1422.\n      try {\n        emptyHTML = _createTrustedHTML('');\n      } catch (error) {\n        trustedTypesPolicy = previousTrustedTypesPolicy;\n        throw error;\n      }\n    } else if (cfg.TRUSTED_TYPES_POLICY === null) {\n      // Explicit opt-out for this call: perform no Trusted Types signing and\n      // create nothing (so a strict `trusted-types` CSP that disallows a\n      // `dompurify` policy can still call `sanitize` from inside its own\n      // policy \u2014 see #1422). Resetting to `undefined` rather than a sticky\n      // `null` also drops any previously retained caller policy, so it cannot\n      // resurface on a later call, while still allowing the next config-less\n      // call to restore the internal default policy. See GHSA-vxr8-fq34-vvx9.\n      trustedTypesPolicy = undefined;\n      emptyHTML = '';\n    } else {\n      // No policy supplied: keep the currently active policy if one is set \u2014 a\n      // previously supplied policy is intentionally sticky across config-less\n      // calls \u2014 otherwise fall back to the instance's own internal policy,\n      // created at most once. (A policy supplied for a *single* call still\n      // lingers by design; what must not linger is a policy whose configuration\n      // has been torn down via `clearConfig()`, which restores the default.)\n      if (trustedTypesPolicy === undefined) {\n        trustedTypesPolicy = _getDefaultTrustedTypesPolicy();\n      }\n\n      // Sign internal variables only when a policy is active. A falsy policy\n      // (Trusted Types unsupported, creation failed, or an explicit opt-out)\n      // leaves `emptyHTML` as a plain string, so we never call `.createHTML` on\n      // a non-policy and throw. See #1422.\n      if (trustedTypesPolicy && typeof emptyHTML === 'string') {\n        emptyHTML = _createTrustedHTML('');\n      }\n    }\n\n    // Prevent further manipulation of configuration.\n    // Not available in IE8, Safari 5, etc.\n    if (freeze) {\n      freeze(cfg);\n    }\n\n    CONFIG = cfg;\n  };\n\n  /* Keep track of all possible SVG and MathML tags\n   * so that we can perform the namespace checks\n   * correctly. */\n  const ALL_SVG_TAGS = addToSet({}, [\n    ...TAGS.svg,\n    ...TAGS.svgFilters,\n    ...TAGS.svgDisallowed,\n  ]);\n  const ALL_MATHML_TAGS = addToSet({}, [\n    ...TAGS.mathMl,\n    ...TAGS.mathMlDisallowed,\n  ]);\n\n  /**\n   * Namespace rules for an element in the SVG namespace.\n   *\n   * @param tagName the element's lowercase tag name\n   * @param parent the (possibly simulated) parent node\n   * @param parentTagName the parent's lowercase tag name\n   * @returns true if a spec-compliant parser could produce this element\n   */\n  const _checkSvgNamespace = function (\n    tagName: string,\n    parent: { namespaceURI?: string },\n    parentTagName: string\n  ): boolean {\n    // The only way to switch from HTML namespace to SVG\n    // is via <svg>. If it happens via any other tag, then\n    // it should be killed.\n    if (parent.namespaceURI === HTML_NAMESPACE) {\n      return tagName === 'svg';\n    }\n\n    // The only way to switch from MathML to SVG is via <svg>\n    // if the parent is either <annotation-xml> or a MathML\n    // text integration point.\n    if (parent.namespaceURI === MATHML_NAMESPACE) {\n      return (\n        tagName === 'svg' &&\n        (parentTagName === 'annotation-xml' ||\n          MATHML_TEXT_INTEGRATION_POINTS[parentTagName])\n      );\n    }\n\n    // We only allow elements that are defined in SVG\n    // spec. All others are disallowed in SVG namespace.\n    return Boolean(ALL_SVG_TAGS[tagName]);\n  };\n\n  /**\n   * Namespace rules for an element in the MathML namespace.\n   *\n   * @param tagName the element's lowercase tag name\n   * @param parent the (possibly simulated) parent node\n   * @param parentTagName the parent's lowercase tag name\n   * @returns true if a spec-compliant parser could produce this element\n   */\n  const _checkMathMlNamespace = function (\n    tagName: string,\n    parent: { namespaceURI?: string },\n    parentTagName: string\n  ): boolean {\n    // The only way to switch from HTML namespace to MathML\n    // is via <math>. If it happens via any other tag, then\n    // it should be killed.\n    if (parent.namespaceURI === HTML_NAMESPACE) {\n      return tagName === 'math';\n    }\n\n    // The only way to switch from SVG to MathML is via\n    // <math> and HTML integration points\n    if (parent.namespaceURI === SVG_NAMESPACE) {\n      return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n    }\n\n    // We only allow elements that are defined in MathML\n    // spec. All others are disallowed in MathML namespace.\n    return Boolean(ALL_MATHML_TAGS[tagName]);\n  };\n\n  /**\n   * Namespace rules for an element in the HTML namespace.\n   *\n   * @param tagName the element's lowercase tag name\n   * @param parent the (possibly simulated) parent node\n   * @param parentTagName the parent's lowercase tag name\n   * @returns true if a spec-compliant parser could produce this element\n   */\n  const _checkHtmlNamespace = function (\n    tagName: string,\n    parent: { namespaceURI?: string },\n    parentTagName: string\n  ): boolean {\n    // The only way to switch from SVG to HTML is via\n    // HTML integration points, and from MathML to HTML\n    // is via MathML text integration points\n    if (\n      parent.namespaceURI === SVG_NAMESPACE &&\n      !HTML_INTEGRATION_POINTS[parentTagName]\n    ) {\n      return false;\n    }\n\n    if (\n      parent.namespaceURI === MATHML_NAMESPACE &&\n      !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]\n    ) {\n      return false;\n    }\n\n    // We disallow tags that are specific for MathML\n    // or SVG and should never appear in HTML namespace\n    return (\n      !ALL_MATHML_TAGS[tagName] &&\n      (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName])\n    );\n  };\n\n  /**\n   * @param element a DOM element whose namespace is being checked\n   * @returns Return false if the element has a\n   *  namespace that a spec-compliant parser would never\n   *  return. Return true otherwise.\n   */\n  const _checkValidNamespace = function (element: Element): boolean {\n    let parent = getParentNode(element);\n\n    // In JSDOM, if we're inside shadow DOM, then parentNode\n    // can be null. We just simulate parent in this case.\n    if (!parent || !parent.tagName) {\n      parent = {\n        namespaceURI: NAMESPACE,\n        tagName: 'template',\n      };\n    }\n\n    const tagName = stringToLowerCase(element.tagName);\n    const parentTagName = stringToLowerCase(parent.tagName);\n\n    if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n      return false;\n    }\n\n    if (element.namespaceURI === SVG_NAMESPACE) {\n      return _checkSvgNamespace(tagName, parent, parentTagName);\n    }\n\n    if (element.namespaceURI === MATHML_NAMESPACE) {\n      return _checkMathMlNamespace(tagName, parent, parentTagName);\n    }\n\n    if (element.namespaceURI === HTML_NAMESPACE) {\n      return _checkHtmlNamespace(tagName, parent, parentTagName);\n    }\n\n    // For XHTML and XML documents that support custom namespaces\n    if (\n      PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n      ALLOWED_NAMESPACES[element.namespaceURI]\n    ) {\n      return true;\n    }\n\n    // The code should never reach this place (this means\n    // that the element somehow got namespace that is not\n    // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n    // Return false just in case.\n    return false;\n  };\n\n  /**\n   * _forceRemove\n   *\n   * @param node a DOM node\n   */\n  const _forceRemove = function (node: Node): void {\n    arrayPush(DOMPurify.removed, { element: node });\n\n    try {\n      // eslint-disable-next-line unicorn/prefer-dom-node-remove\n      getParentNode(node).removeChild(node);\n    } catch (_) {\n      /* The normal detach failed \u2014 this is reached for a parentless node\n         (getParentNode() is null, so .removeChild throws). Element.prototype\n         .remove() is itself a spec no-op on a parentless node, so a recorded\n         \"removal\" would otherwise hand the caller back an intact,\n         payload-bearing node (e.g. a detached IN_PLACE root the mXSS canary or\n         the style-with-element-child rule decided to kill). Fail closed by\n         throwing \u2014 exactly as a clobbered root does at the IN_PLACE entry \u2014\n         rather than trying to \"neutralize\" the node via its own methods.\n         Neutralizing would mean calling getAttributeNames()/removeAttribute()\n         on the node, both of which a <form> root can clobber via a named child\n         (and _isClobbered does not even probe getAttributeNames), so the\n         neutralize step could itself be silently defeated, leaving the payload\n         intact. A throw touches only the cached, clobber-safe remove() and\n         getParentNode(). Generalizes GHSA-r47g-fvhr-h676 (clobbered-form root)\n         to every root-kill reason. REPORT-3.\n\n         This lives inside the catch, so it never fires for a normally-removed\n         in-tree node: those have a parent, removeChild() succeeds, and the\n         catch is not entered. Only a kept (parentless) root reaches here. */\n      remove(node);\n\n      if (!getParentNode(node)) {\n        throw typeErrorCreate(\n          'a node selected for removal could not be detached from its tree ' +\n            'and cannot be safely returned; refusing to sanitize in place'\n        );\n      }\n    }\n  };\n\n  /**\n   * _stripAttributeNode\n   *\n   * Remove a single Attr node case/namespace-exactly on an attribute-teardown\n   * path. Name-based removeAttribute() ASCII-lowercases its lookup key for an\n   * HTML element in an HTML document and so silently misses a case-preserved\n   * handler (e.g. `ONERROR` off an XML/XHTML import) - the same defect\n   * _removeAttribute() was fixed for, which a name-based call would reintroduce\n   * on these IN_PLACE teardown paths. Unlike _removeAttribute this does not\n   * record into DOMPurify.removed: the neutralize passes intentionally do not\n   * book-keep. A clobbered/detached node falls back to best-effort name-based\n   * removal.\n   *\n   * @param element the element to strip the attribute from\n   * @param attribute the Attr node to remove\n   * @param name the attribute's name, for the fallback path\n   */\n  const _stripAttributeNode = function (\n    element: Element,\n    attribute: Attr,\n    name: string\n  ): void {\n    try {\n      element.removeAttributeNode(attribute);\n    } catch (_) {\n      try {\n        element.removeAttribute(name);\n      } catch (_) {}\n    }\n  };\n\n  /**\n   * _neutralizeRoot\n   *\n   * Fail-closed teardown of an in-place root after the sanitize walk aborts\n   * (campaign-3 F2). An internal throw mid-walk \u2014 e.g. a page-registered\n   * custom element's reaction detaches a node so `_forceRemove`'s deliberate\n   * parentless guard throws, or any other re-entrant engine mutation \u2014 would\n   * otherwise leave the caller's *live* tree half-sanitized, with everything\n   * after the abort point still carrying its handlers. There is no safe way\n   * to resume the walk (the tree mutated under us), so we strip the root bare:\n   * remove every child and every attribute, then let the caller's catch see\n   * the original error. Clobber-safe (cached `remove`/`childNodes`/`attributes`\n   * getters; the root was already clobber-pre-flighted at the IN_PLACE entry).\n   *\n   * @param root the in-place root to empty\n   */\n  const _neutralizeRoot = function (root: Node): void {\n    /* Strip every disallowed attribute (on* handlers included) off the whole\n       subtree BEFORE detaching anything. Detaching first would hand back\n       handler-bearing originals (e.g. an already-loading `<img onerror>`)\n       whose queued resource event still fires in page scope after we throw.\n       Clobber-safe reads; a doomed clobbered node's own attributes are\n       irrelevant while its non-clobbered descendants are reached and scrubbed. */\n    _neutralizeSubtree(root);\n\n    const childNodes = getChildNodes(root);\n    if (childNodes) {\n      const snapshot: Node[] = [];\n      arrayForEach(childNodes, (child) => {\n        arrayPush(snapshot, child);\n      });\n      arrayForEach(snapshot, (child) => {\n        try {\n          remove(child);\n        } catch (_) {\n          /* Best-effort teardown; a still-attached child is handled below */\n        }\n      });\n    }\n\n    const attributes = getAttributes(root);\n    if (attributes) {\n      for (let i = attributes.length - 1; i >= 0; --i) {\n        const attribute = attributes[i];\n        const name = attribute && attribute.name;\n        if (typeof name === 'string') {\n          _stripAttributeNode(root as Element, attribute, name);\n        }\n      }\n    }\n  };\n\n  /**\n   * _removeAttribute\n   *\n   * Name-based getAttributeNode()/removeAttribute() ASCII-lowercase their\n   * lookup key for HTML elements in an HTML document, so they silently miss an\n   * attribute whose stored qualified name still contains uppercase ASCII\n   * letters. That happens when the node came from a case-preserving source\n   * (an XML/XHTML document imported via importNode(), or createAttributeNS()),\n   * where e.g. `ONERROR` survives the walk: the policy check lowercases to\n   * `onerror` and rejects it, but `removeAttribute('ONERROR')` looks up\n   * `onerror` and finds nothing. Remove the exact Attr node instead, which is\n   * case- and namespace-exact, and fall back to name-based removal only when\n   * the caller could not supply the node.\n   *\n   * @param name an Attribute name\n   * @param element a DOM node\n   * @param attr the exact Attr node to remove, when the caller has it\n   */\n  const _removeAttribute = function (\n    name: string,\n    element: Element,\n    attr?: Attr | null\n  ): void {\n    if (!attr) {\n      try {\n        attr = element.getAttributeNode(name);\n      } catch (_) {\n        attr = null;\n      }\n    }\n\n    arrayPush(DOMPurify.removed, {\n      attribute: attr || null,\n      from: element,\n    });\n\n    try {\n      if (attr) {\n        element.removeAttributeNode(attr);\n      } else {\n        element.removeAttribute(name);\n      }\n    } catch (_) {\n      /* Clobbered or already-detached node - best-effort fall back to a\n         name-based removal so the \"is\" handling below still runs. */\n      try {\n        element.removeAttribute(name);\n      } catch (_) {}\n    }\n\n    // We void attribute values for unremovable \"is\" attributes\n    if (name === 'is') {\n      if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n        try {\n          _forceRemove(element);\n        } catch (_) {}\n      } else {\n        try {\n          element.setAttribute(name, '');\n        } catch (_) {}\n      }\n    }\n  };\n\n  /**\n   * _stripDisallowedAttributes\n   *\n   * Removes every attribute the active configuration does not allow from a\n   * single element, using the same allowlist as the main attribute pass (so\n   * `on*` handlers go, but no `/^on/` blocklist is introduced). Used only to\n   * neutralise nodes that are being discarded from an in-place tree.\n   *\n   * @param element the element to strip\n   */\n  const _stripDisallowedAttributes = function (element: Element): void {\n    const attributes = getAttributes(element);\n    if (!attributes) {\n      return;\n    }\n\n    for (let i = attributes.length - 1; i >= 0; --i) {\n      const attribute = attributes[i];\n      const name = attribute && attribute.name;\n      if (typeof name !== 'string' || ALLOWED_ATTR[transformCaseFunc(name)]) {\n        continue;\n      }\n\n      _stripAttributeNode(element, attribute, name);\n    }\n  };\n\n  /**\n   * _neutralizeSubtree\n   *\n   * Completes the audit-5 F1 fix across every removal path. The KEEP_CONTENT\n   * move-hoist neutralises only disallowed-tag removals; clobber, mXSS-canary,\n   * namespace, comment, processing-instruction and KEEP_CONTENT:false removals\n   * all drop their subtree wholesale via `_forceRemove`. On the IN_PLACE path\n   * those dropped nodes are detached from the caller's LIVE tree but a\n   * handler-bearing original among them (an `<img onerror>`/`<video>` that was\n   * loading) keeps its queued resource event, which fires in page scope after\n   * sanitize returns. This walks a removed subtree and strips every attribute\n   * the active configuration does not allow \u2014 so `on*` handlers are cancelled\n   * through the SAME allowlist that governs kept nodes, not a separate `/^on/`\n   * blocklist. Run synchronously before sanitize returns, i.e. before any\n   * queued event can fire. Hook-free by design: these nodes leave the output,\n   * so firing attribute hooks for them would be surprising. Clobber-safe reads;\n   * a doomed clobbered node may shadow `removeAttribute` (its own attributes are\n   * irrelevant \u2014 it is discarded \u2014 while its non-clobbered descendants, e.g.\n   * the `<img>`, are reached and scrubbed).\n   *\n   * @param root the root of a removed subtree to neutralise\n   */\n  const _neutralizeSubtree = function (root: Node): void {\n    const stack: Node[] = [root];\n\n    while (stack.length > 0) {\n      const node = stack.pop();\n      const nodeType = _readNodeType(node);\n\n      if (nodeType === NODE_TYPE.element) {\n        _stripDisallowedAttributes(node as Element);\n      }\n\n      const childNodes = getChildNodes(node);\n      if (childNodes) {\n        for (let i = childNodes.length - 1; i >= 0; --i) {\n          stack.push(childNodes[i]);\n        }\n      }\n    }\n  };\n\n  /**\n   * _neutralizePatchLinkage\n   *\n   * IN_PLACE entry pre-pass (declarative-partial-updates / streaming\n   * hardening, https://github.com/WICG/declarative-partial-updates).\n   *\n   * The main walk strips patch linkage (`for`/`patchsrc`) and removes range\n   * markers (PIs / markup comments) node-by-node, in document order, AS it\n   * reaches each node. On a live in-place root that leaves a window: from the\n   * moment the root is connected until the walk arrives at a given node, that\n   * node's linkage is live. A patch applied on connection/stream can fire as\n   * a microtask during the walk and inject or teleport an unsanitized DOM\n   * range into a region the iterator has already passed and will not revisit,\n   * so the post-return \"tree is sanitized\" contract is violated. Sweep the\n   * whole tree once up front and sever every linkage before the walk begins,\n   * closing that window.\n   *\n   * This CANNOT undo a patch that already fired before sanitize ran \u2014 that is\n   * the irreducible \"do not IN_PLACE a live-connected attacker tree\" caveat \u2014\n   * but it closes everything from sanitize-start onward. Gated on SAFE_FOR_XML\n   * to group with the rest of the declarative-partial-updates handling and\n   * stay overridable, consistent with the codebase.\n   *\n   * Clobber-safe traversal (cached childNodes getter); per-node try/catch so a\n   * clobbered root cannot defeat the sweep of its non-clobbered descendants.\n   *\n   * NOTE (pending real-Chrome confirmation, see test/declarative-patch-probe\n   * .html Q1): this mirrors the existing policy of keeping `for` on\n   * <label>/<output>. If the shipping feature can drive a patch through a\n   * surviving `for`-on-label/output + `id` pair, this pre-pass and the\n   * attribute check at _isBasicCustomElement's caller must additionally drop\n   * that pair on the IN_PLACE path. Left as-is until the taxonomy is verified.\n   *\n   * @param root the in-place root to sweep\n   */\n  /**\n   * Central policy for declarative-partial-updates patch-linkage attributes,\n   * shared by the _neutralizePatchLinkage pre-pass and _isValidAttribute so\n   * the two sites cannot drift: `patchsrc` always links, `for` links\n   * everywhere except on <label>/<output>, and the whole policy is gated on\n   * SAFE_FOR_XML (see the rationale block in _isValidAttribute).\n   *\n   * @param lcName the transformCaseFunc'd attribute name\n   * @param lcTag the transformCaseFunc'd tag name of the carrying element\n   * @return true if the attribute is patch linkage and must be dropped\n   */\n  const _isPatchLinkageAttribute = function (\n    lcName: string,\n    lcTag: string\n  ): boolean {\n    if (!SAFE_FOR_XML) {\n      return false;\n    }\n\n    if (lcName === 'patchsrc') {\n      return true;\n    }\n\n    return lcName === 'for' && lcTag !== 'label' && lcTag !== 'output';\n  };\n\n  const _neutralizePatchLinkage = function (root: Node): void {\n    if (!SAFE_FOR_XML) {\n      return;\n    }\n\n    const stack: Node[] = [root];\n    while (stack.length > 0) {\n      const node = stack.pop();\n      const nodeType = _readNodeType(node);\n\n      /* Remove range markers (the target side of a patch linkage): every\n         processing instruction, and any markup-bearing comment. */\n      if (\n        nodeType === NODE_TYPE.processingInstruction ||\n        (nodeType === NODE_TYPE.comment &&\n          regExpTest(EXPRESSIONS.COMMENT_MARKUP_PROBE, (node as any).data))\n      ) {\n        try {\n          remove(node);\n        } catch (_) {\n          /* Best-effort */\n        }\n\n        continue;\n      }\n\n      /* Strip patch-source attributes (the source side) off elements. */\n      if (nodeType === NODE_TYPE.element) {\n        const element = node as Element;\n        const lcTag = transformCaseFunc(_readNodeName(node));\n        try {\n          if (element.hasAttribute && element.hasAttribute('patchsrc')) {\n            element.removeAttribute('patchsrc');\n          }\n\n          if (\n            element.hasAttribute &&\n            element.hasAttribute('for') &&\n            _isPatchLinkageAttribute('for', lcTag)\n          ) {\n            element.removeAttribute('for');\n          }\n        } catch (_) {\n          /* Clobbered removeAttribute/hasAttribute on a doomed node \u2014 ignore */\n        }\n      }\n\n      const childNodes = getChildNodes(node);\n      if (childNodes) {\n        for (let i = childNodes.length - 1; i >= 0; --i) {\n          stack.push(childNodes[i]);\n        }\n      }\n    }\n  };\n\n  /**\n   * _initDocument\n   *\n   * @param dirty - a string of dirty markup\n   * @return a DOM, filled with the dirty markup\n   */\n  const _initDocument = function (dirty: string): Document {\n    /* Create a HTML document */\n    let doc = null;\n    let leadingWhitespace = null;\n\n    if (FORCE_BODY) {\n      dirty = '<remove></remove>' + dirty;\n    } else {\n      /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n      const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n      leadingWhitespace = matches && matches[0];\n    }\n\n    if (\n      PARSER_MEDIA_TYPE === 'application/xhtml+xml' &&\n      NAMESPACE === HTML_NAMESPACE\n    ) {\n      // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n      dirty =\n        '<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>' +\n        dirty +\n        '</body></html>';\n    }\n\n    const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;\n    /*\n     * Use the DOMParser API by default, fallback later if needs be\n     * DOMParser not work for svg when has multiple root element.\n     */\n    if (NAMESPACE === HTML_NAMESPACE) {\n      try {\n        doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n      } catch (_) {}\n    }\n\n    /* Use createHTMLDocument in case DOMParser is not available */\n    if (!doc || !doc.documentElement) {\n      doc = implementation.createDocument(NAMESPACE, 'template', null);\n      try {\n        doc.documentElement.innerHTML = IS_EMPTY_INPUT\n          ? emptyHTML\n          : dirtyPayload;\n      } catch (_) {\n        // Syntax error if dirtyPayload is invalid xml\n      }\n    }\n\n    const body = doc.body || doc.documentElement;\n\n    if (dirty && leadingWhitespace) {\n      body.insertBefore(\n        document.createTextNode(leadingWhitespace),\n        body.childNodes[0] || null\n      );\n    }\n\n    /* Work on whole document or just its body */\n    if (NAMESPACE === HTML_NAMESPACE) {\n      return getElementsByTagName.call(\n        doc,\n        WHOLE_DOCUMENT ? 'html' : 'body'\n      )[0];\n    }\n\n    return WHOLE_DOCUMENT ? doc.documentElement : body;\n  };\n\n  /**\n   * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n   *\n   * @param root The root element or node to start traversing on.\n   * @return The created NodeIterator\n   */\n  const _createNodeIterator = function (root: Node): NodeIterator {\n    /* Read ownerDocument through the cached Node.prototype getter, never the\n       direct property. HTMLFormElement has [LegacyOverrideBuiltIns], so a\n       clobbering child (<input name=\"ownerDocument\"> or a form-associated\n       external input) shadows the prototype getter and makes a direct read\n       return that <input>. createNodeIterator.call(<input>, ...) then throws\n       \"Illegal invocation\", and on the IN_PLACE path that throw lands before\n       the walk's fail-closed barrier - leaving the caller's live tree, with\n       any already-armed handler in it, un-neutralized. The cached getter\n       returns the real Document regardless of the clobber. */\n    const doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;\n    return createNodeIterator.call(\n      doc || root,\n      root,\n      // eslint-disable-next-line no-bitwise\n      NodeFilter.SHOW_ELEMENT |\n        NodeFilter.SHOW_COMMENT |\n        NodeFilter.SHOW_TEXT |\n        NodeFilter.SHOW_PROCESSING_INSTRUCTION |\n        NodeFilter.SHOW_CDATA_SECTION,\n      null\n    );\n  };\n\n  /**\n   * Replace template expression syntax (mustache, ERB, template\n   * literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub\n   * sites. Order matters: mustache, then ERB, then template literal.\n   *\n   * @param value the string to scrub\n   * @returns the scrubbed string\n   */\n  const _stripTemplateExpressions = function (value: string): string {\n    value = stringReplace(value, MUSTACHE_EXPR, ' ');\n    value = stringReplace(value, ERB_EXPR, ' ');\n    value = stringReplace(value, TMPLIT_EXPR, ' ');\n    return value;\n  };\n\n  /**\n   * Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the\n   * character data of an element subtree. Used as the final safety net for\n   * SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions\n   * which only form after text-node normalization (e.g. fragments split across\n   * stripped elements) cannot survive into a template-evaluating framework.\n   *\n   * Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`\n   * in place rather than round-tripping through innerHTML. This preserves\n   * descendant node references (important for IN_PLACE callers), avoids a\n   * serialize/reparse cycle, and reads literal character data \u2014 which means\n   * `<%...%>` in text content matches the ERB regex against its real bytes\n   * instead of the HTML-entity-escaped form innerHTML would produce.\n   *\n   * Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for\n   * attributes is performed during the per-node `_sanitizeAttributes` pass.\n   *\n   * @param node The root element whose character data should be scrubbed.\n   */\n  const _scrubTemplateExpressions = function (node: Element): void {\n    node.normalize();\n    /* Clobber-safe ownerDocument read, same reasoning as _createNodeIterator:\n       under SAFE_FOR_TEMPLATES this runs on the live IN_PLACE root, which may\n       carry a form-named-getter override of ownerDocument. */\n    const doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;\n    const walker = createNodeIterator.call(\n      doc || node,\n      node,\n      // eslint-disable-next-line no-bitwise\n      NodeFilter.SHOW_TEXT |\n        NodeFilter.SHOW_COMMENT |\n        NodeFilter.SHOW_CDATA_SECTION |\n        NodeFilter.SHOW_PROCESSING_INSTRUCTION,\n      null\n    );\n\n    let currentNode = walker.nextNode() as CharacterData | null;\n    while (currentNode) {\n      currentNode.data = _stripTemplateExpressions(currentNode.data);\n      currentNode = walker.nextNode() as CharacterData | null;\n    }\n\n    // NodeIterator does not descend into <template>.content per the DOM spec,\n    // so we must explicitly recurse into each template's content fragment,\n    // mirroring the approach used by _sanitizeShadowDOM.\n    const templates = node.querySelectorAll?.('template');\n    if (templates) {\n      arrayForEach(templates, (tmpl: HTMLTemplateElement) => {\n        if (_isDocumentFragment(tmpl.content)) {\n          _scrubTemplateExpressions(tmpl.content as unknown as Element);\n        }\n      });\n    }\n  };\n\n  /**\n   * _isClobbered\n   *\n   * Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML\n   * interface with [LegacyOverrideBuiltIns]; a descendant element with a\n   * `name` attribute matching a prototype property shadows that property\n   * on direct reads. We use this check at the IN_PLACE entry-point and\n   * during attribute sanitization to refuse clobbered forms.\n   *\n   * @param element element to check for clobbering attacks\n   * @return true if clobbered, false if safe\n   */\n  const _isClobbered = function (element: Element): boolean {\n    // Realm-independent tag-name probe. If we can't determine the tag\n    // name at all, we can't reason about clobbering \u2014 return false\n    // (the caller's other defences still apply).\n    const realTagName = getNodeName ? getNodeName(element) : null;\n    if (typeof realTagName !== 'string') {\n      return false;\n    }\n\n    if (transformCaseFunc(realTagName) !== 'form') {\n      return false;\n    }\n\n    return (\n      typeof element.nodeName !== 'string' ||\n      typeof element.textContent !== 'string' ||\n      typeof element.removeChild !== 'function' ||\n      // Realm-safe NamedNodeMap detection: equality against the cached\n      // prototype getter. Clobbered .attributes (e.g. <input name=\"attributes\">)\n      // makes the direct read diverge from the cached read; a clean form\n      // (same-realm OR foreign-realm) has both reads pointing at the same\n      // canonical NamedNodeMap.\n      element.attributes !== getAttributes(element) ||\n      typeof element.removeAttribute !== 'function' ||\n      typeof element.setAttribute !== 'function' ||\n      typeof element.namespaceURI !== 'string' ||\n      typeof element.insertBefore !== 'function' ||\n      typeof element.hasChildNodes !== 'function' ||\n      // NodeType clobbering probe. Cached Node.prototype.nodeType getter\n      // returns the integer 1 for any Element regardless of realm; direct\n      // read on a clobbered form (e.g. <input name=\"nodeType\">) returns\n      // the named child element. Cheap addition \u2014 nodeType is read from\n      // an internal slot, no serialization cost \u2014 and removes a residual\n      // clobbering surface used by several mXSS / PI / comment branches\n      // in _sanitizeElements that compare currentNode.nodeType directly.\n      element.nodeType !== getNodeType(element) ||\n      // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named\n      // \"childNodes\" shadows the prototype getter. Direct reads of\n      // form.childNodes from a clobbered form return the named child\n      // instead of the real NodeList, so any walk that reads it directly\n      // skips the form's real children. Compare the direct read to the\n      // cached Node.prototype getter \u2014 when the form's named-property\n      // getter intercepts the read, the two values differ and we flag\n      // the form. This catches every clobbering child type (input,\n      // select, etc.) regardless of whether the named child happens to\n      // carry a numeric .length, which a typeof-based probe would miss\n      // (e.g. HTMLSelectElement.length is a defined unsigned-long).\n      element.childNodes !== getChildNodes(element)\n    );\n  };\n\n  /**\n   * Checks whether the given value is a DocumentFragment from any realm.\n   *\n   * The realm-independent replacement reads `nodeType` through the cached\n   * Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE\n   * constant (11). nodeType is a numeric value resolved from the node's\n   * internal slot, identical across realms for the same kind of node.\n   *\n   * @param value object to check\n   * @return true if value is a DocumentFragment-shaped node from any realm\n   */\n  const _isDocumentFragment = function (value: unknown): boolean {\n    if (!getNodeType || typeof value !== 'object' || value === null) {\n      return false;\n    }\n\n    try {\n      return getNodeType(value as Node) === NODE_TYPE.documentFragment;\n    } catch (_) {\n      return false;\n    }\n  };\n\n  /**\n   * Checks whether the given object is a DOM node, including nodes that\n   * originate from a different window/realm (e.g. an iframe's\n   * contentDocument). The previous `value instanceof Node` check was\n   * realm-bound: nodes from a different window failed it, causing\n   * sanitize() to silently stringify them and reset IN_PLACE to false,\n   * returning the original node unsanitized. See GHSA-4w3q-35jp-p934.\n   *\n   * @param value object to check whether it's a DOM node\n   * @return true if value is a DOM node from any realm\n   */\n  const _isNode = function (value: unknown): value is Node {\n    if (!getNodeType || typeof value !== 'object' || value === null) {\n      return false;\n    }\n\n    try {\n      return typeof getNodeType(value) === 'number';\n    } catch (_) {\n      return false;\n    }\n  };\n\n  function _executeHooks<T extends HookFunction>(\n    hooks: HookFunction[],\n    currentNode: Parameters<T>[0],\n    data: Parameters<T>[1]\n  ): void {\n    if (hooks.length === 0) {\n      return;\n    }\n\n    arrayForEach(hooks, (hook: T) => {\n      hook.call(DOMPurify, currentNode, data, CONFIG);\n    });\n  }\n\n  /**\n   * Structural-threat checks that condemn a node regardless of the\n   * allowlists: mXSS via namespace confusion, risky CSS construction,\n   * processing instructions, markup-bearing comments. Pure predicate;\n   * the caller removes. Check order is load-bearing.\n   *\n   * @param currentNode the node to inspect\n   * @param tagName the node's transformCaseFunc'd tag name\n   * @return true if the node must be removed\n   */\n  const _isUnsafeNode = function (currentNode: any, tagName: string): boolean {\n    /* Detect mXSS attempts abusing namespace confusion */\n    if (\n      SAFE_FOR_XML &&\n      currentNode.hasChildNodes() &&\n      !_isNode(currentNode.firstElementChild) &&\n      regExpTest(EXPRESSIONS.ELEMENT_MARKUP_PROBE, currentNode.textContent) &&\n      regExpTest(EXPRESSIONS.ELEMENT_MARKUP_PROBE, currentNode.innerHTML)\n    ) {\n      return true;\n    }\n\n    /* Remove rawtext/literal-text elements whose literal serialization\n       re-opens markup on an HTML reparse - shapes (a) and (b) documented at\n       LITERAL_TEXT_ELEMENTS. Both are invisible to rule 1 above (which\n       self-disables once there is an element child, and whose second probe\n       reads the innerHTML an XML/XHTML document serializes escaped), which\n       is why both probes here read textContent instead. Previously only\n       `style`-with-element-child was covered; every element in\n       LITERAL_TEXT_ELEMENTS shares this literal serialization and is\n       equally affected. */\n    if (\n      SAFE_FOR_XML &&\n      currentNode.namespaceURI === HTML_NAMESPACE &&\n      LITERAL_TEXT_ELEMENTS[tagName] &&\n      (_isNode(currentNode.firstElementChild) ||\n        (typeof currentNode.textContent === 'string' &&\n          regExpTest(LITERAL_TEXT_CLOSE[tagName], currentNode.textContent)))\n    ) {\n      return true;\n    }\n\n    /* Remove any occurrence of processing instructions */\n    if (currentNode.nodeType === NODE_TYPE.processingInstruction) {\n      return true;\n    }\n\n    /* Remove any kind of possibly harmful comments */\n    if (\n      SAFE_FOR_XML &&\n      currentNode.nodeType === NODE_TYPE.comment &&\n      regExpTest(EXPRESSIONS.COMMENT_MARKUP_PROBE, currentNode.data)\n    ) {\n      return true;\n    }\n\n    return false;\n  };\n\n  /**\n   * Evaluate a CUSTOM_ELEMENT_HANDLING check (a RegExp or a predicate\n   * function, per the validation in _parseConfig) against a name.\n   * Additional arguments are forwarded to predicate functions - the\n   * attributeNameCheck predicate receives the tag name as its second\n   * argument. A null/absent check never matches.\n   *\n   * @param check the configured tagNameCheck / attributeNameCheck value\n   * @param name the name to test\n   * @param args extra arguments forwarded to a predicate function\n   * @return true if the check matches the name\n   */\n  const _matchesNameCheck = function (\n    check: unknown,\n    name: string,\n    ...args: unknown[]\n  ): boolean {\n    if (check instanceof RegExp) {\n      return regExpTest(check, name);\n    }\n\n    if (check instanceof Function) {\n      return Boolean(check(name, ...args));\n    }\n\n    return false;\n  };\n\n  /**\n   * Handle a node whose tag is forbidden or not allowlisted: keep\n   * allowed custom elements (false return exits _sanitizeElements\n   * early - the namespace and fallback-tag removal checks are\n   * intentionally skipped for kept custom elements), else hoist\n   * content per KEEP_CONTENT and remove.\n   *\n   * A kept custom element is the ONLY case in which this function\n   * returns false, so the caller uses that return value to run the\n   * afterSanitizeElements hook on the kept element and keep the\n   * element-hook lifecycle consistent with normal allowlisted\n   * elements (GHSA-c2j3-45gr-mqc4).\n   *\n   * @param currentNode the disallowed node\n   * @param tagName the node's transformCaseFunc'd tag name\n   * @return true if the node was removed, false if kept\n   */\n  const _sanitizeDisallowedNode = function (\n    currentNode: any,\n    tagName: string,\n    root: Node\n  ): boolean {\n    /* Check if we have a custom element to handle */\n    if (\n      !FORBID_TAGS[tagName] &&\n      _isBasicCustomElement(tagName) &&\n      _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)\n    ) {\n      return false;\n    }\n\n    /* Keep content except for bad-listed elements.\n         Use the cached prototype getters exclusively \u2014 the previous code\n         had `|| currentNode.parentNode` / `|| currentNode.childNodes`\n         fallbacks, but the cached getters always return the canonical\n         value (or null for a real parent-less node), so the fallback\n         path was dead in safe cases and a clobbering surface in unsafe\n         ones. Falsy cached results stay falsy; the `if (childNodes &&\n         parentNode)` check already gates correctly. */\n    if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n      const parentNode = getParentNode(currentNode);\n      const childNodes = getChildNodes(currentNode);\n\n      if (childNodes && parentNode) {\n        const childCount = childNodes.length;\n\n        /* Hoist by moving each child up one level rather than deep-cloning\n             it. Moving transfers every descendant exactly once, so a chain of\n             nested disallowed elements costs O(n) instead of the O(n^2) that\n             re-cloning the shrinking subtree at each level produced; it also\n             empties the removed original, so `DOMPurify.removed` no longer\n             pins whole subtrees. Moving preserves the in-place guarantee too:\n             an original carrying already-queued resource events (`<img\n             onerror>`, `<video>`/`<audio>` error, lazy/`onload`, \u2026) is\n             relocated and sanitised rather than left detached but still armed.\n\n             The sole case that must clone is removing the walk root itself.\n             The result is serialised from the root's subtree, so a restrictive\n             ALLOWED_TAGS that strips the root (`body` on the string path) must\n             leave the content inside it, which only cloning does. In IN_PLACE\n             the root is pre-validated as an allowed tag and so is never removed\n             here, so that path always takes the move branch.\n\n             `childNodes` is live; a tail-to-head walk keeps `childNodes[i]`\n             valid whether we move (drops the trailing entry) or clone (leaves\n             the list intact). */\n        for (let i = childCount - 1; i >= 0; --i) {\n          const hoisted =\n            currentNode === root\n              ? cloneNode(childNodes[i], true)\n              : childNodes[i];\n          parentNode.insertBefore(hoisted, getNextSibling(currentNode));\n        }\n      }\n    }\n\n    _forceRemove(currentNode);\n    return true;\n  };\n\n  /**\n   * Fork a hook-mutable allowlist off its shared binding the first time a\n   * (possibly lazily-installed) uponSanitize* hook is about to see it, so the\n   * hook cannot widen the per-instance default or the setConfig binding by\n   * reference and leak past the call. Returns the set unchanged once it is\n   * already call-local, so repeated calls across elements are idempotent.\n   *\n   * @param hookList the uponSanitize* hook array for this event\n   * @param set the current ALLOWED_TAGS / ALLOWED_ATTR binding\n   * @param defaultSet the per-instance DEFAULT_ALLOWED_* constant\n   * @param setConfigSet the captured setConfig() binding, or null\n   * @return a call-local clone if a hook is present and set is still shared,\n   *   else set unchanged\n   */\n  const _forkSharedAllowlist = function <T extends Record<string, any>>(\n    hookList: unknown[],\n    set: T,\n    defaultSet: T,\n    setConfigSet: T | null\n  ): T {\n    if (hookList.length === 0) {\n      return set;\n    }\n\n    return set === defaultSet || set === setConfigSet ? clone(set) : set;\n  };\n\n  /**\n   * Shared guard for a node that a hook has detached from the walk tree,\n   * used after each element-hook site in _sanitizeElements. Detaching is a\n   * long-standing user pattern (issue #469; draw.io-style foreignObject\n   * filtering). Per the cached, unclobberable parentNode getter the node is\n   * genuinely out of the tree, so it can reach neither the serialized\n   * output nor an IN_PLACE live tree; treat it as removed and stop\n   * processing it. Without this guard, the unsafe-node / namespace checks\n   * would call _forceRemove on a parentless node and hit the REPORT-3\n   * fail-closed throw \u2014 which exists for nodes DOMPurify wants gone but\n   * *cannot* detach (clobbered / parentless roots), the opposite of a node\n   * that is already safely gone. The walk root is exempt: a detached\n   * IN_PLACE root is legitimate input and must still be fully sanitized,\n   * and a kill-decision on it must keep hitting the REPORT-3 throw.\n   *\n   * Nodes detached by hooks stay the hook's responsibility for placement:\n   * they are not recorded in DOMPurify.removed, so the post-walk IN_PLACE\n   * pass (which iterates DOMPurify.removed) does not reach them. But a\n   * hook-detached subtree can still hold a queued resource-event handler -\n   * e.g. an <img onload> that began loading when the caller built the live\n   * tree - which fires in page scope after sanitize returns even though the\n   * handler never reached the returned tree. That is the audit-5 F1 hazard,\n   * and the documented node.remove() hook pattern walks straight into it.\n   * So on the IN_PLACE path we neutralize the detached subtree inline,\n   * stripping its non-allow-listed attributes before returning, exactly as\n   * the post-walk pass does for _forceRemove'd subtrees.\n   *\n   * @param currentNode the node a hook may have detached\n   * @param root the current walk root\n   * @return true if the node is detached and now handled, false otherwise\n   */\n  const _handleHookDetachedNode = function (\n    currentNode: Node,\n    root: Node\n  ): boolean {\n    if (currentNode === root || getParentNode(currentNode) !== null) {\n      return false;\n    }\n\n    if (IN_PLACE) {\n      _neutralizeSubtree(currentNode);\n    }\n\n    return true;\n  };\n\n  /**\n   * _sanitizeElements\n   *\n   * @protect nodeName\n   * @protect textContent\n   * @protect removeChild\n   * @param currentNode to check for permission to exist\n   * @return true if node was killed, false if left alive\n   */\n  const _sanitizeElements = function (currentNode: any, root: Node): boolean {\n    /* Execute a hook if present */\n    _executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n\n    /* A hook may have detached the node - treat it as removed (see\n       _handleHookDetachedNode for the full rationale). */\n    if (_handleHookDetachedNode(currentNode, root)) {\n      return true;\n    }\n\n    /* Check if element is clobbered or can clobber */\n    if (_isClobbered(currentNode)) {\n      _forceRemove(currentNode);\n      return true;\n    }\n\n    /* Now let's check the element's type and name */\n    const tagName = transformCaseFunc(_readNodeName(currentNode));\n\n    /* Close the pre-walk clone-guard's timing gap: an uponSanitizeElement\n       hook may have been installed after that guard sampled the hook arrays\n       (e.g. lazily from beforeSanitizeElements), leaving ALLOWED_TAGS still\n       aliasing a shared binding that a widening hook would mutate by\n       reference. Fork it before exposing it to the hook. */\n    ALLOWED_TAGS = _forkSharedAllowlist(\n      hooks.uponSanitizeElement,\n      ALLOWED_TAGS,\n      DEFAULT_ALLOWED_TAGS,\n      SET_CONFIG_ALLOWED_TAGS\n    );\n\n    /* Execute a hook if present */\n    _executeHooks(hooks.uponSanitizeElement, currentNode, {\n      tagName,\n      allowedTags: ALLOWED_TAGS,\n    });\n\n    /* The uponSanitizeElement hook may have detached the node, exactly as\n       above (see _handleHookDetachedNode for the full rationale). */\n    if (_handleHookDetachedNode(currentNode, root)) {\n      return true;\n    }\n\n    /* Remove mXSS vectors, processing instructions and risky comments */\n    if (_isUnsafeNode(currentNode, tagName)) {\n      _forceRemove(currentNode);\n      return true;\n    }\n\n    /* Remove element if anything forbids its presence */\n    if (\n      FORBID_TAGS[tagName] ||\n      (!(\n        EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function &&\n        EXTRA_ELEMENT_HANDLING.tagCheck(tagName)\n      ) &&\n        !ALLOWED_TAGS[tagName])\n    ) {\n      const removed = _sanitizeDisallowedNode(currentNode, tagName, root);\n\n      /* A false return means the node is a custom element kept via\n         CUSTOM_ELEMENT_HANDLING - the only keep path through\n         _sanitizeDisallowedNode. Run afterSanitizeElements on it so the\n         element-hook lifecycle matches normal allowlisted elements: a\n         security policy applied in this hook (e.g. stripping an attribute\n         from every surviving element) must not silently skip kept custom\n         elements (GHSA-c2j3-45gr-mqc4). This mirrors the normal-element\n         tail below - the hook runs, then the walker's subsequent\n         _sanitizeAttributes pass sanitizes the element's attributes. The\n         deliberately skipped namespace and fallback-tag removal checks stay\n         skipped; they are removal decisions, not the hook contract. */\n      if (removed === false) {\n        _executeHooks(hooks.afterSanitizeElements, currentNode, null);\n      }\n\n      return removed;\n    }\n\n    /* Check whether element has a valid namespace.\n       Realm-safe check (GHSA-hpcv-96wg-7vj8): use the cached Node.prototype\n       nodeType getter rather than `instanceof Element`, which is realm-\n       bound and short-circuits to false for any node minted in a different\n       realm \u2014 letting a foreign-realm element with a forbidden namespace\n       slip past the namespace check entirely. */\n    const nt = _readNodeType(currentNode);\n    if (nt === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {\n      _forceRemove(currentNode);\n      return true;\n    }\n\n    /* Make sure that older browsers don't get fallback-tag mXSS */\n    if (\n      (tagName === 'noscript' ||\n        tagName === 'noembed' ||\n        tagName === 'noframes') &&\n      regExpTest(EXPRESSIONS.FALLBACK_TAG_CLOSE, currentNode.innerHTML)\n    ) {\n      _forceRemove(currentNode);\n      return true;\n    }\n\n    /* Sanitize element content to be template-safe */\n    if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n      /* Get the element's text content */\n      const content = _stripTemplateExpressions(currentNode.textContent);\n\n      if (currentNode.textContent !== content) {\n        arrayPush(DOMPurify.removed, { element: currentNode.cloneNode() });\n        currentNode.textContent = content;\n      }\n    }\n\n    /* Execute a hook if present */\n    _executeHooks(hooks.afterSanitizeElements, currentNode, null);\n\n    return false;\n  };\n\n  /**\n   * _isValidAttribute\n   *\n   * @param lcTag Lowercase tag name of containing element.\n   * @param lcName Lowercase attribute name.\n   * @param value Attribute value.\n   * @return Returns true if `value` is valid, otherwise false.\n   */\n  // eslint-disable-next-line complexity\n  const _isValidAttribute = function (\n    lcTag: string,\n    lcName: string,\n    value: string\n  ): boolean {\n    /* FORBID_ATTR must always win, even if ADD_ATTR predicate would allow it */\n    if (FORBID_ATTR[lcName]) {\n      return false;\n    }\n\n    /* Reject declarative-partial-updates patch-linkage attributes\n       (https://github.com/WICG/declarative-partial-updates).\n\n       Empirical note (Chrome 150, verified \u2014 see\n       test/declarative-patch-probe-v3.html): expansion is NOT applied after\n       sanitization. For the string path it fires during sanitize()'s own\n       parse, so the walk sees and sanitizes the fully materialized expanded\n       tree \u2014 teleports into MathML/SVG integration points included; a\n       weaponized `<template for>`->`<img onerror>` comes back with the handler\n       stripped. For the IN_PLACE path it fires on connection, before the walk.\n       Either way DOMPurify is NOT blind to the patch.\n\n       This removal is therefore defense-in-depth rather than the sole barrier:\n       it prevents live linkage from surviving into the OUTPUT and re-expanding\n       in the caller's context, and keeps behaviour deterministic if a future\n       engine defers expansion. `for` is legitimate only on <label>/<output>;\n       anywhere else (notably <template for>) it links the element to a patch\n       target and teleports or removes an arbitrary DOM range by id/marker name.\n       `patchsrc` fetches remote markup and is treated as a script-loading\n       mechanism (CSP). Gated on SAFE_FOR_XML so the removal groups with the\n       other structural-threat checks and stays overridable, consistent with\n       the rest of the codebase. PI range markers are already removed by\n       _isUnsafeNode. */\n    if (_isPatchLinkageAttribute(lcName, lcTag)) {\n      return false;\n    }\n\n    /* Make sure attribute cannot clobber */\n    if (\n      SANITIZE_DOM &&\n      (lcName === 'id' || lcName === 'name') &&\n      (value in document || value in formElement)\n    ) {\n      return false;\n    }\n\n    const nameIsPermitted =\n      ALLOWED_ATTR[lcName] ||\n      (EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function &&\n        EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag));\n\n    /* Allow valid data-* attributes: At least one character after \"-\"\n        (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n        XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n        We don't need to check the value; it's always URI safe. */\n    if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR, lcName)) {\n      return true;\n    }\n\n    /* Allow valid aria-* attributes, the value is always URI safe */\n    if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) {\n      return true;\n    }\n\n    /* A name outside the allowlist is acceptable on custom-element terms\n       only. The value checks below are intentionally skipped in that case:\n       if the user supplied a tagNameCheck we also allow derived custom\n       elements using the same test, and attributes passing the configured\n       attributeNameCheck are allowed as custom elements define these at\n       their own discretion. */\n    if (!nameIsPermitted) {\n      return (\n        // Condition a) covers a basically valid custom element tag name whose\n        // tag passes the configured tagNameCheck and whose attribute name\n        // passes the configured attributeNameCheck ...\n        (_isBasicCustomElement(lcTag) &&\n          _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) &&\n          _matchesNameCheck(\n            CUSTOM_ELEMENT_HANDLING.attributeNameCheck,\n            lcName,\n            lcTag\n          )) ||\n        // Condition b) covers an `is` attribute whose value passes the\n        // configured tagNameCheck while customized built-in elements are\n        // allowed.\n        (lcName === 'is' &&\n          CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements &&\n          _matchesNameCheck(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value))\n      );\n    }\n\n    /* Check value is safe. First, is attr inert? If so, is safe */\n    if (URI_SAFE_ATTRIBUTES[lcName]) {\n      return true;\n    }\n\n    /* Check no script, data or unknown possibly unsafe URI\n        unless we know URI values are safe for that attribute */\n    if (regExpTest(IS_ALLOWED_URI, stringReplace(value, ATTR_WHITESPACE, ''))) {\n      return true;\n    }\n\n    /* Keep image data URIs alive if src/xlink:href is allowed */\n    /* Further prevent gadget XSS for dynamically built script tags */\n    if (\n      (lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') &&\n      lcTag !== 'script' &&\n      stringIndexOf(value, 'data:') === 0 &&\n      DATA_URI_TAGS[lcTag]\n    ) {\n      return true;\n    }\n\n    /* Allow unknown protocols: This provides support for links that\n        are handled by protocol handlers which may be unknown ahead of\n        time, e.g. fb:, spotify: */\n    if (\n      ALLOW_UNKNOWN_PROTOCOLS &&\n      !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))\n    ) {\n      return true;\n    }\n\n    /* Only an empty (binary) value remains safe at this point;\n       anything else is presumed unsafe, do not add it back */\n    return !value;\n  };\n\n  /* Names the HTML spec reserves from valid-custom-element-name; these must\n   * never be treated as basic custom elements even when a permissive\n   * CUSTOM_ELEMENT_HANDLING.tagNameCheck is configured. */\n  const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, [\n    'annotation-xml',\n    'color-profile',\n    'font-face',\n    'font-face-format',\n    'font-face-name',\n    'font-face-src',\n    'font-face-uri',\n    'missing-glyph',\n  ]);\n\n  /**\n   * _isBasicCustomElement\n   * checks if at least one dash is included in tagName, and it's not the first char\n   * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n   *\n   * @param tagName name of the tag of the node to sanitize\n   * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n   */\n  const _isBasicCustomElement = function (tagName: string): boolean {\n    return (\n      !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] &&\n      regExpTest(CUSTOM_ELEMENT, tagName)\n    );\n  };\n\n  /**\n   * Wrap an attribute value in the matching Trusted Types object when\n   * the active policy requires it. Namespaced attributes pass through\n   * unchanged (no TT support yet, see\n   * https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).\n   *\n   * @param lcTag lowercase tag name of the containing element\n   * @param lcName lowercase attribute name\n   * @param namespaceURI the attribute's namespace, if any\n   * @param value the attribute value to wrap\n   * @return the value, wrapped when Trusted Types demand it\n   */\n  const _applyTrustedTypesToAttribute = function (\n    lcTag: string,\n    lcName: string,\n    namespaceURI: string | null,\n    value: string\n  ): string {\n    if (\n      trustedTypesPolicy &&\n      typeof trustedTypes === 'object' &&\n      typeof trustedTypes.getAttributeType === 'function' &&\n      !namespaceURI\n    ) {\n      switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n        case 'TrustedHTML': {\n          return _createTrustedHTML(value);\n        }\n\n        case 'TrustedScriptURL': {\n          return _createTrustedScriptURL(value);\n        }\n\n        default: {\n          break;\n        }\n      }\n    }\n\n    return value;\n  };\n\n  /**\n   * Write a modified attribute value back onto the element. On\n   * success, re-probe for clobbering introduced by the new value and\n   * remove the element when found; otherwise pop the removal entry\n   * recorded by the earlier _removeAttribute (long-standing pairing\n   * with the SANITIZE_NAMED_PROPS path - do not \"fix\" casually). On\n   * failure, remove the attribute instead.\n   *\n   * @param currentNode the element carrying the attribute\n   * @param name the attribute name as present on the element\n   * @param namespaceURI the attribute's namespace, if any\n   * @param value the new attribute value\n   */\n  const _setAttributeValue = function (\n    currentNode: Element,\n    name: string,\n    namespaceURI: string | null,\n    value: string\n  ): void {\n    try {\n      if (namespaceURI) {\n        currentNode.setAttributeNS(namespaceURI, name, value);\n      } else {\n        /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n        currentNode.setAttribute(name, value);\n      }\n\n      if (_isClobbered(currentNode)) {\n        _forceRemove(currentNode);\n      } else {\n        arrayPop(DOMPurify.removed);\n      }\n    } catch (_) {\n      _removeAttribute(name, currentNode);\n    }\n  };\n\n  /**\n   * _sanitizeAttributes\n   *\n   * @protect attributes\n   * @protect nodeName\n   * @protect removeAttribute\n   * @protect setAttribute\n   *\n   * @param currentNode to sanitize\n   */\n  const _sanitizeAttributes = function (currentNode: Element): void {\n    /* Execute a hook if present */\n    _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n\n    const { attributes } = currentNode;\n\n    /* Check if we have attributes; if not we might have a text node */\n    if (!attributes || _isClobbered(currentNode)) {\n      return;\n    }\n\n    /* Same lazy-install guard as uponSanitizeElement (see there): fork the\n       attribute allowlist off its shared binding before a hook can see it. */\n    ALLOWED_ATTR = _forkSharedAllowlist(\n      hooks.uponSanitizeAttribute,\n      ALLOWED_ATTR,\n      DEFAULT_ALLOWED_ATTR,\n      SET_CONFIG_ALLOWED_ATTR\n    );\n\n    const hookEvent = {\n      attrName: '',\n      attrValue: '',\n      keepAttr: true,\n      allowedAttributes: ALLOWED_ATTR,\n      forceKeepAttr: undefined,\n    };\n    let l = attributes.length;\n    const lcTag = transformCaseFunc(currentNode.nodeName);\n\n    /* Go backwards over all attributes; safely remove bad ones */\n    while (l--) {\n      const attr = attributes[l];\n      const { name, namespaceURI, value: attrValue } = attr;\n      const lcName = transformCaseFunc(name);\n\n      const initValue = attrValue;\n      let value = name === 'value' ? initValue : stringTrim(initValue);\n\n      /* Execute a hook if present */\n      hookEvent.attrName = lcName;\n      hookEvent.attrValue = value;\n      hookEvent.keepAttr = true;\n      hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n      _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n      value = hookEvent.attrValue;\n\n      /* Full DOM Clobbering protection via namespace isolation,\n       * Prefix id and name attributes with `user-content-`\n       */\n      if (\n        SANITIZE_NAMED_PROPS &&\n        (lcName === 'id' || lcName === 'name') &&\n        stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0\n      ) {\n        // Remove the attribute with this value\n        _removeAttribute(name, currentNode, attr);\n        // Prefix the value and later re-create the attribute with the sanitized value\n        value = SANITIZE_NAMED_PROPS_PREFIX + value;\n      }\n      // Else: already prefixed, leave the attribute alone \u2014 the prefix is\n      // itself the clobbering protection, and re-applying it is incorrect.\n\n      /* Work around a security issue with comments inside attributes */\n      if (\n        SAFE_FOR_XML &&\n        regExpTest(\n          /((--!?|])>)|<\\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,\n          value\n        )\n      ) {\n        _removeAttribute(name, currentNode, attr);\n        continue;\n      }\n\n      /* Make sure we cannot easily use animated hrefs, even if animations are allowed */\n      if (lcName === 'attributename' && stringMatch(value, 'href')) {\n        _removeAttribute(name, currentNode, attr);\n        continue;\n      }\n\n      /* Did the hooks force-keep the attribute? */\n      if (hookEvent.forceKeepAttr) {\n        continue;\n      }\n\n      /* Did the hooks approve of the attribute? */\n      if (!hookEvent.keepAttr) {\n        _removeAttribute(name, currentNode, attr);\n        continue;\n      }\n\n      /* Work around a security issue in jQuery 3.0 */\n      if (\n        !ALLOW_SELF_CLOSE_IN_ATTR &&\n        regExpTest(EXPRESSIONS.SELF_CLOSING_TAG, value)\n      ) {\n        _removeAttribute(name, currentNode, attr);\n        continue;\n      }\n\n      /* Sanitize attribute content to be template-safe */\n      if (SAFE_FOR_TEMPLATES) {\n        value = _stripTemplateExpressions(value);\n      }\n\n      /* Is `value` valid for this attribute? */\n      if (!_isValidAttribute(lcTag, lcName, value)) {\n        _removeAttribute(name, currentNode, attr);\n        continue;\n      }\n\n      /* Handle attributes that require Trusted Types */\n      value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);\n\n      /* Handle invalid data-* attribute set by try-catching it */\n      if (value !== initValue) {\n        _setAttributeValue(currentNode, name, namespaceURI, value);\n      }\n    }\n\n    /* Execute a hook if present */\n    _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n  };\n\n  /**\n   * _sanitizeShadowDOM\n   *\n   * @param fragment to iterate over recursively\n   */\n  const _sanitizeShadowDOM = function (fragment: DocumentFragment): void {\n    let shadowNode = null;\n    const shadowIterator = _createNodeIterator(fragment);\n\n    /* Execute a hook if present */\n    _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n\n    while ((shadowNode = shadowIterator.nextNode())) {\n      /* Execute a hook if present */\n      _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n\n      /* Sanitize tags and elements */\n      _sanitizeElements(shadowNode, fragment);\n\n      /* Check attributes next */\n      _sanitizeAttributes(shadowNode);\n\n      /* Deep shadow DOM detected.\n         Realm-safe check (GHSA-hpcv-96wg-7vj8): use nodeType against the\n         DOCUMENT_FRAGMENT_NODE constant rather than instanceof, so we\n         recurse into <template>.content from foreign realms too. */\n      if (_isDocumentFragment(shadowNode.content)) {\n        _sanitizeShadowDOM(shadowNode.content);\n      }\n\n      /* An element iterated here may itself host an attached\n         shadow root. The default NodeIterator does not enter shadow\n         trees, so a shadow root nested inside template.content was\n         previously reached by no walk at all (the pre-pass at\n         _sanitizeAttachedShadowRoots descends via childNodes, which\n         doesn't enter template.content; the template-content recursion\n         above iterates the content but never inspected shadowRoot).\n         Walk it explicitly. The nodeType guard avoids reading\n         shadowRoot off text / comment / CDATA / PI nodes that the\n         iterator also surfaces. */\n      if (_readNodeType(shadowNode) === NODE_TYPE.element) {\n        const innerSr = getShadowRoot(shadowNode);\n        if (_isDocumentFragment(innerSr)) {\n          _sanitizeAttachedShadowRoots(innerSr);\n          _sanitizeShadowDOM(innerSr);\n        }\n      }\n    }\n\n    /* Execute a hook if present */\n    _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n  };\n\n  /**\n   * _sanitizeAttachedShadowRoots\n   *\n   * Walks `root` and feeds every attached shadow root we encounter into\n   * the existing _sanitizeShadowDOM pipeline. The default node iterator\n   * does not descend into shadow trees, so nodes inside an attached\n   * shadow root would otherwise be skipped entirely.\n   *\n   * Two real input paths put attached shadow roots in front of us:\n   *   1. IN_PLACE on a DOM node that already has shadow roots attached.\n   *   2. DOM-node input where importNode(dirty, true) deep-clones the\n   *      shadow root because it was created with `clonable: true`.\n   *\n   * This pass runs once, up front, so the main iteration loop (and the\n   * existing _sanitizeShadowDOM template-content recursion) stay\n   * untouched \u2014 string-input paths are not affected.\n   *\n   * @param root the subtree root to walk for attached shadow roots\n   */\n  const _sanitizeAttachedShadowRoots = function (root: Node): void {\n    /* Iterative (explicit stack) rather than per-child recursion. DOM APIs\n       impose no depth cap, so an attacker-shaped tree (JSON/CRDT/editor data\n       built straight into the DOM \u2014 the IN_PLACE surface) deeper than the JS\n       call-stack budget would otherwise overflow native recursion here and\n       throw at the IN_PLACE entry pre-pass, before a single node is\n       sanitized, leaving the caller's live tree untouched (fail-open). See\n       campaign-3 F4. A heap stack keeps depth off the call stack.\n\n       Each work item is either a node to descend into, or a deferred\n       `_sanitizeShadowDOM` for an already-walked shadow root. The deferred\n       form preserves the original post-order discipline: a shadow root's\n       nested shadow roots are discovered before the outer shadow is\n       sanitized (which may remove hosts). Pushes are in reverse of the\n       desired processing order (LIFO): template content, then children, then\n       the shadow-sanitize, then the shadow walk \u2014 so the order matches the\n       previous recursion exactly. */\n    const stack: Array<{ node: Node | null; shadow: DocumentFragment | null }> =\n      [{ node: root, shadow: null }];\n\n    while (stack.length > 0) {\n      const item = stack.pop();\n\n      /* Deferred shadow-DOM sanitisation: runs after its subtree was walked. */\n      if (item.shadow) {\n        _sanitizeShadowDOM(item.shadow);\n        continue;\n      }\n\n      const node = item.node;\n      const nodeType = _readNodeType(node);\n      const isElement = nodeType === NODE_TYPE.element;\n\n      /* (pushed last \u2192 processed first) Children, snapshotted in reverse so\n         the first child is processed first. Snapshotting matters because a\n         hook may detach siblings mid-walk. */\n      const childNodes = getChildNodes(node);\n      if (childNodes) {\n        for (let i = childNodes.length - 1; i >= 0; --i) {\n          stack.push({ node: childNodes[i], shadow: null });\n        }\n      }\n\n      /* (pushed before children \u2192 processed after them, matching the old\n         \"template content last\" order) When the node is a <template>,\n         descend into its content. */\n      if (isElement) {\n        const rootName = getNodeName ? getNodeName(node) : null;\n        if (\n          typeof rootName === 'string' &&\n          transformCaseFunc(rootName) === 'template'\n        ) {\n          const content = (node as HTMLTemplateElement).content;\n          if (_isDocumentFragment(content)) {\n            stack.push({ node: content, shadow: null });\n          }\n        }\n      }\n\n      /* Shadow root (processed first): walk its subtree, then sanitise it.\n         Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection\n         rather than `instanceof DocumentFragment`, which is realm-bound and\n         silently skipped foreign-realm shadow roots (e.g.\n         iframe.contentDocument attachShadow). */\n      if (isElement) {\n        const sr = getShadowRoot(node);\n        if (_isDocumentFragment(sr)) {\n          /* Push the deferred sanitise first so it pops after the shadow\n             walk we push next, i.e. nested shadow roots are discovered\n             before this one is sanitised. */\n          stack.push({ node: null, shadow: sr }, { node: sr, shadow: null });\n        }\n      }\n    }\n  };\n\n  // eslint-disable-next-line complexity\n  DOMPurify.sanitize = function (dirty, cfg = {}) {\n    let body = null;\n    let importedNode = null;\n    let currentNode = null;\n    let returnNode = null;\n    /* Make sure we have a string to sanitize.\n      DO NOT return early, as this will return the wrong type if\n      the user has requested a DOM object rather than a string */\n    IS_EMPTY_INPUT = !dirty;\n    if (IS_EMPTY_INPUT) {\n      dirty = '<!-->';\n    }\n\n    /* Stringify, in case dirty is an object */\n    if (typeof dirty !== 'string' && !_isNode(dirty)) {\n      dirty = stringifyValue(dirty);\n\n      if (typeof dirty !== 'string') {\n        throw typeErrorCreate('dirty is not a string, aborting');\n      }\n    }\n\n    /* Return dirty HTML if DOMPurify cannot run */\n    if (!DOMPurify.isSupported) {\n      return dirty;\n    }\n\n    /* Assign config vars */\n    if (SET_CONFIG) {\n      /* Persistent setConfig() path: _parseConfig is skipped, so the sets are\n       * not re-derived per call. Restore them from the pristine bindings\n       * captured at setConfig() time so a previous call's hook clone (mutated\n       * below) does not carry over. */\n      ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;\n      ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;\n    } else {\n      _parseConfig(cfg);\n    }\n\n    /* Clone the hook-mutable allowlists before the walk whenever an\n     * uponSanitize* hook is registered. The hook event exposes ALLOWED_TAGS\n     * and ALLOWED_ATTR by reference (as allowedTags / allowedAttributes), so\n     * a hook that widens them would otherwise mutate the shared set\n     * permanently: across later calls and across every element. Cloning per\n     * walk keeps documented in-call widening working while scoping it to the\n     * call. A single guard for both config paths - the per-call path rebinds\n     * the sets in _parseConfig each call, the persistent path restores them\n     * from the captured bindings just above - so the two cannot diverge. */\n    if (\n      hooks.uponSanitizeElement.length > 0 ||\n      hooks.uponSanitizeAttribute.length > 0\n    ) {\n      ALLOWED_TAGS = clone(ALLOWED_TAGS);\n    }\n\n    if (hooks.uponSanitizeAttribute.length > 0) {\n      ALLOWED_ATTR = clone(ALLOWED_ATTR);\n    }\n\n    /* Clean up removed elements */\n    DOMPurify.removed = [];\n\n    /* Resolve IN_PLACE for this call without mutating persistent config.\n       Writing the IN_PLACE closure variable here leaks under setConfig(),\n       where _parseConfig is skipped on later calls: a single string call would\n       disable in-place mode for every subsequent node call, returning a\n       sanitized copy while leaving the caller's node \u2014 which in-place callers\n       keep using and whose return value they ignore \u2014 unsanitized. REPORT-2. */\n    const inPlace = IN_PLACE && typeof dirty !== 'string' && _isNode(dirty);\n\n    if (inPlace) {\n      /* Declarative-partial-updates / streaming pre-pass: sever every patch\n         linkage across the live tree BEFORE the walk, so no patch can fire\n         mid-walk and inject into an already-processed region. Runs first, so\n         it also covers the forbidden/clobbered roots that throw below. */\n      _neutralizePatchLinkage(dirty as Node);\n\n      /* Do some early pre-sanitization to avoid unsafe root nodes.\n         Read nodeName through the cached prototype getter \u2014 a clobbering\n         child named \"nodeName\" on the form root would otherwise shadow\n         the property and let this check skip the root-allowlist\n         validation entirely. */\n      const nn = _readNodeName(dirty as Node);\n      if (typeof nn === 'string') {\n        const tagName = transformCaseFunc(nn);\n        if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n          /* Fail closed on a live root: neutralize handlers/children before\n             throwing, exactly as the mid-walk abort path does. */\n          _neutralizeRoot(dirty as Node);\n\n          throw typeErrorCreate(\n            'root node is forbidden and cannot be sanitized in-place'\n          );\n        }\n      }\n\n      /* Pre-flight the root through _isClobbered. The iterator-driven\n         removal path can not detach a parent-less root: _forceRemove\n         falls through to Element.prototype.remove(), which per spec\n         is a no-op on a node with no parent. A clobbered root would\n         then survive the main loop with its attributes uninspected,\n         because _sanitizeAttributes early-returns on _isClobbered. The\n         result would be an attacker-controlled form, complete with any\n         event-handler attributes the caller passed in, handed back to\n         the application unsanitized. Refuse to sanitize such a root\n         the same way we refuse a forbidden tag. GHSA-r47g-fvhr-h676. */\n      if (_isClobbered(dirty as Element)) {\n        /* Fail closed on a live clobbered root before throwing.\n           _neutralizeRoot's reads are clobber-safe (cached getters); the\n           form's non-clobbered descendants, e.g. an armed <img>, are scrubbed. */\n        _neutralizeRoot(dirty as Node);\n\n        throw typeErrorCreate(\n          'root node is clobbered and cannot be sanitized in-place'\n        );\n      }\n\n      /* Sanitize attached shadow roots before the main iterator runs.\n         The iterator does not descend into shadow trees. Same fail-closed\n         barrier as the main walk (campaign-3 F2): a custom-element reaction\n         inside a shadow root could abort this pre-pass before the walk runs,\n         which would otherwise leave the entire live tree unsanitized. */\n      try {\n        _sanitizeAttachedShadowRoots(dirty as Node);\n      } catch (error) {\n        _neutralizeRoot(dirty as Node);\n\n        throw error;\n      }\n    } else if (_isNode(dirty)) {\n      /* If dirty is a DOM element, append to an empty document to avoid\n         elements being stripped by the parser */\n      body = _initDocument('<!---->');\n      importedNode = body.ownerDocument.importNode(dirty, true);\n      if (\n        importedNode.nodeType === NODE_TYPE.element &&\n        importedNode.nodeName === 'BODY'\n      ) {\n        /* Node is already a body, use as is */\n        body = importedNode;\n      } else if (importedNode.nodeName === 'HTML') {\n        body = importedNode;\n      } else {\n        // eslint-disable-next-line unicorn/prefer-dom-node-append\n        body.appendChild(importedNode);\n      }\n\n      /* Clonable shadow roots are deep-cloned by importNode(); sanitize\n         them before the main iterator runs, since the iterator does not\n         descend into shadow trees. The walk routes every read through a\n         cached prototype getter so clobbering descendants on a form root\n         cannot hide a shadow host from this pass. */\n      _sanitizeAttachedShadowRoots(importedNode);\n    } else {\n      /* Exit directly if we have nothing to do */\n      if (\n        !RETURN_DOM &&\n        !SAFE_FOR_TEMPLATES &&\n        !WHOLE_DOCUMENT &&\n        // eslint-disable-next-line unicorn/prefer-includes\n        dirty.indexOf('<') === -1\n      ) {\n        return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n          ? _createTrustedHTML(dirty)\n          : dirty;\n      }\n\n      /* Initialize the document to work on */\n      body = _initDocument(dirty);\n\n      /* Check we have a DOM node from the data */\n      if (!body) {\n        return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n      }\n    }\n\n    /* Remove first element node (ours) if FORCE_BODY is set */\n    if (body && FORCE_BODY) {\n      _forceRemove(body.firstChild);\n    }\n\n    /* Get node iterator */\n    const walkRoot: Node = inPlace ? (dirty as Node) : body;\n\n    /* Now start iterating over the created document.\n       The walk runs inside an exception barrier (campaign-3 F2): a re-entrant\n       engine/custom-element mutation can detach a node mid-walk so\n       `_forceRemove`'s parentless guard throws, aborting the loop. Without the\n       barrier the caller's in-place tree would be left half-sanitized with the\n       unvisited tail still armed. _createNodeIterator itself is inside the\n       barrier too: constructing the iterator dereferences the root's document,\n       and any failure there (e.g. an exotic/clobbered root) must still fail\n       closed rather than skip the neutralize. On any throw we fail closed -\n       strip the in-place root bare - then rethrow so the existing throw\n       contract is preserved. (String/DOM-copy paths never return the partial\n       body, so the propagating throw is already fail-closed there.) */\n    try {\n      const nodeIterator = _createNodeIterator(walkRoot);\n      while ((currentNode = nodeIterator.nextNode())) {\n        /* Sanitize tags and elements */\n        _sanitizeElements(currentNode, walkRoot);\n\n        /* Check attributes next */\n        _sanitizeAttributes(currentNode);\n\n        /* Shadow DOM detected, sanitize it.\n           Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection\n           instead of instanceof, so foreign-realm <template>.content is\n           walked correctly. */\n        if (_isDocumentFragment(currentNode.content)) {\n          _sanitizeShadowDOM(currentNode.content);\n        }\n      }\n    } catch (error) {\n      if (inPlace) {\n        _neutralizeRoot(dirty as Node);\n        /* Nodes _forceRemove'd earlier in the aborted walk are already\n           detached from the root, so _neutralizeRoot's subtree pass does not\n           reach them. Defuse them too, mirroring the success-path loop below. */\n        arrayForEach(DOMPurify.removed, (entry) => {\n          if (entry.element) {\n            _neutralizeSubtree(entry.element as Node);\n          }\n        });\n      }\n\n      throw error;\n    }\n\n    /* If we sanitized `dirty` in-place, return it. */\n    if (inPlace) {\n      /* Fail-closed completion of the audit-5 F1 fix: every node removed from\n         the caller's live tree is detached but may still hold a queued\n         resource-event handler that fires in page scope after we return. The\n         move-hoist covers only disallowed-tag KEEP_CONTENT removals; strip the\n         non-allow-listed attributes off every other removed subtree (clobber,\n         mXSS, namespace, comments, KEEP_CONTENT:false, \u2026) so those handlers are\n         cancelled before any event can fire. Runs synchronously, pre-return. */\n      arrayForEach(DOMPurify.removed, (entry) => {\n        if (entry.element) {\n          _neutralizeSubtree(entry.element as Node);\n        }\n      });\n\n      if (SAFE_FOR_TEMPLATES) {\n        _scrubTemplateExpressions(dirty as Element);\n      }\n\n      return dirty;\n    }\n\n    /* Return sanitized string or DOM */\n    if (RETURN_DOM) {\n      if (SAFE_FOR_TEMPLATES) {\n        _scrubTemplateExpressions(body);\n      }\n\n      if (RETURN_DOM_FRAGMENT) {\n        returnNode = createDocumentFragment.call(body.ownerDocument);\n\n        while (body.firstChild) {\n          // eslint-disable-next-line unicorn/prefer-dom-node-append\n          returnNode.appendChild(body.firstChild);\n        }\n      } else {\n        returnNode = body;\n      }\n\n      if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n        /*\n          AdoptNode() is not used because internal state is not reset\n          (e.g. the past names map of a HTMLFormElement), this is safe\n          in theory but we would rather not risk another attack vector.\n          The state that is cloned by importNode() is explicitly defined\n          by the specs.\n        */\n        returnNode = importNode.call(originalDocument, returnNode, true);\n      }\n\n      return returnNode;\n    }\n\n    let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n    /* Serialize doctype if allowed */\n    if (\n      WHOLE_DOCUMENT &&\n      ALLOWED_TAGS['!doctype'] &&\n      body.ownerDocument &&\n      body.ownerDocument.doctype &&\n      body.ownerDocument.doctype.name &&\n      regExpTest(EXPRESSIONS.DOCTYPE_NAME, body.ownerDocument.doctype.name)\n    ) {\n      serializedHTML =\n        '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\\n' + serializedHTML;\n    }\n\n    /* Sanitize final string template-safe */\n    if (SAFE_FOR_TEMPLATES) {\n      serializedHTML = _stripTemplateExpressions(serializedHTML);\n    }\n\n    return trustedTypesPolicy && RETURN_TRUSTED_TYPE\n      ? _createTrustedHTML(serializedHTML)\n      : serializedHTML;\n  };\n\n  DOMPurify.setConfig = function (cfg = {}) {\n    _parseConfig(cfg);\n    SET_CONFIG = true;\n    SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;\n    SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;\n  };\n\n  DOMPurify.clearConfig = function () {\n    CONFIG = null;\n    SET_CONFIG = false;\n    SET_CONFIG_ALLOWED_TAGS = null;\n    SET_CONFIG_ALLOWED_ATTR = null;\n\n    // Drop any caller-supplied Trusted Types policy so it cannot poison later\n    // `RETURN_TRUSTED_TYPE` output. The internal default policy (cached, and\n    // never recreated \u2014 Trusted Types throws on duplicate names) is restored by\n    // the next `_parseConfig`. See GHSA-vxr8-fq34-vvx9.\n    trustedTypesPolicy = defaultTrustedTypesPolicy;\n    emptyHTML = '';\n  };\n\n  DOMPurify.isValidAttribute = function (tag, attr, value) {\n    /* Initialize shared config vars if necessary. */\n    if (!CONFIG) {\n      _parseConfig({});\n    }\n\n    const lcTag = transformCaseFunc(tag);\n    const lcName = transformCaseFunc(attr);\n    return _isValidAttribute(lcTag, lcName, value);\n  };\n\n  DOMPurify.addHook = function (\n    entryPoint: keyof HooksMap,\n    hookFunction: HookFunction\n  ) {\n    if (typeof hookFunction !== 'function') {\n      return;\n    }\n\n    /* Reject unknown entry points. Without this, a non-hook key (e.g.\n     * '__proto__') indexes off the prototype chain rather than a real\n     * hook array, and arrayPush then writes to Object.prototype. Guard\n     * with an own-property check against the known hook names. */\n    if (!objectHasOwnProperty(hooks, entryPoint)) {\n      return;\n    }\n\n    arrayPush(hooks[entryPoint], hookFunction);\n  };\n\n  DOMPurify.removeHook = function (\n    entryPoint: keyof HooksMap,\n    hookFunction: HookFunction\n  ) {\n    if (!objectHasOwnProperty(hooks, entryPoint)) {\n      return undefined;\n    }\n\n    if (hookFunction !== undefined) {\n      const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);\n\n      return index === -1\n        ? undefined\n        : arraySplice(hooks[entryPoint], index, 1)[0];\n    }\n\n    return arrayPop(hooks[entryPoint]);\n  };\n\n  DOMPurify.removeHooks = function (entryPoint: keyof HooksMap) {\n    if (!objectHasOwnProperty(hooks, entryPoint)) {\n      return;\n    }\n\n    hooks[entryPoint] = [];\n  };\n\n  DOMPurify.removeAllHooks = function () {\n    hooks = _createHooksMap();\n  };\n\n  return DOMPurify;\n}\n\nexport default createDOMPurify();\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { $isTextNode, $getEditor, $isRootNode, $getSelection, $isRangeSelection, $caretRangeFromSelection, $isTokenOrSegmented, $isElementNode, $getCharacterOffsets, $cloneWithPropertiesEphemeral, $getNodeByKey, $getPreviousSelection, $createTextNode, getStyleObjectFromCSS as getStyleObjectFromCSS$1, $createRangeSelection, $findMatchingParent, INTERNAL_$isBlock, $setSelection, $caretFromPoint, $isExtendableTextPointCaret, $extendCaretToRange, $isChildCaret, $isDecoratorNode, $isRootOrShadowRoot, $hasAncestor, $isLeafNode } from 'lexical';\nexport { $cloneWithProperties, $selectAll } from 'lexical';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n  throw new Error(message);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/*@__INLINE__*/\nfunction warnOnlyOnce(message) {\n  {\n    let run = false;\n    return () => {\n      if (!run) {\n        console.warn(message);\n      }\n      run = true;\n    };\n  }\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction getDOMTextNode(element) {\n  let node = element;\n  while (node != null) {\n    if (node.nodeType === Node.TEXT_NODE) {\n      return node;\n    }\n    node = node.firstChild;\n  }\n  return null;\n}\nfunction getDOMIndexWithinParent(node) {\n  const parent = node.parentNode;\n  if (parent == null) {\n    throw new Error('Should never happen');\n  }\n  return [parent, Array.from(parent.childNodes).indexOf(node)];\n}\n\n/**\n * Creates a selection range for the DOM.\n * @param editor - The lexical editor.\n * @param anchorNode - The anchor node of a selection.\n * @param _anchorOffset - The amount of space offset from the anchor to the focus.\n * @param focusNode - The current focus.\n * @param _focusOffset - The amount of space offset from the focus to the anchor.\n * @returns The range of selection for the DOM that was created.\n */\nfunction createDOMRange(editor, anchorNode, _anchorOffset, focusNode, _focusOffset) {\n  const anchorKey = anchorNode.getKey();\n  const focusKey = focusNode.getKey();\n  const range = document.createRange();\n  let anchorDOM = editor.getElementByKey(anchorKey);\n  let focusDOM = editor.getElementByKey(focusKey);\n  let anchorOffset = _anchorOffset;\n  let focusOffset = _focusOffset;\n  if ($isTextNode(anchorNode)) {\n    anchorDOM = getDOMTextNode(anchorDOM);\n  }\n  if ($isTextNode(focusNode)) {\n    focusDOM = getDOMTextNode(focusDOM);\n  }\n  if (anchorNode === undefined || focusNode === undefined || anchorDOM === null || focusDOM === null) {\n    return null;\n  }\n  if (anchorDOM.nodeName === 'BR') {\n    [anchorDOM, anchorOffset] = getDOMIndexWithinParent(anchorDOM);\n  }\n  if (focusDOM.nodeName === 'BR') {\n    [focusDOM, focusOffset] = getDOMIndexWithinParent(focusDOM);\n  }\n  const firstChild = anchorDOM.firstChild;\n  if (anchorDOM === focusDOM && firstChild != null && firstChild.nodeName === 'BR' && anchorOffset === 0 && focusOffset === 0) {\n    focusOffset = 1;\n  }\n  try {\n    range.setStart(anchorDOM, anchorOffset);\n    range.setEnd(focusDOM, focusOffset);\n  } catch (_e) {\n    return null;\n  }\n  if (range.collapsed && (anchorOffset !== focusOffset || anchorKey !== focusKey)) {\n    // Range is backwards, we need to reverse it\n    range.setStart(focusDOM, focusOffset);\n    range.setEnd(anchorDOM, anchorOffset);\n  }\n  return range;\n}\n\n/**\n * Creates DOMRects, generally used to help the editor find a specific location on the screen.\n * @param editor - The lexical editor\n * @param range - A fragment of a document that can contain nodes and parts of text nodes.\n * @returns The selectionRects as an array.\n */\nfunction createRectsFromDOMRange(editor, range) {\n  const rootElement = editor.getRootElement();\n  if (rootElement === null) {\n    return [];\n  }\n  const rootRect = rootElement.getBoundingClientRect();\n  const computedStyle = getComputedStyle(rootElement);\n  const rootPadding = parseFloat(computedStyle.paddingLeft) + parseFloat(computedStyle.paddingRight);\n  const selectionRects = Array.from(range.getClientRects());\n  let selectionRectsLength = selectionRects.length;\n  //sort rects from top left to bottom right.\n  selectionRects.sort((a, b) => {\n    const top = a.top - b.top;\n    // Some rects match position closely, but not perfectly,\n    // so we give a 3px tolerance.\n    if (Math.abs(top) <= 3) {\n      return a.left - b.left;\n    }\n    return top;\n  });\n  let prevRect;\n  for (let i = 0; i < selectionRectsLength; i++) {\n    const selectionRect = selectionRects[i];\n    // Exclude rects that overlap preceding Rects in the sorted list.\n    const isOverlappingRect = prevRect && prevRect.top <= selectionRect.top && prevRect.top + prevRect.height > selectionRect.top && prevRect.left + prevRect.width > selectionRect.left;\n    // Exclude selections that span the entire element\n    const selectionSpansElement = selectionRect.width + rootPadding === rootRect.width;\n    if (isOverlappingRect || selectionSpansElement) {\n      selectionRects.splice(i--, 1);\n      selectionRectsLength--;\n      continue;\n    }\n    prevRect = selectionRect;\n  }\n  return selectionRects;\n}\n\n/**\n * Given a CSS string, returns the parsed style object.\n * @param css - The CSS property as a string.\n * @returns The value of the given CSS property.\n */\nfunction getCSSFromStyleObject(styles) {\n  let css = '';\n  for (const style in styles) {\n    if (style) {\n      css += `${style}: ${styles[style]};`;\n    }\n  }\n  return css;\n}\n\n/**\n * Gets the computed DOM styles of the element.\n * @param element - The node to check the styles for.\n * @returns the computed styles of the element or null if there is no DOM element or no default view for the document.\n */\nfunction $getComputedStyleForElement(element) {\n  const editor = $getEditor();\n  const domElement = editor.getElementByKey(element.getKey());\n  if (domElement === null) {\n    return null;\n  }\n  const view = domElement.ownerDocument.defaultView;\n  if (view === null) {\n    return null;\n  }\n  return view.getComputedStyle(domElement);\n}\n\n/**\n * Gets the computed DOM styles of the parent of the node.\n * @param node - The node to check its parent's styles for.\n * @returns the computed styles of the node or null if there is no DOM element or no default view for the document.\n */\nfunction $getComputedStyleForParent(node) {\n  const parent = $isRootNode(node) ? node : node.getParentOrThrow();\n  return $getComputedStyleForElement(parent);\n}\n\n/**\n * Determines whether a node's parent is RTL.\n * @param node - The node to check whether it is RTL.\n * @returns whether the node is RTL.\n */\nfunction $isParentRTL(node) {\n  const styles = $getComputedStyleForParent(node);\n  return styles !== null && styles.direction === 'rtl';\n}\n\n/**\n * Generally used to append text content to HTML and JSON. Grabs the text content and \"slices\"\n * it to be generated into the new TextNode.\n * @param selection - The selection containing the node whose TextNode is to be edited.\n * @param textNode - The TextNode to be edited.\n * @param mutates - 'clone' to return a clone before mutating, 'self' to update in-place\n * @returns The updated TextNode or clone.\n */\nfunction $sliceSelectedTextNodeContent(selection, textNode, mutates = 'self') {\n  const anchorAndFocus = selection.getStartEndPoints();\n  if (textNode.isSelected(selection) && !$isTokenOrSegmented(textNode) && anchorAndFocus !== null) {\n    const [anchor, focus] = anchorAndFocus;\n    const isBackward = selection.isBackward();\n    const anchorNode = anchor.getNode();\n    const focusNode = focus.getNode();\n    const isAnchor = textNode.is(anchorNode);\n    const isFocus = textNode.is(focusNode);\n    if (isAnchor || isFocus) {\n      const [anchorOffset, focusOffset] = $getCharacterOffsets(selection);\n      const isSame = anchorNode.is(focusNode);\n      const isFirst = textNode.is(isBackward ? focusNode : anchorNode);\n      const isLast = textNode.is(isBackward ? anchorNode : focusNode);\n      let startOffset = 0;\n      let endOffset = undefined;\n      if (isSame) {\n        startOffset = anchorOffset > focusOffset ? focusOffset : anchorOffset;\n        endOffset = anchorOffset > focusOffset ? anchorOffset : focusOffset;\n      } else if (isFirst) {\n        const offset = isBackward ? focusOffset : anchorOffset;\n        startOffset = offset;\n        endOffset = undefined;\n      } else if (isLast) {\n        const offset = isBackward ? anchorOffset : focusOffset;\n        startOffset = 0;\n        endOffset = offset;\n      }\n\n      // NOTE: This mutates __text directly because the primary use case is to\n      // modify a $cloneWithProperties node that should never be added\n      // to the EditorState so we must not call getWritable via setTextContent\n      const text = textNode.__text.slice(startOffset, endOffset);\n      if (text !== textNode.__text) {\n        if (mutates === 'clone') {\n          textNode = $cloneWithPropertiesEphemeral(textNode);\n        }\n        textNode.__text = text;\n      }\n    }\n  }\n  return textNode;\n}\n\n/**\n * Determines if the current selection is at the end of the node.\n * @param point - The point of the selection to test.\n * @returns true if the provided point offset is in the last possible position, false otherwise.\n */\nfunction $isAtNodeEnd(point) {\n  if (point.type === 'text') {\n    return point.offset === point.getNode().getTextContentSize();\n  }\n  const node = point.getNode();\n  if (!$isElementNode(node)) {\n    formatDevErrorMessage(`isAtNodeEnd: node must be a TextNode or ElementNode`);\n  }\n  return point.offset === node.getChildrenSize();\n}\n\n/**\n * Trims text from a node in order to shorten it, eg. to enforce a text's max length. If it deletes text\n * that is an ancestor of the anchor then it will leave 2 indents, otherwise, if no text content exists, it deletes\n * the TextNode. It will move the focus to either the end of any left over text or beginning of a new TextNode.\n * @param editor - The lexical editor.\n * @param anchor - The anchor of the current selection, where the selection should be pointing.\n * @param delCount - The amount of characters to delete. Useful as a dynamic variable eg. textContentSize - maxLength;\n */\nfunction $trimTextContentFromAnchor(editor, anchor, delCount) {\n  // Work from the current selection anchor point\n  let currentNode = anchor.getNode();\n  let remaining = delCount;\n  if ($isElementNode(currentNode)) {\n    const descendantNode = currentNode.getDescendantByIndex(anchor.offset);\n    if (descendantNode !== null) {\n      currentNode = descendantNode;\n    }\n  }\n  while (remaining > 0 && currentNode !== null) {\n    if ($isElementNode(currentNode)) {\n      const lastDescendant = currentNode.getLastDescendant();\n      if (lastDescendant !== null) {\n        currentNode = lastDescendant;\n      }\n    }\n    let nextNode = currentNode.getPreviousSibling();\n    let additionalElementWhitespace = 0;\n    if (nextNode === null) {\n      let parent = currentNode.getParentOrThrow();\n      let parentSibling = parent.getPreviousSibling();\n      while (parentSibling === null) {\n        parent = parent.getParent();\n        if (parent === null) {\n          nextNode = null;\n          break;\n        }\n        parentSibling = parent.getPreviousSibling();\n      }\n      if (parent !== null) {\n        additionalElementWhitespace = parent.isInline() ? 0 : 2;\n        nextNode = parentSibling;\n      }\n    }\n    let text = currentNode.getTextContent();\n    // If the text is empty, we need to consider adding in two line breaks to match\n    // the content if we were to get it from its parent.\n    if (text === '' && $isElementNode(currentNode) && !currentNode.isInline()) {\n      // TODO: should this be handled in core?\n      text = '\\n\\n';\n    }\n    const currentNodeSize = text.length;\n    if (!$isTextNode(currentNode) || remaining >= currentNodeSize) {\n      const parent = currentNode.getParent();\n      currentNode.remove();\n      if (parent != null && parent.getChildrenSize() === 0 && !$isRootNode(parent)) {\n        parent.remove();\n      }\n      remaining -= currentNodeSize + additionalElementWhitespace;\n      currentNode = nextNode;\n    } else {\n      const key = currentNode.getKey();\n      // See if we can just revert it to what was in the last editor state\n      const prevTextContent = editor.getEditorState().read(() => {\n        const prevNode = $getNodeByKey(key);\n        if ($isTextNode(prevNode) && prevNode.isSimpleText()) {\n          return prevNode.getTextContent();\n        }\n        return null;\n      });\n      const offset = currentNodeSize - remaining;\n      const slicedText = text.slice(0, offset);\n      if (prevTextContent !== null && prevTextContent !== text) {\n        const prevSelection = $getPreviousSelection();\n        let target = currentNode;\n        if (!currentNode.isSimpleText()) {\n          const textNode = $createTextNode(prevTextContent);\n          currentNode.replace(textNode);\n          target = textNode;\n        } else {\n          currentNode.setTextContent(prevTextContent);\n        }\n        if ($isRangeSelection(prevSelection) && prevSelection.isCollapsed()) {\n          const prevOffset = prevSelection.anchor.offset;\n          target.select(prevOffset, prevOffset);\n        }\n      } else if (currentNode.isSimpleText()) {\n        // Split text\n        const isSelected = anchor.key === key;\n        let anchorOffset = anchor.offset;\n        // Move offset to end if it's less than the remaining number, otherwise\n        // we'll have a negative splitStart.\n        if (anchorOffset < remaining) {\n          anchorOffset = currentNodeSize;\n        }\n        const splitStart = isSelected ? anchorOffset - remaining : 0;\n        const splitEnd = isSelected ? anchorOffset : offset;\n        if (isSelected && splitStart === 0) {\n          const [excessNode] = currentNode.splitText(splitStart, splitEnd);\n          excessNode.remove();\n        } else {\n          const [, excessNode] = currentNode.splitText(splitStart, splitEnd);\n          excessNode.remove();\n        }\n      } else {\n        const textNode = $createTextNode(slicedText);\n        currentNode.replace(textNode);\n      }\n      remaining = 0;\n    }\n  }\n}\n\n/**\n * @deprecated node styles are parsed on demand and not cached eternally\n */\nconst $addNodeStyle = warnOnlyOnce('$addNodeStyle is a deprecated no-op and calls should be removed');\n\n/**\n * Applies the provided styles to the given TextNode, ElementNode, or\n * collapsed RangeSelection.\n *\n * @param target - The TextNode, ElementNode, or collapsed RangeSelection to apply the styles to\n * @param patch - The patch to apply, which can include multiple styles. \\\\{CSSProperty: value\\\\} . Can also accept a function that returns the new property value.\n */\nfunction $patchStyle(target, patch) {\n  if (!($isRangeSelection(target) ? target.isCollapsed() : $isTextNode(target) || $isElementNode(target))) {\n    formatDevErrorMessage(`$patchStyle must only be called with a TextNode, ElementNode, or collapsed RangeSelection`);\n  }\n  const prevStyles = getStyleObjectFromCSS$1($isRangeSelection(target) ? target.style : $isTextNode(target) ? target.getStyle() : target.getTextStyle());\n  const newStyles = Object.entries(patch).reduce((styles, [key, value]) => {\n    if (typeof value === 'function') {\n      styles[key] = value(prevStyles[key], target);\n    } else if (value === null) {\n      delete styles[key];\n    } else {\n      styles[key] = value;\n    }\n    return styles;\n  }, {\n    ...prevStyles\n  });\n  const newCSSText = getCSSFromStyleObject(newStyles);\n  if ($isRangeSelection(target) || $isTextNode(target)) {\n    target.setStyle(newCSSText);\n  } else {\n    target.setTextStyle(newCSSText);\n  }\n}\n\n/**\n * Applies the provided styles to the TextNodes in the provided Selection.\n * Will update partially selected TextNodes by splitting the TextNode and applying\n * the styles to the appropriate one.\n * @param selection - The selected node(s) to update.\n * @param patch - The patch to apply, which can include multiple styles. \\\\{CSSProperty: value\\\\} . Can also accept a function that returns the new property value.\n */\nfunction $patchStyleText(selection, patch) {\n  if ($isRangeSelection(selection) && selection.isCollapsed()) {\n    $patchStyle(selection, patch);\n    const emptyNode = selection.anchor.getNode();\n    if ($isElementNode(emptyNode) && emptyNode.isEmpty()) {\n      $patchStyle(emptyNode, patch);\n    }\n  }\n  $forEachSelectedTextNode(textNode => {\n    $patchStyle(textNode, patch);\n  });\n  const nodes = selection.getNodes();\n  if (nodes.length > 0) {\n    const patchedElementKeys = new Set();\n    for (const node of nodes) {\n      if (!$isElementNode(node) || !node.canBeEmpty() || node.getChildrenSize() !== 0) {\n        continue;\n      }\n      const key = node.getKey();\n      if (patchedElementKeys.has(key)) {\n        continue;\n      }\n      patchedElementKeys.add(key);\n      $patchStyle(node, patch);\n    }\n  }\n}\nfunction $forEachSelectedTextNode(fn) {\n  const selection = $getSelection();\n  if (!selection) {\n    return;\n  }\n  const slicedTextNodes = new Map();\n  const getSliceIndices = node => slicedTextNodes.get(node.getKey()) || [0, node.getTextContentSize()];\n  if ($isRangeSelection(selection)) {\n    for (const slice of $caretRangeFromSelection(selection).getTextSlices()) {\n      if (slice) {\n        slicedTextNodes.set(slice.caret.origin.getKey(), slice.getSliceIndices());\n      }\n    }\n  }\n  const selectedNodes = selection.getNodes();\n  for (const selectedNode of selectedNodes) {\n    if (!($isTextNode(selectedNode) && selectedNode.canHaveFormat())) {\n      continue;\n    }\n    const [startOffset, endOffset] = getSliceIndices(selectedNode);\n    // No actual text is selected, so do nothing.\n    if (endOffset === startOffset) {\n      continue;\n    }\n\n    // The entire node is selected or a token/segment, so just format it\n    if ($isTokenOrSegmented(selectedNode) || startOffset === 0 && endOffset === selectedNode.getTextContentSize()) {\n      fn(selectedNode);\n    } else {\n      // The node is partially selected, so split it into two or three nodes\n      // and style the selected one.\n      const splitNodes = selectedNode.splitText(startOffset, endOffset);\n      const replacement = splitNodes[startOffset === 0 ? 0 : 1];\n      fn(replacement);\n    }\n  }\n  // Prior to NodeCaret #7046 this would have been a side-effect\n  // so we do this for test compatibility.\n  // TODO: we may want to consider simplifying by removing this\n  if ($isRangeSelection(selection) && selection.anchor.type === 'text' && selection.focus.type === 'text' && selection.anchor.key === selection.focus.key) {\n    $ensureForwardRangeSelection(selection);\n  }\n}\n\n/**\n * Ensure that the given RangeSelection is not backwards. If it\n * is backwards, then the anchor and focus points will be swapped\n * in-place. Ensuring that the selection is a writable RangeSelection\n * is the responsibility of the caller (e.g. in a read-only context\n * you will want to clone $getSelection() before using this).\n *\n * @param selection a writable RangeSelection\n */\nfunction $ensureForwardRangeSelection(selection) {\n  if (selection.isBackward()) {\n    const {\n      anchor,\n      focus\n    } = selection;\n    // stash for the in-place swap\n    const {\n      key,\n      offset,\n      type\n    } = anchor;\n    anchor.set(focus.key, focus.offset, focus.type);\n    focus.set(key, offset, type);\n  }\n}\n\nfunction $copyBlockFormatIndent(srcNode, destNode) {\n  const format = srcNode.getFormatType();\n  const indent = srcNode.getIndent();\n  if (format !== destNode.getFormatType()) {\n    destNode.setFormat(format);\n  }\n  if (indent !== destNode.getIndent()) {\n    destNode.setIndent(indent);\n  }\n}\n\n/**\n * Converts all nodes in the selection that are of one block type to another.\n * @param selection - The selected blocks to be converted.\n * @param $createElement - The function that creates the node. eg. $createParagraphNode.\n * @param $afterCreateElement - The function that updates the new node based on the previous one ($copyBlockFormatIndent by default)\n */\nfunction $setBlocksType(selection, $createElement, $afterCreateElement = $copyBlockFormatIndent) {\n  if (selection === null) {\n    return;\n  }\n  // Selections tend to not include their containing blocks so we effectively\n  // expand it here\n  const anchorAndFocus = selection.getStartEndPoints();\n  const blockMap = new Map();\n  let newSelection = null;\n  if (anchorAndFocus) {\n    const [anchor, focus] = anchorAndFocus;\n    newSelection = $createRangeSelection();\n    newSelection.anchor.set(anchor.key, anchor.offset, anchor.type);\n    newSelection.focus.set(focus.key, focus.offset, focus.type);\n    const anchorBlock = $findMatchingParent(anchor.getNode(), INTERNAL_$isBlock);\n    const focusBlock = $findMatchingParent(focus.getNode(), INTERNAL_$isBlock);\n    if ($isElementNode(anchorBlock)) {\n      blockMap.set(anchorBlock.getKey(), anchorBlock);\n    }\n    if ($isElementNode(focusBlock)) {\n      blockMap.set(focusBlock.getKey(), focusBlock);\n    }\n  }\n  for (const node of selection.getNodes()) {\n    if ($isElementNode(node) && INTERNAL_$isBlock(node)) {\n      blockMap.set(node.getKey(), node);\n    } else if (anchorAndFocus === null) {\n      const ancestorBlock = $findMatchingParent(node, INTERNAL_$isBlock);\n      if ($isElementNode(ancestorBlock)) {\n        blockMap.set(ancestorBlock.getKey(), ancestorBlock);\n      }\n    }\n  }\n  for (const [key, prevNode] of blockMap) {\n    const element = $createElement();\n    $afterCreateElement(prevNode, element);\n    prevNode.replace(element, true);\n    if (newSelection) {\n      if (key === newSelection.anchor.key) {\n        newSelection.anchor.set(element.getKey(), newSelection.anchor.offset, newSelection.anchor.type);\n      }\n      if (key === newSelection.focus.key) {\n        newSelection.focus.set(element.getKey(), newSelection.focus.offset, newSelection.focus.type);\n      }\n    }\n  }\n  if (newSelection && selection.is($getSelection())) {\n    $setSelection(newSelection);\n  }\n}\nfunction isPointAttached(point) {\n  return point.getNode().isAttached();\n}\nfunction $removeParentEmptyElements(startingNode) {\n  let node = startingNode;\n  while (node !== null && !$isRootOrShadowRoot(node)) {\n    const latest = node.getLatest();\n    const parentNode = node.getParent();\n    if (latest.getChildrenSize() === 0) {\n      node.remove(true);\n    }\n    node = parentNode;\n  }\n}\n\n/**\n * @deprecated In favor of $setBlockTypes\n * Wraps all nodes in the selection into another node of the type returned by createElement.\n * @param selection - The selection of nodes to be wrapped.\n * @param createElement - A function that creates the wrapping ElementNode. eg. $createParagraphNode.\n * @param wrappingElement - An element to append the wrapped selection and its children to.\n */\nfunction $wrapNodes(selection, createElement, wrappingElement = null) {\n  const anchorAndFocus = selection.getStartEndPoints();\n  const anchor = anchorAndFocus ? anchorAndFocus[0] : null;\n  const nodes = selection.getNodes();\n  const nodesLength = nodes.length;\n  if (anchor !== null && (nodesLength === 0 || nodesLength === 1 && anchor.type === 'element' && anchor.getNode().getChildrenSize() === 0)) {\n    const target = anchor.type === 'text' ? anchor.getNode().getParentOrThrow() : anchor.getNode();\n    const children = target.getChildren();\n    let element = createElement();\n    element.setFormat(target.getFormatType());\n    element.setIndent(target.getIndent());\n    children.forEach(child => element.append(child));\n    if (wrappingElement) {\n      element = wrappingElement.append(element);\n    }\n    target.replace(element);\n    return;\n  }\n  let topLevelNode = null;\n  let descendants = [];\n  for (let i = 0; i < nodesLength; i++) {\n    const node = nodes[i];\n    // Determine whether wrapping has to be broken down into multiple chunks. This can happen if the\n    // user selected multiple Root-like nodes that have to be treated separately as if they are\n    // their own branch. I.e. you don't want to wrap a whole table, but rather the contents of each\n    // of each of the cell nodes.\n    if ($isRootOrShadowRoot(node)) {\n      $wrapNodesImpl(selection, descendants, descendants.length, createElement, wrappingElement);\n      descendants = [];\n      topLevelNode = node;\n    } else if (topLevelNode === null || topLevelNode !== null && $hasAncestor(node, topLevelNode)) {\n      descendants.push(node);\n    } else {\n      $wrapNodesImpl(selection, descendants, descendants.length, createElement, wrappingElement);\n      descendants = [node];\n    }\n  }\n  $wrapNodesImpl(selection, descendants, descendants.length, createElement, wrappingElement);\n}\n\n/**\n * Wraps each node into a new ElementNode.\n * @param selection - The selection of nodes to wrap.\n * @param nodes - An array of nodes, generally the descendants of the selection.\n * @param nodesLength - The length of nodes.\n * @param createElement - A function that creates the wrapping ElementNode. eg. $createParagraphNode.\n * @param wrappingElement - An element to wrap all the nodes into.\n * @returns\n */\nfunction $wrapNodesImpl(selection, nodes, nodesLength, createElement, wrappingElement = null) {\n  if (nodes.length === 0) {\n    return;\n  }\n  const firstNode = nodes[0];\n  const elementMapping = new Map();\n  const elements = [];\n  // The below logic is to find the right target for us to\n  // either insertAfter/insertBefore/append the corresponding\n  // elements to. This is made more complicated due to nested\n  // structures.\n  let target = $isElementNode(firstNode) ? firstNode : firstNode.getParentOrThrow();\n  if (target.isInline()) {\n    target = target.getParentOrThrow();\n  }\n  let targetIsPrevSibling = false;\n  while (target !== null) {\n    const prevSibling = target.getPreviousSibling();\n    if (prevSibling !== null) {\n      target = prevSibling;\n      targetIsPrevSibling = true;\n      break;\n    }\n    target = target.getParentOrThrow();\n    if ($isRootOrShadowRoot(target)) {\n      break;\n    }\n  }\n  const emptyElements = new Set();\n\n  // Find any top level empty elements\n  for (let i = 0; i < nodesLength; i++) {\n    const node = nodes[i];\n    if ($isElementNode(node) && node.getChildrenSize() === 0) {\n      emptyElements.add(node.getKey());\n    }\n  }\n  const movedNodes = new Set();\n\n  // Move out all leaf nodes into our elements array.\n  // If we find a top level empty element, also move make\n  // an element for that.\n  for (let i = 0; i < nodesLength; i++) {\n    const node = nodes[i];\n    let parent = node.getParent();\n    if (parent !== null && parent.isInline()) {\n      parent = parent.getParent();\n    }\n    if (parent !== null && $isLeafNode(node) && !movedNodes.has(node.getKey())) {\n      const parentKey = parent.getKey();\n      if (elementMapping.get(parentKey) === undefined) {\n        const targetElement = createElement();\n        targetElement.setFormat(parent.getFormatType());\n        targetElement.setIndent(parent.getIndent());\n        elements.push(targetElement);\n        elementMapping.set(parentKey, targetElement);\n        // Move node and its siblings to the new\n        // element.\n        parent.getChildren().forEach(child => {\n          targetElement.append(child);\n          movedNodes.add(child.getKey());\n          if ($isElementNode(child)) {\n            // Skip nested leaf nodes if the parent has already been moved\n            child.getChildrenKeys().forEach(key => movedNodes.add(key));\n          }\n        });\n        $removeParentEmptyElements(parent);\n      }\n    } else if (emptyElements.has(node.getKey())) {\n      if (!$isElementNode(node)) {\n        formatDevErrorMessage(`Expected node in emptyElements to be an ElementNode`);\n      }\n      const targetElement = createElement();\n      targetElement.setFormat(node.getFormatType());\n      targetElement.setIndent(node.getIndent());\n      elements.push(targetElement);\n      node.remove(true);\n    }\n  }\n  if (wrappingElement !== null) {\n    for (let i = 0; i < elements.length; i++) {\n      const element = elements[i];\n      wrappingElement.append(element);\n    }\n  }\n  let lastElement = null;\n\n  // If our target is Root-like, let's see if we can re-adjust\n  // so that the target is the first child instead.\n  if ($isRootOrShadowRoot(target)) {\n    if (targetIsPrevSibling) {\n      if (wrappingElement !== null) {\n        target.insertAfter(wrappingElement);\n      } else {\n        for (let i = elements.length - 1; i >= 0; i--) {\n          const element = elements[i];\n          target.insertAfter(element);\n        }\n      }\n    } else {\n      const firstChild = target.getFirstChild();\n      if ($isElementNode(firstChild)) {\n        target = firstChild;\n      }\n      if (firstChild === null) {\n        if (wrappingElement) {\n          target.append(wrappingElement);\n        } else {\n          for (let i = 0; i < elements.length; i++) {\n            const element = elements[i];\n            target.append(element);\n            lastElement = element;\n          }\n        }\n      } else {\n        if (wrappingElement !== null) {\n          firstChild.insertBefore(wrappingElement);\n        } else {\n          for (let i = 0; i < elements.length; i++) {\n            const element = elements[i];\n            firstChild.insertBefore(element);\n            lastElement = element;\n          }\n        }\n      }\n    }\n  } else {\n    if (wrappingElement) {\n      target.insertAfter(wrappingElement);\n    } else {\n      for (let i = elements.length - 1; i >= 0; i--) {\n        const element = elements[i];\n        target.insertAfter(element);\n        lastElement = element;\n      }\n    }\n  }\n  const prevSelection = $getPreviousSelection();\n  if ($isRangeSelection(prevSelection) && isPointAttached(prevSelection.anchor) && isPointAttached(prevSelection.focus)) {\n    $setSelection(prevSelection.clone());\n  } else if (lastElement !== null) {\n    lastElement.selectEnd();\n  } else {\n    selection.dirty = true;\n  }\n}\n\n/**\n * Tests if the selection's parent element has vertical writing mode.\n * @param selection - The selection whose parent to test.\n * @returns true if the selection's parent has vertical writing mode (writing-mode: vertical-rl), false otherwise.\n */\nfunction $isEditorVerticalOrientation(selection) {\n  const computedStyle = $getComputedStyle(selection);\n  return computedStyle !== null && computedStyle.writingMode === 'vertical-rl';\n}\n\n/**\n * Gets the computed DOM styles of the parent of the selection's anchor node.\n * @param selection - The selection to check the styles for.\n * @returns the computed styles of the node or null if there is no DOM element or no default view for the document.\n */\nfunction $getComputedStyle(selection) {\n  const anchorNode = selection.anchor.getNode();\n  if ($isElementNode(anchorNode)) {\n    return $getComputedStyleForElement(anchorNode);\n  }\n  return $getComputedStyleForParent(anchorNode);\n}\n\n/**\n * Determines if the default character selection should be overridden. Used with DecoratorNodes\n * @param selection - The selection whose default character selection may need to be overridden.\n * @param isBackward - Is the selection backwards (the focus comes before the anchor)?\n * @returns true if it should be overridden, false if not.\n */\nfunction $shouldOverrideDefaultCharacterSelection(selection, isBackward) {\n  const isVertical = $isEditorVerticalOrientation(selection);\n\n  // In vertical writing mode, we adjust the direction for correct caret movement\n  let adjustedIsBackward = isVertical ? !isBackward : isBackward;\n\n  // In right-to-left writing mode, we invert the direction for correct caret movement\n  if ($isParentElementRTL(selection)) {\n    adjustedIsBackward = !adjustedIsBackward;\n  }\n  const focusCaret = $caretFromPoint(selection.focus, adjustedIsBackward ? 'previous' : 'next');\n  if ($isExtendableTextPointCaret(focusCaret)) {\n    return false;\n  }\n  for (const nextCaret of $extendCaretToRange(focusCaret)) {\n    if ($isChildCaret(nextCaret)) {\n      return !nextCaret.origin.isInline();\n    } else if ($isElementNode(nextCaret.origin)) {\n      continue;\n    } else if ($isDecoratorNode(nextCaret.origin)) {\n      return true;\n    }\n    break;\n  }\n  return false;\n}\n\n/**\n * Moves the selection according to the arguments.\n * @param selection - The selected text or nodes.\n * @param isHoldingShift - Is the shift key being held down during the operation.\n * @param isBackward - Is the selection selected backwards (the focus comes before the anchor)?\n * @param granularity - The distance to adjust the current selection.\n */\nfunction $moveCaretSelection(selection, isHoldingShift, isBackward, granularity) {\n  selection.modify(isHoldingShift ? 'extend' : 'move', isBackward, granularity);\n}\n\n/**\n * Tests a parent element for right to left direction.\n * @param selection - The selection whose parent is to be tested.\n * @returns true if the selections' parent element has a direction of 'rtl' (right to left), false otherwise.\n */\nfunction $isParentElementRTL(selection) {\n  const computedStyle = $getComputedStyle(selection);\n  return computedStyle !== null && computedStyle.direction === 'rtl';\n}\n\n/**\n * Moves selection by character according to arguments.\n * @param selection - The selection of the characters to move.\n * @param isHoldingShift - Is the shift key being held down during the operation.\n * @param isBackward - Is the selection backward (the focus comes before the anchor)?\n */\nfunction $moveCharacter(selection, isHoldingShift, isBackward) {\n  const isRTL = $isParentElementRTL(selection);\n  const isVertical = $isEditorVerticalOrientation(selection);\n\n  // In vertical-rl writing mode, arrow key directions need to be flipped\n  // to match the visual flow of text (top to bottom, right to left)\n  let adjustedIsBackward;\n  if (isVertical) {\n    // In vertical-rl mode, we need to completely invert the direction\n    // Left arrow (backward) should move down (forward)\n    // Right arrow (forward) should move up (backward)\n    adjustedIsBackward = !isBackward;\n  } else if (isRTL) {\n    // In horizontal RTL mode, use the standard RTL behavior\n    adjustedIsBackward = !isBackward;\n  } else {\n    // Standard LTR horizontal text\n    adjustedIsBackward = isBackward;\n  }\n\n  // Apply the direction adjustment to move the caret\n  $moveCaretSelection(selection, isHoldingShift, adjustedIsBackward, 'character');\n}\n\n/**\n * Returns the current value of a CSS property for Nodes, if set. If not set, it returns the defaultValue.\n * @param node - The node whose style value to get.\n * @param styleProperty - The CSS style property.\n * @param defaultValue - The default value for the property.\n * @returns The value of the property for node.\n */\nfunction $getNodeStyleValueForProperty(node, styleProperty, defaultValue) {\n  const css = node.getStyle();\n  const styleObject = getStyleObjectFromCSS$1(css);\n  if (styleObject !== null) {\n    return styleObject[styleProperty] || defaultValue;\n  }\n  return defaultValue;\n}\n\n/**\n * Returns the current value of a CSS property for TextNodes in the Selection, if set. If not set, it returns the defaultValue.\n * If all TextNodes do not have the same value, it returns an empty string.\n * @param selection - The selection of TextNodes whose value to find.\n * @param styleProperty - The CSS style property.\n * @param defaultValue - The default value for the property, defaults to an empty string.\n * @returns The value of the property for the selected TextNodes.\n */\nfunction $getSelectionStyleValueForProperty(selection, styleProperty, defaultValue = '') {\n  let styleValue = null;\n  const nodes = selection.getNodes();\n  const anchor = selection.anchor;\n  const focus = selection.focus;\n  const isBackward = selection.isBackward();\n  const startNode = isBackward ? focus.getNode() : anchor.getNode();\n  const endNode = isBackward ? anchor.getNode() : focus.getNode();\n  const startOffset = isBackward ? focus.offset : anchor.offset;\n  const endOffset = isBackward ? anchor.offset : focus.offset;\n  if ($isRangeSelection(selection) && selection.isCollapsed() && selection.style !== '') {\n    const css = selection.style;\n    const styleObject = getStyleObjectFromCSS$1(css);\n    if (styleObject !== null && styleProperty in styleObject) {\n      return styleObject[styleProperty];\n    }\n  }\n  for (let i = 0; i < nodes.length; i++) {\n    const node = nodes[i];\n    if (i === 0 && node.is(startNode) && $isTextNode(node) && startOffset === node.getTextContentSize()) {\n      continue;\n    }\n    if (i !== 0 && node.is(endNode) && endOffset === 0) {\n      continue;\n    }\n    if ($isTextNode(node)) {\n      const nodeStyleValue = $getNodeStyleValueForProperty(node, styleProperty, defaultValue);\n      if (styleValue === null) {\n        styleValue = nodeStyleValue;\n      } else if (styleValue !== nodeStyleValue) {\n        // multiple text nodes are in the selection and they don't all\n        // have the same style.\n        styleValue = '';\n        break;\n      }\n    }\n  }\n  return styleValue === null ? defaultValue : styleValue;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/** @deprecated moved to the `lexical` package */\nconst getStyleObjectFromCSS = getStyleObjectFromCSS$1;\n/** @deprecated renamed to {@link $trimTextContentFromAnchor} by @lexical/eslint-plugin rules-of-lexical */\nconst trimTextContentFromAnchor = $trimTextContentFromAnchor;\n\nexport { $addNodeStyle, $copyBlockFormatIndent, $ensureForwardRangeSelection, $forEachSelectedTextNode, $getComputedStyleForElement, $getComputedStyleForParent, $getSelectionStyleValueForProperty, $isAtNodeEnd, $isParentElementRTL, $isParentRTL, $moveCaretSelection, $moveCharacter, $patchStyleText, $setBlocksType, $shouldOverrideDefaultCharacterSelection, $sliceSelectedTextNodeContent, $trimTextContentFromAnchor, $wrapNodes, createDOMRange, createRectsFromDOMRange, getCSSFromStyleObject, getStyleObjectFromCSS, trimTextContentFromAnchor };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n  throw new Error(message);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst documentMode = CAN_USE_DOM && 'documentMode' in document ? document.documentMode : null;\nconst IS_APPLE = CAN_USE_DOM && /Mac|iPod|iPhone|iPad/.test(navigator.platform);\nconst IS_FIREFOX = CAN_USE_DOM && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);\nconst CAN_USE_BEFORE_INPUT = CAN_USE_DOM && 'InputEvent' in window && !documentMode ? 'getTargetRanges' in new window.InputEvent('input') : false;\nconst IS_IOS = CAN_USE_DOM && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\nconst IS_ANDROID = CAN_USE_DOM && /Android/.test(navigator.userAgent);\n\n// Exclude Android \u2014 Android WebView's UA contains \"Version/X.X ... Safari/537.36\"\n// which falsely matches the Safari regex, activating wrong composition code paths.\nconst IS_SAFARI = CAN_USE_DOM && /Version\\/[\\d.]+.*Safari/.test(navigator.userAgent) && !IS_ANDROID;\n\n// Keep these in case we need to use them in the future.\n// export const IS_WINDOWS: boolean = CAN_USE_DOM && /Win/.test(navigator.platform);\nconst IS_CHROME = CAN_USE_DOM && /^(?=.*Chrome).*/i.test(navigator.userAgent);\n// export const canUseTextInputEvent: boolean = CAN_USE_DOM && 'TextEvent' in window && !documentMode;\n\nconst IS_ANDROID_CHROME = CAN_USE_DOM && IS_ANDROID && IS_CHROME;\nconst IS_APPLE_WEBKIT = CAN_USE_DOM && /AppleWebKit\\/[\\d.]+/.test(navigator.userAgent) && IS_APPLE && !IS_CHROME;\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n// DOM\nconst DOM_ELEMENT_TYPE = 1;\nconst DOM_TEXT_TYPE = 3;\nconst DOM_DOCUMENT_TYPE = 9;\nconst DOM_DOCUMENT_FRAGMENT_TYPE = 11;\n\n// Reconciling\nconst NO_DIRTY_NODES = 0;\nconst HAS_DIRTY_NODES = 1;\nconst FULL_RECONCILE = 2;\n\n// Text node modes\nconst IS_NORMAL = 0;\nconst IS_TOKEN = 1;\nconst IS_SEGMENTED = 2;\n// IS_INERT = 3\n\n// Text node formatting\nconst IS_BOLD = 1;\nconst IS_ITALIC = 1 << 1;\nconst IS_STRIKETHROUGH = 1 << 2;\nconst IS_UNDERLINE = 1 << 3;\nconst IS_CODE = 1 << 4;\nconst IS_SUBSCRIPT = 1 << 5;\nconst IS_SUPERSCRIPT = 1 << 6;\nconst IS_HIGHLIGHT = 1 << 7;\nconst IS_LOWERCASE = 1 << 8;\nconst IS_UPPERCASE = 1 << 9;\nconst IS_CAPITALIZE = 1 << 10;\nconst IS_ALL_FORMATTING = IS_BOLD | IS_ITALIC | IS_STRIKETHROUGH | IS_UNDERLINE | IS_CODE | IS_SUBSCRIPT | IS_SUPERSCRIPT | IS_HIGHLIGHT | IS_LOWERCASE | IS_UPPERCASE | IS_CAPITALIZE;\n\n// Text node details\nconst IS_DIRECTIONLESS = 1;\nconst IS_UNMERGEABLE = 1 << 1;\n\n// Element node formatting\nconst IS_ALIGN_LEFT = 1;\nconst IS_ALIGN_CENTER = 2;\nconst IS_ALIGN_RIGHT = 3;\nconst IS_ALIGN_JUSTIFY = 4;\nconst IS_ALIGN_START = 5;\nconst IS_ALIGN_END = 6;\n\n// Reconciliation\nconst NON_BREAKING_SPACE = '\\u00A0';\nconst ZERO_WIDTH_SPACE = '\\u200b';\n\n// For iOS/Safari we use a non breaking space, otherwise the cursor appears\n// overlapping the composed text.\nconst COMPOSITION_SUFFIX = IS_SAFARI || IS_IOS || IS_APPLE_WEBKIT ? NON_BREAKING_SPACE : ZERO_WIDTH_SPACE;\nconst DOUBLE_LINE_BREAK = '\\n\\n';\n\n// For FF, we need to use a non-breaking space, or it gets composition\n// in a stuck state.\nconst COMPOSITION_START_CHAR = IS_FIREFOX ? NON_BREAKING_SPACE : COMPOSITION_SUFFIX;\nconst RTL = '\\u0591-\\u07FF\\uFB1D-\\uFDFD\\uFE70-\\uFEFC';\nconst LTR = 'A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6' + '\\u00F8-\\u02B8\\u0300-\\u0590\\u0800-\\u1FFF\\u200E\\u2C00-\\uFB1C' + '\\uFE00-\\uFE6F\\uFEFD-\\uFFFF';\n\n// eslint-disable-next-line no-misleading-character-class\nconst RTL_REGEX = new RegExp('^[^' + LTR + ']*[' + RTL + ']');\n// eslint-disable-next-line no-misleading-character-class\nconst LTR_REGEX = new RegExp('^[^' + RTL + ']*[' + LTR + ']');\nconst TEXT_TYPE_TO_FORMAT = {\n  bold: IS_BOLD,\n  capitalize: IS_CAPITALIZE,\n  code: IS_CODE,\n  highlight: IS_HIGHLIGHT,\n  italic: IS_ITALIC,\n  lowercase: IS_LOWERCASE,\n  strikethrough: IS_STRIKETHROUGH,\n  subscript: IS_SUBSCRIPT,\n  superscript: IS_SUPERSCRIPT,\n  underline: IS_UNDERLINE,\n  uppercase: IS_UPPERCASE\n};\nconst DETAIL_TYPE_TO_DETAIL = {\n  directionless: IS_DIRECTIONLESS,\n  unmergeable: IS_UNMERGEABLE\n};\nconst ELEMENT_TYPE_TO_FORMAT = {\n  center: IS_ALIGN_CENTER,\n  end: IS_ALIGN_END,\n  justify: IS_ALIGN_JUSTIFY,\n  left: IS_ALIGN_LEFT,\n  right: IS_ALIGN_RIGHT,\n  start: IS_ALIGN_START\n};\nconst ELEMENT_FORMAT_TO_TYPE = {\n  [IS_ALIGN_CENTER]: 'center',\n  [IS_ALIGN_END]: 'end',\n  [IS_ALIGN_JUSTIFY]: 'justify',\n  [IS_ALIGN_LEFT]: 'left',\n  [IS_ALIGN_RIGHT]: 'right',\n  [IS_ALIGN_START]: 'start'\n};\nconst TEXT_MODE_TO_TYPE = {\n  normal: IS_NORMAL,\n  segmented: IS_SEGMENTED,\n  token: IS_TOKEN\n};\nconst TEXT_TYPE_TO_MODE = {\n  [IS_NORMAL]: 'normal',\n  [IS_SEGMENTED]: 'segmented',\n  [IS_TOKEN]: 'token'\n};\nconst NODE_STATE_KEY = '$';\nconst PROTOTYPE_CONFIG_METHOD = '$config';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\nclass DequeSet {\n  _front = new Set();\n  _back = new Set();\n  _cache;\n  get size() {\n    return this._front.size + this._back.size;\n  }\n  addBack(v) {\n    delete this._cache;\n    if (!this._front.has(v)) {\n      this._back.add(v);\n    }\n    return this;\n  }\n  addFront(v) {\n    delete this._cache;\n    if (!this._back.has(v)) {\n      this._front.add(v);\n    }\n    return this;\n  }\n  delete(v) {\n    delete this._cache;\n    return this._front.delete(v) || this._back.delete(v);\n  }\n  toArray() {\n    const arr = Array.from(this._front).reverse();\n    for (const v of this._back) {\n      arr.push(v);\n    }\n    return arr;\n  }\n  toReadonlyArray() {\n    this._cache = this._cache || this.toArray();\n    return this._cache;\n  }\n  [Symbol.iterator]() {\n    return this.toReadonlyArray()[Symbol.iterator]();\n  }\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction $garbageCollectDetachedDecorators(editor, pendingEditorState) {\n  const currentDecorators = editor._decorators;\n  const pendingDecorators = editor._pendingDecorators;\n  let decorators = pendingDecorators || currentDecorators;\n  const nodeMap = pendingEditorState._nodeMap;\n  let key;\n  for (key in decorators) {\n    if (!nodeMap.has(key)) {\n      if (decorators === currentDecorators) {\n        decorators = cloneDecorators(editor);\n      }\n      delete decorators[key];\n    }\n  }\n}\nfunction $garbageCollectDetachedDeepChildNodes(node, parentKey, prevNodeMap, nodeMap, nodeMapDelete, dirtyNodes) {\n  let child = node.getFirstChild();\n  while (child !== null) {\n    const childKey = child.__key;\n    // TODO Revise condition below, redundant? LexicalNode already cleans up children when moving Nodes\n    if (child.__parent === parentKey) {\n      if ($isElementNode(child)) {\n        $garbageCollectDetachedDeepChildNodes(child, childKey, prevNodeMap, nodeMap, nodeMapDelete, dirtyNodes);\n      }\n\n      // If we have created a node and it was dereferenced, then also\n      // remove it from out dirty nodes Set.\n      if (!prevNodeMap.has(childKey)) {\n        dirtyNodes.delete(childKey);\n      }\n      nodeMapDelete.push(childKey);\n    }\n    child = child.getNextSibling();\n  }\n}\nfunction $garbageCollectDetachedNodes(prevEditorState, editorState, dirtyLeaves, dirtyElements) {\n  const prevNodeMap = prevEditorState._nodeMap;\n  const nodeMap = editorState._nodeMap;\n  // Store dirtyElements in a queue for later deletion; deleting dirty subtrees too early will\n  // hinder accessing .__next on child nodes\n  const nodeMapDelete = [];\n  for (const [nodeKey] of dirtyElements) {\n    const node = nodeMap.get(nodeKey);\n    if (node !== undefined) {\n      // Garbage collect node and its children if they exist\n      if (!node.isAttached()) {\n        if ($isElementNode(node)) {\n          $garbageCollectDetachedDeepChildNodes(node, nodeKey, prevNodeMap, nodeMap, nodeMapDelete, dirtyElements);\n        }\n        // If we have created a node and it was dereferenced, then also\n        // remove it from out dirty nodes Set.\n        if (!prevNodeMap.has(nodeKey)) {\n          dirtyElements.delete(nodeKey);\n        }\n        nodeMapDelete.push(nodeKey);\n      }\n    }\n  }\n  for (const nodeKey of nodeMapDelete) {\n    nodeMap.delete(nodeKey);\n  }\n  for (const nodeKey of dirtyLeaves) {\n    const node = nodeMap.get(nodeKey);\n    if (node !== undefined && !node.isAttached()) {\n      if (!prevNodeMap.has(nodeKey)) {\n        dirtyLeaves.delete(nodeKey);\n      }\n      nodeMap.delete(nodeKey);\n    }\n  }\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// The time between a text entry event and the mutation observer firing.\nconst TEXT_MUTATION_VARIANCE = 100;\nlet isProcessingMutations = false;\nlet lastTextEntryTimeStamp = 0;\nfunction getIsProcessingMutations() {\n  return isProcessingMutations;\n}\nfunction updateTimeStamp(event) {\n  lastTextEntryTimeStamp = event.timeStamp;\n}\nfunction initTextEntryListener(editor) {\n  if (lastTextEntryTimeStamp === 0) {\n    getWindow(editor).addEventListener('textInput', updateTimeStamp, true);\n  }\n}\nfunction isManagedLineBreak(dom, target, editor) {\n  const isBR = dom.nodeName === 'BR';\n  const lexicalLineBreak = target.__lexicalLineBreak;\n  return lexicalLineBreak && (dom === lexicalLineBreak || isBR && dom.previousSibling === lexicalLineBreak) || isBR && getNodeKeyFromDOMNode(dom, editor) !== undefined;\n}\nfunction getLastSelection(editor) {\n  return editor.getEditorState().read(() => {\n    const selection = $getSelection();\n    return selection !== null ? selection.clone() : null;\n  });\n}\nfunction $handleTextMutation(target, node, editor) {\n  const domSelection = getDOMSelection(getWindow(editor));\n  let anchorOffset = null;\n  let focusOffset = null;\n  if (domSelection !== null && domSelection.anchorNode === target) {\n    anchorOffset = domSelection.anchorOffset;\n    focusOffset = domSelection.focusOffset;\n  }\n  const text = target.nodeValue;\n  if (text !== null) {\n    $updateTextNodeFromDOMContent(node, text, anchorOffset, focusOffset, false);\n  }\n}\nfunction shouldUpdateTextNodeFromMutation(selection, targetDOM, targetNode) {\n  if ($isRangeSelection(selection)) {\n    const anchorNode = selection.anchor.getNode();\n    if (anchorNode.is(targetNode) && selection.format !== anchorNode.getFormat()) {\n      return false;\n    }\n  }\n  return isDOMTextNode(targetDOM) && targetNode.isAttached();\n}\nfunction $getNearestManagedNodePairFromDOMNode(startingDOM, editor, editorState, rootElement) {\n  for (let dom = startingDOM; dom && !isDOMUnmanaged(dom); dom = getParentElement(dom)) {\n    const key = getNodeKeyFromDOMNode(dom, editor);\n    if (key !== undefined) {\n      const node = $getNodeByKey(key, editorState);\n      if (node) {\n        // All decorator nodes are unmanaged\n        return $isDecoratorNode(node) || !isHTMLElement(dom) ? undefined : [dom, node];\n      }\n    } else if (dom === rootElement) {\n      return [rootElement, internalGetRoot(editorState)];\n    }\n  }\n}\nfunction flushMutations(editor, mutations, observer) {\n  isProcessingMutations = true;\n  const shouldFlushTextMutations = performance.now() - lastTextEntryTimeStamp > TEXT_MUTATION_VARIANCE;\n  try {\n    updateEditorSync(editor, () => {\n      const selection = $getSelection() || getLastSelection(editor);\n      const badDOMTargets = new Map();\n      const rootElement = editor.getRootElement();\n      // We use the current editor state, as that reflects what is\n      // actually \"on screen\".\n      const currentEditorState = editor._editorState;\n      const blockCursorElement = editor._blockCursorElement;\n      let shouldRevertSelection = false;\n      let possibleTextForFirefoxPaste = '';\n      for (let i = 0; i < mutations.length; i++) {\n        const mutation = mutations[i];\n        const type = mutation.type;\n        const targetDOM = mutation.target;\n        const pair = $getNearestManagedNodePairFromDOMNode(targetDOM, editor, currentEditorState, rootElement);\n        if (!pair) {\n          continue;\n        }\n        const [nodeDOM, targetNode] = pair;\n        if (type === 'characterData') {\n          // Text mutations are deferred and passed to mutation listeners to be\n          // processed outside of the Lexical engine.\n          if (\n          // TODO there is an edge case here if a mutation happens too quickly\n          //      after text input, it may never be handled since we do not\n          //      track the ignored mutations in any way\n          shouldFlushTextMutations && $isTextNode(targetNode) && isDOMTextNode(targetDOM) && shouldUpdateTextNodeFromMutation(selection, targetDOM, targetNode)) {\n            $handleTextMutation(targetDOM, targetNode, editor);\n          }\n        } else if (type === 'childList') {\n          shouldRevertSelection = true;\n          // We attempt to \"undo\" any changes that have occurred outside\n          // of Lexical. We want Lexical's editor state to be source of truth.\n          // To the user, these will look like no-ops.\n          const addedDOMs = mutation.addedNodes;\n          for (let s = 0; s < addedDOMs.length; s++) {\n            const addedDOM = addedDOMs[s];\n            const node = $getNodeFromDOMNode(addedDOM);\n            const parentDOM = addedDOM.parentNode;\n            if (parentDOM != null && addedDOM !== blockCursorElement && node === null && !isManagedLineBreak(addedDOM, parentDOM, editor)) {\n              if (IS_FIREFOX) {\n                const possibleText = (isHTMLElement(addedDOM) ? addedDOM.innerText : null) || addedDOM.nodeValue;\n                if (possibleText) {\n                  possibleTextForFirefoxPaste += possibleText;\n                }\n              }\n              parentDOM.removeChild(addedDOM);\n            }\n          }\n          const removedDOMs = mutation.removedNodes;\n          const removedDOMsLength = removedDOMs.length;\n          if (removedDOMsLength > 0) {\n            let unremovedBRs = 0;\n            for (let s = 0; s < removedDOMsLength; s++) {\n              const removedDOM = removedDOMs[s];\n              if (isManagedLineBreak(removedDOM, targetDOM, editor) || blockCursorElement === removedDOM) {\n                targetDOM.appendChild(removedDOM);\n                unremovedBRs++;\n              }\n            }\n            if (removedDOMsLength !== unremovedBRs) {\n              badDOMTargets.set(nodeDOM, targetNode);\n            }\n          }\n        }\n      }\n\n      // Now we process each of the unique target nodes, attempting\n      // to restore their contents back to the source of truth, which\n      // is Lexical's \"current\" editor state. This is basically like\n      // an internal revert on the DOM.\n      if (badDOMTargets.size > 0) {\n        for (const [nodeDOM, targetNode] of badDOMTargets) {\n          targetNode.reconcileObservedMutation(nodeDOM, editor);\n        }\n      }\n\n      // Capture all the mutations made during this function. This\n      // also prevents us having to process them on the next cycle\n      // of onMutation, as these mutations were made by us.\n      const records = observer.takeRecords();\n\n      // Check for any random auto-added <br> elements, and remove them.\n      // These get added by the browser when we undo the above mutations\n      // and this can lead to a broken UI.\n      if (records.length > 0) {\n        for (let i = 0; i < records.length; i++) {\n          const record = records[i];\n          const addedNodes = record.addedNodes;\n          const target = record.target;\n          for (let s = 0; s < addedNodes.length; s++) {\n            const addedDOM = addedNodes[s];\n            const parentDOM = addedDOM.parentNode;\n            if (parentDOM != null && addedDOM.nodeName === 'BR' && !isManagedLineBreak(addedDOM, target, editor)) {\n              parentDOM.removeChild(addedDOM);\n            }\n          }\n        }\n\n        // Clear any of those removal mutations\n        observer.takeRecords();\n      }\n      if (selection !== null) {\n        if (shouldRevertSelection) {\n          $setSelection(selection);\n        }\n        if (IS_FIREFOX && isFirefoxClipboardEvents(editor)) {\n          selection.insertRawText(possibleTextForFirefoxPaste);\n        }\n      }\n    });\n  } finally {\n    isProcessingMutations = false;\n  }\n}\nfunction flushRootMutations(editor) {\n  const observer = editor._observer;\n  if (observer !== null) {\n    const mutations = observer.takeRecords();\n    flushMutations(editor, mutations, observer);\n  }\n}\nfunction initMutationObserver(editor) {\n  initTextEntryListener(editor);\n  editor._observer = new MutationObserver((mutations, observer) => {\n    flushMutations(editor, mutations, observer);\n  });\n}\n\n/**\n * Get the value type (V) from a StateConfig\n */\n\n/**\n * Get the key type (K) from a StateConfig\n */\n\n/**\n * A value type, or an updater for that value type. For use with\n * {@link $setState} or any user-defined wrappers around it.\n */\n\n/**\n * A type alias to make it easier to define setter methods on your node class\n *\n * @example\n * ```ts\n * const fooState = createState(\"foo\", { parse: ... });\n * class MyClass extends TextNode {\n *   // ...\n *   setFoo(valueOrUpdater: StateValueOrUpdater<typeof fooState>): this {\n *     return $setState(this, fooState, valueOrUpdater);\n *   }\n * }\n * ```\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/* eslint-enable @typescript-eslint/no-explicit-any */\n\n/**\n * The NodeState JSON produced by this LexicalNode\n */\n\n/**\n * Configure a value to be used with StateConfig.\n *\n * The value type should be inferred from the definition of parse.\n *\n * If the value type is not JSON serializable, then unparse must also be provided.\n *\n * Values should be treated as immutable, much like React.useState. Mutating\n * stored values directly will cause unpredictable behavior, is not supported,\n * and may trigger errors in the future.\n *\n * @example\n * ```ts\n * const numberOrNullState = createState('numberOrNull', {parse: (v) => typeof v === 'number' ? v : null});\n * //    ^? State<'numberOrNull', StateValueConfig<number | null>>\n * const numberState = createState('number', {parse: (v) => typeof v === 'number' ? v : 0});\n * //    ^? State<'number', StateValueConfig<number>>\n * ```\n *\n * Only the parse option is required, it is generally not useful to\n * override `unparse` or `isEqual`. However, if you are using\n * non-primitive types such as Array, Object, Date, or something\n * more exotic then you would want to override this. In these\n * cases you might want to reach for third party libraries.\n *\n * @example\n * ```ts\n * const isoDateState = createState('isoDate', {\n *   parse: (v): null | Date => {\n *     const date = typeof v === 'string' ? new Date(v) : null;\n *     return date && !isNaN(date.valueOf()) ? date : null;\n *   }\n *   isEqual: (a, b) => a === b || (a && b && a.valueOf() === b.valueOf()),\n *   unparse: (v) => v && v.toString()\n * });\n * ```\n *\n * You may find it easier to write a parse function using libraries like\n * zod, valibot, ajv, Effect, TypeBox, etc. perhaps with a wrapper function.\n */\n\n/**\n * The return value of {@link createState}, for use with\n * {@link $getState} and {@link $setState}.\n */\nclass StateConfig {\n  /** The string key used when serializing this state to JSON */\n  key;\n  /** The parse function from the StateValueConfig passed to createState */\n  parse;\n  /**\n   * The unparse function from the StateValueConfig passed to createState,\n   * with a default that is simply a pass-through that assumes the value is\n   * JSON serializable.\n   */\n  unparse;\n  /**\n   * An equality function from the StateValueConfig, with a default of\n   * Object.is.\n   */\n  isEqual;\n  /**\n   * The result of `stateValueConfig.parse(undefined)`, which is computed only\n   * once and used as the default value. When the current value `isEqual` to\n   * the `defaultValue`, it will not be serialized to JSON.\n   */\n  defaultValue;\n  resetOnCopyNode;\n  constructor(key, stateValueConfig) {\n    this.key = key;\n    this.parse = stateValueConfig.parse.bind(stateValueConfig);\n    this.unparse = (stateValueConfig.unparse || coerceToJSON).bind(stateValueConfig);\n    this.isEqual = (stateValueConfig.isEqual || Object.is).bind(stateValueConfig);\n    this.defaultValue = this.parse(undefined);\n    this.resetOnCopyNode = stateValueConfig.resetOnCopyNode || false;\n  }\n}\n\n/**\n * For advanced use cases, using this type is not recommended unless\n * it is required (due to TypeScript's lack of features like\n * higher-kinded types).\n *\n * A {@link StateConfig} type with any key and any value that can be\n * used in situations where the key and value type can not be known,\n * such as in a generic constraint when working with a collection of\n * StateConfig.\n *\n * {@link StateConfigKey} and {@link StateConfigValue} will be\n * useful when this is used as a generic constraint.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n/**\n * Create a StateConfig for the given string key and StateValueConfig.\n *\n * The key must be locally unique. In dev you will get a key collision error\n * when you use two separate StateConfig on the same node with the same key.\n *\n * The returned StateConfig value should be used with {@link $getState} and\n * {@link $setState}.\n *\n * @param key The key to use\n * @param valueConfig Configuration for the value type\n * @returns a StateConfig\n *\n * @__NO_SIDE_EFFECTS__\n */\nfunction createState(key, valueConfig) {\n  return new StateConfig(key, valueConfig);\n}\n\n/**\n * The accessor for working with node state. This will read the value for the\n * state on the given node, and will return `stateConfig.defaultValue` if the\n * state has never been set on this node.\n *\n * The `version` parameter is optional and should generally be `'latest'`,\n * consistent with the behavior of other node methods and functions,\n * but for certain use cases such as `updateDOM` you may have a need to\n * use `'direct'` to read the state from a previous version of the node.\n *\n * For very advanced use cases, you can expect that 'direct' does not\n * require an editor state, just like directly accessing other properties\n * of a node without an accessor (e.g. `textNode.__text`).\n *\n * @param node Any LexicalNode\n * @param stateConfig The configuration of the state to read\n * @param version The default value 'latest' will read the latest version of the node state, 'direct' will read the version that is stored on this LexicalNode which not reflect the version used in the current editor state\n * @returns The current value from the state, or the default value provided by the configuration.\n */\nfunction $getState(node, stateConfig, version = 'latest') {\n  const latestOrDirectNode = version === 'latest' ? node.getLatest() : node;\n  const state = latestOrDirectNode.__state;\n  if (state) {\n    $checkCollision(node, stateConfig, state);\n    return state.getValue(stateConfig);\n  }\n  return stateConfig.defaultValue;\n}\n\n/**\n * Given two versions of a node and a stateConfig, compare their state values\n * using `$getState(nodeVersion, stateConfig, 'direct')`.\n * If the values are equal according to `stateConfig.isEqual`, return `null`,\n * otherwise return `[value, prevValue]`.\n *\n * This is useful for implementing updateDOM. Note that the `'direct'`\n * version argument is used for both nodes.\n *\n * @param node Any LexicalNode\n * @param prevNode A previous version of node\n * @param stateConfig The configuration of the state to read\n * @returns `[value, prevValue]` if changed, otherwise `null`\n */\nfunction $getStateChange(node, prevNode, stateConfig) {\n  const value = $getState(node, stateConfig, 'direct');\n  const prevValue = $getState(prevNode, stateConfig, 'direct');\n  return stateConfig.isEqual(value, prevValue) ? null : [value, prevValue];\n}\n\n/**\n * Set the state defined by stateConfig on node. Like with `React.useState`\n * you may directly specify the value or use an updater function that will\n * be called with the previous value of the state on that node (which will\n * be the `stateConfig.defaultValue` if not set).\n *\n * When an updater function is used, the node will only be marked dirty if\n * `stateConfig.isEqual(prevValue, value)` is false.\n *\n * @example\n * ```ts\n * const toggle = createState('toggle', {parse: Boolean});\n * // set it direction\n * $setState(node, counterState, true);\n * // use an updater\n * $setState(node, counterState, (prev) => !prev);\n * ```\n *\n * @param node The LexicalNode to set the state on\n * @param stateConfig The configuration for this state\n * @param valueOrUpdater The value or updater function\n * @returns node\n */\nfunction $setState(node, stateConfig, valueOrUpdater) {\n  errorOnReadOnly();\n  let value;\n  if (typeof valueOrUpdater === 'function') {\n    const latest = node.getLatest();\n    const prevValue = $getState(latest, stateConfig);\n    value = valueOrUpdater(prevValue);\n    if (stateConfig.isEqual(prevValue, value)) {\n      return latest;\n    }\n  } else {\n    value = valueOrUpdater;\n  }\n  const writable = node.getWritable();\n  const state = $getWritableNodeState(writable);\n  $checkCollision(node, stateConfig, state);\n  state.updateFromKnown(stateConfig, value);\n  return writable;\n}\n\n/**\n * @internal\n *\n * Register the config to this node's sharedConfigMap and throw an exception in\n * `true` when a collision is detected.\n */\nfunction $checkCollision(node, stateConfig, state) {\n  {\n    const collision = state.sharedNodeState.sharedConfigMap.get(stateConfig.key);\n    if (collision !== undefined && collision !== stateConfig) {\n      {\n        formatDevErrorMessage(`$setState: State key collision ${JSON.stringify(stateConfig.key)} detected in ${node.constructor.name} node with type ${node.getType()} and key ${node.getKey()}. Only one StateConfig with a given key should be used on a node.`);\n      }\n    }\n  }\n}\n\n/**\n * @internal\n *\n * Opaque state to be stored on the editor's RegisterNode for use by NodeState\n */\n\n/**\n * @internal\n *\n * Create the state to store on RegisteredNode\n */\nfunction createSharedNodeState(nodeConfig) {\n  const sharedConfigMap = new Map();\n  const flatKeys = new Set();\n  for (let klass = typeof nodeConfig === 'function' ? nodeConfig : nodeConfig.replace; klass.prototype && klass.prototype.getType !== undefined; klass = Object.getPrototypeOf(klass)) {\n    const {\n      ownNodeConfig\n    } = getStaticNodeConfig(klass);\n    if (ownNodeConfig && ownNodeConfig.stateConfigs) {\n      for (const requiredStateConfig of ownNodeConfig.stateConfigs) {\n        let stateConfig;\n        if ('stateConfig' in requiredStateConfig) {\n          stateConfig = requiredStateConfig.stateConfig;\n          if (requiredStateConfig.flat) {\n            flatKeys.add(stateConfig.key);\n          }\n        } else {\n          stateConfig = requiredStateConfig;\n        }\n        sharedConfigMap.set(stateConfig.key, stateConfig);\n      }\n    }\n  }\n  return {\n    flatKeys,\n    sharedConfigMap\n  };\n}\n\n/**\n * @internal\n *\n * A Map of string keys to state configurations to be shared across nodes\n * and/or node versions.\n */\n\n/**\n * @internal\n */\nclass NodeState {\n  /**\n   * @internal\n   *\n   * Track the (versioned) node that this NodeState was created for, to\n   * facilitate copy-on-write for NodeState. When a LexicalNode is cloned,\n   * it will *reference* the NodeState from its prevNode. From the nextNode\n   * you can continue to read state without copying, but the first $setState\n   * will trigger a copy of the prevNode's NodeState with the node property\n   * updated.\n   */\n  node;\n\n  /**\n   * @internal\n   *\n   * State that has already been parsed in a get state, so it is safe. (can be returned with\n   * just a cast since the proof was given before).\n   *\n   * Note that it uses StateConfig, so in addition to (1) the CURRENT VALUE, it has access to\n   * (2) the State key (3) the DEFAULT VALUE and (4) the PARSE FUNCTION\n   */\n  knownState;\n\n  /**\n   * @internal\n   *\n   * A copy of serializedNode[NODE_STATE_KEY] that is made when JSON is\n   * imported but has not been parsed yet.\n   *\n   * It stays here until a get state requires us to parse it, and since we\n   * then know the value is safe we move it to knownState.\n   *\n   * Note that since only string keys are used here, we can only allow this\n   * state to pass-through on export or on the next version since there is\n   * no known value configuration. This pass-through is to support scenarios\n   * where multiple versions of the editor code are working in parallel so\n   * an old version of your code doesnt erase metadata that was\n   * set by a newer version of your code.\n   */\n  unknownState;\n\n  /**\n   * @internal\n   *\n   * This sharedNodeState is preserved across all instances of a given\n   * node type in an editor and remains writable. It is how keys are resolved\n   * to configuration.\n   */\n  sharedNodeState;\n  /**\n   * @internal\n   *\n   * The count of known or unknown keys in this state, ignoring the\n   * intersection between the two sets.\n   */\n  size;\n\n  /**\n   * @internal\n   */\n  constructor(node, sharedNodeState, unknownState = undefined, knownState = new Map(), size = undefined) {\n    this.node = node;\n    this.sharedNodeState = sharedNodeState;\n    this.unknownState = unknownState;\n    this.knownState = knownState;\n    const {\n      sharedConfigMap\n    } = this.sharedNodeState;\n    const computedSize = size !== undefined ? size : computeSize(sharedConfigMap, unknownState, knownState);\n    {\n      if (!(size === undefined || computedSize === size)) {\n        formatDevErrorMessage(`NodeState: size != computedSize (${String(size)} != ${String(computedSize)})`);\n      }\n      for (const stateConfig of knownState.keys()) {\n        if (!sharedConfigMap.has(stateConfig.key)) {\n          formatDevErrorMessage(`NodeState: sharedConfigMap missing knownState key ${stateConfig.key}`);\n        }\n      }\n    }\n    this.size = computedSize;\n  }\n\n  /**\n   * @internal\n   *\n   * Get the value from knownState, or parse it from unknownState\n   * if it contains the given key.\n   *\n   * Updates the sharedConfigMap when no known state is found.\n   * Updates unknownState and knownState when an unknownState is parsed.\n   */\n  getValue(stateConfig) {\n    const known = this.knownState.get(stateConfig);\n    if (known !== undefined) {\n      return known;\n    }\n    this.sharedNodeState.sharedConfigMap.set(stateConfig.key, stateConfig);\n    let parsed = stateConfig.defaultValue;\n    if (this.unknownState && stateConfig.key in this.unknownState) {\n      const jsonValue = this.unknownState[stateConfig.key];\n      if (jsonValue !== undefined) {\n        parsed = stateConfig.parse(jsonValue);\n      }\n      // Only update if the key was unknown\n      this.updateFromKnown(stateConfig, parsed);\n    }\n    return parsed;\n  }\n\n  /**\n   * @internal\n   *\n   * Used only for advanced use cases, such as collab. The intent here is to\n   * allow you to diff states with a more stable interface than the properties\n   * of this class.\n   */\n  getInternalState() {\n    return [this.unknownState, this.knownState];\n  }\n\n  /**\n   * Encode this NodeState to JSON in the format that its node expects.\n   * This returns `{[NODE_STATE_KEY]?: UnknownStateRecord}` rather than\n   * `UnknownStateRecord | undefined` so that we can support flattening\n   * specific entries in the future when nodes can declare what\n   * their required StateConfigs are.\n   */\n  toJSON() {\n    const state = {\n      ...this.unknownState\n    };\n    const flatState = {};\n    for (const [stateConfig, v] of this.knownState) {\n      if (stateConfig.isEqual(v, stateConfig.defaultValue)) {\n        delete state[stateConfig.key];\n      } else {\n        state[stateConfig.key] = stateConfig.unparse(v);\n      }\n    }\n    for (const key of this.sharedNodeState.flatKeys) {\n      if (key in state) {\n        flatState[key] = state[key];\n        delete state[key];\n      }\n    }\n    if (undefinedIfEmpty(state)) {\n      flatState[NODE_STATE_KEY] = state;\n    }\n    return flatState;\n  }\n\n  /**\n   * @internal\n   *\n   * A NodeState is writable when the node to update matches\n   * the node associated with the NodeState. This basically\n   * mirrors how the EditorState NodeMap works, but in a\n   * bottom-up organization rather than a top-down organization.\n   *\n   * This allows us to implement the same \"copy on write\"\n   * pattern for state, without having the state version\n   * update every time the node version changes (e.g. when\n   * its parent or siblings change).\n   *\n   * @param node The node to associate with the state\n   * @returns The next writable state\n   */\n  getWritable(node) {\n    if (this.node === node) {\n      return this;\n    }\n    const {\n      sharedNodeState,\n      unknownState\n    } = this;\n    const nextKnownState = new Map(this.knownState);\n    return new NodeState(node, sharedNodeState, parseAndPruneNextUnknownState(sharedNodeState.sharedConfigMap, nextKnownState, unknownState), nextKnownState, this.size);\n  }\n\n  /** @internal */\n  resetOnCopyNode() {\n    for (const stateConfig of this.knownState.keys()) {\n      if (stateConfig.resetOnCopyNode) {\n        this.knownState.set(stateConfig, stateConfig.defaultValue);\n      }\n    }\n    return this;\n  }\n\n  /** @internal */\n  updateFromKnown(stateConfig, value) {\n    const key = stateConfig.key;\n    this.sharedNodeState.sharedConfigMap.set(key, stateConfig);\n    const {\n      knownState,\n      unknownState\n    } = this;\n    if (!(knownState.has(stateConfig) || unknownState && key in unknownState)) {\n      if (unknownState) {\n        delete unknownState[key];\n        this.unknownState = undefinedIfEmpty(unknownState);\n      }\n      this.size++;\n    }\n    knownState.set(stateConfig, value);\n  }\n\n  /**\n   * @internal\n   *\n   * This is intended for advanced use cases only, such\n   * as collab or dev tools.\n   *\n   * Update a single key value pair from unknown state,\n   * parsing it if the key is known to this node. This is\n   * basically like updateFromJSON, but the effect is\n   * isolated to a single entry.\n   *\n   * @param k The string key from an UnknownStateRecord\n   * @param v The unknown value from an UnknownStateRecord\n   */\n  updateFromUnknown(k, v) {\n    const stateConfig = this.sharedNodeState.sharedConfigMap.get(k);\n    if (stateConfig) {\n      this.updateFromKnown(stateConfig, stateConfig.parse(v));\n    } else {\n      this.unknownState = this.unknownState || {};\n      if (!(k in this.unknownState)) {\n        this.size++;\n      }\n      this.unknownState[k] = v;\n    }\n  }\n\n  /**\n   * @internal\n   *\n   * Reset all existing state to default or empty values,\n   * and perform any updates from the given unknownState.\n   *\n   * This is used when initializing a node's state from JSON,\n   * or when resetting a node's state from JSON.\n   *\n   * @param unknownState The new state in serialized form\n   */\n  updateFromJSON(unknownState) {\n    const {\n      knownState\n    } = this;\n    // Reset all known state to defaults\n    for (const stateConfig of knownState.keys()) {\n      knownState.set(stateConfig, stateConfig.defaultValue);\n    }\n    // Since we are resetting all state to this new record,\n    // the size starts at the number of known keys\n    // and will be updated as we traverse the new state\n    this.size = knownState.size;\n    this.unknownState = undefined;\n    if (unknownState) {\n      for (const [k, v] of Object.entries(unknownState)) {\n        this.updateFromUnknown(k, v);\n      }\n    }\n  }\n}\n\n/**\n * @internal\n *\n * Only for direct use in very advanced integrations, such as lexical-yjs.\n * Typically you would only use {@link createState}, {@link $getState}, and\n * {@link $setState}. This is effectively the preamble for {@link $setState}.\n */\nfunction $getWritableNodeState(node) {\n  const writable = node.getWritable();\n  const state = writable.__state ? writable.__state.getWritable(writable) : new NodeState(writable, $getSharedNodeState(writable));\n  writable.__state = state;\n  return state;\n}\n\n/**\n * @internal\n *\n * Get the SharedNodeState for a node on this editor\n */\nfunction $getSharedNodeState(node) {\n  return node.__state ? node.__state.sharedNodeState : getRegisteredNodeOrThrow($getEditor(), node.getType()).sharedNodeState;\n}\n\n/**\n * @internal\n *\n * This is used to implement LexicalNode.updateFromJSON and is\n * not intended to be exported from the package.\n *\n * @param node any LexicalNode\n * @param unknownState undefined or a serialized State\n * @returns A writable version of node, with the state set.\n */\nfunction $updateStateFromJSON(node, serialized) {\n  const writable = node.getWritable();\n  const unknownState = serialized[NODE_STATE_KEY];\n  let parseState = unknownState;\n  for (const k of $getSharedNodeState(writable).flatKeys) {\n    if (k in serialized) {\n      if (parseState === undefined || parseState === unknownState) {\n        parseState = {\n          ...unknownState\n        };\n      }\n      parseState[k] = serialized[k];\n    }\n  }\n  if (writable.__state || parseState) {\n    $getWritableNodeState(node).updateFromJSON(parseState);\n  }\n  return writable;\n}\n\n/**\n * @internal\n *\n * Return true if the two nodes have equivalent NodeState, to be used\n * to determine when TextNode are being merged, not a lot of use cases\n * otherwise.\n */\nfunction nodeStatesAreEquivalent(a, b) {\n  if (a === b) {\n    return true;\n  }\n  const keys = new Set();\n  return !(a && hasUnequalMapEntry(keys, a, b) || b && hasUnequalMapEntry(keys, b, a) || a && hasUnequalRecordEntry(keys, a, b) || b && hasUnequalRecordEntry(keys, b, a));\n}\n\n/**\n * Compute the number of distinct keys that will be in a NodeState\n */\nfunction computeSize(sharedConfigMap, unknownState, knownState) {\n  let size = knownState.size;\n  if (unknownState) {\n    for (const k in unknownState) {\n      const sharedConfig = sharedConfigMap.get(k);\n      if (!sharedConfig || !knownState.has(sharedConfig)) {\n        size++;\n      }\n    }\n  }\n  return size;\n}\n\n/**\n * @internal\n *\n * Return obj if it is an object with at least one property, otherwise\n * return undefined.\n */\nfunction undefinedIfEmpty(obj) {\n  if (obj) {\n    for (const key in obj) {\n      return obj;\n    }\n  }\n  return undefined;\n}\n\n/**\n * @internal\n *\n * Cast the given v to unknown\n */\nfunction coerceToJSON(v) {\n  return v;\n}\n\n/**\n * @internal\n *\n * Parse all knowable values in an UnknownStateRecord into nextKnownState\n * and return the unparsed values in a new UnknownStateRecord. Returns\n * undefined if no unknown values remain.\n */\nfunction parseAndPruneNextUnknownState(sharedConfigMap, nextKnownState, unknownState) {\n  let nextUnknownState = undefined;\n  if (unknownState) {\n    for (const [k, v] of Object.entries(unknownState)) {\n      const stateConfig = sharedConfigMap.get(k);\n      if (stateConfig) {\n        if (!nextKnownState.has(stateConfig)) {\n          nextKnownState.set(stateConfig, stateConfig.parse(v));\n        }\n      } else {\n        nextUnknownState = nextUnknownState || {};\n        nextUnknownState[k] = v;\n      }\n    }\n  }\n  return nextUnknownState;\n}\n\n/**\n * @internal\n *\n * Compare each entry of sourceState.knownState that is not in keys to\n * otherState (or the default value if otherState is undefined.\n * Note that otherState will return the defaultValue as well if it\n * has never been set. Any checked entry's key will be added to keys.\n *\n * @returns true if any difference is found, false otherwise\n */\nfunction hasUnequalMapEntry(keys, sourceState, otherState) {\n  for (const [stateConfig, value] of sourceState.knownState) {\n    if (keys.has(stateConfig.key)) {\n      continue;\n    }\n    keys.add(stateConfig.key);\n    const otherValue = otherState ? otherState.getValue(stateConfig) : stateConfig.defaultValue;\n    if (otherValue !== value && !stateConfig.isEqual(otherValue, value)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * @internal\n *\n * Compare each entry of sourceState.unknownState that is not in keys to\n * otherState.unknownState (or undefined if otherState is undefined).\n * Any checked entry's key will be added to keys.\n *\n * Notably since we have already checked hasUnequalMapEntry on both sides,\n * we do not do any parsing or checking of knownState.\n *\n * @returns true if any difference is found, false otherwise\n */\nfunction hasUnequalRecordEntry(keys, sourceState, otherState) {\n  const {\n    unknownState\n  } = sourceState;\n  const otherUnknownState = otherState ? otherState.unknownState : undefined;\n  if (unknownState) {\n    for (const [key, value] of Object.entries(unknownState)) {\n      if (keys.has(key)) {\n        continue;\n      }\n      keys.add(key);\n      const otherValue = otherUnknownState ? otherUnknownState[key] : undefined;\n      if (value !== otherValue) {\n        return true;\n      }\n    }\n  }\n  return false;\n}\n\n/**\n * @internal\n *\n * Clones the NodeState for a given node. Handles aliasing if the state references the from node.\n */\nfunction $cloneNodeState(from, to) {\n  const state = from.__state;\n  return state && state.node === from ? state.getWritable(to) : state;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction $canSimpleTextNodesBeMerged(node1, node2) {\n  const node1Mode = node1.__mode;\n  const node1Format = node1.__format;\n  const node1Style = node1.__style;\n  const node2Mode = node2.__mode;\n  const node2Format = node2.__format;\n  const node2Style = node2.__style;\n  const node1State = node1.__state;\n  const node2State = node2.__state;\n  return (node1Mode === null || node1Mode === node2Mode) && (node1Format === null || node1Format === node2Format) && (node1Style === null || node1Style === node2Style) && (node1.__state === null || node1State === node2State || nodeStatesAreEquivalent(node1State, node2State));\n}\nfunction $mergeTextNodes(node1, node2) {\n  const writableNode1 = node1.mergeWithSibling(node2);\n  const normalizedNodes = getActiveEditor()._normalizedNodes;\n  normalizedNodes.add(node1.__key);\n  normalizedNodes.add(node2.__key);\n  return writableNode1;\n}\nfunction $normalizeTextNode(textNode) {\n  let node = textNode;\n  if (node.__text === '' && node.isSimpleText() && !node.isUnmergeable()) {\n    node.remove();\n    return;\n  }\n\n  // Backward\n  let previousNode;\n  while ((previousNode = node.getPreviousSibling()) !== null && $isTextNode(previousNode) && previousNode.isSimpleText() && !previousNode.isUnmergeable()) {\n    if (previousNode.__text === '') {\n      previousNode.remove();\n    } else if ($canSimpleTextNodesBeMerged(previousNode, node)) {\n      node = $mergeTextNodes(previousNode, node);\n      break;\n    } else {\n      break;\n    }\n  }\n\n  // Forward\n  let nextNode;\n  while ((nextNode = node.getNextSibling()) !== null && $isTextNode(nextNode) && nextNode.isSimpleText() && !nextNode.isUnmergeable()) {\n    if (nextNode.__text === '') {\n      nextNode.remove();\n    } else if ($canSimpleTextNodesBeMerged(node, nextNode)) {\n      node = $mergeTextNodes(node, nextNode);\n      break;\n    } else {\n      break;\n    }\n  }\n}\nfunction $normalizeSelection(selection) {\n  $normalizePoint(selection.anchor);\n  $normalizePoint(selection.focus);\n  return selection;\n}\nfunction $normalizePoint(point) {\n  while (point.type === 'element') {\n    const node = point.getNode();\n    const offset = point.offset;\n    let nextNode;\n    let nextOffsetAtEnd;\n    if (offset === node.getChildrenSize()) {\n      nextNode = node.getChildAtIndex(offset - 1);\n      nextOffsetAtEnd = true;\n    } else {\n      nextNode = node.getChildAtIndex(offset);\n      nextOffsetAtEnd = false;\n    }\n    if ($isTextNode(nextNode)) {\n      point.set(nextNode.__key, nextOffsetAtEnd ? nextNode.getTextContentSize() : 0, 'text', true);\n      break;\n    } else if (!$isElementNode(nextNode)) {\n      break;\n    }\n    point.set(nextNode.__key, nextOffsetAtEnd ? nextNode.getChildrenSize() : 0, 'element', true);\n  }\n}\n\nlet subTreeTextContent = '';\nlet subTreeTextFormat = null;\nlet subTreeTextStyle = null;\nlet activeEditorConfig;\nlet activeEditor$1;\nlet activeEditorNodes;\nlet treatAllNodesAsDirty = false;\nlet activeEditorStateReadOnly = false;\nlet activeMutationListeners;\nlet activeDirtyElements;\nlet activeDirtyLeaves;\nlet activePrevNodeMap;\nlet activeNextNodeMap;\nlet activePrevKeyToDOMMap;\nlet mutatedNodes;\nlet activeEditorDOMRenderConfig;\nfunction $destroyNode(key, parentDOM) {\n  const node = activePrevNodeMap.get(key);\n  if (parentDOM !== null) {\n    const dom = getPrevElementByKeyOrThrow(key);\n    if (dom.parentNode === parentDOM) {\n      parentDOM.removeChild(dom);\n    }\n  }\n\n  // This logic is really important, otherwise we will leak DOM nodes\n  // when their corresponding LexicalNodes are removed from the editor state.\n  if (!activeNextNodeMap.has(key)) {\n    activeEditor$1._keyToDOMMap.delete(key);\n  }\n  if ($isElementNode(node)) {\n    const children = $createChildrenArray(node, activePrevNodeMap);\n    $destroyChildren(children, 0, children.length - 1, null);\n  }\n  if (node !== undefined) {\n    setMutatedNode(mutatedNodes, activeEditorNodes, activeMutationListeners, node, 'destroyed');\n  }\n}\nfunction $destroyChildren(children, _startIndex, endIndex, dom) {\n  for (let startIndex = _startIndex; startIndex <= endIndex; ++startIndex) {\n    const child = children[startIndex];\n    if (child !== undefined) {\n      $destroyNode(child, dom);\n    }\n  }\n}\nfunction setTextAlign(domStyle, value) {\n  domStyle.setProperty('text-align', value);\n}\nconst DEFAULT_INDENT_VALUE = '40px';\nfunction setElementIndent(dom, indent) {\n  const indentClassName = activeEditorConfig.theme.indent;\n  if (typeof indentClassName === 'string') {\n    const elementHasClassName = dom.classList.contains(indentClassName);\n    if (indent > 0 && !elementHasClassName) {\n      dom.classList.add(indentClassName);\n    } else if (indent < 1 && elementHasClassName) {\n      dom.classList.remove(indentClassName);\n    }\n  }\n  if (indent === 0) {\n    dom.style.setProperty('padding-inline-start', '');\n    return;\n  }\n  const indentationBaseValue = getComputedStyle(activeEditor$1._rootElement || dom).getPropertyValue('--lexical-indent-base-value') || DEFAULT_INDENT_VALUE;\n  dom.style.setProperty('padding-inline-start', `calc(${indent} * ${indentationBaseValue})`);\n}\nfunction setElementFormat(dom, format) {\n  const domStyle = dom.style;\n  if (format === 0) {\n    setTextAlign(domStyle, '');\n  } else if (format === IS_ALIGN_LEFT) {\n    setTextAlign(domStyle, 'left');\n  } else if (format === IS_ALIGN_CENTER) {\n    setTextAlign(domStyle, 'center');\n  } else if (format === IS_ALIGN_RIGHT) {\n    setTextAlign(domStyle, 'right');\n  } else if (format === IS_ALIGN_JUSTIFY) {\n    setTextAlign(domStyle, 'justify');\n  } else if (format === IS_ALIGN_START) {\n    setTextAlign(domStyle, 'start');\n  } else if (format === IS_ALIGN_END) {\n    setTextAlign(domStyle, 'end');\n  }\n}\nfunction $getReconciledDirection(node) {\n  const direction = node.__dir;\n  if (direction !== null) {\n    return direction;\n  }\n  if ($isRootNode(node)) {\n    return null;\n  }\n  const parent = node.getParentOrThrow();\n  if (!$isRootNode(parent) || parent.__dir !== null) {\n    return null;\n  }\n  return 'auto';\n}\nfunction $setElementDirection(dom, node) {\n  const direction = $getReconciledDirection(node);\n  if (direction !== null) {\n    dom.dir = direction;\n  } else {\n    dom.removeAttribute('dir');\n  }\n}\nfunction $createNode(key, slot) {\n  const node = activeNextNodeMap.get(key);\n  if (node === undefined) {\n    {\n      formatDevErrorMessage(`createNode: node does not exist in nodeMap`);\n    }\n  }\n  const dom = activeEditorDOMRenderConfig.$createDOM(node, activeEditor$1);\n  storeDOMWithKey(key, dom, activeEditor$1);\n\n  // This helps preserve the text, and stops spell check tools from\n  // merging or break the spans (which happens if they are missing\n  // this attribute).\n  if ($isTextNode(node)) {\n    dom.setAttribute('data-lexical-text', 'true');\n  } else if ($isDecoratorNode(node)) {\n    dom.setAttribute('data-lexical-decorator', 'true');\n  }\n  if ($isElementNode(node)) {\n    const indent = node.__indent;\n    const childrenSize = node.__size;\n    $setElementDirection(dom, node);\n    if (indent !== 0) {\n      setElementIndent(dom, indent);\n    }\n    if (childrenSize !== 0) {\n      const endIndex = childrenSize - 1;\n      const children = $createChildrenArray(node, activeNextNodeMap);\n      $createChildren(children, node, 0, endIndex, activeEditorDOMRenderConfig.$getDOMSlot(node, dom, activeEditor$1));\n    }\n    const format = node.__format;\n    if (format !== 0) {\n      setElementFormat(dom, format);\n    }\n    if (!node.isInline()) {\n      $reconcileElementTerminatingLineBreak(null, node, dom);\n    }\n  } else {\n    const text = node.getTextContent();\n    if ($isDecoratorNode(node)) {\n      const decorator = node.decorate(activeEditor$1, activeEditorConfig);\n      if (decorator !== null) {\n        reconcileDecorator(key, decorator);\n      }\n      // Decorators are always non editable\n      dom.contentEditable = 'false';\n    }\n    subTreeTextContent += text;\n  }\n  if (slot !== null) {\n    slot.insertChild(dom);\n  }\n  activeEditorDOMRenderConfig.$decorateDOM(node, null, dom, activeEditor$1);\n  {\n    // Freeze the node in DEV to prevent accidental mutations\n    Object.freeze(node);\n  }\n  setMutatedNode(mutatedNodes, activeEditorNodes, activeMutationListeners, node, 'created');\n  return dom;\n}\nfunction $createChildren(children, element, _startIndex, endIndex, slot) {\n  const previousSubTreeTextContent = subTreeTextContent;\n  subTreeTextContent = '';\n  let startIndex = _startIndex;\n  for (; startIndex <= endIndex; ++startIndex) {\n    $createNode(children[startIndex], slot);\n    const node = activeNextNodeMap.get(children[startIndex]);\n    if (node !== null && $isTextNode(node)) {\n      if (subTreeTextFormat === null) {\n        subTreeTextFormat = node.getFormat();\n        subTreeTextStyle = node.getStyle();\n      }\n    } else if (\n    // inline $textContentRequiresDoubleLinebreakAtEnd\n    $isElementNode(node) && startIndex < endIndex && !node.isInline()) {\n      subTreeTextContent += DOUBLE_LINE_BREAK;\n    }\n  }\n  const dom = slot.element;\n  dom.__lexicalTextContent = subTreeTextContent;\n  subTreeTextContent = previousSubTreeTextContent + subTreeTextContent;\n}\nfunction isLastChildLineBreakOrDecorator(element, nodeMap) {\n  if (element) {\n    const lastKey = element.__last;\n    if (lastKey) {\n      const node = nodeMap.get(lastKey);\n      if (node) {\n        return $isLineBreakNode(node) ? 'line-break' : $isDecoratorNode(node) && node.isInline() ? 'decorator' : null;\n      }\n    }\n    return 'empty';\n  }\n  return null;\n}\n\n// If we end an element with a LineBreakNode, then we need to add an additional <br>\nfunction $reconcileElementTerminatingLineBreak(prevElement, nextElement, dom) {\n  const prevLineBreak = isLastChildLineBreakOrDecorator(prevElement, activePrevNodeMap);\n  const nextLineBreak = isLastChildLineBreakOrDecorator(nextElement, activeNextNodeMap);\n  if (prevLineBreak !== nextLineBreak) {\n    activeEditorDOMRenderConfig.$getDOMSlot(nextElement, dom, activeEditor$1).setManagedLineBreak(nextLineBreak);\n  }\n}\nfunction reconcileTextFormat(element) {\n  if (subTreeTextFormat != null && subTreeTextFormat !== element.__textFormat && !activeEditorStateReadOnly) {\n    element.setTextFormat(subTreeTextFormat);\n  }\n}\nfunction reconcileTextStyle(element) {\n  if (subTreeTextStyle != null && subTreeTextStyle !== element.__textStyle && !activeEditorStateReadOnly) {\n    element.setTextStyle(subTreeTextStyle);\n  }\n}\nfunction $reconcileChildrenWithDirection(prevElement, nextElement, dom) {\n  subTreeTextFormat = null;\n  subTreeTextStyle = null;\n  $reconcileChildren(prevElement, nextElement, activeEditorDOMRenderConfig.$getDOMSlot(nextElement, dom, activeEditor$1));\n  reconcileTextFormat(nextElement);\n  reconcileTextStyle(nextElement);\n}\nfunction $reconcileChildren(prevElement, nextElement, slot) {\n  const previousSubTreeTextContent = subTreeTextContent;\n  const prevChildrenSize = prevElement.__size;\n  const nextChildrenSize = nextElement.__size;\n  subTreeTextContent = '';\n  const dom = slot.element;\n  if (prevChildrenSize === 1 && nextChildrenSize === 1) {\n    const prevFirstChildKey = prevElement.__first;\n    const nextFirstChildKey = nextElement.__first;\n    if (prevFirstChildKey === nextFirstChildKey) {\n      $reconcileNode(prevFirstChildKey, dom);\n    } else {\n      const lastDOM = getPrevElementByKeyOrThrow(prevFirstChildKey);\n      const replacementDOM = $createNode(nextFirstChildKey, null);\n      try {\n        dom.replaceChild(replacementDOM, lastDOM);\n      } catch (error) {\n        if (typeof error === 'object' && error != null) {\n          const msg = `${error.toString()} Parent: ${dom.tagName}, new child: {tag: ${replacementDOM.tagName} key: ${nextFirstChildKey}}, old child: {tag: ${lastDOM.tagName}, key: ${prevFirstChildKey}}.`;\n          throw new Error(msg);\n        } else {\n          throw error;\n        }\n      }\n      $destroyNode(prevFirstChildKey, null);\n    }\n    const nextChildNode = activeNextNodeMap.get(nextFirstChildKey);\n    if ($isTextNode(nextChildNode)) {\n      if (subTreeTextFormat === null) {\n        subTreeTextFormat = nextChildNode.getFormat();\n        subTreeTextStyle = nextChildNode.getStyle();\n      }\n    }\n  } else {\n    const prevChildren = $createChildrenArray(prevElement, activePrevNodeMap);\n    const nextChildren = $createChildrenArray(nextElement, activeNextNodeMap);\n    if (!(prevChildren.length === prevChildrenSize)) {\n      formatDevErrorMessage(`$reconcileChildren: prevChildren.length !== prevChildrenSize`);\n    }\n    if (!(nextChildren.length === nextChildrenSize)) {\n      formatDevErrorMessage(`$reconcileChildren: nextChildren.length !== nextChildrenSize`);\n    }\n    if (prevChildrenSize === 0) {\n      if (nextChildrenSize !== 0) {\n        $createChildren(nextChildren, nextElement, 0, nextChildrenSize - 1, slot);\n      }\n    } else if (nextChildrenSize === 0) {\n      if (prevChildrenSize !== 0) {\n        const canUseFastPath = slot.after == null && slot.before == null && slot.element.__lexicalLineBreak == null;\n        $destroyChildren(prevChildren, 0, prevChildrenSize - 1, canUseFastPath ? null : dom);\n        if (canUseFastPath) {\n          // Fast path for removing DOM nodes\n          dom.textContent = '';\n        }\n      }\n    } else {\n      $reconcileNodeChildren(nextElement, prevChildren, nextChildren, prevChildrenSize, nextChildrenSize, slot);\n    }\n  }\n  dom.__lexicalTextContent = subTreeTextContent;\n  subTreeTextContent = previousSubTreeTextContent + subTreeTextContent;\n}\nfunction $reconcileNode(key, parentDOM) {\n  const prevNode = activePrevNodeMap.get(key);\n  let nextNode = activeNextNodeMap.get(key);\n  if (prevNode === undefined || nextNode === undefined) {\n    {\n      formatDevErrorMessage(`reconcileNode: prevNode or nextNode does not exist in nodeMap`);\n    }\n  }\n  const isDirty = treatAllNodesAsDirty || activeDirtyLeaves.has(key) || activeDirtyElements.has(key);\n  const dom = getElementByKeyOrThrow(activeEditor$1, key);\n\n  // If the node key points to the same instance in both states\n  // and isn't dirty, we just update the text content cache\n  // and return the existing DOM Node.\n  if (prevNode === nextNode && !isDirty) {\n    let text;\n    if ($isElementNode(prevNode)) {\n      const previousSubTreeTextContent = dom.__lexicalTextContent;\n      if (typeof previousSubTreeTextContent === 'string') {\n        text = previousSubTreeTextContent;\n      } else {\n        text = prevNode.getTextContent();\n        dom.__lexicalTextContent = text;\n      }\n    } else {\n      text = prevNode.getTextContent();\n    }\n    subTreeTextContent += text;\n    return dom;\n  }\n  // If the node key doesn't point to the same instance in both maps,\n  // it was cloned. If it's also dirty, we mark it as mutated.\n  if (prevNode !== nextNode && isDirty) {\n    setMutatedNode(mutatedNodes, activeEditorNodes, activeMutationListeners, nextNode, 'updated');\n  }\n\n  // Update node. If it returns true, we need to unmount and re-create the node\n  if (activeEditorDOMRenderConfig.$updateDOM(nextNode, prevNode, dom, activeEditor$1)) {\n    const replacementDOM = $createNode(key, null);\n    if (parentDOM === null) {\n      {\n        formatDevErrorMessage(`reconcileNode: parentDOM is null`);\n      }\n    }\n    parentDOM.replaceChild(replacementDOM, dom);\n    $destroyNode(key, null);\n    return replacementDOM;\n  }\n  if ($isElementNode(prevNode)) {\n    if (!$isElementNode(nextNode)) {\n      formatDevErrorMessage(`Node with key ${key} changed from ElementNode to !ElementNode`);\n    }\n    const nextIndent = nextNode.__indent;\n    if (treatAllNodesAsDirty || nextIndent !== prevNode.__indent) {\n      setElementIndent(dom, nextIndent);\n    }\n    const nextFormat = nextNode.__format;\n    if (treatAllNodesAsDirty || nextFormat !== prevNode.__format) {\n      setElementFormat(dom, nextFormat);\n    }\n    if (isDirty) {\n      $reconcileChildrenWithDirection(prevNode, nextNode, dom);\n      if (!$isRootNode(nextNode) && !nextNode.isInline()) {\n        $reconcileElementTerminatingLineBreak(prevNode, nextNode, dom);\n      }\n    } else {\n      const previousSubTreeTextContent = dom.__lexicalTextContent;\n      let text;\n      if (typeof previousSubTreeTextContent === 'string') {\n        text = previousSubTreeTextContent;\n      } else {\n        text = prevNode.getTextContent();\n        dom.__lexicalTextContent = text;\n      }\n      subTreeTextContent += text;\n    }\n    if (treatAllNodesAsDirty || nextNode.__dir !== prevNode.__dir) {\n      $setElementDirection(dom, nextNode);\n      if (\n      // Root node direction changing from set to unset (or vice versa)\n      // changes how children's direction is calculated.\n      $isRootNode(nextNode) &&\n      // Can skip if all children already reconciled.\n      !treatAllNodesAsDirty) {\n        for (const child of nextNode.getChildren()) {\n          if ($isElementNode(child)) {\n            const childDom = getElementByKeyOrThrow(activeEditor$1, child.getKey());\n            $setElementDirection(childDom, child);\n          }\n        }\n      }\n    }\n  } else {\n    const text = nextNode.getTextContent();\n    if ($isDecoratorNode(nextNode)) {\n      const decorator = nextNode.decorate(activeEditor$1, activeEditorConfig);\n      if (decorator !== null) {\n        reconcileDecorator(key, decorator);\n      }\n    }\n    subTreeTextContent += text;\n  }\n  if (!activeEditorStateReadOnly && $isRootNode(nextNode) && nextNode.__cachedText !== subTreeTextContent) {\n    // Cache the latest text content.\n    const nextRootNode = nextNode.getWritable();\n    nextRootNode.__cachedText = subTreeTextContent;\n    // This invariant from #8099 is left commented out for performance reasons\n    // if (true) {\n    //   const computedTextContent =\n    //     ElementNode.prototype.getTextContent.call(nextRootNode);\n    //   devInvariant(\n    //     computedTextContent === subTreeTextContent,\n    //     'LexicalReconciler: Computed nextRootNode.getTextContent() does not match nextRootNode.__cachedText %s !== %s (dom.__lexicalTextContent %s)',\n    //     JSON.stringify(computedTextContent),\n    //     JSON.stringify(subTreeTextContent),\n    //     JSON.stringify(dom.__lexicalTextContent),\n    //   );\n    // }\n    nextNode = nextRootNode;\n  }\n  activeEditorDOMRenderConfig.$decorateDOM(nextNode, prevNode, dom, activeEditor$1);\n  {\n    // Freeze the node in DEV to prevent accidental mutations\n    Object.freeze(nextNode);\n  }\n  return dom;\n}\nfunction reconcileDecorator(key, decorator) {\n  let pendingDecorators = activeEditor$1._pendingDecorators;\n  const currentDecorators = activeEditor$1._decorators;\n  if (pendingDecorators === null) {\n    if (currentDecorators[key] === decorator) {\n      return;\n    }\n    pendingDecorators = cloneDecorators(activeEditor$1);\n  }\n  pendingDecorators[key] = decorator;\n}\nfunction getNextSibling(element) {\n  let nextSibling = element.nextSibling;\n  if (nextSibling !== null && nextSibling === activeEditor$1._blockCursorElement) {\n    nextSibling = nextSibling.nextSibling;\n  }\n  return nextSibling;\n}\nfunction childrenSet(children, start) {\n  const s = new Set();\n  for (let i = start; i < children.length; i++) {\n    s.add(children[i]);\n  }\n  return s;\n}\nfunction $reconcileNodeChildren(nextElement, prevChildren, nextChildren, prevChildrenLength, nextChildrenLength, slot) {\n  const prevEndIndex = prevChildrenLength - 1;\n  const nextEndIndex = nextChildrenLength - 1;\n  let prevChildrenSet;\n  let nextChildrenSet;\n  let siblingDOM = slot.getFirstChild();\n  let prevIndex = 0;\n  let nextIndex = 0;\n  while (prevIndex <= prevEndIndex && nextIndex <= nextEndIndex) {\n    const prevKey = prevChildren[prevIndex];\n    const nextKey = nextChildren[nextIndex];\n    if (prevKey === nextKey) {\n      siblingDOM = getNextSibling($reconcileNode(nextKey, slot.element));\n      prevIndex++;\n      nextIndex++;\n    } else {\n      if (nextChildrenSet === undefined) {\n        nextChildrenSet = childrenSet(nextChildren, nextIndex);\n      }\n      if (prevChildrenSet === undefined) {\n        prevChildrenSet = childrenSet(prevChildren, prevIndex);\n      } else if (!prevChildrenSet.has(prevKey)) {\n        // continue if prevKey has already been moved\n        prevIndex++;\n        continue;\n      }\n      if (!nextChildrenSet.has(prevKey)) {\n        // Remove prev and continue\n        siblingDOM = getNextSibling(getPrevElementByKeyOrThrow(prevKey));\n        $destroyNode(prevKey, slot.element);\n        prevIndex++;\n        prevChildrenSet.delete(prevKey);\n        continue;\n      }\n      if (!prevChildrenSet.has(nextKey)) {\n        // Create next\n        $createNode(nextKey, slot.withBefore(siblingDOM));\n        nextIndex++;\n      } else {\n        // Move next\n        const childDOM = getElementByKeyOrThrow(activeEditor$1, nextKey);\n        if (childDOM !== siblingDOM) {\n          slot.withBefore(siblingDOM).insertChild(childDOM);\n        }\n        siblingDOM = getNextSibling($reconcileNode(nextKey, slot.element));\n        prevIndex++;\n        nextIndex++;\n      }\n    }\n    const node = activeNextNodeMap.get(nextKey);\n    if (node !== null && $isTextNode(node)) {\n      if (subTreeTextFormat === null) {\n        subTreeTextFormat = node.getFormat();\n        subTreeTextStyle = node.getStyle();\n      }\n    } else if (\n    // inline $textContentRequiresDoubleLinebreakAtEnd\n    $isElementNode(node) && nextIndex <= nextEndIndex && !node.isInline()) {\n      subTreeTextContent += DOUBLE_LINE_BREAK;\n    }\n  }\n  const appendNewChildren = prevIndex > prevEndIndex;\n  const removeOldChildren = nextIndex > nextEndIndex;\n  if (appendNewChildren && !removeOldChildren) {\n    const previousNode = nextChildren[nextEndIndex + 1];\n    const insertDOM = previousNode === undefined ? null : activeEditor$1.getElementByKey(previousNode);\n    $createChildren(nextChildren, nextElement, nextIndex, nextEndIndex, slot.withBefore(insertDOM));\n  } else if (removeOldChildren && !appendNewChildren) {\n    $destroyChildren(prevChildren, prevIndex, prevEndIndex, slot.element);\n  }\n}\nfunction $reconcileRoot(prevEditorState, nextEditorState, editor, dirtyType, dirtyElements, dirtyLeaves) {\n  // We cache text content to make retrieval more efficient.\n  // The cache must be rebuilt during reconciliation to account for any changes.\n  subTreeTextContent = '';\n  // Rather than pass around a load of arguments through the stack recursively\n  // we instead set them as bindings within the scope of the module.\n  treatAllNodesAsDirty = dirtyType === FULL_RECONCILE;\n  activeEditor$1 = editor;\n  activeEditorConfig = editor._config;\n  activeEditorDOMRenderConfig = editor._config.dom || DEFAULT_EDITOR_DOM_CONFIG;\n  activeEditorNodes = editor._nodes;\n  activeMutationListeners = activeEditor$1._listeners.mutation;\n  activeDirtyElements = dirtyElements;\n  activeDirtyLeaves = dirtyLeaves;\n  activePrevNodeMap = prevEditorState._nodeMap;\n  activeNextNodeMap = nextEditorState._nodeMap;\n  activeEditorStateReadOnly = nextEditorState._readOnly;\n  activePrevKeyToDOMMap = new Map(editor._keyToDOMMap);\n  // We keep track of mutated nodes so we can trigger mutation\n  // listeners later in the update cycle.\n  const currentMutatedNodes = new Map();\n  mutatedNodes = currentMutatedNodes;\n  $reconcileNode('root', null);\n  // We don't want a bunch of void checks throughout the scope\n  // so instead we make it seem that these values are always set.\n  // We also want to make sure we clear them down, otherwise we\n  // can leak memory.\n  // @ts-ignore\n  activeEditor$1 = undefined;\n  // @ts-ignore\n  activeEditorNodes = undefined;\n  // @ts-ignore\n  activeDirtyElements = undefined;\n  // @ts-ignore\n  activeDirtyLeaves = undefined;\n  // @ts-ignore\n  activePrevNodeMap = undefined;\n  // @ts-ignore\n  activeNextNodeMap = undefined;\n  // @ts-ignore\n  activeEditorConfig = undefined;\n  // @ts-ignore\n  activePrevKeyToDOMMap = undefined;\n  // @ts-ignore\n  mutatedNodes = undefined;\n  activeEditorDOMRenderConfig = DEFAULT_EDITOR_DOM_CONFIG;\n  return currentMutatedNodes;\n}\nfunction storeDOMWithKey(key, dom, editor) {\n  const keyToDOMMap = editor._keyToDOMMap;\n  setNodeKeyOnDOMNode(dom, editor, key);\n  keyToDOMMap.set(key, dom);\n}\nfunction getPrevElementByKeyOrThrow(key) {\n  const element = activePrevKeyToDOMMap.get(key);\n  if (element === undefined) {\n    {\n      formatDevErrorMessage(`Reconciliation: could not find DOM element for node key ${key}`);\n    }\n  }\n  return element;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/*@__INLINE__*/\nfunction warnOnlyOnce(message) {\n  {\n    let run = false;\n    return () => {\n      if (!run) {\n        console.warn(message);\n      }\n      run = true;\n    };\n  }\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * Crete a command that can be used with `editor.dispatchCommand` and\n * `editor.registerCommand`. Commands are used by unique reference, not by\n * name.\n *\n * @param type A string to identify the command, very helpful for debugging\n * @returns A new LexicalCommand\n *\n * @__NO_SIDE_EFFECTS__\n */\nfunction createCommand(type) {\n  return {\n    type\n  };\n}\nconst SELECTION_CHANGE_COMMAND = createCommand('SELECTION_CHANGE_COMMAND');\nconst SELECTION_INSERT_CLIPBOARD_NODES_COMMAND = createCommand('SELECTION_INSERT_CLIPBOARD_NODES_COMMAND');\nconst CLICK_COMMAND = createCommand('CLICK_COMMAND');\nconst BEFORE_INPUT_COMMAND = createCommand('BEFORE_INPUT_COMMAND');\nconst INPUT_COMMAND = createCommand('INPUT_COMMAND');\nconst COMPOSITION_START_COMMAND = createCommand('COMPOSITION_START_COMMAND');\nconst COMPOSITION_END_COMMAND = createCommand('COMPOSITION_END_COMMAND');\n/**\n * Dispatched to delete a character, the payload will be `true` if the deletion\n * is backwards (backspace or delete on macOS) and `false` if forwards\n * (delete or Fn+Delete on macOS).\n */\nconst DELETE_CHARACTER_COMMAND = createCommand('DELETE_CHARACTER_COMMAND');\n/**\n * Dispatched to insert a line break. With a false payload the\n * cursor moves to the new line (Shift+Enter), with a true payload the cursor\n * does not move (Ctrl+O on macOS).\n */\nconst INSERT_LINE_BREAK_COMMAND = createCommand('INSERT_LINE_BREAK_COMMAND');\nconst INSERT_PARAGRAPH_COMMAND = createCommand('INSERT_PARAGRAPH_COMMAND');\nconst CONTROLLED_TEXT_INSERTION_COMMAND = createCommand('CONTROLLED_TEXT_INSERTION_COMMAND');\nconst PASTE_COMMAND = createCommand('PASTE_COMMAND');\nconst REMOVE_TEXT_COMMAND = createCommand('REMOVE_TEXT_COMMAND');\n/**\n * Dispatched to delete a word, the payload will be `true` if the deletion is\n * backwards (Ctrl+Backspace or Opt+Delete on macOS), and `false` if\n * forwards (Ctrl+Delete or Fn+Opt+Delete on macOS).\n */\nconst DELETE_WORD_COMMAND = createCommand('DELETE_WORD_COMMAND');\n/**\n * Dispatched to delete a line, the payload will be `true` if the deletion is\n * backwards (Cmd+Delete on macOS), and `false` if forwards\n * (Fn+Cmd+Delete on macOS).\n */\nconst DELETE_LINE_COMMAND = createCommand('DELETE_LINE_COMMAND');\n/**\n * Dispatched to format the selected text.\n */\nconst FORMAT_TEXT_COMMAND = createCommand('FORMAT_TEXT_COMMAND');\n/**\n * Dispatched on undo (Cmd+Z on macOS, Ctrl+Z elsewhere).\n */\nconst UNDO_COMMAND = createCommand('UNDO_COMMAND');\n/**\n * Dispatched on redo (Shift+Cmd+Z on macOS, Shift+Ctrl+Z or Ctrl+Y elsewhere).\n */\nconst REDO_COMMAND = createCommand('REDO_COMMAND');\n/**\n * Dispatched when any key is pressed.\n */\nconst KEY_DOWN_COMMAND = createCommand('KEYDOWN_COMMAND');\n/**\n * Dispatched when the `'ArrowRight'` key is pressed.\n * The shift modifier key may also be down.\n */\nconst KEY_ARROW_RIGHT_COMMAND = createCommand('KEY_ARROW_RIGHT_COMMAND');\n/**\n * Dispatched when the move to end keyboard shortcut is pressed,\n * (Cmd+Right on macOS; Ctrl+Right elsewhere).\n */\nconst MOVE_TO_END = createCommand('MOVE_TO_END');\n/**\n * Dispatched when the `'ArrowLeft'` key is pressed.\n * The shift modifier key may also be down.\n */\nconst KEY_ARROW_LEFT_COMMAND = createCommand('KEY_ARROW_LEFT_COMMAND');\n/**\n * Dispatched when the move to start keyboard shortcut is pressed,\n * (Cmd+Left on macOS; Ctrl+Left elsewhere).\n */\nconst MOVE_TO_START = createCommand('MOVE_TO_START');\n/**\n * Dispatched when the `'ArrowUp'` key is pressed.\n * The shift and/or alt (option) modifier keys may also be down.\n */\nconst KEY_ARROW_UP_COMMAND = createCommand('KEY_ARROW_UP_COMMAND');\n/**\n * Dispatched when the `'ArrowDown'` key is pressed.\n * The shift and/or alt (option) modifier keys may also be down.\n */\nconst KEY_ARROW_DOWN_COMMAND = createCommand('KEY_ARROW_DOWN_COMMAND');\n/**\n * Dispatched when the enter key is pressed, may also be called with a null\n * payload when the intent is to insert a newline. The shift modifier key\n * must be down, any other modifier keys may also be down.\n */\nconst KEY_ENTER_COMMAND = createCommand('KEY_ENTER_COMMAND');\n/**\n * Dispatched whenever the space (`' '`) key is pressed, any modifier\n * keys may be down.\n */\nconst KEY_SPACE_COMMAND = createCommand('KEY_SPACE_COMMAND');\n/**\n * Dispatched whenever the `'Backspace'` key is pressed, the shift\n * modifier key may be down.\n */\nconst KEY_BACKSPACE_COMMAND = createCommand('KEY_BACKSPACE_COMMAND');\n/**\n * Dispatched whenever the `'Escape'` key is pressed, any modifier\n * keys may be down.\n */\nconst KEY_ESCAPE_COMMAND = createCommand('KEY_ESCAPE_COMMAND');\n/**\n * Dispatched whenever the `'Delete'` key is pressed (Fn+Delete on macOS).\n */\nconst KEY_DELETE_COMMAND = createCommand('KEY_DELETE_COMMAND');\n/**\n * Dispatched whenever the `'Tab'` key is pressed. The shift modifier key\n * may be down.\n */\nconst KEY_TAB_COMMAND = createCommand('KEY_TAB_COMMAND');\nconst INSERT_TAB_COMMAND = createCommand('INSERT_TAB_COMMAND');\nconst INDENT_CONTENT_COMMAND = createCommand('INDENT_CONTENT_COMMAND');\nconst OUTDENT_CONTENT_COMMAND = createCommand('OUTDENT_CONTENT_COMMAND');\nconst DROP_COMMAND = createCommand('DROP_COMMAND');\nconst FORMAT_ELEMENT_COMMAND = createCommand('FORMAT_ELEMENT_COMMAND');\nconst DRAGSTART_COMMAND = createCommand('DRAGSTART_COMMAND');\nconst DRAGOVER_COMMAND = createCommand('DRAGOVER_COMMAND');\nconst DRAGEND_COMMAND = createCommand('DRAGEND_COMMAND');\n/**\n * Dispatched on a copy event, either via the clipboard or a KeyboardEvent\n * (Cmd+C on macOS, Ctrl+C elsewhere).\n */\nconst COPY_COMMAND = createCommand('COPY_COMMAND');\n/**\n * Dispatched on a cut event, either via the clipboard or a KeyboardEvent\n * (Cmd+X on macOS, Ctrl+X elsewhere).\n */\nconst CUT_COMMAND = createCommand('CUT_COMMAND');\n/**\n * Dispatched on the select all keyboard shortcut\n * (Cmd+A on macOS, Ctrl+A elsehwere).\n */\nconst SELECT_ALL_COMMAND = createCommand('SELECT_ALL_COMMAND');\nconst CLEAR_EDITOR_COMMAND = createCommand('CLEAR_EDITOR_COMMAND');\nconst CLEAR_HISTORY_COMMAND = createCommand('CLEAR_HISTORY_COMMAND');\nconst CAN_REDO_COMMAND = createCommand('CAN_REDO_COMMAND');\nconst CAN_UNDO_COMMAND = createCommand('CAN_UNDO_COMMAND');\nconst FOCUS_COMMAND = createCommand('FOCUS_COMMAND');\nconst BLUR_COMMAND = createCommand('BLUR_COMMAND');\n/**\n * @deprecated in v0.31.0, use KEY_DOWN_COMMAND and check for modifiers\n * directly.\n *\n * Dispatched after any KeyboardEvent when modifiers are pressed\n */\nconst KEY_MODIFIER_COMMAND = createCommand('KEY_MODIFIER_COMMAND');\n\nconst PASS_THROUGH_COMMAND = Object.freeze({});\nconst ANDROID_COMPOSITION_LATENCY = 30;\nconst rootElementEvents = [['keydown', onKeyDown], ['pointerdown', onPointerDown], ['compositionstart', onCompositionStart], ['compositionend', onCompositionEnd], ['input', onInput], ['click', onClick], ['cut', PASS_THROUGH_COMMAND], ['copy', PASS_THROUGH_COMMAND], ['dragstart', PASS_THROUGH_COMMAND], ['dragover', PASS_THROUGH_COMMAND], ['dragend', PASS_THROUGH_COMMAND], ['paste', PASS_THROUGH_COMMAND], ['focus', PASS_THROUGH_COMMAND], ['blur', PASS_THROUGH_COMMAND], ['drop', PASS_THROUGH_COMMAND]];\nif (CAN_USE_BEFORE_INPUT) {\n  rootElementEvents.push(['beforeinput', (event, editor) => onBeforeInput(event, editor)]);\n}\nlet lastKeyDownTimeStamp = 0;\nlet lastKeyCode = null;\nlet lastBeforeInputInsertTextTimeStamp = 0;\nlet unprocessedBeforeInputData = null;\n// Node can be moved between documents (for example using createPortal), so we\n// need to track the document each root element was originally registered on.\nconst rootElementToDocument = new WeakMap();\nconst rootElementsRegistered = new WeakMap();\nlet isSelectionChangeFromDOMUpdate = false;\nlet isSelectionChangeFromMouseDown = false;\nlet isInsertLineBreak = false;\nlet isFirefoxEndingComposition = false;\nlet isSafariEndingComposition = false;\nlet safariEndCompositionEventData = '';\nlet postDeleteSelectionToRestore = null;\nlet collapsedSelectionFormat = [0, '', 0, 'root', 0];\n\n// This function is used to determine if Lexical should attempt to override\n// the default browser behavior for insertion of text and use its own internal\n// heuristics. This is an extremely important function, and makes much of Lexical\n// work as intended between different browsers and across word, line and character\n// boundary/formats. It also is important for text replacement, node schemas and\n// composition mechanics.\nfunction $shouldPreventDefaultAndInsertText(selection, domTargetRange, text, timeStamp, isBeforeInput) {\n  const anchor = selection.anchor;\n  const focus = selection.focus;\n  const anchorNode = anchor.getNode();\n  const editor = getActiveEditor();\n  const domSelection = getDOMSelection(getWindow(editor));\n  const domAnchorNode = domSelection !== null ? domSelection.anchorNode : null;\n  const anchorKey = anchor.key;\n  const backingAnchorElement = editor.getElementByKey(anchorKey);\n  const textLength = text.length;\n  return anchorKey !== focus.key ||\n  // If we're working with a non-text node.\n  !$isTextNode(anchorNode) ||\n  // If we are replacing a range with a single character or grapheme, and not composing.\n  (!isBeforeInput && (!CAN_USE_BEFORE_INPUT ||\n  // We check to see if there has been\n  // a recent beforeinput event for \"textInput\". If there has been one in the last\n  // 50ms then we proceed as normal. However, if there is not, then this is likely\n  // a dangling `input` event caused by execCommand('insertText').\n  lastBeforeInputInsertTextTimeStamp < timeStamp + 50) || anchorNode.isDirty() && textLength < 2 ||\n  // TODO consider if there are other scenarios when multiple code units\n  //      should be addressed here\n  doesContainSurrogatePair(text)) && anchor.offset !== focus.offset && !anchorNode.isComposing() ||\n  // Any non standard text node.\n  $isTokenOrSegmented(anchorNode) ||\n  // If the text length is more than a single character and we're either\n  // dealing with this in \"beforeinput\" or where the node has already recently\n  // been changed (thus is dirty).\n  anchorNode.isDirty() && textLength > 1 ||\n  // If the DOM selection element is not the same as the backing node during beforeinput.\n  (isBeforeInput || !CAN_USE_BEFORE_INPUT) && backingAnchorElement !== null && !anchorNode.isComposing() && domAnchorNode !== getDOMTextNode(backingAnchorElement) ||\n  // If TargetRange is not the same as the DOM selection; browser trying to edit random parts\n  // of the editor.\n  domSelection !== null && domTargetRange !== null && (!domTargetRange.collapsed || domTargetRange.startContainer !== domSelection.anchorNode || domTargetRange.startOffset !== domSelection.anchorOffset) ||\n  // Check if we're changing from bold to italics, or some other format.\n  !anchorNode.isComposing() && (anchorNode.getFormat() !== selection.format || anchorNode.getStyle() !== selection.style) ||\n  // One last set of heuristics to check against.\n  $shouldInsertTextAfterOrBeforeTextNode(selection, anchorNode);\n}\nfunction shouldSkipSelectionChange(domNode, offset) {\n  return isDOMTextNode(domNode) && domNode.nodeValue !== null && offset !== 0 && offset !== domNode.nodeValue.length;\n}\nfunction onSelectionChange(domSelection, editor, isActive) {\n  const {\n    anchorNode: anchorDOM,\n    anchorOffset,\n    focusNode: focusDOM,\n    focusOffset\n  } = domSelection;\n  if (isSelectionChangeFromDOMUpdate) {\n    isSelectionChangeFromDOMUpdate = false;\n\n    // If native DOM selection is on a DOM element, then\n    // we should continue as usual, as Lexical's selection\n    // may have normalized to a better child. If the DOM\n    // element is a text node, we can safely apply this\n    // optimization and skip the selection change entirely.\n    // We also need to check if the offset is at the boundary,\n    // because in this case, we might need to normalize to a\n    // sibling instead.\n    if (shouldSkipSelectionChange(anchorDOM, anchorOffset) && shouldSkipSelectionChange(focusDOM, focusOffset) && !postDeleteSelectionToRestore) {\n      return;\n    }\n  }\n  updateEditorSync(editor, () => {\n    // Non-active editor don't need any extra logic for selection, it only needs update\n    // to reconcile selection (set it to null) to ensure that only one editor has non-null selection.\n    if (!isActive) {\n      $setSelection(null);\n      return;\n    }\n    if (!isSelectionWithinEditor(editor, anchorDOM, focusDOM)) {\n      return;\n    }\n    let selection = $getSelection();\n\n    // Restore selection in the event of incorrect rightward shift after deletion\n    if (postDeleteSelectionToRestore && $isRangeSelection(selection) && selection.isCollapsed()) {\n      const curAnchor = selection.anchor;\n      const prevAnchor = postDeleteSelectionToRestore.anchor;\n      if (\n      // Rightward shift in same node\n      curAnchor.key === prevAnchor.key && curAnchor.offset === prevAnchor.offset + 1 ||\n      // Or rightward shift into sibling node\n      curAnchor.offset === 1 && prevAnchor.getNode().is(curAnchor.getNode().getPreviousSibling())) {\n        // Restore selection\n        selection = postDeleteSelectionToRestore.clone();\n        $setSelection(selection);\n      }\n    }\n    postDeleteSelectionToRestore = null;\n\n    // Update the selection format\n    if ($isRangeSelection(selection)) {\n      const anchor = selection.anchor;\n      const anchorNode = anchor.getNode();\n      if (selection.isCollapsed()) {\n        // Badly interpreted range selection when collapsed - #1482\n        if (domSelection.type === 'Range' && domSelection.anchorNode === domSelection.focusNode) {\n          selection.dirty = true;\n        }\n\n        // If we have marked a collapsed selection format, and we're\n        // within the given time range \u2013 then attempt to use that format\n        // instead of getting the format from the anchor node.\n        const windowEvent = getWindow(editor).event;\n        const currentTimeStamp = windowEvent ? windowEvent.timeStamp : performance.now();\n        const [lastFormat, lastStyle, lastOffset, lastKey, timeStamp] = collapsedSelectionFormat;\n        const root = $getRoot();\n        const isRootTextContentEmpty = editor.isComposing() === false && root.getTextContent() === '';\n        if (currentTimeStamp < timeStamp + 200 && anchor.offset === lastOffset && anchor.key === lastKey) {\n          $updateSelectionFormatStyle(selection, lastFormat, lastStyle);\n        } else {\n          if (anchor.type === 'text') {\n            if (!$isTextNode(anchorNode)) {\n              formatDevErrorMessage(`Point.getNode() must return TextNode when type is text`);\n            }\n            $updateSelectionFormatStyleFromTextNode(selection, anchorNode);\n          } else if (anchor.type === 'element' && !isRootTextContentEmpty) {\n            if (!$isElementNode(anchorNode)) {\n              formatDevErrorMessage(`Point.getNode() must return ElementNode when type is element`);\n            }\n            const lastNode = anchor.getNode();\n            if (\n            // This previously applied to all ParagraphNode\n            lastNode.isEmpty()) {\n              $updateSelectionFormatStyleFromElementNode(selection, lastNode);\n            } else {\n              $updateSelectionFormatStyle(selection, selection.format, '');\n            }\n          }\n        }\n      } else {\n        const anchorKey = anchor.key;\n        const focus = selection.focus;\n        const focusKey = focus.key;\n        const nodes = selection.getNodes();\n        const nodesLength = nodes.length;\n        const isBackward = selection.isBackward();\n        const startOffset = isBackward ? focusOffset : anchorOffset;\n        const endOffset = isBackward ? anchorOffset : focusOffset;\n        const startKey = isBackward ? focusKey : anchorKey;\n        const endKey = isBackward ? anchorKey : focusKey;\n        let combinedFormat = IS_ALL_FORMATTING;\n        let hasTextNodes = false;\n        for (let i = 0; i < nodesLength; i++) {\n          const node = nodes[i];\n          const textContentSize = node.getTextContentSize();\n          if ($isTextNode(node) && textContentSize !== 0 &&\n          // Exclude empty text nodes at boundaries resulting from user's selection\n          !(i === 0 && node.__key === startKey && startOffset === textContentSize || i === nodesLength - 1 && node.__key === endKey && endOffset === 0)) {\n            // TODO: what about style?\n            hasTextNodes = true;\n            combinedFormat &= node.getFormat();\n            if (combinedFormat === 0) {\n              break;\n            }\n          }\n        }\n        selection.format = hasTextNodes ? combinedFormat : 0;\n      }\n    }\n    dispatchCommand(editor, SELECTION_CHANGE_COMMAND, undefined);\n  });\n}\nfunction $updateSelectionFormatStyle(selection, format, style) {\n  if (selection.format !== format || selection.style !== style) {\n    selection.format = format;\n    selection.style = style;\n    selection.dirty = true;\n  }\n}\nfunction $updateSelectionFormatStyleFromTextNode(selection, node) {\n  const format = node.getFormat();\n  const style = node.getStyle();\n  $updateSelectionFormatStyle(selection, format, style);\n}\nfunction $updateSelectionFormatStyleFromElementNode(selection, node) {\n  const format = node.getTextFormat();\n  const style = node.getTextStyle();\n  $updateSelectionFormatStyle(selection, format, style);\n}\n\n// This is a work-around is mainly Chrome specific bug where if you select\n// the contents of an empty block, you cannot easily unselect anything.\n// This results in a tiny selection box that looks buggy/broken. This can\n// also help other browsers when selection might \"appear\" lost, when it\n// really isn't.\nfunction onClick(event, editor) {\n  updateEditorSync(editor, () => {\n    const selection = $getSelection();\n    const domSelection = getDOMSelection(getWindow(editor));\n    const lastSelection = $getPreviousSelection();\n    if (domSelection) {\n      if ($isRangeSelection(selection)) {\n        const anchor = selection.anchor;\n        const anchorNode = anchor.getNode();\n        if (anchor.type === 'element' && anchor.offset === 0 && selection.isCollapsed() && !$isRootNode(anchorNode) && $getRoot().getChildrenSize() === 1 && anchorNode.getTopLevelElementOrThrow().isEmpty() && lastSelection !== null && selection.is(lastSelection)) {\n          domSelection.removeAllRanges();\n          selection.dirty = true;\n        } else if (event.detail === 3 && !selection.isCollapsed()) {\n          // Triple click causing selection to overflow into the nearest element. In that\n          // case visually it looks like a single element content is selected, focus node\n          // is actually at the beginning of the next element (if present) and any manipulations\n          // with selection (formatting) are affecting second element as well\n          const focus = selection.focus;\n          const focusNode = focus.getNode();\n          if (anchorNode !== focusNode) {\n            const parentNode = $findMatchingParent(anchorNode, node => $isElementNode(node) && !node.isInline());\n            if ($isElementNode(parentNode)) {\n              parentNode.select(0);\n            }\n          }\n        }\n      } else if (event.pointerType === 'touch' || event.pointerType === 'pen') {\n        // This is used to update the selection on touch devices (including Apple Pencil) when the user clicks on text after a\n        // node selection. See isSelectionChangeFromMouseDown for the inverse\n        const domAnchorNode = domSelection.anchorNode;\n        // If the user is attempting to click selection back onto text, then\n        // we should attempt create a range selection.\n        // When we click on an empty paragraph node or the end of a paragraph that ends\n        // with an image/poll, the nodeType will be ELEMENT_NODE\n        if (isHTMLElement(domAnchorNode) || isDOMTextNode(domAnchorNode)) {\n          const newSelection = $internalCreateRangeSelection(lastSelection, domSelection, editor, event);\n          $setSelection(newSelection);\n        }\n      }\n    }\n    dispatchCommand(editor, CLICK_COMMAND, event);\n  });\n}\nfunction onPointerDown(event, editor) {\n  // TODO implement text drag & drop\n  const target = event.target;\n  const pointerType = event.pointerType;\n  if (isDOMNode(target) && pointerType !== 'touch' && pointerType !== 'pen' && event.button === 0) {\n    updateEditorSync(editor, () => {\n      // Drag & drop should not recompute selection until mouse up; otherwise the initially\n      // selected content is lost.\n      if (!$isSelectionCapturedInDecorator(target)) {\n        isSelectionChangeFromMouseDown = true;\n      }\n    });\n  }\n}\nfunction getTargetRange(event) {\n  if (!event.getTargetRanges) {\n    return null;\n  }\n  const targetRanges = event.getTargetRanges();\n  if (targetRanges.length === 0) {\n    return null;\n  }\n  return targetRanges[0];\n}\nfunction $canRemoveText(anchorNode, focusNode) {\n  return anchorNode !== focusNode || $isElementNode(anchorNode) || $isElementNode(focusNode) || !$isTokenOrTab(anchorNode) || !$isTokenOrTab(focusNode);\n}\nfunction isPossiblyAndroidKeyPress(timeStamp) {\n  return lastKeyCode === 'MediaLast' && timeStamp < lastKeyDownTimeStamp + ANDROID_COMPOSITION_LATENCY;\n}\nfunction registerDefaultCommandHandlers(editor) {\n  editor.registerCommand(BEFORE_INPUT_COMMAND, $handleBeforeInput, COMMAND_PRIORITY_EDITOR);\n  editor.registerCommand(INPUT_COMMAND, $handleInput, COMMAND_PRIORITY_EDITOR);\n  editor.registerCommand(COMPOSITION_START_COMMAND, $handleCompositionStart, COMMAND_PRIORITY_EDITOR);\n  editor.registerCommand(COMPOSITION_END_COMMAND, $handleCompositionEnd, COMMAND_PRIORITY_EDITOR);\n  editor.registerCommand(KEY_DOWN_COMMAND, $handleKeyDown, COMMAND_PRIORITY_EDITOR);\n}\nfunction onBeforeInput(event, editor) {\n  const inputType = event.inputType;\n\n  // We let the browser do its own thing for composition.\n  if (inputType === 'deleteCompositionText' ||\n  // If we're pasting in FF, we shouldn't get this event\n  // as the `paste` event should have triggered, unless the\n  // user has dom.event.clipboardevents.enabled disabled in\n  // about:config. In that case, we need to process the\n  // pasted content in the DOM mutation phase.\n  IS_FIREFOX && isFirefoxClipboardEvents(editor)) {\n    return;\n  } else if (inputType === 'insertCompositionText') {\n    return;\n  }\n  dispatchCommand(editor, BEFORE_INPUT_COMMAND, event);\n}\nfunction $handleBeforeInput(event) {\n  const inputType = event.inputType;\n  const targetRange = getTargetRange(event);\n  const editor = getActiveEditor();\n  const selection = $getSelection();\n  if (inputType === 'deleteContentBackward') {\n    if (selection === null) {\n      // Use previous selection\n      const prevSelection = $getPreviousSelection();\n      if (!$isRangeSelection(prevSelection)) {\n        return true;\n      }\n      $setSelection(prevSelection.clone());\n    }\n    if ($isRangeSelection(selection)) {\n      const isSelectionAnchorSameAsFocus = selection.anchor.key === selection.focus.key;\n      if (isPossiblyAndroidKeyPress(event.timeStamp) && editor.isComposing() && isSelectionAnchorSameAsFocus) {\n        $setCompositionKey(null);\n        lastKeyDownTimeStamp = 0;\n        // Fixes an Android bug where selection flickers when backspacing\n        setTimeout(() => {\n          updateEditorSync(editor, () => {\n            $setCompositionKey(null);\n          });\n        }, ANDROID_COMPOSITION_LATENCY);\n        if ($isRangeSelection(selection)) {\n          const anchorNode = selection.anchor.getNode();\n          anchorNode.markDirty();\n          if (!$isTextNode(anchorNode)) {\n            formatDevErrorMessage(`Anchor node must be a TextNode`);\n          }\n          $updateSelectionFormatStyleFromTextNode(selection, anchorNode);\n        }\n      } else {\n        $setCompositionKey(null);\n        event.preventDefault();\n        // Chromium Android at the moment seems to ignore the preventDefault\n        // on 'deleteContentBackward' and still deletes the content. Which leads\n        // to multiple deletions. So we let the browser handle the deletion in this case.\n        const selectedNode = selection.anchor.getNode();\n        const selectedNodeText = selectedNode.getTextContent();\n        // When the target node has `canInsertTextAfter` set to false, the first deletion\n        // doesn't have an effect, so we need to handle it with Lexical.\n        const selectedNodeCanInsertTextAfter = selectedNode.canInsertTextAfter();\n        const hasSelectedAllTextInNode = selection.anchor.offset === 0 && selection.focus.offset === selectedNodeText.length;\n        let shouldLetBrowserHandleDelete = IS_ANDROID_CHROME && isSelectionAnchorSameAsFocus && !hasSelectedAllTextInNode && selectedNodeCanInsertTextAfter;\n        // Check if selection is collapsed and if the previous node is a decorator node\n        // If so, the browser will not be able to handle the deletion\n        if (shouldLetBrowserHandleDelete && selection.isCollapsed()) {\n          shouldLetBrowserHandleDelete = !$isDecoratorNode($getAdjacentNode(selection.anchor, true));\n        }\n        if (!shouldLetBrowserHandleDelete) {\n          dispatchCommand(editor, DELETE_CHARACTER_COMMAND, true);\n          // When deleting across paragraphs, Chrome on Android incorrectly shifts the selection rightwards\n          // We save the correct selection to restore later during handling of selectionchange event\n          const selectionAfterDelete = $getSelection();\n          if (IS_ANDROID_CHROME && $isRangeSelection(selectionAfterDelete) && selectionAfterDelete.isCollapsed()) {\n            postDeleteSelectionToRestore = selectionAfterDelete;\n            // Cleanup in case selectionchange does not fire\n            setTimeout(() => postDeleteSelectionToRestore = null);\n          }\n        }\n      }\n      return true;\n    }\n  }\n  if (!$isRangeSelection(selection)) {\n    return true;\n  }\n  const data = event.data;\n\n  // This represents the case when two beforeinput events are triggered at the same time (without a\n  // full event loop ending at input). This happens with MacOS with the default keyboard settings,\n  // a combination of autocorrection + autocapitalization.\n  // Having Lexical run everything in controlled mode would fix the issue without additional code\n  // but this would kill the massive performance win from the most common typing event.\n  // Alternatively, when this happens we can prematurely update our EditorState based on the DOM\n  // content, a job that would usually be the input event's responsibility.\n  if (unprocessedBeforeInputData !== null) {\n    $updateSelectedTextFromDOM(false, editor, unprocessedBeforeInputData);\n  }\n  if ((!selection.dirty || unprocessedBeforeInputData !== null) && selection.isCollapsed() && !$isRootNode(selection.anchor.getNode()) && targetRange !== null) {\n    selection.applyDOMRange(targetRange);\n  }\n  unprocessedBeforeInputData = null;\n  const anchor = selection.anchor;\n  const focus = selection.focus;\n  const anchorNode = anchor.getNode();\n  const focusNode = focus.getNode();\n  if (inputType === 'insertText' || inputType === 'insertTranspose') {\n    if (data === '\\n') {\n      event.preventDefault();\n      dispatchCommand(editor, INSERT_LINE_BREAK_COMMAND, false);\n    } else if (data === DOUBLE_LINE_BREAK) {\n      event.preventDefault();\n      dispatchCommand(editor, INSERT_PARAGRAPH_COMMAND, undefined);\n    } else if (data == null && event.dataTransfer) {\n      // Gets around a Safari text replacement bug.\n      const text = event.dataTransfer.getData('text/plain');\n      event.preventDefault();\n      selection.insertRawText(text);\n    } else if (data != null && $shouldPreventDefaultAndInsertText(selection, targetRange, data, event.timeStamp, true)) {\n      event.preventDefault();\n      dispatchCommand(editor, CONTROLLED_TEXT_INSERTION_COMMAND, data);\n    } else {\n      unprocessedBeforeInputData = data;\n    }\n    lastBeforeInputInsertTextTimeStamp = event.timeStamp;\n    return true;\n  }\n\n  // Prevent the browser from carrying out\n  // the input event, so we can control the\n  // output.\n  event.preventDefault();\n  switch (inputType) {\n    case 'insertFromYank':\n    case 'insertFromDrop':\n    case 'insertReplacementText':\n      {\n        dispatchCommand(editor, CONTROLLED_TEXT_INSERTION_COMMAND, event);\n        break;\n      }\n    case 'insertFromComposition':\n      {\n        // This is the end of composition\n        $setCompositionKey(null);\n        dispatchCommand(editor, CONTROLLED_TEXT_INSERTION_COMMAND, event);\n        break;\n      }\n    case 'insertLineBreak':\n      {\n        // Used for Android\n        $setCompositionKey(null);\n        dispatchCommand(editor, INSERT_LINE_BREAK_COMMAND, false);\n        break;\n      }\n    case 'insertParagraph':\n      {\n        // Used for Android\n        $setCompositionKey(null);\n\n        // Safari does not provide the type \"insertLineBreak\".\n        // So instead, we need to infer it from the keyboard event.\n        // We do not apply this logic to iOS to allow newline auto-capitalization\n        // work without creating linebreaks when pressing Enter\n        if (isInsertLineBreak && !IS_IOS) {\n          isInsertLineBreak = false;\n          dispatchCommand(editor, INSERT_LINE_BREAK_COMMAND, false);\n        } else {\n          dispatchCommand(editor, INSERT_PARAGRAPH_COMMAND, undefined);\n        }\n        break;\n      }\n    case 'insertFromPaste':\n    case 'insertFromPasteAsQuotation':\n      {\n        dispatchCommand(editor, PASTE_COMMAND, event);\n        break;\n      }\n    case 'deleteByComposition':\n      {\n        if ($canRemoveText(anchorNode, focusNode)) {\n          dispatchCommand(editor, REMOVE_TEXT_COMMAND, event);\n        }\n        break;\n      }\n    case 'deleteByDrag':\n      {\n        // The drop target is taking over focus and the document selection;\n        // suppress this editor's own attempt to focus its root or move the DOM\n        // selection back to the post-removal point during reconciliation.\n        $addUpdateTag(SKIP_SELECTION_FOCUS_TAG);\n        dispatchCommand(editor, REMOVE_TEXT_COMMAND, event);\n        break;\n      }\n    case 'deleteByCut':\n      {\n        dispatchCommand(editor, REMOVE_TEXT_COMMAND, event);\n        break;\n      }\n    case 'deleteContent':\n      {\n        dispatchCommand(editor, DELETE_CHARACTER_COMMAND, false);\n        break;\n      }\n    case 'deleteWordBackward':\n      {\n        dispatchCommand(editor, DELETE_WORD_COMMAND, true);\n        break;\n      }\n    case 'deleteWordForward':\n      {\n        dispatchCommand(editor, DELETE_WORD_COMMAND, false);\n        break;\n      }\n    case 'deleteHardLineBackward':\n    case 'deleteSoftLineBackward':\n      {\n        dispatchCommand(editor, DELETE_LINE_COMMAND, true);\n        break;\n      }\n    case 'deleteContentForward':\n    case 'deleteHardLineForward':\n    case 'deleteSoftLineForward':\n      {\n        dispatchCommand(editor, DELETE_LINE_COMMAND, false);\n        break;\n      }\n    case 'formatStrikeThrough':\n      {\n        dispatchCommand(editor, FORMAT_TEXT_COMMAND, 'strikethrough');\n        break;\n      }\n    case 'formatBold':\n      {\n        dispatchCommand(editor, FORMAT_TEXT_COMMAND, 'bold');\n        break;\n      }\n    case 'formatItalic':\n      {\n        dispatchCommand(editor, FORMAT_TEXT_COMMAND, 'italic');\n        break;\n      }\n    case 'formatUnderline':\n      {\n        dispatchCommand(editor, FORMAT_TEXT_COMMAND, 'underline');\n        break;\n      }\n    case 'historyUndo':\n      {\n        dispatchCommand(editor, UNDO_COMMAND, undefined);\n        break;\n      }\n    case 'historyRedo':\n      {\n        dispatchCommand(editor, REDO_COMMAND, undefined);\n        break;\n      }\n    // NO-OP\n  }\n  return true;\n}\nfunction onInput(event, editor) {\n  // Note that the MutationObserver may or may not have already fired,\n  // but the the DOM and selection may have already changed.\n  // See also:\n  // - https://github.com/facebook/lexical/issues/7028\n  // - https://github.com/facebook/lexical/pull/794\n\n  // We don't want the onInput to bubble, in the case of nested editors.\n  event.stopPropagation();\n  updateEditorSync(editor, () => {\n    editor.dispatchCommand(INPUT_COMMAND, event);\n  }, {\n    event\n  });\n  unprocessedBeforeInputData = null;\n}\nfunction $handleInput(event) {\n  if (isHTMLElement(event.target) && $isSelectionCapturedInDecorator(event.target)) {\n    return true;\n  }\n  const editor = getActiveEditor();\n  const selection = $getSelection();\n  const data = event.data;\n  const targetRange = getTargetRange(event);\n  if (data != null && $isRangeSelection(selection) && $shouldPreventDefaultAndInsertText(selection, targetRange, data, event.timeStamp, false)) {\n    // Given we're over-riding the default behavior, we will need\n    // to ensure to disable composition before dispatching the\n    // insertText command for when changing the sequence for FF.\n    if (isFirefoxEndingComposition) {\n      $onCompositionEndImpl(editor, data);\n      isFirefoxEndingComposition = false;\n    }\n    const anchor = selection.anchor;\n    const anchorNode = anchor.getNode();\n    const domSelection = getDOMSelection(getWindow(editor));\n    if (domSelection === null) {\n      return true;\n    }\n    const isBackward = selection.isBackward();\n    const startOffset = isBackward ? selection.anchor.offset : selection.focus.offset;\n    const endOffset = isBackward ? selection.focus.offset : selection.anchor.offset;\n    // If the content is the same as inserted, then don't dispatch an insertion.\n    // Given onInput doesn't take the current selection (it uses the previous)\n    // we can compare that against what the DOM currently says.\n    if (!CAN_USE_BEFORE_INPUT || selection.isCollapsed() || !$isTextNode(anchorNode) || domSelection.anchorNode === null || anchorNode.getTextContent().slice(0, startOffset) + data + anchorNode.getTextContent().slice(startOffset + endOffset) !== getAnchorTextFromDOM(domSelection.anchorNode)) {\n      dispatchCommand(editor, CONTROLLED_TEXT_INSERTION_COMMAND, data);\n    }\n    const textLength = data.length;\n\n    // Another hack for FF, as it's possible that the IME is still\n    // open, even though compositionend has already fired (sigh).\n    if (IS_FIREFOX && textLength > 1 && event.inputType === 'insertCompositionText' && !editor.isComposing()) {\n      selection.anchor.offset -= textLength;\n    }\n\n    // This ensures consistency on Android.\n    if (IS_ANDROID_CHROME && editor.isComposing()) {\n      lastKeyDownTimeStamp = 0;\n      $setCompositionKey(null);\n    }\n  } else {\n    const characterData = data !== null ? data : undefined;\n    $updateSelectedTextFromDOM(false, editor, characterData);\n\n    // onInput always fires after onCompositionEnd for FF.\n    if (isFirefoxEndingComposition) {\n      $onCompositionEndImpl(editor, data || undefined);\n      isFirefoxEndingComposition = false;\n    }\n  }\n\n  // Also flush any other mutations that might have occurred\n  // since the change.\n  $flushMutations();\n  return true;\n}\nfunction onCompositionStart(event, editor) {\n  dispatchCommand(editor, COMPOSITION_START_COMMAND, event);\n}\nfunction $handleCompositionStart(event) {\n  const editor = getActiveEditor();\n  const selection = $getSelection();\n  if ($isRangeSelection(selection) && !editor.isComposing()) {\n    const anchor = selection.anchor;\n    const node = selection.anchor.getNode();\n    $setCompositionKey(anchor.key);\n    $addUpdateTag(COMPOSITION_START_TAG);\n    if (\n    // If it has been 30ms since the last keydown, then we should\n    // apply the empty space heuristic. We can't do this for Safari,\n    // as the keydown fires after composition start.\n    event.timeStamp < lastKeyDownTimeStamp + ANDROID_COMPOSITION_LATENCY ||\n    // FF has issues around composing multibyte characters, so we also\n    // need to invoke the empty space heuristic below.\n    anchor.type === 'element' || !selection.isCollapsed() || node.getFormat() !== selection.format || $isTextNode(node) && node.getStyle() !== selection.style) {\n      // We insert a zero width character, ready for the composition\n      // to get inserted into the new node we create. If\n      // we don't do this, Safari will fail on us because\n      // there is no text node matching the selection.\n      dispatchCommand(editor, CONTROLLED_TEXT_INSERTION_COMMAND, COMPOSITION_START_CHAR);\n    }\n  }\n  return true;\n}\nfunction $handleCompositionEnd(event) {\n  const editor = getActiveEditor();\n  $onCompositionEndImpl(editor, event.data);\n  $addUpdateTag(COMPOSITION_END_TAG);\n  return true;\n}\nfunction $onCompositionEndImpl(editor, data) {\n  const compositionKey = editor._compositionKey;\n  $setCompositionKey(null);\n\n  // Handle termination of composition.\n  if (compositionKey !== null && data != null) {\n    // Composition can sometimes move to an adjacent DOM node when backspacing.\n    // So check for the empty case.\n    if (data === '') {\n      const node = $getNodeByKey(compositionKey);\n      const domElement = editor.getElementByKey(compositionKey);\n      const textNode = getDOMTextNode(domElement);\n      if (textNode !== null && textNode.nodeValue !== null && $isTextNode(node)) {\n        const domSelection = getDOMSelection(getWindow(editor));\n        let anchorOffset = null;\n        let focusOffset = null;\n        if (domSelection !== null && domSelection.anchorNode === textNode) {\n          anchorOffset = domSelection.anchorOffset;\n          focusOffset = domSelection.focusOffset;\n        }\n        $updateTextNodeFromDOMContent(node, textNode.nodeValue, anchorOffset, focusOffset, true);\n      }\n      return;\n    } else if (data[data.length - 1] === '\\n') {\n      const selection = $getSelection();\n      if ($isRangeSelection(selection) || $isNodeSelection(selection)) {\n        // If the last character is a line break, we also need to insert\n        // a line break.\n        if ($isRangeSelection(selection)) {\n          const focus = selection.focus;\n          selection.anchor.set(focus.key, focus.offset, focus.type);\n        }\n        dispatchCommand(editor, KEY_ENTER_COMMAND, null);\n        return;\n      }\n    }\n  }\n  $updateSelectedTextFromDOM(true, editor, data);\n}\nfunction onCompositionEnd(event, editor) {\n  // Firefox fires onCompositionEnd before onInput, but Chrome/Webkit,\n  // fire onInput before onCompositionEnd. To ensure the sequence works\n  // like Chrome/Webkit we use the isFirefoxEndingComposition flag to\n  // defer handling of onCompositionEnd in Firefox till we have processed\n  // the logic in onInput.\n  if (IS_FIREFOX) {\n    isFirefoxEndingComposition = true;\n  } else if (!IS_IOS && (IS_SAFARI || IS_APPLE_WEBKIT)) {\n    // Fix\uFF1Ahttps://github.com/facebook/lexical/pull/7061\n    // In safari, onCompositionEnd triggers before keydown\n    // This will cause an extra character to be deleted when exiting the IME\n    // Therefore, a flag is used to mark that the keydown event is triggered after onCompositionEnd\n    // Ensure that an extra character is not deleted due to the backspace event being triggered in the keydown event.\n    isSafariEndingComposition = true;\n    safariEndCompositionEventData = event.data;\n  } else {\n    dispatchCommand(editor, COMPOSITION_END_COMMAND, event);\n  }\n}\nfunction onKeyDown(event, editor) {\n  lastKeyDownTimeStamp = event.timeStamp;\n  lastKeyCode = event.key;\n  if (editor.isComposing()) {\n    return;\n  }\n  dispatchCommand(editor, KEY_DOWN_COMMAND, event);\n}\nfunction $handleKeyDown(event) {\n  const editor = getActiveEditor();\n  if (event.key == null) {\n    return true;\n  }\n  if (isSafariEndingComposition) {\n    if (isBackspace(event)) {\n      updateEditorSync(editor, () => {\n        $onCompositionEndImpl(editor, safariEndCompositionEventData);\n      });\n      isSafariEndingComposition = false;\n      safariEndCompositionEventData = '';\n      return true;\n    }\n    isSafariEndingComposition = false;\n    safariEndCompositionEventData = '';\n  }\n  if (isMoveForward(event)) {\n    dispatchCommand(editor, KEY_ARROW_RIGHT_COMMAND, event);\n  } else if (isMoveToEnd(event)) {\n    dispatchCommand(editor, MOVE_TO_END, event);\n  } else if (isMoveBackward(event)) {\n    dispatchCommand(editor, KEY_ARROW_LEFT_COMMAND, event);\n  } else if (isMoveToStart(event)) {\n    dispatchCommand(editor, MOVE_TO_START, event);\n  } else if (isMoveUp(event)) {\n    dispatchCommand(editor, KEY_ARROW_UP_COMMAND, event);\n  } else if (isMoveDown(event)) {\n    dispatchCommand(editor, KEY_ARROW_DOWN_COMMAND, event);\n  } else if (isLineBreak(event)) {\n    isInsertLineBreak = true;\n    dispatchCommand(editor, KEY_ENTER_COMMAND, event);\n  } else if (isSpace(event)) {\n    dispatchCommand(editor, KEY_SPACE_COMMAND, event);\n  } else if (isOpenLineBreak(event)) {\n    event.preventDefault();\n    isInsertLineBreak = true;\n    dispatchCommand(editor, INSERT_LINE_BREAK_COMMAND, true);\n  } else if (isParagraph(event)) {\n    isInsertLineBreak = false;\n    dispatchCommand(editor, KEY_ENTER_COMMAND, event);\n  } else if (isDeleteBackward(event)) {\n    if (isBackspace(event)) {\n      dispatchCommand(editor, KEY_BACKSPACE_COMMAND, event);\n    } else {\n      event.preventDefault();\n      dispatchCommand(editor, DELETE_CHARACTER_COMMAND, true);\n    }\n  } else if (isEscape(event)) {\n    dispatchCommand(editor, KEY_ESCAPE_COMMAND, event);\n  } else if (isDeleteForward(event)) {\n    if (isDelete(event)) {\n      dispatchCommand(editor, KEY_DELETE_COMMAND, event);\n    } else {\n      event.preventDefault();\n      dispatchCommand(editor, DELETE_CHARACTER_COMMAND, false);\n    }\n  } else if (isDeleteWordBackward(event)) {\n    event.preventDefault();\n    dispatchCommand(editor, DELETE_WORD_COMMAND, true);\n  } else if (isDeleteWordForward(event)) {\n    event.preventDefault();\n    dispatchCommand(editor, DELETE_WORD_COMMAND, false);\n  } else if (isDeleteLineBackward(event)) {\n    event.preventDefault();\n    dispatchCommand(editor, DELETE_LINE_COMMAND, true);\n  } else if (isDeleteLineForward(event)) {\n    event.preventDefault();\n    dispatchCommand(editor, DELETE_LINE_COMMAND, false);\n  } else if (isBold(event)) {\n    event.preventDefault();\n    dispatchCommand(editor, FORMAT_TEXT_COMMAND, 'bold');\n  } else if (isUnderline(event)) {\n    event.preventDefault();\n    dispatchCommand(editor, FORMAT_TEXT_COMMAND, 'underline');\n  } else if (isItalic(event)) {\n    event.preventDefault();\n    dispatchCommand(editor, FORMAT_TEXT_COMMAND, 'italic');\n  } else if (isTab(event)) {\n    dispatchCommand(editor, KEY_TAB_COMMAND, event);\n  } else if (isUndo(event)) {\n    event.preventDefault();\n    dispatchCommand(editor, UNDO_COMMAND, undefined);\n  } else if (isRedo(event)) {\n    event.preventDefault();\n    dispatchCommand(editor, REDO_COMMAND, undefined);\n  } else {\n    const prevSelection = editor._editorState._selection;\n    if (prevSelection !== null && !$isRangeSelection(prevSelection)) {\n      // Only RangeSelection can use the native cut/copy/select all\n      if (isCopy(event)) {\n        event.preventDefault();\n        dispatchCommand(editor, COPY_COMMAND, event);\n      } else if (isCut(event)) {\n        event.preventDefault();\n        dispatchCommand(editor, CUT_COMMAND, event);\n      } else if (isSelectAll(event)) {\n        event.preventDefault();\n        dispatchCommand(editor, SELECT_ALL_COMMAND, event);\n      }\n    } else if (isSelectAll(event)) {\n      event.preventDefault();\n      dispatchCommand(editor, SELECT_ALL_COMMAND, event);\n    }\n  }\n  if (isModifier(event)) {\n    editor.dispatchCommand(KEY_MODIFIER_COMMAND, event);\n  }\n  return true;\n}\nfunction getRootElementRemoveHandles(rootElement) {\n  // @ts-expect-error: internal field\n  let eventHandles = rootElement.__lexicalEventHandles;\n  if (eventHandles === undefined) {\n    eventHandles = [];\n    // @ts-expect-error: internal field\n    rootElement.__lexicalEventHandles = eventHandles;\n  }\n  return eventHandles;\n}\n\n// Mapping root editors to their active nested editors, contains nested editors\n// mapping only, so if root editor is selected map will have no reference to free up memory\nconst activeNestedEditorsMap = new Map();\nfunction onDocumentSelectionChange(event) {\n  const domSelection = getDOMSelectionFromTarget(event.target);\n  if (domSelection === null) {\n    return;\n  }\n  const nextActiveEditor = getNearestEditorFromDOMNode(domSelection.anchorNode);\n  if (nextActiveEditor === null) {\n    return;\n  }\n  if (isSelectionChangeFromMouseDown) {\n    isSelectionChangeFromMouseDown = false;\n    updateEditorSync(nextActiveEditor, () => {\n      const lastSelection = $getPreviousSelection();\n      const domAnchorNode = domSelection.anchorNode;\n      if (isHTMLElement(domAnchorNode) || isDOMTextNode(domAnchorNode)) {\n        // If the user is attempting to click selection back onto text, then\n        // we should attempt create a range selection.\n        // When we click on an empty paragraph node or the end of a paragraph that ends\n        // with an image/poll, the nodeType will be ELEMENT_NODE\n        const newSelection = $internalCreateRangeSelection(lastSelection, domSelection, nextActiveEditor, event);\n        $setSelection(newSelection);\n      }\n    });\n  }\n\n  // When editor receives selection change event, we're checking if\n  // it has any sibling editors (within same parent editor) that were active\n  // before, and trigger selection change on it to nullify selection.\n  const editors = getEditorsToPropagate(nextActiveEditor);\n  const rootEditor = editors[editors.length - 1];\n  const rootEditorKey = rootEditor._key;\n  const activeNestedEditor = activeNestedEditorsMap.get(rootEditorKey);\n  const prevActiveEditor = activeNestedEditor || rootEditor;\n  if (prevActiveEditor !== nextActiveEditor) {\n    onSelectionChange(domSelection, prevActiveEditor, false);\n  }\n  onSelectionChange(domSelection, nextActiveEditor, true);\n\n  // If newly selected editor is nested, then add it to the map, clean map otherwise\n  if (nextActiveEditor !== rootEditor) {\n    activeNestedEditorsMap.set(rootEditorKey, nextActiveEditor);\n  } else if (activeNestedEditor) {\n    activeNestedEditorsMap.delete(rootEditorKey);\n  }\n}\nfunction stopLexicalPropagation(event) {\n  // We attach a special property to ensure the same event doesn't re-fire\n  // for parent editors.\n  // @ts-ignore\n  event._lexicalHandled = true;\n}\nfunction hasStoppedLexicalPropagation(event) {\n  // @ts-ignore\n  const stopped = event._lexicalHandled === true;\n  return stopped;\n}\nfunction addRootElementEvents(rootElement, editor) {\n  // We only want to have a single global selectionchange event handler, shared\n  // between all editor instances.\n  const doc = rootElement.ownerDocument;\n  rootElementToDocument.set(rootElement, doc);\n  const documentRootElementsCount = rootElementsRegistered.get(doc) ?? 0;\n  if (documentRootElementsCount < 1) {\n    doc.addEventListener('selectionchange', onDocumentSelectionChange);\n  }\n  rootElementsRegistered.set(doc, documentRootElementsCount + 1);\n\n  // @ts-expect-error: internal field\n  rootElement.__lexicalEditor = editor;\n  const removeHandles = getRootElementRemoveHandles(rootElement);\n  for (let i = 0; i < rootElementEvents.length; i++) {\n    const [eventName, onEvent] = rootElementEvents[i];\n    const eventHandler = typeof onEvent === 'function' ? event => {\n      if (hasStoppedLexicalPropagation(event)) {\n        return;\n      }\n      stopLexicalPropagation(event);\n      if (editor.isEditable() || eventName === 'click') {\n        onEvent(event, editor);\n      }\n    } : event => {\n      if (hasStoppedLexicalPropagation(event)) {\n        return;\n      }\n      stopLexicalPropagation(event);\n      const isEditable = editor.isEditable();\n      switch (eventName) {\n        case 'cut':\n          return isEditable && dispatchCommand(editor, CUT_COMMAND, event);\n        case 'copy':\n          return dispatchCommand(editor, COPY_COMMAND, event);\n        case 'paste':\n          return isEditable && dispatchCommand(editor, PASTE_COMMAND, event);\n        case 'dragstart':\n          return isEditable && dispatchCommand(editor, DRAGSTART_COMMAND, event);\n        case 'dragover':\n          return isEditable && dispatchCommand(editor, DRAGOVER_COMMAND, event);\n        case 'dragend':\n          return isEditable && dispatchCommand(editor, DRAGEND_COMMAND, event);\n        case 'focus':\n          return isEditable && dispatchCommand(editor, FOCUS_COMMAND, event);\n        case 'blur':\n          {\n            return isEditable && dispatchCommand(editor, BLUR_COMMAND, event);\n          }\n        case 'drop':\n          return isEditable && dispatchCommand(editor, DROP_COMMAND, event);\n      }\n    };\n    rootElement.addEventListener(eventName, eventHandler);\n    removeHandles.push(() => {\n      rootElement.removeEventListener(eventName, eventHandler);\n    });\n  }\n}\nconst rootElementNotRegisteredWarning = warnOnlyOnce('Root element not registered');\nfunction removeRootElementEvents(rootElement) {\n  const doc = rootElementToDocument.get(rootElement);\n  if (doc === undefined) {\n    rootElementNotRegisteredWarning();\n    return;\n  }\n  const documentRootElementsCount = rootElementsRegistered.get(doc);\n  if (documentRootElementsCount === undefined) {\n    // This can happen if setRootElement() failed\n    rootElementNotRegisteredWarning();\n    return;\n  }\n\n  // We only want to have a single global selectionchange event handler, shared\n  // between all editor instances.\n  const newCount = documentRootElementsCount - 1;\n  if (!(newCount >= 0)) {\n    formatDevErrorMessage(`Root element count less than 0`);\n  }\n  rootElementToDocument.delete(rootElement);\n  rootElementsRegistered.set(doc, newCount);\n  if (newCount === 0) {\n    doc.removeEventListener('selectionchange', onDocumentSelectionChange);\n  }\n  const editor = getEditorPropertyFromDOMNode(rootElement);\n  if (isLexicalEditor(editor)) {\n    cleanActiveNestedEditorsMap(editor);\n    // @ts-expect-error: internal field\n    rootElement.__lexicalEditor = null;\n  } else if (editor) {\n    {\n      formatDevErrorMessage(`Attempted to remove event handlers from a node that does not belong to this build of Lexical`);\n    }\n  }\n  const removeHandles = getRootElementRemoveHandles(rootElement);\n  for (let i = 0; i < removeHandles.length; i++) {\n    removeHandles[i]();\n  }\n\n  // @ts-expect-error: internal field\n  rootElement.__lexicalEventHandles = [];\n}\nfunction cleanActiveNestedEditorsMap(editor) {\n  if (editor._parentEditor !== null) {\n    // For nested editor cleanup map if this editor was marked as active\n    const editors = getEditorsToPropagate(editor);\n    const rootEditor = editors[editors.length - 1];\n    const rootEditorKey = rootEditor._key;\n    if (activeNestedEditorsMap.get(rootEditorKey) === editor) {\n      activeNestedEditorsMap.delete(rootEditorKey);\n    }\n  } else {\n    // For top-level editors cleanup map\n    activeNestedEditorsMap.delete(editor._key);\n  }\n}\nfunction markSelectionChangeFromDOMUpdate() {\n  isSelectionChangeFromDOMUpdate = true;\n}\nfunction markCollapsedSelectionFormat(format, style, offset, key, timeStamp) {\n  collapsedSelectionFormat = [format, style, offset, key, timeStamp];\n}\n\n/**\n * The base type for all serialized nodes\n */\n\n/**\n * EXPERIMENTAL\n * The configuration of a node returned by LexicalNode.$config()\n *\n * @example\n * ```ts\n * class CustomText extends TextNode {\n *   $config() {\n *     return this.config('custom-text', {extends: TextNode}};\n *   }\n * }\n * ```\n */\n\n/**\n * This is the type of LexicalNode.$config() that can be\n * overridden by subclasses.\n */\n\n/**\n * Used to extract the node and type from a StaticNodeConfigRecord\n */\n\n/**\n * Any StaticNodeConfigValue (for generics and collections)\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n/**\n * @internal\n *\n * This is the more specific type than BaseStaticNodeConfig that a subclass\n * should return from $config()\n */\n\n/**\n * Extract the type from a node based on its $config\n *\n * @example\n * ```ts\n * type TextNodeType = GetStaticNodeType<TextNode>;\n *      // ? 'text'\n * ```\n */\n\n/**\n * The most precise type we can infer for the JSON that will\n * be produced by T.exportJSON().\n *\n * Do not use this for the return type of T.exportJSON()! It must be\n * a more generic type to be compatible with subclassing.\n */\n\n/**\n * Omit the children, type, and version properties from the given SerializedLexicalNode definition.\n */\n\n/** @internal */\n\nfunction $removeNode(nodeToRemove, restoreSelection, preserveEmptyParent) {\n  errorOnReadOnly();\n  const key = nodeToRemove.__key;\n  const parent = nodeToRemove.getParent();\n  if (parent === null) {\n    return;\n  }\n  const selection = $maybeMoveChildrenSelectionToParent(nodeToRemove);\n  let selectionMoved = false;\n  if ($isRangeSelection(selection) && restoreSelection) {\n    const anchor = selection.anchor;\n    const focus = selection.focus;\n    if (anchor.key === key) {\n      moveSelectionPointToSibling(anchor, nodeToRemove, parent, nodeToRemove.getPreviousSibling(), nodeToRemove.getNextSibling());\n      selectionMoved = true;\n    }\n    if (focus.key === key) {\n      moveSelectionPointToSibling(focus, nodeToRemove, parent, nodeToRemove.getPreviousSibling(), nodeToRemove.getNextSibling());\n      selectionMoved = true;\n    }\n  } else if ($isNodeSelection(selection) && restoreSelection && nodeToRemove.isSelected()) {\n    nodeToRemove.selectPrevious();\n  }\n  if ($isRangeSelection(selection) && restoreSelection && !selectionMoved) {\n    // Doing this is O(n) so lets avoid it unless we need to do it\n    const index = nodeToRemove.getIndexWithinParent();\n    removeFromParent(nodeToRemove);\n    $updateElementSelectionOnCreateDeleteNode(selection, parent, index, -1);\n  } else {\n    removeFromParent(nodeToRemove);\n  }\n  if (!preserveEmptyParent && !$isRootOrShadowRoot(parent) && !parent.canBeEmpty() && parent.isEmpty()) {\n    $removeNode(parent, restoreSelection);\n  }\n  if (restoreSelection && selection && $isRootNode(parent) && parent.isEmpty()) {\n    parent.selectEnd();\n  }\n}\n/**\n * An identity function that will infer the type of DOM nodes\n * based on tag names to make it easier to construct a\n * DOMConversionMap.\n */\nfunction buildImportMap(importMap) {\n  return importMap;\n}\nconst EPHEMERAL = Symbol.for('ephemeral');\n\n/**\n * @internal\n * @param node any LexicalNode\n * @returns true if the node was created with {@link $cloneWithPropertiesEphemeral}\n */\nfunction $isEphemeral(node) {\n  return node[EPHEMERAL] || false;\n}\n/**\n * @internal\n * Mark this node as ephemeral, its instance always returns this\n * for getLatest and getWritable. It must not be added to an EditorState.\n */\nfunction $markEphemeral(node) {\n  node[EPHEMERAL] = true;\n  return node;\n}\nclass LexicalNode {\n  /** @internal Allow us to look up the type including static props */\n\n  /** @internal */\n  __type;\n  /** @internal */\n  //@ts-ignore We set the key in the constructor.\n  __key;\n  /** @internal */\n  __parent;\n  /** @internal */\n  __prev;\n  /** @internal */\n  __next;\n  /** @internal */\n  __state;\n\n  // Flow doesn't support abstract classes unfortunately, so we can't _force_\n  // subclasses of Node to implement statics. All subclasses of Node should have\n  // a static getType and clone method though. We define getType and clone here so we can call it\n  // on any  Node, and we throw this error by default since the subclass should provide\n  // their own implementation.\n  /**\n   * Returns the string type of this node. Every node must\n   * implement this and it MUST BE UNIQUE amongst nodes registered\n   * on the editor.\n   *\n   */\n  static getType() {\n    const {\n      ownNodeType\n    } = getStaticNodeConfig(this);\n    if (!(ownNodeType !== undefined)) {\n      formatDevErrorMessage(`LexicalNode: Node ${this.name} does not implement .getType().`);\n    }\n    return ownNodeType;\n  }\n\n  /**\n   * Clones this node, creating a new node with a different key\n   * and adding it to the EditorState (but not attaching it anywhere!). All nodes must\n   * implement this method.\n   *\n   */\n  static clone(_data) {\n    {\n      formatDevErrorMessage(`LexicalNode: Node ${this.name} does not implement .clone().`);\n    }\n  }\n\n  /**\n   * Override this to implement the new static node configuration protocol,\n   * this method is called directly on the prototype and must not depend\n   * on anything initialized in the constructor. Generally it should be\n   * a trivial implementation.\n   *\n   * @example\n   * ```ts\n   * class MyNode extends TextNode {\n   *   $config() {\n   *     return this.config('my-node', {extends: TextNode});\n   *   }\n   * }\n   * ```\n   */\n  $config() {\n    return {};\n  }\n\n  /**\n   * This is a convenience method for $config that\n   * aids in type inference. See {@link LexicalNode.$config}\n   * for example usage.\n   */\n  config(type, config) {\n    const parentKlass = config.extends || Object.getPrototypeOf(this.constructor);\n    Object.assign(config, {\n      extends: parentKlass,\n      type\n    });\n    return {\n      [type]: config\n    };\n  }\n\n  /**\n   * Perform any state updates on the clone of prevNode that are not already\n   * handled by the constructor call in the static clone method. If you have\n   * state to update in your clone that is not handled directly by the\n   * constructor, it is advisable to override this method but it is required\n   * to include a call to `super.afterCloneFrom(prevNode)` in your\n   * implementation. This is only intended to be called by\n   * {@link $cloneWithProperties} function or via a super call.\n   *\n   * @example\n   * ```ts\n   * class ClassesTextNode extends TextNode {\n   *   // Not shown: static getType, static importJSON, exportJSON, createDOM, updateDOM\n   *   __classes = new Set<string>();\n   *   static clone(node: ClassesTextNode): ClassesTextNode {\n   *     // The inherited TextNode constructor is used here, so\n   *     // classes is not set by this method.\n   *     return new ClassesTextNode(node.__text, node.__key);\n   *   }\n   *   afterCloneFrom(node: this): void {\n   *     // This calls TextNode.afterCloneFrom and LexicalNode.afterCloneFrom\n   *     // for necessary state updates\n   *     super.afterCloneFrom(node);\n   *     this.__addClasses(node.__classes);\n   *   }\n   *   // This method is a private implementation detail, it is not\n   *   // suitable for the public API because it does not call getWritable\n   *   __addClasses(classNames: Iterable<string>): this {\n   *     for (const className of classNames) {\n   *       this.__classes.add(className);\n   *     }\n   *     return this;\n   *   }\n   *   addClass(...classNames: string[]): this {\n   *     return this.getWritable().__addClasses(classNames);\n   *   }\n   *   removeClass(...classNames: string[]): this {\n   *     const node = this.getWritable();\n   *     for (const className of classNames) {\n   *       this.__classes.delete(className);\n   *     }\n   *     return this;\n   *   }\n   *   getClasses(): Set<string> {\n   *     return this.getLatest().__classes;\n   *   }\n   * }\n   * ```\n   *\n   */\n  afterCloneFrom(prevNode) {\n    if (this.__key === prevNode.__key) {\n      this.__parent = prevNode.__parent;\n      this.__next = prevNode.__next;\n      this.__prev = prevNode.__prev;\n      this.__state = prevNode.__state;\n    } else if (prevNode.__state) {\n      this.__state = prevNode.__state.getWritable(this);\n    }\n  }\n\n  /**\n   * Reset state in this copy of originalNode, if necessary\n   *\n   * @param originalNode\n   */\n  resetOnCopyNodeFrom(originalNode) {\n    if (this.__state) {\n      this.__state = this.__state.getWritable(this).resetOnCopyNode();\n    }\n  }\n\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  static importDOM;\n  constructor(key) {\n    this.__type = this.constructor.getType();\n    this.__parent = null;\n    this.__prev = null;\n    this.__next = null;\n    Object.defineProperty(this, '__state', {\n      configurable: true,\n      enumerable: false,\n      value: undefined,\n      writable: true\n    });\n    $setNodeKey(this, key);\n    {\n      if (this.__type !== 'root') {\n        errorOnTypeKlassMismatch(this.__type, this.constructor);\n      }\n    }\n  }\n  // Getters and Traversers\n\n  /**\n   * Returns the string type of this node.\n   */\n  getType() {\n    return this.__type;\n  }\n  isInline() {\n    {\n      formatDevErrorMessage(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`);\n    }\n  }\n\n  /**\n   * Returns true if there is a path between this node and the RootNode, false otherwise.\n   * This is a way of determining if the node is \"attached\" EditorState. Unattached nodes\n   * won't be reconciled and will ultimately be cleaned up by the Lexical GC.\n   */\n  isAttached() {\n    let nodeKey = this.__key;\n    while (nodeKey !== null) {\n      if (nodeKey === 'root') {\n        return true;\n      }\n      const node = $getNodeByKey(nodeKey);\n      if (node === null) {\n        break;\n      }\n      nodeKey = node.__parent;\n    }\n    return false;\n  }\n\n  /**\n   * Returns true if this node is contained within the provided Selection., false otherwise.\n   * Relies on the algorithms implemented in {@link BaseSelection.getNodes} to determine\n   * what's included.\n   *\n   * @param selection - The selection that we want to determine if the node is in.\n   */\n  isSelected(selection) {\n    const targetSelection = selection || $getSelection();\n    if (targetSelection == null) {\n      return false;\n    }\n    const isSelected = targetSelection.getNodes().some(n => n.__key === this.__key);\n    if ($isTextNode(this)) {\n      return isSelected;\n    }\n    // For inline images inside of element nodes.\n    // Without this change the image will be selected if the cursor is before or after it.\n    const isElementRangeSelection = $isRangeSelection(targetSelection) && targetSelection.anchor.type === 'element' && targetSelection.focus.type === 'element';\n    if (isElementRangeSelection) {\n      if (targetSelection.isCollapsed()) {\n        return false;\n      }\n      const parentNode = this.getParent();\n      if ($isDecoratorNode(this) && this.isInline() && parentNode) {\n        const firstPoint = targetSelection.isBackward() ? targetSelection.focus : targetSelection.anchor;\n        if (parentNode.is(firstPoint.getNode()) && firstPoint.offset === parentNode.getChildrenSize() && this.is(parentNode.getLastChild())) {\n          return false;\n        }\n      }\n    }\n    return isSelected;\n  }\n\n  /**\n   * Returns this nodes key.\n   */\n  getKey() {\n    // Key is stable between copies\n    return this.__key;\n  }\n\n  /**\n   * Returns the zero-based index of this node within the parent.\n   */\n  getIndexWithinParent() {\n    const parent = this.getParent();\n    if (parent === null) {\n      return -1;\n    }\n    let node = parent.getFirstChild();\n    let index = 0;\n    while (node !== null) {\n      if (this.is(node)) {\n        return index;\n      }\n      index++;\n      node = node.getNextSibling();\n    }\n    return -1;\n  }\n\n  /**\n   * Returns the parent of this node, or null if none is found.\n   */\n  getParent() {\n    const parent = this.getLatest().__parent;\n    if (parent === null) {\n      return null;\n    }\n    return $getNodeByKey(parent);\n  }\n\n  /**\n   * Returns the parent of this node, or throws if none is found.\n   */\n  getParentOrThrow() {\n    const parent = this.getParent();\n    if (parent === null) {\n      {\n        formatDevErrorMessage(`Expected node ${this.__key} to have a parent.`);\n      }\n    }\n    return parent;\n  }\n\n  /**\n   * Returns the highest (in the EditorState tree)\n   * non-root ancestor of this node, or null if none is found. See {@link lexical!$isRootOrShadowRoot}\n   * for more information on which Elements comprise \"roots\".\n   */\n  getTopLevelElement() {\n    let node = this;\n    while (node !== null) {\n      const parent = node.getParent();\n      if ($isRootOrShadowRoot(parent)) {\n        if (!($isElementNode(node) || node === this && $isDecoratorNode(node))) {\n          formatDevErrorMessage(`Children of root nodes must be elements or decorators`);\n        }\n        return node;\n      }\n      node = parent;\n    }\n    return null;\n  }\n\n  /**\n   * Returns the highest (in the EditorState tree)\n   * non-root ancestor of this node, or throws if none is found. See {@link lexical!$isRootOrShadowRoot}\n   * for more information on which Elements comprise \"roots\".\n   */\n  getTopLevelElementOrThrow() {\n    const parent = this.getTopLevelElement();\n    if (parent === null) {\n      {\n        formatDevErrorMessage(`Expected node ${this.__key} to have a top parent element.`);\n      }\n    }\n    return parent;\n  }\n\n  /**\n   * Returns a list of the every ancestor of this node,\n   * all the way up to the RootNode.\n   *\n   */\n  getParents() {\n    const parents = [];\n    let node = this.getParent();\n    while (node !== null) {\n      parents.push(node);\n      node = node.getParent();\n    }\n    return parents;\n  }\n\n  /**\n   * Returns a list of the keys of every ancestor of this node,\n   * all the way up to the RootNode.\n   *\n   */\n  getParentKeys() {\n    const parents = [];\n    let node = this.getParent();\n    while (node !== null) {\n      parents.push(node.__key);\n      node = node.getParent();\n    }\n    return parents;\n  }\n\n  /**\n   * Returns the \"previous\" siblings - that is, the node that comes\n   * before this one in the same parent.\n   *\n   */\n  getPreviousSibling() {\n    const self = this.getLatest();\n    const prevKey = self.__prev;\n    return prevKey === null ? null : $getNodeByKey(prevKey);\n  }\n\n  /**\n   * Returns the \"previous\" siblings - that is, the nodes that come between\n   * this one and the first child of it's parent, inclusive.\n   *\n   */\n  getPreviousSiblings() {\n    const siblings = [];\n    const parent = this.getParent();\n    if (parent === null) {\n      return siblings;\n    }\n    let node = parent.getFirstChild();\n    while (node !== null) {\n      if (node.is(this)) {\n        break;\n      }\n      siblings.push(node);\n      node = node.getNextSibling();\n    }\n    return siblings;\n  }\n\n  /**\n   * Returns the \"next\" siblings - that is, the node that comes\n   * after this one in the same parent\n   *\n   */\n  getNextSibling() {\n    const self = this.getLatest();\n    const nextKey = self.__next;\n    return nextKey === null ? null : $getNodeByKey(nextKey);\n  }\n\n  /**\n   * Returns all \"next\" siblings - that is, the nodes that come between this\n   * one and the last child of it's parent, inclusive.\n   *\n   */\n  getNextSiblings() {\n    const siblings = [];\n    let node = this.getNextSibling();\n    while (node !== null) {\n      siblings.push(node);\n      node = node.getNextSibling();\n    }\n    return siblings;\n  }\n\n  /**\n   * @deprecated use {@link $getCommonAncestor}\n   *\n   * Returns the closest common ancestor of this node and the provided one or null\n   * if one cannot be found.\n   *\n   * @param node - the other node to find the common ancestor of.\n   */\n  getCommonAncestor(node) {\n    const a = $isElementNode(this) ? this : this.getParent();\n    const b = $isElementNode(node) ? node : node.getParent();\n    const result = a && b ? $getCommonAncestor(a, b) : null;\n    return result ? result.commonAncestor /* TODO this type cast is a lie, but fixing it would break backwards compatibility */ : null;\n  }\n\n  /**\n   * Returns true if the provided node is the exact same one as this node, from Lexical's perspective.\n   * Always use this instead of referential equality.\n   *\n   * @param object - the node to perform the equality comparison on.\n   */\n  is(object) {\n    if (object == null) {\n      return false;\n    }\n    return this.__key === object.__key;\n  }\n\n  /**\n   * Returns true if this node logically precedes the target node in the\n   * editor state, false otherwise (including if there is no common ancestor).\n   *\n   * Note that this notion of isBefore is based on post-order; a descendant\n   * node is always before its ancestors. See also\n   * {@link $getCommonAncestor} and {@link $comparePointCaretNext} for\n   * more flexible ways to determine the relative positions of nodes.\n   *\n   * @param targetNode - the node we're testing to see if it's after this one.\n   */\n  isBefore(targetNode) {\n    const compare = $getCommonAncestor(this, targetNode);\n    if (compare === null) {\n      return false;\n    }\n    if (compare.type === 'descendant') {\n      return true;\n    }\n    if (compare.type === 'branch') {\n      return $getCommonAncestorResultBranchOrder(compare) === -1;\n    }\n    if (!(compare.type === 'same' || compare.type === 'ancestor')) {\n      formatDevErrorMessage(`LexicalNode.isBefore: exhaustiveness check`);\n    }\n    return false;\n  }\n\n  /**\n   * Returns true if this node is an ancestor of and distinct from the target node, false otherwise.\n   *\n   * @param targetNode - the would-be child node.\n   */\n  isParentOf(targetNode) {\n    const result = $getCommonAncestor(this, targetNode);\n    return result !== null && result.type === 'ancestor';\n  }\n\n  // TO-DO: this function can be simplified a lot\n  /**\n   * Returns a list of nodes that are between this node and\n   * the target node in the EditorState.\n   *\n   * @param targetNode - the node that marks the other end of the range of nodes to be returned.\n   */\n  getNodesBetween(targetNode) {\n    const isBefore = this.isBefore(targetNode);\n    const nodes = [];\n    const visited = new Set();\n    let node = this;\n    while (true) {\n      if (node === null) {\n        break;\n      }\n      const key = node.__key;\n      if (!visited.has(key)) {\n        visited.add(key);\n        nodes.push(node);\n      }\n      if (node === targetNode) {\n        break;\n      }\n      const child = $isElementNode(node) ? isBefore ? node.getFirstChild() : node.getLastChild() : null;\n      if (child !== null) {\n        node = child;\n        continue;\n      }\n      const nextSibling = isBefore ? node.getNextSibling() : node.getPreviousSibling();\n      if (nextSibling !== null) {\n        node = nextSibling;\n        continue;\n      }\n      const parent = node.getParentOrThrow();\n      if (!visited.has(parent.__key)) {\n        nodes.push(parent);\n      }\n      if (parent === targetNode) {\n        break;\n      }\n      let parentSibling = null;\n      let ancestor = parent;\n      do {\n        if (ancestor === null) {\n          {\n            formatDevErrorMessage(`getNodesBetween: ancestor is null`);\n          }\n        }\n        parentSibling = isBefore ? ancestor.getNextSibling() : ancestor.getPreviousSibling();\n        ancestor = ancestor.getParent();\n        if (ancestor !== null) {\n          if (parentSibling === null && !visited.has(ancestor.__key)) {\n            nodes.push(ancestor);\n          }\n        } else {\n          break;\n        }\n      } while (parentSibling === null);\n      node = parentSibling;\n    }\n    if (!isBefore) {\n      nodes.reverse();\n    }\n    return nodes;\n  }\n\n  /**\n   * Returns true if this node has been marked dirty during this update cycle.\n   *\n   */\n  isDirty() {\n    const editor = getActiveEditor();\n    const dirtyLeaves = editor._dirtyLeaves;\n    return dirtyLeaves !== null && dirtyLeaves.has(this.__key);\n  }\n\n  /**\n   * Returns the latest version of the node from the active EditorState.\n   * This is used to avoid getting values from stale node references.\n   *\n   */\n  getLatest() {\n    if ($isEphemeral(this)) {\n      return this;\n    }\n    const latest = $getNodeByKey(this.__key);\n    if (latest === null) {\n      {\n        formatDevErrorMessage(`Lexical node does not exist in active editor state. Avoid using the same node references between nested closures from editorState.read/editor.update.`);\n      }\n    }\n    return latest;\n  }\n\n  /**\n   * Returns a mutable version of the node using {@link $cloneWithProperties}\n   * if necessary. Will throw an error if called outside of a Lexical Editor\n   * {@link LexicalEditor.update} callback.\n   *\n   */\n  getWritable() {\n    if ($isEphemeral(this)) {\n      return this;\n    }\n    errorOnReadOnly();\n    const editorState = getActiveEditorState();\n    const editor = getActiveEditor();\n    const nodeMap = editorState._nodeMap;\n    const key = this.__key;\n    // Ensure we get the latest node from pending state\n    const latestNode = this.getLatest();\n    const cloneNotNeeded = editor._cloneNotNeeded;\n    const selection = $getSelection();\n    if (selection !== null) {\n      selection.setCachedNodes(null);\n    }\n    if (cloneNotNeeded.has(key)) {\n      // Transforms clear the dirty node set on each iteration to keep track on newly dirty nodes\n      internalMarkNodeAsDirty(latestNode);\n      return latestNode;\n    }\n    const mutableNode = $cloneWithProperties(latestNode);\n    cloneNotNeeded.add(key);\n    internalMarkNodeAsDirty(mutableNode);\n    // Update reference in node map\n    nodeMap.set(key, mutableNode);\n    return mutableNode;\n  }\n\n  /**\n   * Returns the text content of the node. Override this for\n   * custom nodes that should have a representation in plain text\n   * format (for copy + paste, for example)\n   *\n   */\n  getTextContent() {\n    return '';\n  }\n\n  /**\n   * Returns the length of the string produced by calling getTextContent on this node.\n   *\n   */\n  getTextContentSize() {\n    return this.getTextContent().length;\n  }\n\n  // View\n\n  /**\n   * Called during the reconciliation process to determine which nodes\n   * to insert into the DOM for this Lexical Node.\n   *\n   * This method must return exactly one HTMLElement. Nested elements are not supported.\n   *\n   * Do not attempt to update the Lexical EditorState during this phase of the update lifecycle.\n   *\n   * @param _config - allows access to things like the EditorTheme (to apply classes) during reconciliation.\n   * @param _editor - allows access to the editor for context during reconciliation.\n   *\n   * */\n  createDOM(_config, _editor) {\n    {\n      formatDevErrorMessage(`createDOM: base method not extended`);\n    }\n  }\n\n  /**\n   * Called when a node changes and should update the DOM\n   * in whatever way is necessary to make it align with any changes that might\n   * have happened during the update.\n   *\n   * Returning \"true\" here will cause lexical to unmount and recreate the DOM node\n   * (by calling createDOM). You would need to do this if the element tag changes,\n   * for instance.\n   *\n   * */\n  updateDOM(_prevNode, _dom, _config) {\n    {\n      formatDevErrorMessage(`updateDOM: base method not extended`);\n    }\n  }\n\n  /**\n   * Controls how the this node is serialized to HTML. This is important for\n   * copy and paste between Lexical and non-Lexical editors, or Lexical editors with different namespaces,\n   * in which case the primary transfer format is HTML. It's also important if you're serializing\n   * to HTML for any other reason via {@link @lexical/html!$generateHtmlFromNodes}. You could\n   * also use this method to build your own HTML renderer.\n   *\n   * */\n  exportDOM(editor) {\n    const element = this.createDOM(editor._config, editor);\n    return {\n      element\n    };\n  }\n\n  /**\n   * Controls how the this node is serialized to JSON. This is important for\n   * copy and paste between Lexical editors sharing the same namespace. It's also important\n   * if you're serializing to JSON for persistent storage somewhere.\n   * See [Serialization & Deserialization](https://lexical.dev/docs/concepts/serialization#lexical---html).\n   *\n   * */\n  exportJSON() {\n    const state = this.__state ? this.__state.toJSON() : undefined;\n    return {\n      type: this.__type,\n      version: 1,\n      ...state\n    };\n  }\n\n  /**\n   * Controls how the this node is deserialized from JSON. This is usually boilerplate,\n   * but provides an abstraction between the node implementation and serialized interface that can\n   * be important if you ever make breaking changes to a node schema (by adding or removing properties).\n   * See [Serialization & Deserialization](https://lexical.dev/docs/concepts/serialization#lexical---html).\n   *\n   * */\n  static importJSON(_serializedNode) {\n    {\n      formatDevErrorMessage(`LexicalNode: Node ${this.name} does not implement .importJSON().`);\n    }\n  }\n\n  /**\n   * Update this LexicalNode instance from serialized JSON. It's recommended\n   * to implement as much logic as possible in this method instead of the\n   * static importJSON method, so that the functionality can be inherited in subclasses.\n   *\n   * The LexicalUpdateJSON utility type should be used to ignore any type, version,\n   * or children properties in the JSON so that the extended JSON from subclasses\n   * are acceptable parameters for the super call.\n   *\n   * If overridden, this method must call super.\n   *\n   * @example\n   * ```ts\n   * class MyTextNode extends TextNode {\n   *   // ...\n   *   static importJSON(serializedNode: SerializedMyTextNode): MyTextNode {\n   *     return $createMyTextNode()\n   *       .updateFromJSON(serializedNode);\n   *   }\n   *   updateFromJSON(\n   *     serializedNode: LexicalUpdateJSON<SerializedMyTextNode>,\n   *   ): this {\n   *     return super.updateFromJSON(serializedNode)\n   *       .setMyProperty(serializedNode.myProperty);\n   *   }\n   * }\n   * ```\n   **/\n  updateFromJSON(serializedNode) {\n    return $updateStateFromJSON(this, serializedNode);\n  }\n\n  /**\n   * @experimental\n   *\n   * Registers the returned function as a transform on the node during\n   * Editor initialization. Most such use cases should be addressed via\n   * the {@link LexicalEditor.registerNodeTransform} API.\n   *\n   * Experimental - use at your own risk.\n   */\n  static transform() {\n    return null;\n  }\n\n  // Setters and mutators\n\n  /**\n   * Removes this LexicalNode from the EditorState. If the node isn't re-inserted\n   * somewhere, the Lexical garbage collector will eventually clean it up.\n   *\n   * @param preserveEmptyParent - If falsy, the node's parent will be removed if\n   * it's empty after the removal operation. This is the default behavior, subject to\n   * other node heuristics such as {@link ElementNode#canBeEmpty}\n   * */\n  remove(preserveEmptyParent) {\n    $removeNode(this, true, preserveEmptyParent);\n  }\n\n  /**\n   * Replaces this LexicalNode with the provided node, optionally transferring the children\n   * of the replaced node to the replacing node.\n   *\n   * @param replaceWith - The node to replace this one with.\n   * @param includeChildren - Whether or not to transfer the children of this node to the replacing node.\n   * */\n  replace(replaceWith, includeChildren) {\n    errorOnReadOnly();\n    let selection = $getSelection();\n    if (selection !== null) {\n      selection = selection.clone();\n    }\n    errorOnInsertTextNodeOnRoot(this, replaceWith);\n    const self = this.getLatest();\n    const toReplaceKey = this.__key;\n    const key = replaceWith.__key;\n    const writableReplaceWith = replaceWith.getWritable();\n    const writableParent = this.getParentOrThrow().getWritable();\n    const size = writableParent.__size;\n    removeFromParent(writableReplaceWith);\n    const prevSibling = self.getPreviousSibling();\n    const nextSibling = self.getNextSibling();\n    const prevKey = self.__prev;\n    const nextKey = self.__next;\n    const parentKey = self.__parent;\n    $removeNode(self, false, true);\n    if (prevSibling === null) {\n      writableParent.__first = key;\n    } else {\n      const writablePrevSibling = prevSibling.getWritable();\n      writablePrevSibling.__next = key;\n    }\n    writableReplaceWith.__prev = prevKey;\n    if (nextSibling === null) {\n      writableParent.__last = key;\n    } else {\n      const writableNextSibling = nextSibling.getWritable();\n      writableNextSibling.__prev = key;\n    }\n    writableReplaceWith.__next = nextKey;\n    writableReplaceWith.__parent = parentKey;\n    writableParent.__size = size;\n    if (includeChildren) {\n      if (!($isElementNode(this) && $isElementNode(writableReplaceWith))) {\n        formatDevErrorMessage(`includeChildren should only be true for ElementNodes`);\n      }\n      this.getChildren().forEach(child => {\n        writableReplaceWith.append(child);\n      });\n    }\n    if ($isRangeSelection(selection)) {\n      $setSelection(selection);\n      const anchor = selection.anchor;\n      const focus = selection.focus;\n      if (anchor.key === toReplaceKey) {\n        $moveSelectionPointToEnd(anchor, writableReplaceWith);\n      }\n      if (focus.key === toReplaceKey) {\n        $moveSelectionPointToEnd(focus, writableReplaceWith);\n      }\n    }\n    if ($getCompositionKey() === toReplaceKey) {\n      $setCompositionKey(key);\n    }\n    return writableReplaceWith;\n  }\n\n  /**\n   * Inserts a node after this LexicalNode (as the next sibling).\n   *\n   * @param nodeToInsert - The node to insert after this one.\n   * @param restoreSelection - Whether or not to attempt to resolve the\n   * selection to the appropriate place after the operation is complete.\n   * */\n  insertAfter(nodeToInsert, restoreSelection = true) {\n    errorOnReadOnly();\n    errorOnInsertTextNodeOnRoot(this, nodeToInsert);\n    const writableSelf = this.getWritable();\n    const writableNodeToInsert = nodeToInsert.getWritable();\n    const oldParent = writableNodeToInsert.getParent();\n    const selection = $getSelection();\n    let elementAnchorSelectionOnNode = false;\n    let elementFocusSelectionOnNode = false;\n    if (oldParent !== null) {\n      // TODO: this is O(n), can we improve?\n      const oldIndex = nodeToInsert.getIndexWithinParent();\n      removeFromParent(writableNodeToInsert);\n      if ($isRangeSelection(selection)) {\n        const oldParentKey = oldParent.__key;\n        const anchor = selection.anchor;\n        const focus = selection.focus;\n        elementAnchorSelectionOnNode = anchor.type === 'element' && anchor.key === oldParentKey && anchor.offset === oldIndex + 1;\n        elementFocusSelectionOnNode = focus.type === 'element' && focus.key === oldParentKey && focus.offset === oldIndex + 1;\n      }\n    }\n    const nextSibling = this.getNextSibling();\n    const writableParent = this.getParentOrThrow().getWritable();\n    const insertKey = writableNodeToInsert.__key;\n    const nextKey = writableSelf.__next;\n    if (nextSibling === null) {\n      writableParent.__last = insertKey;\n    } else {\n      const writableNextSibling = nextSibling.getWritable();\n      writableNextSibling.__prev = insertKey;\n    }\n    writableParent.__size++;\n    writableSelf.__next = insertKey;\n    writableNodeToInsert.__next = nextKey;\n    writableNodeToInsert.__prev = writableSelf.__key;\n    writableNodeToInsert.__parent = writableSelf.__parent;\n    if (restoreSelection && $isRangeSelection(selection)) {\n      const index = this.getIndexWithinParent();\n      $updateElementSelectionOnCreateDeleteNode(selection, writableParent, index + 1);\n      const writableParentKey = writableParent.__key;\n      if (elementAnchorSelectionOnNode) {\n        selection.anchor.set(writableParentKey, index + 2, 'element');\n      }\n      if (elementFocusSelectionOnNode) {\n        selection.focus.set(writableParentKey, index + 2, 'element');\n      }\n    }\n    return nodeToInsert;\n  }\n\n  /**\n   * Inserts a node before this LexicalNode (as the previous sibling).\n   *\n   * @param nodeToInsert - The node to insert before this one.\n   * @param restoreSelection - Whether or not to attempt to resolve the\n   * selection to the appropriate place after the operation is complete.\n   * */\n  insertBefore(nodeToInsert, restoreSelection = true) {\n    errorOnReadOnly();\n    errorOnInsertTextNodeOnRoot(this, nodeToInsert);\n    const writableSelf = this.getWritable();\n    const writableNodeToInsert = nodeToInsert.getWritable();\n    const insertKey = writableNodeToInsert.__key;\n    removeFromParent(writableNodeToInsert);\n    const prevSibling = this.getPreviousSibling();\n    const writableParent = this.getParentOrThrow().getWritable();\n    const prevKey = writableSelf.__prev;\n    // TODO: this is O(n), can we improve?\n    const index = this.getIndexWithinParent();\n    if (prevSibling === null) {\n      writableParent.__first = insertKey;\n    } else {\n      const writablePrevSibling = prevSibling.getWritable();\n      writablePrevSibling.__next = insertKey;\n    }\n    writableParent.__size++;\n    writableSelf.__prev = insertKey;\n    writableNodeToInsert.__prev = prevKey;\n    writableNodeToInsert.__next = writableSelf.__key;\n    writableNodeToInsert.__parent = writableSelf.__parent;\n    const selection = $getSelection();\n    if (restoreSelection && $isRangeSelection(selection)) {\n      const parent = this.getParentOrThrow();\n      $updateElementSelectionOnCreateDeleteNode(selection, parent, index);\n    }\n    return nodeToInsert;\n  }\n\n  /**\n   * Whether or not this node has a required parent. Used during copy + paste operations\n   * to normalize nodes that would otherwise be orphaned. For example, ListItemNodes without\n   * a ListNode parent or TextNodes with a ParagraphNode parent.\n   *\n   * */\n  isParentRequired() {\n    return false;\n  }\n\n  /**\n   * The creation logic for any required parent. Should be implemented if {@link isParentRequired} returns true.\n   *\n   * */\n  createParentElementNode() {\n    return $createParagraphNode();\n  }\n  selectStart() {\n    return this.selectPrevious();\n  }\n  selectEnd() {\n    return this.selectNext(0, 0);\n  }\n\n  /**\n   * Moves selection to the previous sibling of this node, at the specified offsets.\n   *\n   * @param anchorOffset - The anchor offset for selection.\n   * @param focusOffset -  The focus offset for selection\n   * */\n  selectPrevious(anchorOffset, focusOffset) {\n    errorOnReadOnly();\n    const prevSibling = this.getPreviousSibling();\n    const parent = this.getParentOrThrow();\n    if (prevSibling === null) {\n      return parent.select(0, 0);\n    }\n    if ($isElementNode(prevSibling)) {\n      return prevSibling.select();\n    } else if (!$isTextNode(prevSibling)) {\n      const index = prevSibling.getIndexWithinParent() + 1;\n      return parent.select(index, index);\n    }\n    return prevSibling.select(anchorOffset, focusOffset);\n  }\n\n  /**\n   * Moves selection to the next sibling of this node, at the specified offsets.\n   *\n   * @param anchorOffset - The anchor offset for selection.\n   * @param focusOffset -  The focus offset for selection\n   * */\n  selectNext(anchorOffset, focusOffset) {\n    errorOnReadOnly();\n    const nextSibling = this.getNextSibling();\n    const parent = this.getParentOrThrow();\n    if (nextSibling === null) {\n      return parent.select();\n    }\n    if ($isElementNode(nextSibling)) {\n      return nextSibling.select(0, 0);\n    } else if (!$isTextNode(nextSibling)) {\n      const index = nextSibling.getIndexWithinParent();\n      return parent.select(index, index);\n    }\n    return nextSibling.select(anchorOffset, focusOffset);\n  }\n\n  /**\n   * Marks a node dirty, triggering transforms and\n   * forcing it to be reconciled during the update cycle.\n   *\n   * */\n  markDirty() {\n    this.getWritable();\n  }\n\n  /**\n   * @internal\n   *\n   * When the reconciler detects that a node was mutated, this method\n   * may be called to restore the node to a known good state.\n   */\n  reconcileObservedMutation(dom, editor) {\n    this.markDirty();\n  }\n}\nfunction errorOnTypeKlassMismatch(type, klass) {\n  const registeredNode = getRegisteredNode(getActiveEditor(), type);\n  // Common error - split in its own invariant\n  if (registeredNode === undefined) {\n    {\n      formatDevErrorMessage(`Create node: Attempted to create node ${klass.name} that was not configured to be used on the editor.`);\n    }\n  }\n  const editorKlass = registeredNode.klass;\n  if (editorKlass !== klass) {\n    {\n      formatDevErrorMessage(`Create node: Type ${type} in node ${klass.name} does not match registered node ${editorKlass.name} with the same type`);\n    }\n  }\n}\n\n/**\n * Insert a series of nodes after this LexicalNode (as next siblings)\n *\n * @param firstToInsert - The first node to insert after this one.\n * @param lastToInsert - The last node to insert after this one. Must be a\n * later sibling of FirstNode. If not provided, it will be its last sibling.\n */\nfunction insertRangeAfter(node, firstToInsert, lastToInsert) {\n  const lastToInsert2 = firstToInsert.getParentOrThrow().getLastChild();\n  let current = firstToInsert;\n  const nodesToInsert = [firstToInsert];\n  while (current !== lastToInsert2) {\n    if (!current.getNextSibling()) {\n      {\n        formatDevErrorMessage(`insertRangeAfter: lastToInsert must be a later sibling of firstToInsert`);\n      }\n    }\n    current = current.getNextSibling();\n    nodesToInsert.push(current);\n  }\n  let currentNode = node;\n  for (const nodeToInsert of nodesToInsert) {\n    currentNode = currentNode.insertAfter(nodeToInsert);\n  }\n}\n\n/**\n * Returns true if the given value is a {@link LexicalNode} instance.\n */\nfunction $isLexicalNode(node) {\n  return node instanceof LexicalNode;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * Common update tags used in Lexical. These tags can be used with editor.update() or $addUpdateTag()\n * to indicate the type/purpose of an update. Multiple tags can be used in a single update.\n */\n\n/**\n * Indicates that the update is related to history operations (undo/redo)\n */\nconst HISTORIC_TAG = 'historic';\n\n/**\n * Indicates that a new history entry should be pushed to the history stack\n */\nconst HISTORY_PUSH_TAG = 'history-push';\n\n/**\n * Indicates that the current update should be merged with the previous history entry\n */\nconst HISTORY_MERGE_TAG = 'history-merge';\n\n/**\n * Indicates that the update is related to a paste operation\n */\nconst PASTE_TAG = 'paste';\n\n/**\n * Indicates that the update is related to collaborative editing\n */\nconst COLLABORATION_TAG = 'collaboration';\n\n/**\n * Indicates that the update should skip collaborative sync\n */\nconst SKIP_COLLAB_TAG = 'skip-collab';\n\n/**\n * Indicates that the update should skip scrolling the selection into view\n */\nconst SKIP_SCROLL_INTO_VIEW_TAG = 'skip-scroll-into-view';\n\n/**\n * Indicates that the update should skip updating the DOM selection\n * This is useful when you want to make updates without changing the selection or focus\n */\nconst SKIP_DOM_SELECTION_TAG = 'skip-dom-selection';\n\n/**\n * Indicates that after changing the selection, the editor should not focus itself\n * This tag is ignored if {@link SKIP_DOM_SELECTION_TAG} is used\n */\nconst SKIP_SELECTION_FOCUS_TAG = 'skip-selection-focus';\n\n/**\n * The update was triggered by editor.focus()\n */\nconst FOCUS_TAG = 'focus';\n\n/**\n * The update was triggered by composition-start\n */\nconst COMPOSITION_START_TAG = 'composition-start';\n\n/**\n * The update was triggered by composition-end\n */\nconst COMPOSITION_END_TAG = 'composition-end';\n\n/**\n * The set of known update tags to help with TypeScript suggestions.\n */\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst IMPORTANT_REG_EXP = /\\s*!important\\s*$/i;\n\n/**\n * Parses inline CSS text into an object that is compatible with\n * `CSSStyleDeclaration.setProperty()`.\n *\n * Property names are expected to be kebab-case, such as `font-size`, and\n * values are expected to include explicit units where needed, such as `12px`.\n */\nfunction getStyleObjectFromCSS(css) {\n  const styles = {};\n  if (!css) {\n    return styles;\n  }\n  let currentProperty = '';\n  let currentValue = '';\n  let currentQuote = null;\n  let inComment = false;\n  let isEscaped = false;\n  let isParsingValue = false;\n  let parenthesisDepth = 0;\n  for (let i = 0; i < css.length; i++) {\n    const char = css[i];\n    if (inComment) {\n      if (char === '*' && css[i + 1] === '/') {\n        inComment = false;\n        i++;\n      }\n      continue;\n    }\n    if (isEscaped) {\n      if (isParsingValue) {\n        currentValue += char;\n      } else {\n        currentProperty += char;\n      }\n      isEscaped = false;\n      continue;\n    }\n    if (currentQuote !== null) {\n      if (isParsingValue) {\n        currentValue += char;\n      } else {\n        currentProperty += char;\n      }\n      if (char === '\\\\') {\n        isEscaped = true;\n      } else if (char === currentQuote) {\n        currentQuote = null;\n      }\n      continue;\n    }\n    if (char === '/' && css[i + 1] === '*') {\n      inComment = true;\n      i++;\n      continue;\n    }\n    if (char === '\"' || char === \"'\") {\n      currentQuote = char;\n      if (isParsingValue) {\n        currentValue += char;\n      } else {\n        currentProperty += char;\n      }\n      continue;\n    }\n    if (char === '(') {\n      parenthesisDepth++;\n      if (isParsingValue) {\n        currentValue += char;\n      } else {\n        currentProperty += char;\n      }\n      continue;\n    }\n    if (char === ')') {\n      parenthesisDepth = Math.max(0, parenthesisDepth - 1);\n      if (isParsingValue) {\n        currentValue += char;\n      } else {\n        currentProperty += char;\n      }\n      continue;\n    }\n    if (!isParsingValue && char === ':' && parenthesisDepth === 0) {\n      isParsingValue = true;\n      continue;\n    }\n    if (char === ';' && parenthesisDepth === 0) {\n      const property = currentProperty.trim();\n      const value = currentValue.trim();\n      if (property !== '' && value !== '') {\n        styles[property] = value;\n      }\n      currentProperty = '';\n      currentValue = '';\n      isParsingValue = false;\n      continue;\n    }\n    if (isParsingValue) {\n      currentValue += char;\n    } else {\n      currentProperty += char;\n    }\n  }\n  const property = currentProperty.trim();\n  const value = currentValue.trim();\n  if (property !== '' && value !== '') {\n    styles[property] = value;\n  }\n  return styles;\n}\nfunction setDOMStyleProperty(domStyle, property, value) {\n  const priority = IMPORTANT_REG_EXP.test(value) ? 'important' : '';\n  const nextValue = priority === '' ? value : value.replace(IMPORTANT_REG_EXP, '').trim();\n  domStyle.setProperty(property, nextValue, priority);\n}\n\n/**\n * Applies a style object to a DOM style declaration using\n * `CSSStyleDeclaration.setProperty()`.\n *\n * Property names are expected to be kebab-case, such as `font-size`, and\n * values are expected to include explicit units where needed, such as `12px`.\n */\nfunction setDOMStyleObject(domStyle, styleObject) {\n  for (const property in styleObject) {\n    const value = styleObject[property];\n    if (value == null) {\n      domStyle.removeProperty(property);\n    } else {\n      setDOMStyleProperty(domStyle, property, value);\n    }\n  }\n}\n\n/**\n * Applies inline CSS text to a DOM style declaration using\n * `CSSStyleDeclaration.setProperty()`.\n *\n * Property names are expected to be kebab-case, such as `font-size`, and\n * values are expected to include explicit units where needed, such as `12px`.\n */\nfunction setDOMStyleFromCSS(domStyle, cssText, prevCSSText = '') {\n  if (cssText === prevCSSText) {\n    return;\n  }\n  const prevCSS = getStyleObjectFromCSS(prevCSSText);\n  const nextCSS = getStyleObjectFromCSS(cssText);\n  for (const property in nextCSS) {\n    delete prevCSS[property];\n    setDOMStyleProperty(domStyle, property, nextCSS[property]);\n  }\n  for (const property in prevCSS) {\n    domStyle.removeProperty(property);\n  }\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/** @noInheritDoc */\nclass LineBreakNode extends LexicalNode {\n  /** @internal */\n\n  static getType() {\n    return 'linebreak';\n  }\n  static clone(node) {\n    return new LineBreakNode(node.__key);\n  }\n  constructor(key) {\n    super(key);\n  }\n  getTextContent() {\n    return '\\n';\n  }\n  createDOM() {\n    return document.createElement('br');\n  }\n  updateDOM() {\n    return false;\n  }\n  isInline() {\n    return true;\n  }\n  static importDOM() {\n    return {\n      br: node => {\n        if (isOnlyChildInBlockNode(node) || isLastChildInBlockNode(node)) {\n          return null;\n        }\n        return {\n          conversion: $convertLineBreakElement,\n          priority: 0\n        };\n      }\n    };\n  }\n  static importJSON(serializedLineBreakNode) {\n    return $createLineBreakNode().updateFromJSON(serializedLineBreakNode);\n  }\n}\nfunction $convertLineBreakElement(node) {\n  return {\n    node: $createLineBreakNode()\n  };\n}\nfunction $createLineBreakNode() {\n  return $applyNodeReplacement(new LineBreakNode());\n}\nfunction $isLineBreakNode(node) {\n  return node instanceof LineBreakNode;\n}\nfunction isOnlyChildInBlockNode(node) {\n  const parentElement = node.parentElement;\n  if (parentElement !== null && isBlockDomNode(parentElement)) {\n    const firstChild = parentElement.firstChild;\n    if (firstChild === node || firstChild.nextSibling === node && isWhitespaceDomTextNode(firstChild)) {\n      const lastChild = parentElement.lastChild;\n      if (lastChild === node || lastChild.previousSibling === node && isWhitespaceDomTextNode(lastChild)) {\n        return true;\n      }\n    }\n  }\n  return false;\n}\nfunction isLastChildInBlockNode(node) {\n  const parentElement = node.parentElement;\n  if (parentElement !== null && isBlockDomNode(parentElement)) {\n    // check if node is first child, because only child dont count\n    const firstChild = parentElement.firstChild;\n    if (firstChild === node || firstChild.nextSibling === node && isWhitespaceDomTextNode(firstChild)) {\n      return false;\n    }\n\n    // check if its last child\n    const lastChild = parentElement.lastChild;\n    if (lastChild === node || lastChild.previousSibling === node && isWhitespaceDomTextNode(lastChild)) {\n      return true;\n    }\n  }\n  return false;\n}\nfunction isWhitespaceDomTextNode(node) {\n  return isDOMTextNode(node) && /^( |\\t|\\r?\\n)+$/.test(node.textContent || '');\n}\n\nfunction getElementOuterTag(node, format) {\n  if (format & IS_CODE) {\n    return 'code';\n  }\n  if (format & IS_HIGHLIGHT) {\n    return 'mark';\n  }\n  if (format & IS_SUBSCRIPT) {\n    return 'sub';\n  }\n  if (format & IS_SUPERSCRIPT) {\n    return 'sup';\n  }\n  return null;\n}\nfunction getElementInnerTag(node, format) {\n  if (format & IS_BOLD) {\n    return 'strong';\n  }\n  if (format & IS_ITALIC) {\n    return 'em';\n  }\n  return 'span';\n}\nfunction setTextThemeClassNames(tag, prevFormat, nextFormat, dom, textClassNames) {\n  const domClassList = dom.classList;\n  // Firstly we handle the base theme.\n  let classNames = getCachedClassNameArray(textClassNames, 'base');\n  if (classNames !== undefined) {\n    domClassList.add(...classNames);\n  }\n  // Secondly we handle the special case: underline + strikethrough.\n  // We have to do this as we need a way to compose the fact that\n  // the same CSS property will need to be used: text-decoration.\n  // In an ideal world we shouldn't have to do this, but there's no\n  // easy workaround for many atomic CSS systems today.\n  classNames = getCachedClassNameArray(textClassNames, 'underlineStrikethrough');\n  let hasUnderlineStrikethrough = false;\n  const prevUnderlineStrikethrough = prevFormat & IS_UNDERLINE && prevFormat & IS_STRIKETHROUGH;\n  const nextUnderlineStrikethrough = nextFormat & IS_UNDERLINE && nextFormat & IS_STRIKETHROUGH;\n  if (classNames !== undefined) {\n    if (nextUnderlineStrikethrough) {\n      hasUnderlineStrikethrough = true;\n      if (!prevUnderlineStrikethrough) {\n        domClassList.add(...classNames);\n      }\n    } else if (prevUnderlineStrikethrough) {\n      domClassList.remove(...classNames);\n    }\n  }\n  for (const key in TEXT_TYPE_TO_FORMAT) {\n    const format = key;\n    const flag = TEXT_TYPE_TO_FORMAT[format];\n    classNames = getCachedClassNameArray(textClassNames, key);\n    if (classNames !== undefined) {\n      if (nextFormat & flag) {\n        if (hasUnderlineStrikethrough && (key === 'underline' || key === 'strikethrough')) {\n          if (prevFormat & flag) {\n            domClassList.remove(...classNames);\n          }\n          continue;\n        }\n        if ((prevFormat & flag) === 0 || prevUnderlineStrikethrough && key === 'underline' || key === 'strikethrough') {\n          domClassList.add(...classNames);\n        }\n      } else if (prevFormat & flag) {\n        domClassList.remove(...classNames);\n      }\n    }\n  }\n}\nfunction diffComposedText(a, b) {\n  const aLength = a.length;\n  const bLength = b.length;\n  let left = 0;\n  let right = 0;\n  while (left < aLength && left < bLength && a[left] === b[left]) {\n    left++;\n  }\n  while (right + left < aLength && right + left < bLength && a[aLength - right - 1] === b[bLength - right - 1]) {\n    right++;\n  }\n  return [left, aLength - left - right, b.slice(left, bLength - right)];\n}\nfunction setTextContent(nextText, dom, node) {\n  const firstChild = dom.firstChild;\n  const isComposing = node.isComposing();\n  // Always add a suffix if we're composing a node\n  const suffix = isComposing ? COMPOSITION_SUFFIX : '';\n  const text = nextText + suffix;\n  if (firstChild == null) {\n    dom.textContent = text;\n  } else {\n    const nodeValue = firstChild.nodeValue;\n    if (nodeValue !== text) {\n      if (isComposing || IS_FIREFOX) {\n        // We also use the diff composed text for general text in FF to avoid\n        // the spellcheck red line from flickering.\n        const [index, remove, insert] = diffComposedText(nodeValue, text);\n        if (remove !== 0) {\n          // @ts-expect-error\n          firstChild.deleteData(index, remove);\n        }\n        // @ts-expect-error\n        firstChild.insertData(index, insert);\n      } else {\n        firstChild.nodeValue = text;\n      }\n    }\n  }\n}\nfunction createTextInnerDOM(innerDOM, node, innerTag, format, text, config) {\n  setTextContent(text, innerDOM, node);\n  const theme = config.theme;\n  // Apply theme class names\n  const textClassNames = theme.text;\n  if (textClassNames !== undefined) {\n    setTextThemeClassNames(innerTag, 0, format, innerDOM, textClassNames);\n  }\n}\nfunction wrapElementWith(element, tag) {\n  const el = document.createElement(tag);\n  el.appendChild(element);\n  return el;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\n\n/** @noInheritDoc */\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nclass TextNode extends LexicalNode {\n  /** @internal */\n\n  __text;\n  /** @internal */\n  __format;\n  /** @internal */\n  __style;\n  /** @internal */\n  __mode;\n  /** @internal */\n  __detail;\n  static getType() {\n    return 'text';\n  }\n  static clone(node) {\n    return new TextNode(node.__text, node.__key);\n  }\n  afterCloneFrom(prevNode) {\n    super.afterCloneFrom(prevNode);\n    this.__text = prevNode.__text;\n    this.__format = prevNode.__format;\n    this.__style = prevNode.__style;\n    this.__mode = prevNode.__mode;\n    this.__detail = prevNode.__detail;\n  }\n  constructor(text = '', key) {\n    super(key);\n    this.__text = text;\n    this.__format = 0;\n    this.__style = '';\n    this.__mode = 0;\n    this.__detail = 0;\n  }\n\n  /**\n   * Returns a 32-bit integer that represents the TextFormatTypes currently applied to the\n   * TextNode. You probably don't want to use this method directly - consider using TextNode.hasFormat instead.\n   *\n   * @returns a number representing the format of the text node.\n   */\n  getFormat() {\n    const self = this.getLatest();\n    return self.__format;\n  }\n\n  /**\n   * Returns a 32-bit integer that represents the TextDetailTypes currently applied to the\n   * TextNode. You probably don't want to use this method directly - consider using TextNode.isDirectionless\n   * or TextNode.isUnmergeable instead.\n   *\n   * @returns a number representing the detail of the text node.\n   */\n  getDetail() {\n    const self = this.getLatest();\n    return self.__detail;\n  }\n\n  /**\n   * Returns the mode (TextModeType) of the TextNode, which may be \"normal\", \"token\", or \"segmented\"\n   *\n   * @returns TextModeType.\n   */\n  getMode() {\n    const self = this.getLatest();\n    return TEXT_TYPE_TO_MODE[self.__mode];\n  }\n\n  /**\n   * Returns the styles currently applied to the node. This is analogous to CSSText in the DOM.\n   *\n   * @returns CSSText-like string of styles applied to the underlying DOM node.\n   */\n  getStyle() {\n    const self = this.getLatest();\n    return self.__style;\n  }\n\n  /**\n   * Returns whether or not the node is in \"token\" mode. TextNodes in token mode can be navigated through character-by-character\n   * with a RangeSelection, but are deleted as a single entity (not individually by character).\n   *\n   * @returns true if the node is in token mode, false otherwise.\n   */\n  isToken() {\n    const self = this.getLatest();\n    return self.__mode === IS_TOKEN;\n  }\n\n  /**\n   *\n   * @returns true if Lexical detects that an IME or other 3rd-party script is attempting to\n   * mutate the TextNode, false otherwise.\n   */\n  isComposing() {\n    return this.__key === $getCompositionKey();\n  }\n\n  /**\n   * Returns whether or not the node is in \"segmented\" mode. TextNodes in segmented mode can be navigated through character-by-character\n   * with a RangeSelection, but are deleted in space-delimited \"segments\".\n   *\n   * @returns true if the node is in segmented mode, false otherwise.\n   */\n  isSegmented() {\n    const self = this.getLatest();\n    return self.__mode === IS_SEGMENTED;\n  }\n  /**\n   * Returns whether or not the node is \"directionless\". Directionless nodes don't respect changes between RTL and LTR modes.\n   *\n   * @returns true if the node is directionless, false otherwise.\n   */\n  isDirectionless() {\n    const self = this.getLatest();\n    return (self.__detail & IS_DIRECTIONLESS) !== 0;\n  }\n  /**\n   * Returns whether or not the node is unmergeable. In some scenarios, Lexical tries to merge\n   * adjacent TextNodes into a single TextNode. If a TextNode is unmergeable, this won't happen.\n   *\n   * @returns true if the node is unmergeable, false otherwise.\n   */\n  isUnmergeable() {\n    const self = this.getLatest();\n    return (self.__detail & IS_UNMERGEABLE) !== 0;\n  }\n\n  /**\n   * Returns whether or not the node has the provided format applied. Use this with the human-readable TextFormatType\n   * string values to get the format of a TextNode.\n   *\n   * @param type - the TextFormatType to check for.\n   *\n   * @returns true if the node has the provided format, false otherwise.\n   */\n  hasFormat(type) {\n    const formatFlag = TEXT_TYPE_TO_FORMAT[type];\n    return (this.getFormat() & formatFlag) !== 0;\n  }\n\n  /**\n   * Returns whether or not the node is simple text. Simple text is defined as a TextNode that has the string type \"text\"\n   * (i.e., not a subclass) and has no mode applied to it (i.e., not segmented or token).\n   *\n   * @returns true if the node is simple text, false otherwise.\n   */\n  isSimpleText() {\n    return this.__type === 'text' && this.__mode === 0;\n  }\n\n  /**\n   * Returns the text content of the node as a string.\n   *\n   * @returns a string representing the text content of the node.\n   */\n  getTextContent() {\n    const self = this.getLatest();\n    return self.__text;\n  }\n\n  /**\n   * Returns the format flags applied to the node as a 32-bit integer.\n   *\n   * @returns a number representing the TextFormatTypes applied to the node.\n   */\n  getFormatFlags(type, alignWithFormat) {\n    const self = this.getLatest();\n    const format = self.__format;\n    return toggleTextFormatType(format, type, alignWithFormat);\n  }\n\n  /**\n   *\n   * @returns true if the text node supports font styling, false otherwise.\n   */\n  canHaveFormat() {\n    return true;\n  }\n\n  /**\n   * @returns true if the text node is inline, false otherwise.\n   */\n  isInline() {\n    return true;\n  }\n\n  // View\n\n  createDOM(config, editor) {\n    const format = this.__format;\n    const outerTag = getElementOuterTag(this, format);\n    const innerTag = getElementInnerTag(this, format);\n    const tag = outerTag === null ? innerTag : outerTag;\n    const dom = document.createElement(tag);\n    let innerDOM = dom;\n    if (this.hasFormat('code')) {\n      dom.setAttribute('spellcheck', 'false');\n    }\n    if (outerTag !== null) {\n      innerDOM = document.createElement(innerTag);\n      dom.appendChild(innerDOM);\n    }\n    const text = this.__text;\n    createTextInnerDOM(innerDOM, this, innerTag, format, text, config);\n    const style = this.__style;\n    if (style !== '') {\n      setDOMStyleFromCSS(dom.style, style);\n    }\n    return dom;\n  }\n  updateDOM(prevNode, dom, config) {\n    const nextText = this.__text;\n    const prevFormat = prevNode.__format;\n    const nextFormat = this.__format;\n    const prevOuterTag = getElementOuterTag(this, prevFormat);\n    const nextOuterTag = getElementOuterTag(this, nextFormat);\n    const prevInnerTag = getElementInnerTag(this, prevFormat);\n    const nextInnerTag = getElementInnerTag(this, nextFormat);\n    const prevTag = prevOuterTag === null ? prevInnerTag : prevOuterTag;\n    const nextTag = nextOuterTag === null ? nextInnerTag : nextOuterTag;\n    if (prevTag !== nextTag) {\n      return true;\n    }\n    if (prevOuterTag === nextOuterTag && prevInnerTag !== nextInnerTag) {\n      // should always be an element\n      const prevInnerDOM = dom.firstChild;\n      if (prevInnerDOM == null) {\n        {\n          formatDevErrorMessage(`updateDOM: prevInnerDOM is null or undefined`);\n        }\n      }\n      const nextInnerDOM = document.createElement(nextInnerTag);\n      createTextInnerDOM(nextInnerDOM, this, nextInnerTag, nextFormat, nextText, config);\n      dom.replaceChild(nextInnerDOM, prevInnerDOM);\n      return false;\n    }\n    let innerDOM = dom;\n    if (nextOuterTag !== null) {\n      if (prevOuterTag !== null) {\n        innerDOM = dom.firstChild;\n        if (innerDOM == null) {\n          {\n            formatDevErrorMessage(`updateDOM: innerDOM is null or undefined`);\n          }\n        }\n      }\n    }\n    setTextContent(nextText, innerDOM, this);\n    const theme = config.theme;\n    // Apply theme class names\n    const textClassNames = theme.text;\n    if (textClassNames !== undefined && prevFormat !== nextFormat) {\n      setTextThemeClassNames(nextInnerTag, prevFormat, nextFormat, innerDOM, textClassNames);\n    }\n    const prevStyle = prevNode.__style;\n    const nextStyle = this.__style;\n    if (prevStyle !== nextStyle) {\n      setDOMStyleFromCSS(dom.style, nextStyle, prevStyle);\n    }\n    return false;\n  }\n  static importDOM() {\n    return {\n      '#text': () => ({\n        conversion: $convertTextDOMNode,\n        priority: 0\n      }),\n      b: () => ({\n        conversion: convertBringAttentionToElement,\n        priority: 0\n      }),\n      code: () => ({\n        conversion: convertTextFormatElement,\n        priority: 0\n      }),\n      em: () => ({\n        conversion: convertTextFormatElement,\n        priority: 0\n      }),\n      i: () => ({\n        conversion: convertTextFormatElement,\n        priority: 0\n      }),\n      mark: () => ({\n        conversion: convertTextFormatElement,\n        priority: 0\n      }),\n      s: () => ({\n        conversion: convertTextFormatElement,\n        priority: 0\n      }),\n      span: () => ({\n        conversion: convertSpanElement,\n        priority: 0\n      }),\n      strong: () => ({\n        conversion: convertTextFormatElement,\n        priority: 0\n      }),\n      sub: () => ({\n        conversion: convertTextFormatElement,\n        priority: 0\n      }),\n      sup: () => ({\n        conversion: convertTextFormatElement,\n        priority: 0\n      }),\n      u: () => ({\n        conversion: convertTextFormatElement,\n        priority: 0\n      })\n    };\n  }\n  static importJSON(serializedNode) {\n    return $createTextNode().updateFromJSON(serializedNode);\n  }\n  updateFromJSON(serializedNode) {\n    return super.updateFromJSON(serializedNode).setTextContent(serializedNode.text).setFormat(serializedNode.format).setDetail(serializedNode.detail).setMode(serializedNode.mode).setStyle(serializedNode.style);\n  }\n\n  // This improves Lexical's basic text output in copy+paste plus\n  // for headless mode where people might use Lexical to generate\n  // HTML content and not have the ability to use CSS classes.\n  exportDOM(editor) {\n    let {\n      element\n    } = super.exportDOM(editor);\n    if (!isHTMLElement(element)) {\n      formatDevErrorMessage(`Expected TextNode createDOM to always return a HTMLElement`);\n    }\n    element.style.whiteSpace = 'pre-wrap';\n\n    // Add text-transform styles for capitalization formats\n    if (this.hasFormat('lowercase')) {\n      element.style.textTransform = 'lowercase';\n    } else if (this.hasFormat('uppercase')) {\n      element.style.textTransform = 'uppercase';\n    } else if (this.hasFormat('capitalize')) {\n      element.style.textTransform = 'capitalize';\n    }\n\n    // This is the only way to properly add support for most clients,\n    // even if it's semantically incorrect to have to resort to using\n    // <b>, <u>, <s>, <i> elements.\n    if (this.hasFormat('bold')) {\n      element = wrapElementWith(element, 'b');\n    }\n    if (this.hasFormat('italic')) {\n      element = wrapElementWith(element, 'i');\n    }\n    if (this.hasFormat('strikethrough')) {\n      element = wrapElementWith(element, 's');\n    }\n    if (this.hasFormat('underline')) {\n      element = wrapElementWith(element, 'u');\n    }\n    return {\n      element\n    };\n  }\n  exportJSON() {\n    return {\n      detail: this.getDetail(),\n      format: this.getFormat(),\n      mode: this.getMode(),\n      style: this.getStyle(),\n      text: this.getTextContent(),\n      // As an exception here we invoke super at the end for historical reasons.\n      // Namely, to preserve the order of the properties and not to break the tests\n      // that use the serialized string representation.\n      ...super.exportJSON()\n    };\n  }\n\n  // Mutators\n  selectionTransform(prevSelection, nextSelection) {\n    return;\n  }\n\n  /**\n   * Sets the node format to the provided TextFormatType or 32-bit integer. Note that the TextFormatType\n   * version of the argument can only specify one format and doing so will remove all other formats that\n   * may be applied to the node. For toggling behavior, consider using {@link TextNode.toggleFormat}\n   *\n   * @param format - TextFormatType or 32-bit integer representing the node format.\n   *\n   * @returns this TextNode.\n   * // TODO 0.12 This should just be a `string`.\n   */\n  setFormat(format) {\n    const self = this.getWritable();\n    self.__format = typeof format === 'string' ? TEXT_TYPE_TO_FORMAT[format] : format;\n    return self;\n  }\n\n  /**\n   * Sets the node detail to the provided TextDetailType or 32-bit integer. Note that the TextDetailType\n   * version of the argument can only specify one detail value and doing so will remove all other detail values that\n   * may be applied to the node. For toggling behavior, consider using {@link TextNode.toggleDirectionless}\n   * or {@link TextNode.toggleUnmergeable}\n   *\n   * @param detail - TextDetailType or 32-bit integer representing the node detail.\n   *\n   * @returns this TextNode.\n   * // TODO 0.12 This should just be a `string`.\n   */\n  setDetail(detail) {\n    const self = this.getWritable();\n    self.__detail = typeof detail === 'string' ? DETAIL_TYPE_TO_DETAIL[detail] : detail;\n    return self;\n  }\n\n  /**\n   * Sets the node style to the provided CSSText-like string. Set this property as you\n   * would an HTMLElement style attribute to apply inline styles to the underlying DOM Element.\n   *\n   * @param style - CSSText to be applied to the underlying HTMLElement.\n   *\n   * @returns this TextNode.\n   */\n  setStyle(style) {\n    const self = this.getWritable();\n    self.__style = style;\n    return self;\n  }\n\n  /**\n   * Applies the provided format to this TextNode if it's not present. Removes it if it's present.\n   * The subscript and superscript formats are mutually exclusive.\n   * Prefer using this method to turn specific formats on and off.\n   *\n   * @param type - TextFormatType to toggle.\n   *\n   * @returns this TextNode.\n   */\n  toggleFormat(type) {\n    const format = this.getFormat();\n    const newFormat = toggleTextFormatType(format, type, null);\n    return this.setFormat(newFormat);\n  }\n\n  /**\n   * Toggles the directionless detail value of the node. Prefer using this method over setDetail.\n   *\n   * @returns this TextNode.\n   */\n  toggleDirectionless() {\n    const self = this.getWritable();\n    self.__detail ^= IS_DIRECTIONLESS;\n    return self;\n  }\n\n  /**\n   * Toggles the unmergeable detail value of the node. Prefer using this method over setDetail.\n   *\n   * @returns this TextNode.\n   */\n  toggleUnmergeable() {\n    const self = this.getWritable();\n    self.__detail ^= IS_UNMERGEABLE;\n    return self;\n  }\n\n  /**\n   * Sets the mode of the node.\n   *\n   * @returns this TextNode.\n   */\n  setMode(type) {\n    const mode = TEXT_MODE_TO_TYPE[type];\n    if (this.__mode === mode) {\n      return this;\n    }\n    const self = this.getWritable();\n    self.__mode = mode;\n    return self;\n  }\n\n  /**\n   * Sets the text content of the node.\n   *\n   * @param text - the string to set as the text value of the node.\n   *\n   * @returns this TextNode.\n   */\n  setTextContent(text) {\n    if (this.__text === text) {\n      return this;\n    }\n    const self = this.getWritable();\n    self.__text = text;\n    return self;\n  }\n\n  /**\n   * Sets the current Lexical selection to be a RangeSelection with anchor and focus on this TextNode at the provided offsets.\n   *\n   * @param _anchorOffset - the offset at which the Selection anchor will be placed.\n   * @param _focusOffset - the offset at which the Selection focus will be placed.\n   *\n   * @returns the new RangeSelection.\n   */\n  select(_anchorOffset, _focusOffset) {\n    errorOnReadOnly();\n    let anchorOffset = _anchorOffset;\n    let focusOffset = _focusOffset;\n    const selection = $getSelection();\n    const text = this.getTextContent();\n    const key = this.__key;\n    if (typeof text === 'string') {\n      const lastOffset = text.length;\n      if (anchorOffset === undefined) {\n        anchorOffset = lastOffset;\n      }\n      if (focusOffset === undefined) {\n        focusOffset = lastOffset;\n      }\n    } else {\n      anchorOffset = 0;\n      focusOffset = 0;\n    }\n    if (!$isRangeSelection(selection)) {\n      return $internalMakeRangeSelection(key, anchorOffset, key, focusOffset, 'text', 'text');\n    } else {\n      const compositionKey = $getCompositionKey();\n      if (compositionKey === selection.anchor.key || compositionKey === selection.focus.key) {\n        $setCompositionKey(key);\n      }\n      selection.setTextNodeRange(this, anchorOffset, this, focusOffset);\n    }\n    return selection;\n  }\n  selectStart() {\n    return this.select(0, 0);\n  }\n  selectEnd() {\n    const size = this.getTextContentSize();\n    return this.select(size, size);\n  }\n\n  /**\n   * Inserts the provided text into this TextNode at the provided offset, deleting the number of characters\n   * specified. Can optionally calculate a new selection after the operation is complete.\n   *\n   * @param offset - the offset at which the splice operation should begin.\n   * @param delCount - the number of characters to delete, starting from the offset.\n   * @param newText - the text to insert into the TextNode at the offset.\n   * @param moveSelection - optional, whether or not to move selection to the end of the inserted substring.\n   *\n   * @returns this TextNode.\n   */\n  spliceText(offset, delCount, newText, moveSelection) {\n    const writableSelf = this.getWritable();\n    const text = writableSelf.__text;\n    const handledTextLength = newText.length;\n    let index = offset;\n    if (index < 0) {\n      index = handledTextLength + index;\n      if (index < 0) {\n        index = 0;\n      }\n    }\n    const selection = $getSelection();\n    if (moveSelection && $isRangeSelection(selection)) {\n      const newOffset = offset + handledTextLength;\n      selection.setTextNodeRange(writableSelf, newOffset, writableSelf, newOffset);\n    }\n    const updatedText = text.slice(0, index) + newText + text.slice(index + delCount);\n    writableSelf.__text = updatedText;\n    return writableSelf;\n  }\n\n  /**\n   * This method is meant to be overridden by TextNode subclasses to control the behavior of those nodes\n   * when a user event would cause text to be inserted before them in the editor. If true, Lexical will attempt\n   * to insert text into this node. If false, it will insert the text in a new sibling node.\n   *\n   * @returns true if text can be inserted before the node, false otherwise.\n   */\n  canInsertTextBefore() {\n    return true;\n  }\n\n  /**\n   * This method is meant to be overridden by TextNode subclasses to control the behavior of those nodes\n   * when a user event would cause text to be inserted after them in the editor. If true, Lexical will attempt\n   * to insert text into this node. If false, it will insert the text in a new sibling node.\n   *\n   * @returns true if text can be inserted after the node, false otherwise.\n   */\n  canInsertTextAfter() {\n    return true;\n  }\n\n  /**\n   * Splits this TextNode at the provided character offsets, forming new TextNodes from the substrings\n   * formed by the split, and inserting those new TextNodes into the editor, replacing the one that was split.\n   *\n   * @param splitOffsets - rest param of the text content character offsets at which this node should be split.\n   *\n   * @returns an Array containing the newly-created TextNodes.\n   */\n  splitText(...splitOffsets) {\n    errorOnReadOnly();\n    const self = this.getLatest();\n    const textContent = self.getTextContent();\n    if (textContent === '') {\n      return [];\n    }\n    const key = self.__key;\n    const compositionKey = $getCompositionKey();\n    const textLength = textContent.length;\n    splitOffsets.sort((a, b) => a - b);\n    splitOffsets.push(textLength);\n    const parts = [];\n    const splitOffsetsLength = splitOffsets.length;\n    for (let start = 0, offsetIndex = 0; start < textLength && offsetIndex <= splitOffsetsLength; offsetIndex++) {\n      const end = splitOffsets[offsetIndex];\n      if (end > start) {\n        parts.push(textContent.slice(start, end));\n        start = end;\n      }\n    }\n    const partsLength = parts.length;\n    if (partsLength === 1) {\n      return [self];\n    }\n    const firstPart = parts[0];\n    const parent = self.getParent();\n    let writableNode;\n    const format = self.getFormat();\n    const style = self.getStyle();\n    const detail = self.__detail;\n    let hasReplacedSelf = false;\n\n    // Prepare to handle selection\n    let startTextPoint = null;\n    let endTextPoint = null;\n    const selection = $getSelection();\n    if ($isRangeSelection(selection)) {\n      const [startPoint, endPoint] = selection.isBackward() ? [selection.focus, selection.anchor] : [selection.anchor, selection.focus];\n      if (startPoint.type === 'text' && startPoint.key === key) {\n        startTextPoint = startPoint;\n      }\n      if (endPoint.type === 'text' && endPoint.key === key) {\n        endTextPoint = endPoint;\n      }\n    }\n    if (self.isSegmented()) {\n      // Create a new TextNode\n      writableNode = $createTextNode(firstPart);\n      writableNode.__format = format;\n      writableNode.__style = style;\n      writableNode.__detail = detail;\n      writableNode.__state = $cloneNodeState(self, writableNode);\n      hasReplacedSelf = true;\n    } else {\n      // For the first part, update the existing node\n      writableNode = self.setTextContent(firstPart);\n    }\n\n    // Then handle all other parts\n    const splitNodes = [writableNode];\n    for (let i = 1; i < partsLength; i++) {\n      const part = parts[i];\n      const sibling = $createTextNode(part);\n      sibling.__format = format;\n      sibling.__style = style;\n      sibling.__detail = detail;\n      sibling.__state = $cloneNodeState(self, sibling);\n      const siblingKey = sibling.__key;\n      if (compositionKey === key) {\n        $setCompositionKey(siblingKey);\n      }\n      splitNodes.push(sibling);\n    }\n\n    // Move the selection to the best location in the split string.\n    // The end point is always left-biased, and the start point is\n    // generally left biased unless the end point would land on a\n    // later node in the split in which case it will prefer the start\n    // of that node so they will tend to be on the same node.\n    const originalStartOffset = startTextPoint ? startTextPoint.offset : null;\n    const originalEndOffset = endTextPoint ? endTextPoint.offset : null;\n    let startOffset = 0;\n    for (const node of splitNodes) {\n      if (!(startTextPoint || endTextPoint)) {\n        break;\n      }\n      const endOffset = startOffset + node.getTextContentSize();\n      if (startTextPoint !== null && originalStartOffset !== null && originalStartOffset <= endOffset && originalStartOffset >= startOffset) {\n        // Set the start point to the first valid node\n        startTextPoint.set(node.getKey(), originalStartOffset - startOffset, 'text');\n        if (originalStartOffset < endOffset) {\n          // The start isn't on a border so we can stop checking\n          startTextPoint = null;\n        }\n      }\n      if (endTextPoint !== null && originalEndOffset !== null && originalEndOffset <= endOffset && originalEndOffset >= startOffset) {\n        endTextPoint.set(node.getKey(), originalEndOffset - startOffset, 'text');\n        break;\n      }\n      startOffset = endOffset;\n    }\n\n    // Insert the nodes into the parent's children\n    if (parent !== null) {\n      internalMarkSiblingsAsDirty(this);\n      const writableParent = parent.getWritable();\n      const insertionIndex = this.getIndexWithinParent();\n      if (hasReplacedSelf) {\n        writableParent.splice(insertionIndex, 0, splitNodes);\n        this.remove();\n      } else {\n        writableParent.splice(insertionIndex, 1, splitNodes);\n      }\n      if ($isRangeSelection(selection)) {\n        $updateElementSelectionOnCreateDeleteNode(selection, parent, insertionIndex, partsLength - 1);\n      }\n    }\n    return splitNodes;\n  }\n\n  /**\n   * Merges the target TextNode into this TextNode, removing the target node.\n   *\n   * @param target - the TextNode to merge into this one.\n   *\n   * @returns this TextNode.\n   */\n  mergeWithSibling(target) {\n    const isBefore = target === this.getPreviousSibling();\n    if (!isBefore && target !== this.getNextSibling()) {\n      {\n        formatDevErrorMessage(`mergeWithSibling: sibling must be a previous or next sibling`);\n      }\n    }\n    const key = this.__key;\n    const targetKey = target.__key;\n    const text = this.__text;\n    const textLength = text.length;\n    const compositionKey = $getCompositionKey();\n    if (compositionKey === targetKey) {\n      $setCompositionKey(key);\n    }\n    const selection = $getSelection();\n    if ($isRangeSelection(selection)) {\n      const anchor = selection.anchor;\n      const focus = selection.focus;\n      if (anchor !== null && anchor.key === targetKey) {\n        adjustPointOffsetForMergedSibling(anchor, isBefore, key, target, textLength);\n      }\n      if (focus !== null && focus.key === targetKey) {\n        adjustPointOffsetForMergedSibling(focus, isBefore, key, target, textLength);\n      }\n    }\n    const targetText = target.__text;\n    const newText = isBefore ? targetText + text : text + targetText;\n    this.setTextContent(newText);\n    const writableSelf = this.getWritable();\n    target.remove();\n    return writableSelf;\n  }\n\n  /**\n   * This method is meant to be overridden by TextNode subclasses to control the behavior of those nodes\n   * when used with the registerLexicalTextEntity function. If you're using registerLexicalTextEntity, the\n   * node class that you create and replace matched text with should return true from this method.\n   *\n   * @returns true if the node is to be treated as a \"text entity\", false otherwise.\n   */\n  isTextEntity() {\n    return false;\n  }\n}\nfunction convertSpanElement(domNode) {\n  // domNode is a <span> since we matched it by nodeName\n  const span = domNode;\n  const style = span.style;\n  return {\n    forChild: applyTextFormatFromStyle(style),\n    node: null\n  };\n}\nfunction convertBringAttentionToElement(domNode) {\n  // domNode is a <b> since we matched it by nodeName\n  const b = domNode;\n  // Google Docs wraps all copied HTML in a <b> with font-weight normal\n  const hasNormalFontWeight = b.style.fontWeight === 'normal';\n  return {\n    forChild: applyTextFormatFromStyle(b.style, hasNormalFontWeight ? undefined : 'bold'),\n    node: null\n  };\n}\nconst preParentCache = new WeakMap();\nfunction isNodePre(node) {\n  if (!isHTMLElement(node)) {\n    return false;\n  } else if (node.nodeName === 'PRE') {\n    return true;\n  }\n  const whiteSpace = node.style.whiteSpace;\n  return typeof whiteSpace === 'string' && whiteSpace.startsWith('pre');\n}\nfunction findParentPreDOMNode(node) {\n  let cached;\n  let parent = node.parentNode;\n  const visited = [node];\n  while (parent !== null && (cached = preParentCache.get(parent)) === undefined && !isNodePre(parent)) {\n    visited.push(parent);\n    parent = parent.parentNode;\n  }\n  const resultNode = cached === undefined ? parent : cached;\n  for (let i = 0; i < visited.length; i++) {\n    preParentCache.set(visited[i], resultNode);\n  }\n  return resultNode;\n}\nfunction $convertTextDOMNode(domNode) {\n  const domNode_ = domNode;\n  const parentDom = domNode.parentElement;\n  if (!(parentDom !== null)) {\n    formatDevErrorMessage(`Expected parentElement of Text not to be null`);\n  }\n  let textContent = domNode_.textContent || '';\n  // No collapse and preserve segment break for pre, pre-wrap and pre-line\n  if (findParentPreDOMNode(domNode_) !== null) {\n    const parts = textContent.split(/(\\r?\\n|\\t)/);\n    const nodes = [];\n    const length = parts.length;\n    for (let i = 0; i < length; i++) {\n      const part = parts[i];\n      if (part === '\\n' || part === '\\r\\n') {\n        nodes.push($createLineBreakNode());\n      } else if (part === '\\t') {\n        nodes.push($createTabNode());\n      } else if (part !== '') {\n        nodes.push($createTextNode(part));\n      }\n    }\n    return {\n      node: nodes\n    };\n  }\n  textContent = textContent.replace(/\\r/g, '').replace(/[ \\t\\n]+/g, ' ');\n  if (textContent === '') {\n    return {\n      node: null\n    };\n  }\n  if (textContent[0] === ' ') {\n    // Traverse backward while in the same line. If content contains new line or tab -> potential\n    // delete, other elements can borrow from this one. Deletion depends on whether it's also the\n    // last space (see next condition: textContent[textContent.length - 1] === ' '))\n    let previousText = domNode_;\n    let isStartOfLine = true;\n    while (previousText !== null && (previousText = findTextInLine(previousText, false)) !== null) {\n      const previousTextContent = previousText.textContent || '';\n      if (previousTextContent.length > 0) {\n        if (/[ \\t\\n]$/.test(previousTextContent)) {\n          textContent = textContent.slice(1);\n        }\n        isStartOfLine = false;\n        break;\n      }\n    }\n    if (isStartOfLine) {\n      textContent = textContent.slice(1);\n    }\n  }\n  if (textContent[textContent.length - 1] === ' ') {\n    // Traverse forward while in the same line, preserve if next inline will require a space\n    let nextText = domNode_;\n    let isEndOfLine = true;\n    while (nextText !== null && (nextText = findTextInLine(nextText, true)) !== null) {\n      const nextTextContent = (nextText.textContent || '').replace(/^( |\\t|\\r?\\n)+/, '');\n      if (nextTextContent.length > 0) {\n        isEndOfLine = false;\n        break;\n      }\n    }\n    if (isEndOfLine) {\n      textContent = textContent.slice(0, textContent.length - 1);\n    }\n  }\n  if (textContent === '') {\n    return {\n      node: null\n    };\n  }\n  return {\n    node: $createTextNode(textContent)\n  };\n}\nfunction findTextInLine(text, forward) {\n  let node = text;\n  while (true) {\n    let sibling;\n    while ((sibling = forward ? node.nextSibling : node.previousSibling) === null) {\n      const parentElement = node.parentElement;\n      if (parentElement === null) {\n        return null;\n      }\n      node = parentElement;\n    }\n    node = sibling;\n    if (isHTMLElement(node)) {\n      const display = node.style.display;\n      if (display === '' && !isInlineDomNode(node) || display !== '' && !display.startsWith('inline')) {\n        return null;\n      }\n    }\n    let descendant = node;\n    while ((descendant = forward ? node.firstChild : node.lastChild) !== null) {\n      node = descendant;\n    }\n    if (isDOMTextNode(node)) {\n      return node;\n    } else if (node.nodeName === 'BR') {\n      return null;\n    }\n  }\n}\nconst nodeNameToTextFormat = {\n  code: 'code',\n  em: 'italic',\n  i: 'italic',\n  mark: 'highlight',\n  s: 'strikethrough',\n  strong: 'bold',\n  sub: 'subscript',\n  sup: 'superscript',\n  u: 'underline'\n};\nfunction convertTextFormatElement(domNode) {\n  const format = nodeNameToTextFormat[domNode.nodeName.toLowerCase()];\n  if (format === undefined) {\n    return {\n      node: null\n    };\n  }\n  return {\n    forChild: applyTextFormatFromStyle(domNode.style, format),\n    node: null\n  };\n}\nfunction $createTextNode(text = '') {\n  return $applyNodeReplacement(new TextNode(text));\n}\nfunction $isTextNode(node) {\n  return node instanceof TextNode;\n}\nfunction applyTextFormatFromStyle(style, shouldApply) {\n  const fontWeight = style.fontWeight;\n  const textDecoration = style.textDecoration.split(' ');\n  // Google Docs uses span tags + font-weight for bold text\n  const hasBoldFontWeight = fontWeight === '700' || fontWeight === 'bold';\n  // Google Docs uses span tags + text-decoration: line-through for strikethrough text\n  const hasLinethroughTextDecoration = textDecoration.includes('line-through');\n  // Google Docs uses span tags + font-style for italic text\n  const hasItalicFontStyle = style.fontStyle === 'italic';\n  // Google Docs uses span tags + text-decoration: underline for underline text\n  const hasUnderlineTextDecoration = textDecoration.includes('underline');\n  // Google Docs uses span tags + vertical-align to specify subscript and superscript\n  const verticalAlign = style.verticalAlign;\n  return lexicalNode => {\n    if (!$isTextNode(lexicalNode)) {\n      return lexicalNode;\n    }\n    if (hasBoldFontWeight && !lexicalNode.hasFormat('bold')) {\n      lexicalNode.toggleFormat('bold');\n    }\n    if (hasLinethroughTextDecoration && !lexicalNode.hasFormat('strikethrough')) {\n      lexicalNode.toggleFormat('strikethrough');\n    }\n    if (hasItalicFontStyle && !lexicalNode.hasFormat('italic')) {\n      lexicalNode.toggleFormat('italic');\n    }\n    if (hasUnderlineTextDecoration && !lexicalNode.hasFormat('underline')) {\n      lexicalNode.toggleFormat('underline');\n    }\n    if (verticalAlign === 'sub' && !lexicalNode.hasFormat('subscript')) {\n      lexicalNode.toggleFormat('subscript');\n    }\n    if (verticalAlign === 'super' && !lexicalNode.hasFormat('superscript')) {\n      lexicalNode.toggleFormat('superscript');\n    }\n    if (shouldApply && !lexicalNode.hasFormat(shouldApply)) {\n      lexicalNode.toggleFormat(shouldApply);\n    }\n    return lexicalNode;\n  };\n}\n\n/** @noInheritDoc */\nclass TabNode extends TextNode {\n  static getType() {\n    return 'tab';\n  }\n  static clone(node) {\n    return new TabNode(node.__key);\n  }\n  constructor(key) {\n    super('\\t', key);\n    this.__detail = IS_UNMERGEABLE;\n  }\n  static importDOM() {\n    return null;\n  }\n  createDOM(config) {\n    const dom = super.createDOM(config);\n    const classNames = getCachedClassNameArray(config.theme, 'tab');\n    if (classNames !== undefined) {\n      const domClassList = dom.classList;\n      domClassList.add(...classNames);\n    }\n    return dom;\n  }\n  static importJSON(serializedTabNode) {\n    return $createTabNode().updateFromJSON(serializedTabNode);\n  }\n  setTextContent(text) {\n    if (!(text === '\\t' || text === '')) {\n      formatDevErrorMessage(`TabNode does not support setTextContent`);\n    }\n    return super.setTextContent('\\t');\n  }\n  spliceText(offset, delCount, newText, moveSelection) {\n    if (!(newText === '' && delCount === 0 || newText === '\\t' && delCount === 1)) {\n      formatDevErrorMessage(`TabNode does not support spliceText`);\n    }\n    return this;\n  }\n  setDetail(detail) {\n    if (!(detail === IS_UNMERGEABLE)) {\n      formatDevErrorMessage(`TabNode does not support setDetail`);\n    }\n    return this;\n  }\n  setMode(type) {\n    if (!(type === 'normal')) {\n      formatDevErrorMessage(`TabNode does not support setMode`);\n    }\n    return this;\n  }\n  canInsertTextBefore() {\n    return false;\n  }\n  canInsertTextAfter() {\n    return false;\n  }\n}\nfunction $createTabNode() {\n  return $applyNodeReplacement(new TabNode());\n}\nfunction $isTabNode(node) {\n  return node instanceof TabNode;\n}\n\nclass Point {\n  key;\n  offset;\n  type;\n  _selection;\n  constructor(key, offset, type) {\n    {\n      // This prevents a circular reference error when serialized as JSON,\n      // which happens on unit test failures\n      Object.defineProperty(this, '_selection', {\n        enumerable: false,\n        writable: true\n      });\n    }\n    this._selection = null;\n    this.key = key;\n    this.offset = offset;\n    this.type = type;\n  }\n  is(point) {\n    return this.key === point.key && this.offset === point.offset && this.type === point.type;\n  }\n  isBefore(b) {\n    if (this.key === b.key) {\n      return this.offset < b.offset;\n    }\n    const aCaret = $normalizeCaret($caretFromPoint(this, 'next'));\n    const bCaret = $normalizeCaret($caretFromPoint(b, 'next'));\n    return $comparePointCaretNext(aCaret, bCaret) < 0;\n  }\n  getNode() {\n    const key = this.key;\n    const node = $getNodeByKey(key);\n    if (node === null) {\n      {\n        formatDevErrorMessage(`Point.getNode: node not found`);\n      }\n    }\n    return node;\n  }\n  set(key, offset, type, onlyIfChanged) {\n    const selection = this._selection;\n    const oldKey = this.key;\n    if (onlyIfChanged && this.key === key && this.offset === offset && this.type === type) {\n      return;\n    }\n    this.key = key;\n    this.offset = offset;\n    this.type = type;\n    {\n      const node = $getNodeByKey(key);\n      if (!(type === 'text' ? $isTextNode(node) : $isElementNode(node))) {\n        formatDevErrorMessage(`PointType.set: node with key ${key} is ${node ? node.__type : '[not found]'} and can not be used for a ${type} point`);\n      }\n    }\n    if (!isCurrentlyReadOnlyMode()) {\n      if ($getCompositionKey() === oldKey) {\n        $setCompositionKey(key);\n      }\n      if (selection !== null) {\n        selection.setCachedNodes(null);\n        selection.dirty = true;\n      }\n    }\n  }\n}\nfunction $createPoint(key, offset, type) {\n  // @ts-expect-error: intentionally cast as we use a class for perf reasons\n  return new Point(key, offset, type);\n}\nfunction selectPointOnNode(point, node) {\n  let key = node.__key;\n  let offset = point.offset;\n  let type = 'element';\n  if ($isTextNode(node)) {\n    type = 'text';\n    const textContentLength = node.getTextContentSize();\n    if (offset > textContentLength) {\n      offset = textContentLength;\n    }\n  } else if (!$isElementNode(node)) {\n    const nextSibling = node.getNextSibling();\n    if ($isTextNode(nextSibling)) {\n      key = nextSibling.__key;\n      offset = 0;\n      type = 'text';\n    } else {\n      const parentNode = node.getParent();\n      if (parentNode) {\n        key = parentNode.__key;\n        offset = node.getIndexWithinParent() + 1;\n      }\n    }\n  }\n  point.set(key, offset, type);\n}\nfunction $moveSelectionPointToEnd(point, node) {\n  if ($isElementNode(node)) {\n    const lastNode = node.getLastDescendant();\n    if ($isElementNode(lastNode) || $isTextNode(lastNode)) {\n      selectPointOnNode(point, lastNode);\n    } else {\n      selectPointOnNode(point, node);\n    }\n  } else {\n    selectPointOnNode(point, node);\n  }\n}\nfunction $transferStartingElementPointToTextPoint(start, end, format, style) {\n  const element = start.getNode();\n  const placementNode = element.getChildAtIndex(start.offset);\n  const textNode = $createTextNode();\n  textNode.setFormat(format);\n  textNode.setStyle(style);\n  if ($isParagraphNode(placementNode)) {\n    placementNode.splice(0, 0, [textNode]);\n  } else {\n    const target = $isRootNode(element) ? $createParagraphNode().append(textNode) : textNode;\n    if (placementNode === null) {\n      element.append(target);\n    } else {\n      placementNode.insertBefore(target);\n    }\n  }\n  // Transfer the element point to a text point.\n  if (start.is(end)) {\n    end.set(textNode.__key, 0, 'text');\n  }\n  start.set(textNode.__key, 0, 'text');\n}\nclass NodeSelection {\n  _nodes;\n  _cachedNodes;\n  dirty;\n  constructor(objects) {\n    this._cachedNodes = null;\n    this._nodes = objects;\n    this.dirty = false;\n  }\n  getCachedNodes() {\n    return this._cachedNodes;\n  }\n  setCachedNodes(nodes) {\n    this._cachedNodes = nodes;\n  }\n  is(selection) {\n    if (!$isNodeSelection(selection)) {\n      return false;\n    }\n    const a = this._nodes;\n    const b = selection._nodes;\n    return a.size === b.size && Array.from(a).every(key => b.has(key));\n  }\n  isCollapsed() {\n    return false;\n  }\n  isBackward() {\n    return false;\n  }\n  getStartEndPoints() {\n    return null;\n  }\n  add(key) {\n    this.dirty = true;\n    this._nodes.add(key);\n    this._cachedNodes = null;\n  }\n  delete(key) {\n    this.dirty = true;\n    this._nodes.delete(key);\n    this._cachedNodes = null;\n  }\n  clear() {\n    this.dirty = true;\n    this._nodes.clear();\n    this._cachedNodes = null;\n  }\n  has(key) {\n    return this._nodes.has(key);\n  }\n  clone() {\n    return new NodeSelection(new Set(this._nodes));\n  }\n  extract() {\n    return this.getNodes();\n  }\n  insertRawText(text) {\n    // Do nothing?\n  }\n  insertText() {\n    // Do nothing?\n  }\n  insertNodes(nodes) {\n    const selectedNodes = this.getNodes();\n    const selectedNodesLength = selectedNodes.length;\n    const lastSelectedNode = selectedNodes[selectedNodesLength - 1];\n    let selectionAtEnd;\n    // Insert nodes\n    if ($isTextNode(lastSelectedNode)) {\n      selectionAtEnd = lastSelectedNode.select();\n    } else {\n      const index = lastSelectedNode.getIndexWithinParent() + 1;\n      selectionAtEnd = lastSelectedNode.getParentOrThrow().select(index, index);\n    }\n    selectionAtEnd.insertNodes(nodes);\n    // Remove selected nodes\n    for (let i = 0; i < selectedNodesLength; i++) {\n      selectedNodes[i].remove();\n    }\n  }\n  getNodes() {\n    const cachedNodes = this._cachedNodes;\n    if (cachedNodes !== null) {\n      return cachedNodes;\n    }\n    const objects = this._nodes;\n    const nodes = [];\n    for (const object of objects) {\n      const node = $getNodeByKey(object);\n      if (node !== null) {\n        nodes.push(node);\n      }\n    }\n    if (!isCurrentlyReadOnlyMode()) {\n      this._cachedNodes = nodes;\n    }\n    return nodes;\n  }\n  getTextContent() {\n    const nodes = this.getNodes();\n    let textContent = '';\n    for (let i = 0; i < nodes.length; i++) {\n      textContent += nodes[i].getTextContent();\n    }\n    return textContent;\n  }\n\n  /**\n   * Remove all nodes in the NodeSelection. If there were any nodes,\n   * replace the selection with a new RangeSelection at the previous\n   * location of the first node.\n   */\n  deleteNodes() {\n    const nodes = this.getNodes();\n    if (($getSelection() || $getPreviousSelection()) === this && nodes[0]) {\n      const firstCaret = $getSiblingCaret(nodes[0], 'next');\n      $setSelectionFromCaretRange($getCaretRange(firstCaret, firstCaret));\n    }\n    for (const node of nodes) {\n      node.remove();\n    }\n  }\n}\nfunction $isRangeSelection(x) {\n  return x instanceof RangeSelection;\n}\nclass RangeSelection {\n  format;\n  style;\n  anchor;\n  focus;\n  _cachedNodes;\n  dirty;\n  constructor(anchor, focus, format, style) {\n    this.anchor = anchor;\n    this.focus = focus;\n    anchor._selection = this;\n    focus._selection = this;\n    this._cachedNodes = null;\n    this.format = format;\n    this.style = style;\n    this.dirty = false;\n  }\n  getCachedNodes() {\n    return this._cachedNodes;\n  }\n  setCachedNodes(nodes) {\n    this._cachedNodes = nodes;\n  }\n\n  /**\n   * Used to check if the provided selections is equal to this one by value,\n   * including anchor, focus, format, and style properties.\n   * @param selection - the Selection to compare this one to.\n   * @returns true if the Selections are equal, false otherwise.\n   */\n  is(selection) {\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    return this.anchor.is(selection.anchor) && this.focus.is(selection.focus) && this.format === selection.format && this.style === selection.style;\n  }\n\n  /**\n   * Returns whether the Selection is \"collapsed\", meaning the anchor and focus are\n   * the same node and have the same offset.\n   *\n   * @returns true if the Selection is collapsed, false otherwise.\n   */\n  isCollapsed() {\n    return this.anchor.is(this.focus);\n  }\n\n  /**\n   * Gets all the nodes in the Selection. Uses caching to make it generally suitable\n   * for use in hot paths.\n   *\n   * See also the {@link CaretRange} APIs (starting with\n   * {@link $caretRangeFromSelection}), which are likely to provide a better\n   * foundation for any operation where partial selection is relevant\n   * (e.g. the anchor or focus are inside an ElementNode and TextNode)\n   *\n   * @returns an Array containing all the nodes in the Selection\n   */\n  getNodes() {\n    const cachedNodes = this._cachedNodes;\n    if (cachedNodes !== null) {\n      return cachedNodes;\n    }\n    const range = $getCaretRangeInDirection($caretRangeFromSelection(this), 'next');\n    const nodes = $getNodesFromCaretRangeCompat(range);\n    {\n      if (this.isCollapsed() && nodes.length > 1) {\n        {\n          formatDevErrorMessage(`RangeSelection.getNodes() returned ${String(nodes.length)} > 1 nodes in a collapsed selection`);\n        }\n      }\n    }\n    if (!isCurrentlyReadOnlyMode()) {\n      this._cachedNodes = nodes;\n    }\n    return nodes;\n  }\n\n  /**\n   * Sets this Selection to be of type \"text\" at the provided anchor and focus values.\n   *\n   * @param anchorNode - the anchor node to set on the Selection\n   * @param anchorOffset - the offset to set on the Selection\n   * @param focusNode - the focus node to set on the Selection\n   * @param focusOffset - the focus offset to set on the Selection\n   */\n  setTextNodeRange(anchorNode, anchorOffset, focusNode, focusOffset) {\n    this.anchor.set(anchorNode.__key, anchorOffset, 'text');\n    this.focus.set(focusNode.__key, focusOffset, 'text');\n  }\n\n  /**\n   * Gets the (plain) text content of all the nodes in the selection.\n   *\n   * @returns a string representing the text content of all the nodes in the Selection\n   */\n  getTextContent() {\n    const nodes = this.getNodes();\n    if (nodes.length === 0) {\n      return '';\n    }\n    const firstNode = nodes[0];\n    const lastNode = nodes[nodes.length - 1];\n    const anchor = this.anchor;\n    const focus = this.focus;\n    const isBefore = anchor.isBefore(focus);\n    const [anchorOffset, focusOffset] = $getCharacterOffsets(this);\n    let textContent = '';\n    let prevWasElement = true;\n    for (let i = 0; i < nodes.length; i++) {\n      const node = nodes[i];\n      if ($isElementNode(node) && !node.isInline()) {\n        if (!prevWasElement) {\n          textContent += '\\n';\n        }\n        if (node.isEmpty()) {\n          prevWasElement = false;\n        } else {\n          prevWasElement = true;\n        }\n      } else {\n        prevWasElement = false;\n        if ($isTextNode(node)) {\n          let text = node.getTextContent();\n          if (node === firstNode) {\n            if (node === lastNode) {\n              if (anchor.type !== 'element' || focus.type !== 'element' || focus.offset === anchor.offset) {\n                text = anchorOffset < focusOffset ? text.slice(anchorOffset, focusOffset) : text.slice(focusOffset, anchorOffset);\n              }\n            } else {\n              text = isBefore ? text.slice(anchorOffset) : text.slice(focusOffset);\n            }\n          } else if (node === lastNode) {\n            text = isBefore ? text.slice(0, focusOffset) : text.slice(0, anchorOffset);\n          }\n          textContent += text;\n        } else if (($isDecoratorNode(node) || $isLineBreakNode(node)) && (node !== lastNode || !this.isCollapsed())) {\n          textContent += node.getTextContent();\n        }\n      }\n    }\n    return textContent;\n  }\n\n  /**\n   * Attempts to map a DOM selection range onto this Lexical Selection,\n   * setting the anchor, focus, and type accordingly\n   *\n   * @param range a DOM Selection range conforming to the StaticRange interface.\n   */\n  applyDOMRange(range) {\n    const editor = getActiveEditor();\n    const currentEditorState = editor.getEditorState();\n    const lastSelection = currentEditorState._selection;\n    const resolvedSelectionPoints = $internalResolveSelectionPoints(range.startContainer, range.startOffset, range.endContainer, range.endOffset, editor, lastSelection);\n    if (resolvedSelectionPoints === null) {\n      return;\n    }\n    const [anchorPoint, focusPoint] = resolvedSelectionPoints;\n    this.anchor.set(anchorPoint.key, anchorPoint.offset, anchorPoint.type, true);\n    this.focus.set(focusPoint.key, focusPoint.offset, focusPoint.type, true);\n    // Firefox will use an element point rather than a text point in some cases,\n    // so we normalize for that\n    $normalizeSelection(this);\n  }\n\n  /**\n   * Creates a new RangeSelection, copying over all the property values from this one.\n   *\n   * @returns a new RangeSelection with the same property values as this one.\n   */\n  clone() {\n    const anchor = this.anchor;\n    const focus = this.focus;\n    const selection = new RangeSelection($createPoint(anchor.key, anchor.offset, anchor.type), $createPoint(focus.key, focus.offset, focus.type), this.format, this.style);\n    return selection;\n  }\n\n  /**\n   * Toggles the provided format on all the TextNodes in the Selection.\n   *\n   * @param format a string TextFormatType to toggle on the TextNodes in the selection\n   */\n  toggleFormat(format) {\n    this.format = toggleTextFormatType(this.format, format, null);\n    this.dirty = true;\n  }\n\n  /**\n   * Sets the value of the format property on the Selection\n   *\n   * @param format - the format to set at the value of the format property.\n   */\n  setFormat(format) {\n    this.format = format;\n    this.dirty = true;\n  }\n\n  /**\n   * Sets the value of the style property on the Selection\n   *\n   * @param style - the style to set at the value of the style property.\n   */\n  setStyle(style) {\n    this.style = style;\n    this.dirty = true;\n  }\n\n  /**\n   * Returns whether the provided TextFormatType is present on the Selection. This will be true if any node in the Selection\n   * has the specified format.\n   *\n   * @param type the TextFormatType to check for.\n   * @returns true if the provided format is currently toggled on on the Selection, false otherwise.\n   */\n  hasFormat(type) {\n    const formatFlag = TEXT_TYPE_TO_FORMAT[type];\n    return (this.format & formatFlag) !== 0;\n  }\n\n  /**\n   * Attempts to insert the provided text into the EditorState at the current Selection.\n   * converts tabs, newlines, and carriage returns into LexicalNodes.\n   *\n   * @param text the text to insert into the Selection\n   */\n  insertRawText(text) {\n    const parts = text.split(/(\\r?\\n|\\t)/);\n    const nodes = [];\n    const length = parts.length;\n    for (let i = 0; i < length; i++) {\n      const part = parts[i];\n      if (part === '\\n' || part === '\\r\\n') {\n        nodes.push($createLineBreakNode());\n      } else if (part === '\\t') {\n        nodes.push($createTabNode());\n      } else {\n        nodes.push($createTextNode(part));\n      }\n    }\n    this.insertNodes(nodes);\n  }\n\n  /**\n   * Insert the provided text into the EditorState at the current Selection.\n   *\n   * @param text the text to insert into the Selection\n   */\n  insertText(text) {\n    // Now that \"removeText\" has been improved and does not depend on\n    // insertText, insertText can be greatly simplified. The next\n    // commented version is a WIP (about 5 tests fail).\n    //\n    // this.removeText();\n    // if (text === '') {\n    //   return;\n    // }\n    // const anchorNode = this.anchor.getNode();\n    // const textNode = $createTextNode(text);\n    // textNode.setFormat(this.format);\n    // textNode.setStyle(this.style);\n    // if ($isTextNode(anchorNode)) {\n    //   const parent = anchorNode.getParentOrThrow();\n    //   if (this.anchor.offset === 0) {\n    //     if (parent.isInline() && !anchorNode.__prev) {\n    //       parent.insertBefore(textNode);\n    //     } else {\n    //       anchorNode.insertBefore(textNode);\n    //     }\n    //   } else if (this.anchor.offset === anchorNode.getTextContentSize()) {\n    //     if (parent.isInline() && !anchorNode.__next) {\n    //       parent.insertAfter(textNode);\n    //     } else {\n    //       anchorNode.insertAfter(textNode);\n    //     }\n    //   } else {\n    //     const [before] = anchorNode.splitText(this.anchor.offset);\n    //     before.insertAfter(textNode);\n    //   }\n    // } else {\n    //   anchorNode.splice(this.anchor.offset, 0, [textNode]);\n    // }\n    // const nodeToSelect = textNode.isAttached() ? textNode : anchorNode;\n    // nodeToSelect.selectEnd();\n    // // When composing, we need to adjust the anchor offset so that\n    // // we correctly replace that right range.\n    // if (\n    //   textNode.isComposing() &&\n    //   this.anchor.type === 'text' &&\n    //   anchorNode.getTextContent() !== ''\n    // ) {\n    //   this.anchor.offset -= text.length;\n    // }\n\n    const anchor = this.anchor;\n    const focus = this.focus;\n    const format = this.format;\n    const style = this.style;\n    let firstPoint = anchor;\n    let endPoint = focus;\n    if (!this.isCollapsed() && focus.isBefore(anchor)) {\n      firstPoint = focus;\n      endPoint = anchor;\n    }\n    if (firstPoint.type === 'element') {\n      $transferStartingElementPointToTextPoint(firstPoint, endPoint, format, style);\n    }\n    if (endPoint.type === 'element') {\n      $setPointFromCaret(endPoint, $normalizeCaret($caretFromPoint(endPoint, 'next')));\n    }\n    const startOffset = firstPoint.offset;\n    let endOffset = endPoint.offset;\n    const selectedNodes = this.getNodes();\n    const selectedNodesLength = selectedNodes.length;\n    let firstNode = selectedNodes[0];\n    if (!$isTextNode(firstNode)) {\n      {\n        formatDevErrorMessage(`insertText: first node is not a text node`);\n      }\n    }\n    const firstNodeText = firstNode.getTextContent();\n    const firstNodeTextLength = firstNodeText.length;\n    const firstNodeParent = firstNode.getParentOrThrow();\n    const lastIndex = selectedNodesLength - 1;\n    let lastNode = selectedNodes[lastIndex];\n    if (selectedNodesLength === 1 && endPoint.type === 'element') {\n      endOffset = firstNodeTextLength;\n      endPoint.set(firstPoint.key, endOffset, 'text');\n    }\n    if (this.isCollapsed() && startOffset === firstNodeTextLength && ($isTokenOrSegmented(firstNode) || !firstNode.canInsertTextAfter() || !firstNodeParent.canInsertTextAfter() && firstNode.getNextSibling() === null)) {\n      let nextSibling = firstNode.getNextSibling();\n      if (!$isTextNode(nextSibling) || !nextSibling.canInsertTextBefore() || $isTokenOrSegmented(nextSibling)) {\n        nextSibling = $createTextNode();\n        nextSibling.setFormat(format);\n        nextSibling.setStyle(style);\n        if (!firstNodeParent.canInsertTextAfter()) {\n          firstNodeParent.insertAfter(nextSibling);\n        } else {\n          firstNode.insertAfter(nextSibling);\n        }\n      }\n      nextSibling.select(0, 0);\n      firstNode = nextSibling;\n      if (text !== '') {\n        this.insertText(text);\n        return;\n      }\n    } else if (this.isCollapsed() && startOffset === 0 && ($isTokenOrSegmented(firstNode) || !firstNode.canInsertTextBefore() || !firstNodeParent.canInsertTextBefore() && firstNode.getPreviousSibling() === null)) {\n      let prevSibling = firstNode.getPreviousSibling();\n      if (!$isTextNode(prevSibling) || $isTokenOrSegmented(prevSibling)) {\n        prevSibling = $createTextNode();\n        prevSibling.setFormat(format);\n        if (!firstNodeParent.canInsertTextBefore()) {\n          firstNodeParent.insertBefore(prevSibling);\n        } else {\n          firstNode.insertBefore(prevSibling);\n        }\n      }\n      prevSibling.select();\n      firstNode = prevSibling;\n      if (text !== '') {\n        this.insertText(text);\n        return;\n      }\n    } else if (firstNode.isSegmented() && startOffset !== firstNodeTextLength) {\n      const textNode = $createTextNode(firstNode.getTextContent());\n      textNode.setFormat(format);\n      firstNode.replace(textNode);\n      firstNode = textNode;\n    } else if (!this.isCollapsed() && text !== '') {\n      // When the firstNode or lastNode parents are elements that\n      // do not allow text to be inserted before or after, we first\n      // clear the content. Then we normalize selection, then insert\n      // the new content.\n      const lastNodeParent = lastNode.getParent();\n      if (!firstNodeParent.canInsertTextBefore() || !firstNodeParent.canInsertTextAfter() || $isElementNode(lastNodeParent) && (!lastNodeParent.canInsertTextBefore() || !lastNodeParent.canInsertTextAfter())) {\n        this.insertText('');\n        $normalizeSelectionPointsForBoundaries(this.anchor, this.focus);\n        this.insertText(text);\n        return;\n      }\n    }\n    if (selectedNodesLength === 1) {\n      if ($isTokenOrTab(firstNode)) {\n        const textNode = $createTextNode(text);\n        textNode.select();\n        firstNode.replace(textNode);\n        return;\n      }\n      const firstNodeFormat = firstNode.getFormat();\n      const firstNodeStyle = firstNode.getStyle();\n      if (startOffset === endOffset && (firstNodeFormat !== format || firstNodeStyle !== style)) {\n        if (firstNode.getTextContent() === '') {\n          firstNode.setFormat(format);\n          firstNode.setStyle(style);\n        } else {\n          const textNode = $createTextNode(text);\n          textNode.setFormat(format);\n          textNode.setStyle(style);\n          textNode.select();\n          if (startOffset === 0) {\n            firstNode.insertBefore(textNode, false);\n          } else {\n            const [targetNode] = firstNode.splitText(startOffset);\n            targetNode.insertAfter(textNode, false);\n          }\n          // When composing, we need to adjust the anchor offset so that\n          // we correctly replace that right range.\n          if (textNode.isComposing() && this.anchor.type === 'text') {\n            this.anchor.offset -= text.length;\n          }\n          return;\n        }\n      } else if ($isTabNode(firstNode)) {\n        // We don't need to check for delCount because there is only the entire selected node case\n        // that can hit here for content size 1 and with canInsertTextBeforeAfter false\n        const textNode = $createTextNode(text);\n        textNode.setFormat(format);\n        textNode.setStyle(style);\n        textNode.select();\n        firstNode.replace(textNode);\n        return;\n      }\n      const delCount = endOffset - startOffset;\n      firstNode = firstNode.spliceText(startOffset, delCount, text, true);\n      if (firstNode.getTextContent() === '') {\n        firstNode.remove();\n      } else if (this.anchor.type === 'text') {\n        this.format = firstNodeFormat;\n        this.style = firstNodeStyle;\n        if (firstNode.isComposing()) {\n          // When composing, we need to adjust the anchor offset so that\n          // we correctly replace that right range.\n          this.anchor.offset -= text.length;\n        }\n      }\n    } else {\n      const markedNodeKeysForKeep = new Set([...firstNode.getParentKeys(), ...lastNode.getParentKeys()]);\n\n      // We have to get the parent elements before the next section,\n      // as in that section we might mutate the lastNode.\n      const firstElement = $isElementNode(firstNode) ? firstNode : firstNode.getParentOrThrow();\n      let lastElement = $isElementNode(lastNode) ? lastNode : lastNode.getParentOrThrow();\n      let lastElementChild = lastNode;\n\n      // If the last element is inline, we should instead look at getting\n      // the nodes of its parent, rather than itself. This behavior will\n      // then better match how text node insertions work. We will need to\n      // also update the last element's child accordingly as we do this.\n      if (!firstElement.is(lastElement) && lastElement.isInline()) {\n        // Keep traversing till we have a non-inline element parent.\n        do {\n          lastElementChild = lastElement;\n          lastElement = lastElement.getParentOrThrow();\n        } while (lastElement.isInline());\n      }\n\n      // Handle mutations to the last node.\n      if (endPoint.type === 'text' && (endOffset !== 0 || lastNode.getTextContent() === '') || endPoint.type === 'element' && lastNode.getIndexWithinParent() < endOffset) {\n        if ($isTextNode(lastNode) && !$isTokenOrTab(lastNode) && endOffset !== lastNode.getTextContentSize()) {\n          if (lastNode.isSegmented()) {\n            const textNode = $createTextNode(lastNode.getTextContent());\n            lastNode.replace(textNode);\n            lastNode = textNode;\n          }\n          // root node selections only select whole nodes, so no text splice is necessary\n          if (!$isRootNode(endPoint.getNode()) && endPoint.type === 'text') {\n            lastNode = lastNode.spliceText(0, endOffset, '');\n          }\n          markedNodeKeysForKeep.add(lastNode.__key);\n        } else {\n          const lastNodeParent = lastNode.getParentOrThrow();\n          if (!lastNodeParent.canBeEmpty() && lastNodeParent.getChildrenSize() === 1) {\n            lastNodeParent.remove();\n          } else {\n            lastNode.remove();\n          }\n        }\n      } else {\n        markedNodeKeysForKeep.add(lastNode.__key);\n      }\n\n      // Either move the remaining nodes of the last parent to after\n      // the first child, or remove them entirely. If the last parent\n      // is the same as the first parent, this logic also works.\n      const lastNodeChildren = lastElement.getChildren();\n      const selectedNodesSet = new Set(selectedNodes);\n      const firstAndLastElementsAreEqual = firstElement.is(lastElement);\n\n      // We choose a target to insert all nodes after. In the case of having\n      // and inline starting parent element with a starting node that has no\n      // siblings, we should insert after the starting parent element, otherwise\n      // we will incorrectly merge into the starting parent element.\n      // TODO: should we keep on traversing parents if we're inside another\n      // nested inline element?\n      const insertionTarget = firstElement.isInline() && firstNode.getNextSibling() === null ? firstElement : firstNode;\n      for (let i = lastNodeChildren.length - 1; i >= 0; i--) {\n        const lastNodeChild = lastNodeChildren[i];\n        if (lastNodeChild.is(firstNode) || $isElementNode(lastNodeChild) && lastNodeChild.isParentOf(firstNode)) {\n          break;\n        }\n        if (lastNodeChild.isAttached()) {\n          if (!selectedNodesSet.has(lastNodeChild) || lastNodeChild.is(lastElementChild)) {\n            if (!firstAndLastElementsAreEqual) {\n              insertionTarget.insertAfter(lastNodeChild, false);\n            }\n          } else {\n            lastNodeChild.remove();\n          }\n        }\n      }\n      if (!firstAndLastElementsAreEqual) {\n        // Check if we have already moved out all the nodes of the\n        // last parent, and if so, traverse the parent tree and mark\n        // them all as being able to deleted too.\n        let parent = lastElement;\n        let lastRemovedParent = null;\n        while (parent !== null) {\n          const children = parent.getChildren();\n          const childrenLength = children.length;\n          if (childrenLength === 0 || children[childrenLength - 1].is(lastRemovedParent)) {\n            markedNodeKeysForKeep.delete(parent.__key);\n            lastRemovedParent = parent;\n          }\n          parent = parent.getParent();\n        }\n      }\n\n      // Ensure we do splicing after moving of nodes, as splicing\n      // can have side-effects (in the case of hashtags).\n      if (!$isTokenOrTab(firstNode)) {\n        firstNode = firstNode.spliceText(startOffset, firstNodeTextLength - startOffset, text, true);\n        if (firstNode.getTextContent() === '') {\n          firstNode.remove();\n        } else if (this.anchor.type === 'text') {\n          this.format = firstNode.getFormat();\n          this.style = firstNode.getStyle();\n          if (firstNode.isComposing()) {\n            // When composing, we need to adjust the anchor offset so that\n            // we correctly replace that right range.\n            this.anchor.offset -= text.length;\n          }\n        }\n      } else if (startOffset === firstNodeTextLength) {\n        firstNode.select();\n      } else {\n        const textNode = $createTextNode(text);\n        textNode.select();\n        firstNode.replace(textNode);\n      }\n\n      // Remove all selected nodes that haven't already been removed.\n      for (let i = 1; i < selectedNodesLength; i++) {\n        const selectedNode = selectedNodes[i];\n        const key = selectedNode.__key;\n        if (!markedNodeKeysForKeep.has(key)) {\n          selectedNode.remove();\n        }\n      }\n    }\n  }\n\n  /**\n   * Removes the text in the Selection, adjusting the EditorState accordingly.\n   */\n  removeText() {\n    const isCurrentSelection = $getSelection() === this;\n    const newRange = $removeTextFromCaretRange($caretRangeFromSelection(this));\n    $updateRangeSelectionFromCaretRange(this, newRange);\n    if (isCurrentSelection && $getSelection() !== this) {\n      $setSelection(this);\n    }\n  }\n\n  // TO-DO: Migrate this method to the new utility function $forEachSelectedTextNode (share similar logic)\n  /**\n   * Applies the provided format to the TextNodes in the Selection, splitting or\n   * merging nodes as necessary.\n   *\n   * @param formatType the format type to apply to the nodes in the Selection.\n   * @param alignWithFormat a 32-bit integer representing formatting flags to align with.\n   */\n  formatText(formatType, alignWithFormat = null) {\n    if (this.isCollapsed()) {\n      this.toggleFormat(formatType);\n      // When changing format, we should stop composition\n      $setCompositionKey(null);\n      return;\n    }\n    const selectedNodes = this.getNodes();\n    const selectedTextNodes = [];\n    for (const selectedNode of selectedNodes) {\n      if ($isTextNode(selectedNode)) {\n        selectedTextNodes.push(selectedNode);\n      }\n    }\n    const applyFormatToElements = alignWith => {\n      selectedNodes.forEach(node => {\n        if ($isElementNode(node)) {\n          const newFormat = node.getFormatFlags(formatType, alignWith);\n          node.setTextFormat(newFormat);\n        }\n      });\n    };\n    const selectedTextNodesLength = selectedTextNodes.length;\n    if (selectedTextNodesLength === 0) {\n      this.toggleFormat(formatType);\n      // When changing format, we should stop composition\n      $setCompositionKey(null);\n      applyFormatToElements(alignWithFormat);\n      return;\n    }\n    const anchor = this.anchor;\n    const focus = this.focus;\n    const isBackward = this.isBackward();\n    const startPoint = isBackward ? focus : anchor;\n    const endPoint = isBackward ? anchor : focus;\n    let firstIndex = 0;\n    let firstNode = selectedTextNodes[0];\n    let startOffset = startPoint.type === 'element' ? 0 : startPoint.offset;\n\n    // In case selection started at the end of text node use next text node\n    if (startPoint.type === 'text' && startOffset === firstNode.getTextContentSize()) {\n      firstIndex = 1;\n      firstNode = selectedTextNodes[1];\n      startOffset = 0;\n    }\n    if (firstNode == null) {\n      return;\n    }\n    const firstNextFormat = firstNode.getFormatFlags(formatType, alignWithFormat);\n    applyFormatToElements(firstNextFormat);\n    const lastIndex = selectedTextNodesLength - 1;\n    let lastNode = selectedTextNodes[lastIndex];\n    const endOffset = endPoint.type === 'text' ? endPoint.offset : lastNode.getTextContentSize();\n\n    // Single node selected\n    if (firstNode.is(lastNode)) {\n      // No actual text is selected, so do nothing.\n      if (startOffset === endOffset) {\n        return;\n      }\n      // The entire node is selected or it is token, so just format it\n      if ($isTokenOrSegmented(firstNode) || startOffset === 0 && endOffset === firstNode.getTextContentSize()) {\n        firstNode.setFormat(firstNextFormat);\n      } else {\n        // Node is partially selected, so split it into two nodes\n        // add style the selected one.\n        const splitNodes = firstNode.splitText(startOffset, endOffset);\n        const replacement = startOffset === 0 ? splitNodes[0] : splitNodes[1];\n        replacement.setFormat(firstNextFormat);\n\n        // Update selection only if starts/ends on text node\n        if (startPoint.type === 'text') {\n          startPoint.set(replacement.__key, 0, 'text');\n        }\n        if (endPoint.type === 'text') {\n          endPoint.set(replacement.__key, endOffset - startOffset, 'text');\n        }\n      }\n      this.format = firstNextFormat;\n      return;\n    }\n    // Multiple nodes selected\n    // The entire first node isn't selected, so split it\n    if (startOffset !== 0 && !$isTokenOrSegmented(firstNode)) {\n      [, firstNode] = firstNode.splitText(startOffset);\n      startOffset = 0;\n    }\n    firstNode.setFormat(firstNextFormat);\n    const lastNextFormat = lastNode.getFormatFlags(formatType, firstNextFormat);\n    // If the offset is 0, it means no actual characters are selected,\n    // so we skip formatting the last node altogether.\n    if (endOffset > 0) {\n      if (endOffset !== lastNode.getTextContentSize() && !$isTokenOrSegmented(lastNode)) {\n        [lastNode] = lastNode.splitText(endOffset);\n      }\n      lastNode.setFormat(lastNextFormat);\n    }\n\n    // Process all text nodes in between\n    for (let i = firstIndex + 1; i < lastIndex; i++) {\n      const textNode = selectedTextNodes[i];\n      const nextFormat = textNode.getFormatFlags(formatType, lastNextFormat);\n      textNode.setFormat(nextFormat);\n    }\n\n    // Update selection only if starts/ends on text node\n    if (startPoint.type === 'text') {\n      startPoint.set(firstNode.__key, startOffset, 'text');\n    }\n    if (endPoint.type === 'text') {\n      endPoint.set(lastNode.__key, endOffset, 'text');\n    }\n    this.format = firstNextFormat | lastNextFormat;\n  }\n\n  /**\n   * Attempts to \"intelligently\" insert an arbitrary list of Lexical nodes into the EditorState at the\n   * current Selection according to a set of heuristics that determine how surrounding nodes\n   * should be changed, replaced, or moved to accommodate the incoming ones.\n   *\n   * @param nodes - the nodes to insert\n   */\n  insertNodes(nodes) {\n    if (nodes.length === 0) {\n      return;\n    }\n    if (!this.isCollapsed()) {\n      this.removeText();\n    }\n    if (this.anchor.key === 'root') {\n      this.insertParagraph();\n      const selection = $getSelection();\n      if (!$isRangeSelection(selection)) {\n        formatDevErrorMessage(`Expected RangeSelection after insertParagraph`);\n      }\n      return selection.insertNodes(nodes);\n    }\n    const firstPoint = this.isBackward() ? this.focus : this.anchor;\n    const firstNode = firstPoint.getNode();\n    const firstBlock = $findMatchingParent(firstNode, INTERNAL_$isBlock);\n    const last = nodes[nodes.length - 1];\n\n    // CASE 1: insert inside a code block\n    if ($isElementNode(firstBlock) && '__language' in firstBlock) {\n      if ('__language' in nodes[0]) {\n        this.insertText(nodes[0].getTextContent());\n      } else {\n        const index = $removeTextAndSplitBlock(this);\n        firstBlock.splice(index, 0, nodes);\n        last.selectEnd();\n      }\n      return;\n    }\n\n    // CASE 2: All elements of the array are inline\n    const notInline = node => ($isElementNode(node) || $isDecoratorNode(node)) && !node.isInline();\n    if (!nodes.some(notInline)) {\n      if (!$isElementNode(firstBlock)) {\n        formatDevErrorMessage(`Expected node ${firstNode.constructor.name} of type ${firstNode.getType()} to have a block ElementNode ancestor`);\n      }\n      const index = $removeTextAndSplitBlock(this);\n      firstBlock.splice(index, 0, nodes);\n      last.selectEnd();\n      return;\n    }\n\n    // CASE 3: At least 1 element of the array is not inline\n    const blocksParent = $wrapInlineNodes(nodes);\n    const nodeToSelect = blocksParent.getLastDescendant();\n    const blocks = blocksParent.getChildren();\n    const isMergeable = node => $isElementNode(node) && INTERNAL_$isBlock(node) && !node.isEmpty() && $isElementNode(firstBlock) && (!firstBlock.isEmpty() || firstBlock.canMergeWhenEmpty());\n    const shouldInsert = !$isElementNode(firstBlock) || !firstBlock.isEmpty();\n    const insertedParagraph = shouldInsert ? this.insertParagraph() : null;\n    const lastToInsert = blocks[blocks.length - 1];\n    let firstToInsert = blocks[0];\n    if (isMergeable(firstToInsert)) {\n      if (!$isElementNode(firstBlock)) {\n        formatDevErrorMessage(`Expected node ${firstNode.constructor.name} of type ${firstNode.getType()} to have a block ElementNode ancestor`);\n      }\n      firstBlock.append(...firstToInsert.getChildren());\n      firstToInsert = blocks[1];\n    }\n    if (firstToInsert) {\n      if (!(firstBlock !== null)) {\n        formatDevErrorMessage(`Expected node ${firstNode.constructor.name} of type ${firstNode.getType()} to have a block ancestor`);\n      }\n      insertRangeAfter(firstBlock, firstToInsert);\n    }\n    const lastInsertedBlock = $findMatchingParent(nodeToSelect, INTERNAL_$isBlock);\n    if (insertedParagraph && $isElementNode(lastInsertedBlock) && (insertedParagraph.canMergeWhenEmpty() || INTERNAL_$isBlock(lastToInsert))) {\n      lastInsertedBlock.append(...insertedParagraph.getChildren());\n      insertedParagraph.remove();\n    }\n    if ($isElementNode(firstBlock) && firstBlock.isEmpty()) {\n      firstBlock.remove();\n    }\n    nodeToSelect.selectEnd();\n\n    // To understand this take a look at the test \"can wrap post-linebreak nodes into new element\"\n    const lastChild = $isElementNode(firstBlock) ? firstBlock.getLastChild() : null;\n    if ($isLineBreakNode(lastChild) && lastInsertedBlock !== firstBlock) {\n      lastChild.remove();\n    }\n  }\n\n  /**\n   * Inserts a new ParagraphNode into the EditorState at the current Selection\n   *\n   * @returns the newly inserted node.\n   */\n  insertParagraph() {\n    if (this.anchor.key === 'root') {\n      const paragraph = $createParagraphNode();\n      $getRoot().splice(this.anchor.offset, 0, [paragraph]);\n      paragraph.select();\n      return paragraph;\n    }\n    const index = $removeTextAndSplitBlock(this);\n    const block = $findMatchingParent(this.anchor.getNode(), INTERNAL_$isBlock);\n    if (!$isElementNode(block)) {\n      formatDevErrorMessage(`Expected ancestor to be a block ElementNode`);\n    }\n    const firstToAppend = block.getChildAtIndex(index);\n    const nodesToInsert = firstToAppend ? [firstToAppend, ...firstToAppend.getNextSiblings()] : [];\n    const newBlock = block.insertNewAfter(this, false);\n    if (newBlock) {\n      newBlock.append(...nodesToInsert);\n      newBlock.selectStart();\n      return newBlock;\n    }\n    // if newBlock is null, it means that block is of type CodeNode.\n    return null;\n  }\n\n  /**\n   * Inserts a logical linebreak, which may be a new LineBreakNode or a new ParagraphNode, into the EditorState at the\n   * current Selection.\n   */\n  insertLineBreak(selectStart) {\n    const lineBreak = $createLineBreakNode();\n    this.insertNodes([lineBreak]);\n    // this is used in MacOS with the command 'ctrl-O' (openLineBreak)\n    if (selectStart) {\n      const parent = lineBreak.getParentOrThrow();\n      const index = lineBreak.getIndexWithinParent();\n      parent.select(index, index);\n    }\n  }\n\n  /**\n   * Extracts the nodes in the Selection, splitting nodes where necessary\n   * to get offset-level precision.\n   *\n   * @returns The nodes in the Selection\n   */\n  extract() {\n    const selectedNodes = [...this.getNodes()];\n    const selectedNodesLength = selectedNodes.length;\n    let firstNode = selectedNodes[0];\n    let lastNode = selectedNodes[selectedNodesLength - 1];\n    const [anchorOffset, focusOffset] = $getCharacterOffsets(this);\n    const isBackward = this.isBackward();\n    const [startPoint, endPoint] = isBackward ? [this.focus, this.anchor] : [this.anchor, this.focus];\n    const [startOffset, endOffset] = isBackward ? [focusOffset, anchorOffset] : [anchorOffset, focusOffset];\n    if (selectedNodesLength === 0) {\n      return [];\n    } else if (selectedNodesLength === 1) {\n      if ($isTextNode(firstNode) && !this.isCollapsed()) {\n        const splitNodes = firstNode.splitText(startOffset, endOffset);\n        const node = startOffset === 0 ? splitNodes[0] : splitNodes[1];\n        if (node) {\n          startPoint.set(node.getKey(), 0, 'text');\n          endPoint.set(node.getKey(), node.getTextContentSize(), 'text');\n          return [node];\n        }\n        return [];\n      }\n      return [firstNode];\n    }\n    if ($isTextNode(firstNode)) {\n      if (startOffset === firstNode.getTextContentSize()) {\n        selectedNodes.shift();\n      } else if (startOffset !== 0) {\n        [, firstNode] = firstNode.splitText(startOffset);\n        selectedNodes[0] = firstNode;\n        startPoint.set(firstNode.getKey(), 0, 'text');\n      }\n    }\n    if ($isTextNode(lastNode)) {\n      const lastNodeText = lastNode.getTextContent();\n      const lastNodeTextLength = lastNodeText.length;\n      if (endOffset === 0) {\n        selectedNodes.pop();\n      } else if (endOffset !== lastNodeTextLength) {\n        [lastNode] = lastNode.splitText(endOffset);\n        selectedNodes[selectedNodes.length - 1] = lastNode;\n        endPoint.set(lastNode.getKey(), lastNode.getTextContentSize(), 'text');\n      }\n    }\n    return selectedNodes;\n  }\n\n  /**\n   * Modifies the Selection according to the parameters and a set of heuristics that account for\n   * various node types. Can be used to safely move or extend selection by one logical \"unit\" without\n   * dealing explicitly with all the possible node types.\n   *\n   * @param alter the type of modification to perform\n   * @param isBackward whether or not selection is backwards\n   * @param granularity the granularity at which to apply the modification\n   */\n  modify(alter, isBackward, granularity) {\n    if ($modifySelectionAroundDecoratorsAndBlocks(this, alter, isBackward, granularity)) {\n      return;\n    }\n    const collapse = alter === 'move';\n    const editor = getActiveEditor();\n    const domSelection = getDOMSelection(getWindow(editor));\n    if (!domSelection) {\n      return;\n    }\n    const blockCursorElement = editor._blockCursorElement;\n    const rootElement = editor._rootElement;\n    const focusNode = this.focus.getNode();\n    // Remove the block cursor element if it exists. This will ensure selection\n    // works as intended. If we leave it in the DOM all sorts of strange bugs\n    // occur. :/\n    if (rootElement !== null && blockCursorElement !== null && $isElementNode(focusNode) && !focusNode.isInline() && !focusNode.canBeEmpty()) {\n      removeDOMBlockCursorElement(blockCursorElement, editor, rootElement);\n    }\n    if (this.dirty) {\n      let nextAnchorDOM = getElementByKeyOrThrow(editor, this.anchor.key);\n      let nextFocusDOM = getElementByKeyOrThrow(editor, this.focus.key);\n      if (this.anchor.type === 'text') {\n        nextAnchorDOM = getDOMTextNode(nextAnchorDOM);\n      }\n      if (this.focus.type === 'text') {\n        nextFocusDOM = getDOMTextNode(nextFocusDOM);\n      }\n      if (nextAnchorDOM && nextFocusDOM) {\n        setDOMSelectionBaseAndExtent(domSelection, nextAnchorDOM, this.anchor.offset, nextFocusDOM, this.focus.offset);\n      }\n    }\n    // We use the DOM selection.modify API here to \"tell\" us what the selection\n    // will be. We then use it to update the Lexical selection accordingly. This\n    // is much more reliable than waiting for a beforeinput and using the ranges\n    // from getTargetRanges(), and is also better than trying to do it ourselves\n    // using Intl.Segmenter or other workarounds that struggle with word segments\n    // and line segments (especially with word wrapping and non-Roman languages).\n    moveNativeSelection(domSelection, alter, isBackward ? 'backward' : 'forward', granularity);\n    // Guard against no ranges\n    if (domSelection.rangeCount > 0) {\n      const range = domSelection.getRangeAt(0);\n      // Apply the DOM selection to our Lexical selection.\n      const anchorNode = this.anchor.getNode();\n      const root = $isRootNode(anchorNode) ? anchorNode : $getNearestRootOrShadowRoot(anchorNode);\n      this.applyDOMRange(range);\n      this.dirty = true;\n      if (!collapse) {\n        // Validate selection; make sure that the new extended selection respects shadow roots\n        const nodes = this.getNodes();\n        const validNodes = [];\n        let shrinkSelection = false;\n        for (let i = 0; i < nodes.length; i++) {\n          const nextNode = nodes[i];\n          if ($hasAncestor(nextNode, root)) {\n            validNodes.push(nextNode);\n          } else {\n            shrinkSelection = true;\n          }\n        }\n        if (shrinkSelection && validNodes.length > 0) {\n          // validNodes length check is a safeguard against an invalid selection; as getNodes()\n          // will return an empty array in this case\n          if (isBackward) {\n            const firstValidNode = validNodes[0];\n            if ($isElementNode(firstValidNode)) {\n              firstValidNode.selectStart();\n            } else {\n              firstValidNode.getParentOrThrow().selectStart();\n            }\n          } else {\n            const lastValidNode = validNodes[validNodes.length - 1];\n            if ($isElementNode(lastValidNode)) {\n              lastValidNode.selectEnd();\n            } else {\n              lastValidNode.getParentOrThrow().selectEnd();\n            }\n          }\n        }\n\n        // Because a range works on start and end, we might need to flip\n        // the anchor and focus points to match what the DOM has, not what\n        // the range has specifically.\n        if (domSelection.anchorNode !== range.startContainer || domSelection.anchorOffset !== range.startOffset) {\n          $swapPoints(this);\n        }\n      }\n    }\n    if (granularity === 'lineboundary') {\n      $modifySelectionAroundDecoratorsAndBlocks(this, alter, isBackward, granularity, 'decorators');\n    }\n  }\n  /**\n   * Helper for handling forward character and word deletion that prevents element nodes\n   * like a table, columns layout being destroyed\n   *\n   * @param anchor the anchor\n   * @param anchorNode the anchor node in the selection\n   * @param isBackward whether or not selection is backwards\n   */\n  forwardDeletion(anchor, anchorNode, isBackward) {\n    if (!isBackward && (\n    // Delete forward handle case\n    anchor.type === 'element' && $isElementNode(anchorNode) && anchor.offset === anchorNode.getChildrenSize() || anchor.type === 'text' && anchor.offset === anchorNode.getTextContentSize())) {\n      const parent = anchorNode.getParent();\n      const nextSibling = anchorNode.getNextSibling() || (parent === null ? null : parent.getNextSibling());\n      if ($isElementNode(nextSibling) && nextSibling.isShadowRoot()) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  /**\n   * Performs one logical character deletion operation on the EditorState based on the current Selection.\n   * Handles different node types.\n   *\n   * @param isBackward whether or not the selection is backwards.\n   */\n  deleteCharacter(isBackward) {\n    const wasCollapsed = this.isCollapsed();\n    if (this.isCollapsed()) {\n      const anchor = this.anchor;\n      let anchorNode = anchor.getNode();\n      if (this.forwardDeletion(anchor, anchorNode, isBackward)) {\n        return;\n      }\n      const direction = isBackward ? 'previous' : 'next';\n      const initialCaret = $caretFromPoint(anchor, direction);\n      const initialRange = $extendCaretToRange(initialCaret);\n      if (initialRange.getTextSlices().every(slice => slice === null || slice.distance === 0)) {\n        // There's no text in the direction of the deletion so we can explore our options\n        let state = {\n          type: 'initial'\n        };\n        for (const caret of initialRange.iterNodeCarets('shadowRoot')) {\n          if ($isChildCaret(caret)) {\n            if (caret.origin.isInline()) ; else if (caret.origin.isShadowRoot()) {\n              if (state.type === 'merge-block') {\n                break;\n              }\n              // Don't merge with a shadow root block\n              if ($isElementNode(initialRange.anchor.origin) && initialRange.anchor.origin.isEmpty()) {\n                // delete an empty paragraph like the DecoratorNode case\n                const normCaret = $normalizeCaret(caret);\n                $updateRangeSelectionFromCaretRange(this, $getCaretRange(normCaret, normCaret));\n                initialRange.anchor.origin.remove();\n              }\n              return;\n            } else if (state.type === 'merge-next-block' || state.type === 'merge-block') {\n              // Keep descending ChildCaret to find which block to merge with\n              state = {\n                block: state.block,\n                caret,\n                type: 'merge-block'\n              };\n            }\n          } else if (state.type === 'merge-block') {\n            break;\n          } else if ($isSiblingCaret(caret)) {\n            if ($isElementNode(caret.origin)) {\n              if (!caret.origin.isInline()) {\n                state = {\n                  block: caret.origin,\n                  type: 'merge-next-block'\n                };\n              } else if (!caret.origin.isParentOf(initialRange.anchor.origin)) {\n                break;\n              }\n              continue;\n            } else if ($isDecoratorNode(caret.origin)) {\n              if (caret.origin.isIsolated()) ; else if (state.type === 'merge-next-block' && (caret.origin.isKeyboardSelectable() || !caret.origin.isInline()) && $isElementNode(initialRange.anchor.origin) && initialRange.anchor.origin.isEmpty()) {\n                // If the anchor is an empty element that is adjacent to a\n                // decorator then we remove the paragraph and select the\n                // decorator\n                initialRange.anchor.origin.remove();\n                const nodeSelection = $createNodeSelection();\n                nodeSelection.add(caret.origin.getKey());\n                $setSelection(nodeSelection);\n              } else {\n                // When the anchor is not an empty element then the\n                // adjacent decorator is removed\n                caret.origin.remove();\n              }\n              // always stop when a decorator is encountered\n              return;\n            }\n            break;\n          }\n        }\n        if (state.type === 'merge-block') {\n          const {\n            caret,\n            block\n          } = state;\n          $updateRangeSelectionFromCaretRange(this, $getCaretRange(!caret.origin.isEmpty() && block.isEmpty() ? $rewindSiblingCaret($getSiblingCaret(block, caret.direction)) : initialRange.anchor, caret));\n          return this.removeText();\n        }\n      }\n\n      // Handle the deletion around decorators.\n      const focus = this.focus;\n      this.modify('extend', isBackward, 'character');\n      if (!this.isCollapsed()) {\n        const focusNode = focus.type === 'text' ? focus.getNode() : null;\n        anchorNode = anchor.type === 'text' ? anchor.getNode() : null;\n        if (focusNode !== null && focusNode.isSegmented()) {\n          const offset = focus.offset;\n          const textContentSize = focusNode.getTextContentSize();\n          if (focusNode.is(anchorNode) || isBackward && offset !== textContentSize || !isBackward && offset !== 0) {\n            $removeSegment(focusNode, isBackward, offset);\n            return;\n          }\n        } else if (anchorNode !== null && anchorNode.isSegmented()) {\n          const offset = anchor.offset;\n          const textContentSize = anchorNode.getTextContentSize();\n          if (anchorNode.is(focusNode) || isBackward && offset !== 0 || !isBackward && offset !== textContentSize) {\n            $removeSegment(anchorNode, isBackward, offset);\n            return;\n          }\n        }\n        $updateCaretSelectionForUnicodeCharacter(this, isBackward);\n      } else if (isBackward && anchor.offset === 0) {\n        // Special handling around rich text nodes\n        if ($collapseAtStart(this, anchor.getNode())) {\n          return;\n        }\n      }\n    }\n    this.removeText();\n    if (isBackward && !wasCollapsed && this.isCollapsed() && this.anchor.type === 'element' && this.anchor.offset === 0) {\n      const anchorNode = this.anchor.getNode();\n      if (anchorNode.isEmpty() && $isRootNode(anchorNode.getParent()) && anchorNode.getPreviousSibling() === null) {\n        $collapseAtStart(this, anchorNode);\n      }\n    }\n  }\n\n  /**\n   * Performs one logical line deletion operation on the EditorState based on the current Selection.\n   * Handles different node types.\n   *\n   * @param isBackward whether or not the selection is backwards.\n   */\n  deleteLine(isBackward) {\n    if (this.isCollapsed()) {\n      this.modify('extend', isBackward, 'lineboundary');\n    }\n    if (this.isCollapsed()) {\n      // If the selection was already collapsed at the lineboundary,\n      // use the deleteCharacter operation to handle all of the logic associated\n      // with navigating through the parent element\n      this.deleteCharacter(isBackward);\n    } else {\n      this.removeText();\n    }\n  }\n\n  /**\n   * Performs one logical word deletion operation on the EditorState based on the current Selection.\n   * Handles different node types.\n   *\n   * @param isBackward whether or not the selection is backwards.\n   */\n  deleteWord(isBackward) {\n    if (this.isCollapsed()) {\n      const anchor = this.anchor;\n      const anchorNode = anchor.getNode();\n      if (this.forwardDeletion(anchor, anchorNode, isBackward)) {\n        return;\n      }\n      this.modify('extend', isBackward, 'word');\n    }\n    if (this.isCollapsed()) {\n      // If the selection was already collapsed at the lineboundary,\n      // use the deleteCharacter operation to handle all of the logic associated\n      // with navigating through the parent element\n      this.deleteCharacter(isBackward);\n    } else {\n      this.removeText();\n    }\n  }\n\n  /**\n   * Returns whether the Selection is \"backwards\", meaning the focus\n   * logically precedes the anchor in the EditorState.\n   * @returns true if the Selection is backwards, false otherwise.\n   */\n  isBackward() {\n    return this.focus.isBefore(this.anchor);\n  }\n  getStartEndPoints() {\n    return [this.anchor, this.focus];\n  }\n}\nfunction $isNodeSelection(x) {\n  return x instanceof NodeSelection;\n}\nfunction getCharacterOffset(point) {\n  const offset = point.offset;\n  if (point.type === 'text') {\n    return offset;\n  }\n  const parent = point.getNode();\n  return offset === parent.getChildrenSize() ? parent.getTextContent().length : 0;\n}\nfunction $getCharacterOffsets(selection) {\n  const anchorAndFocus = selection.getStartEndPoints();\n  if (anchorAndFocus === null) {\n    return [0, 0];\n  }\n  const [anchor, focus] = anchorAndFocus;\n  if (anchor.type === 'element' && focus.type === 'element' && anchor.key === focus.key && anchor.offset === focus.offset) {\n    return [0, 0];\n  }\n  return [getCharacterOffset(anchor), getCharacterOffset(focus)];\n}\nfunction $collapseAtStart(selection, startNode) {\n  for (let node = startNode; node; node = node.getParent()) {\n    if ($isElementNode(node)) {\n      if (node.collapseAtStart(selection)) {\n        return true;\n      }\n      if ($isRootOrShadowRoot(node)) {\n        break;\n      }\n    }\n    if (node.getPreviousSibling()) {\n      break;\n    }\n  }\n  return false;\n}\nfunction $swapPoints(selection) {\n  const focus = selection.focus;\n  const anchor = selection.anchor;\n  const anchorKey = anchor.key;\n  const anchorOffset = anchor.offset;\n  const anchorType = anchor.type;\n  anchor.set(focus.key, focus.offset, focus.type, true);\n  focus.set(anchorKey, anchorOffset, anchorType, true);\n}\nfunction moveNativeSelection(domSelection, alter, direction, granularity) {\n  // Selection.modify() method applies a change to the current selection or cursor position,\n  // but is still non-standard in some browsers.\n  domSelection.modify(alter, direction, granularity);\n}\n\n/**\n * Called by `RangeSelection.deleteCharacter` to determine if\n * `this.modify('extend', isBackward, 'character')` extended the selection\n * further than a user would expect for that operation.\n *\n * A short(?) JavaScript string vs. Unicode primer:\n *\n * Strings in JavaScript use an UTF-16 encoding, and the offsets into a\n * string are based on those UTF-16 *code units*. This is basically a\n * historical mistake (though logical at that time, decades ago), but\n * can never really be fixed for compatibility reasons.\n *\n * In Unicode, a *code point* is the combination of one or more *code units*.\n * and the range of a *code point* can fit into 21 bits.\n *\n * Every valid *code point* can be represented with one or two\n * *UTF-16 code units*. One unit is used when the code point is in the\n * Basic Multilingual Plane (BMP) and is `< 0xFFFF`. Anything outside\n * of that plane is encoded with a *surrogate pair* of *code units* and\n * `/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/` is a regex that you could use to\n * find any valid *surrogate pair*. As far as Unicode is concerned, these\n * pairs represent a single *code point*, but in JavaScript, these pairs\n * have a length of 2 (`pair.charCodeAt(n)` is really returning a\n * UTF-16 *code unit*, not a unicode *code point*). It is possible to request\n * a *code point* with `pair.codePointAt(0)` and enumerate code points\n * in a string with `[...string]` but the offsets we work with, and\n * the string length, are based in *code units* so that functionality\n * is unfortunately not very useful here.\n *\n * This only gets us as far as *code points*. We now know that we must\n * consider that each *code point* can have a length of 1 or 2 in JavaScript\n * string distance. It gets even trickier because the visual representation\n * of a character is a *grapheme* (approximately what the user thinks of\n * as a character). A *grapheme* is one or more *code points*, and can\n * essentially be arbitrarily long, as there are many ways to combine\n * them.\n *\n * The `this.modify(\u2026)` call has already extended our selection by one\n * *grapheme* in the direction we want to delete. Sounds great, it's done\n * a lot of awfully tricky work for us because this functionality has only\n * recently become available in JavaScript via `Intl.Segmenter`. The\n * problem is that in many cases the expected behavior of backspace or\n * delete is *not always to delete a whole grapheme*. In some languages\n * it's always expected that backspace ought to delete one code point, not the\n * whole grapheme. In other situations such as emoji that use variation\n * selectors you *do* want to delete the whole *grapheme*.\n *\n * In a few situations the behavior is even application dependent, such as\n * with latin languages where you have multiple ways to represent the same\n * character visually (e.g. a letter with an accent in one code point, or a\n * letter followed by a combining mark in a second code point); some apps will\n * delete the whole grapheme and others will delete only the combining mark,\n * probably based on whether they perform some sort of *normalization* on their\n * input to ensure that only one form is used when two sequences of code points\n * can represent the same visual character. Lexical currently chooses not\n * to perform any normalization so this type of combining marks will be\n * deleted as a *code point* without deleting the whole *grapheme*.\n *\n * See also:\n * https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-2/#G25564\n * https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-3/#G30602\n * https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-3/#G49537\n * https://mathiasbynens.be/notes/javascript-unicode\n */\nfunction $updateCaretSelectionForUnicodeCharacter(selection, isBackward) {\n  const anchor = selection.anchor;\n  const focus = selection.focus;\n  const anchorNode = anchor.getNode();\n  const focusNode = focus.getNode();\n  if (anchorNode === focusNode && anchor.type === 'text' && focus.type === 'text') {\n    // Handling of multibyte characters\n    const anchorOffset = anchor.offset;\n    const focusOffset = focus.offset;\n    const isBefore = anchorOffset < focusOffset;\n    const startOffset = isBefore ? anchorOffset : focusOffset;\n    const endOffset = isBefore ? focusOffset : anchorOffset;\n    const characterOffset = endOffset - 1;\n    if (startOffset !== characterOffset) {\n      const text = anchorNode.getTextContent().slice(startOffset, endOffset);\n      if (shouldDeleteExactlyOneCodeUnit(text)) {\n        if (isBackward) {\n          focus.set(focus.key, characterOffset, focus.type);\n        } else {\n          anchor.set(anchor.key, characterOffset, anchor.type);\n        }\n      }\n    }\n  }\n}\nfunction shouldDeleteExactlyOneCodeUnit(text) {\n  {\n    if (!(text.length > 1)) {\n      formatDevErrorMessage(`shouldDeleteExactlyOneCodeUnit: expecting to be called only with sequences of two or more code units`);\n    }\n  }\n  return !(doesContainSurrogatePair(text) || doesContainEmoji(text));\n}\n\n/**\n * Given the wall of text in $updateCaretSelectionForUnicodeCharacter, you'd\n * think that the solution might be complex, but the only currently known\n * cases given the above constraints where we want to delete a whole grapheme\n * are when emoji is involved. Since ES6 we can use unicode character classes\n * in regexp which makes this simple.\n *\n * It may make sense to add to this heuristic in the future if other\n * edge cases are discovered, which is why detailed notes remain.\n *\n * This is implemented with runtime feature detection and will always\n * return false on pre-2020 platforms that do not have unicode character\n * class support.\n */\nconst doesContainEmoji = (() => {\n  try {\n    const re = new RegExp('\\\\p{Emoji}', 'u');\n    const test = re.test.bind(re);\n    // Sanity check a few emoji to make sure the regexp was parsed\n    // and works correctly. Any one of these should be sufficient,\n    // but they're cheap and it only runs once.\n    if (\n    // Emoji in the BMP (heart) with variation selector\n    test('\\u2764\\ufe0f') &&\n    // Emoji in the BMP (#) with variation selector\n    test('#\\ufe0f\\u20e3') &&\n    // Emoji outside the BMP (thumbs up) that is encoded with a surrogate pair\n    test('\\ud83d\\udc4d')) {\n      return test;\n    }\n  } catch (_e) {\n    // SyntaxError\n  }\n  // fallback, surrogate pair already checked\n  return () => false;\n})();\nfunction $removeSegment(node, isBackward, offset) {\n  const textNode = node;\n  const textContent = textNode.getTextContent();\n  const split = textContent.split(/(?=\\s)/g);\n  const splitLength = split.length;\n  let segmentOffset = 0;\n  let restoreOffset = 0;\n  for (let i = 0; i < splitLength; i++) {\n    const text = split[i];\n    const isLast = i === splitLength - 1;\n    restoreOffset = segmentOffset;\n    segmentOffset += text.length;\n    if (isBackward && segmentOffset === offset || segmentOffset > offset || isLast) {\n      split.splice(i, 1);\n      if (isLast) {\n        restoreOffset = undefined;\n      }\n      break;\n    }\n  }\n  const nextTextContent = split.join('').trim();\n  if (nextTextContent === '') {\n    textNode.remove();\n  } else {\n    textNode.setTextContent(nextTextContent);\n    textNode.select(restoreOffset, restoreOffset);\n  }\n}\nfunction shouldResolveAncestor(resolvedElement, resolvedOffset, lastPoint) {\n  const parent = resolvedElement.getParent();\n  return lastPoint === null || parent === null || !parent.canBeEmpty() || parent !== lastPoint.getNode();\n}\nfunction $internalResolveSelectionPoint(dom, offset, lastPoint, editor) {\n  let resolvedOffset = offset;\n  let resolvedNode;\n  // If we have selection on an element, we will\n  // need to figure out (using the offset) what text\n  // node should be selected.\n\n  if (isHTMLElement(dom)) {\n    // Resolve element to a ElementNode, or TextNode, or null\n    let moveSelectionToEnd = false;\n    // Given we're moving selection to another node, selection is\n    // definitely dirty.\n    // We use the anchor to find which child node to select\n    const childNodes = dom.childNodes;\n    const childNodesLength = childNodes.length;\n    const blockCursorElement = editor._blockCursorElement;\n    // If the anchor is the same as length, then this means we\n    // need to select the very last text node.\n    if (resolvedOffset === childNodesLength) {\n      moveSelectionToEnd = true;\n      resolvedOffset = childNodesLength - 1;\n    }\n    let childDOM = childNodes[resolvedOffset];\n    let hasBlockCursor = false;\n    if (childDOM === blockCursorElement) {\n      childDOM = childNodes[resolvedOffset + 1];\n      hasBlockCursor = true;\n    } else if (blockCursorElement !== null) {\n      const blockCursorElementParent = blockCursorElement.parentNode;\n      if (dom === blockCursorElementParent) {\n        const blockCursorOffset = Array.prototype.indexOf.call(blockCursorElementParent.children, blockCursorElement);\n        if (offset > blockCursorOffset) {\n          resolvedOffset--;\n        }\n      }\n    }\n    resolvedNode = $getNodeFromDOM(childDOM);\n    if ($isTextNode(resolvedNode)) {\n      resolvedOffset = $getTextNodeOffset(resolvedNode, moveSelectionToEnd ? 'next' : 'previous');\n    } else {\n      let resolvedElement = $getNodeFromDOM(dom);\n      // Ensure resolvedElement is actually a element.\n      if (resolvedElement === null) {\n        return null;\n      }\n      if ($isElementNode(resolvedElement)) {\n        const elementDOM = editor.getElementByKey(resolvedElement.getKey());\n        if (!(elementDOM !== null)) {\n          formatDevErrorMessage(`$internalResolveSelectionPoint: node in DOM but not keyToDOMMap`);\n        }\n        const slot = $getEditorDOMRenderConfig(editor).$getDOMSlot(resolvedElement, elementDOM, editor);\n        [resolvedElement, resolvedOffset] = slot.resolveChildIndex(resolvedElement, elementDOM, dom, offset);\n        // This is just a typescript workaround, it is true but lost due to mutability\n        if (!$isElementNode(resolvedElement)) {\n          formatDevErrorMessage(`$internalResolveSelectionPoint: resolvedElement is not an ElementNode`);\n        }\n        if (moveSelectionToEnd && resolvedOffset >= resolvedElement.getChildrenSize()) {\n          resolvedOffset = Math.max(0, resolvedElement.getChildrenSize() - 1);\n        }\n        let child = resolvedElement.getChildAtIndex(resolvedOffset);\n        if ($isElementNode(child) && shouldResolveAncestor(child, resolvedOffset, lastPoint)) {\n          const descendant = moveSelectionToEnd ? child.getLastDescendant() : child.getFirstDescendant();\n          if (descendant === null) {\n            resolvedElement = child;\n          } else {\n            child = descendant;\n            resolvedElement = $isElementNode(child) ? child : child.getParentOrThrow();\n          }\n          resolvedOffset = 0;\n        }\n        if ($isTextNode(child)) {\n          resolvedNode = child;\n          resolvedElement = null;\n          resolvedOffset = $getTextNodeOffset(child, moveSelectionToEnd ? 'next' : 'previous');\n        } else if (child !== resolvedElement && moveSelectionToEnd && !hasBlockCursor) {\n          if (!$isElementNode(resolvedElement)) {\n            formatDevErrorMessage(`invariant`);\n          }\n          resolvedOffset = Math.min(resolvedElement.getChildrenSize(), resolvedOffset + 1);\n        }\n      } else {\n        const index = resolvedElement.getIndexWithinParent();\n        // When selecting decorators, there can be some selection issues when using resolvedOffset,\n        // and instead we should be checking if we're using the offset\n        if (offset === 0 && $isDecoratorNode(resolvedElement) && $getNodeFromDOM(dom) === resolvedElement) {\n          resolvedOffset = index;\n        } else {\n          resolvedOffset = index + 1;\n        }\n        resolvedElement = resolvedElement.getParentOrThrow();\n      }\n      if ($isElementNode(resolvedElement)) {\n        return $createPoint(resolvedElement.__key, resolvedOffset, 'element');\n      }\n    }\n  } else {\n    // TextNode or null\n    resolvedNode = $getNodeFromDOM(dom);\n  }\n  if (!$isTextNode(resolvedNode)) {\n    return null;\n  }\n  return $createPoint(resolvedNode.__key, $getTextNodeOffset(resolvedNode, resolvedOffset, 'clamp'), 'text');\n}\nfunction resolveSelectionPointOnBoundary(point, isBackward, isCollapsed) {\n  const offset = point.offset;\n  const node = point.getNode();\n  if (offset === 0) {\n    const prevSibling = node.getPreviousSibling();\n    const parent = node.getParent();\n    if (!isBackward) {\n      if ($isElementNode(prevSibling) && !isCollapsed && prevSibling.isInline()) {\n        point.set(prevSibling.__key, prevSibling.getChildrenSize(), 'element');\n      } else if ($isTextNode(prevSibling)) {\n        point.set(prevSibling.__key, prevSibling.getTextContent().length, 'text');\n      }\n    } else if ((isCollapsed || !isBackward) && prevSibling === null && $isElementNode(parent) && parent.isInline()) {\n      const parentSibling = parent.getPreviousSibling();\n      if ($isTextNode(parentSibling)) {\n        point.set(parentSibling.__key, parentSibling.getTextContent().length, 'text');\n      }\n    }\n  } else if (offset === node.getTextContent().length) {\n    const nextSibling = node.getNextSibling();\n    const parent = node.getParent();\n    if (isBackward && $isElementNode(nextSibling) && nextSibling.isInline()) {\n      point.set(nextSibling.__key, 0, 'element');\n    } else if ((isCollapsed || isBackward) && nextSibling === null && $isElementNode(parent) && parent.isInline() && !parent.canInsertTextAfter()) {\n      const parentSibling = parent.getNextSibling();\n      if ($isTextNode(parentSibling)) {\n        point.set(parentSibling.__key, 0, 'text');\n      }\n    }\n  }\n}\nfunction $normalizeSelectionPointsForBoundaries(anchor, focus, lastSelection) {\n  if (anchor.type === 'text' && focus.type === 'text') {\n    const isBackward = anchor.isBefore(focus);\n    const isCollapsed = anchor.is(focus);\n\n    // Attempt to normalize the offset to the previous sibling if we're at the\n    // start of a text node and the sibling is a text node or inline element.\n    resolveSelectionPointOnBoundary(anchor, isBackward, isCollapsed);\n    resolveSelectionPointOnBoundary(focus, !isBackward, isCollapsed);\n    if (isCollapsed) {\n      focus.set(anchor.key, anchor.offset, anchor.type);\n    }\n  }\n}\nfunction $internalResolveSelectionPoints(anchorDOM, anchorOffset, focusDOM, focusOffset, editor, lastSelection) {\n  if (anchorDOM === null || focusDOM === null || !isSelectionWithinEditor(editor, anchorDOM, focusDOM)) {\n    return null;\n  }\n  const resolvedAnchorPoint = $internalResolveSelectionPoint(anchorDOM, anchorOffset, $isRangeSelection(lastSelection) ? lastSelection.anchor : null, editor);\n  if (resolvedAnchorPoint === null) {\n    return null;\n  }\n  const resolvedFocusPoint = $internalResolveSelectionPoint(focusDOM, focusOffset, $isRangeSelection(lastSelection) ? lastSelection.focus : null, editor);\n  if (resolvedFocusPoint === null) {\n    return null;\n  }\n  {\n    $validatePoint('anchor', resolvedAnchorPoint);\n    $validatePoint('focus', resolvedFocusPoint);\n  }\n  if (resolvedAnchorPoint.type === 'element' && resolvedFocusPoint.type === 'element') {\n    const anchorNode = $getNodeFromDOM(anchorDOM);\n    const focusNode = $getNodeFromDOM(focusDOM);\n    // Ensure if we're selecting the content of a decorator that we\n    // return null for this point, as it's not in the controlled scope\n    // of Lexical.\n    if ($isDecoratorNode(anchorNode) && $isDecoratorNode(focusNode)) {\n      return null;\n    }\n  }\n\n  // Handle normalization of selection when it is at the boundaries.\n  $normalizeSelectionPointsForBoundaries(resolvedAnchorPoint, resolvedFocusPoint);\n  return [resolvedAnchorPoint, resolvedFocusPoint];\n}\nfunction $isBlockElementNode(node) {\n  return $isElementNode(node) && !node.isInline();\n}\n\n// This is used to make a selection when the existing\n// selection is null, i.e. forcing selection on the editor\n// when it current exists outside the editor.\n\nfunction $internalMakeRangeSelection(anchorKey, anchorOffset, focusKey, focusOffset, anchorType, focusType) {\n  const editorState = getActiveEditorState();\n  const selection = new RangeSelection($createPoint(anchorKey, anchorOffset, anchorType), $createPoint(focusKey, focusOffset, focusType), 0, '');\n  selection.dirty = true;\n  editorState._selection = selection;\n  return selection;\n}\nfunction $createRangeSelection() {\n  const anchor = $createPoint('root', 0, 'element');\n  const focus = $createPoint('root', 0, 'element');\n  return new RangeSelection(anchor, focus, 0, '');\n}\nfunction $createNodeSelection() {\n  return new NodeSelection(new Set());\n}\nfunction $internalCreateSelection(editor, event) {\n  const currentEditorState = editor.getEditorState();\n  const lastSelection = currentEditorState._selection;\n  const domSelection = getDOMSelection(getWindow(editor));\n  if ($isRangeSelection(lastSelection) || lastSelection == null) {\n    return $internalCreateRangeSelection(lastSelection, domSelection, editor, event);\n  }\n  return lastSelection.clone();\n}\nfunction $createRangeSelectionFromDom(domSelection, editor) {\n  return $internalCreateRangeSelection(null, domSelection, editor, null);\n}\nfunction $internalCreateRangeSelection(lastSelection, domSelection, editor, event) {\n  const windowObj = editor._window;\n  if (windowObj === null) {\n    return null;\n  }\n  // When we create a selection, we try to use the previous\n  // selection where possible, unless an actual user selection\n  // change has occurred. When we do need to create a new selection\n  // we validate we can have text nodes for both anchor and focus\n  // nodes. If that holds true, we then return that selection\n  // as a mutable object that we use for the editor state for this\n  // update cycle. If a selection gets changed, and requires a\n  // update to native DOM selection, it gets marked as \"dirty\".\n  // If the selection changes, but matches with the existing\n  // DOM selection, then we only need to sync it. Otherwise,\n  // we generally bail out of doing an update to selection during\n  // reconciliation unless there are dirty nodes that need\n  // reconciling.\n\n  const windowEvent = event || windowObj.event;\n  const eventType = windowEvent ? windowEvent.type : undefined;\n  const isSelectionChange = eventType === 'selectionchange';\n  const useDOMSelection = !getIsProcessingMutations() && (isSelectionChange || eventType === 'beforeinput' || eventType === 'compositionstart' || eventType === 'compositionend' || eventType === 'click' && windowEvent && windowEvent.detail === 3 || eventType === 'drop' || eventType === undefined);\n  let anchorDOM, focusDOM, anchorOffset, focusOffset;\n  if (!$isRangeSelection(lastSelection) || useDOMSelection) {\n    if (domSelection === null) {\n      return null;\n    }\n    anchorDOM = domSelection.anchorNode;\n    focusDOM = domSelection.focusNode;\n    anchorOffset = domSelection.anchorOffset;\n    focusOffset = domSelection.focusOffset;\n    if ((isSelectionChange || eventType === undefined) && $isRangeSelection(lastSelection) && !isSelectionWithinEditor(editor, anchorDOM, focusDOM)) {\n      return lastSelection.clone();\n    }\n  } else {\n    return lastSelection.clone();\n  }\n  // Let's resolve the text nodes from the offsets and DOM nodes we have from\n  // native selection.\n  const resolvedSelectionPoints = $internalResolveSelectionPoints(anchorDOM, anchorOffset, focusDOM, focusOffset, editor, lastSelection);\n  if (resolvedSelectionPoints === null) {\n    return null;\n  }\n  const [resolvedAnchorPoint, resolvedFocusPoint] = resolvedSelectionPoints;\n  let format = 0;\n  let style = '';\n  if ($isRangeSelection(lastSelection)) {\n    const lastAnchor = lastSelection.anchor;\n    if (resolvedAnchorPoint.key === lastAnchor.key) {\n      format = lastSelection.format;\n      style = lastSelection.style;\n    } else {\n      const anchorNode = resolvedAnchorPoint.getNode();\n      if ($isTextNode(anchorNode)) {\n        format = anchorNode.getFormat();\n        style = anchorNode.getStyle();\n      } else if ($isElementNode(anchorNode)) {\n        format = anchorNode.getTextFormat();\n        style = anchorNode.getTextStyle();\n      }\n    }\n  }\n  return new RangeSelection(resolvedAnchorPoint, resolvedFocusPoint, format, style);\n}\nfunction $validatePoint(name, point) {\n  const node = $getNodeByKey(point.key);\n  if (!(node !== undefined)) {\n    formatDevErrorMessage(`$validatePoint: ${name} key ${point.key} not found in current editorState`);\n  }\n  if (point.type === 'text') {\n    if (!$isTextNode(node)) {\n      formatDevErrorMessage(`$validatePoint: ${name} key ${point.key} is not a TextNode`);\n    }\n    const size = node.getTextContentSize();\n    if (!(point.offset <= size)) {\n      formatDevErrorMessage(`$validatePoint: ${name} point.offset > node.getTextContentSize() (${String(point.offset)} > ${String(size)})`);\n    }\n  } else {\n    if (!$isElementNode(node)) {\n      formatDevErrorMessage(`$validatePoint: ${name} key ${point.key} is not an ElementNode`);\n    }\n    const size = node.getChildrenSize();\n    if (!(point.offset <= size)) {\n      formatDevErrorMessage(`$validatePoint: ${name} point.offset > node.getChildrenSize() (${String(point.offset)} > ${String(size)})`);\n    }\n  }\n}\nfunction $getSelection() {\n  const editorState = getActiveEditorState();\n  return editorState._selection;\n}\nfunction $getPreviousSelection() {\n  const editor = getActiveEditor();\n  return editor._editorState._selection;\n}\nfunction $updateElementSelectionOnCreateDeleteNode(selection, parentNode, nodeOffset, times = 1) {\n  const anchor = selection.anchor;\n  const focus = selection.focus;\n  const anchorNode = anchor.getNode();\n  const focusNode = focus.getNode();\n  if (!parentNode.is(anchorNode) && !parentNode.is(focusNode)) {\n    return;\n  }\n  const parentKey = parentNode.__key;\n  // Single node. We shift selection but never redimension it\n  if (selection.isCollapsed()) {\n    const selectionOffset = anchor.offset;\n    if (nodeOffset <= selectionOffset && times > 0 || nodeOffset < selectionOffset && times < 0) {\n      const newSelectionOffset = Math.max(0, selectionOffset + times);\n      anchor.set(parentKey, newSelectionOffset, 'element');\n      focus.set(parentKey, newSelectionOffset, 'element');\n      // The new selection might point to text nodes, try to resolve them\n      $updateSelectionResolveTextNodes(selection);\n    }\n  } else {\n    // Multiple nodes selected. We shift or redimension selection\n    const isBackward = selection.isBackward();\n    const firstPoint = isBackward ? focus : anchor;\n    const firstPointNode = firstPoint.getNode();\n    const lastPoint = isBackward ? anchor : focus;\n    const lastPointNode = lastPoint.getNode();\n    if (parentNode.is(firstPointNode)) {\n      const firstPointOffset = firstPoint.offset;\n      if (nodeOffset <= firstPointOffset && times > 0 || nodeOffset < firstPointOffset && times < 0) {\n        firstPoint.set(parentKey, Math.max(0, firstPointOffset + times), 'element');\n      }\n    }\n    if (parentNode.is(lastPointNode)) {\n      const lastPointOffset = lastPoint.offset;\n      if (nodeOffset <= lastPointOffset && times > 0 || nodeOffset < lastPointOffset && times < 0) {\n        lastPoint.set(parentKey, Math.max(0, lastPointOffset + times), 'element');\n      }\n    }\n  }\n  // The new selection might point to text nodes, try to resolve them\n  $updateSelectionResolveTextNodes(selection);\n}\nfunction $updateSelectionResolveTextNodes(selection) {\n  const anchor = selection.anchor;\n  const anchorOffset = anchor.offset;\n  const focus = selection.focus;\n  const focusOffset = focus.offset;\n  const anchorNode = anchor.getNode();\n  const focusNode = focus.getNode();\n  if (selection.isCollapsed()) {\n    if (!$isElementNode(anchorNode)) {\n      return;\n    }\n    const childSize = anchorNode.getChildrenSize();\n    const anchorOffsetAtEnd = anchorOffset >= childSize;\n    const child = anchorOffsetAtEnd ? anchorNode.getChildAtIndex(childSize - 1) : anchorNode.getChildAtIndex(anchorOffset);\n    if ($isTextNode(child)) {\n      let newOffset = 0;\n      if (anchorOffsetAtEnd) {\n        newOffset = child.getTextContentSize();\n      }\n      anchor.set(child.__key, newOffset, 'text');\n      focus.set(child.__key, newOffset, 'text');\n    }\n    return;\n  }\n  if ($isElementNode(anchorNode)) {\n    const childSize = anchorNode.getChildrenSize();\n    const anchorOffsetAtEnd = anchorOffset >= childSize;\n    const child = anchorOffsetAtEnd ? anchorNode.getChildAtIndex(childSize - 1) : anchorNode.getChildAtIndex(anchorOffset);\n    if ($isTextNode(child)) {\n      let newOffset = 0;\n      if (anchorOffsetAtEnd) {\n        newOffset = child.getTextContentSize();\n      }\n      anchor.set(child.__key, newOffset, 'text');\n    }\n  }\n  if ($isElementNode(focusNode)) {\n    const childSize = focusNode.getChildrenSize();\n    const focusOffsetAtEnd = focusOffset >= childSize;\n    const child = focusOffsetAtEnd ? focusNode.getChildAtIndex(childSize - 1) : focusNode.getChildAtIndex(focusOffset);\n    if ($isTextNode(child)) {\n      let newOffset = 0;\n      if (focusOffsetAtEnd) {\n        newOffset = child.getTextContentSize();\n      }\n      focus.set(child.__key, newOffset, 'text');\n    }\n  }\n}\nfunction applySelectionTransforms(nextEditorState, editor) {\n  const prevEditorState = editor.getEditorState();\n  const prevSelection = prevEditorState._selection;\n  const nextSelection = nextEditorState._selection;\n  if ($isRangeSelection(nextSelection)) {\n    const anchor = nextSelection.anchor;\n    const focus = nextSelection.focus;\n    let anchorNode;\n    if (anchor.type === 'text') {\n      anchorNode = anchor.getNode();\n      anchorNode.selectionTransform(prevSelection, nextSelection);\n    }\n    if (focus.type === 'text') {\n      const focusNode = focus.getNode();\n      if (anchorNode !== focusNode) {\n        focusNode.selectionTransform(prevSelection, nextSelection);\n      }\n    }\n  }\n}\nfunction moveSelectionPointToSibling(point, node, parent, prevSibling, nextSibling) {\n  let siblingKey = null;\n  let offset = 0;\n  let type = null;\n  if (prevSibling !== null) {\n    siblingKey = prevSibling.__key;\n    if ($isTextNode(prevSibling)) {\n      offset = prevSibling.getTextContentSize();\n      type = 'text';\n    } else if ($isElementNode(prevSibling)) {\n      offset = prevSibling.getChildrenSize();\n      type = 'element';\n    }\n  } else {\n    if (nextSibling !== null) {\n      siblingKey = nextSibling.__key;\n      if ($isTextNode(nextSibling)) {\n        type = 'text';\n      } else if ($isElementNode(nextSibling)) {\n        type = 'element';\n      }\n    }\n  }\n  if (siblingKey !== null && type !== null) {\n    point.set(siblingKey, offset, type);\n  } else {\n    offset = node.getIndexWithinParent();\n    if (offset === -1) {\n      // Move selection to end of parent\n      offset = parent.getChildrenSize();\n    }\n    point.set(parent.__key, offset, 'element');\n  }\n}\nfunction adjustPointOffsetForMergedSibling(point, isBefore, key, target, textLength) {\n  if (point.type === 'text') {\n    point.set(key, point.offset + (isBefore ? 0 : textLength), 'text');\n  } else if (point.offset > target.getIndexWithinParent()) {\n    point.set(point.key, point.offset - 1, 'element');\n  }\n}\nfunction setDOMSelectionBaseAndExtent(domSelection, nextAnchorDOM, nextAnchorOffset, nextFocusDOM, nextFocusOffset) {\n  // Apply the updated selection to the DOM. Note: this will trigger\n  // a \"selectionchange\" event, although it will be asynchronous.\n  try {\n    domSelection.setBaseAndExtent(nextAnchorDOM, nextAnchorOffset, nextFocusDOM, nextFocusOffset);\n  } catch (error) {\n    // If we encounter an error, continue. This can sometimes\n    // occur with FF and there's no good reason as to why it\n    // should happen.\n    {\n      console.warn(error);\n    }\n  }\n}\nfunction $getElementAndOffsetForPoint(editor, node, offset) {\n  const element = getElementByKeyOrThrow(editor, node.getKey());\n  if ($isElementNode(node)) {\n    const slot = $getEditorDOMRenderConfig(editor).$getDOMSlot(node, element, editor);\n    return [slot.element, offset + slot.getFirstChildOffset()];\n  }\n  return [element, offset];\n}\nfunction $updateDOMSelection(prevSelection, nextSelection, editor, domSelection, tags, rootElement, nodeCount) {\n  const anchorDOMNode = domSelection.anchorNode;\n  const focusDOMNode = domSelection.focusNode;\n  const anchorOffset = domSelection.anchorOffset;\n  const focusOffset = domSelection.focusOffset;\n  const activeElement = document.activeElement;\n\n  // TODO: make this not hard-coded, and add another config option\n  // that makes this configurable.\n  if (tags.has(COLLABORATION_TAG) && activeElement !== rootElement || activeElement !== null && isSelectionCapturedInDecoratorInput(activeElement)) {\n    return;\n  }\n  if (!$isRangeSelection(nextSelection)) {\n    // We don't remove selection if the prevSelection is null because\n    // of editor.setRootElement(). If this occurs on init when the\n    // editor is already focused, then this can cause the editor to\n    // lose focus.\n    if (prevSelection !== null && isSelectionWithinEditor(editor, anchorDOMNode, focusDOMNode)) {\n      domSelection.removeAllRanges();\n    }\n    return;\n  }\n  const anchor = nextSelection.anchor;\n  const focus = nextSelection.focus;\n  const anchorNode = anchor.getNode();\n  const focusNode = focus.getNode();\n  const [anchorDOM, nextAnchorOffset] = $getElementAndOffsetForPoint(editor, anchorNode, anchor.offset);\n  const [focusDOM, nextFocusOffset] = $getElementAndOffsetForPoint(editor, focusNode, focus.offset);\n  const nextFormat = nextSelection.format;\n  const nextStyle = nextSelection.style;\n  const isCollapsed = nextSelection.isCollapsed();\n  let nextAnchorNode = anchorDOM;\n  let nextFocusNode = focusDOM;\n  let anchorFormatOrStyleChanged = false;\n  if (anchor.type === 'text') {\n    nextAnchorNode = getDOMTextNode(anchorDOM);\n    anchorFormatOrStyleChanged = anchorNode.getFormat() !== nextFormat || anchorNode.getStyle() !== nextStyle;\n  } else if ($isRangeSelection(prevSelection) && prevSelection.anchor.type === 'text') {\n    anchorFormatOrStyleChanged = true;\n  }\n  if (focus.type === 'text') {\n    nextFocusNode = getDOMTextNode(focusDOM);\n  }\n\n  // If we can't get an underlying text node for selection, then\n  // we should avoid setting selection to something incorrect.\n  if (nextAnchorNode === null || nextFocusNode === null) {\n    return;\n  }\n  if (isCollapsed && (prevSelection === null || anchorFormatOrStyleChanged || $isRangeSelection(prevSelection) && (prevSelection.format !== nextFormat || prevSelection.style !== nextStyle))) {\n    markCollapsedSelectionFormat(nextFormat, nextStyle, nextAnchorOffset, anchor.key, performance.now());\n  }\n\n  // Diff against the native DOM selection to ensure we don't do\n  // an unnecessary selection update. We also skip this check if\n  // we're moving selection to within an element, as this can\n  // sometimes be problematic around scrolling.\n  if (anchorOffset === nextAnchorOffset && focusOffset === nextFocusOffset && anchorDOMNode === nextAnchorNode && focusDOMNode === nextFocusNode &&\n  // Badly interpreted range selection when collapsed - #1482\n  !(domSelection.type === 'Range' && isCollapsed)) {\n    // If the root element does not have focus, ensure it has focus\n    if (activeElement === null || !rootElement.contains(activeElement)) {\n      if (!tags.has(SKIP_SELECTION_FOCUS_TAG)) {\n        rootElement.focus({\n          preventScroll: true\n        });\n      }\n    }\n    if (anchor.type !== 'element') {\n      return;\n    }\n  }\n\n  // Apply the updated selection to the DOM. Note: this will trigger\n  // a \"selectionchange\" event, although it will be asynchronous.\n  setDOMSelectionBaseAndExtent(domSelection, nextAnchorNode, nextAnchorOffset, nextFocusNode, nextFocusOffset);\n\n  // Firefox-specific fix: After setting DOM selection, ensure root element has focus\n  // to maintain cursor visibility. Firefox requires focus to be on the root element\n  // for the cursor to be visible, especially after operations like drag that may\n  // cause focus loss. This is critical for collapsed selections (cursor).\n  if (IS_FIREFOX && nextSelection.isCollapsed() && rootElement !== null && !tags.has(SKIP_SELECTION_FOCUS_TAG) && (document.activeElement === null || !rootElement.contains(document.activeElement))) {\n    // Restore focus immediately to ensure cursor visibility\n    rootElement.focus({\n      preventScroll: true\n    });\n    // Note: We rely on the normal selection update mechanism to ensure the cursor\n    // is visible. Using requestAnimationFrame here could cause race conditions where\n    // another update changes the selection before the rAF callback executes.\n  }\n  if (!tags.has(SKIP_SCROLL_INTO_VIEW_TAG) && nextSelection.isCollapsed() && rootElement !== null && rootElement === document.activeElement) {\n    const selectionTarget = $isRangeSelection(nextSelection) && nextSelection.anchor.type === 'element' ? nextAnchorNode.childNodes[nextAnchorOffset] || null : domSelection.rangeCount > 0 ? domSelection.getRangeAt(0) : null;\n    if (selectionTarget !== null) {\n      let selectionRect;\n      if (selectionTarget instanceof Text) {\n        const range = document.createRange();\n        range.selectNode(selectionTarget);\n        selectionRect = range.getBoundingClientRect();\n      } else {\n        selectionRect = selectionTarget.getBoundingClientRect();\n      }\n      scrollIntoViewIfNeeded(editor, selectionRect, rootElement);\n    }\n  }\n  markSelectionChangeFromDOMUpdate();\n}\nfunction $insertNodes(nodes) {\n  let selection = $getSelection() || $getPreviousSelection();\n  if (selection === null) {\n    selection = $getRoot().selectEnd();\n  }\n  selection.insertNodes(nodes);\n}\nfunction $getTextContent() {\n  const selection = $getSelection();\n  if (selection === null) {\n    return '';\n  }\n  return selection.getTextContent();\n}\nfunction $removeTextAndSplitBlock(selection) {\n  let selection_ = selection;\n  if (!selection.isCollapsed()) {\n    selection_.removeText();\n  }\n  // A new selection can originate as a result of node replacement, in which case is registered via\n  // $setSelection\n  const newSelection = $getSelection();\n  if ($isRangeSelection(newSelection)) {\n    selection_ = newSelection;\n  }\n  if (!$isRangeSelection(selection_)) {\n    formatDevErrorMessage(`Unexpected dirty selection to be null`);\n  }\n  const anchor = selection_.anchor;\n  let node = anchor.getNode();\n  let offset = anchor.offset;\n  while (!INTERNAL_$isBlock(node)) {\n    const prevNode = node;\n    [node, offset] = $splitNodeAtPoint(node, offset);\n    if (prevNode.is(node)) {\n      break;\n    }\n  }\n  return offset;\n}\nfunction $splitNodeAtPoint(node, offset) {\n  const parent = node.getParent();\n  if (!parent) {\n    const paragraph = $createParagraphNode();\n    $getRoot().append(paragraph);\n    paragraph.select();\n    return [$getRoot(), 0];\n  }\n  if ($isTextNode(node)) {\n    const split = node.splitText(offset);\n    if (split.length === 0) {\n      return [parent, node.getIndexWithinParent()];\n    }\n    const x = offset === 0 ? 0 : 1;\n    const index = split[0].getIndexWithinParent() + x;\n    return [parent, index];\n  }\n  if (!$isElementNode(node) || offset === 0) {\n    return [parent, node.getIndexWithinParent()];\n  }\n  const firstToAppend = node.getChildAtIndex(offset);\n  if (firstToAppend) {\n    const insertPoint = new RangeSelection($createPoint(node.__key, offset, 'element'), $createPoint(node.__key, offset, 'element'), 0, '');\n    const newElement = node.insertNewAfter(insertPoint);\n    if (newElement) {\n      newElement.append(firstToAppend, ...firstToAppend.getNextSiblings());\n    }\n  }\n  return [parent, node.getIndexWithinParent() + 1];\n}\nfunction $wrapInlineNodes(nodes) {\n  // We temporarily insert the topLevelNodes into an arbitrary ElementNode,\n  // since insertAfter does not work on nodes that have no parent (TO-DO: fix that).\n  const virtualRoot = $createParagraphNode();\n  let currentBlock = null;\n  for (let i = 0; i < nodes.length; i++) {\n    const node = nodes[i];\n    const isLineBreakNode = $isLineBreakNode(node);\n    if (isLineBreakNode || $isDecoratorNode(node) && node.isInline() || $isElementNode(node) && node.isInline() || $isTextNode(node) || node.isParentRequired()) {\n      if (currentBlock === null) {\n        currentBlock = node.createParentElementNode();\n        virtualRoot.append(currentBlock);\n        // In the case of LineBreakNode, we just need to\n        // add an empty ParagraphNode to the topLevelBlocks.\n        if (isLineBreakNode) {\n          continue;\n        }\n      }\n      if (currentBlock !== null) {\n        currentBlock.append(node);\n      }\n    } else {\n      virtualRoot.append(node);\n      currentBlock = null;\n    }\n  }\n  return virtualRoot;\n}\n\n/**\n * Get all nodes in a CaretRange in a way that complies with all of the\n * quirks of the original RangeSelection.getNodes().\n *\n * @param range The CaretRange\n */\nfunction $getNodesFromCaretRangeCompat(\n// getNodes returned nodes in document order\nrange) {\n  const nodes = [];\n  const [beforeSlice, afterSlice] = range.getTextSlices();\n  if (beforeSlice) {\n    nodes.push(beforeSlice.caret.origin);\n  }\n  const seenAncestors = new Set();\n  const seenElements = new Set();\n  for (const caret of range) {\n    if ($isChildCaret(caret)) {\n      // Emulate the leading under-selection behavior of getNodes by\n      // ignoring the 'enter' of any ElementNode until we've seen a\n      // SiblingCaret\n      const {\n        origin\n      } = caret;\n      if (nodes.length === 0) {\n        seenAncestors.add(origin);\n      } else {\n        seenElements.add(origin);\n        nodes.push(origin);\n      }\n    } else {\n      const {\n        origin\n      } = caret;\n      if (!$isElementNode(origin) || !seenElements.has(origin)) {\n        nodes.push(origin);\n      }\n    }\n  }\n  if (afterSlice) {\n    nodes.push(afterSlice.caret.origin);\n  }\n  // Emulate the trailing underselection behavior when the last offset of\n  // an element is selected\n  if ($isSiblingCaret(range.focus) && $isElementNode(range.focus.origin) && range.focus.getNodeAtCaret() === null) {\n    for (let reverseCaret = $getChildCaret(range.focus.origin, 'previous'); $isChildCaret(reverseCaret) && seenAncestors.has(reverseCaret.origin) && !reverseCaret.origin.isEmpty() && reverseCaret.origin.is(nodes[nodes.length - 1]); reverseCaret = $getAdjacentChildCaret(reverseCaret)) {\n      seenAncestors.delete(reverseCaret.origin);\n      nodes.pop();\n    }\n  }\n  while (nodes.length > 1) {\n    const lastIncludedNode = nodes[nodes.length - 1];\n    if ($isElementNode(lastIncludedNode)) {\n      if (seenElements.has(lastIncludedNode) || lastIncludedNode.isEmpty() || seenAncestors.has(lastIncludedNode)) ; else {\n        nodes.pop();\n        continue;\n      }\n    }\n    break;\n  }\n  if (nodes.length === 0 && range.isCollapsed()) {\n    // Emulate the collapsed behavior of getNodes by returning the descendant\n    const normCaret = $normalizeCaret(range.anchor);\n    const flippedNormCaret = $normalizeCaret(range.anchor.getFlipped());\n    const $getCandidate = caret => $isTextPointCaret(caret) ? caret.origin : caret.getNodeAtCaret();\n    const node = $getCandidate(normCaret) || $getCandidate(flippedNormCaret) || (range.anchor.getNodeAtCaret() ? normCaret.origin : flippedNormCaret.origin);\n    nodes.push(node);\n  }\n  return nodes;\n}\n\n/**\n * @internal\n *\n * Modify the focus of the focus around possible decorators and blocks and return true\n * if the movement is done.\n */\nfunction $modifySelectionAroundDecoratorsAndBlocks(selection, alter, isBackward, granularity, mode = 'decorators-and-blocks') {\n  if (alter === 'move' && granularity === 'character' && !selection.isCollapsed()) {\n    // moving left or right when the selection isn't collapsed will\n    // just set the anchor to the focus or vice versa depending on\n    // direction\n    const [src, dst] = isBackward === selection.isBackward() ? [selection.focus, selection.anchor] : [selection.anchor, selection.focus];\n    dst.set(src.key, src.offset, src.type);\n    return true;\n  }\n  const initialFocus = $caretFromPoint(selection.focus, isBackward ? 'previous' : 'next');\n  const isLineBoundary = granularity === 'lineboundary';\n  const collapse = alter === 'move';\n  let focus = initialFocus;\n  let checkForBlock = mode === 'decorators-and-blocks';\n  if (!$isExtendableTextPointCaret(focus)) {\n    for (const siblingCaret of focus) {\n      checkForBlock = false;\n      const {\n        origin\n      } = siblingCaret;\n      if ($isDecoratorNode(origin) && !origin.isIsolated()) {\n        focus = siblingCaret;\n        if (isLineBoundary && origin.isInline()) {\n          continue;\n        }\n      }\n      break;\n    }\n    if (checkForBlock) {\n      for (const nextCaret of $extendCaretToRange(initialFocus).iterNodeCarets(alter === 'extend' ? 'shadowRoot' : 'root')) {\n        if ($isChildCaret(nextCaret)) {\n          if (!nextCaret.origin.isInline()) {\n            focus = nextCaret;\n          }\n        } else if ($isElementNode(nextCaret.origin)) {\n          continue;\n        } else if ($isDecoratorNode(nextCaret.origin) && !nextCaret.origin.isInline()) {\n          focus = nextCaret;\n        }\n        break;\n      }\n    }\n  }\n  if (focus === initialFocus) {\n    return false;\n  }\n  // After this point checkForBlock is true if and only if we moved to a\n  // different block, so we should stop regardless of the granularity\n  if (collapse && !isLineBoundary && $isDecoratorNode(focus.origin) && focus.origin.isKeyboardSelectable()) {\n    // Make it possible to move selection from range selection to\n    // node selection on the node.\n    const nodeSelection = $createNodeSelection();\n    nodeSelection.add(focus.origin.getKey());\n    $setSelection(nodeSelection);\n    return true;\n  }\n  focus = $normalizeCaret(focus);\n  if (collapse) {\n    $setPointFromCaret(selection.anchor, focus);\n  }\n  $setPointFromCaret(selection.focus, focus);\n  return checkForBlock || !isLineBoundary;\n}\n\nlet activeEditorState = null;\nlet activeEditor = null;\nlet isReadOnlyMode = false;\nlet isAttemptingToRecoverFromReconcilerError = false;\nlet infiniteTransformCount = 0;\nconst observerOptions = {\n  characterData: true,\n  childList: true,\n  subtree: true\n};\nfunction isCurrentlyReadOnlyMode() {\n  return isReadOnlyMode || activeEditorState !== null && activeEditorState._readOnly;\n}\nfunction errorOnReadOnly() {\n  if (isReadOnlyMode) {\n    {\n      formatDevErrorMessage(`Cannot use method in read-only mode.`);\n    }\n  }\n}\nfunction errorOnInfiniteTransforms() {\n  if (infiniteTransformCount > 99) {\n    {\n      formatDevErrorMessage(`One or more transforms are endlessly triggering additional transforms. May have encountered infinite recursion caused by transforms that have their preconditions too lose and/or conflict with each other.`);\n    }\n  }\n}\nfunction getActiveEditorState() {\n  if (activeEditorState === null) {\n    {\n      formatDevErrorMessage(`Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update(), editor.read(), or editorState.read().${collectBuildInformation()}`);\n    }\n  }\n  return activeEditorState;\n}\nfunction getActiveEditor() {\n  if (activeEditor === null) {\n    {\n      formatDevErrorMessage(`Unable to find an active editor. This method can only be used synchronously during the callback of editor.update(), editor.read(), or editor.getEditorState().read(..., {editor}).${collectBuildInformation()}`);\n    }\n  }\n  return activeEditor;\n}\nfunction collectBuildInformation() {\n  let compatibleEditors = 0;\n  const incompatibleEditors = new Set();\n  const thisVersion = LexicalEditor.version;\n  if (typeof window !== 'undefined') {\n    for (const node of document.querySelectorAll('[contenteditable]')) {\n      const editor = getEditorPropertyFromDOMNode(node);\n      if (isLexicalEditor(editor)) {\n        compatibleEditors++;\n      } else if (editor) {\n        let version = String(editor.constructor.version || '<0.17.1');\n        if (version === thisVersion) {\n          version += ' (separately built, likely a bundler configuration issue)';\n        }\n        incompatibleEditors.add(version);\n      }\n    }\n  }\n  let output = ` Detected on the page: ${compatibleEditors} compatible editor(s) with version ${thisVersion}`;\n  if (incompatibleEditors.size) {\n    output += ` and incompatible editors with versions ${Array.from(incompatibleEditors).join(', ')}`;\n  }\n  return output;\n}\nfunction internalGetActiveEditor() {\n  return activeEditor;\n}\nfunction internalGetActiveEditorState() {\n  return activeEditorState;\n}\nfunction $applyTransforms(editor, node, transformsCache) {\n  const type = node.__type;\n  const registeredNode = getRegisteredNodeOrThrow(editor, type);\n  let transformsArr = transformsCache.get(type);\n  if (transformsArr === undefined) {\n    transformsArr = Array.from(registeredNode.transforms);\n    transformsCache.set(type, transformsArr);\n  }\n  const transformsArrLength = transformsArr.length;\n  for (let i = 0; i < transformsArrLength; i++) {\n    transformsArr[i](node);\n    if (!node.isAttached()) {\n      break;\n    }\n  }\n}\nfunction $isNodeValidForTransform(node, compositionKey) {\n  return node !== undefined &&\n  // We don't want to transform nodes being composed\n  node.__key !== compositionKey && node.isAttached();\n}\nfunction $normalizeAllDirtyTextNodes(editorState, editor) {\n  const dirtyLeaves = editor._dirtyLeaves;\n  const nodeMap = editorState._nodeMap;\n  for (const nodeKey of dirtyLeaves) {\n    const node = nodeMap.get(nodeKey);\n    if ($isTextNode(node) && node.isAttached() && node.isSimpleText() && !node.isUnmergeable()) {\n      $normalizeTextNode(node);\n    }\n  }\n}\nfunction addTags(editor, tags) {\n  if (!tags) {\n    return;\n  }\n  const updateTags = editor._updateTags;\n  let tags_ = tags;\n  if (!Array.isArray(tags)) {\n    tags_ = [tags];\n  }\n  for (const tag of tags_) {\n    updateTags.add(tag);\n  }\n}\n\n/**\n * Transform heuristic:\n * 1. We transform leaves first. If transforms generate additional dirty nodes we repeat step 1.\n * The reasoning behind this is that marking a leaf as dirty marks all its parent elements as dirty too.\n * 2. We transform elements. If element transforms generate additional dirty nodes we repeat step 1.\n * If element transforms only generate additional dirty elements we only repeat step 2.\n *\n * Note that to keep track of newly dirty nodes and subtrees we leverage the editor._dirtyNodes and\n * editor._subtrees which we reset in every loop.\n */\nfunction $applyAllTransforms(editorState, editor) {\n  const dirtyLeaves = editor._dirtyLeaves;\n  const dirtyElements = editor._dirtyElements;\n  const nodeMap = editorState._nodeMap;\n  const compositionKey = $getCompositionKey();\n  const transformsCache = new Map();\n  let untransformedDirtyLeaves = dirtyLeaves;\n  let untransformedDirtyLeavesLength = untransformedDirtyLeaves.size;\n  let untransformedDirtyElements = dirtyElements;\n  let untransformedDirtyElementsLength = untransformedDirtyElements.size;\n  while (untransformedDirtyLeavesLength > 0 || untransformedDirtyElementsLength > 0) {\n    if (untransformedDirtyLeavesLength > 0) {\n      // We leverage editor._dirtyLeaves to track the new dirty leaves after the transforms\n      editor._dirtyLeaves = new Set();\n      for (const nodeKey of untransformedDirtyLeaves) {\n        const node = nodeMap.get(nodeKey);\n        if ($isTextNode(node) && node.isAttached() && node.isSimpleText() && !node.isUnmergeable()) {\n          $normalizeTextNode(node);\n        }\n        if (node !== undefined && $isNodeValidForTransform(node, compositionKey)) {\n          $applyTransforms(editor, node, transformsCache);\n        }\n        dirtyLeaves.add(nodeKey);\n      }\n      untransformedDirtyLeaves = editor._dirtyLeaves;\n      untransformedDirtyLeavesLength = untransformedDirtyLeaves.size;\n\n      // We want to prioritize node transforms over element transforms\n      if (untransformedDirtyLeavesLength > 0) {\n        infiniteTransformCount++;\n        continue;\n      }\n    }\n\n    // All dirty leaves have been processed. Let's do elements!\n    // We have previously processed dirty leaves, so let's restart the editor leaves Set to track\n    // new ones caused by element transforms\n    editor._dirtyLeaves = new Set();\n    editor._dirtyElements = new Map();\n\n    // The root is always considered intentionally dirty if any attached node\n    // is dirty and by deleting and re-inserting we will apply its transforms\n    // last (e.g. its transform can be used as a sort of \"update finalizer\")\n    const rootDirty = untransformedDirtyElements.delete('root');\n    if (rootDirty) {\n      untransformedDirtyElements.set('root', true);\n    }\n    for (const currentUntransformedDirtyElement of untransformedDirtyElements) {\n      const nodeKey = currentUntransformedDirtyElement[0];\n      const intentionallyMarkedAsDirty = currentUntransformedDirtyElement[1];\n      dirtyElements.set(nodeKey, intentionallyMarkedAsDirty);\n      if (!intentionallyMarkedAsDirty) {\n        continue;\n      }\n      const node = nodeMap.get(nodeKey);\n      if (node !== undefined && $isNodeValidForTransform(node, compositionKey)) {\n        $applyTransforms(editor, node, transformsCache);\n      }\n    }\n    untransformedDirtyLeaves = editor._dirtyLeaves;\n    untransformedDirtyLeavesLength = untransformedDirtyLeaves.size;\n    untransformedDirtyElements = editor._dirtyElements;\n    untransformedDirtyElementsLength = untransformedDirtyElements.size;\n    infiniteTransformCount++;\n  }\n  editor._dirtyLeaves = dirtyLeaves;\n  editor._dirtyElements = dirtyElements;\n}\nfunction $parseSerializedNode(serializedNode) {\n  const internalSerializedNode = serializedNode;\n  return $parseSerializedNodeImpl(internalSerializedNode, getActiveEditor()._nodes);\n}\nfunction $parseSerializedNodeImpl(serializedNode, registeredNodes) {\n  const type = serializedNode.type;\n  const registeredNode = registeredNodes.get(type);\n  if (registeredNode === undefined) {\n    {\n      formatDevErrorMessage(`parseEditorState: type \"${type}\" + not found`);\n    }\n  }\n  const nodeClass = registeredNode.klass;\n  if (serializedNode.type !== nodeClass.getType()) {\n    {\n      formatDevErrorMessage(`LexicalNode: Node ${nodeClass.name} does not implement .importJSON().`);\n    }\n  }\n  const node = nodeClass.importJSON(serializedNode);\n  const children = serializedNode.children;\n  if ($isElementNode(node) && Array.isArray(children)) {\n    for (let i = 0; i < children.length; i++) {\n      const serializedJSONChildNode = children[i];\n      const childNode = $parseSerializedNodeImpl(serializedJSONChildNode, registeredNodes);\n      node.append(childNode);\n    }\n  }\n  return node;\n}\nfunction parseEditorState(serializedEditorState, editor, updateFn) {\n  const editorState = createEmptyEditorState();\n  const previousActiveEditorState = activeEditorState;\n  const previousReadOnlyMode = isReadOnlyMode;\n  const previousActiveEditor = activeEditor;\n  const previousDirtyElements = editor._dirtyElements;\n  const previousDirtyLeaves = editor._dirtyLeaves;\n  const previousCloneNotNeeded = editor._cloneNotNeeded;\n  const previousDirtyType = editor._dirtyType;\n  editor._dirtyElements = new Map();\n  editor._dirtyLeaves = new Set();\n  editor._cloneNotNeeded = new Set();\n  editor._dirtyType = 0;\n  activeEditorState = editorState;\n  isReadOnlyMode = false;\n  activeEditor = editor;\n  setPendingNodeToClone(null);\n  try {\n    const registeredNodes = editor._nodes;\n    const serializedNode = serializedEditorState.root;\n    $parseSerializedNodeImpl(serializedNode, registeredNodes);\n    if (updateFn) {\n      updateFn();\n    }\n\n    // Make the editorState immutable\n    editorState._readOnly = true;\n    {\n      handleDEVOnlyPendingUpdateGuarantees(editorState);\n    }\n  } catch (error) {\n    if (error instanceof Error) {\n      editor._onError(error);\n    }\n  } finally {\n    editor._dirtyElements = previousDirtyElements;\n    editor._dirtyLeaves = previousDirtyLeaves;\n    editor._cloneNotNeeded = previousCloneNotNeeded;\n    editor._dirtyType = previousDirtyType;\n    activeEditorState = previousActiveEditorState;\n    isReadOnlyMode = previousReadOnlyMode;\n    activeEditor = previousActiveEditor;\n  }\n  return editorState;\n}\n\n// This technically isn't an update but given we need\n// exposure to the module's active bindings, we have this\n// function here\n\nfunction readEditorState(editor, editorState, callbackFn) {\n  const previousActiveEditorState = activeEditorState;\n  const previousReadOnlyMode = isReadOnlyMode;\n  const previousActiveEditor = activeEditor;\n  activeEditorState = editorState;\n  isReadOnlyMode = true;\n  activeEditor = editor;\n  try {\n    return callbackFn();\n  } finally {\n    activeEditorState = previousActiveEditorState;\n    isReadOnlyMode = previousReadOnlyMode;\n    activeEditor = previousActiveEditor;\n  }\n}\nfunction handleDEVOnlyPendingUpdateGuarantees(pendingEditorState) {\n  // Given we can't Object.freeze the nodeMap as it's a Map,\n  // we instead replace its set, clear and delete methods.\n  const nodeMap = pendingEditorState._nodeMap;\n  nodeMap.set = () => {\n    throw new Error('Cannot call set() on a frozen Lexical node map');\n  };\n  nodeMap.clear = () => {\n    throw new Error('Cannot call clear() on a frozen Lexical node map');\n  };\n  nodeMap.delete = () => {\n    throw new Error('Cannot call delete() on a frozen Lexical node map');\n  };\n}\nfunction $commitPendingUpdates(editor, recoveryEditorState) {\n  const pendingEditorState = editor._pendingEditorState;\n  const rootElement = editor._rootElement;\n  const shouldSkipDOM = editor._headless || rootElement === null;\n  if (pendingEditorState === null) {\n    // Even without a pending state, flush any deferred callbacks that\n    // may have been added by a prior update (e.g. via $onUpdate inside\n    // editor.focus()). This can happen when another commit consumed\n    // the pending editor state before this scheduled commit ran.\n    if (editor._deferred.length > 0) {\n      triggerDeferredUpdateCallbacks(editor, editor._deferred);\n    }\n    return;\n  }\n\n  // ======\n  // Reconciliation has started.\n  // ======\n\n  const currentEditorState = editor._editorState;\n  const currentSelection = currentEditorState._selection;\n  const pendingSelection = pendingEditorState._selection;\n  const needsUpdate = editor._dirtyType !== NO_DIRTY_NODES;\n  const previousActiveEditorState = activeEditorState;\n  const previousReadOnlyMode = isReadOnlyMode;\n  const previousActiveEditor = activeEditor;\n  const previouslyUpdating = editor._updating;\n  const observer = editor._observer;\n  let mutatedNodes = null;\n  editor._pendingEditorState = null;\n  editor._editorState = pendingEditorState;\n  if (!shouldSkipDOM && needsUpdate && observer !== null) {\n    activeEditor = editor;\n    activeEditorState = pendingEditorState;\n    isReadOnlyMode = false;\n    // We don't want updates to sync block the reconciliation.\n    editor._updating = true;\n    try {\n      const dirtyType = editor._dirtyType;\n      const dirtyElements = editor._dirtyElements;\n      const dirtyLeaves = editor._dirtyLeaves;\n      observer.disconnect();\n      mutatedNodes = $reconcileRoot(currentEditorState, pendingEditorState, editor, dirtyType, dirtyElements, dirtyLeaves);\n    } catch (error) {\n      // Report errors\n      if (error instanceof Error) {\n        editor._onError(error);\n      }\n\n      // Reset editor and restore incoming editor state to the DOM\n      if (!isAttemptingToRecoverFromReconcilerError) {\n        resetEditor(editor, null, rootElement, pendingEditorState);\n        initMutationObserver(editor);\n        editor._dirtyType = FULL_RECONCILE;\n        isAttemptingToRecoverFromReconcilerError = true;\n        $commitPendingUpdates(editor, currentEditorState);\n        isAttemptingToRecoverFromReconcilerError = false;\n      } else {\n        // To avoid a possible situation of infinite loops, lets throw\n        throw error;\n      }\n      return;\n    } finally {\n      observer.observe(rootElement, observerOptions);\n      editor._updating = previouslyUpdating;\n      activeEditorState = previousActiveEditorState;\n      isReadOnlyMode = previousReadOnlyMode;\n      activeEditor = previousActiveEditor;\n    }\n  }\n  if (!pendingEditorState._readOnly) {\n    pendingEditorState._readOnly = true;\n    {\n      handleDEVOnlyPendingUpdateGuarantees(pendingEditorState);\n      if ($isRangeSelection(pendingSelection)) {\n        Object.freeze(pendingSelection.anchor);\n        Object.freeze(pendingSelection.focus);\n      }\n      Object.freeze(pendingSelection);\n    }\n  }\n  const dirtyLeaves = editor._dirtyLeaves;\n  const dirtyElements = editor._dirtyElements;\n  const normalizedNodes = editor._normalizedNodes;\n  const tags = editor._updateTags;\n  const deferred = editor._deferred;\n  if (needsUpdate) {\n    editor._dirtyType = NO_DIRTY_NODES;\n    editor._cloneNotNeeded.clear();\n    editor._dirtyLeaves = new Set();\n    editor._dirtyElements = new Map();\n    editor._normalizedNodes = new Set();\n    editor._updateTags = new Set();\n  }\n  $garbageCollectDetachedDecorators(editor, pendingEditorState);\n\n  // ======\n  // Reconciliation has finished. Now update selection and trigger listeners.\n  // ======\n\n  const domSelection = shouldSkipDOM ? null : getDOMSelection(getWindow(editor));\n\n  // Attempt to update the DOM selection, including focusing of the root element,\n  // and scroll into view if needed.\n  if (editor._editable &&\n  // domSelection will be null in headless\n  domSelection !== null && (needsUpdate || pendingSelection === null || pendingSelection.dirty || !pendingSelection.is(currentSelection)) && rootElement !== null && !tags.has(SKIP_DOM_SELECTION_TAG)) {\n    activeEditor = editor;\n    activeEditorState = pendingEditorState;\n    try {\n      if (observer !== null) {\n        observer.disconnect();\n      }\n      if (needsUpdate || pendingSelection === null || pendingSelection.dirty) {\n        const blockCursorElement = editor._blockCursorElement;\n        if (blockCursorElement !== null) {\n          removeDOMBlockCursorElement(blockCursorElement, editor, rootElement);\n        }\n        $updateDOMSelection(currentSelection, pendingSelection, editor, domSelection, tags, rootElement);\n      }\n      updateDOMBlockCursorElement(editor, rootElement, pendingSelection);\n    } finally {\n      if (observer !== null) {\n        observer.observe(rootElement, observerOptions);\n      }\n      activeEditor = previousActiveEditor;\n      activeEditorState = previousActiveEditorState;\n    }\n  }\n  if (mutatedNodes !== null) {\n    triggerMutationListeners(editor, mutatedNodes, tags, dirtyLeaves, currentEditorState);\n  }\n  if (!$isRangeSelection(pendingSelection) && pendingSelection !== null && (currentSelection === null || !currentSelection.is(pendingSelection))) {\n    editor.dispatchCommand(SELECTION_CHANGE_COMMAND, undefined);\n  }\n  /**\n   * Capture pendingDecorators after garbage collecting detached decorators\n   */\n  const pendingDecorators = editor._pendingDecorators;\n  if (pendingDecorators !== null) {\n    editor._decorators = pendingDecorators;\n    editor._pendingDecorators = null;\n    triggerListeners('decorator', editor, true, pendingDecorators);\n  }\n\n  // If reconciler fails, we reset whole editor (so current editor state becomes empty)\n  // and attempt to re-render pendingEditorState. If that goes through we trigger\n  // listeners, but instead use recoverEditorState which is current editor state before reset\n  // This specifically important for collab that relies on prevEditorState from update\n  // listener to calculate delta of changed nodes/properties\n  triggerTextContentListeners(editor, recoveryEditorState || currentEditorState, pendingEditorState);\n  triggerListeners('update', editor, true, {\n    dirtyElements,\n    dirtyLeaves,\n    editorState: pendingEditorState,\n    mutatedNodes,\n    normalizedNodes,\n    prevEditorState: recoveryEditorState || currentEditorState,\n    tags\n  });\n  triggerDeferredUpdateCallbacks(editor, deferred);\n  $triggerEnqueuedUpdates(editor);\n}\nfunction triggerTextContentListeners(editor, currentEditorState, pendingEditorState) {\n  const currentTextContent = getEditorStateTextContent(currentEditorState);\n  const latestTextContent = getEditorStateTextContent(pendingEditorState);\n  if (currentTextContent !== latestTextContent) {\n    triggerListeners('textcontent', editor, true, latestTextContent);\n  }\n}\nfunction triggerMutationListeners(editor, mutatedNodes, updateTags, dirtyLeaves, prevEditorState) {\n  const listeners = Array.from(editor._listeners.mutation);\n  const listenersLength = listeners.length;\n  for (let i = 0; i < listenersLength; i++) {\n    const [listener, klassSet] = listeners[i];\n    for (const klass of klassSet) {\n      const mutatedNodesByType = mutatedNodes.get(klass);\n      if (mutatedNodesByType !== undefined) {\n        listener(mutatedNodesByType, {\n          dirtyLeaves,\n          prevEditorState,\n          updateTags\n        });\n      }\n    }\n  }\n}\nfunction triggerListeners(type, editor, isCurrentlyEnqueuingUpdates, ...payload) {\n  const previouslyUpdating = editor._updating;\n  editor._updating = isCurrentlyEnqueuingUpdates;\n  try {\n    const listenerMap = editor._listeners[type];\n    const listeners = Array.from(listenerMap);\n    for (const [listener, unregister] of listeners) {\n      if (unregister) {\n        unregister();\n      }\n      const nextUnregister = listener(...payload);\n      if (listenerMap.has(listener)) {\n        listenerMap.set(listener, nextUnregister);\n      } else if (nextUnregister) {\n        nextUnregister();\n      }\n    }\n  } finally {\n    editor._updating = previouslyUpdating;\n  }\n}\nfunction triggerCommandListeners(editor, type, payload, fromEditor) {\n  const editors = getEditorsToPropagate(editor);\n  let updatingParentEditor;\n  for (let i = 4; i >= 0; i--) {\n    for (let e = 0; e < editors.length; e++) {\n      const currentEditor = editors[e];\n      if (e > 0 && currentEditor._updating) {\n        // We can't synchronously update an already updating editor without\n        // creating an early commit that will potentially corrupt the\n        // nodeMap by doing GC too early.\n        updatingParentEditor = currentEditor;\n        break;\n      }\n      const commandListeners = currentEditor._commands;\n      const listenerInPriorityOrder = commandListeners.get(type);\n      if (listenerInPriorityOrder !== undefined) {\n        const listenersSet = listenerInPriorityOrder[i];\n        if (listenersSet.size > 0) {\n          let returnVal = false;\n          updateEditorSync(currentEditor, () => {\n            for (const listener of listenersSet) {\n              if (listener(payload, fromEditor)) {\n                returnVal = true;\n                return;\n              }\n            }\n          });\n          if (returnVal) {\n            return returnVal;\n          }\n        }\n      }\n    }\n  }\n  if (updatingParentEditor) {\n    // Preserve the fairly broken legacy semantics of command delegation to fix\n    // https://github.com/facebook/lexical/issues/8306\n    updatingParentEditor.update(() => {\n      // This will be async so we can't know the result\n      triggerCommandListeners(updatingParentEditor, type, payload, fromEditor);\n    });\n  }\n  return false;\n}\nfunction $triggerEnqueuedUpdates(editor) {\n  const queuedUpdates = editor._updates;\n  if (queuedUpdates.length !== 0) {\n    const queuedUpdate = queuedUpdates.shift();\n    if (queuedUpdate) {\n      const [updateFn, options] = queuedUpdate;\n      $beginUpdate(editor, updateFn, options);\n    }\n  }\n}\nfunction triggerDeferredUpdateCallbacks(editor, deferred) {\n  editor._deferred = [];\n  if (deferred.length !== 0) {\n    const previouslyUpdating = editor._updating;\n    editor._updating = true;\n    try {\n      for (let i = 0; i < deferred.length; i++) {\n        deferred[i]();\n      }\n    } finally {\n      editor._updating = previouslyUpdating;\n    }\n  }\n}\nfunction $processNestedUpdates(editor, initialSkipTransforms) {\n  const queuedUpdates = editor._updates;\n  let skipTransforms = initialSkipTransforms || false;\n\n  // Updates might grow as we process them, we so we'll need\n  // to handle each update as we go until the updates array is\n  // empty.\n  while (queuedUpdates.length !== 0) {\n    const queuedUpdate = queuedUpdates.shift();\n    if (queuedUpdate) {\n      const [nextUpdateFn, options] = queuedUpdate;\n      const pendingEditorState = editor._pendingEditorState;\n      let onUpdate;\n      if (options !== undefined) {\n        onUpdate = options.onUpdate;\n        if (options.skipTransforms) {\n          skipTransforms = true;\n        }\n        if (options.discrete) {\n          if (!(pendingEditorState !== null)) {\n            formatDevErrorMessage(`Unexpected empty pending editor state on discrete nested update`);\n          }\n          pendingEditorState._flushSync = true;\n        }\n        if (onUpdate) {\n          editor._deferred.push(onUpdate);\n        }\n        addTags(editor, options.tag);\n      }\n      if (pendingEditorState == null) {\n        $beginUpdate(editor, nextUpdateFn, options);\n      } else {\n        nextUpdateFn();\n      }\n    }\n  }\n  return skipTransforms;\n}\nfunction $beginUpdate(editor, updateFn, options) {\n  const updateTags = editor._updateTags;\n  let onUpdate;\n  let skipTransforms = false;\n  let discrete = false;\n  if (options !== undefined) {\n    onUpdate = options.onUpdate;\n    addTags(editor, options.tag);\n    skipTransforms = options.skipTransforms || false;\n    discrete = options.discrete || false;\n  }\n  if (onUpdate) {\n    editor._deferred.push(onUpdate);\n  }\n  const currentEditorState = editor._editorState;\n  let pendingEditorState = editor._pendingEditorState;\n  let editorStateWasCloned = false;\n  if (pendingEditorState === null || pendingEditorState._readOnly) {\n    pendingEditorState = editor._pendingEditorState = cloneEditorState(pendingEditorState || currentEditorState);\n    editorStateWasCloned = true;\n  }\n  pendingEditorState._flushSync = discrete;\n  const previousActiveEditorState = activeEditorState;\n  const previousReadOnlyMode = isReadOnlyMode;\n  const previousActiveEditor = activeEditor;\n  const previouslyUpdating = editor._updating;\n  activeEditorState = pendingEditorState;\n  isReadOnlyMode = false;\n  editor._updating = true;\n  activeEditor = editor;\n  const headless = editor._headless || editor.getRootElement() === null;\n  setPendingNodeToClone(null);\n  try {\n    if (editorStateWasCloned) {\n      if (headless) {\n        if (currentEditorState._selection !== null) {\n          pendingEditorState._selection = currentEditorState._selection.clone();\n        }\n      } else {\n        pendingEditorState._selection = $internalCreateSelection(editor, options && options.event || null);\n      }\n    }\n    const startingCompositionKey = editor._compositionKey;\n    updateFn();\n    skipTransforms = $processNestedUpdates(editor, skipTransforms);\n    applySelectionTransforms(pendingEditorState, editor);\n    if (editor._dirtyType !== NO_DIRTY_NODES) {\n      if (skipTransforms) {\n        $normalizeAllDirtyTextNodes(pendingEditorState, editor);\n      } else {\n        $applyAllTransforms(pendingEditorState, editor);\n      }\n      $processNestedUpdates(editor);\n      $garbageCollectDetachedNodes(currentEditorState, pendingEditorState, editor._dirtyLeaves, editor._dirtyElements);\n    }\n    const endingCompositionKey = editor._compositionKey;\n    if (startingCompositionKey !== endingCompositionKey) {\n      pendingEditorState._flushSync = true;\n    }\n    const pendingSelection = pendingEditorState._selection;\n    if ($isRangeSelection(pendingSelection)) {\n      const pendingNodeMap = pendingEditorState._nodeMap;\n      const anchorKey = pendingSelection.anchor.key;\n      const focusKey = pendingSelection.focus.key;\n      if (pendingNodeMap.get(anchorKey) === undefined || pendingNodeMap.get(focusKey) === undefined) {\n        {\n          formatDevErrorMessage(`updateEditor: selection has been lost because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node.`);\n        }\n      }\n    } else if ($isNodeSelection(pendingSelection)) {\n      // TODO: we should also validate node selection?\n      if (pendingSelection._nodes.size === 0) {\n        pendingEditorState._selection = null;\n      }\n    }\n  } catch (error) {\n    // Report errors\n    if (error instanceof Error) {\n      editor._onError(error);\n    }\n\n    // Restore existing editor state to the DOM\n    editor._pendingEditorState = currentEditorState;\n    editor._dirtyType = FULL_RECONCILE;\n    editor._cloneNotNeeded.clear();\n    editor._dirtyLeaves = new Set();\n    editor._dirtyElements.clear();\n    $commitPendingUpdates(editor);\n    return;\n  } finally {\n    activeEditorState = previousActiveEditorState;\n    isReadOnlyMode = previousReadOnlyMode;\n    activeEditor = previousActiveEditor;\n    editor._updating = previouslyUpdating;\n    infiniteTransformCount = 0;\n  }\n  const shouldUpdate = editor._dirtyType !== NO_DIRTY_NODES || editor._deferred.length > 0 || editorStateHasDirtySelection(pendingEditorState, editor);\n  if (shouldUpdate) {\n    if (pendingEditorState._flushSync) {\n      pendingEditorState._flushSync = false;\n      $commitPendingUpdates(editor);\n    } else if (editorStateWasCloned) {\n      scheduleMicroTask(() => {\n        $commitPendingUpdates(editor);\n      });\n    }\n  } else {\n    pendingEditorState._flushSync = false;\n    if (editorStateWasCloned) {\n      updateTags.clear();\n      editor._deferred = [];\n      editor._pendingEditorState = null;\n    }\n  }\n}\n\n/**\n * A variant of updateEditor that will not defer if it is nested in an update\n * to the same editor, much like if it was an editor.dispatchCommand issued\n * within an update\n */\nfunction updateEditorSync(editor, updateFn, options) {\n  if (activeEditor === editor && options === undefined) {\n    updateFn();\n  } else {\n    $beginUpdate(editor, updateFn, options);\n  }\n}\nfunction updateEditor(editor, updateFn, options) {\n  if (editor._updating) {\n    editor._updates.push([updateFn, options]);\n  } else {\n    $beginUpdate(editor, updateFn, options);\n  }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\n\n/**\n * A utility class for managing the DOM children of an ElementNode\n */\nclass ElementDOMSlot {\n  element;\n  before;\n  after;\n  constructor(/** The element returned by createDOM */\n  element, /** All managed children will be inserted before this node, if defined */\n  before, /** All managed children will be inserted after this node, if defined */\n  after) {\n    this.element = element;\n    this.before = before || null;\n    this.after = after || null;\n  }\n  /**\n   * Return a new ElementDOMSlot where all managed children will be inserted before this node\n   */\n  withBefore(before) {\n    return new ElementDOMSlot(this.element, before, this.after);\n  }\n  /**\n   * Return a new ElementDOMSlot where all managed children will be inserted after this node\n   */\n  withAfter(after) {\n    return new ElementDOMSlot(this.element, this.before, after);\n  }\n  /**\n   * Return a new ElementDOMSlot with an updated root element\n   */\n  withElement(element) {\n    if (this.element === element) {\n      return this;\n    }\n    return new ElementDOMSlot(element, this.before, this.after);\n  }\n  /**\n   * Insert the given child before this.before and any reconciler managed line break node,\n   * or append it if this.before is not defined\n   */\n  insertChild(dom) {\n    const before = this.before || this.getManagedLineBreak();\n    if (!(before === null || before.parentElement === this.element)) {\n      formatDevErrorMessage(`ElementDOMSlot.insertChild: before is not in element`);\n    }\n    this.element.insertBefore(dom, before);\n    return this;\n  }\n  /**\n   * Remove the managed child from this container, will throw if it was not already there\n   */\n  removeChild(dom) {\n    if (!(dom.parentElement === this.element)) {\n      formatDevErrorMessage(`ElementDOMSlot.removeChild: dom is not in element`);\n    }\n    this.element.removeChild(dom);\n    return this;\n  }\n  /**\n   * Replace managed child prevDom with dom. Will throw if prevDom is not a child\n   *\n   * @param dom The new node to replace prevDom\n   * @param prevDom the node that will be replaced\n   */\n  replaceChild(dom, prevDom) {\n    if (!(prevDom.parentElement === this.element)) {\n      formatDevErrorMessage(`ElementDOMSlot.replaceChild: prevDom is not in element`);\n    }\n    this.element.replaceChild(dom, prevDom);\n    return this;\n  }\n  /**\n   * Returns the first managed child of this node,\n   * which will either be this.after.nextSibling or this.element.firstChild,\n   * and will never be this.before if it is defined.\n   */\n  getFirstChild() {\n    const firstChild = this.after ? this.after.nextSibling : this.element.firstChild;\n    return firstChild === this.before || firstChild === this.getManagedLineBreak() ? null : firstChild;\n  }\n  /**\n   * @internal\n   */\n  getManagedLineBreak() {\n    const element = this.element;\n    return element.__lexicalLineBreak || null;\n  }\n  /** @internal */\n  setManagedLineBreak(lineBreakType) {\n    if (lineBreakType === null) {\n      this.removeManagedLineBreak();\n    } else {\n      const webkitHack = lineBreakType === 'decorator' && (IS_APPLE_WEBKIT || IS_IOS || IS_SAFARI);\n      this.insertManagedLineBreak(webkitHack);\n    }\n  }\n\n  /** @internal */\n  removeManagedLineBreak() {\n    const br = this.getManagedLineBreak();\n    if (br) {\n      const element = this.element;\n      const sibling = br.nodeName === 'IMG' ? br.nextSibling : null;\n      if (sibling) {\n        element.removeChild(sibling);\n      }\n      element.removeChild(br);\n      element.__lexicalLineBreak = undefined;\n    }\n  }\n  /** @internal */\n  insertManagedLineBreak(webkitHack) {\n    const prevBreak = this.getManagedLineBreak();\n    if (prevBreak) {\n      if (webkitHack === (prevBreak.nodeName === 'IMG')) {\n        return;\n      }\n      this.removeManagedLineBreak();\n    }\n    const element = this.element;\n    const before = this.before;\n    const br = document.createElement('br');\n    element.insertBefore(br, before);\n    if (webkitHack) {\n      const img = document.createElement('img');\n      img.setAttribute('data-lexical-linebreak', 'true');\n      img.style.setProperty('display', 'inline', 'important');\n      img.style.setProperty('border', '0px', 'important');\n      img.style.setProperty('margin', '0px', 'important');\n      img.alt = '';\n      element.insertBefore(img, br);\n      element.__lexicalLineBreak = img;\n    } else {\n      element.__lexicalLineBreak = br;\n    }\n  }\n\n  /**\n   * @internal\n   *\n   * Returns the offset of the first child\n   */\n  getFirstChildOffset() {\n    let i = 0;\n    for (let node = this.after; node !== null; node = node.previousSibling) {\n      i++;\n    }\n    return i;\n  }\n\n  /**\n   * @internal\n   */\n  resolveChildIndex(element, elementDOM, initialDOM, initialOffset) {\n    if (initialDOM === this.element) {\n      const firstChildOffset = this.getFirstChildOffset();\n      return [element, Math.min(firstChildOffset + element.getChildrenSize(), Math.max(firstChildOffset, initialOffset))];\n    }\n    // The resolved offset must be before or after the children\n    const initialPath = indexPath(elementDOM, initialDOM);\n    initialPath.push(initialOffset);\n    const elementPath = indexPath(elementDOM, this.element);\n    let offset = element.getIndexWithinParent();\n    for (let i = 0; i < elementPath.length; i++) {\n      const target = initialPath[i];\n      const source = elementPath[i];\n      if (target === undefined || target < source) {\n        break;\n      } else if (target > source) {\n        offset += 1;\n        break;\n      }\n    }\n    return [element.getParentOrThrow(), offset];\n  }\n}\nfunction indexPath(root, child) {\n  const path = [];\n  let node = child;\n  for (; node !== root && node !== null; node = node.parentNode) {\n    let i = 0;\n    for (let sibling = node.previousSibling; sibling !== null; sibling = sibling.previousSibling) {\n      i++;\n    }\n    path.push(i);\n  }\n  if (!(node === root)) {\n    formatDevErrorMessage(`indexPath: root is not a parent of child`);\n  }\n  return path.reverse();\n}\n\n/** @noInheritDoc */\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nclass ElementNode extends LexicalNode {\n  /** @internal */\n\n  /** @internal */\n  __first;\n  /** @internal */\n  __last;\n  /** @internal */\n  __size;\n  /** @internal */\n  __format;\n  /** @internal */\n  __style;\n  /** @internal */\n  __indent;\n  /** @internal */\n  __dir;\n  /** @internal */\n  __textFormat;\n  /** @internal */\n  __textStyle;\n  constructor(key) {\n    super(key);\n    this.__first = null;\n    this.__last = null;\n    this.__size = 0;\n    this.__format = 0;\n    this.__style = '';\n    this.__indent = 0;\n    this.__dir = null;\n    this.__textFormat = 0;\n    this.__textStyle = '';\n  }\n  afterCloneFrom(prevNode) {\n    super.afterCloneFrom(prevNode);\n    if (this.__key === prevNode.__key) {\n      this.__first = prevNode.__first;\n      this.__last = prevNode.__last;\n      this.__size = prevNode.__size;\n    }\n    this.__indent = prevNode.__indent;\n    this.__format = prevNode.__format;\n    this.__style = prevNode.__style;\n    this.__dir = prevNode.__dir;\n    this.__textFormat = prevNode.__textFormat;\n    this.__textStyle = prevNode.__textStyle;\n  }\n  getFormat() {\n    const self = this.getLatest();\n    return self.__format;\n  }\n  getFormatType() {\n    const format = this.getFormat();\n    return ELEMENT_FORMAT_TO_TYPE[format] || '';\n  }\n  getStyle() {\n    const self = this.getLatest();\n    return self.__style;\n  }\n  getIndent() {\n    const self = this.getLatest();\n    return self.__indent;\n  }\n  getChildren() {\n    const children = [];\n    let child = this.getFirstChild();\n    while (child !== null) {\n      children.push(child);\n      child = child.getNextSibling();\n    }\n    return children;\n  }\n  getChildrenKeys() {\n    const children = [];\n    let child = this.getFirstChild();\n    while (child !== null) {\n      children.push(child.__key);\n      child = child.getNextSibling();\n    }\n    return children;\n  }\n  getChildrenSize() {\n    const self = this.getLatest();\n    return self.__size;\n  }\n  isEmpty() {\n    return this.getChildrenSize() === 0;\n  }\n  isDirty() {\n    const editor = getActiveEditor();\n    const dirtyElements = editor._dirtyElements;\n    return dirtyElements !== null && dirtyElements.has(this.__key);\n  }\n  isLastChild() {\n    const self = this.getLatest();\n    const parentLastChild = this.getParentOrThrow().getLastChild();\n    return parentLastChild !== null && parentLastChild.is(self);\n  }\n  getAllTextNodes() {\n    const textNodes = [];\n    let child = this.getFirstChild();\n    while (child !== null) {\n      if ($isTextNode(child)) {\n        textNodes.push(child);\n      }\n      if ($isElementNode(child)) {\n        const subChildrenNodes = child.getAllTextNodes();\n        textNodes.push(...subChildrenNodes);\n      }\n      child = child.getNextSibling();\n    }\n    return textNodes;\n  }\n  getFirstDescendant() {\n    let node = this.getFirstChild();\n    while ($isElementNode(node)) {\n      const child = node.getFirstChild();\n      if (child === null) {\n        break;\n      }\n      node = child;\n    }\n    return node;\n  }\n  getLastDescendant() {\n    let node = this.getLastChild();\n    while ($isElementNode(node)) {\n      const child = node.getLastChild();\n      if (child === null) {\n        break;\n      }\n      node = child;\n    }\n    return node;\n  }\n  getDescendantByIndex(index) {\n    const children = this.getChildren();\n    const childrenLength = children.length;\n    // For non-empty element nodes, we resolve its descendant\n    // (either a leaf node or the bottom-most element)\n    if (index >= childrenLength) {\n      const resolvedNode = children[childrenLength - 1];\n      return $isElementNode(resolvedNode) && resolvedNode.getLastDescendant() || resolvedNode || null;\n    }\n    const resolvedNode = children[index];\n    return $isElementNode(resolvedNode) && resolvedNode.getFirstDescendant() || resolvedNode || null;\n  }\n  getFirstChild() {\n    const self = this.getLatest();\n    const firstKey = self.__first;\n    return firstKey === null ? null : $getNodeByKey(firstKey);\n  }\n  getFirstChildOrThrow() {\n    const firstChild = this.getFirstChild();\n    if (firstChild === null) {\n      {\n        formatDevErrorMessage(`Expected node ${this.__key} to have a first child.`);\n      }\n    }\n    return firstChild;\n  }\n  getLastChild() {\n    const self = this.getLatest();\n    const lastKey = self.__last;\n    return lastKey === null ? null : $getNodeByKey(lastKey);\n  }\n  getLastChildOrThrow() {\n    const lastChild = this.getLastChild();\n    if (lastChild === null) {\n      {\n        formatDevErrorMessage(`Expected node ${this.__key} to have a last child.`);\n      }\n    }\n    return lastChild;\n  }\n  getChildAtIndex(index) {\n    const size = this.getChildrenSize();\n    let node;\n    let i;\n    if (index < size / 2) {\n      node = this.getFirstChild();\n      i = 0;\n      while (node !== null && i <= index) {\n        if (i === index) {\n          return node;\n        }\n        node = node.getNextSibling();\n        i++;\n      }\n      return null;\n    }\n    node = this.getLastChild();\n    i = size - 1;\n    while (node !== null && i >= index) {\n      if (i === index) {\n        return node;\n      }\n      node = node.getPreviousSibling();\n      i--;\n    }\n    return null;\n  }\n  getTextContent() {\n    let textContent = '';\n    const children = this.getChildren();\n    const childrenLength = children.length;\n    for (let i = 0; i < childrenLength; i++) {\n      const child = children[i];\n      textContent += child.getTextContent();\n      if (\n      // this is an inline $textContentRequiresDoubleLinebreakAtEnd(child)\n      $isElementNode(child) && i !== childrenLength - 1 && !child.isInline()) {\n        textContent += DOUBLE_LINE_BREAK;\n      }\n    }\n    return textContent;\n  }\n  getTextContentSize() {\n    let textContentSize = 0;\n    const children = this.getChildren();\n    const childrenLength = children.length;\n    for (let i = 0; i < childrenLength; i++) {\n      const child = children[i];\n      textContentSize += child.getTextContentSize();\n      if (\n      // This is an inline $textContentRequiresDoubleLinebreakAtEnd(child)\n      $isElementNode(child) && i !== childrenLength - 1 && !child.isInline()) {\n        textContentSize += DOUBLE_LINE_BREAK.length;\n      }\n    }\n    return textContentSize;\n  }\n  getDirection() {\n    const self = this.getLatest();\n    return self.__dir;\n  }\n  getTextFormat() {\n    const self = this.getLatest();\n    return self.__textFormat;\n  }\n  hasFormat(type) {\n    if (type !== '') {\n      const formatFlag = ELEMENT_TYPE_TO_FORMAT[type];\n      return (this.getFormat() & formatFlag) !== 0;\n    }\n    return false;\n  }\n  hasTextFormat(type) {\n    const formatFlag = TEXT_TYPE_TO_FORMAT[type];\n    return (this.getTextFormat() & formatFlag) !== 0;\n  }\n  /**\n   * Returns the format flags applied to the node as a 32-bit integer.\n   *\n   * @returns a number representing the TextFormatTypes applied to the node.\n   */\n  getFormatFlags(type, alignWithFormat) {\n    const self = this.getLatest();\n    const format = self.__textFormat;\n    return toggleTextFormatType(format, type, alignWithFormat);\n  }\n  getTextStyle() {\n    const self = this.getLatest();\n    return self.__textStyle;\n  }\n\n  // Mutators\n\n  select(_anchorOffset, _focusOffset) {\n    errorOnReadOnly();\n    const selection = $getSelection();\n    let anchorOffset = _anchorOffset;\n    let focusOffset = _focusOffset;\n    const childrenCount = this.getChildrenSize();\n    if (!this.canBeEmpty()) {\n      if (_anchorOffset === 0 && _focusOffset === 0) {\n        const firstChild = this.getFirstChild();\n        if ($isTextNode(firstChild) || $isElementNode(firstChild)) {\n          return firstChild.select(0, 0);\n        }\n      } else if ((_anchorOffset === undefined || _anchorOffset === childrenCount) && (_focusOffset === undefined || _focusOffset === childrenCount)) {\n        const lastChild = this.getLastChild();\n        if ($isTextNode(lastChild) || $isElementNode(lastChild)) {\n          return lastChild.select();\n        }\n      }\n    }\n    if (anchorOffset === undefined) {\n      anchorOffset = childrenCount;\n    }\n    if (focusOffset === undefined) {\n      focusOffset = childrenCount;\n    }\n    const key = this.__key;\n    if (!$isRangeSelection(selection)) {\n      return $internalMakeRangeSelection(key, anchorOffset, key, focusOffset, 'element', 'element');\n    } else {\n      selection.anchor.set(key, anchorOffset, 'element');\n      selection.focus.set(key, focusOffset, 'element');\n      selection.dirty = true;\n    }\n    return selection;\n  }\n  selectStart() {\n    const firstNode = this.getFirstDescendant();\n    return firstNode ? firstNode.selectStart() : this.select();\n  }\n  selectEnd() {\n    const lastNode = this.getLastDescendant();\n    return lastNode ? lastNode.selectEnd() : this.select();\n  }\n  clear() {\n    const writableSelf = this.getWritable();\n    const children = this.getChildren();\n    children.forEach(child => child.remove());\n    return writableSelf;\n  }\n  append(...nodesToAppend) {\n    return this.splice(this.getChildrenSize(), 0, nodesToAppend);\n  }\n  setDirection(direction) {\n    const self = this.getWritable();\n    self.__dir = direction;\n    return self;\n  }\n  setFormat(type) {\n    const self = this.getWritable();\n    self.__format = type !== '' ? ELEMENT_TYPE_TO_FORMAT[type] || 0 : 0;\n    return this;\n  }\n  setStyle(style) {\n    const self = this.getWritable();\n    self.__style = style || '';\n    return this;\n  }\n  setTextFormat(type) {\n    const self = this.getWritable();\n    self.__textFormat = type;\n    return self;\n  }\n  setTextStyle(style) {\n    const self = this.getWritable();\n    self.__textStyle = style;\n    return self;\n  }\n  setIndent(indentLevel) {\n    const self = this.getWritable();\n    self.__indent = indentLevel;\n    return this;\n  }\n  splice(start, deleteCount, nodesToInsert) {\n    if (!!$isEphemeral(this)) {\n      formatDevErrorMessage(`ElementNode.splice: Ephemeral nodes can not mutate their children (key ${this.__key} type ${this.__type})`);\n    }\n    const oldSize = this.getChildrenSize();\n    const writableSelf = this.getWritable();\n    if (!(start + deleteCount <= oldSize)) {\n      formatDevErrorMessage(`ElementNode.splice: start + deleteCount > oldSize (${String(start)} + ${String(deleteCount)} > ${String(oldSize)})`);\n    }\n    const writableSelfKey = writableSelf.__key;\n    const nodesToInsertKeys = [];\n    const nodesToRemoveKeys = [];\n    const nodeAfterRange = this.getChildAtIndex(start + deleteCount);\n    let nodeBeforeRange = null;\n    let newSize = oldSize - deleteCount + nodesToInsert.length;\n    if (start !== 0) {\n      if (start === oldSize) {\n        nodeBeforeRange = this.getLastChild();\n      } else {\n        const node = this.getChildAtIndex(start);\n        if (node !== null) {\n          nodeBeforeRange = node.getPreviousSibling();\n        }\n      }\n    }\n    if (deleteCount > 0) {\n      let nodeToDelete = nodeBeforeRange === null ? this.getFirstChild() : nodeBeforeRange.getNextSibling();\n      for (let i = 0; i < deleteCount; i++) {\n        if (nodeToDelete === null) {\n          {\n            formatDevErrorMessage(`splice: sibling not found`);\n          }\n        }\n        const nextSibling = nodeToDelete.getNextSibling();\n        const nodeKeyToDelete = nodeToDelete.__key;\n        const writableNodeToDelete = nodeToDelete.getWritable();\n        removeFromParent(writableNodeToDelete);\n        nodesToRemoveKeys.push(nodeKeyToDelete);\n        nodeToDelete = nextSibling;\n      }\n    }\n    let prevNode = nodeBeforeRange;\n    for (const nodeToInsert of nodesToInsert) {\n      if (prevNode !== null && nodeToInsert.is(prevNode)) {\n        nodeBeforeRange = prevNode = prevNode.getPreviousSibling();\n      }\n      const writableNodeToInsert = nodeToInsert.getWritable();\n      if (writableNodeToInsert.__parent === writableSelfKey) {\n        newSize--;\n      }\n      removeFromParent(writableNodeToInsert);\n      const nodeKeyToInsert = nodeToInsert.__key;\n      if (prevNode === null) {\n        writableSelf.__first = nodeKeyToInsert;\n        writableNodeToInsert.__prev = null;\n      } else {\n        const writablePrevNode = prevNode.getWritable();\n        writablePrevNode.__next = nodeKeyToInsert;\n        writableNodeToInsert.__prev = writablePrevNode.__key;\n      }\n      if (nodeToInsert.__key === writableSelfKey) {\n        {\n          formatDevErrorMessage(`append: attempting to append self`);\n        }\n      }\n      // Set child parent to self\n      writableNodeToInsert.__parent = writableSelfKey;\n      nodesToInsertKeys.push(nodeKeyToInsert);\n      prevNode = nodeToInsert;\n    }\n    if (start + deleteCount === oldSize) {\n      if (prevNode !== null) {\n        const writablePrevNode = prevNode.getWritable();\n        writablePrevNode.__next = null;\n        writableSelf.__last = prevNode.__key;\n      }\n    } else if (nodeAfterRange !== null) {\n      const writableNodeAfterRange = nodeAfterRange.getWritable();\n      if (prevNode !== null) {\n        const writablePrevNode = prevNode.getWritable();\n        writableNodeAfterRange.__prev = prevNode.__key;\n        writablePrevNode.__next = nodeAfterRange.__key;\n      } else {\n        writableNodeAfterRange.__prev = null;\n      }\n    }\n    writableSelf.__size = newSize;\n\n    // In case of deletion we need to adjust selection, unlink removed nodes\n    // and clean up node itself if it becomes empty. None of these needed\n    // for insertion-only cases\n    if (nodesToRemoveKeys.length) {\n      // Adjusting selection, in case node that was anchor/focus will be deleted\n      const selection = $getSelection();\n      if ($isRangeSelection(selection)) {\n        const nodesToRemoveKeySet = new Set(nodesToRemoveKeys);\n        const nodesToInsertKeySet = new Set(nodesToInsertKeys);\n        const {\n          anchor,\n          focus\n        } = selection;\n        if (isPointRemoved(anchor, nodesToRemoveKeySet, nodesToInsertKeySet)) {\n          moveSelectionPointToSibling(anchor, anchor.getNode(), this, nodeBeforeRange, nodeAfterRange);\n        }\n        if (isPointRemoved(focus, nodesToRemoveKeySet, nodesToInsertKeySet)) {\n          moveSelectionPointToSibling(focus, focus.getNode(), this, nodeBeforeRange, nodeAfterRange);\n        }\n        // Cleanup if node can't be empty\n        if (newSize === 0 && !this.canBeEmpty() && !$isRootOrShadowRoot(this)) {\n          this.remove();\n        }\n      }\n    }\n    return writableSelf;\n  }\n  /**\n   * @internal\n   *\n   * An experimental API that an ElementNode can override to control where its\n   * children are inserted into the DOM, this is useful to add a wrapping node\n   * or accessory nodes before or after the children. The root of the node returned\n   * by createDOM must still be exactly one HTMLElement.\n   */\n  getDOMSlot(element) {\n    return new ElementDOMSlot(element);\n  }\n  exportDOM(editor) {\n    const {\n      element\n    } = super.exportDOM(editor);\n    if (isHTMLElement(element)) {\n      const indent = this.getIndent();\n      if (indent > 0) {\n        // padding-inline-start is not widely supported in email HTML\n        // (see https://www.caniemail.com/features/css-padding-inline-start-end/),\n        // If you want to use HTML output for email, consider overriding the serialization\n        // to use `padding-right` in RTL languages, `padding-left` in `LTR` languages, or\n        // `text-indent` if you are ok with first-line indents.\n        // We recommend keeping multiples of 40px to maintain consistency with list-items\n        // (see https://github.com/facebook/lexical/pull/4025)\n        element.style.paddingInlineStart = `${indent * 40}px`;\n      }\n      const direction = this.getDirection();\n      if (direction) {\n        element.dir = direction;\n      }\n    }\n    return {\n      element\n    };\n  }\n  // JSON serialization\n  exportJSON() {\n    const json = {\n      children: [],\n      direction: this.getDirection(),\n      format: this.getFormatType(),\n      indent: this.getIndent(),\n      // As an exception here we invoke super at the end for historical reasons.\n      // Namely, to preserve the order of the properties and not to break the tests\n      // that use the serialized string representation.\n      ...super.exportJSON()\n    };\n    const textFormat = this.getTextFormat();\n    const textStyle = this.getTextStyle();\n    // Only persist for cases when there are no TextNode children from which\n    // these would be set on reconcile (#7968)\n    if ((textFormat !== 0 || textStyle !== '') && !$isRootOrShadowRoot(this) && !this.getChildren().some($isTextNode)) {\n      if (textFormat !== 0) {\n        json.textFormat = textFormat;\n      }\n      if (textStyle !== '') {\n        json.textStyle = textStyle;\n      }\n    }\n    return json;\n  }\n  updateFromJSON(serializedNode) {\n    return super.updateFromJSON(serializedNode).setFormat(serializedNode.format).setIndent(serializedNode.indent).setDirection(serializedNode.direction).setTextFormat(serializedNode.textFormat || 0).setTextStyle(serializedNode.textStyle || '');\n  }\n  // These are intended to be extends for specific element heuristics.\n  insertNewAfter(selection, restoreSelection) {\n    return null;\n  }\n  canIndent() {\n    return true;\n  }\n  /*\n   * This method controls the behavior of the node during backwards\n   * deletion (i.e., backspace) when selection is at the beginning of\n   * the node (offset 0). You may use this to have the node replace\n   * itself, change its state, or do nothing. When you do make such\n   * a change, you should return true.\n   *\n   * When true is returned, the collapse phase will stop.\n   * When false is returned, and isInline() is true, and getPreviousSibling() is null,\n   * then this function will be called on its parent.\n   */\n  collapseAtStart(selection) {\n    return false;\n  }\n  excludeFromCopy(destination) {\n    return false;\n  }\n  /** @deprecated @internal */\n  canReplaceWith(replacement) {\n    return true;\n  }\n  /** @deprecated @internal */\n  canInsertAfter(node) {\n    return true;\n  }\n  canBeEmpty() {\n    return true;\n  }\n  canInsertTextBefore() {\n    return true;\n  }\n  canInsertTextAfter() {\n    return true;\n  }\n  isInline() {\n    return false;\n  }\n  // A shadow root is a Node that behaves like RootNode. The shadow root (and RootNode) mark the\n  // end of the hierarchy, most implementations should treat it as there's nothing (upwards)\n  // beyond this point. For example, node.getTopLevelElement(), when performed inside a TableCellNode\n  // will return the immediate first child underneath TableCellNode instead of RootNode.\n  isShadowRoot() {\n    return false;\n  }\n  /** @deprecated @internal */\n  canMergeWith(node) {\n    return false;\n  }\n  extractWithChild(child, selection, destination) {\n    return false;\n  }\n\n  /**\n   * Determines whether this node, when empty, can merge with a first block\n   * of nodes being inserted.\n   *\n   * This method is specifically called in {@link RangeSelection.insertNodes}\n   * to determine merging behavior during nodes insertion.\n   *\n   * @example\n   * // In a ListItemNode or QuoteNode implementation:\n   * canMergeWhenEmpty(): true {\n   *  return true;\n   * }\n   */\n  canMergeWhenEmpty() {\n    return false;\n  }\n\n  /** @internal */\n  reconcileObservedMutation(dom, editor) {\n    const slot = $getEditorDOMRenderConfig(editor).$getDOMSlot(this, dom, editor);\n    let currentDOM = slot.getFirstChild();\n    for (let currentNode = this.getFirstChild(); currentNode; currentNode = currentNode.getNextSibling()) {\n      const correctDOM = editor.getElementByKey(currentNode.getKey());\n      if (correctDOM === null) {\n        continue;\n      }\n      if (currentDOM == null) {\n        slot.insertChild(correctDOM);\n        currentDOM = correctDOM;\n      } else if (currentDOM !== correctDOM) {\n        slot.replaceChild(correctDOM, currentDOM);\n      }\n      currentDOM = currentDOM.nextSibling;\n    }\n  }\n}\nfunction $isElementNode(node) {\n  return node instanceof ElementNode;\n}\nfunction isPointRemoved(point, nodesToRemoveKeySet, nodesToInsertKeySet) {\n  let node = point.getNode();\n  while (node) {\n    const nodeKey = node.__key;\n    if (nodesToRemoveKeySet.has(nodeKey) && !nodesToInsertKeySet.has(nodeKey)) {\n      return true;\n    }\n    node = node.getParent();\n  }\n  return false;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n/** @noInheritDoc */\n// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging\nclass DecoratorNode extends LexicalNode {\n  /** @internal */\n\n  /**\n   * The returned value is added to the LexicalEditor._decorators\n   */\n  decorate(editor, config) {\n    return null;\n  }\n  isIsolated() {\n    return false;\n  }\n  isInline() {\n    return true;\n  }\n  isKeyboardSelectable() {\n    return true;\n  }\n}\nfunction $isDecoratorNode(node) {\n  return node instanceof DecoratorNode;\n}\n\n/** @noInheritDoc */\nclass RootNode extends ElementNode {\n  /** @internal */\n  __cachedText;\n  static getType() {\n    return 'root';\n  }\n  static clone() {\n    return new RootNode();\n  }\n  constructor() {\n    super('root');\n    this.__cachedText = null;\n  }\n  getTopLevelElementOrThrow() {\n    {\n      formatDevErrorMessage(`getTopLevelElementOrThrow: root nodes are not top level elements`);\n    }\n  }\n  getTextContent() {\n    const cachedText = this.__cachedText;\n    if (isCurrentlyReadOnlyMode() || getActiveEditor()._dirtyType === NO_DIRTY_NODES) {\n      if (cachedText !== null) {\n        return cachedText;\n      }\n    }\n    return super.getTextContent();\n  }\n  remove() {\n    {\n      formatDevErrorMessage(`remove: cannot be called on root nodes`);\n    }\n  }\n  replace(node) {\n    {\n      formatDevErrorMessage(`replace: cannot be called on root nodes`);\n    }\n  }\n  insertBefore(nodeToInsert) {\n    {\n      formatDevErrorMessage(`insertBefore: cannot be called on root nodes`);\n    }\n  }\n  insertAfter(nodeToInsert) {\n    {\n      formatDevErrorMessage(`insertAfter: cannot be called on root nodes`);\n    }\n  }\n\n  // View\n\n  updateDOM(prevNode, dom) {\n    return false;\n  }\n\n  // Mutate\n  splice(start, deleteCount, nodesToInsert) {\n    for (const node of nodesToInsert) {\n      if (!($isElementNode(node) || $isDecoratorNode(node))) {\n        formatDevErrorMessage(`rootNode.splice: Only element or decorator nodes can be inserted to the root node`);\n      }\n    }\n    return super.splice(start, deleteCount, nodesToInsert);\n  }\n  static importJSON(serializedNode) {\n    // We don't create a root, and instead use the existing root.\n    return $getRoot().updateFromJSON(serializedNode);\n  }\n  collapseAtStart() {\n    return true;\n  }\n}\nfunction $createRootNode() {\n  return new RootNode();\n}\nfunction $isRootNode(node) {\n  return node instanceof RootNode;\n}\n\nfunction editorStateHasDirtySelection(editorState, editor) {\n  const currentSelection = editor.getEditorState()._selection;\n  const pendingSelection = editorState._selection;\n\n  // Check if we need to update because of changes in selection\n  if (pendingSelection !== null) {\n    if (pendingSelection.dirty || !pendingSelection.is(currentSelection)) {\n      return true;\n    }\n  } else if (currentSelection !== null) {\n    return true;\n  }\n  return false;\n}\nfunction cloneEditorState(current) {\n  return new EditorState(new Map(current._nodeMap));\n}\nfunction createEmptyEditorState() {\n  return new EditorState(new Map([['root', $createRootNode()]]));\n}\nfunction exportNodeToJSON(node) {\n  const serializedNode = node.exportJSON();\n  const nodeClass = node.constructor;\n  if (serializedNode.type !== nodeClass.getType()) {\n    {\n      formatDevErrorMessage(`LexicalNode: Node ${nodeClass.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);\n    }\n  }\n  if ($isElementNode(node)) {\n    const serializedChildren = serializedNode.children;\n    if (!Array.isArray(serializedChildren)) {\n      {\n        formatDevErrorMessage(`LexicalNode: Node ${nodeClass.name} is an element but .exportJSON() does not have a children array.`);\n      }\n    }\n    const children = node.getChildren();\n    for (let i = 0; i < children.length; i++) {\n      const child = children[i];\n      const serializedChildNode = exportNodeToJSON(child);\n      serializedChildren.push(serializedChildNode);\n    }\n  }\n\n  // @ts-expect-error\n  return serializedNode;\n}\n/**\n * Type guard that returns true if the argument is an EditorState\n */\nfunction $isEditorState(x) {\n  return x instanceof EditorState;\n}\nclass EditorState {\n  _nodeMap;\n  _selection;\n  _flushSync;\n  _readOnly;\n  constructor(nodeMap, selection) {\n    this._nodeMap = nodeMap;\n    this._selection = selection || null;\n    this._flushSync = false;\n    this._readOnly = false;\n  }\n  isEmpty() {\n    return this._nodeMap.size === 1 && this._selection === null;\n  }\n  read(callbackFn, options) {\n    return readEditorState(options && options.editor || null, this, callbackFn);\n  }\n  clone(selection) {\n    const editorState = new EditorState(this._nodeMap, selection === undefined ? this._selection : selection);\n    editorState._readOnly = true;\n    return editorState;\n  }\n  toJSON() {\n    return readEditorState(null, this, () => ({\n      root: exportNodeToJSON($getRoot())\n    }));\n  }\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n// TODO: Cleanup ArtificialNode__DO_NOT_USE #5966\n/** @internal */\nclass ArtificialNode__DO_NOT_USE extends ElementNode {\n  static getType() {\n    return 'artificial';\n  }\n  createDOM(config) {\n    // this isnt supposed to be used and is not used anywhere but defining it to appease the API\n    const dom = document.createElement('div');\n    return dom;\n  }\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/** @noInheritDoc */\nclass ParagraphNode extends ElementNode {\n  /** @internal */\n\n  static getType() {\n    return 'paragraph';\n  }\n  static clone(node) {\n    return new ParagraphNode(node.__key);\n  }\n\n  // View\n\n  createDOM(config) {\n    const dom = document.createElement('p');\n    const classNames = getCachedClassNameArray(config.theme, 'paragraph');\n    if (classNames !== undefined) {\n      const domClassList = dom.classList;\n      domClassList.add(...classNames);\n    }\n    return dom;\n  }\n  updateDOM(prevNode, dom, config) {\n    return false;\n  }\n  static importDOM() {\n    return {\n      p: node => ({\n        conversion: $convertParagraphElement,\n        priority: 0\n      })\n    };\n  }\n  exportDOM(editor) {\n    const {\n      element\n    } = super.exportDOM(editor);\n    if (isHTMLElement(element)) {\n      if (this.isEmpty()) {\n        element.append(document.createElement('br'));\n      }\n      const formatType = this.getFormatType();\n      if (formatType) {\n        element.style.textAlign = formatType;\n      }\n    }\n    return {\n      element\n    };\n  }\n  static importJSON(serializedNode) {\n    return $createParagraphNode().updateFromJSON(serializedNode);\n  }\n  exportJSON() {\n    const json = super.exportJSON();\n    // Provide backwards compatible values, see #7971\n    if (json.textFormat === undefined || json.textStyle === undefined) {\n      // Compute the same value that the reconciler would\n      const firstTextNode = this.getChildren().find($isTextNode);\n      if (firstTextNode) {\n        json.textFormat = firstTextNode.getFormat();\n        json.textStyle = firstTextNode.getStyle();\n      } else {\n        json.textFormat = this.getTextFormat();\n        json.textStyle = this.getTextStyle();\n      }\n    }\n    return json;\n  }\n\n  // Mutation\n\n  insertNewAfter(rangeSelection, restoreSelection) {\n    const newElement = $createParagraphNode();\n    newElement.setTextFormat(rangeSelection.format);\n    newElement.setTextStyle(rangeSelection.style);\n    const direction = this.getDirection();\n    newElement.setDirection(direction);\n    newElement.setFormat(this.getFormatType());\n    newElement.setStyle(this.getStyle());\n    this.insertAfter(newElement, restoreSelection);\n    return newElement;\n  }\n  collapseAtStart() {\n    const children = this.getChildren();\n    // If we have an empty (trimmed) first paragraph and try and remove it,\n    // delete the paragraph as long as we have another sibling to go to\n    if (children.length === 0 || $isTextNode(children[0]) && children[0].getTextContent().trim() === '') {\n      const nextSibling = this.getNextSibling();\n      if (nextSibling !== null) {\n        this.selectNext();\n        this.remove();\n        return true;\n      }\n      const prevSibling = this.getPreviousSibling();\n      if (prevSibling !== null) {\n        this.selectPrevious();\n        this.remove();\n        return true;\n      }\n    }\n    return false;\n  }\n}\nfunction $convertParagraphElement(element) {\n  const node = $createParagraphNode();\n  if (element.style) {\n    node.setFormat(element.style.textAlign);\n    setNodeIndentFromDOM(element, node);\n  }\n\n  // Check legacy 'align' attribute\n  // Only use this if no format was set by CSS\n  if (node.getFormatType() === '') {\n    const align = element.getAttribute('align');\n    if (align) {\n      if (align && align in ELEMENT_TYPE_TO_FORMAT) {\n        node.setFormat(align);\n      }\n    }\n  }\n  return {\n    node\n  };\n}\nfunction $createParagraphNode() {\n  return $applyNodeReplacement(new ParagraphNode());\n}\nfunction $isParagraphNode(node) {\n  return node instanceof ParagraphNode;\n}\n\n// https://github.com/microsoft/TypeScript/issues/3841\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n/**\n * A LexicalNode class or LexicalNodeReplacement configuration\n */\n\n/** @internal @experimental */\n\nconst DEFAULT_SKIP_INITIALIZATION = false;\n\n/**\n * The payload passed to an UpdateListener\n */\n\n/**\n * A listener that gets called after the editor is updated\n */\n\n/**\n * A listener that is called when {@link LexicalEditor.setRootElement} changes the\n * element that the editor is attached to. If this callback returns a function,\n * that function will be called before the next value update or unregister.\n */\n\n/**\n * A listener that is called when {@link LexicalEditor.setEditable} changes the\n * editable state of the editor. If this callback returns a function,\n * that function will be called before the next value update or unregister.\n */\n\n/**\n * {@link LexicalEditor.registerCommand} listener added to the end of the editor priority queue (after critical, high, normal, low)\n */\nconst COMMAND_PRIORITY_EDITOR = 0;\n/**\n * {@link LexicalEditor.registerCommand} listener added to the end of the low priority queue (after critical, high, normal; before editor)\n */\nconst COMMAND_PRIORITY_LOW = 1;\n/**\n * {@link LexicalEditor.registerCommand} listener added to the end of the normal priority queue (after critical, high; before low, editor)\n */\nconst COMMAND_PRIORITY_NORMAL = 2;\n/**\n * {@link LexicalEditor.registerCommand} listener added to the end of the high priority queue (after critical; before normal, low, editor)\n */\nconst COMMAND_PRIORITY_HIGH = 3;\n/**\n * {@link LexicalEditor.registerCommand} listener added to the end of the critical priority queue (before high, normal, low, editor)\n */\nconst COMMAND_PRIORITY_CRITICAL = 4;\n/**\n * {@link LexicalEditor.registerCommand} listener added to the beginning of the editor priority queue (after critical, high, normal, low)\n */\nconst COMMAND_PRIORITY_BEFORE_EDITOR = -8;\n/**\n * {@link LexicalEditor.registerCommand} listener added to the beginning of the low priority queue (after critical, high, normal; before editor)\n */\nconst COMMAND_PRIORITY_BEFORE_LOW = -7;\n/**\n * {@link LexicalEditor.registerCommand} listener added to the beginning of the normal priority queue (after critical, high; before low, editor)\n */\nconst COMMAND_PRIORITY_BEFORE_NORMAL = -6;\n/**\n * {@link LexicalEditor.registerCommand} listener added to the beginning of the high priority queue (after critical; before normal, low, editor)\n */\nconst COMMAND_PRIORITY_BEFORE_HIGH = -5;\n/**\n * {@link LexicalEditor.registerCommand} listener added to the beginning of the critical priority queue (before high, normal, low, editor)\n */\nconst COMMAND_PRIORITY_BEFORE_CRITICAL = -4;\nfunction normalizePriority(priority) {\n  return priority & 7;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\n/**\n * Type helper for extracting the payload type from a command.\n *\n * @example\n * ```ts\n * const MY_COMMAND = createCommand<SomeType>();\n *\n * // ...\n *\n * editor.registerCommand(MY_COMMAND, payload => {\n *   // Type of `payload` is inferred here. But lets say we want to extract a function to delegate to\n *   $handleMyCommand(editor, payload);\n *   return true;\n * });\n *\n * function $handleMyCommand(editor: LexicalEditor, payload: CommandPayloadType<typeof MY_COMMAND>) {\n *   // `payload` is of type `SomeType`, extracted from the command.\n * }\n * ```\n */\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nfunction resetEditor(editor, prevRootElement, nextRootElement, pendingEditorState) {\n  const keyNodeMap = editor._keyToDOMMap;\n  keyNodeMap.clear();\n  editor._editorState = createEmptyEditorState();\n  editor._pendingEditorState = pendingEditorState;\n  editor._compositionKey = null;\n  editor._dirtyType = NO_DIRTY_NODES;\n  editor._cloneNotNeeded.clear();\n  editor._dirtyLeaves = new Set();\n  editor._dirtyElements.clear();\n  editor._normalizedNodes = new Set();\n  editor._updateTags = new Set();\n  editor._updates = [];\n  editor._blockCursorElement = null;\n  const observer = editor._observer;\n  if (observer !== null) {\n    observer.disconnect();\n    editor._observer = null;\n  }\n\n  // Remove all the DOM nodes from the root element\n  if (prevRootElement !== null) {\n    prevRootElement.textContent = '';\n  }\n  if (nextRootElement !== null) {\n    nextRootElement.textContent = '';\n    keyNodeMap.set('root', nextRootElement);\n  }\n}\nfunction initializeConversionCache(nodes, additionalConversions) {\n  const conversionCache = new Map();\n  const handledConversions = new Set();\n  const addConversionsToCache = map => {\n    Object.keys(map).forEach(key => {\n      let currentCache = conversionCache.get(key);\n      if (currentCache === undefined) {\n        currentCache = [];\n        conversionCache.set(key, currentCache);\n      }\n      currentCache.push(map[key]);\n    });\n  };\n  nodes.forEach(node => {\n    const importDOM = node.klass.importDOM;\n    if (importDOM == null || handledConversions.has(importDOM)) {\n      return;\n    }\n    handledConversions.add(importDOM);\n    const map = importDOM.call(node.klass);\n    if (map !== null) {\n      addConversionsToCache(map);\n    }\n  });\n  if (additionalConversions) {\n    addConversionsToCache(additionalConversions);\n  }\n  return conversionCache;\n}\n\n/** @internal */\nfunction getTransformSetFromKlass(klass) {\n  const transforms = new Set();\n  const staticTransforms = new Set();\n  let currentKlass = klass;\n  while (currentKlass) {\n    const {\n      ownNodeConfig\n    } = getStaticNodeConfig(currentKlass);\n    const staticTransform = currentKlass.transform;\n    if (!staticTransforms.has(staticTransform)) {\n      staticTransforms.add(staticTransform);\n      const transform = currentKlass.transform();\n      if (transform) {\n        transforms.add(transform);\n      }\n    }\n    if (ownNodeConfig) {\n      const $transform = ownNodeConfig.$transform;\n      if ($transform) {\n        transforms.add($transform);\n      }\n      currentKlass = ownNodeConfig.extends;\n    } else {\n      const parent = Object.getPrototypeOf(currentKlass);\n      currentKlass = parent.prototype instanceof LexicalNode && parent !== LexicalNode ? parent : undefined;\n    }\n  }\n  return transforms;\n}\n\n/** @internal @experimental */\nconst DEFAULT_EDITOR_DOM_CONFIG = {\n  $createDOM: (node, editor) => node.createDOM(editor._config, editor),\n  $decorateDOM: (_node, _prevNode, _dom, _editor) => {},\n  $exportDOM: (node, editor) => {\n    const registeredNode = getRegisteredNode(editor, node.getType());\n    // Use HTMLConfig overrides, if available.\n    return registeredNode && registeredNode.exportDOM !== undefined ? registeredNode.exportDOM(editor, node) : node.exportDOM(editor);\n  },\n  $extractWithChild: (node, childNode, selection, destination, _editor) => $isElementNode(node) && node.extractWithChild(childNode, selection, destination),\n  $getDOMSlot: (node, dom, _editor) => {\n    if (!$isElementNode(node)) {\n      formatDevErrorMessage(`$getDOMSlot called on a non-ElementNode (key ${node.getKey()} type ${node.getType()})`);\n    }\n    return node.getDOMSlot(dom);\n  },\n  $shouldExclude: (node, _selection, _editor) => $isElementNode(node) && node.excludeFromCopy('html'),\n  $shouldInclude: (node, selection, _editor) => selection ? node.isSelected(selection) : true,\n  $updateDOM: (nextNode, prevNode, dom, editor) => nextNode.updateDOM(prevNode, dom, editor._config)\n};\n\n/**\n * Creates a new LexicalEditor attached to a single contentEditable (provided in the config). This is\n * the lowest-level initialization API for a LexicalEditor. If you're using React or another framework,\n * consider using the appropriate abstractions, such as LexicalComposer\n * @param editorConfig - the editor configuration.\n * @returns a LexicalEditor instance\n */\nfunction createEditor(editorConfig) {\n  const config = editorConfig || {};\n  const activeEditor = internalGetActiveEditor();\n  const theme = config.theme || {};\n  const parentEditor = editorConfig === undefined ? activeEditor : config.parentEditor || null;\n  const disableEvents = config.disableEvents || false;\n  const editorState = createEmptyEditorState();\n  const namespace = config.namespace || (parentEditor !== null ? parentEditor._config.namespace : createUID());\n  const initialEditorState = config.editorState;\n  const nodes = [RootNode, TextNode, LineBreakNode, TabNode, ParagraphNode, ArtificialNode__DO_NOT_USE, ...(config.nodes || [])];\n  const {\n    onError,\n    html\n  } = config;\n  const isEditable = config.editable !== undefined ? config.editable : true;\n  let registeredNodes;\n  if (editorConfig === undefined && activeEditor !== null) {\n    registeredNodes = activeEditor._nodes;\n  } else {\n    registeredNodes = new Map();\n    for (let i = 0; i < nodes.length; i++) {\n      let klass = nodes[i];\n      let replace = null;\n      let replaceWithKlass = null;\n      if (typeof klass !== 'function') {\n        const options = klass;\n        klass = options.replace;\n        replace = options.with;\n        replaceWithKlass = options.withKlass || null;\n      }\n      // For the side-effect of filling in the static methods\n      void getStaticNodeConfig(klass);\n\n      // Ensure custom nodes implement required methods and replaceWithKlass is instance of base klass.\n      {\n        // ArtificialNode__DO_NOT_USE can get renamed, so we use the type\n        const name = klass.name;\n        const nodeType = hasOwnStaticMethod(klass, 'getType') && klass.getType();\n        if (replaceWithKlass) {\n          if (!(replaceWithKlass.prototype instanceof klass)) {\n            formatDevErrorMessage(`${replaceWithKlass.name} doesn't extend the ${name}`);\n          }\n        } else if (replace) {\n          console.warn(`Override for ${name} specifies 'replace' without 'withKlass'. 'withKlass' will be required in a future version.`);\n        }\n        if (name !== 'RootNode' && nodeType !== 'root' && nodeType !== 'artificial' &&\n        // This is mostly for the unit test suite which\n        // uses LexicalNode in an otherwise incorrect way\n        // by mocking its static getType\n        klass !== LexicalNode) {\n          ['getType', 'clone'].forEach(method => {\n            if (!hasOwnStaticMethod(klass, method)) {\n              console.warn(`${name} must implement static \"${method}\" method`);\n            }\n          });\n          if (!hasOwnStaticMethod(klass, 'importDOM') && hasOwnExportDOM(klass)) {\n            console.warn(`${name} should implement \"importDOM\" if using a custom \"exportDOM\" method to ensure HTML serialization (important for copy & paste) works as expected`);\n          }\n          if (!hasOwnStaticMethod(klass, 'importJSON')) {\n            console.warn(`${name} should implement \"importJSON\" method to ensure JSON and default HTML serialization works as expected`);\n          }\n        }\n      }\n      const type = klass.getType();\n      const transforms = getTransformSetFromKlass(klass);\n      registeredNodes.set(type, {\n        exportDOM: html && html.export ? html.export.get(klass) : undefined,\n        klass,\n        replace,\n        replaceWithKlass,\n        sharedNodeState: createSharedNodeState(nodes[i]),\n        transforms\n      });\n    }\n  }\n  const editor = new LexicalEditor(editorState, parentEditor, registeredNodes, {\n    disableEvents,\n    dom: {\n      ...DEFAULT_EDITOR_DOM_CONFIG,\n      ...(editorConfig && editorConfig.dom)\n    },\n    namespace,\n    theme\n  }, onError ? onError : console.error, initializeConversionCache(registeredNodes, html ? html.import : undefined), isEditable, editorConfig);\n  if (initialEditorState !== undefined) {\n    editor._pendingEditorState = initialEditorState;\n    editor._dirtyType = FULL_RECONCILE;\n  }\n  registerDefaultCommandHandlers(editor);\n  return editor;\n}\nfunction triggerListener(listenerMap, listener, args) {\n  const unregister = listenerMap.get(listener);\n  if (unregister) {\n    unregister();\n  }\n  listenerMap.set(listener, listener(...args) || undefined);\n}\nfunction unregisterListener(listenerMap, listener) {\n  const unregister = listenerMap.get(listener);\n  listenerMap.delete(listener);\n  if (unregister) {\n    unregister();\n  }\n}\nfunction registerListener(listenerMap, listener, unregister) {\n  listenerMap.set(listener, unregister);\n  return unregisterListener.bind(null, listenerMap, listener);\n}\nclass LexicalEditor {\n  /** @internal */\n\n  /** The version with build identifiers for this editor (since 0.17.1) */\n  static version;\n\n  /** @internal */\n  _headless;\n  /** @internal */\n  _parentEditor;\n  /** @internal */\n  _rootElement;\n  /** @internal */\n  _editorState;\n  /** @internal */\n  _pendingEditorState;\n  /** @internal */\n  _compositionKey;\n  /** @internal */\n  _deferred;\n  /** @internal */\n  _keyToDOMMap;\n  /** @internal */\n  _updates;\n  /** @internal */\n  _updating;\n  /** @internal */\n  _listeners;\n  /** @internal */\n  _commands;\n  /** @internal */\n  _nodes;\n  /** @internal */\n  _decorators;\n  /** @internal */\n  _pendingDecorators;\n  /** @internal */\n  _config;\n  /** @internal */\n  _dirtyType;\n  /** @internal */\n  _cloneNotNeeded;\n  /** @internal */\n  _dirtyLeaves;\n  /** @internal */\n  _dirtyElements;\n  /** @internal */\n  _normalizedNodes;\n  /** @internal */\n  _updateTags;\n  /** @internal */\n  _observer;\n  /** @internal */\n  _key;\n  /** @internal */\n  _onError;\n  /** @internal */\n  _htmlConversions;\n  /** @internal */\n  _window;\n  /** @internal */\n  _editable;\n  /** @internal */\n  _blockCursorElement;\n  /** @internal */\n  _createEditorArgs;\n\n  /** @internal */\n  constructor(editorState, parentEditor, nodes, config, onError, htmlConversions, editable, createEditorArgs) {\n    this._createEditorArgs = createEditorArgs;\n    this._parentEditor = parentEditor;\n    // The root element associated with this editor\n    this._rootElement = null;\n    // The current editor state\n    this._editorState = editorState;\n    // Handling of drafts and updates\n    this._pendingEditorState = null;\n    // Used to help co-ordinate selection and events\n    this._compositionKey = null;\n    this._deferred = [];\n    // Used during reconciliation\n    this._keyToDOMMap = new Map();\n    this._updates = [];\n    this._updating = false;\n    // Listeners\n    this._listeners = {\n      decorator: new Map(),\n      editable: new Map(),\n      mutation: new Map(),\n      root: new Map(),\n      textcontent: new Map(),\n      update: new Map()\n    };\n    // Commands\n    this._commands = new Map();\n    // Editor configuration for theme/context.\n    this._config = config;\n    // Mapping of types to their nodes\n    this._nodes = nodes;\n    // React node decorators for portals\n    this._decorators = {};\n    this._pendingDecorators = null;\n    // Used to optimize reconciliation\n    this._dirtyType = NO_DIRTY_NODES;\n    this._cloneNotNeeded = new Set();\n    this._dirtyLeaves = new Set();\n    this._dirtyElements = new Map();\n    this._normalizedNodes = new Set();\n    this._updateTags = new Set();\n    // Handling of DOM mutations\n    this._observer = null;\n    // Used for identifying owning editors\n    this._key = createUID();\n    this._onError = onError;\n    this._htmlConversions = htmlConversions;\n    this._editable = editable;\n    this._headless = parentEditor !== null && parentEditor._headless;\n    this._window = null;\n    this._blockCursorElement = null;\n  }\n\n  /**\n   *\n   * @returns true if the editor is currently in \"composition\" mode due to receiving input\n   * through an IME, or 3P extension, for example. Returns false otherwise.\n   */\n  isComposing() {\n    return this._compositionKey != null;\n  }\n  /**\n   * Registers a listener for Editor update event. Will trigger the provided callback\n   * each time the editor goes through an update (via {@link LexicalEditor.update}) until the\n   * teardown function is called.\n   *\n   * @returns a teardown function that can be used to cleanup the listener.\n   */\n  registerUpdateListener(listener) {\n    return registerListener(this._listeners.update, listener);\n  }\n  /**\n   * Registers a listener for for when the editor changes between editable and non-editable states.\n   * Will trigger the provided callback each time the editor transitions between these states until the\n   * teardown function is called.\n   *\n   * If the listener returns a function, that function will be called before the next transition or\n   * teardown.\n   *\n   * @returns a teardown function that can be used to cleanup the listener.\n   */\n  registerEditableListener(listener) {\n    return registerListener(this._listeners.editable, listener);\n  }\n  /**\n   * Registers a listener for when the editor's decorator object changes. The decorator object contains\n   * all DecoratorNode keys -> their decorated value. This is primarily used with external UI frameworks.\n   *\n   * Will trigger the provided callback each time the editor transitions between these states until the\n   * teardown function is called.\n   *\n   * @returns a teardown function that can be used to cleanup the listener.\n   */\n  registerDecoratorListener(listener) {\n    return registerListener(this._listeners.decorator, listener);\n  }\n  /**\n   * Registers a listener for when Lexical commits an update to the DOM and the text content of\n   * the editor changes from the previous state of the editor. If the text content is the\n   * same between updates, no notifications to the listeners will happen.\n   *\n   * Will trigger the provided callback each time the editor transitions between these states until the\n   * teardown function is called.\n   *\n   * @returns a teardown function that can be used to cleanup the listener.\n   */\n  registerTextContentListener(listener) {\n    return registerListener(this._listeners.textcontent, listener);\n  }\n  /**\n   * Registers a listener for when the editor's root DOM element (the content editable\n   * Lexical attaches to) changes. This is primarily used to attach event listeners to the root\n   *  element. The root listener function is executed directly upon registration and then on\n   * any subsequent update.\n   *\n   * Will trigger the provided callback each time the editor transitions between these states until the\n   * teardown function is called.\n   *\n   * If the listener returns a function, that function will be called before the next transition or\n   * teardown.\n   *\n   * @returns a teardown function that can be used to cleanup the listener.\n   */\n  registerRootListener(listener) {\n    const listenerMap = this._listeners.root;\n    return mergeRegister(registerListener(listenerMap, listener, listener(this._rootElement, null) || undefined), () => triggerListener(listenerMap, listener, [null, this._rootElement]));\n  }\n  /**\n   * Registers a listener that will trigger anytime the provided command\n   * is dispatched with {@link LexicalEditor.dispatch}, subject to priority.\n   * Listeners that run at a higher priority can \"intercept\" commands and\n   * prevent them from propagating to other handlers by returning true.\n   *\n   * Listeners are always invoked in an {@link LexicalEditor.update} and can\n   * call dollar functions.\n   *\n   * Listeners registered at the same priority level will run\n   * deterministically in the order of registration.\n   *\n   * @param command - the command that will trigger the callback.\n   * @param listener - the function that will execute when the command is dispatched.\n   * @param priority - the relative priority of the listener. 0 | 1 | 2 | 3 | 4\n   *   (or {@link COMMAND_PRIORITY_EDITOR} |\n   *     {@link COMMAND_PRIORITY_LOW} |\n   *     {@link COMMAND_PRIORITY_NORMAL} |\n   *     {@link COMMAND_PRIORITY_HIGH} |\n   *     {@link COMMAND_PRIORITY_CRITICAL})\n   * @returns a teardown function that can be used to cleanup the listener.\n   */\n  registerCommand(command, listener, priority) {\n    if (priority === undefined) {\n      {\n        formatDevErrorMessage(`Listener for type \"command\" requires a \"priority\".`);\n      }\n    }\n    const commandsMap = this._commands;\n    if (!commandsMap.has(command)) {\n      commandsMap.set(command, [new DequeSet(), new DequeSet(), new DequeSet(), new DequeSet(), new DequeSet()]);\n    }\n    const listenersInPriorityOrder = commandsMap.get(command);\n    if (listenersInPriorityOrder === undefined) {\n      {\n        formatDevErrorMessage(`registerCommand: Command ${String(command)} not found in command map`);\n      }\n    }\n    const normalizedPriority = normalizePriority(priority);\n    const listeners = listenersInPriorityOrder[normalizedPriority];\n    if (normalizedPriority !== priority) {\n      listeners.addFront(listener);\n    } else {\n      listeners.addBack(listener);\n    }\n    return () => {\n      listeners.delete(listener);\n      if (listenersInPriorityOrder.every(listenersSet => listenersSet.size === 0)) {\n        commandsMap.delete(command);\n      }\n    };\n  }\n\n  /**\n   * Registers a listener that will run when a Lexical node of the provided class is\n   * mutated. The listener will receive a list of nodes along with the type of mutation\n   * that was performed on each: created, destroyed, or updated.\n   *\n   * One common use case for this is to attach DOM event listeners to the underlying DOM nodes as Lexical nodes are created.\n   * {@link LexicalEditor.getElementByKey} can be used for this.\n   *\n   * If any existing nodes are in the DOM, and skipInitialization is not true, the listener\n   * will be called immediately with an updateTag of 'registerMutationListener' where all\n   * nodes have the 'created' NodeMutation. This can be controlled with the skipInitialization option\n   * (whose default was previously true for backwards compatibility with &lt;=0.16.1 but has been changed to false as of 0.21.0).\n   *\n   * @param klass - The class of the node that you want to listen to mutations on.\n   * @param listener - The logic you want to run when the node is mutated.\n   * @param options - see {@link MutationListenerOptions}\n   * @returns a teardown function that can be used to cleanup the listener.\n   */\n  registerMutationListener(klass, listener, options) {\n    const klassToMutate = this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(klass)).klass;\n    const mutations = this._listeners.mutation;\n    let klassSet = mutations.get(listener);\n    if (klassSet === undefined) {\n      klassSet = new Set();\n      mutations.set(listener, klassSet);\n    }\n    klassSet.add(klassToMutate);\n    const skipInitialization = options && options.skipInitialization;\n    if (!(skipInitialization === undefined ? DEFAULT_SKIP_INITIALIZATION : skipInitialization)) {\n      this.initializeMutationListener(listener, klassToMutate);\n    }\n    return () => {\n      klassSet.delete(klassToMutate);\n      if (klassSet.size === 0) {\n        mutations.delete(listener);\n      }\n    };\n  }\n\n  /** @internal */\n  getRegisteredNode(klass) {\n    const registeredNode = this._nodes.get(klass.getType());\n    if (registeredNode === undefined) {\n      {\n        formatDevErrorMessage(`Node ${klass.name} has not been registered. Ensure node has been passed to createEditor.`);\n      }\n    }\n    return registeredNode;\n  }\n\n  /** @internal */\n  resolveRegisteredNodeAfterReplacements(registeredNode) {\n    while (registeredNode.replaceWithKlass) {\n      registeredNode = this.getRegisteredNode(registeredNode.replaceWithKlass);\n    }\n    return registeredNode;\n  }\n\n  /** @internal */\n  initializeMutationListener(listener, klass) {\n    const prevEditorState = this._editorState;\n    const nodeMap = getCachedTypeToNodeMap(prevEditorState).get(klass.getType());\n    if (!nodeMap) {\n      return;\n    }\n    const nodeMutationMap = new Map();\n    for (const k of nodeMap.keys()) {\n      nodeMutationMap.set(k, 'created');\n    }\n    if (nodeMutationMap.size > 0) {\n      listener(nodeMutationMap, {\n        dirtyLeaves: new Set(),\n        prevEditorState,\n        updateTags: new Set(['registerMutationListener'])\n      });\n    }\n  }\n\n  /** @internal */\n  registerNodeTransformToKlass(klass, listener) {\n    const registeredNode = this.getRegisteredNode(klass);\n    registeredNode.transforms.add(listener);\n    return registeredNode;\n  }\n\n  /**\n   * Registers a listener that will run when a Lexical node of the provided class is\n   * marked dirty during an update. The listener will continue to run as long as the node\n   * is marked dirty. There are no guarantees around the order of transform execution!\n   *\n   * Watch out for infinite loops. See [Node Transforms](https://lexical.dev/docs/concepts/transforms)\n   * @param klass - The class of the node that you want to run transforms on.\n   * @param listener - The logic you want to run when the node is updated.\n   * @returns a teardown function that can be used to cleanup the listener.\n   */\n  registerNodeTransform(klass, listener) {\n    const registeredNode = this.registerNodeTransformToKlass(klass, listener);\n    const registeredNodes = [registeredNode];\n    const replaceWithKlass = registeredNode.replaceWithKlass;\n    if (replaceWithKlass != null) {\n      const registeredReplaceWithNode = this.registerNodeTransformToKlass(replaceWithKlass, listener);\n      registeredNodes.push(registeredReplaceWithNode);\n    }\n    markNodesWithTypesAsDirty(this, registeredNodes.map(node => node.klass.getType()));\n    return () => {\n      registeredNodes.forEach(node => node.transforms.delete(listener));\n    };\n  }\n\n  /**\n   * Used to assert that a certain node is registered, usually by plugins to ensure nodes that they\n   * depend on have been registered.\n   * @returns True if the editor has registered the provided node type, false otherwise.\n   */\n  hasNode(node) {\n    return this._nodes.has(node.getType());\n  }\n\n  /**\n   * Used to assert that certain nodes are registered, usually by plugins to ensure nodes that they\n   * depend on have been registered.\n   * @returns True if the editor has registered all of the provided node types, false otherwise.\n   */\n  hasNodes(nodes) {\n    return nodes.every(this.hasNode.bind(this));\n  }\n\n  /**\n   * Dispatches a command of the specified type with the specified payload.\n   * This triggers all command listeners (set by {@link LexicalEditor.registerCommand})\n   * for this type, passing them the provided payload. The command listeners\n   * will be triggered in an implicit {@link LexicalEditor.update}, unless\n   * this was invoked from inside an update in which case that update context\n   * will be re-used (as if this was a dollar function itself).\n   * @param type - the type of command listeners to trigger.\n   * @param payload - the data to pass as an argument to the command listeners.\n   */\n  dispatchCommand(type, payload) {\n    return dispatchCommand(this, type, payload);\n  }\n\n  /**\n   * Gets a map of all decorators in the editor.\n   * @returns A mapping of call decorator keys to their decorated content\n   */\n  getDecorators() {\n    return this._decorators;\n  }\n\n  /**\n   *\n   * @returns the current root element of the editor. If you want to register\n   * an event listener, do it via {@link LexicalEditor.registerRootListener}, since\n   * this reference may not be stable.\n   */\n  getRootElement() {\n    return this._rootElement;\n  }\n\n  /**\n   * Gets the key of the editor\n   * @returns The editor key\n   */\n  getKey() {\n    return this._key;\n  }\n\n  /**\n   * Imperatively set the root contenteditable element that Lexical listens\n   * for events on.\n   */\n  setRootElement(nextRootElement) {\n    const prevRootElement = this._rootElement;\n    if (nextRootElement !== prevRootElement) {\n      const classNames = getCachedClassNameArray(this._config.theme, 'root');\n      const pendingEditorState = this._pendingEditorState || this._editorState;\n      this._rootElement = nextRootElement;\n      resetEditor(this, prevRootElement, nextRootElement, pendingEditorState);\n      if (prevRootElement !== null) {\n        // TODO: remove this flag once we no longer use UEv2 internally\n        if (!this._config.disableEvents) {\n          removeRootElementEvents(prevRootElement);\n        }\n        if (classNames != null) {\n          prevRootElement.classList.remove(...classNames);\n        }\n      }\n      if (nextRootElement !== null) {\n        const windowObj = getDefaultView(nextRootElement);\n        const style = nextRootElement.style;\n        style.userSelect = 'text';\n        style.whiteSpace = 'pre-wrap';\n        style.wordBreak = 'break-word';\n        nextRootElement.setAttribute('data-lexical-editor', 'true');\n        this._window = windowObj;\n        this._dirtyType = FULL_RECONCILE;\n        initMutationObserver(this);\n        this._updateTags.add(HISTORY_MERGE_TAG);\n        $commitPendingUpdates(this);\n\n        // TODO: remove this flag once we no longer use UEv2 internally\n        if (!this._config.disableEvents) {\n          addRootElementEvents(nextRootElement, this);\n        }\n        if (classNames != null) {\n          nextRootElement.classList.add(...classNames);\n        }\n        {\n          const nextRootElementParent = nextRootElement.parentElement;\n          if (nextRootElementParent != null && ['flex', 'inline-flex'].includes(getComputedStyle(nextRootElementParent).display)) {\n            console.warn(`When using \"display: flex\" or \"display: inline-flex\" on an element containing content editable, Chrome may have unwanted focusing behavior when clicking outside of it. Consider wrapping the content editable within a non-flex element.`);\n          }\n        }\n      } else {\n        // When the content editable is unmounted we will still trigger a\n        // reconciliation so that any pending updates are flushed,\n        // to match the previous state change when\n        // `_editorState = pendingEditorState` was used, but by\n        // using a commit we preserve the readOnly invariant\n        // for editor.getEditorState().\n        this._window = null;\n        this._updateTags.add(HISTORY_MERGE_TAG);\n        $commitPendingUpdates(this);\n      }\n      triggerListeners('root', this, false, nextRootElement, prevRootElement);\n    }\n  }\n\n  /**\n   * Gets the underlying HTMLElement associated with the LexicalNode for the given key.\n   * @returns the HTMLElement rendered by the LexicalNode associated with the key.\n   * @param key - the key of the LexicalNode.\n   */\n  getElementByKey(key) {\n    return this._keyToDOMMap.get(key) || null;\n  }\n\n  /**\n   * Gets the active editor state.\n   * @returns The editor state\n   */\n  getEditorState() {\n    return this._editorState;\n  }\n\n  /**\n   * Imperatively set the EditorState. Triggers reconciliation like an update.\n   * @param editorState - the state to set the editor\n   * @param options - options for the update.\n   */\n  setEditorState(editorState, options) {\n    if (editorState.isEmpty()) {\n      {\n        formatDevErrorMessage(`setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.`);\n      }\n    }\n\n    // Ensure that we have a writable EditorState so that transforms can run\n    // during a historic operation\n    let writableEditorState = editorState;\n    if (writableEditorState._readOnly) {\n      writableEditorState = cloneEditorState(editorState);\n      writableEditorState._selection = editorState._selection ? editorState._selection.clone() : null;\n    }\n    flushRootMutations(this);\n    const pendingEditorState = this._pendingEditorState;\n    const tags = this._updateTags;\n    const tag = options !== undefined ? options.tag : null;\n    if (pendingEditorState !== null && !pendingEditorState.isEmpty()) {\n      if (tag != null) {\n        tags.add(tag);\n      }\n      $commitPendingUpdates(this);\n    }\n    this._pendingEditorState = writableEditorState;\n    this._dirtyType = FULL_RECONCILE;\n    this._dirtyElements.set('root', false);\n    this._compositionKey = null;\n    if (tag != null) {\n      tags.add(tag);\n    }\n\n    // Only commit pending updates if not already in an editor.update\n    // (e.g. dispatchCommand) otherwise this will cause a second commit\n    // with an already read-only state and selection\n    if (!this._updating) {\n      $commitPendingUpdates(this);\n    }\n  }\n\n  /**\n   * Parses a SerializedEditorState (usually produced by {@link EditorState.toJSON}) and returns\n   * and EditorState object that can be, for example, passed to {@link LexicalEditor.setEditorState}. Typically,\n   * deserialization from JSON stored in a database uses this method.\n   * @param maybeStringifiedEditorState\n   * @param updateFn\n   * @returns\n   */\n  parseEditorState(maybeStringifiedEditorState, updateFn) {\n    const serializedEditorState = typeof maybeStringifiedEditorState === 'string' ? JSON.parse(maybeStringifiedEditorState) : maybeStringifiedEditorState;\n    return parseEditorState(serializedEditorState, this, updateFn);\n  }\n\n  /**\n   * Executes a read of the editor's state, with the\n   * editor context available (useful for exporting and read-only DOM\n   * operations). Much like update, but prevents any mutation of the\n   * editor's state. Any pending updates will be flushed immediately before\n   * the read.\n   * @param callbackFn - A function that has access to read-only editor state.\n   */\n  read(callbackFn) {\n    $commitPendingUpdates(this);\n    return this.getEditorState().read(callbackFn, {\n      editor: this\n    });\n  }\n\n  /**\n   * Executes an update to the editor state. The updateFn callback is the ONLY place\n   * where Lexical editor state can be safely mutated.\n   * @param updateFn - A function that has access to writable editor state.\n   * @param options - A bag of options to control the behavior of the update.\n   */\n  update(updateFn, options) {\n    updateEditor(this, updateFn, options);\n  }\n\n  /**\n   * Focuses the editor by marking the existing selection as dirty, or by\n   * creating a new selection at `defaultSelection` if one does not already\n   * exist. If you want to force a specific selection, you should call\n   * `root.selectStart()` or `root.selectEnd()` in an update.\n   *\n   * @param callbackFn - A function to run after the editor is focused.\n   * @param options - A bag of options\n   */\n  focus(callbackFn, options = {}) {\n    const rootElement = this._rootElement;\n    if (rootElement !== null) {\n      // This ensures that iOS does not trigger caps lock upon focus\n      rootElement.setAttribute('autocapitalize', 'off');\n      updateEditorSync(this, () => {\n        const selection = $getSelection();\n        const root = $getRoot();\n        if (selection !== null) {\n          // Marking the selection dirty will force the selection back to it\n          if (!selection.dirty) {\n            $setSelection(selection.clone());\n          }\n        } else if (root.getChildrenSize() !== 0) {\n          if (options.defaultSelection === 'rootStart') {\n            root.selectStart();\n          } else {\n            root.selectEnd();\n          }\n        }\n        $addUpdateTag(FOCUS_TAG);\n        $onUpdate(() => {\n          rootElement.removeAttribute('autocapitalize');\n          if (callbackFn) {\n            callbackFn();\n          }\n        });\n      });\n      // In the case where onUpdate doesn't fire (due to the focus update not\n      // occurring).\n      if (this._pendingEditorState === null) {\n        rootElement.removeAttribute('autocapitalize');\n      }\n    }\n  }\n\n  /**\n   * Removes focus from the editor.\n   */\n  blur() {\n    const rootElement = this._rootElement;\n    if (rootElement !== null) {\n      rootElement.blur();\n    }\n    const domSelection = getDOMSelection(this._window);\n    if (domSelection !== null) {\n      domSelection.removeAllRanges();\n    }\n  }\n  /**\n   * Returns true if the editor is editable, false otherwise.\n   * @returns True if the editor is editable, false otherwise.\n   */\n  isEditable() {\n    return this._editable;\n  }\n  /**\n   * Sets the editable property of the editor. When false, the\n   * editor will not listen for user events on the underling contenteditable.\n   * @param editable - the value to set the editable mode to.\n   */\n  setEditable(editable) {\n    if (this._editable !== editable) {\n      this._editable = editable;\n      triggerListeners('editable', this, true, editable);\n    }\n  }\n  /**\n   * Returns a JSON-serializable javascript object NOT a JSON string.\n   * You still must call JSON.stringify (or something else) to turn the\n   * state into a string you can transfer over the wire and store in a database.\n   *\n   * See {@link LexicalNode.exportJSON}\n   *\n   * @returns A JSON-serializable javascript object\n   */\n  toJSON() {\n    return {\n      editorState: this._editorState.toJSON()\n    };\n  }\n}\nLexicalEditor.version = \"0.44.0+dev.esm\";\n\nlet pendingNodeToClone = null;\nfunction setPendingNodeToClone(pendingNode) {\n  pendingNodeToClone = pendingNode;\n}\nfunction getPendingNodeToClone() {\n  const node = pendingNodeToClone;\n  pendingNodeToClone = null;\n  return node;\n}\nlet keyCounter = 1;\nfunction resetRandomKey() {\n  keyCounter = 1;\n}\nfunction generateRandomKey() {\n  return '' + keyCounter++;\n}\n\n/**\n * @internal\n */\nfunction getRegisteredNodeOrThrow(editor, nodeType) {\n  const registeredNode = getRegisteredNode(editor, nodeType);\n  if (registeredNode === undefined) {\n    {\n      formatDevErrorMessage(`registeredNode: Type ${nodeType} not found`);\n    }\n  }\n  return registeredNode;\n}\n\n/**\n * @internal\n */\nfunction getRegisteredNode(editor, nodeType) {\n  return editor._nodes.get(nodeType);\n}\n\n/** @internal */\nconst scheduleMicroTask = typeof queueMicrotask === 'function' ? queueMicrotask : fn => {\n  // No window prefix intended (#1400)\n  Promise.resolve().then(fn);\n};\nfunction $isSelectionCapturedInDecorator(node) {\n  return $isDecoratorNode($getNearestNodeFromDOMNode(node));\n}\nfunction isSelectionCapturedInDecoratorInput(anchorDOM) {\n  const activeElement = document.activeElement;\n  if (!isHTMLElement(activeElement)) {\n    return false;\n  }\n  const nodeName = activeElement.nodeName;\n  return $isDecoratorNode($getNearestNodeFromDOMNode(anchorDOM)) && (nodeName === 'INPUT' || nodeName === 'TEXTAREA' || activeElement.contentEditable === 'true' && getEditorPropertyFromDOMNode(activeElement) == null);\n}\nfunction isSelectionWithinEditor(editor, anchorDOM, focusDOM) {\n  const rootElement = editor.getRootElement();\n  try {\n    return rootElement !== null && rootElement.contains(anchorDOM) && rootElement.contains(focusDOM) &&\n    // Ignore if selection is within nested editor\n    anchorDOM !== null && !isSelectionCapturedInDecoratorInput(anchorDOM) && getNearestEditorFromDOMNode(anchorDOM) === editor;\n  } catch (_error) {\n    return false;\n  }\n}\n\n/**\n * @returns true if the given argument is a LexicalEditor instance from this build of Lexical\n */\nfunction isLexicalEditor(editor) {\n  // Check instanceof to prevent issues with multiple embedded Lexical installations\n  return editor instanceof LexicalEditor;\n}\nfunction getNearestEditorFromDOMNode(node) {\n  let currentNode = node;\n  while (currentNode != null) {\n    const editor = getEditorPropertyFromDOMNode(currentNode);\n    if (isLexicalEditor(editor)) {\n      return editor;\n    }\n    currentNode = getParentElement(currentNode);\n  }\n  return null;\n}\n\n/** @internal */\nfunction getEditorPropertyFromDOMNode(node) {\n  // @ts-expect-error: internal field\n  return node ? node.__lexicalEditor : null;\n}\nfunction getTextDirection(text) {\n  if (RTL_REGEX.test(text)) {\n    return 'rtl';\n  }\n  if (LTR_REGEX.test(text)) {\n    return 'ltr';\n  }\n  return null;\n}\n\n/**\n * Return true if the TextNode is a TabNode or is in token mode.\n */\nfunction $isTokenOrTab(node) {\n  return $isTabNode(node) || node.isToken();\n}\n\n/**\n * Return true if the TextNode is a TabNode, or is in token or segmented mode.\n */\nfunction $isTokenOrSegmented(node) {\n  return $isTokenOrTab(node) || node.isSegmented();\n}\n\n/**\n * @param node - The element being tested\n * @returns Returns true if node is an DOM Text node, false otherwise.\n */\nfunction isDOMTextNode(node) {\n  return isDOMNode(node) && node.nodeType === DOM_TEXT_TYPE;\n}\n\n/**\n * @param node - The element being tested\n * @returns Returns true if node is an DOM Document node, false otherwise.\n */\nfunction isDOMDocumentNode(node) {\n  return isDOMNode(node) && node.nodeType === DOM_DOCUMENT_TYPE;\n}\nfunction getDOMTextNode(element) {\n  let node = element;\n  while (node != null) {\n    if (isDOMTextNode(node)) {\n      return node;\n    }\n    node = node.firstChild;\n  }\n  return null;\n}\nfunction toggleTextFormatType(format, type, alignWithFormat) {\n  const activeFormat = TEXT_TYPE_TO_FORMAT[type];\n  if (alignWithFormat !== null && (format & activeFormat) === (alignWithFormat & activeFormat)) {\n    return format;\n  }\n  let newFormat = format ^ activeFormat;\n  if (type === 'subscript') {\n    newFormat &= ~TEXT_TYPE_TO_FORMAT.superscript;\n  } else if (type === 'superscript') {\n    newFormat &= ~TEXT_TYPE_TO_FORMAT.subscript;\n  } else if (type === 'lowercase') {\n    newFormat &= ~TEXT_TYPE_TO_FORMAT.uppercase;\n    newFormat &= ~TEXT_TYPE_TO_FORMAT.capitalize;\n  } else if (type === 'uppercase') {\n    newFormat &= ~TEXT_TYPE_TO_FORMAT.lowercase;\n    newFormat &= ~TEXT_TYPE_TO_FORMAT.capitalize;\n  } else if (type === 'capitalize') {\n    newFormat &= ~TEXT_TYPE_TO_FORMAT.lowercase;\n    newFormat &= ~TEXT_TYPE_TO_FORMAT.uppercase;\n  }\n  return newFormat;\n}\nfunction $isLeafNode(node) {\n  return $isTextNode(node) || $isLineBreakNode(node) || $isDecoratorNode(node);\n}\nfunction $setNodeKey(node, existingKey) {\n  const pendingNode = getPendingNodeToClone();\n  existingKey = existingKey || pendingNode && pendingNode.__key;\n  if (existingKey != null) {\n    {\n      errorOnNodeKeyConstructorMismatch(node, existingKey, pendingNode);\n    }\n    node.__key = existingKey;\n    return;\n  }\n  errorOnReadOnly();\n  errorOnInfiniteTransforms();\n  const editor = getActiveEditor();\n  const editorState = getActiveEditorState();\n  const key = generateRandomKey();\n  editorState._nodeMap.set(key, node);\n  // TODO Split this function into leaf/element\n  if ($isElementNode(node)) {\n    editor._dirtyElements.set(key, true);\n  } else {\n    editor._dirtyLeaves.add(key);\n  }\n  editor._cloneNotNeeded.add(key);\n  editor._dirtyType = HAS_DIRTY_NODES;\n  node.__key = key;\n}\nfunction errorOnNodeKeyConstructorMismatch(node, existingKey, pendingNode) {\n  const editorState = internalGetActiveEditorState();\n  if (!editorState) {\n    // tests expect to be able to do this kind of clone without an active editor state\n    return;\n  }\n  const existingNode = editorState._nodeMap.get(existingKey);\n  if (pendingNode) {\n    if (!(existingKey === pendingNode.__key)) {\n      formatDevErrorMessage(`Lexical node with constructor ${node.constructor.name} (type ${node.getType()}) has an incorrect clone implementation, got ${String(existingKey)} for nodeKey when expecting ${pendingNode.__key}`);\n    }\n  }\n  if (existingNode && existingNode.constructor !== node.constructor) {\n    // Lifted condition to if statement because the inverted logic is a bit confusing\n    if (node.constructor.name !== existingNode.constructor.name) {\n      {\n        formatDevErrorMessage(`Lexical node with constructor ${node.constructor.name} attempted to re-use key from node in active editor state with constructor ${existingNode.constructor.name}. Keys must not be re-used when the type is changed.`);\n      }\n    } else {\n      {\n        formatDevErrorMessage(`Lexical node with constructor ${node.constructor.name} attempted to re-use key from node in active editor state with different constructor with the same name (possibly due to invalid Hot Module Replacement). Keys must not be re-used when the type is changed.`);\n      }\n    }\n  }\n}\nfunction internalMarkParentElementsAsDirty(parentKey, nodeMap, dirtyElements) {\n  let nextParentKey = parentKey;\n  while (nextParentKey !== null) {\n    if (dirtyElements.has(nextParentKey)) {\n      return;\n    }\n    const node = nodeMap.get(nextParentKey);\n    if (node === undefined) {\n      break;\n    }\n    dirtyElements.set(nextParentKey, false);\n    nextParentKey = node.__parent;\n  }\n}\n\n// TODO #6031 this function or their callers have to adjust selection (i.e. insertBefore)\n/**\n * Removes a node from its parent, updating all necessary pointers and links.\n * @internal\n *\n * This function is for internal use of the library.\n * Please do not use it as it may change in the future.\n */\nfunction removeFromParent(node) {\n  const oldParent = node.getParent();\n  if (oldParent !== null) {\n    const writableNode = node.getWritable();\n    const writableParent = oldParent.getWritable();\n    const prevSibling = node.getPreviousSibling();\n    const nextSibling = node.getNextSibling();\n\n    // Store sibling keys\n    const nextSiblingKey = nextSibling !== null ? nextSibling.__key : null;\n    const prevSiblingKey = prevSibling !== null ? prevSibling.__key : null;\n\n    // Get writable siblings once\n    const writablePrevSibling = prevSibling !== null ? prevSibling.getWritable() : null;\n    const writableNextSibling = nextSibling !== null ? nextSibling.getWritable() : null;\n\n    // Update parent's first/last pointers\n    if (prevSibling === null) {\n      writableParent.__first = nextSiblingKey;\n    }\n    if (nextSibling === null) {\n      writableParent.__last = prevSiblingKey;\n    }\n\n    // Update sibling links\n    if (writablePrevSibling !== null) {\n      writablePrevSibling.__next = nextSiblingKey;\n    }\n    if (writableNextSibling !== null) {\n      writableNextSibling.__prev = prevSiblingKey;\n    }\n\n    // Clear node's links\n    writableNode.__prev = null;\n    writableNode.__next = null;\n    writableNode.__parent = null;\n\n    // Update parent size\n    writableParent.__size--;\n  }\n}\n\n// Never use this function directly! It will break\n// the cloning heuristic. Instead use node.getWritable().\nfunction internalMarkNodeAsDirty(node) {\n  errorOnInfiniteTransforms();\n  if (!!$isEphemeral(node)) {\n    formatDevErrorMessage(`internalMarkNodeAsDirty: Ephemeral nodes must not be marked as dirty (key ${node.__key} type ${node.__type})`);\n  }\n  const latest = node.getLatest();\n  const parent = latest.__parent;\n  const editorState = getActiveEditorState();\n  const editor = getActiveEditor();\n  const nodeMap = editorState._nodeMap;\n  const dirtyElements = editor._dirtyElements;\n  if (parent !== null) {\n    internalMarkParentElementsAsDirty(parent, nodeMap, dirtyElements);\n  }\n  const key = latest.__key;\n  editor._dirtyType = HAS_DIRTY_NODES;\n  if ($isElementNode(node)) {\n    dirtyElements.set(key, true);\n  } else {\n    editor._dirtyLeaves.add(key);\n  }\n}\nfunction internalMarkSiblingsAsDirty(node) {\n  const previousNode = node.getPreviousSibling();\n  const nextNode = node.getNextSibling();\n  if (previousNode !== null) {\n    internalMarkNodeAsDirty(previousNode);\n  }\n  if (nextNode !== null) {\n    internalMarkNodeAsDirty(nextNode);\n  }\n}\nfunction $setCompositionKey(compositionKey) {\n  errorOnReadOnly();\n  const editor = getActiveEditor();\n  const previousCompositionKey = editor._compositionKey;\n  if (compositionKey !== previousCompositionKey) {\n    editor._compositionKey = compositionKey;\n    if (previousCompositionKey !== null) {\n      const node = $getNodeByKey(previousCompositionKey);\n      if (node !== null) {\n        node.getWritable();\n      }\n    }\n    if (compositionKey !== null) {\n      const node = $getNodeByKey(compositionKey);\n      if (node !== null) {\n        node.getWritable();\n      }\n    }\n  }\n}\nfunction $getCompositionKey() {\n  if (isCurrentlyReadOnlyMode()) {\n    return null;\n  }\n  const editor = getActiveEditor();\n  return editor._compositionKey;\n}\nfunction $getNodeByKey(key, _editorState) {\n  const editorState = _editorState || getActiveEditorState();\n  const node = editorState._nodeMap.get(key);\n  if (node === undefined) {\n    return null;\n  }\n  return node;\n}\nfunction $getNodeFromDOMNode(dom, editorState) {\n  const editor = getActiveEditor();\n  const key = getNodeKeyFromDOMNode(dom, editor);\n  if (key !== undefined) {\n    return $getNodeByKey(key, editorState);\n  }\n  return null;\n}\nfunction setNodeKeyOnDOMNode(dom, editor, key) {\n  const prop = `__lexicalKey_${editor._key}`;\n  dom[prop] = key;\n}\nfunction getNodeKeyFromDOMNode(dom, editor) {\n  const prop = `__lexicalKey_${editor._key}`;\n  return dom[prop];\n}\nfunction $getNearestNodeFromDOMNode(startingDOM, editorState) {\n  let dom = startingDOM;\n  while (dom != null) {\n    const node = $getNodeFromDOMNode(dom, editorState);\n    if (node !== null) {\n      return node;\n    }\n    dom = getParentElement(dom);\n  }\n  return null;\n}\nfunction cloneDecorators(editor) {\n  const currentDecorators = editor._decorators;\n  const pendingDecorators = Object.assign({}, currentDecorators);\n  editor._pendingDecorators = pendingDecorators;\n  return pendingDecorators;\n}\nfunction getEditorStateTextContent(editorState) {\n  return editorState.read(() => $getRoot().getTextContent());\n}\nfunction markNodesWithTypesAsDirty(editor, types) {\n  // We only need to mark nodes dirty if they were in the previous state.\n  // If they aren't, then they are by definition dirty already.\n  const cachedMap = getCachedTypeToNodeMap(editor.getEditorState());\n  const dirtyNodeMaps = [];\n  for (const type of types) {\n    const nodeMap = cachedMap.get(type);\n    if (nodeMap) {\n      // By construction these are non-empty\n      dirtyNodeMaps.push(nodeMap);\n    }\n  }\n  // Nothing to mark dirty, no update necessary\n  if (dirtyNodeMaps.length === 0) {\n    return;\n  }\n  editor.update(() => {\n    for (const nodeMap of dirtyNodeMaps) {\n      for (const nodeKey of nodeMap.keys()) {\n        // We are only concerned with nodes that are still in the latest NodeMap,\n        // if they no longer exist then markDirty would raise an exception\n        const latest = $getNodeByKey(nodeKey);\n        if (latest) {\n          latest.markDirty();\n        }\n      }\n    }\n  }, editor._pendingEditorState === null ? {\n    tag: HISTORY_MERGE_TAG\n  } : undefined);\n}\nfunction $getRoot() {\n  return internalGetRoot(getActiveEditorState());\n}\nfunction internalGetRoot(editorState) {\n  return editorState._nodeMap.get('root');\n}\nfunction $setSelection(selection) {\n  errorOnReadOnly();\n  const editorState = getActiveEditorState();\n  if (selection !== null) {\n    {\n      if (Object.isFrozen(selection)) {\n        {\n          formatDevErrorMessage(`$setSelection called on frozen selection object. Ensure selection is cloned before passing in.`);\n        }\n      }\n    }\n    selection.dirty = true;\n    selection.setCachedNodes(null);\n  }\n  editorState._selection = selection;\n}\nfunction $flushMutations() {\n  errorOnReadOnly();\n  const editor = getActiveEditor();\n  flushRootMutations(editor);\n}\nfunction $getNodeFromDOM(dom) {\n  const editor = getActiveEditor();\n  const nodeKey = getNodeKeyFromDOMTree(dom, editor);\n  if (nodeKey === null) {\n    const rootElement = editor.getRootElement();\n    if (dom === rootElement) {\n      return $getNodeByKey('root');\n    }\n    return null;\n  }\n  return $getNodeByKey(nodeKey);\n}\nfunction getNodeKeyFromDOMTree(\n// Note that node here refers to a DOM Node, not an Lexical Node\ndom, editor) {\n  let node = dom;\n  while (node != null) {\n    const key = getNodeKeyFromDOMNode(node, editor);\n    if (key !== undefined) {\n      return key;\n    }\n    node = getParentElement(node);\n  }\n  return null;\n}\n\n/**\n * Return true if `str` contains any valid surrogate pair.\n *\n * See also $updateCaretSelectionForUnicodeCharacter for\n * a discussion on when and why this is useful.\n */\nfunction doesContainSurrogatePair(str) {\n  return /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g.test(str);\n}\nfunction getEditorsToPropagate(editor) {\n  const editorsToPropagate = [];\n  for (let currentEditor = editor; currentEditor !== null; currentEditor = currentEditor._parentEditor) {\n    editorsToPropagate.push(currentEditor);\n  }\n  return editorsToPropagate;\n}\nfunction createUID() {\n  return Math.random().toString(36).replace(/[^a-z]+/g, '').substring(0, 5);\n}\nfunction getAnchorTextFromDOM(anchorNode) {\n  return isDOMTextNode(anchorNode) ? anchorNode.nodeValue : null;\n}\nfunction $updateSelectedTextFromDOM(isCompositionEnd, editor, data) {\n  // Update the text content with the latest composition text\n  const domSelection = getDOMSelection(getWindow(editor));\n  if (domSelection === null) {\n    return;\n  }\n  const anchorNode = domSelection.anchorNode;\n  let {\n    anchorOffset,\n    focusOffset\n  } = domSelection;\n  if (anchorNode !== null) {\n    let textContent = getAnchorTextFromDOM(anchorNode);\n    const node = $getNearestNodeFromDOMNode(anchorNode);\n    if (textContent !== null && $isTextNode(node)) {\n      // Data is intentionally truthy, as we check for boolean, null and empty string.\n      if ((textContent === COMPOSITION_SUFFIX || textContent === COMPOSITION_START_CHAR) && data) {\n        const offset = data.length;\n        textContent = data;\n        anchorOffset = offset;\n        focusOffset = offset;\n      }\n      if (textContent !== null) {\n        $updateTextNodeFromDOMContent(node, textContent, anchorOffset, focusOffset, isCompositionEnd);\n      }\n    }\n  }\n}\nfunction $updateTextNodeFromDOMContent(textNode, textContent, anchorOffset, focusOffset, compositionEnd) {\n  let node = textNode;\n  if (node.isAttached() && (compositionEnd || !node.isDirty())) {\n    const isComposing = node.isComposing();\n    let normalizedTextContent = textContent;\n    if (isComposing || compositionEnd) {\n      if (textContent.endsWith(COMPOSITION_SUFFIX)) {\n        normalizedTextContent = textContent.slice(0, -COMPOSITION_SUFFIX.length);\n      }\n      if (compositionEnd) {\n        const char = COMPOSITION_START_CHAR;\n        let index;\n        while ((index = normalizedTextContent.indexOf(char)) !== -1) {\n          normalizedTextContent = normalizedTextContent.slice(0, index) + normalizedTextContent.slice(index + char.length);\n          if (anchorOffset !== null && anchorOffset > index) {\n            anchorOffset = Math.max(index, anchorOffset - char.length);\n          }\n          if (focusOffset !== null && focusOffset > index) {\n            focusOffset = Math.max(index, focusOffset - char.length);\n          }\n        }\n      }\n    }\n    const prevTextContent = node.getTextContent();\n    if (compositionEnd || normalizedTextContent !== prevTextContent) {\n      if (normalizedTextContent === '') {\n        $setCompositionKey(null);\n        if (!IS_SAFARI && !IS_IOS && !IS_APPLE_WEBKIT) {\n          // For composition (mainly Android), we have to remove the node on a later update\n          const editor = getActiveEditor();\n          setTimeout(() => {\n            editor.update(() => {\n              if (node.isAttached()) {\n                node.remove();\n              }\n            });\n          }, 20);\n        } else {\n          node.remove();\n        }\n        return;\n      }\n      const parent = node.getParent();\n      const prevSelection = $getPreviousSelection();\n      const prevTextContentSize = node.getTextContentSize();\n      const compositionKey = $getCompositionKey();\n      const nodeKey = node.getKey();\n      if (node.isToken() || compositionKey !== null && nodeKey === compositionKey && !isComposing ||\n      // Check if character was added at the start or boundaries when not insertable, and we need\n      // to clear this input from occurring as that action wasn't permitted.\n      $isRangeSelection(prevSelection) && (parent !== null && !parent.canInsertTextBefore() && prevSelection.anchor.offset === 0 || prevSelection.anchor.key === textNode.__key && prevSelection.anchor.offset === 0 && !node.canInsertTextBefore() && !isComposing || prevSelection.focus.key === textNode.__key && prevSelection.focus.offset === prevTextContentSize && !node.canInsertTextAfter() && !isComposing)) {\n        node.markDirty();\n        return;\n      }\n      const selection = $getSelection();\n      if (!$isRangeSelection(selection) || anchorOffset === null || focusOffset === null) {\n        $setTextContentWithSelection(node, normalizedTextContent, selection);\n        return;\n      }\n      selection.setTextNodeRange(node, anchorOffset, node, focusOffset);\n      if (node.isSegmented()) {\n        const originalTextContent = node.getTextContent();\n        const replacement = $createTextNode(originalTextContent);\n        node.replace(replacement);\n        node = replacement;\n      }\n      $setTextContentWithSelection(node, normalizedTextContent, selection);\n    }\n  }\n}\nfunction $setTextContentWithSelection(node, textContent, selection) {\n  node.setTextContent(textContent);\n  if ($isRangeSelection(selection)) {\n    const key = node.getKey();\n    for (const k of ['anchor', 'focus']) {\n      const pt = selection[k];\n      if (pt.type === 'text' && pt.key === key) {\n        pt.offset = $getTextNodeOffset(node, pt.offset, 'clamp');\n      }\n    }\n  }\n}\nfunction $previousSiblingDoesNotAcceptText(node) {\n  const previousSibling = node.getPreviousSibling();\n  return ($isTextNode(previousSibling) || $isElementNode(previousSibling) && previousSibling.isInline()) && !previousSibling.canInsertTextAfter();\n}\n\n// This function is connected to $shouldPreventDefaultAndInsertText and determines whether the\n// TextNode boundaries are writable or we should use the previous/next sibling instead. For example,\n// in the case of a LinkNode, boundaries are not writable.\nfunction $shouldInsertTextAfterOrBeforeTextNode(selection, node) {\n  if (node.isSegmented()) {\n    return true;\n  }\n  if (!selection.isCollapsed()) {\n    return false;\n  }\n  const offset = selection.anchor.offset;\n  const parent = node.getParentOrThrow();\n  const isToken = $isTokenOrTab(node);\n  if (offset === 0) {\n    return !node.canInsertTextBefore() || !parent.canInsertTextBefore() && !node.isComposing() || isToken || $previousSiblingDoesNotAcceptText(node);\n  } else if (offset === node.getTextContentSize()) {\n    return !node.canInsertTextAfter() || !parent.canInsertTextAfter() && !node.isComposing() || isToken;\n  } else {\n    return false;\n  }\n}\n\n/**\n * A KeyboardEvent or structurally similar object with a string `key` as well\n * as `altKey`, `ctrlKey`, `metaKey`, and `shiftKey` boolean properties.\n */\n\n/**\n * A record of keyboard modifiers that must be enabled.\n * If the value is `'any'` then the modifier key's state is ignored.\n * If the value is `true` then the modifier key must be pressed.\n * If the value is `false` or the property is omitted then the modifier key must\n * not be pressed.\n */\n\nfunction matchModifier(event, mask, prop) {\n  const expected = mask[prop] || false;\n  return expected === 'any' || expected === event[prop];\n}\n\n/**\n * Match a KeyboardEvent with its expected modifier state\n *\n * @param event A KeyboardEvent, or structurally similar object\n * @param mask An object specifying the expected state of the modifiers\n * @returns true if the event matches\n */\nfunction isModifierMatch(event, mask) {\n  return matchModifier(event, mask, 'altKey') && matchModifier(event, mask, 'ctrlKey') && matchModifier(event, mask, 'shiftKey') && matchModifier(event, mask, 'metaKey');\n}\n\n/**\n * Match a KeyboardEvent with its expected state\n *\n * @param event A KeyboardEvent, or structurally similar object\n * @param expectedKey The string to compare with event.key (case insensitive)\n * @param mask An object specifying the expected state of the modifiers\n * @returns true if the event matches\n */\nfunction isExactShortcutMatch(event, expectedKey, mask) {\n  if (!isModifierMatch(event, mask)) {\n    return false;\n  }\n  if (event.key.toLowerCase() === expectedKey.toLowerCase()) {\n    // For special keys like Enter, Tab, ArrowUp, etc.\n    // For default keys with English-based keyboard layout.\n    return true;\n  }\n  if (expectedKey.length > 1) {\n    // For non English-based keyboard layout but the key is a special key, we must not match it by `event.code`.\n    return false;\n  }\n  if (event.key.length === 1 && event.key.charCodeAt(0) <= 127) {\n    // For ASCII keys we must not match it by `event.code` because it would break remapped layouts (English (US) Dvorak, etc.).\n    return false;\n  }\n\n  // Fallback for number keys\n  if (event.code.startsWith('Digit') && /^\\d$/.test(expectedKey)) {\n    return event.code === `Digit${expectedKey}`;\n  }\n  const expectedCode = 'Key' + expectedKey.toUpperCase();\n\n  // For default keys with not English-based keyboard layouts where `event.key` is non-ASCII, match by `event.code`.\n  return event.code === expectedCode;\n}\nconst CONTROL_OR_META = {\n  ctrlKey: !IS_APPLE,\n  metaKey: IS_APPLE\n};\nconst CONTROL_OR_ALT = {\n  altKey: IS_APPLE,\n  ctrlKey: !IS_APPLE\n};\nfunction isTab(event) {\n  return isExactShortcutMatch(event, 'Tab', {\n    shiftKey: 'any'\n  });\n}\nfunction isBold(event) {\n  return isExactShortcutMatch(event, 'b', CONTROL_OR_META);\n}\nfunction isItalic(event) {\n  return isExactShortcutMatch(event, 'i', CONTROL_OR_META);\n}\nfunction isUnderline(event) {\n  return isExactShortcutMatch(event, 'u', CONTROL_OR_META);\n}\nfunction isParagraph(event) {\n  return isExactShortcutMatch(event, 'Enter', {\n    altKey: 'any',\n    ctrlKey: 'any',\n    metaKey: 'any'\n  });\n}\nfunction isLineBreak(event) {\n  return isExactShortcutMatch(event, 'Enter', {\n    altKey: 'any',\n    ctrlKey: 'any',\n    metaKey: 'any',\n    shiftKey: true\n  });\n}\n\n// Inserts a new line after the selection\n\nfunction isOpenLineBreak(event) {\n  // 79 = KeyO\n  return IS_APPLE && isExactShortcutMatch(event, 'o', {\n    ctrlKey: true\n  });\n}\nfunction isDeleteWordBackward(event) {\n  return isExactShortcutMatch(event, 'Backspace', CONTROL_OR_ALT);\n}\nfunction isDeleteWordForward(event) {\n  return isExactShortcutMatch(event, 'Delete', CONTROL_OR_ALT);\n}\nfunction isDeleteLineBackward(event) {\n  return IS_APPLE && isExactShortcutMatch(event, 'Backspace', {\n    metaKey: true\n  });\n}\nfunction isDeleteLineForward(event) {\n  return IS_APPLE && (isExactShortcutMatch(event, 'Delete', {\n    metaKey: true\n  }) || isExactShortcutMatch(event, 'k', {\n    ctrlKey: true\n  }));\n}\nfunction isDeleteBackward(event) {\n  return isExactShortcutMatch(event, 'Backspace', {\n    shiftKey: 'any'\n  }) || IS_APPLE && isExactShortcutMatch(event, 'h', {\n    ctrlKey: true\n  });\n}\nfunction isDeleteForward(event) {\n  return isExactShortcutMatch(event, 'Delete', {}) || IS_APPLE && isExactShortcutMatch(event, 'd', {\n    ctrlKey: true\n  });\n}\nfunction isUndo(event) {\n  return isExactShortcutMatch(event, 'z', CONTROL_OR_META);\n}\nfunction isRedo(event) {\n  if (IS_APPLE) {\n    return isExactShortcutMatch(event, 'z', {\n      metaKey: true,\n      shiftKey: true\n    });\n  }\n  return isExactShortcutMatch(event, 'y', {\n    ctrlKey: true\n  }) || isExactShortcutMatch(event, 'z', {\n    ctrlKey: true,\n    shiftKey: true\n  });\n}\nfunction isCopy(event) {\n  return isExactShortcutMatch(event, 'c', CONTROL_OR_META);\n}\nfunction isCut(event) {\n  return isExactShortcutMatch(event, 'x', CONTROL_OR_META);\n}\nfunction isMoveBackward(event) {\n  return isExactShortcutMatch(event, 'ArrowLeft', {\n    shiftKey: 'any'\n  });\n}\nfunction isMoveToStart(event) {\n  return isExactShortcutMatch(event, 'ArrowLeft', CONTROL_OR_META);\n}\nfunction isMoveForward(event) {\n  return isExactShortcutMatch(event, 'ArrowRight', {\n    shiftKey: 'any'\n  });\n}\nfunction isMoveToEnd(event) {\n  return isExactShortcutMatch(event, 'ArrowRight', CONTROL_OR_META);\n}\nfunction isMoveUp(event) {\n  return isExactShortcutMatch(event, 'ArrowUp', {\n    altKey: 'any',\n    shiftKey: 'any'\n  });\n}\nfunction isMoveDown(event) {\n  return isExactShortcutMatch(event, 'ArrowDown', {\n    altKey: 'any',\n    shiftKey: 'any'\n  });\n}\nfunction isModifier(event) {\n  return event.ctrlKey || event.shiftKey || event.altKey || event.metaKey;\n}\nfunction isSpace(event) {\n  return event.key === ' ';\n}\nfunction isBackspace(event) {\n  return event.key === 'Backspace';\n}\nfunction isEscape(event) {\n  return event.key === 'Escape';\n}\nfunction isDelete(event) {\n  return event.key === 'Delete';\n}\nfunction isSelectAll(event) {\n  return isExactShortcutMatch(event, 'a', CONTROL_OR_META);\n}\nfunction $selectAll(selection) {\n  const root = $getRoot();\n  if ($isRangeSelection(selection)) {\n    const anchor = selection.anchor;\n    const focus = selection.focus;\n    const anchorNode = anchor.getNode();\n    const topParent = anchorNode.getTopLevelElementOrThrow();\n    const rootNode = topParent.getParentOrThrow();\n    anchor.set(rootNode.getKey(), 0, 'element');\n    focus.set(rootNode.getKey(), rootNode.getChildrenSize(), 'element');\n    $normalizeSelection(selection);\n    return selection;\n  } else {\n    // Create a new RangeSelection\n    const newSelection = root.select(0, root.getChildrenSize());\n    $setSelection($normalizeSelection(newSelection));\n    return newSelection;\n  }\n}\nfunction getCachedClassNameArray(classNamesTheme, classNameThemeType) {\n  if (classNamesTheme.__lexicalClassNameCache === undefined) {\n    classNamesTheme.__lexicalClassNameCache = {};\n  }\n  const classNamesCache = classNamesTheme.__lexicalClassNameCache;\n  const cachedClassNames = classNamesCache[classNameThemeType];\n  if (cachedClassNames !== undefined) {\n    return cachedClassNames;\n  }\n  const classNames = classNamesTheme[classNameThemeType];\n  // As we're using classList, we need\n  // to handle className tokens that have spaces.\n  // The easiest way to do this to convert the\n  // className tokens to an array that can be\n  // applied to classList.add()/remove().\n  if (typeof classNames === 'string') {\n    const classNamesArr = normalizeClassNames(classNames);\n    classNamesCache[classNameThemeType] = classNamesArr;\n    return classNamesArr;\n  }\n  return classNames;\n}\nfunction setMutatedNode(mutatedNodes, registeredNodes, mutationListeners, node, mutation) {\n  if (mutationListeners.size === 0) {\n    return;\n  }\n  const nodeType = node.__type;\n  const nodeKey = node.__key;\n  const registeredNode = registeredNodes.get(nodeType);\n  if (registeredNode === undefined) {\n    {\n      formatDevErrorMessage(`Type ${nodeType} not in registeredNodes`);\n    }\n  }\n  const klass = registeredNode.klass;\n  let mutatedNodesByType = mutatedNodes.get(klass);\n  if (mutatedNodesByType === undefined) {\n    mutatedNodesByType = new Map();\n    mutatedNodes.set(klass, mutatedNodesByType);\n  }\n  const prevMutation = mutatedNodesByType.get(nodeKey);\n  // If the node has already been \"destroyed\", yet we are\n  // re-making it, then this means a move likely happened.\n  // We should change the mutation to be that of \"updated\"\n  // instead.\n  const isMove = prevMutation === 'destroyed' && mutation === 'created';\n  if (prevMutation === undefined || isMove) {\n    mutatedNodesByType.set(nodeKey, isMove ? 'updated' : mutation);\n  }\n}\n/**\n * @deprecated Use {@link LexicalEditor.registerMutationListener} with `skipInitialization: false` instead.\n */\nfunction $nodesOfType(klass) {\n  const klassType = klass.getType();\n  const editorState = getActiveEditorState();\n  if (editorState._readOnly) {\n    const nodes = getCachedTypeToNodeMap(editorState).get(klassType);\n    return nodes ? Array.from(nodes.values()) : [];\n  }\n  const nodes = editorState._nodeMap;\n  const nodesOfType = [];\n  for (const [, node] of nodes) {\n    if (node instanceof klass && node.__type === klassType && node.isAttached()) {\n      nodesOfType.push(node);\n    }\n  }\n  return nodesOfType;\n}\nfunction resolveElement(element, isBackward, focusOffset) {\n  const parent = element.getParent();\n  let offset = focusOffset;\n  let block = element;\n  if (parent !== null) {\n    if (isBackward && focusOffset === 0) {\n      offset = block.getIndexWithinParent();\n      block = parent;\n    } else if (!isBackward && focusOffset === block.getChildrenSize()) {\n      offset = block.getIndexWithinParent() + 1;\n      block = parent;\n    }\n  }\n  return block.getChildAtIndex(isBackward ? offset - 1 : offset);\n}\nfunction $getAdjacentNode(focus, isBackward) {\n  const focusOffset = focus.offset;\n  if (focus.type === 'element') {\n    const block = focus.getNode();\n    return resolveElement(block, isBackward, focusOffset);\n  } else {\n    const focusNode = focus.getNode();\n    if (isBackward && focusOffset === 0 || !isBackward && focusOffset === focusNode.getTextContentSize()) {\n      const possibleNode = isBackward ? focusNode.getPreviousSibling() : focusNode.getNextSibling();\n      if (possibleNode === null) {\n        return resolveElement(focusNode.getParentOrThrow(), isBackward, focusNode.getIndexWithinParent() + (isBackward ? 0 : 1));\n      }\n      return possibleNode;\n    }\n  }\n  return null;\n}\nfunction isFirefoxClipboardEvents(editor) {\n  const event = getWindow(editor).event;\n  const inputType = event && event.inputType;\n  return inputType === 'insertFromPaste' || inputType === 'insertFromPasteAsQuotation';\n}\nfunction dispatchCommand(editor, command, payload) {\n  return triggerCommandListeners(editor, command, payload, editor);\n}\nfunction getElementByKeyOrThrow(editor, key) {\n  const element = editor._keyToDOMMap.get(key);\n  if (element === undefined) {\n    {\n      formatDevErrorMessage(`Reconciliation: could not find DOM element for node key ${key}`);\n    }\n  }\n  return element;\n}\nfunction getParentElement(node) {\n  const parentElement = node.assignedSlot || node.parentElement;\n  return isDocumentFragment(parentElement) ? parentElement.host : parentElement;\n}\nfunction getDOMOwnerDocument(target) {\n  return isDOMDocumentNode(target) ? target : isHTMLElement(target) ? target.ownerDocument : null;\n}\nfunction scrollIntoViewIfNeeded(editor, selectionRect, rootElement) {\n  const doc = getDOMOwnerDocument(rootElement);\n  const defaultView = getDefaultView(doc);\n  if (doc === null || defaultView === null) {\n    return;\n  }\n  let {\n    top: currentTop,\n    bottom: currentBottom\n  } = selectionRect;\n  let targetTop = 0;\n  let targetBottom = 0;\n  let element = rootElement;\n  while (element !== null) {\n    const isBodyElement = element === doc.body;\n    if (isBodyElement) {\n      targetTop = 0;\n      targetBottom = getWindow(editor).innerHeight;\n      // Account for CSS scroll-padding on the document element\n      const computedStyle = defaultView.getComputedStyle(doc.documentElement);\n      const scrollPaddingTop = parseFloat(computedStyle.scrollPaddingTop);\n      const scrollPaddingBottom = parseFloat(computedStyle.scrollPaddingBottom);\n      if (isFinite(scrollPaddingTop)) {\n        targetTop += scrollPaddingTop;\n      }\n      if (isFinite(scrollPaddingBottom)) {\n        targetBottom -= scrollPaddingBottom;\n      }\n    } else {\n      const targetRect = element.getBoundingClientRect();\n      targetTop = targetRect.top;\n      targetBottom = targetRect.bottom;\n    }\n    let diff = 0;\n    if (currentTop < targetTop) {\n      diff = -(targetTop - currentTop);\n    } else if (currentBottom > targetBottom) {\n      diff = currentBottom - targetBottom;\n    }\n    if (diff !== 0) {\n      if (isBodyElement) {\n        // Only handles scrolling of Y axis\n        defaultView.scrollBy(0, diff);\n      } else {\n        const scrollTop = element.scrollTop;\n        element.scrollTop += diff;\n        const yOffset = element.scrollTop - scrollTop;\n        currentTop -= yOffset;\n        currentBottom -= yOffset;\n      }\n    }\n    if (isBodyElement) {\n      break;\n    }\n    element = getParentElement(element);\n  }\n}\nfunction $hasUpdateTag(tag) {\n  const editor = getActiveEditor();\n  return editor._updateTags.has(tag);\n}\nfunction $addUpdateTag(tag) {\n  errorOnReadOnly();\n  const editor = getActiveEditor();\n  editor._updateTags.add(tag);\n}\n\n/**\n * Add a function to run after the current update. This will run after any\n * `onUpdate` function already supplied to `editor.update()`, as well as any\n * functions added with previous calls to `$onUpdate`.\n *\n * @param updateFn The function to run after the current update.\n */\nfunction $onUpdate(updateFn) {\n  errorOnReadOnly();\n  const editor = getActiveEditor();\n  editor._deferred.push(updateFn);\n}\nfunction $maybeMoveChildrenSelectionToParent(parentNode) {\n  const selection = $getSelection();\n  if (!$isRangeSelection(selection) || !$isElementNode(parentNode)) {\n    return selection;\n  }\n  const {\n    anchor,\n    focus\n  } = selection;\n  const anchorNode = anchor.getNode();\n  const focusNode = focus.getNode();\n  if ($hasAncestor(anchorNode, parentNode)) {\n    anchor.set(parentNode.__key, 0, 'element');\n  }\n  if ($hasAncestor(focusNode, parentNode)) {\n    focus.set(parentNode.__key, 0, 'element');\n  }\n  return selection;\n}\nfunction $hasAncestor(child, targetNode) {\n  let parent = child.getParent();\n  while (parent !== null) {\n    if (parent.is(targetNode)) {\n      return true;\n    }\n    parent = parent.getParent();\n  }\n  return false;\n}\nfunction getDefaultView(domElem) {\n  const ownerDoc = getDOMOwnerDocument(domElem);\n  return ownerDoc ? ownerDoc.defaultView : null;\n}\nfunction getWindow(editor) {\n  const windowObj = editor._window;\n  if (windowObj === null) {\n    {\n      formatDevErrorMessage(`window object not found`);\n    }\n  }\n  return windowObj;\n}\nfunction $isInlineElementOrDecoratorNode(node) {\n  return $isElementNode(node) && node.isInline() || $isDecoratorNode(node) && node.isInline();\n}\nfunction $getNearestRootOrShadowRoot(node) {\n  let parent = node.getParentOrThrow();\n  while (parent !== null) {\n    if ($isRootOrShadowRoot(parent)) {\n      return parent;\n    }\n    parent = parent.getParentOrThrow();\n  }\n  return parent;\n}\nfunction $isRootOrShadowRoot(node) {\n  return $isRootNode(node) || $isElementNode(node) && node.isShadowRoot();\n}\n\n/**\n * Returns a shallow clone of node with a new key. All properties of the node\n * will be copied to the new node (by `clone` and then `afterCloneFrom`),\n * except those related to parent/sibling/child\n * relationships in the `EditorState`. This means that the copy must be\n * separately added to the document, and it will not have any children.\n *\n * @param node - The node to be copied.\n * @param skipReset - If true (default false) skip the call to resetOnCopyNodeFrom\n * @returns The copy of the node.\n */\nfunction $copyNode(node, skipReset = false) {\n  const copy = node.constructor.clone(node);\n  $setNodeKey(copy, null);\n  copy.afterCloneFrom(node);\n  if (!skipReset) {\n    copy.resetOnCopyNodeFrom(node);\n  }\n  return copy;\n}\nfunction $applyNodeReplacement(node) {\n  const editor = getActiveEditor();\n  const nodeType = node.getType();\n  const registeredNode = getRegisteredNode(editor, nodeType);\n  if (!(registeredNode !== undefined)) {\n    formatDevErrorMessage(`$applyNodeReplacement node ${node.constructor.name} with type ${nodeType} must be registered to the editor. You can do this by passing the node class via the \"nodes\" array in the editor config.`);\n  }\n  const {\n    replace,\n    replaceWithKlass\n  } = registeredNode;\n  if (replace !== null) {\n    const replacementNode = replace(node);\n    const replacementNodeKlass = replacementNode.constructor;\n    if (replaceWithKlass !== null) {\n      if (!(replacementNode instanceof replaceWithKlass)) {\n        formatDevErrorMessage(`$applyNodeReplacement failed. Expected replacement node to be an instance of ${replaceWithKlass.name} with type ${replaceWithKlass.getType()} but returned ${replacementNodeKlass.name} with type ${replacementNodeKlass.getType()} from original node ${node.constructor.name} with type ${nodeType}`);\n      }\n    } else {\n      if (!(replacementNode instanceof node.constructor && replacementNodeKlass !== node.constructor)) {\n        formatDevErrorMessage(`$applyNodeReplacement failed. Ensure replacement node ${replacementNodeKlass.name} with type ${replacementNodeKlass.getType()} is a subclass of the original node ${node.constructor.name} with type ${nodeType}.`);\n      }\n    }\n    if (!(replacementNode.__key !== node.__key)) {\n      formatDevErrorMessage(`$applyNodeReplacement failed. Ensure that the key argument is *not* used in your replace function (from node ${node.constructor.name} with type ${nodeType} to node ${replacementNodeKlass.name} with type ${replacementNodeKlass.getType()}), Node keys must never be re-used except by the static clone method.`);\n    }\n    return replacementNode;\n  }\n  return node;\n}\nfunction errorOnInsertTextNodeOnRoot(node, insertNode) {\n  const parentNode = node.getParent();\n  if ($isRootNode(parentNode) && !$isElementNode(insertNode) && !$isDecoratorNode(insertNode)) {\n    {\n      formatDevErrorMessage(`Only element or decorator nodes can be inserted in to the root node`);\n    }\n  }\n}\nfunction $getNodeByKeyOrThrow(key) {\n  const node = $getNodeByKey(key);\n  if (node === null) {\n    {\n      formatDevErrorMessage(`Expected node with key ${key} to exist but it's not in the nodeMap.`);\n    }\n  }\n  return node;\n}\nfunction createBlockCursorElement(editorConfig) {\n  const theme = editorConfig.theme;\n  const element = document.createElement('div');\n  element.contentEditable = 'false';\n  element.setAttribute('data-lexical-cursor', 'true');\n  let blockCursorTheme = theme.blockCursor;\n  if (blockCursorTheme !== undefined) {\n    if (typeof blockCursorTheme === 'string') {\n      const classNamesArr = normalizeClassNames(blockCursorTheme);\n      // @ts-expect-error: intentional\n      blockCursorTheme = theme.blockCursor = classNamesArr;\n    }\n    if (blockCursorTheme !== undefined) {\n      element.classList.add(...blockCursorTheme);\n    }\n  }\n  return element;\n}\nfunction needsBlockCursor(node) {\n  return ($isDecoratorNode(node) || $isElementNode(node) && !node.canBeEmpty()) && !node.isInline();\n}\nfunction removeDOMBlockCursorElement(blockCursorElement, editor, rootElement) {\n  rootElement.style.removeProperty('caret-color');\n  editor._blockCursorElement = null;\n  const parentElement = blockCursorElement.parentElement;\n  if (parentElement !== null) {\n    parentElement.removeChild(blockCursorElement);\n  }\n}\nfunction updateDOMBlockCursorElement(editor, rootElement, nextSelection) {\n  let blockCursorElement = editor._blockCursorElement;\n  if ($isRangeSelection(nextSelection) && nextSelection.isCollapsed() && nextSelection.anchor.type === 'element' && rootElement.contains(document.activeElement)) {\n    const anchor = nextSelection.anchor;\n    const elementNode = anchor.getNode();\n    const offset = anchor.offset;\n    const elementNodeSize = elementNode.getChildrenSize();\n    let isBlockCursor = false;\n    let insertBeforeElement = null;\n    if (offset === elementNodeSize) {\n      const child = elementNode.getChildAtIndex(offset - 1);\n      if (needsBlockCursor(child)) {\n        isBlockCursor = true;\n      }\n    } else {\n      const child = elementNode.getChildAtIndex(offset);\n      if (child !== null && needsBlockCursor(child)) {\n        const sibling = child.getPreviousSibling();\n        if (sibling === null || needsBlockCursor(sibling)) {\n          isBlockCursor = true;\n          insertBeforeElement = editor.getElementByKey(child.__key);\n        }\n      }\n    }\n    if (isBlockCursor) {\n      const elementDOM = editor.getElementByKey(elementNode.__key);\n      if (blockCursorElement === null) {\n        editor._blockCursorElement = blockCursorElement = createBlockCursorElement(editor._config);\n      }\n      rootElement.style.caretColor = 'transparent';\n      if (insertBeforeElement === null) {\n        elementDOM.appendChild(blockCursorElement);\n      } else {\n        elementDOM.insertBefore(blockCursorElement, insertBeforeElement);\n      }\n      return;\n    }\n  }\n  // Remove cursor\n  if (blockCursorElement !== null) {\n    removeDOMBlockCursorElement(blockCursorElement, editor, rootElement);\n  }\n}\n\n/**\n * Returns the selection for the given window, or the global window if null.\n * Will return null if {@link CAN_USE_DOM} is false.\n *\n * @param targetWindow The window to get the selection from\n * @returns a Selection or null\n */\nfunction getDOMSelection(targetWindow) {\n  return !CAN_USE_DOM ? null : (targetWindow || window).getSelection();\n}\n\n/**\n * Returns the selection for the defaultView of the ownerDocument of given EventTarget.\n *\n * @param eventTarget The node to get the selection from\n * @returns a Selection or null\n */\nfunction getDOMSelectionFromTarget(eventTarget) {\n  const defaultView = getDefaultView(eventTarget);\n  return defaultView ? defaultView.getSelection() : null;\n}\nfunction $splitNode(node, offset) {\n  let startNode = node.getChildAtIndex(offset);\n  if (startNode == null) {\n    startNode = node;\n  }\n  if (!!$isRootOrShadowRoot(node)) {\n    formatDevErrorMessage(`Can not call $splitNode() on root element`);\n  }\n  const recurse = currentNode => {\n    const parent = currentNode.getParentOrThrow();\n    const isParentRoot = $isRootOrShadowRoot(parent);\n    // The node we start split from (leaf) is moved, but its recursive\n    // parents are copied to create separate tree\n    const nodeToMove = currentNode === startNode && !isParentRoot ? currentNode : $copyNode(currentNode);\n    if (isParentRoot) {\n      if (!($isElementNode(currentNode) && $isElementNode(nodeToMove))) {\n        formatDevErrorMessage(`Children of a root must be ElementNode`);\n      }\n      currentNode.insertAfter(nodeToMove);\n      return [currentNode, nodeToMove, nodeToMove];\n    } else {\n      const [leftTree, rightTree, newParent] = recurse(parent);\n      const nextSiblings = currentNode.getNextSiblings();\n      newParent.append(nodeToMove, ...nextSiblings);\n      return [leftTree, rightTree, nodeToMove];\n    }\n  };\n  const [leftTree, rightTree] = recurse(startNode);\n  return [leftTree, rightTree];\n}\n\n/**\n * @param x - The element being tested\n * @returns Returns true if x is an HTML anchor tag, false otherwise\n */\nfunction isHTMLAnchorElement(x) {\n  return isHTMLElement(x) && x.tagName === 'A';\n}\n\n/**\n * @param x - The element being tested\n * @returns Returns true if x is an HTML element, false otherwise.\n */\nfunction isHTMLElement(x) {\n  return isDOMNode(x) && x.nodeType === DOM_ELEMENT_TYPE;\n}\n\n/**\n * @param x - The element being tested\n * @returns Returns true if x is a DOM Node, false otherwise.\n */\nfunction isDOMNode(x) {\n  return typeof x === 'object' && x !== null && 'nodeType' in x && typeof x.nodeType === 'number';\n}\n\n/**\n * @param x - The element being testing\n * @returns Returns true if x is a document fragment, false otherwise.\n */\nfunction isDocumentFragment(x) {\n  return isDOMNode(x) && x.nodeType === DOM_DOCUMENT_FRAGMENT_TYPE;\n}\n\n/**\n *\n * @param node - the Dom Node to check\n * @returns if the Dom Node is an inline node\n */\nfunction isInlineDomNode(node) {\n  const inlineNodes = new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/, 'i');\n  return node.nodeName.match(inlineNodes) !== null;\n}\nfunction isBlockDomNode(node) {\n  const blockNodes = new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/, 'i');\n  return node.nodeName.match(blockNodes) !== null;\n}\n\n/**\n * @internal\n *\n * This function is for internal use of the library.\n * Please do not use it as it may change in the future.\n *\n * This function returns true for a DecoratorNode that is not inline OR\n * an ElementNode that is:\n * - not a root or shadow root\n * - not inline\n * - can't be empty\n * - has no children or an inline first child\n */\nfunction INTERNAL_$isBlock(node) {\n  if ($isDecoratorNode(node) && !node.isInline()) {\n    return true;\n  }\n  if (!$isElementNode(node) || $isRootOrShadowRoot(node)) {\n    return false;\n  }\n  const firstChild = node.getFirstChild();\n  const isLeafElement = firstChild === null || $isLineBreakNode(firstChild) || $isTextNode(firstChild) || firstChild.isInline();\n  return !node.isInline() && node.canBeEmpty() !== false && isLeafElement;\n}\n\n/**\n * Utility function for accessing current active editor instance.\n * @returns Current active editor\n */\nfunction $getEditor() {\n  return getActiveEditor();\n}\n\n/**\n * @internal @experimental\n */\nfunction $getEditorDOMRenderConfig(editor = $getEditor()) {\n  return editor._config.dom || DEFAULT_EDITOR_DOM_CONFIG;\n}\n\n/** @internal */\n\n/**\n * @internal\n * Compute a cached Map of node type to nodes for a frozen EditorState\n */\nconst cachedNodeMaps = new WeakMap();\nconst EMPTY_TYPE_TO_NODE_MAP = new Map();\nfunction getCachedTypeToNodeMap(editorState) {\n  // If this is a new Editor it may have a writable this._editorState\n  // with only a 'root' entry.\n  if (!editorState._readOnly && editorState.isEmpty()) {\n    return EMPTY_TYPE_TO_NODE_MAP;\n  }\n  if (!editorState._readOnly) {\n    formatDevErrorMessage(`getCachedTypeToNodeMap called with a writable EditorState`);\n  }\n  let typeToNodeMap = cachedNodeMaps.get(editorState);\n  if (!typeToNodeMap) {\n    typeToNodeMap = computeTypeToNodeMap(editorState);\n    cachedNodeMaps.set(editorState, typeToNodeMap);\n  }\n  return typeToNodeMap;\n}\n\n/**\n * @internal\n * Compute a Map of node type to nodes for an EditorState\n */\nfunction computeTypeToNodeMap(editorState) {\n  const typeToNodeMap = new Map();\n  for (const [nodeKey, node] of editorState._nodeMap) {\n    const nodeType = node.__type;\n    let nodeMap = typeToNodeMap.get(nodeType);\n    if (!nodeMap) {\n      nodeMap = new Map();\n      typeToNodeMap.set(nodeType, nodeMap);\n    }\n    nodeMap.set(nodeKey, node);\n  }\n  return typeToNodeMap;\n}\n\n/**\n * Returns a clone of a node using `node.constructor.clone()` followed by\n * `clone.afterCloneFrom(node)`. The resulting clone must have the same key,\n * parent/next/prev pointers, and other properties that are not set by\n * `node.constructor.clone` (format, style, etc.). This is primarily used by\n * {@link LexicalNode.getWritable} to create a writable version of an\n * existing node. The clone is the same logical node as the original node,\n * do not try and use this function to duplicate or copy an existing node.\n *\n * Does not mutate the EditorState.\n * @param latestNode - The node to be cloned.\n * @returns The clone of the node.\n */\nfunction $cloneWithProperties(latestNode) {\n  const constructor = latestNode.constructor;\n  const mutableNode = constructor.clone(latestNode);\n  mutableNode.afterCloneFrom(latestNode);\n  {\n    if (!(mutableNode.__key === latestNode.__key)) {\n      formatDevErrorMessage(`$cloneWithProperties: ${constructor.name}.clone(node) (with type '${constructor.getType()}') did not return a node with the same key, make sure to specify node.__key as the last argument to the constructor`);\n    }\n    if (!(mutableNode.__parent === latestNode.__parent && mutableNode.__next === latestNode.__next && mutableNode.__prev === latestNode.__prev)) {\n      formatDevErrorMessage(`$cloneWithProperties: ${constructor.name}.clone(node) (with type '${constructor.getType()}') overrode afterCloneFrom but did not call super.afterCloneFrom(prevNode)`);\n    }\n  }\n  return mutableNode;\n}\n\n/**\n * Returns a clone with {@link $cloneWithProperties} and then \"detaches\"\n * it from the state by overriding its getLatest and getWritable to always\n * return this. This node can not be added to an EditorState or become the\n * parent, child, or sibling of another node. It is primarily only useful\n * for making in-place temporary modifications to a TextNode when\n * serializing a partial slice.\n *\n * Does not mutate the EditorState.\n * @param latestNode - The node to be cloned.\n * @returns The clone of the node.\n */\nfunction $cloneWithPropertiesEphemeral(latestNode) {\n  return $markEphemeral($cloneWithProperties(latestNode));\n}\nfunction setNodeIndentFromDOM(elementDom, elementNode) {\n  const indentSize = parseInt(elementDom.style.paddingInlineStart, 10) || 0;\n  const indent = Math.round(indentSize / 40);\n  elementNode.setIndent(indent);\n}\n\n/**\n * @internal\n *\n * Mark this node as unmanaged by lexical's mutation observer like\n * decorator nodes\n */\nfunction setDOMUnmanaged(elementDom) {\n  const el = elementDom;\n  el.__lexicalUnmanaged = true;\n}\n\n/**\n * @internal\n *\n * True if this DOM node was marked with {@link setDOMUnmanaged}\n */\nfunction isDOMUnmanaged(elementDom) {\n  const el = elementDom;\n  return el.__lexicalUnmanaged === true;\n}\n\n/**\n * @internal\n *\n * Object.hasOwn ponyfill\n */\nfunction hasOwn(o, k) {\n  return Object.prototype.hasOwnProperty.call(o, k);\n}\n\n/**\n * @internal\n */\nfunction hasOwnStaticMethod(klass, k) {\n  return hasOwn(klass, k) && klass[k] !== LexicalNode[k];\n}\n\n/**\n * @internal\n */\nfunction hasOwnExportDOM(klass) {\n  return hasOwn(klass.prototype, 'exportDOM');\n}\n\n/** @internal */\nfunction isAbstractNodeClass(klass) {\n  if (!(klass === LexicalNode || klass.prototype instanceof LexicalNode)) {\n    let ownNodeType = '<unknown>';\n    let version = '<unknown>';\n    try {\n      ownNodeType = klass.getType();\n    } catch (_err) {\n      // ignore\n    }\n    try {\n      if (LexicalEditor.version) {\n        version = JSON.parse(LexicalEditor.version);\n      }\n    } catch (_err) {\n      // ignore\n    }\n    {\n      formatDevErrorMessage(`${klass.name} (type ${ownNodeType}) does not subclass LexicalNode from the lexical package used by this editor (version ${version}). All lexical and @lexical/* packages used by an editor must have identical versions. If you suspect the version does match, then the problem may be caused by multiple copies of the same lexical module (e.g. both esm and cjs, or included directly in multiple entrypoints).`);\n    }\n  }\n  return klass === DecoratorNode || klass === ElementNode || klass === LexicalNode;\n}\n\n/** @internal */\nfunction getStaticNodeConfig(klass) {\n  const nodeConfigRecord = PROTOTYPE_CONFIG_METHOD in klass.prototype ? klass.prototype[PROTOTYPE_CONFIG_METHOD]() : undefined;\n  const isAbstract = isAbstractNodeClass(klass);\n  const nodeType = !isAbstract && hasOwnStaticMethod(klass, 'getType') ? klass.getType() : undefined;\n  let ownNodeConfig;\n  let ownNodeType = nodeType;\n  if (nodeConfigRecord) {\n    if (nodeType) {\n      ownNodeConfig = nodeConfigRecord[nodeType];\n    } else {\n      for (const [k, v] of Object.entries(nodeConfigRecord)) {\n        ownNodeType = k;\n        ownNodeConfig = v;\n      }\n    }\n  }\n  if (!isAbstract && ownNodeType) {\n    if (!hasOwnStaticMethod(klass, 'getType')) {\n      klass.getType = () => ownNodeType;\n    }\n    if (!hasOwnStaticMethod(klass, 'clone')) {\n      // TextNode.length > 0 will only be true if the compiler output\n      // is not ES6 compliant, in which case we can not provide this\n      // warning\n      if (TextNode.length === 0) {\n        if (!(klass.length === 0)) {\n          formatDevErrorMessage(`${klass.name} (type ${ownNodeType}) must implement a static clone method since its constructor has ${String(klass.length)} required arguments (expecting 0). Use an explicit default in the first argument of your constructor(prop: T=X, nodeKey?: NodeKey).`);\n        }\n      }\n      klass.clone = prevNode => {\n        setPendingNodeToClone(prevNode);\n        return new klass();\n      };\n    }\n    if (!hasOwnStaticMethod(klass, 'importJSON')) {\n      if (TextNode.length === 0) {\n        if (!(klass.length === 0)) {\n          formatDevErrorMessage(`${klass.name} (type ${ownNodeType}) must implement a static importJSON method since its constructor has ${String(klass.length)} required arguments (expecting 0). Use an explicit default in the first argument of your constructor(prop: T=X, nodeKey?: NodeKey).`);\n        }\n      }\n      klass.importJSON = ownNodeConfig && ownNodeConfig.$importJSON || (serializedNode => new klass().updateFromJSON(serializedNode));\n    }\n    if (!hasOwnStaticMethod(klass, 'importDOM') && ownNodeConfig) {\n      const {\n        importDOM\n      } = ownNodeConfig;\n      if (importDOM) {\n        klass.importDOM = () => importDOM;\n      }\n    }\n  }\n  return {\n    ownNodeConfig,\n    ownNodeType\n  };\n}\n\n/**\n * Create an node from its class.\n *\n * Note that this will directly construct the final `withKlass` node type,\n * and will ignore the deprecated `with` functions. This allows `$create` to\n * skip any intermediate steps where the replaced node would be created and\n * then immediately discarded (once per configured replacement of that node).\n *\n * This does not support any arguments to the constructor.\n * Setters can be used to initialize your node, and they can\n * be chained. You can of course write your own mutliple-argument functions\n * to wrap that.\n *\n * @example\n * ```ts\n * function $createTokenText(text: string): TextNode {\n *   return $create(TextNode).setTextContent(text).setMode('token');\n * }\n * ```\n */\nfunction $create(klass) {\n  const editor = $getEditor();\n  errorOnReadOnly();\n  const registeredNode = editor.resolveRegisteredNodeAfterReplacements(editor.getRegisteredNode(klass));\n  return new registeredNode.klass();\n}\n\n/**\n * Starts with a node and moves up the tree (toward the root node) to find a matching node based on\n * the search parameters of the findFn. (Consider JavaScripts' .find() function where a testing function must be\n * passed as an argument. eg. if( (node) => node.__type === 'div') ) return true; otherwise return false\n * @param startingNode - The node where the search starts.\n * @param findFn - A testing function that returns true if the current node satisfies the testing parameters.\n * @returns `startingNode` or one of its ancestors that matches the `findFn` predicate and is not the `RootNode`, or `null` if no match was found.\n */\nconst $findMatchingParent = (startingNode, findFn) => {\n  let curr = startingNode;\n  while (curr != null && !$isRootNode(curr)) {\n    if (findFn(curr)) {\n      return curr;\n    }\n    curr = curr.getParent();\n  }\n  return null;\n};\nfunction $createChildrenArray(element, nodeMap) {\n  const children = [];\n  let nodeKey = element.__first;\n  while (nodeKey !== null) {\n    const node = nodeMap === null ? $getNodeByKey(nodeKey) : nodeMap.get(nodeKey);\n    if (node === null || node === undefined) {\n      {\n        formatDevErrorMessage(`$createChildrenArray: node does not exist in nodeMap`);\n      }\n    }\n    children.push(nodeKey);\n    nodeKey = node.__next;\n  }\n  return children;\n}\n\n/**\n * The direction of a caret, 'next' points towards the end of the document\n * and 'previous' points towards the beginning\n */\n\n/**\n * A type utility to flip next and previous\n */\n\n/**\n * A sibling caret type points from a LexicalNode origin to its next or previous sibling,\n * and a child caret type points from an ElementNode origin to its first or last child.\n */\n\n/**\n * The RootMode is specified in all caret traversals where the traversal can go up\n * towards the root. 'root' means that it will stop at the document root,\n * and 'shadowRoot' will stop at the document root or any shadow root\n * (per {@link $isRootOrShadowRoot}).\n */\n\nconst FLIP_DIRECTION = {\n  next: 'previous',\n  previous: 'next'\n};\n\n/** @noInheritDoc */\n\n/**\n * A RangeSelection expressed as a pair of Carets\n */\n\n/**\n * A NodeCaret is the combination of an origin node and a direction\n * that points towards where a connected node will be fetched, inserted,\n * or replaced. A SiblingCaret points from a node to its next or previous\n * sibling, and a ChildCaret points to its first or last child\n * (using next or previous as direction, for symmetry with SiblingCaret).\n *\n * The differences between NodeCaret and PointType are:\n * - NodeCaret can only be used to refer to an entire node (PointCaret is used when a full analog is needed). A PointType of text type can be used to refer to a specific location inside of a TextNode.\n * - NodeCaret stores an origin node, type (sibling or child), and direction (next or previous). A PointType stores a type (text or element), the key of a node, and a text or child offset within that node.\n * - NodeCaret is directional and always refers to a very specific node, eliminating all ambiguity. PointType can refer to the location before or at a node depending on context.\n * - NodeCaret is more robust to nearby mutations, as it relies only on a node's direct connections. An element Any change to the count of previous siblings in an element PointType will invalidate it.\n * - NodeCaret is designed to work more directly with the internal representation of the document tree, making it suitable for use in traversals without performing any redundant work.\n *\n * The caret does *not* update in response to any mutations, you should\n * not persist it across editor updates, and using a caret after its origin\n * node has been removed or replaced may result in runtime errors.\n */\n\n/**\n * A PointCaret is a NodeCaret that also includes a\n * TextPointCaret type which refers to a specific offset of a TextNode.\n * This type is separate because it is not relevant to general node traversal\n * so it doesn't make sense to have it show up except when defining\n * a CaretRange and in those cases there will be at most two of them only\n * at the boundaries.\n *\n * The addition of TextPointCaret allows this type to represent any location\n * that is representable by PointType, as the TextPointCaret refers to a\n * specific offset within a TextNode.\n */\n\n/**\n * A SiblingCaret points from an origin LexicalNode towards its next or previous sibling.\n */\n\n/**\n * A ChildCaret points from an origin ElementNode towards its first or last child.\n */\n\n/**\n * A TextPointCaret is a special case of a SiblingCaret that also carries\n * an offset used for representing partially selected TextNode at the edges\n * of a CaretRange.\n *\n * The direction determines which part of the text is adjacent to the caret,\n * if next it's all of the text after offset. If previous, it's all of the\n * text before offset.\n *\n * While this can be used in place of any SiblingCaret of a TextNode,\n * the offset into the text will be ignored except in contexts that\n * specifically use the TextPointCaret or PointCaret types.\n */\n\n/**\n * A TextPointCaretSlice is a wrapper for a TextPointCaret that carries a signed\n * distance representing the direction and amount of text selected from the given\n * caret. A negative distance means that text before offset is selected, a\n * positive distance means that text after offset is selected. The offset+distance\n * pair is not affected in any way by the direction of the caret.\n */\n\n/**\n * A utility type to specify that a CaretRange may have zero,\n * one, or two associated TextPointCaretSlice. If the anchor\n * and focus are on the same node, the anchorSlice will contain\n * the slice and focusSlie will be null.\n */\n\nclass AbstractCaret {\n  origin;\n  constructor(origin) {\n    this.origin = origin;\n  }\n  [Symbol.iterator]() {\n    return makeStepwiseIterator({\n      hasNext: $isSiblingCaret,\n      initial: this.getAdjacentCaret(),\n      map: caret => caret,\n      step: caret => caret.getAdjacentCaret()\n    });\n  }\n  getAdjacentCaret() {\n    return $getSiblingCaret(this.getNodeAtCaret(), this.direction);\n  }\n  getSiblingCaret() {\n    return $getSiblingCaret(this.origin, this.direction);\n  }\n  remove() {\n    const node = this.getNodeAtCaret();\n    if (node) {\n      node.remove();\n    }\n    return this;\n  }\n  replaceOrInsert(node, includeChildren) {\n    const target = this.getNodeAtCaret();\n    if (node.is(this.origin) || node.is(target)) ; else if (target === null) {\n      this.insert(node);\n    } else {\n      target.replace(node, includeChildren);\n    }\n    return this;\n  }\n  splice(deleteCount, nodes, nodesDirection = 'next') {\n    const nodeIter = nodesDirection === this.direction ? nodes : Array.from(nodes).reverse();\n    let caret = this;\n    const parent = this.getParentAtCaret();\n    const nodesToRemove = new Map();\n    // Find all of the nodes we expect to remove first, so\n    // we don't have to worry about the cases where there is\n    // overlap between the nodes to insert and the nodes to\n    // remove\n    for (let removeCaret = caret.getAdjacentCaret(); removeCaret !== null && nodesToRemove.size < deleteCount; removeCaret = removeCaret.getAdjacentCaret()) {\n      const writableNode = removeCaret.origin.getWritable();\n      nodesToRemove.set(writableNode.getKey(), writableNode);\n    }\n    // TODO: Optimize this to work directly with node internals\n    for (const node of nodeIter) {\n      if (nodesToRemove.size > 0) {\n        // For some reason `pnpm run tsc-extension` needs this annotation?\n        const target = caret.getNodeAtCaret();\n        if (target) {\n          nodesToRemove.delete(target.getKey());\n          nodesToRemove.delete(node.getKey());\n          if (target.is(node) || caret.origin.is(node)) ; else {\n            const nodeParent = node.getParent();\n            if (nodeParent && nodeParent.is(parent)) {\n              // It's a sibling somewhere else in this node, so unparent it first\n              node.remove();\n            }\n            target.replace(node);\n          }\n        } else {\n          if (!(target !== null)) {\n            formatDevErrorMessage(`NodeCaret.splice: Underflow of expected nodesToRemove during splice (keys: ${Array.from(nodesToRemove).join(' ')})`);\n          }\n        }\n      } else {\n        caret.insert(node);\n      }\n      caret = $getSiblingCaret(node, this.direction);\n    }\n    for (const node of nodesToRemove.values()) {\n      node.remove();\n    }\n    return this;\n  }\n}\nclass AbstractChildCaret extends AbstractCaret {\n  type = 'child';\n  getLatest() {\n    const origin = this.origin.getLatest();\n    return origin === this.origin ? this : $getChildCaret(origin, this.direction);\n  }\n  /**\n   * Get the SiblingCaret from this origin in the same direction.\n   *\n   * @param mode 'root' to return null at the root, 'shadowRoot' to return null at the root or any shadow root\n   * @returns A SiblingCaret with this origin, or null if origin is a root according to mode.\n   */\n  getParentCaret(mode = 'root') {\n    return $getSiblingCaret($filterByMode(this.getParentAtCaret(), mode), this.direction);\n  }\n  getFlipped() {\n    const dir = flipDirection(this.direction);\n    return $getSiblingCaret(this.getNodeAtCaret(), dir) || $getChildCaret(this.origin, dir);\n  }\n  getParentAtCaret() {\n    return this.origin;\n  }\n  getChildCaret() {\n    return this;\n  }\n  isSameNodeCaret(other) {\n    return other instanceof AbstractChildCaret && this.direction === other.direction && this.origin.is(other.origin);\n  }\n  isSamePointCaret(other) {\n    return this.isSameNodeCaret(other);\n  }\n}\nclass ChildCaretFirst extends AbstractChildCaret {\n  direction = 'next';\n  getNodeAtCaret() {\n    return this.origin.getFirstChild();\n  }\n  insert(node) {\n    this.origin.splice(0, 0, [node]);\n    return this;\n  }\n}\nclass ChildCaretLast extends AbstractChildCaret {\n  direction = 'previous';\n  getNodeAtCaret() {\n    return this.origin.getLastChild();\n  }\n  insert(node) {\n    this.origin.splice(this.origin.getChildrenSize(), 0, [node]);\n    return this;\n  }\n}\nconst MODE_PREDICATE = {\n  root: $isRootNode,\n  shadowRoot: $isRootOrShadowRoot\n};\n\n/**\n * Flip a direction ('next' -> 'previous'; 'previous' -> 'next').\n *\n * Note that TypeScript can't prove that FlipDirection is its own\n * inverse (but if you have a concrete 'next' or 'previous' it will\n * simplify accordingly).\n *\n * @param direction A direction\n * @returns The opposite direction\n */\nfunction flipDirection(direction) {\n  return FLIP_DIRECTION[direction];\n}\nfunction $filterByMode(node, mode = 'root') {\n  return MODE_PREDICATE[mode](node) ? null : node;\n}\nclass AbstractSiblingCaret extends AbstractCaret {\n  type = 'sibling';\n  getLatest() {\n    const origin = this.origin.getLatest();\n    return origin === this.origin ? this : $getSiblingCaret(origin, this.direction);\n  }\n  getSiblingCaret() {\n    return this;\n  }\n  getParentAtCaret() {\n    return this.origin.getParent();\n  }\n  getChildCaret() {\n    return $isElementNode(this.origin) ? $getChildCaret(this.origin, this.direction) : null;\n  }\n  getParentCaret(mode = 'root') {\n    return $getSiblingCaret($filterByMode(this.getParentAtCaret(), mode), this.direction);\n  }\n  getFlipped() {\n    const dir = flipDirection(this.direction);\n    return $getSiblingCaret(this.getNodeAtCaret(), dir) || $getChildCaret(this.origin.getParentOrThrow(), dir);\n  }\n  isSamePointCaret(other) {\n    return other instanceof AbstractSiblingCaret && this.direction === other.direction && this.origin.is(other.origin);\n  }\n  isSameNodeCaret(other) {\n    return (other instanceof AbstractSiblingCaret || other instanceof AbstractTextPointCaret) && this.direction === other.direction && this.origin.is(other.origin);\n  }\n}\nclass AbstractTextPointCaret extends AbstractCaret {\n  type = 'text';\n  offset;\n  constructor(origin, offset) {\n    super(origin);\n    this.offset = offset;\n  }\n  getLatest() {\n    const origin = this.origin.getLatest();\n    return origin === this.origin ? this : $getTextPointCaret(origin, this.direction, this.offset);\n  }\n  getParentAtCaret() {\n    return this.origin.getParent();\n  }\n  getChildCaret() {\n    return null;\n  }\n  getParentCaret(mode = 'root') {\n    return $getSiblingCaret($filterByMode(this.getParentAtCaret(), mode), this.direction);\n  }\n  getFlipped() {\n    return $getTextPointCaret(this.origin, flipDirection(this.direction), this.offset);\n  }\n  isSamePointCaret(other) {\n    return other instanceof AbstractTextPointCaret && this.direction === other.direction && this.origin.is(other.origin) && this.offset === other.offset;\n  }\n  isSameNodeCaret(other) {\n    return (other instanceof AbstractSiblingCaret || other instanceof AbstractTextPointCaret) && this.direction === other.direction && this.origin.is(other.origin);\n  }\n  getSiblingCaret() {\n    return $getSiblingCaret(this.origin, this.direction);\n  }\n}\n/**\n * Guard to check if the given caret is specifically a TextPointCaret\n *\n * @param caret Any caret\n * @returns true if it is a TextPointCaret\n */\nfunction $isTextPointCaret(caret) {\n  return caret instanceof AbstractTextPointCaret;\n}\n\n/**\n * Guard to check if the given argument is any type of caret\n *\n * @param caret\n * @returns true if caret is any type of caret\n */\nfunction $isNodeCaret(caret) {\n  return caret instanceof AbstractCaret;\n}\n\n/**\n * Guard to check if the given argument is specifically a SiblingCaret (or TextPointCaret)\n *\n * @param caret\n * @returns true if caret is a SiblingCaret\n */\nfunction $isSiblingCaret(caret) {\n  return caret instanceof AbstractSiblingCaret;\n}\n\n/**\n * Guard to check if the given argument is specifically a ChildCaret\n\n * @param caret \n * @returns true if caret is a ChildCaret\n */\nfunction $isChildCaret(caret) {\n  return caret instanceof AbstractChildCaret;\n}\nclass SiblingCaretNext extends AbstractSiblingCaret {\n  direction = 'next';\n  getNodeAtCaret() {\n    return this.origin.getNextSibling();\n  }\n  insert(node) {\n    this.origin.insertAfter(node);\n    return this;\n  }\n}\nclass SiblingCaretPrevious extends AbstractSiblingCaret {\n  direction = 'previous';\n  getNodeAtCaret() {\n    return this.origin.getPreviousSibling();\n  }\n  insert(node) {\n    this.origin.insertBefore(node);\n    return this;\n  }\n}\nclass TextPointCaretNext extends AbstractTextPointCaret {\n  direction = 'next';\n  getNodeAtCaret() {\n    return this.origin.getNextSibling();\n  }\n  insert(node) {\n    this.origin.insertAfter(node);\n    return this;\n  }\n}\nclass TextPointCaretPrevious extends AbstractTextPointCaret {\n  direction = 'previous';\n  getNodeAtCaret() {\n    return this.origin.getPreviousSibling();\n  }\n  insert(node) {\n    this.origin.insertBefore(node);\n    return this;\n  }\n}\nconst TEXT_CTOR = {\n  next: TextPointCaretNext,\n  previous: TextPointCaretPrevious\n};\nconst SIBLING_CTOR = {\n  next: SiblingCaretNext,\n  previous: SiblingCaretPrevious\n};\nconst CHILD_CTOR = {\n  next: ChildCaretFirst,\n  previous: ChildCaretLast\n};\n\n/**\n * Get a caret that points at the next or previous sibling of the given origin node.\n *\n * @param origin The origin node\n * @param direction 'next' or 'previous'\n * @returns null if origin is null, otherwise a SiblingCaret for this origin and direction\n */\n\nfunction $getSiblingCaret(origin, direction) {\n  return origin ? new SIBLING_CTOR[direction](origin) : null;\n}\n\n/**\n * Construct a TextPointCaret\n *\n * @param origin The TextNode\n * @param direction The direction (next points to the end of the text, previous points to the beginning)\n * @param offset The offset into the text in absolute positive string coordinates (0 is the start)\n * @returns a TextPointCaret\n */\n\nfunction $getTextPointCaret(origin, direction, offset) {\n  return origin ? new TEXT_CTOR[direction](origin, $getTextNodeOffset(origin, offset)) : null;\n}\n\n/**\n * Get a normalized offset into a TextNode given a numeric offset or a\n * direction for which end of the string to use. Throws in dev if the offset\n * is not in the bounds of the text content size.\n *\n * @param origin a TextNode\n * @param offset An absolute offset into the TextNode string, or a direction for which end to use as the offset\n * @param mode If 'error' (the default) out of bounds offsets will be an error in dev. Otherwise it will clamp to a valid offset.\n * @returns An absolute offset into the TextNode string\n */\nfunction $getTextNodeOffset(origin, offset, mode = 'error') {\n  const size = origin.getTextContentSize();\n  let numericOffset = offset === 'next' ? size : offset === 'previous' ? 0 : offset;\n  if (numericOffset < 0 || numericOffset > size) {\n    if (!(mode === 'clamp')) {\n      formatDevErrorMessage(`$getTextNodeOffset: invalid offset ${String(offset)} for size ${String(size)} at key ${origin.getKey()}`);\n    } // Clamp invalid offsets in prod\n    numericOffset = numericOffset < 0 ? 0 : size;\n  }\n  return numericOffset;\n}\n\n/**\n * Construct a TextPointCaretSlice given a TextPointCaret and a signed distance. The\n * distance should be negative to slice text before the caret's offset, and positive\n * to slice text after the offset. The direction of the caret itself is not\n * relevant to the string coordinates when working with a TextPointCaretSlice\n * but mutation operations will preserve the direction.\n *\n * @param caret\n * @param distance\n * @returns TextPointCaretSlice\n */\nfunction $getTextPointCaretSlice(caret, distance) {\n  return new TextPointCaretSliceImpl(caret, distance);\n}\n\n/**\n * Get a caret that points at the first or last child of the given origin node,\n * which must be an ElementNode.\n *\n * @param origin The origin ElementNode\n * @param direction 'next' for first child or 'previous' for last child\n * @returns null if origin is null or not an ElementNode, otherwise a ChildCaret for this origin and direction\n */\n\nfunction $getChildCaret(origin, direction) {\n  return $isElementNode(origin) ? new CHILD_CTOR[direction](origin) : null;\n}\n\n/**\n * Gets the ChildCaret if one is possible at this caret origin, otherwise return the caret\n */\nfunction $getChildCaretOrSelf(caret) {\n  return caret && caret.getChildCaret() || caret;\n}\n\n/**\n * Gets the adjacent caret, if not-null and if the origin of the adjacent caret is an ElementNode, then return\n * the ChildCaret. This can be used along with the getParentAdjacentCaret method to perform a full DFS\n * style traversal of the tree.\n *\n * @param caret The caret to start at\n */\nfunction $getAdjacentChildCaret(caret) {\n  return caret && $getChildCaretOrSelf(caret.getAdjacentCaret());\n}\nclass CaretRangeImpl {\n  type = 'node-caret-range';\n  direction;\n  anchor;\n  focus;\n  constructor(anchor, focus, direction) {\n    this.anchor = anchor;\n    this.focus = focus;\n    this.direction = direction;\n  }\n  getLatest() {\n    const anchor = this.anchor.getLatest();\n    const focus = this.focus.getLatest();\n    return anchor === this.anchor && focus === this.focus ? this : new CaretRangeImpl(anchor, focus, this.direction);\n  }\n  isCollapsed() {\n    return this.anchor.isSamePointCaret(this.focus);\n  }\n  getTextSlices() {\n    const getSlice = k => {\n      const caret = this[k].getLatest();\n      return $isTextPointCaret(caret) ? $getSliceFromTextPointCaret(caret, k) : null;\n    };\n    const anchorSlice = getSlice('anchor');\n    const focusSlice = getSlice('focus');\n    if (anchorSlice && focusSlice) {\n      const {\n        caret: anchorCaret\n      } = anchorSlice;\n      const {\n        caret: focusCaret\n      } = focusSlice;\n      if (anchorCaret.isSameNodeCaret(focusCaret)) {\n        return [$getTextPointCaretSlice(anchorCaret, focusCaret.offset - anchorCaret.offset), null];\n      }\n    }\n    return [anchorSlice, focusSlice];\n  }\n  iterNodeCarets(rootMode = 'root') {\n    const anchor = $isTextPointCaret(this.anchor) ? this.anchor.getSiblingCaret() : this.anchor.getLatest();\n    const focus = this.focus.getLatest();\n    const isTextFocus = $isTextPointCaret(focus);\n    const step = state => state.isSameNodeCaret(focus) ? null : $getAdjacentChildCaret(state) || state.getParentCaret(rootMode);\n    return makeStepwiseIterator({\n      hasNext: state => state !== null && !(isTextFocus && focus.isSameNodeCaret(state)),\n      initial: anchor.isSameNodeCaret(focus) ? null : step(anchor),\n      map: state => state,\n      step\n    });\n  }\n  [Symbol.iterator]() {\n    return this.iterNodeCarets('root');\n  }\n}\nclass TextPointCaretSliceImpl {\n  type = 'slice';\n  caret;\n  distance;\n  constructor(caret, distance) {\n    this.caret = caret;\n    this.distance = distance;\n  }\n  getSliceIndices() {\n    const {\n      distance,\n      caret: {\n        offset\n      }\n    } = this;\n    const offsetB = offset + distance;\n    return offsetB < offset ? [offsetB, offset] : [offset, offsetB];\n  }\n  getTextContent() {\n    const [startIndex, endIndex] = this.getSliceIndices();\n    return this.caret.origin.getTextContent().slice(startIndex, endIndex);\n  }\n  getTextContentSize() {\n    return Math.abs(this.distance);\n  }\n  removeTextSlice() {\n    const {\n      caret: {\n        origin,\n        direction\n      }\n    } = this;\n    const [indexStart, indexEnd] = this.getSliceIndices();\n    const text = origin.getTextContent();\n    return $getTextPointCaret(origin.setTextContent(text.slice(0, indexStart) + text.slice(indexEnd)), direction, indexStart);\n  }\n}\nfunction $getSliceFromTextPointCaret(caret, anchorOrFocus) {\n  const {\n    direction,\n    origin\n  } = caret;\n  const offsetB = $getTextNodeOffset(origin, anchorOrFocus === 'focus' ? flipDirection(direction) : direction);\n  return $getTextPointCaretSlice(caret, offsetB - caret.offset);\n}\n\n/**\n * Guard to check for a TextPointCaretSlice\n *\n * @param caretOrSlice A caret or slice\n * @returns true if caretOrSlice is a TextPointCaretSlice\n */\nfunction $isTextPointCaretSlice(caretOrSlice) {\n  return caretOrSlice instanceof TextPointCaretSliceImpl;\n}\n\n/**\n * Construct a CaretRange that starts at anchor and goes to the end of the\n * document in the anchor caret's direction.\n */\nfunction $extendCaretToRange(anchor) {\n  return $getCaretRange(anchor, $getSiblingCaret($getRoot(), anchor.direction));\n}\n\n/**\n * Construct a collapsed CaretRange that starts and ends at anchor.\n */\nfunction $getCollapsedCaretRange(anchor) {\n  return $getCaretRange(anchor, anchor);\n}\n\n/**\n * Construct a CaretRange from anchor and focus carets pointing in the\n * same direction. In order to get the expected behavior,\n * the anchor must point towards the focus or be the same point.\n *\n * In the 'next' direction the anchor should be at or before the\n * focus in the document. In the 'previous' direction the anchor\n * should be at or after the focus in the document\n * (similar to a backwards RangeSelection).\n *\n * @param anchor\n * @param focus\n * @returns a CaretRange\n */\nfunction $getCaretRange(anchor, focus) {\n  if (!(anchor.direction === focus.direction)) {\n    formatDevErrorMessage(`$getCaretRange: anchor and focus must be in the same direction`);\n  }\n  return new CaretRangeImpl(anchor, focus, anchor.direction);\n}\n\n/**\n * A generalized utility for creating a stepwise iterator\n * based on:\n *\n * - an initial state\n * - a stop guard that returns true if the iteration is over, this\n *   is typically used to detect a sentinel value such as null or\n *   undefined from the state but may return true for other conditions\n *   as well\n * - a step function that advances the state (this will be called\n *   after map each time next() is called to prepare the next state)\n * - a map function that will be called that may transform the state\n *   before returning it. It will only be called once for each next()\n *   call when stop(state) === false\n *\n * @param config\n * @returns An IterableIterator\n */\nfunction makeStepwiseIterator(config) {\n  const {\n    initial,\n    hasNext,\n    step,\n    map\n  } = config;\n  let state = initial;\n  return {\n    [Symbol.iterator]() {\n      return this;\n    },\n    next() {\n      if (!hasNext(state)) {\n        return {\n          done: true,\n          value: undefined\n        };\n      }\n      const rval = {\n        done: false,\n        value: map(state)\n      };\n      state = step(state);\n      return rval;\n    }\n  };\n}\nfunction compareNumber(a, b) {\n  return Math.sign(a - b);\n}\n\n/**\n * A total ordering for `PointCaret<'next'>`, based on\n * the same order that a {@link CaretRange} would iterate\n * them.\n *\n * For a given origin node:\n * - ChildCaret comes before SiblingCaret\n * - TextPointCaret comes before SiblingCaret\n *\n * An exception is thrown when a and b do not have any\n * common ancestor.\n *\n * This ordering is a sort of mix of pre-order and post-order\n * because each ElementNode will show up as a ChildCaret\n * on 'enter' (pre-order) and a SiblingCaret on 'leave' (post-order).\n *\n * @param a\n * @param b\n * @returns -1 if a comes before b, 0 if a and b are the same, or 1 if a comes after b\n */\nfunction $comparePointCaretNext(a, b) {\n  const compare = $getCommonAncestor(a.origin, b.origin);\n  if (!(compare !== null)) {\n    formatDevErrorMessage(`$comparePointCaretNext: a (key ${a.origin.getKey()}) and b (key ${b.origin.getKey()}) do not have a common ancestor`);\n  }\n  switch (compare.type) {\n    case 'same':\n      {\n        const aIsText = a.type === 'text';\n        const bIsText = b.type === 'text';\n        return aIsText && bIsText ? compareNumber(a.offset, b.offset) : a.type === b.type ? 0 : aIsText ? -1 : bIsText ? 1 : a.type === 'child' ? -1 : 1;\n      }\n    case 'ancestor':\n      {\n        return a.type === 'child' ? -1 : 1;\n      }\n    case 'descendant':\n      {\n        return b.type === 'child' ? 1 : -1;\n      }\n    case 'branch':\n      {\n        return $getCommonAncestorResultBranchOrder(compare);\n      }\n  }\n}\n\n/**\n * Return the ordering of siblings in a {@link CommonAncestorResultBranch}\n * @param compare Returns -1 if a precedes b, 1 otherwise\n */\nfunction $getCommonAncestorResultBranchOrder(compare) {\n  const {\n    a,\n    b\n  } = compare;\n  const aKey = a.__key;\n  const bKey = b.__key;\n  let na = a;\n  let nb = b;\n  for (; na && nb; na = na.getNextSibling(), nb = nb.getNextSibling()) {\n    if (na.__key === bKey) {\n      return -1;\n    } else if (nb.__key === aKey) {\n      return 1;\n    }\n  }\n  return na === null ? 1 : -1;\n}\n\n/**\n * The two compared nodes are the same\n */\n\n/**\n * Node a was a descendant of node b, and not the same node\n */\n\n/**\n * Node a is an ancestor of node b, and not the same node\n */\n\n/**\n * Node a and node b have a common ancestor but are on different branches,\n * the `a` and `b` properties of this result are the ancestors of a and b\n * that are children of the commonAncestor. Since they are siblings, their\n * positions are comparable to determine order in the document.\n */\n\n/**\n * The result of comparing two nodes that share some common ancestor\n */\n\nfunction $isSameNode(reference, other) {\n  return other.is(reference);\n}\nfunction $initialElementTuple(node) {\n  return $isElementNode(node) ? [node.getLatest(), null] : [node.getParent(), node.getLatest()];\n}\n\n/**\n * Find a common ancestor of a and b and return a detailed result object,\n * or null if there is no common ancestor between the two nodes.\n *\n * The result object will have a commonAncestor property, and the other\n * properties can be used to quickly compare these positions in the tree.\n *\n * @param a A LexicalNode\n * @param b A LexicalNode\n * @returns A comparison result between the two nodes or null if they have no common ancestor\n */\nfunction $getCommonAncestor(a, b) {\n  if (a.is(b)) {\n    return {\n      commonAncestor: a,\n      type: 'same'\n    };\n  }\n  // Map of parent -> child entries based on a and its ancestors\n  const aMap = new Map();\n  for (let [parent, child] = $initialElementTuple(a); parent; child = parent, parent = parent.getParent()) {\n    aMap.set(parent, child);\n  }\n  for (let [parent, child] = $initialElementTuple(b); parent; child = parent, parent = parent.getParent()) {\n    const aChild = aMap.get(parent);\n    if (aChild === undefined) ; else if (aChild === null) {\n      // a is the ancestor\n      if (!$isSameNode(a, parent)) {\n        formatDevErrorMessage(`$originComparison: ancestor logic error`);\n      }\n      return {\n        commonAncestor: parent,\n        type: 'ancestor'\n      };\n    } else if (child === null) {\n      // b is the ancestor\n      if (!$isSameNode(b, parent)) {\n        formatDevErrorMessage(`$originComparison: descendant logic error`);\n      }\n      return {\n        commonAncestor: parent,\n        type: 'descendant'\n      };\n    } else {\n      if (!(($isElementNode(aChild) || $isSameNode(a, aChild)) && ($isElementNode(child) || $isSameNode(b, child)) && parent.is(aChild.getParent()) && parent.is(child.getParent()))) {\n        formatDevErrorMessage(`$originComparison: branch logic error`);\n      }\n      return {\n        a: aChild,\n        b: child,\n        commonAncestor: parent,\n        type: 'branch'\n      };\n    }\n  }\n  return null;\n}\n\n/**\n * @param point\n * @returns a PointCaret for the point\n */\nfunction $caretFromPoint(point, direction) {\n  const {\n    type,\n    key,\n    offset\n  } = point;\n  const node = $getNodeByKeyOrThrow(point.key);\n  if (type === 'text') {\n    if (!$isTextNode(node)) {\n      formatDevErrorMessage(`$caretFromPoint: Node with type ${node.getType()} and key ${key} that does not inherit from TextNode encountered for text point`);\n    }\n    return $getTextPointCaret(node, direction, offset);\n  }\n  if (!$isElementNode(node)) {\n    formatDevErrorMessage(`$caretFromPoint: Node with type ${node.getType()} and key ${key} that does not inherit from ElementNode encountered for element point`);\n  }\n  return $getChildCaretAtIndex(node, point.offset, direction);\n}\n\n/**\n * Update the given point in-place from the PointCaret\n *\n * @param point the point to set\n * @param caret the caret to set the point from\n */\nfunction $setPointFromCaret(point, caret) {\n  const {\n    origin,\n    direction\n  } = caret;\n  const isNext = direction === 'next';\n  if ($isTextPointCaret(caret)) {\n    point.set(origin.getKey(), caret.offset, 'text');\n  } else if ($isSiblingCaret(caret)) {\n    if ($isTextNode(origin)) {\n      point.set(origin.getKey(), $getTextNodeOffset(origin, direction), 'text');\n    } else {\n      point.set(origin.getParentOrThrow().getKey(), origin.getIndexWithinParent() + (isNext ? 1 : 0), 'element');\n    }\n  } else {\n    if (!($isChildCaret(caret) && $isElementNode(origin))) {\n      formatDevErrorMessage(`$setPointFromCaret: exhaustiveness check`);\n    }\n    point.set(origin.getKey(), isNext ? 0 : origin.getChildrenSize(), 'element');\n  }\n}\n\n/**\n * Set a RangeSelection on the editor from the given CaretRange\n *\n * @returns The new RangeSelection\n */\nfunction $setSelectionFromCaretRange(caretRange) {\n  const currentSelection = $getSelection();\n  const selection = $isRangeSelection(currentSelection) ? currentSelection : $createRangeSelection();\n  $updateRangeSelectionFromCaretRange(selection, caretRange);\n  $setSelection(selection);\n  return selection;\n}\n\n/**\n * Update the points of a RangeSelection based on the given PointCaret.\n */\nfunction $updateRangeSelectionFromCaretRange(selection, caretRange) {\n  $setPointFromCaret(selection.anchor, caretRange.anchor);\n  $setPointFromCaret(selection.focus, caretRange.focus);\n}\n\n/**\n * Get a pair of carets for a RangeSelection.\n *\n * If the focus is before the anchor, then the direction will be\n * 'previous', otherwise the direction will be 'next'.\n */\nfunction $caretRangeFromSelection(selection) {\n  const {\n    anchor,\n    focus\n  } = selection;\n  const anchorCaret = $caretFromPoint(anchor, 'next');\n  const focusCaret = $caretFromPoint(focus, 'next');\n  const direction = $comparePointCaretNext(anchorCaret, focusCaret) <= 0 ? 'next' : 'previous';\n  return $getCaretRange($getCaretInDirection(anchorCaret, direction), $getCaretInDirection(focusCaret, direction));\n}\n\n/**\n * Given a SiblingCaret we can always compute a caret that points to the\n * origin of that caret in the same direction. The adjacent caret of the\n * returned caret will be equivalent to the given caret.\n *\n * @example\n * ```ts\n * siblingCaret.is($rewindSiblingCaret(siblingCaret).getAdjacentCaret())\n * ```\n *\n * @param caret The caret to \"rewind\"\n * @returns A new caret (ChildCaret or SiblingCaret) with the same direction\n */\nfunction $rewindSiblingCaret(caret) {\n  const {\n    direction,\n    origin\n  } = caret;\n  // Rotate the direction around the origin and get the adjacent node\n  const rewindOrigin = $getSiblingCaret(origin, flipDirection(direction)).getNodeAtCaret();\n  return rewindOrigin ? $getSiblingCaret(rewindOrigin, direction) : $getChildCaret(origin.getParentOrThrow(), direction);\n}\nfunction $getAnchorCandidates(anchor, rootMode = 'root') {\n  // These candidates will be the anchor itself, the pointer to the anchor (if different), and then any parents of that\n  const carets = [anchor];\n  for (let parent = $isChildCaret(anchor) ? anchor.getParentCaret(rootMode) : anchor.getSiblingCaret(); parent !== null; parent = parent.getParentCaret(rootMode)) {\n    carets.push($rewindSiblingCaret(parent));\n  }\n  return carets;\n}\nfunction $isCaretAttached(caret) {\n  return !!caret && caret.origin.isAttached();\n}\n\n/**\n * Remove all text and nodes in the given range. If the range spans multiple\n * blocks then the remaining contents of the later block will be merged with\n * the earlier block.\n *\n * @param initialRange The range to remove text and nodes from\n * @param sliceMode If 'preserveEmptyTextPointCaret' it will leave an empty TextPointCaret at the anchor for insert if one exists, otherwise empty slices will be removed\n * @returns The new collapsed range (biased towards the earlier node)\n */\nfunction $removeTextFromCaretRange(initialRange, sliceMode = 'removeEmptySlices') {\n  if (initialRange.isCollapsed()) {\n    return initialRange;\n  }\n  // Always process removals in document order\n  const rootMode = 'root';\n  const nextDirection = 'next';\n  let sliceState = sliceMode;\n  const range = $getCaretRangeInDirection(initialRange, nextDirection);\n  const anchorCandidates = $getAnchorCandidates(range.anchor, rootMode);\n  const focusCandidates = $getAnchorCandidates(range.focus.getFlipped(), rootMode);\n\n  // Mark the start of each ElementNode\n  const seenStart = new Set();\n  // Queue removals since removing the only child can cascade to having\n  // a parent remove itself which will affect iteration\n  const removedNodes = [];\n  for (const caret of range.iterNodeCarets(rootMode)) {\n    if ($isChildCaret(caret)) {\n      seenStart.add(caret.origin.getKey());\n    } else if ($isSiblingCaret(caret)) {\n      const {\n        origin\n      } = caret;\n      if (!$isElementNode(origin) || seenStart.has(origin.getKey())) {\n        removedNodes.push(origin);\n      }\n    }\n  }\n  for (const node of removedNodes) {\n    node.remove();\n  }\n\n  // Splice text at the anchor and/or origin.\n  // If the text is entirely selected then it is removed (unless it is the first slice and sliceMode is preserveEmptyTextSliceCaret).\n  // If it's a token with a non-empty selection then it is removed.\n  // Segmented nodes will be copied to a plain text node with the same format\n  // and style and set to normal mode.\n  for (const slice of range.getTextSlices()) {\n    if (!slice) {\n      continue;\n    }\n    const {\n      origin\n    } = slice.caret;\n    const contentSize = origin.getTextContentSize();\n    const caretBefore = $rewindSiblingCaret($getSiblingCaret(origin, nextDirection));\n    const mode = origin.getMode();\n    if (Math.abs(slice.distance) === contentSize && sliceState === 'removeEmptySlices' || mode === 'token' && slice.distance !== 0) {\n      // anchorCandidates[1] should still be valid, it is caretBefore\n      caretBefore.remove();\n    } else if (slice.distance !== 0) {\n      sliceState = 'removeEmptySlices';\n      let nextCaret = slice.removeTextSlice();\n      const sliceOrigin = slice.caret.origin;\n      if (mode === 'segmented') {\n        const src = nextCaret.origin;\n        const plainTextNode = $createTextNode(src.getTextContent()).setStyle(src.getStyle()).setFormat(src.getFormat());\n        caretBefore.replaceOrInsert(plainTextNode);\n        nextCaret = $getTextPointCaret(plainTextNode, nextDirection, nextCaret.offset);\n      }\n      if (sliceOrigin.is(anchorCandidates[0].origin)) {\n        anchorCandidates[0] = nextCaret;\n      }\n      if (sliceOrigin.is(focusCandidates[0].origin)) {\n        focusCandidates[0] = nextCaret.getFlipped();\n      }\n    }\n  }\n\n  // Find the deepest anchor and focus candidates that are\n  // still attached\n  let anchorCandidate;\n  let focusCandidate;\n  for (const candidate of anchorCandidates) {\n    if ($isCaretAttached(candidate)) {\n      anchorCandidate = $normalizeCaret(candidate);\n      break;\n    }\n  }\n  for (const candidate of focusCandidates) {\n    if ($isCaretAttached(candidate)) {\n      focusCandidate = $normalizeCaret(candidate);\n      break;\n    }\n  }\n\n  // Merge blocks if necessary\n  const mergeTargets = $getBlockMergeTargets(anchorCandidate, focusCandidate, seenStart);\n  if (mergeTargets) {\n    const [anchorBlock, focusBlock] = mergeTargets;\n    // always merge blocks later in the document with\n    // blocks earlier in the document\n    $getChildCaret(anchorBlock, 'previous').splice(0, focusBlock.getChildren());\n    // remove empty parent node even if parent node is canBeEmpty\n    let parent = focusBlock.getParent();\n    focusBlock.remove(true);\n    while (parent && parent.isEmpty()) {\n      const element = parent;\n      parent = parent.getParent();\n      element.remove(true);\n    }\n  }\n\n  // note this caret can be in either direction\n  const bestCandidate = [anchorCandidate, focusCandidate, ...anchorCandidates, ...focusCandidates].find($isCaretAttached);\n  if (bestCandidate) {\n    const anchor = $getCaretInDirection($normalizeCaret(bestCandidate), initialRange.direction);\n    return $getCollapsedCaretRange(anchor);\n  }\n  {\n    formatDevErrorMessage(`$removeTextFromCaretRange: selection was lost, could not find a new anchor given candidates with keys: ${JSON.stringify(anchorCandidates.map(n => n.origin.__key))}`);\n  }\n}\n\n/**\n * Determine if the two caret origins are in distinct blocks that\n * should be merged.\n *\n * The returned block pair will be the closest blocks to their\n * common ancestor, and must be no shadow roots between\n * the blocks and their respective carets. If two distinct\n * blocks matching this criteria are not found, this will return\n * null.\n */\nfunction $getBlockMergeTargets(anchor, focus, seenStart) {\n  if (!anchor || !focus) {\n    return null;\n  }\n  const anchorParent = anchor.getParentAtCaret();\n  const focusParent = focus.getParentAtCaret();\n  if (!anchorParent || !focusParent) {\n    return null;\n  }\n  // TODO refactor when we have a better primitive for common ancestor\n  const anchorElements = anchorParent.getParents().reverse();\n  anchorElements.push(anchorParent);\n  const focusElements = focusParent.getParents().reverse();\n  focusElements.push(focusParent);\n  const maxLen = Math.min(anchorElements.length, focusElements.length);\n  let commonAncestorCount;\n  for (commonAncestorCount = 0; commonAncestorCount < maxLen && anchorElements[commonAncestorCount] === focusElements[commonAncestorCount]; commonAncestorCount++) {\n    // just traverse the ancestors\n  }\n  const $getBlock = (arr, predicate) => {\n    let block;\n    for (let i = commonAncestorCount; i < arr.length; i++) {\n      const ancestor = arr[i];\n      if ($isRootOrShadowRoot(ancestor)) {\n        return;\n      } else if (!block && predicate(ancestor)) {\n        block = ancestor;\n      }\n    }\n    return block;\n  };\n  const anchorBlock = $getBlock(anchorElements, INTERNAL_$isBlock);\n  const focusBlock = anchorBlock && $getBlock(focusElements, node => seenStart.has(node.getKey()) && INTERNAL_$isBlock(node));\n  return anchorBlock && focusBlock ? [anchorBlock, focusBlock] : null;\n}\n\n/**\n * Return the deepest ChildCaret that has initialCaret's origin\n * as an ancestor, or initialCaret if the origin is not an ElementNode\n * or is already the deepest ChildCaret.\n *\n * This is generally used when normalizing because there is\n * \"zero distance\" between these locations.\n *\n * @param initialCaret\n * @returns Either a deeper ChildCaret or the given initialCaret\n */\nfunction $getDeepestChildOrSelf(initialCaret) {\n  let caret = initialCaret;\n  while ($isChildCaret(caret)) {\n    const adjacent = $getAdjacentChildCaret(caret);\n    if (!$isChildCaret(adjacent)) {\n      break;\n    }\n    caret = adjacent;\n  }\n  return caret;\n}\n\n/**\n * Normalize a caret to the deepest equivalent PointCaret.\n * This will return a TextPointCaret with the offset set according\n * to the direction if given a caret with a TextNode origin\n * or a caret with an ElementNode origin with the deepest ChildCaret\n * having an adjacent TextNode.\n *\n * If given a TextPointCaret, it will be returned, as no normalization\n * is required when an offset is already present.\n *\n * @param initialCaret\n * @returns The normalized PointCaret\n */\nfunction $normalizeCaret(initialCaret) {\n  const caret = $getDeepestChildOrSelf(initialCaret.getLatest());\n  const {\n    direction\n  } = caret;\n  if ($isTextNode(caret.origin)) {\n    return $isTextPointCaret(caret) ? caret : $getTextPointCaret(caret.origin, direction, direction);\n  }\n  const adj = caret.getAdjacentCaret();\n  return $isSiblingCaret(adj) && $isTextNode(adj.origin) ? $getTextPointCaret(adj.origin, direction, flipDirection(direction)) : caret;\n}\n/**\n * Determine whether the TextPointCaret's offset can be extended further without leaving the TextNode.\n * Returns false if the given caret is not a TextPointCaret or the offset can not be moved further in\n * direction.\n *\n * @param caret A PointCaret\n * @returns true if caret is a TextPointCaret with an offset that is not at the end of the text given the direction.\n */\nfunction $isExtendableTextPointCaret(caret) {\n  return $isTextPointCaret(caret) && caret.offset !== $getTextNodeOffset(caret.origin, caret.direction);\n}\n\n/**\n * Return the caret if it's in the given direction, otherwise return\n * caret.getFlipped().\n *\n * @param caret Any PointCaret\n * @param direction The desired direction\n * @returns A PointCaret in direction\n */\nfunction $getCaretInDirection(caret, direction) {\n  return caret.direction === direction ? caret : caret.getFlipped();\n}\n\n/**\n * Return the range if it's in the given direction, otherwise\n * construct a new range using a flipped focus as the anchor\n * and a flipped anchor as the focus. This transformation\n * preserves the section of the document that it's working\n * with, but reverses the order of iteration.\n *\n * @param range Any CaretRange\n * @param direction The desired direction\n * @returns A CaretRange in direction\n */\nfunction $getCaretRangeInDirection(range, direction) {\n  if (range.direction === direction) {\n    return range;\n  }\n  return $getCaretRange(\n  // focus and anchor get flipped here\n  $getCaretInDirection(range.focus, direction), $getCaretInDirection(range.anchor, direction));\n}\n\n/**\n * Get a caret pointing at the child at the given index, or the last\n * caret in that node if out of bounds.\n *\n * @param parent An ElementNode\n * @param index The index of the origin for the caret\n * @returns A caret pointing towards the node at that index\n */\nfunction $getChildCaretAtIndex(parent, index, direction) {\n  let caret = $getChildCaret(parent, 'next');\n  for (let i = 0; i < index; i++) {\n    const nextCaret = caret.getAdjacentCaret();\n    if (nextCaret === null) {\n      break;\n    }\n    caret = nextCaret;\n  }\n  return $getCaretInDirection(caret, direction);\n}\n\n/**\n * Returns the Node sibling when this exists, otherwise the closest parent sibling. For example\n * R -> P -> T1, T2\n *   -> P2\n * returns T2 for node T1, P2 for node T2, and null for node P2.\n * @param startCaret The initial caret\n * @param rootMode The root mode, 'root' (default) or 'shadowRoot'\n * @returns An array (tuple) containing the found caret and the depth difference, or null, if this node doesn't exist.\n */\nfunction $getAdjacentSiblingOrParentSiblingCaret(startCaret, rootMode = 'root') {\n  let depthDiff = 0;\n  let caret = startCaret;\n  let nextCaret = $getAdjacentChildCaret(caret);\n  while (nextCaret === null) {\n    depthDiff--;\n    nextCaret = caret.getParentCaret(rootMode);\n    if (!nextCaret) {\n      return null;\n    }\n    caret = nextCaret;\n    nextCaret = $getAdjacentChildCaret(caret);\n  }\n  return nextCaret && [nextCaret, depthDiff];\n}\n\n/**\n * Get the adjacent nodes to initialCaret in the given direction.\n *\n * @example\n * ```ts\n * expect($getAdjacentNodes($getChildCaret(parent, 'next'))).toEqual(parent.getChildren());\n * expect($getAdjacentNodes($getChildCaret(parent, 'previous'))).toEqual(parent.getChildren().reverse());\n * expect($getAdjacentNodes($getSiblingCaret(node, 'next'))).toEqual(node.getNextSiblings());\n * expect($getAdjacentNodes($getSiblingCaret(node, 'previous'))).toEqual(node.getPreviousSiblings().reverse());\n * ```\n *\n * @param initialCaret The caret to start at (the origin will not be included)\n * @returns An array of siblings.\n */\nfunction $getAdjacentNodes(initialCaret) {\n  const siblings = [];\n  for (let caret = initialCaret.getAdjacentCaret(); caret; caret = caret.getAdjacentCaret()) {\n    siblings.push(caret.origin);\n  }\n  return siblings;\n}\nfunction $splitTextPointCaret(textPointCaret) {\n  const {\n    origin,\n    offset,\n    direction\n  } = textPointCaret;\n  if (offset === $getTextNodeOffset(origin, direction)) {\n    return textPointCaret.getSiblingCaret();\n  } else if (offset === $getTextNodeOffset(origin, flipDirection(direction))) {\n    return $rewindSiblingCaret(textPointCaret.getSiblingCaret());\n  }\n  const [textNode] = origin.splitText(offset);\n  if (!$isTextNode(textNode)) {\n    formatDevErrorMessage(`$splitTextPointCaret: splitText must return at least one TextNode`);\n  }\n  return $getCaretInDirection($getSiblingCaret(textNode, 'next'), direction);\n}\nfunction $alwaysSplit(_node, _edge) {\n  return true;\n}\n\n/**\n * Split a node at a PointCaret and return a NodeCaret at that point, or null if the\n * node can't be split. This is non-recursive and will only perform at most one split.\n *\n * @returns The NodeCaret pointing to the location of the split (or null if a split is not possible)\n */\nfunction $splitAtPointCaretNext(pointCaret, {\n  $copyElementNode = $copyNode,\n  $splitTextPointCaretNext = $splitTextPointCaret,\n  rootMode = 'shadowRoot',\n  $shouldSplit = $alwaysSplit,\n  removeEmptyDestination = false\n} = {}) {\n  if ($isTextPointCaret(pointCaret)) {\n    return $splitTextPointCaretNext(pointCaret);\n  }\n  const parentCaret = pointCaret.getParentCaret(rootMode);\n  if (parentCaret) {\n    const {\n      origin\n    } = parentCaret;\n    if ($isChildCaret(pointCaret)) {\n      const beforeParentCaret = $rewindSiblingCaret(parentCaret);\n      if (removeEmptyDestination && origin.isEmpty()) {\n        origin.remove();\n        return beforeParentCaret;\n      }\n      if (!(origin.canBeEmpty() && $shouldSplit(origin, 'first'))) {\n        return beforeParentCaret;\n      }\n    }\n    const siblings = $getAdjacentNodes(pointCaret);\n    if (siblings.length > 0 || !removeEmptyDestination && origin.canBeEmpty() && $shouldSplit(origin, 'last')) {\n      // Split and insert the siblings into the new tree\n      parentCaret.insert($copyElementNode(origin).splice(0, 0, siblings));\n    }\n  }\n  return parentCaret;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * Define a LexicalExtension from the given object literal. TypeScript will\n * infer Config and Name in most cases, but you may want to use\n * {@link safeCast} for config if there are default fields or varying types.\n *\n * @param extension - The LexicalExtension\n * @returns The unmodified extension argument (this is only an inference helper)\n *\n * @example\n * Basic example\n * ```ts\n * export const MyExtension = defineExtension({\n *   // Extension names must be unique in an editor\n *   name: \"my\",\n *   nodes: [MyNode],\n * });\n * ```\n *\n * @example\n * Extension with optional configuration\n * ```ts\n * export interface ConfigurableConfig {\n *   optional?: string;\n *   required: number;\n * }\n * export const ConfigurableExtension = defineExtension({\n *   name: \"configurable\",\n *   // The Extension's config must satisfy the full config type,\n *   // but using the Extension as a dependency never requires\n *   // configuration and any partial of the config can be specified\n *   config: safeCast<ConfigurableConfig>({ required: 1 }),\n * });\n * ```\n *\n * @__NO_SIDE_EFFECTS__\n */\nfunction defineExtension(extension) {\n  return extension;\n}\n\n/**\n * Override a partial of the configuration of an Extension, to be used\n * in the dependencies array of another extension, or as\n * an argument to {@link buildEditorFromExtensions}.\n *\n * Before building the editor, configurations will be merged using\n * `extension.mergeConfig(extension, config)` or {@link shallowMergeConfig} if\n * this is not directly implemented by the Extension.\n *\n * @param args - An extension followed by one or more config partials for that extension\n * @returns `[extension, config, ...configs]`\n *\n * @example\n * ```ts\n * export const ReactDecoratorExtension = defineExtension({\n *   name: \"react-decorator\",\n *   dependencies: [\n *     configExtension(ReactExtension, {\n *       decorators: [<ReactDecorator />]\n *     }),\n *   ],\n * });\n * ```\n *\n * @__NO_SIDE_EFFECTS__\n */\nfunction configExtension(...args) {\n  return args;\n}\n\n/**\n * Used to declare a peer dependency of an extension in a type-safe way,\n * requires the type parameter. The most common use case for peer dependencies\n * is to avoid a direct import dependency, so you would want to use a\n * type import or the import type (shown in below examples).\n *\n * @param name - The extension's name\n * @param config - An optional config override\n * @returns NormalizedPeerDependency\n *\n * @example\n * ```ts\n * import type {FooExtension} from \"foo\";\n *\n * export const PeerExtension = defineExtension({\n *   name: 'PeerExtension',\n *   peerDependencies: [\n *     declarePeerDependency<FooExtension>(\"foo\"),\n *     declarePeerDependency<typeof import(\"bar\").BarExtension>(\"bar\", {config: \"bar\"}),\n *   ],\n * });\n * ```\n *\n * @__NO_SIDE_EFFECTS__\n */\nfunction declarePeerDependency(name, config) {\n  return [name, config];\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * Explicitly and safely cast a value to a specific type when inference or\n * satisfies isn't going to work as expected (often useful for the config\n * property with {@link defineExtension})\n *\n * @__NO_SIDE_EFFECTS__\n */\nfunction safeCast(value) {\n  return value;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * The default merge strategy for extension configuration is a shallow merge.\n *\n * @param config - A full config\n * @param overrides - A partial config of overrides\n * @returns config if there are no overrides, otherwise `{...config, ...overrides}`\n */\nfunction shallowMergeConfig(config, overrides) {\n  if (!overrides || config === overrides) {\n    return config;\n  }\n  for (const k in overrides) {\n    if (config[k] !== overrides[k]) {\n      return {\n        ...config,\n        ...overrides\n      };\n    }\n  }\n  return config;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/** @internal */\nfunction normalizeClassNames(...classNames) {\n  const rval = [];\n  for (const className of classNames) {\n    if (className && typeof className === 'string') {\n      for (const [s] of className.matchAll(/\\S+/g)) {\n        rval.push(s);\n      }\n    }\n  }\n  return rval;\n}\n\n/**\n * Takes an HTML element and adds the classNames passed within an array,\n * ignoring any non-string types. A space can be used to add multiple classes\n * eg. addClassNamesToElement(element, ['element-inner active', true, null])\n * will add both 'element-inner' and 'active' as classes to that element.\n * @param element - The element in which the classes are added\n * @param classNames - An array defining the class names to add to the element\n */\nfunction addClassNamesToElement(element, ...classNames) {\n  const classesToAdd = normalizeClassNames(...classNames);\n  if (classesToAdd.length > 0) {\n    element.classList.add(...classesToAdd);\n  }\n}\n\n/**\n * Takes an HTML element and removes the classNames passed within an array,\n * ignoring any non-string types. A space can be used to remove multiple classes\n * eg. removeClassNamesFromElement(element, ['active small', true, null])\n * will remove both the 'active' and 'small' classes from that element.\n * @param element - The element in which the classes are removed\n * @param classNames - An array defining the class names to remove from the element\n */\nfunction removeClassNamesFromElement(element, ...classNames) {\n  const classesToRemove = normalizeClassNames(...classNames);\n  if (classesToRemove.length > 0) {\n    element.classList.remove(...classesToRemove);\n  }\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * Returns a function that will execute all functions passed when called. It is generally used\n * to register multiple lexical listeners and then tear them down with a single function call, such\n * as React's useEffect hook.\n * @example\n * ```ts\n * useEffect(() => {\n *   return mergeRegister(\n *     editor.registerCommand(...registerCommand1 logic),\n *     editor.registerCommand(...registerCommand2 logic),\n *     editor.registerCommand(...registerCommand3 logic)\n *   )\n * }, [editor])\n * ```\n * In this case, useEffect is returning the function returned by mergeRegister as a cleanup\n * function to be executed after either the useEffect runs again (due to one of its dependencies\n * updating) or the component it resides in unmounts.\n * Note the functions don't necessarily need to be in an array as all arguments\n * are considered to be the func argument and spread from there.\n * The order of cleanup is the reverse of the argument order. Generally it is\n * expected that the first \"acquire\" will be \"released\" last (LIFO order),\n * because a later step may have some dependency on an earlier one.\n * @param func - An array of cleanup functions meant to be executed by the returned function.\n * @returns the function which executes all the passed cleanup functions.\n */\nfunction mergeRegister(...func) {\n  return () => {\n    for (let i = func.length - 1; i >= 0; i--) {\n      func[i]();\n    }\n    // Clean up the references and make future calls a no-op\n    func.length = 0;\n  };\n}\n\nexport { $addUpdateTag, $applyNodeReplacement, $caretFromPoint, $caretRangeFromSelection, $cloneWithProperties, $cloneWithPropertiesEphemeral, $comparePointCaretNext, $copyNode, $create, $createChildrenArray, $createLineBreakNode, $createNodeSelection, $createParagraphNode, $createPoint, $createRangeSelection, $createRangeSelectionFromDom, $createTabNode, $createTextNode, $extendCaretToRange, $findMatchingParent, $getAdjacentChildCaret, $getAdjacentNode, $getAdjacentSiblingOrParentSiblingCaret, $getCaretInDirection, $getCaretRange, $getCaretRangeInDirection, $getCharacterOffsets, $getChildCaret, $getChildCaretAtIndex, $getChildCaretOrSelf, $getCollapsedCaretRange, $getCommonAncestor, $getCommonAncestorResultBranchOrder, $getEditor, $getEditorDOMRenderConfig, $getNearestNodeFromDOMNode, $getNearestRootOrShadowRoot, $getNodeByKey, $getNodeByKeyOrThrow, $getNodeFromDOMNode, $getPreviousSelection, $getRoot, $getSelection, $getSiblingCaret, $getState, $getStateChange, $getTextContent, $getTextNodeOffset, $getTextPointCaret, $getTextPointCaretSlice, $getWritableNodeState, $hasAncestor, $hasUpdateTag, $insertNodes, $isBlockElementNode, $isChildCaret, $isDecoratorNode, $isEditorState, $isElementNode, $isExtendableTextPointCaret, $isInlineElementOrDecoratorNode, $isLeafNode, $isLexicalNode, $isLineBreakNode, $isNodeCaret, $isNodeSelection, $isParagraphNode, $isRangeSelection, $isRootNode, $isRootOrShadowRoot, $isSiblingCaret, $isTabNode, $isTextNode, $isTextPointCaret, $isTextPointCaretSlice, $isTokenOrSegmented, $isTokenOrTab, $nodesOfType, $normalizeCaret, $normalizeSelection as $normalizeSelection__EXPERIMENTAL, $onUpdate, $parseSerializedNode, $removeTextFromCaretRange, $rewindSiblingCaret, $selectAll, $setCompositionKey, $setPointFromCaret, $setSelection, $setSelectionFromCaretRange, $setState, $splitAtPointCaretNext, $splitNode, $updateRangeSelectionFromCaretRange, ArtificialNode__DO_NOT_USE, BEFORE_INPUT_COMMAND, BLUR_COMMAND, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, CLEAR_EDITOR_COMMAND, CLEAR_HISTORY_COMMAND, CLICK_COMMAND, COLLABORATION_TAG, COMMAND_PRIORITY_BEFORE_CRITICAL, COMMAND_PRIORITY_BEFORE_EDITOR, COMMAND_PRIORITY_BEFORE_HIGH, COMMAND_PRIORITY_BEFORE_LOW, COMMAND_PRIORITY_BEFORE_NORMAL, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, COMMAND_PRIORITY_NORMAL, COMPOSITION_END_COMMAND, COMPOSITION_END_TAG, COMPOSITION_START_COMMAND, COMPOSITION_START_TAG, CONTROLLED_TEXT_INSERTION_COMMAND, COPY_COMMAND, CUT_COMMAND, DEFAULT_EDITOR_DOM_CONFIG, DELETE_CHARACTER_COMMAND, DELETE_LINE_COMMAND, DELETE_WORD_COMMAND, DRAGEND_COMMAND, DRAGOVER_COMMAND, DRAGSTART_COMMAND, DROP_COMMAND, DecoratorNode, ElementNode, FOCUS_COMMAND, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, HISTORIC_TAG, HISTORY_MERGE_TAG, HISTORY_PUSH_TAG, INDENT_CONTENT_COMMAND, INPUT_COMMAND, INSERT_LINE_BREAK_COMMAND, INSERT_PARAGRAPH_COMMAND, INSERT_TAB_COMMAND, INTERNAL_$isBlock, IS_ALL_FORMATTING, IS_BOLD, IS_CODE, IS_HIGHLIGHT, IS_ITALIC, IS_STRIKETHROUGH, IS_SUBSCRIPT, IS_SUPERSCRIPT, IS_UNDERLINE, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_LEFT_COMMAND, KEY_ARROW_RIGHT_COMMAND, KEY_ARROW_UP_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND, KEY_DOWN_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND, KEY_MODIFIER_COMMAND, KEY_SPACE_COMMAND, KEY_TAB_COMMAND, LineBreakNode, MOVE_TO_END, MOVE_TO_START, NODE_STATE_KEY, OUTDENT_CONTENT_COMMAND, PASTE_COMMAND, PASTE_TAG, ParagraphNode, REDO_COMMAND, REMOVE_TEXT_COMMAND, RootNode, SELECTION_CHANGE_COMMAND, SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, SELECT_ALL_COMMAND, SKIP_COLLAB_TAG, SKIP_DOM_SELECTION_TAG, SKIP_SCROLL_INTO_VIEW_TAG, SKIP_SELECTION_FOCUS_TAG, TEXT_TYPE_TO_FORMAT, TabNode, TextNode, UNDO_COMMAND, addClassNamesToElement, buildImportMap, configExtension, createCommand, createEditor, createSharedNodeState, createState, declarePeerDependency, defineExtension, flipDirection, getDOMOwnerDocument, getDOMSelection, getDOMSelectionFromTarget, getDOMTextNode, getEditorPropertyFromDOMNode, getNearestEditorFromDOMNode, getRegisteredNode, getRegisteredNodeOrThrow, getStaticNodeConfig, getStyleObjectFromCSS, getTextDirection, getTransformSetFromKlass, isBlockDomNode, isCurrentlyReadOnlyMode, isDOMDocumentNode, isDOMNode, isDOMTextNode, isDOMUnmanaged, isDocumentFragment, isExactShortcutMatch, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, isLexicalEditor, isModifierMatch, isSelectionCapturedInDecoratorInput, isSelectionWithinEditor, makeStepwiseIterator, mergeRegister, normalizeClassNames, removeClassNamesFromElement, removeFromParent, resetRandomKey, safeCast, setDOMStyleFromCSS, setDOMStyleObject, setDOMUnmanaged, setNodeIndentFromDOM, shallowMergeConfig, toggleTextFormatType };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './Lexical.dev.mjs';\nimport * as modProd from './Lexical.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const $addUpdateTag = mod.$addUpdateTag;\nexport const $applyNodeReplacement = mod.$applyNodeReplacement;\nexport const $caretFromPoint = mod.$caretFromPoint;\nexport const $caretRangeFromSelection = mod.$caretRangeFromSelection;\nexport const $cloneWithProperties = mod.$cloneWithProperties;\nexport const $cloneWithPropertiesEphemeral = mod.$cloneWithPropertiesEphemeral;\nexport const $comparePointCaretNext = mod.$comparePointCaretNext;\nexport const $copyNode = mod.$copyNode;\nexport const $create = mod.$create;\nexport const $createChildrenArray = mod.$createChildrenArray;\nexport const $createLineBreakNode = mod.$createLineBreakNode;\nexport const $createNodeSelection = mod.$createNodeSelection;\nexport const $createParagraphNode = mod.$createParagraphNode;\nexport const $createPoint = mod.$createPoint;\nexport const $createRangeSelection = mod.$createRangeSelection;\nexport const $createRangeSelectionFromDom = mod.$createRangeSelectionFromDom;\nexport const $createTabNode = mod.$createTabNode;\nexport const $createTextNode = mod.$createTextNode;\nexport const $extendCaretToRange = mod.$extendCaretToRange;\nexport const $findMatchingParent = mod.$findMatchingParent;\nexport const $getAdjacentChildCaret = mod.$getAdjacentChildCaret;\nexport const $getAdjacentNode = mod.$getAdjacentNode;\nexport const $getAdjacentSiblingOrParentSiblingCaret = mod.$getAdjacentSiblingOrParentSiblingCaret;\nexport const $getCaretInDirection = mod.$getCaretInDirection;\nexport const $getCaretRange = mod.$getCaretRange;\nexport const $getCaretRangeInDirection = mod.$getCaretRangeInDirection;\nexport const $getCharacterOffsets = mod.$getCharacterOffsets;\nexport const $getChildCaret = mod.$getChildCaret;\nexport const $getChildCaretAtIndex = mod.$getChildCaretAtIndex;\nexport const $getChildCaretOrSelf = mod.$getChildCaretOrSelf;\nexport const $getCollapsedCaretRange = mod.$getCollapsedCaretRange;\nexport const $getCommonAncestor = mod.$getCommonAncestor;\nexport const $getCommonAncestorResultBranchOrder = mod.$getCommonAncestorResultBranchOrder;\nexport const $getEditor = mod.$getEditor;\nexport const $getEditorDOMRenderConfig = mod.$getEditorDOMRenderConfig;\nexport const $getNearestNodeFromDOMNode = mod.$getNearestNodeFromDOMNode;\nexport const $getNearestRootOrShadowRoot = mod.$getNearestRootOrShadowRoot;\nexport const $getNodeByKey = mod.$getNodeByKey;\nexport const $getNodeByKeyOrThrow = mod.$getNodeByKeyOrThrow;\nexport const $getNodeFromDOMNode = mod.$getNodeFromDOMNode;\nexport const $getPreviousSelection = mod.$getPreviousSelection;\nexport const $getRoot = mod.$getRoot;\nexport const $getSelection = mod.$getSelection;\nexport const $getSiblingCaret = mod.$getSiblingCaret;\nexport const $getState = mod.$getState;\nexport const $getStateChange = mod.$getStateChange;\nexport const $getTextContent = mod.$getTextContent;\nexport const $getTextNodeOffset = mod.$getTextNodeOffset;\nexport const $getTextPointCaret = mod.$getTextPointCaret;\nexport const $getTextPointCaretSlice = mod.$getTextPointCaretSlice;\nexport const $getWritableNodeState = mod.$getWritableNodeState;\nexport const $hasAncestor = mod.$hasAncestor;\nexport const $hasUpdateTag = mod.$hasUpdateTag;\nexport const $insertNodes = mod.$insertNodes;\nexport const $isBlockElementNode = mod.$isBlockElementNode;\nexport const $isChildCaret = mod.$isChildCaret;\nexport const $isDecoratorNode = mod.$isDecoratorNode;\nexport const $isEditorState = mod.$isEditorState;\nexport const $isElementNode = mod.$isElementNode;\nexport const $isExtendableTextPointCaret = mod.$isExtendableTextPointCaret;\nexport const $isInlineElementOrDecoratorNode = mod.$isInlineElementOrDecoratorNode;\nexport const $isLeafNode = mod.$isLeafNode;\nexport const $isLexicalNode = mod.$isLexicalNode;\nexport const $isLineBreakNode = mod.$isLineBreakNode;\nexport const $isNodeCaret = mod.$isNodeCaret;\nexport const $isNodeSelection = mod.$isNodeSelection;\nexport const $isParagraphNode = mod.$isParagraphNode;\nexport const $isRangeSelection = mod.$isRangeSelection;\nexport const $isRootNode = mod.$isRootNode;\nexport const $isRootOrShadowRoot = mod.$isRootOrShadowRoot;\nexport const $isSiblingCaret = mod.$isSiblingCaret;\nexport const $isTabNode = mod.$isTabNode;\nexport const $isTextNode = mod.$isTextNode;\nexport const $isTextPointCaret = mod.$isTextPointCaret;\nexport const $isTextPointCaretSlice = mod.$isTextPointCaretSlice;\nexport const $isTokenOrSegmented = mod.$isTokenOrSegmented;\nexport const $isTokenOrTab = mod.$isTokenOrTab;\nexport const $nodesOfType = mod.$nodesOfType;\nexport const $normalizeCaret = mod.$normalizeCaret;\nexport const $normalizeSelection__EXPERIMENTAL = mod.$normalizeSelection__EXPERIMENTAL;\nexport const $onUpdate = mod.$onUpdate;\nexport const $parseSerializedNode = mod.$parseSerializedNode;\nexport const $removeTextFromCaretRange = mod.$removeTextFromCaretRange;\nexport const $rewindSiblingCaret = mod.$rewindSiblingCaret;\nexport const $selectAll = mod.$selectAll;\nexport const $setCompositionKey = mod.$setCompositionKey;\nexport const $setPointFromCaret = mod.$setPointFromCaret;\nexport const $setSelection = mod.$setSelection;\nexport const $setSelectionFromCaretRange = mod.$setSelectionFromCaretRange;\nexport const $setState = mod.$setState;\nexport const $splitAtPointCaretNext = mod.$splitAtPointCaretNext;\nexport const $splitNode = mod.$splitNode;\nexport const $updateRangeSelectionFromCaretRange = mod.$updateRangeSelectionFromCaretRange;\nexport const ArtificialNode__DO_NOT_USE = mod.ArtificialNode__DO_NOT_USE;\nexport const BEFORE_INPUT_COMMAND = mod.BEFORE_INPUT_COMMAND;\nexport const BLUR_COMMAND = mod.BLUR_COMMAND;\nexport const CAN_REDO_COMMAND = mod.CAN_REDO_COMMAND;\nexport const CAN_UNDO_COMMAND = mod.CAN_UNDO_COMMAND;\nexport const CLEAR_EDITOR_COMMAND = mod.CLEAR_EDITOR_COMMAND;\nexport const CLEAR_HISTORY_COMMAND = mod.CLEAR_HISTORY_COMMAND;\nexport const CLICK_COMMAND = mod.CLICK_COMMAND;\nexport const COLLABORATION_TAG = mod.COLLABORATION_TAG;\nexport const COMMAND_PRIORITY_BEFORE_CRITICAL = mod.COMMAND_PRIORITY_BEFORE_CRITICAL;\nexport const COMMAND_PRIORITY_BEFORE_EDITOR = mod.COMMAND_PRIORITY_BEFORE_EDITOR;\nexport const COMMAND_PRIORITY_BEFORE_HIGH = mod.COMMAND_PRIORITY_BEFORE_HIGH;\nexport const COMMAND_PRIORITY_BEFORE_LOW = mod.COMMAND_PRIORITY_BEFORE_LOW;\nexport const COMMAND_PRIORITY_BEFORE_NORMAL = mod.COMMAND_PRIORITY_BEFORE_NORMAL;\nexport const COMMAND_PRIORITY_CRITICAL = mod.COMMAND_PRIORITY_CRITICAL;\nexport const COMMAND_PRIORITY_EDITOR = mod.COMMAND_PRIORITY_EDITOR;\nexport const COMMAND_PRIORITY_HIGH = mod.COMMAND_PRIORITY_HIGH;\nexport const COMMAND_PRIORITY_LOW = mod.COMMAND_PRIORITY_LOW;\nexport const COMMAND_PRIORITY_NORMAL = mod.COMMAND_PRIORITY_NORMAL;\nexport const COMPOSITION_END_COMMAND = mod.COMPOSITION_END_COMMAND;\nexport const COMPOSITION_END_TAG = mod.COMPOSITION_END_TAG;\nexport const COMPOSITION_START_COMMAND = mod.COMPOSITION_START_COMMAND;\nexport const COMPOSITION_START_TAG = mod.COMPOSITION_START_TAG;\nexport const CONTROLLED_TEXT_INSERTION_COMMAND = mod.CONTROLLED_TEXT_INSERTION_COMMAND;\nexport const COPY_COMMAND = mod.COPY_COMMAND;\nexport const CUT_COMMAND = mod.CUT_COMMAND;\nexport const DEFAULT_EDITOR_DOM_CONFIG = mod.DEFAULT_EDITOR_DOM_CONFIG;\nexport const DELETE_CHARACTER_COMMAND = mod.DELETE_CHARACTER_COMMAND;\nexport const DELETE_LINE_COMMAND = mod.DELETE_LINE_COMMAND;\nexport const DELETE_WORD_COMMAND = mod.DELETE_WORD_COMMAND;\nexport const DRAGEND_COMMAND = mod.DRAGEND_COMMAND;\nexport const DRAGOVER_COMMAND = mod.DRAGOVER_COMMAND;\nexport const DRAGSTART_COMMAND = mod.DRAGSTART_COMMAND;\nexport const DROP_COMMAND = mod.DROP_COMMAND;\nexport const DecoratorNode = mod.DecoratorNode;\nexport const ElementNode = mod.ElementNode;\nexport const FOCUS_COMMAND = mod.FOCUS_COMMAND;\nexport const FORMAT_ELEMENT_COMMAND = mod.FORMAT_ELEMENT_COMMAND;\nexport const FORMAT_TEXT_COMMAND = mod.FORMAT_TEXT_COMMAND;\nexport const HISTORIC_TAG = mod.HISTORIC_TAG;\nexport const HISTORY_MERGE_TAG = mod.HISTORY_MERGE_TAG;\nexport const HISTORY_PUSH_TAG = mod.HISTORY_PUSH_TAG;\nexport const INDENT_CONTENT_COMMAND = mod.INDENT_CONTENT_COMMAND;\nexport const INPUT_COMMAND = mod.INPUT_COMMAND;\nexport const INSERT_LINE_BREAK_COMMAND = mod.INSERT_LINE_BREAK_COMMAND;\nexport const INSERT_PARAGRAPH_COMMAND = mod.INSERT_PARAGRAPH_COMMAND;\nexport const INSERT_TAB_COMMAND = mod.INSERT_TAB_COMMAND;\nexport const INTERNAL_$isBlock = mod.INTERNAL_$isBlock;\nexport const IS_ALL_FORMATTING = mod.IS_ALL_FORMATTING;\nexport const IS_BOLD = mod.IS_BOLD;\nexport const IS_CODE = mod.IS_CODE;\nexport const IS_HIGHLIGHT = mod.IS_HIGHLIGHT;\nexport const IS_ITALIC = mod.IS_ITALIC;\nexport const IS_STRIKETHROUGH = mod.IS_STRIKETHROUGH;\nexport const IS_SUBSCRIPT = mod.IS_SUBSCRIPT;\nexport const IS_SUPERSCRIPT = mod.IS_SUPERSCRIPT;\nexport const IS_UNDERLINE = mod.IS_UNDERLINE;\nexport const KEY_ARROW_DOWN_COMMAND = mod.KEY_ARROW_DOWN_COMMAND;\nexport const KEY_ARROW_LEFT_COMMAND = mod.KEY_ARROW_LEFT_COMMAND;\nexport const KEY_ARROW_RIGHT_COMMAND = mod.KEY_ARROW_RIGHT_COMMAND;\nexport const KEY_ARROW_UP_COMMAND = mod.KEY_ARROW_UP_COMMAND;\nexport const KEY_BACKSPACE_COMMAND = mod.KEY_BACKSPACE_COMMAND;\nexport const KEY_DELETE_COMMAND = mod.KEY_DELETE_COMMAND;\nexport const KEY_DOWN_COMMAND = mod.KEY_DOWN_COMMAND;\nexport const KEY_ENTER_COMMAND = mod.KEY_ENTER_COMMAND;\nexport const KEY_ESCAPE_COMMAND = mod.KEY_ESCAPE_COMMAND;\nexport const KEY_MODIFIER_COMMAND = mod.KEY_MODIFIER_COMMAND;\nexport const KEY_SPACE_COMMAND = mod.KEY_SPACE_COMMAND;\nexport const KEY_TAB_COMMAND = mod.KEY_TAB_COMMAND;\nexport const LineBreakNode = mod.LineBreakNode;\nexport const MOVE_TO_END = mod.MOVE_TO_END;\nexport const MOVE_TO_START = mod.MOVE_TO_START;\nexport const NODE_STATE_KEY = mod.NODE_STATE_KEY;\nexport const OUTDENT_CONTENT_COMMAND = mod.OUTDENT_CONTENT_COMMAND;\nexport const PASTE_COMMAND = mod.PASTE_COMMAND;\nexport const PASTE_TAG = mod.PASTE_TAG;\nexport const ParagraphNode = mod.ParagraphNode;\nexport const REDO_COMMAND = mod.REDO_COMMAND;\nexport const REMOVE_TEXT_COMMAND = mod.REMOVE_TEXT_COMMAND;\nexport const RootNode = mod.RootNode;\nexport const SELECTION_CHANGE_COMMAND = mod.SELECTION_CHANGE_COMMAND;\nexport const SELECTION_INSERT_CLIPBOARD_NODES_COMMAND = mod.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND;\nexport const SELECT_ALL_COMMAND = mod.SELECT_ALL_COMMAND;\nexport const SKIP_COLLAB_TAG = mod.SKIP_COLLAB_TAG;\nexport const SKIP_DOM_SELECTION_TAG = mod.SKIP_DOM_SELECTION_TAG;\nexport const SKIP_SCROLL_INTO_VIEW_TAG = mod.SKIP_SCROLL_INTO_VIEW_TAG;\nexport const SKIP_SELECTION_FOCUS_TAG = mod.SKIP_SELECTION_FOCUS_TAG;\nexport const TEXT_TYPE_TO_FORMAT = mod.TEXT_TYPE_TO_FORMAT;\nexport const TabNode = mod.TabNode;\nexport const TextNode = mod.TextNode;\nexport const UNDO_COMMAND = mod.UNDO_COMMAND;\nexport const addClassNamesToElement = mod.addClassNamesToElement;\nexport const buildImportMap = mod.buildImportMap;\nexport const configExtension = mod.configExtension;\nexport const createCommand = mod.createCommand;\nexport const createEditor = mod.createEditor;\nexport const createSharedNodeState = mod.createSharedNodeState;\nexport const createState = mod.createState;\nexport const declarePeerDependency = mod.declarePeerDependency;\nexport const defineExtension = mod.defineExtension;\nexport const flipDirection = mod.flipDirection;\nexport const getDOMOwnerDocument = mod.getDOMOwnerDocument;\nexport const getDOMSelection = mod.getDOMSelection;\nexport const getDOMSelectionFromTarget = mod.getDOMSelectionFromTarget;\nexport const getDOMTextNode = mod.getDOMTextNode;\nexport const getEditorPropertyFromDOMNode = mod.getEditorPropertyFromDOMNode;\nexport const getNearestEditorFromDOMNode = mod.getNearestEditorFromDOMNode;\nexport const getRegisteredNode = mod.getRegisteredNode;\nexport const getRegisteredNodeOrThrow = mod.getRegisteredNodeOrThrow;\nexport const getStaticNodeConfig = mod.getStaticNodeConfig;\nexport const getStyleObjectFromCSS = mod.getStyleObjectFromCSS;\nexport const getTextDirection = mod.getTextDirection;\nexport const getTransformSetFromKlass = mod.getTransformSetFromKlass;\nexport const isBlockDomNode = mod.isBlockDomNode;\nexport const isCurrentlyReadOnlyMode = mod.isCurrentlyReadOnlyMode;\nexport const isDOMDocumentNode = mod.isDOMDocumentNode;\nexport const isDOMNode = mod.isDOMNode;\nexport const isDOMTextNode = mod.isDOMTextNode;\nexport const isDOMUnmanaged = mod.isDOMUnmanaged;\nexport const isDocumentFragment = mod.isDocumentFragment;\nexport const isExactShortcutMatch = mod.isExactShortcutMatch;\nexport const isHTMLAnchorElement = mod.isHTMLAnchorElement;\nexport const isHTMLElement = mod.isHTMLElement;\nexport const isInlineDomNode = mod.isInlineDomNode;\nexport const isLexicalEditor = mod.isLexicalEditor;\nexport const isModifierMatch = mod.isModifierMatch;\nexport const isSelectionCapturedInDecoratorInput = mod.isSelectionCapturedInDecoratorInput;\nexport const isSelectionWithinEditor = mod.isSelectionWithinEditor;\nexport const makeStepwiseIterator = mod.makeStepwiseIterator;\nexport const mergeRegister = mod.mergeRegister;\nexport const normalizeClassNames = mod.normalizeClassNames;\nexport const removeClassNamesFromElement = mod.removeClassNamesFromElement;\nexport const removeFromParent = mod.removeFromParent;\nexport const resetRandomKey = mod.resetRandomKey;\nexport const safeCast = mod.safeCast;\nexport const setDOMStyleFromCSS = mod.setDOMStyleFromCSS;\nexport const setDOMStyleObject = mod.setDOMStyleObject;\nexport const setDOMUnmanaged = mod.setDOMUnmanaged;\nexport const setNodeIndentFromDOM = mod.setNodeIndentFromDOM;\nexport const shallowMergeConfig = mod.shallowMergeConfig;\nexport const toggleTextFormatType = mod.toggleTextFormatType;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalSelection.dev.mjs';\nimport * as modProd from './LexicalSelection.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const $addNodeStyle = mod.$addNodeStyle;\nexport const $cloneWithProperties = mod.$cloneWithProperties;\nexport const $copyBlockFormatIndent = mod.$copyBlockFormatIndent;\nexport const $ensureForwardRangeSelection = mod.$ensureForwardRangeSelection;\nexport const $forEachSelectedTextNode = mod.$forEachSelectedTextNode;\nexport const $getComputedStyleForElement = mod.$getComputedStyleForElement;\nexport const $getComputedStyleForParent = mod.$getComputedStyleForParent;\nexport const $getSelectionStyleValueForProperty = mod.$getSelectionStyleValueForProperty;\nexport const $isAtNodeEnd = mod.$isAtNodeEnd;\nexport const $isParentElementRTL = mod.$isParentElementRTL;\nexport const $isParentRTL = mod.$isParentRTL;\nexport const $moveCaretSelection = mod.$moveCaretSelection;\nexport const $moveCharacter = mod.$moveCharacter;\nexport const $patchStyleText = mod.$patchStyleText;\nexport const $selectAll = mod.$selectAll;\nexport const $setBlocksType = mod.$setBlocksType;\nexport const $shouldOverrideDefaultCharacterSelection = mod.$shouldOverrideDefaultCharacterSelection;\nexport const $sliceSelectedTextNodeContent = mod.$sliceSelectedTextNodeContent;\nexport const $trimTextContentFromAnchor = mod.$trimTextContentFromAnchor;\nexport const $wrapNodes = mod.$wrapNodes;\nexport const createDOMRange = mod.createDOMRange;\nexport const createRectsFromDOMRange = mod.createRectsFromDOMRange;\nexport const getCSSFromStyleObject = mod.getCSSFromStyleObject;\nexport const getStyleObjectFromCSS = mod.getStyleObjectFromCSS;\nexport const trimTextContentFromAnchor = mod.trimTextContentFromAnchor;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { addClassNamesToElement, isHTMLAnchorElement, $findMatchingParent, $insertNodeToNearestRootAtCaret, mergeRegister, objectKlassEquals } from '@lexical/utils';\nimport { ElementNode, $copyNode, $isRangeSelection, $applyNodeReplacement, createCommand, $getSelection, $isNodeSelection, $normalizeSelection__EXPERIMENTAL, $setSelection, $getChildCaret, $isElementNode, $rewindSiblingCaret, $caretFromPoint, $normalizeCaret, $isSiblingCaret, $setPointFromCaret, defineExtension, shallowMergeConfig, COMMAND_PRIORITY_EDITOR, PASTE_COMMAND, COMMAND_PRIORITY_LOW, safeCast, isDOMNode, getNearestEditorFromDOMNode, $getNearestNodeFromDOMNode, TextNode, $isTextNode, $isLineBreakNode, $createTextNode } from 'lexical';\nimport { namedSignals, effect } from '@lexical/extension';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n  throw new Error(message);\n}\n\nconst SUPPORTED_URL_PROTOCOLS = new Set(['http:', 'https:', 'mailto:', 'sms:', 'tel:']);\n\n/** @noInheritDoc */\nclass LinkNode extends ElementNode {\n  /** @internal */\n  __url;\n  /** @internal */\n  __target;\n  /** @internal */\n  __rel;\n  /** @internal */\n  __title;\n  static getType() {\n    return 'link';\n  }\n  static clone(node) {\n    return new LinkNode(node.__url, {\n      rel: node.__rel,\n      target: node.__target,\n      title: node.__title\n    }, node.__key);\n  }\n  constructor(url = '', attributes = {}, key) {\n    super(key);\n    const {\n      target = null,\n      rel = null,\n      title = null\n    } = attributes;\n    this.__url = url;\n    this.__target = target;\n    this.__rel = rel;\n    this.__title = title;\n  }\n  afterCloneFrom(prevNode) {\n    super.afterCloneFrom(prevNode);\n    this.__url = prevNode.__url;\n    this.__rel = prevNode.__rel;\n    this.__target = prevNode.__target;\n    this.__title = prevNode.__title;\n  }\n  createDOM(config) {\n    const element = document.createElement('a');\n    this.updateLinkDOM(null, element, config);\n    addClassNamesToElement(element, config.theme.link);\n    return element;\n  }\n  updateLinkDOM(prevNode, anchor, config) {\n    if (isHTMLAnchorElement(anchor)) {\n      if (!prevNode || prevNode.__url !== this.__url) {\n        anchor.href = this.sanitizeUrl(this.__url);\n      }\n      for (const attr of ['target', 'rel', 'title']) {\n        const key = `__${attr}`;\n        const value = this[key];\n        if (!prevNode || prevNode[key] !== value) {\n          if (value) {\n            anchor[attr] = value;\n          } else {\n            anchor.removeAttribute(attr);\n          }\n        }\n      }\n    }\n  }\n  updateDOM(prevNode, anchor, config) {\n    this.updateLinkDOM(prevNode, anchor, config);\n    return false;\n  }\n  static importDOM() {\n    return {\n      a: node => ({\n        conversion: $convertAnchorElement,\n        priority: 1\n      })\n    };\n  }\n  static importJSON(serializedNode) {\n    return $createLinkNode().updateFromJSON(serializedNode);\n  }\n  updateFromJSON(serializedNode) {\n    return super.updateFromJSON(serializedNode).setURL(serializedNode.url).setRel(serializedNode.rel || null).setTarget(serializedNode.target || null).setTitle(serializedNode.title || null);\n  }\n  sanitizeUrl(url) {\n    url = formatUrl(url);\n    try {\n      const parsedUrl = new URL(formatUrl(url));\n      if (!SUPPORTED_URL_PROTOCOLS.has(parsedUrl.protocol)) {\n        return 'about:blank';\n      }\n    } catch (_unused) {\n      return url;\n    }\n    return url;\n  }\n  exportJSON() {\n    return {\n      ...super.exportJSON(),\n      rel: this.getRel(),\n      target: this.getTarget(),\n      title: this.getTitle(),\n      url: this.getURL()\n    };\n  }\n  getURL() {\n    return this.getLatest().__url;\n  }\n  setURL(url) {\n    const writable = this.getWritable();\n    writable.__url = url;\n    return writable;\n  }\n  getTarget() {\n    return this.getLatest().__target;\n  }\n  setTarget(target) {\n    const writable = this.getWritable();\n    writable.__target = target;\n    return writable;\n  }\n  getRel() {\n    return this.getLatest().__rel;\n  }\n  setRel(rel) {\n    const writable = this.getWritable();\n    writable.__rel = rel;\n    return writable;\n  }\n  getTitle() {\n    return this.getLatest().__title;\n  }\n  setTitle(title) {\n    const writable = this.getWritable();\n    writable.__title = title;\n    return writable;\n  }\n  insertNewAfter(_, restoreSelection = true) {\n    const linkNode = $copyNode(this);\n    this.insertAfter(linkNode, restoreSelection);\n    return linkNode;\n  }\n  canInsertTextBefore() {\n    return false;\n  }\n  canInsertTextAfter() {\n    return false;\n  }\n  canBeEmpty() {\n    return false;\n  }\n  isInline() {\n    return true;\n  }\n  extractWithChild(child, selection, destination) {\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    const anchorNode = selection.anchor.getNode();\n    const focusNode = selection.focus.getNode();\n    return this.isParentOf(anchorNode) && this.isParentOf(focusNode) && selection.getTextContent().length > 0;\n  }\n  isEmailURI() {\n    return this.__url.startsWith('mailto:');\n  }\n  isWebSiteURI() {\n    return this.__url.startsWith('https://') || this.__url.startsWith('http://');\n  }\n  shouldMergeAdjacentLink(otherLink) {\n    return this.getType() === otherLink.getType() && this.__url === otherLink.__url && this.__target === otherLink.__target && this.__rel === otherLink.__rel && this.__title === otherLink.__title;\n  }\n}\nfunction $saveCaretPair(point) {\n  const next = $caretFromPoint(point, 'next');\n  return [next, next.getFlipped()];\n}\nfunction $restoreCaretPair(point, pair) {\n  for (const caret of pair) {\n    if (caret.origin.isAttached()) {\n      const normalized = $normalizeCaret(caret);\n      $setPointFromCaret(point, normalized);\n      return;\n    }\n  }\n}\n\n/**\n * Extracts block-level children from a LinkNode, splitting\n * ancestor nodes as needed to maintain a valid document structure.\n * @param link - The LinkNode to normalize\n */\nfunction $linkNodeTransform(link) {\n  const selection = $getSelection();\n  let anchorPair = null;\n  let focusPair = null;\n  if ($isRangeSelection(selection)) {\n    anchorPair = $saveCaretPair(selection.anchor);\n    focusPair = $saveCaretPair(selection.focus);\n  }\n  function $restoreSelection() {\n    if ($isRangeSelection(selection)) {\n      $restoreCaretPair(selection.anchor, anchorPair);\n      $restoreCaretPair(selection.focus, focusPair);\n      $normalizeSelection__EXPERIMENTAL(selection);\n    }\n  }\n  let transformed = false;\n  for (const caret of $getChildCaret(link, 'next')) {\n    const node = caret.origin;\n    if ($isElementNode(node) && !node.isInline()) {\n      const blockChildren = node.getChildren();\n      if (blockChildren.length > 0) {\n        const innerLink = $copyNode(link);\n        innerLink.append(...blockChildren);\n        node.append(innerLink);\n        transformed = true;\n      }\n      $insertNodeToNearestRootAtCaret(node, $rewindSiblingCaret(caret), {\n        $shouldSplit: () => false\n      });\n    }\n  }\n  // Fix a caret pair that points to the end of the absorbing link,\n  // which would shift when new children are appended during merge.\n  function $fixMergeBoundaryCaret(pair, absorbingLink, mergingLink) {\n    const [next, prev] = pair;\n    const $isAffected = caret => $isSiblingCaret(caret) && caret.origin.is(absorbingLink);\n    if (!$isAffected(next) && !$isAffected(prev)) {\n      return pair;\n    }\n    // Resolve the merge boundary from the merging link's start, since\n    // those children survive the move and represent the boundary position.\n    const fixed = $normalizeCaret($getChildCaret(mergingLink, 'next'));\n    return [fixed, fixed.getFlipped()];\n  }\n  if (link.isAttached()) {\n    const prevSibling = link.getPreviousSibling();\n    if ($isLinkNode(prevSibling) && prevSibling.shouldMergeAdjacentLink(link)) {\n      if (anchorPair) {\n        anchorPair = $fixMergeBoundaryCaret(anchorPair, prevSibling, link);\n      }\n      if (focusPair) {\n        focusPair = $fixMergeBoundaryCaret(focusPair, prevSibling, link);\n      }\n      prevSibling.append(...link.getChildren());\n      link.remove();\n      $restoreSelection();\n      return;\n    }\n    const nextSibling = link.getNextSibling();\n    if ($isLinkNode(nextSibling) && link.shouldMergeAdjacentLink(nextSibling)) {\n      if (anchorPair) {\n        anchorPair = $fixMergeBoundaryCaret(anchorPair, link, nextSibling);\n      }\n      if (focusPair) {\n        focusPair = $fixMergeBoundaryCaret(focusPair, link, nextSibling);\n      }\n      link.append(...nextSibling.getChildren());\n      nextSibling.remove();\n      transformed = true;\n    }\n  }\n  if (!transformed) {\n    return;\n  }\n  if (!link.canBeEmpty() && link.isEmpty()) {\n    const parent = link.getParent();\n    link.remove();\n    if (parent && parent.isEmpty()) {\n      parent.remove();\n    }\n  }\n  $restoreSelection();\n}\nfunction $convertAnchorElement(domNode) {\n  let node = null;\n  if (isHTMLAnchorElement(domNode)) {\n    const content = domNode.textContent;\n    if (content !== null && content !== '' || domNode.children.length > 0) {\n      node = $createLinkNode(domNode.getAttribute('href') || '', {\n        rel: domNode.getAttribute('rel'),\n        target: domNode.getAttribute('target'),\n        title: domNode.getAttribute('title')\n      });\n    }\n  }\n  return {\n    node\n  };\n}\n\n/**\n * Takes a URL and creates a LinkNode.\n * @param url - The URL the LinkNode should direct to.\n * @param attributes - Optional HTML a tag attributes \\\\{ target, rel, title \\\\}\n * @returns The LinkNode.\n */\nfunction $createLinkNode(url = '', attributes) {\n  return $applyNodeReplacement(new LinkNode(url, attributes));\n}\n\n/**\n * Determines if node is a LinkNode.\n * @param node - The node to be checked.\n * @returns true if node is a LinkNode, false otherwise.\n */\nfunction $isLinkNode(node) {\n  return node instanceof LinkNode;\n}\n// Custom node type to override `canInsertTextAfter` that will\n// allow typing within the link\nclass AutoLinkNode extends LinkNode {\n  /** @internal */\n  /** Indicates whether the autolink was ever unlinked. **/\n  __isUnlinked;\n  constructor(url = '', attributes = {}, key) {\n    super(url, attributes, key);\n    this.__isUnlinked = attributes.isUnlinked !== undefined && attributes.isUnlinked !== null ? attributes.isUnlinked : false;\n  }\n  afterCloneFrom(prevNode) {\n    super.afterCloneFrom(prevNode);\n    this.__isUnlinked = prevNode.__isUnlinked;\n  }\n  static getType() {\n    return 'autolink';\n  }\n  static clone(node) {\n    return new AutoLinkNode(node.__url, {\n      isUnlinked: node.__isUnlinked,\n      rel: node.__rel,\n      target: node.__target,\n      title: node.__title\n    }, node.__key);\n  }\n  shouldMergeAdjacentLink(_otherLink) {\n    return false;\n  }\n  getIsUnlinked() {\n    return this.__isUnlinked;\n  }\n  setIsUnlinked(value) {\n    const self = this.getWritable();\n    self.__isUnlinked = value;\n    return self;\n  }\n  createDOM(config) {\n    if (this.__isUnlinked) {\n      return document.createElement('span');\n    } else {\n      return super.createDOM(config);\n    }\n  }\n  updateDOM(prevNode, anchor, config) {\n    return super.updateDOM(prevNode, anchor, config) || prevNode.__isUnlinked !== this.__isUnlinked;\n  }\n  static importJSON(serializedNode) {\n    return $createAutoLinkNode().updateFromJSON(serializedNode);\n  }\n  updateFromJSON(serializedNode) {\n    return super.updateFromJSON(serializedNode).setIsUnlinked(serializedNode.isUnlinked || false);\n  }\n  static importDOM() {\n    // TODO: Should link node should handle the import over autolink?\n    return null;\n  }\n  exportJSON() {\n    return {\n      ...super.exportJSON(),\n      isUnlinked: this.__isUnlinked\n    };\n  }\n  insertNewAfter(_, restoreSelection = true) {\n    const linkNode = $createAutoLinkNode(this.__url, {\n      isUnlinked: this.__isUnlinked,\n      rel: this.__rel,\n      target: this.__target,\n      title: this.__title\n    });\n    this.insertAfter(linkNode, restoreSelection);\n    return linkNode;\n  }\n}\n\n/**\n * Takes a URL and creates an AutoLinkNode. AutoLinkNodes are generally automatically generated\n * during typing, which is especially useful when a button to generate a LinkNode is not practical.\n * @param url - The URL the LinkNode should direct to.\n * @param attributes - Optional HTML a tag attributes. \\\\{ target, rel, title \\\\}\n * @returns The LinkNode.\n */\nfunction $createAutoLinkNode(url = '', attributes) {\n  return $applyNodeReplacement(new AutoLinkNode(url, attributes));\n}\n\n/**\n * Determines if node is an AutoLinkNode.\n * @param node - The node to be checked.\n * @returns true if node is an AutoLinkNode, false otherwise.\n */\nfunction $isAutoLinkNode(node) {\n  return node instanceof AutoLinkNode;\n}\nconst TOGGLE_LINK_COMMAND = createCommand('TOGGLE_LINK_COMMAND');\nfunction $getPointNode(point, offset) {\n  if (point.type === 'element') {\n    const node = point.getNode();\n    if (!$isElementNode(node)) {\n      formatDevErrorMessage(`$getPointNode: element point is not an ElementNode`);\n    }\n    const childNode = node.getChildren()[point.offset + offset];\n    return childNode || null;\n  }\n  return null;\n}\n\n/**\n * Preserve the logical start/end of a RangeSelection in situations where\n * the point is an element that may be reparented in the callback.\n *\n * @param $fn The function to run\n * @returns The result of the callback\n */\nfunction $withSelectedNodes($fn) {\n  const initialSelection = $getSelection();\n  if (!$isRangeSelection(initialSelection)) {\n    return $fn();\n  }\n  const normalized = $normalizeSelection__EXPERIMENTAL(initialSelection);\n  const isBackwards = normalized.isBackward();\n  const anchorNode = $getPointNode(normalized.anchor, isBackwards ? -1 : 0);\n  const focusNode = $getPointNode(normalized.focus, isBackwards ? 0 : -1);\n  const rval = $fn();\n  if (anchorNode || focusNode) {\n    const updatedSelection = $getSelection();\n    if ($isRangeSelection(updatedSelection)) {\n      const finalSelection = updatedSelection.clone();\n      if (anchorNode) {\n        const anchorParent = anchorNode.getParent();\n        if (anchorParent) {\n          finalSelection.anchor.set(anchorParent.getKey(), anchorNode.getIndexWithinParent() + (isBackwards ? 1 : 0), 'element');\n        }\n      }\n      if (focusNode) {\n        const focusParent = focusNode.getParent();\n        if (focusParent) {\n          finalSelection.focus.set(focusParent.getKey(), focusNode.getIndexWithinParent() + (isBackwards ? 0 : 1), 'element');\n        }\n      }\n      $setSelection($normalizeSelection__EXPERIMENTAL(finalSelection));\n    }\n  }\n  return rval;\n}\n\n/**\n * Splits a LinkNode by removing selected children from it.\n * Handles three cases: selection at start, end, or middle of the link.\n * @param parentLink - The LinkNode to split\n * @param extractedNodes - The nodes that were extracted from the selection\n */\nfunction $splitLinkAtSelection(parentLink, extractedNodes) {\n  const extractedKeys = new Set(extractedNodes.filter(n => parentLink.isParentOf(n)).map(n => n.getKey()));\n  const allChildren = parentLink.getChildren();\n  // Check if a child is an extracted node OR contains an extracted node\n  // This handles nested structures like LinkNode > HeadingNode > TextNode\n  const isExtractedChild = child => extractedKeys.has(child.getKey()) || $isElementNode(child) && extractedNodes.some(n => parentLink.isParentOf(n) && child.isParentOf(n));\n  const extractedChildren = allChildren.filter(isExtractedChild);\n  if (extractedChildren.length === allChildren.length) {\n    allChildren.forEach(child => parentLink.insertBefore(child));\n    parentLink.remove();\n    return;\n  }\n  const firstExtractedIndex = allChildren.findIndex(isExtractedChild);\n  const lastExtractedIndex = allChildren.findLastIndex(isExtractedChild);\n  const isAtStart = firstExtractedIndex === 0;\n  const isAtEnd = lastExtractedIndex === allChildren.length - 1;\n  if (isAtStart) {\n    extractedChildren.forEach(child => parentLink.insertBefore(child));\n  } else if (isAtEnd) {\n    for (let i = extractedChildren.length - 1; i >= 0; i--) {\n      parentLink.insertAfter(extractedChildren[i]);\n    }\n  } else {\n    for (let i = extractedChildren.length - 1; i >= 0; i--) {\n      parentLink.insertAfter(extractedChildren[i]);\n    }\n    const trailingChildren = allChildren.slice(lastExtractedIndex + 1);\n    if (trailingChildren.length > 0) {\n      const newLink = $copyNode(parentLink);\n      extractedChildren[extractedChildren.length - 1].insertAfter(newLink);\n      trailingChildren.forEach(child => newLink.append(child));\n    }\n  }\n}\n\n/**\n * Generates or updates a LinkNode. It can also delete a LinkNode if the URL is null,\n * but saves any children and brings them up to the parent node.\n * @param urlOrAttributes - The URL the link directs to, or an attributes object with an url property\n * @param attributes - Optional HTML a tag attributes. \\\\{ target, rel, title \\\\}\n */\nfunction $toggleLink(urlOrAttributes, attributes = {}) {\n  let url;\n  if (urlOrAttributes && typeof urlOrAttributes === 'object') {\n    const {\n      url: urlProp,\n      ...rest\n    } = urlOrAttributes;\n    url = urlProp;\n    attributes = {\n      ...rest,\n      ...attributes\n    };\n  } else {\n    url = urlOrAttributes;\n  }\n  const {\n    target,\n    title\n  } = attributes;\n  const rel = attributes.rel === undefined ? 'noreferrer' : attributes.rel;\n  const selection = $getSelection();\n  if (selection === null || !$isRangeSelection(selection) && !$isNodeSelection(selection)) {\n    return;\n  }\n  if ($isNodeSelection(selection)) {\n    const nodes = selection.getNodes();\n    if (nodes.length === 0) {\n      return;\n    }\n\n    // Handle all selected nodes\n    nodes.forEach(node => {\n      if (url === null) {\n        // Remove link\n        const linkParent = $findMatchingParent(node, parent => !$isAutoLinkNode(parent) && $isLinkNode(parent));\n        if (linkParent) {\n          linkParent.insertBefore(node);\n          if (linkParent.getChildren().length === 0) {\n            linkParent.remove();\n          }\n        }\n      } else {\n        // Add/Update link\n        const existingLink = $findMatchingParent(node, parent => !$isAutoLinkNode(parent) && $isLinkNode(parent));\n        if (existingLink) {\n          existingLink.setURL(url);\n          if (target !== undefined) {\n            existingLink.setTarget(target);\n          }\n          if (rel !== undefined) {\n            existingLink.setRel(rel);\n          }\n        } else {\n          const linkNode = $createLinkNode(url, {\n            rel,\n            target\n          });\n          node.insertBefore(linkNode);\n          linkNode.append(node);\n        }\n      }\n    });\n    return;\n  }\n  if (selection.isCollapsed() && url === null) {\n    for (const node of selection.getNodes()) {\n      const parentLink = $findMatchingParent(node, parent => !$isAutoLinkNode(parent) && $isLinkNode(parent));\n      if (parentLink !== null) {\n        parentLink.getChildren().forEach(child => {\n          parentLink.insertBefore(child);\n        });\n        parentLink.remove();\n      }\n      return;\n    }\n  }\n\n  // Handle RangeSelection\n  const nodes = selection.extract();\n  if (url === null) {\n    const processedLinks = new Set();\n    nodes.forEach(node => {\n      const parentLink = $findMatchingParent(node, parent => !$isAutoLinkNode(parent) && $isLinkNode(parent));\n      if (parentLink !== null) {\n        const linkKey = parentLink.getKey();\n        if (processedLinks.has(linkKey)) {\n          return;\n        }\n        $splitLinkAtSelection(parentLink, nodes);\n        processedLinks.add(linkKey);\n      }\n    });\n    return;\n  }\n  const updatedNodes = new Set();\n  const updateLinkNode = linkNode => {\n    if (updatedNodes.has(linkNode.getKey())) {\n      return;\n    }\n    updatedNodes.add(linkNode.getKey());\n    linkNode.setURL(url);\n    if (target !== undefined) {\n      linkNode.setTarget(target);\n    }\n    if (rel !== undefined) {\n      linkNode.setRel(rel);\n    }\n    if (title !== undefined) {\n      linkNode.setTitle(title);\n    }\n  };\n  // Add or merge LinkNodes\n  if (nodes.length === 1) {\n    const firstNode = nodes[0];\n    // if the first node is a LinkNode or if its\n    // parent is a LinkNode, we update the URL, target and rel.\n    const linkNode = $findMatchingParent(firstNode, $isLinkNode);\n    if (linkNode !== null) {\n      return updateLinkNode(linkNode);\n    }\n  }\n  $withSelectedNodes(() => {\n    let linkNode = null;\n    for (const node of nodes) {\n      if (!node.isAttached()) {\n        continue;\n      }\n      const parentLinkNode = $findMatchingParent(node, $isLinkNode);\n      if (parentLinkNode) {\n        updateLinkNode(parentLinkNode);\n        continue;\n      }\n      if ($isElementNode(node)) {\n        if (!node.isInline()) {\n          // Ignore block nodes, if there are any children we will see them\n          // later and wrap in a new LinkNode\n          continue;\n        }\n        if ($isLinkNode(node)) {\n          // If it's not an autolink node and we don't already have a LinkNode\n          // in this block then we can update it and re-use it\n          if (!$isAutoLinkNode(node) && (linkNode === null || !linkNode.getParentOrThrow().isParentOf(node))) {\n            updateLinkNode(node);\n            linkNode = node;\n            continue;\n          }\n          // Unwrap LinkNode, we already have one or it's an AutoLinkNode\n          for (const child of node.getChildren()) {\n            node.insertBefore(child);\n          }\n          node.remove();\n          continue;\n        }\n      }\n      const prevLinkNode = node.getPreviousSibling();\n      if ($isLinkNode(prevLinkNode) && prevLinkNode.is(linkNode)) {\n        prevLinkNode.append(node);\n        continue;\n      }\n      linkNode = $createLinkNode(url, {\n        rel,\n        target,\n        title\n      });\n      node.insertAfter(linkNode);\n      linkNode.append(node);\n    }\n  });\n}\nconst PHONE_NUMBER_REGEX = /^\\+?[0-9\\s()-]{5,}$/;\n\n/**\n * Formats a URL string by adding appropriate protocol if missing\n *\n * @param url - URL to format\n * @returns Formatted URL with appropriate protocol\n */\nfunction formatUrl(url) {\n  // Check if URL already has a protocol\n  if (url.match(/^[a-z][a-z0-9+.-]*:/i)) {\n    // URL already has a protocol, leave it as is\n    return url;\n  }\n  // Check if it's a relative path (starting with '/', '.', or '#')\n  else if (url.match(/^[/#.]/)) {\n    // Relative path, leave it as is\n    return url;\n  }\n\n  // Check for email address\n  else if (url.includes('@')) {\n    return `mailto:${url}`;\n  }\n\n  // Check for phone number\n  else if (PHONE_NUMBER_REGEX.test(url)) {\n    return `tel:${url}`;\n  }\n\n  // For everything else, return with https:// prefix\n  return `https://${url}`;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst defaultProps = {\n  attributes: undefined,\n  validateUrl: undefined\n};\n\n/** @internal */\nfunction registerLink(editor, stores) {\n  return mergeRegister(editor.registerNodeTransform(LinkNode, $linkNodeTransform), editor.registerCommand(TOGGLE_LINK_COMMAND, payload => {\n    const validateUrl = stores.validateUrl.peek();\n    const attributes = stores.attributes.peek();\n    if (payload === null) {\n      $toggleLink(null);\n      return true;\n    } else if (typeof payload === 'string') {\n      if (validateUrl === undefined || validateUrl(payload)) {\n        $toggleLink(payload, attributes);\n        return true;\n      }\n      return false;\n    } else {\n      const {\n        url,\n        target,\n        rel,\n        title\n      } = payload;\n      $toggleLink(url, {\n        ...attributes,\n        rel,\n        target,\n        title\n      });\n      return true;\n    }\n  }, COMMAND_PRIORITY_EDITOR), effect(() => {\n    const validateUrl = stores.validateUrl.value;\n    if (!validateUrl) {\n      return;\n    }\n    const attributes = stores.attributes.value;\n    return editor.registerCommand(PASTE_COMMAND, event => {\n      const selection = $getSelection();\n      if (!$isRangeSelection(selection) || selection.isCollapsed() || !objectKlassEquals(event, ClipboardEvent)) {\n        return false;\n      }\n      if (event.clipboardData === null) {\n        return false;\n      }\n      const clipboardText = event.clipboardData.getData('text');\n      if (!validateUrl(clipboardText)) {\n        return false;\n      }\n      // If we select nodes that are elements then avoid applying the link.\n      if (!selection.getNodes().some(node => $isElementNode(node))) {\n        editor.dispatchCommand(TOGGLE_LINK_COMMAND, {\n          ...attributes,\n          url: clipboardText\n        });\n        event.preventDefault();\n        return true;\n      }\n      return false;\n    }, COMMAND_PRIORITY_LOW);\n  }));\n}\n\n/**\n * Provides {@link LinkNode}, an implementation of\n * {@link TOGGLE_LINK_COMMAND}, and a {@link PASTE_COMMAND}\n * listener to wrap selected nodes in a link when a\n * URL is pasted and `validateUrl` is defined.\n */\nconst LinkExtension = defineExtension({\n  build(editor, config, state) {\n    return namedSignals(config);\n  },\n  config: defaultProps,\n  mergeConfig(config, overrides) {\n    const merged = shallowMergeConfig(config, overrides);\n    if (config.attributes) {\n      merged.attributes = shallowMergeConfig(config.attributes, merged.attributes);\n    }\n    return merged;\n  },\n  name: '@lexical/link/Link',\n  nodes: () => [LinkNode],\n  register(editor, config, state) {\n    return registerLink(editor, state.getOutput());\n  }\n});\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction findMatchingDOM(startNode, predicate) {\n  let node = startNode;\n  while (node != null) {\n    if (predicate(node)) {\n      return node;\n    }\n    node = node.parentNode;\n  }\n  return null;\n}\nfunction registerClickableLink(editor, stores, eventOptions = {}) {\n  const onClick = event => {\n    const target = event.target;\n    if (!isDOMNode(target)) {\n      return;\n    }\n    const nearestEditor = getNearestEditorFromDOMNode(target);\n    if (nearestEditor === null) {\n      return;\n    }\n    let url = null;\n    let urlTarget = null;\n    nearestEditor.update(() => {\n      const clickedNode = $getNearestNodeFromDOMNode(target);\n      if (clickedNode !== null) {\n        const maybeLinkNode = $findMatchingParent(clickedNode, $isElementNode);\n        if (!stores.disabled.peek()) {\n          if ($isLinkNode(maybeLinkNode)) {\n            url = maybeLinkNode.sanitizeUrl(maybeLinkNode.getURL());\n            urlTarget = maybeLinkNode.getTarget();\n          } else {\n            const a = findMatchingDOM(target, isHTMLAnchorElement);\n            if (a !== null) {\n              url = a.href;\n              urlTarget = a.target;\n            }\n          }\n        }\n      }\n    });\n    if (url === null || url === '') {\n      return;\n    }\n\n    // Allow user to select link text without following url\n    const selection = editor.getEditorState().read($getSelection, {\n      editor\n    });\n    if ($isRangeSelection(selection) && !selection.isCollapsed()) {\n      event.preventDefault();\n      return;\n    }\n    const isMiddle = event.type === 'auxclick' && event.button === 1;\n    window.open(url, stores.newTab.peek() || isMiddle || event.metaKey || event.ctrlKey || urlTarget === '_blank' ? '_blank' : '_self');\n    event.preventDefault();\n  };\n  const onMouseUp = event => {\n    if (event.button === 1) {\n      onClick(event);\n    }\n  };\n  return editor.registerRootListener(rootElement => {\n    if (rootElement) {\n      rootElement.addEventListener('click', onClick, eventOptions);\n      rootElement.addEventListener('mouseup', onMouseUp, eventOptions);\n      return () => {\n        rootElement.removeEventListener('click', onClick);\n        rootElement.removeEventListener('mouseup', onMouseUp);\n      };\n    }\n  });\n}\n\n/**\n * Normally in a Lexical editor the `CLICK_COMMAND` on a LinkNode will cause the\n * selection to change instead of opening a link. This extension can be used to\n * restore the default behavior, e.g. when the editor is not editable.\n */\nconst ClickableLinkExtension = defineExtension({\n  build(editor, config, state) {\n    return namedSignals(config);\n  },\n  config: safeCast({\n    disabled: false,\n    newTab: false\n  }),\n  dependencies: [LinkExtension],\n  name: '@lexical/link/ClickableLink',\n  register(editor, config, state) {\n    return registerClickableLink(editor, state.getOutput());\n  }\n});\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction createLinkMatcherWithRegExp(regExp, urlTransformer = text => text) {\n  return text => {\n    const match = regExp.exec(text);\n    if (match === null) {\n      return null;\n    }\n    return {\n      index: match.index,\n      length: match[0].length,\n      text: match[0],\n      url: urlTransformer(match[0])\n    };\n  };\n}\nfunction findFirstMatch(text, matchers) {\n  for (let i = 0; i < matchers.length; i++) {\n    const match = matchers[i](text);\n    if (match) {\n      return match;\n    }\n  }\n  return null;\n}\nconst PUNCTUATION_OR_SPACE = /[.,;\\s]/;\nfunction isSeparator(char, separatorRegex) {\n  return separatorRegex.test(char);\n}\nfunction endsWithSeparator(textContent, separatorRegex) {\n  return isSeparator(textContent[textContent.length - 1], separatorRegex);\n}\nfunction startsWithSeparator(textContent, separatorRegex) {\n  return isSeparator(textContent[0], separatorRegex);\n}\n\n/**\n * Check if the text content starts with a fullstop followed by a top-level domain.\n * Meaning if the text content can be a beginning of a top level domain.\n * @param textContent\n * @param isEmail\n * @returns boolean\n */\nfunction startsWithTLD(textContent, isEmail) {\n  if (isEmail) {\n    return /^\\.[a-zA-Z]{2,}/.test(textContent);\n  } else {\n    return /^\\.[a-zA-Z0-9]{1,}/.test(textContent);\n  }\n}\nfunction isPreviousNodeValid(node, separatorRegex) {\n  let previousNode = node.getPreviousSibling();\n  if ($isElementNode(previousNode)) {\n    previousNode = previousNode.getLastDescendant();\n  }\n  return previousNode === null || $isLineBreakNode(previousNode) || $isTextNode(previousNode) && endsWithSeparator(previousNode.getTextContent(), separatorRegex);\n}\nfunction isNextNodeValid(node, separatorRegex) {\n  let nextNode = node.getNextSibling();\n  if ($isElementNode(nextNode)) {\n    nextNode = nextNode.getFirstDescendant();\n  }\n  return nextNode === null || $isLineBreakNode(nextNode) || $isTextNode(nextNode) && startsWithSeparator(nextNode.getTextContent(), separatorRegex);\n}\nfunction isContentAroundIsValid(matchStart, matchEnd, separatorRegex, text, nodes) {\n  const contentBeforeIsValid = matchStart > 0 ? isSeparator(text[matchStart - 1], separatorRegex) : isPreviousNodeValid(nodes[0], separatorRegex);\n  if (!contentBeforeIsValid) {\n    return false;\n  }\n  const contentAfterIsValid = matchEnd < text.length ? isSeparator(text[matchEnd], separatorRegex) : isNextNodeValid(nodes[nodes.length - 1], separatorRegex);\n  return contentAfterIsValid;\n}\nfunction extractMatchingNodes(nodes, startIndex, endIndex) {\n  const unmodifiedBeforeNodes = [];\n  const matchingNodes = [];\n  const unmodifiedAfterNodes = [];\n  let matchingOffset = 0;\n  let currentOffset = 0;\n  const currentNodes = [...nodes];\n  while (currentNodes.length > 0) {\n    const currentNode = currentNodes[0];\n    const currentNodeText = currentNode.getTextContent();\n    const currentNodeLength = currentNodeText.length;\n    const currentNodeStart = currentOffset;\n    const currentNodeEnd = currentOffset + currentNodeLength;\n    if (currentNodeEnd <= startIndex) {\n      unmodifiedBeforeNodes.push(currentNode);\n      matchingOffset += currentNodeLength;\n    } else if (currentNodeStart >= endIndex) {\n      unmodifiedAfterNodes.push(currentNode);\n    } else {\n      matchingNodes.push(currentNode);\n    }\n    currentOffset += currentNodeLength;\n    currentNodes.shift();\n  }\n  return [matchingOffset, unmodifiedBeforeNodes, matchingNodes, unmodifiedAfterNodes];\n}\nfunction $createAutoLinkNode_(nodes, startIndex, endIndex, match) {\n  const linkNode = $createAutoLinkNode(match.url, match.attributes);\n  if (nodes.length === 1) {\n    let remainingTextNode = nodes[0];\n    let linkTextNode;\n    if (startIndex === 0) {\n      [linkTextNode, remainingTextNode] = remainingTextNode.splitText(endIndex);\n    } else {\n      [, linkTextNode, remainingTextNode] = remainingTextNode.splitText(startIndex, endIndex);\n    }\n    const textNode = $createTextNode(match.text);\n    textNode.setFormat(linkTextNode.getFormat());\n    textNode.setDetail(linkTextNode.getDetail());\n    textNode.setStyle(linkTextNode.getStyle());\n    linkNode.append(textNode);\n    linkTextNode.replace(linkNode);\n    return remainingTextNode;\n  } else if (nodes.length > 1) {\n    const firstTextNode = nodes[0];\n    let offset = firstTextNode.getTextContent().length;\n    let firstLinkTextNode;\n    if (startIndex === 0) {\n      firstLinkTextNode = firstTextNode;\n    } else {\n      [, firstLinkTextNode] = firstTextNode.splitText(startIndex);\n    }\n    const linkNodes = [];\n    let remainingTextNode;\n    for (let i = 1; i < nodes.length; i++) {\n      const currentNode = nodes[i];\n      const currentNodeText = currentNode.getTextContent();\n      const currentNodeLength = currentNodeText.length;\n      const currentNodeStart = offset;\n      const currentNodeEnd = offset + currentNodeLength;\n      if (currentNodeStart < endIndex) {\n        if (currentNodeEnd <= endIndex) {\n          linkNodes.push(currentNode);\n        } else {\n          const [linkTextNode, endNode] = currentNode.splitText(endIndex - currentNodeStart);\n          linkNodes.push(linkTextNode);\n          remainingTextNode = endNode;\n        }\n      }\n      offset += currentNodeLength;\n    }\n    const selection = $getSelection();\n    const selectedTextNode = selection ? selection.getNodes().find($isTextNode) : undefined;\n    const textNode = $createTextNode(firstLinkTextNode.getTextContent());\n    textNode.setFormat(firstLinkTextNode.getFormat());\n    textNode.setDetail(firstLinkTextNode.getDetail());\n    textNode.setStyle(firstLinkTextNode.getStyle());\n    linkNode.append(textNode, ...linkNodes);\n    // it does not preserve caret position if caret was at the first text node\n    // so we need to restore caret position\n    if (selectedTextNode && selectedTextNode === firstLinkTextNode) {\n      if ($isRangeSelection(selection)) {\n        textNode.select(selection.anchor.offset, selection.focus.offset);\n      } else if ($isNodeSelection(selection)) {\n        textNode.select(0, textNode.getTextContent().length);\n      }\n    }\n    firstLinkTextNode.replace(linkNode);\n    return remainingTextNode;\n  }\n  return undefined;\n}\nfunction $handleLinkCreation(nodes, matchers, onChange, separatorRegex) {\n  // Early return if any node is already part of an AutoLinkNode (idempotency check)\n  for (const node of nodes) {\n    const parent = node.getParent();\n    if ($isAutoLinkNode(parent) && !parent.getIsUnlinked()) {\n      return;\n    }\n  }\n  let currentNodes = [...nodes];\n  const initialText = currentNodes.map(node => node.getTextContent()).join('');\n  let text = initialText;\n  let match;\n  let invalidMatchEnd = 0;\n  while ((match = findFirstMatch(text, matchers)) && match !== null) {\n    const matchStart = match.index;\n    const matchLength = match.length;\n    const matchEnd = matchStart + matchLength;\n    const isValid = isContentAroundIsValid(invalidMatchEnd + matchStart, invalidMatchEnd + matchEnd, separatorRegex, initialText, currentNodes);\n    if (isValid) {\n      const [matchingOffset,, matchingNodes, unmodifiedAfterNodes] = extractMatchingNodes(currentNodes, invalidMatchEnd + matchStart, invalidMatchEnd + matchEnd);\n\n      // Skip if matching nodes are already part of an AutoLinkNode\n      let alreadyLinked = false;\n      for (const node of matchingNodes) {\n        const parent = node.getParent();\n        if ($isAutoLinkNode(parent) && !parent.getIsUnlinked()) {\n          alreadyLinked = true;\n          break;\n        }\n      }\n      if (alreadyLinked) {\n        invalidMatchEnd += matchEnd;\n        text = text.substring(matchEnd);\n        continue;\n      }\n      const actualMatchStart = invalidMatchEnd + matchStart - matchingOffset;\n      const actualMatchEnd = invalidMatchEnd + matchEnd - matchingOffset;\n      const remainingTextNode = $createAutoLinkNode_(matchingNodes, actualMatchStart, actualMatchEnd, match);\n      currentNodes = remainingTextNode ? [remainingTextNode, ...unmodifiedAfterNodes] : unmodifiedAfterNodes;\n      onChange(match.url, null);\n      invalidMatchEnd = 0;\n    } else {\n      invalidMatchEnd += matchEnd;\n    }\n    text = text.substring(matchEnd);\n  }\n}\nfunction handleLinkEdit(linkNode, matchers, onChange, separatorRegex) {\n  // Check children are simple text\n  const children = linkNode.getChildren();\n  const childrenLength = children.length;\n  for (let i = 0; i < childrenLength; i++) {\n    const child = children[i];\n    if (!$isTextNode(child) || !child.isSimpleText()) {\n      replaceWithChildren(linkNode);\n      onChange(null, linkNode.getURL());\n      return;\n    }\n  }\n\n  // Check text content fully matches\n  const text = linkNode.getTextContent();\n  const match = findFirstMatch(text, matchers);\n  if (match === null || match.text !== text) {\n    replaceWithChildren(linkNode);\n    onChange(null, linkNode.getURL());\n    return;\n  }\n\n  // Check neighbors\n  if (!isPreviousNodeValid(linkNode, separatorRegex) || !isNextNodeValid(linkNode, separatorRegex)) {\n    replaceWithChildren(linkNode);\n    onChange(null, linkNode.getURL());\n    return;\n  }\n  const url = linkNode.getURL();\n  if (url !== match.url) {\n    linkNode.setURL(match.url);\n    onChange(match.url, url);\n  }\n  if (match.attributes) {\n    const rel = linkNode.getRel();\n    if (rel !== match.attributes.rel) {\n      linkNode.setRel(match.attributes.rel || null);\n      onChange(match.attributes.rel || null, rel);\n    }\n    const target = linkNode.getTarget();\n    if (target !== match.attributes.target) {\n      linkNode.setTarget(match.attributes.target || null);\n      onChange(match.attributes.target || null, target);\n    }\n  }\n}\n\n// Bad neighbors are edits in neighbor nodes that make AutoLinks incompatible.\n// Given the creation preconditions, these can only be simple text nodes.\nfunction handleBadNeighbors(textNode, matchers, onChange, separatorRegex) {\n  const parent = textNode.getParent();\n  const previousSibling = textNode.getPreviousSibling();\n  const nextSibling = textNode.getNextSibling();\n  const text = textNode.getTextContent();\n\n  // Skip if textNode is already part of an AutoLinkNode (idempotency check)\n  // The handleLinkEdit on the parent will handle unwrapping if needed\n  if ($isAutoLinkNode(parent) && !parent.getIsUnlinked()) {\n    return;\n  }\n\n  // Handle case: textNode added AFTER a link, making link invalid\n  // Check if previousSibling is a link and adding this textNode makes it invalid\n  if ($isAutoLinkNode(previousSibling) && !previousSibling.getIsUnlinked()) {\n    // Check if the textNode is still a sibling (hasn't been moved) to prevent loops\n    if (previousSibling.is(textNode.getPreviousSibling()) && textNode.getParent() === previousSibling.getParent()) {\n      // If text doesn't start with separator, link should be unwrapped\n      // because non-separator after link makes the boundary invalid\n      if (!startsWithSeparator(text, separatorRegex)) {\n        // Non-separator after link - unwrap the link\n        replaceWithChildren(previousSibling);\n        onChange(null, previousSibling.getURL());\n        return; // Early return after unwrapping to avoid further processing\n      }\n\n      // If text starts with separator, check if it's valid TLD continuation\n      if (startsWithTLD(text, previousSibling.isEmailURI())) {\n        // Valid TLD continuation - try to append\n        const combinedText = previousSibling.getTextContent() + text;\n        const match = findFirstMatch(combinedText, matchers);\n        if (match !== null && match.text === combinedText) {\n          previousSibling.append(textNode);\n          handleLinkEdit(previousSibling, matchers, onChange, separatorRegex);\n          onChange(null, previousSibling.getURL());\n        }\n      }\n      // If starts with separator but not valid TLD, do nothing (link stays valid)\n    }\n  }\n\n  // Handle case: textNode added BEFORE a link, making link invalid\n  if ($isAutoLinkNode(nextSibling) && !nextSibling.getIsUnlinked() && !endsWithSeparator(text, separatorRegex)) {\n    // Check if the nextSibling is still a sibling (hasn't been moved) to prevent loops\n    if (nextSibling.is(textNode.getNextSibling()) && textNode.getParent() === nextSibling.getParent()) {\n      replaceWithChildren(nextSibling);\n      onChange(null, nextSibling.getURL());\n    }\n  }\n}\nfunction replaceWithChildren(node) {\n  const children = node.getChildren();\n  const childrenLength = children.length;\n  for (let j = childrenLength - 1; j >= 0; j--) {\n    node.insertAfter(children[j]);\n  }\n  node.remove();\n  return children.map(child => child.getLatest());\n}\nfunction getTextNodesToMatch(textNode) {\n  // check if next siblings are simple text nodes till a node contains a space separator\n  const textNodesToMatch = [textNode];\n  let nextSibling = textNode.getNextSibling();\n  while (nextSibling !== null && $isTextNode(nextSibling) && nextSibling.isSimpleText()) {\n    textNodesToMatch.push(nextSibling);\n    if (/[\\s]/.test(nextSibling.getTextContent())) {\n      break;\n    }\n    nextSibling = nextSibling.getNextSibling();\n  }\n  return textNodesToMatch;\n}\nconst defaultConfig = {\n  changeHandlers: [],\n  excludeParents: [],\n  matchers: [],\n  separatorRegex: PUNCTUATION_OR_SPACE\n};\nfunction registerAutoLink(editor, config = defaultConfig) {\n  const {\n    matchers,\n    changeHandlers,\n    excludeParents,\n    separatorRegex = PUNCTUATION_OR_SPACE\n  } = config;\n  const onChange = (url, prevUrl) => {\n    for (const handler of changeHandlers) {\n      handler(url, prevUrl);\n    }\n  };\n  return mergeRegister(editor.registerNodeTransform(TextNode, textNode => {\n    const parent = textNode.getParentOrThrow();\n    const previous = textNode.getPreviousSibling();\n    if ($isAutoLinkNode(parent)) {\n      handleLinkEdit(parent, matchers, onChange, separatorRegex);\n    } else if (!$isLinkNode(parent) && !excludeParents.some(pred => pred(parent))) {\n      if (textNode.isSimpleText() && (startsWithSeparator(textNode.getTextContent(), separatorRegex) || !$isAutoLinkNode(previous))) {\n        const textNodesToMatch = getTextNodesToMatch(textNode);\n        $handleLinkCreation(textNodesToMatch, matchers, onChange, separatorRegex);\n      }\n      handleBadNeighbors(textNode, matchers, onChange, separatorRegex);\n    }\n  }), editor.registerCommand(TOGGLE_LINK_COMMAND, payload => {\n    const selection = $getSelection();\n    if (payload !== null || !$isRangeSelection(selection)) {\n      return false;\n    }\n    const nodes = selection.extract();\n    nodes.forEach(node => {\n      const parent = node.getParent();\n      if ($isAutoLinkNode(parent)) {\n        // invert the value\n        parent.setIsUnlinked(!parent.getIsUnlinked());\n        parent.markDirty();\n      }\n    });\n    return false;\n  },\n  // Has to be higher than TOGGLE_LINK_COMMAND in LinkExtension\n  COMMAND_PRIORITY_LOW));\n}\n\n/**\n * An extension to automatically create AutoLinkNode from text\n * that matches the configured matchers. No default implementation\n * is provided for any matcher, see {@link createLinkMatcherWithRegExp}\n * for a helper function to create a matcher from a RegExp, and the\n * Playground's [AutoLinkPlugin](https://github.com/facebook/lexical/blob/main/packages/lexical-playground/src/plugins/AutoLinkPlugin/index.tsx)\n * for some example RegExps that could be used.\n *\n * The given `matchers` and `changeHandlers` will be merged by\n * concatenating the configured arrays.\n */\nconst AutoLinkExtension = defineExtension({\n  config: defaultConfig,\n  dependencies: [LinkExtension],\n  mergeConfig(config, overrides) {\n    const merged = shallowMergeConfig(config, overrides);\n    for (const k of ['matchers', 'changeHandlers', 'excludeParents']) {\n      const v = overrides[k];\n      if (Array.isArray(v)) {\n        merged[k] = [...config[k], ...v];\n      }\n    }\n    return merged;\n  },\n  name: '@lexical/link/AutoLink',\n  nodes: [AutoLinkNode],\n  register: registerAutoLink\n});\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n/** @deprecated renamed to {@link $toggleLink} by @lexical/eslint-plugin rules-of-lexical */\nconst toggleLink = $toggleLink;\n\nexport { $createAutoLinkNode, $createLinkNode, $isAutoLinkNode, $isLinkNode, $toggleLink, AutoLinkExtension, AutoLinkNode, ClickableLinkExtension, LinkExtension, LinkNode, TOGGLE_LINK_COMMAND, createLinkMatcherWithRegExp, formatUrl, registerAutoLink, registerClickableLink, registerLink, toggleLink };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { isHTMLElement, mergeRegister, $getSelection, $isRangeSelection, $isElementNode, getDOMTextNode, $getEditor, $getEditorDOMRenderConfig, $getChildCaret, $findMatchingParent, $getChildCaretOrSelf, $getSiblingCaret, $getAdjacentSiblingOrParentSiblingCaret, $caretRangeFromSelection, $getCaretRangeInDirection, $removeTextFromCaretRange, $isTextPointCaret, $splitAtPointCaretNext, $setSelectionFromCaretRange, $getCaretRange, $getPreviousSelection, $caretFromPoint, $getRoot, $createParagraphNode, $getAdjacentChildCaret, $isChildCaret, $normalizeCaret, $getCollapsedCaretRange, $getCaretInDirection, $isSiblingCaret, $rewindSiblingCaret, $cloneWithProperties, $setSelection, makeStepwiseIterator, $getState, $setState } from 'lexical';\nexport { $findMatchingParent, $getAdjacentSiblingOrParentSiblingCaret, $splitNode, addClassNamesToElement, isBlockDomNode, isHTMLAnchorElement, isHTMLElement, isInlineDomNode, mergeRegister, removeClassNamesFromElement } from 'lexical';\nimport { createRectsFromDOMRange } from '@lexical/selection';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n  throw new Error(message);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst CAN_USE_DOM$1 = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst documentMode = CAN_USE_DOM$1 && 'documentMode' in document ? document.documentMode : null;\nconst IS_APPLE$1 = CAN_USE_DOM$1 && /Mac|iPod|iPhone|iPad/.test(navigator.platform);\nconst IS_FIREFOX$1 = CAN_USE_DOM$1 && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);\nconst CAN_USE_BEFORE_INPUT$1 = CAN_USE_DOM$1 && 'InputEvent' in window && !documentMode ? 'getTargetRanges' in new window.InputEvent('input') : false;\nconst IS_IOS$1 = CAN_USE_DOM$1 && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\nconst IS_ANDROID$1 = CAN_USE_DOM$1 && /Android/.test(navigator.userAgent);\n\n// Exclude Android \u2014 Android WebView's UA contains \"Version/X.X ... Safari/537.36\"\n// which falsely matches the Safari regex, activating wrong composition code paths.\nconst IS_SAFARI$1 = CAN_USE_DOM$1 && /Version\\/[\\d.]+.*Safari/.test(navigator.userAgent) && !IS_ANDROID$1;\n\n// Keep these in case we need to use them in the future.\n// export const IS_WINDOWS: boolean = CAN_USE_DOM && /Win/.test(navigator.platform);\nconst IS_CHROME$1 = CAN_USE_DOM$1 && /^(?=.*Chrome).*/i.test(navigator.userAgent);\n// export const canUseTextInputEvent: boolean = CAN_USE_DOM && 'TextEvent' in window && !documentMode;\n\nconst IS_ANDROID_CHROME$1 = CAN_USE_DOM$1 && IS_ANDROID$1 && IS_CHROME$1;\nconst IS_APPLE_WEBKIT$1 = CAN_USE_DOM$1 && /AppleWebKit\\/[\\d.]+/.test(navigator.userAgent) && IS_APPLE$1 && !IS_CHROME$1;\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction px(value) {\n  return `${value}px`;\n}\n\nconst mutationObserverConfig = {\n  attributes: true,\n  characterData: true,\n  childList: true,\n  subtree: true\n};\nfunction prependDOMNode(parent, node) {\n  parent.insertBefore(node, parent.firstChild);\n}\n\n/**\n * Place one or multiple newly created Nodes at the passed Range's position.\n * Multiple nodes will only be created when the Range spans multiple lines (aka\n * client rects).\n *\n * This function can come particularly useful to highlight particular parts of\n * the text without interfering with the EditorState, that will often replicate\n * the state across collab and clipboard.\n *\n * This function accounts for DOM updates which can modify the passed Range.\n * Hence, the function return to remove the listener.\n */\nfunction mlcPositionNodeOnRange(editor, range, onReposition) {\n  let rootDOMNode = null;\n  let parentDOMNode = null;\n  let observer = null;\n  let lastNodes = [];\n  const wrapperNode = document.createElement('div');\n  wrapperNode.style.position = 'relative';\n  function position() {\n    if (!(rootDOMNode !== null)) {\n      formatDevErrorMessage(`Unexpected null rootDOMNode`);\n    }\n    if (!(parentDOMNode !== null)) {\n      formatDevErrorMessage(`Unexpected null parentDOMNode`);\n    }\n    const {\n      left: parentLeft,\n      top: parentTop\n    } = parentDOMNode.getBoundingClientRect();\n    const rects = createRectsFromDOMRange(editor, range);\n    if (!wrapperNode.isConnected) {\n      prependDOMNode(parentDOMNode, wrapperNode);\n    }\n    let hasRepositioned = false;\n    for (let i = 0; i < rects.length; i++) {\n      const rect = rects[i];\n      // Try to reuse the previously created Node when possible, no need to\n      // remove/create on the most common case reposition case\n      const rectNode = lastNodes[i] || document.createElement('div');\n      const rectNodeStyle = rectNode.style;\n      if (rectNodeStyle.position !== 'absolute') {\n        rectNodeStyle.position = 'absolute';\n        hasRepositioned = true;\n      }\n      const left = px(rect.left - parentLeft);\n      if (rectNodeStyle.left !== left) {\n        rectNodeStyle.left = left;\n        hasRepositioned = true;\n      }\n      const top = px(rect.top - parentTop);\n      if (rectNodeStyle.top !== top) {\n        rectNode.style.top = top;\n        hasRepositioned = true;\n      }\n      const width = px(rect.width);\n      if (rectNodeStyle.width !== width) {\n        rectNode.style.width = width;\n        hasRepositioned = true;\n      }\n      const height = px(rect.height);\n      if (rectNodeStyle.height !== height) {\n        rectNode.style.height = height;\n        hasRepositioned = true;\n      }\n      if (rectNode.parentNode !== wrapperNode) {\n        wrapperNode.append(rectNode);\n        hasRepositioned = true;\n      }\n      lastNodes[i] = rectNode;\n    }\n    while (lastNodes.length > rects.length) {\n      lastNodes.pop();\n    }\n    if (hasRepositioned) {\n      onReposition(lastNodes);\n    }\n  }\n  function stop() {\n    parentDOMNode = null;\n    rootDOMNode = null;\n    if (observer !== null) {\n      observer.disconnect();\n    }\n    observer = null;\n    wrapperNode.remove();\n    for (const node of lastNodes) {\n      node.remove();\n    }\n    lastNodes = [];\n  }\n  function restart() {\n    const currentRootDOMNode = editor.getRootElement();\n    if (currentRootDOMNode === null) {\n      return stop();\n    }\n    const currentParentDOMNode = currentRootDOMNode.parentElement;\n    if (!isHTMLElement(currentParentDOMNode)) {\n      return stop();\n    }\n    stop();\n    rootDOMNode = currentRootDOMNode;\n    parentDOMNode = currentParentDOMNode;\n    observer = new MutationObserver(mutations => {\n      const nextRootDOMNode = editor.getRootElement();\n      const nextParentDOMNode = nextRootDOMNode && nextRootDOMNode.parentElement;\n      if (nextRootDOMNode !== rootDOMNode || nextParentDOMNode !== parentDOMNode) {\n        return restart();\n      }\n      for (const mutation of mutations) {\n        if (!wrapperNode.contains(mutation.target)) {\n          // TODO throttle\n          return position();\n        }\n      }\n    });\n    observer.observe(currentParentDOMNode, mutationObserverConfig);\n    position();\n  }\n  const removeRootListener = editor.registerRootListener(restart);\n  return () => {\n    removeRootListener();\n    stop();\n  };\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction $getOrderedSelectionPoints(selection) {\n  const points = selection.getStartEndPoints();\n  return selection.isBackward() ? [points[1], points[0]] : points;\n}\nfunction $rangeTargetFromPoint(point, node, dom) {\n  if (point.type === 'text' || !$isElementNode(node)) {\n    const textDOM = getDOMTextNode(dom) || dom;\n    return [textDOM, point.offset];\n  } else {\n    const editor = $getEditor();\n    const slot = $getEditorDOMRenderConfig(editor).$getDOMSlot(node, dom, editor);\n    return [slot.element, slot.getFirstChildOffset() + point.offset];\n  }\n}\nfunction $rangeFromPoints(editor, start, startNode, startDOM, end, endNode, endDOM) {\n  const editorDocument = editor._window ? editor._window.document : document;\n  const range = editorDocument.createRange();\n  range.setStart(...$rangeTargetFromPoint(start, startNode, startDOM));\n  range.setEnd(...$rangeTargetFromPoint(end, endNode, endDOM));\n  return range;\n}\nfunction defaultOnReposition(domNodes) {\n  for (const domNode of domNodes) {\n    const domNodeStyle = domNode.style;\n    if (domNodeStyle.background !== 'Highlight') {\n      domNodeStyle.background = 'Highlight';\n    }\n    if (domNodeStyle.color !== 'HighlightText') {\n      domNodeStyle.color = 'HighlightText';\n    }\n    if (domNodeStyle.marginTop !== px(-1.5)) {\n      domNodeStyle.marginTop = px(-1.5);\n    }\n    if (domNodeStyle.paddingTop !== px(4)) {\n      domNodeStyle.paddingTop = px(4);\n    }\n    if (domNodeStyle.paddingBottom !== px(0)) {\n      domNodeStyle.paddingBottom = px(0);\n    }\n  }\n}\n\n/**\n * Place one or multiple newly created Nodes at the current selection. Multiple\n * nodes will only be created when the selection spans multiple lines (aka\n * client rects).\n *\n * This function can come useful when you want to show the selection but the\n * editor has been focused away.\n */\nfunction markSelection(editor, onReposition = defaultOnReposition) {\n  let previousAnchorNode = null;\n  let previousAnchorNodeDOM = null;\n  let previousAnchorOffset = null;\n  let previousFocusNode = null;\n  let previousFocusNodeDOM = null;\n  let previousFocusOffset = null;\n  let removeRangeListener = () => {};\n  function compute(editorState) {\n    editorState.read(() => {\n      const selection = $getSelection();\n      if (!$isRangeSelection(selection)) {\n        // TODO\n        previousAnchorNode = null;\n        previousAnchorOffset = null;\n        previousFocusNode = null;\n        previousFocusOffset = null;\n        removeRangeListener();\n        removeRangeListener = () => {};\n        return;\n      }\n      const [start, end] = $getOrderedSelectionPoints(selection);\n      const currentStartNode = start.getNode();\n      const currentStartNodeKey = currentStartNode.getKey();\n      const currentStartOffset = start.offset;\n      const currentEndNode = end.getNode();\n      const currentEndNodeKey = currentEndNode.getKey();\n      const currentEndOffset = end.offset;\n      const currentStartNodeDOM = editor.getElementByKey(currentStartNodeKey);\n      const currentEndNodeDOM = editor.getElementByKey(currentEndNodeKey);\n      const differentStartDOM = previousAnchorNode === null || currentStartNodeDOM !== previousAnchorNodeDOM || currentStartOffset !== previousAnchorOffset || currentStartNodeKey !== previousAnchorNode.getKey();\n      const differentEndDOM = previousFocusNode === null || currentEndNodeDOM !== previousFocusNodeDOM || currentEndOffset !== previousFocusOffset || currentEndNodeKey !== previousFocusNode.getKey();\n      if ((differentStartDOM || differentEndDOM) && currentStartNodeDOM !== null && currentEndNodeDOM !== null) {\n        const range = $rangeFromPoints(editor, start, currentStartNode, currentStartNodeDOM, end, currentEndNode, currentEndNodeDOM);\n        removeRangeListener();\n        removeRangeListener = mlcPositionNodeOnRange(editor, range, onReposition);\n      }\n      previousAnchorNode = currentStartNode;\n      previousAnchorNodeDOM = currentStartNodeDOM;\n      previousAnchorOffset = currentStartOffset;\n      previousFocusNode = currentEndNode;\n      previousFocusNodeDOM = currentEndNodeDOM;\n      previousFocusOffset = currentEndOffset;\n    });\n  }\n  compute(editor.getEditorState());\n  return mergeRegister(editor.registerUpdateListener(({\n    editorState\n  }) => compute(editorState)), () => {\n    removeRangeListener();\n  });\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction selectionAlwaysOnDisplay(editor, onReposition) {\n  let removeSelectionMark = null;\n  const onSelectionChange = () => {\n    const domSelection = getSelection();\n    const domAnchorNode = domSelection && domSelection.anchorNode;\n    const editorRootElement = editor.getRootElement();\n    const isSelectionInsideEditor = domAnchorNode !== null && editorRootElement !== null && editorRootElement.contains(domAnchorNode);\n    if (isSelectionInsideEditor) {\n      if (removeSelectionMark !== null) {\n        removeSelectionMark();\n        removeSelectionMark = null;\n      }\n    } else {\n      if (removeSelectionMark === null) {\n        removeSelectionMark = markSelection(editor, onReposition);\n      }\n    }\n  };\n  return editor.registerRootListener(rootElement => {\n    if (rootElement) {\n      const document = rootElement.ownerDocument;\n      document.addEventListener('selectionchange', onSelectionChange);\n      onSelectionChange();\n      return () => {\n        if (removeSelectionMark !== null) {\n          removeSelectionMark();\n        }\n        document.removeEventListener('selectionchange', onSelectionChange);\n      };\n    }\n  });\n}\n\n// Hotfix to export these with inlined types #5918\nconst CAN_USE_BEFORE_INPUT = CAN_USE_BEFORE_INPUT$1;\nconst CAN_USE_DOM = CAN_USE_DOM$1;\nconst IS_ANDROID = IS_ANDROID$1;\nconst IS_ANDROID_CHROME = IS_ANDROID_CHROME$1;\nconst IS_APPLE = IS_APPLE$1;\nconst IS_APPLE_WEBKIT = IS_APPLE_WEBKIT$1;\nconst IS_CHROME = IS_CHROME$1;\nconst IS_FIREFOX = IS_FIREFOX$1;\nconst IS_IOS = IS_IOS$1;\nconst IS_SAFARI = IS_SAFARI$1;\n\n/**\n * Returns true if the file type matches the types passed within the acceptableMimeTypes array, false otherwise.\n * The types passed must be strings and are CASE-SENSITIVE.\n * eg. if file is of type 'text' and acceptableMimeTypes = ['TEXT', 'IMAGE'] the function will return false.\n * @param file - The file you want to type check.\n * @param acceptableMimeTypes - An array of strings of types which the file is checked against.\n * @returns true if the file is an acceptable mime type, false otherwise.\n */\nfunction isMimeType(file, acceptableMimeTypes) {\n  for (const acceptableType of acceptableMimeTypes) {\n    if (file.type.startsWith(acceptableType)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * Lexical File Reader with:\n *  1. MIME type support\n *  2. batched results (HistoryPlugin compatibility)\n *  3. Order aware (respects the order when multiple Files are passed)\n *\n * const filesResult = await mediaFileReader(files, ['image/']);\n * filesResult.forEach(file => editor.dispatchCommand('INSERT_IMAGE', \\\\{\n *   src: file.result,\n * \\\\}));\n */\nfunction mediaFileReader(files, acceptableMimeTypes) {\n  const filesIterator = files[Symbol.iterator]();\n  return new Promise((resolve, reject) => {\n    const processed = [];\n    const handleNextFile = () => {\n      const {\n        done,\n        value: file\n      } = filesIterator.next();\n      if (done) {\n        return resolve(processed);\n      }\n      const fileReader = new FileReader();\n      fileReader.addEventListener('error', reject);\n      fileReader.addEventListener('load', () => {\n        const result = fileReader.result;\n        if (typeof result === 'string') {\n          processed.push({\n            file,\n            result\n          });\n        }\n        handleNextFile();\n      });\n      if (isMimeType(file, acceptableMimeTypes)) {\n        fileReader.readAsDataURL(file);\n      } else {\n        handleNextFile();\n      }\n    };\n    handleNextFile();\n  });\n}\n/**\n * \"Depth-First Search\" starts at the root/top node of a tree and goes as far as it can down a branch end\n * before backtracking and finding a new path. Consider solving a maze by hugging either wall, moving down a\n * branch until you hit a dead-end (leaf) and backtracking to find the nearest branching path and repeat.\n * It will then return all the nodes found in the search in an array of objects.\n * Preorder traversal is used, meaning that nodes are listed in the order of when they are FIRST encountered.\n * @param startNode - The node to start the search (inclusive), if omitted, it will start at the root node.\n * @param endNode - The node to end the search (inclusive), if omitted, it will find all descendants of the startingNode. If endNode\n * is an ElementNode, it will stop before visiting any of its children.\n * @returns An array of objects of all the nodes found by the search, including their depth into the tree.\n * \\\\{depth: number, node: LexicalNode\\\\} It will always return at least 1 node (the start node).\n */\nfunction $dfs(startNode, endNode) {\n  return Array.from($dfsIterator(startNode, endNode));\n}\n\n/**\n * Get the adjacent caret in the same direction\n *\n * @param caret A caret or null\n * @returns `caret.getAdjacentCaret()` or `null`\n */\nfunction $getAdjacentCaret(caret) {\n  return caret ? caret.getAdjacentCaret() : null;\n}\n\n/**\n * $dfs iterator (right to left). Tree traversal is done on the fly as new values are requested with O(1) memory.\n * @param startNode - The node to start the search, if omitted, it will start at the root node.\n * @param endNode - The node to end the search, if omitted, it will find all descendants of the startingNode.\n * @returns An iterator, each yielded value is a DFSNode. It will always return at least 1 node (the start node).\n */\nfunction $reverseDfs(startNode, endNode) {\n  return Array.from($reverseDfsIterator(startNode, endNode));\n}\n\n/**\n * $dfs iterator (left to right). Tree traversal is done on the fly as new values are requested with O(1) memory.\n * Preorder traversal is used, meaning that nodes are iterated over in the order of when they are FIRST encountered.\n * @param startNode - The node to start the search (inclusive), if omitted, it will start at the root node.\n * @param endNode - The node to end the search (inclusive), if omitted, it will find all descendants of the startingNode.\n * If endNode is an ElementNode, the iterator will end as soon as it reaches the endNode (no children will be visited).\n * @returns An iterator, each yielded value is a DFSNode. It will always return at least 1 node (the start node).\n */\nfunction $dfsIterator(startNode, endNode) {\n  return $dfsCaretIterator('next', startNode, endNode);\n}\nfunction $getEndCaret(startNode, direction) {\n  const rval = $getAdjacentSiblingOrParentSiblingCaret($getSiblingCaret(startNode, direction));\n  return rval && rval[0];\n}\nfunction $dfsCaretIterator(direction, startNode, endNode) {\n  const root = $getRoot();\n  const start = startNode || root;\n  const startCaret = $isElementNode(start) ? $getChildCaret(start, direction) : $getSiblingCaret(start, direction);\n  const startDepth = $getDepth(start);\n  const endCaret = endNode ? $getAdjacentChildCaret($getChildCaretOrSelf($getSiblingCaret(endNode, direction))) || $getEndCaret(endNode, direction) : $getEndCaret(start, direction);\n  let depth = startDepth;\n  return makeStepwiseIterator({\n    hasNext: state => state !== null,\n    initial: startCaret,\n    map: state => ({\n      depth,\n      node: state.origin\n    }),\n    step: state => {\n      if (state.isSameNodeCaret(endCaret)) {\n        return null;\n      }\n      if ($isChildCaret(state)) {\n        depth++;\n      }\n      const rval = $getAdjacentSiblingOrParentSiblingCaret(state);\n      if (!rval || rval[0].isSameNodeCaret(endCaret)) {\n        return null;\n      }\n      depth += rval[1];\n      return rval[0];\n    }\n  });\n}\n\n/**\n * Returns the Node sibling when this exists, otherwise the closest parent sibling. For example\n * R -> P -> T1, T2\n *   -> P2\n * returns T2 for node T1, P2 for node T2, and null for node P2.\n * @param node LexicalNode.\n * @returns An array (tuple) containing the found Lexical node and the depth difference, or null, if this node doesn't exist.\n */\nfunction $getNextSiblingOrParentSibling(node) {\n  const rval = $getAdjacentSiblingOrParentSiblingCaret($getSiblingCaret(node, 'next'));\n  return rval && [rval[0].origin, rval[1]];\n}\nfunction $getDepth(node) {\n  let depth = -1;\n  for (let innerNode = node; innerNode !== null; innerNode = innerNode.getParent()) {\n    depth++;\n  }\n  return depth;\n}\n\n/**\n * Performs a right-to-left preorder tree traversal.\n * From the starting node it goes to the rightmost child, than backtracks to parent and finds new rightmost path.\n * It will return the next node in traversal sequence after the startingNode.\n * The traversal is similar to $dfs functions above, but the nodes are visited right-to-left, not left-to-right.\n * @param startingNode - The node to start the search.\n * @returns The next node in pre-order right to left traversal sequence or `null`, if the node does not exist\n */\nfunction $getNextRightPreorderNode(startingNode) {\n  const startCaret = $getChildCaretOrSelf($getSiblingCaret(startingNode, 'previous'));\n  const next = $getAdjacentSiblingOrParentSiblingCaret(startCaret, 'root');\n  return next && next[0].origin;\n}\n\n/**\n * $dfs iterator (right to left). Tree traversal is done on the fly as new values are requested with O(1) memory.\n * @param startNode - The node to start the search, if omitted, it will start at the root node.\n * @param endNode - The node to end the search, if omitted, it will find all descendants of the startingNode.\n * @returns An iterator, each yielded value is a DFSNode. It will always return at least 1 node (the start node).\n */\nfunction $reverseDfsIterator(startNode, endNode) {\n  return $dfsCaretIterator('previous', startNode, endNode);\n}\n\n/**\n * Takes a node and traverses up its ancestors (toward the root node)\n * in order to find a specific type of node.\n * @param node - the node to begin searching.\n * @param klass - an instance of the type of node to look for.\n * @returns the node of type klass that was passed, or null if none exist.\n */\nfunction $getNearestNodeOfType(node, klass) {\n  let parent = node;\n  while (parent != null) {\n    if (parent instanceof klass) {\n      return parent;\n    }\n    parent = parent.getParent();\n  }\n  return null;\n}\n\n/**\n * Returns the element node of the nearest ancestor, otherwise throws an error.\n * @param startNode - The starting node of the search\n * @returns The ancestor node found\n */\nfunction $getNearestBlockElementAncestorOrThrow(startNode) {\n  const blockNode = $findMatchingParent(startNode, node => $isElementNode(node) && !node.isInline());\n  if (!$isElementNode(blockNode)) {\n    {\n      formatDevErrorMessage(`Expected node ${startNode.__key} to have closest block element node.`);\n    }\n  }\n  return blockNode;\n}\n/**\n * Attempts to resolve nested element nodes of the same type into a single node of that type.\n * It is generally used for marks/commenting\n * @param editor - The lexical editor\n * @param targetNode - The target for the nested element to be extracted from.\n * @param cloneNode - See {@link $createMarkNode}\n * @param handleOverlap - Handles any overlap between the node to extract and the targetNode\n * @returns The lexical editor\n */\nfunction registerNestedElementResolver(editor, targetNode, cloneNode, handleOverlap) {\n  const $isTargetNode = node => {\n    return node instanceof targetNode;\n  };\n  const $findMatch = node => {\n    // First validate we don't have any children that are of the target,\n    // as we need to handle them first.\n    const children = node.getChildren();\n    for (let i = 0; i < children.length; i++) {\n      const child = children[i];\n      if ($isTargetNode(child)) {\n        return null;\n      }\n    }\n    let parentNode = node;\n    let childNode = node;\n    while (parentNode !== null) {\n      childNode = parentNode;\n      parentNode = parentNode.getParent();\n      if ($isTargetNode(parentNode)) {\n        return {\n          child: childNode,\n          parent: parentNode\n        };\n      }\n    }\n    return null;\n  };\n  const $elementNodeTransform = node => {\n    const match = $findMatch(node);\n    if (match !== null) {\n      const {\n        child,\n        parent\n      } = match;\n\n      // Simple path, we can move child out and siblings into a new parent.\n\n      if (child.is(node)) {\n        handleOverlap(parent, node);\n        const nextSiblings = child.getNextSiblings();\n        const nextSiblingsLength = nextSiblings.length;\n        parent.insertAfter(child);\n        if (nextSiblingsLength !== 0) {\n          const newParent = cloneNode(parent);\n          child.insertAfter(newParent);\n          for (let i = 0; i < nextSiblingsLength; i++) {\n            newParent.append(nextSiblings[i]);\n          }\n        }\n        if (!parent.canBeEmpty() && parent.getChildrenSize() === 0) {\n          parent.remove();\n        }\n      }\n    }\n  };\n  return editor.registerNodeTransform(targetNode, $elementNodeTransform);\n}\n\n/**\n * Clones the editor and marks it as dirty to be reconciled. If there was a selection,\n * it would be set back to its previous state, or null otherwise.\n * @param editor - The lexical editor\n * @param editorState - The editor's state\n */\nfunction $restoreEditorState(editor, editorState) {\n  const FULL_RECONCILE = 2;\n  const nodeMap = new Map();\n  const activeEditorState = editor._pendingEditorState;\n  for (const [key, node] of editorState._nodeMap) {\n    nodeMap.set(key, $cloneWithProperties(node));\n  }\n  if (activeEditorState) {\n    activeEditorState._nodeMap = nodeMap;\n  }\n  editor._dirtyType = FULL_RECONCILE;\n  const selection = editorState._selection;\n  $setSelection(selection === null ? null : selection.clone());\n}\n\n/**\n * If the selected insertion area is the root/shadow root node (see {@link lexical!$isRootOrShadowRoot}),\n * the node will be appended there, otherwise, it will be inserted before the insertion area.\n * If there is no selection where the node is to be inserted, it will be appended after any current nodes\n * within the tree, as a child of the root node. A paragraph will then be added after the inserted node and selected.\n * @param node - The node to be inserted\n * @returns The node after its insertion\n */\nfunction $insertNodeToNearestRoot(node) {\n  const selection = $getSelection() || $getPreviousSelection();\n  let initialCaret;\n  if ($isRangeSelection(selection)) {\n    initialCaret = $caretFromPoint(selection.focus, 'next');\n  } else {\n    if (selection != null) {\n      const nodes = selection.getNodes();\n      const lastNode = nodes[nodes.length - 1];\n      if (lastNode) {\n        initialCaret = $getSiblingCaret(lastNode, 'next');\n      }\n    }\n    initialCaret = initialCaret || $getChildCaret($getRoot(), 'previous').getFlipped().insert($createParagraphNode());\n  }\n  const insertCaret = $insertNodeToNearestRootAtCaret(node, initialCaret);\n  const adjacent = $getAdjacentChildCaret(insertCaret);\n  const selectionCaret = $isChildCaret(adjacent) ? $normalizeCaret(adjacent) : insertCaret;\n  $setSelectionFromCaretRange($getCollapsedCaretRange(selectionCaret));\n  return node.getLatest();\n}\n\n/**\n * If the insertion caret is the root/shadow root node (see {@link lexical!$isRootOrShadowRoot}),\n * the node will be inserted there, otherwise the parent nodes will be split according to the\n * given options.\n * @param node - The node to be inserted\n * @param caret - The location to insert or split from\n * @returns The node after its insertion\n */\nfunction $insertNodeToNearestRootAtCaret(node, caret, options) {\n  let insertCaret = $getCaretInDirection(caret, 'next');\n  // Normalize boundary cases for TextPointCaret\n  if ($isTextPointCaret(insertCaret)) {\n    if (insertCaret.offset === 0) {\n      insertCaret = $getSiblingCaret(insertCaret.origin, 'previous').getFlipped();\n    } else if (insertCaret.offset === insertCaret.origin.getTextContentSize()) {\n      insertCaret = $getSiblingCaret(insertCaret.origin, 'next');\n    }\n  }\n  // Make sure we have a distinct node as the origin\n  if (insertCaret.origin.is(node)) {\n    if (!$isSiblingCaret(insertCaret)) {\n      formatDevErrorMessage(`$insertNodeToNearestRootAtCaret node ${node.getKey()} of type ${node.getType()} can not be inserted into itself`);\n    }\n    insertCaret = $rewindSiblingCaret(insertCaret);\n  }\n  // Handle split boundary conditions where node is being inserted adjacent to itself\n  if (node.is(insertCaret.getNodeAtCaret()) || node.is(insertCaret.getFlipped().getNodeAtCaret())) {\n    node.remove(true);\n  }\n  for (let nextCaret = insertCaret; nextCaret; nextCaret = $splitAtPointCaretNext(nextCaret, options)) {\n    insertCaret = nextCaret;\n  }\n  if (!!$isTextPointCaret(insertCaret)) {\n    formatDevErrorMessage(`$insertNodeToNearestRootAtCaret: An unattached TextNode can not be split`);\n  }\n  insertCaret.insert(node.isInline() ? $createParagraphNode().append(node) : node);\n  return $getCaretInDirection($getSiblingCaret(node.getLatest(), 'next'), caret.direction);\n}\n\n/**\n * Inserts a node into leaf \u2014 the deepest accessible node at the carriage position\n * @param node - The node to be inserted\n */\nfunction $insertNodeIntoLeaf(node) {\n  const selection = $getSelection();\n  if (!$isRangeSelection(selection)) {\n    if (selection) {\n      selection.insertNodes([node]);\n    }\n    return;\n  }\n  const caretRange = $caretRangeFromSelection(selection);\n  let insertCaret = $getCaretRangeInDirection($removeTextFromCaretRange(caretRange), 'next').anchor;\n  if ($isTextPointCaret(insertCaret)) {\n    const nextAnchor = $splitAtPointCaretNext(insertCaret);\n    if (!nextAnchor) {\n      return;\n    }\n    insertCaret = nextAnchor;\n  }\n  const focus = insertCaret.getFlipped();\n  focus.insert(node);\n  $setSelectionFromCaretRange($getCaretRange(focus, focus));\n}\n\n/**\n * Wraps the node into another node created from a createElementNode function, eg. $createParagraphNode\n * @param node - Node to be wrapped.\n * @param createElementNode - Creates a new lexical element to wrap the to-be-wrapped node and returns it.\n * @returns A new lexical element with the previous node appended within (as a child, including its children).\n */\nfunction $wrapNodeInElement(node, createElementNode) {\n  const elementNode = createElementNode();\n  node.replace(elementNode);\n  elementNode.append(node);\n  return elementNode;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n/**\n * @param object = The instance of the type\n * @param objectClass = The class of the type\n * @returns Whether the object is has the same Klass of the objectClass, ignoring the difference across window (e.g. different iframes)\n */\nfunction objectKlassEquals(object, objectClass) {\n  return object !== null ? Object.getPrototypeOf(object).constructor.name === objectClass.name : false;\n}\n\n/**\n * @deprecated Use Array filter or flatMap\n *\n * Filter the nodes\n * @param nodes Array of nodes that needs to be filtered\n * @param filterFn A filter function that returns node if the current node satisfies the condition otherwise null\n * @returns Array of filtered nodes\n */\n\nfunction $filter(nodes, filterFn) {\n  const result = [];\n  for (let i = 0; i < nodes.length; i++) {\n    const node = filterFn(nodes[i]);\n    if (node !== null) {\n      result.push(node);\n    }\n  }\n  return result;\n}\n\n/**\n * Applies the provided callback to each indentable block element in the Selection\n *\n * @param indentOrOutdent callback for performing the indent or outdent action\n * on a given block element.\n * @returns true if at least one block was handled, false otherwise.\n */\nfunction $handleIndentAndOutdent(indentOrOutdent) {\n  const selection = $getSelection();\n  if (!$isRangeSelection(selection)) {\n    return false;\n  }\n  const alreadyHandled = new Set();\n  const nodes = selection.getNodes();\n  for (let i = 0; i < nodes.length; i++) {\n    const node = nodes[i];\n    const key = node.getKey();\n    if (alreadyHandled.has(key)) {\n      continue;\n    }\n    const parentBlock = $findMatchingParent(node, parentNode => $isElementNode(parentNode) && !parentNode.isInline());\n    if (parentBlock === null) {\n      continue;\n    }\n    const parentKey = parentBlock.getKey();\n    if (parentBlock.canIndent() && !alreadyHandled.has(parentKey)) {\n      alreadyHandled.add(parentKey);\n      indentOrOutdent(parentBlock);\n    }\n  }\n  return alreadyHandled.size > 0;\n}\n\n/**\n * Appends the node before the first child of the parent node\n * @param parent A parent node\n * @param node Node that needs to be appended\n */\nfunction $insertFirst(parent, node) {\n  $getChildCaret(parent, 'next').insert(node);\n}\nlet NEEDS_MANUAL_ZOOM = IS_FIREFOX || !CAN_USE_DOM ? false : undefined;\nfunction needsManualZoom() {\n  if (NEEDS_MANUAL_ZOOM === undefined) {\n    // If the browser implements standardized CSS zoom, then the client rect\n    // will be wider after zoom is applied\n    // https://chromestatus.com/feature/5198254868529152\n    // https://github.com/facebook/lexical/issues/6863\n    const div = document.createElement('div');\n    div.style.position = 'absolute';\n    div.style.opacity = '0';\n    div.style.width = '100px';\n    div.style.left = '-1000px';\n    document.body.appendChild(div);\n    const noZoom = div.getBoundingClientRect();\n    div.style.setProperty('zoom', '2');\n    NEEDS_MANUAL_ZOOM = div.getBoundingClientRect().width === noZoom.width;\n    document.body.removeChild(div);\n  }\n  return NEEDS_MANUAL_ZOOM;\n}\n\n/**\n * Calculates the zoom level of an element as a result of using\n * css zoom property. For browsers that implement standardized CSS\n * zoom (Firefox, Chrome >= 128), this will always return 1.\n * @param element\n * @param useManualZoom - If true, always use zoom level will be calculated manually, otherwise it will be calculated on as needed basis.\n */\nfunction calculateZoomLevel(element, useManualZoom = false) {\n  let zoom = 1;\n  if (needsManualZoom() || useManualZoom) {\n    while (element) {\n      zoom *= Number(window.getComputedStyle(element).getPropertyValue('zoom'));\n      element = element.parentElement;\n    }\n  }\n  return zoom;\n}\n\n/**\n * Checks if the editor is a nested editor created by LexicalNestedComposer\n */\nfunction $isEditorIsNestedEditor(editor) {\n  return editor._parentEditor !== null;\n}\n\n/**\n * A depth first last-to-first traversal of root that stops at each node that matches\n * $predicate and ensures that its parent is root. This is typically used to discard\n * invalid or unsupported wrapping nodes. For example, a TableNode must only have\n * TableRowNode as children, but an importer might add invalid nodes based on\n * caption, tbody, thead, etc. and this will unwrap and discard those.\n *\n * @param root The root to start the traversal\n * @param $predicate Should return true for nodes that are permitted to be children of root\n * @returns true if this unwrapped or removed any nodes\n */\nfunction $unwrapAndFilterDescendants(root, $predicate) {\n  return $unwrapAndFilterDescendantsImpl(root, $predicate, null);\n}\nfunction $unwrapAndFilterDescendantsImpl(root, $predicate, $onSuccess) {\n  let didMutate = false;\n  for (const node of $lastToFirstIterator(root)) {\n    if ($predicate(node)) {\n      if ($onSuccess !== null) {\n        $onSuccess(node);\n      }\n      continue;\n    }\n    didMutate = true;\n    if ($isElementNode(node)) {\n      $unwrapAndFilterDescendantsImpl(node, $predicate, $onSuccess || (child => node.insertAfter(child)));\n    }\n    node.remove();\n  }\n  return didMutate;\n}\n\n/**\n * A depth first traversal of the children array that stops at and collects\n * each node that `$predicate` matches. This is typically used to discard\n * invalid or unsupported wrapping nodes on a children array in the `after`\n * of an {@link lexical!DOMConversionOutput}. For example, a TableNode must only have\n * TableRowNode as children, but an importer might add invalid nodes based on\n * caption, tbody, thead, etc. and this will unwrap and discard those.\n *\n * This function is read-only and performs no mutation operations, which makes\n * it suitable for import and export purposes but likely not for any in-place\n * mutation. You should use {@link $unwrapAndFilterDescendants} for in-place\n * mutations such as node transforms.\n *\n * @param children The children to traverse\n * @param $predicate Should return true for nodes that are permitted to be children of root\n * @returns The children or their descendants that match $predicate\n */\n\nfunction $descendantsMatching(children, $predicate) {\n  const result = [];\n  const stack = Array.from(children).reverse();\n  for (let child = stack.pop(); child !== undefined; child = stack.pop()) {\n    if ($predicate(child)) {\n      result.push(child);\n    } else if ($isElementNode(child)) {\n      for (const grandchild of $lastToFirstIterator(child)) {\n        stack.push(grandchild);\n      }\n    }\n  }\n  return result;\n}\n\n/**\n * Return an iterator that yields each child of node from first to last, taking\n * care to preserve the next sibling before yielding the value in case the caller\n * removes the yielded node.\n *\n * @param node The node whose children to iterate\n * @returns An iterator of the node's children\n */\nfunction $firstToLastIterator(node) {\n  return $childIterator($getChildCaret(node, 'next'));\n}\n\n/**\n * Return an iterator that yields each child of node from last to first, taking\n * care to preserve the previous sibling before yielding the value in case the caller\n * removes the yielded node.\n *\n * @param node The node whose children to iterate\n * @returns An iterator of the node's children\n */\nfunction $lastToFirstIterator(node) {\n  return $childIterator($getChildCaret(node, 'previous'));\n}\nfunction $childIterator(startCaret) {\n  const seen = new Set() ;\n  return makeStepwiseIterator({\n    hasNext: $isSiblingCaret,\n    initial: startCaret.getAdjacentCaret(),\n    map: caret => {\n      const origin = caret.origin.getLatest();\n      if (seen !== null) {\n        const key = origin.getKey();\n        if (!!seen.has(key)) {\n          formatDevErrorMessage(`$childIterator: Cycle detected, node with key ${String(key)} has already been traversed`);\n        }\n        seen.add(key);\n      }\n      return origin;\n    },\n    step: caret => caret.getAdjacentCaret()\n  });\n}\n\n/**\n * Replace this node with its children\n *\n * @param node The ElementNode to unwrap and remove\n */\nfunction $unwrapNode(node) {\n  $rewindSiblingCaret($getSiblingCaret(node, 'next')).splice(1, node.getChildren());\n}\n\n/**\n * A wrapper that creates bound functions and methods for the\n * StateConfig to save some boilerplate when defining methods\n * or exporting only the accessors from your modules rather\n * than exposing the StateConfig directly.\n */\n\n/**\n * EXPERIMENTAL\n *\n * A convenience interface for working with {@link $getState} and\n * {@link $setState}.\n *\n * @param stateConfig The stateConfig to wrap with convenience functionality\n * @returns a StateWrapper\n */\nfunction makeStateWrapper(stateConfig) {\n  const $get = node => $getState(node, stateConfig);\n  const $set = (node, valueOrUpdater) => $setState(node, stateConfig, valueOrUpdater);\n  return {\n    $get,\n    $set,\n    accessors: [$get, $set],\n    makeGetterMethod: () => function $getter() {\n      return $get(this);\n    },\n    makeSetterMethod: () => function $setter(valueOrUpdater) {\n      return $set(this, valueOrUpdater);\n    },\n    stateConfig\n  };\n}\n\nexport { $descendantsMatching, $dfs, $dfsIterator, $filter, $firstToLastIterator, $getAdjacentCaret, $getDepth, $getNearestBlockElementAncestorOrThrow, $getNearestNodeOfType, $getNextRightPreorderNode, $getNextSiblingOrParentSibling, $handleIndentAndOutdent, $insertFirst, $insertNodeIntoLeaf, $insertNodeToNearestRoot, $insertNodeToNearestRootAtCaret, $isEditorIsNestedEditor, $lastToFirstIterator, $restoreEditorState, $reverseDfs, $reverseDfsIterator, $unwrapAndFilterDescendants, $unwrapNode, $wrapNodeInElement, CAN_USE_BEFORE_INPUT, CAN_USE_DOM, IS_ANDROID, IS_ANDROID_CHROME, IS_APPLE, IS_APPLE_WEBKIT, IS_CHROME, IS_FIREFOX, IS_IOS, IS_SAFARI, calculateZoomLevel, isMimeType, makeStateWrapper, markSelection, mediaFileReader, objectKlassEquals, mlcPositionNodeOnRange as positionNodeOnRange, registerNestedElementResolver, selectionAlwaysOnDisplay };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalUtils.dev.mjs';\nimport * as modProd from './LexicalUtils.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const $descendantsMatching = mod.$descendantsMatching;\nexport const $dfs = mod.$dfs;\nexport const $dfsIterator = mod.$dfsIterator;\nexport const $filter = mod.$filter;\nexport const $findMatchingParent = mod.$findMatchingParent;\nexport const $firstToLastIterator = mod.$firstToLastIterator;\nexport const $getAdjacentCaret = mod.$getAdjacentCaret;\nexport const $getAdjacentSiblingOrParentSiblingCaret = mod.$getAdjacentSiblingOrParentSiblingCaret;\nexport const $getDepth = mod.$getDepth;\nexport const $getNearestBlockElementAncestorOrThrow = mod.$getNearestBlockElementAncestorOrThrow;\nexport const $getNearestNodeOfType = mod.$getNearestNodeOfType;\nexport const $getNextRightPreorderNode = mod.$getNextRightPreorderNode;\nexport const $getNextSiblingOrParentSibling = mod.$getNextSiblingOrParentSibling;\nexport const $handleIndentAndOutdent = mod.$handleIndentAndOutdent;\nexport const $insertFirst = mod.$insertFirst;\nexport const $insertNodeIntoLeaf = mod.$insertNodeIntoLeaf;\nexport const $insertNodeToNearestRoot = mod.$insertNodeToNearestRoot;\nexport const $insertNodeToNearestRootAtCaret = mod.$insertNodeToNearestRootAtCaret;\nexport const $isEditorIsNestedEditor = mod.$isEditorIsNestedEditor;\nexport const $lastToFirstIterator = mod.$lastToFirstIterator;\nexport const $restoreEditorState = mod.$restoreEditorState;\nexport const $reverseDfs = mod.$reverseDfs;\nexport const $reverseDfsIterator = mod.$reverseDfsIterator;\nexport const $splitNode = mod.$splitNode;\nexport const $unwrapAndFilterDescendants = mod.$unwrapAndFilterDescendants;\nexport const $unwrapNode = mod.$unwrapNode;\nexport const $wrapNodeInElement = mod.$wrapNodeInElement;\nexport const CAN_USE_BEFORE_INPUT = mod.CAN_USE_BEFORE_INPUT;\nexport const CAN_USE_DOM = mod.CAN_USE_DOM;\nexport const IS_ANDROID = mod.IS_ANDROID;\nexport const IS_ANDROID_CHROME = mod.IS_ANDROID_CHROME;\nexport const IS_APPLE = mod.IS_APPLE;\nexport const IS_APPLE_WEBKIT = mod.IS_APPLE_WEBKIT;\nexport const IS_CHROME = mod.IS_CHROME;\nexport const IS_FIREFOX = mod.IS_FIREFOX;\nexport const IS_IOS = mod.IS_IOS;\nexport const IS_SAFARI = mod.IS_SAFARI;\nexport const addClassNamesToElement = mod.addClassNamesToElement;\nexport const calculateZoomLevel = mod.calculateZoomLevel;\nexport const isBlockDomNode = mod.isBlockDomNode;\nexport const isHTMLAnchorElement = mod.isHTMLAnchorElement;\nexport const isHTMLElement = mod.isHTMLElement;\nexport const isInlineDomNode = mod.isInlineDomNode;\nexport const isMimeType = mod.isMimeType;\nexport const makeStateWrapper = mod.makeStateWrapper;\nexport const markSelection = mod.markSelection;\nexport const mediaFileReader = mod.mediaFileReader;\nexport const mergeRegister = mod.mergeRegister;\nexport const objectKlassEquals = mod.objectKlassEquals;\nexport const positionNodeOnRange = mod.positionNodeOnRange;\nexport const registerNestedElementResolver = mod.registerNestedElementResolver;\nexport const removeClassNamesFromElement = mod.removeClassNamesFromElement;\nexport const selectionAlwaysOnDisplay = mod.selectionAlwaysOnDisplay;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { defineExtension, safeCast, CLEAR_EDITOR_COMMAND, COMMAND_PRIORITY_EDITOR, $getRoot, $getSelection, $createParagraphNode, $isRangeSelection, getStaticNodeConfig, FORMAT_TEXT_COMMAND, $isNodeSelection, COMMAND_PRIORITY_LOW, DecoratorNode, $getState, toggleTextFormatType, $setState, TEXT_TYPE_TO_FORMAT, createState, shallowMergeConfig, RootNode, TextNode, LineBreakNode, TabNode, ParagraphNode, $isEditorState, HISTORY_MERGE_TAG, createEditor, mergeRegister, $getNodeByKey, $create, CLICK_COMMAND, isDOMNode, $getNodeFromDOMNode, addClassNamesToElement, createCommand, $createNodeSelection, $setSelection, removeClassNamesFromElement, $getEditor, KEY_TAB_COMMAND, OUTDENT_CONTENT_COMMAND, INDENT_CONTENT_COMMAND, INSERT_TAB_COMMAND, COMMAND_PRIORITY_CRITICAL, $isBlockElementNode, $createRangeSelection, $normalizeSelection__EXPERIMENTAL } from 'lexical';\nexport { configExtension, declarePeerDependency, defineExtension, safeCast, shallowMergeConfig } from 'lexical';\nimport { $insertNodeToNearestRoot, selectionAlwaysOnDisplay, $handleIndentAndOutdent, $getNearestBlockElementAncestorOrThrow } from '@lexical/utils';\n\nconst i=Symbol.for(\"preact-signals\");function t(){if(e>1){e--;return}let i,t=false;!function(){let i=r;r=void 0;while(void 0!==i){if(i.S.v===i.v)i.S.i=i.i;i=i.o;}}();while(void 0!==s){let n=s;s=void 0;u++;while(void 0!==n){const o=n.u;n.u=void 0;n.f&=-3;if(!(8&n.f)&&w(n))try{n.c();}catch(n){if(!t){i=n;t=true;}}n=o;}}u=0;e--;if(t)throw i}function n(i){if(e>0)return i();d=++c;e++;try{return i()}finally{t();}}let o,s;function h(i){const t=o;o=void 0;try{return i()}finally{o=t;}}let r,e=0,u=0,c=0,d=0,v=0;function l(i){if(void 0===o)return;let t=i.n;if(void 0===t||t.t!==o){t={i:0,S:i,p:o.s,n:void 0,t:o,e:void 0,x:void 0,r:t};if(void 0!==o.s)o.s.n=t;o.s=t;i.n=t;if(32&o.f)i.S(t);return t}else if(-1===t.i){t.i=0;if(void 0!==t.n){t.n.p=t.p;if(void 0!==t.p)t.p.n=t.n;t.p=o.s;t.n=void 0;o.s.n=t;o.s=t;}return t}}function y(i,t){this.v=i;this.i=0;this.n=void 0;this.t=void 0;this.l=0;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name;}y.prototype.brand=i;y.prototype.h=function(){return  true};y.prototype.S=function(i){const t=this.t;if(t!==i&&void 0===i.e){i.x=t;this.t=i;if(void 0!==t)t.e=i;else h(()=>{var i;null==(i=this.W)||i.call(this);});}};y.prototype.U=function(i){if(void 0!==this.t){const t=i.e,n=i.x;if(void 0!==t){t.x=n;i.e=void 0;}if(void 0!==n){n.e=t;i.x=void 0;}if(i===this.t){this.t=n;if(void 0===n)h(()=>{var i;null==(i=this.Z)||i.call(this);});}}};y.prototype.subscribe=function(i){return j(()=>{const t=this.value,n=o;o=void 0;try{i(t);}finally{o=n;}},{name:\"sub\"})};y.prototype.valueOf=function(){return this.value};y.prototype.toString=function(){return this.value+\"\"};y.prototype.toJSON=function(){return this.value};y.prototype.peek=function(){const i=o;o=void 0;try{return this.value}finally{o=i;}};Object.defineProperty(y.prototype,\"value\",{get(){const i=l(this);if(void 0!==i)i.i=this.i;return this.v},set(i){if(i!==this.v){if(u>100)throw new Error(\"Cycle detected\");!function(i){if(0!==e&&0===u)if(i.l!==d){i.l=d;r={S:i,v:i.v,i:i.i,o:r};}}(this);this.v=i;this.i++;v++;e++;try{for(let i=this.t;void 0!==i;i=i.x)i.t.N();}finally{t();}}}});function a(i,t){return new y(i,t)}function w(i){for(let t=i.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return  true;return  false}function _(i){for(let t=i.s;void 0!==t;t=t.n){const n=t.S.n;if(void 0!==n)t.r=n;t.S.n=t;t.i=-1;if(void 0===t.n){i.s=t;break}}}function b(i){let t,n=i.s;while(void 0!==n){const i=n.p;if(-1===n.i){n.S.U(n);if(void 0!==i)i.n=n.n;if(void 0!==n.n)n.n.p=i;}else t=n;n.S.n=n.r;if(void 0!==n.r)n.r=void 0;n=i;}i.s=t;}function p(i,t){y.call(this,void 0);this.x=i;this.s=void 0;this.g=v-1;this.f=4;this.W=null==t?void 0:t.watched;this.Z=null==t?void 0:t.unwatched;this.name=null==t?void 0:t.name;}p.prototype=new y;p.prototype.h=function(){this.f&=-3;if(1&this.f)return  false;if(32==(36&this.f))return  true;this.f&=-5;if(this.g===v)return  true;this.g=v;this.f|=1;if(this.i>0&&!w(this)){this.f&=-2;return  true}const i=o;try{_(this);o=this;const i=this.x();if(16&this.f||this.v!==i||0===this.i){this.v=i;this.f&=-17;this.i++;}}catch(i){this.v=i;this.f|=16;this.i++;}o=i;b(this);this.f&=-2;return  true};p.prototype.S=function(i){if(void 0===this.t){this.f|=36;for(let i=this.s;void 0!==i;i=i.n)i.S.S(i);}y.prototype.S.call(this,i);};p.prototype.U=function(i){if(void 0!==this.t){y.prototype.U.call(this,i);if(void 0===this.t){this.f&=-33;for(let i=this.s;void 0!==i;i=i.n)i.S.U(i);}}};p.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let i=this.t;void 0!==i;i=i.x)i.t.N();}};Object.defineProperty(p.prototype,\"value\",{get(){if(1&this.f)throw new Error(\"Cycle detected\");const i=l(this);this.h();if(void 0!==i)i.i=this.i;if(16&this.f)throw this.v;return this.v}});function g(i,t){return new p(i,t)}function S(i){const n=i.m;i.m=void 0;if(\"function\"==typeof n){e++;const s=o;o=void 0;try{n();}catch(t){i.f&=-2;i.f|=8;m(i);throw t}finally{o=s;t();}}}function m(i){for(let t=i.s;void 0!==t;t=t.n)t.S.U(t);i.x=void 0;i.s=void 0;S(i);}function x(i){if(o!==this)throw new Error(\"Out-of-order effect\");b(this);o=i;this.f&=-2;if(8&this.f)m(this);t();}function E(i,t){this.x=i;this.m=void 0;this.s=void 0;this.u=void 0;this.f=32;this.name=null==t?void 0:t.name;}E.prototype.c=function(){const i=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const t=this.x();if(\"function\"==typeof t)this.m=t;}finally{i();}};E.prototype.S=function(){if(1&this.f)throw new Error(\"Cycle detected\");this.f|=1;this.f&=-9;S(this);_(this);e++;const i=o;o=this;return x.bind(this,i)};E.prototype.N=function(){if(!(2&this.f)){this.f|=2;this.u=s;s=this;}};E.prototype.d=function(){this.f|=8;if(!(1&this.f))m(this);};E.prototype.dispose=function(){this.d();};function j(i,t){const n=new E(i,t);try{n.c();}catch(i){n.d();throw i}const o=n.d.bind(n);o[Symbol.dispose]=o;return o}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n/**\n * Return an object with the same shape as `defaults` with a {@link Signal}\n * for each value. If specified, the second `opts` argument is a partial\n * of overrides to the defaults and will be used as the initial value.\n *\n * Typically used to make a reactive version of some subset of the\n * configuration of an extension, so it can be reconfigured at runtime.\n *\n * @param defaults The object with default values\n * @param opts Overrides to those default values\n * @returns An object with signals initialized with the default values\n */\nfunction namedSignals(defaults, opts = {}) {\n  // eslint-disable-next-line @typescript-eslint/no-explicit-any\n  const initial = {};\n  for (const k in defaults) {\n    const v = opts[k];\n    const store = a(v === undefined ? defaults[k] : v);\n    initial[k] = store;\n  }\n  return initial;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * An Extension to focus the LexicalEditor when the root element is set\n * (typically only when the editor is first created).\n */\nconst AutoFocusExtension = defineExtension({\n  build: (editor, config, state) => {\n    return namedSignals(config);\n  },\n  config: safeCast({\n    defaultSelection: 'rootEnd',\n    disabled: false\n  }),\n  name: '@lexical/extension/AutoFocus',\n  register(editor, config, state) {\n    const stores = state.getOutput();\n    return j(() => stores.disabled.value ? undefined : editor.registerRootListener(rootElement => {\n      editor.focus(() => {\n        // If we try and move selection to the same point with setBaseAndExtent, it won't\n        // trigger a re-focus on the element. So in the case this occurs, we'll need to correct it.\n        // Normally this is fine, Selection API !== Focus API, but fore the intents of the naming\n        // of this plugin, which should preserve focus too.\n        const activeElement = document.activeElement;\n        if (rootElement !== null && (activeElement === null || !rootElement.contains(activeElement))) {\n          // Note: preventScroll won't work in Webkit.\n          rootElement.focus({\n            preventScroll: true\n          });\n        }\n      }, {\n        defaultSelection: stores.defaultSelection.peek()\n      });\n    }));\n  }\n});\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction $defaultOnClear() {\n  const root = $getRoot();\n  const selection = $getSelection();\n  const paragraph = $createParagraphNode();\n  root.clear();\n  root.append(paragraph);\n  if (selection !== null) {\n    paragraph.select();\n  }\n  if ($isRangeSelection(selection)) {\n    selection.format = 0;\n  }\n}\nfunction registerClearEditor(editor, $onClear = $defaultOnClear) {\n  return editor.registerCommand(CLEAR_EDITOR_COMMAND, payload => {\n    editor.update($onClear);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR);\n}\n\n/**\n * An extension to provide an implementation of {@link CLEAR_EDITOR_COMMAND}\n */\nconst ClearEditorExtension = defineExtension({\n  build(editor, config, state) {\n    return namedSignals(config);\n  },\n  config: safeCast({\n    $onClear: $defaultOnClear\n  }),\n  name: '@lexical/extension/ClearEditor',\n  register(editor, config, state) {\n    const {\n      $onClear\n    } = state.getOutput();\n    return j(() => registerClearEditor(editor, $onClear.value));\n  }\n});\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n/**\n * Get the sets of nodes and types registered in the\n * {@link InitialEditorConfig}. This is to be used when an extension\n * needs to register optional behavior if some node or type is present.\n *\n * @param config The InitialEditorConfig (accessible from an extension's init)\n * @returns The known types and nodes as Sets\n */\nfunction getKnownTypesAndNodes(config) {\n  const types = new Set();\n  const nodes = new Set();\n  for (const klassOrReplacement of getNodeConfig(config)) {\n    const klass = typeof klassOrReplacement === 'function' ? klassOrReplacement : klassOrReplacement.replace;\n    // For the side-effect of filling in the static methods\n    void getStaticNodeConfig(klass);\n    types.add(klass.getType());\n    nodes.add(klass);\n  }\n  return {\n    nodes,\n    types\n  };\n}\nfunction getNodeConfig(config) {\n  return (typeof config.nodes === 'function' ? config.nodes() : config.nodes) || [];\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst formatState = createState('format', {\n  parse: value => typeof value === 'number' ? value : 0\n});\nclass DecoratorTextNode extends DecoratorNode {\n  $config() {\n    return this.config('decorator-text', {\n      extends: DecoratorNode,\n      stateConfigs: [{\n        flat: true,\n        stateConfig: formatState\n      }]\n    });\n  }\n  getFormat() {\n    return $getState(this, formatState);\n  }\n  getFormatFlags(type, alignWithFormat) {\n    return toggleTextFormatType(this.getFormat(), type, alignWithFormat);\n  }\n  hasFormat(type) {\n    const formatFlag = TEXT_TYPE_TO_FORMAT[type];\n    return (this.getFormat() & formatFlag) !== 0;\n  }\n  setFormat(type) {\n    return $setState(this, formatState, type);\n  }\n  toggleFormat(type) {\n    const format = this.getFormat();\n    const newFormat = toggleTextFormatType(format, type, null);\n    return this.setFormat(newFormat);\n  }\n  isInline() {\n    return true;\n  }\n  createDOM() {\n    return document.createElement('span');\n  }\n  updateDOM() {\n    return false;\n  }\n}\nfunction $isDecoratorTextNode(node) {\n  return node instanceof DecoratorTextNode;\n}\n\n/**\n * Applies formatting to the node based on the properties in the passed style object.\n * By default, properties are checked according to the values set\n * when importing content from Google Docs.\n * This algorithm is identical to the TextNode import.\n\n * @param lexicalNode The node to which the format will apply\n * @param style CSS style object\n * @param shouldApply format to apply if it is not in style\n * @returns lexicalNode\n */\nfunction applyFormatFromStyle(lexicalNode, style, shouldApply) {\n  const fontWeight = style.fontWeight;\n  const textDecoration = style.textDecoration.split(' ');\n  // Google Docs uses span tags + font-weight for bold text\n  const hasBoldFontWeight = fontWeight === '700' || fontWeight === 'bold';\n  // Google Docs uses span tags + text-decoration: line-through for strikethrough text\n  const hasLinethroughTextDecoration = textDecoration.includes('line-through');\n  // Google Docs uses span tags + font-style for italic text\n  const hasItalicFontStyle = style.fontStyle === 'italic';\n  // Google Docs uses span tags + text-decoration: underline for underline text\n  const hasUnderlineTextDecoration = textDecoration.includes('underline');\n  // Google Docs uses span tags + vertical-align to specify subscript and superscript\n  const verticalAlign = style.verticalAlign;\n  if (hasBoldFontWeight && !lexicalNode.hasFormat('bold')) {\n    lexicalNode.toggleFormat('bold');\n  }\n  if (hasLinethroughTextDecoration && !lexicalNode.hasFormat('strikethrough')) {\n    lexicalNode.toggleFormat('strikethrough');\n  }\n  if (hasItalicFontStyle && !lexicalNode.hasFormat('italic')) {\n    lexicalNode.toggleFormat('italic');\n  }\n  if (hasUnderlineTextDecoration && !lexicalNode.hasFormat('underline')) {\n    lexicalNode.toggleFormat('underline');\n  }\n  if (verticalAlign === 'sub' && !lexicalNode.hasFormat('subscript')) {\n    lexicalNode.toggleFormat('subscript');\n  }\n  if (verticalAlign === 'super' && !lexicalNode.hasFormat('superscript')) {\n    lexicalNode.toggleFormat('superscript');\n  }\n  if (shouldApply && !lexicalNode.hasFormat(shouldApply)) {\n    lexicalNode.toggleFormat(shouldApply);\n  }\n  return lexicalNode;\n}\n\n/**\n * The function wraps the passed DOM node in semantic tags depending on the node format.\n *\n * @param lexicalNode The node where the format is checked\n * @param domNode DOM that will be wrapped in tags\n * @param tagNameToFormat Tag name and format mapping\n * @returns domNode\n */\nfunction applyFormatToDom(lexicalNode, domNode, tagNameToFormat = DEFAULT_TAG_NAME_TO_FORMAT) {\n  for (const [tag, format] of Object.entries(tagNameToFormat)) {\n    if (lexicalNode.hasFormat(format)) {\n      domNode = wrapElementWith(domNode, tag);\n    }\n  }\n  return domNode;\n}\nfunction wrapElementWith(element, tag) {\n  const el = document.createElement(tag);\n  el.appendChild(element);\n  return el;\n}\nconst DEFAULT_TAG_NAME_TO_FORMAT = {\n  b: 'bold',\n  code: 'code',\n  em: 'italic',\n  i: 'italic',\n  mark: 'highlight',\n  s: 'strikethrough',\n  strong: 'bold',\n  sub: 'subscript',\n  sup: 'superscript',\n  u: 'underline'\n};\n\n/**\n * An extension for DecoratorTextNode that sets the format for the node and CSS classes for the DOM container.\n * The base class is always set, and the focus class is set when the node is selected.\n */\nconst DecoratorTextExtension = defineExtension({\n  name: '@lexical/extension/DecoratorText',\n  nodes: () => [DecoratorTextNode],\n  register(editor, config, state) {\n    return editor.registerCommand(FORMAT_TEXT_COMMAND, formatType => {\n      const selection = $getSelection();\n      if ($isNodeSelection(selection) || $isRangeSelection(selection)) {\n        for (const node of selection.getNodes()) {\n          if ($isDecoratorTextNode(node)) {\n            node.toggleFormat(formatType);\n          }\n        }\n      }\n      return false;\n    }, COMMAND_PRIORITY_LOW);\n  }\n});\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * Create a Signal that will subscribe to a value from an external store when watched, similar to\n * React's [useSyncExternalStore](https://react.dev/reference/react/useSyncExternalStore).\n *\n * @param getSnapshot Used to get the initial value of the signal when created and when first watched.\n * @param register A callback that will subscribe to some external store and update the signal, must return a dispose function.\n * @returns The signal\n */\nfunction watchedSignal(getSnapshot, register) {\n  let dispose;\n  return a(getSnapshot(), {\n    unwatched() {\n      if (dispose) {\n        dispose();\n        dispose = undefined;\n      }\n    },\n    watched() {\n      this.value = getSnapshot();\n      dispose = register(this);\n    }\n  });\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * An extension to provide the current EditorState as a signal\n */\nconst EditorStateExtension = defineExtension({\n  build(editor) {\n    return watchedSignal(() => editor.getEditorState(), editorStateSignal => editor.registerUpdateListener(payload => {\n      editorStateSignal.value = payload.editorState;\n    }));\n  },\n  name: '@lexical/extension/EditorState'\n});\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n  throw new Error(message);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * Recursively merge the given theme configuration in-place.\n *\n * @returns If `a` and `b` are both objects (and `b` is not an Array) then\n * all keys in `b` are merged into `a` then `a` is returned.\n * Otherwise `b` is returned.\n *\n * @example\n * ```ts\n * const a = { a: \"a\", nested: { a: 1 } };\n * const b = { b: \"b\", nested: { b: 2 } };\n * const rval = deepThemeMergeInPlace(a, b);\n * expect(a).toBe(rval);\n * expect(a).toEqual({ a: \"a\", b: \"b\", nested: { a: 1, b: 2 } });\n * ```\n */\nfunction deepThemeMergeInPlace(a, b) {\n  if (a && b && !Array.isArray(b) && typeof a === 'object' && typeof b === 'object') {\n    const aObj = a;\n    const bObj = b;\n    for (const k in bObj) {\n      aObj[k] = deepThemeMergeInPlace(aObj[k], bObj[k]);\n    }\n    return a;\n  }\n  return b;\n}\n\nconst ExtensionRepStateIds = {\n  /* eslint-disable sort-keys-fix/sort-keys-fix */\n  unmarked: 0,\n  temporary: 1,\n  permanent: 2,\n  configured: 3,\n  initialized: 4,\n  built: 5,\n  registered: 6,\n  afterRegistration: 7\n  /* eslint-enable sort-keys-fix/sort-keys-fix */\n};\nfunction isExactlyUnmarkedExtensionRepState(state) {\n  return state.id === ExtensionRepStateIds.unmarked;\n}\nfunction isExactlyTemporaryExtensionRepState(state) {\n  return state.id === ExtensionRepStateIds.temporary;\n}\nfunction isExactlyPermanentExtensionRepState(state) {\n  return state.id === ExtensionRepStateIds.permanent;\n}\nfunction isConfiguredExtensionRepState(state) {\n  return state.id >= ExtensionRepStateIds.configured;\n}\nfunction isInitializedExtensionRepState(state) {\n  return state.id >= ExtensionRepStateIds.initialized;\n}\nfunction isBuiltExtensionRepState(state) {\n  return state.id >= ExtensionRepStateIds.built;\n}\nfunction isAfterRegistrationState(state) {\n  return state.id >= ExtensionRepStateIds.afterRegistration;\n}\nfunction applyTemporaryMark(state) {\n  if (!isExactlyUnmarkedExtensionRepState(state)) {\n    formatDevErrorMessage(`LexicalBuilder: Can not apply a temporary mark from state id ${String(state.id)} (expected ${String(ExtensionRepStateIds.unmarked)} unmarked)`);\n  }\n  return Object.assign(state, {\n    id: ExtensionRepStateIds.temporary\n  });\n}\nfunction applyPermanentMark(state) {\n  if (!isExactlyTemporaryExtensionRepState(state)) {\n    formatDevErrorMessage(`LexicalBuilder: Can not apply a permanent mark from state id ${String(state.id)} (expected ${String(ExtensionRepStateIds.temporary)} temporary)`);\n  }\n  return Object.assign(state, {\n    id: ExtensionRepStateIds.permanent\n  });\n}\nfunction applyConfiguredState(state, config, registerState) {\n  return Object.assign(state, {\n    config,\n    id: ExtensionRepStateIds.configured,\n    registerState\n  });\n}\nfunction applyInitializedState(state, initResult, registerState) {\n  return Object.assign(state, {\n    id: ExtensionRepStateIds.initialized,\n    initResult,\n    registerState\n  });\n}\nfunction applyBuiltState(state, output, registerState) {\n  return Object.assign(state, {\n    id: ExtensionRepStateIds.built,\n    output,\n    registerState\n  });\n}\nfunction applyRegisteredState(state) {\n  return Object.assign(state, {\n    id: ExtensionRepStateIds.registered\n  });\n}\nfunction applyAfterRegistrationState(state) {\n  return Object.assign(state, {\n    id: ExtensionRepStateIds.afterRegistration\n  });\n}\nfunction rollbackToBuiltState(state) {\n  return Object.assign(state, {\n    id: ExtensionRepStateIds.built\n  });\n}\nconst emptySet = new Set();\n\n/**\n * @internal\n */\nclass ExtensionRep {\n  builder;\n  configs;\n  _dependency;\n  _peerNameSet;\n  extension;\n  state;\n  _signal;\n  constructor(builder, extension) {\n    this.builder = builder;\n    this.extension = extension;\n    this.configs = new Set();\n    this.state = {\n      id: ExtensionRepStateIds.unmarked\n    };\n  }\n  mergeConfigs() {\n    let config = this.extension.config || {};\n    const mergeConfig = this.extension.mergeConfig ? this.extension.mergeConfig.bind(this.extension) : shallowMergeConfig;\n    for (const cfg of this.configs) {\n      config = mergeConfig(config, cfg);\n    }\n    return config;\n  }\n  init(editorConfig) {\n    const initialState = this.state;\n    if (!isExactlyPermanentExtensionRepState(initialState)) {\n      formatDevErrorMessage(`ExtensionRep: Can not configure from state id ${String(initialState.id)}`);\n    }\n    const initState = {\n      getDependency: this.getInitDependency.bind(this),\n      getDirectDependentNames: this.getDirectDependentNames.bind(this),\n      getPeer: this.getInitPeer.bind(this),\n      getPeerNameSet: this.getPeerNameSet.bind(this)\n    };\n    const buildState = {\n      ...initState,\n      getDependency: this.getDependency.bind(this),\n      getInitResult: this.getInitResult.bind(this),\n      getPeer: this.getPeer.bind(this)\n    };\n    const state = applyConfiguredState(initialState, this.mergeConfigs(), initState);\n    this.state = state;\n    let initResult;\n    if (this.extension.init) {\n      initResult = this.extension.init(editorConfig, state.config, initState);\n    }\n    this.state = applyInitializedState(state, initResult, buildState);\n  }\n  build(editor) {\n    const state = this.state;\n    if (!(state.id === ExtensionRepStateIds.initialized)) {\n      formatDevErrorMessage(`ExtensionRep: register called in state id ${String(state.id)} (expected ${String(ExtensionRepStateIds.built)} initialized)`);\n    }\n    let output;\n    if (this.extension.build) {\n      output = this.extension.build(editor, state.config, state.registerState);\n    }\n    const registerState = {\n      ...state.registerState,\n      getOutput: () => output,\n      getSignal: this.getSignal.bind(this)\n    };\n    this.state = applyBuiltState(state, output, registerState);\n  }\n  register(editor, signal) {\n    this._signal = signal;\n    const state = this.state;\n    if (!(state.id === ExtensionRepStateIds.built)) {\n      formatDevErrorMessage(`ExtensionRep: register called in state id ${String(state.id)} (expected ${String(ExtensionRepStateIds.built)} built)`);\n    }\n    const cleanup = this.extension.register && this.extension.register(editor, state.config, state.registerState);\n    this.state = applyRegisteredState(state);\n    return () => {\n      const afterRegistrationState = this.state;\n      if (!(afterRegistrationState.id === ExtensionRepStateIds.afterRegistration)) {\n        formatDevErrorMessage(`ExtensionRep: rollbackToBuiltState called in state id ${String(state.id)} (expected ${String(ExtensionRepStateIds.afterRegistration)} afterRegistration)`);\n      }\n      this.state = rollbackToBuiltState(afterRegistrationState);\n      if (cleanup) {\n        cleanup();\n      }\n    };\n  }\n  afterRegistration(editor) {\n    const state = this.state;\n    if (!(state.id === ExtensionRepStateIds.registered)) {\n      formatDevErrorMessage(`ExtensionRep: afterRegistration called in state id ${String(state.id)} (expected ${String(ExtensionRepStateIds.registered)} registered)`);\n    }\n    let rval;\n    if (this.extension.afterRegistration) {\n      rval = this.extension.afterRegistration(editor, state.config, state.registerState);\n    }\n    this.state = applyAfterRegistrationState(state);\n    return rval;\n  }\n  getSignal() {\n    if (!(this._signal !== undefined)) {\n      formatDevErrorMessage(`ExtensionRep.getSignal() called before register`);\n    }\n    return this._signal;\n  }\n  getInitResult() {\n    if (!(this.extension.init !== undefined)) {\n      formatDevErrorMessage(`ExtensionRep: getInitResult() called for Extension ${this.extension.name} that does not define init`);\n    }\n    const state = this.state;\n    if (!isInitializedExtensionRepState(state)) {\n      formatDevErrorMessage(`ExtensionRep: getInitResult() called for ExtensionRep in state id ${String(state.id)} < ${String(ExtensionRepStateIds.initialized)} (initialized)`);\n    }\n    return state.initResult;\n  }\n  getInitPeer(name) {\n    const rep = this.builder.extensionNameMap.get(name);\n    return rep ? rep.getExtensionInitDependency() : undefined;\n  }\n  getExtensionInitDependency() {\n    const state = this.state;\n    if (!isConfiguredExtensionRepState(state)) {\n      formatDevErrorMessage(`ExtensionRep: getExtensionInitDependency called in state id ${String(state.id)} (expected >= ${String(ExtensionRepStateIds.configured)} configured)`);\n    }\n    return {\n      config: state.config\n    };\n  }\n  getPeer(name) {\n    const rep = this.builder.extensionNameMap.get(name);\n    return rep ? rep.getExtensionDependency() : undefined;\n  }\n  getInitDependency(dep) {\n    const rep = this.builder.getExtensionRep(dep);\n    if (!(rep !== undefined)) {\n      formatDevErrorMessage(`LexicalExtensionBuilder: Extension ${this.extension.name} missing dependency extension ${dep.name} to be in registry`);\n    }\n    return rep.getExtensionInitDependency();\n  }\n  getDependency(dep) {\n    const rep = this.builder.getExtensionRep(dep);\n    if (!(rep !== undefined)) {\n      formatDevErrorMessage(`LexicalExtensionBuilder: Extension ${this.extension.name} missing dependency extension ${dep.name} to be in registry`);\n    }\n    return rep.getExtensionDependency();\n  }\n  getState() {\n    const state = this.state;\n    if (!isAfterRegistrationState(state)) {\n      formatDevErrorMessage(`ExtensionRep getState called in state id ${String(state.id)} (expected ${String(ExtensionRepStateIds.afterRegistration)} afterRegistration)`);\n    }\n    return state;\n  }\n  getDirectDependentNames() {\n    return this.builder.incomingEdges.get(this.extension.name) || emptySet;\n  }\n  getPeerNameSet() {\n    let s = this._peerNameSet;\n    if (!s) {\n      s = new Set((this.extension.peerDependencies || []).map(([name]) => name));\n      this._peerNameSet = s;\n    }\n    return s;\n  }\n  getExtensionDependency() {\n    if (!this._dependency) {\n      const state = this.state;\n      if (!isBuiltExtensionRepState(state)) {\n        formatDevErrorMessage(`Extension ${this.extension.name} used as a dependency before build`);\n      }\n      this._dependency = {\n        config: state.config,\n        init: state.initResult,\n        output: state.output\n      };\n    }\n    return this._dependency;\n  }\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst HISTORY_MERGE_OPTIONS = {\n  tag: HISTORY_MERGE_TAG\n};\nfunction $defaultInitializer() {\n  const root = $getRoot();\n  if (root.isEmpty()) {\n    root.append($createParagraphNode());\n  }\n}\n/**\n * An extension to set the initial state of the editor from\n * a function or serialized JSON EditorState. This is\n * implicitly included with all editors built with\n * Lexical Extension. This happens in the `afterRegistration`\n * phase so your initial state may depend on registered commands,\n * but you should not call `editor.setRootElement` earlier than\n * this phase to avoid rendering an empty editor first.\n */\nconst InitialStateExtension = defineExtension({\n  config: safeCast({\n    setOptions: HISTORY_MERGE_OPTIONS,\n    updateOptions: HISTORY_MERGE_OPTIONS\n  }),\n  init({\n    $initialEditorState = $defaultInitializer\n  }) {\n    return {\n      $initialEditorState,\n      initialized: false\n    };\n  },\n  // eslint-disable-next-line sort-keys-fix/sort-keys-fix -- typescript inference is order dependent here for some reason\n  afterRegistration(editor, {\n    updateOptions,\n    setOptions\n  }, state) {\n    const initResult = state.getInitResult();\n    if (!initResult.initialized) {\n      initResult.initialized = true;\n      const {\n        $initialEditorState\n      } = initResult;\n      if ($isEditorState($initialEditorState)) {\n        editor.setEditorState($initialEditorState, setOptions);\n      } else if (typeof $initialEditorState === 'function') {\n        editor.update(() => {\n          $initialEditorState(editor);\n        }, updateOptions);\n      } else if ($initialEditorState && (typeof $initialEditorState === 'string' || typeof $initialEditorState === 'object')) {\n        const parsedEditorState = editor.parseEditorState($initialEditorState);\n        editor.setEditorState(parsedEditorState, setOptions);\n      }\n    }\n    return () => {};\n  },\n  name: '@lexical/extension/InitialState',\n  // These are automatically added by createEditor, we add them here so they are\n  // visible during extensionRep.init so extensions can see all known types before the\n  // editor is created.\n  // (excluding ArtificialNode__DO_NOT_USE because it isn't really public API\n  // and shouldn't change anything)\n  nodes: [RootNode, TextNode, LineBreakNode, TabNode, ParagraphNode]\n});\n\n/** @internal Use a well-known symbol for dev tools purposes */\nconst builderSymbol = Symbol.for('@lexical/extension/LexicalBuilder');\n/**\n * Build a LexicalEditor by combining together one or more extensions, optionally\n * overriding some of their configuration.\n *\n * @param extensions - Extension arguments (extensions or extensions with config overrides)\n * @returns An editor handle\n *\n * @example\n * A single root extension with multiple dependencies\n *\n * ```ts\n * const editor = buildEditorFromExtensions(\n *   defineExtension({\n *     name: \"[root]\",\n *     dependencies: [\n *       RichTextExtension,\n *       configExtension(EmojiExtension, { emojiBaseUrl: \"/assets/emoji\" }),\n *     ],\n *     register: (editor: LexicalEditor) => {\n *       console.log(\"Editor Created\");\n *       return () => console.log(\"Editor Disposed\");\n *     },\n *   }),\n * );\n * ```\n *\n * @example\n * A very similar minimal configuration without the register hook\n *\n * ```ts\n * const editor = buildEditorFromExtensions(\n *   RichTextExtension,\n *   configExtension(EmojiExtension, { emojiBaseUrl: \"/assets/emoji\" }),\n * );\n * ```\n */\nfunction buildEditorFromExtensions(...extensions) {\n  return LexicalBuilder.fromExtensions(extensions).buildEditor();\n}\n\n/** @internal */\nfunction noop() {\n  /*empty*/\n}\n\n/** Throw the given Error */\nfunction defaultOnError(err) {\n  throw err;\n}\n/** @internal */\nfunction maybeWithBuilder(editor) {\n  return editor;\n}\nfunction normalizeExtensionArgument(arg) {\n  return Array.isArray(arg) ? arg : [arg];\n}\nconst PACKAGE_VERSION = \"0.44.0+dev.esm\";\n\n/** @internal */\nclass LexicalBuilder {\n  roots;\n  extensionNameMap;\n  outgoingConfigEdges;\n  incomingEdges;\n  conflicts;\n  _sortedExtensionReps;\n  PACKAGE_VERSION;\n  constructor(roots) {\n    this.outgoingConfigEdges = new Map();\n    this.incomingEdges = new Map();\n    this.extensionNameMap = new Map();\n    this.conflicts = new Map();\n    this.PACKAGE_VERSION = PACKAGE_VERSION;\n    this.roots = roots;\n    for (const extension of roots) {\n      this.addExtension(extension);\n    }\n  }\n  static fromExtensions(extensions) {\n    const roots = [normalizeExtensionArgument(InitialStateExtension)];\n    for (const extension of extensions) {\n      roots.push(normalizeExtensionArgument(extension));\n    }\n    return new LexicalBuilder(roots);\n  }\n  static maybeFromEditor(editor) {\n    const builder = maybeWithBuilder(editor)[builderSymbol];\n    if (builder) {\n      // The dev tools variant of this will relax some of these invariants\n      if (!(builder.PACKAGE_VERSION === PACKAGE_VERSION)) {\n        formatDevErrorMessage(`LexicalBuilder.fromEditor: The given editor was created with LexicalBuilder ${builder.PACKAGE_VERSION} but this version is ${PACKAGE_VERSION}. A project should have exactly one copy of LexicalBuilder`);\n      }\n      if (!(builder instanceof LexicalBuilder)) {\n        formatDevErrorMessage(`LexicalBuilder.fromEditor: There are multiple copies of the same version of LexicalBuilder in your project, and this editor was created with another one. Your project, or one of its dependencies, has its package.json and/or bundler configured incorrectly.`);\n      }\n    }\n    return builder;\n  }\n\n  /** Look up the editor that was created by this LexicalBuilder or throw */\n  static fromEditor(editor) {\n    const builder = LexicalBuilder.maybeFromEditor(editor);\n    if (!(builder !== undefined)) {\n      formatDevErrorMessage(`LexicalBuilder.fromEditor: The given editor was not created with LexicalBuilder`);\n    }\n    return builder;\n  }\n  constructEditor() {\n    const {\n      $initialEditorState: _$initialEditorState,\n      onError,\n      ...editorConfig\n    } = this.buildCreateEditorArgs();\n    const editor = Object.assign(createEditor({\n      ...editorConfig,\n      ...(onError ? {\n        onError: err => {\n          onError(err, editor);\n        }\n      } : {})\n    }), {\n      [builderSymbol]: this\n    });\n    for (const extensionRep of this.sortedExtensionReps()) {\n      extensionRep.build(editor);\n    }\n    return editor;\n  }\n  buildEditor() {\n    let disposeOnce = noop;\n    function dispose() {\n      try {\n        disposeOnce();\n      } finally {\n        disposeOnce = noop;\n      }\n    }\n    const editor = Object.assign(this.constructEditor(), {\n      dispose,\n      [Symbol.dispose]: dispose\n    });\n    disposeOnce = mergeRegister(this.registerEditor(editor), () => editor.setRootElement(null));\n    return editor;\n  }\n  hasExtensionByName(name) {\n    return this.extensionNameMap.has(name);\n  }\n  getExtensionRep(extension) {\n    const rep = this.extensionNameMap.get(extension.name);\n    if (rep) {\n      if (!(rep.extension === extension)) {\n        formatDevErrorMessage(`LexicalBuilder: A registered extension with name ${extension.name} exists but does not match the given extension`);\n      }\n      return rep;\n    }\n  }\n  addEdge(fromExtensionName, toExtensionName, configs) {\n    const outgoing = this.outgoingConfigEdges.get(fromExtensionName);\n    if (outgoing) {\n      outgoing.set(toExtensionName, configs);\n    } else {\n      this.outgoingConfigEdges.set(fromExtensionName, new Map([[toExtensionName, configs]]));\n    }\n    const incoming = this.incomingEdges.get(toExtensionName);\n    if (incoming) {\n      incoming.add(fromExtensionName);\n    } else {\n      this.incomingEdges.set(toExtensionName, new Set([fromExtensionName]));\n    }\n  }\n  addExtension(arg) {\n    if (!(this._sortedExtensionReps === undefined)) {\n      formatDevErrorMessage(`LexicalBuilder: addExtension called after finalization`);\n    }\n    const normalized = normalizeExtensionArgument(arg);\n    const [extension] = normalized;\n    if (!(typeof extension.name === 'string')) {\n      formatDevErrorMessage(`LexicalBuilder: extension name must be string, not ${typeof extension.name}`);\n    }\n    let extensionRep = this.extensionNameMap.get(extension.name);\n    if (!(extensionRep === undefined || extensionRep.extension === extension)) {\n      formatDevErrorMessage(`LexicalBuilder: Multiple extensions registered with name ${extension.name}, names must be unique`);\n    }\n    if (!extensionRep) {\n      extensionRep = new ExtensionRep(this, extension);\n      this.extensionNameMap.set(extension.name, extensionRep);\n      const hasConflict = this.conflicts.get(extension.name);\n      if (typeof hasConflict === 'string') {\n        {\n          formatDevErrorMessage(`LexicalBuilder: extension ${extension.name} conflicts with ${hasConflict}`);\n        }\n      }\n      for (const name of extension.conflictsWith || []) {\n        if (!!this.extensionNameMap.has(name)) {\n          formatDevErrorMessage(`LexicalBuilder: extension ${extension.name} conflicts with ${name}`);\n        }\n        this.conflicts.set(name, extension.name);\n      }\n      for (const dep of extension.dependencies || []) {\n        const normDep = normalizeExtensionArgument(dep);\n        this.addEdge(extension.name, normDep[0].name, normDep.slice(1));\n        this.addExtension(normDep);\n      }\n      for (const [depName, config] of extension.peerDependencies || []) {\n        this.addEdge(extension.name, depName, config ? [config] : []);\n      }\n    }\n  }\n  sortedExtensionReps() {\n    if (this._sortedExtensionReps) {\n      return this._sortedExtensionReps;\n    }\n    // depth-first search based topological DAG sort\n    // https://en.wikipedia.org/wiki/Topological_sorting\n    const sortedExtensionReps = [];\n    const visit = (rep, fromExtensionName) => {\n      let mark = rep.state;\n      if (isExactlyPermanentExtensionRepState(mark)) {\n        return;\n      }\n      const extensionName = rep.extension.name;\n      if (!isExactlyUnmarkedExtensionRepState(mark)) {\n        formatDevErrorMessage(`LexicalBuilder: Circular dependency detected for Extension ${extensionName} from ${fromExtensionName || '[unknown]'}`);\n      }\n      mark = applyTemporaryMark(mark);\n      rep.state = mark;\n      const outgoingConfigEdges = this.outgoingConfigEdges.get(extensionName);\n      if (outgoingConfigEdges) {\n        for (const toExtensionName of outgoingConfigEdges.keys()) {\n          const toRep = this.extensionNameMap.get(toExtensionName);\n          // may be undefined for an optional peer dependency\n          if (toRep) {\n            visit(toRep, extensionName);\n          }\n        }\n      }\n      mark = applyPermanentMark(mark);\n      rep.state = mark;\n      sortedExtensionReps.push(rep);\n    };\n    for (const rep of this.extensionNameMap.values()) {\n      if (isExactlyUnmarkedExtensionRepState(rep.state)) {\n        visit(rep);\n      }\n    }\n    for (const rep of sortedExtensionReps) {\n      for (const [toExtensionName, configs] of this.outgoingConfigEdges.get(rep.extension.name) || []) {\n        if (configs.length > 0) {\n          const toRep = this.extensionNameMap.get(toExtensionName);\n          if (toRep) {\n            for (const config of configs) {\n              toRep.configs.add(config);\n            }\n          }\n        }\n      }\n    }\n    for (const [extension, ...configs] of this.roots) {\n      if (configs.length > 0) {\n        const toRep = this.extensionNameMap.get(extension.name);\n        if (!(toRep !== undefined)) {\n          formatDevErrorMessage(`LexicalBuilder: Expecting existing ExtensionRep for ${extension.name}`);\n        }\n        for (const config of configs) {\n          toRep.configs.add(config);\n        }\n      }\n    }\n    this._sortedExtensionReps = sortedExtensionReps;\n    return this._sortedExtensionReps;\n  }\n  registerEditor(editor) {\n    const extensionReps = this.sortedExtensionReps();\n    const controller = new AbortController();\n    const cleanups = [() => controller.abort()];\n    const signal = controller.signal;\n    for (const extensionRep of extensionReps) {\n      const cleanup = extensionRep.register(editor, signal);\n      if (cleanup) {\n        cleanups.push(cleanup);\n      }\n    }\n    for (const extensionRep of extensionReps) {\n      const cleanup = extensionRep.afterRegistration(editor);\n      if (cleanup) {\n        cleanups.push(cleanup);\n      }\n    }\n    return mergeRegister(...cleanups);\n  }\n  buildCreateEditorArgs() {\n    const config = {};\n    const nodes = new Set();\n    const replacedNodes = new Map();\n    const htmlExport = new Map();\n    const htmlImport = {};\n    const theme = {};\n    const extensionReps = this.sortedExtensionReps();\n    for (const extensionRep of extensionReps) {\n      const {\n        extension\n      } = extensionRep;\n      if (extension.onError !== undefined) {\n        config.onError = extension.onError;\n      }\n      if (extension.disableEvents !== undefined) {\n        config.disableEvents = extension.disableEvents;\n      }\n      if (extension.parentEditor !== undefined) {\n        config.parentEditor = extension.parentEditor;\n      }\n      if (extension.editable !== undefined) {\n        config.editable = extension.editable;\n      }\n      if (extension.namespace !== undefined) {\n        config.namespace = extension.namespace;\n      }\n      if (extension.$initialEditorState !== undefined) {\n        config.$initialEditorState = extension.$initialEditorState;\n      }\n      if (extension.nodes) {\n        for (const node of getNodeConfig(extension)) {\n          if (typeof node !== 'function') {\n            const conflictExtension = replacedNodes.get(node.replace);\n            if (conflictExtension) {\n              {\n                formatDevErrorMessage(`LexicalBuilder: Extension ${extension.name} can not register replacement for node ${node.replace.name} because ${conflictExtension.extension.name} already did`);\n              }\n            }\n            replacedNodes.set(node.replace, extensionRep);\n          }\n          nodes.add(node);\n        }\n      }\n      if (extension.html) {\n        if (extension.html.export) {\n          for (const [k, v] of extension.html.export.entries()) {\n            htmlExport.set(k, v);\n          }\n        }\n        if (extension.html.import) {\n          Object.assign(htmlImport, extension.html.import);\n        }\n      }\n      if (extension.theme) {\n        deepThemeMergeInPlace(theme, extension.theme);\n      }\n    }\n    if (Object.keys(theme).length > 0) {\n      config.theme = theme;\n    }\n    if (nodes.size) {\n      config.nodes = [...nodes];\n    }\n    const hasImport = Object.keys(htmlImport).length > 0;\n    const hasExport = htmlExport.size > 0;\n    if (hasImport || hasExport) {\n      config.html = {};\n      if (hasImport) {\n        config.html.import = htmlImport;\n      }\n      if (hasExport) {\n        config.html.export = htmlExport;\n      }\n    }\n    for (const extensionRep of extensionReps) {\n      extensionRep.init(config);\n    }\n    if (!config.onError) {\n      config.onError = defaultOnError;\n    }\n    return config;\n  }\n}\n\n/**\n * Get the finalized config and output of an Extension that was used to build the editor.\n *\n * This is useful in the implementation of a LexicalNode or in other\n * situations where you have an editor reference but it's not easy to\n * pass the config or {@link ExtensionRegisterState} around.\n *\n * It will throw if the Editor was not built using this Extension.\n *\n * @param editor - The editor that was built using extension\n * @param extension - The concrete reference to an Extension used to build this editor\n * @returns The config and output for that Extension\n */\nfunction getExtensionDependencyFromEditor(editor, extension) {\n  const builder = LexicalBuilder.fromEditor(editor);\n  const rep = builder.getExtensionRep(extension);\n  if (!(rep !== undefined)) {\n    formatDevErrorMessage(`getExtensionDependencyFromEditor: Extension ${extension.name} was not built when creating this editor`);\n  }\n  return rep.getExtensionDependency();\n}\n\n/**\n * Get the finalized config and output of an Extension that was used to build the\n * editor by name.\n *\n * This can be used from the implementation of a LexicalNode or in other\n * situation where you have an editor reference but it's not easy to pass the\n * config around. Use this version if you do not have a concrete reference to\n * the Extension for some reason (e.g. it is an optional peer dependency, or you\n * are avoiding a circular import).\n *\n * Both the explicit Extension type and the name are required.\n *\n *  @example\n * ```tsx\n * import type { HistoryExtension } from \"@lexical/history\";\n * getPeerDependencyFromEditor<typeof HistoryExtension>(editor, \"@lexical/history/History\");\n * ```\n\n * @param editor - The editor that may have been built using extension\n * @param extensionName - The name of the Extension\n * @returns The config and output of the Extension or undefined\n */\nfunction getPeerDependencyFromEditor(editor, extensionName) {\n  const builder = LexicalBuilder.maybeFromEditor(editor);\n  if (!builder) return undefined;\n  const peer = builder.extensionNameMap.get(extensionName);\n  return peer ? peer.getExtensionDependency() : undefined;\n}\n\n/**\n * Get the finalized config and output of an Extension that was used to build the\n * editor by name.\n *\n * This can be used from the implementation of a LexicalNode or in other\n * situation where you have an editor reference but it's not easy to pass the\n * config around. Use this version if you do not have a concrete reference to\n * the Extension for some reason (e.g. it is an optional peer dependency, or you\n * are avoiding a circular import).\n *\n * Both the explicit Extension type and the name are required.\n *\n *  @example\n * ```tsx\n * import type { EmojiExtension } from \"./EmojiExtension\";\n * export class EmojiNode extends TextNode {\n *   // other implementation details not included\n *   createDOM(\n *     config: EditorConfig,\n *     editor?: LexicalEditor | undefined\n *   ): HTMLElement {\n *     const dom = super.createDOM(config, editor);\n *     addClassNamesToElement(\n *       dom,\n *       getPeerDependencyFromEditorOrThrow<typeof EmojiExtension>(\n *         editor || $getEditor(),\n *         \"@lexical/playground/emoji\",\n *       ).config.emojiClass,\n *     );\n *     return dom;\n *   }\n * }\n * ```\n\n * @param editor - The editor that may have been built using extension\n * @param extensionName - The name of the Extension\n * @returns The config and output of the Extension\n */\nfunction getPeerDependencyFromEditorOrThrow(editor, extensionName) {\n  const dep = getPeerDependencyFromEditor(editor, extensionName);\n  if (!(dep !== undefined)) {\n    formatDevErrorMessage(`getPeerDependencyFromEditorOrThrow: Editor was not built with Extension ${extensionName}`);\n  }\n  return dep;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst EMPTY_SET = new Set();\n\n/**\n * An extension that provides a `watchNodeKey` output that\n * returns a signal for the selection state of a node.\n *\n * Typically used for tracking whether a DecoratorNode is\n * currently selected or not. A framework independent\n * alternative to {@link useLexicalNodeSelection}.\n */\nconst NodeSelectionExtension = defineExtension({\n  build(editor, config, state) {\n    const editorStateStore = state.getDependency(EditorStateExtension).output;\n    const watchedNodeStore = a({\n      watchedNodeKeys: new Map()\n    });\n    const selectedNodeKeys = watchedSignal(() => undefined, () => j(() => {\n      const prevSelectedNodeKeys = selectedNodeKeys.peek();\n      const {\n        watchedNodeKeys\n      } = watchedNodeStore.value;\n      let nextSelectedNodeKeys;\n      let didChange = false;\n      editorStateStore.value.read(() => {\n        const selection = $getSelection();\n        if (selection) {\n          for (const [key, listeners] of watchedNodeKeys.entries()) {\n            if (listeners.size === 0) {\n              // We intentionally mutate this without firing a signal, to\n              // avoid re-triggering this effect. There are no subscribers\n              // so nothing can observe whether key was in the set or not\n              watchedNodeKeys.delete(key);\n              continue;\n            }\n            const node = $getNodeByKey(key);\n            const isSelected = node && node.isSelected() || false;\n            didChange = didChange || isSelected !== (prevSelectedNodeKeys ? prevSelectedNodeKeys.has(key) : false);\n            if (isSelected) {\n              nextSelectedNodeKeys = nextSelectedNodeKeys || new Set();\n              nextSelectedNodeKeys.add(key);\n            }\n          }\n        }\n      });\n      if (!(!didChange && nextSelectedNodeKeys && prevSelectedNodeKeys && nextSelectedNodeKeys.size === prevSelectedNodeKeys.size)) {\n        selectedNodeKeys.value = nextSelectedNodeKeys;\n      }\n    }));\n    function watchNodeKey(key) {\n      const watcher = g(() => (selectedNodeKeys.value || EMPTY_SET).has(key));\n      const {\n        watchedNodeKeys\n      } = watchedNodeStore.peek();\n      let listeners = watchedNodeKeys.get(key);\n      const hadListener = listeners !== undefined;\n      listeners = listeners || new Set();\n      listeners.add(watcher);\n      if (!hadListener) {\n        watchedNodeKeys.set(key, listeners);\n        watchedNodeStore.value = {\n          watchedNodeKeys\n        };\n      }\n      return watcher;\n    }\n    return {\n      watchNodeKey\n    };\n  },\n  dependencies: [EditorStateExtension],\n  name: '@lexical/extension/NodeSelection'\n});\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst INSERT_HORIZONTAL_RULE_COMMAND = createCommand('INSERT_HORIZONTAL_RULE_COMMAND');\nclass HorizontalRuleNode extends DecoratorNode {\n  static getType() {\n    return 'horizontalrule';\n  }\n  static clone(node) {\n    return new HorizontalRuleNode(node.__key);\n  }\n  static importJSON(serializedNode) {\n    return $createHorizontalRuleNode().updateFromJSON(serializedNode);\n  }\n  static importDOM() {\n    return {\n      hr: () => ({\n        conversion: $convertHorizontalRuleElement,\n        priority: 0\n      })\n    };\n  }\n  exportDOM() {\n    return {\n      element: document.createElement('hr')\n    };\n  }\n  createDOM(config) {\n    const element = document.createElement('hr');\n    addClassNamesToElement(element, config.theme.hr);\n    return element;\n  }\n  getTextContent() {\n    return '\\n';\n  }\n  isInline() {\n    return false;\n  }\n  updateDOM() {\n    return false;\n  }\n}\nfunction $convertHorizontalRuleElement() {\n  return {\n    node: $createHorizontalRuleNode()\n  };\n}\nfunction $createHorizontalRuleNode() {\n  return $create(HorizontalRuleNode);\n}\nfunction $isHorizontalRuleNode(node) {\n  return node instanceof HorizontalRuleNode;\n}\nfunction $toggleNodeSelection(node, shiftKey = false) {\n  const selection = $getSelection();\n  const wasSelected = node.isSelected();\n  const key = node.getKey();\n  let nodeSelection;\n  if (shiftKey && $isNodeSelection(selection)) {\n    nodeSelection = selection;\n  } else {\n    nodeSelection = $createNodeSelection();\n    $setSelection(nodeSelection);\n  }\n  if (wasSelected) {\n    nodeSelection.delete(key);\n  } else {\n    nodeSelection.add(key);\n  }\n}\n\n/**\n * An extension for HorizontalRuleNode that provides an implementation that\n * works without any React dependency.\n */\nconst HorizontalRuleExtension = defineExtension({\n  dependencies: [EditorStateExtension, NodeSelectionExtension],\n  name: '@lexical/extension/HorizontalRule',\n  nodes: () => [HorizontalRuleNode],\n  register(editor, config, state) {\n    const {\n      watchNodeKey\n    } = state.getDependency(NodeSelectionExtension).output;\n    const nodeSelectionStore = a({\n      nodeSelections: new Map()\n    });\n    const isSelectedClassName = editor._config.theme.hrSelected ?? 'selected';\n    return mergeRegister(editor.registerCommand(INSERT_HORIZONTAL_RULE_COMMAND, type => {\n      const selection = $getSelection();\n      if (!$isRangeSelection(selection)) {\n        return false;\n      }\n      const focusNode = selection.focus.getNode();\n      if (focusNode !== null) {\n        const horizontalRuleNode = $createHorizontalRuleNode();\n        $insertNodeToNearestRoot(horizontalRuleNode);\n      }\n      return true;\n    }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(CLICK_COMMAND, event => {\n      if (isDOMNode(event.target)) {\n        const node = $getNodeFromDOMNode(event.target);\n        if ($isHorizontalRuleNode(node)) {\n          $toggleNodeSelection(node, event.shiftKey);\n          return true;\n        }\n      }\n      return false;\n    }, COMMAND_PRIORITY_LOW), editor.registerMutationListener(HorizontalRuleNode, (nodes, payload) => {\n      n(() => {\n        let didChange = false;\n        const {\n          nodeSelections\n        } = nodeSelectionStore.peek();\n        for (const [k, v] of nodes.entries()) {\n          if (v === 'destroyed') {\n            nodeSelections.delete(k);\n            didChange = true;\n          } else {\n            const prev = nodeSelections.get(k);\n            const dom = editor.getElementByKey(k);\n            if (prev) {\n              prev.domNode.value = dom;\n            } else {\n              didChange = true;\n              nodeSelections.set(k, {\n                domNode: a(dom),\n                selectedSignal: watchNodeKey(k)\n              });\n            }\n          }\n        }\n        if (didChange) {\n          nodeSelectionStore.value = {\n            nodeSelections\n          };\n        }\n      });\n    }), j(() => {\n      const effects = [];\n      for (const {\n        domNode,\n        selectedSignal\n      } of nodeSelectionStore.value.nodeSelections.values()) {\n        effects.push(j(() => {\n          const dom = domNode.value;\n          if (dom) {\n            const isSelected = selectedSignal.value;\n            if (isSelected) {\n              addClassNamesToElement(dom, isSelectedClassName);\n            } else {\n              removeClassNamesFromElement(dom, isSelectedClassName);\n            }\n          }\n        }));\n      }\n      return mergeRegister(...effects);\n    }));\n  }\n});\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction $defaultGetParentEditor() {\n  const editor = $getEditor();\n  LexicalBuilder.fromEditor(editor);\n  return editor;\n}\nconst NestedEditorExtension = defineExtension({\n  build: (editor, config) => namedSignals({\n    inheritEditableFromParent: config.inheritEditableFromParent\n  }),\n  config: safeCast({\n    $getParentEditor: $defaultGetParentEditor,\n    inheritEditableFromParent: false\n  }),\n  init: (editorConfig, config, state) => {\n    const parentEditor = config.$getParentEditor();\n    editorConfig.parentEditor = parentEditor;\n    editorConfig.theme = editorConfig.theme || parentEditor._config.theme;\n  },\n  name: '@lexical/extension/NestedEditor',\n  register: (editor, config, state) => j(() => {\n    const parentEditor = editor._parentEditor;\n    if (parentEditor) {\n      if (state.getOutput().inheritEditableFromParent.value) {\n        editor.setEditable(parentEditor.isEditable());\n        return parentEditor.registerEditableListener(editor.setEditable.bind(editor));\n      }\n    }\n  })\n});\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * An extension that highlights selected content in the Lexical editor\n * even when the editor is not currently focused.\n */\nconst SelectionAlwaysOnDisplayExtension = defineExtension({\n  build: (editor, config, state) => namedSignals(config),\n  config: safeCast({\n    disabled: false,\n    onReposition: undefined\n  }),\n  name: '@lexical/utils/SelectionAlwaysOnDisplay',\n  register: (editor, config, state) => {\n    const stores = state.getOutput();\n    return j(() => {\n      if (!stores.disabled.value) {\n        return selectionAlwaysOnDisplay(editor, stores.onReposition.value);\n      }\n    });\n  }\n});\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction $indentOverTab(selection) {\n  // const handled = new Set();\n  const nodes = selection.getNodes();\n  const canIndentBlockNodes = nodes.filter(node => $isBlockElementNode(node) && node.canIndent());\n  // 1. If selection spans across canIndent block nodes: indent\n  if (canIndentBlockNodes.length > 0) {\n    return true;\n  }\n  // 2. If first (anchor/focus) is at block start: indent\n  const anchor = selection.anchor;\n  const focus = selection.focus;\n  const first = focus.isBefore(anchor) ? focus : anchor;\n  const firstNode = first.getNode();\n  const firstBlock = $getNearestBlockElementAncestorOrThrow(firstNode);\n  if (firstBlock.canIndent()) {\n    const firstBlockKey = firstBlock.getKey();\n    let selectionAtStart = $createRangeSelection();\n    selectionAtStart.anchor.set(firstBlockKey, 0, 'element');\n    selectionAtStart.focus.set(firstBlockKey, 0, 'element');\n    selectionAtStart = $normalizeSelection__EXPERIMENTAL(selectionAtStart);\n    if (selectionAtStart.anchor.is(first)) {\n      return true;\n    }\n  }\n  // 3. Else: tab\n  return false;\n}\nfunction $defaultCanIndent(node) {\n  return node.canBeEmpty();\n}\nfunction registerTabIndentation(editor, maxIndent, $canIndent = $defaultCanIndent) {\n  return mergeRegister(editor.registerCommand(KEY_TAB_COMMAND, event => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    event.preventDefault();\n    const command = $indentOverTab(selection) ? event.shiftKey ? OUTDENT_CONTENT_COMMAND : INDENT_CONTENT_COMMAND : INSERT_TAB_COMMAND;\n    return editor.dispatchCommand(command, undefined);\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(INDENT_CONTENT_COMMAND, () => {\n    const currentMaxIndent = typeof maxIndent === 'number' ? maxIndent : maxIndent ? maxIndent.peek() : null;\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    const $currentCanIndent = typeof $canIndent === 'function' ? $canIndent : $canIndent.peek();\n    return $handleIndentAndOutdent(block => {\n      if ($currentCanIndent(block)) {\n        const newIndent = block.getIndent() + 1;\n        if (!currentMaxIndent || newIndent < currentMaxIndent) {\n          block.setIndent(newIndent);\n        }\n      }\n    });\n  }, COMMAND_PRIORITY_CRITICAL));\n}\n/**\n * This extension adds the ability to indent content using the tab key. Generally, we don't\n * recommend using this plugin as it could negatively affect accessibility for keyboard\n * users, causing focus to become trapped within the editor.\n */\nconst TabIndentationExtension = defineExtension({\n  build(editor, config, state) {\n    return namedSignals(config);\n  },\n  config: safeCast({\n    $canIndent: $defaultCanIndent,\n    disabled: false,\n    maxIndent: null\n  }),\n  name: '@lexical/extension/TabIndentation',\n  register(editor, config, state) {\n    const {\n      disabled,\n      maxIndent,\n      $canIndent\n    } = state.getOutput();\n    return j(() => {\n      if (!disabled.value) {\n        return registerTabIndentation(editor, maxIndent, $canIndent);\n      }\n    });\n  }\n});\n\nexport { $createHorizontalRuleNode, $isDecoratorTextNode, $isHorizontalRuleNode, AutoFocusExtension, ClearEditorExtension, DecoratorTextExtension, DecoratorTextNode, EditorStateExtension, HorizontalRuleExtension, HorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND, InitialStateExtension, LexicalBuilder, NestedEditorExtension, NodeSelectionExtension, SelectionAlwaysOnDisplayExtension, TabIndentationExtension, applyFormatFromStyle, applyFormatToDom, n as batch, buildEditorFromExtensions, g as computed, j as effect, getExtensionDependencyFromEditor, getKnownTypesAndNodes, getPeerDependencyFromEditor, getPeerDependencyFromEditorOrThrow, namedSignals, registerClearEditor, registerTabIndentation, a as signal, h as untracked, watchedSignal };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalExtension.dev.mjs';\nimport * as modProd from './LexicalExtension.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const $createHorizontalRuleNode = mod.$createHorizontalRuleNode;\nexport const $isDecoratorTextNode = mod.$isDecoratorTextNode;\nexport const $isHorizontalRuleNode = mod.$isHorizontalRuleNode;\nexport const AutoFocusExtension = mod.AutoFocusExtension;\nexport const ClearEditorExtension = mod.ClearEditorExtension;\nexport const DecoratorTextExtension = mod.DecoratorTextExtension;\nexport const DecoratorTextNode = mod.DecoratorTextNode;\nexport const EditorStateExtension = mod.EditorStateExtension;\nexport const HorizontalRuleExtension = mod.HorizontalRuleExtension;\nexport const HorizontalRuleNode = mod.HorizontalRuleNode;\nexport const INSERT_HORIZONTAL_RULE_COMMAND = mod.INSERT_HORIZONTAL_RULE_COMMAND;\nexport const InitialStateExtension = mod.InitialStateExtension;\nexport const LexicalBuilder = mod.LexicalBuilder;\nexport const NestedEditorExtension = mod.NestedEditorExtension;\nexport const NodeSelectionExtension = mod.NodeSelectionExtension;\nexport const SelectionAlwaysOnDisplayExtension = mod.SelectionAlwaysOnDisplayExtension;\nexport const TabIndentationExtension = mod.TabIndentationExtension;\nexport const applyFormatFromStyle = mod.applyFormatFromStyle;\nexport const applyFormatToDom = mod.applyFormatToDom;\nexport const batch = mod.batch;\nexport const buildEditorFromExtensions = mod.buildEditorFromExtensions;\nexport const computed = mod.computed;\nexport const configExtension = mod.configExtension;\nexport const declarePeerDependency = mod.declarePeerDependency;\nexport const defineExtension = mod.defineExtension;\nexport const effect = mod.effect;\nexport const getExtensionDependencyFromEditor = mod.getExtensionDependencyFromEditor;\nexport const getKnownTypesAndNodes = mod.getKnownTypesAndNodes;\nexport const getPeerDependencyFromEditor = mod.getPeerDependencyFromEditor;\nexport const getPeerDependencyFromEditorOrThrow = mod.getPeerDependencyFromEditorOrThrow;\nexport const namedSignals = mod.namedSignals;\nexport const registerClearEditor = mod.registerClearEditor;\nexport const registerTabIndentation = mod.registerTabIndentation;\nexport const safeCast = mod.safeCast;\nexport const shallowMergeConfig = mod.shallowMergeConfig;\nexport const signal = mod.signal;\nexport const untracked = mod.untracked;\nexport const watchedSignal = mod.watchedSignal;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalLink.dev.mjs';\nimport * as modProd from './LexicalLink.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const $createAutoLinkNode = mod.$createAutoLinkNode;\nexport const $createLinkNode = mod.$createLinkNode;\nexport const $isAutoLinkNode = mod.$isAutoLinkNode;\nexport const $isLinkNode = mod.$isLinkNode;\nexport const $toggleLink = mod.$toggleLink;\nexport const AutoLinkExtension = mod.AutoLinkExtension;\nexport const AutoLinkNode = mod.AutoLinkNode;\nexport const ClickableLinkExtension = mod.ClickableLinkExtension;\nexport const LinkExtension = mod.LinkExtension;\nexport const LinkNode = mod.LinkNode;\nexport const TOGGLE_LINK_COMMAND = mod.TOGGLE_LINK_COMMAND;\nexport const createLinkMatcherWithRegExp = mod.createLinkMatcherWithRegExp;\nexport const formatUrl = mod.formatUrl;\nexport const registerAutoLink = mod.registerAutoLink;\nexport const registerClickableLink = mod.registerClickableLink;\nexport const registerLink = mod.registerLink;\nexport const toggleLink = mod.toggleLink;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { effect, namedSignals } from '@lexical/extension';\nimport { $getNearestNodeOfType, $insertNodeToNearestRootAtCaret, removeClassNamesFromElement, addClassNamesToElement, isHTMLElement as isHTMLElement$1, mergeRegister, $findMatchingParent, calculateZoomLevel } from '@lexical/utils';\nimport { $copyNode, $getSelection, $isRangeSelection, $isRootOrShadowRoot, $createParagraphNode, $isElementNode, $isLeafNode, $setPointFromCaret, $normalizeCaret, $getChildCaret, $isTextNode, ElementNode, buildImportMap, $getSiblingCaret, $rewindSiblingCaret, setDOMStyleFromCSS, isHTMLElement, $isParagraphNode, normalizeClassNames, getStyleObjectFromCSS, $applyNodeReplacement, $createTextNode, COMMAND_PRIORITY_LOW, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND, KEY_ESCAPE_COMMAND, KEY_SPACE_COMMAND, $getNearestNodeFromDOMNode, KEY_ARROW_LEFT_COMMAND, createCommand, getNearestEditorFromDOMNode, $addUpdateTag, SKIP_SELECTION_FOCUS_TAG, SKIP_DOM_SELECTION_TAG, defineExtension, safeCast, $getNodeByKey, INSERT_PARAGRAPH_COMMAND, TextNode } from 'lexical';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n  throw new Error(message);\n}\n\n/**\n * Checks the depth of listNode from the root node.\n * @param listNode - The ListNode to be checked.\n * @returns The depth of the ListNode.\n */\nfunction $getListDepth(listNode) {\n  let depth = 1;\n  let parent = listNode.getParent();\n  while (parent != null) {\n    if ($isListItemNode(parent)) {\n      const parentList = parent.getParent();\n      if ($isListNode(parentList)) {\n        depth++;\n        parent = parentList.getParent();\n        continue;\n      }\n      {\n        formatDevErrorMessage(`A ListItemNode must have a ListNode for a parent.`);\n      }\n    }\n    return depth;\n  }\n  return depth;\n}\n\n/**\n * Finds the nearest ancestral ListNode and returns it, throws an invariant if listItem is not a ListItemNode.\n * @param listItem - The node to be checked.\n * @returns The ListNode found.\n */\nfunction $getTopListNode(listItem) {\n  let list = listItem.getParent();\n  if (!$isListNode(list)) {\n    {\n      formatDevErrorMessage(`A ListItemNode must have a ListNode for a parent.`);\n    }\n  }\n  let parent = list;\n  while (parent !== null) {\n    parent = parent.getParent();\n    if ($isListNode(parent)) {\n      list = parent;\n    }\n  }\n  return list;\n}\n\n/**\n * A recursive Depth-First Search (Postorder Traversal) that finds all of a node's children\n * that are of type ListItemNode and returns them in an array.\n * @param node - The ListNode to start the search.\n * @returns An array containing all nodes of type ListItemNode found.\n */\n// This should probably be $getAllChildrenOfType\nfunction $getAllListItems(node) {\n  let listItemNodes = [];\n  const listChildren = node.getChildren().filter($isListItemNode);\n  for (let i = 0; i < listChildren.length; i++) {\n    const listItemNode = listChildren[i];\n    const firstChild = listItemNode.getFirstChild();\n    if ($isListNode(firstChild)) {\n      listItemNodes = listItemNodes.concat($getAllListItems(firstChild));\n    } else {\n      listItemNodes.push(listItemNode);\n    }\n  }\n  return listItemNodes;\n}\n\n/**\n * Checks to see if the passed node is a ListItemNode and has a ListNode as a child.\n * @param node - The node to be checked.\n * @returns true if the node is a ListItemNode and has a ListNode child, false otherwise.\n */\nfunction isNestedListNode(node) {\n  return $isListItemNode(node) && $isListNode(node.getFirstChild());\n}\n\n/**\n * Takes a deeply nested ListNode or ListItemNode and traverses up the branch to delete the first\n * ancestral ListNode (which could be the root ListNode) or ListItemNode with siblings, essentially\n * bringing the deeply nested node up the branch once. Would remove sublist if it has siblings.\n * Should not break ListItem -> List -> ListItem chain as empty List/ItemNodes should be removed on .remove().\n * @param sublist - The nested ListNode or ListItemNode to be brought up the branch.\n */\nfunction $removeHighestEmptyListParent(sublist) {\n  // Nodes may be repeatedly indented, to create deeply nested lists that each\n  // contain just one bullet.\n  // Our goal is to remove these (empty) deeply nested lists. The easiest\n  // way to do that is crawl back up the tree until we find a node that has siblings\n  // (e.g. is actually part of the list contents) and delete that, or delete\n  // the root of the list (if no list nodes have siblings.)\n  let emptyListPtr = sublist;\n  while (emptyListPtr.getNextSibling() == null && emptyListPtr.getPreviousSibling() == null) {\n    const parent = emptyListPtr.getParent();\n    if (parent == null || !($isListItemNode(parent) || $isListNode(parent))) {\n      break;\n    }\n    emptyListPtr = parent;\n  }\n  emptyListPtr.remove();\n}\n\n/**\n * Wraps a node into a ListItemNode.\n * @param node - The node to be wrapped into a ListItemNode\n * @returns The ListItemNode which the passed node is wrapped in.\n */\nfunction $wrapInListItem(node) {\n  const listItemWrapper = $createListItemNode();\n  return listItemWrapper.append(node);\n}\n\n/**\n * Calculates the start value for a new list created by splitting an existing list.\n */\nfunction $getNewListStart(list, listItem) {\n  return list.getStart() + listItem.getIndexWithinParent();\n}\n\nfunction $isSelectingEmptyListItem(anchorNode, nodes) {\n  return $isListItemNode(anchorNode) && (nodes.length === 0 || nodes.length === 1 && anchorNode.is(nodes[0]) && anchorNode.getChildrenSize() === 0);\n}\n\n/**\n * Inserts a new ListNode. If the selection's anchor node is an empty ListItemNode and is a child of\n * the root/shadow root, it will replace the ListItemNode with a ListNode and the old ListItemNode.\n * Otherwise it will replace its parent with a new ListNode and re-insert the ListItemNode and any previous children.\n * If the selection's anchor node is not an empty ListItemNode, it will add a new ListNode or merge an existing ListNode,\n * unless the the node is a leaf node, in which case it will attempt to find a ListNode up the branch and replace it with\n * a new ListNode, or create a new ListNode at the nearest root/shadow root.\n * @param listType - The type of list, \"number\" | \"bullet\" | \"check\".\n */\nfunction $insertList(listType) {\n  const selection = $getSelection();\n  if (selection !== null) {\n    let nodes = selection.getNodes();\n    if ($isRangeSelection(selection)) {\n      const anchorAndFocus = selection.getStartEndPoints();\n      if (!(anchorAndFocus !== null)) {\n        formatDevErrorMessage(`insertList: anchor should be defined`);\n      }\n      const [anchor] = anchorAndFocus;\n      const anchorNode = anchor.getNode();\n      const anchorNodeParent = anchorNode.getParent();\n      if ($isRootOrShadowRoot(anchorNode)) {\n        const firstChild = anchorNode.getFirstChild();\n        if (firstChild) {\n          nodes = firstChild.selectStart().getNodes();\n        } else {\n          const paragraph = $createParagraphNode();\n          anchorNode.append(paragraph);\n          nodes = paragraph.select().getNodes();\n        }\n      } else if ($isSelectingEmptyListItem(anchorNode, nodes)) {\n        const list = $createListNode(listType);\n        if ($isRootOrShadowRoot(anchorNodeParent)) {\n          anchorNode.replace(list);\n          const listItem = $createListItemNode();\n          if ($isElementNode(anchorNode)) {\n            listItem.setFormat(anchorNode.getFormatType());\n            listItem.setIndent(anchorNode.getIndent());\n          }\n          list.append(listItem);\n        } else if ($isListItemNode(anchorNode)) {\n          const parent = anchorNode.getParentOrThrow();\n          append(list, parent.getChildren());\n          parent.replace(list);\n        }\n        return;\n      }\n    }\n    const handled = new Set();\n    for (let i = 0; i < nodes.length; i++) {\n      const node = nodes[i];\n      if ($isElementNode(node) && node.isEmpty() && !$isListItemNode(node) && !handled.has(node.getKey())) {\n        $createListOrMerge(node, listType);\n        continue;\n      }\n      let parent = $isLeafNode(node) ? node.getParent() : $isListItemNode(node) && node.isEmpty() ? node : null;\n      while (parent != null) {\n        const parentKey = parent.getKey();\n        if ($isListNode(parent)) {\n          if (!handled.has(parentKey)) {\n            const newListNode = $createListNode(listType);\n            append(newListNode, parent.getChildren());\n            parent.replace(newListNode);\n            handled.add(parentKey);\n          }\n          break;\n        } else {\n          const nextParent = parent.getParent();\n          if ($isRootOrShadowRoot(nextParent) && !handled.has(parentKey)) {\n            handled.add(parentKey);\n            $createListOrMerge(parent, listType);\n            break;\n          }\n          parent = nextParent;\n        }\n      }\n    }\n  }\n}\nfunction append(node, nodesToAppend) {\n  node.splice(node.getChildrenSize(), 0, nodesToAppend);\n}\nfunction $createListOrMerge(node, listType) {\n  if ($isListNode(node)) {\n    return node;\n  }\n  const previousSibling = node.getPreviousSibling();\n  const nextSibling = node.getNextSibling();\n  const listItem = $createListItemNode();\n  append(listItem, node.getChildren());\n  let targetList;\n  if ($isListNode(previousSibling) && listType === previousSibling.getListType()) {\n    previousSibling.append(listItem);\n    // if the same type of list is on both sides, merge them.\n    if ($isListNode(nextSibling) && listType === nextSibling.getListType()) {\n      append(previousSibling, nextSibling.getChildren());\n      nextSibling.remove();\n    }\n    targetList = previousSibling;\n  } else if ($isListNode(nextSibling) && listType === nextSibling.getListType()) {\n    nextSibling.getFirstChildOrThrow().insertBefore(listItem);\n    targetList = nextSibling;\n  } else {\n    const list = $createListNode(listType);\n    list.append(listItem);\n    node.replace(list);\n    targetList = list;\n  }\n  // listItem needs to be attached to root prior to setting indent\n  listItem.setFormat(node.getFormatType());\n  listItem.setIndent(node.getIndent());\n\n  // Preserve element-anchored selections by updating them to anchor to the listItem instead of the listNode.\n  const selection = $getSelection();\n  if ($isRangeSelection(selection)) {\n    if (targetList.getKey() === selection.anchor.key) {\n      selection.anchor.set(listItem.getKey(), selection.anchor.offset, 'element');\n    }\n    if (targetList.getKey() === selection.focus.key) {\n      selection.focus.set(listItem.getKey(), selection.focus.offset, 'element');\n    }\n  }\n  node.remove();\n  return targetList;\n}\n\n/**\n * A recursive function that goes through each list and their children, including nested lists,\n * appending list2 children after list1 children and updating ListItemNode values.\n * @param list1 - The first list to be merged.\n * @param list2 - The second list to be merged.\n */\nfunction mergeLists(list1, list2) {\n  const listItem1 = list1.getLastChild();\n  const listItem2 = list2.getFirstChild();\n  if (listItem1 && listItem2 && isNestedListNode(listItem1) && isNestedListNode(listItem2)) {\n    mergeLists(listItem1.getFirstChild(), listItem2.getFirstChild());\n    listItem2.remove();\n  }\n  const toMerge = list2.getChildren();\n  if (toMerge.length > 0) {\n    list1.append(...toMerge);\n  }\n  list2.remove();\n}\n\n/**\n * Searches for the nearest ancestral ListNode and removes it. If selection is an empty ListItemNode\n * it will remove the whole list, including the ListItemNode. For each ListItemNode in the ListNode,\n * removeList will also generate new ParagraphNodes in the removed ListNode's place. Any child node\n * inside a ListItemNode will be appended to the new ParagraphNodes.\n */\nfunction $removeList() {\n  const selection = $getSelection();\n  if ($isRangeSelection(selection)) {\n    const listNodes = new Set();\n    const nodes = selection.getNodes();\n    const anchorNode = selection.anchor.getNode();\n    if ($isSelectingEmptyListItem(anchorNode, nodes)) {\n      listNodes.add($getTopListNode(anchorNode));\n    } else {\n      for (let i = 0; i < nodes.length; i++) {\n        const node = nodes[i];\n        if ($isLeafNode(node)) {\n          const listItemNode = $getNearestNodeOfType(node, ListItemNode);\n          if (listItemNode != null) {\n            listNodes.add($getTopListNode(listItemNode));\n          }\n        }\n      }\n    }\n    for (const listNode of listNodes) {\n      let insertionPoint = listNode;\n      const listItems = $getAllListItems(listNode);\n      for (const listItemNode of listItems) {\n        const paragraph = $createParagraphNode().setTextStyle(selection.style).setTextFormat(selection.format);\n        append(paragraph, listItemNode.getChildren());\n        insertionPoint.insertAfter(paragraph);\n        insertionPoint = paragraph;\n\n        // When the anchor and focus fall on the textNode\n        // we don't have to change the selection because the textNode will be appended to\n        // the newly generated paragraph.\n        // When selection is in empty nested list item, selection is actually on the listItemNode.\n        // When the corresponding listItemNode is deleted and replaced by the newly generated paragraph\n        // we should manually set the selection's focus and anchor to the newly generated paragraph.\n        if (listItemNode.__key === selection.anchor.key) {\n          $setPointFromCaret(selection.anchor, $normalizeCaret($getChildCaret(paragraph, 'next')));\n        }\n        if (listItemNode.__key === selection.focus.key) {\n          $setPointFromCaret(selection.focus, $normalizeCaret($getChildCaret(paragraph, 'next')));\n        }\n        listItemNode.remove();\n      }\n      listNode.remove();\n    }\n  }\n}\n\n/**\n * Takes the value of a child ListItemNode and makes it the value the ListItemNode\n * should be if it isn't already. Also ensures that checked is undefined if the\n * parent does not have a list type of 'check'.\n * @param list - The list whose children are updated.\n */\nfunction updateChildrenListItemValue(list) {\n  const isNotChecklist = list.getListType() !== 'check';\n  let value = list.getStart();\n  for (const child of list.getChildren()) {\n    if ($isListItemNode(child)) {\n      if (child.getValue() !== value) {\n        child.setValue(value);\n      }\n      if (isNotChecklist && child.getLatest().__checked != null) {\n        child.setChecked(undefined);\n      }\n      if (!$isListNode(child.getFirstChild())) {\n        value++;\n      }\n    }\n  }\n}\n\n/**\n * Merge the next sibling list if same type.\n * <ul> will merge with <ul>, but NOT <ul> with <ol>.\n * @param list - The list whose next sibling should be potentially merged\n */\nfunction mergeNextSiblingListIfSameType(list) {\n  const nextSibling = list.getNextSibling();\n  if ($isListNode(nextSibling) && list.getListType() === nextSibling.getListType()) {\n    mergeLists(list, nextSibling);\n  }\n}\n\n/**\n * Adds an empty ListNode/ListItemNode chain at listItemNode, so as to\n * create an indent effect. Won't indent ListItemNodes that have a ListNode as\n * a child, but does merge sibling ListItemNodes if one has a nested ListNode.\n * @param listItemNode - The ListItemNode to be indented.\n */\nfunction $handleIndent(listItemNode) {\n  // go through each node and decide where to move it.\n  const removed = new Set();\n  if (isNestedListNode(listItemNode) || removed.has(listItemNode.getKey())) {\n    return;\n  }\n  const parent = listItemNode.getParent();\n\n  // We can cast both of the below `isNestedListNode` only returns a boolean type instead of a user-defined type guards\n  const nextSibling = listItemNode.getNextSibling();\n  const previousSibling = listItemNode.getPreviousSibling();\n  // if there are nested lists on either side, merge them all together.\n\n  if (isNestedListNode(nextSibling) && isNestedListNode(previousSibling)) {\n    const innerList = previousSibling.getFirstChild();\n    if ($isListNode(innerList)) {\n      innerList.append(listItemNode);\n      const nextInnerList = nextSibling.getFirstChild();\n      if ($isListNode(nextInnerList)) {\n        const children = nextInnerList.getChildren();\n        append(innerList, children);\n        nextSibling.remove();\n        removed.add(nextSibling.getKey());\n      }\n    }\n  } else if (isNestedListNode(nextSibling)) {\n    // if the ListItemNode is next to a nested ListNode, merge them\n    const innerList = nextSibling.getFirstChild();\n    if ($isListNode(innerList)) {\n      const firstChild = innerList.getFirstChild();\n      if (firstChild !== null) {\n        firstChild.insertBefore(listItemNode);\n      }\n    }\n  } else if (isNestedListNode(previousSibling)) {\n    const innerList = previousSibling.getFirstChild();\n    if ($isListNode(innerList)) {\n      innerList.append(listItemNode);\n    }\n  } else {\n    // otherwise, we need to create a new nested ListNode\n\n    if ($isListNode(parent)) {\n      const newListItem = $copyNode(listItemNode);\n      const newList = $copyNode(parent);\n      newListItem.append(newList);\n      newList.append(listItemNode);\n      if (previousSibling) {\n        previousSibling.insertAfter(newListItem);\n      } else if (nextSibling) {\n        nextSibling.insertBefore(newListItem);\n      } else {\n        parent.append(newListItem);\n      }\n    }\n  }\n}\n\n/**\n * Removes an indent by removing an empty ListNode/ListItemNode chain. An indented ListItemNode\n * has a great grandparent node of type ListNode, which is where the ListItemNode will reside\n * within as a child.\n * @param listItemNode - The ListItemNode to remove the indent (outdent).\n */\nfunction $handleOutdent(listItemNode) {\n  // go through each node and decide where to move it.\n\n  if (isNestedListNode(listItemNode)) {\n    return;\n  }\n  const parentList = listItemNode.getParent();\n  const grandparentListItem = parentList ? parentList.getParent() : undefined;\n  const greatGrandparentList = grandparentListItem ? grandparentListItem.getParent() : undefined;\n  // If it doesn't have these ancestors, it's not indented.\n\n  if ($isListNode(greatGrandparentList) && $isListItemNode(grandparentListItem) && $isListNode(parentList)) {\n    // if it's the first child in it's parent list, insert it into the\n    // great grandparent list before the grandparent\n    const firstChild = parentList ? parentList.getFirstChild() : undefined;\n    const lastChild = parentList ? parentList.getLastChild() : undefined;\n    if (listItemNode.is(firstChild)) {\n      grandparentListItem.insertBefore(listItemNode);\n      if (parentList.isEmpty()) {\n        grandparentListItem.remove();\n      }\n      // if it's the last child in it's parent list, insert it into the\n      // great grandparent list after the grandparent.\n    } else if (listItemNode.is(lastChild)) {\n      grandparentListItem.insertAfter(listItemNode);\n      if (parentList.isEmpty()) {\n        grandparentListItem.remove();\n      }\n    } else {\n      // otherwise, we need to split the siblings into two new nested lists\n      const previousSiblingsListItem = $copyNode(listItemNode);\n      const previousSiblingsList = $copyNode(parentList);\n      previousSiblingsListItem.append(previousSiblingsList);\n      listItemNode.getPreviousSiblings().forEach(sibling => previousSiblingsList.append(sibling));\n      const nextSiblingsListItem = $copyNode(listItemNode);\n      const nextSiblingsList = $copyNode(parentList);\n      nextSiblingsListItem.append(nextSiblingsList);\n      append(nextSiblingsList, listItemNode.getNextSiblings());\n      // put the sibling nested lists on either side of the grandparent list item in the great grandparent.\n      grandparentListItem.insertBefore(previousSiblingsListItem);\n      grandparentListItem.insertAfter(nextSiblingsListItem);\n      // replace the grandparent list item (now between the siblings) with the outdented list item.\n      grandparentListItem.replace(listItemNode);\n    }\n  }\n}\n\n/**\n * Attempts to insert a ParagraphNode at selection and selects the new node. The selection must contain a ListItemNode\n * or a node that does not already contain text. If its grandparent is the root/shadow root, it will get the ListNode\n * (which should be the parent node) and insert the ParagraphNode as a sibling to the ListNode. If the ListNode is\n * nested in a ListItemNode instead, it will add the ParagraphNode after the grandparent ListItemNode.\n * Throws an invariant if the selection is not a child of a ListNode.\n * @returns true if a ParagraphNode was inserted successfully, false if there is no selection\n * or the selection does not contain a ListItemNode or the node already holds text.\n */\nfunction $handleListInsertParagraph(restoreNumbering = false) {\n  const selection = $getSelection();\n  if (!$isRangeSelection(selection) || !selection.isCollapsed()) {\n    return false;\n  }\n  // Only run this code on empty list items (including whitespace-only)\n  const anchor = selection.anchor.getNode();\n  let listItem = null;\n  if ($isListItemNode(anchor) && anchor.getChildrenSize() === 0) {\n    // Truly empty list item (element selection)\n    listItem = anchor;\n  } else if ($isTextNode(anchor)) {\n    // Check if the entire list item contains only whitespace text nodes\n    const parentListItem = anchor.getParent();\n    if ($isListItemNode(parentListItem) && parentListItem.getChildren().every(node => $isTextNode(node) && node.getTextContent().trim() === '')) {\n      listItem = parentListItem;\n    }\n  }\n  if (listItem === null) {\n    return false;\n  }\n  const topListNode = $getTopListNode(listItem);\n  const parent = listItem.getParent();\n  if (!$isListNode(parent)) {\n    formatDevErrorMessage(`A ListItemNode must have a ListNode for a parent.`);\n  }\n  const grandparent = parent.getParent();\n  let replacementNode;\n  if ($isRootOrShadowRoot(grandparent)) {\n    replacementNode = $createParagraphNode();\n    topListNode.insertAfter(replacementNode);\n  } else if ($isListItemNode(grandparent)) {\n    replacementNode = $copyNode(grandparent);\n    grandparent.insertAfter(replacementNode);\n  } else {\n    return false;\n  }\n  replacementNode.setTextStyle(selection.style).setTextFormat(selection.format).select();\n  const nextSiblings = listItem.getNextSiblings();\n  if (nextSiblings.length > 0) {\n    const newStart = restoreNumbering ? $getNewListStart(parent, listItem) : 1;\n    const newList = $copyNode(parent).setStart(newStart);\n    if ($isListItemNode(replacementNode)) {\n      const newListItem = $copyNode(replacementNode);\n      newListItem.append(newList);\n      replacementNode.insertAfter(newListItem);\n    } else {\n      replacementNode.insertAfter(newList);\n    }\n    newList.append(...nextSiblings);\n  }\n\n  // Don't leave hanging nested empty lists\n  $removeHighestEmptyListParent(listItem);\n  return true;\n}\n\nfunction applyMarkerStyles(dom, node, prevNode) {\n  const nextTextStyle = node.__textStyle;\n  const prevTextStyle = prevNode ? prevNode.__textStyle : '';\n  if (prevNode !== null && prevTextStyle === nextTextStyle) {\n    return;\n  }\n  const styles = getStyleObjectFromCSS(nextTextStyle);\n  for (const k in styles) {\n    dom.style.setProperty(`--listitem-marker-${k}`, styles[k]);\n  }\n  if (prevTextStyle !== '') {\n    for (const k in getStyleObjectFromCSS(prevTextStyle)) {\n      if (!(k in styles)) {\n        dom.style.removeProperty(`--listitem-marker-${k}`);\n      }\n    }\n  }\n}\n\n/** @noInheritDoc */\nclass ListItemNode extends ElementNode {\n  /** @internal */\n  __value;\n  /** @internal */\n  __checked;\n\n  /** @internal */\n  $config() {\n    return this.config('listitem', {\n      $transform: node => {\n        const parent = node.getParent();\n        if ($isListNode(parent)) {\n          if (parent.getListType() !== 'check' && node.getChecked() != null) {\n            node.setChecked(undefined);\n          }\n        } else if (parent) {\n          const newParent = node.createParentElementNode();\n          if (!$isListNode(newParent)) {\n            formatDevErrorMessage(`ListItemNode.createParentElementNode() must return a ListNode`);\n          } // Insert an empty ListNode at the orphan's position, splitting\n          // any enclosing non-shadow-root blocks so the ListNode lifts to\n          // a valid container before we move the orphan in. The ListNode\n          // $transform merges adjacent same-type lists, so neighbouring\n          // orphans will coalesce once their own transforms run.\n          const children = [node];\n          for (const dir of ['previous', 'next']) {\n            children.reverse();\n            for (const {\n              origin\n            } of $getSiblingCaret(node, dir)) {\n              if (!$isListItemNode(origin)) {\n                break;\n              }\n              children.push(origin);\n            }\n          }\n          node.insertBefore(newParent);\n          newParent.splice(0, 0, children);\n          if (!$isRootOrShadowRoot(parent)) {\n            $insertNodeToNearestRootAtCaret(newParent, $rewindSiblingCaret($getSiblingCaret(newParent, 'next')), {\n              $shouldSplit: () => false,\n              removeEmptyDestination: true\n            });\n            if (parent.isEmpty() && parent.isAttached()) {\n              parent.remove();\n            }\n          }\n        }\n      },\n      extends: ElementNode,\n      importDOM: buildImportMap({\n        li: () => ({\n          conversion: $convertListItemElement,\n          priority: 0\n        })\n      })\n    });\n  }\n  constructor(value = 1, checked = undefined, key) {\n    super(key);\n    this.__value = value === undefined ? 1 : value;\n    this.__checked = checked;\n  }\n  afterCloneFrom(prevNode) {\n    super.afterCloneFrom(prevNode);\n    this.__value = prevNode.__value;\n    this.__checked = prevNode.__checked;\n  }\n  createDOM(config) {\n    const element = document.createElement('li');\n    this.updateListItemDOM(null, element, config);\n    return element;\n  }\n  updateListItemDOM(prevNode, dom, config) {\n    updateListItemChecked(dom, this, prevNode);\n    dom.value = this.__value;\n    $setListItemThemeClassNames(dom, config.theme, this);\n    const prevStyle = prevNode ? prevNode.__style : '';\n    const nextStyle = this.__style;\n    if (prevStyle !== nextStyle) {\n      setDOMStyleFromCSS(dom.style, nextStyle, prevStyle);\n    }\n    applyMarkerStyles(dom, this, prevNode);\n  }\n  updateDOM(prevNode, dom, config) {\n    // @ts-expect-error - this is always HTMLListItemElement\n    const element = dom;\n    this.updateListItemDOM(prevNode, element, config);\n    return false;\n  }\n  updateFromJSON(serializedNode) {\n    return super.updateFromJSON(serializedNode).setValue(serializedNode.value).setChecked(serializedNode.checked);\n  }\n  exportDOM(editor) {\n    const element = this.createDOM(editor._config);\n    const formatType = this.getFormatType();\n    if (formatType) {\n      element.style.textAlign = formatType;\n    }\n    const direction = this.getDirection();\n    if (direction) {\n      element.dir = direction;\n    }\n    if (isNestedListNode(this)) {\n      return {\n        after(containerElement) {\n          if (isHTMLElement(containerElement)) {\n            const prevSibling = containerElement.previousElementSibling;\n            if (isHTMLElement(prevSibling) && prevSibling.nodeName === 'LI') {\n              while (containerElement.firstChild) {\n                prevSibling.append(containerElement.firstChild);\n              }\n              containerElement.remove();\n            }\n          }\n          return containerElement;\n        },\n        element\n      };\n    }\n    return {\n      element\n    };\n  }\n  exportJSON() {\n    return {\n      ...super.exportJSON(),\n      checked: this.getChecked(),\n      value: this.getValue()\n    };\n  }\n  append(...nodes) {\n    for (let i = 0; i < nodes.length; i++) {\n      const node = nodes[i];\n      if ($isElementNode(node) && this.canMergeWith(node)) {\n        const children = node.getChildren();\n        this.append(...children);\n        node.remove();\n      } else {\n        super.append(node);\n      }\n    }\n    return this;\n  }\n  replace(replaceWithNode, includeChildren) {\n    if ($isListItemNode(replaceWithNode)) {\n      return super.replace(replaceWithNode);\n    }\n    this.setIndent(0);\n    const list = this.getParentOrThrow();\n    if (!$isListNode(list)) {\n      return replaceWithNode;\n    }\n    if (list.__first === this.getKey()) {\n      list.insertBefore(replaceWithNode);\n    } else if (list.__last === this.getKey()) {\n      list.insertAfter(replaceWithNode);\n    } else {\n      // Split the list\n      const newList = $copyNode(list);\n      let nextSibling = this.getNextSibling();\n      while (nextSibling) {\n        const nodeToAppend = nextSibling;\n        nextSibling = nextSibling.getNextSibling();\n        newList.append(nodeToAppend);\n      }\n      list.insertAfter(replaceWithNode);\n      replaceWithNode.insertAfter(newList);\n    }\n    if (includeChildren) {\n      if (!$isElementNode(replaceWithNode)) {\n        formatDevErrorMessage(`includeChildren should only be true for ElementNodes`);\n      }\n      this.getChildren().forEach(child => {\n        replaceWithNode.append(child);\n      });\n    }\n    this.remove();\n    if (list.getChildrenSize() === 0) {\n      list.remove();\n    }\n    return replaceWithNode;\n  }\n  insertAfter(node, restoreSelection = true) {\n    const listNode = this.getParentOrThrow();\n    if (!$isListNode(listNode)) {\n      {\n        formatDevErrorMessage(`insertAfter: list node is not parent of list item node`);\n      }\n    }\n    if ($isListItemNode(node)) {\n      return super.insertAfter(node, restoreSelection);\n    }\n    const siblings = this.getNextSiblings();\n\n    // Split the lists and insert the node in between them\n    listNode.insertAfter(node, restoreSelection);\n    if (siblings.length !== 0) {\n      const newListNode = $copyNode(listNode);\n      siblings.forEach(sibling => newListNode.append(sibling));\n      node.insertAfter(newListNode, restoreSelection);\n    }\n    return node;\n  }\n  remove(preserveEmptyParent) {\n    const prevSibling = this.getPreviousSibling();\n    const nextSibling = this.getNextSibling();\n    super.remove(preserveEmptyParent);\n    if (prevSibling && nextSibling && isNestedListNode(prevSibling) && isNestedListNode(nextSibling)) {\n      mergeLists(prevSibling.getFirstChild(), nextSibling.getFirstChild());\n      nextSibling.remove();\n    }\n  }\n  resetOnCopyNodeFrom(original) {\n    super.resetOnCopyNodeFrom(original);\n    if (original.getChecked()) {\n      this.setChecked(false);\n    }\n  }\n  insertNewAfter(_, restoreSelection = true) {\n    const newElement = $copyNode(this);\n    this.insertAfter(newElement, restoreSelection);\n    return newElement;\n  }\n  collapseAtStart(selection) {\n    const paragraph = $createParagraphNode();\n    const children = this.getChildren();\n    children.forEach(child => paragraph.append(child));\n    const listNode = this.getParentOrThrow();\n    const listNodeParent = listNode.getParentOrThrow();\n    const isIndented = $isListItemNode(listNodeParent);\n    if (listNode.getChildrenSize() === 1) {\n      if (isIndented) {\n        // if the list node is nested, we just want to remove it,\n        // effectively unindenting it.\n        listNode.remove();\n        listNodeParent.select();\n      } else {\n        listNode.insertBefore(paragraph);\n        listNode.remove();\n        // If we have selection on the list item, we'll need to move it\n        // to the paragraph\n        const anchor = selection.anchor;\n        const focus = selection.focus;\n        const key = paragraph.getKey();\n        if (anchor.type === 'element' && anchor.getNode().is(this)) {\n          anchor.set(key, anchor.offset, 'element');\n        }\n        if (focus.type === 'element' && focus.getNode().is(this)) {\n          focus.set(key, focus.offset, 'element');\n        }\n      }\n    } else {\n      listNode.insertBefore(paragraph);\n      this.remove();\n    }\n    return true;\n  }\n  getValue() {\n    const self = this.getLatest();\n    return self.__value;\n  }\n  setValue(value) {\n    const self = this.getWritable();\n    self.__value = value;\n    return self;\n  }\n  getChecked() {\n    const self = this.getLatest();\n    let listType;\n    const parent = this.getParent();\n    if ($isListNode(parent)) {\n      listType = parent.getListType();\n    }\n    return listType === 'check' ? Boolean(self.__checked) : undefined;\n  }\n  setChecked(checked) {\n    const self = this.getWritable();\n    self.__checked = checked;\n    return self;\n  }\n  toggleChecked() {\n    const self = this.getWritable();\n    return self.setChecked(!self.__checked);\n  }\n  getIndent() {\n    // If we don't have a parent, we are likely serializing\n    const parent = this.getParent();\n    if (parent === null || !this.isAttached()) {\n      return this.getLatest().__indent;\n    }\n    // ListItemNode should always have a ListNode for a parent.\n    let listNodeParent = parent.getParentOrThrow();\n    let indentLevel = 0;\n    while ($isListItemNode(listNodeParent)) {\n      listNodeParent = listNodeParent.getParentOrThrow().getParentOrThrow();\n      indentLevel++;\n    }\n    return indentLevel;\n  }\n  setIndent(indent) {\n    if (!(typeof indent === 'number')) {\n      formatDevErrorMessage(`Invalid indent value.`);\n    }\n    indent = Math.floor(indent);\n    if (!(indent >= 0)) {\n      formatDevErrorMessage(`Indent value must be non-negative.`);\n    }\n    let currentIndent = this.getIndent();\n    while (currentIndent !== indent) {\n      if (currentIndent < indent) {\n        $handleIndent(this);\n        currentIndent++;\n      } else {\n        $handleOutdent(this);\n        currentIndent--;\n      }\n    }\n    return this;\n  }\n\n  /** @deprecated @internal */\n  canInsertAfter(node) {\n    return $isListItemNode(node);\n  }\n\n  /** @deprecated @internal */\n  canReplaceWith(replacement) {\n    return $isListItemNode(replacement);\n  }\n  canMergeWith(node) {\n    return $isListItemNode(node) || $isParagraphNode(node);\n  }\n  extractWithChild(child, selection) {\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    const anchorNode = selection.anchor.getNode();\n    const focusNode = selection.focus.getNode();\n    return this.isParentOf(anchorNode) && this.isParentOf(focusNode) && this.getTextContent().length === selection.getTextContent().length;\n  }\n  isParentRequired() {\n    return true;\n  }\n  createParentElementNode() {\n    return $createListNode('bullet');\n  }\n  canMergeWhenEmpty() {\n    return true;\n  }\n}\nfunction $setListItemThemeClassNames(dom, editorThemeClasses, node) {\n  const classesToAdd = [];\n  const classesToRemove = [];\n  const listTheme = editorThemeClasses.list;\n  const listItemClassName = listTheme ? listTheme.listitem : undefined;\n  let nestedListItemClassName;\n  if (listTheme && listTheme.nested) {\n    nestedListItemClassName = listTheme.nested.listitem;\n  }\n  if (listItemClassName !== undefined) {\n    classesToAdd.push(...normalizeClassNames(listItemClassName));\n  }\n  if (listTheme) {\n    const parentNode = node.getParent();\n    const isCheckList = $isListNode(parentNode) && parentNode.getListType() === 'check';\n    const checked = node.getChecked();\n    if (!isCheckList || checked) {\n      classesToRemove.push(listTheme.listitemUnchecked);\n    }\n    if (!isCheckList || !checked) {\n      classesToRemove.push(listTheme.listitemChecked);\n    }\n    if (isCheckList) {\n      classesToAdd.push(checked ? listTheme.listitemChecked : listTheme.listitemUnchecked);\n    }\n  }\n  if (nestedListItemClassName !== undefined) {\n    const nestedListItemClasses = normalizeClassNames(nestedListItemClassName);\n    if (node.getChildren().some(child => $isListNode(child))) {\n      classesToAdd.push(...nestedListItemClasses);\n    } else {\n      classesToRemove.push(...nestedListItemClasses);\n    }\n  }\n  if (classesToRemove.length > 0) {\n    removeClassNamesFromElement(dom, ...classesToRemove);\n  }\n  if (classesToAdd.length > 0) {\n    addClassNamesToElement(dom, ...classesToAdd);\n  }\n}\nfunction updateListItemChecked(dom, listItemNode, prevListItemNode) {\n  const parent = listItemNode.getParent();\n  const isCheckbox = $isListNode(parent) && parent.getListType() === 'check' &&\n  // Only add attributes for leaf list items\n  !$isListNode(listItemNode.getFirstChild());\n  if (!isCheckbox) {\n    dom.removeAttribute('role');\n    dom.removeAttribute('tabIndex');\n    dom.removeAttribute('aria-checked');\n  } else {\n    dom.setAttribute('role', 'checkbox');\n    dom.setAttribute('tabIndex', '-1');\n    if (!prevListItemNode || listItemNode.__checked !== prevListItemNode.__checked) {\n      dom.setAttribute('aria-checked', listItemNode.getChecked() ? 'true' : 'false');\n    }\n  }\n}\nfunction $convertListItemElement(domNode) {\n  const isGitHubCheckList = domNode.classList.contains('task-list-item');\n  if (isGitHubCheckList) {\n    for (const child of domNode.children) {\n      if (child.tagName === 'INPUT') {\n        return $convertCheckboxInput(child);\n      }\n    }\n  }\n  const isJoplinCheckList = domNode.classList.contains('joplin-checkbox');\n  if (isJoplinCheckList) {\n    for (const child of domNode.children) {\n      if (child.classList.contains('checkbox-wrapper') && child.children.length > 0 && child.children[0].tagName === 'INPUT') {\n        return $convertCheckboxInput(child.children[0]);\n      }\n    }\n  }\n  const ariaCheckedAttr = domNode.getAttribute('aria-checked');\n  const checked = ariaCheckedAttr === 'true' ? true : ariaCheckedAttr === 'false' ? false : undefined;\n  return {\n    node: $createListItemNode(checked)\n  };\n}\nfunction $convertCheckboxInput(domNode) {\n  const isCheckboxInput = domNode.getAttribute('type') === 'checkbox';\n  if (!isCheckboxInput) {\n    return {\n      node: null\n    };\n  }\n  const checked = domNode.hasAttribute('checked');\n  return {\n    node: $createListItemNode(checked)\n  };\n}\n\n/**\n * Creates a new List Item node, passing true/false will convert it to a checkbox input.\n * @param checked - Is the List Item a checkbox and, if so, is it checked? undefined/null: not a checkbox, true/false is a checkbox and checked/unchecked, respectively.\n * @returns The new List Item.\n */\nfunction $createListItemNode(checked) {\n  return $applyNodeReplacement(new ListItemNode(undefined, checked));\n}\n\n/**\n * Checks to see if the node is a ListItemNode.\n * @param node - The node to be checked.\n * @returns true if the node is a ListItemNode, false otherwise.\n */\nfunction $isListItemNode(node) {\n  return node instanceof ListItemNode;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/** @noInheritDoc */\nclass ListNode extends ElementNode {\n  /** @internal */\n  __tag;\n  /** @internal */\n  __start;\n  /** @internal */\n  __listType;\n\n  /** @internal */\n  $config() {\n    return this.config('list', {\n      $transform: node => {\n        mergeNextSiblingListIfSameType(node);\n        updateChildrenListItemValue(node);\n      },\n      extends: ElementNode,\n      importDOM: buildImportMap({\n        ol: () => ({\n          conversion: $convertListNode,\n          priority: 0\n        }),\n        ul: () => ({\n          conversion: $convertListNode,\n          priority: 0\n        })\n      })\n    });\n  }\n  constructor(listType = 'number', start = 1, key) {\n    super(key);\n    const _listType = TAG_TO_LIST_TYPE[listType] || listType;\n    this.__listType = _listType;\n    this.__tag = _listType === 'number' ? 'ol' : 'ul';\n    this.__start = start;\n  }\n  afterCloneFrom(prevNode) {\n    super.afterCloneFrom(prevNode);\n    this.__listType = prevNode.__listType;\n    this.__tag = prevNode.__tag;\n    this.__start = prevNode.__start;\n  }\n  getTag() {\n    return this.getLatest().__tag;\n  }\n  setListType(type) {\n    const writable = this.getWritable();\n    writable.__listType = type;\n    writable.__tag = type === 'number' ? 'ol' : 'ul';\n    return writable;\n  }\n  getListType() {\n    return this.getLatest().__listType;\n  }\n  getStart() {\n    return this.getLatest().__start;\n  }\n  setStart(start) {\n    const self = this.getWritable();\n    self.__start = start;\n    return self;\n  }\n\n  // View\n\n  createDOM(config, _editor) {\n    const tag = this.__tag;\n    const dom = document.createElement(tag);\n    if (this.__start !== 1) {\n      dom.setAttribute('start', String(this.__start));\n    }\n    // @ts-expect-error Internal field.\n    dom.__lexicalListType = this.__listType;\n    $setListThemeClassNames(dom, config.theme, this);\n    return dom;\n  }\n  updateDOM(prevNode, dom, config) {\n    if (prevNode.__tag !== this.__tag || prevNode.__listType !== this.__listType) {\n      return true;\n    }\n    $setListThemeClassNames(dom, config.theme, this);\n    if (prevNode.__start !== this.__start) {\n      dom.setAttribute('start', String(this.__start));\n    }\n    return false;\n  }\n  updateFromJSON(serializedNode) {\n    return super.updateFromJSON(serializedNode).setListType(serializedNode.listType).setStart(serializedNode.start);\n  }\n  exportDOM(editor) {\n    const element = this.createDOM(editor._config, editor);\n    if (isHTMLElement$1(element)) {\n      if (this.__start !== 1) {\n        element.setAttribute('start', String(this.__start));\n      }\n      if (this.__listType === 'check') {\n        element.setAttribute('__lexicalListType', 'check');\n      }\n    }\n    return {\n      element\n    };\n  }\n  exportJSON() {\n    return {\n      ...super.exportJSON(),\n      listType: this.getListType(),\n      start: this.getStart(),\n      tag: this.getTag()\n    };\n  }\n  canBeEmpty() {\n    return false;\n  }\n  canIndent() {\n    return false;\n  }\n  splice(start, deleteCount, nodesToInsert) {\n    const exampleListItem = nodesToInsert.find($isListItemNode) ?? this.getChildren().find($isListItemNode);\n    const $newListItem = exampleListItem ? () => $copyNode(exampleListItem) : $createListItemNode;\n    let listItemNodesToInsert = nodesToInsert;\n    for (let i = 0; i < nodesToInsert.length; i++) {\n      const node = nodesToInsert[i];\n      if (!$isListItemNode(node)) {\n        if (listItemNodesToInsert === nodesToInsert) {\n          listItemNodesToInsert = [...nodesToInsert];\n        }\n        listItemNodesToInsert[i] = $newListItem().append($isElementNode(node) && !($isListNode(node) || node.isInline()) ? $createTextNode(node.getTextContent()) : node);\n      }\n    }\n    return super.splice(start, deleteCount, listItemNodesToInsert);\n  }\n  extractWithChild(child) {\n    return $isListItemNode(child);\n  }\n}\nfunction $setListThemeClassNames(dom, editorThemeClasses, node) {\n  const classesToAdd = [];\n  const classesToRemove = [];\n  const listTheme = editorThemeClasses.list;\n  if (listTheme !== undefined) {\n    const listLevelsClassNames = listTheme[`${node.__tag}Depth`] || [];\n    const listDepth = $getListDepth(node) - 1;\n    const normalizedListDepth = listDepth % listLevelsClassNames.length;\n    const listLevelClassName = listLevelsClassNames[normalizedListDepth];\n    const listClassName = listTheme[node.__tag];\n    let nestedListClassName;\n    const nestedListTheme = listTheme.nested;\n    const checklistClassName = listTheme.checklist;\n    if (nestedListTheme !== undefined && nestedListTheme.list) {\n      nestedListClassName = nestedListTheme.list;\n    }\n    if (listClassName !== undefined) {\n      classesToAdd.push(listClassName);\n    }\n    if (checklistClassName !== undefined && node.__listType === 'check') {\n      classesToAdd.push(checklistClassName);\n    }\n    if (listLevelClassName !== undefined) {\n      classesToAdd.push(...normalizeClassNames(listLevelClassName));\n      for (let i = 0; i < listLevelsClassNames.length; i++) {\n        if (i !== normalizedListDepth) {\n          classesToRemove.push(node.__tag + i);\n        }\n      }\n    }\n    if (nestedListClassName !== undefined) {\n      const nestedListItemClasses = normalizeClassNames(nestedListClassName);\n      if (listDepth > 1) {\n        classesToAdd.push(...nestedListItemClasses);\n      } else {\n        classesToRemove.push(...nestedListItemClasses);\n      }\n    }\n  }\n  if (classesToRemove.length > 0) {\n    removeClassNamesFromElement(dom, ...classesToRemove);\n  }\n  if (classesToAdd.length > 0) {\n    addClassNamesToElement(dom, ...classesToAdd);\n  }\n}\n\n/*\n * This function normalizes the children of a ListNode after the conversion from HTML,\n * ensuring that they are all ListItemNodes and contain either a single nested ListNode\n * or some other inline content.\n */\nfunction $normalizeChildren(nodes) {\n  const normalizedListItems = [];\n  for (let i = 0; i < nodes.length; i++) {\n    const node = nodes[i];\n    if ($isListItemNode(node)) {\n      normalizedListItems.push(node);\n      const children = node.getChildren();\n      if (children.length > 1) {\n        children.forEach(child => {\n          if ($isListNode(child)) {\n            normalizedListItems.push($wrapInListItem(child));\n          }\n        });\n      }\n    } else {\n      normalizedListItems.push($wrapInListItem(node));\n    }\n  }\n  return normalizedListItems;\n}\nfunction isDomChecklist(domNode) {\n  if (domNode.getAttribute('__lexicallisttype') === 'check' ||\n  // is github checklist\n  domNode.classList.contains('contains-task-list') ||\n  // is joplin checklist\n  domNode.getAttribute('data-is-checklist') === '1') {\n    return true;\n  }\n  // if children are checklist items, the node is a checklist ul. Applicable for googledoc checklist pasting.\n  for (const child of domNode.childNodes) {\n    if (isHTMLElement$1(child) && child.hasAttribute('aria-checked')) {\n      return true;\n    }\n  }\n  return false;\n}\nfunction $convertListNode(domNode) {\n  const nodeName = domNode.nodeName.toLowerCase();\n  let node = null;\n  if (nodeName === 'ol') {\n    // @ts-ignore\n    const start = domNode.start;\n    node = $createListNode('number', start);\n  } else if (nodeName === 'ul') {\n    if (isDomChecklist(domNode)) {\n      node = $createListNode('check');\n    } else {\n      node = $createListNode('bullet');\n    }\n  }\n  return {\n    after: $normalizeChildren,\n    node\n  };\n}\nconst TAG_TO_LIST_TYPE = {\n  ol: 'number',\n  ul: 'bullet'\n};\n\n/**\n * Creates a ListNode of listType.\n * @param listType - The type of list to be created. Can be 'number', 'bullet', or 'check'.\n * @param start - Where an ordered list starts its count, start = 1 if left undefined.\n * @returns The new ListNode\n */\nfunction $createListNode(listType = 'number', start = 1) {\n  return $applyNodeReplacement(new ListNode(listType, start));\n}\n\n/**\n * Checks to see if the node is a ListNode.\n * @param node - The node to be checked.\n * @returns true if the node is a ListNode, false otherwise.\n */\nfunction $isListNode(node) {\n  return node instanceof ListNode;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst INSERT_CHECK_LIST_COMMAND = createCommand('INSERT_CHECK_LIST_COMMAND');\n\n/**\n * Registers the checklist plugin with the editor.\n * @param editor The LexicalEditor instance.\n * @param options Optional configuration.\n *   - disableTakeFocusOnClick: If true, clicking a checklist item will not focus the editor (useful for mobile).\n */\nfunction registerCheckList(editor, options) {\n  const disableTakeFocusOnClick = options && options.disableTakeFocusOnClick || false;\n  const peekDisableTakeFocusOnClick = typeof disableTakeFocusOnClick === 'boolean' ? () => disableTakeFocusOnClick : disableTakeFocusOnClick.peek.bind(disableTakeFocusOnClick);\n\n  // Mobile tap fix: the touchstart listener registered below calls\n  // event.preventDefault() to keep the caret away from the marker. On iOS\n  // Safari and Android Chrome that suppression also cancels the synthesized\n  // click, so handleClick never runs and the checkbox cannot be toggled by\n  // tap. We additionally listen for pointerup with pointerType === 'touch'\n  // and run the same toggle logic, deduplicating against any click that\n  // does fire on browsers where preventDefault doesn't suppress it.\n  //\n  // Dedup state is per-target: recorded as `__lexicalCheckListLastHandled`\n  // on the target element. A global window would\n  // block tapping a second checkbox within 500ms of toggling the first.\n  const DEDUP_WINDOW_MS = 500;\n  const isWithinDedupWindow = event => {\n    const target = event.target;\n    if (!isHTMLElement$1(target)) {\n      return false;\n    }\n    // @ts-ignore internal field\n    const last = target.__lexicalCheckListLastHandled;\n    return last !== undefined && event.timeStamp - last < DEDUP_WINDOW_MS;\n  };\n  const recordHandled = event => {\n    const target = event.target;\n    if (isHTMLElement$1(target)) {\n      // @ts-ignore internal field\n      target.__lexicalCheckListLastHandled = event.timeStamp;\n    }\n  };\n  const configHandleClick = event => {\n    if (isWithinDedupWindow(event)) {\n      return;\n    }\n    recordHandled(event);\n    handleClick(event, peekDisableTakeFocusOnClick());\n  };\n  const configHandlePointerUp = event => {\n    if (event.pointerType !== 'touch') {\n      return;\n    }\n    if (isWithinDedupWindow(event)) {\n      return;\n    }\n    recordHandled(event);\n    handleClick(event, peekDisableTakeFocusOnClick());\n  };\n  const configHandleSelectDefaults = event => {\n    handleSelectDefaults(event, peekDisableTakeFocusOnClick());\n  };\n  return mergeRegister(editor.registerCommand(INSERT_CHECK_LIST_COMMAND, () => {\n    $insertList('check');\n    return true;\n  }, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_ARROW_DOWN_COMMAND, event => {\n    return handleArrowUpOrDown(event, editor, false);\n  }, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_ARROW_UP_COMMAND, event => {\n    return handleArrowUpOrDown(event, editor, true);\n  }, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_ESCAPE_COMMAND, () => {\n    const activeItem = getActiveCheckListItem();\n    if (activeItem != null) {\n      const rootElement = editor.getRootElement();\n      if (rootElement != null) {\n        rootElement.focus();\n      }\n      return true;\n    }\n    return false;\n  }, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_SPACE_COMMAND, event => {\n    const activeItem = getActiveCheckListItem();\n    if (activeItem != null && editor.isEditable()) {\n      editor.update(() => {\n        const listItemNode = $getNearestNodeFromDOMNode(activeItem);\n        if ($isListItemNode(listItemNode)) {\n          event.preventDefault();\n          listItemNode.toggleChecked();\n        }\n      });\n      return true;\n    }\n    return false;\n  }, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_ARROW_LEFT_COMMAND, event => {\n    return editor.getEditorState().read(() => {\n      const selection = $getSelection();\n      if ($isRangeSelection(selection) && selection.isCollapsed()) {\n        const {\n          anchor\n        } = selection;\n        const isElement = anchor.type === 'element';\n        if (isElement || anchor.offset === 0) {\n          const anchorNode = anchor.getNode();\n          const elementNode = $findMatchingParent(anchorNode, node => $isElementNode(node) && !node.isInline());\n          if ($isListItemNode(elementNode)) {\n            const parent = elementNode.getParent();\n            if ($isListNode(parent) && parent.getListType() === 'check' && (isElement || elementNode.getFirstDescendant() === anchorNode)) {\n              const domNode = editor.getElementByKey(elementNode.__key);\n              if (domNode != null && document.activeElement !== domNode) {\n                domNode.focus();\n                event.preventDefault();\n                return true;\n              }\n            }\n          }\n        }\n      }\n      return false;\n    });\n  }, COMMAND_PRIORITY_LOW), editor.registerRootListener(rootElement => {\n    if (rootElement !== null) {\n      rootElement.addEventListener('click', configHandleClick);\n      rootElement.addEventListener('pointerup', configHandlePointerUp);\n      // Use capture so we run before other listeners that might move focus.\n      rootElement.addEventListener('pointerdown', configHandleSelectDefaults, {\n        capture: true\n      });\n      // Some browsers / integrations still generate mousedown events; handle them too.\n      rootElement.addEventListener('mousedown', configHandleSelectDefaults, {\n        capture: true\n      });\n      // Intercept touchstart to stop the mobile browser from placing the caret\n      // and opening the keyboard when tapping the checklist marker.\n      rootElement.addEventListener('touchstart', configHandleSelectDefaults, {\n        capture: true,\n        passive: false\n      });\n      return () => {\n        rootElement.removeEventListener('click', configHandleClick);\n        rootElement.removeEventListener('pointerup', configHandlePointerUp);\n        rootElement.removeEventListener('pointerdown', configHandleSelectDefaults, {\n          capture: true\n        });\n        rootElement.removeEventListener('mousedown', configHandleSelectDefaults, {\n          capture: true\n        });\n        rootElement.removeEventListener('touchstart', configHandleSelectDefaults, {\n          capture: true\n        });\n      };\n    }\n  }));\n}\nfunction handleCheckItemEvent(event, callback) {\n  const target = event.target;\n  if (!isHTMLElement$1(target)) {\n    return;\n  }\n\n  // Ignore clicks on LI that have nested lists\n  const firstChild = target.firstChild;\n  if (isHTMLElement$1(firstChild) && (firstChild.tagName === 'UL' || firstChild.tagName === 'OL')) {\n    return;\n  }\n  const parentNode = target.parentNode;\n\n  // @ts-ignore internal field\n  if (!parentNode || parentNode.__lexicalListType !== 'check') {\n    return;\n  }\n  let clientX = null;\n  let pointerType = null;\n  if ('clientX' in event) {\n    clientX = event.clientX;\n  } else if ('touches' in event) {\n    const touches = event.touches;\n    if (touches.length > 0) {\n      clientX = touches[0].clientX;\n      pointerType = 'touch';\n    }\n  }\n\n  // If we couldn't resolve a clientX (unexpected input), bail out.\n  if (clientX == null) {\n    return;\n  }\n  const rect = target.getBoundingClientRect();\n  const zoom = calculateZoomLevel(target);\n  const clientXInPixels = clientX / zoom;\n\n  // Use getComputedStyle if available, otherwise fallback to 0px width\n  const beforeStyles = window.getComputedStyle ? window.getComputedStyle(target, '::before') : {\n    width: '0px'\n  };\n  const beforeWidthInPixels = parseFloat(beforeStyles.width);\n\n  // Make click area slightly larger for touch devices to improve accessibility\n  // Determine whether this is a touch event; some environments may supply\n  // pointerType on PointerEvent while touch events use the `touches` API above.\n  const isTouchEvent = pointerType === 'touch' || 'pointerType' in event && event.pointerType === 'touch';\n  const clickAreaPadding = isTouchEvent ? 32 : 0; // Add 32px padding for touch events\n\n  if (target.dir === 'rtl' ? clientXInPixels < rect.right + clickAreaPadding && clientXInPixels > rect.right - beforeWidthInPixels - clickAreaPadding : clientXInPixels > rect.left - clickAreaPadding && clientXInPixels < rect.left + beforeWidthInPixels + clickAreaPadding) {\n    callback();\n  }\n}\nfunction handleClick(event, disableFocusOnClick) {\n  handleCheckItemEvent(event, () => {\n    if (isHTMLElement$1(event.target)) {\n      const domNode = event.target;\n      const editor = getNearestEditorFromDOMNode(domNode);\n      if (editor != null && editor.isEditable()) {\n        editor.update(() => {\n          const node = $getNearestNodeFromDOMNode(domNode);\n          if ($isListItemNode(node)) {\n            if (disableFocusOnClick) {\n              $addUpdateTag(SKIP_SELECTION_FOCUS_TAG);\n              $addUpdateTag(SKIP_DOM_SELECTION_TAG);\n            } else {\n              domNode.focus();\n            }\n            node.toggleChecked();\n          }\n        });\n      }\n    }\n  });\n}\n\n/**\n * Prevents default focus switch behavior\n *\n * @param event might be of type PointerEvent, MouseEvent, or TouchEvent, hence the generic Event type\n *\n */\nfunction handleSelectDefaults(event, disableTakeFocusOnClick) {\n  handleCheckItemEvent(event, () => {\n    // Prevents caret moving when clicking on check mark.\n    event.preventDefault();\n    if (disableTakeFocusOnClick) {\n      event.stopPropagation();\n    }\n  });\n}\nfunction getActiveCheckListItem() {\n  const activeElement = document.activeElement;\n  return isHTMLElement$1(activeElement) && activeElement.tagName === 'LI' && activeElement.parentNode != null &&\n  // @ts-ignore internal field\n  activeElement.parentNode.__lexicalListType === 'check' ? activeElement : null;\n}\nfunction findCheckListItemSibling(node, backward) {\n  let sibling = backward ? node.getPreviousSibling() : node.getNextSibling();\n  let parent = node;\n\n  // Going up in a tree to get non-null sibling\n  while (sibling == null && $isListItemNode(parent)) {\n    // Get li -> parent ul/ol -> parent li\n    parent = parent.getParentOrThrow().getParent();\n    if (parent != null) {\n      sibling = backward ? parent.getPreviousSibling() : parent.getNextSibling();\n    }\n  }\n\n  // Going down in a tree to get first non-nested list item\n  while ($isListItemNode(sibling)) {\n    const firstChild = backward ? sibling.getLastChild() : sibling.getFirstChild();\n    if (!$isListNode(firstChild)) {\n      return sibling;\n    }\n    sibling = backward ? firstChild.getLastChild() : firstChild.getFirstChild();\n  }\n  return null;\n}\nfunction handleArrowUpOrDown(event, editor, backward) {\n  const activeItem = getActiveCheckListItem();\n  if (activeItem != null) {\n    editor.update(() => {\n      const listItem = $getNearestNodeFromDOMNode(activeItem);\n      if (!$isListItemNode(listItem)) {\n        return;\n      }\n      const nextListItem = findCheckListItemSibling(listItem, backward);\n      if (nextListItem != null) {\n        nextListItem.selectStart();\n        const dom = editor.getElementByKey(nextListItem.__key);\n        if (dom != null) {\n          event.preventDefault();\n          setTimeout(() => {\n            dom.focus();\n          }, 0);\n        }\n      }\n    });\n  }\n  return false;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst UPDATE_LIST_START_COMMAND = createCommand('UPDATE_LIST_START_COMMAND');\nconst INSERT_UNORDERED_LIST_COMMAND = createCommand('INSERT_UNORDERED_LIST_COMMAND');\nconst INSERT_ORDERED_LIST_COMMAND = createCommand('INSERT_ORDERED_LIST_COMMAND');\nconst REMOVE_LIST_COMMAND = createCommand('REMOVE_LIST_COMMAND');\nfunction registerList(editor, options) {\n  const removeListener = mergeRegister(editor.registerCommand(INSERT_ORDERED_LIST_COMMAND, () => {\n    $insertList('number');\n    return true;\n  }, COMMAND_PRIORITY_LOW), editor.registerCommand(UPDATE_LIST_START_COMMAND, payload => {\n    const {\n      listNodeKey,\n      newStart\n    } = payload;\n    const listNode = $getNodeByKey(listNodeKey);\n    if (!$isListNode(listNode)) {\n      return false;\n    }\n    if (listNode.getListType() === 'number') {\n      listNode.setStart(newStart);\n      updateChildrenListItemValue(listNode);\n    }\n    return true;\n  }, COMMAND_PRIORITY_LOW), editor.registerCommand(INSERT_UNORDERED_LIST_COMMAND, () => {\n    $insertList('bullet');\n    return true;\n  }, COMMAND_PRIORITY_LOW), editor.registerCommand(REMOVE_LIST_COMMAND, () => {\n    $removeList();\n    return true;\n  }, COMMAND_PRIORITY_LOW), editor.registerCommand(INSERT_PARAGRAPH_COMMAND, () => {\n    const shouldRestore = options && options.restoreNumbering;\n    return $handleListInsertParagraph(!!shouldRestore);\n  }, COMMAND_PRIORITY_LOW), editor.registerNodeTransform(ListItemNode, node => {\n    const firstChild = node.getFirstChild();\n    if (firstChild) {\n      if ($isTextNode(firstChild)) {\n        const style = firstChild.getStyle();\n        const format = firstChild.getFormat();\n        if (node.getTextStyle() !== style) {\n          node.setTextStyle(style);\n        }\n        if (node.getTextFormat() !== format) {\n          node.setTextFormat(format);\n        }\n      }\n    } else {\n      // If it's empty, check the selection\n      const selection = $getSelection();\n      if ($isRangeSelection(selection) && (selection.style !== node.getTextStyle() || selection.format !== node.getTextFormat()) && selection.isCollapsed() && node.is(selection.anchor.getNode())) {\n        node.setTextStyle(selection.style).setTextFormat(selection.format);\n      }\n    }\n  }), editor.registerNodeTransform(TextNode, node => {\n    const listItemParentNode = node.getParent();\n    if ($isListItemNode(listItemParentNode) && node.is(listItemParentNode.getFirstChild())) {\n      const style = node.getStyle();\n      const format = node.getFormat();\n      if (style !== listItemParentNode.getTextStyle() || format !== listItemParentNode.getTextFormat()) {\n        listItemParentNode.setTextStyle(style).setTextFormat(format);\n      }\n    }\n  }));\n  return removeListener;\n}\nfunction registerListStrictIndentTransform(editor) {\n  const $formatListIndentStrict = listItemNode => {\n    const listNode = listItemNode.getParent();\n    if ($isListNode(listItemNode.getFirstChild()) || !$isListNode(listNode)) {\n      return;\n    }\n    const startingListItemNode = $findMatchingParent(listItemNode, node => $isListItemNode(node) && $isListNode(node.getParent()) && $isListItemNode(node.getPreviousSibling()));\n    if (startingListItemNode === null && listItemNode.getIndent() > 0) {\n      listItemNode.setIndent(0);\n    } else if ($isListItemNode(startingListItemNode)) {\n      const prevListItemNode = startingListItemNode.getPreviousSibling();\n      if ($isListItemNode(prevListItemNode)) {\n        const endListItemNode = $findChildrenEndListItemNode(prevListItemNode);\n        const endListNode = endListItemNode.getParent();\n        if ($isListNode(endListNode)) {\n          const prevDepth = $getListDepth(endListNode);\n          const depth = $getListDepth(listNode);\n          if (prevDepth + 1 < depth) {\n            listItemNode.setIndent(prevDepth);\n          }\n        }\n      }\n    }\n  };\n  const $processListWithStrictIndent = listNode => {\n    const queue = [listNode];\n    while (queue.length > 0) {\n      const node = queue.shift();\n      if (!$isListNode(node)) {\n        continue;\n      }\n      for (const child of node.getChildren()) {\n        if ($isListItemNode(child)) {\n          $formatListIndentStrict(child);\n          const firstChild = child.getFirstChild();\n          if ($isListNode(firstChild)) {\n            queue.push(firstChild);\n          }\n        }\n      }\n    }\n  };\n  return editor.registerNodeTransform(ListNode, $processListWithStrictIndent);\n}\nfunction $findChildrenEndListItemNode(listItemNode) {\n  let current = listItemNode;\n  let firstChild = current.getFirstChild();\n  while ($isListNode(firstChild)) {\n    const lastChild = firstChild.getLastChild();\n    if ($isListItemNode(lastChild)) {\n      current = lastChild;\n      firstChild = current.getFirstChild();\n    } else {\n      break;\n    }\n  }\n  return current;\n}\n\n/**\n * @deprecated use {@link $insertList} from an update or command listener.\n *\n * Inserts a new ListNode. If the selection's anchor node is an empty ListItemNode and is a child of\n * the root/shadow root, it will replace the ListItemNode with a ListNode and the old ListItemNode.\n * Otherwise it will replace its parent with a new ListNode and re-insert the ListItemNode and any previous children.\n * If the selection's anchor node is not an empty ListItemNode, it will add a new ListNode or merge an existing ListNode,\n * unless the the node is a leaf node, in which case it will attempt to find a ListNode up the branch and replace it with\n * a new ListNode, or create a new ListNode at the nearest root/shadow root.\n * @param editor - The lexical editor.\n * @param listType - The type of list, \"number\" | \"bullet\" | \"check\".\n */\nfunction insertList(editor, listType) {\n  editor.update(() => $insertList(listType));\n}\n\n/**\n * @deprecated use {@link $removeList} from an update or command listener.\n *\n * Searches for the nearest ancestral ListNode and removes it. If selection is an empty ListItemNode\n * it will remove the whole list, including the ListItemNode. For each ListItemNode in the ListNode,\n * removeList will also generate new ParagraphNodes in the removed ListNode's place. Any child node\n * inside a ListItemNode will be appended to the new ParagraphNodes.\n * @param editor - The lexical editor.\n */\nfunction removeList(editor) {\n  editor.update(() => $removeList());\n}\n/**\n * Configures {@link ListNode}, {@link ListItemNode} and registers\n * the strict indent transform if `hasStrictIndent` is true (default false).\n */\nconst ListExtension = defineExtension({\n  build(editor, config, state) {\n    return namedSignals(config);\n  },\n  config: safeCast({\n    hasStrictIndent: false,\n    shouldPreserveNumbering: false\n  }),\n  name: '@lexical/list/List',\n  nodes: () => [ListNode, ListItemNode],\n  register(editor, config, state) {\n    const stores = state.getOutput();\n    return mergeRegister(effect(() => {\n      return registerList(editor, {\n        restoreNumbering: stores.shouldPreserveNumbering.value\n      });\n    }), effect(() => stores.hasStrictIndent.value ? registerListStrictIndentTransform(editor) : undefined));\n  }\n});\n/**\n * Registers checklist functionality for {@link ListNode} and\n * {@link ListItemNode} with a\n * {@link INSERT_CHECK_LIST_COMMAND} listener and\n * the expected keyboard and mouse interactions for\n * checkboxes.\n */\nconst CheckListExtension = defineExtension({\n  build: (editor, config) => namedSignals(config),\n  config: safeCast({\n    disableTakeFocusOnClick: false\n  }),\n  dependencies: [ListExtension],\n  name: '@lexical/list/CheckList',\n  register: (editor, config, state) => registerCheckList(editor, state.getOutput())\n});\n\nexport { $createListItemNode, $createListNode, $getListDepth, $handleListInsertParagraph, $insertList, $isListItemNode, $isListNode, $removeList, CheckListExtension, INSERT_CHECK_LIST_COMMAND, INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, ListExtension, ListItemNode, ListNode, REMOVE_LIST_COMMAND, UPDATE_LIST_START_COMMAND, insertList, registerCheckList, registerList, registerListStrictIndentTransform, removeList };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalList.dev.mjs';\nimport * as modProd from './LexicalList.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const $createListItemNode = mod.$createListItemNode;\nexport const $createListNode = mod.$createListNode;\nexport const $getListDepth = mod.$getListDepth;\nexport const $handleListInsertParagraph = mod.$handleListInsertParagraph;\nexport const $insertList = mod.$insertList;\nexport const $isListItemNode = mod.$isListItemNode;\nexport const $isListNode = mod.$isListNode;\nexport const $removeList = mod.$removeList;\nexport const CheckListExtension = mod.CheckListExtension;\nexport const INSERT_CHECK_LIST_COMMAND = mod.INSERT_CHECK_LIST_COMMAND;\nexport const INSERT_ORDERED_LIST_COMMAND = mod.INSERT_ORDERED_LIST_COMMAND;\nexport const INSERT_UNORDERED_LIST_COMMAND = mod.INSERT_UNORDERED_LIST_COMMAND;\nexport const ListExtension = mod.ListExtension;\nexport const ListItemNode = mod.ListItemNode;\nexport const ListNode = mod.ListNode;\nexport const REMOVE_LIST_COMMAND = mod.REMOVE_LIST_COMMAND;\nexport const UPDATE_LIST_START_COMMAND = mod.UPDATE_LIST_START_COMMAND;\nexport const insertList = mod.insertList;\nexport const registerCheckList = mod.registerCheckList;\nexport const registerList = mod.registerList;\nexport const registerListStrictIndentTransform = mod.registerListStrictIndentTransform;\nexport const removeList = mod.removeList;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { $insertDataTransferForPlainText, $handlePlainTextDrop, $writeDragSourceToDataTransfer, $getHtmlContent } from '@lexical/clipboard';\nimport { DragonExtension } from '@lexical/dragon';\nimport { $shouldOverrideDefaultCharacterSelection, $moveCharacter } from '@lexical/selection';\nimport { mergeRegister, objectKlassEquals } from '@lexical/utils';\nimport { defineExtension, DELETE_CHARACTER_COMMAND, $getSelection, $isRangeSelection, COMMAND_PRIORITY_EDITOR, DELETE_WORD_COMMAND, DELETE_LINE_COMMAND, CONTROLLED_TEXT_INSERTION_COMMAND, REMOVE_TEXT_COMMAND, INSERT_LINE_BREAK_COMMAND, INSERT_PARAGRAPH_COMMAND, KEY_ARROW_LEFT_COMMAND, KEY_ARROW_RIGHT_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND, KEY_ENTER_COMMAND, SELECT_ALL_COMMAND, $selectAll, COPY_COMMAND, CUT_COMMAND, PASTE_COMMAND, DROP_COMMAND, DRAGSTART_COMMAND, PASTE_TAG } from 'lexical';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst documentMode = CAN_USE_DOM && 'documentMode' in document ? document.documentMode : null;\nconst IS_APPLE = CAN_USE_DOM && /Mac|iPod|iPhone|iPad/.test(navigator.platform);\nconst CAN_USE_BEFORE_INPUT = CAN_USE_DOM && 'InputEvent' in window && !documentMode ? 'getTargetRanges' in new window.InputEvent('input') : false;\nconst IS_IOS = CAN_USE_DOM && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\nconst IS_ANDROID = CAN_USE_DOM && /Android/.test(navigator.userAgent);\n\n// Exclude Android \u2014 Android WebView's UA contains \"Version/X.X ... Safari/537.36\"\n// which falsely matches the Safari regex, activating wrong composition code paths.\nconst IS_SAFARI = CAN_USE_DOM && /Version\\/[\\d.]+.*Safari/.test(navigator.userAgent) && !IS_ANDROID;\n\n// Keep these in case we need to use them in the future.\n// export const IS_WINDOWS: boolean = CAN_USE_DOM && /Win/.test(navigator.platform);\nconst IS_CHROME = CAN_USE_DOM && /^(?=.*Chrome).*/i.test(navigator.userAgent);\nconst IS_APPLE_WEBKIT = CAN_USE_DOM && /AppleWebKit\\/[\\d.]+/.test(navigator.userAgent) && IS_APPLE && !IS_CHROME;\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction onCopyForPlainText(event, editor) {\n  editor.update(() => {\n    if (event !== null) {\n      const clipboardData = objectKlassEquals(event, KeyboardEvent) ? null : event.clipboardData;\n      const selection = $getSelection();\n      if (selection !== null && !selection.isCollapsed() && clipboardData != null) {\n        event.preventDefault();\n        const htmlString = $getHtmlContent(editor);\n        if (htmlString !== null) {\n          clipboardData.setData('text/html', htmlString);\n        }\n        clipboardData.setData('text/plain', selection.getTextContent());\n      }\n    }\n  });\n}\nfunction onPasteForPlainText(event, editor) {\n  event.preventDefault();\n  editor.update(() => {\n    const selection = $getSelection();\n    const clipboardData = objectKlassEquals(event, ClipboardEvent) ? event.clipboardData : null;\n    if (clipboardData != null && $isRangeSelection(selection)) {\n      $insertDataTransferForPlainText(clipboardData, selection);\n    }\n  }, {\n    tag: PASTE_TAG\n  });\n}\nfunction onCutForPlainText(event, editor) {\n  onCopyForPlainText(event, editor);\n  editor.update(() => {\n    const selection = $getSelection();\n    if ($isRangeSelection(selection)) {\n      selection.removeText();\n    }\n  });\n}\nfunction registerPlainText(editor) {\n  const removeListener = mergeRegister(editor.registerCommand(DELETE_CHARACTER_COMMAND, isBackward => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    selection.deleteCharacter(isBackward);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DELETE_WORD_COMMAND, isBackward => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    selection.deleteWord(isBackward);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DELETE_LINE_COMMAND, isBackward => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    selection.deleteLine(isBackward);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(CONTROLLED_TEXT_INSERTION_COMMAND, eventOrText => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    if (typeof eventOrText === 'string') {\n      selection.insertText(eventOrText);\n    } else {\n      const dataTransfer = eventOrText.dataTransfer;\n      if (dataTransfer != null) {\n        $insertDataTransferForPlainText(dataTransfer, selection);\n      } else {\n        const data = eventOrText.data;\n        if (data) {\n          selection.insertText(data);\n        }\n      }\n    }\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(REMOVE_TEXT_COMMAND, () => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    selection.removeText();\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(INSERT_LINE_BREAK_COMMAND, selectStart => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    selection.insertLineBreak(selectStart);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(INSERT_PARAGRAPH_COMMAND, () => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    selection.insertLineBreak();\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_ARROW_LEFT_COMMAND, payload => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    const event = payload;\n    const isHoldingShift = event.shiftKey;\n    if ($shouldOverrideDefaultCharacterSelection(selection, true)) {\n      event.preventDefault();\n      $moveCharacter(selection, isHoldingShift, true);\n      return true;\n    }\n    return false;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_ARROW_RIGHT_COMMAND, payload => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    const event = payload;\n    const isHoldingShift = event.shiftKey;\n    if ($shouldOverrideDefaultCharacterSelection(selection, false)) {\n      event.preventDefault();\n      $moveCharacter(selection, isHoldingShift, false);\n      return true;\n    }\n    return false;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_BACKSPACE_COMMAND, event => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n\n    // Exception handling for iOS native behavior instead of Lexical's behavior when using Korean on iOS devices.\n    // more details - https://github.com/facebook/lexical/issues/5841\n    if (IS_IOS && navigator.language === 'ko-KR') {\n      return false;\n    }\n    event.preventDefault();\n    return editor.dispatchCommand(DELETE_CHARACTER_COMMAND, true);\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_DELETE_COMMAND, event => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    event.preventDefault();\n    return editor.dispatchCommand(DELETE_CHARACTER_COMMAND, false);\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_ENTER_COMMAND, event => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    if (event !== null) {\n      // If we have beforeinput, then we can avoid blocking\n      // the default behavior. This ensures that the iOS can\n      // intercept that we're actually inserting a paragraph,\n      // and autocomplete, autocapitalize etc work as intended.\n      // This can also cause a strange performance issue in\n      // Safari, where there is a noticeable pause due to\n      // preventing the key down of enter.\n      if ((IS_IOS || IS_SAFARI || IS_APPLE_WEBKIT) && CAN_USE_BEFORE_INPUT) {\n        return false;\n      }\n      event.preventDefault();\n    }\n    return editor.dispatchCommand(INSERT_LINE_BREAK_COMMAND, false);\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(SELECT_ALL_COMMAND, () => {\n    $selectAll();\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(COPY_COMMAND, event => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    onCopyForPlainText(event, editor);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(CUT_COMMAND, event => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    onCutForPlainText(event, editor);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(PASTE_COMMAND, event => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    onPasteForPlainText(event, editor);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DROP_COMMAND, event => $handlePlainTextDrop(event, editor), COMMAND_PRIORITY_EDITOR), editor.registerCommand(DRAGSTART_COMMAND, event => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    // Mark the drag source so a drop in a different editor can remove\n    // the source range to produce cut-and-paste semantics.\n    if (!selection.isCollapsed() && event.dataTransfer !== null) {\n      $writeDragSourceToDataTransfer(event.dataTransfer, editor);\n    }\n    return true;\n  }, COMMAND_PRIORITY_EDITOR));\n  return removeListener;\n}\n\n/**\n * An extension to register \\@lexical/plain-text behavior\n */\nconst PlainTextExtension = defineExtension({\n  conflictsWith: ['@lexical/rich-text'],\n  dependencies: [DragonExtension],\n  name: '@lexical/plain-text',\n  register: registerPlainText\n});\n\nexport { PlainTextExtension, registerPlainText };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { LexicalBuilder, getExtensionDependencyFromEditor } from '@lexical/extension';\nimport { $generateHtmlFromNodes, $generateNodesFromDOM } from '@lexical/html';\nimport { $addNodeStyle, $sliceSelectedTextNodeContent } from '@lexical/selection';\nimport { objectKlassEquals } from '@lexical/utils';\nimport { $isRangeSelection, $getSelection, $createTabNode, SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, $caretFromPoint, $isTextPointCaret, $getCaretRange, $getChildCaret, $getRoot, $isTextNode, $isElementNode, $parseSerializedNode, getDOMSelection, COPY_COMMAND, COMMAND_PRIORITY_CRITICAL, isSelectionWithinEditor, $getEditor, defineExtension, shallowMergeConfig, safeCast, $splitAtPointCaretNext, $setSelectionFromCaretRange, $getCollapsedCaretRange, $getNearestNodeFromDOMNode, $getTextPointCaret, $getChildCaretAtIndex, $getCaretRangeInDirection, $caretRangeFromSelection, $comparePointCaretNext } from 'lexical';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n  throw new Error(message);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction caretFromPoint(x, y) {\n  if (typeof document.caretRangeFromPoint !== 'undefined') {\n    const range = document.caretRangeFromPoint(x, y);\n    if (range === null) {\n      return null;\n    }\n    return {\n      node: range.startContainer,\n      offset: range.startOffset\n    };\n    // @ts-ignore\n  } else if (document.caretPositionFromPoint !== 'undefined') {\n    // @ts-ignore FF - no types\n    const range = document.caretPositionFromPoint(x, y);\n    if (range === null) {\n      return null;\n    }\n    return {\n      node: range.offsetNode,\n      offset: range.offset\n    };\n  } else {\n    // Gracefully handle IE\n    return null;\n  }\n}\n\n/**\n * Returns the *currently selected* Lexical content as an HTML string, relying on the\n * logic defined in the exportDOM methods on the LexicalNode classes. Note that\n * this will not return the HTML content of the entire editor (unless all the content is included\n * in the current selection).\n *\n * @param editor - LexicalEditor instance to get HTML content from\n * @param selection - The selection to use (default is $getSelection())\n * @returns a string of HTML content\n */\nfunction $getHtmlContent(editor, selection = $getSelection()) {\n  if (selection == null) {\n    {\n      formatDevErrorMessage(`Expected valid LexicalSelection`);\n    }\n  }\n\n  // If we haven't selected anything\n  if ($isRangeSelection(selection) && selection.isCollapsed() || selection.getNodes().length === 0) {\n    return '';\n  }\n  return $generateHtmlFromNodes(editor, selection);\n}\n\n/**\n * Returns the *currently selected* Lexical content as a JSON string, relying on the\n * logic defined in the exportJSON methods on the LexicalNode classes. Note that\n * this will not return the JSON content of the entire editor (unless all the content is included\n * in the current selection).\n *\n * @param editor  - LexicalEditor instance to get the JSON content from\n * @param selection - The selection to use (default is $getSelection())\n * @returns\n */\nfunction $getLexicalContent(editor, selection = $getSelection()) {\n  if (selection == null) {\n    {\n      formatDevErrorMessage(`Expected valid LexicalSelection`);\n    }\n  }\n\n  // If we haven't selected anything\n  if ($isRangeSelection(selection) && selection.isCollapsed() || selection.getNodes().length === 0) {\n    return null;\n  }\n  return JSON.stringify($generateJSONFromSelectedNodes(editor, selection));\n}\n\n/**\n * Attempts to insert content of the mime-types text/plain or text/uri-list from\n * the provided DataTransfer object into the editor at the provided selection.\n * text/uri-list is only used if text/plain is not also provided.\n *\n * @param dataTransfer an object conforming to the [DataTransfer interface] (https://html.spec.whatwg.org/multipage/dnd.html#the-datatransfer-interface)\n * @param selection the selection to use as the insertion point for the content in the DataTransfer object\n */\nfunction $insertDataTransferForPlainText(dataTransfer, selection) {\n  const text = dataTransfer.getData('text/plain') || dataTransfer.getData('text/uri-list');\n  if (text != null) {\n    selection.insertRawText(text);\n  }\n}\n\n/**\n * Attempts to insert content of the mime-types application/x-lexical-editor, text/html,\n * text/plain, or text/uri-list (in descending order of priority) from the provided DataTransfer\n * object into the editor at the provided selection.\n *\n * @param dataTransfer an object conforming to the [DataTransfer interface] (https://html.spec.whatwg.org/multipage/dnd.html#the-datatransfer-interface)\n * @param selection the selection to use as the insertion point for the content in the DataTransfer object\n * @param editor the LexicalEditor the content is being inserted into.\n */\nfunction $insertDataTransferForRichText(dataTransfer, selection, editor) {\n  const lexicalString = dataTransfer.getData('application/x-lexical-editor');\n  if (lexicalString) {\n    try {\n      const payload = JSON.parse(lexicalString);\n      if (payload.namespace === editor._config.namespace && Array.isArray(payload.nodes)) {\n        const nodes = $generateNodesFromSerializedNodes(payload.nodes);\n        return $insertGeneratedNodes(editor, nodes, selection);\n      }\n    } catch (error) {\n      console.error(error);\n    }\n  }\n  const htmlString = dataTransfer.getData('text/html');\n  const plainString = dataTransfer.getData('text/plain');\n\n  // Skip HTML handling if it matches the plain text representation.\n  // This avoids unnecessary processing for plain text strings created by\n  // iOS Safari autocorrect, which incorrectly includes a `text/html` type.\n  if (htmlString && plainString !== htmlString) {\n    try {\n      const parser = new DOMParser();\n      const dom = parser.parseFromString(trustHTML(htmlString), 'text/html');\n      const nodes = $generateNodesFromDOM(editor, dom);\n      return $insertGeneratedNodes(editor, nodes, selection);\n    } catch (error) {\n      console.error(error);\n    }\n  }\n\n  // Multi-line plain text in rich text mode pasted as separate paragraphs\n  // instead of single paragraph with linebreaks.\n  // Webkit-specific: Supports read 'text/uri-list' in clipboard.\n  const text = plainString || dataTransfer.getData('text/uri-list');\n  if (text != null) {\n    if ($isRangeSelection(selection)) {\n      const parts = text.split(/(\\r?\\n|\\t)/);\n      if (parts[parts.length - 1] === '') {\n        parts.pop();\n      }\n      for (let i = 0; i < parts.length; i++) {\n        const currentSelection = $getSelection();\n        if ($isRangeSelection(currentSelection)) {\n          const part = parts[i];\n          if (part === '\\n' || part === '\\r\\n') {\n            currentSelection.insertParagraph();\n          } else if (part === '\\t') {\n            currentSelection.insertNodes([$createTabNode()]);\n          } else {\n            currentSelection.insertText(part);\n          }\n        }\n      }\n    } else {\n      selection.insertRawText(text);\n    }\n  }\n}\nconst LEXICAL_DRAG_MIME_TYPE = 'application/x-lexical-drag';\n/**\n * Populate `dataTransfer` with a marker identifying the current editor as a\n * drag source. Pair this with {@link $handleRichTextDrop} or\n * {@link $handlePlainTextDrop} on the drop side to get cut-and-paste semantics\n * for drags that end in a different editor.\n *\n * Only the source editor's key needs to round-trip \u2014 the source's\n * RangeSelection itself is preserved on the source editor between drag start\n * and drop (Lexical suppresses selectionchange during drag), so the drop\n * handler reads it directly via `$getSelection()` on the resolved source\n * editor.\n *\n * Callers typically invoke this from a DRAGSTART_COMMAND handler alongside\n * {@link setLexicalClipboardDataTransfer} (so that the dragged content itself\n * round-trips with full node fidelity).\n */\nfunction $writeDragSourceToDataTransfer(dataTransfer, editor) {\n  const marker = {\n    editorKey: editor.getKey()\n  };\n  dataTransfer.setData(LEXICAL_DRAG_MIME_TYPE, JSON.stringify(marker));\n}\nfunction isLexicalDragMarker(value) {\n  return value !== null && typeof value === 'object' && 'editorKey' in value && typeof value.editorKey === 'string';\n}\nfunction readDragMarker(dataTransfer) {\n  const raw = dataTransfer.getData(LEXICAL_DRAG_MIME_TYPE);\n  if (!raw) {\n    return null;\n  }\n  let parsed;\n  try {\n    parsed = JSON.parse(raw);\n  } catch (_unused) {\n    return null;\n  }\n  return isLexicalDragMarker(parsed) ? parsed : null;\n}\nfunction findEditorRootByKey(key, doc) {\n  const elements = doc.querySelectorAll('[data-lexical-editor=\"true\"]');\n  for (const el of Array.from(elements)) {\n    const editor = el.__lexicalEditor;\n    if (editor && editor.getKey() === key) {\n      return el;\n    }\n  }\n  return null;\n}\nfunction $resolveDropPointCaret(event) {\n  const hit = caretFromPoint(event.clientX, event.clientY);\n  if (hit === null) {\n    return null;\n  }\n  const node = $getNearestNodeFromDOMNode(hit.node);\n  if (node === null) {\n    return null;\n  }\n  if ($isTextNode(node)) {\n    return $getTextPointCaret(node, 'next', hit.offset);\n  }\n  if ($isElementNode(node)) {\n    return $getChildCaretAtIndex(node, hit.offset, 'next');\n  }\n  const parent = node.getParent();\n  if (parent === null) {\n    return null;\n  }\n  return $getChildCaretAtIndex(parent, node.getIndexWithinParent() + 1, 'next');\n}\nfunction $isDropCaretInsideSelection(dropCaret, selection) {\n  const {\n    anchor: start,\n    focus: end\n  } = $getCaretRangeInDirection($caretRangeFromSelection(selection), 'next');\n  return $comparePointCaretNext(start, dropCaret) < 0 && $comparePointCaretNext(dropCaret, end) < 0;\n}\nfunction $doDrop(event, editor, $insertDataTransfer) {\n  const dataTransfer = event.dataTransfer;\n  if (dataTransfer === null) {\n    return false;\n  }\n\n  // Drags that didn't originate in a Lexical editor (no marker) fall through\n  // to the browser's native drag-and-drop flow; its beforeinput\n  // insertFromDrop is already handled correctly by Lexical's existing\n  // beforeinput logic.\n  const marker = readDragMarker(dataTransfer);\n  if (marker === null) {\n    return false;\n  }\n  const dropCaret = $resolveDropPointCaret(event);\n  if (dropCaret === null) {\n    return false;\n  }\n\n  // Split at the drop caret so we have a stable NodeCaret boundary that\n  // survives text-content mutations in its siblings.\n  const stableDropCaret = $splitAtPointCaretNext(dropCaret);\n  if (stableDropCaret === null) {\n    return false;\n  }\n  const isSameEditorDrag = marker.editorKey === editor.getKey();\n  const currentSelection = $getSelection();\n  if (isSameEditorDrag) {\n    // Same-editor drag: the destination's $getSelection() is the still-\n    // selected dragged range, so Lexical's beforeinput handler would skip\n    // applyDOMRange and route the insert to the source's location instead\n    // of the drop point. Remove the dragged range ourselves, then insert\n    // at the stable drop caret.\n    if (!$isRangeSelection(currentSelection) || currentSelection.isCollapsed()) {\n      return false;\n    }\n    if ($isDropCaretInsideSelection(dropCaret, currentSelection)) {\n      event.preventDefault();\n      return true;\n    }\n    currentSelection.removeText();\n  }\n\n  // If the drop caret's origin was swept away by the source removal, abort \u2014\n  // this can happen on a same-editor drag whose range covered the entire\n  // text node we tried to split at.\n  if (!stableDropCaret.origin.isAttached()) {\n    event.preventDefault();\n    return true;\n  }\n  const dropSelection = $setSelectionFromCaretRange($getCollapsedCaretRange(stableDropCaret));\n  $insertDataTransfer(dataTransfer, dropSelection, editor);\n  if (!isSameEditorDrag) {\n    // Cross-editor drag. The native drag-out deletion that the browser\n    // would normally fire (beforeinput deleteByDrag on the source) isn't\n    // reliable when the source is a nested contenteditable of the\n    // destination (e.g. an image caption inside the main editor), so we\n    // dispatch it ourselves at the source editor's root. The source\n    // editor's own beforeinput handler runs the deletion through its own\n    // REMOVE_TEXT_COMMAND and SKIP_SELECTION_FOCUS_TAG path.\n    const rootElement = editor.getRootElement();\n    const doc = rootElement ? rootElement.ownerDocument : null;\n    const sourceRoot = doc ? findEditorRootByKey(marker.editorKey, doc) : null;\n    if (sourceRoot !== null) {\n      sourceRoot.dispatchEvent(new InputEvent('beforeinput', {\n        bubbles: true,\n        cancelable: true,\n        inputType: 'deleteByDrag'\n      }));\n    }\n  }\n  event.preventDefault();\n  return true;\n}\n\n/**\n * Drop handler for rich-text editors. Inserts the DataTransfer payload via\n * {@link $insertDataTransferForRichText} at the drop caret and, when the drag\n * originated from a Lexical editor (marked via\n * {@link $writeDragSourceToDataTransfer} on DRAGSTART), removes the source\n * range \u2014 producing cut-and-paste semantics whether the drop is in the same\n * editor or a different one on the same page.\n */\nfunction $handleRichTextDrop(event, editor) {\n  return $doDrop(event, editor, $insertDataTransferForRichText);\n}\n\n/**\n * Drop handler for plain-text editors. Same semantics as\n * {@link $handleRichTextDrop} but inserts via\n * {@link $insertDataTransferForPlainText}.\n */\nfunction $handlePlainTextDrop(event, editor) {\n  return $doDrop(event, editor, (dataTransfer, selection) => $insertDataTransferForPlainText(dataTransfer, selection));\n}\nfunction trustHTML(html) {\n  if (window.trustedTypes && window.trustedTypes.createPolicy) {\n    const policy = window.trustedTypes.createPolicy('lexical', {\n      createHTML: input => input\n    });\n    return policy.createHTML(html);\n  }\n  return html;\n}\n\n/**\n * Inserts Lexical nodes into the editor using different strategies depending on\n * some simple selection-based heuristics. If you're looking for a generic way to\n * to insert nodes into the editor at a specific selection point, you probably want\n * {@link lexical.$insertNodes}\n *\n * @param editor LexicalEditor instance to insert the nodes into.\n * @param nodes The nodes to insert.\n * @param selection The selection to insert the nodes into.\n */\nfunction $insertGeneratedNodes(editor, nodes, selection) {\n  if (!editor.dispatchCommand(SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, {\n    nodes,\n    selection\n  })) {\n    selection.insertNodes(nodes);\n    $updateSelectionOnInsert(selection);\n  }\n  return;\n}\nfunction $updateSelectionOnInsert(selection) {\n  if ($isRangeSelection(selection) && selection.isCollapsed()) {\n    const anchor = selection.anchor;\n    let nodeToInspect = null;\n    const anchorCaret = $caretFromPoint(anchor, 'previous');\n    if (anchorCaret) {\n      if ($isTextPointCaret(anchorCaret)) {\n        nodeToInspect = anchorCaret.origin;\n      } else {\n        const range = $getCaretRange(anchorCaret, $getChildCaret($getRoot(), 'next').getFlipped());\n        for (const caret of range) {\n          if ($isTextNode(caret.origin)) {\n            nodeToInspect = caret.origin;\n            break;\n          } else if ($isElementNode(caret.origin) && !caret.origin.isInline()) {\n            break;\n          }\n        }\n      }\n    }\n    if (nodeToInspect && $isTextNode(nodeToInspect)) {\n      const newFormat = nodeToInspect.getFormat();\n      const newStyle = nodeToInspect.getStyle();\n      if (selection.format !== newFormat || selection.style !== newStyle) {\n        selection.format = newFormat;\n        selection.style = newStyle;\n        selection.dirty = true;\n      }\n    }\n  }\n}\nfunction exportNodeToJSON(node) {\n  const serializedNode = node.exportJSON();\n  const nodeClass = node.constructor;\n  if (serializedNode.type !== nodeClass.getType()) {\n    {\n      formatDevErrorMessage(`LexicalNode: Node ${nodeClass.name} does not implement .exportJSON().`);\n    }\n  }\n  if ($isElementNode(node)) {\n    const serializedChildren = serializedNode.children;\n    if (!Array.isArray(serializedChildren)) {\n      {\n        formatDevErrorMessage(`LexicalNode: Node ${nodeClass.name} is an element but .exportJSON() does not have a children array.`);\n      }\n    }\n  }\n  return serializedNode;\n}\nfunction $appendNodesToJSON(editor, selection, currentNode, targetArray = []) {\n  let shouldInclude = selection !== null ? currentNode.isSelected(selection) : true;\n  const shouldExclude = $isElementNode(currentNode) && currentNode.excludeFromCopy('html');\n  let target = currentNode;\n  if (selection !== null && $isTextNode(target)) {\n    target = $sliceSelectedTextNodeContent(selection, target, 'clone');\n  }\n  const children = $isElementNode(target) ? target.getChildren() : [];\n  const serializedNode = exportNodeToJSON(target);\n  if ($isTextNode(target) && target.getTextContentSize() === 0) {\n    // If an uncollapsed selection ends or starts at the end of a line of specialized,\n    // TextNodes, such as code tokens, we will get a 'blank' TextNode here, i.e., one\n    // with text of length 0. We don't want this, it makes a confusing mess. Reset!\n    shouldInclude = false;\n  }\n  for (let i = 0; i < children.length; i++) {\n    const childNode = children[i];\n    const shouldIncludeChild = $appendNodesToJSON(editor, selection, childNode, serializedNode.children);\n    if (!shouldInclude && $isElementNode(currentNode) && shouldIncludeChild && currentNode.extractWithChild(childNode, selection, 'clone')) {\n      shouldInclude = true;\n    }\n  }\n  if (shouldInclude && !shouldExclude) {\n    targetArray.push(serializedNode);\n  } else if (Array.isArray(serializedNode.children)) {\n    for (let i = 0; i < serializedNode.children.length; i++) {\n      const serializedChildNode = serializedNode.children[i];\n      targetArray.push(serializedChildNode);\n    }\n  }\n  return shouldInclude;\n}\n\n// TODO why $ function with Editor instance?\n/**\n * Gets the Lexical JSON of the nodes inside the provided Selection.\n *\n * @param editor LexicalEditor to get the JSON content from.\n * @param selection Selection to get the JSON content from.\n * @returns an object with the editor namespace and a list of serializable nodes as JavaScript objects.\n */\nfunction $generateJSONFromSelectedNodes(editor, selection) {\n  const nodes = [];\n  const root = $getRoot();\n  const topLevelChildren = root.getChildren();\n  for (let i = 0; i < topLevelChildren.length; i++) {\n    const topLevelNode = topLevelChildren[i];\n    $appendNodesToJSON(editor, selection, topLevelNode, nodes);\n  }\n  return {\n    namespace: editor._config.namespace,\n    nodes\n  };\n}\n\n/**\n * This method takes an array of objects conforming to the BaseSerializedNode interface and returns\n * an Array containing instances of the corresponding LexicalNode classes registered on the editor.\n * Normally, you'd get an Array of BaseSerialized nodes from {@link $generateJSONFromSelectedNodes}\n *\n * @param serializedNodes an Array of objects conforming to the BaseSerializedNode interface.\n * @returns an Array of Lexical Node objects.\n */\nfunction $generateNodesFromSerializedNodes(serializedNodes) {\n  const nodes = [];\n  for (let i = 0; i < serializedNodes.length; i++) {\n    const serializedNode = serializedNodes[i];\n    const node = $parseSerializedNode(serializedNode);\n    if ($isTextNode(node)) {\n      $addNodeStyle(node);\n    }\n    nodes.push(node);\n  }\n  return nodes;\n}\nconst EVENT_LATENCY = 50;\nlet clipboardEventTimeout = null;\n\n// TODO custom selection\n// TODO potentially have a node customizable version for plain text\n/**\n * Copies the content of the current selection to the clipboard in\n * text/plain, text/html, and application/x-lexical-editor (Lexical JSON)\n * formats.\n *\n * @param editor the LexicalEditor instance to copy content from\n * @param event the native browser ClipboardEvent to add the content to.\n * @returns\n */\nasync function copyToClipboard(editor, event, data) {\n  if (clipboardEventTimeout !== null) {\n    // Prevent weird race conditions that can happen when this function is run multiple times\n    // synchronously. In the future, we can do better, we can cancel/override the previously running job.\n    return false;\n  }\n  if (event !== null) {\n    return new Promise((resolve, reject) => {\n      editor.update(() => {\n        resolve($copyToClipboardEvent(editor, event, data));\n      });\n    });\n  }\n  const rootElement = editor.getRootElement();\n  const editorWindow = editor._window || window;\n  const windowDocument = editorWindow.document;\n  const domSelection = getDOMSelection(editorWindow);\n  if (rootElement === null || domSelection === null) {\n    return false;\n  }\n  const element = windowDocument.createElement('span');\n  element.style.position = 'fixed';\n  element.style.top = '-1000px';\n  element.append(windowDocument.createTextNode('#'));\n  rootElement.append(element);\n  const range = new Range();\n  range.setStart(element, 0);\n  range.setEnd(element, 1);\n  domSelection.removeAllRanges();\n  domSelection.addRange(range);\n  return new Promise((resolve, reject) => {\n    const removeListener = editor.registerCommand(COPY_COMMAND, secondEvent => {\n      if (objectKlassEquals(secondEvent, ClipboardEvent)) {\n        removeListener();\n        if (clipboardEventTimeout !== null) {\n          editorWindow.clearTimeout(clipboardEventTimeout);\n          clipboardEventTimeout = null;\n        }\n        resolve($copyToClipboardEvent(editor, secondEvent, data));\n      }\n      // Block the entire copy flow while we wait for the next ClipboardEvent\n      return true;\n    }, COMMAND_PRIORITY_CRITICAL);\n    // If the above hack execCommand hack works, this timeout code should never fire. Otherwise,\n    // the listener will be quickly freed so that the user can reuse it again\n    clipboardEventTimeout = editorWindow.setTimeout(() => {\n      removeListener();\n      clipboardEventTimeout = null;\n      resolve(false);\n    }, EVENT_LATENCY);\n    windowDocument.execCommand('copy');\n    element.remove();\n  });\n}\n\n// TODO shouldn't pass editor (pass namespace directly)\nfunction $copyToClipboardEvent(editor, event, data) {\n  if (data === undefined) {\n    const domSelection = getDOMSelection(editor._window);\n    const selection = $getSelection();\n    if (!selection || selection.isCollapsed()) {\n      return false;\n    }\n    if (!domSelection) {\n      return false;\n    }\n    const anchorDOM = domSelection.anchorNode;\n    const focusDOM = domSelection.focusNode;\n    if (anchorDOM !== null && focusDOM !== null && !isSelectionWithinEditor(editor, anchorDOM, focusDOM)) {\n      return false;\n    }\n    data = $getClipboardDataFromSelection(selection);\n  }\n  event.preventDefault();\n  const clipboardData = event.clipboardData;\n  if (clipboardData === null) {\n    return false;\n  }\n  setLexicalClipboardDataTransfer(clipboardData, data);\n  return true;\n}\nconst clipboardDataFunctions = [['text/html', $getHtmlContent], ['application/x-lexical-editor', $getLexicalContent]];\n\n/**\n * Serialize the content of the current selection to strings in\n * text/plain, text/html, and application/x-lexical-editor (Lexical JSON)\n * formats (as available).\n *\n * @param selection the selection to serialize (defaults to $getSelection())\n * @returns LexicalClipboardData\n */\nfunction $getClipboardDataFromSelection(selection = $getSelection()) {\n  return $getClipboardDataWithConfigFromSelection($getExportConfig(), selection);\n}\n\n/**\n * Call setData on the given clipboardData for each MIME type present\n * in the given data (from {@link $getClipboardDataFromSelection})\n *\n * @param clipboardData the event.clipboardData to populate from data\n * @param data The lexical data\n */\nfunction setLexicalClipboardDataTransfer(clipboardData, data) {\n  for (const [k] of clipboardDataFunctions) {\n    if (data[k] === undefined) {\n      clipboardData.setData(k, '');\n    }\n  }\n  for (const k in data) {\n    const v = data[k];\n    if (v !== undefined) {\n      clipboardData.setData(k, v);\n    }\n  }\n}\nfunction $getExportConfig() {\n  const editor = $getEditor();\n  const builder = LexicalBuilder.maybeFromEditor(editor);\n  if (builder && builder.hasExtensionByName(GetClipboardDataExtension.name)) {\n    return getExtensionDependencyFromEditor(editor, GetClipboardDataExtension).output;\n  }\n  return DEFAULT_EXPORT_MIME_TYPE;\n}\nconst DEFAULT_EXPORT_MIME_TYPE = {\n  'application/x-lexical-editor': [(sel, next) => sel ? $getLexicalContent($getEditor(), sel) : next()],\n  'text/html': [(sel, next) => sel ? $getHtmlContent($getEditor(), sel) : next()],\n  'text/plain': [(sel, next) => sel ? sel.getTextContent() : next()]\n};\nfunction $getClipboardDataWithConfigFromSelection($exportMimeType, selection) {\n  const clipboardData = {\n    'text/plain': ''\n  };\n  for (const [k, fns] of Object.entries($exportMimeType)) {\n    const v = callExportMimeTypeFunctionStack(fns, selection);\n    if (v !== null) {\n      clipboardData[k] = v;\n    }\n  }\n  return clipboardData;\n}\nfunction callExportMimeTypeFunctionStack(fns, selection) {\n  const callAt = i => fns[i] ? fns[i](selection, callAt.bind(null, i - 1)) : null;\n  return callAt(fns.length - 1);\n}\nconst GetClipboardDataExtension = defineExtension({\n  build(editor, config, state) {\n    return config.$exportMimeType;\n  },\n  config: safeCast({\n    $exportMimeType: DEFAULT_EXPORT_MIME_TYPE\n  }),\n  mergeConfig(config, partial) {\n    const merged = shallowMergeConfig(config, partial);\n    if (partial.$exportMimeType) {\n      const $exportMimeType = {\n        ...config.$exportMimeType\n      };\n      for (const [k, v] of Object.entries(partial.$exportMimeType)) {\n        $exportMimeType[k] = [...$exportMimeType[k], ...v];\n      }\n      merged.$exportMimeType = $exportMimeType;\n    }\n    return merged;\n  },\n  name: '@lexical/clipboard/GetClipboardData'\n});\n\nexport { $generateJSONFromSelectedNodes, $generateNodesFromSerializedNodes, $getClipboardDataFromSelection, $getHtmlContent, $getLexicalContent, $handlePlainTextDrop, $handleRichTextDrop, $insertDataTransferForPlainText, $insertDataTransferForRichText, $insertGeneratedNodes, $writeDragSourceToDataTransfer, copyToClipboard, setLexicalClipboardDataTransfer };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { $sliceSelectedTextNodeContent } from '@lexical/selection';\nimport { $getEditor, createState, DEFAULT_EDITOR_DOM_CONFIG, $isLexicalNode, getStaticNodeConfig, defineExtension, shallowMergeConfig, RootNode, $getRoot, $getEditorDOMRenderConfig, isDOMDocumentNode, $isTextNode, $isElementNode, isHTMLElement, isDocumentFragment, $isRootOrShadowRoot, $isBlockElementNode, isBlockDomNode, $createLineBreakNode, ArtificialNode__DO_NOT_USE, isInlineDomNode, $createParagraphNode } from 'lexical';\nimport { getKnownTypesAndNodes, LexicalBuilder, getExtensionDependencyFromEditor } from '@lexical/extension';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n  throw new Error(message);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nlet activeContext;\n\n/**\n * @experimental\n *\n * The LexicalEditor with context\n */\n\n/**\n * @experimental\n *\n * @param contextRecord The ContextRecord\n * @param cfg The configuration\n * @returns The value or defaultValue of cfg\n */\nfunction getContextValue(contextRecord, cfg) {\n  const {\n    key\n  } = cfg;\n  return contextRecord && key in contextRecord ? contextRecord[key] : cfg.defaultValue;\n}\nfunction getEditorContext(editor) {\n  return activeContext && activeContext.editor === editor ? activeContext : undefined;\n}\n\n/**\n * @experimental\n *\n * @param sym The symbol for this ContextRecord (e.g. DOMRenderContextSymbol)\n * @param editor The editor\n * @returns The current context or undefined\n */\nfunction getContextRecord(sym, editor) {\n  const editorContext = getEditorContext(editor);\n  return editorContext && editorContext[sym];\n}\nfunction toPair(contextRecord, pairOrUpdater) {\n  if ('cfg' in pairOrUpdater) {\n    const {\n      cfg,\n      updater\n    } = pairOrUpdater;\n    return [cfg, updater(getContextValue(contextRecord, cfg))];\n  }\n  return pairOrUpdater;\n}\n\n/**\n * Construct a new context from a parent context and pairs\n *\n * @param pairs The pairs and updaters to build the context from\n * @param parent The parent context\n * @returns The new context\n */\nfunction contextFromPairs(pairs, parent) {\n  let rval = parent;\n  for (const pairOrUpdater of pairs) {\n    const [k, v] = toPair(rval, pairOrUpdater);\n    const key = k.key;\n    if (rval === parent && getContextValue(rval, k) === v) {\n      continue;\n    }\n    const ctx = rval || createChildContext(parent);\n    ctx[key] = v;\n    rval = ctx;\n  }\n  return rval;\n}\nfunction createChildContext(parent) {\n  return Object.create(parent || null);\n}\n\n/**\n * Create a context config pair that sets a value in the render context.\n * @experimental\n */\nfunction contextValue(cfg, value) {\n  return [cfg, value];\n}\n\n/**\n * Create a context config updater that transforms a value in the render context.\n * @experimental\n */\nfunction contextUpdater(cfg, updater) {\n  return {\n    cfg,\n    updater\n  };\n}\n\n/**\n * @internal\n * @experimental\n * @__NO_SIDE_EFFECTS__\n */\nfunction $withFullContext(sym, contextRecord, f, editor = $getEditor()) {\n  const prevDOMContext = activeContext;\n  const parentEditorContext = getEditorContext(editor);\n  try {\n    activeContext = {\n      ...parentEditorContext,\n      editor,\n      [sym]: contextRecord\n    };\n    return f();\n  } finally {\n    activeContext = prevDOMContext;\n  }\n}\n\n/**\n * @internal\n * @experimental\n * @__NO_SIDE_EFFECTS__\n */\nfunction $withContext(sym, $defaults = () => undefined) {\n  return (cfg, editor = $getEditor()) => {\n    return f => {\n      const parentEditorContext = getEditorContext(editor);\n      const parentContextRecord = parentEditorContext && parentEditorContext[sym];\n      const contextRecord = contextFromPairs(cfg, parentContextRecord || $defaults(editor));\n      if (!contextRecord || contextRecord === parentContextRecord) {\n        return f();\n      }\n      return $withFullContext(sym, contextRecord, f, editor);\n    };\n  };\n}\n\n/**\n * @experimental\n * @internal\n * @__NO_SIDE_EFFECTS__\n */\nfunction createContextState(tag, name, getDefaultValue, isEqual) {\n  return Object.assign(createState(Symbol(name), {\n    isEqual,\n    parse: getDefaultValue\n  }), {\n    [tag]: true\n  });\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\nconst DOMRenderExtensionName = '@lexical/html/DOM';\nconst DOMRenderContextSymbol = Symbol.for('@lexical/html/DOMExportContext');\nconst ALWAYS_TRUE = () => true;\n\nfunction buildTypeTree(editorConfig) {\n  const t = {};\n  const {\n    nodes\n  } = getKnownTypesAndNodes(editorConfig);\n  for (const klass of nodes) {\n    const type = klass.getType();\n    t[type] = {\n      klass,\n      types: {}\n    };\n  }\n  for (const baseRec of Object.values(t)) {\n    if (baseRec) {\n      const baseType = baseRec.klass.getType();\n      for (let {\n        klass\n      } = baseRec; $isLexicalNode(klass.prototype); klass = Object.getPrototypeOf(klass)) {\n        const {\n          ownNodeType\n        } = getStaticNodeConfig(klass);\n        const superRec = ownNodeType && t[ownNodeType];\n        if (superRec) {\n          superRec.types[baseType] = true;\n        }\n      }\n    }\n  }\n  return t;\n}\nfunction buildNodePredicate(klass) {\n  return node => node instanceof klass;\n}\nfunction getPredicate(typeTree, {\n  nodes\n}) {\n  if (nodes === '*') {\n    return ALWAYS_TRUE;\n  }\n  let types = {};\n  const predicates = [];\n  for (const klassOrPredicate of nodes) {\n    if ('getType' in klassOrPredicate) {\n      const type = klassOrPredicate.getType();\n      if (types) {\n        const tree = typeTree[type];\n        if (!(tree !== undefined)) {\n          formatDevErrorMessage(`Node class ${klassOrPredicate.name} with type ${type} not registered in editor`);\n        }\n        types = Object.assign(types, tree.types);\n      }\n      predicates.push(buildNodePredicate(klassOrPredicate));\n    } else {\n      types = undefined;\n      predicates.push(klassOrPredicate);\n    }\n  }\n  if (types) {\n    return types;\n  } else if (predicates.length === 1) {\n    return predicates[0];\n  }\n  return node => {\n    for (const predicate of predicates) {\n      if (predicate(node)) {\n        return true;\n      }\n    }\n    return false;\n  };\n}\nfunction makePrerender() {\n  return {\n    $createDOM: [],\n    $decorateDOM: [],\n    $exportDOM: [],\n    $extractWithChild: [],\n    $getDOMSlot: [],\n    $shouldExclude: [],\n    $shouldInclude: [],\n    $updateDOM: []\n  };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\nfunction ignoreNext2(acc) {\n  return (node, _$next, editor) => acc(node, editor);\n}\nfunction ignoreNext3(acc) {\n  return (node, a, _$next, editor) => acc(node, a, editor);\n}\nfunction ignoreNext4(acc) {\n  return (node, a, b, _$next, editor) => acc(node, a, b, editor);\n}\nfunction ignoreNext5(acc) {\n  return (node, a, b, c, _$next, editor) => acc(node, a, b, c, editor);\n}\nfunction merge2($acc, $getOverride) {\n  return (node, editor) => {\n    const $next = () => $acc(node, editor);\n    const $override = $getOverride(node);\n    return $override ? $override(node, $next, editor) : $next();\n  };\n}\nfunction merge3(acc, $getOverride) {\n  return (node, a, editor) => {\n    const $next = () => acc(node, a, editor);\n    const $override = $getOverride(node);\n    return $override ? $override(node, a, $next, editor) : $next();\n  };\n}\nfunction merge4($acc, $getOverride) {\n  return (node, a, b, editor) => {\n    const $next = () => $acc(node, a, b, editor);\n    const $override = $getOverride(node);\n    return $override ? $override(node, a, b, $next, editor) : $next();\n  };\n}\nfunction merge5(acc, $getOverride) {\n  return (node, a, b, c, editor) => {\n    const $next = () => acc(node, a, b, c, editor);\n    const $override = $getOverride(node);\n    return $override ? $override(node, a, b, c, $next, editor) : $next();\n  };\n}\nfunction sequence4($acc, $getOverride) {\n  return (node, a, b, editor) => {\n    $acc(node, a, b, editor);\n    const $override = $getOverride(node);\n    if ($override) {\n      $override(node, a, b, editor);\n    }\n  };\n}\nfunction compilePrerenderKey(prerender, k, defaults, mergeFunction, ignoreNextFunction) {\n  let acc = defaults[k];\n  for (const pair of prerender[k]) {\n    if (typeof pair[0] === 'function') {\n      const [$predicate, $override] = pair;\n      acc = mergeFunction(acc, node => $predicate(node) && $override || undefined);\n    } else {\n      const typeOverrides = pair[1];\n      const compiled = {};\n      for (const type in typeOverrides) {\n        const arr = typeOverrides[type];\n        if (arr) {\n          compiled[type] = arr.reduce(($acc, $override) => mergeFunction($acc, () => $override), acc);\n        }\n      }\n      acc = mergeFunction(acc, node => {\n        const f = compiled[node.getType()];\n        return f && ignoreNextFunction(f);\n      });\n    }\n  }\n  defaults[k] = acc;\n}\nfunction addOverride(prerender, k, predicateOrTypes, override) {\n  if (!override) {\n    return;\n  }\n  const arr = prerender[k];\n  if (typeof predicateOrTypes === 'function') {\n    arr.push([predicateOrTypes, override]);\n  } else {\n    const last = arr[arr.length - 1];\n    let types;\n    if (last && last[0] === 'types') {\n      types = last[1];\n    } else {\n      types = {};\n      arr.push(['types', types]);\n    }\n    for (const type in predicateOrTypes) {\n      const typeArr = types[type] || [];\n      types[type] = typeArr;\n      typeArr.push(override);\n    }\n  }\n}\nfunction isWildcard(override) {\n  return override.nodes === '*';\n}\nfunction sortedOverrides(overrides) {\n  const byWildcard = [];\n  const byPredicate = [];\n  const byNode = [];\n  for (const override of overrides) {\n    if (isWildcard(override)) {\n      byWildcard.push(override);\n    } else if (Array.isArray(override.nodes)) {\n      for (const klassOrPredicate of override.nodes) {\n        if ($isLexicalNode(klassOrPredicate.prototype)) {\n          byNode.push(override.nodes.length === 1 ? override : {\n            ...override,\n            nodes: [klassOrPredicate]\n          });\n        } else {\n          byPredicate.push(override.nodes.length === 1 ? override : {\n            ...override,\n            nodes: [klassOrPredicate]\n          });\n        }\n      }\n    }\n  }\n  const depths = new Map();\n  const depthOf = klass => {\n    let depth = depths.get(klass);\n    if (depth === undefined) {\n      depth = 0;\n      for (let k = klass; $isLexicalNode(k.prototype); k = Object.getPrototypeOf(k)) {\n        depth++;\n      }\n      depths.set(klass, depth);\n    }\n    return depth;\n  };\n  byNode.sort((a, b) => depthOf(a.nodes[0]) - depthOf(b.nodes[0]));\n  return [...byNode, ...byPredicate, ...byWildcard];\n}\nfunction precompileDOMRenderConfigOverrides(editorConfig, overrides) {\n  const typeTree = buildTypeTree(editorConfig);\n  const prerender = makePrerender();\n  for (const override of sortedOverrides(overrides)) {\n    const predicateOrTypes = getPredicate(typeTree, override);\n    for (const k_ in prerender) {\n      const k = k_;\n      addOverride(prerender, k, predicateOrTypes, override[k]);\n    }\n  }\n  return prerender;\n}\nfunction identity(v) {\n  return v;\n}\nfunction compileDOMRenderConfigOverrides(editorConfig, {\n  overrides\n}) {\n  const prerender = precompileDOMRenderConfigOverrides(editorConfig, overrides);\n  const dom = {\n    ...DEFAULT_EDITOR_DOM_CONFIG,\n    ...editorConfig.dom\n  };\n  compilePrerenderKey(prerender, '$createDOM', dom, merge2, ignoreNext2);\n  compilePrerenderKey(prerender, '$exportDOM', dom, merge2, ignoreNext2);\n  compilePrerenderKey(prerender, '$extractWithChild', dom, merge5, ignoreNext5);\n  compilePrerenderKey(prerender, '$getDOMSlot', dom, merge3, ignoreNext3);\n  compilePrerenderKey(prerender, '$shouldExclude', dom, merge3, ignoreNext3);\n  compilePrerenderKey(prerender, '$shouldInclude', dom, merge3, ignoreNext3);\n  compilePrerenderKey(prerender, '$updateDOM', dom, merge4, ignoreNext4);\n  compilePrerenderKey(prerender, '$decorateDOM', dom, sequence4, identity);\n  return dom;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n/**\n * @experimental\n *\n * An extension that allows overriding the render and export behavior for an\n * editor. This is highly experimental and subject to change from one version\n * to the next.\n **/\nconst DOMRenderExtension = defineExtension({\n  build(editor, config, state) {\n    return {\n      defaults: contextFromPairs(config.contextDefaults, undefined)\n    };\n  },\n  config: {\n    contextDefaults: [],\n    overrides: []\n  },\n  html: {\n    // Define a RootNode export for $generateDOMFromRoot\n    export: new Map([[RootNode, () => {\n      const element = document.createElement('div');\n      element.role = 'textbox';\n      return {\n        element\n      };\n    }]])\n  },\n  init(editorConfig, config) {\n    editorConfig.dom = compileDOMRenderConfigOverrides(editorConfig, config);\n  },\n  mergeConfig(config, partial) {\n    const merged = shallowMergeConfig(config, partial);\n    for (const k of ['overrides', 'contextDefaults']) {\n      if (partial[k]) {\n        merged[k] = [...config[k], ...partial[k]];\n      }\n    }\n    return merged;\n  },\n  name: DOMRenderExtensionName\n});\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n/**\n * Create a context state to be used during render.\n *\n * Note that to support the ValueOrUpdater pattern you can not use a\n * function for V (but you may wrap it in an array or object).\n *\n * @experimental\n * @__NO_SIDE_EFFECTS__\n */\nfunction createRenderState(name, getDefaultValue, isEqual) {\n  return createContextState(DOMRenderContextSymbol, name, getDefaultValue, isEqual);\n}\n\n/**\n * Render context state that is true if the export was initiated from the root of the document.\n * @experimental\n */\nconst RenderContextRoot = createRenderState('root', Boolean);\n\n/**\n * Render context state that is true if this is an export operation ($generateHtmlFromNodes).\n * @experimental\n */\nconst RenderContextExport = createRenderState('isExport', Boolean);\nfunction getDefaultRenderContext(editor) {\n  const builder = LexicalBuilder.maybeFromEditor(editor);\n  return builder && builder.hasExtensionByName(DOMRenderExtensionName) ? getExtensionDependencyFromEditor(editor, DOMRenderExtension).output.defaults : undefined;\n}\nfunction getRenderContext(editor) {\n  return getContextRecord(DOMRenderContextSymbol, editor) || getDefaultRenderContext(editor);\n}\n\n/**\n * Get a render context value during a DOM render or export operation.\n * @experimental\n */\nfunction $getRenderContextValue(cfg, editor = $getEditor()) {\n  return getContextValue(getRenderContext(editor), cfg);\n}\n\n/**\n * Execute a callback within a render context with the given config pairs.\n * @experimental\n */\nconst $withRenderContext = $withContext(DOMRenderContextSymbol, getDefaultRenderContext);\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * A convenience function for type inference when constructing DOM overrides for\n * use with {@link DOMRenderExtension}.\n *\n * @experimental\n * @__NO_SIDE_EFFECTS__\n */\n\nfunction domOverride(nodes, config) {\n  return {\n    ...config,\n    nodes\n  };\n}\n\nfunction isStyleRule(rule) {\n  return rule.constructor.name === CSSStyleRule.name;\n}\n\n/**\n * Inlines CSS rules from <style> tags onto matching elements as inline styles.\n * This is needed because apps like Excel generate HTML where styles live in\n * class-based <style> rules (e.g. `.xl65 { background: #FFFF00; color: blue; }`)\n * rather than inline styles. Since Lexical's import converters read inline styles,\n * we resolve stylesheet rules into inline styles before conversion.\n *\n * Mutates the DOM in-place. Original inline styles always take precedence over\n * stylesheet rules (matching CSS specificity behavior).\n */\nfunction inlineStylesFromStyleSheets(doc) {\n  if (doc.querySelector('style') === null) {\n    return;\n  }\n  const originalInlineStyles = new Map();\n  function getOriginalInlineProps(el) {\n    let props = originalInlineStyles.get(el);\n    if (props === undefined) {\n      props = new Set();\n      for (let i = 0; i < el.style.length; i++) {\n        props.add(el.style[i]);\n      }\n      originalInlineStyles.set(el, props);\n    }\n    return props;\n  }\n  try {\n    for (const sheet of Array.from(doc.styleSheets)) {\n      let rules;\n      try {\n        rules = sheet.cssRules;\n      } catch (_unused) {\n        continue;\n      }\n      for (const rule of Array.from(rules)) {\n        if (!isStyleRule(rule)) {\n          continue;\n        }\n        let elements;\n        try {\n          elements = doc.querySelectorAll(rule.selectorText);\n        } catch (_unused2) {\n          continue;\n        }\n        for (const el of Array.from(elements)) {\n          if (!isHTMLElement(el)) {\n            continue;\n          }\n          const originalProps = getOriginalInlineProps(el);\n          for (let i = 0; i < rule.style.length; i++) {\n            const prop = rule.style[i];\n            if (!originalProps.has(prop)) {\n              el.style.setProperty(prop, rule.style.getPropertyValue(prop), rule.style.getPropertyPriority(prop));\n            }\n          }\n        }\n      }\n    }\n  } catch (_unused3) {\n    // styleSheets API not supported in this environment\n  }\n}\nconst IGNORE_TAGS = new Set(['STYLE', 'SCRIPT']);\n\n/**\n * How you parse your html string to get a document is left up to you. In the browser you can use the native\n * DOMParser API to generate a document (see clipboard.ts), but to use in a headless environment you can use JSDom\n * or an equivalent library and pass in the document here.\n */\nfunction $generateNodesFromDOM(editor, dom) {\n  if (isDOMDocumentNode(dom)) {\n    inlineStylesFromStyleSheets(dom);\n  }\n  const elements = isDOMDocumentNode(dom) ? dom.body.childNodes : dom.childNodes;\n  const lexicalNodes = [];\n  const allArtificialNodes = [];\n  for (const element of elements) {\n    if (!IGNORE_TAGS.has(element.nodeName)) {\n      const lexicalNode = $createNodesFromDOM(element, editor, allArtificialNodes, false);\n      if (lexicalNode !== null) {\n        for (const node of lexicalNode) {\n          lexicalNodes.push(node);\n        }\n      }\n    }\n  }\n  $unwrapArtificialNodes(allArtificialNodes);\n  return lexicalNodes;\n}\n\n/**\n * Generate DOM nodes from the editor state into the given container element,\n * using the editor's {@link EditorDOMRenderConfig}.\n * @experimental\n */\nfunction $generateDOMFromNodes(container, selection = null, editor = $getEditor()) {\n  return $withRenderContext([contextValue(RenderContextExport, true)], editor)(() => {\n    const root = $getRoot();\n    const domConfig = $getEditorDOMRenderConfig(editor);\n    const parentElementAppend = container.append.bind(container);\n    for (const topLevelNode of root.getChildren()) {\n      $appendNodesToHTML(editor, topLevelNode, parentElementAppend, selection, domConfig);\n    }\n    return container;\n  });\n}\n\n/**\n * Generate DOM nodes from a root node into the given container element,\n * including the root node itself. Uses the editor's {@link EditorDOMRenderConfig}.\n * @experimental\n */\nfunction $generateDOMFromRoot(container, root = $getRoot()) {\n  const editor = $getEditor();\n  return $withRenderContext([contextValue(RenderContextExport, true), contextValue(RenderContextRoot, true)], editor)(() => {\n    const selection = null;\n    const domConfig = $getEditorDOMRenderConfig(editor);\n    const parentElementAppend = container.append.bind(container);\n    $appendNodesToHTML(editor, root, parentElementAppend, selection, domConfig);\n    return container;\n  });\n}\nfunction $generateHtmlFromNodes(editor, selection = null) {\n  if (typeof document === 'undefined' || typeof window === 'undefined' && typeof global.window === 'undefined') {\n    {\n      formatDevErrorMessage(`To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom or use withDOM from @lexical/headless/dom before calling this function.`);\n    }\n  }\n  return $generateDOMFromNodes(document.createElement('div'), selection, editor).innerHTML;\n}\nfunction $appendNodesToHTML(editor, currentNode, parentElementAppend, selection = null, domConfig = $getEditorDOMRenderConfig(editor)) {\n  let shouldInclude = domConfig.$shouldInclude(currentNode, selection, editor);\n  const shouldExclude = domConfig.$shouldExclude(currentNode, selection, editor);\n  let target = currentNode;\n  if (selection !== null && $isTextNode(currentNode)) {\n    target = $sliceSelectedTextNodeContent(selection, currentNode, 'clone');\n  }\n  const exportProps = domConfig.$exportDOM(target, editor);\n  const {\n    element,\n    after,\n    append,\n    $getChildNodes\n  } = exportProps;\n  if (!element) {\n    return false;\n  }\n  const fragment = document.createDocumentFragment();\n  const children = $getChildNodes ? $getChildNodes() : $isElementNode(target) ? target.getChildren() : [];\n  const fragmentAppend = fragment.append.bind(fragment);\n  for (const childNode of children) {\n    const shouldIncludeChild = $appendNodesToHTML(editor, childNode, fragmentAppend, selection, domConfig);\n    if (!shouldInclude && shouldIncludeChild && domConfig.$extractWithChild(currentNode, childNode, selection, 'html', editor)) {\n      shouldInclude = true;\n    }\n  }\n  if (shouldInclude && !shouldExclude) {\n    if (isHTMLElement(element) || isDocumentFragment(element)) {\n      if (append) {\n        append(fragment);\n      } else {\n        element.append(fragment);\n      }\n    }\n    parentElementAppend(element);\n    if (after) {\n      const newElement = after.call(target, element);\n      if (newElement) {\n        if (isDocumentFragment(element)) {\n          element.replaceChildren(newElement);\n        } else {\n          element.replaceWith(newElement);\n        }\n      }\n    }\n  } else {\n    parentElementAppend(fragment);\n  }\n  return shouldInclude;\n}\nfunction getConversionFunction(domNode, editor) {\n  const {\n    nodeName\n  } = domNode;\n  const cachedConversions = editor._htmlConversions.get(nodeName.toLowerCase());\n  let currentConversion = null;\n  if (cachedConversions !== undefined) {\n    for (const cachedConversion of cachedConversions) {\n      const domConversion = cachedConversion(domNode);\n      if (domConversion !== null && (currentConversion === null ||\n      // Given equal priority, prefer the last registered importer\n      // which is typically an application custom node or HTMLConfig['import']\n      (currentConversion.priority || 0) <= (domConversion.priority || 0))) {\n        currentConversion = domConversion;\n      }\n    }\n  }\n  return currentConversion !== null ? currentConversion.conversion : null;\n}\nfunction $createNodesFromDOM(node, editor, allArtificialNodes, hasBlockAncestorLexicalNode, forChildMap = new Map(), parentLexicalNode) {\n  const lexicalNodes = [];\n  if (IGNORE_TAGS.has(node.nodeName)) {\n    return lexicalNodes;\n  }\n  let currentLexicalNode = null;\n  const transformFunction = getConversionFunction(node, editor);\n  const transformOutput = transformFunction ? transformFunction(node) : null;\n  let postTransform = null;\n  if (transformOutput !== null) {\n    postTransform = transformOutput.after;\n    const transformNodes = transformOutput.node;\n    currentLexicalNode = Array.isArray(transformNodes) ? transformNodes[transformNodes.length - 1] : transformNodes;\n    if (currentLexicalNode !== null) {\n      for (const [, forChildFunction] of forChildMap) {\n        currentLexicalNode = forChildFunction(currentLexicalNode, parentLexicalNode);\n        if (!currentLexicalNode) {\n          break;\n        }\n      }\n      if (currentLexicalNode) {\n        lexicalNodes.push(...(Array.isArray(transformNodes) ? transformNodes : [currentLexicalNode]));\n      }\n    }\n    if (transformOutput.forChild != null) {\n      forChildMap.set(node.nodeName, transformOutput.forChild);\n    }\n  }\n\n  // If the DOM node doesn't have a transformer, we don't know what\n  // to do with it but we still need to process any childNodes.\n  const children = node.childNodes;\n  let childLexicalNodes = [];\n  const hasBlockAncestorLexicalNodeForChildren = currentLexicalNode != null && $isRootOrShadowRoot(currentLexicalNode) ? false : currentLexicalNode != null && $isBlockElementNode(currentLexicalNode) || hasBlockAncestorLexicalNode;\n  for (let i = 0; i < children.length; i++) {\n    childLexicalNodes.push(...$createNodesFromDOM(children[i], editor, allArtificialNodes, hasBlockAncestorLexicalNodeForChildren, new Map(forChildMap), currentLexicalNode));\n  }\n  if (postTransform != null) {\n    childLexicalNodes = postTransform(childLexicalNodes);\n  }\n  if (isBlockDomNode(node)) {\n    if (!hasBlockAncestorLexicalNodeForChildren) {\n      childLexicalNodes = wrapContinuousInlines(node, childLexicalNodes, $createParagraphNode);\n    } else {\n      childLexicalNodes = wrapContinuousInlines(node, childLexicalNodes, () => {\n        const artificialNode = new ArtificialNode__DO_NOT_USE();\n        allArtificialNodes.push(artificialNode);\n        return artificialNode;\n      });\n    }\n  }\n  if (currentLexicalNode == null) {\n    if (childLexicalNodes.length > 0) {\n      // If it hasn't been converted to a LexicalNode, we hoist its children\n      // up to the same level as it.\n      for (const childNode of childLexicalNodes) {\n        lexicalNodes.push(childNode);\n      }\n    } else {\n      if (isBlockDomNode(node) && isDomNodeBetweenTwoInlineNodes(node)) {\n        // Empty block dom node that hasnt been converted, we replace it with a linebreak if its between inline nodes\n        lexicalNodes.push($createLineBreakNode());\n      }\n    }\n  } else {\n    if ($isElementNode(currentLexicalNode)) {\n      // If the current node is a ElementNode after conversion,\n      // we can append all the children to it.\n      currentLexicalNode.append(...childLexicalNodes);\n    }\n  }\n  return lexicalNodes;\n}\nfunction wrapContinuousInlines(domNode, nodes, createWrapperFn) {\n  const textAlign = domNode.style.textAlign;\n  const out = [];\n  let continuousInlines = [];\n  // wrap contiguous inline child nodes in para\n  for (let i = 0; i < nodes.length; i++) {\n    const node = nodes[i];\n    if ($isBlockElementNode(node)) {\n      if (textAlign && !node.getFormat()) {\n        node.setFormat(textAlign);\n      }\n      out.push(node);\n    } else {\n      continuousInlines.push(node);\n      if (i === nodes.length - 1 || i < nodes.length - 1 && $isBlockElementNode(nodes[i + 1])) {\n        const wrapper = createWrapperFn();\n        wrapper.setFormat(textAlign);\n        wrapper.append(...continuousInlines);\n        out.push(wrapper);\n        continuousInlines = [];\n      }\n    }\n  }\n  return out;\n}\nfunction $unwrapArtificialNodes(allArtificialNodes) {\n  // Replace artificial node with its children, inserting a linebreak\n  // between adjacent artificial nodes\n  for (const node of allArtificialNodes) {\n    if (node.getParent() && node.getNextSibling() instanceof ArtificialNode__DO_NOT_USE) {\n      node.insertAfter($createLineBreakNode());\n    }\n  }\n  for (const node of allArtificialNodes) {\n    const parent = node.getParent();\n    if (parent) {\n      parent.splice(node.getIndexWithinParent(), 1, node.getChildren());\n    }\n  }\n}\nfunction isDomNodeBetweenTwoInlineNodes(node) {\n  if (node.nextSibling == null || node.previousSibling == null) {\n    return false;\n  }\n  return isInlineDomNode(node.nextSibling) && isInlineDomNode(node.previousSibling);\n}\n\nexport { $generateDOMFromNodes, $generateDOMFromRoot, $generateHtmlFromNodes, $generateNodesFromDOM, $getRenderContextValue, $withRenderContext, DOMRenderExtension, RenderContextExport, RenderContextRoot, contextUpdater, contextValue, createRenderState, domOverride };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalHtml.dev.mjs';\nimport * as modProd from './LexicalHtml.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const $generateDOMFromNodes = mod.$generateDOMFromNodes;\nexport const $generateDOMFromRoot = mod.$generateDOMFromRoot;\nexport const $generateHtmlFromNodes = mod.$generateHtmlFromNodes;\nexport const $generateNodesFromDOM = mod.$generateNodesFromDOM;\nexport const $getRenderContextValue = mod.$getRenderContextValue;\nexport const $withRenderContext = mod.$withRenderContext;\nexport const DOMRenderExtension = mod.DOMRenderExtension;\nexport const RenderContextExport = mod.RenderContextExport;\nexport const RenderContextRoot = mod.RenderContextRoot;\nexport const contextUpdater = mod.contextUpdater;\nexport const contextValue = mod.contextValue;\nexport const createRenderState = mod.createRenderState;\nexport const domOverride = mod.domOverride;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalClipboard.dev.mjs';\nimport * as modProd from './LexicalClipboard.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const $generateJSONFromSelectedNodes = mod.$generateJSONFromSelectedNodes;\nexport const $generateNodesFromSerializedNodes = mod.$generateNodesFromSerializedNodes;\nexport const $getClipboardDataFromSelection = mod.$getClipboardDataFromSelection;\nexport const $getHtmlContent = mod.$getHtmlContent;\nexport const $getLexicalContent = mod.$getLexicalContent;\nexport const $handlePlainTextDrop = mod.$handlePlainTextDrop;\nexport const $handleRichTextDrop = mod.$handleRichTextDrop;\nexport const $insertDataTransferForPlainText = mod.$insertDataTransferForPlainText;\nexport const $insertDataTransferForRichText = mod.$insertDataTransferForRichText;\nexport const $insertGeneratedNodes = mod.$insertGeneratedNodes;\nexport const $writeDragSourceToDataTransfer = mod.$writeDragSourceToDataTransfer;\nexport const copyToClipboard = mod.copyToClipboard;\nexport const setLexicalClipboardDataTransfer = mod.setLexicalClipboardDataTransfer;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { effect, namedSignals } from '@lexical/extension';\nimport { defineExtension, safeCast, $getSelection, $isRangeSelection, $isTextNode } from 'lexical';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction registerDragonSupport(editor) {\n  const origin = window.location.origin;\n  const handler = event => {\n    if (event.origin !== origin) {\n      return;\n    }\n    const rootElement = editor.getRootElement();\n    if (document.activeElement !== rootElement) {\n      return;\n    }\n    const data = event.data;\n    if (typeof data === 'string') {\n      let parsedData;\n      try {\n        parsedData = JSON.parse(data);\n      } catch (_e) {\n        return;\n      }\n      if (parsedData && parsedData.protocol === 'nuanria_messaging' && parsedData.type === 'request') {\n        const payload = parsedData.payload;\n        if (payload && payload.functionId === 'makeChanges') {\n          const args = payload.args;\n          if (args) {\n            const [elementStart, elementLength, text, selStart, selLength] = args;\n            // TODO: we should probably handle formatCommand somehow?\n            // formatCommand;\n            editor.update(() => {\n              const selection = $getSelection();\n              if ($isRangeSelection(selection)) {\n                const anchor = selection.anchor;\n                let anchorNode = anchor.getNode();\n                let setSelStart = 0;\n                let setSelEnd = 0;\n                if ($isTextNode(anchorNode)) {\n                  // set initial selection\n                  if (elementStart >= 0 && elementLength >= 0) {\n                    setSelStart = elementStart;\n                    setSelEnd = elementStart + elementLength;\n                    // If the offset is more than the end, make it the end\n                    selection.setTextNodeRange(anchorNode, setSelStart, anchorNode, setSelEnd);\n                  }\n                }\n                if (setSelStart !== setSelEnd || text !== '') {\n                  selection.insertRawText(text);\n                  anchorNode = anchor.getNode();\n                }\n                if ($isTextNode(anchorNode)) {\n                  // set final selection\n                  setSelStart = selStart;\n                  setSelEnd = selStart + selLength;\n                  const anchorNodeTextLength = anchorNode.getTextContentSize();\n                  // If the offset is more than the end, make it the end\n                  setSelStart = setSelStart > anchorNodeTextLength ? anchorNodeTextLength : setSelStart;\n                  setSelEnd = setSelEnd > anchorNodeTextLength ? anchorNodeTextLength : setSelEnd;\n                  selection.setTextNodeRange(anchorNode, setSelStart, anchorNode, setSelEnd);\n                }\n\n                // block the chrome extension from handling this event\n                event.stopImmediatePropagation();\n              }\n            });\n          }\n        }\n      }\n    }\n  };\n  window.addEventListener('message', handler, true);\n  return () => {\n    window.removeEventListener('message', handler, true);\n  };\n}\n/**\n * Add Dragon speech to text input support to the editor, via the\n * \\@lexical/dragon module.\n */\nconst DragonExtension = defineExtension({\n  build: (editor, config, state) => namedSignals(config),\n  config: safeCast({\n    disabled: typeof window === 'undefined'\n  }),\n  name: '@lexical/dragon',\n  register: (editor, config, state) => effect(() => state.getOutput().disabled.value ? undefined : registerDragonSupport(editor))\n});\n\nexport { DragonExtension, registerDragonSupport };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalDragon.dev.mjs';\nimport * as modProd from './LexicalDragon.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const DragonExtension = mod.DragonExtension;\nexport const registerDragonSupport = mod.registerDragonSupport;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalPlainText.dev.mjs';\nimport * as modProd from './LexicalPlainText.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const PlainTextExtension = mod.PlainTextExtension;\nexport const registerPlainText = mod.registerPlainText;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { $insertDataTransferForRichText, $handleRichTextDrop, setLexicalClipboardDataTransfer, $getClipboardDataFromSelection, $writeDragSourceToDataTransfer, copyToClipboard } from '@lexical/clipboard';\nimport { DragonExtension } from '@lexical/dragon';\nimport { $isParentRTL, $shouldOverrideDefaultCharacterSelection, $moveCharacter } from '@lexical/selection';\nimport { mergeRegister, $findMatchingParent, $handleIndentAndOutdent, objectKlassEquals, addClassNamesToElement, isHTMLElement, $getNearestBlockElementAncestorOrThrow } from '@lexical/utils';\nimport { createCommand, defineExtension, CLICK_COMMAND, $getSelection, $isNodeSelection, COMMAND_PRIORITY_EDITOR, DELETE_CHARACTER_COMMAND, $isRangeSelection, DELETE_WORD_COMMAND, DELETE_LINE_COMMAND, CONTROLLED_TEXT_INSERTION_COMMAND, REMOVE_TEXT_COMMAND, FORMAT_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, $isElementNode, INSERT_LINE_BREAK_COMMAND, INSERT_PARAGRAPH_COMMAND, INSERT_TAB_COMMAND, $createTabNode, $insertNodes, INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND, KEY_ARROW_UP_COMMAND, $getAdjacentNode, $isDecoratorNode, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_LEFT_COMMAND, KEY_ARROW_RIGHT_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND, KEY_ENTER_COMMAND, KEY_ESCAPE_COMMAND, DROP_COMMAND, $getNearestNodeFromDOMNode, $createRangeSelection, $isTextNode, $normalizeSelection__EXPERIMENTAL, $setSelection, DRAGSTART_COMMAND, DRAGOVER_COMMAND, SELECT_ALL_COMMAND, $selectAll, COPY_COMMAND, CUT_COMMAND, PASTE_COMMAND, isDOMNode, isSelectionCapturedInDecoratorInput, KEY_SPACE_COMMAND, KEY_TAB_COMMAND, ElementNode, $createParagraphNode, $getRoot, $isRootNode, PASTE_TAG, setNodeIndentFromDOM, $applyNodeReplacement } from 'lexical';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction caretFromPoint(x, y) {\n  if (typeof document.caretRangeFromPoint !== 'undefined') {\n    const range = document.caretRangeFromPoint(x, y);\n    if (range === null) {\n      return null;\n    }\n    return {\n      node: range.startContainer,\n      offset: range.startOffset\n    };\n    // @ts-ignore\n  } else if (document.caretPositionFromPoint !== 'undefined') {\n    // @ts-ignore FF - no types\n    const range = document.caretPositionFromPoint(x, y);\n    if (range === null) {\n      return null;\n    }\n    return {\n      node: range.offsetNode,\n      offset: range.offset\n    };\n  } else {\n    // Gracefully handle IE\n    return null;\n  }\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst documentMode = CAN_USE_DOM && 'documentMode' in document ? document.documentMode : null;\nconst IS_APPLE = CAN_USE_DOM && /Mac|iPod|iPhone|iPad/.test(navigator.platform);\nconst CAN_USE_BEFORE_INPUT = CAN_USE_DOM && 'InputEvent' in window && !documentMode ? 'getTargetRanges' in new window.InputEvent('input') : false;\nconst IS_IOS = CAN_USE_DOM && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\nconst IS_ANDROID = CAN_USE_DOM && /Android/.test(navigator.userAgent);\n\n// Exclude Android \u2014 Android WebView's UA contains \"Version/X.X ... Safari/537.36\"\n// which falsely matches the Safari regex, activating wrong composition code paths.\nconst IS_SAFARI = CAN_USE_DOM && /Version\\/[\\d.]+.*Safari/.test(navigator.userAgent) && !IS_ANDROID;\n\n// Keep these in case we need to use them in the future.\n// export const IS_WINDOWS: boolean = CAN_USE_DOM && /Win/.test(navigator.platform);\nconst IS_CHROME = CAN_USE_DOM && /^(?=.*Chrome).*/i.test(navigator.userAgent);\nconst IS_APPLE_WEBKIT = CAN_USE_DOM && /AppleWebKit\\/[\\d.]+/.test(navigator.userAgent) && IS_APPLE && !IS_CHROME;\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst DRAG_DROP_PASTE = createCommand('DRAG_DROP_PASTE_FILE');\n/** @noInheritDoc */\nclass QuoteNode extends ElementNode {\n  static getType() {\n    return 'quote';\n  }\n  static clone(node) {\n    return new QuoteNode(node.__key);\n  }\n\n  // View\n\n  createDOM(config) {\n    const element = document.createElement('blockquote');\n    addClassNamesToElement(element, config.theme.quote);\n    return element;\n  }\n  updateDOM(prevNode, dom) {\n    return false;\n  }\n  static importDOM() {\n    return {\n      blockquote: node => ({\n        conversion: $convertBlockquoteElement,\n        priority: 0\n      })\n    };\n  }\n  exportDOM(editor) {\n    const {\n      element\n    } = super.exportDOM(editor);\n    if (isHTMLElement(element)) {\n      if (this.isEmpty()) {\n        element.append(document.createElement('br'));\n      }\n      const formatType = this.getFormatType();\n      if (formatType) {\n        element.style.textAlign = formatType;\n      }\n      const direction = this.getDirection();\n      if (direction) {\n        element.dir = direction;\n      }\n    }\n    return {\n      element\n    };\n  }\n  static importJSON(serializedNode) {\n    return $createQuoteNode().updateFromJSON(serializedNode);\n  }\n\n  // Mutation\n\n  insertNewAfter(_, restoreSelection) {\n    const newBlock = $createParagraphNode();\n    const direction = this.getDirection();\n    newBlock.setDirection(direction);\n    this.insertAfter(newBlock, restoreSelection);\n    return newBlock;\n  }\n  collapseAtStart() {\n    const paragraph = $createParagraphNode();\n    const children = this.getChildren();\n    children.forEach(child => paragraph.append(child));\n    this.replace(paragraph);\n    return true;\n  }\n  canMergeWhenEmpty() {\n    return true;\n  }\n}\nfunction $createQuoteNode() {\n  return $applyNodeReplacement(new QuoteNode());\n}\nfunction $isQuoteNode(node) {\n  return node instanceof QuoteNode;\n}\n/** @noInheritDoc */\nclass HeadingNode extends ElementNode {\n  /** @internal */\n  __tag;\n  static getType() {\n    return 'heading';\n  }\n  static clone(node) {\n    return new HeadingNode(node.__tag, node.__key);\n  }\n  afterCloneFrom(prevNode) {\n    super.afterCloneFrom(prevNode);\n    this.__tag = prevNode.__tag;\n  }\n  constructor(tag = 'h1', key) {\n    super(key);\n    this.__tag = tag;\n  }\n  getTag() {\n    return this.getLatest().__tag;\n  }\n  setTag(tag) {\n    const self = this.getWritable();\n    self.__tag = tag;\n    return self;\n  }\n\n  // View\n\n  createDOM(config) {\n    const tag = this.__tag;\n    const element = document.createElement(tag);\n    const theme = config.theme;\n    const classNames = theme.heading;\n    if (classNames !== undefined) {\n      const className = classNames[tag];\n      addClassNamesToElement(element, className);\n    }\n    return element;\n  }\n  updateDOM(prevNode, dom, config) {\n    return prevNode.__tag !== this.__tag;\n  }\n  static importDOM() {\n    return {\n      h1: node => ({\n        conversion: $convertHeadingElement,\n        priority: 0\n      }),\n      h2: node => ({\n        conversion: $convertHeadingElement,\n        priority: 0\n      }),\n      h3: node => ({\n        conversion: $convertHeadingElement,\n        priority: 0\n      }),\n      h4: node => ({\n        conversion: $convertHeadingElement,\n        priority: 0\n      }),\n      h5: node => ({\n        conversion: $convertHeadingElement,\n        priority: 0\n      }),\n      h6: node => ({\n        conversion: $convertHeadingElement,\n        priority: 0\n      }),\n      p: node => {\n        // domNode is a <p> since we matched it by nodeName\n        const paragraph = node;\n        const firstChild = paragraph.firstChild;\n        if (firstChild !== null && isGoogleDocsTitle(firstChild)) {\n          return {\n            conversion: () => ({\n              node: null\n            }),\n            priority: 3\n          };\n        }\n        return null;\n      },\n      span: node => {\n        if (isGoogleDocsTitle(node)) {\n          return {\n            conversion: domNode => {\n              return {\n                node: $createHeadingNode('h1')\n              };\n            },\n            priority: 3\n          };\n        }\n        return null;\n      }\n    };\n  }\n  exportDOM(editor) {\n    const {\n      element\n    } = super.exportDOM(editor);\n    if (isHTMLElement(element)) {\n      if (this.isEmpty()) {\n        element.append(document.createElement('br'));\n      }\n      const formatType = this.getFormatType();\n      if (formatType) {\n        element.style.textAlign = formatType;\n      }\n      const direction = this.getDirection();\n      if (direction) {\n        element.dir = direction;\n      }\n    }\n    return {\n      element\n    };\n  }\n  static importJSON(serializedNode) {\n    return $createHeadingNode(serializedNode.tag).updateFromJSON(serializedNode);\n  }\n  updateFromJSON(serializedNode) {\n    return super.updateFromJSON(serializedNode).setTag(serializedNode.tag);\n  }\n  exportJSON() {\n    return {\n      ...super.exportJSON(),\n      tag: this.getTag()\n    };\n  }\n\n  // Mutation\n  insertNewAfter(selection, restoreSelection = true) {\n    const anchorOffet = selection ? selection.anchor.offset : 0;\n    const lastDesc = this.getLastDescendant();\n    const isAtEnd = !lastDesc || selection && selection.anchor.key === lastDesc.getKey() && anchorOffet === lastDesc.getTextContentSize();\n    const newElement = isAtEnd || !selection ? $createParagraphNode() : $createHeadingNode(this.getTag());\n    const direction = this.getDirection();\n    newElement.setDirection(direction);\n    this.insertAfter(newElement, restoreSelection);\n    if (anchorOffet === 0 && !this.isEmpty() && selection) {\n      const paragraph = $createParagraphNode();\n      paragraph.select();\n      this.replace(paragraph, true);\n    }\n    return newElement;\n  }\n  collapseAtStart() {\n    const newElement = !this.isEmpty() ? $createHeadingNode(this.getTag()) : $createParagraphNode();\n    const children = this.getChildren();\n    children.forEach(child => newElement.append(child));\n    this.replace(newElement);\n    return true;\n  }\n  extractWithChild() {\n    return true;\n  }\n}\nfunction isGoogleDocsTitle(domNode) {\n  if (domNode.nodeName.toLowerCase() === 'span') {\n    return domNode.style.fontSize === '26pt';\n  }\n  return false;\n}\nfunction $convertHeadingElement(element) {\n  const nodeName = element.nodeName.toLowerCase();\n  let node = null;\n  if (nodeName === 'h1' || nodeName === 'h2' || nodeName === 'h3' || nodeName === 'h4' || nodeName === 'h5' || nodeName === 'h6') {\n    node = $createHeadingNode(nodeName);\n    if (element.style !== null) {\n      setNodeIndentFromDOM(element, node);\n      node.setFormat(element.style.textAlign);\n    }\n  }\n  return {\n    node\n  };\n}\nfunction $convertBlockquoteElement(element) {\n  const node = $createQuoteNode();\n  if (element.style !== null) {\n    node.setFormat(element.style.textAlign);\n    setNodeIndentFromDOM(element, node);\n  }\n  return {\n    node\n  };\n}\nfunction $createHeadingNode(headingTag = 'h1') {\n  return $applyNodeReplacement(new HeadingNode(headingTag));\n}\nfunction $isHeadingNode(node) {\n  return node instanceof HeadingNode;\n}\nfunction onPasteForRichText(event, editor) {\n  event.preventDefault();\n  editor.update(() => {\n    const selection = $getSelection();\n    const clipboardData = objectKlassEquals(event, InputEvent) || objectKlassEquals(event, KeyboardEvent) ? null : event.clipboardData;\n    if (clipboardData != null && selection !== null) {\n      $insertDataTransferForRichText(clipboardData, selection, editor);\n    }\n  }, {\n    tag: PASTE_TAG\n  });\n}\nasync function onCutForRichText(event, editor) {\n  await copyToClipboard(editor, objectKlassEquals(event, ClipboardEvent) ? event : null);\n  editor.update(() => {\n    const selection = $getSelection();\n    if ($isRangeSelection(selection)) {\n      selection.removeText();\n    } else if ($isNodeSelection(selection)) {\n      selection.getNodes().forEach(node => node.remove());\n    }\n  });\n}\n\n// Clipboard may contain files that we aren't allowed to read. While the event is arguably useless,\n// in certain occasions, we want to know whether it was a file transfer, as opposed to text. We\n// control this with the first boolean flag.\nfunction eventFiles(event) {\n  let dataTransfer = null;\n  if (objectKlassEquals(event, DragEvent)) {\n    dataTransfer = event.dataTransfer;\n  } else if (objectKlassEquals(event, ClipboardEvent)) {\n    dataTransfer = event.clipboardData;\n  }\n  if (dataTransfer === null) {\n    return [false, [], false];\n  }\n  const types = dataTransfer.types;\n  const hasFiles = types.includes('Files');\n  const hasContent = types.includes('text/html') || types.includes('text/plain');\n  return [hasFiles, Array.from(dataTransfer.files), hasContent];\n}\nfunction $isTargetWithinDecorator(target) {\n  const node = $getNearestNodeFromDOMNode(target);\n  return $isDecoratorNode(node);\n}\nfunction $isSelectionAtEndOfRoot(selection) {\n  const focus = selection.focus;\n  return focus.key === 'root' && focus.offset === $getRoot().getChildrenSize();\n}\nfunction $isSelectionCollapsedAtFrontOfIndentedBlock(selection) {\n  if (!selection.isCollapsed()) {\n    return false;\n  }\n  const {\n    anchor\n  } = selection;\n  if (anchor.offset !== 0) {\n    return false;\n  }\n  const anchorNode = anchor.getNode();\n  if ($isRootNode(anchorNode)) {\n    return false;\n  }\n  const element = $getNearestBlockElementAncestorOrThrow(anchorNode);\n  return element.getIndent() > 0 && (element.is(anchorNode) || anchorNode.is(element.getFirstDescendant()));\n}\n\n/**\n * Resets the capitalization of the selection to default.\n * Called when the user presses space, tab, or enter key.\n * @param selection The selection to reset the capitalization of.\n */\nfunction $resetCapitalization(selection) {\n  for (const format of ['lowercase', 'uppercase', 'capitalize']) {\n    if (selection.hasFormat(format)) {\n      selection.toggleFormat(format);\n    }\n  }\n}\nfunction registerRichText(editor) {\n  const removeListener = mergeRegister(editor.registerCommand(CLICK_COMMAND, payload => {\n    const selection = $getSelection();\n    if ($isNodeSelection(selection)) {\n      selection.clear();\n      return true;\n    }\n    return false;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DELETE_CHARACTER_COMMAND, isBackward => {\n    const selection = $getSelection();\n    if ($isRangeSelection(selection)) {\n      selection.deleteCharacter(isBackward);\n      return true;\n    } else if ($isNodeSelection(selection)) {\n      selection.deleteNodes();\n      return true;\n    }\n    return false;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DELETE_WORD_COMMAND, isBackward => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    selection.deleteWord(isBackward);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DELETE_LINE_COMMAND, isBackward => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    selection.deleteLine(isBackward);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(CONTROLLED_TEXT_INSERTION_COMMAND, eventOrText => {\n    const selection = $getSelection();\n    if (typeof eventOrText === 'string') {\n      if (selection !== null) {\n        selection.insertText(eventOrText);\n      }\n    } else {\n      if (selection === null) {\n        return false;\n      }\n      const dataTransfer = eventOrText.dataTransfer;\n      if (dataTransfer != null) {\n        $insertDataTransferForRichText(dataTransfer, selection, editor);\n      } else if ($isRangeSelection(selection)) {\n        const data = eventOrText.data;\n        if (data) {\n          selection.insertText(data);\n        }\n        return true;\n      }\n    }\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(REMOVE_TEXT_COMMAND, () => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    selection.removeText();\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(FORMAT_TEXT_COMMAND, format => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    selection.formatText(format);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(FORMAT_ELEMENT_COMMAND, format => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection) && !$isNodeSelection(selection)) {\n      return false;\n    }\n    const nodes = selection.getNodes();\n    for (const node of nodes) {\n      const element = $findMatchingParent(node, parentNode => $isElementNode(parentNode) && !parentNode.isInline());\n      if (element !== null) {\n        element.setFormat(format);\n      }\n    }\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(INSERT_LINE_BREAK_COMMAND, selectStart => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    selection.insertLineBreak(selectStart);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(INSERT_PARAGRAPH_COMMAND, () => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    selection.insertParagraph();\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(INSERT_TAB_COMMAND, () => {\n    const tabNode = $createTabNode();\n    const selection = $getSelection();\n    if ($isRangeSelection(selection)) {\n      tabNode.setFormat(selection.format);\n      tabNode.setStyle(selection.style);\n    }\n    $insertNodes([tabNode]);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(INDENT_CONTENT_COMMAND, () => {\n    return $handleIndentAndOutdent(block => {\n      const indent = block.getIndent();\n      block.setIndent(indent + 1);\n    });\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(OUTDENT_CONTENT_COMMAND, () => {\n    return $handleIndentAndOutdent(block => {\n      const indent = block.getIndent();\n      if (indent > 0) {\n        block.setIndent(Math.max(0, indent - 1));\n      }\n    });\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_ARROW_UP_COMMAND, event => {\n    const selection = $getSelection();\n    if ($isNodeSelection(selection)) {\n      // If selection is on a node, let's try and move selection\n      // back to being a range selection.\n      const nodes = selection.getNodes();\n      if (nodes.length > 0) {\n        event.preventDefault();\n        nodes[0].selectPrevious();\n        return true;\n      }\n    } else if ($isRangeSelection(selection)) {\n      const possibleNode = $getAdjacentNode(selection.focus, true);\n      if (!event.shiftKey && $isDecoratorNode(possibleNode) && !possibleNode.isIsolated() && !possibleNode.isInline()) {\n        possibleNode.selectPrevious();\n        event.preventDefault();\n        return true;\n      }\n    }\n    return false;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_ARROW_DOWN_COMMAND, event => {\n    const selection = $getSelection();\n    if ($isNodeSelection(selection)) {\n      // If selection is on a node, let's try and move selection\n      // back to being a range selection.\n      const nodes = selection.getNodes();\n      if (nodes.length > 0) {\n        event.preventDefault();\n        nodes[0].selectNext(0, 0);\n        return true;\n      }\n    } else if ($isRangeSelection(selection)) {\n      if ($isSelectionAtEndOfRoot(selection)) {\n        event.preventDefault();\n        return true;\n      }\n      const possibleNode = $getAdjacentNode(selection.focus, false);\n      if (!event.shiftKey && $isDecoratorNode(possibleNode) && !possibleNode.isIsolated() && !possibleNode.isInline()) {\n        possibleNode.selectNext();\n        event.preventDefault();\n        return true;\n      }\n    }\n    return false;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_ARROW_LEFT_COMMAND, event => {\n    const selection = $getSelection();\n    if ($isNodeSelection(selection)) {\n      // If selection is on a node, let's try and move selection\n      // back to being a range selection.\n      const nodes = selection.getNodes();\n      if (nodes.length > 0) {\n        event.preventDefault();\n        if ($isParentRTL(nodes[0])) {\n          nodes[0].selectNext(0, 0);\n        } else {\n          nodes[0].selectPrevious();\n        }\n        return true;\n      }\n    }\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    if ($shouldOverrideDefaultCharacterSelection(selection, true)) {\n      const isHoldingShift = event.shiftKey;\n      event.preventDefault();\n      $moveCharacter(selection, isHoldingShift, true);\n      return true;\n    }\n    return false;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_ARROW_RIGHT_COMMAND, event => {\n    const selection = $getSelection();\n    if ($isNodeSelection(selection)) {\n      // If selection is on a node, let's try and move selection\n      // back to being a range selection.\n      const nodes = selection.getNodes();\n      if (nodes.length > 0) {\n        event.preventDefault();\n        if ($isParentRTL(nodes[0])) {\n          nodes[0].selectPrevious();\n        } else {\n          nodes[0].selectNext(0, 0);\n        }\n        return true;\n      }\n    }\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    const isHoldingShift = event.shiftKey;\n    if ($shouldOverrideDefaultCharacterSelection(selection, false)) {\n      event.preventDefault();\n      $moveCharacter(selection, isHoldingShift, false);\n      return true;\n    }\n    return false;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_BACKSPACE_COMMAND, event => {\n    if ($isTargetWithinDecorator(event.target)) {\n      return false;\n    }\n    const selection = $getSelection();\n    if ($isRangeSelection(selection)) {\n      if ($isSelectionCollapsedAtFrontOfIndentedBlock(selection)) {\n        event.preventDefault();\n        return editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined);\n      }\n      // Exception handling for iOS native behavior instead of Lexical's behavior when using Korean on iOS devices.\n      // more details - https://github.com/facebook/lexical/issues/5841\n      if (IS_IOS && navigator.language === 'ko-KR') {\n        return false;\n      }\n    } else if (!$isNodeSelection(selection)) {\n      return false;\n    }\n    event.preventDefault();\n    return editor.dispatchCommand(DELETE_CHARACTER_COMMAND, true);\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_DELETE_COMMAND, event => {\n    if ($isTargetWithinDecorator(event.target)) {\n      return false;\n    }\n    const selection = $getSelection();\n    if (!($isRangeSelection(selection) || $isNodeSelection(selection))) {\n      return false;\n    }\n    event.preventDefault();\n    return editor.dispatchCommand(DELETE_CHARACTER_COMMAND, false);\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_ENTER_COMMAND, event => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    $resetCapitalization(selection);\n    if (event !== null) {\n      // If we have beforeinput, then we can avoid blocking\n      // the default behavior. This ensures that the iOS can\n      // intercept that we're actually inserting a paragraph,\n      // and autocomplete, autocapitalize etc work as intended.\n      // This can also cause a strange performance issue in\n      // Safari, where there is a noticeable pause due to\n      // preventing the key down of enter.\n      if ((IS_IOS || IS_SAFARI || IS_APPLE_WEBKIT) && CAN_USE_BEFORE_INPUT) {\n        return false;\n      }\n      event.preventDefault();\n      if (event.shiftKey) {\n        return editor.dispatchCommand(INSERT_LINE_BREAK_COMMAND, false);\n      }\n    }\n    return editor.dispatchCommand(INSERT_PARAGRAPH_COMMAND, undefined);\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_ESCAPE_COMMAND, () => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) {\n      return false;\n    }\n    editor.blur();\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DROP_COMMAND, event => {\n    const [, files] = eventFiles(event);\n    if (files.length > 0) {\n      const x = event.clientX;\n      const y = event.clientY;\n      const eventRange = caretFromPoint(x, y);\n      if (eventRange !== null) {\n        const {\n          offset: domOffset,\n          node: domNode\n        } = eventRange;\n        const node = $getNearestNodeFromDOMNode(domNode);\n        if (node !== null) {\n          const selection = $createRangeSelection();\n          if ($isTextNode(node)) {\n            selection.anchor.set(node.getKey(), domOffset, 'text');\n            selection.focus.set(node.getKey(), domOffset, 'text');\n          } else {\n            const parentKey = node.getParentOrThrow().getKey();\n            const offset = node.getIndexWithinParent() + 1;\n            selection.anchor.set(parentKey, offset, 'element');\n            selection.focus.set(parentKey, offset, 'element');\n          }\n          const normalizedSelection = $normalizeSelection__EXPERIMENTAL(selection);\n          $setSelection(normalizedSelection);\n        }\n        editor.dispatchCommand(DRAG_DROP_PASTE, files);\n      }\n      event.preventDefault();\n      return true;\n    }\n    return $handleRichTextDrop(event, editor);\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DRAGSTART_COMMAND, event => {\n    const [isFileTransfer] = eventFiles(event);\n    const selection = $getSelection();\n    if (isFileTransfer && !$isRangeSelection(selection)) {\n      return false;\n    }\n    if ($isRangeSelection(selection) && !selection.isCollapsed() && event.dataTransfer !== null) {\n      // Populate Lexical's own serialization so custom nodes (images,\n      // decorators) survive a drop back into a Lexical editor rather than\n      // being downgraded to text/html.\n      setLexicalClipboardDataTransfer(event.dataTransfer, $getClipboardDataFromSelection(selection));\n      // Mark the drag source so a drop in a different editor can remove\n      // the source range to produce cut-and-paste semantics.\n      $writeDragSourceToDataTransfer(event.dataTransfer, editor);\n    }\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(DRAGOVER_COMMAND, event => {\n    const [isFileTransfer] = eventFiles(event);\n    const selection = $getSelection();\n    if (isFileTransfer && !$isRangeSelection(selection)) {\n      return false;\n    }\n    const x = event.clientX;\n    const y = event.clientY;\n    const eventRange = caretFromPoint(x, y);\n    if (eventRange !== null) {\n      const node = $getNearestNodeFromDOMNode(eventRange.node);\n      if ($isDecoratorNode(node)) {\n        // Show browser caret as the user is dragging the media across the screen. Won't work\n        // for DecoratorNode nor it's relevant.\n        event.preventDefault();\n      }\n    }\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(SELECT_ALL_COMMAND, () => {\n    $selectAll();\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(COPY_COMMAND, event => {\n    copyToClipboard(editor, objectKlassEquals(event, ClipboardEvent) ? event : null);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(CUT_COMMAND, event => {\n    onCutForRichText(event, editor);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(PASTE_COMMAND, event => {\n    const [, files, hasTextContent] = eventFiles(event);\n    if (files.length > 0 && !hasTextContent) {\n      editor.dispatchCommand(DRAG_DROP_PASTE, files);\n      return true;\n    }\n\n    // if inputs then paste within the input ignore creating a new node on paste event\n    if (isDOMNode(event.target) && isSelectionCapturedInDecoratorInput(event.target)) {\n      return false;\n    }\n    const selection = $getSelection();\n    if (selection !== null) {\n      onPasteForRichText(event, editor);\n      return true;\n    }\n    return false;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_SPACE_COMMAND, _ => {\n    const selection = $getSelection();\n    if ($isRangeSelection(selection)) {\n      $resetCapitalization(selection);\n    }\n    return false;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(KEY_TAB_COMMAND, _ => {\n    const selection = $getSelection();\n    if ($isRangeSelection(selection)) {\n      $resetCapitalization(selection);\n    }\n    return false;\n  }, COMMAND_PRIORITY_EDITOR));\n  return removeListener;\n}\n\n/**\n * An extension to register \\@lexical/rich-text behavior and nodes\n * ({@link HeadingNode}, {@link QuoteNode})\n */\nconst RichTextExtension = defineExtension({\n  conflictsWith: ['@lexical/plain-text'],\n  dependencies: [DragonExtension],\n  name: '@lexical/rich-text',\n  nodes: () => [HeadingNode, QuoteNode],\n  register: registerRichText\n});\n\nexport { $createHeadingNode, $createQuoteNode, $isHeadingNode, $isQuoteNode, DRAG_DROP_PASTE, HeadingNode, QuoteNode, RichTextExtension, eventFiles, registerRichText };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalRichText.dev.mjs';\nimport * as modProd from './LexicalRichText.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const $createHeadingNode = mod.$createHeadingNode;\nexport const $createQuoteNode = mod.$createQuoteNode;\nexport const $isHeadingNode = mod.$isHeadingNode;\nexport const $isQuoteNode = mod.$isQuoteNode;\nexport const DRAG_DROP_PASTE = mod.DRAG_DROP_PASTE;\nexport const HeadingNode = mod.HeadingNode;\nexport const QuoteNode = mod.QuoteNode;\nexport const RichTextExtension = mod.RichTextExtension;\nexport const eventFiles = mod.eventFiles;\nexport const registerRichText = mod.registerRichText;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { effect, namedSignals, batch, getPeerDependencyFromEditor } from '@lexical/extension';\nimport { mergeRegister } from '@lexical/utils';\nimport { defineExtension, safeCast, configExtension, UNDO_COMMAND, COMMAND_PRIORITY_EDITOR, REDO_COMMAND, CLEAR_EDITOR_COMMAND, CLEAR_HISTORY_COMMAND, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, COMPOSITION_START_TAG, HISTORIC_TAG, COMPOSITION_END_TAG, HISTORY_PUSH_TAG, HISTORY_MERGE_TAG, $isRangeSelection, $isTextNode, $isRootNode } from 'lexical';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst HISTORY_MERGE = 0;\nconst HISTORY_PUSH = 1;\nconst DISCARD_HISTORY_CANDIDATE = 2;\nconst OTHER = 0;\nconst COMPOSING_CHARACTER = 1;\nconst INSERT_CHARACTER_AFTER_SELECTION = 2;\nconst DELETE_CHARACTER_BEFORE_SELECTION = 3;\nconst DELETE_CHARACTER_AFTER_SELECTION = 4;\nfunction getDirtyNodes(editorState, dirtyLeaves, dirtyElements) {\n  const nodeMap = editorState._nodeMap;\n  const nodes = [];\n  for (const dirtyLeafKey of dirtyLeaves) {\n    const dirtyLeaf = nodeMap.get(dirtyLeafKey);\n    if (dirtyLeaf !== undefined) {\n      nodes.push(dirtyLeaf);\n    }\n  }\n  for (const [dirtyElementKey, intentionallyMarkedAsDirty] of dirtyElements) {\n    if (!intentionallyMarkedAsDirty) {\n      continue;\n    }\n    const dirtyElement = nodeMap.get(dirtyElementKey);\n    if (dirtyElement !== undefined && !$isRootNode(dirtyElement)) {\n      nodes.push(dirtyElement);\n    }\n  }\n  return nodes;\n}\nfunction getChangeType(prevEditorState, nextEditorState, dirtyLeavesSet, dirtyElementsSet, isComposing) {\n  if (prevEditorState === null || dirtyLeavesSet.size === 0 && dirtyElementsSet.size === 0 && !isComposing) {\n    return OTHER;\n  }\n  const nextSelection = nextEditorState._selection;\n  const prevSelection = prevEditorState._selection;\n  if (isComposing) {\n    return COMPOSING_CHARACTER;\n  }\n  if (!$isRangeSelection(nextSelection) || !$isRangeSelection(prevSelection) || !prevSelection.isCollapsed() || !nextSelection.isCollapsed()) {\n    return OTHER;\n  }\n  const dirtyNodes = getDirtyNodes(nextEditorState, dirtyLeavesSet, dirtyElementsSet);\n  if (dirtyNodes.length === 0) {\n    return OTHER;\n  }\n\n  // Catching the case when inserting new text node into an element (e.g. first char in paragraph/list),\n  // or after existing node.\n  if (dirtyNodes.length > 1) {\n    const nextNodeMap = nextEditorState._nodeMap;\n    const nextAnchorNode = nextNodeMap.get(nextSelection.anchor.key);\n    const prevAnchorNode = nextNodeMap.get(prevSelection.anchor.key);\n    if (nextAnchorNode && prevAnchorNode && !prevEditorState._nodeMap.has(nextAnchorNode.__key) && $isTextNode(nextAnchorNode) && nextAnchorNode.__text.length === 1 && nextSelection.anchor.offset === 1) {\n      return INSERT_CHARACTER_AFTER_SELECTION;\n    }\n    return OTHER;\n  }\n  const nextDirtyNode = dirtyNodes[0];\n  const prevDirtyNode = prevEditorState._nodeMap.get(nextDirtyNode.__key);\n  if (!$isTextNode(prevDirtyNode) || !$isTextNode(nextDirtyNode) || prevDirtyNode.__mode !== nextDirtyNode.__mode) {\n    return OTHER;\n  }\n  const prevText = prevDirtyNode.__text;\n  const nextText = nextDirtyNode.__text;\n  if (prevText === nextText) {\n    return OTHER;\n  }\n  const nextAnchor = nextSelection.anchor;\n  const prevAnchor = prevSelection.anchor;\n  if (nextAnchor.key !== prevAnchor.key || nextAnchor.type !== 'text') {\n    return OTHER;\n  }\n  const nextAnchorOffset = nextAnchor.offset;\n  const prevAnchorOffset = prevAnchor.offset;\n  const textDiff = nextText.length - prevText.length;\n  if (textDiff === 1 && prevAnchorOffset === nextAnchorOffset - 1) {\n    return INSERT_CHARACTER_AFTER_SELECTION;\n  }\n  if (textDiff === -1 && prevAnchorOffset === nextAnchorOffset + 1) {\n    return DELETE_CHARACTER_BEFORE_SELECTION;\n  }\n  if (textDiff === -1 && prevAnchorOffset === nextAnchorOffset) {\n    return DELETE_CHARACTER_AFTER_SELECTION;\n  }\n  return OTHER;\n}\nfunction isTextNodeUnchanged(key, prevEditorState, nextEditorState) {\n  const prevNode = prevEditorState._nodeMap.get(key);\n  const nextNode = nextEditorState._nodeMap.get(key);\n  const prevSelection = prevEditorState._selection;\n  const nextSelection = nextEditorState._selection;\n  const isDeletingLine = $isRangeSelection(prevSelection) && $isRangeSelection(nextSelection) && prevSelection.anchor.type === 'element' && prevSelection.focus.type === 'element' && nextSelection.anchor.type === 'text' && nextSelection.focus.type === 'text';\n  if (!isDeletingLine && $isTextNode(prevNode) && $isTextNode(nextNode) && prevNode.__parent === nextNode.__parent) {\n    // This has the assumption that object key order won't change if the\n    // content did not change, which should normally be safe given\n    // the manner in which nodes and exportJSON are typically implemented.\n    return JSON.stringify(prevEditorState.read(() => prevNode.exportJSON())) === JSON.stringify(nextEditorState.read(() => nextNode.exportJSON()));\n  }\n  return false;\n}\nfunction createMergeActionGetter(editor, delayOrStore, dateNow) {\n  let prevChangeTime = dateNow();\n  let prevChangeType = OTHER;\n  let compositionStartTime = prevChangeTime;\n  let compositionStartChangeType = OTHER;\n  let compositionStartState = null;\n  return (prevEditorState, nextEditorState, currentHistoryEntry, dirtyLeaves, dirtyElements, tags) => {\n    const changeTime = dateNow();\n    if (tags.has(COMPOSITION_START_TAG)) {\n      compositionStartTime = prevChangeTime;\n      compositionStartChangeType = prevChangeType;\n      compositionStartState = prevEditorState;\n    }\n\n    // If applying changes from history stack there's no need\n    // to run history logic again, as history entries already calculated\n    if (tags.has(HISTORIC_TAG)) {\n      prevChangeType = OTHER;\n      prevChangeTime = changeTime;\n      return DISCARD_HISTORY_CANDIDATE;\n    }\n    const isCompositionEnd = tags.has(COMPOSITION_END_TAG);\n    if (isCompositionEnd && compositionStartState) {\n      prevChangeTime = compositionStartTime;\n      prevChangeType = compositionStartChangeType;\n      prevEditorState = compositionStartState;\n    }\n    const changeType = getChangeType(prevEditorState, nextEditorState, dirtyLeaves, dirtyElements, editor.isComposing());\n    const mergeAction = (() => {\n      const isSameEditor = currentHistoryEntry === null || currentHistoryEntry.editor === editor;\n      const shouldPushHistory = tags.has(HISTORY_PUSH_TAG);\n      const shouldMergeHistory = !shouldPushHistory && isSameEditor && tags.has(HISTORY_MERGE_TAG);\n      if (shouldMergeHistory) {\n        return HISTORY_MERGE;\n      }\n      if (changeType === COMPOSING_CHARACTER) {\n        return DISCARD_HISTORY_CANDIDATE;\n      }\n      if (prevEditorState === null) {\n        return HISTORY_PUSH;\n      }\n      const selection = nextEditorState._selection;\n      const hasDirtyNodes = dirtyLeaves.size > 0 || dirtyElements.size > 0;\n      if (!hasDirtyNodes) {\n        if (selection !== null) {\n          return HISTORY_MERGE;\n        }\n        return DISCARD_HISTORY_CANDIDATE;\n      }\n      const delay = typeof delayOrStore === 'number' ? delayOrStore : delayOrStore.peek();\n      if (shouldPushHistory === false && changeType !== OTHER && changeType === prevChangeType && changeTime < prevChangeTime + delay && isSameEditor) {\n        return HISTORY_MERGE;\n      }\n\n      // A single node might have been marked as dirty, but not have changed\n      // due to some node transform reverting the change.\n      if (dirtyLeaves.size === 1) {\n        const dirtyLeafKey = Array.from(dirtyLeaves)[0];\n        if (isTextNodeUnchanged(dirtyLeafKey, prevEditorState, nextEditorState)) {\n          return HISTORY_MERGE;\n        }\n      }\n      return HISTORY_PUSH;\n    })();\n    prevChangeTime = changeTime;\n    prevChangeType = changeType;\n    return mergeAction;\n  };\n}\nfunction redo(editor, historyState) {\n  const redoStack = historyState.redoStack;\n  const undoStack = historyState.undoStack;\n  if (redoStack.length !== 0) {\n    const current = historyState.current;\n    if (current !== null) {\n      undoStack.push(current);\n      editor.dispatchCommand(CAN_UNDO_COMMAND, true);\n    }\n    const historyStateEntry = redoStack.pop();\n    if (redoStack.length === 0) {\n      editor.dispatchCommand(CAN_REDO_COMMAND, false);\n    }\n    historyState.current = historyStateEntry || null;\n    if (historyStateEntry) {\n      historyStateEntry.editor.setEditorState(historyStateEntry.editorState, {\n        tag: HISTORIC_TAG\n      });\n    }\n  }\n}\nfunction undo(editor, historyState) {\n  const redoStack = historyState.redoStack;\n  const undoStack = historyState.undoStack;\n  const undoStackLength = undoStack.length;\n  if (undoStackLength !== 0) {\n    const current = historyState.current;\n    const historyStateEntry = undoStack.pop();\n    if (current !== null) {\n      redoStack.push(current);\n      editor.dispatchCommand(CAN_REDO_COMMAND, true);\n    }\n    if (undoStack.length === 0) {\n      editor.dispatchCommand(CAN_UNDO_COMMAND, false);\n    }\n    historyState.current = historyStateEntry || null;\n    if (historyStateEntry) {\n      historyStateEntry.editor.setEditorState(historyStateEntry.editorState, {\n        tag: HISTORIC_TAG\n      });\n    }\n  }\n}\nfunction clearHistory(historyState) {\n  historyState.undoStack = [];\n  historyState.redoStack = [];\n  historyState.current = null;\n}\n\n/**\n * Registers necessary listeners to manage undo/redo history stack and related editor commands.\n * It returns `unregister` callback that cleans up all listeners and should be called on editor unmount.\n * @param editor - The lexical editor.\n * @param historyState - The history state, containing the current state and the undo/redo stack.\n * @param delay - The time (in milliseconds) the editor should delay generating a new history stack,\n * instead of merging the current changes with the current stack.\n * @returns The listeners cleanup callback function.\n */\nfunction registerHistory(editor, historyState, delay, dateNow = Date.now) {\n  const getMergeAction = createMergeActionGetter(editor, delay, dateNow);\n  const applyChange = ({\n    editorState,\n    prevEditorState,\n    dirtyLeaves,\n    dirtyElements,\n    tags\n  }) => {\n    const current = historyState.current;\n    const redoStack = historyState.redoStack;\n    const undoStack = historyState.undoStack;\n    const currentEditorState = current === null ? null : current.editorState;\n    if (current !== null && editorState === currentEditorState) {\n      return;\n    }\n    const mergeAction = getMergeAction(prevEditorState, editorState, current, dirtyLeaves, dirtyElements, tags);\n    if (mergeAction === HISTORY_PUSH) {\n      if (redoStack.length !== 0) {\n        historyState.redoStack = [];\n        editor.dispatchCommand(CAN_REDO_COMMAND, false);\n      }\n      if (current !== null) {\n        undoStack.push({\n          ...current\n        });\n        editor.dispatchCommand(CAN_UNDO_COMMAND, true);\n      }\n    } else if (mergeAction === DISCARD_HISTORY_CANDIDATE) {\n      return;\n    }\n\n    // Else we merge\n    historyState.current = {\n      editor,\n      editorState\n    };\n  };\n  return mergeRegister(editor.registerCommand(UNDO_COMMAND, () => {\n    undo(editor, historyState);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(REDO_COMMAND, () => {\n    redo(editor, historyState);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(CLEAR_EDITOR_COMMAND, () => {\n    clearHistory(historyState);\n    return false;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(CLEAR_HISTORY_COMMAND, () => {\n    clearHistory(historyState);\n    editor.dispatchCommand(CAN_REDO_COMMAND, false);\n    editor.dispatchCommand(CAN_UNDO_COMMAND, false);\n    return true;\n  }, COMMAND_PRIORITY_EDITOR), editor.registerUpdateListener(applyChange));\n}\n\n/**\n * Creates an empty history state.\n * @returns - The empty history state, as an object.\n */\nfunction createEmptyHistoryState() {\n  return {\n    current: null,\n    redoStack: [],\n    undoStack: []\n  };\n}\n/**\n * Registers necessary listeners to manage undo/redo history stack and related\n * editor commands, via the \\@lexical/history module.\n */\n\nconst HistoryExtension = defineExtension({\n  build: (editor, {\n    delay,\n    createInitialHistoryState,\n    disabled,\n    now\n  }) => namedSignals({\n    delay,\n    disabled,\n    historyState: createInitialHistoryState(editor),\n    now\n  }),\n  config: safeCast({\n    createInitialHistoryState: createEmptyHistoryState,\n    delay: 300,\n    disabled: typeof window === 'undefined',\n    now: Date.now\n  }),\n  name: '@lexical/history/History',\n  register: (editor, config, state) => {\n    const stores = state.getOutput();\n    return effect(() => stores.disabled.value ? undefined : registerHistory(editor, stores.historyState.value, stores.delay, () => stores.now.peek()()));\n  }\n});\nfunction getHistoryPeer(editor) {\n  return editor ? getPeerDependencyFromEditor(editor, HistoryExtension.name) : null;\n}\n/**\n * Registers necessary listeners to manage undo/redo history stack and related\n * editor commands, via the \\@lexical/history module, only if the parent editor\n * has a history plugin implementation.\n */\nconst SharedHistoryExtension = defineExtension({\n  build: (editor, {\n    disabled,\n    parentEditor\n  }) => namedSignals({\n    disabled,\n    parentEditor: parentEditor || editor._parentEditor\n  }),\n  config: safeCast({\n    disabled: false,\n    parentEditor: null\n  }),\n  dependencies: [configExtension(HistoryExtension, {\n    disabled: true\n  })],\n  name: '@lexical/history/SharedHistory',\n  register(editor, _config, state) {\n    return effect(() => {\n      const {\n        disabled,\n        parentEditor\n      } = state.getOutput();\n      if (!disabled.value) {\n        const {\n          output\n        } = state.getDependency(HistoryExtension);\n        const parentPeer = getHistoryPeer(parentEditor.value);\n        if (!parentPeer) {\n          return;\n        }\n        const parentOutput = parentPeer.output;\n        batch(() => {\n          output.delay.value = parentOutput.delay.value;\n          output.historyState.value = parentOutput.historyState.value;\n          output.now.value = parentOutput.now.value;\n          // Note that toggling the parent history will force this to be changed\n          output.disabled.value = parentOutput.disabled.value;\n        });\n      }\n    });\n  }\n});\n\nexport { HistoryExtension, SharedHistoryExtension, createEmptyHistoryState, registerHistory };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalHistory.dev.mjs';\nimport * as modProd from './LexicalHistory.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const HistoryExtension = mod.HistoryExtension;\nexport const SharedHistoryExtension = mod.SharedHistoryExtension;\nexport const createEmptyHistoryState = mod.createEmptyHistoryState;\nexport const registerHistory = mod.registerHistory;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as LexicalCodePrism from '@lexical/code-prism';\nexport { $createCodeHighlightNode, $createCodeNode, $getCodeLineDirection, $getEndOfCodeInLine, $getFirstCodeNodeOfLine, $getLastCodeNodeOfLine, $getStartOfCodeInLine, $isCodeHighlightNode, $isCodeNode, CodeExtension, CodeHighlightNode, CodeNode, DEFAULT_CODE_LANGUAGE, getDefaultCodeLanguage } from '@lexical/code-core';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n/** @deprecated moved to `@lexical/code-prism` */\nconst CODE_LANGUAGE_FRIENDLY_NAME_MAP = LexicalCodePrism.CODE_LANGUAGE_FRIENDLY_NAME_MAP;\n/** @deprecated moved to `@lexical/code-prism` */\nconst CODE_LANGUAGE_MAP = LexicalCodePrism.CODE_LANGUAGE_MAP;\n/** @deprecated moved to `@lexical/code-prism` */\nconst getCodeLanguageOptions = LexicalCodePrism.getCodeLanguageOptions;\n/** @deprecated moved to `@lexical/code-prism` */\nconst getCodeLanguages = LexicalCodePrism.getCodeLanguages;\n/** @deprecated moved to `@lexical/code-prism` */\nconst getCodeThemeOptions = LexicalCodePrism.getCodeThemeOptions;\n/** @deprecated moved to `@lexical/code-prism` */\nconst getLanguageFriendlyName = LexicalCodePrism.getLanguageFriendlyName;\n/** @deprecated renamed to `normalizeCodeLanguage` and moved to `@lexical/code-prism` */\nconst normalizeCodeLang = LexicalCodePrism.normalizeCodeLanguage;\n/** @deprecated moved to `@lexical/code-prism` */\nconst normalizeCodeLanguage = LexicalCodePrism.normalizeCodeLanguage;\n/** @deprecated moved to `@lexical/code-prism` */\nconst PrismTokenizer = LexicalCodePrism.PrismTokenizer;\n/** @deprecated moved to `@lexical/code-prism` */\nconst registerCodeHighlighting = LexicalCodePrism.registerCodeHighlighting;\n\nexport { CODE_LANGUAGE_FRIENDLY_NAME_MAP, CODE_LANGUAGE_MAP, PrismTokenizer, getCodeLanguageOptions, getCodeLanguages, getCodeThemeOptions, getLanguageFriendlyName, normalizeCodeLang, normalizeCodeLanguage, registerCodeHighlighting };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { $createCodeHighlightNode, DEFAULT_CODE_LANGUAGE, $isCodeNode, $isCodeHighlightNode, $getFirstCodeNodeOfLine, $getLastCodeNodeOfLine, $getCodeLineDirection, $getStartOfCodeInLine, $getEndOfCodeInLine, CodeNode, CodeHighlightNode, CodeExtension } from '@lexical/code-core';\nimport { effect, namedSignals } from '@lexical/extension';\nimport { $createLineBreakNode, $createTabNode, $createTextNode, $isLineBreakNode, $onUpdate, $getNodeByKey, $getSelection, $isRangeSelection, $isTextNode, $isTabNode, $createPoint, INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND, INSERT_TAB_COMMAND, $setSelectionFromCaretRange, $getCaretRangeInDirection, $getCaretRange, $getTextPointCaret, $normalizeCaret, $getSiblingCaret, KEY_ARROW_UP_COMMAND, MOVE_TO_START, TextNode, KEY_TAB_COMMAND, COMMAND_PRIORITY_LOW, $insertNodes, $getRoot, KEY_ARROW_DOWN_COMMAND, MOVE_TO_END, mergeRegister, defineExtension, safeCast } from 'lexical';\nimport 'prismjs';\nimport 'prismjs/components/prism-clike.js';\nimport 'prismjs/components/prism-javascript.js';\nimport 'prismjs/components/prism-markup.js';\nimport 'prismjs/components/prism-markdown.js';\nimport 'prismjs/components/prism-c.js';\nimport 'prismjs/components/prism-css.js';\nimport 'prismjs/components/prism-objectivec.js';\nimport 'prismjs/components/prism-sql.js';\nimport 'prismjs/components/prism-powershell.js';\nimport 'prismjs/components/prism-python.js';\nimport 'prismjs/components/prism-rust.js';\nimport 'prismjs/components/prism-swift.js';\nimport 'prismjs/components/prism-typescript.js';\nimport 'prismjs/components/prism-java.js';\nimport 'prismjs/components/prism-cpp.js';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n  throw new Error(message);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// invariant(condition, message) will refine types based on \"condition\", and\n// if \"condition\" is false will throw an error. This function is special-cased\n// in flow itself, so we can't name it anything else.\nfunction invariant(cond, message, ...args) {\n  if (cond) {\n    return;\n  }\n  throw new Error('Internal Lexical error: invariant() is meant to be replaced at compile ' + 'time. There is no runtime version. Error: ' + message);\n}\n\n(function (Prism) {\n\n\tPrism.languages.diff = {\n\t\t'coord': [\n\t\t\t// Match all kinds of coord lines (prefixed by \"+++\", \"---\" or \"***\").\n\t\t\t/^(?:\\*{3}|-{3}|\\+{3}).*$/m,\n\t\t\t// Match \"@@ ... @@\" coord lines in unified diff.\n\t\t\t/^@@.*@@$/m,\n\t\t\t// Match coord lines in normal diff (starts with a number).\n\t\t\t/^\\d.*$/m\n\t\t]\n\n\t\t// deleted, inserted, unchanged, diff\n\t};\n\n\t/**\n\t * A map from the name of a block to its line prefix.\n\t *\n\t * @type {Object<string, string>}\n\t */\n\tvar PREFIXES = {\n\t\t'deleted-sign': '-',\n\t\t'deleted-arrow': '<',\n\t\t'inserted-sign': '+',\n\t\t'inserted-arrow': '>',\n\t\t'unchanged': ' ',\n\t\t'diff': '!',\n\t};\n\n\t// add a token for each prefix\n\tObject.keys(PREFIXES).forEach(function (name) {\n\t\tvar prefix = PREFIXES[name];\n\n\t\tvar alias = [];\n\t\tif (!/^\\w+$/.test(name)) { // \"deleted-sign\" -> \"deleted\"\n\t\t\talias.push(/\\w+/.exec(name)[0]);\n\t\t}\n\t\tif (name === 'diff') {\n\t\t\talias.push('bold');\n\t\t}\n\n\t\tPrism.languages.diff[name] = {\n\t\t\tpattern: RegExp('^(?:[' + prefix + '].*(?:\\r\\n?|\\n|(?![\\\\s\\\\S])))+', 'm'),\n\t\t\talias: alias,\n\t\t\tinside: {\n\t\t\t\t'line': {\n\t\t\t\t\tpattern: /(.)(?=[\\s\\S]).*(?:\\r\\n?|\\n)?/,\n\t\t\t\t\tlookbehind: true\n\t\t\t\t},\n\t\t\t\t'prefix': {\n\t\t\t\t\tpattern: /[\\s\\S]/,\n\t\t\t\t\talias: /\\w+/.exec(name)[0]\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t});\n\n\t// make prefixes available to Diff plugin\n\tObject.defineProperty(Prism.languages.diff, 'PREFIXES', {\n\t\tvalue: PREFIXES\n\t});\n\n}(Prism));\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst Prism$1 = globalThis.Prism || window.Prism;\nconst CODE_LANGUAGE_FRIENDLY_NAME_MAP = {\n  c: 'C',\n  clike: 'C-like',\n  cpp: 'C++',\n  css: 'CSS',\n  html: 'HTML',\n  java: 'Java',\n  js: 'JavaScript',\n  markdown: 'Markdown',\n  objc: 'Objective-C',\n  plain: 'Plain Text',\n  powershell: 'PowerShell',\n  py: 'Python',\n  rust: 'Rust',\n  sql: 'SQL',\n  swift: 'Swift',\n  typescript: 'TypeScript',\n  xml: 'XML'\n};\nconst CODE_LANGUAGE_MAP = {\n  cpp: 'cpp',\n  java: 'java',\n  javascript: 'js',\n  md: 'markdown',\n  plaintext: 'plain',\n  python: 'py',\n  text: 'plain',\n  ts: 'typescript'\n};\nfunction normalizeCodeLanguage(lang) {\n  return CODE_LANGUAGE_MAP[lang] || lang;\n}\nfunction getLanguageFriendlyName(lang) {\n  const _lang = normalizeCodeLanguage(lang);\n  return CODE_LANGUAGE_FRIENDLY_NAME_MAP[_lang] || _lang;\n}\nconst getCodeLanguages = () => Object.keys(Prism$1.languages).filter(\n// Prism has several language helpers mixed into languages object\n// so filtering them out here to get langs list\nlanguage => typeof Prism$1.languages[language] !== 'function').sort();\nfunction getCodeLanguageOptions() {\n  const options = [];\n  for (const [lang, friendlyName] of Object.entries(CODE_LANGUAGE_FRIENDLY_NAME_MAP)) {\n    options.push([lang, friendlyName]);\n  }\n  return options;\n}\n\n// Prism has no theme support\nfunction getCodeThemeOptions() {\n  const options = [];\n  return options;\n}\nfunction getDiffedLanguage(language) {\n  const DIFF_LANGUAGE_REGEX = /^diff-([\\w-]+)/i;\n  const diffLanguageMatch = DIFF_LANGUAGE_REGEX.exec(language);\n  return diffLanguageMatch ? diffLanguageMatch[1] : null;\n}\nfunction isCodeLanguageLoaded(language) {\n  const diffedLanguage = getDiffedLanguage(language);\n  const langId = diffedLanguage ? diffedLanguage : language;\n  try {\n    // eslint-disable-next-line no-prototype-builtins\n    return langId ? Prism$1.languages.hasOwnProperty(langId) : false;\n  } catch (_unused) {\n    return false;\n  }\n}\nasync function loadCodeLanguage(language, editor, codeNodeKey) {\n  // NOT IMPLEMENTED\n}\nfunction getTextContent(token) {\n  if (typeof token === 'string') {\n    return token;\n  } else if (Array.isArray(token)) {\n    return token.map(getTextContent).join('');\n  } else {\n    return getTextContent(token.content);\n  }\n}\n\n// The following code is extracted/adapted from prismjs v2\n// It will probably be possible to use it directly from prism v2\n// in the future when prismjs v2 is published and Lexical upgrades\n// the prismsjs dependency\nfunction tokenizeDiffHighlight(tokens, language) {\n  const diffLanguage = language;\n  const diffGrammar = Prism$1.languages[diffLanguage];\n  const env = {\n    tokens\n  };\n  const PREFIXES = Prism$1.languages.diff.PREFIXES;\n  for (const token of env.tokens) {\n    if (typeof token === 'string' || !(token.type in PREFIXES) || !Array.isArray(token.content)) {\n      continue;\n    }\n    const type = token.type;\n    let insertedPrefixes = 0;\n    const getPrefixToken = () => {\n      insertedPrefixes++;\n      return new Prism$1.Token('prefix', PREFIXES[type], type.replace(/^(\\w+).*/, '$1'));\n    };\n    const withoutPrefixes = token.content.filter(t => typeof t === 'string' || t.type !== 'prefix');\n    const prefixCount = token.content.length - withoutPrefixes.length;\n    const diffTokens = Prism$1.tokenize(getTextContent(withoutPrefixes), diffGrammar);\n\n    // re-insert prefixes\n    // always add a prefix at the start\n    diffTokens.unshift(getPrefixToken());\n    const LINE_BREAK = /\\r\\n|\\n/g;\n    const insertAfterLineBreakString = text => {\n      const result = [];\n      LINE_BREAK.lastIndex = 0;\n      let last = 0;\n      let m;\n      while (insertedPrefixes < prefixCount && (m = LINE_BREAK.exec(text))) {\n        const end = m.index + m[0].length;\n        result.push(text.slice(last, end));\n        last = end;\n        result.push(getPrefixToken());\n      }\n      if (result.length === 0) {\n        return undefined;\n      }\n      if (last < text.length) {\n        result.push(text.slice(last));\n      }\n      return result;\n    };\n    const insertAfterLineBreak = toks => {\n      for (let i = 0; i < toks.length && insertedPrefixes < prefixCount; i++) {\n        const tok = toks[i];\n        if (typeof tok === 'string') {\n          const inserted = insertAfterLineBreakString(tok);\n          if (inserted) {\n            toks.splice(i, 1, ...inserted);\n            i += inserted.length - 1;\n          }\n        } else if (typeof tok.content === 'string') {\n          const inserted = insertAfterLineBreakString(tok.content);\n          if (inserted) {\n            tok.content = inserted;\n          }\n        } else if (Array.isArray(tok.content)) {\n          insertAfterLineBreak(tok.content);\n        } else {\n          insertAfterLineBreak([tok.content]);\n        }\n      }\n    };\n    insertAfterLineBreak(diffTokens);\n    if (insertedPrefixes < prefixCount) {\n      // we are missing the last prefix\n      diffTokens.push(getPrefixToken());\n    }\n    token.content = diffTokens;\n  }\n  return env.tokens;\n}\nfunction $getHighlightNodes(codeNode, language) {\n  const DIFF_LANGUAGE_REGEX = /^diff-([\\w-]+)/i;\n  const diffLanguageMatch = DIFF_LANGUAGE_REGEX.exec(language);\n  const code = codeNode.getTextContent();\n  let tokens = Prism$1.tokenize(code, Prism$1.languages[diffLanguageMatch ? 'diff' : language]);\n  if (diffLanguageMatch) {\n    tokens = tokenizeDiffHighlight(tokens, diffLanguageMatch[1]);\n  }\n  return $mapTokensToLexicalStructure(tokens);\n}\nfunction $mapTokensToLexicalStructure(tokens, type) {\n  const nodes = [];\n  for (const token of tokens) {\n    if (typeof token === 'string') {\n      const partials = token.split(/(\\n|\\t)/);\n      const partialsLength = partials.length;\n      for (let i = 0; i < partialsLength; i++) {\n        const part = partials[i];\n        if (part === '\\n' || part === '\\r\\n') {\n          nodes.push($createLineBreakNode());\n        } else if (part === '\\t') {\n          nodes.push($createTabNode());\n        } else if (part.length > 0) {\n          nodes.push($createCodeHighlightNode(part, type));\n        }\n      }\n    } else {\n      const {\n        content,\n        alias\n      } = token;\n      if (typeof content === 'string') {\n        nodes.push(...$mapTokensToLexicalStructure([content], token.type === 'prefix' && typeof alias === 'string' ? alias : token.type));\n      } else if (Array.isArray(content)) {\n        nodes.push(...$mapTokensToLexicalStructure(content, token.type === 'unchanged' ? undefined : token.type));\n      }\n    }\n  }\n  return nodes;\n}\n\nconst PrismTokenizer = {\n  $tokenize(codeNode, language) {\n    return $getHighlightNodes(codeNode, language || this.defaultLanguage);\n  },\n  defaultLanguage: DEFAULT_CODE_LANGUAGE,\n  tokenize(code, language) {\n    return Prism$1.tokenize(code, Prism$1.languages[language || ''] || Prism$1.languages[this.defaultLanguage]);\n  }\n};\nfunction $textNodeTransform(editor, tokenizer, transformState, node) {\n  // Since CodeNode has flat children structure we only need to check\n  // if node's parent is a code node and run highlighting if so\n  const parentNode = node.getParent();\n  if ($isCodeNode(parentNode)) {\n    $codeNodeTransform(editor, tokenizer, transformState, parentNode);\n  } else if ($isCodeHighlightNode(node)) {\n    // When code block converted into paragraph or other element\n    // code highlight nodes converted back to normal text\n    node.replace($createTextNode(node.__text));\n  }\n}\nfunction updateCodeGutter(node, editor) {\n  const codeElement = editor.getElementByKey(node.getKey());\n  if (codeElement === null) {\n    return;\n  }\n  const children = node.getChildren();\n  const childrenLength = children.length;\n  // @ts-ignore: internal field\n  if (childrenLength === codeElement.__cachedChildrenLength) {\n    // Avoid updating the attribute if the children length hasn't changed.\n    return;\n  }\n  // @ts-ignore:: internal field\n  codeElement.__cachedChildrenLength = childrenLength;\n  let gutter = '1';\n  let count = 1;\n  for (let i = 0; i < childrenLength; i++) {\n    if ($isLineBreakNode(children[i])) {\n      gutter += '\\n' + ++count;\n    }\n  }\n  codeElement.setAttribute('data-gutter', gutter);\n}\nfunction $codeNodeTransform(editor, tokenizer, transformState, node) {\n  const {\n    nodesCurrentlyHighlighting\n  } = transformState;\n  const nodeKey = node.getKey();\n\n  // When new code block inserted it might not have language selected\n  if (node.getLanguage() === undefined) {\n    node.setLanguage(tokenizer.defaultLanguage);\n  }\n  const language = node.getLanguage() || tokenizer.defaultLanguage;\n  if (isCodeLanguageLoaded(language)) {\n    if (!node.getIsSyntaxHighlightSupported()) {\n      node.setIsSyntaxHighlightSupported(true);\n    }\n  } else {\n    if (node.getIsSyntaxHighlightSupported()) {\n      node.setIsSyntaxHighlightSupported(false);\n    }\n    loadCodeLanguage(language, editor, nodeKey);\n    return;\n  }\n  if (nodesCurrentlyHighlighting.has(nodeKey)) {\n    return;\n  }\n  nodesCurrentlyHighlighting.add(nodeKey);\n  if (!transformState.didTransform) {\n    transformState.didTransform = true;\n    $onUpdate(() => {\n      transformState.didTransform = false;\n      nodesCurrentlyHighlighting.clear();\n    });\n  }\n  $updateAndRetainSelection(nodeKey, () => {\n    const currentNode = $getNodeByKey(nodeKey);\n    if (!$isCodeNode(currentNode) || !currentNode.isAttached()) {\n      return false;\n    }\n    //const DIFF_LANGUAGE_REGEX = /^diff-([\\w-]+)/i;\n    const currentLanguage = currentNode.getLanguage() || tokenizer.defaultLanguage;\n    //const diffLanguageMatch = DIFF_LANGUAGE_REGEX.exec(currentLanguage);\n\n    const highlightNodes = tokenizer.$tokenize(currentNode, currentLanguage);\n    const diffRange = getDiffRange(currentNode.getChildren(), highlightNodes);\n    const {\n      from,\n      to,\n      nodesForReplacement\n    } = diffRange;\n    if (from !== to || nodesForReplacement.length) {\n      node.splice(from, to - from, nodesForReplacement);\n      return true;\n    }\n    return false;\n  });\n}\n\n// Wrapping update function into selection retainer, that tries to keep cursor at the same\n// position as before.\nfunction $updateAndRetainSelection(nodeKey, updateFn) {\n  const node = $getNodeByKey(nodeKey);\n  if (!$isCodeNode(node) || !node.isAttached()) {\n    return;\n  }\n  const selection = $getSelection();\n  // If it's not range selection (or null selection) there's no need to change it,\n  // but we can still run highlighting logic\n  if (!$isRangeSelection(selection)) {\n    updateFn();\n    return;\n  }\n  const anchor = selection.anchor;\n  const anchorOffset = anchor.offset;\n  const isNewLineAnchor = anchor.type === 'element' && $isLineBreakNode(node.getChildAtIndex(anchor.offset - 1));\n  let textOffset = 0;\n\n  // Calculating previous text offset (all text node prior to anchor + anchor own text offset)\n  if (!isNewLineAnchor) {\n    const anchorNode = anchor.getNode();\n    textOffset = anchorOffset + anchorNode.getPreviousSiblings().reduce((offset, _node) => {\n      return offset + _node.getTextContentSize();\n    }, 0);\n  }\n  const hasChanges = updateFn();\n  if (!hasChanges) {\n    return;\n  }\n\n  // Non-text anchors only happen for line breaks, otherwise\n  // selection will be within text node (code highlight node)\n  if (isNewLineAnchor) {\n    anchor.getNode().select(anchorOffset, anchorOffset);\n    return;\n  }\n\n  // If it was non-element anchor then we walk through child nodes\n  // and looking for a position of original text offset\n  node.getChildren().some(_node => {\n    const isText = $isTextNode(_node);\n    if (isText || $isLineBreakNode(_node)) {\n      const textContentSize = _node.getTextContentSize();\n      if (isText && textContentSize >= textOffset) {\n        _node.select(textOffset, textOffset);\n        return true;\n      }\n      textOffset -= textContentSize;\n    }\n    return false;\n  });\n}\n\n// Finds minimal diff range between two nodes lists. It returns from/to range boundaries of prevNodes\n// that needs to be replaced with `nodes` (subset of nextNodes) to make prevNodes equal to nextNodes.\nfunction getDiffRange(prevNodes, nextNodes) {\n  let leadingMatch = 0;\n  while (leadingMatch < prevNodes.length) {\n    if (!isEqual(prevNodes[leadingMatch], nextNodes[leadingMatch])) {\n      break;\n    }\n    leadingMatch++;\n  }\n  const prevNodesLength = prevNodes.length;\n  const nextNodesLength = nextNodes.length;\n  const maxTrailingMatch = Math.min(prevNodesLength, nextNodesLength) - leadingMatch;\n  let trailingMatch = 0;\n  while (trailingMatch < maxTrailingMatch) {\n    trailingMatch++;\n    if (!isEqual(prevNodes[prevNodesLength - trailingMatch], nextNodes[nextNodesLength - trailingMatch])) {\n      trailingMatch--;\n      break;\n    }\n  }\n  const from = leadingMatch;\n  const to = prevNodesLength - trailingMatch;\n  const nodesForReplacement = nextNodes.slice(leadingMatch, nextNodesLength - trailingMatch);\n  return {\n    from,\n    nodesForReplacement,\n    to\n  };\n}\nfunction isEqual(nodeA, nodeB) {\n  // Only checking for code highlight nodes, tabs and linebreaks. If it's regular text node\n  // returning false so that it's transformed into code highlight node\n  return $isCodeHighlightNode(nodeA) && $isCodeHighlightNode(nodeB) && nodeA.__text === nodeB.__text && nodeA.__highlightType === nodeB.__highlightType || $isTabNode(nodeA) && $isTabNode(nodeB) || $isLineBreakNode(nodeA) && $isLineBreakNode(nodeB);\n}\n\n/**\n * Returns a boolean.\n * Check that the selection span is within a single CodeNode.\n * This is used to guard against executing handlers that can only be\n * applied in a single CodeNode context\n */\nfunction $isSelectionInCode(selection) {\n  if (!$isRangeSelection(selection)) {\n    return false;\n  }\n  const anchorNode = selection.anchor.getNode();\n  const maybeAnchorCodeNode = $isCodeNode(anchorNode) ? anchorNode : anchorNode.getParent();\n  const focusNode = selection.focus.getNode();\n  const maybeFocusCodeNode = $isCodeNode(focusNode) ? focusNode : focusNode.getParent();\n  return $isCodeNode(maybeAnchorCodeNode) && maybeAnchorCodeNode.is(maybeFocusCodeNode);\n}\n\n/**\n * Returns an Array of code lines\n * Take the sequence of LineBreakNode | TabNode | CodeHighlightNode forming\n * the selection and split it by LineBreakNode.\n * If the selection ends at the start of the last line, it is considered empty.\n * Empty lines are discarded.\n */\nfunction $getCodeLines(selection) {\n  const nodes = selection.getNodes();\n  const lines = [];\n  if (nodes.length === 1 && $isCodeNode(nodes[0])) {\n    return lines;\n  }\n  let lastLine = [];\n  for (let i = 0; i < nodes.length; i++) {\n    const node = nodes[i];\n    if (!($isCodeHighlightNode(node) || $isTabNode(node) || $isLineBreakNode(node))) {\n      formatDevErrorMessage(`Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode`);\n    }\n    if ($isLineBreakNode(node)) {\n      if (lastLine.length > 0) {\n        lines.push(lastLine);\n        lastLine = [];\n      }\n    } else {\n      lastLine.push(node);\n    }\n  }\n  if (lastLine.length > 0) {\n    const selectionEnd = selection.isBackward() ? selection.anchor : selection.focus;\n\n    // Discard the last line if the selection ends exactly at the\n    // start of the line (no real selection)\n    const lastPoint = $createPoint(lastLine[0].getKey(), 0, 'text');\n    if (!selectionEnd.is(lastPoint)) {\n      lines.push(lastLine);\n    }\n  }\n  return lines;\n}\nfunction $handleTab(shiftKey) {\n  const selection = $getSelection();\n  if (!$isRangeSelection(selection) || !$isSelectionInCode(selection)) {\n    return null;\n  }\n  const indentOrOutdent = !shiftKey ? INDENT_CONTENT_COMMAND : OUTDENT_CONTENT_COMMAND;\n  const tabOrOutdent = !shiftKey ? INSERT_TAB_COMMAND : OUTDENT_CONTENT_COMMAND;\n  const anchor = selection.anchor;\n  const focus = selection.focus;\n\n  // 1. early decision when there is no real selection\n  if (anchor.is(focus)) {\n    return tabOrOutdent;\n  }\n\n  // 2. If only empty lines or multiple non-empty lines are selected: indent/outdent\n  const codeLines = $getCodeLines(selection);\n  if (codeLines.length !== 1) {\n    return indentOrOutdent;\n  }\n  const codeLine = codeLines[0];\n  const codeLineLength = codeLine.length;\n  if (!(codeLineLength !== 0)) {\n    formatDevErrorMessage(`$getCodeLines only extracts non-empty lines`);\n  } // Take into account the direction of the selection\n  let selectionFirst;\n  let selectionLast;\n  if (selection.isBackward()) {\n    selectionFirst = focus;\n    selectionLast = anchor;\n  } else {\n    selectionFirst = anchor;\n    selectionLast = focus;\n  }\n\n  // find boundary elements of the line\n  // since codeLine only contains TabNode | CodeHighlightNode\n  // the result of these functions should is of Type TabNode | CodeHighlightNode\n  const firstOfLine = $getFirstCodeNodeOfLine(codeLine[0]);\n  const lastOfLine = $getLastCodeNodeOfLine(codeLine[0]);\n  const anchorOfLine = $createPoint(firstOfLine.getKey(), 0, 'text');\n  const focusOfLine = $createPoint(lastOfLine.getKey(), lastOfLine.getTextContentSize(), 'text');\n\n  // 3. multiline because selection started strictly before the line\n  if (selectionFirst.isBefore(anchorOfLine)) {\n    return indentOrOutdent;\n  }\n\n  // 4. multiline because the selection stops strictly after the line\n  if (focusOfLine.isBefore(selectionLast)) {\n    return indentOrOutdent;\n  }\n\n  // The selection if within the line.\n  // 4. If it does not touch both borders, it needs a tab\n  if (anchorOfLine.isBefore(selectionFirst) || selectionLast.isBefore(focusOfLine)) {\n    return tabOrOutdent;\n  }\n\n  // 5. Selection is matching a full line on non-empty code\n  return indentOrOutdent;\n}\nfunction $handleMultilineIndent(type) {\n  const selection = $getSelection();\n  if (!$isRangeSelection(selection) || !$isSelectionInCode(selection)) {\n    return false;\n  }\n  const codeLines = $getCodeLines(selection);\n  const codeLinesLength = codeLines.length;\n\n  // Special Indent case\n  // Selection is collapsed at the beginning of a line\n  if (codeLinesLength === 0 && selection.isCollapsed()) {\n    if (type === INDENT_CONTENT_COMMAND) {\n      selection.insertNodes([$createTabNode()]);\n    }\n    return true;\n  }\n\n  // Special Indent case\n  // Selection is matching only one LineBreak\n  if (codeLinesLength === 0 && type === INDENT_CONTENT_COMMAND && selection.getTextContent() === '\\n') {\n    const tabNode = $createTabNode();\n    const lineBreakNode = $createLineBreakNode();\n    const direction = selection.isBackward() ? 'previous' : 'next';\n    selection.insertNodes([tabNode, lineBreakNode]);\n    $setSelectionFromCaretRange($getCaretRangeInDirection($getCaretRange($getTextPointCaret(tabNode, 'next', 0), $normalizeCaret($getSiblingCaret(lineBreakNode, 'next'))), direction));\n    return true;\n  }\n\n  // Indent Non Empty Lines\n  for (let i = 0; i < codeLinesLength; i++) {\n    const line = codeLines[i];\n    // a line here is never empty\n    if (line.length > 0) {\n      let firstOfLine = line[0];\n\n      // make sure to consider the first node on the first line\n      // because the line might not be fully selected\n      if (i === 0) {\n        firstOfLine = $getFirstCodeNodeOfLine(firstOfLine);\n      }\n      if (type === INDENT_CONTENT_COMMAND) {\n        const tabNode = $createTabNode();\n        firstOfLine.insertBefore(tabNode);\n        // First real code line may need selection adjustment\n        // when firstOfLine is at the selection boundary\n        if (i === 0) {\n          const anchorKey = selection.isBackward() ? 'focus' : 'anchor';\n          const anchorLine = $createPoint(firstOfLine.getKey(), 0, 'text');\n          if (selection[anchorKey].is(anchorLine)) {\n            selection[anchorKey].set(tabNode.getKey(), 0, 'text');\n          }\n        }\n      } else if ($isTabNode(firstOfLine)) {\n        firstOfLine.remove();\n      }\n    }\n  }\n  return true;\n}\nfunction $handleShiftLines(type, event) {\n  // We only care about the alt+arrow keys\n  const selection = $getSelection();\n  if (!$isRangeSelection(selection)) {\n    return false;\n  }\n\n  // I'm not quite sure why, but it seems like calling anchor.getNode() collapses the selection here\n  // So first, get the anchor and the focus, then get their nodes\n  const {\n    anchor,\n    focus\n  } = selection;\n  const anchorOffset = anchor.offset;\n  const focusOffset = focus.offset;\n  const anchorNode = anchor.getNode();\n  const focusNode = focus.getNode();\n  const arrowIsUp = type === KEY_ARROW_UP_COMMAND;\n\n  // Ensure the selection is within the codeblock\n  if (!$isSelectionInCode(selection) || !($isCodeHighlightNode(anchorNode) || $isTabNode(anchorNode)) || !($isCodeHighlightNode(focusNode) || $isTabNode(focusNode))) {\n    return false;\n  }\n  if (!event.altKey) {\n    // Handle moving selection out of the code block, given there are no\n    // siblings that can natively take the selection.\n    if (selection.isCollapsed()) {\n      const codeNode = anchorNode.getParentOrThrow();\n      if (arrowIsUp && anchorOffset === 0 && anchorNode.getPreviousSibling() === null) {\n        const codeNodeSibling = codeNode.getPreviousSibling();\n        if (codeNodeSibling === null) {\n          codeNode.selectPrevious();\n          event.preventDefault();\n          return true;\n        }\n      } else if (!arrowIsUp && anchorOffset === anchorNode.getTextContentSize() && anchorNode.getNextSibling() === null) {\n        const codeNodeSibling = codeNode.getNextSibling();\n        if (codeNodeSibling === null) {\n          codeNode.selectNext();\n          event.preventDefault();\n          return true;\n        }\n      }\n    }\n    return false;\n  }\n  let start;\n  let end;\n  if (anchorNode.isBefore(focusNode)) {\n    start = $getFirstCodeNodeOfLine(anchorNode);\n    end = $getLastCodeNodeOfLine(focusNode);\n  } else {\n    start = $getFirstCodeNodeOfLine(focusNode);\n    end = $getLastCodeNodeOfLine(anchorNode);\n  }\n  if (start == null || end == null) {\n    return false;\n  }\n  const range = start.getNodesBetween(end);\n  for (let i = 0; i < range.length; i++) {\n    const node = range[i];\n    if (!$isCodeHighlightNode(node) && !$isTabNode(node) && !$isLineBreakNode(node)) {\n      return false;\n    }\n  }\n\n  // After this point, we know the selection is within the codeblock. We may not be able to\n  // actually move the lines around, but we want to return true either way to prevent\n  // the event's default behavior\n  event.preventDefault();\n  event.stopPropagation(); // required to stop cursor movement under Firefox\n\n  const linebreak = arrowIsUp ? start.getPreviousSibling() : end.getNextSibling();\n  if (!$isLineBreakNode(linebreak)) {\n    return true;\n  }\n  const sibling = arrowIsUp ? linebreak.getPreviousSibling() : linebreak.getNextSibling();\n  if (sibling == null) {\n    return true;\n  }\n  const maybeInsertionPoint = $isCodeHighlightNode(sibling) || $isTabNode(sibling) || $isLineBreakNode(sibling) ? arrowIsUp ? $getFirstCodeNodeOfLine(sibling) : $getLastCodeNodeOfLine(sibling) : null;\n  let insertionPoint = maybeInsertionPoint != null ? maybeInsertionPoint : sibling;\n  linebreak.remove();\n  range.forEach(node => node.remove());\n  if (type === KEY_ARROW_UP_COMMAND) {\n    range.forEach(node => insertionPoint.insertBefore(node));\n    insertionPoint.insertBefore(linebreak);\n  } else {\n    insertionPoint.insertAfter(linebreak);\n    insertionPoint = linebreak;\n    range.forEach(node => {\n      insertionPoint.insertAfter(node);\n      insertionPoint = node;\n    });\n  }\n  selection.setTextNodeRange(anchorNode, anchorOffset, focusNode, focusOffset);\n  return true;\n}\nfunction $handleMoveTo(type, event) {\n  const selection = $getSelection();\n  if (!$isRangeSelection(selection)) {\n    return false;\n  }\n  const {\n    anchor,\n    focus\n  } = selection;\n  const anchorNode = anchor.getNode();\n  const focusNode = focus.getNode();\n  const isMoveToStart = type === MOVE_TO_START;\n\n  // Ensure the selection is within the codeblock\n  if (!$isSelectionInCode(selection) || !($isCodeHighlightNode(anchorNode) || $isTabNode(anchorNode)) || !($isCodeHighlightNode(focusNode) || $isTabNode(focusNode))) {\n    return false;\n  }\n  const focusLineNode = focusNode;\n  const direction = $getCodeLineDirection(focusLineNode);\n  const moveToStart = direction === 'rtl' ? !isMoveToStart : isMoveToStart;\n  if (moveToStart) {\n    const start = $getStartOfCodeInLine(focusLineNode, focus.offset);\n    if (start !== null) {\n      const {\n        node,\n        offset\n      } = start;\n      if ($isLineBreakNode(node)) {\n        node.selectNext(0, 0);\n      } else {\n        selection.setTextNodeRange(node, offset, node, offset);\n      }\n    } else {\n      focusLineNode.getParentOrThrow().selectStart();\n    }\n  } else {\n    const node = $getEndOfCodeInLine(focusLineNode);\n    node.select();\n  }\n  event.preventDefault();\n  event.stopPropagation();\n  return true;\n}\nfunction registerCodeHighlighting(editor, tokenizer) {\n  if (!editor.hasNodes([CodeNode, CodeHighlightNode])) {\n    throw new Error('CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor');\n  }\n  if (tokenizer == null) {\n    tokenizer = PrismTokenizer;\n  }\n  const registrations = [];\n\n  // Only register the mutation listener if not in headless mode\n  if (editor._headless !== true) {\n    registrations.push(editor.registerMutationListener(CodeNode, mutations => {\n      editor.getEditorState().read(() => {\n        for (const [key, type] of mutations) {\n          if (type !== 'destroyed') {\n            const node = $getNodeByKey(key);\n            if (node !== null) {\n              updateCodeGutter(node, editor);\n            }\n          }\n        }\n      });\n    }, {\n      skipInitialization: false\n    }));\n  }\n  const transformState = {\n    didTransform: false,\n    nodesCurrentlyHighlighting: new Set()\n  };\n  // Add the rest of the registrations\n  registrations.push(editor.registerNodeTransform(CodeNode, $codeNodeTransform.bind(null, editor, tokenizer, transformState)), editor.registerNodeTransform(TextNode, $textNodeTransform.bind(null, editor, tokenizer, transformState)), editor.registerNodeTransform(CodeHighlightNode, $textNodeTransform.bind(null, editor, tokenizer, transformState)), editor.registerCommand(KEY_TAB_COMMAND, event => {\n    const command = $handleTab(event.shiftKey);\n    if (command === null) {\n      return false;\n    }\n    event.preventDefault();\n    editor.dispatchCommand(command, undefined);\n    return true;\n  }, COMMAND_PRIORITY_LOW), editor.registerCommand(INSERT_TAB_COMMAND, () => {\n    const selection = $getSelection();\n    if (!$isSelectionInCode(selection)) {\n      return false;\n    }\n    $insertNodes([$createTabNode()]);\n    return true;\n  }, COMMAND_PRIORITY_LOW), editor.registerCommand(INDENT_CONTENT_COMMAND, payload => $handleMultilineIndent(INDENT_CONTENT_COMMAND), COMMAND_PRIORITY_LOW), editor.registerCommand(OUTDENT_CONTENT_COMMAND, payload => $handleMultilineIndent(OUTDENT_CONTENT_COMMAND), COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_ARROW_UP_COMMAND, event => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection) || !$isSelectionInCode(selection)) {\n      return false;\n    }\n    const firstNode = $getRoot().getFirstDescendant();\n    const {\n      anchor\n    } = selection;\n    const anchorNode = anchor.getNode();\n    if (firstNode && anchorNode && firstNode.getKey() === anchorNode.getKey()) {\n      return false;\n    }\n    return $handleShiftLines(KEY_ARROW_UP_COMMAND, event);\n  }, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_ARROW_DOWN_COMMAND, event => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection) || !$isSelectionInCode(selection)) {\n      return false;\n    }\n    const lastNode = $getRoot().getLastDescendant();\n    const {\n      anchor\n    } = selection;\n    const anchorNode = anchor.getNode();\n    if (lastNode && anchorNode && lastNode.getKey() === anchorNode.getKey()) {\n      return false;\n    }\n    return $handleShiftLines(KEY_ARROW_DOWN_COMMAND, event);\n  }, COMMAND_PRIORITY_LOW), editor.registerCommand(MOVE_TO_START, event => $handleMoveTo(MOVE_TO_START, event), COMMAND_PRIORITY_LOW), editor.registerCommand(MOVE_TO_END, event => $handleMoveTo(MOVE_TO_END, event), COMMAND_PRIORITY_LOW));\n  return mergeRegister(...registrations);\n}\n/**\n * Add code highlighting support for code blocks with Prism.\n *\n * {@link CodeExtension} is a dependency, so the required `CodeNode` and\n * `CodeHighlightNode` nodes are registered automatically.\n */\nconst CodePrismExtension = defineExtension({\n  build: (editor, config) => namedSignals(config),\n  config: safeCast({\n    disabled: false,\n    tokenizer: PrismTokenizer\n  }),\n  dependencies: [CodeExtension],\n  name: '@lexical/code-prism',\n  register: (editor, config, state) => {\n    const stores = state.getOutput();\n    return effect(() => {\n      if (stores.disabled.value) {\n        return;\n      }\n      return registerCodeHighlighting(editor, stores.tokenizer.value);\n    });\n  }\n});\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nexport { CODE_LANGUAGE_FRIENDLY_NAME_MAP, CODE_LANGUAGE_MAP, CodePrismExtension, PrismTokenizer, getCodeLanguageOptions, getCodeLanguages, getCodeThemeOptions, getLanguageFriendlyName, isCodeLanguageLoaded, loadCodeLanguage, normalizeCodeLanguage, registerCodeHighlighting };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { getTextDirection, $isElementNode, $isTabNode, $isLineBreakNode, $getSiblingCaret, $create, ElementNode, addClassNamesToElement, setDOMStyleFromCSS, $getEditor, $isTextNode, $createTabNode, $createLineBreakNode, $createParagraphNode, isHTMLElement, $applyNodeReplacement, TextNode, removeClassNamesFromElement, defineExtension, KEY_ENTER_COMMAND, $getSelection, $isRangeSelection, COMMAND_PRIORITY_LOW } from 'lexical';\nimport { getPeerDependencyFromEditor } from '@lexical/extension';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/*@__INLINE__*/\nfunction warnOnlyOnce(message) {\n  {\n    let run = false;\n    return () => {\n      if (!run) {\n        console.warn(message);\n      }\n      run = true;\n    };\n  }\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n  throw new Error(message);\n}\n\nfunction $getLastMatchingCodeNode(anchor, direction) {\n  let matchingNode = anchor;\n  for (let caret = $getSiblingCaret(anchor, direction); caret && ($isCodeHighlightNode(caret.origin) || $isTabNode(caret.origin)); caret = caret.getAdjacentCaret()) {\n    matchingNode = caret.origin;\n  }\n  return matchingNode;\n}\nfunction $getFirstCodeNodeOfLine(anchor) {\n  return $getLastMatchingCodeNode(anchor, 'previous');\n}\nfunction $getLastCodeNodeOfLine(anchor) {\n  return $getLastMatchingCodeNode(anchor, 'next');\n}\n\n/**\n * Determines the visual writing direction of a code line.\n *\n * Scans the line segments (CodeHighlightNode/TabNode) from start to end\n * and returns the first strong direction found (\"ltr\" or \"rtl\").\n * If no strong character is found, falls back to the parent element's\n * direction. Returns null if indeterminate.\n */\nfunction $getCodeLineDirection(anchor) {\n  const start = $getFirstCodeNodeOfLine(anchor);\n  const end = $getLastCodeNodeOfLine(anchor);\n  let node = start;\n  while (node !== null) {\n    if ($isCodeHighlightNode(node)) {\n      const direction = getTextDirection(node.getTextContent());\n      if (direction !== null) {\n        return direction;\n      }\n    }\n    if (node === end) {\n      break;\n    }\n    node = node.getNextSibling();\n  }\n  const parent = start.getParent();\n  if ($isElementNode(parent)) {\n    const parentDirection = parent.getDirection();\n    if (parentDirection === 'ltr' || parentDirection === 'rtl') {\n      return parentDirection;\n    }\n  }\n  return null;\n}\nfunction $getStartOfCodeInLine(anchor, offset) {\n  let last = null;\n  let lastNonBlank = null;\n  let node = anchor;\n  let nodeOffset = offset;\n  let nodeTextContent = anchor.getTextContent();\n  while (true) {\n    if (nodeOffset === 0) {\n      node = node.getPreviousSibling();\n      if (node === null) {\n        break;\n      }\n      if (!($isCodeHighlightNode(node) || $isTabNode(node) || $isLineBreakNode(node))) {\n        formatDevErrorMessage(`Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode`);\n      }\n      if ($isLineBreakNode(node)) {\n        last = {\n          node,\n          offset: 1\n        };\n        break;\n      }\n      nodeOffset = Math.max(0, node.getTextContentSize() - 1);\n      nodeTextContent = node.getTextContent();\n    } else {\n      nodeOffset--;\n    }\n    const character = nodeTextContent[nodeOffset];\n    if ($isCodeHighlightNode(node) && character !== ' ') {\n      lastNonBlank = {\n        node,\n        offset: nodeOffset\n      };\n    }\n  }\n  // lastNonBlank !== null: anchor in the middle of code; move to line beginning\n  if (lastNonBlank !== null) {\n    return lastNonBlank;\n  }\n  // Spaces, tabs or nothing ahead of anchor\n  let codeCharacterAtAnchorOffset = null;\n  if (offset < anchor.getTextContentSize()) {\n    if ($isCodeHighlightNode(anchor)) {\n      codeCharacterAtAnchorOffset = anchor.getTextContent()[offset];\n    }\n  } else {\n    const nextSibling = anchor.getNextSibling();\n    if ($isCodeHighlightNode(nextSibling)) {\n      codeCharacterAtAnchorOffset = nextSibling.getTextContent()[0];\n    }\n  }\n  if (codeCharacterAtAnchorOffset !== null && codeCharacterAtAnchorOffset !== ' ') {\n    // Borderline whitespace and code, move to line beginning\n    return last;\n  } else {\n    const nextNonBlank = findNextNonBlankInLine(anchor, offset);\n    if (nextNonBlank !== null) {\n      return nextNonBlank;\n    } else {\n      return last;\n    }\n  }\n}\nfunction findNextNonBlankInLine(anchor, offset) {\n  let node = anchor;\n  let nodeOffset = offset;\n  let nodeTextContent = anchor.getTextContent();\n  let nodeTextContentSize = anchor.getTextContentSize();\n  while (true) {\n    if (!$isCodeHighlightNode(node) || nodeOffset === nodeTextContentSize) {\n      node = node.getNextSibling();\n      if (node === null || $isLineBreakNode(node)) {\n        return null;\n      }\n      if ($isCodeHighlightNode(node)) {\n        nodeOffset = 0;\n        nodeTextContent = node.getTextContent();\n        nodeTextContentSize = node.getTextContentSize();\n      }\n    }\n    if ($isCodeHighlightNode(node)) {\n      if (nodeTextContent[nodeOffset] !== ' ') {\n        return {\n          node,\n          offset: nodeOffset\n        };\n      }\n      nodeOffset++;\n    }\n  }\n}\nfunction $getEndOfCodeInLine(anchor) {\n  const lastNode = $getLastCodeNodeOfLine(anchor);\n  if (!!$isLineBreakNode(lastNode)) {\n    formatDevErrorMessage(`Unexpected lineBreakNode in getEndOfCodeInLine`);\n  }\n  return lastNode;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst DEFAULT_CODE_LANGUAGE = 'javascript';\nconst getDefaultCodeLanguage = () => DEFAULT_CODE_LANGUAGE;\nfunction hasChildDOMNodeTag(node, tagName) {\n  for (const child of node.childNodes) {\n    if (isHTMLElement(child) && child.tagName === tagName) {\n      return true;\n    }\n    hasChildDOMNodeTag(child, tagName);\n  }\n  return false;\n}\nconst LANGUAGE_DATA_ATTRIBUTE = 'data-language';\nconst HIGHLIGHT_LANGUAGE_DATA_ATTRIBUTE = 'data-highlight-language';\nconst THEME_DATA_ATTRIBUTE = 'data-theme';\nconst noExtensionDeprecation = warnOnlyOnce('Using CodeNode without CodeExtension is deprecated');\n\n/** @noInheritDoc */\nclass CodeNode extends ElementNode {\n  /** @internal */\n  __language;\n  /** @internal */\n  __theme;\n  /** @internal */\n  __isSyntaxHighlightSupported;\n  static getType() {\n    return 'code';\n  }\n  static clone(node) {\n    return new CodeNode(node.__language, node.__key);\n  }\n  constructor(language, key) {\n    super(key);\n    this.__language = language || undefined;\n    this.__isSyntaxHighlightSupported = false;\n    this.__theme = undefined;\n  }\n  afterCloneFrom(prevNode) {\n    super.afterCloneFrom(prevNode);\n    this.__language = prevNode.__language;\n    this.__theme = prevNode.__theme;\n    this.__isSyntaxHighlightSupported = prevNode.__isSyntaxHighlightSupported;\n  }\n\n  // View\n  createDOM(config) {\n    const element = document.createElement('code');\n    addClassNamesToElement(element, config.theme.code);\n    element.setAttribute('spellcheck', 'false');\n    const language = this.getLanguage();\n    if (language) {\n      element.setAttribute(LANGUAGE_DATA_ATTRIBUTE, language);\n      if (this.getIsSyntaxHighlightSupported()) {\n        element.setAttribute(HIGHLIGHT_LANGUAGE_DATA_ATTRIBUTE, language);\n      }\n    }\n    const theme = this.getTheme();\n    if (theme) {\n      element.setAttribute(THEME_DATA_ATTRIBUTE, theme);\n    }\n    const style = this.getStyle();\n    if (style) {\n      setDOMStyleFromCSS(element.style, style);\n    }\n    return element;\n  }\n  updateDOM(prevNode, dom, config) {\n    const language = this.__language;\n    const prevLanguage = prevNode.__language;\n    if (language) {\n      if (language !== prevLanguage) {\n        dom.setAttribute(LANGUAGE_DATA_ATTRIBUTE, language);\n      }\n    } else if (prevLanguage) {\n      dom.removeAttribute(LANGUAGE_DATA_ATTRIBUTE);\n    }\n    const isSyntaxHighlightSupported = this.__isSyntaxHighlightSupported;\n    const prevIsSyntaxHighlightSupported = prevNode.__isSyntaxHighlightSupported;\n    if (prevIsSyntaxHighlightSupported && prevLanguage) {\n      if (isSyntaxHighlightSupported && language) {\n        if (language !== prevLanguage) {\n          dom.setAttribute(HIGHLIGHT_LANGUAGE_DATA_ATTRIBUTE, language);\n        }\n      } else {\n        dom.removeAttribute(HIGHLIGHT_LANGUAGE_DATA_ATTRIBUTE);\n      }\n    } else if (isSyntaxHighlightSupported && language) {\n      dom.setAttribute(HIGHLIGHT_LANGUAGE_DATA_ATTRIBUTE, language);\n    }\n    const theme = this.__theme;\n    const prevTheme = prevNode.__theme;\n    if (theme) {\n      if (theme !== prevTheme) {\n        dom.setAttribute(THEME_DATA_ATTRIBUTE, theme);\n      }\n    } else if (prevTheme) {\n      dom.removeAttribute(THEME_DATA_ATTRIBUTE);\n    }\n    const style = this.__style;\n    const prevStyle = prevNode.__style;\n    if (style !== prevStyle) {\n      setDOMStyleFromCSS(dom.style, style, prevStyle);\n    }\n    return false;\n  }\n  exportDOM(editor) {\n    const element = document.createElement('pre');\n    addClassNamesToElement(element, editor._config.theme.code);\n    element.setAttribute('spellcheck', 'false');\n    const language = this.getLanguage();\n    if (language) {\n      element.setAttribute(LANGUAGE_DATA_ATTRIBUTE, language);\n      if (this.getIsSyntaxHighlightSupported()) {\n        element.setAttribute(HIGHLIGHT_LANGUAGE_DATA_ATTRIBUTE, language);\n      }\n    }\n    const theme = this.getTheme();\n    if (theme) {\n      element.setAttribute(THEME_DATA_ATTRIBUTE, theme);\n    }\n    const style = this.getStyle();\n    if (style) {\n      setDOMStyleFromCSS(element.style, style);\n    }\n    return {\n      element\n    };\n  }\n  static importDOM() {\n    return {\n      // Typically <pre> is used for code blocks, and <code> for inline code styles\n      // but if it's a multi line <code> we'll create a block. Pass through to\n      // inline format handled by TextNode otherwise.\n      code: node => {\n        const isMultiLine = node.textContent != null && (/\\r?\\n/.test(node.textContent) || hasChildDOMNodeTag(node, 'BR'));\n        return isMultiLine ? {\n          conversion: $convertPreElement,\n          priority: 1\n        } : null;\n      },\n      div: () => ({\n        conversion: $convertDivElement,\n        priority: 1\n      }),\n      pre: () => ({\n        conversion: $convertPreElement,\n        priority: 0\n      }),\n      table: node => {\n        const table = node;\n        // domNode is a <table> since we matched it by nodeName\n        if (isGitHubCodeTable(table)) {\n          return {\n            conversion: $convertTableElement,\n            priority: 3\n          };\n        }\n        return null;\n      },\n      td: node => {\n        // element is a <td> since we matched it by nodeName\n        const td = node;\n        const table = td.closest('table');\n        if (isGitHubCodeCell(td) || table && isGitHubCodeTable(table)) {\n          // Return a no-op if it's a table cell in a code table, but not a code line.\n          // Otherwise it'll fall back to the T\n          return {\n            conversion: convertCodeNoop,\n            priority: 3\n          };\n        }\n        return null;\n      },\n      tr: node => {\n        // element is a <tr> since we matched it by nodeName\n        const tr = node;\n        const table = tr.closest('table');\n        if (table && isGitHubCodeTable(table)) {\n          return {\n            conversion: convertCodeNoop,\n            priority: 3\n          };\n        }\n        return null;\n      }\n    };\n  }\n  static importJSON(serializedNode) {\n    return $createCodeNode().updateFromJSON(serializedNode);\n  }\n  updateFromJSON(serializedNode) {\n    return super.updateFromJSON(serializedNode).setLanguage(serializedNode.language).setTheme(serializedNode.theme);\n  }\n  exportJSON() {\n    return {\n      ...super.exportJSON(),\n      language: this.getLanguage(),\n      theme: this.getTheme()\n    };\n  }\n\n  // Mutation\n  insertNewAfter(selection, restoreSelection = true) {\n    if (!getPeerDependencyFromEditor($getEditor(), '@lexical/code')) {\n      noExtensionDeprecation();\n      const el = $exitCodeNodeOnEnter(selection);\n      if (el) {\n        return el;\n      }\n    }\n    // If the selection is within the codeblock, find all leading tabs and\n    // spaces of the current line. Create a new line that has all those\n    // tabs and spaces, such that leading indentation is preserved.\n    const {\n      anchor,\n      focus\n    } = selection;\n    const firstPoint = anchor.isBefore(focus) ? anchor : focus;\n    const firstSelectionNode = firstPoint.getNode();\n    if ($isTextNode(firstSelectionNode)) {\n      let node = $getFirstCodeNodeOfLine(firstSelectionNode);\n      const insertNodes = [];\n      while (true) {\n        if ($isTabNode(node)) {\n          insertNodes.push($createTabNode());\n          node = node.getNextSibling();\n        } else if ($isCodeHighlightNode(node)) {\n          let spaces = 0;\n          const text = node.getTextContent();\n          const textSize = node.getTextContentSize();\n          while (spaces < textSize && text[spaces] === ' ') {\n            spaces++;\n          }\n          if (spaces !== 0) {\n            insertNodes.push($createCodeHighlightNode(' '.repeat(spaces)));\n          }\n          if (spaces !== textSize) {\n            break;\n          }\n          node = node.getNextSibling();\n        } else {\n          break;\n        }\n      }\n      const split = firstSelectionNode.splitText(anchor.offset)[0];\n      const x = anchor.offset === 0 ? 0 : 1;\n      const index = split.getIndexWithinParent() + x;\n      const codeNode = firstSelectionNode.getParentOrThrow();\n      const nodesToInsert = [$createLineBreakNode(), ...insertNodes];\n      codeNode.splice(index, 0, nodesToInsert);\n      const last = insertNodes[insertNodes.length - 1];\n      if (last) {\n        last.select();\n      } else if (anchor.offset === 0) {\n        split.selectPrevious();\n      } else {\n        split.getNextSibling().selectNext(0, 0);\n      }\n    }\n    if ($isCodeNode(firstSelectionNode)) {\n      const {\n        offset\n      } = selection.anchor;\n      firstSelectionNode.splice(offset, 0, [$createLineBreakNode()]);\n      firstSelectionNode.select(offset + 1, offset + 1);\n    }\n    return null;\n  }\n  canIndent() {\n    return false;\n  }\n  collapseAtStart() {\n    const paragraph = $createParagraphNode();\n    const children = this.getChildren();\n    children.forEach(child => paragraph.append(child));\n    this.replace(paragraph);\n    return true;\n  }\n  setLanguage(language) {\n    const writable = this.getWritable();\n    writable.__language = language || undefined;\n    return writable;\n  }\n  getLanguage() {\n    return this.getLatest().__language;\n  }\n  setIsSyntaxHighlightSupported(isSupported) {\n    const writable = this.getWritable();\n    writable.__isSyntaxHighlightSupported = isSupported;\n    return writable;\n  }\n  getIsSyntaxHighlightSupported() {\n    return this.getLatest().__isSyntaxHighlightSupported;\n  }\n  setTheme(theme) {\n    const writable = this.getWritable();\n    writable.__theme = theme || undefined;\n    return writable;\n  }\n  getTheme() {\n    return this.getLatest().__theme;\n  }\n}\nfunction $createCodeNode(language, theme) {\n  return $create(CodeNode).setLanguage(language).setTheme(theme);\n}\nfunction $isCodeNode(node) {\n  return node instanceof CodeNode;\n}\nfunction $convertPreElement(domNode) {\n  const language = domNode.getAttribute(LANGUAGE_DATA_ATTRIBUTE);\n  return {\n    node: $createCodeNode(language)\n  };\n}\nfunction $convertDivElement(domNode) {\n  // domNode is a <div> since we matched it by nodeName\n  const div = domNode;\n  const isCode = isCodeElement(div);\n  if (!isCode && !isCodeChildElement(div)) {\n    return {\n      node: null\n    };\n  }\n  return {\n    node: isCode ? $createCodeNode() : null\n  };\n}\nfunction $convertTableElement() {\n  return {\n    node: $createCodeNode()\n  };\n}\nfunction convertCodeNoop() {\n  return {\n    node: null\n  };\n}\nfunction isCodeElement(div) {\n  return div.style.fontFamily.match('monospace') !== null;\n}\nfunction isCodeChildElement(node) {\n  let parent = node.parentElement;\n  while (parent !== null) {\n    if (isCodeElement(parent)) {\n      return true;\n    }\n    parent = parent.parentElement;\n  }\n  return false;\n}\nfunction isGitHubCodeCell(cell) {\n  return cell.classList.contains('js-file-line');\n}\nfunction isGitHubCodeTable(table) {\n  return table.classList.contains('js-file-line-container');\n}\nfunction $exitCodeNodeOnEnter(selection) {\n  const {\n    anchor\n  } = selection;\n  if (selection.isCollapsed() && anchor.type === 'element') {\n    const codeNode = anchor.getNode();\n    if ($isCodeNode(codeNode)) {\n      const childrenSize = codeNode.getChildrenSize();\n      if (childrenSize >= 2 && anchor.offset === childrenSize) {\n        const lastChild = codeNode.getLastChild();\n        if ($isLineBreakNode(lastChild) && $isLineBreakNode(lastChild.getPreviousSibling())) {\n          const newElement = $createParagraphNode();\n          codeNode.splice(childrenSize - 2, 2, []).insertAfter(newElement, false);\n          newElement.select();\n          return newElement;\n        }\n      }\n    }\n  }\n  return null;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/** @noInheritDoc */\nclass CodeHighlightNode extends TextNode {\n  /** @internal */\n  __highlightType;\n  constructor(text = '', highlightType, key) {\n    super(text, key);\n    this.__highlightType = highlightType;\n  }\n  static getType() {\n    return 'code-highlight';\n  }\n  static clone(node) {\n    return new CodeHighlightNode(node.__text, node.__highlightType || undefined, node.__key);\n  }\n  afterCloneFrom(prevNode) {\n    super.afterCloneFrom(prevNode);\n    this.__highlightType = prevNode.__highlightType;\n  }\n  getHighlightType() {\n    const self = this.getLatest();\n    return self.__highlightType;\n  }\n  setHighlightType(highlightType) {\n    const self = this.getWritable();\n    self.__highlightType = highlightType || undefined;\n    return self;\n  }\n  canHaveFormat() {\n    return false;\n  }\n  createDOM(config) {\n    const element = super.createDOM(config);\n    const className = getHighlightThemeClass(config.theme, this.__highlightType);\n    addClassNamesToElement(element, className);\n    return element;\n  }\n  updateDOM(prevNode, dom, config) {\n    const update = super.updateDOM(prevNode, dom, config);\n    const prevClassName = getHighlightThemeClass(config.theme, prevNode.__highlightType);\n    const nextClassName = getHighlightThemeClass(config.theme, this.__highlightType);\n    if (prevClassName !== nextClassName) {\n      if (prevClassName) {\n        removeClassNamesFromElement(dom, prevClassName);\n      }\n      if (nextClassName) {\n        addClassNamesToElement(dom, nextClassName);\n      }\n    }\n    return update;\n  }\n  static importJSON(serializedNode) {\n    return $createCodeHighlightNode().updateFromJSON(serializedNode);\n  }\n  updateFromJSON(serializedNode) {\n    return super.updateFromJSON(serializedNode).setHighlightType(serializedNode.highlightType);\n  }\n  exportJSON() {\n    return {\n      ...super.exportJSON(),\n      highlightType: this.getHighlightType()\n    };\n  }\n\n  // Prevent formatting (bold, underline, etc)\n  setFormat(format) {\n    return this;\n  }\n  isParentRequired() {\n    return true;\n  }\n  createParentElementNode() {\n    return $createCodeNode();\n  }\n}\nfunction getHighlightThemeClass(theme, highlightType) {\n  return highlightType && theme && theme.codeHighlight && theme.codeHighlight[highlightType];\n}\nfunction $createCodeHighlightNode(text = '', highlightType) {\n  return $applyNodeReplacement(new CodeHighlightNode(text, highlightType));\n}\nfunction $isCodeHighlightNode(node) {\n  return node instanceof CodeHighlightNode;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n/**\n * Add code blocks to the editor (syntax highlighting provided separately)\n */\nconst CodeExtension = defineExtension({\n  name: '@lexical/code',\n  nodes: () => [CodeNode, CodeHighlightNode],\n  register(editor) {\n    return editor.registerCommand(KEY_ENTER_COMMAND, event => {\n      const selection = $getSelection();\n      if ($isRangeSelection(selection) && $exitCodeNodeOnEnter(selection)) {\n        event.preventDefault();\n        return true;\n      }\n      return false;\n    }, COMMAND_PRIORITY_LOW);\n  }\n});\n\nexport { $createCodeHighlightNode, $createCodeNode, $getCodeLineDirection, $getEndOfCodeInLine, $getFirstCodeNodeOfLine, $getLastCodeNodeOfLine, $getStartOfCodeInLine, $isCodeHighlightNode, $isCodeNode, CodeExtension, CodeHighlightNode, CodeNode, DEFAULT_CODE_LANGUAGE, getDefaultCodeLanguage };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalCodeCore.dev.mjs';\nimport * as modProd from './LexicalCodeCore.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const $createCodeHighlightNode = mod.$createCodeHighlightNode;\nexport const $createCodeNode = mod.$createCodeNode;\nexport const $getCodeLineDirection = mod.$getCodeLineDirection;\nexport const $getEndOfCodeInLine = mod.$getEndOfCodeInLine;\nexport const $getFirstCodeNodeOfLine = mod.$getFirstCodeNodeOfLine;\nexport const $getLastCodeNodeOfLine = mod.$getLastCodeNodeOfLine;\nexport const $getStartOfCodeInLine = mod.$getStartOfCodeInLine;\nexport const $isCodeHighlightNode = mod.$isCodeHighlightNode;\nexport const $isCodeNode = mod.$isCodeNode;\nexport const CodeExtension = mod.CodeExtension;\nexport const CodeHighlightNode = mod.CodeHighlightNode;\nexport const CodeNode = mod.CodeNode;\nexport const DEFAULT_CODE_LANGUAGE = mod.DEFAULT_CODE_LANGUAGE;\nexport const getDefaultCodeLanguage = mod.getDefaultCodeLanguage;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{$createCodeHighlightNode as e,DEFAULT_CODE_LANGUAGE as t,$isCodeNode as n,$isCodeHighlightNode as r,$getFirstCodeNodeOfLine as o,$getLastCodeNodeOfLine as s,$getCodeLineDirection as i,$getStartOfCodeInLine as c,$getEndOfCodeInLine as l,CodeNode as a,CodeHighlightNode as f,CodeExtension as u}from\"@lexical/code-core\";import{effect as g,namedSignals as p}from\"@lexical/extension\";import{$createLineBreakNode as d,$createTabNode as m,$createTextNode as h,$isLineBreakNode as y,$onUpdate as x,$getNodeByKey as j,$getSelection as v,$isRangeSelection as S,$isTextNode as w,$isTabNode as C,$createPoint as k,INDENT_CONTENT_COMMAND as N,OUTDENT_CONTENT_COMMAND as b,INSERT_TAB_COMMAND as P,$setSelectionFromCaretRange as T,$getCaretRangeInDirection as L,$getCaretRange as _,$getTextPointCaret as A,$normalizeCaret as B,$getSiblingCaret as K,KEY_ARROW_UP_COMMAND as z,MOVE_TO_START as E,TextNode as R,KEY_TAB_COMMAND as H,COMMAND_PRIORITY_LOW as I,$insertNodes as O,$getRoot as $,KEY_ARROW_DOWN_COMMAND as D,MOVE_TO_END as M,mergeRegister as F,defineExtension as X,safeCast as q}from\"lexical\";import\"prismjs\";import\"prismjs/components/prism-clike.js\";import\"prismjs/components/prism-javascript.js\";import\"prismjs/components/prism-markup.js\";import\"prismjs/components/prism-markdown.js\";import\"prismjs/components/prism-c.js\";import\"prismjs/components/prism-css.js\";import\"prismjs/components/prism-objectivec.js\";import\"prismjs/components/prism-sql.js\";import\"prismjs/components/prism-powershell.js\";import\"prismjs/components/prism-python.js\";import\"prismjs/components/prism-rust.js\";import\"prismjs/components/prism-swift.js\";import\"prismjs/components/prism-typescript.js\";import\"prismjs/components/prism-java.js\";import\"prismjs/components/prism-cpp.js\";function J(e,...t){const n=new URL(\"https://lexical.dev/docs/error\"),r=new URLSearchParams;r.append(\"code\",e);for(const e of t)r.append(\"v\",e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}!function(e){e.languages.diff={coord:[/^(?:\\*{3}|-{3}|\\+{3}).*$/m,/^@@.*@@$/m,/^\\d.*$/m]};var t={\"deleted-sign\":\"-\",\"deleted-arrow\":\"<\",\"inserted-sign\":\"+\",\"inserted-arrow\":\">\",unchanged:\" \",diff:\"!\"};Object.keys(t).forEach(function(n){var r=t[n],o=[];/^\\w+$/.test(n)||o.push(/\\w+/.exec(n)[0]),\"diff\"===n&&o.push(\"bold\"),e.languages.diff[n]={pattern:RegExp(\"^(?:[\"+r+\"].*(?:\\r\\n?|\\n|(?![\\\\s\\\\S])))+\",\"m\"),alias:o,inside:{line:{pattern:/(.)(?=[\\s\\S]).*(?:\\r\\n?|\\n)?/,lookbehind:!0},prefix:{pattern:/[\\s\\S]/,alias:/\\w+/.exec(n)[0]}}}}),Object.defineProperty(e.languages.diff,\"PREFIXES\",{value:t})}(Prism);const U=globalThis.Prism||window.Prism,Q={c:\"C\",clike:\"C-like\",cpp:\"C++\",css:\"CSS\",html:\"HTML\",java:\"Java\",js:\"JavaScript\",markdown:\"Markdown\",objc:\"Objective-C\",plain:\"Plain Text\",powershell:\"PowerShell\",py:\"Python\",rust:\"Rust\",sql:\"SQL\",swift:\"Swift\",typescript:\"TypeScript\",xml:\"XML\"},G={cpp:\"cpp\",java:\"java\",javascript:\"js\",md:\"markdown\",plaintext:\"plain\",python:\"py\",text:\"plain\",ts:\"typescript\"};function V(e){return G[e]||e}function W(e){const t=V(e);return Q[t]||t}const Y=()=>Object.keys(U.languages).filter(e=>\"function\"!=typeof U.languages[e]).sort();function Z(){const e=[];for(const[t,n]of Object.entries(Q))e.push([t,n]);return e}function ee(){return[]}function te(e){const t=function(e){const t=/^diff-([\\w-]+)/i.exec(e);return t?t[1]:null}(e),n=t||e;try{return!!n&&U.languages.hasOwnProperty(n)}catch(e){return!1}}async function ne(e,t,n){}function re(e){return\"string\"==typeof e?e:Array.isArray(e)?e.map(re).join(\"\"):re(e.content)}function oe(e,t){const n=/^diff-([\\w-]+)/i.exec(t),r=e.getTextContent();let o=U.tokenize(r,U.languages[n?\"diff\":t]);return n&&(o=function(e,t){const n=t,r=U.languages[n],o={tokens:e},s=U.languages.diff.PREFIXES;for(const e of o.tokens){if(\"string\"==typeof e||!(e.type in s)||!Array.isArray(e.content))continue;const t=e.type;let n=0;const o=()=>(n++,new U.Token(\"prefix\",s[t],t.replace(/^(\\w+).*/,\"$1\"))),i=e.content.filter(e=>\"string\"==typeof e||\"prefix\"!==e.type),c=e.content.length-i.length,l=U.tokenize(re(i),r);l.unshift(o());const a=/\\r\\n|\\n/g,f=e=>{const t=[];a.lastIndex=0;let r,s=0;for(;n<c&&(r=a.exec(e));){const n=r.index+r[0].length;t.push(e.slice(s,n)),s=n,t.push(o())}if(0!==t.length)return s<e.length&&t.push(e.slice(s)),t},u=e=>{for(let t=0;t<e.length&&n<c;t++){const n=e[t];if(\"string\"==typeof n){const r=f(n);r&&(e.splice(t,1,...r),t+=r.length-1)}else if(\"string\"==typeof n.content){const e=f(n.content);e&&(n.content=e)}else Array.isArray(n.content)?u(n.content):u([n.content])}};u(l),n<c&&l.push(o()),e.content=l}return o.tokens}(o,n[1])),se(o)}function se(t,n){const r=[];for(const o of t)if(\"string\"==typeof o){const t=o.split(/(\\n|\\t)/),s=t.length;for(let o=0;o<s;o++){const s=t[o];\"\\n\"===s||\"\\r\\n\"===s?r.push(d()):\"\\t\"===s?r.push(m()):s.length>0&&r.push(e(s,n))}}else{const{content:e,alias:t}=o;\"string\"==typeof e?r.push(...se([e],\"prefix\"===o.type&&\"string\"==typeof t?t:o.type)):Array.isArray(e)&&r.push(...se(e,\"unchanged\"===o.type?void 0:o.type))}return r}const ie={$tokenize(e,t){return oe(e,t||this.defaultLanguage)},defaultLanguage:t,tokenize(e,t){return U.tokenize(e,U.languages[t||\"\"]||U.languages[this.defaultLanguage])}};function ce(e,t,o,s){const i=s.getParent();n(i)?ae(e,t,o,i):r(s)&&s.replace(h(s.__text))}function le(e,t){const n=t.getElementByKey(e.getKey());if(null===n)return;const r=e.getChildren(),o=r.length;if(o===n.__cachedChildrenLength)return;n.__cachedChildrenLength=o;let s=\"1\",i=1;for(let e=0;e<o;e++)y(r[e])&&(s+=\"\\n\"+ ++i);n.setAttribute(\"data-gutter\",s)}function ae(e,t,r,o){const{nodesCurrentlyHighlighting:s}=r,i=o.getKey();void 0===o.getLanguage()&&o.setLanguage(t.defaultLanguage);const c=o.getLanguage()||t.defaultLanguage;if(!te(c))return o.getIsSyntaxHighlightSupported()&&o.setIsSyntaxHighlightSupported(!1),void ne();o.getIsSyntaxHighlightSupported()||o.setIsSyntaxHighlightSupported(!0),s.has(i)||(s.add(i),r.didTransform||(r.didTransform=!0,x(()=>{r.didTransform=!1,s.clear()})),function(e,t){const r=j(e);if(!n(r)||!r.isAttached())return;const o=v();if(!S(o))return void t();const s=o.anchor,i=s.offset,c=\"element\"===s.type&&y(r.getChildAtIndex(s.offset-1));let l=0;if(!c){const e=s.getNode();l=i+e.getPreviousSiblings().reduce((e,t)=>e+t.getTextContentSize(),0)}if(!t())return;if(c)return void s.getNode().select(i,i);r.getChildren().some(e=>{const t=w(e);if(t||y(e)){const n=e.getTextContentSize();if(t&&n>=l)return e.select(l,l),!0;l-=n}return!1})}(i,()=>{const e=j(i);if(!n(e)||!e.isAttached())return!1;const r=e.getLanguage()||t.defaultLanguage,s=t.$tokenize(e,r),c=function(e,t){let n=0;for(;n<e.length&&fe(e[n],t[n]);)n++;const r=e.length,o=t.length,s=Math.min(r,o)-n;let i=0;for(;i<s;)if(i++,!fe(e[r-i],t[o-i])){i--;break}const c=n,l=r-i,a=t.slice(n,o-i);return{from:c,nodesForReplacement:a,to:l}}(e.getChildren(),s),{from:l,to:a,nodesForReplacement:f}=c;return!(l===a&&!f.length)&&(o.splice(l,a-l,f),!0)}))}function fe(e,t){return r(e)&&r(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType||C(e)&&C(t)||y(e)&&y(t)}function ue(e){if(!S(e))return!1;const t=e.anchor.getNode(),r=n(t)?t:t.getParent(),o=e.focus.getNode(),s=n(o)?o:o.getParent();return n(r)&&r.is(s)}function ge(e){const t=e.getNodes(),o=[];if(1===t.length&&n(t[0]))return o;let s=[];for(let e=0;e<t.length;e++){const n=t[e];r(n)||C(n)||y(n)||J(169),y(n)?s.length>0&&(o.push(s),s=[]):s.push(n)}if(s.length>0){const t=e.isBackward()?e.anchor:e.focus,n=k(s[0].getKey(),0,\"text\");t.is(n)||o.push(s)}return o}function pe(e){const t=v();if(!S(t)||!ue(t))return!1;const n=ge(t),r=n.length;if(0===r&&t.isCollapsed())return e===N&&t.insertNodes([m()]),!0;if(0===r&&e===N&&\"\\n\"===t.getTextContent()){const e=m(),n=d(),r=t.isBackward()?\"previous\":\"next\";return t.insertNodes([e,n]),T(L(_(A(e,\"next\",0),B(K(n,\"next\"))),r)),!0}for(let s=0;s<r;s++){const r=n[s];if(r.length>0){let n=r[0];if(0===s&&(n=o(n)),e===N){const e=m();if(n.insertBefore(e),0===s){const r=t.isBackward()?\"focus\":\"anchor\",o=k(n.getKey(),0,\"text\");t[r].is(o)&&t[r].set(e.getKey(),0,\"text\")}}else C(n)&&n.remove()}}return!0}function de(e,t){const n=v();if(!S(n))return!1;const{anchor:i,focus:c}=n,l=i.offset,a=c.offset,f=i.getNode(),u=c.getNode(),g=e===z;if(!ue(n)||!r(f)&&!C(f)||!r(u)&&!C(u))return!1;if(!t.altKey){if(n.isCollapsed()){const e=f.getParentOrThrow();if(g&&0===l&&null===f.getPreviousSibling()){if(null===e.getPreviousSibling())return e.selectPrevious(),t.preventDefault(),!0}else if(!g&&l===f.getTextContentSize()&&null===f.getNextSibling()){if(null===e.getNextSibling())return e.selectNext(),t.preventDefault(),!0}}return!1}let p,d;if(f.isBefore(u)?(p=o(f),d=s(u)):(p=o(u),d=s(f)),null==p||null==d)return!1;const m=p.getNodesBetween(d);for(let e=0;e<m.length;e++){const t=m[e];if(!r(t)&&!C(t)&&!y(t))return!1}t.preventDefault(),t.stopPropagation();const h=g?p.getPreviousSibling():d.getNextSibling();if(!y(h))return!0;const x=g?h.getPreviousSibling():h.getNextSibling();if(null==x)return!0;const j=r(x)||C(x)||y(x)?g?o(x):s(x):null;let w=null!=j?j:x;return h.remove(),m.forEach(e=>e.remove()),e===z?(m.forEach(e=>w.insertBefore(e)),w.insertBefore(h)):(w.insertAfter(h),w=h,m.forEach(e=>{w.insertAfter(e),w=e})),n.setTextNodeRange(f,l,u,a),!0}function me(e,t){const n=v();if(!S(n))return!1;const{anchor:o,focus:s}=n,a=o.getNode(),f=s.getNode(),u=e===E;if(!ue(n)||!r(a)&&!C(a)||!r(f)&&!C(f))return!1;const g=f;if(\"rtl\"===i(g)?!u:u){const e=c(g,s.offset);if(null!==e){const{node:t,offset:r}=e;y(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else g.getParentOrThrow().selectStart()}else{l(g).select()}return t.preventDefault(),t.stopPropagation(),!0}function he(e,t){if(!e.hasNodes([a,f]))throw new Error(\"CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor\");null==t&&(t=ie);const n=[];!0!==e._headless&&n.push(e.registerMutationListener(a,t=>{e.getEditorState().read(()=>{for(const[n,r]of t)if(\"destroyed\"!==r){const t=j(n);null!==t&&le(t,e)}})},{skipInitialization:!1}));const r={didTransform:!1,nodesCurrentlyHighlighting:new Set};return n.push(e.registerNodeTransform(a,ae.bind(null,e,t,r)),e.registerNodeTransform(R,ce.bind(null,e,t,r)),e.registerNodeTransform(f,ce.bind(null,e,t,r)),e.registerCommand(H,t=>{const n=function(e){const t=v();if(!S(t)||!ue(t))return null;const n=e?b:N,r=e?b:P,i=t.anchor,c=t.focus;if(i.is(c))return r;const l=ge(t);if(1!==l.length)return n;const a=l[0];let f,u;0===a.length&&J(285),t.isBackward()?(f=c,u=i):(f=i,u=c);const g=o(a[0]),p=s(a[0]),d=k(g.getKey(),0,\"text\"),m=k(p.getKey(),p.getTextContentSize(),\"text\");return f.isBefore(d)||m.isBefore(u)?n:d.isBefore(f)||u.isBefore(m)?r:n}(t.shiftKey);return null!==n&&(t.preventDefault(),e.dispatchCommand(n,void 0),!0)},I),e.registerCommand(P,()=>!!ue(v())&&(O([m()]),!0),I),e.registerCommand(N,e=>pe(N),I),e.registerCommand(b,e=>pe(b),I),e.registerCommand(z,e=>{const t=v();if(!S(t)||!ue(t))return!1;const n=$().getFirstDescendant(),{anchor:r}=t,o=r.getNode();return(!n||!o||n.getKey()!==o.getKey())&&de(z,e)},I),e.registerCommand(D,e=>{const t=v();if(!S(t)||!ue(t))return!1;const n=$().getLastDescendant(),{anchor:r}=t,o=r.getNode();return(!n||!o||n.getKey()!==o.getKey())&&de(D,e)},I),e.registerCommand(E,e=>me(E,e),I),e.registerCommand(M,e=>me(M,e),I)),F(...n)}const ye=X({build:(e,t)=>p(t),config:q({disabled:!1,tokenizer:ie}),dependencies:[u],name:\"@lexical/code-prism\",register:(e,t,n)=>{const r=n.getOutput();return g(()=>{if(!r.disabled.value)return he(e,r.tokenizer.value)})}});export{Q as CODE_LANGUAGE_FRIENDLY_NAME_MAP,G as CODE_LANGUAGE_MAP,ye as CodePrismExtension,ie as PrismTokenizer,Z as getCodeLanguageOptions,Y as getCodeLanguages,ee as getCodeThemeOptions,W as getLanguageFriendlyName,te as isCodeLanguageLoaded,ne as loadCodeLanguage,V as normalizeCodeLanguage,he as registerCodeHighlighting};\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalCodePrism.dev.mjs';\nimport * as modProd from './LexicalCodePrism.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const CODE_LANGUAGE_FRIENDLY_NAME_MAP = mod.CODE_LANGUAGE_FRIENDLY_NAME_MAP;\nexport const CODE_LANGUAGE_MAP = mod.CODE_LANGUAGE_MAP;\nexport const CodePrismExtension = mod.CodePrismExtension;\nexport const PrismTokenizer = mod.PrismTokenizer;\nexport const getCodeLanguageOptions = mod.getCodeLanguageOptions;\nexport const getCodeLanguages = mod.getCodeLanguages;\nexport const getCodeThemeOptions = mod.getCodeThemeOptions;\nexport const getLanguageFriendlyName = mod.getLanguageFriendlyName;\nexport const isCodeLanguageLoaded = mod.isCodeLanguageLoaded;\nexport const loadCodeLanguage = mod.loadCodeLanguage;\nexport const normalizeCodeLanguage = mod.normalizeCodeLanguage;\nexport const registerCodeHighlighting = mod.registerCodeHighlighting;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalCode.dev.mjs';\nimport * as modProd from './LexicalCode.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const $createCodeHighlightNode = mod.$createCodeHighlightNode;\nexport const $createCodeNode = mod.$createCodeNode;\nexport const $getCodeLineDirection = mod.$getCodeLineDirection;\nexport const $getEndOfCodeInLine = mod.$getEndOfCodeInLine;\nexport const $getFirstCodeNodeOfLine = mod.$getFirstCodeNodeOfLine;\nexport const $getLastCodeNodeOfLine = mod.$getLastCodeNodeOfLine;\nexport const $getStartOfCodeInLine = mod.$getStartOfCodeInLine;\nexport const $isCodeHighlightNode = mod.$isCodeHighlightNode;\nexport const $isCodeNode = mod.$isCodeNode;\nexport const CODE_LANGUAGE_FRIENDLY_NAME_MAP = mod.CODE_LANGUAGE_FRIENDLY_NAME_MAP;\nexport const CODE_LANGUAGE_MAP = mod.CODE_LANGUAGE_MAP;\nexport const CodeExtension = mod.CodeExtension;\nexport const CodeHighlightNode = mod.CodeHighlightNode;\nexport const CodeNode = mod.CodeNode;\nexport const DEFAULT_CODE_LANGUAGE = mod.DEFAULT_CODE_LANGUAGE;\nexport const PrismTokenizer = mod.PrismTokenizer;\nexport const getCodeLanguageOptions = mod.getCodeLanguageOptions;\nexport const getCodeLanguages = mod.getCodeLanguages;\nexport const getCodeThemeOptions = mod.getCodeThemeOptions;\nexport const getDefaultCodeLanguage = mod.getDefaultCodeLanguage;\nexport const getLanguageFriendlyName = mod.getLanguageFriendlyName;\nexport const normalizeCodeLang = mod.normalizeCodeLang;\nexport const normalizeCodeLanguage = mod.normalizeCodeLanguage;\nexport const registerCodeHighlighting = mod.registerCodeHighlighting;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { $isParagraphNode, $isTextNode, $getRoot, $isElementNode, $isDecoratorNode, $isLineBreakNode, $getSelection, $createTextNode, $createParagraphNode, $createLineBreakNode, $createTabNode, createState, $setState, $getState, $findMatchingParent as $findMatchingParent$1, mergeRegister, COLLABORATION_TAG, HISTORIC_TAG, $isRangeSelection, $addUpdateTag, HISTORY_PUSH_TAG, KEY_ENTER_COMMAND, COMMAND_PRIORITY_LOW, $isRootOrShadowRoot, $createRangeSelection, $setSelection } from 'lexical';\nimport { $isListNode, $isListItemNode, ListNode, ListItemNode, $createListItemNode, $createListNode } from '@lexical/list';\nimport { $isQuoteNode, HeadingNode, QuoteNode, $isHeadingNode, $createQuoteNode, $createHeadingNode } from '@lexical/rich-text';\nimport { $findMatchingParent } from '@lexical/utils';\nimport { CodeNode, $createCodeNode, $isCodeNode } from '@lexical/code-core';\nimport { LinkNode, $isLinkNode, $createLinkNode, $isAutoLinkNode } from '@lexical/link';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction indexBy(list, callback) {\n  const index = {};\n  for (const item of list) {\n    const key = callback(item);\n    if (!key) {\n      continue;\n    }\n    if (index[key]) {\n      index[key].push(item);\n    } else {\n      index[key] = [item];\n    }\n  }\n  return index;\n}\nfunction transformersByType(transformers) {\n  const byType = indexBy(transformers, t => t.type);\n  return {\n    element: byType.element || [],\n    multilineElement: byType['multiline-element'] || [],\n    textFormat: byType['text-format'] || [],\n    textMatch: byType['text-match'] || []\n  };\n}\nconst PUNCTUATION_OR_SPACE = /[!-/:-@[-`{-~\\s]/;\nconst WHITESPACE = /[ \\t\\n\\r\\f]/;\nconst PUNCTUATION = /[!\"#$%&'()*+,\\-./:;<=>?@[\\]^_`{|}~]/;\nconst MARKDOWN_EMPTY_LINE_REG_EXP = /^\\s{0,3}$/;\nfunction isEmptyParagraph(node) {\n  if (!$isParagraphNode(node)) {\n    return false;\n  }\n  const firstChild = node.getFirstChild();\n  return firstChild == null || node.getChildrenSize() === 1 && $isTextNode(firstChild) && MARKDOWN_EMPTY_LINE_REG_EXP.test(firstChild.getTextContent());\n}\nfunction unescapeText(value) {\n  return value.replace(/\\\\([!-/:-@[-`{-~])/g, '$1').replace(/&#(\\d+);/g, (_, codePoint) => String.fromCodePoint(Number(codePoint)));\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n/**\n * Renders string from markdown. The selection is moved to the start after the operation.\n */\nfunction createMarkdownExport(transformers, shouldPreserveNewLines = false) {\n  const byType = transformersByType(transformers);\n  const elementTransformers = [...byType.multilineElement, ...byType.element];\n  const isNewlineDelimited = !shouldPreserveNewLines;\n\n  // Export only uses text formats that are responsible for single format\n  // e.g. it will filter out *** (bold, italic) and instead use separate ** and *\n  const textFormatTransformers = byType.textFormat.filter(transformer => transformer.format.length === 1)\n  // Make sure all text transformers that contain 'code' in their format are at the end of the array. Otherwise, formatted code like\n  // <strong><code>code</code></strong> will be exported as `**Bold Code**`, as the code format will be applied first, and the bold format\n  // will be applied second and thus skipped entirely, as the code format will prevent any further formatting.\n  .sort((a, b) => {\n    return Number(a.format.includes('code')) - Number(b.format.includes('code'));\n  });\n  return node => {\n    const output = [];\n    const children = (node || $getRoot()).getChildren();\n    for (let i = 0; i < children.length; i++) {\n      const child = children[i];\n      const result = exportTopLevelElements(child, elementTransformers, textFormatTransformers, byType.textMatch, shouldPreserveNewLines);\n      if (result != null) {\n        output.push(\n        // separate consecutive group of texts with a line break: eg. [\"hello\", \"world\"] -> [\"hello\", \"/nworld\"]\n        isNewlineDelimited && i > 0 && !isEmptyParagraph(child) && !isEmptyParagraph(children[i - 1]) ? '\\n'.concat(result) : result);\n      }\n    }\n    // Ensure consecutive groups of texts are at least \\n\\n apart while each empty paragraph render as a newline.\n    // Eg. [\"hello\", \"\", \"\", \"hi\", \"\\nworld\"] -> \"hello\\n\\n\\nhi\\n\\nworld\"\n    return output.join('\\n');\n  };\n}\nfunction exportTopLevelElements(node, elementTransformers, textTransformersIndex, textMatchTransformers, shouldPreserveNewLines) {\n  for (const transformer of elementTransformers) {\n    if (!transformer.export) {\n      continue;\n    }\n    const result = transformer.export(node, _node => exportChildren(_node, textTransformersIndex, textMatchTransformers, undefined, undefined, shouldPreserveNewLines));\n    if (result != null) {\n      return result;\n    }\n  }\n  if ($isElementNode(node)) {\n    return exportChildren(node, textTransformersIndex, textMatchTransformers, undefined, undefined, shouldPreserveNewLines);\n  } else if ($isDecoratorNode(node)) {\n    return node.getTextContent();\n  } else {\n    return null;\n  }\n}\nfunction exportChildren(node, textTransformersIndex, textMatchTransformers, unclosedTags, unclosableTags, shouldPreserveNewLines = false) {\n  const output = [];\n  const children = node.getChildren();\n  // keep track of unclosed tags from the very beginning\n  if (!unclosedTags) {\n    unclosedTags = [];\n  }\n  if (!unclosableTags) {\n    unclosableTags = [];\n  }\n  mainLoop: for (const child of children) {\n    for (const transformer of textMatchTransformers) {\n      if (!transformer.export) {\n        continue;\n      }\n      const result = transformer.export(child, parentNode => exportChildren(parentNode, textTransformersIndex, textMatchTransformers, unclosedTags,\n      // Add current unclosed tags to the list of unclosable tags - we don't want nested tags from\n      // textmatch transformers to close the outer ones, as that may result in invalid markdown.\n      // E.g. **text [text**](https://lexical.io)\n      // is invalid markdown, as the closing ** is inside the link.\n      //\n      [...unclosableTags, ...unclosedTags], shouldPreserveNewLines), (textNode, textContent) => exportTextFormat(textNode, textContent, textTransformersIndex, unclosedTags, unclosableTags, shouldPreserveNewLines));\n      if (result != null) {\n        output.push(result);\n        continue mainLoop;\n      }\n    }\n    if ($isLineBreakNode(child)) {\n      output.push('\\n');\n    } else if ($isTextNode(child)) {\n      output.push(exportTextFormat(child, child.getTextContent(), textTransformersIndex, unclosedTags, unclosableTags, shouldPreserveNewLines));\n    } else if ($isElementNode(child)) {\n      // empty paragraph returns \"\"\n      output.push(exportChildren(child, textTransformersIndex, textMatchTransformers, unclosedTags, unclosableTags, shouldPreserveNewLines));\n    } else if ($isDecoratorNode(child)) {\n      output.push(child.getTextContent());\n    }\n  }\n  return output.join('');\n}\nfunction exportTextFormat(node, textContent, textTransformers,\n// unclosed tags include the markdown tags that haven't been closed yet, and their associated formats\nunclosedTags, unclosableTags, shouldPreserveNewLines = false) {\n  // This function handles the case of a string looking like this: \"   foo   \"\n  // Where it would be invalid markdown to generate: \"**   foo   **\"\n  // If the node has no format, we use the original text.\n  // Otherwise, we escape leading and trailing whitespaces to their corresponding code points,\n  // ensuring the returned string maintains its original formatting, e.g., \"**&#32;&#32;&#32;foo&#32;&#32;&#32;**\".\n\n  let output = textContent;\n  if (!node.hasFormat('code')) {\n    // Preserve literal backslashes when preserving source newlines.\n    output = shouldPreserveNewLines ? output.replace(/([*_`~])/g, '\\\\$1') : output.replace(/([*_`~\\\\])/g, '\\\\$1');\n  }\n\n  // Extract leading and trailing whitespaces.\n  // CommonMark flanking rules require formatting tags to be adjacent to non-whitespace characters.\n  const match = output.match(/^(\\s*)(.*?)(\\s*)$/s) || ['', '', output, ''];\n  const leadingSpace = match[1];\n  const trimmedOutput = match[2];\n  const trailingSpace = match[3];\n  const isWhitespaceOnly = trimmedOutput === '';\n\n  // the opening tags to be added to the result\n  let openingTags = '';\n  // the closing tags to be added to the result\n  let closingTagsBefore = '';\n  let closingTagsAfter = '';\n  const prevNode = getTextSibling(node, true);\n  const nextNode = getTextSibling(node, false);\n  const applied = new Set();\n  for (const transformer of textTransformers) {\n    const format = transformer.format[0];\n    const tag = transformer.tag;\n\n    // dedup applied formats\n    if (checkHasFormat(node, format) && !applied.has(format)) {\n      applied.add(format);\n\n      // append the tag to openingTags, if it's not applied to the previous nodes,\n      // or the nodes before that (which would result in an unclosed tag)\n      if (!checkHasFormat(prevNode, format) || !unclosedTags.find(element => element.tag === tag)) {\n        unclosedTags.push({\n          format,\n          tag\n        });\n        openingTags += tag;\n      }\n    }\n  }\n\n  // close any tags in the same order they were applied, if necessary\n  for (let i = 0; i < unclosedTags.length; i++) {\n    const nodeHasFormat = hasFormat(node, unclosedTags[i].format);\n    const nextNodeHasFormat = hasFormat(nextNode, unclosedTags[i].format);\n\n    // prevent adding closing tag if next sibling will do it\n    if (nodeHasFormat && nextNodeHasFormat) {\n      continue;\n    }\n    const unhandledUnclosedTags = [...unclosedTags]; // Shallow copy to avoid modifying the original array\n\n    while (unhandledUnclosedTags.length > i) {\n      const unclosedTag = unhandledUnclosedTags.pop();\n\n      // If tag is unclosable, don't close it and leave it in the original array,\n      // So that it can be closed when it's no longer unclosable\n      if (unclosableTags && unclosedTag && unclosableTags.find(element => element.tag === unclosedTag.tag)) {\n        continue;\n      }\n      if (unclosedTag && typeof unclosedTag.tag === 'string') {\n        if (!nodeHasFormat) {\n          // Handles cases where the tag has not been closed before, e.g. if the previous node\n          // was a text match transformer that did not account for closing tags of the next node (e.g. a link)\n          closingTagsBefore += unclosedTag.tag;\n        } else if (!nextNodeHasFormat) {\n          closingTagsAfter += unclosedTag.tag;\n        }\n      }\n      // Mutate the original array to remove the closed tag\n      unclosedTags.pop();\n    }\n    break;\n  }\n  // If the node is entirely whitespace, we don't apply opening/closing tags around it.\n  // However, it must still output closing tags from previous nodes.\n  if (isWhitespaceOnly && !node.hasFormat('code')) {\n    return closingTagsBefore + output;\n  }\n\n  // Flanking Compliance: Notice how openingTags and closingTagsAfter are placed INSIDE the whitespace boundaries!\n  return closingTagsBefore + leadingSpace + openingTags + trimmedOutput + closingTagsAfter + trailingSpace;\n}\nfunction getTextSibling(node, backward) {\n  const sibling = backward ? node.getPreviousSibling() : node.getNextSibling();\n  if ($isTextNode(sibling)) {\n    return sibling;\n  }\n  return null;\n}\nfunction hasFormat(node, format) {\n  return $isTextNode(node) && node.hasFormat(format);\n}\nfunction checkHasFormat(n, f) {\n  if (!hasFormat(n, f)) {\n    return false;\n  }\n  if (f === 'code') {\n    return true;\n  }\n  if (n && /^\\s*$/.test(n.getTextContent())) {\n    return false;\n  }\n  return true;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction findOutermostTextFormatTransformer(textNode, textFormatTransformersIndex) {\n  const textContent = textNode.getTextContent();\n\n  // Find code span first. Emphasis delimiters inside inline elements (e.g., code spans)\n  // should not be processed. Currently only code spans are handled; other inline elements\n  // (e.g., links, raw HTML) may need similar treatment in the future.\n  const codeRegex = textFormatTransformersIndex.fullMatchRegExpByTag['`'];\n  const codeTransformer = textFormatTransformersIndex.transformersByTag['`'];\n  const excludeRanges = [];\n  let codeMatch = null;\n  if (codeRegex && codeTransformer) {\n    const globalRegex = new RegExp(codeRegex.source, 'g');\n    const matches = Array.from(textContent.matchAll(globalRegex));\n    for (const match of matches) {\n      // Group 1 captures the character preceding the opening backtick (or an\n      // empty string when the span starts at position 0). Offset past it so\n      // startIndex points to the backtick itself.\n      const startIndex = match.index + match[1].length;\n      const endIndex = match.index + match[0].length;\n      if (!codeMatch) {\n        codeMatch = {\n          content: match[3],\n          endIndex,\n          startIndex,\n          tag: '`'\n        };\n      }\n      excludeRanges.push({\n        end: endIndex,\n        start: startIndex\n      });\n    }\n  }\n  const delimiters = scanDelimiters(textContent, textFormatTransformersIndex, excludeRanges);\n  const emphasisMatch = delimiters.length > 0 ? processEmphasis(textContent, delimiters, textFormatTransformersIndex) : null;\n  let resultMatch = null;\n  let resultTransformer = null;\n  if (codeMatch && emphasisMatch) {\n    if (emphasisMatch.startIndex <= codeMatch.startIndex && emphasisMatch.endIndex >= codeMatch.endIndex) {\n      resultMatch = emphasisMatch;\n      resultTransformer = textFormatTransformersIndex.transformersByTag[emphasisMatch.tag];\n    } else {\n      resultMatch = codeMatch;\n      resultTransformer = codeTransformer;\n    }\n  } else if (codeMatch) {\n    resultMatch = codeMatch;\n    resultTransformer = codeTransformer;\n  } else if (emphasisMatch) {\n    resultMatch = emphasisMatch;\n    resultTransformer = textFormatTransformersIndex.transformersByTag[emphasisMatch.tag];\n  }\n  if (!resultMatch || !resultTransformer) {\n    return null;\n  }\n  const regexMatch = [textContent.slice(resultMatch.startIndex, resultMatch.endIndex), resultMatch.tag, resultMatch.content];\n  regexMatch.index = resultMatch.startIndex;\n  regexMatch.input = textContent;\n  return {\n    endIndex: resultMatch.endIndex,\n    match: regexMatch,\n    startIndex: resultMatch.startIndex,\n    transformer: resultTransformer\n  };\n}\nfunction scanDelimiters(text, transformersIndex, excludeRanges = []) {\n  const delimiters = [];\n  const delimiterChars = new Set(Object.keys(transformersIndex.transformersByTag).filter(tag => tag[0] !== '`').map(tag => tag[0]));\n  const isEscaped = index => {\n    let count = 0;\n    for (let i = index - 1; i >= 0 && text[i] === '\\\\'; i--) {\n      count++;\n    }\n    return count % 2 === 1;\n  };\n  const isInExcludedRange = index => {\n    return excludeRanges.some(range => index >= range.start && index < range.end);\n  };\n  let i = 0;\n  while (i < text.length) {\n    const char = text[i];\n    if (!delimiterChars.has(char) || isEscaped(i) || isInExcludedRange(i)) {\n      i++;\n      continue;\n    }\n    let len = 1;\n    while (i + len < text.length && text[i + len] === char) {\n      len++;\n    }\n    const canOpen = canEmphasis(char, text, i, len, true);\n    const canClose = canEmphasis(char, text, i, len, false);\n    if (canOpen || canClose) {\n      delimiters.push({\n        active: true,\n        canClose,\n        canOpen,\n        char,\n        index: i,\n        length: len,\n        originalLength: len\n      });\n    }\n    i += len;\n  }\n  return delimiters;\n}\nfunction processEmphasis(text, delimiters, transformersIndex) {\n  const openersBottom = {};\n  let currentPos = 0;\n  let result = null;\n  while (currentPos < delimiters.length) {\n    const closer = delimiters[currentPos];\n    if (!closer.active || !closer.canClose || closer.length === 0) {\n      currentPos++;\n      continue;\n    }\n    const bottomKey = `${closer.char}${closer.canOpen}`;\n    const bottom = openersBottom[bottomKey] ?? -1;\n    let foundOpener = false;\n    for (let openIdx = currentPos - 1; openIdx > bottom; openIdx--) {\n      const opener = delimiters[openIdx];\n      if (!opener.active || !opener.canOpen || opener.length === 0 || opener.char !== closer.char) {\n        continue;\n      }\n\n      // Rule of 3\n      if (opener.canClose || closer.canOpen) {\n        const sum = opener.originalLength + closer.originalLength;\n        if (sum % 3 === 0 && opener.originalLength % 3 !== 0 && closer.originalLength % 3 !== 0) {\n          continue;\n        }\n      }\n      const maxLen = Math.min(opener.length, closer.length);\n      const matchedTag = Object.keys(transformersIndex.transformersByTag).filter(t => t[0] === opener.char && t.length <= maxLen).sort((a, b) => b.length - a.length)[0];\n      if (!matchedTag) {\n        continue;\n      }\n      foundOpener = true;\n      const matchLen = matchedTag.length;\n      const match = {\n        content: text.slice(opener.index + opener.length, closer.index),\n        endIndex: closer.index + matchLen,\n        startIndex: opener.index + (opener.length - matchLen),\n        tag: matchedTag\n      };\n      if (!result || match.startIndex < result.startIndex || match.startIndex === result.startIndex && match.endIndex > result.endIndex) {\n        result = match;\n      }\n      for (let j = openIdx + 1; j < currentPos; j++) {\n        delimiters[j].active = false;\n      }\n      opener.length -= matchLen;\n      closer.length -= matchLen;\n      opener.active = opener.length > 0;\n      if (closer.length > 0) {\n        closer.index += matchLen;\n      } else {\n        closer.active = false;\n        currentPos++;\n      }\n      break;\n    }\n    if (!foundOpener) {\n      openersBottom[bottomKey] = currentPos - 1;\n      if (!closer.canOpen) {\n        closer.active = false;\n      }\n      currentPos++;\n    }\n  }\n  return result;\n}\nfunction canEmphasis(char, text, index, length, isOpen) {\n  if (!isFlanking(text, index, length, isOpen)) {\n    return false;\n  }\n  if (char === '*') {\n    return true;\n  }\n  if (char === '_') {\n    if (!isFlanking(text, index, length, !isOpen)) {\n      return true;\n    }\n    const adjacentChar = isOpen ? text[index - 1] : text[index + length];\n    return adjacentChar !== undefined && PUNCTUATION.test(adjacentChar);\n  }\n  return true;\n}\nfunction isFlanking(text, index, length, isLeft) {\n  const charBefore = text[index - 1];\n  const charAfter = text[index + length];\n  const [primary, secondary] = isLeft ? [charAfter, charBefore] : [charBefore, charAfter];\n  if (primary === undefined || WHITESPACE.test(primary)) {\n    return false;\n  }\n  if (!PUNCTUATION.test(primary)) {\n    return true;\n  }\n  return secondary === undefined || WHITESPACE.test(secondary) || PUNCTUATION.test(secondary);\n}\nfunction importTextFormatTransformer(textNode, startIndex, endIndex, transformer, match) {\n  const textContent = textNode.getTextContent();\n\n  // No text matches - we can safely process the text format match\n  let transformedNode, nodeAfter, nodeBefore;\n\n  // If matching full content there's no need to run splitText and can reuse existing textNode\n  // to update its content and apply format. E.g. for **_Hello_** string after applying bold\n  // format (**) it will reuse the same text node to apply italic (_)\n  if (match[0] === textContent) {\n    transformedNode = textNode;\n  } else {\n    if (startIndex === 0) {\n      [transformedNode, nodeAfter] = textNode.splitText(endIndex);\n    } else {\n      [nodeBefore, transformedNode, nodeAfter] = textNode.splitText(startIndex, endIndex);\n    }\n  }\n  transformedNode.setTextContent(match[2]);\n  if (transformer) {\n    for (const format of transformer.format) {\n      if (!transformedNode.hasFormat(format)) {\n        transformedNode.toggleFormat(format);\n      }\n    }\n  }\n  return {\n    nodeAfter: nodeAfter,\n    nodeBefore: nodeBefore,\n    transformedNode: transformedNode\n  };\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nfunction findOutermostTextMatchTransformer(textNode_, textMatchTransformers) {\n  const textNode = textNode_;\n  let foundMatchStartIndex = undefined;\n  let foundMatchEndIndex = undefined;\n  let foundMatchTransformer = undefined;\n  let foundMatch = undefined;\n  for (const transformer of textMatchTransformers) {\n    if (!transformer.replace || !transformer.importRegExp) {\n      continue;\n    }\n    const match = textNode.getTextContent().match(transformer.importRegExp);\n    if (!match) {\n      continue;\n    }\n    const startIndex = match.index || 0;\n    const endIndex = transformer.getEndIndex ? transformer.getEndIndex(textNode, match) : startIndex + match[0].length;\n    if (endIndex === false) {\n      continue;\n    }\n    if (foundMatchStartIndex === undefined || foundMatchEndIndex === undefined ||\n    // Wraps previous match or is strictly before it.\n    startIndex < foundMatchStartIndex && (endIndex > foundMatchEndIndex || endIndex <= foundMatchStartIndex)) {\n      foundMatchStartIndex = startIndex;\n      foundMatchEndIndex = endIndex;\n      foundMatchTransformer = transformer;\n      foundMatch = match;\n    }\n  }\n  if (foundMatchStartIndex === undefined || foundMatchEndIndex === undefined || foundMatchTransformer === undefined || foundMatch === undefined) {\n    return null;\n  }\n  return {\n    endIndex: foundMatchEndIndex,\n    match: foundMatch,\n    startIndex: foundMatchStartIndex,\n    transformer: foundMatchTransformer\n  };\n}\nfunction importFoundTextMatchTransformer(textNode, startIndex, endIndex, transformer, match) {\n  let transformedNode, nodeAfter, nodeBefore;\n  if (startIndex === 0) {\n    [transformedNode, nodeAfter] = textNode.splitText(endIndex);\n  } else {\n    [nodeBefore, transformedNode, nodeAfter] = textNode.splitText(startIndex, endIndex);\n  }\n  if (!transformer.replace) {\n    return null;\n  }\n  const potentialTransformedNode = transformer.replace(transformedNode, match);\n  return {\n    nodeAfter,\n    nodeBefore,\n    transformedNode: potentialTransformedNode || undefined\n  };\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n/**\n * Returns true if the node can contain transformable markdown.\n * Code nodes cannot contain transformable markdown.\n * For example, `code **bold**` should not be transformed to\n * <code>code <strong>bold</strong></code>.\n */\nfunction canContainTransformableMarkdown(node) {\n  return $isTextNode(node) && !node.hasFormat('code');\n}\n\n/**\n * Handles applying both text format and text match transformers.\n * It finds the outermost text format or text match and applies it,\n * then recursively calls itself to apply the next outermost transformer,\n * until there are no more transformers to apply.\n */\nfunction importTextTransformers(textNode, textFormatTransformersIndex, textMatchTransformers) {\n  let foundTextFormat = findOutermostTextFormatTransformer(textNode, textFormatTransformersIndex);\n  let foundTextMatch = findOutermostTextMatchTransformer(textNode, textMatchTransformers);\n  if (foundTextFormat && foundTextMatch) {\n    // Find the outermost transformer\n    if (foundTextFormat.startIndex <= foundTextMatch.startIndex && foundTextFormat.endIndex >= foundTextMatch.endIndex ||\n    // foundTextMatch is not contained within foundTextFormat\n    foundTextMatch.startIndex > foundTextFormat.endIndex) {\n      // foundTextFormat wraps foundTextMatch - apply foundTextFormat by setting foundTextMatch to null\n      foundTextMatch = null;\n    } else {\n      // foundTextMatch wraps foundTextFormat - apply foundTextMatch by setting foundTextFormat to null\n      foundTextFormat = null;\n    }\n  }\n  if (foundTextFormat) {\n    const result = importTextFormatTransformer(textNode, foundTextFormat.startIndex, foundTextFormat.endIndex, foundTextFormat.transformer, foundTextFormat.match);\n    if (canContainTransformableMarkdown(result.nodeAfter)) {\n      importTextTransformers(result.nodeAfter, textFormatTransformersIndex, textMatchTransformers);\n    }\n    if (canContainTransformableMarkdown(result.nodeBefore)) {\n      importTextTransformers(result.nodeBefore, textFormatTransformersIndex, textMatchTransformers);\n    }\n    if (canContainTransformableMarkdown(result.transformedNode)) {\n      importTextTransformers(result.transformedNode, textFormatTransformersIndex, textMatchTransformers);\n    }\n  } else if (foundTextMatch) {\n    const result = importFoundTextMatchTransformer(textNode, foundTextMatch.startIndex, foundTextMatch.endIndex, foundTextMatch.transformer, foundTextMatch.match);\n    if (!result) {\n      return;\n    }\n    if (canContainTransformableMarkdown(result.nodeAfter)) {\n      importTextTransformers(result.nodeAfter, textFormatTransformersIndex, textMatchTransformers);\n    }\n    if (canContainTransformableMarkdown(result.nodeBefore)) {\n      importTextTransformers(result.nodeBefore, textFormatTransformersIndex, textMatchTransformers);\n    }\n    if (canContainTransformableMarkdown(result.transformedNode)) {\n      importTextTransformers(result.transformedNode, textFormatTransformersIndex, textMatchTransformers);\n    }\n  }\n\n  // Handle escape characters\n  const textContent = textNode.getTextContent();\n  const unescapedText = unescapeText(textContent);\n  textNode.setTextContent(unescapedText);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * Renders markdown from a string. The selection is moved to the start after the operation.\n */\nfunction createMarkdownImport(transformers, shouldPreserveNewLines = false) {\n  const byType = transformersByType(transformers);\n  const textFormatTransformersIndex = createTextFormatTransformersIndex(byType.textFormat);\n  return (markdownString, node) => {\n    const lines = markdownString.split('\\n');\n    const linesLength = lines.length;\n    const root = node || $getRoot();\n    root.clear();\n    for (let i = 0; i < linesLength; i++) {\n      const lineText = lines[i];\n      const [imported, shiftedIndex] = $importMultiline(lines, i, byType.multilineElement, root);\n      if (imported) {\n        // If a multiline markdown element was imported, we don't want to process the lines that were part of it anymore.\n        // There could be other sub-markdown elements (both multiline and normal ones) matching within this matched multiline element's children.\n        // However, it would be the responsibility of the matched multiline transformer to decide how it wants to handle them.\n        // We cannot handle those, as there is no way for us to know how to maintain the correct order of generated lexical nodes for possible children.\n        i = shiftedIndex; // Next loop will start from the line after the last line of the multiline element\n        continue;\n      }\n      $importBlocks(lineText, root, byType.element, textFormatTransformersIndex, byType.textMatch, shouldPreserveNewLines);\n    }\n    const children = root.getChildren();\n    for (const child of children) {\n      // By default, removing empty paragraphs as md does not really\n      // allow empty lines and uses them as delimiter.\n      // If you need empty lines set shouldPreserveNewLines = true.\n      if (!shouldPreserveNewLines && isEmptyParagraph(child) && root.getChildrenSize() > 1) {\n        child.remove();\n        continue;\n      }\n      // Convert all '\\t' into TabNode.\n      if ($isElementNode(child)) {\n        for (const textNode of child.getAllTextNodes()) {\n          $normalizeMarkdownTextNode(textNode);\n        }\n      }\n    }\n    if ($getSelection() !== null) {\n      root.selectStart();\n    }\n  };\n}\n\n/**\n *\n * @returns first element of the returned tuple is a boolean indicating if a multiline element was imported. The second element is the index of the last line that was processed.\n */\nfunction $importMultiline(lines, startLineIndex, multilineElementTransformers, rootNode) {\n  for (const transformer of multilineElementTransformers) {\n    const {\n      handleImportAfterStartMatch,\n      regExpEnd,\n      regExpStart,\n      replace\n    } = transformer;\n    const startMatch = lines[startLineIndex].match(regExpStart);\n    if (!startMatch) {\n      continue; // Try next transformer\n    }\n    if (handleImportAfterStartMatch) {\n      const result = handleImportAfterStartMatch({\n        lines,\n        rootNode,\n        startLineIndex,\n        startMatch,\n        transformer\n      });\n      if (result === null) {\n        continue;\n      } else if (result) {\n        return result;\n      }\n    }\n    const regexpEndRegex = typeof regExpEnd === 'object' && 'regExp' in regExpEnd ? regExpEnd.regExp : regExpEnd;\n    const isEndOptional = regExpEnd && typeof regExpEnd === 'object' && 'optional' in regExpEnd ? regExpEnd.optional : !regExpEnd;\n    let endLineIndex = startLineIndex;\n    const linesLength = lines.length;\n\n    // check every single line for the closing match. It could also be on the same line as the opening match.\n    while (endLineIndex < linesLength) {\n      const endMatch = regexpEndRegex ? lines[endLineIndex].match(regexpEndRegex) : null;\n      if (!endMatch) {\n        if (!isEndOptional || isEndOptional && endLineIndex < linesLength - 1 // Optional end, but didn't reach the end of the document yet => continue searching for potential closing match\n        ) {\n          endLineIndex++;\n          continue; // Search next line for closing match\n        }\n      }\n\n      // Now, check if the closing match matched is the same as the opening match.\n      // If it is, we need to continue searching for the actual closing match.\n      if (endMatch && startLineIndex === endLineIndex && endMatch.index === startMatch.index) {\n        endLineIndex++;\n        continue; // Search next line for closing match\n      }\n\n      // At this point, we have found the closing match. Next: calculate the lines in between open and closing match\n      // This should not include the matches themselves, and be split up by lines\n      const linesInBetween = [];\n      if (endMatch && startLineIndex === endLineIndex) {\n        linesInBetween.push(lines[startLineIndex].slice(startMatch[0].length, -endMatch[0].length));\n      } else {\n        for (let i = startLineIndex; i <= endLineIndex; i++) {\n          if (i === startLineIndex) {\n            const text = lines[i].slice(startMatch[0].length);\n            linesInBetween.push(text); // Also include empty text\n          } else if (i === endLineIndex && endMatch) {\n            const text = lines[i].slice(0, -endMatch[0].length);\n            linesInBetween.push(text); // Also include empty text\n          } else {\n            linesInBetween.push(lines[i]);\n          }\n        }\n      }\n      if (replace(rootNode, null, startMatch, endMatch, linesInBetween, true) !== false) {\n        // Return here. This $importMultiline function is run line by line and should only process a single multiline element at a time.\n        return [true, endLineIndex];\n      }\n\n      // The replace function returned false, despite finding the matching open and close tags => this transformer does not want to handle it.\n      // Thus, we continue letting the remaining transformers handle the passed lines of text from the beginning\n      break;\n    }\n  }\n\n  // No multiline transformer handled this line successfully\n  return [false, startLineIndex];\n}\nfunction $importBlocks(lineText, rootNode, elementTransformers, textFormatTransformersIndex, textMatchTransformers, shouldPreserveNewLines) {\n  const textNode = $createTextNode(lineText);\n  const elementNode = $createParagraphNode();\n  elementNode.append(textNode);\n  rootNode.append(elementNode);\n  for (const {\n    regExp,\n    replace\n  } of elementTransformers) {\n    const match = lineText.match(regExp);\n    if (match) {\n      textNode.setTextContent(lineText.slice(match[0].length));\n      if (replace(elementNode, [textNode], match, true) !== false) {\n        break;\n      }\n    }\n  }\n  importTextTransformers(textNode, textFormatTransformersIndex, textMatchTransformers);\n\n  // If no transformer found and we left with original paragraph node\n  // can check if its content can be appended to the previous node\n  // if it's a paragraph, quote or list\n  if (elementNode.isAttached() && lineText.length > 0) {\n    const previousNode = elementNode.getPreviousSibling();\n    if (!shouldPreserveNewLines && (\n    // Only append if we're not preserving newlines\n    $isParagraphNode(previousNode) || $isQuoteNode(previousNode) || $isListNode(previousNode))) {\n      let targetNode = previousNode;\n      if ($isListNode(previousNode)) {\n        const lastDescendant = previousNode.getLastDescendant();\n        if (lastDescendant == null) {\n          targetNode = null;\n        } else {\n          targetNode = $findMatchingParent(lastDescendant, $isListItemNode);\n        }\n      }\n      if (targetNode != null && targetNode.getTextContentSize() > 0) {\n        const lastChild = targetNode.getLastChild();\n        if ($isTextNode(lastChild)) {\n          const lastText = lastChild.getTextContent();\n          if (lastText.endsWith('\\\\')) {\n            lastChild.setTextContent(lastText.slice(0, -1));\n          } else if (/ {2,}$/.test(lastText)) {\n            lastChild.setTextContent(lastText.replace(/ {2,}$/, ''));\n          }\n        }\n        targetNode.splice(targetNode.getChildrenSize(), 0, [$createLineBreakNode(), ...elementNode.getChildren()]);\n        elementNode.remove();\n      }\n    }\n  }\n}\n\n// Look in node for '\\t' and create a TabNode for each occurrence.\nfunction $normalizeMarkdownTextNode(textNode) {\n  const tabOffsets = new Set();\n  const text = textNode.getTextContent();\n  let index = text.indexOf('\\t');\n\n  // Find all tab occurrences\n  while (index !== -1) {\n    tabOffsets.add(index);\n    tabOffsets.add(index + 1);\n    index = text.indexOf('\\t', index + 1);\n  }\n\n  // Split node to isolate each tab then replace '\\t' into TabNode\n  const splitNodes = textNode.splitText(...tabOffsets);\n  splitNodes.forEach(node => {\n    if (node.getTextContent() === '\\t') {\n      node.replace($createTabNode());\n    }\n  });\n}\nfunction createTextFormatTransformersIndex(textTransformers) {\n  const transformersByTag = {};\n  const fullMatchRegExpByTag = {};\n  const openTagsRegExp = [];\n  for (const transformer of textTransformers) {\n    const {\n      tag\n    } = transformer;\n    transformersByTag[tag] = transformer;\n    const tagRegExp = tag.replace(/(\\*|\\^|\\+)/g, '\\\\$1');\n    openTagsRegExp.push(tagRegExp);\n\n    // Single-char tag (e.g. \"*\")\n    if (tag.length === 1) {\n      if (tag === '`') {\n        // Capture the preceding character in group 1 (empty string at start-of-string\n        // via the ^ branch) rather than using a negative lookbehind, which is not\n        // supported in Safari < 16.4. Consumers must add match[1].length to\n        // match.index to find the real start of the span (see importTextFormatTransformer.ts).\n        fullMatchRegExpByTag[tag] = new RegExp(`(^|[^\\\\\\\\\\`])(\\`)((?:\\\\\\\\\\`|[^\\`])+?)(\\`)(?!\\`)`);\n      } else {\n        fullMatchRegExpByTag[tag] = new RegExp(`(^|[^\\\\\\\\${tagRegExp}])(${tagRegExp})((\\\\\\\\${tagRegExp})?.*?[^${tagRegExp}\\\\s](\\\\\\\\${tagRegExp})?)(${tagRegExp})(?![\\\\\\\\${tagRegExp}])`);\n      }\n    } else {\n      // Multi-char tags (e.g. \"**\")\n      fullMatchRegExpByTag[tag] = new RegExp(`(^|[^\\\\\\\\])(${tagRegExp})((\\\\\\\\${tagRegExp})?.*?[^\\\\s](\\\\\\\\${tagRegExp})?)(${tagRegExp})(?!\\\\\\\\)`);\n    }\n  }\n  return {\n    // Reg exp to find open tag + content + close tag\n    fullMatchRegExpByTag,\n    // Regexp to locate *any* potential opening tag (longest first).\n    // The former (?<!\\\\) escape guard has been removed \u2014 the delimiter\n    // scanner's isEscaped() check handles escape filtering at match time.\n    openTagsRegExp: new RegExp(`(${openTagsRegExp.join('|')})`, 'g'),\n    transformersByTag\n  };\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n  throw new Error(message);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst ORDERED_LIST_REGEX = /^(\\s*)(\\d{1,})\\.\\s/;\nconst UNORDERED_LIST_REGEX = /^(\\s*)[-*+]\\s/;\nconst CHECK_LIST_REGEX = /^(\\s*)(?:[-*+]\\s)?\\s?(\\[(\\s|x)?\\])\\s/i;\nconst HEADING_REGEX = /^(#{1,6})\\s/;\nconst QUOTE_REGEX = /^>\\s/;\nconst CODE_START_REGEX = /^([ \\t]*`{3,})([\\w-]+)?[ \\t]?/;\nconst CODE_END_REGEX = /^[ \\t]*`{3,}$/;\nconst CODE_SINGLE_LINE_REGEX = /^[ \\t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/;\nconst TABLE_ROW_REG_EXP = /^(?:\\|)(.+)(?:\\|)\\s?$/;\nconst TABLE_ROW_DIVIDER_REG_EXP = /^(\\| ?:?-*:? ?)+\\|\\s?$/;\nconst TAG_START_REGEX = /^<[a-z_][\\w-]*(?:\\s[^<>]*)?\\/?>/i;\nconst TAG_END_REGEX = /^<\\/[a-z_][\\w-]*\\s*>/i;\nconst ENDS_WITH = regex => new RegExp(`(?:${regex.source})$`, regex.flags);\nconst listMarkerState = createState('mdListMarker', {\n  parse: v => typeof v === 'string' && /^[-*+]$/.test(v) ? v : '-',\n  resetOnCopyNode: true\n});\nconst codeFenceState = createState('mdCodeFence', {\n  parse: val => {\n    if (typeof val === 'string' && /^`{3,}$/.test(val)) {\n      return val;\n    }\n    return '```';\n  },\n  resetOnCopyNode: true\n});\nconst createBlockNode = createNode => {\n  return (parentNode, children, match, isImport) => {\n    const node = createNode(match);\n    node.append(...children);\n    parentNode.replace(node);\n    if (!isImport) {\n      node.select(0, 0);\n    }\n  };\n};\n\n// Amount of spaces that define indentation level\n// TODO: should be an option\nconst LIST_INDENT_SIZE = 4;\nfunction getIndent(whitespaces) {\n  const tabs = whitespaces.match(/\\t/g);\n  const spaces = whitespaces.match(/ /g);\n  let indent = 0;\n  if (tabs) {\n    indent += tabs.length;\n  }\n  if (spaces) {\n    indent += Math.floor(spaces.length / LIST_INDENT_SIZE);\n  }\n  return indent;\n}\nconst listReplace = listType => {\n  return (parentNode, children, match, isImport) => {\n    const previousNode = parentNode.getPreviousSibling();\n    const nextNode = parentNode.getNextSibling();\n    const listItem = $createListItemNode(listType === 'check' ? match[3] === 'x' : undefined);\n    const firstMatchChar = match[0].trim()[0];\n    const listMarker = (listType === 'bullet' || listType === 'check') && firstMatchChar === listMarkerState.parse(firstMatchChar) ? firstMatchChar : undefined;\n    if ($isListNode(nextNode) && nextNode.getListType() === listType) {\n      if (listMarker) {\n        $setState(nextNode, listMarkerState, listMarker);\n      }\n      const firstChild = nextNode.getFirstChild();\n      if (firstChild !== null) {\n        firstChild.insertBefore(listItem);\n      } else {\n        // should never happen, but let's handle gracefully, just in case.\n        nextNode.append(listItem);\n      }\n      parentNode.remove();\n    } else if ($isListNode(previousNode) && previousNode.getListType() === listType) {\n      if (listMarker) {\n        $setState(previousNode, listMarkerState, listMarker);\n      }\n      previousNode.append(listItem);\n      parentNode.remove();\n    } else {\n      const list = $createListNode(listType, listType === 'number' ? Number(match[2]) : undefined);\n      if (listMarker) {\n        $setState(list, listMarkerState, listMarker);\n      }\n      list.append(listItem);\n      parentNode.replace(list);\n    }\n    listItem.append(...children);\n    if (!isImport) {\n      listItem.select(0, 0);\n    }\n    const indent = getIndent(match[1]);\n    if (indent) {\n      listItem.setIndent(indent);\n    }\n  };\n};\nconst $listExport = (listNode, exportChildren, depth) => {\n  const output = [];\n  const children = listNode.getChildren();\n  let index = 0;\n  for (const listItemNode of children) {\n    if ($isListItemNode(listItemNode)) {\n      if (listItemNode.getChildrenSize() === 1) {\n        const firstChild = listItemNode.getFirstChild();\n        if ($isListNode(firstChild)) {\n          output.push($listExport(firstChild, exportChildren, depth + 1));\n          continue;\n        }\n      }\n      const indent = ' '.repeat(depth * LIST_INDENT_SIZE);\n      const listType = listNode.getListType();\n      const listMarker = $getState(listNode, listMarkerState);\n      const prefix = listType === 'number' ? `${listNode.getStart() + index}. ` : listType === 'check' ? `${listMarker} [${listItemNode.getChecked() ? 'x' : ' '}] ` : listMarker + ' ';\n      let childrenText = exportChildren(listItemNode);\n      if (listType !== 'number') {\n        childrenText = childrenText.replace(/^(\\s{0,3}\\d+)(\\.\\s)/, '$1\\\\$2');\n      }\n      output.push(indent + prefix + childrenText);\n      index++;\n    }\n  }\n  return output.join('\\n');\n};\nconst HEADING = {\n  dependencies: [HeadingNode],\n  export: (node, exportChildren) => {\n    if (!$isHeadingNode(node)) {\n      return null;\n    }\n    const level = Number(node.getTag().slice(1));\n    return '#'.repeat(level) + ' ' + exportChildren(node);\n  },\n  regExp: HEADING_REGEX,\n  replace: createBlockNode(match => {\n    const tag = 'h' + match[1].length;\n    return $createHeadingNode(tag);\n  }),\n  type: 'element'\n};\nconst QUOTE = {\n  dependencies: [QuoteNode],\n  export: (node, exportChildren) => {\n    if (!$isQuoteNode(node)) {\n      return null;\n    }\n    const lines = exportChildren(node).split('\\n');\n    const output = [];\n    for (const line of lines) {\n      output.push('> ' + line);\n    }\n    return output.join('\\n');\n  },\n  regExp: QUOTE_REGEX,\n  replace: (parentNode, children, _match, isImport) => {\n    if (isImport) {\n      const previousNode = parentNode.getPreviousSibling();\n      if ($isQuoteNode(previousNode)) {\n        previousNode.splice(previousNode.getChildrenSize(), 0, [$createLineBreakNode(), ...children]);\n        parentNode.remove();\n        return;\n      }\n    }\n    const node = $createQuoteNode();\n    node.append(...children);\n    parentNode.replace(node);\n    if (!isImport) {\n      node.select(0, 0);\n    }\n  },\n  type: 'element'\n};\nconst CODE = {\n  dependencies: [CodeNode],\n  export: node => {\n    if (!$isCodeNode(node)) {\n      return null;\n    }\n    const textContent = node.getTextContent();\n    let fence = $getState(node, codeFenceState);\n    if (textContent.indexOf(fence) > -1) {\n      const backticks = textContent.match(/`{3,}/g);\n      if (backticks) {\n        const maxLength = Math.max(...backticks.map(b => b.length));\n        fence = '`'.repeat(maxLength + 1);\n      }\n    }\n    return fence + (node.getLanguage() || '') + (textContent ? '\\n' + textContent : '') + '\\n' + fence;\n  },\n  handleImportAfterStartMatch: ({\n    lines,\n    rootNode,\n    startLineIndex,\n    startMatch\n  }) => {\n    const fence = startMatch[1];\n    const fenceLength = fence.trim().length;\n    const currentLine = lines[startLineIndex];\n    const afterFenceIndex = startMatch.index + fence.length;\n    const afterFence = currentLine.slice(afterFenceIndex);\n    const singleLineEndRegex = new RegExp(`\\`{${fenceLength},}$`);\n    if (singleLineEndRegex.test(afterFence)) {\n      const endMatch = afterFence.match(singleLineEndRegex);\n      const content = afterFence.slice(0, afterFence.lastIndexOf(endMatch[0]));\n      const fakeStartMatch = [...startMatch];\n      fakeStartMatch[2] = '';\n      CODE.replace(rootNode, null, fakeStartMatch, endMatch, [content], true);\n      return [true, startLineIndex];\n    }\n    const multilineEndRegex = new RegExp(`^[ \\\\t]*\\`{${fenceLength},}$`);\n    for (let i = startLineIndex + 1; i < lines.length; i++) {\n      const line = lines[i];\n      if (multilineEndRegex.test(line)) {\n        const endMatch = line.match(multilineEndRegex);\n        const linesInBetween = lines.slice(startLineIndex + 1, i);\n        const afterFullMatch = currentLine.slice(startMatch[0].length);\n        if (afterFullMatch.length > 0) {\n          linesInBetween.unshift(afterFullMatch);\n        }\n        CODE.replace(rootNode, null, startMatch, endMatch, linesInBetween, true);\n        return [true, i];\n      }\n    }\n    const linesInBetween = lines.slice(startLineIndex + 1);\n    const afterFullMatch = currentLine.slice(startMatch[0].length);\n    if (afterFullMatch.length > 0) {\n      linesInBetween.unshift(afterFullMatch);\n    }\n    CODE.replace(rootNode, null, startMatch, null, linesInBetween, true);\n    return [true, lines.length - 1];\n  },\n  regExpEnd: {\n    optional: true,\n    regExp: CODE_END_REGEX\n  },\n  regExpStart: CODE_START_REGEX,\n  replace: (rootNode, children, startMatch, endMatch, linesInBetween, isImport) => {\n    let codeBlockNode;\n    let code;\n    const fence = startMatch[1] ? startMatch[1].trim() : '```';\n    const language = startMatch[2] || undefined;\n    if (!children && linesInBetween) {\n      if (linesInBetween.length === 1) {\n        if (endMatch) {\n          codeBlockNode = $createCodeNode(language);\n          code = linesInBetween[0];\n        } else {\n          codeBlockNode = $createCodeNode(language);\n          code = linesInBetween[0].startsWith(' ') ? linesInBetween[0].slice(1) : linesInBetween[0];\n        }\n      } else {\n        codeBlockNode = $createCodeNode(language);\n        if (linesInBetween.length > 0) {\n          if (linesInBetween[0].trim().length === 0) {\n            linesInBetween.shift();\n          } else if (linesInBetween[0].startsWith(' ')) {\n            linesInBetween[0] = linesInBetween[0].slice(1);\n          }\n        }\n        while (linesInBetween.length > 0 && !linesInBetween[linesInBetween.length - 1].length) {\n          linesInBetween.pop();\n        }\n        code = linesInBetween.join('\\n');\n      }\n      $setState(codeBlockNode, codeFenceState, fence);\n      const textNode = $createTextNode(code);\n      codeBlockNode.append(textNode);\n      rootNode.append(codeBlockNode);\n    } else if (children) {\n      createBlockNode(match => {\n        return $createCodeNode(match ? match[2] : undefined);\n      })(rootNode, children, startMatch, isImport);\n    }\n  },\n  type: 'multiline-element'\n};\nconst UNORDERED_LIST = {\n  dependencies: [ListNode, ListItemNode],\n  export: (node, exportChildren) => {\n    return $isListNode(node) ? $listExport(node, exportChildren, 0) : null;\n  },\n  regExp: UNORDERED_LIST_REGEX,\n  replace: listReplace('bullet'),\n  type: 'element'\n};\nconst CHECK_LIST = {\n  dependencies: [ListNode, ListItemNode],\n  export: (node, exportChildren) => {\n    return $isListNode(node) ? $listExport(node, exportChildren, 0) : null;\n  },\n  regExp: CHECK_LIST_REGEX,\n  replace: listReplace('check'),\n  type: 'element'\n};\nconst ORDERED_LIST = {\n  dependencies: [ListNode, ListItemNode],\n  export: (node, exportChildren) => {\n    return $isListNode(node) ? $listExport(node, exportChildren, 0) : null;\n  },\n  regExp: ORDERED_LIST_REGEX,\n  replace: listReplace('number'),\n  type: 'element'\n};\nconst INLINE_CODE = {\n  format: ['code'],\n  tag: '`',\n  type: 'text-format'\n};\nconst HIGHLIGHT = {\n  format: ['highlight'],\n  tag: '==',\n  type: 'text-format'\n};\nconst BOLD_ITALIC_STAR = {\n  format: ['bold', 'italic'],\n  tag: '***',\n  type: 'text-format'\n};\nconst BOLD_ITALIC_UNDERSCORE = {\n  format: ['bold', 'italic'],\n  intraword: false,\n  tag: '___',\n  type: 'text-format'\n};\nconst BOLD_STAR = {\n  format: ['bold'],\n  tag: '**',\n  type: 'text-format'\n};\nconst BOLD_UNDERSCORE = {\n  format: ['bold'],\n  intraword: false,\n  tag: '__',\n  type: 'text-format'\n};\nconst STRIKETHROUGH = {\n  format: ['strikethrough'],\n  tag: '~~',\n  type: 'text-format'\n};\nconst ITALIC_STAR = {\n  format: ['italic'],\n  tag: '*',\n  type: 'text-format'\n};\nconst ITALIC_UNDERSCORE = {\n  format: ['italic'],\n  intraword: false,\n  tag: '_',\n  type: 'text-format'\n};\n\n// Order of text transformers matters:\n//\n// - code should go first as it prevents any transformations inside\n// - then longer tags match (e.g. ** or __ should go before * or _)\nconst LINK = {\n  dependencies: [LinkNode],\n  export: (node, exportChildren, exportFormat) => {\n    if (!$isLinkNode(node) || $isAutoLinkNode(node)) {\n      return null;\n    }\n    const textContent = exportChildren(node);\n    let title = node.getTitle();\n    if (title != null) {\n      title = title.replace(/([\\\\\"])/g, '\\\\$1');\n    }\n    const linkContent = title ? `[${textContent}](${node.getURL()} \"${title}\")` : `[${textContent}](${node.getURL()})`;\n    return linkContent;\n  },\n  importRegExp: /(?:\\[(.+?)\\])(?:\\((?:([^()\\s]+)(?:\\s\"((?:[^\"]*\\\\\")*[^\"]*)\"\\s*)?)\\))/,\n  regExp: /(?:\\[([^[\\]]*(?:\\[[^[\\]]*\\][^[\\]]*)*)\\])(?:\\((?:([^()\\s]+)(?:\\s\"((?:[^\"]*\\\\\")*[^\"]*)\"\\s*)?)\\))$/,\n  replace: (textNode, match) => {\n    // https://spec.commonmark.org/0.31.2/#inline-link\n    if ($findMatchingParent$1(textNode, $isLinkNode)) {\n      return;\n    }\n    const [, linkText, rawLinkUrl, rawLinkTitle] = match;\n    const linkUrl = rawLinkUrl != null ? unescapeText(rawLinkUrl) : undefined;\n    const linkTitle = rawLinkTitle != null ? unescapeText(rawLinkTitle) : undefined;\n    const linkNode = $createLinkNode(linkUrl, {\n      title: linkTitle\n    });\n    const openBracketAmount = linkText.split('[').length - 1;\n    const closeBracketAmount = linkText.split(']').length - 1;\n    let parsedLinkText = linkText;\n    let outsideLinkText = '';\n    if (openBracketAmount < closeBracketAmount) {\n      return;\n    } else if (openBracketAmount > closeBracketAmount) {\n      const linkTextParts = linkText.split('[');\n      outsideLinkText = '[' + linkTextParts[0];\n      parsedLinkText = linkTextParts.slice(1).join('[');\n    }\n    const linkTextNode = $createTextNode(parsedLinkText);\n    linkTextNode.setFormat(textNode.getFormat());\n    linkNode.append(linkTextNode);\n    textNode.replace(linkNode);\n    if (outsideLinkText) {\n      linkNode.insertBefore($createTextNode(outsideLinkText));\n    }\n    return linkTextNode;\n  },\n  trigger: ')',\n  type: 'text-match'\n};\nconst ELEMENT_TRANSFORMERS = [HEADING, QUOTE, UNORDERED_LIST, ORDERED_LIST];\nconst MULTILINE_ELEMENT_TRANSFORMERS = [CODE];\n\n// Order of text format transformers matters:\n//\n// - code should go first as it prevents any transformations inside\n// - then longer tags match (e.g. ** or __ should go before * or _)\nconst TEXT_FORMAT_TRANSFORMERS = [INLINE_CODE, BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE, HIGHLIGHT, ITALIC_STAR, ITALIC_UNDERSCORE, STRIKETHROUGH];\nconst TEXT_MATCH_TRANSFORMERS = [LINK];\nconst TRANSFORMERS = [...ELEMENT_TRANSFORMERS, ...MULTILINE_ELEMENT_TRANSFORMERS, ...TEXT_FORMAT_TRANSFORMERS, ...TEXT_MATCH_TRANSFORMERS];\nfunction normalizeMarkdown(input, shouldMergeAdjacentLines = false) {\n  const lines = input.split('\\n');\n  let inCodeBlock = false;\n  const sanitizedLines = [];\n  for (let i = 0; i < lines.length; i++) {\n    const rawLine = lines[i];\n    const line = rawLine.trimEnd();\n    const lastLine = sanitizedLines[sanitizedLines.length - 1];\n\n    // Code blocks of ```single line``` don't toggle the inCodeBlock flag\n    if (CODE_SINGLE_LINE_REGEX.test(line)) {\n      sanitizedLines.push(line);\n      continue;\n    }\n\n    // Detect the start or end of a code block\n    if (CODE_START_REGEX.test(line) || CODE_END_REGEX.test(line)) {\n      inCodeBlock = !inCodeBlock;\n      sanitizedLines.push(line);\n      continue;\n    }\n\n    // If we are inside a code block, keep the line unchanged\n    if (inCodeBlock) {\n      sanitizedLines.push(rawLine);\n      continue;\n    }\n\n    // In markdown the concept of \"empty paragraphs\" does not exist.\n    // Blocks must be separated by an empty line. Non-empty adjacent lines must be merged.\n    if (line === '' || lastLine === '' || !lastLine || HEADING_REGEX.test(lastLine) || HEADING_REGEX.test(line) || QUOTE_REGEX.test(line) || ORDERED_LIST_REGEX.test(line) || UNORDERED_LIST_REGEX.test(line) || CHECK_LIST_REGEX.test(line) || TABLE_ROW_REG_EXP.test(line) || TABLE_ROW_DIVIDER_REG_EXP.test(line) || !shouldMergeAdjacentLines || TAG_START_REGEX.test(line) || TAG_END_REGEX.test(line) || ENDS_WITH(TAG_END_REGEX).test(lastLine) || ENDS_WITH(TAG_START_REGEX).test(lastLine) || CODE_END_REGEX.test(lastLine)) {\n      // When not merging, preserve trailing whitespace (e.g. hard line-break\n      // markers \"  \" or non-breaking spaces). Whitespace-only lines still\n      // collapse to '' because trimEnd() already reduced them, so they\n      // continue to act as paragraph separators.\n      sanitizedLines.push(!shouldMergeAdjacentLines && line !== '' ? rawLine : line);\n    } else {\n      sanitizedLines[sanitizedLines.length - 1] = lastLine + ' ' + line.trimStart();\n    }\n  }\n  return sanitizedLines.join('\\n');\n}\n\nfunction runElementTransformers(parentNode, anchorNode, anchorOffset, elementTransformers) {\n  const grandParentNode = parentNode.getParent();\n  if (!$isRootOrShadowRoot(grandParentNode) || parentNode.getFirstChild() !== anchorNode) {\n    return false;\n  }\n  const textContent = anchorNode.getTextContent();\n\n  // Checking for anchorOffset position to prevent any checks for cases when caret is too far\n  // from a line start to be a part of block-level markdown trigger.\n  //\n  // TODO:\n  // Can have a quick check if caret is close enough to the beginning of the string (e.g. offset less than 10-20)\n  // since otherwise it won't be a markdown shortcut, but tables are exception\n  if (textContent[anchorOffset - 1] !== ' ') {\n    return false;\n  }\n  for (const {\n    regExp,\n    replace\n  } of elementTransformers) {\n    const match = textContent.match(regExp);\n    if (match && match[0].length === (match[0].endsWith(' ') ? anchorOffset : anchorOffset - 1)) {\n      const nextSiblings = anchorNode.getNextSiblings();\n      const [leadingNode, remainderNode] = anchorNode.splitText(anchorOffset);\n      const siblings = remainderNode ? [remainderNode, ...nextSiblings] : nextSiblings;\n      if (replace(parentNode, siblings, match, false) !== false) {\n        leadingNode.remove();\n        return true;\n      }\n    }\n  }\n  return false;\n}\nfunction runMultilineElementTransformers(parentNode, anchorNode, anchorOffset, elementTransformers, triggerOnEnter) {\n  const grandParentNode = parentNode.getParent();\n  if (!$isRootOrShadowRoot(grandParentNode) || parentNode.getFirstChild() !== anchorNode) {\n    return false;\n  }\n  const textContent = anchorNode.getTextContent();\n  if (!triggerOnEnter) {\n    // Checking for anchorOffset position to prevent any checks for cases when caret is too far\n    // from a line start to be a part of block-level markdown trigger.\n    //\n    // TODO:\n    // Can have a quick check if caret is close enough to the beginning of the string (e.g. offset less than 10-20)\n    // since otherwise it won't be a markdown shortcut, but tables are exception\n    if (textContent[anchorOffset - 1] !== ' ') {\n      return false;\n    }\n  }\n  for (const {\n    regExpStart,\n    replace,\n    regExpEnd\n  } of elementTransformers) {\n    if (regExpEnd && !('optional' in regExpEnd) || regExpEnd && 'optional' in regExpEnd && !regExpEnd.optional) {\n      continue;\n    }\n    const match = textContent.match(regExpStart);\n    if (match) {\n      const matchLength = triggerOnEnter || match[0].endsWith(' ') ? anchorOffset : anchorOffset - 1;\n      if (match[0].length !== matchLength) {\n        continue;\n      }\n      const nextSiblings = anchorNode.getNextSiblings();\n      const [leadingNode, remainderNode] = anchorNode.splitText(anchorOffset);\n      const siblings = remainderNode ? [remainderNode, ...nextSiblings] : nextSiblings;\n      if (replace(parentNode, siblings, match, null, null, false) !== false) {\n        leadingNode.remove();\n        return true;\n      }\n    }\n  }\n  return false;\n}\nfunction runTextMatchTransformers(anchorNode, anchorOffset, transformersByTrigger) {\n  let textContent = anchorNode.getTextContent();\n  const lastChar = textContent[anchorOffset - 1];\n  const transformers = transformersByTrigger[lastChar];\n  if (transformers == null) {\n    return false;\n  }\n\n  // If typing in the middle of content, remove the tail to do\n  // reg exp match up to a string end (caret position)\n  if (anchorOffset < textContent.length) {\n    textContent = textContent.slice(0, anchorOffset);\n  }\n  for (const transformer of transformers) {\n    if (!transformer.replace || !transformer.regExp) {\n      continue;\n    }\n    const match = textContent.match(transformer.regExp);\n    if (match === null) {\n      continue;\n    }\n    const startIndex = match.index || 0;\n    const endIndex = startIndex + match[0].length;\n    let replaceNode;\n    if (startIndex === 0) {\n      [replaceNode] = anchorNode.splitText(endIndex);\n    } else {\n      [, replaceNode] = anchorNode.splitText(startIndex, endIndex);\n    }\n    replaceNode.selectNext(0, 0);\n    transformer.replace(replaceNode, match);\n    return true;\n  }\n  return false;\n}\nfunction $runTextFormatTransformers(anchorNode, anchorOffset, textFormatTransformers) {\n  const textContent = anchorNode.getTextContent();\n  const closeTagEndIndex = anchorOffset - 1;\n  const closeChar = textContent[closeTagEndIndex];\n  // Quick check if we're possibly at the end of inline markdown style\n  const matchers = textFormatTransformers[closeChar];\n  if (!matchers) {\n    return false;\n  }\n  for (const matcher of matchers) {\n    const {\n      tag\n    } = matcher;\n    const tagLength = tag.length;\n    const closeTagStartIndex = closeTagEndIndex - tagLength + 1;\n\n    // If tag is not single char check if rest of it matches with text content\n    if (tagLength > 1) {\n      if (!isEqualSubString(textContent, closeTagStartIndex, tag, 0, tagLength)) {\n        continue;\n      }\n    }\n\n    // Space before closing tag cancels inline markdown\n    if (textContent[closeTagStartIndex - 1] === ' ') {\n      continue;\n    }\n\n    // Some tags can not be used within words, hence should have newline/space/punctuation after it\n    const afterCloseTagChar = textContent[closeTagEndIndex + 1];\n    if (matcher.intraword === false && afterCloseTagChar && !PUNCTUATION_OR_SPACE.test(afterCloseTagChar)) {\n      continue;\n    }\n    const closeNode = anchorNode;\n    let openNode = closeNode;\n    let openTagStartIndex = getOpenTagStartIndex(textContent, closeTagStartIndex, tag);\n\n    // Go through text node siblings and search for opening tag\n    // if haven't found it within the same text node as closing tag\n    let sibling = openNode;\n    while (openTagStartIndex < 0 && (sibling = sibling.getPreviousSibling())) {\n      if ($isLineBreakNode(sibling)) {\n        break;\n      }\n      if ($isTextNode(sibling)) {\n        if (sibling.hasFormat('code')) {\n          continue;\n        }\n        const siblingTextContent = sibling.getTextContent();\n        openNode = sibling;\n        openTagStartIndex = getOpenTagStartIndex(siblingTextContent, siblingTextContent.length, tag);\n      }\n    }\n\n    // Opening tag is not found\n    if (openTagStartIndex < 0) {\n      continue;\n    }\n\n    // No content between opening and closing tag\n    if (openNode === closeNode && openTagStartIndex + tagLength === closeTagStartIndex) {\n      continue;\n    }\n\n    // Checking longer tags for repeating chars (e.g. *** vs **)\n    const prevOpenNodeText = openNode.getTextContent();\n    if (openTagStartIndex > 0 && prevOpenNodeText[openTagStartIndex - 1] === closeChar) {\n      continue;\n    }\n\n    // Some tags can not be used within words, hence should have newline/space/punctuation before it\n    const beforeOpenTagChar = prevOpenNodeText[openTagStartIndex - 1];\n    if (matcher.intraword === false && beforeOpenTagChar && !PUNCTUATION_OR_SPACE.test(beforeOpenTagChar)) {\n      continue;\n    }\n\n    // Per CommonMark, code spans take precedence over other inline formatting\n    if (!matcher.format.includes('code') && $isInsideUnclosedCodeSpan(openNode, openTagStartIndex)) {\n      continue;\n    }\n\n    // Clean text from opening and closing tags (starting from closing tag\n    // to prevent any offset shifts if we start from opening one)\n    const prevCloseNodeText = closeNode.getTextContent();\n    const closeNodeText = prevCloseNodeText.slice(0, closeTagStartIndex) + prevCloseNodeText.slice(closeTagEndIndex + 1);\n    closeNode.setTextContent(closeNodeText);\n    const openNodeText = openNode === closeNode ? closeNodeText : prevOpenNodeText;\n    openNode.setTextContent(openNodeText.slice(0, openTagStartIndex) + openNodeText.slice(openTagStartIndex + tagLength));\n    const selection = $getSelection();\n    const nextSelection = $createRangeSelection();\n    $setSelection(nextSelection);\n    // Adjust offset based on deleted chars\n    const newOffset = closeTagEndIndex - tagLength * (openNode === closeNode ? 2 : 1) + 1;\n    nextSelection.anchor.set(openNode.__key, openTagStartIndex, 'text');\n    nextSelection.focus.set(closeNode.__key, newOffset, 'text');\n\n    // Apply formatting to selected text\n    for (const format of matcher.format) {\n      if (!nextSelection.hasFormat(format)) {\n        nextSelection.formatText(format);\n      }\n    }\n\n    // Collapse selection up to the focus point\n    nextSelection.anchor.set(nextSelection.focus.key, nextSelection.focus.offset, nextSelection.focus.type);\n\n    // Remove formatting from collapsed selection\n    for (const format of matcher.format) {\n      if (nextSelection.hasFormat(format)) {\n        nextSelection.toggleFormat(format);\n      }\n    }\n    if ($isRangeSelection(selection)) {\n      nextSelection.format = selection.format;\n    }\n    return true;\n  }\n  return false;\n}\n\n// Per CommonMark spec, code spans take precedence over other inline\n// formatting. Returns true if there is an unclosed backtick (code span\n// opener) in the text preceding the given offset, which means the offset\n// is inside a code span that hasn't been closed yet.\nfunction $isInsideUnclosedCodeSpan(node, offset) {\n  let backtickCount = 0;\n  const text = node.getTextContent();\n  for (let i = 0; i < offset; i++) {\n    if (text[i] === '`') {\n      backtickCount++;\n    }\n  }\n  return backtickCount % 2 !== 0;\n}\nfunction getOpenTagStartIndex(string, maxIndex, tag) {\n  const tagLength = tag.length;\n  for (let i = maxIndex; i >= tagLength; i--) {\n    const startIndex = i - tagLength;\n    if (isEqualSubString(string, startIndex, tag, 0, tagLength) &&\n    // Space after opening tag cancels transformation\n    string[startIndex + tagLength] !== ' ') {\n      return startIndex;\n    }\n  }\n  return -1;\n}\nfunction isEqualSubString(stringA, aStart, stringB, bStart, length) {\n  for (let i = 0; i < length; i++) {\n    if (stringA[aStart + i] !== stringB[bStart + i]) {\n      return false;\n    }\n  }\n  return true;\n}\nfunction registerMarkdownShortcuts(editor, transformers = TRANSFORMERS) {\n  const byType = transformersByType(transformers);\n  const textFormatTransformersByTrigger = indexBy(byType.textFormat, ({\n    tag\n  }) => tag[tag.length - 1]);\n  const textMatchTransformersByTrigger = indexBy(byType.textMatch, ({\n    trigger\n  }) => trigger);\n  for (const transformer of transformers) {\n    const type = transformer.type;\n    if (type === 'element' || type === 'text-match' || type === 'multiline-element') {\n      const dependencies = transformer.dependencies;\n      for (const node of dependencies) {\n        if (!editor.hasNode(node)) {\n          {\n            formatDevErrorMessage(`MarkdownShortcuts: missing dependency ${node.getType()} for transformer. Ensure node dependency is included in editor initial config.`);\n          }\n        }\n      }\n    }\n  }\n  const $transform = (parentNode, anchorNode, anchorOffset) => {\n    if (runElementTransformers(parentNode, anchorNode, anchorOffset, byType.element)) {\n      return true;\n    }\n    if (runMultilineElementTransformers(parentNode, anchorNode, anchorOffset, byType.multilineElement)) {\n      return true;\n    }\n    if (runTextMatchTransformers(anchorNode, anchorOffset, textMatchTransformersByTrigger)) {\n      return true;\n    }\n    if ($runTextFormatTransformers(anchorNode, anchorOffset, textFormatTransformersByTrigger)) {\n      return true;\n    }\n    return false;\n  };\n  return mergeRegister(editor.registerUpdateListener(({\n    tags,\n    dirtyLeaves,\n    editorState,\n    prevEditorState\n  }) => {\n    // Ignore updates from collaboration and undo/redo (as changes already calculated)\n    if (tags.has(COLLABORATION_TAG) || tags.has(HISTORIC_TAG)) {\n      return;\n    }\n\n    // If editor is still composing (i.e. backticks) we must wait before the user confirms the key\n    if (editor.isComposing()) {\n      return;\n    }\n    const selection = editorState.read($getSelection);\n    const prevSelection = prevEditorState.read($getSelection);\n\n    // We expect selection to be a collapsed range and not match previous one (as we want\n    // to trigger transforms only as user types)\n    if (!$isRangeSelection(prevSelection) || !$isRangeSelection(selection) || !selection.isCollapsed() || selection.is(prevSelection)) {\n      return;\n    }\n    const anchorKey = selection.anchor.key;\n    const anchorOffset = selection.anchor.offset;\n    const anchorNode = editorState._nodeMap.get(anchorKey);\n    if (!$isTextNode(anchorNode) || !dirtyLeaves.has(anchorKey) || anchorOffset !== 1 && anchorOffset > prevSelection.anchor.offset + 1) {\n      return;\n    }\n    editor.update(() => {\n      if (!canContainTransformableMarkdown(anchorNode)) {\n        return;\n      }\n      const parentNode = anchorNode.getParent();\n      if (parentNode === null || $isCodeNode(parentNode)) {\n        return;\n      }\n      if ($transform(parentNode, anchorNode, selection.anchor.offset)) {\n        $addUpdateTag(HISTORY_PUSH_TAG);\n      }\n    });\n  }), editor.registerCommand(KEY_ENTER_COMMAND, event => {\n    if (event !== null && event.shiftKey) {\n      return false;\n    }\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection) || !selection.isCollapsed()) {\n      return false;\n    }\n    const anchorOffset = selection.anchor.offset;\n    const anchorNode = selection.anchor.getNode();\n    if (!$isTextNode(anchorNode) || !canContainTransformableMarkdown(anchorNode)) {\n      return false;\n    }\n    const parentNode = anchorNode.getParent();\n    if (parentNode === null || $isCodeNode(parentNode)) {\n      return false;\n    }\n    const textContent = anchorNode.getTextContent();\n    if (anchorOffset !== textContent.length) {\n      return false;\n    }\n    if (runMultilineElementTransformers(parentNode, anchorNode, anchorOffset, byType.multilineElement, true)) {\n      if (event !== null) {\n        event.preventDefault();\n      }\n      return true;\n    }\n    return false;\n  }, COMMAND_PRIORITY_LOW));\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n\n/**\n * Renders markdown from a string. The selection is moved to the start after the operation.\n *\n *  @param {boolean} [shouldPreserveNewLines] By setting this to true, new lines will be preserved between conversions\n *  @param {boolean} [shouldMergeAdjacentLines] By setting this to true, adjacent non empty lines will be merged according to commonmark spec: https://spec.commonmark.org/0.24/#example-177. Not applicable if shouldPreserveNewLines = true.\n */\nfunction $convertFromMarkdownString(markdown, transformers = TRANSFORMERS, node, shouldPreserveNewLines = false, shouldMergeAdjacentLines = false) {\n  const sanitizedMarkdown = shouldPreserveNewLines ? markdown : normalizeMarkdown(markdown, shouldMergeAdjacentLines);\n  const importMarkdown = createMarkdownImport(transformers, shouldPreserveNewLines);\n  return importMarkdown(sanitizedMarkdown, node);\n}\n\n/**\n * Renders string from markdown. The selection is moved to the start after the operation.\n */\nfunction $convertToMarkdownString(transformers = TRANSFORMERS, node, shouldPreserveNewLines = false) {\n  const exportMarkdown = createMarkdownExport(transformers, shouldPreserveNewLines);\n  return exportMarkdown(node);\n}\n\nexport { $convertFromMarkdownString, $convertToMarkdownString, BOLD_ITALIC_STAR, BOLD_ITALIC_UNDERSCORE, BOLD_STAR, BOLD_UNDERSCORE, CHECK_LIST, CODE, ELEMENT_TRANSFORMERS, HEADING, HIGHLIGHT, INLINE_CODE, ITALIC_STAR, ITALIC_UNDERSCORE, LINK, MULTILINE_ELEMENT_TRANSFORMERS, ORDERED_LIST, QUOTE, STRIKETHROUGH, TEXT_FORMAT_TRANSFORMERS, TEXT_MATCH_TRANSFORMERS, TRANSFORMERS, UNORDERED_LIST, registerMarkdownShortcuts };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalMarkdown.dev.mjs';\nimport * as modProd from './LexicalMarkdown.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const $convertFromMarkdownString = mod.$convertFromMarkdownString;\nexport const $convertToMarkdownString = mod.$convertToMarkdownString;\nexport const BOLD_ITALIC_STAR = mod.BOLD_ITALIC_STAR;\nexport const BOLD_ITALIC_UNDERSCORE = mod.BOLD_ITALIC_UNDERSCORE;\nexport const BOLD_STAR = mod.BOLD_STAR;\nexport const BOLD_UNDERSCORE = mod.BOLD_UNDERSCORE;\nexport const CHECK_LIST = mod.CHECK_LIST;\nexport const CODE = mod.CODE;\nexport const ELEMENT_TRANSFORMERS = mod.ELEMENT_TRANSFORMERS;\nexport const HEADING = mod.HEADING;\nexport const HIGHLIGHT = mod.HIGHLIGHT;\nexport const INLINE_CODE = mod.INLINE_CODE;\nexport const ITALIC_STAR = mod.ITALIC_STAR;\nexport const ITALIC_UNDERSCORE = mod.ITALIC_UNDERSCORE;\nexport const LINK = mod.LINK;\nexport const MULTILINE_ELEMENT_TRANSFORMERS = mod.MULTILINE_ELEMENT_TRANSFORMERS;\nexport const ORDERED_LIST = mod.ORDERED_LIST;\nexport const QUOTE = mod.QUOTE;\nexport const STRIKETHROUGH = mod.STRIKETHROUGH;\nexport const TEXT_FORMAT_TRANSFORMERS = mod.TEXT_FORMAT_TRANSFORMERS;\nexport const TEXT_MATCH_TRANSFORMERS = mod.TEXT_MATCH_TRANSFORMERS;\nexport const TRANSFORMERS = mod.TRANSFORMERS;\nexport const UNORDERED_LIST = mod.UNORDERED_LIST;\nexport const registerMarkdownShortcuts = mod.registerMarkdownShortcuts;", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { addClassNamesToElement, $descendantsMatching, $findMatchingParent, removeClassNamesFromElement, objectKlassEquals, isHTMLElement as isHTMLElement$1, $insertFirst as $insertFirst$1, mergeRegister, $insertNodeToNearestRoot, $dfs, $unwrapAndFilterDescendants } from '@lexical/utils';\nimport { ElementNode, isHTMLElement, $isInlineElementOrDecoratorNode, $isTextNode, $isLineBreakNode, $createParagraphNode, $applyNodeReplacement, createCommand, $createTextNode, $getSelection, $isRangeSelection, $isParagraphNode, $createPoint, $getNodeByKey, $isElementNode, $normalizeSelection__EXPERIMENTAL, isCurrentlyReadOnlyMode, TEXT_TYPE_TO_FORMAT, $getEditor, $setSelection, SELECTION_CHANGE_COMMAND, getDOMSelection, $createRangeSelection, $isRootNode, INSERT_PARAGRAPH_COMMAND, KEY_ARROW_DOWN_COMMAND, KEY_ARROW_UP_COMMAND, KEY_ARROW_LEFT_COMMAND, KEY_ARROW_RIGHT_COMMAND, COMMAND_PRIORITY_HIGH, KEY_ESCAPE_COMMAND, DELETE_WORD_COMMAND, DELETE_LINE_COMMAND, DELETE_CHARACTER_COMMAND, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND, CUT_COMMAND, FORMAT_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, CONTROLLED_TEXT_INSERTION_COMMAND, KEY_TAB_COMMAND, FOCUS_COMMAND, $getNearestNodeFromDOMNode, isDOMNode, $isRootOrShadowRoot, $getPreviousSelection, $getNodeByKeyOrThrow, $caretFromPoint, $isExtendableTextPointCaret, $extendCaretToRange, $isSiblingCaret, $getSiblingCaret, $setPointFromCaret, $normalizeCaret, $createRangeSelectionFromDom, $isChildCaret, $getChildCaret, $getAdjacentChildCaret, setDOMStyleFromCSS, setDOMUnmanaged, COMMAND_PRIORITY_EDITOR, SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, SELECT_ALL_COMMAND, COMMAND_PRIORITY_LOW, CLICK_COMMAND, $getRoot, defineExtension, safeCast } from 'lexical';\nimport { signal, effect, namedSignals } from '@lexical/extension';\nimport { copyToClipboard, $getClipboardDataFromSelection } from '@lexical/clipboard';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst PIXEL_VALUE_REG_EXP = /^(\\d+(?:\\.\\d+)?)px$/;\n\n// .PlaygroundEditorTheme__tableCell width value from\n// packages/lexical-playground/src/themes/PlaygroundEditorTheme.css\nconst COLUMN_WIDTH = 75;\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst TableCellHeaderStates = {\n  BOTH: 3,\n  COLUMN: 2,\n  NO_STATUS: 0,\n  ROW: 1\n};\n/** @noInheritDoc */\nclass TableCellNode extends ElementNode {\n  /** @internal */\n  __colSpan;\n  /** @internal */\n  __rowSpan;\n  /** @internal */\n  __headerState;\n  /** @internal */\n  __width;\n  /** @internal */\n  __backgroundColor;\n  /** @internal */\n  __verticalAlign;\n  static getType() {\n    return 'tablecell';\n  }\n  static clone(node) {\n    return new TableCellNode(node.__headerState, node.__colSpan, node.__width, node.__key);\n  }\n  afterCloneFrom(node) {\n    super.afterCloneFrom(node);\n    this.__rowSpan = node.__rowSpan;\n    this.__backgroundColor = node.__backgroundColor;\n    this.__verticalAlign = node.__verticalAlign;\n    this.__colSpan = node.__colSpan;\n    this.__headerState = node.__headerState;\n    this.__width = node.__width;\n  }\n  static importDOM() {\n    return {\n      td: node => ({\n        conversion: $convertTableCellNodeElement,\n        priority: 0\n      }),\n      th: node => ({\n        conversion: $convertTableCellNodeElement,\n        priority: 0\n      })\n    };\n  }\n  static importJSON(serializedNode) {\n    return $createTableCellNode().updateFromJSON(serializedNode);\n  }\n  updateFromJSON(serializedNode) {\n    return super.updateFromJSON(serializedNode).setHeaderStyles(serializedNode.headerState).setColSpan(serializedNode.colSpan || 1).setRowSpan(serializedNode.rowSpan || 1).setWidth(serializedNode.width || undefined).setBackgroundColor(serializedNode.backgroundColor || null).setVerticalAlign(serializedNode.verticalAlign || undefined);\n  }\n  constructor(headerState = TableCellHeaderStates.NO_STATUS, colSpan = 1, width, key) {\n    super(key);\n    this.__colSpan = colSpan;\n    this.__rowSpan = 1;\n    this.__headerState = headerState;\n    this.__width = width;\n    this.__backgroundColor = null;\n    this.__verticalAlign = undefined;\n  }\n  createDOM(config) {\n    const element = document.createElement(this.getTag());\n    if (this.__width) {\n      element.style.width = `${this.__width}px`;\n    }\n    if (this.__colSpan > 1) {\n      element.colSpan = this.__colSpan;\n    }\n    if (this.__rowSpan > 1) {\n      element.rowSpan = this.__rowSpan;\n    }\n    if (this.__backgroundColor !== null) {\n      element.style.backgroundColor = this.__backgroundColor;\n    }\n    if (isValidVerticalAlign(this.__verticalAlign)) {\n      element.style.verticalAlign = this.__verticalAlign;\n    }\n    addClassNamesToElement(element, config.theme.tableCell, this.hasHeader() && config.theme.tableCellHeader);\n    return element;\n  }\n  exportDOM(editor) {\n    const output = super.exportDOM(editor);\n    if (isHTMLElement(output.element)) {\n      const element = output.element;\n      element.setAttribute('data-temporary-table-cell-lexical-key', this.getKey());\n      element.style.border = '1px solid black';\n      if (this.__colSpan > 1) {\n        element.colSpan = this.__colSpan;\n      }\n      if (this.__rowSpan > 1) {\n        element.rowSpan = this.__rowSpan;\n      }\n      element.style.width = `${this.getWidth() || COLUMN_WIDTH}px`;\n      element.style.verticalAlign = this.getVerticalAlign() || 'top';\n      element.style.textAlign = 'start';\n      if (this.__backgroundColor === null && this.hasHeader()) {\n        element.style.backgroundColor = '#f2f3f5';\n      }\n    }\n    return output;\n  }\n  exportJSON() {\n    return {\n      ...super.exportJSON(),\n      ...(isValidVerticalAlign(this.__verticalAlign) && {\n        verticalAlign: this.__verticalAlign\n      }),\n      backgroundColor: this.getBackgroundColor(),\n      colSpan: this.__colSpan,\n      headerState: this.__headerState,\n      rowSpan: this.__rowSpan,\n      width: this.getWidth()\n    };\n  }\n  getColSpan() {\n    return this.getLatest().__colSpan;\n  }\n  setColSpan(colSpan) {\n    const self = this.getWritable();\n    self.__colSpan = colSpan;\n    return self;\n  }\n  getRowSpan() {\n    return this.getLatest().__rowSpan;\n  }\n  setRowSpan(rowSpan) {\n    const self = this.getWritable();\n    self.__rowSpan = rowSpan;\n    return self;\n  }\n  getTag() {\n    return this.hasHeader() ? 'th' : 'td';\n  }\n  setHeaderStyles(headerState, mask = TableCellHeaderStates.BOTH) {\n    const self = this.getWritable();\n    self.__headerState = headerState & mask | self.__headerState & ~mask;\n    return self;\n  }\n  getHeaderStyles() {\n    return this.getLatest().__headerState;\n  }\n  setWidth(width) {\n    const self = this.getWritable();\n    self.__width = width;\n    return self;\n  }\n  getWidth() {\n    return this.getLatest().__width;\n  }\n  getBackgroundColor() {\n    return this.getLatest().__backgroundColor;\n  }\n  setBackgroundColor(newBackgroundColor) {\n    const self = this.getWritable();\n    self.__backgroundColor = newBackgroundColor;\n    return self;\n  }\n  getVerticalAlign() {\n    return this.getLatest().__verticalAlign;\n  }\n  setVerticalAlign(newVerticalAlign) {\n    const self = this.getWritable();\n    self.__verticalAlign = newVerticalAlign || undefined;\n    return self;\n  }\n  toggleHeaderStyle(headerStateToToggle) {\n    const self = this.getWritable();\n    if ((self.__headerState & headerStateToToggle) === headerStateToToggle) {\n      self.__headerState -= headerStateToToggle;\n    } else {\n      self.__headerState += headerStateToToggle;\n    }\n    return self;\n  }\n  hasHeaderState(headerState) {\n    return (this.getHeaderStyles() & headerState) === headerState;\n  }\n  hasHeader() {\n    return this.getLatest().__headerState !== TableCellHeaderStates.NO_STATUS;\n  }\n  updateDOM(prevNode) {\n    return prevNode.__headerState !== this.__headerState || prevNode.__width !== this.__width || prevNode.__colSpan !== this.__colSpan || prevNode.__rowSpan !== this.__rowSpan || prevNode.__backgroundColor !== this.__backgroundColor || prevNode.__verticalAlign !== this.__verticalAlign;\n  }\n  isShadowRoot() {\n    return true;\n  }\n  collapseAtStart() {\n    return true;\n  }\n  canBeEmpty() {\n    return false;\n  }\n  canIndent() {\n    return false;\n  }\n}\nfunction isValidVerticalAlign(verticalAlign) {\n  return verticalAlign === 'middle' || verticalAlign === 'bottom';\n}\nfunction $convertTableCellNodeElement(domNode) {\n  const domNode_ = domNode;\n  const nodeName = domNode.nodeName.toLowerCase();\n  let width = undefined;\n  if (PIXEL_VALUE_REG_EXP.test(domNode_.style.width)) {\n    width = parseFloat(domNode_.style.width);\n  }\n\n  // Determine header state based on the 'scope' attribute\n  let headerState = TableCellHeaderStates.NO_STATUS;\n  if (nodeName === 'th') {\n    const scope = domNode_.getAttribute('scope');\n    if (scope === 'col') {\n      headerState = TableCellHeaderStates.COLUMN;\n    } else if (scope === 'row') {\n      headerState = TableCellHeaderStates.ROW;\n    } else {\n      const parentRow = domNode_.parentElement;\n      const isInHeaderRow = isHTMLElement(parentRow) && parentRow.nodeName.toLowerCase() === 'tr' && isHTMLElement(parentRow.parentElement) && (parentRow.parentElement.nodeName.toLowerCase() === 'thead' || parentRow.rowIndex === 0);\n      const isFirstColumn = domNode_.cellIndex === 0;\n      if (isInHeaderRow) {\n        headerState |= TableCellHeaderStates.ROW;\n      }\n      if (isFirstColumn) {\n        headerState |= TableCellHeaderStates.COLUMN;\n      }\n      if (headerState === TableCellHeaderStates.NO_STATUS) {\n        headerState = TableCellHeaderStates.ROW;\n      }\n    }\n  }\n  const tableCellNode = $createTableCellNode(headerState, domNode_.colSpan, width);\n  tableCellNode.__rowSpan = domNode_.rowSpan;\n  const backgroundColor = domNode_.style.backgroundColor;\n  if (backgroundColor !== '') {\n    tableCellNode.__backgroundColor = backgroundColor;\n  }\n  const verticalAlign = domNode_.style.verticalAlign;\n  if (isValidVerticalAlign(verticalAlign)) {\n    tableCellNode.__verticalAlign = verticalAlign;\n  }\n  const style = domNode_.style;\n  const textDecoration = (style && style.textDecoration || '').split(' ');\n  const hasBoldFontWeight = style.fontWeight === '700' || style.fontWeight === 'bold';\n  const hasLinethroughTextDecoration = textDecoration.includes('line-through');\n  const hasItalicFontStyle = style.fontStyle === 'italic';\n  const hasUnderlineTextDecoration = textDecoration.includes('underline');\n  const color = style.color;\n  return {\n    after: childLexicalNodes => {\n      const result = [];\n      let paragraphNode = null;\n      const removeSingleLineBreakNode = () => {\n        if (paragraphNode) {\n          const firstChild = paragraphNode.getFirstChild();\n          if ($isLineBreakNode(firstChild) && paragraphNode.getChildrenSize() === 1) {\n            firstChild.remove();\n          }\n        }\n      };\n      for (const child of childLexicalNodes) {\n        if ($isInlineElementOrDecoratorNode(child) || $isTextNode(child) || $isLineBreakNode(child)) {\n          if ($isTextNode(child)) {\n            if (hasBoldFontWeight) {\n              child.toggleFormat('bold');\n            }\n            if (hasLinethroughTextDecoration) {\n              child.toggleFormat('strikethrough');\n            }\n            if (hasItalicFontStyle) {\n              child.toggleFormat('italic');\n            }\n            if (hasUnderlineTextDecoration) {\n              child.toggleFormat('underline');\n            }\n            if (color) {\n              const existingStyle = child.getStyle();\n              if (!existingStyle.includes('color:')) {\n                child.setStyle(existingStyle + `color: ${color};`);\n              }\n            }\n          }\n          if (paragraphNode) {\n            paragraphNode.append(child);\n          } else {\n            paragraphNode = $createParagraphNode().append(child);\n            result.push(paragraphNode);\n          }\n        } else {\n          result.push(child);\n          removeSingleLineBreakNode();\n          paragraphNode = null;\n        }\n      }\n      removeSingleLineBreakNode();\n      if (result.length === 0) {\n        result.push($createParagraphNode());\n      }\n      return result;\n    },\n    node: tableCellNode\n  };\n}\nfunction $createTableCellNode(headerState = TableCellHeaderStates.NO_STATUS, colSpan = 1, width) {\n  return $applyNodeReplacement(new TableCellNode(headerState, colSpan, width));\n}\nfunction $isTableCellNode(node) {\n  return node instanceof TableCellNode;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst INSERT_TABLE_COMMAND = createCommand('INSERT_TABLE_COMMAND');\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n// Do not require this module directly! Use normal `invariant` calls.\n\nfunction formatDevErrorMessage(message) {\n  throw new Error(message);\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/** @noInheritDoc */\nclass TableRowNode extends ElementNode {\n  /** @internal */\n  __height;\n  static getType() {\n    return 'tablerow';\n  }\n  static clone(node) {\n    return new TableRowNode(node.__height, node.__key);\n  }\n  afterCloneFrom(prevNode) {\n    super.afterCloneFrom(prevNode);\n    this.__height = prevNode.__height;\n  }\n  static importDOM() {\n    return {\n      tr: node => ({\n        conversion: $convertTableRowElement,\n        priority: 0\n      })\n    };\n  }\n  static importJSON(serializedNode) {\n    return $createTableRowNode().updateFromJSON(serializedNode);\n  }\n  updateFromJSON(serializedNode) {\n    return super.updateFromJSON(serializedNode).setHeight(serializedNode.height);\n  }\n  constructor(height, key) {\n    super(key);\n    this.__height = height;\n  }\n  exportJSON() {\n    const height = this.getHeight();\n    return {\n      ...super.exportJSON(),\n      ...(height === undefined ? undefined : {\n        height\n      })\n    };\n  }\n  createDOM(config) {\n    const element = document.createElement('tr');\n    if (this.__height) {\n      element.style.height = `${this.__height}px`;\n    }\n    addClassNamesToElement(element, config.theme.tableRow);\n    return element;\n  }\n  extractWithChild(child, selection, destination) {\n    return destination === 'html';\n  }\n  isShadowRoot() {\n    return true;\n  }\n  setHeight(height) {\n    const self = this.getWritable();\n    self.__height = height;\n    return self;\n  }\n  getHeight() {\n    return this.getLatest().__height;\n  }\n  updateDOM(prevNode) {\n    return prevNode.__height !== this.__height;\n  }\n  canBeEmpty() {\n    return false;\n  }\n  canIndent() {\n    return false;\n  }\n}\nfunction $convertTableRowElement(domNode) {\n  const domNode_ = domNode;\n  let height = undefined;\n  if (PIXEL_VALUE_REG_EXP.test(domNode_.style.height)) {\n    height = parseFloat(domNode_.style.height);\n  }\n  return {\n    after: children => $descendantsMatching(children, $isTableCellNode),\n    node: $createTableRowNode(height)\n  };\n}\nfunction $createTableRowNode(height) {\n  return $applyNodeReplacement(new TableRowNode(height));\n}\nfunction $isTableRowNode(node) {\n  return node instanceof TableRowNode;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined';\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nconst documentMode = CAN_USE_DOM && 'documentMode' in document ? document.documentMode : null;\nconst IS_FIREFOX = CAN_USE_DOM && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);\nCAN_USE_DOM && 'InputEvent' in window && !documentMode ? 'getTargetRanges' in new window.InputEvent('input') : false;\n\nfunction $createTableNodeWithDimensions(rowCount, columnCount, includeHeaders = true) {\n  const tableNode = $createTableNode();\n  for (let iRow = 0; iRow < rowCount; iRow++) {\n    const tableRowNode = $createTableRowNode();\n    for (let iColumn = 0; iColumn < columnCount; iColumn++) {\n      let headerState = TableCellHeaderStates.NO_STATUS;\n      if (typeof includeHeaders === 'object') {\n        if (iRow === 0 && includeHeaders.rows) {\n          headerState |= TableCellHeaderStates.ROW;\n        }\n        if (iColumn === 0 && includeHeaders.columns) {\n          headerState |= TableCellHeaderStates.COLUMN;\n        }\n      } else if (includeHeaders) {\n        if (iRow === 0) {\n          headerState |= TableCellHeaderStates.ROW;\n        }\n        if (iColumn === 0) {\n          headerState |= TableCellHeaderStates.COLUMN;\n        }\n      }\n      const tableCellNode = $createTableCellNode(headerState);\n      const paragraphNode = $createParagraphNode();\n      paragraphNode.append($createTextNode());\n      tableCellNode.append(paragraphNode);\n      tableRowNode.append(tableCellNode);\n    }\n    tableNode.append(tableRowNode);\n  }\n  return tableNode;\n}\nfunction $getTableCellNodeFromLexicalNode(startingNode) {\n  const node = $findMatchingParent(startingNode, n => $isTableCellNode(n));\n  if ($isTableCellNode(node)) {\n    return node;\n  }\n  return null;\n}\nfunction $getTableRowNodeFromTableCellNodeOrThrow(startingNode) {\n  const node = $findMatchingParent(startingNode, n => $isTableRowNode(n));\n  if ($isTableRowNode(node)) {\n    return node;\n  }\n  throw new Error('Expected table cell to be inside of table row.');\n}\nfunction $getTableNodeFromLexicalNodeOrThrow(startingNode) {\n  const node = $findMatchingParent(startingNode, n => $isTableNode(n));\n  if ($isTableNode(node)) {\n    return node;\n  }\n  throw new Error('Expected table cell to be inside of table.');\n}\nfunction $getTableRowIndexFromTableCellNode(tableCellNode) {\n  const tableRowNode = $getTableRowNodeFromTableCellNodeOrThrow(tableCellNode);\n  const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableRowNode);\n  return tableNode.getChildren().findIndex(n => n.is(tableRowNode));\n}\nfunction $getTableColumnIndexFromTableCellNode(tableCellNode) {\n  const tableRowNode = $getTableRowNodeFromTableCellNodeOrThrow(tableCellNode);\n  return tableRowNode.getChildren().findIndex(n => n.is(tableCellNode));\n}\nfunction $getTableCellSiblingsFromTableCellNode(tableCellNode, table) {\n  const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);\n  const {\n    x,\n    y\n  } = tableNode.getCordsFromCellNode(tableCellNode, table);\n  return {\n    above: tableNode.getCellNodeFromCords(x, y - 1, table),\n    below: tableNode.getCellNodeFromCords(x, y + 1, table),\n    left: tableNode.getCellNodeFromCords(x - 1, y, table),\n    right: tableNode.getCellNodeFromCords(x + 1, y, table)\n  };\n}\nfunction $removeTableRowAtIndex(tableNode, indexToDelete) {\n  const tableRows = tableNode.getChildren();\n  if (indexToDelete >= tableRows.length || indexToDelete < 0) {\n    throw new Error('Expected table cell to be inside of table row.');\n  }\n  const targetRowNode = tableRows[indexToDelete];\n  targetRowNode.remove();\n  return tableNode;\n}\n\n/**\n * @deprecated This function does not support merged cells. Use {@link $insertTableRowAtSelection} or {@link $insertTableRowAtNode} instead.\n */\nfunction $insertTableRow(tableNode, targetIndex, shouldInsertAfter = true, rowCount, table) {\n  const tableRows = tableNode.getChildren();\n  if (targetIndex >= tableRows.length || targetIndex < 0) {\n    throw new Error('Table row target index out of range');\n  }\n  const targetRowNode = tableRows[targetIndex];\n  if ($isTableRowNode(targetRowNode)) {\n    for (let r = 0; r < rowCount; r++) {\n      const tableRowCells = targetRowNode.getChildren();\n      const tableColumnCount = tableRowCells.length;\n      const newTableRowNode = $createTableRowNode();\n      for (let c = 0; c < tableColumnCount; c++) {\n        const tableCellFromTargetRow = tableRowCells[c];\n        if (!$isTableCellNode(tableCellFromTargetRow)) {\n          formatDevErrorMessage(`Expected table cell`);\n        }\n        const {\n          above,\n          below\n        } = $getTableCellSiblingsFromTableCellNode(tableCellFromTargetRow, table);\n        let headerState = TableCellHeaderStates.NO_STATUS;\n        const width = above && above.getWidth() || below && below.getWidth() || undefined;\n        if (above && above.hasHeaderState(TableCellHeaderStates.COLUMN) || below && below.hasHeaderState(TableCellHeaderStates.COLUMN)) {\n          headerState |= TableCellHeaderStates.COLUMN;\n        }\n        const tableCellNode = $createTableCellNode(headerState, 1, width);\n        tableCellNode.append($createParagraphNode());\n        newTableRowNode.append(tableCellNode);\n      }\n      if (shouldInsertAfter) {\n        targetRowNode.insertAfter(newTableRowNode);\n      } else {\n        targetRowNode.insertBefore(newTableRowNode);\n      }\n    }\n  } else {\n    throw new Error('Row before insertion index does not exist.');\n  }\n  return tableNode;\n}\nconst getHeaderState = (currentState, possibleState) => {\n  if (currentState === TableCellHeaderStates.BOTH || currentState === possibleState) {\n    return possibleState;\n  }\n  return TableCellHeaderStates.NO_STATUS;\n};\n\n/**\n * Inserts a table row before or after the current focus cell node,\n * taking into account any spans. If successful, returns the\n * inserted table row node.\n */\nfunction $insertTableRowAtSelection(insertAfter = true) {\n  const selection = $getSelection();\n  if (!($isRangeSelection(selection) || $isTableSelection(selection))) {\n    formatDevErrorMessage(`Expected a RangeSelection or TableSelection`);\n  }\n  const anchor = selection.anchor.getNode();\n  const focus = selection.focus.getNode();\n  const [anchorCell] = $getNodeTriplet(anchor);\n  const [focusCell,, grid] = $getNodeTriplet(focus);\n  const [, focusCellMap, anchorCellMap] = $computeTableMap(grid, focusCell, anchorCell);\n  const {\n    startRow: anchorStartRow\n  } = anchorCellMap;\n  const {\n    startRow: focusStartRow\n  } = focusCellMap;\n  if (insertAfter) {\n    return $insertTableRowAtNode(anchorStartRow + anchorCell.__rowSpan > focusStartRow + focusCell.__rowSpan ? anchorCell : focusCell, true);\n  } else {\n    return $insertTableRowAtNode(focusStartRow < anchorStartRow ? focusCell : anchorCell, false);\n  }\n}\n\n/**\n * @deprecated renamed to {@link $insertTableRowAtSelection}\n */\nconst $insertTableRow__EXPERIMENTAL = $insertTableRowAtSelection;\n\n/**\n * Inserts a table row before or after the given cell node,\n * taking into account any spans. If successful, returns the\n * inserted table row node.\n */\nfunction $insertTableRowAtNode(cellNode, insertAfter = true) {\n  const [,, grid] = $getNodeTriplet(cellNode);\n  const [gridMap, cellMap] = $computeTableMap(grid, cellNode, cellNode);\n  const columnCount = gridMap[0].length;\n  const {\n    startRow: cellStartRow\n  } = cellMap;\n  let insertedRow = null;\n  if (insertAfter) {\n    const insertAfterEndRow = cellStartRow + cellNode.__rowSpan - 1;\n    const insertAfterEndRowMap = gridMap[insertAfterEndRow];\n    const newRow = $createTableRowNode();\n    for (let i = 0; i < columnCount; i++) {\n      const {\n        cell,\n        startRow\n      } = insertAfterEndRowMap[i];\n      if (startRow + cell.__rowSpan - 1 <= insertAfterEndRow) {\n        const currentCell = insertAfterEndRowMap[i].cell;\n        const currentCellHeaderState = currentCell.__headerState;\n        const headerState = getHeaderState(currentCellHeaderState, TableCellHeaderStates.COLUMN);\n        newRow.append($createTableCellNode(headerState).append($createParagraphNode()));\n      } else {\n        cell.setRowSpan(cell.__rowSpan + 1);\n      }\n    }\n    const insertAfterEndRowNode = grid.getChildAtIndex(insertAfterEndRow);\n    if (!$isTableRowNode(insertAfterEndRowNode)) {\n      formatDevErrorMessage(`insertAfterEndRow is not a TableRowNode`);\n    }\n    insertAfterEndRowNode.insertAfter(newRow);\n    insertedRow = newRow;\n  } else {\n    const insertBeforeStartRow = cellStartRow;\n    const insertBeforeStartRowMap = gridMap[insertBeforeStartRow];\n    const newRow = $createTableRowNode();\n    for (let i = 0; i < columnCount; i++) {\n      const {\n        cell,\n        startRow\n      } = insertBeforeStartRowMap[i];\n      if (startRow === insertBeforeStartRow) {\n        const currentCell = insertBeforeStartRowMap[i].cell;\n        const currentCellHeaderState = currentCell.__headerState;\n        const headerState = getHeaderState(currentCellHeaderState, TableCellHeaderStates.COLUMN);\n        newRow.append($createTableCellNode(headerState).append($createParagraphNode()));\n      } else {\n        cell.setRowSpan(cell.__rowSpan + 1);\n      }\n    }\n    const insertBeforeStartRowNode = grid.getChildAtIndex(insertBeforeStartRow);\n    if (!$isTableRowNode(insertBeforeStartRowNode)) {\n      formatDevErrorMessage(`insertBeforeStartRow is not a TableRowNode`);\n    }\n    insertBeforeStartRowNode.insertBefore(newRow);\n    insertedRow = newRow;\n  }\n  return insertedRow;\n}\n\n/**\n * @deprecated This function does not support merged cells. Use {@link $insertTableColumnAtSelection} or {@link $insertTableColumnAtNode} instead.\n */\nfunction $insertTableColumn(tableNode, targetIndex, shouldInsertAfter = true, columnCount, table) {\n  const tableRows = tableNode.getChildren();\n  const tableCellsToBeInserted = [];\n  for (let r = 0; r < tableRows.length; r++) {\n    const currentTableRowNode = tableRows[r];\n    if ($isTableRowNode(currentTableRowNode)) {\n      for (let c = 0; c < columnCount; c++) {\n        const tableRowChildren = currentTableRowNode.getChildren();\n        if (targetIndex >= tableRowChildren.length || targetIndex < 0) {\n          throw new Error('Table column target index out of range');\n        }\n        const targetCell = tableRowChildren[targetIndex];\n        if (!$isTableCellNode(targetCell)) {\n          formatDevErrorMessage(`Expected table cell`);\n        }\n        const {\n          left,\n          right\n        } = $getTableCellSiblingsFromTableCellNode(targetCell, table);\n        let headerState = TableCellHeaderStates.NO_STATUS;\n        if (left && left.hasHeaderState(TableCellHeaderStates.ROW) || right && right.hasHeaderState(TableCellHeaderStates.ROW)) {\n          headerState |= TableCellHeaderStates.ROW;\n        }\n        const newTableCell = $createTableCellNode(headerState);\n        newTableCell.append($createParagraphNode());\n        tableCellsToBeInserted.push({\n          newTableCell,\n          targetCell\n        });\n      }\n    }\n  }\n  tableCellsToBeInserted.forEach(({\n    newTableCell,\n    targetCell\n  }) => {\n    if (shouldInsertAfter) {\n      targetCell.insertAfter(newTableCell);\n    } else {\n      targetCell.insertBefore(newTableCell);\n    }\n  });\n  return tableNode;\n}\n\n/**\n * Inserts a column before or after the current focus cell node,\n * taking into account any spans. If successful, returns the\n * first inserted cell node.\n */\nfunction $insertTableColumnAtSelection(insertAfter = true) {\n  const selection = $getSelection();\n  if (!($isRangeSelection(selection) || $isTableSelection(selection))) {\n    formatDevErrorMessage(`Expected a RangeSelection or TableSelection`);\n  }\n  const anchor = selection.anchor.getNode();\n  const focus = selection.focus.getNode();\n  const [anchorCell] = $getNodeTriplet(anchor);\n  const [focusCell,, grid] = $getNodeTriplet(focus);\n  const [, focusCellMap, anchorCellMap] = $computeTableMap(grid, focusCell, anchorCell);\n  const {\n    startColumn: anchorStartColumn\n  } = anchorCellMap;\n  const {\n    startColumn: focusStartColumn\n  } = focusCellMap;\n  if (insertAfter) {\n    return $insertTableColumnAtNode(anchorStartColumn + anchorCell.__colSpan > focusStartColumn + focusCell.__colSpan ? anchorCell : focusCell, true);\n  } else {\n    return $insertTableColumnAtNode(focusStartColumn < anchorStartColumn ? focusCell : anchorCell, false);\n  }\n}\n\n/**\n * @deprecated renamed to {@link $insertTableColumnAtSelection}\n */\nconst $insertTableColumn__EXPERIMENTAL = $insertTableColumnAtSelection;\n\n/**\n * Inserts a column before or after the given cell node,\n * taking into account any spans. If successful, returns the\n * first inserted cell node.\n */\nfunction $insertTableColumnAtNode(cellNode, insertAfter = true, shouldSetSelection = true) {\n  const [,, grid] = $getNodeTriplet(cellNode);\n  const [gridMap, cellMap] = $computeTableMap(grid, cellNode, cellNode);\n  const rowCount = gridMap.length;\n  const {\n    startColumn\n  } = cellMap;\n  const insertAfterColumn = insertAfter ? startColumn + cellNode.__colSpan - 1 : startColumn - 1;\n  const gridFirstChild = grid.getFirstChild();\n  if (!$isTableRowNode(gridFirstChild)) {\n    formatDevErrorMessage(`Expected firstTable child to be a row`);\n  }\n  let firstInsertedCell = null;\n  function $createTableCellNodeForInsertTableColumn(headerState = TableCellHeaderStates.NO_STATUS) {\n    const cell = $createTableCellNode(headerState).append($createParagraphNode());\n    if (firstInsertedCell === null) {\n      firstInsertedCell = cell;\n    }\n    return cell;\n  }\n  let loopRow = gridFirstChild;\n  rowLoop: for (let i = 0; i < rowCount; i++) {\n    if (i !== 0) {\n      const currentRow = loopRow.getNextSibling();\n      if (!$isTableRowNode(currentRow)) {\n        formatDevErrorMessage(`Expected row nextSibling to be a row`);\n      }\n      loopRow = currentRow;\n    }\n    const rowMap = gridMap[i];\n    const currentCellHeaderState = rowMap[insertAfterColumn < 0 ? 0 : insertAfterColumn].cell.__headerState;\n    const headerState = getHeaderState(currentCellHeaderState, TableCellHeaderStates.ROW);\n    if (insertAfterColumn < 0) {\n      $insertFirst(loopRow, $createTableCellNodeForInsertTableColumn(headerState));\n      continue;\n    }\n    const {\n      cell: currentCell,\n      startColumn: currentStartColumn,\n      startRow: currentStartRow\n    } = rowMap[insertAfterColumn];\n    if (currentStartColumn + currentCell.__colSpan - 1 <= insertAfterColumn) {\n      let insertAfterCell = currentCell;\n      let insertAfterCellRowStart = currentStartRow;\n      let prevCellIndex = insertAfterColumn;\n      while (insertAfterCellRowStart !== i && insertAfterCell.__rowSpan > 1) {\n        prevCellIndex -= currentCell.__colSpan;\n        if (prevCellIndex >= 0) {\n          const {\n            cell: cell_,\n            startRow: startRow_\n          } = rowMap[prevCellIndex];\n          insertAfterCell = cell_;\n          insertAfterCellRowStart = startRow_;\n        } else {\n          loopRow.append($createTableCellNodeForInsertTableColumn(headerState));\n          continue rowLoop;\n        }\n      }\n      insertAfterCell.insertAfter($createTableCellNodeForInsertTableColumn(headerState));\n    } else {\n      currentCell.setColSpan(currentCell.__colSpan + 1);\n    }\n  }\n  if (firstInsertedCell !== null && shouldSetSelection) {\n    $moveSelectionToCell(firstInsertedCell);\n  }\n  const colWidths = grid.getColWidths();\n  if (colWidths) {\n    const newColWidths = [...colWidths];\n    const columnIndex = insertAfterColumn < 0 ? 0 : insertAfterColumn;\n    const newWidth = newColWidths[columnIndex];\n    newColWidths.splice(columnIndex, 0, newWidth);\n    grid.setColWidths(newColWidths);\n  }\n  return firstInsertedCell;\n}\n\n/**\n * @deprecated This function does not support merged cells. Use {@link $deleteTableColumnAtSelection} instead.\n */\nfunction $deleteTableColumn(tableNode, targetIndex) {\n  const tableRows = tableNode.getChildren();\n  for (let i = 0; i < tableRows.length; i++) {\n    const currentTableRowNode = tableRows[i];\n    if ($isTableRowNode(currentTableRowNode)) {\n      const tableRowChildren = currentTableRowNode.getChildren();\n      if (targetIndex >= tableRowChildren.length || targetIndex < 0) {\n        throw new Error('Table column target index out of range');\n      }\n      tableRowChildren[targetIndex].remove();\n    }\n  }\n  return tableNode;\n}\nfunction $deleteTableRowAtSelection() {\n  const selection = $getSelection();\n  if (!($isRangeSelection(selection) || $isTableSelection(selection))) {\n    formatDevErrorMessage(`Expected a RangeSelection or TableSelection`);\n  }\n  const [anchor, focus] = selection.isBackward() ? [selection.focus.getNode(), selection.anchor.getNode()] : [selection.anchor.getNode(), selection.focus.getNode()];\n  const [anchorCell,, grid] = $getNodeTriplet(anchor);\n  const [focusCell] = $getNodeTriplet(focus);\n  const [gridMap, anchorCellMap, focusCellMap] = $computeTableMap(grid, anchorCell, focusCell);\n  const {\n    startRow: anchorStartRow\n  } = anchorCellMap;\n  const {\n    startRow: focusStartRow\n  } = focusCellMap;\n  const focusEndRow = focusStartRow + focusCell.__rowSpan - 1;\n  if (gridMap.length === focusEndRow - anchorStartRow + 1) {\n    // Empty grid\n    grid.remove();\n    return;\n  }\n  const columnCount = gridMap[0].length;\n  const nextRow = gridMap[focusEndRow + 1];\n  const nextRowNode = grid.getChildAtIndex(focusEndRow + 1);\n  for (let row = focusEndRow; row >= anchorStartRow; row--) {\n    for (let column = columnCount - 1; column >= 0; column--) {\n      const {\n        cell,\n        startRow: cellStartRow,\n        startColumn: cellStartColumn\n      } = gridMap[row][column];\n      if (cellStartColumn !== column) {\n        // Don't repeat work for the same Cell\n        continue;\n      }\n      // Rows overflowing top or bottom have to be trimmed\n      if (cellStartRow < anchorStartRow || cellStartRow + cell.__rowSpan - 1 > focusEndRow) {\n        const intersectionStart = Math.max(cellStartRow, anchorStartRow);\n        const intersectionEnd = Math.min(cell.__rowSpan + cellStartRow - 1, focusEndRow);\n        const overflowRowsCount = intersectionStart <= intersectionEnd ? intersectionEnd - intersectionStart + 1 : 0;\n        cell.setRowSpan(cell.__rowSpan - overflowRowsCount);\n      }\n      // Rows overflowing bottom have to be moved to the next row\n      if (cellStartRow >= anchorStartRow && cellStartRow + cell.__rowSpan - 1 > focusEndRow &&\n      // Handle overflow only once\n      row === focusEndRow) {\n        if (!(nextRowNode !== null)) {\n          formatDevErrorMessage(`Expected nextRowNode not to be null`);\n        }\n        let insertAfterCell = null;\n        for (let columnIndex = 0; columnIndex < column; columnIndex++) {\n          const currentCellMap = nextRow[columnIndex];\n          const currentCell = currentCellMap.cell;\n          // Checking the cell having startRow as same as nextRow\n          if (currentCellMap.startRow === row + 1) {\n            insertAfterCell = currentCell;\n          }\n          if (currentCell.__colSpan > 1) {\n            columnIndex += currentCell.__colSpan - 1;\n          }\n        }\n        if (insertAfterCell === null) {\n          $insertFirst(nextRowNode, cell);\n        } else {\n          insertAfterCell.insertAfter(cell);\n        }\n      }\n    }\n    const rowNode = grid.getChildAtIndex(row);\n    if (!$isTableRowNode(rowNode)) {\n      formatDevErrorMessage(`Expected TableNode childAtIndex(${String(row)}) to be RowNode`);\n    }\n    rowNode.remove();\n  }\n  if (nextRow !== undefined) {\n    const {\n      cell\n    } = nextRow[0];\n    $moveSelectionToCell(cell);\n  } else {\n    const previousRow = gridMap[anchorStartRow - 1];\n    const {\n      cell\n    } = previousRow[0];\n    $moveSelectionToCell(cell);\n  }\n}\n\n/**\n * @deprecated renamed to {@link $deleteTableRowAtSelection}\n */\nconst $deleteTableRow__EXPERIMENTAL = $deleteTableRowAtSelection;\nfunction $deleteTableColumnAtSelection() {\n  const selection = $getSelection();\n  if (!($isRangeSelection(selection) || $isTableSelection(selection))) {\n    formatDevErrorMessage(`Expected a RangeSelection or TableSelection`);\n  }\n  const anchor = selection.anchor.getNode();\n  const focus = selection.focus.getNode();\n  const [anchorCell,, grid] = $getNodeTriplet(anchor);\n  const [focusCell] = $getNodeTriplet(focus);\n  const [gridMap, anchorCellMap, focusCellMap] = $computeTableMap(grid, anchorCell, focusCell);\n  const {\n    startColumn: anchorStartColumn\n  } = anchorCellMap;\n  const {\n    startRow: focusStartRow,\n    startColumn: focusStartColumn\n  } = focusCellMap;\n  const startColumn = Math.min(anchorStartColumn, focusStartColumn);\n  const endColumn = Math.max(anchorStartColumn + anchorCell.__colSpan - 1, focusStartColumn + focusCell.__colSpan - 1);\n  const selectedColumnCount = endColumn - startColumn + 1;\n  const columnCount = gridMap[0].length;\n  if (columnCount === endColumn - startColumn + 1) {\n    // Empty grid\n    grid.selectPrevious();\n    grid.remove();\n    return;\n  }\n  const rowCount = gridMap.length;\n  for (let row = 0; row < rowCount; row++) {\n    for (let column = startColumn; column <= endColumn; column++) {\n      const {\n        cell,\n        startColumn: cellStartColumn\n      } = gridMap[row][column];\n      if (cellStartColumn < startColumn) {\n        if (column === startColumn) {\n          const overflowLeft = startColumn - cellStartColumn;\n          // Overflowing left\n          cell.setColSpan(cell.__colSpan -\n          // Possible overflow right too\n          Math.min(selectedColumnCount, cell.__colSpan - overflowLeft));\n        }\n      } else if (cellStartColumn + cell.__colSpan - 1 > endColumn) {\n        if (column === endColumn) {\n          // Overflowing right\n          const inSelectedArea = endColumn - cellStartColumn + 1;\n          cell.setColSpan(cell.__colSpan - inSelectedArea);\n        }\n      } else {\n        cell.remove();\n      }\n    }\n  }\n  const focusRowMap = gridMap[focusStartRow];\n  const nextColumn = anchorStartColumn > focusStartColumn ? focusRowMap[anchorStartColumn + anchorCell.__colSpan] : focusRowMap[focusStartColumn + focusCell.__colSpan];\n  if (nextColumn !== undefined) {\n    const {\n      cell\n    } = nextColumn;\n    $moveSelectionToCell(cell);\n  } else {\n    const previousRow = focusStartColumn < anchorStartColumn ? focusRowMap[focusStartColumn - 1] : focusRowMap[anchorStartColumn - 1];\n    const {\n      cell\n    } = previousRow;\n    $moveSelectionToCell(cell);\n  }\n  const colWidths = grid.getColWidths();\n  if (colWidths) {\n    const newColWidths = [...colWidths];\n    newColWidths.splice(startColumn, selectedColumnCount);\n    grid.setColWidths(newColWidths);\n  }\n}\n\n/**\n * @deprecated renamed to {@link $deleteTableColumnAtSelection}\n */\nconst $deleteTableColumn__EXPERIMENTAL = $deleteTableColumnAtSelection;\nfunction $moveSelectionToCell(cell) {\n  const firstDescendant = cell.getFirstDescendant();\n  if (firstDescendant == null) {\n    cell.selectStart();\n  } else {\n    firstDescendant.getParentOrThrow().selectStart();\n  }\n}\nfunction $insertFirst(parent, node) {\n  const firstChild = parent.getFirstChild();\n  if (firstChild !== null) {\n    firstChild.insertBefore(node);\n  } else {\n    parent.append(node);\n  }\n}\nfunction $mergeCells(cellNodes) {\n  if (cellNodes.length === 0) {\n    return null;\n  }\n\n  // Find the table node\n  const tableNode = $getTableNodeFromLexicalNodeOrThrow(cellNodes[0]);\n  const [gridMap] = $computeTableMapSkipCellCheck(tableNode, null, null);\n\n  // Find the boundaries of the selection including merged cells\n  let minRow = Infinity;\n  let maxRow = -Infinity;\n  let minCol = Infinity;\n  let maxCol = -Infinity;\n\n  // First pass: find the actual boundaries considering merged cells\n  const processedCells = new Set();\n  for (const row of gridMap) {\n    for (const mapCell of row) {\n      if (!mapCell || !mapCell.cell) {\n        continue;\n      }\n      const cellKey = mapCell.cell.getKey();\n      if (processedCells.has(cellKey)) {\n        continue;\n      }\n      if (cellNodes.some(cell => cell.is(mapCell.cell))) {\n        processedCells.add(cellKey);\n        // Get the actual position of this cell in the grid\n        const cellStartRow = mapCell.startRow;\n        const cellStartCol = mapCell.startColumn;\n        const cellRowSpan = mapCell.cell.__rowSpan || 1;\n        const cellColSpan = mapCell.cell.__colSpan || 1;\n\n        // Update boundaries considering the cell's actual position and span\n        minRow = Math.min(minRow, cellStartRow);\n        maxRow = Math.max(maxRow, cellStartRow + cellRowSpan - 1);\n        minCol = Math.min(minCol, cellStartCol);\n        maxCol = Math.max(maxCol, cellStartCol + cellColSpan - 1);\n      }\n    }\n  }\n\n  // Validate boundaries\n  if (minRow === Infinity || minCol === Infinity) {\n    return null;\n  }\n\n  // The total span of the merged cell\n  const totalRowSpan = maxRow - minRow + 1;\n  const totalColSpan = maxCol - minCol + 1;\n\n  // Use the top-left cell as the target cell\n  const targetCellMap = gridMap[minRow][minCol];\n  if (!targetCellMap.cell) {\n    return null;\n  }\n  const targetCell = targetCellMap.cell;\n\n  // Set the spans for the target cell\n  targetCell.setColSpan(totalColSpan);\n  targetCell.setRowSpan(totalRowSpan);\n\n  // Move content from other cells to the target cell\n  const seenCells = new Set([targetCell.getKey()]);\n\n  // Second pass: merge content and remove other cells\n  for (let row = minRow; row <= maxRow; row++) {\n    for (let col = minCol; col <= maxCol; col++) {\n      const mapCell = gridMap[row][col];\n      if (!mapCell.cell) {\n        continue;\n      }\n      const currentCell = mapCell.cell;\n      const key = currentCell.getKey();\n      if (!seenCells.has(key)) {\n        seenCells.add(key);\n        const isEmpty = $cellContainsEmptyParagraph(currentCell);\n        if (!isEmpty) {\n          targetCell.append(...currentCell.getChildren());\n        }\n        currentCell.remove();\n      }\n    }\n  }\n\n  // Ensure target cell has content\n  if (targetCell.getChildrenSize() === 0) {\n    targetCell.append($createParagraphNode());\n  }\n  return targetCell;\n}\nfunction $cellContainsEmptyParagraph(cell) {\n  if (cell.getChildrenSize() !== 1) {\n    return false;\n  }\n  const firstChild = cell.getFirstChildOrThrow();\n  if (!$isParagraphNode(firstChild) || !firstChild.isEmpty()) {\n    return false;\n  }\n  return true;\n}\nfunction $unmergeCell() {\n  const selection = $getSelection();\n  if (!($isRangeSelection(selection) || $isTableSelection(selection))) {\n    formatDevErrorMessage(`Expected a RangeSelection or TableSelection`);\n  }\n  const anchor = selection.anchor.getNode();\n  const cellNode = $findMatchingParent(anchor, $isTableCellNode);\n  if (!$isTableCellNode(cellNode)) {\n    formatDevErrorMessage(`Expected to find a parent TableCellNode`);\n  }\n  return $unmergeCellNode(cellNode);\n}\nfunction $unmergeCellNode(cellNode) {\n  const [cell, row, grid] = $getNodeTriplet(cellNode);\n  const colSpan = cell.__colSpan;\n  const rowSpan = cell.__rowSpan;\n  if (colSpan === 1 && rowSpan === 1) {\n    return;\n  }\n  const [map, cellMap] = $computeTableMap(grid, cell, cell);\n  const {\n    startColumn,\n    startRow\n  } = cellMap;\n  // Create a heuristic for what the style of the unmerged cells should be\n  // based on whether every row or column already had that state before the\n  // unmerge.\n  const baseColStyle = cell.__headerState & TableCellHeaderStates.COLUMN;\n  const colStyles = Array.from({\n    length: colSpan\n  }, (_v, i) => {\n    let colStyle = baseColStyle;\n    for (let rowIdx = 0; colStyle !== 0 && rowIdx < map.length; rowIdx++) {\n      colStyle &= map[rowIdx][i + startColumn].cell.__headerState;\n    }\n    return colStyle;\n  });\n  const baseRowStyle = cell.__headerState & TableCellHeaderStates.ROW;\n  const rowStyles = Array.from({\n    length: rowSpan\n  }, (_v, i) => {\n    let rowStyle = baseRowStyle;\n    for (let colIdx = 0; rowStyle !== 0 && colIdx < map[0].length; colIdx++) {\n      rowStyle &= map[i + startRow][colIdx].cell.__headerState;\n    }\n    return rowStyle;\n  });\n  if (colSpan > 1) {\n    for (let i = 1; i < colSpan; i++) {\n      cell.insertAfter($createTableCellNode(colStyles[i] | rowStyles[0]).append($createParagraphNode()));\n    }\n    cell.setColSpan(1);\n  }\n  if (rowSpan > 1) {\n    let currentRowNode;\n    for (let i = 1; i < rowSpan; i++) {\n      const currentRow = startRow + i;\n      const currentRowMap = map[currentRow];\n      currentRowNode = (currentRowNode || row).getNextSibling();\n      if (!$isTableRowNode(currentRowNode)) {\n        formatDevErrorMessage(`Expected row next sibling to be a row`);\n      }\n      let insertAfterCell = null;\n      for (let column = 0; column < startColumn; column++) {\n        const currentCellMap = currentRowMap[column];\n        const currentCell = currentCellMap.cell;\n        if (currentCellMap.startRow === currentRow) {\n          insertAfterCell = currentCell;\n        }\n        if (currentCell.__colSpan > 1) {\n          column += currentCell.__colSpan - 1;\n        }\n      }\n      if (insertAfterCell === null) {\n        for (let j = colSpan - 1; j >= 0; j--) {\n          $insertFirst(currentRowNode, $createTableCellNode(colStyles[j] | rowStyles[i]).append($createParagraphNode()));\n        }\n      } else {\n        for (let j = colSpan - 1; j >= 0; j--) {\n          insertAfterCell.insertAfter($createTableCellNode(colStyles[j] | rowStyles[i]).append($createParagraphNode()));\n        }\n      }\n    }\n    cell.setRowSpan(1);\n  }\n}\nfunction $computeTableMap(tableNode, cellA, cellB) {\n  const [tableMap, cellAValue, cellBValue] = $computeTableMapSkipCellCheck(tableNode, cellA, cellB);\n  if (!(cellAValue !== null)) {\n    formatDevErrorMessage(`Anchor not found in Table`);\n  }\n  if (!(cellBValue !== null)) {\n    formatDevErrorMessage(`Focus not found in Table`);\n  }\n  return [tableMap, cellAValue, cellBValue];\n}\nfunction $computeTableMapSkipCellCheck(tableNode, cellA, cellB) {\n  const tableMap = [];\n  let cellAValue = null;\n  let cellBValue = null;\n  function getMapRow(i) {\n    let row = tableMap[i];\n    if (row === undefined) {\n      tableMap[i] = row = [];\n    }\n    return row;\n  }\n  const gridChildren = tableNode.getChildren();\n  for (let rowIdx = 0; rowIdx < gridChildren.length; rowIdx++) {\n    const row = gridChildren[rowIdx];\n    if (!$isTableRowNode(row)) {\n      formatDevErrorMessage(`Expected TableNode children to be TableRowNode`);\n    }\n    const startMapRow = getMapRow(rowIdx);\n    for (let cell = row.getFirstChild(), colIdx = 0; cell != null; cell = cell.getNextSibling()) {\n      if (!$isTableCellNode(cell)) {\n        formatDevErrorMessage(`Expected TableRowNode children to be TableCellNode`);\n      } // Skip past any columns that were merged from a higher row\n      while (startMapRow[colIdx] !== undefined) {\n        colIdx++;\n      }\n      const value = {\n        cell,\n        startColumn: colIdx,\n        startRow: rowIdx\n      };\n      const {\n        __rowSpan: rowSpan,\n        __colSpan: colSpan\n      } = cell;\n      for (let j = 0; j < rowSpan; j++) {\n        if (rowIdx + j >= gridChildren.length) {\n          // The table is non-rectangular with a rowSpan\n          // below the last <tr> in the table.\n          // We should probably handle this with a node transform\n          // to ensure that tables are always rectangular but this\n          // will avoid crashes such as #6584\n          // Note that there are probably still latent bugs\n          // regarding colSpan or general cell count mismatches.\n          break;\n        }\n        const mapRow = getMapRow(rowIdx + j);\n        for (let i = 0; i < colSpan; i++) {\n          mapRow[colIdx + i] = value;\n        }\n      }\n      if (cellA !== null && cellAValue === null && cellA.is(cell)) {\n        cellAValue = value;\n      }\n      if (cellB !== null && cellBValue === null && cellB.is(cell)) {\n        cellBValue = value;\n      }\n    }\n  }\n  return [tableMap, cellAValue, cellBValue];\n}\nfunction $getNodeTriplet(source) {\n  let cell;\n  if (source instanceof TableCellNode) {\n    cell = source;\n  } else if ('__type' in source) {\n    const cell_ = $findMatchingParent(source, $isTableCellNode);\n    if (!$isTableCellNode(cell_)) {\n      formatDevErrorMessage(`Expected to find a parent TableCellNode`);\n    }\n    cell = cell_;\n  } else {\n    const cell_ = $findMatchingParent(source.getNode(), $isTableCellNode);\n    if (!$isTableCellNode(cell_)) {\n      formatDevErrorMessage(`Expected to find a parent TableCellNode`);\n    }\n    cell = cell_;\n  }\n  const row = cell.getParent();\n  if (!$isTableRowNode(row)) {\n    formatDevErrorMessage(`Expected TableCellNode to have a parent TableRowNode`);\n  }\n  const grid = row.getParent();\n  if (!$isTableNode(grid)) {\n    formatDevErrorMessage(`Expected TableRowNode to have a parent TableNode`);\n  }\n  return [cell, row, grid];\n}\nfunction $computeTableCellRectSpans(map, boundary) {\n  const {\n    minColumn,\n    maxColumn,\n    minRow,\n    maxRow\n  } = boundary;\n  let topSpan = 1;\n  let leftSpan = 1;\n  let rightSpan = 1;\n  let bottomSpan = 1;\n  const topRow = map[minRow];\n  const bottomRow = map[maxRow];\n  for (let col = minColumn; col <= maxColumn; col++) {\n    topSpan = Math.max(topSpan, topRow[col].cell.__rowSpan);\n    bottomSpan = Math.max(bottomSpan, bottomRow[col].cell.__rowSpan);\n  }\n  for (let row = minRow; row <= maxRow; row++) {\n    leftSpan = Math.max(leftSpan, map[row][minColumn].cell.__colSpan);\n    rightSpan = Math.max(rightSpan, map[row][maxColumn].cell.__colSpan);\n  }\n  return {\n    bottomSpan,\n    leftSpan,\n    rightSpan,\n    topSpan\n  };\n}\nfunction $computeTableCellRectBoundary(map, cellAMap, cellBMap) {\n  // Initial boundaries based on the anchor and focus cells\n  let minColumn = Math.min(cellAMap.startColumn, cellBMap.startColumn);\n  let minRow = Math.min(cellAMap.startRow, cellBMap.startRow);\n  let maxColumn = Math.max(cellAMap.startColumn + cellAMap.cell.__colSpan - 1, cellBMap.startColumn + cellBMap.cell.__colSpan - 1);\n  let maxRow = Math.max(cellAMap.startRow + cellAMap.cell.__rowSpan - 1, cellBMap.startRow + cellBMap.cell.__rowSpan - 1);\n\n  // Keep expanding until we have a complete rectangle\n  let hasChanges;\n  do {\n    hasChanges = false;\n\n    // Check all cells in the table\n    for (let row = 0; row < map.length; row++) {\n      for (let col = 0; col < map[0].length; col++) {\n        const cell = map[row][col];\n        if (!cell) {\n          continue;\n        }\n        const cellEndCol = cell.startColumn + cell.cell.__colSpan - 1;\n        const cellEndRow = cell.startRow + cell.cell.__rowSpan - 1;\n\n        // Check if this cell intersects with our current selection rectangle\n        const intersectsHorizontally = cell.startColumn <= maxColumn && cellEndCol >= minColumn;\n        const intersectsVertically = cell.startRow <= maxRow && cellEndRow >= minRow;\n\n        // If the cell intersects either horizontally or vertically\n        if (intersectsHorizontally && intersectsVertically) {\n          // Expand boundaries to include this cell completely\n          const newMinColumn = Math.min(minColumn, cell.startColumn);\n          const newMaxColumn = Math.max(maxColumn, cellEndCol);\n          const newMinRow = Math.min(minRow, cell.startRow);\n          const newMaxRow = Math.max(maxRow, cellEndRow);\n\n          // Check if boundaries changed\n          if (newMinColumn !== minColumn || newMaxColumn !== maxColumn || newMinRow !== minRow || newMaxRow !== maxRow) {\n            minColumn = newMinColumn;\n            maxColumn = newMaxColumn;\n            minRow = newMinRow;\n            maxRow = newMaxRow;\n            hasChanges = true;\n          }\n        }\n      }\n    }\n  } while (hasChanges);\n  return {\n    maxColumn,\n    maxRow,\n    minColumn,\n    minRow\n  };\n}\n\n/**\n * Checks if the table does not have any merged cells.\n *\n * @param table Table to check for if it has any merged cells.\n * @returns True if the table does not have any merged cells, false otherwise.\n */\nfunction $isSimpleTable(table) {\n  const rows = table.getChildren();\n  let columns = null;\n  for (const row of rows) {\n    if (!$isTableRowNode(row)) {\n      return false;\n    }\n    if (columns === null) {\n      columns = row.getChildrenSize();\n    }\n    if (row.getChildrenSize() !== columns) {\n      return false;\n    }\n    const cells = row.getChildren();\n    for (const cell of cells) {\n      if (!$isTableCellNode(cell) || cell.getRowSpan() !== 1 || cell.getColSpan() !== 1) {\n        return false;\n      }\n    }\n  }\n  return (columns || 0) > 0;\n}\n\n/**\n * Moves a column from one position to another within a simple (non-merged) table.\n *\n * @param tableNode The table node to modify.\n * @param originColumn The index of the column to move.\n * @param targetColumn The index to move the column to.\n */\nfunction $moveTableColumn(tableNode, originColumn, targetColumn) {\n  if (originColumn === targetColumn) {\n    return;\n  }\n  const columnCount = tableNode.getColumnCount();\n  if (originColumn < 0 || originColumn >= columnCount || targetColumn < 0 || targetColumn >= columnCount) {\n    return;\n  }\n  if (!$isSimpleTable(tableNode)) {\n    return;\n  }\n  const rows = tableNode.getChildren().filter($isTableRowNode);\n  rows.forEach(row => {\n    const cells = row.getChildren();\n    const [moved] = cells.splice(originColumn, 1);\n    cells.splice(targetColumn, 0, moved);\n    row.splice(0, cells.length, cells);\n  });\n  const colWidths = tableNode.getColWidths();\n  if (colWidths && colWidths.length === columnCount) {\n    const newWidths = [...colWidths];\n    const [movedWidth] = newWidths.splice(originColumn, 1);\n    newWidths.splice(targetColumn, 0, movedWidth);\n    tableNode.setColWidths(newWidths);\n  }\n}\nfunction $getTableCellNodeRect(tableCellNode) {\n  const [cellNode,, gridNode] = $getNodeTriplet(tableCellNode);\n  const rows = gridNode.getChildren();\n  const rowCount = rows.length;\n  const columnCount = rows[0].getChildren().length;\n\n  // Create a matrix of the same size as the table to track the position of each cell\n  const cellMatrix = new Array(rowCount);\n  for (let i = 0; i < rowCount; i++) {\n    cellMatrix[i] = new Array(columnCount);\n  }\n  for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n    const row = rows[rowIndex];\n    const cells = row.getChildren();\n    let columnIndex = 0;\n    for (let cellIndex = 0; cellIndex < cells.length; cellIndex++) {\n      // Find the next available position in the matrix, skip the position of merged cells\n      while (cellMatrix[rowIndex][columnIndex]) {\n        columnIndex++;\n      }\n      const cell = cells[cellIndex];\n      const rowSpan = cell.__rowSpan || 1;\n      const colSpan = cell.__colSpan || 1;\n\n      // Put the cell into the corresponding position in the matrix\n      for (let i = 0; i < rowSpan; i++) {\n        for (let j = 0; j < colSpan; j++) {\n          cellMatrix[rowIndex + i][columnIndex + j] = cell;\n        }\n      }\n\n      // Return to the original index, row span and column span of the cell.\n      if (cellNode === cell) {\n        return {\n          colSpan,\n          columnIndex,\n          rowIndex,\n          rowSpan\n        };\n      }\n      columnIndex += colSpan;\n    }\n  }\n  return null;\n}\n\nfunction $getCellNodes(tableSelection) {\n  const [[anchorNode, anchorCell, anchorRow, anchorTable], [focusNode, focusCell, focusRow, focusTable]] = ['anchor', 'focus'].map(k => {\n    const node = tableSelection[k].getNode();\n    const cellNode = $findMatchingParent(node, $isTableCellNode);\n    if (!$isTableCellNode(cellNode)) {\n      formatDevErrorMessage(`Expected TableSelection ${k} to be (or a child of) TableCellNode, got key ${node.getKey()} of type ${node.getType()}`);\n    }\n    const rowNode = cellNode.getParent();\n    if (!$isTableRowNode(rowNode)) {\n      formatDevErrorMessage(`Expected TableSelection ${k} cell parent to be a TableRowNode`);\n    }\n    const tableNode = rowNode.getParent();\n    if (!$isTableNode(tableNode)) {\n      formatDevErrorMessage(`Expected TableSelection ${k} row parent to be a TableNode`);\n    }\n    return [node, cellNode, rowNode, tableNode];\n  });\n  // TODO: nested tables may violate this\n  if (!anchorTable.is(focusTable)) {\n    formatDevErrorMessage(`Expected TableSelection anchor and focus to be in the same table`);\n  }\n  return {\n    anchorCell,\n    anchorNode,\n    anchorRow,\n    anchorTable,\n    focusCell,\n    focusNode,\n    focusRow,\n    focusTable\n  };\n}\nclass TableSelection {\n  tableKey;\n  anchor;\n  focus;\n  _cachedNodes;\n  dirty;\n  constructor(tableKey, anchor, focus) {\n    this.anchor = anchor;\n    this.focus = focus;\n    anchor._selection = this;\n    focus._selection = this;\n    this._cachedNodes = null;\n    this.dirty = false;\n    this.tableKey = tableKey;\n  }\n  getStartEndPoints() {\n    return [this.anchor, this.focus];\n  }\n\n  /**\n   * {@link $createTableSelection} unfortunately makes it very easy to create\n   * nonsense selections, so we have a method to see if the selection probably\n   * makes sense.\n   *\n   * @returns true if the TableSelection is (probably) valid\n   */\n  isValid() {\n    if (this.tableKey === 'root' || this.anchor.key === 'root' || this.anchor.type !== 'element' || this.focus.key === 'root' || this.focus.type !== 'element') {\n      return false;\n    }\n\n    // Check if the referenced nodes still exist in the editor\n    const tableNode = $getNodeByKey(this.tableKey);\n    const anchorNode = $getNodeByKey(this.anchor.key);\n    const focusNode = $getNodeByKey(this.focus.key);\n    return tableNode !== null && anchorNode !== null && focusNode !== null;\n  }\n\n  /**\n   * Returns whether the Selection is \"backwards\", meaning the focus\n   * logically precedes the anchor in the EditorState.\n   * @returns true if the Selection is backwards, false otherwise.\n   */\n  isBackward() {\n    return this.focus.isBefore(this.anchor);\n  }\n  getCachedNodes() {\n    return this._cachedNodes;\n  }\n  setCachedNodes(nodes) {\n    this._cachedNodes = nodes;\n  }\n  is(selection) {\n    return $isTableSelection(selection) && this.tableKey === selection.tableKey && this.anchor.is(selection.anchor) && this.focus.is(selection.focus);\n  }\n  set(tableKey, anchorCellKey, focusCellKey) {\n    // note: closure compiler's acorn does not support ||=\n    this.dirty = this.dirty || tableKey !== this.tableKey || anchorCellKey !== this.anchor.key || focusCellKey !== this.focus.key;\n    this.tableKey = tableKey;\n    this.anchor.key = anchorCellKey;\n    this.focus.key = focusCellKey;\n    this._cachedNodes = null;\n  }\n  clone() {\n    return new TableSelection(this.tableKey, $createPoint(this.anchor.key, this.anchor.offset, this.anchor.type), $createPoint(this.focus.key, this.focus.offset, this.focus.type));\n  }\n  isCollapsed() {\n    return false;\n  }\n  extract() {\n    return this.getNodes();\n  }\n  insertRawText(text) {\n    // Do nothing?\n  }\n  insertText() {\n    // Do nothing?\n  }\n\n  /**\n   * Returns whether the provided TextFormatType is present on the Selection.\n   * This will be true if any paragraph in table cells has the specified format.\n   *\n   * @param type the TextFormatType to check for.\n   * @returns true if the provided format is currently toggled on on the Selection, false otherwise.\n   */\n  hasFormat(type) {\n    let format = 0;\n    const cellNodes = this.getNodes().filter($isTableCellNode);\n    cellNodes.forEach(cellNode => {\n      const paragraph = cellNode.getFirstChild();\n      if ($isParagraphNode(paragraph)) {\n        format |= paragraph.getTextFormat();\n      }\n    });\n    const formatFlag = TEXT_TYPE_TO_FORMAT[type];\n    return (format & formatFlag) !== 0;\n  }\n  insertNodes(nodes) {\n    const focusNode = this.focus.getNode();\n    if (!$isElementNode(focusNode)) {\n      formatDevErrorMessage(`Expected TableSelection focus to be an ElementNode`);\n    }\n    const selection = $normalizeSelection__EXPERIMENTAL(focusNode.select(0, focusNode.getChildrenSize()));\n    selection.insertNodes(nodes);\n  }\n\n  // TODO Deprecate this method. It's confusing when used with colspan|rowspan\n  getShape() {\n    const {\n      anchorCell,\n      focusCell\n    } = $getCellNodes(this);\n    const anchorCellNodeRect = $getTableCellNodeRect(anchorCell);\n    if (!(anchorCellNodeRect !== null)) {\n      formatDevErrorMessage(`getCellRect: expected to find AnchorNode`);\n    }\n    const focusCellNodeRect = $getTableCellNodeRect(focusCell);\n    if (!(focusCellNodeRect !== null)) {\n      formatDevErrorMessage(`getCellRect: expected to find focusCellNode`);\n    }\n    const startX = Math.min(anchorCellNodeRect.columnIndex, focusCellNodeRect.columnIndex);\n    const stopX = Math.max(anchorCellNodeRect.columnIndex + anchorCellNodeRect.colSpan - 1, focusCellNodeRect.columnIndex + focusCellNodeRect.colSpan - 1);\n    const startY = Math.min(anchorCellNodeRect.rowIndex, focusCellNodeRect.rowIndex);\n    const stopY = Math.max(anchorCellNodeRect.rowIndex + anchorCellNodeRect.rowSpan - 1, focusCellNodeRect.rowIndex + focusCellNodeRect.rowSpan - 1);\n    return {\n      fromX: Math.min(startX, stopX),\n      fromY: Math.min(startY, stopY),\n      toX: Math.max(startX, stopX),\n      toY: Math.max(startY, stopY)\n    };\n  }\n  getNodes() {\n    if (!this.isValid()) {\n      return [];\n    }\n    const cachedNodes = this._cachedNodes;\n    if (cachedNodes !== null) {\n      return cachedNodes;\n    }\n    const {\n      anchorTable: tableNode,\n      anchorCell,\n      focusCell\n    } = $getCellNodes(this);\n    const focusCellGrid = focusCell.getParents()[1];\n    if (focusCellGrid !== tableNode) {\n      if (!tableNode.isParentOf(focusCell)) {\n        // focus is on higher Grid level than anchor\n        const gridParent = tableNode.getParent();\n        if (!(gridParent != null)) {\n          formatDevErrorMessage(`Expected gridParent to have a parent`);\n        }\n        this.set(this.tableKey, gridParent.getKey(), focusCell.getKey());\n      } else {\n        // anchor is on higher Grid level than focus\n        const focusCellParent = focusCellGrid.getParent();\n        if (!(focusCellParent != null)) {\n          formatDevErrorMessage(`Expected focusCellParent to have a parent`);\n        }\n        this.set(this.tableKey, focusCell.getKey(), focusCellParent.getKey());\n      }\n      return this.getNodes();\n    }\n\n    // TODO Mapping the whole Grid every time not efficient. We need to compute the entire state only\n    // once (on load) and iterate on it as updates occur. However, to do this we need to have the\n    // ability to store a state. Killing TableSelection and moving the logic to the plugin would make\n    // this possible.\n    const [map, cellAMap, cellBMap] = $computeTableMap(tableNode, anchorCell, focusCell);\n    const {\n      minColumn,\n      maxColumn,\n      minRow,\n      maxRow\n    } = $computeTableCellRectBoundary(map, cellAMap, cellBMap);\n\n    // We use a Map here because merged cells in the grid would otherwise\n    // show up multiple times in the nodes array\n    const nodeMap = new Map([[tableNode.getKey(), tableNode]]);\n    let lastRow = null;\n    for (let i = minRow; i <= maxRow; i++) {\n      for (let j = minColumn; j <= maxColumn; j++) {\n        const {\n          cell\n        } = map[i][j];\n        const currentRow = cell.getParent();\n        if (!$isTableRowNode(currentRow)) {\n          formatDevErrorMessage(`Expected TableCellNode parent to be a TableRowNode`);\n        }\n        if (currentRow !== lastRow) {\n          nodeMap.set(currentRow.getKey(), currentRow);\n          lastRow = currentRow;\n        }\n        if (!nodeMap.has(cell.getKey())) {\n          $visitRecursively(cell, childNode => {\n            nodeMap.set(childNode.getKey(), childNode);\n          });\n        }\n      }\n    }\n    const nodes = Array.from(nodeMap.values());\n    if (!isCurrentlyReadOnlyMode()) {\n      this._cachedNodes = nodes;\n    }\n    return nodes;\n  }\n  getTextContent() {\n    const nodes = this.getNodes().filter(node => $isTableCellNode(node));\n    let textContent = '';\n    for (let i = 0; i < nodes.length; i++) {\n      const node = nodes[i];\n      const row = node.__parent;\n      const nextRow = (nodes[i + 1] || {}).__parent;\n      textContent += node.getTextContent() + (nextRow !== row ? '\\n' : '\\t');\n    }\n    return textContent;\n  }\n}\nfunction $isTableSelection(x) {\n  return x instanceof TableSelection;\n}\nfunction $createTableSelection() {\n  // TODO this is a suboptimal design, it doesn't make sense to have\n  // a table selection that isn't associated with a table. This\n  // constructor should have required arguments and in true we\n  // should check that they point to a table and are element points to\n  // cell nodes of that table.\n  const anchor = $createPoint('root', 0, 'element');\n  const focus = $createPoint('root', 0, 'element');\n  return new TableSelection('root', anchor, focus);\n}\nfunction $createTableSelectionFrom(tableNode, anchorCell, focusCell) {\n  const tableNodeKey = tableNode.getKey();\n  const anchorCellKey = anchorCell.getKey();\n  const focusCellKey = focusCell.getKey();\n  {\n    if (!tableNode.isAttached()) {\n      formatDevErrorMessage(`$createTableSelectionFrom: tableNode ${tableNodeKey} is not attached`);\n    }\n    if (!tableNode.is($findTableNode(anchorCell))) {\n      formatDevErrorMessage(`$createTableSelectionFrom: anchorCell ${anchorCellKey} is not in table ${tableNodeKey}`);\n    }\n    if (!tableNode.is($findTableNode(focusCell))) {\n      formatDevErrorMessage(`$createTableSelectionFrom: focusCell ${focusCellKey} is not in table ${tableNodeKey}`);\n    } // TODO: Check for rectangular grid\n  }\n  const prevSelection = $getSelection();\n  const nextSelection = $isTableSelection(prevSelection) ? prevSelection.clone() : $createTableSelection();\n  nextSelection.set(tableNode.getKey(), anchorCell.getKey(), focusCell.getKey());\n  return nextSelection;\n}\n\n/**\n * Depth first visitor\n * @param node The starting node\n * @param $visit The function to call for each node. If the function returns false, then children of this node will not be explored\n */\nfunction $visitRecursively(node, $visit) {\n  const stack = [[node]];\n  for (let currentArray = stack.at(-1); currentArray !== undefined && stack.length > 0; currentArray = stack.at(-1)) {\n    const currentNode = currentArray.pop();\n    if (currentNode === undefined) {\n      stack.pop();\n    } else if ($visit(currentNode) !== false && $isElementNode(currentNode)) {\n      stack.push(currentNode.getChildren());\n    }\n  }\n}\n\nfunction $getTableAndElementByKey(tableNodeKey, editor = $getEditor()) {\n  const tableNode = $getNodeByKey(tableNodeKey);\n  if (!$isTableNode(tableNode)) {\n    formatDevErrorMessage(`TableObserver: Expected tableNodeKey ${tableNodeKey} to be a TableNode`);\n  }\n  const tableElement = getTableElement(tableNode, editor.getElementByKey(tableNodeKey));\n  if (!(tableElement !== null)) {\n    formatDevErrorMessage(`TableObserver: Expected to find TableElement in DOM for key ${tableNodeKey}`);\n  }\n  return {\n    tableElement,\n    tableNode\n  };\n}\n/**\n * Tracks table selection state that sits across all tables.\n */\nclass TableObservers {\n  observers;\n  nextFocus;\n  shouldCheckSelectionForTable;\n  constructor() {\n    this.observers = new Map();\n    this.nextFocus = null;\n    this.shouldCheckSelectionForTable = null;\n  }\n\n  /**\n   * @internal\n   * When handling mousemove events we track what the focus cell should be, but\n   * the DOM selection may end up somewhere else entirely. We don't have an elegant\n   * way to handle this after the DOM selection has been resolved in a\n   * SELECTION_CHANGE_COMMAND callback.\n   */\n  setNextFocus(nextFocus) {\n    this.nextFocus = nextFocus;\n  }\n\n  /** @internal */\n  getAndClearNextFocus() {\n    const {\n      nextFocus\n    } = this;\n    if (nextFocus !== null) {\n      this.nextFocus = null;\n    }\n    return nextFocus;\n  }\n\n  /**\n   * @internal\n   * Firefox has a strange behavior where pressing the down arrow key from\n   * above the table will move the caret after the table and then lexical\n   * will select the last cell instead of the first.\n   * We do still want to let the browser handle caret movement but we will\n   * use this property to \"tag\" the update so that we can recheck the\n   * selection after the event is processed.\n   */\n  setShouldCheckSelectionForTable(tableKey) {\n    this.shouldCheckSelectionForTable = tableKey;\n  }\n  /**\n   * @internal\n   */\n  getAndClearShouldCheckSelectionForTable() {\n    const {\n      shouldCheckSelectionForTable\n    } = this;\n    if (shouldCheckSelectionForTable) {\n      this.shouldCheckSelectionForTable = null;\n      return shouldCheckSelectionForTable;\n    }\n    return null;\n  }\n}\nclass TableObserver {\n  focusX;\n  focusY;\n  listenersToRemove;\n  table;\n  isHighlightingCells;\n  anchorX;\n  anchorY;\n  tableNodeKey;\n  anchorCell;\n  focusCell;\n  anchorCellNodeKey;\n  focusCellNodeKey;\n  editor;\n  tableSelection;\n  hasHijackedSelectionStyles;\n  isSelecting;\n  pointerType;\n  abortController;\n  listenerOptions;\n  constructor(editor, tableNodeKey) {\n    this.isHighlightingCells = false;\n    this.anchorX = -1;\n    this.anchorY = -1;\n    this.focusX = -1;\n    this.focusY = -1;\n    this.listenersToRemove = new Set();\n    this.tableNodeKey = tableNodeKey;\n    this.editor = editor;\n    this.table = {\n      columns: 0,\n      domRows: [],\n      rows: 0\n    };\n    this.tableSelection = null;\n    this.anchorCellNodeKey = null;\n    this.focusCellNodeKey = null;\n    this.anchorCell = null;\n    this.focusCell = null;\n    this.hasHijackedSelectionStyles = false;\n    this.isSelecting = false;\n    this.pointerType = null;\n    this.abortController = new AbortController();\n    this.listenerOptions = {\n      signal: this.abortController.signal\n    };\n    this.trackTable();\n  }\n  getTable() {\n    return this.table;\n  }\n  removeListeners() {\n    this.abortController.abort('removeListeners');\n    Array.from(this.listenersToRemove).forEach(removeListener => removeListener());\n    this.listenersToRemove.clear();\n  }\n  $lookup() {\n    return $getTableAndElementByKey(this.tableNodeKey, this.editor);\n  }\n  trackTable() {\n    const observer = new MutationObserver(records => {\n      this.editor.getEditorState().read(() => {\n        let gridNeedsRedraw = false;\n        for (let i = 0; i < records.length; i++) {\n          const record = records[i];\n          const target = record.target;\n          const nodeName = target.nodeName;\n          if (nodeName === 'TABLE' || nodeName === 'TBODY' || nodeName === 'THEAD' || nodeName === 'TR') {\n            gridNeedsRedraw = true;\n            break;\n          }\n        }\n        if (!gridNeedsRedraw) {\n          return;\n        }\n        const {\n          tableNode,\n          tableElement\n        } = this.$lookup();\n        this.table = getTable(tableNode, tableElement);\n      }, {\n        editor: this.editor\n      });\n    });\n    this.editor.getEditorState().read(() => {\n      const {\n        tableNode,\n        tableElement\n      } = this.$lookup();\n      this.table = getTable(tableNode, tableElement);\n      observer.observe(tableElement, {\n        attributes: true,\n        childList: true,\n        subtree: true\n      });\n    }, {\n      editor: this.editor\n    });\n  }\n  $clearHighlight(setEmptySelection = true) {\n    const editor = this.editor;\n    this.isHighlightingCells = false;\n    this.anchorX = -1;\n    this.anchorY = -1;\n    this.focusX = -1;\n    this.focusY = -1;\n    this.tableSelection = null;\n    this.anchorCellNodeKey = null;\n    this.focusCellNodeKey = null;\n    this.anchorCell = null;\n    this.focusCell = null;\n    this.hasHijackedSelectionStyles = false;\n    this.$enableHighlightStyle();\n    const {\n      tableNode,\n      tableElement\n    } = this.$lookup();\n    const grid = getTable(tableNode, tableElement);\n    $updateDOMForSelection(editor, grid, null);\n    if (setEmptySelection && $getSelection() !== null) {\n      $setSelection(null);\n      editor.dispatchCommand(SELECTION_CHANGE_COMMAND, undefined);\n    }\n  }\n  $enableHighlightStyle() {\n    const editor = this.editor;\n    const {\n      tableElement\n    } = this.$lookup();\n    removeClassNamesFromElement(tableElement, editor._config.theme.tableSelection);\n    tableElement.classList.remove('disable-selection');\n    this.hasHijackedSelectionStyles = false;\n  }\n  $disableHighlightStyle() {\n    const {\n      tableElement\n    } = this.$lookup();\n    addClassNamesToElement(tableElement, this.editor._config.theme.tableSelection);\n    this.hasHijackedSelectionStyles = true;\n  }\n  $updateTableTableSelection(selection) {\n    if (selection !== null) {\n      if (!(selection.tableKey === this.tableNodeKey)) {\n        formatDevErrorMessage(`TableObserver.$updateTableTableSelection: selection.tableKey !== this.tableNodeKey ('${selection.tableKey}' !== '${this.tableNodeKey}')`);\n      }\n      const editor = this.editor;\n      this.tableSelection = selection;\n      this.isHighlightingCells = true;\n      this.$disableHighlightStyle();\n      this.updateDOMSelection();\n      $updateDOMForSelection(editor, this.table, this.tableSelection);\n    } else {\n      this.$clearHighlight();\n    }\n  }\n\n  /** @internal */\n  updateDOMSelection() {\n    if (this.anchorCell !== null && this.focusCell !== null) {\n      const domSelection = getDOMSelection(this.editor._window);\n      // We are not using a native selection for tables, and if we\n      // set one then the reconciler will undo it.\n      // TODO - it would make sense to have one so that native\n      //        copy/paste worked. Right now we have to emulate with\n      //        keyboard events but it won't fire if triggered from the menu\n      if (domSelection && domSelection.rangeCount > 0) {\n        domSelection.removeAllRanges();\n      }\n    }\n  }\n  $setFocusCellForSelection(cell, ignoreStart = false) {\n    const editor = this.editor;\n    const {\n      tableNode\n    } = this.$lookup();\n    const cellX = cell.x;\n    const cellY = cell.y;\n    this.focusCell = cell;\n\n    // Enable highlighting if: ignoreStart is true, or anchor differs from focus,\n    // or we have valid tableSelection with anchor (for first drag after column switch)\n    if (!this.isHighlightingCells) {\n      const shouldEnable = ignoreStart || this.anchorX !== cellX || this.anchorY !== cellY || this.tableSelection != null && this.anchorCellNodeKey != null;\n      if (shouldEnable) {\n        this.isHighlightingCells = true;\n        this.$disableHighlightStyle();\n      }\n    }\n\n    // Skip if we're trying to select the same cell we already have selected\n    // But only if focusX/focusY are valid (not -1, which means not reset)\n    if (this.focusX !== -1 && this.focusY !== -1 && cellX === this.focusX && cellY === this.focusY) {\n      return false;\n    }\n    this.focusX = cellX;\n    this.focusY = cellY;\n    if (this.isHighlightingCells) {\n      const focusTableCellNode = $getNearestTableCellInTableFromDOMNode(tableNode, cell.elem);\n      if (this.tableSelection != null && this.anchorCellNodeKey != null) {\n        let targetCellNode = focusTableCellNode;\n\n        // Fallback: use coordinates if DOM lookup failed (handles timing issues on first drag)\n        if (targetCellNode === null && ignoreStart) {\n          targetCellNode = tableNode.getCellNodeFromCords(cellX, cellY, this.table);\n        }\n        if (targetCellNode !== null) {\n          const anchorTableCell = this.$getAnchorTableCellOrThrow();\n          this.focusCellNodeKey = targetCellNode.getKey();\n          this.tableSelection = $createTableSelectionFrom(tableNode, anchorTableCell, targetCellNode);\n          $setSelection(this.tableSelection);\n          editor.dispatchCommand(SELECTION_CHANGE_COMMAND, undefined);\n          $updateDOMForSelection(editor, this.table, this.tableSelection);\n          return true;\n        }\n      }\n    }\n    return false;\n  }\n  $getAnchorTableCell() {\n    return this.anchorCellNodeKey ? $getNodeByKey(this.anchorCellNodeKey) : null;\n  }\n  $getAnchorTableCellOrThrow() {\n    const anchorTableCell = this.$getAnchorTableCell();\n    if (!(anchorTableCell !== null)) {\n      formatDevErrorMessage(`TableObserver anchorTableCell is null`);\n    }\n    return anchorTableCell;\n  }\n  $getFocusTableCell() {\n    return this.focusCellNodeKey ? $getNodeByKey(this.focusCellNodeKey) : null;\n  }\n  $getFocusTableCellOrThrow() {\n    const focusTableCell = this.$getFocusTableCell();\n    if (!(focusTableCell !== null)) {\n      formatDevErrorMessage(`TableObserver focusTableCell is null`);\n    }\n    return focusTableCell;\n  }\n  $setAnchorCellForSelection(cell) {\n    this.isHighlightingCells = false;\n    this.anchorCell = cell;\n    this.anchorX = cell.x;\n    this.anchorY = cell.y;\n    // Reset focus state to prevent stale values from previous selections\n    this.focusX = -1;\n    this.focusY = -1;\n    this.focusCell = null;\n    this.focusCellNodeKey = null;\n    const {\n      tableNode\n    } = this.$lookup();\n    const anchorTableCellNode = $getNearestTableCellInTableFromDOMNode(tableNode, cell.elem);\n    if (anchorTableCellNode !== null) {\n      const anchorNodeKey = anchorTableCellNode.getKey();\n      if (this.tableSelection != null) {\n        this.tableSelection = this.tableSelection.clone();\n        this.tableSelection.set(tableNode.getKey(), anchorNodeKey, anchorNodeKey);\n      } else {\n        this.tableSelection = $createTableSelectionFrom(tableNode, anchorTableCellNode, anchorTableCellNode);\n      }\n      this.anchorCellNodeKey = anchorNodeKey;\n    }\n  }\n  $formatCells(type) {\n    const selection = $getSelection();\n    if (!$isTableSelection(selection)) {\n      formatDevErrorMessage(`Expected Table selection`);\n    }\n    const formatSelection = $createRangeSelection();\n    const anchor = formatSelection.anchor;\n    const focus = formatSelection.focus;\n    const cellNodes = selection.getNodes().filter($isTableCellNode);\n    if (!(cellNodes.length > 0)) {\n      formatDevErrorMessage(`No table cells present`);\n    }\n    const paragraph = cellNodes[0].getFirstChild();\n    const alignFormatWith = $isParagraphNode(paragraph) ? paragraph.getFormatFlags(type, null) : null;\n    cellNodes.forEach(cellNode => {\n      anchor.set(cellNode.getKey(), 0, 'element');\n      focus.set(cellNode.getKey(), cellNode.getChildrenSize(), 'element');\n      formatSelection.formatText(type, alignFormatWith);\n    });\n    $setSelection(selection);\n    this.editor.dispatchCommand(SELECTION_CHANGE_COMMAND, undefined);\n  }\n  $clearText() {\n    const {\n      editor\n    } = this;\n    const tableNode = $getNodeByKey(this.tableNodeKey);\n    if (!$isTableNode(tableNode)) {\n      throw new Error('Expected TableNode.');\n    }\n    const selection = $getSelection();\n    if (!$isTableSelection(selection)) {\n      formatDevErrorMessage(`Expected TableSelection`);\n    }\n    const selectedNodes = selection.getNodes().filter($isTableCellNode);\n\n    // Check if the entire table is selected by verifying first and last cells\n    const firstRow = tableNode.getFirstChild();\n    const lastRow = tableNode.getLastChild();\n    const isEntireTableSelected = selectedNodes.length > 0 && firstRow !== null && lastRow !== null && $isTableRowNode(firstRow) && $isTableRowNode(lastRow) && selectedNodes[0] === firstRow.getFirstChild() && selectedNodes[selectedNodes.length - 1] === lastRow.getLastChild();\n    if (isEntireTableSelected) {\n      tableNode.selectPrevious();\n      const parent = tableNode.getParent();\n      // Delete entire table\n      tableNode.remove();\n      // Handle case when table was the only node\n      if ($isRootNode(parent) && parent.isEmpty()) {\n        editor.dispatchCommand(INSERT_PARAGRAPH_COMMAND, undefined);\n      }\n      return;\n    }\n    selectedNodes.forEach(cellNode => {\n      if ($isElementNode(cellNode)) {\n        const paragraphNode = $createParagraphNode();\n        const textNode = $createTextNode();\n        paragraphNode.append(textNode);\n        cellNode.append(paragraphNode);\n        cellNode.getChildren().forEach(child => {\n          if (child !== paragraphNode) {\n            child.remove();\n          }\n        });\n      }\n    });\n    $updateDOMForSelection(editor, this.table, null);\n    $setSelection(null);\n    editor.dispatchCommand(SELECTION_CHANGE_COMMAND, undefined);\n  }\n}\n\nconst LEXICAL_ELEMENT_KEY = '__lexicalTableSelection';\nconst isPointerDownOnEvent = event => {\n  return (event.buttons & 1) === 1;\n};\nfunction isHTMLTableElement(el) {\n  return isHTMLElement(el) && el.nodeName === 'TABLE';\n}\nfunction getTableElement(tableNode, dom) {\n  if (!dom) {\n    return dom;\n  }\n  const element = isHTMLTableElement(dom) ? dom : dom.querySelector('table');\n  if (!isHTMLTableElement(element)) {\n    formatDevErrorMessage(`getTableElement: Expecting table in DOM node for ${tableNode.constructor.name} of type ${tableNode.getType()} with key ${tableNode.getKey()}, not ${dom.nodeName}`);\n  }\n  return element;\n}\nfunction getEditorWindow(editor) {\n  return editor._window;\n}\nfunction $findParentTableCellNodeInTable(tableNode, node) {\n  for (let currentNode = node, lastTableCellNode = null; currentNode !== null; currentNode = currentNode.getParent()) {\n    if (tableNode.is(currentNode)) {\n      return lastTableCellNode;\n    } else if ($isTableCellNode(currentNode)) {\n      lastTableCellNode = currentNode;\n    }\n  }\n  return null;\n}\nconst ARROW_KEY_COMMANDS_WITH_DIRECTION = [[KEY_ARROW_DOWN_COMMAND, 'down'], [KEY_ARROW_UP_COMMAND, 'up'], [KEY_ARROW_LEFT_COMMAND, 'backward'], [KEY_ARROW_RIGHT_COMMAND, 'forward']];\nconst DELETE_TEXT_COMMANDS = [DELETE_WORD_COMMAND, DELETE_LINE_COMMAND, DELETE_CHARACTER_COMMAND];\nconst DELETE_KEY_COMMANDS = [KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND];\nfunction registerTableWindowHandlers(editor, tableObservers) {\n  const rootElement = editor.getRootElement();\n  const editorWindow = editor._window;\n  if (!rootElement || !editorWindow) {\n    return () => {};\n  }\n  const pointerDownCallback = event => {\n    const target = event.target;\n    if (event.button !== 0 || !isDOMNode(target) || !rootElement.contains(target)) {\n      return;\n    }\n    const selectionInfo = getTableObserverFromCellNode(target);\n    editor.update(() => {\n      // Clear highlights from all tables (even one we're actively clicking on)\n      const selection = $getSelection();\n      if ($isTableSelection(selection)) {\n        for (const [observer] of tableObservers.observers.values()) {\n          observer.$clearHighlight(false);\n        }\n        $setSelection(null);\n        editor.dispatchCommand(SELECTION_CHANGE_COMMAND, undefined);\n      }\n      if (!selectionInfo) {\n        return;\n      }\n      const {\n        tableObserver,\n        tableElement,\n        cellElement\n      } = selectionInfo;\n      $handleTableClick(editor, event, cellElement, tableElement, tableObserver, tableObservers);\n    });\n  };\n  editorWindow.addEventListener('pointerdown', pointerDownCallback);\n  return () => {\n    editorWindow.removeEventListener('pointerdown', pointerDownCallback);\n  };\n}\nfunction $handleTableClick(editor, event, selectedDOMCell, tableElement, tableObserver, tableObservers) {\n  const editorWindow = editor._window;\n  if (!editorWindow) {\n    return;\n  }\n  const createPointerHandlers = startingCell => {\n    if (tableObserver.isSelecting) {\n      return;\n    }\n    tableObserver.isSelecting = true;\n\n    // Set anchor immediately if starting cell provided (handles direct drag without click)\n    if (startingCell !== null && tableObserver.anchorCell === null) {\n      editor.update(() => {\n        tableObserver.$setAnchorCellForSelection(startingCell);\n      });\n    }\n    const onPointerUp = () => {\n      tableObserver.isSelecting = false;\n      editorWindow.removeEventListener('pointerup', onPointerUp);\n      editorWindow.removeEventListener('pointermove', onPointerMove);\n    };\n    const onPointerMove = moveEvent => {\n      if (!isPointerDownOnEvent(moveEvent) && tableObserver.isSelecting) {\n        tableObserver.isSelecting = false;\n        editorWindow.removeEventListener('pointerup', onPointerUp);\n        editorWindow.removeEventListener('pointermove', onPointerMove);\n        return;\n      }\n      if (!isDOMNode(moveEvent.target)) {\n        return;\n      }\n      let focusCell = null;\n      // In firefox the moveEvent.target may be captured so we must always\n      // consult the coordinates #7245\n      const override = !(IS_FIREFOX || tableElement.contains(moveEvent.target));\n      if (override) {\n        focusCell = getDOMCellInTableFromTarget(tableElement, moveEvent.target);\n      } else {\n        for (const el of document.elementsFromPoint(moveEvent.clientX, moveEvent.clientY)) {\n          focusCell = getDOMCellInTableFromTarget(tableElement, el);\n          if (focusCell) {\n            break;\n          }\n        }\n      }\n      if (focusCell) {\n        const anchorCell = focusCell;\n        // Fallback: set anchor if still missing (handles race conditions)\n        if (tableObserver.anchorCell === null) {\n          editor.update(() => {\n            tableObserver.$setAnchorCellForSelection(anchorCell);\n          });\n        }\n        if (tableObserver.focusCell === null || focusCell.elem !== tableObserver.focusCell.elem) {\n          tableObservers.setNextFocus({\n            focusCell,\n            override,\n            tableKey: tableObserver.tableNodeKey\n          });\n          editor.dispatchCommand(SELECTION_CHANGE_COMMAND, undefined);\n        }\n      }\n    };\n    editorWindow.addEventListener('pointerup', onPointerUp, tableObserver.listenerOptions);\n    editorWindow.addEventListener('pointermove', onPointerMove, tableObserver.listenerOptions);\n  };\n  tableObserver.pointerType = event.pointerType;\n  const tableNode = $getNodeByKeyOrThrow(tableObserver.tableNodeKey);\n  const prevSelection = $getPreviousSelection();\n  // We can't trust Firefox to do the right thing with the selection and\n  // we don't have a proper state machine to do this \"correctly\" but\n  // if we go ahead and make the table selection now it will work\n  if (IS_FIREFOX && event.shiftKey && $isSelectionInTable(prevSelection, tableNode) && ($isRangeSelection(prevSelection) || $isTableSelection(prevSelection))) {\n    const prevAnchorNode = prevSelection.anchor.getNode();\n    const prevAnchorCell = $findParentTableCellNodeInTable(tableNode, prevSelection.anchor.getNode());\n    if (prevAnchorCell) {\n      tableObserver.$setAnchorCellForSelection($getObserverCellFromCellNodeOrThrow(tableObserver, prevAnchorCell));\n      tableObserver.$setFocusCellForSelection(selectedDOMCell);\n      stopEvent(event);\n    } else {\n      const newSelection = tableNode.isBefore(prevAnchorNode) ? tableNode.selectStart() : tableNode.selectEnd();\n      newSelection.anchor.set(prevSelection.anchor.key, prevSelection.anchor.offset, prevSelection.anchor.type);\n    }\n  } else {\n    // Only set anchor cell for selection if this is not a simple touch tap\n    // Touch taps should not initiate table selection mode\n    if (event.pointerType !== 'touch') {\n      tableObserver.$setAnchorCellForSelection(selectedDOMCell);\n    }\n  }\n\n  // Pass the target cell to createPointerHandlers so it can be used as anchor\n  // if user drags directly without clicking first\n  createPointerHandlers(selectedDOMCell);\n}\nfunction applyTableHandlers(tableNode, element, editor, hasTabHandler, tableObservers) {\n  const rootElement = editor.getRootElement();\n  const editorWindow = getEditorWindow(editor);\n  if (!(rootElement !== null && editorWindow !== null)) {\n    formatDevErrorMessage(`applyTableHandlers: editor has no root element set`);\n  }\n  const tableObserver = new TableObserver(editor, tableNode.getKey());\n  const tableElement = getTableElement(tableNode, element);\n  attachTableObserverToTableElement(tableElement, tableObserver);\n  tableObserver.listenersToRemove.add(() => detachTableObserverFromTableElement(tableElement, tableObserver));\n  const onTripleClick = event => {\n    if (event.detail >= 3 && isDOMNode(event.target)) {\n      const targetCell = getDOMCellFromTarget(event.target);\n      if (targetCell !== null) {\n        event.preventDefault();\n      }\n    }\n  };\n  tableElement.addEventListener('mousedown', onTripleClick, tableObserver.listenerOptions);\n  tableObserver.listenersToRemove.add(() => {\n    tableElement.removeEventListener('mousedown', onTripleClick);\n  });\n  for (const [command, direction] of ARROW_KEY_COMMANDS_WITH_DIRECTION) {\n    tableObserver.listenersToRemove.add(editor.registerCommand(command, event => $handleArrowKey(editor, event, direction, tableNode, tableObserver, tableObservers), COMMAND_PRIORITY_HIGH));\n  }\n  tableObserver.listenersToRemove.add(editor.registerCommand(KEY_ESCAPE_COMMAND, event => {\n    const selection = $getSelection();\n    if ($isTableSelection(selection)) {\n      const focusCellNode = $findParentTableCellNodeInTable(tableNode, selection.focus.getNode());\n      if (focusCellNode !== null) {\n        stopEvent(event);\n        focusCellNode.selectEnd();\n        return true;\n      }\n    }\n    return false;\n  }, COMMAND_PRIORITY_HIGH));\n  const deleteTextHandler = command => () => {\n    const selection = $getSelection();\n    if (!$isSelectionInTable(selection, tableNode)) {\n      return false;\n    }\n    if ($isTableSelection(selection)) {\n      tableObserver.$clearText();\n      return true;\n    } else if ($isRangeSelection(selection)) {\n      const tableCellNode = $findParentTableCellNodeInTable(tableNode, selection.anchor.getNode());\n      if (!$isTableCellNode(tableCellNode)) {\n        return false;\n      }\n      const anchorNode = selection.anchor.getNode();\n      const focusNode = selection.focus.getNode();\n      const isAnchorInside = tableNode.isParentOf(anchorNode);\n      const isFocusInside = tableNode.isParentOf(focusNode);\n      const selectionContainsPartialTable = isAnchorInside && !isFocusInside || isFocusInside && !isAnchorInside;\n      if (selectionContainsPartialTable) {\n        tableObserver.$clearText();\n        return true;\n      }\n      const nearestElementNode = $findMatchingParent(selection.anchor.getNode(), n => $isElementNode(n));\n      const topLevelCellElementNode = nearestElementNode && $findMatchingParent(nearestElementNode, n => $isElementNode(n) && $isTableCellNode(n.getParent()));\n      if (!$isElementNode(topLevelCellElementNode) || !$isElementNode(nearestElementNode)) {\n        return false;\n      }\n      if (command === DELETE_LINE_COMMAND && topLevelCellElementNode.getPreviousSibling() === null) {\n        // TODO: Fix Delete Line in Table Cells.\n        return true;\n      }\n    }\n    return false;\n  };\n  for (const command of DELETE_TEXT_COMMANDS) {\n    tableObserver.listenersToRemove.add(editor.registerCommand(command, deleteTextHandler(command), COMMAND_PRIORITY_HIGH));\n  }\n  const $deleteCellHandler = event => {\n    const selection = $getSelection();\n    if (!($isTableSelection(selection) || $isRangeSelection(selection))) {\n      return false;\n    }\n\n    // If the selection is inside the table but should remove the whole table\n    // we expand the selection so that both the anchor and focus are outside\n    // the table and the editor's command listener will handle the delete\n    const isAnchorInside = tableNode.isParentOf(selection.anchor.getNode());\n    const isFocusInside = tableNode.isParentOf(selection.focus.getNode());\n    if (isAnchorInside !== isFocusInside) {\n      const tablePoint = isAnchorInside ? 'anchor' : 'focus';\n      const outerPoint = isAnchorInside ? 'focus' : 'anchor';\n      // Preserve the outer point\n      const {\n        key,\n        offset,\n        type\n      } = selection[outerPoint];\n      // Expand the selection around the table\n      const newSelection = tableNode[selection[tablePoint].isBefore(selection[outerPoint]) ? 'selectPrevious' : 'selectNext']();\n      // Restore the outer point of the selection\n      newSelection[outerPoint].set(key, offset, type);\n      // Let the base implementation handle the rest\n      return false;\n    }\n    if (!$isSelectionInTable(selection, tableNode)) {\n      return false;\n    }\n    if ($isTableSelection(selection)) {\n      if (event) {\n        event.preventDefault();\n        event.stopPropagation();\n      }\n      tableObserver.$clearText();\n      return true;\n    }\n    return false;\n  };\n  for (const command of DELETE_KEY_COMMANDS) {\n    tableObserver.listenersToRemove.add(editor.registerCommand(command, $deleteCellHandler, COMMAND_PRIORITY_HIGH));\n  }\n  tableObserver.listenersToRemove.add(editor.registerCommand(CUT_COMMAND, event => {\n    const selection = $getSelection();\n    if (selection) {\n      if (!($isTableSelection(selection) || $isRangeSelection(selection))) {\n        return false;\n      }\n      // Copying to the clipboard is async so we must capture the data\n      // before we delete it\n      void copyToClipboard(editor, objectKlassEquals(event, ClipboardEvent) ? event : null, $getClipboardDataFromSelection(selection));\n      const intercepted = $deleteCellHandler(event);\n      if ($isRangeSelection(selection)) {\n        selection.removeText();\n        return true;\n      }\n      return intercepted;\n    }\n    return false;\n  }, COMMAND_PRIORITY_HIGH));\n  tableObserver.listenersToRemove.add(editor.registerCommand(FORMAT_TEXT_COMMAND, payload => {\n    const selection = $getSelection();\n    if (!$isSelectionInTable(selection, tableNode)) {\n      return false;\n    }\n    if ($isTableSelection(selection)) {\n      tableObserver.$formatCells(payload);\n      return true;\n    } else if ($isRangeSelection(selection)) {\n      const tableCellNode = $findMatchingParent(selection.anchor.getNode(), n => $isTableCellNode(n));\n      if (!$isTableCellNode(tableCellNode)) {\n        return false;\n      }\n    }\n    return false;\n  }, COMMAND_PRIORITY_HIGH));\n  tableObserver.listenersToRemove.add(editor.registerCommand(FORMAT_ELEMENT_COMMAND, formatType => {\n    const selection = $getSelection();\n    if (!$isTableSelection(selection) || !$isSelectionInTable(selection, tableNode)) {\n      return false;\n    }\n    const anchorNode = selection.anchor.getNode();\n    const focusNode = selection.focus.getNode();\n    if (!$isTableCellNode(anchorNode) || !$isTableCellNode(focusNode)) {\n      return false;\n    }\n\n    // Align the table if the entire table is selected\n    if ($isFullTableSelection(selection, tableNode)) {\n      tableNode.setFormat(formatType);\n      return true;\n    }\n    const [tableMap, anchorCell, focusCell] = $computeTableMap(tableNode, anchorNode, focusNode);\n    const maxRow = Math.max(anchorCell.startRow + anchorCell.cell.__rowSpan - 1, focusCell.startRow + focusCell.cell.__rowSpan - 1);\n    const maxColumn = Math.max(anchorCell.startColumn + anchorCell.cell.__colSpan - 1, focusCell.startColumn + focusCell.cell.__colSpan - 1);\n    const minRow = Math.min(anchorCell.startRow, focusCell.startRow);\n    const minColumn = Math.min(anchorCell.startColumn, focusCell.startColumn);\n    const visited = new Set();\n    for (let i = minRow; i <= maxRow; i++) {\n      for (let j = minColumn; j <= maxColumn; j++) {\n        const cell = tableMap[i][j].cell;\n        if (visited.has(cell)) {\n          continue;\n        }\n        visited.add(cell);\n        cell.setFormat(formatType);\n        const cellChildren = cell.getChildren();\n        for (let k = 0; k < cellChildren.length; k++) {\n          const child = cellChildren[k];\n          if ($isElementNode(child) && !child.isInline()) {\n            child.setFormat(formatType);\n          }\n        }\n      }\n    }\n    return true;\n  }, COMMAND_PRIORITY_HIGH));\n  tableObserver.listenersToRemove.add(editor.registerCommand(CONTROLLED_TEXT_INSERTION_COMMAND, payload => {\n    const selection = $getSelection();\n    if (!$isSelectionInTable(selection, tableNode)) {\n      return false;\n    }\n    if ($isTableSelection(selection)) {\n      tableObserver.$clearHighlight();\n      return false;\n    } else if ($isRangeSelection(selection)) {\n      const tableCellNode = $findMatchingParent(selection.anchor.getNode(), n => $isTableCellNode(n));\n      if (!$isTableCellNode(tableCellNode)) {\n        return false;\n      }\n      if (typeof payload === 'string') {\n        const edgePosition = $getTableEdgeCursorPosition(editor, selection, tableNode);\n        if (edgePosition) {\n          $insertParagraphAtTableEdge(edgePosition, tableNode, [$createTextNode(payload)]);\n          return true;\n        }\n      }\n    }\n    return false;\n  }, COMMAND_PRIORITY_HIGH));\n  if (hasTabHandler) {\n    tableObserver.listenersToRemove.add(editor.registerCommand(KEY_TAB_COMMAND, event => {\n      const selection = $getSelection();\n      if (!$isRangeSelection(selection) || !selection.isCollapsed() || !$isSelectionInTable(selection, tableNode)) {\n        return false;\n      }\n      const tableCellNode = $findCellNode(selection.anchor.getNode());\n      if (tableCellNode === null || !tableNode.is($findTableNode(tableCellNode))) {\n        return false;\n      }\n      stopEvent(event);\n      $selectAdjacentCell(tableCellNode, event.shiftKey ? 'previous' : 'next');\n      return true;\n    }, COMMAND_PRIORITY_HIGH));\n  }\n  tableObserver.listenersToRemove.add(editor.registerCommand(FOCUS_COMMAND, payload => {\n    return tableNode.isSelected();\n  }, COMMAND_PRIORITY_HIGH));\n  tableObserver.listenersToRemove.add(editor.registerCommand(INSERT_PARAGRAPH_COMMAND, () => {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection) || !selection.isCollapsed() || !$isSelectionInTable(selection, tableNode)) {\n      return false;\n    }\n    const edgePosition = $getTableEdgeCursorPosition(editor, selection, tableNode);\n    if (edgePosition) {\n      $insertParagraphAtTableEdge(edgePosition, tableNode);\n      return true;\n    }\n    return false;\n  }, COMMAND_PRIORITY_HIGH));\n  return tableObserver;\n}\n\n/** @internal */\nfunction $handleTableSelectionChangeCommand(tableObservers, editor) {\n  const selection = $getSelection();\n  const prevSelection = $getPreviousSelection();\n  const nextFocus = tableObservers.getAndClearNextFocus();\n  if (nextFocus !== null) {\n    const {\n      tableKey,\n      focusCell\n    } = nextFocus;\n    const observerAndTable = tableObservers.observers.get(tableKey);\n    if (!!!observerAndTable) {\n      formatDevErrorMessage(`tableObserver not found for tableKey: ${tableKey}`);\n    }\n    const [tableObserver] = observerAndTable;\n    if ($isTableSelection(selection) && selection.tableKey === tableObserver.tableNodeKey) {\n      if (focusCell.x === tableObserver.focusX && focusCell.y === tableObserver.focusY) {\n        // The selection is already the correct table selection\n        return false;\n      } else {\n        tableObserver.$setFocusCellForSelection(focusCell);\n        return true;\n      }\n    } else if (tableObserver.anchorCell !== null && tableObserver.anchorCellNodeKey !== null && focusCell.elem !== tableObserver.anchorCell.elem && tableObserver.tableSelection !== null) {\n      // The selection has crossed cells\n      // If we have an anchor cell set and tableSelection initialized,\n      // we have all the necessary state to create the selection.\n      // The presence of nextFocus means we're dragging, so process it.\n      // Use ignoreStart=true to ensure isHighlightingCells is set correctly\n      // on the first drag attempt, especially when switching columns.\n      tableObserver.$setFocusCellForSelection(focusCell, true);\n      return true;\n    }\n  }\n  const shouldCheckSelectionForTable = tableObservers.getAndClearShouldCheckSelectionForTable();\n  // If they pressed the down arrow with the selection outside of the\n  // table, and then the selection ends up in the table but not in the\n  // first cell, then move the selection to the first cell.\n  if (!!shouldCheckSelectionForTable && $isRangeSelection(prevSelection) && $isRangeSelection(selection) && selection.isCollapsed()) {\n    const tableNode = $getNodeByKeyOrThrow(shouldCheckSelectionForTable);\n    const anchor = selection.anchor.getNode();\n    const firstRow = tableNode.getFirstChild();\n    const anchorCell = $findCellNode(anchor);\n    if (anchorCell !== null && $isTableRowNode(firstRow)) {\n      const firstCell = firstRow.getFirstChild();\n      if ($isTableCellNode(firstCell) && tableNode.is($findMatchingParent(anchorCell, node => node.is(tableNode) || node.is(firstCell)))) {\n        // The selection moved to the table, but not in the first cell\n        firstCell.selectStart();\n        return true;\n      }\n    }\n  }\n  if ($isTableSelection(selection)) {\n    $fixTableSelectionForSelectedTable(editor, selection);\n  }\n  if ($isRangeSelection(selection)) {\n    $fixRangeSelectionForSelectedTable(selection, tableObservers);\n  }\n\n  // Generic selection logic that runs across every table observer when the selection changes.\n  // Note: the selection might have changed in the code above, which re-dispatches the selection change command\n  // and gets handled here on the second pass. This should be refactored.\n  const tableNodesAndObservers = Array.from(tableObservers.observers.entries()).map(([tableKey, [tableObserver]]) => ({\n    tableNode: $getNodeByKeyOrThrow(tableKey),\n    tableObserver\n  }));\n  for (const {\n    tableNode,\n    tableObserver\n  } of tableNodesAndObservers) {\n    $syncTableSelectionState(editor, tableNode, tableObserver);\n  }\n  return false;\n}\n\n/**\n * Handles cases where range selections cross into, out of, or within tables.\n */\nfunction $fixRangeSelectionForSelectedTable(selection, tableObservers) {\n  const prevSelection = $getPreviousSelection();\n  const {\n    anchor,\n    focus\n  } = selection;\n  const anchorNode = anchor.getNode();\n  const focusNode = focus.getNode();\n  // Using explicit comparison with table node to ensure it's not a nested table\n  // as in that case we'll leave selection resolving to that table\n  const anchorCellNode = $findCellNode(anchorNode);\n  const focusCellNode = $findCellNode(focusNode);\n  const anchorCellTable = anchorCellNode ? $findTableNode(anchorCellNode) : null;\n  const focusCellTable = focusCellNode ? $findTableNode(focusCellNode) : null;\n  const isBackward = selection.isBackward();\n  const isSameTable = anchorCellNode && focusCellNode && anchorCellTable && focusCellTable && anchorCellTable.is(focusCellTable);\n\n  // The focus should be moved (to cover the whole focus table) if it is moved outside of the anchor's table.\n  // For example, when dragging from outside a table into it.\n  const shouldMoveFocus = focusCellTable && (!anchorCellTable || anchorCellTable.isParentOf(focusCellTable));\n  // The anchor should be moved (to cover the whole anchor table) if the focus is moved outside of the anchor table.\n  // For example, when dragging from inside a table out of it.\n  const shouldMoveAnchor = anchorCellTable && (!focusCellTable || focusCellTable.isParentOf(anchorCellTable));\n  if (shouldMoveFocus) {\n    // Select the whole focus table.\n    const newSelection = selection.clone();\n    const [tableMap] = $computeTableMap(focusCellTable, focusCellNode, focusCellNode);\n    const firstCell = tableMap[0][0].cell;\n    const lastCell = tableMap[tableMap.length - 1].at(-1).cell;\n    newSelection.focus.set(isBackward ? firstCell.getKey() : lastCell.getKey(), isBackward ? 0 : lastCell.getChildrenSize(), 'element');\n    $setSelection(newSelection);\n  } else if (shouldMoveAnchor) {\n    // Select the whole anchor table.\n    const newSelection = selection.clone();\n    const [tableMap] = $computeTableMap(anchorCellTable, anchorCellNode, anchorCellNode);\n    const firstCell = tableMap[0][0].cell;\n    const lastCell = tableMap[tableMap.length - 1].at(-1).cell;\n    newSelection.anchor.set(isBackward ? lastCell.getKey() : firstCell.getKey(), isBackward ? lastCell.getChildrenSize() : 0, 'element');\n    $setSelection(newSelection);\n  } else if (isSameTable) {\n    // Handle case when selection spans across multiple cells but still\n    // has range selection, then we convert it into table selection\n    // For example, this fires when dragging up from first cell, outside of the table, or when clicking a cell\n    // then shift-clicking another cell.\n    const observerInfo = tableObservers.observers.get(anchorCellTable.getKey());\n    if (!!!observerInfo) {\n      formatDevErrorMessage(`tableObserver not found for tableKey: ${anchorCellTable.getKey()}`);\n    }\n    const [tableObserver] = observerInfo;\n    if (!anchorCellNode.is(focusCellNode)) {\n      tableObserver.$setAnchorCellForSelection($getObserverCellFromCellNodeOrThrow(tableObserver, anchorCellNode));\n      tableObserver.$setFocusCellForSelection($getObserverCellFromCellNodeOrThrow(tableObserver, focusCellNode), true);\n    }\n\n    // Handle case when the pointer type is touch and the current and\n    // previous selection are collapsed, and the previous anchor and current\n    // focus cell nodes are different, then we convert it into table selection\n    // However, only do this if the table observer is actively selecting (user dragging)\n    // to prevent unwanted selections when simply tapping between cells on mobile\n    if (tableObserver.pointerType === 'touch' && tableObserver.isSelecting && selection.isCollapsed() && $isRangeSelection(prevSelection) && prevSelection.isCollapsed()) {\n      const prevAnchorCellNode = $findCellNode(prevSelection.anchor.getNode());\n      if (prevAnchorCellNode && !prevAnchorCellNode.is(focusCellNode)) {\n        tableObserver.$setAnchorCellForSelection($getObserverCellFromCellNodeOrThrow(tableObserver, prevAnchorCellNode));\n        tableObserver.$setFocusCellForSelection($getObserverCellFromCellNodeOrThrow(tableObserver, focusCellNode), true);\n        tableObserver.pointerType = null;\n      }\n    }\n  }\n}\n\n/**\n * Ensures that a TableSelection is automatically changed to a RangeSelection when the selection goes outside of the table.\n */\nfunction $fixTableSelectionForSelectedTable(editor, selection) {\n  const editorWindow = getEditorWindow(editor);\n  const prevSelection = $getPreviousSelection();\n  if (!selection.is(prevSelection)) {\n    return;\n  }\n  const tableNode = $getNodeByKeyOrThrow(selection.tableKey);\n  // if selection goes outside of the table we need to change it to Range selection\n  const domSelection = getDOMSelection(editorWindow);\n  if (domSelection && domSelection.anchorNode && domSelection.focusNode) {\n    const focusNode = $getNearestNodeFromDOMNode(domSelection.focusNode);\n    const isFocusOutside = focusNode && !tableNode.isParentOf(focusNode);\n    const anchorNode = $getNearestNodeFromDOMNode(domSelection.anchorNode);\n    const isAnchorInside = anchorNode && tableNode.isParentOf(anchorNode);\n    if (isFocusOutside && isAnchorInside && domSelection.rangeCount > 0) {\n      const newSelection = $createRangeSelectionFromDom(domSelection, editor);\n      if (newSelection) {\n        newSelection.anchor.set(tableNode.getKey(), selection.isBackward() ? tableNode.getChildrenSize() : 0, 'element');\n        domSelection.removeAllRanges();\n        $setSelection(newSelection);\n      }\n    }\n  }\n}\n\n// Handle keeping the table observer/DOM in sync with the selection.\nfunction $syncTableSelectionState(editor, tableNode, tableObserver) {\n  const selection = $getSelection();\n  const prevSelection = $getPreviousSelection();\n  if (selection && !selection.is(prevSelection) && ($isTableSelection(selection) || $isTableSelection(prevSelection)) && tableObserver.tableSelection && !tableObserver.tableSelection.is(prevSelection)) {\n    if ($isTableSelection(selection) && selection.tableKey === tableObserver.tableNodeKey) {\n      tableObserver.$updateTableTableSelection(selection);\n    } else if (!$isTableSelection(selection) && $isTableSelection(prevSelection) && prevSelection.tableKey === tableObserver.tableNodeKey) {\n      tableObserver.$updateTableTableSelection(null);\n    }\n  }\n  if (tableObserver.hasHijackedSelectionStyles && !tableNode.isSelected()) {\n    $removeHighlightStyleToTable(editor, tableObserver);\n  } else if (!tableObserver.hasHijackedSelectionStyles && tableNode.isSelected()) {\n    $addHighlightStyleToTable(editor, tableObserver);\n  }\n}\nfunction detachTableObserverFromTableElement(tableElement, tableObserver) {\n  if (getTableObserverFromTableElement(tableElement) === tableObserver) {\n    delete tableElement[LEXICAL_ELEMENT_KEY];\n  }\n}\nfunction attachTableObserverToTableElement(tableElement, tableObserver) {\n  if (!(getTableObserverFromTableElement(tableElement) === null)) {\n    formatDevErrorMessage(`tableElement already has an attached TableObserver`);\n  }\n  tableElement[LEXICAL_ELEMENT_KEY] = tableObserver;\n}\nfunction getTableObserverFromTableElement(tableElement) {\n  return tableElement[LEXICAL_ELEMENT_KEY] || null;\n}\nfunction getTableObserverFromCellNode(node) {\n  const cellNode = getDOMCellFromTarget(node);\n  if (cellNode === null) {\n    return null;\n  }\n  let currentNode = cellNode.elem;\n  while (currentNode != null) {\n    const nodeName = currentNode.nodeName;\n    if (nodeName === 'TABLE' && LEXICAL_ELEMENT_KEY in currentNode && !!currentNode[LEXICAL_ELEMENT_KEY]) {\n      return {\n        cellElement: cellNode,\n        tableElement: currentNode,\n        tableObserver: currentNode[LEXICAL_ELEMENT_KEY]\n      };\n    }\n    currentNode = currentNode.parentNode;\n  }\n  return null;\n}\nfunction getDOMCellFromTarget(node) {\n  let currentNode = node;\n  while (currentNode != null) {\n    const nodeName = currentNode.nodeName;\n    if (nodeName === 'TD' || nodeName === 'TH') {\n      // @ts-expect-error: internal field\n      const cell = currentNode._cell;\n      if (cell === undefined) {\n        return null;\n      }\n      return cell;\n    }\n    currentNode = currentNode.parentNode;\n  }\n  return null;\n}\nfunction getDOMCellInTableFromTarget(table, node) {\n  if (!table.contains(node)) {\n    return null;\n  }\n  let cell = null;\n  for (let currentNode = node; currentNode != null; currentNode = currentNode.parentNode) {\n    if (currentNode === table) {\n      return cell;\n    }\n    const nodeName = currentNode.nodeName;\n    if (nodeName === 'TD' || nodeName === 'TH') {\n      // @ts-expect-error: internal field\n      cell = currentNode._cell || null;\n    }\n  }\n  return null;\n}\nfunction getTable(tableNode, dom) {\n  const tableElement = getTableElement(tableNode, dom);\n  const domRows = [];\n  const grid = {\n    columns: 0,\n    domRows,\n    rows: 0\n  };\n  let currentNode = tableElement.querySelector('tr');\n  let x = 0;\n  let y = 0;\n  domRows.length = 0;\n  while (currentNode != null) {\n    const nodeMame = currentNode.nodeName;\n    if (nodeMame === 'TD' || nodeMame === 'TH') {\n      const elem = currentNode;\n      const cell = {\n        elem,\n        hasBackgroundColor: elem.style.backgroundColor !== '',\n        highlighted: false,\n        x,\n        y\n      };\n\n      // @ts-expect-error: internal field\n      currentNode._cell = cell;\n      let row = domRows[y];\n      if (row === undefined) {\n        row = domRows[y] = [];\n      }\n      row[x] = cell;\n    } else {\n      const child = currentNode.firstChild;\n      if (child != null) {\n        currentNode = child;\n        continue;\n      }\n    }\n    const sibling = currentNode.nextSibling;\n    if (sibling != null) {\n      x++;\n      currentNode = sibling;\n      continue;\n    }\n    const parent = currentNode.parentNode;\n    if (parent != null) {\n      const parentSibling = parent.nextSibling;\n      if (parentSibling == null) {\n        break;\n      }\n      y++;\n      x = 0;\n      currentNode = parentSibling;\n    }\n  }\n  grid.columns = x + 1;\n  grid.rows = y + 1;\n  return grid;\n}\nfunction $updateDOMForSelection(editor, table, selection) {\n  const selectedCellNodes = new Set(selection ? selection.getNodes() : []);\n  $forEachTableCell(table, (cell, lexicalNode) => {\n    const elem = cell.elem;\n    if (selectedCellNodes.has(lexicalNode)) {\n      cell.highlighted = true;\n      $addHighlightToDOM(editor, cell);\n    } else {\n      cell.highlighted = false;\n      $removeHighlightFromDOM(editor, cell);\n      if (!elem.getAttribute('style')) {\n        elem.removeAttribute('style');\n      }\n    }\n  });\n}\nfunction $forEachTableCell(grid, cb) {\n  const {\n    domRows\n  } = grid;\n  for (let y = 0; y < domRows.length; y++) {\n    const row = domRows[y];\n    if (!row) {\n      continue;\n    }\n    for (let x = 0; x < row.length; x++) {\n      const cell = row[x];\n      if (!cell) {\n        continue;\n      }\n      const lexicalNode = $getNearestNodeFromDOMNode(cell.elem);\n      if (lexicalNode !== null) {\n        cb(cell, lexicalNode, {\n          x,\n          y\n        });\n      }\n    }\n  }\n}\nfunction $addHighlightStyleToTable(editor, tableSelection) {\n  tableSelection.$disableHighlightStyle();\n  $forEachTableCell(tableSelection.table, cell => {\n    cell.highlighted = true;\n    $addHighlightToDOM(editor, cell);\n  });\n}\nfunction $removeHighlightStyleToTable(editor, tableObserver) {\n  tableObserver.$enableHighlightStyle();\n  $forEachTableCell(tableObserver.table, cell => {\n    const elem = cell.elem;\n    cell.highlighted = false;\n    $removeHighlightFromDOM(editor, cell);\n    if (!elem.getAttribute('style')) {\n      elem.removeAttribute('style');\n    }\n  });\n}\nfunction $selectAdjacentCell(tableCellNode, direction) {\n  const siblingMethod = direction === 'next' ? 'getNextSibling' : 'getPreviousSibling';\n  const childMethod = direction === 'next' ? 'getFirstChild' : 'getLastChild';\n  const sibling = tableCellNode[siblingMethod]();\n  if ($isElementNode(sibling)) {\n    return sibling.selectEnd();\n  }\n  const parentRow = $findMatchingParent(tableCellNode, $isTableRowNode);\n  if (!(parentRow !== null)) {\n    formatDevErrorMessage(`selectAdjacentCell: Cell not in table row`);\n  }\n  for (let nextRow = parentRow[siblingMethod](); $isTableRowNode(nextRow); nextRow = nextRow[siblingMethod]()) {\n    const child = nextRow[childMethod]();\n    if ($isElementNode(child)) {\n      return child.selectEnd();\n    }\n  }\n  const parentTable = $findMatchingParent(parentRow, $isTableNode);\n  if (!(parentTable !== null)) {\n    formatDevErrorMessage(`selectAdjacentCell: Row not in table`);\n  }\n  return direction === 'next' ? parentTable.selectNext() : parentTable.selectPrevious();\n}\nconst selectTableNodeInDirection = (tableObserver, tableNode, x, y, direction) => {\n  const isForward = direction === 'forward';\n  switch (direction) {\n    case 'backward':\n    case 'forward':\n      if (x !== (isForward ? tableObserver.table.columns - 1 : 0)) {\n        selectTableCellNode(tableNode.getCellNodeFromCordsOrThrow(x + (isForward ? 1 : -1), y, tableObserver.table), isForward);\n      } else {\n        if (y !== (isForward ? tableObserver.table.rows - 1 : 0)) {\n          selectTableCellNode(tableNode.getCellNodeFromCordsOrThrow(isForward ? 0 : tableObserver.table.columns - 1, y + (isForward ? 1 : -1), tableObserver.table), isForward);\n        } else if (!isForward) {\n          tableNode.selectPrevious();\n        } else {\n          tableNode.selectNext();\n        }\n      }\n      return true;\n    case 'up':\n      if (y !== 0) {\n        selectTableCellNode(tableNode.getCellNodeFromCordsOrThrow(x, y - 1, tableObserver.table), false);\n      } else {\n        tableNode.selectPrevious();\n      }\n      return true;\n    case 'down':\n      if (y !== tableObserver.table.rows - 1) {\n        selectTableCellNode(tableNode.getCellNodeFromCordsOrThrow(x, y + 1, tableObserver.table), true);\n      } else {\n        tableNode.selectNext();\n      }\n      return true;\n    default:\n      return false;\n  }\n};\nfunction getCorner(rect, cellValue) {\n  let colName;\n  let rowName;\n  if (cellValue.startColumn === rect.minColumn) {\n    colName = 'minColumn';\n  } else if (cellValue.startColumn + cellValue.cell.__colSpan - 1 === rect.maxColumn) {\n    colName = 'maxColumn';\n  } else {\n    return null;\n  }\n  if (cellValue.startRow === rect.minRow) {\n    rowName = 'minRow';\n  } else if (cellValue.startRow + cellValue.cell.__rowSpan - 1 === rect.maxRow) {\n    rowName = 'maxRow';\n  } else {\n    return null;\n  }\n  return [colName, rowName];\n}\nfunction getCornerOrThrow(rect, cellValue) {\n  const corner = getCorner(rect, cellValue);\n  if (!(corner !== null)) {\n    formatDevErrorMessage(`getCornerOrThrow: cell ${cellValue.cell.getKey()} is not at a corner of rect`);\n  }\n  return corner;\n}\nfunction oppositeCorner([colName, rowName]) {\n  return [colName === 'minColumn' ? 'maxColumn' : 'minColumn', rowName === 'minRow' ? 'maxRow' : 'minRow'];\n}\nfunction cellAtCornerOrThrow(tableMap, rect, [colName, rowName]) {\n  const rowNum = rect[rowName];\n  const rowMap = tableMap[rowNum];\n  if (!(rowMap !== undefined)) {\n    formatDevErrorMessage(`cellAtCornerOrThrow: ${rowName} = ${String(rowNum)} missing in tableMap`);\n  }\n  const colNum = rect[colName];\n  const cell = rowMap[colNum];\n  if (!(cell !== undefined)) {\n    formatDevErrorMessage(`cellAtCornerOrThrow: ${colName} = ${String(colNum)} missing in tableMap`);\n  }\n  return cell;\n}\nfunction $extractRectCorners(tableMap, anchorCellValue, newFocusCellValue) {\n  // We are sure that the focus now either contracts or expands the rect\n  // but both the anchor and focus might be moved to ensure a rectangle\n  // given a potentially ragged merge shape\n  const rect = $computeTableCellRectBoundary(tableMap, anchorCellValue, newFocusCellValue);\n  const anchorCorner = getCorner(rect, anchorCellValue);\n  if (anchorCorner) {\n    return [cellAtCornerOrThrow(tableMap, rect, anchorCorner), cellAtCornerOrThrow(tableMap, rect, oppositeCorner(anchorCorner))];\n  }\n  const newFocusCorner = getCorner(rect, newFocusCellValue);\n  if (newFocusCorner) {\n    return [cellAtCornerOrThrow(tableMap, rect, oppositeCorner(newFocusCorner)), cellAtCornerOrThrow(tableMap, rect, newFocusCorner)];\n  }\n  // TODO this doesn't have to be arbitrary, use the closest corner instead\n  const newAnchorCorner = ['minColumn', 'minRow'];\n  return [cellAtCornerOrThrow(tableMap, rect, newAnchorCorner), cellAtCornerOrThrow(tableMap, rect, oppositeCorner(newAnchorCorner))];\n}\nfunction $adjustFocusInDirection(tableObserver, tableMap, anchorCellValue, focusCellValue, direction) {\n  const rect = $computeTableCellRectBoundary(tableMap, anchorCellValue, focusCellValue);\n  const spans = $computeTableCellRectSpans(tableMap, rect);\n  const {\n    topSpan,\n    leftSpan,\n    bottomSpan,\n    rightSpan\n  } = spans;\n  const anchorCorner = getCornerOrThrow(rect, anchorCellValue);\n  const [focusColumn, focusRow] = oppositeCorner(anchorCorner);\n  let fCol = rect[focusColumn];\n  let fRow = rect[focusRow];\n  if (direction === 'forward') {\n    fCol += focusColumn === 'maxColumn' ? 1 : leftSpan;\n  } else if (direction === 'backward') {\n    fCol -= focusColumn === 'minColumn' ? 1 : rightSpan;\n  } else if (direction === 'down') {\n    fRow += focusRow === 'maxRow' ? 1 : topSpan;\n  } else if (direction === 'up') {\n    fRow -= focusRow === 'minRow' ? 1 : bottomSpan;\n  }\n  const targetRowMap = tableMap[fRow];\n  if (targetRowMap === undefined) {\n    return false;\n  }\n  const newFocusCellValue = targetRowMap[fCol];\n  if (newFocusCellValue === undefined) {\n    return false;\n  }\n  // We can be certain that anchorCellValue and newFocusCellValue are\n  // contained within the desired selection, but we are not certain if\n  // they need to be expanded or not to maintain a rectangular shape\n  const [finalAnchorCell, finalFocusCell] = $extractRectCorners(tableMap, anchorCellValue, newFocusCellValue);\n  const anchorDOM = $getObserverCellFromCellNodeOrThrow(tableObserver, finalAnchorCell.cell);\n  const focusDOM = $getObserverCellFromCellNodeOrThrow(tableObserver, finalFocusCell.cell);\n  tableObserver.$setAnchorCellForSelection(anchorDOM);\n  tableObserver.$setFocusCellForSelection(focusDOM, true);\n  return true;\n}\nfunction $isSelectionInTable(selection, tableNode) {\n  if ($isRangeSelection(selection) || $isTableSelection(selection)) {\n    // TODO this should probably return false if there's an unrelated\n    //      shadow root between the node and the table (e.g. another table,\n    //      collapsible, etc.)\n    const isAnchorInside = tableNode.isParentOf(selection.anchor.getNode());\n    const isFocusInside = tableNode.isParentOf(selection.focus.getNode());\n    return isAnchorInside && isFocusInside;\n  }\n  return false;\n}\nfunction $isFullTableSelection(selection, tableNode) {\n  if ($isTableSelection(selection)) {\n    const anchorNode = selection.anchor.getNode();\n    const focusNode = selection.focus.getNode();\n    if (tableNode && anchorNode && focusNode) {\n      const [map] = $computeTableMap(tableNode, anchorNode, focusNode);\n      return anchorNode.getKey() === map[0][0].cell.getKey() && focusNode.getKey() === map[map.length - 1].at(-1).cell.getKey();\n    }\n  }\n  return false;\n}\nfunction selectTableCellNode(tableCell, fromStart) {\n  if (fromStart) {\n    tableCell.selectStart();\n  } else {\n    tableCell.selectEnd();\n  }\n}\nfunction $addHighlightToDOM(editor, cell) {\n  const element = cell.elem;\n  const editorThemeClasses = editor._config.theme;\n  const node = $getNearestNodeFromDOMNode(element);\n  if (!$isTableCellNode(node)) {\n    formatDevErrorMessage(`Expected to find LexicalNode from Table Cell DOMNode`);\n  }\n  addClassNamesToElement(element, editorThemeClasses.tableCellSelected);\n}\nfunction $removeHighlightFromDOM(editor, cell) {\n  const element = cell.elem;\n  const node = $getNearestNodeFromDOMNode(element);\n  if (!$isTableCellNode(node)) {\n    formatDevErrorMessage(`Expected to find LexicalNode from Table Cell DOMNode`);\n  }\n  const editorThemeClasses = editor._config.theme;\n  removeClassNamesFromElement(element, editorThemeClasses.tableCellSelected);\n}\nfunction $findCellNode(node) {\n  const cellNode = $findMatchingParent(node, $isTableCellNode);\n  return $isTableCellNode(cellNode) ? cellNode : null;\n}\nfunction $findTableNode(node) {\n  const tableNode = $findMatchingParent(node, $isTableNode);\n  return $isTableNode(tableNode) ? tableNode : null;\n}\nfunction $getBlockParentIfFirstNode(node) {\n  for (let prevNode = node, currentNode = node; currentNode !== null; prevNode = currentNode, currentNode = currentNode.getParent()) {\n    if ($isElementNode(currentNode)) {\n      if (currentNode !== prevNode && currentNode.getFirstChild() !== prevNode) {\n        // Not the first child or the initial node\n        return null;\n      } else if (!currentNode.isInline()) {\n        return currentNode;\n      }\n    }\n  }\n  return null;\n}\nfunction $handleHorizontalArrowKeyRangeSelection(editor, event, selection, alter, isBackward, tableNode, tableObserver) {\n  const initialFocus = $caretFromPoint(selection.focus, isBackward ? 'previous' : 'next');\n  if ($isExtendableTextPointCaret(initialFocus)) {\n    return false;\n  }\n  let lastCaret = initialFocus;\n  // TableCellNode is the only shadow root we are interested in piercing so\n  // we find the last internal caret and then check its parent\n  for (const nextCaret of $extendCaretToRange(initialFocus).iterNodeCarets('shadowRoot')) {\n    if (!($isSiblingCaret(nextCaret) && $isElementNode(nextCaret.origin))) {\n      return false;\n    }\n    lastCaret = nextCaret;\n  }\n  const lastCaretParent = lastCaret.getParentAtCaret();\n  if (!$isTableCellNode(lastCaretParent)) {\n    return false;\n  }\n  const anchorCell = lastCaretParent;\n  const focusCaret = $findNextTableCell($getSiblingCaret(anchorCell, lastCaret.direction));\n  const anchorCellTable = $findMatchingParent(anchorCell, $isTableNode);\n  if (!(anchorCellTable && anchorCellTable.is(tableNode))) {\n    return false;\n  }\n  const anchorCellDOM = editor.getElementByKey(anchorCell.getKey());\n  const anchorDOMCell = getDOMCellFromTarget(anchorCellDOM);\n  if (!anchorCellDOM || !anchorDOMCell) {\n    return false;\n  }\n  const anchorCellTableElement = $getElementForTableNode(editor, anchorCellTable);\n  tableObserver.table = anchorCellTableElement;\n  if (!focusCaret) {\n    if (alter === 'extend') {\n      // extend the selection from a range inside the cell to a table selection of the cell\n      tableObserver.$setAnchorCellForSelection(anchorDOMCell);\n      tableObserver.$setFocusCellForSelection(anchorDOMCell, true);\n    } else {\n      // exit the table\n      const outerFocusCaret = $getTableExitCaret($getSiblingCaret(anchorCellTable, initialFocus.direction));\n      $setPointFromCaret(selection.anchor, outerFocusCaret);\n      $setPointFromCaret(selection.focus, outerFocusCaret);\n    }\n  } else if (alter === 'extend') {\n    const focusDOMCell = getDOMCellFromTarget(editor.getElementByKey(focusCaret.origin.getKey()));\n    if (!focusDOMCell) {\n      return false;\n    }\n    tableObserver.$setAnchorCellForSelection(anchorDOMCell);\n    tableObserver.$setFocusCellForSelection(focusDOMCell, true);\n  } else {\n    // alter === 'move'\n    const innerFocusCaret = $normalizeCaret(focusCaret);\n    $setPointFromCaret(selection.anchor, innerFocusCaret);\n    $setPointFromCaret(selection.focus, innerFocusCaret);\n  }\n  stopEvent(event);\n  return true;\n}\nfunction $getTableExitCaret(initialCaret) {\n  const adjacent = $getAdjacentChildCaret(initialCaret);\n  return $isChildCaret(adjacent) ? $normalizeCaret(adjacent) : initialCaret;\n}\nfunction $findNextTableCell(initialCaret) {\n  for (const nextCaret of $extendCaretToRange(initialCaret).iterNodeCarets('root')) {\n    const {\n      origin\n    } = nextCaret;\n    if ($isTableCellNode(origin)) {\n      // not sure why ts isn't narrowing here (even if the guard is on nextCaret.origin)\n      // but returning a new caret is fine\n      if ($isChildCaret(nextCaret)) {\n        return $getChildCaret(origin, initialCaret.direction);\n      }\n    } else if (!$isTableRowNode(origin)) {\n      break;\n    }\n  }\n  return null;\n}\nfunction $handleArrowKey(editor, event, direction, tableNode, tableObserver, tableObservers) {\n  if ((direction === 'up' || direction === 'down') && isTypeaheadMenuInView(editor)) {\n    return false;\n  }\n  const selection = $getSelection();\n  if (!$isSelectionInTable(selection, tableNode)) {\n    if ($isRangeSelection(selection)) {\n      if (direction === 'backward') {\n        if (selection.focus.offset > 0) {\n          return false;\n        }\n        const parentNode = $getBlockParentIfFirstNode(selection.focus.getNode());\n        if (!parentNode) {\n          return false;\n        }\n        const siblingNode = parentNode.getPreviousSibling();\n        if (!$isTableNode(siblingNode)) {\n          return false;\n        }\n        stopEvent(event);\n        if (event.shiftKey) {\n          selection.focus.set(siblingNode.getParentOrThrow().getKey(), siblingNode.getIndexWithinParent(), 'element');\n        } else {\n          siblingNode.selectEnd();\n        }\n        return true;\n      } else if (event.shiftKey && (direction === 'up' || direction === 'down')) {\n        const focusNode = selection.focus.getNode();\n        const isTableUnselect = !selection.isCollapsed() && (direction === 'up' && !selection.isBackward() || direction === 'down' && selection.isBackward());\n        if (isTableUnselect) {\n          let focusParentNode = $findMatchingParent(focusNode, n => $isTableNode(n));\n          if ($isTableCellNode(focusParentNode)) {\n            focusParentNode = $findMatchingParent(focusParentNode, $isTableNode);\n          }\n          if (focusParentNode !== tableNode) {\n            return false;\n          }\n          if (!focusParentNode) {\n            return false;\n          }\n          const sibling = direction === 'down' ? focusParentNode.getNextSibling() : focusParentNode.getPreviousSibling();\n          if (!sibling) {\n            return false;\n          }\n          let newOffset = 0;\n          if (direction === 'up') {\n            if ($isElementNode(sibling)) {\n              newOffset = sibling.getChildrenSize();\n            }\n          }\n          let newFocusNode = sibling;\n          if (direction === 'up') {\n            if ($isElementNode(sibling)) {\n              const lastCell = sibling.getLastChild();\n              newFocusNode = lastCell ? lastCell : sibling;\n              newOffset = $isTextNode(newFocusNode) ? newFocusNode.getTextContentSize() : 0;\n            }\n          }\n          const newSelection = selection.clone();\n          newSelection.focus.set(newFocusNode.getKey(), newOffset, $isTextNode(newFocusNode) ? 'text' : 'element');\n          $setSelection(newSelection);\n          stopEvent(event);\n          return true;\n        } else if ($isRootOrShadowRoot(focusNode)) {\n          const selectedNode = direction === 'up' ? selection.getNodes()[selection.getNodes().length - 1] : selection.getNodes()[0];\n          if (selectedNode) {\n            const tableCellNode = $findParentTableCellNodeInTable(tableNode, selectedNode);\n            if (tableCellNode !== null) {\n              const firstDescendant = tableNode.getFirstDescendant();\n              const lastDescendant = tableNode.getLastDescendant();\n              if (!firstDescendant || !lastDescendant) {\n                return false;\n              }\n              const [firstCellNode] = $getNodeTriplet(firstDescendant);\n              const [lastCellNode] = $getNodeTriplet(lastDescendant);\n              const firstCellCoords = tableNode.getCordsFromCellNode(firstCellNode, tableObserver.table);\n              const lastCellCoords = tableNode.getCordsFromCellNode(lastCellNode, tableObserver.table);\n              const firstCellDOM = tableNode.getDOMCellFromCordsOrThrow(firstCellCoords.x, firstCellCoords.y, tableObserver.table);\n              const lastCellDOM = tableNode.getDOMCellFromCordsOrThrow(lastCellCoords.x, lastCellCoords.y, tableObserver.table);\n              tableObserver.$setAnchorCellForSelection(firstCellDOM);\n              tableObserver.$setFocusCellForSelection(lastCellDOM, true);\n              return true;\n            }\n          }\n          return false;\n        } else {\n          let focusParentNode = $findMatchingParent(focusNode, n => $isElementNode(n) && !n.isInline());\n          if ($isTableCellNode(focusParentNode)) {\n            focusParentNode = $findMatchingParent(focusParentNode, $isTableNode);\n          }\n          if (!focusParentNode) {\n            return false;\n          }\n          const sibling = direction === 'down' ? focusParentNode.getNextSibling() : focusParentNode.getPreviousSibling();\n          if ($isTableNode(sibling) && tableObserver.tableNodeKey === sibling.getKey()) {\n            const firstDescendant = sibling.getFirstDescendant();\n            const lastDescendant = sibling.getLastDescendant();\n            if (!firstDescendant || !lastDescendant) {\n              return false;\n            }\n            const [firstCellNode] = $getNodeTriplet(firstDescendant);\n            const [lastCellNode] = $getNodeTriplet(lastDescendant);\n            const newSelection = selection.clone();\n            newSelection.focus.set((direction === 'up' ? firstCellNode : lastCellNode).getKey(), direction === 'up' ? 0 : lastCellNode.getChildrenSize(), 'element');\n            stopEvent(event);\n            $setSelection(newSelection);\n            return true;\n          }\n        }\n      }\n    }\n    if (direction === 'down' && $isScrollableTablesActive(editor)) {\n      // Enable Firefox workaround\n      tableObservers.setShouldCheckSelectionForTable(tableNode.getKey());\n    }\n    return false;\n  }\n  if ($isRangeSelection(selection)) {\n    if (direction === 'backward' || direction === 'forward') {\n      const alter = event.shiftKey ? 'extend' : 'move';\n      return $handleHorizontalArrowKeyRangeSelection(editor, event, selection, alter, direction === 'backward', tableNode, tableObserver);\n    }\n    if (selection.isCollapsed()) {\n      const {\n        anchor,\n        focus\n      } = selection;\n      const anchorCellNode = $findMatchingParent(anchor.getNode(), $isTableCellNode);\n      const focusCellNode = $findMatchingParent(focus.getNode(), $isTableCellNode);\n      if (!$isTableCellNode(anchorCellNode) || !anchorCellNode.is(focusCellNode)) {\n        return false;\n      }\n      const anchorCellTable = $findTableNode(anchorCellNode);\n      if (anchorCellTable !== tableNode && anchorCellTable != null) {\n        const anchorCellTableElement = getTableElement(anchorCellTable, editor.getElementByKey(anchorCellTable.getKey()));\n        if (anchorCellTableElement != null) {\n          tableObserver.table = getTable(anchorCellTable, anchorCellTableElement);\n          return $handleArrowKey(editor, event, direction, anchorCellTable, tableObserver, tableObservers);\n        }\n      }\n      const anchorCellDom = editor.getElementByKey(anchorCellNode.__key);\n      const anchorDOM = editor.getElementByKey(anchor.key);\n      if (anchorDOM == null || anchorCellDom == null) {\n        return false;\n      }\n      let edgeSelectionRect;\n      if (anchor.type === 'element') {\n        edgeSelectionRect = anchorDOM.getBoundingClientRect();\n      } else {\n        const domSelection = getDOMSelection(getEditorWindow(editor));\n        if (domSelection === null || domSelection.rangeCount === 0) {\n          return false;\n        }\n        const range = domSelection.getRangeAt(0);\n        edgeSelectionRect = range.getBoundingClientRect();\n      }\n      const edgeChild = direction === 'up' ? anchorCellNode.getFirstChild() : anchorCellNode.getLastChild();\n      if (edgeChild == null) {\n        return false;\n      }\n      const edgeChildDOM = editor.getElementByKey(edgeChild.__key);\n      if (edgeChildDOM == null) {\n        return false;\n      }\n      const edgeRect = edgeChildDOM.getBoundingClientRect();\n      const isExiting = direction === 'up' ? edgeRect.top > edgeSelectionRect.top - edgeSelectionRect.height : edgeSelectionRect.bottom + edgeSelectionRect.height > edgeRect.bottom;\n      if (isExiting) {\n        stopEvent(event);\n        const cords = tableNode.getCordsFromCellNode(anchorCellNode, tableObserver.table);\n        if (event.shiftKey) {\n          const cell = tableNode.getDOMCellFromCordsOrThrow(cords.x, cords.y, tableObserver.table);\n          tableObserver.$setAnchorCellForSelection(cell);\n          tableObserver.$setFocusCellForSelection(cell, true);\n        } else {\n          return selectTableNodeInDirection(tableObserver, tableNode, cords.x, cords.y, direction);\n        }\n        return true;\n      }\n    }\n  } else if ($isTableSelection(selection)) {\n    const {\n      anchor,\n      focus\n    } = selection;\n    const anchorCellNode = $findMatchingParent(anchor.getNode(), $isTableCellNode);\n    const focusCellNode = $findMatchingParent(focus.getNode(), $isTableCellNode);\n    const [tableNodeFromSelection] = selection.getNodes();\n    if (!$isTableNode(tableNodeFromSelection)) {\n      formatDevErrorMessage(`$handleArrowKey: TableSelection.getNodes()[0] expected to be TableNode`);\n    }\n    const tableElement = getTableElement(tableNodeFromSelection, editor.getElementByKey(tableNodeFromSelection.getKey()));\n    if (!$isTableCellNode(anchorCellNode) || !$isTableCellNode(focusCellNode) || !$isTableNode(tableNodeFromSelection) || tableElement == null) {\n      return false;\n    }\n    tableObserver.$updateTableTableSelection(selection);\n    const grid = getTable(tableNodeFromSelection, tableElement);\n    const cordsAnchor = tableNode.getCordsFromCellNode(anchorCellNode, grid);\n    const anchorCell = tableNode.getDOMCellFromCordsOrThrow(cordsAnchor.x, cordsAnchor.y, grid);\n    tableObserver.$setAnchorCellForSelection(anchorCell);\n    stopEvent(event);\n    if (event.shiftKey) {\n      const [tableMap, anchorValue, focusValue] = $computeTableMap(tableNode, anchorCellNode, focusCellNode);\n      return $adjustFocusInDirection(tableObserver, tableMap, anchorValue, focusValue, direction);\n    } else {\n      focusCellNode.selectEnd();\n    }\n    return true;\n  }\n  return false;\n}\nfunction stopEvent(event) {\n  event.preventDefault();\n  event.stopImmediatePropagation();\n  event.stopPropagation();\n}\nfunction isTypeaheadMenuInView(editor) {\n  // There is no inbuilt way to check if the component picker is in view\n  // but we can check if the root DOM element has the aria-controls attribute \"typeahead-menu\".\n  const root = editor.getRootElement();\n  if (!root) {\n    return false;\n  }\n  return root.hasAttribute('aria-controls') && root.getAttribute('aria-controls') === 'typeahead-menu';\n}\nfunction $insertParagraphAtTableEdge(edgePosition, tableNode, children) {\n  const paragraphNode = $createParagraphNode();\n  if (edgePosition === 'first') {\n    tableNode.insertBefore(paragraphNode);\n  } else {\n    tableNode.insertAfter(paragraphNode);\n  }\n  paragraphNode.append(...(children || []));\n  paragraphNode.selectEnd();\n}\nfunction $getTableEdgeCursorPosition(editor, selection, tableNode) {\n  const tableNodeParent = tableNode.getParent();\n  if (!tableNodeParent) {\n    return undefined;\n  }\n\n  // TODO: Add support for nested tables\n  const domSelection = getDOMSelection(getEditorWindow(editor));\n  if (!domSelection) {\n    return undefined;\n  }\n  const domAnchorNode = domSelection.anchorNode;\n  const tableNodeParentDOM = editor.getElementByKey(tableNodeParent.getKey());\n  const tableElement = getTableElement(tableNode, editor.getElementByKey(tableNode.getKey()));\n  // We are only interested in the scenario where the\n  // native selection anchor is:\n  // - at or inside the table's parent DOM\n  // - and NOT at or inside the table DOM\n  // It may be adjacent to the table DOM (e.g. in a wrapper)\n  if (!domAnchorNode || !tableNodeParentDOM || !tableElement || !tableNodeParentDOM.contains(domAnchorNode) || tableElement.contains(domAnchorNode)) {\n    return undefined;\n  }\n  const anchorCellNode = $findMatchingParent(selection.anchor.getNode(), n => $isTableCellNode(n));\n  if (!anchorCellNode) {\n    return undefined;\n  }\n  const parentTable = $findMatchingParent(anchorCellNode, n => $isTableNode(n));\n  if (!$isTableNode(parentTable) || !parentTable.is(tableNode)) {\n    return undefined;\n  }\n  const [tableMap, cellValue] = $computeTableMap(tableNode, anchorCellNode, anchorCellNode);\n  const firstCell = tableMap[0][0];\n  const lastCell = tableMap[tableMap.length - 1][tableMap[0].length - 1];\n  const {\n    startRow,\n    startColumn\n  } = cellValue;\n  const isAtFirstCell = startRow === firstCell.startRow && startColumn === firstCell.startColumn;\n  const isAtLastCell = startRow === lastCell.startRow && startColumn === lastCell.startColumn;\n  if (isAtFirstCell) {\n    return 'first';\n  } else if (isAtLastCell) {\n    return 'last';\n  } else {\n    return undefined;\n  }\n}\nfunction $getObserverCellFromCellNodeOrThrow(tableObserver, tableCellNode) {\n  const {\n    tableNode\n  } = tableObserver.$lookup();\n  const currentCords = tableNode.getCordsFromCellNode(tableCellNode, tableObserver.table);\n  return tableNode.getDOMCellFromCordsOrThrow(currentCords.x, currentCords.y, tableObserver.table);\n}\nfunction $getNearestTableCellInTableFromDOMNode(tableNode, startingDOM, editorState) {\n  return $findParentTableCellNodeInTable(tableNode, $getNearestNodeFromDOMNode(startingDOM, editorState));\n}\n\nfunction isHTMLDivElement(element) {\n  return isHTMLElement$1(element) && element.nodeName === 'DIV';\n}\nfunction updateColgroup(dom, colCount, colWidths) {\n  const colGroup = dom.querySelector('colgroup');\n  if (!colGroup) {\n    return;\n  }\n  const cols = [];\n  for (let i = 0; i < colCount; i++) {\n    const col = document.createElement('col');\n    const width = colWidths && colWidths[i];\n    if (width) {\n      col.style.width = `${width}px`;\n    }\n    cols.push(col);\n  }\n  colGroup.replaceChildren(...cols);\n}\nfunction setRowStriping(dom, config, rowStriping) {\n  if (rowStriping) {\n    addClassNamesToElement(dom, config.theme.tableRowStriping);\n    dom.setAttribute('data-lexical-row-striping', 'true');\n  } else {\n    removeClassNamesFromElement(dom, config.theme.tableRowStriping);\n    dom.removeAttribute('data-lexical-row-striping');\n  }\n}\nfunction setFrozenColumns(dom, tableElement, config, frozenColumnCount) {\n  if (frozenColumnCount > 0) {\n    addClassNamesToElement(dom, config.theme.tableFrozenColumn);\n    tableElement.setAttribute('data-lexical-frozen-column', 'true');\n  } else {\n    removeClassNamesFromElement(dom, config.theme.tableFrozenColumn);\n    tableElement.removeAttribute('data-lexical-frozen-column');\n  }\n}\nfunction setFrozenRows(dom, tableElement, config, frozenRowCount) {\n  if (frozenRowCount > 0) {\n    addClassNamesToElement(dom, config.theme.tableFrozenRow);\n    tableElement.setAttribute('data-lexical-frozen-row', 'true');\n  } else {\n    removeClassNamesFromElement(dom, config.theme.tableFrozenRow);\n    tableElement.removeAttribute('data-lexical-frozen-row');\n  }\n}\nfunction alignTableElement(dom, config, formatType) {\n  if (!config.theme.tableAlignment) {\n    return;\n  }\n  const removeClasses = [];\n  const addClasses = [];\n  for (const format of ['center', 'right']) {\n    const classes = config.theme.tableAlignment[format];\n    if (!classes) {\n      continue;\n    }\n    (format === formatType ? addClasses : removeClasses).push(classes);\n  }\n  removeClassNamesFromElement(dom, ...removeClasses);\n  addClassNamesToElement(dom, ...addClasses);\n}\nconst scrollableEditors = new WeakSet();\nfunction $isScrollableTablesActive(editor = $getEditor()) {\n  return scrollableEditors.has(editor);\n}\nfunction setScrollableTablesActive(editor, active) {\n  if (active) {\n    if (!editor._config.theme.tableScrollableWrapper) {\n      console.warn('TableNode: hasHorizontalScroll is active but theme.tableScrollableWrapper is not defined.');\n    }\n    scrollableEditors.add(editor);\n  } else {\n    scrollableEditors.delete(editor);\n  }\n}\n\n/** @noInheritDoc */\nclass TableNode extends ElementNode {\n  /** @internal */\n  __rowStriping;\n  __frozenColumnCount;\n  __frozenRowCount;\n  __colWidths;\n  static getType() {\n    return 'table';\n  }\n  getColWidths() {\n    const self = this.getLatest();\n    return self.__colWidths;\n  }\n  setColWidths(colWidths) {\n    const self = this.getWritable();\n    // NOTE: Node properties should be immutable. Freeze to prevent accidental mutation.\n    self.__colWidths = colWidths !== undefined && true ? Object.freeze(colWidths) : colWidths;\n    return self;\n  }\n  static clone(node) {\n    return new TableNode(node.__key);\n  }\n  afterCloneFrom(prevNode) {\n    super.afterCloneFrom(prevNode);\n    this.__colWidths = prevNode.__colWidths;\n    this.__rowStriping = prevNode.__rowStriping;\n    this.__frozenColumnCount = prevNode.__frozenColumnCount;\n    this.__frozenRowCount = prevNode.__frozenRowCount;\n  }\n  static importDOM() {\n    return {\n      table: _node => ({\n        conversion: $convertTableElement,\n        priority: 1\n      })\n    };\n  }\n  static importJSON(serializedNode) {\n    return $createTableNode().updateFromJSON(serializedNode);\n  }\n  updateFromJSON(serializedNode) {\n    return super.updateFromJSON(serializedNode).setRowStriping(serializedNode.rowStriping || false).setFrozenColumns(serializedNode.frozenColumnCount || 0).setFrozenRows(serializedNode.frozenRowCount || 0).setColWidths(serializedNode.colWidths);\n  }\n  constructor(key) {\n    super(key);\n    this.__rowStriping = false;\n    this.__frozenColumnCount = 0;\n    this.__frozenRowCount = 0;\n    this.__colWidths = undefined;\n  }\n  exportJSON() {\n    return {\n      ...super.exportJSON(),\n      colWidths: this.getColWidths(),\n      frozenColumnCount: this.__frozenColumnCount ? this.__frozenColumnCount : undefined,\n      frozenRowCount: this.__frozenRowCount ? this.__frozenRowCount : undefined,\n      rowStriping: this.__rowStriping ? this.__rowStriping : undefined\n    };\n  }\n  extractWithChild(child, selection, destination) {\n    return destination === 'html';\n  }\n  getDOMSlot(element) {\n    const tableElement = !isHTMLTableElement(element) ? element.querySelector('table') : element;\n    if (!isHTMLTableElement(tableElement)) {\n      formatDevErrorMessage(`TableNode.getDOMSlot: createDOM() did not return a table`);\n    }\n    return super.getDOMSlot(element).withElement(tableElement).withAfter(tableElement.querySelector('colgroup'));\n  }\n  createDOM(config, editor) {\n    const tableElement = document.createElement('table');\n    if (this.__style) {\n      setDOMStyleFromCSS(tableElement.style, this.__style);\n    }\n    const colGroup = document.createElement('colgroup');\n    tableElement.appendChild(colGroup);\n    setDOMUnmanaged(colGroup);\n    addClassNamesToElement(tableElement, config.theme.table);\n    this.updateTableElement(null, tableElement, config);\n    if ($isScrollableTablesActive(editor)) {\n      const wrapperElement = document.createElement('div');\n      const classes = config.theme.tableScrollableWrapper;\n      if (classes) {\n        addClassNamesToElement(wrapperElement, classes);\n      } else {\n        wrapperElement.style.overflowX = 'auto';\n      }\n      wrapperElement.appendChild(tableElement);\n      this.updateTableWrapper(null, wrapperElement, tableElement, config);\n      return wrapperElement;\n    }\n    return tableElement;\n  }\n  updateTableWrapper(prevNode, tableWrapper, tableElement, config) {\n    if (this.__frozenColumnCount !== (prevNode ? prevNode.__frozenColumnCount : 0)) {\n      setFrozenColumns(tableWrapper, tableElement, config, this.__frozenColumnCount);\n    }\n    if (this.__frozenRowCount !== (prevNode ? prevNode.__frozenRowCount : 0)) {\n      setFrozenRows(tableWrapper, tableElement, config, this.__frozenRowCount);\n    }\n  }\n  updateTableElement(prevNode, tableElement, config) {\n    if (this.__style !== (prevNode ? prevNode.__style : '')) {\n      setDOMStyleFromCSS(tableElement.style, this.__style, prevNode ? prevNode.__style : '');\n    }\n    if (this.__rowStriping !== (prevNode ? prevNode.__rowStriping : false)) {\n      setRowStriping(tableElement, config, this.__rowStriping);\n    }\n    const prevColCount = prevNode ? prevNode.getColumnCount() : 0;\n    const prevColWidths = prevNode ? prevNode.__colWidths : undefined;\n    if (this.getColumnCount() !== prevColCount || this.getColWidths() !== prevColWidths) {\n      updateColgroup(tableElement, this.getColumnCount(), this.getColWidths());\n    }\n    alignTableElement(tableElement, config, this.getFormatType());\n  }\n  updateDOM(prevNode, dom, config) {\n    const tableElement = getTableElement(this, dom);\n    if (dom === tableElement === $isScrollableTablesActive()) {\n      return true;\n    }\n    if (isHTMLDivElement(dom)) {\n      this.updateTableWrapper(prevNode, dom, tableElement, config);\n    }\n    this.updateTableElement(prevNode, tableElement, config);\n    return false;\n  }\n  scaleDOMColWidths(dom, scale) {\n    const colWidths = this.getColWidths();\n    if (!colWidths) {\n      return;\n    }\n    const tableElement = getTableElement(this, dom);\n    updateColgroup(tableElement, this.getColumnCount(), colWidths.map(width => width * scale));\n  }\n  exportDOM(editor) {\n    const superExport = super.exportDOM(editor);\n    const {\n      element\n    } = superExport;\n    return {\n      after: tableElement => {\n        if (superExport.after) {\n          tableElement = superExport.after(tableElement);\n        }\n        if (!isHTMLTableElement(tableElement) && isHTMLElement$1(tableElement)) {\n          tableElement = tableElement.querySelector('table');\n        }\n        if (!isHTMLTableElement(tableElement)) {\n          return null;\n        }\n        alignTableElement(tableElement, editor._config, this.getFormatType());\n\n        // Scan the table map to build a map of table cell key to the columns it needs\n        const [tableMap] = $computeTableMapSkipCellCheck(this, null, null);\n        const cellValues = new Map();\n        for (const mapRow of tableMap) {\n          for (const mapValue of mapRow) {\n            const key = mapValue.cell.getKey();\n            if (!cellValues.has(key)) {\n              cellValues.set(key, {\n                colSpan: mapValue.cell.getColSpan(),\n                startColumn: mapValue.startColumn\n              });\n            }\n          }\n        }\n\n        // scan the DOM to find the table cell keys that were used and mark those columns\n        const knownColumns = new Set();\n        for (const cellDOM of tableElement.querySelectorAll(':scope > tr > [data-temporary-table-cell-lexical-key]')) {\n          const key = cellDOM.getAttribute('data-temporary-table-cell-lexical-key');\n          if (key) {\n            const cellSpan = cellValues.get(key);\n            cellDOM.removeAttribute('data-temporary-table-cell-lexical-key');\n            if (cellSpan) {\n              cellValues.delete(key);\n              for (let i = 0; i < cellSpan.colSpan; i++) {\n                knownColumns.add(i + cellSpan.startColumn);\n              }\n            }\n          }\n        }\n\n        // Compute the colgroup and columns in the export\n        const colGroup = tableElement.querySelector(':scope > colgroup');\n        if (colGroup) {\n          // Only include the <col /> for rows that are in the output\n          const cols = Array.from(tableElement.querySelectorAll(':scope > colgroup > col')).filter((dom, i) => knownColumns.has(i));\n          colGroup.replaceChildren(...cols);\n        }\n\n        // Wrap direct descendant rows in a tbody for export\n        const rows = tableElement.querySelectorAll(':scope > tr');\n        if (rows.length > 0) {\n          const tBody = document.createElement('tbody');\n          for (const row of rows) {\n            tBody.appendChild(row);\n          }\n          tableElement.append(tBody);\n        }\n        return tableElement;\n      },\n      element: !isHTMLTableElement(element) && isHTMLElement$1(element) ? element.querySelector('table') : element\n    };\n  }\n  canBeEmpty() {\n    return false;\n  }\n  isShadowRoot() {\n    return true;\n  }\n  getCordsFromCellNode(tableCellNode, table) {\n    const {\n      rows,\n      domRows\n    } = table;\n    for (let y = 0; y < rows; y++) {\n      const row = domRows[y];\n      if (row == null) {\n        continue;\n      }\n      for (let x = 0; x < row.length; x++) {\n        const cell = row[x];\n        if (cell == null) {\n          continue;\n        }\n        const {\n          elem\n        } = cell;\n        const cellNode = $getNearestTableCellInTableFromDOMNode(this, elem);\n        if (cellNode !== null && tableCellNode.is(cellNode)) {\n          return {\n            x,\n            y\n          };\n        }\n      }\n    }\n    throw new Error('Cell not found in table.');\n  }\n  getDOMCellFromCords(x, y, table) {\n    const {\n      domRows\n    } = table;\n    const row = domRows[y];\n    if (row == null) {\n      return null;\n    }\n    const index = x < row.length ? x : row.length - 1;\n    const cell = row[index];\n    if (cell == null) {\n      return null;\n    }\n    return cell;\n  }\n  getDOMCellFromCordsOrThrow(x, y, table) {\n    const cell = this.getDOMCellFromCords(x, y, table);\n    if (!cell) {\n      throw new Error('Cell not found at cords.');\n    }\n    return cell;\n  }\n  getCellNodeFromCords(x, y, table) {\n    const cell = this.getDOMCellFromCords(x, y, table);\n    if (cell == null) {\n      return null;\n    }\n    const node = $getNearestNodeFromDOMNode(cell.elem);\n    if ($isTableCellNode(node)) {\n      return node;\n    }\n    return null;\n  }\n  getCellNodeFromCordsOrThrow(x, y, table) {\n    const node = this.getCellNodeFromCords(x, y, table);\n    if (!node) {\n      throw new Error('Node at cords not TableCellNode.');\n    }\n    return node;\n  }\n  getRowStriping() {\n    return Boolean(this.getLatest().__rowStriping);\n  }\n  setRowStriping(newRowStriping) {\n    const self = this.getWritable();\n    self.__rowStriping = newRowStriping;\n    return self;\n  }\n  setFrozenColumns(columnCount) {\n    const self = this.getWritable();\n    self.__frozenColumnCount = columnCount;\n    return self;\n  }\n  getFrozenColumns() {\n    return this.getLatest().__frozenColumnCount;\n  }\n  setFrozenRows(rowCount) {\n    const self = this.getWritable();\n    self.__frozenRowCount = rowCount;\n    return self;\n  }\n  getFrozenRows() {\n    return this.getLatest().__frozenRowCount;\n  }\n  canSelectBefore() {\n    return true;\n  }\n  canIndent() {\n    return false;\n  }\n  getColumnCount() {\n    const firstRow = this.getFirstChild();\n    if (!firstRow) {\n      return 0;\n    }\n    let columnCount = 0;\n    firstRow.getChildren().forEach(cell => {\n      if ($isTableCellNode(cell)) {\n        columnCount += cell.getColSpan();\n      }\n    });\n    return columnCount;\n  }\n}\nfunction $getElementForTableNode(editor, tableNode) {\n  const tableElement = editor.getElementByKey(tableNode.getKey());\n  if (!(tableElement !== null)) {\n    formatDevErrorMessage(`$getElementForTableNode: Table Element Not Found`);\n  }\n  return getTable(tableNode, tableElement);\n}\nfunction $convertTableElement(domNode) {\n  const tableNode = $createTableNode();\n  if (domNode.hasAttribute('data-lexical-row-striping')) {\n    tableNode.setRowStriping(true);\n  }\n  if (domNode.hasAttribute('data-lexical-frozen-column')) {\n    tableNode.setFrozenColumns(1);\n  }\n  if (domNode.hasAttribute('data-lexical-frozen-row')) {\n    tableNode.setFrozenRows(1);\n  }\n  const colGroup = domNode.querySelector(':scope > colgroup');\n  if (colGroup) {\n    let columns = [];\n    for (const col of colGroup.querySelectorAll(':scope > col')) {\n      let width = col.style.width || '';\n      if (!PIXEL_VALUE_REG_EXP.test(width)) {\n        // Also support deprecated width attribute for google docs\n        width = col.getAttribute('width') || '';\n        if (!/^\\d+$/.test(width)) {\n          columns = undefined;\n          break;\n        }\n      }\n      columns.push(parseFloat(width));\n    }\n    if (columns) {\n      tableNode.setColWidths(columns);\n    }\n  }\n  return {\n    after: children => $descendantsMatching(children, $isTableRowNode),\n    node: tableNode\n  };\n}\nfunction $createTableNode() {\n  return $applyNodeReplacement(new TableNode());\n}\nfunction $isTableNode(node) {\n  return node instanceof TableNode;\n}\n\nfunction $insertTable({\n  rows,\n  columns,\n  includeHeaders\n}, hasNestedTables) {\n  const selection = $getSelection() || $getPreviousSelection();\n  if (!selection || !$isRangeSelection(selection)) {\n    return false;\n  }\n\n  // Prevent nested tables by checking if we're already inside a table\n  if (!hasNestedTables && $findTableNode(selection.anchor.getNode())) {\n    return false;\n  }\n  const tableNode = $createTableNodeWithDimensions(Number(rows), Number(columns), includeHeaders);\n  $insertNodeToNearestRoot(tableNode);\n  const firstDescendant = tableNode.getFirstDescendant();\n  if ($isTextNode(firstDescendant)) {\n    firstDescendant.select();\n  }\n  return true;\n}\nfunction $tableCellTransform(node) {\n  if (!$isTableRowNode(node.getParent())) {\n    // TableCellNode must be a child of TableRowNode.\n    node.remove();\n  } else if (node.isEmpty()) {\n    // TableCellNode should never be empty\n    node.append($createParagraphNode());\n  }\n}\nfunction $tableRowTransform(node) {\n  if (!$isTableNode(node.getParent())) {\n    // TableRowNode must be a child of TableNode.\n    // TODO: Future support of tbody/thead/tfoot may change this\n    node.remove();\n  } else {\n    $unwrapAndFilterDescendants(node, $isTableCellNode);\n  }\n}\nfunction $tableTransform(node) {\n  // TableRowNode is the only valid child for TableNode\n  // TODO: Future support of tbody/thead/tfoot/caption may change this\n  $unwrapAndFilterDescendants(node, $isTableRowNode);\n  const [gridMap] = $computeTableMapSkipCellCheck(node, null, null);\n  const maxRowLength = gridMap.reduce((curLength, row) => {\n    return Math.max(curLength, row.length);\n  }, 0);\n  const rowNodes = node.getChildren();\n  for (let i = 0; i < gridMap.length; ++i) {\n    const rowNode = rowNodes[i];\n    if (!rowNode) {\n      continue;\n    }\n    if (!$isTableRowNode(rowNode)) {\n      formatDevErrorMessage(`TablePlugin: Expecting all children of TableNode to be TableRowNode, found ${rowNode.constructor.name} (type ${rowNode.getType()})`);\n    }\n    const rowLength = gridMap[i].reduce((acc, cell) => cell ? 1 + acc : acc, 0);\n    if (rowLength === maxRowLength) {\n      continue;\n    }\n    for (let j = rowLength; j < maxRowLength; ++j) {\n      // TODO: inherit header state from another header or body\n      const newCell = $createTableCellNode();\n      newCell.append($createParagraphNode());\n      rowNode.append(newCell);\n    }\n  }\n  const colWidths = node.getColWidths();\n  const columnCount = node.getColumnCount();\n  if (colWidths && colWidths.length !== columnCount) {\n    let newColWidths = undefined;\n    if (columnCount < colWidths.length) {\n      newColWidths = colWidths.slice(0, columnCount);\n    } else if (colWidths.length > 0) {\n      // Repeat the last column width.\n      const fillWidth = colWidths[colWidths.length - 1];\n      newColWidths = [...colWidths, ...Array(columnCount - colWidths.length).fill(fillWidth)];\n    }\n    node.setColWidths(newColWidths);\n  }\n}\nfunction $tableClickCommand(event) {\n  if (event.detail < 3 || !isDOMNode(event.target)) {\n    return false;\n  }\n  const startNode = $getNearestNodeFromDOMNode(event.target);\n  if (startNode === null) {\n    return false;\n  }\n  const blockNode = $findMatchingParent(startNode, node => $isElementNode(node) && !node.isInline());\n  if (blockNode === null) {\n    return false;\n  }\n  const rootNode = blockNode.getParent();\n  if (!$isTableCellNode(rootNode)) {\n    return false;\n  }\n  blockNode.select(0);\n  return true;\n}\nfunction $tableSelectAllCommand() {\n  const selection = $getSelection();\n  if (!$isRangeSelection(selection)) {\n    return false;\n  }\n\n  // Check if the selection is inside a table\n  const anchorNode = selection.anchor.getNode();\n  const tableNode = $findTableNode(anchorNode);\n  if (tableNode === null) {\n    return false;\n  }\n\n  // CRITICAL: Only intercept if table is the ONLY child of root\n  // This is required to reproduce the bug: table must be the only content, no empty paragraphs\n  // This prevents breaking other tests that expect RangeSelection when there's content outside table\n  const root = $getRoot();\n  if (!root.is(tableNode.getParent()) || root.getChildrenSize() !== 1) {\n    return false;\n  }\n\n  // At this point, table is the only child\n  // This is the exact scenario from issue #8074: table is the only content in editor\n\n  // Get the table map to find first and last cells (handles merged cells correctly)\n  const [tableMap] = $computeTableMapSkipCellCheck(tableNode, null, null);\n  if (tableMap.length === 0 || tableMap[0].length === 0) {\n    return false;\n  }\n\n  // Get the first cell (top-left)\n  const firstCellMap = tableMap[0][0];\n  if (!firstCellMap || !firstCellMap.cell) {\n    return false;\n  }\n\n  // Get the last cell (bottom-right)\n  const lastRow = tableMap[tableMap.length - 1];\n  const lastCellMap = lastRow[lastRow.length - 1];\n  if (!lastCellMap || !lastCellMap.cell) {\n    return false;\n  }\n\n  // Create a TableSelection that selects all cells\n  const tableSelection = $createTableSelectionFrom(tableNode, firstCellMap.cell, lastCellMap.cell);\n  $setSelection(tableSelection);\n  return true;\n}\n\n/**\n * Register a transform to ensure that all TableCellNode have a colSpan and rowSpan of 1.\n * This should only be registered when you do not want to support merged cells.\n *\n * @param editor The editor\n * @returns An unregister callback\n */\nfunction registerTableCellUnmergeTransform(editor) {\n  return editor.registerNodeTransform(TableCellNode, node => {\n    if (node.getColSpan() > 1 || node.getRowSpan() > 1) {\n      // When we have rowSpan we have to map the entire Table to understand where the new Cells\n      // fit best; let's analyze all Cells at once to save us from further transform iterations\n      const [,, gridNode] = $getNodeTriplet(node);\n      const [gridMap] = $computeTableMap(gridNode, node, node);\n      // TODO this function expects Tables to be normalized. Look into this once it exists\n      const rowsCount = gridMap.length;\n      const columnsCount = gridMap[0].length;\n      let row = gridNode.getFirstChild();\n      if (!$isTableRowNode(row)) {\n        formatDevErrorMessage(`Expected TableNode first child to be a RowNode`);\n      }\n      const unmerged = [];\n      for (let i = 0; i < rowsCount; i++) {\n        if (i !== 0) {\n          row = row.getNextSibling();\n          if (!$isTableRowNode(row)) {\n            formatDevErrorMessage(`Expected TableNode first child to be a RowNode`);\n          }\n        }\n        let lastRowCell = null;\n        for (let j = 0; j < columnsCount; j++) {\n          const cellMap = gridMap[i][j];\n          const cell = cellMap.cell;\n          if (cellMap.startRow === i && cellMap.startColumn === j) {\n            lastRowCell = cell;\n            unmerged.push(cell);\n          } else if (cell.getColSpan() > 1 || cell.getRowSpan() > 1) {\n            if (!$isTableCellNode(cell)) {\n              formatDevErrorMessage(`Expected TableNode cell to be a TableCellNode`);\n            }\n            const newCell = $createTableCellNode(cell.__headerState);\n            if (lastRowCell !== null) {\n              lastRowCell.insertAfter(newCell);\n            } else {\n              $insertFirst$1(row, newCell);\n            }\n          }\n        }\n      }\n      for (const cell of unmerged) {\n        cell.setColSpan(1);\n        cell.setRowSpan(1);\n      }\n    }\n  });\n}\nfunction registerTableSelectionObserver(editor, hasTabHandler = true) {\n  const tableObservers = new TableObservers();\n  const initializeTableNode = (tableNode, nodeKey, dom) => {\n    const tableElement = getTableElement(tableNode, dom);\n    const tableSelection = applyTableHandlers(tableNode, tableElement, editor, hasTabHandler, tableObservers);\n    tableObservers.observers.set(nodeKey, [tableSelection, tableElement]);\n  };\n  return mergeRegister(registerTableWindowHandlers(editor, tableObservers), editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {\n    return $handleTableSelectionChangeCommand(tableObservers, editor);\n  }, COMMAND_PRIORITY_HIGH), editor.registerMutationListener(TableNode, nodeMutations => {\n    editor.getEditorState().read(() => {\n      for (const [nodeKey, mutation] of nodeMutations) {\n        const tableSelection = tableObservers.observers.get(nodeKey);\n        if (mutation === 'created' || mutation === 'updated') {\n          const {\n            tableNode,\n            tableElement\n          } = $getTableAndElementByKey(nodeKey);\n          if (tableSelection === undefined) {\n            initializeTableNode(tableNode, nodeKey, tableElement);\n          } else if (tableElement !== tableSelection[1]) {\n            // The update created a new DOM node, destroy the existing TableObserver\n            tableSelection[0].removeListeners();\n            tableObservers.observers.delete(nodeKey);\n            initializeTableNode(tableNode, nodeKey, tableElement);\n          }\n        } else if (mutation === 'destroyed') {\n          if (tableSelection !== undefined) {\n            tableSelection[0].removeListeners();\n            tableObservers.observers.delete(nodeKey);\n          }\n        }\n      }\n    }, {\n      editor\n    });\n  }, {\n    skipInitialization: false\n  }), () => {\n    // Hook might be called multiple times so cleaning up tables listeners as well,\n    // as it'll be reinitialized during recurring call\n    for (const [, [tableSelection]] of tableObservers.observers) {\n      tableSelection.removeListeners();\n    }\n  });\n}\n\n/**\n * Register table command listeners and the table integrity transforms. The\n * table selection observer should be registered separately after this with\n * {@link registerTableSelectionObserver}.\n *\n * @param editor The editor\n * @returns An unregister callback\n */\nfunction registerTablePlugin(editor, options) {\n  if (!editor.hasNodes([TableNode])) {\n    {\n      formatDevErrorMessage(`TablePlugin: TableNode is not registered on editor`);\n    }\n  }\n  const {\n    hasNestedTables = signal(false)\n  } = options ?? {};\n  return mergeRegister(editor.registerCommand(INSERT_TABLE_COMMAND, payload => {\n    return $insertTable(payload, hasNestedTables.peek());\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, (payload, dispatchEditor) => {\n    if (editor !== dispatchEditor) {\n      return false;\n    }\n    return $tableSelectionInsertClipboardNodesCommand(payload, hasNestedTables);\n  }, COMMAND_PRIORITY_EDITOR), editor.registerCommand(SELECT_ALL_COMMAND, $tableSelectAllCommand, COMMAND_PRIORITY_LOW), editor.registerCommand(CLICK_COMMAND, $tableClickCommand, COMMAND_PRIORITY_EDITOR), editor.registerNodeTransform(TableNode, $tableTransform), editor.registerNodeTransform(TableRowNode, $tableRowTransform), editor.registerNodeTransform(TableCellNode, $tableCellTransform));\n}\nfunction $tableSelectionInsertClipboardNodesCommand(selectionPayload, hasNestedTables) {\n  const {\n    nodes,\n    selection\n  } = selectionPayload;\n  const hasTables = nodes.some(n => $isTableNode(n) || $dfs(n).some(d => $isTableNode(d.node)));\n  if (!hasTables) {\n    // Not pasting a table - no special handling required.\n    return false;\n  }\n  const isTableSelection = $isTableSelection(selection);\n  const isRangeSelection = $isRangeSelection(selection);\n  const isSelectionInsideOfGrid = isRangeSelection && $findMatchingParent(selection.anchor.getNode(), n => $isTableCellNode(n)) !== null && $findMatchingParent(selection.focus.getNode(), n => $isTableCellNode(n)) !== null || isTableSelection;\n  if (!isSelectionInsideOfGrid) {\n    // Not pasting in a grid - no special handling required.\n    return false;\n  }\n\n  // When pasting just a table, flatten the table on the destination table, even when nested tables are allowed.\n  if (nodes.length === 1 && $isTableNode(nodes[0])) {\n    return $insertTableIntoGrid(nodes[0], selection);\n  }\n\n  // If nested tables are enabled, allow pasting a table into a single cell.\n  if (isRangeSelection && hasNestedTables.peek() && !$isMultiCellTableSelection(selection)) {\n    return false;\n  }\n\n  // If we reached this point, there's a table in the selection and nested tables are not allowed - reject the paste.\n  return true;\n}\nfunction $insertTableIntoGrid(tableNode, selection) {\n  const anchorAndFocus = selection.getStartEndPoints();\n  const isTableSelection = $isTableSelection(selection);\n  if (anchorAndFocus === null) {\n    return false;\n  }\n  const [anchor, focus] = anchorAndFocus;\n  const [anchorCellNode, anchorRowNode, gridNode] = $getNodeTriplet(anchor);\n  const focusCellNode = $findMatchingParent(focus.getNode(), n => $isTableCellNode(n));\n  if (!$isTableCellNode(anchorCellNode) || !$isTableCellNode(focusCellNode) || !$isTableRowNode(anchorRowNode) || !$isTableNode(gridNode)) {\n    return false;\n  }\n  const [initialGridMap, anchorCellMap, focusCellMap] = $computeTableMap(gridNode, anchorCellNode, focusCellNode);\n  const [templateGridMap] = $computeTableMapSkipCellCheck(tableNode, null, null);\n  const initialRowCount = initialGridMap.length;\n  const initialColCount = initialRowCount > 0 ? initialGridMap[0].length : 0;\n\n  // If we have a range selection, we'll fit the template grid into the\n  // table, growing the table if necessary.\n  let startRow = anchorCellMap.startRow;\n  let startCol = anchorCellMap.startColumn;\n  let affectedRowCount = templateGridMap.length;\n  let affectedColCount = affectedRowCount > 0 ? templateGridMap[0].length : 0;\n  if (isTableSelection) {\n    // If we have a table selection, we'll only modify the cells within\n    // the selection boundary.\n    const selectionBoundary = $computeTableCellRectBoundary(initialGridMap, anchorCellMap, focusCellMap);\n    const selectionRowCount = selectionBoundary.maxRow - selectionBoundary.minRow + 1;\n    const selectionColCount = selectionBoundary.maxColumn - selectionBoundary.minColumn + 1;\n    startRow = selectionBoundary.minRow;\n    startCol = selectionBoundary.minColumn;\n    affectedRowCount = Math.min(affectedRowCount, selectionRowCount);\n    affectedColCount = Math.min(affectedColCount, selectionColCount);\n  }\n\n  // Step 1: Unmerge all merged cells within the affected area\n  let didPerformMergeOperations = false;\n  const lastRowForUnmerge = Math.min(initialRowCount, startRow + affectedRowCount) - 1;\n  const lastColForUnmerge = Math.min(initialColCount, startCol + affectedColCount) - 1;\n  const unmergedKeys = new Set();\n  for (let row = startRow; row <= lastRowForUnmerge; row++) {\n    for (let col = startCol; col <= lastColForUnmerge; col++) {\n      const cellMap = initialGridMap[row][col];\n      if (unmergedKeys.has(cellMap.cell.getKey())) {\n        continue; // cell was a merged cell that was already handled\n      }\n      if (cellMap.cell.__rowSpan === 1 && cellMap.cell.__colSpan === 1) {\n        continue; // cell is not a merged cell\n      }\n      $unmergeCellNode(cellMap.cell);\n      unmergedKeys.add(cellMap.cell.getKey());\n      didPerformMergeOperations = true;\n    }\n  }\n  let [interimGridMap] = $computeTableMapSkipCellCheck(gridNode.getWritable(), null, null);\n\n  // Step 2: Expand current table (if needed)\n  const rowsToInsert = affectedRowCount - initialRowCount + startRow;\n  for (let i = 0; i < rowsToInsert; i++) {\n    const cellMap = interimGridMap[initialRowCount - 1][0];\n    $insertTableRowAtNode(cellMap.cell);\n  }\n  const colsToInsert = affectedColCount - initialColCount + startCol;\n  for (let i = 0; i < colsToInsert; i++) {\n    const cellMap = interimGridMap[0][initialColCount - 1];\n    $insertTableColumnAtNode(cellMap.cell, true, false);\n  }\n  [interimGridMap] = $computeTableMapSkipCellCheck(gridNode.getWritable(), null, null);\n\n  // Step 3: Merge cells and set cell content, to match template grid\n  for (let row = startRow; row < startRow + affectedRowCount; row++) {\n    for (let col = startCol; col < startCol + affectedColCount; col++) {\n      const templateRow = row - startRow;\n      const templateCol = col - startCol;\n      const templateCellMap = templateGridMap[templateRow][templateCol];\n      if (templateCellMap.startRow !== templateRow || templateCellMap.startColumn !== templateCol) {\n        continue; // cell is a merged cell that was already handled\n      }\n      const templateCell = templateCellMap.cell;\n      if (templateCell.__rowSpan !== 1 || templateCell.__colSpan !== 1) {\n        const cellsToMerge = [];\n        const lastRowForMerge = Math.min(row + templateCell.__rowSpan, startRow + affectedRowCount) - 1;\n        const lastColForMerge = Math.min(col + templateCell.__colSpan, startCol + affectedColCount) - 1;\n        for (let r = row; r <= lastRowForMerge; r++) {\n          for (let c = col; c <= lastColForMerge; c++) {\n            const cellMap = interimGridMap[r][c];\n            cellsToMerge.push(cellMap.cell);\n          }\n        }\n        $mergeCells(cellsToMerge);\n        didPerformMergeOperations = true;\n      }\n      const {\n        cell\n      } = interimGridMap[row][col];\n      const backgroundColor = templateCell.getBackgroundColor();\n      if (backgroundColor !== null && backgroundColor !== undefined) {\n        cell.setBackgroundColor(backgroundColor);\n      }\n      const originalChildren = cell.getChildren();\n      templateCell.getChildren().forEach(child => {\n        if ($isTextNode(child)) {\n          const paragraphNode = $createParagraphNode();\n          paragraphNode.append(child);\n          cell.append(child);\n        } else {\n          cell.append(child);\n        }\n      });\n      originalChildren.forEach(n => n.remove());\n    }\n  }\n  if (isTableSelection && didPerformMergeOperations) {\n    // reset the table selection in case the anchor or focus cell was\n    // removed via merge operations\n    const [finalGridMap] = $computeTableMapSkipCellCheck(gridNode.getWritable(), null, null);\n    const newAnchorCellMap = finalGridMap[anchorCellMap.startRow][anchorCellMap.startColumn];\n    newAnchorCellMap.cell.selectEnd();\n  }\n  return true;\n}\nfunction $isMultiCellTableSelection(selection) {\n  if ($isTableSelection(selection) && !selection.focus.getNode().is(selection.anchor.getNode())) {\n    return true;\n  }\n  if ($isRangeSelection(selection) && $isTableCellNode(selection.anchor.getNode()) && !selection.anchor.getNode().is(selection.focus.getNode())) {\n    return true;\n  }\n  return false;\n}\n\n/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/**\n * Configures {@link TableNode}, {@link TableRowNode}, {@link TableCellNode} and\n * registers table behaviors (see {@link TableConfig})\n */\nconst TableExtension = defineExtension({\n  build(editor, config, state) {\n    return namedSignals(config);\n  },\n  config: safeCast({\n    hasCellBackgroundColor: true,\n    hasCellMerge: true,\n    hasHorizontalScroll: true,\n    hasNestedTables: false,\n    hasTabHandler: true\n  }),\n  name: '@lexical/table/Table',\n  nodes: () => [TableNode, TableRowNode, TableCellNode],\n  register(editor, config, state) {\n    const stores = state.getOutput();\n    return mergeRegister(effect(() => {\n      const hasHorizontalScroll = stores.hasHorizontalScroll.value;\n      const hadHorizontalScroll = $isScrollableTablesActive(editor);\n      if (hadHorizontalScroll !== hasHorizontalScroll) {\n        setScrollableTablesActive(editor, hasHorizontalScroll);\n        // Registering the transform has the side-effect of marking all existing\n        // TableNodes as dirty. The handler is immediately unregistered.\n        editor.registerNodeTransform(TableNode, () => {})();\n      }\n    }), registerTablePlugin(editor, stores), effect(() => registerTableSelectionObserver(editor, stores.hasTabHandler.value)), effect(() => stores.hasCellMerge.value ? undefined : registerTableCellUnmergeTransform(editor)), effect(() => stores.hasCellBackgroundColor.value ? undefined : editor.registerNodeTransform(TableCellNode, node => {\n      if (node.getBackgroundColor() !== null) {\n        node.setBackgroundColor(null);\n      }\n    })));\n  }\n});\n\nexport { $computeTableMap, $computeTableMapSkipCellCheck, $createTableCellNode, $createTableNode, $createTableNodeWithDimensions, $createTableRowNode, $createTableSelection, $createTableSelectionFrom, $deleteTableColumn, $deleteTableColumnAtSelection, $deleteTableColumn__EXPERIMENTAL, $deleteTableRowAtSelection, $deleteTableRow__EXPERIMENTAL, $findCellNode, $findTableNode, $getElementForTableNode, $getNodeTriplet, $getTableAndElementByKey, $getTableCellNodeFromLexicalNode, $getTableCellNodeRect, $getTableColumnIndexFromTableCellNode, $getTableNodeFromLexicalNodeOrThrow, $getTableRowIndexFromTableCellNode, $getTableRowNodeFromTableCellNodeOrThrow, $insertTableColumn, $insertTableColumnAtSelection, $insertTableColumn__EXPERIMENTAL, $insertTableRow, $insertTableRowAtSelection, $insertTableRow__EXPERIMENTAL, $isScrollableTablesActive, $isSimpleTable, $isTableCellNode, $isTableNode, $isTableRowNode, $isTableSelection, $mergeCells, $moveTableColumn, $removeTableRowAtIndex, $unmergeCell, INSERT_TABLE_COMMAND, TableCellHeaderStates, TableCellNode, TableExtension, TableNode, TableObserver, TableRowNode, applyTableHandlers, getDOMCellFromTarget, getTableElement, getTableObserverFromTableElement, registerTableCellUnmergeTransform, registerTablePlugin, registerTableSelectionObserver, setScrollableTablesActive };\n", "/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport * as modDev from './LexicalTable.dev.mjs';\nimport * as modProd from './LexicalTable.prod.mjs';\nconst mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;\nexport const $computeTableMap = mod.$computeTableMap;\nexport const $computeTableMapSkipCellCheck = mod.$computeTableMapSkipCellCheck;\nexport const $createTableCellNode = mod.$createTableCellNode;\nexport const $createTableNode = mod.$createTableNode;\nexport const $createTableNodeWithDimensions = mod.$createTableNodeWithDimensions;\nexport const $createTableRowNode = mod.$createTableRowNode;\nexport const $createTableSelection = mod.$createTableSelection;\nexport const $createTableSelectionFrom = mod.$createTableSelectionFrom;\nexport const $deleteTableColumn = mod.$deleteTableColumn;\nexport const $deleteTableColumnAtSelection = mod.$deleteTableColumnAtSelection;\nexport const $deleteTableColumn__EXPERIMENTAL = mod.$deleteTableColumn__EXPERIMENTAL;\nexport const $deleteTableRowAtSelection = mod.$deleteTableRowAtSelection;\nexport const $deleteTableRow__EXPERIMENTAL = mod.$deleteTableRow__EXPERIMENTAL;\nexport const $findCellNode = mod.$findCellNode;\nexport const $findTableNode = mod.$findTableNode;\nexport const $getElementForTableNode = mod.$getElementForTableNode;\nexport const $getNodeTriplet = mod.$getNodeTriplet;\nexport const $getTableAndElementByKey = mod.$getTableAndElementByKey;\nexport const $getTableCellNodeFromLexicalNode = mod.$getTableCellNodeFromLexicalNode;\nexport const $getTableCellNodeRect = mod.$getTableCellNodeRect;\nexport const $getTableColumnIndexFromTableCellNode = mod.$getTableColumnIndexFromTableCellNode;\nexport const $getTableNodeFromLexicalNodeOrThrow = mod.$getTableNodeFromLexicalNodeOrThrow;\nexport const $getTableRowIndexFromTableCellNode = mod.$getTableRowIndexFromTableCellNode;\nexport const $getTableRowNodeFromTableCellNodeOrThrow = mod.$getTableRowNodeFromTableCellNodeOrThrow;\nexport const $insertTableColumn = mod.$insertTableColumn;\nexport const $insertTableColumnAtSelection = mod.$insertTableColumnAtSelection;\nexport const $insertTableColumn__EXPERIMENTAL = mod.$insertTableColumn__EXPERIMENTAL;\nexport const $insertTableRow = mod.$insertTableRow;\nexport const $insertTableRowAtSelection = mod.$insertTableRowAtSelection;\nexport const $insertTableRow__EXPERIMENTAL = mod.$insertTableRow__EXPERIMENTAL;\nexport const $isScrollableTablesActive = mod.$isScrollableTablesActive;\nexport const $isSimpleTable = mod.$isSimpleTable;\nexport const $isTableCellNode = mod.$isTableCellNode;\nexport const $isTableNode = mod.$isTableNode;\nexport const $isTableRowNode = mod.$isTableRowNode;\nexport const $isTableSelection = mod.$isTableSelection;\nexport const $mergeCells = mod.$mergeCells;\nexport const $moveTableColumn = mod.$moveTableColumn;\nexport const $removeTableRowAtIndex = mod.$removeTableRowAtIndex;\nexport const $unmergeCell = mod.$unmergeCell;\nexport const INSERT_TABLE_COMMAND = mod.INSERT_TABLE_COMMAND;\nexport const TableCellHeaderStates = mod.TableCellHeaderStates;\nexport const TableCellNode = mod.TableCellNode;\nexport const TableExtension = mod.TableExtension;\nexport const TableNode = mod.TableNode;\nexport const TableObserver = mod.TableObserver;\nexport const TableRowNode = mod.TableRowNode;\nexport const applyTableHandlers = mod.applyTableHandlers;\nexport const getDOMCellFromTarget = mod.getDOMCellFromTarget;\nexport const getTableElement = mod.getTableElement;\nexport const getTableObserverFromTableElement = mod.getTableObserverFromTableElement;\nexport const registerTableCellUnmergeTransform = mod.registerTableCellUnmergeTransform;\nexport const registerTablePlugin = mod.registerTablePlugin;\nexport const registerTableSelectionObserver = mod.registerTableSelectionObserver;\nexport const setScrollableTablesActive = mod.setScrollableTablesActive;", "import type { MarkedOptions } from './MarkedOptions.ts';\n\n/**\n * Gets the original marked default options.\n */\nexport function _getDefaults<ParserOutput = string, RendererOutput = string>(): MarkedOptions<ParserOutput, RendererOutput> {\n  return {\n    async: false,\n    breaks: false,\n    extensions: null,\n    gfm: true,\n    hooks: null,\n    pedantic: false,\n    renderer: null,\n    silent: false,\n    tokenizer: null,\n    walkTokens: null,\n  };\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport let _defaults: MarkedOptions<any, any> = _getDefaults();\n\nexport function changeDefaults<ParserOutput = string, RendererOutput = string>(newDefaults: MarkedOptions<ParserOutput, RendererOutput>) {\n  _defaults = newDefaults;\n}\n", "const noopTest = { exec: () => null } as unknown as RegExp;\n\nfunction edit(regex: string | RegExp, opt = '') {\n  let source = typeof regex === 'string' ? regex : regex.source;\n  const obj = {\n    replace: (name: string | RegExp, val: string | RegExp) => {\n      let valSource = typeof val === 'string' ? val : val.source;\n      valSource = valSource.replace(other.caret, '$1');\n      source = source.replace(name, valSource);\n      return obj;\n    },\n    getRegex: () => {\n      return new RegExp(source, opt);\n    },\n  };\n  return obj;\n}\n\nconst supportsLookbehind = (() => {\ntry {\n  // eslint-disable-next-line prefer-regex-literals\n  return !!new RegExp('(?<=1)(?<!1)');\n} catch {\n  // See browser support here:\n  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Lookbehind_assertion\n  return false;\n}\n})();\n\nexport const other = {\n  codeRemoveIndent: /^(?: {1,4}| {0,3}\\t)/gm,\n  outputLinkReplace: /\\\\([\\[\\]])/g,\n  indentCodeCompensation: /^(\\s+)(?:```)/,\n  beginningSpace: /^\\s+/,\n  endingHash: /#$/,\n  startingSpaceChar: /^ /,\n  endingSpaceChar: / $/,\n  nonSpaceChar: /[^ ]/,\n  newLineCharGlobal: /\\n/g,\n  tabCharGlobal: /\\t/g,\n  multipleSpaceGlobal: /\\s+/g,\n  blankLine: /^[ \\t]*$/,\n  doubleBlankLine: /\\n[ \\t]*\\n[ \\t]*$/,\n  blockquoteStart: /^ {0,3}>/,\n  blockquoteSetextReplace: /\\n {0,3}((?:=+|-+) *)(?=\\n|$)/g,\n  blockquoteSetextReplace2: /^ {0,3}>[ \\t]?/gm,\n  listReplaceTabs: /^\\t+/,\n  listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g,\n  listIsTask: /^\\[[ xX]\\] /,\n  listReplaceTask: /^\\[[ xX]\\] +/,\n  anyLine: /\\n.*\\n/,\n  hrefBrackets: /^<(.*)>$/,\n  tableDelimiter: /[:|]/,\n  tableAlignChars: /^\\||\\| *$/g,\n  tableRowBlankLine: /\\n[ \\t]*$/,\n  tableAlignRight: /^ *-+: *$/,\n  tableAlignCenter: /^ *:-+: *$/,\n  tableAlignLeft: /^ *:-+ *$/,\n  startATag: /^<a /i,\n  endATag: /^<\\/a>/i,\n  startPreScriptTag: /^<(pre|code|kbd|script)(\\s|>)/i,\n  endPreScriptTag: /^<\\/(pre|code|kbd|script)(\\s|>)/i,\n  startAngleBracket: /^</,\n  endAngleBracket: />$/,\n  pedanticHrefTitle: /^([^'\"]*[^\\s])\\s+(['\"])(.*)\\2/,\n  unicodeAlphaNumeric: /[\\p{L}\\p{N}]/u,\n  escapeTest: /[&<>\"']/,\n  escapeReplace: /[&<>\"']/g,\n  escapeTestNoEncode: /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/,\n  escapeReplaceNoEncode: /[<>\"']|&(?!(#\\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\\w+);)/g,\n  unescapeTest: /&(#(?:\\d+)|(?:#x[0-9A-Fa-f]+)|(?:\\w+));?/ig,\n  caret: /(^|[^\\[])\\^/g,\n  percentDecode: /%25/g,\n  findPipe: /\\|/g,\n  splitPipe: / \\|/,\n  slashPipe: /\\\\\\|/g,\n  carriageReturn: /\\r\\n|\\r/g,\n  spaceLine: /^ +$/gm,\n  notSpaceStart: /^\\S*/,\n  endingNewline: /\\n$/,\n  listItemRegex: (bull: string) => new RegExp(`^( {0,3}${bull})((?:[\\t ][^\\\\n]*)?(?:\\\\n|$))`),\n  nextBulletRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\\\d{1,9}[.)])((?:[ \\t][^\\\\n]*)?(?:\\\\n|$))`),\n  hrRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\\\* *){3,})(?:\\\\n+|$)`),\n  fencesBeginRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\\`\\`\\`|~~~)`),\n  headingBeginRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`),\n  htmlBeginRegex: (indent: number) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}<(?:[a-z].*>|!--)`, 'i'),\n};\n\n/**\n * Block-Level Grammar\n */\n\nconst newline = /^(?:[ \\t]*(?:\\n|$))+/;\nconst blockCode = /^((?: {4}| {0,3}\\t)[^\\n]+(?:\\n(?:[ \\t]*(?:\\n|$))*)?)+/;\nconst fences = /^ {0,3}(`{3,}(?=[^`\\n]*(?:\\n|$))|~{3,})([^\\n]*)(?:\\n|$)(?:|([\\s\\S]*?)(?:\\n|$))(?: {0,3}\\1[~`]* *(?=\\n|$)|$)/;\nconst hr = /^ {0,3}((?:-[\\t ]*){3,}|(?:_[ \\t]*){3,}|(?:\\*[ \\t]*){3,})(?:\\n+|$)/;\nconst heading = /^ {0,3}(#{1,6})(?=\\s|$)(.*)(?:\\n+|$)/;\nconst bullet = /(?:[*+-]|\\d{1,9}[.)])/;\nconst lheadingCore = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\\n(?!\\s*?\\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/;\nconst lheading = edit(lheadingCore)\n  .replace(/bull/g, bullet) // lists can interrupt\n  .replace(/blockCode/g, /(?: {4}| {0,3}\\t)/) // indented code blocks can interrupt\n  .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n  .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n  .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt\n  .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n  .replace(/\\|table/g, '') // table not in commonmark\n  .getRegex();\nconst lheadingGfm = edit(lheadingCore)\n  .replace(/bull/g, bullet) // lists can interrupt\n  .replace(/blockCode/g, /(?: {4}| {0,3}\\t)/) // indented code blocks can interrupt\n  .replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/) // fenced code blocks can interrupt\n  .replace(/blockquote/g, / {0,3}>/) // blockquote can interrupt\n  .replace(/heading/g, / {0,3}#{1,6}/) // ATX heading can interrupt\n  .replace(/html/g, / {0,3}<[^\\n>]+>\\n/) // block html can interrupt\n  .replace(/table/g, / {0,3}\\|?(?:[:\\- ]*\\|)+[\\:\\- ]*\\n/) // table can interrupt\n  .getRegex();\nconst _paragraph = /^([^\\n]+(?:\\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\\n)[^\\n]+)*)/;\nconst blockText = /^[^\\n]+/;\nconst _blockLabel = /(?!\\s*\\])(?:\\\\[\\s\\S]|[^\\[\\]\\\\])+/;\nconst def = edit(/^ {0,3}\\[(label)\\]: *(?:\\n[ \\t]*)?([^<\\s][^\\s]*|<.*?>)(?:(?: +(?:\\n[ \\t]*)?| *\\n[ \\t]*)(title))? *(?:\\n+|$)/)\n  .replace('label', _blockLabel)\n  .replace('title', /(?:\"(?:\\\\\"?|[^\"\\\\])*\"|'[^'\\n]*(?:\\n[^'\\n]+)*\\n?'|\\([^()]*\\))/)\n  .getRegex();\n\nconst list = edit(/^( {0,3}bull)([ \\t][^\\n]+?)?(?:\\n|$)/)\n  .replace(/bull/g, bullet)\n  .getRegex();\n\nconst _tag = 'address|article|aside|base|basefont|blockquote|body|caption'\n  + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'\n  + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'\n  + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'\n  + '|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title'\n  + '|tr|track|ul';\nconst _comment = /<!--(?:-?>|[\\s\\S]*?(?:-->|$))/;\nconst html = edit(\n  '^ {0,3}(?:' // optional indentation\n+ '<(script|pre|style|textarea)[\\\\s>][\\\\s\\\\S]*?(?:</\\\\1>[^\\\\n]*\\\\n+|$)' // (1)\n+ '|comment[^\\\\n]*(\\\\n+|$)' // (2)\n+ '|<\\\\?[\\\\s\\\\S]*?(?:\\\\?>\\\\n*|$)' // (3)\n+ '|<![A-Z][\\\\s\\\\S]*?(?:>\\\\n*|$)' // (4)\n+ '|<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?(?:\\\\]\\\\]>\\\\n*|$)' // (5)\n+ '|</?(tag)(?: +|\\\\n|/?>)[\\\\s\\\\S]*?(?:(?:\\\\n[ \\t]*)+\\\\n|$)' // (6)\n+ '|<(?!script|pre|style|textarea)([a-z][\\\\w-]*)(?:attribute)*? */?>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \\t]*)+\\\\n|$)' // (7) open tag\n+ '|</(?!script|pre|style|textarea)[a-z][\\\\w-]*\\\\s*>(?=[ \\\\t]*(?:\\\\n|$))[\\\\s\\\\S]*?(?:(?:\\\\n[ \\t]*)+\\\\n|$)' // (7) closing tag\n+ ')', 'i')\n  .replace('comment', _comment)\n  .replace('tag', _tag)\n  .replace('attribute', / +[a-zA-Z:_][\\w.:-]*(?: *= *\"[^\"\\n]*\"| *= *'[^'\\n]*'| *= *[^\\s\"'=<>`]+)?/)\n  .getRegex();\n\nconst paragraph = edit(_paragraph)\n  .replace('hr', hr)\n  .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n  .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n  .replace('|table', '')\n  .replace('blockquote', ' {0,3}>')\n  .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n  .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n  .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n  .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n  .getRegex();\n\nconst blockquote = edit(/^( {0,3}> ?(paragraph|[^\\n]*)(?:\\n|$))+/)\n  .replace('paragraph', paragraph)\n  .getRegex();\n\n/**\n * Normal Block Grammar\n */\n\nconst blockNormal = {\n  blockquote,\n  code: blockCode,\n  def,\n  fences,\n  heading,\n  hr,\n  html,\n  lheading,\n  list,\n  newline,\n  paragraph,\n  table: noopTest,\n  text: blockText,\n};\n\ntype BlockKeys = keyof typeof blockNormal;\n\n/**\n * GFM Block Grammar\n */\n\nconst gfmTable = edit(\n  '^ *([^\\\\n ].*)\\\\n' // Header\n+ ' {0,3}((?:\\\\| *)?:?-+:? *(?:\\\\| *:?-+:? *)*(?:\\\\| *)?)' // Align\n+ '(?:\\\\n((?:(?! *\\\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\\\n|$))*)\\\\n*|$)') // Cells\n  .replace('hr', hr)\n  .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n  .replace('blockquote', ' {0,3}>')\n  .replace('code', '(?: {4}| {0,3}\\t)[^\\\\n]')\n  .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n  .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n  .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n  .replace('tag', _tag) // tables can be interrupted by type (6) html blocks\n  .getRegex();\n\nconst blockGfm: Record<BlockKeys, RegExp> = {\n  ...blockNormal,\n  lheading: lheadingGfm,\n  table: gfmTable,\n  paragraph: edit(_paragraph)\n    .replace('hr', hr)\n    .replace('heading', ' {0,3}#{1,6}(?:\\\\s|$)')\n    .replace('|lheading', '') // setext headings don't interrupt commonmark paragraphs\n    .replace('table', gfmTable) // interrupt paragraphs with table\n    .replace('blockquote', ' {0,3}>')\n    .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\\\n]*\\\\n)|~{3,})[^\\\\n]*\\\\n')\n    .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt\n    .replace('html', '</?(?:tag)(?: +|\\\\n|/?>)|<(?:script|pre|style|textarea|!--)')\n    .replace('tag', _tag) // pars can be interrupted by type (6) html blocks\n    .getRegex(),\n};\n\n/**\n * Pedantic grammar (original John Gruber's loose markdown specification)\n */\n\nconst blockPedantic: Record<BlockKeys, RegExp> = {\n  ...blockNormal,\n  html: edit(\n    '^ *(?:comment *(?:\\\\n|\\\\s*$)'\n    + '|<(tag)[\\\\s\\\\S]+?</\\\\1> *(?:\\\\n{2,}|\\\\s*$)' // closed tag\n    + '|<tag(?:\"[^\"]*\"|\\'[^\\']*\\'|\\\\s[^\\'\"/>\\\\s]*)*?/?> *(?:\\\\n{2,}|\\\\s*$))')\n    .replace('comment', _comment)\n    .replace(/tag/g, '(?!(?:'\n      + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub'\n      + '|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)'\n      + '\\\\b)\\\\w+(?!:|[^\\\\w\\\\s@]*@)\\\\b')\n    .getRegex(),\n  def: /^ *\\[([^\\]]+)\\]: *<?([^\\s>]+)>?(?: +([\"(][^\\n]+[\")]))? *(?:\\n+|$)/,\n  heading: /^(#{1,6})(.*)(?:\\n+|$)/,\n  fences: noopTest, // fences not supported\n  lheading: /^(.+?)\\n {0,3}(=+|-+) *(?:\\n+|$)/,\n  paragraph: edit(_paragraph)\n    .replace('hr', hr)\n    .replace('heading', ' *#{1,6} *[^\\n]')\n    .replace('lheading', lheading)\n    .replace('|table', '')\n    .replace('blockquote', ' {0,3}>')\n    .replace('|fences', '')\n    .replace('|list', '')\n    .replace('|html', '')\n    .replace('|tag', '')\n    .getRegex(),\n};\n\n/**\n * Inline-Level Grammar\n */\n\nconst escape = /^\\\\([!\"#$%&'()*+,\\-./:;<=>?@\\[\\]\\\\^_`{|}~])/;\nconst inlineCode = /^(`+)([^`]|[^`][\\s\\S]*?[^`])\\1(?!`)/;\nconst br = /^( {2,}|\\\\)\\n(?!\\s*$)/;\nconst inlineText = /^(`+|[^`])(?:(?= {2,}\\n)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*_]|\\b_|$)|[^ ](?= {2,}\\n)))/;\n\n// list of unicode punctuation marks, plus any missing characters from CommonMark spec\nconst _punctuation = /[\\p{P}\\p{S}]/u;\nconst _punctuationOrSpace = /[\\s\\p{P}\\p{S}]/u;\nconst _notPunctuationOrSpace = /[^\\s\\p{P}\\p{S}]/u;\nconst punctuation = edit(/^((?![*_])punctSpace)/, 'u')\n  .replace(/punctSpace/g, _punctuationOrSpace).getRegex();\n\n// GFM allows ~ inside strong and em for strikethrough\nconst _punctuationGfmStrongEm = /(?!~)[\\p{P}\\p{S}]/u;\nconst _punctuationOrSpaceGfmStrongEm = /(?!~)[\\s\\p{P}\\p{S}]/u;\nconst _notPunctuationOrSpaceGfmStrongEm = /(?:[^\\s\\p{P}\\p{S}]|~)/u;\n\n// sequences em should skip over [title](link), `code`, <html>\nconst blockSkip = edit(/link|precode-code|html/, 'g')\n  .replace('link', /\\[(?:[^\\[\\]`]|(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)/)\n  .replace('precode-', supportsLookbehind ? '(?<!`)()' : '(^^|[^`])')\n  .replace('code', /(?<b>`+)[^`]+\\k<b>(?!`)/)\n  .replace('html', /<(?! )[^<>]*?>/)\n  .getRegex();\n\nconst emStrongLDelimCore = /^(?:\\*+(?:((?!\\*)punct)|[^\\s*]))|^_+(?:((?!_)punct)|([^\\s_]))/;\n\nconst emStrongLDelim = edit(emStrongLDelimCore, 'u')\n  .replace(/punct/g, _punctuation)\n  .getRegex();\n\nconst emStrongLDelimGfm = edit(emStrongLDelimCore, 'u')\n  .replace(/punct/g, _punctuationGfmStrongEm)\n  .getRegex();\n\nconst emStrongRDelimAstCore =\n  '^[^_*]*?__[^_*]*?\\\\*[^_*]*?(?=__)' // Skip orphan inside strong\n+ '|[^*]+(?=[^*])' // Consume to delim\n+ '|(?!\\\\*)punct(\\\\*+)(?=[\\\\s]|$)' // (1) #*** can only be a Right Delimiter\n+ '|notPunctSpace(\\\\*+)(?!\\\\*)(?=punctSpace|$)' // (2) a***#, a*** can only be a Right Delimiter\n+ '|(?!\\\\*)punctSpace(\\\\*+)(?=notPunctSpace)' // (3) #***a, ***a can only be Left Delimiter\n+ '|[\\\\s](\\\\*+)(?!\\\\*)(?=punct)' // (4) ***# can only be Left Delimiter\n+ '|(?!\\\\*)punct(\\\\*+)(?!\\\\*)(?=punct)' // (5) #***# can be either Left or Right Delimiter\n+ '|notPunctSpace(\\\\*+)(?=notPunctSpace)'; // (6) a***a can be either Left or Right Delimiter\n\nconst emStrongRDelimAst = edit(emStrongRDelimAstCore, 'gu')\n  .replace(/notPunctSpace/g, _notPunctuationOrSpace)\n  .replace(/punctSpace/g, _punctuationOrSpace)\n  .replace(/punct/g, _punctuation)\n  .getRegex();\n\nconst emStrongRDelimAstGfm = edit(emStrongRDelimAstCore, 'gu')\n  .replace(/notPunctSpace/g, _notPunctuationOrSpaceGfmStrongEm)\n  .replace(/punctSpace/g, _punctuationOrSpaceGfmStrongEm)\n  .replace(/punct/g, _punctuationGfmStrongEm)\n  .getRegex();\n\n// (6) Not allowed for _\nconst emStrongRDelimUnd = edit(\n  '^[^_*]*?\\\\*\\\\*[^_*]*?_[^_*]*?(?=\\\\*\\\\*)' // Skip orphan inside strong\n+ '|[^_]+(?=[^_])' // Consume to delim\n+ '|(?!_)punct(_+)(?=[\\\\s]|$)' // (1) #___ can only be a Right Delimiter\n+ '|notPunctSpace(_+)(?!_)(?=punctSpace|$)' // (2) a___#, a___ can only be a Right Delimiter\n+ '|(?!_)punctSpace(_+)(?=notPunctSpace)' // (3) #___a, ___a can only be Left Delimiter\n+ '|[\\\\s](_+)(?!_)(?=punct)' // (4) ___# can only be Left Delimiter\n+ '|(?!_)punct(_+)(?!_)(?=punct)', 'gu') // (5) #___# can be either Left or Right Delimiter\n  .replace(/notPunctSpace/g, _notPunctuationOrSpace)\n  .replace(/punctSpace/g, _punctuationOrSpace)\n  .replace(/punct/g, _punctuation)\n  .getRegex();\n\nconst anyPunctuation = edit(/\\\\(punct)/, 'gu')\n  .replace(/punct/g, _punctuation)\n  .getRegex();\n\nconst autolink = edit(/^<(scheme:[^\\s\\x00-\\x1f<>]*|email)>/)\n  .replace('scheme', /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/)\n  .replace('email', /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/)\n  .getRegex();\n\nconst _inlineComment = edit(_comment).replace('(?:-->|$)', '-->').getRegex();\nconst tag = edit(\n  '^comment'\n    + '|^</[a-zA-Z][\\\\w:-]*\\\\s*>' // self-closing tag\n    + '|^<[a-zA-Z][\\\\w-]*(?:attribute)*?\\\\s*/?>' // open tag\n    + '|^<\\\\?[\\\\s\\\\S]*?\\\\?>' // processing instruction, e.g. <?php ?>\n    + '|^<![a-zA-Z]+\\\\s[\\\\s\\\\S]*?>' // declaration, e.g. <!DOCTYPE html>\n    + '|^<!\\\\[CDATA\\\\[[\\\\s\\\\S]*?\\\\]\\\\]>') // CDATA section\n  .replace('comment', _inlineComment)\n  .replace('attribute', /\\s+[a-zA-Z:_][\\w.:-]*(?:\\s*=\\s*\"[^\"]*\"|\\s*=\\s*'[^']*'|\\s*=\\s*[^\\s\"'=<>`]+)?/)\n  .getRegex();\n\nconst _inlineLabel = /(?:\\[(?:\\\\[\\s\\S]|[^\\[\\]\\\\])*\\]|\\\\[\\s\\S]|`+[^`]*?`+(?!`)|[^\\[\\]\\\\`])*?/;\n\nconst link = edit(/^!?\\[(label)\\]\\(\\s*(href)(?:(?:[ \\t]*(?:\\n[ \\t]*)?)(title))?\\s*\\)/)\n  .replace('label', _inlineLabel)\n  .replace('href', /<(?:\\\\.|[^\\n<>\\\\])+>|[^ \\t\\n\\x00-\\x1f]*/)\n  .replace('title', /\"(?:\\\\\"?|[^\"\\\\])*\"|'(?:\\\\'?|[^'\\\\])*'|\\((?:\\\\\\)?|[^)\\\\])*\\)/)\n  .getRegex();\n\nconst reflink = edit(/^!?\\[(label)\\]\\[(ref)\\]/)\n  .replace('label', _inlineLabel)\n  .replace('ref', _blockLabel)\n  .getRegex();\n\nconst nolink = edit(/^!?\\[(ref)\\](?:\\[\\])?/)\n  .replace('ref', _blockLabel)\n  .getRegex();\n\nconst reflinkSearch = edit('reflink|nolink(?!\\\\()', 'g')\n  .replace('reflink', reflink)\n  .replace('nolink', nolink)\n  .getRegex();\n\nconst _caseInsensitiveProtocol = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/;\n\n/**\n * Normal Inline Grammar\n */\n\nconst inlineNormal = {\n  _backpedal: noopTest, // only used for GFM url\n  anyPunctuation,\n  autolink,\n  blockSkip,\n  br,\n  code: inlineCode,\n  del: noopTest,\n  emStrongLDelim,\n  emStrongRDelimAst,\n  emStrongRDelimUnd,\n  escape,\n  link,\n  nolink,\n  punctuation,\n  reflink,\n  reflinkSearch,\n  tag,\n  text: inlineText,\n  url: noopTest,\n};\n\ntype InlineKeys = keyof typeof inlineNormal;\n\n/**\n * Pedantic Inline Grammar\n */\n\nconst inlinePedantic: Record<InlineKeys, RegExp> = {\n  ...inlineNormal,\n  link: edit(/^!?\\[(label)\\]\\((.*?)\\)/)\n    .replace('label', _inlineLabel)\n    .getRegex(),\n  reflink: edit(/^!?\\[(label)\\]\\s*\\[([^\\]]*)\\]/)\n    .replace('label', _inlineLabel)\n    .getRegex(),\n};\n\n/**\n * GFM Inline Grammar\n */\n\nconst inlineGfm: Record<InlineKeys, RegExp> = {\n  ...inlineNormal,\n  emStrongRDelimAst: emStrongRDelimAstGfm,\n  emStrongLDelim: emStrongLDelimGfm,\n  url: edit(/^((?:protocol):\\/\\/|www\\.)(?:[a-zA-Z0-9\\-]+\\.?)+[^\\s<]*|^email/)\n    .replace('protocol', _caseInsensitiveProtocol)\n    .replace('email', /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/)\n    .getRegex(),\n  _backpedal: /(?:[^?!.,:;*_'\"~()&]+|\\([^)]*\\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'\"~)]+(?!$))+/,\n  del: /^(~~?)(?=[^\\s~])((?:\\\\[\\s\\S]|[^\\\\])*?(?:\\\\[\\s\\S]|[^\\s~\\\\]))\\1(?=[^~]|$)/,\n  text: edit(/^([`~]+|[^`~])(?:(?= {2,}\\n)|(?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)|[\\s\\S]*?(?:(?=[\\\\<!\\[`*~_]|\\b_|protocol:\\/\\/|www\\.|$)|[^ ](?= {2,}\\n)|[^a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-](?=[a-zA-Z0-9.!#$%&'*+\\/=?_`{\\|}~-]+@)))/)\n    .replace('protocol', _caseInsensitiveProtocol)\n    .getRegex(),\n};\n\n/**\n * GFM + Line Breaks Inline Grammar\n */\n\nconst inlineBreaks: Record<InlineKeys, RegExp> = {\n  ...inlineGfm,\n  br: edit(br).replace('{2,}', '*').getRegex(),\n  text: edit(inlineGfm.text)\n    .replace('\\\\b_', '\\\\b_| {2,}\\\\n')\n    .replace(/\\{2,\\}/g, '*')\n    .getRegex(),\n};\n\n/**\n * exports\n */\n\nexport const block = {\n  normal: blockNormal,\n  gfm: blockGfm,\n  pedantic: blockPedantic,\n};\n\nexport const inline = {\n  normal: inlineNormal,\n  gfm: inlineGfm,\n  breaks: inlineBreaks,\n  pedantic: inlinePedantic,\n};\n\nexport interface Rules {\n  other: typeof other\n  block: Record<BlockKeys, RegExp>\n  inline: Record<InlineKeys, RegExp>\n}\n", "import { other } from './rules.ts';\n\n/**\n * Helpers\n */\nconst escapeReplacements: { [index: string]: string } = {\n  '&': '&amp;',\n  '<': '&lt;',\n  '>': '&gt;',\n  '\"': '&quot;',\n  \"'\": '&#39;',\n};\nconst getEscapeReplacement = (ch: string) => escapeReplacements[ch];\n\nexport function escape(html: string, encode?: boolean) {\n  if (encode) {\n    if (other.escapeTest.test(html)) {\n      return html.replace(other.escapeReplace, getEscapeReplacement);\n    }\n  } else {\n    if (other.escapeTestNoEncode.test(html)) {\n      return html.replace(other.escapeReplaceNoEncode, getEscapeReplacement);\n    }\n  }\n\n  return html;\n}\n\nexport function unescape(html: string) {\n  // explicitly match decimal, hex, and named HTML entities\n  return html.replace(other.unescapeTest, (_, n) => {\n    n = n.toLowerCase();\n    if (n === 'colon') return ':';\n    if (n.charAt(0) === '#') {\n      return n.charAt(1) === 'x'\n        ? String.fromCharCode(parseInt(n.substring(2), 16))\n        : String.fromCharCode(+n.substring(1));\n    }\n    return '';\n  });\n}\n\nexport function cleanUrl(href: string) {\n  try {\n    href = encodeURI(href).replace(other.percentDecode, '%');\n  } catch {\n    return null;\n  }\n  return href;\n}\n\nexport function splitCells(tableRow: string, count?: number) {\n  // ensure that every cell-delimiting pipe has a space\n  // before it to distinguish it from an escaped pipe\n  const row = tableRow.replace(other.findPipe, (match, offset, str) => {\n      let escaped = false;\n      let curr = offset;\n      while (--curr >= 0 && str[curr] === '\\\\') escaped = !escaped;\n      if (escaped) {\n        // odd number of slashes means | is escaped\n        // so we leave it alone\n        return '|';\n      } else {\n        // add space before unescaped |\n        return ' |';\n      }\n    }),\n    cells = row.split(other.splitPipe);\n  let i = 0;\n\n  // First/last cell in a row cannot be empty if it has no leading/trailing pipe\n  if (!cells[0].trim()) {\n    cells.shift();\n  }\n  if (cells.length > 0 && !cells.at(-1)?.trim()) {\n    cells.pop();\n  }\n\n  if (count) {\n    if (cells.length > count) {\n      cells.splice(count);\n    } else {\n      while (cells.length < count) cells.push('');\n    }\n  }\n\n  for (; i < cells.length; i++) {\n    // leading or trailing whitespace is ignored per the gfm spec\n    cells[i] = cells[i].trim().replace(other.slashPipe, '|');\n  }\n  return cells;\n}\n\n/**\n * Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').\n * /c*$/ is vulnerable to REDOS.\n *\n * @param str\n * @param c\n * @param invert Remove suffix of non-c chars instead. Default falsey.\n */\nexport function rtrim(str: string, c: string, invert?: boolean) {\n  const l = str.length;\n  if (l === 0) {\n    return '';\n  }\n\n  // Length of suffix matching the invert condition.\n  let suffLen = 0;\n\n  // Step left until we fail to match the invert condition.\n  while (suffLen < l) {\n    const currChar = str.charAt(l - suffLen - 1);\n    if (currChar === c && !invert) {\n      suffLen++;\n    } else if (currChar !== c && invert) {\n      suffLen++;\n    } else {\n      break;\n    }\n  }\n\n  return str.slice(0, l - suffLen);\n}\n\nexport function findClosingBracket(str: string, b: string) {\n  if (str.indexOf(b[1]) === -1) {\n    return -1;\n  }\n\n  let level = 0;\n  for (let i = 0; i < str.length; i++) {\n    if (str[i] === '\\\\') {\n      i++;\n    } else if (str[i] === b[0]) {\n      level++;\n    } else if (str[i] === b[1]) {\n      level--;\n      if (level < 0) {\n        return i;\n      }\n    }\n  }\n  if (level > 0) {\n    return -2;\n  }\n\n  return -1;\n}\n", "import { _defaults } from './defaults.ts';\nimport {\n  rtrim,\n  splitCells,\n  findClosingBracket,\n} from './helpers.ts';\nimport type { Rules } from './rules.ts';\nimport type { _Lexer } from './Lexer.ts';\nimport type { Links, Tokens, Token } from './Tokens.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\n\nfunction outputLink(cap: string[], link: Pick<Tokens.Link, 'href' | 'title'>, raw: string, lexer: _Lexer, rules: Rules): Tokens.Link | Tokens.Image {\n  const href = link.href;\n  const title = link.title || null;\n  const text = cap[1].replace(rules.other.outputLinkReplace, '$1');\n\n  lexer.state.inLink = true;\n  const token: Tokens.Link | Tokens.Image = {\n    type: cap[0].charAt(0) === '!' ? 'image' : 'link',\n    raw,\n    href,\n    title,\n    text,\n    tokens: lexer.inlineTokens(text),\n  };\n  lexer.state.inLink = false;\n  return token;\n}\n\nfunction indentCodeCompensation(raw: string, text: string, rules: Rules) {\n  const matchIndentToCode = raw.match(rules.other.indentCodeCompensation);\n\n  if (matchIndentToCode === null) {\n    return text;\n  }\n\n  const indentToCode = matchIndentToCode[1];\n\n  return text\n    .split('\\n')\n    .map(node => {\n      const matchIndentInNode = node.match(rules.other.beginningSpace);\n      if (matchIndentInNode === null) {\n        return node;\n      }\n\n      const [indentInNode] = matchIndentInNode;\n\n      if (indentInNode.length >= indentToCode.length) {\n        return node.slice(indentToCode.length);\n      }\n\n      return node;\n    })\n    .join('\\n');\n}\n\n/**\n * Tokenizer\n */\nexport class _Tokenizer<ParserOutput = string, RendererOutput = string> {\n  options: MarkedOptions<ParserOutput, RendererOutput>;\n  rules!: Rules; // set by the lexer\n  lexer!: _Lexer<ParserOutput, RendererOutput>; // set by the lexer\n\n  constructor(options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    this.options = options || _defaults;\n  }\n\n  space(src: string): Tokens.Space | undefined {\n    const cap = this.rules.block.newline.exec(src);\n    if (cap && cap[0].length > 0) {\n      return {\n        type: 'space',\n        raw: cap[0],\n      };\n    }\n  }\n\n  code(src: string): Tokens.Code | undefined {\n    const cap = this.rules.block.code.exec(src);\n    if (cap) {\n      const text = cap[0].replace(this.rules.other.codeRemoveIndent, '');\n      return {\n        type: 'code',\n        raw: cap[0],\n        codeBlockStyle: 'indented',\n        text: !this.options.pedantic\n          ? rtrim(text, '\\n')\n          : text,\n      };\n    }\n  }\n\n  fences(src: string): Tokens.Code | undefined {\n    const cap = this.rules.block.fences.exec(src);\n    if (cap) {\n      const raw = cap[0];\n      const text = indentCodeCompensation(raw, cap[3] || '', this.rules);\n\n      return {\n        type: 'code',\n        raw,\n        lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, '$1') : cap[2],\n        text,\n      };\n    }\n  }\n\n  heading(src: string): Tokens.Heading | undefined {\n    const cap = this.rules.block.heading.exec(src);\n    if (cap) {\n      let text = cap[2].trim();\n\n      // remove trailing #s\n      if (this.rules.other.endingHash.test(text)) {\n        const trimmed = rtrim(text, '#');\n        if (this.options.pedantic) {\n          text = trimmed.trim();\n        } else if (!trimmed || this.rules.other.endingSpaceChar.test(trimmed)) {\n          // CommonMark requires space before trailing #s\n          text = trimmed.trim();\n        }\n      }\n\n      return {\n        type: 'heading',\n        raw: cap[0],\n        depth: cap[1].length,\n        text,\n        tokens: this.lexer.inline(text),\n      };\n    }\n  }\n\n  hr(src: string): Tokens.Hr | undefined {\n    const cap = this.rules.block.hr.exec(src);\n    if (cap) {\n      return {\n        type: 'hr',\n        raw: rtrim(cap[0], '\\n'),\n      };\n    }\n  }\n\n  blockquote(src: string): Tokens.Blockquote | undefined {\n    const cap = this.rules.block.blockquote.exec(src);\n    if (cap) {\n      let lines = rtrim(cap[0], '\\n').split('\\n');\n      let raw = '';\n      let text = '';\n      const tokens: Token[] = [];\n\n      while (lines.length > 0) {\n        let inBlockquote = false;\n        const currentLines = [];\n\n        let i;\n        for (i = 0; i < lines.length; i++) {\n          // get lines up to a continuation\n          if (this.rules.other.blockquoteStart.test(lines[i])) {\n            currentLines.push(lines[i]);\n            inBlockquote = true;\n          } else if (!inBlockquote) {\n            currentLines.push(lines[i]);\n          } else {\n            break;\n          }\n        }\n        lines = lines.slice(i);\n\n        const currentRaw = currentLines.join('\\n');\n        const currentText = currentRaw\n          // precede setext continuation with 4 spaces so it isn't a setext\n          .replace(this.rules.other.blockquoteSetextReplace, '\\n    $1')\n          .replace(this.rules.other.blockquoteSetextReplace2, '');\n        raw = raw ? `${raw}\\n${currentRaw}` : currentRaw;\n        text = text ? `${text}\\n${currentText}` : currentText;\n\n        // parse blockquote lines as top level tokens\n        // merge paragraphs if this is a continuation\n        const top = this.lexer.state.top;\n        this.lexer.state.top = true;\n        this.lexer.blockTokens(currentText, tokens, true);\n        this.lexer.state.top = top;\n\n        // if there is no continuation then we are done\n        if (lines.length === 0) {\n          break;\n        }\n\n        const lastToken = tokens.at(-1);\n\n        if (lastToken?.type === 'code') {\n          // blockquote continuation cannot be preceded by a code block\n          break;\n        } else if (lastToken?.type === 'blockquote') {\n          // include continuation in nested blockquote\n          const oldToken = lastToken as Tokens.Blockquote;\n          const newText = oldToken.raw + '\\n' + lines.join('\\n');\n          const newToken = this.blockquote(newText)!;\n          tokens[tokens.length - 1] = newToken;\n\n          raw = raw.substring(0, raw.length - oldToken.raw.length) + newToken.raw;\n          text = text.substring(0, text.length - oldToken.text.length) + newToken.text;\n          break;\n        } else if (lastToken?.type === 'list') {\n          // include continuation in nested list\n          const oldToken = lastToken as Tokens.List;\n          const newText = oldToken.raw + '\\n' + lines.join('\\n');\n          const newToken = this.list(newText)!;\n          tokens[tokens.length - 1] = newToken;\n\n          raw = raw.substring(0, raw.length - lastToken.raw.length) + newToken.raw;\n          text = text.substring(0, text.length - oldToken.raw.length) + newToken.raw;\n          lines = newText.substring(tokens.at(-1)!.raw.length).split('\\n');\n          continue;\n        }\n      }\n\n      return {\n        type: 'blockquote',\n        raw,\n        tokens,\n        text,\n      };\n    }\n  }\n\n  list(src: string): Tokens.List | undefined {\n    let cap = this.rules.block.list.exec(src);\n    if (cap) {\n      let bull = cap[1].trim();\n      const isordered = bull.length > 1;\n\n      const list: Tokens.List = {\n        type: 'list',\n        raw: '',\n        ordered: isordered,\n        start: isordered ? +bull.slice(0, -1) : '',\n        loose: false,\n        items: [],\n      };\n\n      bull = isordered ? `\\\\d{1,9}\\\\${bull.slice(-1)}` : `\\\\${bull}`;\n\n      if (this.options.pedantic) {\n        bull = isordered ? bull : '[*+-]';\n      }\n\n      // Get next list item\n      const itemRegex = this.rules.other.listItemRegex(bull);\n      let endsWithBlankLine = false;\n      // Check if current bullet point can start a new List Item\n      while (src) {\n        let endEarly = false;\n        let raw = '';\n        let itemContents = '';\n        if (!(cap = itemRegex.exec(src))) {\n          break;\n        }\n\n        if (this.rules.block.hr.test(src)) { // End list if bullet was actually HR (possibly move into itemRegex?)\n          break;\n        }\n\n        raw = cap[0];\n        src = src.substring(raw.length);\n\n        let line = cap[2].split('\\n', 1)[0].replace(this.rules.other.listReplaceTabs, (t: string) => ' '.repeat(3 * t.length));\n        let nextLine = src.split('\\n', 1)[0];\n        let blankLine = !line.trim();\n\n        let indent = 0;\n        if (this.options.pedantic) {\n          indent = 2;\n          itemContents = line.trimStart();\n        } else if (blankLine) {\n          indent = cap[1].length + 1;\n        } else {\n          indent = cap[2].search(this.rules.other.nonSpaceChar); // Find first non-space char\n          indent = indent > 4 ? 1 : indent; // Treat indented code blocks (> 4 spaces) as having only 1 indent\n          itemContents = line.slice(indent);\n          indent += cap[1].length;\n        }\n\n        if (blankLine && this.rules.other.blankLine.test(nextLine)) { // Items begin with at most one blank line\n          raw += nextLine + '\\n';\n          src = src.substring(nextLine.length + 1);\n          endEarly = true;\n        }\n\n        if (!endEarly) {\n          const nextBulletRegex = this.rules.other.nextBulletRegex(indent);\n          const hrRegex = this.rules.other.hrRegex(indent);\n          const fencesBeginRegex = this.rules.other.fencesBeginRegex(indent);\n          const headingBeginRegex = this.rules.other.headingBeginRegex(indent);\n          const htmlBeginRegex = this.rules.other.htmlBeginRegex(indent);\n\n          // Check if following lines should be included in List Item\n          while (src) {\n            const rawLine = src.split('\\n', 1)[0];\n            let nextLineWithoutTabs;\n            nextLine = rawLine;\n\n            // Re-align to follow commonmark nesting rules\n            if (this.options.pedantic) {\n              nextLine = nextLine.replace(this.rules.other.listReplaceNesting, '  ');\n              nextLineWithoutTabs = nextLine;\n            } else {\n              nextLineWithoutTabs = nextLine.replace(this.rules.other.tabCharGlobal, '    ');\n            }\n\n            // End list item if found code fences\n            if (fencesBeginRegex.test(nextLine)) {\n              break;\n            }\n\n            // End list item if found start of new heading\n            if (headingBeginRegex.test(nextLine)) {\n              break;\n            }\n\n            // End list item if found start of html block\n            if (htmlBeginRegex.test(nextLine)) {\n              break;\n            }\n\n            // End list item if found start of new bullet\n            if (nextBulletRegex.test(nextLine)) {\n              break;\n            }\n\n            // Horizontal rule found\n            if (hrRegex.test(nextLine)) {\n              break;\n            }\n\n            if (nextLineWithoutTabs.search(this.rules.other.nonSpaceChar) >= indent || !nextLine.trim()) { // Dedent if possible\n              itemContents += '\\n' + nextLineWithoutTabs.slice(indent);\n            } else {\n              // not enough indentation\n              if (blankLine) {\n                break;\n              }\n\n              // paragraph continuation unless last line was a different block level element\n              if (line.replace(this.rules.other.tabCharGlobal, '    ').search(this.rules.other.nonSpaceChar) >= 4) { // indented code block\n                break;\n              }\n              if (fencesBeginRegex.test(line)) {\n                break;\n              }\n              if (headingBeginRegex.test(line)) {\n                break;\n              }\n              if (hrRegex.test(line)) {\n                break;\n              }\n\n              itemContents += '\\n' + nextLine;\n            }\n\n            if (!blankLine && !nextLine.trim()) { // Check if current line is blank\n              blankLine = true;\n            }\n\n            raw += rawLine + '\\n';\n            src = src.substring(rawLine.length + 1);\n            line = nextLineWithoutTabs.slice(indent);\n          }\n        }\n\n        if (!list.loose) {\n          // If the previous item ended with a blank line, the list is loose\n          if (endsWithBlankLine) {\n            list.loose = true;\n          } else if (this.rules.other.doubleBlankLine.test(raw)) {\n            endsWithBlankLine = true;\n          }\n        }\n\n        let istask: RegExpExecArray | null = null;\n        let ischecked: boolean | undefined;\n        // Check for task list items\n        if (this.options.gfm) {\n          istask = this.rules.other.listIsTask.exec(itemContents);\n          if (istask) {\n            ischecked = istask[0] !== '[ ] ';\n            itemContents = itemContents.replace(this.rules.other.listReplaceTask, '');\n          }\n        }\n\n        list.items.push({\n          type: 'list_item',\n          raw,\n          task: !!istask,\n          checked: ischecked,\n          loose: false,\n          text: itemContents,\n          tokens: [],\n        });\n\n        list.raw += raw;\n      }\n\n      // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic\n      const lastItem = list.items.at(-1);\n      if (lastItem) {\n        lastItem.raw = lastItem.raw.trimEnd();\n        lastItem.text = lastItem.text.trimEnd();\n      } else {\n        // not a list since there were no items\n        return;\n      }\n      list.raw = list.raw.trimEnd();\n\n      // Item child tokens handled here at end because we needed to have the final item to trim it first\n      for (let i = 0; i < list.items.length; i++) {\n        this.lexer.state.top = false;\n        list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []);\n\n        if (!list.loose) {\n          // Check if list should be loose\n          const spacers = list.items[i].tokens.filter(t => t.type === 'space');\n          const hasMultipleLineBreaks = spacers.length > 0 && spacers.some(t => this.rules.other.anyLine.test(t.raw));\n\n          list.loose = hasMultipleLineBreaks;\n        }\n      }\n\n      // Set all items to loose if list is loose\n      if (list.loose) {\n        for (let i = 0; i < list.items.length; i++) {\n          list.items[i].loose = true;\n        }\n      }\n\n      return list;\n    }\n  }\n\n  html(src: string): Tokens.HTML | undefined {\n    const cap = this.rules.block.html.exec(src);\n    if (cap) {\n      const token: Tokens.HTML = {\n        type: 'html',\n        block: true,\n        raw: cap[0],\n        pre: cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style',\n        text: cap[0],\n      };\n      return token;\n    }\n  }\n\n  def(src: string): Tokens.Def | undefined {\n    const cap = this.rules.block.def.exec(src);\n    if (cap) {\n      const tag = cap[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, ' ');\n      const href = cap[2] ? cap[2].replace(this.rules.other.hrefBrackets, '$1').replace(this.rules.inline.anyPunctuation, '$1') : '';\n      const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, '$1') : cap[3];\n      return {\n        type: 'def',\n        tag,\n        raw: cap[0],\n        href,\n        title,\n      };\n    }\n  }\n\n  table(src: string): Tokens.Table | undefined {\n    const cap = this.rules.block.table.exec(src);\n    if (!cap) {\n      return;\n    }\n\n    if (!this.rules.other.tableDelimiter.test(cap[2])) {\n      // delimiter row must have a pipe (|) or colon (:) otherwise it is a setext heading\n      return;\n    }\n\n    const headers = splitCells(cap[1]);\n    const aligns = cap[2].replace(this.rules.other.tableAlignChars, '').split('|');\n    const rows = cap[3]?.trim() ? cap[3].replace(this.rules.other.tableRowBlankLine, '').split('\\n') : [];\n\n    const item: Tokens.Table = {\n      type: 'table',\n      raw: cap[0],\n      header: [],\n      align: [],\n      rows: [],\n    };\n\n    if (headers.length !== aligns.length) {\n      // header and align columns must be equal, rows can be different.\n      return;\n    }\n\n    for (const align of aligns) {\n      if (this.rules.other.tableAlignRight.test(align)) {\n        item.align.push('right');\n      } else if (this.rules.other.tableAlignCenter.test(align)) {\n        item.align.push('center');\n      } else if (this.rules.other.tableAlignLeft.test(align)) {\n        item.align.push('left');\n      } else {\n        item.align.push(null);\n      }\n    }\n\n    for (let i = 0; i < headers.length; i++) {\n      item.header.push({\n        text: headers[i],\n        tokens: this.lexer.inline(headers[i]),\n        header: true,\n        align: item.align[i],\n      });\n    }\n\n    for (const row of rows) {\n      item.rows.push(splitCells(row, item.header.length).map((cell, i) => {\n        return {\n          text: cell,\n          tokens: this.lexer.inline(cell),\n          header: false,\n          align: item.align[i],\n        };\n      }));\n    }\n\n    return item;\n  }\n\n  lheading(src: string): Tokens.Heading | undefined {\n    const cap = this.rules.block.lheading.exec(src);\n    if (cap) {\n      return {\n        type: 'heading',\n        raw: cap[0],\n        depth: cap[2].charAt(0) === '=' ? 1 : 2,\n        text: cap[1],\n        tokens: this.lexer.inline(cap[1]),\n      };\n    }\n  }\n\n  paragraph(src: string): Tokens.Paragraph | undefined {\n    const cap = this.rules.block.paragraph.exec(src);\n    if (cap) {\n      const text = cap[1].charAt(cap[1].length - 1) === '\\n'\n        ? cap[1].slice(0, -1)\n        : cap[1];\n      return {\n        type: 'paragraph',\n        raw: cap[0],\n        text,\n        tokens: this.lexer.inline(text),\n      };\n    }\n  }\n\n  text(src: string): Tokens.Text | undefined {\n    const cap = this.rules.block.text.exec(src);\n    if (cap) {\n      return {\n        type: 'text',\n        raw: cap[0],\n        text: cap[0],\n        tokens: this.lexer.inline(cap[0]),\n      };\n    }\n  }\n\n  escape(src: string): Tokens.Escape | undefined {\n    const cap = this.rules.inline.escape.exec(src);\n    if (cap) {\n      return {\n        type: 'escape',\n        raw: cap[0],\n        text: cap[1],\n      };\n    }\n  }\n\n  tag(src: string): Tokens.Tag | undefined {\n    const cap = this.rules.inline.tag.exec(src);\n    if (cap) {\n      if (!this.lexer.state.inLink && this.rules.other.startATag.test(cap[0])) {\n        this.lexer.state.inLink = true;\n      } else if (this.lexer.state.inLink && this.rules.other.endATag.test(cap[0])) {\n        this.lexer.state.inLink = false;\n      }\n      if (!this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(cap[0])) {\n        this.lexer.state.inRawBlock = true;\n      } else if (this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(cap[0])) {\n        this.lexer.state.inRawBlock = false;\n      }\n\n      return {\n        type: 'html',\n        raw: cap[0],\n        inLink: this.lexer.state.inLink,\n        inRawBlock: this.lexer.state.inRawBlock,\n        block: false,\n        text: cap[0],\n      };\n    }\n  }\n\n  link(src: string): Tokens.Link | Tokens.Image | undefined {\n    const cap = this.rules.inline.link.exec(src);\n    if (cap) {\n      const trimmedUrl = cap[2].trim();\n      if (!this.options.pedantic && this.rules.other.startAngleBracket.test(trimmedUrl)) {\n        // commonmark requires matching angle brackets\n        if (!(this.rules.other.endAngleBracket.test(trimmedUrl))) {\n          return;\n        }\n\n        // ending angle bracket cannot be escaped\n        const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\\\');\n        if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {\n          return;\n        }\n      } else {\n        // find closing parenthesis\n        const lastParenIndex = findClosingBracket(cap[2], '()');\n        if (lastParenIndex === -2) {\n          // more open parens than closed\n          return;\n        }\n\n        if (lastParenIndex > -1) {\n          const start = cap[0].indexOf('!') === 0 ? 5 : 4;\n          const linkLen = start + cap[1].length + lastParenIndex;\n          cap[2] = cap[2].substring(0, lastParenIndex);\n          cap[0] = cap[0].substring(0, linkLen).trim();\n          cap[3] = '';\n        }\n      }\n      let href = cap[2];\n      let title = '';\n      if (this.options.pedantic) {\n        // split pedantic href and title\n        const link = this.rules.other.pedanticHrefTitle.exec(href);\n\n        if (link) {\n          href = link[1];\n          title = link[3];\n        }\n      } else {\n        title = cap[3] ? cap[3].slice(1, -1) : '';\n      }\n\n      href = href.trim();\n      if (this.rules.other.startAngleBracket.test(href)) {\n        if (this.options.pedantic && !(this.rules.other.endAngleBracket.test(trimmedUrl))) {\n          // pedantic allows starting angle bracket without ending angle bracket\n          href = href.slice(1);\n        } else {\n          href = href.slice(1, -1);\n        }\n      }\n      return outputLink(cap, {\n        href: href ? href.replace(this.rules.inline.anyPunctuation, '$1') : href,\n        title: title ? title.replace(this.rules.inline.anyPunctuation, '$1') : title,\n      }, cap[0], this.lexer, this.rules);\n    }\n  }\n\n  reflink(src: string, links: Links): Tokens.Link | Tokens.Image | Tokens.Text | undefined {\n    let cap;\n    if ((cap = this.rules.inline.reflink.exec(src))\n      || (cap = this.rules.inline.nolink.exec(src))) {\n      const linkString = (cap[2] || cap[1]).replace(this.rules.other.multipleSpaceGlobal, ' ');\n      const link = links[linkString.toLowerCase()];\n      if (!link) {\n        const text = cap[0].charAt(0);\n        return {\n          type: 'text',\n          raw: text,\n          text,\n        };\n      }\n      return outputLink(cap, link, cap[0], this.lexer, this.rules);\n    }\n  }\n\n  emStrong(src: string, maskedSrc: string, prevChar = ''): Tokens.Em | Tokens.Strong | undefined {\n    let match = this.rules.inline.emStrongLDelim.exec(src);\n    if (!match) return;\n\n    // _ can't be between two alphanumerics. \\p{L}\\p{N} includes non-english alphabet/numbers as well\n    if (match[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric)) return;\n\n    const nextChar = match[1] || match[2] || '';\n\n    if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) {\n      // unicode Regex counts emoji as 1 char; spread into array for proper count (used multiple times below)\n      const lLength = [...match[0]].length - 1;\n      let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0;\n\n      const endReg = match[0][0] === '*' ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;\n      endReg.lastIndex = 0;\n\n      // Clip maskedSrc to same section of string as src (move to lexer?)\n      maskedSrc = maskedSrc.slice(-1 * src.length + lLength);\n\n      while ((match = endReg.exec(maskedSrc)) != null) {\n        rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6];\n\n        if (!rDelim) continue; // skip single * in __abc*abc__\n\n        rLength = [...rDelim].length;\n\n        if (match[3] || match[4]) { // found another Left Delim\n          delimTotal += rLength;\n          continue;\n        } else if (match[5] || match[6]) { // either Left or Right Delim\n          if (lLength % 3 && !((lLength + rLength) % 3)) {\n            midDelimTotal += rLength;\n            continue; // CommonMark Emphasis Rules 9-10\n          }\n        }\n\n        delimTotal -= rLength;\n\n        if (delimTotal > 0) continue; // Haven't found enough closing delimiters\n\n        // Remove extra characters. *a*** -> *a*\n        rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal);\n        // char length can be >1 for unicode characters;\n        const lastCharLength = [...match[0]][0].length;\n        const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);\n\n        // Create `em` if smallest delimiter has odd char count. *a***\n        if (Math.min(lLength, rLength) % 2) {\n          const text = raw.slice(1, -1);\n          return {\n            type: 'em',\n            raw,\n            text,\n            tokens: this.lexer.inlineTokens(text),\n          };\n        }\n\n        // Create 'strong' if smallest delimiter has even char count. **a***\n        const text = raw.slice(2, -2);\n        return {\n          type: 'strong',\n          raw,\n          text,\n          tokens: this.lexer.inlineTokens(text),\n        };\n      }\n    }\n  }\n\n  codespan(src: string): Tokens.Codespan | undefined {\n    const cap = this.rules.inline.code.exec(src);\n    if (cap) {\n      let text = cap[2].replace(this.rules.other.newLineCharGlobal, ' ');\n      const hasNonSpaceChars = this.rules.other.nonSpaceChar.test(text);\n      const hasSpaceCharsOnBothEnds = this.rules.other.startingSpaceChar.test(text) && this.rules.other.endingSpaceChar.test(text);\n      if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {\n        text = text.substring(1, text.length - 1);\n      }\n      return {\n        type: 'codespan',\n        raw: cap[0],\n        text,\n      };\n    }\n  }\n\n  br(src: string): Tokens.Br | undefined {\n    const cap = this.rules.inline.br.exec(src);\n    if (cap) {\n      return {\n        type: 'br',\n        raw: cap[0],\n      };\n    }\n  }\n\n  del(src: string): Tokens.Del | undefined {\n    const cap = this.rules.inline.del.exec(src);\n    if (cap) {\n      return {\n        type: 'del',\n        raw: cap[0],\n        text: cap[2],\n        tokens: this.lexer.inlineTokens(cap[2]),\n      };\n    }\n  }\n\n  autolink(src: string): Tokens.Link | undefined {\n    const cap = this.rules.inline.autolink.exec(src);\n    if (cap) {\n      let text, href;\n      if (cap[2] === '@') {\n        text = cap[1];\n        href = 'mailto:' + text;\n      } else {\n        text = cap[1];\n        href = text;\n      }\n\n      return {\n        type: 'link',\n        raw: cap[0],\n        text,\n        href,\n        tokens: [\n          {\n            type: 'text',\n            raw: text,\n            text,\n          },\n        ],\n      };\n    }\n  }\n\n  url(src: string): Tokens.Link | undefined {\n    let cap;\n    if (cap = this.rules.inline.url.exec(src)) {\n      let text, href;\n      if (cap[2] === '@') {\n        text = cap[0];\n        href = 'mailto:' + text;\n      } else {\n        // do extended autolink path validation\n        let prevCapZero;\n        do {\n          prevCapZero = cap[0];\n          cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? '';\n        } while (prevCapZero !== cap[0]);\n        text = cap[0];\n        if (cap[1] === 'www.') {\n          href = 'http://' + cap[0];\n        } else {\n          href = cap[0];\n        }\n      }\n      return {\n        type: 'link',\n        raw: cap[0],\n        text,\n        href,\n        tokens: [\n          {\n            type: 'text',\n            raw: text,\n            text,\n          },\n        ],\n      };\n    }\n  }\n\n  inlineText(src: string): Tokens.Text | undefined {\n    const cap = this.rules.inline.text.exec(src);\n    if (cap) {\n      const escaped = this.lexer.state.inRawBlock;\n      return {\n        type: 'text',\n        raw: cap[0],\n        text: cap[0],\n        escaped,\n      };\n    }\n  }\n}\n", "import { _Tokenizer } from './Tokenizer.ts';\nimport { _defaults } from './defaults.ts';\nimport { other, block, inline } from './rules.ts';\nimport type { Token, TokensList, Tokens } from './Tokens.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\n\n/**\n * Block Lexer\n */\nexport class _Lexer<ParserOutput = string, RendererOutput = string> {\n  tokens: TokensList;\n  options: MarkedOptions<ParserOutput, RendererOutput>;\n  state: {\n    inLink: boolean;\n    inRawBlock: boolean;\n    top: boolean;\n  };\n\n  private tokenizer: _Tokenizer<ParserOutput, RendererOutput>;\n  private inlineQueue: { src: string, tokens: Token[] }[];\n\n  constructor(options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    // TokenList cannot be created in one go\n    this.tokens = [] as unknown as TokensList;\n    this.tokens.links = Object.create(null);\n    this.options = options || _defaults;\n    this.options.tokenizer = this.options.tokenizer || new _Tokenizer<ParserOutput, RendererOutput>();\n    this.tokenizer = this.options.tokenizer;\n    this.tokenizer.options = this.options;\n    this.tokenizer.lexer = this;\n    this.inlineQueue = [];\n    this.state = {\n      inLink: false,\n      inRawBlock: false,\n      top: true,\n    };\n\n    const rules = {\n      other,\n      block: block.normal,\n      inline: inline.normal,\n    };\n\n    if (this.options.pedantic) {\n      rules.block = block.pedantic;\n      rules.inline = inline.pedantic;\n    } else if (this.options.gfm) {\n      rules.block = block.gfm;\n      if (this.options.breaks) {\n        rules.inline = inline.breaks;\n      } else {\n        rules.inline = inline.gfm;\n      }\n    }\n    this.tokenizer.rules = rules;\n  }\n\n  /**\n   * Expose Rules\n   */\n  static get rules() {\n    return {\n      block,\n      inline,\n    };\n  }\n\n  /**\n   * Static Lex Method\n   */\n  static lex<ParserOutput = string, RendererOutput = string>(src: string, options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    const lexer = new _Lexer<ParserOutput, RendererOutput>(options);\n    return lexer.lex(src);\n  }\n\n  /**\n   * Static Lex Inline Method\n   */\n  static lexInline<ParserOutput = string, RendererOutput = string>(src: string, options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    const lexer = new _Lexer<ParserOutput, RendererOutput>(options);\n    return lexer.inlineTokens(src);\n  }\n\n  /**\n   * Preprocessing\n   */\n  lex(src: string) {\n    src = src.replace(other.carriageReturn, '\\n');\n\n    this.blockTokens(src, this.tokens);\n\n    for (let i = 0; i < this.inlineQueue.length; i++) {\n      const next = this.inlineQueue[i];\n      this.inlineTokens(next.src, next.tokens);\n    }\n    this.inlineQueue = [];\n\n    return this.tokens;\n  }\n\n  /**\n   * Lexing\n   */\n  blockTokens(src: string, tokens?: Token[], lastParagraphClipped?: boolean): Token[];\n  blockTokens(src: string, tokens?: TokensList, lastParagraphClipped?: boolean): TokensList;\n  blockTokens(src: string, tokens: Token[] = [], lastParagraphClipped = false) {\n    if (this.options.pedantic) {\n      src = src.replace(other.tabCharGlobal, '    ').replace(other.spaceLine, '');\n    }\n\n    while (src) {\n      let token: Tokens.Generic | undefined;\n\n      if (this.options.extensions?.block?.some((extTokenizer) => {\n        if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n          src = src.substring(token.raw.length);\n          tokens.push(token);\n          return true;\n        }\n        return false;\n      })) {\n        continue;\n      }\n\n      // newline\n      if (token = this.tokenizer.space(src)) {\n        src = src.substring(token.raw.length);\n        const lastToken = tokens.at(-1);\n        if (token.raw.length === 1 && lastToken !== undefined) {\n          // if there's a single \\n as a spacer, it's terminating the last line,\n          // so move it there so that we don't get unnecessary paragraph tags\n          lastToken.raw += '\\n';\n        } else {\n          tokens.push(token);\n        }\n        continue;\n      }\n\n      // code\n      if (token = this.tokenizer.code(src)) {\n        src = src.substring(token.raw.length);\n        const lastToken = tokens.at(-1);\n        // An indented code block cannot interrupt a paragraph.\n        if (lastToken?.type === 'paragraph' || lastToken?.type === 'text') {\n          lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n          lastToken.text += '\\n' + token.text;\n          this.inlineQueue.at(-1)!.src = lastToken.text;\n        } else {\n          tokens.push(token);\n        }\n        continue;\n      }\n\n      // fences\n      if (token = this.tokenizer.fences(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // heading\n      if (token = this.tokenizer.heading(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // hr\n      if (token = this.tokenizer.hr(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // blockquote\n      if (token = this.tokenizer.blockquote(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // list\n      if (token = this.tokenizer.list(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // html\n      if (token = this.tokenizer.html(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // def\n      if (token = this.tokenizer.def(src)) {\n        src = src.substring(token.raw.length);\n        const lastToken = tokens.at(-1);\n        if (lastToken?.type === 'paragraph' || lastToken?.type === 'text') {\n          lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n          lastToken.text += '\\n' + token.raw;\n          this.inlineQueue.at(-1)!.src = lastToken.text;\n        } else if (!this.tokens.links[token.tag]) {\n          this.tokens.links[token.tag] = {\n            href: token.href,\n            title: token.title,\n          };\n          tokens.push(token);\n        }\n        continue;\n      }\n\n      // table (gfm)\n      if (token = this.tokenizer.table(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // lheading\n      if (token = this.tokenizer.lheading(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // top-level paragraph\n      // prevent paragraph consuming extensions by clipping 'src' to extension start\n      let cutSrc = src;\n      if (this.options.extensions?.startBlock) {\n        let startIndex = Infinity;\n        const tempSrc = src.slice(1);\n        let tempStart;\n        this.options.extensions.startBlock.forEach((getStartIndex) => {\n          tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n          if (typeof tempStart === 'number' && tempStart >= 0) {\n            startIndex = Math.min(startIndex, tempStart);\n          }\n        });\n        if (startIndex < Infinity && startIndex >= 0) {\n          cutSrc = src.substring(0, startIndex + 1);\n        }\n      }\n      if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) {\n        const lastToken = tokens.at(-1);\n        if (lastParagraphClipped && lastToken?.type === 'paragraph') {\n          lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n          lastToken.text += '\\n' + token.text;\n          this.inlineQueue.pop();\n          this.inlineQueue.at(-1)!.src = lastToken.text;\n        } else {\n          tokens.push(token);\n        }\n        lastParagraphClipped = cutSrc.length !== src.length;\n        src = src.substring(token.raw.length);\n        continue;\n      }\n\n      // text\n      if (token = this.tokenizer.text(src)) {\n        src = src.substring(token.raw.length);\n        const lastToken = tokens.at(-1);\n        if (lastToken?.type === 'text') {\n          lastToken.raw += (lastToken.raw.endsWith('\\n') ? '' : '\\n') + token.raw;\n          lastToken.text += '\\n' + token.text;\n          this.inlineQueue.pop();\n          this.inlineQueue.at(-1)!.src = lastToken.text;\n        } else {\n          tokens.push(token);\n        }\n        continue;\n      }\n\n      if (src) {\n        const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n        if (this.options.silent) {\n          console.error(errMsg);\n          break;\n        } else {\n          throw new Error(errMsg);\n        }\n      }\n    }\n\n    this.state.top = true;\n    return tokens;\n  }\n\n  inline(src: string, tokens: Token[] = []) {\n    this.inlineQueue.push({ src, tokens });\n    return tokens;\n  }\n\n  /**\n   * Lexing/Compiling\n   */\n  inlineTokens(src: string, tokens: Token[] = []): Token[] {\n    // String with links masked to avoid interference with em and strong\n    let maskedSrc = src;\n    let match: RegExpExecArray | null = null;\n\n    // Mask out reflinks\n    if (this.tokens.links) {\n      const links = Object.keys(this.tokens.links);\n      if (links.length > 0) {\n        while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) {\n          if (links.includes(match[0].slice(match[0].lastIndexOf('[') + 1, -1))) {\n            maskedSrc = maskedSrc.slice(0, match.index)\n              + '[' + 'a'.repeat(match[0].length - 2) + ']'\n              + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex);\n          }\n        }\n      }\n    }\n\n    // Mask out escaped characters\n    while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) {\n      maskedSrc = maskedSrc.slice(0, match.index) + '++' + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);\n    }\n\n    // Mask out other blocks\n    let offset;\n    while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) {\n      offset = match[2] ? match[2].length : 0;\n      maskedSrc = maskedSrc.slice(0, match.index + offset) + '[' + 'a'.repeat(match[0].length - offset - 2) + ']' + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);\n    }\n\n    // Mask out blocks from extensions\n    maskedSrc = this.options.hooks?.emStrongMask?.call({ lexer: this }, maskedSrc) ?? maskedSrc;\n\n    let keepPrevChar = false;\n    let prevChar = '';\n    while (src) {\n      if (!keepPrevChar) {\n        prevChar = '';\n      }\n      keepPrevChar = false;\n\n      let token: Tokens.Generic | undefined;\n\n      // extensions\n      if (this.options.extensions?.inline?.some((extTokenizer) => {\n        if (token = extTokenizer.call({ lexer: this }, src, tokens)) {\n          src = src.substring(token.raw.length);\n          tokens.push(token);\n          return true;\n        }\n        return false;\n      })) {\n        continue;\n      }\n\n      // escape\n      if (token = this.tokenizer.escape(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // tag\n      if (token = this.tokenizer.tag(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // link\n      if (token = this.tokenizer.link(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // reflink, nolink\n      if (token = this.tokenizer.reflink(src, this.tokens.links)) {\n        src = src.substring(token.raw.length);\n        const lastToken = tokens.at(-1);\n        if (token.type === 'text' && lastToken?.type === 'text') {\n          lastToken.raw += token.raw;\n          lastToken.text += token.text;\n        } else {\n          tokens.push(token);\n        }\n        continue;\n      }\n\n      // em & strong\n      if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // code\n      if (token = this.tokenizer.codespan(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // br\n      if (token = this.tokenizer.br(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // del (gfm)\n      if (token = this.tokenizer.del(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // autolink\n      if (token = this.tokenizer.autolink(src)) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // url (gfm)\n      if (!this.state.inLink && (token = this.tokenizer.url(src))) {\n        src = src.substring(token.raw.length);\n        tokens.push(token);\n        continue;\n      }\n\n      // text\n      // prevent inlineText consuming extensions by clipping 'src' to extension start\n      let cutSrc = src;\n      if (this.options.extensions?.startInline) {\n        let startIndex = Infinity;\n        const tempSrc = src.slice(1);\n        let tempStart;\n        this.options.extensions.startInline.forEach((getStartIndex) => {\n          tempStart = getStartIndex.call({ lexer: this }, tempSrc);\n          if (typeof tempStart === 'number' && tempStart >= 0) {\n            startIndex = Math.min(startIndex, tempStart);\n          }\n        });\n        if (startIndex < Infinity && startIndex >= 0) {\n          cutSrc = src.substring(0, startIndex + 1);\n        }\n      }\n      if (token = this.tokenizer.inlineText(cutSrc)) {\n        src = src.substring(token.raw.length);\n        if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started\n          prevChar = token.raw.slice(-1);\n        }\n        keepPrevChar = true;\n        const lastToken = tokens.at(-1);\n        if (lastToken?.type === 'text') {\n          lastToken.raw += token.raw;\n          lastToken.text += token.text;\n        } else {\n          tokens.push(token);\n        }\n        continue;\n      }\n\n      if (src) {\n        const errMsg = 'Infinite loop on byte: ' + src.charCodeAt(0);\n        if (this.options.silent) {\n          console.error(errMsg);\n          break;\n        } else {\n          throw new Error(errMsg);\n        }\n      }\n    }\n\n    return tokens;\n  }\n}\n", "import { _defaults } from './defaults.ts';\nimport {\n  cleanUrl,\n  escape,\n} from './helpers.ts';\nimport { other } from './rules.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\nimport type { Tokens } from './Tokens.ts';\nimport type { _Parser } from './Parser.ts';\n\n/**\n * Renderer\n */\nexport class _Renderer<ParserOutput = string, RendererOutput = string> {\n  options: MarkedOptions<ParserOutput, RendererOutput>;\n  parser!: _Parser<ParserOutput, RendererOutput>; // set by the parser\n  constructor(options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    this.options = options || _defaults;\n  }\n\n  space(token: Tokens.Space): RendererOutput {\n    return '' as RendererOutput;\n  }\n\n  code({ text, lang, escaped }: Tokens.Code): RendererOutput {\n    const langString = (lang || '').match(other.notSpaceStart)?.[0];\n\n    const code = text.replace(other.endingNewline, '') + '\\n';\n\n    if (!langString) {\n      return '<pre><code>'\n        + (escaped ? code : escape(code, true))\n        + '</code></pre>\\n' as RendererOutput;\n    }\n\n    return '<pre><code class=\"language-'\n      + escape(langString)\n      + '\">'\n      + (escaped ? code : escape(code, true))\n      + '</code></pre>\\n' as RendererOutput;\n  }\n\n  blockquote({ tokens }: Tokens.Blockquote): RendererOutput {\n    const body = this.parser.parse(tokens);\n    return `<blockquote>\\n${body}</blockquote>\\n` as RendererOutput;\n  }\n\n  html({ text }: Tokens.HTML | Tokens.Tag): RendererOutput {\n    return text as RendererOutput;\n  }\n\n  def(token: Tokens.Def): RendererOutput {\n    return '' as RendererOutput;\n  }\n\n  heading({ tokens, depth }: Tokens.Heading): RendererOutput {\n    return `<h${depth}>${this.parser.parseInline(tokens)}</h${depth}>\\n` as RendererOutput;\n  }\n\n  hr(token: Tokens.Hr): RendererOutput {\n    return '<hr>\\n' as RendererOutput;\n  }\n\n  list(token: Tokens.List): RendererOutput {\n    const ordered = token.ordered;\n    const start = token.start;\n\n    let body = '';\n    for (let j = 0; j < token.items.length; j++) {\n      const item = token.items[j];\n      body += this.listitem(item);\n    }\n\n    const type = ordered ? 'ol' : 'ul';\n    const startAttr = (ordered && start !== 1) ? (' start=\"' + start + '\"') : '';\n    return '<' + type + startAttr + '>\\n' + body + '</' + type + '>\\n' as RendererOutput;\n  }\n\n  listitem(item: Tokens.ListItem): RendererOutput {\n    let itemBody = '';\n    if (item.task) {\n      const checkbox = this.checkbox({ checked: !!item.checked });\n      if (item.loose) {\n        if (item.tokens[0]?.type === 'paragraph') {\n          item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;\n          if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {\n            item.tokens[0].tokens[0].text = checkbox + ' ' + escape(item.tokens[0].tokens[0].text);\n            item.tokens[0].tokens[0].escaped = true;\n          }\n        } else {\n          item.tokens.unshift({\n            type: 'text',\n            raw: checkbox + ' ',\n            text: checkbox + ' ',\n            escaped: true,\n          });\n        }\n      } else {\n        itemBody += checkbox + ' ';\n      }\n    }\n\n    itemBody += this.parser.parse(item.tokens, !!item.loose);\n\n    return `<li>${itemBody}</li>\\n` as RendererOutput;\n  }\n\n  checkbox({ checked }: Tokens.Checkbox): RendererOutput {\n    return '<input '\n      + (checked ? 'checked=\"\" ' : '')\n      + 'disabled=\"\" type=\"checkbox\">' as RendererOutput;\n  }\n\n  paragraph({ tokens }: Tokens.Paragraph): RendererOutput {\n    return `<p>${this.parser.parseInline(tokens)}</p>\\n` as RendererOutput;\n  }\n\n  table(token: Tokens.Table): RendererOutput {\n    let header = '';\n\n    // header\n    let cell = '';\n    for (let j = 0; j < token.header.length; j++) {\n      cell += this.tablecell(token.header[j]);\n    }\n    header += this.tablerow({ text: cell as ParserOutput });\n\n    let body = '';\n    for (let j = 0; j < token.rows.length; j++) {\n      const row = token.rows[j];\n\n      cell = '';\n      for (let k = 0; k < row.length; k++) {\n        cell += this.tablecell(row[k]);\n      }\n\n      body += this.tablerow({ text: cell as ParserOutput });\n    }\n    if (body) body = `<tbody>${body}</tbody>`;\n\n    return '<table>\\n'\n      + '<thead>\\n'\n      + header\n      + '</thead>\\n'\n      + body\n      + '</table>\\n' as RendererOutput;\n  }\n\n  tablerow({ text }: Tokens.TableRow<ParserOutput>): RendererOutput {\n    return `<tr>\\n${text}</tr>\\n` as RendererOutput;\n  }\n\n  tablecell(token: Tokens.TableCell): RendererOutput {\n    const content = this.parser.parseInline(token.tokens);\n    const type = token.header ? 'th' : 'td';\n    const tag = token.align\n      ? `<${type} align=\"${token.align}\">`\n      : `<${type}>`;\n    return tag + content + `</${type}>\\n` as RendererOutput;\n  }\n\n  /**\n   * span level renderer\n   */\n  strong({ tokens }: Tokens.Strong): RendererOutput {\n    return `<strong>${this.parser.parseInline(tokens)}</strong>` as RendererOutput;\n  }\n\n  em({ tokens }: Tokens.Em): RendererOutput {\n    return `<em>${this.parser.parseInline(tokens)}</em>` as RendererOutput;\n  }\n\n  codespan({ text }: Tokens.Codespan): RendererOutput {\n    return `<code>${escape(text, true)}</code>` as RendererOutput;\n  }\n\n  br(token: Tokens.Br): RendererOutput {\n    return '<br>' as RendererOutput;\n  }\n\n  del({ tokens }: Tokens.Del): RendererOutput {\n    return `<del>${this.parser.parseInline(tokens)}</del>` as RendererOutput;\n  }\n\n  link({ href, title, tokens }: Tokens.Link): RendererOutput {\n    const text = this.parser.parseInline(tokens) as string;\n    const cleanHref = cleanUrl(href);\n    if (cleanHref === null) {\n      return text as RendererOutput;\n    }\n    href = cleanHref;\n    let out = '<a href=\"' + href + '\"';\n    if (title) {\n      out += ' title=\"' + (escape(title)) + '\"';\n    }\n    out += '>' + text + '</a>';\n    return out as RendererOutput;\n  }\n\n  image({ href, title, text, tokens }: Tokens.Image): RendererOutput {\n    if (tokens) {\n      text = this.parser.parseInline(tokens, this.parser.textRenderer) as string;\n    }\n    const cleanHref = cleanUrl(href);\n    if (cleanHref === null) {\n      return escape(text) as RendererOutput;\n    }\n    href = cleanHref;\n\n    let out = `<img src=\"${href}\" alt=\"${text}\"`;\n    if (title) {\n      out += ` title=\"${escape(title)}\"`;\n    }\n    out += '>';\n    return out as RendererOutput;\n  }\n\n  text(token: Tokens.Text | Tokens.Escape): RendererOutput {\n    return 'tokens' in token && token.tokens\n      ? this.parser.parseInline(token.tokens) as unknown as RendererOutput\n      : ('escaped' in token && token.escaped ? token.text as RendererOutput : escape(token.text) as RendererOutput);\n  }\n}\n", "import type { Tokens } from './Tokens.ts';\n\n/**\n * TextRenderer\n * returns only the textual part of the token\n */\nexport class _TextRenderer<RendererOutput = string> {\n  // no need for block level renderers\n  strong({ text }: Tokens.Strong): RendererOutput {\n    return text as RendererOutput;\n  }\n\n  em({ text }: Tokens.Em): RendererOutput {\n    return text as RendererOutput;\n  }\n\n  codespan({ text }: Tokens.Codespan): RendererOutput {\n    return text as RendererOutput;\n  }\n\n  del({ text }: Tokens.Del): RendererOutput {\n    return text as RendererOutput;\n  }\n\n  html({ text }: Tokens.HTML | Tokens.Tag): RendererOutput {\n    return text as RendererOutput;\n  }\n\n  text({ text }: Tokens.Text | Tokens.Escape | Tokens.Tag): RendererOutput {\n    return text as RendererOutput;\n  }\n\n  link({ text }: Tokens.Link): RendererOutput {\n    return '' + text as RendererOutput;\n  }\n\n  image({ text }: Tokens.Image): RendererOutput {\n    return '' + text as RendererOutput;\n  }\n\n  br(): RendererOutput {\n    return '' as RendererOutput;\n  }\n}\n", "import { _Renderer } from './Renderer.ts';\nimport { _TextRenderer } from './TextRenderer.ts';\nimport { _defaults } from './defaults.ts';\nimport type { MarkedToken, Token, Tokens } from './Tokens.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\n\n/**\n * Parsing & Compiling\n */\nexport class _Parser<ParserOutput = string, RendererOutput = string> {\n  options: MarkedOptions<ParserOutput, RendererOutput>;\n  renderer: _Renderer<ParserOutput, RendererOutput>;\n  textRenderer: _TextRenderer<RendererOutput>;\n  constructor(options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    this.options = options || _defaults;\n    this.options.renderer = this.options.renderer || new _Renderer<ParserOutput, RendererOutput>();\n    this.renderer = this.options.renderer;\n    this.renderer.options = this.options;\n    this.renderer.parser = this;\n    this.textRenderer = new _TextRenderer<RendererOutput>();\n  }\n\n  /**\n   * Static Parse Method\n   */\n  static parse<ParserOutput = string, RendererOutput = string>(tokens: Token[], options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    const parser = new _Parser<ParserOutput, RendererOutput>(options);\n    return parser.parse(tokens);\n  }\n\n  /**\n   * Static Parse Inline Method\n   */\n  static parseInline<ParserOutput = string, RendererOutput = string>(tokens: Token[], options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    const parser = new _Parser<ParserOutput, RendererOutput>(options);\n    return parser.parseInline(tokens);\n  }\n\n  /**\n   * Parse Loop\n   */\n  parse(tokens: Token[], top = true): ParserOutput {\n    let out = '';\n\n    for (let i = 0; i < tokens.length; i++) {\n      const anyToken = tokens[i];\n\n      // Run any renderer extensions\n      if (this.options.extensions?.renderers?.[anyToken.type]) {\n        const genericToken = anyToken as Tokens.Generic;\n        const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken);\n        if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'def', 'paragraph', 'text'].includes(genericToken.type)) {\n          out += ret || '';\n          continue;\n        }\n      }\n\n      const token = anyToken as MarkedToken;\n\n      switch (token.type) {\n        case 'space': {\n          out += this.renderer.space(token);\n          continue;\n        }\n        case 'hr': {\n          out += this.renderer.hr(token);\n          continue;\n        }\n        case 'heading': {\n          out += this.renderer.heading(token);\n          continue;\n        }\n        case 'code': {\n          out += this.renderer.code(token);\n          continue;\n        }\n        case 'table': {\n          out += this.renderer.table(token);\n          continue;\n        }\n        case 'blockquote': {\n          out += this.renderer.blockquote(token);\n          continue;\n        }\n        case 'list': {\n          out += this.renderer.list(token);\n          continue;\n        }\n        case 'html': {\n          out += this.renderer.html(token);\n          continue;\n        }\n        case 'def': {\n          out += this.renderer.def(token);\n          continue;\n        }\n        case 'paragraph': {\n          out += this.renderer.paragraph(token);\n          continue;\n        }\n        case 'text': {\n          let textToken = token;\n          let body = this.renderer.text(textToken) as string;\n          while (i + 1 < tokens.length && tokens[i + 1].type === 'text') {\n            textToken = tokens[++i] as Tokens.Text;\n            body += ('\\n' + this.renderer.text(textToken));\n          }\n          if (top) {\n            out += this.renderer.paragraph({\n              type: 'paragraph',\n              raw: body,\n              text: body,\n              tokens: [{ type: 'text', raw: body, text: body, escaped: true }],\n            });\n          } else {\n            out += body;\n          }\n          continue;\n        }\n\n        default: {\n          const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n          if (this.options.silent) {\n            console.error(errMsg);\n            return '' as ParserOutput;\n          } else {\n            throw new Error(errMsg);\n          }\n        }\n      }\n    }\n\n    return out as ParserOutput;\n  }\n\n  /**\n   * Parse Inline Tokens\n   */\n  parseInline(tokens: Token[], renderer: _Renderer<ParserOutput, RendererOutput> | _TextRenderer<RendererOutput> = this.renderer): ParserOutput {\n    let out = '';\n\n    for (let i = 0; i < tokens.length; i++) {\n      const anyToken = tokens[i];\n\n      // Run any renderer extensions\n      if (this.options.extensions?.renderers?.[anyToken.type]) {\n        const ret = this.options.extensions.renderers[anyToken.type].call({ parser: this }, anyToken);\n        if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(anyToken.type)) {\n          out += ret || '';\n          continue;\n        }\n      }\n\n      const token = anyToken as MarkedToken;\n\n      switch (token.type) {\n        case 'escape': {\n          out += renderer.text(token);\n          break;\n        }\n        case 'html': {\n          out += renderer.html(token);\n          break;\n        }\n        case 'link': {\n          out += renderer.link(token);\n          break;\n        }\n        case 'image': {\n          out += renderer.image(token);\n          break;\n        }\n        case 'strong': {\n          out += renderer.strong(token);\n          break;\n        }\n        case 'em': {\n          out += renderer.em(token);\n          break;\n        }\n        case 'codespan': {\n          out += renderer.codespan(token);\n          break;\n        }\n        case 'br': {\n          out += renderer.br(token);\n          break;\n        }\n        case 'del': {\n          out += renderer.del(token);\n          break;\n        }\n        case 'text': {\n          out += renderer.text(token);\n          break;\n        }\n        default: {\n          const errMsg = 'Token with \"' + token.type + '\" type was not found.';\n          if (this.options.silent) {\n            console.error(errMsg);\n            return '' as ParserOutput;\n          } else {\n            throw new Error(errMsg);\n          }\n        }\n      }\n    }\n    return out as ParserOutput;\n  }\n}\n", "import { _defaults } from './defaults.ts';\nimport { _Lexer } from './Lexer.ts';\nimport { _Parser } from './Parser.ts';\nimport type { MarkedOptions } from './MarkedOptions.ts';\nimport type { Token, TokensList } from './Tokens.ts';\n\nexport class _Hooks<ParserOutput = string, RendererOutput = string> {\n  options: MarkedOptions<ParserOutput, RendererOutput>;\n  block?: boolean;\n\n  constructor(options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    this.options = options || _defaults;\n  }\n\n  static passThroughHooks = new Set([\n    'preprocess',\n    'postprocess',\n    'processAllTokens',\n    'emStrongMask',\n  ]);\n\n  static passThroughHooksRespectAsync = new Set([\n    'preprocess',\n    'postprocess',\n    'processAllTokens',\n  ]);\n\n  /**\n   * Process markdown before marked\n   */\n  preprocess(markdown: string) {\n    return markdown;\n  }\n\n  /**\n   * Process HTML after marked is finished\n   */\n  postprocess(html: ParserOutput) {\n    return html;\n  }\n\n  /**\n   * Process all tokens before walk tokens\n   */\n  processAllTokens(tokens: Token[] | TokensList) {\n    return tokens;\n  }\n\n  /**\n   * Mask contents that should not be interpreted as em/strong delimiters\n   */\n  emStrongMask(src: string) {\n    return src;\n  }\n\n  /**\n   * Provide function to tokenize markdown\n   */\n  provideLexer() {\n    return this.block ? _Lexer.lex : _Lexer.lexInline;\n  }\n\n  /**\n   * Provide function to parse tokens\n   */\n  provideParser() {\n    return this.block ? _Parser.parse<ParserOutput, RendererOutput> : _Parser.parseInline<ParserOutput, RendererOutput>;\n  }\n}\n", "import { _getDefaults } from './defaults.ts';\nimport { _Lexer } from './Lexer.ts';\nimport { _Parser } from './Parser.ts';\nimport { _Hooks } from './Hooks.ts';\nimport { _Renderer } from './Renderer.ts';\nimport { _Tokenizer } from './Tokenizer.ts';\nimport { _TextRenderer } from './TextRenderer.ts';\nimport { escape } from './helpers.ts';\nimport type { MarkedExtension, MarkedOptions } from './MarkedOptions.ts';\nimport type { Token, Tokens, TokensList } from './Tokens.ts';\n\nexport type MaybePromise = void | Promise<void>;\n\ntype UnknownFunction = (...args: unknown[]) => unknown;\ntype GenericRendererFunction = (...args: unknown[]) => string | false;\n\nexport class Marked<ParserOutput = string, RendererOutput = string> {\n  defaults = _getDefaults<ParserOutput, RendererOutput>();\n  options = this.setOptions;\n\n  parse = this.parseMarkdown(true);\n  parseInline = this.parseMarkdown(false);\n\n  Parser = _Parser<ParserOutput, RendererOutput>;\n  Renderer = _Renderer<ParserOutput, RendererOutput>;\n  TextRenderer = _TextRenderer<RendererOutput>;\n  Lexer = _Lexer;\n  Tokenizer = _Tokenizer<ParserOutput, RendererOutput>;\n  Hooks = _Hooks<ParserOutput, RendererOutput>;\n\n  constructor(...args: MarkedExtension<ParserOutput, RendererOutput>[]) {\n    this.use(...args);\n  }\n\n  /**\n   * Run callback for every token\n   */\n  walkTokens(tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) {\n    let values: MaybePromise[] = [];\n    for (const token of tokens) {\n      values = values.concat(callback.call(this, token));\n      switch (token.type) {\n        case 'table': {\n          const tableToken = token as Tokens.Table;\n          for (const cell of tableToken.header) {\n            values = values.concat(this.walkTokens(cell.tokens, callback));\n          }\n          for (const row of tableToken.rows) {\n            for (const cell of row) {\n              values = values.concat(this.walkTokens(cell.tokens, callback));\n            }\n          }\n          break;\n        }\n        case 'list': {\n          const listToken = token as Tokens.List;\n          values = values.concat(this.walkTokens(listToken.items, callback));\n          break;\n        }\n        default: {\n          const genericToken = token as Tokens.Generic;\n          if (this.defaults.extensions?.childTokens?.[genericToken.type]) {\n            this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {\n              const tokens = genericToken[childTokens].flat(Infinity) as Token[] | TokensList;\n              values = values.concat(this.walkTokens(tokens, callback));\n            });\n          } else if (genericToken.tokens) {\n            values = values.concat(this.walkTokens(genericToken.tokens, callback));\n          }\n        }\n      }\n    }\n    return values;\n  }\n\n  use(...args: MarkedExtension<ParserOutput, RendererOutput>[]) {\n    const extensions: MarkedOptions<ParserOutput, RendererOutput>['extensions'] = this.defaults.extensions || { renderers: {}, childTokens: {} };\n\n    args.forEach((pack) => {\n      // copy options to new object\n      const opts = { ...pack } as MarkedOptions<ParserOutput, RendererOutput>;\n\n      // set async to true if it was set to true before\n      opts.async = this.defaults.async || opts.async || false;\n\n      // ==-- Parse \"addon\" extensions --== //\n      if (pack.extensions) {\n        pack.extensions.forEach((ext) => {\n          if (!ext.name) {\n            throw new Error('extension name required');\n          }\n          if ('renderer' in ext) { // Renderer extensions\n            const prevRenderer = extensions.renderers[ext.name];\n            if (prevRenderer) {\n              // Replace extension with func to run new extension but fall back if false\n              extensions.renderers[ext.name] = function(...args) {\n                let ret = ext.renderer.apply(this, args);\n                if (ret === false) {\n                  ret = prevRenderer.apply(this, args);\n                }\n                return ret;\n              };\n            } else {\n              extensions.renderers[ext.name] = ext.renderer;\n            }\n          }\n          if ('tokenizer' in ext) { // Tokenizer Extensions\n            if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) {\n              throw new Error(\"extension level must be 'block' or 'inline'\");\n            }\n            const extLevel = extensions[ext.level];\n            if (extLevel) {\n              extLevel.unshift(ext.tokenizer);\n            } else {\n              extensions[ext.level] = [ext.tokenizer];\n            }\n            if (ext.start) { // Function to check for start of token\n              if (ext.level === 'block') {\n                if (extensions.startBlock) {\n                  extensions.startBlock.push(ext.start);\n                } else {\n                  extensions.startBlock = [ext.start];\n                }\n              } else if (ext.level === 'inline') {\n                if (extensions.startInline) {\n                  extensions.startInline.push(ext.start);\n                } else {\n                  extensions.startInline = [ext.start];\n                }\n              }\n            }\n          }\n          if ('childTokens' in ext && ext.childTokens) { // Child tokens to be visited by walkTokens\n            extensions.childTokens[ext.name] = ext.childTokens;\n          }\n        });\n        opts.extensions = extensions;\n      }\n\n      // ==-- Parse \"overwrite\" extensions --== //\n      if (pack.renderer) {\n        const renderer = this.defaults.renderer || new _Renderer<ParserOutput, RendererOutput>(this.defaults);\n        for (const prop in pack.renderer) {\n          if (!(prop in renderer)) {\n            throw new Error(`renderer '${prop}' does not exist`);\n          }\n          if (['options', 'parser'].includes(prop)) {\n            // ignore options property\n            continue;\n          }\n          const rendererProp = prop as Exclude<keyof _Renderer<ParserOutput, RendererOutput>, 'options' | 'parser'>;\n          const rendererFunc = pack.renderer[rendererProp] as GenericRendererFunction;\n          const prevRenderer = renderer[rendererProp] as GenericRendererFunction;\n          // Replace renderer with func to run extension, but fall back if false\n          renderer[rendererProp] = (...args: unknown[]) => {\n            let ret = rendererFunc.apply(renderer, args);\n            if (ret === false) {\n              ret = prevRenderer.apply(renderer, args);\n            }\n            return (ret || '') as RendererOutput;\n          };\n        }\n        opts.renderer = renderer;\n      }\n      if (pack.tokenizer) {\n        const tokenizer = this.defaults.tokenizer || new _Tokenizer<ParserOutput, RendererOutput>(this.defaults);\n        for (const prop in pack.tokenizer) {\n          if (!(prop in tokenizer)) {\n            throw new Error(`tokenizer '${prop}' does not exist`);\n          }\n          if (['options', 'rules', 'lexer'].includes(prop)) {\n            // ignore options, rules, and lexer properties\n            continue;\n          }\n          const tokenizerProp = prop as Exclude<keyof _Tokenizer<ParserOutput, RendererOutput>, 'options' | 'rules' | 'lexer'>;\n          const tokenizerFunc = pack.tokenizer[tokenizerProp] as UnknownFunction;\n          const prevTokenizer = tokenizer[tokenizerProp] as UnknownFunction;\n          // Replace tokenizer with func to run extension, but fall back if false\n          // @ts-expect-error cannot type tokenizer function dynamically\n          tokenizer[tokenizerProp] = (...args: unknown[]) => {\n            let ret = tokenizerFunc.apply(tokenizer, args);\n            if (ret === false) {\n              ret = prevTokenizer.apply(tokenizer, args);\n            }\n            return ret;\n          };\n        }\n        opts.tokenizer = tokenizer;\n      }\n\n      // ==-- Parse Hooks extensions --== //\n      if (pack.hooks) {\n        const hooks = this.defaults.hooks || new _Hooks<ParserOutput, RendererOutput>();\n        for (const prop in pack.hooks) {\n          if (!(prop in hooks)) {\n            throw new Error(`hook '${prop}' does not exist`);\n          }\n          if (['options', 'block'].includes(prop)) {\n            // ignore options and block properties\n            continue;\n          }\n          const hooksProp = prop as Exclude<keyof _Hooks<ParserOutput, RendererOutput>, 'options' | 'block'>;\n          const hooksFunc = pack.hooks[hooksProp] as UnknownFunction;\n          const prevHook = hooks[hooksProp] as UnknownFunction;\n          if (_Hooks.passThroughHooks.has(prop)) {\n            // @ts-expect-error cannot type hook function dynamically\n            hooks[hooksProp] = (arg: unknown) => {\n              if (this.defaults.async && _Hooks.passThroughHooksRespectAsync.has(prop)) {\n                return (async() => {\n                  const ret = await hooksFunc.call(hooks, arg);\n                  return prevHook.call(hooks, ret);\n                })();\n              }\n\n              const ret = hooksFunc.call(hooks, arg);\n              return prevHook.call(hooks, ret);\n            };\n          } else {\n            // @ts-expect-error cannot type hook function dynamically\n            hooks[hooksProp] = (...args: unknown[]) => {\n              if (this.defaults.async) {\n                return (async() => {\n                  let ret = await hooksFunc.apply(hooks, args);\n                  if (ret === false) {\n                    ret = await prevHook.apply(hooks, args);\n                  }\n                  return ret;\n                })();\n              }\n\n              let ret = hooksFunc.apply(hooks, args);\n              if (ret === false) {\n                ret = prevHook.apply(hooks, args);\n              }\n              return ret;\n            };\n          }\n        }\n        opts.hooks = hooks;\n      }\n\n      // ==-- Parse WalkTokens extensions --== //\n      if (pack.walkTokens) {\n        const walkTokens = this.defaults.walkTokens;\n        const packWalktokens = pack.walkTokens;\n        opts.walkTokens = function(token) {\n          let values: MaybePromise[] = [];\n          values.push(packWalktokens.call(this, token));\n          if (walkTokens) {\n            values = values.concat(walkTokens.call(this, token));\n          }\n          return values;\n        };\n      }\n\n      this.defaults = { ...this.defaults, ...opts };\n    });\n\n    return this;\n  }\n\n  setOptions(opt: MarkedOptions<ParserOutput, RendererOutput>) {\n    this.defaults = { ...this.defaults, ...opt };\n    return this;\n  }\n\n  lexer(src: string, options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    return _Lexer.lex(src, options ?? this.defaults);\n  }\n\n  parser(tokens: Token[], options?: MarkedOptions<ParserOutput, RendererOutput>) {\n    return _Parser.parse<ParserOutput, RendererOutput>(tokens, options ?? this.defaults);\n  }\n\n  private parseMarkdown(blockType: boolean) {\n    type overloadedParse = {\n      (src: string, options: MarkedOptions<ParserOutput, RendererOutput> & { async: true }): Promise<ParserOutput>;\n      (src: string, options: MarkedOptions<ParserOutput, RendererOutput> & { async: false }): ParserOutput;\n      (src: string, options?: MarkedOptions<ParserOutput, RendererOutput> | null): ParserOutput | Promise<ParserOutput>;\n    };\n\n    // eslint-disable-next-line @typescript-eslint/no-explicit-any\n    const parse: overloadedParse = (src: string, options?: MarkedOptions<ParserOutput, RendererOutput> | null): any => {\n      const origOpt = { ...options };\n      const opt = { ...this.defaults, ...origOpt };\n\n      const throwError = this.onError(!!opt.silent, !!opt.async);\n\n      // throw error if an extension set async to true but parse was called with async: false\n      if (this.defaults.async === true && origOpt.async === false) {\n        return throwError(new Error('marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.'));\n      }\n\n      // throw error in case of non string input\n      if (typeof src === 'undefined' || src === null) {\n        return throwError(new Error('marked(): input parameter is undefined or null'));\n      }\n      if (typeof src !== 'string') {\n        return throwError(new Error('marked(): input parameter is of type '\n          + Object.prototype.toString.call(src) + ', string expected'));\n      }\n\n      if (opt.hooks) {\n        opt.hooks.options = opt;\n        opt.hooks.block = blockType;\n      }\n\n      if (opt.async) {\n        return (async() => {\n          const processedSrc = opt.hooks ? await opt.hooks.preprocess(src) : src;\n          const lexer = opt.hooks ? await opt.hooks.provideLexer() : (blockType ? _Lexer.lex : _Lexer.lexInline);\n          const tokens = await lexer(processedSrc, opt);\n          const processedTokens = opt.hooks ? await opt.hooks.processAllTokens(tokens) : tokens;\n          if (opt.walkTokens) {\n            await Promise.all(this.walkTokens(processedTokens, opt.walkTokens));\n          }\n          const parser = opt.hooks ? await opt.hooks.provideParser() : (blockType ? _Parser.parse : _Parser.parseInline);\n          const html = await parser(processedTokens, opt);\n          return opt.hooks ? await opt.hooks.postprocess(html) : html;\n        })().catch(throwError);\n      }\n\n      try {\n        if (opt.hooks) {\n          src = opt.hooks.preprocess(src) as string;\n        }\n        const lexer = opt.hooks ? opt.hooks.provideLexer() : (blockType ? _Lexer.lex : _Lexer.lexInline);\n        let tokens = lexer(src, opt);\n        if (opt.hooks) {\n          tokens = opt.hooks.processAllTokens(tokens);\n        }\n        if (opt.walkTokens) {\n          this.walkTokens(tokens, opt.walkTokens);\n        }\n        const parser = opt.hooks ? opt.hooks.provideParser() : (blockType ? _Parser.parse : _Parser.parseInline);\n        let html = parser(tokens, opt);\n        if (opt.hooks) {\n          html = opt.hooks.postprocess(html);\n        }\n        return html;\n      } catch(e) {\n        return throwError(e as Error);\n      }\n    };\n\n    return parse;\n  }\n\n  private onError(silent: boolean, async: boolean) {\n    return (e: Error): string | Promise<string> => {\n      e.message += '\\nPlease report this to https://github.com/markedjs/marked.';\n\n      if (silent) {\n        const msg = '<p>An error occurred:</p><pre>'\n          + escape(e.message + '', true)\n          + '</pre>';\n        if (async) {\n          return Promise.resolve(msg);\n        }\n        return msg;\n      }\n\n      if (async) {\n        return Promise.reject(e);\n      }\n      throw e;\n    };\n  }\n}\n", "import { _Lexer } from './Lexer.ts';\nimport { _Parser } from './Parser.ts';\nimport { _Tokenizer } from './Tokenizer.ts';\nimport { _Renderer } from './Renderer.ts';\nimport { _TextRenderer } from './TextRenderer.ts';\nimport { _Hooks } from './Hooks.ts';\nimport { Marked } from './Instance.ts';\nimport {\n  _getDefaults,\n  changeDefaults,\n  _defaults,\n} from './defaults.ts';\nimport type { MarkedExtension, MarkedOptions } from './MarkedOptions.ts';\nimport type { Token, TokensList } from './Tokens.ts';\nimport type { MaybePromise } from './Instance.ts';\n\nconst markedInstance = new Marked();\n\n/**\n * Compiles markdown to HTML asynchronously.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options, having async: true\n * @return Promise of string of compiled HTML\n */\nexport function marked(src: string, options: MarkedOptions & { async: true }): Promise<string>;\n\n/**\n * Compiles markdown to HTML.\n *\n * @param src String of markdown source to be compiled\n * @param options Optional hash of options\n * @return String of compiled HTML. Will be a Promise of string if async is set to true by any extensions.\n */\nexport function marked(src: string, options: MarkedOptions & { async: false }): string;\nexport function marked(src: string, options: MarkedOptions & { async: true }): Promise<string>;\nexport function marked(src: string, options?: MarkedOptions | null): string | Promise<string>;\nexport function marked(src: string, opt?: MarkedOptions | null): string | Promise<string> {\n  return markedInstance.parse(src, opt);\n}\n\n/**\n * Sets the default options.\n *\n * @param options Hash of options\n */\nmarked.options =\nmarked.setOptions = function(options: MarkedOptions) {\n  markedInstance.setOptions(options);\n  marked.defaults = markedInstance.defaults;\n  changeDefaults(marked.defaults);\n  return marked;\n};\n\n/**\n * Gets the original marked default options.\n */\nmarked.getDefaults = _getDefaults;\n\nmarked.defaults = _defaults;\n\n/**\n * Use Extension\n */\n\nmarked.use = function(...args: MarkedExtension[]) {\n  markedInstance.use(...args);\n  marked.defaults = markedInstance.defaults;\n  changeDefaults(marked.defaults);\n  return marked;\n};\n\n/**\n * Run callback for every token\n */\n\nmarked.walkTokens = function(tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) {\n  return markedInstance.walkTokens(tokens, callback);\n};\n\n/**\n * Compiles markdown to HTML without enclosing `p` tag.\n *\n * @param src String of markdown source to be compiled\n * @param options Hash of options\n * @return String of compiled HTML\n */\nmarked.parseInline = markedInstance.parseInline;\n\n/**\n * Expose\n */\nmarked.Parser = _Parser;\nmarked.parser = _Parser.parse;\nmarked.Renderer = _Renderer;\nmarked.TextRenderer = _TextRenderer;\nmarked.Lexer = _Lexer;\nmarked.lexer = _Lexer.lex;\nmarked.Tokenizer = _Tokenizer;\nmarked.Hooks = _Hooks;\nmarked.parse = marked;\n\nexport const options = marked.options;\nexport const setOptions = marked.setOptions;\nexport const use = marked.use;\nexport const walkTokens = marked.walkTokens;\nexport const parseInline = marked.parseInline;\nexport const parse = marked;\nexport const parser = _Parser.parse;\nexport const lexer = _Lexer.lex;\nexport { _defaults as defaults, _getDefaults as getDefaults } from './defaults.ts';\nexport { _Lexer as Lexer } from './Lexer.ts';\nexport { _Parser as Parser } from './Parser.ts';\nexport { _Tokenizer as Tokenizer } from './Tokenizer.ts';\nexport { _Renderer as Renderer } from './Renderer.ts';\nexport { _TextRenderer as TextRenderer } from './TextRenderer.ts';\nexport { _Hooks as Hooks } from './Hooks.ts';\nexport { Marked } from './Instance.ts';\nexport type * from './MarkedOptions.ts';\nexport type * from './Tokens.ts';\n", "export { highlightCode, highlightElement } from './lexxy_helpers.esm.js';\nimport createDOMPurify from 'dompurify';\nimport { getStyleObjectFromCSS, getCSSFromStyleObject, $getSelectionStyleValueForProperty, $ensureForwardRangeSelection, $isAtNodeEnd, $patchStyleText, $setBlocksType, $forEachSelectedTextNode } from '@lexical/selection';\nimport { SKIP_DOM_SELECTION_TAG, CAN_UNDO_COMMAND, COMMAND_PRIORITY_LOW, CAN_REDO_COMMAND, $getSelection, $isRangeSelection, $isTextNode, DecoratorNode, $createTextNode, defineExtension, $createNodeSelection, $getRoot, $caretFromPoint, $setSelectionFromCaretRange, $getCaretRange, $normalizeCaret, $getChildCaret, $getCaretInDirection, $isParagraphNode, $isLineBreakNode, $createParagraphNode, $isElementNode, $isRootOrShadowRoot, $isRootNode, $isDecoratorNode, $getSiblingCaret, $rewindSiblingCaret, $splitAtPointCaretNext, $normalizeSelection__EXPERIMENTAL, $isNodeSelection, $isChildCaret, $isTextPointCaret, $isExtendableTextPointCaret, $isSiblingCaret, $getCommonAncestor, $findMatchingParent, TextNode, createCommand, COMMAND_PRIORITY_EDITOR, $getEditor, $getNodeByKey, HISTORY_MERGE_TAG, SKIP_SCROLL_INTO_VIEW_TAG, $cloneWithProperties, $getNearestRootOrShadowRoot, $createRangeSelection, $setSelection, ElementNode, $splitNode, createState, COMMAND_PRIORITY_NORMAL, $getState, $setState, $hasUpdateTag, PASTE_TAG, FORMAT_TEXT_COMMAND, UNDO_COMMAND, REDO_COMMAND, KEY_ARROW_RIGHT_COMMAND, KEY_TAB_COMMAND, INSERT_LINE_BREAK_COMMAND, COMMAND_PRIORITY_HIGH, INSERT_PARAGRAPH_COMMAND, OUTDENT_CONTENT_COMMAND, INDENT_CONTENT_COMMAND, KEY_ARROW_LEFT_COMMAND, KEY_ARROW_UP_COMMAND, KEY_ARROW_DOWN_COMMAND, DELETE_CHARACTER_COMMAND, SELECTION_CHANGE_COMMAND, COMMAND_PRIORITY_CRITICAL, $addUpdateTag, CLICK_COMMAND, isDOMNode, $getNearestNodeFromDOMNode, $getChildCaretAtIndex, $createLineBreakNode, SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, PASTE_COMMAND, $onUpdate, ParagraphNode, RootNode, DRAGSTART_COMMAND, DROP_COMMAND, KEY_DOWN_COMMAND, flipDirection, mergeRegister as mergeRegister$1, $createRangeSelectionFromDom, CLEAR_HISTORY_COMMAND, KEY_ENTER_COMMAND, KEY_SPACE_COMMAND, INPUT_COMMAND, HISTORY_PUSH_TAG, KEY_BACKSPACE_COMMAND } from 'lexical';\nimport * as lexical from 'lexical';\nexport { lexical as Lexical };\nimport { LinkNode, $createAutoLinkNode, $toggleLink, $createLinkNode, $isLinkNode, AutoLinkNode } from '@lexical/link';\nimport { buildEditorFromExtensions } from '@lexical/extension';\nimport { ListNode, ListItemNode, $getListDepth, $isListNode, $isListItemNode, INSERT_UNORDERED_LIST_COMMAND, INSERT_ORDERED_LIST_COMMAND, $createListNode, $createListItemNode, registerList } from '@lexical/list';\nimport { $getNearestNodeOfType, $wrapNodeInElement, $lastToFirstIterator, $descendantsMatching, $insertFirst, $unwrapAndFilterDescendants, $firstToLastIterator, mergeRegister, $insertNodeToNearestRoot, $getNearestBlockElementAncestorOrThrow, IS_APPLE } from '@lexical/utils';\nimport { registerPlainText } from '@lexical/plain-text';\nimport { RichTextExtension, $isQuoteNode, QuoteNode, $isHeadingNode, $createHeadingNode, $createQuoteNode, HeadingNode, registerRichText } from '@lexical/rich-text';\nimport { $generateNodesFromDOM, $generateHtmlFromNodes } from '@lexical/html';\nimport { HistoryExtension } from '@lexical/history';\nimport { $isCodeNode, CodeHighlightNode, $isCodeHighlightNode, $createCodeNode, $createCodeHighlightNode, CodeNode, registerCodeHighlighting, PrismTokenizer, normalizeCodeLang, CODE_LANGUAGE_FRIENDLY_NAME_MAP } from '@lexical/code';\nimport { TRANSFORMERS, registerMarkdownShortcuts } from '@lexical/markdown';\nimport { INSERT_TABLE_COMMAND, $getTableCellNodeFromLexicalNode, TableCellNode, TableNode, TableRowNode, setScrollableTablesActive, registerTablePlugin, registerTableSelectionObserver, TableCellHeaderStates, $insertTableRowAtSelection, $insertTableColumnAtSelection, $deleteTableRowAtSelection, $deleteTableColumnAtSelection, $findTableNode, $getTableRowIndexFromTableCellNode, $getTableColumnIndexFromTableCellNode, $findCellNode, $getElementForTableNode } from '@lexical/table';\nimport { Marked } from 'marked';\nimport { $insertDataTransferForRichText } from '@lexical/clipboard';\nimport 'prismjs';\nimport 'prismjs/components/prism-clike';\nimport 'prismjs/components/prism-diff';\nimport 'prismjs/components/prism-javascript';\nimport 'prismjs/components/prism-markup';\nimport 'prismjs/components/prism-markdown';\nimport 'prismjs/components/prism-c';\nimport 'prismjs/components/prism-css';\nimport 'prismjs/components/prism-objectivec';\nimport 'prismjs/components/prism-sql';\nimport 'prismjs/components/prism-powershell';\nimport 'prismjs/components/prism-python';\nimport 'prismjs/components/prism-rust';\nimport 'prismjs/components/prism-swift';\nimport 'prismjs/components/prism-typescript';\nimport 'prismjs/components/prism-java';\nimport 'prismjs/components/prism-cpp';\nimport 'prismjs/components/prism-markup-templating';\nimport 'prismjs/components/prism-ruby';\nimport 'prismjs/components/prism-php';\nimport 'prismjs/components/prism-go';\nimport 'prismjs/components/prism-bash';\nimport 'prismjs/components/prism-json';\nimport 'prismjs/components/prism-kotlin';\n\nfunction deepMerge(target, source) {\n  const result = { ...target, ...source };\n  for (const [ key, value ] of Object.entries(source)) {\n    if (arePlainHashes(target[key], value)) {\n      result[key] = deepMerge(target[key], value);\n    }\n  }\n\n  return result\n}\n\nfunction arePlainHashes(...values) {\n  return values.every(value => value && value.constructor == Object)\n}\n\nclass Configuration {\n  #tree = {}\n\n  constructor(...configs) {\n    this.merge(...configs);\n  }\n\n  merge(...configs) {\n    return this.#tree = configs.reduce(deepMerge, this.#tree)\n  }\n\n  get(path) {\n    const keys = path.split(\".\");\n    return keys.reduce((node, key) => node[key], this.#tree)\n  }\n}\n\nconst global = new Configuration({\n  attachmentTagName: \"action-text-attachment\",\n  attachmentContentTypeNamespace: \"actiontext\",\n  authenticatedUploads: false,\n  extensions: []\n});\n\nconst presets = new Configuration({\n  default: {\n    attachments: true,\n    markdown: true,\n    multiLine: true,\n    permittedAttachmentTypes: null,\n    richText: true,\n    toolbar: {\n      upload: \"both\"\n    },\n    headings: [ \"h2\", \"h3\", \"h4\" ],\n    highlight: {\n      buttons: {\n        color: [\n          { value: \"var(--highlight-1)\", label: \"Yellow\" },\n          { value: \"var(--highlight-2)\", label: \"Orange\" },\n          { value: \"var(--highlight-3)\", label: \"Red\" },\n          { value: \"var(--highlight-4)\", label: \"Magenta\" },\n          { value: \"var(--highlight-5)\", label: \"Purple\" },\n          { value: \"var(--highlight-6)\", label: \"Blue\" },\n          { value: \"var(--highlight-7)\", label: \"Green\" },\n          { value: \"var(--highlight-8)\", label: \"Sand\" },\n          { value: \"var(--highlight-9)\", label: \"Gray\" },\n        ],\n        \"background-color\": [\n          { value: \"var(--highlight-bg-1)\", label: \"Yellow\" },\n          { value: \"var(--highlight-bg-2)\", label: \"Orange\" },\n          { value: \"var(--highlight-bg-3)\", label: \"Red\" },\n          { value: \"var(--highlight-bg-4)\", label: \"Magenta\" },\n          { value: \"var(--highlight-bg-5)\", label: \"Purple\" },\n          { value: \"var(--highlight-bg-6)\", label: \"Blue\" },\n          { value: \"var(--highlight-bg-7)\", label: \"Green\" },\n          { value: \"var(--highlight-bg-8)\", label: \"Sand\" },\n          { value: \"var(--highlight-bg-9)\", label: \"Gray\" },\n        ],\n      },\n      permit: {\n        color: [],\n        \"background-color\": []\n      }\n    }\n  }\n});\n\nvar Lexxy = {\n  global,\n  presets,\n  configure({ global: newGlobal, ...newPresets }) {\n    if (newGlobal) {\n      global.merge(newGlobal);\n    }\n    presets.merge(newPresets);\n  }\n};\n\n// An attachment's `url` ends up as an <img src> (action_text_attachment_node\n// reads it into `this.src`, which is assigned to img.src). DOMPurify already\n// permits a data: URI on img[src] \u2014 img is in its DATA_URI_TAGS \u2014 but it has no\n// way to know that a custom element's `url` feeds the same sink, so it applies\n// the plain URI check and drops it.\n//\n// Until 3.3.2 that never came up: attributes admitted by a *functional* ADD_ATTR\n// skipped URI validation entirely (GHSA-cjmm-f4jc-qw8r), which is how data:\n// URLs worked here \u2014 and, less happily, how `url=\"javascript:\u2026\"` survived too.\n// The fix restored validation for both. The bypass was reported to us by\n// @petitpois via HackerOne.\n//\n// So `url` is marked URI-safe, which hands the decision to this hook. The hook\n// only ever removes an attribute \u2014 it never force-keeps one \u2014 so scoping stays\n// with the ADD_ATTR predicate, and a `url` on a tag that never declared it is\n// dropped as it always was.\n//\n// The data: exception is scoped to the attachment element, not to the attribute\n// name. ADD_URI_SAFE_ATTR is attribute-name-wide: it takes `url` out of\n// DOMPurify's URI checking on every tag, not just ours. Extensions may declare\n// arbitrary attributes on arbitrary tags \u2014 home/docs/extensions.md's own worked\n// example is an <iframe> \u2014 so an extension declaring `url` would otherwise\n// inherit an exception granted because *an attachment's* url becomes an img src.\n// Nothing about a third party's element supports that, and `data:text/html` in a\n// navigational sink is script execution. Everything else gets the standard\n// policy, which is what it would have had if we had never touched `url`.\n//\n// That argument is about an attribute feeding a URL sink, not about\n// ADD_URI_SAFE_ATTR as such. The inert text attributes beside `url` in that list\n// \u2014 `caption`, `filename` \u2014 keep the attribute-name-wide exemption, and need it:\n// ordinary prose like \"Q4: results\" is not a URI any regex here would accept.\nconst URI_BEARING_ATTACHMENT_ATTRIBUTES = [ \"url\" ];\n\n// DOMPurify's own IS_ALLOWED_URI scheme list, reproduced rather than narrowed, so\n// `url` on a non-attachment tag is treated exactly as DOMPurify would have treated\n// it. Kept as a source string so allowedUriRegexp() can widen it with an editor's\n// declared schemes without re-deriving the rest of the pattern.\nconst BASE_URI_SCHEMES = \"(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix\";\n\n// A scheme name (not a full pattern), so a caller can't inject regexp syntax.\nconst SCHEME_NAME = /^[a-z][a-z0-9+.-]*$/;\n\n// The executable schemes, by DOMPurify's own IS_SCRIPT_OR_DATA definition\n// (/^(?:\\w+script|data):/i): javascript, vbscript, \u2026script, and data. Widening the\n// allowlist to admit one would let it survive on href/object[data], which the\n// override otherwise defeats \u2014 DOMPurify does not re-block a scheme its\n// ALLOWED_URI_REGEXP accepts. A caller declaring one is dropped, so it stays\n// refused. This is a closed set (the schemes a browser executes), not a growing\n// denylist.\nconst EXECUTABLE_SCHEME = /^(?:\\w+script|data)$/i;\n\n// Builds DOMPurify's default IS_ALLOWED_URI, optionally with extra schemes folded\n// into the scheme alternation. Widening the recognised-safe scheme set is how a\n// custom-scheme identifier (a mention's `gid://\u2026`) passes validation without\n// exempting any attribute from it. Passing no schemes reproduces DOMPurify's\n// default exactly.\nfunction allowedUriRegexp(extraSchemes = []) {\n  const extra = extraSchemes\n    .map(scheme => String(scheme).toLowerCase())\n    .filter(scheme => SCHEME_NAME.test(scheme) && !EXECUTABLE_SCHEME.test(scheme))\n    .map(scheme => scheme.replace(/[.+-]/g, \"\\\\$&\"));\n\n  const schemes = [ BASE_URI_SCHEMES, ...extra ].join(\"|\");\n\n  return new RegExp(`^(?:(?:${schemes}):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))`, \"i\")\n}\n\nconst ALLOWED_URI = allowedUriRegexp();\n\n// eslint-disable-next-line no-control-regex -- mirrors DOMPurify's own ATTR_WHITESPACE\nconst ATTR_WHITESPACE = /[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g;\n\n// Tested against the value as given, never the whitespace-stripped copy, so a\n// scheme smuggled at a nonzero offset is refused. DOMPurify draws the same line:\n// its data: allowance is a prefix test on the un-stripped value, which is why\n// this is a second step rather than one more scheme in ALLOWED_URI.\n//\n// One deliberate difference from DOMPurify's img[src] handling remains, stated\n// because the earlier claim of matching it \"exactly\" was not true: DOMPurify\n// tests for a literal lowercase `data:` and this is case-insensitive, so `DATA:`\n// passes here too. That matches how browsers resolve schemes, which is what\n// actually decides whether the URL loads.\nconst ATTACHMENT_DATA_URI = /^data:/i;\n\nfunction isAttachmentTag(tag) {\n  return tag === Lexxy.global.get(\"attachmentTagName\")\n}\n\nfunction attachmentUriFilterHook(currentNode, hookEvent) {\n  if (!URI_BEARING_ATTACHMENT_ATTRIBUTES.includes(hookEvent.attrName)) return\n\n  // DOMPurify keeps an empty value \u2014 its chain ends `else if (value) { return\n  // false } else ;` \u2014 while every alternation here needs at least one character.\n  if (!hookEvent.attrValue) return\n\n  const value = String(hookEvent.attrValue);\n\n  if (ALLOWED_URI.test(value.replace(ATTR_WHITESPACE, \"\"))) return\n  if (isAttachmentTag(currentNode?.nodeName?.toLowerCase()) && ATTACHMENT_DATA_URI.test(value)) return\n\n  hookEvent.keepAttr = false;\n}\n\n// Lexxy's own DOMPurify instance, deliberately not the shared default export.\n//\n// dompurify's default export is a singleton, and both its config and its hooks\n// are global to every consumer in the bundle. That makes configuring it from an\n// editor's connectedCallback actively dangerous for the host app: DOMPurify\n// treats a persistent config as final, so once setConfig() has run, every\n// later `sanitize(html, config)` anywhere in the app silently ignores its own\n// config argument. An app sanitizing untrusted HTML with, say,\n// `{ ALLOW_DATA_ATTR: false }` would keep passing that option and stop getting\n// it the moment a Lexxy editor connected \u2014 with no error and no visible change\n// at the call site.\n//\n// Calling the default export with a window returns a fresh, independent\n// instance. This one carries the hooks and config below; nothing we do here can\n// reach the app's instance, and nothing it does can reach ours.\n//\n// Under Trusted Types, every DOMPurify instance tries to create a policy named\n// `dompurify` on its first sanitize, and TT rejects a duplicate name \u2014 so the\n// second instance on the page gets none. That matters, and not because it throws:\n// DOMPurify hands its input to DOMParser.parseFromString, which is itself a TT\n// sink, but `_initDocument` swallows that throw and the innerHTML throw from its\n// createDocument fallback, and `sanitize` then returns \"\" for the body it never\n// got. An unsigned instance silently drops all content, with nothing in the host's\n// error tracker to say why \u2014 and which sanitizer goes silent depends on which one\n// ran first.\n//\n// So we create our own, under our own name, and hand it to DOMPurify rather than\n// letting it try. Lazily, because resolving it at import would fire a CSP\n// violation report on every page load of an app that imports Lexxy and never\n// renders an editor, and at most once, because TT throws on a duplicate name.\n// Guarded too, because creating a policy the CSP hasn't allowlisted throws: if\n// that happens we're back to no policy, which is exactly where this stood before.\n// An app enforcing `require-trusted-types-for 'script'` should add `lexxy` to its\n// `trusted-types` directive.\n//\n// What this does NOT do is make Lexxy work under enforced Trusted Types. It\n// stops *our* sanitizer from taking the host's policy name and breaking the\n// host's; it does nothing about Lexxy's own unwrapped sinks, and there are\n// several. `parseHtml` in helpers/html_helper.js hands a plain string to\n// DOMParser.parseFromString on the initial-value path, so the editor throws\n// before it finishes connecting \u2014 verified in Chromium under\n// `require-trusted-types-for 'script'`, with `lexxy` allowlisted and without.\n// `createElement` in the same file is a second sink in it, writing its `content`\n// argument through innerHTML for the two callers that pass one \u2014 the wrapped-table\n// figure and the table tools' count. `highlightElement` in\n// helpers/code_highlighting_helper.js writes Prism's output the same way, and both\n// it and highlightCode are exported from src/index.js \u2014 so that one throws for a\n// host app calling Lexxy's highlighting API directly, outside any editor. The\n// `insertAdjacentHTML` in nodes/custom_action_text_attachment_node.js and the\n// `innerHTML` writes across elements/ \u2014 the toolbar, the dropdowns, the node\n// delete button \u2014 are in the same position. Making the editor usable under TT is a\n// separate piece of work; this is a prerequisite for it, not the whole of it.\nlet trustedTypesPolicyResolved = false;\nlet resolvedTrustedTypesPolicy = null;\n\nfunction trustedTypesPolicy() {\n  if (!trustedTypesPolicyResolved) {\n    resolvedTrustedTypesPolicy = createTrustedTypesPolicy();\n    trustedTypesPolicyResolved = true;\n  }\n\n  return resolvedTrustedTypesPolicy\n}\n\nfunction createTrustedTypesPolicy() {\n  // Feature-detected below, so browsers without Trusted Types simply get no\n  // policy \u2014 the same path as a CSP that doesn't allowlist ours.\n  // eslint-disable-next-line compat/compat\n  const trustedTypes = window.trustedTypes;\n\n  if (typeof trustedTypes?.createPolicy !== \"function\") return null\n\n  try {\n    return trustedTypes.createPolicy(\"lexxy\", { createHTML: (html) => html, createScriptURL: (url) => url })\n  } catch {\n    // Warned rather than swallowed, matching what DOMPurify does when its own\n    // policy is refused. The fallback is a silent loss of Trusted Types coverage\n    // otherwise, and the CSP violation report alone doesn't name us.\n    console.warn(\"TrustedTypes policy lexxy could not be created.\");\n    return null\n  }\n}\n\nconst DOMPurify = createDOMPurify(window);\n\n// alt is inert on every element it can appear on, so it sits in the blanket\n// list. srcset is deliberately absent \u2014 it carries URLs, so it belongs to a\n// consumer that declares it.\nconst ALLOWED_HTML_ATTRIBUTES = [ \"alt\", \"class\", \"contenteditable\", \"href\", \"src\", \"style\", \"title\" ];\n\n// width/height are scoped to img rather than allowlisted globally, because\n// ALLOWED_ATTR is not per-tag: putting them there would also permit\n// `<table width=\"100000\">` and `<td height=\"500\">` in attachment content, which\n// is layout the editor previously stripped. An image needs them to hold its\n// place while it loads; nothing else here does.\nconst DEFAULT_TAG_ATTRIBUTES = { img: [ \"width\", \"height\" ] };\n\nconst ALLOWED_STYLE_PROPERTIES = [ \"color\", \"background-color\" ];\n\nfunction styleFilterHook(_currentNode, hookEvent) {\n  if (hookEvent.attrName === \"style\" && hookEvent.attrValue) {\n    const styles = { ...getStyleObjectFromCSS(hookEvent.attrValue) };\n    const sanitizedStyles = { };\n\n    for (const property in styles) {\n      if (ALLOWED_STYLE_PROPERTIES.includes(property)) {\n        sanitizedStyles[property] = styles[property];\n      }\n    }\n\n    if (Object.keys(sanitizedStyles).length) {\n      hookEvent.attrValue = getCSSFromStyleObject(sanitizedStyles);\n    } else {\n      hookEvent.keepAttr = false;\n    }\n  }\n}\n\nDOMPurify.addHook(\"uponSanitizeAttribute\", styleFilterHook);\nDOMPurify.addHook(\"uponSanitizeAttribute\", attachmentUriFilterHook);\n\nconst FORBIDDEN_STIMULUS_ATTRIBUTES = [ \"data-controller\", \"data-action\" ];\n\n// Stimulus behavior attributes must never survive sanitization, whatever an\n// extension's allowedElements declares. On dompurify 3.4.13 FORBID_ATTR already\n// carries that on its own: _isValidAttribute opens with it, ahead of the\n// functional ADD_ATTR Lexxy builds from the public allowedElements API. So this\n// hook is defence in depth rather than the barrier, and it is kept because it\n// holds without reference to the config \u2014 the prohibition is a class-level one,\n// and a FORBID_ATTR entry lives or dies with whatever rebuilds the config.\nfunction stimulusAttributeFilterHook(_currentNode, hookEvent) {\n  if (FORBIDDEN_STIMULUS_ATTRIBUTES.includes(hookEvent.attrName)) {\n    hookEvent.keepAttr = false;\n  }\n}\n\nDOMPurify.addHook(\"uponSanitizeAttribute\", stimulusAttributeFilterHook);\n\nDOMPurify.addHook(\"uponSanitizeElement\", (node, data) => {\n  if (data.tagName === \"strong\" || data.tagName === \"em\") {\n    node.removeAttribute(\"class\");\n  }\n});\n\n// Called with no allowedElements for a sanitizer that has no allowlist to apply,\n// which is not the same thing as an empty one \u2014 see EditorSanitizer's fallback.\nfunction buildConfig(allowedElements = null) {\n  const config = {\n    ADD_URI_SAFE_ATTR: [ \"caption\", \"filename\", ...URI_BEARING_ATTACHMENT_ATTRIBUTES ],\n    SAFE_FOR_XML: false, // So that it does not strip attributes that contains serialized HTML (like content)\n    // Stimulus behavior attributes must never survive sanitization: they let stored content\n    // wire up arbitrary controllers/actions in the viewer's session. FORBID_ATTR wins over\n    // ALLOWED_ATTR/ADD_ATTR/ALLOW_DATA_ATTR in DOMPurify, so this holds even though other\n    // data-* attributes (data-language, data-trix-*, etc.) are otherwise allowed through.\n    FORBID_ATTR: [ \"data-controller\", \"data-action\" ]\n  };\n\n  // Left out rather than emptied when there is no allowlist, so DOMPurify's own\n  // default tag and attribute policy stands. `ALLOWED_TAGS: []` would not be a\n  // default, it would be a refusal: it strips every tag. An editor that declares\n  // an empty allowlist still gets that refusal, because it asked for it.\n  //\n  // uriSafeSchemes widens the scheme validation rather than exempting an attribute\n  // from it: ALLOWED_URI_REGEXP is set only when an editor declares custom schemes,\n  // so a value like a mention's `gid://\u2026` passes while javascript:/data: stay\n  // refused on every attribute \u2014 including href and object[data]. Nothing is taken\n  // out of URI checking, so there is no attribute to guard against exempting.\n  if (allowedElements) {\n    const { uriSafeSchemes, ...tagPolicy } = allowlistFor(allowedElements);\n    if (uriSafeSchemes.length) config.ALLOWED_URI_REGEXP = allowedUriRegexp(uriSafeSchemes);\n    Object.assign(config, tagPolicy);\n  }\n\n  // Always assigned, including when we have no policy \u2014 `null` is what\n  // trustedTypesPolicy() returns then, and `TRUSTED_TYPES_POLICY: null` is\n  // DOMPurify's documented per-call opt-out: sign nothing, create nothing.\n  //\n  // Leaving the key out is a different thing entirely, and the wrong one. With no\n  // key DOMPurify falls through to _getDefaultTrustedTypesPolicy() and asks the\n  // browser for `dompurify` \u2014 the very name this exists to stop competing for \u2014 so\n  // an omitted key would disarm the sanitizer of a host shipping\n  // `trusted-types dompurify` on the one path where we couldn't get our own.\n  // Present-and-`undefined` lands in that same fallthrough, so it is not a\n  // substitute for `null` either.\n  config.TRUSTED_TYPES_POLICY = trustedTypesPolicy();\n\n  return config\n}\n\nfunction allowlistFor(allowedElements) {\n  // Null prototype, so a declared tag can never read through to an\n  // Object.prototype key: `tagAttributes[\"constructor\"]` would answer with a\n  // function, and ADD_ATTR would call .includes on it.\n  const tagAttributes = Object.create(null);\n  const uriSafeSchemes = [];\n\n  // Lowercased, because DOMPurify lowercases ALLOWED_TAGS and calls ADD_ATTR\n  // with the lowercased tag and attribute names. Keeping the caller's casing\n  // makes allowedElements silently partial: `[ \"IMG\" ]` allows the element but\n  // drops the width/height below, and `[ { tag: \"img\", attributes: [ \"GID\" ] } ]`\n  // drops the attribute it declares.\n  for (const element of allowedElements) {\n    const tag = String(element.tag ?? element).toLowerCase();\n    const attributes = (element.attributes ?? []).map(attribute => attribute.toLowerCase());\n\n    tagAttributes[tag] ||= [];\n    tagAttributes[tag].push(...attributes);\n\n    // A custom scheme a caller declares is folded into the editor's URI-scheme\n    // allowlist (ALLOWED_URI_REGEXP in buildConfig), so a value like a mention's\n    // `gid=\"gid://\u2026\"` \u2014 which DOMPurify otherwise drops as an unknown scheme, even\n    // once the `gid` name is allowed \u2014 passes validation. It widens the recognised\n    // schemes, it does not exempt an attribute: javascript:/data: stay refused\n    // everywhere, so there is no navigational attribute to guard. Declared per\n    // element for locality, but a scheme is editor-wide once allowed.\n    uriSafeSchemes.push(...(element.uriSafeSchemes ?? []));\n  }\n\n  // Only for tags the caller already permits \u2014 this widens what an allowed\n  // element may carry, never which elements are allowed.\n  for (const [ tag, attributes ] of Object.entries(DEFAULT_TAG_ATTRIBUTES)) {\n    if (tagAttributes[tag]) tagAttributes[tag].push(...attributes);\n  }\n\n  return {\n    ALLOWED_TAGS: Object.keys(tagAttributes),\n    ALLOWED_ATTR: ALLOWED_HTML_ATTRIBUTES,\n    ADD_ATTR: (attribute, tag) => tagAttributes[tag]?.includes(attribute),\n    uriSafeSchemes\n  }\n}\n\nfunction getNonce() {\n  const element = document.head.querySelector(\"meta[name=csp-nonce]\");\n  return element?.content\n}\n\n// Register an event listener with a return function to deregister the listener. Both the element and\n// the listener are WeakRefs so neither is pinned in memory by the deregister function.\nfunction registerEventListener(element, type, listener, options) {\n  element.addEventListener(type, listener, options);\n  const elementRef = new WeakRef(element);\n  const listenerRef = new WeakRef(listener);\n\n  return function deregisterListener() {\n    const listener = listenerRef.deref();\n    if (listener) elementRef.deref()?.removeEventListener(type, listener, options);\n  }\n}\n\nclass ListenerBin {\n  #listeners = []\n\n  track(...listeners) {\n    this.#listeners.push(...listeners);\n  }\n\n  dispose() {\n    while (this.#listeners.length) {\n      const teardown = this.#listeners.pop();\n      teardown();\n    }\n  }\n}\n\nfunction handlingDefault(handler) {\n  return event => {\n    const handled = handler(event);\n    if (handled) event.preventDefault();\n    return handled\n  }\n}\n\nfunction createElement(name, properties, content = \"\") {\n  const element = document.createElement(name);\n  for (const [ key, value ] of Object.entries(properties || {})) {\n    if (key === \"dataset\") {\n      Object.entries(value).forEach(([ key, value ]) => (element.dataset[key] = value));\n    } else if (key in element) {\n      element[key] = value;\n    } else if (value !== null && value !== undefined) {\n      element.setAttribute(key, value);\n    }\n  }\n  if (content) {\n    element.innerHTML = content;\n  }\n  return element\n}\n\nfunction parseHtml(html) {\n  const parser = new DOMParser();\n  return parser.parseFromString(html, \"text/html\")\n}\n\nfunction createAttachmentFigure(contentType, isPreviewable, fileName) {\n  const extension = fileName ? fileName.split(\".\").pop().toLowerCase() : \"unknown\";\n  return createElement(\"figure\", {\n    className: `attachment attachment--${isPreviewable ? \"preview\" : \"file\"} attachment--${extension}`,\n    \"data-content-type\": contentType\n  })\n}\n\nfunction isPreviewableImage(contentType) {\n  return contentType.startsWith(\"image/\") && !contentType.includes(\"svg\")\n}\n\nfunction dispatch(element, eventName, detail = null, cancelable = false) {\n  return element.dispatchEvent(new CustomEvent(eventName, { bubbles: true, detail, cancelable }))\n}\n\nfunction addBlockSpacing(doc) {\n  const selector = \"body > :not(h1, h2, h3, h4, h5, h6) + *, blockquote > :not(h1, h2, h3, h4, h5, h6) + *\";\n  for (const block of doc.querySelectorAll(selector)) {\n    const spacer = doc.createElement(\"p\");\n    spacer.appendChild(doc.createElement(\"br\"));\n    block.before(spacer);\n  }\n}\n\nfunction generateDomId(prefix) {\n  const randomPart = Math.random().toString(36).slice(2, 10);\n  return `${prefix}-${randomPart}`\n}\n\nfunction extractPlainTextFromHtml(innerHtml = \"\") {\n  return parseHtml(innerHtml).body.textContent.trim()\n}\n\nfunction isActiveAndVisible(element) {\n  return element && !element.disabled && checkVisibility(element)\n}\n\n// no `checkVisibility` in Safari < 17.4\n// https://developer.mozilla.org/en-US/docs/Web/API/Element/checkVisibility#browser_compatibility\nfunction checkVisibility(element, options) {\n  if (element.checkVisibility) {\n    return element.checkVisibility(options)\n  } else {\n    // Will not work for body or a fixed position element child of the body\n    // which is OK since that doesn't apply in the toolbar where this is used\n    return Boolean(element.offsetParent)\n  }\n}\n\n// Keyboard and programmatic clicks carry a synthetic pointer.\nfunction isKeyboardActivation(event) {\n  return event instanceof PointerEvent && event.pointerId === -1\n}\n\nfunction trapFocusAtTabBoundary(container, event) {\n  if (event.key !== \"Tab\") return\n\n  const tabStops = Array.from(container.querySelectorAll(\"a[href], area[href], button, input:not([type='hidden']), select, textarea, iframe, object, embed, [contenteditable]:not([contenteditable='false']), [tabindex], summary, audio[controls], video[controls]\"))\n    .filter(element => element.tabIndex >= 0 && !element.matches(\":disabled\") && !element.closest(\"[inert]\") && isActiveAndVisible(element))\n    .sort((first, second) => {\n      if (first.tabIndex > 0 && second.tabIndex > 0) {\n        return first.tabIndex - second.tabIndex\n      } else if (first.tabIndex > 0) {\n        return -1\n      } else if (second.tabIndex > 0) {\n        return 1\n      } else {\n        return 0\n      }\n    });\n\n  const firstTabStop = tabStops[0];\n  const lastTabStop = tabStops.at(-1);\n\n  if (event.shiftKey && document.activeElement === firstTabStop) {\n    event.preventDefault();\n    lastTabStop.focus();\n  } else if (!event.shiftKey && document.activeElement === lastTabStop) {\n    event.preventDefault();\n    firstTabStop.focus();\n  }\n}\n\nfunction handleRollingTabIndex(elements, event, { orientation = \"horizontal\", wrap = false } = {}) {\n  const previousActiveElement = document.activeElement;\n\n  if (elements.includes(previousActiveElement)) {\n    const finder = new NextElementFinder(elements, event.key, { orientation, wrap });\n\n    if (finder.selectNext(previousActiveElement)) {\n      event.preventDefault();\n    }\n  }\n}\n\nclass NextElementFinder {\n  constructor(elements, key, { orientation, wrap }) {\n    this.elements = elements;\n    this.key = key;\n    this.orientation = orientation;\n    this.wrap = wrap;\n  }\n\n  selectNext(fromElement) {\n    const nextElement = this.#findNextElement(fromElement);\n\n    if (nextElement) {\n      const inactiveElements = this.elements.filter(element => element !== nextElement);\n      this.#unsetTabIndex(inactiveElements);\n      this.#focusWithActiveTabIndex(nextElement);\n      return true\n    }\n\n    return false\n  }\n\n  #findNextElement(fromElement) {\n    switch (this.#directionFor(this.key)) {\n      case \"next\":\n        return this.#findNextSibling(fromElement)\n\n      case \"previous\":\n        return this.#findPreviousSibling(fromElement)\n\n      case \"first\":\n        return this.#findFirst()\n\n      case \"last\":\n        return this.#findLast()\n    }\n  }\n\n  #directionFor(key) {\n    if (key === \"Home\") return \"first\"\n    if (key === \"End\") return \"last\"\n    if (this.#nextKeys.includes(key)) return \"next\"\n    if (this.#previousKeys.includes(key)) return \"previous\"\n  }\n\n  get #nextKeys() {\n    return this.orientation === \"both\" ? [ \"ArrowRight\", \"ArrowDown\" ] : [ \"ArrowRight\" ]\n  }\n\n  get #previousKeys() {\n    return this.orientation === \"both\" ? [ \"ArrowLeft\", \"ArrowUp\" ] : [ \"ArrowLeft\" ]\n  }\n\n  #findFirst(elements = this.elements) {\n    return elements.find(isActiveAndVisible)\n  }\n\n  #findLast(elements = this.elements) {\n    return elements.findLast(isActiveAndVisible)\n  }\n\n  #findNextSibling(element) {\n    const afterElements = this.elements.slice(this.#indexOf(element) + 1);\n    return this.#findFirst(afterElements) ?? this.#wrapToFirst()\n  }\n\n  #findPreviousSibling(element) {\n    const beforeElements = this.elements.slice(0, this.#indexOf(element));\n    return this.#findLast(beforeElements) ?? this.#wrapToLast()\n  }\n\n  #wrapToFirst() {\n    return this.wrap ? this.#findFirst() : undefined\n  }\n\n  #wrapToLast() {\n    return this.wrap ? this.#findLast() : undefined\n  }\n\n  #indexOf(element) {\n    return this.elements.indexOf(element)\n  }\n\n  #focusWithActiveTabIndex(element) {\n    if (isActiveAndVisible(element)) {\n      element.tabIndex = 0;\n      element.focus();\n    }\n  }\n\n  #unsetTabIndex(elements) {\n    elements.forEach(element => element.tabIndex = -1);\n  }\n}\n\nvar ToolbarIcons = {\n  \"bold\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M9.05273 1.88232C10.6866 1.88237 12.0033 2.20353 12.9529 2.89673L13.1272 3.0293C13.974 3.70864 14.4008 4.63245 14.4009 5.76562C14.4008 6.49354 14.2316 7.15281 13.8845 7.73145C13.6683 8.09188 13.3997 8.40162 13.0818 8.66016C13.5902 8.92606 14.0196 9.28599 14.3635 9.74121C14.8586 10.3834 15.0945 11.1743 15.0945 12.0879C15.0944 13.3698 14.5922 14.3931 13.5879 15.1106L13.5857 15.1128C12.5967 15.805 11.196 16.125 9.43799 16.125H3.10547V1.88232L9.05273 1.88232ZM6.36108 13.4084H9.28418C10.224 13.4084 10.8634 13.2491 11.2581 12.9851C11.6259 12.7389 11.8198 12.3768 11.8198 11.8367C11.8197 11.2968 11.6259 10.9351 11.2581 10.689C10.8634 10.425 10.2241 10.2649 9.28418 10.2649H6.36108V13.4084ZM6.36108 7.56812H8.78247C9.5163 7.56809 10.0547 7.45371 10.429 7.25757L10.5791 7.16895C10.9438 6.92178 11.1255 6.57934 11.1255 6.09302C11.1254 5.59017 10.9414 5.25227 10.5835 5.02002L10.5784 5.01636L10.5732 5.01343C10.1994 4.75387 9.61878 4.59818 8.78247 4.59814H6.36108V7.56812Z\"/>\n  </svg>`,\n\n  \"italic\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M14.1379 3.91187L14.1086 4.06421H11.4668L9.49805 13.9431H12.0981L11.7473 15.7852L11.7188 15.9375H4.16675L4.51758 14.0955L4.54614 13.9431H7.18799L9.17505 4.06421H6.55664L6.90747 2.22217L6.93677 2.06982H14.4888L14.1379 3.91187Z\"/>\n  </svg>`,\n\n  \"strikethrough\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M14.3723 11.8015C14.3771 11.8858 14.3811 11.9756 14.3811 12.0681C14.3811 12.811 14.1777 13.4959 13.7725 14.1174L13.7717 14.1189C13.3624 14.7329 12.7463 15.2162 11.9377 15.5742L11.9348 15.5757C11.1214 15.9223 10.1306 16.092 8.96997 16.092C7.9356 16.092 6.93308 15.9348 5.96338 15.6204L5.96045 15.6189C5.00593 15.292 4.24112 14.8699 3.67676 14.3459L3.57568 14.2522L3.63501 14.1277L4.45605 12.397L4.64282 12.5654C5.13492 13.0083 5.76733 13.3759 6.54492 13.6648C7.33475 13.9406 8.14322 14.0786 8.96997 14.0786C10.0731 14.0786 10.8638 13.8932 11.3708 13.5513C11.8757 13.1982 12.1172 12.7464 12.1172 12.1838C12.1172 12.0662 12.1049 11.9556 12.0828 11.8513L12.0344 11.625H14.3621L14.3723 11.8015Z\"/>\n    <path d=\"M9.2981 1.91602C10.111 1.91604 10.9109 2.02122 11.6975 2.23096C12.4855 2.44111 13.1683 2.74431 13.7417 3.14429L13.8655 3.23071L13.8083 3.36987L13.1726 4.91235L13.0869 5.1189L12.8987 4.99878C12.3487 4.64881 11.761 4.38633 11.1365 4.21143L11.1328 4.20996C10.585 4.04564 10.0484 3.95419 9.52295 3.93384L9.2981 3.92944C8.22329 3.92944 7.44693 4.12611 6.94043 4.49121C6.44619 4.85665 6.20874 5.31616 6.20874 5.88135L6.21533 6.03296C6.24495 6.37662 6.37751 6.65526 6.61011 6.87964L6.72144 6.97632C6.98746 7.19529 7.30625 7.37584 7.68018 7.51538L8.05151 7.63184C8.45325 7.75061 8.94669 7.87679 9.53247 8.01123L9.53467 8.01196C10.1213 8.15305 10.6426 8.29569 11.0991 8.4375H15C15.5178 8.4375 15.9375 8.85723 15.9375 9.375C15.9375 9.89277 15.5178 10.3125 15 10.3125H3C2.48223 10.3125 2.0625 9.89277 2.0625 9.375C2.0625 8.85723 2.48223 8.4375 3 8.4375H4.93726C4.83783 8.34526 4.74036 8.24896 4.64795 8.146L4.64502 8.14233C4.1721 7.58596 3.94482 6.85113 3.94482 5.95825C3.94483 5.20441 4.14059 4.51965 4.53369 3.90967L4.53516 3.90747C4.94397 3.29427 5.55262 2.81114 6.34863 2.45288C7.15081 2.0919 8.13683 1.91602 9.2981 1.91602Z\"/>\n  </svg>`,\n\n  \"underline\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M14 14C14.5523 14 15 14.4477 15 15C15 15.5523 14.5523 16 14 16H4C3.44772 16 3 15.5523 3 15C3 14.4477 3.44772 14 4 14H14Z\"/>\n    <path d=\"M12.625 1.59375C13.25 1.59375 13.625 1.97656 13.625 2.64062V9.02344C13.625 11.4844 11.8516 13.1875 8.99219 13.1875C6.14062 13.1875 4.35938 11.4844 4.35938 9.02344V2.64062C4.35938 1.97656 4.74219 1.59375 5.36719 1.59375C6 1.59375 6.375 1.97656 6.375 2.64062V8.84375C6.375 10.3828 7.32031 11.4297 8.99219 11.4297C10.6641 11.4297 11.6172 10.3828 11.6172 8.84375V2.64062C11.6172 1.97656 11.9922 1.59375 12.625 1.59375Z\"/>\n  </svg>`,\n\n  \"heading\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M11.5 2C12.0523 2 12.5 2.44772 12.5 3V3.5C12.5 4.05228 12.0523 4.5 11.5 4.5H8V15C8 15.5523 7.55228 16 7 16H6.5C5.94772 16 5.5 15.5523 5.5 15V4.5H2C1.44772 4.5 1 4.05228 1 3.5V3C1 2.44772 1.44772 2 2 2H11.5ZM16 7C16.5523 7 17 7.44772 17 8V8.5C17 9.05228 16.5523 9.5 16 9.5H15V15C15 15.5523 14.5523 16 14 16H13.5C12.9477 16 12.5 15.5523 12.5 15V9.5H11.5C10.9477 9.5 10.5 9.05228 10.5 8.5V8C10.5 7.44772 10.9477 7 11.5 7H16Z\"/>\n  </svg>`,\n\n  \"h1\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M8.12207 4.30078C8.84668 4.30078 9.25684 4.74512 9.25684 5.51758V12.5518C9.25677 13.3241 8.84662 13.7686 8.12207 13.7686C7.39752 13.7686 6.9942 13.3309 6.99414 12.5518V9.87207H3.56934V12.5518C3.56927 13.3241 3.15912 13.7686 2.43457 13.7686C1.71002 13.7686 1.3067 13.3309 1.30664 12.5518V5.51758C1.30664 4.73828 1.70996 4.30078 2.43457 4.30078C3.15918 4.30078 3.56934 4.74512 3.56934 5.51758V8.07422H6.99414V5.51758C6.99414 4.73828 7.39746 4.30078 8.12207 4.30078ZM13.8418 4.125H14.8271C15.543 4.125 16.0449 4.56934 16.0449 5.23828V12.7207C16.0449 13.4111 15.6348 13.8486 14.9854 13.8486C14.336 13.8486 13.9395 13.418 13.9395 12.7207V6.11133H13.8887L12.9541 6.74219C12.7354 6.88574 12.5303 6.95312 12.3047 6.95312C11.7646 6.95312 11.3955 6.58398 11.3955 6.06445C11.3955 5.69531 11.5801 5.42578 11.9766 5.15625L13.4023 4.32031C13.5459 4.23633 13.6826 4.17578 13.8418 4.125Z\"/>\n  </svg>`,\n\n  \"h2\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M8.12207 4.30078C8.84668 4.30078 9.25684 4.74512 9.25684 5.51758V12.5518C9.25677 13.3241 8.84662 13.7686 8.12207 13.7686C7.39752 13.7686 6.9942 13.3309 6.99414 12.5518V9.87207H3.56934V12.5518C3.56927 13.3241 3.15912 13.7686 2.43457 13.7686C1.71002 13.7686 1.3067 13.3309 1.30664 12.5518V5.51758C1.30664 4.73828 1.70996 4.30078 2.43457 4.30078C3.15918 4.30078 3.56934 4.74512 3.56934 5.51758V8.07422H6.99414V5.51758C6.99414 4.73828 7.39746 4.30078 8.12207 4.30078ZM13.6445 4.19824C15.5244 4.19824 16.8984 5.34668 16.8984 6.91211C16.8984 7.8759 16.4335 8.7237 15.292 9.84473L13.3438 11.8135V11.9092H16.1875C16.8232 11.9092 17.2197 12.251 17.2197 12.8115C17.2196 13.3651 16.83 13.7002 16.1875 13.7002H11.5117C10.8487 13.7002 10.4112 13.3241 10.4111 12.75C10.4111 12.3399 10.6368 11.9843 11.3203 11.3145L13.6855 8.88086C14.4169 8.13583 14.7245 7.64349 14.7246 7.12402C14.7246 6.4541 14.2393 6.00293 13.5215 6.00293C12.9404 6.00293 12.5166 6.29688 12.2158 6.90527C11.9151 7.37002 11.6552 7.54785 11.2588 7.54785C10.7188 7.54785 10.3429 7.17861 10.3428 6.65918C10.3428 5.3877 11.7783 4.19824 13.6445 4.19824Z\"/>\n  </svg>`,\n\n  \"h3\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M13.5967 4.19824C15.5928 4.19824 16.9873 5.23047 16.9873 6.7002C16.9872 7.705 16.2421 8.60059 15.2988 8.7168V8.86719C16.4199 8.94923 17.2607 9.89942 17.2607 11.0889C17.2606 12.7362 15.7362 13.9053 13.583 13.9053C11.6827 13.9053 10.1925 12.873 10.1924 11.7041C10.1924 11.1846 10.5547 10.8154 11.0537 10.8154C11.3818 10.8154 11.6553 10.9727 11.9629 11.3555C12.3799 11.9159 12.92 12.2031 13.583 12.2031C14.4853 12.2031 15.0731 11.7313 15.0732 11C15.0732 10.2754 14.4785 9.7832 13.5898 9.7832H13.0361C12.5645 9.7832 12.2159 9.4208 12.2158 8.92188C12.2158 8.44336 12.5576 8.07422 13.0361 8.07422H13.5693C14.3075 8.07422 14.8544 7.60928 14.8545 6.97363C14.8545 6.33789 14.3213 5.90039 13.5557 5.90039C12.9678 5.90039 12.5029 6.16016 12.0859 6.71387C11.8399 7.03508 11.5527 7.17871 11.1973 7.17871C10.671 7.17871 10.295 6.82314 10.2949 6.31738C10.2949 5.18945 11.751 4.19824 13.5967 4.19824ZM8.0332 4.30078C8.75781 4.30078 9.16797 4.74512 9.16797 5.51758V12.5518C9.1679 13.3241 8.75776 13.7686 8.0332 13.7686C7.30865 13.7686 6.90534 13.3309 6.90527 12.5518V9.87207H3.48047V12.5518C3.4804 13.3241 3.07026 13.7686 2.3457 13.7686C1.62115 13.7686 1.21784 13.3309 1.21777 12.5518V5.51758C1.21777 4.73828 1.62109 4.30078 2.3457 4.30078C3.07031 4.30078 3.48047 4.74512 3.48047 5.51758V8.07422H6.90527V5.51758C6.90527 4.73828 7.30859 4.30078 8.0332 4.30078Z\"/>\n  </svg>`,\n\n  \"h4\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M14.6357 4.22559C15.7432 4.22559 16.4336 4.80664 16.4336 5.73633V10.3164H16.7275C17.2881 10.3164 17.6436 10.6787 17.6436 11.2256C17.6435 11.7655 17.3017 12.1006 16.7275 12.1006H16.4336V12.6611C16.4335 13.3515 16.0234 13.7891 15.374 13.7891C14.7247 13.7891 14.3282 13.3583 14.3281 12.6611V12.1006H11.04C10.2335 12.1006 9.76863 11.6766 9.76855 10.918C9.76855 10.5762 9.85064 10.3026 10.1104 9.74219C10.7666 8.42289 11.5733 7.0146 12.5713 5.54492C13.2549 4.56738 13.7812 4.22559 14.6357 4.22559ZM7.88965 4.30078C8.61426 4.30078 9.02441 4.74512 9.02441 5.51758V12.5518C9.02435 13.3241 8.6142 13.7686 7.88965 13.7686C7.1651 13.7686 6.76178 13.3309 6.76172 12.5518V9.87207H3.33691V12.5518C3.33685 13.3241 2.9267 13.7686 2.20215 13.7686C1.4776 13.7686 1.07428 13.3309 1.07422 12.5518V5.51758C1.07422 4.73828 1.47754 4.30078 2.20215 4.30078C2.92676 4.30078 3.33691 4.74512 3.33691 5.51758V8.07422H6.76172V5.51758C6.76172 4.73828 7.16504 4.30078 7.88965 4.30078ZM14.2188 6.07812C13.6035 7.02841 12.2158 9.48929 11.7988 10.2686V10.3164H14.3281V6.07812H14.2188Z\"/>\n  </svg>`,\n\n  \"h5\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M8.12207 4.30078C8.84668 4.30078 9.25684 4.74512 9.25684 5.51758V12.5518C9.25677 13.3241 8.84662 13.7686 8.12207 13.7686C7.39752 13.7686 6.9942 13.3309 6.99414 12.5518V9.87207H3.56934V12.5518C3.56927 13.3241 3.15912 13.7686 2.43457 13.7686C1.71002 13.7686 1.3067 13.3309 1.30664 12.5518V5.51758C1.30664 4.73828 1.70996 4.30078 2.43457 4.30078C3.15918 4.30078 3.56934 4.74512 3.56934 5.51758V8.07422H6.99414V5.51758C6.99414 4.73828 7.39746 4.30078 8.12207 4.30078ZM16.1191 4.30078C16.6934 4.30078 17.0762 4.63672 17.0762 5.16602C17.0762 5.69531 16.6934 6.03125 16.1191 6.03125H13.3457L12.9219 8.25586H13.0176C13.248 8.03711 13.6855 7.84375 14.2871 7.84375C15.9277 7.84375 17.1445 9.07422 17.1445 10.7832C17.1445 12.5605 15.8184 13.9053 13.7695 13.9053C11.9512 13.9053 10.6934 12.9277 10.5566 11.7178C10.5566 11.2021 10.9121 10.8193 11.4277 10.8193C11.8379 10.8193 12.1328 11.0244 12.3516 11.4893C12.625 12.0361 13.1133 12.2549 13.7285 12.2549C14.5488 12.2549 15.1367 11.6533 15.1367 10.7695C15.1367 9.92188 14.5625 9.31348 13.7559 9.31348C13.1953 9.31348 12.7578 9.56055 12.4629 10.0254C12.2168 10.3887 11.9355 10.5527 11.5527 10.5527C10.9648 10.5527 10.5684 10.1699 10.5684 9.55469C10.5684 9.42773 10.582 9.30762 10.6094 9.17383L11.2383 5.55273C11.3516 4.88379 11.7207 4.30078 12.6797 4.30078H16.1191Z\"/>\n  </svg>`,\n\n  \"h6\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M8.12207 4.30078C8.84668 4.30078 9.25684 4.74512 9.25684 5.51758V12.5518C9.25677 13.3241 8.84662 13.7686 8.12207 13.7686C7.39752 13.7686 6.9942 13.3309 6.99414 12.5518V9.87207H3.56934V12.5518C3.56927 13.3241 3.15912 13.7686 2.43457 13.7686C1.71002 13.7686 1.3067 13.3309 1.30664 12.5518V5.51758C1.30664 4.73828 1.70996 4.30078 2.43457 4.30078C3.15918 4.30078 3.56934 4.74512 3.56934 5.51758V8.07422H6.99414V5.51758C6.99414 4.73828 7.39746 4.30078 8.12207 4.30078ZM13.6719 13.9258C15.5518 13.9258 17.1445 12.37306 17.1445 10.35451V10.05763C17.1445 8.10744 16.6016 6.59574 15.5928 5.58694C14.8613 4.85544 13.8975 4.42384 12.7285 4.25294C12.4199 4.21194 12.1592 4.19824 11.8643 4.19824C11.2627 4.19824 10.8389 4.59474 10.8389 5.14164C10.8389 5.65724 11.2354 6.02054 11.7783 6.04784C12.1758 6.06834 12.4844 6.10944 12.7656 6.19144C13.5176 6.42384 14.0742 6.95314 14.3965 7.75974L14.4922 8.00584H14.3828C14.0605 7.56834 13.4863 7.25974 12.6523 7.25974C11.1406 7.25974 10.0674 8.42384 10.0674 10.02345V10.27736C10.0674 12.2549 11.4668 13.9258 13.6719 13.9258ZM13.5215 12.24123C12.6797 12.24123 12.0918 11.48244 12.0918 10.4131V10.1592C12.0918 9.26174 12.6523 8.71291 13.5352 8.71291C14.3965 8.71291 14.9844 9.27638 14.9844 10.1592V10.4131C14.9844 11.48244 14.3828 12.24123 13.5215 12.24123Z\"/>\n  </svg>`,\n\n  \"paragraph\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M9 12C9.55228 12 10 12.4477 10 13C10 13.5523 9.55228 14 9 14H3C2.44772 14 2 13.5523 2 13C2 12.4477 2.44772 12 3 12H9ZM15 8C15.5523 8 16 8.44772 16 9C16 9.55228 15.5523 10 15 10H3C2.44772 10 2 9.55228 2 9C2 8.44772 2.44772 8 3 8H15ZM15 4C15.5523 4 16 4.44772 16 5C16 5.55228 15.5523 6 15 6H3C2.44772 6 2 5.55228 2 5C2 4.44772 2.44772 4 3 4H15Z\"/>\n  </svg>`,\n\n  \"clearFormatting\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M10.0607 2.07533C10.8417 1.29432 12.1078 1.2943 12.8888 2.07533L16.424 5.61049C17.205 6.39154 17.205 7.65854 16.424 8.43959L9.44937 15.4142C9.07435 15.7891 8.5656 16.0001 8.03531 16.0001H5.0148C4.55074 16.0001 4.10309 15.8385 3.74722 15.547L3.60074 15.4142L1.57534 13.3888C0.79431 12.6078 0.794336 11.3417 1.57534 10.5607L10.0607 2.07533ZM2.98941 11.9747L5.0148 14.0001H8.03531L9.71792 12.3165L6.18179 8.78139L2.98941 11.9747Z\"/>\n  </svg>`,\n\n  \"highlight\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M16.4564 14.4272C17.1356 15.5592 16.3204 17.0002 15.0003 17.0004C13.68 17.0004 12.864 15.5593 13.5433 14.4272L15.0003 12.0004L16.4564 14.4272ZM5.1214 1.70746C5.51192 1.31693 6.14494 1.31693 6.53546 1.70746L9.7171 4.8891L13.2532 8.42426C14.2295 9.40056 14.2295 10.9841 13.2532 11.9604L9.7171 15.4955C8.74078 16.4718 7.15822 16.4718 6.18195 15.4955L2.64679 11.9604C1.67048 10.9841 1.67048 9.40057 2.64679 8.42426L6.18195 4.8891C6.30299 4.76805 6.43323 4.66177 6.57062 4.57074L5.1214 3.12152C4.73091 2.73104 4.73099 2.09799 5.1214 1.70746ZM8.30304 6.30316C8.10776 6.10815 7.79119 6.10799 7.59601 6.30316L4.06085 9.83929L3.9964 9.91742C3.88661 10.0838 3.88645 10.3019 3.9964 10.4682L4.02277 10.5004H11.8763C12.0312 10.3043 12.02 10.0205 11.8392 9.83929L8.30304 6.30316Z\"/>\n  </svg>`,\n\n  \"link\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M12.8885 7.23091L13.9479 6.17155C14.5337 5.58576 14.5337 4.63602 13.9479 4.05023C13.3621 3.46444 12.4124 3.46444 11.8266 4.05023L8.29235 7.58446C7.9263 7.95051 7.90312 8.52994 8.2233 8.92271L8.36141 9.07463C8.68158 9.4674 8.65841 10.0468 8.29235 10.4129C7.90183 10.8034 7.26866 10.8034 6.87814 10.4129C5.70657 9.24131 5.70657 7.34182 6.87814 6.17025L10.4124 2.63602C11.7792 1.26918 13.9953 1.26918 15.3621 2.63602C16.729 4.00285 16.729 6.21893 15.3621 7.58576L14.3028 8.64512C13.9122 9.03564 13.2791 9.03564 12.8885 8.64512C12.498 8.2546 12.498 7.62143 12.8885 7.23091Z\"/>\n    <path d=\"M5.11038 10.7664L4.04843 11.8284C3.46264 12.4142 3.46264 13.3639 4.04842 13.9497C4.63421 14.5355 5.58396 14.5355 6.16975 13.9497L9.70657 10.4129C10.0726 10.0468 10.0958 9.46741 9.77563 9.07464L9.63752 8.92272C9.31734 8.52995 9.34052 7.95052 9.70657 7.58446C10.0971 7.19394 10.7303 7.19394 11.1208 7.58446C12.2924 8.75604 12.2924 10.6555 11.1208 11.8271L7.58396 15.3639C6.21712 16.7308 4.00105 16.7308 2.63421 15.3639C1.26738 13.9971 1.26738 11.781 2.63421 10.4142L3.69617 9.35223C4.08669 8.96171 4.71986 8.96171 5.11038 9.35223C5.5009 9.74275 5.5009 10.3759 5.11038 10.7664Z\"/>\n  </svg>`,\n\n  \"quote\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M4.96387 4.23438C6.8769 4.23438 8.42767 5.78522 8.42773 7.69824C8.42773 8.32925 8.25769 8.92015 7.96289 9.42969L7.96387 9.43066L5.11816 14.3584C4.77659 14.95 4.02038 15.153 3.42871 14.8115C2.83701 14.4699 2.63397 13.7128 2.97559 13.1211L4.16113 11.0674C2.63532 10.7052 1.5 9.33485 1.5 7.69824C1.50006 5.78524 3.05086 4.2344 4.96387 4.23438ZM13.0361 4.23438C14.9491 4.23449 16.4999 5.7853 16.5 7.69824C16.5 8.32921 16.3299 8.92017 16.0352 9.42969L16.0361 9.43066L13.1904 14.3584C12.8488 14.9501 12.0917 15.1531 11.5 14.8115C10.9085 14.4698 10.7063 13.7127 11.0479 13.1211L12.2324 11.0674C10.7069 10.7049 9.57227 9.33461 9.57227 7.69824C9.57233 5.78522 11.1231 4.23438 13.0361 4.23438Z\"/>\n  </svg>`,\n\n  \"code\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M6.29289 3.79295C6.68342 3.40243 7.31643 3.40243 7.70696 3.79295C8.09748 4.18348 8.09748 4.81649 7.70696 5.20702L3.91399 8.99999L7.70696 12.793C8.09748 13.1835 8.09748 13.8165 7.70696 14.207C7.31643 14.5975 6.68342 14.5975 6.29289 14.207L1.79289 9.70702C1.40237 9.31649 1.40237 8.68348 1.79289 8.29295L6.29289 3.79295Z\"/>\n    <path d=\"M11.707 3.79295C11.3164 3.40243 10.6834 3.40243 10.2929 3.79295C9.90237 4.18348 9.90237 4.81649 10.2929 5.20702L14.0859 8.99999L10.2929 12.793C9.90237 13.1835 9.90237 13.8165 10.2929 14.207C10.6834 14.5975 11.3164 14.5975 11.707 14.207L16.207 9.70702C16.5975 9.31649 16.5975 8.68348 16.207 8.29295L11.707 3.79295Z\"/>\n  </svg>`,\n\n  \"ul\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M3 12.5C3.82843 12.5 4.5 13.1716 4.5 14C4.5 14.8284 3.82843 15.5 3 15.5C2.17157 15.5 1.5 14.8284 1.5 14C1.5 13.1716 2.17157 12.5 3 12.5ZM15.5 13C16.0523 13 16.5 13.4477 16.5 14C16.5 14.5523 16.0523 15 15.5 15H7C6.44772 15 6 14.5523 6 14C6 13.4477 6.44772 13 7 13H15.5ZM3 7.5C3.82843 7.5 4.5 8.17157 4.5 9C4.5 9.82843 3.82843 10.5 3 10.5C2.17157 10.5 1.5 9.82843 1.5 9C1.5 8.17157 2.17157 7.5 3 7.5ZM15.5 8C16.0523 8 16.5 8.44772 16.5 9C16.5 9.55228 16.0523 10 15.5 10H7C6.44772 10 6 9.55228 6 9C6 8.44772 6.44772 8 7 8H15.5ZM3 2.5C3.82843 2.5 4.5 3.17157 4.5 4C4.5 4.82843 3.82843 5.5 3 5.5C2.17157 5.5 1.5 4.82843 1.5 4C1.5 3.17157 2.17157 2.5 3 2.5ZM15.5 3C16.0523 3 16.5 3.44772 16.5 4C16.5 4.55228 16.0523 5 15.5 5H7C6.44772 5 6 4.55228 6 4C6 3.44772 6.44772 3 7 3H15.5Z\"/>\n  </svg>`,\n\n  \"ol\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M15.5 13C16.0523 13 16.5 13.4477 16.5 14C16.5 14.5523 16.0523 15 15.5 15H7C6.44772 15 6 14.5523 6 14C6 13.4477 6.44772 13 7 13H15.5ZM15.5 8C16.0523 8 16.5 8.44772 16.5 9C16.5 9.55228 16.0523 10 15.5 10H7C6.44772 10 6 9.55228 6 9C6 8.44772 6.44772 8 7 8H15.5ZM15.5 3C16.0523 3 16.5 3.44772 16.5 4C16.5 4.55228 16.0523 5 15.5 5H7C6.44772 5 6 4.55228 6 4C6 3.44772 6.44772 3 7 3H15.5Z\"/>\n    <path d=\"M2.98657 16.0967C2.68042 16.0967 2.41187 16.0465 2.18091 15.9463C1.95174 15.846 1.77002 15.7046 1.63574 15.522C1.50146 15.3376 1.42448 15.1227 1.40479 14.8774L1.4021 14.8452H2.34204L2.34741 14.8748C2.35815 14.9589 2.39038 15.035 2.44409 15.103C2.49959 15.1711 2.5721 15.2248 2.66162 15.2642C2.75293 15.3035 2.86035 15.3232 2.98389 15.3232C3.10563 15.3232 3.21037 15.3027 3.2981 15.2615C3.38761 15.2185 3.45654 15.1603 3.50488 15.0869C3.55322 15.0135 3.57739 14.9294 3.57739 14.8345V14.8291C3.57739 14.6715 3.51921 14.5516 3.40283 14.4692C3.28646 14.3869 3.12085 14.3457 2.90601 14.3457H2.48706V13.677H2.90063C3.02775 13.677 3.13607 13.6582 3.22559 13.6206C3.31689 13.583 3.38672 13.5302 3.43506 13.4622C3.48519 13.3941 3.51025 13.3153 3.51025 13.2258V13.2205C3.51025 13.1256 3.48877 13.0441 3.4458 12.9761C3.40462 12.9062 3.34375 12.8534 3.26318 12.8176C3.18441 12.78 3.08952 12.7612 2.97852 12.7612C2.86572 12.7612 2.76636 12.7809 2.68042 12.8203C2.59627 12.8579 2.52913 12.9125 2.479 12.9841C2.43066 13.054 2.40112 13.1363 2.39038 13.2312L2.3877 13.2581H1.49341L1.49609 13.2205C1.514 12.977 1.58561 12.7666 1.71094 12.5894C1.83805 12.4103 2.00903 12.2725 2.22388 12.1758C2.44051 12.0773 2.69206 12.0281 2.97852 12.0281C3.27393 12.0281 3.52995 12.0728 3.74658 12.1624C3.96322 12.2501 4.13062 12.3727 4.24878 12.5303C4.36694 12.6878 4.42603 12.8722 4.42603 13.0835V13.0889C4.42603 13.2518 4.38932 13.3941 4.31592 13.5159C4.2443 13.6358 4.14762 13.7343 4.02588 13.8113C3.90592 13.8883 3.77254 13.942 3.62573 13.9724V13.9912C3.91756 14.0199 4.14941 14.1121 4.32129 14.2678C4.49316 14.4236 4.5791 14.6295 4.5791 14.8855V14.8909C4.5791 15.1344 4.51375 15.3474 4.38306 15.53C4.25236 15.7109 4.06795 15.8505 3.82983 15.949C3.59172 16.0474 3.31063 16.0967 2.98657 16.0967Z\"/>\n    <path d=\"M1.54443 11V10.342L2.76099 9.20874C2.95076 9.03507 3.09757 8.89274 3.20142 8.78174C3.30705 8.66895 3.37956 8.57316 3.41895 8.49438C3.46012 8.41382 3.48071 8.33415 3.48071 8.25537V8.24463C3.48071 8.14795 3.46012 8.0638 3.41895 7.99219C3.37777 7.92057 3.31779 7.86507 3.23901 7.82568C3.16024 7.7863 3.06714 7.7666 2.95972 7.7666C2.84692 7.7666 2.74756 7.78988 2.66162 7.83643C2.57747 7.88298 2.51123 7.94743 2.46289 8.02979C2.41455 8.11035 2.39038 8.20345 2.39038 8.30908V8.33057L1.48804 8.32788V8.31177C1.48804 8.05396 1.5507 7.82837 1.67603 7.63501C1.80314 7.44165 1.97949 7.29126 2.20508 7.18384C2.43245 7.07463 2.69653 7.02002 2.99731 7.02002C3.28556 7.02002 3.53711 7.06836 3.75195 7.16504C3.96859 7.25993 4.13688 7.39331 4.25684 7.56519C4.37858 7.73706 4.43945 7.93758 4.43945 8.16675V8.18018C4.43945 8.3252 4.40902 8.46932 4.34814 8.61255C4.28727 8.75578 4.18701 8.90885 4.04736 9.07178C3.90771 9.23291 3.71883 9.41642 3.48071 9.62231L2.58374 10.4092L2.85498 9.98486V10.4092L2.58374 10.2319H4.49048V11H1.54443Z\"/>\n    <path d=\"M2.84155 6V3.01367H2.79053L1.85596 3.64478V2.79614L2.84155 2.12476H3.82715V6H2.84155Z\"/>\n  </svg>`,\n\n  \"image\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M14 2C15.6569 2 17 3.34315 17 5V13C17 14.6569 15.6569 16 14 16H4C2.34315 16 1 14.6569 1 13V5C1 3.34315 2.34315 2 4 2H14ZM3.06348 13.3496C3.2053 13.7294 3.57078 14 4 14H13.5859L11 11.4141L9.70703 12.707C9.31651 13.0976 8.68349 13.0976 8.29297 12.707C7.90244 12.3165 7.90244 11.6835 8.29297 11.293L8.58594 11L7 9.41406L3.06348 13.3496ZM4 4C3.44772 4 3 4.44772 3 5V10.5859L6.29297 7.29297L6.36914 7.22461C6.76191 6.90427 7.34092 6.92686 7.70703 7.29297L10 9.58594L10.293 9.29297L10.3691 9.22461C10.7619 8.90427 11.3409 8.92686 11.707 9.29297L15 12.5859V5C15 4.44772 14.5523 4 14 4H4ZM12.5 5C13.3284 5 14 5.67157 14 6.5C14 7.32843 13.3284 8 12.5 8C11.6716 8 11 7.32843 11 6.5C11 5.67157 11.6716 5 12.5 5Z\"/>\n  </svg>`,\n\n  \"attachment\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M13 13.5V6C13 4.067 11.433 2.5 9.5 2.5C7.567 2.5 6 4.067 6 6V13.5C6 14.6046 6.89543 15.5 8 15.5H8.23047C9.20759 15.5 10 14.7076 10 13.7305V7C10 6.72386 9.77614 6.5 9.5 6.5C9.22386 6.5 9 6.72386 9 7V12.5C9 13.0523 8.55228 13.5 8 13.5C7.44772 13.5 7 13.0523 7 12.5V7C7 5.61929 8.11929 4.5 9.5 4.5C10.8807 4.5 12 5.61929 12 7V13.7305C12 15.8122 10.3122 17.5 8.23047 17.5H8C5.79086 17.5 4 15.7091 4 13.5V6C4 2.96243 6.46243 0.5 9.5 0.5C12.5376 0.5 15 2.96243 15 6V13.5C15 14.0523 14.5523 14.5 14 14.5C13.4477 14.5 13 14.0523 13 13.5Z\"/>\n  </svg>`,\n\n  \"table\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M15 1C16.1046 1 17 1.89543 17 3V15C17 16.1046 16.1046 17 15 17H3C1.89543 17 1 16.1046 1 15V3C1 1.89543 1.89543 1 3 1H15ZM3 15H8V10H3V15ZM10 10V15H15V10H10ZM10 8H15V3H10V8ZM3 8H8V3H3V8Z\"/>\n  </svg>`,\n\n  \"hr\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M12.75 12C13.1642 12 13.5 12.3358 13.5 12.75V14.25C13.5 14.6642 13.1642 15 12.75 15H5.25C4.83579 15 4.5 14.6642 4.5 14.25V12.75C4.5 12.3358 4.83579 12 5.25 12H12.75ZM15.4863 8C16.0461 8 16.5 8.44771 16.5 9C16.5 9.55229 16.0461 10 15.4863 10H2.51367C1.95392 10 1.5 9.55229 1.5 9C1.5 8.44771 1.95392 8 2.51367 8H15.4863ZM12.75 3C13.1642 3 13.5 3.33579 13.5 3.75V5.25C13.5 5.66421 13.1642 6 12.75 6H5.25C4.83579 6 4.5 5.66421 4.5 5.25V3.75C4.5 3.33579 4.83579 3 5.25 3H12.75Z\"/>\n  </svg>`,\n\n  \"undo\":\n  `<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M8.36612 5.36612C8.85427 4.87796 9.64554 4.87796 10.1337 5.36612C10.6218 5.85428 10.6218 6.64557 10.1337 7.13369L7.26748 9.9999H15.2499C18.1494 9.99996 20.4999 12.3504 20.4999 15.2499V19.2499C20.4999 19.9402 19.9402 20.4999 19.2499 20.4999C18.5596 20.4999 18 19.9402 17.9999 19.2499V15.2499C17.9999 13.7312 16.7686 12.5 15.2499 12.4999H7.26748L10.1337 15.3661C10.6218 15.8543 10.6218 16.6456 10.1337 17.1337C9.64557 17.6218 8.85428 17.6218 8.36612 17.1337L3.36612 12.1337C2.87796 11.6455 2.87796 10.8543 3.36612 10.3661L8.36612 5.36612Z\"/>\n  </svg>`,\n\n  \"redo\":\n  `<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M15.6338 5.1163C15.1456 4.62814 14.3543 4.62814 13.8662 5.1163C13.3781 5.60446 13.3781 6.39575 13.8662 6.88388L16.7324 9.75009H8.74997C5.85052 9.75014 3.49997 12.1006 3.49997 15.0001V19.0001C3.50002 19.6904 4.05969 20.25 4.74997 20.2501C5.4403 20.2501 5.99992 19.6904 5.99997 19.0001V15.0001C5.99997 13.4813 7.23123 12.2501 8.74997 12.2501H16.7324L13.8662 15.1163C13.3781 15.6045 13.3781 16.3958 13.8662 16.8839C14.3543 17.372 15.1456 17.3719 15.6338 16.8839L20.6338 11.8839C21.1219 11.3957 21.1219 10.6045 20.6338 10.1163L15.6338 5.1163Z\" />\n  </svg>`,\n\n  \"overflow\":\n  `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n    <path d=\"M3 6.75C4.24264 6.75 5.25 7.75736 5.25 9C5.25 10.2426 4.24264 11.25 3 11.25C1.75736 11.25 0.75 10.2426 0.75 9C0.75 7.75736 1.75736 6.75 3 6.75ZM9 6.75C10.2426 6.75 11.25 7.75736 11.25 9C11.25 10.2426 10.2426 11.25 9 11.25C7.75736 11.25 6.75 10.2426 6.75 9C6.75 7.75736 7.75736 6.75 9 6.75ZM15 6.75C16.2426 6.75 17.25 7.75736 17.25 9C17.25 10.2426 16.2426 11.25 15 11.25C13.7574 11.25 12.75 10.2426 12.75 9C12.75 7.75736 13.7574 6.75 15 6.75Z\"/>\n  </svg>`\n};\n\nclass LexicalToolbarElement extends HTMLElement {\n  static observedAttributes = [ \"connected\" ]\n  #listeners = new ListenerBin()\n  #refreshToolbarAF = null\n\n  constructor() {\n    super();\n    this.internals = this.attachInternals();\n    this.internals.role = \"toolbar\";\n\n    this.#createEditorPromise();\n  }\n\n  connectedCallback() {\n    this.requestOverflowRefresh();\n    this.setAttribute(\"role\", \"toolbar\");\n    this.#installResizeObserver();\n  }\n\n  disconnectedCallback() {\n    this.dispose();\n  }\n\n  dispose() {\n    this.#listeners.dispose();\n\n    cancelAnimationFrame(this.#refreshToolbarAF);\n\n    this.editorElement = null;\n    this.editor = null;\n    this.selection = null;\n    this.#refreshToolbarAF = null;\n\n    this.#createEditorPromise();\n  }\n\n  attributeChangedCallback(name, oldValue, newValue) {\n    if (name === \"connected\" && this.isConnected && oldValue != null && oldValue !== newValue) {\n      requestAnimationFrame(() => this.#reconnect());\n    }\n  }\n\n  configure(config) {\n    if (typeof config === \"object\" && config !== null) {\n      for (const [ button, value ] of Object.entries(config)) {\n        this.setAttribute(`data-${button}`, value);\n      }\n    }\n  }\n\n  setEditor(editorElement) {\n    this.editorElement = editorElement;\n    this.editor = editorElement.editor;\n    this.selection = editorElement.selection;\n    this.#bindButtons();\n    this.#bindHotkeys();\n    this.#resetTabIndexValues();\n    this.#monitorSelectionChanges();\n    this.#monitorHistoryChanges();\n    this.requestOverflowRefresh();\n    this.#bindFocusListeners();\n\n    this.resolveEditorPromise(editorElement);\n\n    this.toggleAttribute(\"connected\", true);\n  }\n\n  async getEditorElement() {\n    return this.editorElement || await this.editorPromise\n  }\n\n  requestOverflowRefresh() {\n    if (this.#refreshToolbarAF != null) return\n\n    this.#refreshToolbarAF = requestAnimationFrame(() => {\n      this.#refreshOverflow();\n      this.#refreshToolbarAF = null;\n    });\n  }\n\n  closeDropdowns({ except } = {}) {\n    this.#dropdowns.forEach((dropdown) => {\n      if (dropdown !== except) {\n        dropdown.close({ focusEditor: false });\n      }\n    });\n  }\n\n  #reconnect() {\n    this.disconnectedCallback();\n    this.connectedCallback();\n  }\n\n  async #createEditorPromise() {\n    this.editorPromise = new Promise((resolve) => {\n      this.resolveEditorPromise = resolve;\n    });\n\n    this.editorElement = await this.editorPromise;\n  }\n\n  #installResizeObserver() {\n    const resizeObserver = new ResizeObserver(() => this.requestOverflowRefresh());\n    resizeObserver.observe(this);\n    this.#listeners.track(() => resizeObserver.disconnect());\n  }\n\n  #bindButtons() {\n    this.#listeners.track(registerEventListener(this, \"click\", this.#handleButtonClicked));\n  }\n\n  #handleButtonClicked = (event) => {\n    this.#handleTargetClicked(event, \"[data-command]\", this.#dispatchButtonCommand.bind(this));\n  }\n\n  #handleTargetClicked(event, selector, callback) {\n    const button = event.target.closest(selector);\n    if (button) {\n      callback(event, button);\n    }\n  }\n\n  #dispatchButtonCommand(event, button) {\n    if (button.ariaDisabled === \"true\") return\n\n    const { command, payload } = button.dataset;\n    const shouldKeepToolbarFocus = isKeyboardActivation(event) && !this.#belongsToDropdown(button);\n\n    this.editor.update(() => {\n      this.editor.dispatchCommand(command, payload);\n    }, { tag: shouldKeepToolbarFocus ? SKIP_DOM_SELECTION_TAG : undefined });\n\n    if (!shouldKeepToolbarFocus) this.editor.focus();\n  }\n\n  #belongsToDropdown(button) {\n    return button.closest(\"[data-dropdown-panel]\") != null\n  }\n\n  #bindHotkeys() {\n    this.#listeners.track(registerEventListener(this.editorElement, \"keydown\", this.#handleHotkey));\n  }\n\n  #handleHotkey = (event) => {\n    const buttons = this.querySelectorAll(\"[data-hotkey]\");\n    buttons.forEach((button) => {\n      const hotkeys = button.dataset.hotkey.toLowerCase().split(/\\s+/);\n      if (hotkeys.includes(this.#keyCombinationFor(event))) {\n        event.preventDefault();\n        event.stopPropagation();\n        button.click();\n      }\n    });\n  }\n\n  #keyCombinationFor(event) {\n    const pressedKey = event.key.toLowerCase();\n    const modifiers = [\n      event.ctrlKey ? \"ctrl\" : null,\n      event.metaKey ? \"cmd\" : null,\n      event.altKey ? \"alt\" : null,\n      event.shiftKey ? \"shift\" : null,\n    ].filter(Boolean);\n\n    return [ ...modifiers, pressedKey ].join(\"+\")\n  }\n\n  #bindFocusListeners() {\n    this.#listeners.track(\n      registerEventListener(this.editorElement, \"lexxy:focus\", this.#handleEditorFocus),\n      registerEventListener(this.editorElement, \"lexxy:blur\", this.#handleEditorBlur),\n      registerEventListener(this, \"keydown\", this.#handleKeydown)\n    );\n  }\n\n  #handleEditorFocus = () => {\n    const firstVisibleButton = this.#toolbarButtons.find(isActiveAndVisible);\n    if (firstVisibleButton) firstVisibleButton.tabIndex = 0;\n  }\n\n  #handleEditorBlur = () => {\n    this.#resetTabIndexValues();\n  }\n\n  #handleKeydown = (event) => {\n    handleRollingTabIndex(this.#toolbarButtons, event);\n  }\n\n  #resetTabIndexValues() {\n    this.#toolbarButtons.forEach((button) => {\n      button.tabIndex = -1;\n    });\n  }\n\n  #monitorSelectionChanges() {\n    this.#listeners.track(this.editor.registerUpdateListener(({ editorState }) => {\n      editorState.read(() => {\n        this.#updateButtonStates();\n        this.closeDropdowns();\n      });\n    }));\n  }\n\n  #monitorHistoryChanges() {\n    this.#listeners.track(\n      this.editor.registerCommand(CAN_UNDO_COMMAND, (enabled) => { this.#setButtonDisabled(\"undo\", !enabled); }, COMMAND_PRIORITY_LOW),\n      this.editor.registerCommand(CAN_REDO_COMMAND, (enabled) => { this.#setButtonDisabled(\"redo\", !enabled); }, COMMAND_PRIORITY_LOW),\n    );\n  }\n\n  #updateButtonStates() {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) return\n\n    const anchorNode = selection.anchor.getNode();\n    if (!anchorNode.getParent()) { return }\n\n    const { isBold, isItalic, isStrikethrough, isUnderline, isHighlight, isInLink, isInQuote, isInHeading,\n      headingTag, isInCode, isInList, listType, isInTable } = this.selection.getFormat();\n\n    this.#setButtonPressed(\"bold\", isBold);\n    this.#setButtonPressed(\"italic\", isItalic);\n    this.#setButtonPressed(\"strikethrough\", isStrikethrough);\n    this.#setButtonPressed(\"underline\", isUnderline);\n\n    this.#setButtonPressed(\"format\", isInHeading);\n    this.#setButtonChecked(\"paragraph\", !isInHeading);\n\n    this.querySelector(\"lexxy-heading-dropdown\")\n      ?.updateActiveHeading(headingTag);\n\n    this.#setButtonPressed(\"lists\", isInList);\n    this.#setButtonPressed(\"unordered-list\", isInList && listType === \"bullet\");\n    this.#setButtonPressed(\"ordered-list\", isInList && listType === \"number\");\n\n    this.#setButtonPressed(\"highlight\", isHighlight);\n    this.#setButtonPressed(\"link\", isInLink);\n    this.#setButtonPressed(\"quote\", isInQuote);\n    this.#setButtonPressed(\"code\", isInCode);\n\n    this.#setButtonPressed(\"table\", isInTable);\n  }\n\n  #setButtonPressed(name, isPressed) {\n    const button = this.querySelector(`[name=\"${name}\"]`);\n    if (button) button.ariaPressed = isPressed;\n  }\n\n  #setButtonChecked(name, isChecked) {\n    const button = this.querySelector(`[name=\"${name}\"]`);\n    if (button) button.ariaChecked = isChecked;\n  }\n\n  #setButtonDisabled(name, isDisabled) {\n    const button = this.querySelector(`[name=\"${name}\"]`);\n    if (button) button.ariaDisabled = isDisabled;\n  }\n\n  #refreshOverflow() {\n    this.#hideOverflowMenuButton();\n    this.#resetToolbarOverflow();\n    this.#reindexToolbarItems();\n    this.#compactMenu();\n\n    const isOverflowing = this.#overflowMenuDropdown.children.length > 0;\n\n    this.toggleAttribute(\"overflowing\", isOverflowing);\n    this.#setOverflowMenuNonce();\n    this.#showOverflowMenuButton(isOverflowing);\n  }\n\n  #resetToolbarOverflow() {\n    const items = Array.from(this.#overflowMenuDropdown.children);\n    items.sort((a, b) => this.#itemPosition(b) - this.#itemPosition(a));\n\n    for (const item of items) {\n      const nextItem = this.querySelector(`[data-position=\"${this.#itemPosition(item) + 1}\"]`) ?? this.#overflowMenuButton;\n      item.removeAttribute(\"role\");\n      this.insertBefore(item, nextItem);\n    }\n  }\n\n  #showOverflowMenuButton(show = true) {\n    this.#overflowMenuDropdown.toggleAttribute(\"disabled\", !show);\n    this.#overflowMenuButton.style.display = show ? \"block\" : \"none\";\n  }\n\n  #hideOverflowMenuButton() {\n    this.#showOverflowMenuButton(false);\n  }\n\n  #itemPosition(item) {\n    return parseInt(item.dataset.position ?? \"999\")\n  }\n\n  #reindexToolbarItems() {\n    this.#toolbarItems.forEach((item, index) => {\n      item.dataset.position = index;\n    });\n  }\n\n  #compactMenu() {\n    const overflowWidth = this.#getOverflowWidth();\n\n    if (overflowWidth > 0) {\n      this.#showOverflowMenuButton();\n      const gap = this.#getToolbarGap();\n      const spaceForOverflow = gap + this.#overflowMenuButton.offsetWidth;\n      this.#reclaimWidth(overflowWidth + spaceForOverflow, { gap });\n    }\n  }\n\n  #getOverflowWidth() {\n    return this.scrollWidth - this.clientWidth\n  }\n\n  #reclaimWidth(overflowWidth, { gap }) {\n    const buttons = this.#overflowableButtons;\n    const overflowButtons = [];\n    let recoveredWidth = 0;\n\n    while (recoveredWidth < overflowWidth && buttons.length) {\n      const button = buttons.pop();\n\n      overflowButtons.push(button);\n      button.role = \"menuitem\";\n      recoveredWidth += button.offsetWidth + gap;\n    }\n\n    this.#overflowMenuDropdown.append(...overflowButtons.reverse());\n  }\n\n  #setOverflowMenuNonce() {\n    this.#overflowMenuButton.setAttribute(\"nonce\", getNonce());\n  }\n\n  #getToolbarGap() {\n    return parseFloat(window.getComputedStyle(this).columnGap) || 0\n  }\n\n  get #dropdowns() {\n    return this.querySelectorAll(\":scope .lexxy-editor__toolbar-dropdown\")\n  }\n\n  get #overflowMenuButton() {\n    return this.querySelector(\".lexxy-editor__toolbar-overflow\")\n  }\n\n  get #overflowMenuDropdown() {\n    return this.#overflowMenuButton?.querySelector(\":scope > [data-dropdown-panel]\")\n  }\n\n  get #overflowableButtons() {\n    return Array.from(this.querySelectorAll(\":scope > button:not([data-prevent-overflow])\"))\n  }\n\n  get #toolbarButtons() {\n    return Array.from(this.querySelectorAll(\":scope button\")).filter((button) => {\n      return !button.closest(\"[data-dropdown-panel]\")\n    })\n  }\n\n  get #toolbarItems() {\n    return Array.from(this.querySelectorAll(\":scope > *:not(.lexxy-editor__toolbar-overflow)\"))\n  }\n\n  static get defaultTemplate() {\n    const linkInputId = generateDomId(\"lexxy-link-url\");\n\n    return `\n      <button class=\"lexxy-editor__toolbar-button\" type=\"button\" name=\"image\" data-command=\"uploadImage\" data-prevent-overflow=\"true\" title=\"Add images and video\">\n        ${ToolbarIcons.image}\n      </button>\n\n      <button class=\"lexxy-editor__toolbar-button lexxy-editor__toolbar-group-end\" type=\"button\" name=\"file\" data-command=\"uploadFile\" title=\"Upload files\">\n        ${ToolbarIcons.attachment}\n      </button>\n\n      <button class=\"lexxy-editor__toolbar-button\" type=\"button\" name=\"bold\" data-command=\"bold\" title=\"Bold\">\n        ${ToolbarIcons.bold}\n      </button>\n\n      <button class=\"lexxy-editor__toolbar-button\" type=\"button\" name=\"italic\" data-command=\"italic\" title=\"Italic\">\n      ${ToolbarIcons.italic}\n      </button>\n\n      <button class=\"lexxy-editor__toolbar-button\" type=\"button\" name=\"strikethrough\" data-command=\"strikethrough\" title=\"Strikethrough\">\n        ${ToolbarIcons.strikethrough}\n      </button>\n\n      <button class=\"lexxy-editor__toolbar-button lexxy-editor__toolbar-group-end\" type=\"button\" name=\"underline\" data-command=\"underline\" title=\"Underline\">\n        ${ToolbarIcons.underline}\n      </button>\n\n      <lexxy-toolbar-dropdown class=\"lexxy-editor__toolbar-dropdown\">\n        <button data-dropdown-trigger class=\"lexxy-editor__toolbar-button lexxy-editor__toolbar-button--chevron\" type=\"button\" name=\"format\" title=\"Text formatting\" aria-haspopup=\"menu\" aria-expanded=\"false\">\n          ${ToolbarIcons.heading}\n        </button>\n        <div data-dropdown-panel role=\"menu\" aria-label=\"Text formatting\" class=\"lexxy-editor__toolbar-dropdown-list\" hidden>\n          <button type=\"button\" name=\"paragraph\" data-command=\"setFormatParagraph\" title=\"Paragraph\" role=\"menuitemradio\">\n            ${ToolbarIcons.paragraph} <span>Normal</span>\n          </button>\n          <lexxy-heading-dropdown>\n            <div class=\"lexxy-heading-options\"></div>\n          </lexxy-heading-dropdown>\n          <div class=\"lexxy-editor__toolbar-separator\" role=\"separator\"></div>\n          <button type=\"button\" name=\"clear-formatting\" data-command=\"clearFormatting\" title=\"Clear formatting\" role=\"menuitem\">\n            ${ToolbarIcons.clearFormatting} <span>Clear formatting</span>\n          </button>\n        </div>\n      </lexxy-toolbar-dropdown>\n\n      <lexxy-highlight-dropdown class=\"lexxy-editor__toolbar-dropdown lexxy-editor__toolbar-dropdown--highlight\">\n        <button data-dropdown-trigger class=\"lexxy-editor__toolbar-button lexxy-editor__toolbar-button--chevron\" type=\"button\" name=\"highlight\" title=\"Color highlight\" aria-haspopup=\"menu\" aria-expanded=\"false\">\n          ${ToolbarIcons.highlight}\n        </button>\n        <div data-dropdown-panel role=\"menu\" aria-label=\"Color highlight\" hidden>\n          <div class=\"lexxy-highlight-colors\"></div>\n          <button data-command=\"removeHighlight\" type=\"button\" class=\"lexxy-editor__toolbar-button lexxy-editor__toolbar-dropdown-reset\" role=\"menuitem\">Remove all coloring</button>\n        </div>\n      </lexxy-highlight-dropdown>\n\n      <lexxy-link-dropdown class=\"lexxy-editor__toolbar-dropdown lexxy-editor__toolbar-dropdown--link\">\n        <button data-dropdown-trigger class=\"lexxy-editor__toolbar-button lexxy-editor__toolbar-group-end\" type=\"button\" name=\"link\" title=\"Link\" data-hotkey=\"cmd+k ctrl+k\" aria-haspopup=\"dialog\" aria-expanded=\"false\">\n          ${ToolbarIcons.link}\n        </button>\n        <div data-dropdown-panel role=\"dialog\" aria-label=\"Link\" hidden>\n          <input type=\"url\" placeholder=\"Enter a URL\u2026\" class=\"input\" id=\"${linkInputId}\">\n          <div class=\"lexxy-editor__toolbar-dropdown-actions\">\n            <button type=\"button\" class=\"lexxy-editor__toolbar-button\" value=\"link\">Link</button>\n            <button type=\"button\" class=\"lexxy-editor__toolbar-button\" value=\"unlink\">Unlink</button>\n          </div>\n        </div>\n      </lexxy-link-dropdown>\n\n      <button class=\"lexxy-editor__toolbar-button\" type=\"button\" name=\"quote\" data-command=\"insertQuoteBlock\" title=\"Quote\">\n        ${ToolbarIcons.quote}\n      </button>\n\n      <button class=\"lexxy-editor__toolbar-button\" type=\"button\" name=\"code\" data-command=\"insertCodeBlock\" title=\"Code\">\n        ${ToolbarIcons.code}\n      </button>\n\n      <button class=\"lexxy-editor__toolbar-button\" type=\"button\" name=\"unordered-list\" data-command=\"insertUnorderedList\" title=\"Bullet list\">\n        ${ToolbarIcons.ul}\n      </button>\n      <button class=\"lexxy-editor__toolbar-button lexxy-editor__toolbar-group-end\" type=\"button\" name=\"ordered-list\" data-command=\"insertOrderedList\" title=\"Numbered list\">\n        ${ToolbarIcons.ol}\n      </button>\n\n      <button class=\"lexxy-editor__toolbar-button\" type=\"button\" name=\"table\" data-command=\"insertTable\" title=\"Insert a table\">\n        ${ToolbarIcons.table}\n      </button>\n\n      <button class=\"lexxy-editor__toolbar-button\" type=\"button\" name=\"divider\" data-command=\"insertHorizontalDivider\" title=\"Insert a divider\">\n        ${ToolbarIcons.hr}\n      </button>\n\n      <button class=\"lexxy-editor__toolbar-button lexxy-editor__toolbar-button--push-right\" type=\"button\" name=\"undo\" data-command=\"undo\" title=\"Undo\" aria-disabled=\"true\">\n        ${ToolbarIcons.undo}\n      </button>\n\n      <button class=\"lexxy-editor__toolbar-button\" type=\"button\" name=\"redo\" data-command=\"redo\" title=\"Redo\" aria-disabled=\"true\">\n        ${ToolbarIcons.redo}\n      </button>\n\n      <lexxy-toolbar-dropdown class=\"lexxy-editor__toolbar-dropdown lexxy-editor__toolbar-button--push-right lexxy-editor__toolbar-overflow\">\n        <button data-dropdown-trigger class=\"lexxy-editor__toolbar-button\" type=\"button\" title=\"More options\" aria-haspopup=\"menu\" aria-expanded=\"false\">\n          ${ToolbarIcons.overflow}\n        </button>\n        <div data-dropdown-panel role=\"menu\" class=\"lexxy-editor__toolbar-overflow-menu\" aria-label=\"More options\" hidden></div>\n      </lexxy-toolbar-dropdown>\n    `\n  }\n}\n\nfunction debounce(fn, wait) {\n  let timeout;\n\n  return (...args) => {\n    clearTimeout(timeout);\n    timeout = setTimeout(() => fn(...args), wait);\n  }\n}\n\nfunction debounceAsync(fn, wait) {\n  let timeout;\n\n  return (...args) => {\n    clearTimeout(timeout);\n\n    return new Promise((resolve, reject) => {\n      timeout = setTimeout(async () => {\n        try {\n          const result = await fn(...args);\n          resolve(result);\n        } catch (err) {\n          reject(err);\n        }\n      }, wait);\n    })\n  }\n}\n\nfunction delay(ms) {\n  return new Promise((resolve) => setTimeout(resolve, ms))\n}\n\nfunction nextFrame() {\n  return new Promise(requestAnimationFrame)\n}\n\nclass ToolbarDropdown extends HTMLElement {\n  #listeners = new ListenerBin()\n  #shouldReturnFocusToTrigger = false\n\n  connectedCallback() {\n    this.#onHostEditor(() => {\n      this.#registerListeners();\n      this.editorReady();\n    });\n  }\n\n  disconnectedCallback() {\n    this.#listeners.dispose();\n  }\n\n  editorReady() {}\n  onOpen() {}\n  onClose() {}\n\n  get trigger() {\n    return this.querySelector(\":scope > [data-dropdown-trigger]\")\n  }\n\n  get panel() {\n    return this.querySelector(\":scope > [data-dropdown-panel]\")\n  }\n\n  get host() {\n    return this.closest(\"lexxy-toolbar, lexxy-table-tools\")\n  }\n\n  get editorElement() {\n    return this.host?.editorElement\n  }\n\n  get editor() {\n    return this.host?.editor\n  }\n\n  get isOpen() {\n    return this.panel.hidden === false\n  }\n\n  get isClosed() {\n    return !this.isOpen\n  }\n\n  track(...listeners) {\n    this.#listeners.track(...listeners);\n  }\n\n  open() {\n    if (this.isOpen) return\n    this.trigger.ariaExpanded = true;\n    this.panel.hidden = false;\n    this.onOpen();\n    this.#focusFirstInteractive();\n  }\n\n  close({ focusEditor = true } = {}) {\n    if (focusEditor) this.editor?.focus();\n\n    if (this.isClosed) return\n    this.trigger.ariaExpanded = false;\n    this.panel.hidden = true;\n    this.onClose();\n  }\n\n  #registerListeners() {\n    this.#listeners.track(\n      registerEventListener(this, \"keydown\", this.#handleKeyDown),\n      registerEventListener(this.trigger, \"click\", this.#handleTriggerClick)\n    );\n  }\n\n  #handleTriggerClick = (event) => {\n    if (this.isOpen) {\n      this.close({ focusEditor: false });\n    } else {\n      this.#shouldReturnFocusToTrigger = this.#isOpenedFromHost(event);\n      this.host?.closeDropdowns({ except: this });\n      this.open();\n    }\n  }\n\n  #isOpenedFromHost(event) {\n    return isKeyboardActivation(event) && this.host?.contains(document.activeElement)\n  }\n\n  async #onHostEditor(callback) {\n    if (!this.host) return\n\n    await this.host.getEditorElement();\n    if (this.isConnected && this.host) callback();\n  }\n\n  #handleKeyDown = (event) => {\n    if (event.key === \"Escape\" && this.isOpen) {\n      event.stopPropagation();\n      this.close({ focusEditor: !this.#shouldReturnFocusToTrigger });\n      if (this.#shouldReturnFocusToTrigger) this.trigger?.focus();\n    } else if (this.isOpen && this.panel.role === \"dialog\") {\n      trapFocusAtTabBoundary(this.panel, event);\n    } else if (this.#isNavigatingMenu(event)) {\n      event.stopPropagation();\n      handleRollingTabIndex(this.#buttons, event, { orientation: \"both\", wrap: true });\n    }\n  }\n\n  #isNavigatingMenu(event) {\n    return this.panel.role === \"menu\" && this.panel.contains(event.target)\n  }\n\n  async #focusFirstInteractive() {\n    // Ask for the ring explicitly: opening the menu with the mouse otherwise leaves the\n    // first item focused without a focus ring, since focus() inherits the mouse modality.\n    this.#interactiveElements[0]?.focus({ focusVisible: true });\n    if (this.panel.role === \"menu\") await this.#resetTabIndexValues();\n  }\n\n  async #resetTabIndexValues() {\n    await nextFrame();\n    this.#buttons.forEach((element, index) => {\n      element.setAttribute(\"tabindex\", index === 0 ? 0 : \"-1\");\n    });\n  }\n\n  get #interactiveElements() {\n    return Array.from(this.panel.querySelectorAll(\"button, input\"))\n  }\n\n  get #buttons() {\n    return Array.from(this.panel.querySelectorAll(\"button\"))\n  }\n}\n\nconst HEADING_BUTTON_SELECTOR = \"button.lexxy-heading-button\";\n\nconst HEADING_PRESETS = [\n  { label: \"Large Heading\", name: \"heading-large\", command: \"setFormatHeadingLarge\" },\n  { label: \"Medium Heading\", name: \"heading-medium\", command: \"setFormatHeadingMedium\" },\n  { label: \"Small Heading\", name: \"heading-small\", command: \"setFormatHeadingSmall\" }\n];\n\nclass HeadingDropdown extends HTMLElement {\n  static labelFor(tag, index) {\n    if (index < HEADING_PRESETS.length) {\n      return HEADING_PRESETS[index].label\n    } else {\n      const level = tag.match(/^h(\\d+)$/)?.[1];\n      if (level) {\n        return `Heading ${level}`\n      } else {\n        return tag.toUpperCase()\n      }\n    }\n  }\n\n  static nameFor(tag, index) {\n    if (index < HEADING_PRESETS.length) {\n      return HEADING_PRESETS[index].name\n    } else {\n      const level = tag.match(/^h(\\d+)$/)?.[1];\n      if (level) {\n        return `heading-${level}`\n      } else {\n        return `heading-${tag}`\n      }\n    }\n  }\n\n  static commandFor(index) {\n    if (index < HEADING_PRESETS.length) {\n      return HEADING_PRESETS[index].command\n    } else {\n      return \"applyHeadingFormat\"\n    }\n  }\n\n  #listeners = new ListenerBin()\n\n  connectedCallback() {\n    this.style.display = \"contents\";\n\n    this.#onToolbarEditor(() => {\n      this.#buttonContainer.style.display = \"contents\";\n      this.#setUpButtons();\n      this.#registerButtonHandlers();\n      this.#syncActiveHeading();\n    });\n  }\n\n  disconnectedCallback() {\n    this.#listeners.dispose();\n  }\n\n  updateActiveHeading(tag) {\n    this.#headingButtons.forEach(button => {\n      const next = (button.dataset.heading === tag).toString();\n      if (button.getAttribute(\"aria-checked\") !== next) {\n        button.setAttribute(\"aria-checked\", next);\n      }\n    });\n  }\n\n  get #toolbar() {\n    return this.closest(\"lexxy-toolbar\")\n  }\n\n  get #editorElement() {\n    return this.#toolbar?.editorElement\n  }\n\n  get #editor() {\n    return this.#toolbar?.editor\n  }\n\n  async #onToolbarEditor(callback) {\n    const toolbar = this.#toolbar;\n    if (!toolbar) return\n\n    await toolbar.getEditorElement();\n    if (this.isConnected && this.#toolbar) callback();\n  }\n\n  #setUpButtons() {\n    this.#buttonContainer.innerHTML = \"\";\n\n    this.#configuredHeadings.forEach((tag, index) => {\n      this.#buttonContainer.appendChild(this.#createButton(tag, index));\n    });\n  }\n\n  #createButton(tag, index) {\n    const label = HeadingDropdown.labelFor(tag, index);\n    const name = HeadingDropdown.nameFor(tag, index);\n    const icon = ToolbarIcons[tag] || \"\";\n\n    const button = document.createElement(\"button\");\n    button.type = \"button\";\n    button.dataset.heading = tag;\n    button.dataset.command = HeadingDropdown.commandFor(index);\n    button.classList.add(\"lexxy-heading-button\");\n    button.name = name;\n    button.title = label;\n    button.setAttribute(\"role\", \"menuitemradio\");\n    button.innerHTML = `${icon} <span>${label}</span>`;\n    return button\n  }\n\n  #registerButtonHandlers() {\n    this.#headingButtons.forEach(button => {\n      this.#listeners.track(registerEventListener(button, \"click\", (event) => {\n        if (!this.#editor) return\n\n        event.preventDefault();\n        this.#editor.dispatchCommand(button.dataset.command, button.dataset.heading);\n        this.#editor.focus();\n      }));\n    });\n  }\n\n  #syncActiveHeading() {\n    const { headingTag } = this.#editor.read(() => this.#editorElement.selection.getFormat());\n    this.updateActiveHeading(headingTag ?? null);\n  }\n\n  get #configuredHeadings() {\n    return this.#editorElement.config.get(\"headings\")\n  }\n\n  get #buttonContainer() {\n    return this.querySelector(\".lexxy-heading-options\")\n  }\n\n  get #headingButtons() {\n    return Array.from(this.querySelectorAll(HEADING_BUTTON_SELECTOR))\n  }\n}\n\n// Shared, strictly-contained element used to attach ephemeral nodes when we\n// need to read computed styles (e.g. canonicalizing style values, resolving\n// CSS custom properties). The container is created once and attached to\n// `document.body` once; subsequent child mutations happen *inside* the\n// contained subtree so they do not invalidate style on the rest of the page.\n//\n// Without this, `document.body.appendChild(...)` / `element.remove()` calls\n// forced the browser to re-evaluate every ancestor-dependent selector (`:has()`,\n// descendant combinators, universal sibling rules) across the document on each\n// invocation \u2014 a 13,000+ element style recalc per call on a typical Basecamp\n// page.\n\nlet resolverRoot = null;\n\nfunction styleResolverRoot() {\n  if (resolverRoot && resolverRoot.isConnected) return resolverRoot\n\n  resolverRoot = document.createElement(\"div\");\n  resolverRoot.setAttribute(\"aria-hidden\", \"true\");\n  resolverRoot.setAttribute(\"data-lexxy-style-resolver\", \"\");\n  // `contain: strict` (size, layout, paint, style) isolates everything.\n  // The root itself paints nothing (visibility hidden), has zero\n  // geometric impact (position fixed, intrinsic size via contain), and\n  // never leaks style invalidation to its ancestors.\n  resolverRoot.style.cssText = \"contain: strict; position: fixed; top: 0; left: 0; visibility: hidden; pointer-events: none; width: 0; height: 0;\";\n  document.body.appendChild(resolverRoot);\n  return resolverRoot\n}\n\nfunction isSelectionHighlighted(selection) {\n  if (!$isRangeSelection(selection)) return false\n\n  if (selection.isCollapsed()) {\n    return hasHighlightStyles(selection.style)\n  } else {\n    return selection.hasFormat(\"highlight\")\n  }\n}\n\nfunction getHighlightStyles(selection) {\n  if (!$isRangeSelection(selection)) return null\n\n  let styles = getStyleObjectFromCSS(selection.style);\n  if (!styles.color && !styles[\"background-color\"]) {\n    const anchorNode = selection.anchor.getNode();\n    if ($isTextNode(anchorNode)) {\n      styles = getStyleObjectFromCSS(anchorNode.getStyle());\n    }\n  }\n\n  const color = styles.color || null;\n  const backgroundColor = styles[\"background-color\"] || null;\n  if (!color && !backgroundColor) return null\n\n  return { color, backgroundColor }\n}\n\nfunction hasHighlightStyles(cssOrStyles) {\n  const styles = typeof cssOrStyles === \"string\" ? getStyleObjectFromCSS(cssOrStyles) : cssOrStyles;\n  return !!(styles.color || styles[\"background-color\"])\n}\n\nfunction normalizeColorButtons(buttons) {\n  return buttons.map((button) => (typeof button === \"string\" ? { value: button, label: button } : button))\n}\n\nfunction applyCanonicalizers(styles, canonicalizers = []) {\n  return canonicalizers.reduce((css, canonicalizer) => {\n    return canonicalizer.applyCanonicalization(css)\n  }, styles)\n}\n\nclass StyleCanonicalizer {\n  constructor(property, allowedValues= []) {\n    this._property = property;\n    this._allowedValues = allowedValues;\n    this._canonicalValues = this.#allowedValuesIdentityObject;\n  }\n\n  applyCanonicalization(css) {\n    const styles = { ...getStyleObjectFromCSS(css) };\n\n    styles[this._property] = this.getCanonicalAllowedValue(styles[this._property]);\n    if (!styles[this._property]) {\n      delete styles[this._property];\n    }\n\n    return getCSSFromStyleObject(styles)\n  }\n\n  getCanonicalAllowedValue(value) {\n    return this._canonicalValues[value] ||= this.#resolveCannonicalValue(value)\n  }\n\n  // Private\n\n  get #allowedValuesIdentityObject() {\n    return this._allowedValues.reduce((object, value) => ({ ...object, [value]: value }), {})\n  }\n\n  #resolveCannonicalValue(value) {\n    let index = this.#computedAllowedValues.indexOf(value);\n    if (index === -1) {\n      index = this.#computedAllowedValues.indexOf(computeStyleValues(this._property, [ value ])[0]);\n    }\n    return index === -1 ? null : this._allowedValues[index]\n  }\n\n  get #computedAllowedValues() {\n    return this._computedAllowedValues ||= computeStyleValues(this._property, this._allowedValues)\n  }\n}\n\n// Separates DOM writes from layout reads to avoid forced reflows, and attaches\n// resolver elements to a strictly-contained root (outside the normal document\n// flow) so neither the attach nor the detach invalidate styles on the rest of\n// the page. Without containment, appending to `document.body` triggered a\n// page-wide style recalc on every canonicalization pass.\nfunction computeStyleValues(property, values) {\n  const fragment = document.createDocumentFragment();\n\n  const elements = values.map(value => {\n    const element = createElement(\"span\", { style: `display: none; ${property}: ${value};` });\n    fragment.appendChild(element);\n    return element\n  });\n\n  styleResolverRoot().appendChild(fragment);\n\n  const computed = elements.map(element =>\n    window.getComputedStyle(element).getPropertyValue(property)\n  );\n\n  elements.forEach(element => element.remove());\n  return computed\n}\n\nconst APPLY_HIGHLIGHT_SELECTOR = \"button.lexxy-highlight-button\";\nconst REMOVE_HIGHLIGHT_SELECTOR = \"[data-command='removeHighlight']\";\n\n// Use Symbol instead of null since $getSelectionStyleValueForProperty\n// responds differently for backward selections if null is the default\n// see https://github.com/facebook/lexical/issues/8013\nconst NO_STYLE = Symbol(\"no_style\");\n\nclass HighlightDropdown extends ToolbarDropdown {\n  editorReady() {\n    this.#setUpButtons();\n    this.#registerButtonHandlers();\n  }\n\n  onOpen() {\n    this.editor.getEditorState().read(() => {\n      this.#updateColorButtonStates($getSelection());\n    });\n  }\n\n  #registerButtonHandlers() {\n    this.#colorButtons.forEach(button => {\n      this.track(registerEventListener(button, \"click\", this.#handleColorButtonClick));\n    });\n  }\n\n  #setUpButtons() {\n    this.#buttonContainer.innerHTML = \"\";\n\n    const colorGroups = this.editorElement.config.get(\"highlight.buttons\");\n\n    this.#appendColorGroup(\"Text color\", \"color\", colorGroups.color);\n    this.#appendColorGroup(\"Background color\", \"background-color\", colorGroups[\"background-color\"]);\n\n    const maxNumberOfColors = Math.max(colorGroups.color.length, colorGroups[\"background-color\"].length);\n    this.panel.style.setProperty(\"--max-colors\", maxNumberOfColors);\n  }\n\n  #appendColorGroup(label, attribute, buttons) {\n    const group = createElement(\"div\", {\n      role: \"group\",\n      class: \"lexxy-highlight-colors__group\",\n      \"aria-label\": label\n    });\n\n    normalizeColorButtons(buttons).forEach((button, index) => {\n      group.appendChild(this.#createButton(attribute, button, index));\n    });\n\n    this.#buttonContainer.append(group);\n  }\n\n  #createButton(attribute, button, index) {\n    return createElement(\"button\", {\n      type: \"button\",\n      dataset: { value: button.value, style: attribute },\n      style: `${attribute}: ${button.value}`,\n      class: \"lexxy-editor__toolbar-button lexxy-highlight-button\",\n      name: `${attribute}-${index}`,\n      role: \"menuitemcheckbox\",\n      \"aria-label\": button.label\n    })\n  }\n\n  #handleColorButtonClick = (event) => {\n    event.preventDefault();\n\n    const button = event.target.closest(APPLY_HIGHLIGHT_SELECTOR);\n    if (!button) return\n\n    const { style, value } = button.dataset;\n\n    this.editor.dispatchCommand(\"toggleHighlight\", { [style]: value });\n    this.close();\n  }\n\n  #updateColorButtonStates(selection) {\n    if (!$isRangeSelection(selection)) { return }\n\n    // Use non-\"\" default, so \"\" indicates mixed highlighting\n    const textColor = $getSelectionStyleValueForProperty(selection, \"color\", NO_STYLE);\n    const backgroundColor = $getSelectionStyleValueForProperty(selection, \"background-color\", NO_STYLE);\n\n    this.#colorButtons.forEach(button => {\n      button.ariaChecked = button.dataset.value === textColor || button.dataset.value === backgroundColor;\n    });\n\n    const hasHighlight = textColor !== NO_STYLE || backgroundColor !== NO_STYLE;\n    this.panel.querySelector(REMOVE_HIGHLIGHT_SELECTOR).disabled = !hasHighlight;\n  }\n\n  get #buttonContainer() {\n    return this.panel.querySelector(\".lexxy-highlight-colors\")\n  }\n\n  get #colorButtons() {\n    return Array.from(this.panel.querySelectorAll(APPLY_HIGHLIGHT_SELECTOR))\n  }\n}\n\nclass LinkDropdown extends ToolbarDropdown {\n  editorReady() {\n    this.input = this.panel.querySelector(\"input\");\n\n    this.track(\n      registerEventListener(this.input, \"keydown\", this.#handleEnter),\n      registerEventListener(this.linkButton, \"click\", this.#handleLink),\n      registerEventListener(this.unlinkButton, \"click\", this.#handleUnlink)\n    );\n  }\n\n  onOpen() {\n    this.input.value = this.#selectedLinkUrl;\n    this.input.required = true;\n  }\n\n  onClose() {\n    this.input.required = false;\n  }\n\n  get linkButton() {\n    return this.panel.querySelector(\"[value='link']\")\n  }\n\n  get unlinkButton() {\n    return this.panel.querySelector(\"[value='unlink']\")\n  }\n\n  #handleEnter = (event) => {\n    if (event.key === \"Enter\") {\n      event.preventDefault();\n      event.stopPropagation();\n      this.#handleLink(event);\n    }\n  }\n\n  #handleLink = () => {\n    if (!this.input.checkValidity()) {\n      this.input.reportValidity();\n      return\n    }\n\n    this.editor.dispatchCommand(\"link\", this.input.value);\n    this.close();\n  }\n\n  #handleUnlink = () => {\n    this.editor.dispatchCommand(\"unlink\");\n    this.close();\n  }\n\n  get #selectedLinkUrl() {\n    return this.editor.getEditorState().read(() => {\n      const linkNode = this.editorElement.selection.nearestNodeOfType(LinkNode);\n      return linkNode?.getURL() ?? \"\"\n    })\n  }\n}\n\n// An editor's sanitizer: the allowlist it was registered with, applied to a\n// string.\n//\n// The allowlist is per editor, and passed to each sanitize() call. Neither of\n// those is incidental. This used to be a module-level config installed with\n// DOMPurify.setConfig() on the shared singleton, which had two distinct\n// consequences:\n//\n// 1. A persistent config is final \u2014 DOMPurify ignores the per-call config once\n//    one is set \u2014 so it silently disarmed the sanitizing of any host app that\n//    also imports dompurify. See config/dom_purify for why we now own our\n//    instance; keeping the config per-call means there is no global sanitizer\n//    state left even on that instance.\n//\n// 2. One config for the whole module meant the last editor to connect decided\n//    how every other editor on the page sanitized. That is not cosmetic: an\n//    editor's `value` is sanitized on read, so a rich editor sharing a page with\n//    a plain one would silently drop its own headings, lists and links from the\n//    value it submits.\n//\n// Sanitizers are keyed by the Lexical editor, which is the identity both call\n// sites have: the element registers with it and keeps the result as\n// `this.sanitizer`, while nodes only receive it as createDOM()'s second argument\n// and resolve their sanitizer with for().\nclass EditorSanitizer {\n  static #instances = new WeakMap()\n\n  // Only reached for an editor that never registered, which is a supported case:\n  // CustomActionTextAttachmentNode is exported from src/index.js, so it can be\n  // registered in a Lexical editor Lexxy did not build.\n  //\n  // Fixed, and never reassigned. Pointing it at whichever sanitizer registered\n  // most recently would make an unregistered consumer's allowlist depend on\n  // which Lexxy editor happened to initialise last \u2014 the last-editor-wins bug\n  // this class exists to remove, reintroduced on the one path that has no editor\n  // to key on, and unobservable from the consumer's own code.\n  //\n  // It declares no allowlist, so DOMPurify's own default policy applies. An\n  // empty allowlist would be deterministic too and strips every tag, which\n  // silently drops markup a standalone consumer used to keep. It holds no\n  // editor either, so nothing here pins a disconnected editor's DOM.\n  //\n  // A consumer wanting its own allowlist registers for it: register() needs only\n  // the Lexical editor and is reachable as EditorSanitizer from src/index.js.\n  //\n  // Built on first use rather than as a static field initializer, which would run\n  // buildConfig at import: src/index.js exports this class, so that would create\n  // the Trusted Types policy \u2014 and, unallowlisted, report a CSP violation \u2014 on\n  // every page load of an app that never renders an editor.\n  static #fallback\n\n  static #fallbackSanitizer() {\n    return this.#fallback ||= new EditorSanitizer()\n  }\n\n  static register(editor, allowedElements = []) {\n    const sanitizer = new EditorSanitizer(this.#allowedElementsFor(editor, allowedElements));\n    this.#instances.set(editor, sanitizer);\n\n    return sanitizer\n  }\n\n  static for(editor) {\n    return this.#instances.get(editor) ?? this.#fallbackSanitizer()\n  }\n\n  // An editor can import every tag it can convert from HTML, plus whatever its\n  // extensions declare. Lexical registers the conversions while building the\n  // editor, so they are already in place when $initialEditorState registers us.\n  static #allowedElementsFor(editor, allowedElements) {\n    return this.#importableTags(editor).concat(allowedElements)\n  }\n\n  static #importableTags(editor) {\n    const tags = Array.from(editor._htmlConversions.keys());\n    return tags.filter(tag => !tag.startsWith(\"#\"))\n  }\n\n  #config\n\n  constructor(allowedElements = null) {\n    this.#config = buildConfig(allowedElements);\n  }\n\n  // safeForXml opts into DOMPurify's mXSS-safe mode, for a caller re-inflating\n  // stored content. It is off by default, and the reason is not that the default\n  // hop is trustworthy \u2014 the value an editor reads back carries the attacker's\n  // stored `content` verbatim. The reason is that strictness there is destructive:\n  // SAFE_FOR_XML drops any attribute whose value could close a comment, a\n  // serialized `content` full of Rails view annotations is exactly that, and\n  // CustomActionTextAttachmentNode.importDOM returns null for an attachment with no\n  // `content` \u2014 so the attachment vanishes on the next edit. Verified: strict on the\n  // value hop leaves `<action-text-attachment sgid content-type>` and re-editing that\n  // renders nothing.\n  //\n  // The strict config is this instance's own, spread rather than rebuilt, so the\n  // per-editor allowlist and everything else buildConfig put there \u2014 the Trusted\n  // Types policy, ADD_URI_SAFE_ATTR \u2014 survive the flip.\n  sanitize(html, { safeForXml = false } = {}) {\n    if (safeForXml) {\n      return DOMPurify.sanitize(html, { ...this.#config, SAFE_FOR_XML: true })\n    }\n\n    return DOMPurify.sanitize(html, this.#config)\n  }\n}\n\nfunction bytesToHumanSize(bytes) {\n  if (bytes === 0) return \"0 B\"\n  const sizes = [ \"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\" ];\n  const i = Math.floor(Math.log(bytes) / Math.log(1024));\n  const value = bytes / Math.pow(1024, i);\n  return `${ value.toFixed(2) } ${ sizes[i] }`\n}\n\nfunction extractFileName(string) {\n  return string.split(\"/\").pop()\n}\n\n// The content attribute is raw HTML (matching Trix/ActionText). Older Lexxy\n// versions JSON-encoded it, so try JSON.parse first for backward compatibility.\nfunction parseAttachmentContent(content) {\n  try {\n    return JSON.parse(content)\n  } catch {\n    return content\n  }\n}\n\nfunction mimeTypeToExtension(mimeType) {\n  if (!mimeType) return null\n\n  const extension = mimeType.split(\"/\")[1];\n  return extension\n}\n\nclass CustomActionTextAttachmentNode extends DecoratorNode {\n  static getType() {\n    return \"custom_action_text_attachment\"\n  }\n\n  static clone(node) {\n    return new CustomActionTextAttachmentNode({ ...node }, node.__key)\n  }\n\n  static importJSON(serializedNode) {\n    return new CustomActionTextAttachmentNode({ ...serializedNode })\n  }\n\n  static importDOM() {\n    return {\n      [this.TAG_NAME]: (element) => {\n        if (!element.getAttribute(\"content\")) {\n          return null\n        }\n\n        return {\n          conversion: (attachment) => {\n            // Preserve initial space if present since Lexical removes it\n            const nodes = [];\n            const previousSibling = attachment.previousSibling;\n            if (previousSibling && previousSibling.nodeType === Node.TEXT_NODE && /\\s$/.test(previousSibling.textContent)) {\n              nodes.push($createTextNode(\" \"));\n            }\n\n            const innerHtml = parseAttachmentContent(attachment.getAttribute(\"content\"));\n\n            nodes.push(new CustomActionTextAttachmentNode({\n              sgid: attachment.getAttribute(\"sgid\"),\n              innerHtml,\n              plainText: attachment.textContent.trim() || extractPlainTextFromHtml(innerHtml),\n              contentType: attachment.getAttribute(\"content-type\")\n            }));\n\n            const nextSibling = attachment.nextSibling;\n            if (nextSibling && nextSibling.nodeType === Node.TEXT_NODE && /^\\s/.test(nextSibling.textContent)) {\n              nodes.push($createTextNode(\" \"));\n            }\n\n            return { node: nodes }\n          },\n          priority: 2\n        }\n      }\n    }\n  }\n\n  static get TAG_NAME() {\n    return Lexxy.global.get(\"attachmentTagName\")\n  }\n\n  constructor({ sgid, contentType, innerHtml, plainText } = {}, key) {\n    super(key);\n\n    const contentTypeNamespace = Lexxy.global.get(\"attachmentContentTypeNamespace\");\n\n    this.sgid = sgid;\n    this.contentType = contentType || `application/vnd.${contentTypeNamespace}.unknown`;\n    this.innerHtml = innerHtml;\n    this.plainText = plainText ?? extractPlainTextFromHtml(innerHtml);\n  }\n\n  createDOM(_config, editor) {\n    const figure = createElement(CustomActionTextAttachmentNode.TAG_NAME, { \"content-type\": this.contentType, \"data-lexxy-decorator\": true, draggable: true });\n    figure.dataset.lexicalNodeKey = this.__key;\n\n    // Resolved from the editor so this content is sanitized with its own\n    // allowlist rather than whichever editor connected most recently.\n    //\n    // this.innerHtml is untrusted stored content being re-inflated into the editor,\n    // so it goes through DOMPurify's mXSS-safe mode. Strictness is free here because\n    // of where the `content` attribute that has to survive is sanitized, which is not\n    // this hop: it is produced by exportDOM and by the server-side pass in\n    // lib/lexxy/rich_text_area_tag.rb, and it is only ever sanitized on the lax hop\n    // where an editor reads its own value back.\n    //\n    // The decoded inner markup can carry a `content` attribute of its own \u2014 nested\n    // attachment markup does, and the attribute is allowlisted on the attachment tag\n    // in extensions/attachments_extension.js \u2014 and mXSS-safe mode drops it. That loss\n    // is cosmetic: it is a nested attachment's rendering inside this one, not the\n    // attribute anything re-imports from.\n    figure.insertAdjacentHTML(\"beforeend\", EditorSanitizer.for(editor).sanitize(this.innerHtml, { safeForXml: true }));\n    this.#markImagesAsDecorative(figure);\n    this.#tagLabelImage(figure);\n    this.#tagLabelMirrors(figure);\n\n    return figure\n  }\n\n  exposeLabel(figure) {\n    const labelImage = figure.querySelector(\"[data-lexxy-label-image]\");\n    if (labelImage) labelImage.alt = this.label;\n\n    for (const span of figure.querySelectorAll(\"[data-lexxy-label-mirror]\")) {\n      span.setAttribute(\"aria-hidden\", \"true\");\n    }\n  }\n\n  get label() {\n    return this.getReadableTextContent()\n  }\n\n  restoreLabel(figure) {\n    const labelImage = figure.querySelector(\"[data-lexxy-label-image]\");\n    if (labelImage) labelImage.alt = labelImage.dataset.lexxyOriginalAlt;\n\n    for (const span of figure.querySelectorAll(\"[data-lexxy-label-mirror]\")) {\n      span.removeAttribute(\"aria-hidden\");\n    }\n  }\n\n  updateDOM() {\n    return false\n  }\n\n  getTextContent() {\n    return \"\\ufeff\"\n  }\n\n  getReadableTextContent() {\n    return this.plainText || `[${this.contentType}]`\n  }\n\n  isInline() {\n    return true\n  }\n\n  exportDOM() {\n    const attachment = createElement(CustomActionTextAttachmentNode.TAG_NAME, {\n      sgid: this.sgid,\n      content: this.innerHtml,\n      \"content-type\": this.contentType\n    });\n\n    return { element: attachment }\n  }\n\n  exportJSON() {\n    return {\n      type: \"custom_action_text_attachment\",\n      version: 1,\n      sgid: this.sgid,\n      contentType: this.contentType,\n      innerHtml: this.innerHtml,\n      plainText: this.plainText\n    }\n  }\n\n  decorate() {\n    return null\n  }\n\n  #markImagesAsDecorative(figure) {\n    for (const img of figure.querySelectorAll(\"img:not([alt])\")) {\n      img.alt = \"\";\n    }\n  }\n\n  // Images injected later by other modules must not become the announcement image.\n  #tagLabelImage(figure) {\n    const image = figure.querySelector(\"img\");\n    if (image) {\n      image.setAttribute(\"data-lexxy-label-image\", \"\");\n      image.dataset.lexxyOriginalAlt = image.alt;\n    }\n  }\n\n  // Duplicate labels would be spoken twice. Only authored spans should be silenced,\n  // since the fake selection injects its own label later.\n  #tagLabelMirrors(figure) {\n    const trimmedLabel = this.label.trim();\n    const matches = [ ...figure.querySelectorAll(\"span\") ].filter((span) => span.textContent.trim() === trimmedLabel);\n    const deepest = matches.filter((span) => !matches.some((other) => other !== span && span.contains(other)));\n    const labelImage = figure.querySelector(\"[data-lexxy-label-image]\");\n\n    for (const span of deepest) {\n      if (span.getAttribute(\"aria-hidden\") !== \"true\") {\n        if (span.contains(labelImage)) {\n          this.#wrapLabelTextNodesIn(span);\n        } else {\n          span.setAttribute(\"data-lexxy-label-mirror\", \"\");\n        }\n      }\n    }\n  }\n\n  #wrapLabelTextNodesIn(element) {\n    const walker = document.createTreeWalker(element, NodeFilter.SHOW_TEXT);\n    const textNodes = [];\n\n    while (walker.nextNode()) {\n      if (walker.currentNode.textContent.trim()) textNodes.push(walker.currentNode);\n    }\n\n    for (const textNode of textNodes) {\n      const mirror = createElement(\"span\", { \"data-lexxy-label-mirror\": \"\" });\n      textNode.replaceWith(mirror);\n      mirror.append(textNode);\n    }\n  }\n}\n\nfunction $isCustomActionTextAttachmentNode(node) {\n  return node instanceof CustomActionTextAttachmentNode\n}\n\nfunction dasherize(value) {\n  return value.replace(/([A-Z])/g, (_, char) => `-${char.toLowerCase()}`)\n}\n\nfunction isAutolinkableURL(string) {\n  return /^(?:[a-z0-9]+:\\/\\/|www\\.)[^\\s]+$/i.test(string)\n}\n\nfunction normalizeFilteredText(string) {\n  return string\n    .toLowerCase()\n    .normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\") // Remove diacritics\n}\n\nfunction filterMatchPosition(text, potentialMatch) {\n  const normalizedText = normalizeFilteredText(text);\n  const normalizedMatch = normalizeFilteredText(potentialMatch);\n\n  if (!normalizedMatch) return 0\n\n  const match = normalizedText.match(new RegExp(`(?<![\\\\p{L}\\\\p{N}])${escapeForRegExp(normalizedMatch)}`, \"u\"));\n  return match ? match.index : -1\n}\n\nfunction upcaseFirst(string) {\n  return string.charAt(0).toUpperCase() + string.slice(1)\n}\n\nfunction escapeForRegExp(string) {\n  return string.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n}\n\n// Parses a value that may arrive as a boolean or as a string (e.g. from DOM\n// getAttribute) into a proper boolean. Ensures \"false\" doesn't evaluate as truthy.\nfunction parseBoolean(value) {\n  if (typeof value === \"string\") return value === \"true\"\n  return Boolean(value)\n}\n\nclass LexxyExtension {\n  #editorElement\n\n  constructor(editorElement) {\n    this.#editorElement = editorElement;\n  }\n\n  get editorElement() {\n    return this.#editorElement\n  }\n\n  get editorConfig() {\n    return this.#editorElement.config\n  }\n\n  // optional: defaults to true\n  get enabled() {\n    return true\n  }\n\n  get lexicalExtension() {\n    return null\n  }\n\n  get allowedElements() {\n    return []\n  }\n\n  defineExtension(...args) {\n    return defineExtension(...args)\n  }\n\n  initializeToolbar(_lexxyToolbar) {\n  }\n\n  setEditorValidity(flags, message) {\n    this.editorElement.setElementValidity(this, flags, message);\n  }\n\n  dispose() {\n  }\n}\n\nfunction $containsRangeSelection(node, selection = $getSelection()) {\n  if ($isRangeSelection(selection)) {\n    const { commonAncestor } = $getCommonAncestor(selection.focus.getNode(), selection.anchor.getNode());\n    return $findMatchingParent(commonAncestor, parent => parent.is(node))\n  } else {\n    return false\n  }\n}\n\nfunction $createNodeSelectionWith(...nodes) {\n  const selection = $createNodeSelection();\n  nodes.forEach(node => selection.add(node.getKey()));\n  return selection\n}\n\nfunction $singleSelectedNode() {\n  const selection = $getSelection();\n  if ($isNodeSelection(selection)) {\n    const nodes = selection.getNodes();\n    if (nodes.length === 1) {\n      return nodes[0]\n    } else {\n      return null\n    }\n  } else {\n    return null\n  }\n}\n\nfunction $selectedLabelledDecoratorNode() {\n  const node = $singleSelectedNode();\n  if (typeof node?.label === \"string\") {\n    return { key: node.getKey(), label: node.label }\n  } else {\n    return null\n  }\n}\n\nfunction registerLabelledDecoratorSelection(editor, onChange) {\n  return editor.registerUpdateListener(({ editorState }) => {\n    onChange(editorState.read($selectedLabelledDecoratorNode));\n  })\n}\n\nfunction $isShadowRoot(node) {\n  return $isElementNode(node) && $isRootOrShadowRoot(node) && !$isRootNode(node)\n}\n\nfunction $isSafeForRoot(node) {\n  return ($isElementNode(node) || $isDecoratorNode(node)) && !node.isParentRequired()\n}\n\nfunction $makeSafeForRoot(node) {\n  if ($isSafeForRoot(node)) {\n    return node\n  } else if (node.getParent()) {\n    return $wrapNodeInElement(node, () => node.createParentElementNode())\n  } else {\n    // Detached nodes (e.g. clipboard nodes being inserted) can't be `replace`d in place,\n    // so append them into a fresh required parent instead.\n    return node.createParentElementNode().append(node)\n  }\n}\n\nfunction getListType(node) {\n  const list = $getNearestNodeOfType(node, ListNode);\n  return list?.getListType() ?? null\n}\n\nfunction announceFromEditor(editor, message) {\n  editor.getRootElement()?.closest(\"lexxy-editor\")?.announce(message);\n}\n\nfunction isEditorFocused(editor) {\n  const rootElement = editor.getRootElement();\n  return rootElement !== null && rootElement.contains(document.activeElement)\n}\n\nfunction $isAtNodeEdge(point, atStart = null) {\n  if (atStart === null) {\n    return $isAtNodeEdge(point, true) || $isAtNodeEdge(point, false)\n  } else {\n    return atStart ? $isAtNodeStart(point) : $isAtNodeEnd(point)\n  }\n}\n\nfunction $isAtNodeStart(point) {\n  return point.offset === 0\n}\n\nfunction extendTextNodeConversion(conversionName, ...callbacks) {\n  return extendConversion(TextNode, conversionName, (conversionOutput, element) => ({\n    ...conversionOutput,\n    forChild: (lexicalNode, parentNode) => {\n      const originalForChild = conversionOutput?.forChild ?? (x => x);\n      const childNode = originalForChild(lexicalNode, parentNode);\n\n      if ($isTextNode(childNode)) {\n        return callbacks.reduce(\n          (childNode, callback) => callback(childNode, element) ?? childNode,\n          childNode\n        )\n      } else {\n        return childNode\n      }\n    }\n  }))\n}\n\nfunction extendConversion(nodeKlass, conversionName, callback = (output => output)) {\n  return (element) => {\n    const converter = nodeKlass.importDOM()?.[conversionName]?.(element);\n    if (!converter) return null\n\n    const conversionOutput = converter.conversion(element);\n    if (!conversionOutput) return conversionOutput\n\n    return callback(conversionOutput, element) ?? conversionOutput\n  }\n}\n\nfunction $isCursorOnLastLine(selection) {\n  const anchorNode = selection.anchor.getNode();\n  const elementNode = $isElementNode(anchorNode) ? anchorNode : anchorNode.getParentOrThrow();\n  const children = elementNode.getChildren();\n  if (children.length === 0) return true\n\n  const lastChild = children[children.length - 1];\n\n  if (anchorNode === elementNode.getLatest() && selection.anchor.offset === children.length) return true\n  if (anchorNode === lastChild) return true\n\n  const lastLineBreakIndex = children.findLastIndex(child => $isLineBreakNode(child));\n  if (lastLineBreakIndex === -1) return true\n\n  const anchorIndex = children.indexOf(anchorNode);\n  return anchorIndex > lastLineBreakIndex\n}\n\nfunction $isBlankNode(node) {\n  if (node.getTextContent().trim() !== \"\") return false\n\n  const children = node.getChildren?.();\n  if (!children || children.length === 0) return true\n\n  return children.every(child => {\n    if ($isLineBreakNode(child)) return true\n    return $isBlankNode(child)\n  })\n}\n\nfunction $trimTrailingBlankNodes(parent) {\n  for (const child of $lastToFirstIterator(parent)) {\n    if ($isBlankNode(child)) {\n      child.remove();\n    } else {\n      break\n    }\n  }\n}\n\n// A list item is structurally empty if it contains no meaningful content.\n// Unlike getTextContent().trim() === \"\", this walks descendants to ensure\n// decorator nodes (mentions, attachments whose getTextContent() may return\n// invisible characters like \\ufeff) are treated as non-empty content.\nfunction $isListItemStructurallyEmpty(listItem) {\n  const children = listItem.getChildren();\n  for (const child of children) {\n    if ($isDecoratorNode(child)) return false\n    if ($isLineBreakNode(child)) continue\n    if ($isTextNode(child)) {\n      if (child.getTextContent().trim() !== \"\") return false\n    } else if ($isElementNode(child)) {\n      if (child.getTextContent().trim() !== \"\") return false\n    }\n  }\n  return true\n}\n\n// Returns the document text up to `offset` inside `targetNode`. Non-inline\n// element siblings are joined with `\\n\\n`, matching Lexical's own\n// ElementNode.getTextContent behavior.\nfunction $textBeforeOffset(targetNode, offset) {\n  const parts = [];\n  let done = false;\n\n  function visit(node) {\n    if (done) return\n    if (node === targetNode) {\n      parts.push(node.getTextContent().slice(0, offset));\n      done = true;\n      return\n    }\n    if ($isElementNode(node)) {\n      const children = node.getChildren();\n      for (let i = 0; i < children.length; i++) {\n        visit(children[i]);\n        if (done) return\n        const child = children[i];\n        if ($isElementNode(child) && !child.isInline() && i < children.length - 1) {\n          parts.push(\"\\n\\n\");\n        }\n      }\n    } else {\n      parts.push(node.getTextContent());\n    }\n  }\n\n  visit($getRoot());\n  return parts.join(\"\")\n}\n\nfunction isAttachmentSpacerTextNode(node, previousNode, index, childCount) {\n  return $isTextNode(node)\n    && node.getTextContent() === \" \"\n    && index === childCount - 1\n    && previousNode instanceof CustomActionTextAttachmentNode\n}\n\nfunction $splitSelectedParagraphsAtInnerLineBreaks(selection) {\n  const topLevelElements = new Set();\n  for (const node of selection.getNodes()) {\n    const topLevel = node.getTopLevelElement();\n    if (topLevel) topLevelElements.add(topLevel);\n  }\n\n  for (const element of topLevelElements) {\n    if (!$isParagraphNode(element)) continue\n\n    const children = element.getChildren();\n    if (!children.some($isLineBreakNode)) continue\n\n    const groups = [ [] ];\n    for (const child of children) {\n      if ($isLineBreakNode(child)) {\n        groups.push([]);\n        child.remove();\n      } else {\n        groups[groups.length - 1].push(child);\n      }\n    }\n\n    for (const group of groups) {\n      if (group.length === 0) continue\n      const paragraph = $createParagraphNode();\n      group.forEach(child => paragraph.append(child));\n      element.insertBefore(paragraph);\n    }\n    if (groups.some(group => group.length > 0)) element.remove();\n  }\n}\n\nfunction $expandSelectionToLineBreaksAndSplitAtEdges(selection, fallbackAncestor = (node) => node.getTopLevelElement()) {\n  $ensureForwardRangeSelection(selection);\n  $shrinkSelectionPastBlockEdges(selection);\n\n  const focusCaret = $caretFromPoint(selection.focus, \"next\");\n  const anchorCaret = $caretFromPoint(selection.anchor, \"previous\");\n\n  // A collapsed cursor adjacent to a <br> would claim it from both sides via\n  // inward-edge; force outward-only walks so each side finds its own boundary.\n  const skipInwardEdge = selection.isCollapsed();\n  const focusBrCaret = $getCaretAtLineBreakBoundary(focusCaret, skipInwardEdge);\n  let anchorBrCaret = $getCaretAtLineBreakBoundary(anchorCaret, skipInwardEdge);\n\n  if (focusBrCaret?.origin.is(anchorBrCaret?.origin)) {\n    anchorBrCaret = null;\n  }\n\n  // Splitting focus first keeps the anchor <br>'s position stable.\n  const focusOuter = focusBrCaret && $splitAroundLineBreak(focusBrCaret);\n  const anchorOuter = anchorBrCaret && $splitAroundLineBreak(anchorBrCaret);\n\n  const innerStart = anchorOuter?.getNextSibling() ?? fallbackAncestor(selection.anchor.getNode());\n  const innerEnd = focusOuter?.getPreviousSibling() ?? fallbackAncestor(selection.focus.getNode());\n  if (!innerStart || !innerEnd) return\n\n  $setSelectionFromCaretRange($getCaretRange(\n    $normalizeCaret($getChildCaret(innerStart, \"next\")),\n    $getCaretInDirection(\n      $normalizeCaret($getChildCaret(innerEnd, \"previous\")),\n      \"next\",\n    ),\n  ));\n}\n\n// A selection whose anchor sits at the very end of one block while its focus\n// lives in a later block (e.g. selecting a pasted paragraph when the browser\n// anchors at the end of the line above) contributes nothing from the anchor's\n// block. Pull each endpoint that is flush against a block edge into the block\n// that actually holds the selected content, so we don't wrap the empty edge\n// block too.\nfunction $shrinkSelectionPastBlockEdges(selection) {\n  if (selection.isCollapsed()) return\n\n  const anchorBlock = selection.anchor.getNode().getTopLevelElement();\n  const focusBlock = selection.focus.getNode().getTopLevelElement();\n  if (!anchorBlock || !focusBlock || anchorBlock.is(focusBlock)) return\n\n  if ($isAtBlockEnd(selection.anchor, anchorBlock)) {\n    const nextBlock = $nearestElementSibling(anchorBlock, \"next\");\n    if (nextBlock) selection.anchor.set(nextBlock.getKey(), 0, \"element\");\n  }\n\n  if ($isAtBlockStart(selection.focus, focusBlock)) {\n    const previousBlock = $nearestElementSibling(focusBlock, \"previous\");\n    if (previousBlock) selection.focus.set(previousBlock.getKey(), previousBlock.getChildrenSize(), \"element\");\n  }\n\n  // Shrinking moves the endpoints toward each other, so they can cross when\n  // both were flush against block edges; callers assume a forward selection.\n  $ensureForwardRangeSelection(selection);\n}\n\n// Top-level decorator blocks (attachments, horizontal dividers) can't hold a\n// selection point, so walk past them to the nearest element sibling. Returns\n// null when no element sibling exists in that direction.\nfunction $nearestElementSibling(block, direction) {\n  let sibling = block;\n  do {\n    sibling = direction === \"next\" ? sibling.getNextSibling() : sibling.getPreviousSibling();\n  } while (sibling && !$isElementNode(sibling))\n  return sibling\n}\n\nfunction $isAtBlockEnd(point, block) {\n  return $isAtBlockBoundary($caretFromPoint(point, \"next\"), block)\n}\n\nfunction $isAtBlockStart(point, block) {\n  return $isAtBlockBoundary($caretFromPoint(point, \"previous\"), block)\n}\n\n// A text point sitting mid-node still has content ahead of it in the caret's\n// direction, even though that content is not a sibling node. $getNodeAtCaret\n// only sees siblings, so check the text edge before walking the block.\nfunction $isAtBlockBoundary(caret, block) {\n  if ($isTextPointCaret(caret) && $isExtendableTextPointCaret(caret)) return false\n\n  let cursor = $normalizeCaret(caret);\n  while (cursor && block.isParentOf(cursor.origin)) {\n    if (cursor.getNodeAtCaret()) return false\n    cursor = cursor.getParentCaret();\n  }\n  return true\n}\n\nfunction $getCaretAtLineBreakBoundary(caret, skipInwardEdge = false) {\n  const paragraph = caret.origin.getTopLevelElement();\n  if (!paragraph || !$isParagraphNode(paragraph)) return null\n\n  const lineBreak = (skipInwardEdge ? null : $inwardEdgeLineBreak(caret, paragraph))\n    ?? $outwardLineBreak(caret, paragraph);\n\n  return lineBreak ? $getSiblingCaret(lineBreak, caret.direction) : null\n}\n\n// Prefer a <br> the cursor is sitting flush against, except when a further <br>\n// also exists outward \u2014 that one is the real paragraph break for this side.\nfunction $inwardEdgeLineBreak(caret, paragraph) {\n  let candidateCaret;\n\n  if (\n    ($isChildCaret(caret) && caret.origin.is(paragraph)) ||\n    ($isTextPointCaret(caret) && $isExtendableTextPointCaret(caret.getFlipped()))\n  ) {\n    candidateCaret = null;\n  } else if ($isSiblingCaret(caret) && caret.getParentAtCaret().is(paragraph)) {\n    candidateCaret = caret;\n  } else {\n    const childCaret = $paragraphChildCaretAtInwardEdge(caret, paragraph);\n    candidateCaret = childCaret ? $rewindSiblingCaret(childCaret) : null;\n  }\n\n  if (candidateCaret && $isLineBreakNode(candidateCaret.origin)) {\n    return $candidateUnlessShadowed(candidateCaret)\n  } else {\n    return null\n  }\n}\n\nfunction $candidateUnlessShadowed(candidateCaret) {\n  const outward = candidateCaret.getNodeAtCaret();\n  return $isLineBreakNode(outward) ? null : candidateCaret.origin\n}\n\nfunction $outwardLineBreak(caret, paragraph) {\n  const startCaret = $outwardWalkStartCaret(caret, paragraph);\n  if (!startCaret) return null\n\n  for (const { origin } of startCaret) {\n    if (!origin.getParent().is(paragraph)) break\n    if ($isLineBreakNode(origin)) return origin\n  }\n  return null\n}\n\nfunction $outwardWalkStartCaret(caret, paragraph) {\n  if (caret.getParentAtCaret().is(paragraph)) {\n    return caret\n  } else {\n    return $paragraphChildCaretContaining(caret, paragraph)\n  }\n}\n\nfunction $paragraphChildCaretContaining(caret, paragraph) {\n  let cursor = caret.getSiblingCaret();\n  while (cursor && !cursor.origin.getParent()?.is(paragraph)) {\n    cursor = cursor.getParentCaret();\n  }\n  return cursor?.origin.getParent()?.is(paragraph) ? cursor : null\n}\n\n// Only succeeds when the cursor is flush against the inward edge of every\n// ancestor between itself and the paragraph child.\nfunction $paragraphChildCaretAtInwardEdge(caret, paragraph) {\n  let cursor = caret.getSiblingCaret();\n  while (cursor && !cursor.origin.getParent()?.is(paragraph)) {\n    if (cursor.getNodeAtCaret()) return null\n    cursor = cursor.getParentCaret();\n  }\n  return cursor?.origin.getParent()?.is(paragraph) ? cursor : null\n}\n\nfunction $splitAroundLineBreak(lineBreakCaret) {\n  let outer = null;\n\n  if (lineBreakCaret.getNodeAtCaret() === null) {\n    lineBreakCaret.origin.remove();\n  } else {\n    const lineBreak = lineBreakCaret.origin;\n    const splitCaret = $getCaretInDirection($rewindSiblingCaret(lineBreakCaret), \"next\");\n\n    $splitAtPointCaretNext(splitCaret);\n    outer = lineBreak.getTopLevelElement();\n    lineBreak.remove();\n  }\n\n  return outer\n}\n\n// Lexical's RangeSelection.insertNodes/insertLineBreak require every selection point to have a\n// block ancestor with inline children. An element point on a container of block nodes \u2014 e.g. a\n// quote holding paragraphs \u2014 has none, so Lexical throws invariant #211 or #212. This detects\n// such a point so callers can descend it to a leaf before inserting.\nfunction $isPointOnBlockContainer(point) {\n  if (point.type !== \"element\") return false\n\n  const firstChild = point.getNode().getFirstChild();\n  return ($isElementNode(firstChild) || $isDecoratorNode(firstChild)) && !firstChild.isInline()\n}\n\nfunction $hasPointOnBlockContainer(selection) {\n  return $isRangeSelection(selection) &&\n    [ selection.anchor, selection.focus ].some($isPointOnBlockContainer)\n}\n\n// Descend any block-container element point in the selection to a leaf position, so a subsequent\n// Lexical insert (insertNodes, insertLineBreak, INSERT_PARAGRAPH) doesn't throw invariant #211/#212.\nfunction $normalizeBlockContainerSelection(selection = $getSelection()) {\n  if (!$hasPointOnBlockContainer(selection)) return false\n\n  $normalizeSelection__EXPERIMENTAL(selection);\n  return true\n}\n\nfunction $consecutiveSiblingGroups(blocks) {\n  const ordered = [ ...blocks ].sort((a, b) => a.getIndexWithinParent() - b.getIndexWithinParent());\n  const groups = [];\n\n  for (const block of ordered) {\n    const lastGroup = groups.at(-1);\n    const previous = lastGroup?.at(-1);\n\n    if (previous && previous.getParent().is(block.getParent()) && previous.getNextSibling()?.is(block)) {\n      lastGroup.push(block);\n    } else {\n      groups.push([ block ]);\n    }\n  }\n\n  return groups\n}\n\n// Payload: Record<nodeKey, { patch?, replace? }>\n//   - patch: plain object, shallow-merged into the existing node's properties\n//   - replace: a LexicalNode instance that replaces the node\nconst REWRITE_HISTORY_COMMAND = createCommand(\"REWRITE_HISTORY_COMMAND\");\n\nclass RewritableHistoryExtension extends LexxyExtension {\n  #historyState = null\n\n  get lexicalExtension() {\n    return defineExtension({\n      name: \"lexxy/rewritable-history\",\n      dependencies: [ HistoryExtension ],\n      register: (editor, _config, state) => {\n        const historyOutput = state.getDependency(HistoryExtension).output;\n        this.#historyState = historyOutput.historyState.value;\n\n        return editor.registerCommand(\n          REWRITE_HISTORY_COMMAND,\n          (rewrites) => this.#rewriteHistory(rewrites),\n          COMMAND_PRIORITY_EDITOR\n        )\n      }\n    })\n  }\n\n  get historyState() {\n    return this.#historyState\n  }\n\n  get #allHistoryEntries() {\n    const entries = Array.from(this.#historyState.undoStack);\n    if (this.#historyState.current) entries.push(this.#historyState.current);\n    return entries.concat(this.#historyState.redoStack)\n  }\n\n  #rewriteHistory(rewrites) {\n    this.#applyRewritesImmediatelyToCurrentState(rewrites);\n    this.#applyRewritesToHistory(rewrites);\n\n    return true\n  }\n\n  #applyRewritesImmediatelyToCurrentState(rewrites) {\n    $getEditor().update(() => {\n      for (const [ nodeKey, { patch, replace } ] of Object.entries(rewrites)) {\n        const node = $getNodeByKey(nodeKey);\n        if (!node) continue\n\n        if (patch) Object.assign(node.getWritable(), patch);\n        if (replace) node.replace(replace);\n      }\n    }, { discrete: true, tag: this.#getBackgroundUpdateTags() });\n  }\n\n  #applyRewritesToHistory(rewrites) {\n    const nodeKeys = Object.keys(rewrites);\n\n    for (const entry of this.#allHistoryEntries) {\n      if (!this.#entryHasSomeKeys(entry, nodeKeys)) continue\n\n      const editorState = entry.editorState = safeCloneEditorState(entry.editorState);\n\n      for (const [ nodeKey, { patch, replace } ] of Object.entries(rewrites)) {\n        const node = editorState._nodeMap.get(nodeKey);\n        if (!node) continue\n\n        if (patch) {\n          this.#patchNodeInEditorState(editorState, node, patch);\n        } else if (replace) {\n          this.#replaceNodeInEditorState(editorState, node, replace);\n        }\n      }\n    }\n  }\n\n  #entryHasSomeKeys(entry, nodeKeys) {\n    return nodeKeys.some(key => entry.editorState._nodeMap.has(key))\n  }\n\n  #getBackgroundUpdateTags() {\n    const tags = [ HISTORY_MERGE_TAG, SKIP_SCROLL_INTO_VIEW_TAG ];\n    if (!isEditorFocused(this.editorElement.editor)) { tags.push(SKIP_DOM_SELECTION_TAG); }\n    return tags\n  }\n\n  #patchNodeInEditorState(editorState, node, patch) {\n    editorState._nodeMap.set(node.__key, $cloneNodeWithPatch(node, patch));\n  }\n\n  #replaceNodeInEditorState(editorState, node, replaceWith) {\n    editorState._nodeMap.set(node.__key, $cloneNodeAdoptingKeys(replaceWith, node));\n  }\n}\n\nfunction $cloneNodeWithPatch(node, patch) {\n  const clone = $cloneWithProperties(node);\n  Object.assign(clone, patch);\n  return clone\n}\n\nfunction $cloneNodeAdoptingKeys(node, previousNode) {\n  const clone = $cloneWithProperties(node);\n  clone.__key = previousNode.__key;\n  clone.__parent = previousNode.__parent;\n  clone.__prev = previousNode.__prev;\n  clone.__next = previousNode.__next;\n  return clone\n}\n\n// EditorState#clone() keeps the same map reference.\n// A new Map is needed to prevent editing Lexical's internal map\n// Warning: this bypasses DEV's safety map freezing\nfunction safeCloneEditorState(editorState) {\n  const clone = editorState.clone();\n  clone._nodeMap = new Map(editorState._nodeMap);\n  return clone\n}\n\nconst INITIAL_PREVIEW_POLL_DELAY_MS = 3000;\nconst MAX_PREVIEW_POLL_DELAY_MS = 120000;\nconst MAX_PREVIEW_POLL_ATTEMPTS = 20;\n\n\nclass ActionTextAttachmentNode extends DecoratorNode {\n  static getType() {\n    return \"action_text_attachment\"\n  }\n\n  static clone(node) {\n    return new ActionTextAttachmentNode({ ...node }, node.__key)\n  }\n\n  static importJSON(serializedNode) {\n    return new ActionTextAttachmentNode({ ...serializedNode })\n  }\n\n  static importDOM() {\n    return {\n      [this.TAG_NAME]: () => {\n        return {\n          conversion: (attachment) => ({\n            node: new ActionTextAttachmentNode({\n              sgid: attachment.getAttribute(\"sgid\"),\n              src: attachment.getAttribute(\"url\"),\n              previewable: attachment.getAttribute(\"previewable\"),\n              altText: attachment.getAttribute(\"alt\"),\n              caption: attachment.getAttribute(\"caption\"),\n              contentType: attachment.getAttribute(\"content-type\"),\n              fileName: attachment.getAttribute(\"filename\"),\n              fileSize: attachment.getAttribute(\"filesize\"),\n              width: attachment.getAttribute(\"width\"),\n              height: attachment.getAttribute(\"height\")\n            })\n          }), priority: 1\n        }\n      },\n      \"img\": () => {\n        return {\n          conversion: (img) => {\n            const fileName = extractFileName(img.getAttribute(\"src\") ?? \"\");\n            return {\n              node: new ActionTextAttachmentNode({\n                src: img.getAttribute(\"src\"),\n                fileName: fileName,\n                altText: img.getAttribute(\"alt\"),\n                contentType: \"image/*\",\n                width: img.getAttribute(\"width\"),\n                height: img.getAttribute(\"height\")\n              })\n            }\n          }, priority: 1\n        }\n      },\n      \"video\": () => {\n        return {\n          conversion: (video) => {\n            const videoSource = video.getAttribute(\"src\") || video.querySelector(\"source\")?.src;\n            const fileName = videoSource?.split(\"/\")?.pop();\n            const contentType = video.querySelector(\"source\")?.getAttribute(\"content-type\") || \"video/*\";\n\n            return {\n              node: new ActionTextAttachmentNode({\n                src: videoSource,\n                fileName: fileName,\n                contentType: contentType\n              })\n            }\n          }, priority: 1\n        }\n      }\n    }\n  }\n\n  static get TAG_NAME() {\n    return Lexxy.global.get(\"attachmentTagName\")\n  }\n\n  constructor({ sgid, src, previewSrc, previewable, previewStatusUrl, pendingPreview, altText, caption, contentType, fileName, fileSize, width, height, uploadError } = {}, key) {\n    super(key);\n\n    this.sgid = sgid;\n    this.src = src;\n    this.previewSrc = previewSrc;\n    this.previewable = parseBoolean(previewable);\n    this.previewStatusUrl = previewStatusUrl;\n    this.pendingPreview = pendingPreview;\n    this.altText = altText || \"\";\n    this.caption = caption || \"\";\n    this.contentType = contentType || \"\";\n    this.fileName = fileName || \"\";\n    this.fileSize = fileSize;\n    this.width = width;\n    this.height = height;\n    this.uploadError = uploadError;\n\n    this.editor = $getEditor();\n  }\n\n  createDOM() {\n    if (this.uploadError) return this.createDOMForError()\n    if (this.pendingPreview) return this.#createDOMForPendingPreview()\n\n    const figure = this.createAttachmentFigure();\n\n    if (this.isPreviewableAttachment) {\n      figure.appendChild(this.#createDOMForImage());\n      figure.appendChild(this.#createEditableCaption());\n    } else if (this.isVideo) {\n      figure.appendChild(this.#createDOMForFile());\n      figure.appendChild(this.#createEditableCaption());\n    } else {\n      figure.appendChild(this.#createDOMForFile());\n      figure.appendChild(this.#createDOMForNotImage());\n    }\n\n    return figure\n  }\n\n  updateDOM(prevNode, dom) {\n    if (this.uploadError !== prevNode.uploadError) return true\n\n    const image = dom.querySelector(\"img\");\n    if (image && prevNode.altText !== this.altText) {\n      image.alt = this.altText;\n    }\n\n    if (prevNode.caption !== this.caption) {\n      dom.querySelector(\"figcaption\")?.toggleAttribute(\"data-placeholder\", !this.caption);\n    }\n\n    const captionText = dom.querySelector(\"figcaption .attachment__caption-text\");\n    if (captionText && prevNode.captionLabel !== this.captionLabel) {\n      captionText.textContent = this.captionLabel;\n    }\n\n    return false\n  }\n\n  get captionLabel() {\n    return this.caption || this.fileName || \"\"\n  }\n\n  getTextContent() {\n    return `[${this.caption || this.fileName}]\\n\\n`\n  }\n\n  isInline() {\n    return this.isAttached() && !this.getParent().is($getNearestRootOrShadowRoot(this))\n  }\n\n  exportDOM() {\n    const attachment = createElement(ActionTextAttachmentNode.TAG_NAME, {\n      sgid: this.sgid,\n      previewable: this.previewable || null,\n      url: this.src,\n      alt: this.altText,\n      caption: this.caption,\n      \"content-type\": this.contentType,\n      filename: this.fileName,\n      filesize: this.fileSize,\n      width: this.width,\n      height: this.height,\n      presentation: \"gallery\"\n    });\n\n    return { element: attachment }\n  }\n\n  exportJSON() {\n    return {\n      type: \"action_text_attachment\",\n      version: 1,\n      sgid: this.sgid,\n      src: this.src,\n      previewable: this.previewable,\n      previewStatusUrl: this.previewStatusUrl,\n      pendingPreview: this.pendingPreview,\n      altText: this.altText,\n      caption: this.caption,\n      contentType: this.contentType,\n      fileName: this.fileName,\n      fileSize: this.fileSize,\n      width: this.width,\n      height: this.height\n    }\n  }\n\n  decorate() {\n    return null\n  }\n\n  createDOMForError() {\n    const figure = this.createAttachmentFigure();\n    figure.classList.add(\"attachment--error\");\n    figure.appendChild(createElement(\"div\", { innerText: `Error uploading ${this.fileName || \"file\"}` }));\n    return figure\n  }\n\n  createAttachmentFigure(previewable = this.isPreviewableAttachment) {\n    const figure = createAttachmentFigure(this.contentType, previewable, this.fileName);\n    figure.draggable = true;\n    figure.dataset.lexicalNodeKey = this.__key;\n\n    return figure\n  }\n\n  get isPreviewableAttachment() {\n    return this.isPreviewableImage || this.previewable\n  }\n\n  get isPreviewableImage() {\n    return isPreviewableImage(this.contentType)\n  }\n\n  get isVideo() {\n    return this.contentType.startsWith(\"video/\")\n  }\n\n  get label() {\n    if (this.caption && this.altText && this.altText !== this.caption && this.altText !== this.fileName) {\n      return `${this.caption}. ${this.altText}`\n    } else {\n      return this.caption || this.altText || this.fileName || \"\"\n    }\n  }\n\n  focusCaption() {\n    return this.editor.getRootElement()?.closest(\"lexxy-editor\")?.captionEditor.open(this.getKey()) ?? false\n  }\n\n  #createDOMForPendingPreview() {\n    const figure = this.createAttachmentFigure(false);\n    figure.appendChild(this.#createDOMForFile());\n    figure.appendChild(this.#createDOMForNotImage());\n    this.#pollForPreview(figure);\n    return figure\n  }\n\n  patchAndRewriteHistory(patch) {\n    this.editor.dispatchCommand(REWRITE_HISTORY_COMMAND, {\n      [this.getKey()]: { patch }\n    });\n  }\n\n  replaceAndRewriteHistory(node) {\n    this.editor.dispatchCommand(REWRITE_HISTORY_COMMAND, {\n      [this.getKey()]: { replace: node }\n    });\n  }\n\n  #createDOMForImage(options = {}) {\n    const initialSrc = this.previewSrc || this.src;\n    const img = createElement(\"img\", { src: initialSrc, draggable: false, alt: this.altText, ...this.#imageDimensions, ...options });\n\n    if (this.previewable && !this.isPreviewableImage) {\n      img.onerror = () => this.#swapPreviewToFileDOM(img);\n    }\n\n    if (this.previewSrc) {\n      this.#preloadAndSwapSrc(img);\n    }\n\n    const container = createElement(\"div\", { className: \"attachment__container\" });\n    container.appendChild(img);\n    return container\n  }\n\n  #preloadAndSwapSrc(img) {\n    const previewSrc = this.previewSrc;\n    const serverImage = new Image();\n\n    serverImage.onload = () => this.#handleImageLoaded(img, previewSrc);\n    serverImage.onerror = () => this.#handleImageLoadError(previewSrc);\n    serverImage.src = this.src;\n  }\n\n  #handleImageLoaded(img, previewSrc) {\n    img.src = this.src;\n    this.patchAndRewriteHistory({ previewSrc: null });\n    this.#revokePreviewSrc(previewSrc);\n  }\n\n  #handleImageLoadError(previewSrc) {\n    this.patchAndRewriteHistory({\n      previewSrc: null,\n      uploadError: true\n    });\n    this.#revokePreviewSrc(previewSrc);\n  }\n\n  #revokePreviewSrc(previewSrc) {\n    if (previewSrc?.startsWith(\"blob:\")) URL.revokeObjectURL(previewSrc);\n  }\n\n  #swapPreviewToFileDOM(img) {\n    const figure = img.closest(\"figure.attachment\");\n    if (!figure) return\n\n    this.#swapFigureContent(figure, \"attachment--preview\", \"attachment--file\", () => {\n      figure.appendChild(this.#createDOMForFile());\n      figure.appendChild(this.#createDOMForNotImage());\n    });\n  }\n\n  // While the file-icon is shown, watch for the preview to become ready.\n  // With a status URL, poll it (2xx = processing, anything else = ready).\n  // Without one, preload the preview URL once and swap on load.\n  #pollForPreview(figure) {\n    if (this.previewStatusUrl) {\n      this.#waitForPreviewByPollingStatus(figure);\n    } else {\n      this.#waitForPreviewByPreloadingImage(figure);\n    }\n  }\n\n  #waitForPreviewByPollingStatus(figure) {\n    let attempt = 0;\n\n    const tryStatus = async () => {\n      if (!this.editor.read(() => this.isAttached())) return\n\n      try {\n        // redirect: \"manual\" prevents fetch from transparently following a\n        // 3xx response \u2014 without it, a status endpoint that redirected to,\n        // say, the preview URL would resolve to a 200 and look like\n        // \"still processing.\" The contract is \"any non-2xx means done.\"\n        const response = await fetch(this.previewStatusUrl, { credentials: \"include\", redirect: \"manual\" });\n\n        if (!this.editor.read(() => this.isAttached())) return\n\n        if (response.ok) {\n          retry();\n        } else {\n          this.#swapToPreviewDOM(figure, this.src);\n        }\n      } catch {\n        retry();\n      }\n    };\n\n    const retry = () => {\n      attempt++;\n      if (attempt < MAX_PREVIEW_POLL_ATTEMPTS && this.editor.read(() => this.isAttached())) {\n        const delay = Math.min(2000 * Math.pow(1.5, attempt), MAX_PREVIEW_POLL_DELAY_MS);\n        setTimeout(tryStatus, delay);\n      }\n    };\n\n    // Give the server time to start processing before the first attempt\n    setTimeout(tryStatus, INITIAL_PREVIEW_POLL_DELAY_MS);\n  }\n\n  #waitForPreviewByPreloadingImage(figure) {\n    const img = new Image();\n    img.onload = () => {\n      if (!this.editor.read(() => this.isAttached())) return\n      this.#swapToPreviewDOM(figure, this.src);\n    };\n    img.onerror = () => {\n      // Clear pendingPreview so undo/redo or any JSON round-trip doesn't\n      // re-enter the pending flow and issue another fetch. The file icon\n      // stays as the stable fallback.\n      if (!this.editor.read(() => this.isAttached())) return\n      this.patchAndRewriteHistory({ pendingPreview: false });\n    };\n    img.src = this.src;\n  }\n\n  #swapToPreviewDOM(figure, previewSrc) {\n    const altText = this.editor.read(() => this.getLatest().altText);\n    this.#swapFigureContent(figure, \"attachment--file\", \"attachment--preview\", () => {\n      const img = createElement(\"img\", { src: previewSrc, draggable: false, alt: altText });\n      img.onerror = () => this.#swapPreviewToFileDOM(img);\n      const container = createElement(\"div\", { className: \"attachment__container\" });\n      container.appendChild(img);\n      figure.appendChild(container);\n      figure.appendChild(this.#createEditableCaption());\n    });\n\n    this.patchAndRewriteHistory({ pendingPreview: false });\n  }\n\n  #swapFigureContent(figure, fromClass, toClass, renderContent) {\n    figure.className = figure.className.replace(fromClass, toClass);\n\n    for (const child of [ ...figure.querySelectorAll(\".attachment__container, .attachment__icon, figcaption\") ]) {\n      child.remove();\n    }\n\n    renderContent();\n  }\n\n  get #imageDimensions() {\n    if (this.width && this.height) {\n      return { width: this.width, height: this.height }\n    } else {\n      return {}\n    }\n  }\n\n  #createDOMForFile() {\n    const extension = this.fileName ? this.fileName.split(\".\").pop().toLowerCase() : \"unknown\";\n    return createElement(\"span\", { className: \"attachment__icon\", textContent: `${extension}` })\n  }\n\n  #createDOMForNotImage() {\n    const figcaption = createElement(\"figcaption\", { className: \"attachment__caption\" });\n\n    const nameTag = createElement(\"strong\", { className: \"attachment__name\", textContent: this.caption || this.fileName });\n\n    figcaption.appendChild(nameTag);\n\n    if (this.fileSize) {\n      const sizeSpan = createElement(\"span\", { className: \"attachment__size\", textContent: bytesToHumanSize(this.fileSize) });\n      figcaption.appendChild(sizeSpan);\n    }\n\n    return figcaption\n  }\n\n  #createEditableCaption() {\n    const caption = createElement(\"figcaption\", { className: \"attachment__caption attachment__caption--editable\" });\n    const text = createElement(\"span\", { className: \"attachment__caption-text\", textContent: this.captionLabel });\n    caption.appendChild(text);\n    caption.toggleAttribute(\"data-placeholder\", !this.caption);\n    caption.addEventListener(\"mousedown\", event => event.preventDefault());\n    caption.addEventListener(\"click\", event => {\n      event.stopPropagation();\n      this.focusCaption();\n    });\n    return caption\n  }\n}\n\nfunction $createActionTextAttachmentNode(...args) {\n  return new ActionTextAttachmentNode(...args)\n}\n\nfunction $isActionTextAttachmentNode(node) {\n  return node instanceof ActionTextAttachmentNode\n}\n\nfunction filterDisallowedAttachmentNodes(nodes, editorElement) {\n  return nodes\n    .filter(node => !isDisallowedAttachment(node, editorElement))\n    .map(node => {\n      $descendantsMatching([ node ], descendant => isDisallowedAttachment(descendant, editorElement))\n        .forEach(descendant => descendant.remove());\n      return node\n    })\n}\n\nfunction isDisallowedAttachment(node, editorElement) {\n  const isAttachmentNode =\n    node instanceof CustomActionTextAttachmentNode ||\n    node instanceof ActionTextAttachmentNode;\n  return isAttachmentNode &&\n         !editorElement.permitsAttachmentContentType(node.contentType)\n}\n\n// Replaces inline `data:image/...` attachments with upload nodes that flow through the normal\n// file upload pipeline.\n//\n// Without this step, pasted-from-Google-Docs-style content lands in the editor with the entire\n// base64 image embedded in the attachment's `src`, which then persists into the saved HTML and\n// bloats the stored document.\n//\n// Each conversion dispatches the cancelable `lexxy:file-accept` event so the host's allowlist (and\n// any other listener) can refuse the synthesized File before it's accepted into the upload\n// pipeline; on refusal, the node is dropped silently \u2014 matching how `Contents#uploadFiles` handles\n// file-picker rejections.\nfunction $convertInlineImageDataURIs(nodes, editorElement) {\n  const topLevel = nodes\n    .map(node => isInlineImageDataURIAttachment(node) ? $tryCreateUploadFromDataURI(node, editorElement) : node)\n    .filter(node => node !== null);\n\n  for (const node of topLevel) {\n    for (const desc of $descendantsMatching([ node ], isInlineImageDataURIAttachment)) {\n      const upload = $tryCreateUploadFromDataURI(desc, editorElement);\n      if (upload) {\n        desc.replace(upload);\n      } else {\n        desc.remove();\n      }\n    }\n  }\n\n  return topLevel\n}\n\nfunction isInlineImageDataURIAttachment(node) {\n  return node instanceof ActionTextAttachmentNode &&\n    /^data:image\\/[^,]*;base64,/i.test(node.src ?? \"\")\n}\n\nfunction $tryCreateUploadFromDataURI(node, editorElement) {\n  const file = dataURIToFile(node.src);\n  if (file && editorElement.acceptsFile(file)) {\n    return editorElement.contents.$createUploadNode(file)\n  }\n  return null\n}\n\nfunction dataURIToFile(dataURI) {\n  try {\n    const [ header, data ] = dataURI.split(\",\");\n\n    // https://datatracker.ietf.org/doc/html/rfc6838#section-4.2\n    const mimeType = header.match(/^data:(image\\/[A-Za-z0-9][A-Za-z0-9!#$&\\-^_.+]*)/)?.[1];\n    if (mimeType) {\n      const bytes = Uint8Array.from(atob(data), (c) => c.charCodeAt(0));\n      const extension = mimeTypeToExtension(mimeType) ?? \"png\";\n      return new File([ bytes ], `pasted-image-${Date.now()}.${extension}`, { type: mimeType })\n    } else {\n      return null\n    }\n  } catch {\n    return null\n  }\n}\n\nclass HorizontalDividerNode extends DecoratorNode {\n  static getType() {\n    return \"horizontal_divider\"\n  }\n\n  static clone(node) {\n    return new HorizontalDividerNode(node.__key)\n  }\n\n  static importJSON(serializedNode) {\n    return new HorizontalDividerNode()\n  }\n\n  static importDOM() {\n    return {\n      \"hr\": (hr) => {\n        return {\n          conversion: () => ({\n            node: new HorizontalDividerNode()\n          }),\n          priority: 1\n        }\n      }\n    }\n  }\n\n  constructor(key) {\n    super(key);\n  }\n\n  // The hr already provides separator semantics; a figure boundary would be redundant.\n  createDOM() {\n    const figure = createElement(\"figure\", { className: \"horizontal-divider\", role: \"presentation\" });\n    figure.appendChild(createElement(\"hr\"));\n    figure.dataset.lexicalNodeKey = this.__key;\n\n    return figure\n  }\n\n  updateDOM() {\n    return true\n  }\n\n  getTextContent() {\n    return \"\u2504\\n\\n\"\n  }\n\n  isInline() {\n    return false\n  }\n\n  get label() {\n    return \"Horizontal divider\"\n  }\n\n  exportDOM() {\n    const hr = createElement(\"hr\");\n    return { element: hr }\n  }\n\n  exportJSON() {\n    return {\n      type: \"horizontal_divider\",\n      version: 1\n    }\n  }\n\n  decorate() {\n    return null\n  }\n}\n\nconst HORIZONTAL_DIVIDER = {\n  dependencies: [ HorizontalDividerNode ],\n  export: (node) => {\n    return node instanceof HorizontalDividerNode ? \"---\" : null\n  },\n  regExpStart: /^-{3,}\\s?$/,\n  replace: (parentNode, children, match, endMatch, linesInBetween, isImport) => {\n    const hrNode = new HorizontalDividerNode();\n    parentNode.replace(hrNode);\n\n    if (!isImport) {\n      const paragraph = $createParagraphNode();\n      hrNode.insertAfter(paragraph);\n      paragraph.select();\n    }\n  },\n  type: \"multiline-element\"\n};\n\nconst PUNCTUATION_OR_SPACE = /[^\\w]/;\n\n// Supplements Lexical's built-in registerMarkdownShortcuts to handle the case\n// where a user types a leading tag before text that already ends with a\n// trailing tag (e.g. typing ` before `hello`` or ** before **hello**).\n//\n// Lexical's markdown shortcut handler only triggers format transformations when\n// the closing tag is the character just typed. When the opening tag is typed\n// instead (e.g. typing ` before `hello`` to form ``hello``), the built-in\n// handler doesn't match because it looks backward from the cursor for an\n// opening tag, but the cursor is right after it.\n//\n// This listener detects that scenario for ALL text format transformers\n// (backtick, bold, italic, strikethrough, etc.) and applies the appropriate\n// format.\nfunction registerMarkdownLeadingTagHandler(editor, transformers) {\n  const textFormatTransformers = transformers\n    .filter(t => t.type === \"text-format\")\n    .sort((a, b) => b.tag.length - a.tag.length); // Longer tags first\n\n  return editor.registerUpdateListener(({ tags, dirtyLeaves, editorState, prevEditorState }) => {\n    if (tags.has(\"historic\") || tags.has(\"collaboration\")) return\n    if (editor.isComposing()) return\n\n    const selection = editorState.read($getSelection);\n    const prevSelection = prevEditorState.read($getSelection);\n\n    if (!$isRangeSelection(prevSelection) || !$isRangeSelection(selection) || !selection.isCollapsed()) return\n\n    const anchorKey = selection.anchor.key;\n    const anchorOffset = selection.anchor.offset;\n\n    if (!dirtyLeaves.has(anchorKey)) return\n\n    const anchorNode = editorState.read(() => $getNodeByKey(anchorKey));\n    if (!$isTextNode(anchorNode)) return\n\n    // Only trigger when cursor moved forward (typing)\n    const prevOffset = prevSelection.anchor.key === anchorKey ? prevSelection.anchor.offset : 0;\n    if (anchorOffset <= prevOffset) return\n\n    const textContent = editorState.read(() => anchorNode.getTextContent());\n\n    // Try each transformer, longest tags first\n    for (const transformer of textFormatTransformers) {\n      const tag = transformer.tag;\n      const tagLen = tag.length;\n\n      // The typed characters must end at the cursor position and form the opening tag\n      const openTagStart = anchorOffset - tagLen;\n      if (openTagStart < 0) continue\n\n      const candidateOpenTag = textContent.slice(openTagStart, anchorOffset);\n      if (candidateOpenTag !== tag) continue\n\n      // Disambiguate from longer tags: if the character before the opening tag\n      // is the same as the tag character, this might be part of a longer tag\n      // (e.g. seeing `*` when the user is actually typing `**`)\n      const tagChar = tag[0];\n      if (openTagStart > 0 && textContent[openTagStart - 1] === tagChar) continue\n\n      // Check intraword constraint: if intraword is false, the character before\n      // the opening tag must be a space, punctuation, or the start of the text\n      if (transformer.intraword === false && openTagStart > 0) {\n        const beforeChar = textContent[openTagStart - 1];\n        if (beforeChar && !PUNCTUATION_OR_SPACE.test(beforeChar)) continue\n      }\n\n      // Search forward for a closing tag in the same text node\n      const searchStart = anchorOffset;\n      const closeTagIndex = textContent.indexOf(tag, searchStart);\n      if (closeTagIndex < 0) continue\n\n      // Disambiguate closing tag from longer tags: if the character right after\n      // the closing tag is the same as the tag character, skip\n      // (e.g. `*hello**` \u2014 the first `*` at index 6 is part of `**`)\n      if (textContent[closeTagIndex + tagLen] === tagChar) continue\n\n      // Also check if the character before the closing tag start is the same\n      // tag character (e.g. the closing tag might be a suffix of a longer sequence)\n      if (closeTagIndex > 0 && textContent[closeTagIndex - 1] === tagChar) continue\n\n      // There must be content between the tags (not just empty or whitespace-adjacent)\n      const innerStart = anchorOffset;\n      const innerEnd = closeTagIndex;\n      if (innerEnd <= innerStart) continue\n\n      // No space immediately after opening tag\n      if (textContent[innerStart] === \" \") continue\n\n      // No space immediately before closing tag\n      if (textContent[innerEnd - 1] === \" \") continue\n\n      // Check intraword constraint for closing tag\n      if (transformer.intraword === false) {\n        const afterCloseChar = textContent[closeTagIndex + tagLen];\n        if (afterCloseChar && !PUNCTUATION_OR_SPACE.test(afterCloseChar)) continue\n      }\n\n      editor.update(() => {\n        const node = $getNodeByKey(anchorKey);\n        if (!node || !$isTextNode(node)) return\n\n        const parent = node.getParent();\n        if (parent === null || $isCodeNode(parent)) return\n\n        $applyFormatFromLeadingTag(node, openTagStart, transformer);\n      });\n\n      break // Only apply the first (longest) matching transformer\n    }\n  })\n}\n\nfunction $applyFormatFromLeadingTag(anchorNode, openTagStart, transformer) {\n  const tag = transformer.tag;\n  const tagLen = tag.length;\n  const textContent = anchorNode.getTextContent();\n\n  const innerStart = openTagStart + tagLen;\n  const closeTagIndex = textContent.indexOf(tag, innerStart);\n  if (closeTagIndex < 0) return\n\n  const inner = textContent.slice(innerStart, closeTagIndex);\n  if (inner.length === 0) return\n\n  // Remove both tags and apply format\n  const before = textContent.slice(0, openTagStart);\n  const after = textContent.slice(closeTagIndex + tagLen);\n\n  anchorNode.setTextContent(before + inner + after);\n\n  const nextSelection = $createRangeSelection();\n  $setSelection(nextSelection);\n\n  // Select the inner text to apply formatting\n  nextSelection.anchor.set(anchorNode.getKey(), openTagStart, \"text\");\n  nextSelection.focus.set(anchorNode.getKey(), openTagStart + inner.length, \"text\");\n\n  for (const format of transformer.format) {\n    if (!nextSelection.hasFormat(format)) {\n      nextSelection.formatText(format);\n    }\n  }\n\n  // Collapse selection to end of formatted text and clear the format\n  // so subsequent typing is plain text\n  nextSelection.anchor.set(nextSelection.focus.key, nextSelection.focus.offset, nextSelection.focus.type);\n\n  for (const format of transformer.format) {\n    if (nextSelection.hasFormat(format)) {\n      nextSelection.toggleFormat(format);\n    }\n  }\n}\n\nvar theme = {\n  text: {\n    bold: \"lexxy-content__bold\",\n    italic: \"lexxy-content__italic\",\n    strikethrough: \"lexxy-content__strikethrough\",\n    underline: \"lexxy-content__underline\",\n    highlight: \"lexxy-content__highlight\"\n  },\n  tableCellHeader: \"lexxy-content__table-cell--header\",\n  tableCellSelected: \"lexxy-content__table-cell--selected\",\n  tableSelection: \"lexxy-content__table--selection\",\n  tableScrollableWrapper: \"lexxy-content__table-wrapper\",\n  tableCellHighlight: \"lexxy-content__table-cell--highlight\",\n  tableCellFocus: \"lexxy-content__table-cell--focus\",\n  list: {\n    nested: {\n      listitem: \"lexxy-nested-listitem\",\n    }\n  },\n  codeHighlight: {\n    addition: \"code-token__selector\",\n    atrule: \"code-token__attr\",\n    attr: \"code-token__attr\",\n    \"attr-name\": \"code-token__attr\",\n    \"attr-value\": \"code-token__selector\",\n    boolean: \"code-token__property\",\n    bold: \"code-token__variable\",\n    builtin: \"code-token__selector\",\n    cdata: \"code-token__comment\",\n    char: \"code-token__selector\",\n    class: \"code-token__function\",\n    \"class-name\": \"code-token__function\",\n    color: \"code-token__property\",\n    comment: \"code-token__comment\",\n    constant: \"code-token__property\",\n    coord: \"code-token__comment\",\n    decorator: \"code-token__function\",\n    deleted: \"code-token__operator\",\n    deletion: \"code-token__operator\",\n    directive: \"code-token__attr\",\n    \"directive-hash\": \"code-token__property\",\n    doctype: \"code-token__comment\",\n    entity: \"code-token__operator\",\n    function: \"code-token__function\",\n    hexcode: \"code-token__property\",\n    important: \"code-token__function\",\n    inserted: \"code-token__selector\",\n    italic: \"code-token__comment\",\n    keyword: \"code-token__attr\",\n    line: \"code-token__selector\",\n    namespace: \"code-token__variable\",\n    number: \"code-token__property\",\n    macro: \"code-token__function\",\n    operator: \"code-token__operator\",\n    parameter: \"code-token__variable\",\n    prolog: \"code-token__comment\",\n    property: \"code-token__property\",\n    punctuation: \"code-token__punctuation\",\n    \"raw-string\": \"code-token__operator\",\n    regex: \"code-token__variable\",\n    script: \"code-token__function\",\n    selector: \"code-token__selector\",\n    string: \"code-token__selector\",\n    style: \"code-token__function\",\n    symbol: \"code-token__property\",\n    tag: \"code-token__property\",\n    title: \"code-token__function\",\n    \"type-definition\": \"code-token__function\",\n    url: \"code-token__operator\",\n    variable: \"code-token__variable\",\n  }\n};\n\nclass ImageGalleryNode extends ElementNode {\n  $config() {\n    return this.config(\"image_gallery\", {\n      extends: ElementNode,\n    })\n  }\n\n  static transform() {\n    return (gallery) => {\n      gallery.unwrapEmptyNode()\n        || gallery.replaceWithSingularChild()\n        || gallery.splitAroundInvalidChild();\n    }\n  }\n\n  static importDOM() {\n    return {\n      div: (element) => {\n        if (!this.#isGalleryElement(element)) return null\n\n        return {\n          conversion: () => {\n            return {\n              node: $createImageGalleryNode()\n            }\n          },\n          priority: 2\n        }\n      }\n    }\n  }\n\n  static canCollapseWith(node) {\n    return $isImageGalleryNode(node) || this.isValidChild(node)\n  }\n\n  static isValidChild(node) {\n    return $isActionTextAttachmentNode(node) && node.isPreviewableImage\n  }\n\n  static #isGalleryElement(element) {\n    const attachmentChildren = element.querySelectorAll(`:scope > :is(${this.#attachmentTags.join()})`);\n    return element.textContent.trim() === \"\"\n      && attachmentChildren.length > 0\n      && element.children.length === attachmentChildren.length\n  }\n\n  static get #attachmentTags() {\n    return Object.keys(ActionTextAttachmentNode.importDOM())\n  }\n\n  createDOM() {\n    const div = document.createElement(\"div\");\n    div.className = this.#galleryClassNames;\n    return div\n  }\n\n  updateDOM(_prevNode, dom) {\n    dom.className = this.#galleryClassNames;\n    return false\n  }\n\n  canBeEmpty() {\n    // Return `true` to conform to `$isBlock(node)`\n    // We clean-up empty galleries with a transform\n    return true\n  }\n\n  collapseAtStart(_selection) {\n    return true\n  }\n\n  insertNewAfter(selection, restoreSelection) {\n    const selectionBeforeLastChild = selection.anchor.getNode().is(this) && selection.anchor.offset == this.getChildrenSize() - 1;\n    if (selectionBeforeLastChild) {\n      const paragraph = $createParagraphNode();\n      this.insertAfter(paragraph, false);\n      paragraph.insertAfter(this.getLastChild(), false);\n      paragraph.selectEnd();\n\n      // return null as selection has been managed\n      return null\n    }\n\n    const newNode = $createImageGalleryNode();\n    this.insertAfter(newNode, restoreSelection);\n    return newNode\n  }\n\n  getImageAttachments() {\n    const children = this.getChildren();\n    return children.filter($isActionTextAttachmentNode)\n  }\n\n  exportDOM() {\n    const div = document.createElement(\"div\");\n    div.className = this.#galleryClassNames;\n    return { element: div }\n  }\n\n  collapseWith(node, backwards) {\n    if (!ImageGalleryNode.canCollapseWith(node)) return false\n\n    if (backwards) {\n      $insertFirst(this, node);\n    } else {\n      this.append(node);\n    }\n\n    $unwrapAndFilterDescendants(this, ImageGalleryNode.isValidChild);\n\n    return true\n  }\n\n  unwrapEmptyNode() {\n    if (this.isEmpty()) {\n      const paragraph = $createParagraphNode();\n      return this.replace(paragraph)\n    }\n  }\n\n  replaceWithSingularChild() {\n    if (this.#hasSingularChild) {\n      const child = this.getFirstChild();\n      return this.replace($makeSafeForRoot(child))\n    }\n  }\n\n  splitAroundInvalidChild() {\n    for (const child of $firstToLastIterator(this)) {\n      if (ImageGalleryNode.isValidChild(child)) continue\n\n      const poppedNode = $makeSafeForRoot(child);\n      const [ topGallery, secondGallery ] = this.splitAtIndex(poppedNode.getIndexWithinParent());\n      topGallery.insertAfter(poppedNode);\n      poppedNode.selectEnd();\n\n      // remove an empty gallery rather than let it unwrap to a paragraph\n      if (secondGallery.isEmpty()) secondGallery.remove();\n\n      break\n    }\n  }\n\n  splitAtIndex(index) {\n    return $splitNode(this, index)\n  }\n\n  get #hasSingularChild() {\n    return this.getChildrenSize() === 1\n  }\n\n  get #galleryClassNames() {\n    return `attachment-gallery attachment-gallery--${this.getChildrenSize()}`\n  }\n}\n\nfunction $createImageGalleryNode() {\n  return new ImageGalleryNode()\n}\n\nfunction $isImageGalleryNode(node) {\n  return node instanceof ImageGalleryNode\n}\n\nfunction $findOrCreateGalleryForImage(node) {\n  if (!ImageGalleryNode.canCollapseWith(node)) return null\n\n  const existingGallery = $getNearestNodeOfType(node, ImageGalleryNode);\n  return existingGallery ?? $wrapNodeInElement(node, $createImageGalleryNode)\n}\n\nclass CaptionEditor {\n  #editorElement\n  #editor\n  #input = createElement(\"textarea\", { className: \"lexxy-caption-editor\", hidden: true, tabIndex: -1, rows: 1, placeholder: \"Add caption...\" })\n  #nodeKey\n  #caption\n  #listeners = new ListenerBin()\n  #resizeObserver = new ResizeObserver(() => this.#updatePosition())\n\n  constructor(editorElement) {\n    this.#editorElement = editorElement;\n    this.#editor = editorElement.editor;\n    editorElement.append(this.#input);\n    this.#listeners.track(\n      registerEventListener(this.#input, \"blur\", () => this.#save()),\n      registerEventListener(this.#input, \"keydown\", event => this.#handleKeydown(event)),\n      registerEventListener(this.#input, \"input\", () => this.#updatePosition()),\n      registerEventListener(editorElement, \"scroll\", () => this.#updatePosition(), { capture: true, passive: true }),\n      this.#editor.registerUpdateListener(() => this.#checkAttachment())\n    );\n  }\n\n  dispose() {\n    this.#listeners.dispose();\n    this.#close();\n    this.#input.remove();\n  }\n\n  open(nodeKey) {\n    const caption = this.#editor.getElementByKey(nodeKey)?.querySelector(\"figcaption.attachment__caption--editable\");\n    if (caption) {\n      if (this.#nodeKey !== nodeKey) {\n        this.#edit(nodeKey, caption);\n      }\n      return true\n    } else {\n      return false\n    }\n  }\n\n  #save() {\n    if (this.#nodeKey) {\n      const key = this.#nodeKey;\n      const value = this.#input.value;\n      this.#close();\n      this.#editor.update(() => {\n        const node = $getNodeByKey(key);\n        if (node && node.caption !== value) node.getWritable().caption = value;\n      }, { tag: SKIP_DOM_SELECTION_TAG, discrete: true });\n    }\n  }\n\n  #close() {\n    this.#nodeKey = null;\n    this.#resizeObserver.disconnect();\n    if (this.#caption) {\n      this.#caption.classList.remove(\"attachment__caption--editing\");\n      this.#caption.style.removeProperty(\"min-height\");\n      this.#caption = null;\n    }\n    this.#input.hidden = true;\n  }\n\n  #handleKeydown(event) {\n    if (!event.isComposing && [ \"Enter\", \"Escape\" ].includes(event.key)) {\n      event.preventDefault();\n      const key = this.#nodeKey;\n      this.#input.blur();\n      this.#editor.getRootElement()?.focus({ preventScroll: true });\n      this.#editor.update(() => {\n        const node = $getNodeByKey(key);\n        if (node) {\n          if (event.key === \"Enter\") {\n            if ($isImageGalleryNode(node.getParent()) && !node.getNextSibling()) {\n              node.getParent().selectNext(0, 0);\n            } else {\n              node.selectNext(0, 0);\n            }\n          } else {\n            $setSelection($createNodeSelectionWith(node));\n          }\n        }\n      }, { tag: HISTORY_MERGE_TAG });\n    }\n    event.stopPropagation();\n  }\n\n  #updatePosition() {\n    if (this.#caption?.isConnected) {\n      const rect = this.#caption.getBoundingClientRect();\n      const editorRect = this.#editorElement.getBoundingClientRect();\n      this.#input.style.left = `${rect.left - editorRect.left - this.#editorElement.clientLeft + this.#editorElement.scrollLeft}px`;\n      this.#input.style.top = `${rect.top - editorRect.top - this.#editorElement.clientTop + this.#editorElement.scrollTop}px`;\n      this.#input.style.width = `${rect.width}px`;\n      this.#input.style.height = \"0px\";\n      const height = this.#input.scrollHeight;\n      this.#input.style.height = `${height}px`;\n      this.#caption.style.minHeight = `${height}px`;\n    }\n  }\n\n  #checkAttachment() {\n    if (this.#nodeKey && this.#editor.getElementByKey(this.#nodeKey)?.querySelector(\"figcaption\") !== this.#caption) {\n      this.#close();\n    } else {\n      this.#updatePosition();\n    }\n  }\n\n  #edit(nodeKey, caption) {\n    this.#save();\n    this.#nodeKey = nodeKey;\n    this.#caption = caption;\n    this.#editor.getEditorState().read(() => {\n      const node = $getNodeByKey(nodeKey);\n      this.#input.value = node.caption;\n      if (node.isVideo) {\n        this.#input.ariaLabel = \"Video caption\";\n      } else {\n        this.#input.ariaLabel = \"Image caption\";\n      }\n    });\n\n    caption.scrollIntoView({ block: \"nearest\", inline: \"nearest\" });\n    const style = getComputedStyle(caption);\n    this.#input.style.font = style.font;\n    this.#input.style.padding = style.padding;\n    this.#input.style.color = style.color;\n    this.#input.style.textAlign = getComputedStyle(caption.firstElementChild).textAlign;\n    this.#input.hidden = false;\n    caption.classList.add(\"attachment__caption--editing\");\n    this.#resizeObserver.observe(caption);\n    this.#resizeObserver.observe(this.#editorElement);\n    this.#updatePosition();\n    this.#input.focus({ preventScroll: true });\n  }\n}\n\nclass UploadRequests {\n  #requestsByKey = new Map()\n\n  track(key, request) {\n    this.#requestsByKey.set(key, request);\n  }\n\n  forget(key) {\n    this.#requestsByKey.delete(key);\n  }\n\n  abort(key) {\n    const request = this.#requestsByKey.get(key);\n    if (request) {\n      this.#requestsByKey.delete(key);\n      request.abort();\n    }\n  }\n\n  clear() {\n    this.#requestsByKey.clear();\n  }\n}\n\n// Partition a stretch of text into consecutive { start, end, range } segments,\n// where offsets are relative to the text and range is the covering source\n// range \u2014 expressed in outer coordinates as { start, end, ... } \u2014 or null for\n// the stretches no range covers. Ranges must be sorted and non-overlapping.\nfunction segmentTextByRanges(text, textStart, ranges) {\n  const segments = [];\n  let cursor = 0;\n\n  for (const range of ranges) {\n    const from = Math.max(range.start - textStart, cursor);\n    const to = Math.min(range.end - textStart, text.length);\n\n    if (from < to) {\n      if (from > cursor) {\n        segments.push({ start: cursor, end: from, range: null });\n      }\n      segments.push({ start: from, end: to, range });\n      cursor = to;\n    }\n  }\n\n  if (cursor < text.length) {\n    segments.push({ start: cursor, end: text.length, range: null });\n  }\n\n  return segments\n}\n\nconst TOGGLE_HIGHLIGHT_COMMAND = createCommand();\nconst REMOVE_HIGHLIGHT_COMMAND = createCommand();\nconst BLANK_STYLES = { \"color\": null, \"background-color\": null };\n\nconst hasPastedStylesState = createState(\"hasPastedStyles\", {\n  parse: (value) => value || false\n});\n\n// Stores pending highlight ranges extracted during HTML import, keyed by CodeNode key.\n// The highlight-preserving tokenizer consumes this map when the code retokenizer\n// first tokenizes the block. Scoped per editor instance so entries don't leak\n// across editors or outlive a torn-down editor.\nconst pendingCodeHighlights = new WeakMap();\n\nclass HighlightExtension extends LexxyExtension {\n  get enabled() {\n    return this.editorElement.supportsRichText\n  }\n\n  get lexicalExtension() {\n    const extension = defineExtension({\n      dependencies: [ RichTextExtension ],\n      name: \"lexxy/highlight\",\n      config: {\n        color: { buttons: [], permit: [] },\n        \"background-color\": { buttons: [], permit: [] }\n      },\n      html: {\n        import: {\n          mark: $markConversion\n        }\n      },\n      register(editor, config) {\n        // keep the ref to the canonicalizers for optimized css conversion\n        const canonicalizers = buildCanonicalizers(config);\n\n        // Register the <pre> converter directly in the conversion cache so it\n        // coexists with other extensions' \"pre\" converters (the extension-level\n        // html.import uses Object.assign, which means only one \"pre\" per key).\n        $registerPreConversion(editor);\n\n        return mergeRegister(\n          editor.registerCommand(TOGGLE_HIGHLIGHT_COMMAND, (styles) => $toggleSelectionStyles(editor, styles), COMMAND_PRIORITY_NORMAL),\n          editor.registerCommand(REMOVE_HIGHLIGHT_COMMAND, () => $toggleSelectionStyles(editor, BLANK_STYLES), COMMAND_PRIORITY_NORMAL),\n          editor.registerNodeTransform(TextNode, $syncHighlightWithStyle),\n          editor.registerNodeTransform(CodeHighlightNode, $syncHighlightWithCodeHighlightNode),\n          editor.registerNodeTransform(TextNode, (textNode) => $canonicalizePastedStyles(textNode, canonicalizers))\n        )\n      }\n    });\n\n    return [ extension, this.editorConfig.get(\"highlight\") ]\n  }\n}\n\nfunction $applyHighlightStyle(textNode, element) {\n  const elementStyles = {\n    color: element.style?.color,\n    \"background-color\": element.style?.backgroundColor\n  };\n\n  if ($hasUpdateTag(PASTE_TAG)) { $setPastedStyles(textNode); }\n  const highlightStyle = getCSSFromStyleObject(elementStyles);\n\n  if (highlightStyle.length) {\n    return textNode.setStyle(textNode.getStyle() + highlightStyle)\n  }\n}\n\nfunction $markConversion() {\n  return {\n    conversion: extendTextNodeConversion(\"mark\", $applyHighlightStyle),\n    priority: 1\n  }\n}\n\n// Register a custom <pre> converter directly in the editor's HTML conversion\n// cache. We can't use the extension-level html.import because Object.assign\n// merges all extensions' converters by tag, and a later extension (e.g.\n// TrixContentExtension) would overwrite ours.\nfunction $registerPreConversion(editor) {\n  if (!editor._htmlConversions) return\n\n  let preEntries = editor._htmlConversions.get(\"pre\");\n  if (!preEntries) {\n    preEntries = [];\n    editor._htmlConversions.set(\"pre\", preEntries);\n  }\n  preEntries.push($preConversionWithHighlightsFactory(editor));\n}\n\n// Returns a <pre> converter factory scoped to a specific editor instance.\n// The factory extracts highlight ranges from <mark> elements before the code\n// retokenizer can destroy them. The ranges are stored in pendingCodeHighlights\n// and restored by the highlight-preserving tokenizer during retokenization.\nfunction $preConversionWithHighlightsFactory(editor) {\n  return function $preConversionWithHighlights(domNode) {\n    const highlights = extractHighlightRanges(domNode);\n    if (highlights.length === 0) return null\n\n    return {\n      conversion: (domNode) => {\n        const language = domNode.getAttribute(\"data-language\");\n        const codeNode = $createCodeNode(language);\n        $getPendingHighlights(editor).set(codeNode.getKey(), highlights);\n        return { node: codeNode }\n      },\n      priority: 2\n    }\n  }\n}\n\n// Walk the DOM tree inside a <pre> element and build a list of\n// { start, end, style } ranges for every <mark> element found.\nfunction extractHighlightRanges(preElement) {\n  const ranges = [];\n  const codeElement = preElement.querySelector(\"code\") || preElement;\n\n  let offset = 0;\n\n  function walk(node) {\n    if (node.nodeType === Node.TEXT_NODE) {\n      offset += node.textContent.length;\n    } else if (node.nodeType === Node.ELEMENT_NODE) {\n      // <br> maps to a LineBreakNode (1 character) in Lexical\n      if (node.tagName === \"BR\") {\n        offset += 1;\n        return\n      }\n\n      const isMark = node.tagName === \"MARK\";\n      const start = offset;\n\n      for (const child of node.childNodes) {\n        walk(child);\n      }\n\n      if (isMark) {\n        const style = extractHighlightStyleFromElement(node);\n        if (style) {\n          ranges.push({ start, end: offset, style });\n        }\n      }\n    }\n  }\n\n  for (const child of codeElement.childNodes) {\n    walk(child);\n  }\n\n  return ranges\n}\n\nfunction $getPendingHighlights(editor) {\n  let map = pendingCodeHighlights.get(editor);\n  if (!map) {\n    map = new Map();\n    pendingCodeHighlights.set(editor, map);\n  }\n  return map\n}\n\nfunction extractHighlightStyleFromElement(element) {\n  const styles = {};\n  if (element.style?.color) styles.color = element.style.color;\n  if (element.style?.backgroundColor) styles[\"background-color\"] = element.style.backgroundColor;\n  const css = getCSSFromStyleObject(styles);\n  return css.length > 0 ? css : null\n}\n\n// Recover the highlight ranges to reapply after a retokenization: the ranges\n// staged during HTML import, or the ones read from the children the fresh\n// tokens are about to replace.\nfunction $takeHighlightRanges(editor, codeNode) {\n  const pending = $getPendingHighlights(editor);\n  const key = codeNode.getKey();\n\n  if (pending.has(key)) {\n    const highlights = pending.get(key);\n    pending.delete(key);\n    return highlights\n  } else if (codeNode.getChildren().some($isCodeHighlightNode)) {\n    return $extractHighlightRangesFromCodeNode(codeNode)\n  } else {\n    // A block that was never tokenized has only plain text children. Styles\n    // on those come from import paths that didn't stage ranges (e.g. colored\n    // spans in Trix HTML), and the first tokenization discards them.\n    return []\n  }\n}\n\nfunction $applyHighlightRangesToTokens(tokens, highlights) {\n  if (highlights.length === 0) return tokens\n\n  const styledTokens = [];\n  let offset = 0;\n\n  for (const token of tokens) {\n    if ($isCodeHighlightNode(token)) {\n      styledTokens.push(...$splitTokenAtHighlightBoundaries(token, offset, highlights));\n    } else {\n      styledTokens.push(token);\n    }\n    offset += token.getTextContentSize();\n  }\n\n  return styledTokens\n}\n\n// Split a token into segments at highlight boundaries, styling the covered\n// segments. We can't use TextNode.splitText() because the fresh tokens aren't\n// attached to the tree yet, so we create CodeHighlightNode replacements.\nfunction $splitTokenAtHighlightBoundaries(token, tokenStart, highlights) {\n  const text = token.getTextContent();\n  const segments = segmentTextByRanges(text, tokenStart, highlights);\n\n  if (segments.length === 1) {\n    const [ segment ] = segments;\n    if (segment.range) {\n      $applyHighlightStyleToToken(token, segment.range.style);\n    }\n    return [ token ]\n  } else {\n    return segments.map((segment) => {\n      const segmentToken = $createCodeHighlightNode(text.slice(segment.start, segment.end), token.getHighlightType());\n      if (segment.range) {\n        $applyHighlightStyleToToken(segmentToken, segment.range.style);\n      }\n      return segmentToken\n    })\n  }\n}\n\nfunction $applyHighlightStyleToToken(token, style) {\n  token.setStyle(style);\n  $setCodeHighlightFormat(token, true);\n}\n\nfunction $buildChildRanges(codeNode) {\n  const childRanges = [];\n  let charOffset = 0;\n\n  function walk(node) {\n    for (const child of node.getChildren()) {\n      if ($isElementNode(child)) {\n        // e.g. a LinkNode awaiting its first retokenization\n        walk(child);\n      } else if ($isCodeHighlightNode(child) || $isTextNode(child)) {\n        const text = child.getTextContent();\n        childRanges.push({ node: child, start: charOffset, end: charOffset + text.length });\n        charOffset += text.length;\n      } else {\n        // LineBreakNode - counts as 1 character (\\n)\n        charOffset += 1;\n      }\n    }\n  }\n\n  walk(codeNode);\n\n  return childRanges\n}\n\n// Extract highlight ranges from the Lexical node tree of a CodeNode.\n// This mirrors extractHighlightRanges (which works on DOM elements during\n// HTML import) but reads from live CodeHighlightNode children instead.\nfunction $extractHighlightRangesFromCodeNode(codeNode) {\n  const ranges = [];\n  const childRanges = $buildChildRanges(codeNode);\n\n  for (const { node, start, end } of childRanges) {\n    const style = node.getStyle();\n    if (style && hasHighlightStyles(style)) {\n      ranges.push({ start, end, style });\n    }\n  }\n\n  return ranges\n}\n\nfunction buildCanonicalizers(config) {\n  return [\n    new StyleCanonicalizer(\"color\", [ ...colorValues(config.buttons.color), ...config.permit.color ]),\n    new StyleCanonicalizer(\"background-color\", [ ...colorValues(config.buttons[\"background-color\"]), ...config.permit[\"background-color\"] ])\n  ]\n}\n\nfunction colorValues(buttons) {\n  return normalizeColorButtons(buttons).map((button) => button.value)\n}\n\nfunction $toggleSelectionStyles(editor, styles) {\n  const selection = $getSelection();\n  if (!$isRangeSelection(selection)) return\n\n  const patch = {};\n  for (const property in styles) {\n    const oldValue = $getSelectionStyleValueForProperty(selection, property);\n    patch[property] = toggleOrReplace(oldValue, styles[property]);\n  }\n\n  if ($selectionIsInCodeBlock(selection)) {\n    $patchCodeHighlightStyles(editor, selection, patch);\n  } else {\n    $patchStyleText(selection, patch);\n  }\n}\n\nfunction $selectionIsInCodeBlock(selection) {\n  const nodes = selection.getNodes();\n  return nodes.some((node) => {\n    // A text node inside a code block may be either a CodeHighlightNode\n    // (after retokenization) or a plain TextNode (after splitText or before\n    // the retokenizer has run). Check the parent in both cases.\n    if ($isCodeHighlightNode(node) || $isTextNode(node)) {\n      return $isCodeNode(node.getParent())\n    }\n    return $isCodeNode(node)\n  })\n}\n\nfunction $patchCodeHighlightStyles(editor, selection, patch) {\n  // Capture selection state and node keys before the nested update.\n  // Accept both CodeHighlightNode and TextNode children of a CodeNode\n  // because splitText creates TextNode instances and the retokenizer\n  // may not have converted them back to CodeHighlightNodes yet.\n  const nodeKeys = selection.getNodes()\n    .filter((node) => ($isCodeHighlightNode(node) || $isTextNode(node)) && $isCodeNode(node.getParent()))\n    .map((node) => ({\n      key: node.getKey(),\n      startOffset: $getNodeSelectionOffsets(node, selection)[0],\n      endOffset: $getNodeSelectionOffsets(node, selection)[1],\n      textSize: node.getTextContentSize()\n    }));\n\n  // Use skipTransforms so the retokenizer doesn't rebuild the block in the\n  // middle of the toggle, and discrete to force a synchronous commit so the\n  // styles are in place before editor.focus() triggers a second update cycle.\n  editor.update(() => {\n    for (const { key, startOffset, endOffset, textSize } of nodeKeys) {\n      const node = $getNodeByKey(key);\n      if (!node) continue\n\n      const parent = node.getParent();\n      if (!$isCodeNode(parent)) continue\n      if (startOffset === endOffset) continue\n\n      if (startOffset === 0 && endOffset === textSize) {\n        $applyStylePatchToNode(node, patch);\n      } else {\n        const splitNodes = node.splitText(startOffset, endOffset);\n        const targetNode = splitNodes[startOffset === 0 ? 0 : 1];\n        $applyStylePatchToNode(targetNode, patch);\n      }\n    }\n  }, { skipTransforms: true, discrete: true });\n}\n\nfunction $getNodeSelectionOffsets(node, selection) {\n  const nodeKey = node.getKey();\n  const anchorKey = selection.anchor.key;\n  const focusKey = selection.focus.key;\n  const textSize = node.getTextContentSize();\n\n  const isAnchor = nodeKey === anchorKey;\n  const isFocus = nodeKey === focusKey;\n\n  // Determine if selection is forward or backward\n  const isForward = selection.isBackward() === false;\n\n  let start = 0;\n  let end = textSize;\n\n  if (isForward) {\n    if (isAnchor) start = selection.anchor.offset;\n    if (isFocus) end = selection.focus.offset;\n  } else {\n    if (isFocus) start = selection.focus.offset;\n    if (isAnchor) end = selection.anchor.offset;\n  }\n\n  return [ start, end ]\n}\n\nfunction $applyStylePatchToNode(node, patch) {\n  const prevStyles = getStyleObjectFromCSS(node.getStyle());\n  const newStyles = { ...prevStyles };\n\n  for (const [ key, value ] of Object.entries(patch)) {\n    if (value === null) {\n      delete newStyles[key];\n    } else {\n      newStyles[key] = value;\n    }\n  }\n\n  const newCSSText = getCSSFromStyleObject(newStyles);\n  node.setStyle(newCSSText);\n\n  // Sync the highlight format using TextNode's setFormat to bypass\n  // CodeHighlightNode's no-op override\n  const shouldHaveHighlight = hasHighlightStyles(newCSSText);\n  const hasHighlight = node.hasFormat(\"highlight\");\n\n  if (shouldHaveHighlight !== hasHighlight) {\n    $setCodeHighlightFormat(node, shouldHaveHighlight);\n  }\n}\n\nfunction $setCodeHighlightFormat(node, shouldHaveHighlight) {\n  const writable = node.getWritable();\n  const IS_HIGHLIGHT = 1 << 7;\n\n  if (shouldHaveHighlight) {\n    writable.__format |= IS_HIGHLIGHT;\n  } else {\n    writable.__format &= ~IS_HIGHLIGHT;\n  }\n}\n\nfunction toggleOrReplace(oldValue, newValue) {\n  return oldValue === newValue ? null : newValue\n}\n\nfunction $syncHighlightWithStyle(textNode) {\n  if (hasHighlightStyles(textNode.getStyle()) !== textNode.hasFormat(\"highlight\")) {\n    textNode.toggleFormat(\"highlight\");\n  }\n}\n\nfunction $syncHighlightWithCodeHighlightNode(node) {\n  const parent = node.getParent();\n  if (!$isCodeNode(parent)) return\n\n  const shouldHaveHighlight = hasHighlightStyles(node.getStyle());\n  const hasHighlight = node.hasFormat(\"highlight\");\n\n  if (shouldHaveHighlight !== hasHighlight) {\n    $setCodeHighlightFormat(node, shouldHaveHighlight);\n  }\n}\n\nfunction $canonicalizePastedStyles(textNode, canonicalizers = []) {\n  if ($hasPastedStyles(textNode)) {\n    $setPastedStyles(textNode, false);\n\n    const canonicalizedCSS = applyCanonicalizers(textNode.getStyle(), canonicalizers);\n    textNode.setStyle(canonicalizedCSS);\n\n    const selection = $getSelection();\n    if (textNode.isSelected(selection)) {\n      selection.setStyle(textNode.getStyle());\n      selection.setFormat(textNode.getFormat());\n    }\n  }\n}\n\nfunction $setPastedStyles(textNode, value = true) {\n  $setState(textNode, hasPastedStylesState, value);\n}\n\nfunction $hasPastedStyles(textNode) {\n  return $getState(textNode, hasPastedStylesState)\n}\n\nconst COMMANDS = [\n  \"bold\",\n  \"italic\",\n  \"strikethrough\",\n  \"underline\",\n  \"link\",\n  \"unlink\",\n  \"toggleHighlight\",\n  \"removeHighlight\",\n  \"setFormatHeadingLarge\",\n  \"setFormatHeadingMedium\",\n  \"setFormatHeadingSmall\",\n  \"setFormatParagraph\",\n  \"applyHeadingFormat\",\n  \"clearFormatting\",\n  \"insertUnorderedList\",\n  \"insertOrderedList\",\n  \"insertQuoteBlock\",\n  \"insertCodeBlock\",\n  \"setCodeLanguage\",\n  \"insertHorizontalDivider\",\n  \"uploadImage\",\n  \"uploadFile\",\n\n  \"insertTable\",\n\n  \"undo\",\n  \"redo\"\n];\n\nclass CommandDispatcher {\n  #selectionBeforeDrag = null\n  #listeners = new ListenerBin()\n\n  static configureFor(editorElement) {\n    return new CommandDispatcher(editorElement)\n  }\n\n  constructor(editorElement) {\n    this.editorElement = editorElement;\n    this.editor = editorElement.editor;\n    this.selection = editorElement.selection;\n    this.contents = editorElement.contents;\n\n    this.#registerCommands();\n    this.#registerKeyboardCommands();\n    this.#registerDragAndDropHandlers();\n  }\n\n  dispatchBold() {\n    this.editor.dispatchCommand(FORMAT_TEXT_COMMAND, \"bold\");\n  }\n\n  dispatchItalic() {\n    this.editor.dispatchCommand(FORMAT_TEXT_COMMAND, \"italic\");\n  }\n\n  dispatchStrikethrough() {\n    this.editor.dispatchCommand(FORMAT_TEXT_COMMAND, \"strikethrough\");\n  }\n\n  dispatchUnderline() {\n    this.editor.dispatchCommand(FORMAT_TEXT_COMMAND, \"underline\");\n  }\n\n  dispatchToggleHighlight(styles) {\n    this.editor.dispatchCommand(TOGGLE_HIGHLIGHT_COMMAND, styles);\n  }\n\n  dispatchRemoveHighlight() {\n    this.editor.dispatchCommand(REMOVE_HIGHLIGHT_COMMAND);\n  }\n\n  dispatchLink(url) {\n    this.editor.update(() => {\n      const selection = $getSelection();\n      if (!$isRangeSelection(selection)) return\n\n      const anchorNode = selection.anchor.getNode();\n\n      if (selection.isCollapsed() && !$getNearestNodeOfType(anchorNode, LinkNode)) {\n        const autoLinkNode = $createAutoLinkNode(url);\n        const textNode = $createTextNode(url);\n        autoLinkNode.append(textNode);\n        selection.insertNodes([ autoLinkNode ]);\n      } else {\n        $toggleLink(url);\n      }\n    });\n  }\n\n  dispatchUnlink() {\n    this.editor.update(() => {\n      // Let adapters signal whether unlink should target a frozen link key.\n      if (this.editorElement.adapter.unlinkFrozenNode?.()) {\n        return\n      }\n\n      $toggleLink(null);\n    });\n  }\n\n  dispatchInsertUnorderedList() {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) return\n\n    const anchorNode = selection.anchor.getNode();\n\n    if (this.selection.isInsideList && anchorNode && getListType(anchorNode) === \"bullet\") {\n      this.contents.applyParagraphFormat();\n    } else {\n      this.contents.applyUnorderedListFormat();\n    }\n  }\n\n  dispatchInsertOrderedList() {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) return\n\n    const anchorNode = selection.anchor.getNode();\n\n    if (this.selection.isInsideList && anchorNode && getListType(anchorNode) === \"number\") {\n      this.contents.applyParagraphFormat();\n    } else {\n      this.contents.applyOrderedListFormat();\n    }\n  }\n\n  dispatchInsertQuoteBlock() {\n    this.contents.toggleBlockquote();\n  }\n\n  dispatchInsertCodeBlock() {\n    if (this.selection.hasSelectedWordsInSingleLine) {\n      this.#toggleInlineCode();\n    } else {\n      this.contents.toggleCodeBlock();\n    }\n  }\n\n  #toggleInlineCode() {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) return\n\n    if (!selection.isCollapsed()) {\n      const textNodes = selection.getNodes().filter($isTextNode);\n      const applyingCode = !textNodes.every((node) => node.hasFormat(\"code\"));\n\n      if (applyingCode) {\n        this.#stripInlineFormattingFromSelection(selection, textNodes);\n      }\n    }\n\n    this.editor.dispatchCommand(FORMAT_TEXT_COMMAND, \"code\");\n  }\n\n  // Strip all inline formatting (bold, italic, etc.) from the selected text\n  // nodes so that applying code produces a single merged <code> element instead\n  // of one per differently-formatted span.\n  #stripInlineFormattingFromSelection(selection, textNodes) {\n    const isBackward = selection.isBackward();\n    const startPoint = isBackward ? selection.focus : selection.anchor;\n    const endPoint = isBackward ? selection.anchor : selection.focus;\n\n    for (let i = 0; i < textNodes.length; i++) {\n      const node = textNodes[i];\n      if (node.getFormat() === 0) continue\n\n      const isFirst = i === 0;\n      const isLast = i === textNodes.length - 1;\n      const startOffset = isFirst && startPoint.type === \"text\" ? startPoint.offset : 0;\n      const endOffset = isLast && endPoint.type === \"text\" ? endPoint.offset : node.getTextContentSize();\n\n      if (startOffset === 0 && endOffset === node.getTextContentSize()) {\n        node.setFormat(0);\n      } else {\n        const splits = node.splitText(startOffset, endOffset);\n        const target = startOffset === 0 ? splits[0] : splits[1];\n        target.setFormat(0);\n\n        if (isFirst && startPoint.type === \"text\") {\n          startPoint.set(target.getKey(), 0, \"text\");\n        }\n        if (isLast && endPoint.type === \"text\") {\n          endPoint.set(target.getKey(), endOffset - startOffset, \"text\");\n        }\n      }\n    }\n  }\n\n  dispatchSetCodeLanguage(language) {\n    this.editor.update(() => {\n      if (!this.selection.isInsideCodeBlock) return\n\n      const codeNode = this.selection.nearestNodeOfType(CodeNode);\n      if (!codeNode) return\n\n      codeNode.setLanguage(language);\n    });\n  }\n\n  dispatchInsertHorizontalDivider() {\n    $insertNodeToNearestRoot(new HorizontalDividerNode);\n  }\n\n  dispatchSetFormatHeadingLarge() {\n    this.#applyConfiguredHeadingFormat(0);\n  }\n\n  dispatchSetFormatHeadingMedium() {\n    this.#applyConfiguredHeadingFormat(1);\n  }\n\n  dispatchSetFormatHeadingSmall() {\n    this.#applyConfiguredHeadingFormat(2);\n  }\n\n  dispatchSetFormatParagraph() {\n    this.contents.applyParagraphFormat();\n  }\n\n  dispatchApplyHeadingFormat(tag) {\n    this.contents.applyHeadingFormat(tag);\n  }\n\n  dispatchClearFormatting() {\n    this.contents.clearFormatting();\n  }\n\n  dispatchUploadImage() {\n    this.#dispatchUploadAttachment(\"image/*,video/*\");\n  }\n\n  dispatchUploadFile() {\n    this.#dispatchUploadAttachment();\n  }\n\n  #dispatchUploadAttachment(accept = null) {\n    const attributes = {\n      type: \"file\",\n      multiple: true,\n      style: \"display: none;\",\n      onchange: ({ target: { files } }) => {\n        this.contents.uploadFiles(files, { selectLast: true });\n      }\n    };\n\n    if (accept) attributes.accept = accept;\n\n    const input = createElement(\"input\", attributes);\n\n    // Append and remove to make testable\n    this.editorElement.appendChild(input);\n    input.click();\n    setTimeout(() => input.remove(), 1000);\n  }\n\n  dispatchInsertTable() {\n    this.editor.dispatchCommand(INSERT_TABLE_COMMAND, { \"rows\": 3, \"columns\": 3, \"includeHeaders\": true });\n  }\n\n  dispatchUndo() {\n    this.editor.dispatchCommand(UNDO_COMMAND, undefined);\n  }\n\n  dispatchRedo() {\n    this.editor.dispatchCommand(REDO_COMMAND, undefined);\n  }\n\n  dispose() {\n    this.#listeners.dispose();\n  }\n\n  #applyConfiguredHeadingFormat(index) {\n    const tag = this.editorElement.config.get(\"headings\")[index];\n    if (tag) this.contents.applyHeadingFormat(tag);\n  }\n\n  #registerCommands() {\n    for (const command of COMMANDS) {\n      const methodName = `dispatch${capitalize(command)}`;\n      this.#registerCommandHandler(command, 0, this[methodName].bind(this));\n    }\n  }\n\n  #registerCommandHandler(command, priority, handler) {\n    this.#listeners.track(this.editor.registerCommand(command, handler, priority));\n  }\n\n  #registerKeyboardCommands() {\n    this.#registerCommandHandler(KEY_ARROW_RIGHT_COMMAND, COMMAND_PRIORITY_NORMAL, this.#handleArrowRightKey.bind(this));\n    this.#registerCommandHandler(KEY_TAB_COMMAND, COMMAND_PRIORITY_NORMAL, this.#handleTabKey.bind(this));\n\n    // Run before Lexical's built-in insert handlers to descend an element point on a\n    // block container to a leaf, avoiding error #211 on Enter / Shift+Enter in a quote.\n    this.#registerCommandHandler(INSERT_LINE_BREAK_COMMAND, COMMAND_PRIORITY_HIGH, this.#normalizeBlockContainerSelection.bind(this));\n    this.#registerCommandHandler(INSERT_PARAGRAPH_COMMAND, COMMAND_PRIORITY_HIGH, this.#normalizeBlockContainerSelection.bind(this));\n  }\n\n  #normalizeBlockContainerSelection() {\n    $normalizeBlockContainerSelection();\n    return false\n  }\n\n  #handleArrowRightKey(event) {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection) || !selection.isCollapsed()) return false\n    if (this.selection.isInsideCodeBlock || !selection.hasFormat(\"code\")) return false\n\n    const anchorNode = selection.anchor.getNode();\n    if (!$isTextNode(anchorNode) || selection.anchor.offset !== anchorNode.getTextContentSize()) return false\n    if (anchorNode.getNextSibling() !== null) return false\n\n    event.preventDefault();\n    selection.toggleFormat(\"code\");\n    return true\n  }\n\n  #registerDragAndDropHandlers() {\n    if (this.editorElement.supportsAttachments) {\n      this.dragCounter = 0;\n      this.#listeners.track(\n        this.editor.registerRootListener((rootElement) => {\n          if (rootElement) {\n            const teardowns = [\n              registerEventListener(rootElement, \"dragover\", this.#handleDragOver.bind(this)),\n              registerEventListener(rootElement, \"drop\", this.#handleDrop.bind(this)),\n              registerEventListener(rootElement, \"dragenter\", this.#handleDragEnter.bind(this)),\n              registerEventListener(rootElement, \"dragleave\", this.#handleDragLeave.bind(this))\n            ];\n            return () => teardowns.forEach((teardown) => teardown())\n          }\n        })\n      );\n    }\n  }\n\n  #handleDragEnter(event) {\n    if (this.#isInternalDrag(event)) return\n\n    this.dragCounter++;\n    if (this.dragCounter === 1) {\n      this.#saveSelectionBeforeDrag();\n      this.editor.getRootElement().classList.add(\"lexxy-editor--drag-over\");\n    }\n  }\n\n  #handleDragLeave(event) {\n    if (this.#isInternalDrag(event)) return\n\n    this.dragCounter--;\n    if (this.dragCounter === 0) {\n      this.#selectionBeforeDrag = null;\n      this.editor.getRootElement().classList.remove(\"lexxy-editor--drag-over\");\n    }\n  }\n\n  #handleDragOver(event) {\n    if (this.#isInternalDrag(event)) return\n\n    event.preventDefault();\n  }\n\n  #handleDrop(event) {\n    if (this.#isInternalDrag(event)) return\n\n    event.preventDefault();\n\n    this.dragCounter = 0;\n    this.editor.getRootElement().classList.remove(\"lexxy-editor--drag-over\");\n\n    const dataTransfer = event.dataTransfer;\n    if (!dataTransfer) return\n\n    const files = Array.from(dataTransfer.files);\n    if (!files.length) return\n\n    this.#restoreSelectionBeforeDrag();\n    this.contents.uploadFiles(files, { selectLast: true });\n\n    this.editor.focus();\n  }\n\n  #saveSelectionBeforeDrag() {\n    this.editor.getEditorState().read(() => {\n      this.#selectionBeforeDrag = $getSelection()?.clone();\n    });\n  }\n\n  #restoreSelectionBeforeDrag() {\n    if (!this.#selectionBeforeDrag) return\n\n    this.editor.update(() => {\n      $setSelection(this.#selectionBeforeDrag);\n    });\n\n    this.#selectionBeforeDrag = null;\n  }\n\n  #isInternalDrag(event) {\n    return event.dataTransfer?.types.some((type) => type.startsWith(\"application/x-lexxy-\"))\n  }\n\n  #handleTabKey(event) {\n    if (this.selection.isInsideList) {\n      return this.#handleTabForList(event)\n    } else if (this.selection.isInsideCodeBlock) {\n      return this.#handleTabForCode()\n    }\n    return false\n  }\n\n  #handleTabForList(event) {\n    if (event.shiftKey && !this.selection.isIndentedList) return false\n\n    event.preventDefault();\n    const command = event.shiftKey? OUTDENT_CONTENT_COMMAND : INDENT_CONTENT_COMMAND;\n    return this.editor.dispatchCommand(command)\n  }\n\n  #handleTabForCode() {\n    const selection = $getSelection();\n    return $isRangeSelection(selection) && selection.isCollapsed()\n  }\n\n}\n\nfunction capitalize(str) {\n  return str.charAt(0).toUpperCase() + str.slice(1)\n}\n\nclass Selection {\n  #listeners = new ListenerBin()\n\n  constructor(editorElement) {\n    this.editorElement = editorElement;\n    this.editorContentElement = editorElement.editorContentElement;\n    this.editor = this.editorElement.editor;\n    this.previouslySelectedKeys = new Set();\n\n    this.#listenForNodeSelections();\n    this.#processSelectionChangeCommands();\n    this.#containEditorFocus();\n    this.#clearStaleInlineCodeFormat();\n  }\n\n  get hasNodeSelection() {\n    return this.editor.getEditorState().read(() => {\n      const selection = $getSelection();\n      return selection !== null && $isNodeSelection(selection)\n    })\n  }\n\n  get cursorPosition() {\n    let position = null;\n\n    this.editor.getEditorState().read(() => {\n      const range = this.#getValidSelectionRange();\n      if (!range) return\n\n      const rect = this.#getReliableRectFromRange(range);\n      if (this.#isRectUnreliable(rect)) return\n\n      position = this.#calculateCursorPosition(rect, range);\n    });\n\n    return position\n  }\n\n  placeCursorAtTheEnd() {\n    this.editor.update(() => {\n      const root = $getRoot();\n      const lastDescendant = root.getLastDescendant();\n\n      if (lastDescendant && $isTextNode(lastDescendant)) {\n        lastDescendant.selectEnd();\n      } else {\n        root.selectEnd();\n      }\n    });\n  }\n\n  selectedNodeWithOffset() {\n    const selection = $getSelection();\n    if (!selection) return { node: null, offset: 0 }\n\n    if ($isRangeSelection(selection)) {\n      return {\n        node: selection.anchor.getNode(),\n        offset: selection.anchor.offset\n      }\n    } else if ($isNodeSelection(selection)) {\n      const [ node ] = selection.getNodes();\n      return {\n        node,\n        offset: 0\n      }\n    }\n\n    return { node: null, offset: 0 }\n  }\n\n  getFormat() {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) return {}\n\n    const anchorNode = selection.anchor.getNode();\n    if (!anchorNode.getParent()) return {}\n\n    const topLevelElement = anchorNode.getTopLevelElementOrThrow();\n    const listType = getListType(anchorNode);\n    const headingNode = this.#getNearestHeadingNode(anchorNode);\n\n    return {\n      isBold: selection.hasFormat(\"bold\"),\n      isItalic: selection.hasFormat(\"italic\"),\n      isStrikethrough: selection.hasFormat(\"strikethrough\"),\n      isUnderline: selection.hasFormat(\"underline\"),\n      isHighlight: isSelectionHighlighted(selection),\n      isInLink: $getNearestNodeOfType(anchorNode, LinkNode) !== null,\n      isInQuote: $isQuoteNode(topLevelElement),\n      isInHeading: headingNode !== null,\n      isInCode: this.#isInCode(selection, anchorNode),\n      headingTag: headingNode?.getTag() ?? null,\n      isInList: listType !== null,\n      listType,\n      isInTable: $getTableCellNodeFromLexicalNode(anchorNode) !== null\n    }\n  }\n\n  nearestNodeOfType(nodeType) {\n    const anchorNode = $getSelection()?.anchor?.getNode();\n    return $getNearestNodeOfType(anchorNode, nodeType)\n  }\n\n  get hasSelectedWordsInSingleLine() {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) return false\n\n    if (selection.isCollapsed()) return false\n\n    const anchorNode = selection.anchor.getNode();\n    const focusNode = selection.focus.getNode();\n\n    if (anchorNode.getTopLevelElement() !== focusNode.getTopLevelElement()) {\n      return false\n    }\n\n    const anchorElement = anchorNode.getTopLevelElement();\n    if (!anchorElement) return false\n\n    // When anchor and focus are in different block-level children of the same\n    // top-level element (e.g. two paragraphs inside a blockquote), this is a\n    // multi-line selection, not a single-line one.\n    const anchorBlock = $isElementNode(anchorNode) ? anchorNode : anchorNode.getParent();\n    const focusBlock = $isElementNode(focusNode) ? focusNode : focusNode.getParent();\n    if (anchorBlock !== focusBlock && anchorBlock !== anchorElement) {\n      return false\n    }\n\n    const nodes = selection.getNodes();\n    for (const node of nodes) {\n      if ($isLineBreakNode(node)) {\n        return false\n      }\n    }\n\n    return true\n  }\n\n  get isInsideList() {\n    return this.nearestNodeOfType(ListItemNode)\n  }\n\n  get isInsideBlockQuote() {\n    return this.nearestNodeOfType(QuoteNode)\n  }\n\n  get isIndentedList() {\n    const closestListNode = this.nearestNodeOfType(ListNode);\n    return closestListNode && ($getListDepth(closestListNode) > 1)\n  }\n\n  get isInsideCodeBlock() {\n    return this.nearestNodeOfType(CodeNode) !== null\n  }\n\n  get isTableCellSelected() {\n    const selection = $getSelection();\n    const { anchor, focus } = selection;\n    if (!$isRangeSelection(selection) || anchor.key !== focus.key) return false\n\n    return this.nearestNodeOfType(TableCellNode) !== null\n  }\n\n  get isOnPreviewableImage() {\n    return this.previewableImageNode != null\n  }\n\n  get previewableImageNode() {\n    const firstNode = $getSelection()?.getNodes().at(0);\n    return $isActionTextAttachmentNode(firstNode) && firstNode.isPreviewableImage ? firstNode : null\n  }\n\n  get isAtNodeStart() {\n    const { anchorNode, offset } = this.#getCollapsedSelectionData();\n    return anchorNode && offset === 0\n  }\n\n  get nodeAfterCursor() {\n    const { anchorNode, offset } = this.#getCollapsedSelectionData();\n    if (!anchorNode) return null\n\n    if ($isTextNode(anchorNode)) {\n      return this.#getNodeAfterTextNode(anchorNode, offset)\n    }\n\n    if ($isElementNode(anchorNode)) {\n      return this.#getNodeAfterElementNode(anchorNode, offset)\n    }\n\n    return this.#findNextSiblingUp(anchorNode)\n  }\n\n  get topLevelNodeAfterCursor() {\n    const { anchorNode, offset } = this.#getCollapsedSelectionData();\n    if (!anchorNode) return null\n\n    if ($isTextNode(anchorNode)) {\n      if (offset === anchorNode.getTextContentSize()) return this.#getNextNodeFromTextEnd(anchorNode)\n      if (this.#isCursorOnLastVisualLineOfBlock(anchorNode)) {\n        const topLevelElement = anchorNode.getTopLevelElement();\n        return topLevelElement ? topLevelElement.getNextSibling() : null\n      }\n      return null\n    }\n\n    if ($isElementNode(anchorNode)) {\n      return this.#getNodeAfterElementNode(anchorNode, offset)\n    }\n\n    return this.#findNextSiblingUp(anchorNode)\n  }\n\n  get nodeBeforeCursor() {\n    const { anchorNode, offset } = this.#getCollapsedSelectionData();\n    if (!anchorNode) return null\n\n    if ($isTextNode(anchorNode)) {\n      return this.#getNodeBeforeTextNode(anchorNode, offset)\n    }\n\n    if ($isElementNode(anchorNode)) {\n      return this.#getNodeBeforeElementNode(anchorNode, offset)\n    }\n\n    return this.#findPreviousSiblingUp(anchorNode)\n  }\n\n  get topLevelNodeBeforeCursor() {\n    const { anchorNode, offset } = this.#getCollapsedSelectionData();\n    if (!anchorNode) return null\n\n    if ($isTextNode(anchorNode)) {\n      if (offset === 0) return this.#getPreviousNodeFromTextStart(anchorNode)\n      if (this.#isCursorOnFirstVisualLineOfBlock(anchorNode)) {\n        const topLevelElement = anchorNode.getTopLevelElement();\n        return topLevelElement ? topLevelElement.getPreviousSibling() : null\n      }\n      return null\n    }\n\n    if ($isElementNode(anchorNode)) {\n      return this.#getNodeBeforeElementNode(anchorNode, offset)\n    }\n\n    return this.#findPreviousSiblingUp(anchorNode)\n  }\n\n  dispose() {\n    this.editorElement = null;\n    this.editorContentElement = null;\n    this.editor = null;\n    this.previouslySelectedKeys = null;\n\n    this.#listeners.dispose();\n  }\n\n  // When all inline code text is deleted, Lexical's selection retains the stale\n  // code format flag. Verify the flag is backed by actual code-formatted content:\n  // a code block ancestor or a text node that carries the code format.\n  #isInCode(selection, anchorNode) {\n    if ($getNearestNodeOfType(anchorNode, CodeNode) !== null) return true\n    if (!selection.hasFormat(\"code\")) return false\n\n    return $isTextNode(anchorNode) && anchorNode.hasFormat(\"code\")\n  }\n\n  // After deleting all inline code text, Lexical preserves the code format on\n  // the selection even though no code-formatted content remains. This listener\n  // detects that stale state and clears it so newly typed text won't be\n  // code-formatted.\n  #clearStaleInlineCodeFormat() {\n    this.#listeners.track(this.editor.registerUpdateListener(({ editorState, tags }) => {\n      if (tags.has(\"history-merge\") || tags.has(\"skip-dom-selection\")) return\n\n      let isStale = false;\n\n      editorState.read(() => {\n        const selection = $getSelection();\n        if (!$isRangeSelection(selection) || !selection.isCollapsed()) return\n        if (!selection.hasFormat(\"code\")) return\n\n        const anchorNode = selection.anchor.getNode();\n        if (this.#isInCode(selection, anchorNode)) return\n\n        isStale = true;\n      });\n\n      if (isStale) {\n        setTimeout(() => {\n          this.editor.update(() => {\n            const selection = $getSelection();\n            if (!$isRangeSelection(selection) || !selection.hasFormat(\"code\")) return\n\n            const anchorNode = selection.anchor.getNode();\n            if (this.#isInCode(selection, anchorNode)) return\n\n            selection.toggleFormat(\"code\");\n          });\n        }, 0);\n      }\n    }));\n  }\n\n  get #currentlySelectedKeys() {\n    if (this.currentlySelectedKeys) { return this.currentlySelectedKeys }\n\n    this.currentlySelectedKeys = new Set();\n\n    const selection = $getSelection();\n    if (selection && $isNodeSelection(selection)) {\n      for (const node of selection.getNodes()) {\n        this.currentlySelectedKeys.add(node.getKey());\n      }\n    }\n\n    return this.currentlySelectedKeys\n  }\n\n  #processSelectionChangeCommands() {\n    this.#listeners.track(\n      this.editor.registerCommand(KEY_ARROW_LEFT_COMMAND, handlingDefault(this.#selectPreviousNode.bind(this)), COMMAND_PRIORITY_LOW),\n      this.editor.registerCommand(KEY_ARROW_RIGHT_COMMAND, handlingDefault(this.#selectNextNode.bind(this)), COMMAND_PRIORITY_LOW),\n      this.editor.registerCommand(KEY_ARROW_UP_COMMAND, handlingDefault(this.#selectPreviousTopLevelNode.bind(this)), COMMAND_PRIORITY_LOW),\n      this.editor.registerCommand(KEY_ARROW_DOWN_COMMAND, handlingDefault(this.#selectNextTopLevelNode.bind(this)), COMMAND_PRIORITY_LOW),\n\n      this.editor.registerCommand(DELETE_CHARACTER_COMMAND, this.#selectDecoratorNodeBeforeDeletion.bind(this), COMMAND_PRIORITY_LOW),\n\n      this.editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {\n        this.#syncSelectedClasses();\n      }, COMMAND_PRIORITY_LOW),\n\n      this.editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {\n        this.#preserveFocusOutsideEditor();\n        return false\n      }, COMMAND_PRIORITY_CRITICAL)\n    );\n  }\n\n  // Selection changes can arrive after Tab moves focus to a toolbar or another field.\n  // Reconciling that stale selection would pull focus back into the editor.\n  #preserveFocusOutsideEditor() {\n    if (this.#isAnotherElementFocused) {\n      $addUpdateTag(SKIP_DOM_SELECTION_TAG);\n    }\n  }\n\n  get #isAnotherElementFocused() {\n    const rootElement = this.editor.getRootElement();\n    const activeElement = rootElement?.ownerDocument.activeElement;\n\n    return activeElement && activeElement !== rootElement.ownerDocument.body && !rootElement.contains(activeElement)\n  }\n\n  #listenForNodeSelections() {\n    this.#listeners.track(this.editor.registerCommand(CLICK_COMMAND, ({ target }) => {\n      if (!isDOMNode(target)) return false\n\n      const targetNode = $getNearestNodeFromDOMNode(target);\n      return $isDecoratorNode(targetNode) && this.#selectInLexical(targetNode)\n    }, COMMAND_PRIORITY_LOW));\n\n    this.#listeners.track(\n      this.editor.registerRootListener((rootElement) => {\n        if (rootElement) {\n          return registerEventListener(rootElement, \"lexxy:internal:move-to-next-line\", () => this.#selectOrAppendNextLine())\n        }\n      })\n    );\n  }\n\n  #containEditorFocus() {\n    // Workaround for a bizarre Chrome bug where the cursor abandons the editor to focus on not-focusable elements\n    // above when navigating UP/DOWN when Lexical shows its fake cursor on custom decorator nodes.\n    this.#listeners.track(\n      this.editor.registerRootListener((rootElement) => {\n        if (rootElement) {\n          const handler = (event) => this.#handleArrowKeyOnLexicalCursor(event);\n          rootElement.addEventListener(\"keydown\", handler, true);\n          return () => rootElement.removeEventListener(\"keydown\", handler, true)\n        }\n      })\n    );\n  }\n\n  #handleArrowKeyOnLexicalCursor(event) {\n    if (event.key === \"ArrowUp\") {\n      const lexicalCursor = this.editor.getRootElement().querySelector(\"[data-lexical-cursor]\");\n\n      if (lexicalCursor) {\n        let currentElement = lexicalCursor.previousElementSibling;\n        while (currentElement && currentElement.hasAttribute(\"data-lexical-cursor\")) {\n          currentElement = currentElement.previousElementSibling;\n        }\n\n        if (!currentElement) {\n          event.preventDefault();\n        }\n      }\n    }\n\n    if (event.key === \"ArrowDown\") {\n      const lexicalCursor = this.editor.getRootElement().querySelector(\"[data-lexical-cursor]\");\n\n      if (lexicalCursor) {\n        let currentElement = lexicalCursor.nextElementSibling;\n        while (currentElement && currentElement.hasAttribute(\"data-lexical-cursor\")) {\n          currentElement = currentElement.nextElementSibling;\n        }\n\n        if (!currentElement) {\n          event.preventDefault();\n        }\n      }\n    }\n  }\n\n  #syncSelectedClasses() {\n    this.#clearPreviouslyHighlightedItems();\n    this.#highlightNewItems();\n\n    this.previouslySelectedKeys = this.#currentlySelectedKeys;\n    this.currentlySelectedKeys = null;\n  }\n\n  #clearPreviouslyHighlightedItems() {\n    for (const key of this.previouslySelectedKeys) {\n      if (!this.#currentlySelectedKeys.has(key)) {\n        const dom = this.editor.getElementByKey(key);\n        if (dom) dom.classList.remove(\"node--selected\");\n      }\n    }\n  }\n\n  #highlightNewItems() {\n    for (const key of this.#currentlySelectedKeys) {\n      if (!this.previouslySelectedKeys.has(key)) {\n        const nodeElement = this.editor.getElementByKey(key);\n        if (nodeElement) nodeElement.classList.add(\"node--selected\");\n      }\n    }\n  }\n\n  #selectPreviousNode(event) {\n    if (event.shiftKey) {\n      return this.#withCurrentNodeSelectionNode((currentNode) => {\n        const selection = this.#rangeSelectDecorator(currentNode, \"forward\");\n\n        // Can't rely on native pass-through with Playwright on firefox\n        selection.modify(\"extend\", true, \"character\");\n        return true\n      })\n    } else {\n      return this.#withCurrentNodeSelectionNode((currentNode) => currentNode.selectPrevious())\n        || this.#selectInLexical(this.nodeBeforeCursor)\n    }\n  }\n\n  #selectNextNode(event) {\n    if (event.shiftKey) {\n      return this.#withCurrentNodeSelectionNode((currentNode) => {\n        const selection = this.#rangeSelectDecorator(currentNode, \"forward\");\n\n        // Can't rely on native pass-through with Playwright on firefox\n        selection.modify(\"extend\", false, \"character\");\n        return true\n      })\n    } else {\n      return this.#withCurrentNodeSelectionNode((currentNode) => currentNode.selectNext(0, 0))\n        || this.#selectInLexical(this.nodeAfterCursor)\n    }\n  }\n\n  #selectPreviousTopLevelNode() {\n    return this.#withCurrentNodeSelectionNode((currentNode) => currentNode.getTopLevelElement().selectPrevious())\n      || this.#selectInLexical(this.topLevelNodeBeforeCursor)\n  }\n\n  #selectNextTopLevelNode() {\n    return this.#withCurrentNodeSelectionNode((currentNode) => currentNode.getTopLevelElement().selectNext(0, 0))\n      || this.#selectInLexical(this.topLevelNodeAfterCursor)\n  }\n\n  // hasNodeSelection reads the committed state, while $getSelection() resolves\n  // against the pending one \u2014 so the selection here can be missing, no longer a\n  // NodeSelection, or reference a node that no longer exists (empty editor,\n  // just-deleted node, decorator boundary). Only invoke the callback when a\n  // node actually resolves; returning false lets the callers fall back \u2014\n  // #selectInLexical for plain arrows, native pass-through for shift-arrows.\n  #withCurrentNodeSelectionNode(fn) {\n    const selection = this.hasNodeSelection ? $getSelection() : null;\n    const currentNode = $isNodeSelection(selection) ? selection.getNodes()[0] : undefined;\n\n    return currentNode ? fn(currentNode) : false\n  }\n\n  #rangeSelectDecorator(node, direction = \"forward\") {\n    if ($isDecoratorNode(node)) {\n        const [ anchorOffset, focusOffset ] = direction === \"forward\" ? [ 0, 1 ] : [ 1, 0 ];\n        const indexAtNode = node.getIndexWithinParent();\n\n        return node.getParent().select(indexAtNode + anchorOffset, indexAtNode + focusOffset)\n    }\n  }\n\n  async #selectOrAppendNextLine() {\n    this.editor.update(() => {\n      const topLevelElement = this.#getTopLevelElementFromSelection();\n      if (!topLevelElement) return\n\n      this.#moveToOrCreateNextLine(topLevelElement);\n    });\n  }\n\n  #getTopLevelElementFromSelection() {\n    const selection = $getSelection();\n    if (!selection) return null\n\n    if ($isNodeSelection(selection)) {\n      return this.#getTopLevelFromNodeSelection(selection)\n    }\n\n    if ($isRangeSelection(selection)) {\n      return this.#getTopLevelFromRangeSelection(selection)\n    }\n\n    return null\n  }\n\n  #getTopLevelFromNodeSelection(selection) {\n    const nodes = selection.getNodes();\n    return nodes.length > 0 ? nodes[0].getTopLevelElement() : null\n  }\n\n  #getTopLevelFromRangeSelection(selection) {\n    const anchorNode = selection.anchor.getNode();\n    return anchorNode.getTopLevelElement()\n  }\n\n  #getNearestHeadingNode(anchorNode) {\n    const topLevelElement = anchorNode.getTopLevelElementOrThrow();\n\n    let headingNode = $isHeadingNode(topLevelElement) ? topLevelElement : null;\n    if (!headingNode) {\n      let current = anchorNode.getParent();\n      while (current) {\n        if ($isHeadingNode(current)) {\n          headingNode = current;\n          break\n        }\n        current = current.getParent();\n      }\n    }\n\n    return headingNode\n  }\n\n  #moveToOrCreateNextLine(topLevelElement) {\n    const nextSibling = topLevelElement.getNextSibling();\n\n    if (nextSibling) {\n      nextSibling.selectStart();\n    } else {\n      this.#createAndSelectNewParagraph();\n    }\n  }\n\n  #createAndSelectNewParagraph() {\n    const root = $getRoot();\n    const newParagraph = $createParagraphNode();\n    root.append(newParagraph);\n    newParagraph.selectStart();\n  }\n\n  #selectInLexical(node) {\n    if ($isDecoratorNode(node)) {\n      $addUpdateTag(HISTORY_MERGE_TAG);\n      const selection = $createNodeSelectionWith(node);\n      $setSelection(selection);\n      return selection\n    } else {\n      return false\n    }\n  }\n\n  #selectDecoratorNodeBeforeDeletion(backwards) {\n    if (backwards && this.#removeEmptyListItem()) return true\n\n    const node = backwards ? this.nodeBeforeCursor : this.nodeAfterCursor;\n    if (!$isDecoratorNode(node)) return false\n\n    if (this.#collapseListItemToParagraph(node)) return true\n\n    this.#removeEmptyElementAnchorNode();\n\n    const selection = this.#selectInLexical(node);\n    return Boolean(selection)\n  }\n\n  // When backspace is pressed on an empty list item that has siblings,\n  // handle the deletion appropriately:\n  //\n  // - Middle/end items (has previous sibling): remove the empty item and\n  //   place the cursor at the end of the previous sibling. Without this,\n  //   Lexical's default collapseAtStart converts the empty item into a\n  //   paragraph above the list, causing the cursor to jump away.\n  //\n  // - First item (no previous sibling): convert to a paragraph above the\n  //   list, matching the standard \"unwrap list formatting\" behavior that\n  //   users expect from pressing backspace at the start of a list item.\n  //   Inside a blockquote we instead just remove the empty item and move\n  //   the cursor into the next one \u2014 stranding a paragraph there would\n  //   leave the blank line the user is trying to close.\n  //\n  // When the empty item is the last/only one in the list, we return false\n  // and let Lexical's default (convert to paragraph) provide the standard\n  // \"exit list\" behavior.\n  #removeEmptyListItem() {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection) || !selection.isCollapsed()) return false\n\n    const anchorNode = selection.anchor.getNode();\n    const listItem = $getNearestNodeOfType(anchorNode, ListItemNode);\n    if (!listItem) return false\n\n    if (!$isListItemStructurallyEmpty(listItem)) return false\n\n    const nextSibling = listItem.getNextSibling();\n    if (!nextSibling) return false\n\n    const previousSibling = listItem.getPreviousSibling();\n    const listNode = $getNearestNodeOfType(listItem, ListNode);\n    if (!listNode) return false\n\n    if (previousSibling) {\n      previousSibling.selectEnd();\n      listItem.remove();\n    } else if ($isQuoteNode(listNode.getParent())) {\n      nextSibling.selectStart();\n      listItem.remove();\n    } else {\n      const paragraph = $createParagraphNode();\n      listNode.insertBefore(paragraph);\n      listItem.remove();\n      paragraph.selectStart();\n    }\n\n    return true\n  }\n\n  // When the cursor is inside a list item, collapse the list item into a\n  // paragraph instead of selecting the decorator. This lets the user\n  // delete a list that immediately follows an attachment without the\n  // attachment becoming selected. Only applies when the decorator is\n  // outside the list item (e.g. a block attachment before the list),\n  // not when it's an inline mention inside the list item.\n  #collapseListItemToParagraph(decoratorNode) {\n    const anchorNode = $getSelection()?.anchor?.getNode();\n    const listItem = anchorNode && $getNearestNodeOfType(anchorNode, ListItemNode);\n    if (!listItem) return false\n\n    if (listItem.isParentOf(decoratorNode)) return false\n\n    const listNode = $getNearestNodeOfType(listItem, ListNode);\n    if (!listNode) return false\n\n    const paragraph = $createParagraphNode();\n    const children = listItem.getChildren();\n    children.forEach(child => paragraph.append(child));\n\n    if (listNode.getChildrenSize() === 1) {\n      listNode.insertBefore(paragraph);\n      listNode.remove();\n    } else {\n      listNode.insertBefore(paragraph);\n      listItem.remove();\n    }\n\n    paragraph.selectStart();\n    return true\n  }\n\n  #removeEmptyElementAnchorNode(anchor = $getSelection()?.anchor) {\n    const anchorNode = anchor?.getNode();\n    if ($isElementNode(anchorNode) && anchorNode?.isEmpty()) anchorNode.remove();\n  }\n\n  #getValidSelectionRange() {\n    const lexicalSelection = $getSelection();\n    if (!lexicalSelection || !lexicalSelection.isCollapsed()) return null\n\n    const nativeSelection = window.getSelection();\n    if (!nativeSelection || nativeSelection.rangeCount === 0) return null\n\n    return nativeSelection.getRangeAt(0)\n  }\n\n  #getReliableRectFromRange(range) {\n    let rect = range.getBoundingClientRect();\n\n    if (this.#isRectUnreliable(rect)) {\n      const marker = this.#createAndInsertMarker(range);\n      rect = marker.getBoundingClientRect();\n      this.#restoreSelectionAfterMarker(marker);\n      marker.remove();\n    }\n\n    return rect\n  }\n\n  #isRectUnreliable(rect) {\n    return rect.width === 0 && rect.height === 0 || rect.top === 0 && rect.left === 0\n  }\n\n  #createAndInsertMarker(range) {\n    const marker = this.#createMarker();\n    range.insertNode(marker);\n    return marker\n  }\n\n  #createMarker() {\n    const marker = document.createElement(\"span\");\n    marker.textContent = \"\\u200b\";\n    marker.style.display = \"inline-block\";\n    marker.style.width = \"1px\";\n    marker.style.height = \"1em\";\n    marker.style.lineHeight = \"normal\";\n    marker.setAttribute(\"nonce\", getNonce());\n    return marker\n  }\n\n  #restoreSelectionAfterMarker(marker) {\n    const nativeSelection = window.getSelection();\n    nativeSelection.removeAllRanges();\n    const newRange = document.createRange();\n    newRange.setStartAfter(marker);\n    newRange.collapse(true);\n    nativeSelection.addRange(newRange);\n  }\n\n  #calculateCursorPosition(rect, range) {\n    const rootRect = this.editor.getRootElement().getBoundingClientRect();\n    const x = rect.left - rootRect.left;\n    let y = rect.top - rootRect.top;\n\n    const fontSize = this.#getFontSizeForCursor(range);\n    if (!isNaN(fontSize)) {\n      y += fontSize;\n    }\n\n    return { x, y, fontSize }\n  }\n\n  #getFontSizeForCursor(range) {\n    const nativeSelection = window.getSelection();\n    const anchorNode = nativeSelection.anchorNode;\n    const parentElement = this.#getElementFromNode(anchorNode);\n\n    if (parentElement instanceof HTMLElement) {\n      const computed = window.getComputedStyle(parentElement);\n      return parseFloat(computed.fontSize)\n    }\n\n    return 0\n  }\n\n  #getElementFromNode(node) {\n    return node?.nodeType === Node.TEXT_NODE ? node.parentElement : node\n  }\n\n  #getCollapsedSelectionData() {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection) || !selection.isCollapsed()) {\n      return { anchorNode: null, offset: 0 }\n    }\n\n    const { anchor } = selection;\n    return { anchorNode: anchor.getNode(), offset: anchor.offset }\n  }\n\n  #getNodeAfterTextNode(anchorNode, offset) {\n    if (offset === anchorNode.getTextContentSize()) {\n      return this.#getNextNodeFromTextEnd(anchorNode)\n    }\n    return null\n  }\n\n  #getNextNodeFromTextEnd(anchorNode) {\n    const nextSibling = anchorNode.getNextSibling();\n    if ($isDecoratorNode(nextSibling)) {\n      return nextSibling\n    }\n    if (nextSibling != null) {\n      return null\n    }\n    const parent = anchorNode.getParent();\n    return parent ? parent.getNextSibling() : null\n  }\n\n  #getNodeAfterElementNode(anchorNode, offset) {\n    if (offset < anchorNode.getChildrenSize()) {\n      return anchorNode.getChildAtIndex(offset)\n    }\n    return this.#findNextSiblingUp(anchorNode)\n  }\n\n  #getNodeBeforeTextNode(anchorNode, offset) {\n    if (offset === 0) {\n      return this.#getPreviousNodeFromTextStart(anchorNode)\n    }\n    return null\n  }\n\n  #getPreviousNodeFromTextStart(anchorNode) {\n    const previousSibling = anchorNode.getPreviousSibling();\n    if ($isDecoratorNode(previousSibling)) {\n      return previousSibling\n    }\n    if (previousSibling != null) {\n      return null\n    }\n    const parent = anchorNode.getParent();\n    return parent ? parent.getPreviousSibling() : null\n  }\n\n  #getNodeBeforeElementNode(anchorNode, offset) {\n    if (offset > 0) {\n      return anchorNode.getChildAtIndex(offset - 1)\n    }\n    return this.#findPreviousSiblingUp(anchorNode)\n  }\n\n  #findNextSiblingUp(node) {\n    let current = node;\n    while (current && current.getNextSibling() == null) {\n      current = current.getParent();\n    }\n    return current ? current.getNextSibling() : null\n  }\n\n  #findPreviousSiblingUp(node) {\n    let current = node;\n    while (current && current.getPreviousSibling() == null) {\n      current = current.getParent();\n    }\n    return current ? current.getPreviousSibling() : null\n  }\n\n  #isCursorOnFirstVisualLineOfBlock(anchorNode) {\n    return this.#isCursorOnEdgeLineOfBlock(anchorNode, \"first\")\n  }\n\n  #isCursorOnLastVisualLineOfBlock(anchorNode) {\n    return this.#isCursorOnEdgeLineOfBlock(anchorNode, \"last\")\n  }\n\n  // Check whether the cursor sits on the first or last visual line of its\n  // top-level block by comparing the Y position of the cursor with the Y\n  // position of the block's start (first line) or end (last line).\n  #isCursorOnEdgeLineOfBlock(anchorNode, edge) {\n    const topLevelElement = anchorNode.getTopLevelElement();\n    if (!topLevelElement) return false\n\n    const domElement = this.editor.getElementByKey(topLevelElement.getKey());\n    if (!domElement) return false\n\n    const nativeSelection = window.getSelection();\n    if (!nativeSelection?.rangeCount) return false\n\n    const cursorRect = this.#getReliableRectFromRange(nativeSelection.getRangeAt(0));\n    if (!cursorRect || this.#isRectUnreliable(cursorRect)) return false\n\n    const edgeRect = this.#getEdgeCharRect(domElement, edge);\n    if (!edgeRect || this.#isRectUnreliable(edgeRect)) return false\n\n    const tolerance = edgeRect.height > 0 ? edgeRect.height * 0.5 : 5;\n    return Math.abs(cursorRect.top - edgeRect.top) < tolerance\n  }\n\n  // Get a reliable bounding rect for the first or last character in a DOM\n  // element by creating a non-collapsed range around it.\n  #getEdgeCharRect(element, edge) {\n    const walker = document.createTreeWalker(element, 4 /* NodeFilter.SHOW_TEXT */);\n    let textNode;\n\n    if (edge === \"first\") {\n      textNode = walker.nextNode();\n    } else {\n      while (walker.nextNode()) textNode = walker.currentNode;\n    }\n\n    if (!textNode || textNode.length === 0) return null\n\n    const range = document.createRange();\n    if (edge === \"first\") {\n      range.setStart(textNode, 0);\n      range.setEnd(textNode, 1);\n    } else {\n      range.setStart(textNode, textNode.length - 1);\n      range.setEnd(textNode, textNode.length);\n    }\n\n    return range.getBoundingClientRect()\n  }\n}\n\nclass EditorConfiguration {\n  #editorElement\n  #config\n\n  constructor(editorElement) {\n    this.#editorElement = editorElement;\n    this.#config = new Configuration(\n      Lexxy.presets.get(\"default\"),\n      Lexxy.presets.get(editorElement.preset),\n      this.#overrides\n    );\n  }\n\n  get(path) {\n    return this.#config.get(path)\n  }\n\n  get #overrides() {\n    const overrides = {};\n    for (const option of this.#defaultOptions) {\n      const attribute = dasherize(option);\n      if (this.#editorElement.hasAttribute(attribute)) {\n        overrides[option] = this.#parseAttribute(attribute);\n      }\n    }\n    return overrides\n  }\n\n  get #defaultOptions() {\n    return Object.keys(Lexxy.presets.get(\"default\"))\n  }\n\n  #parseAttribute(attribute) {\n    const value = this.#editorElement.getAttribute(attribute);\n    try {\n      return JSON.parse(value)\n    } catch {\n      return value\n    }\n  }\n}\n\nclass Uploader {\n  #files\n\n  static for(editorElement, files, options = {}) {\n    const UploaderKlass = GalleryUploader.handle(editorElement, files) ? GalleryUploader : Uploader;\n    return new UploaderKlass(editorElement, files, options)\n  }\n\n  constructor(editorElement, files, options = {}) {\n    this.#files = files;\n    this.options = options;\n\n    this.editorElement = editorElement;\n    this.contents = editorElement.contents;\n    this.selection = editorElement.selection;\n  }\n\n  get files() {\n    return Array.from(this.#files)\n  }\n\n  $uploadFiles() {\n    this.$createUploadNodes();\n    this.$insertUploadNodes();\n  }\n\n  $createUploadNodes() {\n    this.nodes = this.files.map(file => this.#createUploadNode(file));\n  }\n\n  #createUploadNode(file) {\n    return this.options.pending\n      ? this.contents.$createPendingUploadNode(file)\n      : this.contents.$createUploadNode(file)\n  }\n\n  $insertUploadNodes() {\n    this.contents.insertAtCursor(...this.nodes);\n  }\n}\n\nclass GalleryUploader extends Uploader {\n  #gallery\n\n  static handle(editorElement, files) {\n    return this.isMultipleImageUpload(files) || this.gallerySelection(editorElement.selection)\n  }\n\n  static isMultipleImageUpload(files) {\n    let imageFileCount = 0;\n    for (const file of files) {\n      if (isPreviewableImage(file.type)) imageFileCount++;\n      if (imageFileCount > 1) return true\n    }\n    return false\n  }\n\n  static gallerySelection(selection) {\n    return selection.isOnPreviewableImage || this.selectionIsAfterGalleryEdge(selection)\n  }\n\n  static selectionIsAfterGalleryEdge(selection) {\n    return selection.isAtNodeStart && ImageGalleryNode.canCollapseWith(selection.nodeBeforeCursor)\n  }\n\n  $insertUploadNodes() {\n    this.#findOrCreateGallery();\n    this.#insertImagesInGallery();\n    this.#insertNonImagesAfterGallery();\n  }\n\n  #findOrCreateGallery() {\n    if (this.selection.isOnPreviewableImage) {\n      // Resolve from the previewable image itself (the selection's first node), not from\n      // #selectedNode (the anchor) \u2014 those differ when the selection runs from an image\n      // into following text, and the anchor text node can't join a gallery (returns null).\n      this.#gallery = $findOrCreateGalleryForImage(this.selection.previewableImageNode);\n    } else if (this.#selectionIsAfterGalleryEdge) {\n      this.#gallery = $findOrCreateGalleryForImage(this.selection.nodeBeforeCursor);\n    } else {\n      this.#gallery = $createImageGalleryNode();\n      this.contents.insertAtCursor(this.#gallery);\n    }\n  }\n\n  get #selectionIsAfterGalleryEdge() {\n    return this.constructor.selectionIsAfterGalleryEdge(this.selection)\n  }\n\n  get #selectedNode() {\n    const { node } = this.selection.selectedNodeWithOffset();\n    return node\n  }\n\n  get #galleryInsertPosition() {\n    if (this.#selectionIsAfterGalleryEdge) return this.#gallery.getChildrenSize()\n\n    const anchor = $getSelection()?.anchor;\n    const galleryHasElementSelection = anchor?.getNode().is(this.#gallery);\n    if (galleryHasElementSelection) return anchor.offset\n\n    const selectedNode = this.#selectedNode;\n    const childIndex = this.#gallery.isParentOf(selectedNode) && selectedNode.getIndexWithinParent();\n    return childIndex !== false ? (childIndex + 1) : 0\n  }\n\n  get #imageNodes() {\n    return this.nodes.filter(node => ImageGalleryNode.isValidChild(node))\n  }\n\n  get #nonImageNodes() {\n    return this.nodes.filter(node => !ImageGalleryNode.isValidChild(node))\n  }\n\n  #insertImagesInGallery() {\n    this.#gallery.splice(this.#galleryInsertPosition, 0, this.#imageNodes);\n  }\n\n  #insertNonImagesAfterGallery() {\n    let beforeNode = this.#gallery;\n\n    for (const node of this.#nonImageNodes) {\n      beforeNode.insertAfter(node);\n      beforeNode = node;\n    }\n  }\n}\n\nasync function loadFileIntoImage(file, image) {\n  return new Promise((resolve) => {\n    const reader = new FileReader();\n\n    image.addEventListener(\"load\", () => {\n      resolve(image);\n    });\n\n    reader.onload = (event) => {\n      image.src = event.target.result || null;\n    };\n\n    reader.readAsDataURL(file);\n  })\n}\n\nclass ActionTextAttachmentUploadNode extends ActionTextAttachmentNode {\n  static getType() {\n    return \"action_text_attachment_upload\"\n  }\n\n  static clone(node) {\n    return new ActionTextAttachmentUploadNode({ ...node }, node.__key)\n  }\n\n  static importJSON(serializedNode) {\n    return new ActionTextAttachmentUploadNode({ ...serializedNode })\n  }\n\n  // Should never run since this is a transient node. Defined to remove console warning.\n  static importDOM() {\n    return null\n  }\n\n  constructor(node = {}, key) {\n    const { file, uploadUrl, blobUrlTemplate, progress, width, height, uploadError, fileName, contentType } = node;\n    super({ ...node, contentType: file?.type ?? contentType }, key);\n    this.file = file ?? null;\n    this.fileName = file?.name ?? fileName;\n    this.uploadUrl = uploadUrl;\n    this.blobUrlTemplate = blobUrlTemplate;\n    this.progress = progress ?? null;\n    this.width = width;\n    this.height = height;\n    this.uploadError = uploadError;\n  }\n\n  createDOM() {\n    if (this.uploadError) return this.createDOMForError()\n\n    // This side-effect is trigged on DOM load to fire only once and avoid multiple\n    // uploads through cloning. The upload is guarded from restarting in case the\n    // node is reloaded from saved state such as from history.\n    this.#startUploadIfNeeded();\n\n    // Bridge-managed uploads (uploadUrl is null) and restored or remote\n    // instances (no local File) don't have file data to show an image\n    // preview, so always show the file icon during upload.\n    const canPreviewFile = this.isPreviewableAttachment && this.uploadUrl != null && this.file != null;\n    const figure = this.createAttachmentFigure(canPreviewFile);\n\n    if (canPreviewFile) {\n      const img = figure.appendChild(this.#createDOMForImage());\n\n      // load file locally to set dimensions and prevent vertical shifting\n      loadFileIntoImage(this.file, img).then(img => this.#setDimensionsFromImage(img));\n    } else {\n      figure.appendChild(this.#createDOMForFile());\n    }\n\n    figure.appendChild(this.#createCaption());\n    figure.appendChild(this.#createProgressBar());\n\n    return figure\n  }\n\n  updateDOM(prevNode, dom) {\n    if (this.uploadError !== prevNode.uploadError) return true\n\n    const image = dom.querySelector(\"img\");\n    if (image && prevNode.altText !== this.altText) {\n      image.alt = this.altText;\n    }\n\n    if (prevNode.progress !== this.progress) {\n      const progress = dom.querySelector(\"progress\");\n      progress.value = this.progress ?? 0;\n    }\n\n    return false\n  }\n\n  exportDOM() {\n    return { element: null }\n  }\n\n  exportJSON() {\n    return {\n      ...super.exportJSON(),\n      type: \"action_text_attachment_upload\",\n      version: 1,\n      fileName: this.fileName,\n      contentType: this.contentType,\n      uploadUrl: this.uploadUrl,\n      blobUrlTemplate: this.blobUrlTemplate,\n      progress: this.progress,\n      width: this.width,\n      height: this.height,\n      uploadError: this.uploadError\n    }\n  }\n\n  get #uploadStarted() {\n    return this.progress !== null\n  }\n\n  #createDOMForImage() {\n    return createElement(\"img\", { alt: this.altText })\n  }\n\n  #createDOMForFile() {\n    const extension = this.#getFileExtension();\n    const span = createElement(\"span\", { className: \"attachment__icon\", textContent: extension });\n    return span\n  }\n\n  #getFileExtension() {\n    return (this.fileName || \"\").split(\".\").pop().toLowerCase()\n  }\n\n  #createCaption() {\n    const figcaption = createElement(\"figcaption\", { className: \"attachment__caption\" });\n\n    const nameSpan = createElement(\"span\", { className: \"attachment__name\", textContent: this.caption || this.fileName || \"\" });\n    figcaption.appendChild(nameSpan);\n\n    if (this.file) {\n      const sizeSpan = createElement(\"span\", { className: \"attachment__size\", textContent: bytesToHumanSize(this.file.size) });\n      figcaption.appendChild(sizeSpan);\n    }\n\n    return figcaption\n  }\n\n  #createProgressBar() {\n    return createElement(\"progress\", { value: this.progress ?? 0, max: 100 })\n  }\n\n  #setDimensionsFromImage({ width, height }) {\n    if (this.#hasDimensions) return\n\n    this.patchAndRewriteHistory({ width, height });\n  }\n\n  get #hasDimensions() {\n    return Boolean(this.width && this.height)\n  }\n\n  async #startUploadIfNeeded() {\n    if (this.#uploadStarted) return\n    if (!this.uploadUrl) return // Bridge-managed upload \u2014 skip DirectUpload\n    if (!this.file) return // Restored or remote instance \u2014 no local File to upload\n\n    this.#setUploadStarted();\n\n    const { DirectUpload } = await import('@rails/activestorage');\n\n    const upload = new DirectUpload(this.file, this.uploadUrl, this);\n    upload.delegate = this.#createUploadDelegate();\n\n    this.#dispatchEvent(\"lexxy:upload-start\", { file: this.file });\n\n    upload.create((error, blob) => {\n      this.#forgetUploadRequest();\n\n      if (error) {\n        this.#dispatchEvent(\"lexxy:upload-end\", { file: this.file, error });\n        this.#handleUploadError(error);\n      } else {\n        this.#dispatchEvent(\"lexxy:upload-end\", { file: this.file, error: null });\n        this.editor.update(() => {\n          this.$showUploadedAttachment(blob);\n        });\n      }\n    });\n  }\n\n  #createUploadDelegate() {\n    const shouldAuthenticateUploads = Lexxy.global.get(\"authenticatedUploads\");\n\n    return {\n      directUploadWillCreateBlobWithXHR: (request) => {\n        if (shouldAuthenticateUploads) request.withCredentials = true;\n      },\n      directUploadWillStoreFileWithXHR: (request) => {\n        if (shouldAuthenticateUploads) request.withCredentials = true;\n\n        this.#rememberUploadRequest(request);\n\n        const uploadProgressHandler = (event) => this.#handleUploadProgress(event, request);\n        request.upload.addEventListener(\"progress\", uploadProgressHandler);\n      }\n    }\n  }\n\n  #forgetUploadRequest() {\n    this.#editorElement?.uploadRequests.forget(this.getKey());\n  }\n\n  #rememberUploadRequest(request) {\n    this.#editorElement?.uploadRequests.track(this.getKey(), request);\n  }\n\n  get #editorElement() {\n    return this.editor.getRootElement()?.closest(\"lexxy-editor\")\n  }\n\n  #setUploadStarted() {\n    this.#setProgress(1);\n  }\n\n  #handleUploadProgress(event, request) {\n    const progress = Math.round(event.loaded / event.total * 100);\n    try {\n      this.#setProgress(progress);\n      this.#dispatchEvent(\"lexxy:upload-progress\", { file: this.file, progress });\n    } catch {\n      request.abort();\n    }\n  }\n\n  #setProgress(progress) {\n    this.patchAndRewriteHistory({ progress });\n  }\n\n  #handleUploadError(error) {\n    console.warn(`Upload error for ${this.file?.name ?? \"file\"}: ${error}`);\n\n    this.patchAndRewriteHistory({ uploadError: true });\n  }\n\n  $showUploadedAttachment(blob) {\n    const previewSrc = this.isPreviewableImage && this.file ? URL.createObjectURL(this.file) : null;\n\n    const replacementNode = this.#toActionTextAttachmentNodeWith(blob, previewSrc);\n    this.replaceAndRewriteHistory(replacementNode);\n\n    return replacementNode.getKey()\n  }\n\n  #toActionTextAttachmentNodeWith(blob, previewSrc) {\n    const conversion = new AttachmentNodeConversion(this, blob, previewSrc);\n    return conversion.toAttachmentNode()\n  }\n\n  #dispatchEvent(name, detail) {\n    const figure = this.editor.getElementByKey(this.getKey());\n    if (figure) dispatch(figure, name, detail);\n  }\n}\n\nclass AttachmentNodeConversion {\n  constructor(uploadNode, blob, previewSrc) {\n    this.uploadNode = uploadNode;\n    this.blob = blob;\n    this.previewSrc = previewSrc;\n  }\n\n  toAttachmentNode() {\n    return new ActionTextAttachmentNode({\n      ...this.uploadNode,\n      ...this.#propertiesFromBlob,\n      src: this.#src,\n      previewSrc: this.previewSrc,\n      pendingPreview: this.blob.previewable && !this.uploadNode.isPreviewableImage\n    })\n  }\n\n  get #propertiesFromBlob() {\n    const { blob } = this;\n    return {\n      sgid: blob.attachable_sgid,\n      contentType: blob.content_type,\n      fileName: blob.filename,\n      fileSize: blob.byte_size,\n      previewable: blob.previewable,\n      previewStatusUrl: blob.preview_status_url\n    }\n  }\n\n  get #src() {\n    return this.blob.previewable ? this.blob.url : this.#blobSrc\n  }\n\n  get #blobSrc() {\n    return this.uploadNode.blobUrlTemplate\n      .replace(\":signed_id\", this.blob.signed_id)\n      .replace(\":filename\", encodeURIComponent(this.blob.filename))\n  }\n}\n\nfunction $createActionTextAttachmentUploadNode(...args) {\n  return new ActionTextAttachmentUploadNode(...args)\n}\n\nclass BaseNodeInserter {\n  constructor(selection) {\n    this.selection = selection;\n  }\n}\n\nclass CodeNodeInserter extends BaseNodeInserter {\n  static handles(selection) {\n    return $getNearestNodeOfType(selection.anchor?.getNode(), CodeNode)\n  }\n\n  insertNodes(nodes) {\n    if (!this.selection.isCollapsed()) { this.selection.removeText(); }\n\n    $ensureForwardRangeSelection(this.selection);\n    const focusNode = this.selection.focus.getNode();\n    const codeNode = $getNearestNodeOfType(focusNode, CodeNode);\n    const insertionIndex = focusNode.is(codeNode) ? 0 : focusNode.getIndexWithinParent();\n\n    const caret = $getChildCaretAtIndex(codeNode, insertionIndex + 1, \"previous\");\n\n    // Nodes that are already in the document come from the format-toggle path (existing\n    // content converted into this code block). Brand-new nodes (dropped/pasted content)\n    // were never attached.\n    const existingNodes = new Set(nodes.filter(node => node.isAttached()));\n    const trailingNodes = [];\n\n    for (const node of nodes) {\n      if (existingNodes.has(node)) {\n        if (!node.isAttached()) continue // already pulled in when a converted ancestor was removed\n      } else if (!this.#canJoinCodeBlock(node)) {\n        trailingNodes.push(node); // e.g. a dropped attachment, which a code block can't hold\n        continue\n      }\n\n      if (caret.getNodeAtCaret() && $isElementNode(node)) { caret.insert($createLineBreakNode()); }\n      caret.insert(this.#convertNodeToCodeChild(node));\n    }\n\n    const lastTrailingNode = this.#insertAfterCodeBlock(codeNode, trailingNodes);\n    const nodeToSelect = lastTrailingNode ?? caret.getNodeAtCaret();\n    nodeToSelect?.selectEnd();\n  }\n\n  #canJoinCodeBlock(node) {\n    return $isTextNode(node) || $isLineBreakNode(node)\n  }\n\n  #insertAfterCodeBlock(codeNode, nodes) {\n    let previousNode = codeNode;\n    for (const node of nodes) {\n      previousNode.insertAfter(node);\n      previousNode = node;\n    }\n    return nodes.at(-1)\n  }\n\n  #convertNodeToCodeChild(node) {\n    if ($isLineBreakNode(node)) {\n      return node\n    } else {\n      node.remove();\n      return $createTextNode(node.getTextContent())\n    }\n  }\n}\n\nclass ShadowRootNodeInserter extends BaseNodeInserter {\n  static handles(selection) {\n    return $isShadowRoot(selection?.anchor?.getNode())\n  }\n\n  insertNodes(nodes) {\n    const anchorNode = this.selection.anchor.getNode();\n    const paragraph = $createParagraphNode();\n    anchorNode.append(paragraph);\n\n    paragraph.selectStart().insertNodes(nodes);\n  }\n}\n\nclass NodeSelectionNodeInserter extends BaseNodeInserter {\n  static handles(selection) {\n    return $isNodeSelection(selection) && selection.getNodes().length > 0\n  }\n\n  insertNodes(nodes) {\n    // Overrides Lexical's default behavior of _removing_ the currently selected nodes\n    // https://github.com/facebook/lexical/blob/v0.38.2/packages/lexical/src/LexicalSelection.ts#L412\n    let lastNode = this.selection.getNodes().at(-1);\n\n    for (const node of nodes) {\n      // Inserting after a top-level node would make this one a root child. Inline nodes\n      // can't live there (Lexical error #99), so wrap them in their required parent first.\n      const nodeToInsert = this.#insertsIntoRoot(lastNode) ? $makeSafeForRoot(node) : node;\n      lastNode = lastNode.insertAfter(nodeToInsert);\n    }\n  }\n\n  #insertsIntoRoot(node) {\n    return node.is(node.getTopLevelElement())\n  }\n}\n\n// A list item can only hold inline content, so a block node (such as an image\n// attachment) dropped into one corrupts the list: Lexical lifts it into the\n// wrong list item and orphans an empty bullet. Block nodes belong at the top\n// level instead, splitting the list around the cursor. Inline content keeps\n// Lexical's default behavior and stays within the list item.\nclass ListItemNodeInserter extends BaseNodeInserter {\n  static handles(selection) {\n    return $isRangeSelection(selection) &&\n      $getNearestNodeOfType(selection.anchor.getNode(), ListItemNode)\n  }\n\n  insertNodes(nodes) {\n    if (nodes.some(node => this.#isBlockDecorator(node))) {\n      this.#insertAroundList(nodes);\n    } else {\n      this.selection.insertNodes(nodes);\n    }\n  }\n\n  #insertAroundList(nodes) {\n    if (!this.selection.isCollapsed()) { this.selection.removeText(); }\n\n    // Break out of any nesting to the outermost list. Splitting an inner list\n    // would leave the block stranded inside an ancestor list item, which is the\n    // very corruption we are avoiding. The block must land at the list's level.\n    const anchorNode = this.selection.anchor.getNode();\n    const outerList = this.#outermostList(anchorNode);\n\n    // removeText() can relocate the anchor before we read it back \u2014 clean out\n    // of the list when the removed range spanned it. With no list left to\n    // split, default insertion applies.\n    if (!outerList) {\n      this.selection.insertNodes(nodes);\n      return\n    }\n\n    const topItem = this.#topLevelItemFor(anchorNode, outerList);\n    const [ listBefore, listAfter ] = $splitNode(outerList, this.#splitIndexFor(topItem));\n    if (topItem && $isBlankNode(topItem)) { topItem.remove(); }\n\n    let anchor = listBefore ?? listAfter;\n    for (const node of nodes) {\n      anchor.insertAfter(node);\n      anchor = node;\n    }\n\n    this.#removeEmptyList(listBefore);\n    this.#removeEmptyList(listAfter);\n    nodes.at(-1).selectNext();\n  }\n\n  // A blank top-level bullet is just the insertion point (e.g. the user pressed\n  // Enter to leave the list); break out of it entirely. A bullet with content \u2014\n  // including one wrapping a nested list \u2014 splits so its content stays in the\n  // list. With no top-level bullet at all \u2014 removeText() relocated the anchor\n  // onto the list node itself \u2014 the anchor offset is the boundary between items.\n  #splitIndexFor(topItem) {\n    if (!topItem) return this.selection.anchor.offset\n\n    const splitAfterItem = $isBlankNode(topItem) ? topItem.getPreviousSibling() : topItem;\n    return splitAfterItem ? splitAfterItem.getIndexWithinParent() + 1 : 0\n  }\n\n  #outermostList(node) {\n    return [ node, ...node.getParents() ].reverse().find($isListNode)\n  }\n\n  #topLevelItemFor(node, outerList) {\n    return [ node, ...node.getParents() ].find(ancestor =>\n      $isListItemNode(ancestor) && ancestor.getParent()?.is(outerList)\n    )\n  }\n\n  #removeEmptyList(list) {\n    if ($isListNode(list) && list.isEmpty()) list.remove();\n  }\n\n  // Only block decorator nodes (image/file attachments) are intercepted. A list\n  // item cannot hold them, so they must break out. Pasted element blocks\n  // (paragraphs, quotes) keep Lexical's own list-escape semantics.\n  #isBlockDecorator(node) {\n    return $isDecoratorNode(node) && !node.isInline()\n  }\n}\n\n// Lexical's RangeSelection.insertNodes requires every selection point to have a block\n// ancestor with inline children. An element point on a container of block nodes \u2014 e.g.\n// a quote holding paragraphs \u2014 has none, so Lexical throws invariant #211 or #212.\n// Descend such points to a leaf position before inserting.\nclass BlockContainerNodeInserter extends BaseNodeInserter {\n  static handles(selection) {\n    return $hasPointOnBlockContainer(selection)\n  }\n\n  insertNodes(nodes) {\n    $normalizeSelection__EXPERIMENTAL(this.selection);\n    this.selection.insertNodes(nodes);\n  }\n}\n\nconst INSERTERS = [\n  CodeNodeInserter,\n  ShadowRootNodeInserter,\n  NodeSelectionNodeInserter,\n  ListItemNodeInserter,\n  BlockContainerNodeInserter\n];\n\n// Defined here rather than on the base class so the base can stay free of any\n// dependency on its subclasses (they import the base), avoiding an import cycle.\nBaseNodeInserter.for = (selection) => {\n  const inserterClass = INSERTERS.find(inserter => inserter.handles(selection));\n  return inserterClass ? new inserterClass(selection) : selection\n};\n\n// Word and Outlook never emit <ul>/<ol>/<li>. They simulate lists with flat\n// paragraphs that declare their depth in an inline `mso-list:l0 level2 lfo1`\n// and carry the bullet or number glyph in a <span style=\"mso-list:Ignore\">.\n// Nothing downstream understands either, so the items land as plain paragraphs\n// with the marker baked into the text. Rebuild real lists from the level each\n// paragraph declares.\n//\n// Everything this reads lives in inline attributes, so it stays correct after\n// the pasted content formatter has dropped Office's style sheet.\nclass OfficeFormatter {\n  constructor(doc) {\n    this.doc = doc;\n  }\n\n  format() {\n    for (const run of this.#listRuns()) {\n      this.#replaceWithLists(run);\n    }\n  }\n\n  // A run is a stretch of Office list paragraphs that are siblings with nothing\n  // but whitespace and Word's conditional comments between them. Anything else\n  // in between (a heading, a plain paragraph) ends one list and starts another.\n  #listRuns() {\n    const runs = [];\n    const claimed = new Set();\n\n    for (const paragraph of this.doc.querySelectorAll(\"p[style*='mso-list']\")) {\n      if (claimed.has(paragraph) || this.#listLevel(paragraph) === null) continue\n\n      const run = [];\n      let node = paragraph;\n      while (node) {\n        run.push(node);\n        claimed.add(node);\n        node = this.#nextListParagraph(node);\n      }\n      runs.push(run);\n    }\n\n    return runs\n  }\n\n  #nextListParagraph(paragraph) {\n    let sibling = paragraph.nextSibling;\n    while (sibling && this.#isIgnorableBetweenListParagraphs(sibling)) {\n      sibling = sibling.nextSibling;\n    }\n\n    if (sibling && sibling.nodeType === Node.ELEMENT_NODE && this.#listLevel(sibling) !== null) {\n      return sibling\n    }\n\n    return null\n  }\n\n  #isIgnorableBetweenListParagraphs(node) {\n    if (node.nodeType === Node.COMMENT_NODE) {\n      return true\n    }\n    return node.nodeType === Node.TEXT_NODE && node.textContent.trim() === \"\"\n  }\n\n  // Word numbers levels from 1, but a copied selection often starts partway down\n  // a list, so every paragraph declares level3 with no level1 above it. Anchoring\n  // the run at its own shallowest level is what keeps the result from arriving\n  // needlessly deep.\n  #replaceWithLists(paragraphs) {\n    const levels = paragraphs.map((paragraph) => this.#listLevel(paragraph));\n    const baseLevel = Math.min(...levels);\n    const roots = [];\n    const stack = [];\n\n    paragraphs.forEach((paragraph, index) => {\n      const depth = levels[index] - baseLevel + 1;\n      const tagName = this.#listTagName(paragraph);\n\n      while (stack.length > depth) {\n        stack.pop();\n      }\n      if (stack.length === depth && stack[depth - 1].tagName !== tagName.toUpperCase()) {\n        stack.pop();\n      }\n\n      while (stack.length < depth) {\n        const list = this.doc.createElement(tagName);\n        if (stack.length === 0) {\n          roots.push(list);\n        } else {\n          this.#lastItemOf(stack[stack.length - 1]).appendChild(list);\n        }\n        stack.push(list);\n      }\n\n      stack[stack.length - 1].appendChild(this.#createListItem(paragraph));\n    });\n\n    paragraphs[0].replaceWith(...roots);\n    for (const paragraph of paragraphs.slice(1)) {\n      paragraph.remove();\n    }\n  }\n\n  #lastItemOf(list) {\n    if (!list.lastElementChild) {\n      list.appendChild(this.doc.createElement(\"li\"));\n    }\n    return list.lastElementChild\n  }\n\n  // Word writes bullets as the raw glyph of the marker font (Symbol's \"\u00B7\",\n  // Wingdings' \"\u00A7\", Courier New's \"o\") and numbers as the rendered counter\n  // (\"1.\", \"a)\", \"iv)\"). A bare letter with no delimiter after it is Courier\n  // New's bullet, not a counter, so the delimiter is what tells them apart.\n  #listTagName(paragraph) {\n    const marker = paragraph.querySelector(\"[style*='mso-list:Ignore']\");\n    const text = marker?.textContent || \"\";\n\n    if (/\\d/.test(text) || /^\\(?[A-Za-z]+[.)]/.test(text)) {\n      return \"ol\"\n    }\n    return \"ul\"\n  }\n\n  #createListItem(paragraph) {\n    for (const marker of paragraph.querySelectorAll(\"[style*='mso-list:Ignore']\")) {\n      marker.remove();\n    }\n\n    const item = this.doc.createElement(\"li\");\n    item.append(...paragraph.childNodes);\n    return item\n  }\n\n  #listLevel(element) {\n    const match = /mso-list:[^;\"']*\\blevel(\\d+)/.exec(element.getAttribute(\"style\") || \"\");\n    if (match) {\n      return parseInt(match[1], 10)\n    }\n    return null\n  }\n}\n\n// Properties worth rescuing from a foreign style sheet before #stripStyleElements\n// drops it, keyed by the elements that carry them. Word and Outlook declare\n// paragraph spacing in the sheet (p.MsoNormal { margin: 0cm }) and never inline,\n// so once the sheet goes there is nothing left to say how tightly the author's\n// paragraphs sat, and hosts that turn pasted paragraph margins into explicit\n// blank lines read tight Office paragraphs as spaced ones and multiply every\n// line break.\nconst PRESERVABLE_STYLES = {\n  p: [ \"margin-top\", \"margin-bottom\" ]\n};\n\nclass PastedContentFormatter {\n  constructor(doc) {\n    this.doc = doc;\n  }\n\n  format() {\n    this.#inlinePreservableStyles();\n    this.#stripStyleElements();\n    this.#stripInterchangeNewlines();\n    this.#unwrapPlaceholderAnchors();\n    this.#stripTableCellColorStyles();\n    new OfficeFormatter(this.doc).format();\n    this.#unwrapWrappedListChildren();\n    this.#nestStrayListChildren();\n    this.#stripStrayListChildren();\n    this.#replaceGmailEmojiImgTags();\n    return this.doc\n  }\n\n  // Runs before #stripStyleElements, to inline anything we still need\n  // from an external style before we remove it\n  #inlinePreservableStyles() {\n    const rules = this.#styleRules();\n    if (rules.length === 0) return\n\n    for (const [ selector, properties ] of Object.entries(PRESERVABLE_STYLES)) {\n      for (const element of this.doc.querySelectorAll(selector)) {\n        this.#inlineDeclaredStyles(element, properties, rules);\n      }\n    }\n  }\n\n  // Spreadsheets (e.g. Excel) copy a <style> block whose rules (td { color:\n  // black }, .xlNN { ... }) cascade onto the imported text. That color rides\n  // in through the cascade rather than an inline style, so it slips past both\n  // the cell-level stripping below and the paste style canonicalizer, leaving\n  // pasted tables with foreign text colors that don't adapt to the theme. Drop\n  // foreign style sheets so nothing cascades into imported content.\n  #stripStyleElements() {\n    for (const style of this.doc.querySelectorAll(\"style\")) {\n      style.remove();\n    }\n  }\n\n  // Chrome and Safari append <br class=\"Apple-interchange-newline\"> when the\n  // copied selection ends at a line end (Google Docs does this on every copy).\n  // It marks the end of the selection, not a line the author wrote, so left in\n  // place it pastes as an extra empty paragraph. Only the trailing marker goes:\n  // one at the start of the fragment is a real line boundary.\n  #stripInterchangeNewlines() {\n    for (const br of this.doc.querySelectorAll(\"br.Apple-interchange-newline\")) {\n      if (this.#isAtEndOfBody(br)) {\n        br.remove();\n      }\n    }\n  }\n\n  #isAtEndOfBody(node) {\n    for (let current = node; current && current !== this.doc.body; current = current.parentNode) {\n      for (let sibling = current.nextSibling; sibling; sibling = sibling.nextSibling) {\n        if (!this.#isIgnorableTrailingNode(sibling)) return false\n      }\n    }\n    return true\n  }\n\n  #isIgnorableTrailingNode(node) {\n    if (node.nodeType === Node.COMMENT_NODE) {\n      return true\n    }\n    return node.nodeType === Node.TEXT_NODE && node.textContent.trim() === \"\"\n  }\n\n  // Anchors with non-meaningful hrefs (e.g. \"#\", \"\") appear in content copied\n  // from rendered views where mentions and interactive elements are wrapped in\n  // <a href=\"#\"> tags. Unwrap them so their text content pastes as plain text\n  // and real links are preserved.\n  #unwrapPlaceholderAnchors() {\n    for (const anchor of this.doc.querySelectorAll(\"a\")) {\n      const href = anchor.getAttribute(\"href\") || \"\";\n      if (href === \"\" || href === \"#\") {\n        anchor.replaceWith(...anchor.childNodes);\n      }\n    }\n  }\n\n  // Table cells copied from a page inherit the source theme's inline color\n  // styles (e.g. dark-mode backgrounds). Strip them so pasted tables adopt\n  // the current theme instead of carrying stale colors.\n  #stripTableCellColorStyles() {\n    for (const cell of this.doc.querySelectorAll(\"td, th\")) {\n      cell.style.removeProperty(\"background-color\");\n      cell.style.removeProperty(\"background\");\n      cell.style.removeProperty(\"color\");\n    }\n  }\n\n  // Some sources wrap runs of <li>s in a stray element (e.g. a <div> directly\n  // inside the list). Dissolve such wrappers so their items become direct\n  // list children and any nested list they hide becomes visible to\n  // #nestStrayListChildren below.\n  #unwrapWrappedListChildren() {\n    for (const list of this.doc.querySelectorAll(\"ol, ul\")) {\n      let wrapper = this.#wrappedListChild(list);\n      while (wrapper) {\n        wrapper.replaceWith(...wrapper.childNodes);\n        wrapper = this.#wrappedListChild(list);\n      }\n    }\n  }\n\n  #wrappedListChild(list) {\n    for (const child of list.children) {\n      if (child.tagName !== \"LI\" && !this.#isNestedList(child) && this.#containsListItems(child)) {\n        return child\n      }\n    }\n    return null\n  }\n\n  // Some sources (e.g. Gmail) nest a sublist as a direct child of the parent\n  // <ol>/<ul> instead of inside a <li>. Move each nested list into its\n  // preceding <li> so the import preserves the nesting instead of dropping it.\n  #nestStrayListChildren() {\n    for (const list of this.doc.querySelectorAll(\"ol, ul\")) {\n      for (const child of Array.from(list.children)) {\n        if (child.tagName !== \"OL\" && child.tagName !== \"UL\") continue\n\n        const previousItem = child.previousElementSibling;\n        if (previousItem && previousItem.tagName === \"LI\") {\n          previousItem.appendChild(child);\n        }\n      }\n    }\n  }\n\n  // Only <li> is a valid child of a list. Unwrap remaining stray children\n  // that still hold list items (a nested list with no preceding <li> to nest\n  // under) so the items survive, and drop stray <br>/whitespace so the import\n  // doesn't wrap them into an empty leading item.\n  #stripStrayListChildren() {\n    for (const list of this.doc.querySelectorAll(\"ol, ul\")) {\n      let stray = this.#firstStrayListChild(list);\n      while (stray) {\n        if (this.#containsListItems(stray)) {\n          stray.replaceWith(...stray.childNodes);\n        } else {\n          stray.remove();\n        }\n\n        stray = this.#firstStrayListChild(list);\n      }\n    }\n  }\n\n  // Read the rules from a sheet we build rather than from this.doc.styleSheets: the\n  // document came from DOMParser, so it has no browsing context, and WebKit leaves\n  // its styleSheets empty. Parsing the text ourselves still expands the shorthands\n  // Word writes (margin: 0cm) into the longhands we ask for.\n  #styleRules() {\n    const css = Array.from(this.doc.querySelectorAll(\"style\"), (style) => style.textContent).join(\"\\n\");\n    if (css.trim() === \"\") return []\n\n    const sheet = new CSSStyleSheet();\n    sheet.replaceSync(css);\n\n    const rules = [];\n    for (const rule of sheet.cssRules) {\n      if (rule instanceof CSSStyleRule) {\n        rules.push(rule);\n      }\n    }\n    return rules\n  }\n\n  // A declaration the element already carries inline is the author's own and wins.\n  #inlineDeclaredStyles(element, properties, rules) {\n    for (const property of properties) {\n      if (element.style.getPropertyValue(property) === \"\") {\n        const value = this.#declaredValue(rules, element, property);\n        if (value) {\n          this.#appendStyleProperty(element, property, value);\n        }\n      }\n    }\n  }\n\n  // Source order alone doesn't decide the cascade, so when the matching rules\n  // disagree we can't say which value wins without resolving specificity. Skip\n  // the property rather than guess: guessing is permanent, since the sheet is\n  // about to go, and skipping only leaves the host on its own default.\n  #declaredValue(rules, element, property) {\n    const declared = new Set();\n    for (const rule of rules) {\n      const value = rule.style.getPropertyValue(property);\n      if (value !== \"\" && element.matches(rule.selectorText)) {\n        declared.add(value);\n      }\n    }\n\n    if (declared.size === 1) {\n      return declared.values().next().value\n    } else {\n      return null\n    }\n  }\n\n  // Assigning through element.style would reserialize the style attribute and\n  // drop the mso-* declarations Word leaves inline (they aren't valid CSS),\n  // and OfficeFormatter still needs to read mso-list from them. Append to the\n  // attribute instead so the original declarations survive untouched.\n  #appendStyleProperty(element, property, value) {\n    const style = element.getAttribute(\"style\");\n    const declaration = `${property}:${value}`;\n    if (style === null || style.trim() === \"\") {\n      element.setAttribute(\"style\", declaration);\n    } else {\n      element.setAttribute(\"style\", `${style.replace(/;\\s*$/, \"\")};${declaration}`);\n    }\n  }\n\n  #firstStrayListChild(list) {\n    for (const child of list.childNodes) {\n      if (child.nodeType !== Node.ELEMENT_NODE || child.tagName !== \"LI\") {\n        return child\n      }\n    }\n    return null\n  }\n\n  #isNestedList(node) {\n    return node.nodeType === Node.ELEMENT_NODE && (node.tagName === \"OL\" || node.tagName === \"UL\")\n  }\n\n  #containsListItems(node) {\n    return node.nodeType === Node.ELEMENT_NODE && node.querySelector(\"li\") !== null\n  }\n\n  // Emoji in gmail: <img data-emoji=\"\uD83D\uDE02\" class=\"an1\" alt=\"\uD83D\uDE02\" aria-label=\"\uD83D\uDE02\" draggable=\"false\" src=\"https://fonts.gstatic.com/s/e/notoemoji/17.0/1f602/32.png\" loading=\"lazy\" style=\"height: 1.2em; width: 1.2em; vertical-align: middle;\">\n  #replaceGmailEmojiImgTags() {\n    for (const emojiImg of this.doc.querySelectorAll(\"img[data-emoji]\")) {\n      const emoji = emojiImg.dataset.emoji;\n      if (emoji === emojiImg.alt) {\n        emojiImg.replaceWith(emoji);\n      }\n    }\n  }\n}\n\nclass Contents {\n  constructor(editorElement) {\n    this.editorElement = editorElement;\n    this.editor = editorElement.editor;\n  }\n\n  dispose() {\n    this.editorElement = null;\n    this.editor = null;\n  }\n\n  get selection() { return this.editorElement.selection }\n\n  insertHtml(html, { tag } = {}) {\n    this.insertDOM(parseHtml(html), { tag });\n  }\n\n  insertDOM(doc, { tag } = {}) {\n    this.editor.update(() => {\n      if ($hasUpdateTag(PASTE_TAG)) this.#formatPastedDOM(doc);\n\n      const nodes = this.editorElement.$generateNodesFromDOM(doc);\n\n      if (!$hasUpdateTag(PASTE_TAG) || !this.#dispatchPastedNodesCommand(nodes)) {\n        this.#insertUploadNodes(nodes) || this.insertAtCursor(...nodes);\n      }\n    }, { tag });\n  }\n\n  insertText(text, { tag } = {}) {\n    this.editor.update(() => {\n      const paragraph = $createParagraphNode();\n      text.split(/\\r\\n|\\r|\\n/).forEach((line, index) => {\n        if (index > 0) paragraph.append($createLineBreakNode());\n        paragraph.append($createTextNode(line));\n      });\n      this.insertAtCursor(paragraph);\n    }, { tag });\n  }\n\n  insertAtCursor(...nodes) {\n    const selection = this.#insertableSelection();\n    const inserter = BaseNodeInserter.for(selection);\n\n    inserter.insertNodes(nodes);\n  }\n\n  applyParagraphFormat() {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) return\n\n    $expandSelectionToLineBreaksAndSplitAtEdges(selection, (node) => $getNearestBlockElementAncestorOrThrow(node));\n    $setBlocksType(selection, () => $createParagraphNode());\n  }\n\n  applyHeadingFormat(tag) {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) return\n\n    $expandSelectionToLineBreaksAndSplitAtEdges(selection);\n    $setBlocksType(selection, () => $createHeadingNode(tag));\n  }\n\n  applyUnorderedListFormat() {\n    this.#applyListFormat(\"bullet\", INSERT_UNORDERED_LIST_COMMAND);\n  }\n\n  applyOrderedListFormat() {\n    this.#applyListFormat(\"number\", INSERT_ORDERED_LIST_COMMAND);\n  }\n\n  clearFormatting() {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) return\n\n    $forEachSelectedTextNode(node => {\n      node.setFormat(0);\n      node.setStyle(\"\");\n    });\n\n    $toggleLink(null);\n\n    this.#topLevelElementsInSelection(selection).filter($isQuoteNode).forEach(node => this.#unwrap(node));\n\n    $setBlocksType(selection, () => $createParagraphNode());\n  }\n\n  toggleCodeBlock() {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) return\n\n    if (this.#insertNodeIfRoot($createCodeNode(\"plain\"))) return\n\n    const blockElements = this.#blockLevelElementsInSelection(selection);\n    const allCode = blockElements.every($isCodeNode);\n\n    if (allCode) {\n      blockElements.forEach(node => this.#unwrapCodeBlock(node));\n    } else {\n      $expandSelectionToLineBreaksAndSplitAtEdges(selection);\n      const elements = this.#outermostElements(this.#blockLevelElementsInSelection(selection));\n      if (elements.length === 0) return\n\n      const codeNode = $createCodeNode(\"plain\");\n      elements.at(-1).insertAfter(codeNode);\n      codeNode.selectEnd();\n      this.insertAtCursor(...elements);\n    }\n  }\n\n  toggleBlockquote() {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) return\n\n    if (this.#insertNodeIfRoot($createQuoteNode())) return\n\n    const topLevelElements = this.#topLevelElementsInSelection(selection);\n\n    const allQuoted = topLevelElements.length > 0 && topLevelElements.every($isQuoteNode);\n\n    if (allQuoted) {\n      topLevelElements.forEach(node => this.#unwrap(node));\n    } else {\n      topLevelElements.filter($isQuoteNode).forEach(node => this.#unwrap(node));\n\n       $expandSelectionToLineBreaksAndSplitAtEdges(selection);\n      const elements = this.#topLevelElementsInSelection(selection);\n      if (elements.length === 0) return\n\n      const blockquote = $createQuoteNode();\n      elements[0].insertBefore(blockquote);\n      elements.forEach((element) => blockquote.append(element));\n    }\n  }\n\n  hasSelectedText() {\n    let result = false;\n\n    this.editor.read(() => {\n      const selection = $getSelection();\n      result = $isRangeSelection(selection) && !selection.isCollapsed();\n    });\n\n    return result\n  }\n\n  createLink(url) {\n    let linkNodeKey = null;\n\n    this.editor.update(() => {\n      const textNode = $createTextNode(url);\n      const linkNode = $createLinkNode(url);\n      linkNode.append(textNode);\n\n      const selection = $getSelection();\n      if ($isRangeSelection(selection)) {\n        BaseNodeInserter.for(selection).insertNodes([ linkNode ]);\n        linkNodeKey = linkNode.getKey();\n      }\n    });\n\n    return linkNodeKey\n  }\n\n  createLinkWithSelectedText(url) {\n    if (!this.hasSelectedText()) return\n\n    this.editor.update(() => {\n      $toggleLink(null);\n      $toggleLink(url);\n    });\n  }\n\n  textBackUntil(string) {\n    let result = \"\";\n\n    this.editor.getEditorState().read(() => {\n      const selection = $getSelection();\n      if (!selection || !selection.isCollapsed()) return\n\n      const anchor = selection.anchor;\n      const anchorNode = anchor.getNode();\n\n      if (!$isTextNode(anchorNode)) return\n\n      const fullText = anchorNode.getTextContent();\n      const offset = anchor.offset;\n\n      const lastIndex = fullText.slice(0, offset).lastIndexOf(string);\n      if (lastIndex !== -1) {\n        result = fullText.slice(lastIndex + string.length, this.#endOffsetAt(fullText, offset));\n      }\n    });\n\n    return result\n  }\n\n  // The query runs from the trigger up to the next boundary, even when the\n  // cursor sits inside an existing word \u2014 inserting \"@\" before \"Jack\" must\n  // filter by \"Jack\" rather than treating the prompt as empty.\n  #endOffsetAt(fullText, cursorOffset) {\n    for (let offset = cursorOffset; offset < fullText.length; offset++) {\n      if (this.#isQueryBoundary(fullText, offset)) {\n        return offset\n      }\n    }\n\n    return fullText.length\n  }\n\n  // Whitespace always ends the query. Punctuation ends it too: with \"@\" typed\n  // right before a period, extending across it would glue \".\" onto everything\n  // typed (\"B\" would query \"B.\"), matching the wrong names or nothing at all.\n  // But punctuation joining two word characters is part of a name \u2014 \"@\" before\n  // \"Anne-Marie\" or \"O'Connor\" must keep the whole name as the query.\n  #isQueryBoundary(fullText, offset) {\n    const character = fullText[offset];\n    if (/\\s/.test(character)) return true\n    if (!/\\p{P}/u.test(character)) return false\n\n    return !(this.#isWordCharacter(fullText[offset - 1]) && this.#isWordCharacter(fullText[offset + 1]))\n  }\n\n  #isWordCharacter(character) {\n    return character != null && /[\\p{L}\\p{N}]/u.test(character)\n  }\n\n  containsTextBackUntil(string) {\n    let result = false;\n\n    this.editor.getEditorState().read(() => {\n      const selection = $getSelection();\n      if (!selection || !selection.isCollapsed()) return\n\n      const anchor = selection.anchor;\n      const anchorNode = anchor.getNode();\n\n      if (!$isTextNode(anchorNode)) return\n\n      const fullText = anchorNode.getTextContent();\n      const offset = anchor.offset;\n\n      const textBeforeCursor = fullText.slice(0, offset);\n\n      result = textBeforeCursor.includes(string);\n    });\n\n    return result\n  }\n\n  replaceTextBackUntil(stringToReplace, replacementNodes) {\n    replacementNodes = Array.isArray(replacementNodes) ? replacementNodes : [ replacementNodes ];\n\n    const { anchorNode, offset } = this.#getTextAnchorData();\n    if (!anchorNode) return\n\n    const lastIndex = this.#findReplacementStart(anchorNode, offset, stringToReplace);\n    if (lastIndex === -1) return\n\n    this.#performTextReplacement(anchorNode, lastIndex, stringToReplace, replacementNodes);\n  }\n\n  uploadFiles(files, { selectLast, altText } = {}) {\n    if (!this.editorElement) return // Disposed (e.g. on turbo:before-cache); a late drop can still land here\n\n    if (!this.editorElement.supportsAttachments) {\n      console.warn(\"This editor does not supports attachments (it's configured with [attachments=false])\");\n      return\n    }\n    const validFiles = Array.from(files).filter(file => this.editorElement.acceptsFile(file));\n\n    this.editor.update(() => {\n      const uploader = Uploader.for(this.editorElement, validFiles);\n      uploader.$uploadFiles();\n\n      if (altText && files.length === 1 && uploader.nodes.length === 1) {\n        uploader.nodes[0].getWritable().altText = altText;\n      }\n\n      if (selectLast && uploader.nodes?.length) {\n        const lastNode = uploader.nodes.at(-1);\n        lastNode.selectEnd();\n        this.#normalizeSelectionInShadowRoot();\n      }\n    });\n  }\n\n  $createUploadNode(file) {\n    return $createActionTextAttachmentUploadNode({\n      file,\n      uploadUrl: this.editorElement.directUploadUrl,\n      blobUrlTemplate: this.editorElement.blobUrlTemplate,\n      contentType: file.type,\n    })\n  }\n\n  $createPendingUploadNode(file) {\n    return $createActionTextAttachmentUploadNode({\n      file,\n      uploadUrl: null,\n      blobUrlTemplate: this.editorElement.blobUrlTemplate,\n      contentType: file.type,\n    })\n  }\n\n  insertPendingAttachment(file) {\n    if (!this.editorElement.supportsAttachments) return null\n\n    let nodeKey = null;\n    this.editor.update(() => {\n      const uploadNode = this.$createPendingUploadNode(file);\n      this.insertAtCursor(uploadNode);\n      nodeKey = uploadNode.getKey();\n    });\n\n    return nodeKey ? this.#pendingAttachmentHandle(nodeKey) : null\n  }\n\n  insertPendingAttachments(files) {\n    const fileList = Array.from(files);\n    if (!this.editorElement.supportsAttachments || fileList.length === 0) return []\n\n    let nodeKeys = [];\n    this.editor.update(() => {\n      const uploader = Uploader.for(this.editorElement, fileList, { pending: true });\n      uploader.$uploadFiles();\n      nodeKeys = (uploader.nodes ?? []).map(node => node.getKey());\n    });\n\n    return nodeKeys.map(nodeKey => this.#pendingAttachmentHandle(nodeKey))\n  }\n\n  #pendingAttachmentHandle(initialNodeKey) {\n    const editor = this.editor;\n    let nodeKey = initialNodeKey;\n\n    return {\n      setAttributes(blob) {\n        editor.update(() => {\n          const node = $getNodeByKey(nodeKey);\n          if (!(node instanceof ActionTextAttachmentUploadNode)) return\n\n          const replacementNodeKey = node.$showUploadedAttachment(blob);\n          if (replacementNodeKey) {\n            nodeKey = replacementNodeKey;\n          }\n        }, { tag: HISTORY_MERGE_TAG });\n      },\n      setUploadProgress(progress) {\n        editor.update(() => {\n          const node = $getNodeByKey(nodeKey);\n          if (!(node instanceof ActionTextAttachmentUploadNode)) return\n\n          node.getWritable().progress = progress;\n        }, { tag: HISTORY_MERGE_TAG });\n      },\n      remove() {\n        editor.update(() => {\n          const node = $getNodeByKey(nodeKey);\n          if (node) node.remove();\n        });\n      }\n    }\n  }\n\n  replaceNodeWithHTML(nodeKey, html, options = {}) {\n    this.editor.update(() => {\n      const node = $getNodeByKey(nodeKey);\n      if (!node) return\n\n      const selection = $getSelection();\n      let wasSelected = false;\n\n      if ($isRangeSelection(selection)) {\n        const selectedNodes = selection.getNodes();\n        wasSelected = selectedNodes.includes(node) || selectedNodes.some(n => n.getParent() === node);\n\n        if (wasSelected) {\n          $setSelection(null);\n        }\n      }\n\n      const replacementNode = options.attachment ? this.#createCustomAttachmentNodeWithHtml(html, options.attachment) : this.#createHtmlNodeWith(html);\n      node.replace(replacementNode);\n\n      if (wasSelected) {\n        replacementNode.selectEnd();\n      }\n    });\n  }\n\n  insertHTMLBelowNode(nodeKey, html, options = {}) {\n    this.editor.update(() => {\n      const node = $getNodeByKey(nodeKey);\n      if (!node) return\n\n      const previousNode = node.getTopLevelElement() || node;\n\n      const newNode = options.attachment ? this.#createCustomAttachmentNodeWithHtml(html, options.attachment) : this.#createHtmlNodeWith(html);\n      previousNode.insertAfter(newNode);\n    });\n  }\n\n  #insertableSelection() {\n    const selection = $getSelection();\n    if ($isNodeSelection(selection) && selection.getNodes().length === 0) {\n      return $getRoot().selectEnd()\n    }\n\n    return selection ?? $getRoot().selectEnd()\n  }\n\n  #formatPastedDOM(doc) {\n    new PastedContentFormatter(doc).format();\n  }\n\n  #dispatchPastedNodesCommand(nodes) {\n    return this.editor.dispatchCommand(SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, {\n      nodes, selection: $getSelection()\n    })\n  }\n\n  #insertNodeIfRoot(node) {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) return false\n\n    const anchorNode = selection.anchor.getNode();\n    if ($isRootOrShadowRoot(anchorNode)) {\n      anchorNode.append(node);\n      node.selectEnd();\n\n      return true\n    }\n\n    return false\n  }\n\n  #unwrapCodeBlock(codeNode) {\n    const children = codeNode.getChildren();\n    const groups = [ [] ];\n\n    for (const child of children) {\n      if ($isLineBreakNode(child)) {\n        groups.push([]);\n      } else {\n        groups[groups.length - 1].push(child.getTextContent());\n      }\n    }\n\n    for (const group of groups) {\n      const paragraph = $createParagraphNode();\n      const text = group.join(\"\");\n      if (text) {\n        paragraph.append($createTextNode(text));\n      }\n      codeNode.insertBefore(paragraph);\n    }\n\n    codeNode.remove();\n  }\n\n  #applyListFormat(listType, command) {\n    if (this.selection.isInsideBlockQuote) {\n      this.#insertListInsideQuote(listType);\n    } else {\n      this.#splitParagraphsAtLineBreaksUnlessInsideList();\n      this.editor.dispatchCommand(command);\n    }\n  }\n\n  #insertListInsideQuote(listType) {\n    for (const group of $consecutiveSiblingGroups(this.#quotedBlocksInSelection())) {\n      this.#wrapBlocksInList(group, listType);\n    }\n  }\n\n  #quotedBlocksInSelection() {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) return []\n\n    const blocks = this.#outermostElements(this.#blockLevelElementsInSelection(selection));\n    return blocks.filter((block) => $isQuoteNode(block.getParent()))\n  }\n\n  #wrapBlocksInList(blocks, listType) {\n    const list = $createListNode(listType);\n    blocks[0].insertBefore(list);\n\n    for (const block of blocks) {\n      const listItem = $createListItemNode();\n      if ($isListNode(block)) {\n        listItem.append(...block.getChildren().flatMap((item) => item.getChildren()));\n      } else {\n        listItem.append(...block.getChildren());\n      }\n      list.append(listItem);\n      block.remove();\n    }\n  }\n\n  #splitParagraphsAtLineBreaksUnlessInsideList() {\n    if (this.selection.isInsideList) return\n\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) return\n\n    $expandSelectionToLineBreaksAndSplitAtEdges(selection);\n    $splitSelectedParagraphsAtInnerLineBreaks(selection);\n  }\n\n  #blockLevelElementsInSelection(selection) {\n    const blocks = new Set();\n    for (const node of selection.getNodes()) {\n      blocks.add($getNearestBlockElementAncestorOrThrow(node));\n    }\n\n    return Array.from(blocks)\n  }\n\n  #topLevelElementsInSelection(selection) {\n    const elements = new Set();\n    for (const node of selection.getNodes()) {\n      const topLevel = node.getTopLevelElement();\n      if (topLevel) elements.add(topLevel);\n    }\n    return Array.from(elements)\n  }\n\n  // Selections spanning nested structures (a quote and its inner paragraphs,\n  // nested list items) yield both an element and its ancestor. Converting the\n  // ancestor detaches its whole subtree \u2014 including a node freshly inserted\n  // inside it \u2014 which can leave the selection on removed nodes (Lexical\n  // invariant #19). The outermost elements already cover their descendants'\n  // text content, so keep only those.\n  #outermostElements(elements) {\n    return elements.filter((element) => {\n      return elements.every((other) => other === element || !element.getParents().includes(other))\n    })\n  }\n\n  #insertUploadNodes(nodes) {\n    if (nodes.every($isActionTextAttachmentNode)) {\n      const uploader = Uploader.for(this.editorElement, []);\n      uploader.nodes = nodes;\n      uploader.$insertUploadNodes();\n      return true\n    }\n  }\n\n  #unwrap(node) {\n    const children = node.getChildren();\n\n    if (children.length == 0) {\n      node.insertBefore($createParagraphNode());\n    } else {\n      children.forEach((child) => {\n        if ($isTextNode(child) && child.getTextContent().trim() !== \"\") {\n          const newParagraph = $createParagraphNode();\n          newParagraph.append(child);\n          node.insertBefore(newParagraph);\n        } else if (!$isLineBreakNode(child)) {\n          node.insertBefore(child);\n        }\n      });\n    }\n\n    node.remove();\n  }\n\n  #getTextAnchorData() {\n    const selection = $getSelection();\n    if (!selection || !selection.isCollapsed()) return { anchorNode: null, offset: 0 }\n\n    const anchor = selection.anchor;\n    const anchorNode = anchor.getNode();\n\n    if (!$isTextNode(anchorNode)) return { anchorNode: null, offset: 0 }\n\n    return { anchorNode, offset: anchor.offset }\n  }\n\n  // The replaced span must start before the cursor but can extend past it\n  // (e.g. \"@Jack\" when \"@\" was just inserted before \"Jack\"), so we bound the\n  // match's start with lastIndexOf's fromIndex rather than slicing the text.\n  #findReplacementStart(anchorNode, offset, stringToReplace) {\n    if (offset === 0) {\n      // A negative fromIndex clamps to 0 and could match at the cursor\n      return -1\n    } else {\n      return anchorNode.getTextContent().lastIndexOf(stringToReplace, offset - 1)\n    }\n  }\n\n  #performTextReplacement(anchorNode, startIndex, stringToReplace, replacementNodes) {\n    const fullText = anchorNode.getTextContent();\n    const textBeforeString = fullText.slice(0, startIndex);\n    const textAfterString = fullText.slice(startIndex + stringToReplace.length);\n\n    const textNodeBefore = this.#cloneTextNodeFormatting(anchorNode, textBeforeString);\n    const textNodeAfter = this.#cloneTextNodeFormatting(anchorNode, textAfterString || \" \");\n\n    anchorNode.replace(textNodeBefore);\n\n    const lastInsertedNode = this.#insertReplacementNodes(textNodeBefore, replacementNodes);\n    lastInsertedNode.insertAfter(textNodeAfter);\n\n    this.#appendLineBreakIfNeeded(textNodeAfter.getParentOrThrow());\n    const cursorOffset = textAfterString ? 0 : 1;\n    textNodeAfter.select(cursorOffset, cursorOffset);\n  }\n\n  #cloneTextNodeFormatting(anchorNode, text) {\n    return $createTextNode(text)\n      .setFormat(anchorNode.getFormat())\n      .setDetail(anchorNode.getDetail())\n      .setMode(anchorNode.getMode())\n      .setStyle(anchorNode.getStyle())\n  }\n\n  #insertReplacementNodes(startNode, replacementNodes) {\n    let previousNode = startNode;\n    for (const node of replacementNodes) {\n      previousNode.insertAfter(node);\n      previousNode = node;\n    }\n    return previousNode\n  }\n\n  #appendLineBreakIfNeeded(paragraph) {\n    if ($isParagraphNode(paragraph) && this.editorElement.supportsMultiLine) {\n      const children = paragraph.getChildren();\n      const last = children[children.length - 1];\n      const beforeLast = children[children.length - 2];\n\n      if ($isTextNode(last) && last.getTextContent() === \"\" && (beforeLast && !$isTextNode(beforeLast))) {\n        paragraph.append($createLineBreakNode());\n      }\n    }\n  }\n\n  #createCustomAttachmentNodeWithHtml(html, options = {}) {\n    const attachmentConfig = typeof options === \"object\" ? options : {};\n    const contentType = attachmentConfig.contentType || \"text/html\";\n    if (!this.editorElement.permitsAttachmentContentType(contentType)) {\n      return this.#createHtmlNodeWith(html)\n    }\n    return new CustomActionTextAttachmentNode({\n      sgid: attachmentConfig.sgid || null,\n      contentType,\n      innerHtml: html,\n    })\n  }\n\n  #createHtmlNodeWith(html) {\n    const htmlNodes = this.editorElement.$generateNodesFromDOM(parseHtml(html));\n    return htmlNodes[0] || $createParagraphNode()\n  }\n\n  // When the selection anchor is on a shadow root (e.g. a table cell), Lexical's\n  // insertNodes can't find a block parent and fails silently. Normalize the\n  // selection to point inside the shadow root's content instead.\n  #normalizeSelectionInShadowRoot() {\n    const selection = $getSelection();\n    if (!$isRangeSelection(selection)) return\n\n    const anchorNode = selection.anchor.getNode();\n    if (!$isShadowRoot(anchorNode)) return\n\n    // Append a paragraph inside the shadow root so there's a valid text-level\n    // target for subsequent insertions. This is necessary because decorator\n    // nodes (e.g. attachments) at the end of a table cell leave the selection\n    // on the cell itself with no block-level descendant to anchor to.\n    const paragraph = $createParagraphNode();\n    anchorNode.append(paragraph);\n    paragraph.selectStart();\n  }\n}\n\nfunction parsePastedMarkdown(text) {\n  return pasteMarked.parse(text)\n}\n\n// A marked instance scoped to the paste flow. A fresh Marked starts from\n// marked's stock defaults \u2014 gfm stays on and tables still parse \u2014 and is\n// isolated from the global `marked` singleton, so a host bundle sharing the\n// deduped module can't leak `marked.use(...)` customizations into pasting.\n// The additions are breaks: true, matching the render pass Clipboard always\n// used, the `html` renderer, and the dropped `code` tokenizer.\n//\n// Markdown reads any line indented by a tab or four spaces as a code block. Pasted\n// plain text is full of incidental indentation \u2014 outlines, notes, logs \u2014 and nobody\n// indents a note meaning \"this is code\"; they fence it. Keep fences, drop the\n// indentation rule.\n//\n// Following CommonMark, marked tokenizes a bare \"<tag>\" in prose as raw inline\n// (or block) HTML. That is intentional for recognized tags \u2014 pasted plain text\n// carrying <span style>, <mark>, <b>\u2026 is styled on import \u2014 but for an\n// *unrecognized* element the Lexical importer has no converter and silently\n// unwraps it, dropping the tag. WEBVTT speaker cues such as\n// \"<v Nabila Abdel Nabi>\", where the name lives in what the HTML parser reads\n// as attributes, thus vanish entirely.\n//\n// Classifying at marked's html renderer rides its public token grammar instead\n// of shadowing it: marked routes code (`code`/`codespan`), autolinks and\n// [text](<dest>) links to *other* token types that never reach this renderer,\n// so their literal \"<...>\" content is preserved for free \u2014 no pre-escaping,\n// code-region collection, or lexer-option syncing required. This renderer fires\n// only for genuine raw-HTML tokens, and marked inserts its return value verbatim\n// (it does not re-encode), so we escape unsupported tags to literal text here.\nconst pasteMarked = new Marked({\n  breaks: true,\n  renderer: { html: renderPastedHtmlToken }\n}).use({ tokenizer: { code: () => undefined } });\n\n// Matches a single HTML tag lexeme: an optional \"/\", a tag name, then attribute\n// characters up to the closing \">\". Quoted attribute values may contain \">\" \u2014\n// the HTML tokenizer consumes them as part of the value, and marked's tag\n// grammar matches them into the same raw token \u2014 so the attribute run matches\n// quoted strings whole. Otherwise a lexeme like <v title=\"a > b\"> would end at\n// the inner \">\", escaping only the prefix and leaving the tail for DOMParser\n// to decode.\nconst HTML_TAG_LEXEME = /<(\\/?)([a-zA-Z][a-zA-Z0-9-]*)((?:\"[^\"]*\"|'[^']*'|[^'\">])*)>/g;\n\n// Escape unknown tags *within* the raw-HTML token, keeping known tags intact.\n// Lexeme-level (not whole-token) escaping matters because marked can emit a\n// single coarse block-HTML token whose first tag is known but which nests an\n// unknown one \u2014 e.g. \"<div><v Name> Hello</div>\" arrives as one token. We keep\n// the <div> so it still renders, and escape the nested <v Name> so it survives\n// as literal text rather than being unwrapped and dropped by the importer.\nfunction renderPastedHtmlToken(token) {\n  return token.text.replace(HTML_TAG_LEXEME, (lexeme, _slash, name) => {\n    return isSupportedHtmlElement(name) ? lexeme : escapeHtml(lexeme)\n  })\n}\n\n// The renderer's output is final, so escape the full lexeme \u2014 \"&\", \"<\" and \">\" \u2014\n// for an exact round-trip (e.g. \"<v A&nbsp;B>\" \u2192 \"&lt;v A&amp;nbsp;B&gt;\").\nfunction escapeHtml(text) {\n  return text.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").replace(/>/g, \"&gt;\")\n}\n\n// \"Supported\" \u2014 safe to pass through for the importer to handle \u2014 is decided from\n// the element taxonomy, not the importer's converter registry. The importer both\n// converts tags it has a converter for (span\u2192mark, b\u2192bold, tr/td\u2192table cells) and\n// transparently traverses standard structural wrappers it has *no* converter for\n// (thead, tbody, tfoot, colgroup, caption), keeping their children. A converter\n// registry (editor._htmlConversions) lists only the former, so classifying by it\n// escaped those wrappers to literal text and corrupted pasted tables \u2014 foster\n// parenting hoisted \"&lt;thead&gt;\u2026\" out as a stray paragraph. The taxonomy covers\n// both: a standard HTML element is either converted or losslessly unwrapped.\n//\n// Two exclusions escape the tag to literal text instead:\n//   - Invented tags (WEBVTT's \"<v Nabila Abdel Nabi>\", \"<foo>\"): document\n//     .createElement returns HTMLUnknownElement. The importer would unwrap them,\n//     dropping the tag \u2014 and for <v Name> the name lives in what parses as\n//     attributes, so it vanishes entirely.\n//   - Custom elements (turbo-frame, bc-attachment, action-text-attachment): a\n//     hyphenated name is a custom element (HTML spec; no standard element has a\n//     hyphen). They're excluded even when the importer registers a converter, so\n//     a plain-text paste can never materialize an attachment/widget. Legitimate\n//     attachments arrive through the rich-HTML paste path, not here.\nfunction isSupportedHtmlElement(name) {\n  const tag = name.toLowerCase();\n  return !(document.createElement(tag) instanceof HTMLUnknownElement) && !tag.includes(\"-\")\n}\n\nclass Clipboard {\n  #listeners = new ListenerBin()\n\n  constructor(editorElement) {\n    this.editorElement = editorElement;\n    this.editor = editorElement.editor;\n    this.contents = editorElement.contents;\n\n    this.#registerPasteCommands();\n  }\n\n  dispose() {\n    this.editorElement = null;\n    this.editor = null;\n    this.contents = null;\n\n    this.#listeners.dispose();\n  }\n\n  paste(event) {\n    const clipboardData = event.clipboardData;\n\n    if (!clipboardData) return false\n\n    if (this.#isPastingIntoCodeBlock()) {\n      this.#pastePlainTextIntoCodeBlock(clipboardData);\n      event.preventDefault();\n      return true\n    }\n\n    if (this.#isPlainTextOrURLPasted(clipboardData)) {\n      this.#pastePlainTextOrURL(clipboardData);\n      event.preventDefault();\n      return true\n    }\n\n    const handled = this.#handlePastedFiles(clipboardData);\n    if (handled) event.preventDefault();\n    return handled\n  }\n\n  #registerPasteCommands() {\n    this.#listeners.track(\n      this.editor.registerCommand(PASTE_COMMAND, this.paste.bind(this), COMMAND_PRIORITY_NORMAL),\n      this.editor.registerCommand(\n        SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,\n        (payload) => this.#handleParsedClipboardNodes(payload),\n        COMMAND_PRIORITY_NORMAL\n      )\n    );\n  }\n\n  #handleParsedClipboardNodes({ nodes, selection }) {\n    const url = $bareUrlFromSingleLink(nodes);\n    if (url && $isRangeSelection(selection)) {\n      this.#insertSingleLinkAt(selection, url);\n      return true\n    }\n  }\n\n  #isPlainTextOrURLPasted(clipboardData) {\n    return this.#isOnlyPlainTextPasted(clipboardData) || this.#isOnlyURLPasted(clipboardData)\n  }\n\n  #isOnlyPlainTextPasted(clipboardData) {\n    const types = Array.from(clipboardData.types);\n    return types.length === 1 && types[0] === \"text/plain\"\n  }\n\n  // Browsers expose a copied URL in several shapes:\n  //   Safari          [ text/plain, text/uri-list ]\n  //   App ShareSheet  [ text/uri-list ]\n  //   Chromium macOS  [ text/plain, text/html, (?:text/link-preview) ]\n  #isOnlyURLPasted(clipboardData) {\n    if (this.#isLexicalClipboardData(clipboardData)) return false\n\n    const types = Array.from(clipboardData.types);\n    if (types.includes(\"text/uri-list\")) {\n      return types.every(type => type === \"text/plain\" || type === \"text/uri-list\")\n    }\n\n    if (clipboardData.files.length) return false\n\n    const text = clipboardData.getData(\"text/plain\").trim();\n    if (!isAutolinkableURL(text)) return false\n\n    const html = clipboardData.getData(\"text/html\");\n    return !html || this.#htmlIsBareLinkToURL(html, text)\n  }\n\n  #htmlIsBareLinkToURL(html, url) {\n    const doc = parseHtml(html);\n    if (doc.body.textContent.trim() !== url) return false\n\n    const links = doc.body.querySelectorAll(\"a\");\n    if (links.length === 0) return true\n    return links.length === 1 && links[0].getAttribute(\"href\") === url\n  }\n\n  #isPastingIntoCodeBlock() {\n    let result = false;\n\n    this.editor.getEditorState().read(() => {\n      const selection = $getSelection();\n      if (!$isRangeSelection(selection)) return\n\n      let currentNode = selection.anchor.getNode();\n\n      while (currentNode) {\n        if ($isCodeNode(currentNode)) {\n          result = true;\n          return\n        }\n        currentNode = currentNode.getParent();\n      }\n    });\n\n    return result\n  }\n\n  #pastePlainTextIntoCodeBlock(clipboardData) {\n    const text = clipboardData.getData(\"text/plain\");\n    if (!text) return\n\n    this.editor.update(() => {\n      const selection = $getSelection();\n      if ($isRangeSelection(selection)) selection.insertRawText(text);\n    }, { tag: PASTE_TAG });\n  }\n\n  #pastePlainTextOrURL(clipboardData) {\n    const item = this.#plainTextOrURLItem(clipboardData);\n    item.getAsString((text) => {\n      const url = text.trim();\n      if (isAutolinkableURL(url)) {\n        this.#pasteURL(url);\n      } else if (this.editorElement.supportsMarkdown) {\n        this.#pasteMarkdown(text);\n      } else {\n        this.#pasteRichText(clipboardData);\n      }\n    });\n  }\n\n  #plainTextOrURLItem(clipboardData) {\n    const items = Array.from(clipboardData.items);\n    return items.find((item) => item.type === \"text/plain\") || items.find((item) => item.type === \"text/uri-list\")\n  }\n\n  #pasteURL(url) {\n    if (this.contents.hasSelectedText()) {\n      this.contents.createLinkWithSelectedText(url);\n    } else {\n      const nodeKey = this.contents.createLink(url);\n      this.#dispatchLinkInsertEvent(nodeKey, { url });\n    }\n  }\n\n  #insertSingleLinkAt(selection, url) {\n    if (!$isRangeSelection(selection)) return\n\n    if (!selection.isCollapsed()) {\n      $toggleLink(null);\n      $toggleLink(url);\n      return\n    }\n\n    const linkNode = $createLinkNode(url).append($createTextNode(url));\n    BaseNodeInserter.for(selection).insertNodes([ linkNode ]);\n\n    $onUpdate(() => this.#dispatchLinkInsertEvent(linkNode.getKey(), { url }));\n  }\n\n  #dispatchLinkInsertEvent(nodeKey, payload) {\n    const linkManipulationMethods = {\n      replaceLinkWith: (html, options) => this.contents.replaceNodeWithHTML(nodeKey, html, options),\n      insertBelowLink: (html, options) => this.contents.insertHTMLBelowNode(nodeKey, html, options)\n    };\n\n    dispatch(this.editorElement, \"lexxy:insert-link\", {\n      ...payload,\n      ...linkManipulationMethods\n    });\n  }\n\n  #pasteMarkdown(text) {\n    const html = parsePastedMarkdown(text);\n    const doc = parseHtml(html);\n\n    if (this.#isPlainTextWithoutMarkdown(doc)) {\n      this.contents.insertText(text, { tag: PASTE_TAG });\n    } else {\n      const detail = Object.freeze({\n        markdown: text,\n        document: doc,\n        addBlockSpacing: () => addBlockSpacing(doc)\n      });\n\n      dispatch(this.editorElement, \"lexxy:insert-markdown\", detail);\n      this.contents.insertDOM(doc, { tag: PASTE_TAG });\n    }\n  }\n\n  // Markdown conversion collapses runs of whitespace and unescapes backslashes,\n  // silently corrupting plain text such as Windows/UNC file paths. When the text\n  // carries no Markdown structure, paste it verbatim instead. A path that wrapped\n  // across lines renders as a single paragraph with <br> line breaks (marked runs\n  // with breaks: true), which is still plain text we should preserve untouched.\n  #isPlainTextWithoutMarkdown(doc) {\n    const elements = Array.from(doc.body.children);\n    if (elements.length !== 1) return false\n\n    const paragraph = elements[0];\n    return paragraph.nodeName === \"P\"\n      && Array.from(paragraph.childNodes).every((node) => node.nodeType === Node.TEXT_NODE || node.nodeName === \"BR\")\n  }\n\n  #pasteRichText(clipboardData) {\n    this.editor.update(() => {\n      const selection = $getSelection();\n      $insertDataTransferForRichText(clipboardData, selection, this.editor);\n    }, { tag: PASTE_TAG });\n  }\n\n  #handlePastedFiles(clipboardData) {\n    if (this.editorElement.supportsAttachments) {\n      const html = clipboardData.getData(\"text/html\");\n      const files = clipboardData.files;\n      const copiedImage = files.length && this.#copiedImage(html);\n\n      if (copiedImage) {\n        this.#uploadFilesPreservingScroll(files, copiedImage.getAttribute(\"alt\"));\n        return true\n      } else if (html && !this.#isLexicalClipboardData(clipboardData)) {\n        this.contents.insertHtml(html, { tag: PASTE_TAG });\n        return true\n      } else if (files.length) {\n        this.#uploadFilesPreservingScroll(files);\n        return true\n      } else {\n        return false\n      }\n    } else {\n      return false\n    }\n  }\n\n  #isLexicalClipboardData(clipboardData) {\n    return Array.from(clipboardData.types).includes(\"application/x-lexical-editor\")\n  }\n\n  #copiedImage(html) {\n    if (html) {\n      const doc = parseHtml(html);\n      const elementChildren = Array.from(doc.body.children);\n\n      if (elementChildren.length === 1 && elementChildren[0].tagName === \"IMG\") {\n        return elementChildren[0]\n      } else {\n        return null\n      }\n    } else {\n      return null\n    }\n  }\n\n  #uploadFilesPreservingScroll(files, altText) {\n    this.#preservingScrollPosition(() => {\n      if (files.length) {\n        this.contents.uploadFiles(files, { selectLast: true, altText });\n      }\n    });\n  }\n\n  // Deals with an issue in Safari where it scrolls to the tops after pasting attachments\n  async #preservingScrollPosition(callback) {\n    const scrollY = window.scrollY;\n    const scrollX = window.scrollX;\n\n    callback();\n\n    await nextFrame();\n\n    window.scrollTo(scrollX, scrollY);\n    this.editor.focus();\n  }\n}\n\nfunction $bareUrlFromSingleLink(nodes) {\n  if (nodes.length !== 1) return null\n\n  const node = nodes[0];\n  if ($isLinkNode(node)) return $bareUrlFromLink(node)\n\n  if ($isParagraphNode(node)) {\n    const children = node.getChildren();\n    if (children.length === 1 && $isLinkNode(children[0])) {\n      return $bareUrlFromLink(children[0])\n    }\n  }\n\n  return null\n}\n\nfunction $bareUrlFromLink(linkNode) {\n  const url = linkNode.getURL();\n  if (!url) return null\n  return linkNode.getTextContent() === url ? url : null\n}\n\nclass Extensions {\n\n  constructor(lexxyElement) {\n    this.lexxyElement = lexxyElement;\n\n    this.enabledExtensions = this.#initializeExtensions();\n  }\n\n  get lexicalExtensions() {\n    return this.enabledExtensions.map(ext => ext.lexicalExtension).filter(Boolean)\n  }\n\n  initializeToolbars() {\n    const toolbar = this.#lexxyToolbar;\n    if (!toolbar) return\n\n    this.#clearPreviousExtensionToolbarButtons(toolbar);\n    this.#addExtensionToolbarButtons(toolbar);\n    toolbar.requestOverflowRefresh();\n  }\n\n  dispose() {\n    while (this.enabledExtensions.length) {\n      this.enabledExtensions.pop().dispose();\n    }\n  }\n\n  #clearPreviousExtensionToolbarButtons(toolbar) {\n    toolbar.querySelectorAll(\"[data-lexxy-extension]\").forEach(el => el.remove());\n  }\n\n  #addExtensionToolbarButtons(toolbar) {\n    this.enabledExtensions.forEach(ext => {\n      const childrenBefore = new Set(toolbar.children);\n      ext.initializeToolbar(toolbar);\n      for (const child of toolbar.children) {\n        if (!childrenBefore.has(child)) {\n          child.setAttribute(\"data-lexxy-extension\", \"\");\n        }\n      }\n    });\n  }\n\n  get allowedElements() {\n    return this.enabledExtensions.flatMap(ext => ext.allowedElements)\n  }\n\n  get #lexxyToolbar() {\n    return this.lexxyElement.toolbar\n  }\n\n  get #baseExtensions() {\n    return this.lexxyElement.baseExtensions\n  }\n\n  get #configuredExtensions() {\n    return Lexxy.global.get(\"extensions\")\n  }\n\n  #initializeExtensions() {\n    const extensionDefinitions = this.#baseExtensions.concat(this.#configuredExtensions);\n\n    return extensionDefinitions.map(\n      extension => new extension(this.lexxyElement)\n    ).filter(extension => extension.enabled)\n  }\n}\n\nclass BrowserAdapter {\n  frozenLinkKey = null\n\n  dispatchAttributesChange(attributes, linkHref, highlight, headingTag) {}\n  dispatchEditorInitialized(detail) {}\n  freeze() {}\n  thaw() {}\n  unlinkFrozenNode() {\n    return false\n  }\n}\n\n// The code retokenizer only knows CodeHighlightNode, LineBreakNode and\n// TabNode, so a LinkNode inside a code block \u2014 Trix-authored documents allow\n// links in code \u2014 is destroyed on the first retokenization. Links survive as\n// state on the tokens instead: this state records the link attributes on each\n// CodeHighlightNode the link covers, the extraction below reads it (or a\n// still-untokenized LinkNode) back into ranges before every retokenization,\n// and the tokenizer reapplies it to the fresh tokens.\nconst codeLinkState = createState(\"codeLink\", {\n  parse: (value) => (value && typeof value.url === \"string\" ? value : null)\n});\n\nfunction $getCodeLink(node) {\n  return $getState(node, codeLinkState)\n}\n\nfunction $setCodeLink(node, link) {\n  $setState(node, codeLinkState, link);\n}\n\n// Build the list of { start, end, link } ranges covering every link in a code\n// block, with offsets into the block's text content. Links appear either as\n// LinkNode descendants (imported or just created, before their first\n// retokenization) or as link state on tokens (after it). The walk recurses\n// through nested elements because `<pre><code>` imports of multi-line content\n// briefly produce a CodeNode nested inside another before the outer one's\n// retokenization flattens them.\nfunction $extractLinkRangesFromCodeNode(codeNode) {\n  const ranges = [];\n  let offset = 0;\n\n  function walk(node) {\n    for (const child of node.getChildren()) {\n      if ($isLinkNode(child)) {\n        const size = child.getTextContent().length;\n        appendRange(ranges, { start: offset, end: offset + size, link: linkAttributesFrom(child) });\n        offset += size;\n      } else if ($isElementNode(child)) {\n        walk(child);\n      } else {\n        const size = child.getTextContent().length;\n        if ($isTextNode(child)) {\n          const link = $getCodeLink(child);\n          if (link) {\n            appendRange(ranges, { start: offset, end: offset + size, link });\n          }\n        }\n        offset += size;\n      }\n    }\n  }\n\n  walk(codeNode);\n\n  return ranges\n}\n\nfunction $applyLinkRangesToTokens(tokens, ranges) {\n  if (ranges.length === 0) return tokens\n\n  const linkedTokens = [];\n  let offset = 0;\n\n  for (const token of tokens) {\n    if ($isCodeHighlightNode(token)) {\n      linkedTokens.push(...$splitTokenAtLinkBoundaries(token, offset, ranges));\n    } else {\n      linkedTokens.push(token);\n    }\n    offset += token.getTextContentSize();\n  }\n\n  return linkedTokens\n}\n\nfunction $splitTokenAtLinkBoundaries(token, tokenStart, ranges) {\n  const text = token.getTextContent();\n  const segments = segmentTextByRanges(text, tokenStart, ranges);\n\n  if (segments.length === 1) {\n    const [ segment ] = segments;\n    if (segment.range) {\n      $setCodeLink(token, segment.range.link);\n    }\n    return [ token ]\n  } else {\n    return segments.map((segment) => {\n      const segmentToken = $cloneTokenSlice(token, text.slice(segment.start, segment.end));\n      if (segment.range) {\n        $setCodeLink(segmentToken, segment.range.link);\n      }\n      return segmentToken\n    })\n  }\n}\n\nfunction $cloneTokenSlice(token, text) {\n  const segmentToken = $createCodeHighlightNode(text, token.getHighlightType());\n  segmentToken.setStyle(token.getStyle());\n  // CodeHighlightNode.setFormat is a no-op, so carry the format over directly\n  segmentToken.getWritable().__format = token.getFormat();\n  return segmentToken\n}\n\n// Consecutive children carrying the same link merge into a single range, so a\n// link split across tokens by an earlier retokenization keeps covering fresh\n// tokens as one contiguous stretch however they retokenize.\nfunction appendRange(ranges, range) {\n  const previous = ranges[ranges.length - 1];\n\n  if (previous && previous.end === range.start && sameLink(previous.link, range.link)) {\n    previous.end = range.end;\n  } else {\n    ranges.push(range);\n  }\n}\n\nfunction sameLink(a, b) {\n  return a.url === b.url && a.target === b.target && a.rel === b.rel && a.title === b.title\n}\n\nfunction linkAttributesFrom(linkNode) {\n  const link = { url: linkNode.getURL() };\n  if (linkNode.getTarget()) link.target = linkNode.getTarget();\n  if (linkNode.getRel()) link.rel = linkNode.getRel();\n  if (linkNode.getTitle()) link.title = linkNode.getTitle();\n  return link\n}\n\n// Custom TextNode exportDOM that avoids redundant wrapping.\n//\n// Lexical's built-in TextNode.exportDOM() calls createDOM() which produces semantic tags\n// like <strong> for bold and <em> for italic, then unconditionally wraps the result\n// with presentational tags (<b>, <i>) for the same formats. This produces redundant markup\n// like <b><strong>text</strong></b>.\n//\n// This custom export skips <b> when <strong> is already present and <i> when <em> is\n// already present, while preserving <s> and <u> wrappers which have no semantic equivalents\n// in createDOM's output.\n//\n// Any <span> elements produced by createDOM() are unwrapped, since they only carry\n// editor classes that aren't meaningful in exported HTML.\n\n// A CodeHighlightNode exports like any other text node, plus an <a> wrapper\n// when it carries link state \u2014 that's how a link survives inside a code\n// block, whose retokenizer would destroy an actual LinkNode child.\nfunction exportCodeHighlightNodeDOM(editor, codeHighlightNode) {\n  const output = exportTextNodeDOM(editor, codeHighlightNode);\n  const link = $getCodeLink(codeHighlightNode);\n\n  if (link) {\n    return { element: wrapWithAnchor(output.element, link) }\n  } else {\n    return output\n  }\n}\n\nfunction wrapWithAnchor(element, link) {\n  const anchor = document.createElement(\"a\");\n  anchor.setAttribute(\"href\", link.url);\n  if (link.target) anchor.setAttribute(\"target\", link.target);\n  if (link.rel) anchor.setAttribute(\"rel\", link.rel);\n  if (link.title) anchor.setAttribute(\"title\", link.title);\n  anchor.appendChild(element);\n  return anchor\n}\n\nfunction exportTextNodeDOM(editor, textNode) {\n  const element = textNode.createDOM(editor._config, editor);\n  element.style.whiteSpace = \"pre-wrap\";\n\n  if (textNode.hasFormat(\"lowercase\")) {\n    element.style.textTransform = \"lowercase\";\n  } else if (textNode.hasFormat(\"uppercase\")) {\n    element.style.textTransform = \"uppercase\";\n  } else if (textNode.hasFormat(\"capitalize\")) {\n    element.style.textTransform = \"capitalize\";\n  }\n\n  let result = element;\n\n  if (textNode.hasFormat(\"bold\") && !containsTag(element, \"strong\")) {\n    result = wrapWith(result, \"b\");\n  }\n  if (textNode.hasFormat(\"italic\") && !containsTag(element, \"em\")) {\n    result = wrapWith(result, \"i\");\n  }\n  if (textNode.hasFormat(\"strikethrough\")) {\n    result = wrapWith(result, \"s\");\n  }\n  if (textNode.hasFormat(\"underline\")) {\n    result = wrapWith(result, \"u\");\n  }\n\n  return { element: unwrapSpans(result) }\n}\n\nfunction containsTag(element, tagName) {\n  const upperTag = tagName.toUpperCase();\n  if (element.tagName === upperTag) return true\n\n  return element.querySelector(tagName) !== null\n}\n\nfunction wrapWith(element, tag) {\n  const wrapper = document.createElement(tag);\n  wrapper.appendChild(element);\n  return wrapper\n}\n\nfunction unwrapSpans(element) {\n  if (element.tagName === \"SPAN\") return element.firstChild\n\n  for (const span of element.querySelectorAll(\"span\")) {\n    span.replaceWith(...span.childNodes);\n  }\n\n  return element\n}\n\nclass ProvisionalParagraphNode extends ParagraphNode {\n  $config() {\n    return this.config(\"provisonal_paragraph\", {\n      extends: ParagraphNode,\n      importDOM: () => null,\n      $transform: (node) => {\n        node.concretizeIfEdited(node);\n        node.removeUnlessRequired(node);\n      }\n    })\n  }\n\n  static neededBetween(nodeBefore, nodeAfter) {\n    return !$isSelectableElement(nodeBefore, \"next\")\n      && !$isSelectableElement(nodeAfter, \"previous\")\n  }\n\n  createDOM(editor) {\n    const p = super.createDOM(editor);\n    const selected = this.isSelected($getSelection());\n    p.classList.add(\"provisional-paragraph\");\n    p.classList.toggle(\"hidden\", !selected);\n    return p\n  }\n\n  updateDOM(_prevNode, dom) {\n    const selected = this.isSelected($getSelection());\n    dom.classList.toggle(\"hidden\", !selected);\n    return false\n  }\n\n  getTextContent() {\n    return \"\"\n  }\n\n  exportDOM() {\n    return {\n      element: null\n    }\n  }\n\n  // override as Lexical has an interesting view of collapsed selection in ElementNodes\n  // https://github.com/facebook/lexical/blob/f1e4f66014377b1f2595aec2b0ee17f5b7ef4dfc/packages/lexical/src/LexicalNode.ts#L646\n  isSelected(selection = null) {\n    const targetSelection = selection || $getSelection();\n    if (!targetSelection) return false\n\n    if (targetSelection.getNodes().some(node => node.is(this) || this.isParentOf(node))) return true\n\n    // A collapsed range selection on the parent element at an offset adjacent to\n    // this node means the caret is visually at this paragraph's position. Treat it\n    // as selected so the paragraph is visible and the caret renders correctly.\n    //\n    // Both the offset matching our index (cursor just before us) and index + 1\n    // (cursor just after us) count, because the provisional paragraph is an\n    // invisible spacer: the browser resolves both offsets to the same visual spot.\n    if ($isRangeSelection(targetSelection) && targetSelection.isCollapsed()) {\n      const { anchor } = targetSelection;\n      const parent = this.getParent();\n      if (parent && anchor.getNode().is(parent) && anchor.type === \"element\") {\n        const index = this.getIndexWithinParent();\n        return anchor.offset === index || anchor.offset === index + 1\n      }\n    }\n\n    return false\n  }\n\n  removeUnlessRequired(self = this.getLatest()) {\n    if (!self.required) self.remove();\n  }\n\n  concretizeIfEdited(self = this.getLatest()) {\n    if (self.getTextContentSize() > 0) {\n      self.replace($createParagraphNode(), true);\n    }\n  }\n\n\n  get required() {\n    return this.isDirectRootChild && ProvisionalParagraphNode.neededBetween(...this.immediateSiblings)\n  }\n\n  get isDirectRootChild() {\n    const parent = this.getParent();\n    return $isRootOrShadowRoot(parent)\n  }\n\n  get immediateSiblings() {\n    return [ this.getPreviousSibling(), this.getNextSibling() ]\n  }\n}\n\nfunction $isProvisionalParagraphNode(node) {\n  return node instanceof ProvisionalParagraphNode\n}\n\nfunction $isSelectableElement(node, direction) {\n  return $isElementNode(node) && (direction === \"next\" ? node.canInsertTextBefore() : node.canInsertTextAfter())\n}\n\nclass ProvisionalParagraphExtension extends LexxyExtension {\n  get lexicalExtension() {\n    return defineExtension({\n      name: \"lexxy/provisional-paragraph\",\n      nodes: [\n        ProvisionalParagraphNode\n      ],\n      register(editor) {\n        return mergeRegister(\n          // Process Provisional Paragraph Nodes on RootNode changes as sibling status influences whether\n          // they are required and their visible/hidden status\n          editor.registerNodeTransform(RootNode, $insertRequiredProvisionalParagraphs),\n          editor.registerNodeTransform(RootNode, $removeUnneededProvisionalParagraphs),\n          editor.registerCommand(SELECTION_CHANGE_COMMAND, $markAllProvisionalParagraphsDirty, COMMAND_PRIORITY_HIGH)\n        )\n      }\n    })\n  }\n}\n\nfunction $insertRequiredProvisionalParagraphs(rootNode) {\n  const nodeBeforeRootSelection = $nodeBeforeRootSelection(rootNode);\n\n  const firstNode = rootNode.getFirstChild();\n  if (ProvisionalParagraphNode.neededBetween(null, firstNode)) {\n    $insertFirst(rootNode, new ProvisionalParagraphNode);\n  }\n\n  for (const node of $firstToLastIterator(rootNode)) {\n    const nextNode = node.getNextSibling();\n    if (ProvisionalParagraphNode.neededBetween(node, nextNode)) {\n      node.insertAfter(new ProvisionalParagraphNode);\n      if (node.is(nodeBeforeRootSelection)) node.selectNext();\n    }\n  }\n}\n\nfunction $nodeBeforeRootSelection(rootNode) {\n  const selection = $getSelection();\n  if (!$isRootOrShadowRoot(selection?.anchor?.getNode())) return null\n\n  return rootNode.getChildAtIndex(selection.anchor.offset - 1)\n}\n\nfunction $removeUnneededProvisionalParagraphs(rootNode) {\n  for (const provisionalParagraph of $getAllProvisionalParagraphs(rootNode)) {\n    provisionalParagraph.removeUnlessRequired();\n  }\n}\n\nfunction $markAllProvisionalParagraphsDirty() {\n  // Selection-driven visibility updates must not become standalone undo steps.\n  $addUpdateTag(HISTORY_MERGE_TAG);\n\n  for (const provisionalParagraph of $getAllProvisionalParagraphs()) {\n    provisionalParagraph.markDirty();\n  }\n}\n\nfunction $getAllProvisionalParagraphs(rootNode = $getRoot()) {\n  return $descendantsMatching(rootNode.getChildren(), $isProvisionalParagraphNode)\n}\n\n// Registers code highlighting through the extension system so its node\n// transforms exist before the initial editor state is applied. Registering\n// after editor creation misses code blocks loaded from the initial value:\n// their transform pass has already run, and Lexical's catch-up dirtying\n// only sees the committed (still empty) state.\nclass CodeHighlightingExtension extends LexxyExtension {\n  get enabled() {\n    return this.editorElement.supportsRichText\n  }\n\n  get lexicalExtension() {\n    return defineExtension({\n      name: \"lexxy/code-highlighting\",\n      register(editor) {\n        return registerCodeHighlighting(editor, buildMarkupPreservingTokenizer(editor))\n      }\n    })\n  }\n}\n\n// The code retokenizer replaces a code block's children with freshly created\n// tokens that carry no styles or links, which would drop color highlights and\n// hyperlinks on every edit. This tokenizer wraps the stock Prism tokenizer to\n// restore both: it recovers the block's highlight and link ranges \u2014 staged\n// during HTML import, or read from the children the fresh tokens are about to\n// replace \u2014 and reapplies them to the fresh tokens before the retokenizer\n// splices them in.\nfunction buildMarkupPreservingTokenizer(editor) {\n  return {\n    defaultLanguage: PrismTokenizer.defaultLanguage,\n    tokenize(code, language) {\n      return PrismTokenizer.tokenize(code, language)\n    },\n    $tokenize(codeNode, language) {\n      const linkRanges = $extractLinkRangesFromCodeNode(codeNode);\n      const highlightRanges = $takeHighlightRanges(editor, codeNode);\n      const tokens = PrismTokenizer.$tokenize(codeNode, language);\n      return $applyLinkRangesToTokens($applyHighlightRangesToTokens(tokens, highlightRanges), linkRanges)\n    }\n  }\n}\n\nconst TRIX_LANGUAGE_ATTR = \"language\";\n\nclass TrixContentExtension extends LexxyExtension {\n\n  get enabled() {\n    return this.editorElement.supportsRichText\n  }\n\n  get lexicalExtension() {\n    return defineExtension({\n      name: \"lexxy/trix-content\",\n      html: {\n        import: {\n          em: (element) => onlyStyledElements(element, {\n            conversion: extendTextNodeConversion(\"i\", $applyHighlightStyle),\n            priority: 1\n          }),\n          span: (element) => onlyStyledElements(element, {\n            conversion: extendTextNodeConversion(\"span\", $applyHighlightStyle),\n            priority: 1\n          }),\n          strong: (element) => onlyStyledElements(element, {\n            conversion: extendTextNodeConversion(\"b\", $applyHighlightStyle),\n            priority: 1\n          }),\n          del: () => ({\n            conversion: extendTextNodeConversion(\"s\", $applyStrikethrough, $applyHighlightStyle),\n            priority: 1\n          }),\n          pre: (element) => onlyPreLanguageElements(element, {\n            conversion: extendConversion(CodeNode, \"pre\", $applyLanguage),\n            priority: 1\n          })\n        }\n      }\n    })\n  }\n}\n\nfunction onlyStyledElements(element, conversion) {\n  const elementHighlighted = element.style.color !== \"\" || element.style.backgroundColor !== \"\";\n  return elementHighlighted ? conversion : null\n}\n\nfunction $applyStrikethrough(textNode) {\n  if (!textNode.hasFormat(\"strikethrough\")) textNode.toggleFormat(\"strikethrough\");\n  return textNode\n}\n\nfunction onlyPreLanguageElements(element, conversion) {\n  return element.hasAttribute(TRIX_LANGUAGE_ATTR) ? conversion : null\n}\n\nfunction $applyLanguage(conversionOutput, element) {\n  const language = normalizeCodeLang(element.getAttribute(TRIX_LANGUAGE_ATTR));\n  conversionOutput.node.setLanguage(language);\n}\n\nclass WrappedTableNode extends TableNode {\n  $config() {\n    return this.config(\"wrapped_table_node\", { extends: TableNode })\n  }\n\n  static importDOM() {\n    return super.importDOM()\n  }\n\n  canInsertTextBefore() {\n    return false\n  }\n\n  canInsertTextAfter() {\n    return false\n  }\n\n  exportDOM(editor) {\n    const superExport = super.exportDOM(editor);\n\n    return {\n      ...superExport,\n      after: (tableElement) => {\n        if (superExport.after) {\n          tableElement = superExport.after(tableElement);\n          const clonedTable = tableElement.cloneNode(true);\n          const wrappedTable = createElement(\"figure\", { className: \"lexxy-content__table-wrapper\" }, clonedTable.outerHTML);\n          return wrappedTable\n        }\n\n        return tableElement\n      }\n    }\n  }\n}\n\nclass TablesExtension extends LexxyExtension {\n\n  get enabled() {\n    return this.editorElement.supportsRichText\n  }\n\n  get allowedElements() {\n    return [ \"figure\", \"tbody\" ]\n  }\n\n  get lexicalExtension() {\n    return defineExtension({\n      name: \"lexxy/tables\",\n      nodes: [\n        WrappedTableNode,\n        {\n          replace: TableNode,\n          with: () => new WrappedTableNode(),\n          withKlass: WrappedTableNode\n        },\n        TableCellNode,\n        TableRowNode\n      ],\n      register(editor) {\n        setScrollableTablesActive(editor, true);\n\n        return mergeRegister(\n          registerTablePlugin(editor),\n\n          // Lexxy registers extensions before setRootElement(), but table\n          // drag-selection needs a root before wiring its pointer handlers.\n          editor.registerRootListener((rootElement) => {\n            if (rootElement) {\n              return registerTableSelectionObserver(editor, true)\n            }\n          }),\n\n          // A table in Lexxy is a Lexxy table: cell shading can't be set in the\n          // editor, so any cell background only ever comes from foreign content\n          // (pasted spreadsheets, loaded documents). Normalize every cell to no\n          // background so it adopts the current theme. This also clears\n          // Lexical's hardcoded default header background (Lexical #8089).\n          editor.registerNodeTransform(TableCellNode, (node) => {\n            if (node.getBackgroundColor() !== \"\") {\n              node.setBackgroundColor(\"\");\n            }\n          }),\n\n          // Bug fix: Fix column header states (Lexical #8090)\n          editor.registerNodeTransform(TableCellNode, (node) => {\n            const headerState = node.getHeaderStyles();\n\n            if (headerState !== TableCellHeaderStates.ROW) return\n\n            const rowParent = node.getParent();\n            const tableNode = rowParent?.getParent();\n            if (!tableNode) return\n\n            const rows = tableNode.getChildren();\n            const cellIndex = rowParent.getChildren().indexOf(node);\n\n            const cellsInRow = rowParent.getChildren();\n            const isHeaderRow = cellsInRow.every(cell =>\n              cell.getHeaderStyles() !== TableCellHeaderStates.NO_STATUS\n            );\n\n            const isHeaderColumn = rows.every(row => {\n              const cell = row.getChildren()[cellIndex];\n              return cell && cell.getHeaderStyles() !== TableCellHeaderStates.NO_STATUS\n            });\n\n            let newHeaderState = TableCellHeaderStates.NO_STATUS;\n\n            if (isHeaderRow) newHeaderState |= TableCellHeaderStates.ROW;\n            if (isHeaderColumn) newHeaderState |= TableCellHeaderStates.COLUMN;\n\n            if (newHeaderState !== headerState) {\n              node.setHeaderStyles(newHeaderState, TableCellHeaderStates.BOTH);\n            }\n          }),\n\n          editor.registerCommand(\"insertTableRowAfter\", () => {\n            $insertTableRowAtSelection(true);\n          }, COMMAND_PRIORITY_NORMAL),\n\n          editor.registerCommand(\"insertTableRowBefore\", () => {\n            $insertTableRowAtSelection(false);\n          }, COMMAND_PRIORITY_NORMAL),\n\n          editor.registerCommand(\"insertTableColumnAfter\", () => {\n            $insertTableColumnAtSelection(true);\n          }, COMMAND_PRIORITY_NORMAL),\n\n          editor.registerCommand(\"insertTableColumnBefore\", () => {\n            $insertTableColumnAtSelection(false);\n          }, COMMAND_PRIORITY_NORMAL),\n\n          editor.registerCommand(\"deleteTableRow\", () => {\n            $deleteTableRowAtSelection();\n          }, COMMAND_PRIORITY_NORMAL),\n\n          editor.registerCommand(\"deleteTableColumn\", () => {\n            $deleteTableColumnAtSelection();\n          }, COMMAND_PRIORITY_NORMAL),\n\n          editor.registerCommand(\"deleteTable\", () => {\n            const selection = $getSelection();\n            if (!$isRangeSelection(selection)) return false\n            $findTableNode(selection.anchor.getNode())?.remove();\n          }, COMMAND_PRIORITY_NORMAL)\n        )\n      }\n    })\n  }\n}\n\nconst MIME_TYPE$1 = \"application/x-lexxy-node-key\";\n\nclass AttachmentDragAndDrop {\n  #editor\n  #draggedNodeKey = null\n  #rafId = null\n  #draggingRafId = null\n  #listeners = new ListenerBin()\n\n  constructor(editor) {\n    this.#editor = editor;\n\n    // Register Lexical commands at HIGH priority to intercept before the\n    // base @lexical/rich-text handlers (which return true and consume the events).\n    this.#listeners.track(\n      editor.registerCommand(DRAGSTART_COMMAND, (event) => this.#handleDragStart(event), COMMAND_PRIORITY_HIGH),\n      editor.registerCommand(DROP_COMMAND, (event) => this.#handleDrop(event), COMMAND_PRIORITY_HIGH),\n    );\n\n    // Use a root listener to register DOM-level dragover/dragend handlers\n    // (these events need throttled rAF handling that works better as DOM listeners).\n    this.#listeners.track(editor.registerRootListener((root, prevRoot) => {\n      if (prevRoot) {\n        prevRoot.removeEventListener(\"dragover\", this.#onDragOver);\n        prevRoot.removeEventListener(\"dragend\", this.#onDragEnd);\n      }\n      if (root) {\n        root.addEventListener(\"dragover\", this.#onDragOver);\n        root.addEventListener(\"dragend\", this.#onDragEnd);\n      }\n    }));\n  }\n\n  destroy() {\n    this.#cleanup();\n    this.#listeners.dispose();\n  }\n\n  // -- Event handlers --------------------------------------------------------\n\n  #handleDragStart(event) {\n    if (event.target.closest?.(\"textarea\")) return false\n\n    const figure = event.target.closest?.(\"figure.attachment[data-lexical-node-key]\");\n    if (!figure) return false\n\n    this.#draggedNodeKey = figure.dataset.lexicalNodeKey;\n    event.dataTransfer.setData(MIME_TYPE$1, this.#draggedNodeKey);\n    event.dataTransfer.effectAllowed = \"move\";\n\n    // Add dragging class after a tick so it doesn't affect the drag image\n    this.#draggingRafId = requestAnimationFrame(() => {\n      this.#draggingRafId = null;\n      figure.classList.add(\"lexxy-dragging\");\n    });\n\n    return true\n  }\n\n  #onDragOver = (event) => {\n    if (!this.#draggedNodeKey) return\n\n    event.preventDefault();\n    event.dataTransfer.dropEffect = \"move\";\n\n    if (!this.#rafId) {\n      this.#rafId = requestAnimationFrame(() => {\n        this.#rafId = null;\n        this.#updateDropTarget(event);\n      });\n    }\n  }\n\n  #handleDrop(event) {\n    if (!this.#draggedNodeKey) return false\n\n    event.preventDefault();\n\n    const target = this.#resolveDropTarget(event);\n    const draggedKey = this.#draggedNodeKey;\n    this.#cleanup();\n\n    if (target) {\n      this.#performDrop(draggedKey, target);\n    }\n    return true\n  }\n\n  #onDragEnd = () => {\n    this.#cleanup();\n  }\n\n  // -- Drop target resolution -----------------------------------------------\n\n  #updateDropTarget(event) {\n    this.#clearDropIndicators();\n\n    const target = this.#resolveDropTarget(event);\n    if (!target) return\n\n    if (target.type === \"gallery\" || target.type === \"gallery-reorder\") {\n      target.element.classList.add(`lexxy-drop-target--gallery-${target.position}`);\n    } else if (target.type === \"list-item\") {\n      target.element.classList.add(`lexxy-drop-target--list-${target.position}`);\n    } else {\n      target.element.classList.add(`lexxy-drop-target--block-${target.position}`);\n    }\n  }\n\n  #resolveDropTarget(event) {\n    const element = document.elementFromPoint(event.clientX, event.clientY);\n    if (!element) return null\n\n    const rootElement = this.#editor.getRootElement();\n    if (!rootElement || !rootElement.contains(element)) return null\n\n    // Check if hovering over a previewable image (for gallery merge or reorder)\n    const targetFigure = element.closest(\"figure.attachment--preview[data-lexical-node-key]\");\n    if (targetFigure && targetFigure.dataset.lexicalNodeKey !== this.#draggedNodeKey) {\n      const targetGallery = targetFigure.closest(\".attachment-gallery\");\n      if (targetGallery) {\n        // If the dragged image is in the same gallery, this is a reorder\n        const draggedFigure = rootElement.querySelector(`[data-lexical-node-key=\"${this.#draggedNodeKey}\"]`);\n        if (draggedFigure && targetGallery.contains(draggedFigure)) {\n          const position = this.#computeHorizontalPosition(targetFigure, event.clientX);\n          return { type: \"gallery-reorder\", element: targetFigure, nodeKey: targetFigure.dataset.lexicalNodeKey, position }\n        }\n      }\n      const position = this.#computeHorizontalPosition(targetFigure, event.clientX);\n      return { type: \"gallery\", element: targetFigure, nodeKey: targetFigure.dataset.lexicalNodeKey, position }\n    }\n\n    // Hovering over the dragged image itself inside a gallery \u2014 treat as no-op\n    // to prevent fallthrough to the block handler, which would eject it from the gallery.\n    if (targetFigure && targetFigure.closest(\".attachment-gallery\")) return null\n\n    // Check if hovering over a gallery's empty space (for reorder within gallery)\n    const targetGallery = element.closest(\".attachment-gallery\");\n    if (targetGallery) {\n      let galleryFigure = element.closest(\"figure.attachment[data-lexical-node-key]\");\n      if (!galleryFigure) {\n        galleryFigure = this.#findNearestFigureInGallery(targetGallery, event.clientX);\n      }\n      if (galleryFigure && galleryFigure.dataset.lexicalNodeKey !== this.#draggedNodeKey) {\n        const position = this.#computeHorizontalPosition(galleryFigure, event.clientX);\n        return { type: \"gallery-reorder\", element: galleryFigure, nodeKey: galleryFigure.dataset.lexicalNodeKey, position }\n      }\n      // Nearest figure is the dragged image \u2014 no-op to avoid block handler fallthrough\n      if (galleryFigure) return null\n    }\n\n    // Check if hovering over a list item (for list splitting)\n    const listItem = element.closest(\"li\");\n    if (listItem && rootElement.contains(listItem)) {\n      const position = this.#computeVerticalPosition(listItem, event.clientY);\n      return { type: \"list-item\", element: listItem, position }\n    }\n\n    // Otherwise, find nearest block-level element for between-block insertion.\n    // Normalize so each gap has exactly one indicator: prefer \"after\" on the\n    // previous sibling, falling back to \"before\" only for the first block.\n    const block = this.#findNearestBlock(element, rootElement, event.clientY);\n    if (!block) return null\n\n    const position = this.#computeVerticalPosition(block, event.clientY);\n    if (position === \"before\" && block.previousElementSibling) {\n      return { type: \"block\", element: block.previousElementSibling, position: \"after\" }\n    }\n    return { type: \"block\", element: block, position }\n  }\n\n  #findNearestBlock(element, rootElement, clientY) {\n    let current = element;\n    while (current && current !== rootElement) {\n      if (current.parentElement === rootElement) return current\n      current = current.parentElement;\n    }\n\n    // elementFromPoint landed on the root itself (e.g. a margin gap between\n    // blocks). Fall back to the nearest child by vertical distance.\n    let nearest = null;\n    let minDistance = Infinity;\n    for (const child of rootElement.children) {\n      const rect = child.getBoundingClientRect();\n      const distance = Math.min(Math.abs(clientY - rect.top), Math.abs(clientY - rect.bottom));\n      if (distance < minDistance) {\n        minDistance = distance;\n        nearest = child;\n      }\n    }\n    return nearest\n  }\n\n  #computeVerticalPosition(element, clientY) {\n    const rect = element.getBoundingClientRect();\n    return clientY < rect.top + rect.height / 2 ? \"before\" : \"after\"\n  }\n\n  #computeHorizontalPosition(element, clientX) {\n    const rect = element.getBoundingClientRect();\n    return clientX < rect.left + rect.width / 2 ? \"before\" : \"after\"\n  }\n\n  #findNearestFigureInGallery(gallery, clientX) {\n    const figures = gallery.querySelectorAll(\"figure.attachment[data-lexical-node-key]\");\n    let nearest = null;\n    let minDistance = Infinity;\n    for (const figure of figures) {\n      const rect = figure.getBoundingClientRect();\n      const center = rect.left + rect.width / 2;\n      const distance = Math.abs(clientX - center);\n      if (distance < minDistance) {\n        minDistance = distance;\n        nearest = figure;\n      }\n    }\n    return nearest\n  }\n\n  // -- Drop indicator --------------------------------------------------------\n\n  static #DROP_CLASSES = [\n    \"lexxy-drop-target--gallery-before\", \"lexxy-drop-target--gallery-after\",\n    \"lexxy-drop-target--list-before\", \"lexxy-drop-target--list-after\",\n    \"lexxy-drop-target--block-before\", \"lexxy-drop-target--block-after\",\n  ]\n\n  #clearDropIndicators() {\n    const rootElement = this.#editor.getRootElement();\n    if (!rootElement) return\n\n    for (const el of rootElement.querySelectorAll(\"[class*='lexxy-drop-target--']\")) {\n      el.classList.remove(...AttachmentDragAndDrop.#DROP_CLASSES);\n    }\n  }\n\n  // -- Node operations -------------------------------------------------------\n\n  #performDrop(draggedKey, target) {\n    const draggedNode = $getNodeByKey(draggedKey);\n    if (!draggedNode || !$isActionTextAttachmentNode(draggedNode)) return\n\n    if (target.type === \"gallery\") {\n      this.#dropOntoImage(draggedNode, target.nodeKey, target.position);\n    } else if (target.type === \"gallery-reorder\") {\n      this.#reorderInGallery(draggedNode, target.nodeKey, target.position);\n    } else if (target.type === \"list-item\") {\n      this.#dropIntoList(draggedNode, target);\n    } else {\n      this.#dropBetweenBlocks(draggedNode, target);\n    }\n\n    // Clear selection to prevent a second history entry. Lexical dispatches\n    // SELECTION_CHANGE_COMMAND during commit for non-range selections, which\n    // creates a separate update. Null selection avoids that dispatch entirely\n    // and also prevents Firefox's follow-up selectionchange from dirtying nodes.\n    $setSelection(null);\n  }\n\n  #dropOntoImage(draggedNode, targetKey, position) {\n    const targetNode = $getNodeByKey(targetKey);\n    if (!targetNode || !$isActionTextAttachmentNode(targetNode)) return\n    if (draggedNode.is(targetNode)) return\n\n    draggedNode.remove();\n\n    const gallery = $findOrCreateGalleryForImage(targetNode);\n    if (gallery) {\n      if (position === \"before\") {\n        targetNode.insertBefore(draggedNode);\n      } else {\n        targetNode.insertAfter(draggedNode);\n      }\n    }\n  }\n\n  #reorderInGallery(draggedNode, targetKey, position) {\n    const targetNode = $getNodeByKey(targetKey);\n    if (!targetNode || draggedNode.is(targetNode)) return\n\n    draggedNode.remove();\n\n    if (position === \"before\") {\n      targetNode.insertBefore(draggedNode);\n    } else {\n      targetNode.insertAfter(draggedNode);\n    }\n  }\n\n  #dropIntoList(draggedNode, target) {\n    const listItemNode = $getNearestNodeFromDOMNode(target.element);\n    if (!listItemNode || !$isListItemNode(listItemNode)) return\n\n    const listNode = listItemNode.getParent();\n    if (!listNode || !$isListNode(listNode)) return\n\n    const children = listNode.getChildren();\n    const index = children.indexOf(listItemNode);\n    if (index === -1) return\n\n    const splitIndex = target.position === \"before\" ? index : index + 1;\n\n    draggedNode.remove();\n\n    if (splitIndex === 0) {\n      listNode.insertBefore(draggedNode);\n    } else if (splitIndex >= children.length) {\n      listNode.insertAfter(draggedNode);\n    } else {\n      const [ , listAfter ] = $splitNode(listNode, splitIndex);\n      listAfter.insertBefore(draggedNode);\n    }\n  }\n\n  #dropBetweenBlocks(draggedNode, target) {\n    const targetNode = $getNearestNodeFromDOMNode(target.element);\n    if (!targetNode) return\n\n    const topLevelTarget = targetNode.getTopLevelElement?.() || targetNode;\n    if (draggedNode.is(topLevelTarget)) return\n\n    draggedNode.remove();\n\n    if (target.position === \"before\") {\n      topLevelTarget.insertBefore(draggedNode);\n    } else {\n      topLevelTarget.insertAfter(draggedNode);\n    }\n  }\n\n  // -- Lifecycle helpers -----------------------------------------------------\n\n  #cleanup() {\n    this.#clearDropIndicators();\n\n    if (this.#draggedNodeKey) {\n      const rootElement = this.#editor.getRootElement();\n      if (rootElement) {\n        const figure = rootElement.querySelector(`[data-lexical-node-key=\"${this.#draggedNodeKey}\"]`);\n        figure?.classList.remove(\"lexxy-dragging\");\n      }\n    }\n\n    this.#draggedNodeKey = null;\n\n    if (this.#rafId) {\n      cancelAnimationFrame(this.#rafId);\n      this.#rafId = null;\n    }\n\n    if (this.#draggingRafId) {\n      cancelAnimationFrame(this.#draggingRafId);\n      this.#draggingRafId = null;\n    }\n  }\n}\n\n// Lexical clears the DOM range on NodeSelection, leaving screen readers in focus\n// mode to read stray adjacent characters unless we provide a labelled range.\nclass AttachmentFakeSelection {\n  #editor\n  #listeners = new ListenerBin()\n  #container = createElement(\"span\", { className: \"lexxy-fake-selection\" })\n\n  constructor(editor) {\n    this.#editor = editor;\n    this.#listeners.track(\n      registerLabelledDecoratorSelection(editor, (target) => this.#update(target))\n    );\n  }\n\n  destroy() {\n    this.#listeners.dispose();\n    this.#container.remove();\n    this.#container = null;\n  }\n\n  #update(target) {\n    if (this.#container) {\n      const figure = target && this.#editor.getElementByKey(target.key);\n      if (figure) {\n        const label = target.label || \"Attachment\";\n        if (this.#container.textContent !== label) this.#container.textContent = label;\n        if (this.#container.parentNode !== figure) figure.append(this.#container);\n        this.#parkSelection();\n      } else {\n        this.#container.remove();\n      }\n    }\n  }\n\n  #parkSelection() {\n    const textNode = this.#container.firstChild;\n    if (textNode && this.#isEditorFocused && !this.#isAlreadyParkedHere) {\n      const range = document.createRange();\n      range.setStart(textNode, 0);\n      range.setEnd(textNode, textNode.length);\n\n      const selection = window.getSelection();\n      selection.removeAllRanges();\n      selection.addRange(range);\n    }\n  }\n\n  // Parking the range while a nested control is focused steals its screen reader cursor.\n  get #isEditorFocused() {\n    const root = this.#editor.getRootElement();\n    return root != null && document.activeElement === root\n  }\n\n  get #isAlreadyParkedHere() {\n    const selection = window.getSelection();\n    if (selection?.rangeCount === 1) {\n      const textNode = this.#container.firstChild;\n      return selection.anchorNode === textNode\n        && selection.focusNode === textNode\n        && selection.anchorOffset === 0\n        && selection.focusOffset === textNode.length\n    } else {\n      return false\n    }\n  }\n}\n\nclass AttachmentKeyboardMove {\n  #editor\n  #listeners = new ListenerBin()\n  #scrollFrame\n\n  constructor(editor) {\n    this.#editor = editor;\n\n    this.#listeners.track(\n      editor.registerCommand(KEY_DOWN_COMMAND, this.#tryReorder, COMMAND_PRIORITY_HIGH)\n    );\n  }\n\n  destroy() {\n    this.#listeners.dispose();\n    cancelAnimationFrame(this.#scrollFrame);\n  }\n\n  #tryReorder = (event) => {\n    const node = $singleSelectedNode();\n    if (event.altKey && event.shiftKey && event.key.startsWith(\"Arrow\") && $isActionTextAttachmentNode(node)) {\n      event.preventDefault();\n      const message = this.#executeMove(event.key, node);\n      $setSelection($createNodeSelectionWith(node));\n      announceFromEditor(this.#editor, message);\n      this.#keepInView(node);\n      return true\n    } else {\n      return false\n    }\n  }\n\n  #executeMove(key, node) {\n    switch (key) {\n      case \"ArrowUp\": return new AttachmentReorder(node, \"previous\").moveVertically()\n      case \"ArrowDown\": return new AttachmentReorder(node, \"next\").moveVertically()\n      case \"ArrowLeft\": return new AttachmentReorder(node, \"previous\").reorderInGallery()\n      case \"ArrowRight\": return new AttachmentReorder(node, \"next\").reorderInGallery()\n      default: return null\n    }\n  }\n\n  // Node selections don't scroll into view automatically like a caret does.\n  #keepInView(node) {\n    const key = node.getKey();\n    cancelAnimationFrame(this.#scrollFrame);\n    this.#scrollFrame = requestAnimationFrame(() => {\n      this.#editor.getElementByKey(key)?.scrollIntoView({ block: \"nearest\" });\n    });\n  }\n}\n\nclass AttachmentReorder {\n  constructor(node, direction) {\n    this.node = node;\n    this.direction = direction;\n  }\n\n  moveVertically() {\n    if ($isImageGalleryNode(this.node.getParent())) {\n      return this.#extractFromGallery()\n    } else {\n      return this.#moveBlock() || this.#blockedMessage\n    }\n  }\n\n  reorderInGallery() {\n    const sibling = $getSiblingCaret(this.node, this.direction).getNodeAtCaret();\n    if ($isImageGalleryNode(this.node.getParent()) && sibling) {\n      $getSiblingCaret(sibling, this.direction).insert(this.node);\n      return \"Image reordered in gallery\"\n    } else {\n      return this.#blockedMessage\n    }\n  }\n\n  #extractFromGallery() {\n    const gallery = this.node.getParent();\n    $getSiblingCaret(gallery, this.direction).insert(this.node);\n    return \"Image removed from gallery\"\n  }\n\n  #moveBlock() {\n    const target = this.#skipProvisional($getSiblingCaret(this.node, this.direction).getNodeAtCaret());\n    if (this.#canJoinGallery(target)) {\n      return this.#joinGallery(target)\n    } else if (this.#canFormGalleryWith(target)) {\n      return this.#formGalleryWith(target)\n    } else if (target) {\n      return this.#swapWith(target)\n    } else {\n      return null\n    }\n  }\n\n  #skipProvisional(node) {\n    let current = node;\n    while (current && $isProvisionalParagraphNode(current)) {\n      current = $getSiblingCaret(current, this.direction).getNodeAtCaret();\n    }\n    return current\n  }\n\n  #canJoinGallery(target) {\n    return $isImageGalleryNode(target) && ImageGalleryNode.isValidChild(this.node)\n  }\n\n  #joinGallery(gallery) {\n    $getChildCaret(gallery, this.direction).insert(this.node);\n    return \"Image added to gallery\"\n  }\n\n  #canFormGalleryWith(target) {\n    return $isActionTextAttachmentNode(target)\n      && target.isPreviewableImage\n      && this.node.isPreviewableImage\n  }\n\n  #formGalleryWith(target) {\n    if ($findOrCreateGalleryForImage(target)) {\n      $getSiblingCaret(target, flipDirection(this.direction)).insert(this.node);\n      return \"Gallery created\"\n    } else {\n      return null\n    }\n  }\n\n  #swapWith(target) {\n    $getSiblingCaret(target, this.direction).insert(this.node);\n    if (this.direction === \"next\") {\n      return \"Attachment moved down\"\n    } else {\n      return \"Attachment moved up\"\n    }\n  }\n\n  get #blockedMessage() {\n    if (this.direction === \"next\") {\n      return \"Already at the end\"\n    } else {\n      return \"Already at the start\"\n    }\n  }\n}\n\n// Using a mention's label as avatar alt text can interrupt line-by-line reading,\n// but character navigation needs it near the caret to announce the mention.\nclass CustomAttachmentLabels {\n  #editor\n  #listeners = new ListenerBin()\n  #active = null\n\n  constructor(editor) {\n    this.#editor = editor;\n    this.#listeners.track(\n      editor.registerUpdateListener(this.#updateLabel),\n      // A blur command opens a Lexical update that can pull focus back into the editor.\n      editor.registerRootListener(rootElement => {\n        if (rootElement) {\n          return registerEventListener(rootElement, \"blur\", () => this.#restoreLabel())\n        }\n      })\n    );\n  }\n\n  destroy() {\n    this.#listeners.dispose();\n    this.#restoreLabel();\n  }\n\n  #updateLabel = ({ editorState }) => {\n    if (document.activeElement === this.#editor.getRootElement()) {\n      editorState.read(() => {\n        const selection = $getSelection();\n        const attachment = customAttachmentSelectedBy(selection) || customAttachmentBesideAnchor(selection);\n\n        if (attachment) {\n          this.#exposeLabelOn(attachment);\n        } else {\n          this.#restoreLabel();\n        }\n      });\n    } else {\n      this.#restoreLabel();\n    }\n  }\n\n  #exposeLabelOn(attachment) {\n    const figure = this.#editor.getElementByKey(attachment.getKey());\n    if (figure && figure !== this.#active?.figure) {\n      this.#restoreLabel();\n      attachment.exposeLabel(figure);\n      this.#active = { figure, attachment };\n    }\n  }\n\n  #restoreLabel() {\n    if (this.#active) {\n      const { attachment, figure } = this.#active;\n      attachment.restoreLabel(figure);\n      this.#active = null;\n    }\n  }\n}\n\nfunction customAttachmentSelectedBy(selection) {\n  if ($isNodeSelection(selection)) {\n    const nodes = selection.getNodes();\n    if (nodes.length === 1 && $isCustomActionTextAttachmentNode(nodes[0])) {\n      return nodes[0]\n    } else {\n      return null\n    }\n  } else {\n    return null\n  }\n}\n\n// Screen readers need the label one character early to announce it as the caret\n// crosses the figure.\nfunction customAttachmentBesideAnchor(selection) {\n  if ($isRangeSelection(selection) && selection.isCollapsed()) {\n    const anchor = selection.anchor;\n    const parent = anchor.getNode();\n    const candidates = [];\n\n    if (anchor.type === \"text\") {\n      const toEnd = parent.getTextContentSize() - anchor.offset;\n      if (toEnd <= 1) candidates.push({ node: parent.getNextSibling(), distance: toEnd });\n      if (anchor.offset <= 1) candidates.push({ node: parent.getPreviousSibling(), distance: anchor.offset });\n    } else {\n      candidates.push({ node: parent.getChildAtIndex(anchor.offset), distance: 0 });\n      candidates.push({ node: parent.getChildAtIndex(anchor.offset - 1), distance: 0 });\n    }\n\n    const nearest = candidates\n      .filter(({ node }) => $isCustomActionTextAttachmentNode(node))\n      .sort((a, b) => a.distance - b.distance)[0];\n\n    return nearest?.node ?? null\n  } else {\n    return null\n  }\n}\n\nconst ATTACHMENT_ATTRIBUTES = [ \"alt\", \"caption\", \"content\", \"content-type\", \"data-direct-upload-id\",\n  \"data-sgid\", \"filename\", \"filesize\", \"height\", \"presentation\", \"previewable\", \"sgid\", \"url\", \"width\" ];\n\nconst UPLOADS_BUSY_MESSAGE = \"Please wait for all files to upload\";\n\nclass AttachmentsExtension extends LexxyExtension {\n  #uploadsCount = 0\n\n  get enabled() {\n    return this.editorElement.supportsAttachments\n  }\n\n  get allowedElements() {\n    return [ { tag: ActionTextAttachmentNode.TAG_NAME, attributes: ATTACHMENT_ATTRIBUTES } ]\n  }\n\n  get lexicalExtension() {\n    return defineExtension({\n      name: \"lexxy/action-text-attachments\",\n      nodes: [\n        ActionTextAttachmentNode,\n        ActionTextAttachmentUploadNode,\n        ImageGalleryNode\n      ],\n      register: (editor) => {\n        const dragAndDrop = new AttachmentDragAndDrop(editor);\n        const keyboardMove = new AttachmentKeyboardMove(editor);\n        const fakeSelection = new AttachmentFakeSelection(editor);\n        const customAttachmentLabels = new CustomAttachmentLabels(editor);\n\n        return mergeRegister(\n          editor.registerNodeTransform(ActionTextAttachmentNode, $extractAttachmentFromParagraph),\n          editor.registerCommand(DELETE_CHARACTER_COMMAND, $collapseIntoGallery, COMMAND_PRIORITY_NORMAL),\n          editor.registerCommand(KEY_TAB_COMMAND, $focusCaptionFromSelectedAttachment, COMMAND_PRIORITY_HIGH),\n          editor.registerMutationListener(ActionTextAttachmentUploadNode, this.#handleUploadMutations.bind(this)),\n          () => dragAndDrop.destroy(),\n          () => keyboardMove.destroy(),\n          () => fakeSelection.destroy(),\n          () => customAttachmentLabels.destroy()\n        )\n      }\n    })\n  }\n\n  #handleUploadMutations(mutations) {\n    const previousUploadsCount = this.#uploadsCount;\n    for (const [ key, mutation ] of mutations) {\n      if (mutation === \"created\") {\n        this.#uploadsCount++;\n      } else if (mutation === \"destroyed\") {\n        this.#uploadsCount--;\n        this.editorElement.uploadRequests.abort(key);\n      }\n    }\n\n    if (this.#uploadsCount !== previousUploadsCount) {\n      this.#setUploadsValidity();\n    }\n  }\n\n  #setUploadsValidity() {\n    if (this.#uploadsCount) {\n      this.setEditorValidity({ customError: true }, UPLOADS_BUSY_MESSAGE);\n    } else {\n      this.setEditorValidity({});\n    }\n  }\n}\n\n// Decorator nodes can be wrapped in a Paragraph Node by Lexical when contained in a <div>\n// We remove them, splitting the node as needed\nfunction $extractAttachmentFromParagraph(attachmentNode) {\n  const parentNode = attachmentNode.getParent();\n  if (!$isParagraphNode(parentNode)) return\n\n  if (parentNode.getChildrenSize() === 1) {\n    parentNode.replace(attachmentNode);\n  } else {\n    const index = attachmentNode.getIndexWithinParent();\n    const [ topParagraph, bottomParagraph ] = $splitNode(parentNode, index);\n    topParagraph.insertAfter(attachmentNode);\n\n    for (const p of [ topParagraph, bottomParagraph ]) {\n      if (p.isEmpty()) p.remove();\n    }\n  }\n}\n\nfunction $collapseIntoGallery(backwards) {\n  const anchor = $getSelection()?.anchor;\n  if (!anchor) return false\n\n  if ($collapseAtGalleryEdge(anchor, backwards)) {\n    return true\n  } else if (backwards) {\n    return $collapseAroundEmptyParagraph(anchor)\n      || $moveSelectionBeforeGallery(anchor)\n  }\n\n  return false\n}\n\nfunction $collapseAroundEmptyParagraph(anchor) {\n  const anchorNode = anchor.getNode();\n  if (!anchorNode) return false\n\n  const isWithinEmptyParagraph = $isParagraphNode(anchorNode) && anchorNode.isEmpty();\n  const previousSibling = anchorNode.getPreviousSibling();\n  const topGallery = $findOrCreateGalleryForImage(previousSibling);\n  const selectionIndex = topGallery?.getChildrenSize();\n\n  if (isWithinEmptyParagraph && topGallery?.collapseWith(anchorNode.getNextSibling())) {\n    topGallery.select(selectionIndex, selectionIndex);\n    anchorNode.remove();\n    return true\n  } else {\n    return false\n  }\n}\n\nfunction $collapseAtGalleryEdge(anchor, backwards) {\n  const anchorNode = anchor.getNode();\n  if (!$isImageGalleryNode(anchorNode)) return false\n\n  const isAtGalleryEdge = $isAtNodeEdge(anchor, backwards);\n  const sibling = backwards ? anchorNode.getPreviousSibling() : anchorNode.getNextSibling();\n\n  if (isAtGalleryEdge && anchorNode.collapseWith(sibling, backwards)) {\n    const selectionOffset = backwards ? 1 : anchorNode.getChildrenSize() - 1;\n    anchorNode.select(selectionOffset, selectionOffset);\n    return true\n  } else {\n    return false\n  }\n}\n\nfunction $focusCaptionFromSelectedAttachment(event) {\n  const node = $singleSelectedNode();\n  if (!event.shiftKey && $isActionTextAttachmentNode(node) && node.focusCaption()) {\n    event.preventDefault();\n    return true\n  } else {\n    return false\n  }\n}\n\n// Manual selection handling to prevent Lexical merging the gallery with a <p> and unwrapping it\nfunction $moveSelectionBeforeGallery(anchor) {\n  const previousNode = anchor.getNode().getPreviousSibling();\n  if (!$isImageGalleryNode(anchor.getNode()) || !$isAtNodeEdge(anchor, true) || !previousNode) return false\n\n  if ($isDecoratorNode(previousNode)) {\n    // Handled by Lexxy decorator selection behavior\n    return false\n  } else if (previousNode.isEmpty()) {\n    previousNode.remove();\n  } else {\n    previousNode.selectEnd();\n  }\n\n  return true\n}\n\nclass EarlyEscapeCodeNode extends CodeNode {\n  $config() {\n    return this.config(\"early_escape_code\", { extends: CodeNode })\n  }\n\n  static $fromSelection(selection) {\n    const anchorNode = selection.anchor.getNode();\n    return $getNearestNodeOfType(anchorNode, EarlyEscapeCodeNode)\n      || (anchorNode instanceof EarlyEscapeCodeNode ? anchorNode : null)\n  }\n\n  insertNewAfter(selection, restoreSelection) {\n    if ($hasUpdateTag(PASTE_TAG) || !selection.isCollapsed()) {\n      return super.insertNewAfter(selection, restoreSelection)\n    } else if (this.#isCursorAtStart(selection)) {\n      return this.#insertParagraphBefore()\n    } else if (this.#isCursorOnWhitespaceOnlyLastLine(selection)) {\n      return this.#insertBlankLineBelow(selection, restoreSelection)\n    } else if (this.#isCursorOnEmptyLastLine(selection)) {\n      return this.#escapeToNewParagraphAfter()\n    } else {\n      return super.insertNewAfter(selection, restoreSelection)\n    }\n  }\n\n  #isCursorAtStart(selection) {\n    const { anchor } = selection;\n    if (!$isAtNodeStart(anchor)) return false\n\n    const anchorNode = anchor.getNode();\n    return this.is(anchorNode) || this.getFirstChild()?.is(anchorNode)\n  }\n\n  #isCursorOnEmptyLastLine(selection) {\n    if (!$isCursorOnLastLine(selection)) return false\n\n    const textContent = this.getTextContent();\n    return textContent === \"\" || textContent.endsWith(\"\\n\")\n  }\n\n  #isCursorOnWhitespaceOnlyLastLine(selection) {\n    if (!$isCursorOnLastLine(selection)) return false\n\n    const textContent = this.getTextContent();\n    const lastNewlineIndex = textContent.lastIndexOf(\"\\n\");\n    const lastLine = lastNewlineIndex === -1 ? textContent : textContent.slice(lastNewlineIndex + 1);\n    return lastLine.length > 0 && lastLine.trim() === \"\"\n  }\n\n  #insertParagraphBefore() {\n    this.insertBefore($createParagraphNode());\n    return null\n  }\n\n  #insertBlankLineBelow(selection, restoreSelection) {\n    super.insertNewAfter(selection, restoreSelection);\n    this.getLastChild().remove();\n    return null\n  }\n\n  #escapeToNewParagraphAfter() {\n    $trimTrailingBlankNodes(this);\n    const paragraph = $createParagraphNode();\n    this.insertAfter(paragraph);\n    return paragraph\n  }\n}\n\nclass EarlyEscapeListItemNode extends ListItemNode {\n  $config() {\n    return this.config(\"early_escape_listitem\", { extends: ListItemNode })\n  }\n\n  insertNewAfter(selection, restoreSelection) {\n    if (this.#shouldEscape(selection)) {\n      return this.#escapeFromList()\n    }\n\n    return super.insertNewAfter(selection, restoreSelection)\n  }\n\n  get #isInBlockquote() {\n    return Boolean($getNearestNodeOfType(this, QuoteNode))\n  }\n\n  #shouldEscape(selection) {\n    if (this.#isInPasteOperation() || !this.#isInBlockquote) {\n      return false\n    } else if ($isBlankNode(this)) {\n      return true\n    } else {\n      const paragraph = $getNearestNodeOfType(selection.anchor.getNode(), ParagraphNode);\n      return paragraph && $isBlankNode(paragraph) && $isListItemNode(paragraph.getParent())\n    }\n  }\n\n  #isInPasteOperation() {\n    return $hasUpdateTag(PASTE_TAG)\n  }\n\n  #escapeFromList() {\n    const parentList = this.getParent();\n    if (!parentList || !$isListNode(parentList)) return\n\n    const blockquote = parentList.getParent();\n    const isInBlockquote = blockquote && $isQuoteNode(blockquote);\n\n    if (isInBlockquote) {\n      const hasNonEmptyListItems = this.getNextSiblings().some(\n        sibling => $isListItemNode(sibling) && !$isBlankNode(sibling)\n      );\n\n      if (hasNonEmptyListItems) {\n        return this.#splitBlockquoteWithList()\n      }\n    }\n\n    const paragraph = $createParagraphNode();\n    parentList.insertAfter(paragraph);\n\n    this.remove();\n    return paragraph\n  }\n\n  #splitBlockquoteWithList() {\n    const splitQuotes = $splitNode(this.getParent(), this.getIndexWithinParent());\n    this.remove();\n\n    const middleParagraph = $createParagraphNode();\n    splitQuotes[0].insertAfter(middleParagraph);\n\n    splitQuotes.forEach($trimTrailingBlankNodes);\n\n    return middleParagraph\n  }\n\n}\n\nclass FormatEscapeExtension extends LexxyExtension {\n\n  get enabled() {\n    return this.editorElement.supportsRichText\n  }\n\n  get allowedElements() {\n    return [ { tag: \"ol\", attributes: [ \"start\" ] }, { tag: \"li\", attributes: [ \"value\" ] } ]\n  }\n\n  get lexicalExtension() {\n    return defineExtension({\n      name: \"lexxy/format-escape\",\n      nodes: [\n        EarlyEscapeCodeNode,\n        { replace: CodeNode, with: (node) => new EarlyEscapeCodeNode(node.getLanguage()), withKlass: EarlyEscapeCodeNode },\n        EarlyEscapeListItemNode,\n        { replace: ListItemNode, with: () => new EarlyEscapeListItemNode(), withKlass: EarlyEscapeListItemNode },\n      ],\n      register(editor) {\n        return mergeRegister(\n          editor.registerCommand(\n            INSERT_PARAGRAPH_COMMAND,\n            () => $escapeFromBlockquote(),\n            COMMAND_PRIORITY_HIGH\n          ),\n          editor.registerCommand(\n            KEY_ARROW_DOWN_COMMAND,\n            (event) => $handleArrowDownInCodeBlock(event),\n            COMMAND_PRIORITY_NORMAL\n          ),\n          editor.registerNodeTransform(QuoteNode, $ensureQuoteHasParagraphChild)\n        )\n      }\n    })\n  }\n}\n\nfunction $escapeFromBlockquote() {\n  return $escapeBeforeBlockquoteStart() || $escapeFromBlankBlockquoteParagraph()\n}\n\nfunction $escapeBeforeBlockquoteStart() {\n  const selection = $getSelection();\n  if (!$isRangeSelection(selection) || !selection.isCollapsed() || selection.anchor.offset !== 0) return false\n\n  const paragraph = $getNearestNodeOfType(selection.anchor.getNode(), ParagraphNode);\n  if (paragraph && !$isBlankNode(paragraph) && !paragraph.getPreviousSibling()) {\n    const blockquote = paragraph.getParent();\n    if ($isQuoteNode(blockquote)) {\n      blockquote.insertBefore($createParagraphNode());\n      return true\n    }\n  }\n\n  return false\n}\n\nfunction $escapeFromBlankBlockquoteParagraph() {\n  const anchorNode = $getSelection().anchor.getNode();\n\n  const paragraph = $getNearestNodeOfType(anchorNode, ParagraphNode);\n  if (!paragraph || !$isBlankNode(paragraph)) return false\n\n  const blockquote = paragraph.getParent();\n  if ($isQuoteNode(blockquote)) {\n    const nonEmptySiblings = paragraph.getNextSiblings().filter(sibling => !$isBlankNode(sibling));\n\n    if (nonEmptySiblings.length > 0) {\n      $splitQuoteNode(blockquote, paragraph);\n    } else {\n      blockquote.insertAfter(paragraph);\n      paragraph.selectStart();\n    }\n\n    return true\n  }\n\n  return false\n}\n\nfunction $splitQuoteNode(node, paragraph) {\n  const splitQuotes = $splitNode(node, paragraph.getIndexWithinParent());\n  splitQuotes[0].insertAfter(paragraph);\n  splitQuotes.forEach($trimTrailingBlankNodes);\n  paragraph.selectEnd();\n}\n\nfunction $handleArrowDownInCodeBlock(event) {\n  const selection = $getSelection();\n  if (!$isRangeSelection(selection) || !selection.isCollapsed()) return false\n\n  const codeNode = EarlyEscapeCodeNode.$fromSelection(selection);\n  if (!codeNode) return false\n\n  if ($isCursorOnLastLine(selection) && !codeNode.getNextSibling()) {\n    event?.preventDefault();\n    const paragraph = $createParagraphNode();\n    codeNode.insertAfter(paragraph);\n    paragraph.selectEnd();\n    return true\n  }\n\n  return false\n}\n\nfunction $ensureQuoteHasParagraphChild(quoteNode) {\n  if (!quoteNode.isEmpty()) return\n\n  quoteNode.append($createParagraphNode());\n  if ($containsRangeSelection(quoteNode)) quoteNode.getFirstChild().select();\n}\n\nclass LinkOpenerExtension extends LexxyExtension {\n  get enabled() {\n    return this.editorElement.supportsRichText\n  }\n\n  get lexicalExtension() {\n    return defineExtension({\n      name: \"lexxy/link-opener\",\n      register: (editor) => mergeRegister$1(\n        editor.registerCommand(CLICK_COMMAND, this.#handleClick.bind(this), COMMAND_PRIORITY_NORMAL),\n        registerEventListener(this.editorElement.editorContentElement, \"auxclick\", this.#handleAuxClick.bind(this)),\n        registerEventListener(window, \"keydown\", this.#handleKey.bind(this)),\n        registerEventListener(window, \"keyup\", this.#handleKey.bind(this)),\n        registerEventListener(window, \"focus\", this.#handleFocus.bind(this))\n      )\n    })\n  }\n\n  #handleClick(event) {\n    if (this.#isModified(event)) {\n      return $openLink(event.target)\n    } else {\n      return false\n    }\n  }\n\n  #handleAuxClick(event) {\n    if (event.button === 1) {\n      this.editorElement.editor.read(() => $openLink(event.target));\n    }\n  }\n\n  #handleKey(event) {\n    this.#updateOpenableAttribute(event);\n  }\n\n  // Chrome dispatches events without modifier keys *for a while* after changing tabs\n  async #handleFocus() {\n    await delay(200);\n    this.editorElement.addEventListener(\"mousemove\", this.#updateOpenableAttribute.bind(this), { once: true });\n  }\n\n  #updateOpenableAttribute(event) {\n    this.editorElement.toggleAttribute(\"data-links-openable\", this.#isModified(event));\n  }\n\n  #isModified(event) {\n    return IS_APPLE ? event.metaKey : event.ctrlKey\n  }\n}\n\nfunction $openLink(target) {\n  const node = $getNearestNodeFromDOMNode(target);\n  const linkNode = $findMatchingParent(node, $isLinkNode);\n  if (linkNode) {\n    const url = linkNode.sanitizeUrl(linkNode.getURL());\n    window.open(url, \"_blank\", \"noopener,noreferrer\");\n    return true\n  } else {\n    return false\n  }\n}\n\nclass PreventLexicalTripleClickExtension extends LexxyExtension {\n  get lexicalExtension() {\n    return defineExtension({\n      name: \"lexxy/prevent-lexical-triple-click\",\n      register: (editor) => editor.registerRootListener((rootElement) => {\n        if (rootElement) {\n          return registerEventListener(\n            rootElement,\n            \"click\",\n            this.#handleTripleClick.bind(this),\n            { capture: true }\n          )\n        }\n      })\n    })\n  }\n\n  // Stop propagation of the triple-click to prevent Lexical's handler from running.\n  //\n  // Lexical's onClick handler implements a triple-click handler that is trivial/anemic/na\u00EFve. The\n  // intention of the change, made in facebook/lexical#4512, seems to be to deal with browsers'\n  // \"overselection\" behavior, where a triple-click selection might end at offset 0 of the following\n  // block, which can cause issues when transforming the selection. But the implementation breaks\n  // many common real-world use cases and Lexxy does not demonstrate the behavior it's intended to\n  // work around (in headers or tables).\n  #handleTripleClick(event) {\n    if (event.detail === 3) {\n      event.stopPropagation();\n    }\n  }\n}\n\nfunction caretRect(node, offset) {\n  const range = document.createRange();\n  range.setStart(node, offset);\n  range.collapse(true);\n\n  const rect = range.getBoundingClientRect();\n  if (rect.height > 0) {\n    return rect\n  } else {\n    return null\n  }\n}\n\nfunction caretFromPoint(clientX, clientY) {\n  if (document.caretPositionFromPoint) {\n    const position = document.caretPositionFromPoint(clientX, clientY);\n    if (position) return { node: position.offsetNode, offset: position.offset }\n  } else if (document.caretRangeFromPoint) {\n    const range = document.caretRangeFromPoint(clientX, clientY);\n    if (range) return { node: range.startContainer, offset: range.startOffset }\n  }\n\n  return null\n}\n\nconst MIME_TYPE = \"application/x-lexxy-custom-attachment-key\";\n\n// Custom inline attachments reorder by dropping at a text caret, unlike block\n// attachments which insert between blocks or into galleries.\nclass CustomAttachmentDragAndDrop {\n  #editor\n  #draggedNodeKey = null\n  #draggingRafId = null\n  #dragOverRafId = null\n  #dropIndicator = null\n  #listeners = new ListenerBin()\n\n  constructor(editor) {\n    this.#editor = editor;\n\n    // Register at HIGH priority to intercept before the base @lexical/rich-text\n    // handlers, which consume drag events. The block-attachment handler also\n    // registers here but bails for inline custom attachments, so we get our turn.\n    this.#listeners.track(\n      editor.registerCommand(DRAGSTART_COMMAND, (event) => this.#handleDragStart(event), COMMAND_PRIORITY_HIGH),\n      editor.registerCommand(DROP_COMMAND, (event) => this.#handleDrop(event), COMMAND_PRIORITY_HIGH)\n    );\n\n    this.#listeners.track(editor.registerRootListener((root, prevRoot) => {\n      if (prevRoot) {\n        prevRoot.removeEventListener(\"dragover\", this.#onDragOver);\n        prevRoot.removeEventListener(\"dragend\", this.#onDragEnd);\n      }\n      if (root) {\n        root.addEventListener(\"dragover\", this.#onDragOver);\n        root.addEventListener(\"dragend\", this.#onDragEnd);\n      }\n    }));\n  }\n\n  destroy() {\n    this.#cleanup();\n    this.#dropIndicator?.remove();\n    this.#dropIndicator = null;\n    this.#listeners.dispose();\n  }\n\n  #handleDragStart(event) {\n    const attachment = this.#customAttachmentElementFrom(event.target);\n    if (!attachment) return false\n\n    this.#draggedNodeKey = attachment.dataset.lexicalNodeKey;\n    event.dataTransfer.setData(MIME_TYPE, this.#draggedNodeKey);\n    event.dataTransfer.effectAllowed = \"move\";\n\n    this.#draggingRafId = requestAnimationFrame(() => {\n      this.#draggingRafId = null;\n      attachment.classList.add(\"lexxy-dragging\");\n    });\n\n    return true\n  }\n\n  #onDragOver = (event) => {\n    if (!this.#draggedNodeKey) return\n\n    event.preventDefault();\n    event.dataTransfer.dropEffect = \"move\";\n\n    if (!this.#dragOverRafId) {\n      this.#dragOverRafId = requestAnimationFrame(() => {\n        this.#dragOverRafId = null;\n        this.#updateDropIndicator(event);\n      });\n    }\n  }\n\n  #onDragEnd = () => {\n    this.#cleanup();\n  }\n\n  #handleDrop(event) {\n    if (!this.#draggedNodeKey) return false\n\n    event.preventDefault();\n\n    const dropPoint = this.#resolveDropPoint(event);\n    const draggedKey = this.#draggedNodeKey;\n    this.#cleanup();\n\n    if (dropPoint) {\n      this.#moveAttachment(draggedKey, dropPoint);\n    }\n\n    return true\n  }\n\n  #resolveDropPoint(event) {\n    const rootElement = this.#editor.getRootElement();\n    if (!rootElement) return null\n\n    const caret = caretFromPoint(event.clientX, event.clientY);\n    if (!caret || !rootElement.contains(caret.node)) return null\n\n    // A caret on the root itself points between blocks. Mentions behave like text:\n    // they only drop onto an existing line, so snap to the nearest one.\n    if (caret.node === rootElement) {\n      return this.#nearestLineCaret(rootElement, event.clientY)\n    }\n\n    // When mentions sit next to each other with no text between them, the caret\n    // lands inside the neighbouring decorator's DOM. Lexical can't resolve a point\n    // inside a decorator to an editable position, and the cursor has no business\n    // showing there anyway, so snap to just before or after that mention.\n    const decorator = this.#decoratorElementContaining(caret.node);\n    if (decorator) {\n      return this.#dropPointBesideDecorator(decorator, event.clientX)\n    } else {\n      return caret\n    }\n  }\n\n  #nearestLineCaret(rootElement, clientY) {\n    let nearestLine = null;\n    let nearestDistance = Infinity;\n\n    for (const line of rootElement.children) {\n      const rect = line.getBoundingClientRect();\n      const distance = Math.min(Math.abs(clientY - rect.top), Math.abs(clientY - rect.bottom));\n      if (distance < nearestDistance) {\n        nearestDistance = distance;\n        nearestLine = line;\n      }\n    }\n\n    if (!nearestLine) return null\n\n    const rect = nearestLine.getBoundingClientRect();\n    if (clientY < rect.top) {\n      return { node: nearestLine, offset: 0 }\n    } else {\n      return { node: nearestLine, offset: nearestLine.childNodes.length }\n    }\n  }\n\n  #decoratorElementContaining(node) {\n    const element = node.nodeType === Node.ELEMENT_NODE ? node : node.parentElement;\n    return element?.closest(\"[data-lexxy-decorator][data-lexical-node-key]\")\n  }\n\n  #dropPointBesideDecorator(decorator, clientX) {\n    const rect = decorator.getBoundingClientRect();\n    const placement = clientX > rect.left + rect.width / 2 ? \"after\" : \"before\";\n    return { decoratorKey: decorator.dataset.lexicalNodeKey, placement }\n  }\n\n  #moveAttachment(draggedKey, dropPoint) {\n    this.#editor.update(() => {\n      const draggedNode = $getNodeByKey(draggedKey);\n      if (!$isCustomActionTextAttachmentNode(draggedNode)) return\n\n      if (dropPoint.decoratorKey) {\n        this.#moveBesideNode(draggedNode, dropPoint);\n      } else {\n        this.#moveToCaret(draggedNode, dropPoint);\n      }\n    });\n  }\n\n  #moveBesideNode(draggedNode, { decoratorKey, placement }) {\n    const targetNode = $getNodeByKey(decoratorKey);\n    if (!targetNode || targetNode === draggedNode) return\n\n    draggedNode.remove();\n    if (placement === \"after\") {\n      targetNode.insertAfter(draggedNode);\n    } else {\n      targetNode.insertBefore(draggedNode);\n    }\n  }\n\n  #moveToCaret(draggedNode, dropPoint) {\n    const selection = $createRangeSelectionFromDom({\n      anchorNode: dropPoint.node,\n      anchorOffset: dropPoint.offset,\n      focusNode: dropPoint.node,\n      focusOffset: dropPoint.offset\n    }, this.#editor);\n    if (!selection) return\n\n    $setSelection(selection);\n\n    draggedNode.remove();\n    selection.insertNodes([ draggedNode ]);\n  }\n\n  #updateDropIndicator(event) {\n    this.#hideCaret();\n\n    const dropPoint = this.#resolveDropPoint(event);\n    if (dropPoint) this.#showCaret(this.#caretRectFor(dropPoint));\n  }\n\n  #caretRectFor(dropPoint) {\n    if (dropPoint.decoratorKey) {\n      return this.#decoratorEdgeRect(dropPoint)\n    }\n\n    const { node, offset } = dropPoint;\n    const rect = caretRect(node, offset);\n    if (rect) return rect\n\n    // A blank line has no text to measure, so fall back to the line's own box.\n    const line = node.nodeType === Node.TEXT_NODE ? node.parentElement : node;\n    if (!line) return null\n\n    const lineRect = line.getBoundingClientRect();\n    return { left: lineRect.left, top: lineRect.top, height: lineRect.height }\n  }\n\n  #decoratorEdgeRect({ decoratorKey, placement }) {\n    const decorator = this.#editor.getRootElement()?.querySelector(`[data-lexical-node-key=\"${decoratorKey}\"]`);\n    if (!decorator) return null\n\n    const rect = decorator.getBoundingClientRect();\n    const left = placement === \"after\" ? rect.right : rect.left;\n    return { left, top: rect.top, height: rect.height }\n  }\n\n  #showCaret(rect) {\n    if (!rect) return\n\n    const caret = this.#ensureCaretIndicator();\n    caret.style.blockSize = `${rect.height}px`;\n    caret.style.insetInlineStart = `${rect.left}px`;\n    caret.style.insetBlockStart = `${rect.top}px`;\n  }\n\n  #ensureCaretIndicator() {\n    this.#dropIndicator ||= createElement(\"div\", { className: \"lexxy-drop-caret\" });\n\n    this.#editorElement().appendChild(this.#dropIndicator);\n    this.#dropIndicator.style.display = \"block\";\n    return this.#dropIndicator\n  }\n\n  #editorElement() {\n    return this.#editor.getRootElement().closest(\"lexxy-editor\")\n  }\n\n  #hideCaret() {\n    if (this.#dropIndicator) this.#dropIndicator.style.display = \"none\";\n  }\n\n  #customAttachmentElementFrom(target) {\n    return target?.closest?.(\"[data-lexxy-decorator][data-lexical-node-key]\")\n  }\n\n  #cleanup() {\n    if (this.#draggedNodeKey) {\n      const rootElement = this.#editor.getRootElement();\n      const attachment = rootElement?.querySelector(`[data-lexical-node-key=\"${this.#draggedNodeKey}\"]`);\n      attachment?.classList.remove(\"lexxy-dragging\");\n    }\n\n    this.#hideCaret();\n    this.#draggedNodeKey = null;\n\n    if (this.#draggingRafId) {\n      cancelAnimationFrame(this.#draggingRafId);\n      this.#draggingRafId = null;\n    }\n\n    if (this.#dragOverRafId) {\n      cancelAnimationFrame(this.#dragOverRafId);\n      this.#dragOverRafId = null;\n    }\n  }\n}\n\nclass CustomAttachmentDragAndDropExtension extends LexxyExtension {\n  get enabled() {\n    return this.editorElement.supportsRichText\n  }\n\n  get lexicalExtension() {\n    return defineExtension({\n      name: \"lexxy/custom-attachment-drag-and-drop\",\n      register: (editor) => {\n        const dragAndDrop = new CustomAttachmentDragAndDrop(editor);\n        return () => dragAndDrop.destroy()\n      }\n    })\n  }\n}\n\nconst LINE_SEPARATORS = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n// A literal line separator inside a text node renders as a break in the editor, or not at all,\n// but never survives serialization to HTML. macOS text replacements deliver U+2028 LINE SEPARATOR,\n// and other insertions can carry \"\\n\", so however the text arrives, a transform converts whatever\n// lands in a text node into line break nodes.\nclass LineSeparatorsExtension extends LexxyExtension {\n  get lexicalExtension() {\n    return this.defineExtension({\n      name: \"lexxy/line-separators\",\n      register(editor) {\n        return editor.registerNodeTransform(TextNode, $replaceLineSeparatorWithLineBreak)\n      }\n    })\n  }\n}\n\n// Replaces the first separator only: the split leaves dirty text nodes behind, so Lexical re-runs\n// the transform until none remain.\nfunction $replaceLineSeparatorWithLineBreak(textNode) {\n  const match = textNode.getTextContent().match(LINE_SEPARATORS);\n\n  if (match) {\n    let separatorNode;\n    if (match.index === 0) {\n      [ separatorNode ] = textNode.splitText(match[0].length);\n    } else {\n      [ , separatorNode ] = textNode.splitText(match.index, match.index + match[0].length);\n    }\n    separatorNode.replace($createLineBreakNode());\n  }\n}\n\nclass LexicalEditorElement extends HTMLElement {\n  static formAssociated = true\n  static debug = false\n  static commands = [ \"bold\", \"italic\", \"strikethrough\" ]\n\n  static observedAttributes = [ \"autocapitalize\", \"connected\", \"required\" ]\n\n  #initialValue = \"\"\n  #previousInternalFormValue = null\n\n  #initializeEventDispatched = false\n  #editorInitializedDispatched = false\n  #listeners = new ListenerBin()\n  #disposables = []\n  #historyState = { undo: false, redo: false }\n\n  #validity = new Map()\n  #validationAttempted = false\n  #validationTextArea = document.createElement(\"textarea\")\n  #uploadRequests\n  #liveRegion\n\n  constructor() {\n    super();\n    this.internals = this.attachInternals();\n    this.internals.role = \"presentation\";\n  }\n\n  get uploadRequests() {\n    return this.#uploadRequests\n  }\n\n  connectedCallback() {\n    this.id ||= generateDomId(\"lexxy-editor\");\n    this.config = new EditorConfiguration(this);\n    this.extensions = new Extensions(this);\n    this.#disposables.push(this.extensions);\n\n    this.editor = this.#createEditor();\n    this.#disposables.push(this.editor);\n    this.#disposables.push(this.#listeners);\n\n    this.contents = new Contents(this);\n    this.#disposables.push(this.contents);\n\n    this.selection = new Selection(this);\n    this.#disposables.push(this.selection);\n\n    this.clipboard = new Clipboard(this);\n    this.#disposables.push(this.clipboard);\n\n    this.#liveRegion = this.querySelector(\"lexxy-live-region\") ?? createElement(\"lexxy-live-region\");\n    this.append(this.#liveRegion);\n    this.#disposables.push(this.#liveRegion);\n\n    this.adapter = new BrowserAdapter();\n    this.#uploadRequests = new UploadRequests();\n\n    const commandDispatcher = CommandDispatcher.configureFor(this);\n    this.#disposables.push(commandDispatcher);\n\n    this.#initialize();\n\n    this.toggleAttribute(\"connected\", true);\n\n    requestAnimationFrame(() => {\n      this.#mountRoot();\n      this.#handleAutofocus();\n      this.#dispatchInitialize();\n    });\n  }\n\n  disconnectedCallback() {\n    this.#initializeEventDispatched = false;\n    this.#editorInitializedDispatched = false;\n\n    this.#previousInternalFormValue = null;\n    this.valueBeforeDisconnect = this.value;\n\n    this.#clearCachedValues();\n    this.#reset(); // Prevent hangs with Safari when morphing\n  }\n\n  attributeChangedCallback(name, oldValue, newValue) {\n    if (typeof this[`${name}ChangedCallback`] === \"function\") {\n      this[`${name}ChangedCallback`](oldValue, newValue);\n    }\n  }\n\n  autocapitalizeChangedCallback() {\n    if (this.editorContentElement) {\n      this.#transferAttributeToContentEditable(this.editorContentElement, \"autocapitalize\");\n    }\n  }\n\n  connectedChangedCallback(oldValue, newValue) {\n    if (this.isConnected && oldValue != null && oldValue !== newValue) {\n      requestAnimationFrame(() => this.#reconnect());\n    }\n  }\n\n  requiredChangedCallback() {\n    if (this.editorContentElement) this.#synchronizeAriaAttribute(\"aria-required\");\n    if (this.isConnected) this.#requestValidityRefresh();\n  }\n\n  formResetCallback() {\n    this.#validationAttempted = false;\n    this.#synchronizeAriaAttribute(\"aria-invalid\");\n    this.value = this.#initialValue;\n    this.editor.dispatchCommand(CLEAR_HISTORY_COMMAND, undefined);\n  }\n\n  toString() {\n    return this.cachedStringValue ??= this.editor?.read(() => {\n      return $getReadableTextContent($getRoot())\n    })\n  }\n\n  get form() {\n    return this.internals.form\n  }\n\n  get name() {\n    return this.getAttribute(\"name\")\n  }\n\n  get required() {\n    return this.hasAttribute(\"required\")\n  }\n\n  get validity() {\n    return this.internals.validity\n  }\n\n  get validationMessage() {\n    return this.internals.validationMessage\n  }\n\n  setCustomValidity(message) {\n    this.#validationTextArea.setCustomValidity(message);\n    this.#refreshValidity();\n  }\n\n  checkValidity() {\n    return this.internals.checkValidity()\n  }\n\n  reportValidity() {\n    return this.internals.reportValidity()\n  }\n\n  setElementValidity(key, flags, message) {\n    this.#validity.set(key, { flags, message });\n    this.#requestValidityRefresh();\n  }\n\n  get toolbarElement() {\n    if (!this.#hasToolbar) return null\n\n    this.toolbar ??= this.#findOrCreateDefaultToolbar();\n    return this.toolbar\n  }\n\n  get baseExtensions() {\n    return [\n      ProvisionalParagraphExtension,\n      CodeHighlightingExtension,\n      HighlightExtension,\n      TrixContentExtension,\n      TablesExtension,\n      RewritableHistoryExtension,\n      AttachmentsExtension,\n      FormatEscapeExtension,\n      LinkOpenerExtension,\n      PreventLexicalTripleClickExtension,\n      CustomAttachmentDragAndDropExtension,\n      LineSeparatorsExtension\n    ]\n  }\n\n  get directUploadUrl() {\n    return this.dataset.directUploadUrl\n  }\n\n  get blobUrlTemplate() {\n    return this.dataset.blobUrlTemplate\n  }\n\n  get permittedAttachmentTypes() {\n    const raw = this.config.get(\"permittedAttachmentTypes\");\n    if (raw == null) {\n      return null\n    } else {\n      const tokens = Array.isArray(raw) ? raw : String(raw).split(/\\s+/);\n      return Object.freeze(tokens.filter(t => t && t !== \"false\"))\n    }\n  }\n\n  permitsAttachmentContentType(contentType) {\n    if (!this.supportsAttachments) {\n      return false\n    } else {\n      const list = this.permittedAttachmentTypes;\n      return list === null || list.includes(contentType)\n    }\n  }\n\n  acceptsFile(file) {\n    return dispatch(this, \"lexxy:file-accept\", { file }, true)\n  }\n\n  announce(message) {\n    if (message) {\n      if (typeof document.ariaNotify === \"function\") {\n        document.ariaNotify(message, { priority: \"high\" });\n      } else {\n        this.#liveRegion?.announce(message);\n      }\n    }\n  }\n\n  $generateNodesFromDOM(doc, { editor = this.editor } = {}) {\n    let nodes = $generateNodesFromDOM(editor, doc);\n    if ($hasUpdateTag(PASTE_TAG)) nodes = $convertInlineImageDataURIs(nodes, this);\n    return filterDisallowedAttachmentNodes(nodes, this)\n  }\n\n  get isEmpty() {\n    return [ \"<p><br></p>\", \"<p></p>\", \"\" ].includes(this.value.trim())\n  }\n\n  get isBlank() {\n    return this.isEmpty || this.toString().match(/^\\s*$/g) !== null\n  }\n\n  get hasOpenPrompt() {\n    return this.querySelector(\".lexxy-prompt-menu.lexxy-prompt-menu--visible\") !== null\n  }\n\n  get preset() {\n    return this.getAttribute(\"preset\") || \"default\"\n  }\n\n  get supportsAttachments() {\n    return this.config.get(\"attachments\")\n  }\n\n  get supportsMarkdown() {\n    return this.supportsRichText && this.config.get(\"markdown\")\n  }\n\n  get supportsMultiLine() {\n    return this.config.get(\"multiLine\") && !this.isSingleLineMode\n  }\n\n  get supportsRichText() {\n    return this.config.get(\"richText\")\n  }\n\n  registerAdapter(adapter) {\n    this.adapter = adapter;\n\n    if (!this.editor) return\n\n    this.#dispatchEditorInitialized();\n    this.#dispatchAttributesChange();\n  }\n\n  freezeSelection() {\n    this.adapter.freeze();\n  }\n\n  thawSelection() {\n    this.adapter.thaw();\n  }\n\n  dispatchAttributesChange() {\n    this.#dispatchAttributesChange();\n  }\n\n  dispatchEditorInitialized() {\n    this.#dispatchEditorInitialized();\n  }\n\n  // TODO: Deprecate `single-line` attribute\n  get isSingleLineMode() {\n    return this.hasAttribute(\"single-line\")\n  }\n\n  get contentTabIndex() {\n    return parseInt(this.editorContentElement?.getAttribute(\"tabindex\") ?? \"0\")\n  }\n\n  focus() {\n    // `editor.focus()` commits a reconciler update to position the cursor.\n    // Skip if the contenteditable already owns focus \u2014 the update would be a\n    // no-op but still triggers a full style/layout pass on pages with large\n    // DOMs.\n    if (this.#isContentFocused) return\n\n    this.editor.focus(() => this.#onFocus());\n  }\n\n  get #isContentFocused() {\n    return !!this.editor && isEditorFocused(this.editor)\n  }\n\n  get value() {\n    return this.cachedValue ??= this.#readSanitizedEditorValue()\n  }\n\n  set value(html) {\n    const editorHasFocus = this.#isContentFocused;\n\n    this.editor.update(() => {\n      if (editorHasFocus) {\n        // Address Safari inconsistently placing the cursor in the contenteditable by forcing focus back onto the editor\n        // Use direct `editor.focus` to bypass the pre-existing focus optimization and skip the callback\n        $onUpdate(() => this.editor.focus());\n      } else {\n        $addUpdateTag(SKIP_DOM_SELECTION_TAG);\n      }\n\n\n      this.#setEditorHtml(html);\n      this.#toggleEmptyStatus();\n    }, { discrete: true });\n  }\n\n  get canUndo() {\n    return this.#historyState.undo\n  }\n\n  get canRedo() {\n    return this.#historyState.redo\n  }\n\n  #readSanitizedEditorValue() {\n    return this.editor?.read(() => {\n      return this.sanitizer.sanitize($generateHtmlFromNodes(this.editor, null))\n    }) ?? null\n  }\n\n  #parseHtmlIntoLexicalNodes(html, { editor = this.editor } = {}) {\n    if (!html) html = \"<p></p>\";\n    const nodes = this.$generateNodesFromDOM(parseHtml(`${html}`), { editor });\n\n    return nodes\n      .filter(this.#isNotWhitespaceOnlyNode)\n      .map(this.#wrapTextNode)\n  }\n\n  // Whitespace-only text nodes (e.g. \"\\n\" between block elements like <div>) and stray line break\n  // nodes are formatting artifacts from the HTML source. They can't be appended to the root node\n  // and have no semantic meaning, so we strip them during import.\n  #isNotWhitespaceOnlyNode(node) {\n    if ($isLineBreakNode(node)) return false\n    if ($isTextNode(node) && node.getTextContent().trim() === \"\") return false\n    return true\n  }\n\n  // Raw string values produce TextNodes which cannot be appended directly to the RootNode.\n  // We wrap those in <p>\n  #wrapTextNode(node) {\n    if (!$isTextNode(node)) return node\n\n    const paragraph = $createParagraphNode();\n    paragraph.append(node);\n    return paragraph\n  }\n\n  #initialize() {\n    this.#registerComponents();\n    this.#handleEnter();\n    this.#registerFocusEvents();\n    this.#registerHistoryEvents();\n    this.#registerFileAcceptFilter();\n    this.#attachDebugHooks();\n    this.#attachToolbar();\n    this.#resetBeforeTurboCaches();\n    this.#observeAriaAttributes();\n\n    this.#setInternalFormValue(this.value, { suppressEvent: true });\n    this.#synchronizeWithChanges();\n  }\n\n  #registerFileAcceptFilter() {\n    this.#listeners.track(\n      registerEventListener(this, \"lexxy:file-accept\", (event) => {\n        if (!this.permitsAttachmentContentType(event.detail.file.type)) {\n          event.preventDefault();\n        }\n      })\n    );\n  }\n\n  #createEditor() {\n    this.editorContentElement ||= this.#createEditorContentElement();\n    this.appendChild(this.editorContentElement);\n\n    const editor = buildEditorFromExtensions({\n      name: \"lexxy/core\",\n      namespace: \"Lexxy\",\n      theme: theme,\n      nodes: this.#lexicalNodes,\n      html: {\n        export: new Map([ [ TextNode, exportTextNodeDOM ], [ CodeHighlightNode, exportCodeHighlightNodeDOM ] ])\n      },\n      $initialEditorState: (editor) => {\n        this.#configureSanitizer(editor);\n        this.#loadInitialValue(editor);\n      },\n    },\n      ...this.extensions.lexicalExtensions\n    );\n\n    return editor\n  }\n\n  // Toggling editable around setRootElement skips Lexical's DOM-selection sync,\n  // which would otherwise steal focus from elsewhere on the page.\n  #mountRoot() {\n    this.editor.setEditable(false);\n    this.editor.setRootElement(this.editorContentElement);\n    this.editor.setEditable(true);\n  }\n\n  get #lexicalNodes() {\n    const nodes = [ CustomActionTextAttachmentNode ];\n\n    if (this.supportsRichText) {\n      nodes.push(\n        QuoteNode,\n        HeadingNode,\n        ListNode,\n        ListItemNode,\n        CodeNode,\n        CodeHighlightNode,\n        LinkNode,\n        AutoLinkNode,\n        HorizontalDividerNode\n      );\n    }\n\n    return nodes\n  }\n\n  #createEditorContentElement() {\n    const editorContentElement = createElement(\"div\", {\n      id: `${this.id}-content`,\n      classList: \"lexxy-editor__content\",\n      contenteditable: true,\n      role: \"textbox\",\n      \"aria-multiline\": this.supportsMultiLine,\n      \"aria-required\": this.required,\n      \"aria-invalid\": false,\n      \"aria-label\": this.#labelText,\n      placeholder: this.getAttribute(\"placeholder\")\n    });\n\n    this.#ariaAttributes.forEach(attribute => editorContentElement.setAttribute(attribute.name, attribute.value));\n\n    this.#transferAttributeToContentEditable(editorContentElement, \"autocapitalize\");\n    this.#transferAttributeToContentEditable(editorContentElement, \"tabindex\", { defaultValue: 0, removeSource: true });\n\n    return editorContentElement\n  }\n\n  #transferAttributeToContentEditable(element, qualifiedName, { defaultValue = null, removeSource = false } = {}) {\n    if (this.hasAttribute(qualifiedName)) {\n      element.setAttribute(qualifiedName, this.getAttribute(qualifiedName));\n    } else if (defaultValue !== null) {\n      element.setAttribute(qualifiedName, defaultValue);\n    } else {\n      element.removeAttribute(qualifiedName);\n    }\n\n    if (removeSource) this.removeAttribute(qualifiedName);\n  }\n\n  get #labelText() {\n    return Array.from(this.internals.labels).map(label => label.textContent).join(\" \")\n  }\n\n  get #ariaAttributes() {\n    return Array.from(this.attributes).filter(attribute => attribute.name.startsWith(\"aria-\"))\n  }\n\n  #observeAriaAttributes() {\n    const observer = new MutationObserver(mutations => {\n      for (const { attributeName } of mutations) {\n        if (attributeName.startsWith(\"aria-\")) {\n          this.#synchronizeAriaAttribute(attributeName);\n        } else if (attributeName === \"single-line\") {\n          this.#synchronizeAriaAttribute(\"aria-multiline\");\n        }\n      }\n    });\n    observer.observe(this, { attributes: true });\n\n    this.#listeners.track(\n      () => observer.disconnect(),\n      registerEventListener(this, \"invalid\", () => {\n        this.#validationAttempted = true;\n        this.#synchronizeAriaAttribute(\"aria-invalid\");\n      })\n    );\n  }\n\n  #synchronizeAriaAttribute(name) {\n    const value = this.getAttribute(name) ?? this.#defaultAriaValue(name);\n    if (value === null) {\n      this.editorContentElement.removeAttribute(name);\n    } else if (this.editorContentElement.getAttribute(name) !== String(value)) {\n      this.editorContentElement.setAttribute(name, value);\n    }\n  }\n\n  #defaultAriaValue(name) {\n    switch (name) {\n      case \"aria-label\": return this.#labelText\n      case \"aria-required\": return this.required\n      case \"aria-multiline\": return this.supportsMultiLine\n      case \"aria-invalid\": return this.#validationAttempted && !this.validity.valid\n      default: return null\n    }\n  }\n\n  #setInternalFormValue(html, { suppressEvent = false } = {}) {\n    const changed = html !== this.#previousInternalFormValue;\n\n    this.internals.setFormValue(html);\n    this.#previousInternalFormValue = html;\n\n    if (changed && !suppressEvent) {\n      dispatch(this, \"lexxy:change\");\n    }\n  }\n\n  #loadInitialValue(editor) {\n    const initialHtml = this.valueBeforeDisconnect || this.getAttribute(\"value\") || \"<p><br></p>\";\n\n    this.#initialValue = initialHtml;\n    this.#setEditorHtml(initialHtml, { editor });\n  }\n\n  #setEditorHtml(html, { editor = this.editor } = { }) {\n    $getRoot()\n      .clear()\n      .selectEnd()\n      .insertNodes(this.#parseHtmlIntoLexicalNodes(html, { editor }));\n  }\n\n  #resetBeforeTurboCaches() {\n    this.#listeners.track(\n      registerEventListener(document, \"turbo:before-cache\", this.#handleTurboBeforeCache)\n    );\n  }\n\n  #handleTurboBeforeCache = (event) => {\n    if (!this.closest(\"[data-turbo-permanent]\")) {\n      this.#reset();\n    }\n  }\n\n  #synchronizeWithChanges() {\n    this.#listeners.track(this.editor.registerUpdateListener(({ editorState }) => {\n      this.#clearCachedValues();\n      this.#setInternalFormValue(this.value);\n      this.#toggleEmptyStatus();\n      this.#requestValidityRefresh();\n      this.#dispatchAttributesChange();\n    }));\n  }\n\n  async #requestValidityRefresh() {\n    await nextFrame();\n\n    if (this.isConnected) this.#refreshValidity();\n  }\n\n  #refreshValidity() {\n    this.#refreshInternalValidity();\n    const { validity, message } = this.#calculateValidity();\n    this.internals.setValidity(validity, message, this.editorContentElement ?? undefined);\n    if (this.editorContentElement) {\n      this.#synchronizeAriaAttribute(\"aria-invalid\");\n    }\n  }\n\n  #refreshInternalValidity() {\n    if (this.editorContentElement) {\n      this.#validationTextArea.required = this.required && this.isBlank;\n    }\n    const flags = this.#validationTextArea.validity;\n    const message = this.#validationTextArea.validationMessage;\n\n    this.#validity.set(this, { flags, message });\n  }\n\n  #calculateValidity() {\n    const validity = {};\n    const messages = [];\n\n    for (const { flags, message } of this.#validity.values()) {\n      // internal TextArea's ValidityState can contain `valid: true`\n      if (flags.valid === true) continue\n\n      let hasError = false;\n      for (const flag in flags) {\n        if (flags[flag]) {\n          validity[flag] = true;\n          hasError = true;\n        }\n      }\n      if (hasError) messages.push(message);\n    }\n\n    return { validity, message: messages.join(\"\\n\") }\n  }\n\n  #clearCachedValues() {\n    this.cachedValue = null;\n    this.cachedStringValue = null;\n  }\n\n  #registerComponents() {\n    const registered = [];\n\n    if (this.supportsRichText) {\n      registered.push(\n        registerRichText(this.editor),\n        registerList(this.editor)\n      );\n      this.#registerTableComponents();\n      this.#registerCodeLanguagePicker();\n      if (this.supportsAttachments) {\n        this.#registerAttachmentToolbar();\n      }\n      if (this.supportsMarkdown) {\n        const transformers = [ ...TRANSFORMERS, HORIZONTAL_DIVIDER ];\n        registered.push(\n          registerMarkdownShortcuts(this.editor, transformers),\n          registerMarkdownLeadingTagHandler(this.editor, transformers)\n        );\n      }\n    } else {\n      registered.push(registerPlainText(this.editor));\n    }\n\n    this.#listeners.track(...registered);\n  }\n\n  #registerTableComponents() {\n    let tableTools = this.querySelector(\"lexxy-table-tools\");\n    tableTools ??= createElement(\"lexxy-table-tools\");\n    this.append(tableTools);\n    this.#disposables.push(tableTools);\n  }\n\n  #registerCodeLanguagePicker() {\n    let codeLanguagePicker = this.querySelector(\"lexxy-code-language-picker\");\n    codeLanguagePicker ??= createElement(\"lexxy-code-language-picker\");\n    this.append(codeLanguagePicker);\n    this.#disposables.push(codeLanguagePicker);\n  }\n\n  #registerAttachmentToolbar() {\n    let attachmentToolbar = this.querySelector(\"lexxy-attachment-toolbar\");\n    attachmentToolbar ??= createElement(\"lexxy-attachment-toolbar\");\n    this.append(attachmentToolbar);\n    this.#disposables.push(attachmentToolbar);\n    this.captionEditor = new CaptionEditor(this);\n    this.#disposables.push(this.captionEditor);\n  }\n\n  #handleEnter() {\n    // We can't prevent these externally using regular keydown because Lexical handles it first.\n    this.#listeners.track(this.editor.registerCommand(\n      KEY_ENTER_COMMAND,\n      (event) => {\n        // Prevent CTRL+ENTER\n        if (event.ctrlKey || event.metaKey) {\n          event.preventDefault();\n          return true\n        }\n\n        // In single line mode, prevent ENTER\n        if (!this.supportsMultiLine) {\n          event.preventDefault();\n          return true\n        }\n\n        return false\n      },\n      COMMAND_PRIORITY_NORMAL\n    ));\n  }\n\n  #registerFocusEvents() {\n    this.#listeners.track(\n      registerEventListener(this, \"focusin\", this.#handleFocusIn),\n      registerEventListener(this, \"focusout\", this.#handleFocusOut)\n    );\n  }\n\n  #handleFocusIn(event) {\n    if (this.#elementInEditorOrToolbar(event.target) && !this.currentlyFocused) {\n      this.#dispatchAttributesChange();\n      dispatch(this, \"lexxy:focus\");\n      this.currentlyFocused = true;\n    }\n  }\n\n  #handleFocusOut(event) {\n    if (!this.#elementInEditorOrToolbar(event.relatedTarget)) {\n      dispatch(this, \"lexxy:blur\");\n      this.currentlyFocused = false;\n    }\n  }\n\n  #elementInEditorOrToolbar(element) {\n    return this.contains(element) || this.toolbarElement?.contains(element)\n  }\n\n  #onFocus() {\n    if (this.isEmpty) {\n      this.selection.placeCursorAtTheEnd();\n    }\n  }\n\n  #handleAutofocus() {\n    if (!document.querySelector(\":focus\")) {\n      if (this.hasAttribute(\"autofocus\") && document.querySelector(\"[autofocus]\") === this) {\n        this.focus();\n      }\n    }\n  }\n\n  #registerHistoryEvents() {\n    this.#listeners.track(\n      this.editor.registerCommand(CAN_UNDO_COMMAND, (enabled) => { this.#historyState.undo = enabled; }, COMMAND_PRIORITY_NORMAL),\n      this.editor.registerCommand(CAN_REDO_COMMAND, (enabled) => { this.#historyState.redo = enabled; }, COMMAND_PRIORITY_NORMAL)\n    );\n  }\n\n  #attachDebugHooks() {\n    return\n  }\n\n  #attachToolbar() {\n    if (this.#hasToolbar) {\n      this.toolbarElement.setEditor(this);\n      if (typeof this.toolbarElement.dispose === \"function\") {\n        this.#disposables.push(this.toolbarElement);\n      }\n\n      this.extensions.initializeToolbars();\n    }\n  }\n\n  #findOrCreateDefaultToolbar() {\n    const toolbarConfig = this.config.get(\"toolbar\");\n    if (typeof toolbarConfig === \"string\") {\n      return document.getElementById(toolbarConfig)\n    } else {\n      return this.querySelector(\"lexxy-toolbar\") ?? this.#createDefaultToolbar()\n    }\n  }\n\n  get #hasToolbar() {\n    return this.supportsRichText && !!this.config.get(\"toolbar\")\n  }\n\n  #createDefaultToolbar() {\n    const toolbar = createElement(\"lexxy-toolbar\");\n    toolbar.innerHTML = LexicalToolbarElement.defaultTemplate;\n    toolbar.setAttribute(\"data-attachments\", this.supportsAttachments); // Drives toolbar CSS styles\n    toolbar.configure(this.config.get(\"toolbar\"));\n    this.prepend(toolbar);\n    return toolbar\n  }\n\n  #toggleEmptyStatus() {\n    this.classList.toggle(\"lexxy-editor--empty\", this.isEmpty);\n  }\n\n  #configureSanitizer(editor) {\n    this.sanitizer = EditorSanitizer.register(editor, this.extensions.allowedElements);\n  }\n\n  #dispatchAttributesChange() {\n    let attributes = null;\n    let linkHref = null;\n    let highlight = null;\n    let headingTag = null;\n\n    this.editor.getEditorState().read(() => {\n      const selection = $getSelection();\n      if (!$isRangeSelection(selection)) return\n\n      const format = this.selection.getFormat();\n      if (Object.keys(format).length === 0) return\n\n      const anchorNode = selection.anchor.getNode();\n      const linkNode = $getNearestNodeOfType(anchorNode, LinkNode);\n\n      attributes = {\n        bold: { active: format.isBold, enabled: true },\n        italic: { active: format.isItalic, enabled: true },\n        strikethrough: { active: format.isStrikethrough, enabled: true },\n        code: { active: format.isInCode, enabled: true },\n        highlight: { active: format.isHighlight, enabled: true },\n        link: { active: format.isInLink, enabled: true },\n        quote: { active: format.isInQuote, enabled: true },\n        heading: { active: format.isInHeading, enabled: true },\n        \"unordered-list\": { active: format.isInList && format.listType === \"bullet\", enabled: true },\n        \"ordered-list\": { active: format.isInList && format.listType === \"number\", enabled: true },\n        undo: { active: false, enabled: this.canUndo },\n        redo: { active: false, enabled: this.canRedo }\n      };\n\n      linkHref = linkNode ? linkNode.getURL() : null;\n      highlight = format.isHighlight ? getHighlightStyles(selection) : null;\n      headingTag = format.headingTag ?? null;\n    });\n\n    if (attributes) {\n      this.adapter.dispatchAttributesChange(attributes, linkHref, highlight, headingTag);\n    }\n  }\n\n  #dispatchEditorInitialized() {\n    if (!this.adapter) return\n\n    this.#editorInitializedDispatched = true;\n\n    this.adapter.dispatchEditorInitialized({\n      highlightColors: this.#resolvedHighlightColors,\n      headingFormats: this.#supportedHeadingFormats\n    });\n  }\n\n  #dispatchInitialize() {\n    if (this.isConnected && this.adapter) {\n      if (!this.#initializeEventDispatched) {\n        this.#initializeEventDispatched = true;\n        dispatch(this, \"lexxy:initialize\");\n      }\n\n      if (!this.#editorInitializedDispatched) {\n        this.#dispatchEditorInitialized();\n      }\n    }\n  }\n\n  get #resolvedHighlightColors() {\n    const buttons = this.config.get(\"highlight.buttons\");\n    if (!buttons) return null\n\n    const colors = this.#resolveColors(\"color\", buttons.color || []);\n    const backgroundColors = this.#resolveColors(\"background-color\", buttons[\"background-color\"] || []);\n    return { colors, backgroundColors }\n  }\n\n  get #supportedHeadingFormats() {\n    if (!this.supportsRichText) return []\n\n    const headings = this.config.get(\"headings\");\n    return [\n      { label: \"Normal\", command: \"setFormatParagraph\", tag: null },\n      ...headings.map((tag, index) => ({\n        label: HeadingDropdown.labelFor(tag, index),\n        command: HeadingDropdown.commandFor(index),\n        tag\n      }))\n    ]\n  }\n\n  // Builds one resolver element per CSS value inside a hidden container, attaches\n  // the container in a single DOM write, then reads all computed values in one pass\n  // \u2014 triggering at most one forced reflow. The previous implementation interleaved\n  // setProperty/getComputedStyle/removeProperty on the same element, forcing a style\n  // recalc on every iteration during editor initialization.\n  #resolveColors(property, buttons) {\n    const container = document.createElement(\"span\");\n    container.style.display = \"none\";\n\n    const resolvers = normalizeColorButtons(buttons).map(({ value, label }) => {\n      const element = document.createElement(\"span\");\n      element.style.setProperty(property, value);\n      container.appendChild(element);\n      return { element, name: value, label }\n    });\n\n    styleResolverRoot().appendChild(container);\n\n    const resolved = resolvers.map(({ element, name, label }) => ({\n      name,\n      label,\n      value: window.getComputedStyle(element).getPropertyValue(property)\n    }));\n\n    container.remove();\n    return resolved\n  }\n\n  #reset() {\n    this.#dispose();\n    this.#resetValidity();\n    this.#uploadRequests?.clear();\n    this.editorContentElement?.remove();\n    this.editorContentElement = null;\n\n    // Prevents issues with turbo morphing receiving an empty <lexxy-editor> which wipes\n    // out the DOM for the tools, and the old toolbar reference will cause issues\n    this.toolbar = null;\n  }\n\n  #dispose() {\n    while (this.#disposables.length) {\n      this.#disposables.pop().dispose();\n    }\n  }\n\n  #reconnect() {\n    this.disconnectedCallback();\n    this.valueBeforeDisconnect = null;\n    this.connectedCallback();\n  }\n\n  #resetValidity() {\n    this.#validity = new Map();\n    this.#validationAttempted = false;\n  }\n}\n\n// Like $getRoot().getTextContent() but uses readable text for custom attachment nodes\n// (e.g., mentions) instead of their single-character cursor placeholder.\nfunction $getReadableTextContent(node) {\n  if (node instanceof CustomActionTextAttachmentNode) {\n    return node.getReadableTextContent()\n  }\n\n  if ($isElementNode(node)) {\n    let text = \"\";\n    const children = node.getChildren();\n    for (let i = 0; i < children.length; i++) {\n      const child = children[i];\n      const previousChild = children[i - 1];\n\n      if (isAttachmentSpacerTextNode(child, previousChild, i, children.length)) continue\n\n      text += $getReadableTextContent(child);\n      if ($isElementNode(child) && i !== children.length - 1 && !child.isInline()) {\n        text += \"\\n\\n\";\n      }\n    }\n    return text\n  }\n\n  return node.getTextContent()\n}\n\nconst REMOVAL_DELAY = 1000;\n\nclass LiveRegion extends HTMLElement {\n  #additions = createElement(\"span\", { ariaLive: \"assertive\", ariaRelevant: \"additions\" })\n  #removalTimeouts = new Set()\n\n  connectedCallback() {\n    this.replaceChildren(this.#additions);\n  }\n\n  disconnectedCallback() {\n    this.dispose();\n  }\n\n  dispose() {\n    for (const timeout of this.#removalTimeouts) clearTimeout(timeout);\n    this.#removalTimeouts.clear();\n    this.#additions.replaceChildren();\n    this.replaceChildren();\n  }\n\n  announce(message) {\n    const announcement = createElement(\"div\", { textContent: message });\n    this.#additions.appendChild(announcement);\n\n    const timeout = setTimeout(() => {\n      announcement.remove();\n      this.#removalTimeouts.delete(timeout);\n    }, REMOVAL_DELAY);\n    this.#removalTimeouts.add(timeout);\n  }\n}\n\nclass BaseSource {\n  // Template method to override\n  async buildListItems(filter = \"\") {\n    return Promise.resolve([])\n  }\n\n  // Template method to override\n  promptItemFor(listItem) {\n    return null\n  }\n\n  // Protected\n\n  buildListItemElementFor(promptItemElement) {\n    const template = promptItemElement.querySelector(\"template[type='menu']\");\n    const fragment = template.content.cloneNode(true);\n    const listItemElement = createElement(\"li\", { role: \"option\", id: generateDomId(\"prompt-item\"), tabindex: \"0\" });\n    listItemElement.classList.add(\"lexxy-prompt-menu__item\");\n    listItemElement.appendChild(fragment);\n    return listItemElement\n  }\n\n  async loadPromptItemsFromUrl(url) {\n    try {\n      const response = await fetch(url);\n      const html = await response.text();\n      const promptItems = parseHtml(html).querySelectorAll(\"lexxy-prompt-item\");\n      return Promise.resolve(Array.from(promptItems))\n    } catch (error) {\n      return Promise.reject(error)\n    }\n  }\n}\n\nconst MAX_RENDERED_SUGGESTIONS$1 = 100;\n\nclass LocalFilterSource extends BaseSource {\n  async buildListItems(filter = \"\") {\n    const promptItems = await this.fetchPromptItems();\n    return this.#buildListItemsFromPromptItems(promptItems, filter)\n  }\n\n  // Template method to override\n  async fetchPromptItems(filter) {\n    return Promise.resolve([])\n  }\n\n  promptItemFor(listItem) {\n    return this.promptItemByListItem.get(listItem)\n  }\n\n  #buildListItemsFromPromptItems(promptItems, filter) {\n    this.promptItemByListItem = new WeakMap();\n\n    if (!filter) {\n      return this.#buildAllListItems(promptItems)\n    }\n\n    const matches = [];\n    for (const promptItem of promptItems) {\n      const searchableText = promptItem.getAttribute(\"search\");\n      const position = filterMatchPosition(searchableText, filter);\n      if (position >= 0) {\n        matches.push({ promptItem, position });\n      }\n    }\n\n    matches.sort((a, b) => a.position - b.position);\n\n    const listItems = [];\n    for (const { promptItem } of matches) {\n      if (listItems.length >= MAX_RENDERED_SUGGESTIONS$1) break\n      const listItem = this.buildListItemElementFor(promptItem);\n      this.promptItemByListItem.set(listItem, promptItem);\n      listItems.push(listItem);\n    }\n    return listItems\n  }\n\n  #buildAllListItems(promptItems) {\n    const listItems = [];\n    for (const promptItem of promptItems) {\n      if (listItems.length >= MAX_RENDERED_SUGGESTIONS$1) break\n      const listItem = this.buildListItemElementFor(promptItem);\n      this.promptItemByListItem.set(listItem, promptItem);\n      listItems.push(listItem);\n    }\n    return listItems\n  }\n}\n\nclass InlinePromptSource extends LocalFilterSource {\n  constructor(inlinePromptItems) {\n    super();\n    this.inlinePromptItemElements = Array.from(inlinePromptItems);\n  }\n\n  async fetchPromptItems() {\n    return Promise.resolve(this.inlinePromptItemElements)\n  }\n}\n\nclass DeferredPromptSource extends LocalFilterSource {\n  constructor(url) {\n    super();\n    this.url = url;\n\n    this.fetchPromptItems();\n  }\n\n  async fetchPromptItems() {\n    this.promptItems ??= await this.loadPromptItemsFromUrl(this.url);\n\n    return Promise.resolve(this.promptItems)\n  }\n}\n\nconst DEBOUNCE_INTERVAL = 200;\nconst MAX_RENDERED_SUGGESTIONS = 100;\n\nclass RemoteFilterSource extends BaseSource {\n  constructor(url) {\n    super();\n\n    this.baseURL = url;\n    this.loadAndFilterListItems = debounceAsync(this.fetchFilteredListItems.bind(this), DEBOUNCE_INTERVAL);\n  }\n\n  async buildListItems(filter = \"\") {\n    return await this.loadAndFilterListItems(filter)\n  }\n\n  promptItemFor(listItem) {\n    return this.promptItemByListItem.get(listItem)\n  }\n\n  async fetchFilteredListItems(filter) {\n    const promptItems = await this.loadPromptItemsFromUrl(this.#urlFor(filter));\n    return this.#buildListItemsFromPromptItems(promptItems)\n  }\n\n  #urlFor(filter) {\n    const url = new URL(this.baseURL, window.location.origin);\n    url.searchParams.append(\"filter\", filter);\n    return url.toString()\n  }\n\n  #buildListItemsFromPromptItems(promptItems) {\n    const listItems = [];\n    this.promptItemByListItem = new WeakMap();\n\n    for (const promptItem of promptItems) {\n      if (listItems.length >= MAX_RENDERED_SUGGESTIONS) break\n\n      const listItem = this.buildListItemElementFor(promptItem);\n      this.promptItemByListItem.set(listItem, promptItem);\n      listItems.push(listItem);\n    }\n\n    return listItems\n  }\n}\n\nconst NOTHING_FOUND_DEFAULT_MESSAGE = \"Nothing found\";\nconst FILTER_DEBOUNCE_INTERVAL = 50;\n\n// Start of line, or after a space or newline.\nconst DEFAULT_ONLY_AT_PATTERN = \"^|[ \\\\n]\";\n\nclass LexicalPromptElement extends HTMLElement {\n  #globalListeners = new ListenerBin()\n  #popoverListeners = new ListenerBin()\n  #debouncedFilterOptions = debounce(() => this.#filterOptions(), FILTER_DEBOUNCE_INTERVAL)\n\n  constructor() {\n    super();\n    this.showPopoverId = 0;\n  }\n\n  static observedAttributes = [ \"connected\" ]\n\n  connectedCallback() {\n    this.source = this.#createSource();\n\n    this.#addTriggerListener();\n    this.#removePopoverBeforeTurboCaches();\n    this.toggleAttribute(\"connected\", true);\n  }\n\n  disconnectedCallback() {\n    this.#popoverListeners.dispose();\n    this.#globalListeners.dispose();\n    this.source = null;\n    this.#removePopover();\n  }\n\n\n  attributeChangedCallback(name, oldValue, newValue) {\n    if (name === \"connected\" && this.isConnected && oldValue != null && oldValue !== newValue) {\n      requestAnimationFrame(() => this.#reconnect());\n    }\n  }\n\n  get name() {\n    return this.getAttribute(\"name\")\n  }\n\n  get trigger() {\n    return this.getAttribute(\"trigger\")\n  }\n\n  get supportsSpaceInSearches() {\n    return this.hasAttribute(\"supports-space-in-searches\")\n  }\n\n  get onlyAt() {\n    return this.getAttribute(\"only-at\")\n  }\n\n  get verticalDirection() {\n    return this.getAttribute(\"vertical-direction\")\n  }\n\n  get open() {\n    return this.popoverElement?.classList?.contains(\"lexxy-prompt-menu--visible\")\n  }\n\n  get closed() {\n    return !this.open\n  }\n\n  get #doesSpaceSelect() {\n    return !this.supportsSpaceInSearches\n  }\n\n  #createSource() {\n    const src = this.getAttribute(\"src\");\n    if (src) {\n      if (this.hasAttribute(\"remote-filtering\")) {\n        return new RemoteFilterSource(src)\n      } else {\n        return new DeferredPromptSource(src)\n      }\n    } else {\n      return new InlinePromptSource(this.querySelectorAll(\"lexxy-prompt-item\"))\n    }\n  }\n\n  #addTriggerListener() {\n    if (!this.#promptContentTypePermitted) return\n\n    this.#popoverListeners.track(this.#editor.registerUpdateListener(({ editorState }) => {\n      editorState.read(() => {\n        if (this.#selection.isInsideCodeBlock) return\n\n        const { node, offset } = this.#selection.selectedNodeWithOffset();\n        if (!node) return\n\n        if ($isTextNode(node)) {\n          const fullText = node.getTextContent();\n          const triggerLength = this.trigger.length;\n\n          // Check if we have enough characters for the trigger\n          if (offset >= triggerLength) {\n            const textBeforeCursor = fullText.slice(offset - triggerLength, offset);\n\n            if (textBeforeCursor === this.trigger) {\n              const textBeforeTrigger = $textBeforeOffset(node, offset - triggerLength);\n\n              if (this.#onlyAtRegExp.test(textBeforeTrigger)) {\n                this.#popoverListeners.dispose();\n                this.#showPopover();\n              }\n            }\n          }\n        }\n      });\n    }));\n  }\n\n  get #onlyAtRegExp() {\n    return new RegExp(`(?:${this.onlyAt ?? DEFAULT_ONLY_AT_PATTERN})$`)\n  }\n\n  get #promptContentTypePermitted() {\n    // `insert-editable-text` prompts never create attachments, so the\n    // editor's attachment support and content-type allowlist don't apply.\n    if (this.hasAttribute(\"insert-editable-text\")) return true\n\n    const el = this.#editorElement;\n    if (!el.supportsAttachments) {\n      return false\n    } else {\n      const templates = Array.from(this.querySelectorAll(\"template[type='editor']\"));\n      const types = templates.length\n        ? templates.map(t => t.getAttribute(\"content-type\") || this.#defaultPromptContentType)\n        : [ this.#defaultPromptContentType ];\n      return types.some(t => el.permitsAttachmentContentType(t))\n    }\n  }\n\n  #addCursorPositionListener() {\n    this.#popoverListeners.track(this.#editor.registerUpdateListener(({ editorState }) => {\n      if (this.closed) return\n\n      editorState.read(() => {\n        if (this.#selection.isInsideCodeBlock) {\n          this.#hidePopover();\n          return\n        }\n\n        const { node, offset } = this.#selection.selectedNodeWithOffset();\n        if (!node) return\n\n        if (this.#cursorIsTypingSearchTerm(node, offset)) {\n          if (!this.popoverElement.hasAttribute(\"data-anchored\")) {\n            this.#positionPopover();\n          }\n        } else {\n          this.#hidePopover();\n        }\n      });\n    }));\n  }\n\n  // The popover should stay open only while the cursor sits at the end of the\n  // trigger and its search term. When the cursor moves away \u2014 before the\n  // trigger, or past the token into later text \u2014 the text between the trigger\n  // and the cursor breaks that run and we dismiss. A newline always breaks the\n  // run; a space breaks it only for triggers that don't support spaces in\n  // searches, since those that do (e.g. `person:`) expect multi-word terms.\n  #cursorIsTypingSearchTerm(node, offset) {\n    if (!$isTextNode(node) || offset === 0) return false\n\n    const textBeforeCursor = node.getTextContent().slice(0, offset);\n    const lastTriggerIndex = textBeforeCursor.lastIndexOf(this.trigger);\n    if (lastTriggerIndex === -1) return false\n\n    const searchTerm = textBeforeCursor.slice(lastTriggerIndex + this.trigger.length);\n    const breakPattern = this.supportsSpaceInSearches ? /\\n/ : /[ \\n]/;\n    return !breakPattern.test(searchTerm)\n  }\n\n  get #editor() {\n    return this.#editorElement.editor\n  }\n\n  get #editorElement() {\n    return this.closest(\"lexxy-editor\")\n  }\n\n  get #selection() {\n    return this.#editorElement.selection\n  }\n\n  async #showPopover() {\n    const showId = ++this.showPopoverId;\n    this.popoverElement ??= await this.#buildPopover();\n    if (this.showPopoverId !== showId) return\n\n    this.#resetPopoverPosition();\n    await this.#filterOptions();\n    if (this.showPopoverId !== showId) return\n\n    this.popoverElement.classList.toggle(\"lexxy-prompt-menu--visible\", true);\n    this.#selectFirstOption();\n\n    this.#popoverListeners.track(\n      registerEventListener(this.#editorElement, \"keydown\", this.#handleKeydownOnPopover),\n      registerEventListener(this.#editorElement, \"lexxy:change\", this.#debouncedFilterOptions)\n    );\n\n    this.#registerKeyListeners();\n    this.#addCursorPositionListener();\n  }\n\n  #registerKeyListeners() {\n    // We can't use a regular keydown for Enter as Lexical handles it first\n    this.#popoverListeners.track(\n      this.#editor.registerCommand(KEY_ENTER_COMMAND, this.#handleSelectedOption.bind(this), COMMAND_PRIORITY_CRITICAL),\n      this.#editor.registerCommand(KEY_TAB_COMMAND, this.#handleSelectedOption.bind(this), COMMAND_PRIORITY_CRITICAL)\n    );\n\n    if (this.#doesSpaceSelect) {\n      this.#popoverListeners.track(this.#editor.registerCommand(KEY_SPACE_COMMAND, this.#handleSelectedOption.bind(this), COMMAND_PRIORITY_CRITICAL));\n      this.#popoverListeners.track(this.#editor.registerCommand(INPUT_COMMAND, this.#handleInputCommand.bind(this), COMMAND_PRIORITY_CRITICAL));\n    }\n\n    // Register arrow keys with CRITICAL priority to prevent Lexical's selection handlers from running\n    this.#popoverListeners.track(\n      this.#editor.registerCommand(KEY_ARROW_UP_COMMAND, this.#handleArrowUp.bind(this), COMMAND_PRIORITY_CRITICAL),\n      this.#editor.registerCommand(KEY_ARROW_DOWN_COMMAND, this.#handleArrowDown.bind(this), COMMAND_PRIORITY_CRITICAL)\n    );\n  }\n\n  #handleArrowUp(event) {\n    this.#moveSelectionUp();\n    event.preventDefault();\n    return true\n  }\n\n  #handleArrowDown(event) {\n    this.#moveSelectionDown();\n    event.preventDefault();\n    return true\n  }\n\n  #selectFirstOption() {\n    const firstOption = this.#listItemElements[0];\n\n    if (firstOption) {\n      this.#selectOption(firstOption);\n    }\n  }\n\n  get #listItemElements() {\n    return Array.from(this.popoverElement.querySelectorAll(\".lexxy-prompt-menu__item\"))\n  }\n\n  #selectOption(listItem, { scrollIntoView = false } = {}) {\n    this.#clearListItemSelection();\n    listItem.toggleAttribute(\"aria-selected\", true);\n    if (scrollIntoView) {\n      listItem.scrollIntoView({ block: \"nearest\", container: \"nearest\", behavior: \"smooth\" });\n    }\n\n    this.#setEditorAssociationAttribute(\"aria-controls\", this.popoverElement.id);\n    this.#setEditorAssociationAttribute(\"aria-activedescendant\", listItem.id);\n    this.#setEditorAssociationAttribute(\"aria-haspopup\", \"listbox\");\n  }\n\n  #clearListItemSelection() {\n    this.#listItemElements.forEach((item) => { item.toggleAttribute(\"aria-selected\", false); });\n  }\n\n  #clearSelection() {\n    this.#clearListItemSelection();\n    this.#editorContentElement.removeAttribute(\"aria-controls\");\n    this.#editorContentElement.removeAttribute(\"aria-activedescendant\");\n    this.#editorContentElement.removeAttribute(\"aria-haspopup\");\n  }\n\n  #setEditorAssociationAttribute(name, value) {\n    if (this.#editorContentElement.getAttribute(name) !== value) {\n      this.#editorContentElement.setAttribute(name, value);\n    }\n  }\n\n  // Right after a Turbo history restore the editor reconnects before the DOM selection\n  // is re-established, so the cursor geometry is momentarily unavailable. Anchoring then\n  // would pin the menu to the editor's left edge for the rest of the open cycle, so we\n  // skip it and let a later reposition anchor it once the selection is ready. The menu\n  // stays hidden until anchored (see the `[data-anchored]` rule in the stylesheet).\n  #positionPopover() {\n    const cursorPosition = this.#selection.cursorPosition;\n    if (!cursorPosition) return\n\n    const { x, y, fontSize } = cursorPosition;\n    const editorRect = this.#editorElement.getBoundingClientRect();\n    const contentRect = this.#editorContentElement.getBoundingClientRect();\n    const verticalOffset = contentRect.top - editorRect.top;\n\n    if (!this.popoverElement.hasAttribute(\"data-anchored\")) {\n      this.#setPopoverOffsetX(x);\n      this.#setPopoverOffsetY(y + verticalOffset);\n      this.popoverElement.toggleAttribute(\"data-anchored\", true);\n    }\n\n    const popoverRect = this.popoverElement.getBoundingClientRect();\n\n    if (popoverRect.right > editorRect.right) {\n      this.popoverElement.toggleAttribute(\"data-clipped-at-right\", true);\n    }\n\n    const forceTop = this.verticalDirection === \"top\";\n    const forceBottom = this.verticalDirection === \"bottom\";\n    const overflowsWindow = popoverRect.bottom > window.innerHeight;\n\n    if (!forceBottom && (forceTop || overflowsWindow)) {\n      this.#setPopoverOffsetY(contentRect.height - y + fontSize);\n      this.popoverElement.toggleAttribute(\"data-clipped-at-bottom\", true);\n    }\n  }\n\n  #setPopoverOffsetX(value) {\n    this.popoverElement.style.setProperty(\"--lexxy-prompt-offset-x\", `${value}px`);\n  }\n\n  #setPopoverOffsetY(value) {\n    this.popoverElement.style.setProperty(\"--lexxy-prompt-offset-y\", `${value}px`);\n  }\n\n  #resetPopoverPosition() {\n    this.popoverElement.removeAttribute(\"data-clipped-at-bottom\");\n    this.popoverElement.removeAttribute(\"data-clipped-at-right\");\n    this.popoverElement.removeAttribute(\"data-anchored\");\n  }\n\n  async #hidePopover() {\n    this.showPopoverId++;\n    this.#clearSelection();\n    this.popoverElement.classList.toggle(\"lexxy-prompt-menu--visible\", false);\n    this.#popoverListeners.dispose();\n\n    await nextFrame();\n    this.#addTriggerListener();\n  }\n\n  // The popover is appended to the <lexxy-editor> subtree, so Turbo serializes it\n  // into the page cache. Removing it before caching prevents an orphaned, unmanaged\n  // popover from being restored on history back/forward.\n  #removePopoverBeforeTurboCaches() {\n    this.#globalListeners.track(\n      registerEventListener(document, \"turbo:before-cache\", () => this.#removePopover())\n    );\n  }\n\n  #removePopover() {\n    this.#popoverListeners.dispose();\n    this.popoverElement?.remove();\n    this.popoverElement = null;\n  }\n\n  #filterOptions = async () => {\n    if (this.initialPrompt) {\n      this.initialPrompt = false;\n      return\n    }\n\n    if (this.#editorContents.containsTextBackUntil(this.trigger)) {\n      await this.#showFilteredOptions();\n\n      // Re-check after async operation \u2014 the trigger may have been consumed\n      // (e.g. markdown heading shortcut converted \"# \" to h1 during the fetch)\n      if (!this.#editorContents.containsTextBackUntil(this.trigger)) {\n        this.#hidePopover();\n        return\n      }\n\n      await nextFrame();\n      this.#positionPopover();\n    } else {\n      this.#hidePopover();\n    }\n  }\n\n  async #showFilteredOptions() {\n    const showId = this.showPopoverId;\n    const filter = this.#editorContents.textBackUntil(this.trigger);\n    const filteredListItems = await this.source.buildListItems(filter);\n    if (this.showPopoverId !== showId) return\n    if (!this.#editorContents.containsTextBackUntil(this.trigger)) return\n\n    this.popoverElement.innerHTML = \"\";\n\n    if (filteredListItems.length > 0) {\n      this.#showResults(filteredListItems);\n    } else {\n      this.#showEmptyResults();\n    }\n    this.#selectFirstOption();\n  }\n\n  #showResults(filteredListItems) {\n    this.popoverElement.classList.remove(\"lexxy-prompt-menu--empty\");\n    this.popoverElement.append(...filteredListItems);\n  }\n\n  #showEmptyResults() {\n    this.popoverElement.classList.add(\"lexxy-prompt-menu--empty\");\n    const el = createElement(\"li\", { textContent: this.#emptyResultsMessage });\n    el.classList.add(\"lexxy-prompt-menu__item--empty\");\n    this.popoverElement.append(el);\n  }\n\n  get #emptyResultsMessage() {\n    return this.getAttribute(\"empty-results\") || NOTHING_FOUND_DEFAULT_MESSAGE\n  }\n\n  #handleKeydownOnPopover = (event) => {\n    if (event.key === \"Escape\") {\n      this.#hidePopover();\n      this.#editorElement.focus();\n      event.stopPropagation();\n    } else if (event.key === \",\") {\n      event.preventDefault();\n      event.stopPropagation();\n      this.#optionWasSelected();\n      this.#editor.update(() => {\n        const selection = $getSelection();\n        if ($isRangeSelection(selection)) {\n          selection.insertText(\",\");\n        }\n      });\n    }\n    // Arrow keys are handled via Lexical commands\n  }\n\n  // Android Mobile keyboard doesn't trigger KEY_SPACE_COMMAND\n  #handleInputCommand(event) {\n    if (event.inputType === \"insertText\" && event.data === \" \") return this.#handleSelectedOption(event)\n  }\n\n  #moveSelectionDown() {\n    const nextIndex = this.#selectedIndex + 1;\n    if (nextIndex < this.#listItemElements.length) this.#selectOption(this.#listItemElements[nextIndex], { scrollIntoView: true });\n  }\n\n  #moveSelectionUp() {\n    const previousIndex = this.#selectedIndex - 1;\n    if (previousIndex >= 0) this.#selectOption(this.#listItemElements[previousIndex], { scrollIntoView: true });\n  }\n\n  get #selectedIndex() {\n    return this.#listItemElements.findIndex((item) => item.hasAttribute(\"aria-selected\"))\n  }\n\n  get #selectedListItem() {\n    return this.#listItemElements[this.#selectedIndex]\n  }\n\n  #handleSelectedOption(event) {\n    event.preventDefault();\n    event.stopPropagation();\n    this.#optionWasSelected();\n    return true\n  }\n\n  #optionWasSelected() {\n    this.#replaceTriggerWithSelectedItem();\n    this.#hidePopover();\n    this.#editorElement.focus();\n  }\n\n  #replaceTriggerWithSelectedItem() {\n    const promptItem = this.source.promptItemFor(this.#selectedListItem);\n\n    if (!promptItem) { return }\n\n    const templates = Array.from(promptItem.querySelectorAll(\"template[type='editor']\"));\n    const stringToReplace = `${this.trigger}${this.#editorContents.textBackUntil(this.trigger)}`;\n\n    if (this.hasAttribute(\"insert-editable-text\")) {\n      this.#insertTemplatesAsEditableText(templates, stringToReplace);\n    } else {\n      this.#insertTemplatesAsAttachments(templates, stringToReplace, promptItem.getAttribute(\"sgid\"));\n    }\n  }\n\n  #insertTemplatesAsEditableText(templates, stringToReplace) {\n    this.#editor.update(() => {\n      const nodes = templates.flatMap(template => this.#buildEditableTextNodes(template));\n      this.#editorContents.replaceTextBackUntil(stringToReplace, nodes);\n    });\n  }\n\n  #buildEditableTextNodes(template) {\n    return this.#editorElement.$generateNodesFromDOM(parseHtml(`${template.innerHTML}`))\n  }\n\n  #insertTemplatesAsAttachments(templates, stringToReplace, fallbackSgid = null) {\n    this.#editor.update(() => {\n      const attachmentNodes = this.#buildAttachmentNodes(templates, fallbackSgid);\n      const spacedAttachmentNodes = attachmentNodes.flatMap(node => [ node, this.#getSpacerTextNode() ]).slice(0, -1);\n      this.#editorContents.replaceTextBackUntil(stringToReplace, spacedAttachmentNodes);\n    });\n  }\n\n  #buildAttachmentNodes(templates, fallbackSgid = null) {\n    return templates\n      .filter(template => this.#editorElement.permitsAttachmentContentType(\n        template.getAttribute(\"content-type\") || this.#defaultPromptContentType))\n      .map(template => this.#buildAttachmentNode(\n        template.innerHTML,\n        template.getAttribute(\"content-type\") || this.#defaultPromptContentType,\n        template.getAttribute(\"sgid\") || fallbackSgid\n      ))\n  }\n\n  #getSpacerTextNode() {\n    return $createTextNode(\" \")\n  }\n\n  get #defaultPromptContentType() {\n    const attachmentContentTypeNamespace = Lexxy.global.get(\"attachmentContentTypeNamespace\");\n    return `application/vnd.${attachmentContentTypeNamespace}.${this.name}`\n  }\n\n  #buildAttachmentNode(innerHtml, contentType, sgid) {\n    return new CustomActionTextAttachmentNode({ sgid, contentType, innerHtml })\n  }\n\n  get #editorContents() {\n    return this.#editorElement.contents\n  }\n\n  get #editorContentElement() {\n    return this.#editorElement.editorContentElement\n  }\n\n  async #buildPopover() {\n    const popoverContainer = createElement(\"ul\", { role: \"listbox\", id: generateDomId(\"prompt-popover\") }); // Avoiding [popover] due to not being able to position at an arbitrary X, Y position.\n    popoverContainer.classList.add(\"lexxy-prompt-menu\");\n    popoverContainer.style.position = \"absolute\";\n    popoverContainer.setAttribute(\"nonce\", getNonce());\n    popoverContainer.append(...await this.source.buildListItems());\n    this.#globalListeners.track(registerEventListener(popoverContainer, \"click\", this.#handlePopoverClick));\n    this.#editorElement.appendChild(popoverContainer);\n    return popoverContainer\n  }\n\n  #handlePopoverClick = (event) => {\n    const listItem = event.target.closest(\".lexxy-prompt-menu__item\");\n    if (listItem) {\n      this.#selectOption(listItem);\n      this.#optionWasSelected();\n    }\n  }\n\n  #reconnect() {\n    this.disconnectedCallback();\n    this.connectedCallback();\n  }\n}\n\nclass CodeLanguagePicker extends HTMLElement {\n  #abortController = null\n  #listeners = new ListenerBin()\n\n  connectedCallback() {\n    this.editorElement = this.closest(\"lexxy-editor\");\n    this.editor = this.editorElement.editor;\n    this.classList.add(\"lexxy-floating-controls\");\n    this.#abortController = new AbortController();\n    this.#listeners.track(() => this.#abortController?.abort());\n\n    this.#attachLanguagePicker();\n    this.#hide();\n    this.#monitorForCodeBlockSelection();\n  }\n\n  disconnectedCallback() {\n    this.dispose();\n  }\n\n  dispose() {\n    this.#listeners.dispose();\n  }\n\n  #attachLanguagePicker() {\n    this.languagePickerElement = this.#findLanguagePicker() ?? this.#createLanguagePicker();\n\n    const signal = this.#abortController.signal;\n\n    this.#listeners.track(registerEventListener(this.languagePickerElement, \"change\", () => {\n      this.#updateCodeBlockLanguage(this.languagePickerElement.value);\n    }, { signal }));\n\n    this.#listeners.track(registerEventListener(this.languagePickerElement, \"mousedown\", (event) => {\n      this.#dispatchOpenEvent(event);\n    }, { signal }));\n\n    this.languagePickerElement.setAttribute(\"nonce\", getNonce());\n    this.appendChild(this.languagePickerElement);\n  }\n\n  #findLanguagePicker() {\n    return this.querySelector(\"select\")\n  }\n\n  #createLanguagePicker() {\n    const selectElement = createElement(\"select\", { className: \"lexxy-code-language-picker\", \"aria-label\": \"Pick a language\u2026\", name: \"lexxy-code-language\" });\n\n    for (const [ value, label ] of Object.entries(this.#languages)) {\n      const option = document.createElement(\"option\");\n      option.value = value;\n      option.textContent = label;\n      selectElement.appendChild(option);\n    }\n\n    return selectElement\n  }\n\n  get #languages() {\n    const languages = { ...CODE_LANGUAGE_FRIENDLY_NAME_MAP };\n\n    languages.ruby ||= \"Ruby\";\n    languages.php ||= \"PHP\";\n    languages.go ||= \"Go\";\n    languages.bash ||= \"Bash\";\n    languages.json ||= \"JSON\";\n    languages.diff ||= \"Diff\";\n    languages.kotlin ||= \"Kotlin\";\n\n\n    // Place the \"plain\" entry first, then the rest of language sorted alphabetically\n    delete languages.plain;\n    const sortedEntries = Object.entries(languages)\n      .sort((a, b) => a[1].localeCompare(b[1]));\n    return { plain: \"Plain text\", ...Object.fromEntries(sortedEntries) }\n  }\n\n  #dispatchOpenEvent(event) {\n    const handled = !dispatch(this.editorElement, \"lexxy:code-language-picker-open\", {\n      languages: this.#bridgeLanguages,\n      currentLanguage: this.languagePickerElement.value\n    }, true);\n\n    if (handled) {\n      event.preventDefault();\n    }\n  }\n\n  get #bridgeLanguages() {\n    return Object.entries(this.#languages).map(([ key, name ]) => ({ key, name }))\n  }\n\n  #updateCodeBlockLanguage(language) {\n    this.editor.update(() => {\n      const codeNode = this.#getCurrentCodeNode();\n\n      if (codeNode) {\n        codeNode.setLanguage(language);\n      }\n    });\n  }\n\n  #monitorForCodeBlockSelection() {\n    this.#listeners.track(this.editor.registerUpdateListener(({ editorState }) => {\n      editorState.read(() => {\n        const codeNode = this.#getCurrentCodeNode();\n\n        if (codeNode) {\n          this.#codeNodeWasSelected(codeNode);\n        } else {\n          this.#hide();\n        }\n      });\n    }));\n  }\n\n  #getCurrentCodeNode() {\n    return this.editorElement.selection.nearestNodeOfType(CodeNode)\n  }\n\n  #codeNodeWasSelected(codeNode) {\n    const language = codeNode.getLanguage();\n\n    this.#updateLanguagePickerWith(language);\n    this.#show();\n    this.#positionLanguagePicker(codeNode);\n  }\n\n  #updateLanguagePickerWith(language) {\n    if (this.languagePickerElement && language) {\n      const normalizedLanguage = normalizeCodeLang(language);\n      this.languagePickerElement.value = normalizedLanguage;\n    }\n  }\n\n  #positionLanguagePicker(codeNode) {\n    const codeElement = this.editor.getElementByKey(codeNode.getKey());\n    if (!codeElement) return\n\n    const codeRect = codeElement.getBoundingClientRect();\n    const editorRect = this.editorElement.getBoundingClientRect();\n    const relativeTop = codeRect.top - editorRect.top;\n    const relativeRight = editorRect.right - codeRect.right;\n\n    this.style.top = `${relativeTop}px`;\n    this.style.right = `${relativeRight}px`;\n  }\n\n  #show() {\n    this.hidden = false;\n  }\n\n  #hide() {\n    this.hidden = true;\n  }\n}\n\nclass AlternativeTextDialog {\n  #editor\n  #editorElement\n  #dialog\n  #input\n  #nodeKey\n  #elementToRefocus\n  #listeners = new ListenerBin()\n\n  constructor(editorElement) {\n    this.#editor = editorElement.editor;\n    this.#editorElement = editorElement;\n    this.#dialog = createElement(\"dialog\", { className: \"lexxy-alternative-text-dialog\", ariaLabel: \"Alternative text\" });\n    this.#input = createElement(\"textarea\", { rows: 1, autofocus: true, ariaLabel: \"Description\", placeholder: \"Keep it short, but enough to convey the context\u2026\" });\n\n    const title = createElement(\"h2\", { textContent: \"Describe the image for people who can't see it:\" });\n\n    const actions = createElement(\"div\", { className: \"lexxy-alternative-text-dialog__actions\" });\n    const cancel = createElement(\"button\", { type: \"button\", textContent: \"Cancel\" });\n    const save = createElement(\"button\", { type: \"button\", className: \"lexxy-alternative-text-dialog__save\", textContent: \"Save\" });\n    actions.append(cancel, save);\n\n    const controls = createElement(\"div\", { className: \"lexxy-alternative-text-dialog__controls\" });\n    controls.append(this.#input, actions);\n    this.#dialog.append(title, controls);\n    editorElement.appendChild(this.#dialog);\n\n    this.#listeners.track(\n      registerEventListener(cancel, \"click\", () => this.#close()),\n      registerEventListener(save, \"click\", () => this.#save()),\n      registerEventListener(this.#dialog, \"keydown\", this.#handleKeyDown),\n      registerEventListener(document, \"pointerdown\", this.#closeOnClickOutside)\n    );\n  }\n\n  dispose() {\n    this.#dialog.remove();\n    this.#listeners.dispose();\n  }\n\n  open(nodeKey) {\n    const description = this.#editor.read(() => {\n      const node = $getNodeByKey(nodeKey);\n      if ($isActionTextAttachmentNode(node)) {\n        return node.altText\n      }\n    });\n\n    if (description !== undefined) {\n      this.#nodeKey = nodeKey;\n      this.#input.value = description;\n      this.#anchorBelowAttachment(nodeKey);\n      this.#elementToRefocus = document.activeElement;\n      this.#editorElement.querySelector(\"lexxy-toolbar\")?.closeDropdowns();\n      this.#dialog.show();\n      this.#input.focus();\n    }\n  }\n\n  #anchorBelowAttachment(nodeKey) {\n    const figureElement = this.#editor.getElementByKey(nodeKey);\n    if (figureElement) {\n      const rect = figureElement.getBoundingClientRect();\n      const editorRect = this.#editorElement.getBoundingClientRect();\n      const bottom = rect.bottom - editorRect.top - this.#editorElement.clientTop + this.#editorElement.scrollTop;\n      this.#dialog.style.setProperty(\"--lexxy-anchor-bottom\", `${bottom}px`);\n    }\n  }\n\n  #save() {\n    const description = this.#input.value.trim();\n    this.#editor.update(() => {\n      const node = $getNodeByKey(this.#nodeKey);\n      if ($isActionTextAttachmentNode(node) && node.altText !== description) {\n        node.getWritable().altText = description;\n      }\n    }, { tag: [ HISTORY_PUSH_TAG, SKIP_DOM_SELECTION_TAG ] });\n    this.#close();\n  }\n\n  #handleKeyDown = (event) => {\n    event.stopPropagation();\n    if (event.key === \"Escape\") {\n      this.#close();\n    } else {\n      trapFocusAtTabBoundary(this.#dialog, event);\n    }\n  }\n\n  // Dismissing by clicking elsewhere must leave focus where the click landed.\n  #closeOnClickOutside = (event) => {\n    if (this.#dialog.open && !this.#dialog.contains(event.target)) {\n      this.#close({ refocus: false });\n    }\n  }\n\n  #close({ refocus = true } = {}) {\n    this.#dialog.close();\n    if (refocus && this.#elementToRefocus?.isConnected) {\n      this.#elementToRefocus.focus();\n    }\n    this.#elementToRefocus = null;\n  }\n}\n\nconst DELETE_ICON = `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\">\n  <path d=\"M11.2041 1.01074C12.2128 1.113 13 1.96435 13 3V4H15L15.1025 4.00488C15.6067 4.05621 16 4.48232 16 5C16 5.55228 15.5523 6 15 6H14.8457L14.1416 15.1533C14.0614 16.1953 13.1925 17 12.1475 17H5.85254L5.6582 16.9902C4.76514 16.9041 4.03607 16.2296 3.88184 15.3457L3.8584 15.1533L3.1543 6H3C2.44772 6 2 5.55228 2 5C2 4.44772 2.44772 4 3 4H5V3C5 1.89543 5.89543 1 7 1H11L11.2041 1.01074ZM5.85254 15H12.1475L12.8398 6H5.16016L5.85254 15ZM7 4H11V3H7V4Z\"/>\n</svg>`;\n\nclass AttachmentToolbar extends HTMLElement {\n  #listeners = new ListenerBin()\n  #buttons = []\n  #alternativeTextButton\n  #alternativeTextDialog\n  #currentNodeKey = null\n  #reflowObserver = new ResizeObserver(() => this.#updatePosition())\n  #presentationObserver = new MutationObserver(() => this.#refresh())\n  #observedElement = null\n\n  connectedCallback() {\n    this.classList.add(\"lexxy-floating-controls\");\n    this.role = \"toolbar\";\n    this.hidden = true;\n\n    if (this.#editor) {\n      this.#setUpButtons();\n      this.#monitorSelection();\n      this.#followScrolling();\n      this.#registerKeyboardShortcut();\n    }\n  }\n\n  disconnectedCallback() {\n    this.dispose();\n  }\n\n  dispose() {\n    this.#listeners.dispose();\n    this.#reflowObserver.disconnect();\n    this.#presentationObserver.disconnect();\n    this.#alternativeTextDialog?.dispose();\n  }\n\n  get #editor() {\n    return this.#editorElement?.editor\n  }\n\n  get #editorElement() {\n    return this.closest(\"lexxy-editor\")\n  }\n\n  #setUpButtons() {\n    this.innerHTML = \"\";\n\n    const container = createElement(\"div\", { className: \"lexxy-floating-controls__group\" });\n    container.appendChild(this.#createAlternativeTextButton());\n    container.appendChild(this.#createRemoveButton());\n    this.#alternativeTextDialog = new AlternativeTextDialog(this.#editorElement);\n    this.appendChild(container);\n\n    this.#buttons = Array.from(this.querySelectorAll(\"button\"));\n    this.#listeners.track(\n      registerEventListener(this, \"keydown\", this.#navigateOrExit),\n      registerEventListener(this, \"focusout\", this.#resetTabIndexOnExit)\n    );\n  }\n\n  #createRemoveButton() {\n    const button = createElement(\"button\", {\n      type: \"button\",\n      className: \"lexxy-attachment-toolbar__remove\",\n      ariaLabel: \"Remove\",\n      tabIndex: -1\n    });\n    button.innerHTML = DELETE_ICON;\n    this.#listeners.track(registerEventListener(button, \"click\", () => this.#removeSelectedNode()));\n    return button\n  }\n\n  #removeSelectedNode() {\n    if (this.#hasSelectedNode) {\n      this.#editor.update(() => $getNodeByKey(this.#currentNodeKey)?.remove());\n      this.#editor.focus();\n    }\n  }\n\n  get #hasSelectedNode() {\n    return this.#currentNodeKey !== null\n  }\n\n  #createAlternativeTextButton() {\n    this.#alternativeTextButton = createElement(\"button\", {\n      type: \"button\",\n      className: \"lexxy-attachment-toolbar__alternative-text\",\n      ariaLabel: \"Alternative text\",\n      title: \"Alternative text\",\n      ariaHasPopup: \"dialog\",\n      tabIndex: -1\n    });\n    this.#alternativeTextButton.appendChild(createElement(\"span\", null, \"ALT\"));\n    this.#listeners.track(registerEventListener(this.#alternativeTextButton, \"click\", () => {\n      this.#alternativeTextDialog.open(this.#currentNodeKey);\n    }));\n    return this.#alternativeTextButton\n  }\n\n  #navigateOrExit = (event) => {\n    if (event.key === \"Escape\") {\n      event.preventDefault();\n      event.stopPropagation();\n      this.#returnFocusToEditor();\n    } else {\n      handleRollingTabIndex(this.#buttons, event);\n    }\n  }\n\n  #returnFocusToEditor() {\n    this.#editor.getRootElement()?.focus({ preventScroll: true });\n    if (this.#currentNodeKey) {\n      const nodeKey = this.#currentNodeKey;\n      this.#editor.update(() => {\n        const node = $getNodeByKey(nodeKey);\n        if (node) $setSelection($createNodeSelectionWith(node));\n      });\n    }\n  }\n\n  #resetTabIndexOnExit = (event) => {\n    if (!this.contains(event.relatedTarget)) {\n      this.#buttons.forEach(button => button.tabIndex = -1);\n    }\n  }\n\n  #monitorSelection() {\n    this.#listeners.track(\n      registerLabelledDecoratorSelection(this.#editor, (target) => this.#updateForSelection(target))\n    );\n  }\n\n  #updateForSelection(target) {\n    if (target) {\n      this.#show(target.key);\n    } else {\n      this.#hide();\n    }\n  }\n\n  #show(nodeKey) {\n    this.#currentNodeKey = nodeKey;\n    this.#refresh();\n    this.hidden = false;\n    this.#reflowObserver.observe(this.#editorElement);\n  }\n\n  #refresh() {\n    if (this.#hasSelectedNode) {\n      this.#watchPresentation(this.#currentNodeKey);\n      this.#describeNode(this.#currentNodeKey);\n      this.#updatePosition();\n    }\n  }\n\n  // Failed previews change presentation without a Lexical update, and a node\n  // can replace its figure without changing its key.\n  #watchPresentation(nodeKey) {\n    const element = this.#editor.getElementByKey(nodeKey);\n    if (element !== this.#observedElement) {\n      this.#presentationObserver.disconnect();\n      this.#observedElement = element;\n      if (element) this.#presentationObserver.observe(element, { attributes: true, attributeFilter: [ \"class\" ] });\n    }\n  }\n\n  #describeNode(nodeKey) {\n    const element = this.#editor.getElementByKey(nodeKey);\n\n    this.#editor.getEditorState().read(() => {\n      const node = $getNodeByKey(nodeKey);\n      this.#alternativeTextButton.hidden = !this.#canEditAlternativeText(node);\n      this.dataset.nodeType = node.getType();\n      this.dataset.presentation = this.#presentationOf(node, element);\n\n      if (node.contentType) {\n        this.dataset.contentType = node.contentType;\n      } else {\n        delete this.dataset.contentType;\n      }\n    });\n  }\n\n  #canEditAlternativeText(node) {\n    return this.#editorElement.dataset.actionTextSupportsAlt !== \"false\"\n      && node.getType() === \"action_text_attachment\"\n      && node.isPreviewableAttachment\n  }\n\n  #presentationOf(node, element) {\n    if ($isImageGalleryNode(node.getParent())) {\n      return \"gallery\"\n    } else if (node.isInline() && this.#rendersInline(element)) {\n      return \"inline\"\n    } else if (element?.classList.contains(\"attachment--preview\")) {\n      return \"preview\"\n    } else {\n      return \"block\"\n    }\n  }\n\n  #rendersInline(element) {\n    return element != null && getComputedStyle(element).display.startsWith(\"inline\")\n  }\n\n  #updatePosition() {\n    const figureElement = this.#editor.getElementByKey(this.#currentNodeKey);\n    if (figureElement) {\n      const rect = figureElement.getBoundingClientRect();\n      const editorRect = this.#editorElement.getBoundingClientRect();\n      // We are positioned against the editor's padding box, but the rect measures its border box.\n      const borderTop = this.#editorElement.clientTop;\n      const borderLeft = this.#editorElement.clientLeft;\n      this.style.setProperty(\"--lexxy-anchor-top\", `${rect.top - editorRect.top - borderTop}px`);\n      this.style.setProperty(\"--lexxy-anchor-left\", `${rect.left - editorRect.left - borderLeft}px`);\n      this.style.setProperty(\"--lexxy-anchor-width\", `${rect.width}px`);\n      this.style.setProperty(\"--lexxy-anchor-height\", `${rect.height}px`);\n      this.#flipWhenOverflowing(editorRect);\n    }\n  }\n\n  #flipWhenOverflowing(editorRect) {\n    this.removeAttribute(\"data-overflow\");\n    if (this.getBoundingClientRect().right > editorRect.right) {\n      this.setAttribute(\"data-overflow\", \"\");\n    }\n  }\n\n  #hide() {\n    if (this.#hasSelectedNode) {\n      this.#currentNodeKey = null;\n      this.hidden = true;\n      this.#reflowObserver.disconnect();\n      this.#presentationObserver.disconnect();\n      this.#observedElement = null;\n    }\n  }\n\n  // Scrolling inside the editor moves the figure without resizing anything.\n  #followScrolling() {\n    this.#listeners.track(registerEventListener(this.#editorElement, \"scroll\", () => this.#updatePosition(), { capture: true, passive: true }));\n  }\n\n  #registerKeyboardShortcut() {\n    this.#listeners.track(this.#editor.registerCommand(\n      KEY_DOWN_COMMAND,\n      this.#focusToolbarOnAltF10,\n      COMMAND_PRIORITY_HIGH\n    ));\n  }\n\n  #focusToolbarOnAltF10 = (event) => {\n    if (this.#hasSelectedNode && event.altKey && event.key === \"F10\") {\n      event.preventDefault();\n      this.#buttons.find(isActiveAndVisible)?.focus();\n      return true\n    } else {\n      return false\n    }\n  }\n}\n\nclass TableController {\n  #listeners = new ListenerBin()\n\n  constructor(editorElement) {\n    this.editor = editorElement.editor;\n    this.contents = editorElement.contents;\n    this.selection = editorElement.selection;\n\n    this.currentTableNodeKey = null;\n    this.currentCellKey = null;\n\n    this.#registerKeyHandlers();\n  }\n\n  destroy() {\n    this.currentTableNodeKey = null;\n    this.currentCellKey = null;\n\n    this.#listeners.dispose();\n  }\n\n  get currentCell() {\n    if (!this.currentCellKey) return null\n\n    return this.editor.getEditorState().read(() => {\n      const cell = $getNodeByKey(this.currentCellKey);\n      return (cell instanceof TableCellNode) ? cell : null\n    })\n  }\n\n  get currentTableNode() {\n    if (!this.currentTableNodeKey) return null\n\n    return this.editor.getEditorState().read(() => {\n      const tableNode = $getNodeByKey(this.currentTableNodeKey);\n      return (tableNode instanceof TableNode) ? tableNode : null\n    })\n  }\n\n  get currentRowCells() {\n    const currentRowIndex = this.currentRowIndex;\n\n    const rows = this.tableRows;\n    if (!rows) return null\n\n    return this.editor.getEditorState().read(() => {\n      return rows[currentRowIndex]?.getChildren() ?? null\n    }) ?? null\n  }\n\n  get currentRowIndex() {\n    const currentCell = this.currentCell;\n    if (!currentCell) return 0\n\n    return this.editor.getEditorState().read(() => {\n      return $getTableRowIndexFromTableCellNode(currentCell)\n    }) ?? 0\n  }\n\n  get currentColumnCells() {\n    const columnIndex = this.currentColumnIndex;\n\n    const rows = this.tableRows;\n    if (!rows) return null\n\n    return this.editor.getEditorState().read(() => {\n      return rows.map(row => row.getChildAtIndex(columnIndex))\n    }) ?? null\n  }\n\n  get currentColumnIndex() {\n    const currentCell = this.currentCell;\n    if (!currentCell) return 0\n\n    return this.editor.getEditorState().read(() => {\n      return $getTableColumnIndexFromTableCellNode(currentCell)\n    }) ?? 0\n  }\n\n  get tableRows() {\n    return this.editor.getEditorState().read(() => {\n      return this.currentTableNode?.getChildren()\n    }) ?? null\n  }\n\n  updateSelectedTable() {\n    let cellNode = null;\n    let tableNode = null;\n\n    this.editor.getEditorState().read(() => {\n      const selection = $getSelection();\n      if (!selection || !this.selection.isTableCellSelected) return\n\n      const node = selection.getNodes()[0];\n\n      cellNode = $findCellNode(node);\n      tableNode = $findTableNode(node);\n    });\n\n    this.currentCellKey = cellNode?.getKey() ?? null;\n    this.currentTableNodeKey = tableNode?.getKey() ?? null;\n\n    return tableNode\n  }\n\n  executeTableCommand(command, customIndex = null) {\n    if (command.action === \"delete\" && command.childType === \"table\") {\n      this.#deleteTable();\n      return\n    }\n\n    if (command.action === \"toggle\") {\n      this.#executeToggleStyle(command);\n      return\n    }\n\n    this.#executeCommand(command, customIndex);\n  }\n\n  #executeCommand(command, customIndex = null) {\n    this.#selectCellAtSelection();\n    this.editor.dispatchCommand(this.#commandName(command));\n    this.#selectNextBestCell(command, customIndex);\n  }\n\n  #executeToggleStyle(command) {\n    const childType = command.childType;\n\n    let cells = null;\n    let headerState = null;\n\n    if (childType === \"row\") {\n      cells = this.currentRowCells;\n      headerState = TableCellHeaderStates.ROW;\n    } else if (childType === \"column\") {\n      cells = this.currentColumnCells;\n      headerState = TableCellHeaderStates.COLUMN;\n    }\n\n    if (!cells || cells.length === 0) return\n\n    this.editor.update(() => {\n      const firstCell = $getTableCellNodeFromLexicalNode(cells[0]);\n      if (!firstCell) return\n\n      const currentStyle = firstCell.getHeaderStyles();\n      const newStyle = currentStyle ^ headerState;\n\n      cells.forEach(cell => {\n        this.#setHeaderStyle(cell, newStyle, headerState);\n      });\n    });\n  }\n\n  #deleteTable() {\n    this.#selectCellAtSelection();\n    this.editor.dispatchCommand(\"deleteTable\");\n  }\n\n  #selectCellAtSelection() {\n    this.editor.update(() => {\n      const selection = $getSelection();\n      if (!selection) return\n\n      const node = selection.getNodes()[0];\n\n      $findCellNode(node)?.selectEnd();\n    });\n  }\n\n  #commandName(command) {\n    const { action, childType, direction } = command;\n\n    const childTypeSuffix = upcaseFirst(childType);\n    const directionSuffix = action == \"insert\" ? upcaseFirst(direction) : \"\";\n    return `${action}Table${childTypeSuffix}${directionSuffix}`\n  }\n\n  #setHeaderStyle(cell, newStyle, headerState) {\n    const tableCellNode = $getTableCellNodeFromLexicalNode(cell);\n    tableCellNode?.setHeaderStyles(newStyle, headerState);\n  }\n\n  async #selectCellAtIndex(rowIndex, columnIndex) {\n    // We wait for next frame, otherwise table operations might not have completed yet.\n    await nextFrame();\n\n    if (!this.currentTableNode) return\n\n    const rows = this.tableRows;\n    if (!rows) return\n\n    const row = rows[rowIndex];\n    if (!row) return\n\n    this.editor.update(() => {\n      const cell = $getTableCellNodeFromLexicalNode(row.getChildAtIndex(columnIndex));\n      cell?.selectEnd();\n    });\n  }\n\n  #selectNextBestCell(command, customIndex = null) {\n    const { childType, direction } = command;\n\n    let rowIndex = this.currentRowIndex;\n    let columnIndex = customIndex !== null ? customIndex : this.currentColumnIndex;\n\n    const deleteOffset = command.action === \"delete\" ? -1 : 0;\n    const offset = direction === \"after\" ? 1 : deleteOffset;\n\n    if (childType === \"row\") {\n      rowIndex += offset;\n    } else if (childType === \"column\") {\n      columnIndex += offset;\n    }\n\n    this.#selectCellAtIndex(rowIndex, columnIndex);\n  }\n\n  #selectNextRow() {\n    const rows = this.tableRows;\n    if (!rows) return\n\n    const nextRow = rows.at(this.currentRowIndex + 1);\n    if (!nextRow) return\n\n    this.editor.update(() => {\n      nextRow.getChildAtIndex(this.currentColumnIndex)?.selectEnd();\n    });\n  }\n\n  #selectPreviousCell() {\n    const cell = this.currentCell;\n    if (!cell) return\n\n    this.editor.update(() => {\n      cell.selectPrevious();\n    });\n  }\n\n  #insertRowAndSelectFirstCell() {\n    this.executeTableCommand({ action: \"insert\", childType: \"row\", direction: \"after\" }, 0);\n  }\n\n  #deleteRowAndSelectLastCell() {\n    this.executeTableCommand({ action: \"delete\", childType: \"row\" }, -1);\n  }\n\n  #deleteRowAndSelectNextNode() {\n    const tableNode = this.currentTableNode;\n    this.executeTableCommand({ action: \"delete\", childType: \"row\" });\n\n    this.editor.update(() => {\n      const next = tableNode?.getNextSibling();\n      if ($isParagraphNode(next)) {\n        next.selectStart();\n      } else {\n        const newParagraph = $createParagraphNode();\n        this.currentTableNode.insertAfter(newParagraph);\n        newParagraph.selectStart();\n      }\n    });\n  }\n\n  #isCurrentCellEmpty() {\n    if (!this.currentTableNode) return false\n\n    const cell = this.currentCell;\n    if (!cell) return false\n\n    return cell.getTextContent().trim() === \"\"\n  }\n\n  #isCurrentRowLast() {\n    if (!this.currentTableNode) return false\n\n    const rows = this.tableRows;\n    if (!rows) return false\n\n    return rows.length === this.currentRowIndex + 1\n  }\n\n  #isCurrentRowEmpty() {\n    if (!this.currentTableNode) return false\n\n    const cells = this.currentRowCells;\n    if (!cells) return false\n\n    return cells.every(cell => cell.getTextContent().trim() === \"\")\n  }\n\n  #isFirstCellInRow() {\n    if (!this.currentTableNode) return false\n\n    const cells = this.currentRowCells;\n    if (!cells) return false\n\n    return cells.indexOf(this.currentCell) === 0\n  }\n\n  #registerKeyHandlers() {\n    // We can't prevent these externally using regular keydown because Lexical handles it first.\n    this.#listeners.track(\n      this.editor.registerCommand(KEY_BACKSPACE_COMMAND, (event) => this.#handleBackspaceKey(event), COMMAND_PRIORITY_HIGH),\n      this.editor.registerCommand(KEY_ENTER_COMMAND, (event) => this.#handleEnterKey(event), COMMAND_PRIORITY_HIGH)\n    );\n  }\n\n  #handleBackspaceKey(event) {\n    if (!this.currentTableNode) return false\n\n    if (this.#isCurrentRowEmpty() && this.#isFirstCellInRow()) {\n      event.preventDefault();\n      this.#deleteRowAndSelectLastCell();\n      return true\n    }\n\n    if (this.#isCurrentCellEmpty() && !this.#isFirstCellInRow()) {\n      event.preventDefault();\n      this.#selectPreviousCell();\n      return true\n    }\n\n    return false\n  }\n\n  #handleEnterKey(event) {\n    if ((event.ctrlKey || event.metaKey) || event.shiftKey || !this.currentTableNode) return false\n\n    if (this.selection.isInsideList || this.selection.isInsideCodeBlock) return false\n\n    event.preventDefault();\n\n    if (this.#isCurrentRowLast() && this.#isCurrentRowEmpty()) {\n      this.#deleteRowAndSelectNextNode();\n    } else if (this.#isCurrentRowLast()) {\n      this.#insertRowAndSelectFirstCell();\n    } else {\n      this.#selectNextRow();\n    }\n\n    return true\n  }\n}\n\nvar TableIcons = {\n  \"insert-row-before\":\n    `<svg  viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7.86804e-07 15C8.29055e-07 15.8284 0.671574 16.5 1.5 16.5H15L15.1533 16.4922C15.8593 16.4205 16.4205 15.8593 16.4922 15.1533L16.5 15V4.5L16.4922 4.34668C16.4154 3.59028 15.7767 3 15 3H13.5L13.5 4.5H15V9H1.5L1.5 4.5L3 4.5V3H1.5C0.671574 3 1.20956e-06 3.67157 1.24577e-06 4.5L7.86804e-07 15ZM15 10.5V15H1.5L1.5 10.5H15Z\"/>\n    <path d=\"M4.5 4.5H7.5V7.5H9V4.5H12L12 3L9 3V6.55671e-08L7.5 0V3L4.5 3V4.5Z\"/>\n    </svg>`,\n\n  \"insert-row-after\":\n    `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M7.86804e-07 13.5C7.50592e-07 14.3284 0.671574 15 1.5 15H3V13.5H1.5L1.5 9L15 9V13.5H13.5V15H15C15.7767 15 16.4154 14.4097 16.4922 13.6533L16.5 13.5V3L16.4922 2.84668C16.4205 2.14069 15.8593 1.57949 15.1533 1.50781L15 1.5L1.5 1.5C0.671574 1.5 1.28803e-06 2.17157 1.24577e-06 3L7.86804e-07 13.5ZM15 3V7.5L1.5 7.5L1.5 3L15 3Z\"/>\n    <path d=\"M7.5 15V18H9V15H12V13.5H9V10.5H7.5V13.5H4.5V15H7.5Z\"/>\n    </svg>`,\n\n  \"delete-row\":\n    `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M16.4922 12.1533C16.4154 12.9097 15.7767 13.5 15 13.5L12 13.5V12H15V6L1.5 6L1.5 12H4.5V13.5H1.5C0.723337 13.5 0.0846104 12.9097 0.00781328 12.1533L7.86804e-07 12L1.04907e-06 6C1.17362e-06 5.22334 0.590278 4.58461 1.34668 4.50781L1.5 4.5L15 4.5C15.8284 4.5 16.5 5.17157 16.5 6V12L16.4922 12.1533Z\"/>\n    <path d=\"M10.3711 15.9316L8.25 13.8096L6.12793 15.9316L5.06738 14.8711L7.18945 12.75L5.06738 10.6289L6.12793 9.56836L8.25 11.6895L10.3711 9.56836L11.4316 10.6289L9.31055 12.75L11.4316 14.8711L10.3711 15.9316Z\"/>\n    </svg>`,\n\n  \"toggle-row\":\n    `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M0.00781328 13.6533C0.0846108 14.4097 0.723337 15 1.5 15L15 15L15.1533 14.9922C15.8593 14.9205 16.4205 14.3593 16.4922 13.6533L16.5 13.5V4.5L16.4922 4.34668C16.4205 3.64069 15.8593 3.07949 15.1533 3.00781L15 3L1.5 3C0.671574 3 1.24863e-06 3.67157 1.18021e-06 4.5L7.86804e-07 13.5L0.00781328 13.6533ZM15 9V13.5L1.5 13.5L1.5 9L15 9Z\"/>\n    </svg>`,\n\n  \"insert-column-before\":\n    `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M4.5 0C3.67157 0 3 0.671573 3 1.5V3H4.5V1.5H9V15H4.5V13.5H3V15C3 15.7767 3.59028 16.4154 4.34668 16.4922L4.5 16.5H15L15.1533 16.4922C15.8593 16.4205 16.4205 15.8593 16.4922 15.1533L16.5 15V1.5C16.5 0.671573 15.8284 6.03989e-09 15 0H4.5ZM15 15H10.5V1.5H15V15Z\"/>\n    <path d=\"M3 7.5H0V9H3V12H4.5V9H7.5V7.5H4.5V4.5H3V7.5Z\"/>\n    </svg>`,\n\n  \"insert-column-after\":\n    `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13.5 0C14.3284 0 15 0.671573 15 1.5V3H13.5V1.5H9V15H13.5V13.5H15V15C15 15.7767 14.4097 16.4154 13.6533 16.4922L13.5 16.5H3L2.84668 16.4922C2.14069 16.4205 1.57949 15.8593 1.50781 15.1533L1.5 15V1.5C1.5 0.671573 2.17157 6.03989e-09 3 0H13.5ZM3 15H7.5V1.5H3V15Z\"/>\n    <path d=\"M15 7.5H18V9H15V12H13.5V9H10.5V7.5H13.5V4.5H15V7.5Z\"/>\n    </svg>`,\n\n  \"delete-column\":\n    `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M12.1533 0.0078125C12.9097 0.0846097 13.5 0.723336 13.5 1.5V4.5H12V1.5H6V15H12V12H13.5V15C13.5 15.7767 12.9097 16.4154 12.1533 16.4922L12 16.5H6C5.22334 16.5 4.58461 15.9097 4.50781 15.1533L4.5 15V1.5C4.5 0.671573 5.17157 2.41596e-08 6 0H12L12.1533 0.0078125Z\"/>\n    <path d=\"M15.9316 6.12891L13.8105 8.24902L15.9326 10.3711L14.8711 11.4316L12.75 9.31055L10.6289 11.4316L9.56738 10.3711L11.6885 8.24902L9.56836 6.12891L10.6289 5.06836L12.75 7.18848L14.8711 5.06836L15.9316 6.12891Z\"/>\n    </svg>`,\n\n  \"toggle-column\":\n    `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M13.6533 17.9922C14.4097 17.9154 15 17.2767 15 16.5L15 3L14.9922 2.84668C14.9205 2.14069 14.3593 1.57949 13.6533 1.50781L13.5 1.5L4.5 1.5L4.34668 1.50781C3.59028 1.58461 3 2.22334 3 3L3 16.5C3 17.2767 3.59028 17.9154 4.34668 17.9922L4.5 18L13.5 18L13.6533 17.9922ZM9 3L13.5 3L13.5 16.5L9 16.5L9 3Z\"/>\n    </svg>`,\n\n  \"delete-table\":\n    `<svg viewBox=\"0 0 18 18\" xmlns=\"http://www.w3.org/2000/svg\">\n      <path d=\"M11.2041 1.01074C12.2128 1.113 13 1.96435 13 3V4H15L15.1025 4.00488C15.6067 4.05621 16 4.48232 16 5C16 5.55228 15.5523 6 15 6H14.8457L14.1416 15.1533C14.0614 16.1953 13.1925 17 12.1475 17H5.85254L5.6582 16.9902C4.76514 16.9041 4.03607 16.2296 3.88184 15.3457L3.8584 15.1533L3.1543 6H3C2.44772 6 2 5.55228 2 5C2 4.44772 2.44772 4 3 4H5V3C5 1.89543 5.89543 1 7 1H11L11.2041 1.01074ZM5.85254 15H12.1475L12.8398 6H5.16016L5.85254 15ZM7 4H11V3H7V4Z\"/>\n    </svg>`\n};\n\nclass TableTools extends HTMLElement {\n  #listeners = new ListenerBin()\n\n  connectedCallback() {\n    this.tableController = new TableController(this.editorElement);\n    this.classList.add(\"lexxy-floating-controls\");\n    this.role = \"toolbar\";\n\n    this.#setUpButtons();\n    this.#hide();\n    this.#monitorForTableSelection();\n    this.#registerKeyboardShortcuts();\n  }\n\n  disconnectedCallback() {\n    this.dispose();\n  }\n\n  dispose() {\n    this.#listeners.dispose();\n\n    this.tableController?.destroy();\n    this.tableController = null;\n  }\n\n  get editorElement() {\n    return this.closest(\"lexxy-editor\")\n  }\n\n  get editor() {\n    return this.editorElement.editor\n  }\n\n  getEditorElement() {\n    return this.editorElement\n  }\n\n  closeDropdowns({ except } = {}) {\n    this.#moreMenus.forEach(menu => {\n      if (menu !== except) menu.close({ focusEditor: false });\n    });\n  }\n\n  get #moreMenus() {\n    return this.querySelectorAll(\"lexxy-toolbar-dropdown\")\n  }\n\n  get #hasOpenMoreMenu() {\n    return Array.from(this.#moreMenus).some(menu => menu.isOpen)\n  }\n\n  get #tableToolsButtons() {\n    return Array.from(this.querySelectorAll(\"button\")).filter(button => !button.closest(\"[data-dropdown-panel]\"))\n  }\n\n  #setUpButtons() {\n    this.innerHTML = \"\";\n\n    this.appendChild(this.#createRowButtonsContainer());\n    this.appendChild(this.#createColumnButtonsContainer());\n\n    this.appendChild(this.#createDeleteTableButton());\n    this.#listeners.track(registerEventListener(this, \"keydown\", this.#handleToolsKeydown));\n  }\n\n  #createButtonsContainer(childType, setCountProperty, moreMenu) {\n    const container = createElement(\"div\", { className: `lexxy-floating-controls__group lexxy-table-control lexxy-table-control--${childType}` });\n\n    const plusButton = this.#createButton(`Add ${childType}`, { action: \"insert\", childType, direction: \"after\" }, \"+\");\n    const minusButton = this.#createButton(`Remove ${childType}`, { action: \"delete\", childType }, \"\u2212\");\n\n    container.appendChild(minusButton);\n    container.appendChild(this.#createMoreMenu(childType, setCountProperty, moreMenu));\n    container.appendChild(plusButton);\n\n    return container\n  }\n\n  #createMoreMenu(childType, setCountProperty, menu) {\n    const dropdown = createElement(\"lexxy-toolbar-dropdown\", { className: \"lexxy-table-control__more-menu\" });\n\n    const trigger = createElement(\"button\", {\n      type: \"button\",\n      className: \"lexxy-table-control__more-menu-trigger\",\n      dataset: { dropdownTrigger: \"\" },\n      \"aria-haspopup\": \"menu\",\n      \"aria-expanded\": \"false\"\n    }, `_ ${childType}s`);\n    trigger.tabIndex = -1;\n    setCountProperty(trigger);\n\n    menu.dataset.dropdownPanel = \"\";\n    menu.role = \"menu\";\n    menu.setAttribute(\"aria-label\", `${childType} options`);\n    menu.hidden = true;\n\n    dropdown.appendChild(trigger);\n    dropdown.appendChild(menu);\n\n    return dropdown\n  }\n\n  #createRowButtonsContainer() {\n    return this.#createButtonsContainer(\n      \"row\",\n      (count) => { this.rowCount = count; },\n      this.#createMoreMenuSection(\"row\")\n    )\n  }\n\n  #createColumnButtonsContainer() {\n    return this.#createButtonsContainer(\n      \"column\",\n      (count) => { this.columnCount = count; },\n      this.#createMoreMenuSection(\"column\")\n    )\n  }\n\n  #createMoreMenuSection(childType) {\n    const section = createElement(\"div\", { className: \"lexxy-floating-controls__group lexxy-table-control__more-menu-details\" });\n\n    const items = [\n      this.#createButton(`Add ${childType} before`, { action: \"insert\", childType, direction: \"before\" }),\n      this.#createButton(`Add ${childType} after`, { action: \"insert\", childType, direction: \"after\" }),\n      this.#createButton(`Toggle ${childType} style`, { action: \"toggle\", childType }),\n      this.#createButton(`Remove ${childType}`, { action: \"delete\", childType })\n    ];\n\n    items.forEach(item => {\n      item.role = \"menuitem\";\n      section.appendChild(item);\n    });\n\n    return section\n  }\n\n  #createDeleteTableButton() {\n    const container = createElement(\"div\", { className: \"lexxy-table-control lexxy-floating-controls__group\" });\n\n    const deleteTableButton = this.#createButton(\"Delete this table?\", { action: \"delete\", childType: \"table\" });\n    deleteTableButton.classList.add(\"lexxy-table-control__button--delete-table\");\n\n    container.appendChild(deleteTableButton);\n\n    this.deleteContainer = container;\n\n    return container\n  }\n\n  #createButton(label, command = {}, icon = this.#icon(command)) {\n    const button = createElement(\"button\", {\n      className: \"lexxy-table-control__button\",\n      \"aria-label\": label,\n      type: \"button\"\n    });\n    button.tabIndex = -1;\n    button.innerHTML = `${icon} <span>${label}</span>`;\n\n    button.dataset.action = command.action;\n    button.dataset.childType = command.childType;\n    button.dataset.direction = command.direction;\n\n    button.addEventListener(\"click\", () => this.#executeTableCommand(command));\n\n    button.addEventListener(\"mouseover\", () => this.#handleCommandButtonHover());\n    button.addEventListener(\"focus\", () => this.#handleCommandButtonHover());\n    button.addEventListener(\"mouseout\", () => this.#handleCommandButtonHover());\n\n    return button\n  }\n\n  #registerKeyboardShortcuts() {\n    this.#listeners.track(this.editor.registerCommand(KEY_DOWN_COMMAND, this.#focusToolbarOnAltF10, COMMAND_PRIORITY_HIGH));\n  }\n\n  #focusToolbarOnAltF10 = (event) => {\n    if (this.#hasSelectedTable && event.altKey && event.key === \"F10\") {\n      event.preventDefault();\n      // Ask for the ring explicitly: a programmatic focus coming from a mouse-focused\n      // editor otherwise inherits the mouse modality and paints no focus ring.\n      this.#tableToolsButtons[0]?.focus({ focusVisible: true });\n      return true\n    } else {\n      return false\n    }\n  }\n\n  get #hasSelectedTable() {\n    return this.tableController?.currentTableNodeKey != null\n  }\n\n  #handleToolsKeydown = (event) => {\n    if (event.key === \"Escape\") {\n      this.#handleEscapeKey();\n    } else {\n      handleRollingTabIndex(this.#tableToolsButtons, event);\n    }\n  }\n\n  #handleEscapeKey() {\n    const cell = this.tableController.currentCell;\n    if (!cell) return\n\n    this.editor.update(() => {\n      cell.select();\n      this.editor.focus();\n    });\n\n    this.#update();\n  }\n\n  async #handleCommandButtonHover() {\n    await nextFrame();\n\n    this.#clearCellStyles();\n\n    const activeElement = this.querySelector(\"button:hover, button:focus\");\n    if (!activeElement) return\n\n    const command = {\n      action: activeElement.dataset.action,\n      childType: activeElement.dataset.childType,\n      direction: activeElement.dataset.direction\n    };\n\n    let cellsToHighlight = null;\n\n    switch (command.childType) {\n      case \"row\":\n        cellsToHighlight = this.tableController.currentRowCells;\n        break\n      case \"column\":\n        cellsToHighlight = this.tableController.currentColumnCells;\n        break\n      case \"table\":\n        cellsToHighlight = this.tableController.tableRows;\n        break\n    }\n\n    if (!cellsToHighlight) return\n\n    cellsToHighlight.forEach(cell => {\n      const cellElement = this.editor.getElementByKey(cell.getKey());\n      if (!cellElement) return\n\n      cellElement.classList.toggle(theme.tableCellHighlight, true);\n      Object.assign(cellElement.dataset, command);\n    });\n  }\n\n  #monitorForTableSelection() {\n    this.#listeners.track(this.editor.registerUpdateListener(() => {\n      const tableNode = this.editor.getRootElement() && this.tableController.updateSelectedTable();\n\n      if (tableNode) {\n        this.#show();\n      } else {\n        this.#hide();\n      }\n    }));\n  }\n\n  #executeTableCommand(command) {\n    const fromMoreMenu = this.#hasOpenMoreMenu;\n\n    this.tableController.executeTableCommand(command);\n    this.#update();\n\n    if (fromMoreMenu) this.editor.focus();\n  }\n\n  #show() {\n    this.#updateButtonsPosition();\n    this.style.display = \"flex\";\n    this.#updateRowColumnCount();\n    this.#closeMoreMenu();\n    this.#handleCommandButtonHover();\n  }\n\n  #hide() {\n    this.style.display = \"none\";\n    this.#clearCellStyles();\n  }\n\n  #update() {\n    this.#updateButtonsPosition();\n    this.#updateRowColumnCount();\n    this.#closeMoreMenu();\n    this.#handleCommandButtonHover();\n  }\n\n  #closeMoreMenu() {\n    this.closeDropdowns();\n  }\n\n  #updateButtonsPosition() {\n    const tableNode = this.tableController.currentTableNode;\n    if (!tableNode) return\n\n    const tableElement = this.editor.getElementByKey(tableNode.getKey());\n    if (!tableElement) return\n\n    const tableRect = tableElement.getBoundingClientRect();\n    const editorRect = this.editorElement.getBoundingClientRect();\n\n    const relativeTop = tableRect.top - editorRect.top;\n    const relativeCenter = (tableRect.left + tableRect.right) / 2 - editorRect.left;\n    this.style.top = `${relativeTop}px`;\n    this.style.left = `${relativeCenter}px`;\n  }\n\n  #updateRowColumnCount() {\n    const tableNode = this.tableController.currentTableNode;\n    if (!tableNode) return\n\n    const tableElement = $getElementForTableNode(this.editor, tableNode);\n    if (!tableElement) return\n\n    const rowCount = tableElement.rows;\n    const columnCount = tableElement.columns;\n\n    this.rowCount.textContent = `${rowCount} row${rowCount === 1 ? \"\" : \"s\"}`;\n    this.columnCount.textContent = `${columnCount} column${columnCount === 1 ? \"\" : \"s\"}`;\n  }\n\n  #setTableCellFocus() {\n    const cell = this.tableController.currentCell;\n    if (!cell) return\n\n    const cellElement = this.editor.getElementByKey(cell.getKey());\n    if (!cellElement?.contains(document.getSelection()?.anchorNode)) return\n\n    cellElement.classList.add(theme.tableCellFocus);\n  }\n\n  #clearCellStyles() {\n    this.editorElement.querySelectorAll(`.${theme.tableCellFocus}`)?.forEach(cell => {\n      cell.classList.remove(theme.tableCellFocus);\n    });\n\n    this.editorElement.querySelectorAll(`.${theme.tableCellHighlight}`)?.forEach(cell => {\n      cell.classList.remove(theme.tableCellHighlight);\n      cell.removeAttribute(\"data-action\");\n      cell.removeAttribute(\"data-child-type\");\n      cell.removeAttribute(\"data-direction\");\n    });\n\n    this.#setTableCellFocus();\n  }\n\n  #icon(command) {\n    const { action, childType } = command;\n    const direction = (action == \"insert\" ? command.direction : null);\n    const iconId = [ action, childType, direction ].filter(Boolean).join(\"-\");\n    return TableIcons[iconId]\n  }\n}\n\nfunction defineElements() {\n  const elements = {\n    // Toolbar must be registered BEFORE Editor\n    \"lexxy-toolbar\": LexicalToolbarElement,\n    \"lexxy-toolbar-dropdown\": ToolbarDropdown,\n    \"lexxy-heading-dropdown\": HeadingDropdown,\n    \"lexxy-highlight-dropdown\": HighlightDropdown,\n    \"lexxy-link-dropdown\": LinkDropdown,\n\n    \"lexxy-editor\": LexicalEditorElement,\n\n    // Prompt must be registered AFTER Editor\n    \"lexxy-prompt\": LexicalPromptElement,\n    \"lexxy-code-language-picker\": CodeLanguagePicker,\n    \"lexxy-live-region\": LiveRegion,\n    \"lexxy-attachment-toolbar\": AttachmentToolbar,\n    \"lexxy-table-tools\": TableTools\n  };\n\n  Object.entries(elements).forEach(([ name, element ]) => {\n    customElements.define(name, element);\n  });\n}\n\nclass NativeAdapter {\n  frozenLinkKey = null\n\n  constructor(editorElement) {\n    this.editorElement = editorElement;\n    this.editorContentElement = editorElement.editorContentElement;\n  }\n\n  dispatchAttributesChange(attributes, linkHref, highlight, headingTag) {\n    dispatch(this.editorElement, \"lexxy:attributes-change\", {\n      attributes,\n      link: linkHref ? { href: linkHref } : null,\n      highlight,\n      headingTag\n    });\n  }\n\n  dispatchEditorInitialized(detail) {\n    dispatch(this.editorElement, \"lexxy:editor-initialized\", detail);\n  }\n\n  freeze() {\n    let frozenLinkKey = null;\n    this.editorElement.editor?.getEditorState().read(() => {\n      const selection = $getSelection();\n      if (!$isRangeSelection(selection)) return\n\n      const linkNode = $getNearestNodeOfType(selection.anchor.getNode(), LinkNode);\n      if (linkNode) {\n        frozenLinkKey = linkNode.getKey();\n      }\n    });\n\n    this.frozenLinkKey = frozenLinkKey;\n    this.editorContentElement.contentEditable = \"false\";\n  }\n\n  thaw() {\n    this.editorContentElement.contentEditable = \"true\";\n  }\n\n  unlinkFrozenNode() {\n    const key = this.frozenLinkKey;\n    if (!key) return false\n\n    const linkNode = $getNodeByKey(key);\n    if (!$isLinkNode(linkNode)) {\n      this.frozenLinkKey = null;\n      return false\n    }\n\n    const children = linkNode.getChildren();\n    for (const child of children) {\n      linkNode.insertBefore(child);\n    }\n    linkNode.remove();\n\n    // Select the former link text so a follow-up createLink can re-wrap it.\n    const firstText = this.#findFirstTextDescendant(children);\n    const lastText = this.#findLastTextDescendant(children);\n    if (firstText && lastText) {\n      const selection = $getSelection();\n      if ($isRangeSelection(selection)) {\n        selection.anchor.set(firstText.getKey(), 0, \"text\");\n        selection.focus.set(lastText.getKey(), lastText.getTextContent().length, \"text\");\n      }\n    }\n\n    this.frozenLinkKey = null;\n    return true\n  }\n\n  #findFirstTextDescendant(nodes) {\n    for (const node of nodes) {\n      if ($isTextNode(node)) return node\n      if ($isElementNode(node)) {\n        const nestedTextNode = this.#findFirstTextDescendant(node.getChildren());\n        if (nestedTextNode) return nestedTextNode\n      }\n    }\n\n    return null\n  }\n\n  #findLastTextDescendant(nodes) {\n    for (let index = nodes.length - 1; index >= 0; index--) {\n      const node = nodes[index];\n      if ($isTextNode(node)) return node\n      if ($isElementNode(node)) {\n        const nestedTextNode = this.#findLastTextDescendant(node.getChildren());\n        if (nestedTextNode) return nestedTextNode\n      }\n    }\n\n    return null\n  }\n}\n\nconst configure = Lexxy.configure;\n\n// Pushing elements definition to after the current call stack to allow global configuration to take place first\nsetTimeout(defineElements, 0);\n\nexport { $createActionTextAttachmentNode, $createActionTextAttachmentUploadNode, $isActionTextAttachmentNode, $isCustomActionTextAttachmentNode, ActionTextAttachmentNode, ActionTextAttachmentUploadNode, CustomActionTextAttachmentNode, EditorSanitizer, LexxyExtension as Extension, HorizontalDividerNode, NativeAdapter, REWRITE_HISTORY_COMMAND, configure };\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AW,MAAM;AACtB,YAAMc,OAAO9F,yBAAyBgF,QAAQa,IAAI;AAElD,UAAIC,MAAM;AACR,YAAIA,KAAKC,KAAK;AACZ,iBAAO1E,QAAQyE,KAAKC,GAAG;QACzB;AAEA,YAAI,OAAOD,KAAKR,UAAU,YAAY;AACpC,iBAAOjE,QAAQyE,KAAKR,KAAK;QAC3B;MACF;AAEAN,eAASjF,eAAeiF,MAAM;IAChC;AAEA,aAASgB,gBAAa;AACpB,aAAO;IACT;AAEA,WAAOA;EACT;AAEA,WAASC,QAAQX,OAAc;AAC7B,QAAI;AACF5B,iBAAW4B,OAAiB,EAAE;AAC9B,aAAO;IACT,SAAEY,SAAM;AACN,aAAO;IACT;EACF;ACnSO,MAAMC,SAAOlG,OAAO,CACzB,KACA,QACA,WACA,WACA,QACA,WACA,SACA,SACA,KACA,OACA,OACA,OACA,SACA,cACA,QACA,MACA,UACA,UACA,WACA,UACA,QACA,QACA,OACA,YACA,WACA,QACA,YACA,MACA,aACA,OACA,WACA,OACA,UACA,OACA,OACA,MACA,MACA,WACA,MACA,YACA,cACA,UACA,QACA,UACA,QACA,MACA,MACA,MACA,MACA,MACA,MACA,QACA,UACA,UACA,MACA,QACA,KACA,OACA,SACA,OACA,OACA,SACA,UACA,MACA,QACA,OACA,QACA,WACA,QACA,YACA,SACA,OACA,QACA,MACA,YACA,UACA,UACA,KACA,WACA,OACA,YACA,KACA,MACA,MACA,QACA,KACA,QACA,UACA,WACA,UACA,UACA,QACA,SACA,UACA,UACA,QACA,UACA,UACA,SACA,OACA,WACA,OACA,SACA,SACA,MACA,YACA,YACA,SACA,MACA,SACA,QACA,MACA,SACA,MACA,KACA,MACA,OACA,SACA,KAAK,CACG;AAEH,MAAMmG,QAAMnG,OAAO,CACxB,OACA,KACA,YACA,eACA,gBACA,gBACA,iBACA,oBACA,UACA,YACA,QACA,QACA,WACA,gBACA,eACA,UACA,QACA,KACA,SACA,YACA,SACA,SACA,aACA,QACA,kBACA,UACA,QACA,YACA,SACA,QACA,QACA,WACA,WACA,YACA,kBACA,QACA,QACA,SACA,UACA,UACA,QACA,YACA,SACA,QACA,SACA,QACA,OAAO,CACC;AAEH,MAAMoG,aAAapG,OAAO,CAC/B,WACA,iBACA,uBACA,eACA,oBACA,qBACA,qBACA,kBACA,gBACA,WACA,WACA,WACA,WACA,WACA,kBACA,WACA,WACA,eACA,gBACA,YACA,gBACA,sBACA,eACA,UACA,cAAc,CACN;AAMH,MAAMqG,gBAAgBrG,OAAO,CAClC,WACA,iBACA,UACA,WACA,aACA,oBACA,kBACA,iBACA,iBACA,iBACA,SACA,aACA,QACA,gBACA,aACA,WACA,iBACA,UACA,OACA,cACA,WACA,KAAK,CACG;AAEH,MAAMsG,WAAStG,OAAO,CAC3B,QACA,YACA,UACA,WACA,SACA,UACA,MACA,cACA,iBACA,MACA,MACA,SACA,WACA,YACA,SACA,QACA,MACA,UACA,SACA,UACA,QACA,QACA,WACA,UACA,OACA,SACA,OACA,UACA,cACA,aAAa,CACL;AAIH,MAAMuG,mBAAmBvG,OAAO,CACrC,WACA,eACA,cACA,YACA,aACA,WACA,WACA,UACA,UACA,SACA,aACA,cACA,kBACA,eACA,MAAM,CACE;AAEH,MAAMwG,OAAOxG,OAAO,CAAC,OAAO,CAAU;AC1RtC,MAAMkG,OAAOlG,OAAO,CACzB,UACA,UACA,SACA,OACA,kBACA,gBACA,wBACA,YACA,cACA,WACA,UACA,WACA,eACA,eACA,WACA,QACA,SACA,SACA,SACA,QACA,WACA,WACA,cACA,YACA,gBACA,UACA,eACA,YACA,YACA,WACA,OACA,YACA,2BACA,yBACA,YACA,aACA,WACA,gBACA,eACA,QACA,OACA,WACA,UACA,UACA,QACA,QACA,YACA,MACA,SACA,aACA,aACA,SACA,QACA,SACA,QACA,QACA,WACA,QACA,OACA,OACA,aACA,SACA,UACA,OACA,aACA,YACA,SACA,QACA,SACA,WACA,cACA,UACA,QACA,WACA,QACA,WACA,eACA,eACA,WACA,iBACA,uBACA,UACA,WACA,WACA,cACA,YACA,OACA,YACA,OACA,YACA,QACA,QACA,WACA,cACA,SACA,YACA,SACA,QACA,SACA,QACA,QACA,WACA,SACA,OACA,UACA,QACA,SACA,WACA,YACA,SACA,aACA,QACA,UACA,UACA,SACA,SACA,QACA,OAAO,CACC;AAEH,MAAMmG,MAAMnG,OAAO,CACxB,iBACA,cACA,YACA,sBACA,aACA,UACA,iBACA,iBACA,WACA,iBACA,kBACA,SACA,QACA,MACA,SACA,QACA,iBACA,aACA,aACA,SACA,uBACA,+BACA,iBACA,mBACA,MACA,MACA,KACA,MACA,MACA,mBACA,aACA,WACA,WACA,qBACA,OACA,YACA,aACA,OACA,YACA,QACA,gBACA,aACA,UACA,eACA,eACA,iBACA,eACA,aACA,oBACA,gBACA,cACA,gBACA,eACA,MACA,MACA,MACA,MACA,cACA,YACA,iBACA,qBACA,UACA,QACA,MACA,mBACA,MACA,OACA,aACA,KACA,MACA,MACA,MACA,MACA,WACA,aACA,cACA,YACA,QACA,gBACA,kBACA,gBACA,oBACA,kBACA,SACA,cACA,cACA,gBACA,gBACA,eACA,eACA,oBACA,aACA,OACA,QACA,aACA,SACA,UACA,QACA,OACA,QACA,cACA,UACA,YACA,WACA,SACA,UACA,eACA,UACA,YACA,eACA,QACA,cACA,uBACA,oBACA,gBACA,kBACA,UACA,iBACA,uBACA,kBACA,KACA,MACA,MACA,UACA,QACA,QACA,eACA,aACA,WACA,UACA,UACA,SACA,QACA,mBACA,SACA,oBACA,oBACA,gBACA,eACA,gBACA,eACA,cACA,gBACA,oBACA,qBACA,kBACA,mBACA,qBACA,kBACA,UACA,gBACA,SACA,gBACA,kBACA,YACA,eACA,WACA,WACA,aACA,oBACA,eACA,mBACA,oBACA,kBACA,cACA,QACA,MACA,MACA,WACA,UACA,iBACA,WACA,cACA,WACA,cACA,iBACA,iBACA,SACA,gBACA,QACA,gBACA,oBACA,oBACA,KACA,MACA,MACA,SACA,KACA,MACA,MACA,KACA,YAAY,CACJ;AAEH,MAAMsG,SAASt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BAA4B;AAAA,MAC5B,uBAAuB;AAAA,MAEvB,gBAAgB;AAAA;AAAA,MAGhB,gBAAgB;AAAA,MAChB,8BAA8B;AAAA,MAC9B,qBAAqB;AAAA,MACrB,4BAA4B;AAAA,MAC5B,qBAAqB;AAAA,IACvB;AAEA,WAAO,QAAQ,QAAQ,EAAE,QAAQ,CAAC,CAAE,MAAM,OAAQ,MAAM;AACtD,qBAAe,OAAO,MAAM,OAAO;AAAA,IACrC,CAAC;AAAA,EACH;AAoGA,MAAM,YAAY,MAAM;AAGxB,aAAW,gBAAgB,CAAC;",
  "names": ["Prism", "_self", "_", "o", "clone", "id", "v", "i", "m", "lang", "text", "toArray", "s", "e", "j", "p", "k", "addInlined", "start", "x", "k", "a", "b", "c", "d", "s", "i", "n", "j", "hex", "SparkMD5", "start", "error", "Prism", "Prism", "i", "l", "id", "html", "text", "m", "Prism", "Prism", "Prism", "i", "Prism", "Prism", "Prism", "Prism", "i", "j", "k", "t", "s", "Prism", "Prism", "Prism", "i", "Prism", "entries", "Object", "setPrototypeOf", "isFrozen", "getPrototypeOf", "getOwnPropertyDescriptor", "freeze", "seal", "create", "_ref", "Reflect", "apply", "construct", "x", "func", "thisArg", "_len", "arguments", "length", "args", "Array", "_key", "Func", "_len2", "_key2", "arrayForEach", "unapply", "prototype", "forEach", "arrayLastIndexOf", "lastIndexOf", "arrayPop", "pop", "arrayPush", "push", "arraySplice", "splice", "arrayIsArray", "isArray", "stringToLowerCase", "String", "toLowerCase", "stringToString", "toString", "stringMatch", "match", "stringReplace", "replace", "stringIndexOf", "indexOf", "stringTrim", "trim", "numberToString", "Number", "booleanToString", "Boolean", "bigintToString", "BigInt", "symbolToString", "Symbol", "objectHasOwnProperty", "hasOwnProperty", "objectToString", "regExpTest", "RegExp", "test", "typeErrorCreate", "unconstruct", "TypeError", "lastIndex", "_len3", "_key3", "_len4", "_key4", "addToSet", "set", "array", "transformCaseFunc", "l", "element", "lcElement", "cleanArray", "index", "isPropertyExist", "clone", "object", "newObject", "_ref2", "_ref3", "_slicedToArray", "property", "value", "constructor", "stringifyValue", "valueAsRecord", "valueToString", "lookupGetter", "stringified", "prop", "desc", "get", "fallbackValue", "isRegex", "_unused", "html", "svg", "svgFilters", "svgDisallowed", "mathMl", "mathMlDisallowed", "text", "xml", "MUSTACHE_EXPR", "ERB_EXPR", "TMPLIT_EXPR", "DATA_ATTR", "ARIA_ATTR", "IS_ALLOWED_URI", "IS_SCRIPT_OR_DATA", "ATTR_WHITESPACE", "DOCTYPE_NAME", "CUSTOM_ELEMENT", "ELEMENT_MARKUP_PROBE", "COMMENT_MARKUP_PROBE", "FALLBACK_TAG_CLOSE", "SELF_CLOSING_TAG", "NODE_TYPE", "attribute", "cdataSection", "entityReference", "entityNode", "processingInstruction", "comment", "document", "documentType", "documentFragment", "notation", "LITERAL_TEXT_ELEMENT_NAMES", "LITERAL_TEXT_ELEMENTS", "LITERAL_TEXT_CLOSE", "map", "name", "getGlobal", "window", "_createTrustedTypesPolicy", "trustedTypes", "purifyHostElement", "createPolicy", "suffix", "ATTR_NAME", "hasAttribute", "getAttribute", "policyName", "createHTML", "createScriptURL", "scriptUrl", "_", "console", "warn", "_createHooksMap", "afterSanitizeAttributes", "afterSanitizeElements", "afterSanitizeShadowDOM", "beforeSanitizeAttributes", "beforeSanitizeElements", "beforeSanitizeShadowDOM", "uponSanitizeAttribute", "uponSanitizeElement", "uponSanitizeShadowNode", "_resolveSetOption", "cfg", "key", "fallback", "options", "base", "transform", "_resolveObjectOption", "makeFallback", "undefined", "createDOMPurify", "DOMPurify", "root", "version", "VERSION", "removed", "nodeType", "Element", "isSupported", "originalDocument", "currentScript", "DocumentFragment", "HTMLTemplateElement", "Node", "NodeFilter", "_window$NamedNodeMap", "NamedNodeMap", "MozNamedAttrMap", "HTMLFormElement", "DOMParser", "ElementPrototype", "cloneNode", "remove", "getNextSibling", "getChildNodes", "getParentNode", "getShadowRoot", "getAttributes", "getNodeType", "getNodeName", "getOwnerDocument", "_readNodeType", "node", "_readNodeName", "nodeName", "template", "createElement", "content", "ownerDocument", "trustedTypesPolicy", "emptyHTML", "defaultTrustedTypesPolicy", "defaultTrustedTypesPolicyResolved", "IN_TRUSTED_TYPES_POLICY", "_assertNotInTrustedTypesPolicy", "_createTrustedHTML", "_createTrustedScriptURL", "_getDefaultTrustedTypesPolicy", "_document", "implementation", "createNodeIterator", "createDocumentFragment", "getElementsByTagName", "importNode", "hooks", "createHTMLDocument", "EXPRESSIONS", "ALLOWED_TAGS", "DEFAULT_ALLOWED_TAGS", "TAGS", "ALLOWED_ATTR", "DEFAULT_ALLOWED_ATTR", "ATTRS", "CUSTOM_ELEMENT_HANDLING", "tagNameCheck", "writable", "configurable", "enumerable", "attributeNameCheck", "allowCustomizedBuiltInElements", "FORBID_TAGS", "FORBID_ATTR", "EXTRA_ELEMENT_HANDLING", "tagCheck", "attributeCheck", "ALLOW_ARIA_ATTR", "ALLOW_DATA_ATTR", "ALLOW_UNKNOWN_PROTOCOLS", "ALLOW_SELF_CLOSE_IN_ATTR", "SAFE_FOR_TEMPLATES", "SAFE_FOR_XML", "WHOLE_DOCUMENT", "SET_CONFIG", "SET_CONFIG_ALLOWED_TAGS", "SET_CONFIG_ALLOWED_ATTR", "FORCE_BODY", "RETURN_DOM", "RETURN_DOM_FRAGMENT", "RETURN_TRUSTED_TYPE", "SANITIZE_DOM", "SANITIZE_NAMED_PROPS", "SANITIZE_NAMED_PROPS_PREFIX", "KEEP_CONTENT", "IN_PLACE", "USE_PROFILES", "FORBID_CONTENTS", "DEFAULT_FORBID_CONTENTS", "DATA_URI_TAGS", "DEFAULT_DATA_URI_TAGS", "URI_SAFE_ATTRIBUTES", "DEFAULT_URI_SAFE_ATTRIBUTES", "MATHML_NAMESPACE", "SVG_NAMESPACE", "HTML_NAMESPACE", "NAMESPACE", "IS_EMPTY_INPUT", "ALLOWED_NAMESPACES", "DEFAULT_ALLOWED_NAMESPACES", "DEFAULT_MATHML_TEXT_INTEGRATION_POINTS", "MATHML_TEXT_INTEGRATION_POINTS", "DEFAULT_HTML_INTEGRATION_POINTS", "HTML_INTEGRATION_POINTS", "COMMON_SVG_AND_HTML_ELEMENTS", "PARSER_MEDIA_TYPE", "SUPPORTED_PARSER_MEDIA_TYPES", "DEFAULT_PARSER_MEDIA_TYPE", "CONFIG", "formElement", "isRegexOrFunction", "testValue", "Function", "_parseConfig", "ALLOWED_URI_REGEXP", "customElementHandling", "ADD_TAGS", "ADD_ATTR", "ADD_FORBID_CONTENTS", "table", "tbody", "TRUSTED_TYPES_POLICY", "previousTrustedTypesPolicy", "error", "ALL_SVG_TAGS", "ALL_MATHML_TAGS", "_checkSvgNamespace", "tagName", "parent", "parentTagName", "namespaceURI", "_checkMathMlNamespace", "_checkHtmlNamespace", "_checkValidNamespace", "_forceRemove", "removeChild", "_stripAttributeNode", "removeAttributeNode", "removeAttribute", "_neutralizeRoot", "_neutralizeSubtree", "childNodes", "snapshot", "child", "attributes", "i", "_removeAttribute", "attr", "getAttributeNode", "from", "setAttribute", "_stripDisallowedAttributes", "stack", "_isPatchLinkageAttribute", "lcName", "lcTag", "_neutralizePatchLinkage", "data", "_initDocument", "dirty", "doc", "leadingWhitespace", "matches", "dirtyPayload", "parseFromString", "documentElement", "createDocument", "innerHTML", "body", "insertBefore", "createTextNode", "call", "_createNodeIterator", "SHOW_ELEMENT", "SHOW_COMMENT", "SHOW_TEXT", "SHOW_PROCESSING_INSTRUCTION", "SHOW_CDATA_SECTION", "_stripTemplateExpressions", "_scrubTemplateExpressions", "_node$querySelectorAl", "normalize", "walker", "currentNode", "nextNode", "templates", "querySelectorAll", "tmpl", "_isDocumentFragment", "_isClobbered", "realTagName", "textContent", "hasChildNodes", "_isNode", "_executeHooks", "hook", "_isUnsafeNode", "firstElementChild", "_matchesNameCheck", "check", "_sanitizeDisallowedNode", "_isBasicCustomElement", "parentNode", "childCount", "hoisted", "_forkSharedAllowlist", "hookList", "defaultSet", "setConfigSet", "_handleHookDetachedNode", "_sanitizeElements", "allowedTags", "nt", "_isValidAttribute", "nameIsPermitted", "RESERVED_CUSTOM_ELEMENT_NAMES", "_applyTrustedTypesToAttribute", "getAttributeType", "_setAttributeValue", "setAttributeNS", "_sanitizeAttributes", "hookEvent", "attrName", "attrValue", "keepAttr", "allowedAttributes", "forceKeepAttr", "initValue", "_sanitizeShadowDOM", "fragment", "shadowNode", "shadowIterator", "innerSr", "_sanitizeAttachedShadowRoots", "shadow", "item", "isElement", "rootName", "sr", "sanitize", "importedNode", "returnNode", "inPlace", "nn", "appendChild", "firstChild", "walkRoot", "nodeIterator", "entry", "shadowroot", "shadowrootmode", "serializedHTML", "outerHTML", "doctype", "setConfig", "clearConfig", "isValidAttribute", "tag", "addHook", "entryPoint", "hookFunction", "removeHook", "removeHooks", "removeAllHooks", "$cloneWithProperties", "$selectAll", "getStyleObjectFromCSS", "v", "text", "i", "s", "k", "a", "b", "start", "anchorNode", "n", "self", "property", "value", "theme", "x", "re", "_e", "mutatedNodes", "dirtyElements", "dirtyLeaves", "e", "resolvedNode", "activeEditor", "html", "nodes", "leftTree", "rightTree", "o", "$addUpdateTag", "$applyNodeReplacement", "$caretFromPoint", "$caretRangeFromSelection", "$cloneWithProperties", "$cloneWithPropertiesEphemeral", "$comparePointCaretNext", "$copyNode", "$create", "$createChildrenArray", "$createLineBreakNode", "$createNodeSelection", "$createParagraphNode", "$createPoint", "$createRangeSelection", "$createRangeSelectionFromDom", "$createTabNode", "$createTextNode", "$extendCaretToRange", "$findMatchingParent", "$getAdjacentChildCaret", "$getAdjacentNode", "$getAdjacentSiblingOrParentSiblingCaret", "$getCaretInDirection", "$getCaretRange", "$getCaretRangeInDirection", "$getCharacterOffsets", "$getChildCaret", "$getChildCaretAtIndex", "$getChildCaretOrSelf", "$getCollapsedCaretRange", "$getCommonAncestor", "$getCommonAncestorResultBranchOrder", "$getEditor", "$getEditorDOMRenderConfig", "$getNearestNodeFromDOMNode", "$getNearestRootOrShadowRoot", "$getNodeByKey", "$getNodeByKeyOrThrow", "$getNodeFromDOMNode", "$getPreviousSelection", "$getRoot", "$getSelection", "$getSiblingCaret", "$getState", "$getStateChange", "$getTextContent", "$getTextNodeOffset", "$getTextPointCaret", "$getTextPointCaretSlice", "$getWritableNodeState", "$hasAncestor", "$hasUpdateTag", "$insertNodes", "$isBlockElementNode", "$isChildCaret", "$isDecoratorNode", "$isEditorState", "$isElementNode", "$isExtendableTextPointCaret", "$isInlineElementOrDecoratorNode", "$isLeafNode", "$isLexicalNode", "$isLineBreakNode", "$isNodeCaret", "$isNodeSelection", "$isParagraphNode", "$isRangeSelection", "$isRootNode", "$isRootOrShadowRoot", "$isSiblingCaret", "$isTabNode", "$isTextNode", "$isTextPointCaret", "$isTextPointCaretSlice", "$isTokenOrSegmented", "$isTokenOrTab", "$nodesOfType", "$normalizeCaret", "$onUpdate", "$parseSerializedNode", "$removeTextFromCaretRange", "$rewindSiblingCaret", "$selectAll", "$setCompositionKey", "$setPointFromCaret", "$setSelection", "$setSelectionFromCaretRange", "$setState", "$splitAtPointCaretNext", "$splitNode", "$updateRangeSelectionFromCaretRange", "ArtificialNode__DO_NOT_USE", "BEFORE_INPUT_COMMAND", "BLUR_COMMAND", "CAN_REDO_COMMAND", "CAN_UNDO_COMMAND", "CLEAR_EDITOR_COMMAND", "CLEAR_HISTORY_COMMAND", "CLICK_COMMAND", "COLLABORATION_TAG", "COMMAND_PRIORITY_BEFORE_CRITICAL", "COMMAND_PRIORITY_BEFORE_EDITOR", "COMMAND_PRIORITY_BEFORE_HIGH", "COMMAND_PRIORITY_BEFORE_LOW", "COMMAND_PRIORITY_BEFORE_NORMAL", "COMMAND_PRIORITY_CRITICAL", "COMMAND_PRIORITY_EDITOR", "COMMAND_PRIORITY_HIGH", "COMMAND_PRIORITY_LOW", "COMMAND_PRIORITY_NORMAL", "COMPOSITION_END_COMMAND", "COMPOSITION_END_TAG", "COMPOSITION_START_COMMAND", "COMPOSITION_START_TAG", "CONTROLLED_TEXT_INSERTION_COMMAND", "COPY_COMMAND", "CUT_COMMAND", "DEFAULT_EDITOR_DOM_CONFIG", "DELETE_CHARACTER_COMMAND", "DELETE_LINE_COMMAND", "DELETE_WORD_COMMAND", "DRAGEND_COMMAND", "DRAGOVER_COMMAND", "DRAGSTART_COMMAND", "DROP_COMMAND", "DecoratorNode", "ElementNode", "FOCUS_COMMAND", "FORMAT_ELEMENT_COMMAND", "FORMAT_TEXT_COMMAND", "HISTORIC_TAG", "HISTORY_MERGE_TAG", "HISTORY_PUSH_TAG", "INDENT_CONTENT_COMMAND", "INPUT_COMMAND", "INSERT_LINE_BREAK_COMMAND", "INSERT_PARAGRAPH_COMMAND", "INSERT_TAB_COMMAND", "INTERNAL_$isBlock", "IS_ALL_FORMATTING", "IS_BOLD", "IS_CODE", "IS_HIGHLIGHT", "IS_ITALIC", "IS_STRIKETHROUGH", "IS_SUBSCRIPT", "IS_SUPERSCRIPT", "IS_UNDERLINE", "KEY_ARROW_DOWN_COMMAND", "KEY_ARROW_LEFT_COMMAND", "KEY_ARROW_RIGHT_COMMAND", "KEY_ARROW_UP_COMMAND", "KEY_BACKSPACE_COMMAND", "KEY_DELETE_COMMAND", "KEY_DOWN_COMMAND", "KEY_ENTER_COMMAND", "KEY_ESCAPE_COMMAND", "KEY_MODIFIER_COMMAND", "KEY_SPACE_COMMAND", "KEY_TAB_COMMAND", "LineBreakNode", "MOVE_TO_END", "MOVE_TO_START", "NODE_STATE_KEY", "OUTDENT_CONTENT_COMMAND", "PASTE_COMMAND", "PASTE_TAG", "ParagraphNode", "REDO_COMMAND", "REMOVE_TEXT_COMMAND", "RootNode", "SELECTION_CHANGE_COMMAND", "SELECTION_INSERT_CLIPBOARD_NODES_COMMAND", "SELECT_ALL_COMMAND", "SKIP_COLLAB_TAG", "SKIP_DOM_SELECTION_TAG", "SKIP_SCROLL_INTO_VIEW_TAG", "SKIP_SELECTION_FOCUS_TAG", "TEXT_TYPE_TO_FORMAT", "TabNode", "TextNode", "UNDO_COMMAND", "addClassNamesToElement", "buildImportMap", "configExtension", "createCommand", "createEditor", "createSharedNodeState", "createState", "declarePeerDependency", "defineExtension", "flipDirection", "getDOMOwnerDocument", "getDOMSelection", "getDOMSelectionFromTarget", "getDOMTextNode", "getEditorPropertyFromDOMNode", "getNearestEditorFromDOMNode", "getRegisteredNode", "getRegisteredNodeOrThrow", "getStaticNodeConfig", "getStyleObjectFromCSS", "getTextDirection", "getTransformSetFromKlass", "isBlockDomNode", "isCurrentlyReadOnlyMode", "isDOMDocumentNode", "isDOMNode", "isDOMTextNode", "isDOMUnmanaged", "isDocumentFragment", "isExactShortcutMatch", "isHTMLAnchorElement", "isHTMLElement", "isInlineDomNode", "isLexicalEditor", "isModifierMatch", "isSelectionCapturedInDecoratorInput", "isSelectionWithinEditor", "makeStepwiseIterator", "mergeRegister", "normalizeClassNames", "removeClassNamesFromElement", "removeFromParent", "resetRandomKey", "safeCast", "setDOMStyleFromCSS", "setDOMStyleObject", "setDOMUnmanaged", "setNodeIndentFromDOM", "shallowMergeConfig", "toggleTextFormatType", "formatDevErrorMessage", "warnOnlyOnce", "getDOMTextNode", "$isTextNode", "_e", "a", "b", "i", "$getEditor", "$isRootNode", "$isTokenOrSegmented", "$getCharacterOffsets", "text", "$cloneWithPropertiesEphemeral", "$isElementNode", "$getNodeByKey", "$getPreviousSelection", "$createTextNode", "$isRangeSelection", "getStyleObjectFromCSS", "$getSelection", "$caretRangeFromSelection", "$createRangeSelection", "$findMatchingParent", "INTERNAL_$isBlock", "$setSelection", "$isRootOrShadowRoot", "createElement", "$hasAncestor", "$isLeafNode", "$caretFromPoint", "$isExtendableTextPointCaret", "$extendCaretToRange", "$isChildCaret", "$isDecoratorNode", "mod", "$addNodeStyle", "$cloneWithProperties", "$copyBlockFormatIndent", "$ensureForwardRangeSelection", "$forEachSelectedTextNode", "$getComputedStyleForElement", "$getComputedStyleForParent", "$getSelectionStyleValueForProperty", "$isAtNodeEnd", "$isParentElementRTL", "$isParentRTL", "$moveCaretSelection", "$moveCharacter", "$patchStyleText", "$selectAll", "$setBlocksType", "$shouldOverrideDefaultCharacterSelection", "$sliceSelectedTextNodeContent", "$trimTextContentFromAnchor", "$wrapNodes", "createDOMRange", "createRectsFromDOMRange", "getCSSFromStyleObject", "getStyleObjectFromCSS", "trimTextContentFromAnchor", "$findMatchingParent", "$getAdjacentSiblingOrParentSiblingCaret", "$splitNode", "CAN_USE_BEFORE_INPUT", "CAN_USE_DOM", "IS_ANDROID", "IS_ANDROID_CHROME", "IS_APPLE", "IS_APPLE_WEBKIT", "IS_CHROME", "IS_FIREFOX", "IS_IOS", "IS_SAFARI", "addClassNamesToElement", "isBlockDomNode", "isHTMLAnchorElement", "isHTMLElement", "isInlineDomNode", "mergeRegister", "removeClassNamesFromElement", "formatDevErrorMessage", "documentMode", "createRectsFromDOMRange", "i", "isHTMLElement", "$isElementNode", "getDOMTextNode", "$getEditor", "$getEditorDOMRenderConfig", "start", "$getSelection", "$isRangeSelection", "mergeRegister", "onSelectionChange", "document", "CAN_USE_BEFORE_INPUT", "CAN_USE_DOM", "IS_ANDROID", "IS_ANDROID_CHROME", "IS_APPLE", "IS_APPLE_WEBKIT", "IS_CHROME", "IS_FIREFOX", "IS_IOS", "IS_SAFARI", "$getAdjacentSiblingOrParentSiblingCaret", "$getSiblingCaret", "$getRoot", "$getChildCaret", "$getAdjacentChildCaret", "$getChildCaretOrSelf", "makeStepwiseIterator", "$isChildCaret", "$findMatchingParent", "FULL_RECONCILE", "activeEditorState", "$cloneWithProperties", "$setSelection", "$getPreviousSelection", "$caretFromPoint", "$createParagraphNode", "$normalizeCaret", "$setSelectionFromCaretRange", "$getCollapsedCaretRange", "$getCaretInDirection", "$isTextPointCaret", "$isSiblingCaret", "$rewindSiblingCaret", "$splitAtPointCaretNext", "$caretRangeFromSelection", "$getCaretRangeInDirection", "$removeTextFromCaretRange", "$getCaretRange", "$getState", "$setState", "mod", "$descendantsMatching", "$dfs", "$dfsIterator", "$filter", "$findMatchingParent", "$firstToLastIterator", "$getAdjacentCaret", "$getAdjacentSiblingOrParentSiblingCaret", "$getDepth", "$getNearestBlockElementAncestorOrThrow", "$getNearestNodeOfType", "$getNextRightPreorderNode", "$getNextSiblingOrParentSibling", "$handleIndentAndOutdent", "$insertFirst", "$insertNodeIntoLeaf", "$insertNodeToNearestRoot", "$insertNodeToNearestRootAtCaret", "$isEditorIsNestedEditor", "$lastToFirstIterator", "$restoreEditorState", "$reverseDfs", "$reverseDfsIterator", "$splitNode", "$unwrapAndFilterDescendants", "$unwrapNode", "$wrapNodeInElement", "CAN_USE_BEFORE_INPUT", "CAN_USE_DOM", "IS_ANDROID", "IS_ANDROID_CHROME", "IS_APPLE", "IS_APPLE_WEBKIT", "IS_CHROME", "IS_FIREFOX", "IS_IOS", "IS_SAFARI", "addClassNamesToElement", "calculateZoomLevel", "isBlockDomNode", "isHTMLAnchorElement", "isHTMLElement", "isInlineDomNode", "isMimeType", "makeStateWrapper", "markSelection", "mediaFileReader", "mergeRegister", "objectKlassEquals", "registerNestedElementResolver", "removeClassNamesFromElement", "selectionAlwaysOnDisplay", "configExtension", "declarePeerDependency", "defineExtension", "safeCast", "shallowMergeConfig", "i", "t", "n", "o", "s", "k", "v", "defineExtension", "safeCast", "$getRoot", "$getSelection", "$createParagraphNode", "$isRangeSelection", "CLEAR_EDITOR_COMMAND", "COMMAND_PRIORITY_EDITOR", "getStaticNodeConfig", "createState", "DecoratorNode", "$getState", "toggleTextFormatType", "TEXT_TYPE_TO_FORMAT", "$setState", "wrapElementWith", "FORMAT_TEXT_COMMAND", "$isNodeSelection", "COMMAND_PRIORITY_LOW", "formatDevErrorMessage", "a", "b", "shallowMergeConfig", "signal", "HISTORY_MERGE_TAG", "$isEditorState", "RootNode", "TextNode", "LineBreakNode", "TabNode", "ParagraphNode", "createEditor", "mergeRegister", "theme", "$getNodeByKey", "createCommand", "addClassNamesToElement", "$create", "$createNodeSelection", "$setSelection", "$insertNodeToNearestRoot", "CLICK_COMMAND", "isDOMNode", "$getNodeFromDOMNode", "removeClassNamesFromElement", "$getEditor", "selectionAlwaysOnDisplay", "$isBlockElementNode", "$getNearestBlockElementAncestorOrThrow", "$createRangeSelection", "KEY_TAB_COMMAND", "OUTDENT_CONTENT_COMMAND", "INDENT_CONTENT_COMMAND", "INSERT_TAB_COMMAND", "$handleIndentAndOutdent", "COMMAND_PRIORITY_CRITICAL", "mod", "$createHorizontalRuleNode", "$isDecoratorTextNode", "$isHorizontalRuleNode", "AutoFocusExtension", "ClearEditorExtension", "DecoratorTextExtension", "DecoratorTextNode", "EditorStateExtension", "HorizontalRuleExtension", "HorizontalRuleNode", "INSERT_HORIZONTAL_RULE_COMMAND", "InitialStateExtension", "LexicalBuilder", "NestedEditorExtension", "NodeSelectionExtension", "SelectionAlwaysOnDisplayExtension", "TabIndentationExtension", "applyFormatFromStyle", "applyFormatToDom", "buildEditorFromExtensions", "configExtension", "declarePeerDependency", "defineExtension", "getExtensionDependencyFromEditor", "getKnownTypesAndNodes", "getPeerDependencyFromEditor", "getPeerDependencyFromEditorOrThrow", "namedSignals", "registerClearEditor", "registerTabIndentation", "safeCast", "shallowMergeConfig", "watchedSignal", "formatDevErrorMessage", "ElementNode", "addClassNamesToElement", "isHTMLAnchorElement", "_", "$copyNode", "$isRangeSelection", "$caretFromPoint", "$normalizeCaret", "$setPointFromCaret", "$getSelection", "$getChildCaret", "$isElementNode", "$insertNodeToNearestRootAtCaret", "$rewindSiblingCaret", "$isSiblingCaret", "$applyNodeReplacement", "self", "createCommand", "$setSelection", "n", "i", "$isNodeSelection", "nodes", "$findMatchingParent", "mergeRegister", "COMMAND_PRIORITY_EDITOR", "PASTE_COMMAND", "objectKlassEquals", "COMMAND_PRIORITY_LOW", "defineExtension", "namedSignals", "shallowMergeConfig", "onClick", "isDOMNode", "getNearestEditorFromDOMNode", "$getNearestNodeFromDOMNode", "a", "safeCast", "text", "$isLineBreakNode", "$isTextNode", "$createTextNode", "j", "TextNode", "k", "v", "mod", "$createAutoLinkNode", "$createLinkNode", "$isAutoLinkNode", "$isLinkNode", "$toggleLink", "AutoLinkExtension", "AutoLinkNode", "ClickableLinkExtension", "LinkExtension", "LinkNode", "TOGGLE_LINK_COMMAND", "createLinkMatcherWithRegExp", "formatUrl", "registerAutoLink", "registerClickableLink", "registerLink", "toggleLink", "formatDevErrorMessage", "i", "$getSelection", "$isRangeSelection", "$isRootOrShadowRoot", "$createParagraphNode", "$isElementNode", "$isLeafNode", "$getNearestNodeOfType", "$setPointFromCaret", "$normalizeCaret", "$getChildCaret", "$copyNode", "$isTextNode", "getStyleObjectFromCSS", "k", "ElementNode", "$getSiblingCaret", "$insertNodeToNearestRootAtCaret", "$rewindSiblingCaret", "buildImportMap", "setDOMStyleFromCSS", "isHTMLElement", "_", "self", "$isParagraphNode", "normalizeClassNames", "removeClassNamesFromElement", "addClassNamesToElement", "$applyNodeReplacement", "start", "$createTextNode", "createCommand", "mergeRegister", "COMMAND_PRIORITY_LOW", "KEY_ARROW_DOWN_COMMAND", "KEY_ARROW_UP_COMMAND", "KEY_ESCAPE_COMMAND", "KEY_SPACE_COMMAND", "$getNearestNodeFromDOMNode", "KEY_ARROW_LEFT_COMMAND", "$findMatchingParent", "calculateZoomLevel", "getNearestEditorFromDOMNode", "$addUpdateTag", "SKIP_SELECTION_FOCUS_TAG", "SKIP_DOM_SELECTION_TAG", "$getNodeByKey", "INSERT_PARAGRAPH_COMMAND", "TextNode", "defineExtension", "namedSignals", "safeCast", "mod", "$createListItemNode", "$createListNode", "$getListDepth", "$handleListInsertParagraph", "$insertList", "$isListItemNode", "$isListNode", "$removeList", "CheckListExtension", "INSERT_CHECK_LIST_COMMAND", "INSERT_ORDERED_LIST_COMMAND", "INSERT_UNORDERED_LIST_COMMAND", "ListExtension", "ListItemNode", "ListNode", "REMOVE_LIST_COMMAND", "UPDATE_LIST_START_COMMAND", "insertList", "registerCheckList", "registerList", "registerListStrictIndentTransform", "removeList", "formatDevErrorMessage", "k", "v", "$getEditor", "isEqual", "createState", "t", "getKnownTypesAndNodes", "$isLexicalNode", "getStaticNodeConfig", "a", "b", "c", "DEFAULT_EDITOR_DOM_CONFIG", "defineExtension", "RootNode", "shallowMergeConfig", "LexicalBuilder", "getExtensionDependencyFromEditor", "i", "isHTMLElement", "isDOMDocumentNode", "$getRoot", "$getEditorDOMRenderConfig", "$isTextNode", "$sliceSelectedTextNodeContent", "append", "$isElementNode", "isDocumentFragment", "$isRootOrShadowRoot", "$isBlockElementNode", "isBlockDomNode", "$createParagraphNode", "ArtificialNode__DO_NOT_USE", "$createLineBreakNode", "isInlineDomNode", "mod", "$generateDOMFromNodes", "$generateDOMFromRoot", "$generateHtmlFromNodes", "$generateNodesFromDOM", "$getRenderContextValue", "$withRenderContext", "DOMRenderExtension", "RenderContextExport", "RenderContextRoot", "contextUpdater", "contextValue", "createRenderState", "domOverride", "formatDevErrorMessage", "x", "y", "$getSelection", "$isRangeSelection", "$generateHtmlFromNodes", "text", "$generateNodesFromDOM", "i", "$createTabNode", "$getNearestNodeFromDOMNode", "$isTextNode", "$getTextPointCaret", "$isElementNode", "$getChildCaretAtIndex", "start", "$getCaretRangeInDirection", "$caretRangeFromSelection", "$comparePointCaretNext", "$splitAtPointCaretNext", "$setSelectionFromCaretRange", "$getCollapsedCaretRange", "html", "SELECTION_INSERT_CLIPBOARD_NODES_COMMAND", "$caretFromPoint", "$isTextPointCaret", "$getCaretRange", "$getChildCaret", "$getRoot", "exportNodeToJSON", "$sliceSelectedTextNodeContent", "$parseSerializedNode", "$addNodeStyle", "getDOMSelection", "COPY_COMMAND", "objectKlassEquals", "COMMAND_PRIORITY_CRITICAL", "isSelectionWithinEditor", "k", "v", "$getEditor", "LexicalBuilder", "getExtensionDependencyFromEditor", "defineExtension", "safeCast", "shallowMergeConfig", "mod", "$generateJSONFromSelectedNodes", "$generateNodesFromSerializedNodes", "$getClipboardDataFromSelection", "$getHtmlContent", "$getLexicalContent", "$handlePlainTextDrop", "$handleRichTextDrop", "$insertDataTransferForPlainText", "$insertDataTransferForRichText", "$insertGeneratedNodes", "$writeDragSourceToDataTransfer", "copyToClipboard", "setLexicalClipboardDataTransfer", "_e", "text", "$getSelection", "$isRangeSelection", "$isTextNode", "defineExtension", "namedSignals", "safeCast", "mod", "DragonExtension", "registerDragonSupport", "CAN_USE_DOM", "documentMode", "IS_APPLE", "CAN_USE_BEFORE_INPUT", "IS_IOS", "IS_ANDROID", "IS_SAFARI", "IS_CHROME", "IS_APPLE_WEBKIT", "objectKlassEquals", "$getSelection", "$getHtmlContent", "$isRangeSelection", "$insertDataTransferForPlainText", "PASTE_TAG", "mergeRegister", "DELETE_CHARACTER_COMMAND", "COMMAND_PRIORITY_EDITOR", "DELETE_WORD_COMMAND", "DELETE_LINE_COMMAND", "CONTROLLED_TEXT_INSERTION_COMMAND", "REMOVE_TEXT_COMMAND", "INSERT_LINE_BREAK_COMMAND", "INSERT_PARAGRAPH_COMMAND", "KEY_ARROW_LEFT_COMMAND", "$shouldOverrideDefaultCharacterSelection", "$moveCharacter", "KEY_ARROW_RIGHT_COMMAND", "KEY_BACKSPACE_COMMAND", "KEY_DELETE_COMMAND", "KEY_ENTER_COMMAND", "SELECT_ALL_COMMAND", "$selectAll", "COPY_COMMAND", "CUT_COMMAND", "PASTE_COMMAND", "DROP_COMMAND", "$handlePlainTextDrop", "DRAGSTART_COMMAND", "$writeDragSourceToDataTransfer", "defineExtension", "DragonExtension", "mod", "PlainTextExtension", "registerPlainText", "caretFromPoint", "x", "y", "CAN_USE_DOM", "documentMode", "IS_APPLE", "CAN_USE_BEFORE_INPUT", "IS_IOS", "IS_ANDROID", "IS_SAFARI", "IS_CHROME", "IS_APPLE_WEBKIT", "createCommand", "ElementNode", "addClassNamesToElement", "isHTMLElement", "_", "$createParagraphNode", "$applyNodeReplacement", "self", "theme", "setNodeIndentFromDOM", "$getSelection", "objectKlassEquals", "$insertDataTransferForRichText", "PASTE_TAG", "copyToClipboard", "$isRangeSelection", "$isNodeSelection", "$getNearestNodeFromDOMNode", "$isDecoratorNode", "$getRoot", "$isRootNode", "$getNearestBlockElementAncestorOrThrow", "mergeRegister", "CLICK_COMMAND", "COMMAND_PRIORITY_EDITOR", "DELETE_CHARACTER_COMMAND", "DELETE_WORD_COMMAND", "DELETE_LINE_COMMAND", "CONTROLLED_TEXT_INSERTION_COMMAND", "REMOVE_TEXT_COMMAND", "FORMAT_TEXT_COMMAND", "FORMAT_ELEMENT_COMMAND", "$findMatchingParent", "$isElementNode", "INSERT_LINE_BREAK_COMMAND", "INSERT_PARAGRAPH_COMMAND", "INSERT_TAB_COMMAND", "$createTabNode", "$insertNodes", "INDENT_CONTENT_COMMAND", "$handleIndentAndOutdent", "OUTDENT_CONTENT_COMMAND", "KEY_ARROW_UP_COMMAND", "$getAdjacentNode", "KEY_ARROW_DOWN_COMMAND", "KEY_ARROW_LEFT_COMMAND", "$isParentRTL", "$shouldOverrideDefaultCharacterSelection", "$moveCharacter", "KEY_ARROW_RIGHT_COMMAND", "KEY_BACKSPACE_COMMAND", "KEY_DELETE_COMMAND", "KEY_ENTER_COMMAND", "KEY_ESCAPE_COMMAND", "DROP_COMMAND", "$createRangeSelection", "$isTextNode", "$setSelection", "$handleRichTextDrop", "DRAGSTART_COMMAND", "setLexicalClipboardDataTransfer", "$getClipboardDataFromSelection", "$writeDragSourceToDataTransfer", "DRAGOVER_COMMAND", "SELECT_ALL_COMMAND", "$selectAll", "COPY_COMMAND", "CUT_COMMAND", "PASTE_COMMAND", "isDOMNode", "isSelectionCapturedInDecoratorInput", "KEY_SPACE_COMMAND", "KEY_TAB_COMMAND", "defineExtension", "DragonExtension", "mod", "$createHeadingNode", "$createQuoteNode", "$isHeadingNode", "$isQuoteNode", "DRAG_DROP_PASTE", "HeadingNode", "QuoteNode", "RichTextExtension", "eventFiles", "registerRichText", "$isRootNode", "$isRangeSelection", "$isTextNode", "COMPOSITION_START_TAG", "HISTORIC_TAG", "COMPOSITION_END_TAG", "HISTORY_PUSH_TAG", "HISTORY_MERGE_TAG", "delay", "CAN_UNDO_COMMAND", "CAN_REDO_COMMAND", "mergeRegister", "UNDO_COMMAND", "COMMAND_PRIORITY_EDITOR", "REDO_COMMAND", "CLEAR_EDITOR_COMMAND", "CLEAR_HISTORY_COMMAND", "defineExtension", "namedSignals", "safeCast", "getPeerDependencyFromEditor", "configExtension", "mod", "HistoryExtension", "SharedHistoryExtension", "createEmptyHistoryState", "registerHistory", "$createCodeHighlightNode", "$createCodeNode", "$getCodeLineDirection", "$getEndOfCodeInLine", "$getFirstCodeNodeOfLine", "$getLastCodeNodeOfLine", "$getStartOfCodeInLine", "$isCodeHighlightNode", "$isCodeNode", "CODE_LANGUAGE_FRIENDLY_NAME_MAP", "CODE_LANGUAGE_MAP", "CodeExtension", "CodeHighlightNode", "CodeNode", "DEFAULT_CODE_LANGUAGE", "PrismTokenizer", "getCodeLanguageOptions", "getCodeLanguages", "getCodeThemeOptions", "getDefaultCodeLanguage", "getLanguageFriendlyName", "normalizeCodeLanguage", "registerCodeHighlighting", "warnOnlyOnce", "formatDevErrorMessage", "$getSiblingCaret", "$isTabNode", "start", "getTextDirection", "$isElementNode", "$isLineBreakNode", "isHTMLElement", "ElementNode", "addClassNamesToElement", "theme", "setDOMStyleFromCSS", "getPeerDependencyFromEditor", "$getEditor", "$isTextNode", "$createTabNode", "text", "x", "$createLineBreakNode", "$createParagraphNode", "$create", "TextNode", "self", "removeClassNamesFromElement", "$applyNodeReplacement", "defineExtension", "KEY_ENTER_COMMAND", "$getSelection", "$isRangeSelection", "COMMAND_PRIORITY_LOW", "mod", "$createCodeHighlightNode", "$createCodeNode", "$getCodeLineDirection", "$getEndOfCodeInLine", "$getFirstCodeNodeOfLine", "$getLastCodeNodeOfLine", "$getStartOfCodeInLine", "$isCodeHighlightNode", "$isCodeNode", "CodeExtension", "CodeHighlightNode", "CodeNode", "DEFAULT_CODE_LANGUAGE", "getDefaultCodeLanguage", "import_prismjs", "formatDevErrorMessage", "Prism", "t", "text", "m", "i", "$createLineBreakNode", "$createTabNode", "$createCodeHighlightNode", "DEFAULT_CODE_LANGUAGE", "$isCodeNode", "$isCodeHighlightNode", "$createTextNode", "$isLineBreakNode", "$onUpdate", "$getNodeByKey", "$getSelection", "$isRangeSelection", "$isTextNode", "$isTabNode", "formatDevErrorMessage", "$createPoint", "INDENT_CONTENT_COMMAND", "OUTDENT_CONTENT_COMMAND", "INSERT_TAB_COMMAND", "$getFirstCodeNodeOfLine", "$getLastCodeNodeOfLine", "$setSelectionFromCaretRange", "$getCaretRangeInDirection", "$getCaretRange", "$getTextPointCaret", "$normalizeCaret", "$getSiblingCaret", "KEY_ARROW_UP_COMMAND", "start", "isMoveToStart", "MOVE_TO_START", "$getCodeLineDirection", "$getStartOfCodeInLine", "$getEndOfCodeInLine", "CodeNode", "CodeHighlightNode", "TextNode", "KEY_TAB_COMMAND", "COMMAND_PRIORITY_LOW", "$insertNodes", "$getRoot", "KEY_ARROW_DOWN_COMMAND", "MOVE_TO_END", "mergeRegister", "defineExtension", "namedSignals", "safeCast", "CodeExtension", "import_prismjs", "e", "t", "n", "r", "o", "e", "t", "n", "r", "o", "s", "i", "c", "l", "a", "u", "$createLineBreakNode", "$createTabNode", "$createCodeHighlightNode", "DEFAULT_CODE_LANGUAGE", "$isCodeNode", "$isCodeHighlightNode", "$createTextNode", "$isLineBreakNode", "$onUpdate", "$getNodeByKey", "$getSelection", "$isRangeSelection", "$isTextNode", "$isTabNode", "$createPoint", "INDENT_CONTENT_COMMAND", "$setSelectionFromCaretRange", "$getCaretRangeInDirection", "$getCaretRange", "$getTextPointCaret", "$normalizeCaret", "$getSiblingCaret", "$getFirstCodeNodeOfLine", "g", "KEY_ARROW_UP_COMMAND", "p", "d", "$getLastCodeNodeOfLine", "m", "h", "x", "j", "w", "MOVE_TO_START", "$getCodeLineDirection", "$getStartOfCodeInLine", "$getEndOfCodeInLine", "CodeNode", "CodeHighlightNode", "TextNode", "KEY_TAB_COMMAND", "OUTDENT_CONTENT_COMMAND", "INSERT_TAB_COMMAND", "COMMAND_PRIORITY_LOW", "$insertNodes", "$getRoot", "KEY_ARROW_DOWN_COMMAND", "MOVE_TO_END", "mergeRegister", "defineExtension", "namedSignals", "safeCast", "CodeExtension", "mod", "CODE_LANGUAGE_FRIENDLY_NAME_MAP", "CODE_LANGUAGE_MAP", "CodePrismExtension", "PrismTokenizer", "getCodeLanguageOptions", "getCodeLanguages", "getCodeThemeOptions", "getLanguageFriendlyName", "isCodeLanguageLoaded", "loadCodeLanguage", "normalizeCodeLanguage", "registerCodeHighlighting", "CODE_LANGUAGE_FRIENDLY_NAME_MAP", "CODE_LANGUAGE_MAP", "getCodeLanguageOptions", "getCodeLanguages", "getCodeThemeOptions", "getLanguageFriendlyName", "normalizeCodeLanguage", "PrismTokenizer", "registerCodeHighlighting", "mod", "$createCodeHighlightNode", "$createCodeNode", "$getCodeLineDirection", "$getEndOfCodeInLine", "$getFirstCodeNodeOfLine", "$getLastCodeNodeOfLine", "$getStartOfCodeInLine", "$isCodeHighlightNode", "$isCodeNode", "CODE_LANGUAGE_FRIENDLY_NAME_MAP", "CODE_LANGUAGE_MAP", "CodeExtension", "CodeHighlightNode", "CodeNode", "DEFAULT_CODE_LANGUAGE", "PrismTokenizer", "getCodeLanguageOptions", "getCodeLanguages", "getCodeThemeOptions", "getDefaultCodeLanguage", "getLanguageFriendlyName", "normalizeCodeLang", "normalizeCodeLanguage", "registerCodeHighlighting", "t", "PUNCTUATION_OR_SPACE", "$isParagraphNode", "$isTextNode", "_", "a", "b", "$getRoot", "i", "$isElementNode", "$isDecoratorNode", "$isLineBreakNode", "n", "text", "j", "$getSelection", "$createTextNode", "$createParagraphNode", "$isQuoteNode", "$isListNode", "$findMatchingParent", "$isListItemNode", "$createLineBreakNode", "$createTabNode", "formatDevErrorMessage", "createState", "v", "$createListItemNode", "$setState", "$createListNode", "exportChildren", "$getState", "HeadingNode", "$isHeadingNode", "$createHeadingNode", "QuoteNode", "$createQuoteNode", "CodeNode", "$isCodeNode", "linesInBetween", "afterFullMatch", "$createCodeNode", "ListNode", "ListItemNode", "LinkNode", "$isLinkNode", "$isAutoLinkNode", "$createLinkNode", "$isRootOrShadowRoot", "$createRangeSelection", "$setSelection", "$isRangeSelection", "mergeRegister", "COLLABORATION_TAG", "HISTORIC_TAG", "$addUpdateTag", "HISTORY_PUSH_TAG", "KEY_ENTER_COMMAND", "COMMAND_PRIORITY_LOW", "mod", "$convertFromMarkdownString", "$convertToMarkdownString", "BOLD_ITALIC_STAR", "BOLD_ITALIC_UNDERSCORE", "BOLD_STAR", "BOLD_UNDERSCORE", "CHECK_LIST", "CODE", "ELEMENT_TRANSFORMERS", "HEADING", "HIGHLIGHT", "INLINE_CODE", "ITALIC_STAR", "ITALIC_UNDERSCORE", "LINK", "MULTILINE_ELEMENT_TRANSFORMERS", "ORDERED_LIST", "QUOTE", "STRIKETHROUGH", "TEXT_FORMAT_TRANSFORMERS", "TEXT_MATCH_TRANSFORMERS", "TRANSFORMERS", "UNORDERED_LIST", "registerMarkdownShortcuts", "ElementNode", "addClassNamesToElement", "isHTMLElement", "self", "$isLineBreakNode", "$isInlineElementOrDecoratorNode", "$isTextNode", "$createParagraphNode", "$applyNodeReplacement", "createCommand", "formatDevErrorMessage", "$descendantsMatching", "CAN_USE_DOM", "documentMode", "IS_FIREFOX", "$createTextNode", "$findMatchingParent", "n", "x", "y", "r", "c", "$getSelection", "$isRangeSelection", "i", "$insertFirst", "$isParagraphNode", "j", "k", "$getNodeByKey", "$createPoint", "text", "TEXT_TYPE_TO_FORMAT", "$isElementNode", "isCurrentlyReadOnlyMode", "$getEditor", "$setSelection", "SELECTION_CHANGE_COMMAND", "removeClassNamesFromElement", "getDOMSelection", "$createRangeSelection", "$isRootNode", "INSERT_PARAGRAPH_COMMAND", "KEY_ARROW_DOWN_COMMAND", "KEY_ARROW_UP_COMMAND", "KEY_ARROW_LEFT_COMMAND", "KEY_ARROW_RIGHT_COMMAND", "DELETE_WORD_COMMAND", "DELETE_LINE_COMMAND", "DELETE_CHARACTER_COMMAND", "KEY_BACKSPACE_COMMAND", "KEY_DELETE_COMMAND", "isDOMNode", "$getNodeByKeyOrThrow", "$getPreviousSelection", "COMMAND_PRIORITY_HIGH", "KEY_ESCAPE_COMMAND", "CUT_COMMAND", "copyToClipboard", "objectKlassEquals", "$getClipboardDataFromSelection", "FORMAT_TEXT_COMMAND", "FORMAT_ELEMENT_COMMAND", "CONTROLLED_TEXT_INSERTION_COMMAND", "KEY_TAB_COMMAND", "FOCUS_COMMAND", "$getNearestNodeFromDOMNode", "$createRangeSelectionFromDom", "$caretFromPoint", "$isExtendableTextPointCaret", "$extendCaretToRange", "$isSiblingCaret", "$getSiblingCaret", "$setPointFromCaret", "$normalizeCaret", "$getAdjacentChildCaret", "$isChildCaret", "$getChildCaret", "$isRootOrShadowRoot", "$convertTableElement", "setDOMStyleFromCSS", "setDOMUnmanaged", "$insertNodeToNearestRoot", "$unwrapAndFilterDescendants", "$getRoot", "mergeRegister", "COMMAND_PRIORITY_EDITOR", "SELECTION_INSERT_CLIPBOARD_NODES_COMMAND", "SELECT_ALL_COMMAND", "COMMAND_PRIORITY_LOW", "CLICK_COMMAND", "$dfs", "d", "defineExtension", "namedSignals", "safeCast", "mod", "$computeTableMap", "$computeTableMapSkipCellCheck", "$createTableCellNode", "$createTableNode", "$createTableNodeWithDimensions", "$createTableRowNode", "$createTableSelection", "$createTableSelectionFrom", "$deleteTableColumn", "$deleteTableColumnAtSelection", "$deleteTableColumn__EXPERIMENTAL", "$deleteTableRowAtSelection", "$deleteTableRow__EXPERIMENTAL", "$findCellNode", "$findTableNode", "$getElementForTableNode", "$getNodeTriplet", "$getTableAndElementByKey", "$getTableCellNodeFromLexicalNode", "$getTableCellNodeRect", "$getTableColumnIndexFromTableCellNode", "$getTableNodeFromLexicalNodeOrThrow", "$getTableRowIndexFromTableCellNode", "$getTableRowNodeFromTableCellNodeOrThrow", "$insertTableColumn", "$insertTableColumnAtSelection", "$insertTableColumn__EXPERIMENTAL", "$insertTableRow", "$insertTableRowAtSelection", "$insertTableRow__EXPERIMENTAL", "$isScrollableTablesActive", "$isSimpleTable", "$isTableCellNode", "$isTableNode", "$isTableRowNode", "$isTableSelection", "$mergeCells", "$moveTableColumn", "$removeTableRowAtIndex", "$unmergeCell", "INSERT_TABLE_COMMAND", "TableCellHeaderStates", "TableCellNode", "TableExtension", "TableNode", "TableObserver", "TableRowNode", "applyTableHandlers", "getDOMCellFromTarget", "getTableElement", "getTableObserverFromTableElement", "registerTableCellUnmergeTransform", "registerTablePlugin", "registerTableSelectionObserver", "setScrollableTablesActive", "_getDefaults", "_defaults", "changeDefaults", "newDefaults", "noopTest", "edit", "regex", "opt", "source", "obj", "name", "val", "valSource", "other", "supportsLookbehind", "bull", "indent", "newline", "blockCode", "fences", "hr", "heading", "bullet", "lheadingCore", "lheading", "lheadingGfm", "_paragraph", "blockText", "_blockLabel", "def", "list", "_tag", "_comment", "html", "paragraph", "blockquote", "blockNormal", "gfmTable", "blockGfm", "blockPedantic", "escape", "inlineCode", "br", "inlineText", "_punctuation", "_punctuationOrSpace", "_notPunctuationOrSpace", "punctuation", "_punctuationGfmStrongEm", "_punctuationOrSpaceGfmStrongEm", "_notPunctuationOrSpaceGfmStrongEm", "blockSkip", "emStrongLDelimCore", "emStrongLDelim", "emStrongLDelimGfm", "emStrongRDelimAstCore", "emStrongRDelimAst", "emStrongRDelimAstGfm", "emStrongRDelimUnd", "anyPunctuation", "autolink", "_inlineComment", "tag", "_inlineLabel", "link", "reflink", "nolink", "reflinkSearch", "_caseInsensitiveProtocol", "inlineNormal", "inlinePedantic", "inlineGfm", "inlineBreaks", "block", "inline", "escapeReplacements", "getEscapeReplacement", "ch", "encode", "cleanUrl", "href", "splitCells", "tableRow", "count", "row", "match", "offset", "str", "escaped", "curr", "cells", "i", "rtrim", "c", "invert", "l", "suffLen", "currChar", "findClosingBracket", "b", "level", "outputLink", "cap", "raw", "lexer", "rules", "title", "text", "token", "indentCodeCompensation", "matchIndentToCode", "indentToCode", "node", "matchIndentInNode", "indentInNode", "_Tokenizer", "options", "src", "trimmed", "lines", "tokens", "inBlockquote", "currentLines", "currentRaw", "currentText", "top", "lastToken", "oldToken", "newText", "newToken", "isordered", "itemRegex", "endsWithBlankLine", "endEarly", "itemContents", "line", "t", "nextLine", "blankLine", "nextBulletRegex", "hrRegex", "fencesBeginRegex", "headingBeginRegex", "htmlBeginRegex", "rawLine", "nextLineWithoutTabs", "istask", "ischecked", "lastItem", "spacers", "hasMultipleLineBreaks", "headers", "aligns", "rows", "item", "align", "cell", "trimmedUrl", "rtrimSlash", "lastParenIndex", "linkLen", "links", "linkString", "maskedSrc", "prevChar", "lLength", "rDelim", "rLength", "delimTotal", "midDelimTotal", "endReg", "lastCharLength", "hasNonSpaceChars", "hasSpaceCharsOnBothEnds", "prevCapZero", "_Lexer", "__Lexer", "next", "lastParagraphClipped", "extTokenizer", "cutSrc", "startIndex", "tempSrc", "tempStart", "getStartIndex", "errMsg", "keepPrevChar", "_Renderer", "lang", "langString", "code", "depth", "ordered", "start", "body", "j", "type", "startAttr", "itemBody", "checkbox", "checked", "header", "k", "content", "cleanHref", "out", "_TextRenderer", "_Parser", "__Parser", "anyToken", "genericToken", "ret", "textToken", "renderer", "_Hooks", "markdown", "Marked", "args", "callback", "values", "tableToken", "listToken", "childTokens", "extensions", "pack", "opts", "ext", "prevRenderer", "extLevel", "prop", "rendererProp", "rendererFunc", "tokenizer", "tokenizerProp", "tokenizerFunc", "prevTokenizer", "hooks", "hooksProp", "hooksFunc", "prevHook", "arg", "walkTokens", "packWalktokens", "blockType", "origOpt", "throwError", "processedSrc", "processedTokens", "e", "silent", "async", "msg", "markedInstance", "marked", "setOptions", "use", "parseInline", "parser", "_Parser", "lexer", "_Lexer", "import_prismjs", "global", "ATTR_WHITESPACE", "html", "getStyleObjectFromCSS", "getCSSFromStyleObject", "listener", "key", "value", "SKIP_DOM_SELECTION_TAG", "CAN_UNDO_COMMAND", "COMMAND_PRIORITY_LOW", "CAN_REDO_COMMAND", "$getSelection", "$isRangeSelection", "isBold", "isItalic", "isUnderline", "a", "b", "$isTextNode", "computed", "$getSelectionStyleValueForProperty", "LinkNode", "i", "DecoratorNode", "$createTextNode", "_", "text", "defineExtension", "$getCommonAncestor", "$findMatchingParent", "$createNodeSelection", "$isNodeSelection", "$isElementNode", "$isRootOrShadowRoot", "$isRootNode", "$isDecoratorNode", "$wrapNodeInElement", "$getNearestNodeOfType", "ListNode", "$isAtNodeEnd", "TextNode", "x", "childNode", "$isLineBreakNode", "$lastToFirstIterator", "$getRoot", "$isParagraphNode", "$createParagraphNode", "$ensureForwardRangeSelection", "$caretFromPoint", "$setSelectionFromCaretRange", "$getCaretRange", "$normalizeCaret", "$getChildCaret", "$getCaretInDirection", "$isTextPointCaret", "$isExtendableTextPointCaret", "$getSiblingCaret", "$isChildCaret", "$isSiblingCaret", "$rewindSiblingCaret", "$splitAtPointCaretNext", "createCommand", "HistoryExtension", "COMMAND_PRIORITY_EDITOR", "entries", "$getEditor", "$getNodeByKey", "HISTORY_MERGE_TAG", "SKIP_SCROLL_INTO_VIEW_TAG", "clone", "$cloneWithProperties", "$getNearestRootOrShadowRoot", "delay", "$descendantsMatching", "c", "DecoratorNode", "$createParagraphNode", "PUNCTUATION_OR_SPACE", "t", "a", "b", "$getSelection", "$isRangeSelection", "$getNodeByKey", "$isTextNode", "$isCodeNode", "$createRangeSelection", "$setSelection", "ElementNode", "$insertFirst", "$unwrapAndFilterDescendants", "$firstToLastIterator", "$splitNode", "$getNearestNodeOfType", "$wrapNodeInElement", "SKIP_DOM_SELECTION_TAG", "HISTORY_MERGE_TAG", "text", "createCommand", "createState", "defineExtension", "RichTextExtension", "mergeRegister", "COMMAND_PRIORITY_NORMAL", "TextNode", "CodeHighlightNode", "$hasUpdateTag", "PASTE_TAG", "getCSSFromStyleObject", "domNode", "$createCodeNode", "start", "$isCodeHighlightNode", "$createCodeHighlightNode", "$isElementNode", "$getSelectionStyleValueForProperty", "$patchStyleText", "getStyleObjectFromCSS", "IS_HIGHLIGHT", "$setState", "$getState", "FORMAT_TEXT_COMMAND", "LinkNode", "$createAutoLinkNode", "$createTextNode", "$toggleLink", "i", "CodeNode", "$insertNodeToNearestRoot", "INSERT_TABLE_COMMAND", "UNDO_COMMAND", "REDO_COMMAND", "KEY_ARROW_RIGHT_COMMAND", "KEY_TAB_COMMAND", "INSERT_LINE_BREAK_COMMAND", "COMMAND_PRIORITY_HIGH", "INSERT_PARAGRAPH_COMMAND", "OUTDENT_CONTENT_COMMAND", "INDENT_CONTENT_COMMAND", "$isNodeSelection", "$getRoot", "$isQuoteNode", "$getTableCellNodeFromLexicalNode", "$isLineBreakNode", "ListItemNode", "QuoteNode", "ListNode", "$getListDepth", "TableCellNode", "KEY_ARROW_LEFT_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_ARROW_UP_COMMAND", "KEY_ARROW_DOWN_COMMAND", "DELETE_CHARACTER_COMMAND", "SELECTION_CHANGE_COMMAND", "COMMAND_PRIORITY_CRITICAL", "$addUpdateTag", "CLICK_COMMAND", "isDOMNode", "$getNearestNodeFromDOMNode", "$isDecoratorNode", "$isHeadingNode", "x", "y", "computed", "img", "DirectUpload", "$ensureForwardRangeSelection", "$getChildCaretAtIndex", "$createLineBreakNode", "$isListNode", "$isListItemNode", "html", "$getNearestBlockElementAncestorOrThrow", "$setBlocksType", "$createHeadingNode", "INSERT_UNORDERED_LIST_COMMAND", "INSERT_ORDERED_LIST_COMMAND", "$forEachSelectedTextNode", "$createQuoteNode", "$createLinkNode", "n", "SELECTION_INSERT_CLIPBOARD_NODES_COMMAND", "$isRootOrShadowRoot", "$createListNode", "$createListItemNode", "$isParagraphNode", "PASTE_COMMAND", "$onUpdate", "$insertDataTransferForRichText", "$isLinkNode", "ParagraphNode", "p", "self", "RootNode", "registerCodeHighlighting", "PrismTokenizer", "normalizeCodeLang", "TableNode", "TableRowNode", "setScrollableTablesActive", "registerTablePlugin", "registerTableSelectionObserver", "TableCellHeaderStates", "$insertTableRowAtSelection", "$insertTableColumnAtSelection", "$deleteTableRowAtSelection", "$deleteTableColumnAtSelection", "$findTableNode", "DRAGSTART_COMMAND", "DROP_COMMAND", "targetGallery", "position", "KEY_DOWN_COMMAND", "$getSiblingCaret", "$getChildCaret", "flipDirection", "IS_APPLE", "$findMatchingParent", "caretFromPoint", "rect", "$createRangeSelectionFromDom", "CLEAR_HISTORY_COMMAND", "$generateNodesFromDOM", "$generateHtmlFromNodes", "buildEditorFromExtensions", "editor", "HeadingNode", "AutoLinkNode", "registerRichText", "registerList", "TRANSFORMERS", "registerMarkdownShortcuts", "registerPlainText", "KEY_ENTER_COMMAND", "CAN_UNDO_COMMAND", "CAN_REDO_COMMAND", "KEY_SPACE_COMMAND", "INPUT_COMMAND", "signal", "CODE_LANGUAGE_FRIENDLY_NAME_MAP", "HISTORY_PUSH_TAG", "$getTableRowIndexFromTableCellNode", "$getTableColumnIndexFromTableCellNode", "$findCellNode", "KEY_BACKSPACE_COMMAND", "$getElementForTableNode"]
}
