reactjs-tiptap-editor 1.0.20 → 1.0.21

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 (126) hide show
  1. package/lib/{ActionMenuButton-BPgqKDXT.cjs → ActionMenuButton-BVaZBdL3.cjs} +1 -1
  2. package/lib/{ActionMenuButton-CMXWxvWu.js → ActionMenuButton-Cpla3oSm.js} +1 -1
  3. package/lib/Attachment.cjs +1 -1
  4. package/lib/Attachment.js +23 -23
  5. package/lib/Blockquote.cjs +1 -1
  6. package/lib/Blockquote.js +1 -1
  7. package/lib/Bold.cjs +1 -1
  8. package/lib/Bold.js +1 -1
  9. package/lib/BulletList.cjs +1 -1
  10. package/lib/BulletList.js +1 -1
  11. package/lib/Callout-JL3mm4GU.cjs +1 -0
  12. package/lib/Callout-mb31jDcR.js +340 -0
  13. package/lib/Callout.cjs +1 -1
  14. package/lib/Callout.js +8 -222
  15. package/lib/Clear.cjs +1 -1
  16. package/lib/Clear.js +1 -1
  17. package/lib/Code.cjs +1 -1
  18. package/lib/Code.js +1 -1
  19. package/lib/CodeBlock.cjs +1 -1
  20. package/lib/CodeBlock.js +1 -1
  21. package/lib/CodeView.cjs +1 -1
  22. package/lib/CodeView.js +1 -1
  23. package/lib/Color.cjs +1 -1
  24. package/lib/Color.js +2 -2
  25. package/lib/Column.cjs +1 -1
  26. package/lib/Column.js +1 -1
  27. package/lib/{Drawer-BivLAzMN.cjs → Drawer-94nAoli4.cjs} +1 -1
  28. package/lib/{Drawer-BmVmgJsc.js → Drawer-d9e69c7G.js} +18 -18
  29. package/lib/Drawer.cjs +1 -1
  30. package/lib/Drawer.js +2 -2
  31. package/lib/Emoji.cjs +1 -1
  32. package/lib/Emoji.js +8 -8
  33. package/lib/Excalidraw.cjs +1 -1
  34. package/lib/Excalidraw.js +5 -5
  35. package/lib/ExportPdf.cjs +1 -1
  36. package/lib/ExportPdf.js +1 -1
  37. package/lib/ExportWord.cjs +1 -1
  38. package/lib/ExportWord.js +1 -1
  39. package/lib/FontFamily.cjs +1 -1
  40. package/lib/FontFamily.js +3 -3
  41. package/lib/FontSize.cjs +1 -1
  42. package/lib/FontSize.js +3 -3
  43. package/lib/Heading.cjs +1 -1
  44. package/lib/Heading.js +8 -8
  45. package/lib/Highlight.cjs +1 -1
  46. package/lib/Highlight.js +2 -2
  47. package/lib/History.cjs +1 -1
  48. package/lib/History.js +1 -1
  49. package/lib/HorizontalRule.cjs +1 -1
  50. package/lib/HorizontalRule.js +1 -1
  51. package/lib/{Iframe-CAUrccA0.js → Iframe-CkUClxtI.js} +5 -5
  52. package/lib/{Iframe-hwg9FxhU.cjs → Iframe-qCivhCR5.cjs} +1 -1
  53. package/lib/Iframe.cjs +1 -1
  54. package/lib/Iframe.js +1 -1
  55. package/lib/Image.cjs +1 -1
  56. package/lib/Image.js +4 -4
  57. package/lib/ImageGif.cjs +1 -1
  58. package/lib/ImageGif.js +35 -35
  59. package/lib/ImportWord.cjs +1 -1
  60. package/lib/ImportWord.js +12 -12
  61. package/lib/{Indent-3MoIatX1.js → Indent-BTzj50Sf.js} +1 -1
  62. package/lib/{Indent-MuSU0kXz.cjs → Indent-DtgugDpq.cjs} +1 -1
  63. package/lib/Indent.cjs +1 -1
  64. package/lib/Indent.js +1 -1
  65. package/lib/Italic.cjs +1 -1
  66. package/lib/Italic.js +1 -1
  67. package/lib/{Katex-xS-XZKQc.js → Katex-BuFwL_MA.js} +4 -3
  68. package/lib/Katex-RcbH2O5p.cjs +4 -0
  69. package/lib/Katex.cjs +1 -1
  70. package/lib/Katex.js +1 -1
  71. package/lib/LineHeight.cjs +1 -1
  72. package/lib/LineHeight.js +2 -2
  73. package/lib/Link.cjs +1 -1
  74. package/lib/Link.js +1 -1
  75. package/lib/{LinkEditBlock-DLDY-8Ax.cjs → LinkEditBlock-CSKh_5n7.cjs} +1 -1
  76. package/lib/{LinkEditBlock-Dhvz7DCA.js → LinkEditBlock-DYOmu7jQ.js} +25 -25
  77. package/lib/Mermaid.cjs +2 -2
  78. package/lib/Mermaid.js +44 -43
  79. package/lib/MoreMark.cjs +1 -1
  80. package/lib/MoreMark.js +4 -4
  81. package/lib/OrderedList.cjs +1 -1
  82. package/lib/OrderedList.js +1 -1
  83. package/lib/SearchAndReplace.cjs +1 -1
  84. package/lib/SearchAndReplace.js +7 -7
  85. package/lib/SlashCommand.cjs +1 -1
  86. package/lib/SlashCommand.js +2 -2
  87. package/lib/{SlashCommandNodeView-RnDRm4Z1.js → SlashCommandNodeView-CT_-28t6.js} +6 -6
  88. package/lib/{SlashCommandNodeView-CavaOSwo.cjs → SlashCommandNodeView-CYdYVjeb.cjs} +1 -1
  89. package/lib/Strike.cjs +1 -1
  90. package/lib/Strike.js +1 -1
  91. package/lib/{Table-DN4TuDz1.js → Table-CEHV8gmO.js} +2 -2
  92. package/lib/{Table-m32ZhtxF.cjs → Table-DOl6C6To.cjs} +1 -1
  93. package/lib/Table.cjs +1 -1
  94. package/lib/Table.js +1 -1
  95. package/lib/TaskList.cjs +1 -1
  96. package/lib/TaskList.js +1 -1
  97. package/lib/TextAlign.cjs +1 -1
  98. package/lib/TextAlign.js +2 -2
  99. package/lib/TextDirection.cjs +1 -1
  100. package/lib/TextDirection.js +2 -2
  101. package/lib/TextUnderline.cjs +1 -1
  102. package/lib/TextUnderline.js +1 -1
  103. package/lib/{Twitter-CJhQLKYS.cjs → Twitter-DDuJwWdF.cjs} +1 -1
  104. package/lib/{Twitter-B2FDarxE.js → Twitter-DxqKzo3U.js} +7 -7
  105. package/lib/Twitter.cjs +1 -1
  106. package/lib/Twitter.js +1 -1
  107. package/lib/Video.cjs +1 -1
  108. package/lib/Video.js +3 -3
  109. package/lib/bubble.cjs +6 -6
  110. package/lib/bubble.js +667 -640
  111. package/lib/{dropdown-menu-CWd8VVRO.js → dropdown-menu-BYbds8yQ.js} +1 -1
  112. package/lib/{dropdown-menu-C0VlKIZC.cjs → dropdown-menu-CoZZaqv5.cjs} +1 -1
  113. package/lib/{index-B2a7NqnN.js → index-B1SzsIsE.js} +1020 -1149
  114. package/lib/index-DirFiHQ6.cjs +1 -0
  115. package/lib/index.cjs +1 -1
  116. package/lib/index.js +12 -12
  117. package/lib/{popover-UUKfPWue.cjs → popover-BaAurWOZ.cjs} +1 -1
  118. package/lib/{popover-BrSDMb_n.js → popover-CK54Ip2N.js} +1 -1
  119. package/lib/{separator-LH5EzF0T.cjs → separator-ByK1SKWn.cjs} +1 -1
  120. package/lib/{separator-fpWkZkoh.js → separator-XZA3-egy.js} +14 -14
  121. package/lib/style.css +1 -1
  122. package/lib/textarea--IMIy9VF.js +20 -0
  123. package/lib/textarea-mwHtiXJV.cjs +1 -0
  124. package/package.json +1 -1
  125. package/lib/Katex-BPQ7_A3w.cjs +0 -4
  126. package/lib/index-czmcFIW7.cjs +0 -1
