@banx9x/react-editor
Version:
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
1,483 lines (1,480 loc) • 1.03 MB
JavaScript
import * as C from "react";
import Fe, { createContext as am, useContext as lm, useMemo as Hl, useLayoutEffect as Ts, useEffect as ft, useState as rt, useCallback as Qe, useRef as Nu, Suspense as av, forwardRef as cm, createElement as Sc } from "react";
import * as Vo from "react-dom";
import lv, { flushSync as um, createPortal as cv } from "react-dom";
var kc = { exports: {} }, js = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var Sf;
function uv() {
if (Sf) return js;
Sf = 1;
var r = Fe, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, i = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = { key: !0, ref: !0, __self: !0, __source: !0 };
function o(a, l, c) {
var u, d = {}, f = null, m = null;
c !== void 0 && (f = "" + c), l.key !== void 0 && (f = "" + l.key), l.ref !== void 0 && (m = l.ref);
for (u in l) n.call(l, u) && !s.hasOwnProperty(u) && (d[u] = l[u]);
if (a && a.defaultProps) for (u in l = a.defaultProps, l) d[u] === void 0 && (d[u] = l[u]);
return { $$typeof: e, type: a, key: f, ref: m, props: d, _owner: i.current };
}
return js.Fragment = t, js.jsx = o, js.jsxs = o, js;
}
var $s = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var kf;
function dv() {
return kf || (kf = 1, process.env.NODE_ENV !== "production" && function() {
var r = Fe, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), a = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), u = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), f = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), p = Symbol.iterator, v = "@@iterator";
function y(R) {
if (R === null || typeof R != "object")
return null;
var K = p && R[p] || R[v];
return typeof K == "function" ? K : null;
}
var _ = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function x(R) {
{
for (var K = arguments.length, fe = new Array(K > 1 ? K - 1 : 0), Ae = 1; Ae < K; Ae++)
fe[Ae - 1] = arguments[Ae];
k("error", R, fe);
}
}
function k(R, K, fe) {
{
var Ae = _.ReactDebugCurrentFrame, Ye = Ae.getStackAddendum();
Ye !== "" && (K += "%s", fe = fe.concat([Ye]));
var nt = fe.map(function(Ve) {
return String(Ve);
});
nt.unshift("Warning: " + K), Function.prototype.apply.call(console[R], console, nt);
}
}
var T = !1, E = !1, D = !1, z = !1, L = !1, P;
P = Symbol.for("react.module.reference");
function V(R) {
return !!(typeof R == "string" || typeof R == "function" || R === n || R === s || L || R === i || R === c || R === u || z || R === m || T || E || D || typeof R == "object" && R !== null && (R.$$typeof === f || R.$$typeof === d || R.$$typeof === o || R.$$typeof === a || R.$$typeof === l || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
R.$$typeof === P || R.getModuleId !== void 0));
}
function re(R, K, fe) {
var Ae = R.displayName;
if (Ae)
return Ae;
var Ye = K.displayName || K.name || "";
return Ye !== "" ? fe + "(" + Ye + ")" : fe;
}
function I(R) {
return R.displayName || "Context";
}
function $(R) {
if (R == null)
return null;
if (typeof R.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof R == "function")
return R.displayName || R.name || null;
if (typeof R == "string")
return R;
switch (R) {
case n:
return "Fragment";
case t:
return "Portal";
case s:
return "Profiler";
case i:
return "StrictMode";
case c:
return "Suspense";
case u:
return "SuspenseList";
}
if (typeof R == "object")
switch (R.$$typeof) {
case a:
var K = R;
return I(K) + ".Consumer";
case o:
var fe = R;
return I(fe._context) + ".Provider";
case l:
return re(R, R.render, "ForwardRef");
case d:
var Ae = R.displayName || null;
return Ae !== null ? Ae : $(R.type) || "Memo";
case f: {
var Ye = R, nt = Ye._payload, Ve = Ye._init;
try {
return $(Ve(nt));
} catch {
return null;
}
}
}
return null;
}
var j = Object.assign, q = 0, U, Z, oe, ae, we, Ie, Me;
function dt() {
}
dt.__reactDisabledLog = !0;
function Xe() {
{
if (q === 0) {
U = console.log, Z = console.info, oe = console.warn, ae = console.error, we = console.group, Ie = console.groupCollapsed, Me = console.groupEnd;
var R = {
configurable: !0,
enumerable: !0,
value: dt,
writable: !0
};
Object.defineProperties(console, {
info: R,
log: R,
warn: R,
error: R,
group: R,
groupCollapsed: R,
groupEnd: R
});
}
q++;
}
}
function et() {
{
if (q--, q === 0) {
var R = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: j({}, R, {
value: U
}),
info: j({}, R, {
value: Z
}),
warn: j({}, R, {
value: oe
}),
error: j({}, R, {
value: ae
}),
group: j({}, R, {
value: we
}),
groupCollapsed: j({}, R, {
value: Ie
}),
groupEnd: j({}, R, {
value: Me
})
});
}
q < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var Ze = _.ReactCurrentDispatcher, me;
function Ee(R, K, fe) {
{
if (me === void 0)
try {
throw Error();
} catch (Ye) {
var Ae = Ye.stack.trim().match(/\n( *(at )?)/);
me = Ae && Ae[1] || "";
}
return `
` + me + R;
}
}
var $e = !1, ze;
{
var qe = typeof WeakMap == "function" ? WeakMap : Map;
ze = new qe();
}
function Je(R, K) {
if (!R || $e)
return "";
{
var fe = ze.get(R);
if (fe !== void 0)
return fe;
}
var Ae;
$e = !0;
var Ye = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var nt;
nt = Ze.current, Ze.current = null, Xe();
try {
if (K) {
var Ve = function() {
throw Error();
};
if (Object.defineProperty(Ve.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(Ve, []);
} catch (sr) {
Ae = sr;
}
Reflect.construct(R, [], Ve);
} else {
try {
Ve.call();
} catch (sr) {
Ae = sr;
}
R.call(Ve.prototype);
}
} else {
try {
throw Error();
} catch (sr) {
Ae = sr;
}
R();
}
} catch (sr) {
if (sr && Ae && typeof sr.stack == "string") {
for (var Be = sr.stack.split(`
`), Kt = Ae.stack.split(`
`), _t = Be.length - 1, At = Kt.length - 1; _t >= 1 && At >= 0 && Be[_t] !== Kt[At]; )
At--;
for (; _t >= 1 && At >= 0; _t--, At--)
if (Be[_t] !== Kt[At]) {
if (_t !== 1 || At !== 1)
do
if (_t--, At--, At < 0 || Be[_t] !== Kt[At]) {
var Sr = `
` + Be[_t].replace(" at new ", " at ");
return R.displayName && Sr.includes("<anonymous>") && (Sr = Sr.replace("<anonymous>", R.displayName)), typeof R == "function" && ze.set(R, Sr), Sr;
}
while (_t >= 1 && At >= 0);
break;
}
}
} finally {
$e = !1, Ze.current = nt, et(), Error.prepareStackTrace = Ye;
}
var Ui = R ? R.displayName || R.name : "", _i = Ui ? Ee(Ui) : "";
return typeof R == "function" && ze.set(R, _i), _i;
}
function wt(R, K, fe) {
return Je(R, !1);
}
function Lt(R) {
var K = R.prototype;
return !!(K && K.isReactComponent);
}
function ir(R, K, fe) {
if (R == null)
return "";
if (typeof R == "function")
return Je(R, Lt(R));
if (typeof R == "string")
return Ee(R);
switch (R) {
case c:
return Ee("Suspense");
case u:
return Ee("SuspenseList");
}
if (typeof R == "object")
switch (R.$$typeof) {
case l:
return wt(R.render);
case d:
return ir(R.type, K, fe);
case f: {
var Ae = R, Ye = Ae._payload, nt = Ae._init;
try {
return ir(nt(Ye), K, fe);
} catch {
}
}
}
return "";
}
var Ne = Object.prototype.hasOwnProperty, Ft = {}, M = _.ReactDebugCurrentFrame;
function F(R) {
if (R) {
var K = R._owner, fe = ir(R.type, R._source, K ? K.type : null);
M.setExtraStackFrame(fe);
} else
M.setExtraStackFrame(null);
}
function H(R, K, fe, Ae, Ye) {
{
var nt = Function.call.bind(Ne);
for (var Ve in R)
if (nt(R, Ve)) {
var Be = void 0;
try {
if (typeof R[Ve] != "function") {
var Kt = Error((Ae || "React class") + ": " + fe + " type `" + Ve + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof R[Ve] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
throw Kt.name = "Invariant Violation", Kt;
}
Be = R[Ve](K, Ve, Ae, fe, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (_t) {
Be = _t;
}
Be && !(Be instanceof Error) && (F(Ye), x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", Ae || "React class", fe, Ve, typeof Be), F(null)), Be instanceof Error && !(Be.message in Ft) && (Ft[Be.message] = !0, F(Ye), x("Failed %s type: %s", fe, Be.message), F(null));
}
}
}
var le = Array.isArray;
function ne(R) {
return le(R);
}
function te(R) {
{
var K = typeof Symbol == "function" && Symbol.toStringTag, fe = K && R[Symbol.toStringTag] || R.constructor.name || "Object";
return fe;
}
}
function ye(R) {
try {
return Re(R), !1;
} catch {
return !0;
}
}
function Re(R) {
return "" + R;
}
function tt(R) {
if (ye(R))
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", te(R)), Re(R);
}
var Rt = _.ReactCurrentOwner, Vn = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, la, Wi, wi;
wi = {};
function A0(R) {
if (Ne.call(R, "ref")) {
var K = Object.getOwnPropertyDescriptor(R, "ref").get;
if (K && K.isReactWarning)
return !1;
}
return R.ref !== void 0;
}
function ca(R) {
if (Ne.call(R, "key")) {
var K = Object.getOwnPropertyDescriptor(R, "key").get;
if (K && K.isReactWarning)
return !1;
}
return R.key !== void 0;
}
function N0(R, K) {
if (typeof R.ref == "string" && Rt.current && K && Rt.current.stateNode !== K) {
var fe = $(Rt.current.type);
wi[fe] || (x('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', $(Rt.current.type), R.ref), wi[fe] = !0);
}
}
function ua(R, K) {
{
var fe = function() {
la || (la = !0, x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", K));
};
fe.isReactWarning = !0, Object.defineProperty(R, "key", {
get: fe,
configurable: !0
});
}
}
function G2(R, K) {
{
var fe = function() {
Wi || (Wi = !0, x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", K));
};
fe.isReactWarning = !0, Object.defineProperty(R, "ref", {
get: fe,
configurable: !0
});
}
}
var K2 = function(R, K, fe, Ae, Ye, nt, Ve) {
var Be = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: e,
// Built-in properties that belong on the element
type: R,
key: K,
ref: fe,
props: Ve,
// Record the component responsible for creating this element.
_owner: nt
};
return Be._store = {}, Object.defineProperty(Be._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(Be, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: Ae
}), Object.defineProperty(Be, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: Ye
}), Object.freeze && (Object.freeze(Be.props), Object.freeze(Be)), Be;
};
function Y2(R, K, fe, Ae, Ye) {
{
var nt, Ve = {}, Be = null, Kt = null;
fe !== void 0 && (tt(fe), Be = "" + fe), ca(K) && (tt(K.key), Be = "" + K.key), A0(K) && (Kt = K.ref, N0(K, Ye));
for (nt in K)
Ne.call(K, nt) && !Vn.hasOwnProperty(nt) && (Ve[nt] = K[nt]);
if (R && R.defaultProps) {
var _t = R.defaultProps;
for (nt in _t)
Ve[nt] === void 0 && (Ve[nt] = _t[nt]);
}
if (Be || Kt) {
var At = typeof R == "function" ? R.displayName || R.name || "Unknown" : R;
Be && ua(Ve, At), Kt && G2(Ve, At);
}
return K2(R, Be, Kt, Ye, Ae, Rt.current, Ve);
}
}
var M0 = _.ReactCurrentOwner, gf = _.ReactDebugCurrentFrame;
function qi(R) {
if (R) {
var K = R._owner, fe = ir(R.type, R._source, K ? K.type : null);
gf.setExtraStackFrame(fe);
} else
gf.setExtraStackFrame(null);
}
var R0;
R0 = !1;
function z0(R) {
return typeof R == "object" && R !== null && R.$$typeof === e;
}
function vf() {
{
if (M0.current) {
var R = $(M0.current.type);
if (R)
return `
Check the render method of \`` + R + "`.";
}
return "";
}
}
function X2(R) {
return "";
}
var yf = {};
function J2(R) {
{
var K = vf();
if (!K) {
var fe = typeof R == "string" ? R : R.displayName || R.name;
fe && (K = `
Check the top-level render call using <` + fe + ">.");
}
return K;
}
}
function bf(R, K) {
{
if (!R._store || R._store.validated || R.key != null)
return;
R._store.validated = !0;
var fe = J2(K);
if (yf[fe])
return;
yf[fe] = !0;
var Ae = "";
R && R._owner && R._owner !== M0.current && (Ae = " It was passed a child from " + $(R._owner.type) + "."), qi(R), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', fe, Ae), qi(null);
}
}
function xf(R, K) {
{
if (typeof R != "object")
return;
if (ne(R))
for (var fe = 0; fe < R.length; fe++) {
var Ae = R[fe];
z0(Ae) && bf(Ae, K);
}
else if (z0(R))
R._store && (R._store.validated = !0);
else if (R) {
var Ye = y(R);
if (typeof Ye == "function" && Ye !== R.entries)
for (var nt = Ye.call(R), Ve; !(Ve = nt.next()).done; )
z0(Ve.value) && bf(Ve.value, K);
}
}
}
function Q2(R) {
{
var K = R.type;
if (K == null || typeof K == "string")
return;
var fe;
if (typeof K == "function")
fe = K.propTypes;
else if (typeof K == "object" && (K.$$typeof === l || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
K.$$typeof === d))
fe = K.propTypes;
else
return;
if (fe) {
var Ae = $(K);
H(fe, R.props, "prop", Ae, R);
} else if (K.PropTypes !== void 0 && !R0) {
R0 = !0;
var Ye = $(K);
x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", Ye || "Unknown");
}
typeof K.getDefaultProps == "function" && !K.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function ev(R) {
{
for (var K = Object.keys(R.props), fe = 0; fe < K.length; fe++) {
var Ae = K[fe];
if (Ae !== "children" && Ae !== "key") {
qi(R), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", Ae), qi(null);
break;
}
}
R.ref !== null && (qi(R), x("Invalid attribute `ref` supplied to `React.Fragment`."), qi(null));
}
}
var wf = {};
function _f(R, K, fe, Ae, Ye, nt) {
{
var Ve = V(R);
if (!Ve) {
var Be = "";
(R === void 0 || typeof R == "object" && R !== null && Object.keys(R).length === 0) && (Be += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var Kt = X2();
Kt ? Be += Kt : Be += vf();
var _t;
R === null ? _t = "null" : ne(R) ? _t = "array" : R !== void 0 && R.$$typeof === e ? (_t = "<" + ($(R.type) || "Unknown") + " />", Be = " Did you accidentally export a JSX literal instead of a component?") : _t = typeof R, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", _t, Be);
}
var At = Y2(R, K, fe, Ye, nt);
if (At == null)
return At;
if (Ve) {
var Sr = K.children;
if (Sr !== void 0)
if (Ae)
if (ne(Sr)) {
for (var Ui = 0; Ui < Sr.length; Ui++)
xf(Sr[Ui], R);
Object.freeze && Object.freeze(Sr);
} else
x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
else
xf(Sr, R);
}
if (Ne.call(K, "key")) {
var _i = $(R), sr = Object.keys(K).filter(function(ov) {
return ov !== "key";
}), D0 = sr.length > 0 ? "{key: someKey, " + sr.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!wf[_i + D0]) {
var sv = sr.length > 0 ? "{" + sr.join(": ..., ") + ": ...}" : "{}";
x(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`, D0, _i, sv, _i), wf[_i + D0] = !0;
}
}
return R === n ? ev(At) : Q2(At), At;
}
}
function tv(R, K, fe) {
return _f(R, K, fe, !0);
}
function rv(R, K, fe) {
return _f(R, K, fe, !1);
}
var nv = rv, iv = tv;
$s.Fragment = n, $s.jsx = nv, $s.jsxs = iv;
}()), $s;
}
process.env.NODE_ENV === "production" ? kc.exports = uv() : kc.exports = dv();
var b = kc.exports;
function Es(r) {
return {};
}
const Wl = {}, fv = {}, Mu = {}, Ni = {}, us = {}, mo = {}, ds = {}, Ru = {}, Cc = {}, po = {}, go = {}, Jt = {}, ql = {}, Ul = {}, hv = {}, dm = {}, mv = {}, fm = {}, pv = {}, hm = {}, mm = {}, vo = {}, gv = {}, zu = {}, pm = {}, Du = {}, gm = {}, vm = {}, Ou = {}, Tc = {}, ym = {}, Ks = {}, bm = {}, xm = {}, vv = {}, Zl = {}, Pu = {}, Ec = {}, yv = {}, bv = {}, Ys = {}, Xs = {}, xv = {}, wv = {}, _v = {};
function Sv(r) {
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
}
var he = Sv(function(r) {
const e = new URLSearchParams();
e.append("code", r);
for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${e} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
});
const qr = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, kv = qr && "documentMode" in document ? document.documentMode : null, zr = qr && /Mac|iPod|iPhone|iPad/.test(navigator.platform), ri = qr && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), Ka = !(!qr || !("InputEvent" in window) || kv) && "getTargetRanges" in new window.InputEvent("input"), Iu = qr && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), Gl = qr && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Cv = qr && /Android/.test(navigator.userAgent), wm = qr && /^(?=.*Chrome).*/i.test(navigator.userAgent), Tv = qr && Cv && wm, Lu = qr && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !wm, Ho = 1, pi = 3, Di = 0, _m = 1, ys = 2, Ev = 0, Av = 1, Nv = 2, Ya = 4, Xa = 8, Mv = 240 | (3 | Ya | Xa), Fu = 1, Bu = 2, ju = 3, $u = 4, Vu = 5, Hu = 6, Kl = Iu || Gl || Lu ? " " : "", Nn = `
`, Rv = ri ? " " : Kl, Sm = "֑-߿יִ-﷽ﹰ-ﻼ", km = "A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--", zv = new RegExp("^[^" + km + "]*[" + Sm + "]"), Dv = new RegExp("^[^" + Sm + "]*[" + km + "]"), Tn = { bold: 1, code: 16, highlight: 128, italic: 2, strikethrough: Ya, subscript: 32, superscript: 64, underline: Xa }, Ov = { directionless: 1, unmergeable: 2 }, Cf = { center: Bu, end: Hu, justify: $u, left: Fu, right: ju, start: Vu }, Pv = { [Bu]: "center", [Hu]: "end", [$u]: "justify", [Fu]: "left", [ju]: "right", [Vu]: "start" }, Iv = { normal: 0, segmented: 2, token: 1 }, Lv = { [Ev]: "normal", [Nv]: "segmented", [Av]: "token" };
function Ja(...r) {
const e = [];
for (const t of r) if (t && typeof t == "string") for (const [n] of t.matchAll(/\S+/g)) e.push(n);
return e;
}
const Fv = 100;
let Ac = !1, Wu = 0;
function Bv(r) {
Wu = r.timeStamp;
}
function O0(r, e, t) {
return e.__lexicalLineBreak === r || r[`__lexicalKey_${t._key}`] !== void 0;
}
function jv(r, e, t) {
const n = nn(t._window);
let i = null, s = null;
n !== null && n.anchorNode === r && (i = n.anchorOffset, s = n.focusOffset);
const o = r.nodeValue;
o !== null && Ku(e, o, i, s, !1);
}
function $v(r, e, t) {
if (ee(r)) {
const n = r.anchor.getNode();
if (n.is(t) && r.format !== n.getFormat()) return !1;
}
return e.nodeType === pi && t.isAttached();
}
function Cm(r, e, t) {
Ac = !0;
const n = performance.now() - Wu > Fv;
try {
vr(r, () => {
const i = ue() || function(f) {
return f.getEditorState().read(() => {
const m = ue();
return m !== null ? m.clone() : null;
});
}(r), s = /* @__PURE__ */ new Map(), o = r.getRootElement(), a = r._editorState, l = r._blockCursorElement;
let c = !1, u = "";
for (let f = 0; f < e.length; f++) {
const m = e[f], p = m.type, v = m.target;
let y = Mn(v, a);
if (!(y === null && v !== o || st(y))) {
if (p === "characterData") n && X(y) && $v(i, v, y) && jv(v, y, r);
else if (p === "childList") {
c = !0;
const _ = m.addedNodes;
for (let T = 0; T < _.length; T++) {
const E = _[T], D = Mm(E), z = E.parentNode;
if (z != null && E !== l && D === null && (E.nodeName !== "BR" || !O0(E, z, r))) {
if (ri) {
const L = E.innerText || E.nodeValue;
L && (u += L);
}
z.removeChild(E);
}
}
const x = m.removedNodes, k = x.length;
if (k > 0) {
let T = 0;
for (let E = 0; E < k; E++) {
const D = x[E];
(D.nodeName === "BR" && O0(D, v, r) || l === D) && (v.appendChild(D), T++);
}
k !== T && (v === o && (y = zm(a)), s.set(v, y));
}
}
}
}
if (s.size > 0) for (const [f, m] of s) if (W(m)) {
const p = m.getChildrenKeys();
let v = f.firstChild;
for (let y = 0; y < p.length; y++) {
const _ = p[y], x = r.getElementByKey(_);
x !== null && (v == null ? (f.appendChild(x), v = x) : v !== x && f.replaceChild(x, v), v = v.nextSibling);
}
} else X(m) && m.markDirty();
const d = t.takeRecords();
if (d.length > 0) {
for (let f = 0; f < d.length; f++) {
const m = d[f], p = m.addedNodes, v = m.target;
for (let y = 0; y < p.length; y++) {
const _ = p[y], x = _.parentNode;
x == null || _.nodeName !== "BR" || O0(_, v, r) || x.removeChild(_);
}
}
t.takeRecords();
}
i !== null && (c && (i.dirty = !0, Er(i)), ri && Im(r) && i.insertRawText(u));
});
} finally {
Ac = !1;
}
}
function Tm(r) {
const e = r._observer;
e !== null && Cm(r, e.takeRecords(), e);
}
function Em(r) {
(function(e) {
Wu === 0 && Jl(e).addEventListener("textInput", Bv, !0);
})(r), r._observer = new MutationObserver((e, t) => {
Cm(r, e, t);
});
}
function Tf(r, e) {
const t = r.__mode, n = r.__format, i = r.__style, s = e.__mode, o = e.__format, a = e.__style;
return !(t !== null && t !== s || n !== null && n !== o || i !== null && i !== a);
}
function Ef(r, e) {
const t = r.mergeWithSibling(e), n = Ct()._normalizedNodes;
return n.add(r.__key), n.add(e.__key), t;
}
function Af(r) {
let e, t, n = r;
if (n.__text !== "" || !n.isSimpleText() || n.isUnmergeable()) {
for (; (e = n.getPreviousSibling()) !== null && X(e) && e.isSimpleText() && !e.isUnmergeable(); ) {
if (e.__text !== "") {
if (Tf(e, n)) {
n = Ef(e, n);
break;
}
break;
}
e.remove();
}
for (; (t = n.getNextSibling()) !== null && X(t) && t.isSimpleText() && !t.isUnmergeable(); ) {
if (t.__text !== "") {
if (Tf(n, t)) {
n = Ef(n, t);
break;
}
break;
}
t.remove();
}
} else n.remove();
}
function qu(r) {
return Nf(r.anchor), Nf(r.focus), r;
}
function Nf(r) {
for (; r.type === "element"; ) {
const e = r.getNode(), t = r.offset;
let n, i;
if (t === e.getChildrenSize() ? (n = e.getChildAtIndex(t - 1), i = !0) : (n = e.getChildAtIndex(t), i = !1), X(n)) {
r.set(n.__key, i ? n.getTextContentSize() : 0, "text");
break;
}
if (!W(n)) break;
r.set(n.__key, i ? n.getChildrenSize() : 0, "element");
}
}
let Vv = 1;
const Hv = typeof queueMicrotask == "function" ? queueMicrotask : (r) => {
Promise.resolve().then(r);
};
function Uu(r) {
const e = document.activeElement;
if (e === null) return !1;
const t = e.nodeName;
return st(Mn(r)) && (t === "INPUT" || t === "TEXTAREA" || e.contentEditable === "true" && e.__lexicalEditor == null);
}
function Wo(r, e, t) {
const n = r.getRootElement();
try {
return n !== null && n.contains(e) && n.contains(t) && e !== null && !Uu(e) && Am(e) === r;
} catch {
return !1;
}
}
function Am(r) {
let e = r;
for (; e != null; ) {
const t = e.__lexicalEditor;
if (t != null) return t;
e = Xl(e);
}
return null;
}
function rs(r) {
return r.isToken() || r.isSegmented();
}
function Wv(r) {
return r.nodeType === pi;
}
function Qa(r) {
let e = r;
for (; e != null; ) {
if (Wv(e)) return e;
e = e.firstChild;
}
return null;
}
function Nc(r, e, t) {
const n = Tn[e];
if (t !== null && (r & n) == (t & n)) return r;
let i = r ^ n;
return e === "subscript" ? i &= ~Tn.superscript : e === "superscript" && (i &= ~Tn.subscript), i;
}
function Nm(r) {
return X(r) || tn(r) || st(r);
}
function qv(r, e) {
if (e != null) return void (r.__key = e);
cr(), np();
const t = Ct(), n = Bn(), i = "" + Vv++;
n._nodeMap.set(i, r), W(r) ? t._dirtyElements.set(i, !0) : t._dirtyLeaves.add(i), t._cloneNotNeeded.add(i), t._dirtyType = _m, r.__key = i;
}
function Mi(r) {
const e = r.getParent();
if (e !== null) {
const t = r.getWritable(), n = e.getWritable(), i = r.getPreviousSibling(), s = r.getNextSibling();
if (i === null) if (s !== null) {
const o = s.getWritable();
n.__first = s.__key, o.__prev = null;
} else n.__first = null;
else {
const o = i.getWritable();
if (s !== null) {
const a = s.getWritable();
a.__prev = o.__key, o.__next = a.__key;
} else o.__next = null;
t.__prev = null;
}
if (s === null) if (i !== null) {
const o = i.getWritable();
n.__last = i.__key, o.__next = null;
} else n.__last = null;
else {
const o = s.getWritable();
if (i !== null) {
const a = i.getWritable();
a.__next = o.__key, o.__prev = a.__key;
} else o.__prev = null;
t.__next = null;
}
n.__size--, t.__parent = null;
}
}
function el(r) {
np();
const e = r.getLatest(), t = e.__parent, n = Bn(), i = Ct(), s = n._nodeMap, o = i._dirtyElements;
t !== null && function(l, c, u) {
let d = l;
for (; d !== null; ) {
if (u.has(d)) return;
const f = c.get(d);
if (f === void 0) break;
u.set(d, !1), d = f.__parent;
}
}(t, s, o);
const a = e.__key;
i._dirtyType = _m, W(r) ? o.set(a, !0) : i._dirtyLeaves.add(a);
}
function Vt(r) {
cr();
const e = Ct(), t = e._compositionKey;
if (r !== t) {
if (e._compositionKey = r, t !== null) {
const n = Ot(t);
n !== null && n.getWritable();
}
if (r !== null) {
const n = Ot(r);
n !== null && n.getWritable();
}
}
}
function Jn() {
return Go() ? null : Ct()._compositionKey;
}
function Ot(r, e) {
const t = (e || Bn())._nodeMap.get(r);
return t === void 0 ? null : t;
}
function Mm(r, e) {
const t = r[`__lexicalKey_${Ct()._key}`];
return t !== void 0 ? Ot(t, e) : null;
}
function Mn(r, e) {
let t = r;
for (; t != null; ) {
const n = Mm(t, e);
if (n !== null) return n;
t = Xl(t);
}
return null;
}
function Rm(r) {
const e = r._decorators, t = Object.assign({}, e);
return r._pendingDecorators = t, t;
}
function Mf(r) {
return r.read(() => xt().getTextContent());
}
function xt() {
return zm(Bn());
}
function zm(r) {
return r._nodeMap.get("root");
}
function Er(r) {
cr();
const e = Bn();
r !== null && (r.dirty = !0, r.setCachedNodes(null)), e._selection = r;
}
function os(r) {
const e = Ct(), t = function(n, i) {
let s = n;
for (; s != null; ) {
const o = s[`__lexicalKey_${i._key}`];
if (o !== void 0) return o;
s = Xl(s);
}
return null;
}(r, e);
return t === null ? r === e.getRootElement() ? Ot("root") : null : Ot(t);
}
function Rf(r, e) {
return e ? r.getTextContentSize() : 0;
}
function Dm(r) {
return /[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(r);
}
function Zu(r) {
const e = [];
let t = r;
for (; t !== null; ) e.push(t), t = t._parentEditor;
return e;
}
function Om() {
return Math.random().toString(36).replace(/[^a-z]+/g, "").substr(0, 5);
}
function Pm(r) {
return r.nodeType === pi ? r.nodeValue : null;
}
function Gu(r, e, t) {
const n = nn(e._window);
if (n === null) return;
const i = n.anchorNode;
let { anchorOffset: s, focusOffset: o } = n;
if (i !== null) {
let a = Pm(i);
const l = Mn(i);
if (a !== null && X(l)) {
if (a === Kl && t) {
const c = t.length;
a = t, s = c, o = c;
}
a !== null && Ku(l, a, s, o, r);
}
}
}
function Ku(r, e, t, n, i) {
let s = r;
if (s.isAttached() && (i || !s.isDirty())) {
const o = s.isComposing();
let a = e;
(o || i) && e[e.length - 1] === Kl && (a = e.slice(0, -1));
const l = s.getTextContent();
if (i || a !== l) {
if (a === "") {
if (Vt(null), Iu || Gl || Lu) s.remove();
else {
const v = Ct();
setTimeout(() => {
v.update(() => {
s.isAttached() && s.remove();
});
}, 20);
}
return;
}
const c = s.getParent(), u = As(), d = s.getTextContentSize(), f = Jn(), m = s.getKey();
if (s.isToken() || f !== null && m === f && !o || ee(u) && (c !== null && !c.canInsertTextBefore() && u.anchor.offset === 0 || u.anchor.key === r.__key && u.anchor.offset === 0 && !s.canInsertTextBefore() && !o || u.focus.key === r.__key && u.focus.offset === d && !s.canInsertTextAfter() && !o)) return void s.markDirty();
const p = ue();
if (!ee(p) || t === null || n === null) return void s.setTextContent(a);
if (p.setTextNodeRange(s, t, s, n), s.isSegmented()) {
const v = St(s.getTextContent());
s.replace(v), s = v;
}
s.setTextContent(a);
}
}
}
function Uv(r, e) {
if (e.isSegmented()) return !0;
if (!r.isCollapsed()) return !1;
const t = r.anchor.offset, n = e.getParentOrThrow(), i = e.isToken();
return t === 0 ? !e.canInsertTextBefore() || !n.canInsertTextBefore() && !e.isComposing() || i || function(s) {
const o = s.getPreviousSibling();
return (X(o) || W(o) && o.isInline()) && !o.canInsertTextAfter();
}(e) : t === e.getTextContentSize() && (!e.canInsertTextAfter() || !n.canInsertTextAfter() && !e.isComposing() || i);
}
function zf(r) {
return r === "ArrowLeft";
}
function Df(r) {
return r === "ArrowRight";
}
function Js(r, e) {
return zr ? r : e;
}
function Of(r) {
return r === "Enter";
}
function Vs(r) {
return r === "Backspace";
}
function Hs(r) {
return r === "Delete";
}
function Pf(r, e, t) {
return r.toLowerCase() === "a" && Js(e, t);
}
function Zv() {
const r = xt();
Er(qu(r.select(0, r.getChildrenSize())));
}
function io(r, e) {
r.__lexicalClassNameCache === void 0 && (r.__lexicalClassNameCache = {});
const t = r.__lexicalClassNameCache, n = t[e];
if (n !== void 0) return n;
const i = r[e];
if (typeof i == "string") {
const s = Ja(i);
return t[e] = s, s;
}
return i;
}
function Yu(r, e, t, n, i) {
if (t.size === 0) return;
const s = n.__type, o = n.__key, a = e.get(s);
a === void 0 && he(33, s);
const l = a.klass;
let c = r.get(l);
c === void 0 && (c = /* @__PURE__ */ new Map(), r.set(l, c));
const u = c.get(o), d = u === "destroyed" && i === "created";
(u === void 0 || d) && c.set(o, d ? "updated" : i);
}
function If(r, e, t) {
const n = r.getParent();
let i = t, s = r;
return n !== null && (e && t === 0 ? (i = s.getIndexWithinParent(), s = n) : e || t !== s.getChildrenSize() || (i = s.getIndexWithinParent() + 1, s = n)), s.getChildAtIndex(e ? i - 1 : i);
}
function yo(r, e) {
const t = r.offset;
if (r.type === "element")
return If(r.getNode(), e, t);
{
const n = r.getNode();
if (e && t === 0 || !e && t === n.getTextContentSize()) {
const i = e ? n.getPreviousSibling() : n.getNextSibling();
return i === null ? If(n.getParentOrThrow(), e, n.getIndexWithinParent() + (e ? 0 : 1)) : i;
}
}
return null;
}
function Im(r) {
const e = Jl(r).event, t = e && e.inputType;
return t === "insertFromPaste" || t === "insertFromPasteAsQuotation";
}
function pe(r, e, t) {
return ip(r, e, t);
}
function Yl(r) {
return !Ht(r) && !r.isLastChild() && !r.isInline();
}
function tl(r, e) {
const t = r._keyToDOMMap.get(e);
return t === void 0 && he(75, e), t;
}
function Xl(r) {
const e = r.assignedSlot || r.parentElement;
return e !== null && e.nodeType === 11 ? e.host : e;
}
function Mc(r, e) {
let t = r.getParent();
for (; t !== null; ) {
if (t.is(e)) return !0;
t = t.getParent();
}
return !1;
}
function Jl(r) {
const e = r._window;
return e === null && he(78), e;
}
function Gv(r) {
let e = r.getParentOrThrow();
for (; e !== null; ) {
if ($r(e)) return e;
e = e.getParentOrThrow();
}
return e;
}
function $r(r) {
return Ht(r) || W(r) && r.isShadowRoot();
}
function Gt(r) {
const e = Ct(), t = r.constructor.getType(), n = e._nodes.get(t);
n === void 0 && he(97);
const i = n.replace;
if (i !== null) {
const s = i(r);
return s instanceof r.constructor || he(98), s;
}
return r;
}
function P0(r, e) {
!Ht(r.getParent()) || W(e) || st(e) || he(99);
}
function I0(r) {
return (st(r) || W(r) && !r.canBeEmpty()) && !r.isInline();
}
function Xu(r, e, t) {
t.style.removeProperty("caret-color"), e._blockCursorElement = null;
const n = r.parentElement;
n !== null && n.removeChild(r);
}
function Kv(r, e, t) {
let n = r._blockCursorElement;
if (ee(t) && t.isCollapsed() && t.anchor.type === "element" && e.contains(document.activeElement)) {
const i = t.anchor, s = i.getNode(), o = i.offset;
let a = !1, l = null;
if (o === s.getChildrenSize())
I0(s.getChildAtIndex(o - 1)) && (a = !0);
else {
const c = s.getChildAtIndex(o);
if (I0(c)) {
const u = c.getPreviousSibling();
(u === null || I0(u)) && (a = !0, l = r.getElementByKey(c.__key));
}
}
if (a) {
const c = r.getElementByKey(s.__key);
return n === null && (r._blockCursorElement = n = function(u) {
const d = u.theme, f = document.createElement("div");
f.contentEditable = "false", f.setAttribute("data-lexical-cursor", "true");
let m = d.blockCursor;
if (m !== void 0) {
if (typeof m == "string") {
const p = Ja(m);
m = d.blockCursor = p;
}
m !== void 0 && f.classList.add(...m);
}
return f;
}(r._config)), e.style.caretColor = "transparent", void (l === null ? c.appendChild(n) : c.insertBefore(n, l));
}
}
n !== null && Xu(n, r, e);
}
function nn(r) {
return qr ? (r || window).getSelection() : null;
}
function Yv(r) {
return Fn(r) && r.tagName === "A";
}
function Fn(r) {
return r.nodeType === 1;
}
function Xv(r) {
const e = new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/, "i");
return r.nodeName.match(e) !== null;
}
function Jv(r) {
const 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 r.nodeName.match(e) !== null;
}
function ns(r) {
if (Ht(r) || st(r) && !r.isInline()) return !0;
if (!W(r) || $r(r)) return !1;
const e = r.getFirstChild(), t = e === null || tn(e) || X(e) || e.isInline();
return !r.isInline() && r.canBeEmpty() !== !1 && t;
}
function L0(r, e) {
let t = r;
for (; t !== null && t.getParent() !== null && !e(t); ) t = t.getParentOrThrow();
return e(t) ? t : null;
}
function Lm(r, e, t, n, i, s) {
let o = r.getFirstChild();
for (; o !== null; ) {
const a = o.__key;
o.__parent === e && (W(o) && Lm(o, a, t, n, i, s), t.has(a) || s.delete(a), i.push(a)), o = o.getNextSibling();
}
}
let ni, tr, bo, Ql, Rc, zc, Oi, Fr, Dc, xo, Dt = "", Qt = "", Dr = null, Sn = "", Fm = !1, Ju = !1, Fa = null;
function rl(r, e) {
const t = Oi.get(r);
if (e !== null) {
const n = Ic(r);
n.parentNode === e && e.removeChild(n);
}
if (Fr.has(r) || tr._keyToDOMMap.delete(r), W(t)) {
const n = il(t, Oi);
Oc(n, 0, n.length - 1, null);
}
t !== void 0 && Yu(xo, bo, Ql, t, "destroyed");
}
function Oc(r, e, t, n) {
let i = e;
for (; i <= t; ++i) {
const s = r[i];
s !== void 0 && rl(s, n);
}
}
function Si(r, e) {
r.setProperty("text-align", e);
}
const Qv = "40px";
function Bm(r, e) {
const t = ni.theme.indent;
if (typeof t == "string") {
const i = r.classList.contains(t);
e > 0 && !i ? r.classList.add(t) : e < 1 && i && r.classList.remove(t);
}
const n = getComputedStyle(r).getPropertyValue("--lexical-indent-base-value") || Qv;
r.style.setProperty("padding-inline-start", e === 0 ? "" : `calc(${e} * ${n})`);
}
function jm(r, e) {
const t = r.style;
e === 0 ? Si(t, "") : e === Fu ? Si(t, "left") : e === Bu ? Si(t, "center") : e === ju ? Si(t, "right") : e === $u ? Si(t, "justify") : e === Vu ? Si(t, "start") : e === Hu && Si(t, "end");
}
function nl(r, e, t) {
const n = Fr.get(r);
n === void 0 && he(60);
const i = n.createDOM(ni, tr);
if (function(s, o, a) {
const l = a._keyToDOMMap;
o["__lexicalKey_" + a._key] = s, l.set(s, o);
}(r, i, tr), X(n) ? i.setAttribute("data-lexical-text", "true") : st(n) && i.setAttribute("data-lexical-decorator", "true"), W(n)) {
const s = n.__indent, o = n.__size;
if (s !== 0 && Bm(i, s), o !== 0) {
const l = o - 1;
(function(c, u, d, f) {
const m = Qt;
Qt = "", Pc(c, d, 0, u, f, null), Vm(d, f), Qt = m;
})(il(n, Fr), l, n, i);
}
const a = n.__format;
a !== 0 && jm(i, a), n.isInline() || $m(null, n, i), Yl(n) && (Dt += Nn, Sn += Nn);
} else {
const s = n.getTextContent();
if (st(n)) {
const o = n.decorate(tr, ni);
o !== null && Hm(r, o), i.contentEditable = "false";
} else X(n) && (n.isDirectionless() || (Qt += s));
Dt += s, Sn += s;
}
if (e !== null) if (t != null) e.insertBefore(i, t);
else {
const s = e.__lexicalLineBreak;
s != null ? e.insertBefore(i, s) : e.appendChild(i);
}
return Yu(xo, bo, Ql, n, "created"), i;
}
function Pc(r, e, t, n, i, s) {
const o = Dt;
Dt = "";
let a = t;
for (; a <= n; ++a) {
nl(r[a], i, s);
const l = Fr.get(r[a]);
l !== null && Dr === null && X(l) && (Dr = l.getFormat());
}
Yl(e) && (Dt += Nn), i.__lexicalTextContent = Dt, Dt = o + Dt;
}
function Lf(r, e) {
const t = e.get(r);
return tn(t) || st(t) && t.isInline();
}
function $m(r, e, t) {
const n = r !== null && (r.__size === 0 || Lf(r.__last, Oi)), i = e.__size === 0 || Lf(e.__last, Fr);
if (n) {
if (!i) {
const s = t.__lexicalLineBreak;
s != null && t.removeChild(s), t.__lexicalLineBreak = null;
}
} else if (i) {
const s = document.createElement("br");
t.__lexicalLineBreak = s, t.appendChild(s);
}
}
function Vm(r, e) {
const t = e.__lexicalDirTextContent, n = e.__lexicalDir;
if (t !== Qt || n !== Fa) {
const s = Qt === "", o = s ? Fa : (i = Qt, zv.test(i) ? "rtl" : Dv.test(i) ? "ltr" : null);
if (o !== n) {
const a = e.classList, l = ni.theme;
let c = n !== null ? l[n] : void 0, u = o !== null ? l[o] : void 0;
if (c !== void 0) {
if (typeof c == "string") {
const d = Ja(c);
c = l[n] = d;
}
a.remove(...c);
}
if (o === null || s && o === "ltr") e.removeAttribute("dir");
else {
if (u !== void 0) {
if (typeof u == "string") {
const d = Ja(u);
u = l[o] = d;
}
u !== void 0 && a.add(...u);
}
e.dir = o;
}
Ju || (r.getWritable().__dir = o);
}
Fa = o, e.__lexicalDirTextContent = Qt, e.__lexicalDir = o;
}
var i;
}
function e3(r, e, t) {
const n = Qt;
var i;
Qt = "", Dr = null, function(s, o, a) {
const l = Dt, c = s.__size, u = o.__size;
if (Dt = "", c === 1 && u === 1) {
const d = s.__first, f = o.__first;
if (d === f) Qs(d, a);
else {
const p = Ic(d), v = nl(f, null, null);
a.replaceChild(v, p), rl(d, null);
}
const m = Fr.get(f);
Dr === null && X(m) && (Dr = m.getFormat());
} else {
const d = il(s, Oi), f = il(o, Fr);
if (c === 0) u !== 0 && Pc(f, o, 0, u - 1, a, null);
else if (u === 0) {
if (c !== 0) {
const m = a.__lexicalLineBreak == null;
Oc(d, 0, c - 1, m ? null : a), m && (a.textContent = "");
}
} else (function(m, p, v, y, _, x) {
const k = y - 1, T = _ - 1;
let E, D, z = (V = x, V.firstChild), L = 0, P = 0;
for (var V; L <= k && P <= T; ) {
const $ = p[L], j = v[P];
if ($ === j) z = F0(Qs(j, x)), L++, P++;
else {
E === void 0 && (E = new Set(p)), D === void 0 && (D = new Set(v));
const U = D.has($), Z = E.has(j);
if (U) if (Z) {
const oe = tl(tr, j);
oe === z ? z = F0(Qs(j, x)) : (z != null ? x.insertBefore(oe, z) : x.appendChild(oe), Qs(j, x)), L++, P++;
} else nl(j, x, z), P++;
else z = F0(Ic($)), rl($, x), L++;
}
const q = Fr.get(j);
q !== null && Dr === null && X(q) && (Dr = q.getFormat());
}
const re = L > k, I = P > T;
if (re && !I) {
const $ = v[T + 1];
Pc(v, m, P, T, x, $ === void 0 ? null : tr.getElementByKey($));
} else I && !re && Oc(p, L, k, x);
})(o, d, f, c, u, a);
}
Yl(o) && (Dt += Nn), a.__lexicalTextContent = Dt, Dt = l + Dt;
}(r, e, t), Vm(e, t), ii(i = e) && Dr != null && Dr !== i.__textFormat && i.setTextFormat(Dr), Qt = n, Dr = null;
}
function il(r, e) {
const t = [];
let n = r.__first;
for (; n !== null; ) {
const i = e.get(n);
i === void 0 && he(101), t.push(n), n = i.__next;
}
return t;
}
function Qs(r, e) {
const t = Oi.get(r);
let n = Fr.get(r);
t !== void 0 && n !== void 0 || he(61);
const i = Fm || zc.has(r) || Rc.has(r), s = tl(tr, r);
if (t === n && !i) {
if (W(t)) {
const o = s.__lexicalTextContent;
o !== void 0 && (Dt += o, Sn += o);
const a = s.__lexicalDirTextContent;
a !== void 0 && (Qt += a);
} else {
const o = t.getTextContent();
X(t) && !t.isDirectionless() && (Qt += o), Sn += o, Dt += o;
}
return s;
}
if (t !== n && i && Yu(xo, bo, Ql, n, "updated"), n.updateDOM(t, s, ni)) {
const o = nl(r, null, null);
return e === null && he(62), e.replaceChild(o, s), rl(r, null), o;
}
if (W(t) && W(n)) {
const o = n.__indent;
o !== t.__indent && Bm(s, o);
const a = n.__format;
a !== t.__format && jm(s, a), i && (e3(t, n, s), Ht(n) || n.isInline() || $m(t, n, s)), Yl(n) && (Dt += Nn, Sn += Nn);
} else {
const o = n.getTextContent();
if (st(n)) {
const a = n.decorate(tr, ni);
a !== null && Hm(r, a);
} else X(n) && !n.isDirectionless() && (Qt += o);
Dt += o, Sn += o;
}
if (!Ju && Ht(n) && n.__cachedText !== Sn) {
const o = n.getWritable();
o.__cachedText = Sn, n = o;
}
return s;
}
function Hm(r, e) {
let t = tr._pendingDecorators;
const n = tr._decorators;
if (t === null) {
if (n[r] === e) return;
t = Rm(tr);
}
t[r] = e;
}
function F0(r) {
let e = r.nextSibling;
return e !== null && e === tr._blockCursorElement && (e = e.nextSibling), e;
}
function t3(r, e, t, n, i, s) {
Dt = "", Sn = "", Qt = "", Fm = n === ys, Fa = null, tr = t, ni = t._config, bo = t._nodes, Ql = tr._listeners.mutation, Rc = i, zc = s, Oi = r._nodeMap, Fr = e._nodeMap, Ju = e._readOnly, Dc = new Map(t._keyToDOMMap);
const o = /* @__PURE__ */ new Map();
return xo = o, Qs("root", null), tr = void 0, bo = void 0, Rc = void 0, zc = void 0, Oi = void 0, Fr