reactjs-tiptap-editor 0.2.21 → 0.2.24

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.
@@ -1,27 +1,26 @@
1
- import { a as yt, I as kt, U as vt, S as Ct, C as Nt, f as ce, N as le, b as At, c as Tt, R as He, F as Lt, H as St, T as Et, E as N, d as Ht, e as Mt, g as zt, h as we, O as Rt, i as Pt, j as It, k as Bt, L as jt, l as Dt, m as pe, n as Ot, o as $t, D as Ft, P as Ut, p as qt, q as Kt, G as Vt, r as Wt, s as Gt, t as Zt, u as Jt, v as Qt, w as Yt, x as nt, y as it, z as at, A as Me, J as Xt, K as en, M as tn, Q as nn, V as an } from "./tiptap-BV9BUpUC.js";
2
- import { P as te, b as Z, $ as de, a0 as he, al as R, am as on, T as ot, A as rn, a4 as sn, an as cn, ao as ln } from "./vendor-DyAqAGVt.js";
3
- import { jsxs as m, jsx as r, Fragment as ye } from "react/jsx-runtime";
4
- import * as J from "react";
5
- import dn, { useMemo as P, useState as v, useRef as G, useCallback as F, Fragment as ze, forwardRef as Re, useImperativeHandle as Pe, useEffect as M } from "react";
6
- import { ChevronDown as Ie, Check as hn, ChevronUp as un, Copy as mn, CopyCheck as fn, SearchIcon as _n, LoaderIcon as gn, LucideTableProperties as bn, LucideSheet as xn, LucideImage as wn, LucideFile as pn, LucideVideo as yn, LucideAudioLines as kn } from "lucide-react";
7
- import { i as Be, T as ke, a as ve, B as V, b as Ce, g as je, A as x, D as Q, c as Y, d as X, e as vn, f as S, u as De, h as Cn, I as z, j as ne, k as rt, l as Se, m as Nn, n as Oe, P as ie, o as ae, p as oe, q as $e, C as An, H as Tn, L as Ln, r as Sn, M as En, s as Hn, t as Ke, v as me, w as K, E as D, x as Mn, y as zn, V as Rn, z as Ve, F as Ne, G as We, S as Pn, J as In, K as Bn, N as j, O as jn, Q as Dn, U as On, W as $n, X as Fn, Y as st } from "./RichTextEditor-aaUynZc2.js";
8
- import { a3 as Vo, $ as Wo, Z as Go, a0 as Zo, _ as Jo, a1 as Qo, a2 as Yo } from "./RichTextEditor-aaUynZc2.js";
9
- import { M as Un, D as ct, u as B, f as qn, g as Kn, h as Ge, i as A, j as lt, k as Vn, T as fe, m as _e, n as ge } from "./index-8id9bPv5.js";
10
- import { bundledThemes as dt, bundledLanguages as ht, createHighlighter as Wn } from "shiki";
11
- import * as C from "@radix-ui/react-select";
12
- import { Slot as Gn } from "@radix-ui/react-slot";
13
- import Fe from "tippy.js";
14
- import Ue from "scroll-into-view-if-needed";
15
- import { EmojiPicker as W } from "frimousse";
16
- import { Packer as Zn, WidthType as Jn } from "docx";
17
- import { DocxSerializer as Qn, defaultNodes as U, defaultMarks as Yn } from "prosemirror-docx";
18
- const qe = dn.forwardRef(
1
+ import { a as ft, I as _t, U as gt, S as bt, C as xt, N as ae, b as oe, t as qe, R as Le, m as re, F as wt, H as pt, T as yt, E as C, c as vt, d as kt, e as Ct, O as Nt, f as At, g as Tt, h as St, L as Lt, i as Et, j as Ht, k as zt, D as Mt, P as Rt, l as It, n as Pt, G as jt, o as Bt, p as Ot, q as Dt, r as $t, s as Ft, u as qt, v as nt, w as it, x as at, y as Ee, z as Ut, A as Kt, J as Vt, K as Wt, M as Gt } from "./tiptap-CXio79KB.js";
2
+ import { u as I, D as Zt, f as Jt, g as Ue, h as N, i as ot, j as Yt, T as le, k as de, m as ue } from "./index-BlV5SJJW.js";
3
+ import { i as He, T as xe, a as we, B as K, b as pe, g as ze, A as x, c as E, u as Me, j as Qt, k as A, l as Z, m as J, n as Y, o as Q, p as rt, q as Ne, r as Xt, s as Re, P as X, t as ee, v as te, w as Ie, x as en, H as tn, L as nn, C as an, M as on, y as rn, z as Ke, F as he, G as U, J as j, I as sn, N as cn, V as ln, O as Ve, Q as ve, S as We, U as dn, W as un, X as hn, Y as P, Z as mn, _ as fn, $ as _n, a0 as gn, a1 as bn, a2 as st } from "./RichTextEditor-C_dIT2FZ.js";
4
+ import { D as Lo, E as Eo, d as Ho, e as zo, K as Mo, f as Ro, h as Io } from "./RichTextEditor-C_dIT2FZ.js";
5
+ import { al as xn, am as wn, an as pn, ao as yn, ap as vn, aq as kn, ar as Cn, as as Nn, at as R, au as An, P as se, T as ct, b as ne, $ as ge, a0 as be, A as Tn, a4 as Sn, av as Ln, aw as En } from "./vendor-VlEklMUJ.js";
6
+ import Pe from "tippy.js";
7
+ import { Packer as Hn, WidthType as zn } from "docx";
8
+ import { DocxSerializer as Mn, defaultNodes as F, defaultMarks as Rn } from "prosemirror-docx";
9
+ import { jsxs as m, jsx as o, Fragment as ye } from "react/jsx-runtime";
10
+ import * as W from "react";
11
+ import In, { useRef as $, useCallback as D, useEffect as T, useMemo as B, Fragment as je, useState as k, forwardRef as Be, useImperativeHandle as Oe } from "react";
12
+ import * as v from "@radix-ui/react-select";
13
+ import { ChevronDown as De, Check as Pn, ChevronUp as jn, SearchIcon as Bn, LoaderIcon as On, LucideTableProperties as Dn, LucideSheet as $n, LucideImage as Fn, LucideFile as qn, LucideVideo as Un, LucideAudioLines as Kn } from "lucide-react";
14
+ import { Slot as Vn } from "@radix-ui/react-slot";
15
+ import $e from "scroll-into-view-if-needed";
16
+ import { EmojiPicker as V } from "frimousse";
17
+ const Fe = In.forwardRef(
19
18
  ({ asChild: e, ...t }, n) => {
20
- var o;
21
- const i = Be[t.icon];
22
- return /* @__PURE__ */ m(ke, { children: [
23
- /* @__PURE__ */ r(ve, { asChild: !0, children: /* @__PURE__ */ r(
24
- e ? Gn : V,
19
+ var r;
20
+ const i = He[t.icon];
21
+ return /* @__PURE__ */ m(xe, { children: [
22
+ /* @__PURE__ */ o(we, { asChild: !0, children: /* @__PURE__ */ o(
23
+ e ? Vn : K,
25
24
  {
26
25
  className: "richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0",
27
26
  disabled: t == null ? void 0 : t.disabled,
@@ -29,18 +28,18 @@ const qe = dn.forwardRef(
29
28
  variant: "ghost",
30
29
  ...t,
31
30
  children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-h-full richtext-items-center richtext-font-normal", children: [
32
- (t == null ? void 0 : t.title) && /* @__PURE__ */ r("div", { className: "richtext-grow richtext-truncate richtext-text-left richtext-text-sm", children: t == null ? void 0 : t.title }),
33
- i && /* @__PURE__ */ r(i, { className: "richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500" })
31
+ (t == null ? void 0 : t.title) && /* @__PURE__ */ o("div", { className: "richtext-grow richtext-truncate richtext-text-left richtext-text-sm", children: t == null ? void 0 : t.title }),
32
+ i && /* @__PURE__ */ o(i, { className: "richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500" })
34
33
  ] })
35
34
  }
36
35
  ) }),
37
- /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center", children: [
38
- (t == null ? void 0 : t.tooltip) && /* @__PURE__ */ r("div", { children: t == null ? void 0 : t.tooltip }),
39
- /* @__PURE__ */ r("div", { className: "richtext-flex", children: !!((o = t == null ? void 0 : t.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: je(t == null ? void 0 : t.shortcutKeys) }) })
36
+ /* @__PURE__ */ o(pe, { children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center", children: [
37
+ (t == null ? void 0 : t.tooltip) && /* @__PURE__ */ o("div", { children: t == null ? void 0 : t.tooltip }),
38
+ /* @__PURE__ */ o("div", { className: "richtext-flex", children: !!((r = t == null ? void 0 : t.shortcutKeys) != null && r.length) && /* @__PURE__ */ o("span", { children: ze(t == null ? void 0 : t.shortcutKeys) }) })
40
39
  ] }) })
41
40
  ] });
42
41
  }
43
- ), co = yt.extend({
42
+ ), Ka = ft.extend({
44
43
  addOptions() {
45
44
  var e;
46
45
  return {
@@ -58,7 +57,7 @@ const qe = dn.forwardRef(
58
57
  })
59
58
  };
60
59
  }
61
- }), lo = kt.extend({
60
+ }), Va = _t.extend({
62
61
  addOptions() {
63
62
  var e;
64
63
  return {
@@ -78,7 +77,7 @@ const qe = dn.forwardRef(
78
77
  }
79
78
  };
80
79
  }
81
- }), ho = vt.extend({
80
+ }), Wa = gt.extend({
82
81
  addOptions() {
83
82
  var e;
84
83
  return {
@@ -98,7 +97,7 @@ const qe = dn.forwardRef(
98
97
  }
99
98
  };
100
99
  }
101
- }), uo = Ct.extend({
100
+ }), Ga = bt.extend({
102
101
  addOptions() {
103
102
  var e;
104
103
  return {
@@ -116,7 +115,7 @@ const qe = dn.forwardRef(
116
115
  })
117
116
  };
118
117
  }
119
- }), mo = Nt.extend({
118
+ }), Za = xt.extend({
120
119
  addOptions() {
121
120
  var e;
122
121
  return {
@@ -135,220 +134,64 @@ const qe = dn.forwardRef(
135
134
  };
136
135
  }
137
136
  });
138
- let I, re;
139
- const Ae = /* @__PURE__ */ new Set(), Te = /* @__PURE__ */ new Set();
140
- function Xn() {
141
- return I;
142
- }
143
- function ei(e) {
144
- if (!I && !re) {
145
- const t = e.themes.filter(
146
- (i) => !!i && i in dt
147
- ), n = e.languages.filter(
148
- (i) => !!i && i in ht
149
- );
150
- return re = Wn({ themes: t, langs: n }).then((i) => {
151
- I = i;
152
- }), re;
153
- }
154
- if (re)
155
- return re;
156
- }
157
- async function ut(e) {
158
- return I && !I.getLoadedThemes().includes(e) && !Te.has(e) && e in dt ? (Te.add(e), await I.loadTheme(e), Te.delete(e), !0) : !1;
159
- }
160
- async function mt(e) {
161
- return I && !I.getLoadedLanguages().includes(e) && !Ae.has(e) && e in ht ? (Ae.add(e), await I.loadLanguage(e), Ae.delete(e), !0) : !1;
162
- }
163
- async function ti({
164
- doc: e,
165
- name: t,
166
- defaultTheme: n,
167
- defaultLanguage: i
168
- }) {
169
- const a = ce(e, (c) => c.type.name === t), o = [
170
- ...a.map((c) => c.node.attrs.theme),
171
- n
172
- ], s = [
173
- ...a.map((c) => c.node.attrs.language),
174
- i
175
- ];
176
- I ? await Promise.all([
177
- ...o.flatMap((c) => ut(c)),
178
- ...s.flatMap((c) => !!c && mt(c))
179
- ]) : await ei({ languages: s, themes: o });
180
- }
181
- function Ze({
182
- doc: e,
183
- name: t,
184
- defaultTheme: n,
185
- defaultLanguage: i
186
- }) {
187
- const a = [];
188
- return ce(e, (s) => s.type.name === t).forEach((s) => {
189
- let c = s.pos + 1, h = s.node.attrs.language || i;
190
- const d = s.node.attrs.theme || n, l = Xn();
191
- if (!l)
192
- return;
193
- l.getLoadedLanguages().includes(h) || (h = "plaintext");
194
- const u = l.getLoadedThemes().includes(d) ? d : l.getLoadedThemes()[0], f = l.codeToTokensBase(s.node.textContent, {
195
- lang: h,
196
- theme: u
197
- });
198
- for (const _ of f) {
199
- for (const w of _) {
200
- const p = c + w.content.length, T = he.inline(c, p, {
201
- style: `color: ${w.color}`
202
- });
203
- a.push(T), c = p;
204
- }
205
- c += 1;
206
- }
207
- }), de.create(e, a);
208
- }
209
- function ni({
210
- name: e,
211
- defaultLanguage: t,
212
- defaultTheme: n
213
- }) {
214
- const i = new te({
215
- key: new Z("shiki"),
216
- view(a) {
217
- class o {
218
- constructor() {
219
- this.initDecorations();
220
- }
221
- update() {
222
- this.checkUndecoratedBlocks();
223
- }
224
- destroy() {
225
- }
226
- // Initialize shiki async, and then highlight initial document
227
- async initDecorations() {
228
- const c = a.state.doc;
229
- await ti({ doc: c, name: e, defaultLanguage: t, defaultTheme: n });
230
- const h = a.state.tr.setMeta("shikiPluginForceDecoration", !0);
231
- a.dispatch(h);
232
- }
233
- // When new codeblocks were added and they have missing themes or
234
- // languages, load those and then add code decorations once again.
235
- async checkUndecoratedBlocks() {
236
- const c = ce(
237
- a.state.doc,
238
- (l) => l.type.name === e
239
- );
240
- if ((await Promise.all(
241
- c.flatMap((l) => [
242
- ut(l.node.attrs.theme),
243
- mt(l.node.attrs.language)
244
- ])
245
- )).includes(!0)) {
246
- const l = a.state.tr.setMeta("shikiPluginForceDecoration", !0);
247
- a.dispatch(l);
248
- }
249
- }
250
- }
251
- return new o();
252
- },
253
- state: {
254
- init: (a, { doc: o }) => Ze({
255
- doc: o,
256
- name: e,
257
- defaultLanguage: t,
258
- defaultTheme: n
259
- }),
260
- apply: (a, o, s, c) => {
261
- const h = s.selection.$head.parent.type.name, d = c.selection.$head.parent.type.name, l = ce(
262
- s.doc,
263
- (_) => _.type.name === e
264
- ), u = ce(
265
- c.doc,
266
- (_) => _.type.name === e
267
- ), f = a.docChanged && ([h, d].includes(e) || u.length !== l.length || a.steps.some((_) => _.from !== void 0 && _.to !== void 0 && l.some((w) => w.pos >= _.from && w.pos + w.node.nodeSize <= _.to)));
268
- return a.getMeta("shikiPluginForceDecoration") || f ? Ze({
269
- doc: a.doc,
270
- name: e,
271
- defaultLanguage: t,
272
- defaultTheme: n
273
- }) : o.map(a.mapping, a.doc);
274
- }
275
- },
276
- props: {
277
- //@ts-expect-error
278
- decorations(a) {
279
- return i.getState(a);
280
- }
137
+ function Wn({ action: e, ...t }) {
138
+ return /* @__PURE__ */ o(
139
+ x,
140
+ {
141
+ action: e,
142
+ disabled: t == null ? void 0 : t.disabled,
143
+ icon: t == null ? void 0 : t.icon,
144
+ tooltip: t == null ? void 0 : t.tooltip
281
145
  }
282
- });
283
- return i;
284
- }
285
- function ii({ action: e, languages: t, ...n }) {
286
- const i = (o) => {
287
- e(o);
288
- }, a = P(() => t == null ? void 0 : t.map((o) => ({
289
- title: Un[o] || o,
290
- // icon: language.icon,
291
- language: o
292
- })), [t]);
293
- return /* @__PURE__ */ m(Q, { children: [
294
- /* @__PURE__ */ r(Y, { disabled: n == null ? void 0 : n.disabled, asChild: !0, children: /* @__PURE__ */ r(
295
- x,
296
- {
297
- tooltip: n == null ? void 0 : n.tooltip,
298
- disabled: n == null ? void 0 : n.disabled,
299
- icon: n == null ? void 0 : n.icon
300
- }
301
- ) }),
302
- /* @__PURE__ */ r(X, { className: "richtext-w-full !richtext-max-h-[180px] !richtext-overflow-y-scroll", children: a == null ? void 0 : a.map((o) => /* @__PURE__ */ r(vn, { onClick: () => i(o.language), children: /* @__PURE__ */ r("div", { className: "richtext-h-full richtext-ml-1", children: o.title }) }, `codeblock-${o.title}`)) })
303
- ] });
146
+ );
304
147
  }
305
- const ai = C.Root, oi = C.Value, ft = J.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ m(
306
- C.Trigger,
148
+ const Ge = v.Root, Gn = v.Value, Ae = W.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ m(
149
+ v.Trigger,
307
150
  {
308
151
  ref: i,
309
- className: S(
152
+ className: E(
310
153
  "richtext-flex richtext-h-10 richtext-w-full richtext-items-center richtext-justify-between richtext-rounded-md richtext-border richtext-border-input richtext-bg-background richtext-px-3 richtext-py-2 richtext-text-sm richtext-ring-offset-background placeholder:richtext-text-muted-foreground focus:richtext-outline-none focus:richtext-ring-2 focus:richtext-ring-ring focus:richtext-ring-offset-2 disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50 [&>span]:richtext-line-clamp-1",
311
154
  e
312
155
  ),
313
156
  ...n,
314
157
  children: [
315
158
  t,
316
- /* @__PURE__ */ r(C.Icon, { asChild: !0, children: /* @__PURE__ */ r(Ie, { className: "richtext-h-4 richtext-w-4 richtext-opacity-50" }) })
159
+ /* @__PURE__ */ o(v.Icon, { asChild: !0, children: /* @__PURE__ */ o(De, { className: "richtext-h-4 richtext-w-4 richtext-opacity-50" }) })
317
160
  ]
318
161
  }
319
162
  ));
320
- ft.displayName = C.Trigger.displayName;
321
- const _t = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
322
- C.ScrollUpButton,
163
+ Ae.displayName = v.Trigger.displayName;
164
+ const lt = W.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
165
+ v.ScrollUpButton,
323
166
  {
324
167
  ref: n,
325
- className: S(
168
+ className: E(
326
169
  "richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",
327
170
  e
328
171
  ),
329
172
  ...t,
330
- children: /* @__PURE__ */ r(un, { className: "richtext-h-4 richtext-w-4" })
173
+ children: /* @__PURE__ */ o(jn, { className: "richtext-h-4 richtext-w-4" })
331
174
  }
332
175
  ));
333
- _t.displayName = C.ScrollUpButton.displayName;
334
- const gt = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
335
- C.ScrollDownButton,
176
+ lt.displayName = v.ScrollUpButton.displayName;
177
+ const dt = W.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
178
+ v.ScrollDownButton,
336
179
  {
337
180
  ref: n,
338
- className: S(
181
+ className: E(
339
182
  "richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",
340
183
  e
341
184
  ),
342
185
  ...t,
343
- children: /* @__PURE__ */ r(Ie, { className: "richtext-h-4 richtext-w-4" })
186
+ children: /* @__PURE__ */ o(De, { className: "richtext-h-4 richtext-w-4" })
344
187
  }
345
188
  ));
346
- gt.displayName = C.ScrollDownButton.displayName;
347
- const bt = J.forwardRef(({ className: e, children: t, position: n = "popper", ...i }, a) => /* @__PURE__ */ r(C.Portal, { children: /* @__PURE__ */ m(
348
- C.Content,
189
+ dt.displayName = v.ScrollDownButton.displayName;
190
+ const Te = W.forwardRef(({ className: e, children: t, position: n = "popper", ...i }, a) => /* @__PURE__ */ o(v.Portal, { children: /* @__PURE__ */ m(
191
+ v.Content,
349
192
  {
350
193
  ref: a,
351
- className: S(
194
+ className: E(
352
195
  "richtext-relative richtext-z-50 richtext-max-h-60 richtext-overflow-y-auto richtext-min-w-[8rem] richtext-overflow-hidden richtext-rounded-md richtext-border richtext-bg-popover richtext-text-popover-foreground richtext-shadow-md data-[state=open]:richtext-animate-in data-[state=closed]:richtext-animate-out data-[state=closed]:richtext-fade-out-0 data-[state=open]:richtext-fade-in-0 data-[state=closed]:richtext-zoom-out-95 data-[state=open]:richtext-zoom-in-95 data-[side=bottom]:richtext-slide-in-from-top-2 data-[side=left]:richtext-slide-in-from-right-2 data-[side=right]:richtext-slide-in-from-left-2 data-[side=top]:richtext-slide-in-from-bottom-2",
353
196
  n === "popper" && "data-[side=bottom]:richtext-translate-y-1 data-[side=left]:richtext--translate-x-1 data-[side=right]:richtext-translate-x-1 data-[side=top]:richtext--translate-y-1",
354
197
  e
@@ -356,182 +199,404 @@ const bt = J.forwardRef(({ className: e, children: t, position: n = "popper", ..
356
199
  position: n,
357
200
  ...i,
358
201
  children: [
359
- /* @__PURE__ */ r(_t, {}),
360
- /* @__PURE__ */ r(
361
- C.Viewport,
202
+ /* @__PURE__ */ o(lt, {}),
203
+ /* @__PURE__ */ o(
204
+ v.Viewport,
362
205
  {
363
- className: S(
206
+ className: E(
364
207
  "richtext-p-1",
365
208
  n === "popper" && "richtext-h-[var(--radix-select-trigger-height)] richtext-w-full richtext-min-w-[var(--radix-select-trigger-width)]"
366
209
  ),
367
210
  children: t
368
211
  }
369
212
  ),
370
- /* @__PURE__ */ r(gt, {})
213
+ /* @__PURE__ */ o(dt, {})
371
214
  ]
372
215
  }
373
216
  ) }));
374
- bt.displayName = C.Content.displayName;
375
- const ri = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
376
- C.Label,
217
+ Te.displayName = v.Content.displayName;
218
+ const Zn = W.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
219
+ v.Label,
377
220
  {
378
221
  ref: n,
379
- className: S("richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-font-semibold", e),
222
+ className: E("richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-font-semibold", e),
380
223
  ...t
381
224
  }
382
225
  ));
383
- ri.displayName = C.Label.displayName;
384
- const Ee = J.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ m(
385
- C.Item,
226
+ Zn.displayName = v.Label.displayName;
227
+ const Se = W.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ m(
228
+ v.Item,
386
229
  {
387
230
  ref: i,
388
- className: S(
231
+ className: E(
389
232
  "richtext-relative richtext-flex richtext-w-full richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-outline-none focus:richtext-bg-accent focus:richtext-text-accent-foreground data-[disabled]:richtext-pointer-events-none data-[disabled]:richtext-opacity-50",
390
233
  e
391
234
  ),
392
235
  ...n,
393
236
  children: [
394
- /* @__PURE__ */ r("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ r(C.ItemIndicator, { children: /* @__PURE__ */ r(hn, { className: "richtext-h-4 richtext-w-4" }) }) }),
395
- /* @__PURE__ */ r(C.ItemText, { children: t })
237
+ /* @__PURE__ */ o("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ o(v.ItemIndicator, { children: /* @__PURE__ */ o(Pn, { className: "richtext-h-4 richtext-w-4" }) }) }),
238
+ /* @__PURE__ */ o(v.ItemText, { children: t })
396
239
  ]
397
240
  }
398
241
  ));
399
- Ee.displayName = C.Item.displayName;
400
- const si = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
401
- C.Separator,
242
+ Se.displayName = v.Item.displayName;
243
+ const Jn = W.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
244
+ v.Separator,
402
245
  {
403
246
  ref: n,
404
- className: S("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted", e),
247
+ className: E("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted", e),
405
248
  ...t
406
249
  }
407
250
  ));
408
- si.displayName = C.Separator.displayName;
409
- function ci() {
410
- const [e, t] = v(!1);
411
- return { isCopied: e, copyToClipboard: async (i) => {
412
- try {
413
- await navigator.clipboard.writeText(i), t(!0), setTimeout(() => t(!1), 2e3);
414
- } catch (a) {
415
- console.error("Failed to copy text: ", a), t(!1);
251
+ Jn.displayName = v.Separator.displayName;
252
+ const Yn = "_wrap_1toeg_1", Qn = "_blockInfoEditable_1toeg_245", Ze = {
253
+ wrap: Yn,
254
+ blockInfoEditable: Qn
255
+ }, me = [
256
+ { value: "plaintext", label: "plaintext" },
257
+ { value: "javascript", label: "JavaScript" },
258
+ { value: "typescript", label: "TypeScript" },
259
+ { value: "html", label: "HTML" },
260
+ { value: "css", label: "CSS" },
261
+ { value: "python", label: "Python" },
262
+ { value: "java", label: "Java" },
263
+ { value: "cpp", label: "C++" },
264
+ { value: "go", label: "Go" },
265
+ { value: "rust", label: "Rust" },
266
+ { value: "sql", label: "SQL" },
267
+ { value: "json", label: "JSON" },
268
+ { value: "yaml", label: "YAML" },
269
+ { value: "markdown", label: "Markdown" },
270
+ { value: "bash", label: "Bash" },
271
+ { value: "php", label: "PHP" }
272
+ ], ke = [2, 4, 8];
273
+ function Xn(e) {
274
+ const t = Me(), n = $(null), i = D(() => Qt(ni.name, e == null ? void 0 : e.editor), [e == null ? void 0 : e.edito]), a = $(null), r = e.node.attrs.code || e.node.textContent || "", s = () => {
275
+ r && navigator.clipboard.writeText(r).then(() => {
276
+ console.log("Copy Success");
277
+ }).catch((l) => {
278
+ console.error("Error:", l);
279
+ });
280
+ }, c = () => {
281
+ e.updateAttributes({
282
+ lineNumbers: !e.node.attrs.lineNumbers
283
+ });
284
+ }, u = () => {
285
+ e.updateAttributes({
286
+ wordWrap: !e.node.attrs.wordWrap
287
+ });
288
+ }, d = (l) => {
289
+ const h = { ...l };
290
+ return h.language && !me.some((f) => f.value === h.language) && (h.language = "plaintext", e.updateAttributes({
291
+ language: "plaintext"
292
+ })), h;
293
+ };
294
+ return T(() => {
295
+ if (n.current) {
296
+ const l = d(e.node.attrs);
297
+ a.current = xn(n.current, {
298
+ readOnly: !e.editor.isEditable,
299
+ language: l.language || "plaintext",
300
+ tabSize: l.tabSize ?? 2,
301
+ lineNumbers: l.lineNumbers ?? !0,
302
+ wordWrap: l.wordWrap ?? !1,
303
+ value: r,
304
+ rtl: !1,
305
+ onUpdate(h) {
306
+ e.updateAttributes({ code: h });
307
+ }
308
+ }), a.current.addExtensions(
309
+ wn(),
310
+ pn(),
311
+ yn(),
312
+ vn(),
313
+ kn(),
314
+ Cn(),
315
+ Nn()
316
+ ), e.node.attrs.shouldFocus && setTimeout(() => {
317
+ var h;
318
+ (h = a.current) == null || h.textarea.focus(), e.updateAttributes({
319
+ shouldFocus: !1
320
+ });
321
+ }, 0);
416
322
  }
417
- } };
418
- }
419
- const li = "_wrap_134f4_1", di = "_maxHeight_134f4_10", hi = "_btnCopy_134f4_13", ui = "_btnDelete_134f4_14", mi = "_blockInfo_134f4_18", fi = "_blockInfoEditable_134f4_28", _i = "_selectLang_134f4_32", gi = "_copied_134f4_58", $ = {
420
- wrap: li,
421
- maxHeight: di,
422
- btnCopy: hi,
423
- btnDelete: ui,
424
- blockInfo: mi,
425
- blockInfoEditable: fi,
426
- selectLang: _i,
427
- copied: gi
428
- };
429
- function bi({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }) {
430
- var f, _;
431
- const { isCopied: a, copyToClipboard: o } = ci(), s = P(() => {
432
- var w;
433
- return (w = i.options.languages) != null && w.length ? i.options.languages : ct;
434
- }, [i.options.languages]), c = De(), h = (_ = (f = e == null ? void 0 : e.options) == null ? void 0 : f.editorProps) == null ? void 0 : _.print, { language: d } = t, l = G(null), u = F(() => Cn(xi.name, e), [e]);
435
- return /* @__PURE__ */ m(le, { className: R($.wrap, !h && $.maxHeight, "render-wrapper"), children: [
436
- /* @__PURE__ */ m(
437
- "div",
438
- {
439
- className: R($.blockInfo, {
440
- [$.blockInfoEditable]: !c
441
- }),
442
- children: [
443
- /* @__PURE__ */ r(
444
- "span",
445
- {
446
- className: R($.btnCopy, a && $.copied),
447
- onClick: () => o(l.current.innerText),
448
- children: a ? /* @__PURE__ */ r(fn, { size: 16 }) : /* @__PURE__ */ r(mn, { size: 16 })
449
- }
450
- ),
451
- /* @__PURE__ */ r(
452
- "span",
453
- {
454
- className: $.btnDelete,
455
- onClick: u,
456
- children: /* @__PURE__ */ r(
457
- z,
323
+ return () => {
324
+ var l, h;
325
+ (l = a.current) != null && l.remove && ((h = a.current) == null || h.remove());
326
+ };
327
+ }, [n]), T(() => {
328
+ var l, h;
329
+ (l = a.current) != null && l.setOption && ((h = a.current) == null || h.setOptions({
330
+ readOnly: e.editor.isEditable
331
+ }));
332
+ }, [a, e.editor.isEditable]), T(() => {
333
+ var l, h;
334
+ if ((l = a.current) != null && l.setOption) {
335
+ const f = d(e.node.attrs);
336
+ (h = a.current) == null || h.setOptions(f);
337
+ }
338
+ }, [a, e.node.attrs.language, e.node.attrs.lineNumbers, e.node.attrs.wordWrap, e.node.attrs.tabSize, e.node.attrs]), /* @__PURE__ */ o(ae, { className: R(Ze.wrap, "render-wrapper"), children: /* @__PURE__ */ o(
339
+ "div",
340
+ {
341
+ ref: n,
342
+ className: R("richtext-node-container richtext-hover-shadow richtext-select-outline richtext-node-code-block", {
343
+ [Ze.blockInfoEditable]: !t
344
+ }),
345
+ children: /* @__PURE__ */ m("div", { className: "richtext-code-block-toolbar", children: [
346
+ /* @__PURE__ */ o("div", { children: /* @__PURE__ */ m(
347
+ Ge,
348
+ {
349
+ defaultValue: e.node.attrs.language,
350
+ disabled: !t,
351
+ onValueChange: (l) => {
352
+ e.updateAttributes({
353
+ language: l
354
+ });
355
+ },
356
+ children: [
357
+ /* @__PURE__ */ o(Ae, { className: "richtext-h-7 richtext-w-[160px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]", children: /* @__PURE__ */ o(Gn, { placeholder: "Select language" }) }),
358
+ /* @__PURE__ */ o(
359
+ Te,
458
360
  {
459
- name: "Trash2"
361
+ className: "richtext-border-[#3a3f4b] richtext-bg-[#21252b] richtext-text-[#ccc]",
362
+ onCloseAutoFocus: (l) => l.preventDefault(),
363
+ children: me == null ? void 0 : me.map(
364
+ (l) => /* @__PURE__ */ o(
365
+ Se,
366
+ {
367
+ className: "focus:richtext-bg-[#5a5d5e4f] focus:richtext-text-white",
368
+ value: l.value,
369
+ children: l.label
370
+ },
371
+ l.value
372
+ )
373
+ )
460
374
  }
461
375
  )
462
- }
463
- ),
464
- /* @__PURE__ */ r("div", { className: $.selectLang, children: /* @__PURE__ */ m(
465
- ai,
466
- {
467
- defaultValue: d || "auto",
468
- disabled: !c,
469
- onValueChange: (w) => n({ language: w }),
470
- children: [
471
- /* @__PURE__ */ r(ft, { children: /* @__PURE__ */ r(oi, { placeholder: "Language" }) }),
472
- /* @__PURE__ */ m(bt, { className: "richtext-max-h-60 richtext-overflow-y-auto", children: [
473
- /* @__PURE__ */ r(Ee, { value: "auto", children: "Auto" }),
474
- s.map((w, p) => /* @__PURE__ */ r(
475
- Ee,
376
+ ]
377
+ }
378
+ ) }),
379
+ /* @__PURE__ */ o("div", { className: "toolbar-divider" }),
380
+ /* @__PURE__ */ o(
381
+ "div",
382
+ {
383
+ className: "richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",
384
+ onClick: s,
385
+ children: /* @__PURE__ */ o(
386
+ A,
387
+ {
388
+ className: "richtext-size-4",
389
+ name: "Copy"
390
+ }
391
+ )
392
+ }
393
+ ),
394
+ /* @__PURE__ */ o("div", { className: "toolbar-divider" }),
395
+ /* @__PURE__ */ o(
396
+ "div",
397
+ {
398
+ onClick: c,
399
+ className: R("richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]", {
400
+ "richtext-bg-[#5a5d5e4f]": e == null ? void 0 : e.node.attrs.lineNumbers
401
+ }),
402
+ children: /* @__PURE__ */ o(
403
+ A,
404
+ {
405
+ className: "richtext-size-4",
406
+ name: "List"
407
+ }
408
+ )
409
+ }
410
+ ),
411
+ /* @__PURE__ */ o("div", { className: "toolbar-divider" }),
412
+ /* @__PURE__ */ o(
413
+ "div",
414
+ {
415
+ onClick: u,
416
+ className: R("richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]", {
417
+ "richtext-bg-[#5a5d5e4f]": e == null ? void 0 : e.node.attrs.wordWrap
418
+ }),
419
+ children: /* @__PURE__ */ o(
420
+ A,
421
+ {
422
+ className: "richtext-size-4",
423
+ name: "WrapText"
424
+ }
425
+ )
426
+ }
427
+ ),
428
+ /* @__PURE__ */ o("div", { className: "toolbar-divider" }),
429
+ /* @__PURE__ */ o("div", { children: /* @__PURE__ */ m(
430
+ Ge,
431
+ {
432
+ defaultValue: e.node.attrs.tabSize,
433
+ disabled: !t,
434
+ onValueChange: (l) => {
435
+ e.updateAttributes({
436
+ tabSize: l
437
+ });
438
+ },
439
+ children: [
440
+ /* @__PURE__ */ o(Ae, { className: "richtext-h-7 richtext-w-[60px] richtext-border-none richtext-text-sm richtext-outline-none hover:richtext-bg-[#5a5d5e4f]", children: /* @__PURE__ */ o(
441
+ A,
442
+ {
443
+ className: "richtext-size-4",
444
+ name: "IndentIncrease"
445
+ }
446
+ ) }),
447
+ /* @__PURE__ */ o(
448
+ Te,
449
+ {
450
+ className: "richtext-border-[#3a3f4b] richtext-bg-[#21252b] richtext-text-[#ccc]",
451
+ onCloseAutoFocus: (l) => l.preventDefault(),
452
+ children: ke == null ? void 0 : ke.map((l) => /* @__PURE__ */ o(
453
+ Se,
476
454
  {
477
- value: w,
478
- children: w.charAt(0).toUpperCase() + w.slice(1)
455
+ className: "focus:richtext-bg-[#5a5d5e4f] focus:richtext-text-white",
456
+ value: l,
457
+ children: l
479
458
  },
480
- `code-lang-${p}`
459
+ l
481
460
  ))
482
- ] })
483
- ]
484
- }
485
- ) })
486
- ]
487
- }
488
- ),
489
- /* @__PURE__ */ r("pre", { ref: l, children: /* @__PURE__ */ r(At, { as: "code" }) })
490
- ] });
461
+ }
462
+ )
463
+ ]
464
+ }
465
+ ) }),
466
+ /* @__PURE__ */ o("div", { className: "toolbar-divider" }),
467
+ /* @__PURE__ */ o(
468
+ "div",
469
+ {
470
+ className: "richtext-flex richtext-size-7 richtext-cursor-pointer richtext-items-center richtext-justify-center richtext-rounded-sm hover:richtext-bg-[#5a5d5e4f]",
471
+ onClick: i,
472
+ children: /* @__PURE__ */ o(
473
+ A,
474
+ {
475
+ className: "richtext-size-4",
476
+ name: "Trash2"
477
+ }
478
+ )
479
+ }
480
+ )
481
+ ] })
482
+ }
483
+ ) });
491
484
  }
492
- const xi = Tt.extend({
485
+ const ei = /^`{3}([a-z]+)?\s$/, ti = /^~{3}([a-z]+)?\s$/, ni = oe.create({
486
+ name: "codeBlock",
487
+ group: "block",
488
+ atom: !0,
489
+ content: "text*",
493
490
  addOptions() {
494
491
  var e;
495
492
  return {
496
493
  ...(e = this.parent) == null ? void 0 : e.call(this),
497
494
  languages: [],
498
- button: ({ editor: t, t: n, extension: i }) => {
499
- var o, s, c;
500
- const a = (s = (o = i == null ? void 0 : i.options) == null ? void 0 : o.languages) != null && s.length ? (c = i == null ? void 0 : i.options) == null ? void 0 : c.languages : ct;
501
- return {
502
- component: ii,
503
- componentProps: {
504
- action: (h = "js") => t.commands.setCodeBlock({
505
- language: h
506
- }),
507
- isActive: () => t.isActive("codeBlock") || !1,
508
- disabled: !t.can().toggleCodeBlock(),
509
- icon: "Code2",
510
- tooltip: n("editor.codeblock.tooltip"),
511
- languages: a
512
- }
513
- };
495
+ button: ({ editor: t, t: n }) => ({
496
+ component: Wn,
497
+ componentProps: {
498
+ action: () => t.commands.setCodeBlock({}),
499
+ isActive: () => t.isActive("codeBlock") || !1,
500
+ disabled: !1,
501
+ icon: "Code2",
502
+ tooltip: n("editor.codeblock.tooltip")
503
+ }
504
+ })
505
+ };
506
+ },
507
+ addAttributes() {
508
+ return {
509
+ code: {
510
+ default: "",
511
+ parseHTML: (e) => e.textContent || ""
512
+ },
513
+ language: {
514
+ default: "plaintext"
515
+ },
516
+ lineNumbers: {
517
+ default: !0
518
+ },
519
+ wordWrap: {
520
+ default: !1
521
+ },
522
+ tabSize: {
523
+ default: 2
524
+ },
525
+ shouldFocus: {
526
+ default: !0,
527
+ parseHTML: () => !1,
528
+ renderHTML: !1
514
529
  }
515
530
  };
516
531
  },
532
+ parseHTML() {
533
+ return [
534
+ {
535
+ tag: "pre",
536
+ preserveWhitespace: "full",
537
+ getAttrs: (e) => ({
538
+ code: e.textContent || ""
539
+ })
540
+ },
541
+ {
542
+ tag: "pre code",
543
+ preserveWhitespace: "full",
544
+ getAttrs: (e) => ({
545
+ code: e.textContent || ""
546
+ })
547
+ }
548
+ ];
549
+ },
550
+ renderHTML({ HTMLAttributes: e, node: t }) {
551
+ var i;
552
+ const n = t.attrs.code || ((i = t.content.firstChild) == null ? void 0 : i.text) || "";
553
+ return [
554
+ "pre",
555
+ re(this.options.HTMLAttributes, e),
556
+ ["code", {}, n]
557
+ ];
558
+ },
517
559
  addNodeView() {
518
- return He(bi);
560
+ return Le(Xn);
519
561
  },
520
- addProseMirrorPlugins() {
521
- var e;
562
+ addCommands() {
563
+ return {
564
+ setCodeBlock: (e) => ({ commands: t }) => t.insertContent({
565
+ type: this.name,
566
+ attrs: {
567
+ ...e,
568
+ shouldFocus: !0
569
+ }
570
+ })
571
+ };
572
+ },
573
+ addKeyboardShortcuts() {
574
+ return {
575
+ "Mod-Alt-c": () => this.editor.commands.setCodeBlock({})
576
+ };
577
+ },
578
+ addInputRules() {
522
579
  return [
523
- ...((e = this.parent) == null ? void 0 : e.call(this)) || [],
524
- ni({
525
- name: this.name,
526
- defaultLanguage: null,
527
- defaultTheme: this.options.defaultTheme
580
+ qe({
581
+ find: ei,
582
+ type: this.type,
583
+ getAttributes: (e) => ({
584
+ language: e[1]
585
+ })
586
+ }),
587
+ qe({
588
+ find: ti,
589
+ type: this.type,
590
+ getAttributes: (e) => ({
591
+ language: e[1]
592
+ })
528
593
  })
529
594
  ];
530
595
  }
531
596
  });
532
- function wi(e) {
533
- var a, o, s;
534
- const { t, lang: n } = B(), i = P(() => {
597
+ function ii(e) {
598
+ var a, r, s;
599
+ const { t, lang: n } = I(), i = B(() => {
535
600
  var d;
536
601
  const c = (d = e == null ? void 0 : e.items) == null ? void 0 : d.find((l) => l.isActive());
537
602
  return c && !c.default ? {
@@ -544,32 +609,32 @@ function wi(e) {
544
609
  action: () => e.editor.chain().focus().unsetFontFamily().run()
545
610
  };
546
611
  }, [t, n, e]);
547
- return /* @__PURE__ */ m(Q, { children: [
548
- /* @__PURE__ */ r(
549
- Y,
612
+ return /* @__PURE__ */ m(Z, { children: [
613
+ /* @__PURE__ */ o(
614
+ J,
550
615
  {
551
616
  asChild: !0,
552
617
  disabled: e == null ? void 0 : e.disabled,
553
- children: /* @__PURE__ */ r(
554
- qe,
618
+ children: /* @__PURE__ */ o(
619
+ Fe,
555
620
  {
556
621
  disabled: e == null ? void 0 : e.disabled,
557
622
  icon: "MenuDown",
558
- title: ((a = i == null ? void 0 : i.font) == null ? void 0 : a.length) > 7 ? `${(o = i == null ? void 0 : i.font) == null ? void 0 : o.slice(0, 6)}...` : i == null ? void 0 : i.font,
623
+ title: ((a = i == null ? void 0 : i.font) == null ? void 0 : a.length) > 7 ? `${(r = i == null ? void 0 : i.font) == null ? void 0 : r.slice(0, 6)}...` : i == null ? void 0 : i.font,
559
624
  tooltip: e == null ? void 0 : e.tooltip
560
625
  }
561
626
  )
562
627
  }
563
628
  ),
564
- /* @__PURE__ */ r(X, { className: "richtext-w-full", children: (s = e == null ? void 0 : e.items) == null ? void 0 : s.map((c, h) => {
629
+ /* @__PURE__ */ o(Y, { className: "richtext-w-full", children: (s = e == null ? void 0 : e.items) == null ? void 0 : s.map((c, u) => {
565
630
  const d = c.font === t("editor.fontFamily.default.tooltip") ? {} : { fontFamily: c.font };
566
- return /* @__PURE__ */ m(ze, { children: [
567
- /* @__PURE__ */ r(
568
- ne,
631
+ return /* @__PURE__ */ m(je, { children: [
632
+ /* @__PURE__ */ o(
633
+ Q,
569
634
  {
570
635
  checked: (i == null ? void 0 : i.font) === c.font,
571
636
  onClick: c.action,
572
- children: /* @__PURE__ */ r(
637
+ children: /* @__PURE__ */ o(
573
638
  "div",
574
639
  {
575
640
  className: "richtext-ml-1 richtext-h-full",
@@ -579,22 +644,22 @@ function wi(e) {
579
644
  )
580
645
  }
581
646
  ),
582
- c.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ r(rt, {})
583
- ] }, `font-family-${h}`);
647
+ c.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ o(rt, {})
648
+ ] }, `font-family-${u}`);
584
649
  }) })
585
650
  ] });
586
651
  }
587
- const fo = Lt.extend({
652
+ const Ja = wt.extend({
588
653
  addOptions() {
589
654
  var e;
590
655
  return {
591
656
  ...(e = this.parent) == null ? void 0 : e.call(this),
592
- fontFamilyList: qn,
657
+ fontFamilyList: Zt,
593
658
  button({ editor: t, extension: n, t: i }) {
594
659
  var d;
595
- const { extensions: a = [] } = t.extensionManager ?? [], o = Se(((d = n == null ? void 0 : n.options) == null ? void 0 : d.fontFamilyList) || []), s = a.find(
660
+ const { extensions: a = [] } = t.extensionManager ?? [], r = Ne(((d = n == null ? void 0 : n.options) == null ? void 0 : d.fontFamilyList) || []), s = a.find(
596
661
  (l) => l.name === "base-kit"
597
- ), c = o.map((l) => ({
662
+ ), c = r.map((l) => ({
598
663
  action: () => {
599
664
  t.chain().focus().setFontFamily(l.value).run();
600
665
  },
@@ -610,12 +675,12 @@ const fo = Lt.extend({
610
675
  font: i("editor.fontFamily.default.tooltip"),
611
676
  title: i("editor.fontFamily.tooltip")
612
677
  });
613
- const h = c.filter((l) => l.disabled).length === c.length;
678
+ const u = c.filter((l) => l.disabled).length === c.length;
614
679
  return {
615
- component: wi,
680
+ component: ii,
616
681
  componentProps: {
617
682
  tooltip: i("editor.fontFamily.tooltip"),
618
- disabled: h,
683
+ disabled: u,
619
684
  items: c,
620
685
  editor: t
621
686
  }
@@ -624,11 +689,11 @@ const fo = Lt.extend({
624
689
  };
625
690
  }
626
691
  });
627
- function pi(e) {
692
+ function ai(e) {
628
693
  var n;
629
- const t = P(() => {
630
- var o;
631
- const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
694
+ const t = B(() => {
695
+ var r;
696
+ const i = (r = e == null ? void 0 : e.items) == null ? void 0 : r.find((s) => s.isActive());
632
697
  return i && !i.default ? {
633
698
  ...i
634
699
  } : {
@@ -637,14 +702,14 @@ function pi(e) {
637
702
  isActive: () => !1
638
703
  };
639
704
  }, [e]);
640
- return /* @__PURE__ */ m(Q, { children: [
641
- /* @__PURE__ */ r(
642
- Y,
705
+ return /* @__PURE__ */ m(Z, { children: [
706
+ /* @__PURE__ */ o(
707
+ J,
643
708
  {
644
709
  asChild: !0,
645
710
  disabled: e == null ? void 0 : e.disabled,
646
- children: /* @__PURE__ */ r(
647
- qe,
711
+ children: /* @__PURE__ */ o(
712
+ Fe,
648
713
  {
649
714
  disabled: e == null ? void 0 : e.disabled,
650
715
  icon: "MenuDown",
@@ -654,26 +719,26 @@ function pi(e) {
654
719
  )
655
720
  }
656
721
  ),
657
- /* @__PURE__ */ r(X, { className: "richtext-w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
658
- var o, s;
659
- return /* @__PURE__ */ m(ze, { children: [
722
+ /* @__PURE__ */ o(Y, { className: "richtext-w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
723
+ var r, s;
724
+ return /* @__PURE__ */ m(je, { children: [
660
725
  /* @__PURE__ */ m(
661
- ne,
726
+ Q,
662
727
  {
663
728
  checked: (t == null ? void 0 : t.title) === i.title,
664
729
  onClick: i.action,
665
730
  children: [
666
- /* @__PURE__ */ r("div", { className: `heading- richtext-ml-1 richtext-h-full${i.level}`, children: i.title }),
667
- !!((o = i == null ? void 0 : i.shortcutKeys) != null && o.length) && /* @__PURE__ */ r(Nn, { className: "richtext-pl-4", children: (s = i == null ? void 0 : i.shortcutKeys) == null ? void 0 : s.map((c) => Oe(c)).join(" ") })
731
+ /* @__PURE__ */ o("div", { className: `heading- richtext-ml-1 richtext-h-full${i.level}`, children: i.title }),
732
+ !!((r = i == null ? void 0 : i.shortcutKeys) != null && r.length) && /* @__PURE__ */ o(Xt, { className: "richtext-pl-4", children: (s = i == null ? void 0 : i.shortcutKeys) == null ? void 0 : s.map((c) => Re(c)).join(" ") })
668
733
  ]
669
734
  }
670
735
  ),
671
- i.level === 0 && /* @__PURE__ */ r(rt, {})
736
+ i.level === 0 && /* @__PURE__ */ o(rt, {})
672
737
  ] }, `heading-k-${a}`);
673
738
  }) })
674
739
  ] });
675
740
  }
676
- const _o = St.extend({
741
+ const Ya = pt.extend({
677
742
  addOptions() {
678
743
  var e;
679
744
  return {
@@ -681,9 +746,9 @@ const _o = St.extend({
681
746
  levels: [1, 2, 3, 4, 5, 6],
682
747
  button({ editor: t, extension: n, t: i }) {
683
748
  var d;
684
- const { extensions: a = [] } = t.extensionManager ?? [], o = ((d = n.options) == null ? void 0 : d.levels) || [], s = a.find(
749
+ const { extensions: a = [] } = t.extensionManager ?? [], r = ((d = n.options) == null ? void 0 : d.levels) || [], s = a.find(
685
750
  (l) => l.name === "base-kit"
686
- ), c = o.map((l) => ({
751
+ ), c = r.map((l) => ({
687
752
  action: () => t.commands.toggleHeading({ level: l }),
688
753
  isActive: () => t.isActive("heading", { level: l }) || !1,
689
754
  disabled: !t.can().toggleHeading({ level: l }),
@@ -699,12 +764,12 @@ const _o = St.extend({
699
764
  title: i("editor.paragraph.tooltip"),
700
765
  shortcutKeys: ["alt", "mod", "0"]
701
766
  });
702
- const h = c.filter((l) => l.disabled).length === c.length;
767
+ const u = c.filter((l) => l.disabled).length === c.length;
703
768
  return {
704
- component: pi,
769
+ component: ai,
705
770
  componentProps: {
706
771
  tooltip: i("editor.heading.tooltip"),
707
- disabled: h,
772
+ disabled: u,
708
773
  items: c,
709
774
  editor: t
710
775
  }
@@ -713,11 +778,11 @@ const _o = St.extend({
713
778
  };
714
779
  }
715
780
  });
716
- function yi(e) {
781
+ function oi(e) {
717
782
  var n;
718
- const t = P(() => {
719
- var o;
720
- const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
783
+ const t = B(() => {
784
+ var r;
785
+ const i = (r = e == null ? void 0 : e.items) == null ? void 0 : r.find((s) => s.isActive());
721
786
  return i && !i.default ? {
722
787
  ...i,
723
788
  icon: i.icon ? i.icon : e.icon
@@ -727,21 +792,21 @@ function yi(e) {
727
792
  isActive: () => !1
728
793
  };
729
794
  }, [e]);
730
- return /* @__PURE__ */ m(ie, { modal: !0, children: [
731
- /* @__PURE__ */ r(
732
- ae,
795
+ return /* @__PURE__ */ m(X, { modal: !0, children: [
796
+ /* @__PURE__ */ o(
797
+ ee,
733
798
  {
734
799
  asChild: !0,
735
800
  disabled: e == null ? void 0 : e.disabled,
736
- children: /* @__PURE__ */ r(
801
+ children: /* @__PURE__ */ o(
737
802
  x,
738
803
  {
739
804
  customClass: "!richtext-w-12 richtext-h-12",
740
805
  disabled: e == null ? void 0 : e.disabled,
741
806
  icon: e == null ? void 0 : e.icon,
742
807
  tooltip: e == null ? void 0 : e.tooltip,
743
- children: /* @__PURE__ */ r(
744
- z,
808
+ children: /* @__PURE__ */ o(
809
+ A,
745
810
  {
746
811
  className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
747
812
  name: "MenuDown"
@@ -751,29 +816,29 @@ function yi(e) {
751
816
  )
752
817
  }
753
818
  ),
754
- /* @__PURE__ */ r(
755
- oe,
819
+ /* @__PURE__ */ o(
820
+ te,
756
821
  {
757
822
  align: "start",
758
823
  className: "richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",
759
824
  side: "bottom",
760
825
  children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
761
- var o, s;
762
- return /* @__PURE__ */ m(ke, { children: [
763
- /* @__PURE__ */ r(ve, { asChild: !0, children: /* @__PURE__ */ r(
764
- $e,
826
+ var r, s;
827
+ return /* @__PURE__ */ m(xe, { children: [
828
+ /* @__PURE__ */ o(we, { asChild: !0, children: /* @__PURE__ */ o(
829
+ Ie,
765
830
  {
766
831
  className: "richtext-size-7 richtext-p-1",
767
832
  "data-state": t.title === i.title ? "on" : "off",
768
833
  onClick: i == null ? void 0 : i.action,
769
834
  pressed: t.title === i.title,
770
835
  size: "sm",
771
- children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ r(z, { name: i.icon })
836
+ children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ o(A, { name: i.icon })
772
837
  }
773
838
  ) }),
774
- /* @__PURE__ */ m(Ce, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
775
- /* @__PURE__ */ r("span", { children: i.title }),
776
- !!((o = i.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: (s = i.shortcutKeys) == null ? void 0 : s.map((c) => Oe(c)).join(" ") })
839
+ /* @__PURE__ */ m(pe, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
840
+ /* @__PURE__ */ o("span", { children: i.title }),
841
+ !!((r = i.shortcutKeys) != null && r.length) && /* @__PURE__ */ o("span", { children: (s = i.shortcutKeys) == null ? void 0 : s.map((c) => Re(c)).join(" ") })
777
842
  ] })
778
843
  ] }, `text-align-${a}`);
779
844
  })
@@ -781,7 +846,7 @@ function yi(e) {
781
846
  )
782
847
  ] });
783
848
  }
784
- const go = Et.extend({
849
+ const Qa = yt.extend({
785
850
  addOptions() {
786
851
  var e;
787
852
  return {
@@ -793,7 +858,7 @@ const go = Et.extend({
793
858
  t: i
794
859
  }) {
795
860
  var d;
796
- const a = ((d = n.options) == null ? void 0 : d.alignments) || [], o = {
861
+ const a = ((d = n.options) == null ? void 0 : d.alignments) || [], r = {
797
862
  left: ["mod", "Shift", "L"],
798
863
  center: ["mod", "Shift", "E"],
799
864
  right: ["mod", "Shift", "R"],
@@ -804,25 +869,25 @@ const go = Et.extend({
804
869
  right: "AlignRight",
805
870
  justify: "AlignJustify"
806
871
  }, c = a.map((l) => {
807
- var u, f, _;
872
+ var h, f, _;
808
873
  return {
809
874
  title: i(`editor.textalign.${l}.tooltip`),
810
875
  icon: s[l],
811
- shortcutKeys: o[l],
876
+ shortcutKeys: r[l],
812
877
  isActive: () => t.isActive({ textAlign: l }) || !1,
813
878
  action: () => {
814
- var w, p;
815
- return (p = (w = t.commands) == null ? void 0 : w.setTextAlign) == null ? void 0 : p.call(w, l);
879
+ var S, p;
880
+ return (p = (S = t.commands) == null ? void 0 : S.setTextAlign) == null ? void 0 : p.call(S, l);
816
881
  },
817
- disabled: !((_ = (f = (u = t == null ? void 0 : t.can) == null ? void 0 : u.call(t)) == null ? void 0 : f.setTextAlign) != null && _.call(f, l))
882
+ disabled: !((_ = (f = (h = t == null ? void 0 : t.can) == null ? void 0 : h.call(t)) == null ? void 0 : f.setTextAlign) != null && _.call(f, l))
818
883
  };
819
- }), h = c.filter((l) => l.disabled).length === c.length;
884
+ }), u = c.filter((l) => l.disabled).length === c.length;
820
885
  return {
821
- component: yi,
886
+ component: oi,
822
887
  componentProps: {
823
888
  icon: "AlignJustify",
824
889
  tooltip: i("editor.textalign.tooltip"),
825
- disabled: h,
890
+ disabled: u,
826
891
  items: c
827
892
  }
828
893
  };
@@ -830,23 +895,23 @@ const go = Et.extend({
830
895
  };
831
896
  }
832
897
  });
833
- function ki(e) {
898
+ function ri(e) {
834
899
  var i;
835
- const { t } = B(), n = P(() => {
900
+ const { t } = I(), n = B(() => {
836
901
  const a = (e.items || []).find((s) => s.isActive());
837
902
  return a || {
838
903
  title: t("editor.fontSize.default.tooltip"),
839
904
  isActive: () => !1
840
905
  };
841
906
  }, [e]);
842
- return /* @__PURE__ */ m(Q, { children: [
843
- /* @__PURE__ */ r(
844
- Y,
907
+ return /* @__PURE__ */ m(Z, { children: [
908
+ /* @__PURE__ */ o(
909
+ J,
845
910
  {
846
911
  asChild: !0,
847
912
  disabled: e == null ? void 0 : e.disabled,
848
- children: /* @__PURE__ */ r(
849
- qe,
913
+ children: /* @__PURE__ */ o(
914
+ Fe,
850
915
  {
851
916
  disabled: e == null ? void 0 : e.disabled,
852
917
  icon: "MenuDown",
@@ -856,46 +921,46 @@ function ki(e) {
856
921
  )
857
922
  }
858
923
  ),
859
- /* @__PURE__ */ r(X, { className: "richtext-max-h-96 richtext-w-32 richtext-overflow-y-auto", children: (i = e == null ? void 0 : e.items) == null ? void 0 : i.map((a, o) => /* @__PURE__ */ r(
860
- ne,
924
+ /* @__PURE__ */ o(Y, { className: "richtext-max-h-96 richtext-w-32 richtext-overflow-y-auto", children: (i = e == null ? void 0 : e.items) == null ? void 0 : i.map((a, r) => /* @__PURE__ */ o(
925
+ Q,
861
926
  {
862
927
  checked: n.title === a.title,
863
928
  onClick: a.action,
864
- children: /* @__PURE__ */ r("div", { className: "richtext-ml-1 richtext-h-full", children: a.title })
929
+ children: /* @__PURE__ */ o("div", { className: "richtext-ml-1 richtext-h-full", children: a.title })
865
930
  },
866
- `font-size-${o}`
931
+ `font-size-${r}`
867
932
  )) })
868
933
  ] });
869
934
  }
870
- const bo = N.create({
935
+ const Xa = C.create({
871
936
  name: "fontSize",
872
937
  addOptions() {
873
938
  var e;
874
939
  return {
875
940
  ...(e = this.parent) == null ? void 0 : e.call(this),
876
941
  types: ["textStyle"],
877
- fontSizes: [...Kn],
942
+ fontSizes: [...Jt],
878
943
  button({ editor: t, extension: n, t: i }) {
879
- var h;
880
- const a = Se(((h = n.options) == null ? void 0 : h.fontSizes) || Ge), o = Se([Ge])[0], s = a.map((d) => ({
881
- title: d.value === o.value ? i("editor.fontSize.default.tooltip") : String(d.name),
944
+ var u;
945
+ const a = Ne(((u = n.options) == null ? void 0 : u.fontSizes) || Ue), r = Ne([Ue])[0], s = a.map((d) => ({
946
+ title: d.value === r.value ? i("editor.fontSize.default.tooltip") : String(d.name),
882
947
  isActive: () => {
883
948
  const { fontSize: l } = t.getAttributes("textStyle");
884
- return d.value === o.value && l === void 0 ? !0 : t.isActive({ fontSize: String(d.value) }) || !1;
949
+ return d.value === r.value && l === void 0 ? !0 : t.isActive({ fontSize: String(d.value) }) || !1;
885
950
  },
886
951
  action: () => {
887
- if (d.value === o.value) {
952
+ if (d.value === r.value) {
888
953
  t.commands.unsetFontSize();
889
954
  return;
890
955
  }
891
956
  t.commands.setFontSize(String(d.value));
892
957
  },
893
958
  disabled: !t.can().setFontSize(String(d.value)),
894
- divider: d.value === o.value || !1,
895
- default: d.value === o.value || !1
959
+ divider: d.value === r.value || !1,
960
+ default: d.value === r.value || !1
896
961
  })), c = s.filter((d) => d.disabled).length === s.length;
897
962
  return {
898
- component: ki,
963
+ component: ri,
899
964
  componentProps: {
900
965
  editor: t,
901
966
  tooltip: i("editor.fontSize.tooltip"),
@@ -930,8 +995,8 @@ const bo = N.create({
930
995
  };
931
996
  }
932
997
  });
933
- function vi({ fill: e }) {
934
- return /* @__PURE__ */ r(
998
+ function si({ fill: e }) {
999
+ return /* @__PURE__ */ o(
935
1000
  "svg",
936
1001
  {
937
1002
  width: "18px",
@@ -939,8 +1004,8 @@ function vi({ fill: e }) {
939
1004
  viewBox: "0 0 240 240",
940
1005
  version: "1.1",
941
1006
  xmlns: "http://www.w3.org/2000/svg",
942
- children: /* @__PURE__ */ r("g", { stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ r("g", { transform: "translate(0.000000, 0.500000)", children: /* @__PURE__ */ m("g", { transform: "translate(39.000000, 17.353553)", children: [
943
- /* @__PURE__ */ r(
1007
+ children: /* @__PURE__ */ o("g", { stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ o("g", { transform: "translate(0.000000, 0.500000)", children: /* @__PURE__ */ m("g", { transform: "translate(39.000000, 17.353553)", children: [
1008
+ /* @__PURE__ */ o(
944
1009
  "path",
945
1010
  {
946
1011
  d: "M11,201.146447 L167,201.146447 C173.075132,201.146447 178,206.071314 178,212.146447 C178,218.221579 173.075132,223.146447 167,223.146447 L11,223.146447 C4.92486775,223.146447 7.43989126e-16,218.221579 0,212.146447 C-7.43989126e-16,206.071314 4.92486775,201.146447 11,201.146447 Z",
@@ -949,7 +1014,7 @@ function vi({ fill: e }) {
949
1014
  fillRule: "evenodd"
950
1015
  }
951
1016
  ),
952
- /* @__PURE__ */ r(
1017
+ /* @__PURE__ */ o(
953
1018
  "path",
954
1019
  {
955
1020
  d: "M72.3425855,16.8295583 C75.799482,7.50883712 86.1577877,2.75526801 95.4785089,6.21216449 C100.284516,7.99463061 104.096358,11.7387855 105.968745,16.4968188 L106.112518,16.8745422 L159.385152,161.694068 C161.291848,166.877345 158.635655,172.624903 153.452378,174.531599 C148.358469,176.405421 142.719567,173.872338 140.716873,168.864661 L140.614848,168.598825 L89.211,28.86 L37.3759214,168.623816 C35.4885354,173.712715 29.8981043,176.351047 24.7909589,174.617647 L24.5226307,174.522368 C19.4337312,172.634982 16.7953993,167.044551 18.5287999,161.937406 L18.6240786,161.669077 L72.3425855,16.8295583 Z",
@@ -958,7 +1023,7 @@ function vi({ fill: e }) {
958
1023
  fillRule: "nonzero"
959
1024
  }
960
1025
  ),
961
- /* @__PURE__ */ r(
1026
+ /* @__PURE__ */ o(
962
1027
  "path",
963
1028
  {
964
1029
  d: "M121,103.146447 C126.522847,103.146447 131,107.623599 131,113.146447 C131,118.575687 126.673329,122.994378 121.279905,123.142605 L121,123.146447 L55,123.146447 C49.4771525,123.146447 45,118.669294 45,113.146447 C45,107.717207 49.3266708,103.298515 54.7200952,103.150288 L55,103.146447 L121,103.146447 Z",
@@ -971,8 +1036,8 @@ function vi({ fill: e }) {
971
1036
  }
972
1037
  );
973
1038
  }
974
- function Ci(e) {
975
- const [t, n] = v(void 0);
1039
+ function ci(e) {
1040
+ const [t, n] = k(void 0);
976
1041
  function i(s) {
977
1042
  var c;
978
1043
  (c = e.action) == null || c.call(e, s);
@@ -981,36 +1046,36 @@ function Ci(e) {
981
1046
  var s;
982
1047
  (s = e.action) == null || s.call(e, t);
983
1048
  }
984
- const o = F(
985
- on((s) => {
1049
+ const r = D(
1050
+ An((s) => {
986
1051
  n(s);
987
1052
  }, 350),
988
1053
  []
989
1054
  );
990
1055
  return /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-h-[32px]", children: [
991
- /* @__PURE__ */ r(x, { tooltip: e == null ? void 0 : e.tooltip, disabled: e == null ? void 0 : e.disabled, action: a, children: /* @__PURE__ */ r("span", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-text-sm", children: /* @__PURE__ */ r(vi, { fill: t }) }) }),
992
- /* @__PURE__ */ r(
993
- An,
1056
+ /* @__PURE__ */ o(x, { tooltip: e == null ? void 0 : e.tooltip, disabled: e == null ? void 0 : e.disabled, action: a, children: /* @__PURE__ */ o("span", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-text-sm", children: /* @__PURE__ */ o(si, { fill: t }) }) }),
1057
+ /* @__PURE__ */ o(
1058
+ en,
994
1059
  {
995
1060
  selectedColor: t,
996
- setSelectedColor: o,
1061
+ setSelectedColor: r,
997
1062
  onChange: i,
998
1063
  disabled: e == null ? void 0 : e.disabled,
999
1064
  colors: e == null ? void 0 : e.colors,
1000
1065
  defaultColor: e == null ? void 0 : e.defaultColor,
1001
- children: /* @__PURE__ */ r(V, { variant: "ghost", size: "icon", className: "r!ichtext-h-[32px] !richtext-w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ r(z, { className: "!richtext-w-3 !richtext-h-3 richtext-text-zinc-500", name: "MenuDown" }) })
1066
+ children: /* @__PURE__ */ o(K, { variant: "ghost", size: "icon", className: "r!ichtext-h-[32px] !richtext-w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ o(A, { className: "!richtext-w-3 !richtext-h-3 richtext-text-zinc-500", name: "MenuDown" }) })
1002
1067
  }
1003
1068
  )
1004
1069
  ] });
1005
1070
  }
1006
- const xo = Ht.extend({
1071
+ const eo = vt.extend({
1007
1072
  addOptions() {
1008
1073
  var e;
1009
1074
  return {
1010
1075
  ...(e = this.parent) == null ? void 0 : e.call(this),
1011
1076
  button({ editor: t, t: n, extension: i }) {
1012
1077
  return {
1013
- component: Ci,
1078
+ component: ci,
1014
1079
  componentProps: {
1015
1080
  colors: i.options.colors,
1016
1081
  defaultColor: i.options.defaultColor,
@@ -1029,14 +1094,14 @@ const xo = Ht.extend({
1029
1094
  }
1030
1095
  };
1031
1096
  }
1032
- }), wo = Mt.extend({
1097
+ }), to = kt.extend({
1033
1098
  addOptions() {
1034
1099
  var e;
1035
1100
  return {
1036
1101
  ...(e = this.parent) == null ? void 0 : e.call(this),
1037
1102
  multicolor: !0,
1038
1103
  button: ({ editor: t, t: n }) => ({
1039
- component: Tn,
1104
+ component: tn,
1040
1105
  componentProps: {
1041
1106
  action: (i) => {
1042
1107
  typeof i == "string" && t.chain().focus().setHighlight({ color: i }).run(), i === void 0 && t.chain().focus().unsetHighlight().run();
@@ -1050,7 +1115,7 @@ const xo = Ht.extend({
1050
1115
  })
1051
1116
  };
1052
1117
  }
1053
- }), po = zt.extend({
1118
+ }), no = Ct.extend({
1054
1119
  addOptions() {
1055
1120
  var e;
1056
1121
  return {
@@ -1068,7 +1133,7 @@ const xo = Ht.extend({
1068
1133
  })
1069
1134
  };
1070
1135
  }
1071
- }), yo = we.create({
1136
+ }), io = oe.create({
1072
1137
  name: "clear",
1073
1138
  addOptions() {
1074
1139
  var e;
@@ -1085,7 +1150,7 @@ const xo = Ht.extend({
1085
1150
  })
1086
1151
  };
1087
1152
  }
1088
- }), ko = Rt.extend({
1153
+ }), ao = Nt.extend({
1089
1154
  addOptions() {
1090
1155
  var e;
1091
1156
  return {
@@ -1103,7 +1168,7 @@ const xo = Ht.extend({
1103
1168
  })
1104
1169
  };
1105
1170
  }
1106
- }), vo = Pt.extend({
1171
+ }), oo = At.extend({
1107
1172
  addOptions() {
1108
1173
  var e;
1109
1174
  return {
@@ -1130,9 +1195,9 @@ const xo = Ht.extend({
1130
1195
  };
1131
1196
  },
1132
1197
  addExtensions() {
1133
- return [It.configure(this.options.taskItem)];
1198
+ return [Tt.configure(this.options.taskItem)];
1134
1199
  }
1135
- }), Co = Bt.extend({
1200
+ }), ro = St.extend({
1136
1201
  addOptions() {
1137
1202
  var e;
1138
1203
  return {
@@ -1154,25 +1219,25 @@ const xo = Ht.extend({
1154
1219
  };
1155
1220
  }
1156
1221
  });
1157
- function Ni(e) {
1158
- const [t, n] = v(!1);
1159
- function i(a, o, s) {
1160
- e.action && (e.action({ link: a, text: o, openInNewTab: s }), n(!1));
1222
+ function li(e) {
1223
+ const [t, n] = k(!1);
1224
+ function i(a, r, s) {
1225
+ e.action && (e.action({ link: a, text: r, openInNewTab: s }), n(!1));
1161
1226
  }
1162
- return /* @__PURE__ */ m(ie, { modal: !0, open: t, onOpenChange: n, children: [
1163
- /* @__PURE__ */ r(ae, { disabled: e == null ? void 0 : e.disabled, asChild: !0, children: /* @__PURE__ */ r(
1227
+ return /* @__PURE__ */ m(X, { modal: !0, open: t, onOpenChange: n, children: [
1228
+ /* @__PURE__ */ o(ee, { disabled: e == null ? void 0 : e.disabled, asChild: !0, children: /* @__PURE__ */ o(
1164
1229
  x,
1165
1230
  {
1166
1231
  tooltip: e == null ? void 0 : e.tooltip,
1167
1232
  isActive: e == null ? void 0 : e.isActive,
1168
1233
  disabled: e == null ? void 0 : e.disabled,
1169
- children: /* @__PURE__ */ r(z, { name: e == null ? void 0 : e.icon })
1234
+ children: /* @__PURE__ */ o(A, { name: e == null ? void 0 : e.icon })
1170
1235
  }
1171
1236
  ) }),
1172
- /* @__PURE__ */ r(oe, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ r(Ln, { editor: e.editor, onSetLink: i }) })
1237
+ /* @__PURE__ */ o(te, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ o(nn, { editor: e.editor, onSetLink: i }) })
1173
1238
  ] });
1174
1239
  }
1175
- const No = jt.extend({
1240
+ const so = Lt.extend({
1176
1241
  inclusive: !1,
1177
1242
  parseHTML() {
1178
1243
  return [
@@ -1184,7 +1249,7 @@ const No = jt.extend({
1184
1249
  renderHTML({ HTMLAttributes: e }) {
1185
1250
  return [
1186
1251
  "a",
1187
- pe(this.options.HTMLAttributes, e, {
1252
+ re(this.options.HTMLAttributes, e, {
1188
1253
  class: "link"
1189
1254
  }),
1190
1255
  0
@@ -1196,14 +1261,14 @@ const No = jt.extend({
1196
1261
  ...(e = this.parent) == null ? void 0 : e.call(this),
1197
1262
  openOnClick: !0,
1198
1263
  button: ({ editor: t, t: n }) => ({
1199
- component: Ni,
1264
+ component: li,
1200
1265
  componentProps: {
1201
1266
  editor: t,
1202
1267
  action: (i) => {
1203
- const { link: a, text: o, openInNewTab: s } = i;
1268
+ const { link: a, text: r, openInNewTab: s } = i;
1204
1269
  t.chain().extendMarkRange("link").insertContent({
1205
1270
  type: "text",
1206
- text: o,
1271
+ text: r,
1207
1272
  marks: [
1208
1273
  {
1209
1274
  type: "link",
@@ -1226,24 +1291,24 @@ const No = jt.extend({
1226
1291
  },
1227
1292
  addProseMirrorPlugins() {
1228
1293
  return [
1229
- new te({
1294
+ new se({
1230
1295
  props: {
1231
1296
  handleClick: (e, t) => {
1232
- const { schema: n, doc: i, tr: a } = e.state, o = Dt(i.resolve(t), n.marks.link);
1233
- if (!o)
1297
+ const { schema: n, doc: i, tr: a } = e.state, r = Et(i.resolve(t), n.marks.link);
1298
+ if (!r)
1234
1299
  return !1;
1235
- const s = i.resolve(o.from), c = i.resolve(o.to), h = a.setSelection(new ot(s, c));
1236
- e.dispatch(h);
1300
+ const s = i.resolve(r.from), c = i.resolve(r.to), u = a.setSelection(new ct(s, c));
1301
+ e.dispatch(u);
1237
1302
  }
1238
1303
  }
1239
1304
  })
1240
1305
  ];
1241
1306
  }
1242
- }), Ao = Ot.extend({
1307
+ }), co = Ht.extend({
1243
1308
  renderHTML() {
1244
1309
  return [
1245
1310
  "div",
1246
- pe(this.options.HTMLAttributes, {
1311
+ re(this.options.HTMLAttributes, {
1247
1312
  "data-type": this.name
1248
1313
  }),
1249
1314
  ["hr"]
@@ -1271,7 +1336,7 @@ const No = jt.extend({
1271
1336
  };
1272
1337
  }
1273
1338
  });
1274
- function Ai(e) {
1339
+ function di(e) {
1275
1340
  var d;
1276
1341
  const {
1277
1342
  icon: t = void 0,
@@ -1283,39 +1348,39 @@ function Ai(e) {
1283
1348
  // loading = false,
1284
1349
  // shortcutKeys = undefined,
1285
1350
  tooltipOptions: a = {},
1286
- action: o = void 0,
1351
+ action: r = void 0,
1287
1352
  isActive: s = void 0,
1288
1353
  children: c
1289
- } = e, h = Be[t];
1290
- return /* @__PURE__ */ m(ke, { children: [
1291
- /* @__PURE__ */ r(ve, { asChild: !0, children: /* @__PURE__ */ m(
1292
- $e,
1354
+ } = e, u = He[t];
1355
+ return /* @__PURE__ */ m(xe, { children: [
1356
+ /* @__PURE__ */ o(we, { asChild: !0, children: /* @__PURE__ */ m(
1357
+ Ie,
1293
1358
  {
1294
1359
  size: "sm",
1295
1360
  className: `richtext-w-[32px] richtext-h-[32px] ${i}`,
1296
1361
  disabled: s == null ? void 0 : s(),
1297
- onClick: o,
1362
+ onClick: r,
1298
1363
  children: [
1299
- h && /* @__PURE__ */ r(h, { className: "richtext-w-4 richtext-h-4" }),
1300
- c && /* @__PURE__ */ r(ye, { children: c })
1364
+ u && /* @__PURE__ */ o(u, { className: "richtext-w-4 richtext-h-4" }),
1365
+ c && /* @__PURE__ */ o(ye, { children: c })
1301
1366
  ]
1302
1367
  }
1303
1368
  ) }),
1304
- n && /* @__PURE__ */ r(Ce, { ...a, children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24", children: [
1305
- /* @__PURE__ */ r("div", { children: n }),
1306
- !!((d = e == null ? void 0 : e.shortcutKeys) != null && d.length) && /* @__PURE__ */ r("span", { children: je(e == null ? void 0 : e.shortcutKeys) })
1369
+ n && /* @__PURE__ */ o(pe, { ...a, children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24", children: [
1370
+ /* @__PURE__ */ o("div", { children: n }),
1371
+ !!((d = e == null ? void 0 : e.shortcutKeys) != null && d.length) && /* @__PURE__ */ o("span", { children: ze(e == null ? void 0 : e.shortcutKeys) })
1307
1372
  ] }) })
1308
1373
  ] });
1309
1374
  }
1310
- const Ti = ["undo", "redo"], To = $t.extend({
1375
+ const ui = ["undo", "redo"], lo = zt.extend({
1311
1376
  addOptions() {
1312
1377
  var e;
1313
1378
  return {
1314
1379
  ...(e = this.parent) == null ? void 0 : e.call(this),
1315
1380
  depth: 100,
1316
1381
  newGroupDelay: 500,
1317
- button: ({ editor: t, t: n }) => Ti.map((i) => ({
1318
- component: Ai,
1382
+ button: ({ editor: t, t: n }) => ui.map((i) => ({
1383
+ component: di,
1319
1384
  componentProps: {
1320
1385
  action: () => {
1321
1386
  i === "undo" && t.chain().focus().undo().run(), i === "redo" && t.chain().focus().redo().run();
@@ -1329,10 +1394,10 @@ const Ti = ["undo", "redo"], To = $t.extend({
1329
1394
  }))
1330
1395
  };
1331
1396
  }
1332
- }), Li = Ft.extend({
1397
+ }), hi = Mt.extend({
1333
1398
  content: "(block|columns)+"
1334
1399
  // echo editor is a block editor
1335
- }), Lo = N.create({
1400
+ }), uo = C.create({
1336
1401
  name: "columnActionButton",
1337
1402
  addOptions() {
1338
1403
  var e;
@@ -1350,17 +1415,17 @@ const Ti = ["undo", "redo"], To = $t.extend({
1350
1415
  })
1351
1416
  };
1352
1417
  }
1353
- }), Si = N.create({
1418
+ }), mi = C.create({
1354
1419
  name: "selection",
1355
1420
  addProseMirrorPlugins() {
1356
1421
  const { editor: e } = this;
1357
1422
  return [
1358
- new te({
1359
- key: new Z("selection"),
1423
+ new se({
1424
+ key: new ne("selection"),
1360
1425
  props: {
1361
1426
  decorations(t) {
1362
- return t.selection.empty || e.isFocused === !0 ? null : de.create(t.doc, [
1363
- he.inline(t.selection.from, t.selection.to, {
1427
+ return t.selection.empty || e.isFocused === !0 ? null : ge.create(t.doc, [
1428
+ be.inline(t.selection.from, t.selection.to, {
1364
1429
  class: "selection"
1365
1430
  })
1366
1431
  ]);
@@ -1370,8 +1435,8 @@ const Ti = ["undo", "redo"], To = $t.extend({
1370
1435
  ];
1371
1436
  }
1372
1437
  });
1373
- function Ei(e) {
1374
- const { t } = B(), n = P(() => [
1438
+ function fi(e) {
1439
+ const { t } = I(), n = B(() => [
1375
1440
  {
1376
1441
  name: "paragraph",
1377
1442
  label: t("editor.paragraph.tooltip"),
@@ -1427,20 +1492,13 @@ function Ei(e) {
1427
1492
  isActive: () => e.editor.isActive("blockquote"),
1428
1493
  iconName: "TextQuote",
1429
1494
  action: () => e.editor.chain().focus().clearNodes().toggleBlockquote().run()
1430
- },
1431
- {
1432
- name: "codeBlock",
1433
- label: t("editor.codeblock.tooltip"),
1434
- isActive: () => e.editor.isActive("codeBlock"),
1435
- iconName: "Code2",
1436
- action: () => e.editor.chain().focus().clearNodes().toggleCodeBlock().run()
1437
1495
  }
1438
- ], [e.editor, t]), i = P(() => n.findLast((a) => a.isActive()) ?? {
1496
+ ], [e.editor, t]), i = B(() => n.findLast((a) => a.isActive()) ?? {
1439
1497
  label: "Empty"
1440
1498
  }, [n]);
1441
- return /* @__PURE__ */ m(Q, { children: [
1442
- /* @__PURE__ */ r(Y, { asChild: !0, children: /* @__PURE__ */ m(
1443
- V,
1499
+ return /* @__PURE__ */ m(Z, { children: [
1500
+ /* @__PURE__ */ o(J, { asChild: !0, children: /* @__PURE__ */ m(
1501
+ K,
1444
1502
  {
1445
1503
  className: "richtext-flex richtext-h-[32px] richtext-gap-1 richtext-px-1.5",
1446
1504
  variant: "ghost",
@@ -1449,42 +1507,42 @@ function Ei(e) {
1449
1507
  " ",
1450
1508
  i == null ? void 0 : i.label
1451
1509
  ] }),
1452
- /* @__PURE__ */ r(Ie, { className: "richtext-size-4" })
1510
+ /* @__PURE__ */ o(De, { className: "richtext-size-4" })
1453
1511
  ]
1454
1512
  }
1455
1513
  ) }),
1456
- /* @__PURE__ */ r(
1457
- X,
1514
+ /* @__PURE__ */ o(
1515
+ Y,
1458
1516
  {
1459
1517
  align: "start",
1460
1518
  className: "richtext-w-full richtext-p-1",
1461
1519
  hideWhenDetached: !0,
1462
1520
  sideOffset: 5,
1463
- children: n.map((a, o) => {
1521
+ children: n.map((a, r) => {
1464
1522
  var c;
1465
- const s = Be[a.iconName];
1466
- return /* @__PURE__ */ r(
1467
- ne,
1523
+ const s = He[a.iconName];
1524
+ return /* @__PURE__ */ o(
1525
+ Q,
1468
1526
  {
1469
1527
  checked: ((c = a.isActive) == null ? void 0 : c.call(a)) || !1,
1470
1528
  className: "richtext-cursor-pointer",
1471
1529
  onClick: () => a.action(),
1472
1530
  children: /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-px-2", children: [
1473
- /* @__PURE__ */ r(s, { className: "richtext-h3 richtext-w-3" }),
1531
+ /* @__PURE__ */ o(s, { className: "richtext-h3 richtext-w-3" }),
1474
1532
  /* @__PURE__ */ m("span", { children: [
1475
1533
  " ",
1476
1534
  a.label
1477
1535
  ] })
1478
1536
  ] })
1479
1537
  },
1480
- `text-bubble-${o}`
1538
+ `text-bubble-${r}`
1481
1539
  );
1482
1540
  })
1483
1541
  }
1484
1542
  )
1485
1543
  ] });
1486
1544
  }
1487
- const Hi = N.create({
1545
+ const _i = C.create({
1488
1546
  name: "text-bubble",
1489
1547
  addOptions() {
1490
1548
  var e;
@@ -1492,7 +1550,7 @@ const Hi = N.create({
1492
1550
  ...(e = this.parent) == null ? void 0 : e.call(this),
1493
1551
  toolbar: !1,
1494
1552
  button: () => ({
1495
- component: Ei,
1553
+ component: fi,
1496
1554
  componentProps: {}
1497
1555
  })
1498
1556
  };
@@ -1501,7 +1559,7 @@ const Hi = N.create({
1501
1559
  function Je({ types: e, node: t }) {
1502
1560
  return Array.isArray(e) && e.includes(t.type) || t.type === e;
1503
1561
  }
1504
- const Mi = N.create({
1562
+ const gi = C.create({
1505
1563
  name: "trailingNode",
1506
1564
  addOptions() {
1507
1565
  return {
@@ -1510,13 +1568,13 @@ const Mi = N.create({
1510
1568
  };
1511
1569
  },
1512
1570
  addProseMirrorPlugins() {
1513
- const e = new Z(this.name), t = Object.entries(this.editor.schema.nodes).map(([, n]) => n).filter((n) => this.options.notAfter.includes(n.name));
1571
+ const e = new ne(this.name), t = Object.entries(this.editor.schema.nodes).map(([, n]) => n).filter((n) => this.options.notAfter.includes(n.name));
1514
1572
  return [
1515
- new te({
1573
+ new se({
1516
1574
  key: e,
1517
1575
  appendTransaction: (n, i, a) => {
1518
- const { doc: o, tr: s, schema: c } = a, h = e.getState(a), d = o.content.size, l = c.nodes[this.options.node];
1519
- if (h)
1576
+ const { doc: r, tr: s, schema: c } = a, u = e.getState(a), d = r.content.size, l = c.nodes[this.options.node];
1577
+ if (u)
1520
1578
  return s.insert(d, l.create());
1521
1579
  },
1522
1580
  state: {
@@ -1534,39 +1592,39 @@ const Mi = N.create({
1534
1592
  })
1535
1593
  ];
1536
1594
  }
1537
- }), So = N.create({
1595
+ }), ho = C.create({
1538
1596
  name: "base-kit",
1539
1597
  addExtensions() {
1540
1598
  const e = [];
1541
- return this.options.document !== !1 && e.push(Li.configure()), this.options.placeholder !== !1 && e.push(
1542
- Ut.configure({
1599
+ return this.options.document !== !1 && e.push(hi.configure()), this.options.placeholder !== !1 && e.push(
1600
+ Rt.configure({
1543
1601
  placeholder: ({ node: t, pos: n, editor: i }) => {
1544
- var a, o, s, c, h;
1545
- return ((a = t == null ? void 0 : t.type) == null ? void 0 : a.name) === "columns" || ((o = t == null ? void 0 : t.content) == null ? void 0 : o.size) !== 0 ? "" : ((s = t == null ? void 0 : t.type) == null ? void 0 : s.name) === "heading" ? `${A.t(`editor.heading.h${t.attrs.level}.tooltip`)}` : ((c = t == null ? void 0 : t.type) == null ? void 0 : c.name) === "codeBlock" || ((h = t == null ? void 0 : t.type) == null ? void 0 : h.name) === "table" ? "" : i.extensionManager.extensions.some((d) => d.name === "slashCommand") ? A.t("editor.slash") : n === 0 ? A.t("editor.content") : A.t("editor.content");
1602
+ var a, r, s, c, u;
1603
+ return ((a = t == null ? void 0 : t.type) == null ? void 0 : a.name) === "columns" || ((r = t == null ? void 0 : t.content) == null ? void 0 : r.size) !== 0 ? "" : ((s = t == null ? void 0 : t.type) == null ? void 0 : s.name) === "heading" ? `${N.t(`editor.heading.h${t.attrs.level}.tooltip`)}` : ((c = t == null ? void 0 : t.type) == null ? void 0 : c.name) === "codeBlock" || ((u = t == null ? void 0 : t.type) == null ? void 0 : u.name) === "table" ? "" : i.extensionManager.extensions.some((d) => d.name === "slashCommand") ? N.t("editor.slash") : n === 0 ? N.t("editor.content") : N.t("editor.content");
1546
1604
  },
1547
1605
  ...this.options.placeholder
1548
1606
  })
1549
1607
  ), this.options.focus !== !1 && e.push(
1550
- qt.configure({
1608
+ It.configure({
1551
1609
  className: "focus",
1552
1610
  ...this.options.focus
1553
1611
  })
1554
- ), this.options.text !== !1 && e.push(Kt.configure()), this.options.textBubble !== !1 && e.push(Hi.configure()), this.options.gapcursor !== !1 && e.push(Vt.configure()), this.options.dropcursor !== !1 && e.push(
1555
- Wt.configure({
1612
+ ), this.options.text !== !1 && e.push(Pt.configure()), this.options.textBubble !== !1 && e.push(_i.configure()), this.options.gapcursor !== !1 && e.push(jt.configure()), this.options.dropcursor !== !1 && e.push(
1613
+ Bt.configure({
1556
1614
  ...this.options.dropcursor,
1557
1615
  width: 2,
1558
1616
  class: "ProseMirror-dropcursor border-black"
1559
1617
  })
1560
- ), this.options.characterCount !== !1 && e.push(Gt.configure(this.options.characterCount)), this.options.paragraph !== !1 && e.push(Zt.configure(this.options.paragraph)), this.options.hardBreak !== !1 && e.push(Jt.configure(this.options.hardBreak)), this.options.listItem !== !1 && e.push(Qt.configure(this.options.listItem)), this.options.textStyle !== !1 && e.push(Yt.configure(this.options.textStyle)), this.options.trailingNode !== !1 && e.push(Mi.configure(this.options.trailingNode)), this.options.selection !== !1 && e.push(Si), this.options.multiColumn !== !1 && e.push(Sn, En), e;
1618
+ ), this.options.characterCount !== !1 && e.push(Ot.configure(this.options.characterCount)), this.options.paragraph !== !1 && e.push(Dt.configure(this.options.paragraph)), this.options.hardBreak !== !1 && e.push($t.configure(this.options.hardBreak)), this.options.listItem !== !1 && e.push(Ft.configure(this.options.listItem)), this.options.textStyle !== !1 && e.push(qt.configure(this.options.textStyle)), this.options.trailingNode !== !1 && e.push(gi.configure(this.options.trailingNode)), this.options.selection !== !1 && e.push(mi), this.options.multiColumn !== !1 && e.push(an, on), e;
1561
1619
  }
1562
- }), Eo = N.create({
1620
+ }), mo = C.create({
1563
1621
  name: "subAndSuperScript",
1564
1622
  addOptions() {
1565
1623
  var e;
1566
1624
  return {
1567
1625
  ...(e = this.parent) == null ? void 0 : e.call(this),
1568
1626
  button: ({ editor: t, extension: n, t: i }) => {
1569
- const a = n.options.subscript, o = n.options.superscript, s = {
1627
+ const a = n.options.subscript, r = n.options.superscript, s = {
1570
1628
  component: x,
1571
1629
  componentProps: {
1572
1630
  action: () => t.commands.toggleSubscript(),
@@ -1584,8 +1642,8 @@ const Mi = N.create({
1584
1642
  icon: "Superscript",
1585
1643
  tooltip: i("editor.superscript.tooltip")
1586
1644
  }
1587
- }, h = [];
1588
- return a !== !1 && h.push(s), o !== !1 && h.push(c), h;
1645
+ }, u = [];
1646
+ return a !== !1 && u.push(s), r !== !1 && u.push(c), u;
1589
1647
  }
1590
1648
  };
1591
1649
  },
@@ -1594,11 +1652,11 @@ const Mi = N.create({
1594
1652
  return this.options.subscript !== !1 && e.push(nt.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(it.configure(this.options.superscript)), e;
1595
1653
  }
1596
1654
  });
1597
- function zi(e) {
1655
+ function bi(e) {
1598
1656
  var n;
1599
- const t = P(() => {
1600
- var o;
1601
- const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
1657
+ const t = B(() => {
1658
+ var r;
1659
+ const i = (r = e == null ? void 0 : e.items) == null ? void 0 : r.find((s) => s.isActive());
1602
1660
  return i && !i.default ? {
1603
1661
  ...i,
1604
1662
  icon: i != null && i.icon ? i == null ? void 0 : i.icon : e == null ? void 0 : e.icon
@@ -1608,48 +1666,48 @@ function zi(e) {
1608
1666
  isActive: () => !1
1609
1667
  };
1610
1668
  }, [e]);
1611
- return /* @__PURE__ */ m(Q, { children: [
1612
- /* @__PURE__ */ r(
1613
- Y,
1669
+ return /* @__PURE__ */ m(Z, { children: [
1670
+ /* @__PURE__ */ o(
1671
+ J,
1614
1672
  {
1615
1673
  asChild: !0,
1616
1674
  disabled: e == null ? void 0 : e.disabled,
1617
- children: /* @__PURE__ */ r(
1675
+ children: /* @__PURE__ */ o(
1618
1676
  x,
1619
1677
  {
1620
1678
  customClass: "!richtext-w-12 richtext-h-12",
1621
1679
  disabled: e == null ? void 0 : e.disabled,
1622
1680
  icon: e == null ? void 0 : e.icon,
1623
1681
  tooltip: e == null ? void 0 : e.tooltip,
1624
- children: /* @__PURE__ */ r(Hn, { className: "richtext-size-3 richtext-text-gray-500" })
1682
+ children: /* @__PURE__ */ o(rn, { className: "richtext-size-3 richtext-text-gray-500" })
1625
1683
  }
1626
1684
  )
1627
1685
  }
1628
1686
  ),
1629
- /* @__PURE__ */ r(X, { className: "w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => /* @__PURE__ */ m(
1630
- ne,
1687
+ /* @__PURE__ */ o(Y, { className: "w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => /* @__PURE__ */ m(
1688
+ Q,
1631
1689
  {
1632
1690
  checked: t.title === i.title,
1633
1691
  className: "richtext-flex richtext-items-center richtext-gap-3",
1634
1692
  onClick: i.action,
1635
1693
  children: [
1636
- /* @__PURE__ */ r(z, { name: i == null ? void 0 : i.icon }),
1637
- /* @__PURE__ */ r("span", { className: "richtext-ml-1", children: i.title }),
1638
- !!(i != null && i.shortcutKeys) && /* @__PURE__ */ r("span", { className: "richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", children: je(i.shortcutKeys) })
1694
+ /* @__PURE__ */ o(A, { name: i == null ? void 0 : i.icon }),
1695
+ /* @__PURE__ */ o("span", { className: "richtext-ml-1", children: i.title }),
1696
+ !!(i != null && i.shortcutKeys) && /* @__PURE__ */ o("span", { className: "richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", children: ze(i.shortcutKeys) })
1639
1697
  ]
1640
1698
  },
1641
1699
  `more-mark-${a}`
1642
1700
  )) })
1643
1701
  ] });
1644
1702
  }
1645
- const Ho = N.create({
1703
+ const fo = C.create({
1646
1704
  name: "moreMark",
1647
1705
  addOptions() {
1648
1706
  var e;
1649
1707
  return {
1650
1708
  ...(e = this.parent) == null ? void 0 : e.call(this),
1651
1709
  button({ editor: t, extension: n, t: i }) {
1652
- const a = n.options.subscript, o = n.options.superscript, s = {
1710
+ const a = n.options.subscript, r = n.options.superscript, s = {
1653
1711
  action: () => t.commands.toggleSubscript(),
1654
1712
  isActive: () => t.isActive("subscript") || !1,
1655
1713
  disabled: !t.can().toggleSubscript(),
@@ -1663,14 +1721,14 @@ const Ho = N.create({
1663
1721
  icon: "Superscript",
1664
1722
  title: i("editor.superscript.tooltip"),
1665
1723
  shortcutKeys: ["mod", ","]
1666
- }, h = [];
1667
- return a !== !1 && h.push(s), o !== !1 && h.push(c), {
1668
- component: zi,
1724
+ }, u = [];
1725
+ return a !== !1 && u.push(s), r !== !1 && u.push(c), {
1726
+ component: bi,
1669
1727
  componentProps: {
1670
1728
  icon: "Type",
1671
1729
  tooltip: i("editor.moremark"),
1672
1730
  disabled: !t.isEditable,
1673
- items: h
1731
+ items: u
1674
1732
  }
1675
1733
  };
1676
1734
  }
@@ -1680,15 +1738,15 @@ const Ho = N.create({
1680
1738
  const e = [];
1681
1739
  return this.options.subscript !== !1 && e.push(nt.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(it.configure(this.options.superscript)), e;
1682
1740
  }
1683
- }), Mo = N.create({
1741
+ }), _o = C.create({
1684
1742
  name: "indent",
1685
1743
  addOptions() {
1686
1744
  var e;
1687
1745
  return {
1688
1746
  ...(e = this.parent) == null ? void 0 : e.call(this),
1689
1747
  types: ["paragraph", "heading", "blockquote"],
1690
- minIndent: me.min,
1691
- maxIndent: me.max,
1748
+ minIndent: he.min,
1749
+ maxIndent: he.max,
1692
1750
  button({ editor: t, t: n }) {
1693
1751
  return [
1694
1752
  {
@@ -1737,11 +1795,11 @@ const Ho = N.create({
1737
1795
  addCommands() {
1738
1796
  return {
1739
1797
  indent: () => Ke({
1740
- delta: me.more,
1798
+ delta: he.more,
1741
1799
  types: this.options.types
1742
1800
  }),
1743
1801
  outdent: () => Ke({
1744
- delta: me.less,
1802
+ delta: he.less,
1745
1803
  types: this.options.types
1746
1804
  })
1747
1805
  };
@@ -1753,41 +1811,41 @@ const Ho = N.create({
1753
1811
  };
1754
1812
  }
1755
1813
  });
1756
- function Ri(e) {
1814
+ function xi(e) {
1757
1815
  return Number.parseFloat(e.replace("%", "")) / 100;
1758
1816
  }
1759
- function Pi(e) {
1760
- const { t } = B(), [n, i] = v("default");
1817
+ function wi(e) {
1818
+ const { t } = I(), [n, i] = k("default");
1761
1819
  function a(s) {
1762
1820
  s === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(s), i(s);
1763
1821
  }
1764
- const o = P(() => {
1765
- const h = e.editor.extensionManager.extensions.find(
1822
+ const r = B(() => {
1823
+ const u = e.editor.extensionManager.extensions.find(
1766
1824
  (d) => d.name === "lineHeight"
1767
1825
  ).options.lineHeights.map((d) => ({
1768
- label: Ri(d),
1826
+ label: xi(d),
1769
1827
  value: d
1770
1828
  }));
1771
- return h.unshift({
1829
+ return u.unshift({
1772
1830
  label: t("editor.default"),
1773
1831
  value: "default"
1774
- }), h;
1832
+ }), u;
1775
1833
  }, [e]);
1776
- return /* @__PURE__ */ m(Q, { children: [
1777
- /* @__PURE__ */ r(
1778
- Y,
1834
+ return /* @__PURE__ */ m(Z, { children: [
1835
+ /* @__PURE__ */ o(
1836
+ J,
1779
1837
  {
1780
1838
  asChild: !0,
1781
1839
  disabled: e == null ? void 0 : e.disabled,
1782
- children: /* @__PURE__ */ r(
1840
+ children: /* @__PURE__ */ o(
1783
1841
  x,
1784
1842
  {
1785
1843
  customClass: "!richtext-w-12 richtext-h-12",
1786
1844
  disabled: e == null ? void 0 : e.disabled,
1787
1845
  icon: "LineHeight",
1788
1846
  tooltip: e == null ? void 0 : e.tooltip,
1789
- children: /* @__PURE__ */ r(
1790
- z,
1847
+ children: /* @__PURE__ */ o(
1848
+ A,
1791
1849
  {
1792
1850
  className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
1793
1851
  name: "MenuDown"
@@ -1797,8 +1855,8 @@ function Pi(e) {
1797
1855
  )
1798
1856
  }
1799
1857
  ),
1800
- /* @__PURE__ */ r(X, { className: "richtext-min-w-24", children: o == null ? void 0 : o.map((s, c) => /* @__PURE__ */ r(
1801
- ne,
1858
+ /* @__PURE__ */ o(Y, { className: "richtext-min-w-24", children: r == null ? void 0 : r.map((s, c) => /* @__PURE__ */ o(
1859
+ Q,
1802
1860
  {
1803
1861
  checked: s.value === n,
1804
1862
  onClick: () => a(s.value),
@@ -1808,50 +1866,50 @@ function Pi(e) {
1808
1866
  )) })
1809
1867
  ] });
1810
1868
  }
1811
- const Ii = ["paragraph", "heading", "list_item", "todo_item"];
1812
- function Bi(e, t) {
1869
+ const pi = ["paragraph", "heading", "list_item", "todo_item"];
1870
+ function yi(e, t) {
1813
1871
  const { selection: n, doc: i } = e;
1814
- if (!n || !i || !(n instanceof ot || n instanceof rn))
1872
+ if (!n || !i || !(n instanceof ct || n instanceof Tn))
1815
1873
  return e;
1816
- const { from: a, to: o } = n, s = [], c = t && t !== lt ? t : null;
1817
- if (i.nodesBetween(a, o, (h, d) => {
1818
- const l = h.type;
1819
- return Ii.includes(l.name) ? ((h.attrs.lineHeight || null) !== c && s.push({
1820
- node: h,
1874
+ const { from: a, to: r } = n, s = [], c = t && t !== ot ? t : null;
1875
+ if (i.nodesBetween(a, r, (u, d) => {
1876
+ const l = u.type;
1877
+ return pi.includes(l.name) ? ((u.attrs.lineHeight || null) !== c && s.push({
1878
+ node: u,
1821
1879
  pos: d,
1822
1880
  nodeType: l
1823
1881
  }), l.name !== "list_item" && l.name !== "todo_item") : !0;
1824
1882
  }), s.length === 0)
1825
1883
  return e;
1826
- for (const h of s) {
1827
- const { node: d, pos: l, nodeType: u } = h;
1884
+ for (const u of s) {
1885
+ const { node: d, pos: l, nodeType: h } = u;
1828
1886
  let { attrs: f } = d;
1829
1887
  f = {
1830
1888
  ...f,
1831
1889
  lineHeight: c
1832
- }, e = e.setNodeMarkup(l, u, f, d.marks);
1890
+ }, e = e.setNodeMarkup(l, h, f, d.marks);
1833
1891
  }
1834
1892
  return e;
1835
1893
  }
1836
- function ji(e) {
1894
+ function vi(e) {
1837
1895
  return ({ state: t, dispatch: n }) => {
1838
1896
  const { selection: i } = t;
1839
1897
  let { tr: a } = t;
1840
- return a = a.setSelection(i), a = Bi(a, e), a.docChanged ? (n && n(a), !0) : !1;
1898
+ return a = a.setSelection(i), a = yi(a, e), a.docChanged ? (n && n(a), !0) : !1;
1841
1899
  };
1842
1900
  }
1843
- const zo = N.create({
1901
+ const go = C.create({
1844
1902
  name: "lineHeight",
1845
1903
  addOptions() {
1846
1904
  var e;
1847
1905
  return {
1848
1906
  ...(e = this.parent) == null ? void 0 : e.call(this),
1849
1907
  types: ["paragraph", "heading", "list_item", "todo_item"],
1850
- lineHeights: Vn,
1851
- defaultHeight: lt,
1908
+ lineHeights: Yt,
1909
+ defaultHeight: ot,
1852
1910
  button({ editor: t, t: n }) {
1853
1911
  return {
1854
- component: Pi,
1912
+ component: wi,
1855
1913
  componentProps: {
1856
1914
  editor: t,
1857
1915
  tooltip: n("editor.lineheight.tooltip")
@@ -1876,41 +1934,41 @@ const zo = N.create({
1876
1934
  },
1877
1935
  addCommands() {
1878
1936
  return {
1879
- setLineHeight: (e) => ji(e),
1937
+ setLineHeight: (e) => vi(e),
1880
1938
  unsetLineHeight: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "lineHeight"))
1881
1939
  };
1882
1940
  }
1883
1941
  });
1884
- function Di(e, t) {
1885
- var T, E;
1886
- const [n, i] = v(0), [a, o] = v(0), s = G(null), { t: c } = B(), h = G([]);
1887
- Pe(t, () => ({
1942
+ function ki(e, t) {
1943
+ var M, H;
1944
+ const [n, i] = k(0), [a, r] = k(0), s = $(null), { t: c } = I(), u = $([]);
1945
+ Oe(t, () => ({
1888
1946
  onKeyDown: d
1889
- })), M(() => {
1947
+ })), T(() => {
1890
1948
  if (!s.current)
1891
1949
  return;
1892
- const g = a * 1e3 + n, b = h.current[g];
1950
+ const g = a * 1e3 + n, b = u.current[g];
1893
1951
  b && b.scrollIntoView({
1894
1952
  behavior: "smooth",
1895
1953
  block: "nearest"
1896
1954
  });
1897
1955
  }, [n, a]);
1898
1956
  function d({ event: g }) {
1899
- return g.key === "ArrowUp" ? (l(), !0) : g.key === "ArrowDown" ? (u(), !0) : g.key === "Enter" ? (f(), !0) : !1;
1957
+ return g.key === "ArrowUp" ? (l(), !0) : g.key === "ArrowDown" ? (h(), !0) : g.key === "Enter" ? (f(), !0) : !1;
1900
1958
  }
1901
1959
  function l() {
1902
- var k;
1960
+ var y;
1903
1961
  if (e.items.length === 0)
1904
1962
  return !1;
1905
1963
  let g = n - 1, b = a;
1906
- g < 0 && (b = a - 1, g = ((k = e.items[b]) == null ? void 0 : k.commands.length) - 1 || 0), b < 0 && (b = e.items.length - 1, g = e.items[b].commands.length - 1), i(g), o(b);
1964
+ g < 0 && (b = a - 1, g = ((y = e.items[b]) == null ? void 0 : y.commands.length) - 1 || 0), b < 0 && (b = e.items.length - 1, g = e.items[b].commands.length - 1), i(g), r(b);
1907
1965
  }
1908
- function u() {
1966
+ function h() {
1909
1967
  if (e.items.length === 0)
1910
1968
  return !1;
1911
1969
  const g = e.items[a].commands;
1912
- let b = n + 1, k = a;
1913
- g.length - 1 < b && (b = 0, k = a + 1), e.items.length - 1 < k && (k = 0), i(b), o(k);
1970
+ let b = n + 1, y = a;
1971
+ g.length - 1 < b && (b = 0, y = a + 1), e.items.length - 1 < y && (y = 0), i(b), r(y);
1914
1972
  }
1915
1973
  function f() {
1916
1974
  if (e.items.length === 0 || a === -1 || n === -1)
@@ -1918,70 +1976,70 @@ function Di(e, t) {
1918
1976
  _(a, n);
1919
1977
  }
1920
1978
  function _(g, b) {
1921
- const k = e.items[g].commands[b];
1922
- e.command(k);
1979
+ const y = e.items[g].commands[b];
1980
+ e.command(y);
1923
1981
  }
1924
- function w(g, b) {
1982
+ function S(g, b) {
1925
1983
  _(g, b);
1926
1984
  }
1927
- function p(g, b, k) {
1928
- h.current[g * 1e3 + b] = k;
1985
+ function p(g, b, y) {
1986
+ u.current[g * 1e3 + b] = y;
1929
1987
  }
1930
- return /* @__PURE__ */ r(
1988
+ return /* @__PURE__ */ o(
1931
1989
  "div",
1932
1990
  {
1933
1991
  className: "richtext-mb-8 richtext-max-h-[min(80vh,24rem)] richtext-flex-wrap richtext-overflow-auto richtext-rounded-lg !richtext-border !richtext-border-neutral-200 !richtext-bg-white richtext-p-1 !richtext-text-black richtext-shadow-sm dark:!richtext-border-neutral-800 dark:!richtext-bg-black",
1934
1992
  ref: s,
1935
- children: (T = e == null ? void 0 : e.items) != null && T.length ? /* @__PURE__ */ r("div", { className: "richtext-grid richtext-min-w-48 richtext-grid-cols-1 richtext-gap-0.5", children: (E = e == null ? void 0 : e.items) == null ? void 0 : E.map((g, b) => /* @__PURE__ */ m(ze, { children: [
1936
- /* @__PURE__ */ r("div", { className: "richtext-col-[1/-1] richtext-mx-2 richtext-mt-2 richtext-select-none richtext-text-[0.65rem] richtext-font-semibold richtext-uppercase richtext-tracking-wider !richtext-text-neutral-500 first:richtext-mt-0.5", children: g.title }),
1937
- g.commands.map((k, H) => /* @__PURE__ */ m(
1993
+ children: (M = e == null ? void 0 : e.items) != null && M.length ? /* @__PURE__ */ o("div", { className: "richtext-grid richtext-min-w-48 richtext-grid-cols-1 richtext-gap-0.5", children: (H = e == null ? void 0 : e.items) == null ? void 0 : H.map((g, b) => /* @__PURE__ */ m(je, { children: [
1994
+ /* @__PURE__ */ o("div", { className: "richtext-col-[1/-1] richtext-mx-2 richtext-mt-2 richtext-select-none richtext-text-[0.65rem] richtext-font-semibold richtext-uppercase richtext-tracking-wider !richtext-text-neutral-500 first:richtext-mt-0.5", children: g.title }),
1995
+ g.commands.map((y, z) => /* @__PURE__ */ m(
1938
1996
  "button",
1939
1997
  {
1940
- onClick: () => w(b, H),
1941
- ref: (L) => p(b, H, L),
1942
- className: S("richtext-flex richtext-items-center richtext-gap-3 richtext-px-2 richtext-py-1.5 richtext-text-sm !richtext-text-neutral-800 dark:!richtext-text-neutral-200 richtext-text-left richtext-w-full richtext-rounded-sm richtext-outline-none richtext-transition-colors !richtext-bg-transparent hover:!richtext-bg-accent ", {
1943
- "slash-command-active": a === b && n === H
1998
+ onClick: () => S(b, z),
1999
+ ref: (L) => p(b, z, L),
2000
+ className: E("richtext-flex richtext-items-center richtext-gap-3 richtext-px-2 richtext-py-1.5 richtext-text-sm !richtext-text-neutral-800 dark:!richtext-text-neutral-200 richtext-text-left richtext-w-full richtext-rounded-sm richtext-outline-none richtext-transition-colors !richtext-bg-transparent hover:!richtext-bg-accent ", {
2001
+ "slash-command-active": a === b && n === z
1944
2002
  }),
1945
2003
  children: [
1946
- k.iconUrl && /* @__PURE__ */ r(
2004
+ y.iconUrl && /* @__PURE__ */ o(
1947
2005
  "img",
1948
2006
  {
1949
2007
  alt: "",
1950
2008
  className: "richtext-size-6",
1951
- src: k.iconUrl
2009
+ src: y.iconUrl
1952
2010
  }
1953
2011
  ),
1954
- k.iconName && /* @__PURE__ */ r(
1955
- z,
2012
+ y.iconName && /* @__PURE__ */ o(
2013
+ A,
1956
2014
  {
1957
2015
  className: "!richtext-mr-1 !richtext-text-lg",
1958
- name: k.iconName
2016
+ name: y.iconName
1959
2017
  }
1960
2018
  ),
1961
- k.label
2019
+ y.label
1962
2020
  ]
1963
2021
  },
1964
- `command-${H}`
2022
+ `command-${z}`
1965
2023
  ))
1966
- ] }, `slash-${g.title}`)) }) : /* @__PURE__ */ r("div", { className: "richtext-p-3", children: /* @__PURE__ */ r("span", { className: "richtext-text-xs richtext-text-gray-800 dark:richtext-text-gray-100", children: c("editor.slash.empty") }) })
2024
+ ] }, `slash-${g.title}`)) }) : /* @__PURE__ */ o("div", { className: "richtext-p-3", children: /* @__PURE__ */ o("span", { className: "richtext-text-xs richtext-text-gray-800 dark:richtext-text-gray-100", children: c("editor.slash.empty") }) })
1967
2025
  }
1968
2026
  );
1969
2027
  }
1970
- const Oi = Re(Di), $i = {
2028
+ const Ci = Be(ki), Ni = {
1971
2029
  setOpen: (e, t) => {
1972
- K(D.UPLOAD_VIDEO(e), t);
2030
+ U(j.UPLOAD_VIDEO(e), t);
1973
2031
  }
1974
2032
  };
1975
- function Fi(e, t) {
2033
+ function Ai(e, t) {
1976
2034
  const n = [
1977
2035
  {
1978
2036
  name: "format",
1979
- title: A.t("editor.slash.format"),
2037
+ title: N.t("editor.slash.format"),
1980
2038
  commands: []
1981
2039
  },
1982
2040
  {
1983
2041
  name: "insert",
1984
- title: A.t("editor.slash.insert"),
2042
+ title: N.t("editor.slash.insert"),
1985
2043
  commands: []
1986
2044
  }
1987
2045
  ];
@@ -1989,98 +2047,98 @@ function Fi(e, t) {
1989
2047
  i.name.toLowerCase() === "heading" && i.options.levels.forEach((a) => {
1990
2048
  n[0].commands.push({
1991
2049
  name: `heading${a}`,
1992
- label: A.t(`editor.heading.h${a}.tooltip`),
2050
+ label: N.t(`editor.heading.h${a}.tooltip`),
1993
2051
  aliases: [`h${a}`, "bt", `bt${a}`],
1994
2052
  iconName: `Heading${a}`,
1995
- action: ({ editor: o, range: s }) => {
1996
- o.chain().focus().deleteRange(s).setHeading({ level: a }).run();
2053
+ action: ({ editor: r, range: s }) => {
2054
+ r.chain().focus().deleteRange(s).setHeading({ level: a }).run();
1997
2055
  }
1998
2056
  });
1999
2057
  }), i.name.toLowerCase() === "bulletlist" && n[0].commands.push({
2000
2058
  name: "bulletList",
2001
- label: A.t("editor.bulletlist.tooltip"),
2059
+ label: N.t("editor.bulletlist.tooltip"),
2002
2060
  aliases: ["ul", "yxlb"],
2003
2061
  iconName: "List",
2004
- action: ({ editor: a, range: o }) => {
2005
- a.chain().focus().deleteRange(o).toggleBulletList().run();
2062
+ action: ({ editor: a, range: r }) => {
2063
+ a.chain().focus().deleteRange(r).toggleBulletList().run();
2006
2064
  }
2007
2065
  }), i.name.toLowerCase() === "orderedlist" && n[0].commands.push({
2008
2066
  name: "numberedList",
2009
- label: A.t("editor.orderedlist.tooltip"),
2067
+ label: N.t("editor.orderedlist.tooltip"),
2010
2068
  aliases: ["ol", "yxlb"],
2011
2069
  iconName: "ListOrdered",
2012
- action: ({ editor: a, range: o }) => {
2013
- a.chain().focus().deleteRange(o).toggleOrderedList().run();
2070
+ action: ({ editor: a, range: r }) => {
2071
+ a.chain().focus().deleteRange(r).toggleOrderedList().run();
2014
2072
  }
2015
2073
  }), i.name.toLowerCase() === "tasklist" && n[0].commands.push({
2016
2074
  name: "taskList",
2017
- label: A.t("editor.tasklist.tooltip"),
2075
+ label: N.t("editor.tasklist.tooltip"),
2018
2076
  iconName: "ListTodo",
2019
2077
  description: "Task list with todo items",
2020
2078
  aliases: ["todo"],
2021
- action: ({ editor: a, range: o }) => {
2022
- a.chain().focus().deleteRange(o).toggleTaskList().run();
2079
+ action: ({ editor: a, range: r }) => {
2080
+ a.chain().focus().deleteRange(r).toggleTaskList().run();
2023
2081
  }
2024
2082
  }), i.name.toLowerCase() === "blockquote" && n[0].commands.push({
2025
2083
  name: "blockquote",
2026
- label: A.t("editor.blockquote.tooltip"),
2084
+ label: N.t("editor.blockquote.tooltip"),
2027
2085
  description: "插入引入格式",
2028
2086
  aliases: ["yr"],
2029
2087
  iconName: "TextQuote",
2030
- action: ({ editor: a, range: o }) => {
2031
- a.chain().focus().deleteRange(o).setBlockquote().run();
2088
+ action: ({ editor: a, range: r }) => {
2089
+ a.chain().focus().deleteRange(r).setBlockquote().run();
2032
2090
  }
2033
2091
  }), i.name.toLowerCase() === "codeblock" && n[0].commands.push({
2034
2092
  name: "codeBlock",
2035
- label: A.t("editor.codeblock.tooltip"),
2093
+ label: N.t("editor.codeblock.tooltip"),
2036
2094
  iconName: "Code2",
2037
2095
  description: "Code block with syntax highlighting",
2038
2096
  shouldBeHidden: (a) => a.isActive("columns"),
2039
- action: ({ editor: a, range: o }) => {
2040
- a.chain().focus().deleteRange(o).setCodeBlock().run();
2097
+ action: ({ editor: a, range: r }) => {
2098
+ a.chain().focus().deleteRange(r).setCodeBlock().run();
2041
2099
  }
2042
- }), i.name.toLowerCase() === Mn.name && n[1].commands.push({
2100
+ }), i.name.toLowerCase() === sn.name && n[1].commands.push({
2043
2101
  name: "image",
2044
- label: A.t("editor.image.tooltip"),
2102
+ label: N.t("editor.image.tooltip"),
2045
2103
  iconName: "ImageUp",
2046
2104
  description: "Insert a image",
2047
2105
  aliases: ["image", "tp", "tupian"],
2048
2106
  shouldBeHidden: (a) => a.isActive("columns"),
2049
- action: ({ editor: a, range: o }) => {
2050
- a.chain().focus().deleteRange(o).run(), zn.setOpen(a.id, !0);
2107
+ action: ({ editor: a, range: r }) => {
2108
+ a.chain().focus().deleteRange(r).run(), cn.setOpen(a.id, !0);
2051
2109
  }
2052
- }), i.name.toLowerCase() === Rn.name && n[1].commands.push({
2110
+ }), i.name.toLowerCase() === ln.name && n[1].commands.push({
2053
2111
  name: "video",
2054
- label: A.t("editor.video.tooltip"),
2112
+ label: N.t("editor.video.tooltip"),
2055
2113
  iconName: "Video",
2056
2114
  description: "Insert a video",
2057
2115
  aliases: ["video", "sp", "shipin"],
2058
2116
  shouldBeHidden: (a) => a.isActive("columns"),
2059
- action: ({ editor: a, range: o }) => {
2060
- a.chain().focus().deleteRange(o).run(), $i.setOpen(a.id, !0);
2117
+ action: ({ editor: a, range: r }) => {
2118
+ a.chain().focus().deleteRange(r).run(), Ni.setOpen(a.id, !0);
2061
2119
  }
2062
2120
  }), i.name.toLowerCase() === "table" && n[1].commands.push({
2063
2121
  name: "table",
2064
- label: A.t("editor.table.tooltip"),
2122
+ label: N.t("editor.table.tooltip"),
2065
2123
  iconName: "Table",
2066
2124
  description: "Insert a table",
2067
2125
  aliases: ["table", "bg", "biaoge", "biao"],
2068
2126
  shouldBeHidden: (a) => a.isActive("columns"),
2069
- action: ({ editor: a, range: o }) => {
2070
- a.chain().focus().deleteRange(o).insertTable({ rows: 3, cols: 3, withHeaderRow: !1 }).run();
2127
+ action: ({ editor: a, range: r }) => {
2128
+ a.chain().focus().deleteRange(r).insertTable({ rows: 3, cols: 3, withHeaderRow: !1 }).run();
2071
2129
  }
2072
2130
  }), i.name.toLowerCase() === "horizontalrule" && n[1].commands.push({
2073
2131
  name: "horizontalRule",
2074
- label: A.t("editor.horizontalrule.tooltip"),
2132
+ label: N.t("editor.horizontalrule.tooltip"),
2075
2133
  iconName: "Minus",
2076
2134
  description: "Insert a horizontal divider",
2077
2135
  aliases: ["hr", "fgx", "fg"],
2078
- action: ({ editor: a, range: o }) => {
2079
- a.chain().focus().deleteRange(o).setHorizontalRule().run();
2136
+ action: ({ editor: a, range: r }) => {
2137
+ a.chain().focus().deleteRange(r).setHorizontalRule().run();
2080
2138
  }
2081
2139
  }), i.name.toLowerCase() === "columns" && n[1].commands.push({
2082
2140
  name: "columns",
2083
- label: A.t("editor.columns.tooltip"),
2141
+ label: N.t("editor.columns.tooltip"),
2084
2142
  iconName: "Columns2",
2085
2143
  description: "Add two column content",
2086
2144
  action: ({ editor: a }) => {
@@ -2090,12 +2148,12 @@ function Fi(e, t) {
2090
2148
  }), n;
2091
2149
  }
2092
2150
  const q = "slashCommand";
2093
- let y;
2094
- const Ro = N.create({
2151
+ let w;
2152
+ const bo = C.create({
2095
2153
  name: q,
2096
2154
  priority: 200,
2097
2155
  onCreate() {
2098
- y = Fe("body", {
2156
+ w = Pe("body", {
2099
2157
  interactive: !0,
2100
2158
  trigger: "manual",
2101
2159
  placement: "bottom-start",
@@ -2120,27 +2178,27 @@ const Ro = N.create({
2120
2178
  char: "/",
2121
2179
  allowSpaces: !0,
2122
2180
  startOfLine: !0,
2123
- pluginKey: new Z(q),
2181
+ pluginKey: new ne(q),
2124
2182
  allow: ({ state: e, range: t }) => {
2125
- var d, l, u;
2126
- const n = e.doc.resolve(t.from), i = n.depth === 1, a = n.parent.type.name === "paragraph", o = ((d = n.parent.textContent) == null ? void 0 : d.charAt(0)) === "/", s = this.editor.isActive("column"), c = (u = n.parent.textContent) == null ? void 0 : u.slice(
2183
+ var d, l, h;
2184
+ const n = e.doc.resolve(t.from), i = n.depth === 1, a = n.parent.type.name === "paragraph", r = ((d = n.parent.textContent) == null ? void 0 : d.charAt(0)) === "/", s = this.editor.isActive("column"), c = (h = n.parent.textContent) == null ? void 0 : h.slice(
2127
2185
  Math.max(0, (l = n.parent.textContent) == null ? void 0 : l.indexOf("/"))
2128
- ), h = !(c != null && c.endsWith(" "));
2129
- return (i && a && o || s && a && o) && h;
2186
+ ), u = !(c != null && c.endsWith(" "));
2187
+ return (i && a && r || s && a && r) && u;
2130
2188
  },
2131
2189
  command: ({ editor: e, range: t, props: n }) => {
2132
2190
  const { view: i } = e;
2133
2191
  n.action({ editor: e, range: t }), i.focus();
2134
2192
  },
2135
- items: ({ query: e, editor: t }) => Fi(t.extensionManager.extensions, this.options.renderGroupItem).map((s) => ({
2193
+ items: ({ query: e, editor: t }) => Ai(t.extensionManager.extensions, this.options.renderGroupItem).map((s) => ({
2136
2194
  ...s,
2137
2195
  commands: s.commands.filter((c) => {
2138
- const h = c.label.toLowerCase().trim(), d = e.toLowerCase().trim();
2196
+ const u = c.label.toLowerCase().trim(), d = e.toLowerCase().trim();
2139
2197
  if (c.aliases) {
2140
- const l = c.aliases.map((_) => _.toLowerCase().trim()), u = h.match(d), f = l.some((_) => _.match(d));
2141
- return u || f;
2198
+ const l = c.aliases.map((_) => _.toLowerCase().trim()), h = u.match(d), f = l.some((_) => _.match(d));
2199
+ return h || f;
2142
2200
  }
2143
- return h.match(d);
2201
+ return u.match(d);
2144
2202
  }).filter(
2145
2203
  (c) => c.shouldBeHidden ? !c.shouldBeHidden(this.editor) : !0
2146
2204
  )
@@ -2155,8 +2213,8 @@ const Ro = N.create({
2155
2213
  let e, t = null;
2156
2214
  return {
2157
2215
  onStart: (n) => {
2158
- var o;
2159
- e = new Me(Oi, {
2216
+ var r;
2217
+ e = new Ee(Ci, {
2160
2218
  props: n,
2161
2219
  editor: n.editor
2162
2220
  });
@@ -2168,20 +2226,20 @@ const Ro = N.create({
2168
2226
  return n.editor.storage[q].rect;
2169
2227
  let c = s.y;
2170
2228
  if (s.top + e.element.offsetHeight + 40 > window.innerHeight) {
2171
- const h = s.top + e.element.offsetHeight - window.innerHeight + 40;
2172
- c = s.y - h;
2229
+ const u = s.top + e.element.offsetHeight - window.innerHeight + 40;
2230
+ c = s.y - u;
2173
2231
  }
2174
2232
  return new DOMRect(s.x, c, s.width, s.height);
2175
2233
  };
2176
2234
  t = () => {
2177
- y == null || y[0].setProps({
2235
+ w == null || w[0].setProps({
2178
2236
  getReferenceClientRect: a
2179
2237
  });
2180
- }, (o = i.dom.parentElement) == null || o.addEventListener("scroll", t), y == null || y[0].setProps({
2238
+ }, (r = i.dom.parentElement) == null || r.addEventListener("scroll", t), w == null || w[0].setProps({
2181
2239
  getReferenceClientRect: a,
2182
2240
  appendTo: () => document.body,
2183
2241
  content: e.element
2184
- }), y == null || y[0].show();
2242
+ }), w == null || w[0].show();
2185
2243
  },
2186
2244
  onUpdate(n) {
2187
2245
  var s;
@@ -2191,29 +2249,29 @@ const Ro = N.create({
2191
2249
  return n.editor.storage[q].rect;
2192
2250
  const c = n.clientRect();
2193
2251
  return c ? new DOMRect(c.x, c.y, c.width, c.height) : n.editor.storage[q].rect;
2194
- }, o = () => {
2195
- y == null || y[0].setProps({
2252
+ }, r = () => {
2253
+ w == null || w[0].setProps({
2196
2254
  getReferenceClientRect: a
2197
2255
  });
2198
2256
  };
2199
- (s = i.dom.parentElement) == null || s.addEventListener("scroll", o), n.editor.storage[q].rect = n.clientRect ? a() : {
2257
+ (s = i.dom.parentElement) == null || s.addEventListener("scroll", r), n.editor.storage[q].rect = n.clientRect ? a() : {
2200
2258
  width: 0,
2201
2259
  height: 0,
2202
2260
  left: 0,
2203
2261
  top: 0,
2204
2262
  right: 0,
2205
2263
  bottom: 0
2206
- }, y == null || y[0].setProps({
2264
+ }, w == null || w[0].setProps({
2207
2265
  getReferenceClientRect: a
2208
2266
  });
2209
2267
  },
2210
2268
  onKeyDown(n) {
2211
2269
  var i;
2212
- return n.event.key === "Escape" ? (y == null || y[0].hide(), !0) : (y != null && y[0].state.isShown || y == null || y[0].show(), (i = e.ref) == null ? void 0 : i.onKeyDown(n));
2270
+ return n.event.key === "Escape" ? (w == null || w[0].hide(), !0) : (w != null && w[0].state.isShown || w == null || w[0].show(), (i = e.ref) == null ? void 0 : i.onKeyDown(n));
2213
2271
  },
2214
2272
  onExit(n) {
2215
2273
  var i;
2216
- if (y == null || y[0].hide(), t) {
2274
+ if (w == null || w[0].hide(), t) {
2217
2275
  const { view: a } = n.editor;
2218
2276
  (i = a.dom.parentElement) == null || i.removeEventListener("scroll", t);
2219
2277
  }
@@ -2237,7 +2295,7 @@ const Ro = N.create({
2237
2295
  };
2238
2296
  }
2239
2297
  });
2240
- function Ui(e, t, n) {
2298
+ function Ti(e, t, n) {
2241
2299
  if (!e.doc)
2242
2300
  return e;
2243
2301
  const i = e.doc.nodeAt(t);
@@ -2249,19 +2307,19 @@ function Ui(e, t, n) {
2249
2307
  };
2250
2308
  return e.setNodeMarkup(t, i.type, a, i.marks);
2251
2309
  }
2252
- function qi(e, t, n) {
2310
+ function Si(e, t, n) {
2253
2311
  const { doc: i, selection: a } = e;
2254
- return !i || !a || !(a instanceof sn) || a.forEachCell((o, s) => {
2255
- e = Ui(e, s, n);
2312
+ return !i || !a || !(a instanceof Sn) || a.forEachCell((r, s) => {
2313
+ e = Ti(e, s, n);
2256
2314
  }), e;
2257
2315
  }
2258
- function Qe(e, t) {
2316
+ function Ye(e, t) {
2259
2317
  return ({ tr: n, state: i, dispatch: a }) => {
2260
- const { selection: o } = i;
2261
- return n = n.setSelection(o), n = qi(n, t, e), n.docChanged ? (a == null || a(n), !0) : !1;
2318
+ const { selection: r } = i;
2319
+ return n = n.setSelection(r), n = Si(n, t, e), n.docChanged ? (a == null || a(n), !0) : !1;
2262
2320
  };
2263
2321
  }
2264
- const Ki = N.create({
2322
+ const Li = C.create({
2265
2323
  name: "tableCellBackground",
2266
2324
  addOptions() {
2267
2325
  return {
@@ -2286,94 +2344,94 @@ const Ki = N.create({
2286
2344
  },
2287
2345
  addCommands() {
2288
2346
  return {
2289
- setTableCellBackground: (e) => Qe(e, this.options),
2290
- unsetTableCellBackground: () => Qe("", this.options)
2347
+ setTableCellBackground: (e) => Ye(e, this.options),
2348
+ unsetTableCellBackground: () => Ye("", this.options)
2291
2349
  };
2292
2350
  }
2293
- }), Vi = /(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i, Wi = /CrOS/, Gi = /android|ipad|playbook|silk/i;
2294
- function Ye(e = {}) {
2351
+ }), Ei = /(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i, Hi = /CrOS/, zi = /android|ipad|playbook|silk/i;
2352
+ function Qe(e = {}) {
2295
2353
  let t = e.ua || typeof navigator < "u" && navigator.userAgent;
2296
- return t && typeof t == "object" && t.headers && typeof t.headers["user-agent"] == "string" && (t = t.headers["user-agent"]), typeof t != "string" ? !1 : !!(Vi.test(t) && !Wi.test(t) || e.tablet && Gi.test(t) || e.tablet && e.featureDetect && navigator && navigator.maxTouchPoints > 1 && t.includes("Macintosh") && t.includes("Safari"));
2354
+ return t && typeof t == "object" && t.headers && typeof t.headers["user-agent"] == "string" && (t = t.headers["user-agent"]), typeof t != "string" ? !1 : !!(Ei.test(t) && !Hi.test(t) || e.tablet && zi.test(t) || e.tablet && e.featureDetect && navigator && navigator.maxTouchPoints > 1 && t.includes("Macintosh") && t.includes("Safari"));
2297
2355
  }
2298
2356
  const Xe = (e) => Array.from({ length: e }).map((t, n) => n + 1);
2299
- function Zi(e) {
2357
+ function Mi(e) {
2300
2358
  var l;
2301
- const [t, n] = v(!0), [i, a] = v({
2302
- rows: Ye() ? fe : _e,
2303
- cols: Ye() ? fe : _e
2304
- }), [o, s] = v({
2305
- rows: ge,
2306
- cols: ge
2359
+ const [t, n] = k(!0), [i, a] = k({
2360
+ rows: Qe() ? le : de,
2361
+ cols: Qe() ? le : de
2362
+ }), [r, s] = k({
2363
+ rows: ue,
2364
+ cols: ue
2307
2365
  });
2308
- function c(u, f) {
2309
- u === i.rows && a((_) => ({
2366
+ function c(h, f) {
2367
+ h === i.rows && a((_) => ({
2310
2368
  ..._,
2311
- rows: Math.min(u + 1, fe)
2369
+ rows: Math.min(h + 1, le)
2312
2370
  })), f === i.cols && a((_) => ({
2313
2371
  ..._,
2314
- cols: Math.min(f + 1, fe)
2372
+ cols: Math.min(f + 1, le)
2315
2373
  })), s({
2316
- rows: u,
2374
+ rows: h,
2317
2375
  cols: f
2318
2376
  });
2319
2377
  }
2320
- function h(u, f) {
2321
- e == null || e.createTable({ rows: u, cols: f, withHeaderRow: t }), d();
2378
+ function u(h, f) {
2379
+ e == null || e.createTable({ rows: h, cols: f, withHeaderRow: t }), d();
2322
2380
  }
2323
2381
  function d() {
2324
2382
  n(!1), a({
2325
- rows: _e,
2326
- cols: _e
2383
+ rows: de,
2384
+ cols: de
2327
2385
  }), s({
2328
- rows: ge,
2329
- cols: ge
2386
+ rows: ue,
2387
+ cols: ue
2330
2388
  });
2331
2389
  }
2332
- return /* @__PURE__ */ m(ie, { modal: !0, children: [
2333
- /* @__PURE__ */ r(ae, { asChild: !0, children: e == null ? void 0 : e.children }),
2334
- /* @__PURE__ */ r(
2335
- oe,
2390
+ return /* @__PURE__ */ m(X, { modal: !0, children: [
2391
+ /* @__PURE__ */ o(ee, { asChild: !0, children: e == null ? void 0 : e.children }),
2392
+ /* @__PURE__ */ o(
2393
+ te,
2336
2394
  {
2337
2395
  align: "start",
2338
2396
  className: "richtext-w-full !richtext-p-2",
2339
2397
  side: "bottom",
2340
2398
  children: /* @__PURE__ */ m("div", { className: "table-grid-size-editor richtext-p-0", children: [
2341
- /* @__PURE__ */ r("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (l = Xe(i == null ? void 0 : i.rows)) == null ? void 0 : l.map((u) => {
2399
+ /* @__PURE__ */ o("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (l = Xe(i == null ? void 0 : i.rows)) == null ? void 0 : l.map((h) => {
2342
2400
  var f;
2343
- return /* @__PURE__ */ r(
2401
+ return /* @__PURE__ */ o(
2344
2402
  "div",
2345
2403
  {
2346
2404
  className: "richtext-flex richtext-gap-1",
2347
- children: (f = Xe(i == null ? void 0 : i.cols)) == null ? void 0 : f.map((_) => /* @__PURE__ */ r(
2405
+ children: (f = Xe(i == null ? void 0 : i.cols)) == null ? void 0 : f.map((_) => /* @__PURE__ */ o(
2348
2406
  "div",
2349
2407
  {
2350
- onMouseDown: () => h(u, _),
2351
- onMouseOver: () => c(u, _),
2352
- className: `richtext-cursor-pointer richtext-border-border ${_ <= o.cols && u <= o.rows && "tableCellActive !richtext-bg-foreground"}`,
2353
- children: /* @__PURE__ */ r("div", { className: "richtext-box-border richtext-size-4 richtext-rounded-[2px] !richtext-border richtext-border-solid !richtext-border-border richtext-p-1" })
2408
+ onMouseDown: () => u(h, _),
2409
+ onMouseOver: () => c(h, _),
2410
+ className: `richtext-cursor-pointer richtext-border-border ${_ <= r.cols && h <= r.rows && "tableCellActive !richtext-bg-foreground"}`,
2411
+ children: /* @__PURE__ */ o("div", { className: "richtext-box-border richtext-size-4 richtext-rounded-[2px] !richtext-border richtext-border-solid !richtext-border-border richtext-p-1" })
2354
2412
  },
2355
2413
  `c-${_}`
2356
2414
  ))
2357
2415
  },
2358
- `r-${u}`
2416
+ `r-${h}`
2359
2417
  );
2360
2418
  }) }),
2361
2419
  /* @__PURE__ */ m("div", { className: "richtext-mt-2 richtext-text-center richtext-text-sm richtext-text-zinc-600", children: [
2362
- o.rows,
2420
+ r.rows,
2363
2421
  " ",
2364
2422
  "x",
2365
- o.cols
2423
+ r.cols
2366
2424
  ] })
2367
2425
  ] })
2368
2426
  }
2369
2427
  )
2370
2428
  ] });
2371
2429
  }
2372
- function Ji(e) {
2430
+ function Ri(e) {
2373
2431
  function t(n) {
2374
2432
  e.disabled || e.editor.chain().focus().insertTable({ ...n, withHeaderRow: !1 }).run();
2375
2433
  }
2376
- return /* @__PURE__ */ r(Zi, { createTable: t, children: /* @__PURE__ */ r(
2434
+ return /* @__PURE__ */ o(Mi, { createTable: t, children: /* @__PURE__ */ o(
2377
2435
  x,
2378
2436
  {
2379
2437
  icon: e == null ? void 0 : e.icon,
@@ -2385,7 +2443,7 @@ function Ji(e) {
2385
2443
  }
2386
2444
  ) });
2387
2445
  }
2388
- const Po = Xt.extend({
2446
+ const xo = Ut.extend({
2389
2447
  addOptions() {
2390
2448
  var e;
2391
2449
  return {
@@ -2394,7 +2452,7 @@ const Po = Xt.extend({
2394
2452
  lastColumnResizable: !0,
2395
2453
  allowTableNodeSelection: !1,
2396
2454
  button: ({ editor: t, t: n }) => ({
2397
- component: Ji,
2455
+ component: Ri,
2398
2456
  componentProps: {
2399
2457
  disabled: t.isActive("table") || !1,
2400
2458
  icon: "Table",
@@ -2406,13 +2464,13 @@ const Po = Xt.extend({
2406
2464
  },
2407
2465
  addExtensions() {
2408
2466
  return [
2409
- en.configure(this.options.tableRow),
2410
- tn.configure(this.options.tableHeader),
2411
- nn.configure(this.options.tableCell),
2412
- Ki.configure(this.options.tableCellBackground)
2467
+ Kt.configure(this.options.tableRow),
2468
+ Vt.configure(this.options.tableHeader),
2469
+ Wt.configure(this.options.tableCell),
2470
+ Li.configure(this.options.tableCellBackground)
2413
2471
  ];
2414
2472
  }
2415
- }), Io = N.create({
2473
+ }), wo = C.create({
2416
2474
  name: "painter",
2417
2475
  addOptions() {
2418
2476
  var e;
@@ -2446,8 +2504,8 @@ const Po = Xt.extend({
2446
2504
  },
2447
2505
  addProseMirrorPlugins() {
2448
2506
  return [
2449
- new te({
2450
- key: new Z("format-painter"),
2507
+ new se({
2508
+ key: new ne("format-painter"),
2451
2509
  state: {
2452
2510
  init: () => [],
2453
2511
  apply: (e, t) => {
@@ -2465,12 +2523,12 @@ const Po = Xt.extend({
2465
2523
  document.removeEventListener("mouseup", n);
2466
2524
  let {
2467
2525
  dispatch: i,
2468
- state: { tr: a, selection: o },
2526
+ state: { tr: a, selection: r },
2469
2527
  dom: s
2470
2528
  } = e;
2471
- s.style.cursor = "", a = a.removeMark(o.from, o.to);
2529
+ s.style.cursor = "", a = a.removeMark(r.from, r.to);
2472
2530
  for (const c of t)
2473
- c.type.name !== "link" && (a = a.addMark(o.from, o.to, c));
2531
+ c.type.name !== "link" && (a = a.addMark(r.from, r.to, c));
2474
2532
  i(a.setMeta("painterAction", { type: "end" }));
2475
2533
  };
2476
2534
  return document.addEventListener("mouseup", n), !0;
@@ -2481,53 +2539,53 @@ const Po = Xt.extend({
2481
2539
  ];
2482
2540
  }
2483
2541
  });
2484
- function Qi({ editor: e, ...t }) {
2485
- const { t: n } = B(), [i, a] = v(-1), [o, s] = v([]), [c, h] = v(""), [d, l] = v(""), [u, f] = v(!1), [_, w] = v(!1);
2486
- return M(() => {
2487
- u || (h(""), l(""), a(-1), s([]), e.commands.setSearchTerm(""), e.commands.setReplaceTerm(""));
2488
- }, [e, u]), M(() => {
2489
- u && e && e.commands && e.commands.setSearchTerm && e.commands.setSearchTerm(c);
2490
- }, [u, c, e]), M(() => {
2491
- u && e && e.commands && e.commands.setReplaceTerm && e.commands.setReplaceTerm(d);
2492
- }, [u, d, e]), M(() => {
2542
+ function Ii({ editor: e, ...t }) {
2543
+ const { t: n } = I(), [i, a] = k(-1), [r, s] = k([]), [c, u] = k(""), [d, l] = k(""), [h, f] = k(!1), [_, S] = k(!1);
2544
+ return T(() => {
2545
+ h || (u(""), l(""), a(-1), s([]), e.commands.setSearchTerm(""), e.commands.setReplaceTerm(""));
2546
+ }, [e, h]), T(() => {
2547
+ h && e && e.commands && e.commands.setSearchTerm && e.commands.setSearchTerm(c);
2548
+ }, [h, c, e]), T(() => {
2549
+ h && e && e.commands && e.commands.setReplaceTerm && e.commands.setReplaceTerm(d);
2550
+ }, [h, d, e]), T(() => {
2493
2551
  if (!e)
2494
2552
  return;
2495
- const p = e.extensionManager.extensions.find((E) => E.name === na.name);
2553
+ const p = e.extensionManager.extensions.find((H) => H.name === Di.name);
2496
2554
  if (!p)
2497
2555
  return;
2498
- const T = () => {
2499
- if (!u)
2556
+ const M = () => {
2557
+ if (!h)
2500
2558
  return;
2501
- const E = p ? p.storage.currentIndex : -1, g = p ? p.storage.results : [];
2502
- a((b) => b !== E ? E : b), s((b) => cn(b, g) ? b : g);
2559
+ const H = p ? p.storage.currentIndex : -1, g = p ? p.storage.results : [];
2560
+ a((b) => b !== H ? H : b), s((b) => Ln(b, g) ? b : g);
2503
2561
  };
2504
- return Ve(D.SEARCH_REPLCE, T), () => {
2505
- p && Ve(D.SEARCH_REPLCE, T);
2562
+ return Ve(j.SEARCH_REPLCE, M), () => {
2563
+ p && Ve(j.SEARCH_REPLCE, M);
2506
2564
  };
2507
- }, [u, e]), /* @__PURE__ */ m(
2508
- ie,
2565
+ }, [h, e]), /* @__PURE__ */ m(
2566
+ X,
2509
2567
  {
2510
2568
  onOpenChange: f,
2511
- open: u,
2569
+ open: h,
2512
2570
  children: [
2513
- /* @__PURE__ */ r(
2514
- ae,
2571
+ /* @__PURE__ */ o(
2572
+ ee,
2515
2573
  {
2516
2574
  asChild: !0,
2517
2575
  disabled: t == null ? void 0 : t.disabled,
2518
- children: /* @__PURE__ */ r(
2576
+ children: /* @__PURE__ */ o(
2519
2577
  x,
2520
2578
  {
2521
2579
  disabled: t == null ? void 0 : t.disabled,
2522
2580
  isActive: t == null ? void 0 : t.isActive,
2523
2581
  tooltip: t == null ? void 0 : t.tooltip,
2524
- children: /* @__PURE__ */ r(z, { name: t == null ? void 0 : t.icon })
2582
+ children: /* @__PURE__ */ o(A, { name: t == null ? void 0 : t.icon })
2525
2583
  }
2526
2584
  )
2527
2585
  }
2528
2586
  ),
2529
2587
  /* @__PURE__ */ m(
2530
- oe,
2588
+ te,
2531
2589
  {
2532
2590
  align: "start",
2533
2591
  className: "richtext-w-full",
@@ -2535,43 +2593,43 @@ function Qi({ editor: e, ...t }) {
2535
2593
  side: "bottom",
2536
2594
  children: [
2537
2595
  /* @__PURE__ */ m("div", { className: "richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between", children: [
2538
- /* @__PURE__ */ r(Ne, { children: n("editor.search.dialog.text") }),
2539
- /* @__PURE__ */ r("span", { className: "richtext-font-semibold", children: o.length > 0 ? `${i + 1}/${o.length}` : "0/0" })
2596
+ /* @__PURE__ */ o(ve, { children: n("editor.search.dialog.text") }),
2597
+ /* @__PURE__ */ o("span", { className: "richtext-font-semibold", children: r.length > 0 ? `${i + 1}/${r.length}` : "0/0" })
2540
2598
  ] }),
2541
2599
  /* @__PURE__ */ m("div", { className: "richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: [
2542
- /* @__PURE__ */ r(
2600
+ /* @__PURE__ */ o(
2543
2601
  We,
2544
2602
  {
2545
2603
  autoFocus: !0,
2546
2604
  className: "richtext-w-full",
2547
- onChange: (p) => h(p.target.value),
2605
+ onChange: (p) => u(p.target.value),
2548
2606
  placeholder: "Text",
2549
2607
  required: !0,
2550
2608
  type: "text",
2551
2609
  value: c
2552
2610
  }
2553
2611
  ),
2554
- /* @__PURE__ */ r(
2555
- V,
2612
+ /* @__PURE__ */ o(
2613
+ K,
2556
2614
  {
2557
2615
  className: "richtext-flex-1",
2558
- disabled: o.length === 0,
2616
+ disabled: r.length === 0,
2559
2617
  onClick: e.commands.goToPrevSearchResult,
2560
- children: /* @__PURE__ */ r(z, { name: "ChevronUp" })
2618
+ children: /* @__PURE__ */ o(A, { name: "ChevronUp" })
2561
2619
  }
2562
2620
  ),
2563
- /* @__PURE__ */ r(
2564
- V,
2621
+ /* @__PURE__ */ o(
2622
+ K,
2565
2623
  {
2566
2624
  className: "richtext-flex-1",
2567
- disabled: o.length === 0,
2625
+ disabled: r.length === 0,
2568
2626
  onClick: e.commands.goToNextSearchResult,
2569
- children: /* @__PURE__ */ r(z, { name: "ChevronDown" })
2627
+ children: /* @__PURE__ */ o(A, { name: "ChevronDown" })
2570
2628
  }
2571
2629
  )
2572
2630
  ] }),
2573
- /* @__PURE__ */ r(Ne, { className: "richtext-mb-[6px]", children: n("editor.replace.dialog.text") }),
2574
- /* @__PURE__ */ r("div", { className: "richtext-mb-[5px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: /* @__PURE__ */ r(
2631
+ /* @__PURE__ */ o(ve, { className: "richtext-mb-[6px]", children: n("editor.replace.dialog.text") }),
2632
+ /* @__PURE__ */ o("div", { className: "richtext-mb-[5px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5", children: /* @__PURE__ */ o("div", { className: "richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center", children: /* @__PURE__ */ o(
2575
2633
  We,
2576
2634
  {
2577
2635
  className: "richtext-w-80",
@@ -2583,32 +2641,32 @@ function Qi({ editor: e, ...t }) {
2583
2641
  }
2584
2642
  ) }) }),
2585
2643
  /* @__PURE__ */ m("div", { className: "richtext-mb-[10px] richtext-flex richtext-items-center richtext-space-x-2", children: [
2586
- /* @__PURE__ */ r(
2587
- Pn,
2644
+ /* @__PURE__ */ o(
2645
+ dn,
2588
2646
  {
2589
2647
  checked: _,
2590
2648
  onCheckedChange: (p) => {
2591
- w(p), e.commands.setCaseSensitive(p);
2649
+ S(p), e.commands.setCaseSensitive(p);
2592
2650
  }
2593
2651
  }
2594
2652
  ),
2595
- /* @__PURE__ */ r(Ne, { children: n("editor.replace.caseSensitive") })
2653
+ /* @__PURE__ */ o(ve, { children: n("editor.replace.caseSensitive") })
2596
2654
  ] }),
2597
2655
  /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
2598
- /* @__PURE__ */ r(
2599
- V,
2656
+ /* @__PURE__ */ o(
2657
+ K,
2600
2658
  {
2601
2659
  className: "richtext-flex-1",
2602
- disabled: o.length === 0,
2660
+ disabled: r.length === 0,
2603
2661
  onClick: e.commands.replace,
2604
2662
  children: n("editor.replace.dialog.text")
2605
2663
  }
2606
2664
  ),
2607
- /* @__PURE__ */ r(
2608
- V,
2665
+ /* @__PURE__ */ o(
2666
+ K,
2609
2667
  {
2610
2668
  className: "richtext-flex-1",
2611
- disabled: o.length === 0,
2669
+ disabled: r.length === 0,
2612
2670
  onClick: e.commands.replaceAll,
2613
2671
  children: n("editor.replaceAll.dialog.text")
2614
2672
  }
@@ -2621,88 +2679,88 @@ function Qi({ editor: e, ...t }) {
2621
2679
  }
2622
2680
  );
2623
2681
  }
2624
- const se = (e, t) => t(e.tr);
2625
- function Yi(e, t, n) {
2682
+ const ie = (e, t) => t(e.tr);
2683
+ function Pi(e, t, n) {
2626
2684
  return RegExp(t ? e.replace(/[$()*+./?[\\\]^{|}-]/g, String.raw`\$&`) : e, n ? "gu" : "gui");
2627
2685
  }
2628
- function Xi(e, t, n) {
2686
+ function ji(e, t, n) {
2629
2687
  const i = [];
2630
2688
  let a = [];
2631
- const o = [];
2689
+ const r = [];
2632
2690
  let s = 0;
2633
2691
  if (!t)
2634
2692
  return { decorationsToReturn: [], results: [] };
2635
- e == null || e.descendants((c, h) => {
2693
+ e == null || e.descendants((c, u) => {
2636
2694
  c.isText ? a[s] ? a[s] = {
2637
2695
  text: a[s].text + c.text,
2638
2696
  pos: a[s].pos
2639
2697
  } : a[s] = {
2640
2698
  text: `${c.text}`,
2641
- pos: h
2699
+ pos: u
2642
2700
  } : s += 1;
2643
2701
  }), a = a.filter(Boolean);
2644
- for (const { text: c, pos: h } of a) {
2702
+ for (const { text: c, pos: u } of a) {
2645
2703
  const d = [...c.matchAll(t)];
2646
2704
  for (const l of d) {
2647
2705
  if (l[0] === "")
2648
2706
  break;
2649
- l.index !== void 0 && o.push({
2650
- from: h + l.index,
2651
- to: h + l.index + l[0].length
2707
+ l.index !== void 0 && r.push({
2708
+ from: u + l.index,
2709
+ to: u + l.index + l[0].length
2652
2710
  });
2653
2711
  }
2654
2712
  }
2655
- for (const c of o)
2656
- i.push(he.inline(c.from, c.to, { class: n }));
2713
+ for (const c of r)
2714
+ i.push(be.inline(c.from, c.to, { class: n }));
2657
2715
  return {
2658
2716
  decorationsToReturn: i,
2659
- results: o
2717
+ results: r
2660
2718
  };
2661
2719
  }
2662
2720
  function et(e, t, { state: n, dispatch: i }) {
2663
2721
  if (!t[0])
2664
2722
  return;
2665
- const { from: o, to: s } = t[0];
2666
- i && i(n.tr.insertText(e, o, s));
2723
+ const { from: r, to: s } = t[0];
2724
+ i && i(n.tr.insertText(e, r, s));
2667
2725
  }
2668
- function ea(e, t, n, i) {
2726
+ function Bi(e, t, n, i) {
2669
2727
  const a = t + 1;
2670
2728
  if (!i[a])
2671
2729
  return null;
2672
- const { from: o, to: s } = i[t], c = s - o - e.length + n, { from: h, to: d } = i[a];
2730
+ const { from: r, to: s } = i[t], c = s - r - e.length + n, { from: u, to: d } = i[a];
2673
2731
  return i[a] = {
2674
2732
  to: d - c,
2675
- from: h - c
2733
+ from: u - c
2676
2734
  }, [c, i];
2677
2735
  }
2678
- function ta(e, t, { tr: n, dispatch: i }) {
2679
- let a = 0, o = t.slice();
2680
- if (o.length === 0)
2736
+ function Oi(e, t, { tr: n, dispatch: i }) {
2737
+ let a = 0, r = t.slice();
2738
+ if (r.length === 0)
2681
2739
  return !1;
2682
- for (let s = 0; s < o.length; s += 1) {
2683
- const { from: c, to: h } = o[s];
2684
- n.insertText(e, c, h);
2685
- const d = ea(e, s, a, o);
2686
- d && (a = d[0], o = d[1]);
2740
+ for (let s = 0; s < r.length; s += 1) {
2741
+ const { from: c, to: u } = r[s];
2742
+ n.insertText(e, c, u);
2743
+ const d = Bi(e, s, a, r);
2744
+ d && (a = d[0], r = d[1]);
2687
2745
  }
2688
2746
  return i(n), !0;
2689
2747
  }
2690
2748
  function tt({ view: e, tr: t, searchResults: n, searchResultCurrentClass: i, gotoIndex: a }) {
2691
- const o = n[a];
2692
- if (o) {
2749
+ const r = n[a];
2750
+ if (r) {
2693
2751
  const s = t.setMeta("directDecoration", {
2694
- fromPos: o.from,
2695
- toPos: o.to,
2752
+ fromPos: r.from,
2753
+ toPos: r.to,
2696
2754
  attrs: { class: i }
2697
2755
  });
2698
2756
  return e == null || e.dispatch(s), setTimeout(() => {
2699
2757
  const c = window.document.querySelector(`.${i}`);
2700
- c && Ue(c, { behavior: "smooth", scrollMode: "if-needed" });
2758
+ c && $e(c, { behavior: "smooth", scrollMode: "if-needed" });
2701
2759
  }, 0), !0;
2702
2760
  }
2703
2761
  return !1;
2704
2762
  }
2705
- const na = N.create({
2763
+ const Di = C.create({
2706
2764
  name: "search",
2707
2765
  addOptions() {
2708
2766
  var e;
@@ -2719,7 +2777,7 @@ const na = N.create({
2719
2777
  onChange: () => {
2720
2778
  },
2721
2779
  button: ({ editor: t, t: n }) => ({
2722
- component: Qi,
2780
+ component: Ii,
2723
2781
  componentProps: {
2724
2782
  action: () => {
2725
2783
  },
@@ -2740,35 +2798,35 @@ const na = N.create({
2740
2798
  },
2741
2799
  addCommands() {
2742
2800
  return {
2743
- setSearchTerm: (e) => ({ state: t, dispatch: n }) => (this.options.searchTerm = e, this.storage.results = [], this.storage.currentIndex = 0, K(D.SEARCH_REPLCE), se(t, n), !1),
2744
- setReplaceTerm: (e) => ({ state: t, dispatch: n }) => (this.options.replaceTerm = e, se(t, n), !1),
2745
- setCaseSensitive: (e) => ({ state: t, dispatch: n }) => (this.options.caseSensitive = e, se(t, n), !1),
2801
+ setSearchTerm: (e) => ({ state: t, dispatch: n }) => (this.options.searchTerm = e, this.storage.results = [], this.storage.currentIndex = 0, U(j.SEARCH_REPLCE), ie(t, n), !1),
2802
+ setReplaceTerm: (e) => ({ state: t, dispatch: n }) => (this.options.replaceTerm = e, ie(t, n), !1),
2803
+ setCaseSensitive: (e) => ({ state: t, dispatch: n }) => (this.options.caseSensitive = e, ie(t, n), !1),
2746
2804
  replace: () => ({ state: e, dispatch: t }) => {
2747
- const { replaceTerm: n } = this.options, { currentIndex: i, results: a } = this.storage, o = a[i];
2748
- return o ? (et(n, [o], { state: e, dispatch: t }), this.storage.results.splice(i, 1)) : (et(n, a, { state: e, dispatch: t }), this.storage.results.shift()), K(D.SEARCH_REPLCE), se(e, t), !1;
2805
+ const { replaceTerm: n } = this.options, { currentIndex: i, results: a } = this.storage, r = a[i];
2806
+ return r ? (et(n, [r], { state: e, dispatch: t }), this.storage.results.splice(i, 1)) : (et(n, a, { state: e, dispatch: t }), this.storage.results.shift()), U(j.SEARCH_REPLCE), ie(e, t), !1;
2749
2807
  },
2750
2808
  replaceAll: () => ({ state: e, tr: t, dispatch: n }) => {
2751
2809
  const { replaceTerm: i } = this.options, { results: a } = this.storage;
2752
- return ta(i, a, { tr: t, dispatch: n }), this.storage.currentIndex = -1, this.storage.results = [], K(D.SEARCH_REPLCE), se(e, n), !1;
2810
+ return Oi(i, a, { tr: t, dispatch: n }), this.storage.currentIndex = -1, this.storage.results = [], U(j.SEARCH_REPLCE), ie(e, n), !1;
2753
2811
  },
2754
2812
  goToPrevSearchResult: () => ({ view: e, tr: t }) => {
2755
- const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, o = (i + a.length - 1) % a.length;
2756
- return this.storage.currentIndex = o, K(D.SEARCH_REPLCE), tt({
2813
+ const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, r = (i + a.length - 1) % a.length;
2814
+ return this.storage.currentIndex = r, U(j.SEARCH_REPLCE), tt({
2757
2815
  view: e,
2758
2816
  tr: t,
2759
2817
  searchResults: a,
2760
2818
  searchResultCurrentClass: n,
2761
- gotoIndex: o
2819
+ gotoIndex: r
2762
2820
  });
2763
2821
  },
2764
2822
  goToNextSearchResult: () => ({ view: e, tr: t }) => {
2765
- const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, o = (i + 1) % a.length;
2766
- return this.storage.currentIndex = o, this.options.onChange && this.options.onChange(), K(D.SEARCH_REPLCE), tt({
2823
+ const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, r = (i + 1) % a.length;
2824
+ return this.storage.currentIndex = r, this.options.onChange && this.options.onChange(), U(j.SEARCH_REPLCE), tt({
2767
2825
  view: e,
2768
2826
  tr: t,
2769
2827
  searchResults: a,
2770
2828
  searchResultCurrentClass: n,
2771
- gotoIndex: o
2829
+ gotoIndex: r
2772
2830
  });
2773
2831
  }
2774
2832
  };
@@ -2776,30 +2834,30 @@ const na = N.create({
2776
2834
  addProseMirrorPlugins() {
2777
2835
  const e = this;
2778
2836
  return [
2779
- new te({
2780
- key: new Z("search"),
2837
+ new se({
2838
+ key: new ne("search"),
2781
2839
  state: {
2782
2840
  init() {
2783
- return de.empty;
2841
+ return ge.empty;
2784
2842
  },
2785
2843
  apply(t) {
2786
- const { doc: n, docChanged: i } = t, { searchTerm: a, searchResultClass: o, searchResultCurrentClass: s, disableRegex: c, caseSensitive: h } = e.options;
2844
+ const { doc: n, docChanged: i } = t, { searchTerm: a, searchResultClass: r, searchResultCurrentClass: s, disableRegex: c, caseSensitive: u } = e.options;
2787
2845
  if (i || a) {
2788
- const { decorationsToReturn: d, results: l } = Xi(
2846
+ const { decorationsToReturn: d, results: l } = ji(
2789
2847
  n,
2790
- Yi(a, c, h),
2791
- o
2848
+ Pi(a, c, u),
2849
+ r
2792
2850
  );
2793
- if (e.storage.results = l, e.storage.currentIndex > l.length - 1 && (e.storage.currentIndex = 0), K(D.SEARCH_REPLCE), t.getMeta("directDecoration")) {
2794
- const { fromPos: u, toPos: f, attrs: _ } = t.getMeta("directDecoration");
2795
- d.push(he.inline(u, f, _));
2851
+ if (e.storage.results = l, e.storage.currentIndex > l.length - 1 && (e.storage.currentIndex = 0), U(j.SEARCH_REPLCE), t.getMeta("directDecoration")) {
2852
+ const { fromPos: h, toPos: f, attrs: _ } = t.getMeta("directDecoration");
2853
+ d.push(be.inline(h, f, _));
2796
2854
  } else
2797
- l.length > 0 && (d[0] = he.inline(l[0].from, l[0].to, {
2855
+ l.length > 0 && (d[0] = be.inline(l[0].from, l[0].to, {
2798
2856
  class: s
2799
2857
  }));
2800
- return de.create(n, d);
2858
+ return ge.create(n, d);
2801
2859
  }
2802
- return de.empty;
2860
+ return ge.empty;
2803
2861
  }
2804
2862
  },
2805
2863
  props: {
@@ -2811,14 +2869,14 @@ const na = N.create({
2811
2869
  ];
2812
2870
  }
2813
2871
  });
2814
- function ia({
2872
+ function $i({
2815
2873
  className: e,
2816
2874
  ...t
2817
2875
  }) {
2818
- return /* @__PURE__ */ r(
2819
- W.Root,
2876
+ return /* @__PURE__ */ o(
2877
+ V.Root,
2820
2878
  {
2821
- className: S(
2879
+ className: E(
2822
2880
  "richtext-bg-popover richtext-text-popover-foreground richtext-isolate richtext-flex richtext-h-full richtext-w-fit richtext-flex-col richtext-overflow-hidden richtext-rounded-md",
2823
2881
  e
2824
2882
  ),
@@ -2827,19 +2885,19 @@ function ia({
2827
2885
  }
2828
2886
  );
2829
2887
  }
2830
- function aa({
2888
+ function Fi({
2831
2889
  className: e,
2832
2890
  ...t
2833
2891
  }) {
2834
2892
  return /* @__PURE__ */ m(
2835
2893
  "div",
2836
2894
  {
2837
- className: S("richtext-flex richtext-h-9 richtext-items-center richtext-gap-2 richtext-border-b richtext-px-3", e),
2895
+ className: E("richtext-flex richtext-h-9 richtext-items-center richtext-gap-2 richtext-border-b richtext-px-3", e),
2838
2896
  "data-slot": "emoji-picker-search-wrapper",
2839
2897
  children: [
2840
- /* @__PURE__ */ r(_n, { className: "richtext-size-4 richtext-shrink-0 richtext-opacity-50" }),
2841
- /* @__PURE__ */ r(
2842
- W.Search,
2898
+ /* @__PURE__ */ o(Bn, { className: "richtext-size-4 richtext-shrink-0 richtext-opacity-50" }),
2899
+ /* @__PURE__ */ o(
2900
+ V.Search,
2843
2901
  {
2844
2902
  className: "richtext-outline-hidden placeholder:richtext-text-muted-foreground richtext-flex richtext-h-10 richtext-w-full richtext-rounded-md richtext-bg-transparent richtext-py-3 richtext-text-sm disabled:richtext-cursor-not-allowed disabled:richtext-opacity-50",
2845
2903
  "data-slot": "emoji-picker-search",
@@ -2850,19 +2908,19 @@ function aa({
2850
2908
  }
2851
2909
  );
2852
2910
  }
2853
- function oa({ children: e, ...t }) {
2854
- return /* @__PURE__ */ r("div", { ...t, className: "richtext-scroll-my-1 richtext-px-1", "data-slot": "emoji-picker-row", children: e });
2911
+ function qi({ children: e, ...t }) {
2912
+ return /* @__PURE__ */ o("div", { ...t, className: "richtext-scroll-my-1 richtext-px-1", "data-slot": "emoji-picker-row", children: e });
2855
2913
  }
2856
- function ra({
2914
+ function Ui({
2857
2915
  emoji: e,
2858
2916
  className: t,
2859
2917
  ...n
2860
2918
  }) {
2861
- return /* @__PURE__ */ r(
2919
+ return /* @__PURE__ */ o(
2862
2920
  "button",
2863
2921
  {
2864
2922
  ...n,
2865
- className: S(
2923
+ className: E(
2866
2924
  "data-[active]:richtext-bg-accent richtext-flex richtext-size-7 richtext-items-center richtext-justify-center richtext-rounded-sm richtext-text-base",
2867
2925
  t
2868
2926
  ),
@@ -2871,11 +2929,11 @@ function ra({
2871
2929
  }
2872
2930
  );
2873
2931
  }
2874
- function sa({
2932
+ function Ki({
2875
2933
  category: e,
2876
2934
  ...t
2877
2935
  }) {
2878
- return /* @__PURE__ */ r(
2936
+ return /* @__PURE__ */ o(
2879
2937
  "div",
2880
2938
  {
2881
2939
  ...t,
@@ -2885,41 +2943,41 @@ function sa({
2885
2943
  }
2886
2944
  );
2887
2945
  }
2888
- function ca({
2946
+ function Vi({
2889
2947
  className: e,
2890
2948
  ...t
2891
2949
  }) {
2892
2950
  return /* @__PURE__ */ m(
2893
- W.Viewport,
2951
+ V.Viewport,
2894
2952
  {
2895
- className: S("richtext-outline-hidden richtext-relative richtext-flex-1", e),
2953
+ className: E("richtext-outline-hidden richtext-relative richtext-flex-1", e),
2896
2954
  "data-slot": "emoji-picker-viewport",
2897
2955
  ...t,
2898
2956
  children: [
2899
- /* @__PURE__ */ r(
2900
- W.Loading,
2957
+ /* @__PURE__ */ o(
2958
+ V.Loading,
2901
2959
  {
2902
2960
  className: "richtext-absolute richtext-inset-0 richtext-flex richtext-items-center richtext-justify-center richtext-text-muted-foreground",
2903
2961
  "data-slot": "emoji-picker-loading",
2904
- children: /* @__PURE__ */ r(gn, { className: "richtext-size-4 richtext-animate-spin" })
2962
+ children: /* @__PURE__ */ o(On, { className: "richtext-size-4 richtext-animate-spin" })
2905
2963
  }
2906
2964
  ),
2907
- /* @__PURE__ */ r(
2908
- W.Empty,
2965
+ /* @__PURE__ */ o(
2966
+ V.Empty,
2909
2967
  {
2910
2968
  className: "richtext-absolute richtext-inset-0 richtext-flex richtext-items-center richtext-justify-center richtext-text-muted-foreground richtext-text-sm",
2911
2969
  "data-slot": "emoji-picker-empty",
2912
2970
  children: "No emoji found."
2913
2971
  }
2914
2972
  ),
2915
- /* @__PURE__ */ r(
2916
- W.List,
2973
+ /* @__PURE__ */ o(
2974
+ V.List,
2917
2975
  {
2918
2976
  className: "richtext-select-none richtext-pb-1",
2919
2977
  components: {
2920
- Row: oa,
2921
- Emoji: ra,
2922
- CategoryHeader: sa
2978
+ Row: qi,
2979
+ Emoji: Ui,
2980
+ CategoryHeader: Ki
2923
2981
  },
2924
2982
  "data-slot": "emoji-picker-list"
2925
2983
  }
@@ -2928,47 +2986,47 @@ function ca({
2928
2986
  }
2929
2987
  );
2930
2988
  }
2931
- function la({
2989
+ function Wi({
2932
2990
  className: e,
2933
2991
  ...t
2934
2992
  }) {
2935
- return /* @__PURE__ */ r(
2993
+ return /* @__PURE__ */ o(
2936
2994
  "div",
2937
2995
  {
2938
- className: S(
2996
+ className: E(
2939
2997
  "richtext-max-w-(--frimousse-viewport-width) richtext-flex richtext-w-full richtext-min-w-0 richtext-items-center richtext-gap-1 richtext-border-t richtext-p-2",
2940
2998
  e
2941
2999
  ),
2942
3000
  "data-slot": "emoji-picker-footer",
2943
3001
  ...t,
2944
- children: /* @__PURE__ */ r(W.ActiveEmoji, { children: ({ emoji: n }) => n ? /* @__PURE__ */ m(ye, { children: [
2945
- /* @__PURE__ */ r("div", { className: "richtext-flex richtext-size-7 richtext-flex-none richtext-items-center richtext-justify-center richtext-text-lg", children: n.emoji }),
2946
- /* @__PURE__ */ r("span", { className: "richtext-text-secondary-foreground richtext-truncate richtext-text-xs", children: n.label })
2947
- ] }) : /* @__PURE__ */ r("span", { className: "richtext-text-muted-foreground richtext-ml-1.5 richtext-flex richtext-h-7 richtext-items-center richtext-truncate richtext-text-xs", children: "Select an emoji…" }) })
3002
+ children: /* @__PURE__ */ o(V.ActiveEmoji, { children: ({ emoji: n }) => n ? /* @__PURE__ */ m(ye, { children: [
3003
+ /* @__PURE__ */ o("div", { className: "richtext-flex richtext-size-7 richtext-flex-none richtext-items-center richtext-justify-center richtext-text-lg", children: n.emoji }),
3004
+ /* @__PURE__ */ o("span", { className: "richtext-text-secondary-foreground richtext-truncate richtext-text-xs", children: n.label })
3005
+ ] }) : /* @__PURE__ */ o("span", { className: "richtext-text-muted-foreground richtext-ml-1.5 richtext-flex richtext-h-7 richtext-items-center richtext-truncate richtext-text-xs", children: "Select an emoji…" }) })
2948
3006
  }
2949
3007
  );
2950
3008
  }
2951
- function da({ onSelectEmoji: e, children: t }) {
2952
- return /* @__PURE__ */ m(ie, { modal: !0, children: [
2953
- /* @__PURE__ */ r(ae, { asChild: !0, children: t }),
2954
- /* @__PURE__ */ r(
2955
- oe,
3009
+ function Gi({ onSelectEmoji: e, children: t }) {
3010
+ return /* @__PURE__ */ m(X, { modal: !0, children: [
3011
+ /* @__PURE__ */ o(ee, { asChild: !0, children: t }),
3012
+ /* @__PURE__ */ o(
3013
+ te,
2956
3014
  {
2957
3015
  align: "start",
2958
3016
  className: "richtext-size-full richtext-p-2",
2959
3017
  hideWhenDetached: !0,
2960
3018
  side: "bottom",
2961
3019
  children: /* @__PURE__ */ m(
2962
- ia,
3020
+ $i,
2963
3021
  {
2964
3022
  className: "!richtext-h-[342px]",
2965
3023
  onEmojiSelect: ({ emoji: n }) => {
2966
3024
  e(n);
2967
3025
  },
2968
3026
  children: [
2969
- /* @__PURE__ */ r(aa, {}),
2970
- /* @__PURE__ */ r(ca, {}),
2971
- /* @__PURE__ */ r(la, {})
3027
+ /* @__PURE__ */ o(Fi, {}),
3028
+ /* @__PURE__ */ o(Vi, {}),
3029
+ /* @__PURE__ */ o(Wi, {})
2972
3030
  ]
2973
3031
  }
2974
3032
  )
@@ -2976,15 +3034,15 @@ function da({ onSelectEmoji: e, children: t }) {
2976
3034
  )
2977
3035
  ] });
2978
3036
  }
2979
- function ha({ editor: e, icon: t, ...n }) {
2980
- const i = F(
3037
+ function Zi({ editor: e, icon: t, ...n }) {
3038
+ const i = D(
2981
3039
  (a) => {
2982
- const { selection: o } = e.state, { $anchor: s } = o;
3040
+ const { selection: r } = e.state, { $anchor: s } = r;
2983
3041
  return e.chain().insertContentAt(s.pos, a).run();
2984
3042
  },
2985
3043
  [e]
2986
3044
  );
2987
- return /* @__PURE__ */ r(da, { onSelectEmoji: i, children: /* @__PURE__ */ r(
3045
+ return /* @__PURE__ */ o(Gi, { onSelectEmoji: i, children: /* @__PURE__ */ o(
2988
3046
  x,
2989
3047
  {
2990
3048
  icon: t,
@@ -2992,31 +3050,31 @@ function ha({ editor: e, icon: t, ...n }) {
2992
3050
  }
2993
3051
  ) });
2994
3052
  }
2995
- const xt = Re((e, t) => {
2996
- const n = G(null), [i, a] = v(0), { t: o } = B(), s = (l) => {
2997
- const u = e.items[l];
2998
- u && e.command(u);
3053
+ const ut = Be((e, t) => {
3054
+ const n = $(null), [i, a] = k(0), { t: r } = I(), s = (l) => {
3055
+ const h = e.items[l];
3056
+ h && e.command(h);
2999
3057
  }, c = () => {
3000
3058
  a((i + e.items.length - 1) % e.items.length);
3001
- }, h = () => {
3059
+ }, u = () => {
3002
3060
  a((i + 1) % e.items.length);
3003
3061
  }, d = () => {
3004
3062
  s(i);
3005
3063
  };
3006
- return M(() => a(0), [e.items]), M(() => {
3064
+ return T(() => a(0), [e.items]), T(() => {
3007
3065
  if (Number.isNaN(i + 1))
3008
3066
  return;
3009
3067
  const l = n.current.querySelector(`span:nth-of-type(${i + 1})`);
3010
- l && Ue(l, { behavior: "smooth", scrollMode: "if-needed" });
3011
- }, [i]), Pe(t, () => ({
3012
- onKeyDown: ({ event: l }) => l.key === "ArrowUp" ? (c(), !0) : l.key === "ArrowDown" ? (h(), !0) : l.key === "Enter" ? (d(), !0) : !1
3013
- })), /* @__PURE__ */ r("div", { className: "richtext-max-h-[320px] richtext-w-[200px] richtext-overflow-y-auto richtext-overflow-x-hidden richtext-rounded-sm !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none", children: /* @__PURE__ */ r("div", { ref: n, children: e.items.length > 0 ? e.items.map((l, u) => /* @__PURE__ */ m(
3068
+ l && $e(l, { behavior: "smooth", scrollMode: "if-needed" });
3069
+ }, [i]), Oe(t, () => ({
3070
+ onKeyDown: ({ event: l }) => l.key === "ArrowUp" ? (c(), !0) : l.key === "ArrowDown" ? (u(), !0) : l.key === "Enter" ? (d(), !0) : !1
3071
+ })), /* @__PURE__ */ o("div", { className: "richtext-max-h-[320px] richtext-w-[200px] richtext-overflow-y-auto richtext-overflow-x-hidden richtext-rounded-sm !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none", children: /* @__PURE__ */ o("div", { ref: n, children: e.items.length > 0 ? e.items.map((l, h) => /* @__PURE__ */ m(
3014
3072
  "span",
3015
3073
  {
3016
- className: R(" richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors hover:richtext-bg-accent focus:richtext-bg-accent focus:richtext-text-accent-foreground", u === i ? "bg-accent" : ""),
3017
- onClick: () => s(u),
3074
+ className: R(" richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors hover:richtext-bg-accent focus:richtext-bg-accent focus:richtext-text-accent-foreground", h === i ? "bg-accent" : ""),
3075
+ onClick: () => s(h),
3018
3076
  children: [
3019
- l.fallbackImage ? /* @__PURE__ */ r(
3077
+ l.fallbackImage ? /* @__PURE__ */ o(
3020
3078
  "img",
3021
3079
  {
3022
3080
  className: "richtext-size-[1em]",
@@ -3028,11 +3086,11 @@ const xt = Re((e, t) => {
3028
3086
  ":"
3029
3087
  ]
3030
3088
  },
3031
- `emoji-list-code-${u}`
3032
- )) : /* @__PURE__ */ r("div", { className: "richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors", children: /* @__PURE__ */ r("span", { children: o("no_result_found") }) }) }) });
3089
+ `emoji-list-code-${h}`
3090
+ )) : /* @__PURE__ */ o("div", { className: "richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors", children: /* @__PURE__ */ o("span", { children: r("no_result_found") }) }) }) });
3033
3091
  });
3034
- xt.displayName = "EmojiList";
3035
- const ee = {
3092
+ ut.displayName = "EmojiList";
3093
+ const G = {
3036
3094
  100: "💯",
3037
3095
  1234: "🔢",
3038
3096
  grinning: "😀",
@@ -4872,22 +4930,22 @@ const ee = {
4872
4930
  scotland: "🏴󠁧󠁢󠁳󠁣󠁴󠁿",
4873
4931
  wales: "🏴󠁧󠁢󠁷󠁬󠁳󠁿"
4874
4932
  };
4875
- Object.keys(ee).reduce((e, t) => {
4876
- const n = ee[t];
4933
+ Object.keys(G).reduce((e, t) => {
4934
+ const n = G[t];
4877
4935
  return e[n] = t, e;
4878
4936
  }, {});
4879
- const ua = Object.keys(ee).map((e) => e);
4880
- Object.keys(ee).map((e) => ee[e]);
4881
- function ma(e) {
4882
- return ua.filter((t) => t.startsWith(e)).map((t) => ({
4937
+ const Ji = Object.keys(G).map((e) => e);
4938
+ Object.keys(G).map((e) => G[e]);
4939
+ function Yi(e) {
4940
+ return Ji.filter((t) => t.startsWith(e)).map((t) => ({
4883
4941
  name: t,
4884
- emoji: ee[t]
4942
+ emoji: G[t]
4885
4943
  }));
4886
4944
  }
4887
- const fa = 200, _a = new Z("emoji"), Bo = we.create({
4945
+ const Qi = 200, Xi = new ne("emoji"), po = oe.create({
4888
4946
  name: "emoji",
4889
4947
  content: "text*",
4890
- priority: fa,
4948
+ priority: Qi,
4891
4949
  addOptions() {
4892
4950
  var e;
4893
4951
  return {
@@ -4895,13 +4953,13 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
4895
4953
  HTMLAttributes: {},
4896
4954
  suggestion: {
4897
4955
  char: ":",
4898
- pluginKey: _a,
4956
+ pluginKey: Xi,
4899
4957
  command: ({ editor: t, range: n, props: i }) => {
4900
4958
  t.chain().focus().insertContentAt(n, `${i.emoji} `).run();
4901
4959
  }
4902
4960
  },
4903
4961
  button: ({ editor: t, t: n }) => ({
4904
- component: ha,
4962
+ component: Zi,
4905
4963
  componentProps: {
4906
4964
  editor: t,
4907
4965
  action: () => {
@@ -4929,15 +4987,15 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
4929
4987
  }
4930
4988
  }).configure({
4931
4989
  suggestion: {
4932
- items: ({ query: e }) => ma(e),
4990
+ items: ({ query: e }) => Yi(e),
4933
4991
  render: () => {
4934
4992
  let e, t, n;
4935
4993
  return {
4936
4994
  onStart: (i) => {
4937
- n = i.editor.isEditable, n && (e = new Me(xt, {
4995
+ n = i.editor.isEditable, n && (e = new Ee(ut, {
4938
4996
  props: i,
4939
4997
  editor: i.editor
4940
- }), t = Fe("body", {
4998
+ }), t = Pe("body", {
4941
4999
  getReferenceClientRect: i.clientRect,
4942
5000
  appendTo: () => document.body,
4943
5001
  content: e.element,
@@ -4964,7 +5022,7 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
4964
5022
  }
4965
5023
  }
4966
5024
  });
4967
- function ga(e) {
5025
+ function ea(e) {
4968
5026
  const t = document.createElement("iframe");
4969
5027
  t.setAttribute("style", "position: absolute; width: 0; height: 0; top: 0; left: 0;"), document.body.appendChild(t), t.textContent = `
4970
5028
  <!DOCTYPE html>
@@ -4993,19 +5051,19 @@ function ga(e) {
4993
5051
  }
4994
5052
  n.close();
4995
5053
  }, 10);
4996
- } catch (o) {
4997
- console.error(o);
5054
+ } catch (r) {
5055
+ console.error(r);
4998
5056
  }
4999
5057
  setTimeout(() => {
5000
5058
  document.body.removeChild(t);
5001
5059
  }, 100);
5002
5060
  });
5003
5061
  }
5004
- function ba(e) {
5062
+ function ta(e) {
5005
5063
  const t = e.getHTML();
5006
- return t ? (ga(t), !0) : !1;
5064
+ return t ? (ea(t), !0) : !1;
5007
5065
  }
5008
- const jo = N.create({
5066
+ const yo = C.create({
5009
5067
  name: "exportPdf",
5010
5068
  addOptions() {
5011
5069
  var e;
@@ -5015,7 +5073,7 @@ const jo = N.create({
5015
5073
  component: x,
5016
5074
  componentProps: {
5017
5075
  action: () => {
5018
- ba(t);
5076
+ ta(t);
5019
5077
  },
5020
5078
  icon: "ExportPdf",
5021
5079
  tooltip: n("editor.exportPdf.tooltip"),
@@ -5026,24 +5084,24 @@ const jo = N.create({
5026
5084
  };
5027
5085
  }
5028
5086
  });
5029
- function xa(e, t) {
5087
+ function na(e, t) {
5030
5088
  const n = atob(e.split(",")[1]), i = Array.from({ length: n.length });
5031
- for (let o = 0; o < n.length; o++)
5032
- i[o] = n.charCodeAt(o);
5089
+ for (let r = 0; r < n.length; r++)
5090
+ i[r] = n.charCodeAt(r);
5033
5091
  const a = new Uint8Array(i);
5034
5092
  return new Blob([a], { type: t });
5035
5093
  }
5036
- function wa(e, t) {
5094
+ function ia(e, t) {
5037
5095
  return new File([e], t, { type: e.type });
5038
5096
  }
5039
- function pa(e) {
5040
- const { toast: t } = In(), { t: n } = B(), [i, a] = v(!1), o = G(null);
5097
+ function aa(e) {
5098
+ const { toast: t } = un(), { t: n } = I(), [i, a] = k(!1), r = $(null);
5041
5099
  function s() {
5042
- var u;
5043
- (u = o.current) == null || u.click();
5100
+ var h;
5101
+ (h = r.current) == null || h.click();
5044
5102
  }
5045
- function c(u) {
5046
- const f = u.target.files[0];
5103
+ function c(h) {
5104
+ const f = h.target.files[0];
5047
5105
  if (f) {
5048
5106
  if (f.size > e.limit) {
5049
5107
  t({
@@ -5055,26 +5113,26 @@ function pa(e) {
5055
5113
  d(f);
5056
5114
  }
5057
5115
  }
5058
- async function h(u) {
5059
- var T;
5060
- const _ = new DOMParser().parseFromString(u, "text/html"), w = _.querySelectorAll("img");
5061
- if (w.length === 0)
5116
+ async function u(h) {
5117
+ var M;
5118
+ const _ = new DOMParser().parseFromString(h, "text/html"), S = _.querySelectorAll("img");
5119
+ if (S.length === 0)
5062
5120
  return _.body.innerHTML;
5063
- if (Bn(e.editor, "image")) {
5064
- const E = (T = e.editor.extensionManager.extensions.find(
5121
+ if (hn(e.editor, "image")) {
5122
+ const H = (M = e.editor.extensionManager.extensions.find(
5065
5123
  (g) => g.name === "importWord"
5066
- )) == null ? void 0 : T.options;
5067
- if (E && typeof E.upload == "function") {
5124
+ )) == null ? void 0 : M.options;
5125
+ if (H && typeof H.upload == "function") {
5068
5126
  const g = [];
5069
- for (const k of w) {
5070
- const H = k.getAttribute("src"), L = xa(H, "image/jpeg"), O = wa(L, "image.jpeg");
5127
+ for (const y of S) {
5128
+ const z = y.getAttribute("src"), L = na(z, "image/jpeg"), O = ia(L, "image.jpeg");
5071
5129
  g.push(O);
5072
5130
  }
5073
- const b = await E.upload(g);
5074
- for (const [k, H] of w.entries()) {
5075
- H.setAttribute("src", b[k].src);
5076
- const L = H.parentElement;
5077
- (L == null ? void 0 : L.tagName) === "P" && (L.insertAdjacentElement("beforebegin", H), !L.hasChildNodes() && L.textContent === "" && L.remove());
5131
+ const b = await H.upload(g);
5132
+ for (const [y, z] of S.entries()) {
5133
+ z.setAttribute("src", b[y].src);
5134
+ const L = z.parentElement;
5135
+ (L == null ? void 0 : L.tagName) === "P" && (L.insertAdjacentElement("beforebegin", z), !L.hasChildNodes() && L.textContent === "" && L.remove());
5078
5136
  }
5079
5137
  return _.body.innerHTML;
5080
5138
  } else
@@ -5082,14 +5140,14 @@ function pa(e) {
5082
5140
  } else
5083
5141
  return console.error("Image extension not found, unable to convert image"), _.body.innerHTML;
5084
5142
  }
5085
- async function d(u) {
5143
+ async function d(h) {
5086
5144
  a(!0);
5087
5145
  try {
5088
5146
  if (e.convert) {
5089
- const f = await e.convert(u);
5147
+ const f = await e.convert(h);
5090
5148
  l(f);
5091
5149
  } else {
5092
- const f = await u.arrayBuffer(), { value: _ } = await ln.convertToHtml(
5150
+ const f = await h.arrayBuffer(), { value: _ } = await En.convertToHtml(
5093
5151
  { arrayBuffer: f },
5094
5152
  e == null ? void 0 : e.mammothOptions
5095
5153
  );
@@ -5099,12 +5157,12 @@ function pa(e) {
5099
5157
  a(!1);
5100
5158
  }
5101
5159
  }
5102
- async function l(u) {
5103
- const f = await h(u);
5160
+ async function l(h) {
5161
+ const f = await u(h);
5104
5162
  e.editor.chain().setContent(f, !0).run();
5105
5163
  }
5106
5164
  return /* @__PURE__ */ m("div", { children: [
5107
- /* @__PURE__ */ r(
5165
+ /* @__PURE__ */ o(
5108
5166
  x,
5109
5167
  {
5110
5168
  action: s,
@@ -5114,12 +5172,12 @@ function pa(e) {
5114
5172
  tooltip: e == null ? void 0 : e.tooltip
5115
5173
  }
5116
5174
  ),
5117
- /* @__PURE__ */ r(
5175
+ /* @__PURE__ */ o(
5118
5176
  "input",
5119
5177
  {
5120
5178
  accept: ".docx",
5121
5179
  onChange: c,
5122
- ref: o,
5180
+ ref: r,
5123
5181
  type: "file",
5124
5182
  style: {
5125
5183
  display: "none"
@@ -5128,7 +5186,7 @@ function pa(e) {
5128
5186
  )
5129
5187
  ] });
5130
5188
  }
5131
- const Do = N.create({
5189
+ const vo = C.create({
5132
5190
  name: "importWord",
5133
5191
  addOptions() {
5134
5192
  var e;
@@ -5139,13 +5197,13 @@ const Do = N.create({
5139
5197
  limit: 1024 * 1024 * 10,
5140
5198
  // 10 MB
5141
5199
  button: ({ editor: t, extension: n, t: i }) => {
5142
- const { convert: a, limit: o, mammothOptions: s } = n.options;
5200
+ const { convert: a, limit: r, mammothOptions: s } = n.options;
5143
5201
  return {
5144
- component: pa,
5202
+ component: aa,
5145
5203
  componentProps: {
5146
5204
  editor: t,
5147
5205
  convert: a,
5148
- limit: o,
5206
+ limit: r,
5149
5207
  mammothOptions: s,
5150
5208
  action: () => t.commands.setHorizontalRule(),
5151
5209
  disabled: !t.can().setHorizontalRule(),
@@ -5157,22 +5215,22 @@ const Do = N.create({
5157
5215
  }
5158
5216
  };
5159
5217
  }
5160
- }), ya = typeof window < "u";
5161
- function ka(e, t) {
5162
- if (ya) {
5218
+ }), oa = typeof window < "u";
5219
+ function ra(e, t) {
5220
+ if (oa) {
5163
5221
  const n = window.URL.createObjectURL(e), i = document.createElement("a");
5164
5222
  return i.href = n, i.download = t, i.click(), window.URL.revokeObjectURL(n), Promise.resolve();
5165
5223
  }
5166
5224
  return console.error("Download is not supported in Node.js"), Promise.resolve();
5167
5225
  }
5168
- const va = {
5169
- ...U,
5170
- hardBreak: U.hard_break,
5171
- codeBlock: U.code_block,
5172
- orderedList: U.ordered_list,
5173
- listItem: U.list_item,
5174
- bulletList: U.bullet_list,
5175
- horizontalRule: U.horizontal_rule,
5226
+ const sa = {
5227
+ ...F,
5228
+ hardBreak: F.hard_break,
5229
+ codeBlock: F.code_block,
5230
+ orderedList: F.ordered_list,
5231
+ listItem: F.list_item,
5232
+ bulletList: F.bullet_list,
5233
+ horizontalRule: F.horizontal_rule,
5176
5234
  // Requirement Buffer on browser
5177
5235
  image(e, t) {
5178
5236
  e.renderInline(t), e.closeBlock(t);
@@ -5182,12 +5240,12 @@ const va = {
5182
5240
  tableOptions: {
5183
5241
  width: {
5184
5242
  size: 100,
5185
- type: Jn.PERCENTAGE
5243
+ type: zn.PERCENTAGE
5186
5244
  }
5187
5245
  }
5188
5246
  });
5189
5247
  }
5190
- }, Ca = new Qn(va, Yn), Oo = N.create({
5248
+ }, ca = new Mn(sa, Rn), ko = C.create({
5191
5249
  name: "exportWord",
5192
5250
  addOptions() {
5193
5251
  var e;
@@ -5213,74 +5271,74 @@ const va = {
5213
5271
  exportToWord: () => async ({ editor: e }) => {
5214
5272
  const t = {
5215
5273
  getImageBuffer: async (i) => {
5216
- const o = await (await fetch(i)).arrayBuffer();
5217
- return new Uint8Array(o);
5274
+ const r = await (await fetch(i)).arrayBuffer();
5275
+ return new Uint8Array(r);
5218
5276
  }
5219
- }, n = Ca.serialize(e.state.doc, t);
5220
- return Zn.toBlob(n).then((i) => ka(new Blob([i]), "export-document.docx")), !0;
5277
+ }, n = ca.serialize(e.state.doc, t);
5278
+ return Hn.toBlob(n).then((i) => ra(new Blob([i]), "export-document.docx")), !0;
5221
5279
  }
5222
5280
  };
5223
5281
  }
5224
- }), Na = "_toc_aag8a_1", Aa = "_visible_aag8a_7", Ta = "_list_aag8a_11", La = "_item_aag8a_16", be = {
5225
- toc: Na,
5226
- visible: Aa,
5227
- list: Ta,
5228
- item: La
5282
+ }), la = "_toc_aag8a_1", da = "_visible_aag8a_7", ua = "_list_aag8a_11", ha = "_item_aag8a_16", fe = {
5283
+ toc: la,
5284
+ visible: da,
5285
+ list: ua,
5286
+ item: ha
5229
5287
  };
5230
- function Sa(e) {
5288
+ function ma(e) {
5231
5289
  const t = [], n = [t];
5232
5290
  return e.forEach((i) => {
5233
- let a = -1, o = n[i.level + a];
5234
- for (; !o; )
5235
- a -= 1, o = n[i.level + a];
5236
- o.push({ ...i, children: n[i.level] = [] });
5291
+ let a = -1, r = n[i.level + a];
5292
+ for (; !r; )
5293
+ a -= 1, r = n[i.level + a];
5294
+ r.push({ ...i, children: n[i.level] = [] });
5237
5295
  }), t;
5238
5296
  }
5239
- function Ea({ editor: e }) {
5240
- const t = De(), [n, i] = v([]), { t: a } = B(), o = F(() => {
5297
+ function fa({ editor: e }) {
5298
+ const t = Me(), [n, i] = k([]), { t: a } = I(), r = D(() => {
5241
5299
  const s = [], c = e.state.tr;
5242
- e.state.doc.descendants((h, d) => {
5243
- if (h.type.name === "heading") {
5300
+ e.state.doc.descendants((u, d) => {
5301
+ if (u.type.name === "heading") {
5244
5302
  const l = `heading-${s.length + 1}`;
5245
- h.attrs.id !== l && c.setNodeMarkup(d, void 0, {
5246
- ...h.attrs,
5303
+ u.attrs.id !== l && c.setNodeMarkup(d, void 0, {
5304
+ ...u.attrs,
5247
5305
  id: l
5248
5306
  }), s.push({
5249
- level: h.attrs.level,
5250
- text: h.textContent,
5307
+ level: u.attrs.level,
5308
+ text: u.textContent,
5251
5309
  id: l
5252
5310
  });
5253
5311
  }
5254
- }), c.setMeta("addToHistory", !1), c.setMeta("preventUpdate", !0), e.view.dispatch(c), i(s), e.eventEmitter && e.eventEmitter.emit("TableOfContents", Sa(s));
5312
+ }), c.setMeta("addToHistory", !1), c.setMeta("preventUpdate", !0), e.view.dispatch(c), i(s), e.eventEmitter && e.eventEmitter.emit("TableOfContents", ma(s));
5255
5313
  }, [e]);
5256
- return M(() => {
5314
+ return T(() => {
5257
5315
  if (e) {
5258
5316
  if (!e.options.editable) {
5259
- o();
5317
+ r();
5260
5318
  return;
5261
5319
  }
5262
- return e.on("update", o), () => {
5263
- e.off("update", o);
5320
+ return e.on("update", r), () => {
5321
+ e.off("update", r);
5264
5322
  };
5265
5323
  }
5266
- }, [e, o]), M(() => {
5267
- o();
5268
- }, []), /* @__PURE__ */ r(le, { className: R("tableOfContent", be.toc, t && be.visible), children: t ? /* @__PURE__ */ m("div", { style: { position: "relative" }, children: [
5269
- /* @__PURE__ */ r("p", { className: "text-[20px] richtext-mb-[8px] richtext-font-semibold", children: a("editor.table_of_content") }),
5270
- /* @__PURE__ */ r("ul", { className: be.list, children: n.map((s, c) => /* @__PURE__ */ r(
5324
+ }, [e, r]), T(() => {
5325
+ r();
5326
+ }, []), /* @__PURE__ */ o(ae, { className: R("tableOfContent", fe.toc, t && fe.visible), children: t ? /* @__PURE__ */ m("div", { style: { position: "relative" }, children: [
5327
+ /* @__PURE__ */ o("p", { className: "text-[20px] richtext-mb-[8px] richtext-font-semibold", children: a("editor.table_of_content") }),
5328
+ /* @__PURE__ */ o("ul", { className: fe.list, children: n.map((s, c) => /* @__PURE__ */ o(
5271
5329
  "li",
5272
5330
  {
5273
- className: be.item,
5331
+ className: fe.item,
5274
5332
  style: { paddingLeft: `${s.level - 1}rem` },
5275
- children: /* @__PURE__ */ r("a", { href: `#${s.id}`, children: s.text })
5333
+ children: /* @__PURE__ */ o("a", { href: `#${s.id}`, children: s.text })
5276
5334
  },
5277
5335
  `table-of-content-${c}`
5278
5336
  )) })
5279
5337
  ] }) : null });
5280
5338
  }
5281
- function Ha(e, ...t) {
5282
- const [n, i] = v(!1);
5283
- return M(() => {
5339
+ function _a(e, ...t) {
5340
+ const [n, i] = k(!1);
5341
+ return T(() => {
5284
5342
  const a = () => {
5285
5343
  i(e.isActive.apply(e, t));
5286
5344
  };
@@ -5289,15 +5347,15 @@ function Ha(e, ...t) {
5289
5347
  };
5290
5348
  }, [e, t, i]), n;
5291
5349
  }
5292
- function Ma({ editor: e, icon: t, tooltip: n }) {
5293
- const i = Ha(e, Pa.name), a = F(() => {
5350
+ function ga({ editor: e, icon: t, tooltip: n }) {
5351
+ const i = _a(e, wa.name), a = D(() => {
5294
5352
  if (i) {
5295
5353
  e.chain().focus().removeTableOfContents().run();
5296
5354
  return;
5297
5355
  }
5298
5356
  e.chain().focus().setTableOfContents().run();
5299
5357
  }, [e, i]);
5300
- return /* @__PURE__ */ r(
5358
+ return /* @__PURE__ */ o(
5301
5359
  x,
5302
5360
  {
5303
5361
  action: a,
@@ -5307,18 +5365,18 @@ function Ma({ editor: e, icon: t, tooltip: n }) {
5307
5365
  }
5308
5366
  );
5309
5367
  }
5310
- function za(e) {
5368
+ function ba(e) {
5311
5369
  return e && e.type.name === "title";
5312
5370
  }
5313
- function Ra(e, t) {
5371
+ function xa(e, t) {
5314
5372
  const i = [e.getJSON()], a = [];
5315
5373
  for (; i.length > 0; ) {
5316
- const o = i.shift();
5317
- o.type === t && a.push(o), o.content && o.content.length > 0 && i.push(...o.content);
5374
+ const r = i.shift();
5375
+ r.type === t && a.push(r), r.content && r.content.length > 0 && i.push(...r.content);
5318
5376
  }
5319
5377
  return a;
5320
5378
  }
5321
- const Pa = we.create({
5379
+ const wa = oe.create({
5322
5380
  name: "tableOfContents",
5323
5381
  group: "block",
5324
5382
  atom: !0,
@@ -5332,7 +5390,7 @@ const Pa = we.create({
5332
5390
  lastColumnResizable: !0,
5333
5391
  allowTableNodeSelection: !1,
5334
5392
  button: ({ editor: t, t: n }) => ({
5335
- component: Ma,
5393
+ component: ga,
5336
5394
  componentProps: {
5337
5395
  disabled: !1,
5338
5396
  icon: "BookMarked",
@@ -5350,23 +5408,23 @@ const Pa = we.create({
5350
5408
  ];
5351
5409
  },
5352
5410
  renderHTML({ HTMLAttributes: e }) {
5353
- return ["toc", pe(e)];
5411
+ return ["toc", re(e)];
5354
5412
  },
5355
5413
  addNodeView() {
5356
- return He(Ea);
5414
+ return Le(fa);
5357
5415
  },
5358
5416
  // @ts-expect-error
5359
5417
  addCommands() {
5360
5418
  return {
5361
5419
  setTableOfContents: () => ({ commands: e, editor: t, view: n }) => {
5362
- if (Ra(t, this.name).length > 0) {
5420
+ if (xa(t, this.name).length > 0) {
5363
5421
  this.options.onHasOneBeforeInsert();
5364
5422
  return;
5365
5423
  }
5366
5424
  const a = n.props.state.doc.content.firstChild;
5367
- if (za(a)) {
5368
- const o = (a.firstChild && a.firstChild.nodeSize || 0) + 1;
5369
- return e.insertContentAt(o, { type: this.name });
5425
+ if (ba(a)) {
5426
+ const r = (a.firstChild && a.firstChild.nodeSize || 0) + 1;
5427
+ return e.insertContentAt(r, { type: this.name });
5370
5428
  }
5371
5429
  return e.insertContent({
5372
5430
  type: this.name
@@ -5374,9 +5432,9 @@ const Pa = we.create({
5374
5432
  },
5375
5433
  removeTableOfContents: () => ({ state: e, dispatch: t }) => {
5376
5434
  const { tr: n } = e, i = e.schema.nodes.tableOfContents;
5377
- return e.doc.descendants((a, o) => {
5435
+ return e.doc.descendants((a, r) => {
5378
5436
  if (a.type === i) {
5379
- const s = o, c = o + a.nodeSize;
5437
+ const s = r, c = r + a.nodeSize;
5380
5438
  n.delete(s, c);
5381
5439
  }
5382
5440
  }), n.docChanged ? (t(n), !0) : !1;
@@ -5396,11 +5454,11 @@ const Pa = we.create({
5396
5454
  ];
5397
5455
  }
5398
5456
  });
5399
- function Ia(e) {
5457
+ function pa(e) {
5400
5458
  var n;
5401
- const t = P(() => {
5402
- var o;
5403
- const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
5459
+ const t = B(() => {
5460
+ var r;
5461
+ const i = (r = e == null ? void 0 : e.items) == null ? void 0 : r.find((s) => s.isActive());
5404
5462
  return i && !i.default ? {
5405
5463
  ...i,
5406
5464
  icon: i.icon ? i.icon : e.icon
@@ -5410,21 +5468,21 @@ function Ia(e) {
5410
5468
  isActive: () => !1
5411
5469
  };
5412
5470
  }, [e]);
5413
- return /* @__PURE__ */ m(ie, { modal: !0, children: [
5414
- /* @__PURE__ */ r(
5415
- ae,
5471
+ return /* @__PURE__ */ m(X, { modal: !0, children: [
5472
+ /* @__PURE__ */ o(
5473
+ ee,
5416
5474
  {
5417
5475
  asChild: !0,
5418
5476
  disabled: e == null ? void 0 : e.disabled,
5419
- children: /* @__PURE__ */ r(
5477
+ children: /* @__PURE__ */ o(
5420
5478
  x,
5421
5479
  {
5422
5480
  customClass: "!richtext-w-12 richtext-h-12",
5423
5481
  disabled: e == null ? void 0 : e.disabled,
5424
5482
  icon: e == null ? void 0 : e.icon,
5425
5483
  tooltip: e == null ? void 0 : e.tooltip,
5426
- children: /* @__PURE__ */ r(
5427
- z,
5484
+ children: /* @__PURE__ */ o(
5485
+ A,
5428
5486
  {
5429
5487
  className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
5430
5488
  name: "MenuDown"
@@ -5434,29 +5492,29 @@ function Ia(e) {
5434
5492
  )
5435
5493
  }
5436
5494
  ),
5437
- /* @__PURE__ */ r(
5438
- oe,
5495
+ /* @__PURE__ */ o(
5496
+ te,
5439
5497
  {
5440
5498
  align: "start",
5441
5499
  className: "richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",
5442
5500
  side: "bottom",
5443
5501
  children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
5444
- var o, s;
5445
- return /* @__PURE__ */ m(ke, { children: [
5446
- /* @__PURE__ */ r(ve, { asChild: !0, children: /* @__PURE__ */ r(
5447
- $e,
5502
+ var r, s;
5503
+ return /* @__PURE__ */ m(xe, { children: [
5504
+ /* @__PURE__ */ o(we, { asChild: !0, children: /* @__PURE__ */ o(
5505
+ Ie,
5448
5506
  {
5449
5507
  className: "richtext-size-7 richtext-p-1",
5450
5508
  "data-state": t.title === i.title ? "on" : "off",
5451
5509
  onClick: i == null ? void 0 : i.action,
5452
5510
  pressed: t.title === i.title,
5453
5511
  size: "sm",
5454
- children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ r(z, { name: i.icon })
5512
+ children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ o(A, { name: i.icon })
5455
5513
  }
5456
5514
  ) }),
5457
- /* @__PURE__ */ m(Ce, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
5458
- /* @__PURE__ */ r("span", { children: i.title }),
5459
- !!((o = i.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: (s = i.shortcutKeys) == null ? void 0 : s.map((c) => Oe(c)).join(" ") })
5515
+ /* @__PURE__ */ m(pe, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
5516
+ /* @__PURE__ */ o("span", { children: i.title }),
5517
+ !!((r = i.shortcutKeys) != null && r.length) && /* @__PURE__ */ o("span", { children: (s = i.shortcutKeys) == null ? void 0 : s.map((c) => Re(c)).join(" ") })
5460
5518
  ] })
5461
5519
  ] }, `text-align-${a}`);
5462
5520
  })
@@ -5464,7 +5522,7 @@ function Ia(e) {
5464
5522
  )
5465
5523
  ] });
5466
5524
  }
5467
- const $o = N.create({
5525
+ const Co = C.create({
5468
5526
  name: "text-direction",
5469
5527
  addOptions() {
5470
5528
  var e;
@@ -5478,19 +5536,19 @@ const $o = N.create({
5478
5536
  extension: n,
5479
5537
  t: i
5480
5538
  }) {
5481
- var h;
5482
- const a = ((h = n.options) == null ? void 0 : h.directions) || [], o = {
5539
+ var u;
5540
+ const a = ((u = n.options) == null ? void 0 : u.directions) || [], r = {
5483
5541
  auto: "TextDirection",
5484
5542
  ltr: "LeftToRight",
5485
5543
  rtl: "RightToLeft"
5486
5544
  }, s = a.map((d) => ({
5487
5545
  title: i(`editor.textDirection.${d}.tooltip`),
5488
- icon: o[d],
5546
+ icon: r[d],
5489
5547
  isActive: () => !1,
5490
5548
  action: () => {
5491
- var l, u, f, _;
5549
+ var l, h, f, _;
5492
5550
  if (d === "auto") {
5493
- (u = (l = t.commands) == null ? void 0 : l.unsetTextDirection) == null || u.call(l);
5551
+ (h = (l = t.commands) == null ? void 0 : l.unsetTextDirection) == null || h.call(l);
5494
5552
  return;
5495
5553
  }
5496
5554
  (_ = (f = t.commands) == null ? void 0 : f.setTextDirection) == null || _.call(f, d);
@@ -5498,7 +5556,7 @@ const $o = N.create({
5498
5556
  disabled: !1
5499
5557
  })), c = s.filter((d) => d.disabled).length === s.length;
5500
5558
  return {
5501
- component: Ia,
5559
+ component: pa,
5502
5560
  componentProps: {
5503
5561
  icon: "TextDirection",
5504
5562
  tooltip: i("editor.textDirection.tooltip"),
@@ -5530,38 +5588,38 @@ const $o = N.create({
5530
5588
  unsetTextDirection: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "dir"))
5531
5589
  };
5532
5590
  }
5533
- }), Ba = "_listUsers_en3pm_1", ja = "_itemUser_en3pm_10", Da = "_selectedUser_en3pm_31", xe = {
5534
- listUsers: Ba,
5535
- itemUser: ja,
5536
- selectedUser: Da
5537
- }, Oa = Re((e, t) => {
5538
- const n = G(null), [i, a] = v(0), o = (d) => {
5591
+ }), ya = "_listUsers_en3pm_1", va = "_itemUser_en3pm_10", ka = "_selectedUser_en3pm_31", _e = {
5592
+ listUsers: ya,
5593
+ itemUser: va,
5594
+ selectedUser: ka
5595
+ }, Ca = Be((e, t) => {
5596
+ const n = $(null), [i, a] = k(0), r = (d) => {
5539
5597
  const l = e.items[d];
5540
5598
  l && e.command({ id: l, label: l });
5541
5599
  }, s = () => {
5542
5600
  a((i + e.items.length - 1) % e.items.length);
5543
5601
  }, c = () => {
5544
5602
  a((i + 1) % e.items.length);
5545
- }, h = () => {
5546
- o(i);
5603
+ }, u = () => {
5604
+ r(i);
5547
5605
  };
5548
- return M(() => a(0), [e.items]), M(() => {
5606
+ return T(() => a(0), [e.items]), T(() => {
5549
5607
  if (Number.isNaN(i + 1))
5550
5608
  return;
5551
5609
  const d = n.current.querySelector(`span:nth-of-type(${i + 1})`);
5552
- d && Ue(d, { behavior: "smooth", scrollMode: "if-needed" });
5553
- }, [i]), Pe(t, () => ({
5554
- onKeyDown: ({ event: d }) => d.key === "ArrowUp" ? (s(), !0) : d.key === "ArrowDown" ? (c(), !0) : d.key === "Enter" ? (h(), !0) : !1
5555
- })), /* @__PURE__ */ r("div", { className: R("listUsers", xe.listUsers), children: /* @__PURE__ */ r("div", { ref: n, children: e.items.length > 0 ? e.items.map((d, l) => /* @__PURE__ */ r(
5610
+ d && $e(d, { behavior: "smooth", scrollMode: "if-needed" });
5611
+ }, [i]), Oe(t, () => ({
5612
+ onKeyDown: ({ event: d }) => d.key === "ArrowUp" ? (s(), !0) : d.key === "ArrowDown" ? (c(), !0) : d.key === "Enter" ? (u(), !0) : !1
5613
+ })), /* @__PURE__ */ o("div", { className: R("listUsers", _e.listUsers), children: /* @__PURE__ */ o("div", { ref: n, children: e.items.length > 0 ? e.items.map((d, l) => /* @__PURE__ */ o(
5556
5614
  "span",
5557
5615
  {
5558
- className: R("itemUser", xe.itemUser, l === i ? xe.selectedUser : ""),
5559
- onClick: () => o(l),
5616
+ className: R("itemUser", _e.itemUser, l === i ? _e.selectedUser : ""),
5617
+ onClick: () => r(l),
5560
5618
  children: d
5561
5619
  },
5562
5620
  l
5563
- )) : /* @__PURE__ */ r("div", { className: R("itemUserEmpty", xe.itemUser), children: "Empty" }) }) });
5564
- }), $a = [
5621
+ )) : /* @__PURE__ */ o("div", { className: R("itemUserEmpty", _e.itemUser), children: "Empty" }) }) });
5622
+ }), Na = [
5565
5623
  {
5566
5624
  id: "1",
5567
5625
  name: "John Doe"
@@ -5578,16 +5636,16 @@ const $o = N.create({
5578
5636
  id: "4",
5579
5637
  name: "Bob"
5580
5638
  }
5581
- ], Fa = {
5582
- items: async ({ query: e }) => $a.map((n) => n.name).filter((n) => n.toLowerCase().startsWith(e.toLowerCase())),
5639
+ ], Aa = {
5640
+ items: async ({ query: e }) => Na.map((n) => n.name).filter((n) => n.toLowerCase().startsWith(e.toLowerCase())),
5583
5641
  render: () => {
5584
5642
  let e, t;
5585
5643
  return {
5586
5644
  onStart: (n) => {
5587
- e = new Me(Oa, {
5645
+ e = new Ee(Ca, {
5588
5646
  props: n,
5589
5647
  editor: n.editor
5590
- }), t = Fe("body", {
5648
+ }), t = Pe("body", {
5591
5649
  getReferenceClientRect: n.clientRect,
5592
5650
  appendTo: () => document.body,
5593
5651
  content: e.element,
@@ -5611,16 +5669,16 @@ const $o = N.create({
5611
5669
  }
5612
5670
  };
5613
5671
  }
5614
- }, Fo = an.extend({
5672
+ }, No = Gt.extend({
5615
5673
  addAttributes() {
5616
5674
  return {
5617
5675
  id: {
5618
5676
  default: "",
5619
- parseHTML: j("id")
5677
+ parseHTML: P("id")
5620
5678
  },
5621
5679
  label: {
5622
5680
  default: "",
5623
- parseHTML: j("label")
5681
+ parseHTML: P("label")
5624
5682
  }
5625
5683
  };
5626
5684
  }
@@ -5628,8 +5686,8 @@ const $o = N.create({
5628
5686
  HTMLAttributes: {
5629
5687
  class: "mention"
5630
5688
  },
5631
- suggestion: Fa
5632
- }), Ua = {
5689
+ suggestion: Aa
5690
+ }), Ta = {
5633
5691
  audio: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-audio-lines"><path d="M2 10v3"/><path d="M6 6v11"/><path d="M10 3v18"/><path d="M14 8v7"/><path d="M18 5v13"/><path d="M22 10v3"/></svg>',
5634
5692
  video: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-video"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"/><rect x="2" y="6" width="14" height="12" rx="2"/></svg>',
5635
5693
  file: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>',
@@ -5657,8 +5715,8 @@ const $o = N.create({
5657
5715
  excel: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sheet"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><line x1="3" x2="21" y1="15" y2="15"/><line x1="9" x2="9" y1="9" y2="21"/><line x1="15" x2="15" y1="9" y2="21"/></svg>',
5658
5716
  ppt: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-table-properties"><path d="M15 3v18"/><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M21 9H3"/><path d="M21 15H3"/></svg>'
5659
5717
  };
5660
- function qa(e) {
5661
- const t = Ua[e], a = new DOMParser().parseFromString(t, "image/svg+xml").documentElement, o = [
5718
+ function Sa(e) {
5719
+ const t = Ta[e], a = new DOMParser().parseFromString(t, "image/svg+xml").documentElement, r = [
5662
5720
  "svg",
5663
5721
  {
5664
5722
  ...Array.from(a.attributes).reduce((s, c) => (s[c.name] = c.value, s), {})
@@ -5668,86 +5726,86 @@ function qa(e) {
5668
5726
  if (s.nodeType === 1) {
5669
5727
  const c = [
5670
5728
  s.tagName.toLowerCase(),
5671
- Array.from(s.attributes).reduce((h, d) => (h[d.name] = d.value, h), {})
5729
+ Array.from(s.attributes).reduce((u, d) => (u[d.name] = d.value, u), {})
5672
5730
  ];
5673
- s.textContent && c.push(s.textContent), o.push(c);
5731
+ s.textContent && c.push(s.textContent), r.push(c);
5674
5732
  }
5675
- }), o;
5733
+ }), r;
5676
5734
  }
5677
- const Ka = {
5678
- audio: /* @__PURE__ */ r(kn, {}),
5679
- video: /* @__PURE__ */ r(yn, {}),
5680
- file: /* @__PURE__ */ r(pn, {}),
5681
- image: /* @__PURE__ */ r(wn, {}),
5682
- pdf: /* @__PURE__ */ r(On, {}),
5683
- word: /* @__PURE__ */ r(Dn, {}),
5684
- excel: /* @__PURE__ */ r(xn, {}),
5685
- ppt: /* @__PURE__ */ r(bn, {})
5735
+ const La = {
5736
+ audio: /* @__PURE__ */ o(Kn, {}),
5737
+ video: /* @__PURE__ */ o(Un, {}),
5738
+ file: /* @__PURE__ */ o(qn, {}),
5739
+ image: /* @__PURE__ */ o(Fn, {}),
5740
+ pdf: /* @__PURE__ */ o(_n, {}),
5741
+ word: /* @__PURE__ */ o(fn, {}),
5742
+ excel: /* @__PURE__ */ o($n, {}),
5743
+ ppt: /* @__PURE__ */ o(Dn, {})
5686
5744
  };
5687
- function wt(e, t = !1) {
5688
- const n = jn(e), i = Ka[n] || /* @__PURE__ */ r(ye, {});
5689
- return t ? qa(n) : i;
5745
+ function ht(e, t = !1) {
5746
+ const n = mn(e), i = La[n] || /* @__PURE__ */ o(ye, {});
5747
+ return t ? Sa(n) : i;
5690
5748
  }
5691
- const Va = "_wrap_1x1ms_2", Le = {
5692
- wrap: Va
5749
+ const Ea = "_wrap_1x1ms_2", Ce = {
5750
+ wrap: Ea
5693
5751
  };
5694
- function Wa({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension: a }) {
5695
- var H;
5696
- const o = G(null), s = De(), { hasTrigger: c, fileName: h, fileSize: d, fileExt: l, fileType: u, url: f, error: _ } = t.attrs, [w, p] = v(!1), { t: T } = B(), E = (H = a == null ? void 0 : a.options) == null ? void 0 : H.upload, g = F(() => {
5697
- !s || f || s && o.current.click();
5698
- }, [s, f]), b = F(
5752
+ function Ha({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension: a }) {
5753
+ var z;
5754
+ const r = $(null), s = Me(), { hasTrigger: c, fileName: u, fileSize: d, fileExt: l, fileType: h, url: f, error: _ } = t.attrs, [S, p] = k(!1), { t: M } = I(), H = (z = a == null ? void 0 : a.options) == null ? void 0 : z.upload, g = D(() => {
5755
+ !s || f || s && r.current.click();
5756
+ }, [s, f]), b = D(
5699
5757
  async (L) => {
5700
5758
  const O = L.target.files && L.target.files[0];
5701
5759
  if (!O)
5702
5760
  return;
5703
- const pt = {
5704
- fileName: Fn(O.name),
5761
+ const mt = {
5762
+ fileName: bn(O.name),
5705
5763
  fileSize: O.size,
5706
5764
  fileType: O.type,
5707
- fileExt: $n(O.name)
5765
+ fileExt: gn(O.name)
5708
5766
  };
5709
5767
  p(!0);
5710
5768
  try {
5711
- const ue = await E(O);
5712
- n({ ...pt, url: ue }), p(!1);
5713
- } catch (ue) {
5714
- n({ error: `File upload fail: ${ue && ue.message}` || "Unknown error" }), p(!1), o.current.value = "";
5769
+ const ce = await H(O);
5770
+ n({ ...mt, url: ce }), p(!1);
5771
+ } catch (ce) {
5772
+ n({ error: `File upload fail: ${ce && ce.message}` || "Unknown error" }), p(!1), r.current.value = "";
5715
5773
  }
5716
5774
  },
5717
5775
  [p, n]
5718
5776
  );
5719
- M(() => {
5777
+ T(() => {
5720
5778
  !f && !c && (g(), n({ hasTrigger: !0 }));
5721
5779
  }, [f, c, g, n]);
5722
- const k = F(() => i(), [e]);
5723
- return s && !f ? /* @__PURE__ */ r(le, { children: /* @__PURE__ */ m("div", { className: R(Le.wrap, "render-wrapper"), children: [
5724
- /* @__PURE__ */ r(
5780
+ const y = D(() => i(), [e]);
5781
+ return s && !f ? /* @__PURE__ */ o(ae, { children: /* @__PURE__ */ m("div", { className: R(Ce.wrap, "render-wrapper"), children: [
5782
+ /* @__PURE__ */ o(
5725
5783
  "p",
5726
5784
  {
5727
5785
  onClick: g,
5728
5786
  style: { cursor: "pointer" },
5729
- children: w ? /* @__PURE__ */ r("span", { children: T("editor.attachment.uploading") }) : /* @__PURE__ */ r("span", { children: T("editor.attachment.please_upload") })
5787
+ children: S ? /* @__PURE__ */ o("span", { children: M("editor.attachment.uploading") }) : /* @__PURE__ */ o("span", { children: M("editor.attachment.please_upload") })
5730
5788
  }
5731
5789
  ),
5732
- /* @__PURE__ */ r(
5790
+ /* @__PURE__ */ o(
5733
5791
  "input",
5734
5792
  {
5735
5793
  hidden: !0,
5736
5794
  onChange: b,
5737
- ref: o,
5795
+ ref: r,
5738
5796
  type: "file"
5739
5797
  }
5740
5798
  )
5741
- ] }) }) : f ? /* @__PURE__ */ r(le, { children: /* @__PURE__ */ m(
5799
+ ] }) }) : f ? /* @__PURE__ */ o(ae, { children: /* @__PURE__ */ m(
5742
5800
  "div",
5743
5801
  {
5744
- className: R(Le.wrap, "render-wrapper"),
5802
+ className: R(Ce.wrap, "render-wrapper"),
5745
5803
  onClick: g,
5746
5804
  children: [
5747
5805
  /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
5748
- /* @__PURE__ */ r("span", { children: wt(u) }),
5806
+ /* @__PURE__ */ o("span", { children: ht(h) }),
5749
5807
  /* @__PURE__ */ m("span", { children: [
5750
- h,
5808
+ u,
5751
5809
  ".",
5752
5810
  l
5753
5811
  ] }),
@@ -5757,26 +5815,26 @@ function Wa({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension:
5757
5815
  ")"
5758
5816
  ] })
5759
5817
  ] }),
5760
- /* @__PURE__ */ r(
5818
+ /* @__PURE__ */ o(
5761
5819
  x,
5762
5820
  {
5763
- action: k,
5821
+ action: y,
5764
5822
  icon: "Trash2",
5765
- tooltip: T("editor.delete")
5823
+ tooltip: M("editor.delete")
5766
5824
  }
5767
5825
  )
5768
5826
  ]
5769
5827
  }
5770
- ) }) : _ !== "null" ? /* @__PURE__ */ r(le, { children: /* @__PURE__ */ r(
5828
+ ) }) : _ !== "null" ? /* @__PURE__ */ o(ae, { children: /* @__PURE__ */ o(
5771
5829
  "div",
5772
5830
  {
5773
- className: R(Le.wrap, "render-wrapper"),
5831
+ className: R(Ce.wrap, "render-wrapper"),
5774
5832
  onClick: g,
5775
- children: /* @__PURE__ */ r("p", { children: _ })
5833
+ children: /* @__PURE__ */ o("p", { children: _ })
5776
5834
  }
5777
- ) }) : /* @__PURE__ */ r(ye, {});
5835
+ ) }) : /* @__PURE__ */ o(ye, {});
5778
5836
  }
5779
- const Uo = we.create({
5837
+ const Ao = oe.create({
5780
5838
  name: "attachment",
5781
5839
  content: "",
5782
5840
  marks: "",
@@ -5812,11 +5870,11 @@ const Uo = we.create({
5812
5870
  fileName: n = "",
5813
5871
  fileSize: i = "",
5814
5872
  fileType: a = "",
5815
- fileExt: o = ""
5873
+ fileExt: r = ""
5816
5874
  } = e || {};
5817
5875
  return [
5818
5876
  "div",
5819
- pe(
5877
+ re(
5820
5878
  // @ts-expect-error
5821
5879
  this.options.HTMLAttributes || {},
5822
5880
  e || {}
@@ -5827,12 +5885,12 @@ const Uo = we.create({
5827
5885
  [
5828
5886
  "span",
5829
5887
  { class: "attachment__icon" },
5830
- wt(a, !0)
5888
+ ht(a, !0)
5831
5889
  ],
5832
5890
  [
5833
5891
  "span",
5834
5892
  { class: "attachment__text" },
5835
- `${n}.${o} (${st(i)})`
5893
+ `${n}.${r} (${st(i)})`
5836
5894
  ]
5837
5895
  ] : ["div", { class: "attachment__placeholder" }]
5838
5896
  ];
@@ -5841,31 +5899,31 @@ const Uo = we.create({
5841
5899
  return {
5842
5900
  fileName: {
5843
5901
  default: null,
5844
- parseHTML: j("filename")
5902
+ parseHTML: P("filename")
5845
5903
  },
5846
5904
  fileSize: {
5847
5905
  default: null,
5848
- parseHTML: j("filesize")
5906
+ parseHTML: P("filesize")
5849
5907
  },
5850
5908
  fileType: {
5851
5909
  default: null,
5852
- parseHTML: j("filetype")
5910
+ parseHTML: P("filetype")
5853
5911
  },
5854
5912
  fileExt: {
5855
5913
  default: null,
5856
- parseHTML: j("fileext")
5914
+ parseHTML: P("fileext")
5857
5915
  },
5858
5916
  url: {
5859
5917
  default: null,
5860
- parseHTML: j("url")
5918
+ parseHTML: P("url")
5861
5919
  },
5862
5920
  hasTrigger: {
5863
5921
  default: !1,
5864
- parseHTML: (e) => j("hastrigger")(e) === "true"
5922
+ parseHTML: (e) => P("hastrigger")(e) === "true"
5865
5923
  },
5866
5924
  error: {
5867
5925
  default: null,
5868
- parseHTML: j("error")
5926
+ parseHTML: P("error")
5869
5927
  }
5870
5928
  };
5871
5929
  },
@@ -5875,57 +5933,57 @@ const Uo = we.create({
5875
5933
  };
5876
5934
  },
5877
5935
  addNodeView() {
5878
- return He(Wa);
5936
+ return Le(Ha);
5879
5937
  }
5880
5938
  });
5881
5939
  export {
5882
- Uo as Attachment,
5883
- So as BaseKit,
5884
- Co as Blockquote,
5885
- co as Bold,
5886
- po as BulletList,
5887
- yo as Clear,
5888
- mo as Code,
5889
- xi as CodeBlock,
5890
- xo as Color,
5891
- Sn as Column,
5892
- Lo as ColumnActionButton,
5893
- Vo as Drawer,
5894
- Bo as Emoji,
5895
- Wo as Excalidraw,
5896
- jo as ExportPdf,
5897
- Oo as ExportWord,
5898
- fo as FontFamily,
5899
- bo as FontSize,
5900
- Io as FormatPainter,
5901
- _o as Heading,
5902
- wo as Highlight,
5903
- To as History,
5904
- Ao as HorizontalRule,
5905
- Go as Iframe,
5906
- Mn as Image,
5907
- Zo as ImageGif,
5908
- Do as ImportWord,
5909
- Mo as Indent,
5910
- lo as Italic,
5911
- Jo as Katex,
5912
- zo as LineHeight,
5913
- No as Link,
5914
- Fo as Mention,
5915
- Qo as Mermaid,
5916
- Ho as MoreMark,
5917
- En as MultiColumn,
5918
- ko as OrderedList,
5919
- na as SearchAndReplace,
5920
- Ro as SlashCommand,
5921
- uo as Strike,
5922
- Eo as SubAndSuperScript,
5923
- Po as Table,
5924
- Pa as TableOfContents,
5925
- vo as TaskList,
5926
- go as TextAlign,
5927
- $o as TextDirection,
5928
- Yo as Twitter,
5929
- ho as Underline,
5930
- Rn as Video
5940
+ Ao as Attachment,
5941
+ ho as BaseKit,
5942
+ ro as Blockquote,
5943
+ Ka as Bold,
5944
+ no as BulletList,
5945
+ io as Clear,
5946
+ Za as Code,
5947
+ ni as CodeBlock,
5948
+ eo as Color,
5949
+ an as Column,
5950
+ uo as ColumnActionButton,
5951
+ Lo as Drawer,
5952
+ po as Emoji,
5953
+ Eo as Excalidraw,
5954
+ yo as ExportPdf,
5955
+ ko as ExportWord,
5956
+ Ja as FontFamily,
5957
+ Xa as FontSize,
5958
+ wo as FormatPainter,
5959
+ Ya as Heading,
5960
+ to as Highlight,
5961
+ lo as History,
5962
+ co as HorizontalRule,
5963
+ Ho as Iframe,
5964
+ sn as Image,
5965
+ zo as ImageGif,
5966
+ vo as ImportWord,
5967
+ _o as Indent,
5968
+ Va as Italic,
5969
+ Mo as Katex,
5970
+ go as LineHeight,
5971
+ so as Link,
5972
+ No as Mention,
5973
+ Ro as Mermaid,
5974
+ fo as MoreMark,
5975
+ on as MultiColumn,
5976
+ ao as OrderedList,
5977
+ Di as SearchAndReplace,
5978
+ bo as SlashCommand,
5979
+ Ga as Strike,
5980
+ mo as SubAndSuperScript,
5981
+ xo as Table,
5982
+ wa as TableOfContents,
5983
+ oo as TaskList,
5984
+ Qa as TextAlign,
5985
+ Co as TextDirection,
5986
+ Io as Twitter,
5987
+ Wa as Underline,
5988
+ ln as Video
5931
5989
  };