package/lib/bubble.js CHANGED
@@ -4,51 +4,52 @@ var qe = (e, t, n) => pl(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { jsx as p, Fragment as A, jsxs as x } from "react/jsx-runtime";
5
5
  import { $ as gl, e as gr, E as Ue, a0 as ml, a1 as wl, a2 as Le, a3 as bl, O as Ui, L as mr, u as Je, F as Xe, T as Li, A as yl, s as xl, a4 as vl, a5 as Sl, a6 as kl } from "./index-D0EmqTpe.js";
6
6
  import { f as wr, s as br, o as yr, a as xr, b as vr, d as Sr, h as kr, e as Cr, c as Pi } from "./index-P5_MyY0i.js";
7
- import { Plugin as Pe, PluginKey as Gt, NodeSelection as di, TextSelection as Cl, SelectionRange as _l, Selection as El } from "@tiptap/pm/state";
8
- import { C as Tl, T as Dl } from "./Table-DN4TuDz1.js";
7
+ import { Plugin as Pe, PluginKey as Yt, NodeSelection as di, TextSelection as Cl, SelectionRange as _l, Selection as El } from "@tiptap/pm/state";
8
+ import { C as Tl, T as Dl } from "./Table-CEHV8gmO.js";
9
9
  import { u as _r } from "./clsx-Bg-2aTKh.js";
10
10
  import Er, { useRef as ot, useState as N, useEffect as nt, useLayoutEffect as Al, useCallback as O, useMemo as ht, Fragment as $i } from "react";
11
11
  import { createPortal as Tr } from "react-dom";
12
- import { M as Q, h as F, D as $e, m as Be, A as v, n as Ve, o as He, L as Ut, S as Il, p as Ol, q as Ml, r as Rl, s as Nl, j as te, t as ze, B as Lt, G as Dr, v as Bi, J as Ul, K as Ll, a2 as Pl, F as ui, y as $l, a3 as Bl, I as st } from "./index-B2a7NqnN.js";
13
- import { Callout as Ze } from "./Callout.js";
14
- import { u as Yt, K as fi, s as Vl } from "./Katex-xS-XZKQc.js";
12
+ import { F as Q, h as F, D as $e, r as Be, A as v, s as Ve, v as He, L as Ut, j as te, w as ze, B as Lt, x as Dr, m as Bi, E as Il, z as Ol, Y as Ml, p as Rl, Z as Nl, I as st } from "./index-B1SzsIsE.js";
13
+ import { C as Ze, S as Ul, a as Ll, b as Pl, c as $l, d as Bl } from "./Callout-mb31jDcR.js";
14
+ import { u as Gt, K as ui, s as Vl } from "./Katex-BuFwL_MA.js";
15
15
  import { u as q, n as un, V as ws } from "./index-BlXGgvT-.js";
16
- import { Pencil as Hl, Trash2 as Ar, Check as pi } from "lucide-react";
17
- import { P as Vi, a as Hi, b as zi } from "./popover-BrSDMb_n.js";
18
- import { S as Tt } from "./separator-fpWkZkoh.js";
19
- import { CodeBlock as Yn } from "./CodeBlock.js";
16
+ import { Pencil as Hl, Trash2 as Ar, Check as fi, Copy as zl } from "lucide-react";
17
+ import { CodeBlock as Gn } from "./CodeBlock.js";
18
+ import { S as St } from "./separator-XZA3-egy.js";
19
+ import { P as Vi, a as Hi, b as zi } from "./popover-CK54Ip2N.js";
20
20
  import { MultipleColumnNode as bs } from "./Column.js";
21
21
  import "./theme.js";
22
- import { C as zl, D as qn } from "./Drawer-BmVmgJsc.js";
23
- import { Editor as Fl, makeDropdownToolbar as jl } from "easydrawer";
22
+ import { C as Fl, D as qn } from "./Drawer-d9e69c7G.js";
23
+ import { Editor as jl, makeDropdownToolbar as Kl } from "easydrawer";
24
24
  import { s as Ir, i as Or } from "./shortId-WJVkrvml.js";
25
25
  import { Excalidraw as we } from "./Excalidraw.js";
26
- import { I as be, g as Kl } from "./Iframe-CAUrccA0.js";
27
- import { ImageGif as Wl } from "./ImageGif.js";
26
+ import { I as be, g as Wl } from "./Iframe-CkUClxtI.js";
27
+ import { ImageGif as Yl } from "./ImageGif.js";
28
28
  import Gl from "katex";
29
- import { L as ys, a as Yl, R as ql } from "./LinkEditBlock-Dhvz7DCA.js";
30
- import { DecorationSet as xs, Decoration as Jl } from "@tiptap/pm/view";
31
- import { NodeRange as Xl } from "@tiptap/pm/model";
32
- import { D as Zl, a as Ql, b as tc, f as _t, d as ec, g as vs, h as Ss, i as ks, j as Cs } from "./dropdown-menu-CWd8VVRO.js";
33
- import { Clear as nc } from "./Clear.js";
34
- import { I as ic, a as _s, s as Es } from "./Indent-3MoIatX1.js";
35
- import { RichTextAlign as sc, TextAlign as rc } from "./TextAlign.js";
29
+ import { T as pi } from "./textarea--IMIy9VF.js";
30
+ import { L as ys, a as ql, R as Jl } from "./LinkEditBlock-DYOmu7jQ.js";
31
+ import { DecorationSet as xs, Decoration as Xl } from "@tiptap/pm/view";
32
+ import { NodeRange as Zl } from "@tiptap/pm/model";
33
+ import { Clear as Ql } from "./Clear.js";
34
+ import { I as tc, a as vs, s as Ss } from "./Indent-BTzj50Sf.js";
35
+ import { RichTextAlign as ec, TextAlign as nc } from "./TextAlign.js";
36
+ import { D as ic, a as sc, b as rc, f as Et, d as oc, g as ks, h as Cs, i as _s, j as Es } from "./dropdown-menu-BYbds8yQ.js";
36
37
  import { Mermaid as gi } from "./Mermaid.js";
37
- import { RichTextBold as oc } from "./Bold.js";
38
- import { RichTextCode as lc } from "./Code.js";
38
+ import { RichTextBold as lc } from "./Bold.js";
39
+ import { RichTextCode as cc } from "./Code.js";
39
40
  import "./index-CbkpBnTX.js";
40
- import { RichTextColor as cc } from "./Color.js";
41
- import { RichTextHighlight as ac } from "./Highlight.js";
42
- import { RichTextItalic as hc } from "./Italic.js";
43
- import { r as dc } from "./SlashCommandNodeView-RnDRm4Z1.js";
44
- import { RichTextStrike as uc } from "./Strike.js";
45
- import { RichTextUnderline as fc } from "./TextUnderline.js";
46
- import { T as Ts, F as pc } from "./Twitter-B2FDarxE.js";
47
- function gc(e, t) {
41
+ import { RichTextColor as ac } from "./Color.js";
42
+ import { RichTextHighlight as hc } from "./Highlight.js";
43
+ import { RichTextItalic as dc } from "./Italic.js";
44
+ import { r as uc } from "./SlashCommandNodeView-CT_-28t6.js";
45
+ import { RichTextStrike as fc } from "./Strike.js";
46
+ import { RichTextUnderline as pc } from "./TextUnderline.js";
47
+ import { T as Ts, F as gc } from "./Twitter-DxqKzo3U.js";
48
+ function mc(e, t) {
48
49
  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;
49
50
  return new DOMRect(c, a, o, l);
50
51
  }
51
- var mc = class {
52
+ var wc = class {
52
53
  constructor({
53
54
  editor: e,
54
55
  element: t,
@@ -162,7 +163,7 @@ var mc = class {
162
163
  const { $anchorCell: l, $headCell: c } = i, a = l ? l.pos : c.pos, d = c ? c.pos : l.pos, h = this.view.nodeDOM(a), u = this.view.nodeDOM(d);
163
164
  if (!h || !u)
164
165
  return;
165
- const f = h === u ? h.getBoundingClientRect() : gc(
166
+ const f = h === u ? h.getBoundingClientRect() : mc(
166
167
  h.getBoundingClientRect(),
167
168
  u.getBoundingClientRect()
168
169
  );
@@ -235,8 +236,8 @@ var mc = class {
235
236
  this.hide(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.removeEventListener("dragstart", this.dragstartHandler), window.removeEventListener("resize", this.resizeHandler), this.scrollTarget.removeEventListener("scroll", this.resizeHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler), this.editor.off("transaction", this.transactionHandler), this.floatingUIOptions.onDestroy && this.floatingUIOptions.onDestroy();
236
237
  }
237
238
  }, Mr = (e) => new Pe({
238
- key: typeof e.pluginKey == "string" ? new Gt(e.pluginKey) : e.pluginKey,
239
- view: (t) => new mc({ view: t, ...e })
239
+ key: typeof e.pluginKey == "string" ? new Yt(e.pluginKey) : e.pluginKey,
240
+ view: (t) => new wc({ view: t, ...e })
240
241
  });
241
242
  Ue.create({
242
243
  name: "bubbleMenu",
@@ -264,7 +265,7 @@ Ue.create({
264
265
  ] : [];
265
266
  }
266
267
  });
267
- var wc = class {
268
+ var bc = class {
268
269
  constructor({
269
270
  editor: e,
270
271
  element: t,
@@ -400,8 +401,8 @@ var wc = class {
400
401
  this.hide(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), window.removeEventListener("resize", this.resizeHandler), this.scrollTarget.removeEventListener("scroll", this.resizeHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler), this.editor.off("transaction", this.transactionHandler), this.floatingUIOptions.onDestroy && this.floatingUIOptions.onDestroy();
401
402
  }
402
403
  }, Rr = (e) => new Pe({
403
- key: typeof e.pluginKey == "string" ? new Gt(e.pluginKey) : e.pluginKey,
404
- view: (t) => new wc({ view: t, ...e })
404
+ key: typeof e.pluginKey == "string" ? new Yt(e.pluginKey) : e.pluginKey,
405
+ view: (t) => new bc({ view: t, ...e })
405
406
  });
406
407
  Ue.create({
407
408
  name: "floatingMenu",
@@ -437,9 +438,9 @@ Ue.create({
437
438
  }
438
439
  });
439
440
  function Nr(e, t) {
440
- return e ?? new Gt(t);
441
+ return e ?? new Yt(t);
441
442
  }
442
- var bc = typeof window < "u" ? Al : nt, Ur = /* @__PURE__ */ new Set(["left", "opacity", "position", "top", "visibility", "width"]), yc = /* @__PURE__ */ new Set([
443
+ var yc = typeof window < "u" ? Al : nt, Ur = /* @__PURE__ */ new Set(["left", "opacity", "position", "top", "visibility", "width"]), xc = /* @__PURE__ */ new Set([
443
444
  "animationIterationCount",
444
445
  "aspectRatio",
445
446
  "borderImageOutset",
@@ -475,7 +476,7 @@ var bc = typeof window < "u" ? Al : nt, Ur = /* @__PURE__ */ new Set(["left", "o
475
476
  "widows",
476
477
  "zIndex",
477
478
  "zoom"
478
- ]), xc = /* @__PURE__ */ new Set(["children", "className", "style"]), vc = /* @__PURE__ */ new Set(["tabIndex"]), Sc = /* @__PURE__ */ new Set([
479
+ ]), vc = /* @__PURE__ */ new Set(["children", "className", "style"]), Sc = /* @__PURE__ */ new Set(["tabIndex"]), kc = /* @__PURE__ */ new Set([
479
480
  "accessKey",
480
481
  "autoCapitalize",
481
482
  "contentEditable",
@@ -493,7 +494,7 @@ var bc = typeof window < "u" ? Al : nt, Ur = /* @__PURE__ */ new Set(["left", "o
493
494
  "tabIndex",
494
495
  "title",
495
496
  "translate"
496
- ]), kc = {
497
+ ]), Cc = {
497
498
  Blur: "focusout",
498
499
  DoubleClick: "dblclick",
499
500
  Focus: "focusin",
@@ -503,24 +504,24 @@ var bc = typeof window < "u" ? Al : nt, Ur = /* @__PURE__ */ new Set(["left", "o
503
504
  function mi(e, t) {
504
505
  return /^on[A-Z]/.test(e) && typeof t == "function";
505
506
  }
506
- function Cc(e) {
507
+ function _c(e) {
507
508
  return e.startsWith("aria-") || e.startsWith("data-"), e;
508
509
  }
509
- function _c(e) {
510
- return e.startsWith("aria-") || e.startsWith("data-") || Sc.has(e);
510
+ function Ec(e) {
511
+ return e.startsWith("aria-") || e.startsWith("data-") || kc.has(e);
511
512
  }
512
513
  function Lr(e) {
513
514
  return e.startsWith("--") ? e : e.replace(/[A-Z]/g, (t) => `-${t.toLowerCase()}`);
514
515
  }
515
- function Ec(e) {
516
+ function Tc(e) {
516
517
  var t;
517
518
  const n = e.endsWith("Capture"), s = (n ? e.slice(0, -7) : e).slice(2);
518
519
  return {
519
- eventName: (t = kc[s]) != null ? t : s.toLowerCase(),
520
+ eventName: (t = Cc[s]) != null ? t : s.toLowerCase(),
520
521
  options: n ? { capture: !0 } : void 0
521
522
  };
522
523
  }
523
- function Tc(e, t) {
524
+ function Dc(e, t) {
524
525
  let n = t.defaultPrevented, i = !1;
525
526
  const s = Object.create(t);
526
527
  return Object.defineProperties(s, {
@@ -544,7 +545,7 @@ function Tc(e, t) {
544
545
  }), s;
545
546
  }
546
547
  function Jn(e) {
547
- return vc.has(e);
548
+ return Sc.has(e);
548
549
  }
549
550
  function Ds(e, t, n) {
550
551
  if (t === "tabIndex") {
@@ -553,7 +554,7 @@ function Ds(e, t, n) {
553
554
  }
554
555
  e[t] = n;
555
556
  }
556
- function Dc(e, t) {
557
+ function Ac(e, t) {
557
558
  if (t === "tabIndex") {
558
559
  e.removeAttribute("tabindex");
559
560
  return;
@@ -569,25 +570,25 @@ function Dc(e, t) {
569
570
  }
570
571
  e[t] = "";
571
572
  }
572
- function Ac(e, t) {
573
- return typeof t != "number" || t === 0 || e.startsWith("--") || yc.has(e) ? String(t) : `${t}px`;
574
- }
575
573
  function Ic(e, t) {
576
- Ur.has(t) || e.style.removeProperty(Lr(t));
574
+ return typeof t != "number" || t === 0 || e.startsWith("--") || xc.has(e) ? String(t) : `${t}px`;
577
575
  }
578
- function Oc(e, t, n) {
579
- Ur.has(t) || e.style.setProperty(Lr(t), Ac(t, n));
576
+ function Oc(e, t) {
577
+ Ur.has(t) || e.style.removeProperty(Lr(t));
580
578
  }
581
579
  function Mc(e, t, n) {
580
+ Ur.has(t) || e.style.setProperty(Lr(t), Ic(t, n));
581
+ }
582
+ function Rc(e, t, n) {
582
583
  (/* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(n)])).forEach((s) => {
583
- if (xc.has(s) || !_c(s) || mi(s, t[s]) || mi(s, n[s]))
584
+ if (vc.has(s) || !Ec(s) || mi(s, t[s]) || mi(s, n[s]))
584
585
  return;
585
586
  const r = t[s], o = n[s];
586
587
  if (r === o)
587
588
  return;
588
- const l = Cc(s);
589
+ const l = _c(s);
589
590
  if (o == null || o === !1) {
590
- Jn(s) && Dc(e, s), e.removeAttribute(l);
591
+ Jn(s) && Ac(e, s), e.removeAttribute(l);
591
592
  return;
592
593
  }
593
594
  if (o === !0) {
@@ -601,7 +602,7 @@ function Mc(e, t, n) {
601
602
  e.setAttribute(l, String(o));
602
603
  });
603
604
  }
604
- function Rc(e, t, n) {
605
+ function Nc(e, t, n) {
605
606
  if (t !== n) {
606
607
  if (n) {
607
608
  e.className = n;
@@ -610,20 +611,20 @@ function Rc(e, t, n) {
610
611
  e.removeAttribute("class");
611
612
  }
612
613
  }
613
- function Nc(e, t, n) {
614
+ function Uc(e, t, n) {
614
615
  const i = t ?? {}, s = n ?? {};
615
616
  (/* @__PURE__ */ new Set([...Object.keys(i), ...Object.keys(s)])).forEach((o) => {
616
617
  const l = i[o], c = s[o];
617
618
  if (l !== c) {
618
619
  if (c == null) {
619
- Ic(e, o);
620
+ Oc(e, o);
620
621
  return;
621
622
  }
622
- Oc(e, o, c);
623
+ Mc(e, o, c);
623
624
  }
624
625
  });
625
626
  }
626
- function Uc(e, t, n) {
627
+ function Lc(e, t, n) {
627
628
  t.forEach(({ eventName: s, listener: r, options: o }) => {
628
629
  e.removeEventListener(s, r, o);
629
630
  });
@@ -631,17 +632,17 @@ function Uc(e, t, n) {
631
632
  return Object.entries(n).forEach(([s, r]) => {
632
633
  if (!mi(s, r))
633
634
  return;
634
- const { eventName: o, options: l } = Ec(s), c = (a) => {
635
- r(Tc(e, a));
635
+ const { eventName: o, options: l } = Tc(s), c = (a) => {
636
+ r(Dc(e, a));
636
637
  };
637
638
  e.addEventListener(o, c, l), i.push({ eventName: o, listener: c, options: l });
638
639
  }), i;
639
640
  }
640
641
  function Pr(e, t) {
641
642
  const n = ot({}), i = ot([]);
642
- bc(() => {
643
+ yc(() => {
643
644
  const s = n.current;
644
- return Rc(e, s.className, t.className), Nc(e, s.style, t.style), Mc(e, s, t), i.current = Uc(e, i.current, t), n.current = t, () => {
645
+ return Nc(e, s.className, t.className), Uc(e, s.style, t.style), Rc(e, s, t), i.current = Lc(e, i.current, t), n.current = t, () => {
645
646
  i.current.forEach(({ eventName: r, listener: o, options: l }) => {
646
647
  e.removeEventListener(r, o, l);
647
648
  }), i.current = [];
@@ -795,15 +796,15 @@ function qt(e, t) {
795
796
  }
796
797
  return s;
797
798
  }
798
- const Lc = [
799
+ const Pc = [
799
800
  { value: "note", label: "Note", icon: "Info" },
800
801
  { value: "tip", label: "Tip", icon: "Lightbulb" },
801
802
  { value: "important", label: "Important", icon: "AlertCircle" },
802
803
  { value: "warning", label: "Warning", icon: "TriangleAlert" },
803
804
  { value: "caution", label: "Caution", icon: "OctagonAlert" }
804
805
  ];
805
- function bp() {
806
- const e = Q(), t = F(), { t: n } = q(), { type: i, title: s, body: r } = Yt(t, Ze.name, {
806
+ function xp() {
807
+ const e = Q(), t = F(), { t: n } = q(), { type: i, title: s, body: r } = Gt(t, Ze.name, {
807
808
  type: "note",
808
809
  title: "",
809
810
  body: ""
@@ -837,15 +838,15 @@ function bp() {
837
838
  /* @__PURE__ */ x("div", { className: "richtext-space-y-4 richtext-py-4", children: [
838
839
  /* @__PURE__ */ x("div", { className: "richtext-space-y-2", children: [
839
840
  /* @__PURE__ */ p(Ut, { children: n("editor.callout.dialog.type") }),
840
- /* @__PURE__ */ x(Il, { onValueChange: a, value: c, children: [
841
- /* @__PURE__ */ p(Ol, { children: /* @__PURE__ */ p(
842
- Ml,
841
+ /* @__PURE__ */ x(Ul, { onValueChange: a, value: c, children: [
842
+ /* @__PURE__ */ p(Ll, { children: /* @__PURE__ */ p(
843
+ Pl,
843
844
  {
844
845
  className: "richtext-text-accent",
845
846
  placeholder: n("editor.callout.dialog.type.placeholder")
846
847
  }
847
848
  ) }),
848
- /* @__PURE__ */ p(Rl, { children: Lc.map((k) => /* @__PURE__ */ p(Nl, { value: k.value, children: n(`editor.callout.type.${k.value}`) }, k.value)) })
849
+ /* @__PURE__ */ p($l, { children: Pc.map((k) => /* @__PURE__ */ p(Bl, { value: k.value, children: n(`editor.callout.type.${k.value}`) }, k.value)) })
849
850
  ] })
850
851
  ] }),
851
852
  /* @__PURE__ */ x("div", { className: "richtext-space-y-2", children: [
@@ -884,7 +885,7 @@ function bp() {
884
885
  }
885
886
  ) : /* @__PURE__ */ p(A, {});
886
887
  }
887
- function yp() {
888
+ function vp() {
888
889
  const e = Q(), t = F(), { t: n } = q(), i = O(() => t.isActive(bs.name), [t]), s = O(() => qt(bs.name, t), [t]), r = O(() => t.chain().focus().addColBefore().run(), [t]), o = O(() => t.chain().focus().addColAfter().run(), [t]), l = O(() => t.chain().focus().deleteCol().run(), [t]);
889
890
  return e ? /* @__PURE__ */ p(
890
891
  it,
@@ -930,7 +931,7 @@ function yp() {
930
931
  }
931
932
  ) : /* @__PURE__ */ p(A, {});
932
933
  }
933
- function Pc(e, t) {
934
+ function $c(e, t) {
934
935
  const n = ["size-small", "size-medium", "size-large"], i = [
935
936
  "SizeS",
936
937
  "SizeM",
@@ -947,7 +948,7 @@ function Pc(e, t) {
947
948
  }
948
949
  }));
949
950
  }
950
- function $c(e, t) {
951
+ function Bc(e, t) {
951
952
  const n = ["size-small", "size-medium", "size-large"], i = [
952
953
  "SizeS",
953
954
  "SizeM",
@@ -964,7 +965,7 @@ function $c(e, t) {
964
965
  }
965
966
  }));
966
967
  }
967
- function Bc(e, t) {
968
+ function Vc(e, t) {
968
969
  const n = ["left", "center", "right"], i = {
969
970
  left: "AlignLeft",
970
971
  center: "AlignCenter",
@@ -985,7 +986,7 @@ function Bc(e, t) {
985
986
  }
986
987
  }));
987
988
  }
988
- function Vc(e, t) {
989
+ function Hc(e, t) {
989
990
  const n = ["left", "center", "right"], i = {
990
991
  left: "AlignLeft",
991
992
  center: "AlignCenter",
@@ -1006,7 +1007,7 @@ function Vc(e, t) {
1006
1007
  }
1007
1008
  }));
1008
1009
  }
1009
- function Hc(e, t) {
1010
+ function zc(e, t) {
1010
1011
  const n = ["left", "center", "right"], i = {
1011
1012
  left: "AlignLeft",
1012
1013
  center: "AlignCenter",
@@ -1027,7 +1028,7 @@ function Hc(e, t) {
1027
1028
  }
1028
1029
  }));
1029
1030
  }
1030
- function zc(e, t) {
1031
+ function Fc(e, t) {
1031
1032
  const n = ["left", "center", "right"], i = {
1032
1033
  left: "AlignLeft",
1033
1034
  center: "AlignCenter",
@@ -1048,7 +1049,7 @@ function zc(e, t) {
1048
1049
  }
1049
1050
  }));
1050
1051
  }
1051
- function Fc(e) {
1052
+ function jc(e) {
1052
1053
  return [
1053
1054
  { type: "flex-start", icon: "AlignLeft", tooltip: "Align left" },
1054
1055
  { type: "center", icon: "AlignCenter", tooltip: "Align center" },
@@ -1064,7 +1065,7 @@ function Fc(e) {
1064
1065
  }
1065
1066
  }));
1066
1067
  }
1067
- function jc(e, t) {
1068
+ function Kc(e, t) {
1068
1069
  const n = ["size-small", "size-medium", "size-large"], i = [
1069
1070
  "SizeS",
1070
1071
  "SizeM",
@@ -1081,7 +1082,7 @@ function jc(e, t) {
1081
1082
  }
1082
1083
  }));
1083
1084
  }
1084
- function Kc(e, t) {
1085
+ function Wc(e, t) {
1085
1086
  return [
1086
1087
  {
1087
1088
  type: "flipX",
@@ -1113,8 +1114,8 @@ function Kc(e, t) {
1113
1114
  }
1114
1115
  }
1115
1116
  },
1116
- ...Pc(e, t),
1117
- ...Bc(e, t),
1117
+ ...$c(e, t),
1118
+ ...Vc(e, t),
1118
1119
  {
1119
1120
  type: "remove",
1120
1121
  component: v,
@@ -1130,10 +1131,10 @@ function Kc(e, t) {
1130
1131
  }
1131
1132
  ];
1132
1133
  }
1133
- function Wc(e, t) {
1134
+ function Yc(e, t) {
1134
1135
  return [
1135
- ...$c(e, t),
1136
- ...Vc(e, t),
1136
+ ...Bc(e, t),
1137
+ ...Hc(e, t),
1137
1138
  {
1138
1139
  type: "remove",
1139
1140
  component: v,
@@ -1151,7 +1152,7 @@ function Wc(e, t) {
1151
1152
  }
1152
1153
  function Gc(e, t) {
1153
1154
  return [
1154
- ...Hc(e, t),
1155
+ ...zc(e, t),
1155
1156
  {
1156
1157
  type: "edit",
1157
1158
  component: v,
@@ -1177,9 +1178,9 @@ function Gc(e, t) {
1177
1178
  }
1178
1179
  ];
1179
1180
  }
1180
- function Yc(e, t) {
1181
+ function qc(e, t) {
1181
1182
  return [
1182
- ...zc(e, t),
1183
+ ...Fc(e, t),
1183
1184
  {
1184
1185
  type: "edit",
1185
1186
  component: v,
@@ -1205,10 +1206,10 @@ function Yc(e, t) {
1205
1206
  }
1206
1207
  ];
1207
1208
  }
1208
- function qc(e, t) {
1209
+ function Jc(e, t) {
1209
1210
  return [
1210
- ...jc(e, t),
1211
- ...Fc(e),
1211
+ ...Kc(e, t),
1212
+ ...jc(e),
1212
1213
  {
1213
1214
  type: "remove",
1214
1215
  component: v,
@@ -1225,14 +1226,14 @@ function qc(e, t) {
1225
1226
  ];
1226
1227
  }
1227
1228
  let ye = !1;
1228
- function Jc({ editor: e, attrs: t, extension: n }) {
1229
+ function Xc({ editor: e, attrs: t, extension: n }) {
1229
1230
  const [i, s] = N(!1), r = ot(null), o = ot(null), { alt: l, align: c } = t, a = n == null ? void 0 : n.options.upload, d = () => {
1230
1231
  (async () => {
1231
1232
  const S = document.querySelector("#easydrawer");
1232
- S && (r.current = new Fl(S, {
1233
+ S && (r.current = new jl(S, {
1233
1234
  wheelEventsEnabled: !1,
1234
1235
  disableZoom: !0
1235
- }), o.current = jl(r.current), o.current.addDefaultToolWidgets(), r.current.loadFromSVG(decodeURIComponent(l)));
1236
+ }), o.current = Kl(r.current), o.current.addDefaultToolWidgets(), r.current.loadFromSVG(decodeURIComponent(l)));
1236
1237
  })();
1237
1238
  };
1238
1239
  nt(() => {
@@ -1306,7 +1307,7 @@ function Jc({ editor: e, attrs: t, extension: n }) {
1306
1307
  children: [
1307
1308
  /* @__PURE__ */ p("div", { className: "richtext-size-full", id: "easydrawer" }),
1308
1309
  /* @__PURE__ */ p(
1309
- zl,
1310
+ Fl,
1310
1311
  {
1311
1312
  changeBorderColorShape: k,
1312
1313
  changeColorShape: w,
@@ -1336,11 +1337,11 @@ function Jc({ editor: e, attrs: t, extension: n }) {
1336
1337
  ] })
1337
1338
  ] });
1338
1339
  }
1339
- function Xc({ item: e, disabled: t, editor: n }) {
1340
+ function Zc({ item: e, disabled: t, editor: n }) {
1340
1341
  var s;
1341
1342
  const i = e.component;
1342
1343
  return i ? /* @__PURE__ */ p($i, { children: e.type === "divider" ? /* @__PURE__ */ p(
1343
- Tt,
1344
+ St,
1344
1345
  {
1345
1346
  className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
1346
1347
  orientation: "vertical"
@@ -1354,15 +1355,15 @@ function Xc({ item: e, disabled: t, editor: n }) {
1354
1355
  }
1355
1356
  ) }) : /* @__PURE__ */ p(A, {});
1356
1357
  }
1357
- function xp() {
1358
- const { lang: e, t } = q(), n = Q(), i = F(), s = Yt(i, qn.name), r = Bi(qn.name), o = ({ editor: c }) => {
1358
+ function Sp() {
1359
+ const { lang: e, t } = q(), n = Q(), i = F(), s = Gt(i, qn.name), r = Bi(qn.name), o = ({ editor: c }) => {
1359
1360
  const { selection: a } = c.view.state, { $from: d, to: h } = a;
1360
1361
  let u = !1;
1361
1362
  return c.view.state.doc.nodesBetween(d.pos, h, (f) => {
1362
1363
  if (f.type.name === qn.name)
1363
1364
  return u = !0, !1;
1364
1365
  }), u;
1365
- }, l = ht(() => Yc(i, t), [i, e, t]);
1366
+ }, l = ht(() => qc(i, t), [i, e, t]);
1366
1367
  return n ? /* @__PURE__ */ p(
1367
1368
  it,
1368
1369
  {
@@ -1371,14 +1372,14 @@ function xp() {
1371
1372
  pluginKey: "RichTextBubbleDrawer",
1372
1373
  shouldShow: o,
1373
1374
  children: l != null && l.length ? /* @__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: l == null ? void 0 : l.map((c, a) => c.type === "edit" && (s != null && s.src) ? /* @__PURE__ */ p(
1374
- Jc,
1375
+ Xc,
1375
1376
  {
1376
1377
  attrs: s,
1377
1378
  editor: i,
1378
1379
  extension: r
1379
1380
  },
1380
1381
  `bubbleMenu-drawer-${a}`
1381
- ) : /* @__PURE__ */ p(Xc, { editor: i, item: c }, `bubbleMenu-drawer-${a}`)) }) : /* @__PURE__ */ p(A, {})
1382
+ ) : /* @__PURE__ */ p(Zc, { editor: i, item: c }, `bubbleMenu-drawer-${a}`)) }) : /* @__PURE__ */ p(A, {})
1382
1383
  }
1383
1384
  ) : /* @__PURE__ */ p(A, {});
1384
1385
  }
@@ -1435,7 +1436,7 @@ const $r = ({ width: e, maxWidth: t, height: n, onOk: i, children: s }) => {
1435
1436
  ] }) })
1436
1437
  ] });
1437
1438
  }, Vt = /* @__PURE__ */ new Map();
1438
- function Zc(e) {
1439
+ function Qc(e) {
1439
1440
  const t = e.options.element;
1440
1441
  Vt.has("width") || Vt.set("width", t.clientWidth), Vt.has("width") && Vt.get("width") <= 0 && Vt.set("width", t.clientWidth);
1441
1442
  const n = { attributes: !0, childList: !0, subtree: !0 }, i = function() {
@@ -1445,8 +1446,8 @@ function Zc(e) {
1445
1446
  s.disconnect();
1446
1447
  }), { width: Vt.get("width") };
1447
1448
  }
1448
- function vp() {
1449
- const e = Q(), t = F(), { t: n } = q(), { width: i } = Zc(t), s = Yt(t, we.name, {
1449
+ function kp() {
1450
+ const e = Q(), t = F(), { t: n } = q(), { width: i } = Qc(t), s = Gt(t, we.name, {
1450
1451
  defaultShowPicker: !1,
1451
1452
  createUser: "",
1452
1453
  width: 0,
@@ -1457,8 +1458,8 @@ function vp() {
1457
1458
  },
1458
1459
  [t]
1459
1460
  ), d = O(() => {
1460
- const f = Ul.EXCALIDRAW(t.id);
1461
- Ll(f, s);
1461
+ const f = Il.EXCALIDRAW(t.id);
1462
+ Ol(f, s);
1462
1463
  }, [t, s]), h = O(() => t.isActive(we.name), [t]), u = O(() => qt(we.name, t), [t]);
1463
1464
  return nt(() => {
1464
1465
  r && (d(), t.chain().updateAttributes(we.name, { defaultShowPicker: !1 }).focus().run());
@@ -1477,8 +1478,8 @@ function vp() {
1477
1478
  }
1478
1479
  ) : /* @__PURE__ */ p(A, {});
1479
1480
  }
1480
- function Sp() {
1481
- const e = Q(), t = F(), { t: n } = q(), { width: i, height: s, src: r } = Yt(t, be.name, {
1481
+ function Cp() {
1482
+ const e = Q(), t = F(), { t: n } = q(), { width: i, height: s, src: r } = Gt(t, be.name, {
1482
1483
  width: 0,
1483
1484
  height: 0,
1484
1485
  src: "",
@@ -1497,7 +1498,7 @@ function Sp() {
1497
1498
  (w) => {
1498
1499
  var k;
1499
1500
  (k = w == null ? void 0 : w.preventDefault) == null || k.call(w);
1500
- const b = Kl(c);
1501
+ const b = Wl(c);
1501
1502
  t.chain().updateAttributes(be.name, {
1502
1503
  src: (b == null ? void 0 : b.src) || c
1503
1504
  }).setNodeSelection(t.state.selection.from).focus().run(), l(!1);
@@ -1523,7 +1524,7 @@ function Sp() {
1523
1524
  /* @__PURE__ */ x($e, { onOpenChange: l, open: o, children: [
1524
1525
  /* @__PURE__ */ p(Be, { asChild: !0, children: /* @__PURE__ */ p(v, { icon: "Pencil", tooltip: "Open Edit Link" }) }),
1525
1526
  /* @__PURE__ */ x(Ve, { children: [
1526
- /* @__PURE__ */ p(Pl, { children: /* @__PURE__ */ p(He, { children: "Edit Link Iframe" }) }),
1527
+ /* @__PURE__ */ p(Ml, { children: /* @__PURE__ */ p(He, { children: "Edit Link Iframe" }) }),
1527
1528
  /* @__PURE__ */ p(
1528
1529
  te,
1529
1530
  {
@@ -1546,8 +1547,8 @@ function Sp() {
1546
1547
  }
1547
1548
  ) }) : /* @__PURE__ */ p(A, {});
1548
1549
  }
1549
- function Qc({ children: e, visible: t, toggleVisible: n }) {
1550
- const { t: i } = q(), s = F(), r = Yt(s, fi.name, {
1550
+ function ta({ children: e, visible: t, toggleVisible: n }) {
1551
+ const { t: i } = q(), s = F(), r = Gt(s, ui.name, {
1551
1552
  text: "",
1552
1553
  macros: ""
1553
1554
  }), { text: o, macros: l } = r, [c, a] = N(decodeURIComponent(o || "")), [d, h] = N(decodeURIComponent(l || ""));
@@ -1576,7 +1577,7 @@ function Qc({ children: e, visible: t, toggleVisible: n }) {
1576
1577
  /* @__PURE__ */ x("div", { className: "richtext-flex-1", children: [
1577
1578
  /* @__PURE__ */ p(Ut, { className: "mb-[6px]", children: "Expression" }),
1578
1579
  /* @__PURE__ */ p(
1579
- ui,
1580
+ pi,
1580
1581
  {
1581
1582
  autoFocus: !0,
1582
1583
  className: "richtext-mb-[10px]",
@@ -1592,7 +1593,7 @@ function Qc({ children: e, visible: t, toggleVisible: n }) {
1592
1593
  ),
1593
1594
  /* @__PURE__ */ p(Ut, { className: "mb-[6px]", children: "Macros" }),
1594
1595
  /* @__PURE__ */ p(
1595
- ui,
1596
+ pi,
1596
1597
  {
1597
1598
  onChange: (m) => h(m.target.value),
1598
1599
  placeholder: "Macros",
@@ -1622,8 +1623,8 @@ function Qc({ children: e, visible: t, toggleVisible: n }) {
1622
1623
  ] })
1623
1624
  ] });
1624
1625
  }
1625
- function kp() {
1626
- const e = Q(), t = F(), [n, i] = N(!1), s = O(() => t.isActive(fi.name), [t]), r = O(() => qt(fi.name, t), [t]);
1626
+ function _p() {
1627
+ const e = Q(), t = F(), [n, i] = N(!1), s = O(() => t.isActive(ui.name), [t]), r = O(() => qt(ui.name, t), [t]);
1627
1628
  return e ? /* @__PURE__ */ p(
1628
1629
  it,
1629
1630
  {
@@ -1632,13 +1633,13 @@ function kp() {
1632
1633
  pluginKey: "RichTextBubbleKatex",
1633
1634
  shouldShow: s,
1634
1635
  children: /* @__PURE__ */ x("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: [
1635
- /* @__PURE__ */ p(Qc, { toggleVisible: i, visible: n, children: /* @__PURE__ */ p(v, { action: () => i(!n), tooltip: "Edit", children: /* @__PURE__ */ p(Hl, { size: 16 }) }) }),
1636
+ /* @__PURE__ */ p(ta, { toggleVisible: i, visible: n, children: /* @__PURE__ */ p(v, { action: () => i(!n), tooltip: "Edit", children: /* @__PURE__ */ p(Hl, { size: 16 }) }) }),
1636
1637
  /* @__PURE__ */ p(v, { action: r, tooltip: "Delete", children: /* @__PURE__ */ p(Ar, { size: 16 }) })
1637
1638
  ] })
1638
1639
  }
1639
1640
  ) : /* @__PURE__ */ p(A, {});
1640
1641
  }
1641
- function ta(e) {
1642
+ function ea(e) {
1642
1643
  const { t } = q();
1643
1644
  return /* @__PURE__ */ x("div", { className: "richtext-flex richtext-flex-nowrap", children: [
1644
1645
  /* @__PURE__ */ p(
@@ -1677,8 +1678,8 @@ function ta(e) {
1677
1678
  )
1678
1679
  ] });
1679
1680
  }
1680
- function Cp() {
1681
- const e = Q(), t = F(), [n, i] = N(!1), s = Yt(t, ys.name), r = s == null ? void 0 : s.href, o = O(({ editor: d }) => d.isActive(ys.name), []), l = (d, h, u) => {
1681
+ function Ep() {
1682
+ const e = Q(), t = F(), [n, i] = N(!1), s = Gt(t, ys.name), r = s == null ? void 0 : s.href, o = O(({ editor: d }) => d.isActive(ys.name), []), l = (d, h, u) => {
1682
1683
  const f = t.state.selection, { from: g } = f, m = (h == null ? void 0 : h.length) ?? 0, w = g + m;
1683
1684
  t.chain().extendMarkRange("link").insertContent({
1684
1685
  type: "text",
@@ -1705,8 +1706,8 @@ function Cp() {
1705
1706
  options: { placement: "bottom", offset: 8, flip: !0 },
1706
1707
  pluginKey: "RichTextBubbleLink",
1707
1708
  shouldShow: o,
1708
- children: /* @__PURE__ */ p(A, { children: n ? /* @__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(Yl, { editor: t, onClose: a, onSetLink: l }) }) : /* @__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(
1709
- ta,
1709
+ children: /* @__PURE__ */ p(A, { children: n ? /* @__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(ql, { editor: t, onClose: a, onSetLink: l }) }) : /* @__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(
1710
+ ea,
1710
1711
  {
1711
1712
  editor: t,
1712
1713
  link: r,
@@ -1722,7 +1723,7 @@ function Cp() {
1722
1723
  function Fi({ item: e, disabled: t, editor: n }) {
1723
1724
  const i = e.component;
1724
1725
  return i ? /* @__PURE__ */ p($i, { children: e.type === "divider" ? /* @__PURE__ */ p(
1725
- Tt,
1726
+ St,
1726
1727
  {
1727
1728
  className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
1728
1729
  orientation: "vertical"
@@ -1736,24 +1737,24 @@ function Fi({ item: e, disabled: t, editor: n }) {
1736
1737
  }
1737
1738
  ) }) : /* @__PURE__ */ p(A, {});
1738
1739
  }
1739
- function ea(e) {
1740
- return e.type.name === $l.name;
1741
- }
1742
1740
  function na(e) {
1743
- return e.type.name === Wl.name;
1741
+ return e.type.name === Rl.name;
1744
1742
  }
1745
1743
  function ia(e) {
1746
- return e.type.name === Bl.name;
1744
+ return e.type.name === Yl.name;
1747
1745
  }
1748
- function _p() {
1746
+ function sa(e) {
1747
+ return e.type.name === Nl.name;
1748
+ }
1749
+ function Tp() {
1749
1750
  const { lang: e, t } = q(), n = Q(), i = F(), s = ({ editor: o }) => {
1750
1751
  const { selection: l } = o.view.state, { $from: c, to: a } = l;
1751
1752
  let d = !1;
1752
1753
  return o.view.state.doc.nodesBetween(c.pos, a, (h) => {
1753
- if (ea(h))
1754
+ if (na(h))
1754
1755
  return d = !0, !1;
1755
1756
  }), d;
1756
- }, r = ht(() => Kc(i, t), [i, e, t]);
1757
+ }, r = ht(() => Wc(i, t), [i, e, t]);
1757
1758
  return n ? /* @__PURE__ */ p(
1758
1759
  it,
1759
1760
  {
@@ -1765,15 +1766,15 @@ function _p() {
1765
1766
  }
1766
1767
  ) : /* @__PURE__ */ p(A, {});
1767
1768
  }
1768
- function Ep() {
1769
+ function Dp() {
1769
1770
  const { lang: e, t } = q(), n = Q(), i = F(), s = ({ editor: o }) => {
1770
1771
  const { selection: l } = o.view.state, { $from: c, to: a } = l;
1771
1772
  let d = !1;
1772
1773
  return o.view.state.doc.nodesBetween(c.pos, a, (h) => {
1773
- if (na(h))
1774
+ if (ia(h))
1774
1775
  return d = !0, !1;
1775
1776
  }), d;
1776
- }, r = ht(() => Wc(i, t), [i, t, e]);
1777
+ }, r = ht(() => Yc(i, t), [i, t, e]);
1777
1778
  return n ? /* @__PURE__ */ p(
1778
1779
  it,
1779
1780
  {
@@ -1785,15 +1786,15 @@ function Ep() {
1785
1786
  }
1786
1787
  ) : /* @__PURE__ */ p(A, {});
1787
1788
  }
1788
- function Tp() {
1789
+ function Ap() {
1789
1790
  const { t: e } = q(), t = Q(), n = F(), i = ({ editor: r }) => {
1790
1791
  const { selection: o } = r.view.state, { $from: l, to: c } = o;
1791
1792
  let a = !1;
1792
1793
  return r.view.state.doc.nodesBetween(l.pos, c, (d) => {
1793
- if (ia(d))
1794
+ if (sa(d))
1794
1795
  return a = !0, !1;
1795
1796
  }), a;
1796
- }, s = ht(() => qc(n, e), [n, e]);
1797
+ }, s = ht(() => Jc(n, e), [n, e]);
1797
1798
  return t ? /* @__PURE__ */ p(
1798
1799
  it,
1799
1800
  {
@@ -1806,7 +1807,7 @@ function Tp() {
1806
1807
  ) : /* @__PURE__ */ p(A, {});
1807
1808
  }
1808
1809
  const As = `graph TB
1809
- a-->b`, sa = ({ editor: e, attrs: t, extension: n }) => {
1810
+ a-->b`, ra = ({ editor: e, attrs: t, extension: n }) => {
1810
1811
  const { alt: i, align: s } = t, [r, o] = N(decodeURIComponent(i ?? As)), [l, c] = N(""), [a, d] = N(!1), h = ot(null), [u, f] = N(null), g = n == null ? void 0 : n.options.upload, m = O((C) => {
1811
1812
  C && import("mermaid").then((I) => {
1812
1813
  f(I.default);
@@ -1837,7 +1838,7 @@ a-->b`, sa = ({ editor: e, attrs: t, extension: n }) => {
1837
1838
  /* @__PURE__ */ p(He, { children: "Edit Mermaid" }),
1838
1839
  /* @__PURE__ */ p("div", { ref: m, style: { height: "100%", border: "1px solid hsl(var(--border))" }, children: /* @__PURE__ */ x("div", { className: "richtext-flex richtext-gap-[10px] richtext-rounded-[10px] richtext-p-[10px]", children: [
1839
1840
  /* @__PURE__ */ p(
1840
- ui,
1841
+ pi,
1841
1842
  {
1842
1843
  autoFocus: !0,
1843
1844
  className: "richtext-flex-1",
@@ -1892,11 +1893,11 @@ a-->b`, sa = ({ editor: e, attrs: t, extension: n }) => {
1892
1893
  ] })
1893
1894
  ] });
1894
1895
  };
1895
- function ra({ item: e, disabled: t, editor: n }) {
1896
+ function oa({ item: e, disabled: t, editor: n }) {
1896
1897
  var s;
1897
1898
  const i = e.component;
1898
1899
  return i ? /* @__PURE__ */ p($i, { children: e.type === "divider" ? /* @__PURE__ */ p(
1899
- Tt,
1900
+ St,
1900
1901
  {
1901
1902
  className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
1902
1903
  orientation: "vertical"
@@ -1910,15 +1911,15 @@ function ra({ item: e, disabled: t, editor: n }) {
1910
1911
  }
1911
1912
  ) }) : /* @__PURE__ */ p(A, {});
1912
1913
  }
1913
- function oa(e) {
1914
+ function la(e) {
1914
1915
  return e.type.name === gi.name;
1915
1916
  }
1916
- function Dp() {
1917
- const { lang: e, t } = q(), n = Q(), i = F(), s = Yt(i, gi.name), r = Bi(gi.name), o = ({ editor: c }) => {
1917
+ function Ip() {
1918
+ const { lang: e, t } = q(), n = Q(), i = F(), s = Gt(i, gi.name), r = Bi(gi.name), o = ({ editor: c }) => {
1918
1919
  const { selection: a } = c.view.state, { $from: d, to: h } = a;
1919
1920
  let u = !1;
1920
1921
  return c.view.state.doc.nodesBetween(d.pos, h, (f) => {
1921
- if (oa(f))
1922
+ if (la(f))
1922
1923
  return u = !0, !1;
1923
1924
  }), u;
1924
1925
  }, l = ht(() => Gc(i, t), [i, e, t]);
@@ -1930,19 +1931,19 @@ function Dp() {
1930
1931
  pluginKey: "RichTextBubbleMermaid",
1931
1932
  shouldShow: o,
1932
1933
  children: l != null && l.length ? /* @__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: l == null ? void 0 : l.map((c, a) => c.type === "edit" && (s != null && s.src) ? /* @__PURE__ */ p(
1933
- sa,
1934
+ ra,
1934
1935
  {
1935
1936
  attrs: s,
1936
1937
  editor: i,
1937
1938
  extension: r
1938
1939
  },
1939
1940
  `bubbleMenu-mermaid-${a}`
1940
- ) : /* @__PURE__ */ p(ra, { editor: i, item: c }, `bubbleMenu-mermaid-${a}`)) }) : /* @__PURE__ */ p(A, {})
1941
+ ) : /* @__PURE__ */ p(oa, { editor: i, item: c }, `bubbleMenu-mermaid-${a}`)) }) : /* @__PURE__ */ p(A, {})
1941
1942
  }
1942
1943
  ) : /* @__PURE__ */ p(A, {});
1943
1944
  }
1944
- function Ap({ hiddenActions: e = [] }) {
1945
- var m, w, b, k, C, I, $, y, S, T, j, P, V, Y, ct, _, Ct, Ye;
1945
+ function Op({ hiddenActions: e = [] }) {
1946
+ var m, w, b, k, C, I, $, y, S, T, j, P, V, G, ct, _, _t, Ge;
1946
1947
  const { t } = q(), n = Q(), i = F(), s = ({ editor: Zt }) => bl(Zt.view.state, Dl.name), r = (Zt) => e.includes(Zt);
1947
1948
  function o() {
1948
1949
  i.chain().focus().addColumnBefore().run();
@@ -2010,7 +2011,7 @@ function Ap({ hiddenActions: e = [] }) {
2010
2011
  }
2011
2012
  ),
2012
2013
  /* @__PURE__ */ p(
2013
- Tt,
2014
+ St,
2014
2015
  {
2015
2016
  className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
2016
2017
  orientation: "vertical"
@@ -2047,7 +2048,7 @@ function Ap({ hiddenActions: e = [] }) {
2047
2048
  }
2048
2049
  ),
2049
2050
  /* @__PURE__ */ p(
2050
- Tt,
2051
+ St,
2051
2052
  {
2052
2053
  className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
2053
2054
  orientation: "vertical"
@@ -2057,7 +2058,7 @@ function Ap({ hiddenActions: e = [] }) {
2057
2058
  v,
2058
2059
  {
2059
2060
  action: u,
2060
- disabled: !((Y = (V = i == null ? void 0 : i.can()) == null ? void 0 : V.mergeCells) != null && Y.call(V)),
2061
+ disabled: !((G = (V = i == null ? void 0 : i.can()) == null ? void 0 : V.mergeCells) != null && G.call(V)),
2061
2062
  icon: "TableCellsMerge",
2062
2063
  tooltip: t("editor.table.menu.mergeCells"),
2063
2064
  tooltipOptions: { sideOffset: 15 }
@@ -2074,7 +2075,7 @@ function Ap({ hiddenActions: e = [] }) {
2074
2075
  }
2075
2076
  ),
2076
2077
  /* @__PURE__ */ p(
2077
- Tt,
2078
+ St,
2078
2079
  {
2079
2080
  className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
2080
2081
  orientation: "vertical"
@@ -2084,7 +2085,7 @@ function Ap({ hiddenActions: e = [] }) {
2084
2085
  v,
2085
2086
  {
2086
2087
  action: g,
2087
- disabled: !((Ye = (Ct = i == null ? void 0 : i.can()) == null ? void 0 : Ct.deleteTable) != null && Ye.call(Ct)),
2088
+ disabled: !((Ge = (_t = i == null ? void 0 : i.can()) == null ? void 0 : _t.deleteTable) != null && Ge.call(_t)),
2088
2089
  icon: "Trash2",
2089
2090
  tooltip: t("editor.table.menu.deleteTable"),
2090
2091
  tooltipOptions: { sideOffset: 15 }
@@ -2094,10 +2095,10 @@ function Ap({ hiddenActions: e = [] }) {
2094
2095
  }
2095
2096
  ) : /* @__PURE__ */ p(A, {});
2096
2097
  }
2097
- function la() {
2098
+ function ca() {
2098
2099
  const { t: e } = q(), [t, n] = N(!1), i = F(), s = ht(() => {
2099
2100
  var o, l;
2100
- return (l = (o = dc({ t: e })) == null ? void 0 : o[0]) == null ? void 0 : l.commands;
2101
+ return (l = (o = uc({ t: e })) == null ? void 0 : o[0]) == null ? void 0 : l.commands;
2101
2102
  }, [e]), r = ht(() => {
2102
2103
  var l;
2103
2104
  return (l = s == null ? void 0 : s.find((c) => {
@@ -2145,8 +2146,8 @@ function la() {
2145
2146
  },
2146
2147
  children: [
2147
2148
  /* @__PURE__ */ x("div", { className: "!richtext-min-w-[20px]", children: [
2148
- l && /* @__PURE__ */ p(pi, { size: 16 }),
2149
- !r && o.label === e("editor.paragraph.tooltip") && !l && /* @__PURE__ */ p(pi, { size: 16 })
2149
+ l && /* @__PURE__ */ p(fi, { size: 16 }),
2150
+ !r && o.label === e("editor.paragraph.tooltip") && !l && /* @__PURE__ */ p(fi, { size: 16 })
2150
2151
  ] }),
2151
2152
  /* @__PURE__ */ x("div", { className: "richtext-flex richtext-items-center richtext-gap-1", children: [
2152
2153
  o.iconName && /* @__PURE__ */ p(
@@ -2167,35 +2168,35 @@ function la() {
2167
2168
  )
2168
2169
  ] });
2169
2170
  }
2170
- function ca() {
2171
+ function aa() {
2171
2172
  return /* @__PURE__ */ x(A, { children: [
2172
- /* @__PURE__ */ p(la, {}),
2173
+ /* @__PURE__ */ p(ca, {}),
2173
2174
  /* @__PURE__ */ p(
2174
- Tt,
2175
+ St,
2175
2176
  {
2176
2177
  className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
2177
2178
  orientation: "vertical"
2178
2179
  }
2179
2180
  ),
2180
- /* @__PURE__ */ p(oc, {}),
2181
- /* @__PURE__ */ p(hc, {}),
2182
- /* @__PURE__ */ p(fc, {}),
2183
- /* @__PURE__ */ p(uc, {}),
2184
2181
  /* @__PURE__ */ p(lc, {}),
2185
- /* @__PURE__ */ p(ql, {}),
2182
+ /* @__PURE__ */ p(dc, {}),
2183
+ /* @__PURE__ */ p(pc, {}),
2184
+ /* @__PURE__ */ p(fc, {}),
2185
+ /* @__PURE__ */ p(cc, {}),
2186
+ /* @__PURE__ */ p(Jl, {}),
2186
2187
  /* @__PURE__ */ p(
2187
- Tt,
2188
+ St,
2188
2189
  {
2189
2190
  className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
2190
2191
  orientation: "vertical"
2191
2192
  }
2192
2193
  ),
2193
- /* @__PURE__ */ p(cc, {}),
2194
2194
  /* @__PURE__ */ p(ac, {}),
2195
- /* @__PURE__ */ p(sc, {})
2195
+ /* @__PURE__ */ p(hc, {}),
2196
+ /* @__PURE__ */ p(ec, {})
2196
2197
  ] });
2197
2198
  }
2198
- function Ip({ buttonBubble: e }) {
2199
+ function Mp({ buttonBubble: e }) {
2199
2200
  const t = F(), n = Q(), i = ({ editor: s }) => {
2200
2201
  const { selection: r } = s.view.state, { $from: o, to: l } = r;
2201
2202
  return s.isActive("codeBlock") || o.pos === l ? !1 : r instanceof Cl;
@@ -2207,11 +2208,11 @@ function Ip({ buttonBubble: e }) {
2207
2208
  options: { placement: "bottom", offset: 8, flip: !0 },
2208
2209
  pluginKey: "RichTextBubbleText",
2209
2210
  shouldShow: i,
2210
- children: e ? /* @__PURE__ */ p(A, { 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(ca, {}) })
2211
+ children: e ? /* @__PURE__ */ p(A, { 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(aa, {}) })
2211
2212
  }
2212
2213
  ) : /* @__PURE__ */ p(A, {});
2213
2214
  }
2214
- function Op() {
2215
+ function Rp() {
2215
2216
  const { t: e } = q(), t = Q(), n = F(), [i, s] = N(!1), r = O(({ editor: c }) => c.isActive(Ts.name), []), o = (c) => {
2216
2217
  n.commands.updateTweet({ src: c }), s(!1);
2217
2218
  }, l = O(() => qt(Ts.name, n), [n]);
@@ -2222,7 +2223,7 @@ function Op() {
2222
2223
  options: { placement: "bottom", offset: 8, flip: !0 },
2223
2224
  pluginKey: "RichTextBubbleTwitter",
2224
2225
  shouldShow: r,
2225
- children: /* @__PURE__ */ p(A, { 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(pc, { editor: n, onSetLink: o }) }) : /* @__PURE__ */ x("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: [
2226
+ children: /* @__PURE__ */ p(A, { 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(gc, { editor: n, onSetLink: o }) }) : /* @__PURE__ */ x("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: [
2226
2227
  /* @__PURE__ */ p(
2227
2228
  v,
2228
2229
  {
@@ -2255,17 +2256,17 @@ const mt = () => /* @__PURE__ */ new Map(), wi = (e) => {
2255
2256
  }, It = (e, t, n) => {
2256
2257
  let i = e.get(t);
2257
2258
  return i === void 0 && e.set(t, i = n()), i;
2258
- }, aa = (e, t) => {
2259
+ }, ha = (e, t) => {
2259
2260
  const n = [];
2260
2261
  for (const [i, s] of e)
2261
2262
  n.push(t(s, i));
2262
2263
  return n;
2263
- }, ha = (e, t) => {
2264
+ }, da = (e, t) => {
2264
2265
  for (const [n, i] of e)
2265
2266
  if (t(i, n))
2266
2267
  return !0;
2267
2268
  return !1;
2268
- }, Ft = () => /* @__PURE__ */ new Set(), Xn = (e) => e[e.length - 1], da = (e, t) => {
2269
+ }, Ft = () => /* @__PURE__ */ new Set(), Xn = (e) => e[e.length - 1], ua = (e, t) => {
2269
2270
  for (let n = 0; n < t.length; n++)
2270
2271
  e.push(t[n]);
2271
2272
  }, jt = Array.from, ji = (e, t) => {
@@ -2278,7 +2279,7 @@ const mt = () => /* @__PURE__ */ new Map(), wi = (e) => {
2278
2279
  if (t(e[n], n, e))
2279
2280
  return !0;
2280
2281
  return !1;
2281
- }, ua = (e, t) => {
2282
+ }, fa = (e, t) => {
2282
2283
  const n = new Array(e);
2283
2284
  for (let i = 0; i < e; i++)
2284
2285
  n[i] = t(i, n);
@@ -2346,7 +2347,7 @@ class Br {
2346
2347
  this._observers = mt();
2347
2348
  }
2348
2349
  }
2349
- const wt = Math.floor, rn = Math.abs, le = (e, t) => e < t ? e : t, Pt = (e, t) => e > t ? e : t, Vr = (e) => e !== 0 ? e < 0 : 1 / e < 0, Is = 1, Os = 2, Zn = 4, Qn = 8, ke = 32, Dt = 64, et = 128, fa = 1 << 29, On = 31, bi = 63, zt = 127, pa = 2147483647, fn = Number.MAX_SAFE_INTEGER, Ms = Number.MIN_SAFE_INTEGER, ga = Number.isInteger || ((e) => typeof e == "number" && isFinite(e) && wt(e) === e), Hr = String.fromCharCode, ma = (e) => e.toLowerCase(), wa = /^\s*/g, ba = (e) => e.replace(wa, ""), ya = /([A-Z])/g, Rs = (e, t) => ba(e.replace(ya, (n) => `${t}${ma(n)}`)), xa = (e) => {
2350
+ const wt = Math.floor, rn = Math.abs, le = (e, t) => e < t ? e : t, Pt = (e, t) => e > t ? e : t, Vr = (e) => e !== 0 ? e < 0 : 1 / e < 0, Is = 1, Os = 2, Zn = 4, Qn = 8, ke = 32, Dt = 64, et = 128, pa = 1 << 29, On = 31, bi = 63, zt = 127, ga = 2147483647, fn = Number.MAX_SAFE_INTEGER, Ms = Number.MIN_SAFE_INTEGER, ma = Number.isInteger || ((e) => typeof e == "number" && isFinite(e) && wt(e) === e), Hr = String.fromCharCode, wa = (e) => e.toLowerCase(), ba = /^\s*/g, ya = (e) => e.replace(ba, ""), xa = /([A-Z])/g, Rs = (e, t) => ya(e.replace(xa, (n) => `${t}${wa(n)}`)), va = (e) => {
2350
2351
  const t = unescape(encodeURIComponent(e)), n = t.length, i = new Uint8Array(n);
2351
2352
  for (let s = 0; s < n; s++)
2352
2353
  i[s] = /** @type {number} */
@@ -2355,32 +2356,32 @@ const wt = Math.floor, rn = Math.abs, le = (e, t) => e < t ? e : t, Pt = (e, t)
2355
2356
  }, Ce = (
2356
2357
  /** @type {TextEncoder} */
2357
2358
  typeof TextEncoder < "u" ? new TextEncoder() : null
2358
- ), va = (e) => Ce.encode(e), Sa = Ce ? va : xa;
2359
+ ), Sa = (e) => Ce.encode(e), ka = Ce ? Sa : va;
2359
2360
  let ve = typeof TextDecoder > "u" ? null : new TextDecoder("utf-8", { fatal: !0, ignoreBOM: !0 });
2360
2361
  ve && ve.decode(new Uint8Array()).length === 1 && (ve = null);
2361
- const ka = (e, t) => ua(t, () => e).join("");
2362
+ const Ca = (e, t) => fa(t, () => e).join("");
2362
2363
  class Fe {
2363
2364
  constructor() {
2364
2365
  this.cpos = 0, this.cbuf = new Uint8Array(100), this.bufs = [];
2365
2366
  }
2366
2367
  }
2367
- const je = () => new Fe(), Ca = (e) => {
2368
+ const je = () => new Fe(), _a = (e) => {
2368
2369
  const t = je();
2369
2370
  return e(t), gt(t);
2370
- }, _a = (e) => {
2371
+ }, Ea = (e) => {
2371
2372
  let t = e.cpos;
2372
2373
  for (let n = 0; n < e.bufs.length; n++)
2373
2374
  t += e.bufs[n].length;
2374
2375
  return t;
2375
2376
  }, gt = (e) => {
2376
- const t = new Uint8Array(_a(e));
2377
+ const t = new Uint8Array(Ea(e));
2377
2378
  let n = 0;
2378
2379
  for (let i = 0; i < e.bufs.length; i++) {
2379
2380
  const s = e.bufs[i];
2380
2381
  t.set(s, n), n += s.length;
2381
2382
  }
2382
2383
  return t.set(new Uint8Array(e.cbuf.buffer, 0, e.cpos), n), t;
2383
- }, Ea = (e, t) => {
2384
+ }, Ta = (e, t) => {
2384
2385
  const n = e.cbuf.length;
2385
2386
  n - e.cpos < t && (e.bufs.push(new Uint8Array(e.cbuf.buffer, 0, e.cpos)), e.cbuf = new Uint8Array(Pt(n, t) * 2), e.cpos = 0);
2386
2387
  }, K = (e, t) => {
@@ -2394,15 +2395,15 @@ const je = () => new Fe(), Ca = (e) => {
2394
2395
  const n = Vr(t);
2395
2396
  for (n && (t = -t), K(e, (t > bi ? et : 0) | (n ? Dt : 0) | bi & t), t = wt(t / 64); t > 0; )
2396
2397
  K(e, (t > zt ? et : 0) | zt & t), t = wt(t / 128);
2397
- }, xi = new Uint8Array(3e4), Ta = xi.length / 3, Da = (e, t) => {
2398
- if (t.length < Ta) {
2398
+ }, xi = new Uint8Array(3e4), Da = xi.length / 3, Aa = (e, t) => {
2399
+ if (t.length < Da) {
2399
2400
  const n = Ce.encodeInto(t, xi).written || 0;
2400
2401
  D(e, n);
2401
2402
  for (let i = 0; i < n; i++)
2402
2403
  K(e, xi[i]);
2403
2404
  } else
2404
- at(e, Sa(t));
2405
- }, Aa = (e, t) => {
2405
+ at(e, ka(t));
2406
+ }, Ia = (e, t) => {
2406
2407
  const n = unescape(encodeURIComponent(t)), i = n.length;
2407
2408
  D(e, i);
2408
2409
  for (let s = 0; s < i; s++)
@@ -2412,28 +2413,28 @@ const je = () => new Fe(), Ca = (e) => {
2412
2413
  n.codePointAt(s)
2413
2414
  );
2414
2415
  }, ee = Ce && /** @type {any} */
2415
- Ce.encodeInto ? Da : Aa, Mn = (e, t) => {
2416
+ Ce.encodeInto ? Aa : Ia, Mn = (e, t) => {
2416
2417
  const n = e.cbuf.length, i = e.cpos, s = le(n - i, t.length), r = t.length - s;
2417
2418
  e.cbuf.set(t.subarray(0, s), i), e.cpos += s, r > 0 && (e.bufs.push(e.cbuf), e.cbuf = new Uint8Array(Pt(n * 2, r)), e.cbuf.set(t.subarray(s)), e.cpos = r);
2418
2419
  }, at = (e, t) => {
2419
2420
  D(e, t.byteLength), Mn(e, t);
2420
- }, Gi = (e, t) => {
2421
- Ea(e, t);
2421
+ }, Yi = (e, t) => {
2422
+ Ta(e, t);
2422
2423
  const n = new DataView(e.cbuf.buffer, e.cpos, t);
2423
2424
  return e.cpos += t, n;
2424
- }, Ia = (e, t) => Gi(e, 4).setFloat32(0, t, !1), Oa = (e, t) => Gi(e, 8).setFloat64(0, t, !1), Ma = (e, t) => (
2425
+ }, Oa = (e, t) => Yi(e, 4).setFloat32(0, t, !1), Ma = (e, t) => Yi(e, 8).setFloat64(0, t, !1), Ra = (e, t) => (
2425
2426
  /** @type {any} */
2426
- Gi(e, 8).setBigInt64(0, t, !1)
2427
- ), Ns = new DataView(new ArrayBuffer(4)), Ra = (e) => (Ns.setFloat32(0, e), Ns.getFloat32(0) === e), ce = (e, t) => {
2427
+ Yi(e, 8).setBigInt64(0, t, !1)
2428
+ ), Ns = new DataView(new ArrayBuffer(4)), Na = (e) => (Ns.setFloat32(0, e), Ns.getFloat32(0) === e), ce = (e, t) => {
2428
2429
  switch (typeof t) {
2429
2430
  case "string":
2430
2431
  K(e, 119), ee(e, t);
2431
2432
  break;
2432
2433
  case "number":
2433
- ga(t) && rn(t) <= pa ? (K(e, 125), Wi(e, t)) : Ra(t) ? (K(e, 124), Ia(e, t)) : (K(e, 123), Oa(e, t));
2434
+ ma(t) && rn(t) <= ga ? (K(e, 125), Wi(e, t)) : Na(t) ? (K(e, 124), Oa(e, t)) : (K(e, 123), Ma(e, t));
2434
2435
  break;
2435
2436
  case "bigint":
2436
- K(e, 122), Ma(e, t);
2437
+ K(e, 122), Ra(e, t);
2437
2438
  break;
2438
2439
  case "object":
2439
2440
  if (t === null)
@@ -2522,7 +2523,7 @@ class ti {
2522
2523
  return Ps(this), gt(this.encoder);
2523
2524
  }
2524
2525
  }
2525
- class Na {
2526
+ class Ua {
2526
2527
  constructor() {
2527
2528
  this.sarr = [], this.s = "", this.lensE = new on();
2528
2529
  }
@@ -2537,11 +2538,11 @@ class Na {
2537
2538
  return this.sarr.push(this.s), this.s = "", ee(t, this.sarr.join("")), Mn(t, this.lensE.toUint8Array()), gt(t);
2538
2539
  }
2539
2540
  }
2540
- const kt = (e) => new Error(e), ft = () => {
2541
- throw kt("Method unimplemented");
2541
+ const Ct = (e) => new Error(e), ft = () => {
2542
+ throw Ct("Method unimplemented");
2542
2543
  }, Z = () => {
2543
- throw kt("Unexpected case");
2544
- }, zr = kt("Unexpected end of array"), Fr = kt("Integer out of Range");
2544
+ throw Ct("Unexpected case");
2545
+ }, zr = Ct("Unexpected end of array"), Fr = Ct("Integer out of Range");
2545
2546
  class Rn {
2546
2547
  /**
2547
2548
  * @param {Uint8Array<Buf>} uint8Array Binary data to decode
@@ -2550,10 +2551,10 @@ class Rn {
2550
2551
  this.arr = t, this.pos = 0;
2551
2552
  }
2552
2553
  }
2553
- const Yi = (e) => new Rn(e), Ua = (e) => e.pos !== e.arr.length, La = (e, t) => {
2554
+ const Gi = (e) => new Rn(e), La = (e) => e.pos !== e.arr.length, Pa = (e, t) => {
2554
2555
  const n = new Uint8Array(e.arr.buffer, e.pos + e.arr.byteOffset, t);
2555
2556
  return e.pos += t, n;
2556
- }, dt = (e) => La(e, U(e)), _e = (e) => e.arr[e.pos++], U = (e) => {
2557
+ }, dt = (e) => Pa(e, U(e)), _e = (e) => e.arr[e.pos++], U = (e) => {
2557
2558
  let t = 0, n = 1;
2558
2559
  const i = e.arr.length;
2559
2560
  for (; e.pos < i; ) {
@@ -2577,7 +2578,7 @@ const Yi = (e) => new Rn(e), Ua = (e) => e.pos !== e.arr.length, La = (e, t) =>
2577
2578
  throw Fr;
2578
2579
  }
2579
2580
  throw zr;
2580
- }, Pa = (e) => {
2581
+ }, $a = (e) => {
2581
2582
  let t = U(e);
2582
2583
  if (t === 0)
2583
2584
  return "";
@@ -2597,16 +2598,16 @@ const Yi = (e) => new Rn(e), Ua = (e) => e.pos !== e.arr.length, La = (e, t) =>
2597
2598
  }
2598
2599
  return decodeURIComponent(escape(n));
2599
2600
  }
2600
- }, $a = (e) => (
2601
+ }, Ba = (e) => (
2601
2602
  /** @type any */
2602
2603
  ve.decode(dt(e))
2603
- ), vi = ve ? $a : Pa, Ji = (e, t) => {
2604
+ ), vi = ve ? Ba : $a, Ji = (e, t) => {
2604
2605
  const n = new DataView(e.arr.buffer, e.arr.byteOffset + e.pos, t);
2605
2606
  return e.pos += t, n;
2606
- }, Ba = (e) => Ji(e, 4).getFloat32(0, !1), Va = (e) => Ji(e, 8).getFloat64(0, !1), Ha = (e) => (
2607
+ }, Va = (e) => Ji(e, 4).getFloat32(0, !1), Ha = (e) => Ji(e, 8).getFloat64(0, !1), za = (e) => (
2607
2608
  /** @type {any} */
2608
2609
  Ji(e, 8).getBigInt64(0, !1)
2609
- ), za = [
2610
+ ), Fa = [
2610
2611
  (e) => {
2611
2612
  },
2612
2613
  // CASE 127: undefined
@@ -2614,11 +2615,11 @@ const Yi = (e) => new Rn(e), Ua = (e) => e.pos !== e.arr.length, La = (e, t) =>
2614
2615
  // CASE 126: null
2615
2616
  qi,
2616
2617
  // CASE 125: integer
2617
- Ba,
2618
- // CASE 124: float32
2619
2618
  Va,
2620
- // CASE 123: float64
2619
+ // CASE 124: float32
2621
2620
  Ha,
2621
+ // CASE 123: float64
2622
+ za,
2622
2623
  // CASE 122: bigint
2623
2624
  (e) => !1,
2624
2625
  // CASE 121: boolean (false)
@@ -2642,7 +2643,7 @@ const Yi = (e) => new Rn(e), Ua = (e) => e.pos !== e.arr.length, La = (e, t) =>
2642
2643
  },
2643
2644
  dt
2644
2645
  // CASE 116: Uint8Array
2645
- ], pn = (e) => za[127 - _e(e)](e);
2646
+ ], pn = (e) => Fa[127 - _e(e)](e);
2646
2647
  class $s extends Rn {
2647
2648
  /**
2648
2649
  * @param {Uint8Array} uint8Array
@@ -2652,7 +2653,7 @@ class $s extends Rn {
2652
2653
  super(t), this.reader = n, this.s = null, this.count = 0;
2653
2654
  }
2654
2655
  read() {
2655
- return this.count === 0 && (this.s = this.reader(this), Ua(this) ? this.count = U(this) + 1 : this.count = -1), this.count--, /** @type {T} */
2656
+ return this.count === 0 && (this.s = this.reader(this), La(this) ? this.count = U(this) + 1 : this.count = -1), this.count--, /** @type {T} */
2656
2657
  this.s;
2657
2658
  }
2658
2659
  }
@@ -2691,7 +2692,7 @@ class ei extends Rn {
2691
2692
  return this.s += this.diff, this.count--, this.s;
2692
2693
  }
2693
2694
  }
2694
- class Fa {
2695
+ class ja {
2695
2696
  /**
2696
2697
  * @param {Uint8Array} uint8Array
2697
2698
  */
@@ -2706,17 +2707,17 @@ class Fa {
2706
2707
  return this.spos = t, n;
2707
2708
  }
2708
2709
  }
2709
- const ja = crypto.getRandomValues.bind(crypto), Ka = Math.random, jr = () => ja(new Uint32Array(1))[0], Wa = (e) => e[wt(Ka() * e.length)], Ga = "10000000-1000-4000-8000" + -1e11, Ya = () => Ga.replace(
2710
+ const Ka = crypto.getRandomValues.bind(crypto), Wa = Math.random, jr = () => Ka(new Uint32Array(1))[0], Ya = (e) => e[wt(Wa() * e.length)], Ga = "10000000-1000-4000-8000" + -1e11, qa = () => Ga.replace(
2710
2711
  /[018]/g,
2711
2712
  /** @param {number} c */
2712
2713
  (e) => (e ^ jr() & 15 >> e / 4).toString(16)
2713
- ), qa = Date.now, Bs = (e) => (
2714
+ ), Ja = Date.now, Bs = (e) => (
2714
2715
  /** @type {Promise<T>} */
2715
2716
  new Promise(e)
2716
2717
  );
2717
2718
  Promise.all.bind(Promise);
2718
2719
  const Vs = (e) => e === void 0 ? null : e;
2719
- class Ja {
2720
+ class Xa {
2720
2721
  constructor() {
2721
2722
  this.map = /* @__PURE__ */ new Map();
2722
2723
  }
@@ -2734,18 +2735,18 @@ class Ja {
2734
2735
  return this.map.get(t);
2735
2736
  }
2736
2737
  }
2737
- let Kr = new Ja(), Xa = !0;
2738
+ let Kr = new Xa(), Za = !0;
2738
2739
  try {
2739
- typeof localStorage < "u" && localStorage && (Kr = localStorage, Xa = !1);
2740
+ typeof localStorage < "u" && localStorage && (Kr = localStorage, Za = !1);
2740
2741
  } catch {
2741
2742
  }
2742
- const Za = Kr, Ee = Symbol("Equality"), Wr = (e, t) => {
2743
+ const Qa = Kr, Ee = Symbol("Equality"), Wr = (e, t) => {
2743
2744
  var n;
2744
2745
  return e === t || !!((n = e == null ? void 0 : e[Ee]) != null && n.call(e, t)) || !1;
2745
- }, Qa = (e) => typeof e == "object", th = Object.assign, Gr = Object.keys, eh = (e, t) => {
2746
+ }, th = (e) => typeof e == "object", eh = Object.assign, Yr = Object.keys, nh = (e, t) => {
2746
2747
  for (const n in e)
2747
2748
  t(e[n], n);
2748
- }, gn = (e) => Gr(e).length, nh = (e) => {
2749
+ }, gn = (e) => Yr(e).length, ih = (e) => {
2749
2750
  for (const t in e)
2750
2751
  return !1;
2751
2752
  return !0;
@@ -2754,12 +2755,12 @@ const Za = Kr, Ee = Symbol("Equality"), Wr = (e, t) => {
2754
2755
  if (!t(e[n], n))
2755
2756
  return !1;
2756
2757
  return !0;
2757
- }, Xi = (e, t) => Object.prototype.hasOwnProperty.call(e, t), ih = (e, t) => e === t || gn(e) === gn(t) && ue(e, (n, i) => (n !== void 0 || Xi(t, i)) && Wr(t[i], n)), sh = Object.freeze, Yr = (e) => {
2758
+ }, Xi = (e, t) => Object.prototype.hasOwnProperty.call(e, t), sh = (e, t) => e === t || gn(e) === gn(t) && ue(e, (n, i) => (n !== void 0 || Xi(t, i)) && Wr(t[i], n)), rh = Object.freeze, Gr = (e) => {
2758
2759
  for (const t in e) {
2759
2760
  const n = e[t];
2760
- (typeof n == "object" || typeof n == "function") && Yr(e[t]);
2761
+ (typeof n == "object" || typeof n == "function") && Gr(e[t]);
2761
2762
  }
2762
- return sh(e);
2763
+ return rh(e);
2763
2764
  }, Zi = (e, t, n = 0) => {
2764
2765
  try {
2765
2766
  for (; n < e.length; n++)
@@ -2821,9 +2822,9 @@ const Za = Kr, Ee = Symbol("Equality"), Wr = (e, t) => {
2821
2822
  return !1;
2822
2823
  }
2823
2824
  return !0;
2824
- }, rh = (e, t) => t.includes(e), ae = typeof process < "u" && process.release && /node|io\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]", qr = typeof window < "u" && typeof document < "u" && !ae;
2825
+ }, oh = (e, t) => t.includes(e), ae = typeof process < "u" && process.release && /node|io\.js/.test(process.release.name) && Object.prototype.toString.call(typeof process < "u" ? process : 0) === "[object process]", qr = typeof window < "u" && typeof document < "u" && !ae;
2825
2826
  let vt;
2826
- const oh = () => {
2827
+ const lh = () => {
2827
2828
  if (vt === void 0)
2828
2829
  if (ae) {
2829
2830
  vt = mt();
@@ -2841,14 +2842,14 @@ const oh = () => {
2841
2842
  }
2842
2843
  })) : vt = mt();
2843
2844
  return vt;
2844
- }, Si = (e) => oh().has(e), mn = (e) => Vs(ae ? process.env[e.toUpperCase().replaceAll("-", "_")] : Za.getItem(e)), Jr = (e) => Si("--" + e) || mn(e) !== null, lh = Jr("production"), ch = ae && rh(process.env.FORCE_COLOR, ["true", "1", "2"]), ah = ch || !Si("--no-colors") && // @todo deprecate --no-colors
2845
- !Jr("no-color") && (!ae || process.stdout.isTTY) && (!ae || Si("--color") || mn("COLORTERM") !== null || (mn("TERM") || "").includes("color")), hh = (e) => {
2845
+ }, Si = (e) => lh().has(e), mn = (e) => Vs(ae ? process.env[e.toUpperCase().replaceAll("-", "_")] : Qa.getItem(e)), Jr = (e) => Si("--" + e) || mn(e) !== null, ch = Jr("production"), ah = ae && oh(process.env.FORCE_COLOR, ["true", "1", "2"]), hh = ah || !Si("--no-colors") && // @todo deprecate --no-colors
2846
+ !Jr("no-color") && (!ae || process.stdout.isTTY) && (!ae || Si("--color") || mn("COLORTERM") !== null || (mn("TERM") || "").includes("color")), dh = (e) => {
2846
2847
  let t = "";
2847
2848
  for (let n = 0; n < e.byteLength; n++)
2848
2849
  t += Hr(e[n]);
2849
2850
  return btoa(t);
2850
- }, dh = (e) => Buffer.from(e.buffer, e.byteOffset, e.byteLength).toString("base64"), uh = qr ? hh : dh, fh = (e) => Ca((t) => ce(t, e));
2851
- class ph {
2851
+ }, uh = (e) => Buffer.from(e.buffer, e.byteOffset, e.byteLength).toString("base64"), fh = qr ? dh : uh, ph = (e) => _a((t) => ce(t, e));
2852
+ class gh {
2852
2853
  /**
2853
2854
  * @param {L} left
2854
2855
  * @param {R} right
@@ -2857,14 +2858,14 @@ class ph {
2857
2858
  this.left = t, this.right = n;
2858
2859
  }
2859
2860
  }
2860
- const Et = (e, t) => new ph(e, t), Hs = (e) => e.next() >= 0.5, ni = (e, t, n) => wt(e.next() * (n + 1 - t) + t), Xr = (e, t, n) => wt(e.next() * (n + 1 - t) + t), Qi = (e, t, n) => Xr(e, t, n), gh = (e) => Hr(Qi(e, 97, 122)), mh = (e, t = 0, n = 20) => {
2861
+ const Tt = (e, t) => new gh(e, t), Hs = (e) => e.next() >= 0.5, ni = (e, t, n) => wt(e.next() * (n + 1 - t) + t), Xr = (e, t, n) => wt(e.next() * (n + 1 - t) + t), Qi = (e, t, n) => Xr(e, t, n), mh = (e) => Hr(Qi(e, 97, 122)), wh = (e, t = 0, n = 20) => {
2861
2862
  const i = Qi(e, t, n);
2862
2863
  let s = "";
2863
2864
  for (let r = 0; r < i; r++)
2864
- s += gh(e);
2865
+ s += mh(e);
2865
2866
  return s;
2866
- }, ii = (e, t) => t[Qi(e, 0, t.length - 1)], wh = Symbol("0schema");
2867
- class bh {
2867
+ }, ii = (e, t) => t[Qi(e, 0, t.length - 1)], bh = Symbol("0schema");
2868
+ class yh {
2868
2869
  constructor() {
2869
2870
  this._rerrs = [];
2870
2871
  }
@@ -2881,7 +2882,7 @@ class bh {
2881
2882
  const t = [];
2882
2883
  for (let n = this._rerrs.length - 1; n > 0; n--) {
2883
2884
  const i = this._rerrs[n];
2884
- t.push(ka(" ", (this._rerrs.length - n) * 2) + `${i.path != null ? `[${i.path}] ` : ""}${i.has} doesn't match ${i.expected}. ${i.message}`);
2885
+ t.push(Ca(" ", (this._rerrs.length - n) * 2) + `${i.path != null ? `[${i.path}] ` : ""}${i.has} doesn't match ${i.expected}. ${i.message}`);
2885
2886
  }
2886
2887
  return t.join(`
2887
2888
  `);
@@ -2890,7 +2891,7 @@ class bh {
2890
2891
  const ki = (e, t) => e === t ? !0 : e == null || t == null || e.constructor !== t.constructor ? !1 : e[Ee] ? Wr(e, t) : oe(e) ? ji(
2891
2892
  e,
2892
2893
  (n) => Ki(t, (i) => ki(n, i))
2893
- ) : Qa(e) ? ue(
2894
+ ) : th(e) ? ue(
2894
2895
  e,
2895
2896
  (n, i) => ki(n, t[i])
2896
2897
  ) : !1;
@@ -2918,7 +2919,7 @@ class tt {
2918
2919
  equals(t) {
2919
2920
  return this.constructor === t.constructor && cn(this.shape, t.shape);
2920
2921
  }
2921
- [wh]() {
2922
+ [bh]() {
2922
2923
  return !0;
2923
2924
  }
2924
2925
  /**
@@ -3051,7 +3052,7 @@ class es extends tt {
3051
3052
  return !i && (n == null || n.extend(null, "custom prop", t == null ? void 0 : t.constructor.name, "failed to check custom prop")), i;
3052
3053
  }
3053
3054
  }
3054
- const G = (e) => new es(e);
3055
+ const Y = (e) => new es(e);
3055
3056
  z(es);
3056
3057
  class Nn extends tt {
3057
3058
  /**
@@ -3071,13 +3072,13 @@ class Nn extends tt {
3071
3072
  return !i && (n == null || n.extend(null, this.shape.join(" | "), t.toString())), i;
3072
3073
  }
3073
3074
  }
3074
- const Un = (...e) => new Nn(e), Zr = z(Nn), yh = (
3075
+ const Un = (...e) => new Nn(e), Zr = z(Nn), xh = (
3075
3076
  /** @type {any} */
3076
3077
  RegExp.escape || /** @type {(str:string) => string} */
3077
3078
  ((e) => e.replace(/[().|&,$^[\]]/g, (t) => "\\" + t))
3078
3079
  ), Qr = (e) => {
3079
3080
  if (he.check(e))
3080
- return [yh(e)];
3081
+ return [xh(e)];
3081
3082
  if (Zr.check(e))
3082
3083
  return (
3083
3084
  /** @type {Array<string|number>} */
@@ -3091,7 +3092,7 @@ const Un = (...e) => new Nn(e), Zr = z(Nn), yh = (
3091
3092
  return e.shape.map(Qr).flat(1);
3092
3093
  Z();
3093
3094
  };
3094
- class xh extends tt {
3095
+ class vh extends tt {
3095
3096
  /**
3096
3097
  * @param {T} shape
3097
3098
  */
@@ -3108,8 +3109,8 @@ class xh extends tt {
3108
3109
  return !i && (n == null || n.extend(null, this._r.toString(), t.toString(), "String doesn't match string template.")), i;
3109
3110
  }
3110
3111
  }
3111
- z(xh);
3112
- const vh = Symbol("optional");
3112
+ z(vh);
3113
+ const Sh = Symbol("optional");
3113
3114
  class to extends tt {
3114
3115
  /**
3115
3116
  * @param {S} shape
@@ -3126,12 +3127,12 @@ class to extends tt {
3126
3127
  const i = t === void 0 || this.shape.check(t);
3127
3128
  return !i && (n == null || n.extend(null, "undefined (optional)", "()")), i;
3128
3129
  }
3129
- get [vh]() {
3130
+ get [Sh]() {
3130
3131
  return !0;
3131
3132
  }
3132
3133
  }
3133
- const Sh = z(to);
3134
- class kh extends tt {
3134
+ const kh = z(to);
3135
+ class Ch extends tt {
3135
3136
  /**
3136
3137
  * @param {any} _o
3137
3138
  * @param {ValidationError} [err]
@@ -3141,7 +3142,7 @@ class kh extends tt {
3141
3142
  return n == null || n.extend(null, "never", typeof t), !1;
3142
3143
  }
3143
3144
  }
3144
- z(kh);
3145
+ z(Ch);
3145
3146
  const In = class In extends tt {
3146
3147
  /**
3147
3148
  * @param {S} shape
@@ -3170,10 +3171,10 @@ const In = class In extends tt {
3170
3171
  };
3171
3172
  qe(In, "_dilutes", !0);
3172
3173
  let wn = In;
3173
- const Ch = (e) => (
3174
+ const _h = (e) => (
3174
3175
  /** @type {any} */
3175
3176
  new wn(e)
3176
- ), _h = z(wn), Eh = G((e) => e != null && (e.constructor === Object || e.constructor == null));
3177
+ ), Eh = z(wn), Th = Y((e) => e != null && (e.constructor === Object || e.constructor == null));
3177
3178
  class eo extends tt {
3178
3179
  /**
3179
3180
  * @param {Keys} keys
@@ -3197,7 +3198,7 @@ class eo extends tt {
3197
3198
  });
3198
3199
  }
3199
3200
  }
3200
- const no = (e, t) => new eo(e, t), Th = z(eo);
3201
+ const no = (e, t) => new eo(e, t), Dh = z(eo);
3201
3202
  class io extends tt {
3202
3203
  /**
3203
3204
  * @param {S} shape
@@ -3220,7 +3221,7 @@ class io extends tt {
3220
3221
  });
3221
3222
  }
3222
3223
  }
3223
- const Dh = (...e) => new io(e);
3224
+ const Ah = (...e) => new io(e);
3224
3225
  z(io);
3225
3226
  class so extends tt {
3226
3227
  /**
@@ -3239,7 +3240,7 @@ class so extends tt {
3239
3240
  return !i && (n == null || n.extend(null, "Array", "")), i;
3240
3241
  }
3241
3242
  }
3242
- const ro = (...e) => new so(e), Ah = z(so), Ih = G((e) => oe(e));
3243
+ const ro = (...e) => new so(e), Ih = z(so), Oh = Y((e) => oe(e));
3243
3244
  class oo extends tt {
3244
3245
  /**
3245
3246
  * @param {new (...args:any) => T} constructor
@@ -3258,15 +3259,15 @@ class oo extends tt {
3258
3259
  return !i && (n == null || n.extend(null, this.shape.name, t == null ? void 0 : t.constructor.name)), i;
3259
3260
  }
3260
3261
  }
3261
- const Oh = (e, t = null) => new oo(e, t);
3262
+ const Mh = (e, t = null) => new oo(e, t);
3262
3263
  z(oo);
3263
- const Mh = Oh(tt);
3264
- class Rh extends tt {
3264
+ const Rh = Mh(tt);
3265
+ class Nh extends tt {
3265
3266
  /**
3266
3267
  * @param {Args} args
3267
3268
  */
3268
3269
  constructor(t) {
3269
- super(), this.len = t.length - 1, this.args = Dh(...t.slice(-1)), this.res = t[this.len];
3270
+ super(), this.len = t.length - 1, this.args = Ah(...t.slice(-1)), this.res = t[this.len];
3270
3271
  }
3271
3272
  /**
3272
3273
  * @param {any} f
@@ -3278,8 +3279,8 @@ class Rh extends tt {
3278
3279
  return !i && (n == null || n.extend(null, "function", typeof t)), i;
3279
3280
  }
3280
3281
  }
3281
- const Nh = z(Rh), Uh = G((e) => typeof e == "function");
3282
- class Lh extends tt {
3282
+ const Uh = z(Nh), Lh = Y((e) => typeof e == "function");
3283
+ class Ph extends tt {
3283
3284
  /**
3284
3285
  * @param {T} v
3285
3286
  */
@@ -3296,7 +3297,7 @@ class Lh extends tt {
3296
3297
  return !i && (n == null || n.extend(null, "Intersectinon", typeof t)), i;
3297
3298
  }
3298
3299
  }
3299
- z(Lh, (e) => e.shape.length > 0);
3300
+ z(Ph, (e) => e.shape.length > 0);
3300
3301
  class Ln extends tt {
3301
3302
  /**
3302
3303
  * @param {Array<Schema<S>>} v
@@ -3318,33 +3319,33 @@ qe(Ln, "_dilutes", !0);
3318
3319
  const fe = (...e) => e.findIndex((t) => bn.check(t)) >= 0 ? fe(...e.map((t) => Te(t)).map((t) => bn.check(t) ? t.shape : [t]).flat(1)) : e.length === 1 ? e[0] : new Ln(e), bn = (
3319
3320
  /** @type {Schema<$Union<any>>} */
3320
3321
  z(Ln)
3321
- ), lo = () => !0, yn = G(lo), Ph = (
3322
+ ), lo = () => !0, yn = Y(lo), $h = (
3322
3323
  /** @type {Schema<Schema<any>>} */
3323
3324
  z(es, (e) => e.shape === lo)
3324
- ), ns = G((e) => typeof e == "bigint"), $h = (
3325
+ ), ns = Y((e) => typeof e == "bigint"), Bh = (
3325
3326
  /** @type {Schema<Schema<BigInt>>} */
3326
- G((e) => e === ns)
3327
- ), co = G((e) => typeof e == "symbol");
3328
- G((e) => e === co);
3329
- const ne = G((e) => typeof e == "number"), ao = (
3327
+ Y((e) => e === ns)
3328
+ ), co = Y((e) => typeof e == "symbol");
3329
+ Y((e) => e === co);
3330
+ const ne = Y((e) => typeof e == "number"), ao = (
3330
3331
  /** @type {Schema<Schema<number>>} */
3331
- G((e) => e === ne)
3332
- ), he = G((e) => typeof e == "string"), ho = (
3332
+ Y((e) => e === ne)
3333
+ ), he = Y((e) => typeof e == "string"), ho = (
3333
3334
  /** @type {Schema<Schema<string>>} */
3334
- G((e) => e === he)
3335
- ), Pn = G((e) => typeof e == "boolean"), Bh = (
3335
+ Y((e) => e === he)
3336
+ ), Pn = Y((e) => typeof e == "boolean"), Vh = (
3336
3337
  /** @type {Schema<Schema<Boolean>>} */
3337
- G((e) => e === Pn)
3338
+ Y((e) => e === Pn)
3338
3339
  ), uo = Un(void 0);
3339
3340
  z(Nn, (e) => e.shape.length === 1 && e.shape[0] === void 0);
3340
3341
  Un(void 0);
3341
- const $n = Un(null), Vh = (
3342
+ const $n = Un(null), Hh = (
3342
3343
  /** @type {Schema<Schema<null>>} */
3343
3344
  z(Nn, (e) => e.shape.length === 1 && e.shape[0] === null)
3344
3345
  );
3345
3346
  z(Uint8Array);
3346
3347
  z(ts, (e) => e.shape === Uint8Array);
3347
- const Hh = fe(ne, he, $n, uo, ns, Pn, co);
3348
+ const zh = fe(ne, he, $n, uo, ns, Pn, co);
3348
3349
  (() => {
3349
3350
  const e = (
3350
3351
  /** @type {$Array<$any>} */
@@ -3356,31 +3357,31 @@ const Hh = fe(ne, he, $n, uo, ns, Pn, co);
3356
3357
  return e.shape = n, t.shape.values = n, n;
3357
3358
  })();
3358
3359
  const Te = (e) => {
3359
- if (Mh.check(e))
3360
+ if (Rh.check(e))
3360
3361
  return (
3361
3362
  /** @type {any} */
3362
3363
  e
3363
3364
  );
3364
- if (Eh.check(e)) {
3365
+ if (Th.check(e)) {
3365
3366
  const t = {};
3366
3367
  for (const n in e)
3367
3368
  t[n] = Te(e[n]);
3368
3369
  return (
3369
3370
  /** @type {any} */
3370
- Ch(t)
3371
+ _h(t)
3371
3372
  );
3372
3373
  } else {
3373
- if (Ih.check(e))
3374
+ if (Oh.check(e))
3374
3375
  return (
3375
3376
  /** @type {any} */
3376
3377
  fe(...e.map(Te))
3377
3378
  );
3378
- if (Hh.check(e))
3379
+ if (zh.check(e))
3379
3380
  return (
3380
3381
  /** @type {any} */
3381
3382
  Un(e)
3382
3383
  );
3383
- if (Uh.check(e))
3384
+ if (Lh.check(e))
3384
3385
  return (
3385
3386
  /** @type {any} */
3386
3387
  z(
@@ -3390,14 +3391,14 @@ const Te = (e) => {
3390
3391
  );
3391
3392
  }
3392
3393
  Z();
3393
- }, zs = lh ? () => {
3394
+ }, zs = ch ? () => {
3394
3395
  } : (e, t) => {
3395
- const n = new bh();
3396
+ const n = new yh();
3396
3397
  if (!t.check(e, n))
3397
- throw kt(`Expected value to be of type ${t.constructor.name}.
3398
+ throw Ct(`Expected value to be of type ${t.constructor.name}.
3398
3399
  ${n.toString()}`);
3399
3400
  };
3400
- class zh {
3401
+ class Fh {
3401
3402
  /**
3402
3403
  * @param {Schema<State>} [$state]
3403
3404
  */
@@ -3435,24 +3436,24 @@ class zh {
3435
3436
  if (s.if.check(t))
3436
3437
  return s.h(t, n);
3437
3438
  }
3438
- throw kt("Unhandled pattern");
3439
+ throw Ct("Unhandled pattern");
3439
3440
  }
3440
3441
  );
3441
3442
  }
3442
3443
  }
3443
- const Fh = (e) => new zh(
3444
+ const jh = (e) => new Fh(
3444
3445
  /** @type {any} */
3445
3446
  e
3446
3447
  ), fo = (
3447
3448
  /** @type {any} */
3448
- Fh(
3449
+ jh(
3449
3450
  /** @type {Schema<prng.PRNG>} */
3450
3451
  yn
3451
- ).if(ao, (e, t) => ni(t, Ms, fn)).if(ho, (e, t) => mh(t)).if(Bh, (e, t) => Hs(t)).if($h, (e, t) => BigInt(ni(t, Ms, fn))).if(bn, (e, t) => Qt(t, ii(t, e.shape))).if(_h, (e, t) => {
3452
+ ).if(ao, (e, t) => ni(t, Ms, fn)).if(ho, (e, t) => wh(t)).if(Vh, (e, t) => Hs(t)).if(Bh, (e, t) => BigInt(ni(t, Ms, fn))).if(bn, (e, t) => Qt(t, ii(t, e.shape))).if(Eh, (e, t) => {
3452
3453
  const n = {};
3453
3454
  for (const i in e.shape) {
3454
3455
  let s = e.shape[i];
3455
- if (Sh.check(s)) {
3456
+ if (kh.check(s)) {
3456
3457
  if (Hs(t))
3457
3458
  continue;
3458
3459
  s = s.shape;
@@ -3460,15 +3461,15 @@ const Fh = (e) => new zh(
3460
3461
  n[i] = fo(s, t);
3461
3462
  }
3462
3463
  return n;
3463
- }).if(Ah, (e, t) => {
3464
+ }).if(Ih, (e, t) => {
3464
3465
  const n = [], i = Xr(t, 0, 42);
3465
3466
  for (let s = 0; s < i; s++)
3466
3467
  n.push(Qt(t, e.shape));
3467
3468
  return n;
3468
- }).if(Zr, (e, t) => ii(t, e.shape)).if(Vh, (e, t) => null).if(Nh, (e, t) => {
3469
+ }).if(Zr, (e, t) => ii(t, e.shape)).if(Hh, (e, t) => null).if(Uh, (e, t) => {
3469
3470
  const n = Qt(t, e.res);
3470
3471
  return () => n;
3471
- }).if(Ph, (e, t) => Qt(t, ii(t, [
3472
+ }).if($h, (e, t) => Qt(t, ii(t, [
3472
3473
  ne,
3473
3474
  he,
3474
3475
  $n,
@@ -3477,7 +3478,7 @@ const Fh = (e) => new zh(
3477
3478
  Pn,
3478
3479
  ro(ne),
3479
3480
  no(fe("a", "b", "c"), ne)
3480
- ]))).if(Th, (e, t) => {
3481
+ ]))).if(Dh, (e, t) => {
3481
3482
  const n = {}, i = ni(t, 0, 3);
3482
3483
  for (let s = 0; s < i; s++) {
3483
3484
  const r = Qt(t, e.shape.keys), o = Qt(t, e.shape.values);
@@ -3492,13 +3493,13 @@ const Fh = (e) => new zh(
3492
3493
  /** @type {Document} */
3493
3494
  typeof document < "u" ? document : {}
3494
3495
  );
3495
- G((e) => e.nodeType === Yh);
3496
+ Y((e) => e.nodeType === qh);
3496
3497
  typeof DOMParser < "u" && new DOMParser();
3497
- G((e) => e.nodeType === Kh);
3498
- G((e) => e.nodeType === Wh);
3499
- const jh = (e) => aa(e, (t, n) => `${n}:${t};`).join(""), Kh = Ke.ELEMENT_NODE, Wh = Ke.TEXT_NODE, Gh = Ke.DOCUMENT_NODE, Yh = Ke.DOCUMENT_FRAGMENT_NODE;
3500
- G((e) => e.nodeType === Gh);
3501
- const qh = (e) => class {
3498
+ Y((e) => e.nodeType === Wh);
3499
+ Y((e) => e.nodeType === Yh);
3500
+ const Kh = (e) => ha(e, (t, n) => `${n}:${t};`).join(""), Wh = Ke.ELEMENT_NODE, Yh = Ke.TEXT_NODE, Gh = Ke.DOCUMENT_NODE, qh = Ke.DOCUMENT_FRAGMENT_NODE;
3501
+ Y((e) => e.nodeType === Gh);
3502
+ const Jh = (e) => class {
3502
3503
  /**
3503
3504
  * @param {number} timeoutId
3504
3505
  */
@@ -3508,7 +3509,7 @@ const qh = (e) => class {
3508
3509
  destroy() {
3509
3510
  e(this._);
3510
3511
  }
3511
- }, Jh = qh(clearTimeout), po = (e, t) => new Jh(setTimeout(t, e)), Ot = Symbol, go = Ot(), mo = Ot(), Xh = Ot(), Zh = Ot(), Qh = Ot(), wo = Ot(), td = Ot(), is = Ot(), ed = Ot(), nd = (e) => {
3512
+ }, Xh = Jh(clearTimeout), po = (e, t) => new Xh(setTimeout(t, e)), Ot = Symbol, go = Ot(), mo = Ot(), Zh = Ot(), Qh = Ot(), td = Ot(), wo = Ot(), ed = Ot(), is = Ot(), nd = Ot(), id = (e) => {
3512
3513
  var s;
3513
3514
  e.length === 1 && ((s = e[0]) == null ? void 0 : s.constructor) === Function && (e = /** @type {Array<string|Symbol|Object|number>} */
3514
3515
  /** @type {[function]} */
@@ -3529,18 +3530,18 @@ const qh = (e) => class {
3529
3530
  r instanceof Symbol || n.push(r);
3530
3531
  }
3531
3532
  return n;
3532
- }, id = {
3533
- [go]: Et("font-weight", "bold"),
3534
- [mo]: Et("font-weight", "normal"),
3535
- [Xh]: Et("color", "blue"),
3536
- [Qh]: Et("color", "green"),
3537
- [Zh]: Et("color", "grey"),
3538
- [wo]: Et("color", "red"),
3539
- [td]: Et("color", "purple"),
3540
- [is]: Et("color", "orange"),
3533
+ }, sd = {
3534
+ [go]: Tt("font-weight", "bold"),
3535
+ [mo]: Tt("font-weight", "normal"),
3536
+ [Zh]: Tt("color", "blue"),
3537
+ [td]: Tt("color", "green"),
3538
+ [Qh]: Tt("color", "grey"),
3539
+ [wo]: Tt("color", "red"),
3540
+ [ed]: Tt("color", "purple"),
3541
+ [is]: Tt("color", "orange"),
3541
3542
  // not well supported in chrome when debugging node with inspector - TODO: deprecate
3542
- [ed]: Et("color", "black")
3543
- }, sd = (e) => {
3543
+ [nd]: Tt("color", "black")
3544
+ }, rd = (e) => {
3544
3545
  var o;
3545
3546
  e.length === 1 && ((o = e[0]) == null ? void 0 : o.constructor) === Function && (e = /** @type {Array<string|Symbol|Object|number>} */
3546
3547
  /** @type {[function]} */
@@ -3548,14 +3549,14 @@ const qh = (e) => class {
3548
3549
  const t = [], n = [], i = mt();
3549
3550
  let s = [], r = 0;
3550
3551
  for (; r < e.length; r++) {
3551
- const l = e[r], c = id[l];
3552
+ const l = e[r], c = sd[l];
3552
3553
  if (c !== void 0)
3553
3554
  i.set(c.left, c.right);
3554
3555
  else {
3555
3556
  if (l === void 0)
3556
3557
  break;
3557
3558
  if (l.constructor === String || l.constructor === Number) {
3558
- const a = jh(i);
3559
+ const a = Kh(i);
3559
3560
  r > 0 || a.length > 0 ? (t.push("%c" + l), n.push(a)) : t.push(l);
3560
3561
  } else
3561
3562
  break;
@@ -3566,7 +3567,7 @@ const qh = (e) => class {
3566
3567
  l instanceof Symbol || s.push(l);
3567
3568
  }
3568
3569
  return s;
3569
- }, bo = ah ? sd : nd, rd = (...e) => {
3570
+ }, bo = hh ? rd : id, od = (...e) => {
3570
3571
  console.log(...bo(e)), xo.forEach((t) => t.print(e));
3571
3572
  }, yo = (...e) => {
3572
3573
  console.warn(...bo(e)), e.unshift(is), xo.forEach((t) => t.print(e));
@@ -3579,7 +3580,7 @@ const qh = (e) => class {
3579
3580
  },
3580
3581
  // @ts-ignore
3581
3582
  next: e
3582
- }), od = (e, t) => vo(() => {
3583
+ }), ld = (e, t) => vo(() => {
3583
3584
  let n;
3584
3585
  do
3585
3586
  n = e.next();
@@ -3613,7 +3614,7 @@ const $t = (e, t, n) => t.clients.forEach((i, s) => {
3613
3614
  for (let c = 0, a = i[c]; c < i.length && a.clock < l; a = i[++c])
3614
3615
  Ao(e, r, a.clock, a.len, n);
3615
3616
  }
3616
- }), ld = (e, t) => {
3617
+ }), cd = (e, t) => {
3617
3618
  let n = 0, i = e.length - 1;
3618
3619
  for (; n <= i; ) {
3619
3620
  const s = wt((n + i) / 2), r = e[s], o = r.clock;
@@ -3627,7 +3628,7 @@ const $t = (e, t, n) => t.clients.forEach((i, s) => {
3627
3628
  return null;
3628
3629
  }, ge = (e, t) => {
3629
3630
  const n = e.clients.get(t.client);
3630
- return n !== void 0 && ld(n, t.clock) !== null;
3631
+ return n !== void 0 && cd(n, t.clock) !== null;
3631
3632
  }, ss = (e) => {
3632
3633
  e.clients.forEach((t) => {
3633
3634
  t.sort((s, r) => s.clock - r.clock);
@@ -3645,7 +3646,7 @@ const $t = (e, t, n) => t.clients.forEach((i, s) => {
3645
3646
  if (!t.clients.has(s)) {
3646
3647
  const r = i.slice();
3647
3648
  for (let o = n + 1; o < e.length; o++)
3648
- da(r, e[o].clients.get(s) || []);
3649
+ ua(r, e[o].clients.get(s) || []);
3649
3650
  t.clients.set(s, r);
3650
3651
  }
3651
3652
  });
@@ -3655,7 +3656,7 @@ const $t = (e, t, n) => t.clients.forEach((i, s) => {
3655
3656
  /** @type {Array<DeleteItem>} */
3656
3657
  []
3657
3658
  )).push(new Bn(n, i));
3658
- }, So = () => new pe(), cd = (e) => {
3659
+ }, So = () => new pe(), ad = (e) => {
3659
3660
  const t = So();
3660
3661
  return e.clients.forEach((n, i) => {
3661
3662
  const s = [];
@@ -3682,7 +3683,7 @@ const $t = (e, t, n) => t.clients.forEach((i, s) => {
3682
3683
  e.writeDsClock(o.clock), e.writeDsLen(o.len);
3683
3684
  }
3684
3685
  });
3685
- }, ad = (e) => {
3686
+ }, hd = (e) => {
3686
3687
  const t = new pe(), n = U(e.restDecoder);
3687
3688
  for (let i = 0; i < n; i++) {
3688
3689
  e.resetDsCurVal();
@@ -3723,7 +3724,7 @@ class Jt extends Br {
3723
3724
  /**
3724
3725
  * @param {DocOpts} opts configuration
3725
3726
  */
3726
- constructor({ guid: t = Ya(), collectionid: n = null, gc: i = !0, gcFilter: s = () => !0, meta: r = null, autoLoad: o = !1, shouldLoad: l = !0 } = {}) {
3727
+ constructor({ guid: t = qa(), collectionid: n = null, gc: i = !0, gcFilter: s = () => !0, meta: r = null, autoLoad: o = !1, shouldLoad: l = !0 } = {}) {
3727
3728
  super(), this.gc = i, this.gcFilter = s, this.clientID = ko(), this.guid = t, this.collectionid = n, this.share = /* @__PURE__ */ new Map(), this.store = new To(), this._transaction = null, this._transactionCleanups = [], this.subdocs = /* @__PURE__ */ new Set(), this._item = null, this.shouldLoad = l, this.autoLoad = o, this.meta = r, this.isLoaded = !1, this.isSynced = !1, this.isDestroyed = !1, this.whenLoaded = Bs((a) => {
3728
3729
  this.on("load", () => {
3729
3730
  this.isLoaded = !0, a(this);
@@ -3932,7 +3933,7 @@ class Jt extends Br {
3932
3933
  this.emit("destroyed", [!0]), this.emit("destroy", [this]), super.destroy();
3933
3934
  }
3934
3935
  }
3935
- class hd {
3936
+ class dd {
3936
3937
  /**
3937
3938
  * @param {decoding.Decoder} decoder
3938
3939
  */
@@ -3956,12 +3957,12 @@ class hd {
3956
3957
  return this.dsCurrVal += t, t;
3957
3958
  }
3958
3959
  }
3959
- class xn extends hd {
3960
+ class xn extends dd {
3960
3961
  /**
3961
3962
  * @param {decoding.Decoder} decoder
3962
3963
  */
3963
3964
  constructor(t) {
3964
- super(t), this.keys = [], U(t), this.keyClockDecoder = new ei(dt(t)), this.clientDecoder = new ln(dt(t)), this.leftClockDecoder = new ei(dt(t)), this.rightClockDecoder = new ei(dt(t)), this.infoDecoder = new $s(dt(t), _e), this.stringDecoder = new Fa(dt(t)), this.parentInfoDecoder = new $s(dt(t), _e), this.typeRefDecoder = new ln(dt(t)), this.lenDecoder = new ln(dt(t));
3965
+ super(t), this.keys = [], U(t), this.keyClockDecoder = new ei(dt(t)), this.clientDecoder = new ln(dt(t)), this.leftClockDecoder = new ei(dt(t)), this.rightClockDecoder = new ei(dt(t)), this.infoDecoder = new $s(dt(t), _e), this.stringDecoder = new ja(dt(t)), this.parentInfoDecoder = new $s(dt(t), _e), this.typeRefDecoder = new ln(dt(t)), this.lenDecoder = new ln(dt(t));
3965
3966
  }
3966
3967
  /**
3967
3968
  * @return {ID}
@@ -4052,7 +4053,7 @@ class xn extends hd {
4052
4053
  }
4053
4054
  }
4054
4055
  }
4055
- class dd {
4056
+ class ud {
4056
4057
  constructor() {
4057
4058
  this.restEncoder = je();
4058
4059
  }
@@ -4074,7 +4075,7 @@ class dd {
4074
4075
  D(this.restEncoder, t);
4075
4076
  }
4076
4077
  }
4077
- class ud extends dd {
4078
+ class fd extends ud {
4078
4079
  /**
4079
4080
  * @param {ID} id
4080
4081
  */
@@ -4151,7 +4152,7 @@ class ud extends dd {
4151
4152
  ee(this.restEncoder, t);
4152
4153
  }
4153
4154
  }
4154
- class fd {
4155
+ class pd {
4155
4156
  constructor() {
4156
4157
  this.restEncoder = je(), this.dsCurrVal = 0;
4157
4158
  }
@@ -4175,9 +4176,9 @@ class fd {
4175
4176
  t === 0 && Z(), D(this.restEncoder, t - 1), this.dsCurrVal += t;
4176
4177
  }
4177
4178
  }
4178
- class Vn extends fd {
4179
+ class Vn extends pd {
4179
4180
  constructor() {
4180
- super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new ti(), this.clientEncoder = new on(), this.leftClockEncoder = new ti(), this.rightClockEncoder = new ti(), this.infoEncoder = new Us(yi), this.stringEncoder = new Na(), this.parentInfoEncoder = new Us(yi), this.typeRefEncoder = new on(), this.lenEncoder = new on();
4181
+ super(), this.keyMap = /* @__PURE__ */ new Map(), this.keyClock = 0, this.keyClockEncoder = new ti(), this.clientEncoder = new on(), this.leftClockEncoder = new ti(), this.rightClockEncoder = new ti(), this.infoEncoder = new Us(yi), this.stringEncoder = new Ua(), this.parentInfoEncoder = new Us(yi), this.typeRefEncoder = new on(), this.lenEncoder = new on();
4181
4182
  }
4182
4183
  toUint8Array() {
4183
4184
  const t = je();
@@ -4268,7 +4269,7 @@ class Vn extends fd {
4268
4269
  n === void 0 ? (this.keyClockEncoder.write(this.keyClock++), this.stringEncoder.write(t)) : this.keyClockEncoder.write(n);
4269
4270
  }
4270
4271
  }
4271
- const pd = (e, t, n, i) => {
4272
+ const gd = (e, t, n, i) => {
4272
4273
  i = Pt(i, t[0].id.clock);
4273
4274
  const s = bt(t, i);
4274
4275
  D(e.restEncoder, t.length - s), e.writeClient(n), D(e.restEncoder, i);
@@ -4283,7 +4284,7 @@ const pd = (e, t, n, i) => {
4283
4284
  }), Hn(t).forEach((s, r) => {
4284
4285
  n.has(r) || i.set(r, 0);
4285
4286
  }), D(e.restEncoder, i.size), jt(i.entries()).sort((s, r) => r[0] - s[0]).forEach(([s, r]) => {
4286
- pd(
4287
+ gd(
4287
4288
  e,
4288
4289
  /** @type {Array<GC|Item>} */
4289
4290
  t.clients.get(s),
@@ -4291,7 +4292,7 @@ const pd = (e, t, n, i) => {
4291
4292
  r
4292
4293
  );
4293
4294
  });
4294
- }, gd = (e, t) => {
4295
+ }, md = (e, t) => {
4295
4296
  const n = mt(), i = U(e.restDecoder);
4296
4297
  for (let s = 0; s < i; s++) {
4297
4298
  const r = U(e.restDecoder), o = new Array(r), l = e.readClient();
@@ -4334,7 +4335,7 @@ const pd = (e, t, n, i) => {
4334
4335
  }
4335
4336
  }
4336
4337
  return n;
4337
- }, md = (e, t, n) => {
4338
+ }, wd = (e, t, n) => {
4338
4339
  const i = [];
4339
4340
  let s = jt(n.keys()).sort((f, g) => f - g);
4340
4341
  if (s.length === 0)
@@ -4419,10 +4420,10 @@ const pd = (e, t, n, i) => {
4419
4420
  return Co(f, l, /* @__PURE__ */ new Map()), D(f.restEncoder, 0), { missing: c, update: f.toUint8Array() };
4420
4421
  }
4421
4422
  return null;
4422
- }, wd = (e, t) => Co(e, t.doc.store, t.beforeState), bd = (e, t, n, i = new xn(e)) => R(t, (s) => {
4423
+ }, bd = (e, t) => Co(e, t.doc.store, t.beforeState), yd = (e, t, n, i = new xn(e)) => R(t, (s) => {
4423
4424
  s.local = !1;
4424
4425
  let r = !1;
4425
- const o = s.doc, l = o.store, c = gd(i, o), a = md(s, l, c), d = l.pendingStructs;
4426
+ const o = s.doc, l = o.store, c = md(i, o), a = wd(s, l, c), d = l.pendingStructs;
4426
4427
  if (d) {
4427
4428
  for (const [u, f] of d.missing)
4428
4429
  if (f < B(l, u)) {
@@ -4440,7 +4441,7 @@ const pd = (e, t, n, i) => {
4440
4441
  l.pendingStructs = a;
4441
4442
  const h = Fs(i, s, l);
4442
4443
  if (l.pendingDs) {
4443
- const u = new xn(Yi(l.pendingDs));
4444
+ const u = new xn(Gi(l.pendingDs));
4444
4445
  U(u.restDecoder);
4445
4446
  const f = Fs(u, s, l);
4446
4447
  h && f ? l.pendingDs = Zs([h, f]) : l.pendingDs = h || f;
@@ -4454,15 +4455,15 @@ const pd = (e, t, n, i) => {
4454
4455
  l.pendingStructs = null, _i(s.doc, u);
4455
4456
  }
4456
4457
  }, n, !1), _i = (e, t, n, i = xn) => {
4457
- const s = Yi(t);
4458
- bd(s, e, n, new i(s));
4458
+ const s = Gi(t);
4459
+ yd(s, e, n, new i(s));
4459
4460
  };
4460
- class yd {
4461
+ class xd {
4461
4462
  constructor() {
4462
4463
  this.l = [];
4463
4464
  }
4464
4465
  }
4465
- const js = () => new yd(), Ks = (e, t) => e.l.push(t), Ws = (e, t) => {
4466
+ const js = () => new xd(), Ks = (e, t) => e.l.push(t), Ws = (e, t) => {
4466
4467
  const n = e.l, i = n.length;
4467
4468
  e.l = n.filter((s) => t !== s), i === e.l.length && console.error("[yjs] Tried to remove event handler that doesn't exist.");
4468
4469
  }, _o = (e, t, n) => Zi(e.l, [t, n]);
@@ -4500,7 +4501,7 @@ class vn {
4500
4501
  this.type = t, this.tname = n, this.item = i, this.assoc = s;
4501
4502
  }
4502
4503
  }
4503
- class xd {
4504
+ class vd {
4504
4505
  /**
4505
4506
  * @param {AbstractType<any>} type
4506
4507
  * @param {number} index
@@ -4510,7 +4511,7 @@ class xd {
4510
4511
  this.type = t, this.index = n, this.assoc = i;
4511
4512
  }
4512
4513
  }
4513
- const vd = (e, t, n = 0) => new xd(e, t, n), tn = (e, t, n) => {
4514
+ const Sd = (e, t, n = 0) => new vd(e, t, n), tn = (e, t, n) => {
4514
4515
  let i = null, s = null;
4515
4516
  return e._item === null ? s = Ae(e) : i = E(e._item.id.client, e._item.id.clock), new vn(i, s, t, n);
4516
4517
  }, ri = (e, t, n = 0) => {
@@ -4531,19 +4532,19 @@ const vd = (e, t, n = 0) => new xd(e, t, n), tn = (e, t, n) => {
4531
4532
  i = i.right;
4532
4533
  }
4533
4534
  return tn(e, null, n);
4534
- }, Sd = (e, t) => {
4535
+ }, kd = (e, t) => {
4535
4536
  const n = se(e, t), i = t.clock - n.id.clock;
4536
4537
  return {
4537
4538
  item: n,
4538
4539
  diff: i
4539
4540
  };
4540
- }, kd = (e, t, n = !0) => {
4541
+ }, Cd = (e, t, n = !0) => {
4541
4542
  const i = t.store, s = e.item, r = e.type, o = e.tname, l = e.assoc;
4542
4543
  let c = null, a = 0;
4543
4544
  if (s !== null) {
4544
4545
  if (B(i, s.client) <= s.clock)
4545
4546
  return null;
4546
- const d = n ? Ai(i, s) : Sd(i, s), h = d.item;
4547
+ const d = n ? Ai(i, s) : kd(i, s), h = d.item;
4547
4548
  if (!(h instanceof M))
4548
4549
  return null;
4549
4550
  if (c = /** @type {AbstractType<any>} */
@@ -4568,7 +4569,7 @@ const vd = (e, t, n = 0) => new xd(e, t, n), tn = (e, t, n) => {
4568
4569
  throw Z();
4569
4570
  l >= 0 ? a = c._length : a = 0;
4570
4571
  }
4571
- return vd(c, a, e.assoc);
4572
+ return Sd(c, a, e.assoc);
4572
4573
  };
4573
4574
  class os {
4574
4575
  /**
@@ -4579,7 +4580,7 @@ class os {
4579
4580
  this.ds = t, this.sv = n;
4580
4581
  }
4581
4582
  }
4582
- const Eo = (e, t) => new os(e, t), oi = (e) => Eo(cd(e.store), Hn(e.store)), Ht = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.get(e.id.client) || 0) > e.id.clock && !ge(t.ds, e.id), Ei = (e, t) => {
4583
+ const Eo = (e, t) => new os(e, t), oi = (e) => Eo(ad(e.store), Hn(e.store)), Ht = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && (t.sv.get(e.id.client) || 0) > e.id.clock && !ge(t.ds, e.id), Ei = (e, t) => {
4583
4584
  const n = It(e.meta, Ei, Ft), i = e.doc.store;
4584
4585
  n.has(t) || (t.sv.forEach((s, r) => {
4585
4586
  s < B(i, r) && rt(e, E(r, s));
@@ -4628,12 +4629,12 @@ const Hn = (e) => {
4628
4629
  o = wt((n + i) / 2);
4629
4630
  }
4630
4631
  throw Z();
4631
- }, Cd = (e, t) => {
4632
+ }, _d = (e, t) => {
4632
4633
  const n = e.clients.get(t.client);
4633
4634
  return n[bt(n, t.clock)];
4634
4635
  }, se = (
4635
4636
  /** @type {function(StructStore,ID):Item} */
4636
- Cd
4637
+ _d
4637
4638
  ), Ti = (e, t, n) => {
4638
4639
  const i = bt(t, n), s = t[i];
4639
4640
  return s.id.clock < n && s instanceof M ? (t.splice(i + 1, 0, En(e, s, n - s.id.clock)), i + 1) : i;
@@ -4643,10 +4644,10 @@ const Hn = (e) => {
4643
4644
  e.doc.store.clients.get(t.client)
4644
4645
  );
4645
4646
  return n[Ti(e, n, t.clock)];
4646
- }, Gs = (e, t, n) => {
4647
+ }, Ys = (e, t, n) => {
4647
4648
  const i = t.clients.get(n.client), s = bt(i, n.clock), r = i[s];
4648
4649
  return n.clock !== r.id.clock + r.length - 1 && r.constructor !== ut && i.splice(s + 1, 0, En(e, r, n.clock - r.id.clock + 1)), r;
4649
- }, _d = (e, t, n) => {
4650
+ }, Ed = (e, t, n) => {
4650
4651
  const i = (
4651
4652
  /** @type {Array<GC|Item>} */
4652
4653
  e.clients.get(t.id.client)
@@ -4661,7 +4662,7 @@ const Hn = (e) => {
4661
4662
  l = t[o++], r < l.id.clock + l.length && Ti(e, t, r), s(l);
4662
4663
  while (o < t.length && t[o].id.clock < r);
4663
4664
  };
4664
- class Ed {
4665
+ class Td {
4665
4666
  /**
4666
4667
  * @param {Doc} doc
4667
4668
  * @param {any} origin
@@ -4671,7 +4672,7 @@ class Ed {
4671
4672
  this.doc = t, this.deleteSet = new pe(), this.beforeState = Hn(t.store), this.afterState = /* @__PURE__ */ new Map(), this.changed = /* @__PURE__ */ new Map(), this.changedParentTypes = /* @__PURE__ */ new Map(), this._mergeStructs = [], this.origin = n, this.meta = /* @__PURE__ */ new Map(), this.local = i, this.subdocsAdded = /* @__PURE__ */ new Set(), this.subdocsRemoved = /* @__PURE__ */ new Set(), this.subdocsLoaded = /* @__PURE__ */ new Set(), this._needFormattingCleanup = !1;
4672
4673
  }
4673
4674
  }
4674
- const Ys = (e, t) => t.deleteSet.clients.size === 0 && !ha(t.afterState, (n, i) => t.beforeState.get(i) !== n) ? !1 : (ss(t.deleteSet), wd(e, t), rs(e, t.deleteSet), !0), qs = (e, t, n) => {
4675
+ const Gs = (e, t) => t.deleteSet.clients.size === 0 && !da(t.afterState, (n, i) => t.beforeState.get(i) !== n) ? !1 : (ss(t.deleteSet), bd(e, t), rs(e, t.deleteSet), !0), qs = (e, t, n) => {
4675
4676
  const i = t._item;
4676
4677
  (i === null || i.id.clock < (e.beforeState.get(i.id.client) || 0) && !i.deleted) && It(e.changed, t, Ft).add(n);
4677
4678
  }, an = (e, t) => {
@@ -4690,7 +4691,7 @@ const Ys = (e, t) => t.deleteSet.clients.size === 0 && !ha(t.afterState, (n, i)
4690
4691
  }
4691
4692
  const r = t - s;
4692
4693
  return r && e.splice(t + 1 - r, r), r;
4693
- }, Td = (e, t, n) => {
4694
+ }, Dd = (e, t, n) => {
4694
4695
  for (const [i, s] of e.clients.entries()) {
4695
4696
  const r = (
4696
4697
  /** @type {Array<GC|Item>} */
@@ -4706,7 +4707,7 @@ const Ys = (e, t) => t.deleteSet.clients.size === 0 && !ha(t.afterState, (n, i)
4706
4707
  }
4707
4708
  }
4708
4709
  }
4709
- }, Dd = (e, t) => {
4710
+ }, Ad = (e, t) => {
4710
4711
  e.clients.forEach((n, i) => {
4711
4712
  const s = (
4712
4713
  /** @type {Array<GC|Item>} */
@@ -4738,11 +4739,11 @@ const Ys = (e, t) => t.deleteSet.clients.size === 0 && !ha(t.afterState, (n, i)
4738
4739
  _o(a._dEH, c, n);
4739
4740
  }));
4740
4741
  }), l.push(() => i.emit("afterTransaction", [n, i])), l.push(() => {
4741
- n._needFormattingCleanup && Yd(n);
4742
+ n._needFormattingCleanup && qd(n);
4742
4743
  });
4743
4744
  }), Zi(l, []);
4744
4745
  } finally {
4745
- i.gc && Td(r, s, i.gcFilter), Dd(r, s), n.afterState.forEach((d, h) => {
4746
+ i.gc && Dd(r, s, i.gcFilter), Ad(r, s), n.afterState.forEach((d, h) => {
4746
4747
  const u = n.beforeState.get(h) || 0;
4747
4748
  if (u !== d) {
4748
4749
  const f = (
@@ -4760,13 +4761,13 @@ const Ys = (e, t) => t.deleteSet.clients.size === 0 && !ha(t.afterState, (n, i)
4760
4761
  ), g = bt(f, u);
4761
4762
  g + 1 < f.length && an(f, g + 1) > 1 || g > 0 && an(f, g);
4762
4763
  }
4763
- if (!n.local && n.afterState.get(i.clientID) !== n.beforeState.get(i.clientID) && (rd(is, go, "[yjs] ", mo, wo, "Changed the client-id because another client seems to be using it."), i.clientID = ko()), i.emit("afterTransactionCleanup", [n, i]), i._observers.has("update")) {
4764
- const d = new ud();
4765
- Ys(d, n) && i.emit("update", [d.toUint8Array(), n.origin, i, n]);
4764
+ if (!n.local && n.afterState.get(i.clientID) !== n.beforeState.get(i.clientID) && (od(is, go, "[yjs] ", mo, wo, "Changed the client-id because another client seems to be using it."), i.clientID = ko()), i.emit("afterTransactionCleanup", [n, i]), i._observers.has("update")) {
4765
+ const d = new fd();
4766
+ Gs(d, n) && i.emit("update", [d.toUint8Array(), n.origin, i, n]);
4766
4767
  }
4767
4768
  if (i._observers.has("updateV2")) {
4768
4769
  const d = new Vn();
4769
- Ys(d, n) && i.emit("updateV2", [d.toUint8Array(), n.origin, i, n]);
4770
+ Gs(d, n) && i.emit("updateV2", [d.toUint8Array(), n.origin, i, n]);
4770
4771
  }
4771
4772
  const { subdocsAdded: l, subdocsLoaded: c, subdocsRemoved: a } = n;
4772
4773
  (l.size > 0 || a.size > 0 || c.size > 0) && (l.forEach((d) => {
@@ -4777,7 +4778,7 @@ const Ys = (e, t) => t.deleteSet.clients.size === 0 && !ha(t.afterState, (n, i)
4777
4778
  }, R = (e, t, n = null, i = !0) => {
4778
4779
  const s = e._transactionCleanups;
4779
4780
  let r = !1, o = null;
4780
- e._transaction === null && (r = !0, e._transaction = new Ed(e, n, i), s.push(e._transaction), s.length === 1 && e.emit("beforeAllTransactions", [e]), e.emit("beforeTransaction", [e._transaction, e]));
4781
+ e._transaction === null && (r = !0, e._transaction = new Td(e, n, i), s.push(e._transaction), s.length === 1 && e.emit("beforeAllTransactions", [e]), e.emit("beforeTransaction", [e._transaction, e]));
4781
4782
  try {
4782
4783
  o = t(e._transaction);
4783
4784
  } finally {
@@ -4788,7 +4789,7 @@ const Ys = (e, t) => t.deleteSet.clients.size === 0 && !ha(t.afterState, (n, i)
4788
4789
  }
4789
4790
  return o;
4790
4791
  };
4791
- class Ad {
4792
+ class Id {
4792
4793
  /**
4793
4794
  * @param {DeleteSet} deletions
4794
4795
  * @param {DeleteSet} insertions
@@ -4884,13 +4885,13 @@ class Oo extends Br {
4884
4885
  const k = c.beforeState.get(b) || 0, C = w - k;
4885
4886
  C > 0 && De(u, b, k, C);
4886
4887
  });
4887
- const f = qa();
4888
+ const f = Ja();
4888
4889
  let g = !1;
4889
4890
  if (this.lastChange > 0 && f - this.lastChange < this.captureTimeout && h.length > 0 && !a && !d) {
4890
4891
  const w = h[h.length - 1];
4891
4892
  w.deletions = Ci([w.deletions, c.deleteSet]), w.insertions = Ci([w.insertions, u]);
4892
4893
  } else
4893
- h.push(new Ad(c.deleteSet, u)), g = !0;
4894
+ h.push(new Id(c.deleteSet, u)), g = !0;
4894
4895
  !a && !d && (this.lastChange = f), $t(
4895
4896
  c,
4896
4897
  c.deleteSet,
@@ -5010,7 +5011,7 @@ class Oo extends Br {
5010
5011
  this.trackedOrigins.delete(this), this.doc.off("afterTransaction", this.afterTransactionHandler), super.destroy();
5011
5012
  }
5012
5013
  }
5013
- function* Id(e) {
5014
+ function* Od(e) {
5014
5015
  const t = U(e.restDecoder);
5015
5016
  for (let n = 0; n < t; n++) {
5016
5017
  const i = U(e.restDecoder), s = e.readClient();
@@ -5047,13 +5048,13 @@ function* Id(e) {
5047
5048
  }
5048
5049
  }
5049
5050
  }
5050
- class Od {
5051
+ class Md {
5051
5052
  /**
5052
5053
  * @param {UpdateDecoderV1 | UpdateDecoderV2} decoder
5053
5054
  * @param {boolean} filterSkips
5054
5055
  */
5055
5056
  constructor(t, n) {
5056
- this.gen = Id(t), this.curr = null, this.done = !1, this.filterSkips = n, this.next();
5057
+ this.gen = Od(t), this.curr = null, this.done = !1, this.filterSkips = n, this.next();
5057
5058
  }
5058
5059
  /**
5059
5060
  * @return {Item | GC | Skip |null}
@@ -5065,7 +5066,7 @@ class Od {
5065
5066
  return this.curr;
5066
5067
  }
5067
5068
  }
5068
- class Md {
5069
+ class Rd {
5069
5070
  /**
5070
5071
  * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
5071
5072
  */
@@ -5073,7 +5074,7 @@ class Md {
5073
5074
  this.currClient = 0, this.startClock = 0, this.written = 0, this.encoder = t, this.clientStructs = [];
5074
5075
  }
5075
5076
  }
5076
- const Rd = (e, t) => {
5077
+ const Nd = (e, t) => {
5077
5078
  if (e.constructor === ut) {
5078
5079
  const { client: n, clock: i } = e.id;
5079
5080
  return new ut(E(n, i + t), e.length - t);
@@ -5099,9 +5100,9 @@ const Rd = (e, t) => {
5099
5100
  }, Zs = (e, t = xn, n = Vn) => {
5100
5101
  if (e.length === 1)
5101
5102
  return e[0];
5102
- const i = e.map((d) => new t(Yi(d)));
5103
- let s = i.map((d) => new Od(d, !0)), r = null;
5104
- const o = new n(), l = new Md(o);
5103
+ const i = e.map((d) => new t(Gi(d)));
5104
+ let s = i.map((d) => new Md(d, !0)), r = null;
5105
+ const o = new n(), l = new Rd(o);
5105
5106
  for (; s = s.filter((u) => u.curr !== null), s.sort(
5106
5107
  /** @type {function(any,any):number} */
5107
5108
  (u, f) => {
@@ -5139,7 +5140,7 @@ const Rd = (e, t) => {
5139
5140
  }
5140
5141
  else {
5141
5142
  const g = r.struct.id.clock + r.struct.length - u.id.clock;
5142
- g > 0 && (r.struct.constructor === pt ? r.struct.length -= g : u = Rd(u, g)), r.struct.mergeWith(
5143
+ g > 0 && (r.struct.constructor === pt ? r.struct.length -= g : u = Nd(u, g)), r.struct.mergeWith(
5143
5144
  /** @type {any} */
5144
5145
  u
5145
5146
  ) || (xe(l, r.struct, r.offset), r = { struct: u, offset: 0 }, d.next());
@@ -5152,14 +5153,14 @@ const Rd = (e, t) => {
5152
5153
  for (let u = d.curr; u !== null && u.id.client === h && u.id.clock === r.struct.id.clock + r.struct.length && u.constructor !== pt; u = d.next())
5153
5154
  xe(l, r.struct, r.offset), r = { struct: u, offset: 0 };
5154
5155
  }
5155
- r !== null && (xe(l, r.struct, r.offset), r = null), Nd(l);
5156
- const c = i.map((d) => ad(d)), a = Ci(c);
5156
+ r !== null && (xe(l, r.struct, r.offset), r = null), Ud(l);
5157
+ const c = i.map((d) => hd(d)), a = Ci(c);
5157
5158
  return rs(o, a), o.toUint8Array();
5158
5159
  }, Mo = (e) => {
5159
5160
  e.written > 0 && (e.clientStructs.push({ written: e.written, restEncoder: gt(e.encoder.restEncoder) }), e.encoder.restEncoder = je(), e.written = 0);
5160
5161
  }, xe = (e, t, n) => {
5161
5162
  e.written > 0 && e.currClient !== t.id.client && Mo(e), e.written === 0 && (e.currClient = t.id.client, e.encoder.writeClient(t.id.client), D(e.encoder.restEncoder, t.id.clock + n)), t.write(e.encoder, n), e.written++;
5162
- }, Nd = (e) => {
5163
+ }, Ud = (e) => {
5163
5164
  Mo(e);
5164
5165
  const t = e.encoder.restEncoder;
5165
5166
  D(t, e.clientStructs.length);
@@ -5190,7 +5191,7 @@ class zn {
5190
5191
  * type === event.target // => true
5191
5192
  */
5192
5193
  get path() {
5193
- return this._path || (this._path = Ud(this.currentTarget, this.target));
5194
+ return this._path || (this._path = Ld(this.currentTarget, this.target));
5194
5195
  }
5195
5196
  /**
5196
5197
  * Check if a struct is deleted by this event.
@@ -5209,7 +5210,7 @@ class zn {
5209
5210
  get keys() {
5210
5211
  if (this._keys === null) {
5211
5212
  if (this.transaction.doc._transactionCleanups.length === 0)
5212
- throw kt(Qs);
5213
+ throw Ct(Qs);
5213
5214
  const t = /* @__PURE__ */ new Map(), n = this.target;
5214
5215
  /** @type Set<string|null> */
5215
5216
  this.transaction.changed.get(n).forEach((s) => {
@@ -5277,7 +5278,7 @@ class zn {
5277
5278
  let t = this._changes;
5278
5279
  if (t === null) {
5279
5280
  if (this.transaction.doc._transactionCleanups.length === 0)
5280
- throw kt(Qs);
5281
+ throw Ct(Qs);
5281
5282
  const n = this.target, i = Ft(), s = Ft(), r = [];
5282
5283
  if (t = {
5283
5284
  added: i,
@@ -5302,7 +5303,7 @@ class zn {
5302
5303
  );
5303
5304
  }
5304
5305
  }
5305
- const Ud = (e, t) => {
5306
+ const Ld = (e, t) => {
5306
5307
  const n = [];
5307
5308
  for (; t._item !== null && t !== e; ) {
5308
5309
  if (t._item.parentSub !== null)
@@ -5324,7 +5325,7 @@ const Ud = (e, t) => {
5324
5325
  yo("Invalid access: Add Yjs type to a document before reading data.");
5325
5326
  }, Ro = 80;
5326
5327
  let ls = 0;
5327
- class Ld {
5328
+ class Pd {
5328
5329
  /**
5329
5330
  * @param {Item} p
5330
5331
  * @param {number} index
@@ -5333,16 +5334,16 @@ class Ld {
5333
5334
  t.marker = !0, this.p = t, this.index = n, this.timestamp = ls++;
5334
5335
  }
5335
5336
  }
5336
- const Pd = (e) => {
5337
+ const $d = (e) => {
5337
5338
  e.timestamp = ls++;
5338
5339
  }, No = (e, t, n) => {
5339
5340
  e.p.marker = !1, e.p = t, t.marker = !0, e.index = n, e.timestamp = ls++;
5340
- }, $d = (e, t, n) => {
5341
+ }, Bd = (e, t, n) => {
5341
5342
  if (e.length >= Ro) {
5342
5343
  const i = e.reduce((s, r) => s.timestamp < r.timestamp ? s : r);
5343
5344
  return No(i, t, n), i;
5344
5345
  } else {
5345
- const i = new Ld(t, n);
5346
+ const i = new Pd(t, n);
5346
5347
  return e.push(i), i;
5347
5348
  }
5348
5349
  }, Fn = (e, t) => {
@@ -5350,7 +5351,7 @@ const Pd = (e) => {
5350
5351
  return null;
5351
5352
  const n = e._searchMarker.length === 0 ? null : e._searchMarker.reduce((r, o) => rn(t - r.index) < rn(t - o.index) ? r : o);
5352
5353
  let i = e._start, s = 0;
5353
- for (n !== null && (i = n.p, s = n.index, Pd(n)); i.right !== null && s < t; ) {
5354
+ for (n !== null && (i = n.p, s = n.index, $d(n)); i.right !== null && s < t; ) {
5354
5355
  if (!i.deleted && i.countable) {
5355
5356
  if (t < s + i.length)
5356
5357
  break;
@@ -5363,7 +5364,7 @@ const Pd = (e) => {
5363
5364
  for (; i.left !== null && i.left.id.client === i.id.client && i.left.id.clock + i.left.length === i.id.clock; )
5364
5365
  i = i.left, !i.deleted && i.countable && (s -= i.length);
5365
5366
  return n !== null && rn(n.index - s) < /** @type {YText|YArray<any>} */
5366
- i.parent.length / Ro ? (No(n, i, s), n) : $d(e._searchMarker, i, s);
5367
+ i.parent.length / Ro ? (No(n, i, s), n) : Bd(e._searchMarker, i, s);
5367
5368
  }, Oe = (e, t, n) => {
5368
5369
  for (let i = e.length - 1; i >= 0; i--) {
5369
5370
  const s = e[i];
@@ -5550,7 +5551,7 @@ const Uo = (e, t, n) => {
5550
5551
  return Me(e, (i, s) => {
5551
5552
  n.push(t(i, s, e));
5552
5553
  }), n;
5553
- }, Bd = (e) => {
5554
+ }, Vd = (e) => {
5554
5555
  let t = e._start, n = null, i = 0;
5555
5556
  return {
5556
5557
  [Symbol.iterator]() {
@@ -5613,7 +5614,7 @@ const Uo = (e, t, n) => {
5613
5614
  ))), s.integrate(e, 0);
5614
5615
  break;
5615
5616
  case Jt:
5616
- s = new M(E(o, B(l, o)), s, s && s.lastId, c, c && c.id, t, null, new Ge(
5617
+ s = new M(E(o, B(l, o)), s, s && s.lastId, c, c && c.id, t, null, new Ye(
5617
5618
  /** @type {Doc} */
5618
5619
  h
5619
5620
  )), s.integrate(e, 0);
@@ -5626,7 +5627,7 @@ const Uo = (e, t, n) => {
5626
5627
  }
5627
5628
  }
5628
5629
  }), d();
5629
- }, Vo = () => kt("Length exceeded!"), Ho = (e, t, n, i) => {
5630
+ }, Vo = () => Ct("Length exceeded!"), Ho = (e, t, n, i) => {
5630
5631
  if (n > t._length)
5631
5632
  throw Vo();
5632
5633
  if (n === 0)
@@ -5642,7 +5643,7 @@ const Uo = (e, t, n) => {
5642
5643
  n -= o.length;
5643
5644
  }
5644
5645
  return t._searchMarker && Oe(t._searchMarker, s, i.length), Sn(e, t, o, i);
5645
- }, Vd = (e, t, n) => {
5646
+ }, Hd = (e, t, n) => {
5646
5647
  let s = (t._searchMarker || []).reduce((r, o) => o.index > r.index ? o : r, { index: 0, p: t._start }).p;
5647
5648
  if (s)
5648
5649
  for (; s.right; )
@@ -5691,7 +5692,7 @@ const Uo = (e, t, n) => {
5691
5692
  );
5692
5693
  break;
5693
5694
  case Jt:
5694
- l = new Ge(
5695
+ l = new Ye(
5695
5696
  /** @type {Doc} */
5696
5697
  i
5697
5698
  );
@@ -5716,7 +5717,7 @@ const Uo = (e, t, n) => {
5716
5717
  e.doc ?? X();
5717
5718
  const n = e._map.get(t);
5718
5719
  return n !== void 0 && !n.deleted;
5719
- }, Hd = (e, t) => {
5720
+ }, zd = (e, t) => {
5720
5721
  const n = {};
5721
5722
  return e._map.forEach((i, s) => {
5722
5723
  let r = i;
@@ -5724,12 +5725,12 @@ const Uo = (e, t, n) => {
5724
5725
  r = r.left;
5725
5726
  r !== null && Ht(r, t) && (n[s] = r.content.getContent()[r.length - 1]);
5726
5727
  }), n;
5727
- }, en = (e) => (e.doc ?? X(), od(
5728
+ }, en = (e) => (e.doc ?? X(), ld(
5728
5729
  e._map.entries(),
5729
5730
  /** @param {any} entry */
5730
5731
  (t) => !t[1].deleted
5731
5732
  ));
5732
- class zd extends zn {
5733
+ class Fd extends zn {
5733
5734
  }
5734
5735
  class re extends W {
5735
5736
  constructor() {
@@ -5794,7 +5795,7 @@ class re extends W {
5794
5795
  * @param {Set<null|string>} parentSubs Keys changed on this type. `null` if list was modified.
5795
5796
  */
5796
5797
  _callObserver(t, n) {
5797
- super._callObserver(t, n), jn(this, t, new zd(this, t));
5798
+ super._callObserver(t, n), jn(this, t, new Fd(this, t));
5798
5799
  }
5799
5800
  /**
5800
5801
  * Inserts new content at an index.
@@ -5832,7 +5833,7 @@ class re extends W {
5832
5833
  */
5833
5834
  push(t) {
5834
5835
  this.doc !== null ? R(this.doc, (n) => {
5835
- Vd(
5836
+ Hd(
5836
5837
  n,
5837
5838
  this,
5838
5839
  /** @type {any} */
@@ -5923,17 +5924,17 @@ class re extends W {
5923
5924
  * @return {IterableIterator<T>}
5924
5925
  */
5925
5926
  [Symbol.iterator]() {
5926
- return Bd(this);
5927
+ return Vd(this);
5927
5928
  }
5928
5929
  /**
5929
5930
  * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
5930
5931
  */
5931
5932
  _write(t) {
5932
- t.writeTypeRef(fu);
5933
+ t.writeTypeRef(pu);
5933
5934
  }
5934
5935
  }
5935
- const Fd = (e) => new re();
5936
- class jd extends zn {
5936
+ const jd = (e) => new re();
5937
+ class Kd extends zn {
5937
5938
  /**
5938
5939
  * @param {YMap<T>} ymap The YArray that changed.
5939
5940
  * @param {Transaction} transaction
@@ -5995,7 +5996,7 @@ class de extends W {
5995
5996
  * @param {Set<null|string>} parentSubs Keys changed on this type. `null` if list was modified.
5996
5997
  */
5997
5998
  _callObserver(t, n) {
5998
- jn(this, t, new jd(this, t, n));
5999
+ jn(this, t, new Kd(this, t, n));
5999
6000
  }
6000
6001
  /**
6001
6002
  * Transforms this Shared Type to a JSON object.
@@ -6141,10 +6142,10 @@ class de extends W {
6141
6142
  * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
6142
6143
  */
6143
6144
  _write(t) {
6144
- t.writeTypeRef(pu);
6145
+ t.writeTypeRef(gu);
6145
6146
  }
6146
6147
  }
6147
- const Kd = (e) => new de(), Rt = (e, t) => e === t || typeof e == "object" && typeof t == "object" && e && t && ih(e, t);
6148
+ const Wd = (e) => new de(), Rt = (e, t) => e === t || typeof e == "object" && typeof t == "object" && e && t && sh(e, t);
6148
6149
  class Di {
6149
6150
  /**
6150
6151
  * @param {Item|null} left
@@ -6233,7 +6234,7 @@ const tr = (e, t, n) => {
6233
6234
  ))) break;
6234
6235
  e.forward();
6235
6236
  }
6236
- }, Go = (e, t, n, i) => {
6237
+ }, Yo = (e, t, n, i) => {
6237
6238
  const s = e.doc, r = s.clientID, o = /* @__PURE__ */ new Map();
6238
6239
  for (const l in i) {
6239
6240
  const c = i[l], a = n.currentAttributes.get(l) ?? null;
@@ -6250,7 +6251,7 @@ const tr = (e, t, n) => {
6250
6251
  });
6251
6252
  const r = e.doc, o = r.clientID;
6252
6253
  Wo(n, s);
6253
- const l = Go(e, t, n, s), c = i.constructor === String ? new yt(
6254
+ const l = Yo(e, t, n, s), c = i.constructor === String ? new yt(
6254
6255
  /** @type {string} */
6255
6256
  i
6256
6257
  ) : i instanceof W ? new xt(i) : new Xt(i);
@@ -6259,7 +6260,7 @@ const tr = (e, t, n) => {
6259
6260
  }, er = (e, t, n, i, s) => {
6260
6261
  const r = e.doc, o = r.clientID;
6261
6262
  Wo(n, s);
6262
- const l = Go(e, t, n, s);
6263
+ const l = Yo(e, t, n, s);
6263
6264
  t: for (; n.right !== null && (i > 0 || l.size > 0 && (n.right.deleted || n.right.content.constructor === H)); ) {
6264
6265
  if (!n.right.deleted)
6265
6266
  switch (n.right.content.constructor) {
@@ -6295,7 +6296,7 @@ const tr = (e, t, n) => {
6295
6296
  n.right = new M(E(o, B(r.store, o)), n.left, n.left && n.left.lastId, n.right, n.right && n.right.id, t, null, new yt(c)), n.right.integrate(e, 0), n.forward();
6296
6297
  }
6297
6298
  Ko(e, t, n, l);
6298
- }, Yo = (e, t, n, i, s) => {
6299
+ }, Go = (e, t, n, i, s) => {
6299
6300
  let r = t;
6300
6301
  const o = mt();
6301
6302
  for (; r && (!r.countable || r.deleted); ) {
@@ -6331,7 +6332,7 @@ const tr = (e, t, n) => {
6331
6332
  t.right;
6332
6333
  }
6333
6334
  return l;
6334
- }, Wd = (e, t) => {
6335
+ }, Yd = (e, t) => {
6335
6336
  for (; t && t.right && (t.right.deleted || !t.right.countable); )
6336
6337
  t = t.right;
6337
6338
  const n = /* @__PURE__ */ new Set();
@@ -6367,14 +6368,14 @@ const tr = (e, t, n) => {
6367
6368
  );
6368
6369
  break;
6369
6370
  default:
6370
- t += Yo(n, i, s, r, o), r = wi(o), i = s;
6371
+ t += Go(n, i, s, r, o), r = wi(o), i = s;
6371
6372
  break;
6372
6373
  }
6373
6374
  s = s.right;
6374
6375
  }
6375
6376
  }
6376
6377
  ), t;
6377
- }, Yd = (e) => {
6378
+ }, qd = (e) => {
6378
6379
  const t = /* @__PURE__ */ new Set(), n = e.doc;
6379
6380
  for (const [i, s] of e.afterState.entries()) {
6380
6381
  const r = e.beforeState.get(i) || 0;
@@ -6405,7 +6406,7 @@ const tr = (e, t, n) => {
6405
6406
  /** @type {YText} */
6406
6407
  s.parent
6407
6408
  );
6408
- s.content.constructor === H ? t.add(r) : Wd(i, s);
6409
+ s.content.constructor === H ? t.add(r) : Yd(i, s);
6409
6410
  });
6410
6411
  for (const s of t)
6411
6412
  Gd(s);
@@ -6423,7 +6424,7 @@ const tr = (e, t, n) => {
6423
6424
  }
6424
6425
  t.forward();
6425
6426
  }
6426
- r && Yo(e, r, t.right, s, t.currentAttributes);
6427
+ r && Go(e, r, t.right, s, t.currentAttributes);
6427
6428
  const o = (
6428
6429
  /** @type {AbstractType<any>} */
6429
6430
  /** @type {Item} */
@@ -6431,7 +6432,7 @@ const tr = (e, t, n) => {
6431
6432
  );
6432
6433
  return o._searchMarker && Oe(o._searchMarker, t.index, -i + n), t;
6433
6434
  };
6434
- class qd extends zn {
6435
+ class Jd extends zn {
6435
6436
  /**
6436
6437
  * @param {YText} ytext
6437
6438
  * @param {Transaction} transaction
@@ -6492,7 +6493,7 @@ class qd extends zn {
6492
6493
  }))), a = "";
6493
6494
  break;
6494
6495
  case "retain":
6495
- d > 0 && (f = { retain: d }, nh(c) || (f.attributes = th({}, c))), d = 0;
6496
+ d > 0 && (f = { retain: d }, ih(c) || (f.attributes = eh({}, c))), d = 0;
6496
6497
  break;
6497
6498
  }
6498
6499
  f && n.push(f), l = null;
@@ -6602,7 +6603,7 @@ class Bt extends W {
6602
6603
  */
6603
6604
  _callObserver(t, n) {
6604
6605
  super._callObserver(t, n);
6605
- const i = new qd(this, t, n);
6606
+ const i = new Jd(this, t, n);
6606
6607
  jn(this, t, i), !t.local && this._hasFormatting && (t._needFormattingCleanup = !0);
6607
6608
  }
6608
6609
  /**
@@ -6857,10 +6858,10 @@ class Bt extends W {
6857
6858
  * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
6858
6859
  */
6859
6860
  _write(t) {
6860
- t.writeTypeRef(gu);
6861
+ t.writeTypeRef(mu);
6861
6862
  }
6862
6863
  }
6863
- const Jd = (e) => new Bt();
6864
+ const Xd = (e) => new Bt();
6864
6865
  class ci {
6865
6866
  /**
6866
6867
  * @param {YXmlFragment | YXmlElement} root
@@ -7013,7 +7014,7 @@ class Kt extends W {
7013
7014
  * @param {Set<null|string>} parentSubs Keys changed on this type. `null` if list was modified.
7014
7015
  */
7015
7016
  _callObserver(t, n) {
7016
- jn(this, t, new Qd(this, n, t));
7017
+ jn(this, t, new tu(this, n, t));
7017
7018
  }
7018
7019
  /**
7019
7020
  * Get the string representation of all the children of this YXmlFragment.
@@ -7087,7 +7088,7 @@ class Kt extends W {
7087
7088
  this._prelimContent
7088
7089
  ), s = t === null ? 0 : i.findIndex((r) => r === t) + 1;
7089
7090
  if (s === 0 && t !== null)
7090
- throw kt("Reference item not found");
7091
+ throw Ct("Reference item not found");
7091
7092
  i.splice(s, 0, ...n);
7092
7093
  }
7093
7094
  }
@@ -7163,10 +7164,10 @@ class Kt extends W {
7163
7164
  * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.
7164
7165
  */
7165
7166
  _write(t) {
7166
- t.writeTypeRef(wu);
7167
+ t.writeTypeRef(bu);
7167
7168
  }
7168
7169
  }
7169
- const Xd = (e) => new Kt();
7170
+ const Zd = (e) => new Kt();
7170
7171
  class J extends Kt {
7171
7172
  constructor(t = "UNDEFINED") {
7172
7173
  super(), this.nodeName = t, this._prelimAttrs = /* @__PURE__ */ new Map();
@@ -7226,7 +7227,7 @@ class J extends Kt {
7226
7227
  */
7227
7228
  clone() {
7228
7229
  const t = new J(this.nodeName), n = this.getAttributes();
7229
- return eh(n, (i, s) => {
7230
+ return nh(n, (i, s) => {
7230
7231
  t.setAttribute(
7231
7232
  s,
7232
7233
  /** @type {any} */
@@ -7325,7 +7326,7 @@ class J extends Kt {
7325
7326
  getAttributes(t) {
7326
7327
  return (
7327
7328
  /** @type {any} */
7328
- t ? Hd(this, t) : Fo(this)
7329
+ t ? zd(this, t) : Fo(this)
7329
7330
  );
7330
7331
  }
7331
7332
  /**
@@ -7362,11 +7363,11 @@ class J extends Kt {
7362
7363
  * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.
7363
7364
  */
7364
7365
  _write(t) {
7365
- t.writeTypeRef(mu), t.writeKey(this.nodeName);
7366
+ t.writeTypeRef(wu), t.writeKey(this.nodeName);
7366
7367
  }
7367
7368
  }
7368
- const Zd = (e) => new J(e.readKey());
7369
- class Qd extends zn {
7369
+ const Qd = (e) => new J(e.readKey());
7370
+ class tu extends zn {
7370
7371
  /**
7371
7372
  * @param {YXmlElement|YXmlText|YXmlFragment} target The target on which the event is created.
7372
7373
  * @param {Set<string|null>} subs The set of changed attributes. `null` is included if the
@@ -7435,10 +7436,10 @@ class Cn extends de {
7435
7436
  * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder The encoder to write data to.
7436
7437
  */
7437
7438
  _write(t) {
7438
- t.writeTypeRef(bu), t.writeKey(this.hookName);
7439
+ t.writeTypeRef(yu), t.writeKey(this.hookName);
7439
7440
  }
7440
7441
  }
7441
- const tu = (e) => new Cn(e.readKey());
7442
+ const eu = (e) => new Cn(e.readKey());
7442
7443
  class lt extends Bt {
7443
7444
  /**
7444
7445
  * @type {YXmlElement|YXmlText|null}
@@ -7531,10 +7532,10 @@ class lt extends Bt {
7531
7532
  * @param {UpdateEncoderV1 | UpdateEncoderV2} encoder
7532
7533
  */
7533
7534
  _write(t) {
7534
- t.writeTypeRef(yu);
7535
+ t.writeTypeRef(xu);
7535
7536
  }
7536
7537
  }
7537
- const eu = (e) => new lt();
7538
+ const nu = (e) => new lt();
7538
7539
  class hs {
7539
7540
  /**
7540
7541
  * @param {ID} id
@@ -7575,7 +7576,7 @@ class hs {
7575
7576
  throw ft();
7576
7577
  }
7577
7578
  }
7578
- const nu = 0;
7579
+ const iu = 0;
7579
7580
  class ut extends hs {
7580
7581
  get deleted() {
7581
7582
  return !0;
@@ -7601,7 +7602,7 @@ class ut extends hs {
7601
7602
  * @param {number} offset
7602
7603
  */
7603
7604
  write(t, n) {
7604
- t.writeInfo(nu), t.writeLen(this.length - n);
7605
+ t.writeInfo(iu), t.writeLen(this.length - n);
7605
7606
  }
7606
7607
  /**
7607
7608
  * @param {Transaction} transaction
@@ -7687,7 +7688,7 @@ class We {
7687
7688
  return 3;
7688
7689
  }
7689
7690
  }
7690
- const iu = (e) => new We(e.readBuf());
7691
+ const su = (e) => new We(e.readBuf());
7691
7692
  class Re {
7692
7693
  /**
7693
7694
  * @param {number} len
@@ -7765,8 +7766,8 @@ class Re {
7765
7766
  return 1;
7766
7767
  }
7767
7768
  }
7768
- const su = (e) => new Re(e.readLen()), qo = (e, t) => new Jt({ guid: e, ...t, shouldLoad: t.shouldLoad || t.autoLoad || !1 });
7769
- class Ge {
7769
+ const ru = (e) => new Re(e.readLen()), qo = (e, t) => new Jt({ guid: e, ...t, shouldLoad: t.shouldLoad || t.autoLoad || !1 });
7770
+ class Ye {
7770
7771
  /**
7771
7772
  * @param {Doc} doc
7772
7773
  */
@@ -7797,7 +7798,7 @@ class Ge {
7797
7798
  * @return {ContentDoc}
7798
7799
  */
7799
7800
  copy() {
7800
- return new Ge(qo(this.doc.guid, this.opts));
7801
+ return new Ye(qo(this.doc.guid, this.opts));
7801
7802
  }
7802
7803
  /**
7803
7804
  * @param {number} offset
@@ -7845,7 +7846,7 @@ class Ge {
7845
7846
  return 9;
7846
7847
  }
7847
7848
  }
7848
- const ru = (e) => new Ge(qo(e.readString(), e.readAny()));
7849
+ const ou = (e) => new Ye(qo(e.readString(), e.readAny()));
7849
7850
  class Xt {
7850
7851
  /**
7851
7852
  * @param {Object} embed
@@ -7921,7 +7922,7 @@ class Xt {
7921
7922
  return 5;
7922
7923
  }
7923
7924
  }
7924
- const ou = (e) => new Xt(e.readJSON());
7925
+ const lu = (e) => new Xt(e.readJSON());
7925
7926
  class H {
7926
7927
  /**
7927
7928
  * @param {string} key
@@ -8003,7 +8004,7 @@ class H {
8003
8004
  return 6;
8004
8005
  }
8005
8006
  }
8006
- const lu = (e) => new H(e.readKey(), e.readJSON());
8007
+ const cu = (e) => new H(e.readKey(), e.readJSON());
8007
8008
  class _n {
8008
8009
  /**
8009
8010
  * @param {Array<any>} arr
@@ -8085,20 +8086,20 @@ class _n {
8085
8086
  return 2;
8086
8087
  }
8087
8088
  }
8088
- const cu = (e) => {
8089
+ const au = (e) => {
8089
8090
  const t = e.readLen(), n = [];
8090
8091
  for (let i = 0; i < t; i++) {
8091
8092
  const s = e.readString();
8092
8093
  s === "undefined" ? n.push(void 0) : n.push(JSON.parse(s));
8093
8094
  }
8094
8095
  return new _n(n);
8095
- }, au = mn("node_env") === "development";
8096
+ }, hu = mn("node_env") === "development";
8096
8097
  class Wt {
8097
8098
  /**
8098
8099
  * @param {Array<any>} arr
8099
8100
  */
8100
8101
  constructor(t) {
8101
- this.arr = t, au && Yr(t);
8102
+ this.arr = t, hu && Gr(t);
8102
8103
  }
8103
8104
  /**
8104
8105
  * @return {number}
@@ -8174,7 +8175,7 @@ class Wt {
8174
8175
  return 8;
8175
8176
  }
8176
8177
  }
8177
- const hu = (e) => {
8178
+ const du = (e) => {
8178
8179
  const t = e.readLen(), n = [];
8179
8180
  for (let i = 0; i < t; i++)
8180
8181
  n.push(e.readAny());
@@ -8258,15 +8259,15 @@ class yt {
8258
8259
  return 4;
8259
8260
  }
8260
8261
  }
8261
- const du = (e) => new yt(e.readString()), uu = [
8262
- Fd,
8263
- Kd,
8264
- Jd,
8265
- Zd,
8262
+ const uu = (e) => new yt(e.readString()), fu = [
8263
+ jd,
8264
+ Wd,
8266
8265
  Xd,
8267
- tu,
8268
- eu
8269
- ], fu = 0, pu = 1, gu = 2, mu = 3, wu = 4, bu = 5, yu = 6;
8266
+ Qd,
8267
+ Zd,
8268
+ eu,
8269
+ nu
8270
+ ], pu = 0, gu = 1, mu = 2, wu = 3, bu = 4, yu = 5, xu = 6;
8270
8271
  class xt {
8271
8272
  /**
8272
8273
  * @param {AbstractType<any>} type
@@ -8359,7 +8360,7 @@ class xt {
8359
8360
  return 7;
8360
8361
  }
8361
8362
  }
8362
- const xu = (e) => new xt(uu[e.readTypeRef()](e)), Ai = (e, t) => {
8363
+ const vu = (e) => new xt(fu[e.readTypeRef()](e)), Ai = (e, t) => {
8363
8364
  let n = t, i = 0, s;
8364
8365
  do
8365
8366
  i > 0 && (n = E(n.client, n.clock + i)), s = se(e, n), i = n.clock - s.id.clock, n = s.redone;
@@ -8517,7 +8518,7 @@ class M extends hs {
8517
8518
  return this.rightOrigin.client;
8518
8519
  if (this.parent && this.parent.constructor === ie && this.id.client !== this.parent.client && this.parent.clock >= B(n, this.parent.client))
8519
8520
  return this.parent.client;
8520
- if (this.origin && (this.left = Gs(t, n, this.origin), this.origin = this.left.lastId), this.rightOrigin && (this.right = rt(t, this.rightOrigin), this.rightOrigin = this.right.id), this.left && this.left.constructor === ut || this.right && this.right.constructor === ut)
8521
+ if (this.origin && (this.left = Ys(t, n, this.origin), this.origin = this.left.lastId), this.rightOrigin && (this.right = rt(t, this.rightOrigin), this.rightOrigin = this.right.id), this.left && this.left.constructor === ut || this.right && this.right.constructor === ut)
8521
8522
  this.parent = null;
8522
8523
  else if (!this.parent)
8523
8524
  this.left && this.left.constructor === M ? (this.parent = this.left.parent, this.parentSub = this.left.parentSub) : this.right && this.right.constructor === M && (this.parent = this.right.parent, this.parentSub = this.right.parentSub);
@@ -8533,7 +8534,7 @@ class M extends hs {
8533
8534
  * @param {number} offset
8534
8535
  */
8535
8536
  integrate(t, n) {
8536
- if (n > 0 && (this.id.clock += n, this.left = Gs(t, t.doc.store, E(this.id.client, this.id.clock - 1)), this.origin = this.left.lastId, this.content = this.content.splice(n), this.length -= n), this.parent) {
8537
+ if (n > 0 && (this.id.clock += n, this.left = Ys(t, t.doc.store, E(this.id.client, this.id.clock - 1)), this.origin = this.left.lastId, this.content = this.content.splice(n), this.length -= n), this.parent) {
8537
8538
  if (!this.left && (!this.right || this.right.left !== null) || this.left && this.left.right !== this.right) {
8538
8539
  let i = this.left, s;
8539
8540
  if (i !== null)
@@ -8648,7 +8649,7 @@ class M extends hs {
8648
8649
  gc(t, n) {
8649
8650
  if (!this.deleted)
8650
8651
  throw Z();
8651
- this.content.gc(t), n ? _d(t, this, new ut(this.id, this.length)) : this.content = new Re(this.length);
8652
+ this.content.gc(t), n ? Ed(t, this, new ut(this.id, this.length)) : this.content = new Re(this.length);
8652
8653
  }
8653
8654
  /**
8654
8655
  * Transform the properties of this type to binary and write it to an
@@ -8681,34 +8682,34 @@ class M extends hs {
8681
8682
  this.content.write(t, n);
8682
8683
  }
8683
8684
  }
8684
- const Xo = (e, t) => vu[t & On](e), vu = [
8685
+ const Xo = (e, t) => Su[t & On](e), Su = [
8685
8686
  () => {
8686
8687
  Z();
8687
8688
  },
8688
8689
  // GC is not ItemContent
8689
- su,
8690
+ ru,
8690
8691
  // 1
8691
- cu,
8692
+ au,
8692
8693
  // 2
8693
- iu,
8694
+ su,
8694
8695
  // 3
8695
- du,
8696
+ uu,
8696
8697
  // 4
8697
- ou,
8698
- // 5
8699
8698
  lu,
8699
+ // 5
8700
+ cu,
8700
8701
  // 6
8701
- xu,
8702
+ vu,
8702
8703
  // 7
8703
- hu,
8704
+ du,
8704
8705
  // 8
8705
- ru,
8706
+ ou,
8706
8707
  // 9
8707
8708
  () => {
8708
8709
  Z();
8709
8710
  }
8710
8711
  // 10 - Skip is not ItemContent
8711
- ], Su = 10;
8712
+ ], ku = 10;
8712
8713
  class pt extends hs {
8713
8714
  get deleted() {
8714
8715
  return !0;
@@ -8734,7 +8735,7 @@ class pt extends hs {
8734
8735
  * @param {number} offset
8735
8736
  */
8736
8737
  write(t, n) {
8737
- t.writeInfo(Su), D(t.restEncoder, this.length - n);
8738
+ t.writeInfo(ku), D(t.restEncoder, this.length - n);
8738
8739
  }
8739
8740
  /**
8740
8741
  * @param {Transaction} transaction
@@ -8751,7 +8752,7 @@ const Zo = (
8751
8752
  ), Qo = "__ $YJS$ __";
8752
8753
  Zo[Qo] === !0 && console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");
8753
8754
  Zo[Qo] = !0;
8754
- const ku = () => {
8755
+ const Cu = () => {
8755
8756
  let e = !0;
8756
8757
  return (t, n) => {
8757
8758
  if (e) {
@@ -8763,18 +8764,18 @@ const ku = () => {
8763
8764
  }
8764
8765
  } else n !== void 0 && n();
8765
8766
  };
8766
- }, Cu = /[\uD800-\uDBFF]/, _u = /[\uDC00-\uDFFF]/, Eu = (e, t) => {
8767
+ }, _u = /[\uD800-\uDBFF]/, Eu = /[\uDC00-\uDFFF]/, Tu = (e, t) => {
8767
8768
  let n = 0, i = 0;
8768
8769
  for (; n < e.length && n < t.length && e[n] === t[n]; )
8769
8770
  n++;
8770
- for (n > 0 && Cu.test(e[n - 1]) && n--; i + n < e.length && i + n < t.length && e[e.length - i - 1] === t[t.length - i - 1]; )
8771
+ for (n > 0 && _u.test(e[n - 1]) && n--; i + n < e.length && i + n < t.length && e[e.length - i - 1] === t[t.length - i - 1]; )
8771
8772
  i++;
8772
- return i > 0 && _u.test(e[e.length - i]) && i--, {
8773
+ return i > 0 && Eu.test(e[e.length - i]) && i--, {
8773
8774
  index: n,
8774
8775
  remove: e.length - n - i,
8775
8776
  insert: t.slice(n, t.length - i)
8776
8777
  };
8777
- }, Tu = Eu, St = (e, t) => e >>> t | e << 32 - t, Du = (e) => St(e, 2) ^ St(e, 13) ^ St(e, 22), Au = (e) => St(e, 6) ^ St(e, 11) ^ St(e, 25), Iu = (e) => St(e, 7) ^ St(e, 18) ^ e >>> 3, Ou = (e) => St(e, 17) ^ St(e, 19) ^ e >>> 10, Mu = new Uint32Array([
8778
+ }, Du = Tu, kt = (e, t) => e >>> t | e << 32 - t, Au = (e) => kt(e, 2) ^ kt(e, 13) ^ kt(e, 22), Iu = (e) => kt(e, 6) ^ kt(e, 11) ^ kt(e, 25), Ou = (e) => kt(e, 7) ^ kt(e, 18) ^ e >>> 3, Mu = (e) => kt(e, 17) ^ kt(e, 19) ^ e >>> 10, Ru = new Uint32Array([
8778
8779
  1116352408,
8779
8780
  1899447441,
8780
8781
  3049323471,
@@ -8839,7 +8840,7 @@ const ku = () => {
8839
8840
  2756734187,
8840
8841
  3204031479,
8841
8842
  3329325298
8842
- ]), Ru = new Uint32Array([
8843
+ ]), Nu = new Uint32Array([
8843
8844
  1779033703,
8844
8845
  3144134277,
8845
8846
  1013904242,
@@ -8849,18 +8850,18 @@ const ku = () => {
8849
8850
  528734635,
8850
8851
  1541459225
8851
8852
  ]);
8852
- class Nu {
8853
+ class Uu {
8853
8854
  constructor() {
8854
8855
  const t = new ArrayBuffer(320);
8855
- this._H = new Uint32Array(t, 0, 8), this._H.set(Ru), this._W = new Uint32Array(t, 64, 64);
8856
+ this._H = new Uint32Array(t, 0, 8), this._H.set(Nu), this._W = new Uint32Array(t, 64, 64);
8856
8857
  }
8857
8858
  _updateHash() {
8858
8859
  const t = this._H, n = this._W;
8859
8860
  for (let h = 16; h < 64; h++)
8860
- n[h] = Ou(n[h - 2]) + n[h - 7] + Iu(n[h - 15]) + n[h - 16];
8861
+ n[h] = Mu(n[h - 2]) + n[h - 7] + Ou(n[h - 15]) + n[h - 16];
8861
8862
  let i = t[0], s = t[1], r = t[2], o = t[3], l = t[4], c = t[5], a = t[6], d = t[7];
8862
8863
  for (let h = 0, u, f; h < 64; h++)
8863
- u = d + Au(l) + (l & c ^ ~l & a) + Mu[h] + n[h] >>> 0, f = Du(i) + (i & s ^ i & r ^ s & r) >>> 0, d = a, a = c, c = l, l = o + u >>> 0, o = r, r = s, s = i, i = u + f >>> 0;
8864
+ u = d + Iu(l) + (l & c ^ ~l & a) + Ru[h] + n[h] >>> 0, f = Au(i) + (i & s ^ i & r ^ s & r) >>> 0, d = a, a = c, c = l, l = o + u >>> 0, o = r, r = s, s = i, i = u + f >>> 0;
8864
8865
  t[0] += i, t[1] += s, t[2] += r, t[3] += o, t[4] += l, t[5] += c, t[6] += a, t[7] += d;
8865
8866
  }
8866
8867
  /**
@@ -8887,7 +8888,7 @@ class Nu {
8887
8888
  for (; n < t.length; s++)
8888
8889
  for (let o = 3; o >= 0 && n < t.length; o--)
8889
8890
  this._W[s] |= t[n++] << o * 8;
8890
- i || (this._W[s - (n % 4 === 0 ? 0 : 1)] |= et << (3 - n % 4) * 8), this._W[14] = t.byteLength / fa, this._W[15] = t.byteLength * 8, this._updateHash();
8891
+ i || (this._W[s - (n % 4 === 0 ? 0 : 1)] |= et << (3 - n % 4) * 8), this._W[14] = t.byteLength / pa, this._W[15] = t.byteLength * 8, this._updateHash();
8891
8892
  const r = new Uint8Array(32);
8892
8893
  for (let o = 0; o < this._H.length; o++)
8893
8894
  for (let l = 0; l < 4; l++)
@@ -8895,27 +8896,27 @@ class Nu {
8895
8896
  return r;
8896
8897
  }
8897
8898
  }
8898
- const Uu = (e) => new Nu().digest(e), L = new Ui("y-sync"), At = new Ui("y-undo");
8899
+ const Lu = (e) => new Uu().digest(e), L = new Ui("y-sync"), At = new Ui("y-undo");
8899
8900
  new Ui("yjs-cursor");
8900
- const Lu = (e) => {
8901
+ const Pu = (e) => {
8901
8902
  for (let n = 6; n < e.length; n++)
8902
8903
  e[n % 6] = e[n % 6] ^ e[n];
8903
8904
  return e.slice(0, 6);
8904
- }, Pu = (e) => uh(Lu(Uu(fh(e)))), Tn = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && /** @type {number} */
8905
- t.sv.get(e.id.client) > e.id.clock && !ge(t.ds, e.id), $u = [{ light: "#ecd44433", dark: "#ecd444" }], Bu = (e, t, n) => {
8905
+ }, $u = (e) => fh(Pu(Lu(ph(e)))), Tn = (e, t) => t === void 0 ? !e.deleted : t.sv.has(e.id.client) && /** @type {number} */
8906
+ t.sv.get(e.id.client) > e.id.clock && !ge(t.ds, e.id), Bu = [{ light: "#ecd44433", dark: "#ecd444" }], Vu = (e, t, n) => {
8906
8907
  if (!e.has(n)) {
8907
8908
  if (e.size < t.length) {
8908
8909
  const i = Ft();
8909
8910
  e.forEach((s) => i.add(s)), t = t.filter((s) => !i.has(s));
8910
8911
  }
8911
- e.set(n, Wa(t));
8912
+ e.set(n, Ya(t));
8912
8913
  }
8913
8914
  return (
8914
8915
  /** @type {ColorDef} */
8915
8916
  e.get(n)
8916
8917
  );
8917
- }, Vu = (e, {
8918
- colors: t = $u,
8918
+ }, Hu = (e, {
8919
+ colors: t = Bu,
8919
8920
  colorMapping: n = /* @__PURE__ */ new Map(),
8920
8921
  permanentUserData: i = null,
8921
8922
  onFirstRender: s = () => {
@@ -8923,7 +8924,7 @@ t.sv.get(e.id.client) > e.id.clock && !ge(t.ds, e.id), $u = [{ light: "#ecd44433
8923
8924
  mapping: r
8924
8925
  } = {}) => {
8925
8926
  let o = !1;
8926
- const l = new Fu(e, r), c = new mr({
8927
+ const l = new ju(e, r), c = new mr({
8927
8928
  props: {
8928
8929
  editable: (a) => {
8929
8930
  const d = L.getState(a);
@@ -8998,7 +8999,7 @@ t.sv.get(e.id.client) > e.id.clock && !ge(t.ds, e.id), $u = [{ light: "#ecd44433
8998
8999
  })
8999
9000
  });
9000
9001
  return c;
9001
- }, Hu = (e, t, n) => {
9002
+ }, zu = (e, t, n) => {
9002
9003
  if (t !== null && t.anchor !== null && t.head !== null)
9003
9004
  if (t.type === "all")
9004
9005
  e.setSelection(new yl(e.doc));
@@ -9009,7 +9010,7 @@ t.sv.get(e.id.client) > e.id.clock && !ge(t.ds, e.id), $u = [{ light: "#ecd44433
9009
9010
  t.anchor,
9010
9011
  n.mapping
9011
9012
  );
9012
- e.setSelection(zu(e, i));
9013
+ e.setSelection(Fu(e, i));
9013
9014
  } else {
9014
9015
  const i = Se(
9015
9016
  n.doc,
@@ -9024,7 +9025,7 @@ t.sv.get(e.id.client) > e.id.clock && !ge(t.ds, e.id), $u = [{ light: "#ecd44433
9024
9025
  );
9025
9026
  i !== null && s !== null && e.setSelection(Li.between(e.doc.resolve(i), e.doc.resolve(s)));
9026
9027
  }
9027
- }, zu = (e, t) => {
9028
+ }, Fu = (e, t) => {
9028
9029
  const n = e.doc.resolve(t);
9029
9030
  return n.nodeAfter ? xl.create(e.doc, t) : Li.near(n);
9030
9031
  }, Ii = (e, t) => ({
@@ -9043,13 +9044,13 @@ t.sv.get(e.id.client) > e.id.clock && !ge(t.ds, e.id), $u = [{ light: "#ecd44433
9043
9044
  e.mapping
9044
9045
  )
9045
9046
  });
9046
- class Fu {
9047
+ class ju {
9047
9048
  /**
9048
9049
  * @param {Y.XmlFragment} yXmlFragment The bind source
9049
9050
  * @param {ProsemirrorMapping} mapping
9050
9051
  */
9051
9052
  constructor(t, n = /* @__PURE__ */ new Map()) {
9052
- this.type = t, this.prosemirrorView = null, this.mux = ku(), this.mapping = n, this.isOMark = /* @__PURE__ */ new Map(), this._observeFunction = this._typeChanged.bind(this), this.doc = t.doc, this.beforeTransactionSelection = null, this.beforeAllTransactions = () => {
9053
+ this.type = t, this.prosemirrorView = null, this.mux = Cu(), this.mapping = n, this.isOMark = /* @__PURE__ */ new Map(), this._observeFunction = this._typeChanged.bind(this), this.doc = t.doc, this.beforeTransactionSelection = null, this.beforeAllTransactions = () => {
9053
9054
  this.beforeTransactionSelection === null && this.prosemirrorView != null && (this.beforeTransactionSelection = Ii(
9054
9055
  this,
9055
9056
  this.prosemirrorView.state
@@ -9163,7 +9164,7 @@ class Fu {
9163
9164
  return {
9164
9165
  user: f,
9165
9166
  type: h,
9166
- color: Bu(
9167
+ color: Vu(
9167
9168
  i.colorMapping,
9168
9169
  i.colors,
9169
9170
  f
@@ -9230,7 +9231,7 @@ class Fu {
9230
9231
  this.prosemirrorView.state.doc.content.size,
9231
9232
  new Je(Xe.from(r), 0, 0)
9232
9233
  );
9233
- Hu(o, this.beforeTransactionSelection, this), o = o.setMeta(L, { isChangeOrigin: !0, isUndoRedoOperation: n.origin instanceof Oo }), this.beforeTransactionSelection !== null && this._isLocalCursorInView() && o.scrollIntoView(), this.prosemirrorView.dispatch(o);
9234
+ zu(o, this.beforeTransactionSelection, this), o = o.setMeta(L, { isChangeOrigin: !0, isUndoRedoOperation: n.origin instanceof Oo }), this.beforeTransactionSelection !== null && this._isLocalCursorInView() && o.scrollIntoView(), this.prosemirrorView.dispatch(o);
9234
9235
  });
9235
9236
  }
9236
9237
  /**
@@ -9297,7 +9298,7 @@ const tl = (e, t, n, i, s, r) => {
9297
9298
  ]), h.doc.transact((f) => {
9298
9299
  h._item.delete(f);
9299
9300
  }));
9300
- const u = ju(
9301
+ const u = Ku(
9301
9302
  c,
9302
9303
  t,
9303
9304
  n,
@@ -9337,12 +9338,12 @@ const tl = (e, t, n, i, s, r) => {
9337
9338
  e._item.delete(a);
9338
9339
  }, L), n.mapping.delete(e), null;
9339
9340
  }
9340
- }, ju = (e, t, n, i, s, r) => {
9341
+ }, Ku = (e, t, n, i, s, r) => {
9341
9342
  const o = [], l = e.toDelta(i, s, r);
9342
9343
  try {
9343
9344
  for (let c = 0; c < l.length; c++) {
9344
9345
  const a = l[c];
9345
- o.push(t.text(a.insert, Ju(a.attributes, t)));
9346
+ o.push(t.text(a.insert, Xu(a.attributes, t)));
9346
9347
  }
9347
9348
  } catch {
9348
9349
  return e.doc.transact((a) => {
@@ -9350,14 +9351,14 @@ const tl = (e, t, n, i, s, r) => {
9350
9351
  }, L), null;
9351
9352
  }
9352
9353
  return o;
9353
- }, Ku = (e, t) => {
9354
+ }, Wu = (e, t) => {
9354
9355
  const n = new lt(), i = e.map((s) => ({
9355
9356
  // @ts-ignore
9356
9357
  insert: s.text,
9357
9358
  attributes: nl(s.marks, t)
9358
9359
  }));
9359
9360
  return n.applyDelta(i), t.mapping.set(n, e), n;
9360
- }, Wu = (e, t) => {
9361
+ }, Yu = (e, t) => {
9361
9362
  const n = new J(e.type.name);
9362
9363
  for (const i in e.attrs) {
9363
9364
  const s = e.attrs[i];
@@ -9369,7 +9370,7 @@ const tl = (e, t, n, i, s, r) => {
9369
9370
  (i) => Oi(i, t)
9370
9371
  )
9371
9372
  ), t.mapping.set(n, e), n;
9372
- }, Oi = (e, t) => e instanceof Array ? Ku(e, t) : Wu(e, t), sr = (e) => typeof e == "object" && e !== null, us = (e, t) => {
9373
+ }, Oi = (e, t) => e instanceof Array ? Wu(e, t) : Yu(e, t), sr = (e) => typeof e == "object" && e !== null, us = (e, t) => {
9373
9374
  const n = Object.keys(e).filter((s) => e[s] !== null);
9374
9375
  let i = n.length === Object.keys(t).filter((s) => t[s] !== null).length;
9375
9376
  for (let s = 0; s < n.length && i; s++) {
@@ -9395,7 +9396,7 @@ const tl = (e, t, n, i, s, r) => {
9395
9396
  return n.length === t.length && n.every(
9396
9397
  /** @type {(d:any,i:number) => boolean} */
9397
9398
  (i, s) => i.insert === /** @type {any} */
9398
- t[s].text && Gr(i.attributes || {}).length === t[s].marks.length && ue(i.attributes, (r, o) => {
9399
+ t[s].text && Yr(i.attributes || {}).length === t[s].marks.length && ue(i.attributes, (r, o) => {
9399
9400
  var d;
9400
9401
  const l = fs(o), c = t[s].marks;
9401
9402
  return c.find(
@@ -9447,7 +9448,7 @@ const tl = (e, t, n, i, s, r) => {
9447
9448
  str: t,
9448
9449
  nAttrs: i
9449
9450
  };
9450
- }, Yu = (e, t, n) => {
9451
+ }, qu = (e, t, n) => {
9451
9452
  n.mapping.set(e, t);
9452
9453
  const { nAttrs: i, str: s } = Gu(e), r = t.map((a) => ({
9453
9454
  insert: (
@@ -9455,17 +9456,17 @@ const tl = (e, t, n, i, s, r) => {
9455
9456
  a.text
9456
9457
  ),
9457
9458
  attributes: Object.assign({}, i, nl(a.marks, n))
9458
- })), { insert: o, remove: l, index: c } = Tu(
9459
+ })), { insert: o, remove: l, index: c } = Du(
9459
9460
  s,
9460
9461
  r.map((a) => a.insert).join("")
9461
9462
  );
9462
9463
  e.delete(c, l), e.insert(c, o), e.applyDelta(
9463
9464
  r.map((a) => ({ retain: a.insert.length, attributes: a.attributes }))
9464
9465
  );
9465
- }, qu = /(.*)(--[a-zA-Z0-9+/=]{8})$/, fs = (e) => {
9466
+ }, Ju = /(.*)(--[a-zA-Z0-9+/=]{8})$/, fs = (e) => {
9466
9467
  var t;
9467
- return ((t = qu.exec(e)) == null ? void 0 : t[1]) ?? e;
9468
- }, Ju = (e, t) => {
9468
+ return ((t = Ju.exec(e)) == null ? void 0 : t[1]) ?? e;
9469
+ }, Xu = (e, t) => {
9469
9470
  const n = [];
9470
9471
  for (const i in e)
9471
9472
  n.push(t.mark(fs(i), e[i]));
@@ -9475,7 +9476,7 @@ const tl = (e, t, n, i, s, r) => {
9475
9476
  return e.forEach((i) => {
9476
9477
  if (i.type.name !== "ychange") {
9477
9478
  const s = It(t.isOMark, i.type, () => !i.type.excludes(i.type));
9478
- n[s ? `${i.type.name}--${Pu(i.toJSON())}` : i.type.name] = i.attrs;
9479
+ n[s ? `${i.type.name}--${$u(i.toJSON())}` : i.type.name] = i.attrs;
9479
9480
  }
9480
9481
  }), n;
9481
9482
  }, Mi = (e, t, n, i) => {
@@ -9510,7 +9511,7 @@ const tl = (e, t, n, i, s, r) => {
9510
9511
  for (; l - a - d > 0 && r - a - d > 0; ) {
9511
9512
  const u = o[a], f = s[a], g = o[l - d - 1], m = s[r - d - 1];
9512
9513
  if (u instanceof lt && f instanceof Array)
9513
- el(u, f) || Yu(u, f, i), a += 1;
9514
+ el(u, f) || qu(u, f, i), a += 1;
9514
9515
  else {
9515
9516
  let w = u instanceof J && Ri(u, f), b = g instanceof J && Ri(g, m);
9516
9517
  if (w && b) {
@@ -9612,14 +9613,14 @@ const tl = (e, t, n, i, s, r) => {
9612
9613
  if (i === null)
9613
9614
  throw Z();
9614
9615
  if (e === 0 && i.constructor !== lt && i !== t)
9615
- return Xu(i._item.parent, i._item);
9616
+ return Zu(i._item.parent, i._item);
9616
9617
  }
9617
9618
  return ri(t, t._length, -1);
9618
- }, Xu = (e, t) => {
9619
+ }, Zu = (e, t) => {
9619
9620
  let n = null, i = null;
9620
9621
  return e._item === null ? i = Ae(e) : n = E(e._item.id.client, e._item.id.clock), new vn(n, i, t.id);
9621
9622
  }, Se = (e, t, n, i) => {
9622
- const s = kd(n, e);
9623
+ const s = Cd(n, e);
9623
9624
  if (s === null || s.type !== t && !Ie(t, s.type._item))
9624
9625
  return null;
9625
9626
  let r = s.type, o = 0;
@@ -9665,7 +9666,7 @@ const tl = (e, t, n, i, s, r) => {
9665
9666
  }
9666
9667
  return o - 1;
9667
9668
  };
9668
- function Zu(e) {
9669
+ function Qu(e) {
9669
9670
  const t = e.toArray(), n = (i) => {
9670
9671
  let s;
9671
9672
  if (i instanceof lt)
@@ -9701,21 +9702,21 @@ function Zu(e) {
9701
9702
  content: t.map(n)
9702
9703
  };
9703
9704
  }
9704
- const Qu = (e) => {
9705
+ const tf = (e) => {
9705
9706
  const t = At.getState(e).undoManager;
9706
9707
  if (t != null)
9707
9708
  return t.undo(), !0;
9708
- }, tf = (e) => {
9709
+ }, ef = (e) => {
9709
9710
  const t = At.getState(e).undoManager;
9710
9711
  if (t != null)
9711
9712
  return t.redo(), !0;
9712
- }, ef = /* @__PURE__ */ new Set(["paragraph"]), nf = (e, t) => !(e instanceof M) || !(e.content instanceof xt) || !(e.content.type instanceof Bt || e.content.type instanceof J && t.has(e.content.type.nodeName)) || e.content.type._length === 0, sf = ({ protectedNodes: e = ef, trackedOrigins: t = [], undoManager: n = null } = {}) => new mr({
9713
+ }, nf = /* @__PURE__ */ new Set(["paragraph"]), sf = (e, t) => !(e instanceof M) || !(e.content instanceof xt) || !(e.content.type instanceof Bt || e.content.type instanceof J && t.has(e.content.type.nodeName)) || e.content.type._length === 0, rf = ({ protectedNodes: e = nf, trackedOrigins: t = [], undoManager: n = null } = {}) => new mr({
9713
9714
  key: At,
9714
9715
  state: {
9715
9716
  init: (i, s) => {
9716
9717
  const r = L.getState(s), o = n || new Oo(r.type, {
9717
9718
  trackedOrigins: new Set([L].concat(t)),
9718
- deleteFilter: (l) => nf(l, e),
9719
+ deleteFilter: (l) => sf(l, e),
9719
9720
  captureTransaction: (l) => l.meta.get("addToHistory") !== !1
9720
9721
  });
9721
9722
  return {
@@ -9759,7 +9760,7 @@ const Qu = (e) => {
9759
9760
  function il(e) {
9760
9761
  return !!e.getMeta(L);
9761
9762
  }
9762
- function rf(e, t) {
9763
+ function of(e, t) {
9763
9764
  const n = L.getState(e);
9764
9765
  return Se(n.doc, n.type, t, n.binding.mapping) || 0;
9765
9766
  }
@@ -9787,14 +9788,14 @@ var dn = class rl extends Sl {
9787
9788
  };
9788
9789
  }
9789
9790
  };
9790
- function of(e, t) {
9791
+ function lf(e, t) {
9791
9792
  const n = sl(t, e);
9792
9793
  return new dn(e, n);
9793
9794
  }
9794
- function lf(e, t, n) {
9795
+ function cf(e, t, n) {
9795
9796
  const i = e instanceof dn ? e.yRelativePosition : null;
9796
9797
  if (il(t) && i) {
9797
- const o = rf(n, i);
9798
+ const o = of(n, i);
9798
9799
  return {
9799
9800
  position: new dn(o, i),
9800
9801
  mapResult: null
@@ -9831,12 +9832,12 @@ Ue.create({
9831
9832
  );
9832
9833
  },
9833
9834
  onBeforeCreate() {
9834
- this.editor.utils.getUpdatedPosition = (e, t) => lf(e, t, this.editor.state), this.editor.utils.createMappablePosition = (e) => of(e, this.editor.state);
9835
+ this.editor.utils.getUpdatedPosition = (e, t) => cf(e, t, this.editor.state), this.editor.utils.createMappablePosition = (e) => lf(e, this.editor.state);
9835
9836
  },
9836
9837
  addCommands() {
9837
9838
  return {
9838
- undo: () => ({ tr: e, state: t, dispatch: n }) => (e.setMeta("preventDispatch", !0), At.getState(t).undoManager.undoStack.length === 0 ? !1 : n ? Qu(t) : !0),
9839
- redo: () => ({ tr: e, state: t, dispatch: n }) => (e.setMeta("preventDispatch", !0), At.getState(t).undoManager.redoStack.length === 0 ? !1 : n ? tf(t) : !0)
9839
+ undo: () => ({ tr: e, state: t, dispatch: n }) => (e.setMeta("preventDispatch", !0), At.getState(t).undoManager.undoStack.length === 0 ? !1 : n ? tf(t) : !0),
9840
+ redo: () => ({ tr: e, state: t, dispatch: n }) => (e.setMeta("preventDispatch", !0), At.getState(t).undoManager.redoStack.length === 0 ? !1 : n ? ef(t) : !0)
9840
9841
  };
9841
9842
  },
9842
9843
  addKeyboardShortcuts() {
@@ -9848,7 +9849,7 @@ Ue.create({
9848
9849
  },
9849
9850
  addProseMirrorPlugins() {
9850
9851
  var e;
9851
- const t = this.options.fragment ? this.options.fragment : this.options.document.getXmlFragment(this.options.field), n = sf(this.options.yUndoOptions), i = n.spec.view;
9852
+ const t = this.options.fragment ? this.options.fragment : this.options.document.getXmlFragment(this.options.field), n = rf(this.options.yUndoOptions), i = n.spec.view;
9852
9853
  n.spec.view = (o) => {
9853
9854
  const { undoManager: l } = At.getState(o.state);
9854
9855
  l.restore && (l.restore(), l.restore = () => {
@@ -9866,10 +9867,10 @@ Ue.create({
9866
9867
  const s = {
9867
9868
  ...this.options.ySyncOptions,
9868
9869
  onFirstRender: this.options.onFirstRender
9869
- }, r = Vu(t, s);
9870
+ }, r = Hu(t, s);
9870
9871
  return this.editor.options.enableContentCheck && ((e = t.doc) == null || e.on("beforeTransaction", () => {
9871
9872
  try {
9872
- const o = Zu(t);
9873
+ const o = Qu(t);
9873
9874
  if (o.content.length === 0)
9874
9875
  return;
9875
9876
  this.editor.schema.nodeFromJSON(o).check();
@@ -9888,7 +9889,7 @@ Ue.create({
9888
9889
  n,
9889
9890
  // Only add the filterInvalidContent plugin if content checking is enabled
9890
9891
  this.editor.options.enableContentCheck && new Pe({
9891
- key: new Gt("filterInvalidContent"),
9892
+ key: new Yt("filterInvalidContent"),
9892
9893
  filterTransaction: () => {
9893
9894
  var o;
9894
9895
  return this.storage.isDisabled !== !1 && ((o = t.doc) == null || o.destroy()), !0;
@@ -9904,7 +9905,7 @@ function or(e) {
9904
9905
  return e.forEach((i) => {
9905
9906
  const s = i.$from.pos, r = i.$from.nodeAfter;
9906
9907
  r && t.push(
9907
- Jl.node(s, s + r.nodeSize, {
9908
+ Xl.node(s, s + r.nodeSize, {
9908
9909
  class: "ProseMirror-selectednoderange"
9909
9910
  })
9910
9911
  );
@@ -9913,7 +9914,7 @@ function or(e) {
9913
9914
  function Wn(e, t, n) {
9914
9915
  const i = [], s = e.node(0);
9915
9916
  typeof n == "number" && n >= 0 || (e.sameParent(t) ? n = Math.max(0, e.sharedDepth(t.pos) - 1) : n = e.sharedDepth(t.pos));
9916
- const r = new Xl(e, t, n), o = r.depth === 0 ? 0 : s.resolve(r.start).posAtIndex(0);
9917
+ const r = new Zl(e, t, n), o = r.depth === 0 ? 0 : s.resolve(r.start).posAtIndex(0);
9917
9918
  return r.parent.forEach((l, c) => {
9918
9919
  const a = o + c, d = a + l.nodeSize;
9919
9920
  if (a < r.start || a >= r.end)
@@ -9922,7 +9923,7 @@ function Wn(e, t, n) {
9922
9923
  i.push(h);
9923
9924
  }), i;
9924
9925
  }
9925
- var cf = class ol {
9926
+ var af = class ol {
9926
9927
  constructor(t, n) {
9927
9928
  this.anchor = t, this.head = n;
9928
9929
  }
@@ -9988,7 +9989,7 @@ var cf = class ol {
9988
9989
  return new this(t.resolve(n), t.resolve(i), s, r);
9989
9990
  }
9990
9991
  getBookmark() {
9991
- return new cf(this.anchor, this.head);
9992
+ return new af(this.anchor, this.head);
9992
9993
  }
9993
9994
  };
9994
9995
  Nt.prototype.visible = !1;
@@ -10040,7 +10041,7 @@ Ue.create({
10040
10041
  let e = !1, t = !1;
10041
10042
  return [
10042
10043
  new Pe({
10043
- key: new Gt("nodeRange"),
10044
+ key: new Yt("nodeRange"),
10044
10045
  props: {
10045
10046
  attributes: () => e ? {
10046
10047
  class: "ProseMirror-noderangeselection"
@@ -10079,39 +10080,39 @@ Ue.create({
10079
10080
  ];
10080
10081
  }
10081
10082
  });
10082
- function af(e) {
10083
+ function hf(e) {
10083
10084
  let t = "";
10084
10085
  const n = getComputedStyle(e);
10085
10086
  for (let i = 0; i < n.length; i += 1)
10086
10087
  t += `${n[i]}:${n.getPropertyValue(n[i])};`;
10087
10088
  return t;
10088
10089
  }
10089
- function hf(e) {
10090
+ function df(e) {
10090
10091
  const t = e.cloneNode(!0), n = [e, ...Array.from(e.getElementsByTagName("*"))], i = [t, ...Array.from(t.getElementsByTagName("*"))];
10091
10092
  return n.forEach((s, r) => {
10092
- i[r].style.cssText = af(s);
10093
+ i[r].style.cssText = hf(s);
10093
10094
  }), t;
10094
10095
  }
10095
- var df = {
10096
+ var uf = {
10096
10097
  id: "listItemFirstChild",
10097
10098
  evaluate: ({ parent: e, isFirst: t }) => t && e && ["listItem", "taskItem"].includes(e.type.name) ? 1e3 : 0
10098
- }, uf = {
10099
+ }, ff = {
10099
10100
  id: "listWrapperDeprioritize",
10100
10101
  evaluate: ({ node: e }) => {
10101
10102
  const t = ["listItem", "taskItem"], n = e.firstChild;
10102
10103
  return n && t.includes(n.type.name) ? 1e3 : 0;
10103
10104
  }
10104
- }, ff = {
10105
+ }, pf = {
10105
10106
  id: "tableStructure",
10106
10107
  evaluate: ({ node: e, parent: t }) => ["tableRow", "tableCell", "tableHeader"].includes(e.type.name) || t && t.type.name === "tableHeader" ? 1e3 : 0
10107
- }, pf = {
10108
+ }, gf = {
10108
10109
  id: "inlineContent",
10109
10110
  evaluate: ({ node: e }) => e.isInline || e.isText ? 1e3 : 0
10110
- }, gf = [
10111
- df,
10111
+ }, mf = [
10112
10112
  uf,
10113
10113
  ff,
10114
- pf
10114
+ pf,
10115
+ gf
10115
10116
  ], lr = {
10116
10117
  edges: ["left", "top"],
10117
10118
  threshold: 12,
@@ -10120,37 +10121,37 @@ var df = {
10120
10121
  function ai(e) {
10121
10122
  return e === void 0 || e === "left" ? { ...lr } : e === "right" ? { edges: ["right", "top"], threshold: 12, strength: 500 } : e === "both" ? { edges: ["left", "right", "top"], threshold: 12, strength: 500 } : e === "none" ? { edges: [], threshold: 0, strength: 0 } : { ...lr, ...e };
10122
10123
  }
10123
- function mf(e, t, n) {
10124
+ function wf(e, t, n) {
10124
10125
  if (n.edges.length === 0)
10125
10126
  return !1;
10126
10127
  const i = t.getBoundingClientRect(), { threshold: s, edges: r } = n;
10127
10128
  return r.some((o) => o === "left" ? e.x - i.left < s : o === "right" ? i.right - e.x < s : o === "top" ? e.y - i.top < s : o === "bottom" ? i.bottom - e.y < s : !1);
10128
10129
  }
10129
- function wf(e, t, n, i) {
10130
- return !t || n.edges.length === 0 ? 0 : mf(e, t, n) ? n.strength * i : 0;
10130
+ function bf(e, t, n, i) {
10131
+ return !t || n.edges.length === 0 ? 0 : wf(e, t, n) ? n.strength * i : 0;
10131
10132
  }
10132
- var bf = 1e3;
10133
+ var yf = 1e3;
10133
10134
  function cr(e, t, n, i) {
10134
- let s = bf, r = !1;
10135
+ let s = yf, r = !1;
10135
10136
  if (t.every((l) => {
10136
10137
  const c = l.evaluate(e);
10137
10138
  return s -= c, s <= 0 ? (r = !0, !1) : !0;
10138
10139
  }), r)
10139
10140
  return -1;
10140
10141
  const o = e.view.nodeDOM(e.pos);
10141
- return s -= wf(i, o, n, e.depth), s <= 0 ? -1 : s;
10142
+ return s -= bf(i, o, n, e.depth), s <= 0 ? -1 : s;
10142
10143
  }
10143
10144
  function ar(e, t, n) {
10144
10145
  return Array.from({ length: t }, (s, r) => t - 1 - r).some((s) => n.includes(e.node(s).type.name));
10145
10146
  }
10146
- function yf(e, t, n) {
10147
+ function xf(e, t, n) {
10147
10148
  if (!Number.isFinite(t.x) || !Number.isFinite(t.y))
10148
10149
  return null;
10149
10150
  const i = e.posAtCoords({ left: t.x, top: t.y });
10150
10151
  if (!i)
10151
10152
  return null;
10152
10153
  const { doc: s } = e.state, r = s.resolve(i.pos), o = [];
10153
- n.defaultRules && o.push(...gf), o.push(...n.rules);
10154
+ n.defaultRules && o.push(...mf), o.push(...n.rules);
10154
10155
  const c = Array.from({ length: r.depth }, (h, u) => r.depth - u).map((h) => {
10155
10156
  const u = r.node(h), f = r.before(h);
10156
10157
  if (n.allowedContainers && h > 0 && !ar(r, h, n.allowedContainers))
@@ -10202,7 +10203,7 @@ function yf(e, t, n) {
10202
10203
  dom: d.dom
10203
10204
  } : null;
10204
10205
  }
10205
- function xf(e, t) {
10206
+ function vf(e, t) {
10206
10207
  let n = e;
10207
10208
  for (; n != null && n.parentElement && n.parentElement !== t.dom; )
10208
10209
  n = n.parentElement;
@@ -10211,7 +10212,7 @@ function xf(e, t) {
10211
10212
  function hr(e) {
10212
10213
  return Number.isFinite(e.top) && Number.isFinite(e.bottom) && Number.isFinite(e.left) && Number.isFinite(e.right) && e.width > 0 && e.height > 0;
10213
10214
  }
10214
- function vf(e, t, n, i = 5) {
10215
+ function Sf(e, t, n, i = 5) {
10215
10216
  if (!Number.isFinite(t) || !Number.isFinite(n))
10216
10217
  return null;
10217
10218
  const s = e.dom, r = s.firstElementChild, o = s.lastElementChild;
@@ -10227,12 +10228,12 @@ function vf(e, t, n, i = 5) {
10227
10228
  return !Number.isFinite(g) || !Number.isFinite(a) ? null : { x: g, y: a };
10228
10229
  }
10229
10230
  var ll = (e) => {
10230
- const { x: t, y: n, editor: i, nestedOptions: s } = e, { view: r, state: o } = i, l = vf(r, t, n, 5);
10231
+ const { x: t, y: n, editor: i, nestedOptions: s } = e, { view: r, state: o } = i, l = Sf(r, t, n, 5);
10231
10232
  if (!l)
10232
10233
  return { resultElement: null, resultNode: null, pos: null };
10233
10234
  const { x: c, y: a } = l;
10234
10235
  if (s != null && s.enabled) {
10235
- const g = yf(r, { x: c, y: a }, s);
10236
+ const g = xf(r, { x: c, y: a }, s);
10236
10237
  return g ? {
10237
10238
  resultElement: g.dom,
10238
10239
  resultNode: g.node,
@@ -10244,7 +10245,7 @@ var ll = (e) => {
10244
10245
  if (Array.prototype.some.call(d, (g) => {
10245
10246
  if (!r.dom.contains(g))
10246
10247
  return !1;
10247
- const m = xf(g, r);
10248
+ const m = vf(g, r);
10248
10249
  return m ? (h = m, !0) : !1;
10249
10250
  }), !h)
10250
10251
  return { resultElement: null, resultNode: null, pos: null };
@@ -10273,7 +10274,7 @@ function cl(e) {
10273
10274
  var t;
10274
10275
  (t = e.parentNode) == null || t.removeChild(e);
10275
10276
  }
10276
- function Sf(e, t, n, i) {
10277
+ function kf(e, t, n, i) {
10277
10278
  const { doc: s } = t.view.state;
10278
10279
  if (n != null && n.enabled && (i != null && i.node) && i.pos >= 0) {
10279
10280
  const a = i.pos, d = i.pos + i.node.nodeSize;
@@ -10295,17 +10296,17 @@ function Sf(e, t, n, i) {
10295
10296
  const o = r.resultNode.isText || r.resultNode.isAtom ? 0 : -1, l = s.resolve(r.pos), c = s.resolve(r.pos + r.resultNode.nodeSize + o);
10296
10297
  return Wn(l, c, 0);
10297
10298
  }
10298
- function kf(e, t, n, i) {
10299
+ function Cf(e, t, n, i) {
10299
10300
  const { view: s } = t;
10300
10301
  if (!e.dataTransfer)
10301
10302
  return;
10302
- const { empty: r, $from: o, $to: l } = s.state.selection, c = Sf(e, t, n, i), a = Wn(o, l, 0), d = a.some((I) => c.find(($) => $.$from === I.$from && $.$to === I.$to)), h = r || !d ? c : a;
10303
+ const { empty: r, $from: o, $to: l } = s.state.selection, c = kf(e, t, n, i), a = Wn(o, l, 0), d = a.some((I) => c.find(($) => $.$from === I.$from && $.$to === I.$to)), h = r || !d ? c : a;
10303
10304
  if (!h.length)
10304
10305
  return;
10305
10306
  const { tr: u } = s.state, f = document.createElement("div"), g = h[0].$from.pos, m = h[h.length - 1].$to.pos, w = (n == null ? void 0 : n.enabled) && (i == null ? void 0 : i.node);
10306
10307
  let b, k;
10307
10308
  w ? (b = s.state.doc.slice(g, m), k = di.create(s.state.doc, g)) : (k = Nt.create(s.state.doc, g, m), b = k.content()), h.forEach((I) => {
10308
- const $ = s.nodeDOM(I.$from.pos), y = hf($);
10309
+ const $ = s.nodeDOM(I.$from.pos), y = df($);
10309
10310
  f.append(y);
10310
10311
  }), f.style.position = "absolute", f.style.top = "-10000px", document.body.append(f), e.dataTransfer.clearData(), e.dataTransfer.setDragImage(f, 0, 0);
10311
10312
  const C = k instanceof di ? k : void 0;
@@ -10325,7 +10326,7 @@ var dr = (e, t) => {
10325
10326
  }, hi = (e, t) => {
10326
10327
  const n = L.getState(e);
10327
10328
  return n ? An(t, n.type, n.binding.mapping) : null;
10328
- }, Cf = (e, t) => {
10329
+ }, _f = (e, t) => {
10329
10330
  const n = L.getState(e);
10330
10331
  return n ? Se(n.doc, n.type, t, n.binding.mapping) || 0 : -1;
10331
10332
  }, fr = (e, t) => {
@@ -10333,7 +10334,7 @@ var dr = (e, t) => {
10333
10334
  for (; n != null && n.parentNode && n.parentNode !== e.dom; )
10334
10335
  n = n.parentNode;
10335
10336
  return n;
10336
- }, al = new Gt("dragHandle"), hl = ({
10337
+ }, al = new Yt("dragHandle"), hl = ({
10337
10338
  pluginKey: e = al,
10338
10339
  element: t,
10339
10340
  editor: n,
@@ -10371,7 +10372,7 @@ var dr = (e, t) => {
10371
10372
  });
10372
10373
  }
10373
10374
  function C(y) {
10374
- o == null || o(y), kf(y, n, c, { node: h, pos: u }), t && (t.dataset.dragging = "true"), setTimeout(() => {
10375
+ o == null || o(y), Cf(y, n, c, { node: h, pos: u }), t && (t.dataset.dragging = "true"), setTimeout(() => {
10375
10376
  t && (t.style.pointerEvents = "none");
10376
10377
  }, 0);
10377
10378
  }
@@ -10391,7 +10392,7 @@ var dr = (e, t) => {
10391
10392
  t.removeEventListener("dragstart", C), t.removeEventListener("dragend", I), document.removeEventListener("drop", $), g && (cancelAnimationFrame(g), g = null, m = null);
10392
10393
  },
10393
10394
  plugin: new Pe({
10394
- key: typeof e == "string" ? new Gt(e) : e,
10395
+ key: typeof e == "string" ? new Yt(e) : e,
10395
10396
  state: {
10396
10397
  init() {
10397
10398
  return { locked: !1 };
@@ -10402,11 +10403,11 @@ var dr = (e, t) => {
10402
10403
  return w(), d = !1, h = null, u = -1, r == null || r({ editor: n, node: null, pos: -1 }), S;
10403
10404
  if (y.docChanged && u !== -1 && t)
10404
10405
  if (il(y)) {
10405
- const Y = Cf(j, f);
10406
- Y !== u && (u = Y);
10406
+ const G = _f(j, f);
10407
+ G !== u && (u = G);
10407
10408
  } else {
10408
- const Y = y.mapping.map(u);
10409
- Y !== u && (u = Y, f = hi(j, u));
10409
+ const G = y.mapping.map(u);
10410
+ G !== u && (u = G, f = hi(j, u));
10410
10411
  }
10411
10412
  return S;
10412
10413
  }
@@ -10426,8 +10427,8 @@ var dr = (e, t) => {
10426
10427
  let P = y.nodeDOM(u);
10427
10428
  if (P = fr(y, P), P === y.dom || (P == null ? void 0 : P.nodeType) !== 1)
10428
10429
  return;
10429
- const V = y.posAtDOM(P, 0), Y = ur(n.state.doc, V), ct = dr(n.state.doc, V);
10430
- h = Y, u = ct, f = hi(y.state, u), r == null || r({ editor: n, node: h, pos: u }), k(P);
10430
+ const V = y.posAtDOM(P, 0), G = ur(n.state.doc, V), ct = dr(n.state.doc, V);
10431
+ h = G, u = ct, f = hi(y.state, u), r == null || r({ editor: n, node: h, pos: u }), k(P);
10431
10432
  },
10432
10433
  // TODO: Kills even on hot reload
10433
10434
  destroy() {
@@ -10457,14 +10458,14 @@ var dr = (e, t) => {
10457
10458
  });
10458
10459
  if (!P.resultElement)
10459
10460
  return;
10460
- let V = P.resultElement, Y = P.resultNode, ct = P.pos;
10461
+ let V = P.resultElement, G = P.resultNode, ct = P.pos;
10461
10462
  if (!(c != null && c.enabled)) {
10462
10463
  if (V = fr(y, V), V === y.dom || (V == null ? void 0 : V.nodeType) !== 1)
10463
10464
  return;
10464
10465
  const _ = y.posAtDOM(V, 0);
10465
- Y = ur(n.state.doc, _), ct = dr(n.state.doc, _);
10466
+ G = ur(n.state.doc, _), ct = dr(n.state.doc, _);
10466
10467
  }
10467
- Y !== h && (h = Y, u = ct ?? -1, f = hi(y.state, u), r == null || r({ editor: n, node: h, pos: u }), k(V), b());
10468
+ G !== h && (h = G, u = ct ?? -1, f = hi(y.state, u), r == null || r({ editor: n, node: h, pos: u }), k(V), b());
10468
10469
  })), !1;
10469
10470
  }
10470
10471
  }
@@ -10537,7 +10538,7 @@ Ue.create({
10537
10538
  ];
10538
10539
  }
10539
10540
  });
10540
- var _f = (e) => {
10541
+ var Ef = (e) => {
10541
10542
  const {
10542
10543
  className: t = "drag-handle",
10543
10544
  children: n,
@@ -10589,15 +10590,15 @@ var _f = (e) => {
10589
10590
  children: n
10590
10591
  }
10591
10592
  );
10592
- }, Ef = _f;
10593
- function Rp() {
10594
- var y, S, T, j, P, V, Y, ct;
10593
+ }, Tf = Ef;
10594
+ function Up() {
10595
+ var y, S, T, j, P, V, G, ct;
10595
10596
  const e = F(), t = Q(), { t: n } = q(), [i, s] = N(null), [r, o] = N(-1), [l, c] = N(!1), a = (S = (y = e == null ? void 0 : e.extensionManager) == null ? void 0 : y.extensions) == null ? void 0 : S.some(
10596
- (_) => (_ == null ? void 0 : _.name) === rc.name
10597
+ (_) => (_ == null ? void 0 : _.name) === nc.name
10597
10598
  ), d = (j = (T = e == null ? void 0 : e.extensionManager) == null ? void 0 : T.extensions) == null ? void 0 : j.some(
10598
- (_) => (_ == null ? void 0 : _.name) === ic.name
10599
+ (_) => (_ == null ? void 0 : _.name) === tc.name
10599
10600
  ), h = (V = (P = e == null ? void 0 : e.extensionManager) == null ? void 0 : P.extensions) == null ? void 0 : V.some(
10600
- (_) => (_ == null ? void 0 : _.name) === nc.name
10601
+ (_) => (_ == null ? void 0 : _.name) === Ql.name
10601
10602
  );
10602
10603
  function u() {
10603
10604
  const _ = e.chain();
@@ -10608,18 +10609,18 @@ function Rp() {
10608
10609
  }
10609
10610
  function g() {
10610
10611
  e.commands.setNodeSelection(r);
10611
- const { $anchor: _ } = e.state.selection, Ct = _.node(1) || e.state.selection.node;
10612
- e.chain().setMeta("hideDragHandle", !0).insertContentAt(r + ((i == null ? void 0 : i.nodeSize) || 0), Ct.toJSON()).run();
10612
+ const { $anchor: _ } = e.state.selection, _t = _.node(1) || e.state.selection.node;
10613
+ e.chain().setMeta("hideDragHandle", !0).insertContentAt(r + ((i == null ? void 0 : i.nodeSize) || 0), _t.toJSON()).run();
10613
10614
  }
10614
10615
  function m(_) {
10615
10616
  e.commands.setTextAlign(_);
10616
10617
  }
10617
10618
  function w() {
10618
- const _ = Es(e.state.tr, r, 1);
10619
+ const _ = Ss(e.state.tr, r, 1);
10619
10620
  _.setMeta("hideDragHandle", !0), e.view.dispatch && e.view.dispatch(_);
10620
10621
  }
10621
10622
  function b() {
10622
- const _ = Es(e.state.tr, r, -1);
10623
+ const _ = Ss(e.state.tr, r, -1);
10623
10624
  e.view.dispatch && e.view.dispatch(_);
10624
10625
  }
10625
10626
  function k() {
@@ -10633,13 +10634,13 @@ function Rp() {
10633
10634
  },
10634
10635
  []
10635
10636
  ), I = (_) => {
10636
- var Ct;
10637
+ var _t;
10637
10638
  if (_.preventDefault(), r !== -1) {
10638
- const Ye = (i == null ? void 0 : i.nodeSize) || 0, Zt = r + Ye, ps = (i == null ? void 0 : i.type.name) === "paragraph" && ((Ct = i == null ? void 0 : i.content) == null ? void 0 : Ct.size) === 0, ul = ps ? r + 2 : Zt + 2;
10639
- e.chain().command(({ dispatch: gs, tr: Gn, state: ms }) => gs ? (ps ? Gn.insertText("/", r, r + 1) : Gn.insert(
10639
+ const Ge = (i == null ? void 0 : i.nodeSize) || 0, Zt = r + Ge, ps = (i == null ? void 0 : i.type.name) === "paragraph" && ((_t = i == null ? void 0 : i.content) == null ? void 0 : _t.size) === 0, ul = ps ? r + 2 : Zt + 2;
10640
+ e.chain().command(({ dispatch: gs, tr: Yn, state: ms }) => gs ? (ps ? Yn.insertText("/", r, r + 1) : Yn.insert(
10640
10641
  Zt,
10641
10642
  ms.schema.nodes.paragraph.create(null, [ms.schema.text("/")])
10642
- ), gs(Gn)) : !0).focus(ul).run();
10643
+ ), gs(Yn)) : !0).focus(ul).run();
10643
10644
  }
10644
10645
  };
10645
10646
  nt(() => (l ? e.commands.setMeta("lockDragHandle", !0) : e.commands.setMeta("lockDragHandle", !1), () => {
@@ -10649,7 +10650,7 @@ function Rp() {
10649
10650
  t && c(_);
10650
10651
  };
10651
10652
  return /* @__PURE__ */ p(
10652
- Ef,
10653
+ Tf,
10653
10654
  {
10654
10655
  className: "richtext-transition-all richtext-duration-200 richtext-ease-out",
10655
10656
  editor: e,
@@ -10668,10 +10669,10 @@ function Rp() {
10668
10669
  }
10669
10670
  }
10670
10671
  ),
10671
- /* @__PURE__ */ x(Zl, { onOpenChange: $, open: l, children: [
10672
- /* @__PURE__ */ p(Ql, { className: "richtext-pointer-events-none" }),
10672
+ /* @__PURE__ */ x(ic, { onOpenChange: $, open: l, children: [
10673
+ /* @__PURE__ */ p(sc, { className: "richtext-pointer-events-none" }),
10673
10674
  /* @__PURE__ */ x(
10674
- tc,
10675
+ rc,
10675
10676
  {
10676
10677
  align: "start",
10677
10678
  className: "richtext-w-48",
@@ -10680,7 +10681,7 @@ function Rp() {
10680
10681
  sideOffset: 0,
10681
10682
  children: [
10682
10683
  /* @__PURE__ */ x(
10683
- _t,
10684
+ Et,
10684
10685
  {
10685
10686
  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",
10686
10687
  onClick: k,
@@ -10691,7 +10692,7 @@ function Rp() {
10691
10692
  }
10692
10693
  ),
10693
10694
  h ? /* @__PURE__ */ x(
10694
- _t,
10695
+ Et,
10695
10696
  {
10696
10697
  className: "richtext-flex richtext-gap-3",
10697
10698
  onClick: u,
@@ -10702,7 +10703,7 @@ function Rp() {
10702
10703
  }
10703
10704
  ) : null,
10704
10705
  /* @__PURE__ */ x(
10705
- _t,
10706
+ Et,
10706
10707
  {
10707
10708
  className: "richtext-flex richtext-gap-3",
10708
10709
  onClick: f,
@@ -10712,19 +10713,19 @@ function Rp() {
10712
10713
  ]
10713
10714
  }
10714
10715
  ),
10715
- /* @__PURE__ */ x(_t, { className: "richtext-flex richtext-gap-3", onClick: g, children: [
10716
+ /* @__PURE__ */ x(Et, { className: "richtext-flex richtext-gap-3", onClick: g, children: [
10716
10717
  /* @__PURE__ */ p(st, { name: "Copy" }),
10717
10718
  /* @__PURE__ */ p("span", { children: n("editor.copy") })
10718
10719
  ] }),
10719
- a || d ? /* @__PURE__ */ p(ec, {}) : null,
10720
- a ? /* @__PURE__ */ x(vs, { children: [
10721
- /* @__PURE__ */ x(Ss, { className: "richtext-flex richtext-gap-3", children: [
10720
+ a || d ? /* @__PURE__ */ p(oc, {}) : null,
10721
+ a ? /* @__PURE__ */ x(ks, { children: [
10722
+ /* @__PURE__ */ x(Cs, { className: "richtext-flex richtext-gap-3", children: [
10722
10723
  /* @__PURE__ */ p(st, { name: "AlignCenter" }),
10723
10724
  /* @__PURE__ */ p("span", { children: n("editor.textalign.tooltip") })
10724
10725
  ] }),
10725
- /* @__PURE__ */ p(ks, { children: /* @__PURE__ */ x(Cs, { children: [
10726
+ /* @__PURE__ */ p(_s, { children: /* @__PURE__ */ x(Es, { children: [
10726
10727
  /* @__PURE__ */ x(
10727
- _t,
10728
+ Et,
10728
10729
  {
10729
10730
  className: "richtext-flex richtext-gap-3",
10730
10731
  onClick: () => m("left"),
@@ -10735,7 +10736,7 @@ function Rp() {
10735
10736
  }
10736
10737
  ),
10737
10738
  /* @__PURE__ */ x(
10738
- _t,
10739
+ Et,
10739
10740
  {
10740
10741
  className: "richtext-flex richtext-gap-3",
10741
10742
  onClick: () => m("center"),
@@ -10746,7 +10747,7 @@ function Rp() {
10746
10747
  }
10747
10748
  ),
10748
10749
  /* @__PURE__ */ x(
10749
- _t,
10750
+ Et,
10750
10751
  {
10751
10752
  className: "richtext-flex richtext-gap-3",
10752
10753
  onClick: () => m("right"),
@@ -10758,17 +10759,17 @@ function Rp() {
10758
10759
  )
10759
10760
  ] }) })
10760
10761
  ] }) : null,
10761
- d ? /* @__PURE__ */ x(vs, { children: [
10762
- /* @__PURE__ */ x(Ss, { className: "richtext-flex richtext-gap-3", children: [
10762
+ d ? /* @__PURE__ */ x(ks, { children: [
10763
+ /* @__PURE__ */ x(Cs, { className: "richtext-flex richtext-gap-3", children: [
10763
10764
  /* @__PURE__ */ p(st, { name: "IndentIncrease" }),
10764
10765
  /* @__PURE__ */ p("span", { children: n("editor.indent") })
10765
10766
  ] }),
10766
- /* @__PURE__ */ p(ks, { children: /* @__PURE__ */ x(Cs, { children: [
10767
+ /* @__PURE__ */ p(_s, { children: /* @__PURE__ */ x(Es, { children: [
10767
10768
  /* @__PURE__ */ x(
10768
- _t,
10769
+ Et,
10769
10770
  {
10770
10771
  className: "richtext-flex richtext-gap-3",
10771
- disabled: ((Y = i == null ? void 0 : i.attrs) == null ? void 0 : Y.indent) >= _s.max,
10772
+ disabled: ((G = i == null ? void 0 : i.attrs) == null ? void 0 : G.indent) >= vs.max,
10772
10773
  onClick: w,
10773
10774
  children: [
10774
10775
  /* @__PURE__ */ p(st, { name: "IndentIncrease" }),
@@ -10777,10 +10778,10 @@ function Rp() {
10777
10778
  }
10778
10779
  ),
10779
10780
  /* @__PURE__ */ x(
10780
- _t,
10781
+ Et,
10781
10782
  {
10782
10783
  className: "richtext-flex richtext-gap-3",
10783
- disabled: ((ct = i == null ? void 0 : i.attrs) == null ? void 0 : ct.indent) <= _s.min,
10784
+ disabled: ((ct = i == null ? void 0 : i.attrs) == null ? void 0 : ct.indent) <= vs.min,
10784
10785
  onClick: b,
10785
10786
  children: [
10786
10787
  /* @__PURE__ */ p(st, { name: "IndentDecrease" }),
@@ -10804,9 +10805,10 @@ const pr = {
10804
10805
  ts: "TypeScript",
10805
10806
  css: "CSS",
10806
10807
  html: "HTML",
10807
- python: "Python"
10808
+ python: "Python",
10809
+ bash: "Bash"
10808
10810
  };
10809
- function Tf({ listLanguages: e }) {
10811
+ function Df({ listLanguages: e }) {
10810
10812
  const { t } = q(), [n, i] = N(!1), s = F(), r = ht(() => {
10811
10813
  const { selection: l } = s.state, c = l.$from.parent;
10812
10814
  if (c.type.name === "codeBlock") {
@@ -10853,7 +10855,7 @@ function Tf({ listLanguages: e }) {
10853
10855
  c.preventDefault(), s.chain().focus().setCodeBlock({ language: l.value }).run(), i(!1);
10854
10856
  },
10855
10857
  children: [
10856
- /* @__PURE__ */ p("div", { className: "!richtext-min-w-[20px]", children: r === l.value && /* @__PURE__ */ p(pi, { size: 16 }) }),
10858
+ /* @__PURE__ */ p("div", { className: "!richtext-min-w-[20px]", children: r === l.value && /* @__PURE__ */ p(fi, { size: 16 }) }),
10857
10859
  /* @__PURE__ */ p("div", { className: "richtext-flex richtext-items-center richtext-gap-1", children: l.label })
10858
10860
  ]
10859
10861
  },
@@ -10863,22 +10865,47 @@ function Tf({ listLanguages: e }) {
10863
10865
  )
10864
10866
  ] });
10865
10867
  }
10866
- function Np() {
10867
- const e = Q(), t = F(), n = Bi(Yn.name), i = O(({ editor: o }) => o.isActive(Yn.name), []), s = ht(() => {
10868
- var o, l, c;
10869
- return n ? ((c = (l = (o = n.options) == null ? void 0 : o.lowlight) == null ? void 0 : l.listLanguages) == null ? void 0 : c.call(l)) || ["plaintext", "html", "css", "js", "ts"] : [];
10870
- }, [n]), r = O(() => qt(Yn.name, t), [t]);
10868
+ function Lp() {
10869
+ const e = Q(), t = F(), n = Bi(Gn.name), i = O(({ editor: c }) => c.isActive(Gn.name), []), s = ht(() => {
10870
+ var c, a, d;
10871
+ return n ? ((d = (a = (c = n.options) == null ? void 0 : c.lowlight) == null ? void 0 : a.listLanguages) == null ? void 0 : d.call(a)) || ["plaintext", "html", "css", "js", "ts"] : [];
10872
+ }, [n]), r = O(() => qt(Gn.name, t), [t]), o = () => {
10873
+ const { from: c } = t.state.selection, a = t.state.doc.resolve(c);
10874
+ for (let d = a.depth; d >= 0; d--) {
10875
+ const h = a.node(d);
10876
+ if (h.type.name === "codeBlock")
10877
+ return h.textContent;
10878
+ }
10879
+ return "";
10880
+ }, l = () => {
10881
+ const c = o();
10882
+ navigator.clipboard.writeText(c);
10883
+ };
10871
10884
  return e ? /* @__PURE__ */ p(
10872
10885
  it,
10873
10886
  {
10874
10887
  editor: t,
10875
- options: { placement: "top-start", strategy: "fixed", offset: 25, flip: !0 },
10888
+ options: { placement: "bottom", offset: 8, flip: !0 },
10876
10889
  pluginKey: "RichTextBubbleCodeBlock",
10877
10890
  shouldShow: i,
10891
+ getReferencedVirtualElement: () => {
10892
+ const { from: c } = t.state.selection, d = t.view.domAtPos(c).node.parentElement;
10893
+ return d ? {
10894
+ getBoundingClientRect: () => d.getBoundingClientRect()
10895
+ } : null;
10896
+ },
10878
10897
  children: /* @__PURE__ */ x("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: [
10879
- /* @__PURE__ */ p(Tf, { listLanguages: s }),
10898
+ /* @__PURE__ */ p(Df, { listLanguages: s }),
10899
+ /* @__PURE__ */ p(
10900
+ St,
10901
+ {
10902
+ className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
10903
+ orientation: "vertical"
10904
+ }
10905
+ ),
10906
+ /* @__PURE__ */ p(v, { action: l, tooltip: "Copy", children: /* @__PURE__ */ p(zl, { size: 16 }) }),
10880
10907
  /* @__PURE__ */ p(
10881
- Tt,
10908
+ St,
10882
10909
  {
10883
10910
  className: "!richtext-mx-1 !richtext-my-2 !richtext-h-[16px]",
10884
10911
  orientation: "vertical"
@@ -10890,20 +10917,20 @@ function Np() {
10890
10917
  ) : /* @__PURE__ */ p(A, {});
10891
10918
  }
10892
10919
  export {
10893
- bp as RichTextBubbleCallout,
10894
- Np as RichTextBubbleCodeBlock,
10895
- yp as RichTextBubbleColumns,
10896
- xp as RichTextBubbleDrawer,
10897
- vp as RichTextBubbleExcalidraw,
10898
- Sp as RichTextBubbleIframe,
10899
- _p as RichTextBubbleImage,
10900
- Ep as RichTextBubbleImageGif,
10901
- kp as RichTextBubbleKatex,
10902
- Cp as RichTextBubbleLink,
10903
- Rp as RichTextBubbleMenuDragHandle,
10904
- Dp as RichTextBubbleMermaid,
10905
- Ap as RichTextBubbleTable,
10906
- Ip as RichTextBubbleText,
10907
- Op as RichTextBubbleTwitter,
10908
- Tp as RichTextBubbleVideo
10920
+ xp as RichTextBubbleCallout,
10921
+ Lp as RichTextBubbleCodeBlock,
10922
+ vp as RichTextBubbleColumns,
10923
+ Sp as RichTextBubbleDrawer,
10924
+ kp as RichTextBubbleExcalidraw,
10925
+ Cp as RichTextBubbleIframe,
10926
+ Tp as RichTextBubbleImage,
10927
+ Dp as RichTextBubbleImageGif,
10928
+ _p as RichTextBubbleKatex,
10929
+ Ep as RichTextBubbleLink,
10930
+ Up as RichTextBubbleMenuDragHandle,
10931
+ Ip as RichTextBubbleMermaid,
10932
+ Op as RichTextBubbleTable,
10933
+ Mp as RichTextBubbleText,
10934
+ Rp as RichTextBubbleTwitter,
10935
+ Ap as RichTextBubbleVideo
10909
10936
  };