reactjs-tiptap-editor 1.0.10 → 1.0.12

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 (209) hide show
  1. package/lib/{ActionMenuButton-CKTxYtl7.js → ActionMenuButton-BKqin6Kz.js} +17 -13
  2. package/lib/ActionMenuButton-CPPHERbq.cjs +1 -0
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.js +24 -21
  5. package/lib/Blockquote.cjs +2 -2
  6. package/lib/Blockquote.js +7 -5
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +11 -9
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +14 -12
  11. package/lib/Clear.cjs +1 -1
  12. package/lib/Clear.js +3 -3
  13. package/lib/Code.cjs +1 -1
  14. package/lib/Code.js +11 -9
  15. package/lib/CodeBlock.cjs +22 -22
  16. package/lib/CodeBlock.js +102 -100
  17. package/lib/CodeView.cjs +1 -1
  18. package/lib/CodeView.js +10 -8
  19. package/lib/Color.cjs +1 -1
  20. package/lib/Color.js +20 -18
  21. package/lib/Column.cjs +1 -1
  22. package/lib/Column.js +7 -5
  23. package/lib/{Drawer-Cfx115up.js → Drawer-DUPsBE0H.js} +10 -9
  24. package/lib/Drawer-fplzqNI6.cjs +1 -0
  25. package/lib/Drawer.cjs +1 -1
  26. package/lib/Drawer.js +3 -3
  27. package/lib/Emoji.cjs +1 -1
  28. package/lib/Emoji.js +11 -9
  29. package/lib/{Excalidraw-CO93Tsmb.js → Excalidraw-BEzpvRLx.js} +20 -19
  30. package/lib/Excalidraw-qjnQspLq.cjs +1 -0
  31. package/lib/Excalidraw.cjs +1 -1
  32. package/lib/Excalidraw.js +2 -2
  33. package/lib/ExportPdf.cjs +2 -2
  34. package/lib/ExportPdf.js +7 -5
  35. package/lib/ExportWord.cjs +1 -1
  36. package/lib/ExportWord.js +7 -5
  37. package/lib/FontFamily.cjs +1 -1
  38. package/lib/FontFamily.js +9 -8
  39. package/lib/FontSize.cjs +1 -1
  40. package/lib/FontSize.js +13 -12
  41. package/lib/Heading.cjs +1 -1
  42. package/lib/Heading.js +25 -24
  43. package/lib/Highlight.cjs +1 -1
  44. package/lib/Highlight.js +9 -7
  45. package/lib/History.cjs +1 -1
  46. package/lib/History.js +18 -15
  47. package/lib/HorizontalRule.cjs +1 -1
  48. package/lib/HorizontalRule.js +7 -5
  49. package/lib/Icon-CiR8RqdQ.cjs +1 -0
  50. package/lib/Icon-ONE1AwKo.js +12 -0
  51. package/lib/{Iframe-DwhclppJ.js → Iframe-CBTnv2mk.js} +41 -39
  52. package/lib/Iframe-DsUNJ2n2.cjs +1 -0
  53. package/lib/Iframe.cjs +1 -1
  54. package/lib/Iframe.js +2 -2
  55. package/lib/Image.cjs +1 -1
  56. package/lib/Image.js +25 -23
  57. package/lib/ImageGif.cjs +1 -1
  58. package/lib/ImageGif.js +53 -51
  59. package/lib/ImportWord.cjs +31 -31
  60. package/lib/ImportWord.js +8 -6
  61. package/lib/{Indent-BOsymiZ7.js → Indent-B00o0P0M.js} +26 -24
  62. package/lib/Indent-CaGP0qTp.cjs +1 -0
  63. package/lib/Indent.cjs +1 -1
  64. package/lib/Indent.js +2 -2
  65. package/lib/Italic.cjs +1 -1
  66. package/lib/Italic.js +12 -10
  67. package/lib/Katex-XsfpKgJU.cjs +4 -0
  68. package/lib/{Katex-BYK-b9X2.js → Katex-x370CSXZ.js} +12 -10
  69. package/lib/Katex.cjs +1 -1
  70. package/lib/Katex.js +2 -2
  71. package/lib/LineHeight.cjs +1 -1
  72. package/lib/LineHeight.js +10 -8
  73. package/lib/Link.cjs +1 -1
  74. package/lib/Link.js +2 -2
  75. package/lib/{LinkEditBlock-DgrLUMsJ.js → LinkEditBlock-C_ipl3EA.js} +23 -21
  76. package/lib/{LinkEditBlock-4-iRXH7m.cjs → LinkEditBlock-xt88G5fb.cjs} +2 -2
  77. package/lib/Mention.cjs +1 -1
  78. package/lib/Mention.js +3 -3
  79. package/lib/Mermaid.cjs +2 -2
  80. package/lib/Mermaid.js +18 -17
  81. package/lib/MoreMark.cjs +1 -1
  82. package/lib/MoreMark.js +25 -22
  83. package/lib/OrderedList.cjs +1 -1
  84. package/lib/OrderedList.js +10 -8
  85. package/lib/SearchAndReplace.cjs +1 -1
  86. package/lib/SearchAndReplace.js +43 -41
  87. package/lib/SlashCommand.cjs +1 -1
  88. package/lib/SlashCommand.js +6 -6
  89. package/lib/SlashCommandNodeView-BT5ystah.cjs +1 -0
  90. package/lib/{SlashCommandNodeView-BpNNU7Sm.js → SlashCommandNodeView-DX6axvLs.js} +75 -66
  91. package/lib/Strike.cjs +1 -1
  92. package/lib/Strike.js +7 -5
  93. package/lib/Table-DSRSwtXx.cjs +9 -0
  94. package/lib/{Table-CT9R9Sdq.js → Table-DidusYID.js} +10 -8
  95. package/lib/Table.cjs +1 -1
  96. package/lib/Table.js +1 -1
  97. package/lib/TaskList.cjs +1 -1
  98. package/lib/TaskList.js +15 -13
  99. package/lib/TextAlign.cjs +1 -1
  100. package/lib/TextAlign.js +20 -17
  101. package/lib/TextDirection.cjs +1 -1
  102. package/lib/TextDirection.js +20 -17
  103. package/lib/TextUnderline.cjs +1 -1
  104. package/lib/TextUnderline.js +7 -5
  105. package/lib/Twitter-CBuVBQM1.cjs +1 -0
  106. package/lib/{Twitter-mowilxRd.js → Twitter-D58T0Zt3.js} +51 -49
  107. package/lib/Twitter.cjs +1 -1
  108. package/lib/Twitter.js +2 -2
  109. package/lib/Video.cjs +1 -1
  110. package/lib/Video.js +13 -11
  111. package/lib/bubble.cjs +4 -4
  112. package/lib/bubble.js +403 -407
  113. package/lib/{button-CBO-WDXK.js → button-9_8t7ca7.js} +4 -3
  114. package/lib/button-Cs9TroWr.cjs +1 -0
  115. package/lib/{checkbox-DUcLSGZD.cjs → checkbox-BQRKTXXr.cjs} +1 -1
  116. package/lib/{checkbox-D1h32VWM.js → checkbox-DnkkV6qo.js} +1 -1
  117. package/lib/{index-BBNITgNi.cjs → clsx-CXbNJWDD.cjs} +13 -13
  118. package/lib/{index-sVScpCFG.js → clsx-DmuN0U_8.js} +228 -228
  119. package/lib/{dialog-DY868Uji.cjs → dialog-BS3zm-T9.cjs} +1 -1
  120. package/lib/{dialog-DSvgtlDI.js → dialog-DhayAPvV.js} +1 -1
  121. package/lib/{dropdown-menu-BripAeGB.cjs → dropdown-menu-CxwWX0yj.cjs} +1 -1
  122. package/lib/{dropdown-menu-B88Qn2KR.js → dropdown-menu-DQqKeZcx.js} +1 -1
  123. package/lib/events.constant-Dq21NPdV.cjs +1 -0
  124. package/lib/events.constant-do95b767.js +21 -0
  125. package/lib/{index-CApXPpjF.cjs → index-BCzvbrf5.cjs} +1 -1
  126. package/lib/{index-0OnGZkVF.js → index-BDX1uE62.js} +78 -312
  127. package/lib/index-CBFmXCcU.cjs +1 -0
  128. package/lib/{index-DmPwbBqm.js → index-CKmT9KAQ.js} +1 -1
  129. package/lib/index-CVFzP1Dc.cjs +1 -0
  130. package/lib/index-CX4pNJlH.cjs +1 -0
  131. package/lib/index-CjhjjJsN.cjs +1 -0
  132. package/lib/index-Cs6cp0Y6.cjs +1 -0
  133. package/lib/{index-9A6-kVBM.js → index-D1jd7elj.js} +1 -1
  134. package/lib/{index-BIqaogQg.js → index-D9JOHlso.js} +449 -1216
  135. package/lib/{index-DRHrDScg.js → index-DdEmgiAA.js} +1 -1
  136. package/lib/{index-DKt5wfAc.js → index-DvvwJvau.js} +23 -23
  137. package/lib/index-EAK64CCA.js +425 -0
  138. package/lib/{index--nUS7Y66.cjs → index-neeeY2o7.cjs} +3 -3
  139. package/lib/index.cjs +9 -2
  140. package/lib/index.js +142 -26
  141. package/lib/{input-BeD5GdMv.cjs → input-BJ7ihMq-.cjs} +1 -1
  142. package/lib/{input-Bx4uo4gO.js → input-YoheBL2D.js} +1 -1
  143. package/lib/{isNumber-Bv1Qhmw8.cjs → isNumber-BTYSVlKo.cjs} +1 -1
  144. package/lib/{isNumber-DF0fU3ob.js → isNumber-DmQXlKp3.js} +1 -1
  145. package/lib/label-C8PLcjFI.js +19 -0
  146. package/lib/label-Y7_hvqf2.cjs +1 -0
  147. package/lib/locale-bundle.cjs +1 -1
  148. package/lib/locale-bundle.js +6 -7
  149. package/lib/locales/index.d.ts +3 -4316
  150. package/lib/{popover-Csk538NC.cjs → popover-BiSrlM4j.cjs} +1 -1
  151. package/lib/{popover-BVX8otO9.js → popover-CWmTzHSy.js} +1 -1
  152. package/lib/react-BEoMZB61.cjs +1 -0
  153. package/lib/react-c9FSfB30.js +27 -0
  154. package/lib/separator-C-DKMYmg.js +329 -0
  155. package/lib/separator-CJ_adziN.cjs +1 -0
  156. package/lib/store/EditorEditableReactive.d.ts +1 -0
  157. package/lib/store/ThemeColorReactive.d.ts +1 -0
  158. package/lib/store/commandList.d.ts +1 -1
  159. package/lib/store/store.d.ts +6 -7
  160. package/lib/store-BKMaw1AW.cjs +1 -0
  161. package/lib/store-DG7cMfET.js +10 -0
  162. package/lib/style.css +1 -1
  163. package/lib/{tabs-DOasUMDU.cjs → tabs-DpHSMyF_.cjs} +1 -1
  164. package/lib/{tabs-BKpr0QQB.js → tabs-DxlKKM-N.js} +1 -1
  165. package/lib/{textarea-Ba9OOzba.js → textarea-D7m-apUh.js} +1 -1
  166. package/lib/{textarea-D9egO4qC.cjs → textarea-DU9RMi6u.cjs} +1 -1
  167. package/lib/theme/theme.d.ts +5 -0
  168. package/lib/theme.cjs +1 -1
  169. package/lib/theme.js +37 -8
  170. package/lib/{throttle-DsowOft0.js → throttle-BRtichEP.js} +1 -1
  171. package/lib/throttle-gTTvqDTW.cjs +1 -0
  172. package/lib/toggle-BYvLnjCL.cjs +1 -0
  173. package/lib/toggle-Bxwwb_Kp.js +99 -0
  174. package/lib/tooltip-BTy5CRrN.js +24 -0
  175. package/lib/tooltip-COvf4_R-.cjs +1 -0
  176. package/lib/{updatePosition-Bbd8ETMv.js → updatePosition-CUukgu-Q.js} +2 -2
  177. package/lib/updatePosition-Cjuj2E26.cjs +1 -0
  178. package/lib/{useButtonProps-C_bqxmHi.js → useButtonProps-CfYtuEnd.js} +48 -36
  179. package/lib/useButtonProps-CydzndG1.cjs +1 -0
  180. package/lib/utils/customEvents/events.constant.d.ts +0 -5
  181. package/package.json +3 -3
  182. package/lib/ActionMenuButton-BPdRqzDX.cjs +0 -1
  183. package/lib/Drawer-hHj4Opkg.cjs +0 -1
  184. package/lib/Excalidraw-8pWJ17Ye.cjs +0 -1
  185. package/lib/Icon-D7GJZzoa.js +0 -10
  186. package/lib/Icon-gtc3g-VK.cjs +0 -1
  187. package/lib/Iframe-BmXO2c65.cjs +0 -1
  188. package/lib/Indent-DPkMWfcv.cjs +0 -1
  189. package/lib/Katex-B1XbT8-X.cjs +0 -4
  190. package/lib/SlashCommandNodeView-CQvMTXys.cjs +0 -1
  191. package/lib/Table-LnWGm2m8.cjs +0 -9
  192. package/lib/Twitter-Bo4JkBTL.cjs +0 -1
  193. package/lib/button-wt49IYwP.cjs +0 -1
  194. package/lib/events.constant-DQYeJpu5.cjs +0 -1
  195. package/lib/events.constant-wrlJ_7JZ.js +0 -26
  196. package/lib/index-BZ6DfR2r.cjs +0 -1
  197. package/lib/index-BvIJKpX1.cjs +0 -8
  198. package/lib/index-Cv9Z6dyV.cjs +0 -1
  199. package/lib/index-FSRjMsxW.cjs +0 -1
  200. package/lib/label--161UPH6.cjs +0 -1
  201. package/lib/label-uKG7RzFU.js +0 -18
  202. package/lib/separator-DLRVddHS.cjs +0 -1
  203. package/lib/separator-DtrEdjAF.js +0 -241
  204. package/lib/store/ProviderUniqueId.d.ts +0 -6
  205. package/lib/store-B8IkVz1J.cjs +0 -1
  206. package/lib/store-CsIFDUKR.js +0 -10
  207. package/lib/throttle-BM3Bmbf_.cjs +0 -1
  208. package/lib/updatePosition-M2IyqkI1.cjs +0 -1
  209. package/lib/useButtonProps-DEtmDVPr.cjs +0 -1
package/lib/bubble.js CHANGED
@@ -1,53 +1,55 @@
1
- import { jsx as p, Fragment as O, jsxs as y } from "react/jsx-runtime";
2
- import bs, { useRef as Pt, useEffect as at, useCallback as R, useState as F, useMemo as yt, Fragment as ei } from "react";
3
- import { a3 as Xr, d as xs, E as ke, a4 as Zr, a5 as Qr, G as ys, a6 as ve, a7 as to, U as ni, Q as Ss, x as Oe, F as Me, T as ii, A as eo, v as no, a8 as io, a9 as so } from "./index-sVScpCFG.js";
4
- import { f as ks, s as vs, o as Cs, a as _s, b as Es, d as Ts, h as Ds, e as Is, c as si } from "./index-9A6-kVBM.js";
1
+ import { jsx as p, Fragment as I, jsxs as y } from "react/jsx-runtime";
2
+ import bs, { useRef as Pt, useEffect as at, useCallback as L, useState as F, useMemo as yt, Fragment as ei } from "react";
3
+ import { a3 as Xr, d as xs, E as ke, a4 as Zr, a5 as Qr, O as ys, a6 as ve, a7 as to, U as ni, Q as Ss, v as Oe, F as Me, T as ii, A as eo, u as no, a8 as io, a9 as so } from "./clsx-DmuN0U_8.js";
4
+ import { f as ks, s as vs, o as Cs, a as _s, b as Es, d as Ts, h as Ds, e as Is, c as si } from "./index-D1jd7elj.js";
5
5
  import { Plugin as Ce, PluginKey as te, NodeSelection as ro, TextSelection as oo, SelectionRange as lo, Selection as co } from "@tiptap/pm/state";
6
- import { C as ao, T as ho } from "./Table-CT9R9Sdq.js";
6
+ import { C as ao, T as ho } from "./Table-DidusYID.js";
7
7
  import { createPortal as As } from "react-dom";
