@pstdio/ui 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/{MermaidComponent-CatfVUxA.js → MermaidComponent-DBJsTOmj.js} +3 -3
  2. package/dist/{MermaidComponent-CatfVUxA.js.map → MermaidComponent-DBJsTOmj.js.map} +1 -1
  3. package/dist/chat-ui.js +441 -442
  4. package/dist/chat-ui.js.map +1 -1
  5. package/dist/components/bubble-button.d.ts +1 -1
  6. package/dist/components/data-renderer/data-renderer-enum-helpers.d.ts +3 -3
  7. package/dist/components/data-renderer/data-renderer-helpers.d.ts +2 -0
  8. package/dist/components/diff-viewer/diff-viewer-options-menu.d.ts +16 -0
  9. package/dist/components/icon-color-picker.d.ts +2 -6
  10. package/dist/components/list-row/list-row.types.d.ts +1 -1
  11. package/dist/components/notification-center/index.d.ts +2 -0
  12. package/dist/components/notification-center/notification-center.d.ts +2 -0
  13. package/dist/components/notification-center/notification-center.types.d.ts +37 -0
  14. package/dist/components/search-modal-content.d.ts +20 -0
  15. package/dist/components/style-guide-data.d.ts +0 -6
  16. package/dist/components/tab-strip/tab-visibility-filter.d.ts +4 -2
  17. package/dist/components/tree-list/tree-list-visibility-filter.d.ts +11 -3
  18. package/dist/components/tree-list/tree-list.types.d.ts +7 -2
  19. package/dist/index.d.ts +6 -2
  20. package/dist/index.js +4471 -4328
  21. package/dist/index.js.map +1 -1
  22. package/dist/mermaid-renderer-CPGj6vsb.js +570 -0
  23. package/dist/mermaid-renderer-CPGj6vsb.js.map +1 -0
  24. package/dist/{resource-badge-D33IFv74.js → resource-badge-CeJTOn8F.js} +41 -41
  25. package/dist/resource-badge-CeJTOn8F.js.map +1 -0
  26. package/dist/{rich-message-BFtvH9H7.js → rich-message-DNSEhxXh.js} +4 -4
  27. package/dist/{rich-message-BFtvH9H7.js.map → rich-message-DNSEhxXh.js.map} +1 -1
  28. package/dist/rich-text.js +405 -399
  29. package/dist/rich-text.js.map +1 -1
  30. package/dist/style.css +1 -1
  31. package/dist/theme/shadowless-default-config.d.ts +2 -0
  32. package/dist/{theme-C5qHTCU9.js → theme-25P7ij4C.js} +209 -239
  33. package/dist/theme-25P7ij4C.js.map +1 -0
  34. package/dist/theme.js +1 -1
  35. package/package.json +1 -1
  36. package/dist/components/sidebar/sidebar-project-menu.d.ts +0 -7
  37. package/dist/mermaid-renderer-DYEiYmYQ.js +0 -411
  38. package/dist/mermaid-renderer-DYEiYmYQ.js.map +0 -1
  39. package/dist/resource-badge-D33IFv74.js.map +0 -1
  40. package/dist/theme/tokens/shadows.d.ts +0 -64
  41. package/dist/theme-C5qHTCU9.js.map +0 -1
package/dist/rich-text.js CHANGED
@@ -1,8 +1,8 @@
1
- import { jsx as n, jsxs as ie, Fragment as ft } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as le, Fragment as ft } from "react/jsx-runtime";
2
2
  import { c as te } from "react/compiler-runtime";
3
- import { T as Ke, e as We, a as Ve, C as Ge, I as qe, E as Ye, b as Xe, s as mt, n as ut, c as He, d as pt, f as ht } from "./rich-message-BFtvH9H7.js";
4
- import { D as co, g as fo, R as mo, P as uo, R as po, h as ho, i as go } from "./rich-message-BFtvH9H7.js";
5
- import { IconButton as F, Text as me, Stack as Pe, Box as $e, Flex as Ae, Input as gt, Link as bt } from "@chakra-ui/react";
3
+ import { T as Ke, e as We, a as Ve, C as Ge, I as qe, E as Ye, b as Xe, s as mt, n as ut, c as Te, d as ht, f as pt } from "./rich-message-DNSEhxXh.js";
4
+ import { D as mo, g as uo, R as ho, P as po, R as go, h as bo, i as vo } from "./rich-message-DNSEhxXh.js";
5
+ import { IconButton as K, Text as ue, Stack as Ae, Box as De, Flex as Be, Input as gt, Link as bt } from "@chakra-ui/react";
6
6
  import { LexicalCollaboration as vt } from "@lexical/react/LexicalCollaborationContext";
7
7
  import { CollaborationPluginV2__EXPERIMENTAL as Ct } from "@lexical/react/LexicalCollaborationPlugin";
8
8
  import { LexicalComposer as Qe } from "@lexical/react/LexicalComposer";
@@ -12,39 +12,40 @@ import { LinkPlugin as et } from "@lexical/react/LexicalLinkPlugin";
12
12
  import { ListPlugin as tt } from "@lexical/react/LexicalListPlugin";
13
13
  import { RichTextPlugin as nt } from "@lexical/react/LexicalRichTextPlugin";
14
14
  import { TabIndentationPlugin as ot } from "@lexical/react/LexicalTabIndentationPlugin";
15
- import { useState as B, useRef as oe, useEffect as q, useLayoutEffect as _t } from "react";
16
- import { WebsocketProvider as Et } from "y-websocket";
17
- import * as kt from "yjs";
18
- import { useLexicalComposerContext as De } from "@lexical/react/LexicalComposerContext";
19
- import { mergeRegister as Le, $findMatchingParent as Z } from "@lexical/utils";
20
- import { SELECTION_CHANGE_COMMAND as Se, COMMAND_PRIORITY_CRITICAL as Oe, $getSelection as ee, $isRangeSelection as Q, FORMAT_TEXT_COMMAND as Te, $isRootOrShadowRoot as Lt, CLICK_COMMAND as it, COMMAND_PRIORITY_HIGH as lt, $createParagraphNode as Fe, COMMAND_PRIORITY_LOW as Be, KEY_ESCAPE_COMMAND as St, $isLineBreakNode as yt, $setSelection as xt, $getRoot as Tt } from "lexical";
21
- import { Check as rt, Copy as Rt, Link as wt, Code2 as Nt, List as It, ListOrdered as Pt, ListTodo as At, X as Bt, Pencil as zt, Trash2 as Mt } from "lucide-react";
22
- import { createPortal as Ue } from "react-dom";
23
- import { T as j } from "./resource-badge-D33IFv74.js";
24
- import { $isCodeNode as Re, $createCodeNode as $t } from "@lexical/code";
25
- import { $isLinkNode as le, $isAutoLinkNode as pe, TOGGLE_LINK_COMMAND as ze, $createLinkNode as Dt } from "@lexical/link";
26
- import { $isListNode as we, REMOVE_LIST_COMMAND as Ot, INSERT_CHECK_LIST_COMMAND as Ut, INSERT_ORDERED_LIST_COMMAND as Ht, INSERT_UNORDERED_LIST_COMMAND as Ft } from "@lexical/list";
15
+ import { useState as A, useRef as ie, useEffect as Y, useLayoutEffect as _t } from "react";
16
+ import { WebsocketProvider as kt } from "y-websocket";
17
+ import * as Et from "yjs";
18
+ import { useLexicalComposerContext as Oe } from "@lexical/react/LexicalComposerContext";
19
+ import { mergeRegister as Se, $findMatchingParent as Z } from "@lexical/utils";
20
+ import { SELECTION_CHANGE_COMMAND as ye, COMMAND_PRIORITY_CRITICAL as Ue, $getSelection as ee, $isRangeSelection as Q, FORMAT_TEXT_COMMAND as Re, $isRootOrShadowRoot as St, CLICK_COMMAND as it, COMMAND_PRIORITY_HIGH as lt, $createParagraphNode as Fe, COMMAND_PRIORITY_LOW as Me, KEY_ESCAPE_COMMAND as yt, $isLineBreakNode as Lt, $setSelection as xt, $getRoot as Tt } from "lexical";
21
+ import { Check as rt, Copy as Rt, Link as wt, Code2 as Nt, List as It, ListOrdered as Pt, ListTodo as At, X as Bt, Pencil as Mt, Trash2 as zt } from "lucide-react";
22
+ import { createPortal as He } from "react-dom";
23
+ import { T as W } from "./resource-badge-CeJTOn8F.js";
24
+ import { $isCodeNode as we, $createCodeNode as $t } from "@lexical/code";
25
+ import { $isLinkNode as re, $isAutoLinkNode as pe, TOGGLE_LINK_COMMAND as ze, $createLinkNode as Dt } from "@lexical/link";
26
+ import { $isListNode as Ne, REMOVE_LIST_COMMAND as Ot, INSERT_CHECK_LIST_COMMAND as Ut, INSERT_ORDERED_LIST_COMMAND as Ht, INSERT_UNORDERED_LIST_COMMAND as Ft } from "@lexical/list";
27
27
  import { $isHeadingNode as jt, $createHeadingNode as Kt } from "@lexical/rich-text";
28
28
  import { $isAtNodeEnd as je, $setBlocksType as _e } from "@lexical/selection";
29
29
  import { $convertFromMarkdownString as Wt, $convertToMarkdownString as Vt } from "@lexical/markdown";
30
30
  import { AutoFocusPlugin as Gt } from "@lexical/react/LexicalAutoFocusPlugin";
31
31
  import { CheckListPlugin as qt } from "@lexical/react/LexicalCheckListPlugin";
32
32
  import { HistoryPlugin as Yt } from "@lexical/react/LexicalHistoryPlugin";
