@uva-glass/component-library 1.59.2 → 1.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/{Lexical.prod-CO0gPAfo.js → Lexical.prod-qM_1BY0u.js} +961 -952
  2. package/dist/Lexical.prod-qM_1BY0u.js.map +1 -0
  3. package/dist/{LexicalUtils.prod-PbdOb6JG.js → LexicalUtils.prod-BFSPHHi1.js} +20 -20
  4. package/dist/{LexicalUtils.prod-PbdOb6JG.js.map → LexicalUtils.prod-BFSPHHi1.js.map} +1 -1
  5. package/dist/ListPlugin-Bhkh3IBK.js +625 -0
  6. package/dist/ListPlugin-Bhkh3IBK.js.map +1 -0
  7. package/dist/RteEditor.module-Cku3JY-0.js +29 -0
  8. package/dist/RteEditor.module-Cku3JY-0.js.map +1 -0
  9. package/dist/TablePlugin-CLPV2OjO.js +294 -0
  10. package/dist/TablePlugin-CLPV2OjO.js.map +1 -0
  11. package/dist/assets/EditorHeader.css +1 -1
  12. package/dist/assets/Periods.css +1 -1
  13. package/dist/assets/RteEditor.css +1 -1
  14. package/dist/assets/TableCellContextMenu.css +1 -1
  15. package/dist/assets/TablePlugin.css +1 -1
  16. package/dist/components/CheckboxTree/CheckboxTree.js +2 -2
  17. package/dist/components/InputField/InputField.stories.js +2 -2
  18. package/dist/components/MultiSelect/MultiSelect.js +1 -1
  19. package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
  20. package/dist/components/MultiSelect/components/MultiSelectHeader.js +2 -2
  21. package/dist/components/MultiSelect/index.js +1 -1
  22. package/dist/components/Periods/Periods.js +19 -19
  23. package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +2 -2
  24. package/dist/components/RteEditor/EditorHeader/EditorHeader.js +19 -19
  25. package/dist/components/RteEditor/EditorHeader/EditorHeader.js.map +1 -1
  26. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.d.ts +1 -6
  27. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +34 -20
  28. package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js.map +1 -1
  29. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +36 -31
  30. package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js.map +1 -1
  31. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.d.ts +3 -3
  32. package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkFrom.js +4 -4
  33. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.d.ts +7 -6
  34. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +157 -54
  35. package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js.map +1 -1
  36. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.d.ts +1 -3
  37. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +5 -6
  38. package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js.map +1 -1
  39. package/dist/components/RteEditor/Plugins/LinkPlugin/index.js +3 -2
  40. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.d.ts +1 -6
  41. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +10 -31
  42. package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js.map +1 -1
  43. package/dist/components/RteEditor/Plugins/ListPlugin/index.js +1 -1
  44. package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +2 -2
  45. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.d.ts +2 -1
  46. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js +104 -31
  47. package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/TableCellContextMenu.js.map +1 -1
  48. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +6 -5
  49. package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js.map +1 -1
  50. package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +1 -1
  51. package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
  52. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.d.ts +6 -7
  53. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +42 -46
  54. package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js.map +1 -1
  55. package/dist/components/RteEditor/Plugins/index.js +13 -12
  56. package/dist/components/RteEditor/RteEditor.d.ts +13 -4
  57. package/dist/components/RteEditor/RteEditor.js +593 -601
  58. package/dist/components/RteEditor/RteEditor.js.map +1 -1
  59. package/dist/components/RteEditor/UvaTheme/UvaTheme.js +1 -1
  60. package/dist/components/RteEditor/hooks/components/Flyout.js.map +1 -1
  61. package/dist/components/RteEditor/hooks/useTranslation.d.ts +98 -6
  62. package/dist/components/RteEditor/translations.d.ts +98 -6
  63. package/dist/components/RteEditor/translations.js +104 -12
  64. package/dist/components/RteEditor/translations.js.map +1 -1
  65. package/dist/components/index.js +1 -1
  66. package/dist/{helpers-Ec7CfNnA.js → helpers-BB6Byf50.js} +92 -103
  67. package/dist/helpers-BB6Byf50.js.map +1 -0
  68. package/dist/{helpers-BewZrn6E.js → helpers-D9T1Tgkj.js} +581 -515
  69. package/dist/helpers-D9T1Tgkj.js.map +1 -0
  70. package/dist/index.js +1 -1
  71. package/package.json +9 -9
  72. package/dist/Lexical.prod-CO0gPAfo.js.map +0 -1
  73. package/dist/LexicalList.prod-BceA-cJD.js +0 -562
  74. package/dist/LexicalList.prod-BceA-cJD.js.map +0 -1
  75. package/dist/RteEditor.module-Dz9a8vaK.js +0 -29
  76. package/dist/RteEditor.module-Dz9a8vaK.js.map +0 -1
  77. package/dist/TablePlugin-Cj6IBz2k.js +0 -249
  78. package/dist/TablePlugin-Cj6IBz2k.js.map +0 -1
  79. package/dist/helpers-BewZrn6E.js.map +0 -1
  80. package/dist/helpers-Ec7CfNnA.js.map +0 -1
@@ -1,13 +1,13 @@
1
- function Hi(n) {
1
+ function qi(n) {
2
2
  return {};
3
3
  }
4
- const bn = {}, qi = {}, Ls = {}, yt = {}, gt = {}, Zn = {}, He = {}, zr = {}, Gn = {}, mt = {}, xt = {}, we = {}, Br = {}, Rr = {}, Os = {}, Is = {}, As = {}, Ms = {}, Ws = {}, zs = {}, Bs = {}, fn = {}, Rs = {}, Ks = {}, Js = {}, $s = {}, Us = {}, Qi = {}, Xi = {}, Zi = {}, Vs = {}, Gi = {}, js = {}, Hs = {}, qs = {}, Kr = {}, Jr = {}, Yn = {}, Yi = {}, eo = {}, to = {}, no = {}, Qs = {}, Xs = {}, Zs = {}, ne = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Gs = ne && "documentMode" in document ? document.documentMode : null, Y = ne && /Mac|iPod|iPhone|iPad/.test(navigator.platform), xe = ne && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), vt = !(!ne || !("InputEvent" in window) || Gs) && "getTargetRanges" in new window.InputEvent("input"), wn = ne && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), It = ne && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Ys = ne && /Android/.test(navigator.userAgent), $r = ne && /^(?=.*Chrome).*/i.test(navigator.userAgent), ei = ne && Ys && $r, Nn = ne && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !$r, rt = 1, Te = 3, Ee = 0, Ur = 1, Me = 2, ti = 0, ni = 1, ri = 2, St = 4, Tt = 8, En = 128, si = 112 | (3 | St | Tt) | En, Pn = 1, Fn = 2, Dn = 3, Ln = 4, On = 5, In = 6, At = wn || It || Nn ? " " : "​", ae = `
4
+ const wn = {}, Qi = {}, Ls = {}, yt = {}, gt = {}, Yn = {}, He = {}, Wr = {}, Gn = {}, mt = {}, xt = {}, we = {}, Br = {}, Rr = {}, Os = {}, Is = {}, As = {}, Ms = {}, zs = {}, Ws = {}, Bs = {}, dn = {}, Rs = {}, Ks = {}, $s = {}, Js = {}, Us = {}, Xi = {}, Yi = {}, Gi = {}, Vs = {}, Zi = {}, js = {}, Hs = {}, qs = {}, Kr = {}, $r = {}, Zn = {}, eo = {}, to = {}, no = {}, ro = {}, Qs = {}, Xs = {}, Ys = {}, ne = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, Gs = ne && "documentMode" in document ? document.documentMode : null, Z = ne && /Mac|iPod|iPhone|iPad/.test(navigator.platform), xe = ne && /^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent), vt = !(!ne || !("InputEvent" in window) || Gs) && "getTargetRanges" in new window.InputEvent("input"), Nn = ne && /Version\/[\d.]+.*Safari/.test(navigator.userAgent), It = ne && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream, Zs = ne && /Android/.test(navigator.userAgent), Jr = ne && /^(?=.*Chrome).*/i.test(navigator.userAgent), ei = ne && Zs && Jr, En = ne && /AppleWebKit\/[\d.]+/.test(navigator.userAgent) && !Jr, rt = 1, Te = 3, Ee = 0, Ur = 1, Me = 2, ti = 0, ni = 1, ri = 2, St = 4, Tt = 8, Pn = 128, si = 112 | (3 | St | Tt) | Pn, Fn = 1, Dn = 2, Ln = 3, On = 4, In = 5, An = 6, At = Nn || It || En ? " " : "​", ae = `
5
5
 
6
- `, ii = xe ? " " : At, Vr = "֑-߿יִ-﷽ﹰ-ﻼ", jr = "A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿", oi = new RegExp("^[^" + jr + "]*[" + Vr + "]"), li = new RegExp("^[^" + Vr + "]*[" + jr + "]"), ce = { bold: 1, code: 16, highlight: En, italic: 2, strikethrough: St, subscript: 32, superscript: 64, underline: Tt }, ci = { directionless: 1, unmergeable: 2 }, er = { center: Fn, end: In, justify: Ln, left: Pn, right: Dn, start: On }, ai = { [Fn]: "center", [In]: "end", [Ln]: "justify", [Pn]: "left", [Dn]: "right", [On]: "start" }, ui = { normal: 0, segmented: 2, token: 1 }, fi = { [ti]: "normal", [ri]: "segmented", [ni]: "token" };
6
+ `, ii = xe ? " " : At, Vr = "֑-߿יִ-﷽ﹰ-ﻼ", jr = "A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿", oi = new RegExp("^[^" + jr + "]*[" + Vr + "]"), li = new RegExp("^[^" + Vr + "]*[" + jr + "]"), ce = { bold: 1, code: 16, highlight: Pn, italic: 2, strikethrough: St, subscript: 32, superscript: 64, underline: Tt }, ci = { directionless: 1, unmergeable: 2 }, er = { center: Dn, end: An, justify: On, left: Fn, right: Ln, start: In }, ai = { [Dn]: "center", [An]: "end", [On]: "justify", [Fn]: "left", [Ln]: "right", [In]: "start" }, ui = { normal: 0, segmented: 2, token: 1 }, fi = { [ti]: "normal", [ri]: "segmented", [ni]: "token" };
7
7
  function di(n) {
8
8
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
9
9
  }