8
- import { k as Z, A as x } from "./index-BIqaogQg.js";
8
+ import { A as x } from "./toggle-Bxwwb_Kp.js";
9
9
  import { MultipleColumnNode as Ti } from "./Column.js";
10
- import { u as G, p as je, V as Di } from "./index-0OnGZkVF.js";
11
- import { c as j, d as Os } from "./useButtonProps-C_bqxmHi.js";
10
+ import { u as G, n as je, V as Di } from "./index-BDX1uE62.js";
11
+ import { c as j, d as Os } from "./useButtonProps-CfYtuEnd.js";
12
+ import { a as Z } from "./index-D9JOHlso.js";
12
13
  import { d as _e } from "./delete-node-IyVmiRbI.js";
13
- import { S as Tt } from "./separator-DtrEdjAF.js";
14
- import { C as uo, D as kn } from "./Drawer-Cfx115up.js";
14
+ import "./theme.js";
15
+ import { S as Tt } from "./separator-C-DKMYmg.js";
16
+ import { C as uo, D as kn } from "./Drawer-DUPsBE0H.js";
15
17
  import { Editor as fo, makeDropdownToolbar as po } from "easydrawer";
16
18
  import { s as Ms, i as Rs } from "./shortId-WJVkrvml.js";
17
- import { B as Jt } from "./button-CBO-WDXK.js";
18
- import { D as on, a as ln, b as cn, c as an, d as hn, e as go } from "./dialog-DSvgtlDI.js";
19
+ import { B as Jt } from "./button-9_8t7ca7.js";
20
+ import { D as on, a as ln, b as cn, c as an, d as hn, e as go } from "./dialog-DhayAPvV.js";
19
21
  import { d as Ns } from "./file-BLas99n7.js";
20
- import { u as ee, K as Nn, s as mo } from "./Katex-BYK-b9X2.js";
21
- import { I as Ve } from "./input-Bx4uo4gO.js";
22
- import { L as ae } from "./label-uKG7RzFU.js";
23
- import { P as Us, a as Ls, b as Ps } from "./popover-BVX8otO9.js";
24
- import { E as re, t as wo } from "./Excalidraw-CO93Tsmb.js";
25
- import { I as oe, g as bo } from "./Iframe-DwhclppJ.js";
22
+ import { u as ee, K as Nn, s as mo } from "./Katex-x370CSXZ.js";
23
+ import { I as Ve } from "./input-YoheBL2D.js";
24
+ import { L as ae } from "./label-C8PLcjFI.js";
25
+ import { P as Us, a as Ls, b as Ps } from "./popover-CWmTzHSy.js";
26
+ import { E as re, t as wo } from "./Excalidraw-BEzpvRLx.js";
27
+ import { I as oe, g as bo } from "./Iframe-CBTnv2mk.js";
26
28
  import xo from "katex";
27
29
  import { Pencil as yo, Trash2 as So, Check as Ii } from "lucide-react";
28
- import { T as Un } from "./textarea-Ba9OOzba.js";
29
- import { L as Ai, a as ko, R as vo } from "./LinkEditBlock-DgrLUMsJ.js";
30
+ import { T as Un } from "./textarea-D7m-apUh.js";
31
+ import { L as Ai, a as ko, R as vo } from "./LinkEditBlock-C_ipl3EA.js";
30
32
  import { Image as Co } from "./Image.js";
31
33
  import { ImageGif as _o } from "./ImageGif.js";
32
34
  import { Video as Eo } from "./Video.js";
33
35
  import { Mermaid as Ln } from "./Mermaid.js";
34
36
  import { RichTextBold as To } from "./Bold.js";
35
37
  import { RichTextCode as Do } from "./Code.js";
36
- import "./index-DmPwbBqm.js";
38
+ import "./index-CKmT9KAQ.js";
37
39
  import { RichTextColor as Io } from "./Color.js";
38
40
  import { RichTextHighlight as Ao } from "./Highlight.js";
39
41
  import { RichTextItalic as Oo } from "./Italic.js";
40
- import { r as Mo } from "./SlashCommandNodeView-BpNNU7Sm.js";
42
+ import { r as Mo } from "./SlashCommandNodeView-DX6axvLs.js";
41
43
  import { RichTextStrike as Ro } from "./Strike.js";
42
44
  import { RichTextAlign as No, TextAlign as Uo } from "./TextAlign.js";
43
45
  import { RichTextUnderline as Lo } from "./TextUnderline.js";
44
- import { I as Q } from "./Icon-D7GJZzoa.js";
45
- import { T as Oi, F as Po } from "./Twitter-mowilxRd.js";
46
+ import { I as Q } from "./Icon-ONE1AwKo.js";
47
+ import { T as Oi, F as Po } from "./Twitter-D58T0Zt3.js";
46
48
  import { DecorationSet as Mi, Decoration as Bo } from "@tiptap/pm/view";
47
49
  import { NodeRange as Vo } from "@tiptap/pm/model";
48
- import { D as Ho, a as $o, b as Fo, f as mt, d as zo, g as Ri, h as Ni, i as Ui, j as Li } from "./dropdown-menu-B88Qn2KR.js";
50
+ import { D as Ho, a as $o, b as Fo, f as mt, d as zo, g as Ri, h as Ni, i as Ui, j as Li } from "./dropdown-menu-DQqKeZcx.js";
49
51
  import { Clear as Wo } from "./Clear.js";
50
- import { I as Ko, a as Pi, s as Bi } from "./Indent-BOsymiZ7.js";
52
+ import { I as Ko, a as Pi, s as Bi } from "./Indent-B00o0P0M.js";
51
53
  function jo(e, t) {
52
54
  const n = Math.min(e.top, t.top), i = Math.max(e.bottom, t.bottom), s = Math.min(e.left, t.left), o = Math.max(e.right, t.right) - s, l = i - n, c = s, a = n;
53
55
  return new DOMRect(c, a, o, l);
@@ -80,8 +82,8 @@ var Yo = class {
80
82
  onUpdate: void 0,
81
83
  onDestroy: void 0
82
84
  }, this.shouldShow = ({ view: h, state: d, from: u, to: f }) => {
83
- const { doc: g, selection: m } = d, { empty: b } = m, w = !g.textBetween(u, f).length && Xr(d.selection), D = this.element.contains(document.activeElement);
84
- return !(!(h.hasFocus() || D) || b || w || !this.editor.isEditable);
85
+ const { doc: g, selection: m } = d, { empty: w } = m, b = !g.textBetween(u, f).length && Xr(d.selection), M = this.element.contains(document.activeElement);
86
+ return !(!(h.hasFocus() || M) || w || b || !this.editor.isEditable);
85
87
  }, this.mousedownHandler = () => {
86
88
  this.preventHide = !0;
87
89
  }, this.dragstartHandler = () => {
@@ -409,18 +411,18 @@ var et = bs.forwardRef(
409
411
  console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");
410
412
  return;
411
413
  }
412
- const b = d.current;
413
- b.style.visibility = "hidden", b.style.position = "absolute";
414
- const w = Bs({
414
+ const w = d.current;
415
+ w.style.visibility = "hidden", w.style.position = "absolute";
416
+ const b = Bs({
415
417
  ...m.current,
416
418
  editor: f,
417
- element: b
419
+ element: w
418
420
  });
419
- f.registerPlugin(w);
420
- const D = m.current.pluginKey;
421
+ f.registerPlugin(b);
422
+ const M = m.current.pluginKey;
421
423
  return () => {
422
- f.unregisterPlugin(D), window.requestAnimationFrame(() => {
423
- b.parentNode && b.parentNode.removeChild(b);
424
+ f.unregisterPlugin(M), window.requestAnimationFrame(() => {
425
+ w.parentNode && w.parentNode.removeChild(w);
424
426
  });
425
427
  };
426
428
  }, [f]), As(/* @__PURE__ */ p("div", { ...a, children: c }), d.current);
@@ -458,8 +460,8 @@ bs.forwardRef(
458
460
  }, [t, a, n, e, i, s]), As(/* @__PURE__ */ p("div", { ...o, children: r }), c.current);
459
461
  }
460
462
  );
461
- function Gd() {
462
- const e = Z(), t = j(), { t: n } = G(), i = R(() => t.isActive(Ti.name), [t]), s = R(() => _e(Ti.name, t), [t]), r = R(() => t.chain().focus().addColBefore().run(), [t]), o = R(() => t.chain().focus().addColAfter().run(), [t]), l = R(() => t.chain().focus().deleteCol().run(), [t]);
463
+ function qd() {
464
+ const e = Z(), t = j(), { t: n } = G(), i = L(() => t.isActive(Ti.name), [t]), s = L(() => _e(Ti.name, t), [t]), r = L(() => t.chain().focus().addColBefore().run(), [t]), o = L(() => t.chain().focus().addColAfter().run(), [t]), l = L(() => t.chain().focus().deleteCol().run(), [t]);
463
465
  return e ? /* @__PURE__ */ p(
464
466
  et,
465
467
  {
@@ -502,7 +504,7 @@ function Gd() {
502
504
  )
503
505
  ] })
504
506
  }
505
- ) : /* @__PURE__ */ p(O, {});
507
+ ) : /* @__PURE__ */ p(I, {});
506
508
  }
507
509
  function Jo(e, t) {
508
510
  const n = ["size-small", "size-medium", "size-large"], i = [
@@ -817,15 +819,15 @@ function cl({ editor: e, attrs: t, extension: n }) {
817
819
  const d = async () => {
818
820
  if (r.current) {
819
821
  const E = r.current.toSVG(), S = E.outerHTML, k = `drawer-${Ms()}.svg`;
820
- let U = Rs(E.outerHTML);
822
+ let N = Rs(E.outerHTML);
821
823
  if (a) {
822
- const H = Ns(U, k);
823
- U = await a(H);
824
+ const H = Ns(N, k);
825
+ N = await a(H);
824
826
  }
825
827
  e == null || e.chain().focus().setDrawer(
826
828
  {
827
829
  type: "drawer",
828
- src: U,
830
+ src: N,
829
831
  alt: encodeURIComponent(S),
830
832
  width: 426,
831
833
  height: 212
@@ -846,16 +848,16 @@ function cl({ editor: e, attrs: t, extension: n }) {
846
848
  }, m = (E) => {
847
849
  const S = o.current.getWidgetById("shape");
848
850
  S && S.setShapeType(E);
849
- }, b = (E) => {
851
+ }, w = (E) => {
850
852
  const S = r.current.toolController.getPrimaryTools()[5], k = o.current.getWidgetById("shape");
851
853
  S && k && (S.setColor(E), k.serializeState());
852
- }, w = (E) => {
854
+ }, b = (E) => {
853
855
  const S = r.current.toolController.getPrimaryTools()[5], k = o.current.getWidgetById("shape");
854
856
  S && k && (S.setThickness(E), k.serializeState());
855
- }, D = (E) => {
857
+ }, M = (E) => {
856
858
  const S = r.current.toolController.getPrimaryTools()[5], k = o.current.getWidgetById("shape");
857
859
  S && k && (S.setBorderColor(E), k.serializeState());
858
- }, I = () => {
860
+ }, A = () => {
859
861
  if (le) {
860
862
  for (; r.current.history.redoStackSize > 0; )
861
863
  r.current.history.redo();
@@ -891,21 +893,21 @@ function cl({ editor: e, attrs: t, extension: n }) {
891
893
  /* @__PURE__ */ p(
892
894
  uo,
893
895
  {
894
- changeBorderColorShape: D,
895
- changeColorShape: b,
896
+ changeBorderColorShape: M,
897
+ changeColorShape: w,
896
898
  changeShape: m,
897
899
  onClear: () => {
898
900
  if (!le) {
899
901
  for (; r.current.history.undoStackSize > 0; )
900
- I();
902
+ A();
901
903
  le = !0;
902
904
  }
903
905
  },
904
906
  onRedo: () => {
905
907
  le || r.current.history.redo();
906
908
  },
907
- onThicknessChange: w,
908
- onUndo: I,
909
+ onThicknessChange: b,
910
+ onUndo: A,
909
911
  refEditor: r,
910
912
  setColorHighlight: g,
911
913
  setColorPen: u,
@@ -942,9 +944,9 @@ function al({ item: e, disabled: t, editor: n }) {
942
944
  disabled: t || ((s = e == null ? void 0 : e.componentProps) == null ? void 0 : s.disabled),
943
945
  editor: n
944
946
  }
945
- ) }) : /* @__PURE__ */ p(O, {});
947
+ ) }) : /* @__PURE__ */ p(I, {});
946
948
  }
947
- function Jd() {
949
+ function Xd() {
948
950
  const { lang: e, t } = G(), n = Z(), i = j(), s = ee(i, kn.name), r = Os(kn.name), o = ({ editor: c }) => {
949
951
  const { selection: a } = c.view.state, { $from: h, to: d } = a;
950
952
  let u = !1;
@@ -975,9 +977,9 @@ function Jd() {
975
977
  item: c
976
978
  },
977
979
  `bubbleMenu-drawer-${a}`
978
- )) }) : /* @__PURE__ */ p(O, {})
980
+ )) }) : /* @__PURE__ */ p(I, {})
979
981
  }
980
- ) : /* @__PURE__ */ p(O, {});
982
+ ) : /* @__PURE__ */ p(I, {});
981
983
  }
982
984
  const Hs = ({ width: e, maxWidth: t, height: n, onOk: i, children: s }) => {
983
985
  const { t: r } = G(), [o, l] = F({
@@ -1056,20 +1058,20 @@ function hl(e) {
1056
1058
  s.disconnect();
1057
1059
  }), { width: Nt.get("width") };
1058
1060
  }
1059
- function qd() {
1061
+ function Zd() {
1060
1062
  const e = Z(), t = j(), { t: n } = G(), { width: i } = hl(t), s = ee(t, re.name, {
1061
1063
  defaultShowPicker: !1,
1062
1064
  createUser: "",
1063
1065
  width: 0,
1064
1066
  height: 0
1065
- }), { defaultShowPicker: r, createUser: o, width: l, height: c } = s, a = R(
1067
+ }), { defaultShowPicker: r, createUser: o, width: l, height: c } = s, a = L(
1066
1068
  (f) => {
1067
1069
  t.chain().updateAttributes(re.name, f).setNodeSelection(t.state.selection.from).focus().run();
1068
1070
  },
1069
1071
  [t]
1070
- ), h = R(() => {
1072
+ ), h = L(() => {
1071
1073
  wo({ ...s, editor: t });
1072
- }, [t, s]), d = R(() => t.isActive(re.name), [t]), u = R(() => _e(re.name, t), [t]);
1074
+ }, [t, s]), d = L(() => t.isActive(re.name), [t]), u = L(() => _e(re.name, t), [t]);
1073
1075
  return at(() => {
1074
1076
  r && (h(), t.chain().updateAttributes(re.name, { defaultShowPicker: !1 }).focus().run());
1075
1077
  }, [o, r, t, h]), e ? /* @__PURE__ */ p(
@@ -1114,131 +1116,125 @@ function qd() {
1114
1116
  )
1115
1117
  ] })
1116
1118
  }
1117
- ) : /* @__PURE__ */ p(O, {});
1119
+ ) : /* @__PURE__ */ p(I, {});
1118
1120
  }