33
- import { OnChangePlugin as Xt } from "@lexical/react/LexicalOnChangePlugin";
34
- function Ne(t) {
33
+ import { MarkdownShortcutPlugin as Xt } from "@lexical/react/LexicalMarkdownShortcutPlugin";
34
+ import { OnChangePlugin as Qt } from "@lexical/react/LexicalOnChangePlugin";
35
+ function Ie(t) {
35
36
  const e = ee();
36
37
  if (!Q(e))
37
38
  return null;
38
- const r = e.anchor.getNode(), o = Re(r) ? r : Z(r, (m) => Re(m));
39
- if (!Re(o))
39
+ const r = e.anchor.getNode(), o = we(r) ? r : Z(r, (u) => we(u));
40
+ if (!we(o))
40
41
  return null;
41
42
  const l = t.getElementByKey(o.getKey());
42
43
  return l instanceof HTMLElement ? l : null;
43
44
  }
44
- function Qt(t) {
45
+ function Zt(t) {
45
46
  return t instanceof HTMLElement ? t.closest(".rich-text__code") : null;
46
47
  }
47
- function Zt(t, e) {
48
+ function Jt(t, e) {
48
49
  const r = t.getBoundingClientRect(), o = e.getBoundingClientRect();
49
50
  return {
50
51
  top: o.top - r.top + 6,
@@ -54,49 +55,49 @@ function Zt(t, e) {
54
55
  function st(t) {
55
56
  const e = te(31), {
56
57
  anchorElem: r
57
- } = t, [o] = De(), [l, m] = B(null), [L, u] = B(!1), a = oe(null);
58
- let p, E;
58
+ } = t, [o] = Oe(), [l, u] = A(null), [S, h] = A(!1), a = ie(null);
59
+ let p, k;
59
60
  e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = () => () => {
60
61
  a.current !== null && window.clearTimeout(a.current);
61
- }, E = [], e[0] = p, e[1] = E) : (p = e[0], E = e[1]), q(p, E);
62
- let b, h;
62
+ }, k = [], e[0] = p, e[1] = k) : (p = e[0], k = e[1]), Y(p, k);
63
+ let b, d;
63
64
  e[2] !== o ? (b = () => {
64
65
  const _ = o.getRootElement();
65
66
  if (!_)
66
67
  return;
67
- const k = (I) => {
68
- const z = Qt(I.target);
69
- m(z instanceof HTMLElement ? z : null);
68
+ const E = (I) => {
69
+ const B = Zt(I.target);
70
+ u(B instanceof HTMLElement ? B : null);
70
71
  }, N = () => {
71
72
  o.getEditorState().read(() => {
72
- const I = Ne(o);
73
- m(I);
73
+ const I = Ie(o);
74
+ u(I);
74
75
  });
75
76
  };
76
- return _.addEventListener("pointermove", k), _.addEventListener("pointerleave", N), () => {
77
- _.removeEventListener("pointermove", k), _.removeEventListener("pointerleave", N);
77
+ return _.addEventListener("pointermove", E), _.addEventListener("pointerleave", N), () => {
78
+ _.removeEventListener("pointermove", E), _.removeEventListener("pointerleave", N);
78
79
  };
79
- }, h = [o], e[2] = o, e[3] = b, e[4] = h) : (b = e[3], h = e[4]), q(b, h);
80
+ }, d = [o], e[2] = o, e[3] = b, e[4] = d) : (b = e[3], d = e[4]), Y(b, d);
80
81
  let C, R;
81
- if (e[5] !== o ? (C = () => Le(o.registerUpdateListener((_) => {
82
+ if (e[5] !== o ? (C = () => Se(o.registerUpdateListener((_) => {
82
83
  const {
83
- editorState: k
84
+ editorState: E
84
85
  } = _;
85
- k.read(() => {
86
- const N = Ne(o);
87
- N && m(N);
86
+ E.read(() => {
87
+ const N = Ie(o);
88
+ N && u(N);
88
89
  });
89
- }), o.registerCommand(Se, () => (o.getEditorState().read(() => {
90
- const _ = Ne(o);
90
+ }), o.registerCommand(ye, () => (o.getEditorState().read(() => {
91
+ const _ = Ie(o);
91
92
  if (!_) {
92
- m(Jt);
93
+ u(en);
93
94
  return;
94
95
  }
95
- m(_);
96
- }), !1), Oe)), R = [o], e[5] = o, e[6] = C, e[7] = R) : (C = e[6], R = e[7]), q(C, R), !r || !l)
96
+ u(_);
97
+ }), !1), Ue)), R = [o], e[5] = o, e[6] = C, e[7] = R) : (C = e[6], R = e[7]), Y(C, R), !r || !l)
97
98
  return null;
98
99
  let c;
99
- e[8] !== l || e[9] !== r ? (c = Zt(r, l), e[8] = l, e[9] = r, e[10] = c) : c = e[10];
100
+ e[8] !== l || e[9] !== r ? (c = Jt(r, l), e[8] = l, e[9] = r, e[10] = c) : c = e[10];
100
101
  const w = c;
101
102
  let v;
102
103
  e[11] !== w.left || e[12] !== w.top ? (v = {
@@ -104,48 +105,48 @@ function st(t) {
104
105
  top: w.top,
105
106
  left: w.left
106
107
  }, e[11] = w.left, e[12] = w.top, e[13] = v) : v = e[13];
107
- const S = v, g = L ? "Copied" : "Copy code", d = L ? "Copied" : "Copy code";
108
+ const y = v, g = S ? "Copied" : "Copy code", f = S ? "Copied" : "Copy code";
108
109
  let i;
109
110
  e[14] !== l.textContent ? (i = async () => {
110
111
  const _ = l.textContent ?? "";
111
112
  try {
112
- await navigator.clipboard.writeText(_), u(!0), a.current !== null && window.clearTimeout(a.current), a.current = window.setTimeout(() => {
113
- u(!1);
113
+ await navigator.clipboard.writeText(_), h(!0), a.current !== null && window.clearTimeout(a.current), a.current = window.setTimeout(() => {
114
+ h(!1);
114
115
  }, 1200);
115
116
  } catch {
116
- u(!1);
117
+ h(!1);
117
118
  }
118
119
  }, e[14] = l.textContent, e[15] = i) : i = e[15];
119
120
  let s;
120
- e[16] !== L ? (s = L ? /* @__PURE__ */ n(rt, { size: 14 }) : /* @__PURE__ */ n(Rt, { size: 14 }), e[16] = L, e[17] = s) : s = e[17];
121
- let f;
122
- e[18] !== d || e[19] !== i || e[20] !== s ? (f = /* @__PURE__ */ n(F, { "aria-label": d, variant: "surface", size: "xs", onClick: i, children: s }), e[18] = d, e[19] = i, e[20] = s, e[21] = f) : f = e[21];
123
- let y;
124
- e[22] !== f || e[23] !== g ? (y = /* @__PURE__ */ n(j, { content: g, children: f }), e[22] = f, e[23] = g, e[24] = y) : y = e[24];
121
+ e[16] !== S ? (s = S ? /* @__PURE__ */ n(rt, { size: 14 }) : /* @__PURE__ */ n(Rt, { size: 14 }), e[16] = S, e[17] = s) : s = e[17];
122
+ let m;
123
+ e[18] !== f || e[19] !== i || e[20] !== s ? (m = /* @__PURE__ */ n(K, { "aria-label": f, variant: "surface", size: "xs", onClick: i, children: s }), e[18] = f, e[19] = i, e[20] = s, e[21] = m) : m = e[21];
124
+ let L;
125
+ e[22] !== m || e[23] !== g ? (L = /* @__PURE__ */ n(W, { content: g, children: m }), e[22] = m, e[23] = g, e[24] = L) : L = e[24];
125
126
  let x;
126
- e[25] !== S || e[26] !== y ? (x = /* @__PURE__ */ n("div", { className: "code-block-actions", style: S, children: y }), e[25] = S, e[26] = y, e[27] = x) : x = e[27];
127
+ e[25] !== y || e[26] !== L ? (x = /* @__PURE__ */ n("div", { className: "code-block-actions", style: y, children: L }), e[25] = y, e[26] = L, e[27] = x) : x = e[27];
127
128
  let T;
128
- return e[28] !== r || e[29] !== x ? (T = Ue(x, r), e[28] = r, e[29] = x, e[30] = T) : T = e[30], T;
129
+ return e[28] !== r || e[29] !== x ? (T = He(x, r), e[28] = r, e[29] = x, e[30] = T) : T = e[30], T;
129
130
  }
130
- function Jt(t) {
131
+ function en(t) {
131
132
  return t?.matches(":hover") ? t : null;
132
133
  }
133
- function he(t) {
134
+ function ge(t) {
134
135
  const e = t.anchor, r = t.focus, o = t.anchor.getNode(), l = t.focus.getNode();
135
136
  return o === l ? o : t.isBackward() ? je(r) ? o : l : je(e) ? o : l;
136
137
  }
137
- const en = 10, tn = 5;
138
- function ke(t, e, r, o = en, l = tn, m = "legacy") {
139
- const L = r.parentElement;
140
- if (t === null || !L) {
138
+ const tn = 10, nn = 5;
139
+ function Ee(t, e, r, o = tn, l = nn, u = "legacy") {
140
+ const S = r.parentElement;
141
+ if (t === null || !S) {
141
142
  e.style.opacity = "0", e.style.transform = "translate(-10000px, -10000px)";
142
143
  return;
143
144
  }
144
- const u = e.getBoundingClientRect(), a = r.getBoundingClientRect(), p = L.getBoundingClientRect();
145
- let E = m === "above" ? t.top - u.height - o : t.top - o, b = t.left - l;
146
- E < p.top && (E = m === "above" ? t.bottom + o : E + u.height + t.height + o * 2), b + u.width > p.right && (b = p.right - u.width - l), E -= a.top, b -= a.left, e.style.opacity = "1", e.style.transform = `translate(${b}px, ${E}px)`;
145
+ const h = e.getBoundingClientRect(), a = r.getBoundingClientRect(), p = S.getBoundingClientRect();
146
+ let k = u === "above" ? t.top - h.height - o : t.top - o, b = t.left - l;
147
+ k < p.top && (k = u === "above" ? t.bottom + o : k + h.height + t.height + o * 2), b + h.width > p.right && (b = p.right - h.width - l), k -= a.top, b -= a.left, e.style.opacity = "1", e.style.transform = `translate(${b}px, ${k}px)`;
147
148
  }
148
- function Ie() {
149
+ function Pe() {
149
150
  const t = te(1);
150
151
  let e;
151
152
  return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n("span", { style: {
@@ -155,118 +156,118 @@ function Ie() {
155
156
  borderLeft: "1px solid var(--chakra-colors-border-muted)"
156
157
  } }), t[0] = e) : e = t[0], e;
157
158
  }
158
- function nn(t) {
159
+ function on(t) {
159
160
  const e = te(81), {
160
161
  editor: r,
161
162
  blockType: o,
162
163
  isBold: l,
163
- isItalic: m,
164
- isUnderline: L,
165
- isLink: u,
164
+ isItalic: u,
165
+ isUnderline: S,
166
+ isLink: h,
166
167
  formatHeading: a,
167
168
  formatList: p,
168
- formatCodeBlock: E,
169
+ formatCodeBlock: k,
169
170
  insertLink: b
170
- } = t, h = l || void 0;
171
+ } = t, d = l || void 0;
171
172
  let C;
172
- e[0] !== r ? (C = () => r.dispatchCommand(Te, "bold"), e[0] = r, e[1] = C) : C = e[1];
173
+ e[0] !== r ? (C = () => r.dispatchCommand(Re, "bold"), e[0] = r, e[1] = C) : C = e[1];
173
174
  let R;
174
- e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ n(me, { fontWeight: "bold", fontSize: ".75rem", children: "B" }), e[2] = R) : R = e[2];
175
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ n(ue, { fontWeight: "bold", fontSize: ".75rem", children: "B" }), e[2] = R) : R = e[2];
175
176
  let c;
176
- e[3] !== h || e[4] !== C ? (c = /* @__PURE__ */ n(j, { content: "Bold", children: /* @__PURE__ */ n(F, { "data-active": h, onClick: C, variant: "ghost", "aria-label": "Bold", size: "xs", children: R }) }), e[3] = h, e[4] = C, e[5] = c) : c = e[5];
177
- const w = m || void 0;
177
+ e[3] !== d || e[4] !== C ? (c = /* @__PURE__ */ n(W, { content: "Bold", children: /* @__PURE__ */ n(K, { "data-active": d, onClick: C, variant: "ghost", "aria-label": "Bold", size: "xs", children: R }) }), e[3] = d, e[4] = C, e[5] = c) : c = e[5];
178
+ const w = u || void 0;
178
179
  let v;
179
- e[6] !== r ? (v = () => r.dispatchCommand(Te, "italic"), e[6] = r, e[7] = v) : v = e[7];
180
- let S;
181
- e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ n(me, { fontStyle: "italic", fontSize: ".75rem", children: "I" }), e[8] = S) : S = e[8];
180
+ e[6] !== r ? (v = () => r.dispatchCommand(Re, "italic"), e[6] = r, e[7] = v) : v = e[7];
181
+ let y;
182
+ e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ n(ue, { fontStyle: "italic", fontSize: ".75rem", children: "I" }), e[8] = y) : y = e[8];
182
183
  let g;
183
- e[9] !== w || e[10] !== v ? (g = /* @__PURE__ */ n(j, { content: "Italic", children: /* @__PURE__ */ n(F, { "data-active": w, onClick: v, variant: "ghost", "aria-label": "Italic", size: "xs", children: S }) }), e[9] = w, e[10] = v, e[11] = g) : g = e[11];
184
- const d = L || void 0;
184
+ e[9] !== w || e[10] !== v ? (g = /* @__PURE__ */ n(W, { content: "Italic", children: /* @__PURE__ */ n(K, { "data-active": w, onClick: v, variant: "ghost", "aria-label": "Italic", size: "xs", children: y }) }), e[9] = w, e[10] = v, e[11] = g) : g = e[11];
185
+ const f = S || void 0;
185
186
  let i;
186
- e[12] !== r ? (i = () => r.dispatchCommand(Te, "underline"), e[12] = r, e[13] = i) : i = e[13];
187
+ e[12] !== r ? (i = () => r.dispatchCommand(Re, "underline"), e[12] = r, e[13] = i) : i = e[13];
187
188
  let s;
188
- e[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ n(me, { textDecoration: "underline", fontSize: ".75rem", children: "U" }), e[14] = s) : s = e[14];
189
- let f;
190
- e[15] !== d || e[16] !== i ? (f = /* @__PURE__ */ n(j, { content: "Underline", children: /* @__PURE__ */ n(F, { "data-active": d, onClick: i, variant: "ghost", "aria-label": "Underline", size: "xs", children: s }) }), e[15] = d, e[16] = i, e[17] = f) : f = e[17];
191
- const y = u ? "Remove Link" : "Insert Link", x = u || void 0, T = u ? "Remove Link" : "Insert Link";
189
+ e[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ n(ue, { textDecoration: "underline", fontSize: ".75rem", children: "U" }), e[14] = s) : s = e[14];
190
+ let m;
191
+ e[15] !== f || e[16] !== i ? (m = /* @__PURE__ */ n(W, { content: "Underline", children: /* @__PURE__ */ n(K, { "data-active": f, onClick: i, variant: "ghost", "aria-label": "Underline", size: "xs", children: s }) }), e[15] = f, e[16] = i, e[17] = m) : m = e[17];
192
+ const L = h ? "Remove Link" : "Insert Link", x = h || void 0, T = h ? "Remove Link" : "Insert Link";
192
193
  let _;
193
194
  e[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ n(wt, { size: 14 }), e[18] = _) : _ = e[18];
194
- let k;
195
- e[19] !== b || e[20] !== x || e[21] !== T ? (k = /* @__PURE__ */ n(F, { "data-active": x, variant: "ghost", "aria-label": T, size: "xs", onClick: b, children: _ }), e[19] = b, e[20] = x, e[21] = T, e[22] = k) : k = e[22];
195
+ let E;
196
+ e[19] !== b || e[20] !== x || e[21] !== T ? (E = /* @__PURE__ */ n(K, { "data-active": x, variant: "ghost", "aria-label": T, size: "xs", onClick: b, children: _ }), e[19] = b, e[20] = x, e[21] = T, e[22] = E) : E = e[22];
196
197
  let N;
197
- e[23] !== y || e[24] !== k ? (N = /* @__PURE__ */ n(j, { content: y, children: k }), e[23] = y, e[24] = k, e[25] = N) : N = e[25];
198
+ e[23] !== L || e[24] !== E ? (N = /* @__PURE__ */ n(W, { content: L, children: E }), e[23] = L, e[24] = E, e[25] = N) : N = e[25];
198
199
  let I;
199
- e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ n(Ie, {}), e[26] = I) : I = e[26];
200
- const z = o === "h1" || void 0;
200
+ e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (I = /* @__PURE__ */ n(Pe, {}), e[26] = I) : I = e[26];
201
+ const B = o === "h1" || void 0;
202
+ let $;
203
+ e[27] !== a ? ($ = () => a("h1"), e[27] = a, e[28] = $) : $ = e[28];
201
204
  let D;
202
- e[27] !== a ? (D = () => a("h1"), e[27] = a, e[28] = D) : D = e[28];
203
- let W;
204
- e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = /* @__PURE__ */ n(me, { fontWeight: "thin", fontSize: ".8rem", children: "H1" }), e[29] = W) : W = e[29];
205
+ e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ n(ue, { fontWeight: "thin", fontSize: ".8rem", children: "H1" }), e[29] = D) : D = e[29];
205
206
  let O;
206
- e[30] !== z || e[31] !== D ? (O = /* @__PURE__ */ n(j, { content: "Heading 1", children: /* @__PURE__ */ n(F, { "data-active": z, variant: "ghost", "aria-label": "Heading 1", size: "xs", onClick: D, children: W }) }), e[30] = z, e[31] = D, e[32] = O) : O = e[32];
207
- const K = o === "h2" || void 0;
208
- let M;
209
- e[33] !== a ? (M = () => a("h2"), e[33] = a, e[34] = M) : M = e[34];
210
- let V;
211
- e[35] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ n(me, { fontWeight: "thin", fontSize: ".8rem", children: "H2" }), e[35] = V) : V = e[35];
212
- let P;
213
- e[36] !== K || e[37] !== M ? (P = /* @__PURE__ */ n(j, { content: "Heading 2", children: /* @__PURE__ */ n(F, { "data-active": K, variant: "ghost", "aria-label": "Heading 2", size: "xs", onClick: M, children: V }) }), e[36] = K, e[37] = M, e[38] = P) : P = e[38];
214
- const $ = o === "h3" || void 0;
215
- let A;
216
- e[39] !== a ? (A = () => a("h3"), e[39] = a, e[40] = A) : A = e[40];
207
+ e[30] !== B || e[31] !== $ ? (O = /* @__PURE__ */ n(W, { content: "Heading 1", children: /* @__PURE__ */ n(K, { "data-active": B, variant: "ghost", "aria-label": "Heading 1", size: "xs", onClick: $, children: D }) }), e[30] = B, e[31] = $, e[32] = O) : O = e[32];
208
+ const V = o === "h2" || void 0;
217
209
  let U;
218
- e[41] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ n(me, { fontWeight: "thin", fontSize: ".8rem", children: "H3" }), e[41] = U) : U = e[41];
210
+ e[33] !== a ? (U = () => a("h2"), e[33] = a, e[34] = U) : U = e[34];
219
211
  let H;
220
- e[42] !== $ || e[43] !== A ? (H = /* @__PURE__ */ n(j, { content: "Heading 3", children: /* @__PURE__ */ n(F, { "data-active": $, variant: "ghost", "aria-label": "Heading 3", size: "xs", onClick: A, children: U }) }), e[42] = $, e[43] = A, e[44] = H) : H = e[44];
212
+ e[35] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ n(ue, { fontWeight: "thin", fontSize: ".8rem", children: "H2" }), e[35] = H) : H = e[35];
213
+ let M;
214
+ e[36] !== V || e[37] !== U ? (M = /* @__PURE__ */ n(W, { content: "Heading 2", children: /* @__PURE__ */ n(K, { "data-active": V, variant: "ghost", "aria-label": "Heading 2", size: "xs", onClick: U, children: H }) }), e[36] = V, e[37] = U, e[38] = M) : M = e[38];
215
+ const z = o === "h3" || void 0;
216
+ let P;
217
+ e[39] !== a ? (P = () => a("h3"), e[39] = a, e[40] = P) : P = e[40];
218
+ let F;
219
+ e[41] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (F = /* @__PURE__ */ n(ue, { fontWeight: "thin", fontSize: ".8rem", children: "H3" }), e[41] = F) : F = e[41];
220
+ let j;
221
+ e[42] !== z || e[43] !== P ? (j = /* @__PURE__ */ n(W, { content: "Heading 3", children: /* @__PURE__ */ n(K, { "data-active": z, variant: "ghost", "aria-label": "Heading 3", size: "xs", onClick: P, children: F }) }), e[42] = z, e[43] = P, e[44] = j) : j = e[44];
221
222
  let G;
222
- e[45] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (G = /* @__PURE__ */ n(Ie, {}), e[45] = G) : G = e[45];
223
+ e[45] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (G = /* @__PURE__ */ n(Pe, {}), e[45] = G) : G = e[45];
223
224
  const J = o === "code" || void 0;
224
- let Y;
225
- e[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Y = /* @__PURE__ */ n(Nt, { size: 14 }), e[46] = Y) : Y = e[46];
226
225
  let X;
227
- e[47] !== E || e[48] !== J ? (X = /* @__PURE__ */ n(j, { content: "Code Block", children: /* @__PURE__ */ n(F, { "data-active": J, variant: "ghost", "aria-label": "Code Block", size: "xs", onClick: E, children: Y }) }), e[47] = E, e[48] = J, e[49] = X) : X = e[49];
228
- let re;
229
- e[50] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (re = /* @__PURE__ */ n(Ie, {}), e[50] = re) : re = e[50];
230
- const ue = o === "bullet" || void 0;
226
+ e[46] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (X = /* @__PURE__ */ n(Nt, { size: 14 }), e[46] = X) : X = e[46];
227
+ let q;
228
+ e[47] !== k || e[48] !== J ? (q = /* @__PURE__ */ n(W, { content: "Code Block", children: /* @__PURE__ */ n(K, { "data-active": J, variant: "ghost", "aria-label": "Code Block", size: "xs", onClick: k, children: X }) }), e[47] = k, e[48] = J, e[49] = q) : q = e[49];
231
229
  let ne;
232
- e[51] !== p ? (ne = () => p("bullet"), e[51] = p, e[52] = ne) : ne = e[52];
233
- let ge;
234
- e[53] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ge = /* @__PURE__ */ n(It, { size: 14 }), e[53] = ge) : ge = e[53];
230
+ e[50] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ne = /* @__PURE__ */ n(Pe, {}), e[50] = ne) : ne = e[50];
231
+ const he = o === "bullet" || void 0;
232
+ let oe;
233
+ e[51] !== p ? (oe = () => p("bullet"), e[51] = p, e[52] = oe) : oe = e[52];
235
234
  let se;
236
- e[54] !== ue || e[55] !== ne ? (se = /* @__PURE__ */ n(j, { content: "Bulleted List", children: /* @__PURE__ */ n(F, { "data-active": ue, variant: "ghost", "aria-label": "Bulleted List", size: "xs", onClick: ne, children: ge }) }), e[54] = ue, e[55] = ne, e[56] = se) : se = e[56];
237
- const ye = o === "number" || void 0;
235
+ e[53] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (se = /* @__PURE__ */ n(It, { size: 14 }), e[53] = se) : se = e[53];
238
236
  let ae;
239
- e[57] !== p ? (ae = () => p("number"), e[57] = p, e[58] = ae) : ae = e[58];
237
+ e[54] !== he || e[55] !== oe ? (ae = /* @__PURE__ */ n(W, { content: "Bulleted List", children: /* @__PURE__ */ n(K, { "data-active": he, variant: "ghost", "aria-label": "Bulleted List", size: "xs", onClick: oe, children: se }) }), e[54] = he, e[55] = oe, e[56] = ae) : ae = e[56];
238
+ const Le = o === "number" || void 0;
239
+ let ce;
240
+ e[57] !== p ? (ce = () => p("number"), e[57] = p, e[58] = ce) : ce = e[58];
240
241
  let be;
241
242
  e[59] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (be = /* @__PURE__ */ n(Pt, { size: 14 }), e[59] = be) : be = e[59];
242
- let ce;
243
- e[60] !== ye || e[61] !== ae ? (ce = /* @__PURE__ */ n(j, { content: "Numbered List", children: /* @__PURE__ */ n(F, { "data-active": ye, variant: "ghost", "aria-label": "Numbered List", size: "xs", onClick: ae, children: be }) }), e[60] = ye, e[61] = ae, e[62] = ce) : ce = e[62];
244
- const xe = o === "check" || void 0;
245
243
  let de;
246
- e[63] !== p ? (de = () => p("check"), e[63] = p, e[64] = de) : de = e[64];
244
+ e[60] !== Le || e[61] !== ce ? (de = /* @__PURE__ */ n(W, { content: "Numbered List", children: /* @__PURE__ */ n(K, { "data-active": Le, variant: "ghost", "aria-label": "Numbered List", size: "xs", onClick: ce, children: be }) }), e[60] = Le, e[61] = ce, e[62] = de) : de = e[62];
245
+ const xe = o === "check" || void 0;
246
+ let fe;
247
+ e[63] !== p ? (fe = () => p("check"), e[63] = p, e[64] = fe) : fe = e[64];
247
248
  let ve;
248
249
  e[65] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ve = /* @__PURE__ */ n(At, { size: 14 }), e[65] = ve) : ve = e[65];