10
- var k = di(function(n) {
10
+ var b = di(function(n) {
11
11
  const e = new URLSearchParams();
12
12
  e.append("code", n);
13
13
  for (let t = 1; t < arguments.length; t++) e.append("v", arguments[t]);
@@ -19,11 +19,11 @@ function Ct(...n) {
19
19
  return e;
20
20
  }
21
21
  const hi = 100;
22
- let dn = !1, An = 0;
22
+ let hn = !1, Mn = 0;
23
23
  function gi(n) {
24
- An = n.timeStamp;
24
+ Mn = n.timeStamp;
25
25
  }
26
- function en(n, e, t) {
26
+ function tn(n, e, t) {
27
27
  return e.__lexicalLineBreak === n || n[`__lexicalKey_${t._key}`] !== void 0;
28
28
  }
29
29
  function _i(n, e, t) {
@@ -31,7 +31,7 @@ function _i(n, e, t) {
31
31
  let s = null, i = null;
32
32
  r !== null && r.anchorNode === n && (s = r.anchorOffset, i = r.focusOffset);
33
33
  const o = n.nodeValue;
34
- o !== null && Bn(e, o, s, i, !1);
34
+ o !== null && Rn(e, o, s, i, !1);
35
35
  }
36
36
  function pi(n, e, t) {
37
37
  if (F(n)) {
@@ -41,70 +41,70 @@ function pi(n, e, t) {
41
41
  return e.nodeType === Te && t.isAttached();
42
42
  }
43
43
  function Hr(n, e, t) {
44
- dn = !0;
45
- const r = performance.now() - An > hi;
44
+ hn = !0;
45
+ const r = performance.now() - Mn > hi;
46
46
  try {
47
47
  X(n, () => {
48
- const s = I() || function(u) {
49
- return u.getEditorState().read(() => {
48
+ const s = I() || function(f) {
49
+ return f.getEditorState().read(() => {
50
50
  const d = I();
51
51
  return d !== null ? d.clone() : null;
52
52
  });
53
53
  }(n), i = /* @__PURE__ */ new Map(), o = n.getRootElement(), l = n._editorState, c = n._blockCursorElement;
54
- let a = !1, f = "";
55
- for (let u = 0; u < e.length; u++) {
56
- const d = e[u], g = d.type, p = d.target;
57
- let _ = zt(p, l);
54
+ let a = !1, u = "";
55
+ for (let f = 0; f < e.length; f++) {
56
+ const d = e[f], g = d.type, p = d.target;
57
+ let _ = Wt(p, l);
58
58
  if (!(_ === null && p !== o || A(_))) {
59
59
  if (g === "characterData") r && N(_) && pi(s, p, _) && _i(p, _, n);
60
60
  else if (g === "childList") {
61
61
  a = !0;
62
62
  const m = d.addedNodes;
63
- for (let C = 0; C < m.length; C++) {
64
- const b = m[C], v = Yr(b), P = b.parentNode;
65
- if (P != null && b !== c && v === null && (b.nodeName !== "BR" || !en(b, P, n))) {
63
+ for (let k = 0; k < m.length; k++) {
64
+ const T = m[k], x = Zr(T), P = T.parentNode;
65
+ if (P != null && T !== c && x === null && (T.nodeName !== "BR" || !tn(T, P, n))) {
66
66
  if (xe) {
67
- const T = b.innerText || b.nodeValue;
68
- T && (f += T);
67
+ const C = T.innerText || T.nodeValue;
68
+ C && (u += C);
69
69
  }
70
- P.removeChild(b);
70
+ P.removeChild(T);
71
71
  }
72
72
  }
73
- const y = d.removedNodes, x = y.length;
74
- if (x > 0) {
75
- let C = 0;
76
- for (let b = 0; b < x; b++) {
77
- const v = y[b];
78
- (v.nodeName === "BR" && en(v, p, n) || c === v) && (p.appendChild(v), C++);
73
+ const y = d.removedNodes, S = y.length;
74
+ if (S > 0) {
75
+ let k = 0;
76
+ for (let T = 0; T < S; T++) {
77
+ const x = y[T];
78
+ (x.nodeName === "BR" && tn(x, p, n) || c === x) && (p.appendChild(x), k++);
79
79
  }
80
- x !== C && (p === o && (_ = ts(l)), i.set(p, _));
80
+ S !== k && (p === o && (_ = ts(l)), i.set(p, _));
81
81
  }
82
82
  }
83
83
  }
84
84
  }
85
- if (i.size > 0) for (const [u, d] of i) if (S(d)) {
85
+ if (i.size > 0) for (const [f, d] of i) if (v(d)) {
86
86
  const g = d.getChildrenKeys();
87
- let p = u.firstChild;
87
+ let p = f.firstChild;
88
88
  for (let _ = 0; _ < g.length; _++) {
89
89
  const m = g[_], y = n.getElementByKey(m);
90
- y !== null && (p == null ? (u.appendChild(y), p = y) : p !== y && u.replaceChild(y, p), p = p.nextSibling);
90
+ y !== null && (p == null ? (f.appendChild(y), p = y) : p !== y && f.replaceChild(y, p), p = p.nextSibling);
91
91
  }
92
92
  } else N(d) && d.markDirty();
93
93
  const h = t.takeRecords();
94
94
  if (h.length > 0) {
95
- for (let u = 0; u < h.length; u++) {
96
- const d = h[u], g = d.addedNodes, p = d.target;
95
+ for (let f = 0; f < h.length; f++) {
96
+ const d = h[f], g = d.addedNodes, p = d.target;
97
97
  for (let _ = 0; _ < g.length; _++) {
98
98
  const m = g[_], y = m.parentNode;
99
- y == null || m.nodeName !== "BR" || en(m, p, n) || y.removeChild(m);
99
+ y == null || m.nodeName !== "BR" || tn(m, p, n) || y.removeChild(m);
100
100
  }
101
101
  }
102
102
  t.takeRecords();
103
103
  }
104
- s !== null && (a && (s.dirty = !0, ue(s)), xe && is(n) && s.insertRawText(f));
104
+ s !== null && (a && (s.dirty = !0, ue(s)), xe && is(n) && s.insertRawText(u));
105
105
  });
106
106
  } finally {
107
- dn = !1;
107
+ hn = !1;
108
108
  }
109
109
  }
110
110
  function qr(n) {
@@ -113,7 +113,7 @@ function qr(n) {
113
113
  }
114
114
  function Qr(n) {
115
115
  (function(e) {
116
- An === 0 && Kt(e).addEventListener("textInput", gi, !0);
116
+ Mn === 0 && Kt(e).addEventListener("textInput", gi, !0);
117
117
  })(n), n._observer = new MutationObserver((e, t) => {
118
118
  Hr(n, e, t);
119
119
  });
@@ -162,7 +162,7 @@ function sr(n) {
162
162
  n.set(r.__key, s ? r.getTextContentSize() : 0, "text");
163
163
  break;
164
164
  }
165
- if (!S(r)) break;
165
+ if (!v(r)) break;
166
166
  n.set(r.__key, s ? r.getChildrenSize() : 0, "element");
167
167
  }
168
168
  }
@@ -174,29 +174,29 @@ function Xr(n) {
174
174
  const e = document.activeElement;
175
175
  if (e === null) return !1;
176
176
  const t = e.nodeName;
177
- return A(zt(n)) && (t === "INPUT" || t === "TEXTAREA" || e.contentEditable === "true" && Wt(e) == null);
177
+ return A(Wt(n)) && (t === "INPUT" || t === "TEXTAREA" || e.contentEditable === "true" && zt(e) == null);
178
178
  }
179
179
  function Mt(n, e, t) {
180
180
  const r = n.getRootElement();
181
181
  try {
182
- return r !== null && r.contains(e) && r.contains(t) && e !== null && !Xr(e) && Zr(e) === n;
182
+ return r !== null && r.contains(e) && r.contains(t) && e !== null && !Xr(e) && Yr(e) === n;
183
183
  } catch {
184
184
  return !1;
185
185
  }
186
186
  }
187
- function Mn(n) {
188
- return n instanceof Xt;
187
+ function zn(n) {
188
+ return n instanceof Yt;
189
189
  }
190
- function Zr(n) {
190
+ function Yr(n) {
191
191
  let e = n;
192
192
  for (; e != null; ) {
193
- const t = Wt(e);
194
- if (Mn(t)) return t;
193
+ const t = zt(e);
194
+ if (zn(t)) return t;
195
195
  e = Rt(e);
196
196
  }
197
197
  return null;
198
198
  }
199
- function Wt(n) {
199
+ function zt(n) {
200
200
  return n ? n.__lexicalEditor : null;
201
201
  }
202
202
  function be(n) {
@@ -219,14 +219,14 @@ function bt(n, e, t) {
219
219
  let s = n ^ r;
220
220
  return e === "subscript" ? s &= ~ce.superscript : e === "superscript" && (s &= ~ce.subscript), s;
221
221
  }
222
- function ro(n) {
222
+ function so(n) {
223
223
  return N(n) || Ae(n) || A(n);
224
224
  }
225
225
  function Gr(n, e) {
226
226
  if (e != null) return void (n.__key = e);
227
227
  q(), bs();
228
228
  const t = M(), r = fe(), s = "" + mi++;
229
- r._nodeMap.set(s, n), S(n) ? t._dirtyElements.set(s, !0) : t._dirtyLeaves.add(s), t._cloneNotNeeded.add(s), t._dirtyType = Ur, n.__key = s;
229
+ r._nodeMap.set(s, n), v(n) ? t._dirtyElements.set(s, !0) : t._dirtyLeaves.add(s), t._cloneNotNeeded.add(s), t._dirtyType = Ur, n.__key = s;
230
230
  }
231
231
  function Ne(n) {
232
232
  const e = n.getParent();
@@ -262,19 +262,19 @@ function Ne(n) {
262
262
  function wt(n) {
263
263
  bs();
264
264
  const e = n.getLatest(), t = e.__parent, r = fe(), s = M(), i = r._nodeMap, o = s._dirtyElements;
265
- t !== null && function(c, a, f) {
265
+ t !== null && function(c, a, u) {
266
266
  let h = c;
267
267
  for (; h !== null; ) {
268
- if (f.has(h)) return;
269
- const u = a.get(h);
270
- if (u === void 0) break;
271
- f.set(h, !1), h = u.__parent;
268
+ if (u.has(h)) return;
269
+ const f = a.get(h);
270
+ if (f === void 0) break;
271
+ u.set(h, !1), h = f.__parent;
272
272
  }
273
273
  }(t, i, o);
274
274
  const l = e.__key;
275
- s._dirtyType = Ur, S(n) ? o.set(l, !0) : s._dirtyLeaves.add(l);
275
+ s._dirtyType = Ur, v(n) ? o.set(l, !0) : s._dirtyLeaves.add(l);
276
276
  }
277
- function $(n) {
277
+ function J(n) {
278
278
  q();
279
279
  const e = M(), t = e._compositionKey;
280
280
  if (n !== t) {
@@ -295,14 +295,14 @@ function V(n, e) {
295
295
  const t = (e || fe())._nodeMap.get(n);
296
296
  return t === void 0 ? null : t;
297
297
  }
298
- function Yr(n, e) {
298
+ function Zr(n, e) {
299
299
  const t = n[`__lexicalKey_${M()._key}`];
300
300
  return t !== void 0 ? V(t, e) : null;
301
301
  }
302
- function zt(n, e) {
302
+ function Wt(n, e) {
303
303
  let t = n;
304
304
  for (; t != null; ) {
305
- const r = Yr(t, e);
305
+ const r = Zr(t, e);
306
306
  if (r !== null) return r;
307
307
  t = Rt(t);
308
308
  }
@@ -356,24 +356,24 @@ function rs() {
356
356
  function ss(n) {
357
357
  return n.nodeType === Te ? n.nodeValue : null;
358
358
  }
359
- function zn(n, e, t) {
359
+ function Bn(n, e, t) {
360
360
  const r = se(e._window);
361
361
  if (r === null) return;
362
362
  const s = r.anchorNode;
363
363
  let { anchorOffset: i, focusOffset: o } = r;
364
364
  if (s !== null) {
365
365
  let l = ss(s);
366
- const c = zt(s);
366
+ const c = Wt(s);
367
367
  if (l !== null && N(c)) {
368
368
  if (l === At && t) {
369
369
  const a = t.length;
370
370
  l = t, i = a, o = a;
371
371
  }
372
- l !== null && Bn(c, l, i, o, n);
372
+ l !== null && Rn(c, l, i, o, n);
373
373
  }
374
374
  }
375
375
  }
376
- function Bn(n, e, t, r, s) {
376
+ function Rn(n, e, t, r, s) {
377
377
  let i = n;
378
378
  if (i.isAttached() && (s || !i.isDirty())) {
379
379
  const o = i.isComposing();
@@ -382,7 +382,7 @@ function Bn(n, e, t, r, s) {
382
382
  const c = i.getTextContent();
383
383
  if (s || l !== c) {
384
384
  if (l === "") {
385
- if ($(null), wn || It || Nn) i.remove();
385
+ if (J(null), Nn || It || En) i.remove();
386
386
  else {
387
387
  const p = M();
388
388
  setTimeout(() => {
@@ -393,12 +393,12 @@ function Bn(n, e, t, r, s) {
393
393
  }
394
394
  return;
395
395
  }
396
- const a = i.getParent(), f = ot(), h = i.getTextContentSize(), u = ye(), d = i.getKey();
397
- if (i.isToken() || u !== null && d === u && !o || F(f) && (a !== null && !a.canInsertTextBefore() && f.anchor.offset === 0 || f.anchor.key === n.__key && f.anchor.offset === 0 && !i.canInsertTextBefore() && !o || f.focus.key === n.__key && f.focus.offset === h && !i.canInsertTextAfter() && !o)) return void i.markDirty();
396
+ const a = i.getParent(), u = ot(), h = i.getTextContentSize(), f = ye(), d = i.getKey();
397
+ if (i.isToken() || f !== null && d === f && !o || F(u) && (a !== null && !a.canInsertTextBefore() && u.anchor.offset === 0 || u.anchor.key === n.__key && u.anchor.offset === 0 && !i.canInsertTextBefore() && !o || u.focus.key === n.__key && u.focus.offset === h && !i.canInsertTextAfter() && !o)) return void i.markDirty();
398
398
  const g = I();
399
399
  if (!F(g) || t === null || r === null) return void i.setTextContent(l);
400
400
  if (g.setTextNodeRange(i, t, i, r), i.isSegmented()) {
401
- const p = J(i.getTextContent());
401
+ const p = $(i.getTextContent());
402
402
  i.replace(p), i = p;
403
403
  }
404
404
  i.setTextContent(l);
@@ -411,7 +411,7 @@ function Si(n, e) {
411
411
  const t = n.anchor.offset, r = e.getParentOrThrow(), s = e.isToken();
412
412
  return t === 0 ? !e.canInsertTextBefore() || !r.canInsertTextBefore() && !e.isComposing() || s || function(i) {
413
413
  const o = i.getPreviousSibling();
414
- return (N(o) || S(o) && o.isInline()) && !o.canInsertTextAfter();
414
+ return (N(o) || v(o) && o.isInline()) && !o.canInsertTextAfter();
415
415
  }(e) : t === e.getTextContentSize() && (!e.canInsertTextAfter() || !r.canInsertTextAfter() && !e.isComposing() || s);
416
416
  }
417
417
  function lr(n) {
@@ -421,7 +421,7 @@ function cr(n) {
421
421
  return n === "ArrowRight";
422
422
  }
423
423
  function Ve(n, e) {
424
- return Y ? n : e;
424
+ return Z ? n : e;
425
425
  }
426
426
  function ar(n) {
427
427
  return n === "Enter";
@@ -429,13 +429,13 @@ function ar(n) {
429
429
  function Ke(n) {
430
430
  return n === "Backspace";
431
431
  }
432
- function Je(n) {
432
+ function $e(n) {
433
433
  return n === "Delete";
434
434
  }
435
435
  function ur(n, e, t) {
436
436
  return n.toLowerCase() === "a" && Ve(e, t);
437
437
  }
438
- function so() {
438
+ function io() {
439
439
  const n = G();
440
440
  ue(yi(n.select(0, n.getChildrenSize())));
441
441
  }
@@ -450,15 +450,15 @@ function qe(n, e) {
450
450
  }
451
451
  return s;
452
452
  }
453
- function Rn(n, e, t, r, s) {
453
+ function Kn(n, e, t, r, s) {
454
454
  if (t.size === 0) return;
455
455
  const i = r.__type, o = r.__key, l = e.get(i);
456
- l === void 0 && k(33, i);
456
+ l === void 0 && b(33, i);
457
457
  const c = l.klass;
458
458
  let a = n.get(c);
459
459
  a === void 0 && (a = /* @__PURE__ */ new Map(), n.set(c, a));
460
- const f = a.get(o), h = f === "destroyed" && s === "created";
461
- (f === void 0 || h) && a.set(o, h ? "updated" : s);
460
+ const u = a.get(o), h = u === "destroyed" && s === "created";
461
+ (u === void 0 || h) && a.set(o, h ? "updated" : s);
462
462
  }
463
463
  function fr(n, e, t) {
464
464
  const r = n.getParent();
@@ -486,11 +486,11 @@ function w(n, e, t) {
486
486
  return Es(n, e, t);
487
487
  }
488
488
  function Bt(n) {
489
- return !Z(n) && !n.isLastChild() && !n.isInline();
489
+ return !Y(n) && !n.isLastChild() && !n.isInline();
490
490
  }
491
491
  function Nt(n, e) {
492
492
  const t = n._keyToDOMMap.get(e);
493
- return t === void 0 && k(75, e), t;
493
+ return t === void 0 && b(75, e), t;
494
494
  }
495
495
  function Rt(n) {
496
496
  const e = n.assignedSlot || n.parentElement;
@@ -506,7 +506,7 @@ function Qe(n, e) {
506
506
  }
507
507
  function Kt(n) {
508
508
  const e = n._window;
509
- return e === null && k(78), e;
509
+ return e === null && b(78), e;
510
510
  }
511
511
  function Ti(n) {
512
512
  let e = n.getParentOrThrow();
@@ -517,29 +517,29 @@ function Ti(n) {
517
517
  return e;
518
518
  }
519
519
  function Pe(n) {
520
- return Z(n) || S(n) && n.isShadowRoot();
520
+ return Y(n) || v(n) && n.isShadowRoot();
521
521
  }
522
522
  function Ci(n) {
523
523
  const e = n.constructor.clone(n);
524
524
  return Gr(e, null), e;
525
525
  }
526
- function Jt(n) {
526
+ function $t(n) {
527
527
  const e = M(), t = n.constructor.getType(), r = e._nodes.get(t);
528
- r === void 0 && k(200, n.constructor.name, t);
528
+ r === void 0 && b(200, n.constructor.name, t);
529
529
  const { replace: s, replaceWithKlass: i } = r;
530
530
  if (s !== null) {
531
531
  const o = s(n), l = o.constructor;
532
- return i !== null ? o instanceof i || k(201, i.name, i.getType(), l.name, l.getType(), n.constructor.name, t) : o instanceof n.constructor && l !== n.constructor || k(202, l.name, l.getType(), n.constructor.name, t), o.__key === n.__key && k(203, n.constructor.name, t, l.name, l.getType()), o;
532
+ return i !== null ? o instanceof i || b(201, i.name, i.getType(), l.name, l.getType(), n.constructor.name, t) : o instanceof n.constructor && l !== n.constructor || b(202, l.name, l.getType(), n.constructor.name, t), o.__key === n.__key && b(203, n.constructor.name, t, l.name, l.getType()), o;
533
533
  }
534
534
  return n;
535
535
  }
536
- function tn(n, e) {
537
- !Z(n.getParent()) || S(e) || A(e) || k(99);
536
+ function nn(n, e) {
537
+ !Y(n.getParent()) || v(e) || A(e) || b(99);
538
538
  }
539
- function nn(n) {
540
- return (A(n) || S(n) && !n.canBeEmpty()) && !n.isInline();
539
+ function rn(n) {
540
+ return (A(n) || v(n) && !n.canBeEmpty()) && !n.isInline();
541
541
  }
542
- function Kn(n, e, t) {
542
+ function $n(n, e, t) {
543
543
  t.style.removeProperty("caret-color"), e._blockCursorElement = null;
544
544
  const r = n.parentElement;
545
545
  r !== null && r.removeChild(n);
@@ -550,56 +550,56 @@ function ki(n, e, t) {
550
550
  const s = t.anchor, i = s.getNode(), o = s.offset;
551
551
  let l = !1, c = null;
552
552
  if (o === i.getChildrenSize())
553
- nn(i.getChildAtIndex(o - 1)) && (l = !0);
553
+ rn(i.getChildAtIndex(o - 1)) && (l = !0);
554
554
  else {
555
555
  const a = i.getChildAtIndex(o);
556
- if (nn(a)) {
557
- const f = a.getPreviousSibling();
558
- (f === null || nn(f)) && (l = !0, c = n.getElementByKey(a.__key));
556
+ if (rn(a)) {
557
+ const u = a.getPreviousSibling();
558
+ (u === null || rn(u)) && (l = !0, c = n.getElementByKey(a.__key));
559
559
  }
560
560
  }
561
561
  if (l) {
562
562
  const a = n.getElementByKey(i.__key);
563
- return r === null && (n._blockCursorElement = r = function(f) {
564
- const h = f.theme, u = document.createElement("div");
565
- u.contentEditable = "false", u.setAttribute("data-lexical-cursor", "true");
563
+ return r === null && (n._blockCursorElement = r = function(u) {
564
+ const h = u.theme, f = document.createElement("div");
565
+ f.contentEditable = "false", f.setAttribute("data-lexical-cursor", "true");
566
566
  let d = h.blockCursor;
567
567
  if (d !== void 0) {
568
568
  if (typeof d == "string") {
569
569
  const g = Ct(d);
570
570
  d = h.blockCursor = g;
571
571
  }
572
- d !== void 0 && u.classList.add(...d);
572
+ d !== void 0 && f.classList.add(...d);
573
573
  }
574
- return u;
574
+ return f;
575
575
  }(n._config)), e.style.caretColor = "transparent", void (c === null ? a.appendChild(r) : a.insertBefore(r, c));
576
576
  }
577
577
  }
578
- r !== null && Kn(r, n, e);
578
+ r !== null && $n(r, n, e);
579
579
  }
580
580
  function se(n) {
581
581
  return ne ? (n || window).getSelection() : null;
582
582
  }
583
- function io(n, e) {
583
+ function oo(n, e) {
584
584
  let t = n.getChildAtIndex(e);
585
- t == null && (t = n), Pe(n) && k(102);
585
+ t == null && (t = n), Pe(n) && b(102);
586
586
  const r = (o) => {
587
587
  const l = o.getParentOrThrow(), c = Pe(l), a = o !== t || c ? Ci(o) : o;
588
- if (c) return S(o) && S(a) || k(133), o.insertAfter(a), [o, a, a];
588
+ if (c) return v(o) && v(a) || b(133), o.insertAfter(a), [o, a, a];
589
589
  {
590
- const [f, h, u] = r(l), d = o.getNextSiblings();
591
- return u.append(a, ...d), [f, h, a];
590
+ const [u, h, f] = r(l), d = o.getNextSiblings();
591
+ return f.append(a, ...d), [u, h, a];
592
592
  }
593
593
  }, [s, i] = r(t);
594
594
  return [s, i];
595
595
  }
596
- function oo(n) {
597
- return Jn(n) && n.tagName === "A";
596
+ function lo(n) {
597
+ return Jt(n) && n.tagName === "A";
598
598
  }
599
- function Jn(n) {
599
+ function Jt(n) {
600
600
  return n.nodeType === 1;
601
601
  }
602
- function lo(n) {
602
+ function co(n) {
603
603
  return n.nodeType === 11;
604
604
  }
605
605
  function bi(n) {
@@ -612,22 +612,22 @@ function hr(n) {
612
612
  }
613
613
  function _e(n) {
614
614
  if (A(n) && !n.isInline()) return !0;
615
- if (!S(n) || Pe(n)) return !1;
615
+ if (!v(n) || Pe(n)) return !1;
616
616
  const e = n.getFirstChild(), t = e === null || Ae(e) || N(e) || e.isInline();
617
617
  return !n.isInline() && n.canBeEmpty() !== !1 && t;
618
618
  }
619
- function $e(n, e) {
619
+ function Je(n, e) {
620
620
  let t = n;
621
621
  for (; t !== null && t.getParent() !== null && !e(t); ) t = t.getParentOrThrow();
622
622
  return e(t) ? t : null;
623
623
  }
624
- function co() {
624
+ function ao() {
625
625
  return M();
626
626
  }
627
627
  const gr = /* @__PURE__ */ new WeakMap(), wi = /* @__PURE__ */ new Map();
628
628
  function Ni(n) {
629
629
  if (!n._readOnly && n.isEmpty()) return wi;
630
- n._readOnly || k(192);
630
+ n._readOnly || b(192);
631
631
  let e = gr.get(n);
632
632
  if (!e) {
633
633
  e = /* @__PURE__ */ new Map(), gr.set(n, e);
@@ -643,27 +643,31 @@ function Ei(n) {
643
643
  const e = n.constructor.clone(n);
644
644
  return e.afterCloneFrom(n), e;
645
645
  }
646
+ function Pi(n, e) {
647
+ const t = (parseInt(n.style.paddingInlineStart, 10) || 0) / 40;
648
+ e.setIndent(t);
649
+ }
646
650
  function os(n, e, t, r, s, i) {
647
651
  let o = n.getFirstChild();
648
652
  for (; o !== null; ) {
649
653
  const l = o.__key;
650
- o.__parent === e && (S(o) && os(o, l, t, r, s, i), t.has(l) || i.delete(l), s.push(l)), o = o.getNextSibling();
654
+ o.__parent === e && (v(o) && os(o, l, t, r, s, i), t.has(l) || i.delete(l), s.push(l)), o = o.getNextSibling();
651
655
  }
652
656
  }
653
- let Se, H, Ye, $t, hn, gn, Fe, te, _n, et, B = "", j = "", re = null, ee = "", le = "", ls = !1, tt = !1, _t = null;
657
+ let Se, H, Ze, Ut, gn, _n, Fe, te, pn, et, B = "", j = "", re = null, ee = "", le = "", ls = !1, tt = !1, _t = null;
654
658
  function Et(n, e) {
655
659
  const t = Fe.get(n);
656
660
  if (e !== null) {
657
- const r = mn(n);
661
+ const r = xn(n);
658
662
  r.parentNode === e && e.removeChild(r);
659
663
  }
660
- if (te.has(n) || H._keyToDOMMap.delete(n), S(t)) {
664
+ if (te.has(n) || H._keyToDOMMap.delete(n), v(t)) {
661
665
  const r = Ft(t, Fe);
662
- pn(r, 0, r.length - 1, null);
666
+ yn(r, 0, r.length - 1, null);
663
667
  }
664
- t !== void 0 && Rn(et, Ye, $t, t, "destroyed");
668
+ t !== void 0 && Kn(et, Ze, Ut, t, "destroyed");
665
669
  }
666
- function pn(n, e, t, r) {
670
+ function yn(n, e, t, r) {
667
671
  let s = e;
668
672
  for (; s <= t; ++s) {
669
673
  const i = n[s];
@@ -673,34 +677,34 @@ function pn(n, e, t, r) {
673
677
  function ke(n, e) {
674
678
  n.setProperty("text-align", e);
675
679
  }
676
- const Pi = "40px";
680
+ const Fi = "40px";
677
681
  function cs(n, e) {
678
682
  const t = Se.theme.indent;
679
683
  if (typeof t == "string") {
680
684
  const s = n.classList.contains(t);
681
685
  e > 0 && !s ? n.classList.add(t) : e < 1 && s && n.classList.remove(t);
682
686
  }
683
- const r = getComputedStyle(n).getPropertyValue("--lexical-indent-base-value") || Pi;
687
+ const r = getComputedStyle(n).getPropertyValue("--lexical-indent-base-value") || Fi;
684
688
  n.style.setProperty("padding-inline-start", e === 0 ? "" : `calc(${e} * ${r})`);
685
689
  }
686
690
  function as(n, e) {
687
691
  const t = n.style;
688
- e === 0 ? ke(t, "") : e === Pn ? ke(t, "left") : e === Fn ? ke(t, "center") : e === Dn ? ke(t, "right") : e === Ln ? ke(t, "justify") : e === On ? ke(t, "start") : e === In && ke(t, "end");
692
+ e === 0 ? ke(t, "") : e === Fn ? ke(t, "left") : e === Dn ? ke(t, "center") : e === Ln ? ke(t, "right") : e === On ? ke(t, "justify") : e === In ? ke(t, "start") : e === An && ke(t, "end");
689
693
  }
690
694
  function Pt(n, e, t) {
691
695
  const r = te.get(n);
692
- r === void 0 && k(60);
696
+ r === void 0 && b(60);
693
697
  const s = r.createDOM(Se, H);
694
698
  if (function(i, o, l) {
695
699
  const c = l._keyToDOMMap;
696
700
  o["__lexicalKey_" + l._key] = i, c.set(i, o);
697
- }(n, s, H), N(r) ? s.setAttribute("data-lexical-text", "true") : A(r) && s.setAttribute("data-lexical-decorator", "true"), S(r)) {
701
+ }(n, s, H), N(r) ? s.setAttribute("data-lexical-text", "true") : A(r) && s.setAttribute("data-lexical-decorator", "true"), v(r)) {
698
702
  const i = r.__indent, o = r.__size;
699
703
  if (i !== 0 && cs(s, i), o !== 0) {
700
704
  const c = o - 1;
701
- (function(a, f, h, u) {
705
+ (function(a, u, h, f) {
702
706
  const d = j;
703
- j = "", yn(a, h, 0, f, u, null), fs(h, u), j = d;
707
+ j = "", mn(a, h, 0, u, f, null), fs(h, f), j = d;
704
708
  })(Ft(r, te), c, r, s);
705
709
  }
706
710
  const l = r.__format;
@@ -718,9 +722,9 @@ function Pt(n, e, t) {
718
722
  const i = e.__lexicalLineBreak;
719
723
  i != null ? e.insertBefore(s, i) : e.appendChild(s);
720
724
  }
721
- return Rn(et, Ye, $t, r, "created"), s;
725
+ return Kn(et, Ze, Ut, r, "created"), s;
722
726
  }
723
- function yn(n, e, t, r, s, i) {
727
+ function mn(n, e, t, r, s, i) {
724
728
  const o = B;
725
729
  B = "";
726
730
  let l = t;
@@ -762,7 +766,7 @@ function fs(n, e) {
762
766
  const i = j === "", o = i ? _t : (s = j, oi.test(s) ? "rtl" : li.test(s) ? "ltr" : null);
763
767
  if (o !== r) {
764
768
  const l = e.classList, c = Se.theme;
765
- let a = r !== null ? c[r] : void 0, f = o !== null ? c[o] : void 0;
769
+ let a = r !== null ? c[r] : void 0, u = o !== null ? c[o] : void 0;
766
770
  if (a !== void 0) {
767
771
  if (typeof a == "string") {
768
772
  const h = Ct(a);
@@ -772,12 +776,12 @@ function fs(n, e) {
772
776
  }
773
777
  if (o === null || i && o === "ltr") e.removeAttribute("dir");
774
778
  else {
775
- if (f !== void 0) {
776
- if (typeof f == "string") {
777
- const h = Ct(f);
778
- f = c[o] = h;
779
+ if (u !== void 0) {
780
+ if (typeof u == "string") {
781
+ const h = Ct(u);
782
+ u = c[o] = h;
779
783
  }
780
- f !== void 0 && l.add(...f);
784
+ u !== void 0 && l.add(...u);
781
785
  }
782
786
  e.dir = o;
783
787
  }
@@ -787,65 +791,65 @@ function fs(n, e) {
787
791
  }
788
792
  var s;
789
793
  }
790
- function Fi(n, e, t) {
794
+ function Di(n, e, t) {
791
795
  const r = j;
792
796
  var s;
793
797
  j = "", re = null, ee = "", function(i, o, l) {
794
- const c = B, a = i.__size, f = o.__size;
795
- if (B = "", a === 1 && f === 1) {
796
- const h = i.__first, u = o.__first;
797
- if (h === u) je(h, l);
798
+ const c = B, a = i.__size, u = o.__size;
799
+ if (B = "", a === 1 && u === 1) {
800
+ const h = i.__first, f = o.__first;
801
+ if (h === f) je(h, l);
798
802
  else {
799
- const g = mn(h), p = Pt(u, null, null);
803
+ const g = xn(h), p = Pt(f, null, null);
800
804
  try {
801
805
  l.replaceChild(p, g);
802
806
  } catch (_) {
803
807
  if (typeof _ == "object" && _ != null) {
804
- const m = `${_.toString()} Parent: ${l.tagName}, new child: {tag: ${p.tagName} key: ${u}}, old child: {tag: ${g.tagName}, key: ${h}}.`;
808
+ const m = `${_.toString()} Parent: ${l.tagName}, new child: {tag: ${p.tagName} key: ${f}}, old child: {tag: ${g.tagName}, key: ${h}}.`;
805
809
  throw new Error(m);
806
810
  }
807
811
  throw _;
808
812
  }
809
813
  Et(h, null);
810
814
  }
811
- const d = te.get(u);
815
+ const d = te.get(f);
812
816
  N(d) && (re === null && (re = d.getFormat()), ee === "" && (ee = d.getStyle()));
813
817
  } else {
814
- const h = Ft(i, Fe), u = Ft(o, te);
815
- if (a === 0) f !== 0 && yn(u, o, 0, f - 1, l, null);
816
- else if (f === 0) {
818
+ const h = Ft(i, Fe), f = Ft(o, te);
819
+ if (a === 0) u !== 0 && mn(f, o, 0, u - 1, l, null);
820
+ else if (u === 0) {
817
821
  if (a !== 0) {
818
822
  const d = l.__lexicalLineBreak == null;
819
- pn(h, 0, a - 1, d ? null : l), d && (l.textContent = "");
823
+ yn(h, 0, a - 1, d ? null : l), d && (l.textContent = "");
820
824
  }
821
825
  } else (function(d, g, p, _, m, y) {
822
- const x = _ - 1, C = m - 1;
823
- let b, v, P = (D = y, D.firstChild), T = 0, E = 0;
824
- for (var D; T <= x && E <= C; ) {
825
- const L = g[T], U = p[E];
826
- if (L === U) P = rn(je(U, y)), T++, E++;
826
+ const S = _ - 1, k = m - 1;
827
+ let T, x, P = (D = y, D.firstChild), C = 0, E = 0;
828
+ for (var D; C <= S && E <= k; ) {
829
+ const L = g[C], U = p[E];
830
+ if (L === U) P = sn(je(U, y)), C++, E++;
827
831
  else {
828
- b === void 0 && (b = new Set(g)), v === void 0 && (v = new Set(p));
829
- const de = v.has(L), De = b.has(U);
832
+ T === void 0 && (T = new Set(g)), x === void 0 && (x = new Set(p));
833
+ const de = x.has(L), De = T.has(U);
830
834
  if (de) if (De) {
831
835
  const Be = Nt(H, U);
832
- Be === P ? P = rn(je(U, y)) : (P != null ? y.insertBefore(Be, P) : y.appendChild(Be), je(U, y)), T++, E++;
836
+ Be === P ? P = sn(je(U, y)) : (P != null ? y.insertBefore(Be, P) : y.appendChild(Be), je(U, y)), C++, E++;
833
837
  } else Pt(U, y, P), E++;
834
- else P = rn(mn(L)), Et(L, y), T++;
838
+ else P = sn(xn(L)), Et(L, y), C++;
835
839
  }
836
- const z = te.get(U);
837
- z !== null && N(z) && (re === null && (re = z.getFormat()), ee === "" && (ee = z.getStyle()));
840
+ const W = te.get(U);
841
+ W !== null && N(W) && (re === null && (re = W.getFormat()), ee === "" && (ee = W.getStyle()));
838
842
  }
839
- const O = T > x, W = E > C;
840
- if (O && !W) {
841
- const L = p[C + 1];
842
- yn(p, d, E, C, y, L === void 0 ? null : H.getElementByKey(L));
843
- } else W && !O && pn(g, T, x, y);
844
- })(o, h, u, a, f, l);
843
+ const O = C > S, z = E > k;
844
+ if (O && !z) {
845
+ const L = p[k + 1];
846
+ mn(p, d, E, k, y, L === void 0 ? null : H.getElementByKey(L));
847
+ } else z && !O && yn(g, C, S, y);
848
+ })(o, h, f, a, u, l);
845
849
  }
846
850
  Bt(o) && (B += ae), l.__lexicalTextContent = B, B = c + B;
847
- }(n, e, t), fs(e, t), kn(s = e) && re != null && re !== s.__textFormat && !tt && (s.setTextFormat(re), s.setTextStyle(ee)), function(i) {
848
- kn(i) && ee !== "" && ee !== i.__textStyle && !tt && i.setTextStyle(ee);
851
+ }(n, e, t), fs(e, t), bn(s = e) && re != null && re !== s.__textFormat && !tt && (s.setTextFormat(re), s.setTextStyle(ee)), function(i) {
852
+ bn(i) && ee !== "" && ee !== i.__textStyle && !tt && i.setTextStyle(ee);
849
853
  }(e), j = r;
850
854
  }
851
855
  function Ft(n, e) {
@@ -853,17 +857,17 @@ function Ft(n, e) {
853
857
  let r = n.__first;
854
858
  for (; r !== null; ) {
855
859
  const s = e.get(r);
856
- s === void 0 && k(101), t.push(r), r = s.__next;
860
+ s === void 0 && b(101), t.push(r), r = s.__next;
857
861
  }
858
862
  return t;
859
863
  }
860
864
  function je(n, e) {
861
865
  const t = Fe.get(n);
862
866
  let r = te.get(n);
863
- t !== void 0 && r !== void 0 || k(61);
864
- const s = ls || gn.has(n) || hn.has(n), i = Nt(H, n);
867
+ t !== void 0 && r !== void 0 || b(61);
868
+ const s = ls || _n.has(n) || gn.has(n), i = Nt(H, n);
865
869
  if (t === r && !s) {
866
- if (S(t)) {
870
+ if (v(t)) {
867
871
  const o = i.__lexicalTextContent;
868
872
  o !== void 0 && (B += o, le += o);
869
873
  const l = i.__lexicalDirTextContent;
@@ -874,15 +878,15 @@ function je(n, e) {
874
878
  }
875
879
  return i;
876
880
  }
877
- if (t !== r && s && Rn(et, Ye, $t, r, "updated"), r.updateDOM(t, i, Se)) {
881
+ if (t !== r && s && Kn(et, Ze, Ut, r, "updated"), r.updateDOM(t, i, Se)) {
878
882
  const o = Pt(n, null, null);
879
- return e === null && k(62), e.replaceChild(o, i), Et(n, null), o;
883
+ return e === null && b(62), e.replaceChild(o, i), Et(n, null), o;
880
884
  }
881
- if (S(t) && S(r)) {
885
+ if (v(t) && v(r)) {
882
886
  const o = r.__indent;
883
887
  o !== t.__indent && cs(i, o);
884
888
  const l = r.__format;
885
- l !== t.__format && as(i, l), s && (Fi(t, r, i), Z(r) || r.isInline() || us(t, r, i)), Bt(r) && (B += ae, le += ae);
889
+ l !== t.__format && as(i, l), s && (Di(t, r, i), Y(r) || r.isInline() || us(t, r, i)), Bt(r) && (B += ae, le += ae);
886
890
  } else {
887
891
  const o = r.getTextContent();
888
892
  if (A(r)) {
@@ -891,7 +895,7 @@ function je(n, e) {
891
895
  } else N(r) && !r.isDirectionless() && (j += o);
892
896
  B += o, le += o;
893
897
  }
894
- if (!tt && Z(r) && r.__cachedText !== le) {
898
+ if (!tt && Y(r) && r.__cachedText !== le) {
895
899
  const o = r.getWritable();
896
900
  o.__cachedText = le, r = o;
897
901
  }
@@ -906,109 +910,109 @@ function ds(n, e) {
906
910
  }
907
911
  t[n] = e;
908
912
  }
909
- function rn(n) {
913
+ function sn(n) {
910
914
  let e = n.nextSibling;
911
915
  return e !== null && e === H._blockCursorElement && (e = e.nextSibling), e;
912
916
  }
913
- function Di(n, e, t, r, s, i) {
914
- B = "", le = "", j = "", ls = r === Me, _t = null, H = t, Se = t._config, Ye = t._nodes, $t = H._listeners.mutation, hn = s, gn = i, Fe = n._nodeMap, te = e._nodeMap, tt = e._readOnly, _n = new Map(t._keyToDOMMap);
917
+ function Li(n, e, t, r, s, i) {
918
+ B = "", le = "", j = "", ls = r === Me, _t = null, H = t, Se = t._config, Ze = t._nodes, Ut = H._listeners.mutation, gn = s, _n = i, Fe = n._nodeMap, te = e._nodeMap, tt = e._readOnly, pn = new Map(t._keyToDOMMap);
915
919
  const o = /* @__PURE__ */ new Map();
916
- return et = o, je("root", null), H = void 0, Ye = void 0, hn = void 0, gn = void 0, Fe = void 0, te = void 0, Se = void 0, _n = void 0, et = void 0, o;
920
+ return et = o, je("root", null), H = void 0, Ze = void 0, gn = void 0, _n = void 0, Fe = void 0, te = void 0, Se = void 0, pn = void 0, et = void 0, o;
917
921
  }
918
- function mn(n) {
919
- const e = _n.get(n);
920
- return e === void 0 && k(75, n), e;
922
+ function xn(n) {
923
+ const e = pn.get(n);
924
+ return e === void 0 && b(75, n), e;
921
925
  }
922
- const oe = Object.freeze({}), xn = 30, vn = [["keydown", function(n, e) {
926
+ const oe = Object.freeze({}), vn = 30, Sn = [["keydown", function(n, e) {
923
927
  if (Xe = n.timeStamp, hs = n.key, e.isComposing()) return;
924
928
  const { key: t, shiftKey: r, ctrlKey: s, metaKey: i, altKey: o } = n;
925
- w(e, Os, n) || t != null && (function(l, c, a, f) {
926
- return cr(l) && !c && !f && !a;
927
- }(t, s, o, i) ? w(e, Is, n) : function(l, c, a, f, h) {
928
- return cr(l) && !f && !a && (c || h);
929
- }(t, s, r, o, i) ? w(e, As, n) : function(l, c, a, f) {
930
- return lr(l) && !c && !f && !a;
931
- }(t, s, o, i) ? w(e, Ms, n) : function(l, c, a, f, h) {
932
- return lr(l) && !f && !a && (c || h);
933
- }(t, s, r, o, i) ? w(e, Ws, n) : /* @__PURE__ */ function(l, c, a) {
934
- return /* @__PURE__ */ function(f) {
935
- return f === "ArrowUp";
929
+ w(e, Os, n) || t != null && (function(l, c, a, u) {
930
+ return cr(l) && !c && !u && !a;
931
+ }(t, s, o, i) ? w(e, Is, n) : function(l, c, a, u, h) {
932
+ return cr(l) && !u && !a && (c || h);
933
+ }(t, s, r, o, i) ? w(e, As, n) : function(l, c, a, u) {
934
+ return lr(l) && !c && !u && !a;
935
+ }(t, s, o, i) ? w(e, Ms, n) : function(l, c, a, u, h) {
936
+ return lr(l) && !u && !a && (c || h);
937
+ }(t, s, r, o, i) ? w(e, zs, n) : /* @__PURE__ */ function(l, c, a) {
938
+ return /* @__PURE__ */ function(u) {
939
+ return u === "ArrowUp";
936
940
  }(l) && !c && !a;
937
- }(t, s, i) ? w(e, zs, n) : /* @__PURE__ */ function(l, c, a) {
938
- return /* @__PURE__ */ function(f) {
939
- return f === "ArrowDown";
941
+ }(t, s, i) ? w(e, Ws, n) : /* @__PURE__ */ function(l, c, a) {
942
+ return /* @__PURE__ */ function(u) {
943
+ return u === "ArrowDown";
940
944
  }(l) && !c && !a;
941
945
  }(t, s, i) ? w(e, Bs, n) : function(l, c) {
942
946
  return ar(l) && c;
943
- }(t, r) ? (Ze = !0, w(e, fn, n)) : /* @__PURE__ */ function(l) {
947
+ }(t, r) ? (Ye = !0, w(e, dn, n)) : /* @__PURE__ */ function(l) {
944
948
  return l === " ";
945
949
  }(t) ? w(e, Rs, n) : function(l, c) {
946
- return Y && c && l.toLowerCase() === "o";
947
- }(t, s) ? (n.preventDefault(), Ze = !0, w(e, gt, !0)) : function(l, c) {
950
+ return Z && c && l.toLowerCase() === "o";
951
+ }(t, s) ? (n.preventDefault(), Ye = !0, w(e, gt, !0)) : function(l, c) {
948
952
  return ar(l) && !c;
949
- }(t, r) ? (Ze = !1, w(e, fn, n)) : function(l, c, a, f) {
950
- return Y ? !c && !a && (Ke(l) || l.toLowerCase() === "h" && f) : !(f || c || a) && Ke(l);
953
+ }(t, r) ? (Ye = !1, w(e, dn, n)) : function(l, c, a, u) {
954
+ return Z ? !c && !a && (Ke(l) || l.toLowerCase() === "h" && u) : !(u || c || a) && Ke(l);
951
955
  }(t, o, i, s) ? Ke(t) ? w(e, Ks, n) : (n.preventDefault(), w(e, yt, !0)) : /* @__PURE__ */ function(l) {
952
956
  return l === "Escape";
953
- }(t) ? w(e, Js, n) : function(l, c, a, f, h) {
954
- return Y ? !(a || f || h) && (Je(l) || l.toLowerCase() === "d" && c) : !(c || f || h) && Je(l);
955
- }(t, s, r, o, i) ? Je(t) ? w(e, $s, n) : (n.preventDefault(), w(e, yt, !1)) : function(l, c, a) {
956
- return Ke(l) && (Y ? c : a);
957
+ }(t) ? w(e, $s, n) : function(l, c, a, u, h) {
958
+ return Z ? !(a || u || h) && ($e(l) || l.toLowerCase() === "d" && c) : !(c || u || h) && $e(l);
959
+ }(t, s, r, o, i) ? $e(t) ? w(e, Js, n) : (n.preventDefault(), w(e, yt, !1)) : function(l, c, a) {
960
+ return Ke(l) && (Z ? c : a);
957
961
  }(t, o, s) ? (n.preventDefault(), w(e, mt, !0)) : function(l, c, a) {
958
- return Je(l) && (Y ? c : a);
962
+ return $e(l) && (Z ? c : a);
959
963
  }(t, o, s) ? (n.preventDefault(), w(e, mt, !1)) : function(l, c) {
960
- return Y && c && Ke(l);
964
+ return Z && c && Ke(l);
961
965
  }(t, i) ? (n.preventDefault(), w(e, xt, !0)) : function(l, c) {
962
- return Y && c && Je(l);
963
- }(t, i) ? (n.preventDefault(), w(e, xt, !1)) : function(l, c, a, f) {
964
- return l.toLowerCase() === "b" && !c && Ve(a, f);
965
- }(t, o, i, s) ? (n.preventDefault(), w(e, we, "bold")) : function(l, c, a, f) {
966
- return l.toLowerCase() === "u" && !c && Ve(a, f);
967
- }(t, o, i, s) ? (n.preventDefault(), w(e, we, "underline")) : function(l, c, a, f) {
968
- return l.toLowerCase() === "i" && !c && Ve(a, f);
969
- }(t, o, i, s) ? (n.preventDefault(), w(e, we, "italic")) : /* @__PURE__ */ function(l, c, a, f) {
970
- return l === "Tab" && !c && !a && !f;
971
- }(t, o, s, i) ? w(e, Us, n) : function(l, c, a, f) {
972
- return l.toLowerCase() === "z" && !c && Ve(a, f);
973
- }(t, r, i, s) ? (n.preventDefault(), w(e, Br, void 0)) : function(l, c, a, f) {
974
- return Y ? l.toLowerCase() === "z" && a && c : l.toLowerCase() === "y" && f || l.toLowerCase() === "z" && f && c;
975
- }(t, r, i, s) ? (n.preventDefault(), w(e, Rr, void 0)) : jt(e._editorState._selection) ? function(l, c, a, f) {
976
- return !c && l.toLowerCase() === "c" && (Y ? a : f);
977
- }(t, r, i, s) ? (n.preventDefault(), w(e, Kr, n)) : function(l, c, a, f) {
978
- return !c && l.toLowerCase() === "x" && (Y ? a : f);
979
- }(t, r, i, s) ? (n.preventDefault(), w(e, Jr, n)) : ur(t, i, s) && (n.preventDefault(), w(e, Yn, n)) : !xe && ur(t, i, s) && (n.preventDefault(), w(e, Yn, n)), /* @__PURE__ */ function(l, c, a, f) {
980
- return l || c || a || f;
981
- }(s, r, o, i) && w(e, Zs, n));
966
+ return Z && c && $e(l);
967
+ }(t, i) ? (n.preventDefault(), w(e, xt, !1)) : function(l, c, a, u) {
968
+ return l.toLowerCase() === "b" && !c && Ve(a, u);
969
+ }(t, o, i, s) ? (n.preventDefault(), w(e, we, "bold")) : function(l, c, a, u) {
970
+ return l.toLowerCase() === "u" && !c && Ve(a, u);
971
+ }(t, o, i, s) ? (n.preventDefault(), w(e, we, "underline")) : function(l, c, a, u) {
972
+ return l.toLowerCase() === "i" && !c && Ve(a, u);
973
+ }(t, o, i, s) ? (n.preventDefault(), w(e, we, "italic")) : /* @__PURE__ */ function(l, c, a, u) {
974
+ return l === "Tab" && !c && !a && !u;
975
+ }(t, o, s, i) ? w(e, Us, n) : function(l, c, a, u) {
976
+ return l.toLowerCase() === "z" && !c && Ve(a, u);
977
+ }(t, r, i, s) ? (n.preventDefault(), w(e, Br, void 0)) : function(l, c, a, u) {
978
+ return Z ? l.toLowerCase() === "z" && a && c : l.toLowerCase() === "y" && u || l.toLowerCase() === "z" && u && c;
979
+ }(t, r, i, s) ? (n.preventDefault(), w(e, Rr, void 0)) : Ht(e._editorState._selection) ? function(l, c, a, u) {
980
+ return !c && l.toLowerCase() === "c" && (Z ? a : u);
981
+ }(t, r, i, s) ? (n.preventDefault(), w(e, Kr, n)) : function(l, c, a, u) {
982
+ return !c && l.toLowerCase() === "x" && (Z ? a : u);
983
+ }(t, r, i, s) ? (n.preventDefault(), w(e, $r, n)) : ur(t, i, s) && (n.preventDefault(), w(e, Zn, n)) : !xe && ur(t, i, s) && (n.preventDefault(), w(e, Zn, n)), /* @__PURE__ */ function(l, c, a, u) {
984
+ return l || c || a || u;
985
+ }(s, r, o, i) && w(e, Ys, n));
982
986
  }], ["pointerdown", function(n, e) {
983
987
  const t = n.target, r = n.pointerType;
984
988
  t instanceof Node && r !== "touch" && X(e, () => {
985
- A(zt(t)) || (Tn = !0);
989
+ A(Wt(t)) || (Cn = !0);
986
990
  });
987
991
  }], ["compositionstart", function(n, e) {
988
992
  X(e, () => {
989
993
  const t = I();
990
994
  if (F(t) && !e.isComposing()) {
991
995
  const r = t.anchor, s = t.anchor.getNode();
992
- $(r.key), (n.timeStamp < Xe + xn || r.type === "element" || !t.isCollapsed() || s.getFormat() !== t.format || N(s) && s.getStyle() !== t.style) && w(e, He, ii);
996
+ J(r.key), (n.timeStamp < Xe + vn || r.type === "element" || !t.isCollapsed() || s.getFormat() !== t.format || N(s) && s.getStyle() !== t.style) && w(e, He, ii);
993
997
  }
994
998
  });
995
999
  }], ["compositionend", function(n, e) {
996
1000
  xe ? Ue = !0 : X(e, () => {
997
- sn(e, n.data);
1001
+ on(e, n.data);
998
1002
  });
999
1003
  }], ["input", function(n, e) {
1000
1004
  n.stopPropagation(), X(e, () => {
1001
1005
  const t = I(), r = n.data, s = ys(n);
1002
1006
  if (r != null && F(t) && ps(t, s, r, n.timeStamp, !1)) {
1003
- Ue && (sn(e, r), Ue = !1);
1007
+ Ue && (on(e, r), Ue = !1);
1004
1008
  const i = t.anchor.getNode(), o = se(e._window);
1005
1009
  if (o === null) return;
1006
1010
  const l = t.isBackward(), c = l ? t.anchor.offset : t.focus.offset, a = l ? t.focus.offset : t.anchor.offset;
1007
1011
  vt && !t.isCollapsed() && N(i) && o.anchorNode !== null && i.getTextContent().slice(0, c) + r + i.getTextContent().slice(c + a) === ss(o.anchorNode) || w(e, He, r);
1008
- const f = r.length;
1009
- xe && f > 1 && n.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= f), wn || It || Nn || !e.isComposing() || (Xe = 0, $(null));
1012
+ const u = r.length;
1013
+ xe && u > 1 && n.inputType === "insertCompositionText" && !e.isComposing() && (t.anchor.offset -= u), Nn || It || En || !e.isComposing() || (Xe = 0, J(null));
1010
1014
  } else
1011
- zn(!1, e, r !== null ? r : void 0), Ue && (sn(e, r || void 0), Ue = !1);
1015
+ Bn(!1, e, r !== null ? r : void 0), Ue && (on(e, r || void 0), Ue = !1);
1012
1016
  q(), qr(M());
1013
1017
  }), Le = null;
1014
1018
  }], ["click", function(n, e) {
@@ -1017,19 +1021,19 @@ const oe = Object.freeze({}), xn = 30, vn = [["keydown", function(n, e) {
1017
1021
  if (r) {
1018
1022
  if (F(t)) {
1019
1023
  const i = t.anchor, o = i.getNode();
1020
- i.type === "element" && i.offset === 0 && t.isCollapsed() && !Z(o) && G().getChildrenSize() === 1 && o.getTopLevelElementOrThrow().isEmpty() && s !== null && t.is(s) ? (r.removeAllRanges(), t.dirty = !0) : n.detail === 3 && !t.isCollapsed() && o !== t.focus.getNode() && (S(o) ? o.select(0) : o.getParentOrThrow().select(0));
1024
+ i.type === "element" && i.offset === 0 && t.isCollapsed() && !Y(o) && G().getChildrenSize() === 1 && o.getTopLevelElementOrThrow().isEmpty() && s !== null && t.is(s) ? (r.removeAllRanges(), t.dirty = !0) : n.detail === 3 && !t.isCollapsed() && o !== t.focus.getNode() && (v(o) ? o.select(0) : o.getParentOrThrow().select(0));
1021
1025
  } else if (n.pointerType === "touch") {
1022
1026
  const i = r.anchorNode;
1023
1027
  if (i !== null) {
1024
1028
  const o = i.nodeType;
1025
- (o === rt || o === Te) && ue(Ht(s, r, e, n));
1029
+ (o === rt || o === Te) && ue(qt(s, r, e, n));
1026
1030
  }
1027
1031
  }
1028
1032
  }
1029
1033
  w(e, Ls, n);
1030
1034
  });
1031
1035
  }], ["cut", oe], ["copy", oe], ["dragstart", oe], ["dragover", oe], ["dragend", oe], ["paste", oe], ["focus", oe], ["blur", oe], ["drop", oe]];
1032
- vt && vn.push(["beforeinput", (n, e) => function(t, r) {
1036
+ vt && Sn.push(["beforeinput", (n, e) => function(t, r) {
1033
1037
  const s = t.inputType, i = ys(t);
1034
1038
  s === "deleteCompositionText" || xe && is(r) || s !== "insertCompositionText" && X(r, () => {
1035
1039
  const o = I();
@@ -1041,17 +1045,17 @@ vt && vn.push(["beforeinput", (n, e) => function(t, r) {
1041
1045
  }
1042
1046
  if (F(o)) {
1043
1047
  const d = o.anchor.key === o.focus.key;
1044
- if (l = t.timeStamp, hs === "MediaLast" && l < Xe + xn && r.isComposing() && d) {
1045
- if ($(null), Xe = 0, setTimeout(() => {
1048
+ if (l = t.timeStamp, hs === "MediaLast" && l < Xe + vn && r.isComposing() && d) {
1049
+ if (J(null), Xe = 0, setTimeout(() => {
1046
1050
  X(r, () => {
1047
- $(null);
1051
+ J(null);
1048
1052
  });
1049
- }, xn), F(o)) {
1053
+ }, vn), F(o)) {
1050
1054
  const g = o.anchor.getNode();
1051
- g.markDirty(), o.format = g.getFormat(), N(g) || k(142), o.style = g.getStyle();
1055
+ g.markDirty(), o.format = g.getFormat(), N(g) || b(142), o.style = g.getStyle();
1052
1056
  }
1053
1057
  } else {
1054
- $(null), t.preventDefault();
1058
+ J(null), t.preventDefault();
1055
1059
  const g = o.anchor.getNode().getTextContent(), p = o.anchor.offset === 0 && o.focus.offset === g.length;
1056
1060
  ei && d && !p || w(r, yt, !0);
1057
1061
  }
@@ -1061,8 +1065,8 @@ vt && vn.push(["beforeinput", (n, e) => function(t, r) {
1061
1065
  var l;
1062
1066
  if (!F(o)) return;
1063
1067
  const c = t.data;
1064
- Le !== null && zn(!1, r, Le), o.dirty && Le === null || !o.isCollapsed() || Z(o.anchor.getNode()) || i === null || o.applyDOMRange(i), Le = null;
1065
- const a = o.anchor, f = o.focus, h = a.getNode(), u = f.getNode();
1068
+ Le !== null && Bn(!1, r, Le), o.dirty && Le === null || !o.isCollapsed() || Y(o.anchor.getNode()) || i === null || o.applyDOMRange(i), Le = null;
1069
+ const a = o.anchor, u = o.focus, h = a.getNode(), f = u.getNode();
1066
1070
  if (s !== "insertText" && s !== "insertTranspose") switch (t.preventDefault(), s) {
1067
1071
  case "insertFromYank":
1068
1072
  case "insertFromDrop":
@@ -1070,22 +1074,22 @@ vt && vn.push(["beforeinput", (n, e) => function(t, r) {
1070
1074
  w(r, He, t);
1071
1075
  break;
1072
1076
  case "insertFromComposition":
1073
- $(null), w(r, He, t);
1077
+ J(null), w(r, He, t);
1074
1078
  break;
1075
1079
  case "insertLineBreak":
1076
- $(null), w(r, gt, !1);
1080
+ J(null), w(r, gt, !1);
1077
1081
  break;
1078
1082
  case "insertParagraph":
1079
- $(null), Ze && !It ? (Ze = !1, w(r, gt, !1)) : w(r, Zn, void 0);
1083
+ J(null), Ye && !It ? (Ye = !1, w(r, gt, !1)) : w(r, Yn, void 0);
1080
1084
  break;
1081
1085
  case "insertFromPaste":
1082
1086
  case "insertFromPasteAsQuotation":
1083
- w(r, zr, t);
1087
+ w(r, Wr, t);
1084
1088
  break;
1085
1089
  case "deleteByComposition":
1086
1090
  (function(d, g) {
1087
- return d !== g || S(d) || S(g) || !d.isToken() || !g.isToken();
1088
- })(h, u) && w(r, Gn, t);
1091
+ return d !== g || v(d) || v(g) || !d.isToken() || !g.isToken();
1092
+ })(h, f) && w(r, Gn, t);
1089
1093
  break;
1090
1094
  case "deleteByDrag":
1091
1095
  case "deleteByCut":
@@ -1130,7 +1134,7 @@ vt && vn.push(["beforeinput", (n, e) => function(t, r) {
1130
1134
  else {
1131
1135
  if (c === `
1132
1136
  `) t.preventDefault(), w(r, gt, !1);
1133
- else if (c === ae) t.preventDefault(), w(r, Zn, void 0);
1137
+ else if (c === ae) t.preventDefault(), w(r, Yn, void 0);
1134
1138
  else if (c == null && t.dataTransfer) {
1135
1139
  const d = t.dataTransfer.getData("text/plain");
1136
1140
  t.preventDefault(), o.insertRawText(d);
@@ -1141,17 +1145,17 @@ vt && vn.push(["beforeinput", (n, e) => function(t, r) {
1141
1145
  }(n, e)]);
1142
1146
  let Xe = 0, hs = null, gs = 0, Le = null;
1143
1147
  const Dt = /* @__PURE__ */ new WeakMap();
1144
- let Sn = !1, Tn = !1, Ze = !1, Ue = !1, _s = [0, "", 0, "root", 0];
1148
+ let Tn = !1, Cn = !1, Ye = !1, Ue = !1, _s = [0, "", 0, "root", 0];
1145
1149
  function ps(n, e, t, r, s) {
1146
- const i = n.anchor, o = n.focus, l = i.getNode(), c = M(), a = se(c._window), f = a !== null ? a.anchorNode : null, h = i.key, u = c.getElementByKey(h), d = t.length;
1147
- return h !== o.key || !N(l) || (!s && (!vt || gs < r + 50) || l.isDirty() && d < 2 || ns(t)) && i.offset !== o.offset && !l.isComposing() || be(l) || l.isDirty() && d > 1 || (s || !vt) && u !== null && !l.isComposing() && f !== kt(u) || a !== null && e !== null && (!e.collapsed || e.startContainer !== a.anchorNode || e.startOffset !== a.anchorOffset) || l.getFormat() !== n.format || l.getStyle() !== n.style || Si(n, l);
1150
+ const i = n.anchor, o = n.focus, l = i.getNode(), c = M(), a = se(c._window), u = a !== null ? a.anchorNode : null, h = i.key, f = c.getElementByKey(h), d = t.length;
1151
+ return h !== o.key || !N(l) || (!s && (!vt || gs < r + 50) || l.isDirty() && d < 2 || ns(t)) && i.offset !== o.offset && !l.isComposing() || be(l) || l.isDirty() && d > 1 || (s || !vt) && f !== null && !l.isComposing() && u !== kt(f) || a !== null && e !== null && (!e.collapsed || e.startContainer !== a.anchorNode || e.startOffset !== a.anchorOffset) || l.getFormat() !== n.format || l.getStyle() !== n.style || Si(n, l);
1148
1152
  }
1149
1153
  function pr(n, e) {
1150
1154
  return n !== null && n.nodeValue !== null && n.nodeType === Te && e !== 0 && e !== n.nodeValue.length;
1151
1155
  }
1152
1156
  function yr(n, e, t) {
1153
1157
  const { anchorNode: r, anchorOffset: s, focusNode: i, focusOffset: o } = n;
1154
- Sn && (Sn = !1, pr(r, s) && pr(i, o)) || X(e, () => {
1158
+ Tn && (Tn = !1, pr(r, s) && pr(i, o)) || X(e, () => {
1155
1159
  if (!t) return void ue(null);
1156
1160
  if (!Mt(e, r, i)) return;
1157
1161
  const l = I();
@@ -1159,24 +1163,24 @@ function yr(n, e, t) {
1159
1163
  const c = l.anchor, a = c.getNode();
1160
1164
  if (l.isCollapsed()) {
1161
1165
  n.type === "Range" && n.anchorNode === n.focusNode && (l.dirty = !0);
1162
- const f = Kt(e).event, h = f ? f.timeStamp : performance.now(), [u, d, g, p, _] = _s, m = G(), y = e.isComposing() === !1 && m.getTextContent() === "";
1163
- if (h < _ + 200 && c.offset === g && c.key === p) l.format = u, l.style = d;
1164
- else if (c.type === "text") N(a) || k(141), l.format = a.getFormat(), l.style = a.getStyle();
1166
+ const u = Kt(e).event, h = u ? u.timeStamp : performance.now(), [f, d, g, p, _] = _s, m = G(), y = e.isComposing() === !1 && m.getTextContent() === "";
1167
+ if (h < _ + 200 && c.offset === g && c.key === p) l.format = f, l.style = d;
1168
+ else if (c.type === "text") N(a) || b(141), l.format = a.getFormat(), l.style = a.getStyle();
1165
1169
  else if (c.type === "element" && !y) {
1166
- const x = c.getNode();
1167
- l.style = "", x instanceof ze && x.getChildrenSize() === 0 ? (l.format = x.getTextFormat(), l.style = x.getTextStyle()) : l.format = 0;
1170
+ const S = c.getNode();
1171
+ l.style = "", S instanceof We && S.getChildrenSize() === 0 ? (l.format = S.getTextFormat(), l.style = S.getTextStyle()) : l.format = 0;
1168
1172
  }
1169
1173
  } else {
1170
- const f = c.key, h = l.focus.key, u = l.getNodes(), d = u.length, g = l.isBackward(), p = g ? o : s, _ = g ? s : o, m = g ? h : f, y = g ? f : h;
1171
- let x = si, C = !1;
1172
- for (let b = 0; b < d; b++) {
1173
- const v = u[b], P = v.getTextContentSize();
1174
- if (N(v) && P !== 0 && !(b === 0 && v.__key === m && p === P || b === d - 1 && v.__key === y && _ === 0) && (C = !0, x &= v.getFormat(), x === 0)) break;
1174
+ const u = c.key, h = l.focus.key, f = l.getNodes(), d = f.length, g = l.isBackward(), p = g ? o : s, _ = g ? s : o, m = g ? h : u, y = g ? u : h;
1175
+ let S = si, k = !1;
1176
+ for (let T = 0; T < d; T++) {
1177
+ const x = f[T], P = x.getTextContentSize();
1178
+ if (N(x) && P !== 0 && !(T === 0 && x.__key === m && p === P || T === d - 1 && x.__key === y && _ === 0) && (k = !0, S &= x.getFormat(), S === 0)) break;
1175
1179
  }
1176
- l.format = C ? x : 0;
1180
+ l.format = k ? S : 0;
1177
1181
  }
1178
1182
  }
1179
- w(e, bn, void 0);
1183
+ w(e, wn, void 0);
1180
1184
  });
1181
1185
  }
1182
1186
  function ys(n) {
@@ -1184,23 +1188,23 @@ function ys(n) {
1184
1188
  const e = n.getTargetRanges();
1185
1189
  return e.length === 0 ? null : e[0];
1186
1190
  }
1187
- function sn(n, e) {
1191
+ function on(n, e) {
1188
1192
  const t = n._compositionKey;
1189
- if ($(null), t !== null && e != null) {
1193
+ if (J(null), t !== null && e != null) {
1190
1194
  if (e === "") {
1191
1195
  const r = V(t), s = kt(n.getElementByKey(t));
1192
- return void (s !== null && s.nodeValue !== null && N(r) && Bn(r, s.nodeValue, null, null, !0));
1196
+ return void (s !== null && s.nodeValue !== null && N(r) && Rn(r, s.nodeValue, null, null, !0));
1193
1197
  }
1194
1198
  if (e[e.length - 1] === `
1195
1199
  `) {
1196
1200
  const r = I();
1197
1201
  if (F(r)) {
1198
1202
  const s = r.focus;
1199
- return r.anchor.set(s.key, s.offset, s.type), void w(n, fn, null);
1203
+ return r.anchor.set(s.key, s.offset, s.type), void w(n, dn, null);
1200
1204
  }
1201
1205
  }
1202
1206
  }
1203
- zn(!0, n, e);
1207
+ Bn(!0, n, e);
1204
1208
  }
1205
1209
  function ms(n) {
1206
1210
  let e = n.__lexicalEventHandles;
@@ -1210,13 +1214,13 @@ const Ie = /* @__PURE__ */ new Map();
1210
1214
  function xs(n) {
1211
1215
  const e = n.target, t = se(e == null ? null : e.nodeType === 9 ? e.defaultView : e.ownerDocument.defaultView);
1212
1216
  if (t === null) return;
1213
- const r = Zr(t.anchorNode);
1217
+ const r = Yr(t.anchorNode);
1214
1218
  if (r === null) return;
1215
- Tn && (Tn = !1, X(r, () => {
1216
- const a = ot(), f = t.anchorNode;
1217
- if (f === null) return;
1218
- const h = f.nodeType;
1219
- h !== rt && h !== Te || ue(Ht(a, t, r, n));
1219
+ Cn && (Cn = !1, X(r, () => {
1220
+ const a = ot(), u = t.anchorNode;
1221
+ if (u === null) return;
1222
+ const h = u.nodeType;
1223
+ h !== rt && h !== Te || ue(qt(a, t, r, n));
1220
1224
  }));
1221
1225
  const s = Wn(r), i = s[s.length - 1], o = i._key, l = Ie.get(o), c = l || i;
1222
1226
  c !== r && yr(t, c, !1), yr(t, r, !0), r !== i ? Ie.set(o, r) : l && Ie.delete(o);
@@ -1227,49 +1231,49 @@ function mr(n) {
1227
1231
  function xr(n) {
1228
1232
  return n._lexicalHandled === !0;
1229
1233
  }
1230
- function Li(n) {
1234
+ function Oi(n) {
1231
1235
  const e = n.ownerDocument, t = Dt.get(e);
1232
- t === void 0 && k(162);
1236
+ t === void 0 && b(162);
1233
1237
  const r = t - 1;
1234
- r >= 0 || k(164), Dt.set(e, r), r === 0 && e.removeEventListener("selectionchange", xs);
1235
- const s = Wt(n);
1236
- Mn(s) ? (function(o) {
1238
+ r >= 0 || b(164), Dt.set(e, r), r === 0 && e.removeEventListener("selectionchange", xs);
1239
+ const s = zt(n);
1240
+ zn(s) ? (function(o) {
1237
1241
  if (o._parentEditor !== null) {
1238
1242
  const l = Wn(o), c = l[l.length - 1]._key;
1239
1243
  Ie.get(c) === o && Ie.delete(c);
1240
1244
  } else Ie.delete(o._key);
1241
- }(s), n.__lexicalEditor = null) : s && k(198);
1245
+ }(s), n.__lexicalEditor = null) : s && b(198);
1242
1246
  const i = ms(n);
1243
1247
  for (let o = 0; o < i.length; o++) i[o]();
1244
1248
  n.__lexicalEventHandles = [];
1245
1249
  }
1246
- function Cn(n, e, t) {
1250
+ function kn(n, e, t) {
1247
1251
  q();
1248
1252
  const r = n.__key, s = n.getParent();
1249
1253
  if (s === null) return;
1250
1254
  const i = function(l) {
1251
1255
  const c = I();
1252
- if (!F(c) || !S(l)) return c;
1253
- const { anchor: a, focus: f } = c, h = a.getNode(), u = f.getNode();
1254
- return Qe(h, l) && a.set(l.__key, 0, "element"), Qe(u, l) && f.set(l.__key, 0, "element"), c;
1256
+ if (!F(c) || !v(l)) return c;
1257
+ const { anchor: a, focus: u } = c, h = a.getNode(), f = u.getNode();
1258
+ return Qe(h, l) && a.set(l.__key, 0, "element"), Qe(f, l) && u.set(l.__key, 0, "element"), c;
1255
1259
  }(n);
1256
1260
  let o = !1;
1257
1261
  if (F(i) && e) {
1258
1262
  const l = i.anchor, c = i.focus;
1259
1263
  l.key === r && (Ot(l, n, s, n.getPreviousSibling(), n.getNextSibling()), o = !0), c.key === r && (Ot(c, n, s, n.getPreviousSibling(), n.getNextSibling()), o = !0);
1260
- } else jt(i) && e && n.isSelected() && n.selectPrevious();
1264
+ } else Ht(i) && e && n.isSelected() && n.selectPrevious();
1261
1265
  if (F(i) && e && !o) {
1262
1266
  const l = n.getIndexWithinParent();
1263
1267
  Ne(n), Lt(i, s, l, -1);
1264
1268
  } else Ne(n);
1265
- t || Pe(s) || s.canBeEmpty() || !s.isEmpty() || Cn(s, e), e && Z(s) && s.isEmpty() && s.selectEnd();
1269
+ t || Pe(s) || s.canBeEmpty() || !s.isEmpty() || kn(s, e), e && Y(s) && s.isEmpty() && s.selectEnd();
1266
1270
  }
1267
- class Ut {
1271
+ class Vt {
1268
1272
  static getType() {
1269
- k(64, this.name);
1273
+ b(64, this.name);
1270
1274
  }
1271
1275
  static clone(e) {
1272
- k(65, this.name);
1276
+ b(65, this.name);
1273
1277
  }
1274
1278
  afterCloneFrom(e) {
1275
1279
  this.__parent = e.__parent, this.__next = e.__next, this.__prev = e.__prev;
@@ -1281,7 +1285,7 @@ class Ut {
1281
1285
  return this.__type;
1282
1286
  }
1283
1287
  isInline() {
1284
- k(137, this.constructor.name);
1288
+ b(137, this.constructor.name);
1285
1289
  }
1286
1290
  isAttached() {
1287
1291
  let e = this.__key;
@@ -1327,20 +1331,20 @@ class Ut {
1327
1331
  }
1328
1332
  getParentOrThrow() {
1329
1333
  const e = this.getParent();
1330
- return e === null && k(66, this.__key), e;
1334
+ return e === null && b(66, this.__key), e;
1331
1335
  }
1332
1336
  getTopLevelElement() {
1333
1337
  let e = this;
1334
1338
  for (; e !== null; ) {
1335
1339
  const t = e.getParent();
1336
- if (Pe(t)) return S(e) || e === this && A(e) || k(194), e;
1340
+ if (Pe(t)) return v(e) || e === this && A(e) || b(194), e;
1337
1341
  e = t;
1338
1342
  }
1339
1343
  return null;
1340
1344
  }
1341
1345
  getTopLevelElementOrThrow() {
1342
1346
  const e = this.getTopLevelElement();
1343
- return e === null && k(67, this.__key), e;
1347
+ return e === null && b(67, this.__key), e;
1344
1348
  }
1345
1349
  getParents() {
1346
1350
  const e = [];
@@ -1377,7 +1381,7 @@ class Ut {
1377
1381
  }
1378
1382
  getCommonAncestor(e) {
1379
1383
  const t = this.getParents(), r = e.getParents();
1380
- S(this) && t.unshift(this), S(e) && r.unshift(e);
1384
+ v(this) && t.unshift(this), v(e) && r.unshift(e);
1381
1385
  const s = t.length, i = r.length;
1382
1386
  if (s === 0 || i === 0 || t[s - 1] !== r[i - 1]) return null;
1383
1387
  const o = new Set(r);
@@ -1430,7 +1434,7 @@ class Ut {
1430
1434
  for (; i !== null; ) {
1431
1435
  const o = i.__key;
1432
1436
  if (s.has(o) || (s.add(o), r.push(i)), i === e) break;
1433
- const l = S(i) ? t ? i.getFirstChild() : i.getLastChild() : null;
1437
+ const l = v(i) ? t ? i.getFirstChild() : i.getLastChild() : null;
1434
1438
  if (l !== null) {
1435
1439
  i = l;
1436
1440
  continue;
@@ -1442,12 +1446,12 @@ class Ut {
1442
1446
  }
1443
1447
  const a = i.getParentOrThrow();
1444
1448
  if (s.has(a.__key) || r.push(a), a === e) break;
1445
- let f = null, h = a;
1449
+ let u = null, h = a;
1446
1450
  do {
1447
- if (h === null && k(68), f = t ? h.getNextSibling() : h.getPreviousSibling(), h = h.getParent(), h === null) break;
1448
- f !== null || s.has(h.__key) || r.push(h);
1449
- } while (f === null);
1450
- i = f;
1451
+ if (h === null && b(68), u = t ? h.getNextSibling() : h.getPreviousSibling(), h = h.getParent(), h === null) break;
1452
+ u !== null || s.has(h.__key) || r.push(h);
1453
+ } while (u === null);
1454
+ i = u;
1451
1455
  }
1452
1456
  return t || r.reverse(), r;
1453
1457
  }
@@ -1457,7 +1461,7 @@ class Ut {
1457
1461
  }
1458
1462
  getLatest() {
1459
1463
  const e = V(this.__key);
1460
- return e === null && k(113), e;
1464
+ return e === null && b(113), e;
1461
1465
  }
1462
1466
  getWritable() {
1463
1467
  q();
@@ -1473,44 +1477,44 @@ class Ut {
1473
1477
  return this.getTextContent().length;
1474
1478
  }
1475
1479
  createDOM(e, t) {
1476
- k(70);
1480
+ b(70);
1477
1481
  }
1478
1482
  updateDOM(e, t, r) {
1479
- k(71);
1483
+ b(71);
1480
1484
  }
1481
1485
  exportDOM(e) {
1482
1486
  return { element: this.createDOM(e._config, e) };
1483
1487
  }
1484
1488
  exportJSON() {
1485
- k(72);
1489
+ b(72);
1486
1490
  }
1487
1491
  static importJSON(e) {
1488
- k(18, this.name);
1492
+ b(18, this.name);
1489
1493
  }
1490
1494
  static transform() {
1491
1495
  return null;
1492
1496
  }
1493
1497
  remove(e) {
1494
- Cn(this, !0, e);
1498
+ kn(this, !0, e);
1495
1499
  }
1496
1500
  replace(e, t) {
1497
1501
  q();
1498
1502
  let r = I();
1499
- r !== null && (r = r.clone()), tn(this, e);
1503
+ r !== null && (r = r.clone()), nn(this, e);
1500
1504
  const s = this.getLatest(), i = this.__key, o = e.__key, l = e.getWritable(), c = this.getParentOrThrow().getWritable(), a = c.__size;
1501
1505
  Ne(l);
1502
- const f = s.getPreviousSibling(), h = s.getNextSibling(), u = s.__prev, d = s.__next, g = s.__parent;
1503
- if (Cn(s, !1, !0), f === null ? c.__first = o : f.getWritable().__next = o, l.__prev = u, h === null ? c.__last = o : h.getWritable().__prev = o, l.__next = d, l.__parent = g, c.__size = a, t && (S(this) && S(l) || k(139), this.getChildren().forEach((p) => {
1506
+ const u = s.getPreviousSibling(), h = s.getNextSibling(), f = s.__prev, d = s.__next, g = s.__parent;
1507
+ if (kn(s, !1, !0), u === null ? c.__first = o : u.getWritable().__next = o, l.__prev = f, h === null ? c.__last = o : h.getWritable().__prev = o, l.__next = d, l.__parent = g, c.__size = a, t && (v(this) && v(l) || b(139), this.getChildren().forEach((p) => {
1504
1508
  l.append(p);
1505
1509
  })), F(r)) {
1506
1510
  ue(r);
1507
1511
  const p = r.anchor, _ = r.focus;
1508
1512
  p.key === i && Cr(p, l), _.key === i && Cr(_, l);
1509
1513
  }
1510
- return ye() === i && $(o), l;
1514
+ return ye() === i && J(o), l;
1511
1515
  }
1512
1516
  insertAfter(e, t = !0) {
1513
- q(), tn(this, e);
1517
+ q(), nn(this, e);
1514
1518
  const r = this.getWritable(), s = e.getWritable(), i = s.getParent(), o = I();
1515
1519
  let l = !1, c = !1;
1516
1520
  if (i !== null) {
@@ -1520,23 +1524,23 @@ class Ut {
1520
1524
  l = p.type === "element" && p.key === g && p.offset === d + 1, c = _.type === "element" && _.key === g && _.offset === d + 1;
1521
1525
  }
1522
1526
  }
1523
- const a = this.getNextSibling(), f = this.getParentOrThrow().getWritable(), h = s.__key, u = r.__next;
1524
- if (a === null ? f.__last = h : a.getWritable().__prev = h, f.__size++, r.__next = h, s.__next = u, s.__prev = r.__key, s.__parent = r.__parent, t && F(o)) {
1527
+ const a = this.getNextSibling(), u = this.getParentOrThrow().getWritable(), h = s.__key, f = r.__next;
1528
+ if (a === null ? u.__last = h : a.getWritable().__prev = h, u.__size++, r.__next = h, s.__next = f, s.__prev = r.__key, s.__parent = r.__parent, t && F(o)) {
1525
1529
  const d = this.getIndexWithinParent();
1526
- Lt(o, f, d + 1);
1527
- const g = f.__key;
1530
+ Lt(o, u, d + 1);
1531
+ const g = u.__key;
1528
1532
  l && o.anchor.set(g, d + 2, "element"), c && o.focus.set(g, d + 2, "element");
1529
1533
  }
1530
1534
  return e;
1531
1535
  }
1532
1536
  insertBefore(e, t = !0) {
1533
- q(), tn(this, e);
1537
+ q(), nn(this, e);
1534
1538
  const r = this.getWritable(), s = e.getWritable(), i = s.__key;
1535
1539
  Ne(s);
1536
1540
  const o = this.getPreviousSibling(), l = this.getParentOrThrow().getWritable(), c = r.__prev, a = this.getIndexWithinParent();
1537
1541
  o === null ? l.__first = i : o.getWritable().__next = i, l.__size++, r.__prev = i, s.__prev = c, s.__next = r.__key, s.__parent = r.__parent;
1538
- const f = I();
1539
- return t && F(f) && Lt(f, this.getParentOrThrow(), a), e;
1542
+ const u = I();
1543
+ return t && F(u) && Lt(u, this.getParentOrThrow(), a), e;
1540
1544
  }
1541
1545
  isParentRequired() {
1542
1546
  return !1;
@@ -1554,7 +1558,7 @@ class Ut {
1554
1558
  q();
1555
1559
  const r = this.getPreviousSibling(), s = this.getParentOrThrow();
1556
1560
  if (r === null) return s.select(0, 0);
1557
- if (S(r)) return r.select();
1561
+ if (v(r)) return r.select();
1558
1562
  if (!N(r)) {
1559
1563
  const i = r.getIndexWithinParent() + 1;
1560
1564
  return s.select(i, i);
@@ -1565,7 +1569,7 @@ class Ut {
1565
1569
  q();
1566
1570
  const r = this.getNextSibling(), s = this.getParentOrThrow();
1567
1571
  if (r === null) return s.select();
1568
- if (S(r)) return r.select(0, 0);
1572
+ if (v(r)) return r.select(0, 0);
1569
1573
  if (!N(r)) {
1570
1574
  const i = r.getIndexWithinParent();
1571
1575
  return s.select(i, i);
@@ -1576,7 +1580,7 @@ class Ut {
1576
1580
  this.getWritable();
1577
1581
  }
1578
1582
  }
1579
- class st extends Ut {
1583
+ class st extends Vt {
1580
1584
  static getType() {
1581
1585
  return "linebreak";
1582
1586
  }
@@ -1616,7 +1620,7 @@ class st extends Ut {
1616
1620
  if (i === t || i.previousSibling === t && dt(i)) return !0;
1617
1621
  }
1618
1622
  return !1;
1619
- }(e) ? null : { conversion: Oi, priority: 0 } };
1623
+ }(e) ? null : { conversion: Ii, priority: 0 } };
1620
1624
  }
1621
1625
  static importJSON(e) {
1622
1626
  return nt();
@@ -1625,11 +1629,11 @@ class st extends Ut {
1625
1629
  return { type: "linebreak", version: 1 };
1626
1630
  }
1627
1631
  }
1628
- function Oi(n) {
1632
+ function Ii(n) {
1629
1633
  return { node: nt() };
1630
1634
  }
1631
1635
  function nt() {
1632
- return Jt(new st());
1636
+ return $t(new st());
1633
1637
  }
1634
1638
  function Ae(n) {
1635
1639
  return n instanceof st;
@@ -1637,10 +1641,10 @@ function Ae(n) {
1637
1641
  function dt(n) {
1638
1642
  return n.nodeType === Te && /^( |\t|\r?\n)+$/.test(n.textContent || "");
1639
1643
  }
1640
- function on(n, e) {
1641
- return 16 & e ? "code" : e & En ? "mark" : 32 & e ? "sub" : 64 & e ? "sup" : null;
1642
- }
1643
1644
  function ln(n, e) {
1645
+ return 16 & e ? "code" : e & Pn ? "mark" : 32 & e ? "sub" : 64 & e ? "sup" : null;
1646
+ }
1647
+ function cn(n, e) {
1644
1648
  return 1 & e ? "strong" : 2 & e ? "em" : "span";
1645
1649
  }
1646
1650
  function vs(n, e, t, r, s) {
@@ -1651,14 +1655,14 @@ function vs(n, e, t, r, s) {
1651
1655
  const c = e & Tt && e & St;
1652
1656
  o !== void 0 && (t & Tt && t & St ? (l = !0, c || i.add(...o)) : c && i.remove(...o));
1653
1657
  for (const a in ce) {
1654
- const f = ce[a];
1655
- if (o = qe(s, a), o !== void 0) if (t & f) {
1658
+ const u = ce[a];
1659
+ if (o = qe(s, a), o !== void 0) if (t & u) {
1656
1660
  if (l && (a === "underline" || a === "strikethrough")) {
1657
- e & f && i.remove(...o);
1661
+ e & u && i.remove(...o);
1658
1662
  continue;
1659
1663
  }
1660
- e & f && (!c || a !== "underline") && a !== "strikethrough" || i.add(...o);
1661
- } else e & f && i.remove(...o);
1664
+ e & u && (!c || a !== "underline") && a !== "strikethrough" || i.add(...o);
1665
+ } else e & u && i.remove(...o);
1662
1666
  }
1663
1667
  }
1664
1668
  function Ss(n, e, t) {
@@ -1667,12 +1671,12 @@ function Ss(n, e, t) {
1667
1671
  else {
1668
1672
  const o = r.nodeValue;
1669
1673
  if (o !== i) if (s || xe) {
1670
- const [l, c, a] = function(f, h) {
1671
- const u = f.length, d = h.length;
1674
+ const [l, c, a] = function(u, h) {
1675
+ const f = u.length, d = h.length;
1672
1676
  let g = 0, p = 0;
1673
- for (; g < u && g < d && f[g] === h[g]; ) g++;
1674
- for (; p + g < u && p + g < d && f[u - p - 1] === h[d - p - 1]; ) p++;
1675
- return [g, u - g - p, h.slice(g, d - p)];
1677
+ for (; g < f && g < d && u[g] === h[g]; ) g++;
1678
+ for (; p + g < f && p + g < d && u[f - p - 1] === h[d - p - 1]; ) p++;
1679
+ return [g, f - g - p, h.slice(g, d - p)];
1676
1680
  }(o, i);
1677
1681
  c !== 0 && r.deleteData(l, c), r.insertData(l, a);
1678
1682
  } else r.nodeValue = i;
@@ -1687,12 +1691,12 @@ function ht(n, e) {
1687
1691
  const t = document.createElement(e);
1688
1692
  return t.appendChild(n), t;
1689
1693
  }
1690
- class We extends Ut {
1694
+ class ze extends Vt {
1691
1695
  static getType() {
1692
1696
  return "text";
1693
1697
  }
1694
1698
  static clone(e) {
1695
- return new We(e.__text, e.__key);
1699
+ return new ze(e.__text, e.__key);
1696
1700
  }
1697
1701
  afterCloneFrom(e) {
1698
1702
  super.afterCloneFrom(e), this.__format = e.__format, this.__style = e.__style, this.__mode = e.__mode, this.__detail = e.__detail;
@@ -1745,38 +1749,38 @@ class We extends Ut {
1745
1749
  return !0;
1746
1750
  }
1747
1751
  createDOM(e, t) {
1748
- const r = this.__format, s = on(0, r), i = ln(0, r), o = s === null ? i : s, l = document.createElement(o);
1752
+ const r = this.__format, s = ln(0, r), i = cn(0, r), o = s === null ? i : s, l = document.createElement(o);
1749
1753
  let c = l;
1750
1754
  this.hasFormat("code") && l.setAttribute("spellcheck", "false"), s !== null && (c = document.createElement(i), l.appendChild(c)), vr(c, this, 0, r, this.__text, e);
1751
1755
  const a = this.__style;
1752
1756
  return a !== "" && (l.style.cssText = a), l;
1753
1757
  }
1754
1758
  updateDOM(e, t, r) {
1755
- const s = this.__text, i = e.__format, o = this.__format, l = on(0, i), c = on(0, o), a = ln(0, i), f = ln(0, o);
1756
- if ((l === null ? a : l) !== (c === null ? f : c)) return !0;
1757
- if (l === c && a !== f) {
1759
+ const s = this.__text, i = e.__format, o = this.__format, l = ln(0, i), c = ln(0, o), a = cn(0, i), u = cn(0, o);
1760
+ if ((l === null ? a : l) !== (c === null ? u : c)) return !0;
1761
+ if (l === c && a !== u) {
1758
1762
  const p = t.firstChild;
1759
- p == null && k(48);
1760
- const _ = document.createElement(f);
1763
+ p == null && b(48);
1764
+ const _ = document.createElement(u);
1761
1765
  return vr(_, this, 0, o, s, r), t.replaceChild(_, p), !1;
1762
1766
  }
1763
1767
  let h = t;
1764
- c !== null && l !== null && (h = t.firstChild, h == null && k(49)), Ss(s, h, this);
1765
- const u = r.theme.text;
1766
- u !== void 0 && i !== o && vs(0, i, o, h, u);
1768
+ c !== null && l !== null && (h = t.firstChild, h == null && b(49)), Ss(s, h, this);
1769
+ const f = r.theme.text;
1770
+ f !== void 0 && i !== o && vs(0, i, o, h, f);
1767
1771
  const d = e.__style, g = this.__style;
1768
1772
  return d !== g && (t.style.cssText = g), !1;
1769
1773
  }
1770
1774
  static importDOM() {
1771
- return { "#text": () => ({ conversion: Wi, priority: 0 }), b: () => ({ conversion: Ai, priority: 0 }), code: () => ({ conversion: ge, priority: 0 }), em: () => ({ conversion: ge, priority: 0 }), i: () => ({ conversion: ge, priority: 0 }), s: () => ({ conversion: ge, priority: 0 }), span: () => ({ conversion: Ii, priority: 0 }), strong: () => ({ conversion: ge, priority: 0 }), sub: () => ({ conversion: ge, priority: 0 }), sup: () => ({ conversion: ge, priority: 0 }), u: () => ({ conversion: ge, priority: 0 }) };
1775
+ return { "#text": () => ({ conversion: Wi, priority: 0 }), b: () => ({ conversion: Mi, priority: 0 }), code: () => ({ conversion: ge, priority: 0 }), em: () => ({ conversion: ge, priority: 0 }), i: () => ({ conversion: ge, priority: 0 }), s: () => ({ conversion: ge, priority: 0 }), span: () => ({ conversion: Ai, priority: 0 }), strong: () => ({ conversion: ge, priority: 0 }), sub: () => ({ conversion: ge, priority: 0 }), sup: () => ({ conversion: ge, priority: 0 }), u: () => ({ conversion: ge, priority: 0 }) };
1772
1776
  }
1773
1777
  static importJSON(e) {
1774
- const t = J(e.text);
1778
+ const t = $(e.text);
1775
1779
  return t.setFormat(e.format), t.setDetail(e.detail), t.setMode(e.mode), t.setStyle(e.style), t;
1776
1780
  }
1777
1781
  exportDOM(e) {
1778
1782
  let { element: t } = super.exportDOM(e);
1779
- return t !== null && Jn(t) || k(132), t.style.whiteSpace = "pre-wrap", this.hasFormat("bold") && (t = ht(t, "b")), this.hasFormat("italic") && (t = ht(t, "i")), this.hasFormat("strikethrough") && (t = ht(t, "s")), this.hasFormat("underline") && (t = ht(t, "u")), { element: t };
1783
+ return t !== null && Jt(t) || b(132), t.style.whiteSpace = "pre-wrap", this.hasFormat("bold") && (t = ht(t, "b")), this.hasFormat("italic") && (t = ht(t, "i")), this.hasFormat("strikethrough") && (t = ht(t, "s")), this.hasFormat("underline") && (t = ht(t, "u")), { element: t };
1780
1784
  }
1781
1785
  exportJSON() {
1782
1786
  return { detail: this.getDetail(), format: this.getFormat(), mode: this.getMode(), style: this.getStyle(), text: this.getTextContent(), type: "text", version: 1 };
@@ -1829,7 +1833,7 @@ class We extends Ut {
1829
1833
  if (!F(i)) return ks(l, r, l, s, "text", "text");
1830
1834
  {
1831
1835
  const c = ye();
1832
- c !== i.anchor.key && c !== i.focus.key || $(l), i.setTextNodeRange(this, r, this, s);
1836
+ c !== i.anchor.key && c !== i.focus.key || J(l), i.setTextNodeRange(this, r, this, s);
1833
1837
  }
1834
1838
  return i;
1835
1839
  }
@@ -1849,8 +1853,8 @@ class We extends Ut {
1849
1853
  const h = e + l;
1850
1854
  a.setTextNodeRange(i, h, i, h);
1851
1855
  }
1852
- const f = o.slice(0, c) + r + o.slice(c + t);
1853
- return i.__text = f, i;
1856
+ const u = o.slice(0, c) + r + o.slice(c + t);
1857
+ return i.__text = u, i;
1854
1858
  }
1855
1859
  canInsertTextBefore() {
1856
1860
  return !0;
@@ -1862,76 +1866,76 @@ class We extends Ut {
1862
1866
  q();
1863
1867
  const t = this.getLatest(), r = t.getTextContent(), s = t.__key, i = ye(), o = new Set(e), l = [], c = r.length;
1864
1868
  let a = "";
1865
- for (let b = 0; b < c; b++) a !== "" && o.has(b) && (l.push(a), a = ""), a += r[b];
1869
+ for (let T = 0; T < c; T++) a !== "" && o.has(T) && (l.push(a), a = ""), a += r[T];
1866
1870
  a !== "" && l.push(a);
1867
- const f = l.length;
1868
- if (f === 0) return [];
1871
+ const u = l.length;
1872
+ if (u === 0) return [];
1869
1873
  if (l[0] === r) return [t];
1870
- const h = l[0], u = t.getParent();
1874
+ const h = l[0], f = t.getParent();
1871
1875
  let d;
1872
1876
  const g = t.getFormat(), p = t.getStyle(), _ = t.__detail;
1873
1877
  let m = !1;
1874
- t.isSegmented() ? (d = J(h), d.__format = g, d.__style = p, d.__detail = _, m = !0) : (d = t.getWritable(), d.__text = h);
1875
- const y = I(), x = [d];
1876
- let C = h.length;
1877
- for (let b = 1; b < f; b++) {
1878
- const v = l[b], P = v.length, T = J(v).getWritable();
1879
- T.__format = g, T.__style = p, T.__detail = _;
1880
- const E = T.__key, D = C + P;
1878
+ t.isSegmented() ? (d = $(h), d.__format = g, d.__style = p, d.__detail = _, m = !0) : (d = t.getWritable(), d.__text = h);
1879
+ const y = I(), S = [d];
1880
+ let k = h.length;
1881
+ for (let T = 1; T < u; T++) {
1882
+ const x = l[T], P = x.length, C = $(x).getWritable();
1883
+ C.__format = g, C.__style = p, C.__detail = _;
1884
+ const E = C.__key, D = k + P;
1881
1885
  if (F(y)) {
1882
- const O = y.anchor, W = y.focus;
1883
- O.key === s && O.type === "text" && O.offset > C && O.offset <= D && (O.key = E, O.offset -= C, y.dirty = !0), W.key === s && W.type === "text" && W.offset > C && W.offset <= D && (W.key = E, W.offset -= C, y.dirty = !0);
1886
+ const O = y.anchor, z = y.focus;
1887
+ O.key === s && O.type === "text" && O.offset > k && O.offset <= D && (O.key = E, O.offset -= k, y.dirty = !0), z.key === s && z.type === "text" && z.offset > k && z.offset <= D && (z.key = E, z.offset -= k, y.dirty = !0);
1884
1888
  }
1885
- i === s && $(E), C = D, x.push(T);
1889
+ i === s && J(E), k = D, S.push(C);
1886
1890
  }
1887
- if (u !== null) {
1891
+ if (f !== null) {
1888
1892
  (function(P) {
1889
- const T = P.getPreviousSibling(), E = P.getNextSibling();
1890
- T !== null && wt(T), E !== null && wt(E);
1893
+ const C = P.getPreviousSibling(), E = P.getNextSibling();
1894
+ C !== null && wt(C), E !== null && wt(E);
1891
1895
  })(this);
1892
- const b = u.getWritable(), v = this.getIndexWithinParent();
1893
- m ? (b.splice(v, 0, x), this.remove()) : b.splice(v, 1, x), F(y) && Lt(y, u, v, f - 1);
1896
+ const T = f.getWritable(), x = this.getIndexWithinParent();
1897
+ m ? (T.splice(x, 0, S), this.remove()) : T.splice(x, 1, S), F(y) && Lt(y, f, x, u - 1);
1894
1898
  }
1895
- return x;
1899
+ return S;
1896
1900
  }
1897
1901
  mergeWithSibling(e) {
1898
1902
  const t = e === this.getPreviousSibling();
1899
- t || e === this.getNextSibling() || k(50);
1903
+ t || e === this.getNextSibling() || b(50);
1900
1904
  const r = this.__key, s = e.__key, i = this.__text, o = i.length;
1901
- ye() === s && $(r);
1905
+ ye() === s && J(r);
1902
1906
  const l = I();
1903
1907
  if (F(l)) {
1904
- const h = l.anchor, u = l.focus;
1905
- h !== null && h.key === s && (Dr(h, t, r, e, o), l.dirty = !0), u !== null && u.key === s && (Dr(u, t, r, e, o), l.dirty = !0);
1908
+ const h = l.anchor, f = l.focus;
1909
+ h !== null && h.key === s && (Dr(h, t, r, e, o), l.dirty = !0), f !== null && f.key === s && (Dr(f, t, r, e, o), l.dirty = !0);
1906
1910
  }
1907
1911
  const c = e.__text, a = t ? c + i : i + c;
1908
1912
  this.setTextContent(a);
1909
- const f = this.getWritable();
1910
- return e.remove(), f;
1913
+ const u = this.getWritable();
1914
+ return e.remove(), u;
1911
1915
  }
1912
1916
  isTextEntity() {
1913
1917
  return !1;
1914
1918
  }
1915
1919
  }
1916
- function Ii(n) {
1917
- return { forChild: $n(n.style), node: null };
1918
- }
1919
1920
  function Ai(n) {
1921
+ return { forChild: Jn(n.style), node: null };
1922
+ }
1923
+ function Mi(n) {
1920
1924
  const e = n, t = e.style.fontWeight === "normal";
1921
- return { forChild: $n(e.style, t ? void 0 : "bold"), node: null };
1925
+ return { forChild: Jn(e.style, t ? void 0 : "bold"), node: null };
1922
1926
  }
1923
1927
  const Sr = /* @__PURE__ */ new WeakMap();
1924
- function Mi(n) {
1928
+ function zi(n) {
1925
1929
  return n.nodeName === "PRE" || n.nodeType === rt && n.style !== void 0 && n.style.whiteSpace !== void 0 && n.style.whiteSpace.startsWith("pre");
1926
1930
  }
1927
1931
  function Wi(n) {
1928
1932
  const e = n;
1929
- n.parentElement === null && k(129);
1933
+ n.parentElement === null && b(129);
1930
1934
  let t = e.textContent || "";
1931
1935
  if (function(r) {
1932
1936
  let s, i = r.parentNode;
1933
1937
  const o = [r];
1934
- for (; i !== null && (s = Sr.get(i)) === void 0 && !Mi(i); ) o.push(i), i = i.parentNode;
1938
+ for (; i !== null && (s = Sr.get(i)) === void 0 && !zi(i); ) o.push(i), i = i.parentNode;
1935
1939
  const l = s === void 0 ? i : s;
1936
1940
  for (let c = 0; c < o.length; c++) Sr.set(o[c], l);
1937
1941
  return l;
@@ -1941,7 +1945,7 @@ function Wi(n) {
1941
1945
  const l = r[o];
1942
1946
  l === `
1943
1947
  ` || l === `\r
1944
- ` ? s.push(nt()) : l === " " ? s.push(Un()) : l !== "" && s.push(J(l));
1948
+ ` ? s.push(nt()) : l === " " ? s.push(Un()) : l !== "" && s.push($(l));
1945
1949
  }
1946
1950
  return { node: s };
1947
1951
  }
@@ -1966,7 +1970,7 @@ function Wi(n) {
1966
1970
  }
1967
1971
  s && (t = t.slice(0, t.length - 1));
1968
1972
  }
1969
- return t === "" ? { node: null } : { node: J(t) };
1973
+ return t === "" ? { node: null } : { node: $(t) };
1970
1974
  }
1971
1975
  function Tr(n, e) {
1972
1976
  let t = n;
@@ -1987,22 +1991,22 @@ function Tr(n, e) {
1987
1991
  if (t.nodeName === "BR") return null;
1988
1992
  }
1989
1993
  }
1990
- const zi = { code: "code", em: "italic", i: "italic", s: "strikethrough", strong: "bold", sub: "subscript", sup: "superscript", u: "underline" };
1994
+ const Bi = { code: "code", em: "italic", i: "italic", s: "strikethrough", strong: "bold", sub: "subscript", sup: "superscript", u: "underline" };
1991
1995
  function ge(n) {
1992
- const e = zi[n.nodeName.toLowerCase()];
1993
- return e === void 0 ? { node: null } : { forChild: $n(n.style, e), node: null };
1996
+ const e = Bi[n.nodeName.toLowerCase()];
1997
+ return e === void 0 ? { node: null } : { forChild: Jn(n.style, e), node: null };
1994
1998
  }
1995
- function J(n = "") {
1996
- return Jt(new We(n));
1999
+ function $(n = "") {
2000
+ return $t(new ze(n));
1997
2001
  }
1998
2002
  function N(n) {
1999
- return n instanceof We;
2003
+ return n instanceof ze;
2000
2004
  }
2001
- function $n(n, e) {
2005
+ function Jn(n, e) {
2002
2006
  const t = n.fontWeight, r = n.textDecoration.split(" "), s = t === "700" || t === "bold", i = r.includes("line-through"), o = n.fontStyle === "italic", l = r.includes("underline"), c = n.verticalAlign;
2003
2007
  return (a) => (N(a) && (s && !a.hasFormat("bold") && a.toggleFormat("bold"), i && !a.hasFormat("strikethrough") && a.toggleFormat("strikethrough"), o && !a.hasFormat("italic") && a.toggleFormat("italic"), l && !a.hasFormat("underline") && a.toggleFormat("underline"), c !== "sub" || a.hasFormat("subscript") || a.toggleFormat("subscript"), c !== "super" || a.hasFormat("superscript") || a.toggleFormat("superscript"), e && !a.hasFormat(e) && a.toggleFormat(e)), a);
2004
2008
  }
2005
- class it extends We {
2009
+ class it extends ze {
2006
2010
  static getType() {
2007
2011
  return "tab";
2008
2012
  }
@@ -2026,13 +2030,13 @@ class it extends We {
2026
2030
  return { ...super.exportJSON(), type: "tab", version: 1 };
2027
2031
  }
2028
2032
  setTextContent(e) {
2029
- k(126);
2033
+ b(126);
2030
2034
  }
2031
2035
  setDetail(e) {
2032
- k(127);
2036
+ b(127);
2033
2037
  }
2034
2038
  setMode(e) {
2035
- k(128);
2039
+ b(128);
2036
2040
  }
2037
2041
  canInsertTextBefore() {
2038
2042
  return !1;
@@ -2042,12 +2046,12 @@ class it extends We {
2042
2046
  }
2043
2047
  }
2044
2048
  function Un() {
2045
- return Jt(new it());
2049
+ return $t(new it());
2046
2050
  }
2047
- function Bi(n) {
2051
+ function Ri(n) {
2048
2052
  return n instanceof it;
2049
2053
  }
2050
- class Ri {
2054
+ class Ki {
2051
2055
  constructor(e, t, r) {
2052
2056
  this._selection = null, this.key = e, this.offset = t, this.type = r;
2053
2057
  }
@@ -2057,11 +2061,11 @@ class Ri {
2057
2061
  isBefore(e) {
2058
2062
  let t = this.getNode(), r = e.getNode();
2059
2063
  const s = this.offset, i = e.offset;
2060
- if (S(t)) {
2064
+ if (v(t)) {
2061
2065
  const o = t.getDescendantByIndex(s);
2062
2066
  t = o ?? t;
2063
2067
  }
2064
- if (S(r)) {
2068
+ if (v(r)) {
2065
2069
  const o = r.getDescendantByIndex(i);
2066
2070
  r = o ?? r;
2067
2071
  }
@@ -2069,23 +2073,23 @@ class Ri {
2069
2073
  }
2070
2074
  getNode() {
2071
2075
  const e = V(this.key);
2072
- return e === null && k(20), e;
2076
+ return e === null && b(20), e;
2073
2077
  }
2074
2078
  set(e, t, r) {
2075
2079
  const s = this._selection, i = this.key;
2076
- this.key = e, this.offset = t, this.type = r, lt() || (ye() === i && $(e), s !== null && (s.setCachedNodes(null), s.dirty = !0));
2080
+ this.key = e, this.offset = t, this.type = r, lt() || (ye() === i && J(e), s !== null && (s.setCachedNodes(null), s.dirty = !0));
2077
2081
  }
2078
2082
  }
2079
2083
  function ie(n, e, t) {
2080
- return new Ri(n, e, t);
2084
+ return new Ki(n, e, t);
2081
2085
  }
2082
- function cn(n, e) {
2086
+ function an(n, e) {
2083
2087
  let t = e.__key, r = n.offset, s = "element";
2084
2088
  if (N(e)) {
2085
2089
  s = "text";
2086
2090
  const i = e.getTextContentSize();
2087
2091
  r > i && (r = i);
2088
- } else if (!S(e)) {
2092
+ } else if (!v(e)) {
2089
2093
  const i = e.getNextSibling();
2090
2094
  if (N(i)) t = i.__key, r = 0, s = "text";
2091
2095
  else {
@@ -2096,15 +2100,15 @@ function cn(n, e) {
2096
2100
  n.set(t, r, s);
2097
2101
  }
2098
2102
  function Cr(n, e) {
2099
- if (S(e)) {
2103
+ if (v(e)) {
2100
2104
  const t = e.getLastDescendant();
2101
- S(t) || N(t) ? cn(n, t) : cn(n, e);
2102
- } else cn(n, e);
2105
+ v(t) || N(t) ? an(n, t) : an(n, e);
2106
+ } else an(n, e);
2103
2107
  }
2104
2108
  function pe(n, e, t, r) {
2105
2109
  n.key = e, n.offset = t, n.type = r;
2106
2110
  }
2107
- class Vt {
2111
+ class jt {
2108
2112
  constructor(e) {
2109
2113
  this._cachedNodes = null, this._nodes = e, this.dirty = !1;
2110
2114
  }
@@ -2115,7 +2119,7 @@ class Vt {
2115
2119
  this._cachedNodes = e;
2116
2120
  }
2117
2121
  is(e) {
2118
- if (!jt(e)) return !1;
2122
+ if (!Ht(e)) return !1;
2119
2123
  const t = this._nodes, r = e._nodes;
2120
2124
  return t.size === r.size && Array.from(t).every((s) => r.has(s));
2121
2125
  }
@@ -2141,7 +2145,7 @@ class Vt {
2141
2145
  return this._nodes.has(e);
2142
2146
  }
2143
2147
  clone() {
2144
- return new Vt(new Set(this._nodes));
2148
+ return new jt(new Set(this._nodes));
2145
2149
  }
2146
2150
  extract() {
2147
2151
  return this.getNodes();
@@ -2202,17 +2206,17 @@ class Ce {
2202
2206
  if (e !== null) return e;
2203
2207
  const t = this.anchor, r = this.focus, s = t.isBefore(r), i = s ? t : r, o = s ? r : t;
2204
2208
  let l = i.getNode(), c = o.getNode();
2205
- const a = i.offset, f = o.offset;
2206
- if (S(l)) {
2207
- const u = l.getDescendantByIndex(a);
2208
- l = u ?? l;
2209
+ const a = i.offset, u = o.offset;
2210
+ if (v(l)) {
2211
+ const f = l.getDescendantByIndex(a);
2212
+ l = f ?? l;
2209
2213
  }
2210
- if (S(c)) {
2211
- let u = c.getDescendantByIndex(f);
2212
- u !== null && u !== l && c.getChildAtIndex(f) === u && (u = u.getPreviousSibling()), c = u ?? c;
2214
+ if (v(c)) {
2215
+ let f = c.getDescendantByIndex(u);
2216
+ f !== null && f !== l && c.getChildAtIndex(u) === f && (f = f.getPreviousSibling()), c = f ?? c;
2213
2217
  }
2214
2218
  let h;
2215
- return h = l.is(c) ? S(l) && l.getChildrenSize() > 0 ? [] : [l] : l.getNodesBetween(c), lt() || (this._cachedNodes = h), h;
2219
+ return h = l.is(c) ? v(l) && l.getChildrenSize() > 0 ? [] : [l] : l.getNodesBetween(c), lt() || (this._cachedNodes = h), h;
2216
2220
  }
2217
2221
  setTextNodeRange(e, t, r, s) {
2218
2222
  pe(this.anchor, e.__key, t, "text"), pe(this.focus, r.__key, s, "text"), this._cachedNodes = null, this.dirty = !0;
@@ -2221,15 +2225,15 @@ class Ce {
2221
2225
  const e = this.getNodes();
2222
2226
  if (e.length === 0) return "";
2223
2227
  const t = e[0], r = e[e.length - 1], s = this.anchor, i = this.focus, o = s.isBefore(i), [l, c] = br(this);
2224
- let a = "", f = !0;
2228
+ let a = "", u = !0;
2225
2229
  for (let h = 0; h < e.length; h++) {
2226
- const u = e[h];
2227
- if (S(u) && !u.isInline()) f || (a += `
2228
- `), f = !u.isEmpty();
2229
- else if (f = !1, N(u)) {
2230
- let d = u.getTextContent();
2231
- u === t ? u === r ? s.type === "element" && i.type === "element" && i.offset !== s.offset || (d = l < c ? d.slice(l, c) : d.slice(c, l)) : d = o ? d.slice(l) : d.slice(c) : u === r && (d = o ? d.slice(0, c) : d.slice(0, l)), a += d;
2232
- } else !A(u) && !Ae(u) || u === r && this.isCollapsed() || (a += u.getTextContent());
2230
+ const f = e[h];
2231
+ if (v(f) && !f.isInline()) u || (a += `
2232
+ `), u = !f.isEmpty();
2233
+ else if (u = !1, N(f)) {
2234
+ let d = f.getTextContent();
2235
+ f === t ? f === r ? s.type === "element" && i.type === "element" && i.offset !== s.offset || (d = l < c ? d.slice(l, c) : d.slice(c, l)) : d = o ? d.slice(l) : d.slice(c) : f === r && (d = o ? d.slice(0, c) : d.slice(0, l)), a += d;
2236
+ } else !A(f) && !Ae(f) || f === r && this.isCollapsed() || (a += f.getTextContent());
2233
2237
  }
2234
2238
  return a;
2235
2239
  }
@@ -2259,100 +2263,100 @@ class Ce {
2259
2263
  const o = t[i];
2260
2264
  o === `
2261
2265
  ` || o === `\r
2262
- ` ? r.push(nt()) : o === " " ? r.push(Un()) : r.push(J(o));
2266
+ ` ? r.push(nt()) : o === " " ? r.push(Un()) : r.push($(o));
2263
2267
  }
2264
2268
  this.insertNodes(r);
2265
2269
  }
2266
2270
  insertText(e) {
2267
2271
  const t = this.anchor, r = this.focus, s = this.format, i = this.style;
2268
2272
  let o = t, l = r;
2269
- !this.isCollapsed() && r.isBefore(t) && (o = r, l = t), o.type === "element" && function(_, m, y, x) {
2270
- const C = _.getNode(), b = C.getChildAtIndex(_.offset), v = J(), P = Z(C) ? ve().append(v) : v;
2271
- v.setFormat(y), v.setStyle(x), b === null ? C.append(P) : b.insertBefore(P), _.is(m) && m.set(v.__key, 0, "text"), _.set(v.__key, 0, "text");
2273
+ !this.isCollapsed() && r.isBefore(t) && (o = r, l = t), o.type === "element" && function(_, m, y, S) {
2274
+ const k = _.getNode(), T = k.getChildAtIndex(_.offset), x = $(), P = Y(k) ? ve().append(x) : x;
2275
+ x.setFormat(y), x.setStyle(S), T === null ? k.append(P) : T.insertBefore(P), _.is(m) && m.set(x.__key, 0, "text"), _.set(x.__key, 0, "text");
2272
2276
  }(o, l, s, i);
2273
2277
  const c = o.offset;
2274
2278
  let a = l.offset;
2275
- const f = this.getNodes(), h = f.length;
2276
- let u = f[0];
2277
- N(u) || k(26);
2278
- const d = u.getTextContent().length, g = u.getParentOrThrow();
2279
- let p = f[h - 1];
2280
- if (h === 1 && l.type === "element" && (a = d, l.set(o.key, a, "text")), this.isCollapsed() && c === d && (u.isSegmented() || u.isToken() || !u.canInsertTextAfter() || !g.canInsertTextAfter() && u.getNextSibling() === null)) {
2281
- let _ = u.getNextSibling();
2282
- if (N(_) && _.canInsertTextBefore() && !be(_) || (_ = J(), _.setFormat(s), _.setStyle(i), g.canInsertTextAfter() ? u.insertAfter(_) : g.insertAfter(_)), _.select(0, 0), u = _, e !== "") return void this.insertText(e);
2283
- } else if (this.isCollapsed() && c === 0 && (u.isSegmented() || u.isToken() || !u.canInsertTextBefore() || !g.canInsertTextBefore() && u.getPreviousSibling() === null)) {
2284
- let _ = u.getPreviousSibling();
2285
- if (N(_) && !be(_) || (_ = J(), _.setFormat(s), g.canInsertTextBefore() ? u.insertBefore(_) : g.insertBefore(_)), _.select(), u = _, e !== "") return void this.insertText(e);
2286
- } else if (u.isSegmented() && c !== d) {
2287
- const _ = J(u.getTextContent());
2288
- _.setFormat(s), u.replace(_), u = _;
2279
+ const u = this.getNodes(), h = u.length;
2280
+ let f = u[0];
2281
+ N(f) || b(26);
2282
+ const d = f.getTextContent().length, g = f.getParentOrThrow();
2283
+ let p = u[h - 1];
2284
+ if (h === 1 && l.type === "element" && (a = d, l.set(o.key, a, "text")), this.isCollapsed() && c === d && (f.isSegmented() || f.isToken() || !f.canInsertTextAfter() || !g.canInsertTextAfter() && f.getNextSibling() === null)) {
2285
+ let _ = f.getNextSibling();
2286
+ if (N(_) && _.canInsertTextBefore() && !be(_) || (_ = $(), _.setFormat(s), _.setStyle(i), g.canInsertTextAfter() ? f.insertAfter(_) : g.insertAfter(_)), _.select(0, 0), f = _, e !== "") return void this.insertText(e);
2287
+ } else if (this.isCollapsed() && c === 0 && (f.isSegmented() || f.isToken() || !f.canInsertTextBefore() || !g.canInsertTextBefore() && f.getPreviousSibling() === null)) {
2288
+ let _ = f.getPreviousSibling();
2289
+ if (N(_) && !be(_) || (_ = $(), _.setFormat(s), g.canInsertTextBefore() ? f.insertBefore(_) : g.insertBefore(_)), _.select(), f = _, e !== "") return void this.insertText(e);
2290
+ } else if (f.isSegmented() && c !== d) {
2291
+ const _ = $(f.getTextContent());
2292
+ _.setFormat(s), f.replace(_), f = _;
2289
2293
  } else if (!this.isCollapsed() && e !== "") {
2290
2294
  const _ = p.getParent();
2291
- if (!g.canInsertTextBefore() || !g.canInsertTextAfter() || S(_) && (!_.canInsertTextBefore() || !_.canInsertTextAfter())) return this.insertText(""), Ts(this.anchor, this.focus, null), void this.insertText(e);
2295
+ if (!g.canInsertTextBefore() || !g.canInsertTextAfter() || v(_) && (!_.canInsertTextBefore() || !_.canInsertTextAfter())) return this.insertText(""), Ts(this.anchor, this.focus, null), void this.insertText(e);
2292
2296
  }
2293
2297
  if (h === 1) {
2294
- if (u.isToken()) {
2295
- const x = J(e);
2296
- return x.select(), void u.replace(x);
2298
+ if (f.isToken()) {
2299
+ const S = $(e);
2300
+ return S.select(), void f.replace(S);
2297
2301
  }
2298
- const _ = u.getFormat(), m = u.getStyle();
2302
+ const _ = f.getFormat(), m = f.getStyle();
2299
2303
  if (c !== a || _ === s && m === i) {
2300
- if (Bi(u)) {
2301
- const x = J(e);
2302
- return x.setFormat(s), x.setStyle(i), x.select(), void u.replace(x);
2304
+ if (Ri(f)) {
2305
+ const S = $(e);
2306
+ return S.setFormat(s), S.setStyle(i), S.select(), void f.replace(S);
2303
2307
  }
2304
2308
  } else {
2305
- if (u.getTextContent() !== "") {
2306
- const x = J(e);
2307
- if (x.setFormat(s), x.setStyle(i), x.select(), c === 0) u.insertBefore(x, !1);
2309
+ if (f.getTextContent() !== "") {
2310
+ const S = $(e);
2311
+ if (S.setFormat(s), S.setStyle(i), S.select(), c === 0) f.insertBefore(S, !1);
2308
2312
  else {
2309
- const [C] = u.splitText(c);
2310
- C.insertAfter(x, !1);
2313
+ const [k] = f.splitText(c);
2314
+ k.insertAfter(S, !1);
2311
2315
  }
2312
- return void (x.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length));
2316
+ return void (S.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length));
2313
2317
  }
2314
- u.setFormat(s), u.setStyle(i);
2318
+ f.setFormat(s), f.setStyle(i);
2315
2319
  }
2316
2320
  const y = a - c;
2317
- u = u.spliceText(c, y, e, !0), u.getTextContent() === "" ? u.remove() : this.anchor.type === "text" && (u.isComposing() ? this.anchor.offset -= e.length : (this.format = _, this.style = m));
2321
+ f = f.spliceText(c, y, e, !0), f.getTextContent() === "" ? f.remove() : this.anchor.type === "text" && (f.isComposing() ? this.anchor.offset -= e.length : (this.format = _, this.style = m));
2318
2322
  } else {
2319
- const _ = /* @__PURE__ */ new Set([...u.getParentKeys(), ...p.getParentKeys()]), m = S(u) ? u : u.getParentOrThrow();
2320
- let y = S(p) ? p : p.getParentOrThrow(), x = p;
2323
+ const _ = /* @__PURE__ */ new Set([...f.getParentKeys(), ...p.getParentKeys()]), m = v(f) ? f : f.getParentOrThrow();
2324
+ let y = v(p) ? p : p.getParentOrThrow(), S = p;
2321
2325
  if (!m.is(y) && y.isInline()) do
2322
- x = y, y = y.getParentOrThrow();
2326
+ S = y, y = y.getParentOrThrow();
2323
2327
  while (y.isInline());
2324
2328
  if (l.type === "text" && (a !== 0 || p.getTextContent() === "") || l.type === "element" && p.getIndexWithinParent() < a) if (N(p) && !p.isToken() && a !== p.getTextContentSize()) {
2325
2329
  if (p.isSegmented()) {
2326
- const T = J(p.getTextContent());
2327
- p.replace(T), p = T;
2330
+ const C = $(p.getTextContent());
2331
+ p.replace(C), p = C;
2328
2332
  }
2329
- Z(l.getNode()) || l.type !== "text" || (p = p.spliceText(0, a, "")), _.add(p.__key);
2333
+ Y(l.getNode()) || l.type !== "text" || (p = p.spliceText(0, a, "")), _.add(p.__key);
2330
2334
  } else {
2331
- const T = p.getParentOrThrow();
2332
- T.canBeEmpty() || T.getChildrenSize() !== 1 ? p.remove() : T.remove();
2335
+ const C = p.getParentOrThrow();
2336
+ C.canBeEmpty() || C.getChildrenSize() !== 1 ? p.remove() : C.remove();
2333
2337
  }
2334
2338
  else _.add(p.__key);
2335
- const C = y.getChildren(), b = new Set(f), v = m.is(y), P = m.isInline() && u.getNextSibling() === null ? m : u;
2336
- for (let T = C.length - 1; T >= 0; T--) {
2337
- const E = C[T];
2338
- if (E.is(u) || S(E) && E.isParentOf(u)) break;
2339
- E.isAttached() && (!b.has(E) || E.is(x) ? v || P.insertAfter(E, !1) : E.remove());
2340
- }
2341
- if (!v) {
2342
- let T = y, E = null;
2343
- for (; T !== null; ) {
2344
- const D = T.getChildren(), O = D.length;
2345
- (O === 0 || D[O - 1].is(E)) && (_.delete(T.__key), E = T), T = T.getParent();
2339
+ const k = y.getChildren(), T = new Set(u), x = m.is(y), P = m.isInline() && f.getNextSibling() === null ? m : f;
2340
+ for (let C = k.length - 1; C >= 0; C--) {
2341
+ const E = k[C];
2342
+ if (E.is(f) || v(E) && E.isParentOf(f)) break;
2343
+ E.isAttached() && (!T.has(E) || E.is(S) ? x || P.insertAfter(E, !1) : E.remove());
2344
+ }
2345
+ if (!x) {
2346
+ let C = y, E = null;
2347
+ for (; C !== null; ) {
2348
+ const D = C.getChildren(), O = D.length;
2349
+ (O === 0 || D[O - 1].is(E)) && (_.delete(C.__key), E = C), C = C.getParent();
2346
2350
  }
2347
2351
  }
2348
- if (u.isToken()) if (c === d) u.select();
2352
+ if (f.isToken()) if (c === d) f.select();
2349
2353
  else {
2350
- const T = J(e);
2351
- T.select(), u.replace(T);
2354
+ const C = $(e);
2355
+ C.select(), f.replace(C);
2352
2356
  }
2353
- else u = u.spliceText(c, d - c, e, !0), u.getTextContent() === "" ? u.remove() : u.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length);
2354
- for (let T = 1; T < h; T++) {
2355
- const E = f[T], D = E.__key;
2357
+ else f = f.spliceText(c, d - c, e, !0), f.getTextContent() === "" ? f.remove() : f.isComposing() && this.anchor.type === "text" && (this.anchor.offset -= e.length);
2358
+ for (let C = 1; C < h; C++) {
2359
+ const E = u[C], D = E.__key;
2356
2360
  _.has(D) || E.remove();
2357
2361
  }
2358
2362
  }
@@ -2361,119 +2365,121 @@ class Ce {
2361
2365
  if (this.isCollapsed()) return;
2362
2366
  const { anchor: e, focus: t } = this, r = this.getNodes(), s = this.isBackward() ? t : e, i = this.isBackward() ? e : t;
2363
2367
  let o = s.getNode(), l = i.getNode();
2364
- const c = $e(o, _e), a = $e(l, _e);
2365
- r.forEach((h) => {
2368
+ const c = Je(o, _e), a = Je(l, _e);
2369
+ N(o) && o.isToken() && s.offset < o.getTextContentSize() && (s.offset = 0), i.offset > 0 && N(l) && l.isToken() && (i.offset = l.getTextContentSize()), r.forEach((h) => {
2366
2370
  Qe(o, h) || Qe(l, h) || h.getKey() === o.getKey() || h.getKey() === l.getKey() || h.remove();
2367
2371
  });
2368
- const f = (h, u) => {
2372
+ const u = (h, f) => {
2369
2373
  if (h.getTextContent() === "") h.remove();
2370
- else if (u !== 0 && be(h)) {
2371
- const d = J(h.getTextContent());
2374
+ else if (f !== 0 && be(h)) {
2375
+ const d = $(h.getTextContent());
2372
2376
  return d.setFormat(h.getFormat()), d.setStyle(h.getStyle()), h.replace(d);
2373
2377
  }
2374
2378
  };
2375
2379
  if (o === l && N(o)) {
2376
2380
  const h = Math.abs(t.offset - e.offset);
2377
- return o.spliceText(s.offset, h, "", !0), void f(o, h);
2381
+ return o.spliceText(s.offset, h, "", !0), void u(o, h);
2378
2382
  }
2379
2383
  if (N(o)) {
2380
2384
  const h = o.getTextContentSize() - s.offset;
2381
- o.spliceText(s.offset, h, ""), o = f(o, h) || o;
2385
+ o.spliceText(s.offset, h, ""), o = u(o, h) || o;
2382
2386
  }
2383
- N(l) && (l.spliceText(0, i.offset, ""), l = f(l, i.offset) || l), o.isAttached() && N(o) ? o.selectEnd() : l.isAttached() && N(l) && l.selectStart(), S(c) && S(a) && c !== a && (c.append(...a.getChildren()), a.remove(), i.set(s.key, s.offset, s.type));
2387
+ N(l) && (l.spliceText(0, i.offset, ""), l = u(l, i.offset) || l), o.isAttached() && N(o) ? o.selectEnd() : l.isAttached() && N(l) && l.selectStart(), v(c) && v(a) && c !== a && (c.append(...a.getChildren()), a.remove(), i.set(s.key, s.offset, s.type));
2384
2388
  }
2385
2389
  formatText(e, t = null) {
2386
- if (this.isCollapsed()) return this.toggleFormat(e), void $(null);
2390
+ if (this.isCollapsed()) return this.toggleFormat(e), void J(null);
2387
2391
  const r = this.getNodes(), s = [];
2388
- for (const x of r) N(x) && s.push(x);
2389
- const i = s.length;
2390
- if (i === 0) return this.toggleFormat(e), void $(null);
2391
- const o = this.anchor, l = this.focus, c = this.isBackward(), a = c ? l : o, f = c ? o : l;
2392
- let h = 0, u = s[0], d = a.type === "element" ? 0 : a.offset;
2393
- if (a.type === "text" && d === u.getTextContentSize() && (h = 1, u = s[1], d = 0), u == null) return;
2394
- const g = u.getFormatFlags(e, t);
2395
- r.forEach((x) => {
2396
- if (kn(x)) {
2397
- const C = x.getFormatFlags(e, g);
2398
- x.setTextFormat(C);
2399
- }
2400
- });
2401
- const p = i - 1;
2402
- let _ = s[p];
2403
- const m = f.type === "text" ? f.offset : _.getTextContentSize();
2404
- if (u.is(_)) {
2405
- if (d === m) return;
2406
- if (be(u) || d === 0 && m === u.getTextContentSize()) u.setFormat(g);
2392
+ for (const k of r) N(k) && s.push(k);
2393
+ const i = (k) => {
2394
+ r.forEach((T) => {
2395
+ if (bn(T)) {
2396
+ const x = T.getFormatFlags(e, k);
2397
+ T.setTextFormat(x);
2398
+ }
2399
+ });
2400
+ }, o = s.length;
2401
+ if (o === 0) return this.toggleFormat(e), J(null), void i(t);
2402
+ const l = this.anchor, c = this.focus, a = this.isBackward(), u = a ? c : l, h = a ? l : c;
2403
+ let f = 0, d = s[0], g = u.type === "element" ? 0 : u.offset;
2404
+ if (u.type === "text" && g === d.getTextContentSize() && (f = 1, d = s[1], g = 0), d == null) return;
2405
+ const p = d.getFormatFlags(e, t);
2406
+ i(p);
2407
+ const _ = o - 1;
2408
+ let m = s[_];
2409
+ const y = h.type === "text" ? h.offset : m.getTextContentSize();
2410
+ if (d.is(m)) {
2411
+ if (g === y) return;
2412
+ if (be(d) || g === 0 && y === d.getTextContentSize()) d.setFormat(p);
2407
2413
  else {
2408
- const x = u.splitText(d, m), C = d === 0 ? x[0] : x[1];
2409
- C.setFormat(g), a.type === "text" && a.set(C.__key, 0, "text"), f.type === "text" && f.set(C.__key, m - d, "text");
2414
+ const k = d.splitText(g, y), T = g === 0 ? k[0] : k[1];
2415
+ T.setFormat(p), u.type === "text" && u.set(T.__key, 0, "text"), h.type === "text" && h.set(T.__key, y - g, "text");
2410
2416
  }
2411
- return void (this.format = g);
2417
+ return void (this.format = p);
2412
2418
  }
2413
- d === 0 || be(u) || ([, u] = u.splitText(d), d = 0), u.setFormat(g);
2414
- const y = _.getFormatFlags(e, g);
2415
- m > 0 && (m === _.getTextContentSize() || be(_) || ([_] = _.splitText(m)), _.setFormat(y));
2416
- for (let x = h + 1; x < p; x++) {
2417
- const C = s[x], b = C.getFormatFlags(e, y);
2418
- C.setFormat(b);
2419
+ g === 0 || be(d) || ([, d] = d.splitText(g), g = 0), d.setFormat(p);
2420
+ const S = m.getFormatFlags(e, p);
2421
+ y > 0 && (y === m.getTextContentSize() || be(m) || ([m] = m.splitText(y)), m.setFormat(S));
2422
+ for (let k = f + 1; k < _; k++) {
2423
+ const T = s[k], x = T.getFormatFlags(e, S);
2424
+ T.setFormat(x);
2419
2425
  }
2420
- a.type === "text" && a.set(u.__key, d, "text"), f.type === "text" && f.set(_.__key, m, "text"), this.format = g | y;
2426
+ u.type === "text" && u.set(d.__key, g, "text"), h.type === "text" && h.set(m.__key, y, "text"), this.format = p | S;
2421
2427
  }
2422
2428
  insertNodes(e) {
2423
2429
  if (e.length === 0) return;
2424
2430
  if (this.anchor.key === "root") {
2425
2431
  this.insertParagraph();
2426
- const d = I();
2427
- return F(d) || k(134), d.insertNodes(e);
2432
+ const g = I();
2433
+ return F(g) || b(134), g.insertNodes(e);
2428
2434
  }
2429
- const t = $e((this.isBackward() ? this.focus : this.anchor).getNode(), _e), r = e[e.length - 1];
2430
- if ("__language" in t && S(t)) {
2435
+ const t = (this.isBackward() ? this.focus : this.anchor).getNode(), r = Je(t, _e), s = e[e.length - 1];
2436
+ if (v(r) && "__language" in r) {
2431
2437
  if ("__language" in e[0]) this.insertText(e[0].getTextContent());
2432
2438
  else {
2433
- const d = an(this);
2434
- t.splice(d, 0, e), r.selectEnd();
2439
+ const g = un(this);
2440
+ r.splice(g, 0, e), s.selectEnd();
2435
2441
  }
2436
2442
  return;
2437
2443
  }
2438
- if (!e.some((d) => (S(d) || A(d)) && !d.isInline())) {
2439
- S(t) || k(135);
2440
- const d = an(this);
2441
- return t.splice(d, 0, e), void r.selectEnd();
2442
- }
2443
- const s = function(d) {
2444
- const g = ve();
2445
- let p = null;
2446
- for (let _ = 0; _ < d.length; _++) {
2447
- const m = d[_], y = Ae(m);
2448
- if (y || A(m) && m.isInline() || S(m) && m.isInline() || N(m) || m.isParentRequired()) {
2449
- if (p === null && (p = m.createParentElementNode(), g.append(p), y)) continue;
2450
- p !== null && p.append(m);
2451
- } else g.append(m), p = null;
2452
- }
2453
- return g;
2454
- }(e), i = s.getLastDescendant(), o = s.getChildren(), l = !S(t) || !t.isEmpty() ? this.insertParagraph() : null, c = o[o.length - 1];
2455
- let a = o[0];
2456
- var f;
2457
- S(f = a) && _e(f) && !f.isEmpty() && S(t) && (!t.isEmpty() || t.canMergeWhenEmpty()) && (S(t) || k(135), t.append(...a.getChildren()), a = o[1]), a && function(d, g, p) {
2458
- const _ = g.getParentOrThrow().getLastChild();
2459
- let m = g;
2460
- const y = [g];
2461
- for (; m !== _; ) m.getNextSibling() || k(140), m = m.getNextSibling(), y.push(m);
2462
- let x = d;
2463
- for (const C of y) x = x.insertAfter(C);
2464
- }(t, a);
2465
- const h = $e(i, _e);
2466
- l && S(h) && (l.canMergeWhenEmpty() || _e(c)) && (h.append(...l.getChildren()), l.remove()), S(t) && t.isEmpty() && t.remove(), i.selectEnd();
2467
- const u = S(t) ? t.getLastChild() : null;
2468
- Ae(u) && h !== t && u.remove();
2444
+ if (!e.some((g) => (v(g) || A(g)) && !g.isInline())) {
2445
+ v(r) || b(211, t.constructor.name, t.getType());
2446
+ const g = un(this);
2447
+ return r.splice(g, 0, e), void s.selectEnd();
2448
+ }
2449
+ const i = function(g) {
2450
+ const p = ve();
2451
+ let _ = null;
2452
+ for (let m = 0; m < g.length; m++) {
2453
+ const y = g[m], S = Ae(y);
2454
+ if (S || A(y) && y.isInline() || v(y) && y.isInline() || N(y) || y.isParentRequired()) {
2455
+ if (_ === null && (_ = y.createParentElementNode(), p.append(_), S)) continue;
2456
+ _ !== null && _.append(y);
2457
+ } else p.append(y), _ = null;
2458
+ }
2459
+ return p;
2460
+ }(e), o = i.getLastDescendant(), l = i.getChildren(), c = !v(r) || !r.isEmpty() ? this.insertParagraph() : null, a = l[l.length - 1];
2461
+ let u = l[0];
2462
+ var h;
2463
+ v(h = u) && _e(h) && !h.isEmpty() && v(r) && (!r.isEmpty() || r.canMergeWhenEmpty()) && (v(r) || b(211, t.constructor.name, t.getType()), r.append(...u.getChildren()), u = l[1]), u && (r === null && b(212, t.constructor.name, t.getType()), function(g, p, _) {
2464
+ const m = p.getParentOrThrow().getLastChild();
2465
+ let y = p;
2466
+ const S = [p];
2467
+ for (; y !== m; ) y.getNextSibling() || b(140), y = y.getNextSibling(), S.push(y);
2468
+ let k = g;
2469
+ for (const T of S) k = k.insertAfter(T);
2470
+ }(r, u));
2471
+ const f = Je(o, _e);
2472
+ c && v(f) && (c.canMergeWhenEmpty() || _e(a)) && (f.append(...c.getChildren()), c.remove()), v(r) && r.isEmpty() && r.remove(), o.selectEnd();
2473
+ const d = v(r) ? r.getLastChild() : null;
2474
+ Ae(d) && f !== r && d.remove();
2469
2475
  }
2470
2476
  insertParagraph() {
2471
2477
  if (this.anchor.key === "root") {
2472
2478
  const o = ve();
2473
2479
  return G().splice(this.anchor.offset, 0, [o]), o.select(), o;
2474
2480
  }
2475
- const e = an(this), t = $e(this.anchor.getNode(), _e);
2476
- S(t) || k(136);
2481
+ const e = un(this), t = Je(this.anchor.getNode(), _e);
2482
+ v(t) || b(213);
2477
2483
  const r = t.getChildAtIndex(e), s = r ? [r, ...r.getNextSiblings()] : [], i = t.insertNewAfter(this, !1);
2478
2484
  return i ? (i.append(...s), i.selectStart(), i) : null;
2479
2485
  }
@@ -2491,19 +2497,19 @@ class Ce {
2491
2497
  if (t === 0) return [];
2492
2498
  if (t === 1) {
2493
2499
  if (N(o) && !this.isCollapsed()) {
2494
- const h = c > a ? a : c, u = c > a ? c : a, d = o.splitText(h, u), g = h === 0 ? d[0] : d[1];
2500
+ const h = c > a ? a : c, f = c > a ? c : a, d = o.splitText(h, f), g = h === 0 ? d[0] : d[1];
2495
2501
  return g != null ? [g] : [];
2496
2502
  }
2497
2503
  return [o];
2498
2504
  }
2499
- const f = s.isBefore(i);
2505
+ const u = s.isBefore(i);
2500
2506
  if (N(o)) {
2501
- const h = f ? c : a;
2507
+ const h = u ? c : a;
2502
2508
  h === o.getTextContentSize() ? e.shift() : h !== 0 && ([, o] = o.splitText(h), e[0] = o);
2503
2509
  }
2504
2510
  if (N(l)) {
2505
- const h = l.getTextContent().length, u = f ? a : c;
2506
- u === 0 ? e.pop() : u !== h && ([l] = l.splitText(u), e[r] = l);
2511
+ const h = l.getTextContent().length, f = u ? a : c;
2512
+ f === 0 ? e.pop() : f !== h && ([l] = l.splitText(f), e[r] = l);
2507
2513
  }
2508
2514
  return e;
2509
2515
  }
@@ -2514,49 +2520,49 @@ class Ce {
2514
2520
  const d = Pr();
2515
2521
  return d.add(l.__key), void ue(d);
2516
2522
  }
2517
- const u = t ? l.getPreviousSibling() : l.getNextSibling();
2518
- if (N(u)) {
2519
- const d = u.__key, g = t ? u.getTextContent().length : 0;
2523
+ const f = t ? l.getPreviousSibling() : l.getNextSibling();
2524
+ if (N(f)) {
2525
+ const d = f.__key, g = t ? f.getTextContent().length : 0;
2520
2526
  return s.set(d, g, "text"), void (o && i.set(d, g, "text"));
2521
2527
  }
2522
2528
  {
2523
2529
  const d = l.getParentOrThrow();
2524
2530
  let g, p;
2525
- return S(u) ? (p = u.__key, g = t ? u.getChildrenSize() : 0) : (g = l.getIndexWithinParent(), p = d.__key, t || g++), s.set(p, g, "element"), void (o && i.set(p, g, "element"));
2531
+ return v(f) ? (p = f.__key, g = t ? f.getChildrenSize() : 0) : (g = l.getIndexWithinParent(), p = d.__key, t || g++), s.set(p, g, "element"), void (o && i.set(p, g, "element"));
2526
2532
  }
2527
2533
  }
2528
2534
  const c = M(), a = se(c._window);
2529
2535
  if (!a) return;
2530
- const f = c._blockCursorElement, h = c._rootElement;
2531
- if (h === null || f === null || !S(l) || l.isInline() || l.canBeEmpty() || Kn(f, c, h), function(u, d, g, p) {
2532
- u.modify(d, g, p);
2536
+ const u = c._blockCursorElement, h = c._rootElement;
2537
+ if (h === null || u === null || !v(l) || l.isInline() || l.canBeEmpty() || $n(u, c, h), function(f, d, g, p) {
2538
+ f.modify(d, g, p);
2533
2539
  }(a, e, t ? "backward" : "forward", r), a.rangeCount > 0) {
2534
- const u = a.getRangeAt(0), d = this.anchor.getNode(), g = Z(d) ? d : Ti(d);
2535
- if (this.applyDOMRange(u), this.dirty = !0, !o) {
2540
+ const f = a.getRangeAt(0), d = this.anchor.getNode(), g = Y(d) ? d : Ti(d);
2541
+ if (this.applyDOMRange(f), this.dirty = !0, !o) {
2536
2542
  const p = this.getNodes(), _ = [];
2537
2543
  let m = !1;
2538
2544
  for (let y = 0; y < p.length; y++) {
2539
- const x = p[y];
2540
- Qe(x, g) ? _.push(x) : m = !0;
2545
+ const S = p[y];
2546
+ Qe(S, g) ? _.push(S) : m = !0;
2541
2547
  }
2542
2548
  if (m && _.length > 0) if (t) {
2543
2549
  const y = _[0];
2544
- S(y) ? y.selectStart() : y.getParentOrThrow().selectStart();
2550
+ v(y) ? y.selectStart() : y.getParentOrThrow().selectStart();
2545
2551
  } else {
2546
2552
  const y = _[_.length - 1];
2547
- S(y) ? y.selectEnd() : y.getParentOrThrow().selectEnd();
2553
+ v(y) ? y.selectEnd() : y.getParentOrThrow().selectEnd();
2548
2554
  }
2549
- a.anchorNode === u.startContainer && a.anchorOffset === u.startOffset || function(y) {
2550
- const x = y.focus, C = y.anchor, b = C.key, v = C.offset, P = C.type;
2551
- pe(C, x.key, x.offset, x.type), pe(x, b, v, P), y._cachedNodes = null;
2555
+ a.anchorNode === f.startContainer && a.anchorOffset === f.startOffset || function(y) {
2556
+ const S = y.focus, k = y.anchor, T = k.key, x = k.offset, P = k.type;
2557
+ pe(k, S.key, S.offset, S.type), pe(S, T, x, P), y._cachedNodes = null;
2552
2558
  }(this);
2553
2559
  }
2554
2560
  }
2555
2561
  }
2556
2562
  forwardDeletion(e, t, r) {
2557
- if (!r && (e.type === "element" && S(t) && e.offset === t.getChildrenSize() || e.type === "text" && e.offset === t.getTextContentSize())) {
2563
+ if (!r && (e.type === "element" && v(t) && e.offset === t.getChildrenSize() || e.type === "text" && e.offset === t.getTextContentSize())) {
2558
2564
  const s = t.getParent(), i = t.getNextSibling() || (s === null ? null : s.getNextSibling());
2559
- if (S(i) && i.isShadowRoot()) return !0;
2565
+ if (v(i) && i.isShadowRoot()) return !0;
2560
2566
  }
2561
2567
  return !1;
2562
2568
  }
@@ -2568,15 +2574,15 @@ class Ce {
2568
2574
  if (this.forwardDeletion(r, s, e)) return;
2569
2575
  const i = this.focus, o = dr(i, e);
2570
2576
  if (A(o) && !o.isIsolated()) {
2571
- if (o.isKeyboardSelectable() && S(s) && s.getChildrenSize() === 0) {
2577
+ if (o.isKeyboardSelectable() && v(s) && s.getChildrenSize() === 0) {
2572
2578
  s.remove();
2573
2579
  const l = Pr();
2574
2580
  l.add(o.__key), ue(l);
2575
2581
  } else
2576
- o.remove(), M().dispatchCommand(bn, void 0);
2582
+ o.remove(), M().dispatchCommand(wn, void 0);
2577
2583
  return;
2578
2584
  }
2579
- if (!e && S(o) && S(s) && s.isEmpty()) return s.remove(), void o.selectStart();
2585
+ if (!e && v(o) && v(s) && s.isEmpty()) return s.remove(), void o.selectStart();
2580
2586
  if (this.modify("extend", e, "character"), this.isCollapsed()) {
2581
2587
  if (e && r.offset === 0 && (r.type === "element" ? r.getNode() : r.getNode().getParentOrThrow()).collapseAtStart(this))
2582
2588
  return;
@@ -2590,23 +2596,23 @@ class Ce {
2590
2596
  if (s.is(l) || e && c !== 0 || !e && c !== a) return void wr(s, e, c);
2591
2597
  }
2592
2598
  (function(c, a) {
2593
- const f = c.anchor, h = c.focus, u = f.getNode(), d = h.getNode();
2594
- if (u === d && f.type === "text" && h.type === "text") {
2595
- const g = f.offset, p = h.offset, _ = g < p, m = _ ? g : p, y = _ ? p : g, x = y - 1;
2596
- m !== x && (ns(u.getTextContent().slice(m, y)) || (a ? h.offset = x : f.offset = x));
2599
+ const u = c.anchor, h = c.focus, f = u.getNode(), d = h.getNode();
2600
+ if (f === d && u.type === "text" && h.type === "text") {
2601
+ const g = u.offset, p = h.offset, _ = g < p, m = _ ? g : p, y = _ ? p : g, S = y - 1;
2602
+ m !== S && (ns(f.getTextContent().slice(m, y)) || (a ? h.offset = S : u.offset = S));
2597
2603
  }
2598
2604
  })(this, e);
2599
2605
  }
2600
2606
  }
2601
2607
  if (this.removeText(), e && !t && this.isCollapsed() && this.anchor.type === "element" && this.anchor.offset === 0) {
2602
2608
  const r = this.anchor.getNode();
2603
- r.isEmpty() && Z(r.getParent()) && r.getIndexWithinParent() === 0 && r.collapseAtStart(this);
2609
+ r.isEmpty() && Y(r.getParent()) && r.getIndexWithinParent() === 0 && r.collapseAtStart(this);
2604
2610
  }
2605
2611
  }
2606
2612
  deleteLine(e) {
2607
2613
  if (this.isCollapsed()) {
2608
2614
  const t = this.anchor.type === "element";
2609
- if (t && this.insertText(" "), this.modify("extend", e, "lineboundary"), (e ? this.focus : this.anchor).offset === 0 && this.modify("extend", e, "character"), t) {
2615
+ if (t && this.insertText(" "), this.modify("extend", e, "lineboundary"), this.isCollapsed() && this.anchor.offset === 0 && this.modify("extend", e, "character"), t) {
2610
2616
  const r = e ? this.anchor : this.focus;
2611
2617
  r.set(r.key, r.offset + 1, r.type);
2612
2618
  }
@@ -2628,8 +2634,8 @@ class Ce {
2628
2634
  return [this.anchor, this.focus];
2629
2635
  }
2630
2636
  }
2631
- function jt(n) {
2632
- return n instanceof Vt;
2637
+ function Ht(n) {
2638
+ return n instanceof jt;
2633
2639
  }
2634
2640
  function kr(n) {
2635
2641
  const e = n.offset;
@@ -2647,9 +2653,9 @@ function wr(n, e, t) {
2647
2653
  const r = n, s = r.getTextContent().split(/(?=\s)/g), i = s.length;
2648
2654
  let o = 0, l = 0;
2649
2655
  for (let a = 0; a < i; a++) {
2650
- const f = a === i - 1;
2651
- if (l = o, o += s[a].length, e && o === t || o > t || f) {
2652
- s.splice(a, 1), f && (l = void 0);
2656
+ const u = a === i - 1;
2657
+ if (l = o, o += s[a].length, e && o === t || o > t || u) {
2658
+ s.splice(a, 1), u && (l = void 0);
2653
2659
  break;
2654
2660
  }
2655
2661
  }
@@ -2662,32 +2668,32 @@ function Nr(n, e, t, r) {
2662
2668
  let o = !1;
2663
2669
  const l = n.childNodes, c = l.length, a = r._blockCursorElement;
2664
2670
  i === c && (o = !0, i = c - 1);
2665
- let f = l[i], h = !1;
2666
- if (f === a) f = l[i + 1], h = !0;
2671
+ let u = l[i], h = !1;
2672
+ if (u === a) u = l[i + 1], h = !0;
2667
2673
  else if (a !== null) {
2668
- const u = a.parentNode;
2669
- n === u && e > Array.prototype.indexOf.call(u.children, a) && i--;
2674
+ const f = a.parentNode;
2675
+ n === f && e > Array.prototype.indexOf.call(f.children, a) && i--;
2670
2676
  }
2671
- if (s = Oe(f), N(s)) i = or(s, o);
2677
+ if (s = Oe(u), N(s)) i = or(s, o);
2672
2678
  else {
2673
- let u = Oe(n);
2674
- if (u === null) return null;
2675
- if (S(u)) {
2676
- i = Math.min(u.getChildrenSize(), i);
2677
- let d = u.getChildAtIndex(i);
2678
- if (S(d) && function(g, p, _) {
2679
+ let f = Oe(n);
2680
+ if (f === null) return null;
2681
+ if (v(f)) {
2682
+ i = Math.min(f.getChildrenSize(), i);
2683
+ let d = f.getChildAtIndex(i);
2684
+ if (v(d) && function(g, p, _) {
2679
2685
  const m = g.getParent();
2680
2686
  return _ === null || m === null || !m.canBeEmpty() || m !== _.getNode();
2681
2687
  }(d, 0, t)) {
2682
2688
  const g = o ? d.getLastDescendant() : d.getFirstDescendant();
2683
- g === null ? u = d : (d = g, u = S(d) ? d : d.getParentOrThrow()), i = 0;
2689
+ g === null ? f = d : (d = g, f = v(d) ? d : d.getParentOrThrow()), i = 0;
2684
2690
  }
2685
- N(d) ? (s = d, u = null, i = or(d, o)) : d !== u && o && !h && i++;
2691
+ N(d) ? (s = d, f = null, i = or(d, o)) : d !== f && o && !h && i++;
2686
2692
  } else {
2687
- const d = u.getIndexWithinParent();
2688
- i = e === 0 && A(u) && Oe(n) === u ? d : d + 1, u = u.getParentOrThrow();
2693
+ const d = f.getIndexWithinParent();
2694
+ i = e === 0 && A(f) && Oe(n) === f ? d : d + 1, f = f.getParentOrThrow();
2689
2695
  }
2690
- if (S(u)) return ie(u.__key, i, "element");
2696
+ if (v(f)) return ie(f.__key, i, "element");
2691
2697
  }
2692
2698
  } else s = Oe(n);
2693
2699
  return N(s) ? ie(s.__key, i, "text") : null;
@@ -2697,15 +2703,15 @@ function Er(n, e, t) {
2697
2703
  if (r === 0) {
2698
2704
  const i = s.getPreviousSibling(), o = s.getParent();
2699
2705
  if (e) {
2700
- if ((t || !e) && i === null && S(o) && o.isInline()) {
2706
+ if ((t || !e) && i === null && v(o) && o.isInline()) {
2701
2707
  const l = o.getPreviousSibling();
2702
2708
  N(l) && (n.key = l.__key, n.offset = l.getTextContent().length);
2703
2709
  }
2704
- } else S(i) && !t && i.isInline() ? (n.key = i.__key, n.offset = i.getChildrenSize(), n.type = "element") : N(i) && (n.key = i.__key, n.offset = i.getTextContent().length);
2710
+ } else v(i) && !t && i.isInline() ? (n.key = i.__key, n.offset = i.getChildrenSize(), n.type = "element") : N(i) && (n.key = i.__key, n.offset = i.getTextContent().length);
2705
2711
  } else if (r === s.getTextContent().length) {
2706
2712
  const i = s.getNextSibling(), o = s.getParent();
2707
- if (e && S(i) && i.isInline()) n.key = i.__key, n.offset = 0, n.type = "element";
2708
- else if ((t || e) && i === null && S(o) && o.isInline() && !o.canInsertTextAfter()) {
2713
+ if (e && v(i) && i.isInline()) n.key = i.__key, n.offset = 0, n.type = "element";
2714
+ else if ((t || e) && i === null && v(o) && o.isInline() && !o.canInsertTextAfter()) {
2709
2715
  const l = o.getNextSibling();
2710
2716
  N(l) && (n.key = l.__key, n.offset = 0);
2711
2717
  }
@@ -2734,32 +2740,32 @@ function Cs(n, e, t, r, s, i) {
2734
2740
  }
2735
2741
  return Ts(o, l, i), [o, l];
2736
2742
  }
2737
- function ao(n) {
2738
- return S(n) && !n.isInline();
2743
+ function uo(n) {
2744
+ return v(n) && !n.isInline();
2739
2745
  }
2740
2746
  function ks(n, e, t, r, s, i) {
2741
2747
  const o = fe(), l = new Ce(ie(n, e, s), ie(t, r, i), 0, "");
2742
2748
  return l.dirty = !0, o._selection = l, l;
2743
2749
  }
2744
- function uo() {
2750
+ function fo() {
2745
2751
  const n = ie("root", 0, "element"), e = ie("root", 0, "element");
2746
2752
  return new Ce(n, e, 0, "");
2747
2753
  }
2748
2754
  function Pr() {
2749
- return new Vt(/* @__PURE__ */ new Set());
2755
+ return new jt(/* @__PURE__ */ new Set());
2750
2756
  }
2751
- function fo(n, e) {
2752
- return Ht(null, n, e, null);
2757
+ function ho(n, e) {
2758
+ return qt(null, n, e, null);
2753
2759
  }
2754
- function Ht(n, e, t, r) {
2760
+ function qt(n, e, t, r) {
2755
2761
  const s = t._window;
2756
2762
  if (s === null) return null;
2757
- const i = r || s.event, o = i ? i.type : void 0, l = o === "selectionchange", c = !dn && (l || o === "beforeinput" || o === "compositionstart" || o === "compositionend" || o === "click" && i && i.detail === 3 || o === "drop" || o === void 0);
2758
- let a, f, h, u;
2763
+ const i = r || s.event, o = i ? i.type : void 0, l = o === "selectionchange", c = !hn && (l || o === "beforeinput" || o === "compositionstart" || o === "compositionend" || o === "click" && i && i.detail === 3 || o === "drop" || o === void 0);
2764
+ let a, u, h, f;
2759
2765
  if (F(n) && !c) return n.clone();
2760
2766
  if (e === null) return null;
2761
- if (a = e.anchorNode, f = e.focusNode, h = e.anchorOffset, u = e.focusOffset, l && F(n) && !Mt(t, a, f)) return n.clone();
2762
- const d = Cs(a, h, f, u, t, n);
2767
+ if (a = e.anchorNode, u = e.focusNode, h = e.anchorOffset, f = e.focusOffset, l && F(n) && !Mt(t, a, u)) return n.clone();
2768
+ const d = Cs(a, h, u, f, t, n);
2763
2769
  if (d === null) return null;
2764
2770
  const [g, p] = d;
2765
2771
  return new Ce(g, p, F(n) ? n.format : 0, F(n) ? n.style : "");
@@ -2777,117 +2783,117 @@ function Lt(n, e, t, r = 1) {
2777
2783
  if (n.isCollapsed()) {
2778
2784
  const a = s.offset;
2779
2785
  if (t <= a && r > 0 || t < a && r < 0) {
2780
- const f = Math.max(0, a + r);
2781
- s.set(c, f, "element"), i.set(c, f, "element"), Fr(n);
2786
+ const u = Math.max(0, a + r);
2787
+ s.set(c, u, "element"), i.set(c, u, "element"), Fr(n);
2782
2788
  }
2783
2789
  } else {
2784
- const a = n.isBackward(), f = a ? i : s, h = f.getNode(), u = a ? s : i, d = u.getNode();
2790
+ const a = n.isBackward(), u = a ? i : s, h = u.getNode(), f = a ? s : i, d = f.getNode();
2785
2791
  if (e.is(h)) {
2786
- const g = f.offset;
2787
- (t <= g && r > 0 || t < g && r < 0) && f.set(c, Math.max(0, g + r), "element");
2788
- }
2789
- if (e.is(d)) {
2790
2792
  const g = u.offset;
2791
2793
  (t <= g && r > 0 || t < g && r < 0) && u.set(c, Math.max(0, g + r), "element");
2792
2794
  }
2795
+ if (e.is(d)) {
2796
+ const g = f.offset;
2797
+ (t <= g && r > 0 || t < g && r < 0) && f.set(c, Math.max(0, g + r), "element");
2798
+ }
2793
2799
  }
2794
2800
  Fr(n);
2795
2801
  }
2796
2802
  function Fr(n) {
2797
2803
  const e = n.anchor, t = e.offset, r = n.focus, s = r.offset, i = e.getNode(), o = r.getNode();
2798
2804
  if (n.isCollapsed()) {
2799
- if (!S(i)) return;
2805
+ if (!v(i)) return;
2800
2806
  const l = i.getChildrenSize(), c = t >= l, a = c ? i.getChildAtIndex(l - 1) : i.getChildAtIndex(t);
2801
2807
  if (N(a)) {
2802
- let f = 0;
2803
- c && (f = a.getTextContentSize()), e.set(a.__key, f, "text"), r.set(a.__key, f, "text");
2808
+ let u = 0;
2809
+ c && (u = a.getTextContentSize()), e.set(a.__key, u, "text"), r.set(a.__key, u, "text");
2804
2810
  }
2805
2811
  } else {
2806
- if (S(i)) {
2812
+ if (v(i)) {
2807
2813
  const l = i.getChildrenSize(), c = t >= l, a = c ? i.getChildAtIndex(l - 1) : i.getChildAtIndex(t);
2808
2814
  if (N(a)) {
2809
- let f = 0;
2810
- c && (f = a.getTextContentSize()), e.set(a.__key, f, "text");
2815
+ let u = 0;
2816
+ c && (u = a.getTextContentSize()), e.set(a.__key, u, "text");
2811
2817
  }
2812
2818
  }
2813
- if (S(o)) {
2819
+ if (v(o)) {
2814
2820
  const l = o.getChildrenSize(), c = s >= l, a = c ? o.getChildAtIndex(l - 1) : o.getChildAtIndex(s);
2815
2821
  if (N(a)) {
2816
- let f = 0;
2817
- c && (f = a.getTextContentSize()), r.set(a.__key, f, "text");
2822
+ let u = 0;
2823
+ c && (u = a.getTextContentSize()), r.set(a.__key, u, "text");
2818
2824
  }
2819
2825
  }
2820
2826
  }
2821
2827
  }
2822
2828
  function Ot(n, e, t, r, s) {
2823
2829
  let i = null, o = 0, l = null;
2824
- r !== null ? (i = r.__key, N(r) ? (o = r.getTextContentSize(), l = "text") : S(r) && (o = r.getChildrenSize(), l = "element")) : s !== null && (i = s.__key, N(s) ? l = "text" : S(s) && (l = "element")), i !== null && l !== null ? n.set(i, o, l) : (o = e.getIndexWithinParent(), o === -1 && (o = t.getChildrenSize()), n.set(t.__key, o, "element"));
2830
+ r !== null ? (i = r.__key, N(r) ? (o = r.getTextContentSize(), l = "text") : v(r) && (o = r.getChildrenSize(), l = "element")) : s !== null && (i = s.__key, N(s) ? l = "text" : v(s) && (l = "element")), i !== null && l !== null ? n.set(i, o, l) : (o = e.getIndexWithinParent(), o === -1 && (o = t.getChildrenSize()), n.set(t.__key, o, "element"));
2825
2831
  }
2826
2832
  function Dr(n, e, t, r, s) {
2827
2833
  n.type === "text" ? (n.key = t, e || (n.offset += s)) : n.offset > r.getIndexWithinParent() && (n.offset -= 1);
2828
2834
  }
2829
- function Ki(n, e, t, r, s, i, o) {
2830
- const l = r.anchorNode, c = r.focusNode, a = r.anchorOffset, f = r.focusOffset, h = document.activeElement;
2835
+ function $i(n, e, t, r, s, i, o) {
2836
+ const l = r.anchorNode, c = r.focusNode, a = r.anchorOffset, u = r.focusOffset, h = document.activeElement;
2831
2837
  if (s.has("collaboration") && h !== i || h !== null && Xr(h)) return;
2832
2838
  if (!F(e)) return void (n !== null && Mt(t, l, c) && r.removeAllRanges());
2833
- const u = e.anchor, d = e.focus, g = u.key, p = d.key, _ = Nt(t, g), m = Nt(t, p), y = u.offset, x = d.offset, C = e.format, b = e.style, v = e.isCollapsed();
2834
- let P = _, T = m, E = !1;
2835
- if (u.type === "text") {
2839
+ const f = e.anchor, d = e.focus, g = f.key, p = d.key, _ = Nt(t, g), m = Nt(t, p), y = f.offset, S = d.offset, k = e.format, T = e.style, x = e.isCollapsed();
2840
+ let P = _, C = m, E = !1;
2841
+ if (f.type === "text") {
2836
2842
  P = kt(_);
2837
- const z = u.getNode();
2838
- E = z.getFormat() !== C || z.getStyle() !== b;
2843
+ const W = f.getNode();
2844
+ E = W.getFormat() !== k || W.getStyle() !== T;
2839
2845
  } else F(n) && n.anchor.type === "text" && (E = !0);
2840
- var D, O, W, L, U;
2841
- if (d.type === "text" && (T = kt(m)), P !== null && T !== null && (v && (n === null || E || F(n) && (n.format !== C || n.style !== b)) && (D = C, O = b, W = y, L = g, U = performance.now(), _s = [D, O, W, L, U]), a !== y || f !== x || l !== P || c !== T || r.type === "Range" && v || (h !== null && i.contains(h) || i.focus({ preventScroll: !0 }), u.type === "element"))) {
2846
+ var D, O, z, L, U;
2847
+ if (d.type === "text" && (C = kt(m)), P !== null && C !== null && (x && (n === null || E || F(n) && (n.format !== k || n.style !== T)) && (D = k, O = T, z = y, L = g, U = performance.now(), _s = [D, O, z, L, U]), a !== y || u !== S || l !== P || c !== C || r.type === "Range" && x || (h !== null && i.contains(h) || i.focus({ preventScroll: !0 }), f.type === "element"))) {
2842
2848
  try {
2843
- r.setBaseAndExtent(P, y, T, x);
2849
+ r.setBaseAndExtent(P, y, C, S);
2844
2850
  } catch {
2845
2851
  }
2846
2852
  if (!s.has("skip-scroll-into-view") && e.isCollapsed() && i !== null && i === document.activeElement) {
2847
- const z = e instanceof Ce && e.anchor.type === "element" ? P.childNodes[y] || null : r.rangeCount > 0 ? r.getRangeAt(0) : null;
2848
- if (z !== null) {
2853
+ const W = e instanceof Ce && e.anchor.type === "element" ? P.childNodes[y] || null : r.rangeCount > 0 ? r.getRangeAt(0) : null;
2854
+ if (W !== null) {
2849
2855
  let de;
2850
- if (z instanceof Text) {
2856
+ if (W instanceof Text) {
2851
2857
  const De = document.createRange();
2852
- De.selectNode(z), de = De.getBoundingClientRect();
2853
- } else de = z.getBoundingClientRect();
2858
+ De.selectNode(W), de = De.getBoundingClientRect();
2859
+ } else de = W.getBoundingClientRect();
2854
2860
  (function(De, Be, Hn) {
2855
2861
  const qn = Hn.ownerDocument, Qn = qn.defaultView;
2856
2862
  if (Qn === null) return;
2857
- let { top: Zt, bottom: Gt } = Be, at = 0, ut = 0, he = Hn;
2863
+ let { top: Gt, bottom: Zt } = Be, at = 0, ut = 0, he = Hn;
2858
2864
  for (; he !== null; ) {
2859
- const Yt = he === qn.body;
2860
- if (Yt) at = 0, ut = Kt(De).innerHeight;
2865
+ const en = he === qn.body;
2866
+ if (en) at = 0, ut = Kt(De).innerHeight;
2861
2867
  else {
2862
2868
  const ft = he.getBoundingClientRect();
2863
2869
  at = ft.top, ut = ft.bottom;
2864
2870
  }
2865
2871
  let Re = 0;
2866
- if (Zt < at ? Re = -(at - Zt) : Gt > ut && (Re = Gt - ut), Re !== 0) if (Yt) Qn.scrollBy(0, Re);
2872
+ if (Gt < at ? Re = -(at - Gt) : Zt > ut && (Re = Zt - ut), Re !== 0) if (en) Qn.scrollBy(0, Re);
2867
2873
  else {
2868
2874
  const ft = he.scrollTop;
2869
2875
  he.scrollTop += Re;
2870
2876
  const Xn = he.scrollTop - ft;
2871
- Zt -= Xn, Gt -= Xn;
2877
+ Gt -= Xn, Zt -= Xn;
2872
2878
  }
2873
- if (Yt) break;
2879
+ if (en) break;
2874
2880
  he = Rt(he);
2875
2881
  }
2876
2882
  })(t, de, i);
2877
2883
  }
2878
2884
  }
2879
- Sn = !0;
2885
+ Tn = !0;
2880
2886
  }
2881
2887
  }
2882
- function ho(n) {
2888
+ function go(n) {
2883
2889
  let e = I() || ot();
2884
2890
  e === null && (e = G().selectEnd()), e.insertNodes(n);
2885
2891
  }
2886
- function an(n) {
2892
+ function un(n) {
2887
2893
  let e = n;
2888
2894
  n.isCollapsed() || e.removeText();
2889
2895
  const t = I();
2890
- F(t) && (e = t), F(e) || k(161);
2896
+ F(t) && (e = t), F(e) || b(161);
2891
2897
  const r = e.anchor;
2892
2898
  let s = r.getNode(), i = r.offset;
2893
2899
  for (; !_e(s); ) [s, i] = Ji(s, i);
@@ -2905,7 +2911,7 @@ function Ji(n, e) {
2905
2911
  const i = e === 0 ? 0 : 1;
2906
2912
  return [t, s[0].getIndexWithinParent() + i];
2907
2913
  }
2908
- if (!S(n) || e === 0) return [t, n.getIndexWithinParent()];
2914
+ if (!v(n) || e === 0) return [t, n.getIndexWithinParent()];
2909
2915
  const r = n.getChildAtIndex(e);
2910
2916
  if (r) {
2911
2917
  const s = new Ce(ie(n.__key, e, "element"), ie(n.__key, e, "element"), 0, ""), i = n.insertNewAfter(s);
@@ -2913,29 +2919,29 @@ function Ji(n, e) {
2913
2919
  }
2914
2920
  return [t, n.getIndexWithinParent() + 1];
2915
2921
  }
2916
- let R = null, K = null, Q = !1, un = !1, pt = 0;
2922
+ let R = null, K = null, Q = !1, fn = !1, pt = 0;
2917
2923
  const Lr = { characterData: !0, childList: !0, subtree: !0 };
2918
2924
  function lt() {
2919
2925
  return Q || R !== null && R._readOnly;
2920
2926
  }
2921
2927
  function q() {
2922
- Q && k(13);
2928
+ Q && b(13);
2923
2929
  }
2924
2930
  function bs() {
2925
- pt > 99 && k(14);
2931
+ pt > 99 && b(14);
2926
2932
  }
2927
2933
  function fe() {
2928
- return R === null && k(195, ws()), R;
2934
+ return R === null && b(195, ws()), R;
2929
2935
  }
2930
2936
  function M() {
2931
- return K === null && k(196, ws()), K;
2937
+ return K === null && b(196, ws()), K;
2932
2938
  }
2933
2939
  function ws() {
2934
2940
  let n = 0;
2935
- const e = /* @__PURE__ */ new Set(), t = Xt.version;
2941
+ const e = /* @__PURE__ */ new Set(), t = Yt.version;
2936
2942
  if (typeof window < "u") for (const s of document.querySelectorAll("[contenteditable]")) {
2937
- const i = Wt(s);
2938
- if (Mn(i)) n++;
2943
+ const i = zt(s);
2944
+ if (zn(i)) n++;
2939
2945
  else if (i) {
2940
2946
  let o = String(i.constructor.version || "<0.17.1");
2941
2947
  o === t && (o += " (separately built, likely a bundler configuration issue)"), e.add(o);
@@ -2944,13 +2950,13 @@ function ws() {
2944
2950
  let r = ` Detected on the page: ${n} compatible editor(s) with version ${t}`;
2945
2951
  return e.size && (r += ` and incompatible editors with versions ${Array.from(e).join(", ")}`), r;
2946
2952
  }
2947
- function $i() {
2953
+ function Ui() {
2948
2954
  return K;
2949
2955
  }
2950
2956
  function Or(n, e, t) {
2951
2957
  const r = e.__type, s = function(l, c) {
2952
2958
  const a = l._nodes.get(c);
2953
- return a === void 0 && k(30, c), a;
2959
+ return a === void 0 && b(30, c), a;
2954
2960
  }(n, r);
2955
2961
  let i = t.get(r);
2956
2962
  i === void 0 && (i = Array.from(s.transforms), t.set(r, i));
@@ -2967,16 +2973,16 @@ function Ns(n, e) {
2967
2973
  Array.isArray(e) || (r = [e]);
2968
2974
  for (const s of r) t.add(s);
2969
2975
  }
2970
- function go(n) {
2976
+ function _o(n) {
2971
2977
  return Vn(n, M()._nodes);
2972
2978
  }
2973
2979
  function Vn(n, e) {
2974
2980
  const t = n.type, r = e.get(t);
2975
- r === void 0 && k(17, t);
2981
+ r === void 0 && b(17, t);
2976
2982
  const s = r.klass;
2977
- n.type !== s.getType() && k(18, s.name);
2983
+ n.type !== s.getType() && b(18, s.name);
2978
2984
  const i = s.importJSON(n), o = n.children;
2979
- if (S(i) && Array.isArray(o)) for (let l = 0; l < o.length; l++) {
2985
+ if (v(i) && Array.isArray(o)) for (let l = 0; l < o.length; l++) {
2980
2986
  const c = Vn(o[l], e);
2981
2987
  i.append(c);
2982
2988
  }
@@ -2994,70 +3000,70 @@ function Ar(n, e, t) {
2994
3000
  function me(n, e) {
2995
3001
  const t = n._pendingEditorState, r = n._rootElement, s = n._headless || r === null;
2996
3002
  if (t === null) return;
2997
- const i = n._editorState, o = i._selection, l = t._selection, c = n._dirtyType !== Ee, a = R, f = Q, h = K, u = n._updating, d = n._observer;
3003
+ const i = n._editorState, o = i._selection, l = t._selection, c = n._dirtyType !== Ee, a = R, u = Q, h = K, f = n._updating, d = n._observer;
2998
3004
  let g = null;
2999
3005
  if (n._pendingEditorState = null, n._editorState = t, !s && c && d !== null) {
3000
3006
  K = n, R = t, Q = !1, n._updating = !0;
3001
3007
  try {
3002
- const v = n._dirtyType, P = n._dirtyElements, T = n._dirtyLeaves;
3003
- d.disconnect(), g = Di(i, t, n, v, P, T);
3004
- } catch (v) {
3005
- if (v instanceof Error && n._onError(v), un) throw v;
3006
- return Ds(n, null, r, t), Qr(n), n._dirtyType = Me, un = !0, me(n, i), void (un = !1);
3008
+ const x = n._dirtyType, P = n._dirtyElements, C = n._dirtyLeaves;
3009
+ d.disconnect(), g = Li(i, t, n, x, P, C);
3010
+ } catch (x) {
3011
+ if (x instanceof Error && n._onError(x), fn) throw x;
3012
+ return Ds(n, null, r, t), Qr(n), n._dirtyType = Me, fn = !0, me(n, i), void (fn = !1);
3007
3013
  } finally {
3008
- d.observe(r, Lr), n._updating = u, R = a, Q = f, K = h;
3014
+ d.observe(r, Lr), n._updating = f, R = a, Q = u, K = h;
3009
3015
  }
3010
3016
  }
3011
3017
  t._readOnly || (t._readOnly = !0);
3012
- const p = n._dirtyLeaves, _ = n._dirtyElements, m = n._normalizedNodes, y = n._updateTags, x = n._deferred;
3013
- c && (n._dirtyType = Ee, n._cloneNotNeeded.clear(), n._dirtyLeaves = /* @__PURE__ */ new Set(), n._dirtyElements = /* @__PURE__ */ new Map(), n._normalizedNodes = /* @__PURE__ */ new Set(), n._updateTags = /* @__PURE__ */ new Set()), function(v, P) {
3014
- const T = v._decorators;
3015
- let E = v._pendingDecorators || T;
3018
+ const p = n._dirtyLeaves, _ = n._dirtyElements, m = n._normalizedNodes, y = n._updateTags, S = n._deferred;
3019
+ c && (n._dirtyType = Ee, n._cloneNotNeeded.clear(), n._dirtyLeaves = /* @__PURE__ */ new Set(), n._dirtyElements = /* @__PURE__ */ new Map(), n._normalizedNodes = /* @__PURE__ */ new Set(), n._updateTags = /* @__PURE__ */ new Set()), function(x, P) {
3020
+ const C = x._decorators;
3021
+ let E = x._pendingDecorators || C;
3016
3022
  const D = P._nodeMap;
3017
3023
  let O;
3018
- for (O in E) D.has(O) || (E === T && (E = es(v)), delete E[O]);
3024
+ for (O in E) D.has(O) || (E === C && (E = es(x)), delete E[O]);
3019
3025
  }(n, t);
3020
- const C = s ? null : se(n._window);
3021
- if (n._editable && C !== null && (c || l === null || l.dirty)) {
3026
+ const k = s ? null : se(n._window);
3027
+ if (n._editable && k !== null && (c || l === null || l.dirty)) {
3022
3028
  K = n, R = t;
3023
3029
  try {
3024
3030
  if (d !== null && d.disconnect(), c || l === null || l.dirty) {
3025
- const v = n._blockCursorElement;
3026
- v !== null && Kn(v, n, r), Ki(o, l, n, C, y, r);
3031
+ const x = n._blockCursorElement;
3032
+ x !== null && $n(x, n, r), $i(o, l, n, k, y, r);
3027
3033
  }
3028
3034
  ki(n, r, l), d !== null && d.observe(r, Lr);
3029
3035
  } finally {
3030
3036
  K = h, R = a;
3031
3037
  }
3032
3038
  }
3033
- g !== null && function(v, P, T, E, D) {
3034
- const O = Array.from(v._listeners.mutation), W = O.length;
3035
- for (let L = 0; L < W; L++) {
3036
- const [U, z] = O[L], de = P.get(z);
3037
- de !== void 0 && U(de, { dirtyLeaves: E, prevEditorState: D, updateTags: T });
3038
- }
3039
- }(n, g, y, p, i), F(l) || l === null || o !== null && o.is(l) || n.dispatchCommand(bn, void 0);
3040
- const b = n._pendingDecorators;
3041
- b !== null && (n._decorators = b, n._pendingDecorators = null, Ge("decorator", n, !0, b)), function(v, P, T) {
3042
- const E = ir(P), D = ir(T);
3043
- E !== D && Ge("textcontent", v, !0, D);
3044
- }(n, e || i, t), Ge("update", n, !0, { dirtyElements: _, dirtyLeaves: p, editorState: t, normalizedNodes: m, prevEditorState: e || i, tags: y }), function(v, P) {
3045
- if (v._deferred = [], P.length !== 0) {
3046
- const T = v._updating;
3047
- v._updating = !0;
3039
+ g !== null && function(x, P, C, E, D) {
3040
+ const O = Array.from(x._listeners.mutation), z = O.length;
3041
+ for (let L = 0; L < z; L++) {
3042
+ const [U, W] = O[L], de = P.get(W);
3043
+ de !== void 0 && U(de, { dirtyLeaves: E, prevEditorState: D, updateTags: C });
3044
+ }
3045
+ }(n, g, y, p, i), F(l) || l === null || o !== null && o.is(l) || n.dispatchCommand(wn, void 0);
3046
+ const T = n._pendingDecorators;
3047
+ T !== null && (n._decorators = T, n._pendingDecorators = null, Ge("decorator", n, !0, T)), function(x, P, C) {
3048
+ const E = ir(P), D = ir(C);
3049
+ E !== D && Ge("textcontent", x, !0, D);
3050
+ }(n, e || i, t), Ge("update", n, !0, { dirtyElements: _, dirtyLeaves: p, editorState: t, normalizedNodes: m, prevEditorState: e || i, tags: y }), function(x, P) {
3051
+ if (x._deferred = [], P.length !== 0) {
3052
+ const C = x._updating;
3053
+ x._updating = !0;
3048
3054
  try {
3049
3055
  for (let E = 0; E < P.length; E++) P[E]();
3050
3056
  } finally {
3051
- v._updating = T;
3057
+ x._updating = C;
3052
3058
  }
3053
3059
  }
3054
- }(n, x), function(v) {
3055
- const P = v._updates;
3060
+ }(n, S), function(x) {
3061
+ const P = x._updates;
3056
3062
  if (P.length !== 0) {
3057
- const T = P.shift();
3058
- if (T) {
3059
- const [E, D] = T;
3060
- Ps(v, E, D);
3063
+ const C = P.shift();
3064
+ if (C) {
3065
+ const [E, D] = C;
3066
+ Ps(x, E, D);
3061
3067
  }
3062
3068
  }
3063
3069
  }(n);
@@ -3086,7 +3092,7 @@ function Es(n, e, t) {
3086
3092
  const l = o[s];
3087
3093
  if (l !== void 0) {
3088
3094
  const c = Array.from(l), a = c.length;
3089
- for (let f = 0; f < a; f++) if (c[f](t, n) === !0) return !0;
3095
+ for (let u = 0; u < a; u++) if (c[u](t, n) === !0) return !0;
3090
3096
  }
3091
3097
  }
3092
3098
  }
@@ -3103,7 +3109,7 @@ function Mr(n, e) {
3103
3109
  if (o !== void 0) {
3104
3110
  if (l = o.onUpdate, o.skipTransforms && (r = !0), o.discrete) {
3105
3111
  const c = n._pendingEditorState;
3106
- c === null && k(191), c._flushSync = !0;
3112
+ c === null && b(191), c._flushSync = !0;
3107
3113
  }
3108
3114
  l && n._deferred.push(l), Ns(n, o.tag);
3109
3115
  }
@@ -3118,77 +3124,77 @@ function Ps(n, e, t) {
3118
3124
  t !== void 0 && (s = t.onUpdate, Ns(n, t.tag), i = t.skipTransforms || !1, o = t.discrete || !1), s && n._deferred.push(s);
3119
3125
  const l = n._editorState;
3120
3126
  let c = n._pendingEditorState, a = !1;
3121
- (c === null || c._readOnly) && (c = n._pendingEditorState = new Qt(new Map((c || l)._nodeMap)), a = !0), c._flushSync = o;
3122
- const f = R, h = Q, u = K, d = n._updating;
3127
+ (c === null || c._readOnly) && (c = n._pendingEditorState = new Xt(new Map((c || l)._nodeMap)), a = !0), c._flushSync = o;
3128
+ const u = R, h = Q, f = K, d = n._updating;
3123
3129
  R = c, Q = !1, n._updating = !0, K = n;
3124
3130
  try {
3125
3131
  a && (n._headless ? l._selection !== null && (c._selection = l._selection.clone()) : c._selection = function(m) {
3126
- const y = m.getEditorState()._selection, x = se(m._window);
3127
- return F(y) || y == null ? Ht(y, x, m, null) : y.clone();
3132
+ const y = m.getEditorState()._selection, S = se(m._window);
3133
+ return F(y) || y == null ? qt(y, S, m, null) : y.clone();
3128
3134
  }(n));
3129
3135
  const p = n._compositionKey;
3130
3136
  e(), i = Mr(n, i), function(m, y) {
3131
- const x = y.getEditorState()._selection, C = m._selection;
3132
- if (F(C)) {
3133
- const b = C.anchor, v = C.focus;
3137
+ const S = y.getEditorState()._selection, k = m._selection;
3138
+ if (F(k)) {
3139
+ const T = k.anchor, x = k.focus;
3134
3140
  let P;
3135
- if (b.type === "text" && (P = b.getNode(), P.selectionTransform(x, C)), v.type === "text") {
3136
- const T = v.getNode();
3137
- P !== T && T.selectionTransform(x, C);
3141
+ if (T.type === "text" && (P = T.getNode(), P.selectionTransform(S, k)), x.type === "text") {
3142
+ const C = x.getNode();
3143
+ P !== C && C.selectionTransform(S, k);
3138
3144
  }
3139
3145
  }
3140
3146
  }(c, n), n._dirtyType !== Ee && (i ? function(m, y) {
3141
- const x = y._dirtyLeaves, C = m._nodeMap;
3142
- for (const b of x) {
3143
- const v = C.get(b);
3144
- N(v) && v.isAttached() && v.isSimpleText() && !v.isUnmergeable() && rr(v);
3147
+ const S = y._dirtyLeaves, k = m._nodeMap;
3148
+ for (const T of S) {
3149
+ const x = k.get(T);
3150
+ N(x) && x.isAttached() && x.isSimpleText() && !x.isUnmergeable() && rr(x);
3145
3151
  }
3146
3152
  }(c, n) : function(m, y) {
3147
- const x = y._dirtyLeaves, C = y._dirtyElements, b = m._nodeMap, v = ye(), P = /* @__PURE__ */ new Map();
3148
- let T = x, E = T.size, D = C, O = D.size;
3153
+ const S = y._dirtyLeaves, k = y._dirtyElements, T = m._nodeMap, x = ye(), P = /* @__PURE__ */ new Map();
3154
+ let C = S, E = C.size, D = k, O = D.size;
3149
3155
  for (; E > 0 || O > 0; ) {
3150
3156
  if (E > 0) {
3151
3157
  y._dirtyLeaves = /* @__PURE__ */ new Set();
3152
- for (const W of T) {
3153
- const L = b.get(W);
3154
- N(L) && L.isAttached() && L.isSimpleText() && !L.isUnmergeable() && rr(L), L !== void 0 && Ir(L, v) && Or(y, L, P), x.add(W);
3158
+ for (const z of C) {
3159
+ const L = T.get(z);
3160
+ N(L) && L.isAttached() && L.isSimpleText() && !L.isUnmergeable() && rr(L), L !== void 0 && Ir(L, x) && Or(y, L, P), S.add(z);
3155
3161
  }
3156
- if (T = y._dirtyLeaves, E = T.size, E > 0) {
3162
+ if (C = y._dirtyLeaves, E = C.size, E > 0) {
3157
3163
  pt++;
3158
3164
  continue;
3159
3165
  }
3160
3166
  }
3161
3167
  y._dirtyLeaves = /* @__PURE__ */ new Set(), y._dirtyElements = /* @__PURE__ */ new Map();
3162
- for (const W of D) {
3163
- const L = W[0], U = W[1];
3168
+ for (const z of D) {
3169
+ const L = z[0], U = z[1];
3164
3170
  if (L !== "root" && !U) continue;
3165
- const z = b.get(L);
3166
- z !== void 0 && Ir(z, v) && Or(y, z, P), C.set(L, U);
3171
+ const W = T.get(L);
3172
+ W !== void 0 && Ir(W, x) && Or(y, W, P), k.set(L, U);
3167
3173
  }
3168
- T = y._dirtyLeaves, E = T.size, D = y._dirtyElements, O = D.size, pt++;
3174
+ C = y._dirtyLeaves, E = C.size, D = y._dirtyElements, O = D.size, pt++;
3169
3175
  }
3170
- y._dirtyLeaves = x, y._dirtyElements = C;
3171
- }(c, n), Mr(n), function(m, y, x, C) {
3172
- const b = m._nodeMap, v = y._nodeMap, P = [];
3173
- for (const [T] of C) {
3174
- const E = v.get(T);
3175
- E !== void 0 && (E.isAttached() || (S(E) && os(E, T, b, v, P, C), b.has(T) || C.delete(T), P.push(T)));
3176
+ y._dirtyLeaves = S, y._dirtyElements = k;
3177
+ }(c, n), Mr(n), function(m, y, S, k) {
3178
+ const T = m._nodeMap, x = y._nodeMap, P = [];
3179
+ for (const [C] of k) {
3180
+ const E = x.get(C);
3181
+ E !== void 0 && (E.isAttached() || (v(E) && os(E, C, T, x, P, k), T.has(C) || k.delete(C), P.push(C)));
3176
3182
  }
3177
- for (const T of P) v.delete(T);
3178
- for (const T of x) {
3179
- const E = v.get(T);
3180
- E === void 0 || E.isAttached() || (b.has(T) || x.delete(T), v.delete(T));
3183
+ for (const C of P) x.delete(C);
3184
+ for (const C of S) {
3185
+ const E = x.get(C);
3186
+ E === void 0 || E.isAttached() || (T.has(C) || S.delete(C), x.delete(C));
3181
3187
  }
3182
3188
  }(l, c, n._dirtyLeaves, n._dirtyElements)), p !== n._compositionKey && (c._flushSync = !0);
3183
3189
  const _ = c._selection;
3184
3190
  if (F(_)) {
3185
- const m = c._nodeMap, y = _.anchor.key, x = _.focus.key;
3186
- m.get(y) !== void 0 && m.get(x) !== void 0 || k(19);
3187
- } else jt(_) && _._nodes.size === 0 && (c._selection = null);
3191
+ const m = c._nodeMap, y = _.anchor.key, S = _.focus.key;
3192
+ m.get(y) !== void 0 && m.get(S) !== void 0 || b(19);
3193
+ } else Ht(_) && _._nodes.size === 0 && (c._selection = null);
3188
3194
  } catch (p) {
3189
3195
  return p instanceof Error && n._onError(p), n._pendingEditorState = l, n._dirtyType = Me, n._cloneNotNeeded.clear(), n._dirtyLeaves = /* @__PURE__ */ new Set(), n._dirtyElements.clear(), void me(n);
3190
3196
  } finally {
3191
- R = f, Q = h, K = u, n._updating = d, pt = 0;
3197
+ R = u, Q = h, K = f, n._updating = d, pt = 0;
3192
3198
  }
3193
3199
  n._dirtyType !== Ee || function(p, _) {
3194
3200
  const m = _.getEditorState()._selection, y = p._selection;
@@ -3203,7 +3209,7 @@ function Ps(n, e, t) {
3203
3209
  function X(n, e, t) {
3204
3210
  n._updating ? n._updates.push([e, t]) : Ps(n, e, t);
3205
3211
  }
3206
- class qt extends Ut {
3212
+ class Qt extends Vt {
3207
3213
  constructor(e) {
3208
3214
  super(e), this.__first = null, this.__last = null, this.__size = 0, this.__format = 0, this.__style = "", this.__indent = 0, this.__dir = null;
3209
3215
  }
@@ -3253,7 +3259,7 @@ class qt extends Ut {
3253
3259
  const e = [];
3254
3260
  let t = this.getFirstChild();
3255
3261
  for (; t !== null; ) {
3256
- if (N(t) && e.push(t), S(t)) {
3262
+ if (N(t) && e.push(t), v(t)) {
3257
3263
  const r = t.getAllTextNodes();
3258
3264
  e.push(...r);
3259
3265
  }
@@ -3263,7 +3269,7 @@ class qt extends Ut {
3263
3269
  }
3264
3270
  getFirstDescendant() {
3265
3271
  let e = this.getFirstChild();
3266
- for (; S(e); ) {
3272
+ for (; v(e); ) {
3267
3273
  const t = e.getFirstChild();
3268
3274
  if (t === null) break;
3269
3275
  e = t;
@@ -3272,7 +3278,7 @@ class qt extends Ut {
3272
3278
  }
3273
3279
  getLastDescendant() {
3274
3280
  let e = this.getLastChild();
3275
- for (; S(e); ) {
3281
+ for (; v(e); ) {
3276
3282
  const t = e.getLastChild();
3277
3283
  if (t === null) break;
3278
3284
  e = t;
@@ -3283,10 +3289,10 @@ class qt extends Ut {
3283
3289
  const t = this.getChildren(), r = t.length;
3284
3290
  if (e >= r) {
3285
3291
  const i = t[r - 1];
3286
- return S(i) && i.getLastDescendant() || i || null;
3292
+ return v(i) && i.getLastDescendant() || i || null;
3287
3293
  }
3288
3294
  const s = t[e];
3289
- return S(s) && s.getFirstDescendant() || s || null;
3295
+ return v(s) && s.getFirstDescendant() || s || null;
3290
3296
  }
3291
3297
  getFirstChild() {
3292
3298
  const e = this.getLatest().__first;
@@ -3294,7 +3300,7 @@ class qt extends Ut {
3294
3300
  }
3295
3301
  getFirstChildOrThrow() {
3296
3302
  const e = this.getFirstChild();
3297
- return e === null && k(45, this.__key), e;
3303
+ return e === null && b(45, this.__key), e;
3298
3304
  }
3299
3305
  getLastChild() {
3300
3306
  const e = this.getLatest().__last;
@@ -3302,7 +3308,7 @@ class qt extends Ut {
3302
3308
  }
3303
3309
  getLastChildOrThrow() {
3304
3310
  const e = this.getLastChild();
3305
- return e === null && k(96, this.__key), e;
3311
+ return e === null && b(96, this.__key), e;
3306
3312
  }
3307
3313
  getChildAtIndex(e) {
3308
3314
  const t = this.getChildrenSize();
@@ -3325,7 +3331,7 @@ class qt extends Ut {
3325
3331
  const t = this.getChildren(), r = t.length;
3326
3332
  for (let s = 0; s < r; s++) {
3327
3333
  const i = t[s];
3328
- e += i.getTextContent(), S(i) && s !== r - 1 && !i.isInline() && (e += ae);
3334
+ e += i.getTextContent(), v(i) && s !== r - 1 && !i.isInline() && (e += ae);
3329
3335
  }
3330
3336
  return e;
3331
3337
  }
@@ -3334,7 +3340,7 @@ class qt extends Ut {
3334
3340
  const t = this.getChildren(), r = t.length;
3335
3341
  for (let s = 0; s < r; s++) {
3336
3342
  const i = t[s];
3337
- e += i.getTextContentSize(), S(i) && s !== r - 1 && !i.isInline() && (e += ae.length);
3343
+ e += i.getTextContentSize(), v(i) && s !== r - 1 && !i.isInline() && (e += ae.length);
3338
3344
  }
3339
3345
  return e;
3340
3346
  }
@@ -3356,10 +3362,10 @@ class qt extends Ut {
3356
3362
  if (!this.canBeEmpty()) {
3357
3363
  if (e === 0 && t === 0) {
3358
3364
  const c = this.getFirstChild();
3359
- if (N(c) || S(c)) return c.select(0, 0);
3365
+ if (N(c) || v(c)) return c.select(0, 0);
3360
3366
  } else if (!(e !== void 0 && e !== o || t !== void 0 && t !== o)) {
3361
3367
  const c = this.getLastChild();
3362
- if (N(c) || S(c)) return c.select();
3368
+ if (N(c) || v(c)) return c.select();
3363
3369
  }
3364
3370
  }
3365
3371
  s === void 0 && (s = o), i === void 0 && (i = o);
@@ -3395,8 +3401,8 @@ class qt extends Ut {
3395
3401
  return this.getWritable().__indent = e, this;
3396
3402
  }
3397
3403
  splice(e, t, r) {
3398
- const s = r.length, i = this.getChildrenSize(), o = this.getWritable(), l = o.__key, c = [], a = [], f = this.getChildAtIndex(e + t);
3399
- let h = null, u = i - t + s;
3404
+ const s = r.length, i = this.getChildrenSize(), o = this.getWritable(), l = o.__key, c = [], a = [], u = this.getChildAtIndex(e + t);
3405
+ let h = null, f = i - t + s;
3400
3406
  if (e !== 0) if (e === i) h = this.getLastChild();
3401
3407
  else {
3402
3408
  const g = this.getChildAtIndex(e);
@@ -3405,7 +3411,7 @@ class qt extends Ut {
3405
3411
  if (t > 0) {
3406
3412
  let g = h === null ? this.getFirstChild() : h.getNextSibling();
3407
3413
  for (let p = 0; p < t; p++) {
3408
- g === null && k(100);
3414
+ g === null && b(100);
3409
3415
  const _ = g.getNextSibling(), m = g.__key;
3410
3416
  Ne(g.getWritable()), a.push(m), g = _;
3411
3417
  }
@@ -3415,33 +3421,41 @@ class qt extends Ut {
3415
3421
  const p = r[g];
3416
3422
  d !== null && p.is(d) && (h = d = d.getPreviousSibling());
3417
3423
  const _ = p.getWritable();
3418
- _.__parent === l && u--, Ne(_);
3424
+ _.__parent === l && f--, Ne(_);
3419
3425
  const m = p.__key;
3420
3426
  if (d === null) o.__first = m, _.__prev = null;
3421
3427
  else {
3422
3428
  const y = d.getWritable();
3423
3429
  y.__next = m, _.__prev = y.__key;
3424
3430
  }
3425
- p.__key === l && k(76), _.__parent = l, c.push(m), d = p;
3431
+ p.__key === l && b(76), _.__parent = l, c.push(m), d = p;
3426
3432
  }
3427
3433
  if (e + t === i)
3428
3434
  d !== null && (d.getWritable().__next = null, o.__last = d.__key);
3429
- else if (f !== null) {
3430
- const g = f.getWritable();
3435
+ else if (u !== null) {
3436
+ const g = u.getWritable();
3431
3437
  if (d !== null) {
3432
3438
  const p = d.getWritable();
3433
- g.__prev = d.__key, p.__next = f.__key;
3439
+ g.__prev = d.__key, p.__next = u.__key;
3434
3440
  } else g.__prev = null;
3435
3441
  }
3436
- if (o.__size = u, a.length) {
3442
+ if (o.__size = f, a.length) {
3437
3443
  const g = I();
3438
3444
  if (F(g)) {
3439
3445
  const p = new Set(a), _ = new Set(c), { anchor: m, focus: y } = g;
3440
- Wr(m, p, _) && Ot(m, m.getNode(), this, h, f), Wr(y, p, _) && Ot(y, y.getNode(), this, h, f), u !== 0 || this.canBeEmpty() || Pe(this) || this.remove();
3446
+ zr(m, p, _) && Ot(m, m.getNode(), this, h, u), zr(y, p, _) && Ot(y, y.getNode(), this, h, u), f !== 0 || this.canBeEmpty() || Pe(this) || this.remove();
3441
3447
  }
3442
3448
  }
3443
3449
  return o;
3444
3450
  }
3451
+ exportDOM(e) {
3452
+ const { element: t } = super.exportDOM(e);
3453
+ if (t && Jt(t)) {
3454
+ const r = this.getIndent();
3455
+ r > 0 && (t.style.paddingInlineStart = 40 * r + "px");
3456
+ }
3457
+ return { element: t };
3458
+ }
3445
3459
  exportJSON() {
3446
3460
  return { children: [], direction: this.getDirection(), format: this.getFormatType(), indent: this.getIndent(), type: "element", version: 1 };
3447
3461
  }
@@ -3488,10 +3502,10 @@ class qt extends Ut {
3488
3502
  return !1;
3489
3503
  }
3490
3504
  }
3491
- function S(n) {
3492
- return n instanceof qt;
3505
+ function v(n) {
3506
+ return n instanceof Qt;
3493
3507
  }
3494
- function Wr(n, e, t) {
3508
+ function zr(n, e, t) {
3495
3509
  let r = n.getNode();
3496
3510
  for (; r; ) {
3497
3511
  const s = r.__key;
@@ -3500,12 +3514,12 @@ function Wr(n, e, t) {
3500
3514
  }
3501
3515
  return !1;
3502
3516
  }
3503
- class Ui extends Ut {
3517
+ class Vi extends Vt {
3504
3518
  constructor(e) {
3505
3519
  super(e);
3506
3520
  }
3507
3521
  decorate(e, t) {
3508
- k(47);
3522
+ b(47);
3509
3523
  }
3510
3524
  isIsolated() {
3511
3525
  return !1;
@@ -3518,9 +3532,9 @@ class Ui extends Ut {
3518
3532
  }
3519
3533
  }
3520
3534
  function A(n) {
3521
- return n instanceof Ui;
3535
+ return n instanceof Vi;
3522
3536
  }
3523
- class ct extends qt {
3537
+ class ct extends Qt {
3524
3538
  static getType() {
3525
3539
  return "root";
3526
3540
  }
@@ -3531,23 +3545,23 @@ class ct extends qt {
3531
3545
  super("root"), this.__cachedText = null;
3532
3546
  }
3533
3547
  getTopLevelElementOrThrow() {
3534
- k(51);
3548
+ b(51);
3535
3549
  }
3536
3550
  getTextContent() {
3537
3551
  const e = this.__cachedText;
3538
3552
  return !lt() && M()._dirtyType !== Ee || e === null ? super.getTextContent() : e;
3539
3553
  }
3540
3554
  remove() {
3541
- k(52);
3555
+ b(52);
3542
3556
  }
3543
3557
  replace(e) {
3544
- k(53);
3558
+ b(53);
3545
3559
  }
3546
3560
  insertBefore(e) {
3547
- k(54);
3561
+ b(54);
3548
3562
  }
3549
3563
  insertAfter(e) {
3550
- k(55);
3564
+ b(55);
3551
3565
  }
3552
3566
  updateDOM(e, t) {
3553
3567
  return !1;
@@ -3555,7 +3569,7 @@ class ct extends qt {
3555
3569
  append(...e) {
3556
3570
  for (let t = 0; t < e.length; t++) {
3557
3571
  const r = e[t];
3558
- S(r) || A(r) || k(56);
3572
+ v(r) || A(r) || b(56);
3559
3573
  }
3560
3574
  return super.append(...e);
3561
3575
  }
@@ -3570,17 +3584,17 @@ class ct extends qt {
3570
3584
  return !0;
3571
3585
  }
3572
3586
  }
3573
- function Z(n) {
3587
+ function Y(n) {
3574
3588
  return n instanceof ct;
3575
3589
  }
3576
3590
  function jn() {
3577
- return new Qt(/* @__PURE__ */ new Map([["root", new ct()]]));
3591
+ return new Xt(/* @__PURE__ */ new Map([["root", new ct()]]));
3578
3592
  }
3579
3593
  function Fs(n) {
3580
3594
  const e = n.exportJSON(), t = n.constructor;
3581
- if (e.type !== t.getType() && k(130, t.name), S(n)) {
3595
+ if (e.type !== t.getType() && b(130, t.name), v(n)) {
3582
3596
  const r = e.children;
3583
- Array.isArray(r) || k(59, t.name);
3597
+ Array.isArray(r) || b(59, t.name);
3584
3598
  const s = n.getChildren();
3585
3599
  for (let i = 0; i < s.length; i++) {
3586
3600
  const o = Fs(s[i]);
@@ -3589,7 +3603,7 @@ function Fs(n) {
3589
3603
  }
3590
3604
  return e;
3591
3605
  }
3592
- class Qt {
3606
+ class Xt {
3593
3607
  constructor(e, t) {
3594
3608
  this._nodeMap = e, this._selection = t || null, this._flushSync = !1, this._readOnly = !1;
3595
3609
  }
@@ -3600,14 +3614,14 @@ class Qt {
3600
3614
  return Ar(t && t.editor || null, this, e);
3601
3615
  }
3602
3616
  clone(e) {
3603
- const t = new Qt(this._nodeMap, e === void 0 ? this._selection : e);
3617
+ const t = new Xt(this._nodeMap, e === void 0 ? this._selection : e);
3604
3618
  return t._readOnly = !0, t;
3605
3619
  }
3606
3620
  toJSON() {
3607
3621
  return Ar(null, this, () => ({ root: Fs(G()) }));
3608
3622
  }
3609
3623
  }
3610
- class Vi extends qt {
3624
+ class ji extends Qt {
3611
3625
  static getType() {
3612
3626
  return "artificial";
3613
3627
  }
@@ -3615,7 +3629,7 @@ class Vi extends qt {
3615
3629
  return document.createElement("div");
3616
3630
  }
3617
3631
  }
3618
- class ze extends qt {
3632
+ class We extends Qt {
3619
3633
  constructor(e) {
3620
3634
  super(e), this.__textFormat = 0, this.__textStyle = "";
3621
3635
  }
@@ -3644,7 +3658,7 @@ class ze extends qt {
3644
3658
  return t.__textStyle = e, t;
3645
3659
  }
3646
3660
  static clone(e) {
3647
- return new ze(e.__key);
3661
+ return new We(e.__key);
3648
3662
  }
3649
3663
  afterCloneFrom(e) {
3650
3664
  super.afterCloneFrom(e), this.__textFormat = e.__textFormat, this.__textStyle = e.__textStyle;
@@ -3657,18 +3671,16 @@ class ze extends qt {
3657
3671
  return !1;
3658
3672
  }
3659
3673
  static importDOM() {
3660
- return { p: (e) => ({ conversion: ji, priority: 0 }) };
3674
+ return { p: (e) => ({ conversion: Hi, priority: 0 }) };
3661
3675
  }
3662
3676
  exportDOM(e) {
3663
3677
  const { element: t } = super.exportDOM(e);
3664
- if (t && Jn(t)) {
3678
+ if (t && Jt(t)) {
3665
3679
  this.isEmpty() && t.append(document.createElement("br"));
3666
3680
  const r = this.getFormatType();
3667
3681
  t.style.textAlign = r;
3668
3682
  const s = this.getDirection();
3669
3683
  s && (t.dir = s);
3670
- const i = this.getIndent();
3671
- i > 0 && (t.style.textIndent = 20 * i + "px");
3672
3684
  }
3673
3685
  return { element: t };
3674
3686
  }
@@ -3694,30 +3706,25 @@ class ze extends qt {
3694
3706
  return !1;
3695
3707
  }
3696
3708
  }
3697
- function ji(n) {
3709
+ function Hi(n) {
3698
3710
  const e = ve();
3699
- if (n.style) {
3700
- e.setFormat(n.style.textAlign);
3701
- const t = parseInt(n.style.textIndent, 10) / 20;
3702
- t > 0 && e.setIndent(t);
3703
- }
3704
- return { node: e };
3711
+ return n.style && (e.setFormat(n.style.textAlign), Pi(n, e)), { node: e };
3705
3712
  }
3706
3713
  function ve() {
3707
- return Jt(new ze());
3714
+ return $t(new We());
3708
3715
  }
3709
- function kn(n) {
3710
- return n instanceof ze;
3716
+ function bn(n) {
3717
+ return n instanceof We;
3711
3718
  }
3712
- const _o = 0, po = 1, yo = 3, mo = 4;
3719
+ const po = 0, yo = 1, mo = 3, xo = 4;
3713
3720
  function Ds(n, e, t, r) {
3714
3721
  const s = n._keyToDOMMap;
3715
3722
  s.clear(), n._editorState = jn(), n._pendingEditorState = r, n._compositionKey = null, n._dirtyType = Ee, n._cloneNotNeeded.clear(), n._dirtyLeaves = /* @__PURE__ */ new Set(), n._dirtyElements.clear(), n._normalizedNodes = /* @__PURE__ */ new Set(), n._updateTags = /* @__PURE__ */ new Set(), n._updates = [], n._blockCursorElement = null;
3716
3723
  const i = n._observer;
3717
3724
  i !== null && (i.disconnect(), n._observer = null), e !== null && (e.textContent = ""), t !== null && (t.textContent = "", s.set("root", t));
3718
3725
  }
3719
- function xo(n) {
3720
- const e = n || {}, t = $i(), r = e.theme || {}, s = n === void 0 ? t : e.parentEditor || null, i = e.disableEvents || !1, o = jn(), l = e.namespace || (s !== null ? s._config.namespace : rs()), c = e.editorState, a = [ct, We, st, it, ze, Vi, ...e.nodes || []], { onError: f, html: h } = e, u = e.editable === void 0 || e.editable;
3726
+ function vo(n) {
3727
+ const e = n || {}, t = Ui(), r = e.theme || {}, s = n === void 0 ? t : e.parentEditor || null, i = e.disableEvents || !1, o = jn(), l = e.namespace || (s !== null ? s._config.namespace : rs()), c = e.editorState, a = [ct, ze, st, it, We, ji, ...e.nodes || []], { onError: u, html: h } = e, f = e.editable === void 0 || e.editable;
3721
3728
  let d;
3722
3729
  if (n === void 0 && t !== null) d = t._nodes;
3723
3730
  else {
@@ -3725,31 +3732,31 @@ function xo(n) {
3725
3732
  for (let p = 0; p < a.length; p++) {
3726
3733
  let _ = a[p], m = null, y = null;
3727
3734
  if (typeof _ != "function") {
3728
- const v = _;
3729
- _ = v.replace, m = v.with, y = v.withKlass || null;
3735
+ const x = _;
3736
+ _ = x.replace, m = x.with, y = x.withKlass || null;
3730
3737
  }
3731
- const x = _.getType(), C = _.transform(), b = /* @__PURE__ */ new Set();
3732
- C !== null && b.add(C), d.set(x, { exportDOM: h && h.export ? h.export.get(_) : void 0, klass: _, replace: m, replaceWithKlass: y, transforms: b });
3738
+ const S = _.getType(), k = _.transform(), T = /* @__PURE__ */ new Set();
3739
+ k !== null && T.add(k), d.set(S, { exportDOM: h && h.export ? h.export.get(_) : void 0, klass: _, replace: m, replaceWithKlass: y, transforms: T });
3733
3740
  }
3734
3741
  }
3735
- const g = new Xt(o, s, d, { disableEvents: i, namespace: l, theme: r }, f || console.error, function(p, _) {
3736
- const m = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Set(), x = (C) => {
3737
- Object.keys(C).forEach((b) => {
3738
- let v = m.get(b);
3739
- v === void 0 && (v = [], m.set(b, v)), v.push(C[b]);
3742
+ const g = new Yt(o, s, d, { disableEvents: i, namespace: l, theme: r }, u || console.error, function(p, _) {
3743
+ const m = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Set(), S = (k) => {
3744
+ Object.keys(k).forEach((T) => {
3745
+ let x = m.get(T);
3746
+ x === void 0 && (x = [], m.set(T, x)), x.push(k[T]);
3740
3747
  });
3741
3748
  };
3742
- return p.forEach((C) => {
3743
- const b = C.klass.importDOM;
3744
- if (b == null || y.has(b)) return;
3745
- y.add(b);
3746
- const v = b.call(C.klass);
3747
- v !== null && x(v);
3748
- }), _ && x(_), m;
3749
- }(d, h ? h.import : void 0), u);
3749
+ return p.forEach((k) => {
3750
+ const T = k.klass.importDOM;
3751
+ if (T == null || y.has(T)) return;
3752
+ y.add(T);
3753
+ const x = T.call(k.klass);
3754
+ x !== null && S(x);
3755
+ }), _ && S(_), m;
3756
+ }(d, h ? h.import : void 0), f);
3750
3757
  return c !== void 0 && (g._pendingEditorState = c, g._dirtyType = Me), g;
3751
3758
  }
3752
- class Xt {
3759
+ class Yt {
3753
3760
  constructor(e, t, r, s, i, o, l) {
3754
3761
  this._parentEditor = t, this._rootElement = null, this._editorState = e, this._pendingEditorState = null, this._compositionKey = null, this._deferred = [], this._keyToDOMMap = /* @__PURE__ */ new Map(), this._updates = [], this._updating = !1, this._listeners = { decorator: /* @__PURE__ */ new Set(), editable: /* @__PURE__ */ new Set(), mutation: /* @__PURE__ */ new Map(), root: /* @__PURE__ */ new Set(), textcontent: /* @__PURE__ */ new Set(), update: /* @__PURE__ */ new Set() }, this._commands = /* @__PURE__ */ new Map(), this._config = s, this._nodes = r, this._decorators = {}, this._pendingDecorators = null, this._dirtyType = Ee, this._cloneNotNeeded = /* @__PURE__ */ new Set(), this._dirtyLeaves = /* @__PURE__ */ new Set(), this._dirtyElements = /* @__PURE__ */ new Map(), this._normalizedNodes = /* @__PURE__ */ new Set(), this._updateTags = /* @__PURE__ */ new Set(), this._observer = null, this._key = rs(), this._onError = i, this._htmlConversions = o, this._editable = l, this._headless = t !== null && t._headless, this._window = null, this._blockCursorElement = null;
3755
3762
  }
@@ -3787,11 +3794,11 @@ class Xt {
3787
3794
  };
3788
3795
  }
3789
3796
  registerCommand(e, t, r) {
3790
- r === void 0 && k(35);
3797
+ r === void 0 && b(35);
3791
3798
  const s = this._commands;
3792
3799
  s.has(e) || s.set(e, [/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set(), /* @__PURE__ */ new Set()]);
3793
3800
  const i = s.get(e);
3794
- i === void 0 && k(36, String(e));
3801
+ i === void 0 && b(36, String(e));
3795
3802
  const o = i[r];
3796
3803
  return o.add(t), () => {
3797
3804
  o.delete(t), i.every((l) => l.size === 0) && s.delete(e);
@@ -3807,7 +3814,7 @@ class Xt {
3807
3814
  }
3808
3815
  getRegisteredNode(e) {
3809
3816
  const t = this._nodes.get(e.getType());
3810
- return t === void 0 && k(37, e.name), t;
3817
+ return t === void 0 && b(37, e.name), t;
3811
3818
  }
3812
3819
  resolveRegisteredNodeAfterReplacements(e) {
3813
3820
  for (; e.replaceWithKlass; ) e = this.getRegisteredNode(e.replaceWithKlass);
@@ -3836,7 +3843,7 @@ class Xt {
3836
3843
  if (c.isEmpty()) return;
3837
3844
  if (l === "root") return void G().markDirty();
3838
3845
  const a = c._nodeMap;
3839
- for (const [, f] of a) f.markDirty();
3846
+ for (const [, u] of a) u.markDirty();
3840
3847
  }, o._pendingEditorState === null ? { tag: "history-merge" } : void 0), () => {
3841
3848
  s.forEach((c) => c.transforms.delete(t));
3842
3849
  };
@@ -3863,17 +3870,17 @@ class Xt {
3863
3870
  const t = this._rootElement;
3864
3871
  if (e !== t) {
3865
3872
  const r = qe(this._config.theme, "root"), s = this._pendingEditorState || this._editorState;
3866
- if (this._rootElement = e, Ds(this, t, e, s), t !== null && (this._config.disableEvents || Li(t), r != null && t.classList.remove(...r)), e !== null) {
3873
+ if (this._rootElement = e, Ds(this, t, e, s), t !== null && (this._config.disableEvents || Oi(t), r != null && t.classList.remove(...r)), e !== null) {
3867
3874
  const i = function(l) {
3868
3875
  const c = l.ownerDocument;
3869
3876
  return c && c.defaultView || null;
3870
3877
  }(e), o = e.style;
3871
3878
  o.userSelect = "text", o.whiteSpace = "pre-wrap", o.wordBreak = "break-word", e.setAttribute("data-lexical-editor", "true"), this._window = i, this._dirtyType = Me, Qr(this), this._updateTags.add("history-merge"), me(this), this._config.disableEvents || function(l, c) {
3872
- const a = l.ownerDocument, f = Dt.get(a);
3873
- (f === void 0 || f < 1) && a.addEventListener("selectionchange", xs), Dt.set(a, (f || 0) + 1), l.__lexicalEditor = c;
3879
+ const a = l.ownerDocument, u = Dt.get(a);
3880
+ (u === void 0 || u < 1) && a.addEventListener("selectionchange", xs), Dt.set(a, (u || 0) + 1), l.__lexicalEditor = c;
3874
3881
  const h = ms(l);
3875
- for (let u = 0; u < vn.length; u++) {
3876
- const [d, g] = vn[u], p = typeof g == "function" ? (_) => {
3882
+ for (let f = 0; f < Sn.length; f++) {
3883
+ const [d, g] = Sn[f], p = typeof g == "function" ? (_) => {
3877
3884
  xr(_) || (mr(_), (c.isEditable() || d === "click") && g(_, c));
3878
3885
  } : (_) => {
3879
3886
  if (xr(_)) return;
@@ -3881,11 +3888,11 @@ class Xt {
3881
3888
  const m = c.isEditable();
3882
3889
  switch (d) {
3883
3890
  case "cut":
3884
- return m && w(c, Jr, _);
3891
+ return m && w(c, $r, _);
3885
3892
  case "copy":
3886
3893
  return w(c, Kr, _);
3887
3894
  case "paste":
3888
- return m && w(c, zr, _);
3895
+ return m && w(c, Wr, _);
3889
3896
  case "dragstart":
3890
3897
  return m && w(c, js, _);
3891
3898
  case "dragover":
@@ -3916,13 +3923,13 @@ class Xt {
3916
3923
  return this._editorState;
3917
3924
  }
3918
3925
  setEditorState(e, t) {
3919
- e.isEmpty() && k(38), qr(this);
3926
+ e.isEmpty() && b(38), qr(this);
3920
3927
  const r = this._pendingEditorState, s = this._updateTags, i = t !== void 0 ? t.tag : null;
3921
3928
  r === null || r.isEmpty() || (i != null && s.add(i), me(this)), this._pendingEditorState = e, this._dirtyType = Me, this._dirtyElements.set("root", !1), this._compositionKey = null, i != null && s.add(i), me(this);
3922
3929
  }
3923
3930
  parseEditorState(e, t) {
3924
3931
  return function(r, s, i) {
3925
- const o = jn(), l = R, c = Q, a = K, f = s._dirtyElements, h = s._dirtyLeaves, u = s._cloneNotNeeded, d = s._dirtyType;
3932
+ const o = jn(), l = R, c = Q, a = K, u = s._dirtyElements, h = s._dirtyLeaves, f = s._cloneNotNeeded, d = s._dirtyType;
3926
3933
  s._dirtyElements = /* @__PURE__ */ new Map(), s._dirtyLeaves = /* @__PURE__ */ new Set(), s._cloneNotNeeded = /* @__PURE__ */ new Set(), s._dirtyType = 0, R = o, Q = !1, K = s;
3927
3934
  try {
3928
3935
  const g = s._nodes;
@@ -3930,7 +3937,7 @@ class Xt {
3930
3937
  } catch (g) {
3931
3938
  g instanceof Error && s._onError(g);
3932
3939
  } finally {
3933
- s._dirtyElements = f, s._dirtyLeaves = h, s._cloneNotNeeded = u, s._dirtyType = d, R = l, Q = c, K = a;
3940
+ s._dirtyElements = u, s._dirtyLeaves = h, s._cloneNotNeeded = f, s._dirtyType = d, R = l, Q = c, K = a;
3934
3941
  }
3935
3942
  return o;
3936
3943
  }(typeof e == "string" ? JSON.parse(e) : e, this, t);
@@ -3966,97 +3973,99 @@ class Xt {
3966
3973
  return { editorState: this._editorState.toJSON() };
3967
3974
  }
3968
3975
  }
3969
- Xt.version = "0.18.0+prod.esm";
3976
+ Yt.version = "0.19.0+prod.esm";
3970
3977
  export {
3971
- no as $,
3972
- ot as A,
3973
- go as B,
3974
- hr as C,
3975
- mo as D,
3976
- ao as E,
3977
- kn as F,
3978
- Mt as G,
3979
- co as H,
3980
- I,
3981
- Ae as J,
3982
- to as K,
3978
+ ro as $,
3979
+ I as A,
3980
+ _o as B,
3981
+ br as C,
3982
+ bn as D,
3983
+ Kr as E,
3984
+ ve as F,
3985
+ xo as G,
3986
+ Mt as H,
3987
+ ao as I,
3988
+ nt as J,
3989
+ no as K,
3983
3990
  po as L,
3984
- Kr as M,
3985
- zt as N,
3986
- Bs as O,
3987
- ve as P,
3988
- yo as Q,
3989
- zs as R,
3990
- lo as S,
3991
- br as T,
3992
- Ms as U,
3993
- Is as V,
3994
- Js as W,
3991
+ ot as M,
3992
+ ji as N,
3993
+ yo as O,
3994
+ uo as P,
3995
+ Wt as Q,
3996
+ Bs as R,
3997
+ Ht as S,
3998
+ bi as T,
3999
+ Ae as U,
4000
+ mo as V,
4001
+ Ws as W,
3995
4002
  dr as X,
3996
- We as Y,
3997
- mt as Z,
3998
- ro as _,
3999
- Zn as a,
4000
- xt as a0,
4001
- yt as a1,
4002
- Ks as a2,
4003
- $s as a3,
4004
- Jr as a4,
4005
- Gi as a5,
4006
- He as a6,
4007
- Us as a7,
4008
- Qs as a8,
4009
- bn as a9,
4010
- ue as aa,
4011
- fo as ab,
4012
- V as ac,
4013
- uo as ad,
4014
- yi as ae,
4015
- lt as af,
4016
- ie as ag,
4017
- xo as ah,
4018
- zr as ai,
4019
- Xr as aj,
4020
- _o as ak,
4021
- Yn as al,
4022
- so as am,
4023
- Hs as an,
4024
- js as ao,
4025
- Vs as ap,
4026
- fn as aq,
4027
- gt as ar,
4028
- Zi as as,
4029
- Xi as at,
4030
- Qi as au,
4031
- ho as av,
4032
- Gn as aw,
4033
- Zr as ax,
4034
- eo as ay,
4035
- Yi as az,
4036
- Pe as b,
4037
- io as c,
4003
+ Ms as Y,
4004
+ ze as Z,
4005
+ Os as _,
4006
+ Pe as a,
4007
+ Is as a0,
4008
+ $s as a1,
4009
+ mt as a2,
4010
+ xt as a3,
4011
+ yt as a4,
4012
+ Ks as a5,
4013
+ Js as a6,
4014
+ $r as a7,
4015
+ Zi as a8,
4016
+ He as a9,
4017
+ to as aA,
4018
+ eo as aB,
4019
+ Us as aa,
4020
+ Qs as ab,
4021
+ ue as ac,
4022
+ ho as ad,
4023
+ V as ae,
4024
+ fo as af,
4025
+ ce as ag,
4026
+ yi as ah,
4027
+ lt as ai,
4028
+ ie as aj,
4029
+ vo as ak,
4030
+ Wr as al,
4031
+ Xr as am,
4032
+ Zn as an,
4033
+ io as ao,
4034
+ Hs as ap,
4035
+ js as aq,
4036
+ Vs as ar,
4037
+ dn as as,
4038
+ gt as at,
4039
+ Gi as au,
4040
+ Yi as av,
4041
+ Xi as aw,
4042
+ go as ax,
4043
+ Gn as ay,
4044
+ Yr as az,
4045
+ v as b,
4046
+ N as c,
4038
4047
  we as d,
4039
- jt as e,
4040
- Jt as f,
4048
+ wn as e,
4049
+ $t as f,
4041
4050
  Rr as g,
4042
4051
  Br as h,
4043
- A as i,
4044
- Z as j,
4045
- Vi as k,
4046
- N as l,
4047
- F as m,
4048
- nt as n,
4049
- J as o,
4050
- qt as p,
4051
- Ei as q,
4052
+ so as i,
4053
+ lo as j,
4054
+ A as k,
4055
+ $ as l,
4056
+ oo as m,
4057
+ Y as n,
4058
+ Yn as o,
4059
+ Ei as p,
4060
+ co as q,
4052
4061
  Ls as r,
4053
- bi as s,
4054
- Hi as t,
4062
+ hr as s,
4063
+ qi as t,
4055
4064
  Un as u,
4056
- Jn as v,
4065
+ Jt as v,
4057
4066
  G as w,
4058
- oo as x,
4059
- S as y,
4060
- qi as z
4067
+ F as x,
4068
+ Qt as y,
4069
+ Qi as z
4061
4070
  };
4062
- //# sourceMappingURL=Lexical.prod-CO0gPAfo.js.map
4071
+ //# sourceMappingURL=Lexical.prod-qM_1BY0u.js.map