1119
- function Xd() {
1121
+ function Qd() {
1120
1122
  const e = Z(), t = j(), { t: n } = G(), { width: i, height: s, src: r } = ee(t, oe.name, {
1121
1123
  width: 0,
1122
1124
  height: 0,
1123
1125
  src: "",
1124
1126
  defaultShowPicker: !1
1125
- }), [o, l] = F(!1), [c, a] = F(""), h = R((w) => {
1126
- var D;
1127
- (D = w == null ? void 0 : w.preventDefault) == null || D.call(w), l(!1);
1127
+ }), [o, l] = F(!1), [c, a] = F(""), h = L((w) => {
1128
+ var b;
1129
+ (b = w == null ? void 0 : w.preventDefault) == null || b.call(w), l(!1);
1128
1130
  }, [l]);
1129
1131
  at(() => {
1130
1132
  o && a(r);
1131
1133
  }, [o, r]);
1132
- const d = R((w) => {
1133
- var I;
1134
- (I = w == null ? void 0 : w.preventDefault) == null || I.call(w);
1135
- const D = bo(c);
1134
+ const d = L((w) => {
1135
+ var M;
1136
+ (M = w == null ? void 0 : w.preventDefault) == null || M.call(w);
1137
+ const b = bo(c);
1136
1138
  t.chain().updateAttributes(oe.name, {
1137
- src: (D == null ? void 0 : D.src) || c
1139
+ src: (b == null ? void 0 : b.src) || c
1138
1140
  }).setNodeSelection(t.state.selection.from).focus().run(), l(!1);
1139
- }, [t, c, l]), u = R(() => {
1141
+ }, [t, c, l]), u = L(() => {
1140
1142
  window.open(r, "_blank");
1141
- }, [r]), f = R(() => {
1142
- l(!0);
1143
- }, [l]), g = R(
1143
+ }, [r]), f = L(
1144
1144
  (w) => {
1145
1145
  t.chain().updateAttributes(oe.name, w).setNodeSelection(t.state.selection.from).focus().run();
1146
1146
  },
1147
1147
  [t]
1148
- ), m = R(() => t.isActive(oe.name) && !r, [t, r]), b = R(() => _e(oe.name, t), [t]);
1149
- return e ? /* @__PURE__ */ y(O, { children: [
1150
- /* @__PURE__ */ p(
1151
- et,
1152
- {
1153
- editor: t,
1154
- options: { placement: "bottom", offset: 8, flip: !0 },
1155
- pluginKey: "RichTextBubbleIframe",
1156
- shouldShow: m,
1157
- children: /* @__PURE__ */ y("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-md !richtext-border !richtext-border-solid !richtext-border-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none", children: [
1158
- /* @__PURE__ */ p(
1159
- x,
1160
- {
1161
- action: u,
1162
- icon: "Eye",
1163
- tooltip: "Visit Link"
1164
- }
1165
- ),
1166
- /* @__PURE__ */ p(
1167
- x,
1168
- {
1169
- action: f,
1170
- icon: "Pencil",
1171
- tooltip: "Open Edit Link"
1172
- }
1173
- ),
1174
- /* @__PURE__ */ p(
1175
- Hs,
1176
- {
1177
- height: s,
1178
- onOk: g,
1179
- width: i,
1180
- children: /* @__PURE__ */ p(
1148
+ ), g = L(() => t.isActive(oe.name) && !r, [t, r]), m = L(() => _e(oe.name, t), [t]);
1149
+ return e ? /* @__PURE__ */ p(I, { children: /* @__PURE__ */ p(
1150
+ et,
1151
+ {
1152
+ editor: t,
1153
+ options: { placement: "bottom", offset: 8, flip: !0 },
1154
+ pluginKey: "RichTextBubbleIframe",
1155
+ shouldShow: g,
1156
+ children: /* @__PURE__ */ y("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-md !richtext-border !richtext-border-solid !richtext-border-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none", children: [
1157
+ /* @__PURE__ */ p(
1158
+ x,
1159
+ {
1160
+ action: u,
1161
+ icon: "Eye",
1162
+ tooltip: "Visit Link"
1163
+ }
1164
+ ),
1165
+ /* @__PURE__ */ y(
1166
+ on,
1167
+ {
1168
+ onOpenChange: l,
1169
+ open: o,
1170
+ children: [
1171
+ /* @__PURE__ */ p(ln, { asChild: !0, children: /* @__PURE__ */ p(
1181
1172
  x,
1182
1173
  {
1183
- icon: "Settings",
1184
- tooltip: n("editor.settings")
1174
+ icon: "Pencil",
1175
+ tooltip: "Open Edit Link"
1185
1176
  }
1186
- )
1187
- }
1188
- ),
1189
- /* @__PURE__ */ p(
1190
- x,
1191
- {
1192
- action: b,
1193
- icon: "Trash2",
1194
- tooltip: n("editor.delete")
1195
- }
1196
- )
1197
- ] })
1198
- }
1199
- ),
1200
- /* @__PURE__ */ y(
1201
- on,
1202
- {
1203
- onOpenChange: l,
1204
- open: o,
1205
- children: [
1206
- /* @__PURE__ */ p(ln, {}),
1207
- /* @__PURE__ */ y(cn, { children: [
1208
- /* @__PURE__ */ p(go, { children: /* @__PURE__ */ p(an, { children: "Edit Link Iframe" }) }),
1209
- /* @__PURE__ */ p(
1210
- Ve,
1177
+ ) }),
1178
+ /* @__PURE__ */ y(cn, { children: [
1179
+ /* @__PURE__ */ p(go, { children: /* @__PURE__ */ p(an, { children: "Edit Link Iframe" }) }),
1180
+ /* @__PURE__ */ p(
1181
+ Ve,
1182
+ {
1183
+ autoFocus: !0,
1184
+ onInput: (w) => a(w.target.value),
1185
+ placeholder: "Enter link",
1186
+ type: "url",
1187
+ value: c
1188
+ }
1189
+ ),
1190
+ /* @__PURE__ */ y(hn, { children: [
1191
+ /* @__PURE__ */ p(
1192
+ Jt,
1193
+ {
1194
+ onClick: h,
1195
+ type: "button",
1196
+ children: "Cancel"
1197
+ }
1198
+ ),
1199
+ /* @__PURE__ */ p(
1200
+ Jt,
1201
+ {
1202
+ onClick: d,
1203
+ type: "button",
1204
+ children: "OK"
1205
+ }
1206
+ )
1207
+ ] })
1208
+ ] })
1209
+ ]
1210
+ }
1211
+ ),
1212
+ /* @__PURE__ */ p(
1213
+ Hs,
1214
+ {
1215
+ height: s,
1216
+ onOk: f,
1217
+ width: i,
1218
+ children: /* @__PURE__ */ p(
1219
+ x,
1211
1220
  {
1212
- autoFocus: !0,
1213
- onInput: (w) => a(w.target.value),
1214
- placeholder: "Enter link",
1215
- type: "url",
1216
- value: c
1221
+ icon: "Settings",
1222
+ tooltip: n("editor.settings")
1217
1223
  }
1218
- ),
1219
- /* @__PURE__ */ y(hn, { children: [
1220
- /* @__PURE__ */ p(
1221
- Jt,
1222
- {
1223
- onClick: h,
1224
- type: "button",
1225
- children: "Cancel"
1226
- }
1227
- ),
1228
- /* @__PURE__ */ p(
1229
- Jt,
1230
- {
1231
- onClick: d,
1232
- type: "button",
1233
- children: "OK"
1234
- }
1235
- )
1236
- ] })
1237
- ] })
1238
- ]
1239
- }
1240
- )
1241
- ] }) : /* @__PURE__ */ p(O, {});
1224
+ )
1225
+ }
1226
+ ),
1227
+ /* @__PURE__ */ p(
1228
+ x,
1229
+ {
1230
+ action: m,
1231
+ icon: "Trash2",
1232
+ tooltip: n("editor.delete")
1233
+ }
1234
+ )
1235
+ ] })
1236
+ }
1237
+ ) }) : /* @__PURE__ */ p(I, {});
1242
1238
  }
1243
1239
  function dl({
1244
1240
  children: e,
@@ -1252,7 +1248,7 @@ function dl({
1252
1248
  at(() => {
1253
1249
  t && (a(decodeURIComponent(o || "")), d(decodeURIComponent(l || "")));
1254
1250
  }, [t]);
1255
- const u = R(() => {
1251
+ const u = L(() => {
1256
1252
  s.chain().focus().setKatex({ text: encodeURIComponent(c), macros: encodeURIComponent(h) }).run(), a(""), d(""), n(!1);
1257
1253
  }, [s, c, h, n]), f = yt(() => {
1258
1254
  try {
@@ -1341,8 +1337,8 @@ function dl({
1341
1337
  }
1342
1338
  );
1343
1339
  }
1344
- function Zd() {
1345
- const e = Z(), t = j(), [n, i] = F(!1), s = R(() => t.isActive(Nn.name), [t]), r = R(() => _e(Nn.name, t), [t]);
1340
+ function tu() {
1341
+ const e = Z(), t = j(), [n, i] = F(!1), s = L(() => t.isActive(Nn.name), [t]), r = L(() => _e(Nn.name, t), [t]);
1346
1342
  return e ? /* @__PURE__ */ p(
1347
1343
  et,
1348
1344
  {
@@ -1376,7 +1372,7 @@ function Zd() {
1376
1372
  )
1377
1373
  ] })
1378
1374
  }
1379
- ) : /* @__PURE__ */ p(O, {});
1375
+ ) : /* @__PURE__ */ p(I, {});
1380
1376
  }
1381
1377
  function ul(e) {
1382
1378
  const { t } = G();
@@ -1417,9 +1413,9 @@ function ul(e) {
1417
1413
  )
1418
1414
  ] });
1419
1415
  }
1420
- function Qd() {
1421
- const e = Z(), t = j(), [n, i] = F(!1), s = ee(t, Ai.name), r = s == null ? void 0 : s.href, o = R(({ editor: h }) => h.isActive(Ai.name), []), l = (h, d, u) => {
1422
- const f = t.state.selection, { from: g } = f, m = (d == null ? void 0 : d.length) ?? 0, b = g + m;
1416
+ function eu() {
1417
+ const e = Z(), t = j(), [n, i] = F(!1), s = ee(t, Ai.name), r = s == null ? void 0 : s.href, o = L(({ editor: h }) => h.isActive(Ai.name), []), l = (h, d, u) => {
1418
+ const f = t.state.selection, { from: g } = f, m = (d == null ? void 0 : d.length) ?? 0, w = g + m;
1423
1419
  t.chain().extendMarkRange("link").insertContent({
1424
1420
  type: "text",
1425
1421
  text: d,
@@ -1432,8 +1428,8 @@ function Qd() {
1432
1428
  }
1433
1429
  }
1434
1430
  ]
1435
- }).setLink({ href: h }).setTextSelection({ from: g, to: b }).focus().run(), i(!1);
1436
- }, c = R(() => {
1431
+ }).setLink({ href: h }).setTextSelection({ from: g, to: w }).focus().run(), i(!1);
1432
+ }, c = L(() => {
1437
1433
  t.chain().extendMarkRange("link").unsetLink().focus().run(), i(!1);
1438
1434
  }, [t]), a = () => {
1439
1435
  i(!1);
@@ -1445,7 +1441,7 @@ function Qd() {
1445
1441
  options: { placement: "bottom", offset: 8, flip: !0 },
1446
1442
  pluginKey: "RichTextBubbleLink",
1447
1443
  shouldShow: o,
1448
- children: /* @__PURE__ */ p(O, { children: n ? /* @__PURE__ */ p(
1444
+ children: /* @__PURE__ */ p(I, { children: n ? /* @__PURE__ */ p(
1449
1445
  "div",
1450
1446
  {
1451
1447
  className: "richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-md !richtext-border !richtext-border-solid !richtext-border-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none",
@@ -1476,7 +1472,7 @@ function Qd() {
1476
1472
  }
1477
1473
  ) })
1478
1474
  }
1479
- ) : /* @__PURE__ */ p(O, {});
1475
+ ) : /* @__PURE__ */ p(I, {});
1480
1476
  }
1481
1477
  function ri({ item: e, disabled: t, editor: n }) {
1482
1478
  const i = e.component;
@@ -1493,7 +1489,7 @@ function ri({ item: e, disabled: t, editor: n }) {
1493
1489
  disabled: t || (e == null ? void 0 : e.componentdisabled),
1494
1490
  editor: n
1495
1491
  }
1496
- ) }) : /* @__PURE__ */ p(O, {});
1492
+ ) }) : /* @__PURE__ */ p(I, {});
1497
1493
  }
1498
1494
  function fl(e) {
1499
1495
  return e.type.name === Co.name;
@@ -1504,7 +1500,7 @@ function pl(e) {
1504
1500
  function gl(e) {
1505
1501
  return e.type.name === Eo.name;
1506
1502
  }
1507
- function tu() {
1503
+ function nu() {
1508
1504
  const { lang: e, t } = G(), n = Z(), i = j(), s = ({ editor: o }) => {
1509
1505
  const { selection: l } = o.view.state, { $from: c, to: a } = l;
1510
1506
  let h = !1;
@@ -1527,11 +1523,11 @@ function tu() {
1527
1523
  item: o
1528
1524
  },
1529
1525
  `bubbleMenu-image-${l}`
1530
- )) }) : /* @__PURE__ */ p(O, {})
1526
+ )) }) : /* @__PURE__ */ p(I, {})
1531
1527
  }
1532
- ) : /* @__PURE__ */ p(O, {});
1528
+ ) : /* @__PURE__ */ p(I, {});
1533
1529
  }
1534
- function eu() {
1530
+ function iu() {
1535
1531
  const { lang: e, t } = G(), n = Z(), i = j(), s = ({ editor: o }) => {
1536
1532
  const { selection: l } = o.view.state, { $from: c, to: a } = l;
1537
1533
  let h = !1;
@@ -1554,11 +1550,11 @@ function eu() {
1554
1550
  item: o
1555
1551
  },
1556
1552
  `bubbleMenu-image-gif-${l}`
1557
- )) }) : /* @__PURE__ */ p(O, {})
1553
+ )) }) : /* @__PURE__ */ p(I, {})
1558
1554
  }
1559
- ) : /* @__PURE__ */ p(O, {});
1555
+ ) : /* @__PURE__ */ p(I, {});
1560
1556
  }
1561
- function nu() {
1557
+ function su() {
1562
1558
  const { t: e } = G(), t = Z(), n = j(), i = ({ editor: r }) => {
1563
1559
  const { selection: o } = r.view.state, { $from: l, to: c } = o;
1564
1560
  let a = !1;
@@ -1581,39 +1577,39 @@ function nu() {
1581
1577
  item: r
1582
1578
  },
1583
1579
  `bubbleMenu-video-${o}`
1584
- )) }) : /* @__PURE__ */ p(O, {})
1580
+ )) }) : /* @__PURE__ */ p(I, {})
1585
1581
  }
1586
- ) : /* @__PURE__ */ p(O, {});
1582
+ ) : /* @__PURE__ */ p(I, {});
1587
1583
  }
1588
1584
  const Vi = `graph TB
1589
1585
  a-->b`, ml = ({ editor: e, attrs: t, extension: n }) => {
1590
- const { alt: i, align: s } = t, [r, o] = F(decodeURIComponent(i ?? Vi)), [l, c] = F(""), [a, h] = F(!1), d = Pt(null), [u, f] = F(null), g = n == null ? void 0 : n.options.upload, m = R(
1591
- (I) => {
1592
- I && import("mermaid").then((v) => {
1586
+ const { alt: i, align: s } = t, [r, o] = F(decodeURIComponent(i ?? Vi)), [l, c] = F(""), [a, h] = F(!1), d = Pt(null), [u, f] = F(null), g = n == null ? void 0 : n.options.upload, m = L(
1587
+ (A) => {
1588
+ A && import("mermaid").then((v) => {
1593
1589
  f(v.default);
1594
1590
  });
1595
1591
  },
1596
1592
  []
1597
- ), b = async (I) => {
1593
+ ), w = async (A) => {
1598
1594
  try {
1599
- const { svg: v } = await u.render("mermaid-svg", I);
1595
+ const { svg: v } = await u.render("mermaid-svg", A);
1600
1596
  c(v);
1601
1597
  } catch {
1602
1598
  c("");
1603
1599
  }
1604
- }, w = () => {
1600
+ }, b = () => {
1605
1601
  u.initialize({
1606
1602
  darkMode: !1,
1607
1603
  startOnLoad: !1,
1608
1604
  // fontFamily:'',
1609
1605
  fontSize: 12,
1610
1606
  theme: "base"
1611
- }), b(r);
1607
+ }), w(r);
1612
1608
  };
1613
1609
  return at(() => {
1614
- u && a && w();
1610
+ u && a && b();
1615
1611
  }, [u, a]), at(() => {
1616
- u && a && b(r);
1612
+ u && a && w(r);
1617
1613
  }, [u, r]), /* @__PURE__ */ y(
1618
1614
  on,
1619
1615
  {
@@ -1642,7 +1638,7 @@ a-->b`, ml = ({ editor: e, attrs: t, extension: n }) => {
1642
1638
  autoFocus: !0,
1643
1639
  className: "richtext-flex-1",
1644
1640
  defaultValue: Vi,
1645
- onChange: (I) => o(I.target.value),
1641
+ onChange: (A) => o(A.target.value),
1646
1642
  placeholder: "Text",
1647
1643
  required: !0,
1648
1644
  rows: 10,
@@ -1670,8 +1666,8 @@ a-->b`, ml = ({ editor: e, attrs: t, extension: n }) => {
1670
1666
  onClick: async () => {
1671
1667
  if (r !== "") {
1672
1668
  if (r) {
1673
- const I = d.current.querySelector("svg"), { width: v, height: P } = I.getBoundingClientRect(), E = `mermaid-${Ms()}.svg`;
1674
- let S = Rs(I.outerHTML);
1669
+ const A = d.current.querySelector("svg"), { width: v, height: P } = A.getBoundingClientRect(), E = `mermaid-${Ms()}.svg`;
1670
+ let S = Rs(A.outerHTML);
1675
1671
  if (g) {
1676
1672
  const k = Ns(S, E);
1677
1673
  S = await g(k);
@@ -1715,12 +1711,12 @@ function wl({ item: e, disabled: t, editor: n }) {
1715
1711
  disabled: t || ((s = e == null ? void 0 : e.componentProps) == null ? void 0 : s.disabled),
1716
1712
  editor: n
1717
1713
  }
1718
- ) }) : /* @__PURE__ */ p(O, {});
1714
+ ) }) : /* @__PURE__ */ p(I, {});
1719
1715
  }
1720
1716
  function bl(e) {
1721
1717
  return e.type.name === Ln.name;
1722
1718
  }
1723
- function iu() {
1719
+ function ru() {
1724
1720
  const { lang: e, t } = G(), n = Z(), i = j(), s = ee(i, Ln.name), r = Os(Ln.name), o = ({ editor: c }) => {
1725
1721
  const { selection: a } = c.view.state, { $from: h, to: d } = a;
1726
1722
  let u = !1;
@@ -1751,12 +1747,12 @@ function iu() {
1751
1747
  item: c
1752
1748
  },
1753
1749
  `bubbleMenu-mermaid-${a}`
1754
- )) }) : /* @__PURE__ */ p(O, {})
1750
+ )) }) : /* @__PURE__ */ p(I, {})
1755
1751
  }