249
- let fe;
250
- e[66] !== xe || e[67] !== de ? (fe = /* @__PURE__ */ n(j, { content: "Check List", children: /* @__PURE__ */ n(F, { "data-active": xe, variant: "ghost", "aria-label": "Check List", size: "xs", onClick: de, children: ve }) }), e[66] = xe, e[67] = de, e[68] = fe) : fe = e[68];
250
+ let me;
251
+ e[66] !== xe || e[67] !== fe ? (me = /* @__PURE__ */ n(W, { content: "Check List", children: /* @__PURE__ */ n(K, { "data-active": xe, variant: "ghost", "aria-label": "Check List", size: "xs", onClick: fe, children: ve }) }), e[66] = xe, e[67] = fe, e[68] = me) : me = e[68];
251
252
  let Ce;
252
- return e[69] !== f || e[70] !== N || e[71] !== O || e[72] !== P || e[73] !== c || e[74] !== H || e[75] !== X || e[76] !== se || e[77] !== ce || e[78] !== fe || e[79] !== g ? (Ce = /* @__PURE__ */ ie(Pe, { direction: "row", gap: "0.5", alignItems: "center", children: [
253
+ return e[69] !== m || e[70] !== N || e[71] !== O || e[72] !== M || e[73] !== c || e[74] !== j || e[75] !== q || e[76] !== ae || e[77] !== de || e[78] !== me || e[79] !== g ? (Ce = /* @__PURE__ */ le(Ae, { direction: "row", gap: "0.5", alignItems: "center", children: [
253
254
  c,
254
255
  g,
255
- f,
256
+ m,
256
257
  N,
257
258
  I,
258
259
  O,
259
- P,
260
- H,
260
+ M,
261
+ j,
261
262
  G,
262
- X,
263
- re,
264
- se,
265
- ce,
266
- fe
267
- ] }), e[69] = f, e[70] = N, e[71] = O, e[72] = P, e[73] = c, e[74] = H, e[75] = X, e[76] = se, e[77] = ce, e[78] = fe, e[79] = g, e[80] = Ce) : Ce = e[80], Ce;
268
- }
269
- const on = {
263
+ q,
264
+ ne,
265
+ ae,
266
+ de,
267
+ me
268
+ ] }), e[69] = m, e[70] = N, e[71] = O, e[72] = M, e[73] = c, e[74] = j, e[75] = q, e[76] = ae, e[77] = de, e[78] = me, e[79] = g, e[80] = Ce) : Ce = e[80], Ce;
269
+ }
270
+ const ln = {
270
271
  bullet: "Bulleted List",
271
272
  check: "Check List",
272
273
  code: "Code Block",
@@ -279,44 +280,44 @@ const on = {
279
280
  number: "Numbered List",
280
281
  paragraph: "Normal",
281
282
  quote: "Quote"
282
- }, ln = (t) => t in on ? t : null, rn = (t) => (t.getKey() === "root" ? t : Z(t, (r) => {
283
+ }, rn = (t) => t in ln ? t : null, sn = (t) => (t.getKey() === "root" ? t : Z(t, (r) => {
283
284
  const o = r.getParent();
284
- return o !== null && Lt(o);
285
- })) ?? t.getTopLevelElementOrThrow(), sn = (t) => {
286
- const e = rn(t);
287
- if (we(e))
285
+ return o !== null && St(o);
286
+ })) ?? t.getTopLevelElementOrThrow(), an = (t) => {
287
+ const e = sn(t);
288
+ if (Ne(e))
288
289
  return e.getListType();
289
- const r = Z(t, (l) => we(l));
290
- if (r !== null && we(r))
290
+ const r = Z(t, (l) => Ne(l));
291
+ if (r !== null && Ne(r))
291
292
  return r.getListType();
292
293
  const o = jt(e) ? e.getTag() : e.getType();
293
- return ln(o);
294
+ return rn(o);
294
295
  };
295
- function an(t) {
296
+ function cn(t) {
296
297
  const {
297
298
  hasSelection: e,
298
299
  isRangeSelection: r,
299
300
  isCollapsed: o,
300
301
  hasNativeSelection: l,
301
- hasNativeRange: m,
302
- isAnchorInsideEditor: L,
303
- isEditorEditable: u
302
+ hasNativeRange: u,
303
+ isAnchorInsideEditor: S,
304
+ isEditorEditable: h
304
305
  } = t;
305
- return e && r && !o && l && m && L && u;
306
+ return e && r && !o && l && u && S && h;
306
307
  }
307
- const cn = -4;
308
- function dn({
308
+ const dn = -4;
309
+ function fn({
309
310
  editor: t,
310
311
  anchorElem: e,
311
312
  isToolbarActive: r,
312
313
  setIsToolbarActive: o
313
314
  }) {
314
- const l = oe(null), [m, L] = B("paragraph"), [u, a] = B(!1), [p, E] = B(!1), [b, h] = B(!1), [C, R] = B(!1), c = oe(() => {
315
+ const l = ie(null), [u, S] = A("paragraph"), [h, a] = A(!1), [p, k] = A(!1), [b, d] = A(!1), [C, R] = A(!1), c = ie(() => {
315
316
  }), w = (i) => {
316
317
  t.update(() => {
317
318
  const s = ee();
318
319
  if (Q(s)) {
319
- if (m === i) {
320
+ if (u === i) {
320
321
  _e(s, Fe);
321
322
  return;
322
323
  }
@@ -324,7 +325,7 @@ function dn({
324
325
  }
325
326
  });
326
327
  }, v = (i) => {
327
- if (m === i) {
328
+ if (u === i) {
328
329
  t.dispatchCommand(Ot, void 0);
329
330
  return;
330
331
  }
@@ -334,11 +335,11 @@ function dn({
334
335
  check: Ut
335
336
  }[i];
336
337
  t.dispatchCommand(s, void 0);
337
- }, S = () => {
338
+ }, y = () => {
338
339
  t.update(() => {
339
340
  const i = ee();
340
341
  if (Q(i)) {
341
- if (m === "code") {
342
+ if (u === "code") {
342
343
  _e(i, Fe);
343
344
  return;
344
345
  }
@@ -351,21 +352,21 @@ function dn({
351
352
  return;
352
353
  }
353
354
  t.dispatchCommand(Ke, !0);
354
- }, d = () => {
355
+ }, f = () => {
355
356
  const i = ee();
356
357
  if (!Q(i)) return;
357
- a(i.hasFormat("bold")), E(i.hasFormat("italic")), h(i.hasFormat("underline"));
358
- const s = he(i), f = Z(s, le), y = Z(s, pe);
359
- R(f !== null || y !== null);
360
- const x = sn(i.anchor.getNode());
361
- x && L(x);
358
+ a(i.hasFormat("bold")), k(i.hasFormat("italic")), d(i.hasFormat("underline"));
359
+ const s = ge(i), m = Z(s, re), L = Z(s, pe);
360
+ R(m !== null || L !== null);
361
+ const x = an(i.anchor.getNode());
362
+ x && S(x);
362
363
  };
363
364
  return c.current = () => {
364
- const i = ee(), s = l.current, f = window.getSelection();
365
+ const i = ee(), s = l.current, m = window.getSelection();
365
366
  if (s === null)
366
367
  return;
367
- const y = t.getRootElement(), x = f !== null, T = x && f.rangeCount > 0, _ = !!y?.contains(x ? f.anchorNode : null);
368
- if (an({
368
+ const L = t.getRootElement(), x = m !== null, T = x && m.rangeCount > 0, _ = !!L?.contains(x ? m.anchorNode : null);
369
+ if (cn({
369
370
  hasSelection: i !== null,
370
371
  isRangeSelection: Q(i),
371
372
  isCollapsed: Q(i) ? i.isCollapsed() : !1,
@@ -373,17 +374,17 @@ function dn({
373
374
  hasNativeRange: T,
374
375
  isAnchorInsideEditor: _,
375
376
  isEditorEditable: t.isEditable()
376
- }) && f) {
377
- const k = f.getRangeAt(0).getBoundingClientRect();
378
- if (k) {
379
- const N = new DOMRect(k.left, k.bottom, 0, 0);
380
- ke(N, s, e, cn);
377
+ }) && m) {
378
+ const E = m.getRangeAt(0).getBoundingClientRect();
379
+ if (E) {
380
+ const N = new DOMRect(E.left, E.bottom, 0, 0);
381
+ Ee(N, s, e, dn);
381
382
  }
382
383
  o(!0);
383
384
  } else
384
- y !== null && ke(null, s, e), o(!1);
385
- return d(), !0;
386
- }, q(() => {
385
+ L !== null && Ee(null, s, e), o(!1);
386
+ return f(), !0;
387
+ }, Y(() => {
387
388
  const i = e.parentElement, s = () => {
388
389
  t.getEditorState().read(() => {
389
390
  c.current();
@@ -392,27 +393,27 @@ function dn({
392
393
  return window.addEventListener("resize", s), i && i.addEventListener("scroll", s), () => {
393
394
  window.removeEventListener("resize", s), i && i.removeEventListener("scroll", s);
394
395
  };
395
- }, [e, t]), q(() => Le(t.registerUpdateListener(({
396
+ }, [e, t]), Y(() => Se(t.registerUpdateListener(({
396
397
  editorState: i
397
398
  }) => {
398
399
  i.read(() => {
399
400
  c.current();
400
401
  });
401
- }), t.registerCommand(Se, (i) => (c.current(), !1), Oe), t.registerCommand(it, (i) => {
402
+ }), t.registerCommand(ye, (i) => (c.current(), !1), Ue), t.registerCommand(it, (i) => {
402
403
  const s = ee();
403
404
  return Q(s) && c.current(), !1;
404
- }, lt)), [t]), /* @__PURE__ */ n("div", { ref: l, className: `floating-text-format-toolbar ${r ? "active" : ""}`, children: /* @__PURE__ */ n(nn, { editor: t, blockType: m, isBold: u, isItalic: p, isUnderline: b, isLink: C, formatHeading: w, formatList: v, formatCodeBlock: S, insertLink: g }) });
405
+ }, lt)), [t]), /* @__PURE__ */ n("div", { ref: l, className: `floating-text-format-toolbar ${r ? "active" : ""}`, children: /* @__PURE__ */ n(on, { editor: t, blockType: u, isBold: h, isItalic: p, isUnderline: b, isLink: C, formatHeading: w, formatList: v, formatCodeBlock: y, insertLink: g }) });
405
406
  }
406
407
  function at(t) {
407
408
  const e = te(7), {
408
409
  anchorElem: r
409
- } = t, o = r === void 0 ? document.body : r, [l] = De(), [m, L] = B(!1);
410
- let u;
411
- e[0] !== o || e[1] !== l || e[2] !== m ? (u = /* @__PURE__ */ n(dn, { editor: l, anchorElem: o, isToolbarActive: m, setIsToolbarActive: L }), e[0] = o, e[1] = l, e[2] = m, e[3] = u) : u = e[3];
410
+ } = t, o = r === void 0 ? document.body : r, [l] = Oe(), [u, S] = A(!1);
411
+ let h;
412
+ e[0] !== o || e[1] !== l || e[2] !== u ? (h = /* @__PURE__ */ n(fn, { editor: l, anchorElem: o, isToolbarActive: u, setIsToolbarActive: S }), e[0] = o, e[1] = l, e[2] = u, e[3] = h) : h = e[3];
412
413
  let a;
413
- return e[4] !== o || e[5] !== u ? (a = Ue(u, o), e[4] = o, e[5] = u, e[6] = a) : a = e[6], a;
414
+ return e[4] !== o || e[5] !== h ? (a = He(h, o), e[4] = o, e[5] = h, e[6] = a) : a = e[6], a;
414
415
  }
415
- function fn() {
416
+ function mn() {
416
417
  const t = te(1);
417
418
  let e;
418
419
  return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n("style", { children: `
@@ -451,161 +452,161 @@ function fn() {
451
452
  }
452
453
  ` }), t[0] = e) : e = t[0], e;
453
454
  }
454
- function oo(t) {
455
+ function lo(t) {
455
456
  const e = te(42), {
456
457
  roomId: r,
457
458
  wsUrl: o,
458
459
  wsParams: l,
459
- userName: m,
460
- userColor: L,
461
- placeholder: u
460
+ userName: u,
461
+ userColor: S,
462
+ placeholder: h
462
463
  } = t;
463
464
  let a;
464
465
  e[0] !== l ? (a = l === void 0 ? {} : l, e[0] = l, e[1] = a) : a = e[1];
465
- const p = a, E = m === void 0 ? "Anonymous" : m, b = L === void 0 ? "#30bced" : L, h = oe(null), [C, R] = B(null), [c, w] = B(!1), [v] = B(un);
466
- let S;
467
- e[2] !== v || e[3] !== r || e[4] !== p || e[5] !== o ? (S = () => {
468
- const H = new Et(o, r, v, {
466
+ const p = a, k = u === void 0 ? "Anonymous" : u, b = S === void 0 ? "#30bced" : S, d = ie(null), [C, R] = A(null), [c, w] = A(!1), [v] = A(hn);
467
+ let y;
468
+ e[2] !== v || e[3] !== r || e[4] !== p || e[5] !== o ? (y = () => {
469
+ const j = new kt(o, r, v, {
469
470
  params: p,
470
471
  connect: !1
471
472
  });
472
- return H.on("sync", (G) => {
473
+ return j.on("sync", (G) => {
473
474
  G && w(!0);
474
- }), H;
475
- }, e[2] = v, e[3] = r, e[4] = p, e[5] = o, e[6] = S) : S = e[6];
476
- const [g] = B(S);
477
- let d, i;
478
- e[7] !== g ? (d = () => (g.connect(), () => {
475
+ }), j;
476
+ }, e[2] = v, e[3] = r, e[4] = p, e[5] = o, e[6] = y) : y = e[6];
477
+ const [g] = A(y);
478
+ let f, i;
479
+ e[7] !== g ? (f = () => (g.connect(), () => {
479
480
  g.disconnect();
480
- }), i = [g], e[7] = g, e[8] = d, e[9] = i) : (d = e[8], i = e[9]), q(d, i);
481
- let s, f;
481
+ }), i = [g], e[7] = g, e[8] = f, e[9] = i) : (f = e[8], i = e[9]), Y(f, i);
482
+ let s, m;
482
483
  e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = () => {
483
- R(h.current);
484
- }, f = [], e[10] = s, e[11] = f) : (s = e[10], f = e[11]), q(s, f);
485
- let y;
486
- e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = {
484
+ R(d.current);
485
+ }, m = [], e[10] = s, e[11] = m) : (s = e[10], m = e[11]), Y(s, m);
486
+ let L;
487
+ e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = {
487
488
  namespace: "COLLABORATIVE_EDITOR",
488
489
  nodes: Ve,
489
490
  editorState: null,
490
- onError: mn,
491
+ onError: un,
491
492
  editable: !0,
492
493
  theme: We
493
- }, e[12] = y) : y = e[12];
494
- const x = y;
494
+ }, e[12] = L) : L = e[12];
495
+ const x = L;
495
496
  let T;
496
- e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ n(fn, {}), e[13] = T) : T = e[13];
497
+ e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = /* @__PURE__ */ n(mn, {}), e[13] = T) : T = e[13];
497
498
  const _ = g;
498
- let k;
499
- e[14] !== v || e[15] !== r || e[16] !== _ || e[17] !== b || e[18] !== E ? (k = /* @__PURE__ */ n(Ct, { id: r, doc: v, provider: _, __shouldBootstrapUnsafe: !1, username: E, cursorColor: b }), e[14] = v, e[15] = r, e[16] = _, e[17] = b, e[18] = E, e[19] = k) : k = e[19];
500
- let N, I, z, D, W, O;
501
- e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ n(et, {}), I = /* @__PURE__ */ n(tt, {}), z = /* @__PURE__ */ n(ot, { maxIndent: 7 }), D = /* @__PURE__ */ n(Je, {}), W = /* @__PURE__ */ n(Ge, {}), O = /* @__PURE__ */ n(qe, {}), e[20] = N, e[21] = I, e[22] = z, e[23] = D, e[24] = W, e[25] = O) : (N = e[20], I = e[21], z = e[22], D = e[23], W = e[24], O = e[25]);
502
- let K;
503
- e[26] !== C ? (K = /* @__PURE__ */ n(st, { anchorElem: C }), e[26] = C, e[27] = K) : K = e[27];
504
- let M;
505
- e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ n(Ye, {}), e[28] = M) : M = e[28];
499
+ let E;
500
+ e[14] !== v || e[15] !== r || e[16] !== _ || e[17] !== b || e[18] !== k ? (E = /* @__PURE__ */ n(Ct, { id: r, doc: v, provider: _, __shouldBootstrapUnsafe: !1, username: k, cursorColor: b }), e[14] = v, e[15] = r, e[16] = _, e[17] = b, e[18] = k, e[19] = E) : E = e[19];
501
+ let N, I, B, $, D, O;
502
+ e[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ n(et, {}), I = /* @__PURE__ */ n(tt, {}), B = /* @__PURE__ */ n(ot, { maxIndent: 7 }), $ = /* @__PURE__ */ n(Je, {}), D = /* @__PURE__ */ n(Ge, {}), O = /* @__PURE__ */ n(qe, {}), e[20] = N, e[21] = I, e[22] = B, e[23] = $, e[24] = D, e[25] = O) : (N = e[20], I = e[21], B = e[22], $ = e[23], D = e[24], O = e[25]);
506
503
  let V;
507
- e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ n(Xe, { fullWidth: !1 }), e[29] = V) : V = e[29];
508
- let P;
509
- e[30] !== u || e[31] !== c ? (P = c && u ? /* @__PURE__ */ n($e, { position: "absolute", top: "0", color: "fg.muted", pointerEvents: "none", userSelect: "none", textStyle: "paragraph/M/regular", children: u }) : null, e[30] = u, e[31] = c, e[32] = P) : P = e[32];
510
- let $;
511
- e[33] !== P ? ($ = /* @__PURE__ */ n(nt, { contentEditable: V, placeholder: P, ErrorBoundary: Ze }), e[33] = P, e[34] = $) : $ = e[34];
512
- let A;
513
- e[35] !== C ? (A = C ? /* @__PURE__ */ n(at, { anchorElem: C }) : null, e[35] = C, e[36] = A) : A = e[36];
504
+ e[26] !== C ? (V = /* @__PURE__ */ n(st, { anchorElem: C }), e[26] = C, e[27] = V) : V = e[27];
514
505
  let U;
515
- return e[37] !== k || e[38] !== K || e[39] !== $ || e[40] !== A ? (U = /* @__PURE__ */ ie(Ae, { ref: h, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "visible", children: [
506
+ e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ n(Ye, {}), e[28] = U) : U = e[28];
507
+ let H;
508
+ e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ n(Xe, { fullWidth: !1 }), e[29] = H) : H = e[29];
509
+ let M;
510
+ e[30] !== h || e[31] !== c ? (M = c && h ? /* @__PURE__ */ n(De, { position: "absolute", top: "0", color: "fg.muted", pointerEvents: "none", userSelect: "none", textStyle: "paragraph/M/regular", children: h }) : null, e[30] = h, e[31] = c, e[32] = M) : M = e[32];
511
+ let z;
512
+ e[33] !== M ? (z = /* @__PURE__ */ n(nt, { contentEditable: H, placeholder: M, ErrorBoundary: Ze }), e[33] = M, e[34] = z) : z = e[34];
513
+ let P;
514
+ e[35] !== C ? (P = C ? /* @__PURE__ */ n(at, { anchorElem: C }) : null, e[35] = C, e[36] = P) : P = e[36];
515
+ let F;
516
+ return e[37] !== E || e[38] !== V || e[39] !== z || e[40] !== P ? (F = /* @__PURE__ */ le(Be, { ref: d, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: "100%", position: "relative", direction: "column", overflow: "visible", children: [
516
517
  T,
517
- /* @__PURE__ */ n(Qe, { initialConfig: x, children: /* @__PURE__ */ ie(vt, { children: [
518
- k,
518
+ /* @__PURE__ */ n(Qe, { initialConfig: x, children: /* @__PURE__ */ le(vt, { children: [
519
+ E,
519
520
  N,
520
521
  I,
521
- z,
522
+ B,
523
+ $,
522
524
  D,
523
- W,
524
525
  O,
525
- K,
526
- M,
527
- $,
528
- A
526
+ V,
527
+ U,
528
+ z,
529
+ P
529
530
  ] }) })
530
- ] }), e[37] = k, e[38] = K, e[39] = $, e[40] = A, e[41] = U) : U = e[41], U;
531
+ ] }), e[37] = E, e[38] = V, e[39] = z, e[40] = P, e[41] = F) : F = e[41], F;
531
532
  }
532
- function mn(t) {
533
+ function un(t) {
533
534
  return console.error(t);
534
535
  }
535
- function un() {
536
- return new kt.Doc();
536
+ function hn() {
537
+ return new Et.Doc();
537
538
  }
538
539
  function pn(t) {
539
540
  const e = te(32), {
540
541
  isActive: r,
541
542
  isLinkEditMode: o,
542
543
  editedLinkUrl: l,
543
- editedLinkUrlIsValid: m,
544
- linkUrl: L,
545
- href: u,
544
+ editedLinkUrlIsValid: u,
545
+ linkUrl: S,
546
+ href: h,
546
547
  inputRef: a,
547
548
  onEditedLinkUrlChange: p,
548
- onInputKeyDown: E,
549
+ onInputKeyDown: k,
549
550
  onClose: b,
550
- onSubmit: h,
551
+ onSubmit: d,
551
552
  onEdit: C,
552
553
  onRemove: R
553
554
  } = t;
554
555
  if (!r)
555
556
  return null;
556
557
  if (o) {
557
- const i = !m;
558
+ const i = !u;
558
559
  let s;
559
560
  e[0] !== p ? (s = (I) => {
560
561
  p(I.target.value);
561
562
  }, e[0] = p, e[1] = s) : s = e[1];
562
- let f;
563
- e[2] !== l || e[3] !== a || e[4] !== E || e[5] !== i || e[6] !== s ? (f = /* @__PURE__ */ n(gt, { ref: a, className: "link-editor-url-field", size: "sm", fontSize: "sm", value: l, placeholder: "https://", "aria-label": "Link URL", "aria-invalid": i, onChange: s, onKeyDown: E }), e[2] = l, e[3] = a, e[4] = E, e[5] = i, e[6] = s, e[7] = f) : f = e[7];
564
- let y;
565
- e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ n(Bt, { size: 14 }), e[8] = y) : y = e[8];
563
+ let m;
564
+ e[2] !== l || e[3] !== a || e[4] !== k || e[5] !== i || e[6] !== s ? (m = /* @__PURE__ */ n(gt, { ref: a, className: "link-editor-url-field", size: "sm", fontSize: "sm", value: l, placeholder: "https://", "aria-label": "Link URL", "aria-invalid": i, onChange: s, onKeyDown: k }), e[2] = l, e[3] = a, e[4] = k, e[5] = i, e[6] = s, e[7] = m) : m = e[7];
565
+ let L;
566
+ e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (L = /* @__PURE__ */ n(Bt, { size: 14 }), e[8] = L) : L = e[8];
566
567
  let x;
567
- e[9] !== b ? (x = /* @__PURE__ */ n(j, { content: "Cancel", children: /* @__PURE__ */ n(F, { variant: "ghost", size: "xs", "aria-label": "Cancel link edit", onMouseDown: Ee, onClick: b, children: y }) }), e[9] = b, e[10] = x) : x = e[10];
568
- const T = !m;
568
+ e[9] !== b ? (x = /* @__PURE__ */ n(W, { content: "Cancel", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Cancel link edit", onMouseDown: ke, onClick: b, children: L }) }), e[9] = b, e[10] = x) : x = e[10];
569
+ const T = !u;
569
570
  let _;
570
571
  e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ n(rt, { size: 14 }), e[11] = _) : _ = e[11];
571
- let k;
572
- e[12] !== h || e[13] !== T ? (k = /* @__PURE__ */ n(j, { content: "Confirm", children: /* @__PURE__ */ n(F, { variant: "ghost", size: "xs", "aria-label": "Confirm link edit", disabled: T, onMouseDown: Ee, onClick: h, children: _ }) }), e[12] = h, e[13] = T, e[14] = k) : k = e[14];
572
+ let E;
573
+ e[12] !== d || e[13] !== T ? (E = /* @__PURE__ */ n(W, { content: "Confirm", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Confirm link edit", disabled: T, onMouseDown: ke, onClick: d, children: _ }) }), e[12] = d, e[13] = T, e[14] = E) : E = e[14];
573
574
  let N;
574
- return e[15] !== f || e[16] !== x || e[17] !== k ? (N = /* @__PURE__ */ ie(Pe, { className: "link-editor-content", direction: "row", gap: "1", alignItems: "center", p: "1", children: [
575
- f,
575
+ return e[15] !== m || e[16] !== x || e[17] !== E ? (N = /* @__PURE__ */ le(Ae, { className: "link-editor-content", direction: "row", gap: "1", alignItems: "center", p: "1", children: [
576
+ m,
576
577
  x,
577
- k
578
- ] }), e[15] = f, e[16] = x, e[17] = k, e[18] = N) : N = e[18], N;
578
+ E
579
+ ] }), e[15] = m, e[16] = x, e[17] = E, e[18] = N) : N = e[18], N;
579
580
  }
580
581
  let c;
581
- e[19] !== u || e[20] !== L ? (c = /* @__PURE__ */ n(bt, { href: u, target: "_blank", rel: "noopener noreferrer", className: "link-editor-url-field", fontSize: "sm", textDecoration: "underline", px: "2", truncate: !0, children: L }), e[19] = u, e[20] = L, e[21] = c) : c = e[21];
582
+ e[19] !== h || e[20] !== S ? (c = /* @__PURE__ */ n(bt, { href: h, target: "_blank", rel: "noopener noreferrer", className: "link-editor-url-field", fontSize: "sm", textDecoration: "underline", px: "2", truncate: !0, children: S }), e[19] = h, e[20] = S, e[21] = c) : c = e[21];
582
583
  let w;
583
- e[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ n(zt, { size: 14 }), e[22] = w) : w = e[22];
584
+ e[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ n(Mt, { size: 14 }), e[22] = w) : w = e[22];
584
585
  let v;
585
- e[23] !== C ? (v = /* @__PURE__ */ n(j, { content: "Edit link", children: /* @__PURE__ */ n(F, { variant: "ghost", size: "xs", "aria-label": "Edit link", onMouseDown: Ee, onClick: C, children: w }) }), e[23] = C, e[24] = v) : v = e[24];
586
- let S;
587
- e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ n(Mt, { size: 14 }), e[25] = S) : S = e[25];
586
+ e[23] !== C ? (v = /* @__PURE__ */ n(W, { content: "Edit link", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Edit link", onMouseDown: ke, onClick: C, children: w }) }), e[23] = C, e[24] = v) : v = e[24];
587
+ let y;
588
+ e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (y = /* @__PURE__ */ n(zt, { size: 14 }), e[25] = y) : y = e[25];
588
589
  let g;
589
- e[26] !== R ? (g = /* @__PURE__ */ n(j, { content: "Remove link", children: /* @__PURE__ */ n(F, { variant: "ghost", size: "xs", "aria-label": "Remove link", onMouseDown: Ee, onClick: R, children: S }) }), e[26] = R, e[27] = g) : g = e[27];
590
- let d;
591
- return e[28] !== c || e[29] !== v || e[30] !== g ? (d = /* @__PURE__ */ ie(Pe, { className: "link-editor-content", direction: "row", gap: "1", alignItems: "center", p: "1", children: [
590
+ e[26] !== R ? (g = /* @__PURE__ */ n(W, { content: "Remove link", children: /* @__PURE__ */ n(K, { variant: "ghost", size: "xs", "aria-label": "Remove link", onMouseDown: ke, onClick: R, children: y }) }), e[26] = R, e[27] = g) : g = e[27];
591
+ let f;
592
+ return e[28] !== c || e[29] !== v || e[30] !== g ? (f = /* @__PURE__ */ le(Ae, { className: "link-editor-content", direction: "row", gap: "1", alignItems: "center", p: "1", children: [
592
593
  c,
593
594
  v,
594
595
  g
595
- ] }), e[28] = c, e[29] = v, e[30] = g, e[31] = d) : d = e[31], d;
596
+ ] }), e[28] = c, e[29] = v, e[30] = g, e[31] = f) : f = e[31], f;
596
597
  }
597
- function Ee(t) {
598
+ function ke(t) {
598
599
  t.preventDefault();
599
600
  }
600
- function hn(t, e, r) {
601
+ function gn(t, e, r) {
601
602
  return t && e && r === "";
602
603
  }
603
- function gn(t) {
604
- const e = he(t), r = Z(e, le);
605
- return r ? r.getURL() : le(e) ? e.getURL() : "";
604
+ function bn(t) {
605
+ const e = ge(t), r = Z(e, re);
606
+ return r ? r.getURL() : re(e) ? e.getURL() : "";
606
607
  }
607
608
  const ct = /* @__PURE__ */ new Set(["http:", "https:", "mailto:", "sms:", "tel:"]);
608
- function Me(t) {
609
+ function $e(t) {
609
610
  try {
610
611
  const e = new URL(t);
611
612
  if (!ct.has(e.protocol))
@@ -623,47 +624,47 @@ function dt(t) {
623
624
  return !1;
624
625
  }
625
626
  }
626
- const bn = 8;
627
- function vn({
627
+ const vn = 8;
628
+ function Cn({
628
629
  editor: t,
629
630
  isLink: e,
630
631
  setIsLink: r,
631
632
  anchorElem: o,
632
633
  isLinkEditMode: l,
633
- setIsLinkEditMode: m
634
+ setIsLinkEditMode: u
634
635
  }) {
635
- const L = oe(null), u = oe(null), a = oe(() => {
636
- }), [p, E] = B(""), [b, h] = B("https://"), [C, R] = B(null), c = e || l, w = dt(b);
636
+ const S = ie(null), h = ie(null), a = ie(() => {
637
+ }), [p, k] = A(""), [b, d] = A("https://"), [C, R] = A(null), c = e || l, w = dt(b);
637
638
  a.current = () => {
638
- const d = ee();
639
- if (Q(d)) {
640
- const T = gn(d);
641
- E(T), hn(l, e, T) && S(), l && T !== "" && h(T);
639
+ const f = ee();
640
+ if (Q(f)) {
641
+ const T = bn(f);
642
+ k(T), gn(l, e, T) && y(), l && T !== "" && d(T);
642
643
  }
643
- const i = L.current, s = window.getSelection(), f = document.activeElement;
644
+ const i = S.current, s = window.getSelection(), m = document.activeElement;
644
645
  if (i === null)
645
646
  return;
646
- const y = t.getRootElement(), x = s !== null && s.rangeCount > 0;
647
- if (d !== null && s !== null && x && y?.contains(s.anchorNode) && t.isEditable()) {
647
+ const L = t.getRootElement(), x = s !== null && s.rangeCount > 0;
648
+ if (f !== null && s !== null && x && L?.contains(s.anchorNode) && t.isEditable()) {
648
649
  const T = s.getRangeAt(0).getBoundingClientRect(), _ = new DOMRect(T.left, T.top, 0, T.height);
649
- ke(_, i, o, bn, void 0, "above"), R(d);
650
- } else i.contains(f) || (y !== null && ke(null, i, o), R(null), m(!1), E(""));
651
- }, q(() => {
652
- const d = o.parentElement, i = () => {
650
+ Ee(_, i, o, vn, void 0, "above"), R(f);
651
+ } else i.contains(m) || (L !== null && Ee(null, i, o), R(null), u(!1), k(""));
652
+ }, Y(() => {
653
+ const f = o.parentElement, i = () => {
653
654
  t.getEditorState().read(() => {
654
655
  a.current();
655
656
  });
656
657
  };
657
- return window.addEventListener("resize", i), d && d.addEventListener("scroll", i), () => {
658
- window.removeEventListener("resize", i), d && d.removeEventListener("scroll", i);
658
+ return window.addEventListener("resize", i), f && f.addEventListener("scroll", i), () => {
659
+ window.removeEventListener("resize", i), f && f.removeEventListener("scroll", i);
659
660
  };
660
- }, [o.parentElement, t]), q(() => Le(t.registerUpdateListener(({
661
- editorState: d
661
+ }, [o.parentElement, t]), Y(() => Se(t.registerUpdateListener(({
662
+ editorState: f
662
663
  }) => {
663
- d.read(() => {
664
+ f.read(() => {
664
665
  a.current();
665
666
  });
666
- }), t.registerCommand(Se, () => (a.current(), !0), Be), t.registerCommand(St, () => e ? (r(!1), !0) : !1, lt)), [t, r, e]), q(() => {
667
+ }), t.registerCommand(ye, () => (a.current(), !0), Me), t.registerCommand(yt, () => e ? (r(!1), !0) : !1, lt)), [t, r, e]), Y(() => {
667
668
  t.getEditorState().read(() => {
668
669
  a.current();
669
670
  });
@@ -671,20 +672,20 @@ function vn({
671
672
  c && t.getEditorState().read(() => {
672
673
  a.current();
673
674
  });
674
- }, [t, c]), q(() => {
675
- l && u.current && u.current.focus();
675
+ }, [t, c]), Y(() => {
676
+ l && h.current && h.current.focus();
676
677
  }, [l]);
677
- const v = (d) => {
678
- d.key === "Enter" ? (d.preventDefault(), g()) : d.key === "Escape" && (d.preventDefault(), S());
679
- }, S = () => {
680
- h("https://"), m(!1);
678
+ const v = (f) => {
679
+ f.key === "Enter" ? (f.preventDefault(), g()) : f.key === "Escape" && (f.preventDefault(), y());
680
+ }, y = () => {
681
+ d("https://"), u(!1);
681
682
  }, g = () => {
682
683
  C === null || !w || (t.update(() => {
683
684
  xt(C);
684
- }), t.dispatchCommand(ze, Me(b)), t.update(() => {
685
- const d = ee();
686
- if (Q(d)) {
687
- const i = he(d).getParent();
685
+ }), t.dispatchCommand(ze, $e(b)), t.update(() => {
686
+ const f = ee();
687
+ if (Q(f)) {
688
+ const i = ge(f).getParent();
688
689
  if (pe(i)) {
689
690
  const s = Dt(i.getURL(), {
690
691
  rel: i.__rel,
@@ -694,166 +695,171 @@ function vn({
694
695
  i.replace(s, !0);
695
696
  }
696
697
  }
697
- }), S());
698
+ }), y());
698
699
  };
699
- return /* @__PURE__ */ n($e, { ref: L, className: `link-editor ${c ? "active" : ""}`, children: /* @__PURE__ */ n(pn, { isActive: c, isLinkEditMode: l, editedLinkUrl: b, editedLinkUrlIsValid: w, linkUrl: p, href: Me(p), inputRef: u, onEditedLinkUrlChange: h, onInputKeyDown: v, onClose: S, onSubmit: g, onEdit: () => {
700
- h(p), m(!0);
700
+ return /* @__PURE__ */ n(De, { ref: S, className: `link-editor ${c ? "active" : ""}`, children: /* @__PURE__ */ n(pn, { isActive: c, isLinkEditMode: l, editedLinkUrl: b, editedLinkUrlIsValid: w, linkUrl: p, href: $e(p), inputRef: h, onEditedLinkUrlChange: d, onInputKeyDown: v, onClose: y, onSubmit: g, onEdit: () => {
701
+ d(p), u(!0);
701
702
  }, onRemove: () => {
702
703
  t.dispatchCommand(ze, null);
703
704
  } }) });
704
705
  }
705
- function Cn(t, e, r, o) {
706
- const l = te(13), [m, L] = B(t), [u, a] = B(!1);
707
- let p, E;
706
+ function _n(t, e, r, o) {
707
+ const l = te(13), [u, S] = A(t), [h, a] = A(!1);
708
+ let p, k;
708
709
  l[0] !== t || l[1] !== o ? (p = () => {
709
710
  const C = function() {
710
711
  const c = ee();
711
712
  if (Q(c)) {
712
- const w = he(c), v = Z(w, le), S = Z(w, pe);
713
- if (!(v || S)) {
713
+ const w = ge(c), v = Z(w, re), y = Z(w, pe);
714
+ if (!(v || y)) {
714
715
  a(!1);
715
716
  return;
716
717
  }
717
- const g = c.getNodes().filter(En).find((d) => {
718
- const i = Z(d, le), s = Z(d, pe), f = pe(s) && s.getIsUnlinked();
719
- return v && !v.is(i) || i && !i.is(v) || S && !S.is(s) || s && (!s.is(S) || f);
718
+ const g = c.getNodes().filter(En).find((f) => {
719
+ const i = Z(f, re), s = Z(f, pe), m = pe(s) && s.getIsUnlinked();
720
+ return v && !v.is(i) || i && !i.is(v) || y && !y.is(s) || s && (!s.is(y) || m);
720
721
  });
721
722
  a(!g);
722
723
  }
723
724
  };
724
- return Le(t.registerUpdateListener((R) => {
725
+ return Se(t.registerUpdateListener((R) => {
725
726
  const {
726
727
  editorState: c
727
728
  } = R;
728
729
  c.read(() => {
729
730
  C();
730
731
  });
731
- }), t.registerCommand(Se, (R, c) => (C(), L(c), !1), Oe), t.registerCommand(it, _n, Be), t.registerCommand(Ke, (R) => (o(R), !0), Be));
732
- }, E = [t, o], l[0] = t, l[1] = o, l[2] = p, l[3] = E) : (p = l[2], E = l[3]), q(p, E);
732
+ }), t.registerCommand(ye, (R, c) => (C(), S(c), !1), Ue), t.registerCommand(it, kn, Me), t.registerCommand(Ke, (R) => (o(R), !0), Me));
733
+ }, k = [t, o], l[0] = t, l[1] = o, l[2] = p, l[3] = k) : (p = l[2], k = l[3]), Y(p, k);
733
734
  let b;
734
- l[4] !== m || l[5] !== e || l[6] !== u || l[7] !== r || l[8] !== o ? (b = /* @__PURE__ */ n(vn, { editor: m, isLink: u, anchorElem: e, setIsLink: a, isLinkEditMode: r, setIsLinkEditMode: o }), l[4] = m, l[5] = e, l[6] = u, l[7] = r, l[8] = o, l[9] = b) : b = l[9];
735
- let h;
736
- return l[10] !== e || l[11] !== b ? (h = Ue(b, e), l[10] = e, l[11] = b, l[12] = h) : h = l[12], h;
735
+ l[4] !== u || l[5] !== e || l[6] !== h || l[7] !== r || l[8] !== o ? (b = /* @__PURE__ */ n(Cn, { editor: u, isLink: h, anchorElem: e, setIsLink: a, isLinkEditMode: r, setIsLinkEditMode: o }), l[4] = u, l[5] = e, l[6] = h, l[7] = r, l[8] = o, l[9] = b) : b = l[9];
736
+ let d;
737
+ return l[10] !== e || l[11] !== b ? (d = He(b, e), l[10] = e, l[11] = b, l[12] = d) : d = l[12], d;
737
738
  }
738
- function _n(t) {
739
+ function kn(t) {
739
740
  const e = ee();
740
741
  if (Q(e)) {
741
- const r = he(e), o = Z(r, le);
742
- if (le(o) && (t.metaKey || t.ctrlKey))
743
- return window.open(Me(o.getURL()), "_blank", "noopener,noreferrer"), !0;
742
+ const r = ge(e), o = Z(r, re);
743
+ if (re(o) && (t.metaKey || t.ctrlKey))
744
+ return window.open($e(o.getURL()), "_blank", "noopener,noreferrer"), !0;
744
745
  }
745
746
  return !1;
746
747
  }
747
748
  function En(t) {
748
- return !yt(t);
749
+ return !Lt(t);
749
750
  }
750
- function kn(t) {
751
+ function Sn(t) {
751
752
  const {
752
753
  anchorElem: e
753
- } = t, r = e === void 0 ? document.body : e, [o, l] = B(!1), [m] = De();
754
- return Cn(m, r, o, l);
754
+ } = t, r = e === void 0 ? document.body : e, [o, l] = A(!1), [u] = Oe();
755
+ return _n(u, r, o, l);
755
756
  }
756
- function Ln() {
757
+ function yn() {
757
758
  const t = te(1);
758
759
  let e;
759
760
  return t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ n(et, { validateUrl: dt }), t[0] = e) : e = t[0], e;
760
761
  }
761
- function io(t) {
762
- const e = te(54), {
762
+ function ro(t) {
763
+ const e = te(57), {
763
764
  autoFocus: r,
764
765
  debug: o,
765
766
  defaultState: l,
766
- isEditable: m,
767
- placeholder: L,
768
- scrollable: u,
767
+ isEditable: u,
768
+ placeholder: S,
769
+ scrollable: h,
769
770
  onChange: a
770
- } = t, p = r === void 0 ? !1 : r, E = o === void 0 ? !1 : o, b = l === void 0 ? "" : l, h = m === void 0 ? !1 : m, C = u === void 0 ? !0 : u;
771
+ } = t, p = r === void 0 ? !1 : r, k = o === void 0 ? !1 : o, b = l === void 0 ? "" : l, d = u === void 0 ? !1 : u, C = h === void 0 ? !0 : h;
771
772
  let R;
772
773
  e[0] !== b ? (R = mt(b), e[0] = b, e[1] = R) : R = e[1];
773
774
  const {
774
775
  frontmatter: c,
775
776
  body: w
776
- } = R, v = h && !!a, S = oe(null), [g, d] = B(null);
777
+ } = R, v = d && !!a, y = ie(null), [g, f] = A(null);
777
778
  let i, s;
778
779
  e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = () => {
779
- d(S.current);
780
- }, s = [], e[2] = i, e[3] = s) : (i = e[2], s = e[3]), q(i, s);
781
- let f;
782
- e[4] !== w ? (f = () => Wt(ut(w), He, void 0, !1), e[4] = w, e[5] = f) : f = e[5];
783
- let y;
784
- e[6] !== h || e[7] !== f ? (y = {
780
+ f(y.current);
781
+ }, s = [], e[2] = i, e[3] = s) : (i = e[2], s = e[3]), Y(i, s);
782
+ let m;
783
+ e[4] !== w ? (m = () => Wt(ut(w), Te, void 0, !1), e[4] = w, e[5] = m) : m = e[5];
784
+ let L;
785
+ e[6] !== d || e[7] !== m ? (L = {
785
786
  namespace: "MARKDOWN_EDITOR",
786
787
  nodes: Ve,
787
- editorState: f,
788
- onError: Sn,
789
- editable: h,
788
+ editorState: m,
789
+ onError: Ln,
790
+ editable: d,
790
791
  theme: We
791
- }, e[6] = h, e[7] = f, e[8] = y) : y = e[8];
792
- const x = y, T = C ? "100%" : "auto";
792
+ }, e[6] = d, e[7] = m, e[8] = L) : L = e[8];
793
+ const x = L, T = C ? "100%" : "auto";
793
794
  let _;
794
795
  e[9] !== p ? (_ = p ? /* @__PURE__ */ n(Gt, {}) : null, e[9] = p, e[10] = _) : _ = e[10];
795
- let k, N, I;
796
- e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ n(Yt, {}), N = /* @__PURE__ */ n(Ln, {}), I = /* @__PURE__ */ n(tt, {}), e[11] = k, e[12] = N, e[13] = I) : (k = e[11], N = e[12], I = e[13]);
797
- let z;
798
- e[14] !== h ? (z = h ? /* @__PURE__ */ n(ot, { maxIndent: 7 }) : null, e[14] = h, e[15] = z) : z = e[15];
799
- let D, W, O, K;
800
- e[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ n(qt, {}), W = /* @__PURE__ */ n(Je, {}), O = /* @__PURE__ */ n(Ge, {}), K = /* @__PURE__ */ n(qe, {}), e[16] = D, e[17] = W, e[18] = O, e[19] = K) : (D = e[16], W = e[17], O = e[18], K = e[19]);
796
+ let E, N, I;
797
+ e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = /* @__PURE__ */ n(Yt, {}), N = /* @__PURE__ */ n(yn, {}), I = /* @__PURE__ */ n(tt, {}), e[11] = E, e[12] = N, e[13] = I) : (E = e[11], N = e[12], I = e[13]);
798
+ let B;
799
+ e[14] !== d ? (B = d ? /* @__PURE__ */ n(ot, { maxIndent: 7 }) : null, e[14] = d, e[15] = B) : B = e[15];
800
+ let $;
801
+ e[16] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = /* @__PURE__ */ n(qt, {}), e[16] = $) : $ = e[16];
802
+ let D;
803
+ e[17] !== d ? (D = d ? /* @__PURE__ */ n(Xt, { transformers: Te }) : null, e[17] = d, e[18] = D) : D = e[18];
804
+ let O, V, U;
805
+ e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ n(Je, {}), V = /* @__PURE__ */ n(Ge, {}), U = /* @__PURE__ */ n(qe, {}), e[19] = O, e[20] = V, e[21] = U) : (O = e[19], V = e[20], U = e[21]);
806
+ let H;
807
+ e[22] !== g ? (H = /* @__PURE__ */ n(st, { anchorElem: g }), e[22] = g, e[23] = H) : H = e[23];
801
808
  let M;
802
- e[20] !== g ? (M = /* @__PURE__ */ n(st, { anchorElem: g }), e[20] = g, e[21] = M) : M = e[21];
803
- let V;
804
- e[22] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ n(Ye, {}), e[22] = V) : V = e[22];
809
+ e[24] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ n(Ye, {}), e[24] = M) : M = e[24];
810
+ let z;
811
+ e[25] !== C ? (z = /* @__PURE__ */ n(Xe, { fullWidth: !1, padding: "sm", scrollable: C }), e[25] = C, e[26] = z) : z = e[26];
805
812
  let P;
806
- e[23] !== C ? (P = /* @__PURE__ */ n(Xe, { fullWidth: !1, padding: "sm", scrollable: C }), e[23] = C, e[24] = P) : P = e[24];
807
- let $;
808
- e[25] !== L ? ($ = L ? /* @__PURE__ */ n(Ae, { position: "absolute", padding: "sm", top: "0", left: "0", right: "0", pointerEvents: "none", userSelect: "none", justifyContent: "center", children: /* @__PURE__ */ n($e, { width: "100%", maxWidth: "720px", color: "fg.muted", textStyle: "paragraph/M/regular", children: L }) }) : null, e[25] = L, e[26] = $) : $ = e[26];
809
- let A;
810
- e[27] !== P || e[28] !== $ ? (A = /* @__PURE__ */ n(nt, { contentEditable: P, placeholder: $, ErrorBoundary: Ze }), e[27] = P, e[28] = $, e[29] = A) : A = e[29];
811
- let U;
812
- e[30] !== g || e[31] !== h ? (U = h && g ? /* @__PURE__ */ ie(ft, { children: [
813
+ e[27] !== S ? (P = S ? /* @__PURE__ */ n(Be, { position: "absolute", padding: "sm", top: "0", left: "0", right: "0", pointerEvents: "none", userSelect: "none", justifyContent: "center", children: /* @__PURE__ */ n(De, { width: "100%", maxWidth: "45rem", color: "fg.muted", textStyle: "paragraph/M/regular", children: S }) }) : null, e[27] = S, e[28] = P) : P = e[28];
814
+ let F;
815
+ e[29] !== z || e[30] !== P ? (F = /* @__PURE__ */ n(nt, { contentEditable: z, placeholder: P, ErrorBoundary: Ze }), e[29] = z, e[30] = P, e[31] = F) : F = e[31];
816
+ let j;
817
+ e[32] !== g || e[33] !== d ? (j = d && g ? /* @__PURE__ */ le(ft, { children: [
813
818
  /* @__PURE__ */ n(at, { anchorElem: g }),
814
- /* @__PURE__ */ n(kn, { anchorElem: g })
815
- ] }) : null, e[30] = g, e[31] = h, e[32] = U) : U = e[32];
816
- let H;
817
- e[33] !== c || e[34] !== a || e[35] !== v ? (H = v ? /* @__PURE__ */ n(Xt, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (re) => {
818
- re.read(() => {
819
- const ue = Tt(), ne = Vt(He, ue);
820
- a?.(c + ne);
821
- });
822
- } }) : null, e[33] = c, e[34] = a, e[35] = v, e[36] = H) : H = e[36];
819
+ /* @__PURE__ */ n(Sn, { anchorElem: g })
820
+ ] }) : null, e[32] = g, e[33] = d, e[34] = j) : j = e[34];
823
821
  let G;
824
- e[37] !== h ? (G = /* @__PURE__ */ n(pt, { isEditable: h }), e[37] = h, e[38] = G) : G = e[38];
822
+ e[35] !== c || e[36] !== a || e[37] !== v ? (G = v ? /* @__PURE__ */ n(Qt, { ignoreSelectionChange: !0, ignoreHistoryMergeTagChange: !1, onChange: (he) => {
823
+ he.read(() => {
824
+ const oe = Tt(), se = Vt(Te, oe);
825
+ a?.(c + se);
826
+ });
827
+ } }) : null, e[35] = c, e[36] = a, e[37] = v, e[38] = G) : G = e[38];
825
828
  let J;
826
- e[39] !== E ? (J = E && /* @__PURE__ */ n(ht, {}), e[39] = E, e[40] = J) : J = e[40];
827
- let Y;
828
- e[41] !== x || e[42] !== _ || e[43] !== z || e[44] !== M || e[45] !== A || e[46] !== U || e[47] !== H || e[48] !== G || e[49] !== J ? (Y = /* @__PURE__ */ ie(Qe, { initialConfig: x, children: [
829
+ e[39] !== d ? (J = /* @__PURE__ */ n(ht, { isEditable: d }), e[39] = d, e[40] = J) : J = e[40];
830
+ let X;
831
+ e[41] !== k ? (X = k && /* @__PURE__ */ n(pt, {}), e[41] = k, e[42] = X) : X = e[42];
832
+ let q;
833
+ e[43] !== x || e[44] !== _ || e[45] !== B || e[46] !== D || e[47] !== H || e[48] !== F || e[49] !== j || e[50] !== G || e[51] !== J || e[52] !== X ? (q = /* @__PURE__ */ le(Qe, { initialConfig: x, children: [
829
834
  _,
830
- k,
835
+ E,
831
836
  N,
832
837
  I,
833
- z,
838
+ B,
839
+ $,
834
840
  D,
835
- W,
836
841
  O,
837
- K,
838
- M,
839
842
  V,
840
- A,
841
843
  U,
842
844
  H,
845
+ M,
846
+ F,
847
+ j,
843
848
  G,
844
- J
845
- ] }), e[41] = x, e[42] = _, e[43] = z, e[44] = M, e[45] = A, e[46] = U, e[47] = H, e[48] = G, e[49] = J, e[50] = Y) : Y = e[50];
846
- let X;
847
- return e[51] !== T || e[52] !== Y ? (X = /* @__PURE__ */ n(Ae, { ref: S, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: T, position: "relative", direction: "column", overflow: "visible", children: Y }), e[51] = T, e[52] = Y, e[53] = X) : X = e[53], X;
849
+ J,
850
+ X
851
+ ] }), e[43] = x, e[44] = _, e[45] = B, e[46] = D, e[47] = H, e[48] = F, e[49] = j, e[50] = G, e[51] = J, e[52] = X, e[53] = q) : q = e[53];
852
+ let ne;
853
+ return e[54] !== T || e[55] !== q ? (ne = /* @__PURE__ */ n(Be, { ref: y, className: "rich-text", justifyContent: "space-between", width: "100%", maxWidth: "100%", height: T, position: "relative", direction: "column", overflow: "visible", children: q }), e[54] = T, e[55] = q, e[56] = ne) : ne = e[56], ne;
848
854
  }
849
- function Sn(t) {
855
+ function Ln(t) {
850
856
  return console.error(t);
851
857
  }
852
- function lo(t) {
858
+ function so(t) {
853
859
  const e = t.toLowerCase().trim();
854
860
  return e ? e.startsWith("image/") ? "image" : e === "application/pdf" ? "pdf" : e === "text/markdown" ? "markdown" : e === "text/csv" || e === "text/tab-separated-values" ? "table" : e === "application/json" ? "json" : (e.startsWith("text/") || e.startsWith("application/"), "text") : "text";
855
861
  }
856
- const yn = {
862
+ const xn = {
857
863
  csv: "text/csv",
858
864
  tsv: "text/tab-separated-values",
859
865
  json: "application/json",
@@ -877,21 +883,21 @@ const yn = {
877
883
  yml: "text/yaml",
878
884
  yaml: "text/yaml"
879
885
  };
880
- function ro(t) {
886
+ function ao(t) {
881
887
  const r = (t.split("?")[0]?.split("#")[0] ?? "").split(".").pop()?.toLowerCase();
882
- return r ? yn[r] ?? null : null;
888
+ return r ? xn[r] ?? null : null;
883
889
  }
884
890
  export {
885
- oo as CollaborativeMarkdownEditor,
886
- co as DefaultRichTextCodeEditor,
887
- fo as DefaultRichTextDataTable,
888
- io as MarkdownEditor,
889
- mo as MarkdownPreview,
890
- uo as PromptEditor,
891
- po as RichMessage,
892
- ho as generateEditorStateFromString,
893
- go as getTextFromSerializedEditorState,
894
- lo as inferResourceTypeFromMediaType,
895
- ro as mediaTypeFromPath
891
+ lo as CollaborativeMarkdownEditor,
892
+ mo as DefaultRichTextCodeEditor,
893
+ uo as DefaultRichTextDataTable,
894
+ ro as MarkdownEditor,
895
+ ho as MarkdownPreview,
896
+ po as PromptEditor,
897
+ go as RichMessage,
898
+ bo as generateEditorStateFromString,
899
+ vo as getTextFromSerializedEditorState,
900
+ so as inferResourceTypeFromMediaType,
901
+ ao as mediaTypeFromPath
896
902
  };
897
903
  //# sourceMappingURL=rich-text.js.map