var t_ = Object.create; var wi = Object.defineProperty; var n_ = Object.getOwnPropertyDescriptor; var r_ = Object.getOwnPropertyNames; var o_ = Object.getPrototypeOf, i_ = Object.prototype.hasOwnProperty; var s_ = (n, e, t) => e in n ? wi(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t; var a_ = (n, e) => () => (e || n((e = { exports: {} }).exports, e), e.exports), At = (n, e) => { for (var t in e) wi(n, t, { get: e[t], enumerable: !0 }) }, l_ = (n, e, t, r) => { if (e && typeof e == "object" || typeof e == "function") for (let o of r_(e)) !i_.call(n, o) && o !== t && wi(n, o, { get: () => e[o], enumerable: !(r = n_(e, o)) || r.enumerable }); return n }; var Au = (n, e, t) => (t = n != null ? t_(o_(n)) : {}, l_(e || !n || !n.__esModule ? wi(t, "default", { value: n, enumerable: !0 }) : t, n)); var kt = (n, e, t) => s_(n, typeof e != "symbol" ? e + "" : e, t); var Dc = a_((kT, Qs) => { var hN = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {}; var H = function (n) { var e = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, t = 0, r = {}, o = { manual: n.Prism && n.Prism.manual, disableWorkerMessageHandler: n.Prism && n.Prism.disableWorkerMessageHandler, util: { encode: function m(h) { return h instanceof i ? new i(h.type, m(h.content), h.alias) : Array.isArray(h) ? h.map(m) : h.replace(/&/g, "&").replace(/ "u") return null; if (document.currentScript && document.currentScript.tagName === "SCRIPT") return document.currentScript; try { throw new Error } catch (C) { var m = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(C.stack) || [])[1]; if (m) { var h = document.getElementsByTagName("script"); for (var _ in h) if (h[_].src == m) return h[_] } return null } }, isActive: function (m, h, _) { for (var C = "no-" + h; m;) { var y = m.classList; if (y.contains(h)) return !0; if (y.contains(C)) return !1; m = m.parentElement } return !!_ } }, languages: { plain: r, plaintext: r, text: r, txt: r, extend: function (m, h) { var _ = o.util.clone(o.languages[m]); for (var C in h) _[C] = h[C]; return _ }, insertBefore: function (m, h, _, C) { C = C || o.languages; var y = C[m], x = {}; for (var b in y) if (y.hasOwnProperty(b)) { if (b == h) for (var S in _) _.hasOwnProperty(S) && (x[S] = _[S]); _.hasOwnProperty(b) || (x[b] = y[b]) } var N = C[m]; return C[m] = x, o.languages.DFS(o.languages, function (A, O) { O === N && A != m && (this[A] = x) }), x }, DFS: function m(h, _, C, y) { y = y || {}; var x = o.util.objId; for (var b in h) if (h.hasOwnProperty(b)) { _.call(h, b, h[b], C || b); var S = h[b], N = o.util.type(S); N === "Object" && !y[x(S)] ? (y[x(S)] = !0, m(S, _, null, y)) : N === "Array" && !y[x(S)] && (y[x(S)] = !0, m(S, _, b, y)) } } }, plugins: {}, highlightAll: function (m, h) { o.highlightAllUnder(document, m, h) }, highlightAllUnder: function (m, h, _) { var C = { callback: _, container: m, selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code' }; o.hooks.run("before-highlightall", C), C.elements = Array.prototype.slice.apply(C.container.querySelectorAll(C.selector)), o.hooks.run("before-all-elements-highlight", C); for (var y = 0, x; x = C.elements[y++];)o.highlightElement(x, h === !0, C.callback) }, highlightElement: function (m, h, _) { var C = o.util.getLanguage(m), y = o.languages[C]; o.util.setLanguage(m, C); var x = m.parentElement; x && x.nodeName.toLowerCase() === "pre" && o.util.setLanguage(x, C); var b = m.textContent, S = { element: m, language: C, grammar: y, code: b }; function N(O) { S.highlightedCode = O, o.hooks.run("before-insert", S), S.element.innerHTML = S.highlightedCode, o.hooks.run("after-highlight", S), o.hooks.run("complete", S), _ && _.call(S.element) } if (o.hooks.run("before-sanity-check", S), x = S.element.parentElement, x && x.nodeName.toLowerCase() === "pre" && !x.hasAttribute("tabindex") && x.setAttribute("tabindex", "0"), !S.code) { o.hooks.run("complete", S), _ && _.call(S.element); return } if (o.hooks.run("before-highlight", S), !S.grammar) { N(o.util.encode(S.code)); return } if (h && n.Worker) { var A = new Worker(o.filename); A.onmessage = function (O) { N(O.data) }, A.postMessage(JSON.stringify({ language: S.language, code: S.code, immediateClose: !0 })) } else N(o.highlight(S.code, S.grammar, S.language)) }, highlight: function (m, h, _) { var C = { code: m, grammar: h, language: _ }; if (o.hooks.run("before-tokenize", C), !C.grammar) throw new Error('The language "' + C.language + '" has no grammar.'); return C.tokens = o.tokenize(C.code, C.grammar), o.hooks.run("after-tokenize", C), i.stringify(o.util.encode(C.tokens), C.language) }, tokenize: function (m, h) { var _ = h.rest; if (_) { for (var C in _) h[C] = _[C]; delete h.rest } var y = new l; return c(y, y.head, m), a(m, y, h, y.head, 0), p(y) }, hooks: { all: {}, add: function (m, h) { var _ = o.hooks.all; _[m] = _[m] || [], _[m].push(h) }, run: function (m, h) { var _ = o.hooks.all[m]; if (!(!_ || !_.length)) for (var C = 0, y; y = _[C++];)y(h) } }, Token: i }; n.Prism = o; function i(m, h, _, C) { this.type = m, this.content = h, this.alias = _, this.length = (C || "").length | 0 } i.stringify = function m(h, _) { if (typeof h == "string") return h; if (Array.isArray(h)) { var C = ""; return h.forEach(function (N) { C += m(N, _) }), C } var y = { type: h.type, content: m(h.content, _), tag: "span", classes: ["token", h.type], attributes: {}, language: _ }, x = h.alias; x && (Array.isArray(x) ? Array.prototype.push.apply(y.classes, x) : y.classes.push(x)), o.hooks.run("wrap", y); var b = ""; for (var S in y.attributes) b += " " + S + '="' + (y.attributes[S] || "").replace(/"/g, """) + '"'; return "<" + y.tag + ' class="' + y.classes.join(" ") + '"' + b + ">" + y.content + "" }; function s(m, h, _, C) { m.lastIndex = h; var y = m.exec(_); if (y && C && y[1]) { var x = y[1].length; y.index += x, y[0] = y[0].slice(x) } return y } function a(m, h, _, C, y, x) { for (var b in _) if (!(!_.hasOwnProperty(b) || !_[b])) { var S = _[b]; S = Array.isArray(S) ? S : [S]; for (var N = 0; N < S.length; ++N) { if (x && x.cause == b + "," + N) return; var A = S[N], O = A.inside, F = !!A.lookbehind, L = !!A.greedy, G = A.alias; if (L && !A.pattern.global) { var U = A.pattern.toString().match(/[imsuy]*$/)[0]; A.pattern = RegExp(A.pattern.source, U + "g") } for (var K = A.pattern || A, W = C.next, q = y; W !== h.tail && !(x && q >= x.reach); q += W.value.length, W = W.next) { var de = W.value; if (h.length > m.length) return; if (!(de instanceof i)) { var ae = 1, le; if (L) { if (le = s(K, q, m, F), !le || le.index >= m.length) break; var Be = le.index, Qe = le.index + le[0].length, Je = q; for (Je += W.value.length; Be >= Je;)W = W.next, Je += W.value.length; if (Je -= W.value.length, q = Je, W.value instanceof i) continue; for (var dt = W; dt !== h.tail && (Je < Qe || typeof dt.value == "string"); dt = dt.next)ae++, Je += dt.value.length; ae--, de = m.slice(q, Je), le.index -= q } else if (le = s(K, 0, de, F), !le) continue; var Be = le.index, ke = le[0], ft = de.slice(0, Be), Oe = de.slice(Be + ke.length), re = q + de.length; x && re > x.reach && (x.reach = re); var ye = W.prev; ft && (ye = c(h, ye, ft), q += ft.length), u(h, ye, ae); var Re = new i(b, O ? o.tokenize(ke, O) : ke, G, ke); if (W = c(h, ye, Re), Oe && c(h, W, Oe), ae > 1) { var Ve = { cause: b + "," + N, reach: re }; a(m, h, _, W.prev, q, Ve), x && Ve.reach > x.reach && (x.reach = Ve.reach) } } } } } } function l() { var m = { value: null, prev: null, next: null }, h = { value: null, prev: m, next: null }; m.next = h, this.head = m, this.tail = h, this.length = 0 } function c(m, h, _) { var C = h.next, y = { value: _, prev: h, next: C }; return h.next = y, C.prev = y, m.length++, y } function u(m, h, _) { for (var C = h.next, y = 0; y < _ && C !== m.tail; y++)C = C.next; h.next = C, C.prev = h, m.length -= y } function p(m) { for (var h = [], _ = m.head.next; _ !== m.tail;)h.push(_.value), _ = _.next; return h } if (!n.document) return n.addEventListener && (o.disableWorkerMessageHandler || n.addEventListener("message", function (m) { var h = JSON.parse(m.data), _ = h.language, C = h.code, y = h.immediateClose; n.postMessage(o.highlight(C, o.languages[_], _)), y && n.close() }, !1)), o; var g = o.util.currentScript(); g && (o.filename = g.src, g.hasAttribute("data-manual") && (o.manual = !0)); function f() { o.manual || o.highlightAll() } if (!o.manual) { var d = document.readyState; d === "loading" || d === "interactive" && g && g.defer ? document.addEventListener("DOMContentLoaded", f) : window.requestAnimationFrame ? window.requestAnimationFrame(f) : window.setTimeout(f, 16) } return o }(hN); typeof Qs < "u" && Qs.exports && (Qs.exports = H); typeof global < "u" && (global.Prism = H); H.languages.markup = { comment: { pattern: //, greedy: !0 }, prolog: { pattern: /<\?[\s\S]+?\?>/, greedy: !0 }, doctype: { pattern: /"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i, greedy: !0, inside: { "internal-subset": { pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/, lookbehind: !0, greedy: !0, inside: null }, string: { pattern: /"[^"]*"|'[^']*'/, greedy: !0 }, punctuation: /^$|[[\]]/, "doctype-tag": /^DOCTYPE/i, name: /[^\s<>'"]+/ } }, cdata: { pattern: //i, greedy: !0 }, tag: { pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/, greedy: !0, inside: { tag: { pattern: /^<\/?[^\s>\/]+/, inside: { punctuation: /^<\/?/, namespace: /^[^\s>\/:]+:/ } }, "special-attr": [], "attr-value": { pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/, inside: { punctuation: [{ pattern: /^=/, alias: "attr-equals" }, { pattern: /^(\s*)["']|["']$/, lookbehind: !0 }] } }, punctuation: /\/?>/, "attr-name": { pattern: /[^\s>\/]+/, inside: { namespace: /^[^\s>\/:]+:/ } } } }, entity: [{ pattern: /&[\da-z]{1,8};/i, alias: "named-entity" }, /&#x?[\da-f]{1,8};/i] }; H.languages.markup.tag.inside["attr-value"].inside.entity = H.languages.markup.entity; H.languages.markup.doctype.inside["internal-subset"].inside = H.languages.markup; H.hooks.add("wrap", function (n) { n.type === "entity" && (n.attributes.title = n.content.replace(/&/, "&")) }); Object.defineProperty(H.languages.markup.tag, "addInlined", { value: function (e, t) { var r = {}; r["language-" + t] = { pattern: /(^$)/i, lookbehind: !0, inside: H.languages[t] }, r.cdata = /^$/i; var o = { "included-cdata": { pattern: //i, inside: r } }; o["language-" + t] = { pattern: /[\s\S]+/, inside: H.languages[t] }; var i = {}; i[e] = { pattern: RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g, function () { return e }), "i"), lookbehind: !0, greedy: !0, inside: o }, H.languages.insertBefore("markup", "cdata", i) } }); Object.defineProperty(H.languages.markup.tag, "addAttribute", { value: function (n, e) { H.languages.markup.tag.inside["special-attr"].push({ pattern: RegExp(/(^|["'\s])/.source + "(?:" + n + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, "i"), lookbehind: !0, inside: { "attr-name": /^[^\s=]+/, "attr-value": { pattern: /=[\s\S]+/, inside: { value: { pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/, lookbehind: !0, alias: [e, "language-" + e], inside: H.languages[e] }, punctuation: [{ pattern: /^=/, alias: "attr-equals" }, /"|'/] } } } }) } }); H.languages.html = H.languages.markup; H.languages.mathml = H.languages.markup; H.languages.svg = H.languages.markup; H.languages.xml = H.languages.extend("markup", {}); H.languages.ssml = H.languages.xml; H.languages.atom = H.languages.xml; H.languages.rss = H.languages.xml; (function (n) { var e = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/; n.languages.css = { comment: /\/\*[\s\S]*?\*\//, atrule: { pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + e.source + ")*?" + /(?:;|(?=\s*\{))/.source), inside: { rule: /^@[\w-]+/, "selector-function-argument": { pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/, lookbehind: !0, alias: "selector" }, keyword: { pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/, lookbehind: !0 } } }, url: { pattern: RegExp("\\burl\\((?:" + e.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"), greedy: !0, inside: { function: /^url/i, punctuation: /^\(|\)$/, string: { pattern: RegExp("^" + e.source + "$"), alias: "url" } } }, selector: { pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + e.source + ")*(?=\\s*\\{)"), lookbehind: !0 }, string: { pattern: e, greedy: !0 }, property: { pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i, lookbehind: !0 }, important: /!important\b/i, function: { pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i, lookbehind: !0 }, punctuation: /[(){};:,]/ }, n.languages.css.atrule.inside.rest = n.languages.css; var t = n.languages.markup; t && (t.tag.addInlined("style", "css"), t.tag.addAttribute("style", "css")) })(H); H.languages.clike = { comment: [{ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, lookbehind: !0, greedy: !0 }, { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }], string: { pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, greedy: !0 }, "class-name": { pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i, lookbehind: !0, inside: { punctuation: /[.\\]/ } }, keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/, boolean: /\b(?:false|true)\b/, function: /\b\w+(?=\()/, number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, punctuation: /[{}[\];(),.:]/ }; H.languages.javascript = H.languages.extend("clike", { "class-name": [H.languages.clike["class-name"], { pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/, lookbehind: !0 }], keyword: [{ pattern: /((?:^|\})\s*)catch\b/, lookbehind: !0 }, { pattern: /(^|[^.]|\.\.\.\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/, lookbehind: !0 }], function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, number: { pattern: RegExp(/(^|[^\w$])/.source + "(?:" + (/NaN|Infinity/.source + "|" + /0[bB][01]+(?:_[01]+)*n?/.source + "|" + /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + /\d+(?:_\d+)*n/.source + "|" + /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source), lookbehind: !0 }, operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/ }); H.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/; H.languages.insertBefore("javascript", "keyword", { regex: { pattern: RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source), lookbehind: !0, greedy: !0, inside: { "regex-source": { pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/, lookbehind: !0, alias: "language-regex", inside: H.languages.regex }, "regex-delimiter": /^\/|\/$/, "regex-flags": /^[a-z]+$/ } }, "function-variable": { pattern: /#?(?!\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*=>))/, alias: "function" }, parameter: [{ pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/, lookbehind: !0, inside: H.languages.javascript }, { pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i, lookbehind: !0, inside: H.languages.javascript }, { pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/, lookbehind: !0, inside: H.languages.javascript }, { pattern: /((?:\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*\{)/, lookbehind: !0, inside: H.languages.javascript }], constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/ }); H.languages.insertBefore("javascript", "string", { hashbang: { pattern: /^#!.*/, greedy: !0, alias: "comment" }, "template-string": { pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/, greedy: !0, inside: { "template-punctuation": { pattern: /^`|`$/, alias: "string" }, interpolation: { pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, lookbehind: !0, inside: { "interpolation-punctuation": { pattern: /^\$\{|\}$/, alias: "punctuation" }, rest: H.languages.javascript } }, string: /[\s\S]+/ } }, "string-property": { pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m, lookbehind: !0, greedy: !0, alias: "property" } }); H.languages.insertBefore("javascript", "operator", { "literal-property": { pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m, lookbehind: !0, alias: "property" } }); H.languages.markup && (H.languages.markup.tag.addInlined("script", "javascript"), H.languages.markup.tag.addAttribute(/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, "javascript")); H.languages.js = H.languages.javascript; (function () { if (typeof H > "u" || typeof document > "u") return; Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector); var n = "Loading\u2026", e = function (g, f) { return "\u2716 Error " + g + " while fetching file: " + f }, t = "\u2716 Error: File does not exist or is empty", r = { js: "javascript", py: "python", rb: "ruby", ps1: "powershell", psm1: "powershell", sh: "bash", bat: "batch", h: "c", tex: "latex" }, o = "data-src-status", i = "loading", s = "loaded", a = "failed", l = "pre[data-src]:not([" + o + '="' + s + '"]):not([' + o + '="' + i + '"])'; function c(g, f, d) { var m = new XMLHttpRequest; m.open("GET", g, !0), m.onreadystatechange = function () { m.readyState == 4 && (m.status < 400 && m.responseText ? f(m.responseText) : m.status >= 400 ? d(e(m.status, m.statusText)) : d(t)) }, m.send(null) } function u(g) { var f = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g || ""); if (f) { var d = Number(f[1]), m = f[2], h = f[3]; return m ? h ? [d, Number(h)] : [d, void 0] : [d, d] } } H.hooks.add("before-highlightall", function (g) { g.selector += ", " + l }), H.hooks.add("before-sanity-check", function (g) { var f = g.element; if (f.matches(l)) { g.code = "", f.setAttribute(o, i); var d = f.appendChild(document.createElement("CODE")); d.textContent = n; var m = f.getAttribute("data-src"), h = g.language; if (h === "none") { var _ = (/\.(\w+)$/.exec(m) || [, "none"])[1]; h = r[_] || _ } H.util.setLanguage(d, h), H.util.setLanguage(f, h); var C = H.plugins.autoloader; C && C.loadLanguages(h), c(m, function (y) { f.setAttribute(o, s); var x = u(f.getAttribute("data-range")); if (x) { var b = y.split(/\r\n?|\n/g), S = x[0], N = x[1] == null ? b.length : x[1]; S < 0 && (S += b.length), S = Math.max(0, Math.min(S - 1, b.length)), N < 0 && (N += b.length), N = Math.max(0, Math.min(N, b.length)), y = b.slice(S, N).join(` `), f.hasAttribute("data-start") || f.setAttribute("data-start", String(S + 1)) } d.textContent = y, H.highlightElement(d) }, function (y) { f.setAttribute(o, a), d.textContent = y }) } }), H.plugins.fileHighlight = { highlight: function (f) { for (var d = (f || document).querySelectorAll(l), m = 0, h; h = d[m++];)H.highlightElement(h) } }; var p = !1; H.fileHighlight = function () { p || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), p = !0), H.plugins.fileHighlight.highlight.apply(this, arguments) } })() }); var Yl = {}; At(Yl, { $addUpdateTag: () => Rf, $applyNodeReplacement: () => oi, $caretFromPoint: () => Hn, $caretRangeFromSelection: () => dl, $cloneWithProperties: () => Kf, $comparePointCaretNext: () => Ul, $copyNode: () => Bl, $createLineBreakNode: () => Gr, $createNodeSelection: () => Ol, $createParagraphNode: () => mn, $createPoint: () => Ht, $createRangeSelection: () => uf, $createRangeSelectionFromDom: () => aC, $createTabNode: () => us, $createTextNode: () => Ke, $extendCaretToRange: () => Hl, $getAdjacentChildCaret: () => eo, $getAdjacentNode: () => Mf, $getAdjacentSiblingOrParentSiblingCaret: () => GC, $getCaretInDirection: () => zn, $getCaretRange: () => Kn, $getCaretRangeInDirection: () => Gl, $getCharacterOffsets: () => ol, $getChildCaret: () => yn, $getChildCaretAtIndex: () => Jf, $getChildCaretOrSelf: () => Uf, $getCollapsedCaretRange: () => Wf, $getCommonAncestor: () => Uo, $getCommonAncestorResultBranchOrder: () => Wl, $getEditor: () => LC, $getNearestNodeFromDOMNode: () => ps, $getNearestRootOrShadowRoot: () => Lf, $getNodeByKey: () => Le, $getNodeByKeyOrThrow: () => $f, $getPreviousSelection: () => Cr, $getRoot: () => _t, $getSelection: () => ue, $getSiblingCaret: () => We, $getState: () => Wi, $getStateChange: () => I_, $getTextContent: () => uC, $getTextNodeOffset: () => _r, $getTextPointCaret: () => Bn, $getTextPointCaretSlice: () => cl, $getWritableNodeState: () => yl, $hasAncestor: () => is, $hasUpdateTag: () => MC, $insertNodes: () => cC, $isBlockElementNode: () => sC, $isChildCaret: () => Kt, $isDecoratorNode: () => Ce, $isElementNode: () => M, $isExtendableTextPointCaret: () => jf, $isInlineElementOrDecoratorNode: () => kC, $isLeafNode: () => vC, $isLineBreakNode: () => cr, $isNodeCaret: () => KC, $isNodeSelection: () => ds, $isParagraphNode: () => yC, $isRangeSelection: () => J, $isRootNode: () => pt, $isRootOrShadowRoot: () => zt, $isSiblingCaret: () => mr, $isTabNode: () => sf, $isTextNode: () => B, $isTextPointCaret: () => _n, $isTextPointCaretSlice: () => WC, $isTokenOrSegmented: () => lr, $nodesOfType: () => wC, $normalizeCaret: () => Pt, $normalizeSelection__EXPERIMENTAL: () => Gi, $onUpdate: () => Ff, $parseSerializedNode: () => gC, $removeTextFromCaretRange: () => Yf, $rewindSiblingCaret: () => oo, $selectAll: () => DC, $setCompositionKey: () => He, $setPointFromCaret: () => to, $setSelection: () => Ct, $setSelectionFromCaretRange: () => Gf, $setState: () => P_, $splitAtPointCaretNext: () => JC, $splitNode: () => RC, $updateRangeSelectionFromCaretRange: () => Wo, ArtificialNode__DO_NOT_USE: () => ns, BLUR_COMMAND: () => jd, CAN_REDO_COMMAND: () => V_, CAN_UNDO_COMMAND: () => X_, CLEAR_EDITOR_COMMAND: () => j_, CLEAR_HISTORY_COMMAND: () => J_, CLICK_COMMAND: () => Dd, COLLABORATION_TAG: () => _f, COMMAND_PRIORITY_CRITICAL: () => EC, COMMAND_PRIORITY_EDITOR: () => NC, COMMAND_PRIORITY_HIGH: () => TC, COMMAND_PRIORITY_LOW: () => xC, COMMAND_PRIORITY_NORMAL: () => SC, CONTROLLED_TEXT_INSERTION_COMMAND: () => Pr, COPY_COMMAND: () => El, CUT_COMMAND: () => bl, DELETE_CHARACTER_COMMAND: () => qo, DELETE_LINE_COMMAND: () => Qo, DELETE_WORD_COMMAND: () => Zo, DRAGEND_COMMAND: () => Gd, DRAGOVER_COMMAND: () => Wd, DRAGSTART_COMMAND: () => Ud, DROP_COMMAND: () => zd, DecoratorNode: () => es, ElementNode: () => hr, FOCUS_COMMAND: () => Yd, FORMAT_ELEMENT_COMMAND: () => Y_, FORMAT_TEXT_COMMAND: () => Fn, HISTORIC_TAG: () => hC, HISTORY_MERGE_TAG: () => Ki, HISTORY_PUSH_TAG: () => pC, INDENT_CONTENT_COMMAND: () => W_, INSERT_LINE_BREAK_COMMAND: () => Bo, INSERT_PARAGRAPH_COMMAND: () => Va, INSERT_TAB_COMMAND: () => U_, INTERNAL_$isBlock: () => pn, IS_ALL_FORMATTING: () => pd, IS_BOLD: () => C_, IS_CODE: () => N_, IS_HIGHLIGHT: () => as, IS_ITALIC: () => y_, IS_STRIKETHROUGH: () => Yo, IS_SUBSCRIPT: () => x_, IS_SUPERSCRIPT: () => S_, IS_UNDERLINE: () => jo, KEY_ARROW_DOWN_COMMAND: () => $d, KEY_ARROW_LEFT_COMMAND: () => Rd, KEY_ARROW_RIGHT_COMMAND: () => Md, KEY_ARROW_UP_COMMAND: () => Ld, KEY_BACKSPACE_COMMAND: () => Pd, KEY_DELETE_COMMAND: () => Kd, KEY_DOWN_COMMAND: () => wd, KEY_ENTER_COMMAND: () => Vi, KEY_ESCAPE_COMMAND: () => Bd, KEY_MODIFIER_COMMAND: () => Jd, KEY_SPACE_COMMAND: () => Id, KEY_TAB_COMMAND: () => Hd, LineBreakNode: () => Wr, MOVE_TO_END: () => kd, MOVE_TO_START: () => Fd, NODE_STATE_KEY: () => Cd, OUTDENT_CONTENT_COMMAND: () => G_, PASTE_COMMAND: () => xl, PASTE_TAG: () => mC, ParagraphNode: () => Jr, REDO_COMMAND: () => Tl, REMOVE_TEXT_COMMAND: () => Xa, RootNode: () => jr, SELECTION_CHANGE_COMMAND: () => Nl, SELECTION_INSERT_CLIPBOARD_NODES_COMMAND: () => z_, SELECT_ALL_COMMAND: () => qa, SKIP_COLLAB_TAG: () => _C, SKIP_DOM_SELECTION_TAG: () => yf, SKIP_SCROLL_INTO_VIEW_TAG: () => Cf, TEXT_TYPE_TO_FORMAT: () => et, TabNode: () => Yr, TextNode: () => fr, UNDO_COMMAND: () => Sl, createCommand: () => ee, createEditor: () => bC, createState: () => $_, flipDirection: () => Un, getDOMOwnerDocument: () => Il, getDOMSelection: () => Zt, getDOMSelectionFromTarget: () => If, getDOMTextNode: () => pr, getEditorPropertyFromDOMNode: () => ni, getNearestEditorFromDOMNode: () => kl, isBlockDomNode: () => al, isCurrentlyReadOnlyMode: () => no, isDOMDocumentNode: () => Sf, isDOMNode: () => ro, isDOMTextNode: () => Qt, isDOMUnmanaged: () => zf, isDocumentFragment: () => Pf, isExactShortcutMatch: () => ge, isHTMLAnchorElement: () => FC, isHTMLElement: () => it, isInlineDomNode: () => Bf, isLexicalEditor: () => gs, isModifierMatch: () => wf, isSelectionCapturedInDecoratorInput: () => Ml, isSelectionWithinEditor: () => ti, makeStepwiseIterator: () => zl, removeFromParent: () => In, resetRandomKey: () => AC, setDOMUnmanaged: () => IC, setNodeIndentFromDOM: () => Hf }); function R(n, ...e) { let t = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams; r.append("code", n); for (let o of e) r.append("v", o); throw t.search = r.toString(), Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`) } var Ut = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, c_ = Ut && "documentMode" in document ? document.documentMode : null, qt = Ut && /Mac|iPod|iPhone|iPad/.test(navigator.platform), $n = Ut && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), Hi = !(!Ut || !("InputEvent" in window) || c_) && "getTargetRanges" in new window.InputEvent("input"), Go = Ut && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Hr = Ut && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, u_ = Ut && /Android/.test(navigator.userAgent), gd = Ut && /^(?=.*Chrome).*/i.test(navigator.userAgent), Ou = Ut && u_ && gd, zi = Ut && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !gd; function Ui(...n) { let e = []; for (let t of n) if (t && typeof t == "string") for (let [r] of t.matchAll(/\S+/g)) e.push(r); return e } var d_ = 1, f_ = 3, g_ = 9, h_ = 11, ur = 0, hd = 1, zr = 2, p_ = 0, m_ = 1, __ = 2, C_ = 1, y_ = 2, Yo = 4, jo = 8, N_ = 16, x_ = 32, S_ = 64, as = 128, pd = 1792 | (112 | (3 | Yo | jo) | as), fl = 1, gl = 2, hl = 3, pl = 4, ml = 5, _l = 6, ls = Go || Hr || zi ? "\xA0" : "\u200B", Cn = ` `, T_ = $n ? "\xA0" : ls, md = "\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC", _d = "A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF", E_ = new RegExp("^[^" + _d + "]*[" + md + "]"), b_ = new RegExp("^[^" + md + "]*[" + _d + "]"), et = { bold: 1, capitalize: 1024, code: 16, highlight: as, italic: 2, lowercase: 256, strikethrough: Yo, subscript: 32, superscript: 64, underline: jo, uppercase: 512 }, A_ = { directionless: 1, unmergeable: 2 }, vu = { center: gl, end: _l, justify: pl, left: fl, right: hl, start: ml }, O_ = { [gl]: "center", [_l]: "end", [pl]: "justify", [fl]: "left", [hl]: "right", [ml]: "start" }, v_ = { normal: 0, segmented: 2, token: 1 }, D_ = { [p_]: "normal", [__]: "segmented", [m_]: "token" }, Cd = "$"; function yd(n, e, t, r, o, i) { let s = n.getFirstChild(); for (; s !== null;) { let a = s.__key; s.__parent === e && (M(s) && yd(s, a, t, r, o, i), t.has(a) || i.delete(a), o.push(a)), s = s.getNextSibling() } } var w_ = 100, Ka = !1, Cl = 0; function M_(n) { Cl = n.timeStamp } function Oa(n, e, t) { let r = n.nodeName === "BR", o = e.__lexicalLineBreak; return o && (n === o || r && n.previousSibling === o) || r && hs(n, t) !== void 0 } function k_(n, e, t) { let r = Zt(Rt(t)), o = null, i = null; r !== null && r.anchorNode === n && (o = r.anchorOffset, i = r.focusOffset); let s = n.nodeValue; s !== null && Ll(e, s, o, i, !1) } function R_(n, e, t) { if (J(n)) { let r = n.anchor.getNode(); if (r.is(t) && n.format !== r.getFormat()) return !1 } return Qt(e) && t.isAttached() } function F_(n, e, t, r) { for (let o = n; o && !zf(o); o = ri(o)) { let i = hs(o, e); if (i !== void 0) { let s = Le(i, t); if (s) return Ce(s) || !it(o) ? void 0 : [o, s] } else if (o === r) return [r, Af(t)] } } function Nd(n, e, t) { Ka = !0; let r = performance.now() - Cl > w_; try { Ot(n, () => { let o = ue() || function (g) { return g.getEditorState().read(() => { let f = ue(); return f !== null ? f.clone() : null }) }(n), i = new Map, s = n.getRootElement(), a = n._editorState, l = n._blockCursorElement, c = !1, u = ""; for (let g = 0; g < e.length; g++) { let f = e[g], d = f.type, m = f.target, h = F_(m, n, a, s); if (!h) continue; let [_, C] = h; if (d === "characterData") r && B(C) && Qt(m) && R_(o, m, C) && k_(m, C, n); else if (d === "childList") { c = !0; let y = f.addedNodes; for (let S = 0; S < y.length; S++) { let N = y[S], A = Ef(N), O = N.parentNode; if (O != null && N !== l && A === null && !Oa(N, O, n)) { if ($n) { let F = (it(N) ? N.innerText : null) || N.nodeValue; F && (u += F) } O.removeChild(N) } } let x = f.removedNodes, b = x.length; if (b > 0) { let S = 0; for (let N = 0; N < b; N++) { let A = x[N]; (Oa(A, m, n) || l === A) && (m.appendChild(A), S++) } b !== S && i.set(_, C) } } } if (i.size > 0) for (let [g, f] of i) f.reconcileObservedMutation(g, n); let p = t.takeRecords(); if (p.length > 0) { for (let g = 0; g < p.length; g++) { let f = p[g], d = f.addedNodes, m = f.target; for (let h = 0; h < d.length; h++) { let _ = d[h], C = _.parentNode; C == null || _.nodeName !== "BR" || Oa(_, m, n) || C.removeChild(_) } } t.takeRecords() } o !== null && (c && Ct(o), $n && kf(n) && o.insertRawText(u)) }) } finally { Ka = !1 } } function xd(n) { let e = n._observer; e !== null && Nd(n, e.takeRecords(), e) } function Sd(n) { (function (e) { Cl === 0 && Rt(e).addEventListener("textInput", M_, !0) })(n), n._observer = new MutationObserver((e, t) => { Nd(n, e, t) }) } function L_(n) { return n } var Ha = class { constructor(e, t) { this.key = e, this.parse = t.parse.bind(t), this.unparse = (t.unparse || L_).bind(t), this.isEqual = (t.isEqual || Object.is).bind(t), this.defaultValue = this.parse(void 0) } }; function $_(n, e) { return new Ha(n, e) } function I_(n, e, t) { let r = Wi(n, t, "direct"), o = Wi(e, t, "direct"); return t.isEqual(r, o) ? null : [r, o] } function Wi(n, e, t = "latest") { let r = (t === "latest" ? n.getLatest() : n).__state; return r ? r.getValue(e) : e.defaultValue } function P_(n, e, t) { let r; if (Xe(), typeof t == "function") { let i = n.getLatest(), s = Wi(i, e); if (r = t(s), e.isEqual(s, r)) return i } else r = t; let o = n.getWritable(); return yl(o).updateFromKnown(e, r), o } var za = class n { constructor(e, t = new Map, r = void 0, o = new Map, i = void 0) { this.node = e, this.sharedConfigMap = t, this.unknownState = r, this.knownState = o; let s = i !== void 0 ? i : function (a, l, c) { let u = c.size; if (l) for (let p in l) { let g = a.get(p); g && c.has(g) || u++ } return u }(t, r, o); this.size = s } getValue(e) { let t = this.knownState.get(e); if (t !== void 0) return t; this.sharedConfigMap.set(e.key, e); let r = e.defaultValue; if (this.unknownState && e.key in this.unknownState) { let o = this.unknownState[e.key]; o !== void 0 && (r = e.parse(o)), this.updateFromKnown(e, r) } return r } getInternalState() { return [this.unknownState, this.knownState] } toJSON() { let e = { ...this.unknownState }; for (let [t, r] of this.knownState) t.isEqual(r, t.defaultValue) ? delete e[t.key] : e[t.key] = t.unparse(r); return Mi(e) ? { [Cd]: e } : {} } getWritable(e) { if (this.node === e) return this; let t = new Map(this.knownState), r = Mi(o = this.unknownState) && { ...o }; var o; if (r) for (let i of t.keys()) delete r[i.key]; return new n(e, this.sharedConfigMap, Mi(r), t, this.size) } updateFromKnown(e, t) { let r = e.key; this.sharedConfigMap.set(r, e); let { knownState: o, unknownState: i } = this; o.has(e) || i && r in i || this.size++, o.set(e, t) } updateFromUnknown(e, t) { let r = this.sharedConfigMap.get(e); r ? this.updateFromKnown(r, r.parse(t)) : (this.unknownState = this.unknownState || {}, e in this.unknownState || this.size++, this.unknownState[e] = t) } updateFromJSON(e) { let { knownState: t } = this; for (let r of t.keys()) t.set(r, r.defaultValue); if (this.size = t.size, this.unknownState = {}, e) for (let [r, o] of Object.entries(e)) this.updateFromUnknown(r, o); this.unknownState = Mi(this.unknownState) } }; function Mi(n) { if (n) for (let e in n) return n } function yl(n) { let e = n.getWritable(), t = e.__state ? e.__state.getWritable(e) : new za(e); return e.__state = t, t } function Du(n, e) { let t = n.__mode, r = n.__format, o = n.__style, i = e.__mode, s = e.__format, a = e.__style, l = n.__state, c = e.__state; return (t === null || t === i) && (r === null || r === s) && (o === null || o === a) && (n.__state === null || l === c || function (u, p) { if (u === p) return !0; if (u && p && u.size !== p.size) return !1; let g = new Set, f = (m, h) => { for (let [_, C] of m.knownState) { if (g.has(_.key)) continue; g.add(_.key); let y = h ? h.getValue(_) : _.defaultValue; if (y !== C && !_.isEqual(y, C)) return !0 } return !1 }, d = (m, h) => { let { unknownState: _ } = m, C = h ? h.unknownState : void 0; if (_) { for (let [y, x] of Object.entries(_)) if (!g.has(y) && (g.add(y), x !== (C ? C[y] : void 0))) return !0 } return !1 }; return !(u && f(u, p) || p && f(p, u) || u && d(u, p) || p && d(p, u)) }(l, c)) } function wu(n, e) { let t = n.mergeWithSibling(e), r = Se()._normalizedNodes; return r.add(n.__key), r.add(e.__key), t } function Mu(n) { let e, t, r = n; if (r.__text !== "" || !r.isSimpleText() || r.isUnmergeable()) { for (; (e = r.getPreviousSibling()) !== null && B(e) && e.isSimpleText() && !e.isUnmergeable();) { if (e.__text !== "") { if (Du(e, r)) { r = wu(e, r); break } break } e.remove() } for (; (t = r.getNextSibling()) !== null && B(t) && t.isSimpleText() && !t.isUnmergeable();) { if (t.__text !== "") { if (Du(r, t)) { r = wu(r, t); break } break } t.remove() } } else r.remove() } function Gi(n) { return ku(n.anchor), ku(n.focus), n } function ku(n) { for (; n.type === "element";) { let e = n.getNode(), t = n.offset, r, o; if (t === e.getChildrenSize() ? (r = e.getChildAtIndex(t - 1), o = !0) : (r = e.getChildAtIndex(t), o = !1), B(r)) { n.set(r.__key, o ? r.getTextContentSize() : 0, "text", !0); break } if (!M(r)) break; n.set(r.__key, o ? r.getChildrenSize() : 0, "element", !0) } } var Pn, ot, Jo, cs, Ua, Wa, dr, Bt, Ga, Vo, Fe = "", rt = "", Vt = null, Xt = "", gn = "", Td = !1, Xo = !1, Ii = null; function Yi(n, e) { let t = dr.get(n); if (e !== null) { let r = Ja(n); r.parentNode === e && e.removeChild(r) } if (Bt.has(n) || ot._keyToDOMMap.delete(n), M(t)) { let r = Ji(t, dr); Ya(r, 0, r.length - 1, null) } t !== void 0 && $l(Vo, Jo, cs, t, "destroyed") } function Ya(n, e, t, r) { let o = e; for (; o <= t; ++o) { let i = n[o]; i !== void 0 && Yi(i, r) } } function sr(n, e) { n.setProperty("text-align", e) } var B_ = "40px"; function Ed(n, e) { let t = Pn.theme.indent; if (typeof t == "string") { let o = n.classList.contains(t); e > 0 && !o ? n.classList.add(t) : e < 1 && o && n.classList.remove(t) } let r = getComputedStyle(n).getPropertyValue("--lexical-indent-base-value") || B_; n.style.setProperty("padding-inline-start", e === 0 ? "" : `calc(${e} * ${r})`) } function bd(n, e) { let t = n.style; e === 0 ? sr(t, "") : e === fl ? sr(t, "left") : e === gl ? sr(t, "center") : e === hl ? sr(t, "right") : e === pl ? sr(t, "justify") : e === ml ? sr(t, "start") : e === _l && sr(t, "end") } function ji(n, e) { let t = Bt.get(n); t === void 0 && R(60); let r = t.createDOM(Pn, ot); if (function (o, i, s) { let a = s._keyToDOMMap; (function (l, c, u) { let p = `__lexicalKey_${c._key}`; l[p] = u })(i, s, o), a.set(o, i) }(n, r, ot), B(t) ? r.setAttribute("data-lexical-text", "true") : Ce(t) && r.setAttribute("data-lexical-decorator", "true"), M(t)) { let o = t.__indent, i = t.__size; if (o !== 0 && Ed(r, o), i !== 0) { let a = i - 1; (function (l, c, u, p) { let g = rt; rt = "", ja(l, u, 0, c, u.getDOMSlot(p)), Od(u, p), rt = g })(Ji(t, Bt), a, t, r) } let s = t.__format; s !== 0 && bd(r, s), t.isInline() || Ad(null, t, r), ms(t) && (Fe += Cn, gn += Cn) } else { let o = t.getTextContent(); if (Ce(t)) { let i = t.decorate(ot, Pn); i !== null && vd(n, i), r.contentEditable = "false" } else B(t) && (t.isDirectionless() || (rt += o)); Fe += o, gn += o } return e !== null && e.insertChild(r), $l(Vo, Jo, cs, t, "created"), r } function ja(n, e, t, r, o) { let i = Fe; Fe = ""; let s = t; for (; s <= r; ++s) { ji(n[s], o); let a = Bt.get(n[s]); a !== null && B(a) && (Vt === null && (Vt = a.getFormat()), Xt === "" && (Xt = a.getStyle())) } ms(e) && (Fe += Cn), o.element.__lexicalTextContent = Fe, Fe = i + Fe } function Ru(n, e) { if (n) { let t = n.__last; if (t) { let r = e.get(t); if (r) return cr(r) ? "line-break" : Ce(r) && r.isInline() ? "decorator" : null } return "empty" } return null } function Ad(n, e, t) { let r = Ru(n, dr), o = Ru(e, Bt); r !== o && e.getDOMSlot(t).setManagedLineBreak(o) } function Od(n, e) { let t = e.__lexicalDirTextContent || "", r = e.__lexicalDir || ""; if (t !== rt || r !== Ii) { let o = rt === "", i = o ? Ii : function (s) { return E_.test(s) ? "rtl" : b_.test(s) ? "ltr" : null }(rt); if (i !== r) { let s = e.classList, a = Pn.theme, l = r !== null ? a[r] : void 0, c = i !== null ? a[i] : void 0; if (l !== void 0) { if (typeof l == "string") { let u = Ui(l); l = a[r] = u } s.remove(...l) } if (i === null || o && i === "ltr") e.removeAttribute("dir"); else { if (c !== void 0) { if (typeof c == "string") { let u = Ui(c); c = a[i] = u } c !== void 0 && s.add(...c) } e.dir = i } Xo || (n.getWritable().__dir = i) } Ii = i, e.__lexicalDirTextContent = rt, e.__lexicalDir = i } } function K_(n, e, t) { let r = rt; var o; rt = "", Vt = null, Xt = "", function (i, s, a) { let l = Fe, c = i.__size, u = s.__size; Fe = ""; let p = a.element; if (c === 1 && u === 1) { let g = i.__first, f = s.__first; if (g === f) Po(g, p); else { let m = Ja(g), h = ji(f, null); try { p.replaceChild(h, m) } catch (_) { if (typeof _ == "object" && _ != null) { let C = `${_.toString()} Parent: ${p.tagName}, new child: {tag: ${h.tagName} key: ${f}}, old child: {tag: ${m.tagName}, key: ${g}}.`; throw new Error(C) } throw _ } Yi(g, null) } let d = Bt.get(f); B(d) && (Vt === null && (Vt = d.getFormat()), Xt === "" && (Xt = d.getStyle())) } else { let g = Ji(i, dr), f = Ji(s, Bt); if (g.length !== c && R(227), f.length !== u && R(228), c === 0) u !== 0 && ja(f, s, 0, u - 1, a); else if (u === 0) { if (c !== 0) { let d = a.after == null && a.before == null && a.element.__lexicalLineBreak == null; Ya(g, 0, c - 1, d ? null : p), d && (p.textContent = "") } } else (function (d, m, h, _, C, y) { let x = _ - 1, b = C - 1, S, N, A = y.getFirstChild(), O = 0, F = 0; for (; O <= x && F <= b;) { let U = m[O], K = h[F]; if (U === K) A = va(Po(K, y.element)), O++, F++; else { S === void 0 && (S = new Set(m)), N === void 0 && (N = new Set(h)); let q = N.has(U), de = S.has(K); if (q) if (de) { let ae = Xr(ot, K); ae === A ? A = va(Po(K, y.element)) : (y.withBefore(A).insertChild(ae), Po(K, y.element)), O++, F++ } else ji(K, y.withBefore(A)), F++; else A = va(Ja(U)), Yi(U, y.element), O++ } let W = Bt.get(K); W !== null && B(W) && (Vt === null && (Vt = W.getFormat()), Xt === "" && (Xt = W.getStyle())) } let L = O > x, G = F > b; if (L && !G) { let U = h[b + 1], K = U === void 0 ? null : ot.getElementByKey(U); ja(h, d, F, b, y.withBefore(K)) } else G && !L && Ya(m, O, x, y.element) })(s, g, f, c, u, a) } ms(s) && (Fe += Cn), p.__lexicalTextContent = Fe, Fe = l + Fe }(n, e, e.getDOMSlot(t)), Od(e, t), o = e, Vt == null || Vt === o.__textFormat || Xo || o.setTextFormat(Vt), function (i) { Xt === "" || Xt === i.__textStyle || Xo || i.setTextStyle(Xt) }(e), rt = r } function Ji(n, e) { let t = [], r = n.__first; for (; r !== null;) { let o = e.get(r); o === void 0 && R(101), t.push(r), r = o.__next } return t } function Po(n, e) { let t = dr.get(n), r = Bt.get(n); t !== void 0 && r !== void 0 || R(61); let o = Td || Wa.has(n) || Ua.has(n), i = Xr(ot, n); if (t === r && !o) { if (M(t)) { let s = i.__lexicalTextContent; s !== void 0 && (Fe += s, gn += s); let a = i.__lexicalDirTextContent; a !== void 0 && (rt += a) } else { let s = t.getTextContent(); B(t) && !t.isDirectionless() && (rt += s), gn += s, Fe += s } return i } if (t !== r && o && $l(Vo, Jo, cs, r, "updated"), r.updateDOM(t, i, Pn)) { let s = ji(n, null); return e === null && R(62), e.replaceChild(s, i), Yi(n, null), s } if (M(t) && M(r)) { let s = r.__indent; s !== t.__indent && Ed(i, s); let a = r.__format; a !== t.__format && bd(i, a), o && (K_(t, r, i), pt(r) || r.isInline() || Ad(t, r, i)), ms(r) && (Fe += Cn, gn += Cn) } else { let s = r.getTextContent(); if (Ce(r)) { let a = r.decorate(ot, Pn); a !== null && vd(n, a) } else B(r) && !r.isDirectionless() && (rt += s); Fe += s, gn += s } if (!Xo && pt(r) && r.__cachedText !== gn) { let s = r.getWritable(); s.__cachedText = gn, r = s } return i } function vd(n, e) { let t = ot._pendingDecorators, r = ot._decorators; if (t === null) { if (r[n] === e) return; t = bf(ot) } t[n] = e } function va(n) { let e = n.nextSibling; return e !== null && e === ot._blockCursorElement && (e = e.nextSibling), e } function H_(n, e, t, r, o, i) { Fe = "", gn = "", rt = "", Td = r === zr, Ii = null, ot = t, Pn = t._config, Jo = t._nodes, cs = ot._listeners.mutation, Ua = o, Wa = i, dr = n._nodeMap, Bt = e._nodeMap, Xo = e._readOnly, Ga = new Map(t._keyToDOMMap); let s = new Map; return Vo = s, Po("root", null), ot = void 0, Jo = void 0, Ua = void 0, Wa = void 0, dr = void 0, Bt = void 0, Pn = void 0, Ga = void 0, Vo = void 0, s } function Ja(n) { let e = Ga.get(n); return e === void 0 && R(75, n), e } function ee(n) { return { type: n } } var Nl = ee("SELECTION_CHANGE_COMMAND"), z_ = ee("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"), Dd = ee("CLICK_COMMAND"), qo = ee("DELETE_CHARACTER_COMMAND"), Bo = ee("INSERT_LINE_BREAK_COMMAND"), Va = ee("INSERT_PARAGRAPH_COMMAND"), Pr = ee("CONTROLLED_TEXT_INSERTION_COMMAND"), xl = ee("PASTE_COMMAND"), Xa = ee("REMOVE_TEXT_COMMAND"), Zo = ee("DELETE_WORD_COMMAND"), Qo = ee("DELETE_LINE_COMMAND"), Fn = ee("FORMAT_TEXT_COMMAND"), Sl = ee("UNDO_COMMAND"), Tl = ee("REDO_COMMAND"), wd = ee("KEYDOWN_COMMAND"), Md = ee("KEY_ARROW_RIGHT_COMMAND"), kd = ee("MOVE_TO_END"), Rd = ee("KEY_ARROW_LEFT_COMMAND"), Fd = ee("MOVE_TO_START"), Ld = ee("KEY_ARROW_UP_COMMAND"), $d = ee("KEY_ARROW_DOWN_COMMAND"), Vi = ee("KEY_ENTER_COMMAND"), Id = ee("KEY_SPACE_COMMAND"), Pd = ee("KEY_BACKSPACE_COMMAND"), Bd = ee("KEY_ESCAPE_COMMAND"), Kd = ee("KEY_DELETE_COMMAND"), Hd = ee("KEY_TAB_COMMAND"), U_ = ee("INSERT_TAB_COMMAND"), W_ = ee("INDENT_CONTENT_COMMAND"), G_ = ee("OUTDENT_CONTENT_COMMAND"), zd = ee("DROP_COMMAND"), Y_ = ee("FORMAT_ELEMENT_COMMAND"), Ud = ee("DRAGSTART_COMMAND"), Wd = ee("DRAGOVER_COMMAND"), Gd = ee("DRAGEND_COMMAND"), El = ee("COPY_COMMAND"), bl = ee("CUT_COMMAND"), qa = ee("SELECT_ALL_COMMAND"), j_ = ee("CLEAR_EDITOR_COMMAND"), J_ = ee("CLEAR_HISTORY_COMMAND"), V_ = ee("CAN_REDO_COMMAND"), X_ = ee("CAN_UNDO_COMMAND"), Yd = ee("FOCUS_COMMAND"), jd = ee("BLUR_COMMAND"), Jd = ee("KEY_MODIFIER_COMMAND"), un = Object.freeze({}), Za = 30, Qa = [["keydown", function (n, e) { if (Ko = n.timeStamp, Vd = n.key, !e.isComposing() && !I(e, wd, n) && n.key != null) { if (Da && ad(n)) return Ot(e, () => { ki(e, wa) }), Da = !1, void (wa = ""); if (function (t) { return ge(t, "ArrowRight", { shiftKey: "any" }) }(n)) I(e, Md, n); else if (function (t) { return ge(t, "ArrowRight", fn) }(n)) I(e, kd, n); else if (function (t) { return ge(t, "ArrowLeft", { shiftKey: "any" }) }(n)) I(e, Rd, n); else if (function (t) { return ge(t, "ArrowLeft", fn) }(n)) I(e, Fd, n); else if (function (t) { return ge(t, "ArrowUp", { altKey: "any", shiftKey: "any" }) }(n)) I(e, Ld, n); else if (function (t) { return ge(t, "ArrowDown", { altKey: "any", shiftKey: "any" }) }(n)) I(e, $d, n); else if (function (t) { return ge(t, "Enter", { altKey: "any", ctrlKey: "any", metaKey: "any", shiftKey: !0 }) }(n)) Ho = !0, I(e, Vi, n); else if (function (t) { return t.key === " " }(n)) I(e, Id, n); else if (function (t) { return qt && ge(t, "o", { ctrlKey: !0 }) }(n)) n.preventDefault(), Ho = !0, I(e, Bo, !0); else if (function (t) { return ge(t, "Enter", { altKey: "any", ctrlKey: "any", metaKey: "any" }) }(n)) Ho = !1, I(e, Vi, n); else if (function (t) { return ge(t, "Backspace", { shiftKey: "any" }) || qt && ge(t, "h", { ctrlKey: !0 }) }(n)) ad(n) ? I(e, Pd, n) : (n.preventDefault(), I(e, qo, !0)); else if (function (t) { return t.key === "Escape" }(n)) I(e, Bd, n); else if (function (t) { return ge(t, "Delete", {}) || qt && ge(t, "d", { ctrlKey: !0 }) }(n)) (function (t) { return t.key === "Delete" })(n) ? I(e, Kd, n) : (n.preventDefault(), I(e, qo, !1)); else if (function (t) { return ge(t, "Backspace", sd) }(n)) n.preventDefault(), I(e, Zo, !0); else if (function (t) { return ge(t, "Delete", sd) }(n)) n.preventDefault(), I(e, Zo, !1); else if (function (t) { return qt && ge(t, "Backspace", { metaKey: !0 }) }(n)) n.preventDefault(), I(e, Qo, !0); else if (function (t) { return qt && (ge(t, "Delete", { metaKey: !0 }) || ge(t, "k", { ctrlKey: !0 })) }(n)) n.preventDefault(), I(e, Qo, !1); else if (function (t) { return ge(t, "b", fn) }(n)) n.preventDefault(), I(e, Fn, "bold"); else if (function (t) { return ge(t, "u", fn) }(n)) n.preventDefault(), I(e, Fn, "underline"); else if (function (t) { return ge(t, "i", fn) }(n)) n.preventDefault(), I(e, Fn, "italic"); else if (function (t) { return ge(t, "Tab", { shiftKey: "any" }) }(n)) I(e, Hd, n); else if (function (t) { return ge(t, "z", fn) }(n)) n.preventDefault(), I(e, Sl, void 0); else if (function (t) { return qt ? ge(t, "z", { metaKey: !0, shiftKey: !0 }) : ge(t, "y", { ctrlKey: !0 }) || ge(t, "z", { ctrlKey: !0, shiftKey: !0 }) }(n)) n.preventDefault(), I(e, Tl, void 0); else { let t = e._editorState._selection; t === null || J(t) ? !$n && ld(n) && (n.preventDefault(), I(e, qa, n)) : function (r) { return ge(r, "c", fn) }(n) ? (n.preventDefault(), I(e, El, n)) : function (r) { return ge(r, "x", fn) }(n) ? (n.preventDefault(), I(e, bl, n)) : ld(n) && (n.preventDefault(), I(e, qa, n)) } (function (t) { return t.ctrlKey || t.shiftKey || t.altKey || t.metaKey })(n) && I(e, Jd, n) } }], ["pointerdown", function (n, e) { let t = n.target, r = n.pointerType; ro(t) && r !== "touch" && n.button === 0 && Ot(e, () => { rd(t) || (tl = !0) }) }], ["compositionstart", function (n, e) { Ot(e, () => { let t = ue(); if (J(t) && !e.isComposing()) { let r = t.anchor, o = t.anchor.getNode(); He(r.key), (n.timeStamp < Ko + Za || r.type === "element" || !t.isCollapsed() || o.getFormat() !== t.format || B(o) && o.getStyle() !== t.style) && I(e, Pr, T_) } }) }], ["compositionend", function (n, e) { $n ? Io = !0 : Hr || !Go && !zi ? Ot(e, () => { ki(e, n.data) }) : (Da = !0, wa = n.data) }], ["input", function (n, e) { n.stopPropagation(), Ot(e, () => { if (it(n.target) && rd(n.target)) return; let t = ue(), r = n.data, o = ef(n); if (r != null && J(t) && Zd(t, o, r, n.timeStamp, !1)) { Io && (ki(e, r), Io = !1); let i = t.anchor.getNode(), s = Zt(Rt(e)); if (s === null) return; let a = t.isBackward(), l = a ? t.anchor.offset : t.focus.offset, c = a ? t.focus.offset : t.anchor.offset; Hi && !t.isCollapsed() && B(i) && s.anchorNode !== null && i.getTextContent().slice(0, l) + r + i.getTextContent().slice(l + c) === Df(s.anchorNode) || I(e, Pr, r); let u = r.length; $n && u > 1 && n.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= u), Go || Hr || zi || !e.isComposing() || (Ko = 0, He(null)) } else Fl(!1, e, r !== null ? r : void 0), Io && (ki(e, r || void 0), Io = !1); (function () { Xe(); let i = Se(); xd(i) })() }, { event: n }), $r = null }], ["click", function (n, e) { Ot(e, () => { let t = ue(), r = Zt(Rt(e)), o = Cr(); if (r) { if (J(t)) { let i = t.anchor, s = i.getNode(); if (i.type === "element" && i.offset === 0 && t.isCollapsed() && !pt(s) && _t().getChildrenSize() === 1 && s.getTopLevelElementOrThrow().isEmpty() && o !== null && t.is(o)) r.removeAllRanges(), t.dirty = !0; else if (n.detail === 3 && !t.isCollapsed() && s !== t.focus.getNode()) { let a = function (l, c) { let u = l; for (; u !== _t() && u != null;) { if (c(u)) return u; u = u.getParent() } return null }(s, l => M(l) && !l.isInline()); M(a) && a.select(0) } } else if (n.pointerType === "touch") { let i = r.anchorNode; (it(i) || Qt(i)) && Ct(fs(o, r, e, n)) } } I(e, Dd, n) }) }], ["cut", un], ["copy", un], ["dragstart", un], ["dragover", un], ["dragend", un], ["paste", un], ["focus", un], ["blur", un], ["drop", un]]; Hi && Qa.push(["beforeinput", (n, e) => function (t, r) { let o = t.inputType, i = ef(t); o === "deleteCompositionText" || $n && kf(r) || o !== "insertCompositionText" && Ot(r, () => { let s = ue(); if (o === "deleteContentBackward") { if (s === null) { let f = Cr(); if (!J(f)) return; Ct(f.clone()) } if (J(s)) { let f = s.anchor.key === s.focus.key; if (a = t.timeStamp, Vd === "MediaLast" && a < Ko + Za && r.isComposing() && f) { if (He(null), Ko = 0, setTimeout(() => { Ot(r, () => { He(null) }) }, Za), J(s)) { let d = s.anchor.getNode(); d.markDirty(), B(d) || R(142), Qd(s, d) } } else { He(null), t.preventDefault(); let d = s.anchor.getNode(), m = d.getTextContent(), h = d.canInsertTextAfter(), _ = s.anchor.offset === 0 && s.focus.offset === m.length, C = Ou && f && !_ && h; if (C && s.isCollapsed() && (C = !Ce(Mf(s.anchor, !0))), !C) { I(r, qo, !0); let y = ue(); Ou && J(y) && y.isCollapsed() && (ar = y, setTimeout(() => ar = null)) } } return } } var a; if (!J(s)) return; let l = t.data; $r !== null && Fl(!1, r, $r), s.dirty && $r === null || !s.isCollapsed() || pt(s.anchor.getNode()) || i === null || s.applyDOMRange(i), $r = null; let c = s.anchor, u = s.focus, p = c.getNode(), g = u.getNode(); if (o !== "insertText" && o !== "insertTranspose") switch (t.preventDefault(), o) { case "insertFromYank": case "insertFromDrop": case "insertReplacementText": I(r, Pr, t); break; case "insertFromComposition": He(null), I(r, Pr, t); break; case "insertLineBreak": He(null), I(r, Bo, !1); break; case "insertParagraph": He(null), Ho && !Hr ? (Ho = !1, I(r, Bo, !1)) : I(r, Va, void 0); break; case "insertFromPaste": case "insertFromPasteAsQuotation": I(r, xl, t); break; case "deleteByComposition": (function (f, d) { return f !== d || M(f) || M(d) || !f.isToken() || !d.isToken() })(p, g) && I(r, Xa, t); break; case "deleteByDrag": case "deleteByCut": I(r, Xa, t); break; case "deleteContent": I(r, qo, !1); break; case "deleteWordBackward": I(r, Zo, !0); break; case "deleteWordForward": I(r, Zo, !1); break; case "deleteHardLineBackward": case "deleteSoftLineBackward": I(r, Qo, !0); break; case "deleteContentForward": case "deleteHardLineForward": case "deleteSoftLineForward": I(r, Qo, !1); break; case "formatStrikeThrough": I(r, Fn, "strikethrough"); break; case "formatBold": I(r, Fn, "bold"); break; case "formatItalic": I(r, Fn, "italic"); break; case "formatUnderline": I(r, Fn, "underline"); break; case "historyUndo": I(r, Sl, void 0); break; case "historyRedo": I(r, Tl, void 0) } else { if (l === ` `) t.preventDefault(), I(r, Bo, !1); else if (l === Cn) t.preventDefault(), I(r, Va, void 0); else if (l == null && t.dataTransfer) { let f = t.dataTransfer.getData("text/plain"); t.preventDefault(), s.insertRawText(f) } else l != null && Zd(s, i, l, t.timeStamp, !0) ? (t.preventDefault(), I(r, Pr, l)) : $r = l; Xd = t.timeStamp } }) }(n, e)]); var Ko = 0, Vd = null, Xd = 0, $r = null, Xi = new WeakMap, el = !1, tl = !1, Ho = !1, Io = !1, Da = !1, wa = "", ar = null, qd = [0, "", 0, "root", 0]; function Zd(n, e, t, r, o) { let i = n.anchor, s = n.focus, a = i.getNode(), l = Se(), c = Zt(Rt(l)), u = c !== null ? c.anchorNode : null, p = i.key, g = l.getElementByKey(p), f = t.length; return p !== s.key || !B(a) || (!o && (!Hi || Xd < r + 50) || a.isDirty() && f < 2 || Of(t)) && i.offset !== s.offset && !a.isComposing() || lr(a) || a.isDirty() && f > 1 || (o || !Hi) && g !== null && !a.isComposing() && u !== pr(g) || c !== null && e !== null && (!e.collapsed || e.startContainer !== c.anchorNode || e.startOffset !== c.anchorOffset) || a.getFormat() !== n.format || a.getStyle() !== n.style || function (d, m) { if (m.isSegmented()) return !0; if (!d.isCollapsed()) return !1; let h = d.anchor.offset, _ = m.getParentOrThrow(), C = m.isToken(); return h === 0 ? !m.canInsertTextBefore() || !_.canInsertTextBefore() && !m.isComposing() || C || function (y) { let x = y.getPreviousSibling(); return (B(x) || M(x) && x.isInline()) && !x.canInsertTextAfter() }(m) : h === m.getTextContentSize() && (!m.canInsertTextAfter() || !_.canInsertTextAfter() && !m.isComposing() || C) }(n, a) } function Fu(n, e) { return Qt(n) && n.nodeValue !== null && e !== 0 && e !== n.nodeValue.length } function Lu(n, e, t) { let { anchorNode: r, anchorOffset: o, focusNode: i, focusOffset: s } = n; el && (el = !1, Fu(r, o) && Fu(i, s) && !ar) || Ot(e, () => { if (!t) return void Ct(null); if (!ti(e, r, i)) return; let a = ue(); if (ar && J(a) && a.isCollapsed()) { let l = a.anchor, c = ar.anchor; (l.key === c.key && l.offset === c.offset + 1 || l.offset === 1 && c.getNode().is(l.getNode().getPreviousSibling())) && (a = ar.clone(), Ct(a)) } if (ar = null, J(a)) { let l = a.anchor, c = l.getNode(); if (a.isCollapsed()) { n.type === "Range" && n.anchorNode === n.focusNode && (a.dirty = !0); let u = Rt(e).event, p = u ? u.timeStamp : performance.now(), [g, f, d, m, h] = qd, _ = _t(), C = e.isComposing() === !1 && _.getTextContent() === ""; if (p < h + 200 && l.offset === d && l.key === m) Pi(a, g, f); else if (l.type === "text") B(c) || R(141), Qd(a, c); else if (l.type === "element" && !C) { M(c) || R(259); let y = l.getNode(); y.isEmpty() ? function (x, b) { let S = b.getTextFormat(), N = b.getTextStyle(); Pi(x, S, N) }(a, y) : Pi(a, 0, "") } } else { let u = l.key, p = a.focus.key, g = a.getNodes(), f = g.length, d = a.isBackward(), m = d ? s : o, h = d ? o : s, _ = d ? p : u, C = d ? u : p, y = pd, x = !1; for (let b = 0; b < f; b++) { let S = g[b], N = S.getTextContentSize(); if (B(S) && N !== 0 && !(b === 0 && S.__key === _ && m === N || b === f - 1 && S.__key === C && h === 0) && (x = !0, y &= S.getFormat(), y === 0)) break } a.format = x ? y : 0 } } I(e, Nl, void 0) }) } function Pi(n, e, t) { n.format === e && n.style === t || (n.format = e, n.style = t, n.dirty = !0) } function Qd(n, e) { Pi(n, e.getFormat(), e.getStyle()) } function ef(n) { if (!n.getTargetRanges) return null; let e = n.getTargetRanges(); return e.length === 0 ? null : e[0] } function ki(n, e) { let t = n._compositionKey; if (He(null), t !== null && e != null) { if (e === "") { let r = Le(t), o = pr(n.getElementByKey(t)); return void (o !== null && o.nodeValue !== null && B(r) && Ll(r, o.nodeValue, null, null, !0)) } if (e[e.length - 1] === ` `) { let r = ue(); if (J(r)) { let o = r.focus; return r.anchor.set(o.key, o.offset, o.type), void I(n, Vi, null) } } } Fl(!0, n, e) } function tf(n) { let e = n.__lexicalEventHandles; return e === void 0 && (e = [], n.__lexicalEventHandles = e), e } var Br = new Map; function nf(n) { let e = If(n.target); if (e === null) return; let t = kl(e.anchorNode); if (t === null) return; tl && (tl = !1, Ot(t, () => { let l = Cr(), c = e.anchorNode; (it(c) || Qt(c)) && Ct(fs(l, e, t, n)) })); let r = Rl(t), o = r[r.length - 1], i = o._key, s = Br.get(i), a = s || o; a !== t && Lu(e, a, !1), Lu(e, t, !0), t !== o ? Br.set(i, t) : s && Br.delete(i) } function $u(n) { n._lexicalHandled = !0 } function Iu(n) { return n._lexicalHandled === !0 } var q_ = () => { }; function Z_(n) { let e = n.ownerDocument, t = Xi.get(e); if (t === void 0) return void q_(); let r = t - 1; r >= 0 || R(164), Xi.set(e, r), r === 0 && e.removeEventListener("selectionchange", nf); let o = ni(n); gs(o) ? (function (s) { if (s._parentEditor !== null) { let a = Rl(s), l = a[a.length - 1]._key; Br.get(l) === s && Br.delete(l) } else Br.delete(s._key) }(o), n.__lexicalEditor = null) : o && R(198); let i = tf(n); for (let s = 0; s < i.length; s++)i[s](); n.__lexicalEventHandles = [] } function nl(n, e, t) { Xe(); let r = n.__key, o = n.getParent(); if (o === null) return; let i = function (a) { let l = ue(); if (!J(l) || !M(a)) return l; let { anchor: c, focus: u } = l, p = c.getNode(), g = u.getNode(); return is(p, a) && c.set(a.__key, 0, "element"), is(g, a) && u.set(a.__key, 0, "element"), l }(n), s = !1; if (J(i) && e) { let a = i.anchor, l = i.focus; a.key === r && (Qi(a, n, o, n.getPreviousSibling(), n.getNextSibling()), s = !0), l.key === r && (Qi(l, n, o, n.getPreviousSibling(), n.getNextSibling()), s = !0) } else ds(i) && e && n.isSelected() && n.selectPrevious(); if (J(i) && e && !s) { let a = n.getIndexWithinParent(); In(n), Zi(i, o, a, -1) } else In(n); t || zt(o) || o.canBeEmpty() || !o.isEmpty() || nl(o, e), e && i && pt(o) && o.isEmpty() && o.selectEnd() } var Ur = class { static getType() { R(64, this.name) } static clone(e) { R(65, this.name) } afterCloneFrom(e) { this.__parent = e.__parent, this.__next = e.__next, this.__prev = e.__prev, this.__state = e.__state } constructor(e) { this.__type = this.constructor.getType(), this.__parent = null, this.__prev = null, this.__next = null, Object.defineProperty(this, "__state", { configurable: !0, enumerable: !1, value: void 0, writable: !0 }), Tf(this, e) } getType() { return this.__type } isInline() { R(137, this.constructor.name) } isAttached() { let e = this.__key; for (; e !== null;) { if (e === "root") return !0; let t = Le(e); if (t === null) break; e = t.__parent } return !1 } isSelected(e) { let t = e || ue(); if (t == null) return !1; let r = t.getNodes().some(o => o.__key === this.__key); if (B(this)) return r; if (J(t) && t.anchor.type === "element" && t.focus.type === "element") { if (t.isCollapsed()) return !1; let o = this.getParent(); if (Ce(this) && this.isInline() && o) { let i = t.isBackward() ? t.focus : t.anchor; if (o.is(i.getNode()) && i.offset === o.getChildrenSize() && this.is(o.getLastChild())) return !1 } } return r } getKey() { return this.__key } getIndexWithinParent() { let e = this.getParent(); if (e === null) return -1; let t = e.getFirstChild(), r = 0; for (; t !== null;) { if (this.is(t)) return r; r++, t = t.getNextSibling() } return -1 } getParent() { let e = this.getLatest().__parent; return e === null ? null : Le(e) } getParentOrThrow() { let e = this.getParent(); return e === null && R(66, this.__key), e } getTopLevelElement() { let e = this; for (; e !== null;) { let t = e.getParent(); if (zt(t)) return M(e) || e === this && Ce(e) || R(194), e; e = t } return null } getTopLevelElementOrThrow() { let e = this.getTopLevelElement(); return e === null && R(67, this.__key), e } getParents() { let e = [], t = this.getParent(); for (; t !== null;)e.push(t), t = t.getParent(); return e } getParentKeys() { let e = [], t = this.getParent(); for (; t !== null;)e.push(t.__key), t = t.getParent(); return e } getPreviousSibling() { let e = this.getLatest().__prev; return e === null ? null : Le(e) } getPreviousSiblings() { let e = [], t = this.getParent(); if (t === null) return e; let r = t.getFirstChild(); for (; r !== null && !r.is(this);)e.push(r), r = r.getNextSibling(); return e } getNextSibling() { let e = this.getLatest().__next; return e === null ? null : Le(e) } getNextSiblings() { let e = [], t = this.getNextSibling(); for (; t !== null;)e.push(t), t = t.getNextSibling(); return e } getCommonAncestor(e) { let t = M(this) ? this : this.getParent(), r = M(e) ? e : e.getParent(), o = t && r ? Uo(t, r) : null; return o ? o.commonAncestor : null } is(e) { return e != null && this.__key === e.__key } isBefore(e) { let t = Uo(this, e); return t !== null && (t.type === "descendant" || (t.type === "branch" ? Wl(t) === -1 : (t.type !== "same" && t.type !== "ancestor" && R(279), !1))) } isParentOf(e) { let t = Uo(this, e); return t !== null && t.type === "ancestor" } getNodesBetween(e) { let t = this.isBefore(e), r = [], o = new Set, i = this; for (; i !== null;) { let s = i.__key; if (o.has(s) || (o.add(s), r.push(i)), i === e) break; let a = M(i) ? t ? i.getFirstChild() : i.getLastChild() : null; if (a !== null) { i = a; continue } let l = t ? i.getNextSibling() : i.getPreviousSibling(); if (l !== null) { i = l; continue } let c = i.getParentOrThrow(); if (o.has(c.__key) || r.push(c), c === e) break; let u = null, p = c; do { if (p === null && R(68), u = t ? p.getNextSibling() : p.getPreviousSibling(), p = p.getParent(), p === null) break; u !== null || o.has(p.__key) || r.push(p) } while (u === null); i = u } return t || r.reverse(), r } isDirty() { let e = Se()._dirtyLeaves; return e !== null && e.has(this.__key) } getLatest() { let e = Le(this.__key); return e === null && R(113), e } getWritable() { Xe(); let e = Nn(), t = Se(), r = e._nodeMap, o = this.__key, i = this.getLatest(), s = t._cloneNotNeeded, a = ue(); if (a !== null && a.setCachedNodes(null), s.has(o)) return os(i), i; let l = Kf(i); return s.add(o), os(l), r.set(o, l), l } getTextContent() { return "" } getTextContentSize() { return this.getTextContent().length } createDOM(e, t) { R(70) } updateDOM(e, t, r) { R(71) } exportDOM(e) { return { element: this.createDOM(e._config, e) } } exportJSON() { let e = this.__state ? this.__state.toJSON() : void 0; return { type: this.__type, version: 1, ...e } } static importJSON(e) { R(18, this.name) } updateFromJSON(e) { return function (t, r) { let o = t.getWritable(); return (r || o.__state) && yl(t).updateFromJSON(r), o }(this, e.$) } static transform() { return null } remove(e) { nl(this, !0, e) } replace(e, t) { Xe(); let r = ue(); r !== null && (r = r.clone()), $a(this, e); let o = this.getLatest(), i = this.__key, s = e.__key, a = e.getWritable(), l = this.getParentOrThrow().getWritable(), c = l.__size; In(a); let u = o.getPreviousSibling(), p = o.getNextSibling(), g = o.__prev, f = o.__next, d = o.__parent; if (nl(o, !1, !0), u === null ? l.__first = s : u.getWritable().__next = s, a.__prev = g, p === null ? l.__last = s : p.getWritable().__prev = s, a.__next = f, a.__parent = d, l.__size = c, t && (M(this) && M(a) || R(139), this.getChildren().forEach(m => { a.append(m) })), J(r)) { Ct(r); let m = r.anchor, h = r.focus; m.key === i && Hu(m, a), h.key === i && Hu(h, a) } return Ln() === i && He(s), a } insertAfter(e, t = !0) { Xe(), $a(this, e); let r = this.getWritable(), o = e.getWritable(), i = o.getParent(), s = ue(), a = !1, l = !1; if (i !== null) { let f = e.getIndexWithinParent(); if (In(o), J(s)) { let d = i.__key, m = s.anchor, h = s.focus; a = m.type === "element" && m.key === d && m.offset === f + 1, l = h.type === "element" && h.key === d && h.offset === f + 1 } } let c = this.getNextSibling(), u = this.getParentOrThrow().getWritable(), p = o.__key, g = r.__next; if (c === null ? u.__last = p : c.getWritable().__prev = p, u.__size++, r.__next = p, o.__next = g, o.__prev = r.__key, o.__parent = r.__parent, t && J(s)) { let f = this.getIndexWithinParent(); Zi(s, u, f + 1); let d = u.__key; a && s.anchor.set(d, f + 2, "element"), l && s.focus.set(d, f + 2, "element") } return e } insertBefore(e, t = !0) { Xe(), $a(this, e); let r = this.getWritable(), o = e.getWritable(), i = o.__key; In(o); let s = this.getPreviousSibling(), a = this.getParentOrThrow().getWritable(), l = r.__prev, c = this.getIndexWithinParent(); s === null ? a.__first = i : s.getWritable().__next = i, a.__size++, r.__prev = i, o.__prev = l, o.__next = r.__key, o.__parent = r.__parent; let u = ue(); return t && J(u) && Zi(u, this.getParentOrThrow(), c), e } isParentRequired() { return !1 } createParentElementNode() { return mn() } selectStart() { return this.selectPrevious() } selectEnd() { return this.selectNext(0, 0) } selectPrevious(e, t) { Xe(); let r = this.getPreviousSibling(), o = this.getParentOrThrow(); if (r === null) return o.select(0, 0); if (M(r)) return r.select(); if (!B(r)) { let i = r.getIndexWithinParent() + 1; return o.select(i, i) } return r.select(e, t) } selectNext(e, t) { Xe(); let r = this.getNextSibling(), o = this.getParentOrThrow(); if (r === null) return o.select(); if (M(r)) return r.select(0, 0); if (!B(r)) { let i = r.getIndexWithinParent(); return o.select(i, i) } return r.select(e, t) } markDirty() { this.getWritable() } reconcileObservedMutation(e, t) { this.markDirty() } }, Wr = class n extends Ur { static getType() { return "linebreak" } static clone(e) { return new n(e.__key) } constructor(e) { super(e) } getTextContent() { return ` `} createDOM() { return document.createElement("br") } updateDOM() { return !1 } isInline() { return !0 } static importDOM() { return { br: e => function (t) { let r = t.parentElement; if (r !== null && al(r)) { let o = r.firstChild; if (o === t || o.nextSibling === t && Ri(o)) { let i = r.lastChild; if (i === t || i.previousSibling === t && Ri(i)) return !0 } } return !1 }(e) || function (t) { let r = t.parentElement; if (r !== null && al(r)) { let o = r.firstChild; if (o === t || o.nextSibling === t && Ri(o)) return !1; let i = r.lastChild; if (i === t || i.previousSibling === t && Ri(i)) return !0 } return !1 }(e) ? null : { conversion: Q_, priority: 0 } } } static importJSON(e) { return Gr().updateFromJSON(e) } }; function Q_(n) { return { node: Gr() } } function Gr() { return oi(new Wr) } function cr(n) { return n instanceof Wr } function Ri(n) { return Qt(n) && /^( |\t|\r?\n)+$/.test(n.textContent || "") } function Ma(n, e) { return 16 & e ? "code" : e & as ? "mark" : 32 & e ? "sub" : 64 & e ? "sup" : null } function ka(n, e) { return 1 & e ? "strong" : 2 & e ? "em" : "span" } function rf(n, e, t, r, o) { let i = r.classList, s = Kr(o, "base"); s !== void 0 && i.add(...s), s = Kr(o, "underlineStrikethrough"); let a = !1, l = e & jo && e & Yo; s !== void 0 && (t & jo && t & Yo ? (a = !0, l || i.add(...s)) : l && i.remove(...s)); for (let c in et) { let u = et[c]; if (s = Kr(o, c), s !== void 0) if (t & u) { if (a && (c === "underline" || c === "strikethrough")) { e & u && i.remove(...s); continue } e & u && (!l || c !== "underline") && c !== "strikethrough" || i.add(...s) } else e & u && i.remove(...s) } } function of(n, e, t) { let r = e.firstChild, o = t.isComposing(), i = n + (o ? ls : ""); if (r == null) e.textContent = i; else { let s = r.nodeValue; if (s !== i) if (o || $n) { let [a, l, c] = function (u, p) { let g = u.length, f = p.length, d = 0, m = 0; for (; d < g && d < f && u[d] === p[d];)d++; for (; m + d < g && m + d < f && u[g - m - 1] === p[f - m - 1];)m++; return [d, g - d - m, p.slice(d, f - m)] }(s, i); l !== 0 && r.deleteData(a, l), r.insertData(a, c) } else r.nodeValue = i } } function Pu(n, e, t, r, o, i) { of(o, n, e); let s = i.theme.text; s !== void 0 && rf(0, 0, r, n, s) } function Fi(n, e) { let t = document.createElement(e); return t.appendChild(n), t } var fr = class n extends Ur { static getType() { return "text" } static clone(e) { return new n(e.__text, e.__key) } afterCloneFrom(e) { super.afterCloneFrom(e), this.__text = e.__text, this.__format = e.__format, this.__style = e.__style, this.__mode = e.__mode, this.__detail = e.__detail } constructor(e = "", t) { super(t), this.__text = e, this.__format = 0, this.__style = "", this.__mode = 0, this.__detail = 0 } getFormat() { return this.getLatest().__format } getDetail() { return this.getLatest().__detail } getMode() { let e = this.getLatest(); return D_[e.__mode] } getStyle() { return this.getLatest().__style } isToken() { return this.getLatest().__mode === 1 } isComposing() { return this.__key === Ln() } isSegmented() { return this.getLatest().__mode === 2 } isDirectionless() { return !!(1 & this.getLatest().__detail) } isUnmergeable() { return !!(2 & this.getLatest().__detail) } hasFormat(e) { let t = et[e]; return !!(this.getFormat() & t) } isSimpleText() { return this.__type === "text" && this.__mode === 0 } getTextContent() { return this.getLatest().__text } getFormatFlags(e, t) { return rs(this.getLatest().__format, e, t) } canHaveFormat() { return !0 } isInline() { return !0 } createDOM(e, t) { let r = this.__format, o = Ma(0, r), i = ka(0, r), s = o === null ? i : o, a = document.createElement(s), l = a; this.hasFormat("code") && a.setAttribute("spellcheck", "false"), o !== null && (l = document.createElement(i), a.appendChild(l)), Pu(l, this, 0, r, this.__text, e); let c = this.__style; return c !== "" && (a.style.cssText = c), a } updateDOM(e, t, r) { let o = this.__text, i = e.__format, s = this.__format, a = Ma(0, i), l = Ma(0, s), c = ka(0, i), u = ka(0, s); if ((a === null ? c : a) !== (l === null ? u : l)) return !0; if (a === l && c !== u) { let m = t.firstChild; m == null && R(48); let h = document.createElement(u); return Pu(h, this, 0, s, o, r), t.replaceChild(h, m), !1 } let p = t; l !== null && a !== null && (p = t.firstChild, p == null && R(49)), of(o, p, this); let g = r.theme.text; g !== void 0 && i !== s && rf(0, i, s, p, g); let f = e.__style, d = this.__style; return f !== d && (t.style.cssText = d), !1 } static importDOM() { return { "#text": () => ({ conversion: rC, priority: 0 }), b: () => ({ conversion: tC, priority: 0 }), code: () => ({ conversion: dn, priority: 0 }), em: () => ({ conversion: dn, priority: 0 }), i: () => ({ conversion: dn, priority: 0 }), mark: () => ({ conversion: dn, priority: 0 }), s: () => ({ conversion: dn, priority: 0 }), span: () => ({ conversion: eC, priority: 0 }), strong: () => ({ conversion: dn, priority: 0 }), sub: () => ({ conversion: dn, priority: 0 }), sup: () => ({ conversion: dn, priority: 0 }), u: () => ({ conversion: dn, priority: 0 }) } } static importJSON(e) { return Ke().updateFromJSON(e) } updateFromJSON(e) { return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style) } exportDOM(e) { let { element: t } = super.exportDOM(e); return it(t) || R(132), t.style.whiteSpace = "pre-wrap", this.hasFormat("lowercase") ? t.style.textTransform = "lowercase" : this.hasFormat("uppercase") ? t.style.textTransform = "uppercase" : this.hasFormat("capitalize") && (t.style.textTransform = "capitalize"), this.hasFormat("bold") && (t = Fi(t, "b")), this.hasFormat("italic") && (t = Fi(t, "i")), this.hasFormat("strikethrough") && (t = Fi(t, "s")), this.hasFormat("underline") && (t = Fi(t, "u")), { element: t } } exportJSON() { return { detail: this.getDetail(), format: this.getFormat(), mode: this.getMode(), style: this.getStyle(), text: this.getTextContent(), ...super.exportJSON() } } selectionTransform(e, t) { } setFormat(e) { let t = this.getWritable(); return t.__format = typeof e == "string" ? et[e] : e, t } setDetail(e) { let t = this.getWritable(); return t.__detail = typeof e == "string" ? A_[e] : e, t } setStyle(e) { let t = this.getWritable(); return t.__style = e, t } toggleFormat(e) { let t = rs(this.getFormat(), e, null); return this.setFormat(t) } toggleDirectionless() { let e = this.getWritable(); return e.__detail ^= 1, e } toggleUnmergeable() { let e = this.getWritable(); return e.__detail ^= 2, e } setMode(e) { let t = v_[e]; if (this.__mode === t) return this; let r = this.getWritable(); return r.__mode = t, r } setTextContent(e) { if (this.__text === e) return this; let t = this.getWritable(); return t.__text = e, t } select(e, t) { Xe(); let r = e, o = t, i = ue(), s = this.getTextContent(), a = this.__key; if (typeof s == "string") { let l = s.length; r === void 0 && (r = l), o === void 0 && (o = l) } else r = 0, o = 0; if (!J(i)) return cf(a, r, a, o, "text", "text"); { let l = Ln(); l !== i.anchor.key && l !== i.focus.key || He(a), i.setTextNodeRange(this, r, this, o) } return i } selectStart() { return this.select(0, 0) } selectEnd() { let e = this.getTextContentSize(); return this.select(e, e) } spliceText(e, t, r, o) { let i = this.getWritable(), s = i.__text, a = r.length, l = e; l < 0 && (l = a + l, l < 0 && (l = 0)); let c = ue(); if (o && J(c)) { let p = e + a; c.setTextNodeRange(i, p, i, p) } let u = s.slice(0, l) + r + s.slice(l + t); return i.__text = u, i } canInsertTextBefore() { return !0 } canInsertTextAfter() { return !0 } splitText(...e) { Xe(); let t = this.getLatest(), r = t.getTextContent(); if (r === "") return []; let o = t.__key, i = Ln(), s = r.length; e.sort((A, O) => A - O), e.push(s); let a = [], l = e.length; for (let A = 0, O = 0; A < s && O <= l; O++) { let F = e[O]; F > A && (a.push(r.slice(A, F)), A = F) } let c = a.length; if (c === 1) return [t]; let u = a[0], p = t.getParent(), g, f = t.getFormat(), d = t.getStyle(), m = t.__detail, h = !1, _ = null, C = null, y = ue(); if (J(y)) { let [A, O] = y.isBackward() ? [y.focus, y.anchor] : [y.anchor, y.focus]; A.type === "text" && A.key === o && (_ = A), O.type === "text" && O.key === o && (C = O) } t.isSegmented() ? (g = Ke(u), g.__format = f, g.__style = d, g.__detail = m, h = !0) : (g = t.getWritable(), g.__text = u); let x = [g]; for (let A = 1; A < c; A++) { let O = Ke(a[A]); O.__format = f, O.__style = d, O.__detail = m; let F = O.__key; i === o && He(F), x.push(O) } let b = _ ? _.offset : null, S = C ? C.offset : null, N = 0; for (let A of x) { if (!_ && !C) break; let O = N + A.getTextContentSize(); if (_ !== null && b !== null && b <= O && b >= N && (_.set(A.getKey(), b - N, "text"), b < O && (_ = null)), C !== null && S !== null && S <= O && S >= N) { C.set(A.getKey(), S - N, "text"); break } N = O } if (p !== null) { (function (F) { let L = F.getPreviousSibling(), G = F.getNextSibling(); L !== null && os(L), G !== null && os(G) })(this); let A = p.getWritable(), O = this.getIndexWithinParent(); h ? (A.splice(O, 0, x), this.remove()) : A.splice(O, 1, x), J(y) && Zi(y, p, O, c - 1) } return x } mergeWithSibling(e) { let t = e === this.getPreviousSibling(); t || e === this.getNextSibling() || R(50); let r = this.__key, o = e.__key, i = this.__text, s = i.length; Ln() === o && He(r); let a = ue(); if (J(a)) { let p = a.anchor, g = a.focus; p !== null && p.key === o && Ju(p, t, r, e, s), g !== null && g.key === o && Ju(g, t, r, e, s) } let l = e.__text, c = t ? l + i : i + l; this.setTextContent(c); let u = this.getWritable(); return e.remove(), u } isTextEntity() { return !1 } }; function eC(n) { return { forChild: Al(n.style), node: null } } function tC(n) { let e = n, t = e.style.fontWeight === "normal"; return { forChild: Al(e.style, t ? void 0 : "bold"), node: null } } var Bu = new WeakMap; function nC(n) { if (!it(n)) return !1; if (n.nodeName === "PRE") return !0; let e = n.style.whiteSpace; return typeof e == "string" && e.startsWith("pre") } function rC(n) { let e = n; n.parentElement === null && R(129); let t = e.textContent || ""; if (function (r) { let o, i = r.parentNode, s = [r]; for (; i !== null && (o = Bu.get(i)) === void 0 && !nC(i);)s.push(i), i = i.parentNode; let a = o === void 0 ? i : o; for (let l = 0; l < s.length; l++)Bu.set(s[l], a); return a }(e) !== null) { let r = t.split(/(\r?\n|\t)/), o = [], i = r.length; for (let s = 0; s < i; s++) { let a = r[s]; a === ` `|| a === `\r `? o.push(Gr()) : a === " " ? o.push(us()) : a !== "" && o.push(Ke(a)) } return { node: o } } if (t = t.replace(/\r/g, "").replace(/[ \t\n]+/g, " "), t === "") return { node: null }; if (t[0] === " ") { let r = e, o = !0; for (; r !== null && (r = Ku(r, !1)) !== null;) { let i = r.textContent || ""; if (i.length > 0) { /[ \t\n]$/.test(i) && (t = t.slice(1)), o = !1; break } } o && (t = t.slice(1)) } if (t[t.length - 1] === " ") { let r = e, o = !0; for (; r !== null && (r = Ku(r, !0)) !== null;)if ((r.textContent || "").replace(/^( |\t|\r?\n)+/, "").length > 0) { o = !1; break } o && (t = t.slice(0, t.length - 1)) } return t === "" ? { node: null } : { node: Ke(t) } } function Ku(n, e) { let t = n; for (; ;) { let r; for (; (r = e ? t.nextSibling : t.previousSibling) === null;) { let i = t.parentElement; if (i === null) return null; t = i } if (t = r, it(t)) { let i = t.style.display; if (i === "" && !Bf(t) || i !== "" && !i.startsWith("inline")) return null } let o = t; for (; (o = e ? t.firstChild : t.lastChild) !== null;)t = o; if (Qt(t)) return t; if (t.nodeName === "BR") return null } } var oC = { code: "code", em: "italic", i: "italic", mark: "highlight", s: "strikethrough", strong: "bold", sub: "subscript", sup: "superscript", u: "underline" }; function dn(n) { let e = oC[n.nodeName.toLowerCase()]; return e === void 0 ? { node: null } : { forChild: Al(n.style, e), node: null } } function Ke(n = "") { return oi(new fr(n)) } function B(n) { return n instanceof fr } function Al(n, e) { let t = n.fontWeight, r = n.textDecoration.split(" "), o = t === "700" || t === "bold", i = r.includes("line-through"), s = n.fontStyle === "italic", a = r.includes("underline"), l = n.verticalAlign; return c => (B(c) && (o && !c.hasFormat("bold") && c.toggleFormat("bold"), i && !c.hasFormat("strikethrough") && c.toggleFormat("strikethrough"), s && !c.hasFormat("italic") && c.toggleFormat("italic"), a && !c.hasFormat("underline") && c.toggleFormat("underline"), l !== "sub" || c.hasFormat("subscript") || c.toggleFormat("subscript"), l !== "super" || c.hasFormat("superscript") || c.toggleFormat("superscript"), e && !c.hasFormat(e) && c.toggleFormat(e)), c) } var Yr = class n extends fr { static getType() { return "tab" } static clone(e) { return new n(e.__key) } constructor(e) { super(" ", e), this.__detail = 2 } static importDOM() { return null } createDOM(e) { let t = super.createDOM(e), r = Kr(e.theme, "tab"); return r !== void 0 && t.classList.add(...r), t } static importJSON(e) { return us().updateFromJSON(e) } setTextContent(e) { return e !== " " && e !== "" && R(126), super.setTextContent(e) } setDetail(e) { return e !== 2 && R(127), this } setMode(e) { return e !== "normal" && R(128), this } canInsertTextBefore() { return !1 } canInsertTextAfter() { return !1 } }; function us() { return oi(new Yr) } function sf(n) { return n instanceof Yr } var rl = class { constructor(e, t, r) { this._selection = null, this.key = e, this.offset = t, this.type = r } is(e) { return this.key === e.key && this.offset === e.offset && this.type === e.type } isBefore(e) { return this.key === e.key ? this.offset < e.offset : Ul(Pt(Hn(this, "next")), Pt(Hn(e, "next"))) < 0 } getNode() { let e = Le(this.key); return e === null && R(20), e } set(e, t, r, o) { let i = this._selection, s = this.key; o && this.key === e && this.offset === t && this.type === r || (this.key = e, this.offset = t, this.type = r, no() || (Ln() === s && He(e), i !== null && (i.setCachedNodes(null), i.dirty = !0))) } }; function Ht(n, e, t) { return new rl(n, e, t) } function Ra(n, e) { let t = e.__key, r = n.offset, o = "element"; if (B(e)) { o = "text"; let i = e.getTextContentSize(); r > i && (r = i) } else if (!M(e)) { let i = e.getNextSibling(); if (B(i)) t = i.__key, r = 0, o = "text"; else { let s = e.getParent(); s && (t = s.__key, r = e.getIndexWithinParent() + 1) } } n.set(t, r, o) } function Hu(n, e) { if (M(e)) { let t = e.getLastDescendant(); M(t) || B(t) ? Ra(n, t) : Ra(n, e) } else Ra(n, e) } var qi = class n { constructor(e) { this._cachedNodes = null, this._nodes = e, this.dirty = !1 } getCachedNodes() { return this._cachedNodes } setCachedNodes(e) { this._cachedNodes = e } is(e) { if (!ds(e)) return !1; let t = this._nodes, r = e._nodes; return t.size === r.size && Array.from(t).every(o => r.has(o)) } isCollapsed() { return !1 } isBackward() { return !1 } getStartEndPoints() { return null } add(e) { this.dirty = !0, this._nodes.add(e), this._cachedNodes = null } delete(e) { this.dirty = !0, this._nodes.delete(e), this._cachedNodes = null } clear() { this.dirty = !0, this._nodes.clear(), this._cachedNodes = null } has(e) { return this._nodes.has(e) } clone() { return new n(new Set(this._nodes)) } extract() { return this.getNodes() } insertRawText(e) { } insertText() { } insertNodes(e) { let t = this.getNodes(), r = t.length, o = t[r - 1], i; if (B(o)) i = o.select(); else { let s = o.getIndexWithinParent() + 1; i = o.getParentOrThrow().select(s, s) } i.insertNodes(e); for (let s = 0; s < r; s++)t[s].remove() } getNodes() { let e = this._cachedNodes; if (e !== null) return e; let t = this._nodes, r = []; for (let o of t) { let i = Le(o); i !== null && r.push(i) } return no() || (this._cachedNodes = r), r } getTextContent() { let e = this.getNodes(), t = ""; for (let r = 0; r < e.length; r++)t += e[r].getTextContent(); return t } deleteNodes() { let e = this.getNodes(); if ((ue() || Cr()) === this && e[0]) { let t = We(e[0], "next"); Gf(Kn(t, t)) } for (let t of e) t.remove() } }; function J(n) { return n instanceof gr } var gr = class n { constructor(e, t, r, o) { this.anchor = e, this.focus = t, e._selection = this, t._selection = this, this._cachedNodes = null, this.format = r, this.style = o, this.dirty = !1 } getCachedNodes() { return this._cachedNodes } setCachedNodes(e) { this._cachedNodes = e } is(e) { return !!J(e) && this.anchor.is(e.anchor) && this.focus.is(e.focus) && this.format === e.format && this.style === e.style } isCollapsed() { return this.anchor.is(this.focus) } getNodes() { let e = this._cachedNodes; if (e !== null) return e; let t = function (r) { let o = [], [i, s] = r.getTextSlices(); i && o.push(i.caret.origin); let a = new Set, l = new Set; for (let c of r) if (Kt(c)) { let { origin: u } = c; o.length === 0 ? a.add(u) : (l.add(u), o.push(u)) } else { let { origin: u } = c; M(u) && l.has(u) || o.push(u) } if (s && o.push(s.caret.origin), mr(r.focus) && M(r.focus.origin) && r.focus.getNodeAtCaret() === null) for (let c = yn(r.focus.origin, "previous"); Kt(c) && a.has(c.origin) && !c.origin.isEmpty() && c.origin.is(o[o.length - 1]); c = eo(c))a.delete(c.origin), o.pop(); for (; o.length > 1;) { let c = o[o.length - 1]; if (!M(c) || l.has(c) || c.isEmpty() || a.has(c)) break; o.pop() } if (o.length === 0 && r.isCollapsed()) { let c = Pt(r.anchor), u = Pt(r.anchor.getFlipped()), p = f => _n(f) ? f.origin : f.getNodeAtCaret(), g = p(c) || p(u) || (r.anchor.getNodeAtCaret() ? c.origin : u.origin); o.push(g) } return o }(Gl(dl(this), "next")); return no() || (this._cachedNodes = t), t } setTextNodeRange(e, t, r, o) { this.anchor.set(e.__key, t, "text"), this.focus.set(r.__key, o, "text") } getTextContent() { let e = this.getNodes(); if (e.length === 0) return ""; let t = e[0], r = e[e.length - 1], o = this.anchor, i = this.focus, s = o.isBefore(i), [a, l] = ol(this), c = "", u = !0; for (let p = 0; p < e.length; p++) { let g = e[p]; if (M(g) && !g.isInline()) u || (c += ` `), u = !g.isEmpty(); else if (u = !1, B(g)) { let f = g.getTextContent(); g === t ? g === r ? o.type === "element" && i.type === "element" && i.offset !== o.offset || (f = a < l ? f.slice(a, l) : f.slice(l, a)) : f = s ? f.slice(a) : f.slice(l) : g === r && (f = s ? f.slice(0, l) : f.slice(0, a)), c += f } else !Ce(g) && !cr(g) || g === r && this.isCollapsed() || (c += g.getTextContent()) } return c } applyDOMRange(e) { let t = Se(), r = t.getEditorState()._selection, o = lf(e.startContainer, e.startOffset, e.endContainer, e.endOffset, t, r); if (o === null) return; let [i, s] = o; this.anchor.set(i.key, i.offset, i.type, !0), this.focus.set(s.key, s.offset, s.type, !0), Gi(this) } clone() { let e = this.anchor, t = this.focus; return new n(Ht(e.key, e.offset, e.type), Ht(t.key, t.offset, t.type), this.format, this.style) } toggleFormat(e) { this.format = rs(this.format, e, null), this.dirty = !0 } setStyle(e) { this.style = e, this.dirty = !0 } hasFormat(e) { let t = et[e]; return !!(this.format & t) } insertRawText(e) { let t = e.split(/(\r?\n|\t)/), r = [], o = t.length; for (let i = 0; i < o; i++) { let s = t[i]; s === ` `|| s === `\r `? r.push(Gr()) : s === " " ? r.push(us()) : r.push(Ke(s)) } this.insertNodes(r) } insertText(e) { let t = this.anchor, r = this.focus, o = this.format, i = this.style, s = t, a = r; !this.isCollapsed() && r.isBefore(t) && (s = r, a = t), s.type === "element" && function (h, _, C, y) { let x = h.getNode(), b = x.getChildAtIndex(h.offset), S = Ke(), N = pt(x) ? mn().append(S) : S; S.setFormat(C), S.setStyle(y), b === null ? x.append(N) : b.insertBefore(N), h.is(_) && _.set(S.__key, 0, "text"), h.set(S.__key, 0, "text") }(s, a, o, i), a.type === "element" && to(a, Pt(Hn(a, "next"))); let l = s.offset, c = a.offset, u = this.getNodes(), p = u.length, g = u[0]; B(g) || R(26); let f = g.getTextContent().length, d = g.getParentOrThrow(), m = u[p - 1]; if (p === 1 && a.type === "element" && (c = f, a.set(s.key, c, "text")), this.isCollapsed() && l === f && (g.isSegmented() || g.isToken() || !g.canInsertTextAfter() || !d.canInsertTextAfter() && g.getNextSibling() === null)) { let h = g.getNextSibling(); if (B(h) && h.canInsertTextBefore() && !lr(h) || (h = Ke(), h.setFormat(o), h.setStyle(i), d.canInsertTextAfter() ? g.insertAfter(h) : d.insertAfter(h)), h.select(0, 0), g = h, e !== "") return void this.insertText(e) } else if (this.isCollapsed() && l === 0 && (g.isSegmented() || g.isToken() || !g.canInsertTextBefore() || !d.canInsertTextBefore() && g.getPreviousSibling() === null)) { let h = g.getPreviousSibling(); if (B(h) && !lr(h) || (h = Ke(), h.setFormat(o), d.canInsertTextBefore() ? g.insertBefore(h) : d.insertBefore(h)), h.select(), g = h, e !== "") return void this.insertText(e) } else if (g.isSegmented() && l !== f) { let h = Ke(g.getTextContent()); h.setFormat(o), g.replace(h), g = h } else if (!this.isCollapsed() && e !== "") { let h = m.getParent(); if (!d.canInsertTextBefore() || !d.canInsertTextAfter() || M(h) && (!h.canInsertTextBefore() || !h.canInsertTextAfter())) return this.insertText(""), af(this.anchor, this.focus, null), void this.insertText(e) } if (p === 1) { if (g.isToken()) { let y = Ke(e); return y.select(), void g.replace(y) } let h = g.getFormat(), _ = g.getStyle(); if (l !== c || h === o && _ === i) { if (sf(g)) { let y = Ke(e); return y.setFormat(o), y.setStyle(i), y.select(), void g.replace(y) } } else { if (g.getTextContent() !== "") { let y = Ke(e); if (y.setFormat(o), y.setStyle(i), y.select(), l === 0) g.insertBefore(y, !1); else { let [x] = g.splitText(l); x.insertAfter(y, !1) } return void (y.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length)) } g.setFormat(o), g.setStyle(i) } let C = c - l; g = g.spliceText(l, C, e, !0), g.getTextContent() === "" ? g.remove() : this.anchor.type === "text" && (g.isComposing() ? this.anchor.offset -= e.length : (this.format = h, this.style = _)) } else { let h = new Set([...g.getParentKeys(), ...m.getParentKeys()]), _ = M(g) ? g : g.getParentOrThrow(), C = M(m) ? m : m.getParentOrThrow(), y = m; if (!_.is(C) && C.isInline()) do y = C, C = C.getParentOrThrow(); while (C.isInline()); if (a.type === "text" && (c !== 0 || m.getTextContent() === "") || a.type === "element" && m.getIndexWithinParent() < c) if (B(m) && !m.isToken() && c !== m.getTextContentSize()) { if (m.isSegmented()) { let A = Ke(m.getTextContent()); m.replace(A), m = A } pt(a.getNode()) || a.type !== "text" || (m = m.spliceText(0, c, "")), h.add(m.__key) } else { let A = m.getParentOrThrow(); A.canBeEmpty() || A.getChildrenSize() !== 1 ? m.remove() : A.remove() } else h.add(m.__key); let x = C.getChildren(), b = new Set(u), S = _.is(C), N = _.isInline() && g.getNextSibling() === null ? _ : g; for (let A = x.length - 1; A >= 0; A--) { let O = x[A]; if (O.is(g) || M(O) && O.isParentOf(g)) break; O.isAttached() && (!b.has(O) || O.is(y) ? S || N.insertAfter(O, !1) : O.remove()) } if (!S) { let A = C, O = null; for (; A !== null;) { let F = A.getChildren(), L = F.length; (L === 0 || F[L - 1].is(O)) && (h.delete(A.__key), O = A), A = A.getParent() } } if (g.isToken()) if (l === f) g.select(); else { let A = Ke(e); A.select(), g.replace(A) } else g = g.spliceText(l, f - l, e, !0), g.getTextContent() === "" ? g.remove() : g.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length); for (let A = 1; A < p; A++) { let O = u[A], F = O.__key; h.has(F) || O.remove() } } } removeText() { let e = ue() === this; Wo(this, Yf(dl(this))), e && ue() !== this && Ct(this) } formatText(e, t = null) { if (this.isCollapsed()) return this.toggleFormat(e), void He(null); let r = this.getNodes(), o = []; for (let x of r) B(x) && o.push(x); let i = x => { r.forEach(b => { if (M(b)) { let S = b.getFormatFlags(e, x); b.setTextFormat(S) } }) }, s = o.length; if (s === 0) return this.toggleFormat(e), He(null), void i(t); let a = this.anchor, l = this.focus, c = this.isBackward(), u = c ? l : a, p = c ? a : l, g = 0, f = o[0], d = u.type === "element" ? 0 : u.offset; if (u.type === "text" && d === f.getTextContentSize() && (g = 1, f = o[1], d = 0), f == null) return; let m = f.getFormatFlags(e, t); i(m); let h = s - 1, _ = o[h], C = p.type === "text" ? p.offset : _.getTextContentSize(); if (f.is(_)) { if (d === C) return; if (lr(f) || d === 0 && C === f.getTextContentSize()) f.setFormat(m); else { let x = f.splitText(d, C), b = d === 0 ? x[0] : x[1]; b.setFormat(m), u.type === "text" && u.set(b.__key, 0, "text"), p.type === "text" && p.set(b.__key, C - d, "text") } return void (this.format = m) } d === 0 || lr(f) || ([, f] = f.splitText(d), d = 0), f.setFormat(m); let y = _.getFormatFlags(e, m); C > 0 && (C === _.getTextContentSize() || lr(_) || ([_] = _.splitText(C)), _.setFormat(y)); for (let x = g + 1; x < h; x++) { let b = o[x], S = b.getFormatFlags(e, y); b.setFormat(S) } u.type === "text" && u.set(f.__key, d, "text"), p.type === "text" && p.set(_.__key, C, "text"), this.format = m | y } insertNodes(e) { if (e.length === 0) return; if (this.isCollapsed() || this.removeText(), this.anchor.key === "root") { this.insertParagraph(); let d = ue(); return J(d) || R(134), d.insertNodes(e) } let t = (this.isBackward() ? this.focus : this.anchor).getNode(), r = Pa(t, pn), o = e[e.length - 1]; if (M(r) && "__language" in r) { if ("__language" in e[0]) this.insertText(e[0].getTextContent()); else { let d = Fa(this); r.splice(d, 0, e), o.selectEnd() } return } if (!e.some(d => (M(d) || Ce(d)) && !d.isInline())) { M(r) || R(211, t.constructor.name, t.getType()); let d = Fa(this); return r.splice(d, 0, e), void o.selectEnd() } let i = function (d) { let m = mn(), h = null; for (let _ = 0; _ < d.length; _++) { let C = d[_], y = cr(C); if (y || Ce(C) && C.isInline() || M(C) && C.isInline() || B(C) || C.isParentRequired()) { if (h === null && (h = C.createParentElementNode(), m.append(h), y)) continue; h !== null && h.append(C) } else m.append(C), h = null } return m }(e), s = i.getLastDescendant(), a = i.getChildren(), l = !M(r) || !r.isEmpty() ? this.insertParagraph() : null, c = a[a.length - 1], u = a[0]; var p; M(p = u) && pn(p) && !p.isEmpty() && M(r) && (!r.isEmpty() || r.canMergeWhenEmpty()) && (M(r) || R(211, t.constructor.name, t.getType()), r.append(...u.getChildren()), u = a[1]), u && (r === null && R(212, t.constructor.name, t.getType()), function (d, m, h) { let _ = m.getParentOrThrow().getLastChild(), C = m, y = [m]; for (; C !== _;)C.getNextSibling() || R(140), C = C.getNextSibling(), y.push(C); let x = d; for (let b of y) x = x.insertAfter(b) }(r, u)); let g = Pa(s, pn); l && M(g) && (l.canMergeWhenEmpty() || pn(c)) && (g.append(...l.getChildren()), l.remove()), M(r) && r.isEmpty() && r.remove(), s.selectEnd(); let f = M(r) ? r.getLastChild() : null; cr(f) && g !== r && f.remove() } insertParagraph() { if (this.anchor.key === "root") { let s = mn(); return _t().splice(this.anchor.offset, 0, [s]), s.select(), s } let e = Fa(this), t = Pa(this.anchor.getNode(), pn); M(t) || R(213); let r = t.getChildAtIndex(e), o = r ? [r, ...r.getNextSiblings()] : [], i = t.insertNewAfter(this, !1); return i ? (i.append(...o), i.selectStart(), i) : null } insertLineBreak(e) { let t = Gr(); if (this.insertNodes([t]), e) { let r = t.getParentOrThrow(), o = t.getIndexWithinParent(); r.select(o, o) } } extract() { let e = this.getNodes(), t = e.length, r = t - 1, o = this.anchor, i = this.focus, s = e[0], a = e[r], [l, c] = ol(this); if (t === 0) return []; if (t === 1) { if (B(s) && !this.isCollapsed()) { let p = l > c ? c : l, g = l > c ? l : c, f = s.splitText(p, g), d = p === 0 ? f[0] : f[1]; return d != null ? [d] : [] } return [s] } let u = o.isBefore(i); if (B(s)) { let p = u ? l : c; p === s.getTextContentSize() ? e.shift() : p !== 0 && ([, s] = s.splitText(p), e[0] = s) } if (B(a)) { let p = a.getTextContent().length, g = u ? c : l; g === 0 ? e.pop() : g !== p && ([a] = a.splitText(g), e[r] = a) } return e } modify(e, t, r) { if (Vu(this, e, t, r)) return; let o = e === "move", i = Se(), s = Zt(Rt(i)); if (!s) return; let a = i._blockCursorElement, l = i._rootElement, c = this.focus.getNode(); if (l === null || a === null || !M(c) || c.isInline() || c.canBeEmpty() || sl(a, i, l), this.dirty) { let u = Xr(i, this.anchor.key), p = Xr(i, this.focus.key); this.anchor.type === "text" && (u = pr(u)), this.focus.type === "text" && (p = pr(p)), u && p && df(s, u, this.anchor.offset, p, this.focus.offset) } if (function (u, p, g, f) { u.modify(p, g, f) }(s, e, t ? "backward" : "forward", r), s.rangeCount > 0) { let u = s.getRangeAt(0), p = this.anchor.getNode(), g = pt(p) ? p : Lf(p); if (this.applyDOMRange(u), this.dirty = !0, !o) { let f = this.getNodes(), d = [], m = !1; for (let h = 0; h < f.length; h++) { let _ = f[h]; is(_, g) ? d.push(_) : m = !0 } if (m && d.length > 0) if (t) { let h = d[0]; M(h) ? h.selectStart() : h.getParentOrThrow().selectStart() } else { let h = d[d.length - 1]; M(h) ? h.selectEnd() : h.getParentOrThrow().selectEnd() } s.anchorNode === u.startContainer && s.anchorOffset === u.startOffset || function (h) { let _ = h.focus, C = h.anchor, y = C.key, x = C.offset, b = C.type; C.set(_.key, _.offset, _.type, !0), _.set(y, x, b, !0) }(this) } } r === "lineboundary" && Vu(this, e, t, r, "decorators") } forwardDeletion(e, t, r) { if (!r && (e.type === "element" && M(t) && e.offset === t.getChildrenSize() || e.type === "text" && e.offset === t.getTextContentSize())) { let o = t.getParent(), i = t.getNextSibling() || (o === null ? null : o.getNextSibling()); if (M(i) && i.isShadowRoot()) return !0 } return !1 } deleteCharacter(e) { let t = this.isCollapsed(); if (this.isCollapsed()) { let r = this.anchor, o = r.getNode(); if (this.forwardDeletion(r, o, e)) return; let i = Hl(Hn(r, e ? "previous" : "next")); if (i.getTextSlices().every(a => a === null || a.distance === 0)) { let a = { type: "initial" }; for (let l of i.iterNodeCarets("shadowRoot")) if (Kt(l)) { if (!l.origin.isInline()) { if (l.origin.isShadowRoot()) { if (a.type === "merge-block") break; if (M(i.anchor.origin) && i.anchor.origin.isEmpty()) { let c = Pt(l); Wo(this, Kn(c, c)), i.anchor.origin.remove() } return } a.type !== "merge-next-block" && a.type !== "merge-block" || (a = { block: a.block, caret: l, type: "merge-block" }) } } else { if (a.type === "merge-block") break; if (mr(l)) { if (M(l.origin)) { if (l.origin.isInline()) { if (!l.origin.isParentOf(i.anchor.origin)) break } else a = { block: l.origin, type: "merge-next-block" }; continue } if (Ce(l.origin)) { if (!l.origin.isIsolated()) if (a.type === "merge-next-block" && (l.origin.isKeyboardSelectable() || !l.origin.isInline()) && M(i.anchor.origin) && i.anchor.origin.isEmpty()) { i.anchor.origin.remove(); let c = Ol(); c.add(l.origin.getKey()), Ct(c) } else l.origin.remove(); return } break } } if (a.type === "merge-block") { let { caret: l, block: c } = a; return Wo(this, Kn(!l.origin.isEmpty() && c.isEmpty() ? oo(We(c, l.direction)) : i.anchor, l)), this.removeText() } } let s = this.focus; if (this.modify("extend", e, "character"), this.isCollapsed()) { if (e && r.offset === 0 && Uu(this, r.getNode())) return } else { let a = s.type === "text" ? s.getNode() : null; if (o = r.type === "text" ? r.getNode() : null, a !== null && a.isSegmented()) { let l = s.offset, c = a.getTextContentSize(); if (a.is(o) || e && l !== c || !e && l !== 0) return void Wu(a, e, l) } else if (o !== null && o.isSegmented()) { let l = r.offset, c = o.getTextContentSize(); if (o.is(a) || e && l !== 0 || !e && l !== c) return void Wu(o, e, l) } (function (l, c) { let u = l.anchor, p = l.focus, g = u.getNode(), f = p.getNode(); if (g === f && u.type === "text" && p.type === "text") { let d = u.offset, m = p.offset, h = d < m, _ = h ? d : m, C = h ? m : d, y = C - 1; _ !== y && function (x) { return !(Of(x) || iC(x)) }(g.getTextContent().slice(_, C)) && (c ? p.set(p.key, y, p.type) : u.set(u.key, y, u.type)) } })(this, e) } } if (this.removeText(), e && !t && this.isCollapsed() && this.anchor.type === "element" && this.anchor.offset === 0) { let r = this.anchor.getNode(); r.isEmpty() && pt(r.getParent()) && r.getPreviousSibling() === null && Uu(this, r) } } deleteLine(e) { this.isCollapsed() && this.modify("extend", e, "lineboundary"), this.isCollapsed() ? this.deleteCharacter(e) : this.removeText() } deleteWord(e) { if (this.isCollapsed()) { let t = this.anchor, r = t.getNode(); if (this.forwardDeletion(t, r, e)) return; this.modify("extend", e, "word") } this.removeText() } isBackward() { return this.focus.isBefore(this.anchor) } getStartEndPoints() { return [this.anchor, this.focus] } }; function ds(n) { return n instanceof qi } function zu(n) { let e = n.offset; if (n.type === "text") return e; let t = n.getNode(); return e === t.getChildrenSize() ? t.getTextContent().length : 0 } function ol(n) { let e = n.getStartEndPoints(); if (e === null) return [0, 0]; let [t, r] = e; return t.type === "element" && r.type === "element" && t.key === r.key && t.offset === r.offset ? [0, 0] : [zu(t), zu(r)] } function Uu(n, e) { for (let t = e; t; t = t.getParent()) { if (M(t)) { if (t.collapseAtStart(n)) return !0; if (zt(t)) break } if (t.getPreviousSibling()) break } return !1 } var iC = (() => { try { let n = new RegExp("\\p{Emoji}", "u"), e = n.test.bind(n); if (e("\u2764\uFE0F") && e("#\uFE0F\u20E3") && e("\u{1F44D}")) return e } catch { } return () => !1 })(); function Wu(n, e, t) { let r = n, o = r.getTextContent().split(/(?=\s)/g), i = o.length, s = 0, a = 0; for (let c = 0; c < i; c++) { let u = c === i - 1; if (a = s, s += o[c].length, e && s === t || s > t || u) { o.splice(c, 1), u && (a = void 0); break } } let l = o.join("").trim(); l === "" ? r.remove() : (r.setTextContent(l), r.select(a, a)) } function Gu(n, e, t, r) { let o, i = e; if (it(n)) { let s = !1, a = n.childNodes, l = a.length, c = r._blockCursorElement; i === l && (s = !0, i = l - 1); let u = a[i], p = !1; if (u === c) u = a[i + 1], p = !0; else if (c !== null) { let g = c.parentNode; n === g && e > Array.prototype.indexOf.call(g.children, c) && i-- } if (o = Ir(u), B(o)) i = id(o, s); else { let g = Ir(n); if (g === null) return null; if (M(g)) { let f = r.getElementByKey(g.getKey()); f === null && R(214), [g, i] = g.getDOMSlot(f).resolveChildIndex(g, f, n, e), M(g) || R(215), s && i >= g.getChildrenSize() && (i = Math.max(0, g.getChildrenSize() - 1)); let m = g.getChildAtIndex(i); if (M(m) && function (h, _, C) { let y = h.getParent(); return C === null || y === null || !y.canBeEmpty() || y !== C.getNode() }(m, 0, t)) { let h = s ? m.getLastDescendant() : m.getFirstDescendant(); h === null ? g = m : (m = h, g = M(m) ? m : m.getParentOrThrow()), i = 0 } B(m) ? (o = m, g = null, i = id(m, s)) : m !== g && s && !p && (M(g) || R(216), i = Math.min(g.getChildrenSize(), i + 1)) } else { let f = g.getIndexWithinParent(); i = e === 0 && Ce(g) && Ir(n) === g ? f : f + 1, g = g.getParentOrThrow() } if (M(g)) return Ht(g.__key, i, "element") } } else o = Ir(n); return B(o) ? Ht(o.__key, i, "text") : null } function Yu(n, e, t) { let r = n.offset, o = n.getNode(); if (r === 0) { let i = o.getPreviousSibling(), s = o.getParent(); if (e) { if ((t || !e) && i === null && M(s) && s.isInline()) { let a = s.getPreviousSibling(); B(a) && n.set(a.__key, a.getTextContent().length, "text") } } else M(i) && !t && i.isInline() ? n.set(i.__key, i.getChildrenSize(), "element") : B(i) && n.set(i.__key, i.getTextContent().length, "text") } else if (r === o.getTextContent().length) { let i = o.getNextSibling(), s = o.getParent(); if (e && M(i) && i.isInline()) n.set(i.__key, 0, "element"); else if ((t || e) && i === null && M(s) && s.isInline() && !s.canInsertTextAfter()) { let a = s.getNextSibling(); B(a) && n.set(a.__key, 0, "text") } } } function af(n, e, t) { if (n.type === "text" && e.type === "text") { let r = n.isBefore(e), o = n.is(e); Yu(n, r, o), Yu(e, !r, o), o && e.set(n.key, n.offset, n.type); let i = Se(); if (i.isComposing() && i._compositionKey !== n.key && J(t)) { let s = t.anchor, a = t.focus; n.set(s.key, s.offset, s.type, !0), e.set(a.key, a.offset, a.type, !0) } } } function lf(n, e, t, r, o, i) { if (n === null || t === null || !ti(o, n, t)) return null; let s = Gu(n, e, J(i) ? i.anchor : null, o); if (s === null) return null; let a = Gu(t, r, J(i) ? i.focus : null, o); if (a === null) return null; if (s.type === "element" && a.type === "element") { let l = Ir(n), c = Ir(t); if (Ce(l) && Ce(c)) return null } return af(s, a, i), [s, a] } function sC(n) { return M(n) && !n.isInline() } function cf(n, e, t, r, o, i) { let s = Nn(), a = new gr(Ht(n, e, o), Ht(t, r, i), 0, ""); return a.dirty = !0, s._selection = a, a } function uf() { let n = Ht("root", 0, "element"), e = Ht("root", 0, "element"); return new gr(n, e, 0, "") } function Ol() { return new qi(new Set) } function aC(n, e) { return fs(null, n, e, null) } function fs(n, e, t, r) { let o = t._window; if (o === null) return null; let i = r || o.event, s = i ? i.type : void 0, a = s === "selectionchange", l = !Ka && (a || s === "beforeinput" || s === "compositionstart" || s === "compositionend" || s === "click" && i && i.detail === 3 || s === "drop" || s === void 0), c, u, p, g; if (J(n) && !l) return n.clone(); if (e === null) return null; if (c = e.anchorNode, u = e.focusNode, p = e.anchorOffset, g = e.focusOffset, a && J(n) && !ti(t, c, u)) return n.clone(); let f = lf(c, p, u, g, t, n); if (f === null) return null; let [d, m] = f; return new gr(d, m, J(n) ? n.format : 0, J(n) ? n.style : "") } function ue() { return Nn()._selection } function Cr() { return Se()._editorState._selection } function Zi(n, e, t, r = 1) { let o = n.anchor, i = n.focus, s = o.getNode(), a = i.getNode(); if (!e.is(s) && !e.is(a)) return; let l = e.__key; if (n.isCollapsed()) { let c = o.offset; if (t <= c && r > 0 || t < c && r < 0) { let u = Math.max(0, c + r); o.set(l, u, "element"), i.set(l, u, "element"), ju(n) } } else { let c = n.isBackward(), u = c ? i : o, p = u.getNode(), g = c ? o : i, f = g.getNode(); if (e.is(p)) { let d = u.offset; (t <= d && r > 0 || t < d && r < 0) && u.set(l, Math.max(0, d + r), "element") } if (e.is(f)) { let d = g.offset; (t <= d && r > 0 || t < d && r < 0) && g.set(l, Math.max(0, d + r), "element") } } ju(n) } function ju(n) { let e = n.anchor, t = e.offset, r = n.focus, o = r.offset, i = e.getNode(), s = r.getNode(); if (n.isCollapsed()) { if (!M(i)) return; let a = i.getChildrenSize(), l = t >= a, c = l ? i.getChildAtIndex(a - 1) : i.getChildAtIndex(t); if (B(c)) { let u = 0; l && (u = c.getTextContentSize()), e.set(c.__key, u, "text"), r.set(c.__key, u, "text") } } else { if (M(i)) { let a = i.getChildrenSize(), l = t >= a, c = l ? i.getChildAtIndex(a - 1) : i.getChildAtIndex(t); if (B(c)) { let u = 0; l && (u = c.getTextContentSize()), e.set(c.__key, u, "text") } } if (M(s)) { let a = s.getChildrenSize(), l = o >= a, c = l ? s.getChildAtIndex(a - 1) : s.getChildAtIndex(o); if (B(c)) { let u = 0; l && (u = c.getTextContentSize()), r.set(c.__key, u, "text") } } } } function Qi(n, e, t, r, o) { let i = null, s = 0, a = null; r !== null ? (i = r.__key, B(r) ? (s = r.getTextContentSize(), a = "text") : M(r) && (s = r.getChildrenSize(), a = "element")) : o !== null && (i = o.__key, B(o) ? a = "text" : M(o) && (a = "element")), i !== null && a !== null ? n.set(i, s, a) : (s = e.getIndexWithinParent(), s === -1 && (s = t.getChildrenSize()), n.set(t.__key, s, "element")) } function Ju(n, e, t, r, o) { n.type === "text" ? n.set(t, n.offset + (e ? 0 : o), "text") : n.offset > r.getIndexWithinParent() && n.set(n.key, n.offset - 1, "element") } function df(n, e, t, r, o) { try { n.setBaseAndExtent(e, t, r, o) } catch { } } function lC(n, e, t, r, o, i, s) { let a = r.anchorNode, l = r.focusNode, c = r.anchorOffset, u = r.focusOffset, p = document.activeElement; if (o.has(_f) && p !== i || p !== null && Ml(p)) return; if (!J(e)) return void (n !== null && ti(t, a, l) && r.removeAllRanges()); let g = e.anchor, f = e.focus, d = g.key, m = f.key, h = Xr(t, d), _ = Xr(t, m), C = g.offset, y = f.offset, x = e.format, b = e.style, S = e.isCollapsed(), N = h, A = _, O = !1; if (g.type === "text") { N = pr(h); let W = g.getNode(); O = W.getFormat() !== x || W.getStyle() !== b } else J(n) && n.anchor.type === "text" && (O = !0); var F, L, G, U, K; if (f.type === "text" && (A = pr(_)), N !== null && A !== null && (S && (n === null || O || J(n) && (n.format !== x || n.style !== b)) && (F = x, L = b, G = C, U = d, K = performance.now(), qd = [F, L, G, U, K]), c !== C || u !== y || a !== N || l !== A || r.type === "Range" && S || (p !== null && i.contains(p) || i.focus({ preventScroll: !0 }), g.type === "element"))) { if (df(r, N, C, A, y), !o.has(Cf) && e.isCollapsed() && i !== null && i === document.activeElement) { let W = J(e) && e.anchor.type === "element" ? N.childNodes[C] || null : r.rangeCount > 0 ? r.getRangeAt(0) : null; if (W !== null) { let q; if (W instanceof Text) { let de = document.createRange(); de.selectNode(W), q = de.getBoundingClientRect() } else q = W.getBoundingClientRect(); (function (de, ae, le) { let Qe = Il(le), Je = Pl(Qe); if (Qe === null || Je === null) return; let { top: dt, bottom: Be } = ae, ke = 0, ft = 0, Oe = le; for (; Oe !== null;) { let re = Oe === Qe.body; if (re) ke = 0, ft = Rt(de).innerHeight; else { let Re = Oe.getBoundingClientRect(); ke = Re.top, ft = Re.bottom } let ye = 0; if (dt < ke ? ye = -(ke - dt) : Be > ft && (ye = Be - ft), ye !== 0) if (re) Je.scrollBy(0, ye); else { let Re = Oe.scrollTop; Oe.scrollTop += ye; let Ve = Oe.scrollTop - Re; dt -= Ve, Be -= Ve } if (re) break; Oe = ri(Oe) } })(t, q, i) } } el = !0 } } function cC(n) { let e = ue() || Cr(); e === null && (e = _t().selectEnd()), e.insertNodes(n) } function uC() { let n = ue(); return n === null ? "" : n.getTextContent() } function Fa(n) { let e = n; n.isCollapsed() || e.removeText(); let t = ue(); J(t) && (e = t), J(e) || R(161); let r = e.anchor, o = r.getNode(), i = r.offset; for (; !pn(o);) { let s = o; if ([o, i] = dC(o, i), s.is(o)) break } return i } function dC(n, e) { let t = n.getParent(); if (!t) { let o = mn(); return _t().append(o), o.select(), [_t(), 0] } if (B(n)) { let o = n.splitText(e); if (o.length === 0) return [t, n.getIndexWithinParent()]; let i = e === 0 ? 0 : 1; return [t, o[0].getIndexWithinParent() + i] } if (!M(n) || e === 0) return [t, n.getIndexWithinParent()]; let r = n.getChildAtIndex(e); if (r) { let o = new gr(Ht(n.__key, e, "element"), Ht(n.__key, e, "element"), 0, ""), i = n.insertNewAfter(o); i && i.append(r, ...r.getNextSiblings()) } return [t, n.getIndexWithinParent() + 1] } function Vu(n, e, t, r, o = "decorators-and-blocks") { if (e === "move" && r === "character" && !n.isCollapsed()) { let [u, p] = t === n.isBackward() ? [n.focus, n.anchor] : [n.anchor, n.focus]; return p.set(u.key, u.offset, u.type), !0 } let i = Hn(n.focus, t ? "previous" : "next"), s = r === "lineboundary", a = e === "move", l = i, c = o === "decorators-and-blocks"; if (!jf(l)) { for (let u of l) { c = !1; let { origin: p } = u; if (!Ce(p) || p.isIsolated() || (l = u, !s || !p.isInline())) break } if (c) for (let u of Hl(i).iterNodeCarets(e === "extend" ? "shadowRoot" : "root")) { if (Kt(u)) u.origin.isInline() || (l = u); else { if (M(u.origin)) continue; Ce(u.origin) && !u.origin.isInline() && (l = u) } break } } if (l === i) return !1; if (a && !s && Ce(l.origin) && l.origin.isKeyboardSelectable()) { let u = Ol(); return u.add(l.origin.getKey()), Ct(u), !0 } return l = Pt(l), a && to(n.anchor, l), to(n.focus, l), c || !s } var ze = null, Ue = null, mt = !1, La = !1, Bi = 0, Xu = { characterData: !0, childList: !0, subtree: !0 }; function no() { return mt || ze !== null && ze._readOnly } function Xe() { mt && R(13) } function ff() { Bi > 99 && R(14) } function Nn() { return ze === null && R(195, gf()), ze } function Se() { return Ue === null && R(196, gf()), Ue } function gf() { let n = 0, e = new Set, t = Vr.version; if (typeof window < "u") for (let o of document.querySelectorAll("[contenteditable]")) { let i = ni(o); if (gs(i)) n++; else if (i) { let s = String(i.constructor.version || "<0.17.1"); s === t && (s += " (separately built, likely a bundler configuration issue)"), e.add(s) } } let r = ` Detected on the page: ${n} compatible editor(s) with version ${t}`; return e.size && (r += ` and incompatible editors with versions ${Array.from(e).join(", ")}`), r } function fC() { return Ue } function qu(n, e, t) { let r = e.__type, o = function (a, l) { let c = a._nodes.get(l); return c === void 0 && R(30, l), c }(n, r), i = t.get(r); i === void 0 && (i = Array.from(o.transforms), t.set(r, i)); let s = i.length; for (let a = 0; a < s && (i[a](e), e.isAttached()); a++); } function Zu(n, e) { return n !== void 0 && n.__key !== e && n.isAttached() } function hf(n, e) { if (!e) return; let t = n._updateTags, r = e; Array.isArray(e) || (r = [e]); for (let o of r) t.add(o) } function gC(n) { return vl(n, Se()._nodes) } function vl(n, e) { let t = n.type, r = e.get(t); r === void 0 && R(17, t); let o = r.klass; n.type !== o.getType() && R(18, o.name); let i = o.importJSON(n), s = n.children; if (M(i) && Array.isArray(s)) for (let a = 0; a < s.length; a++) { let l = vl(s[a], e); i.append(l) } return i } function Qu(n, e, t) { let r = ze, o = mt, i = Ue; ze = e, mt = !0, Ue = n; try { return t() } finally { ze = r, mt = o, Ue = i } } function hn(n, e) { let t = n._pendingEditorState, r = n._rootElement, o = n._headless || r === null; if (t === null) return; let i = n._editorState, s = i._selection, a = t._selection, l = n._dirtyType !== ur, c = ze, u = mt, p = Ue, g = n._updating, f = n._observer, d = null; if (n._pendingEditorState = null, n._editorState = t, !o && l && f !== null) { Ue = n, ze = t, mt = !1, n._updating = !0; try { let S = n._dirtyType, N = n._dirtyElements, A = n._dirtyLeaves; f.disconnect(), d = H_(i, t, n, S, N, A) } catch (S) { if (S instanceof Error && n._onError(S), La) throw S; return Nf(n, null, r, t), Sd(n), n._dirtyType = zr, La = !0, hn(n, i), void (La = !1) } finally { f.observe(r, Xu), n._updating = g, ze = c, mt = u, Ue = p } } t._readOnly || (t._readOnly = !0); let m = n._dirtyLeaves, h = n._dirtyElements, _ = n._normalizedNodes, C = n._updateTags, y = n._deferred; l && (n._dirtyType = ur, n._cloneNotNeeded.clear(), n._dirtyLeaves = new Set, n._dirtyElements = new Map, n._normalizedNodes = new Set, n._updateTags = new Set), function (S, N) { let A = S._decorators, O = S._pendingDecorators || A, F = N._nodeMap, L; for (L in O) F.has(L) || (O === A && (O = bf(S)), delete O[L]) }(n, t); let x = o ? null : Zt(Rt(n)); if (n._editable && x !== null && (l || a === null || a.dirty) && r !== null && !C.has(yf)) { Ue = n, ze = t; try { if (f !== null && f.disconnect(), l || a === null || a.dirty) { let S = n._blockCursorElement; S !== null && sl(S, n, r), lC(s, a, n, x, C, r) } (function (S, N, A) { let O = S._blockCursorElement; if (J(A) && A.isCollapsed() && A.anchor.type === "element" && N.contains(document.activeElement)) { let F = A.anchor, L = F.getNode(), G = F.offset, U = !1, K = null; if (G === L.getChildrenSize()) Ia(L.getChildAtIndex(G - 1)) && (U = !0); else { let W = L.getChildAtIndex(G); if (W !== null && Ia(W)) { let q = W.getPreviousSibling(); (q === null || Ia(q)) && (U = !0, K = S.getElementByKey(W.__key)) } } if (U) { let W = S.getElementByKey(L.__key); return O === null && (S._blockCursorElement = O = function (q) { let de = q.theme, ae = document.createElement("div"); ae.contentEditable = "false", ae.setAttribute("data-lexical-cursor", "true"); let le = de.blockCursor; if (le !== void 0) { if (typeof le == "string") { let Qe = Ui(le); le = de.blockCursor = Qe } le !== void 0 && ae.classList.add(...le) } return ae }(S._config)), N.style.caretColor = "transparent", void (K === null ? W.appendChild(O) : W.insertBefore(O, K)) } } O !== null && sl(O, S, N) })(n, r, a) } finally { f !== null && f.observe(r, Xu), Ue = p, ze = c } } d !== null && function (S, N, A, O, F) { let L = Array.from(S._listeners.mutation), G = L.length; for (let U = 0; U < G; U++) { let [K, W] = L[U], q = N.get(W); q !== void 0 && K(q, { dirtyLeaves: O, prevEditorState: F, updateTags: A }) } }(n, d, C, m, i), J(a) || a === null || s !== null && s.is(a) || n.dispatchCommand(Nl, void 0); let b = n._pendingDecorators; b !== null && (n._decorators = b, n._pendingDecorators = null, zo("decorator", n, !0, b)), function (S, N, A) { let O = od(N), F = od(A); O !== F && zo("textcontent", S, !0, F) }(n, e || i, t), zo("update", n, !0, { dirtyElements: h, dirtyLeaves: m, editorState: t, mutatedNodes: d, normalizedNodes: _, prevEditorState: e || i, tags: C }), function (S, N) { if (S._deferred = [], N.length !== 0) { let A = S._updating; S._updating = !0; try { for (let O = 0; O < N.length; O++)N[O]() } finally { S._updating = A } } }(n, y), function (S) { let N = S._updates; if (N.length !== 0) { let A = N.shift(); if (A) { let [O, F] = A; Dl(S, O, F) } } }(n) } function zo(n, e, t, ...r) { let o = e._updating; e._updating = t; try { let i = Array.from(e._listeners[n]); for (let s = 0; s < i.length; s++)i[s].apply(null, r) } finally { e._updating = o } } function ed(n, e) { let t = n._updates, r = e || !1; for (; t.length !== 0;) { let o = t.shift(); if (o) { let [i, s] = o, a; if (s !== void 0) { if (a = s.onUpdate, s.skipTransforms && (r = !0), s.discrete) { let l = n._pendingEditorState; l === null && R(191), l._flushSync = !0 } a && n._deferred.push(a), hf(n, s.tag) } i() } } return r } function Dl(n, e, t) { let r = n._updateTags, o, i = !1, s = !1; t !== void 0 && (o = t.onUpdate, hf(n, t.tag), i = t.skipTransforms || !1, s = t.discrete || !1), o && n._deferred.push(o); let a = n._editorState, l = n._pendingEditorState, c = !1; (l === null || l._readOnly) && (l = n._pendingEditorState = pf(l || a), c = !0), l._flushSync = s; let u = ze, p = mt, g = Ue, f = n._updating; ze = l, mt = !1, n._updating = !0, Ue = n; let d = n._headless || n.getRootElement() === null; try { c && (d ? a._selection !== null && (l._selection = a._selection.clone()) : l._selection = function (C, y) { let x = C.getEditorState()._selection, b = Zt(Rt(C)); return J(x) || x == null ? fs(x, b, C, y) : x.clone() }(n, t && t.event || null)); let h = n._compositionKey; e(), i = ed(n, i), function (C, y) { let x = y.getEditorState()._selection, b = C._selection; if (J(b)) { let S = b.anchor, N = b.focus, A; if (S.type === "text" && (A = S.getNode(), A.selectionTransform(x, b)), N.type === "text") { let O = N.getNode(); A !== O && O.selectionTransform(x, b) } } }(l, n), n._dirtyType !== ur && (i ? function (C, y) { let x = y._dirtyLeaves, b = C._nodeMap; for (let S of x) { let N = b.get(S); B(N) && N.isAttached() && N.isSimpleText() && !N.isUnmergeable() && Mu(N) } }(l, n) : function (C, y) { let x = y._dirtyLeaves, b = y._dirtyElements, S = C._nodeMap, N = Ln(), A = new Map, O = x, F = O.size, L = b, G = L.size; for (; F > 0 || G > 0;) { if (F > 0) { y._dirtyLeaves = new Set; for (let U of O) { let K = S.get(U); B(K) && K.isAttached() && K.isSimpleText() && !K.isUnmergeable() && Mu(K), K !== void 0 && Zu(K, N) && qu(y, K, A), x.add(U) } if (O = y._dirtyLeaves, F = O.size, F > 0) { Bi++; continue } } y._dirtyLeaves = new Set, y._dirtyElements = new Map, L.delete("root") && L.set("root", !0); for (let U of L) { let K = U[0], W = U[1]; if (b.set(K, W), !W) continue; let q = S.get(K); q !== void 0 && Zu(q, N) && qu(y, q, A) } O = y._dirtyLeaves, F = O.size, L = y._dirtyElements, G = L.size, Bi++ } y._dirtyLeaves = x, y._dirtyElements = b }(l, n), ed(n), function (C, y, x, b) { let S = C._nodeMap, N = y._nodeMap, A = []; for (let [O] of b) { let F = N.get(O); F !== void 0 && (F.isAttached() || (M(F) && yd(F, O, S, N, A, b), S.has(O) || b.delete(O), A.push(O))) } for (let O of A) N.delete(O); for (let O of x) { let F = N.get(O); F === void 0 || F.isAttached() || (S.has(O) || x.delete(O), N.delete(O)) } }(a, l, n._dirtyLeaves, n._dirtyElements)), h !== n._compositionKey && (l._flushSync = !0); let _ = l._selection; if (J(_)) { let C = l._nodeMap, y = _.anchor.key, x = _.focus.key; C.get(y) !== void 0 && C.get(x) !== void 0 || R(19) } else ds(_) && _._nodes.size === 0 && (l._selection = null) } catch (h) { return h instanceof Error && n._onError(h), n._pendingEditorState = a, n._dirtyType = zr, n._cloneNotNeeded.clear(), n._dirtyLeaves = new Set, n._dirtyElements.clear(), void hn(n) } finally { ze = u, mt = p, Ue = g, n._updating = f, Bi = 0 } n._dirtyType !== ur || n._deferred.length > 0 || function (h, _) { let C = _.getEditorState()._selection, y = h._selection; if (y !== null) { if (y.dirty || !y.is(C)) return !0 } else if (C !== null) return !0; return !1 }(l, n) ? l._flushSync ? (l._flushSync = !1, hn(n)) : c && OC(() => { hn(n) }) : (l._flushSync = !1, c && (r.clear(), n._deferred = [], n._pendingEditorState = null)) } function Ot(n, e, t) { Ue === n && t === void 0 ? e() : Dl(n, e, t) } var il = class n { constructor(e, t, r) { this.element = e, this.before = t || null, this.after = r || null } withBefore(e) { return new n(this.element, e, this.after) } withAfter(e) { return new n(this.element, this.before, e) } withElement(e) { return this.element === e ? this : new n(e, this.before, this.after) } insertChild(e) { let t = this.before || this.getManagedLineBreak(); return t !== null && t.parentElement !== this.element && R(222), this.element.insertBefore(e, t), this } removeChild(e) { return e.parentElement !== this.element && R(223), this.element.removeChild(e), this } replaceChild(e, t) { return t.parentElement !== this.element && R(224), this.element.replaceChild(e, t), this } getFirstChild() { let e = this.after ? this.after.nextSibling : this.element.firstChild; return e === this.before || e === this.getManagedLineBreak() ? null : e } getManagedLineBreak() { return this.element.__lexicalLineBreak || null } setManagedLineBreak(e) { if (e === null) this.removeManagedLineBreak(); else { let t = e === "decorator" && (Hr || Go); this.insertManagedLineBreak(t) } } removeManagedLineBreak() { let e = this.getManagedLineBreak(); if (e) { let t = this.element, r = e.nodeName === "IMG" ? e.nextSibling : null; r && t.removeChild(r), t.removeChild(e), t.__lexicalLineBreak = void 0 } } insertManagedLineBreak(e) { let t = this.getManagedLineBreak(); if (t) { if (e === (t.nodeName === "IMG")) return; this.removeManagedLineBreak() } let r = this.element, o = this.before, i = document.createElement("br"); if (r.insertBefore(i, o), e) { let s = document.createElement("img"); s.setAttribute("data-lexical-linebreak", "true"), s.style.cssText = "display: inline !important; border: 0px !important; margin: 0px !important;", s.alt = "", r.insertBefore(s, i), r.__lexicalLineBreak = s } else r.__lexicalLineBreak = i } getFirstChildOffset() { let e = 0; for (let t = this.after; t !== null; t = t.previousSibling)e++; return e } resolveChildIndex(e, t, r, o) { if (r === this.element) { let l = this.getFirstChildOffset(); return [e, Math.min(l + e.getChildrenSize(), Math.max(l, o))] } let i = td(t, r); i.push(o); let s = td(t, this.element), a = e.getIndexWithinParent(); for (let l = 0; l < s.length; l++) { let c = i[l], u = s[l]; if (c === void 0 || c < u) break; if (c > u) { a += 1; break } } return [e.getParentOrThrow(), a] } }; function td(n, e) { let t = [], r = e; for (; r !== n && r !== null; r = e.parentNode) { let o = 0; for (let i = r.previousSibling; i !== null; i = i.previousSibling)o++; t.push(o) } return r !== n && R(225), t.reverse() } var hr = class extends Ur { constructor(e) { super(e), this.__first = null, this.__last = null, this.__size = 0, this.__format = 0, this.__style = "", this.__indent = 0, this.__dir = null, this.__textFormat = 0, this.__textStyle = "" } afterCloneFrom(e) { super.afterCloneFrom(e), this.__first = e.__first, this.__last = e.__last, this.__size = e.__size, this.__indent = e.__indent, this.__format = e.__format, this.__style = e.__style, this.__dir = e.__dir, this.__textFormat = e.__textFormat, this.__textStyle = e.__textStyle } getFormat() { return this.getLatest().__format } getFormatType() { let e = this.getFormat(); return O_[e] || "" } getStyle() { return this.getLatest().__style } getIndent() { return this.getLatest().__indent } getChildren() { let e = [], t = this.getFirstChild(); for (; t !== null;)e.push(t), t = t.getNextSibling(); return e } getChildrenKeys() { let e = [], t = this.getFirstChild(); for (; t !== null;)e.push(t.__key), t = t.getNextSibling(); return e } getChildrenSize() { return this.getLatest().__size } isEmpty() { return this.getChildrenSize() === 0 } isDirty() { let e = Se()._dirtyElements; return e !== null && e.has(this.__key) } isLastChild() { let e = this.getLatest(), t = this.getParentOrThrow().getLastChild(); return t !== null && t.is(e) } getAllTextNodes() { let e = [], t = this.getFirstChild(); for (; t !== null;) { if (B(t) && e.push(t), M(t)) { let r = t.getAllTextNodes(); e.push(...r) } t = t.getNextSibling() } return e } getFirstDescendant() { let e = this.getFirstChild(); for (; M(e);) { let t = e.getFirstChild(); if (t === null) break; e = t } return e } getLastDescendant() { let e = this.getLastChild(); for (; M(e);) { let t = e.getLastChild(); if (t === null) break; e = t } return e } getDescendantByIndex(e) { let t = this.getChildren(), r = t.length; if (e >= r) { let i = t[r - 1]; return M(i) && i.getLastDescendant() || i || null } let o = t[e]; return M(o) && o.getFirstDescendant() || o || null } getFirstChild() { let e = this.getLatest().__first; return e === null ? null : Le(e) } getFirstChildOrThrow() { let e = this.getFirstChild(); return e === null && R(45, this.__key), e } getLastChild() { let e = this.getLatest().__last; return e === null ? null : Le(e) } getLastChildOrThrow() { let e = this.getLastChild(); return e === null && R(96, this.__key), e } getChildAtIndex(e) { let t = this.getChildrenSize(), r, o; if (e < t / 2) { for (r = this.getFirstChild(), o = 0; r !== null && o <= e;) { if (o === e) return r; r = r.getNextSibling(), o++ } return null } for (r = this.getLastChild(), o = t - 1; r !== null && o >= e;) { if (o === e) return r; r = r.getPreviousSibling(), o-- } return null } getTextContent() { let e = "", t = this.getChildren(), r = t.length; for (let o = 0; o < r; o++) { let i = t[o]; e += i.getTextContent(), M(i) && o !== r - 1 && !i.isInline() && (e += Cn) } return e } getTextContentSize() { let e = 0, t = this.getChildren(), r = t.length; for (let o = 0; o < r; o++) { let i = t[o]; e += i.getTextContentSize(), M(i) && o !== r - 1 && !i.isInline() && (e += Cn.length) } return e } getDirection() { return this.getLatest().__dir } getTextFormat() { return this.getLatest().__textFormat } hasFormat(e) { if (e !== "") { let t = vu[e]; return !!(this.getFormat() & t) } return !1 } hasTextFormat(e) { let t = et[e]; return !!(this.getTextFormat() & t) } getFormatFlags(e, t) { return rs(this.getLatest().__textFormat, e, t) } getTextStyle() { return this.getLatest().__textStyle } select(e, t) { Xe(); let r = ue(), o = e, i = t, s = this.getChildrenSize(); if (!this.canBeEmpty()) { if (e === 0 && t === 0) { let l = this.getFirstChild(); if (B(l) || M(l)) return l.select(0, 0) } else if (!(e !== void 0 && e !== s || t !== void 0 && t !== s)) { let l = this.getLastChild(); if (B(l) || M(l)) return l.select() } } o === void 0 && (o = s), i === void 0 && (i = s); let a = this.__key; return J(r) ? (r.anchor.set(a, o, "element"), r.focus.set(a, i, "element"), r.dirty = !0, r) : cf(a, o, a, i, "element", "element") } selectStart() { let e = this.getFirstDescendant(); return e ? e.selectStart() : this.select() } selectEnd() { let e = this.getLastDescendant(); return e ? e.selectEnd() : this.select() } clear() { let e = this.getWritable(); return this.getChildren().forEach(t => t.remove()), e } append(...e) { return this.splice(this.getChildrenSize(), 0, e) } setDirection(e) { let t = this.getWritable(); return t.__dir = e, t } setFormat(e) { return this.getWritable().__format = e !== "" ? vu[e] : 0, this } setStyle(e) { return this.getWritable().__style = e || "", this } setTextFormat(e) { let t = this.getWritable(); return t.__textFormat = e, t } setTextStyle(e) { let t = this.getWritable(); return t.__textStyle = e, t } setIndent(e) { return this.getWritable().__indent = e, this } splice(e, t, r) { let o = r.length, i = this.getChildrenSize(), s = this.getWritable(); e + t <= i || R(226, String(e), String(t), String(i)); let a = s.__key, l = [], c = [], u = this.getChildAtIndex(e + t), p = null, g = i - t + o; if (e !== 0) if (e === i) p = this.getLastChild(); else { let d = this.getChildAtIndex(e); d !== null && (p = d.getPreviousSibling()) } if (t > 0) { let d = p === null ? this.getFirstChild() : p.getNextSibling(); for (let m = 0; m < t; m++) { d === null && R(100); let h = d.getNextSibling(), _ = d.__key; In(d.getWritable()), c.push(_), d = h } } let f = p; for (let d = 0; d < o; d++) { let m = r[d]; f !== null && m.is(f) && (p = f = f.getPreviousSibling()); let h = m.getWritable(); h.__parent === a && g--, In(h); let _ = m.__key; if (f === null) s.__first = _, h.__prev = null; else { let C = f.getWritable(); C.__next = _, h.__prev = C.__key } m.__key === a && R(76), h.__parent = a, l.push(_), f = m } if (e + t === i) f !== null && (f.getWritable().__next = null, s.__last = f.__key); else if (u !== null) { let d = u.getWritable(); if (f !== null) { let m = f.getWritable(); d.__prev = f.__key, m.__next = u.__key } else d.__prev = null } if (s.__size = g, c.length) { let d = ue(); if (J(d)) { let m = new Set(c), h = new Set(l), { anchor: _, focus: C } = d; nd(_, m, h) && Qi(_, _.getNode(), this, p, u), nd(C, m, h) && Qi(C, C.getNode(), this, p, u), g !== 0 || this.canBeEmpty() || zt(this) || this.remove() } } return s } getDOMSlot(e) { return new il(e) } exportDOM(e) { let { element: t } = super.exportDOM(e); if (it(t)) { let r = this.getIndent(); r > 0 && (t.style.paddingInlineStart = 40 * r + "px"); let o = this.getDirection(); o && (t.dir = o) } return { element: t } } exportJSON() { let e = { children: [], direction: this.getDirection(), format: this.getFormatType(), indent: this.getIndent(), ...super.exportJSON() }, t = this.getTextFormat(), r = this.getTextStyle(); return t !== 0 && (e.textFormat = t), r !== "" && (e.textStyle = r), e } updateFromJSON(e) { return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat || 0).setTextStyle(e.textStyle || "") } insertNewAfter(e, t) { return null } canIndent() { return !0 } collapseAtStart(e) { return !1 } excludeFromCopy(e) { return !1 } canReplaceWith(e) { return !0 } canInsertAfter(e) { return !0 } canBeEmpty() { return !0 } canInsertTextBefore() { return !0 } canInsertTextAfter() { return !0 } isInline() { return !1 } isShadowRoot() { return !1 } canMergeWith(e) { return !1 } extractWithChild(e, t, r) { return !1 } canMergeWhenEmpty() { return !1 } reconcileObservedMutation(e, t) { let r = this.getDOMSlot(e), o = r.getFirstChild(); for (let i = this.getFirstChild(); i; i = i.getNextSibling()) { let s = t.getElementByKey(i.getKey()); s !== null && (o == null ? (r.insertChild(s), o = s) : o !== s && r.replaceChild(s, o), o = o.nextSibling) } } }; function M(n) { return n instanceof hr } function nd(n, e, t) { let r = n.getNode(); for (; r;) { let o = r.__key; if (e.has(o) && !t.has(o)) return !0; r = r.getParent() } return !1 } var es = class extends Ur { decorate(e, t) { R(47) } isIsolated() { return !1 } isInline() { return !0 } isKeyboardSelectable() { return !0 } }; function Ce(n) { return n instanceof es } var jr = class n extends hr { static getType() { return "root" } static clone() { return new n } constructor() { super("root"), this.__cachedText = null } getTopLevelElementOrThrow() { R(51) } getTextContent() { let e = this.__cachedText; return !no() && Se()._dirtyType !== ur || e === null ? super.getTextContent() : e } remove() { R(52) } replace(e) { R(53) } insertBefore(e) { R(54) } insertAfter(e) { R(55) } updateDOM(e, t) { return !1 } splice(e, t, r) { for (let o of r) M(o) || Ce(o) || R(282); return super.splice(e, t, r) } static importJSON(e) { return _t().updateFromJSON(e) } collapseAtStart() { return !0 } }; function pt(n) { return n instanceof jr } function pf(n) { return new ts(new Map(n._nodeMap)) } function wl() { return new ts(new Map([["root", new jr]])) } function mf(n) { let e = n.exportJSON(), t = n.constructor; if (e.type !== t.getType() && R(130, t.name), M(n)) { let r = e.children; Array.isArray(r) || R(59, t.name); let o = n.getChildren(); for (let i = 0; i < o.length; i++) { let s = mf(o[i]); r.push(s) } } return e } var ts = class n { constructor(e, t) { this._nodeMap = e, this._selection = t || null, this._flushSync = !1, this._readOnly = !1 } isEmpty() { return this._nodeMap.size === 1 && this._selection === null } read(e, t) { return Qu(t && t.editor || null, this, e) } clone(e) { let t = new n(this._nodeMap, e === void 0 ? this._selection : e); return t._readOnly = !0, t } toJSON() { return Qu(null, this, () => ({ root: mf(_t()) })) } }, hC = "historic", pC = "history-push", Ki = "history-merge", mC = "paste", _f = "collaboration", _C = "skip-collab", Cf = "skip-scroll-into-view", yf = "skip-dom-selection", ns = class extends hr { static getType() { return "artificial" } createDOM(e) { return document.createElement("div") } }, Jr = class n extends hr { static getType() { return "paragraph" } static clone(e) { return new n(e.__key) } createDOM(e) { let t = document.createElement("p"), r = Kr(e.theme, "paragraph"); return r !== void 0 && t.classList.add(...r), t } updateDOM(e, t, r) { return !1 } static importDOM() { return { p: e => ({ conversion: CC, priority: 0 }) } } exportDOM(e) { let { element: t } = super.exportDOM(e); if (it(t)) { this.isEmpty() && t.append(document.createElement("br")); let r = this.getFormatType(); t.style.textAlign = r } return { element: t } } static importJSON(e) { return mn().updateFromJSON(e) } exportJSON() { return { ...super.exportJSON(), textFormat: this.getTextFormat(), textStyle: this.getTextStyle() } } insertNewAfter(e, t) { let r = mn(); r.setTextFormat(e.format), r.setTextStyle(e.style); let o = this.getDirection(); return r.setDirection(o), r.setFormat(this.getFormatType()), r.setStyle(this.getStyle()), this.insertAfter(r, t), r } collapseAtStart() { let e = this.getChildren(); if (e.length === 0 || B(e[0]) && e[0].getTextContent().trim() === "") { if (this.getNextSibling() !== null) return this.selectNext(), this.remove(), !0; if (this.getPreviousSibling() !== null) return this.selectPrevious(), this.remove(), !0 } return !1 } }; function CC(n) { let e = mn(); return n.style && (e.setFormat(n.style.textAlign), Hf(n, e)), { node: e } } function mn() { return oi(new Jr) } function yC(n) { return n instanceof Jr } var NC = 0, xC = 1, SC = 2, TC = 3, EC = 4; function Nf(n, e, t, r) { let o = n._keyToDOMMap; o.clear(), n._editorState = wl(), n._pendingEditorState = r, n._compositionKey = null, n._dirtyType = ur, n._cloneNotNeeded.clear(), n._dirtyLeaves = new Set, n._dirtyElements.clear(), n._normalizedNodes = new Set, n._updateTags = new Set, n._updates = [], n._blockCursorElement = null; let i = n._observer; i !== null && (i.disconnect(), n._observer = null), e !== null && (e.textContent = ""), t !== null && (t.textContent = "", o.set("root", t)) } function bC(n) { let e = n || {}, t = fC(), r = e.theme || {}, o = n === void 0 ? t : e.parentEditor || null, i = e.disableEvents || !1, s = wl(), a = e.namespace || (o !== null ? o._config.namespace : vf()), l = e.editorState, c = [jr, fr, Wr, Yr, Jr, ns, ...e.nodes || []], { onError: u, html: p } = e, g = e.editable === void 0 || e.editable, f; if (n === void 0 && t !== null) f = t._nodes; else { f = new Map; for (let m = 0; m < c.length; m++) { let h = c[m], _ = null, C = null; if (typeof h != "function") { let S = h; h = S.replace, _ = S.with, C = S.withKlass || null } let y = h.getType(), x = h.transform(), b = new Set; x !== null && b.add(x), f.set(y, { exportDOM: p && p.export ? p.export.get(h) : void 0, klass: h, replace: _, replaceWithKlass: C, transforms: b }) } } let d = new Vr(s, o, f, { disableEvents: i, namespace: a, theme: r }, u || console.error, function (m, h) { let _ = new Map, C = new Set, y = x => { Object.keys(x).forEach(b => { let S = _.get(b); S === void 0 && (S = [], _.set(b, S)), S.push(x[b]) }) }; return m.forEach(x => { let b = x.klass.importDOM; if (b == null || C.has(b)) return; C.add(b); let S = b.call(x.klass); S !== null && y(S) }), h && y(h), _ }(f, p ? p.import : void 0), g, n); return l !== void 0 && (d._pendingEditorState = l, d._dirtyType = zr), d } var Vr = class { constructor(e, t, r, o, i, s, a, l) { this._createEditorArgs = l, this._parentEditor = t, this._rootElement = null, this._editorState = e, this._pendingEditorState = null, this._compositionKey = null, this._deferred = [], this._keyToDOMMap = new Map, this._updates = [], this._updating = !1, this._listeners = { decorator: new Set, editable: new Set, mutation: new Map, root: new Set, textcontent: new Set, update: new Set }, this._commands = new Map, this._config = o, this._nodes = r, this._decorators = {}, this._pendingDecorators = null, this._dirtyType = ur, this._cloneNotNeeded = new Set, this._dirtyLeaves = new Set, this._dirtyElements = new Map, this._normalizedNodes = new Set, this._updateTags = new Set, this._observer = null, this._key = vf(), this._onError = i, this._htmlConversions = s, this._editable = a, this._headless = t !== null && t._headless, this._window = null, this._blockCursorElement = null } isComposing() { return this._compositionKey != null } registerUpdateListener(e) { let t = this._listeners.update; return t.add(e), () => { t.delete(e) } } registerEditableListener(e) { let t = this._listeners.editable; return t.add(e), () => { t.delete(e) } } registerDecoratorListener(e) { let t = this._listeners.decorator; return t.add(e), () => { t.delete(e) } } registerTextContentListener(e) { let t = this._listeners.textcontent; return t.add(e), () => { t.delete(e) } } registerRootListener(e) { let t = this._listeners.root; return e(this._rootElement, null), t.add(e), () => { e(null, this._rootElement), t.delete(e) } } registerCommand(e, t, r) { r === void 0 && R(35); let o = this._commands; o.has(e) || o.set(e, [new Set, new Set, new Set, new Set, new Set]); let i = o.get(e); i === void 0 && R(36, String(e)); let s = i[r]; return s.add(t), () => { s.delete(t), i.every(a => a.size === 0) && o.delete(e) } } registerMutationListener(e, t, r) { let o = this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass, i = this._listeners.mutation; i.set(t, o); let s = r && r.skipInitialization; return s !== void 0 && s || this.initializeMutationListener(t, o), () => { i.delete(t) } } getRegisteredNode(e) { let t = this._nodes.get(e.getType()); return t === void 0 && R(37, e.name), t } resolveRegisteredNodeAfterReplacements(e) { for (; e.replaceWithKlass;)e = this.getRegisteredNode(e.replaceWithKlass); return e } initializeMutationListener(e, t) { let r = this._editorState, o = ll(r).get(t.getType()); if (!o) return; let i = new Map; for (let s of o.keys()) i.set(s, "created"); i.size > 0 && e(i, { dirtyLeaves: new Set, prevEditorState: r, updateTags: new Set(["registerMutationListener"]) }) } registerNodeTransformToKlass(e, t) { let r = this.getRegisteredNode(e); return r.transforms.add(t), r } registerNodeTransform(e, t) { let r = this.registerNodeTransformToKlass(e, t), o = [r], i = r.replaceWithKlass; if (i != null) { let s = this.registerNodeTransformToKlass(i, t); o.push(s) } return function (s, a) { let l = ll(s.getEditorState()), c = []; for (let u of a) { let p = l.get(u); p && c.push(p) } c.length !== 0 && s.update(() => { for (let u of c) for (let p of u.keys()) { let g = Le(p); g && g.markDirty() } }, s._pendingEditorState === null ? { tag: Ki } : void 0) }(this, o.map(s => s.klass.getType())), () => { o.forEach(s => s.transforms.delete(t)) } } hasNode(e) { return this._nodes.has(e.getType()) } hasNodes(e) { return e.every(this.hasNode.bind(this)) } dispatchCommand(e, t) { return I(this, e, t) } getDecorators() { return this._decorators } getRootElement() { return this._rootElement } getKey() { return this._key } setRootElement(e) { let t = this._rootElement; if (e !== t) { let r = Kr(this._config.theme, "root"), o = this._pendingEditorState || this._editorState; if (this._rootElement = e, Nf(this, t, e, o), t !== null && (this._config.disableEvents || Z_(t), r != null && t.classList.remove(...r)), e !== null) { let i = Pl(e), s = e.style; s.userSelect = "text", s.whiteSpace = "pre-wrap", s.wordBreak = "break-word", e.setAttribute("data-lexical-editor", "true"), this._window = i, this._dirtyType = zr, Sd(this), this._updateTags.add(Ki), hn(this), this._config.disableEvents || function (a, l) { let c = a.ownerDocument, u = Xi.get(c); (u === void 0 || u < 1) && c.addEventListener("selectionchange", nf), Xi.set(c, (u || 0) + 1), a.__lexicalEditor = l; let p = tf(a); for (let g = 0; g < Qa.length; g++) { let [f, d] = Qa[g], m = typeof d == "function" ? h => { Iu(h) || ($u(h), (l.isEditable() || f === "click") && d(h, l)) } : h => { if (Iu(h)) return; $u(h); let _ = l.isEditable(); switch (f) { case "cut": return _ && I(l, bl, h); case "copy": return I(l, El, h); case "paste": return _ && I(l, xl, h); case "dragstart": return _ && I(l, Ud, h); case "dragover": return _ && I(l, Wd, h); case "dragend": return _ && I(l, Gd, h); case "focus": return _ && I(l, Yd, h); case "blur": return _ && I(l, jd, h); case "drop": return _ && I(l, zd, h) } }; a.addEventListener(f, m), p.push(() => { a.removeEventListener(f, m) }) } }(e, this), r != null && e.classList.add(...r) } else this._window = null, this._updateTags.add(Ki), hn(this); zo("root", this, !1, e, t) } } getElementByKey(e) { return this._keyToDOMMap.get(e) || null } getEditorState() { return this._editorState } setEditorState(e, t) { e.isEmpty() && R(38); let r = e; r._readOnly && (r = pf(e), r._selection = e._selection ? e._selection.clone() : null), xd(this); let o = this._pendingEditorState, i = this._updateTags, s = t !== void 0 ? t.tag : null; o === null || o.isEmpty() || (s != null && i.add(s), hn(this)), this._pendingEditorState = r, this._dirtyType = zr, this._dirtyElements.set("root", !1), this._compositionKey = null, s != null && i.add(s), this._updating || hn(this) } parseEditorState(e, t) { return function (r, o, i) { let s = wl(), a = ze, l = mt, c = Ue, u = o._dirtyElements, p = o._dirtyLeaves, g = o._cloneNotNeeded, f = o._dirtyType; o._dirtyElements = new Map, o._dirtyLeaves = new Set, o._cloneNotNeeded = new Set, o._dirtyType = 0, ze = s, mt = !1, Ue = o; try { let d = o._nodes; vl(r.root, d), i && i(), s._readOnly = !0 } catch (d) { d instanceof Error && o._onError(d) } finally { o._dirtyElements = u, o._dirtyLeaves = p, o._cloneNotNeeded = g, o._dirtyType = f, ze = a, mt = l, Ue = c } return s }(typeof e == "string" ? JSON.parse(e) : e, this, t) } read(e) { return hn(this), this.getEditorState().read(e, { editor: this }) } update(e, t) { (function (r, o, i) { r._updating ? r._updates.push([o, i]) : Dl(r, o, i) })(this, e, t) } focus(e, t = {}) { let r = this._rootElement; r !== null && (r.setAttribute("autocapitalize", "off"), Ot(this, () => { let o = ue(), i = _t(); o !== null ? o.dirty || Ct(o.clone()) : i.getChildrenSize() !== 0 && (t.defaultSelection === "rootStart" ? i.selectStart() : i.selectEnd()), Rf("focus"), Ff(() => { r.removeAttribute("autocapitalize"), e && e() }) }), this._pendingEditorState === null && r.removeAttribute("autocapitalize")) } blur() { let e = this._rootElement; e !== null && e.blur(); let t = Zt(this._window); t !== null && t.removeAllRanges() } isEditable() { return this._editable } setEditable(e) { this._editable !== e && (this._editable = e, zo("editable", this, !0, e)) } toJSON() { return { editorState: this._editorState.toJSON() } } }; Vr.version = "0.31.0+prod.esm"; var xf = 1; function AC() { xf = 1 } var OC = typeof queueMicrotask == "function" ? queueMicrotask : n => { Promise.resolve().then(n) }; function rd(n) { return Ce(ps(n)) } function Ml(n) { let e = document.activeElement; if (!it(e)) return !1; let t = e.nodeName; return Ce(ps(n)) && (t === "INPUT" || t === "TEXTAREA" || e.contentEditable === "true" && ni(e) == null) } function ti(n, e, t) { let r = n.getRootElement(); try { return r !== null && r.contains(e) && r.contains(t) && e !== null && !Ml(e) && kl(e) === n } catch { return !1 } } function gs(n) { return n instanceof Vr } function kl(n) { let e = n; for (; e != null;) { let t = ni(e); if (gs(t)) return t; e = ri(e) } return null } function ni(n) { return n ? n.__lexicalEditor : null } function lr(n) { return n.isToken() || n.isSegmented() } function Qt(n) { return ro(n) && n.nodeType === f_ } function Sf(n) { return ro(n) && n.nodeType === g_ } function pr(n) { let e = n; for (; e != null;) { if (Qt(e)) return e; e = e.firstChild } return null } function rs(n, e, t) { let r = et[e]; if (t !== null && (n & r) == (t & r)) return n; let o = n ^ r; return e === "subscript" ? o &= ~et.superscript : e === "superscript" ? o &= ~et.subscript : e === "lowercase" ? (o &= ~et.uppercase, o &= ~et.capitalize) : e === "uppercase" ? (o &= ~et.lowercase, o &= ~et.capitalize) : e === "capitalize" && (o &= ~et.lowercase, o &= ~et.uppercase), o } function vC(n) { return B(n) || cr(n) || Ce(n) } function Tf(n, e) { if (e != null) return void (n.__key = e); Xe(), ff(); let t = Se(), r = Nn(), o = "" + xf++; r._nodeMap.set(o, n), M(n) ? t._dirtyElements.set(o, !0) : t._dirtyLeaves.add(o), t._cloneNotNeeded.add(o), t._dirtyType = hd, n.__key = o } function In(n) { let e = n.getParent(); if (e !== null) { let t = n.getWritable(), r = e.getWritable(), o = n.getPreviousSibling(), i = n.getNextSibling(), s = i !== null ? i.__key : null, a = o !== null ? o.__key : null, l = o !== null ? o.getWritable() : null, c = i !== null ? i.getWritable() : null; o === null && (r.__first = s), i === null && (r.__last = a), l !== null && (l.__next = s), c !== null && (c.__prev = a), t.__prev = null, t.__next = null, t.__parent = null, r.__size-- } } function os(n) { ff(); let e = n.getLatest(), t = e.__parent, r = Nn(), o = Se(), i = r._nodeMap, s = o._dirtyElements; t !== null && function (l, c, u) { let p = l; for (; p !== null;) { if (u.has(p)) return; let g = c.get(p); if (g === void 0) break; u.set(p, !1), p = g.__parent } }(t, i, s); let a = e.__key; o._dirtyType = hd, M(n) ? s.set(a, !0) : o._dirtyLeaves.add(a) } function He(n) { Xe(); let e = Se(), t = e._compositionKey; if (n !== t) { if (e._compositionKey = n, t !== null) { let r = Le(t); r !== null && r.getWritable() } if (n !== null) { let r = Le(n); r !== null && r.getWritable() } } } function Ln() { return no() ? null : Se()._compositionKey } function Le(n, e) { let t = (e || Nn())._nodeMap.get(n); return t === void 0 ? null : t } function Ef(n, e) { let t = hs(n, Se()); return t !== void 0 ? Le(t, e) : null } function hs(n, e) { return n[`__lexicalKey_${e._key}`] } function ps(n, e) { let t = n; for (; t != null;) { let r = Ef(t, e); if (r !== null) return r; t = ri(t) } return null } function bf(n) { let e = n._decorators, t = Object.assign({}, e); return n._pendingDecorators = t, t } function od(n) { return n.read(() => _t().getTextContent()) } function _t() { return Af(Nn()) } function Af(n) { return n._nodeMap.get("root") } function Ct(n) { Xe(); let e = Nn(); n !== null && (n.dirty = !0, n.setCachedNodes(null)), e._selection = n } function Ir(n) { let e = Se(), t = function (r, o) { let i = r; for (; i != null;) { let s = hs(i, o); if (s !== void 0) return s; i = ri(i) } return null }(n, e); return t === null ? n === e.getRootElement() ? Le("root") : null : Le(t) } function id(n, e) { return e ? n.getTextContentSize() : 0 } function Of(n) { return /[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n) } function Rl(n) { let e = [], t = n; for (; t !== null;)e.push(t), t = t._parentEditor; return e } function vf() { return Math.random().toString(36).replace(/[^a-z]+/g, "").substring(0, 5) } function Df(n) { return Qt(n) ? n.nodeValue : null } function Fl(n, e, t) { let r = Zt(Rt(e)); if (r === null) return; let o = r.anchorNode, { anchorOffset: i, focusOffset: s } = r; if (o !== null) { let a = Df(o), l = ps(o); if (a !== null && B(l)) { if (a === ls && t) { let c = t.length; a = t, i = c, s = c } a !== null && Ll(l, a, i, s, n) } } } function Ll(n, e, t, r, o) { let i = n; if (i.isAttached() && (o || !i.isDirty())) { let s = i.isComposing(), a = e; (s || o) && e[e.length - 1] === ls && (a = e.slice(0, -1)); let l = i.getTextContent(); if (o || a !== l) { if (a === "") { if (He(null), Go || Hr || zi) i.remove(); else { let m = Se(); setTimeout(() => { m.update(() => { i.isAttached() && i.remove() }) }, 20) } return } let c = i.getParent(), u = Cr(), p = i.getTextContentSize(), g = Ln(), f = i.getKey(); if (i.isToken() || g !== null && f === g && !s || J(u) && (c !== null && !c.canInsertTextBefore() && u.anchor.offset === 0 || u.anchor.key === n.__key && u.anchor.offset === 0 && !i.canInsertTextBefore() && !s || u.focus.key === n.__key && u.focus.offset === p && !i.canInsertTextAfter() && !s)) return void i.markDirty(); let d = ue(); if (!J(d) || t === null || r === null) return void i.setTextContent(a); if (d.setTextNodeRange(i, t, i, r), i.isSegmented()) { let m = Ke(i.getTextContent()); i.replace(m), i = m } i.setTextContent(a) } } } function Li(n, e, t) { let r = e[t] || !1; return r === "any" || r === n[t] } function wf(n, e) { return Li(n, e, "altKey") && Li(n, e, "ctrlKey") && Li(n, e, "shiftKey") && Li(n, e, "metaKey") } function ge(n, e, t) { return wf(n, t) && n.key.toLowerCase() === e.toLowerCase() } var fn = { ctrlKey: !qt, metaKey: qt }, sd = { altKey: qt, ctrlKey: !qt }; function ad(n) { return n.key === "Backspace" } function ld(n) { return ge(n, "a", fn) } function DC(n) { let e = _t(); if (J(n)) { let t = n.anchor, r = n.focus, o = t.getNode().getTopLevelElementOrThrow().getParentOrThrow(); return t.set(o.getKey(), 0, "element"), r.set(o.getKey(), o.getChildrenSize(), "element"), Gi(n), n } { let t = e.select(0, e.getChildrenSize()); return Ct(Gi(t)), t } } function Kr(n, e) { n.__lexicalClassNameCache === void 0 && (n.__lexicalClassNameCache = {}); let t = n.__lexicalClassNameCache, r = t[e]; if (r !== void 0) return r; let o = n[e]; if (typeof o == "string") { let i = Ui(o); return t[e] = i, i } return o } function $l(n, e, t, r, o) { if (t.size === 0) return; let i = r.__type, s = r.__key, a = e.get(i); a === void 0 && R(33, i); let l = a.klass, c = n.get(l); c === void 0 && (c = new Map, n.set(l, c)); let u = c.get(s), p = u === "destroyed" && o === "created"; (u === void 0 || p) && c.set(s, p ? "updated" : o) } function wC(n) { let e = n.getType(), t = Nn(); if (t._readOnly) { let i = ll(t).get(e); return i ? Array.from(i.values()) : [] } let r = t._nodeMap, o = []; for (let [, i] of r) i instanceof n && i.__type === e && i.isAttached() && o.push(i); return o } function cd(n, e, t) { let r = n.getParent(), o = t, i = n; return r !== null && (e && t === 0 ? (o = i.getIndexWithinParent(), i = r) : e || t !== i.getChildrenSize() || (o = i.getIndexWithinParent() + 1, i = r)), i.getChildAtIndex(e ? o - 1 : o) } function Mf(n, e) { let t = n.offset; if (n.type === "element") return cd(n.getNode(), e, t); { let r = n.getNode(); if (e && t === 0 || !e && t === r.getTextContentSize()) { let o = e ? r.getPreviousSibling() : r.getNextSibling(); return o === null ? cd(r.getParentOrThrow(), e, r.getIndexWithinParent() + (e ? 0 : 1)) : o } } return null } function kf(n) { let e = Rt(n).event, t = e && e.inputType; return t === "insertFromPaste" || t === "insertFromPasteAsQuotation" } function I(n, e, t) { return function (r, o, i) { let s = Rl(r); for (let a = 4; a >= 0; a--)for (let l = 0; l < s.length; l++) { let c = s[l], u = c._commands.get(o); if (u !== void 0) { let p = u[a]; if (p !== void 0) { let g = Array.from(p), f = g.length, d = !1; if (Ot(c, () => { for (let m = 0; m < f; m++)if (g[m](i, r)) return void (d = !0) }), d) return d } } } return !1 }(n, e, t) } function ms(n) { return !pt(n) && !n.isLastChild() && !n.isInline() } function Xr(n, e) { let t = n._keyToDOMMap.get(e); return t === void 0 && R(75, e), t } function ri(n) { let e = n.assignedSlot || n.parentElement; return Pf(e) ? e.host : e } function Il(n) { return Sf(n) ? n : it(n) ? n.ownerDocument : null } function MC(n) { return Se()._updateTags.has(n) } function Rf(n) { Xe(), Se()._updateTags.add(n) } function Ff(n) { Xe(), Se()._deferred.push(n) } function is(n, e) { let t = n.getParent(); for (; t !== null;) { if (t.is(e)) return !0; t = t.getParent() } return !1 } function Pl(n) { let e = Il(n); return e ? e.defaultView : null } function Rt(n) { let e = n._window; return e === null && R(78), e } function kC(n) { return M(n) && n.isInline() || Ce(n) && n.isInline() } function Lf(n) { let e = n.getParentOrThrow(); for (; e !== null;) { if (zt(e)) return e; e = e.getParentOrThrow() } return e } function zt(n) { return pt(n) || M(n) && n.isShadowRoot() } function Bl(n) { let e = n.constructor.clone(n); return Tf(e, null), e } function oi(n) { let e = Se(), t = n.constructor.getType(), r = e._nodes.get(t); r === void 0 && R(200, n.constructor.name, t); let { replace: o, replaceWithKlass: i } = r; if (o !== null) { let s = o(n), a = s.constructor; return i !== null ? s instanceof i || R(201, i.name, i.getType(), a.name, a.getType(), n.constructor.name, t) : s instanceof n.constructor && a !== n.constructor || R(202, a.name, a.getType(), n.constructor.name, t), s.__key === n.__key && R(203, n.constructor.name, t, a.name, a.getType()), s } return n } function $a(n, e) { !pt(n.getParent()) || M(e) || Ce(e) || R(99) } function $f(n) { let e = Le(n); return e === null && R(63, n), e } function Ia(n) { return (Ce(n) || M(n) && !n.canBeEmpty()) && !n.isInline() } function sl(n, e, t) { t.style.removeProperty("caret-color"), e._blockCursorElement = null; let r = n.parentElement; r !== null && r.removeChild(n) } function Zt(n) { return Ut ? (n || window).getSelection() : null } function If(n) { let e = Pl(n); return e ? e.getSelection() : null } function RC(n, e) { let t = n.getChildAtIndex(e); t == null && (t = n), zt(n) && R(102); let r = s => { let a = s.getParentOrThrow(), l = zt(a), c = s !== t || l ? Bl(s) : s; if (l) return M(s) && M(c) || R(133), s.insertAfter(c), [s, c, c]; { let [u, p, g] = r(a), f = s.getNextSiblings(); return g.append(c, ...f), [u, p, c] } }, [o, i] = r(t); return [o, i] } function FC(n) { return it(n) && n.tagName === "A" } function it(n) { return ro(n) && n.nodeType === d_ } function ro(n) { return typeof n == "object" && n !== null && "nodeType" in n && typeof n.nodeType == "number" } function Pf(n) { return ro(n) && n.nodeType === h_ } function Bf(n) { let e = 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"); return n.nodeName.match(e) !== null } function al(n) { let e = 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"); return n.nodeName.match(e) !== null } function pn(n) { if (Ce(n) && !n.isInline()) return !0; if (!M(n) || zt(n)) return !1; let e = n.getFirstChild(), t = e === null || cr(e) || B(e) || e.isInline(); return !n.isInline() && n.canBeEmpty() !== !1 && t } function Pa(n, e) { let t = n; for (; t !== null && t.getParent() !== null && !e(t);)t = t.getParentOrThrow(); return e(t) ? t : null } function LC() { return Se() } var ud = new WeakMap, $C = new Map; function ll(n) { if (!n._readOnly && n.isEmpty()) return $C; n._readOnly || R(192); let e = ud.get(n); return e || (e = function (t) { let r = new Map; for (let [o, i] of t._nodeMap) { let s = i.__type, a = r.get(s); a || (a = new Map, r.set(s, a)), a.set(o, i) } return r }(n), ud.set(n, e)), e } function Kf(n) { let e = n.constructor.clone(n); return e.afterCloneFrom(n), e } function Hf(n, e) { let t = parseInt(n.style.paddingInlineStart, 10) || 0, r = Math.round(t / 40); e.setIndent(r) } function IC(n) { n.__lexicalUnmanaged = !0 } function zf(n) { return n.__lexicalUnmanaged === !0 } var PC = { next: "previous", previous: "next" }, qr = class { constructor(e) { this.origin = e } [Symbol.iterator]() { return zl({ hasNext: mr, initial: this.getAdjacentCaret(), map: e => e, step: e => e.getAdjacentCaret() }) } getAdjacentCaret() { return We(this.getNodeAtCaret(), this.direction) } getSiblingCaret() { return We(this.origin, this.direction) } remove() { let e = this.getNodeAtCaret(); return e && e.remove(), this } replaceOrInsert(e, t) { let r = this.getNodeAtCaret(); return e.is(this.origin) || e.is(r) || (r === null ? this.insert(e) : r.replace(e, t)), this } splice(e, t, r = "next") { let o = r === this.direction ? t : Array.from(t).reverse(), i = this, s = this.getParentAtCaret(), a = new Map; for (let l = i.getAdjacentCaret(); l !== null && a.size < e; l = l.getAdjacentCaret()) { let c = l.origin.getWritable(); a.set(c.getKey(), c) } for (let l of o) { if (a.size > 0) { let c = i.getNodeAtCaret(); if (c) { if (a.delete(c.getKey()), a.delete(l.getKey()), !(c.is(l) || i.origin.is(l))) { let u = l.getParent(); u && u.is(s) && l.remove(), c.replace(l) } } else c === null && R(263, Array.from(a).join(" ")) } else i.insert(l); i = We(l, this.direction) } for (let l of a.values()) l.remove(); return this } }, ei = class n extends qr { constructor() { super(...arguments); kt(this, "type", "child") } getLatest() { let t = this.origin.getLatest(); return t === this.origin ? this : yn(t, this.direction) } getParentCaret(t = "root") { return We(Kl(this.getParentAtCaret(), t), this.direction) } getFlipped() { let t = Un(this.direction); return We(this.getNodeAtCaret(), t) || yn(this.origin, t) } getParentAtCaret() { return this.origin } getChildCaret() { return this } isSameNodeCaret(t) { return t instanceof n && this.direction === t.direction && this.origin.is(t.origin) } isSamePointCaret(t) { return this.isSameNodeCaret(t) } }, BC = { root: pt, shadowRoot: zt }; function Un(n) { return PC[n] } function Kl(n, e = "root") { return BC[e](n) ? null : n } var Zr = class n extends qr { constructor() { super(...arguments); kt(this, "type", "sibling") } getLatest() { let t = this.origin.getLatest(); return t === this.origin ? this : We(t, this.direction) } getSiblingCaret() { return this } getParentAtCaret() { return this.origin.getParent() } getChildCaret() { return M(this.origin) ? yn(this.origin, this.direction) : null } getParentCaret(t = "root") { return We(Kl(this.getParentAtCaret(), t), this.direction) } getFlipped() { let t = Un(this.direction); return We(this.getNodeAtCaret(), t) || yn(this.origin.getParentOrThrow(), t) } isSamePointCaret(t) { return t instanceof n && this.direction === t.direction && this.origin.is(t.origin) } isSameNodeCaret(t) { return (t instanceof n || t instanceof Qr) && this.direction === t.direction && this.origin.is(t.origin) } }, Qr = class n extends qr { constructor(t, r) { super(t); kt(this, "type", "text"); this.offset = r } getLatest() { let t = this.origin.getLatest(); return t === this.origin ? this : Bn(t, this.direction, this.offset) } getParentAtCaret() { return this.origin.getParent() } getChildCaret() { return null } getParentCaret(t = "root") { return We(Kl(this.getParentAtCaret(), t), this.direction) } getFlipped() { return Bn(this.origin, Un(this.direction), this.offset) } isSamePointCaret(t) { return t instanceof n && this.direction === t.direction && this.origin.is(t.origin) && this.offset === t.offset } isSameNodeCaret(t) { return (t instanceof Zr || t instanceof n) && this.direction === t.direction && this.origin.is(t.origin) } getSiblingCaret() { return We(this.origin, this.direction) } }; function _n(n) { return n instanceof Qr } function KC(n) { return n instanceof qr } function mr(n) { return n instanceof Zr } function Kt(n) { return n instanceof ei } var HC = { next: class extends Qr { constructor() { super(...arguments); kt(this, "direction", "next") } getNodeAtCaret() { return this.origin.getNextSibling() } insert(e) { return this.origin.insertAfter(e), this } }, previous: class extends Qr { constructor() { super(...arguments); kt(this, "direction", "previous") } getNodeAtCaret() { return this.origin.getPreviousSibling() } insert(e) { return this.origin.insertBefore(e), this } } }, zC = { next: class extends Zr { constructor() { super(...arguments); kt(this, "direction", "next") } getNodeAtCaret() { return this.origin.getNextSibling() } insert(e) { return this.origin.insertAfter(e), this } }, previous: class extends Zr { constructor() { super(...arguments); kt(this, "direction", "previous") } getNodeAtCaret() { return this.origin.getPreviousSibling() } insert(e) { return this.origin.insertBefore(e), this } } }, UC = { next: class extends ei { constructor() { super(...arguments); kt(this, "direction", "next") } getNodeAtCaret() { return this.origin.getFirstChild() } insert(e) { return this.origin.splice(0, 0, [e]), this } }, previous: class extends ei { constructor() { super(...arguments); kt(this, "direction", "previous") } getNodeAtCaret() { return this.origin.getLastChild() } insert(e) { return this.origin.splice(this.origin.getChildrenSize(), 0, [e]), this } } }; function We(n, e) { return n ? new zC[e](n) : null } function Bn(n, e, t) { return n ? new HC[e](n, _r(n, t)) : null } function _r(n, e) { let t = n.getTextContentSize(), r = e === "next" ? t : e === "previous" ? 0 : e; return (r < 0 || r > t) && (function (o, ...i) { let s = new URL("https://lexical.dev/docs/error"), a = new URLSearchParams; a.append("code", o); for (let l of i) a.append("v", l); s.search = a.toString(), console.warn(`Minified Lexical warning #${o}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`) }(284, String(e), String(t), n.getKey()), r = r < 0 ? 0 : t), r } function cl(n, e) { return new ss(n, e) } function yn(n, e) { return M(n) ? new UC[e](n) : null } function Uf(n) { return n && n.getChildCaret() || n } function eo(n) { return n && Uf(n.getAdjacentCaret()) } var ul = class n { constructor(e, t, r) { kt(this, "type", "node-caret-range"); this.anchor = e, this.focus = t, this.direction = r } getLatest() { let e = this.anchor.getLatest(), t = this.focus.getLatest(); return e === this.anchor && t === this.focus ? this : new n(e, t, this.direction) } isCollapsed() { return this.anchor.isSamePointCaret(this.focus) } getTextSlices() { let e = o => { let i = this[o].getLatest(); return _n(i) ? function (s, a) { let { direction: l, origin: c } = s, u = _r(c, a === "focus" ? Un(l) : l); return cl(s, u - s.offset) }(i, o) : null }, t = e("anchor"), r = e("focus"); if (t && r) { let { caret: o } = t, { caret: i } = r; if (o.isSameNodeCaret(i)) return [cl(o, i.offset - o.offset), null] } return [t, r] } iterNodeCarets(e = "root") { let t = _n(this.anchor) ? this.anchor.getSiblingCaret() : this.anchor.getLatest(), r = this.focus.getLatest(), o = _n(r), i = s => s.isSameNodeCaret(r) ? null : eo(s) || s.getParentCaret(e); return zl({ hasNext: s => s !== null && !(o && r.isSameNodeCaret(s)), initial: t.isSameNodeCaret(r) ? null : i(t), map: s => s, step: i }) } [Symbol.iterator]() { return this.iterNodeCarets("root") } }, ss = class { constructor(e, t) { kt(this, "type", "slice"); this.caret = e, this.distance = t } getSliceIndices() { let { distance: e, caret: { offset: t } } = this, r = t + e; return r < t ? [r, t] : [t, r] } getTextContent() { let [e, t] = this.getSliceIndices(); return this.caret.origin.getTextContent().slice(e, t) } getTextContentSize() { return Math.abs(this.distance) } removeTextSlice() { let { caret: { origin: e, direction: t } } = this, [r, o] = this.getSliceIndices(), i = e.getTextContent(); return Bn(e.setTextContent(i.slice(0, r) + i.slice(o)), t, r) } }; function WC(n) { return n instanceof ss } function Hl(n) { return Kn(n, We(_t(), n.direction)) } function Wf(n) { return Kn(n, n) } function Kn(n, e) { return n.direction !== e.direction && R(265), new ul(n, e, n.direction) } function zl(n) { let { initial: e, hasNext: t, step: r, map: o } = n, i = e; return { [Symbol.iterator]() { return this }, next() { if (!t(i)) return { done: !0, value: void 0 }; let s = { done: !1, value: o(i) }; return i = r(i), s } } } function Ul(n, e) { let t = Uo(n.origin, e.origin); switch (t === null && R(275, n.origin.getKey(), e.origin.getKey()), t.type) { case "same": { let r = n.type === "text", o = e.type === "text"; return r && o ? function (i, s) { return Math.sign(i - s) }(n.offset, e.offset) : n.type === e.type ? 0 : r ? -1 : o ? 1 : n.type === "child" ? -1 : 1 } case "ancestor": return n.type === "child" ? -1 : 1; case "descendant": return e.type === "child" ? 1 : -1; case "branch": return Wl(t) } } function Wl(n) { let { a: e, b: t } = n, r = e.__key, o = t.__key, i = e, s = t; for (; i && s; i = i.getNextSibling(), s = s.getNextSibling()) { if (i.__key === o) return -1; if (s.__key === r) return 1 } return i === null ? 1 : -1 } function $i(n, e) { return e.is(n) } function dd(n) { return M(n) ? [n.getLatest(), null] : [n.getParent(), n.getLatest()] } function Uo(n, e) { if (n.is(e)) return { commonAncestor: n, type: "same" }; let t = new Map; for (let [r, o] = dd(n); r; o = r, r = r.getParent())t.set(r, o); for (let [r, o] = dd(e); r; o = r, r = r.getParent()) { let i = t.get(r); if (i !== void 0) return i === null ? ($i(n, r) || R(276), { commonAncestor: r, type: "ancestor" }) : o === null ? ($i(e, r) || R(277), { commonAncestor: r, type: "descendant" }) : ((M(i) || $i(n, i)) && (M(o) || $i(e, o)) && r.is(i.getParent()) && r.is(o.getParent()) || R(278), { a: i, b: o, commonAncestor: r, type: "branch" }) } return null } function Hn(n, e) { let { type: t, key: r, offset: o } = n, i = $f(n.key); return t === "text" ? (B(i) || R(266, i.getType(), r), Bn(i, e, o)) : (M(i) || R(267, i.getType(), r), Jf(i, n.offset, e)) } function to(n, e) { let { origin: t, direction: r } = e, o = r === "next"; _n(e) ? n.set(t.getKey(), e.offset, "text") : mr(e) ? B(t) ? n.set(t.getKey(), _r(t, r), "text") : n.set(t.getParentOrThrow().getKey(), t.getIndexWithinParent() + (o ? 1 : 0), "element") : (Kt(e) && M(t) || R(268), n.set(t.getKey(), o ? 0 : t.getChildrenSize(), "element")) } function Gf(n) { let e = ue(), t = J(e) ? e : uf(); return Wo(t, n), Ct(t), t } function Wo(n, e) { to(n.anchor, e.anchor), to(n.focus, e.focus) } function dl(n) { let { anchor: e, focus: t } = n, r = Hn(e, "next"), o = Hn(t, "next"), i = Ul(r, o) <= 0 ? "next" : "previous"; return Kn(zn(r, i), zn(o, i)) } function oo(n) { let { direction: e, origin: t } = n, r = We(t, Un(e)).getNodeAtCaret(); return r ? We(r, e) : yn(t.getParentOrThrow(), e) } function fd(n, e = "root") { let t = [n]; for (let r = Kt(n) ? n.getParentCaret(e) : n.getSiblingCaret(); r !== null; r = r.getParentCaret(e))t.push(oo(r)); return t } function Ba(n) { return !!n && n.origin.isAttached() } function Yf(n, e = "removeEmptySlices") { if (n.isCollapsed()) return n; let t = "root", r = "next", o = e, i = Gl(n, r), s = fd(i.anchor, t), a = fd(i.focus.getFlipped(), t), l = new Set, c = []; for (let d of i.iterNodeCarets(t)) if (Kt(d)) l.add(d.origin.getKey()); else if (mr(d)) { let { origin: m } = d; M(m) && !l.has(m.getKey()) || c.push(m) } for (let d of c) d.remove(); for (let d of i.getTextSlices()) { if (!d) continue; let { origin: m } = d.caret, h = m.getTextContentSize(), _ = oo(We(m, r)), C = m.getMode(); if (Math.abs(d.distance) === h && o === "removeEmptySlices" || C === "token" && d.distance !== 0) _.remove(); else if (d.distance !== 0) { o = "removeEmptySlices"; let y = d.removeTextSlice(), x = d.caret.origin; if (C === "segmented") { let b = y.origin, S = Ke(b.getTextContent()).setStyle(b.getStyle()).setFormat(b.getFormat()); _.replaceOrInsert(S), y = Bn(S, r, y.offset) } x.is(s[0].origin) && (s[0] = y), x.is(a[0].origin) && (a[0] = y.getFlipped()) } } let u, p; for (let d of s) if (Ba(d)) { u = Pt(d); break } for (let d of a) if (Ba(d)) { p = Pt(d); break } let g = function (d, m, h) { if (!d || !m) return null; let _ = d.getParentAtCaret(), C = m.getParentAtCaret(); if (!_ || !C) return null; let y = _.getParents().reverse(); y.push(_); let x = C.getParents().reverse(); x.push(C); let b = Math.min(y.length, x.length), S; for (S = 0; S < b && y[S] === x[S]; S++); let N = (F, L) => { let G; for (let U = S; U < F.length; U++) { let K = F[U]; if (zt(K)) return; !G && L(K) && (G = K) } return G }, A = N(y, pn), O = A && N(x, F => h.has(F.getKey()) && pn(F)); return A && O ? [A, O] : null }(u, p, l); if (g) { let [d, m] = g; yn(d, "previous").splice(0, m.getChildren()), m.remove() } let f = [u, p, ...s, ...a].find(Ba); if (f) return Wf(zn(Pt(f), n.direction)); R(269, JSON.stringify(s.map(d => d.origin.__key))) } function Pt(n) { let e = function (o) { let i = o; for (; Kt(i);) { let s = eo(i); if (!Kt(s)) break; i = s } return i }(n.getLatest()), { direction: t } = e; if (B(e.origin)) return _n(e) ? e : Bn(e.origin, t, t); let r = e.getAdjacentCaret(); return mr(r) && B(r.origin) ? Bn(r.origin, t, Un(t)) : e } function jf(n) { return _n(n) && n.offset !== _r(n.origin, n.direction) } function zn(n, e) { return n.direction === e ? n : n.getFlipped() } function Gl(n, e) { return n.direction === e ? n : Kn(zn(n.focus, e), zn(n.anchor, e)) } function Jf(n, e, t) { let r = yn(n, "next"); for (let o = 0; o < e; o++) { let i = r.getAdjacentCaret(); if (i === null) break; r = i } return zn(r, t) } function GC(n, e = "root") { let t = 0, r = n, o = eo(r); for (; o === null;) { if (t--, o = r.getParentCaret(e), !o) return null; r = o, o = eo(r) } return o && [o, t] } function YC(n) { let { origin: e, offset: t, direction: r } = n; if (t === _r(e, r)) return n.getSiblingCaret(); if (t === _r(e, Un(r))) return oo(n.getSiblingCaret()); let [o] = e.splitText(t); return B(o) || R(281), zn(We(o, "next"), r) } function jC(n, e) { return !0 } function JC(n, { $copyElementNode: e = Bl, $splitTextPointCaretNext: t = YC, rootMode: r = "shadowRoot", $shouldSplit: o = jC } = {}) { if (_n(n)) return t(n); let i = n.getParentCaret(r); if (i) { let { origin: s } = i; if (Kt(n) && (!s.canBeEmpty() || !o(s, "first"))) return oo(i); let a = function (l) { let c = []; for (let u = l.getAdjacentCaret(); u; u = u.getAdjacentCaret())c.push(u.origin); return c }(n); (a.length > 0 || s.canBeEmpty() && o(s, "last")) && i.insert(e(s).splice(0, 0, a)) } return i } var E = Yl, Q0 = E.$addUpdateTag, Te = E.$applyNodeReplacement, io = E.$caretFromPoint, Vf = E.$caretRangeFromSelection, Wn = E.$cloneWithProperties, ex = E.$comparePointCaretNext, tx = E.$copyNode, yr = E.$createLineBreakNode, nx = E.$createNodeSelection, oe = E.$createParagraphNode, ii = E.$createPoint, so = E.$createRangeSelection, Xf = E.$createRangeSelectionFromDom, Ft = E.$createTabNode, st = E.$createTextNode, si = E.$extendCaretToRange, Nr = E.$getAdjacentChildCaret, jl = E.$getAdjacentNode, rx = E.$getAdjacentSiblingOrParentSiblingCaret, Jl = E.$getCaretInDirection, ox = E.$getCaretRange, ix = E.$getCaretRangeInDirection, qf = E.$getCharacterOffsets, Wt = E.$getChildCaret, sx = E.$getChildCaretAtIndex, Vl = E.$getChildCaretOrSelf, Zf = E.$getCollapsedCaretRange, ax = E.$getCommonAncestor, lx = E.$getCommonAncestorResultBranchOrder, xn = E.$getEditor, $e = E.$getNearestNodeFromDOMNode, cx = E.$getNearestRootOrShadowRoot, at = E.$getNodeByKey, ux = E.$getNodeByKeyOrThrow, Sn = E.$getPreviousSelection, Ge = E.$getRoot, k = E.$getSelection, yt = E.$getSiblingCaret, Qf = E.$getState, dx = E.$getStateChange, fx = E.$getTextContent, gx = E.$getTextNodeOffset, hx = E.$getTextPointCaret, px = E.$getTextPointCaretSlice, mx = E.$getWritableNodeState, eg = E.$hasAncestor, _x = E.$hasUpdateTag, Gn = E.$insertNodes, _s = E.$isBlockElementNode, Yn = E.$isChildCaret, Tn = E.$isDecoratorNode, $ = E.$isElementNode, Cs = E.$isExtendableTextPointCaret, tg = E.$isInlineElementOrDecoratorNode, ai = E.$isLeafNode, ve = E.$isLineBreakNode, Cx = E.$isNodeCaret, Nt = E.$isNodeSelection, jn = E.$isParagraphNode, v = E.$isRangeSelection, en = E.$isRootNode, tt = E.$isRootOrShadowRoot, ys = E.$isSiblingCaret, qe = E.$isTabNode, Z = E.$isTextNode, ng = E.$isTextPointCaret, yx = E.$isTextPointCaretSlice, rg = E.$isTokenOrSegmented, Nx = E.$nodesOfType, Jn = E.$normalizeCaret, xr = E.$normalizeSelection__EXPERIMENTAL, xx = E.$onUpdate, og = E.$parseSerializedNode, Sx = E.$removeTextFromCaretRange, ig = E.$rewindSiblingCaret, Ns = E.$selectAll, Tx = E.$setCompositionKey, Vn = E.$setPointFromCaret, Ye = E.$setSelection, sg = E.$setSelectionFromCaretRange, ag = E.$setState, lg = E.$splitAtPointCaretNext, cg = E.$splitNode, Ex = E.$updateRangeSelectionFromCaretRange, Xl = E.ArtificialNode__DO_NOT_USE, bx = E.BLUR_COMMAND, Sr = E.CAN_REDO_COMMAND, Tr = E.CAN_UNDO_COMMAND, ug = E.CLEAR_EDITOR_COMMAND, dg = E.CLEAR_HISTORY_COMMAND, xs = E.CLICK_COMMAND, Ax = E.COLLABORATION_TAG, vt = E.COMMAND_PRIORITY_CRITICAL, te = E.COMMAND_PRIORITY_EDITOR, Ss = E.COMMAND_PRIORITY_HIGH, De = E.COMMAND_PRIORITY_LOW, fg = E.COMMAND_PRIORITY_NORMAL, Ts = E.CONTROLLED_TEXT_INSERTION_COMMAND, Es = E.COPY_COMMAND, bs = E.CUT_COMMAND, ao = E.DELETE_CHARACTER_COMMAND, li = E.DELETE_LINE_COMMAND, As = E.DELETE_WORD_COMMAND, Ox = E.DRAGEND_COMMAND, gg = E.DRAGOVER_COMMAND, hg = E.DRAGSTART_COMMAND, pg = E.DROP_COMMAND, Os = E.DecoratorNode, xt = E.ElementNode, mg = E.FOCUS_COMMAND, Dt = E.FORMAT_ELEMENT_COMMAND, lt = E.FORMAT_TEXT_COMMAND, vs = E.HISTORIC_TAG, _g = E.HISTORY_MERGE_TAG, Cg = E.HISTORY_PUSH_TAG, wt = E.INDENT_CONTENT_COMMAND, ql = E.INSERT_LINE_BREAK_COMMAND, Xn = E.INSERT_PARAGRAPH_COMMAND, ci = E.INSERT_TAB_COMMAND, Ds = E.INTERNAL_$isBlock, vx = E.IS_ALL_FORMATTING, Dx = E.IS_BOLD, wx = E.IS_CODE, Mx = E.IS_HIGHLIGHT, kx = E.IS_ITALIC, Rx = E.IS_STRIKETHROUGH, Fx = E.IS_SUBSCRIPT, Lx = E.IS_SUPERSCRIPT, $x = E.IS_UNDERLINE, En = E.KEY_ARROW_DOWN_COMMAND, lo = E.KEY_ARROW_LEFT_COMMAND, ws = E.KEY_ARROW_RIGHT_COMMAND, Gt = E.KEY_ARROW_UP_COMMAND, Ms = E.KEY_BACKSPACE_COMMAND, ks = E.KEY_DELETE_COMMAND, Ix = E.KEY_DOWN_COMMAND, yg = E.KEY_ENTER_COMMAND, co = E.KEY_ESCAPE_COMMAND, Ng = E.KEY_MODIFIER_COMMAND, Rs = E.KEY_SPACE_COMMAND, uo = E.KEY_TAB_COMMAND, Px = E.LineBreakNode, Zl = E.MOVE_TO_END, Fs = E.MOVE_TO_START, Bx = E.NODE_STATE_KEY, Lt = E.OUTDENT_CONTENT_COMMAND, xg = E.PASTE_COMMAND, Sg = E.PASTE_TAG, Kx = E.ParagraphNode, Ls = E.REDO_COMMAND, Tg = E.REMOVE_TEXT_COMMAND, Hx = E.RootNode, Er = E.SELECTION_CHANGE_COMMAND, ui = E.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND, Eg = E.SELECT_ALL_COMMAND, zx = E.SKIP_COLLAB_TAG, Ux = E.SKIP_DOM_SELECTION_TAG, Wx = E.SKIP_SCROLL_INTO_VIEW_TAG, bg = E.TEXT_TYPE_TO_FORMAT, Gx = E.TabNode, St = E.TextNode, $s = E.UNDO_COMMAND, ct = E.createCommand, Is = E.createEditor, Yx = E.createState, jx = E.flipDirection, Jx = E.getDOMOwnerDocument, qn = E.getDOMSelection, Vx = E.getDOMSelectionFromTarget, Ag = E.getDOMTextNode, Xx = E.getEditorPropertyFromDOMNode, Ps = E.getNearestEditorFromDOMNode, Og = E.isBlockDomNode, vg = E.isCurrentlyReadOnlyMode, qx = E.isDOMDocumentNode, tn = E.isDOMNode, Zx = E.isDOMTextNode, Qx = E.isDOMUnmanaged, Ql = E.isDocumentFragment, eS = E.isExactShortcutMatch, Bs = E.isHTMLAnchorElement, br = E.isHTMLElement, di = E.isInlineDomNode, tS = E.isLexicalEditor, nS = E.isModifierMatch, Dg = E.isSelectionCapturedInDecoratorInput, wg = E.isSelectionWithinEditor, ec = E.makeStepwiseIterator, rS = E.removeFromParent, oS = E.resetRandomKey, Mg = E.setDOMUnmanaged, tc = E.setNodeIndentFromDOM; var ic = {}; At(ic, { $addNodeStyle: () => QC, $cloneWithProperties: () => Wn, $copyBlockFormatIndent: () => Hg, $ensureForwardRangeSelection: () => Kg, $forEachSelectedTextNode: () => Bg, $getSelectionStyleValueForProperty: () => ay, $isAtNodeEnd: () => ZC, $isParentElementRTL: () => Wg, $moveCaretSelection: () => Ug, $moveCharacter: () => iy, $patchStyleText: () => ey, $selectAll: () => Ns, $setBlocksType: () => ty, $shouldOverrideDefaultCharacterSelection: () => oy, $sliceSelectedTextNodeContent: () => qC, $trimTextContentFromAnchor: () => Pg, $wrapNodes: () => ry, createDOMRange: () => VC, createRectsFromDOMRange: () => XC, getCSSFromStyleObject: () => Ig, getStyleObjectFromCSS: () => Hs, trimTextContentFromAnchor: () => ly }); function oc(n, ...e) { let t = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams; r.append("code", n); for (let o of e) r.append("v", o); throw t.search = r.toString(), Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`) } var Ks = new Map; function kg(n) { let e = n; for (; e != null;) { if (e.nodeType === Node.TEXT_NODE) return e; e = e.firstChild } return null } function Rg(n) { let e = n.parentNode; if (e == null) throw new Error("Should never happen"); return [e, Array.from(e.childNodes).indexOf(n)] } function VC(n, e, t, r, o) { let i = e.getKey(), s = r.getKey(), a = document.createRange(), l = n.getElementByKey(i), c = n.getElementByKey(s), u = t, p = o; if (Z(e) && (l = kg(l)), Z(r) && (c = kg(c)), e === void 0 || r === void 0 || l === null || c === null) return null; l.nodeName === "BR" && ([l, u] = Rg(l)), c.nodeName === "BR" && ([c, p] = Rg(c)); let g = l.firstChild; l === c && g != null && g.nodeName === "BR" && u === 0 && p === 0 && (p = 1); try { a.setStart(l, u), a.setEnd(c, p) } catch { return null } return !a.collapsed || u === p && i === s || (a.setStart(c, p), a.setEnd(l, u)), a } function XC(n, e) { let t = n.getRootElement(); if (t === null) return []; let r = t.getBoundingClientRect(), o = getComputedStyle(t), i = parseFloat(o.paddingLeft) + parseFloat(o.paddingRight), s = Array.from(e.getClientRects()), a, l = s.length; s.sort((c, u) => { let p = c.top - u.top; return Math.abs(p) <= 3 ? c.left - u.left : p }); for (let c = 0; c < l; c++) { let u = s[c], p = a && a.top <= u.top && a.top + a.height > u.top && a.left + a.width > u.left, g = u.width + i === r.width; p || g ? (s.splice(c--, 1), l--) : a = u } return s } function $g(n) { let e = {}; if (!n) return e; let t = n.split(";"); for (let r of t) if (r !== "") { let [o, i] = r.split(/:([^]+)/); o && i && (e[o.trim()] = i.trim()) } return e } function Hs(n) { let e = Ks.get(n); return e === void 0 && (e = $g(n), Ks.set(n, e)), e } function Ig(n) { let e = ""; for (let t in n) t && (e += `${t}: ${n[t]};`); return e } function qC(n, e) { let t = n.getStartEndPoints(); if (e.isSelected(n) && !e.isSegmented() && !e.isToken() && t !== null) { let [r, o] = t, i = n.isBackward(), s = r.getNode(), a = o.getNode(), l = e.is(s), c = e.is(a); if (l || c) { let [u, p] = qf(n), g = s.is(a), f = e.is(i ? a : s), d = e.is(i ? s : a), m, h = 0; return g ? (h = u > p ? p : u, m = u > p ? u : p) : f ? (h = i ? p : u, m = void 0) : d && (h = 0, m = i ? u : p), e.__text = e.__text.slice(h, m), e } } return e } function ZC(n) { if (n.type === "text") return n.offset === n.getNode().getTextContentSize(); let e = n.getNode(); return $(e) || oc(177), n.offset === e.getChildrenSize() } function Pg(n, e, t) { let r = e.getNode(), o = t; if ($(r)) { let i = r.getDescendantByIndex(e.offset); i !== null && (r = i) } for (; o > 0 && r !== null;) { if ($(r)) { let c = r.getLastDescendant(); c !== null && (r = c) } let i = r.getPreviousSibling(), s = 0; if (i === null) { let c = r.getParentOrThrow(), u = c.getPreviousSibling(); for (; u === null;) { if (c = c.getParent(), c === null) { i = null; break } u = c.getPreviousSibling() } c !== null && (s = c.isInline() ? 0 : 2, i = u) } let a = r.getTextContent(); a === "" && $(r) && !r.isInline() && (a = ` `); let l = a.length; if (!Z(r) || o >= l) { let c = r.getParent(); r.remove(), c == null || c.getChildrenSize() !== 0 || en(c) || c.remove(), o -= l + s, r = i } else { let c = r.getKey(), u = n.getEditorState().read(() => { let f = at(c); return Z(f) && f.isSimpleText() ? f.getTextContent() : null }), p = l - o, g = a.slice(0, p); if (u !== null && u !== a) { let f = Sn(), d = r; if (r.isSimpleText()) r.setTextContent(u); else { let m = st(u); r.replace(m), d = m } if (v(f) && f.isCollapsed()) { let m = f.anchor.offset; d.select(m, m) } } else if (r.isSimpleText()) { let f = e.key === c, d = e.offset; d < o && (d = l); let m = f ? d - o : 0, h = f ? d : p; if (f && m === 0) { let [_] = r.splitText(m, h); _.remove() } else { let [, _] = r.splitText(m, h); _.remove() } } else { let f = st(g); r.replace(f) } o = 0 } } } function QC(n) { let e = n.getStyle(), t = $g(e); Ks.set(e, t) } function nc(n, e) { (v(n) ? n.isCollapsed() : Z(n) || $(n)) || oc(280); let t = Hs(v(n) ? n.style : Z(n) ? n.getStyle() : n.getTextStyle()), r = Object.entries(e).reduce((i, [s, a]) => (typeof a == "function" ? i[s] = a(t[s], n) : a === null ? delete i[s] : i[s] = a, i), { ...t }), o = Ig(r); v(n) || Z(n) ? n.setStyle(o) : n.setTextStyle(o), Ks.set(o, r) } function ey(n, e) { if (v(n) && n.isCollapsed()) { nc(n, e); let t = n.anchor.getNode(); $(t) && t.isEmpty() && nc(t, e) } Bg(t => { nc(t, e) }) } function Bg(n) { let e = k(); if (!e) return; let t = new Map; if (v(e)) for (let i of Vf(e).getTextSlices()) i && t.set(i.caret.origin.getKey(), i.getSliceIndices()); let r = e.getNodes(); for (let i of r) { if (!Z(i) || !i.canHaveFormat()) continue; let [s, a] = (o = i, t.get(o.getKey()) || [0, o.getTextContentSize()]); a !== s && (rg(i) || s === 0 && a === i.getTextContentSize() ? n(i) : n(i.splitText(s, a)[s === 0 ? 0 : 1])) } var o; v(e) && e.anchor.type === "text" && e.focus.type === "text" && e.anchor.key === e.focus.key && Kg(e) } function Kg(n) { if (n.isBackward()) { let { anchor: e, focus: t } = n, { key: r, offset: o, type: i } = e; e.set(t.key, t.offset, t.type), t.set(r, o, i) } } function Hg(n, e) { let t = n.getFormatType(), r = n.getIndent(); t !== e.getFormatType() && e.setFormat(t), r !== e.getIndent() && e.setIndent(r) } function ty(n, e, t = Hg) { if (n === null) return; let r = n.getStartEndPoints(), o = new Map, i = null; if (r) { let [s, a] = r; i = so(), i.anchor.set(s.key, s.offset, s.type), i.focus.set(a.key, a.offset, a.type); let l = Lg(s.getNode(), Ds), c = Lg(a.getNode(), Ds); $(l) && o.set(l.getKey(), l), $(c) && o.set(c.getKey(), c) } for (let s of n.getNodes()) $(s) && Ds(s) && o.set(s.getKey(), s); for (let [s, a] of o) { let l = e(); t(a, l), a.replace(l, !0), i && (s === i.anchor.key && i.anchor.set(l.getKey(), i.anchor.offset, i.anchor.type), s === i.focus.key && i.focus.set(l.getKey(), i.focus.offset, i.focus.type)) } i && n.is(k()) && Ye(i) } function Fg(n) { return n.getNode().isAttached() } function ny(n) { let e = n; for (; e !== null && !tt(e);) { let t = e.getLatest(), r = e.getParent(); t.getChildrenSize() === 0 && e.remove(!0), e = r } } function ry(n, e, t = null) { let r = n.getStartEndPoints(), o = r ? r[0] : null, i = n.getNodes(), s = i.length; if (o !== null && (s === 0 || s === 1 && o.type === "element" && o.getNode().getChildrenSize() === 0)) { let c = o.type === "text" ? o.getNode().getParentOrThrow() : o.getNode(), u = c.getChildren(), p = e(); return p.setFormat(c.getFormatType()), p.setIndent(c.getIndent()), u.forEach(g => p.append(g)), t && (p = t.append(p)), void c.replace(p) } let a = null, l = []; for (let c = 0; c < s; c++) { let u = i[c]; tt(u) ? (rc(n, l, l.length, e, t), l = [], a = u) : a === null || a !== null && eg(u, a) ? l.push(u) : (rc(n, l, l.length, e, t), l = [u]) } rc(n, l, l.length, e, t) } function rc(n, e, t, r, o = null) { if (e.length === 0) return; let i = e[0], s = new Map, a = [], l = $(i) ? i : i.getParentOrThrow(); l.isInline() && (l = l.getParentOrThrow()); let c = !1; for (; l !== null;) { let d = l.getPreviousSibling(); if (d !== null) { l = d, c = !0; break } if (l = l.getParentOrThrow(), tt(l)) break } let u = new Set; for (let d = 0; d < t; d++) { let m = e[d]; $(m) && m.getChildrenSize() === 0 && u.add(m.getKey()) } let p = new Set; for (let d = 0; d < t; d++) { let m = e[d], h = m.getParent(); if (h !== null && h.isInline() && (h = h.getParent()), h !== null && ai(m) && !p.has(m.getKey())) { let _ = h.getKey(); if (s.get(_) === void 0) { let C = r(); C.setFormat(h.getFormatType()), C.setIndent(h.getIndent()), a.push(C), s.set(_, C), h.getChildren().forEach(y => { C.append(y), p.add(y.getKey()), $(y) && y.getChildrenKeys().forEach(x => p.add(x)) }), ny(h) } } else if (u.has(m.getKey())) { $(m) || oc(179); let _ = r(); _.setFormat(m.getFormatType()), _.setIndent(m.getIndent()), a.push(_), m.remove(!0) } } if (o !== null) for (let d = 0; d < a.length; d++) { let m = a[d]; o.append(m) } let g = null; if (tt(l)) if (c) if (o !== null) l.insertAfter(o); else for (let d = a.length - 1; d >= 0; d--) { let m = a[d]; l.insertAfter(m) } else { let d = l.getFirstChild(); if ($(d) && (l = d), d === null) if (o) l.append(o); else for (let m = 0; m < a.length; m++) { let h = a[m]; l.append(h), g = h } else if (o !== null) d.insertBefore(o); else for (let m = 0; m < a.length; m++) { let h = a[m]; d.insertBefore(h), g = h } } else if (o) l.insertAfter(o); else for (let d = a.length - 1; d >= 0; d--) { let m = a[d]; l.insertAfter(m), g = m } let f = Sn(); v(f) && Fg(f.anchor) && Fg(f.focus) ? Ye(f.clone()) : g !== null ? g.selectEnd() : n.dirty = !0 } function zg(n) { let e = n.anchor.getNode(), t = en(e) ? e : e.getParentOrThrow(), r = xn().getElementByKey(t.getKey()); if (r === null) return !1; let o = r.ownerDocument.defaultView; return o === null ? !1 : o.getComputedStyle(r).writingMode === "vertical-rl" } function oy(n, e) { let t = zg(n) ? !e : e, r = io(n.focus, t ? "previous" : "next"); if (Cs(r)) return !1; for (let o of si(r)) { if (Yn(o)) return !o.origin.isInline(); if (!$(o.origin)) { if (Tn(o.origin)) return !0; break } } return !1 } function Ug(n, e, t, r) { n.modify(e ? "extend" : "move", t, r) } function Wg(n) { let e = n.anchor.getNode(); return (en(e) ? e : e.getParentOrThrow()).getDirection() === "rtl" } function iy(n, e, t) { let r = Wg(n), o; o = zg(n) || r ? !t : t, Ug(n, e, o, "character") } function sy(n, e, t) { let r = Hs(n.getStyle()); return r !== null && r[e] || t } function ay(n, e, t = "") { let r = null, o = n.getNodes(), i = n.anchor, s = n.focus, a = n.isBackward(), l = a ? s.offset : i.offset, c = a ? s.getNode() : i.getNode(); if (v(n) && n.isCollapsed() && n.style !== "") { let u = Hs(n.style); if (u !== null && e in u) return u[e] } for (let u = 0; u < o.length; u++) { let p = o[u]; if ((u === 0 || l !== 0 || !p.is(c)) && Z(p)) { let g = sy(p, e, t); if (r === null) r = g; else if (r !== g) { r = ""; break } } } return r === null ? t : r } function Lg(n, e) { let t = n; for (; t !== null && t.getParent() !== null && !e(t);)t = t.getParentOrThrow(); return e(t) ? t : null } var ly = Pg; var we = ic, Gg = we.$addNodeStyle, lS = we.$cloneWithProperties, cS = we.$copyBlockFormatIndent, uS = we.$ensureForwardRangeSelection, dS = we.$forEachSelectedTextNode, fi = we.$getSelectionStyleValueForProperty, sc = we.$isAtNodeEnd, Yg = we.$isParentElementRTL, fS = we.$moveCaretSelection, ac = we.$moveCharacter, fo = we.$patchStyleText, gS = we.$selectAll, Zn = we.$setBlocksType, lc = we.$shouldOverrideDefaultCharacterSelection, zs = we.$sliceSelectedTextNodeContent, hS = we.$trimTextContentFromAnchor, pS = we.$wrapNodes, mS = we.createDOMRange, jg = we.createRectsFromDOMRange, _S = we.getCSSFromStyleObject, cc = we.getStyleObjectFromCSS, CS = we.trimTextContentFromAnchor; var gc = {}; At(gc, { $descendantsMatching: () => jy, $dfs: () => wy, $dfsIterator: () => nh, $filter: () => zy, $findMatchingParent: () => sh, $firstToLastIterator: () => Jy, $getAdjacentCaret: () => My, $getAdjacentSiblingOrParentSiblingCaret: () => gi, $getDepth: () => oh, $getNearestBlockElementAncestorOrThrow: () => $y, $getNearestNodeOfType: () => Ly, $getNextRightPreorderNode: () => Fy, $getNextSiblingOrParentSibling: () => Ry, $insertFirst: () => Uy, $insertNodeToNearestRoot: () => By, $insertNodeToNearestRootAtCaret: () => ah, $isEditorIsNestedEditor: () => Gy, $lastToFirstIterator: () => fc, $restoreEditorState: () => Py, $reverseDfs: () => ky, $reverseDfsIterator: () => ih, $splitNode: () => cg, $unwrapAndFilterDescendants: () => Yy, $unwrapNode: () => Vy, $wrapNodeInElement: () => Ky, CAN_USE_BEFORE_INPUT: () => yy, CAN_USE_DOM: () => Qg, IS_ANDROID: () => Ny, IS_ANDROID_CHROME: () => xy, IS_APPLE: () => Sy, IS_APPLE_WEBKIT: () => Ty, IS_CHROME: () => Ey, IS_FIREFOX: () => eh, IS_IOS: () => by, IS_SAFARI: () => Ay, addClassNamesToElement: () => Oy, calculateZoomLevel: () => Wy, isBlockDomNode: () => Og, isHTMLAnchorElement: () => Bs, isHTMLElement: () => br, isInlineDomNode: () => di, isMimeType: () => th, makeStateWrapper: () => Xy, markSelection: () => Zg, mediaFileReader: () => Dy, mergeRegister: () => Xg, objectKlassEquals: () => Hy, positionNodeOnRange: () => qg, registerNestedElementResolver: () => Iy, removeClassNamesFromElement: () => vy, selectionAlwaysOnDisplay: () => Cy }); function Ws(n, ...e) { let t = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams; r.append("code", n); for (let o of e) r.append("v", o); throw t.search = r.toString(), Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`) } var Yt = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, cy = Yt && "documentMode" in document ? document.documentMode : null, uy = Yt && /Mac|iPod|iPhone|iPad/.test(navigator.platform), dy = Yt && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), fy = !(!Yt || !("InputEvent" in window) || cy) && "getTargetRanges" in new window.InputEvent("input"), gy = Yt && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), hy = Yt && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Jg = Yt && /Android/.test(navigator.userAgent), dc = Yt && /^(?=.*Chrome).*/i.test(navigator.userAgent), py = Yt && Jg && dc, my = Yt && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !dc; function Vg(...n) { let e = []; for (let t of n) if (t && typeof t == "string") for (let [r] of t.matchAll(/\S+/g)) e.push(r); return e } function Xg(...n) { return () => { for (let e = n.length - 1; e >= 0; e--)n[e](); n.length = 0 } } function nn(n) { return `${n}px` } var _y = { attributes: !0, characterData: !0, childList: !0, subtree: !0 }; function qg(n, e, t) { let r = null, o = null, i = null, s = [], a = document.createElement("div"); function l() { r === null && Ws(182), o === null && Ws(183); let { left: p, top: g } = o.getBoundingClientRect(), f = jg(n, e); var d, m; a.isConnected || (m = a, (d = o).insertBefore(m, d.firstChild)); let h = !1; for (let _ = 0; _ < f.length; _++) { let C = f[_], y = s[_] || document.createElement("div"), x = y.style; x.position !== "absolute" && (x.position = "absolute", h = !0); let b = nn(C.left - p); x.left !== b && (x.left = b, h = !0); let S = nn(C.top - g); x.top !== S && (y.style.top = S, h = !0); let N = nn(C.width); x.width !== N && (y.style.width = N, h = !0); let A = nn(C.height); x.height !== A && (y.style.height = A, h = !0), y.parentNode !== a && (a.append(y), h = !0), s[_] = y } for (; s.length > f.length;)s.pop(); h && t(s) } function c() { o = null, r = null, i !== null && i.disconnect(), i = null, a.remove(); for (let p of s) p.remove(); s = [] } a.style.position = "relative"; let u = n.registerRootListener(function p() { let g = n.getRootElement(); if (g === null) return c(); let f = g.parentElement; if (!br(f)) return c(); c(), r = g, o = f, i = new MutationObserver(d => { let m = n.getRootElement(), h = m && m.parentElement; if (m !== r || h !== o) return p(); for (let _ of d) if (!a.contains(_.target)) return l() }), i.observe(f, _y), l() }); return () => { u(), c() } } function Us(n, e, t) { if (n.type !== "text" && $(e)) { let r = e.getDOMSlot(t); return [r.element, r.getFirstChildOffset() + n.offset] } return [Ag(t) || t, n.offset] } function Zg(n, e) { let t = null, r = null, o = null, i = null, s = null, a = null, l = () => { }; function c(u) { u.read(() => { let p = k(); if (!v(p)) return t = null, o = null, i = null, a = null, l(), void (l = () => { }); let { anchor: g, focus: f } = p, d = g.getNode(), m = d.getKey(), h = g.offset, _ = f.getNode(), C = _.getKey(), y = f.offset, x = n.getElementByKey(m), b = n.getElementByKey(C), S = t === null || x !== r || h !== o || m !== t.getKey(), N = i === null || b !== s || y !== a || C !== i.getKey(); if ((S || N) && x !== null && b !== null) { let A = function (O, F, L, G, U, K, W) { let q = (O._window ? O._window.document : document).createRange(); return K.isBefore(L) ? (q.setStart(...Us(U, K, W)), q.setEnd(...Us(F, L, G))) : (q.setStart(...Us(F, L, G)), q.setEnd(...Us(U, K, W))), q }(n, g, d, x, f, _, b); l(), l = qg(n, A, O => { if (e === void 0) for (let F of O) { let L = F.style; L.background !== "Highlight" && (L.background = "Highlight"), L.color !== "HighlightText" && (L.color = "HighlightText"), L.marginTop !== nn(-1.5) && (L.marginTop = nn(-1.5)), L.paddingTop !== nn(4) && (L.paddingTop = nn(4)), L.paddingBottom !== nn(0) && (L.paddingBottom = nn(0)) } else e(O) }) } t = d, r = x, o = h, i = _, s = b, a = y }) } return c(n.getEditorState()), Xg(n.registerUpdateListener(({ editorState: u }) => c(u)), () => { l() }) } function Cy(n) { let e = null, t = () => { let r = getSelection(), o = r && r.anchorNode, i = n.getRootElement(); o !== null && i !== null && i.contains(o) ? e !== null && (e(), e = null) : e === null && (e = Zg(n)) }; return document.addEventListener("selectionchange", t), () => { e !== null && e(), document.removeEventListener("selectionchange", t) } } var yy = fy, Qg = Yt, Ny = Jg, xy = py, Sy = uy, Ty = my, Ey = dc, eh = dy, by = hy, Ay = gy; function Oy(n, ...e) { let t = Vg(...e); t.length > 0 && n.classList.add(...t) } function vy(n, ...e) { let t = Vg(...e); t.length > 0 && n.classList.remove(...t) } function th(n, e) { for (let t of e) if (n.type.startsWith(t)) return !0; return !1 } function Dy(n, e) { let t = n[Symbol.iterator](); return new Promise((r, o) => { let i = [], s = () => { let { done: a, value: l } = t.next(); if (a) return r(i); let c = new FileReader; c.addEventListener("error", o), c.addEventListener("load", () => { let u = c.result; typeof u == "string" && i.push({ file: l, result: u }), s() }), th(l, e) ? c.readAsDataURL(l) : s() }; s() }) } function wy(n, e) { return Array.from(nh(n, e)) } function My(n) { return n ? n.getAdjacentCaret() : null } function ky(n, e) { return Array.from(ih(n, e)) } function nh(n, e) { return rh("next", n, e) } function rh(n, e, t) { let r = Ge(), o = e || r, i = $(o) ? Wt(o, n) : yt(o, n), s = oh(o), a = t ? Nr(Vl(yt(t, n))) : function (c, u) { let p = gi(yt(c, u)); return p && p[0] }(o, n), l = s; return ec({ hasNext: c => c !== null, initial: i, map: c => ({ depth: l, node: c.origin }), step: c => { if (c.isSameNodeCaret(a)) return null; Yn(c) && l++; let u = gi(c); return !u || u[0].isSameNodeCaret(a) ? null : (l += u[1], u[0]) } }) } function Ry(n) { let e = gi(yt(n, "next")); return e && [e[0].origin, e[1]] } function oh(n) { let e = -1; for (let t = n; t !== null; t = t.getParent())e++; return e } function Fy(n) { let e = gi(Vl(yt(n, "previous")), "root"); return e && e[0].origin } function ih(n, e) { return rh("previous", n, e) } function Ly(n, e) { let t = n; for (; t != null;) { if (t instanceof e) return t; t = t.getParent() } return null } function $y(n) { let e = sh(n, t => $(t) && !t.isInline()); return $(e) || Ws(4, n.__key), e } var sh = (n, e) => { let t = n; for (; t !== Ge() && t != null;) { if (e(t)) return t; t = t.getParent() } return null }; function Iy(n, e, t, r) { let o = i => i instanceof e; return n.registerNodeTransform(e, i => { let s = (a => { let l = a.getChildren(); for (let p = 0; p < l.length; p++) { let g = l[p]; if (o(g)) return null } let c = a, u = a; for (; c !== null;)if (u = c, c = c.getParent(), o(c)) return { child: u, parent: c }; return null })(i); if (s !== null) { let { child: a, parent: l } = s; if (a.is(i)) { r(l, i); let c = a.getNextSiblings(), u = c.length; if (l.insertAfter(a), u !== 0) { let p = t(l); a.insertAfter(p); for (let g = 0; g < u; g++)p.append(c[g]) } l.canBeEmpty() || l.getChildrenSize() !== 0 || l.remove() } } }) } function Py(n, e) { let t = new Map, r = n._pendingEditorState; for (let [i, s] of e._nodeMap) t.set(i, Wn(s)); r && (r._nodeMap = t), n._dirtyType = 2; let o = e._selection; Ye(o === null ? null : o.clone()) } function By(n) { let e = k() || Sn(), t; if (v(e)) t = io(e.focus, "next"); else { if (e != null) { let s = e.getNodes(), a = s[s.length - 1]; a && (t = yt(a, "next")) } t = t || Wt(Ge(), "previous").getFlipped().insert(oe()) } let r = ah(n, t), o = Nr(r), i = Yn(o) ? Jn(o) : r; return sg(Zf(i)), n.getLatest() } function ah(n, e, t) { let r = Jl(e, "next"); for (let o = r; o; o = lg(o, t))r = o; return ng(r) && Ws(283), r.insert(n.isInline() ? oe().append(n) : n), Jl(yt(n.getLatest(), "next"), e.direction) } function Ky(n, e) { let t = e(); return n.replace(t), t.append(n), t } function Hy(n, e) { return n !== null && Object.getPrototypeOf(n).constructor.name === e.name } function zy(n, e) { let t = []; for (let r = 0; r < n.length; r++) { let o = e(n[r]); o !== null && t.push(o) } return t } function Uy(n, e) { Wt(n, "next").insert(e) } var uc = !(eh || !Qg) && void 0; function Wy(n) { let e = 1; if (function () { if (uc === void 0) { let t = document.createElement("div"); t.style.cssText = "position: absolute; opacity: 0; width: 100px; left: -1000px;", document.body.appendChild(t); let r = t.getBoundingClientRect(); t.style.setProperty("zoom", "2"), uc = t.getBoundingClientRect().width === r.width, document.body.removeChild(t) } return uc }()) for (; n;)e *= Number(window.getComputedStyle(n).getPropertyValue("zoom")), n = n.parentElement; return e } function Gy(n) { return n._parentEditor !== null } function Yy(n, e) { return lh(n, e, null) } function lh(n, e, t) { let r = !1; for (let o of fc(n)) e(o) ? t !== null && t(o) : (r = !0, $(o) && lh(o, e, t || (i => o.insertAfter(i))), o.remove()); return r } function jy(n, e) { let t = [], r = Array.from(n).reverse(); for (let o = r.pop(); o !== void 0; o = r.pop())if (e(o)) t.push(o); else if ($(o)) for (let i of fc(o)) r.push(i); return t } function Jy(n) { return ch(Wt(n, "next")) } function fc(n) { return ch(Wt(n, "previous")) } function ch(n) { return ec({ hasNext: ys, initial: n.getAdjacentCaret(), map: e => e.origin.getLatest(), step: e => e.getAdjacentCaret() }) } function Vy(n) { ig(yt(n, "next")).splice(1, n.getChildren()) } function gi(n, e = "root") { let t = 0, r = n, o = Nr(r); for (; o === null;) { if (t--, o = r.getParentCaret(e), !o) return null; r = o, o = Nr(r) } return o && [o, t] } function Xy(n) { let e = r => Qf(r, n), t = (r, o) => ag(r, n, o); return { $get: e, $set: t, accessors: [e, t], makeGetterMethod: () => function () { return e(this) }, makeSetterMethod: () => function (r) { return t(this, r) }, stateConfig: n } } var X = gc, hc = X.$descendantsMatching, TS = X.$dfs, ES = X.$dfsIterator, bS = X.$filter, Q = X.$findMatchingParent, AS = X.$firstToLastIterator, uh = X.$getAdjacentCaret, OS = X.$getAdjacentSiblingOrParentSiblingCaret, vS = X.$getDepth, Gs = X.$getNearestBlockElementAncestorOrThrow, Ys = X.$getNearestNodeOfType, DS = X.$getNextRightPreorderNode, wS = X.$getNextSiblingOrParentSibling, dh = X.$insertFirst, js = X.$insertNodeToNearestRoot, MS = X.$insertNodeToNearestRootAtCaret, kS = X.$isEditorIsNestedEditor, RS = X.$lastToFirstIterator, FS = X.$restoreEditorState, LS = X.$reverseDfs, $S = X.$reverseDfsIterator, IS = X.$splitNode, pc = X.$unwrapAndFilterDescendants, PS = X.$unwrapNode, BS = X.$wrapNodeInElement, KS = X.CAN_USE_BEFORE_INPUT, HS = X.CAN_USE_DOM, zS = X.IS_ANDROID, US = X.IS_ANDROID_CHROME, WS = X.IS_APPLE, GS = X.IS_APPLE_WEBKIT, YS = X.IS_CHROME, jS = X.IS_FIREFOX, JS = X.IS_IOS, VS = X.IS_SAFARI, pe = X.addClassNamesToElement, fh = X.calculateZoomLevel, mc = X.isBlockDomNode, _c = X.isHTMLAnchorElement, je = X.isHTMLElement, XS = X.isInlineDomNode, qS = X.isMimeType, ZS = X.makeStateWrapper, QS = X.markSelection, eT = X.mediaFileReader, Mt = X.mergeRegister, jt = X.objectKlassEquals, tT = X.positionNodeOnRange, nT = X.registerNestedElementResolver, $t = X.removeClassNamesFromElement, rT = X.selectionAlwaysOnDisplay; var Cc = {}; At(Cc, { $generateHtmlFromNodes: () => Zy, $generateNodesFromDOM: () => qy }); function qy(n, e) { let t = e.body ? e.body.childNodes : [], r = [], o = []; for (let i = 0; i < t.length; i++) { let s = t[i]; if (!hh.has(s.nodeName)) { let a = ph(s, n, o, !1); a !== null && (r = r.concat(a)) } } return function (i) { for (let s of i) s.getNextSibling() instanceof Xl && s.insertAfter(yr()); for (let s of i) { let a = s.getChildren(); for (let l of a) s.insertBefore(l); s.remove() } }(o), r } function Zy(n, e) { if (typeof document > "u" || typeof window > "u" && global.window === void 0) throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function."); let t = document.createElement("div"), r = Ge().getChildren(); for (let o = 0; o < r.length; o++)gh(n, r[o], t, e); return t.innerHTML } function gh(n, e, t, r = null) { let o = r === null || e.isSelected(r), i = $(e) && e.excludeFromCopy("html"), s = e; if (r !== null) { let f = Wn(e); f = Z(f) && r !== null ? zs(r, f) : f, s = f } let a = $(s) ? s.getChildren() : [], l = n._nodes.get(s.getType()), c; c = l && l.exportDOM !== void 0 ? l.exportDOM(n, s) : s.exportDOM(n); let { element: u, after: p } = c; if (!u) return !1; let g = document.createDocumentFragment(); for (let f = 0; f < a.length; f++) { let d = a[f], m = gh(n, d, g, r); !o && $(e) && m && e.extractWithChild(d, r, "html") && (o = !0) } if (o && !i) { if ((je(u) || Ql(u)) && u.append(g), t.append(u), p) { let f = p.call(s, u); f && (Ql(u) ? u.replaceChildren(f) : u.replaceWith(f)) } } else t.append(g); return o } var hh = new Set(["STYLE", "SCRIPT"]); function ph(n, e, t, r, o = new Map, i) { let s = []; if (hh.has(n.nodeName)) return s; let a = null, l = function (d, m) { let { nodeName: h } = d, _ = m._htmlConversions.get(h.toLowerCase()), C = null; if (_ !== void 0) for (let y of _) { let x = y(d); x !== null && (C === null || (C.priority || 0) <= (x.priority || 0)) && (C = x) } return C !== null ? C.conversion : null }(n, e), c = l ? l(n) : null, u = null; if (c !== null) { u = c.after; let d = c.node; if (a = Array.isArray(d) ? d[d.length - 1] : d, a !== null) { for (let [, m] of o) if (a = m(a, i), !a) break; a && s.push(...Array.isArray(d) ? d : [a]) } c.forChild != null && o.set(n.nodeName, c.forChild) } let p = n.childNodes, g = [], f = (a == null || !tt(a)) && (a != null && _s(a) || r); for (let d = 0; d < p.length; d++)g.push(...ph(p[d], e, t, f, new Map(o), a)); return u != null && (g = u(g)), mc(n) && (g = Qy(n, g, f ? () => { let d = new Xl; return t.push(d), d } : oe)), a == null ? g.length > 0 ? s = s.concat(g) : mc(n) && function (d) { return d.nextSibling == null || d.previousSibling == null ? !1 : di(d.nextSibling) && di(d.previousSibling) }(n) && (s = s.concat(yr())) : $(a) && a.append(...g), s } function Qy(n, e, t) { let r = n.style.textAlign, o = [], i = []; for (let s = 0; s < e.length; s++) { let a = e[s]; if (_s(a)) r && !a.getFormat() && a.setFormat(r), o.push(a); else if (i.push(a), s === e.length - 1 || s < e.length - 1 && _s(e[s + 1])) { let l = t(); l.setFormat(r), l.append(...i), o.push(l), i = [] } } return o } var mh = Cc, Js = mh.$generateHtmlFromNodes, Vs = mh.$generateNodesFromDOM; var Nc = {}; At(Nc, { $generateJSONFromSelectedNodes: () => xh, $generateNodesFromSerializedNodes: () => Sh, $getClipboardDataFromSelection: () => Th, $getHtmlContent: () => Ch, $getLexicalContent: () => yh, $insertDataTransferForPlainText: () => eN, $insertDataTransferForRichText: () => tN, $insertGeneratedNodes: () => yc, copyToClipboard: () => nN, setLexicalClipboardDataTransfer: () => Eh }); function Xs(n, ...e) { let t = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams; r.append("code", n); for (let o of e) r.append("v", o); throw t.search = r.toString(), Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`) } function Ch(n, e = k()) { return e == null && Xs(166), v(e) && e.isCollapsed() || e.getNodes().length === 0 ? "" : Js(n, e) } function yh(n, e = k()) { return e == null && Xs(166), v(e) && e.isCollapsed() || e.getNodes().length === 0 ? null : JSON.stringify(xh(n, e)) } function eN(n, e) { let t = n.getData("text/plain") || n.getData("text/uri-list"); t != null && e.insertRawText(t) } function tN(n, e, t) { let r = n.getData("application/x-lexical-editor"); if (r) try { let a = JSON.parse(r); if (a.namespace === t._config.namespace && Array.isArray(a.nodes)) return yc(t, Sh(a.nodes), e) } catch { } let o = n.getData("text/html"), i = n.getData("text/plain"); if (o && i !== o) try { let a = new DOMParser().parseFromString(function (l) { return window.trustedTypes && window.trustedTypes.createPolicy ? window.trustedTypes.createPolicy("lexical", { createHTML: c => c }).createHTML(l) : l }(o), "text/html"); return yc(t, Vs(t, a), e) } catch { } let s = i || n.getData("text/uri-list"); if (s != null) if (v(e)) { let a = s.split(/(\r?\n|\t)/); a[a.length - 1] === "" && a.pop(); for (let l = 0; l < a.length; l++) { let c = k(); if (v(c)) { let u = a[l]; u === ` `|| u === `\r `? c.insertParagraph() : u === " " ? c.insertNodes([Ft()]) : c.insertText(u) } } } else e.insertRawText(s) } function yc(n, e, t) { n.dispatchCommand(ui, { nodes: e, selection: t }) || t.insertNodes(e) } function Nh(n, e, t, r = []) { let o = e === null || t.isSelected(e), i = $(t) && t.excludeFromCopy("html"), s = t; if (e !== null) { let c = Wn(t); c = Z(c) && e !== null ? zs(e, c) : c, s = c } let a = $(s) ? s.getChildren() : [], l = function (c) { let u = c.exportJSON(), p = c.constructor; if (u.type !== p.getType() && Xs(58, p.name), $(c)) { let g = u.children; Array.isArray(g) || Xs(59, p.name) } return u }(s); if (Z(s)) { let c = s.__text; c.length > 0 ? l.text = c : o = !1 } for (let c = 0; c < a.length; c++) { let u = a[c], p = Nh(n, e, u, l.children); !o && $(t) && p && t.extractWithChild(u, e, "clone") && (o = !0) } if (o && !i) r.push(l); else if (Array.isArray(l.children)) for (let c = 0; c < l.children.length; c++) { let u = l.children[c]; r.push(u) } return o } function xh(n, e) { let t = [], r = Ge().getChildren(); for (let o = 0; o < r.length; o++)Nh(n, e, r[o], t); return { namespace: n._config.namespace, nodes: t } } function Sh(n) { let e = []; for (let t = 0; t < n.length; t++) { let r = n[t], o = og(r); Z(o) && Gg(o), e.push(o) } return e } var go = null; async function nN(n, e, t) { if (go !== null) return !1; if (e !== null) return new Promise((c, u) => { n.update(() => { c(_h(n, e, t)) }) }); let r = n.getRootElement(), o = n._window || window, i = window.document, s = qn(o); if (r === null || s === null) return !1; let a = i.createElement("span"); a.style.cssText = "position: fixed; top: -1000px;", a.append(i.createTextNode("#")), r.append(a); let l = new Range; return l.setStart(a, 0), l.setEnd(a, 1), s.removeAllRanges(), s.addRange(l), new Promise((c, u) => { let p = n.registerCommand(Es, g => (jt(g, ClipboardEvent) && (p(), go !== null && (window.clearTimeout(go), go = null), c(_h(n, g, t))), !0), vt); go = window.setTimeout(() => { p(), go = null, c(!1) }, 50), i.execCommand("copy"), a.remove() }) } function _h(n, e, t) { if (t === void 0) { let o = qn(n._window); if (!o) return !1; let i = o.anchorNode, s = o.focusNode; if (i !== null && s !== null && !wg(n, i, s)) return !1; let a = k(); if (a === null) return !1; t = Th(a) } e.preventDefault(); let r = e.clipboardData; return r !== null && (Eh(r, t), !0) } var rN = [["text/html", Ch], ["application/x-lexical-editor", yh]]; function Th(n = k()) { let e = { "text/plain": n ? n.getTextContent() : "" }; if (n) { let t = xn(); for (let [r, o] of rN) { let i = o(t, n); i !== null && (e[r] = i) } } return e } function Eh(n, e) { for (let t in e) { let r = e[t]; r !== void 0 && n.setData(t, r) } } var rn = Nc, gT = rn.$generateJSONFromSelectedNodes, hT = rn.$generateNodesFromSerializedNodes, bh = rn.$getClipboardDataFromSelection, pT = rn.$getHtmlContent, mT = rn.$getLexicalContent, _T = rn.$insertDataTransferForPlainText, xc = rn.$insertDataTransferForRichText, CT = rn.$insertGeneratedNodes, hi = rn.copyToClipboard, yT = rn.setLexicalClipboardDataTransfer; var bc = {}; At(bc, { $createHeadingNode: () => po, $createQuoteNode: () => Ec, $isHeadingNode: () => dN, $isQuoteNode: () => cN, DRAG_DROP_PASTE: () => Tc, HeadingNode: () => _i, QuoteNode: () => mi, eventFiles: () => pi, registerRichText: () => fN }); function Ah(n, e) { if (document.caretRangeFromPoint !== void 0) { let t = document.caretRangeFromPoint(n, e); return t === null ? null : { node: t.startContainer, offset: t.startOffset } } if (document.caretPositionFromPoint !== "undefined") { let t = document.caretPositionFromPoint(n, e); return t === null ? null : { node: t.offsetNode, offset: t.offset } } return null } var mo = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, oN = mo && "documentMode" in document ? document.documentMode : null, iN = !(!mo || !("InputEvent" in window) || oN) && "getTargetRanges" in new window.InputEvent("input"), sN = mo && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Oh = mo && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, aN = mo && /^(?=.*Chrome).*/i.test(navigator.userAgent), lN = mo && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !aN, Tc = ct("DRAG_DROP_PASTE_FILE"), mi = class n extends xt { static getType() { return "quote" } static clone(e) { return new n(e.__key) } createDOM(e) { let t = document.createElement("blockquote"); return pe(t, e.theme.quote), t } updateDOM(e, t) { return !1 } static importDOM() { return { blockquote: e => ({ conversion: uN, priority: 0 }) } } exportDOM(e) { let { element: t } = super.exportDOM(e); if (je(t)) { this.isEmpty() && t.append(document.createElement("br")); let r = this.getFormatType(); t.style.textAlign = r; let o = this.getDirection(); o && (t.dir = o) } return { element: t } } static importJSON(e) { return Ec().updateFromJSON(e) } insertNewAfter(e, t) { let r = oe(), o = this.getDirection(); return r.setDirection(o), this.insertAfter(r, t), r } collapseAtStart() { let e = oe(); return this.getChildren().forEach(t => e.append(t)), this.replace(e), !0 } canMergeWhenEmpty() { return !0 } }; function Ec() { return Te(new mi) } function cN(n) { return n instanceof mi } var _i = class n extends xt { static getType() { return "heading" } static clone(e) { return new n(e.__tag, e.__key) } constructor(e, t) { super(t), this.__tag = e } getTag() { return this.__tag } setTag(e) { let t = this.getWritable(); return this.__tag = e, t } createDOM(e) { let t = this.__tag, r = document.createElement(t), o = e.theme.heading; if (o !== void 0) { let i = o[t]; pe(r, i) } return r } updateDOM(e, t, r) { return e.__tag !== this.__tag } static importDOM() { return { h1: e => ({ conversion: ho, priority: 0 }), h2: e => ({ conversion: ho, priority: 0 }), h3: e => ({ conversion: ho, priority: 0 }), h4: e => ({ conversion: ho, priority: 0 }), h5: e => ({ conversion: ho, priority: 0 }), h6: e => ({ conversion: ho, priority: 0 }), p: e => { let t = e.firstChild; return t !== null && vh(t) ? { conversion: () => ({ node: null }), priority: 3 } : null }, span: e => vh(e) ? { conversion: t => ({ node: po("h1") }), priority: 3 } : null } } exportDOM(e) { let { element: t } = super.exportDOM(e); if (je(t)) { this.isEmpty() && t.append(document.createElement("br")); let r = this.getFormatType(); t.style.textAlign = r; let o = this.getDirection(); o && (t.dir = o) } return { element: t } } static importJSON(e) { return po(e.tag).updateFromJSON(e) } updateFromJSON(e) { return super.updateFromJSON(e).setTag(e.tag) } exportJSON() { return { ...super.exportJSON(), tag: this.getTag() } } insertNewAfter(e, t = !0) { let r = e ? e.anchor.offset : 0, o = this.getLastDescendant(), i = !o || e && e.anchor.key === o.getKey() && r === o.getTextContentSize() || !e ? oe() : po(this.getTag()), s = this.getDirection(); if (i.setDirection(s), this.insertAfter(i, t), r === 0 && !this.isEmpty() && e) { let a = oe(); a.select(), this.replace(a, !0) } return i } collapseAtStart() { let e = this.isEmpty() ? oe() : po(this.getTag()); return this.getChildren().forEach(t => e.append(t)), this.replace(e), !0 } extractWithChild() { return !0 } }; function vh(n) { return n.nodeName.toLowerCase() === "span" && n.style.fontSize === "26pt" } function ho(n) { let e = n.nodeName.toLowerCase(), t = null; return e !== "h1" && e !== "h2" && e !== "h3" && e !== "h4" && e !== "h5" && e !== "h6" || (t = po(e), n.style !== null && (tc(n, t), t.setFormat(n.style.textAlign))), { node: t } } function uN(n) { let e = Ec(); return n.style !== null && (e.setFormat(n.style.textAlign), tc(n, e)), { node: e } } function po(n = "h1") { return Te(new _i(n)) } function dN(n) { return n instanceof _i } function pi(n) { let e = null; if (jt(n, DragEvent) ? e = n.dataTransfer : jt(n, ClipboardEvent) && (e = n.clipboardData), e === null) return [!1, [], !1]; let t = e.types, r = t.includes("Files"), o = t.includes("text/html") || t.includes("text/plain"); return [r, Array.from(e.files), o] } function Dh(n) { let e = k(); if (!v(e)) return !1; let t = new Set, r = e.getNodes(); for (let o = 0; o < r.length; o++) { let i = r[o], s = i.getKey(); if (t.has(s)) continue; let a = Q(i, c => $(c) && !c.isInline()); if (a === null) continue; let l = a.getKey(); a.canIndent() && !t.has(l) && (t.add(l), n(a)) } return t.size > 0 } function wh(n) { let e = $e(n); return Tn(e) } function Sc(n) { for (let e of ["lowercase", "uppercase", "capitalize"]) n.hasFormat(e) && n.toggleFormat(e) } function fN(n) { return Mt(n.registerCommand(xs, e => { let t = k(); return !!Nt(t) && (t.clear(), !0) }, 0), n.registerCommand(ao, e => { let t = k(); return v(t) ? (t.deleteCharacter(e), !0) : !!Nt(t) && (t.deleteNodes(), !0) }, te), n.registerCommand(As, e => { let t = k(); return !!v(t) && (t.deleteWord(e), !0) }, te), n.registerCommand(li, e => { let t = k(); return !!v(t) && (t.deleteLine(e), !0) }, te), n.registerCommand(Ts, e => { let t = k(); if (typeof e == "string") t !== null && t.insertText(e); else { if (t === null) return !1; let r = e.dataTransfer; if (r != null) xc(r, t, n); else if (v(t)) { let o = e.data; return o && t.insertText(o), !0 } } return !0 }, te), n.registerCommand(Tg, () => { let e = k(); return !!v(e) && (e.removeText(), !0) }, te), n.registerCommand(lt, e => { let t = k(); return !!v(t) && (t.formatText(e), !0) }, te), n.registerCommand(Dt, e => { let t = k(); if (!v(t) && !Nt(t)) return !1; let r = t.getNodes(); for (let o of r) { let i = Q(o, s => $(s) && !s.isInline()); i !== null && i.setFormat(e) } return !0 }, te), n.registerCommand(ql, e => { let t = k(); return !!v(t) && (t.insertLineBreak(e), !0) }, te), n.registerCommand(Xn, () => { let e = k(); return !!v(e) && (e.insertParagraph(), !0) }, te), n.registerCommand(ci, () => (Gn([Ft()]), !0), te), n.registerCommand(wt, () => Dh(e => { let t = e.getIndent(); e.setIndent(t + 1) }), te), n.registerCommand(Lt, () => Dh(e => { let t = e.getIndent(); t > 0 && e.setIndent(Math.max(0, t - 1)) }), te), n.registerCommand(Gt, e => { let t = k(); if (Nt(t)) { let r = t.getNodes(); if (r.length > 0) return r[0].selectPrevious(), !0 } else if (v(t)) { let r = jl(t.focus, !0); if (!e.shiftKey && Tn(r) && !r.isIsolated() && !r.isInline()) return r.selectPrevious(), e.preventDefault(), !0 } return !1 }, te), n.registerCommand(En, e => { let t = k(); if (Nt(t)) { let r = t.getNodes(); if (r.length > 0) return r[0].selectNext(0, 0), !0 } else if (v(t)) { if (function (o) { let i = o.focus; return i.key === "root" && i.offset === Ge().getChildrenSize() }(t)) return e.preventDefault(), !0; let r = jl(t.focus, !1); if (!e.shiftKey && Tn(r) && !r.isIsolated() && !r.isInline()) return r.selectNext(), e.preventDefault(), !0 } return !1 }, te), n.registerCommand(lo, e => { let t = k(); if (Nt(t)) { let r = t.getNodes(); if (r.length > 0) return e.preventDefault(), r[0].selectPrevious(), !0 } if (!v(t)) return !1; if (lc(t, !0)) { let r = e.shiftKey; return e.preventDefault(), ac(t, r, !0), !0 } return !1 }, te), n.registerCommand(ws, e => { let t = k(); if (Nt(t)) { let o = t.getNodes(); if (o.length > 0) return e.preventDefault(), o[0].selectNext(0, 0), !0 } if (!v(t)) return !1; let r = e.shiftKey; return !!lc(t, !1) && (e.preventDefault(), ac(t, r, !1), !0) }, te), n.registerCommand(Ms, e => { if (wh(e.target)) return !1; let t = k(); if (v(t)) { let { anchor: r } = t, o = r.getNode(); if (t.isCollapsed() && r.offset === 0 && !en(o) && Gs(o).getIndent() > 0) return e.preventDefault(), n.dispatchCommand(Lt, void 0); if (Oh && navigator.language === "ko-KR") return !1 } else if (!Nt(t)) return !1; return e.preventDefault(), n.dispatchCommand(ao, !0) }, te), n.registerCommand(ks, e => { if (wh(e.target)) return !1; let t = k(); return !(!v(t) && !Nt(t)) && (e.preventDefault(), n.dispatchCommand(ao, !1)) }, te), n.registerCommand(yg, e => { let t = k(); if (!v(t)) return !1; if (Sc(t), e !== null) { if ((Oh || sN || lN) && iN) return !1; if (e.preventDefault(), e.shiftKey) return n.dispatchCommand(ql, !1) } return n.dispatchCommand(Xn, void 0) }, te), n.registerCommand(co, () => { let e = k(); return !!v(e) && (n.blur(), !0) }, te), n.registerCommand(pg, e => { let [, t] = pi(e); if (t.length > 0) { let o = Ah(e.clientX, e.clientY); if (o !== null) { let { offset: i, node: s } = o, a = $e(s); if (a !== null) { let l = so(); if (Z(a)) l.anchor.set(a.getKey(), i, "text"), l.focus.set(a.getKey(), i, "text"); else { let u = a.getParentOrThrow().getKey(), p = a.getIndexWithinParent() + 1; l.anchor.set(u, p, "element"), l.focus.set(u, p, "element") } let c = xr(l); Ye(c) } n.dispatchCommand(Tc, t) } return e.preventDefault(), !0 } let r = k(); return !!v(r) }, te), n.registerCommand(hg, e => { let [t] = pi(e), r = k(); return !(t && !v(r)) }, te), n.registerCommand(gg, e => { let [t] = pi(e), r = k(); if (t && !v(r)) return !1; let o = Ah(e.clientX, e.clientY); if (o !== null) { let i = $e(o.node); Tn(i) && e.preventDefault() } return !0 }, te), n.registerCommand(Eg, () => (Ns(), !0), te), n.registerCommand(Es, e => (hi(n, jt(e, ClipboardEvent) ? e : null), !0), te), n.registerCommand(bs, e => (async function (t, r) { await hi(r, jt(t, ClipboardEvent) ? t : null), r.update(() => { let o = k(); v(o) ? o.removeText() : Nt(o) && o.getNodes().forEach(i => i.remove()) }) }(e, n), !0), te), n.registerCommand(xg, e => { let [, t, r] = pi(e); return t.length > 0 && !r ? (n.dispatchCommand(Tc, t), !0) : tn(e.target) && Dg(e.target) ? !1 : k() !== null && (function (o, i) { o.preventDefault(), i.update(() => { let s = k(), a = jt(o, InputEvent) || jt(o, KeyboardEvent) ? null : o.clipboardData; a != null && s !== null && xc(a, s, i) }, { tag: Sg }) }(e, n), !0) }, te), n.registerCommand(Rs, e => { let t = k(); return v(t) && Sc(t), !1 }, te), n.registerCommand(uo, e => { let t = k(); return v(t) && Sc(t), !1 }, te)) } var bn = bc, qs = bn.$createHeadingNode, Mh = bn.$createQuoteNode, Zs = bn.$isHeadingNode, kh = bn.$isQuoteNode, bT = bn.DRAG_DROP_PASTE, Rh = bn.HeadingNode, Fh = bn.QuoteNode, AT = bn.eventFiles, Lh = bn.registerRichText; var Ac = {}; At(Ac, { $createHashtagNode: () => $h, $isHashtagNode: () => gN, HashtagNode: () => Ci }); var Ci = class n extends St { static getType() { return "hashtag" } static clone(e) { return new n(e.__text, e.__key) } createDOM(e) { let t = super.createDOM(e); return pe(t, e.theme.hashtag), t } static importJSON(e) { return $h().updateFromJSON(e) } canInsertTextBefore() { return !1 } isTextEntity() { return !0 } }; function $h(n = "") { return Te(new Ci(n)) } function gN(n) { return n instanceof Ci } var Oc = Ac, Ih = Oc.$createHashtagNode, wT = Oc.$isHashtagNode, vc = Oc.HashtagNode; var RT = Au(Dc(), 1); Prism.languages.clike = { comment: [{ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, lookbehind: !0, greedy: !0 }, { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }], string: { pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, greedy: !0 }, "class-name": { pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i, lookbehind: !0, inside: { punctuation: /[.\\]/ } }, keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/, boolean: /\b(?:false|true)\b/, function: /\b\w+(?=\()/, number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, punctuation: /[{}[\];(),.:]/ }; Prism.languages.javascript = Prism.languages.extend("clike", { "class-name": [Prism.languages.clike["class-name"], { pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/, lookbehind: !0 }], keyword: [{ pattern: /((?:^|\})\s*)catch\b/, lookbehind: !0 }, { pattern: /(^|[^.]|\.\.\.\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/, lookbehind: !0 }], function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, number: { pattern: RegExp(/(^|[^\w$])/.source + "(?:" + (/NaN|Infinity/.source + "|" + /0[bB][01]+(?:_[01]+)*n?/.source + "|" + /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + /\d+(?:_\d+)*n/.source + "|" + /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source), lookbehind: !0 }, operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/ }); Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/; Prism.languages.insertBefore("javascript", "keyword", { regex: { pattern: RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source), lookbehind: !0, greedy: !0, inside: { "regex-source": { pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/, lookbehind: !0, alias: "language-regex", inside: Prism.languages.regex }, "regex-delimiter": /^\/|\/$/, "regex-flags": /^[a-z]+$/ } }, "function-variable": { pattern: /#?(?!\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*=>))/, alias: "function" }, parameter: [{ pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/, lookbehind: !0, inside: Prism.languages.javascript }, { pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i, lookbehind: !0, inside: Prism.languages.javascript }, { pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/, lookbehind: !0, inside: Prism.languages.javascript }, { pattern: /((?:\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*\{)/, lookbehind: !0, inside: Prism.languages.javascript }], constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/ }); Prism.languages.insertBefore("javascript", "string", { hashbang: { pattern: /^#!.*/, greedy: !0, alias: "comment" }, "template-string": { pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/, greedy: !0, inside: { "template-punctuation": { pattern: /^`|`$/, alias: "string" }, interpolation: { pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, lookbehind: !0, inside: { "interpolation-punctuation": { pattern: /^\$\{|\}$/, alias: "punctuation" }, rest: Prism.languages.javascript } }, string: /[\s\S]+/ } }, "string-property": { pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m, lookbehind: !0, greedy: !0, alias: "property" } }); Prism.languages.insertBefore("javascript", "operator", { "literal-property": { pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m, lookbehind: !0, alias: "property" } }); Prism.languages.markup && (Prism.languages.markup.tag.addInlined("script", "javascript"), Prism.languages.markup.tag.addAttribute(/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, "javascript")); Prism.languages.js = Prism.languages.javascript; Prism.languages.markup = { comment: { pattern: //, greedy: !0 }, prolog: { pattern: /<\?[\s\S]+?\?>/, greedy: !0 }, doctype: { pattern: /"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i, greedy: !0, inside: { "internal-subset": { pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/, lookbehind: !0, greedy: !0, inside: null }, string: { pattern: /"[^"]*"|'[^']*'/, greedy: !0 }, punctuation: /^$|[[\]]/, "doctype-tag": /^DOCTYPE/i, name: /[^\s<>'"]+/ } }, cdata: { pattern: //i, greedy: !0 }, tag: { pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/, greedy: !0, inside: { tag: { pattern: /^<\/?[^\s>\/]+/, inside: { punctuation: /^<\/?/, namespace: /^[^\s>\/:]+:/ } }, "special-attr": [], "attr-value": { pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/, inside: { punctuation: [{ pattern: /^=/, alias: "attr-equals" }, { pattern: /^(\s*)["']|["']$/, lookbehind: !0 }] } }, punctuation: /\/?>/, "attr-name": { pattern: /[^\s>\/]+/, inside: { namespace: /^[^\s>\/:]+:/ } } } }, entity: [{ pattern: /&[\da-z]{1,8};/i, alias: "named-entity" }, /&#x?[\da-f]{1,8};/i] }; Prism.languages.markup.tag.inside["attr-value"].inside.entity = Prism.languages.markup.entity; Prism.languages.markup.doctype.inside["internal-subset"].inside = Prism.languages.markup; Prism.hooks.add("wrap", function (n) { n.type === "entity" && (n.attributes.title = n.content.replace(/&/, "&")) }); Object.defineProperty(Prism.languages.markup.tag, "addInlined", { value: function (e, t) { var r = {}; r["language-" + t] = { pattern: /(^$)/i, lookbehind: !0, inside: Prism.languages[t] }, r.cdata = /^$/i; var o = { "included-cdata": { pattern: //i, inside: r } }; o["language-" + t] = { pattern: /[\s\S]+/, inside: Prism.languages[t] }; var i = {}; i[e] = { pattern: RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g, function () { return e }), "i"), lookbehind: !0, greedy: !0, inside: o }, Prism.languages.insertBefore("markup", "cdata", i) } }); Object.defineProperty(Prism.languages.markup.tag, "addAttribute", { value: function (n, e) { Prism.languages.markup.tag.inside["special-attr"].push({ pattern: RegExp(/(^|["'\s])/.source + "(?:" + n + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, "i"), lookbehind: !0, inside: { "attr-name": /^[^\s=]+/, "attr-value": { pattern: /=[\s\S]+/, inside: { value: { pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/, lookbehind: !0, alias: [e, "language-" + e], inside: Prism.languages[e] }, punctuation: [{ pattern: /^=/, alias: "attr-equals" }, /"|'/] } } } }) } }); Prism.languages.html = Prism.languages.markup; Prism.languages.mathml = Prism.languages.markup; Prism.languages.svg = Prism.languages.markup; Prism.languages.xml = Prism.languages.extend("markup", {}); Prism.languages.ssml = Prism.languages.xml; Prism.languages.atom = Prism.languages.xml; Prism.languages.rss = Prism.languages.xml; (function (n) { var e = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source; function t(u) { return u = u.replace(//g, function () { return e }), RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + u + ")") } var r = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source, o = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g, function () { return r }), i = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source; n.languages.markdown = n.languages.extend("markup", {}), n.languages.insertBefore("markdown", "prolog", { "front-matter-block": { pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/, lookbehind: !0, greedy: !0, inside: { punctuation: /^---|---$/, "front-matter": { pattern: /\S+(?:\s+\S+)*/, alias: ["yaml", "language-yaml"], inside: n.languages.yaml } } }, blockquote: { pattern: /^>(?:[\t ]*>)*/m, alias: "punctuation" }, table: { pattern: RegExp("^" + o + i + "(?:" + o + ")*", "m"), inside: { "table-data-rows": { pattern: RegExp("^(" + o + i + ")(?:" + o + ")*$"), lookbehind: !0, inside: { "table-data": { pattern: RegExp(r), inside: n.languages.markdown }, punctuation: /\|/ } }, "table-line": { pattern: RegExp("^(" + o + ")" + i + "$"), lookbehind: !0, inside: { punctuation: /\||:?-{3,}:?/ } }, "table-header-row": { pattern: RegExp("^" + o + "$"), inside: { "table-header": { pattern: RegExp(r), alias: "important", inside: n.languages.markdown }, punctuation: /\|/ } } } }, code: [{ pattern: /((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/, lookbehind: !0, alias: "keyword" }, { pattern: /^```[\s\S]*?^```$/m, greedy: !0, inside: { "code-block": { pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m, lookbehind: !0 }, "code-language": { pattern: /^(```).+/, lookbehind: !0 }, punctuation: /```/ } }], title: [{ pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m, alias: "important", inside: { punctuation: /==+$|--+$/ } }, { pattern: /(^\s*)#.+/m, lookbehind: !0, alias: "important", inside: { punctuation: /^#+|#+$/ } }], hr: { pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m, lookbehind: !0, alias: "punctuation" }, list: { pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m, lookbehind: !0, alias: "punctuation" }, "url-reference": { pattern: /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/, inside: { variable: { pattern: /^(!?\[)[^\]]+/, lookbehind: !0 }, string: /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/, punctuation: /^[\[\]!:]|[<>]/ }, alias: "url" }, bold: { pattern: t(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source), lookbehind: !0, greedy: !0, inside: { content: { pattern: /(^..)[\s\S]+(?=..$)/, lookbehind: !0, inside: {} }, punctuation: /\*\*|__/ } }, italic: { pattern: t(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source), lookbehind: !0, greedy: !0, inside: { content: { pattern: /(^.)[\s\S]+(?=.$)/, lookbehind: !0, inside: {} }, punctuation: /[*_]/ } }, strike: { pattern: t(/(~~?)(?:(?!~))+\2/.source), lookbehind: !0, greedy: !0, inside: { content: { pattern: /(^~~?)[\s\S]+(?=\1$)/, lookbehind: !0, inside: {} }, punctuation: /~~?/ } }, "code-snippet": { pattern: /(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/, lookbehind: !0, greedy: !0, alias: ["code", "keyword"] }, url: { pattern: t(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source), lookbehind: !0, greedy: !0, inside: { operator: /^!/, content: { pattern: /(^\[)[^\]]+(?=\])/, lookbehind: !0, inside: {} }, variable: { pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/, lookbehind: !0 }, url: { pattern: /(^\]\()[^\s)]+/, lookbehind: !0 }, string: { pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/, lookbehind: !0 } } } }), ["url", "bold", "italic", "strike"].forEach(function (u) { ["url", "bold", "italic", "strike", "code-snippet"].forEach(function (p) { u !== p && (n.languages.markdown[u].inside.content.inside[p] = n.languages.markdown[p]) }) }), n.hooks.add("after-tokenize", function (u) { if (u.language !== "markdown" && u.language !== "md") return; function p(g) { if (!(!g || typeof g == "string")) for (var f = 0, d = g.length; f < d; f++) { var m = g[f]; if (m.type !== "code") { p(m.content); continue } var h = m.content[1], _ = m.content[3]; if (h && _ && h.type === "code-language" && _.type === "code-block" && typeof h.content == "string") { var C = h.content.replace(/\b#/g, "sharp").replace(/\b\+\+/g, "pp"); C = (/[a-z][\w-]*/i.exec(C) || [""])[0].toLowerCase(); var y = "language-" + C; _.alias ? typeof _.alias == "string" ? _.alias = [_.alias, y] : _.alias.push(y) : _.alias = [y] } } } p(u.tokens) }), n.hooks.add("wrap", function (u) { if (u.type === "code-block") { for (var p = "", g = 0, f = u.classes.length; g < f; g++) { var d = u.classes[g], m = /language-(.+)/.exec(d); if (m) { p = m[1]; break } } var h = n.languages[p]; if (h) u.content = n.highlight(c(u.content), h, p); else if (p && p !== "none" && n.plugins.autoloader) { var _ = "md-" + new Date().valueOf() + "-" + Math.floor(Math.random() * 1e16); u.attributes.id = _, n.plugins.autoloader.loadLanguages(p, function () { var C = document.getElementById(_); C && (C.innerHTML = n.highlight(C.textContent, n.languages[p], p)) }) } } }); var s = RegExp(n.languages.markup.tag.pattern.source, "gi"), a = { amp: "&", lt: "<", gt: ">", quot: '"' }, l = String.fromCodePoint || String.fromCharCode; function c(u) { var p = u.replace(s, ""); return p = p.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function (g, f) { if (f = f.toLowerCase(), f[0] === "#") { var d; return f[1] === "x" ? d = parseInt(f.slice(2), 16) : d = Number(f.slice(1)), l(d) } else { var m = a[f]; return m || g } }), p } n.languages.md = n.languages.markdown })(Prism); Prism.languages.c = Prism.languages.extend("clike", { comment: { pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/, greedy: !0 }, string: { pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, greedy: !0 }, "class-name": { pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/, lookbehind: !0 }, 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/, function: /\b[a-z_]\w*(?=\s*\()/i, number: /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i, operator: />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/ }); Prism.languages.insertBefore("c", "string", { char: { pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/, greedy: !0 } }); Prism.languages.insertBefore("c", "string", { macro: { pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im, lookbehind: !0, greedy: !0, alias: "property", inside: { string: [{ pattern: /^(#\s*include\s*)<[^>]+>/, lookbehind: !0 }, Prism.languages.c.string], char: Prism.languages.c.char, comment: Prism.languages.c.comment, "macro-name": [{ pattern: /(^#\s*define\s+)\w+\b(?!\()/i, lookbehind: !0 }, { pattern: /(^#\s*define\s+)\w+\b(?=\()/i, lookbehind: !0, alias: "function" }], directive: { pattern: /^(#\s*)[a-z]+/, lookbehind: !0, alias: "keyword" }, "directive-hash": /^#/, punctuation: /##|\\(?=[\r\n])/, expression: { pattern: /\S[\s\S]*/, inside: Prism.languages.c } } } }); Prism.languages.insertBefore("c", "function", { constant: /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/ }); delete Prism.languages.c.boolean; (function (n) { var e = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/; n.languages.css = { comment: /\/\*[\s\S]*?\*\//, atrule: { pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + e.source + ")*?" + /(?:;|(?=\s*\{))/.source), inside: { rule: /^@[\w-]+/, "selector-function-argument": { pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/, lookbehind: !0, alias: "selector" }, keyword: { pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/, lookbehind: !0 } } }, url: { pattern: RegExp("\\burl\\((?:" + e.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"), greedy: !0, inside: { function: /^url/i, punctuation: /^\(|\)$/, string: { pattern: RegExp("^" + e.source + "$"), alias: "url" } } }, selector: { pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + e.source + ")*(?=\\s*\\{)"), lookbehind: !0 }, string: { pattern: e, greedy: !0 }, property: { pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i, lookbehind: !0 }, important: /!important\b/i, function: { pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i, lookbehind: !0 }, punctuation: /[(){};:,]/ }, n.languages.css.atrule.inside.rest = n.languages.css; var t = n.languages.markup; t && (t.tag.addInlined("style", "css"), t.tag.addAttribute("style", "css")) })(Prism); Prism.languages.objectivec = Prism.languages.extend("c", { string: { pattern: /@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, greedy: !0 }, 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/, operator: /-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/ }); delete Prism.languages.objectivec["class-name"]; Prism.languages.objc = Prism.languages.objectivec; Prism.languages.sql = { comment: { pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/, lookbehind: !0 }, variable: [{ pattern: /@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/, greedy: !0 }, /@[\w.$]+/], string: { pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/, greedy: !0, lookbehind: !0 }, identifier: { pattern: /(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/, greedy: !0, lookbehind: !0, inside: { punctuation: /^`|`$/ } }, function: /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i, 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, boolean: /\b(?:FALSE|NULL|TRUE)\b/i, number: /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i, operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i, punctuation: /[;[\]()`,.]/ }; (function (n) { var e = n.languages.powershell = { comment: [{ pattern: /(^|[^`])<#[\s\S]*?#>/, lookbehind: !0 }, { pattern: /(^|[^`])#.*/, lookbehind: !0 }], string: [{ pattern: /"(?:`[\s\S]|[^`"])*"/, greedy: !0, inside: null }, { pattern: /'(?:[^']|'')*'/, greedy: !0 }], namespace: /\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i, boolean: /\$(?:false|true)\b/i, variable: /\$\w+\b/, function: [/\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, /\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], 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, operator: { pattern: /(^|\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, lookbehind: !0 }, punctuation: /[|{}[\];(),.]/ }; e.string[0].inside = { function: { pattern: /(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/, lookbehind: !0, inside: e }, boolean: e.boolean, variable: e.variable } })(Prism); Prism.languages.python = { comment: { pattern: /(^|[^\\])#.*/, lookbehind: !0, greedy: !0 }, "string-interpolation": { pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i, greedy: !0, inside: { interpolation: { pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/, lookbehind: !0, inside: { "format-spec": { pattern: /(:)[^:(){}]+(?=\}$)/, lookbehind: !0 }, "conversion-option": { pattern: /![sra](?=[:}]$)/, alias: "punctuation" }, rest: null } }, string: /[\s\S]+/ } }, "triple-quoted-string": { pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i, greedy: !0, alias: "string" }, string: { pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i, greedy: !0 }, function: { pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g, lookbehind: !0 }, "class-name": { pattern: /(\bclass\s+)\w+/i, lookbehind: !0 }, decorator: { pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m, lookbehind: !0, alias: ["annotation", "punctuation"], inside: { punctuation: /\./ } }, 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/, 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/, boolean: /\b(?:False|None|True)\b/, 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, operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, punctuation: /[{}[\];(),.:]/ }; Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python; Prism.languages.py = Prism.languages.python; (function (n) { for (var e = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source, t = 0; t < 2; t++)e = e.replace(//g, function () { return e }); e = e.replace(//g, function () { return /[^\s\S]/.source }), n.languages.rust = { comment: [{ pattern: RegExp(/(^|[^\\])/.source + e), lookbehind: !0, greedy: !0 }, { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }], string: { pattern: /b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/, greedy: !0 }, char: { pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/, greedy: !0 }, attribute: { pattern: /#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/, greedy: !0, alias: "attr-name", inside: { string: null } }, "closure-params": { pattern: /([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/, lookbehind: !0, greedy: !0, inside: { "closure-punctuation": { pattern: /^\||\|$/, alias: "punctuation" }, rest: null } }, "lifetime-annotation": { pattern: /'\w+/, alias: "symbol" }, "fragment-specifier": { pattern: /(\$\w+:)[a-z]+/, lookbehind: !0, alias: "punctuation" }, variable: /\$\w+/, "function-definition": { pattern: /(\bfn\s+)\w+/, lookbehind: !0, alias: "function" }, "type-definition": { pattern: /(\b(?:enum|struct|trait|type|union)\s+)\w+/, lookbehind: !0, alias: "class-name" }, "module-declaration": [{ pattern: /(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/, lookbehind: !0, alias: "namespace" }, { pattern: /(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/, lookbehind: !0, alias: "namespace", inside: { punctuation: /::/ } }], keyword: [/\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/, /\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/], function: /\b[a-z_]\w*(?=\s*(?:::\s*<|\())/, macro: { pattern: /\b\w+!/, alias: "property" }, constant: /\b[A-Z_][A-Z_\d]+\b/, "class-name": /\b[A-Z]\w*\b/, namespace: { pattern: /(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/, inside: { punctuation: /::/ } }, 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/, boolean: /\b(?:false|true)\b/, punctuation: /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/, operator: /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/ }, n.languages.rust["closure-params"].inside.rest = n.languages.rust, n.languages.rust.attribute.inside.string = n.languages.rust.string })(Prism); Prism.languages.swift = { comment: { pattern: /(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/, lookbehind: !0, greedy: !0 }, "string-literal": [{ pattern: RegExp(/(^|[^"#])/.source + "(?:" + /"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source + "|" + /"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source + ")" + /(?!["#])/.source), lookbehind: !0, greedy: !0, inside: { interpolation: { pattern: /(\\\()(?:[^()]|\([^()]*\))*(?=\))/, lookbehind: !0, inside: null }, "interpolation-punctuation": { pattern: /^\)|\\\($/, alias: "punctuation" }, punctuation: /\\(?=[\r\n])/, string: /[\s\S]+/ } }, { pattern: RegExp(/(^|[^"#])(#+)/.source + "(?:" + /"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source + "|" + /"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source + ")\\2"), lookbehind: !0, greedy: !0, inside: { interpolation: { pattern: /(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/, lookbehind: !0, inside: null }, "interpolation-punctuation": { pattern: /^\)|\\#+\($/, alias: "punctuation" }, string: /[\s\S]+/ } }], directive: { pattern: RegExp(/#/.source + "(?:" + (/(?:elseif|if)\b/.source + "(?:[ ]*" + /(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source + ")+") + "|" + /(?:else|endif)\b/.source + ")"), alias: "property", inside: { "directive-name": /^#\w+/, boolean: /\b(?:false|true)\b/, number: /\b\d+(?:\.\d+)*\b/, operator: /!|&&|\|\||[<>]=?/, punctuation: /[(),]/ } }, literal: { pattern: /#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/, alias: "constant" }, "other-directive": { pattern: /#\w+\b/, alias: "property" }, attribute: { pattern: /@\w+/, alias: "atrule" }, "function-definition": { pattern: /(\bfunc\s+)\w+/, lookbehind: !0, alias: "function" }, label: { pattern: /\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/, lookbehind: !0, alias: "important" }, 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/, boolean: /\b(?:false|true)\b/, nil: { pattern: /\bnil\b/, alias: "constant" }, "short-argument": /\$\d+\b/, omit: { pattern: /\b_\b/, alias: "keyword" }, number: /\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i, "class-name": /\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/, function: /\b[a-z_]\w*(?=\s*\()/i, constant: /\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/, operator: /[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/, punctuation: /[{}[\]();,.:\\]/ }; Prism.languages.swift["string-literal"].forEach(function (n) { n.inside.interpolation.inside = Prism.languages.swift }); (function (n) { n.languages.typescript = n.languages.extend("javascript", { "class-name": { pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/, lookbehind: !0, greedy: !0, inside: null }, builtin: /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/ }), n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/, /\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/, /\btype\b(?=\s*(?:[\{*]|$))/), delete n.languages.typescript.parameter, delete n.languages.typescript["literal-property"]; var e = n.languages.extend("typescript", {}); delete e["class-name"], n.languages.typescript["class-name"].inside = e, n.languages.insertBefore("typescript", "function", { decorator: { pattern: /@[$\w\xA0-\uFFFF]+/, inside: { at: { pattern: /^@/, alias: "operator" }, function: /^[\s\S]+/ } }, "generic-function": { pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/, greedy: !0, inside: { function: /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/, generic: { pattern: /<[\s\S]+/, alias: "class-name", inside: e } } } }), n.languages.ts = n.languages.typescript })(Prism); (function (n) { var e = /\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/, t = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, r = { pattern: RegExp(/(^|[^\w.])/.source + t + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source), lookbehind: !0, inside: { namespace: { pattern: /^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/, inside: { punctuation: /\./ } }, punctuation: /\./ } }; n.languages.java = n.languages.extend("clike", { string: { pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/, lookbehind: !0, greedy: !0 }, "class-name": [r, { pattern: RegExp(/(^|[^\w.])/.source + t + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source), lookbehind: !0, inside: r.inside }, { pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + t + /[A-Z]\w*\b/.source), lookbehind: !0, inside: r.inside }], keyword: e, function: [n.languages.clike.function, { pattern: /(::\s*)[a-z_]\w*/, lookbehind: !0 }], 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, operator: { pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m, lookbehind: !0 }, constant: /\b[A-Z][A-Z_\d]+\b/ }), n.languages.insertBefore("java", "string", { "triple-quoted-string": { pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/, greedy: !0, alias: "string" }, char: { pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/, greedy: !0 } }), n.languages.insertBefore("java", "class-name", { annotation: { pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/, lookbehind: !0, alias: "punctuation" }, generics: { pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/, inside: { "class-name": r, keyword: e, punctuation: /[<>(),.:]/, operator: /[?&|]/ } }, import: [{ pattern: RegExp(/(\bimport\s+)/.source + t + /(?:[A-Z]\w*|\*)(?=\s*;)/.source), lookbehind: !0, inside: { namespace: r.inside.namespace, punctuation: /\./, operator: /\*/, "class-name": /\w+/ } }, { pattern: RegExp(/(\bimport\s+static\s+)/.source + t + /(?:\w+|\*)(?=\s*;)/.source), lookbehind: !0, alias: "static", inside: { namespace: r.inside.namespace, static: /\b\w+$/, punctuation: /\./, operator: /\*/, "class-name": /\w+/ } }], namespace: { pattern: RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g, function () { return e.source })), lookbehind: !0, inside: { punctuation: /\./ } } }) })(Prism); (function (n) { var e = /\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/, t = /\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g, function () { return e.source }); n.languages.cpp = n.languages.extend("c", { "class-name": [{ pattern: RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g, function () { return e.source })), lookbehind: !0 }, /\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/, /\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i, /\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/], keyword: e, number: { pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i, greedy: !0 }, operator: />>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/, boolean: /\b(?:false|true)\b/ }), n.languages.insertBefore("cpp", "string", { module: { pattern: RegExp(/(\b(?:import|module)\s+)/.source + "(?:" + /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source + "|" + /(?:\s*:\s*)?|:\s*/.source.replace(//g, function () { return t }) + ")"), lookbehind: !0, greedy: !0, inside: { string: /^[<"][\s\S]+/, operator: /:/, punctuation: /\./ } }, "raw-string": { pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/, alias: "string", greedy: !0 } }), n.languages.insertBefore("cpp", "keyword", { "generic-function": { pattern: /\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i, inside: { function: /^\w+/, generic: { pattern: /<[\s\S]+/, alias: "class-name", inside: n.languages.cpp } } } }), n.languages.insertBefore("cpp", "operator", { "double-colon": { pattern: /::/, alias: "punctuation" } }), n.languages.insertBefore("cpp", "class-name", { "base-clause": { pattern: /(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/, lookbehind: !0, greedy: !0, inside: n.languages.extend("cpp", {}) } }), n.languages.insertBefore("inside", "double-colon", { "class-name": /\b[a-z_]\w*\b(?!\s*::)/i }, n.languages.cpp["base-clause"]) })(Prism); var VT = globalThis.Prism || window.Prism; var Ic = {}; At(Ic, { $createCodeHighlightNode: () => ta, $createCodeNode: () => Co, $getEndOfCodeInLine: () => $c, $getFirstCodeNodeOfLine: () => An, $getLastCodeNodeOfLine: () => Or, $getStartOfCodeInLine: () => Lc, $isCodeHighlightNode: () => Me, $isCodeNode: () => Tt, CODE_LANGUAGE_FRIENDLY_NAME_MAP: () => Jh, CODE_LANGUAGE_MAP: () => Vh, CodeHighlightNode: () => vr, CodeNode: () => Qn, DEFAULT_CODE_LANGUAGE: () => Fc, PrismTokenizer: () => Zh, getCodeLanguages: () => yN, getDefaultCodeLanguage: () => CN, getEndOfCodeInLine: () => EN, getFirstCodeNodeOfLine: () => SN, getLanguageFriendlyName: () => _N, getLastCodeNodeOfLine: () => TN, getStartOfCodeInLine: () => bN, normalizeCodeLang: () => Xh, registerCodeHighlighting: () => xN }); var QT = Au(Dc(), 1); function Ni(n, ...e) { let t = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams; r.append("code", n); for (let o of e) r.append("v", o); throw t.search = r.toString(), Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`) } var _o = globalThis.Prism || window.Prism, Ph = n => { try { return !!n && _o.languages.hasOwnProperty(n) } catch { return !1 } }; function jh(n, e) { for (let t of n.childNodes) { if (je(t) && t.tagName === e) return !0; jh(t, e) } return !1 } var yi = "data-language", ea = "data-highlight-language", Qn = class n extends xt { static getType() { return "code" } static clone(e) { return new n(e.__language, e.__key) } constructor(e, t) { super(t), this.__language = e || void 0, this.__isSyntaxHighlightSupported = Ph(e) } createDOM(e) { let t = document.createElement("code"); pe(t, e.theme.code), t.setAttribute("spellcheck", "false"); let r = this.getLanguage(); return r && (t.setAttribute(yi, r), this.getIsSyntaxHighlightSupported() && t.setAttribute(ea, r)), t } updateDOM(e, t, r) { let o = this.__language, i = e.__language; return o ? o !== i && (t.setAttribute(yi, o), this.__isSyntaxHighlightSupported && t.setAttribute(ea, o)) : i && (t.removeAttribute(yi), e.__isSyntaxHighlightSupported && t.removeAttribute(ea)), !1 } exportDOM(e) { let t = document.createElement("pre"); pe(t, e._config.theme.code), t.setAttribute("spellcheck", "false"); let r = this.getLanguage(); return r && (t.setAttribute(yi, r), this.getIsSyntaxHighlightSupported() && t.setAttribute(ea, r)), { element: t } } static importDOM() { return { code: e => e.textContent != null && (/\r?\n/.test(e.textContent) || jh(e, "BR")) ? { conversion: Bh, priority: 1 } : null, div: () => ({ conversion: pN, priority: 1 }), pre: () => ({ conversion: Bh, priority: 0 }), table: e => wc(e) ? { conversion: mN, priority: 3 } : null, td: e => { let t = e, r = t.closest("table"); return t.classList.contains("js-file-line") || r && wc(r) ? { conversion: Kh, priority: 3 } : null }, tr: e => { let t = e.closest("table"); return t && wc(t) ? { conversion: Kh, priority: 3 } : null } } } static importJSON(e) { return Co().updateFromJSON(e) } updateFromJSON(e) { return super.updateFromJSON(e).setLanguage(e.language) } exportJSON() { return { ...super.exportJSON(), language: this.getLanguage() } } insertNewAfter(e, t = !0) { let r = this.getChildren(), o = r.length; if (o >= 2 && r[o - 1].getTextContent() === ` `&& r[o - 2].getTextContent() === ` `&& e.isCollapsed() && e.anchor.key === this.__key && e.anchor.offset === o) { r[o - 1].remove(), r[o - 2].remove(); let l = oe(); return this.insertAfter(l, t), l } let { anchor: i, focus: s } = e, a = (i.isBefore(s) ? i : s).getNode(); if (Z(a)) { let l = An(a), c = []; for (; ;)if (qe(l)) c.push(Ft()), l = l.getNextSibling(); else { if (!Me(l)) break; { let h = 0, _ = l.getTextContent(), C = l.getTextContentSize(); for (; h < C && _[h] === " ";)h++; if (h !== 0 && c.push(ta(" ".repeat(h))), h !== C) break; l = l.getNextSibling() } } let u = a.splitText(i.offset)[0], p = i.offset === 0 ? 0 : 1, g = u.getIndexWithinParent() + p, f = a.getParentOrThrow(), d = [yr(), ...c]; f.splice(g, 0, d); let m = c[c.length - 1]; m ? m.select() : i.offset === 0 ? u.selectPrevious() : u.getNextSibling().selectNext(0, 0) } if (Tt(a)) { let { offset: l } = e.anchor; a.splice(l, 0, [yr()]), a.select(l + 1, l + 1) } return null } canIndent() { return !1 } collapseAtStart() { let e = oe(); return this.getChildren().forEach(t => e.append(t)), this.replace(e), !0 } setLanguage(e) { let t = this.getWritable(); return t.__language = e || void 0, t.__isSyntaxHighlightSupported = Ph(e), t } getLanguage() { return this.getLatest().__language } getIsSyntaxHighlightSupported() { return this.getLatest().__isSyntaxHighlightSupported } }; function Co(n) { return Te(new Qn(n)) } function Tt(n) { return n instanceof Qn } function Bh(n) { return { node: Co(n.getAttribute(yi)) } } function pN(n) { let e = n, t = Hh(e); return t || function (r) { let o = r.parentElement; for (; o !== null;) { if (Hh(o)) return !0; o = o.parentElement } return !1 }(e) ? { node: t ? Co() : null } : { node: null } } function mN() { return { node: Co() } } function Kh() { return { node: null } } function Hh(n) { return n.style.fontFamily.match("monospace") !== null } function wc(n) { return n.classList.contains("js-file-line-container") } var Fc = "javascript", Jh = { 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" }, Vh = { cpp: "cpp", java: "java", javascript: "js", md: "markdown", plaintext: "plain", python: "py", text: "plain", ts: "typescript" }; function Xh(n) { return Vh[n] || n } function _N(n) { let e = Xh(n); return Jh[e] || e } var CN = () => Fc, yN = () => Object.keys(_o.languages).filter(n => typeof _o.languages[n] != "function").sort(), vr = class n extends St { constructor(e = "", t, r) { super(e, r), this.__highlightType = t } static getType() { return "code-highlight" } static clone(e) { return new n(e.__text, e.__highlightType || void 0, e.__key) } getHighlightType() { return this.getLatest().__highlightType } setHighlightType(e) { let t = this.getWritable(); return t.__highlightType = e || void 0, t } canHaveFormat() { return !1 } createDOM(e) { let t = super.createDOM(e), r = Mc(e.theme, this.__highlightType); return pe(t, r), t } updateDOM(e, t, r) { let o = super.updateDOM(e, t, r), i = Mc(r.theme, e.__highlightType), s = Mc(r.theme, this.__highlightType); return i !== s && (i && $t(t, i), s && pe(t, s)), o } static importJSON(e) { return ta().updateFromJSON(e) } updateFromJSON(e) { return super.updateFromJSON(e).setHighlightType(e.highlightType) } exportJSON() { return { ...super.exportJSON(), highlightType: this.getHighlightType() } } setFormat(e) { return this } isParentRequired() { return !0 } createParentElementNode() { return Co() } }; function Mc(n, e) { return e && n && n.codeHighlight && n.codeHighlight[e] } function ta(n = "", e) { return Te(new vr(n, e)) } function Me(n) { return n instanceof vr } function qh(n, e) { let t = n; for (let r = yt(n, e); r && (Me(r.origin) || qe(r.origin)); r = uh(r))t = r.origin; return t } function An(n) { return qh(n, "previous") } function Or(n) { return qh(n, "next") } var Zh = { defaultLanguage: Fc, tokenize(n, e) { return _o.tokenize(n, _o.languages[e || ""] || _o.languages[this.defaultLanguage]) } }; function Lc(n, e) { let t = null, r = null, o = n, i = e, s = n.getTextContent(); for (; ;) { if (i === 0) { if (o = o.getPreviousSibling(), o === null) break; if (Me(o) || qe(o) || ve(o) || Ni(167), ve(o)) { t = { node: o, offset: 1 }; break } i = Math.max(0, o.getTextContentSize() - 1), s = o.getTextContent() } else i--; let l = s[i]; Me(o) && l !== " " && (r = { node: o, offset: i }) } if (r !== null) return r; let a = null; if (e < n.getTextContentSize()) Me(n) && (a = n.getTextContent()[e]); else { let l = n.getNextSibling(); Me(l) && (a = l.getTextContent()[0]) } if (a !== null && a !== " ") return t; { let l = function (c, u) { let p = c, g = u, f = c.getTextContent(), d = c.getTextContentSize(); for (; ;) { if (!Me(p) || g === d) { if (p = p.getNextSibling(), p === null || ve(p)) return null; Me(p) && (g = 0, f = p.getTextContent(), d = p.getTextContentSize()) } if (Me(p)) { if (f[g] !== " ") return { node: p, offset: g }; g++ } } }(n, e); return l !== null ? l : t } } function $c(n) { let e = Or(n); return ve(e) && Ni(168), e } function zh(n, e, t) { let r = n.getParent(); Tt(r) ? Qh(r, e, t) : Me(n) && n.replace(st(n.__text)) } function NN(n, e) { let t = e.getElementByKey(n.getKey()); if (t === null) return; let r = n.getChildren(), o = r.length; if (o === t.__cachedChildrenLength) return; t.__cachedChildrenLength = o; let i = "1", s = 1; for (let a = 0; a < o; a++)ve(r[a]) && (i += ` `+ ++s); t.setAttribute("data-gutter", i) } var kc = new Set; function Qh(n, e, t) { let r = n.getKey(); kc.has(r) || (kc.add(r), n.getLanguage() === void 0 && n.setLanguage(t.defaultLanguage), e.update(() => { (function (o, i) { let s = at(o); if (!Tt(s) || !s.isAttached()) return; let a = k(); if (!v(a)) return void i(); let l = a.anchor, c = l.offset, u = l.type === "element" && ve(s.getChildAtIndex(l.offset - 1)), p = 0; if (!u) { let g = l.getNode(); p = c + g.getPreviousSiblings().reduce((f, d) => f + d.getTextContentSize(), 0) } if (i()) { if (u) return void l.getNode().select(c, c); s.getChildren().some(g => { let f = Z(g); if (f || ve(g)) { let d = g.getTextContentSize(); if (f && d >= p) return g.select(p, p), !0; p -= d } return !1 }) } })(r, () => { let o = at(r); if (!Tt(o) || !o.isAttached()) return !1; let i = o.getTextContent(), s = Rc(t.tokenize(i, o.getLanguage() || t.defaultLanguage)), a = function (p, g) { let f = 0; for (; f < p.length && Uh(p[f], g[f]);)f++; let d = p.length, m = g.length, h = Math.min(d, m) - f, _ = 0; for (; _ < h;)if (_++, !Uh(p[d - _], g[m - _])) { _--; break } let C = f, y = d - _, x = g.slice(f, m - _); return { from: C, nodesForReplacement: x, to: y } }(o.getChildren(), s), { from: l, to: c, nodesForReplacement: u } = a; return !(l === c && !u.length) && (n.splice(l, c - l, u), !0) }) }, { onUpdate: () => { kc.delete(r) }, skipTransforms: !0 })) } function Rc(n, e) { let t = []; for (let r of n) if (typeof r == "string") { let o = r.split(/(\n|\t)/), i = o.length; for (let s = 0; s < i; s++) { let a = o[s]; a === ` `|| a === `\r `? t.push(yr()) : a === " " ? t.push(Ft()) : a.length > 0 && t.push(ta(a, e)) } } else { let { content: o } = r; typeof o == "string" ? t.push(...Rc([o], r.type)) : Array.isArray(o) && t.push(...Rc(o, r.type)) } return t } function Uh(n, e) { return Me(n) && Me(e) && n.__text === e.__text && n.__highlightType === e.__highlightType || qe(n) && qe(e) || ve(n) && ve(e) } function Ar(n) { if (!v(n)) return !1; let e = n.anchor.getNode(), t = n.focus.getNode(); if (e.is(t) && Tt(e)) return !0; let r = e.getParent(); return Tt(r) && r.is(t.getParent()) } function ep(n) { let e = n.getNodes(), t = [[]]; if (e.length === 1 && Tt(e[0])) return t; let r = t[0]; for (let o = 0; o < e.length; o++) { let i = e[o]; Me(i) || qe(i) || ve(i) || Ni(169), ve(i) ? o !== 0 && r.length > 0 && (r = [], t.push(r)) : r.push(i) } return t } function Wh(n) { let e = k(); if (!v(e) || !Ar(e)) return !1; let t = ep(e), r = t.length; if (t.length > 1) { for (let s = 0; s < r; s++) { let a = t[s]; if (a.length > 0) { let l = a[0]; s === 0 && (l = An(l)), l !== null && (n === wt ? l.insertBefore(Ft()) : qe(l) && l.remove()) } } return !0 } let o = e.getNodes()[0]; if (Tt(o) || Me(o) || qe(o) || ve(o) || Ni(171), Tt(o)) return n === wt && e.insertNodes([Ft()]), !0; let i = An(o); return n === wt ? ve(i) ? i.insertAfter(Ft()) : i.insertBefore(Ft()) : qe(i) && i.remove(), !0 } function Gh(n, e) { let t = k(); if (!v(t)) return !1; let { anchor: r, focus: o } = t, i = r.offset, s = o.offset, a = r.getNode(), l = o.getNode(), c = n === Gt; if (!Ar(t) || !Me(a) && !qe(a) || !Me(l) && !qe(l)) return !1; if (!e.altKey) { if (t.isCollapsed()) { let _ = a.getParentOrThrow(); if (c && i === 0 && a.getPreviousSibling() === null) { if (_.getPreviousSibling() === null) return _.selectPrevious(), e.preventDefault(), !0 } else if (!c && i === a.getTextContentSize() && a.getNextSibling() === null && _.getNextSibling() === null) return _.selectNext(), e.preventDefault(), !0 } return !1 } let u, p; if (a.isBefore(l) ? (u = An(a), p = Or(l)) : (u = An(l), p = Or(a)), u == null || p == null) return !1; let g = u.getNodesBetween(p); for (let _ = 0; _ < g.length; _++) { let C = g[_]; if (!Me(C) && !qe(C) && !ve(C)) return !1 } e.preventDefault(), e.stopPropagation(); let f = c ? u.getPreviousSibling() : p.getNextSibling(); if (!ve(f)) return !0; let d = c ? f.getPreviousSibling() : f.getNextSibling(); if (d == null) return !0; let m = Me(d) || qe(d) || ve(d) ? c ? An(d) : Or(d) : null, h = m ?? d; return f.remove(), g.forEach(_ => _.remove()), n === Gt ? (g.forEach(_ => h.insertBefore(_)), h.insertBefore(f)) : (h.insertAfter(f), h = f, g.forEach(_ => { h.insertAfter(_), h = _ })), t.setTextNodeRange(a, i, l, s), !0 } function Yh(n, e) { let t = k(); if (!v(t)) return !1; let { anchor: r, focus: o } = t, i = r.getNode(), s = o.getNode(), a = n === Fs; if (!Ar(t) || !Me(i) && !qe(i) || !Me(s) && !qe(s)) return !1; if (a) { let l = Lc(s, o.offset); if (l !== null) { let { node: c, offset: u } = l; ve(c) ? c.selectNext(0, 0) : t.setTextNodeRange(c, u, c, u) } else s.getParentOrThrow().selectStart() } else $c(s).select(); return e.preventDefault(), e.stopPropagation(), !0 } function xN(n, e) { if (!n.hasNodes([Qn, vr])) throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor"); return e == null && (e = Zh), Mt(n.registerMutationListener(Qn, t => { n.update(() => { for (let [r, o] of t) if (o !== "destroyed") { let i = at(r); i !== null && NN(i, n) } }) }, { skipInitialization: !1 }), n.registerNodeTransform(Qn, t => Qh(t, n, e)), n.registerNodeTransform(St, t => zh(t, n, e)), n.registerNodeTransform(vr, t => zh(t, n, e)), n.registerCommand(uo, t => { let r = function (o) { let i = k(); if (!v(i) || !Ar(i)) return null; let s = o ? Lt : wt, a = o ? Lt : ci; if (ep(i).length > 1) return s; let l = i.getNodes()[0]; if (Tt(l) || Me(l) || qe(l) || ve(l) || Ni(170), Tt(l)) return s; let c = An(l), u = Or(l), p = i.anchor, g = i.focus, f, d; return g.isBefore(p) ? (f = g, d = p) : (f = p, d = g), c !== null && u !== null && f.key === c.getKey() && f.offset === 0 && d.key === u.getKey() && d.offset === u.getTextContentSize() ? s : a }(t.shiftKey); return r !== null && (t.preventDefault(), n.dispatchCommand(r, void 0), !0) }, De), n.registerCommand(ci, () => !!Ar(k()) && (Gn([Ft()]), !0), De), n.registerCommand(wt, t => Wh(wt), De), n.registerCommand(Lt, t => Wh(Lt), De), n.registerCommand(Gt, t => { let r = k(); if (!v(r)) return !1; let { anchor: o } = r, i = o.getNode(); return !!Ar(r) && (r.isCollapsed() && o.offset === 0 && i.getPreviousSibling() === null && Tt(i.getParentOrThrow()) ? (t.preventDefault(), !0) : Gh(Gt, t)) }, De), n.registerCommand(En, t => { let r = k(); if (!v(r)) return !1; let { anchor: o } = r, i = o.getNode(); return !!Ar(r) && (r.isCollapsed() && o.offset === i.getTextContentSize() && i.getNextSibling() === null && Tt(i.getParentOrThrow()) ? (t.preventDefault(), !0) : Gh(En, t)) }, De), n.registerCommand(Fs, t => Yh(Fs, t), De), n.registerCommand(Zl, t => Yh(Zl, t), De)) } var SN = An, TN = Or, EN = $c, bN = Lc; var Ae = Ic, mE = Ae.$createCodeHighlightNode, Pc = Ae.$createCodeNode, _E = Ae.$getEndOfCodeInLine, CE = Ae.$getFirstCodeNodeOfLine, yE = Ae.$getLastCodeNodeOfLine, NE = Ae.$getStartOfCodeInLine, xE = Ae.$isCodeHighlightNode, tp = Ae.$isCodeNode, SE = Ae.CODE_LANGUAGE_FRIENDLY_NAME_MAP, np = Ae.CODE_LANGUAGE_MAP, TE = Ae.CodeHighlightNode, rp = Ae.CodeNode, EE = Ae.DEFAULT_CODE_LANGUAGE, bE = Ae.PrismTokenizer, AE = Ae.getCodeLanguages, OE = Ae.getDefaultCodeLanguage, vE = Ae.getEndOfCodeInLine, DE = Ae.getFirstCodeNodeOfLine, wE = Ae.getLanguageFriendlyName, ME = Ae.getLastCodeNodeOfLine, kE = Ae.getStartOfCodeInLine, RE = Ae.normalizeCodeLang, FE = Ae.registerCodeHighlighting; var Kc = {}; At(Kc, { $createAutoLinkNode: () => Bc, $createLinkNode: () => No, $isAutoLinkNode: () => xi, $isLinkNode: () => er, $toggleLink: () => sp, AutoLinkNode: () => Si, LinkNode: () => yo, TOGGLE_LINK_COMMAND: () => vN, toggleLink: () => DN }); var AN = new Set(["http:", "https:", "mailto:", "sms:", "tel:"]), yo = class n extends xt { static getType() { return "link" } static clone(e) { return new n(e.__url, { rel: e.__rel, target: e.__target, title: e.__title }, e.__key) } constructor(e = "", t = {}, r) { super(r); let { target: o = null, rel: i = null, title: s = null } = t; this.__url = e, this.__target = o, this.__rel = i, this.__title = s } createDOM(e) { let t = document.createElement("a"); return t.href = this.sanitizeUrl(this.__url), this.__target !== null && (t.target = this.__target), this.__rel !== null && (t.rel = this.__rel), this.__title !== null && (t.title = this.__title), pe(t, e.theme.link), t } updateDOM(e, t, r) { if (_c(t)) { let o = this.__url, i = this.__target, s = this.__rel, a = this.__title; o !== e.__url && (t.href = o), i !== e.__target && (i ? t.target = i : t.removeAttribute("target")), s !== e.__rel && (s ? t.rel = s : t.removeAttribute("rel")), a !== e.__title && (a ? t.title = a : t.removeAttribute("title")) } return !1 } static importDOM() { return { a: e => ({ conversion: ON, priority: 1 }) } } static importJSON(e) { return No().updateFromJSON(e) } updateFromJSON(e) { return super.updateFromJSON(e).setURL(e.url).setRel(e.rel || null).setTarget(e.target || null).setTitle(e.title || null) } sanitizeUrl(e) { try { let t = new URL(e); if (!AN.has(t.protocol)) return "about:blank" } catch { return e } return e } exportJSON() { return { ...super.exportJSON(), rel: this.getRel(), target: this.getTarget(), title: this.getTitle(), url: this.getURL() } } getURL() { return this.getLatest().__url } setURL(e) { let t = this.getWritable(); return t.__url = e, t } getTarget() { return this.getLatest().__target } setTarget(e) { let t = this.getWritable(); return t.__target = e, t } getRel() { return this.getLatest().__rel } setRel(e) { let t = this.getWritable(); return t.__rel = e, t } getTitle() { return this.getLatest().__title } setTitle(e) { let t = this.getWritable(); return t.__title = e, t } insertNewAfter(e, t = !0) { let r = No(this.__url, { rel: this.__rel, target: this.__target, title: this.__title }); return this.insertAfter(r, t), r } canInsertTextBefore() { return !1 } canInsertTextAfter() { return !1 } canBeEmpty() { return !1 } isInline() { return !0 } extractWithChild(e, t, r) { if (!v(t)) return !1; let o = t.anchor.getNode(), i = t.focus.getNode(); return this.isParentOf(o) && this.isParentOf(i) && t.getTextContent().length > 0 } isEmailURI() { return this.__url.startsWith("mailto:") } isWebSiteURI() { return this.__url.startsWith("https://") || this.__url.startsWith("http://") } }; function ON(n) { let e = null; if (_c(n)) { let t = n.textContent; (t !== null && t !== "" || n.children.length > 0) && (e = No(n.getAttribute("href") || "", { rel: n.getAttribute("rel"), target: n.getAttribute("target"), title: n.getAttribute("title") })) } return { node: e } } function No(n = "", e) { return Te(new yo(n, e)) } function er(n) { return n instanceof yo } var Si = class n extends yo { constructor(e = "", t = {}, r) { super(e, t, r), this.__isUnlinked = t.isUnlinked !== void 0 && t.isUnlinked !== null && t.isUnlinked } static getType() { return "autolink" } static clone(e) { return new n(e.__url, { isUnlinked: e.__isUnlinked, rel: e.__rel, target: e.__target, title: e.__title }, e.__key) } getIsUnlinked() { return this.__isUnlinked } setIsUnlinked(e) { let t = this.getWritable(); return t.__isUnlinked = e, t } createDOM(e) { return this.__isUnlinked ? document.createElement("span") : super.createDOM(e) } updateDOM(e, t, r) { return super.updateDOM(e, t, r) || e.__isUnlinked !== this.__isUnlinked } static importJSON(e) { return Bc().updateFromJSON(e) } updateFromJSON(e) { return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked || !1) } static importDOM() { return null } exportJSON() { return { ...super.exportJSON(), isUnlinked: this.__isUnlinked } } insertNewAfter(e, t = !0) { let r = this.getParentOrThrow().insertNewAfter(e, t); if ($(r)) { let o = Bc(this.__url, { isUnlinked: this.__isUnlinked, rel: this.__rel, target: this.__target, title: this.__title }); return r.append(o), o } return null } }; function Bc(n = "", e) { return Te(new Si(n, e)) } function xi(n) { return n instanceof Si } var vN = ct("TOGGLE_LINK_COMMAND"); function op(n, e) { if (n.type === "element") { let t = n.getNode(); return $(t) || function (r, ...o) { let i = new URL("https://lexical.dev/docs/error"), s = new URLSearchParams; s.append("code", r); for (let a of o) s.append("v", a); throw i.search = s.toString(), Error(`Minified Lexical error #${r}; visit ${i.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`) }(252), t.getChildren()[n.offset + e] || null } return null } function sp(n, e = {}) { let { target: t, title: r } = e, o = e.rel === void 0 ? "noreferrer" : e.rel, i = k(); if (i === null || !v(i) && !Nt(i)) return; if (Nt(i)) { let c = i.getNodes(); return c.length === 0 ? void 0 : void c.forEach(u => { if (n === null) { let p = Q(u, g => !xi(g) && er(g)); p && (p.insertBefore(u), p.getChildren().length === 0 && p.remove()) } else { let p = Q(u, g => !xi(g) && er(g)); if (p) p.setURL(n), t !== void 0 && p.setTarget(t), o !== void 0 && p.setRel(o); else { let g = No(n, { rel: o, target: t }); u.insertBefore(g), g.append(u) } } }) } let s = i.extract(); if (n === null) return void s.forEach(c => { let u = Q(c, p => !xi(p) && er(p)); if (u) { let p = u.getChildren(); for (let g = 0; g < p.length; g++)u.insertBefore(p[g]); u.remove() } }); let a = new Set, l = c => { a.has(c.getKey()) || (a.add(c.getKey()), c.setURL(n), t !== void 0 && c.setTarget(t), o !== void 0 && c.setRel(o), r !== void 0 && c.setTitle(r)) }; if (s.length === 1) { let c = ip(s[0], er); if (c !== null) return l(c) } (function (c) { let u = k(); if (!v(u)) return c(); let p = xr(u), g = p.isBackward(), f = op(p.anchor, g ? -1 : 0), d = op(p.focus, g ? 0 : -1), m = c(); if (f || d) { let h = k(); if (v(h)) { let _ = h.clone(); if (f) { let C = f.getParent(); C && _.anchor.set(C.getKey(), f.getIndexWithinParent() + (g ? 1 : 0), "element") } if (d) { let C = d.getParent(); C && _.focus.set(C.getKey(), d.getIndexWithinParent() + (g ? 0 : 1), "element") } Ye(xr(_)) } } })(() => { let c = null; for (let u of s) { if (!u.isAttached()) continue; let p = ip(u, er); if (p) { l(p); continue } if ($(u)) { if (!u.isInline()) continue; if (er(u)) { if (!(xi(u) || c !== null && c.getParentOrThrow().isParentOf(u))) { l(u), c = u; continue } for (let f of u.getChildren()) u.insertBefore(f); u.remove(); continue } } let g = u.getPreviousSibling(); er(g) && g.is(c) ? g.append(u) : (c = No(n, { rel: o, target: t, title: r }), u.insertAfter(c), c.append(u)) } }) } var DN = sp; function ip(n, e) { let t = n; for (; t !== null && t.getParent() !== null && !e(t);)t = t.getParentOrThrow(); return e(t) ? t : null } var On = Kc, PE = On.$createAutoLinkNode, BE = On.$createLinkNode, KE = On.$isAutoLinkNode, on = On.$isLinkNode, Hc = On.$toggleLink, ap = On.AutoLinkNode, lp = On.LinkNode, tr = On.TOGGLE_LINK_COMMAND, HE = On.toggleLink; var Yc = {}; At(Yc, { $createListItemNode: () => Et, $createListNode: () => ut, $getListDepth: () => na, $handleListInsertParagraph: () => Sp, $insertList: () => Ti, $isListItemNode: () => se, $isListNode: () => ne, $removeList: () => Gc, INSERT_CHECK_LIST_COMMAND: () => Tp, INSERT_ORDERED_LIST_COMMAND: () => Ap, INSERT_UNORDERED_LIST_COMMAND: () => bp, ListItemNode: () => wr, ListNode: () => xo, REMOVE_LIST_COMMAND: () => Op, insertList: () => PN, registerCheckList: () => LN, registerList: () => $N, registerListStrictIndentTransform: () => IN, removeList: () => BN }); function sn(n, ...e) { let t = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams; r.append("code", n); for (let o of e) r.append("v", o); throw t.search = r.toString(), Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`) } function na(n) { let e = 1, t = n.getParent(); for (; t != null;) { if (se(t)) { let r = t.getParent(); if (ne(r)) { e++, t = r.getParent(); continue } sn(40) } return e } return e } function zc(n) { let e = n.getParent(); ne(e) || sn(40); let t = e; for (; t !== null;)t = t.getParent(), ne(t) && (e = t); return e } function Np(n) { let e = [], t = n.getChildren().filter(se); for (let r = 0; r < t.length; r++) { let o = t[r], i = o.getFirstChild(); ne(i) ? e = e.concat(Np(i)) : e.push(o) } return e } function an(n) { return se(n) && ne(n.getFirstChild()) } function cp(n) { return Et().append(n) } function xp(n, e) { return se(n) && (e.length === 0 || e.length === 1 && n.is(e[0]) && n.getChildrenSize() === 0) } function Ti(n) { let e = k(); if (e !== null) { let t = e.getNodes(); if (v(e)) { let o = e.getStartEndPoints(); o === null && sn(143); let [i] = o, s = i.getNode(), a = s.getParent(); if (tt(s)) { let l = s.getFirstChild(); if (l) t = l.selectStart().getNodes(); else { let c = oe(); s.append(c), t = c.select().getNodes() } } else if (xp(s, t)) { let l = ut(n); if (tt(a)) { s.replace(l); let c = Et(); $(s) && (c.setFormat(s.getFormatType()), c.setIndent(s.getIndent())), l.append(c) } else if (se(s)) { let c = s.getParentOrThrow(); Dr(l, c.getChildren()), c.replace(l) } return } } let r = new Set; for (let o = 0; o < t.length; o++) { let i = t[o]; if ($(i) && i.isEmpty() && !se(i) && !r.has(i.getKey())) { up(i, n); continue } let s = ai(i) ? i.getParent() : se(i) && i.isEmpty() ? i : null; for (; s != null;) { let a = s.getKey(); if (ne(s)) { if (!r.has(a)) { let l = ut(n); Dr(l, s.getChildren()), s.replace(l), r.add(a) } break } { let l = s.getParent(); if (tt(l) && !r.has(a)) { r.add(a), up(s, n); break } s = l } } } } } function Dr(n, e) { n.splice(n.getChildrenSize(), 0, e) } function up(n, e) { if (ne(n)) return n; let t = n.getPreviousSibling(), r = n.getNextSibling(), o = Et(), i; if (Dr(o, n.getChildren()), ne(t) && e === t.getListType()) t.append(o), ne(r) && e === r.getListType() && (Dr(t, r.getChildren()), r.remove()), i = t; else if (ne(r) && e === r.getListType()) r.getFirstChildOrThrow().insertBefore(o), i = r; else { let s = ut(e); s.append(o), n.replace(s), i = s } return o.setFormat(n.getFormatType()), o.setIndent(n.getIndent()), n.remove(), i } function Wc(n, e) { let t = n.getLastChild(), r = e.getFirstChild(); t && r && an(t) && an(r) && (Wc(t.getFirstChild(), r.getFirstChild()), r.remove()); let o = e.getChildren(); o.length > 0 && n.append(...o), e.remove() } function Gc() { let n = k(); if (v(n)) { let e = new Set, t = n.getNodes(), r = n.anchor.getNode(); if (xp(r, t)) e.add(zc(r)); else for (let o = 0; o < t.length; o++) { let i = t[o]; if (ai(i)) { let s = Ys(i, wr); s != null && e.add(zc(s)) } } for (let o of e) { let i = o, s = Np(o); for (let a of s) { let l = oe().setTextStyle(n.style).setTextFormat(n.format); Dr(l, a.getChildren()), i.insertAfter(l), i = l, a.__key === n.anchor.key && Vn(n.anchor, Jn(Wt(l, "next"))), a.__key === n.focus.key && Vn(n.focus, Jn(Wt(l, "next"))), a.remove() } o.remove() } } } function wN(n) { let e = new Set; if (an(n) || e.has(n.getKey())) return; let t = n.getParent(), r = n.getNextSibling(), o = n.getPreviousSibling(); if (an(r) && an(o)) { let i = o.getFirstChild(); if (ne(i)) { i.append(n); let s = r.getFirstChild(); ne(s) && (Dr(i, s.getChildren()), r.remove(), e.add(r.getKey())) } } else if (an(r)) { let i = r.getFirstChild(); if (ne(i)) { let s = i.getFirstChild(); s !== null && s.insertBefore(n) } } else if (an(o)) { let i = o.getFirstChild(); ne(i) && i.append(n) } else if (ne(t)) { let i = Et().setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle()), s = ut(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle()); i.append(s), s.append(n), o ? o.insertAfter(i) : r ? r.insertBefore(i) : t.append(i) } } function MN(n) { if (an(n)) return; let e = n.getParent(), t = e ? e.getParent() : void 0; if (ne(t ? t.getParent() : void 0) && se(t) && ne(e)) { let r = e ? e.getFirstChild() : void 0, o = e ? e.getLastChild() : void 0; if (n.is(r)) t.insertBefore(n), e.isEmpty() && t.remove(); else if (n.is(o)) t.insertAfter(n), e.isEmpty() && t.remove(); else { let i = e.getListType(), s = Et(), a = ut(i); s.append(a), n.getPreviousSiblings().forEach(u => a.append(u)); let l = Et(), c = ut(i); l.append(c), Dr(c, n.getNextSiblings()), t.insertBefore(s), t.insertAfter(l), t.replace(n) } } } function Sp() { let n = k(); if (!v(n) || !n.isCollapsed()) return !1; let e = n.anchor.getNode(); if (!se(e) || e.getChildrenSize() !== 0) return !1; let t = zc(e), r = e.getParent(); ne(r) || sn(40); let o = r.getParent(), i; if (tt(o)) i = oe(), t.insertAfter(i); else { if (!se(o)) return !1; i = Et(), o.insertAfter(i) } i.setTextStyle(n.style).setTextFormat(n.format).select(); let s = e.getNextSiblings(); if (s.length > 0) { let a = ut(r.getListType()); if (se(i)) { let l = Et(); l.append(a), i.insertAfter(l) } else i.insertAfter(a); a.append(...s) } return function (a) { let l = a; for (; l.getNextSibling() == null && l.getPreviousSibling() == null;) { let c = l.getParent(); if (c == null || !se(c) && !ne(c)) break; l = c } l.remove() }(e), !0 } function ra(...n) { let e = []; for (let t of n) if (t && typeof t == "string") for (let [r] of t.matchAll(/\S+/g)) e.push(r); return e } function dp(n, e, t) { let r = cc(e.__textStyle); for (let o in r) n.style.setProperty(`--listitem-marker-${o}`, r[o]); if (t) for (let o in cc(t.__textStyle)) o in r || n.style.removeProperty(`--listitem-marker-${o}`) } var wr = class n extends xt { static getType() { return "listitem" } static clone(e) { return new n(e.__value, e.__checked, e.__key) } constructor(e, t, r) { super(r), this.__value = e === void 0 ? 1 : e, this.__checked = t } createDOM(e) { let t = document.createElement("li"), r = this.getParent(); ne(r) && r.getListType() === "check" && gp(t, this, null), t.value = this.__value, fp(t, e.theme, this); let o = this.__style; return o && (t.style.cssText = o), dp(t, this, null), t } updateDOM(e, t, r) { let o = this.getParent(); ne(o) && o.getListType() === "check" && gp(t, this, e), t.value = this.__value, fp(t, r.theme, this); let i = e.__style, s = this.__style; return i !== s && (s === "" ? t.removeAttribute("style") : t.style.cssText = s), dp(t, this, e), !1 } static transform() { return e => { if (se(e) || sn(144), e.__checked == null) return; let t = e.getParent(); ne(t) && t.getListType() !== "check" && e.getChecked() != null && e.setChecked(void 0) } } static importDOM() { return { li: () => ({ conversion: kN, priority: 0 }) } } static importJSON(e) { return Et().updateFromJSON(e) } updateFromJSON(e) { return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked) } exportDOM(e) { let t = this.createDOM(e._config); t.style.textAlign = this.getFormatType(); let r = this.getDirection(); return r && (t.dir = r), { element: t } } exportJSON() { return { ...super.exportJSON(), checked: this.getChecked(), value: this.getValue() } } append(...e) { for (let t = 0; t < e.length; t++) { let r = e[t]; if ($(r) && this.canMergeWith(r)) { let o = r.getChildren(); this.append(...o), r.remove() } else super.append(r) } return this } replace(e, t) { if (se(e)) return super.replace(e); this.setIndent(0); let r = this.getParentOrThrow(); if (!ne(r)) return e; if (r.__first === this.getKey()) r.insertBefore(e); else if (r.__last === this.getKey()) r.insertAfter(e); else { let o = ut(r.getListType()), i = this.getNextSibling(); for (; i;) { let s = i; i = i.getNextSibling(), o.append(s) } r.insertAfter(e), e.insertAfter(o) } return t && ($(e) || sn(139), this.getChildren().forEach(o => { e.append(o) })), this.remove(), r.getChildrenSize() === 0 && r.remove(), e } insertAfter(e, t = !0) { let r = this.getParentOrThrow(); if (ne(r) || sn(39), se(e)) return super.insertAfter(e, t); let o = this.getNextSiblings(); if (r.insertAfter(e, t), o.length !== 0) { let i = ut(r.getListType()); o.forEach(s => i.append(s)), e.insertAfter(i, t) } return e } remove(e) { let t = this.getPreviousSibling(), r = this.getNextSibling(); super.remove(e), t && r && an(t) && an(r) && (Wc(t.getFirstChild(), r.getFirstChild()), r.remove()) } insertNewAfter(e, t = !0) { let r = Et().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked() && void 0); return this.insertAfter(r, t), r } collapseAtStart(e) { let t = oe(); this.getChildren().forEach(s => t.append(s)); let r = this.getParentOrThrow(), o = r.getParentOrThrow(), i = se(o); if (r.getChildrenSize() === 1) if (i) r.remove(), o.select(); else { r.insertBefore(t), r.remove(); let s = e.anchor, a = e.focus, l = t.getKey(); s.type === "element" && s.getNode().is(this) && s.set(l, s.offset, "element"), a.type === "element" && a.getNode().is(this) && a.set(l, a.offset, "element") } else r.insertBefore(t), this.remove(); return !0 } getValue() { return this.getLatest().__value } setValue(e) { let t = this.getWritable(); return t.__value = e, t } getChecked() { let e = this.getLatest(), t, r = this.getParent(); return ne(r) && (t = r.getListType()), t === "check" ? !!e.__checked : void 0 } setChecked(e) { let t = this.getWritable(); return t.__checked = e, t } toggleChecked() { let e = this.getWritable(); return e.setChecked(!e.__checked) } getIndent() { let e = this.getParent(); if (e === null || !this.isAttached()) return this.getLatest().__indent; let t = e.getParentOrThrow(), r = 0; for (; se(t);)t = t.getParentOrThrow().getParentOrThrow(), r++; return r } setIndent(e) { typeof e != "number" && sn(117), (e = Math.floor(e)) >= 0 || sn(199); let t = this.getIndent(); for (; t !== e;)t < e ? (wN(this), t++) : (MN(this), t--); return this } canInsertAfter(e) { return se(e) } canReplaceWith(e) { return se(e) } canMergeWith(e) { return se(e) || jn(e) } extractWithChild(e, t) { if (!v(t)) return !1; let r = t.anchor.getNode(), o = t.focus.getNode(); return this.isParentOf(r) && this.isParentOf(o) && this.getTextContent().length === t.getTextContent().length } isParentRequired() { return !0 } createParentElementNode() { return ut("bullet") } canMergeWhenEmpty() { return !0 } }; function fp(n, e, t) { let r = [], o = [], i = e.list, s = i ? i.listitem : void 0, a; if (i && i.nested && (a = i.nested.listitem), s !== void 0 && r.push(...ra(s)), i) { let l = t.getParent(), c = ne(l) && l.getListType() === "check", u = t.getChecked(); c && !u || o.push(i.listitemUnchecked), c && u || o.push(i.listitemChecked), c && r.push(u ? i.listitemChecked : i.listitemUnchecked) } if (a !== void 0) { let l = ra(a); t.getChildren().some(c => ne(c)) ? r.push(...l) : o.push(...l) } o.length > 0 && $t(n, ...o), r.length > 0 && pe(n, ...r) } function gp(n, e, t, r) { ne(e.getFirstChild()) ? (n.removeAttribute("role"), n.removeAttribute("tabIndex"), n.removeAttribute("aria-checked")) : (n.setAttribute("role", "checkbox"), n.setAttribute("tabIndex", "-1"), t && e.__checked === t.__checked || n.setAttribute("aria-checked", e.getChecked() ? "true" : "false")) } function kN(n) { if (n.classList.contains("task-list-item")) { for (let t of n.children) if (t.tagName === "INPUT") return RN(t) } let e = n.getAttribute("aria-checked"); return { node: Et(e === "true" || e !== "false" && void 0) } } function RN(n) { return n.getAttribute("type") !== "checkbox" ? { node: null } : { node: Et(n.hasAttribute("checked")) } } function Et(n) { return Te(new wr(void 0, n)) } function se(n) { return n instanceof wr } var xo = class n extends xt { static getType() { return "list" } static clone(e) { let t = e.__listType || mp[e.__tag]; return new n(t, e.__start, e.__key) } constructor(e = "number", t = 1, r) { super(r); let o = mp[e] || e; this.__listType = o, this.__tag = o === "number" ? "ol" : "ul", this.__start = t } getTag() { return this.__tag } setListType(e) { let t = this.getWritable(); return t.__listType = e, t.__tag = e === "number" ? "ol" : "ul", t } getListType() { return this.__listType } getStart() { return this.__start } setStart(e) { let t = this.getWritable(); return t.__start = e, t } createDOM(e, t) { let r = this.__tag, o = document.createElement(r); return this.__start !== 1 && o.setAttribute("start", String(this.__start)), o.__lexicalListType = this.__listType, hp(o, e.theme, this), o } updateDOM(e, t, r) { return e.__tag !== this.__tag || (hp(t, r.theme, this), !1) } static transform() { return e => { ne(e) || sn(163), function (t) { let r = t.getNextSibling(); ne(r) && t.getListType() === r.getListType() && Wc(t, r) }(e), function (t) { let r = t.getListType() !== "check", o = t.getStart(); for (let i of t.getChildren()) se(i) && (i.getValue() !== o && i.setValue(o), r && i.getLatest().__checked != null && i.setChecked(void 0), ne(i.getFirstChild()) || o++) }(e) } } static importDOM() { return { ol: () => ({ conversion: pp, priority: 0 }), ul: () => ({ conversion: pp, priority: 0 }) } } static importJSON(e) { return ut().updateFromJSON(e) } updateFromJSON(e) { return super.updateFromJSON(e).setListType(e.listType).setStart(e.start) } exportDOM(e) { let t = this.createDOM(e._config, e); return je(t) && (this.__start !== 1 && t.setAttribute("start", String(this.__start)), this.__listType === "check" && t.setAttribute("__lexicalListType", "check")), { element: t } } exportJSON() { return { ...super.exportJSON(), listType: this.getListType(), start: this.getStart(), tag: this.getTag() } } canBeEmpty() { return !1 } canIndent() { return !1 } splice(e, t, r) { let o = r; for (let i = 0; i < r.length; i++) { let s = r[i]; se(s) || (o === r && (o = [...r]), o[i] = Et().append(!$(s) || ne(s) || s.isInline() ? s : st(s.getTextContent()))) } return super.splice(e, t, o) } extractWithChild(e) { return se(e) } }; function hp(n, e, t) { let r = [], o = [], i = e.list; if (i !== void 0) { let s = i[`${t.__tag}Depth`] || [], a = na(t) - 1, l = a % s.length, c = s[l], u = i[t.__tag], p, g = i.nested, f = i.checklist; if (g !== void 0 && g.list && (p = g.list), u !== void 0 && r.push(u), f !== void 0 && t.__listType === "check" && r.push(f), c !== void 0) { r.push(...ra(c)); for (let d = 0; d < s.length; d++)d !== l && o.push(t.__tag + d) } if (p !== void 0) { let d = ra(p); a > 1 ? r.push(...d) : o.push(...d) } } o.length > 0 && $t(n, ...o), r.length > 0 && pe(n, ...r) } function FN(n) { let e = []; for (let t = 0; t < n.length; t++) { let r = n[t]; if (se(r)) { e.push(r); let o = r.getChildren(); o.length > 1 && o.forEach(i => { ne(i) && e.push(cp(i)) }) } else e.push(cp(r)) } return e } function pp(n) { let e = n.nodeName.toLowerCase(), t = null; return e === "ol" ? t = ut("number", n.start) : e === "ul" && (t = function (r) { if (r.getAttribute("__lexicallisttype") === "check" || r.classList.contains("contains-task-list")) return !0; for (let o of r.childNodes) if (je(o) && o.hasAttribute("aria-checked")) return !0; return !1 }(n) ? ut("check") : ut("bullet")), { after: FN, node: t } } var mp = { ol: "number", ul: "bullet" }; function ut(n = "number", e = 1) { return Te(new xo(n, e)) } function ne(n) { return n instanceof xo } var Tp = ct("INSERT_CHECK_LIST_COMMAND"); function LN(n) { return Mt(n.registerCommand(Tp, () => (Ti("check"), !0), De), n.registerCommand(En, e => yp(e, n, !1), De), n.registerCommand(Gt, e => yp(e, n, !0), De), n.registerCommand(co, () => { if (Uc() != null) { let e = n.getRootElement(); return e?.focus(), !0 } return !1 }, De), n.registerCommand(Rs, e => { let t = Uc(); return !(t == null || !n.isEditable()) && (n.update(() => { let r = $e(t); se(r) && (e.preventDefault(), r.toggleChecked()) }), !0) }, De), n.registerCommand(lo, e => n.getEditorState().read(() => { let t = k(); if (v(t) && t.isCollapsed()) { let { anchor: r } = t, o = r.type === "element"; if (o || r.offset === 0) { let i = r.getNode(), s = Q(i, a => $(a) && !a.isInline()); if (se(s)) { let a = s.getParent(); if (ne(a) && a.getListType() === "check" && (o || s.getFirstDescendant() === i)) { let l = n.getElementByKey(s.__key); if (l != null && document.activeElement !== l) return l.focus(), e.preventDefault(), !0 } } } } return !1 }), De), n.registerRootListener((e, t) => { e !== null && (e.addEventListener("click", _p), e.addEventListener("pointerdown", Cp)), t !== null && (t.removeEventListener("click", _p), t.removeEventListener("pointerdown", Cp)) })) } function Ep(n, e) { let t = n.target; if (!je(t)) return; let r = t.firstChild; if (je(r) && (r.tagName === "UL" || r.tagName === "OL")) return; let o = t.parentNode; if (!o || o.__lexicalListType !== "check") return; let i = t.getBoundingClientRect(), s = n.pageX / fh(t); (t.dir === "rtl" ? s < i.right && s > i.right - 20 : s > i.left && s < i.left + 20) && e() } function _p(n) { Ep(n, () => { if (je(n.target)) { let e = n.target, t = Ps(e); t != null && t.isEditable() && t.update(() => { let r = $e(e); se(r) && (e.focus(), r.toggleChecked()) }) } }) } function Cp(n) { Ep(n, () => { n.preventDefault() }) } function Uc() { let n = document.activeElement; return je(n) && n.tagName === "LI" && n.parentNode != null && n.parentNode.__lexicalListType === "check" ? n : null } function yp(n, e, t) { let r = Uc(); return r != null && e.update(() => { let o = $e(r); if (!se(o)) return; let i = function (s, a) { let l = a ? s.getPreviousSibling() : s.getNextSibling(), c = s; for (; l == null && se(c);)c = c.getParentOrThrow().getParent(), c != null && (l = a ? c.getPreviousSibling() : c.getNextSibling()); for (; se(l);) { let u = a ? l.getLastChild() : l.getFirstChild(); if (!ne(u)) return l; l = a ? u.getLastChild() : u.getFirstChild() } return null }(o, t); if (i != null) { i.selectStart(); let s = e.getElementByKey(i.__key); s != null && (n.preventDefault(), setTimeout(() => { s.focus() }, 0)) } }), !1 } var bp = ct("INSERT_UNORDERED_LIST_COMMAND"), Ap = ct("INSERT_ORDERED_LIST_COMMAND"), Op = ct("REMOVE_LIST_COMMAND"); function $N(n) { return Mt(n.registerCommand(Ap, () => (Ti("number"), !0), De), n.registerCommand(bp, () => (Ti("bullet"), !0), De), n.registerCommand(Op, () => (Gc(), !0), De), n.registerCommand(Xn, () => Sp(), De), n.registerNodeTransform(wr, e => { let t = e.getFirstChild(); if (t) { if (Z(t)) { let r = t.getStyle(), o = t.getFormat(); e.getTextStyle() !== r && e.setTextStyle(r), e.getTextFormat() !== o && e.setTextFormat(o) } } else { let r = k(); v(r) && (r.style !== e.getTextStyle() || r.format !== e.getTextFormat()) && r.isCollapsed() && e.is(r.anchor.getNode()) && e.setTextStyle(r.style).setTextFormat(r.format) } }), n.registerNodeTransform(St, e => { let t = e.getParent(); if (se(t) && e.is(t.getFirstChild())) { let r = e.getStyle(), o = e.getFormat(); r === t.getTextStyle() && o === t.getTextFormat() || t.setTextStyle(r).setTextFormat(o) } })) } function IN(n) { let e = t => { let r = t.getParent(); if (ne(t.getFirstChild()) || !ne(r)) return; let o = Q(t, i => se(i) && ne(i.getParent()) && se(i.getPreviousSibling())); if (o === null && t.getIndent() > 0) t.setIndent(0); else if (se(o)) { let i = o.getPreviousSibling(); if (se(i)) { let s = function (l) { let c = l, u = c.getFirstChild(); for (; ne(u);) { let p = u.getLastChild(); if (!se(p)) break; c = p, u = c.getFirstChild() } return c }(i), a = s.getParent(); if (ne(a)) { let l = na(a); l + 1 < na(r) && t.setIndent(l) } } } }; return n.registerNodeTransform(xo, t => { let r = [t]; for (; r.length > 0;) { let o = r.shift(); if (ne(o)) { for (let i of o.getChildren()) if (se(i)) { e(i); let s = i.getFirstChild(); ne(s) && r.push(s) } } } }) } function PN(n, e) { n.update(() => Ti(e)) } function BN(n) { n.update(() => Gc()) } var Ie = Yc, YE = Ie.$createListItemNode, jE = Ie.$createListNode, JE = Ie.$getListDepth, VE = Ie.$handleListInsertParagraph, XE = Ie.$insertList, qE = Ie.$isListItemNode, vp = Ie.$isListNode, ZE = Ie.$removeList, Dp = Ie.INSERT_CHECK_LIST_COMMAND, oa = Ie.INSERT_ORDERED_LIST_COMMAND, ia = Ie.INSERT_UNORDERED_LIST_COMMAND, wp = Ie.ListItemNode, jc = Ie.ListNode, QE = Ie.REMOVE_LIST_COMMAND, eb = Ie.insertList, tb = Ie.registerCheckList, Mp = Ie.registerList, nb = Ie.registerListStrictIndentTransform, rb = Ie.removeList; var Xc = {}; At(Xc, { createEmptyHistoryState: () => YN, registerHistory: () => GN }); var sa = 0, Jc = 1, Vc = 2, Jt = 0, KN = 1, kp = 2, HN = 3, zN = 4; function UN(n, e, t, r, o) { if (n === null || t.size === 0 && r.size === 0 && !o) return Jt; let i = e._selection, s = n._selection; if (o) return KN; if (!(v(i) && v(s) && s.isCollapsed() && i.isCollapsed())) return Jt; let a = function (_, C, y) { let x = _._nodeMap, b = []; for (let S of C) { let N = x.get(S); N !== void 0 && b.push(N) } for (let [S, N] of y) { if (!N) continue; let A = x.get(S); A === void 0 || en(A) || b.push(A) } return b }(e, t, r); if (a.length === 0) return Jt; if (a.length > 1) { let _ = e._nodeMap, C = _.get(i.anchor.key), y = _.get(s.anchor.key); return C && y && !n._nodeMap.has(C.__key) && Z(C) && C.__text.length === 1 && i.anchor.offset === 1 ? kp : Jt } let l = a[0], c = n._nodeMap.get(l.__key); if (!Z(c) || !Z(l) || c.__mode !== l.__mode) return Jt; let u = c.__text, p = l.__text; if (u === p) return Jt; let g = i.anchor, f = s.anchor; if (g.key !== f.key || g.type !== "text") return Jt; let d = g.offset, m = f.offset, h = p.length - u.length; return h === 1 && m === d - 1 ? kp : h === -1 && m === d + 1 ? HN : h === -1 && m === d ? zN : Jt } function WN(n, e) { let t = Date.now(), r = Jt; return (o, i, s, a, l, c) => { let u = Date.now(); if (c.has(vs)) return r = Jt, t = u, Vc; let p = UN(o, i, a, l, n.isComposing()), g = (() => { let f = s === null || s.editor === n, d = c.has(Cg); if (!d && f && c.has(_g)) return sa; if (o === null) return Jc; let m = i._selection; return a.size > 0 || l.size > 0 ? d === !1 && p !== Jt && p === r && u < t + e && f || a.size === 1 && function (h, _, C) { let y = _._nodeMap.get(h), x = C._nodeMap.get(h), b = _._selection, S = C._selection; return !(v(b) && v(S) && b.anchor.type === "element" && b.focus.type === "element" && S.anchor.type === "text" && S.focus.type === "text" || !Z(y) || !Z(x) || y.__parent !== x.__parent) && JSON.stringify(_.read(() => y.exportJSON())) === JSON.stringify(C.read(() => x.exportJSON())) }(Array.from(a)[0], o, i) ? sa : Jc : m !== null ? sa : Vc })(); return t = u, r = p, g } } function Rp(n) { n.undoStack = [], n.redoStack = [], n.current = null } function GN(n, e, t) { let r = WN(n, t); return Mt(n.registerCommand($s, () => (function (i, s) { let a = s.redoStack, l = s.undoStack; if (l.length !== 0) { let c = s.current, u = l.pop(); c !== null && (a.push(c), i.dispatchCommand(Sr, !0)), l.length === 0 && i.dispatchCommand(Tr, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: vs }) } }(n, e), !0), te), n.registerCommand(Ls, () => (function (i, s) { let a = s.redoStack, l = s.undoStack; if (a.length !== 0) { let c = s.current; c !== null && (l.push(c), i.dispatchCommand(Tr, !0)); let u = a.pop(); a.length === 0 && i.dispatchCommand(Sr, !1), s.current = u || null, u && u.editor.setEditorState(u.editorState, { tag: vs }) } }(n, e), !0), te), n.registerCommand(ug, () => (Rp(e), !1), te), n.registerCommand(dg, () => (Rp(e), n.dispatchCommand(Sr, !1), n.dispatchCommand(Tr, !1), !0), te), n.registerUpdateListener(({ editorState: i, prevEditorState: s, dirtyLeaves: a, dirtyElements: l, tags: c }) => { let u = e.current, p = e.redoStack, g = e.undoStack, f = u === null ? null : u.editorState; if (u !== null && i === f) return; let d = r(s, i, u, a, l, c); if (d === Jc) p.length !== 0 && (e.redoStack = [], n.dispatchCommand(Sr, !1)), u !== null && (g.push({ ...u }), n.dispatchCommand(Tr, !0)); else if (d === Vc) return; e.current = { editor: n, editorState: i } })) } function YN() { return { current: null, redoStack: [], undoStack: [] } } var Fp = Xc, Lp = Fp.createEmptyHistoryState, $p = Fp.registerHistory; var vn = (() => { return ((n, e, t, r) => { let o = e.createElement("canvas").getContext("2d"), i = { r: 0, g: 0, b: 0, h: 0, s: 0, v: 0, a: 1 }, s, a, l, c, u, p, g, f, d, m, h, _, C, y, x, b, S = {}, N = { el: "[data-coloris]", parent: "body", theme: "default", themeMode: "light", rtl: !1, wrap: !0, margin: 2, format: "hex", formatToggle: !1, swatches: [], swatchesOnly: !1, alpha: !0, forceAlpha: !1, focusInput: !0, selectInput: !1, inline: !1, defaultColor: "#000000", clearButton: !1, clearLabel: "Clear", closeButton: !1, closeLabel: "Close", onChange: () => r, a11y: { open: "Open color picker", close: "Close color picker", clear: "Clear the selected color", marker: "Saturation: {s}. Brightness: {v}.", hueSlider: "Hue slider", alphaSlider: "Opacity slider", input: "Color value field", format: "Color format", swatch: "Color swatch", instruction: "Saturation and brightness selector. Use up, down, left and right arrow keys to select." } }, A = {}, O = "", F = {}, L = !1; function G(T) { if (typeof T == "object") for (let D in T) switch (D) { case "el": de(T.el), T.wrap !== !1 && Qe(T.el); break; case "parent": s = T.parent instanceof HTMLElement ? T.parent : e.querySelector(T.parent), s && (s.appendChild(a), N.parent = T.parent, s === e.body && (s = r)); break; case "themeMode": N.themeMode = T.themeMode, T.themeMode === "auto" && n.matchMedia && n.matchMedia("(prefers-color-scheme: dark)").matches && (N.themeMode = "dark"); case "theme": T.theme && (N.theme = T.theme), a.className = "clr-picker clr-" + N.theme + " clr-" + N.themeMode, N.inline && le(); break; case "rtl": N.rtl = !!T.rtl, Array.from(e.getElementsByClassName("clr-field")).forEach(Y => Y.classList.toggle("clr-rtl", N.rtl)); break; case "margin": T.margin *= 1, N.margin = isNaN(T.margin) ? N.margin : T.margin; break; case "wrap": T.el && T.wrap && Qe(T.el); break; case "formatToggle": N.formatToggle = !!T.formatToggle, nt("clr-format").style.display = N.formatToggle ? "block" : "none", N.formatToggle && (N.format = "auto"); break; case "swatches": if (Array.isArray(T.swatches)) { let Y = nt("clr-swatches"), ie = e.createElement("div"); Y.textContent = "", T.swatches.forEach((be, gt) => { let _e = e.createElement("button"); _e.setAttribute("type", "button"), _e.setAttribute("id", "clr-swatch-" + gt), _e.setAttribute("aria-labelledby", "clr-swatch-label clr-swatch-" + gt), _e.style.color = be, _e.textContent = be, ie.appendChild(_e) }), T.swatches.length && Y.appendChild(ie), N.swatches = T.swatches.slice() } break; case "swatchesOnly": N.swatchesOnly = !!T.swatchesOnly, a.setAttribute("data-minimal", N.swatchesOnly); break; case "alpha": N.alpha = !!T.alpha, a.setAttribute("data-alpha", N.alpha); break; case "inline": if (N.inline = !!T.inline, a.setAttribute("data-inline", N.inline), N.inline) { let Y = T.defaultColor || N.defaultColor; y = ft(Y), le(), ke(Y) } break; case "clearButton": typeof T.clearButton == "object" && (T.clearButton.label && (N.clearLabel = T.clearButton.label, g.innerHTML = N.clearLabel), T.clearButton = T.clearButton.show), N.clearButton = !!T.clearButton, g.style.display = N.clearButton ? "block" : "none"; break; case "clearLabel": N.clearLabel = T.clearLabel, g.innerHTML = N.clearLabel; break; case "closeButton": N.closeButton = !!T.closeButton, N.closeButton ? a.insertBefore(f, u) : u.appendChild(f); break; case "closeLabel": N.closeLabel = T.closeLabel, f.innerHTML = N.closeLabel; break; case "a11y": let w = T.a11y, P = !1; if (typeof w == "object") for (let Y in w) w[Y] && N.a11y[Y] && (N.a11y[Y] = w[Y], P = !0); if (P) { let Y = nt("clr-open-label"), ie = nt("clr-swatch-label"); Y.innerHTML = N.a11y.open, ie.innerHTML = N.a11y.swatch, f.setAttribute("aria-label", N.a11y.close), g.setAttribute("aria-label", N.a11y.clear), d.setAttribute("aria-label", N.a11y.hueSlider), h.setAttribute("aria-label", N.a11y.alphaSlider), p.setAttribute("aria-label", N.a11y.input), l.setAttribute("aria-label", N.a11y.instruction) } break; default: N[D] = T[D] } } function U(T, D) { typeof T == "string" && typeof D == "object" && (A[T] = D, L = !0) } function K(T) { delete A[T], Object.keys(A).length === 0 && (L = !1, T === O && q()) } function W(T) { if (L) { let D = ["el", "wrap", "rtl", "inline", "defaultColor", "a11y"]; for (let w in A) { let P = A[w]; if (T.matches(w)) { O = w, F = {}, D.forEach(Y => delete P[Y]); for (let Y in P) F[Y] = Array.isArray(N[Y]) ? N[Y].slice() : N[Y]; G(P); break } } } } function q() { Object.keys(F).length > 0 && (G(F), O = "", F = {}) } function de(T) { T instanceof HTMLElement && (T = [T]), Array.isArray(T) ? T.forEach(D => { Ne(D, "click", ae), Ne(D, "input", dt) }) : (Ne(e, "click", T, ae), Ne(e, "input", T, dt)) } function ae(T) { N.inline || (W(T.target), C = T.target, x = C.value, y = ft(x), a.classList.add("clr-open"), le(), ke(x), (N.focusInput || N.selectInput) && (p.focus({ preventScroll: !0 }), p.setSelectionRange(C.selectionStart, C.selectionEnd)), N.selectInput && p.select(), (b || N.swatchesOnly) && bu().shift().focus(), C.dispatchEvent(new Event("open", { bubbles: !0 }))) } function le() { if (!a || !C && !N.inline) return; let T = s, D = n.scrollY, w = a.offsetWidth, P = a.offsetHeight, Y = { left: !1, top: !1 }, ie, be, gt, _e = { x: 0, y: 0 }; if (T && (ie = n.getComputedStyle(T), be = parseFloat(ie.marginTop), gt = parseFloat(ie.borderTopWidth), _e = T.getBoundingClientRect(), _e.y += gt + D), !N.inline) { let ht = C.getBoundingClientRect(), Rn = ht.x, ir = D + ht.y + ht.height + N.margin; T ? (Rn -= _e.x, ir -= _e.y, Rn + w > T.clientWidth && (Rn += ht.width - w, Y.left = !0), ir + P > T.clientHeight - be && P + N.margin <= ht.top - (_e.y - D) && (ir -= ht.height + P + N.margin * 2, Y.top = !0), ir += T.scrollTop) : (Rn + w > e.documentElement.clientWidth && (Rn += ht.width - w, Y.left = !0), ir + P - D > e.documentElement.clientHeight && P + N.margin <= ht.top && (ir = D + ht.y - P - N.margin, Y.top = !0)), a.classList.toggle("clr-left", Y.left), a.classList.toggle("clr-top", Y.top), a.style.left = Rn + "px", a.style.top = ir + "px", _e.x += a.offsetLeft, _e.y += a.offsetTop } S = { width: l.offsetWidth, height: l.offsetHeight, x: l.offsetLeft + _e.x, y: l.offsetTop + _e.y } } function Qe(T) { T instanceof HTMLElement ? Je(T) : Array.isArray(T) ? T.forEach(Je) : e.querySelectorAll(T).forEach(Je) } function Je(T) { let D = T.parentNode; if (!D.classList.contains("clr-field")) { let w = e.createElement("div"), P = "clr-field"; (N.rtl || T.classList.contains("clr-rtl")) && (P += " clr-rtl"), w.innerHTML = '', D.insertBefore(w, T), w.className = P, w.style.color = T.value, w.appendChild(T) } } function dt(T) { let D = T.target.parentNode; D.classList.contains("clr-field") && (D.style.color = T.target.value) } function Be(T) { if (C && !N.inline) { let D = C; T && (C = r, x !== D.value && (D.value = x, D.dispatchEvent(new Event("input", { bubbles: !0 })))), setTimeout(() => { x !== D.value && D.dispatchEvent(new Event("change", { bubbles: !0 })) }), a.classList.remove("clr-open"), L && q(), D.dispatchEvent(new Event("close", { bubbles: !0 })), N.focusInput && D.focus({ preventScroll: !0 }), C = r } } function ke(T) { let D = $o(T), w = Lo(D); ye(w.s, w.v), kn(D, w), d.value = w.h, a.style.color = "hsl(" + w.h + ", 100%, 50%)", m.style.left = w.h / 360 * 100 + "%", c.style.left = S.width * w.s / 100 + "px", c.style.top = S.height - S.height * w.v / 100 + "px", h.value = w.a * 100, _.style.left = w.a * 100 + "%" } function ft(T) { let D = T.substring(0, 3).toLowerCase(); return D === "rgb" || D === "hsl" ? D : "hex" } function Oe(T) { T = T !== r ? T : p.value, C && (C.value = T, C.dispatchEvent(new Event("input", { bubbles: !0 }))), N.onChange && N.onChange.call(n, T, C), e.dispatchEvent(new CustomEvent("coloris:pick", { detail: { color: T, currentEl: C } })) } function re(T, D) { let w = { h: d.value * 1, s: T / S.width * 100, v: 100 - D / S.height * 100, a: h.value / 100 }, P = Ta(w); ye(w.s, w.v), kn(P, w), Oe() } function ye(T, D) { let w = N.a11y.marker; T = T.toFixed(1) * 1, D = D.toFixed(1) * 1, w = w.replace("{s}", T), w = w.replace("{v}", D), c.setAttribute("aria-label", w) } function Re(T) { return { pageX: T.changedTouches ? T.changedTouches[0].pageX : T.pageX, pageY: T.changedTouches ? T.changedTouches[0].pageY : T.pageY } } function Ve(T) { let D = Re(T), w = D.pageX - S.x, P = D.pageY - S.y; s && (P += s.scrollTop), Mn(w, P), T.preventDefault(), T.stopPropagation() } function Fo(T, D) { let w = c.style.left.replace("px", "") * 1 + T, P = c.style.top.replace("px", "") * 1 + D; Mn(w, P) } function Mn(T, D) { T = T < 0 ? 0 : T > S.width ? S.width : T, D = D < 0 ? 0 : D > S.height ? S.height : D, c.style.left = T + "px", c.style.top = D + "px", re(T, D), c.focus() } function kn(T, D) { T === void 0 && (T = {}), D === void 0 && (D = {}); let w = N.format; for (let ie in T) i[ie] = T[ie]; for (let ie in D) i[ie] = D[ie]; let P = ba(i), Y = P.substring(0, 7); switch (c.style.color = Y, _.parentNode.style.color = Y, _.style.color = P, u.style.color = P, l.style.display = "none", l.offsetHeight, l.style.display = "", _.nextElementSibling.style.display = "none", _.nextElementSibling.offsetHeight, _.nextElementSibling.style.display = "", w === "mixed" ? w = i.a === 1 ? "hex" : "rgb" : w === "auto" && (w = y), w) { case "hex": p.value = P; break; case "rgb": p.value = qm(i); break; case "hsl": p.value = Zm(Ea(i)); break }e.querySelector('.clr-format [value="' + w + '"]').checked = !0 } function Sa() { let T = d.value * 1, D = c.style.left.replace("px", "") * 1, w = c.style.top.replace("px", "") * 1; a.style.color = "hsl(" + T + ", 100%, 50%)", m.style.left = T / 360 * 100 + "%", re(D, w) } function It() { let T = h.value / 100; _.style.left = T * 100 + "%", kn({ a: T }), Oe() } function Ta(T) { let D = T.s / 100, w = T.v / 100, P = D * w, Y = T.h / 60, ie = P * (1 - t.abs(Y % 2 - 1)), be = w - P; P = P + be, ie = ie + be; let gt = t.floor(Y) % 6, _e = [P, ie, be, be, ie, P][gt], ht = [ie, P, P, ie, be, be][gt], Rn = [be, be, ie, P, P, ie][gt]; return { r: t.round(_e * 255), g: t.round(ht * 255), b: t.round(Rn * 255), a: T.a } } function Ea(T) { let D = T.v / 100, w = D * (1 - T.s / 100 / 2), P; return w > 0 && w < 1 && (P = t.round((D - w) / t.min(w, 1 - w) * 100)), { h: T.h, s: P || 0, l: t.round(w * 100), a: T.a } } function Lo(T) { let D = T.r / 255, w = T.g / 255, P = T.b / 255, Y = t.max(D, w, P), ie = t.min(D, w, P), be = Y - ie, gt = Y, _e = 0, ht = 0; return be && (Y === D && (_e = (w - P) / be), Y === w && (_e = 2 + (P - D) / be), Y === P && (_e = 4 + (D - w) / be), Y && (ht = be / Y)), _e = t.floor(_e * 60), { h: _e < 0 ? _e + 360 : _e, s: t.round(ht * 100), v: t.round(gt * 100), a: T.a } } function $o(T) { let D = /^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i, w, P; return o.fillStyle = "#000", o.fillStyle = T, w = D.exec(o.fillStyle), w ? P = { r: w[3] * 1, g: w[4] * 1, b: w[5] * 1, a: w[6] * 1 } : (w = o.fillStyle.replace("#", "").match(/.{2}/g).map(Y => parseInt(Y, 16)), P = { r: w[0], g: w[1], b: w[2], a: 1 }), P } function ba(T) { let D = T.r.toString(16), w = T.g.toString(16), P = T.b.toString(16), Y = ""; if (T.r < 16 && (D = "0" + D), T.g < 16 && (w = "0" + w), T.b < 16 && (P = "0" + P), N.alpha && (T.a < 1 || N.forceAlpha)) { let ie = T.a * 255 | 0; Y = ie.toString(16), ie < 16 && (Y = "0" + Y) } return "#" + D + w + P + Y } function qm(T) { return !N.alpha || T.a === 1 && !N.forceAlpha ? "rgb(" + T.r + ", " + T.g + ", " + T.b + ")" : "rgba(" + T.r + ", " + T.g + ", " + T.b + ", " + T.a + ")" } function Zm(T) { return !N.alpha || T.a === 1 && !N.forceAlpha ? "hsl(" + T.h + ", " + T.s + "%, " + T.l + "%)" : "hsla(" + T.h + ", " + T.s + "%, " + T.l + "%, " + T.a + ")" } function Qm() { e.getElementById("clr-picker") || (s = r, a = e.createElement("div"), a.setAttribute("id", "clr-picker"), a.className = "clr-picker", a.innerHTML = '' + ('
') + '
' + ('') + '
' + ('') + '
' + ("" + N.a11y.format + "") + '
' + ('") + '
' + ('") + "
" + ('") + ('"), e.body.appendChild(a), l = nt("clr-color-area"), c = nt("clr-color-marker"), g = nt("clr-clear"), f = nt("clr-close"), u = nt("clr-color-preview"), p = nt("clr-color-value"), d = nt("clr-hue-slider"), m = nt("clr-hue-marker"), h = nt("clr-alpha-slider"), _ = nt("clr-alpha-marker"), de(N.el), Qe(N.el), Ne(a, "mousedown", T => { a.classList.remove("clr-keyboard-nav"), T.stopPropagation() }), Ne(l, "mousedown", T => { Ne(e, "mousemove", Ve) }), Ne(l, "contextmenu", T => { T.preventDefault() }), Ne(l, "touchstart", T => { e.addEventListener("touchmove", Ve, { passive: !1 }) }), Ne(c, "mousedown", T => { Ne(e, "mousemove", Ve) }), Ne(c, "touchstart", T => { e.addEventListener("touchmove", Ve, { passive: !1 }) }), Ne(p, "change", T => { let D = p.value; if (C || N.inline) { let w = D === "" ? D : ke(D); Oe(w) } }), Ne(g, "click", T => { Oe(""), Be() }), Ne(f, "click", T => { Oe(), Be() }), Ne(nt("clr-format"), "click", ".clr-format input", T => { y = T.target.value, kn(), Oe() }), Ne(a, "click", ".clr-swatches button", T => { ke(T.target.textContent), Oe(), N.swatchesOnly && Be() }), Ne(e, "mouseup", T => { e.removeEventListener("mousemove", Ve) }), Ne(e, "touchend", T => { e.removeEventListener("touchmove", Ve) }), Ne(e, "mousedown", T => { b = !1, a.classList.remove("clr-keyboard-nav"), Be() }), Ne(e, "keydown", T => { let D = T.key, w = T.target, P = T.shiftKey; if (D === "Escape" ? Be(!0) : ["Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"].includes(D) && (b = !0, a.classList.add("clr-keyboard-nav")), D === "Tab" && w.matches(".clr-picker *")) { let ie = bu(), be = ie.shift(), gt = ie.pop(); P && w === be ? (gt.focus(), T.preventDefault()) : !P && w === gt && (be.focus(), T.preventDefault()) } }), Ne(e, "click", ".clr-field button", T => { L && q(), T.target.nextElementSibling.dispatchEvent(new Event("click", { bubbles: !0 })) }), Ne(c, "keydown", T => { let D = { ArrowUp: [0, -1], ArrowDown: [0, 1], ArrowLeft: [-1, 0], ArrowRight: [1, 0] }; Object.keys(D).includes(T.key) && (Fo(...D[T.key]), T.preventDefault()) }), Ne(l, "click", Ve), Ne(d, "input", Sa), Ne(h, "input", It)) } function bu() { return Array.from(a.querySelectorAll("input, button")).filter(w => !!w.offsetWidth) } function nt(T) { return e.getElementById(T) } function Ne(T, D, w, P) { let Y = Element.prototype.matches || Element.prototype.msMatchesSelector; typeof w == "string" ? T.addEventListener(D, ie => { Y.call(ie.target, w) && P.call(ie.target, ie) }) : (P = w, T.addEventListener(D, P)) } function Di(T, D) { D = D !== r ? D : [], e.readyState !== "loading" ? T(...D) : e.addEventListener("DOMContentLoaded", () => { T(...D) }) } NodeList !== r && NodeList.prototype && !NodeList.prototype.forEach && (NodeList.prototype.forEach = Array.prototype.forEach); function e_(T, D) { C = D, x = C.value, W(D), y = ft(T), le(), ke(T), Oe(), x !== T && C.dispatchEvent(new Event("change", { bubbles: !0 })) } let Aa = (() => { let T = { init: Qm, set: G, wrap: Qe, close: Be, setInstance: U, setColor: e_, removeInstance: K, updatePosition: le, ready: Di }; function D(w) { Di(() => { w && (typeof w == "string" ? de(w) : G(w)) }) } for (let w in T) D[w] = function () { for (var P = arguments.length, Y = new Array(P), ie = 0; ie < P; ie++)Y[ie] = arguments[ie]; Di(T[w], Y) }; return Di(() => { n.addEventListener("resize", w => { D.updatePosition() }), n.addEventListener("scroll", w => { D.updatePosition() }) }), D })(); return Aa.coloris = Aa, Aa })(window, document, Math) })(), lb = vn.coloris, cb = vn.init, ub = vn.set, db = vn.wrap, fb = vn.close, gb = vn.setInstance, hb = vn.removeInstance, pb = vn.updatePosition, aa = vn; var Zc = {}; At(Zc, { $canShowPlaceholder: () => Pp, $canShowPlaceholderCurry: () => JN, $findTextIntersectionFromCharacters: () => VN, $isRootTextContentEmpty: () => qc, $isRootTextContentEmptyCurry: () => jN, $rootTextContent: () => Ip, registerLexicalTextEntity: () => qN }); function Ip() { return Ge().getTextContent() } function qc(n, e = !0) { if (n) return !1; let t = Ip(); return e && (t = t.trim()), t === "" } function jN(n, e) { return () => qc(n, e) } function Pp(n) { if (!qc(n, !1)) return !1; let e = Ge().getChildren(), t = e.length; if (t > 1) return !1; for (let r = 0; r < t; r++) { let o = e[r]; if (Tn(o)) return !1; if ($(o)) { if (!jn(o) || o.__indent !== 0) return !1; let i = o.getChildren(), s = i.length; for (let a = 0; a < s; a++) { let l = i[r]; if (!Z(l)) return !1 } } } return !0 } function JN(n) { return () => Pp(n) } function VN(n, e) { let t = n.getFirstChild(), r = 0; e: for (; t !== null;) { if ($(t)) { let s = t.getFirstChild(); if (s !== null) { t = s; continue } } else if (Z(t)) { let s = t.getTextContentSize(); if (r + s > e) return { node: t, offset: e - r }; r += s } let o = t.getNextSibling(); if (o !== null) { t = o; continue } let i = t.getParent(); for (; i !== null;) { let s = i.getNextSibling(); if (s !== null) { t = s; continue e } i = i.getParent() } break } return null } function XN(n, ...e) { let t = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams; r.append("code", n); for (let o of e) r.append("v", o); throw t.search = r.toString(), Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`) } function qN(n, e, t, r) { let o = s => s instanceof t, i = s => { let a = st(s.getTextContent()); a.setFormat(s.getFormat()), s.replace(a) }; return [n.registerNodeTransform(St, s => { if (!s.isSimpleText()) return; let a, l = s.getPreviousSibling(), c = s.getTextContent(), u = s; if (Z(l)) { let g = l.getTextContent(), f = e(g + c); if (o(l)) { if (f === null || (d => d.getLatest().__mode)(l) !== 0) return void i(l); { let d = f.end - g.length; if (d > 0) { let m = g + c.slice(0, d); if (l.select(), l.setTextContent(m), d === c.length) s.remove(); else { let h = c.slice(d); s.setTextContent(h) } return } } } else if (f === null || f.start < g.length) return } let p = 0; for (; ;) { a = e(c); let g, f = a === null ? "" : c.slice(a.end); if (c = f, f === "") { let m = u.getNextSibling(); if (Z(m)) { f = u.getTextContent() + m.getTextContent(); let h = e(f); if (h === null) return void (o(m) ? i(m) : m.markDirty()); if (h.start !== 0) return } } if (a === null) return; if (a.start === 0 && Z(l) && l.isTextEntity()) { p += a.end; continue } a.start === 0 ? [g, u] = u.splitText(a.end) : [, g, u] = u.splitText(a.start + p, a.end + p), g === void 0 && XN(165, "nodeToReplace"); let d = r(g); if (d.setFormat(g.getFormat()), g.replace(d), u == null) return; p = 0, l = d } }), n.registerNodeTransform(t, s => { let a = s.getTextContent(), l = e(a); if (l === null || l.start !== 0) return void i(s); if (a.length > l.end) return void s.splitText(l.end); let c = s.getPreviousSibling(); Z(c) && c.isTextEntity() && (i(c), i(s)); let u = s.getNextSibling(); Z(u) && u.isTextEntity() && (i(u), o(s) && i(s)) })] } var Mr = Zc, Cb = Mr.$canShowPlaceholder, yb = Mr.$canShowPlaceholderCurry, Nb = Mr.$findTextIntersectionFromCharacters, xb = Mr.$isRootTextContentEmpty, Sb = Mr.$isRootTextContentEmptyCurry, Tb = Mr.$rootTextContent, Bp = Mr.registerLexicalTextEntity; function ZN() { let n = "\xC0-\xD6\xD8-\xF6\xF8-\xFF\u0100-\u024F\u0253-\u0254\u0256-\u0257\u0259\u025B\u0263\u0268\u026F\u0272\u0289\u028B\u02BB\u0300-\u036F\u1E00-\u1EFF", e = "\u0400-\u04FF\u0500-\u0527\u2DE0-\u2DFF\uA640-\uA69F\u0591-\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F4\uFB12-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFB4F\u0610-\u061A\u0620-\u065F\u066E-\u06D3\u06D5-\u06DC\u06DE-\u06E8\u06EA-\u06EF\u06FA-\u06FC\u06FF\u0750-\u077F\u08A0\u08A2-\u08AC\u08E4-\u08FE\uFB50-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\u200C-\u200C\u0E01-\u0E3A\u0E40-\u0E4E\u1100-\u11FF\u3130-\u3185\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF\uFFA1-\uFFDC", t = String.fromCharCode, r = "\u30A1-\u30FA\u30FC-\u30FE\uFF66-\uFF9F\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\u3041-\u3096\u3099-\u309E\u3400-\u4DBF\u4E00-\u9FFF" + t(173824) + "-" + t(177983) + t(177984) + "-" + t(178207) + t(194560) + "-" + t(195103) + "\u3003\u3005\u303B", o = n + e + r, i = "A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u0241\u0250-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EE\u037A\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03F5\u03F7-\u0481\u048A-\u04CE\u04D0-\u04F9\u0500-\u050F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0640-\u064A\u066E-\u066F\u0671-\u06D3\u06D5\u06E5-\u06E6\u06EE-\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u076D\u0780-\u07A5\u07B1\u0904-\u0939\u093D\u0950\u0958-\u0961\u097D\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0-\u0AE1\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D60-\u0D61\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E46\u0E81-\u0E82\u0E84\u0E87-\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDD\u0F00\u0F40-\u0F47\u0F49-\u0F6A\u0F88-\u0F8B\u1000-\u1021\u1023-\u1027\u1029-\u102A\u1050-\u1055\u10A0-\u10C5\u10D0-\u10FA\u10FC\u1100-\u1159\u115F-\u11A2\u11A8-\u11F9\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u1676\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19A9\u19C1-\u19C7\u1A00-\u1A16\u1D00-\u1DBF\u1E00-\u1E9B\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u2094\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2131\u2133-\u2139\u213C-\u213F\u2145-\u2149\u2C00-\u2C2E\u2C30-\u2C5E\u2C80-\u2CE4\u2D00-\u2D25\u2D30-\u2D65\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3006\u3031-\u3035\u303B-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312C\u3131-\u318E\u31A0-\u31B7\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FBB\uA000-\uA48C\uA800-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uAC00-\uD7A3\uF900-\uFA2D\uFA30-\uFA6A\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC", s = "\u0300-\u036F\u0483-\u0486\u0591-\u05B9\u05BB-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u0615\u064B-\u065E\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u0901-\u0903\u093C\u093E-\u094D\u0951-\u0954\u0962-\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7\u09E2-\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A70-\u0A71\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2-\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C82-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D82-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2-\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F3E-\u0F3F\u0F71-\u0F84\u0F86-\u0F87\u0F90-\u0F97\u0F99-\u0FBC\u0FC6\u102C-\u1032\u1036-\u1039\u1056-\u1059\u135F\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17B6-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8-\u19C9\u1A17-\u1A1B\u1DC0-\u1DC3\u20D0-\u20DC\u20E1\u20E5-\u20EB\u302A-\u302F\u3099-\u309A\uA802\uA806\uA80B\uA823-\uA827\uFB1E\uFE00-\uFE0F\uFE20-\uFE23", a = "0-9\u0660-\u0669\u06F0-\u06F9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\uFF10-\uFF19", l = i + s + o, c = a + "_", u = l + c; return { alpha: l, alphanumeric: u, hashChars: "#\\uFF03" } } function QN() { let { alpha: n, alphanumeric: e, hashChars: t } = ZN(), r = "[" + n + "]", o = "[" + e + "]", i = "^|$|[^&/" + e + "]", s = "[" + t + "]"; return "(" + i + ")(" + s + ")(" + o + "*" + r + o + "*)" } var e0 = new RegExp(QN(), "i"), Kp = function (n) { return Ih(n.getTextContent()) }, Hp = function (n) { let e = e0.exec(n); if (e === null) return null; let t = e[3].length + 1, r = e.index + e[1].length; return { end: r + t, start: r } }; var Qc = ct("INSERT_HORIZONTAL_RULE_COMMAND"), Ei = class n extends Os { static getType() { return "horizontalrule" } static clone(e) { return new n(e.__key) } static importJSON(e) { return eu() } static importDOM() { return { hr: () => ({ conversion: n0, priority: 0 }) } } exportDOM() { return { element: document.createElement("hr") } } createDOM(e) { let t = document.createElement("hr"); pe(t, e.theme.hr); let r = "selected"; return t?.addEventListener("click", () => { t.classList.toggle(r) }), t?.setAttribute("x-on:click.outside", '$el.classList.remove("' + r + '")'), t } getTextContent() { return ` `} isInline() { return !1 } updateDOM() { return !1 } decorate() { return xn().getElementByKey(this.__key) } }; function n0() { return { node: eu() } } function eu() { return Te(new Ei) } function zp(n) { return n.registerCommand(Qc, e => { let t = k(); if (!v(t)) return !1; if (t.focus.getNode() !== null) { let o = eu(); js(o) } return !0 }, te) } var yu = {}; At(yu, { $computeTableMap: () => Ze, $computeTableMapSkipCellCheck: () => wn, $createTableCellNode: () => bt, $createTableNode: () => ma, $createTableNodeWithDimensions: () => Zp, $createTableRowNode: () => Fr, $createTableSelection: () => pu, $createTableSelectionFrom: () => sm, $deleteTableColumn: () => g0, $deleteTableColumnAtSelection: () => rm, $deleteTableColumn__EXPERIMENTAL: () => p0, $deleteTableRowAtSelection: () => nm, $deleteTableRow__EXPERIMENTAL: () => h0, $findCellNode: () => Eo, $findTableNode: () => Rr, $getElementForTableNode: () => dm, $getNodeTriplet: () => Pe, $getTableAndElementByKey: () => mu, $getTableCellNodeFromLexicalNode: () => i0, $getTableCellNodeRect: () => su, $getTableColumnIndexFromTableCellNode: () => a0, $getTableNodeFromLexicalNodeOrThrow: () => pa, $getTableRowIndexFromTableCellNode: () => s0, $getTableRowNodeFromTableCellNodeOrThrow: () => gu, $insertTableColumn: () => d0, $insertTableColumnAtSelection: () => tm, $insertTableColumn__EXPERIMENTAL: () => f0, $insertTableRow: () => c0, $insertTableRowAtSelection: () => em, $insertTableRow__EXPERIMENTAL: () => u0, $isScrollableTablesActive: () => ha, $isTableCellNode: () => j, $isTableNode: () => Ee, $isTableRowNode: () => he, $isTableSelection: () => fe, $mergeCells: () => om, $removeTableRowAtIndex: () => l0, $unmergeCell: () => _0, INSERT_TABLE_COMMAND: () => qp, TableCellHeaderStates: () => me, TableCellNode: () => nr, TableNode: () => or, TableObserver: () => ga, TableRowNode: () => Ao, applyTableHandlers: () => am, getDOMCellFromTarget: () => Oi, getTableElement: () => rr, getTableObserverFromTableElement: () => lu, registerTableCellUnmergeTransform: () => R0, registerTablePlugin: () => L0, registerTableSelectionObserver: () => F0, setScrollableTablesActive: () => A0 }); var du = /^(\d+(?:\.\d+)?)px$/, me = { BOTH: 3, COLUMN: 2, NO_STATUS: 0, ROW: 1 }, nr = class n extends xt { static getType() { return "tablecell" } static clone(e) { return new n(e.__headerState, e.__colSpan, e.__width, e.__key) } afterCloneFrom(e) { super.afterCloneFrom(e), this.__rowSpan = e.__rowSpan, this.__backgroundColor = e.__backgroundColor, this.__verticalAlign = e.__verticalAlign } static importDOM() { return { td: e => ({ conversion: Up, priority: 0 }), th: e => ({ conversion: Up, priority: 0 }) } } static importJSON(e) { return bt().updateFromJSON(e) } updateFromJSON(e) { return super.updateFromJSON(e).setHeaderStyles(e.headerState).setColSpan(e.colSpan || 1).setRowSpan(e.rowSpan || 1).setWidth(e.width || void 0).setBackgroundColor(e.backgroundColor || null).setVerticalAlign(e.verticalAlign || void 0) } constructor(e = me.NO_STATUS, t = 1, r, o) { super(o), this.__colSpan = t, this.__rowSpan = 1, this.__headerState = e, this.__width = r, this.__backgroundColor = null, this.__verticalAlign = void 0 } createDOM(e) { let t = document.createElement(this.getTag()); return this.__width && (t.style.width = `${this.__width}px`), this.__colSpan > 1 && (t.colSpan = this.__colSpan), this.__rowSpan > 1 && (t.rowSpan = this.__rowSpan), this.__backgroundColor !== null && (t.style.backgroundColor = this.__backgroundColor), nu(this.__verticalAlign) && (t.style.verticalAlign = this.__verticalAlign), pe(t, e.theme.tableCell, this.hasHeader() && e.theme.tableCellHeader), t } exportDOM(e) { let t = super.exportDOM(e); if (br(t.element)) { let r = t.element; r.setAttribute("data-temporary-table-cell-lexical-key", this.getKey()), r.style.border = "1px solid black", this.__colSpan > 1 && (r.colSpan = this.__colSpan), this.__rowSpan > 1 && (r.rowSpan = this.__rowSpan), r.style.width = `${this.getWidth() || 75}px`, r.style.verticalAlign = this.getVerticalAlign() || "top", r.style.textAlign = "start", this.__backgroundColor === null && this.hasHeader() && (r.style.backgroundColor = "#f2f3f5") } return t } exportJSON() { return { ...super.exportJSON(), ...nu(this.__verticalAlign) && { verticalAlign: this.__verticalAlign }, backgroundColor: this.getBackgroundColor(), colSpan: this.__colSpan, headerState: this.__headerState, rowSpan: this.__rowSpan, width: this.getWidth() } } getColSpan() { return this.getLatest().__colSpan } setColSpan(e) { let t = this.getWritable(); return t.__colSpan = e, t } getRowSpan() { return this.getLatest().__rowSpan } setRowSpan(e) { let t = this.getWritable(); return t.__rowSpan = e, t } getTag() { return this.hasHeader() ? "th" : "td" } setHeaderStyles(e, t = me.BOTH) { let r = this.getWritable(); return r.__headerState = e & t | r.__headerState & ~t, r } getHeaderStyles() { return this.getLatest().__headerState } setWidth(e) { let t = this.getWritable(); return t.__width = e, t } getWidth() { return this.getLatest().__width } getBackgroundColor() { return this.getLatest().__backgroundColor } setBackgroundColor(e) { let t = this.getWritable(); return t.__backgroundColor = e, t } getVerticalAlign() { return this.getLatest().__verticalAlign } setVerticalAlign(e) { let t = this.getWritable(); return t.__verticalAlign = e || void 0, t } toggleHeaderStyle(e) { let t = this.getWritable(); return (t.__headerState & e) === e ? t.__headerState -= e : t.__headerState += e, t } hasHeaderState(e) { return (this.getHeaderStyles() & e) === e } hasHeader() { return this.getLatest().__headerState !== me.NO_STATUS } updateDOM(e) { return e.__headerState !== this.__headerState || e.__width !== this.__width || e.__colSpan !== this.__colSpan || e.__rowSpan !== this.__rowSpan || e.__backgroundColor !== this.__backgroundColor || e.__verticalAlign !== this.__verticalAlign } isShadowRoot() { return !0 } collapseAtStart() { return !0 } canBeEmpty() { return !1 } canIndent() { return !1 } }; function nu(n) { return n === "middle" || n === "bottom" } function Up(n) { let e = n, t = n.nodeName.toLowerCase(), r; du.test(e.style.width) && (r = parseFloat(e.style.width)); let o = bt(t === "th" ? me.ROW : me.NO_STATUS, e.colSpan, r); o.__rowSpan = e.rowSpan; let i = e.style.backgroundColor; i !== "" && (o.__backgroundColor = i); let s = e.style.verticalAlign; nu(s) && (o.__verticalAlign = s); let a = e.style, l = (a && a.textDecoration || "").split(" "), c = a.fontWeight === "700" || a.fontWeight === "bold", u = l.includes("line-through"), p = a.fontStyle === "italic", g = l.includes("underline"); return { after: f => { let d = [], m = null, h = () => { if (m) { let _ = m.getFirstChild(); ve(_) && m.getChildrenSize() === 1 && _.remove() } }; for (let _ of f) tg(_) || Z(_) || ve(_) ? (Z(_) && (c && _.toggleFormat("bold"), u && _.toggleFormat("strikethrough"), p && _.toggleFormat("italic"), g && _.toggleFormat("underline")), m ? m.append(_) : (m = oe().append(_), d.push(m))) : (d.push(_), h(), m = null); return h(), d.length === 0 && d.push(oe()), d }, node: o } } function bt(n = me.NO_STATUS, e = 1, t) { return Te(new nr(n, e, t)) } function j(n) { return n instanceof nr } var qp = ct("INSERT_TABLE_COMMAND"); function z(n, ...e) { let t = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams; r.append("code", n); for (let o of e) r.append("v", o); throw t.search = r.toString(), Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`) } var Ao = class n extends xt { static getType() { return "tablerow" } static clone(e) { return new n(e.__height, e.__key) } static importDOM() { return { tr: e => ({ conversion: r0, priority: 0 }) } } static importJSON(e) { return Fr().updateFromJSON(e) } updateFromJSON(e) { return super.updateFromJSON(e).setHeight(e.height) } constructor(e, t) { super(t), this.__height = e } exportJSON() { let e = this.getHeight(); return { ...super.exportJSON(), ...e === void 0 ? void 0 : { height: e } } } createDOM(e) { let t = document.createElement("tr"); return this.__height && (t.style.height = `${this.__height}px`), pe(t, e.theme.tableRow), t } extractWithChild(e, t, r) { return r === "html" } isShadowRoot() { return !0 } setHeight(e) { let t = this.getWritable(); return t.__height = e, t } getHeight() { return this.getLatest().__height } updateDOM(e) { return e.__height !== this.__height } canBeEmpty() { return !1 } canIndent() { return !1 } }; function r0(n) { let e = n, t; return du.test(e.style.height) && (t = parseFloat(e.style.height)), { after: r => hc(r, j), node: Fr(t) } } function Fr(n) { return Te(new Ao(n)) } function he(n) { return n instanceof Ao } var fu = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, o0 = fu && "documentMode" in document ? document.documentMode : null, Wp = fu && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent); function Zp(n, e, t = !0) { let r = ma(); for (let o = 0; o < n; o++) { let i = Fr(); for (let s = 0; s < e; s++) { let a = me.NO_STATUS; typeof t == "object" ? (o === 0 && t.rows && (a |= me.ROW), s === 0 && t.columns && (a |= me.COLUMN)) : t && (o === 0 && (a |= me.ROW), s === 0 && (a |= me.COLUMN)); let l = bt(a), c = oe(); c.append(st()), l.append(c), i.append(l) } r.append(i) } return r } function i0(n) { let e = Q(n, t => j(t)); return j(e) ? e : null } function gu(n) { let e = Q(n, t => he(t)); if (he(e)) return e; throw new Error("Expected table cell to be inside of table row.") } function pa(n) { let e = Q(n, t => Ee(t)); if (Ee(e)) return e; throw new Error("Expected table cell to be inside of table.") } function s0(n) { let e = gu(n); return pa(e).getChildren().findIndex(t => t.is(e)) } function a0(n) { return gu(n).getChildren().findIndex(e => e.is(n)) } function Qp(n, e) { let t = pa(n), { x: r, y: o } = t.getCordsFromCellNode(n, e); return { above: t.getCellNodeFromCords(r, o - 1, e), below: t.getCellNodeFromCords(r, o + 1, e), left: t.getCellNodeFromCords(r - 1, o, e), right: t.getCellNodeFromCords(r + 1, o, e) } } function l0(n, e) { let t = n.getChildren(); if (e >= t.length || e < 0) throw new Error("Expected table cell to be inside of table row."); return t[e].remove(), n } function c0(n, e, t = !0, r, o) { let i = n.getChildren(); if (e >= i.length || e < 0) throw new Error("Table row target index out of range"); let s = i[e]; if (!he(s)) throw new Error("Row before insertion index does not exist."); for (let a = 0; a < r; a++) { let l = s.getChildren(), c = l.length, u = Fr(); for (let p = 0; p < c; p++) { let g = l[p]; j(g) || z(12); let { above: f, below: d } = Qp(g, o), m = me.NO_STATUS, h = f && f.getWidth() || d && d.getWidth() || void 0; (f && f.hasHeaderState(me.COLUMN) || d && d.hasHeaderState(me.COLUMN)) && (m |= me.COLUMN); let _ = bt(m, 1, h); _.append(oe()), u.append(_) } t ? s.insertAfter(u) : s.insertBefore(u) } return n } fu && "InputEvent" in window && !o0 && new window.InputEvent("input"); var ru = (n, e) => n === me.BOTH || n === e ? e : me.NO_STATUS; function em(n = !0) { let e = k(); v(e) || fe(e) || z(188); let t = e.anchor.getNode(), r = e.focus.getNode(), [o] = Pe(t), [i, , s] = Pe(r), [, a, l] = Ze(s, i, o), { startRow: c } = l, { startRow: u } = a; return n ? ou(c + o.__rowSpan > u + i.__rowSpan ? o : i, !0) : ou(u < c ? i : o, !1) } var u0 = em; function ou(n, e = !0) { let [, , t] = Pe(n), [r, o] = Ze(t, n, n), i = r[0].length, { startRow: s } = o, a = null; if (e) { let l = s + n.__rowSpan - 1, c = r[l], u = Fr(); for (let g = 0; g < i; g++) { let { cell: f, startRow: d } = c[g]; if (d + f.__rowSpan - 1 <= l) { let m = c[g].cell.__headerState, h = ru(m, me.COLUMN); u.append(bt(h).append(oe())) } else f.setRowSpan(f.__rowSpan + 1) } let p = t.getChildAtIndex(l); he(p) || z(256), p.insertAfter(u), a = u } else { let l = s, c = r[l], u = Fr(); for (let g = 0; g < i; g++) { let { cell: f, startRow: d } = c[g]; if (d === l) { let m = c[g].cell.__headerState, h = ru(m, me.COLUMN); u.append(bt(h).append(oe())) } else f.setRowSpan(f.__rowSpan + 1) } let p = t.getChildAtIndex(l); he(p) || z(257), p.insertBefore(u), a = u } return a } function d0(n, e, t = !0, r, o) { let i = n.getChildren(), s = []; for (let a = 0; a < i.length; a++) { let l = i[a]; if (he(l)) for (let c = 0; c < r; c++) { let u = l.getChildren(); if (e >= u.length || e < 0) throw new Error("Table column target index out of range"); let p = u[e]; j(p) || z(12); let { left: g, right: f } = Qp(p, o), d = me.NO_STATUS; (g && g.hasHeaderState(me.ROW) || f && f.hasHeaderState(me.ROW)) && (d |= me.ROW); let m = bt(d); m.append(oe()), s.push({ newTableCell: m, targetCell: p }) } } return s.forEach(({ newTableCell: a, targetCell: l }) => { t ? l.insertAfter(a) : l.insertBefore(a) }), n } function tm(n = !0) { let e = k(); v(e) || fe(e) || z(188); let t = e.anchor.getNode(), r = e.focus.getNode(), [o] = Pe(t), [i, , s] = Pe(r), [, a, l] = Ze(s, i, o), { startColumn: c } = l, { startColumn: u } = a; return n ? iu(c + o.__colSpan > u + i.__colSpan ? o : i, !0) : iu(u < c ? i : o, !1) } var f0 = tm; function iu(n, e = !0, t = !0) { let [, , r] = Pe(n), [o, i] = Ze(r, n, n), s = o.length, { startColumn: a } = i, l = e ? a + n.__colSpan - 1 : a - 1, c = r.getFirstChild(); he(c) || z(120); let u = null; function p(d = me.NO_STATUS) { let m = bt(d).append(oe()); return u === null && (u = m), m } let g = c; e: for (let d = 0; d < s; d++) { if (d !== 0) { let b = g.getNextSibling(); he(b) || z(121), g = b } let m = o[d], h = m[l < 0 ? 0 : l].cell.__headerState, _ = ru(h, me.ROW); if (l < 0) { hu(g, p(_)); continue } let { cell: C, startColumn: y, startRow: x } = m[l]; if (y + C.__colSpan - 1 <= l) { let b = C, S = x, N = l; for (; S !== d && b.__rowSpan > 1;) { if (N -= C.__colSpan, !(N >= 0)) { g.append(p(_)); continue e } { let { cell: A, startRow: O } = m[N]; b = A, S = O } } b.insertAfter(p(_)) } else C.setColSpan(C.__colSpan + 1) } u !== null && t && Ai(u); let f = r.getColWidths(); if (f) { let d = [...f], m = l < 0 ? 0 : l, h = d[m]; d.splice(m, 0, h), r.setColWidths(d) } return u } function g0(n, e) { let t = n.getChildren(); for (let r = 0; r < t.length; r++) { let o = t[r]; if (he(o)) { let i = o.getChildren(); if (e >= i.length || e < 0) throw new Error("Table column target index out of range"); i[e].remove() } } return n } function nm() { let n = k(); v(n) || fe(n) || z(188); let [e, t] = n.isBackward() ? [n.focus.getNode(), n.anchor.getNode()] : [n.anchor.getNode(), n.focus.getNode()], [r, , o] = Pe(e), [i] = Pe(t), [s, a, l] = Ze(o, r, i), { startRow: c } = a, { startRow: u } = l, p = u + i.__rowSpan - 1; if (s.length === p - c + 1) return void o.remove(); let g = s[0].length, f = r.__rowSpan, d = s[p + 1], m = o.getChildAtIndex(p + 1); for (let h = p; h >= c; h--) { for (let C = g - 1; C >= 0; C--) { let { cell: y, startRow: x, startColumn: b } = s[h][C]; if (b === C) { if (h === c && x < c) { let S = c - x; y.setRowSpan(y.__rowSpan - Math.min(f, y.__rowSpan - S)) } if (x >= c && x + y.__rowSpan - 1 > p) { y.setRowSpan(y.__rowSpan - (p - x + 1)), m === null && z(122); let S = null; for (let N = 0; N < C; N++) { let A = d[N], O = A.cell; A.startRow === h + 1 && (S = O), O.__colSpan > 1 && (N += O.__colSpan - 1) } S === null ? hu(m, y) : S.insertAfter(y) } } } let _ = o.getChildAtIndex(h); he(_) || z(206, String(h)), _.remove() } if (d !== void 0) { let { cell: h } = d[0]; Ai(h) } else { let h = s[c - 1], { cell: _ } = h[0]; Ai(_) } } var h0 = nm; function rm() { let n = k(); v(n) || fe(n) || z(188); let e = n.anchor.getNode(), t = n.focus.getNode(), [r, , o] = Pe(e), [i] = Pe(t), [s, a, l] = Ze(o, r, i), { startColumn: c } = a, { startRow: u, startColumn: p } = l, g = Math.min(c, p), f = Math.max(c + r.__colSpan - 1, p + i.__colSpan - 1), d = f - g + 1; if (s[0].length === f - g + 1) return o.selectPrevious(), void o.remove(); let m = s.length; for (let y = 0; y < m; y++)for (let x = g; x <= f; x++) { let { cell: b, startColumn: S } = s[y][x]; if (S < g) { if (x === g) { let N = g - S; b.setColSpan(b.__colSpan - Math.min(d, b.__colSpan - N)) } } else if (S + b.__colSpan - 1 > f) { if (x === f) { let N = f - S + 1; b.setColSpan(b.__colSpan - N) } } else b.remove() } let h = s[u], _ = c > p ? h[c + r.__colSpan] : h[p + i.__colSpan]; if (_ !== void 0) { let { cell: y } = _; Ai(y) } else { let y = p < c ? h[p - 1] : h[c - 1], { cell: x } = y; Ai(x) } let C = o.getColWidths(); if (C) { let y = [...C]; y.splice(g, d), o.setColWidths(y) } } var p0 = rm; function Ai(n) { let e = n.getFirstDescendant(); e == null ? n.selectStart() : e.getParentOrThrow().selectStart() } function hu(n, e) { let t = n.getFirstChild(); t !== null ? t.insertBefore(e) : n.append(e) } function om(n) { if (n.length === 0) return null; let e = pa(n[0]), [t] = wn(e, null, null), r = 1 / 0, o = -1 / 0, i = 1 / 0, s = -1 / 0, a = new Set; for (let f of t) for (let d of f) { if (!d || !d.cell) continue; let m = d.cell.getKey(); if (!a.has(m) && n.some(h => h.is(d.cell))) { a.add(m); let h = d.startRow, _ = d.startColumn, C = d.cell.__rowSpan || 1, y = d.cell.__colSpan || 1; r = Math.min(r, h), o = Math.max(o, h + C - 1), i = Math.min(i, _), s = Math.max(s, _ + y - 1) } } if (r === 1 / 0 || i === 1 / 0) return null; let l = o - r + 1, c = s - i + 1, u = t[r][i]; if (!u.cell) return null; let p = u.cell; p.setColSpan(c), p.setRowSpan(l); let g = new Set([p.getKey()]); for (let f = r; f <= o; f++)for (let d = i; d <= s; d++) { let m = t[f][d]; if (!m.cell) continue; let h = m.cell, _ = h.getKey(); g.has(_) || (g.add(_), m0(h) || p.append(...h.getChildren()), h.remove()) } return p.getChildrenSize() === 0 && p.append(oe()), p } function m0(n) { if (n.getChildrenSize() !== 1) return !1; let e = n.getFirstChildOrThrow(); return !(!jn(e) || !e.isEmpty()) } function _0() { let n = k(); v(n) || fe(n) || z(188); let e = n.anchor.getNode(), t = Q(e, j); return j(t) || z(148), im(t) } function im(n) { let [e, t, r] = Pe(n), o = e.__colSpan, i = e.__rowSpan; if (o === 1 && i === 1) return; let [s, a] = Ze(r, e, e), { startColumn: l, startRow: c } = a, u = e.__headerState & me.COLUMN, p = Array.from({ length: o }, (d, m) => { let h = u; for (let _ = 0; h !== 0 && _ < s.length; _++)h &= s[_][m + l].cell.__headerState; return h }), g = e.__headerState & me.ROW, f = Array.from({ length: i }, (d, m) => { let h = g; for (let _ = 0; h !== 0 && _ < s[0].length; _++)h &= s[m + c][_].cell.__headerState; return h }); if (o > 1) { for (let d = 1; d < o; d++)e.insertAfter(bt(p[d] | f[0]).append(oe())); e.setColSpan(1) } if (i > 1) { let d; for (let m = 1; m < i; m++) { let h = c + m, _ = s[h]; d = (d || t).getNextSibling(), he(d) || z(125); let C = null; for (let y = 0; y < l; y++) { let x = _[y], b = x.cell; x.startRow === h && (C = b), b.__colSpan > 1 && (y += b.__colSpan - 1) } if (C === null) for (let y = o - 1; y >= 0; y--)hu(d, bt(p[y] | f[m]).append(oe())); else for (let y = o - 1; y >= 0; y--)C.insertAfter(bt(p[y] | f[m]).append(oe())) } e.setRowSpan(1) } } function Ze(n, e, t) { let [r, o, i] = wn(n, e, t); return o === null && z(207), i === null && z(208), [r, o, i] } function wn(n, e, t) { let r = [], o = null, i = null; function s(l) { let c = r[l]; return c === void 0 && (r[l] = c = []), c } let a = n.getChildren(); for (let l = 0; l < a.length; l++) { let c = a[l]; he(c) || z(209); let u = s(l); for (let p = c.getFirstChild(), g = 0; p != null; p = p.getNextSibling()) { for (j(p) || z(147); u[g] !== void 0;)g++; let f = { cell: p, startColumn: g, startRow: l }, { __rowSpan: d, __colSpan: m } = p; for (let h = 0; h < d && !(l + h >= a.length); h++) { let _ = s(l + h); for (let C = 0; C < m; C++)_[g + C] = f } e !== null && o === null && e.is(p) && (o = f), t !== null && i === null && t.is(p) && (i = f) } } return [r, o, i] } function Pe(n) { let e; if (n instanceof nr) e = n; else if ("__type" in n) { let o = Q(n, j); j(o) || z(148), e = o } else { let o = Q(n.getNode(), j); j(o) || z(148), e = o } let t = e.getParent(); he(t) || z(149); let r = t.getParent(); return Ee(r) || z(210), [e, t, r] } function da(n, e, t) { let r, o = Math.min(e.startColumn, t.startColumn), i = Math.min(e.startRow, t.startRow), s = Math.max(e.startColumn + e.cell.__colSpan - 1, t.startColumn + t.cell.__colSpan - 1), a = Math.max(e.startRow + e.cell.__rowSpan - 1, t.startRow + t.cell.__rowSpan - 1); do { r = !1; for (let l = 0; l < n.length; l++)for (let c = 0; c < n[0].length; c++) { let u = n[l][c]; if (!u) continue; let p = u.startColumn + u.cell.__colSpan - 1, g = u.startRow + u.cell.__rowSpan - 1, f = u.startColumn <= s && p >= o, d = u.startRow <= a && g >= i; if (f && d) { let m = Math.min(o, u.startColumn), h = Math.max(s, p), _ = Math.min(i, u.startRow), C = Math.max(a, g); m === o && h === s && _ === i && C === a || (o = m, s = h, i = _, a = C, r = !0) } } } while (r); return { maxColumn: s, maxRow: a, minColumn: o, minRow: i } } function su(n) { let [e, , t] = Pe(n), r = t.getChildren(), o = r.length, i = r[0].getChildren().length, s = new Array(o); for (let a = 0; a < o; a++)s[a] = new Array(i); for (let a = 0; a < o; a++) { let l = r[a].getChildren(), c = 0; for (let u = 0; u < l.length; u++) { for (; s[a][c];)c++; let p = l[u], g = p.__rowSpan || 1, f = p.__colSpan || 1; for (let d = 0; d < g; d++)for (let m = 0; m < f; m++)s[a + d][c + m] = p; if (e === p) return { colSpan: f, columnIndex: c, rowIndex: a, rowSpan: g }; c += f } } return null } function Gp(n) { let [[e, t, r, o], [i, s, a, l]] = ["anchor", "focus"].map(c => { let u = n[c].getNode(), p = Q(u, j); j(p) || z(238, c, u.getKey(), u.getType()); let g = p.getParent(); he(g) || z(239, c); let f = g.getParent(); return Ee(f) || z(240, c), [u, p, g, f] }); return o.is(l) || z(241), { anchorCell: t, anchorNode: e, anchorRow: r, anchorTable: o, focusCell: s, focusNode: i, focusRow: a, focusTable: l } } var fa = class n { constructor(e, t, r) { this.anchor = t, this.focus = r, t._selection = this, r._selection = this, this._cachedNodes = null, this.dirty = !1, this.tableKey = e } getStartEndPoints() { return [this.anchor, this.focus] } isValid() { return this.tableKey !== "root" && this.anchor.key !== "root" && this.anchor.type === "element" && this.focus.key !== "root" && this.focus.type === "element" } isBackward() { return this.focus.isBefore(this.anchor) } getCachedNodes() { return this._cachedNodes } setCachedNodes(e) { this._cachedNodes = e } is(e) { return fe(e) && this.tableKey === e.tableKey && this.anchor.is(e.anchor) && this.focus.is(e.focus) } set(e, t, r) { this.dirty = this.dirty || e !== this.tableKey || t !== this.anchor.key || r !== this.focus.key, this.tableKey = e, this.anchor.key = t, this.focus.key = r, this._cachedNodes = null } clone() { return new n(this.tableKey, ii(this.anchor.key, this.anchor.offset, this.anchor.type), ii(this.focus.key, this.focus.offset, this.focus.type)) } isCollapsed() { return !1 } extract() { return this.getNodes() } insertRawText(e) { } insertText() { } hasFormat(e) { let t = 0; this.getNodes().filter(j).forEach(o => { let i = o.getFirstChild(); jn(i) && (t |= i.getTextFormat()) }); let r = bg[e]; return !!(t & r) } insertNodes(e) { let t = this.focus.getNode(); $(t) || z(151), xr(t.select(0, t.getChildrenSize())).insertNodes(e) } getShape() { let { anchorCell: e, focusCell: t } = Gp(this), r = su(e); r === null && z(153); let o = su(t); o === null && z(155); let i = Math.min(r.columnIndex, o.columnIndex), s = Math.max(r.columnIndex + r.colSpan - 1, o.columnIndex + o.colSpan - 1), a = Math.min(r.rowIndex, o.rowIndex), l = Math.max(r.rowIndex + r.rowSpan - 1, o.rowIndex + o.rowSpan - 1); return { fromX: Math.min(i, s), fromY: Math.min(a, l), toX: Math.max(i, s), toY: Math.max(a, l) } } getNodes() { if (!this.isValid()) return []; let e = this._cachedNodes; if (e !== null) return e; let { anchorTable: t, anchorCell: r, focusCell: o } = Gp(this), i = o.getParents()[1]; if (i !== t) { if (t.isParentOf(o)) { let h = i.getParent(); h == null && z(159), this.set(this.tableKey, o.getKey(), h.getKey()) } else { let h = t.getParent(); h == null && z(158), this.set(this.tableKey, h.getKey(), o.getKey()) } return this.getNodes() } let [s, a, l] = Ze(t, r, o), { minColumn: c, maxColumn: u, minRow: p, maxRow: g } = da(s, a, l), f = new Map([[t.getKey(), t]]), d = null; for (let h = p; h <= g; h++)for (let _ = c; _ <= u; _++) { let { cell: C } = s[h][_], y = C.getParent(); he(y) || z(160), y !== d && (f.set(y.getKey(), y), d = y), f.has(C.getKey()) || C0(C, x => { f.set(x.getKey(), x) }) } let m = Array.from(f.values()); return vg() || (this._cachedNodes = m), m } getTextContent() { let e = this.getNodes().filter(r => j(r)), t = ""; for (let r = 0; r < e.length; r++) { let o = e[r], i = o.__parent, s = (e[r + 1] || {}).__parent; t += o.getTextContent() + (s !== i ? ` `: " ") } return t } }; function fe(n) { return n instanceof fa } function pu() { let n = ii("root", 0, "element"), e = ii("root", 0, "element"); return new fa("root", n, e) } function sm(n, e, t) { n.getKey(), e.getKey(), t.getKey(); let r = k(), o = fe(r) ? r.clone() : pu(); return o.set(n.getKey(), e.getKey(), t.getKey()), o } function C0(n, e) { let t = [[n]]; for (let r = t.at(-1); r !== void 0 && t.length > 0; r = t.at(-1)) { let o = r.pop(); o === void 0 ? t.pop() : e(o) !== !1 && $(o) && t.push(o.getChildren()) } } function mu(n, e = xn()) { let t = at(n); Ee(t) || z(231, n); let r = rr(t, e.getElementByKey(n)); return r === null && z(232, n), { tableElement: r, tableNode: t } } var ga = class { constructor(e, t) { this.isHighlightingCells = !1, this.anchorX = -1, this.anchorY = -1, this.focusX = -1, this.focusY = -1, this.listenersToRemove = new Set, this.tableNodeKey = t, this.editor = e, this.table = { columns: 0, domRows: [], rows: 0 }, this.tableSelection = null, this.anchorCellNodeKey = null, this.focusCellNodeKey = null, this.anchorCell = null, this.focusCell = null, this.hasHijackedSelectionStyles = !1, this.isSelecting = !1, this.pointerType = null, this.shouldCheckSelection = !1, this.abortController = new AbortController, this.listenerOptions = { signal: this.abortController.signal }, this.nextFocus = null, this.trackTable() } getTable() { return this.table } removeListeners() { this.abortController.abort("removeListeners"), Array.from(this.listenersToRemove).forEach(e => e()), this.listenersToRemove.clear() } $lookup() { return mu(this.tableNodeKey, this.editor) } trackTable() { let e = new MutationObserver(t => { this.editor.getEditorState().read(() => { let r = !1; for (let s = 0; s < t.length; s++) { let a = t[s].target.nodeName; if (a === "TABLE" || a === "TBODY" || a === "THEAD" || a === "TR") { r = !0; break } } if (!r) return; let { tableNode: o, tableElement: i } = this.$lookup(); this.table = bo(o, i) }, { editor: this.editor }) }); this.editor.getEditorState().read(() => { let { tableNode: t, tableElement: r } = this.$lookup(); this.table = bo(t, r), e.observe(r, { attributes: !0, childList: !0, subtree: !0 }) }, { editor: this.editor }) } $clearHighlight() { let e = this.editor; this.isHighlightingCells = !1, this.anchorX = -1, this.anchorY = -1, this.focusX = -1, this.focusY = -1, this.tableSelection = null, this.anchorCellNodeKey = null, this.focusCellNodeKey = null, this.anchorCell = null, this.focusCell = null, this.hasHijackedSelectionStyles = !1, this.$enableHighlightStyle(); let { tableNode: t, tableElement: r } = this.$lookup(); la(e, bo(t, r), null), k() !== null && (Ye(null), e.dispatchCommand(Er, void 0)) } $enableHighlightStyle() { let e = this.editor, { tableElement: t } = this.$lookup(); $t(t, e._config.theme.tableSelection), t.classList.remove("disable-selection"), this.hasHijackedSelectionStyles = !1 } $disableHighlightStyle() { let { tableElement: e } = this.$lookup(); pe(e, this.editor._config.theme.tableSelection), this.hasHijackedSelectionStyles = !0 } $updateTableTableSelection(e) { if (e !== null) { e.tableKey !== this.tableNodeKey && z(233, e.tableKey, this.tableNodeKey); let t = this.editor; this.tableSelection = e, this.isHighlightingCells = !0, this.$disableHighlightStyle(), this.updateDOMSelection(), la(t, this.table, this.tableSelection) } else this.$clearHighlight() } setShouldCheckSelection() { this.shouldCheckSelection = !0 } getAndClearShouldCheckSelection() { return !!this.shouldCheckSelection && (this.shouldCheckSelection = !1, !0) } setNextFocus(e) { this.nextFocus = e } getAndClearNextFocus() { let { nextFocus: e } = this; return e !== null && (this.nextFocus = null), e } updateDOMSelection() { if (this.anchorCell !== null && this.focusCell !== null) { let e = qn(this.editor._window); e && e.rangeCount > 0 && e.removeAllRanges() } } $setFocusCellForSelection(e, t = !1) { let r = this.editor, { tableNode: o } = this.$lookup(), i = e.x, s = e.y; if (this.focusCell = e, this.isHighlightingCells || this.anchorX === i && this.anchorY === s && !t) { if (i === this.focusX && s === this.focusY) return !1 } else this.isHighlightingCells = !0, this.$disableHighlightStyle(); if (this.focusX = i, this.focusY = s, this.isHighlightingCells) { let a = cu(o, e.elem); if (this.tableSelection != null && this.anchorCellNodeKey != null && a !== null) return this.focusCellNodeKey = a.getKey(), this.tableSelection = sm(o, this.$getAnchorTableCellOrThrow(), a), Ye(this.tableSelection), r.dispatchCommand(Er, void 0), la(r, this.table, this.tableSelection), !0 } return !1 } $getAnchorTableCell() { return this.anchorCellNodeKey ? at(this.anchorCellNodeKey) : null } $getAnchorTableCellOrThrow() { let e = this.$getAnchorTableCell(); return e === null && z(234), e } $getFocusTableCell() { return this.focusCellNodeKey ? at(this.focusCellNodeKey) : null } $getFocusTableCellOrThrow() { let e = this.$getFocusTableCell(); return e === null && z(235), e } $setAnchorCellForSelection(e) { this.isHighlightingCells = !1, this.anchorCell = e, this.anchorX = e.x, this.anchorY = e.y; let { tableNode: t } = this.$lookup(), r = cu(t, e.elem); if (r !== null) { let o = r.getKey(); this.tableSelection = this.tableSelection != null ? this.tableSelection.clone() : pu(), this.anchorCellNodeKey = o } } $formatCells(e) { let t = k(); fe(t) || z(236); let r = so(), o = r.anchor, i = r.focus, s = t.getNodes().filter(j); s.length > 0 || z(237); let a = s[0].getFirstChild(), l = jn(a) ? a.getFormatFlags(e, null) : null; s.forEach(c => { o.set(c.getKey(), 0, "element"), i.set(c.getKey(), c.getChildrenSize(), "element"), r.formatText(e, l) }), Ye(t), this.editor.dispatchCommand(Er, void 0) } $clearText() { let { editor: e } = this, t = at(this.tableNodeKey); if (!Ee(t)) throw new Error("Expected TableNode."); let r = k(); fe(r) || z(253); let o = r.getNodes().filter(j), i = t.getFirstChild(), s = t.getLastChild(); if (o.length > 0 && i !== null && s !== null && he(i) && he(s) && o[0] === i.getFirstChild() && o[o.length - 1] === s.getLastChild()) { t.selectPrevious(); let a = t.getParent(); return t.remove(), void (en(a) && a.isEmpty() && e.dispatchCommand(Xn, void 0)) } o.forEach(a => { if ($(a)) { let l = oe(), c = st(); l.append(c), a.append(l), a.getChildren().forEach(u => { u !== l && u.remove() }) } }), la(e, this.table, null), Ye(null), e.dispatchCommand(Er, void 0) } }, au = "__lexicalTableSelection", y0 = n => !(1 & ~n.buttons); function To(n) { return br(n) && n.nodeName === "TABLE" } function rr(n, e) { if (!e) return e; let t = To(e) ? e : n.getDOMSlot(e).element; return t.nodeName !== "TABLE" && z(245, e.nodeName), t } function _u(n) { return n._window } function bi(n, e) { for (let t = e, r = null; t !== null; t = t.getParent()) { if (n.is(t)) return r; j(t) && (r = t) } return null } var N0 = [[En, "down"], [Gt, "up"], [lo, "backward"], [ws, "forward"]], x0 = [As, li, ao], S0 = [Ms, ks]; function am(n, e, t, r) { let o = t.getRootElement(), i = _u(t); o !== null && i !== null || z(246); let s = new ga(t, n.getKey()), a = rr(n, e); (function (f, d) { lu(f) !== null && z(205), f[au] = d })(a, s), s.listenersToRemove.add(() => function (f, d) { lu(f) === d && delete f[au] }(a, s)); let l = f => { if (s.pointerType = f.pointerType, f.button !== 0 || !tn(f.target) || !i) return; let d = Oi(f.target); d !== null && t.update(() => { let m = Sn(); if (Wp && f.shiftKey && ln(m, n) && (v(m) || fe(m))) { let h = m.anchor.getNode(), _ = bi(n, m.anchor.getNode()); _ ? (s.$setAnchorCellForSelection(kr(s, _)), s.$setFocusCellForSelection(d), Dn(f)) : (n.isBefore(h) ? n.selectStart() : n.selectEnd()).anchor.set(m.anchor.key, m.anchor.offset, m.anchor.type) } else s.$setAnchorCellForSelection(d) }), (() => { if (s.isSelecting) return; let m = () => { s.isSelecting = !1, i.removeEventListener("pointerup", m), i.removeEventListener("pointermove", h) }, h = _ => { if (!y0(_) && s.isSelecting) return s.isSelecting = !1, i.removeEventListener("pointerup", m), void i.removeEventListener("pointermove", h); if (!tn(_.target)) return; let C = null, y = !(Wp || a.contains(_.target)); if (y) C = Yp(a, _.target); else for (let x of document.elementsFromPoint(_.clientX, _.clientY)) if (C = Yp(a, x), C) break; !C || s.focusCell !== null && C.elem === s.focusCell.elem || (s.setNextFocus({ focusCell: C, override: y }), t.dispatchCommand(Er, void 0)) }; s.isSelecting = !0, i.addEventListener("pointerup", m, s.listenerOptions), i.addEventListener("pointermove", h, s.listenerOptions) })() }; a.addEventListener("pointerdown", l, s.listenerOptions), s.listenersToRemove.add(() => { a.removeEventListener("pointerdown", l) }); let c = f => { f.detail >= 3 && tn(f.target) && Oi(f.target) !== null && f.preventDefault() }; a.addEventListener("mousedown", c, s.listenerOptions), s.listenersToRemove.add(() => { a.removeEventListener("mousedown", c) }); let u = f => { let d = f.target; f.button === 0 && tn(d) && t.update(() => { let m = k(); fe(m) && m.tableKey === s.tableNodeKey && o.contains(d) && s.$clearHighlight() }) }; i.addEventListener("pointerdown", u, s.listenerOptions), s.listenersToRemove.add(() => { i.removeEventListener("pointerdown", u) }); for (let [f, d] of N0) s.listenersToRemove.add(t.registerCommand(f, m => um(t, m, d, n, s), Ss)); s.listenersToRemove.add(t.registerCommand(co, f => { let d = k(); if (fe(d)) { let m = bi(n, d.focus.getNode()); if (m !== null) return Dn(f), m.selectEnd(), !0 } return !1 }, Ss)); let p = f => () => { let d = k(); if (!ln(d, n)) return !1; if (fe(d)) return s.$clearText(), !0; if (v(d)) { if (!j(bi(n, d.anchor.getNode()))) return !1; let m = d.anchor.getNode(), h = d.focus.getNode(), _ = n.isParentOf(m), C = n.isParentOf(h); if (_ && !C || C && !_) return s.$clearText(), !0; let y = Q(d.anchor.getNode(), b => $(b)), x = y && Q(y, b => $(b) && j(b.getParent())); if (!$(x) || !$(y)) return !1; if (f === li && x.getPreviousSibling() === null) return !0 } return !1 }; for (let f of x0) s.listenersToRemove.add(t.registerCommand(f, p(f), vt)); let g = f => { let d = k(); if (!fe(d) && !v(d)) return !1; let m = n.isParentOf(d.anchor.getNode()); if (m !== n.isParentOf(d.focus.getNode())) { let h = m ? "anchor" : "focus", _ = m ? "focus" : "anchor", { key: C, offset: y, type: x } = d[_]; return n[d[h].isBefore(d[_]) ? "selectPrevious" : "selectNext"]()[_].set(C, y, x), !1 } return !!ln(d, n) && !!fe(d) && (f && (f.preventDefault(), f.stopPropagation()), s.$clearText(), !0) }; for (let f of S0) s.listenersToRemove.add(t.registerCommand(f, g, vt)); return s.listenersToRemove.add(t.registerCommand(bs, f => { let d = k(); if (d) { if (!fe(d) && !v(d)) return !1; hi(t, jt(f, ClipboardEvent) ? f : null, bh(d)); let m = g(f); return v(d) ? (d.removeText(), !0) : m } return !1 }, vt)), s.listenersToRemove.add(t.registerCommand(lt, f => { let d = k(); if (!ln(d, n)) return !1; if (fe(d)) return s.$formatCells(f), !0; if (v(d)) { let m = Q(d.anchor.getNode(), h => j(h)); if (!j(m)) return !1 } return !1 }, vt)), s.listenersToRemove.add(t.registerCommand(Dt, f => { let d = k(); if (!fe(d) || !ln(d, n)) return !1; let m = d.anchor.getNode(), h = d.focus.getNode(); if (!j(m) || !j(h)) return !1; if (function (O, F) { if (fe(O)) { let L = O.anchor.getNode(), G = O.focus.getNode(); if (F && L && G) { let [U] = Ze(F, L, G); return L.getKey() === U[0][0].cell.getKey() && G.getKey() === U[U.length - 1].at(-1).cell.getKey() } } return !1 }(d, n)) return n.setFormat(f), !0; let [_, C, y] = Ze(n, m, h), x = Math.max(C.startRow + C.cell.__rowSpan - 1, y.startRow + y.cell.__rowSpan - 1), b = Math.max(C.startColumn + C.cell.__colSpan - 1, y.startColumn + y.cell.__colSpan - 1), S = Math.min(C.startRow, y.startRow), N = Math.min(C.startColumn, y.startColumn), A = new Set; for (let O = S; O <= x; O++)for (let F = N; F <= b; F++) { let L = _[O][F].cell; if (A.has(L)) continue; A.add(L), L.setFormat(f); let G = L.getChildren(); for (let U = 0; U < G.length; U++) { let K = G[U]; $(K) && !K.isInline() && K.setFormat(f) } } return !0 }, vt)), s.listenersToRemove.add(t.registerCommand(Ts, f => { let d = k(); if (!ln(d, n)) return !1; if (fe(d)) return s.$clearHighlight(), !1; if (v(d)) { let m = Q(d.anchor.getNode(), h => j(h)); if (!j(m)) return !1; if (typeof f == "string") { let h = Vp(t, d, n); if (h) return Jp(h, n, [st(f)]), !0 } } return !1 }, vt)), r && s.listenersToRemove.add(t.registerCommand(uo, f => { let d = k(); if (!v(d) || !d.isCollapsed() || !ln(d, n)) return !1; let m = Eo(d.anchor.getNode()); return !(m === null || !n.is(Rr(m))) && (Dn(f), function (h, _) { let C = _ === "next" ? "getNextSibling" : "getPreviousSibling", y = _ === "next" ? "getFirstChild" : "getLastChild", x = h[C](); if ($(x)) return x.selectEnd(); let b = Q(h, he); b === null && z(247); for (let N = b[C](); he(N); N = N[C]()) { let A = N[y](); if ($(A)) return A.selectEnd() } let S = Q(b, Ee); S === null && z(248), _ === "next" ? S.selectNext() : S.selectPrevious() }(m, f.shiftKey ? "previous" : "next"), !0) }, vt)), s.listenersToRemove.add(t.registerCommand(mg, f => n.isSelected(), Ss)), s.listenersToRemove.add(t.registerCommand(ui, f => { let { nodes: d, selection: m } = f, h = m.getStartEndPoints(), _ = fe(m), C = v(m) && Q(m.anchor.getNode(), re => j(re)) !== null && Q(m.focus.getNode(), re => j(re)) !== null || _; if (d.length !== 1 || !Ee(d[0]) || !C || h === null) return !1; let [y, x] = h, [b, S, N] = Pe(y), A = Q(x.getNode(), re => j(re)); if (!(j(b) && j(A) && he(S) && Ee(N))) return !1; let O = d[0], [F, L, G] = Ze(N, b, A), [U] = wn(O, null, null), K = F.length, W = K > 0 ? F[0].length : 0, q = L.startRow, de = L.startColumn, ae = U.length, le = ae > 0 ? U[0].length : 0; if (_) { let re = da(F, L, G), ye = re.maxRow - re.minRow + 1, Re = re.maxColumn - re.minColumn + 1; q = re.minRow, de = re.minColumn, ae = Math.min(ae, ye), le = Math.min(le, Re) } let Qe = !1, Je = Math.min(K, q + ae) - 1, dt = Math.min(W, de + le) - 1, Be = new Set; for (let re = q; re <= Je; re++)for (let ye = de; ye <= dt; ye++) { let Re = F[re][ye]; Be.has(Re.cell.getKey()) || Re.cell.__rowSpan === 1 && Re.cell.__colSpan === 1 || (im(Re.cell), Be.add(Re.cell.getKey()), Qe = !0) } let [ke] = wn(N.getWritable(), null, null), ft = ae - K + q; for (let re = 0; re < ft; re++)ou(ke[K - 1][0].cell); let Oe = le - W + de; for (let re = 0; re < Oe; re++)iu(ke[0][W - 1].cell, !0, !1);[ke] = wn(N.getWritable(), null, null); for (let re = q; re < q + ae; re++)for (let ye = de; ye < de + le; ye++) { let Re = re - q, Ve = ye - de, Fo = U[Re][Ve]; if (Fo.startRow !== Re || Fo.startColumn !== Ve) continue; let Mn = Fo.cell; if (Mn.__rowSpan !== 1 || Mn.__colSpan !== 1) { let It = [], Ta = Math.min(re + Mn.__rowSpan, q + ae) - 1, Ea = Math.min(ye + Mn.__colSpan, de + le) - 1; for (let Lo = re; Lo <= Ta; Lo++)for (let $o = ye; $o <= Ea; $o++) { let ba = ke[Lo][$o]; It.push(ba.cell) } om(It), Qe = !0 } let { cell: kn } = ke[re][ye], Sa = kn.getChildren(); Mn.getChildren().forEach(It => { Z(It) && oe().append(It), kn.append(It) }), Sa.forEach(It => It.remove()) } if (_ && Qe) { let [re] = wn(N.getWritable(), null, null); re[L.startRow][L.startColumn].cell.selectEnd() } return !0 }, vt)), s.listenersToRemove.add(t.registerCommand(Er, () => { let f = k(), d = Sn(), m = s.getAndClearNextFocus(); if (m !== null) { let { focusCell: h } = m; if (fe(f) && f.tableKey === s.tableNodeKey) return (h.x !== s.focusX || h.y !== s.focusY) && (s.$setFocusCellForSelection(h), !0); if (h !== s.anchorCell && ln(f, n)) return s.$setFocusCellForSelection(h), !0 } if (s.getAndClearShouldCheckSelection() && v(d) && v(f) && f.isCollapsed()) { let h = f.anchor.getNode(), _ = n.getFirstChild(), C = Eo(h); if (C !== null && he(_)) { let y = _.getFirstChild(); if (j(y) && n.is(Q(C, x => x.is(n) || x.is(y)))) return y.selectStart(), !0 } } if (v(f)) { let { anchor: h, focus: _ } = f, C = h.getNode(), y = _.getNode(), x = Eo(C), b = Eo(y), S = !(!x || !n.is(Rr(x))), N = !(!b || !n.is(Rr(b))), A = S !== N, O = S && N, F = f.isBackward(); if (A) { let L = f.clone(); if (N) { let [G] = Ze(n, b, b), U = G[0][0].cell, K = G[G.length - 1].at(-1).cell; L.focus.set(F ? U.getKey() : K.getKey(), F ? U.getChildrenSize() : K.getChildrenSize(), "element") } else if (S) { let [G] = Ze(n, x, x), U = G[0][0].cell, K = G[G.length - 1].at(-1).cell; L.anchor.set(F ? K.getKey() : U.getKey(), F ? K.getChildrenSize() : 0, "element") } Ye(L), jp(t, s) } else if (O && (x.is(b) || (s.$setAnchorCellForSelection(kr(s, x)), s.$setFocusCellForSelection(kr(s, b), !0)), s.pointerType === "touch" && f.isCollapsed() && v(d) && d.isCollapsed())) { let L = Eo(d.anchor.getNode()); L && !L.is(b) && (s.$setAnchorCellForSelection(kr(s, L)), s.$setFocusCellForSelection(kr(s, b), !0), s.pointerType = null) } } else if (f && fe(f) && f.is(d) && f.tableKey === n.getKey()) { let h = qn(i); if (h && h.anchorNode && h.focusNode) { let _ = $e(h.focusNode), C = _ && !n.isParentOf(_), y = $e(h.anchorNode), x = y && n.isParentOf(y); if (C && x && h.rangeCount > 0) { let b = Xf(h, t); b && (b.anchor.set(n.getKey(), f.isBackward() ? n.getChildrenSize() : 0, "element"), h.removeAllRanges(), Ye(b)) } } } return f && !f.is(d) && (fe(f) || fe(d)) && s.tableSelection && !s.tableSelection.is(d) ? (fe(f) && f.tableKey === s.tableNodeKey ? s.$updateTableTableSelection(f) : !fe(f) && fe(d) && d.tableKey === s.tableNodeKey && s.$updateTableTableSelection(null), !1) : (s.hasHijackedSelectionStyles && !n.isSelected() ? function (h, _) { _.$enableHighlightStyle(), Cu(_.table, C => { let y = C.elem; C.highlighted = !1, cm(h, C), y.getAttribute("style") || y.removeAttribute("style") }) }(t, s) : !s.hasHijackedSelectionStyles && n.isSelected() && jp(t, s), !1) }, vt)), s.listenersToRemove.add(t.registerCommand(Xn, () => { let f = k(); if (!v(f) || !f.isCollapsed() || !ln(f, n)) return !1; let d = Vp(t, f, n); return !!d && (Jp(d, n), !0) }, vt)), s } function lu(n) { return n[au] || null } function Oi(n) { let e = n; for (; e != null;) { let t = e.nodeName; if (t === "TD" || t === "TH") { let r = e._cell; return r === void 0 ? null : r } e = e.parentNode } return null } function Yp(n, e) { if (!n.contains(e)) return null; let t = null; for (let r = e; r != null; r = r.parentNode) { if (r === n) return t; let o = r.nodeName; o !== "TD" && o !== "TH" || (t = r._cell || null) } return null } function bo(n, e) { let t = [], r = { columns: 0, domRows: t, rows: 0 }, o = rr(n, e).querySelector("tr"), i = 0, s = 0; for (t.length = 0; o != null;) { let a = o.nodeName; if (a === "TD" || a === "TH") { let u = { elem: o, hasBackgroundColor: o.style.backgroundColor !== "", highlighted: !1, x: i, y: s }; o._cell = u; let p = t[s]; p === void 0 && (p = t[s] = []), p[i] = u } else { let u = o.firstChild; if (u != null) { o = u; continue } } let l = o.nextSibling; if (l != null) { i++, o = l; continue } let c = o.parentNode; if (c != null) { let u = c.nextSibling; if (u == null) break; s++, i = 0, o = u } } return r.columns = i + 1, r.rows = s + 1, r } function la(n, e, t) { let r = new Set(t ? t.getNodes() : []); Cu(e, (o, i) => { let s = o.elem; r.has(i) ? (o.highlighted = !0, lm(n, o)) : (o.highlighted = !1, cm(n, o), s.getAttribute("style") || s.removeAttribute("style")) }) } function Cu(n, e) { let { domRows: t } = n; for (let r = 0; r < t.length; r++) { let o = t[r]; if (o) for (let i = 0; i < o.length; i++) { let s = o[i]; if (!s) continue; let a = $e(s.elem); a !== null && e(s, a, { x: i, y: r }) } } } function jp(n, e) { e.$disableHighlightStyle(), Cu(e.table, t => { t.highlighted = !0, lm(n, t) }) } var T0 = (n, e, t, r, o) => { let i = o === "forward"; switch (o) { case "backward": case "forward": return t !== (i ? n.table.columns - 1 : 0) ? ua(e.getCellNodeFromCordsOrThrow(t + (i ? 1 : -1), r, n.table), i) : r !== (i ? n.table.rows - 1 : 0) ? ua(e.getCellNodeFromCordsOrThrow(i ? 0 : n.table.columns - 1, r + (i ? 1 : -1), n.table), i) : i ? e.selectNext() : e.selectPrevious(), !0; case "up": return r !== 0 ? ua(e.getCellNodeFromCordsOrThrow(t, r - 1, n.table), !1) : e.selectPrevious(), !0; case "down": return r !== n.table.rows - 1 ? ua(e.getCellNodeFromCordsOrThrow(t, r + 1, n.table), !0) : e.selectNext(), !0; default: return !1 } }; function tu(n, e) { let t, r; if (e.startColumn === n.minColumn) t = "minColumn"; else { if (e.startColumn + e.cell.__colSpan - 1 !== n.maxColumn) return null; t = "maxColumn" } if (e.startRow === n.minRow) r = "minRow"; else { if (e.startRow + e.cell.__rowSpan - 1 !== n.maxRow) return null; r = "maxRow" } return [t, r] } function ca([n, e]) { return [n === "minColumn" ? "maxColumn" : "minColumn", e === "minRow" ? "maxRow" : "minRow"] } function So(n, e, [t, r]) { let o = e[r], i = n[o]; i === void 0 && z(250, r, String(o)); let s = e[t], a = i[s]; return a === void 0 && z(250, t, String(s)), a } function E0(n, e, t, r, o) { let i = da(e, t, r), s = function (S, N) { let { minColumn: A, maxColumn: O, minRow: F, maxRow: L } = N, G = 1, U = 1, K = 1, W = 1, q = S[F], de = S[L]; for (let ae = A; ae <= O; ae++)G = Math.max(G, q[ae].cell.__rowSpan), W = Math.max(W, de[ae].cell.__rowSpan); for (let ae = F; ae <= L; ae++)U = Math.max(U, S[ae][A].cell.__colSpan), K = Math.max(K, S[ae][O].cell.__colSpan); return { bottomSpan: W, leftSpan: U, rightSpan: K, topSpan: G } }(e, i), { topSpan: a, leftSpan: l, bottomSpan: c, rightSpan: u } = s, p = function (S, N) { let A = tu(S, N); return A === null && z(249, N.cell.getKey()), A }(i, t), [g, f] = ca(p), d = i[g], m = i[f]; o === "forward" ? d += g === "maxColumn" ? 1 : l : o === "backward" ? d -= g === "minColumn" ? 1 : u : o === "down" ? m += f === "maxRow" ? 1 : a : o === "up" && (m -= f === "minRow" ? 1 : c); let h = e[m]; if (h === void 0) return !1; let _ = h[d]; if (_ === void 0) return !1; let [C, y] = function (S, N, A) { let O = da(S, N, A), F = tu(O, N); if (F) return [So(S, O, F), So(S, O, ca(F))]; let L = tu(O, A); if (L) return [So(S, O, ca(L)), So(S, O, L)]; let G = ["minColumn", "minRow"]; return [So(S, O, G), So(S, O, ca(G))] }(e, t, _), x = kr(n, C.cell), b = kr(n, y.cell); return n.$setAnchorCellForSelection(x), n.$setFocusCellForSelection(b, !0), !0 } function ln(n, e) { if (v(n) || fe(n)) { let t = e.isParentOf(n.anchor.getNode()), r = e.isParentOf(n.focus.getNode()); return t && r } return !1 } function ua(n, e) { e ? n.selectStart() : n.selectEnd() } function lm(n, e) { let t = e.elem, r = n._config.theme; j($e(t)) || z(131), pe(t, r.tableCellSelected) } function cm(n, e) { let t = e.elem; j($e(t)) || z(131); let r = n._config.theme; $t(t, r.tableCellSelected) } function Eo(n) { let e = Q(n, j); return j(e) ? e : null } function Rr(n) { let e = Q(n, Ee); return Ee(e) ? e : null } function b0(n, e, t, r, o, i, s) { let a = io(t.focus, o ? "previous" : "next"); if (Cs(a)) return !1; let l = a; for (let h of si(a).iterNodeCarets("shadowRoot")) { if (!ys(h) || !$(h.origin)) return !1; l = h } let c = l.getParentAtCaret(); if (!j(c)) return !1; let u = c, p = function (h) { for (let _ of si(h).iterNodeCarets("root")) { let { origin: C } = _; if (j(C)) { if (Yn(_)) return Wt(C, h.direction) } else if (!he(C)) break } return null }(yt(u, l.direction)), g = Q(u, Ee); if (!g || !g.is(i)) return !1; let f = n.getElementByKey(u.getKey()), d = Oi(f); if (!f || !d) return !1; let m = dm(n, g); if (s.table = m, p) if (r === "extend") { let h = Oi(n.getElementByKey(p.origin.getKey())); if (!h) return !1; s.$setAnchorCellForSelection(d), s.$setFocusCellForSelection(h, !0) } else { let h = Jn(p); Vn(t.anchor, h), Vn(t.focus, h) } else if (r === "extend") s.$setAnchorCellForSelection(d), s.$setFocusCellForSelection(d, !0); else { let h = function (_) { let C = Nr(_); return Yn(C) ? Jn(C) : _ }(yt(g, a.direction)); Vn(t.anchor, h), Vn(t.focus, h) } return Dn(e), !0 } function um(n, e, t, r, o) { if ((t === "up" || t === "down") && function (s) { let a = s.getRootElement(); return a ? a.hasAttribute("aria-controls") && a.getAttribute("aria-controls") === "typeahead-menu" : !1 }(n)) return !1; let i = k(); if (!ln(i, r)) { if (v(i)) { if (t === "backward") { if (i.focus.offset > 0) return !1; let s = function (l) { for (let c = l, u = l; u !== null; c = u, u = u.getParent())if ($(u)) { if (u !== c && u.getFirstChild() !== c) return null; if (!u.isInline()) return u } return null }(i.focus.getNode()); if (!s) return !1; let a = s.getPreviousSibling(); return !!Ee(a) && (Dn(e), e.shiftKey ? i.focus.set(a.getParentOrThrow().getKey(), a.getIndexWithinParent(), "element") : a.selectEnd(), !0) } if (e.shiftKey && (t === "up" || t === "down")) { let s = i.focus.getNode(); if (!i.isCollapsed() && (t === "up" && !i.isBackward() || t === "down" && i.isBackward())) { let a = Q(s, g => Ee(g)); if (j(a) && (a = Q(a, Ee)), a !== r || !a) return !1; let l = t === "down" ? a.getNextSibling() : a.getPreviousSibling(); if (!l) return !1; let c = 0; t === "up" && $(l) && (c = l.getChildrenSize()); let u = l; t === "up" && $(l) && (u = l.getLastChild() || l, c = Z(u) ? u.getTextContentSize() : 0); let p = i.clone(); return p.focus.set(u.getKey(), c, Z(u) ? "text" : "element"), Ye(p), Dn(e), !0 } if (tt(s)) { let a = t === "up" ? i.getNodes()[i.getNodes().length - 1] : i.getNodes()[0]; if (a && bi(r, a) !== null) { let l = r.getFirstDescendant(), c = r.getLastDescendant(); if (!l || !c) return !1; let [u] = Pe(l), [p] = Pe(c), g = r.getCordsFromCellNode(u, o.table), f = r.getCordsFromCellNode(p, o.table), d = r.getDOMCellFromCordsOrThrow(g.x, g.y, o.table), m = r.getDOMCellFromCordsOrThrow(f.x, f.y, o.table); return o.$setAnchorCellForSelection(d), o.$setFocusCellForSelection(m, !0), !0 } return !1 } { let a = Q(s, c => $(c) && !c.isInline()); if (j(a) && (a = Q(a, Ee)), !a) return !1; let l = t === "down" ? a.getNextSibling() : a.getPreviousSibling(); if (Ee(l) && o.tableNodeKey === l.getKey()) { let c = l.getFirstDescendant(), u = l.getLastDescendant(); if (!c || !u) return !1; let [p] = Pe(c), [g] = Pe(u), f = i.clone(); return f.focus.set((t === "up" ? p : g).getKey(), t === "up" ? 0 : g.getChildrenSize(), "element"), Dn(e), Ye(f), !0 } } } } return t === "down" && ha(n) && o.setShouldCheckSelection(), !1 } if (v(i)) { if (t === "backward" || t === "forward") return b0(n, e, i, e.shiftKey ? "extend" : "move", t === "backward", r, o); if (i.isCollapsed()) { let { anchor: s, focus: a } = i, l = Q(s.getNode(), j), c = Q(a.getNode(), j); if (!j(l) || !l.is(c)) return !1; let u = Rr(l); if (u !== r && u != null) { let _ = rr(u, n.getElementByKey(u.getKey())); if (_ != null) return o.table = bo(u, _), um(n, e, t, u, o) } let p = n.getElementByKey(l.__key), g = n.getElementByKey(s.key); if (g == null || p == null) return !1; let f; if (s.type === "element") f = g.getBoundingClientRect(); else { let _ = qn(_u(n)); if (_ === null || _.rangeCount === 0) return !1; f = _.getRangeAt(0).getBoundingClientRect() } let d = t === "up" ? l.getFirstChild() : l.getLastChild(); if (d == null) return !1; let m = n.getElementByKey(d.__key); if (m == null) return !1; let h = m.getBoundingClientRect(); if (t === "up" ? h.top > f.top - f.height : f.bottom + f.height > h.bottom) { Dn(e); let _ = r.getCordsFromCellNode(l, o.table); if (!e.shiftKey) return T0(o, r, _.x, _.y, t); { let C = r.getDOMCellFromCordsOrThrow(_.x, _.y, o.table); o.$setAnchorCellForSelection(C), o.$setFocusCellForSelection(C, !0) } return !0 } } } else if (fe(i)) { let { anchor: s, focus: a } = i, l = Q(s.getNode(), j), c = Q(a.getNode(), j), [u] = i.getNodes(); Ee(u) || z(251); let p = rr(u, n.getElementByKey(u.getKey())); if (!j(l) || !j(c) || !Ee(u) || p == null) return !1; o.$updateTableTableSelection(i); let g = bo(u, p), f = r.getCordsFromCellNode(l, g), d = r.getDOMCellFromCordsOrThrow(f.x, f.y, g); if (o.$setAnchorCellForSelection(d), Dn(e), e.shiftKey) { let [m, h, _] = Ze(r, l, c); return E0(o, m, h, _, t) } return c.selectEnd(), !0 } return !1 } function Dn(n) { n.preventDefault(), n.stopImmediatePropagation(), n.stopPropagation() } function Jp(n, e, t) { let r = oe(); n === "first" ? e.insertBefore(r) : e.insertAfter(r), r.append(...t || []), r.selectEnd() } function Vp(n, e, t) { let r = t.getParent(); if (!r) return; let o = qn(_u(n)); if (!o) return; let i = o.anchorNode, s = n.getElementByKey(r.getKey()), a = rr(t, n.getElementByKey(t.getKey())); if (!i || !s || !a || !s.contains(i) || a.contains(i)) return; let l = Q(e.anchor.getNode(), C => j(C)); if (!l) return; let c = Q(l, C => Ee(C)); if (!Ee(c) || !c.is(t)) return; let [u, p] = Ze(t, l, l), g = u[0][0], f = u[u.length - 1][u[0].length - 1], { startRow: d, startColumn: m } = p, h = d === g.startRow && m === g.startColumn, _ = d === f.startRow && m === f.startColumn; return h ? "first" : _ ? "last" : void 0 } function kr(n, e) { let { tableNode: t } = n.$lookup(), r = t.getCordsFromCellNode(e, n.table); return t.getDOMCellFromCordsOrThrow(r.x, r.y, n.table) } function cu(n, e, t) { return bi(n, $e(e, t)) } function Xp(n, e, t) { if (!e.theme.tableAlignment) return; let r = [], o = []; for (let i of ["center", "right"]) { let s = e.theme.tableAlignment[i]; s && (i === t ? o : r).push(s) } $t(n, ...r), pe(n, ...o) } var uu = new WeakSet; function ha(n = xn()) { return uu.has(n) } function A0(n, e) { e ? uu.add(n) : uu.delete(n) } var or = class n extends xt { static getType() { return "table" } getColWidths() { return this.getLatest().__colWidths } setColWidths(e) { let t = this.getWritable(); return t.__colWidths = e, t } static clone(e) { return new n(e.__key) } afterCloneFrom(e) { super.afterCloneFrom(e), this.__colWidths = e.__colWidths, this.__rowStriping = e.__rowStriping, this.__frozenColumnCount = e.__frozenColumnCount, this.__frozenRowCount = e.__frozenRowCount } static importDOM() { return { table: e => ({ conversion: O0, priority: 1 }) } } static importJSON(e) { return ma().updateFromJSON(e) } updateFromJSON(e) { return super.updateFromJSON(e).setRowStriping(e.rowStriping || !1).setFrozenColumns(e.frozenColumnCount || 0).setFrozenRows(e.frozenRowCount || 0).setColWidths(e.colWidths) } constructor(e) { super(e), this.__rowStriping = !1, this.__frozenColumnCount = 0, this.__frozenRowCount = 0 } exportJSON() { return { ...super.exportJSON(), colWidths: this.getColWidths(), frozenColumnCount: this.__frozenColumnCount ? this.__frozenColumnCount : void 0, frozenRowCount: this.__frozenRowCount ? this.__frozenRowCount : void 0, rowStriping: this.__rowStriping ? this.__rowStriping : void 0 } } extractWithChild(e, t, r) { return r === "html" } getDOMSlot(e) { let t = To(e) ? e : e.querySelector("table"); return To(t) || z(229), super.getDOMSlot(e).withElement(t).withAfter(t.querySelector("colgroup")) } createDOM(e, t) { let r = document.createElement("table"); this.__style && (r.style.cssText = this.__style); let o = document.createElement("colgroup"); if (r.appendChild(o), Mg(o), pe(r, e.theme.table), this.updateTableElement(null, r, e), ha(t)) { let i = document.createElement("div"), s = e.theme.tableScrollableWrapper; return s ? pe(i, s) : i.style.cssText = "overflow-x: auto;", i.appendChild(r), this.updateTableWrapper(null, i, r, e), i } return r } updateTableWrapper(e, t, r, o) { this.__frozenColumnCount !== (e ? e.__frozenColumnCount : 0) && function (i, s, a, l) { l > 0 ? (pe(i, a.theme.tableFrozenColumn), s.setAttribute("data-lexical-frozen-column", "true")) : ($t(i, a.theme.tableFrozenColumn), s.removeAttribute("data-lexical-frozen-column")) }(t, r, o, this.__frozenColumnCount), this.__frozenRowCount !== (e ? e.__frozenRowCount : 0) && function (i, s, a, l) { l > 0 ? (pe(i, a.theme.tableFrozenRow), s.setAttribute("data-lexical-frozen-row", "true")) : ($t(i, a.theme.tableFrozenRow), s.removeAttribute("data-lexical-frozen-row")) }(t, r, o, this.__frozenRowCount) } updateTableElement(e, t, r) { this.__style !== (e ? e.__style : "") && (t.style.cssText = this.__style), this.__rowStriping !== (!!e && e.__rowStriping) && function (o, i, s) { s ? (pe(o, i.theme.tableRowStriping), o.setAttribute("data-lexical-row-striping", "true")) : ($t(o, i.theme.tableRowStriping), o.removeAttribute("data-lexical-row-striping")) }(t, r, this.__rowStriping), function (o, i, s, a) { let l = o.querySelector("colgroup"); if (!l) return; let c = []; for (let u = 0; u < s; u++) { let p = document.createElement("col"), g = a && a[u]; g && (p.style.width = `${g}px`), c.push(p) } l.replaceChildren(...c) }(t, 0, this.getColumnCount(), this.getColWidths()), Xp(t, r, this.getFormatType()) } updateDOM(e, t, r) { let o = this.getDOMSlot(t).element; return t === o === ha() || (je(i = t) && i.nodeName === "DIV" && this.updateTableWrapper(e, t, o, r), this.updateTableElement(e, o, r), !1); var i } exportDOM(e) { let t = super.exportDOM(e), { element: r } = t; return { after: o => { if (t.after && (o = t.after(o)), !To(o) && je(o) && (o = o.querySelector("table")), !To(o)) return null; Xp(o, e._config, this.getFormatType()); let [i] = wn(this, null, null), s = new Map; for (let u of i) for (let p of u) { let g = p.cell.getKey(); s.has(g) || s.set(g, { colSpan: p.cell.getColSpan(), startColumn: p.startColumn }) } let a = new Set; for (let u of o.querySelectorAll(":scope > tr > [data-temporary-table-cell-lexical-key]")) { let p = u.getAttribute("data-temporary-table-cell-lexical-key"); if (p) { let g = s.get(p); if (u.removeAttribute("data-temporary-table-cell-lexical-key"), g) { s.delete(p); for (let f = 0; f < g.colSpan; f++)a.add(f + g.startColumn) } } } let l = o.querySelector(":scope > colgroup"); if (l) { let u = Array.from(o.querySelectorAll(":scope > colgroup > col")).filter((p, g) => a.has(g)); l.replaceChildren(...u) } let c = o.querySelectorAll(":scope > tr"); if (c.length > 0) { let u = document.createElement("tbody"); for (let p of c) u.appendChild(p); o.append(u) } return o }, element: !To(r) && je(r) ? r.querySelector("table") : r } } canBeEmpty() { return !1 } isShadowRoot() { return !0 } getCordsFromCellNode(e, t) { let { rows: r, domRows: o } = t; for (let i = 0; i < r; i++) { let s = o[i]; if (s != null) for (let a = 0; a < s.length; a++) { let l = s[a]; if (l == null) continue; let { elem: c } = l, u = cu(this, c); if (u !== null && e.is(u)) return { x: a, y: i } } } throw new Error("Cell not found in table.") } getDOMCellFromCords(e, t, r) { let { domRows: o } = r, i = o[t]; if (i == null) return null; let s = i[e < i.length ? e : i.length - 1]; return s ?? null } getDOMCellFromCordsOrThrow(e, t, r) { let o = this.getDOMCellFromCords(e, t, r); if (!o) throw new Error("Cell not found at cords."); return o } getCellNodeFromCords(e, t, r) { let o = this.getDOMCellFromCords(e, t, r); if (o == null) return null; let i = $e(o.elem); return j(i) ? i : null } getCellNodeFromCordsOrThrow(e, t, r) { let o = this.getCellNodeFromCords(e, t, r); if (!o) throw new Error("Node at cords not TableCellNode."); return o } getRowStriping() { return !!this.getLatest().__rowStriping } setRowStriping(e) { let t = this.getWritable(); return t.__rowStriping = e, t } setFrozenColumns(e) { let t = this.getWritable(); return t.__frozenColumnCount = e, t } getFrozenColumns() { return this.getLatest().__frozenColumnCount } setFrozenRows(e) { let t = this.getWritable(); return t.__frozenRowCount = e, t } getFrozenRows() { return this.getLatest().__frozenRowCount } canSelectBefore() { return !0 } canIndent() { return !1 } getColumnCount() { let e = this.getFirstChild(); if (!e) return 0; let t = 0; return e.getChildren().forEach(r => { j(r) && (t += r.getColSpan()) }), t } }; function dm(n, e) { let t = n.getElementByKey(e.getKey()); return t === null && z(230), bo(e, t) } function O0(n) { let e = ma(); n.hasAttribute("data-lexical-row-striping") && e.setRowStriping(!0); let t = n.querySelector(":scope > colgroup"); if (t) { let r = []; for (let o of t.querySelectorAll(":scope > col")) { let i = o.style.width || ""; if (!du.test(i) && (i = o.getAttribute("width") || "", !/^\d+$/.test(i))) { r = void 0; break } r.push(parseFloat(i)) } r && e.setColWidths(r) } return { after: r => hc(r, he), node: e } } function ma() { return Te(new or) } function Ee(n) { return n instanceof or } function v0({ rows: n, columns: e, includeHeaders: t }) { let r = k() || Sn(); if (!r || !v(r) || Rr(r.anchor.getNode())) return !1; let o = Zp(Number(n), Number(e), t); js(o); let i = o.getFirstDescendant(); return Z(i) && i.select(), !0 } function D0(n) { he(n.getParent()) ? n.isEmpty() && n.append(oe()) : n.remove() } function w0(n) { Ee(n.getParent()) ? pc(n, j) : n.remove() } function M0(n) { pc(n, he); let [e] = wn(n, null, null), t = e.reduce((o, i) => Math.max(o, i.length), 0), r = n.getChildren(); for (let o = 0; o < e.length; ++o) { let i = r[o]; if (!i) continue; he(i) || z(254, i.constructor.name, i.getType()); let s = e[o].reduce((a, l) => l ? 1 + a : a, 0); if (s !== t) for (let a = s; a < t; ++a) { let l = bt(); l.append(oe()), i.append(l) } } } function k0(n) { if (n.detail < 3 || !tn(n.target)) return !1; let e = $e(n.target); if (e === null) return !1; let t = Q(e, r => $(r) && !r.isInline()); return t === null ? !1 : !!j(t.getParent()) && (t.select(0), !0) } function R0(n) { return n.registerNodeTransform(nr, e => { if (e.getColSpan() > 1 || e.getRowSpan() > 1) { let [, , t] = Pe(e), [r] = Ze(t, e, e), o = r.length, i = r[0].length, s = t.getFirstChild(); he(s) || z(175); let a = []; for (let l = 0; l < o; l++) { l !== 0 && (s = s.getNextSibling(), he(s) || z(175)); let c = null; for (let u = 0; u < i; u++) { let p = r[l][u], g = p.cell; if (p.startRow === l && p.startColumn === u) c = g, a.push(g); else if (g.getColSpan() > 1 || g.getRowSpan() > 1) { j(g) || z(176); let f = bt(g.__headerState); c !== null ? c.insertAfter(f) : dh(s, f) } } } for (let l of a) l.setColSpan(1), l.setRowSpan(1) } }) } function F0(n, e = !0) { let t = new Map, r = (i, s, a) => { let l = rr(i, a), c = am(i, l, n, e); t.set(s, [c, l]) }, o = n.registerMutationListener(or, i => { n.getEditorState().read(() => { for (let [s, a] of i) { let l = t.get(s); if (a === "created" || a === "updated") { let { tableNode: c, tableElement: u } = mu(s); l === void 0 ? r(c, s, u) : u !== l[1] && (l[0].removeListeners(), t.delete(s), r(c, s, u)) } else a === "destroyed" && l !== void 0 && (l[0].removeListeners(), t.delete(s)) } }, { editor: n }) }, { skipInitialization: !1 }); return () => { o(); for (let [, [i]] of t) i.removeListeners() } } function L0(n) { return n.hasNodes([or]) || z(255), Mt(n.registerCommand(qp, v0, te), n.registerCommand(ui, ({ nodes: e, selection: t }) => v(t) ? Rr(t.anchor.getNode()) !== null && e.some(Ee) : !1, te), n.registerCommand(xs, k0, te), n.registerNodeTransform(or, M0), n.registerNodeTransform(Ao, w0), n.registerNodeTransform(nr, D0)) } var V = yu, Zb = V.$computeTableMap, Qb = V.$computeTableMapSkipCellCheck, eA = V.$createTableCellNode, tA = V.$createTableNode, nA = V.$createTableNodeWithDimensions, rA = V.$createTableRowNode, oA = V.$createTableSelection, iA = V.$createTableSelectionFrom, sA = V.$deleteTableColumn, aA = V.$deleteTableColumnAtSelection, lA = V.$deleteTableColumn__EXPERIMENTAL, cA = V.$deleteTableRowAtSelection, uA = V.$deleteTableRow__EXPERIMENTAL, dA = V.$findCellNode, fA = V.$findTableNode, gA = V.$getElementForTableNode, hA = V.$getNodeTriplet, pA = V.$getTableAndElementByKey, mA = V.$getTableCellNodeFromLexicalNode, _A = V.$getTableCellNodeRect, CA = V.$getTableColumnIndexFromTableCellNode, yA = V.$getTableNodeFromLexicalNodeOrThrow, NA = V.$getTableRowIndexFromTableCellNode, xA = V.$getTableRowNodeFromTableCellNodeOrThrow, SA = V.$insertTableColumn, TA = V.$insertTableColumnAtSelection, EA = V.$insertTableColumn__EXPERIMENTAL, bA = V.$insertTableRow, AA = V.$insertTableRowAtSelection, OA = V.$insertTableRow__EXPERIMENTAL, vA = V.$isScrollableTablesActive, DA = V.$isTableCellNode, wA = V.$isTableNode, MA = V.$isTableRowNode, _a = V.$isTableSelection, kA = V.$mergeCells, RA = V.$removeTableRowAtIndex, FA = V.$unmergeCell, LA = V.INSERT_TABLE_COMMAND, $A = V.TableCellHeaderStates, IA = V.TableCellNode, PA = V.TableNode, BA = V.TableObserver, KA = V.TableRowNode, HA = V.applyTableHandlers, zA = V.getDOMCellFromTarget, UA = V.getTableElement, WA = V.getTableObserverFromTableElement, GA = V.registerTableCellUnmergeTransform, YA = V.registerTablePlugin, jA = V.registerTableSelectionObserver, JA = V.setScrollableTablesActive; var vo = 8, Do = 72, Oo = 15; var fm = { bullet: "Bulleted List", check: "Check List", code: "Code Block", h1: "Heading 1", h2: "Heading 2", h3: "Heading 3", h4: "Heading 4", h5: "Heading 5", h6: "Heading 6", number: "Numbered List", paragraph: "Normal", quote: "Quote" }, gm = { none: !1, bgColor: "#fff", blockType: "paragraph", canRedo: !1, canUndo: !1, cannotRedo: !0, cannotUndo: !0, codeLanguage: "", elementFormat: "left", fontColor: "#000", fontFamily: "Arial", fontSize: `${Oo}px`, fontSizeInputValue: `${Oo}`, isBold: !1, isCode: !1, isImageCaption: !1, isItalic: !1, isLink: !1, isRTL: !1, isStrikethrough: !1, isSubscript: !1, isSuperscript: !1, isUnderline: !1, isLowercase: !1, isUppercase: !1, isCapitalize: !1, rootType: "root" }; var hm = { autocomplete: "lexical__autocomplete", blockCursor: "lexical__blockCursor", characterLimit: "lexical__characterLimit", code: "lexical__code", codeHighlight: { atrule: "lexical__tokenAttr", attr: "lexical__tokenAttr", boolean: "lexical__tokenProperty", builtin: "lexical__tokenSelector", cdata: "lexical__tokenComment", char: "lexical__tokenSelector", class: "lexical__tokenFunction", "class-name": "lexical__tokenFunction", comment: "lexical__tokenComment", constant: "lexical__tokenProperty", deleted: "lexical__tokenProperty", doctype: "lexical__tokenComment", entity: "lexical__tokenOperator", function: "lexical__tokenFunction", important: "lexical__tokenVariable", inserted: "lexical__tokenSelector", keyword: "lexical__tokenAttr", namespace: "lexical__tokenVariable", number: "lexical__tokenProperty", operator: "lexical__tokenOperator", prolog: "lexical__tokenComment", property: "lexical__tokenProperty", punctuation: "lexical__tokenPunctuation", regex: "lexical__tokenVariable", selector: "lexical__tokenSelector", string: "lexical__tokenSelector", symbol: "lexical__tokenProperty", tag: "lexical__tokenProperty", url: "lexical__tokenOperator", variable: "lexical__tokenVariable" }, embedBlock: { base: "lexical__embedBlock", focus: "lexical__embedBlockFocus" }, hashtag: "lexical__hashtag", heading: { h1: "lexical__h1", h2: "lexical__h2", h3: "lexical__h3", h4: "lexical__h4", h5: "lexical__h5", h6: "lexical__h6" }, hr: "lexical__hr", image: "lexical__editor-image", indent: "lexical__indent", inlineImage: "lexical__inline-editor-image", layoutContainer: "lexical__layoutContainer", layoutItem: "lexical__layoutItem", link: "lexical__link", list: { checklist: "lexical__checklist", listitem: "lexical__listItem", listitemChecked: "lexical__listItemChecked", listitemUnchecked: "lexical__listItemUnchecked", nested: { listitem: "lexical__nestedListItem" }, olDepth: ["lexical__ol1", "lexical__ol2", "lexical__ol3", "lexical__ol4", "lexical__ol5"], ul: "lexical__ul" }, ltr: "lexical__ltr", mark: "lexical__mark", markOverlap: "lexical__markOverlap", paragraph: "lexical__paragraph", quote: "lexical__quote", rtl: "lexical__rtl", table: "lexical__table", tableAddColumns: "lexical__tableAddColumns", tableAddRows: "lexical__tableAddRows", tableCell: "lexical__tableCell", tableCellActionButton: "lexical__tableCellActionButton", tableCellActionButtonContainer: "lexical__tableCellActionButtonContainer", tableCellEditing: "lexical__tableCellEditing", tableCellHeader: "lexical__tableCellHeader", tableCellPrimarySelected: "lexical__tableCellPrimarySelected", tableCellResizer: "lexical__tableCellResizer", tableCellSelected: "lexical__tableCellSelected", tableCellSortedIndicator: "lexical__tableCellSortedIndicator", tableResizeRuler: "lexical__tableCellResizeRuler", tableSelected: "lexical__tableSelected", tableSelection: "lexical__tableSelection", text: { bold: "lexical__textBold", code: "lexical__textCode", italic: "lexical__textItalic", strikethrough: "lexical__textStrikethrough", subscript: "lexical__textSubscript", superscript: "lexical__textSuperscript", underline: "lexical__textUnderline", underlineStrikethrough: "lexical__textUnderlineStrikethrough", lowercase: "lexical__textLowercase", uppercase: "lexical__textUppercase", capitalize: "lexical__textCapitalize" } }, pm = (n, e) => { if (!e) return n; let t = n; switch (e) { case 2: switch (!0) { case n > Do: t = Do; break; case n >= 48: t -= 12; break; case n >= 24: t -= 4; break; case n >= 14: t -= 2; break; case n >= 9: t -= 1; break; default: t = vo; break }break; case 1: switch (!0) { case n < vo: t = vo; break; case n < 12: t += 1; break; case n < 20: t += 2; break; case n < 36: t += 4; break; case n <= 60: t += 12; break; default: t = Do; break }break; default: break }return t }, Nu = (n, e, t) => { let r = o => (o || (o = `${Oo}px`), o = o.slice(0, -2), `${pm(Number(o), t)}px`); n.update(() => { if (n.isEditable()) { let o = k(); o !== null && fo(o, { "font-size": e || r }) } }) }, wo = (n, e, t) => { let r = t.value; if (r !== "") { let o = pm(Number(r), e); Nu(n, String(o) + "px", null), t.value = o.toString() } else Nu(n, null, e) }, xu = function (n, e, t) { if (e == null) return; let r = e; e > Do ? (r = Do, t.value = r.toString()) : e < vo && (r = vo, t.value = r.toString()), r != null && Nu(n, String(r) + "px", null) }, Mo = n => { n.update(() => { let e = k(); v(e) && Zn(e, () => oe()) }) }, mm = (n, e, t) => { e !== t && n.update(() => { let r = k(); Zn(r, () => qs(t)) }) }, _m = (n, e) => { e !== "bullet" ? n.dispatchCommand(ia, void 0) : Mo(n) }, Cm = (n, e) => { e !== "check" ? n.dispatchCommand(Dp, void 0) : Mo(n) }, ym = (n, e) => { e !== "number" ? n.dispatchCommand(oa, void 0) : Mo(n) }, Ca = (n, e) => { e !== "quote" && n.update(() => { let t = k(); Zn(t, () => Mh()) }) }, ya = (n, e) => { e !== "code" && n.update(() => { let t = k(); if (t !== null) if (t.isCollapsed()) Zn(t, () => Pc()); else { let r = t.getTextContent(), o = Pc(); t.insertNodes([o]), t = k(), v(t) && t.insertRawText(r) } }) }, vi = function (n) { let e = n.anchor, t = n.focus, r = n.anchor.getNode(), o = n.focus.getNode(); return r === o ? r : n.isBackward() ? sc(t) ? r : o : sc(e) ? o : r }, Na = n => { Mo(n), n.update(() => { let e = k(); if (v(e) || _a(e)) { let t = e.anchor, r = e.focus, o = e.getNodes(), i = e.extract(); if (t.key === r.key && t.offset === r.offset) return; o.forEach((s, a) => { if (Z(s)) { let l = s; a === 0 && t.offset !== 0 && (l = l.splitText(t.offset)[1] || l), a === o.length - 1 && (l = l.splitText(r.offset)[0] || l); let c = i[0]; o.length === 1 && Z(c) && (l = c), l.__style !== "" && l.setStyle(""), l.__format !== 0 && (l.setFormat(0), Gs(l).setFormat("")), s = l } else Zs(s) || kh(s) ? s.replace(oe(), !0) : on(s) && s.replace(st(s.getTextContent()), !1) }) } }) }; function xm(n) { return n.registerCommand(tr, e => { let t = k(); if (!v(t)) return !1; let r = n.getElementByKey(Ge().getKey()), o = vi(t), i = o.getParent(); return on(i) || on(o) ? (Hc(e == null ? null : $0(e), { rel: "noopener noreferrer", target: "_blank" }), e == null && r.dispatchEvent(new CustomEvent("close-link-editor-dialog"))) : (Hc("https://", { rel: "noopener noreferrer", target: "_blank" }), n.read(() => { let s = k(); if (v(s)) { let l = vi(s).getKey(), c = n.getElementByKey(l); c != null && r.dispatchEvent(new CustomEvent("link-created", { detail: { url: "https://", target: c } })) } })), !0 }, De), n.registerRootListener((e, t) => { t !== null && (t.removeEventListener("click", Su), t.removeEventListener("mouseup", Nm)), e !== null && (e.addEventListener("click", Su), e.addEventListener("mouseup", Nm)) }) } var $0 = function (n) { try { let e = new URL(n); if (!I0.has(e.protocol)) return "about:blank" } catch { return n } return n }, I0 = new Set(["http:", "https:", "mailto:", "sms:", "tel:"]), _O = new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/); var Su = n => { let e = n.target; if (!tn(e)) return; let t = Ps(e); if (t === null) return; let r = null, o = null; if (t.update(() => { let s = $e(e); if (s !== null) { let a = Q(s, $); if (on(a)) r = a.sanitizeUrl(a.getURL()), o = a.getTarget(); else { let l = P0(e, Bs); l !== null && (r = l.href, o = l.target) } } }), r === null || r === "") return; let i = t.getEditorState().read(k); if (v(i) && !i.isCollapsed()) { n.preventDefault(); return } e !== null && t.read(() => { t.getElementByKey(Ge().getKey()).dispatchEvent(new CustomEvent("link-clicked", { detail: { url: r, target: e } })) }) }, Nm = n => { n.button === 1 && Su(n) }, P0 = function (n, e) { let t = n; for (; t != null;) { if (e(t)) return t; t = t.parentNode } return null }; var cn = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u"; var B0 = cn && "documentMode" in document ? document.documentMode : null, ce = cn && /Mac|iPod|iPhone|iPad/.test(navigator.platform), xO = cn && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), SO = cn && "InputEvent" in window && !B0 ? "getTargetRanges" in new window.InputEvent("input") : !1, TO = cn && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), EO = cn && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, bO = cn && /Android/.test(navigator.userAgent), K0 = cn && /^(?=.*Chrome).*/i.test(navigator.userAgent); var AO = cn && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !K0; var DO = Object.freeze({ NORMAL: ce ? "\u2318+Opt+0" : "Ctrl+Alt+0", HEADING1: ce ? "\u2318+Opt+1" : "Ctrl+Alt+1", HEADING2: ce ? "\u2318+Opt+2" : "Ctrl+Alt+2", HEADING3: ce ? "\u2318+Opt+3" : "Ctrl+Alt+3", BULLET_LIST: ce ? "\u2318+Opt+4" : "Ctrl+Alt+4", NUMBERED_LIST: ce ? "\u2318+Opt+5" : "Ctrl+Alt+5", CHECK_LIST: ce ? "\u2318+Opt+6" : "Ctrl+Alt+6", CODE_BLOCK: ce ? "\u2318+Opt+C" : "Ctrl+Alt+C", QUOTE: ce ? "\u2318+Opt+Q" : "Ctrl+Alt+Q", INCREASE_FONT_SIZE: ce ? "\u2318+Shift+." : "Ctrl+Shift+.", DECREASE_FONT_SIZE: ce ? "\u2318+Shift+," : "Ctrl+Shift+,", INSERT_CODE_BLOCK: ce ? "\u2318+Shift+C" : "Ctrl+Shift+C", STRIKETHROUGH: ce ? "\u2318+Shift+S" : "Ctrl+Shift+S", LOWERCASE: ce ? "\u2318+Shift+1" : "Ctrl+Shift+1", UPPERCASE: ce ? "\u2318+Shift+2" : "Ctrl+Shift+2", CAPITALIZE: ce ? "\u2318+Shift+3" : "Ctrl+Shift+3", CENTER_ALIGN: ce ? "\u2318+Shift+E" : "Ctrl+Shift+E", JUSTIFY_ALIGN: ce ? "\u2318+Shift+J" : "Ctrl+Shift+J", LEFT_ALIGN: ce ? "\u2318+Shift+L" : "Ctrl+Shift+L", RIGHT_ALIGN: ce ? "\u2318+Shift+R" : "Ctrl+Shift+R", SUBSCRIPT: ce ? "\u2318+," : "Ctrl+,", SUPERSCRIPT: ce ? "\u2318+." : "Ctrl+.", INDENT: ce ? "\u2318+]" : "Ctrl+]", OUTDENT: ce ? "\u2318+[" : "Ctrl+[", CLEAR_FORMATTING: ce ? "\u2318+\\" : "Ctrl+\\", REDO: ce ? "\u2318+Shift+Z" : "Ctrl+Y", UNDO: ce ? "\u2318+Z" : "Ctrl+Z", BOLD: ce ? "\u2318+B" : "Ctrl+B", ITALIC: ce ? "\u2318+I" : "Ctrl+I", UNDERLINE: ce ? "\u2318+U" : "Ctrl+U", INSERT_LINK: ce ? "\u2318+K" : "Ctrl+K" }); function xe(n, e) { return ce ? n : e } function Sm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return (e === "Numpad0" || e === "Digit0") && !t && r && xe(o, i) } function Tm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n, s = e[e.length - 1]; return ["1", "2", "3", "4", "5", "6"].includes(s) && !t && r && xe(o, i) } function Em(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return (e === "Numpad7" || e === "Digit7") && !t && r && xe(o, i) } function bm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return (e === "Numpad8" || e === "Digit8") && !t && r && xe(o, i) } function Am(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return (e === "Numpad6" || e === "Digit6") && !t && r && xe(o, i) } function Om(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "KeyC" && !t && r && xe(o, i) } function vm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "KeyQ" && !t && r && xe(o, i) } function Dm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return (e === "Numpad1" || e === "Digit1") && t && !r && xe(o, i) } function wm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return (e === "Numpad2" || e === "Digit2") && t && !r && xe(o, i) } function Mm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return (e === "Numpad3" || e === "Digit3") && t && !r && xe(o, i) } function km(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "KeyS" && t && !r && xe(o, i) } function Rm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "BracketRight" && !t && !r && xe(o, i) } function Fm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "BracketLeft" && !t && !r && xe(o, i) } function Lm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "KeyE" && t && !r && xe(o, i) } function $m(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "KeyL" && t && !r && xe(o, i) } function Im(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "KeyR" && t && !r && xe(o, i) } function Pm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "KeyJ" && t && !r && xe(o, i) } function Bm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "BracketLeft" && t && !r && xe(o, i) } function Km(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "BracketRight" && t && !r && xe(o, i) } function Hm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "Comma" && !t && !r && xe(o, i) } function zm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "Period" && !t && !r && xe(o, i) } function Um(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "KeyC" && t && !r && xe(o, i) } function Wm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "Period" && t && !r && xe(o, i) } function Gm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "Comma" && t && !r && xe(o, i) } function Ym(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "Slash" && !t && !r && xe(o, i) } function jm(n) { let { code: e, shiftKey: t, altKey: r, metaKey: o, ctrlKey: i } = n; return e === "KeyK" && !t && !r && xe(o, i) } function Jm(n) { let e = t => { let r = t; if (Sm(r)) r.preventDefault(), Mo(n); else if (Tm(r)) { r.preventDefault(); let { code: o } = r, i = `h${o[o.length - 1]}`; mm(n, null, i) } else if (Em(r)) r.preventDefault(), _m(n, null); else if (bm(r)) r.preventDefault(), ym(n, null); else if (Am(r)) r.preventDefault(), Cm(n, null); else if (Om(r)) r.preventDefault(), ya(n, null); else if (vm(r)) r.preventDefault(), Ca(n, null); else if (km(r)) r.preventDefault(), n.dispatchCommand(lt, "strikethrough"); else if (Dm(r)) r.preventDefault(), n.dispatchCommand(lt, "lowercase"); else if (wm(r)) r.preventDefault(), n.dispatchCommand(lt, "uppercase"); else if (Mm(r)) r.preventDefault(), n.dispatchCommand(lt, "capitalize"); else if (Rm(r)) r.preventDefault(), n.dispatchCommand(wt, void 0); else if (Fm(r)) r.preventDefault(), n.dispatchCommand(Lt, void 0); else if (Lm(r)) r.preventDefault(), n.dispatchCommand(Dt, "center"); else if ($m(r)) r.preventDefault(), n.dispatchCommand(Dt, "left"); else if (Im(r)) r.preventDefault(), n.dispatchCommand(Dt, "right"); else if (Pm(r)) r.preventDefault(), n.dispatchCommand(Dt, "justify"); else if (Bm(r)) r.preventDefault(), n.dispatchCommand(Dt, "start"); else if (Km(r)) r.preventDefault(), n.dispatchCommand(Dt, "end"); else if (Hm(r)) r.preventDefault(), n.dispatchCommand(lt, "subscript"); else if (zm(r)) r.preventDefault(), n.dispatchCommand(lt, "superscript"); else if (Um(r)) r.preventDefault(), n.dispatchCommand(lt, "code"); else if (Wm(r)) { r.preventDefault(); let i = r.target.closest(".editor-shell").querySelector('[x-ref="fontSize"]'); wo(n, 1, i) } else if (Gm(r)) { r.preventDefault(); let i = r.target.closest(".editor-shell").querySelector('[x-ref="fontSize"]'); wo(n, 2, i) } else Ym(r) ? (r.preventDefault(), Na(n)) : jm(r) && (r.preventDefault(), n.dispatchCommand(tr, null)); return !1 }; return n.registerCommand(Ng, e, fg) } var ko = class n extends Os { static getType() { return "image" } static clone(e) { return new n(e.__src, e.__altText, e.__maxWidth, e.__width, e.__height, e.__showCaption, e.__caption, e.__captionsEnabled, e.__key) } static importJSON(e) { let { altText: t, height: r, width: o, maxWidth: i, caption: s, src: a, showCaption: l } = e, c = Tu({ altText: t, height: r, maxWidth: i, showCaption: l, src: a, width: o }), u = c.__caption, p = u.parseEditorState(s.editorState); return p.isEmpty() || u.setEditorState(p), c } exportDOM() { let e = document.createElement("img"); return e.setAttribute("src", this.__src), e.setAttribute("alt", this.__altText), e.setAttribute("width", this.__width.toString()), e.setAttribute("height", this.__height.toString()), { element: e } } static importDOM() { return { img: e => ({ conversion: z0, priority: 0 }) } } constructor(e, t, r, o, i, s, a, l, c) { super(c), this.__src = e, this.__altText = t, this.__maxWidth = r, this.__width = o || "inherit", this.__height = i || "inherit", this.__showCaption = s || !1, this.__caption = a || Is(), this.__captionsEnabled = l || l === void 0 } exportJSON() { return { altText: this.getAltText(), caption: this.__caption.toJSON(), height: this.__height === "inherit" ? 0 : this.__height, maxWidth: this.__maxWidth, showCaption: this.__showCaption, src: this.getSrc(), type: "image", version: 1, width: this.__width === "inherit" ? 0 : this.__width } } setWidthAndHeight(e, t) { let r = this.getWritable(); r.__width = e, r.__height = t } setAltText(e) { let t = this.getWritable(); t.__altText = e } createDOM(e) { let t = document.createElement("span"), o = e.theme.image; o !== void 0 && (t.className = o), t.classList.add("relative"), t.classList.add("image-span"); let i = document.createElement("img"); i.setAttribute("src", this.__src), i.setAttribute("alt", this.__altText), i.style.width = this.__width === "inherit" || this.__width == 0 ? void 0 : this.__width + "px", i.style.height = this.__height === "inherit" || this.__height == 0 ? void 0 : this.__height + "px"; let s = "focused"; i.onclick = () => { i.classList.toggle(s) }, i?.setAttribute("x-on:click.outside", '$el.classList.remove("' + s + '")'), t.appendChild(i); let a = document.createElement("button"); a.type = "button", a.style.width = "2rem", a.style.height = "2rem", a.className = "image-editor-button bg-gray-200 rounded-full", a.style.top = "0", a.style.right = "0", a.style.position = "absolute"; let l = document.createElement("i"); return l.className = "edit", l.style.width = "1.5rem", l.style.height = "1.5rem", l.style.display = "block", l.style.margin = "auto", a.appendChild(l), a.setAttribute("x-on:click", "openImageEditor('" + this.__key + "')"), t.appendChild(a), t } updateDOM(e, t, r) { let o = t.querySelector("img"); return o.style.width = this.__width === "inherit" || this.__width == 0 ? void 0 : this.__width + "px", o.style.height = this.__height === "inherit" || this.__height == 0 ? void 0 : this.__height + "px", o.setAttribute("alt", this.__altText), !0 } getSrc() { return this.__src } getAltText() { return this.__altText } getWidth() { return this.__width === "inherit" ? 0 : this.__width } getHeight() { return this.__height === "inherit" ? 0 : this.__height } decorate() { return null } }; function z0(n) { let e = n; if (e.src.startsWith("file:///")) return null; let { alt: t, src: r, width: o, height: i } = e; return { node: Tu({ altText: t, height: i, src: r, width: o }) } } function Tu({ altText: n, height: e, maxWidth: t = 500, captionsEnabled: r, src: o, width: i, showCaption: s, caption: a, key: l }) { return Te(new ko(o, n, t, i, e, s, a, r, l)) } function xa(n) { return n instanceof ko } var Vm = n => n.registerCommand(Eu, e => { let t = Tu(e); return Gn([t]), !0 }, te), Eu = ct("INSERT_IMAGE_COMMAND"); var Lr = class n extends St { constructor(e, t) { super(e, t) } static getType() { return "extended-text" } static clone(e) { return new n(e.__text, e.__key) } static importDOM() { let e = St.importDOM(); return { ...e, code: () => ({ conversion: Ro(e?.code), priority: 1 }), em: () => ({ conversion: Ro(e?.em), priority: 1 }), span: () => ({ conversion: Ro(e?.span), priority: 1 }), strong: () => ({ conversion: Ro(e?.strong), priority: 1 }), sub: () => ({ conversion: Ro(e?.sub), priority: 1 }), sup: () => ({ conversion: Ro(e?.sup), priority: 1 }) } } static importJSON(e) { return U0().updateFromJSON(e) } isSimpleText() { return this.__type === "extended-text" && this.__mode === 0 } }; function U0(n = "") { return Te(new Lr(n)) } function Ro(n) { return e => { let t = n?.(e); if (!t) return null; let r = t.conversion(e); if (!r) return r; let o = e.style.backgroundColor, i = e.style.color, s = e.style.fontFamily, a = e.style.fontWeight, l = e.style.fontSize, c = e.style.textDecoration; return { ...r, forChild: (u, p) => { let f = (r?.forChild ?? (d => d))(u, p); if (Z(f)) { let d = [o ? `background-color: ${o}` : null, i ? `color: ${i}` : null, s ? `font-family: ${s}` : null, a ? `font-weight: ${a}` : null, l ? `font-size: ${l}` : null, c ? `text-decoration: ${c}` : null].filter(m => m != null).join("; "); if (d.length) return f.setStyle(d) } return f } } } } var Xm = 1; function W0({ basicColors: n = ["#d0021b", "#f5a623", "#f8e71c", "#8b572a", "#7ed321", "#417505", "#bd10e0", "#9013fe", "#4a90e2", "#50e3c2", "#b8e986", "#000000", "#4a4a4a", "#9b9b9b", "#000000"], state: e, enabledToolbars: t = ["undo", "redo", "normal", "h1", "h2", "h3", "h4", "h5", "h6", "bullet", "numbered", "quote", "code", "fontSize", "bold", "italic", "underline", "icode", "link", "textColor", "backgroundColor", "lowercase", "uppercase", "capitalize", "strikethrough", "subscript", "superscript", "clear", "left", "center", "right", "justify", "start", "end", "indent", "outdent"] }) { return { state: e, basicColors: n, toolbarState: structuredClone(gm), showLinkEditor: !1, linkEditMode: !1, linkEditorAnchor: null, linkEditorUrl: null, editor: null, enabledToolbars: t, init: function () { let r = this.$refs.editor, o = { namespace: "lexical-editor", nodes: [Lr, { replace: St, with: i => new Lr(i.__text), withKlass: Lr }, ap, wp, rp, Rh, lp, jc, Fh, vc, Ei, ko], onError: console.error, theme: hm }; this.editor = Is(o), this.editor.setRootElement(r), aa.init(), Mt(Lh(this.editor), Mp(this.editor), $p(this.editor, Lp(), 300), xm(this.editor), Jm(this.editor), zp(this.editor), Vm(this.editor), ...Bp(this.editor, Hp, vc, Kp)), this.editor.registerCommand(Tr, i => (this.updateToolbarState("canUndo", i), this.updateToolbarState("cannotUndo", !i), !1), Xm), this.editor.registerCommand(Sr, i => (this.updateToolbarState("canRedo", i), this.updateToolbarState("cannotRedo", !i), !1), Xm), this.editor.registerUpdateListener(({ editorState: i }) => { i.read(() => { this.state = Js(this.editor), this.updateToolbar() }) }), this.state && this.editor.update(() => { let s = new DOMParser().parseFromString(this.state, "text/html"), a = Vs(this.editor, s); Ge().select(), Gn(a) }), this.registerToolbarActions() }, updateLink: function () { this.editor?.dispatchCommand(tr, this.linkEditorUrl), this.linkEditMode = !1 }, handleImage: function () { let r = this.$refs.image_input.files, o = this.$refs.image_alt.value, i = new FileReader, s = this; i.onload = function () { if (typeof i.result == "string") { let a = { altText: o, src: i.result }; s.insertImage(a) } return "" }, r !== null && i.readAsDataURL(r[0]) }, insertImage(r) { this.editor?.dispatchCommand(Eu, r) }, openImageEditor: function (r) { this.editor.read(() => { let o = at(r); if (xa(o)) { let i = this.$refs.imageEditorModal, s = i?.getAttribute("modal-id"); if (s) { let a = i.querySelector("[x-ref='image_editor_key']"), l = i.querySelector("[x-ref='image_editor_alt']"), c = i.querySelector("[x-ref='image_editor_width']"), u = i.querySelector("[x-ref='image_editor_height']"); a.value = r, l.value = o.getAltText(), c.value = o.getWidth().toString(), u.value = o.getHeight().toString(), this.$dispatch("open-modal", { id: s }) } } }) }, deleteImage: function (r) { let o = this.$refs.image_editor_key.value; this.editor.update(() => { let i = at(o); xa(i) && i.remove() }) }, updateImage: function () { let r = this.$refs.image_editor_key.value; this.editor.update(() => { let o = at(r); xa(o) && (o.setAltText(this.$refs.image_editor_alt.value), o.setWidthAndHeight(Number(this.$refs.image_editor_width.value), Number(this.$refs.image_editor_height.value))) }) }, removeLink: function () { this.editor?.dispatchCommand(tr, null), this.closeLinkEditorDialog() }, showLinkEditorDialog: function (r, o = null, i = !0) { this.$nextTick(() => { this.linkEditorAnchor = r, this.linkEditMode = i, this.linkEditorUrl = o, this.showLinkEditor = !0 }) }, closeLinkEditorDialog: function () { this.$nextTick(() => { this.linkEditorAnchor = null, this.linkEditorUrl = null, this.showLinkEditor = !1 }) }, formatHeading: function (r) { this.editor?.update(() => { let o = k(); Zn(o, () => qs(r)) }) }, formatAlignment: function (r) { this.editor?.dispatchCommand(Dt, r) }, formatFontFamily: function (r) { this.editor.update(() => { let o = k(); o !== null && fo(o, { "font-family": r }) }) }, formatText: function (r) { this.editor?.dispatchCommand(lt, r) }, formatParagraph: function () { this.editor?.update(() => { let r = k(); v(r) && Zn(r, () => oe()) }) }, formatBulletList: function () { this.editor?.dispatchCommand(ia, void 0) }, formatNumberedList: function () { this.editor?.dispatchCommand(oa, void 0) }, formatLineCode: function () { this.editor?.dispatchCommand(lt, "code") }, insetLink: function () { this.editor?.dispatchCommand(tr, null) }, insetHR: function () { this.editor?.dispatchCommand(Qc, void 0) }, getToolbarActions: function () { return { bold: () => this.formatText("bold"), strikethrough: () => this.formatText("strikethrough"), subscript: () => this.formatText("subscript"), lowercase: () => this.formatText("lowercase"), uppercase: () => this.formatText("uppercase"), capitalize: () => this.formatText("capitalize"), superscript: () => this.formatText("superscript"), italic: () => this.formatText("italic"), underline: () => this.formatText("underline"), link: r => { r.stopPropagation(), this.insetLink() }, h1: () => this.formatHeading("h1"), h2: () => this.formatHeading("h2"), h3: () => this.formatHeading("h3"), h4: () => this.formatHeading("h4"), h5: () => this.formatHeading("h5"), h6: () => this.formatHeading("h6"), normal: () => this.formatParagraph(), bullet: () => this.formatBulletList(), numbered: () => this.formatNumberedList(), quote: () => Ca(this.editor, null), code: () => ya(this.editor, null), decrement: () => wo(this.editor, 2, this.$refs.fontSize), increment: () => wo(this.editor, 1, this.$refs.fontSize), icode: () => this.formatLineCode(), fontSizeChange: () => xu(this.editor, Number(this.$refs.fontSize.value), this.$refs.fontSize), fontSizeKeydown: r => { r.key === "Enter" && (r.stopPropagation(), r.preventDefault(), xu(this.editor, Number(this.$refs.fontSize.value), this.$refs.fontSize)) }, undo: () => this.editor?.dispatchCommand($s, void 0), redo: () => this.editor?.dispatchCommand(Ls, void 0), left: () => this.formatAlignment("left"), right: () => this.formatAlignment("right"), center: () => this.formatAlignment("center"), justify: () => this.formatAlignment("justify"), start: () => this.formatAlignment("start"), end: () => this.formatAlignment("end"), indent: () => this.editor?.dispatchCommand(wt, void 0), outdent: () => this.editor?.dispatchCommand(Lt, void 0), clear: () => Na(this.editor), textColor: () => { this.$refs.text_color_input.click(), aa({ swatches: this.basicColors, alpha: !1, formatToggle: !0 }) }, textColorChange: r => { let i = r.target.value; this.editor?.update(() => { let s = k(); v(s) && fo(s, { color: i }) }) }, backgroundColor: () => { this.$refs.background_color_input.click(), aa({ swatches: this.basicColors, alpha: !1, formatToggle: !0 }) }, backgroundColorChange: r => { let i = r.target.value; this.editor?.update(() => { let s = k(); v(s) && fo(s, { "background-color": i }) }) }, fontFamily: r => { this.formatFontFamily(r) }, hr: () => this.insetHR(), image: () => { this.$refs.image.addEventListener("click", () => { let r = this.$refs.imageModal?.getAttribute("modal-id"); r && this.$dispatch("open-modal", { id: r }) }) } } }, registerToolbarActions() { let r = this.getToolbarActions(); this.enabledToolbars.forEach(o => { if (o === "backgroundColor") this.$refs.background_color.addEventListener("click", () => { r.backgroundColor() }), this.$refs.background_color_input.addEventListener("change", i => { r.backgroundColorChange(i) }); else if (o === "textColor") this.$refs.text_color.addEventListener("click", () => { r.textColor() }), this.$refs.text_color_input.addEventListener("change", i => { r.textColorChange(i) }); else if (o === "link") this.$refs.link.addEventListener("click", i => { r.link(i) }); else if (o === "fontSize") this.$refs.decrement.addEventListener("click", () => { r.decrement() }), this.$refs.increment.addEventListener("click", () => { r.increment() }), this.$refs.fontSize.addEventListener("change", () => { r.fontSizeChange() }), this.$refs.fontSize.addEventListener("keydown", i => { r.fontSizeKeydown(i) }); else if (o === "fontFamily") this.$refs.fontFamily.addEventListener("change", i => { r.fontFamily(i.target.value) }); else if (o === "image") r.image(); else if (o !== "divider") { let i = r[o]; this.$refs[o].addEventListener("click", () => { i && i() }) } }) }, updateToolbar() { let r = k(); if (v(r)) { let o = r.anchor.getNode(), i = o.getKey() === "root" ? o : Q(o, g => { let f = g.getParent(); return f !== null && tt(f) }); i === null && (i = o.getTopLevelElementOrThrow()); let s = i.getKey(), a = this.editor.getElementByKey(s); this.updateToolbarState("isRTL", Yg(r)); let l = vi(r), c = l.getParent(), u = on(c) || on(l); if (this.updateToolbarState("isLink", u), a !== null) if (vp(i)) { let g = Ys(o, jc), f = g ? g.getListType() : i.getListType(); this.updateToolbarState("blockType", f) } else { let g = Zs(i) ? i.getTag() : i.getType(); if (g in fm && this.updateToolbarState("blockType", g), tp(i)) { let f = i.getLanguage(); this.updateToolbarState("codeLanguage", f ? np[f] || f : ""); return } } this.updateToolbarState("fontColor", fi(r, "color", "#000")), this.updateToolbarState("bgColor", fi(r, "background-color", "#fff")), this.updateToolbarState("fontFamily", fi(r, "font-family", "Arial")); let p; on(c) && (p = Q(l, g => $(g) && !g.isInline())), this.updateToolbarState("elementFormat", $(p) ? p.getFormatType() : $(l) ? l.getFormatType() : c?.getFormatType() || "left") } (v(r) || _a(r)) && (this.updateToolbarState("isBold", r.hasFormat("bold")), this.updateToolbarState("isItalic", r.hasFormat("italic")), this.updateToolbarState("isUnderline", r.hasFormat("underline")), this.updateToolbarState("isStrikethrough", r.hasFormat("strikethrough")), this.updateToolbarState("isSubscript", r.hasFormat("subscript")), this.updateToolbarState("isSuperscript", r.hasFormat("superscript")), this.updateToolbarState("isCode", r.hasFormat("code")), this.updateToolbarState("fontSize", fi(r, "font-size", "15px")), this.updateToolbarState("isLowercase", r.hasFormat("lowercase")), this.updateToolbarState("isUppercase", r.hasFormat("uppercase")), this.updateToolbarState("isCapitalize", r.hasFormat("capitalize"))) }, updateToolbarState(r, o) { this.toolbarState[r] = o, r === "fontColor" && this.$refs.text_color_input != null ? this.$nextTick(() => { this.$refs.text_color_input.value = o, this.$refs.text_color_input.dispatchEvent(new Event("input", { bubbles: !0 })) }) : r === "bgColor" && this.$refs.background_color_input != null ? this.$nextTick(() => { this.$refs.background_color_input.value = o, this.$refs.background_color_input.dispatchEvent(new Event("input", { bubbles: !0 })) }) : r === "fontSize" && this.$refs.fontSize != null ? this.$refs.fontSize.value = o.toString().replace("px", "") ?? Oo : r === "fontFamily" && (this.$refs.fontFamily.value = o) } } } export { W0 as default }; /*! Bundled license information: prismjs/prism.js: (** * Prism: Lightweight, robust, elegant syntax highlighting * * @license MIT * @author Lea Verou * @namespace * @public *) @melloware/coloris/dist/esm/coloris.js: (*! * Copyright (c) 2021-2024 Momo Bassit. * Licensed under the MIT License (MIT) * https://github.com/mdbassit/Coloris * Version: 0.24.0 * NPM: https://github.com/melloware/coloris-npm *) */