1756
- ) : /* @__PURE__ */ p(O, {});
1752
+ ) : /* @__PURE__ */ p(I, {});
1757
1753
  }
1758
- function su({ hiddenActions: e = [] }) {
1759
- var m, b, w, D, I, v, P, E, S, k, U, H, nt, Mt, Rt, C, gt, Ae;
1754
+ function ou({ hiddenActions: e = [] }) {
1755
+ var m, w, b, M, A, v, P, E, S, k, N, H, nt, Mt, Rt, C, gt, Ae;
1760
1756
  const { t } = G(), n = Z(), i = j(), s = ({ editor: Wt }) => to(Wt.view.state, ho.name), r = (Wt) => e.includes(Wt);
1761
1757
  function o() {
1762
1758
  i.chain().focus().addColumnBefore().run();
@@ -1797,7 +1793,7 @@ function su({ hiddenActions: e = [] }) {
1797
1793
  x,
1798
1794
  {
1799
1795
  action: o,
1800
- disabled: !((b = (m = i == null ? void 0 : i.can()) == null ? void 0 : m.addColumnBefore) != null && b.call(m)),
1796
+ disabled: !((w = (m = i == null ? void 0 : i.can()) == null ? void 0 : m.addColumnBefore) != null && w.call(m)),
1801
1797
  icon: "BetweenHorizonalEnd",
1802
1798
  tooltip: t("editor.table.menu.insertColumnBefore"),
1803
1799
  tooltipOptions: { sideOffset: 15 }
@@ -1807,7 +1803,7 @@ function su({ hiddenActions: e = [] }) {
1807
1803
  x,
1808
1804
  {
1809
1805
  action: l,
1810
- disabled: !((D = (w = i == null ? void 0 : i.can()) == null ? void 0 : w.addColumnAfter) != null && D.call(w)),
1806
+ disabled: !((M = (b = i == null ? void 0 : i.can()) == null ? void 0 : b.addColumnAfter) != null && M.call(b)),
1811
1807
  icon: "BetweenHorizonalStart",
1812
1808
  tooltip: t("editor.table.menu.insertColumnAfter"),
1813
1809
  tooltipOptions: { sideOffset: 15 }
@@ -1817,7 +1813,7 @@ function su({ hiddenActions: e = [] }) {
1817
1813
  x,
1818
1814
  {
1819
1815
  action: c,
1820
- disabled: !((v = i == null ? void 0 : (I = i.can()).deleteColumn) != null && v.call(I)),
1816
+ disabled: !((v = i == null ? void 0 : (A = i.can()).deleteColumn) != null && v.call(A)),
1821
1817
  icon: "DeleteColumn",
1822
1818
  tooltip: t("editor.table.menu.deleteColumn"),
1823
1819
  tooltipOptions: { sideOffset: 15 }
@@ -1854,7 +1850,7 @@ function su({ hiddenActions: e = [] }) {
1854
1850
  x,
1855
1851
  {
1856
1852
  action: d,
1857
- disabled: !((H = (U = i == null ? void 0 : i.can()) == null ? void 0 : U.deleteRow) != null && H.call(U)),
1853
+ disabled: !((H = (N = i == null ? void 0 : i.can()) == null ? void 0 : N.deleteRow) != null && H.call(N)),
1858
1854
  icon: "DeleteRow",
1859
1855
  tooltip: t("editor.table.menu.deleteRow"),
1860
1856
  tooltipOptions: { sideOffset: 15 }
@@ -1906,7 +1902,7 @@ function su({ hiddenActions: e = [] }) {
1906
1902
  )
1907
1903
  ] })
1908
1904
  }
1909
- ) : /* @__PURE__ */ p(O, {});
1905
+ ) : /* @__PURE__ */ p(I, {});
1910
1906
  }
1911
1907
  function xl() {
1912
1908
  const { t: e } = G(), [t, n] = F(!1), i = j(), s = yt(() => {
@@ -1936,7 +1932,7 @@ function xl() {
1936
1932
  {
1937
1933
  dataState: !!r,
1938
1934
  children: [
1939
- r ? /* @__PURE__ */ p(O, { children: r }) : /* @__PURE__ */ p(O, { children: e("editor.paragraph.tooltip") }),
1935
+ r ? /* @__PURE__ */ p(I, { children: r }) : /* @__PURE__ */ p(I, { children: e("editor.paragraph.tooltip") }),
1940
1936
  /* @__PURE__ */ p(
1941
1937
  Q,
1942
1938
  {
@@ -1998,7 +1994,7 @@ function xl() {
1998
1994
  );
1999
1995
  }
2000
1996
  function yl() {
2001
- return /* @__PURE__ */ y(O, { children: [
1997
+ return /* @__PURE__ */ y(I, { children: [
2002
1998
  /* @__PURE__ */ p(xl, {}),
2003
1999
  /* @__PURE__ */ p(
2004
2000
  Tt,
@@ -2025,7 +2021,7 @@ function yl() {
2025
2021
  /* @__PURE__ */ p(No, {})
2026
2022
  ] });
2027
2023
  }
2028
- function ru({ buttonBubble: e }) {
2024
+ function lu({ buttonBubble: e }) {
2029
2025
  const t = j(), n = Z(), i = ({ editor: s }) => {
2030
2026
  const { selection: r } = s.view.state, { $from: o, to: l } = r;
2031
2027
  return o.pos === l ? !1 : r instanceof oo;
@@ -2037,14 +2033,14 @@ function ru({ buttonBubble: e }) {
2037
2033
  options: { placement: "bottom", offset: 8, flip: !0 },
2038
2034
  pluginKey: "RichTextBubbleText",
2039
2035
  shouldShow: i,
2040
- children: e ? /* @__PURE__ */ p(O, { children: e }) : /* @__PURE__ */ p("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-md !richtext-border !richtext-border-solid !richtext-border-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none", children: /* @__PURE__ */ p(yl, {}) })
2036
+ children: e ? /* @__PURE__ */ p(I, { children: e }) : /* @__PURE__ */ p("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-md !richtext-border !richtext-border-solid !richtext-border-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none", children: /* @__PURE__ */ p(yl, {}) })
2041
2037
  }
2042
- ) : /* @__PURE__ */ p(O, {});
2038
+ ) : /* @__PURE__ */ p(I, {});
2043
2039
  }
2044
- function ou() {
2045
- const { t: e } = G(), t = Z(), n = j(), [i, s] = F(!1), r = R(({ editor: c }) => c.isActive(Oi.name), []), o = (c) => {
2040
+ function cu() {
2041
+ const { t: e } = G(), t = Z(), n = j(), [i, s] = F(!1), r = L(({ editor: c }) => c.isActive(Oi.name), []), o = (c) => {
2046
2042
  n.commands.updateTweet({ src: c }), s(!1);
2047
- }, l = R(() => _e(Oi.name, n), [n]);
2043
+ }, l = L(() => _e(Oi.name, n), [n]);
2048
2044
  return t ? /* @__PURE__ */ p(
2049
2045
  et,
2050
2046
  {
@@ -2052,7 +2048,7 @@ function ou() {
2052
2048
  options: { placement: "bottom", offset: 8, flip: !0 },
2053
2049
  pluginKey: "RichTextBubbleTwitter",
2054
2050
  shouldShow: r,
2055
- children: /* @__PURE__ */ p(O, { children: i ? /* @__PURE__ */ p("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-md !richtext-border !richtext-border-solid !richtext-border-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none", children: /* @__PURE__ */ p(
2051
+ children: /* @__PURE__ */ p(I, { children: i ? /* @__PURE__ */ p("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-rounded-md !richtext-border !richtext-border-solid !richtext-border-border richtext-bg-popover richtext-p-4 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none", children: /* @__PURE__ */ p(
2056
2052
  Po,
2057
2053
  {
2058
2054
  editor: n,
@@ -2081,7 +2077,7 @@ function ou() {
2081
2077
  )
2082
2078
  ] }) })
2083
2079
  }
2084
- ) : /* @__PURE__ */ p(O, {});
2080
+ ) : /* @__PURE__ */ p(I, {});
2085
2081
  }
2086
2082
  const lt = () => /* @__PURE__ */ new Map(), Pn = (e) => {
2087
2083
  const t = lt();
@@ -2378,7 +2374,7 @@ class fn {
2378
2374
  const ci = (e) => new fn(e), Yl = (e) => e.pos !== e.arr.length, Gl = (e, t) => {
2379
2375
  const n = new Uint8Array(e.arr.buffer, e.pos + e.arr.byteOffset, t);
2380
2376
  return e.pos += t, n;
2381
- }, it = (e) => Gl(e, N(e)), pe = (e) => e.arr[e.pos++], N = (e) => {
2377
+ }, it = (e) => Gl(e, R(e)), pe = (e) => e.arr[e.pos++], R = (e) => {
2382
2378
  let t = 0, n = 1;
2383
2379
  const i = e.arr.length;
2384
2380
  for (; e.pos < i; ) {
@@ -2403,7 +2399,7 @@ const ci = (e) => new fn(e), Yl = (e) => e.pos !== e.arr.length, Gl = (e, t) =>
2403
2399
  }
2404
2400
  throw Ws;
2405
2401
  }, Jl = (e) => {
2406
- let t = N(e);
2402
+ let t = R(e);
2407
2403
  if (t === 0)
2408
2404
  return "";
2409
2405
  {
@@ -2452,7 +2448,7 @@ const ci = (e) => new fn(e), Yl = (e) => e.pos !== e.arr.length, Gl = (e, t) =>
2452
2448
  Fn,
2453
2449
  // CASE 119: string
2454
2450
  (e) => {
2455
- const t = N(e), n = {};
2451
+ const t = R(e), n = {};
2456
2452
  for (let i = 0; i < t; i++) {
2457
2453
  const s = Fn(e);
2458
2454
  n[s] = Ye(e);
@@ -2460,7 +2456,7 @@ const ci = (e) => new fn(e), Yl = (e) => e.pos !== e.arr.length, Gl = (e, t) =>
2460
2456
  return n;
2461
2457
  },
2462
2458
  (e) => {
2463
- const t = N(e), n = [];
2459
+ const t = R(e), n = [];
2464
2460
  for (let i = 0; i < t; i++)
2465
2461
  n.push(Ye(e));
2466
2462
  return n;
@@ -2477,7 +2473,7 @@ class Yi extends fn {
2477
2473
  super(t), this.reader = n, this.s = null, this.count = 0;
2478
2474
  }
2479
2475
  read() {
2480
- return this.count === 0 && (this.s = this.reader(this), Yl(this) ? this.count = N(this) + 1 : this.count = -1), this.count--, /** @type {T} */
2476
+ return this.count === 0 && (this.s = this.reader(this), Yl(this) ? this.count = R(this) + 1 : this.count = -1), this.count--, /** @type {T} */
2481
2477
  this.s;
2482
2478
  }
2483
2479
  }
@@ -2492,7 +2488,7 @@ class Fe extends fn {
2492
2488
  if (this.count === 0) {
2493
2489
  this.s = ai(this);
2494
2490
  const t = Fs(this.s);
2495
- this.count = 1, t && (this.s = -this.s, this.count = N(this) + 2);
2491
+ this.count = 1, t && (this.s = -this.s, this.count = R(this) + 2);
2496
2492
  }
2497
2493
  return this.count--, /** @type {number} */
2498
2494
  this.s;
@@ -2511,7 +2507,7 @@ class Tn extends fn {
2511
2507
  read() {
2512
2508
  if (this.count === 0) {
2513
2509
  const t = ai(this), n = t & 1;
2514
- this.diff = St(t / 2), this.count = 1, n && (this.count = N(this) + 2);
2510
+ this.diff = St(t / 2), this.count = 1, n && (this.count = R(this) + 2);
2515
2511
  }
2516
2512
  return this.s += this.diff, this.count--, this.s;
2517
2513
  }
@@ -2817,10 +2813,10 @@ const At = (e, t, n) => t.clients.forEach((i, s) => {
2817
2813
  }
2818
2814
  });
2819
2815
  }, Fc = (e) => {
2820
- const t = new ne(), n = N(e.restDecoder);
2816
+ const t = new ne(), n = R(e.restDecoder);
2821
2817
  for (let i = 0; i < n; i++) {
2822
2818
  e.resetDsCurVal();
2823
- const s = N(e.restDecoder), r = N(e.restDecoder);
2819
+ const s = R(e.restDecoder), r = R(e.restDecoder);
2824
2820
  if (r > 0) {
2825
2821
  const o = kt(t.clients, s, () => (
2826
2822
  /** @type {Array<DeleteItem>} */
@@ -2832,10 +2828,10 @@ const At = (e, t, n) => t.clients.forEach((i, s) => {
2832
2828
  }
2833
2829
  return t;
2834
2830
  }, Xi = (e, t, n) => {
2835
- const i = new ne(), s = N(e.restDecoder);
2831
+ const i = new ne(), s = R(e.restDecoder);
2836
2832
  for (let r = 0; r < s; r++) {
2837
2833
  e.resetDsCurVal();
2838
- const o = N(e.restDecoder), l = N(e.restDecoder), c = n.clients.get(o) || [], a = B(n, o);
2834
+ const o = R(e.restDecoder), l = R(e.restDecoder), c = n.clients.get(o) || [], a = B(n, o);
2839
2835
  for (let h = 0; h < l; h++) {
2840
2836
  const d = e.readDsClock(), u = d + e.readDsLen();
2841
2837
  if (d < a) {
@@ -2882,7 +2878,7 @@ class Ft extends $s {
2882
2878
  */
2883
2879
  load() {
2884
2880
  const t = this._item;
2885
- t !== null && !this.shouldLoad && M(
2881
+ t !== null && !this.shouldLoad && O(
2886
2882
  /** @type {any} */
2887
2883
  t.parent.doc,
2888
2884
  (n) => {
@@ -2912,7 +2908,7 @@ class Ft extends $s {
2912
2908
  * @public
2913
2909
  */
2914
2910
  transact(t, n = null) {
2915
- return M(this, t, n);
2911
+ return O(this, t, n);
2916
2912
  }
2917
2913
  /**
2918
2914
  * Define a shared data type.
@@ -3052,7 +3048,7 @@ class Ft extends $s {
3052
3048
  /** @type {ContentDoc} */
3053
3049
  t.content
3054
3050
  );
3055
- n.doc = new Ft({ guid: this.guid, ...n.opts, shouldLoad: !1 }), n.doc._item = t, M(
3051
+ n.doc = new Ft({ guid: this.guid, ...n.opts, shouldLoad: !1 }), n.doc._item = t, O(
3056
3052
  /** @type {any} */
3057
3053
  t.parent.doc,
3058
3054
  (i) => {
@@ -3080,13 +3076,13 @@ class zc {
3080
3076
  * @return {number}
3081
3077
  */
3082
3078
  readDsClock() {
3083
- return this.dsCurrVal += N(this.restDecoder), this.dsCurrVal;
3079
+ return this.dsCurrVal += R(this.restDecoder), this.dsCurrVal;
3084
3080
  }
3085
3081
  /**
3086
3082
  * @return {number}
3087
3083
  */
3088
3084
  readDsLen() {
3089
- const t = N(this.restDecoder) + 1;
3085
+ const t = R(this.restDecoder) + 1;
3090
3086
  return this.dsCurrVal += t, t;
3091
3087
  }
3092
3088
  }
@@ -3095,7 +3091,7 @@ class Je extends zc {
3095
3091
  * @param {decoding.Decoder} decoder
3096
3092
  */
3097
3093
  constructor(t) {
3098
- super(t), this.keys = [], N(t), this.keyClockDecoder = new Tn(it(t)), this.clientDecoder = new Fe(it(t)), this.leftClockDecoder = new Tn(it(t)), this.rightClockDecoder = new Tn(it(t)), this.infoDecoder = new Yi(it(t), pe), this.stringDecoder = new ec(it(t)), this.parentInfoDecoder = new Yi(it(t), pe), this.typeRefDecoder = new Fe(it(t)), this.lenDecoder = new Fe(it(t));
3094
+ super(t), this.keys = [], R(t), this.keyClockDecoder = new Tn(it(t)), this.clientDecoder = new Fe(it(t)), this.leftClockDecoder = new Tn(it(t)), this.rightClockDecoder = new Tn(it(t)), this.infoDecoder = new Yi(it(t), pe), this.stringDecoder = new ec(it(t)), this.parentInfoDecoder = new Yi(it(t), pe), this.typeRefDecoder = new Fe(it(t)), this.lenDecoder = new Fe(it(t));
3099
3095
  }
3100
3096
  /**
3101
3097
  * @return {ID}
@@ -3426,10 +3422,10 @@ const Yc = (e, t, n, i) => {
3426
3422
  );
3427
3423
  });
3428
3424
  }, Gc = (e, t) => {
3429
- const n = lt(), i = N(e.restDecoder);
3425
+ const n = lt(), i = R(e.restDecoder);
3430
3426
  for (let s = 0; s < i; s++) {
3431
- const r = N(e.restDecoder), o = new Array(r), l = e.readClient();
3432
- let c = N(e.restDecoder);
3427
+ const r = R(e.restDecoder), o = new Array(r), l = e.readClient();
3428
+ let c = R(e.restDecoder);
3433
3429
  n.set(l, { i: 0, refs: o });
3434
3430
  for (let a = 0; a < r; a++) {
3435
3431
  const h = e.readInfo();
@@ -3440,12 +3436,12 @@ const Yc = (e, t, n, i) => {
3440
3436
  break;
3441
3437
  }
3442
3438
  case 10: {
3443
- const d = N(e.restDecoder);
3439
+ const d = R(e.restDecoder);
3444
3440
  o[a] = new rt(_(l, c), d), c += d;
3445
3441
  break;
3446
3442
  }
3447
3443
  default: {
3448
- const d = (h & (bt | Y)) === 0, u = new A(
3444
+ const d = (h & (bt | Y)) === 0, u = new D(
3449
3445
  _(l, c),
3450
3446
  null,
3451
3447
  // left
@@ -3505,7 +3501,7 @@ const Yc = (e, t, n, i) => {
3505
3501
  const d = /* @__PURE__ */ new Map(), u = () => {
3506
3502
  for (const f of i) {
3507
3503
  const g = f.id.client, m = n.get(g);
3508
- m ? (m.i--, l.clients.set(g, m.refs.slice(m.i)), n.delete(g), m.i = 0, m.refs = []) : l.clients.set(g, [f]), s = s.filter((b) => b !== g);
3504
+ m ? (m.i--, l.clients.set(g, m.refs.slice(m.i)), n.delete(g), m.i = 0, m.refs = []) : l.clients.set(g, [f]), s = s.filter((w) => w !== g);
3509
3505
  }
3510
3506
  i.length = 0;
3511
3507
  };
@@ -3518,18 +3514,18 @@ const Yc = (e, t, n, i) => {
3518
3514
  const m = h.getMissing(e, t);
3519
3515
  if (m !== null) {
3520
3516
  i.push(h);
3521
- const b = n.get(
3517
+ const w = n.get(
3522
3518
  /** @type {number} */
3523
3519
  m
3524
3520
  ) || { refs: [], i: 0 };
3525
- if (b.refs.length === b.i)
3521
+ if (w.refs.length === w.i)
3526
3522
  a(
3527
3523
  /** @type {number} */
3528
3524
  m,
3529
3525
  B(t, m)
3530
3526
  ), u();
3531
3527
  else {
3532
- h = b.refs[b.i++];
3528
+ h = w.refs[w.i++];
3533
3529
  continue;
3534
3530
  }
3535
3531
  } else (g === 0 || g < h.length) && (h.integrate(e, g), d.set(h.id.client, h.id.clock + h.length));
@@ -3553,7 +3549,7 @@ const Yc = (e, t, n, i) => {
3553
3549
  return ar(f, l, /* @__PURE__ */ new Map()), T(f.restEncoder, 0), { missing: c, update: f.toUint8Array() };
3554
3550
  }
3555
3551
  return null;
3556
- }, qc = (e, t) => ar(e, t.doc.store, t.beforeState), Xc = (e, t, n, i = new Je(e)) => M(t, (s) => {
3552
+ }, qc = (e, t) => ar(e, t.doc.store, t.beforeState), Xc = (e, t, n, i = new Je(e)) => O(t, (s) => {
3557
3553
  s.local = !1;
3558
3554
  let r = !1;
3559
3555
  const o = s.doc, l = o.store, c = Gc(i, o), a = Jc(s, l, c), h = l.pendingStructs;
@@ -3575,7 +3571,7 @@ const Yc = (e, t, n, i) => {
3575
3571
  const d = Xi(i, s, l);
3576
3572
  if (l.pendingDs) {
3577
3573
  const u = new Je(ci(l.pendingDs));
3578
- N(u.restDecoder);
3574
+ R(u.restDecoder);
3579
3575
  const f = Xi(u, s, l);
3580
3576
  d && f ? l.pendingDs = os([d, f]) : l.pendingDs = d || f;
3581
3577
  } else
@@ -3678,7 +3674,7 @@ const ta = (e, t, n = 0) => new Qc(e, t, n), Ne = (e, t, n) => {
3678
3674
  if (B(i, s.client) <= s.clock)
3679
3675
  return null;
3680
3676
  const h = n ? Jn(i, s) : ea(i, s), d = h.item;
3681
- if (!(d instanceof A))
3677
+ if (!(d instanceof D))
3682
3678
  return null;
3683
3679
  if (c = /** @type {AbstractType<any>} */
3684
3680
  d.parent, c._item === null || !c._item.deleted) {
@@ -3694,7 +3690,7 @@ const ta = (e, t, n = 0) => new Qc(e, t, n), Ne = (e, t, n) => {
3694
3690
  if (B(i, r.client) <= r.clock)
3695
3691
  return null;
3696
3692
  const { item: h } = n ? Jn(i, r) : { item: Yt(i, r) };
3697
- if (h instanceof A && h.content instanceof ut)
3693
+ if (h instanceof D && h.content instanceof ut)
3698
3694
  c = h.content.type;
3699
3695
  else
3700
3696
  return null;
@@ -3770,7 +3766,7 @@ const gn = (e) => {
3770
3766
  ia
3771
3767
  ), Yn = (e, t, n) => {
3772
3768
  const i = ht(t, n), s = t[i];
3773
- return s.id.clock < n && s instanceof A ? (t.splice(i + 1, 0, en(e, s, n - s.id.clock)), i + 1) : i;
3769
+ return s.id.clock < n && s instanceof D ? (t.splice(i + 1, 0, en(e, s, n - s.id.clock)), i + 1) : i;
3774
3770
  }, J = (e, t) => {
3775
3771
  const n = (
3776
3772
  /** @type {Array<Item>} */
@@ -3812,7 +3808,7 @@ const ns = (e, t) => t.deleteSet.clients.size === 0 && !kl(t.afterState, (n, i)
3812
3808
  let n = e[t], i = e[t - 1], s = t;
3813
3809
  for (; s > 0; n = i, i = e[--s - 1]) {
3814
3810
  if (i.deleted === n.deleted && i.constructor === n.constructor && i.mergeWith(n)) {
3815
- n instanceof A && n.parentSub !== null && /** @type {AbstractType<any>} */
3811
+ n instanceof D && n.parentSub !== null && /** @type {AbstractType<any>} */
3816
3812
  n.parent._map.get(n.parentSub) === n && n.parent._map.set(
3817
3813
  n.parentSub,
3818
3814
  /** @type {Item} */
@@ -3836,7 +3832,7 @@ const ns = (e, t) => t.deleteSet.clients.size === 0 && !kl(t.afterState, (n, i)
3836
3832
  const d = r[a];
3837
3833
  if (l.clock + l.len <= d.id.clock)
3838
3834
  break;
3839
- d instanceof A && d.deleted && !d.keep && n(d) && d.gc(t, !1);
3835
+ d instanceof D && d.deleted && !d.keep && n(d) && d.gc(t, !1);
3840
3836
  }
3841
3837
  }
3842
3838
  }
@@ -3904,7 +3900,7 @@ const ns = (e, t) => t.deleteSet.clients.size === 0 && !kl(t.afterState, (n, i)
3904
3900
  }), a.forEach((h) => i.subdocs.delete(h)), i.emit("subdocs", [{ loaded: c, added: l, removed: a }, i, n]), a.forEach((h) => h.destroy())), e.length <= t + 1 ? (i._transactionCleanups = [], i.emit("afterAllTransactions", [i, e])) : gr(e, t + 1);
3905
3901
  }
3906
3902
  }
3907
- }, M = (e, t, n = null, i = !0) => {
3903
+ }, O = (e, t, n = null, i = !0) => {
3908
3904
  const s = e._transactionCleanups;
3909
3905
  let r = !1, o = null;
3910
3906
  e._transaction === null && (r = !0, e._transaction = new ra(e, n, i), s.push(e._transaction), s.length === 1 && e.emit("beforeAllTransactions", [e]), e.emit("beforeTransaction", [e._transaction, e]));
@@ -3929,7 +3925,7 @@ class ca {
3929
3925
  }
3930
3926
  const ss = (e, t, n) => {
3931
3927
  At(e, n.deletions, (i) => {
3932
- i instanceof A && t.scope.some((s) => s === e.doc || we(
3928
+ i instanceof D && t.scope.some((s) => s === e.doc || we(
3933
3929
  /** @type {AbstractType<any>} */
3934
3930
  s,
3935
3931
  i
@@ -3938,7 +3934,7 @@ const ss = (e, t, n) => {
3938
3934
  }, rs = (e, t, n) => {
3939
3935
  let i = null;
3940
3936
  const s = e.doc, r = e.scope;
3941
- M(s, (l) => {
3937
+ O(s, (l) => {
3942
3938
  for (; t.length > 0 && e.currStackItem === null; ) {
3943
3939
  const c = s.store, a = (
3944
3940
  /** @type {StackItem} */
@@ -3946,7 +3942,7 @@ const ss = (e, t, n) => {
3946
3942
  ), h = /* @__PURE__ */ new Set(), d = [];
3947
3943
  let u = !1;
3948
3944
  At(l, a.insertions, (f) => {
3949
- if (f instanceof A) {
3945
+ if (f instanceof D) {
3950
3946
  if (f.redone !== null) {
3951
3947
  let { item: g, diff: m } = Jn(c, f.id);
3952
3948
  m > 0 && (g = J(l, _(g.id.client, g.id.clock + m))), f = g;
@@ -3959,7 +3955,7 @@ const ss = (e, t, n) => {
3959
3955
  )) && d.push(f);
3960
3956
  }
3961
3957
  }), At(l, a.deletions, (f) => {
3962
- f instanceof A && r.some((g) => g === l.doc || we(
3958
+ f instanceof D && r.some((g) => g === l.doc || we(
3963
3959
  /** @type {AbstractType<any>} */
3964
3960
  g,
3965
3961
  f
@@ -4002,35 +3998,35 @@ class mr extends $s {
4002
3998
  )
4003
3999
  } = {}) {
4004
4000
  super(), this.scope = [], this.doc = l, this.addToScope(t), this.deleteFilter = s, r.add(this), this.trackedOrigins = r, this.captureTransaction = i, this.undoStack = [], this.redoStack = [], this.undoing = !1, this.redoing = !1, this.currStackItem = null, this.lastChange = 0, this.ignoreRemoteMapChanges = o, this.captureTimeout = n, this.afterTransactionHandler = (c) => {
4005
- if (!this.captureTransaction(c) || !this.scope.some((b) => c.changedParentTypes.has(
4001
+ if (!this.captureTransaction(c) || !this.scope.some((w) => c.changedParentTypes.has(
4006
4002
  /** @type {AbstractType<any>} */
4007
- b
4008
- ) || b === this.doc) || !this.trackedOrigins.has(c.origin) && (!c.origin || !this.trackedOrigins.has(c.origin.constructor)))
4003
+ w
4004
+ ) || w === this.doc) || !this.trackedOrigins.has(c.origin) && (!c.origin || !this.trackedOrigins.has(c.origin.constructor)))
4009
4005
  return;
4010
4006
  const a = this.undoing, h = this.redoing, d = a ? this.redoStack : this.undoStack;
4011
4007
  a ? this.stopCapturing() : h || this.clear(!1, !0);
4012
4008
  const u = new ne();
4013
- c.afterState.forEach((b, w) => {
4014
- const D = c.beforeState.get(w) || 0, I = b - D;
4015
- I > 0 && ge(u, w, D, I);
4009
+ c.afterState.forEach((w, b) => {
4010
+ const M = c.beforeState.get(b) || 0, A = w - M;
4011
+ A > 0 && ge(u, b, M, A);
4016
4012
  });
4017
4013
  const f = lc();
4018
4014
  let g = !1;
4019
4015
  if (this.lastChange > 0 && f - this.lastChange < this.captureTimeout && d.length > 0 && !a && !h) {
4020
- const b = d[d.length - 1];
4021
- b.deletions = Wn([b.deletions, c.deleteSet]), b.insertions = Wn([b.insertions, u]);
4016
+ const w = d[d.length - 1];
4017
+ w.deletions = Wn([w.deletions, c.deleteSet]), w.insertions = Wn([w.insertions, u]);
4022
4018
  } else
4023
4019
  d.push(new ca(c.deleteSet, u)), g = !0;
4024
4020
  !a && !h && (this.lastChange = f), At(
4025
4021
  c,
4026
4022
  c.deleteSet,
4027
4023
  /** @param {Item|GC} item */
4028
- (b) => {
4029
- b instanceof A && this.scope.some((w) => w === c.doc || we(
4024
+ (w) => {
4025
+ w instanceof D && this.scope.some((b) => b === c.doc || we(
4030
4026
  /** @type {AbstractType<any>} */
4031
- w,
4032
- b
4033
- )) && Si(b, !0);
4027
+ b,
4028
+ w
4029
+ )) && Si(w, !0);
4034
4030
  }
4035
4031
  );
4036
4032
  const m = [{ stackItem: d[d.length - 1], origin: c.origin, type: a ? "redo" : "undo", changedParentTypes: c.changedParentTypes }, this];
@@ -4141,17 +4137,17 @@ class mr extends $s {
4141
4137
  }
4142
4138
  }
4143
4139
  function* aa(e) {
4144
- const t = N(e.restDecoder);
4140
+ const t = R(e.restDecoder);
4145
4141
  for (let n = 0; n < t; n++) {
4146
- const i = N(e.restDecoder), s = e.readClient();
4147
- let r = N(e.restDecoder);
4142
+ const i = R(e.restDecoder), s = e.readClient();
4143
+ let r = R(e.restDecoder);
4148
4144
  for (let o = 0; o < i; o++) {
4149
4145
  const l = e.readInfo();
4150
4146
  if (l === 10) {
4151
- const c = N(e.restDecoder);
4147
+ const c = R(e.restDecoder);
4152
4148
  yield new rt(_(s, r), c), r += c;
4153
4149
  } else if ((dn & l) !== 0) {
4154
- const c = (l & (bt | Y)) === 0, a = new A(
4150
+ const c = (l & (bt | Y)) === 0, a = new D(
4155
4151
  _(s, r),
4156
4152
  null,
4157
4153
  // left
@@ -4215,7 +4211,7 @@ const ua = (e, t) => {
4215
4211
  /** @type {Item} */
4216
4212
  e
4217
4213
  ), { client: i, clock: s } = n.id;
4218
- return new A(
4214
+ return new D(
4219
4215
  _(i, s + t),
4220
4216
  null,
4221
4217
  _(i, s + t - 1),
@@ -4719,7 +4715,7 @@ const yr = (e, t, n) => {
4719
4715
  const r = e.doc, o = r.clientID, l = r.store, c = n === null ? t._start : n.right;
4720
4716
  let a = [];
4721
4717
  const h = () => {
4722
- a.length > 0 && (s = new A(_(o, B(l, o)), s, s && s.lastId, c, c && c.id, t, null, new $t(a)), s.integrate(e, 0), a = []);
4718
+ a.length > 0 && (s = new D(_(o, B(l, o)), s, s && s.lastId, c, c && c.id, t, null, new $t(a)), s.integrate(e, 0), a = []);
4723
4719
  };
4724
4720
  i.forEach((d) => {
4725
4721
  if (d === null)
@@ -4737,20 +4733,20 @@ const yr = (e, t, n) => {
4737
4733
  switch (h(), d.constructor) {
4738
4734
  case Uint8Array:
4739
4735
  case ArrayBuffer:
4740
- s = new A(_(o, B(l, o)), s, s && s.lastId, c, c && c.id, t, null, new De(new Uint8Array(
4736
+ s = new D(_(o, B(l, o)), s, s && s.lastId, c, c && c.id, t, null, new De(new Uint8Array(
4741
4737
  /** @type {Uint8Array} */
4742
4738
  d
4743
4739
  ))), s.integrate(e, 0);
4744
4740
  break;
4745
4741
  case Ft:
4746
- s = new A(_(o, B(l, o)), s, s && s.lastId, c, c && c.id, t, null, new Ie(
4742
+ s = new D(_(o, B(l, o)), s, s && s.lastId, c, c && c.id, t, null, new Ie(
4747
4743
  /** @type {Doc} */
4748
4744
  d
4749
4745
  )), s.integrate(e, 0);
4750
4746
  break;
4751
4747
  default:
4752
4748
  if (d instanceof z)
4753
- s = new A(_(o, B(l, o)), s, s && s.lastId, c, c && c.id, t, null, new ut(d)), s.integrate(e, 0);
4749
+ s = new D(_(o, B(l, o)), s, s && s.lastId, c, c && c.id, t, null, new ut(d)), s.integrate(e, 0);
4754
4750
  else
4755
4751
  throw new Error("Unexpected content type in insert operation");
4756
4752
  }
@@ -4832,7 +4828,7 @@ const yr = (e, t, n) => {
4832
4828
  else
4833
4829
  throw new Error("Unexpected content type");
4834
4830
  }
4835
- new A(_(o, B(r.store, o)), s, s && s.lastId, null, null, t, n, l).integrate(e, 0);
4831
+ new D(_(o, B(r.store, o)), s, s && s.lastId, null, null, t, n, l).integrate(e, 0);
4836
4832
  }, xi = (e, t) => {
4837
4833
  e.doc ?? K();
4838
4834
  const n = e._map.get(t);
@@ -4943,7 +4939,7 @@ class Gt extends z {
4943
4939
  * @param {Array<T>} content The array of content
4944
4940
  */
4945
4941
  insert(t, n) {
4946
- this.doc !== null ? M(this.doc, (i) => {
4942
+ this.doc !== null ? O(this.doc, (i) => {
4947
4943
  Er(
4948
4944
  i,
4949
4945
  this,
@@ -4961,7 +4957,7 @@ class Gt extends z {
4961
4957
  * @todo Use the following implementation in all types.
4962
4958
  */
4963
4959
  push(t) {
4964
- this.doc !== null ? M(this.doc, (n) => {
4960
+ this.doc !== null ? O(this.doc, (n) => {
4965
4961
  xa(
4966
4962
  n,
4967
4963
  this,
@@ -4985,7 +4981,7 @@ class Gt extends z {
4985
4981
  * @param {number} length The number of elements to remove. Defaults to 1.
4986
4982
  */
4987
4983
  delete(t, n = 1) {
4988
- this.doc !== null ? M(this.doc, (i) => {
4984
+ this.doc !== null ? O(this.doc, (i) => {
4989
4985
  Tr(i, this, t, n);
4990
4986
  }) : this._prelimContent.splice(t, n);
4991
4987
  }
@@ -5213,7 +5209,7 @@ class Qt extends z {
5213
5209
  * @param {string} key The key of the element to remove.
5214
5210
  */
5215
5211
  delete(t) {
5216
- this.doc !== null ? M(this.doc, (n) => {
5212
+ this.doc !== null ? O(this.doc, (n) => {
5217
5213
  Ze(n, this, t);
5218
5214
  }) : this._prelimContent.delete(t);
5219
5215
  }
@@ -5226,7 +5222,7 @@ class Qt extends z {
5226
5222
  * @return {VAL}
5227
5223
  */
5228
5224
  set(t, n) {
5229
- return this.doc !== null ? M(this.doc, (i) => {
5225
+ return this.doc !== null ? O(this.doc, (i) => {
5230
5226
  bi(
5231
5227
  i,
5232
5228
  this,
@@ -5261,7 +5257,7 @@ class Qt extends z {
5261
5257
  * Removes all elements from this YMap.
5262
5258
  */
5263
5259
  clear() {
5264
- this.doc !== null ? M(this.doc, (t) => {
5260
+ this.doc !== null ? O(this.doc, (t) => {
5265
5261
  this.forEach(function(n, i, s) {
5266
5262
  Ze(t, s, i);
5267
5263
  });
@@ -5345,7 +5341,7 @@ const cs = (e, t, n) => {
5345
5341
  ), n.forward();
5346
5342
  const s = e.doc, r = s.clientID;
5347
5343
  i.forEach((o, l) => {
5348
- const c = n.left, a = n.right, h = new A(_(r, B(s.store, r)), c, c && c.lastId, a, a && a.id, t, null, new V(l, o));
5344
+ const c = n.left, a = n.right, h = new D(_(r, B(s.store, r)), c, c && c.lastId, a, a && a.id, t, null, new V(l, o));
5349
5345
  h.integrate(e, 0), n.right = h, n.forward();
5350
5346
  });
5351
5347
  }, se = (e, t) => {
@@ -5370,7 +5366,7 @@ const cs = (e, t, n) => {
5370
5366
  if (!_t(a, c)) {
5371
5367
  o.set(l, a);
5372
5368
  const { left: h, right: d } = n;
5373
- n.right = new A(_(r, B(s.store, r)), h, h && h.lastId, d, d && d.id, t, null, new V(l, c)), n.right.integrate(e, 0), n.forward();
5369
+ n.right = new D(_(r, B(s.store, r)), h, h && h.lastId, d, d && d.id, t, null, new V(l, c)), n.right.integrate(e, 0), n.forward();
5374
5370
  }
5375
5371
  }
5376
5372
  return o;
@@ -5385,7 +5381,7 @@ const cs = (e, t, n) => {
5385
5381
  i
5386
5382
  ) : i instanceof z ? new ut(i) : new zt(i);
5387
5383
  let { left: a, right: h, index: d } = n;
5388
- t._searchMarker && be(t._searchMarker, n.index, c.getLength()), h = new A(_(o, B(r.store, o)), a, a && a.lastId, h, h && h.id, t, null, c), h.integrate(e, 0), n.right = h, n.index = d, n.forward(), Ar(e, t, n, l);
5384
+ t._searchMarker && be(t._searchMarker, n.index, c.getLength()), h = new D(_(o, B(r.store, o)), a, a && a.lastId, h, h && h.id, t, null, c), h.integrate(e, 0), n.right = h, n.index = d, n.forward(), Ar(e, t, n, l);
5389
5385
  }, as = (e, t, n, i, s) => {
5390
5386
  const r = e.doc, o = r.clientID;
5391
5387
  Or(n, s);
@@ -5422,7 +5418,7 @@ const cs = (e, t, n) => {
5422
5418
  for (; i > 0; i--)
5423
5419
  c += `
5424
5420
  `;
5425
- n.right = new A(_(o, B(r.store, o)), n.left, n.left && n.left.lastId, n.right, n.right && n.right.id, t, null, new dt(c)), n.right.integrate(e, 0), n.forward();
5421
+ n.right = new D(_(o, B(r.store, o)), n.left, n.left && n.left.lastId, n.right, n.right && n.right.id, t, null, new dt(c)), n.right.integrate(e, 0), n.forward();
5426
5422
  }
5427
5423
  Ar(e, t, n, l);
5428
5424
  }, Rr = (e, t, n, i, s) => {
@@ -5477,7 +5473,7 @@ const cs = (e, t, n) => {
5477
5473
  }
5478
5474
  }, Ea = (e) => {
5479
5475
  let t = 0;
5480
- return M(
5476
+ return O(
5481
5477
  /** @type {Doc} */
5482
5478
  e.doc,
5483
5479
  (n) => {
@@ -5523,7 +5519,7 @@ const cs = (e, t, n) => {
5523
5519
  }
5524
5520
  );
5525
5521
  }
5526
- M(n, (i) => {
5522
+ O(n, (i) => {
5527
5523
  At(e, e.deleteSet, (s) => {
5528
5524
  if (s instanceof st || !/** @type {YText} */
5529
5525
  s.parent._hasFormatting || t.has(
@@ -5604,7 +5600,7 @@ class Da extends mn {
5604
5600
  /** @type {Doc} */
5605
5601
  this.target.doc
5606
5602
  ), n = [];
5607
- M(t, (i) => {
5603
+ O(t, (i) => {
5608
5604
  const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
5609
5605
  let o = this.target._start, l = null;
5610
5606
  const c = {};
@@ -5768,7 +5764,7 @@ class Ot extends z {
5768
5764
  * @public
5769
5765
  */
5770
5766
  applyDelta(t, { sanitize: n = !0 } = {}) {
5771
- this.doc !== null ? M(this.doc, (i) => {
5767
+ this.doc !== null ? O(this.doc, (i) => {
5772
5768
  const s = new Gn(null, this._start, 0, /* @__PURE__ */ new Map());
5773
5769
  for (let r = 0; r < t.length; r++) {
5774
5770
  const o = t[r];
@@ -5848,7 +5844,7 @@ class Ot extends z {
5848
5844
  }
5849
5845
  a();
5850
5846
  };
5851
- return t || n ? M(o, (d) => {
5847
+ return t || n ? O(o, (d) => {
5852
5848
  t && jn(d, t), n && jn(d, n), h();
5853
5849
  }, "cleanup") : h(), s;
5854
5850
  }
@@ -5866,7 +5862,7 @@ class Ot extends z {
5866
5862
  if (n.length <= 0)
5867
5863
  return;
5868
5864
  const s = this.doc;
5869
- s !== null ? M(s, (r) => {
5865
+ s !== null ? O(s, (r) => {
5870
5866
  const o = Le(r, this, t, !i);
5871
5867
  i || (i = {}, o.currentAttributes.forEach((l, c) => {
5872
5868
  i[c] = l;
@@ -5885,7 +5881,7 @@ class Ot extends z {
5885
5881
  */
5886
5882
  insertEmbed(t, n, i) {
5887
5883
  const s = this.doc;
5888
- s !== null ? M(s, (r) => {
5884
+ s !== null ? O(s, (r) => {
5889
5885
  const o = Le(r, this, t, !i);
5890
5886
  On(r, this, o, n, i || {});
5891
5887
  }) : this._pending.push(() => this.insertEmbed(t, n, i || {}));
@@ -5902,7 +5898,7 @@ class Ot extends z {
5902
5898
  if (n === 0)
5903
5899
  return;
5904
5900
  const i = this.doc;
5905
- i !== null ? M(i, (s) => {
5901
+ i !== null ? O(i, (s) => {
5906
5902
  hs(s, Le(s, this, t, !0), n);
5907
5903
  }) : this._pending.push(() => this.delete(t, n));
5908
5904
  }
@@ -5920,7 +5916,7 @@ class Ot extends z {
5920
5916
  if (n === 0)
5921
5917
  return;
5922
5918
  const s = this.doc;
5923
- s !== null ? M(s, (r) => {
5919
+ s !== null ? O(s, (r) => {
5924
5920
  const o = Le(r, this, t, !1);
5925
5921
  o.right !== null && as(r, this, o, n, i);
5926
5922
  }) : this._pending.push(() => this.format(t, n, i));
@@ -5935,7 +5931,7 @@ class Ot extends z {
5935
5931
  * @public
5936
5932
  */
5937
5933
  removeAttribute(t) {
5938
- this.doc !== null ? M(this.doc, (n) => {
5934
+ this.doc !== null ? O(this.doc, (n) => {
5939
5935
  Ze(n, this, t);
5940
5936
  }) : this._pending.push(() => this.removeAttribute(t));
5941
5937
  }
@@ -5950,7 +5946,7 @@ class Ot extends z {
5950
5946
  * @public
5951
5947
  */
5952
5948
  setAttribute(t, n) {
5953
- this.doc !== null ? M(this.doc, (i) => {
5949
+ this.doc !== null ? O(this.doc, (i) => {
5954
5950
  bi(i, this, t, n);
5955
5951
  }) : this._pending.push(() => this.setAttribute(t, n));
5956
5952
  }
@@ -6191,7 +6187,7 @@ class Ht extends z {
6191
6187
  * @param {Array<YXmlElement|YXmlText>} content The array of content
6192
6188
  */
6193
6189
  insert(t, n) {
6194
- this.doc !== null ? M(this.doc, (i) => {
6190
+ this.doc !== null ? O(this.doc, (i) => {
6195
6191
  Er(i, this, t, n);
6196
6192
  }) : this._prelimContent.splice(t, 0, ...n);
6197
6193
  }
@@ -6207,7 +6203,7 @@ class Ht extends z {
6207
6203
  */
6208
6204
  insertAfter(t, n) {
6209
6205
  if (this.doc !== null)
6210
- M(this.doc, (i) => {
6206
+ O(this.doc, (i) => {
6211
6207
  const s = t && t instanceof z ? t._item : t;
6212
6208
  Xe(i, this, s, n);
6213
6209
  });
@@ -6228,7 +6224,7 @@ class Ht extends z {
6228
6224
  * @param {number} [length=1] The number of elements to remove. Defaults to 1.
6229
6225
  */
6230
6226
  delete(t, n = 1) {
6231
- this.doc !== null ? M(this.doc, (i) => {
6227
+ this.doc !== null ? O(this.doc, (i) => {
6232
6228
  Tr(i, this, t, n);
6233
6229
  }) : this._prelimContent.splice(t, n);
6234
6230
  }
@@ -6394,7 +6390,7 @@ class W extends Ht {
6394
6390
  * @public
6395
6391
  */
6396
6392
  removeAttribute(t) {
6397
- this.doc !== null ? M(this.doc, (n) => {
6393
+ this.doc !== null ? O(this.doc, (n) => {
6398
6394
  Ze(n, this, t);
6399
6395
  }) : this._prelimAttrs.delete(t);
6400
6396
  }
@@ -6409,7 +6405,7 @@ class W extends Ht {
6409
6405
  * @public
6410
6406
  */
6411
6407
  setAttribute(t, n) {
6412
- this.doc !== null ? M(this.doc, (i) => {
6408
+ this.doc !== null ? O(this.doc, (i) => {
6413
6409
  bi(i, this, t, n);
6414
6410
  }) : this._prelimAttrs.set(t, n);
6415
6411
  }
@@ -7493,7 +7489,7 @@ const Qa = (e) => new ut(Ka[e.readTypeRef()](e)), Jn = (e, t) => {
7493
7489
  let n = t, i = 0, s;
7494
7490
  do
7495
7491
  i > 0 && (n = _(n.client, n.clock + i)), s = Yt(e, n), i = n.clock - s.id.clock, n = s.redone;
7496
- while (n !== null && s instanceof A);
7492
+ while (n !== null && s instanceof D);
7497
7493
  return {
7498
7494
  item: s,
7499
7495
  diff: i
@@ -7503,7 +7499,7 @@ const Qa = (e) => new ut(Ka[e.readTypeRef()](e)), Jn = (e, t) => {
7503
7499
  e.keep = t, e = /** @type {AbstractType<any>} */
7504
7500
  e.parent._item;
7505
7501
  }, en = (e, t, n) => {
7506
- const { client: i, clock: s } = t.id, r = new A(
7502
+ const { client: i, clock: s } = t.id, r = new D(
7507
7503
  _(i, s + n),
7508
7504
  t,
7509
7505
  _(i, s + n - 1),
@@ -7541,25 +7537,25 @@ const Qa = (e) => new ut(Ka[e.readTypeRef()](e)), Jn = (e, t) => {
7541
7537
  );
7542
7538
  if (t.parentSub === null) {
7543
7539
  for (d = t.left, u = t; d !== null; ) {
7544
- let w = d;
7545
- for (; w !== null && /** @type {AbstractType<any>} */
7546
- w.parent._item !== h; )
7547
- w = w.redone === null ? null : J(e, w.redone);
7548
- if (w !== null && /** @type {AbstractType<any>} */
7549
- w.parent._item === h) {
7550
- d = w;
7540
+ let b = d;
7541
+ for (; b !== null && /** @type {AbstractType<any>} */
7542
+ b.parent._item !== h; )
7543
+ b = b.redone === null ? null : J(e, b.redone);
7544
+ if (b !== null && /** @type {AbstractType<any>} */
7545
+ b.parent._item === h) {
7546
+ d = b;
7551
7547
  break;
7552
7548
  }
7553
7549
  d = d.left;
7554
7550
  }
7555
7551
  for (; u !== null; ) {
7556
- let w = u;
7557
- for (; w !== null && /** @type {AbstractType<any>} */
7558
- w.parent._item !== h; )
7559
- w = w.redone === null ? null : J(e, w.redone);
7560
- if (w !== null && /** @type {AbstractType<any>} */
7561
- w.parent._item === h) {
7562
- u = w;
7552
+ let b = u;
7553
+ for (; b !== null && /** @type {AbstractType<any>} */
7554
+ b.parent._item !== h; )
7555
+ b = b.redone === null ? null : J(e, b.redone);
7556
+ if (b !== null && /** @type {AbstractType<any>} */
7557
+ b.parent._item === h) {
7558
+ u = b;
7563
7559
  break;
7564
7560
  }
7565
7561
  u = u.right;
@@ -7571,7 +7567,7 @@ const Qa = (e) => new ut(Ka[e.readTypeRef()](e)), Jn = (e, t) => {
7571
7567
  return null;
7572
7568
  } else
7573
7569
  d = f._map.get(t.parentSub) || null;
7574
- const g = B(l, c), m = _(c, g), b = new A(
7570
+ const g = B(l, c), m = _(c, g), w = new D(
7575
7571
  m,
7576
7572
  d,
7577
7573
  d && d.lastId,
@@ -7581,9 +7577,9 @@ const Qa = (e) => new ut(Ka[e.readTypeRef()](e)), Jn = (e, t) => {
7581
7577
  t.parentSub,
7582
7578
  t.content.copy()
7583
7579
  );
7584
- return t.redone = m, Si(b, !0), b.integrate(e, 0), b;
7580
+ return t.redone = m, Si(w, !0), w.integrate(e, 0), w;
7585
7581
  };
7586
- class A extends yi {
7582
+ class D extends yi {
7587
7583
  /**
7588
7584
  * @param {ID} id
7589
7585
  * @param {Item | null} left
@@ -7650,7 +7646,7 @@ class A extends yi {
7650
7646
  if (this.origin && (this.left = es(t, n, this.origin), this.origin = this.left.lastId), this.rightOrigin && (this.right = J(t, this.rightOrigin), this.rightOrigin = this.right.id), this.left && this.left.constructor === st || this.right && this.right.constructor === st)
7651
7647
  this.parent = null;
7652
7648
  else if (!this.parent)
7653
- this.left && this.left.constructor === A ? (this.parent = this.left.parent, this.parentSub = this.left.parentSub) : this.right && this.right.constructor === A && (this.parent = this.right.parent, this.parentSub = this.right.parentSub);
7649
+ this.left && this.left.constructor === D ? (this.parent = this.left.parent, this.parentSub = this.left.parentSub) : this.right && this.right.constructor === D && (this.parent = this.right.parent, this.parentSub = this.right.parentSub);
7654
7650
  else if (this.parent.constructor === jt) {
7655
7651
  const i = Yt(n, this.parent);
7656
7652
  i.constructor === st ? this.parent = null : this.parent = /** @type {ContentType} */
@@ -8025,7 +8021,7 @@ class fh {
8025
8021
  return r;
8026
8022
  }
8027
8023
  }
8028
- const ph = (e) => new fh().digest(e), L = new ni("y-sync"), xt = new ni("y-undo");
8024
+ const ph = (e) => new fh().digest(e), U = new ni("y-sync"), xt = new ni("y-undo");
8029
8025
  new ni("yjs-cursor");
8030
8026
  const gh = (e) => {
8031
8027
  for (let n = 6; n < e.length; n++)
@@ -8056,11 +8052,11 @@ t.sv.get(e.id.client) > e.id.clock && !ie(t.ds, e.id), wh = [{ light: "#ecd44433
8056
8052
  const l = new kh(e, r), c = new Ss({
8057
8053
  props: {
8058
8054
  editable: (a) => {
8059
- const h = L.getState(a);
8055
+ const h = U.getState(a);
8060
8056
  return h.snapshot == null && h.prevSnapshot == null;
8061
8057
  }
8062
8058
  },
8063
- key: L,
8059
+ key: U,
8064
8060
  state: {
8065
8061
  /**
8066
8062
  * @returns {any}
@@ -8079,7 +8075,7 @@ t.sv.get(e.id.client) > e.id.clock && !ie(t.ds, e.id), wh = [{ light: "#ecd44433
8079
8075
  permanentUserData: i
8080
8076
  }),
8081
8077
  apply: (a, h) => {
8082
- const d = a.getMeta(L);
8078
+ const d = a.getMeta(U);
8083
8079
  if (d !== void 0) {
8084
8080
  h = Object.assign({}, h);
8085
8081
  for (const u in d)
@@ -8118,7 +8114,7 @@ t.sv.get(e.id.client) > e.id.clock && !ie(t.ds, e.id), wh = [{ light: "#ecd44433
8118
8114
  l.mux(() => {
8119
8115
  h.doc.transact((d) => {
8120
8116
  d.meta.set("addToHistory", h.addToHistory), l._prosemirrorChanged(a.state.doc);
8121
- }, L);
8117
+ }, U);
8122
8118
  });
8123
8119
  }
8124
8120
  },
@@ -8215,7 +8211,7 @@ class kh {
8215
8211
  */
8216
8212
  renderSnapshot(t, n) {
8217
8213
  n || (n = dr(lr(), /* @__PURE__ */ new Map())), this.prosemirrorView.dispatch(
8218
- this._tr.setMeta(L, { snapshot: t, prevSnapshot: n })
8214
+ this._tr.setMeta(U, { snapshot: t, prevSnapshot: n })
8219
8215
  );
8220
8216
  }
8221
8217
  unrenderSnapshot() {
@@ -8232,7 +8228,7 @@ class kh {
8232
8228
  this.prosemirrorView.state.doc.content.size,
8233
8229
  new Oe(Me.from(t), 0, 0)
8234
8230
  );
8235
- n.setMeta(L, { snapshot: null, prevSnapshot: null }), this.prosemirrorView.dispatch(n);
8231
+ n.setMeta(U, { snapshot: null, prevSnapshot: null }), this.prosemirrorView.dispatch(n);
8236
8232
  });
8237
8233
  }
8238
8234
  _forceRerender() {
@@ -8254,7 +8250,7 @@ class kh {
8254
8250
  i.setSelection(ii.create(i.doc, s, r));
8255
8251
  }
8256
8252
  this.prosemirrorView.dispatch(
8257
- i.setMeta(L, { isChangeOrigin: !0, binding: this })
8253
+ i.setMeta(U, { isChangeOrigin: !0, binding: this })
8258
8254
  );
8259
8255
  });
8260
8256
  }
@@ -8315,9 +8311,9 @@ class kh {
8315
8311
  new Oe(Me.from(a), 0, 0)
8316
8312
  );
8317
8313
  this.prosemirrorView.dispatch(
8318
- h.setMeta(L, { isChangeOrigin: !0 })
8314
+ h.setMeta(U, { isChangeOrigin: !0 })
8319
8315
  );
8320
- }, L);
8316
+ }, U);
8321
8317
  });
8322
8318
  }
8323
8319
  /**
@@ -8326,7 +8322,7 @@ class kh {
8326
8322
  */
8327
8323
  _typeChanged(t, n) {
8328
8324
  if (this.prosemirrorView == null) return;
8329
- const i = L.getState(this.prosemirrorView.state);
8325
+ const i = U.getState(this.prosemirrorView.state);
8330
8326
  if (t.length === 0 || i.snapshot != null || i.prevSnapshot != null) {
8331
8327
  this.renderSnapshot(i.snapshot, i.prevSnapshot);
8332
8328
  return;
@@ -8337,7 +8333,7 @@ class kh {
8337
8333
  n,
8338
8334
  n.deleteSet,
8339
8335
  (l) => {
8340
- if (l.constructor === A) {
8336
+ if (l.constructor === D) {
8341
8337
  const c = (
8342
8338
  /** @type {Y.ContentType} */
8343
8339
  /** @type {Y.Item} */
@@ -8360,7 +8356,7 @@ class kh {
8360
8356
  this.prosemirrorView.state.doc.content.size,
8361
8357
  new Oe(Me.from(r), 0, 0)
8362
8358
  );
8363
- yh(o, this.beforeTransactionSelection, this), o = o.setMeta(L, { isChangeOrigin: !0, isUndoRedoOperation: n.origin instanceof mr }), this.beforeTransactionSelection !== null && this._isLocalCursorInView() && o.scrollIntoView(), this.prosemirrorView.dispatch(o);
8359
+ yh(o, this.beforeTransactionSelection, this), o = o.setMeta(U, { isChangeOrigin: !0, isUndoRedoOperation: n.origin instanceof mr }), this.beforeTransactionSelection !== null && this._isLocalCursorInView() && o.scrollIntoView(), this.prosemirrorView.dispatch(o);
8364
8360
  });
8365
8361
  }
8366
8362
  /**
@@ -8372,7 +8368,7 @@ class kh {
8372
8368
  this,
8373
8369
  this.prosemirrorView.state
8374
8370
  );
8375
- }, L);
8371
+ }, U);
8376
8372
  }
8377
8373
  /**
8378
8374
  * View is ready to listen to changes. Register observers.
@@ -8465,7 +8461,7 @@ const Vr = (e, t, n, i, s, r) => {
8465
8461
  } catch {
8466
8462
  return e.doc.transact((a) => {
8467
8463
  e._item.delete(a);
8468
- }, L), n.mapping.delete(e), null;
8464
+ }, U), n.mapping.delete(e), null;
8469
8465
  }
8470
8466
  }, vh = (e, t, n, i, s, r) => {
8471
8467
  const o = [], l = e.toDelta(i, s, r);
@@ -8477,7 +8473,7 @@ const Vr = (e, t, n, i, s, r) => {
8477
8473
  } catch {
8478
8474
  return e.doc.transact((a) => {
8479
8475
  e._item.delete(a);
8480
- }, L), null;
8476
+ }, U), null;
8481
8477
  }
8482
8478
  return o;
8483
8479
  }, Ch = (e, t) => {
@@ -8642,31 +8638,31 @@ const Vr = (e, t, n, i, s, r) => {
8642
8638
  if (u instanceof q && f instanceof Array)
8643
8639
  Hr(u, f) || Th(u, f, i), a += 1;
8644
8640
  else {
8645
- let b = u instanceof W && Qn(u, f), w = g instanceof W && Qn(g, m);
8646
- if (b && w) {
8647
- const D = fs(
8641
+ let w = u instanceof W && Qn(u, f), b = g instanceof W && Qn(g, m);
8642
+ if (w && b) {
8643
+ const M = fs(
8648
8644
  /** @type {Y.XmlElement} */
8649
8645
  u,
8650
8646
  /** @type {PModel.Node} */
8651
8647
  f,
8652
8648
  i
8653
- ), I = fs(
8649
+ ), A = fs(
8654
8650
  /** @type {Y.XmlElement} */
8655
8651
  g,
8656
8652
  /** @type {PModel.Node} */
8657
8653
  m,
8658
8654
  i
8659
8655
  );
8660
- D.foundMappedChild && !I.foundMappedChild ? w = !1 : !D.foundMappedChild && I.foundMappedChild || D.equalityFactor < I.equalityFactor ? b = !1 : w = !1;
8656
+ M.foundMappedChild && !A.foundMappedChild ? b = !1 : !M.foundMappedChild && A.foundMappedChild || M.equalityFactor < A.equalityFactor ? w = !1 : b = !1;
8661
8657
  }
8662
- b ? (Zn(
8658
+ w ? (Zn(
8663
8659
  e,
8664
8660
  /** @type {Y.XmlFragment} */
8665
8661
  u,
8666
8662
  /** @type {PModel.Node} */
8667
8663
  f,
8668
8664
  i
8669
- ), a += 1) : w ? (Zn(
8665
+ ), a += 1) : b ? (Zn(
8670
8666
  e,
8671
8667
  /** @type {Y.XmlFragment} */
8672
8668
  g,
@@ -8685,7 +8681,7 @@ const Vr = (e, t, n, i, s, r) => {
8685
8681
  u.push(Xn(s[f], i));
8686
8682
  t.insert(a, u);
8687
8683
  }
8688
- }, L);
8684
+ }, U);
8689
8685
  }, Qn = (e, t) => !(t instanceof Array) && e.nodeName === t.type.name, rn = (e, t, n) => {
8690
8686
  if (e === 0)
8691
8687
  return In(t, 0, -1);
@@ -8839,12 +8835,12 @@ const Mh = (e) => {
8839
8835
  const t = xt.getState(e).undoManager;
8840
8836
  if (t != null)
8841
8837
  return t.redo(), !0;
8842
- }, Nh = /* @__PURE__ */ new Set(["paragraph"]), Uh = (e, t) => !(e instanceof A) || !(e.content instanceof ut) || !(e.content.type instanceof Ot || e.content.type instanceof W && t.has(e.content.type.nodeName)) || e.content.type._length === 0, Lh = ({ protectedNodes: e = Nh, trackedOrigins: t = [], undoManager: n = null } = {}) => new Ss({
8838
+ }, Nh = /* @__PURE__ */ new Set(["paragraph"]), Uh = (e, t) => !(e instanceof D) || !(e.content instanceof ut) || !(e.content.type instanceof Ot || e.content.type instanceof W && t.has(e.content.type.nodeName)) || e.content.type._length === 0, Lh = ({ protectedNodes: e = Nh, trackedOrigins: t = [], undoManager: n = null } = {}) => new Ss({
8843
8839
  key: xt,
8844
8840
  state: {
8845
8841
  init: (i, s) => {
8846
- const r = L.getState(s), o = n || new mr(r.type, {
8847
- trackedOrigins: new Set([L].concat(t)),
8842
+ const r = U.getState(s), o = n || new mr(r.type, {
8843
+ trackedOrigins: new Set([U].concat(t)),
8848
8844
  deleteFilter: (l) => Uh(l, e),
8849
8845
  captureTransaction: (l) => l.meta.get("addToHistory") !== !1
8850
8846
  });
@@ -8859,7 +8855,7 @@ const Mh = (e) => {
8859
8855
  * @returns {any}
8860
8856
  */
8861
8857
  apply: (i, s, r, o) => {
8862
- const l = L.getState(o).binding, c = s.undoManager, a = c.undoStack.length > 0, h = c.redoStack.length > 0;
8858
+ const l = U.getState(o).binding, c = s.undoManager, a = c.undoStack.length > 0, h = c.redoStack.length > 0;
8863
8859
  return l ? {
8864
8860
  undoManager: c,
8865
8861
  prevSel: qn(l, r),
@@ -8872,7 +8868,7 @@ const Mh = (e) => {
8872
8868
  }
8873
8869
  },
8874
8870
  view: (i) => {
8875
- const s = L.getState(i.state), r = xt.getState(i.state).undoManager;
8871
+ const s = U.getState(i.state), r = xt.getState(i.state).undoManager;
8876
8872
  return r.on("stack-item-added", ({ stackItem: o }) => {
8877
8873
  const l = s.binding;
8878
8874
  l && o.meta.set(l, xt.getState(i.state).prevSel);
@@ -8887,14 +8883,14 @@ const Mh = (e) => {
8887
8883
  }
8888
8884
  });
8889
8885
  function Fr(e) {
8890
- return !!e.getMeta(L);
8886
+ return !!e.getMeta(U);
8891
8887
  }
8892
8888
  function Ph(e, t) {
8893
- const n = L.getState(e);
8889
+ const n = U.getState(e);
8894
8890
  return de(n.doc, n.type, t, n.binding.mapping) || 0;
8895
8891
  }
8896
8892
  function zr(e, t) {
8897
- const n = L.getState(e);
8893
+ const n = U.getState(e);
8898
8894
  return rn(t, n.type, n.binding.mapping);
8899
8895
  }
8900
8896
  var Ke = class Wr extends so {
@@ -9182,11 +9178,11 @@ ke.create({
9182
9178
  "mouseup",
9183
9179
  () => {
9184
9180
  t = !1;
9185
- const { state: d } = n, { doc: u, selection: f, tr: g } = d, { $anchor: m, $head: b } = f;
9186
- if (m.sameParent(b))
9181
+ const { state: d } = n, { doc: u, selection: f, tr: g } = d, { $anchor: m, $head: w } = f;
9182
+ if (m.sameParent(w))
9187
9183
  return;
9188
- const w = Et.create(u, m.pos, b.pos, this.options.depth);
9189
- g.setSelection(w), n.dispatch(g);
9184
+ const b = Et.create(u, m.pos, w.pos, this.options.depth);
9185
+ g.setSelection(b), n.dispatch(g);
9190
9186
  },
9191
9187
  { once: !0 }
9192
9188
  ), !1;
@@ -9305,13 +9301,13 @@ function Gh(e, t) {
9305
9301
  const { view: n } = t;
9306
9302
  if (!e.dataTransfer)
9307
9303
  return;
9308
- const { empty: i, $from: s, $to: r } = n.state.selection, o = Yh(e, t), l = yn(s, r, 0), c = l.some((b) => o.find((w) => w.$from === b.$from && w.$to === b.$to)), a = i || !c ? o : l;
9304
+ const { empty: i, $from: s, $to: r } = n.state.selection, o = Yh(e, t), l = yn(s, r, 0), c = l.some((w) => o.find((b) => b.$from === w.$from && b.$to === w.$to)), a = i || !c ? o : l;
9309
9305
  if (!a.length)
9310
9306
  return;
9311
9307
  const { tr: h } = n.state, d = document.createElement("div"), u = a[0].$from.pos, f = a[a.length - 1].$to.pos, g = Et.create(n.state.doc, u, f), m = g.content();
9312
- a.forEach((b) => {
9313
- const w = n.nodeDOM(b.$from.pos), D = Fh(w);
9314
- d.append(D);
9308
+ a.forEach((w) => {
9309
+ const b = n.nodeDOM(w.$from.pos), M = Fh(b);
9310
+ d.append(M);
9315
9311
  }), d.style.position = "absolute", d.style.top = "-10000px", document.body.append(d), e.dataTransfer.clearData(), e.dataTransfer.setDragImage(d, 0, 0), n.dragging = { slice: m, move: !0 }, h.setSelection(g), n.dispatch(h), document.addEventListener("drop", () => Yr(d), { once: !0 });
9316
9312
  }
9317
9313
  var gs = (e, t) => {
@@ -9326,10 +9322,10 @@ var gs = (e, t) => {
9326
9322
  }
9327
9323
  return r;
9328
9324
  }, Rn = (e, t) => {
9329
- const n = L.getState(e);
9325
+ const n = U.getState(e);
9330
9326
  return n ? rn(t, n.type, n.binding.mapping) : null;
9331
9327
  }, Jh = (e, t) => {
9332
- const n = L.getState(e);
9328
+ const n = U.getState(e);
9333
9329
  return n ? de(n.doc, n.type, t, n.binding.mapping) || 0 : -1;
9334
9330
  }, ws = (e, t) => {
9335
9331
  let n = t;
@@ -9351,7 +9347,7 @@ var gs = (e, t) => {
9351
9347
  function m() {
9352
9348
  t && (t.style.visibility = "hidden", t.style.pointerEvents = "none");
9353
9349
  }
9354
- function b() {
9350
+ function w() {
9355
9351
  if (t) {
9356
9352
  if (!n.isEditable) {
9357
9353
  m();
@@ -9360,7 +9356,7 @@ var gs = (e, t) => {
9360
9356
  t.style.visibility = "", t.style.pointerEvents = "auto";
9361
9357
  }
9362
9358
  }
9363
- function w(v) {
9359
+ function b(v) {
9364
9360
  const P = (s == null ? void 0 : s()) || {
9365
9361
  getBoundingClientRect: () => v.getBoundingClientRect()
9366
9362
  };
@@ -9372,17 +9368,17 @@ var gs = (e, t) => {
9372
9368
  });
9373
9369
  });
9374
9370
  }
9375
- function D(v) {
9371
+ function M(v) {
9376
9372
  o == null || o(v), Gh(v, n), t && (t.dataset.dragging = "true"), setTimeout(() => {
9377
9373
  t && (t.style.pointerEvents = "none");
9378
9374
  }, 0);
9379
9375
  }
9380
- function I(v) {
9376
+ function A(v) {
9381
9377
  l == null || l(v), m(), t && (t.style.pointerEvents = "auto", t.dataset.dragging = "false");
9382
9378
  }
9383
- return t.addEventListener("dragstart", D), t.addEventListener("dragend", I), c.appendChild(t), {
9379
+ return t.addEventListener("dragstart", M), t.addEventListener("dragend", A), c.appendChild(t), {
9384
9380
  unbind() {
9385
- t.removeEventListener("dragstart", D), t.removeEventListener("dragend", I), f && (cancelAnimationFrame(f), f = null, g = null);
9381
+ t.removeEventListener("dragstart", M), t.removeEventListener("dragend", A), f && (cancelAnimationFrame(f), f = null, g = null);
9386
9382
  },
9387
9383
  plugin: new Ce({
9388
9384
  key: typeof e == "string" ? new te(e) : e,
@@ -9391,8 +9387,8 @@ var gs = (e, t) => {
9391
9387
  return { locked: !1 };
9392
9388
  },
9393
9389
  apply(v, P, E, S) {
9394
- const k = v.getMeta("lockDragHandle"), U = v.getMeta("hideDragHandle");
9395
- if (k !== void 0 && (a = k), U)
9390
+ const k = v.getMeta("lockDragHandle"), N = v.getMeta("hideDragHandle");
9391
+ if (k !== void 0 && (a = k), N)
9396
9392
  return m(), a = !1, h = null, d = -1, r == null || r({ editor: n, node: null, pos: -1 }), P;
9397
9393
  if (v.docChanged && d !== -1 && t)
9398
9394
  if (Fr(v)) {
@@ -9420,8 +9416,8 @@ var gs = (e, t) => {
9420
9416
  let k = v.nodeDOM(d);
9421
9417
  if (k = ws(v, k), k === v.dom || (k == null ? void 0 : k.nodeType) !== 1)
9422
9418
  return;
9423
- const U = v.posAtDOM(k, 0), H = ms(n.state.doc, U), nt = gs(n.state.doc, U);
9424
- h = H, d = nt, u = Rn(v.state, d), r == null || r({ editor: n, node: h, pos: d }), w(k);
9419
+ const N = v.posAtDOM(k, 0), H = ms(n.state.doc, N), nt = gs(n.state.doc, N);
9420
+ h = H, d = nt, u = Rn(v.state, d), r == null || r({ editor: n, node: h, pos: d }), b(k);
9425
9421
  },
9426
9422
  // TODO: Kills even on hot reload
9427
9423
  destroy() {
@@ -9450,13 +9446,13 @@ var gs = (e, t) => {
9450
9446
  });
9451
9447
  if (!k.resultElement)
9452
9448
  return;
9453
- let U = k.resultElement;
9454
- if (U = ws(v, U), U === v.dom || (U == null ? void 0 : U.nodeType) !== 1)
9449
+ let N = k.resultElement;
9450
+ if (N = ws(v, N), N === v.dom || (N == null ? void 0 : N.nodeType) !== 1)
9455
9451
  return;
9456
- const H = v.posAtDOM(U, 0), nt = ms(n.state.doc, H);
9452
+ const H = v.posAtDOM(N, 0), nt = ms(n.state.doc, H);
9457
9453
  if (nt !== h) {
9458
9454
  const Mt = gs(n.state.doc, H);
9459
- h = nt, d = Mt, u = Rn(v.state, d), r == null || r({ editor: n, node: h, pos: d }), w(U), b();
9455
+ h = nt, d = Mt, u = Rn(v.state, d), r == null || r({ editor: n, node: h, pos: d }), b(N), w();
9460
9456
  }
9461
9457
  })), !1;
9462
9458
  }
@@ -9547,9 +9543,9 @@ var qh = (e) => {
9547
9543
  }
9548
9544
  );
9549
9545
  }, Xh = qh;
9550
- function cu() {
9551
- var E, S, k, U, H, nt, Mt, Rt;
9552
- const e = j(), t = Z(), { t: n } = G(), [i, s] = F(null), [r, o] = F(-1), [l, c] = F(!1), a = (S = (E = e == null ? void 0 : e.extensionManager) == null ? void 0 : E.extensions) == null ? void 0 : S.some((C) => (C == null ? void 0 : C.name) === Uo.name), h = (U = (k = e == null ? void 0 : e.extensionManager) == null ? void 0 : k.extensions) == null ? void 0 : U.some((C) => (C == null ? void 0 : C.name) === Ko.name), d = (nt = (H = e == null ? void 0 : e.extensionManager) == null ? void 0 : H.extensions) == null ? void 0 : nt.some((C) => (C == null ? void 0 : C.name) === Wo.name);
9546
+ function hu() {
9547
+ var E, S, k, N, H, nt, Mt, Rt;
9548
+ const e = j(), t = Z(), { t: n } = G(), [i, s] = F(null), [r, o] = F(-1), [l, c] = F(!1), a = (S = (E = e == null ? void 0 : e.extensionManager) == null ? void 0 : E.extensions) == null ? void 0 : S.some((C) => (C == null ? void 0 : C.name) === Uo.name), h = (N = (k = e == null ? void 0 : e.extensionManager) == null ? void 0 : k.extensions) == null ? void 0 : N.some((C) => (C == null ? void 0 : C.name) === Ko.name), d = (nt = (H = e == null ? void 0 : e.extensionManager) == null ? void 0 : H.extensions) == null ? void 0 : nt.some((C) => (C == null ? void 0 : C.name) === Wo.name);
9553
9549
  function u() {
9554
9550
  const C = e.chain();
9555
9551
  C.setNodeSelection(r).unsetAllMarks(), (i == null ? void 0 : i.type.name) !== "paragraph" && C.setParagraph(), C.run();
@@ -9565,18 +9561,18 @@ function cu() {
9565
9561
  function m(C) {
9566
9562
  e.commands.setTextAlign(C);
9567
9563
  }
9568
- function b() {
9564
+ function w() {
9569
9565
  const C = Bi(e.state.tr, r, 1);
9570
9566
  C.setMeta("hideDragHandle", !0), e.view.dispatch && e.view.dispatch(C);
9571
9567
  }
9572
- function w() {
9568
+ function b() {
9573
9569
  const C = Bi(e.state.tr, r, -1);
9574
9570
  e.view.dispatch && e.view.dispatch(C);
9575
9571
  }
9576
- function D() {
9572
+ function M() {
9577
9573
  e.chain().setMeta("hideDragHandle", !0).setNodeSelection(r).deleteSelection().run();
9578
9574
  }
9579
- const I = R((C) => {
9575
+ const A = L((C) => {
9580
9576
  C.node && s(C.node), o(C.pos), requestAnimationFrame(() => {
9581
9577
  C.editor.commands.focus();
9582
9578
  });
@@ -9601,7 +9597,7 @@ function cu() {
9601
9597
  {
9602
9598
  className: "richtext-transition-all richtext-duration-200 richtext-ease-out",
9603
9599
  editor: e,
9604
- onNodeChange: I,
9600
+ onNodeChange: A,
9605
9601
  pluginKey: "RichTextBubbleMenuDragHandle",
9606
9602
  children: /* @__PURE__ */ y("div", { className: "richtext-flex richtext-items-center richtext-gap-0.5", children: [
9607
9603
  /* @__PURE__ */ p(
@@ -9630,7 +9626,7 @@ function cu() {
9630
9626
  onOpenChange: P,
9631
9627
  open: l,
9632
9628
  children: [
9633
- /* @__PURE__ */ p("div", { className: "richtext-relative richtext-flex richtext-flex-col", children: /* @__PURE__ */ p($o, { className: "richtext-absolute richtext-left-0 richtext-top-0 richtext-z-0 richtext-size-[28px]" }) }),
9629
+ /* @__PURE__ */ p($o, { className: "richtext-pointer-events-none" }),
9634
9630
  /* @__PURE__ */ y(
9635
9631
  Fo,
9636
9632
  {
@@ -9644,7 +9640,7 @@ function cu() {
9644
9640
  mt,
9645
9641
  {
9646
9642
  className: "richtext-flex richtext-gap-3 richtext-bg-opacity-10 hover:richtext-bg-red-400 hover:richtext-bg-opacity-20 focus:richtext-bg-red-400 focus:richtext-bg-opacity-30 focus:richtext-text-red-500 dark:hover:richtext-bg-opacity-20 dark:hover:richtext-text-red-500",
9647
- onClick: D,
9643
+ onClick: M,
9648
9644
  children: [
9649
9645
  /* @__PURE__ */ p(Q, { name: "Trash2" }),
9650
9646
  /* @__PURE__ */ p("span", { children: n("editor.remove") })
@@ -9737,7 +9733,7 @@ function cu() {
9737
9733
  {
9738
9734
  className: "richtext-flex richtext-gap-3",
9739
9735
  disabled: ((Mt = i == null ? void 0 : i.attrs) == null ? void 0 : Mt.indent) >= Pi.max,
9740
- onClick: b,
9736
+ onClick: w,
9741
9737
  children: [
9742
9738
  /* @__PURE__ */ p(Q, { name: "IndentIncrease" }),
9743
9739
  /* @__PURE__ */ p("span", { children: n("editor.indent.tooltip") })
@@ -9749,7 +9745,7 @@ function cu() {
9749
9745
  {
9750
9746
  className: "richtext-flex richtext-gap-3",
9751
9747
  disabled: ((Rt = i == null ? void 0 : i.attrs) == null ? void 0 : Rt.indent) <= Pi.min,
9752
- onClick: w,
9748
+ onClick: b,
9753
9749
  children: [
9754
9750
  /* @__PURE__ */ p(Q, { name: "IndentDecrease" }),
9755
9751
  /* @__PURE__ */ p("span", { children: n("editor.outdent.tooltip") })
@@ -9769,18 +9765,18 @@ function cu() {
9769
9765
  );
9770
9766
  }
9771
9767
  export {
9772
- Gd as RichTextBubbleColumns,
9773
- Jd as RichTextBubbleDrawer,
9774
- qd as RichTextBubbleExcalidraw,
9775
- Xd as RichTextBubbleIframe,
9776
- tu as RichTextBubbleImage,
9777
- eu as RichTextBubbleImageGif,
9778
- Zd as RichTextBubbleKatex,
9779
- Qd as RichTextBubbleLink,
9780
- cu as RichTextBubbleMenuDragHandle,
9781
- iu as RichTextBubbleMermaid,
9782
- su as RichTextBubbleTable,
9783
- ru as RichTextBubbleText,
9784
- ou as RichTextBubbleTwitter,
9785
- nu as RichTextBubbleVideo
9768
+ qd as RichTextBubbleColumns,
9769
+ Xd as RichTextBubbleDrawer,
9770
+ Zd as RichTextBubbleExcalidraw,
9771
+ Qd as RichTextBubbleIframe,
9772
+ nu as RichTextBubbleImage,
9773
+ iu as RichTextBubbleImageGif,
9774
+ tu as RichTextBubbleKatex,
9775
+ eu as RichTextBubbleLink,
9776
+ hu as RichTextBubbleMenuDragHandle,
9777
+ ru as RichTextBubbleMermaid,
9778
+ ou as RichTextBubbleTable,
9779
+ lu as RichTextBubbleText,
9780
+ cu as RichTextBubbleTwitter,
9781
+ su as RichTextBubbleVideo
9786
9782
  };