reactjs-tiptap-editor-pro 0.2.25 → 0.2.27

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,52 +1,52 @@
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-Kst3Ray3.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-tDefVoN_.js";
3
- import { jsxs as m, jsx as r, Fragment as ye } from "react/jsx-runtime";
1
+ import { a as ft, I as gt, U as bt, S as pt, C as wt, f as oe, N as se, b as yt, c as kt, R as Se, F as vt, H as xt, T as Ct, E as A, d as Nt, e as At, g as Lt, h as ge, O as St, i as Tt, j as Et, k as Ht, L as zt, l as Mt, m as be, n as Pt, o as Rt, D as It, P as jt, p as Bt, q as Dt, G as Ot, r as $t, s as Ft, t as Ut, u as qt, v as Kt, w as Vt, x as Je, y as Ye, z as Qe, A as Te, M as Wt } from "./tiptap-DkWHMWDt.js";
2
+ import { P as te, b as Z, $ as re, a0 as le, al as P, am as Gt, T as Xe, A as Zt, an as Jt, ao as Yt } from "./vendor-Cpa6z-M0.js";
3
+ import { jsxs as m, jsx as s, Fragment as pe } from "react/jsx-runtime";
4
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-Bxdp3pW3.js";
8
- import { a3 as Vo, $ as Wo, Z as Go, a0 as Zo, _ as Jo, a1 as Qo, a2 as Yo } from "./RichTextEditor-Bxdp3pW3.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-PJxla8pp.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";
5
+ import Qt, { useMemo as R, useState as C, useRef as G, useCallback as F, Fragment as Ee, forwardRef as He, useImperativeHandle as ze, useEffect as z } from "react";
6
+ import { ChevronDown as Me, Check as Xt, ChevronUp as en, Copy as tn, CopyCheck as nn, SearchIcon as an, LoaderIcon as on, LucideTableProperties as sn, LucideSheet as rn, LucideImage as ln, LucideFile as cn, LucideVideo as dn, LucideAudioLines as un } from "lucide-react";
7
+ import { i as Pe, T as we, a as ye, B as V, b as ke, g as Re, A as p, D as Y, c as Q, d as X, e as mn, f as T, u as Ie, h as hn, I as M, j as ne, k as et, l as Ae, m as _n, n as je, P as ce, o as de, p as ue, q as Be, C as fn, H as gn, L as bn, r as pn, M as wn, s as yn, t as Fe, v as he, w as K, E as D, x as kn, y as vn, V as xn, z as Ue, F as ve, G as qe, S as Cn, J as Nn, K as An, N as B, O as Ln, Q as Sn, U as Tn, W as En, X as Hn, Y as tt } from "./RichTextEditor-B1Y3PPzy.js";
8
+ import { a4 as Ao, a0 as Lo, _ as So, a1 as To, $ as Eo, a2 as Ho, Z as zo, a3 as Mo } from "./RichTextEditor-B1Y3PPzy.js";
9
+ import { M as zn, D as nt, u as j, f as Mn, g as Pn, h as Ke, i as N, j as at, k as Rn } from "./index-M6H3FoBi.js";
10
+ import { bundledThemes as it, bundledLanguages as ot, createHighlighter as In } from "shiki";
11
+ import * as x from "@radix-ui/react-select";
12
+ import { Slot as jn } from "@radix-ui/react-slot";
13
+ import De from "tippy.js";
14
+ import Oe from "scroll-into-view-if-needed";
15
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(
16
+ import { Packer as Bn, WidthType as Dn } from "docx";
17
+ import { DocxSerializer as On, defaultNodes as U, defaultMarks as $n } from "prosemirror-docx";
18
+ const $e = Qt.forwardRef(
19
19
  ({ asChild: e, ...t }, n) => {
20
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,
21
+ const a = Pe[t.icon];
22
+ return /* @__PURE__ */ m(we, { children: [
23
+ /* @__PURE__ */ s(ye, { asChild: !0, children: /* @__PURE__ */ s(
24
+ e ? jn : V,
25
25
  {
26
- className: "richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0",
26
+ className: "h-[32px] min-w-24 overflow-hidden px-[5px] py-0",
27
27
  disabled: t == null ? void 0 : t.disabled,
28
28
  ref: n,
29
29
  variant: "ghost",
30
30
  ...t,
31
- 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
+ children: /* @__PURE__ */ m("div", { className: "flex h-full items-center font-normal", children: [
32
+ (t == null ? void 0 : t.title) && /* @__PURE__ */ s("div", { className: "grow truncate text-left text-sm", children: t == null ? void 0 : t.title }),
33
+ a && /* @__PURE__ */ s(a, { className: "ml-1 size-3 shrink-0 text-zinc-500" })
34
34
  ] })
35
35
  }
36
36
  ) }),
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) }) })
37
+ /* @__PURE__ */ s(ke, { children: /* @__PURE__ */ m("div", { className: "flex max-w-24 flex-col items-center text-center", children: [
38
+ (t == null ? void 0 : t.tooltip) && /* @__PURE__ */ s("div", { children: t == null ? void 0 : t.tooltip }),
39
+ /* @__PURE__ */ s("div", { className: "flex", children: !!((o = t == null ? void 0 : t.shortcutKeys) != null && o.length) && /* @__PURE__ */ s("span", { children: Re(t == null ? void 0 : t.shortcutKeys) }) })
40
40
  ] }) })
41
41
  ] });
42
42
  }
43
- ), co = yt.extend({
43
+ ), Ui = ft.extend({
44
44
  addOptions() {
45
45
  var e;
46
46
  return {
47
47
  ...(e = this.parent) == null ? void 0 : e.call(this),
48
48
  button: ({ editor: t, t: n }) => ({
49
- component: x,
49
+ component: p,
50
50
  componentProps: {
51
51
  action: () => t.commands.toggleBold(),
52
52
  isActive: () => t.isActive("bold") || !1,
@@ -58,14 +58,14 @@ const qe = dn.forwardRef(
58
58
  })
59
59
  };
60
60
  }
61
- }), lo = kt.extend({
61
+ }), qi = gt.extend({
62
62
  addOptions() {
63
63
  var e;
64
64
  return {
65
65
  ...(e = this.parent) == null ? void 0 : e.call(this),
66
66
  button({ editor: t, t: n }) {
67
67
  return {
68
- component: x,
68
+ component: p,
69
69
  componentProps: {
70
70
  action: () => t.commands.toggleItalic(),
71
71
  isActive: () => t.isActive("italic") || !1,
@@ -78,14 +78,14 @@ const qe = dn.forwardRef(
78
78
  }
79
79
  };
80
80
  }
81
- }), ho = vt.extend({
81
+ }), Ki = bt.extend({
82
82
  addOptions() {
83
83
  var e;
84
84
  return {
85
85
  ...(e = this.parent) == null ? void 0 : e.call(this),
86
86
  button({ editor: t, t: n }) {
87
87
  return {
88
- component: x,
88
+ component: p,
89
89
  componentProps: {
90
90
  action: () => t.commands.toggleUnderline(),
91
91
  isActive: () => t.isActive("underline") || !1,
@@ -98,13 +98,13 @@ const qe = dn.forwardRef(
98
98
  }
99
99
  };
100
100
  }
101
- }), uo = Ct.extend({
101
+ }), Vi = pt.extend({
102
102
  addOptions() {
103
103
  var e;
104
104
  return {
105
105
  ...(e = this.parent) == null ? void 0 : e.call(this),
106
106
  button: ({ editor: t, t: n }) => ({
107
- component: x,
107
+ component: p,
108
108
  componentProps: {
109
109
  action: () => t.commands.toggleStrike(),
110
110
  isActive: () => t.isActive("strike") || !1,
@@ -116,13 +116,13 @@ const qe = dn.forwardRef(
116
116
  })
117
117
  };
118
118
  }
119
- }), mo = Nt.extend({
119
+ }), Wi = wt.extend({
120
120
  addOptions() {
121
121
  var e;
122
122
  return {
123
123
  ...(e = this.parent) == null ? void 0 : e.call(this),
124
124
  button: ({ editor: t, t: n }) => ({
125
- component: x,
125
+ component: p,
126
126
  componentProps: {
127
127
  action: () => t.commands.toggleCode(),
128
128
  isActive: () => t.isActive("code") || !1,
@@ -135,85 +135,85 @@ const qe = dn.forwardRef(
135
135
  };
136
136
  }
137
137
  });
138
- let I, re;
139
- const Ae = /* @__PURE__ */ new Set(), Te = /* @__PURE__ */ new Set();
140
- function Xn() {
138
+ let I, ae;
139
+ const xe = /* @__PURE__ */ new Set(), Ce = /* @__PURE__ */ new Set();
140
+ function Fn() {
141
141
  return I;
142
142
  }
143
- function ei(e) {
144
- if (!I && !re) {
143
+ function Un(e) {
144
+ if (!I && !ae) {
145
145
  const t = e.themes.filter(
146
- (i) => !!i && i in dt
146
+ (a) => !!a && a in it
147
147
  ), n = e.languages.filter(
148
- (i) => !!i && i in ht
148
+ (a) => !!a && a in ot
149
149
  );
150
- return re = Wn({ themes: t, langs: n }).then((i) => {
151
- I = i;
152
- }), re;
150
+ return ae = In({ themes: t, langs: n }).then((a) => {
151
+ I = a;
152
+ }), ae;
153
153
  }
154
- if (re)
155
- return re;
154
+ if (ae)
155
+ return ae;
156
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;
157
+ async function st(e) {
158
+ return I && !I.getLoadedThemes().includes(e) && !Ce.has(e) && e in it ? (Ce.add(e), await I.loadTheme(e), Ce.delete(e), !0) : !1;
159
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;
160
+ async function rt(e) {
161
+ return I && !I.getLoadedLanguages().includes(e) && !xe.has(e) && e in ot ? (xe.add(e), await I.loadLanguage(e), xe.delete(e), !0) : !1;
162
162
  }
163
- async function ti({
163
+ async function qn({
164
164
  doc: e,
165
165
  name: t,
166
166
  defaultTheme: n,
167
- defaultLanguage: i
167
+ defaultLanguage: a
168
168
  }) {
169
- const a = ce(e, (c) => c.type.name === t), o = [
170
- ...a.map((c) => c.node.attrs.theme),
169
+ const i = oe(e, (l) => l.type.name === t), o = [
170
+ ...i.map((l) => l.node.attrs.theme),
171
171
  n
172
- ], s = [
173
- ...a.map((c) => c.node.attrs.language),
174
- i
172
+ ], r = [
173
+ ...i.map((l) => l.node.attrs.language),
174
+ a
175
175
  ];
176
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 });
177
+ ...o.flatMap((l) => st(l)),
178
+ ...r.flatMap((l) => !!l && rt(l))
179
+ ]) : await Un({ languages: r, themes: o });
180
180
  }
181
- function Ze({
181
+ function Ve({
182
182
  doc: e,
183
183
  name: t,
184
184
  defaultTheme: n,
185
- defaultLanguage: i
185
+ defaultLanguage: a
186
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)
187
+ const i = [];
188
+ return oe(e, (r) => r.type.name === t).forEach((r) => {
189
+ let l = r.pos + 1, u = r.node.attrs.language || a;
190
+ const d = r.node.attrs.theme || n, c = Fn();
191
+ if (!c)
192
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
193
+ c.getLoadedLanguages().includes(u) || (u = "plaintext");
194
+ const h = c.getLoadedThemes().includes(d) ? d : c.getLoadedThemes()[0], _ = c.codeToTokensBase(r.node.textContent, {
195
+ lang: u,
196
+ theme: h
197
197
  });
198
- for (const _ of f) {
199
- for (const w of _) {
200
- const p = c + w.content.length, T = he.inline(c, p, {
198
+ for (const f of _) {
199
+ for (const w of f) {
200
+ const y = l + w.content.length, L = le.inline(l, y, {
201
201
  style: `color: ${w.color}`
202
202
  });
203
- a.push(T), c = p;
203
+ i.push(L), l = y;
204
204
  }
205
- c += 1;
205
+ l += 1;
206
206
  }
207
- }), de.create(e, a);
207
+ }), re.create(e, i);
208
208
  }
209
- function ni({
209
+ function Kn({
210
210
  name: e,
211
211
  defaultLanguage: t,
212
212
  defaultTheme: n
213
213
  }) {
214
- const i = new te({
214
+ const a = new te({
215
215
  key: new Z("shiki"),
216
- view(a) {
216
+ view(i) {
217
217
  class o {
218
218
  constructor() {
219
219
  this.initDecorations();
@@ -225,259 +225,259 @@ function ni({
225
225
  }
226
226
  // Initialize shiki async, and then highlight initial document
227
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);
228
+ const l = i.state.doc;
229
+ await qn({ doc: l, name: e, defaultLanguage: t, defaultTheme: n });
230
+ const u = i.state.tr.setMeta("shikiPluginForceDecoration", !0);
231
+ i.dispatch(u);
232
232
  }
233
233
  // When new codeblocks were added and they have missing themes or
234
234
  // languages, load those and then add code decorations once again.
235
235
  async checkUndecoratedBlocks() {
236
- const c = ce(
237
- a.state.doc,
238
- (l) => l.type.name === e
236
+ const l = oe(
237
+ i.state.doc,
238
+ (c) => c.type.name === e
239
239
  );
240
240
  if ((await Promise.all(
241
- c.flatMap((l) => [
242
- ut(l.node.attrs.theme),
243
- mt(l.node.attrs.language)
241
+ l.flatMap((c) => [
242
+ st(c.node.attrs.theme),
243
+ rt(c.node.attrs.language)
244
244
  ])
245
245
  )).includes(!0)) {
246
- const l = a.state.tr.setMeta("shikiPluginForceDecoration", !0);
247
- a.dispatch(l);
246
+ const c = i.state.tr.setMeta("shikiPluginForceDecoration", !0);
247
+ i.dispatch(c);
248
248
  }
249
249
  }
250
250
  }
251
251
  return new o();
252
252
  },
253
253
  state: {
254
- init: (a, { doc: o }) => Ze({
254
+ init: (i, { doc: o }) => Ve({
255
255
  doc: o,
256
256
  name: e,
257
257
  defaultLanguage: t,
258
258
  defaultTheme: n
259
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,
260
+ apply: (i, o, r, l) => {
261
+ const u = r.selection.$head.parent.type.name, d = l.selection.$head.parent.type.name, c = oe(
262
+ r.doc,
263
+ (f) => f.type.name === e
264
+ ), h = oe(
265
+ l.doc,
266
+ (f) => f.type.name === e
267
+ ), _ = i.docChanged && ([u, d].includes(e) || h.length !== c.length || i.steps.some((f) => f.from !== void 0 && f.to !== void 0 && c.some((w) => w.pos >= f.from && w.pos + w.node.nodeSize <= f.to)));
268
+ return i.getMeta("shikiPluginForceDecoration") || _ ? Ve({
269
+ doc: i.doc,
270
270
  name: e,
271
271
  defaultLanguage: t,
272
272
  defaultTheme: n
273
- }) : o.map(a.mapping, a.doc);
273
+ }) : o.map(i.mapping, i.doc);
274
274
  }
275
275
  },
276
276
  props: {
277
277
  //@ts-expect-error
278
- decorations(a) {
279
- return i.getState(a);
278
+ decorations(i) {
279
+ return a.getState(i);
280
280
  }
281
281
  }
282
282
  });
283
- return i;
283
+ return a;
284
284
  }
285
- function ii({ action: e, languages: t, ...n }) {
286
- const i = (o) => {
285
+ function Vn({ action: e, languages: t, ...n }) {
286
+ const a = (o) => {
287
287
  e(o);
288
- }, a = P(() => t == null ? void 0 : t.map((o) => ({
289
- title: Un[o] || o,
288
+ }, i = R(() => t == null ? void 0 : t.map((o) => ({
289
+ title: zn[o] || o,
290
290
  // icon: language.icon,
291
291
  language: o
292
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,
293
+ return /* @__PURE__ */ m(Y, { children: [
294
+ /* @__PURE__ */ s(Q, { disabled: n == null ? void 0 : n.disabled, asChild: !0, children: /* @__PURE__ */ s(
295
+ p,
296
296
  {
297
297
  tooltip: n == null ? void 0 : n.tooltip,
298
298
  disabled: n == null ? void 0 : n.disabled,
299
299
  icon: n == null ? void 0 : n.icon
300
300
  }
301
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}`)) })
302
+ /* @__PURE__ */ s(X, { className: "w-full !max-h-[180px] !overflow-y-scroll", children: i == null ? void 0 : i.map((o) => /* @__PURE__ */ s(mn, { onClick: () => a(o.language), children: /* @__PURE__ */ s("div", { className: "h-full ml-1", children: o.title }) }, `codeblock-${o.title}`)) })
303
303
  ] });
304
304
  }
305
- const ai = C.Root, oi = C.Value, ft = J.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ m(
306
- C.Trigger,
305
+ const Wn = x.Root, Gn = x.Value, lt = J.forwardRef(({ className: e, children: t, ...n }, a) => /* @__PURE__ */ m(
306
+ x.Trigger,
307
307
  {
308
- ref: i,
309
- className: S(
310
- "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",
308
+ ref: a,
309
+ className: T(
310
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
311
311
  e
312
312
  ),
313
313
  ...n,
314
314
  children: [
315
315
  t,
316
- /* @__PURE__ */ r(C.Icon, { asChild: !0, children: /* @__PURE__ */ r(Ie, { className: "richtext-h-4 richtext-w-4 richtext-opacity-50" }) })
316
+ /* @__PURE__ */ s(x.Icon, { asChild: !0, children: /* @__PURE__ */ s(Me, { className: "h-4 w-4 opacity-50" }) })
317
317
  ]
318
318
  }
319
319
  ));
320
- ft.displayName = C.Trigger.displayName;
321
- const _t = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
322
- C.ScrollUpButton,
320
+ lt.displayName = x.Trigger.displayName;
321
+ const ct = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ s(
322
+ x.ScrollUpButton,
323
323
  {
324
324
  ref: n,
325
- className: S(
326
- "richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",
325
+ className: T(
326
+ "flex cursor-default items-center justify-center py-1",
327
327
  e
328
328
  ),
329
329
  ...t,
330
- children: /* @__PURE__ */ r(un, { className: "richtext-h-4 richtext-w-4" })
330
+ children: /* @__PURE__ */ s(en, { className: "h-4 w-4" })
331
331
  }
332
332
  ));
333
- _t.displayName = C.ScrollUpButton.displayName;
334
- const gt = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
335
- C.ScrollDownButton,
333
+ ct.displayName = x.ScrollUpButton.displayName;
334
+ const dt = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ s(
335
+ x.ScrollDownButton,
336
336
  {
337
337
  ref: n,
338
- className: S(
339
- "richtext-flex richtext-cursor-default richtext-items-center richtext-justify-center richtext-py-1",
338
+ className: T(
339
+ "flex cursor-default items-center justify-center py-1",
340
340
  e
341
341
  ),
342
342
  ...t,
343
- children: /* @__PURE__ */ r(Ie, { className: "richtext-h-4 richtext-w-4" })
343
+ children: /* @__PURE__ */ s(Me, { className: "h-4 w-4" })
344
344
  }
345
345
  ));
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,
346
+ dt.displayName = x.ScrollDownButton.displayName;
347
+ const ut = J.forwardRef(({ className: e, children: t, position: n = "popper", ...a }, i) => /* @__PURE__ */ s(x.Portal, { children: /* @__PURE__ */ m(
348
+ x.Content,
349
349
  {
350
- ref: a,
351
- className: S(
352
- "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
- 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",
350
+ ref: i,
351
+ className: T(
352
+ "relative z-50 max-h-60 overflow-y-auto min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
353
+ n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
354
354
  e
355
355
  ),
356
356
  position: n,
357
- ...i,
357
+ ...a,
358
358
  children: [
359
- /* @__PURE__ */ r(_t, {}),
360
- /* @__PURE__ */ r(
361
- C.Viewport,
359
+ /* @__PURE__ */ s(ct, {}),
360
+ /* @__PURE__ */ s(
361
+ x.Viewport,
362
362
  {
363
- className: S(
364
- "richtext-p-1",
365
- n === "popper" && "richtext-h-[var(--radix-select-trigger-height)] richtext-w-full richtext-min-w-[var(--radix-select-trigger-width)]"
363
+ className: T(
364
+ "p-1",
365
+ n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
366
366
  ),
367
367
  children: t
368
368
  }
369
369
  ),
370
- /* @__PURE__ */ r(gt, {})
370
+ /* @__PURE__ */ s(dt, {})
371
371
  ]
372
372
  }
373
373
  ) }));
374
- bt.displayName = C.Content.displayName;
375
- const ri = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
376
- C.Label,
374
+ ut.displayName = x.Content.displayName;
375
+ const Zn = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ s(
376
+ x.Label,
377
377
  {
378
378
  ref: n,
379
- className: S("richtext-py-1.5 richtext-pl-8 richtext-pr-2 richtext-text-sm richtext-font-semibold", e),
379
+ className: T("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
380
380
  ...t
381
381
  }
382
382
  ));
383
- ri.displayName = C.Label.displayName;
384
- const Ee = J.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ m(
385
- C.Item,
383
+ Zn.displayName = x.Label.displayName;
384
+ const Le = J.forwardRef(({ className: e, children: t, ...n }, a) => /* @__PURE__ */ m(
385
+ x.Item,
386
386
  {
387
- ref: i,
388
- className: S(
389
- "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",
387
+ ref: a,
388
+ className: T(
389
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
390
390
  e
391
391
  ),
392
392
  ...n,
393
393
  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 })
394
+ /* @__PURE__ */ s("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ s(x.ItemIndicator, { children: /* @__PURE__ */ s(Xt, { className: "h-4 w-4" }) }) }),
395
+ /* @__PURE__ */ s(x.ItemText, { children: t })
396
396
  ]
397
397
  }
398
398
  ));
399
- Ee.displayName = C.Item.displayName;
400
- const si = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
401
- C.Separator,
399
+ Le.displayName = x.Item.displayName;
400
+ const Jn = J.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ s(
401
+ x.Separator,
402
402
  {
403
403
  ref: n,
404
- className: S("richtext--mx-1 richtext-my-1 richtext-h-px richtext-bg-muted", e),
404
+ className: T("-mx-1 my-1 h-px bg-muted", e),
405
405
  ...t
406
406
  }
407
407
  ));
408
- si.displayName = C.Separator.displayName;
409
- function ci() {
410
- const [e, t] = v(!1);
411
- return { isCopied: e, copyToClipboard: async (i) => {
408
+ Jn.displayName = x.Separator.displayName;
409
+ function Yn() {
410
+ const [e, t] = C(!1);
411
+ return { isCopied: e, copyToClipboard: async (a) => {
412
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);
413
+ await navigator.clipboard.writeText(a), t(!0), setTimeout(() => t(!1), 2e3);
414
+ } catch (i) {
415
+ console.error("Failed to copy text: ", i), t(!1);
416
416
  }
417
417
  } };
418
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
419
+ const Qn = "_wrap_fsdar_1", Xn = "_maxHeight_fsdar_10", ea = "_btnCopy_fsdar_13", ta = "_btnDelete_fsdar_14", na = "_blockInfo_fsdar_18", aa = "_blockInfoEditable_fsdar_28", ia = "_selectLang_fsdar_32", oa = "_copied_fsdar_58", $ = {
420
+ wrap: Qn,
421
+ maxHeight: Xn,
422
+ btnCopy: ea,
423
+ btnDelete: ta,
424
+ blockInfo: na,
425
+ blockInfoEditable: aa,
426
+ selectLang: ia,
427
+ copied: oa
428
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(() => {
429
+ function sa({ editor: e, node: { attrs: t }, updateAttributes: n, extension: a }) {
430
+ var _, f;
431
+ const { isCopied: i, copyToClipboard: o } = Yn(), r = R(() => {
432
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: [
433
+ return (w = a.options.languages) != null && w.length ? a.options.languages : nt;
434
+ }, [a.options.languages]), l = Ie(), u = (f = (_ = e == null ? void 0 : e.options) == null ? void 0 : _.editorProps) == null ? void 0 : f.print, { language: d } = t, c = G(null), h = F(() => hn(ra.name, e), [e]);
435
+ return /* @__PURE__ */ m(se, { className: P($.wrap, !u && $.maxHeight, "render-wrapper"), children: [
436
436
  /* @__PURE__ */ m(
437
437
  "div",
438
438
  {
439
- className: R($.blockInfo, {
440
- [$.blockInfoEditable]: !c
439
+ className: P($.blockInfo, {
440
+ [$.blockInfoEditable]: !l
441
441
  }),
442
442
  children: [
443
- /* @__PURE__ */ r(
443
+ /* @__PURE__ */ s(
444
444
  "span",
445
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 })
446
+ className: P($.btnCopy, i && $.copied),
447
+ onClick: () => o(c.current.innerText),
448
+ children: i ? /* @__PURE__ */ s(nn, { size: 16 }) : /* @__PURE__ */ s(tn, { size: 16 })
449
449
  }
450
450
  ),
451
- /* @__PURE__ */ r(
451
+ /* @__PURE__ */ s(
452
452
  "span",
453
453
  {
454
454
  className: $.btnDelete,
455
- onClick: u,
456
- children: /* @__PURE__ */ r(
457
- z,
455
+ onClick: h,
456
+ children: /* @__PURE__ */ s(
457
+ M,
458
458
  {
459
459
  name: "Trash2"
460
460
  }
461
461
  )
462
462
  }
463
463
  ),
464
- /* @__PURE__ */ r("div", { className: $.selectLang, children: /* @__PURE__ */ m(
465
- ai,
464
+ /* @__PURE__ */ s("div", { className: $.selectLang, children: /* @__PURE__ */ m(
465
+ Wn,
466
466
  {
467
467
  defaultValue: d || "auto",
468
- disabled: !c,
468
+ disabled: !l,
469
469
  onValueChange: (w) => n({ language: w }),
470
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,
471
+ /* @__PURE__ */ s(lt, { children: /* @__PURE__ */ s(Gn, { placeholder: "Language" }) }),
472
+ /* @__PURE__ */ m(ut, { className: "max-h-60 overflow-y-auto", children: [
473
+ /* @__PURE__ */ s(Le, { value: "auto", children: "Auto" }),
474
+ r.map((w, y) => /* @__PURE__ */ s(
475
+ Le,
476
476
  {
477
477
  value: w,
478
478
  children: w.charAt(0).toUpperCase() + w.slice(1)
479
479
  },
480
- `code-lang-${p}`
480
+ `code-lang-${y}`
481
481
  ))
482
482
  ] })
483
483
  ]
@@ -486,42 +486,42 @@ function bi({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }
486
486
  ]
487
487
  }
488
488
  ),
489
- /* @__PURE__ */ r("pre", { ref: l, children: /* @__PURE__ */ r(At, { as: "code" }) })
489
+ /* @__PURE__ */ s("pre", { ref: c, children: /* @__PURE__ */ s(yt, { as: "code" }) })
490
490
  ] });
491
491
  }
492
- const xi = Tt.extend({
492
+ const ra = kt.extend({
493
493
  addOptions() {
494
494
  var e;
495
495
  return {
496
496
  ...(e = this.parent) == null ? void 0 : e.call(this),
497
497
  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;
498
+ button: ({ editor: t, t: n, extension: a }) => {
499
+ var o, r, l;
500
+ const i = (r = (o = a == null ? void 0 : a.options) == null ? void 0 : o.languages) != null && r.length ? (l = a == null ? void 0 : a.options) == null ? void 0 : l.languages : nt;
501
501
  return {
502
- component: ii,
502
+ component: Vn,
503
503
  componentProps: {
504
- action: (h = "js") => t.commands.setCodeBlock({
505
- language: h
504
+ action: (u = "js") => t.commands.setCodeBlock({
505
+ language: u
506
506
  }),
507
507
  isActive: () => t.isActive("codeBlock") || !1,
508
508
  disabled: !t.can().toggleCodeBlock(),
509
509
  icon: "Code2",
510
510
  tooltip: n("editor.codeblock.tooltip"),
511
- languages: a
511
+ languages: i
512
512
  }
513
513
  };
514
514
  }
515
515
  };
516
516
  },
517
517
  addNodeView() {
518
- return He(bi);
518
+ return Se(sa);
519
519
  },
520
520
  addProseMirrorPlugins() {
521
521
  var e;
522
522
  return [
523
523
  ...((e = this.parent) == null ? void 0 : e.call(this)) || [],
524
- ni({
524
+ Kn({
525
525
  name: this.name,
526
526
  defaultLanguage: null,
527
527
  defaultTheme: this.options.defaultTheme
@@ -529,13 +529,13 @@ const xi = Tt.extend({
529
529
  ];
530
530
  }
531
531
  });
532
- function wi(e) {
533
- var a, o, s;
534
- const { t, lang: n } = B(), i = P(() => {
532
+ function la(e) {
533
+ var i, o, r;
534
+ const { t, lang: n } = j(), a = R(() => {
535
535
  var d;
536
- const c = (d = e == null ? void 0 : e.items) == null ? void 0 : d.find((l) => l.isActive());
537
- return c && !c.default ? {
538
- ...c
536
+ const l = (d = e == null ? void 0 : e.items) == null ? void 0 : d.find((c) => c.isActive());
537
+ return l && !l.default ? {
538
+ ...l
539
539
  } : {
540
540
  title: e.tooltip,
541
541
  font: t("editor.fontFamily.default.tooltip"),
@@ -544,79 +544,79 @@ function wi(e) {
544
544
  action: () => e.editor.chain().focus().unsetFontFamily().run()
545
545
  };
546
546
  }, [t, n, e]);
547
- return /* @__PURE__ */ m(Q, { children: [
548
- /* @__PURE__ */ r(
549
- Y,
547
+ return /* @__PURE__ */ m(Y, { children: [
548
+ /* @__PURE__ */ s(
549
+ Q,
550
550
  {
551
551
  asChild: !0,
552
552
  disabled: e == null ? void 0 : e.disabled,
553
- children: /* @__PURE__ */ r(
554
- qe,
553
+ children: /* @__PURE__ */ s(
554
+ $e,
555
555
  {
556
556
  disabled: e == null ? void 0 : e.disabled,
557
557
  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,
558
+ title: ((i = a == null ? void 0 : a.font) == null ? void 0 : i.length) > 7 ? `${(o = a == null ? void 0 : a.font) == null ? void 0 : o.slice(0, 6)}...` : a == null ? void 0 : a.font,
559
559
  tooltip: e == null ? void 0 : e.tooltip
560
560
  }
561
561
  )
562
562
  }
563
563
  ),
564
- /* @__PURE__ */ r(X, { className: "richtext-w-full", children: (s = e == null ? void 0 : e.items) == null ? void 0 : s.map((c, h) => {
565
- const d = c.font === t("editor.fontFamily.default.tooltip") ? {} : { fontFamily: c.font };
566
- return /* @__PURE__ */ m(ze, { children: [
567
- /* @__PURE__ */ r(
564
+ /* @__PURE__ */ s(X, { className: "w-full", children: (r = e == null ? void 0 : e.items) == null ? void 0 : r.map((l, u) => {
565
+ const d = l.font === t("editor.fontFamily.default.tooltip") ? {} : { fontFamily: l.font };
566
+ return /* @__PURE__ */ m(Ee, { children: [
567
+ /* @__PURE__ */ s(
568
568
  ne,
569
569
  {
570
- checked: (i == null ? void 0 : i.font) === c.font,
571
- onClick: c.action,
572
- children: /* @__PURE__ */ r(
570
+ checked: (a == null ? void 0 : a.font) === l.font,
571
+ onClick: l.action,
572
+ children: /* @__PURE__ */ s(
573
573
  "div",
574
574
  {
575
- className: "richtext-ml-1 richtext-h-full",
575
+ className: "ml-1 h-full",
576
576
  style: d,
577
- children: c.font
577
+ children: l.font
578
578
  }
579
579
  )
580
580
  }
581
581
  ),
582
- c.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ r(rt, {})
583
- ] }, `font-family-${h}`);
582
+ l.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ s(et, {})
583
+ ] }, `font-family-${u}`);
584
584
  }) })
585
585
  ] });
586
586
  }
587
- const fo = Lt.extend({
587
+ const Gi = vt.extend({
588
588
  addOptions() {
589
589
  var e;
590
590
  return {
591
591
  ...(e = this.parent) == null ? void 0 : e.call(this),
592
- fontFamilyList: qn,
593
- button({ editor: t, extension: n, t: i }) {
592
+ fontFamilyList: Mn,
593
+ button({ editor: t, extension: n, t: a }) {
594
594
  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(
596
- (l) => l.name === "base-kit"
597
- ), c = o.map((l) => ({
595
+ const { extensions: i = [] } = t.extensionManager ?? [], o = Ae(((d = n == null ? void 0 : n.options) == null ? void 0 : d.fontFamilyList) || []), r = i.find(
596
+ (c) => c.name === "base-kit"
597
+ ), l = o.map((c) => ({
598
598
  action: () => {
599
- t.chain().focus().setFontFamily(l.value).run();
599
+ t.chain().focus().setFontFamily(c.value).run();
600
600
  },
601
- isActive: () => t.isActive("textStyle", { fontFamily: l.value }) || !1,
602
- disabled: !t.can().setFontFamily(l.value),
603
- title: l.name,
604
- font: l.value
601
+ isActive: () => t.isActive("textStyle", { fontFamily: c.value }) || !1,
602
+ disabled: !t.can().setFontFamily(c.value),
603
+ title: c.name,
604
+ font: c.value
605
605
  }));
606
- s && s.options.textStyle !== !1 && c.unshift({
606
+ r && r.options.textStyle !== !1 && l.unshift({
607
607
  action: () => t.chain().focus().unsetFontFamily().run(),
608
608
  isActive: () => !1,
609
609
  disabled: !1,
610
- font: i("editor.fontFamily.default.tooltip"),
611
- title: i("editor.fontFamily.tooltip")
610
+ font: a("editor.fontFamily.default.tooltip"),
611
+ title: a("editor.fontFamily.tooltip")
612
612
  });
613
- const h = c.filter((l) => l.disabled).length === c.length;
613
+ const u = l.filter((c) => c.disabled).length === l.length;
614
614
  return {
615
- component: wi,
615
+ component: la,
616
616
  componentProps: {
617
- tooltip: i("editor.fontFamily.tooltip"),
618
- disabled: h,
619
- items: c,
617
+ tooltip: a("editor.fontFamily.tooltip"),
618
+ disabled: u,
619
+ items: l,
620
620
  editor: t
621
621
  }
622
622
  };
@@ -624,27 +624,27 @@ const fo = Lt.extend({
624
624
  };
625
625
  }
626
626
  });
627
- function pi(e) {
627
+ function ca(e) {
628
628
  var n;
629
- const t = P(() => {
629
+ const t = R(() => {
630
630
  var o;
631
- const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
632
- return i && !i.default ? {
633
- ...i
631
+ const a = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((r) => r.isActive());
632
+ return a && !a.default ? {
633
+ ...a
634
634
  } : {
635
635
  title: e.tooltip,
636
636
  level: 0,
637
637
  isActive: () => !1
638
638
  };
639
639
  }, [e]);
640
- return /* @__PURE__ */ m(Q, { children: [
641
- /* @__PURE__ */ r(
642
- Y,
640
+ return /* @__PURE__ */ m(Y, { children: [
641
+ /* @__PURE__ */ s(
642
+ Q,
643
643
  {
644
644
  asChild: !0,
645
645
  disabled: e == null ? void 0 : e.disabled,
646
- children: /* @__PURE__ */ r(
647
- qe,
646
+ children: /* @__PURE__ */ s(
647
+ $e,
648
648
  {
649
649
  disabled: e == null ? void 0 : e.disabled,
650
650
  icon: "MenuDown",
@@ -654,58 +654,58 @@ function pi(e) {
654
654
  )
655
655
  }
656
656
  ),
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: [
657
+ /* @__PURE__ */ s(X, { className: "w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((a, i) => {
658
+ var o, r;
659
+ return /* @__PURE__ */ m(Ee, { children: [
660
660
  /* @__PURE__ */ m(
661
661
  ne,
662
662
  {
663
- checked: (t == null ? void 0 : t.title) === i.title,
664
- onClick: i.action,
663
+ checked: (t == null ? void 0 : t.title) === a.title,
664
+ onClick: a.action,
665
665
  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(" ") })
666
+ /* @__PURE__ */ s("div", { className: `heading- ml-1 h-full${a.level}`, children: a.title }),
667
+ !!((o = a == null ? void 0 : a.shortcutKeys) != null && o.length) && /* @__PURE__ */ s(_n, { className: "pl-4", children: (r = a == null ? void 0 : a.shortcutKeys) == null ? void 0 : r.map((l) => je(l)).join(" ") })
668
668
  ]
669
669
  }
670
670
  ),
671
- i.level === 0 && /* @__PURE__ */ r(rt, {})
672
- ] }, `heading-k-${a}`);
671
+ a.level === 0 && /* @__PURE__ */ s(et, {})
672
+ ] }, `heading-k-${i}`);
673
673
  }) })
674
674
  ] });
675
675
  }
676
- const _o = St.extend({
676
+ const Zi = xt.extend({
677
677
  addOptions() {
678
678
  var e;
679
679
  return {
680
680
  ...(e = this.parent) == null ? void 0 : e.call(this),
681
681
  levels: [1, 2, 3, 4, 5, 6],
682
- button({ editor: t, extension: n, t: i }) {
682
+ button({ editor: t, extension: n, t: a }) {
683
683
  var d;
684
- const { extensions: a = [] } = t.extensionManager ?? [], o = ((d = n.options) == null ? void 0 : d.levels) || [], s = a.find(
685
- (l) => l.name === "base-kit"
686
- ), c = o.map((l) => ({
687
- action: () => t.commands.toggleHeading({ level: l }),
688
- isActive: () => t.isActive("heading", { level: l }) || !1,
689
- disabled: !t.can().toggleHeading({ level: l }),
690
- title: i(`editor.heading.h${l}.tooltip`),
691
- level: l,
692
- shortcutKeys: ["alt", "mod", `${l}`]
684
+ const { extensions: i = [] } = t.extensionManager ?? [], o = ((d = n.options) == null ? void 0 : d.levels) || [], r = i.find(
685
+ (c) => c.name === "base-kit"
686
+ ), l = o.map((c) => ({
687
+ action: () => t.commands.toggleHeading({ level: c }),
688
+ isActive: () => t.isActive("heading", { level: c }) || !1,
689
+ disabled: !t.can().toggleHeading({ level: c }),
690
+ title: a(`editor.heading.h${c}.tooltip`),
691
+ level: c,
692
+ shortcutKeys: ["alt", "mod", `${c}`]
693
693
  }));
694
- s && s.options.paragraph !== !1 && c.unshift({
694
+ r && r.options.paragraph !== !1 && l.unshift({
695
695
  action: () => t.commands.setParagraph(),
696
696
  isActive: () => t.isActive("paragraph") || !1,
697
697
  disabled: !t.can().setParagraph(),
698
698
  level: 0,
699
- title: i("editor.paragraph.tooltip"),
699
+ title: a("editor.paragraph.tooltip"),
700
700
  shortcutKeys: ["alt", "mod", "0"]
701
701
  });
702
- const h = c.filter((l) => l.disabled).length === c.length;
702
+ const u = l.filter((c) => c.disabled).length === l.length;
703
703
  return {
704
- component: pi,
704
+ component: ca,
705
705
  componentProps: {
706
- tooltip: i("editor.heading.tooltip"),
707
- disabled: h,
708
- items: c,
706
+ tooltip: a("editor.heading.tooltip"),
707
+ disabled: u,
708
+ items: l,
709
709
  editor: t
710
710
  }
711
711
  };
@@ -713,37 +713,37 @@ const _o = St.extend({
713
713
  };
714
714
  }
715
715
  });
716
- function yi(e) {
716
+ function da(e) {
717
717
  var n;
718
- const t = P(() => {
718
+ const t = R(() => {
719
719
  var o;
720
- const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
721
- return i && !i.default ? {
722
- ...i,
723
- icon: i.icon ? i.icon : e.icon
720
+ const a = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((r) => r.isActive());
721
+ return a && !a.default ? {
722
+ ...a,
723
+ icon: a.icon ? a.icon : e.icon
724
724
  } : {
725
725
  title: e == null ? void 0 : e.tooltip,
726
726
  icon: e.icon,
727
727
  isActive: () => !1
728
728
  };
729
729
  }, [e]);
730
- return /* @__PURE__ */ m(ie, { modal: !0, children: [
731
- /* @__PURE__ */ r(
732
- ae,
730
+ return /* @__PURE__ */ m(ce, { modal: !0, children: [
731
+ /* @__PURE__ */ s(
732
+ de,
733
733
  {
734
734
  asChild: !0,
735
735
  disabled: e == null ? void 0 : e.disabled,
736
- children: /* @__PURE__ */ r(
737
- x,
736
+ children: /* @__PURE__ */ s(
737
+ p,
738
738
  {
739
- customClass: "!richtext-w-12 richtext-h-12",
739
+ customClass: "!w-12 h-12",
740
740
  disabled: e == null ? void 0 : e.disabled,
741
741
  icon: e == null ? void 0 : e.icon,
742
742
  tooltip: e == null ? void 0 : e.tooltip,
743
- children: /* @__PURE__ */ r(
744
- z,
743
+ children: /* @__PURE__ */ s(
744
+ M,
745
745
  {
746
- className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
746
+ className: "ml-1 size-3 text-zinc-500",
747
747
  name: "MenuDown"
748
748
  }
749
749
  )
@@ -751,37 +751,37 @@ function yi(e) {
751
751
  )
752
752
  }
753
753
  ),
754
- /* @__PURE__ */ r(
755
- oe,
754
+ /* @__PURE__ */ s(
755
+ ue,
756
756
  {
757
757
  align: "start",
758
- className: "richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",
758
+ className: "flex w-full min-w-4 flex-row gap-1 !p-[4px]",
759
759
  side: "bottom",
760
- 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,
760
+ children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((a, i) => {
761
+ var o, r;
762
+ return /* @__PURE__ */ m(we, { children: [
763
+ /* @__PURE__ */ s(ye, { asChild: !0, children: /* @__PURE__ */ s(
764
+ Be,
765
765
  {
766
- className: "richtext-size-7 richtext-p-1",
767
- "data-state": t.title === i.title ? "on" : "off",
768
- onClick: i == null ? void 0 : i.action,
769
- pressed: t.title === i.title,
766
+ className: "size-7 p-1",
767
+ "data-state": t.title === a.title ? "on" : "off",
768
+ onClick: a == null ? void 0 : a.action,
769
+ pressed: t.title === a.title,
770
770
  size: "sm",
771
- children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ r(z, { name: i.icon })
771
+ children: (a == null ? void 0 : a.icon) && /* @__PURE__ */ s(M, { name: a.icon })
772
772
  }
773
773
  ) }),
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(" ") })
774
+ /* @__PURE__ */ m(ke, { className: "flex flex-col items-center", children: [
775
+ /* @__PURE__ */ s("span", { children: a.title }),
776
+ !!((o = a.shortcutKeys) != null && o.length) && /* @__PURE__ */ s("span", { children: (r = a.shortcutKeys) == null ? void 0 : r.map((l) => je(l)).join(" ") })
777
777
  ] })
778
- ] }, `text-align-${a}`);
778
+ ] }, `text-align-${i}`);
779
779
  })
780
780
  }
781
781
  )
782
782
  ] });
783
783
  }
784
- const go = Et.extend({
784
+ const Ji = Ct.extend({
785
785
  addOptions() {
786
786
  var e;
787
787
  return {
@@ -790,63 +790,63 @@ const go = Et.extend({
790
790
  button({
791
791
  editor: t,
792
792
  extension: n,
793
- t: i
793
+ t: a
794
794
  }) {
795
795
  var d;
796
- const a = ((d = n.options) == null ? void 0 : d.alignments) || [], o = {
796
+ const i = ((d = n.options) == null ? void 0 : d.alignments) || [], o = {
797
797
  left: ["mod", "Shift", "L"],
798
798
  center: ["mod", "Shift", "E"],
799
799
  right: ["mod", "Shift", "R"],
800
800
  justify: ["mod", "Shift", "J"]
801
- }, s = {
801
+ }, r = {
802
802
  left: "AlignLeft",
803
803
  center: "AlignCenter",
804
804
  right: "AlignRight",
805
805
  justify: "AlignJustify"
806
- }, c = a.map((l) => {
807
- var u, f, _;
806
+ }, l = i.map((c) => {
807
+ var h, _, f;
808
808
  return {
809
- title: i(`editor.textalign.${l}.tooltip`),
810
- icon: s[l],
811
- shortcutKeys: o[l],
812
- isActive: () => t.isActive({ textAlign: l }) || !1,
809
+ title: a(`editor.textalign.${c}.tooltip`),
810
+ icon: r[c],
811
+ shortcutKeys: o[c],
812
+ isActive: () => t.isActive({ textAlign: c }) || !1,
813
813
  action: () => {
814
- var w, p;
815
- return (p = (w = t.commands) == null ? void 0 : w.setTextAlign) == null ? void 0 : p.call(w, l);
814
+ var w, y;
815
+ return (y = (w = t.commands) == null ? void 0 : w.setTextAlign) == null ? void 0 : y.call(w, c);
816
816
  },
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))
817
+ disabled: !((f = (_ = (h = t == null ? void 0 : t.can) == null ? void 0 : h.call(t)) == null ? void 0 : _.setTextAlign) != null && f.call(_, c))
818
818
  };
819
- }), h = c.filter((l) => l.disabled).length === c.length;
819
+ }), u = l.filter((c) => c.disabled).length === l.length;
820
820
  return {
821
- component: yi,
821
+ component: da,
822
822
  componentProps: {
823
823
  icon: "AlignJustify",
824
- tooltip: i("editor.textalign.tooltip"),
825
- disabled: h,
826
- items: c
824
+ tooltip: a("editor.textalign.tooltip"),
825
+ disabled: u,
826
+ items: l
827
827
  }
828
828
  };
829
829
  }
830
830
  };
831
831
  }
832
832
  });
833
- function ki(e) {
834
- var i;
835
- const { t } = B(), n = P(() => {
836
- const a = (e.items || []).find((s) => s.isActive());
837
- return a || {
833
+ function ua(e) {
834
+ var a;
835
+ const { t } = j(), n = R(() => {
836
+ const i = (e.items || []).find((r) => r.isActive());
837
+ return i || {
838
838
  title: t("editor.fontSize.default.tooltip"),
839
839
  isActive: () => !1
840
840
  };
841
841
  }, [e]);
842
- return /* @__PURE__ */ m(Q, { children: [
843
- /* @__PURE__ */ r(
844
- Y,
842
+ return /* @__PURE__ */ m(Y, { children: [
843
+ /* @__PURE__ */ s(
844
+ Q,
845
845
  {
846
846
  asChild: !0,
847
847
  disabled: e == null ? void 0 : e.disabled,
848
- children: /* @__PURE__ */ r(
849
- qe,
848
+ children: /* @__PURE__ */ s(
849
+ $e,
850
850
  {
851
851
  disabled: e == null ? void 0 : e.disabled,
852
852
  icon: "MenuDown",
@@ -856,32 +856,32 @@ function ki(e) {
856
856
  )
857
857
  }
858
858
  ),
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(
859
+ /* @__PURE__ */ s(X, { className: "max-h-96 w-32 overflow-y-auto", children: (a = e == null ? void 0 : e.items) == null ? void 0 : a.map((i, o) => /* @__PURE__ */ s(
860
860
  ne,
861
861
  {
862
- checked: n.title === a.title,
863
- onClick: a.action,
864
- children: /* @__PURE__ */ r("div", { className: "richtext-ml-1 richtext-h-full", children: a.title })
862
+ checked: n.title === i.title,
863
+ onClick: i.action,
864
+ children: /* @__PURE__ */ s("div", { className: "ml-1 h-full", children: i.title })
865
865
  },
866
866
  `font-size-${o}`
867
867
  )) })
868
868
  ] });
869
869
  }
870
- const bo = N.create({
870
+ const Yi = A.create({
871
871
  name: "fontSize",
872
872
  addOptions() {
873
873
  var e;
874
874
  return {
875
875
  ...(e = this.parent) == null ? void 0 : e.call(this),
876
876
  types: ["textStyle"],
877
- fontSizes: [...Kn],
878
- 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),
877
+ fontSizes: [...Pn],
878
+ button({ editor: t, extension: n, t: a }) {
879
+ var u;
880
+ const i = Ae(((u = n.options) == null ? void 0 : u.fontSizes) || Ke), o = Ae([Ke])[0], r = i.map((d) => ({
881
+ title: d.value === o.value ? a("editor.fontSize.default.tooltip") : String(d.name),
882
882
  isActive: () => {
883
- const { fontSize: l } = t.getAttributes("textStyle");
884
- return d.value === o.value && l === void 0 ? !0 : t.isActive({ fontSize: String(d.value) }) || !1;
883
+ const { fontSize: c } = t.getAttributes("textStyle");
884
+ return d.value === o.value && c === void 0 ? !0 : t.isActive({ fontSize: String(d.value) }) || !1;
885
885
  },
886
886
  action: () => {
887
887
  if (d.value === o.value) {
@@ -893,14 +893,14 @@ const bo = N.create({
893
893
  disabled: !t.can().setFontSize(String(d.value)),
894
894
  divider: d.value === o.value || !1,
895
895
  default: d.value === o.value || !1
896
- })), c = s.filter((d) => d.disabled).length === s.length;
896
+ })), l = r.filter((d) => d.disabled).length === r.length;
897
897
  return {
898
- component: ki,
898
+ component: ua,
899
899
  componentProps: {
900
900
  editor: t,
901
- tooltip: i("editor.fontSize.tooltip"),
902
- disabled: c,
903
- items: s,
901
+ tooltip: a("editor.fontSize.tooltip"),
902
+ disabled: l,
903
+ items: r,
904
904
  maxHeight: 280
905
905
  }
906
906
  };
@@ -930,8 +930,8 @@ const bo = N.create({
930
930
  };
931
931
  }
932
932
  });
933
- function vi({ fill: e }) {
934
- return /* @__PURE__ */ r(
933
+ function ma({ fill: e }) {
934
+ return /* @__PURE__ */ s(
935
935
  "svg",
936
936
  {
937
937
  width: "18px",
@@ -939,8 +939,8 @@ function vi({ fill: e }) {
939
939
  viewBox: "0 0 240 240",
940
940
  version: "1.1",
941
941
  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(
942
+ children: /* @__PURE__ */ s("g", { stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ s("g", { transform: "translate(0.000000, 0.500000)", children: /* @__PURE__ */ m("g", { transform: "translate(39.000000, 17.353553)", children: [
943
+ /* @__PURE__ */ s(
944
944
  "path",
945
945
  {
946
946
  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 +949,7 @@ function vi({ fill: e }) {
949
949
  fillRule: "evenodd"
950
950
  }
951
951
  ),
952
- /* @__PURE__ */ r(
952
+ /* @__PURE__ */ s(
953
953
  "path",
954
954
  {
955
955
  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 +958,7 @@ function vi({ fill: e }) {
958
958
  fillRule: "nonzero"
959
959
  }
960
960
  ),
961
- /* @__PURE__ */ r(
961
+ /* @__PURE__ */ s(
962
962
  "path",
963
963
  {
964
964
  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,55 +971,55 @@ function vi({ fill: e }) {
971
971
  }
972
972
  );
973
973
  }
974
- function Ci(e) {
975
- const [t, n] = v(void 0);
976
- function i(s) {
977
- var c;
978
- (c = e.action) == null || c.call(e, s);
974
+ function ha(e) {
975
+ const [t, n] = C(void 0);
976
+ function a(r) {
977
+ var l;
978
+ (l = e.action) == null || l.call(e, r);
979
979
  }
980
- function a() {
981
- var s;
982
- (s = e.action) == null || s.call(e, t);
980
+ function i() {
981
+ var r;
982
+ (r = e.action) == null || r.call(e, t);
983
983
  }
984
984
  const o = F(
985
- on((s) => {
986
- n(s);
985
+ Gt((r) => {
986
+ n(r);
987
987
  }, 350),
988
988
  []
989
989
  );
990
- 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,
990
+ return /* @__PURE__ */ m("div", { className: "flex items-center h-[32px]", children: [
991
+ /* @__PURE__ */ s(p, { tooltip: e == null ? void 0 : e.tooltip, disabled: e == null ? void 0 : e.disabled, action: i, children: /* @__PURE__ */ s("span", { className: "flex items-center justify-center text-sm", children: /* @__PURE__ */ s(ma, { fill: t }) }) }),
992
+ /* @__PURE__ */ s(
993
+ fn,
994
994
  {
995
995
  selectedColor: t,
996
996
  setSelectedColor: o,
997
- onChange: i,
997
+ onChange: a,
998
998
  disabled: e == null ? void 0 : e.disabled,
999
999
  colors: e == null ? void 0 : e.colors,
1000
1000
  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" }) })
1001
+ children: /* @__PURE__ */ s(V, { variant: "ghost", size: "icon", className: "r!ichtext-h-[32px] !w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ s(M, { className: "!w-3 !h-3 text-zinc-500", name: "MenuDown" }) })
1002
1002
  }
1003
1003
  )
1004
1004
  ] });
1005
1005
  }
1006
- const xo = Ht.extend({
1006
+ const Qi = Nt.extend({
1007
1007
  addOptions() {
1008
1008
  var e;
1009
1009
  return {
1010
1010
  ...(e = this.parent) == null ? void 0 : e.call(this),
1011
- button({ editor: t, t: n, extension: i }) {
1011
+ button({ editor: t, t: n, extension: a }) {
1012
1012
  return {
1013
- component: Ci,
1013
+ component: ha,
1014
1014
  componentProps: {
1015
- colors: i.options.colors,
1016
- defaultColor: i.options.defaultColor,
1017
- action: (a) => {
1018
- a === void 0 && t.chain().focus().unsetColor().run(), typeof a == "string" && t.chain().focus().setColor(a).run();
1015
+ colors: a.options.colors,
1016
+ defaultColor: a.options.defaultColor,
1017
+ action: (i) => {
1018
+ i === void 0 && t.chain().focus().unsetColor().run(), typeof i == "string" && t.chain().focus().setColor(i).run();
1019
1019
  },
1020
1020
  isActive: () => {
1021
- const { color: a } = t.getAttributes("textStyle");
1022
- return a && t.isActive({ color: a }) || !1;
1021
+ const { color: i } = t.getAttributes("textStyle");
1022
+ return i && t.isActive({ color: i }) || !1;
1023
1023
  },
1024
1024
  editor: t,
1025
1025
  disabled: !t.can().setColor(""),
@@ -1029,17 +1029,17 @@ const xo = Ht.extend({
1029
1029
  }
1030
1030
  };
1031
1031
  }
1032
- }), wo = Mt.extend({
1032
+ }), Xi = At.extend({
1033
1033
  addOptions() {
1034
1034
  var e;
1035
1035
  return {
1036
1036
  ...(e = this.parent) == null ? void 0 : e.call(this),
1037
1037
  multicolor: !0,
1038
1038
  button: ({ editor: t, t: n }) => ({
1039
- component: Tn,
1039
+ component: gn,
1040
1040
  componentProps: {
1041
- action: (i) => {
1042
- typeof i == "string" && t.chain().focus().setHighlight({ color: i }).run(), i === void 0 && t.chain().focus().unsetHighlight().run();
1041
+ action: (a) => {
1042
+ typeof a == "string" && t.chain().focus().setHighlight({ color: a }).run(), a === void 0 && t.chain().focus().unsetHighlight().run();
1043
1043
  },
1044
1044
  editor: t,
1045
1045
  isActive: () => t.isActive("highlight") || !1,
@@ -1050,13 +1050,13 @@ const xo = Ht.extend({
1050
1050
  })
1051
1051
  };
1052
1052
  }
1053
- }), po = zt.extend({
1053
+ }), eo = Lt.extend({
1054
1054
  addOptions() {
1055
1055
  var e;
1056
1056
  return {
1057
1057
  ...(e = this.parent) == null ? void 0 : e.call(this),
1058
1058
  button: ({ editor: t, t: n }) => ({
1059
- component: x,
1059
+ component: p,
1060
1060
  componentProps: {
1061
1061
  action: () => t.commands.toggleBulletList(),
1062
1062
  isActive: () => t.isActive("bulletList") || !1,
@@ -1068,14 +1068,14 @@ const xo = Ht.extend({
1068
1068
  })
1069
1069
  };
1070
1070
  }
1071
- }), yo = we.create({
1071
+ }), to = ge.create({
1072
1072
  name: "clear",
1073
1073
  addOptions() {
1074
1074
  var e;
1075
1075
  return {
1076
1076
  ...(e = this.parent) == null ? void 0 : e.call(this),
1077
1077
  button: ({ editor: t, t: n }) => ({
1078
- component: x,
1078
+ component: p,
1079
1079
  componentProps: {
1080
1080
  action: () => t.chain().focus().clearNodes().unsetAllMarks().run(),
1081
1081
  disabled: !t.can().chain().focus().clearNodes().unsetAllMarks().run(),
@@ -1085,13 +1085,13 @@ const xo = Ht.extend({
1085
1085
  })
1086
1086
  };
1087
1087
  }
1088
- }), ko = Rt.extend({
1088
+ }), no = St.extend({
1089
1089
  addOptions() {
1090
1090
  var e;
1091
1091
  return {
1092
1092
  ...(e = this.parent) == null ? void 0 : e.call(this),
1093
1093
  button: ({ editor: t, t: n }) => ({
1094
- component: x,
1094
+ component: p,
1095
1095
  componentProps: {
1096
1096
  action: () => t.commands.toggleOrderedList(),
1097
1097
  isActive: () => t.isActive("orderedList") || !1,
@@ -1103,7 +1103,7 @@ const xo = Ht.extend({
1103
1103
  })
1104
1104
  };
1105
1105
  }
1106
- }), vo = Pt.extend({
1106
+ }), ao = Tt.extend({
1107
1107
  addOptions() {
1108
1108
  var e;
1109
1109
  return {
@@ -1117,7 +1117,7 @@ const xo = Ht.extend({
1117
1117
  }
1118
1118
  },
1119
1119
  button: ({ editor: t, t: n }) => ({
1120
- component: x,
1120
+ component: p,
1121
1121
  componentProps: {
1122
1122
  action: () => t.commands.toggleTaskList(),
1123
1123
  isActive: () => t.isActive("taskList") || !1,
@@ -1130,9 +1130,9 @@ const xo = Ht.extend({
1130
1130
  };
1131
1131
  },
1132
1132
  addExtensions() {
1133
- return [It.configure(this.options.taskItem)];
1133
+ return [Et.configure(this.options.taskItem)];
1134
1134
  }
1135
- }), Co = Bt.extend({
1135
+ }), io = Ht.extend({
1136
1136
  addOptions() {
1137
1137
  var e;
1138
1138
  return {
@@ -1141,7 +1141,7 @@ const xo = Ht.extend({
1141
1141
  class: "blockquote"
1142
1142
  },
1143
1143
  button: ({ editor: t, t: n }) => ({
1144
- component: x,
1144
+ component: p,
1145
1145
  componentProps: {
1146
1146
  action: () => t.commands.toggleBlockquote(),
1147
1147
  isActive: () => t.isActive("blockquote") || !1,
@@ -1154,25 +1154,25 @@ const xo = Ht.extend({
1154
1154
  };
1155
1155
  }
1156
1156
  });
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));
1157
+ function _a(e) {
1158
+ const [t, n] = C(!1);
1159
+ function a(i, o, r) {
1160
+ e.action && (e.action({ link: i, text: o, openInNewTab: r }), n(!1));
1161
1161
  }
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(
1164
- x,
1162
+ return /* @__PURE__ */ m(ce, { modal: !0, open: t, onOpenChange: n, children: [
1163
+ /* @__PURE__ */ s(de, { disabled: e == null ? void 0 : e.disabled, asChild: !0, children: /* @__PURE__ */ s(
1164
+ p,
1165
1165
  {
1166
1166
  tooltip: e == null ? void 0 : e.tooltip,
1167
1167
  isActive: e == null ? void 0 : e.isActive,
1168
1168
  disabled: e == null ? void 0 : e.disabled,
1169
- children: /* @__PURE__ */ r(z, { name: e == null ? void 0 : e.icon })
1169
+ children: /* @__PURE__ */ s(M, { name: e == null ? void 0 : e.icon })
1170
1170
  }
1171
1171
  ) }),
1172
- /* @__PURE__ */ r(oe, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ r(Ln, { editor: e.editor, onSetLink: i }) })
1172
+ /* @__PURE__ */ s(ue, { hideWhenDetached: !0, className: "w-full", align: "start", side: "bottom", children: /* @__PURE__ */ s(bn, { editor: e.editor, onSetLink: a }) })
1173
1173
  ] });
1174
1174
  }
1175
- const No = jt.extend({
1175
+ const oo = zt.extend({
1176
1176
  inclusive: !1,
1177
1177
  parseHTML() {
1178
1178
  return [
@@ -1184,7 +1184,7 @@ const No = jt.extend({
1184
1184
  renderHTML({ HTMLAttributes: e }) {
1185
1185
  return [
1186
1186
  "a",
1187
- pe(this.options.HTMLAttributes, e, {
1187
+ be(this.options.HTMLAttributes, e, {
1188
1188
  class: "link"
1189
1189
  }),
1190
1190
  0
@@ -1196,11 +1196,11 @@ const No = jt.extend({
1196
1196
  ...(e = this.parent) == null ? void 0 : e.call(this),
1197
1197
  openOnClick: !0,
1198
1198
  button: ({ editor: t, t: n }) => ({
1199
- component: Ni,
1199
+ component: _a,
1200
1200
  componentProps: {
1201
1201
  editor: t,
1202
- action: (i) => {
1203
- const { link: a, text: o, openInNewTab: s } = i;
1202
+ action: (a) => {
1203
+ const { link: i, text: o, openInNewTab: r } = a;
1204
1204
  t.chain().extendMarkRange("link").insertContent({
1205
1205
  type: "text",
1206
1206
  text: o,
@@ -1208,12 +1208,12 @@ const No = jt.extend({
1208
1208
  {
1209
1209
  type: "link",
1210
1210
  attrs: {
1211
- href: a,
1212
- target: s ? "_blank" : ""
1211
+ href: i,
1212
+ target: r ? "_blank" : ""
1213
1213
  }
1214
1214
  }
1215
1215
  ]
1216
- }).setLink({ href: a }).focus().run();
1216
+ }).setLink({ href: i }).focus().run();
1217
1217
  },
1218
1218
  id: "linkk",
1219
1219
  isActive: () => t.isActive("link") || !1,
@@ -1229,21 +1229,21 @@ const No = jt.extend({
1229
1229
  new te({
1230
1230
  props: {
1231
1231
  handleClick: (e, t) => {
1232
- const { schema: n, doc: i, tr: a } = e.state, o = Dt(i.resolve(t), n.marks.link);
1232
+ const { schema: n, doc: a, tr: i } = e.state, o = Mt(a.resolve(t), n.marks.link);
1233
1233
  if (!o)
1234
1234
  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);
1235
+ const r = a.resolve(o.from), l = a.resolve(o.to), u = i.setSelection(new Xe(r, l));
1236
+ e.dispatch(u);
1237
1237
  }
1238
1238
  }
1239
1239
  })
1240
1240
  ];
1241
1241
  }
1242
- }), Ao = Ot.extend({
1242
+ }), so = Pt.extend({
1243
1243
  renderHTML() {
1244
1244
  return [
1245
1245
  "div",
1246
- pe(this.options.HTMLAttributes, {
1246
+ be(this.options.HTMLAttributes, {
1247
1247
  "data-type": this.name
1248
1248
  }),
1249
1249
  ["hr"]
@@ -1254,7 +1254,7 @@ const No = jt.extend({
1254
1254
  return {
1255
1255
  ...(e = this.parent) == null ? void 0 : e.call(this),
1256
1256
  button: ({ editor: t, t: n }) => ({
1257
- component: x,
1257
+ component: p,
1258
1258
  componentProps: {
1259
1259
  action: () => t.commands.setHorizontalRule(),
1260
1260
  disabled: !t.can().setHorizontalRule(),
@@ -1271,75 +1271,75 @@ const No = jt.extend({
1271
1271
  };
1272
1272
  }
1273
1273
  });
1274
- function Ai(e) {
1274
+ function fa(e) {
1275
1275
  var d;
1276
1276
  const {
1277
1277
  icon: t = void 0,
1278
1278
  // title = undefined,
1279
1279
  tooltip: n = void 0,
1280
1280
  // disabled = false,
1281
- customClass: i = "",
1281
+ customClass: a = "",
1282
1282
  // color = undefined,
1283
1283
  // loading = false,
1284
1284
  // shortcutKeys = undefined,
1285
- tooltipOptions: a = {},
1285
+ tooltipOptions: i = {},
1286
1286
  action: o = void 0,
1287
- isActive: s = void 0,
1288
- children: c
1289
- } = e, h = Be[t];
1290
- return /* @__PURE__ */ m(ke, { children: [
1291
- /* @__PURE__ */ r(ve, { asChild: !0, children: /* @__PURE__ */ m(
1292
- $e,
1287
+ isActive: r = void 0,
1288
+ children: l
1289
+ } = e, u = Pe[t];
1290
+ return /* @__PURE__ */ m(we, { children: [
1291
+ /* @__PURE__ */ s(ye, { asChild: !0, children: /* @__PURE__ */ m(
1292
+ Be,
1293
1293
  {
1294
1294
  size: "sm",
1295
- className: `richtext-w-[32px] richtext-h-[32px] ${i}`,
1296
- disabled: s == null ? void 0 : s(),
1295
+ className: `w-[32px] h-[32px] ${a}`,
1296
+ disabled: r == null ? void 0 : r(),
1297
1297
  onClick: o,
1298
1298
  children: [
1299
- h && /* @__PURE__ */ r(h, { className: "richtext-w-4 richtext-h-4" }),
1300
- c && /* @__PURE__ */ r(ye, { children: c })
1299
+ u && /* @__PURE__ */ s(u, { className: "w-4 h-4" }),
1300
+ l && /* @__PURE__ */ s(pe, { children: l })
1301
1301
  ]
1302
1302
  }
1303
1303
  ) }),
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) })
1304
+ n && /* @__PURE__ */ s(ke, { ...i, children: /* @__PURE__ */ m("div", { className: "flex flex-col items-center text-center max-w-24", children: [
1305
+ /* @__PURE__ */ s("div", { children: n }),
1306
+ !!((d = e == null ? void 0 : e.shortcutKeys) != null && d.length) && /* @__PURE__ */ s("span", { children: Re(e == null ? void 0 : e.shortcutKeys) })
1307
1307
  ] }) })
1308
1308
  ] });
1309
1309
  }
1310
- const Ti = ["undo", "redo"], To = $t.extend({
1310
+ const ga = ["undo", "redo"], ro = Rt.extend({
1311
1311
  addOptions() {
1312
1312
  var e;
1313
1313
  return {
1314
1314
  ...(e = this.parent) == null ? void 0 : e.call(this),
1315
1315
  depth: 100,
1316
1316
  newGroupDelay: 500,
1317
- button: ({ editor: t, t: n }) => Ti.map((i) => ({
1318
- component: Ai,
1317
+ button: ({ editor: t, t: n }) => ga.map((a) => ({
1318
+ component: fa,
1319
1319
  componentProps: {
1320
1320
  action: () => {
1321
- i === "undo" && t.chain().focus().undo().run(), i === "redo" && t.chain().focus().redo().run();
1321
+ a === "undo" && t.chain().focus().undo().run(), a === "redo" && t.chain().focus().redo().run();
1322
1322
  },
1323
- shortcutKeys: i === "undo" ? ["mod", "Z"] : ["shift", "mod", "Z"],
1324
- disabled: i === "undo" ? !t.can().undo() : !t.can().redo(),
1325
- isActive: () => i === "undo" ? !t.can().undo() : !t.can().redo(),
1326
- icon: i === "undo" ? "Undo2" : "Redo2",
1327
- tooltip: n(`editor.${i}.tooltip`)
1323
+ shortcutKeys: a === "undo" ? ["mod", "Z"] : ["shift", "mod", "Z"],
1324
+ disabled: a === "undo" ? !t.can().undo() : !t.can().redo(),
1325
+ isActive: () => a === "undo" ? !t.can().undo() : !t.can().redo(),
1326
+ icon: a === "undo" ? "Undo2" : "Redo2",
1327
+ tooltip: n(`editor.${a}.tooltip`)
1328
1328
  }
1329
1329
  }))
1330
1330
  };
1331
1331
  }
1332
- }), Li = Ft.extend({
1332
+ }), ba = It.extend({
1333
1333
  content: "(block|columns)+"
1334
1334
  // echo editor is a block editor
1335
- }), Lo = N.create({
1335
+ }), lo = A.create({
1336
1336
  name: "columnActionButton",
1337
1337
  addOptions() {
1338
1338
  var e;
1339
1339
  return {
1340
1340
  ...(e = this.parent) == null ? void 0 : e.call(this),
1341
1341
  button: ({ editor: t, t: n }) => ({
1342
- component: x,
1342
+ component: p,
1343
1343
  componentProps: {
1344
1344
  action: () => {
1345
1345
  t.chain().focus().insertColumns({ cols: 2 }).run();
@@ -1350,7 +1350,7 @@ const Ti = ["undo", "redo"], To = $t.extend({
1350
1350
  })
1351
1351
  };
1352
1352
  }
1353
- }), Si = N.create({
1353
+ }), pa = A.create({
1354
1354
  name: "selection",
1355
1355
  addProseMirrorPlugins() {
1356
1356
  const { editor: e } = this;
@@ -1359,8 +1359,8 @@ const Ti = ["undo", "redo"], To = $t.extend({
1359
1359
  key: new Z("selection"),
1360
1360
  props: {
1361
1361
  decorations(t) {
1362
- return t.selection.empty || e.isFocused === !0 ? null : de.create(t.doc, [
1363
- he.inline(t.selection.from, t.selection.to, {
1362
+ return t.selection.empty || e.isFocused === !0 ? null : re.create(t.doc, [
1363
+ le.inline(t.selection.from, t.selection.to, {
1364
1364
  class: "selection"
1365
1365
  })
1366
1366
  ]);
@@ -1370,8 +1370,8 @@ const Ti = ["undo", "redo"], To = $t.extend({
1370
1370
  ];
1371
1371
  }
1372
1372
  });
1373
- function Ei(e) {
1374
- const { t } = B(), n = P(() => [
1373
+ function wa(e) {
1374
+ const { t } = j(), n = R(() => [
1375
1375
  {
1376
1376
  name: "paragraph",
1377
1377
  label: t("editor.paragraph.tooltip"),
@@ -1435,45 +1435,45 @@ function Ei(e) {
1435
1435
  iconName: "Code2",
1436
1436
  action: () => e.editor.chain().focus().clearNodes().toggleCodeBlock().run()
1437
1437
  }
1438
- ], [e.editor, t]), i = P(() => n.findLast((a) => a.isActive()) ?? {
1438
+ ], [e.editor, t]), a = R(() => n.findLast((i) => i.isActive()) ?? {
1439
1439
  label: "Empty"
1440
1440
  }, [n]);
1441
- return /* @__PURE__ */ m(Q, { children: [
1442
- /* @__PURE__ */ r(Y, { asChild: !0, children: /* @__PURE__ */ m(
1441
+ return /* @__PURE__ */ m(Y, { children: [
1442
+ /* @__PURE__ */ s(Q, { asChild: !0, children: /* @__PURE__ */ m(
1443
1443
  V,
1444
1444
  {
1445
- className: "richtext-flex richtext-h-[32px] richtext-gap-1 richtext-px-1.5",
1445
+ className: "flex h-[32px] gap-1 px-1.5",
1446
1446
  variant: "ghost",
1447
1447
  children: [
1448
- /* @__PURE__ */ m("span", { className: "richtext-whitespace-nowrap richtext-text-sm richtext-font-normal", children: [
1448
+ /* @__PURE__ */ m("span", { className: "whitespace-nowrap text-sm font-normal", children: [
1449
1449
  " ",
1450
- i == null ? void 0 : i.label
1450
+ a == null ? void 0 : a.label
1451
1451
  ] }),
1452
- /* @__PURE__ */ r(Ie, { className: "richtext-size-4" })
1452
+ /* @__PURE__ */ s(Me, { className: "size-4" })
1453
1453
  ]
1454
1454
  }
1455
1455
  ) }),
1456
- /* @__PURE__ */ r(
1456
+ /* @__PURE__ */ s(
1457
1457
  X,
1458
1458
  {
1459
1459
  align: "start",
1460
- className: "richtext-w-full richtext-p-1",
1460
+ className: "w-full p-1",
1461
1461
  hideWhenDetached: !0,
1462
1462
  sideOffset: 5,
1463
- children: n.map((a, o) => {
1464
- var c;
1465
- const s = Be[a.iconName];
1466
- return /* @__PURE__ */ r(
1463
+ children: n.map((i, o) => {
1464
+ var l;
1465
+ const r = Pe[i.iconName];
1466
+ return /* @__PURE__ */ s(
1467
1467
  ne,
1468
1468
  {
1469
- checked: ((c = a.isActive) == null ? void 0 : c.call(a)) || !1,
1470
- className: "richtext-cursor-pointer",
1471
- onClick: () => a.action(),
1472
- 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" }),
1469
+ checked: ((l = i.isActive) == null ? void 0 : l.call(i)) || !1,
1470
+ className: "cursor-pointer",
1471
+ onClick: () => i.action(),
1472
+ children: /* @__PURE__ */ m("div", { className: "flex items-center gap-2 px-2", children: [
1473
+ /* @__PURE__ */ s(r, { className: "h3 w-3" }),
1474
1474
  /* @__PURE__ */ m("span", { children: [
1475
1475
  " ",
1476
- a.label
1476
+ i.label
1477
1477
  ] })
1478
1478
  ] })
1479
1479
  },
@@ -1484,7 +1484,7 @@ function Ei(e) {
1484
1484
  )
1485
1485
  ] });
1486
1486
  }
1487
- const Hi = N.create({
1487
+ const ya = A.create({
1488
1488
  name: "text-bubble",
1489
1489
  addOptions() {
1490
1490
  var e;
@@ -1492,16 +1492,16 @@ const Hi = N.create({
1492
1492
  ...(e = this.parent) == null ? void 0 : e.call(this),
1493
1493
  toolbar: !1,
1494
1494
  button: () => ({
1495
- component: Ei,
1495
+ component: wa,
1496
1496
  componentProps: {}
1497
1497
  })
1498
1498
  };
1499
1499
  }
1500
1500
  });
1501
- function Je({ types: e, node: t }) {
1501
+ function We({ types: e, node: t }) {
1502
1502
  return Array.isArray(e) && e.includes(t.type) || t.type === e;
1503
1503
  }
1504
- const Mi = N.create({
1504
+ const ka = A.create({
1505
1505
  name: "trailingNode",
1506
1506
  addOptions() {
1507
1507
  return {
@@ -1514,163 +1514,163 @@ const Mi = N.create({
1514
1514
  return [
1515
1515
  new te({
1516
1516
  key: e,
1517
- 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)
1520
- return s.insert(d, l.create());
1517
+ appendTransaction: (n, a, i) => {
1518
+ const { doc: o, tr: r, schema: l } = i, u = e.getState(i), d = o.content.size, c = l.nodes[this.options.node];
1519
+ if (u)
1520
+ return r.insert(d, c.create());
1521
1521
  },
1522
1522
  state: {
1523
- init: (n, i) => {
1524
- const a = i.tr.doc.lastChild;
1525
- return !Je({ node: a, types: t });
1523
+ init: (n, a) => {
1524
+ const i = a.tr.doc.lastChild;
1525
+ return !We({ node: i, types: t });
1526
1526
  },
1527
- apply: (n, i) => {
1527
+ apply: (n, a) => {
1528
1528
  if (!n.docChanged)
1529
- return i;
1530
- const a = n.doc.lastChild;
1531
- return !Je({ node: a, types: t });
1529
+ return a;
1530
+ const i = n.doc.lastChild;
1531
+ return !We({ node: i, types: t });
1532
1532
  }
1533
1533
  }
1534
1534
  })
1535
1535
  ];
1536
1536
  }
1537
- }), So = N.create({
1537
+ }), co = A.create({
1538
1538
  name: "base-kit",
1539
1539
  addExtensions() {
1540
1540
  const e = [];
1541
- return this.options.document !== !1 && e.push(Li.configure()), this.options.placeholder !== !1 && e.push(
1542
- Ut.configure({
1543
- 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");
1541
+ return this.options.document !== !1 && e.push(ba.configure()), this.options.placeholder !== !1 && e.push(
1542
+ jt.configure({
1543
+ placeholder: ({ node: t, pos: n, editor: a }) => {
1544
+ var i, o, r, l, u;
1545
+ return ((i = t == null ? void 0 : t.type) == null ? void 0 : i.name) === "columns" || ((o = t == null ? void 0 : t.content) == null ? void 0 : o.size) !== 0 ? "" : ((r = t == null ? void 0 : t.type) == null ? void 0 : r.name) === "heading" ? `${N.t(`editor.heading.h${t.attrs.level}.tooltip`)}` : ((l = t == null ? void 0 : t.type) == null ? void 0 : l.name) === "codeBlock" || ((u = t == null ? void 0 : t.type) == null ? void 0 : u.name) === "table" ? "" : a.extensionManager.extensions.some((d) => d.name === "slashCommand") ? N.t("editor.slash") : n === 0 ? N.t("editor.content") : N.t("editor.content");
1546
1546
  },
1547
1547
  ...this.options.placeholder
1548
1548
  })
1549
1549
  ), this.options.focus !== !1 && e.push(
1550
- qt.configure({
1550
+ Bt.configure({
1551
1551
  className: "focus",
1552
1552
  ...this.options.focus
1553
1553
  })
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({
1554
+ ), this.options.text !== !1 && e.push(Dt.configure()), this.options.textBubble !== !1 && e.push(ya.configure()), this.options.gapcursor !== !1 && e.push(Ot.configure()), this.options.dropcursor !== !1 && e.push(
1555
+ $t.configure({
1556
1556
  ...this.options.dropcursor,
1557
1557
  width: 2,
1558
1558
  class: "ProseMirror-dropcursor border-black"
1559
1559
  })
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;
1560
+ ), this.options.characterCount !== !1 && e.push(Ft.configure(this.options.characterCount)), this.options.paragraph !== !1 && e.push(Ut.configure(this.options.paragraph)), this.options.hardBreak !== !1 && e.push(qt.configure(this.options.hardBreak)), this.options.listItem !== !1 && e.push(Kt.configure(this.options.listItem)), this.options.textStyle !== !1 && e.push(Vt.configure(this.options.textStyle)), this.options.trailingNode !== !1 && e.push(ka.configure(this.options.trailingNode)), this.options.selection !== !1 && e.push(pa), this.options.multiColumn !== !1 && e.push(pn, wn), e;
1561
1561
  }
1562
- }), Eo = N.create({
1562
+ }), uo = A.create({
1563
1563
  name: "subAndSuperScript",
1564
1564
  addOptions() {
1565
1565
  var e;
1566
1566
  return {
1567
1567
  ...(e = this.parent) == null ? void 0 : e.call(this),
1568
- button: ({ editor: t, extension: n, t: i }) => {
1569
- const a = n.options.subscript, o = n.options.superscript, s = {
1570
- component: x,
1568
+ button: ({ editor: t, extension: n, t: a }) => {
1569
+ const i = n.options.subscript, o = n.options.superscript, r = {
1570
+ component: p,
1571
1571
  componentProps: {
1572
1572
  action: () => t.commands.toggleSubscript(),
1573
1573
  isActive: () => t.isActive("subscript") || !1,
1574
1574
  disabled: !t.can().toggleSubscript(),
1575
1575
  icon: "Subscript",
1576
- tooltip: i("editor.subscript.tooltip")
1576
+ tooltip: a("editor.subscript.tooltip")
1577
1577
  }
1578
- }, c = {
1579
- component: x,
1578
+ }, l = {
1579
+ component: p,
1580
1580
  componentProps: {
1581
1581
  action: () => t.commands.toggleSuperscript(),
1582
1582
  isActive: () => t.isActive("superscript") || !1,
1583
1583
  disabled: !t.can().toggleSuperscript(),
1584
1584
  icon: "Superscript",
1585
- tooltip: i("editor.superscript.tooltip")
1585
+ tooltip: a("editor.superscript.tooltip")
1586
1586
  }
1587
- }, h = [];
1588
- return a !== !1 && h.push(s), o !== !1 && h.push(c), h;
1587
+ }, u = [];
1588
+ return i !== !1 && u.push(r), o !== !1 && u.push(l), u;
1589
1589
  }
1590
1590
  };
1591
1591
  },
1592
1592
  addExtensions() {
1593
1593
  const e = [];
1594
- return this.options.subscript !== !1 && e.push(nt.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(it.configure(this.options.superscript)), e;
1594
+ return this.options.subscript !== !1 && e.push(Je.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(Ye.configure(this.options.superscript)), e;
1595
1595
  }
1596
1596
  });
1597
- function zi(e) {
1597
+ function va(e) {
1598
1598
  var n;
1599
- const t = P(() => {
1599
+ const t = R(() => {
1600
1600
  var o;
1601
- const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
1602
- return i && !i.default ? {
1603
- ...i,
1604
- icon: i != null && i.icon ? i == null ? void 0 : i.icon : e == null ? void 0 : e.icon
1601
+ const a = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((r) => r.isActive());
1602
+ return a && !a.default ? {
1603
+ ...a,
1604
+ icon: a != null && a.icon ? a == null ? void 0 : a.icon : e == null ? void 0 : e.icon
1605
1605
  } : {
1606
1606
  title: e.tooltip,
1607
1607
  icon: e.icon,
1608
1608
  isActive: () => !1
1609
1609
  };
1610
1610
  }, [e]);
1611
- return /* @__PURE__ */ m(Q, { children: [
1612
- /* @__PURE__ */ r(
1613
- Y,
1611
+ return /* @__PURE__ */ m(Y, { children: [
1612
+ /* @__PURE__ */ s(
1613
+ Q,
1614
1614
  {
1615
1615
  asChild: !0,
1616
1616
  disabled: e == null ? void 0 : e.disabled,
1617
- children: /* @__PURE__ */ r(
1618
- x,
1617
+ children: /* @__PURE__ */ s(
1618
+ p,
1619
1619
  {
1620
- customClass: "!richtext-w-12 richtext-h-12",
1620
+ customClass: "!w-12 h-12",
1621
1621
  disabled: e == null ? void 0 : e.disabled,
1622
1622
  icon: e == null ? void 0 : e.icon,
1623
1623
  tooltip: e == null ? void 0 : e.tooltip,
1624
- children: /* @__PURE__ */ r(Hn, { className: "richtext-size-3 richtext-text-gray-500" })
1624
+ children: /* @__PURE__ */ s(yn, { className: "size-3 text-gray-500" })
1625
1625
  }
1626
1626
  )
1627
1627
  }
1628
1628
  ),
1629
- /* @__PURE__ */ r(X, { className: "w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => /* @__PURE__ */ m(
1629
+ /* @__PURE__ */ s(X, { className: "w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((a, i) => /* @__PURE__ */ m(
1630
1630
  ne,
1631
1631
  {
1632
- checked: t.title === i.title,
1633
- className: "richtext-flex richtext-items-center richtext-gap-3",
1634
- onClick: i.action,
1632
+ checked: t.title === a.title,
1633
+ className: "flex items-center gap-3",
1634
+ onClick: a.action,
1635
1635
  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) })
1636
+ /* @__PURE__ */ s(M, { name: a == null ? void 0 : a.icon }),
1637
+ /* @__PURE__ */ s("span", { className: "ml-1", children: a.title }),
1638
+ !!(a != null && a.shortcutKeys) && /* @__PURE__ */ s("span", { className: "ml-auto text-xs tracking-widest opacity-60", children: Re(a.shortcutKeys) })
1639
1639
  ]
1640
1640
  },
1641
- `more-mark-${a}`
1641
+ `more-mark-${i}`
1642
1642
  )) })
1643
1643
  ] });
1644
1644
  }
1645
- const Ho = N.create({
1645
+ const mo = A.create({
1646
1646
  name: "moreMark",
1647
1647
  addOptions() {
1648
1648
  var e;
1649
1649
  return {
1650
1650
  ...(e = this.parent) == null ? void 0 : e.call(this),
1651
- button({ editor: t, extension: n, t: i }) {
1652
- const a = n.options.subscript, o = n.options.superscript, s = {
1651
+ button({ editor: t, extension: n, t: a }) {
1652
+ const i = n.options.subscript, o = n.options.superscript, r = {
1653
1653
  action: () => t.commands.toggleSubscript(),
1654
1654
  isActive: () => t.isActive("subscript") || !1,
1655
1655
  disabled: !t.can().toggleSubscript(),
1656
1656
  icon: "Subscript",
1657
- title: i("editor.subscript.tooltip"),
1657
+ title: a("editor.subscript.tooltip"),
1658
1658
  shortcutKeys: ["mod", "."]
1659
- }, c = {
1659
+ }, l = {
1660
1660
  action: () => t.commands.toggleSuperscript(),
1661
1661
  isActive: () => t.isActive("superscript") || !1,
1662
1662
  disabled: !t.can().toggleSuperscript(),
1663
1663
  icon: "Superscript",
1664
- title: i("editor.superscript.tooltip"),
1664
+ title: a("editor.superscript.tooltip"),
1665
1665
  shortcutKeys: ["mod", ","]
1666
- }, h = [];
1667
- return a !== !1 && h.push(s), o !== !1 && h.push(c), {
1668
- component: zi,
1666
+ }, u = [];
1667
+ return i !== !1 && u.push(r), o !== !1 && u.push(l), {
1668
+ component: va,
1669
1669
  componentProps: {
1670
1670
  icon: "Type",
1671
- tooltip: i("editor.moremark"),
1671
+ tooltip: a("editor.moremark"),
1672
1672
  disabled: !t.isEditable,
1673
- items: h
1673
+ items: u
1674
1674
  }
1675
1675
  };
1676
1676
  }
@@ -1678,21 +1678,21 @@ const Ho = N.create({
1678
1678
  },
1679
1679
  addExtensions() {
1680
1680
  const e = [];
1681
- return this.options.subscript !== !1 && e.push(nt.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(it.configure(this.options.superscript)), e;
1681
+ return this.options.subscript !== !1 && e.push(Je.configure(this.options.subscript)), this.options.superscript !== !1 && e.push(Ye.configure(this.options.superscript)), e;
1682
1682
  }
1683
- }), Mo = N.create({
1683
+ }), ho = A.create({
1684
1684
  name: "indent",
1685
1685
  addOptions() {
1686
1686
  var e;
1687
1687
  return {
1688
1688
  ...(e = this.parent) == null ? void 0 : e.call(this),
1689
1689
  types: ["paragraph", "heading", "blockquote"],
1690
- minIndent: me.min,
1691
- maxIndent: me.max,
1690
+ minIndent: he.min,
1691
+ maxIndent: he.max,
1692
1692
  button({ editor: t, t: n }) {
1693
1693
  return [
1694
1694
  {
1695
- component: x,
1695
+ component: p,
1696
1696
  componentProps: {
1697
1697
  action: () => {
1698
1698
  t.commands.indent();
@@ -1703,7 +1703,7 @@ const Ho = N.create({
1703
1703
  }
1704
1704
  },
1705
1705
  {
1706
- component: x,
1706
+ component: p,
1707
1707
  componentProps: {
1708
1708
  action: () => {
1709
1709
  t.commands.outdent();
@@ -1736,12 +1736,12 @@ const Ho = N.create({
1736
1736
  },
1737
1737
  addCommands() {
1738
1738
  return {
1739
- indent: () => Ke({
1740
- delta: me.more,
1739
+ indent: () => Fe({
1740
+ delta: he.more,
1741
1741
  types: this.options.types
1742
1742
  }),
1743
- outdent: () => Ke({
1744
- delta: me.less,
1743
+ outdent: () => Fe({
1744
+ delta: he.less,
1745
1745
  types: this.options.types
1746
1746
  })
1747
1747
  };
@@ -1753,43 +1753,43 @@ const Ho = N.create({
1753
1753
  };
1754
1754
  }
1755
1755
  });
1756
- function Ri(e) {
1756
+ function xa(e) {
1757
1757
  return Number.parseFloat(e.replace("%", "")) / 100;
1758
1758
  }
1759
- function Pi(e) {
1760
- const { t } = B(), [n, i] = v("default");
1761
- function a(s) {
1762
- s === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(s), i(s);
1759
+ function Ca(e) {
1760
+ const { t } = j(), [n, a] = C("default");
1761
+ function i(r) {
1762
+ r === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(r), a(r);
1763
1763
  }
1764
- const o = P(() => {
1765
- const h = e.editor.extensionManager.extensions.find(
1764
+ const o = R(() => {
1765
+ const u = e.editor.extensionManager.extensions.find(
1766
1766
  (d) => d.name === "lineHeight"
1767
1767
  ).options.lineHeights.map((d) => ({
1768
- label: Ri(d),
1768
+ label: xa(d),
1769
1769
  value: d
1770
1770
  }));
1771
- return h.unshift({
1771
+ return u.unshift({
1772
1772
  label: t("editor.default"),
1773
1773
  value: "default"
1774
- }), h;
1774
+ }), u;
1775
1775
  }, [e]);
1776
- return /* @__PURE__ */ m(Q, { children: [
1777
- /* @__PURE__ */ r(
1778
- Y,
1776
+ return /* @__PURE__ */ m(Y, { children: [
1777
+ /* @__PURE__ */ s(
1778
+ Q,
1779
1779
  {
1780
1780
  asChild: !0,
1781
1781
  disabled: e == null ? void 0 : e.disabled,
1782
- children: /* @__PURE__ */ r(
1783
- x,
1782
+ children: /* @__PURE__ */ s(
1783
+ p,
1784
1784
  {
1785
- customClass: "!richtext-w-12 richtext-h-12",
1785
+ customClass: "!w-12 h-12",
1786
1786
  disabled: e == null ? void 0 : e.disabled,
1787
1787
  icon: "LineHeight",
1788
1788
  tooltip: e == null ? void 0 : e.tooltip,
1789
- children: /* @__PURE__ */ r(
1790
- z,
1789
+ children: /* @__PURE__ */ s(
1790
+ M,
1791
1791
  {
1792
- className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
1792
+ className: "ml-1 size-3 text-zinc-500",
1793
1793
  name: "MenuDown"
1794
1794
  }
1795
1795
  )
@@ -1797,61 +1797,61 @@ function Pi(e) {
1797
1797
  )
1798
1798
  }
1799
1799
  ),
1800
- /* @__PURE__ */ r(X, { className: "richtext-min-w-24", children: o == null ? void 0 : o.map((s, c) => /* @__PURE__ */ r(
1800
+ /* @__PURE__ */ s(X, { className: "min-w-24", children: o == null ? void 0 : o.map((r, l) => /* @__PURE__ */ s(
1801
1801
  ne,
1802
1802
  {
1803
- checked: s.value === n,
1804
- onClick: () => a(s.value),
1805
- children: s.label
1803
+ checked: r.value === n,
1804
+ onClick: () => i(r.value),
1805
+ children: r.label
1806
1806
  },
1807
- `lineHeight-${c}`
1807
+ `lineHeight-${l}`
1808
1808
  )) })
1809
1809
  ] });
1810
1810
  }
1811
- const Ii = ["paragraph", "heading", "list_item", "todo_item"];
1812
- function Bi(e, t) {
1813
- const { selection: n, doc: i } = e;
1814
- if (!n || !i || !(n instanceof ot || n instanceof rn))
1811
+ const Na = ["paragraph", "heading", "list_item", "todo_item"];
1812
+ function Aa(e, t) {
1813
+ const { selection: n, doc: a } = e;
1814
+ if (!n || !a || !(n instanceof Xe || n instanceof Zt))
1815
1815
  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,
1816
+ const { from: i, to: o } = n, r = [], l = t && t !== at ? t : null;
1817
+ if (a.nodesBetween(i, o, (u, d) => {
1818
+ const c = u.type;
1819
+ return Na.includes(c.name) ? ((u.attrs.lineHeight || null) !== l && r.push({
1820
+ node: u,
1821
1821
  pos: d,
1822
- nodeType: l
1823
- }), l.name !== "list_item" && l.name !== "todo_item") : !0;
1824
- }), s.length === 0)
1822
+ nodeType: c
1823
+ }), c.name !== "list_item" && c.name !== "todo_item") : !0;
1824
+ }), r.length === 0)
1825
1825
  return e;
1826
- for (const h of s) {
1827
- const { node: d, pos: l, nodeType: u } = h;
1828
- let { attrs: f } = d;
1829
- f = {
1830
- ...f,
1831
- lineHeight: c
1832
- }, e = e.setNodeMarkup(l, u, f, d.marks);
1826
+ for (const u of r) {
1827
+ const { node: d, pos: c, nodeType: h } = u;
1828
+ let { attrs: _ } = d;
1829
+ _ = {
1830
+ ..._,
1831
+ lineHeight: l
1832
+ }, e = e.setNodeMarkup(c, h, _, d.marks);
1833
1833
  }
1834
1834
  return e;
1835
1835
  }
1836
- function ji(e) {
1836
+ function La(e) {
1837
1837
  return ({ state: t, dispatch: n }) => {
1838
- const { selection: i } = t;
1839
- let { tr: a } = t;
1840
- return a = a.setSelection(i), a = Bi(a, e), a.docChanged ? (n && n(a), !0) : !1;
1838
+ const { selection: a } = t;
1839
+ let { tr: i } = t;
1840
+ return i = i.setSelection(a), i = Aa(i, e), i.docChanged ? (n && n(i), !0) : !1;
1841
1841
  };
1842
1842
  }
1843
- const zo = N.create({
1843
+ const _o = A.create({
1844
1844
  name: "lineHeight",
1845
1845
  addOptions() {
1846
1846
  var e;
1847
1847
  return {
1848
1848
  ...(e = this.parent) == null ? void 0 : e.call(this),
1849
1849
  types: ["paragraph", "heading", "list_item", "todo_item"],
1850
- lineHeights: Vn,
1851
- defaultHeight: lt,
1850
+ lineHeights: Rn,
1851
+ defaultHeight: at,
1852
1852
  button({ editor: t, t: n }) {
1853
1853
  return {
1854
- component: Pi,
1854
+ component: Ca,
1855
1855
  componentProps: {
1856
1856
  editor: t,
1857
1857
  tooltip: n("editor.lineheight.tooltip")
@@ -1876,226 +1876,226 @@ const zo = N.create({
1876
1876
  },
1877
1877
  addCommands() {
1878
1878
  return {
1879
- setLineHeight: (e) => ji(e),
1879
+ setLineHeight: (e) => La(e),
1880
1880
  unsetLineHeight: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "lineHeight"))
1881
1881
  };
1882
1882
  }
1883
1883
  });
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, () => ({
1884
+ function Sa(e, t) {
1885
+ var L, E;
1886
+ const [n, a] = C(0), [i, o] = C(0), r = G(null), { t: l } = j(), u = G([]);
1887
+ ze(t, () => ({
1888
1888
  onKeyDown: d
1889
- })), M(() => {
1890
- if (!s.current)
1889
+ })), z(() => {
1890
+ if (!r.current)
1891
1891
  return;
1892
- const g = a * 1e3 + n, b = h.current[g];
1892
+ const g = i * 1e3 + n, b = u.current[g];
1893
1893
  b && b.scrollIntoView({
1894
1894
  behavior: "smooth",
1895
1895
  block: "nearest"
1896
1896
  });
1897
- }, [n, a]);
1897
+ }, [n, i]);
1898
1898
  function d({ event: g }) {
1899
- return g.key === "ArrowUp" ? (l(), !0) : g.key === "ArrowDown" ? (u(), !0) : g.key === "Enter" ? (f(), !0) : !1;
1899
+ return g.key === "ArrowUp" ? (c(), !0) : g.key === "ArrowDown" ? (h(), !0) : g.key === "Enter" ? (_(), !0) : !1;
1900
1900
  }
1901
- function l() {
1902
- var k;
1901
+ function c() {
1902
+ var v;
1903
1903
  if (e.items.length === 0)
1904
1904
  return !1;
1905
- 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);
1905
+ let g = n - 1, b = i;
1906
+ g < 0 && (b = i - 1, g = ((v = e.items[b]) == null ? void 0 : v.commands.length) - 1 || 0), b < 0 && (b = e.items.length - 1, g = e.items[b].commands.length - 1), a(g), o(b);
1907
1907
  }
1908
- function u() {
1908
+ function h() {
1909
1909
  if (e.items.length === 0)
1910
1910
  return !1;
1911
- 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);
1911
+ const g = e.items[i].commands;
1912
+ let b = n + 1, v = i;
1913
+ g.length - 1 < b && (b = 0, v = i + 1), e.items.length - 1 < v && (v = 0), a(b), o(v);
1914
1914
  }
1915
- function f() {
1916
- if (e.items.length === 0 || a === -1 || n === -1)
1915
+ function _() {
1916
+ if (e.items.length === 0 || i === -1 || n === -1)
1917
1917
  return !1;
1918
- _(a, n);
1918
+ f(i, n);
1919
1919
  }
1920
- function _(g, b) {
1921
- const k = e.items[g].commands[b];
1922
- e.command(k);
1920
+ function f(g, b) {
1921
+ const v = e.items[g].commands[b];
1922
+ e.command(v);
1923
1923
  }
1924
1924
  function w(g, b) {
1925
- _(g, b);
1925
+ f(g, b);
1926
1926
  }
1927
- function p(g, b, k) {
1928
- h.current[g * 1e3 + b] = k;
1927
+ function y(g, b, v) {
1928
+ u.current[g * 1e3 + b] = v;
1929
1929
  }
1930
- return /* @__PURE__ */ r(
1930
+ return /* @__PURE__ */ s(
1931
1931
  "div",
1932
1932
  {
1933
- 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
- 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(
1933
+ className: "mb-8 max-h-[min(80vh,24rem)] flex-wrap overflow-auto rounded-lg !border !border-neutral-200 !bg-white p-1 !text-black shadow-sm dark:!border-neutral-800 dark:!bg-black",
1934
+ ref: r,
1935
+ children: (L = e == null ? void 0 : e.items) != null && L.length ? /* @__PURE__ */ s("div", { className: "grid min-w-48 grid-cols-1 gap-0.5", children: (E = e == null ? void 0 : e.items) == null ? void 0 : E.map((g, b) => /* @__PURE__ */ m(Ee, { children: [
1936
+ /* @__PURE__ */ s("div", { className: "col-[1/-1] mx-2 mt-2 select-none text-[0.65rem] font-semibold uppercase tracking-wider !text-neutral-500 first:mt-0.5", children: g.title }),
1937
+ g.commands.map((v, H) => /* @__PURE__ */ m(
1938
1938
  "button",
1939
1939
  {
1940
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
1941
+ ref: (S) => y(b, H, S),
1942
+ className: T("flex items-center gap-3 px-2 py-1.5 text-sm !text-neutral-800 dark:!text-neutral-200 text-left w-full rounded-sm outline-none transition-colors !bg-transparent hover:!bg-accent ", {
1943
+ "slash-command-active": i === b && n === H
1944
1944
  }),
1945
1945
  children: [
1946
- k.iconUrl && /* @__PURE__ */ r(
1946
+ v.iconUrl && /* @__PURE__ */ s(
1947
1947
  "img",
1948
1948
  {
1949
1949
  alt: "",
1950
- className: "richtext-size-6",
1951
- src: k.iconUrl
1950
+ className: "size-6",
1951
+ src: v.iconUrl
1952
1952
  }
1953
1953
  ),
1954
- k.iconName && /* @__PURE__ */ r(
1955
- z,
1954
+ v.iconName && /* @__PURE__ */ s(
1955
+ M,
1956
1956
  {
1957
- className: "!richtext-mr-1 !richtext-text-lg",
1958
- name: k.iconName
1957
+ className: "!mr-1 !text-lg",
1958
+ name: v.iconName
1959
1959
  }
1960
1960
  ),
1961
- k.label
1961
+ v.label
1962
1962
  ]
1963
1963
  },
1964
1964
  `command-${H}`
1965
1965
  ))
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") }) })
1966
+ ] }, `slash-${g.title}`)) }) : /* @__PURE__ */ s("div", { className: "p-3", children: /* @__PURE__ */ s("span", { className: "text-xs text-gray-800 dark:text-gray-100", children: l("editor.slash.empty") }) })
1967
1967
  }
1968
1968
  );
1969
1969
  }
1970
- const Oi = Re(Di), $i = {
1970
+ const Ta = He(Sa), Ea = {
1971
1971
  setOpen: (e, t) => {
1972
1972
  K(D.UPLOAD_VIDEO(e), t);
1973
1973
  }
1974
1974
  };
1975
- function Fi(e, t) {
1975
+ function Ha(e, t) {
1976
1976
  const n = [
1977
1977
  {
1978
1978
  name: "format",
1979
- title: A.t("editor.slash.format"),
1979
+ title: N.t("editor.slash.format"),
1980
1980
  commands: []
1981
1981
  },
1982
1982
  {
1983
1983
  name: "insert",
1984
- title: A.t("editor.slash.insert"),
1984
+ title: N.t("editor.slash.insert"),
1985
1985
  commands: []
1986
1986
  }
1987
1987
  ];
1988
- return e.forEach((i) => {
1989
- i.name.toLowerCase() === "heading" && i.options.levels.forEach((a) => {
1988
+ return e.forEach((a) => {
1989
+ a.name.toLowerCase() === "heading" && a.options.levels.forEach((i) => {
1990
1990
  n[0].commands.push({
1991
- name: `heading${a}`,
1992
- label: A.t(`editor.heading.h${a}.tooltip`),
1993
- aliases: [`h${a}`, "bt", `bt${a}`],
1994
- iconName: `Heading${a}`,
1995
- action: ({ editor: o, range: s }) => {
1996
- o.chain().focus().deleteRange(s).setHeading({ level: a }).run();
1991
+ name: `heading${i}`,
1992
+ label: N.t(`editor.heading.h${i}.tooltip`),
1993
+ aliases: [`h${i}`, "bt", `bt${i}`],
1994
+ iconName: `Heading${i}`,
1995
+ action: ({ editor: o, range: r }) => {
1996
+ o.chain().focus().deleteRange(r).setHeading({ level: i }).run();
1997
1997
  }
1998
1998
  });
1999
- }), i.name.toLowerCase() === "bulletlist" && n[0].commands.push({
1999
+ }), a.name.toLowerCase() === "bulletlist" && n[0].commands.push({
2000
2000
  name: "bulletList",
2001
- label: A.t("editor.bulletlist.tooltip"),
2001
+ label: N.t("editor.bulletlist.tooltip"),
2002
2002
  aliases: ["ul", "yxlb"],
2003
2003
  iconName: "List",
2004
- action: ({ editor: a, range: o }) => {
2005
- a.chain().focus().deleteRange(o).toggleBulletList().run();
2004
+ action: ({ editor: i, range: o }) => {
2005
+ i.chain().focus().deleteRange(o).toggleBulletList().run();
2006
2006
  }
2007
- }), i.name.toLowerCase() === "orderedlist" && n[0].commands.push({
2007
+ }), a.name.toLowerCase() === "orderedlist" && n[0].commands.push({
2008
2008
  name: "numberedList",
2009
- label: A.t("editor.orderedlist.tooltip"),
2009
+ label: N.t("editor.orderedlist.tooltip"),
2010
2010
  aliases: ["ol", "yxlb"],
2011
2011
  iconName: "ListOrdered",
2012
- action: ({ editor: a, range: o }) => {
2013
- a.chain().focus().deleteRange(o).toggleOrderedList().run();
2012
+ action: ({ editor: i, range: o }) => {
2013
+ i.chain().focus().deleteRange(o).toggleOrderedList().run();
2014
2014
  }
2015
- }), i.name.toLowerCase() === "tasklist" && n[0].commands.push({
2015
+ }), a.name.toLowerCase() === "tasklist" && n[0].commands.push({
2016
2016
  name: "taskList",
2017
- label: A.t("editor.tasklist.tooltip"),
2017
+ label: N.t("editor.tasklist.tooltip"),
2018
2018
  iconName: "ListTodo",
2019
2019
  description: "Task list with todo items",
2020
2020
  aliases: ["todo"],
2021
- action: ({ editor: a, range: o }) => {
2022
- a.chain().focus().deleteRange(o).toggleTaskList().run();
2021
+ action: ({ editor: i, range: o }) => {
2022
+ i.chain().focus().deleteRange(o).toggleTaskList().run();
2023
2023
  }
2024
- }), i.name.toLowerCase() === "blockquote" && n[0].commands.push({
2024
+ }), a.name.toLowerCase() === "blockquote" && n[0].commands.push({
2025
2025
  name: "blockquote",
2026
- label: A.t("editor.blockquote.tooltip"),
2026
+ label: N.t("editor.blockquote.tooltip"),
2027
2027
  description: "插入引入格式",
2028
2028
  aliases: ["yr"],
2029
2029
  iconName: "TextQuote",
2030
- action: ({ editor: a, range: o }) => {
2031
- a.chain().focus().deleteRange(o).setBlockquote().run();
2030
+ action: ({ editor: i, range: o }) => {
2031
+ i.chain().focus().deleteRange(o).setBlockquote().run();
2032
2032
  }
2033
- }), i.name.toLowerCase() === "codeblock" && n[0].commands.push({
2033
+ }), a.name.toLowerCase() === "codeblock" && n[0].commands.push({
2034
2034
  name: "codeBlock",
2035
- label: A.t("editor.codeblock.tooltip"),
2035
+ label: N.t("editor.codeblock.tooltip"),
2036
2036
  iconName: "Code2",
2037
2037
  description: "Code block with syntax highlighting",
2038
- shouldBeHidden: (a) => a.isActive("columns"),
2039
- action: ({ editor: a, range: o }) => {
2040
- a.chain().focus().deleteRange(o).setCodeBlock().run();
2038
+ shouldBeHidden: (i) => i.isActive("columns"),
2039
+ action: ({ editor: i, range: o }) => {
2040
+ i.chain().focus().deleteRange(o).setCodeBlock().run();
2041
2041
  }
2042
- }), i.name.toLowerCase() === Mn.name && n[1].commands.push({
2042
+ }), a.name.toLowerCase() === kn.name && n[1].commands.push({
2043
2043
  name: "image",
2044
- label: A.t("editor.image.tooltip"),
2044
+ label: N.t("editor.image.tooltip"),
2045
2045
  iconName: "ImageUp",
2046
2046
  description: "Insert a image",
2047
2047
  aliases: ["image", "tp", "tupian"],
2048
- shouldBeHidden: (a) => a.isActive("columns"),
2049
- action: ({ editor: a, range: o }) => {
2050
- a.chain().focus().deleteRange(o).run(), zn.setOpen(a.id, !0);
2048
+ shouldBeHidden: (i) => i.isActive("columns"),
2049
+ action: ({ editor: i, range: o }) => {
2050
+ i.chain().focus().deleteRange(o).run(), vn.setOpen(i.id, !0);
2051
2051
  }
2052
- }), i.name.toLowerCase() === Rn.name && n[1].commands.push({
2052
+ }), a.name.toLowerCase() === xn.name && n[1].commands.push({
2053
2053
  name: "video",
2054
- label: A.t("editor.video.tooltip"),
2054
+ label: N.t("editor.video.tooltip"),
2055
2055
  iconName: "Video",
2056
2056
  description: "Insert a video",
2057
2057
  aliases: ["video", "sp", "shipin"],
2058
- shouldBeHidden: (a) => a.isActive("columns"),
2059
- action: ({ editor: a, range: o }) => {
2060
- a.chain().focus().deleteRange(o).run(), $i.setOpen(a.id, !0);
2058
+ shouldBeHidden: (i) => i.isActive("columns"),
2059
+ action: ({ editor: i, range: o }) => {
2060
+ i.chain().focus().deleteRange(o).run(), Ea.setOpen(i.id, !0);
2061
2061
  }
2062
- }), i.name.toLowerCase() === "table" && n[1].commands.push({
2062
+ }), a.name.toLowerCase() === "table" && n[1].commands.push({
2063
2063
  name: "table",
2064
- label: A.t("editor.table.tooltip"),
2064
+ label: N.t("editor.table.tooltip"),
2065
2065
  iconName: "Table",
2066
2066
  description: "Insert a table",
2067
2067
  aliases: ["table", "bg", "biaoge", "biao"],
2068
- 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();
2068
+ shouldBeHidden: (i) => i.isActive("columns"),
2069
+ action: ({ editor: i, range: o }) => {
2070
+ i.chain().focus().deleteRange(o).insertTable({ rows: 3, cols: 3, withHeaderRow: !1 }).run();
2071
2071
  }
2072
- }), i.name.toLowerCase() === "horizontalrule" && n[1].commands.push({
2072
+ }), a.name.toLowerCase() === "horizontalrule" && n[1].commands.push({
2073
2073
  name: "horizontalRule",
2074
- label: A.t("editor.horizontalrule.tooltip"),
2074
+ label: N.t("editor.horizontalrule.tooltip"),
2075
2075
  iconName: "Minus",
2076
2076
  description: "Insert a horizontal divider",
2077
2077
  aliases: ["hr", "fgx", "fg"],
2078
- action: ({ editor: a, range: o }) => {
2079
- a.chain().focus().deleteRange(o).setHorizontalRule().run();
2078
+ action: ({ editor: i, range: o }) => {
2079
+ i.chain().focus().deleteRange(o).setHorizontalRule().run();
2080
2080
  }
2081
- }), i.name.toLowerCase() === "columns" && n[1].commands.push({
2081
+ }), a.name.toLowerCase() === "columns" && n[1].commands.push({
2082
2082
  name: "columns",
2083
- label: A.t("editor.columns.tooltip"),
2083
+ label: N.t("editor.columns.tooltip"),
2084
2084
  iconName: "Columns2",
2085
2085
  description: "Add two column content",
2086
- action: ({ editor: a }) => {
2087
- a.chain().focus().insertColumns({ cols: 2 }).run();
2086
+ action: ({ editor: i }) => {
2087
+ i.chain().focus().insertColumns({ cols: 2 }).run();
2088
2088
  }
2089
- }), t == null || t(i, n);
2089
+ }), t == null || t(a, n);
2090
2090
  }), n;
2091
2091
  }
2092
2092
  const q = "slashCommand";
2093
- let y;
2094
- const Ro = N.create({
2093
+ let k;
2094
+ const fo = A.create({
2095
2095
  name: q,
2096
2096
  priority: 200,
2097
2097
  onCreate() {
2098
- y = Fe("body", {
2098
+ k = De("body", {
2099
2099
  interactive: !0,
2100
2100
  trigger: "manual",
2101
2101
  placement: "bottom-start",
@@ -2115,39 +2115,39 @@ const Ro = N.create({
2115
2115
  },
2116
2116
  addProseMirrorPlugins() {
2117
2117
  return [
2118
- at({
2118
+ Qe({
2119
2119
  editor: this.editor,
2120
2120
  char: "/",
2121
2121
  allowSpaces: !0,
2122
2122
  startOfLine: !0,
2123
2123
  pluginKey: new Z(q),
2124
2124
  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(
2127
- 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;
2125
+ var d, c, h;
2126
+ const n = e.doc.resolve(t.from), a = n.depth === 1, i = n.parent.type.name === "paragraph", o = ((d = n.parent.textContent) == null ? void 0 : d.charAt(0)) === "/", r = this.editor.isActive("column"), l = (h = n.parent.textContent) == null ? void 0 : h.slice(
2127
+ Math.max(0, (c = n.parent.textContent) == null ? void 0 : c.indexOf("/"))
2128
+ ), u = !(l != null && l.endsWith(" "));
2129
+ return (a && i && o || r && i && o) && u;
2130
2130
  },
2131
2131
  command: ({ editor: e, range: t, props: n }) => {
2132
- const { view: i } = e;
2133
- n.action({ editor: e, range: t }), i.focus();
2132
+ const { view: a } = e;
2133
+ n.action({ editor: e, range: t }), a.focus();
2134
2134
  },
2135
- items: ({ query: e, editor: t }) => Fi(t.extensionManager.extensions, this.options.renderGroupItem).map((s) => ({
2136
- ...s,
2137
- commands: s.commands.filter((c) => {
2138
- const h = c.label.toLowerCase().trim(), d = e.toLowerCase().trim();
2139
- if (c.aliases) {
2140
- const l = c.aliases.map((_) => _.toLowerCase().trim()), u = h.match(d), f = l.some((_) => _.match(d));
2141
- return u || f;
2135
+ items: ({ query: e, editor: t }) => Ha(t.extensionManager.extensions, this.options.renderGroupItem).map((r) => ({
2136
+ ...r,
2137
+ commands: r.commands.filter((l) => {
2138
+ const u = l.label.toLowerCase().trim(), d = e.toLowerCase().trim();
2139
+ if (l.aliases) {
2140
+ const c = l.aliases.map((f) => f.toLowerCase().trim()), h = u.match(d), _ = c.some((f) => f.match(d));
2141
+ return h || _;
2142
2142
  }
2143
- return h.match(d);
2143
+ return u.match(d);
2144
2144
  }).filter(
2145
- (c) => c.shouldBeHidden ? !c.shouldBeHidden(this.editor) : !0
2145
+ (l) => l.shouldBeHidden ? !l.shouldBeHidden(this.editor) : !0
2146
2146
  )
2147
- })).filter((s) => s.commands.length > 0).map((s) => ({
2148
- ...s,
2149
- commands: s.commands.map((c) => ({
2150
- ...c,
2147
+ })).filter((r) => r.commands.length > 0).map((r) => ({
2148
+ ...r,
2149
+ commands: r.commands.map((l) => ({
2150
+ ...l,
2151
2151
  isEnabled: !0
2152
2152
  }))
2153
2153
  })),
@@ -2156,66 +2156,66 @@ const Ro = N.create({
2156
2156
  return {
2157
2157
  onStart: (n) => {
2158
2158
  var o;
2159
- e = new Me(Oi, {
2159
+ e = new Te(Ta, {
2160
2160
  props: n,
2161
2161
  editor: n.editor
2162
2162
  });
2163
- const { view: i } = n.editor, a = () => {
2163
+ const { view: a } = n.editor, i = () => {
2164
2164
  if (!n.clientRect)
2165
2165
  return n.editor.storage[q].rect;
2166
- const s = n.clientRect();
2167
- if (!s)
2166
+ const r = n.clientRect();
2167
+ if (!r)
2168
2168
  return n.editor.storage[q].rect;
2169
- let c = s.y;
2170
- 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;
2169
+ let l = r.y;
2170
+ if (r.top + e.element.offsetHeight + 40 > window.innerHeight) {
2171
+ const u = r.top + e.element.offsetHeight - window.innerHeight + 40;
2172
+ l = r.y - u;
2173
2173
  }
2174
- return new DOMRect(s.x, c, s.width, s.height);
2174
+ return new DOMRect(r.x, l, r.width, r.height);
2175
2175
  };
2176
2176
  t = () => {
2177
- y == null || y[0].setProps({
2178
- getReferenceClientRect: a
2177
+ k == null || k[0].setProps({
2178
+ getReferenceClientRect: i
2179
2179
  });
2180
- }, (o = i.dom.parentElement) == null || o.addEventListener("scroll", t), y == null || y[0].setProps({
2181
- getReferenceClientRect: a,
2180
+ }, (o = a.dom.parentElement) == null || o.addEventListener("scroll", t), k == null || k[0].setProps({
2181
+ getReferenceClientRect: i,
2182
2182
  appendTo: () => document.body,
2183
2183
  content: e.element
2184
- }), y == null || y[0].show();
2184
+ }), k == null || k[0].show();
2185
2185
  },
2186
2186
  onUpdate(n) {
2187
- var s;
2187
+ var r;
2188
2188
  e.updateProps(n);
2189
- const { view: i } = n.editor, a = () => {
2189
+ const { view: a } = n.editor, i = () => {
2190
2190
  if (!n.clientRect)
2191
2191
  return n.editor.storage[q].rect;
2192
- const c = n.clientRect();
2193
- return c ? new DOMRect(c.x, c.y, c.width, c.height) : n.editor.storage[q].rect;
2192
+ const l = n.clientRect();
2193
+ return l ? new DOMRect(l.x, l.y, l.width, l.height) : n.editor.storage[q].rect;
2194
2194
  }, o = () => {
2195
- y == null || y[0].setProps({
2196
- getReferenceClientRect: a
2195
+ k == null || k[0].setProps({
2196
+ getReferenceClientRect: i
2197
2197
  });
2198
2198
  };
2199
- (s = i.dom.parentElement) == null || s.addEventListener("scroll", o), n.editor.storage[q].rect = n.clientRect ? a() : {
2199
+ (r = a.dom.parentElement) == null || r.addEventListener("scroll", o), n.editor.storage[q].rect = n.clientRect ? i() : {
2200
2200
  width: 0,
2201
2201
  height: 0,
2202
2202
  left: 0,
2203
2203
  top: 0,
2204
2204
  right: 0,
2205
2205
  bottom: 0
2206
- }, y == null || y[0].setProps({
2207
- getReferenceClientRect: a
2206
+ }, k == null || k[0].setProps({
2207
+ getReferenceClientRect: i
2208
2208
  });
2209
2209
  },
2210
2210
  onKeyDown(n) {
2211
- 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));
2211
+ var a;
2212
+ return n.event.key === "Escape" ? (k == null || k[0].hide(), !0) : (k != null && k[0].state.isShown || k == null || k[0].show(), (a = e.ref) == null ? void 0 : a.onKeyDown(n));
2213
2213
  },
2214
2214
  onExit(n) {
2215
- var i;
2216
- if (y == null || y[0].hide(), t) {
2217
- const { view: a } = n.editor;
2218
- (i = a.dom.parentElement) == null || i.removeEventListener("scroll", t);
2215
+ var a;
2216
+ if (k == null || k[0].hide(), t) {
2217
+ const { view: i } = n.editor;
2218
+ (a = i.dom.parentElement) == null || a.removeEventListener("scroll", t);
2219
2219
  }
2220
2220
  e.destroy();
2221
2221
  }
@@ -2236,190 +2236,14 @@ const Ro = N.create({
2236
2236
  }
2237
2237
  };
2238
2238
  }
2239
- });
2240
- function Ui(e, t, n) {
2241
- if (!e.doc)
2242
- return e;
2243
- const i = e.doc.nodeAt(t);
2244
- if (!i || n === i.attrs.backgroundColor)
2245
- return e;
2246
- const a = {
2247
- ...i.attrs,
2248
- backgroundColor: n
2249
- };
2250
- return e.setNodeMarkup(t, i.type, a, i.marks);
2251
- }
2252
- function qi(e, t, n) {
2253
- const { doc: i, selection: a } = e;
2254
- return !i || !a || !(a instanceof sn) || a.forEachCell((o, s) => {
2255
- e = Ui(e, s, n);
2256
- }), e;
2257
- }
2258
- function Qe(e, t) {
2259
- 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;
2262
- };
2263
- }
2264
- const Ki = N.create({
2265
- name: "tableCellBackground",
2266
- addOptions() {
2267
- return {
2268
- types: ["tableCell"],
2269
- HTMLAttributes: {}
2270
- };
2271
- },
2272
- addGlobalAttributes() {
2273
- return [
2274
- {
2275
- types: this.options.types,
2276
- attributes: {
2277
- backgroundColor: {
2278
- parseHTML: (e) => e.style.backgroundColor || "",
2279
- renderHTML: (e) => !e.backgroundColor || e.backgroundColor === "" ? {} : {
2280
- style: `background-color: ${e.backgroundColor}`
2281
- }
2282
- }
2283
- }
2284
- }
2285
- ];
2286
- },
2287
- addCommands() {
2288
- return {
2289
- setTableCellBackground: (e) => Qe(e, this.options),
2290
- unsetTableCellBackground: () => Qe("", this.options)
2291
- };
2292
- }
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 = {}) {
2295
- 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"));
2297
- }
2298
- const Xe = (e) => Array.from({ length: e }).map((t, n) => n + 1);
2299
- function Zi(e) {
2300
- 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
2307
- });
2308
- function c(u, f) {
2309
- u === i.rows && a((_) => ({
2310
- ..._,
2311
- rows: Math.min(u + 1, fe)
2312
- })), f === i.cols && a((_) => ({
2313
- ..._,
2314
- cols: Math.min(f + 1, fe)
2315
- })), s({
2316
- rows: u,
2317
- cols: f
2318
- });
2319
- }
2320
- function h(u, f) {
2321
- e == null || e.createTable({ rows: u, cols: f, withHeaderRow: t }), d();
2322
- }
2323
- function d() {
2324
- n(!1), a({
2325
- rows: _e,
2326
- cols: _e
2327
- }), s({
2328
- rows: ge,
2329
- cols: ge
2330
- });
2331
- }
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,
2336
- {
2337
- align: "start",
2338
- className: "richtext-w-full !richtext-p-2",
2339
- side: "bottom",
2340
- 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) => {
2342
- var f;
2343
- return /* @__PURE__ */ r(
2344
- "div",
2345
- {
2346
- className: "richtext-flex richtext-gap-1",
2347
- children: (f = Xe(i == null ? void 0 : i.cols)) == null ? void 0 : f.map((_) => /* @__PURE__ */ r(
2348
- "div",
2349
- {
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" })
2354
- },
2355
- `c-${_}`
2356
- ))
2357
- },
2358
- `r-${u}`
2359
- );
2360
- }) }),
2361
- /* @__PURE__ */ m("div", { className: "richtext-mt-2 richtext-text-center richtext-text-sm richtext-text-zinc-600", children: [
2362
- o.rows,
2363
- " ",
2364
- "x",
2365
- o.cols
2366
- ] })
2367
- ] })
2368
- }
2369
- )
2370
- ] });
2371
- }
2372
- function Ji(e) {
2373
- function t(n) {
2374
- e.disabled || e.editor.chain().focus().insertTable({ ...n, withHeaderRow: !1 }).run();
2375
- }
2376
- return /* @__PURE__ */ r(Zi, { createTable: t, children: /* @__PURE__ */ r(
2377
- x,
2378
- {
2379
- icon: e == null ? void 0 : e.icon,
2380
- tooltip: e == null ? void 0 : e.tooltip,
2381
- disabled: e == null ? void 0 : e.disabled,
2382
- color: e == null ? void 0 : e.color,
2383
- action: e == null ? void 0 : e.action,
2384
- isActive: e == null ? void 0 : e.isActive
2385
- }
2386
- ) });
2387
- }
2388
- const Po = Xt.extend({
2389
- addOptions() {
2390
- var e;
2391
- return {
2392
- ...(e = this.parent) == null ? void 0 : e.call(this),
2393
- resizable: !0,
2394
- lastColumnResizable: !0,
2395
- allowTableNodeSelection: !1,
2396
- button: ({ editor: t, t: n }) => ({
2397
- component: Ji,
2398
- componentProps: {
2399
- disabled: t.isActive("table") || !1,
2400
- icon: "Table",
2401
- tooltip: n("editor.table.tooltip"),
2402
- editor: t
2403
- }
2404
- })
2405
- };
2406
- },
2407
- addExtensions() {
2408
- 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)
2413
- ];
2414
- }
2415
- }), Io = N.create({
2239
+ }), go = A.create({
2416
2240
  name: "painter",
2417
2241
  addOptions() {
2418
2242
  var e;
2419
2243
  return {
2420
2244
  ...(e = this.parent) == null ? void 0 : e.call(this),
2421
2245
  button: ({ editor: t, t: n }) => ({
2422
- component: x,
2246
+ component: p,
2423
2247
  componentProps: {
2424
2248
  action: () => {
2425
2249
  t.commands.setPainter(t == null ? void 0 : t.state.selection.$head.marks());
@@ -2436,11 +2260,11 @@ const Po = Xt.extend({
2436
2260
  view: {
2437
2261
  dispatch: t,
2438
2262
  state: { tr: n },
2439
- dom: i
2263
+ dom: a
2440
2264
  }
2441
2265
  }) => {
2442
- const s = `url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;
2443
- return i.style.cursor = s, t(n.setMeta("painterAction", { type: "start", marks: e })), !0;
2266
+ const r = `url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;
2267
+ return a.style.cursor = r, t(n.setMeta("painterAction", { type: "start", marks: e })), !0;
2444
2268
  }
2445
2269
  };
2446
2270
  },
@@ -2464,14 +2288,14 @@ const Po = Xt.extend({
2464
2288
  const n = () => {
2465
2289
  document.removeEventListener("mouseup", n);
2466
2290
  let {
2467
- dispatch: i,
2468
- state: { tr: a, selection: o },
2469
- dom: s
2291
+ dispatch: a,
2292
+ state: { tr: i, selection: o },
2293
+ dom: r
2470
2294
  } = e;
2471
- s.style.cursor = "", a = a.removeMark(o.from, o.to);
2472
- for (const c of t)
2473
- c.type.name !== "link" && (a = a.addMark(o.from, o.to, c));
2474
- i(a.setMeta("painterAction", { type: "end" }));
2295
+ r.style.cursor = "", i = i.removeMark(o.from, o.to);
2296
+ for (const l of t)
2297
+ l.type.name !== "link" && (i = i.addMark(o.from, o.to, l));
2298
+ a(i.setMeta("painterAction", { type: "end" }));
2475
2299
  };
2476
2300
  return document.addEventListener("mouseup", n), !0;
2477
2301
  }
@@ -2481,133 +2305,133 @@ const Po = Xt.extend({
2481
2305
  ];
2482
2306
  }
2483
2307
  });
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(() => {
2308
+ function za({ editor: e, ...t }) {
2309
+ const { t: n } = j(), [a, i] = C(-1), [o, r] = C([]), [l, u] = C(""), [d, c] = C(""), [h, _] = C(!1), [f, w] = C(!1);
2310
+ return z(() => {
2311
+ h || (u(""), c(""), i(-1), r([]), e.commands.setSearchTerm(""), e.commands.setReplaceTerm(""));
2312
+ }, [e, h]), z(() => {
2313
+ h && e && e.commands && e.commands.setSearchTerm && e.commands.setSearchTerm(l);
2314
+ }, [h, l, e]), z(() => {
2315
+ h && e && e.commands && e.commands.setReplaceTerm && e.commands.setReplaceTerm(d);
2316
+ }, [h, d, e]), z(() => {
2493
2317
  if (!e)
2494
2318
  return;
2495
- const p = e.extensionManager.extensions.find((E) => E.name === na.name);
2496
- if (!p)
2319
+ const y = e.extensionManager.extensions.find((E) => E.name === ja.name);
2320
+ if (!y)
2497
2321
  return;
2498
- const T = () => {
2499
- if (!u)
2322
+ const L = () => {
2323
+ if (!h)
2500
2324
  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);
2325
+ const E = y ? y.storage.currentIndex : -1, g = y ? y.storage.results : [];
2326
+ i((b) => b !== E ? E : b), r((b) => Jt(b, g) ? b : g);
2503
2327
  };
2504
- return Ve(D.SEARCH_REPLCE, T), () => {
2505
- p && Ve(D.SEARCH_REPLCE, T);
2328
+ return Ue(D.SEARCH_REPLCE, L), () => {
2329
+ y && Ue(D.SEARCH_REPLCE, L);
2506
2330
  };
2507
- }, [u, e]), /* @__PURE__ */ m(
2508
- ie,
2331
+ }, [h, e]), /* @__PURE__ */ m(
2332
+ ce,
2509
2333
  {
2510
- onOpenChange: f,
2511
- open: u,
2334
+ onOpenChange: _,
2335
+ open: h,
2512
2336
  children: [
2513
- /* @__PURE__ */ r(
2514
- ae,
2337
+ /* @__PURE__ */ s(
2338
+ de,
2515
2339
  {
2516
2340
  asChild: !0,
2517
2341
  disabled: t == null ? void 0 : t.disabled,
2518
- children: /* @__PURE__ */ r(
2519
- x,
2342
+ children: /* @__PURE__ */ s(
2343
+ p,
2520
2344
  {
2521
2345
  disabled: t == null ? void 0 : t.disabled,
2522
2346
  isActive: t == null ? void 0 : t.isActive,
2523
2347
  tooltip: t == null ? void 0 : t.tooltip,
2524
- children: /* @__PURE__ */ r(z, { name: t == null ? void 0 : t.icon })
2348
+ children: /* @__PURE__ */ s(M, { name: t == null ? void 0 : t.icon })
2525
2349
  }
2526
2350
  )
2527
2351
  }
2528
2352
  ),
2529
2353
  /* @__PURE__ */ m(
2530
- oe,
2354
+ ue,
2531
2355
  {
2532
2356
  align: "start",
2533
- className: "richtext-w-full",
2357
+ className: "w-full",
2534
2358
  hideWhenDetached: !0,
2535
2359
  side: "bottom",
2536
2360
  children: [
2537
- /* @__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" })
2361
+ /* @__PURE__ */ m("div", { className: "mb-[6px] flex items-center justify-between", children: [
2362
+ /* @__PURE__ */ s(ve, { children: n("editor.search.dialog.text") }),
2363
+ /* @__PURE__ */ s("span", { className: "font-semibold", children: o.length > 0 ? `${a + 1}/${o.length}` : "0/0" })
2540
2364
  ] }),
2541
- /* @__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(
2543
- We,
2365
+ /* @__PURE__ */ m("div", { className: "mb-[10px] flex w-full max-w-sm items-center gap-1.5", children: [
2366
+ /* @__PURE__ */ s(
2367
+ qe,
2544
2368
  {
2545
2369
  autoFocus: !0,
2546
- className: "richtext-w-full",
2547
- onChange: (p) => h(p.target.value),
2370
+ className: "w-full",
2371
+ onChange: (y) => u(y.target.value),
2548
2372
  placeholder: "Text",
2549
2373
  required: !0,
2550
2374
  type: "text",
2551
- value: c
2375
+ value: l
2552
2376
  }
2553
2377
  ),
2554
- /* @__PURE__ */ r(
2378
+ /* @__PURE__ */ s(
2555
2379
  V,
2556
2380
  {
2557
- className: "richtext-flex-1",
2381
+ className: "flex-1",
2558
2382
  disabled: o.length === 0,
2559
2383
  onClick: e.commands.goToPrevSearchResult,
2560
- children: /* @__PURE__ */ r(z, { name: "ChevronUp" })
2384
+ children: /* @__PURE__ */ s(M, { name: "ChevronUp" })
2561
2385
  }
2562
2386
  ),
2563
- /* @__PURE__ */ r(
2387
+ /* @__PURE__ */ s(
2564
2388
  V,
2565
2389
  {
2566
- className: "richtext-flex-1",
2390
+ className: "flex-1",
2567
2391
  disabled: o.length === 0,
2568
2392
  onClick: e.commands.goToNextSearchResult,
2569
- children: /* @__PURE__ */ r(z, { name: "ChevronDown" })
2393
+ children: /* @__PURE__ */ s(M, { name: "ChevronDown" })
2570
2394
  }
2571
2395
  )
2572
2396
  ] }),
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(
2575
- We,
2397
+ /* @__PURE__ */ s(ve, { className: "mb-[6px]", children: n("editor.replace.dialog.text") }),
2398
+ /* @__PURE__ */ s("div", { className: "mb-[5px] flex w-full max-w-sm items-center gap-1.5", children: /* @__PURE__ */ s("div", { className: "relative w-full max-w-sm items-center", children: /* @__PURE__ */ s(
2399
+ qe,
2576
2400
  {
2577
- className: "richtext-w-80",
2578
- onChange: (p) => l(p.target.value),
2401
+ className: "w-80",
2402
+ onChange: (y) => c(y.target.value),
2579
2403
  placeholder: "Text",
2580
2404
  required: !0,
2581
2405
  type: "text",
2582
2406
  value: d
2583
2407
  }
2584
2408
  ) }) }),
2585
- /* @__PURE__ */ m("div", { className: "richtext-mb-[10px] richtext-flex richtext-items-center richtext-space-x-2", children: [
2586
- /* @__PURE__ */ r(
2587
- Pn,
2409
+ /* @__PURE__ */ m("div", { className: "mb-[10px] flex items-center space-x-2", children: [
2410
+ /* @__PURE__ */ s(
2411
+ Cn,
2588
2412
  {
2589
- checked: _,
2590
- onCheckedChange: (p) => {
2591
- w(p), e.commands.setCaseSensitive(p);
2413
+ checked: f,
2414
+ onCheckedChange: (y) => {
2415
+ w(y), e.commands.setCaseSensitive(y);
2592
2416
  }
2593
2417
  }
2594
2418
  ),
2595
- /* @__PURE__ */ r(Ne, { children: n("editor.replace.caseSensitive") })
2419
+ /* @__PURE__ */ s(ve, { children: n("editor.replace.caseSensitive") })
2596
2420
  ] }),
2597
- /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
2598
- /* @__PURE__ */ r(
2421
+ /* @__PURE__ */ m("div", { className: "flex items-center gap-[10px]", children: [
2422
+ /* @__PURE__ */ s(
2599
2423
  V,
2600
2424
  {
2601
- className: "richtext-flex-1",
2425
+ className: "flex-1",
2602
2426
  disabled: o.length === 0,
2603
2427
  onClick: e.commands.replace,
2604
2428
  children: n("editor.replace.dialog.text")
2605
2429
  }
2606
2430
  ),
2607
- /* @__PURE__ */ r(
2431
+ /* @__PURE__ */ s(
2608
2432
  V,
2609
2433
  {
2610
- className: "richtext-flex-1",
2434
+ className: "flex-1",
2611
2435
  disabled: o.length === 0,
2612
2436
  onClick: e.commands.replaceAll,
2613
2437
  children: n("editor.replaceAll.dialog.text")
@@ -2621,88 +2445,88 @@ function Qi({ editor: e, ...t }) {
2621
2445
  }
2622
2446
  );
2623
2447
  }
2624
- const se = (e, t) => t(e.tr);
2625
- function Yi(e, t, n) {
2448
+ const ie = (e, t) => t(e.tr);
2449
+ function Ma(e, t, n) {
2626
2450
  return RegExp(t ? e.replace(/[$()*+./?[\\\]^{|}-]/g, String.raw`\$&`) : e, n ? "gu" : "gui");
2627
2451
  }
2628
- function Xi(e, t, n) {
2629
- const i = [];
2630
- let a = [];
2452
+ function Pa(e, t, n) {
2453
+ const a = [];
2454
+ let i = [];
2631
2455
  const o = [];
2632
- let s = 0;
2456
+ let r = 0;
2633
2457
  if (!t)
2634
2458
  return { decorationsToReturn: [], results: [] };
2635
- e == null || e.descendants((c, h) => {
2636
- c.isText ? a[s] ? a[s] = {
2637
- text: a[s].text + c.text,
2638
- pos: a[s].pos
2639
- } : a[s] = {
2640
- text: `${c.text}`,
2641
- pos: h
2642
- } : s += 1;
2643
- }), a = a.filter(Boolean);
2644
- for (const { text: c, pos: h } of a) {
2645
- const d = [...c.matchAll(t)];
2646
- for (const l of d) {
2647
- if (l[0] === "")
2459
+ e == null || e.descendants((l, u) => {
2460
+ l.isText ? i[r] ? i[r] = {
2461
+ text: i[r].text + l.text,
2462
+ pos: i[r].pos
2463
+ } : i[r] = {
2464
+ text: `${l.text}`,
2465
+ pos: u
2466
+ } : r += 1;
2467
+ }), i = i.filter(Boolean);
2468
+ for (const { text: l, pos: u } of i) {
2469
+ const d = [...l.matchAll(t)];
2470
+ for (const c of d) {
2471
+ if (c[0] === "")
2648
2472
  break;
2649
- l.index !== void 0 && o.push({
2650
- from: h + l.index,
2651
- to: h + l.index + l[0].length
2473
+ c.index !== void 0 && o.push({
2474
+ from: u + c.index,
2475
+ to: u + c.index + c[0].length
2652
2476
  });
2653
2477
  }
2654
2478
  }
2655
- for (const c of o)
2656
- i.push(he.inline(c.from, c.to, { class: n }));
2479
+ for (const l of o)
2480
+ a.push(le.inline(l.from, l.to, { class: n }));
2657
2481
  return {
2658
- decorationsToReturn: i,
2482
+ decorationsToReturn: a,
2659
2483
  results: o
2660
2484
  };
2661
2485
  }
2662
- function et(e, t, { state: n, dispatch: i }) {
2486
+ function Ge(e, t, { state: n, dispatch: a }) {
2663
2487
  if (!t[0])
2664
2488
  return;
2665
- const { from: o, to: s } = t[0];
2666
- i && i(n.tr.insertText(e, o, s));
2489
+ const { from: o, to: r } = t[0];
2490
+ a && a(n.tr.insertText(e, o, r));
2667
2491
  }
2668
- function ea(e, t, n, i) {
2669
- const a = t + 1;
2670
- if (!i[a])
2492
+ function Ra(e, t, n, a) {
2493
+ const i = t + 1;
2494
+ if (!a[i])
2671
2495
  return null;
2672
- const { from: o, to: s } = i[t], c = s - o - e.length + n, { from: h, to: d } = i[a];
2673
- return i[a] = {
2674
- to: d - c,
2675
- from: h - c
2676
- }, [c, i];
2496
+ const { from: o, to: r } = a[t], l = r - o - e.length + n, { from: u, to: d } = a[i];
2497
+ return a[i] = {
2498
+ to: d - l,
2499
+ from: u - l
2500
+ }, [l, a];
2677
2501
  }
2678
- function ta(e, t, { tr: n, dispatch: i }) {
2679
- let a = 0, o = t.slice();
2502
+ function Ia(e, t, { tr: n, dispatch: a }) {
2503
+ let i = 0, o = t.slice();
2680
2504
  if (o.length === 0)
2681
2505
  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]);
2506
+ for (let r = 0; r < o.length; r += 1) {
2507
+ const { from: l, to: u } = o[r];
2508
+ n.insertText(e, l, u);
2509
+ const d = Ra(e, r, i, o);
2510
+ d && (i = d[0], o = d[1]);
2687
2511
  }
2688
- return i(n), !0;
2512
+ return a(n), !0;
2689
2513
  }
2690
- function tt({ view: e, tr: t, searchResults: n, searchResultCurrentClass: i, gotoIndex: a }) {
2691
- const o = n[a];
2514
+ function Ze({ view: e, tr: t, searchResults: n, searchResultCurrentClass: a, gotoIndex: i }) {
2515
+ const o = n[i];
2692
2516
  if (o) {
2693
- const s = t.setMeta("directDecoration", {
2517
+ const r = t.setMeta("directDecoration", {
2694
2518
  fromPos: o.from,
2695
2519
  toPos: o.to,
2696
- attrs: { class: i }
2520
+ attrs: { class: a }
2697
2521
  });
2698
- return e == null || e.dispatch(s), setTimeout(() => {
2699
- const c = window.document.querySelector(`.${i}`);
2700
- c && Ue(c, { behavior: "smooth", scrollMode: "if-needed" });
2522
+ return e == null || e.dispatch(r), setTimeout(() => {
2523
+ const l = window.document.querySelector(`.${a}`);
2524
+ l && Oe(l, { behavior: "smooth", scrollMode: "if-needed" });
2701
2525
  }, 0), !0;
2702
2526
  }
2703
2527
  return !1;
2704
2528
  }
2705
- const na = N.create({
2529
+ const ja = A.create({
2706
2530
  name: "search",
2707
2531
  addOptions() {
2708
2532
  var e;
@@ -2719,7 +2543,7 @@ const na = N.create({
2719
2543
  onChange: () => {
2720
2544
  },
2721
2545
  button: ({ editor: t, t: n }) => ({
2722
- component: Qi,
2546
+ component: za,
2723
2547
  componentProps: {
2724
2548
  action: () => {
2725
2549
  },
@@ -2740,33 +2564,33 @@ const na = N.create({
2740
2564
  },
2741
2565
  addCommands() {
2742
2566
  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),
2567
+ setSearchTerm: (e) => ({ state: t, dispatch: n }) => (this.options.searchTerm = e, this.storage.results = [], this.storage.currentIndex = 0, K(D.SEARCH_REPLCE), ie(t, n), !1),
2568
+ setReplaceTerm: (e) => ({ state: t, dispatch: n }) => (this.options.replaceTerm = e, ie(t, n), !1),
2569
+ setCaseSensitive: (e) => ({ state: t, dispatch: n }) => (this.options.caseSensitive = e, ie(t, n), !1),
2746
2570
  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;
2571
+ const { replaceTerm: n } = this.options, { currentIndex: a, results: i } = this.storage, o = i[a];
2572
+ return o ? (Ge(n, [o], { state: e, dispatch: t }), this.storage.results.splice(a, 1)) : (Ge(n, i, { state: e, dispatch: t }), this.storage.results.shift()), K(D.SEARCH_REPLCE), ie(e, t), !1;
2749
2573
  },
2750
2574
  replaceAll: () => ({ state: e, tr: t, dispatch: n }) => {
2751
- 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;
2575
+ const { replaceTerm: a } = this.options, { results: i } = this.storage;
2576
+ return Ia(a, i, { tr: t, dispatch: n }), this.storage.currentIndex = -1, this.storage.results = [], K(D.SEARCH_REPLCE), ie(e, n), !1;
2753
2577
  },
2754
2578
  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({
2579
+ const { searchResultCurrentClass: n } = this.options, { currentIndex: a, results: i } = this.storage, o = (a + i.length - 1) % i.length;
2580
+ return this.storage.currentIndex = o, K(D.SEARCH_REPLCE), Ze({
2757
2581
  view: e,
2758
2582
  tr: t,
2759
- searchResults: a,
2583
+ searchResults: i,
2760
2584
  searchResultCurrentClass: n,
2761
2585
  gotoIndex: o
2762
2586
  });
2763
2587
  },
2764
2588
  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({
2589
+ const { searchResultCurrentClass: n } = this.options, { currentIndex: a, results: i } = this.storage, o = (a + 1) % i.length;
2590
+ return this.storage.currentIndex = o, this.options.onChange && this.options.onChange(), K(D.SEARCH_REPLCE), Ze({
2767
2591
  view: e,
2768
2592
  tr: t,
2769
- searchResults: a,
2593
+ searchResults: i,
2770
2594
  searchResultCurrentClass: n,
2771
2595
  gotoIndex: o
2772
2596
  });
@@ -2780,26 +2604,26 @@ const na = N.create({
2780
2604
  key: new Z("search"),
2781
2605
  state: {
2782
2606
  init() {
2783
- return de.empty;
2607
+ return re.empty;
2784
2608
  },
2785
2609
  apply(t) {
2786
- const { doc: n, docChanged: i } = t, { searchTerm: a, searchResultClass: o, searchResultCurrentClass: s, disableRegex: c, caseSensitive: h } = e.options;
2787
- if (i || a) {
2788
- const { decorationsToReturn: d, results: l } = Xi(
2610
+ const { doc: n, docChanged: a } = t, { searchTerm: i, searchResultClass: o, searchResultCurrentClass: r, disableRegex: l, caseSensitive: u } = e.options;
2611
+ if (a || i) {
2612
+ const { decorationsToReturn: d, results: c } = Pa(
2789
2613
  n,
2790
- Yi(a, c, h),
2614
+ Ma(i, l, u),
2791
2615
  o
2792
2616
  );
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, _));
2617
+ if (e.storage.results = c, e.storage.currentIndex > c.length - 1 && (e.storage.currentIndex = 0), K(D.SEARCH_REPLCE), t.getMeta("directDecoration")) {
2618
+ const { fromPos: h, toPos: _, attrs: f } = t.getMeta("directDecoration");
2619
+ d.push(le.inline(h, _, f));
2796
2620
  } else
2797
- l.length > 0 && (d[0] = he.inline(l[0].from, l[0].to, {
2798
- class: s
2621
+ c.length > 0 && (d[0] = le.inline(c[0].from, c[0].to, {
2622
+ class: r
2799
2623
  }));
2800
- return de.create(n, d);
2624
+ return re.create(n, d);
2801
2625
  }
2802
- return de.empty;
2626
+ return re.empty;
2803
2627
  }
2804
2628
  },
2805
2629
  props: {
@@ -2811,15 +2635,15 @@ const na = N.create({
2811
2635
  ];
2812
2636
  }
2813
2637
  });
2814
- function ia({
2638
+ function Ba({
2815
2639
  className: e,
2816
2640
  ...t
2817
2641
  }) {
2818
- return /* @__PURE__ */ r(
2642
+ return /* @__PURE__ */ s(
2819
2643
  W.Root,
2820
2644
  {
2821
- className: S(
2822
- "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",
2645
+ className: T(
2646
+ "bg-popover text-popover-foreground isolate flex h-full w-fit flex-col overflow-hidden rounded-md",
2823
2647
  e
2824
2648
  ),
2825
2649
  "data-slot": "emoji-picker",
@@ -2827,21 +2651,21 @@ function ia({
2827
2651
  }
2828
2652
  );
2829
2653
  }
2830
- function aa({
2654
+ function Da({
2831
2655
  className: e,
2832
2656
  ...t
2833
2657
  }) {
2834
2658
  return /* @__PURE__ */ m(
2835
2659
  "div",
2836
2660
  {
2837
- className: S("richtext-flex richtext-h-9 richtext-items-center richtext-gap-2 richtext-border-b richtext-px-3", e),
2661
+ className: T("flex h-9 items-center gap-2 border-b px-3", e),
2838
2662
  "data-slot": "emoji-picker-search-wrapper",
2839
2663
  children: [
2840
- /* @__PURE__ */ r(_n, { className: "richtext-size-4 richtext-shrink-0 richtext-opacity-50" }),
2841
- /* @__PURE__ */ r(
2664
+ /* @__PURE__ */ s(an, { className: "size-4 shrink-0 opacity-50" }),
2665
+ /* @__PURE__ */ s(
2842
2666
  W.Search,
2843
2667
  {
2844
- 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",
2668
+ className: "outline-hidden placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm disabled:cursor-not-allowed disabled:opacity-50",
2845
2669
  "data-slot": "emoji-picker-search",
2846
2670
  ...t
2847
2671
  }
@@ -2850,20 +2674,20 @@ function aa({
2850
2674
  }
2851
2675
  );
2852
2676
  }
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 });
2677
+ function Oa({ children: e, ...t }) {
2678
+ return /* @__PURE__ */ s("div", { ...t, className: "scroll-my-1 px-1", "data-slot": "emoji-picker-row", children: e });
2855
2679
  }
2856
- function ra({
2680
+ function $a({
2857
2681
  emoji: e,
2858
2682
  className: t,
2859
2683
  ...n
2860
2684
  }) {
2861
- return /* @__PURE__ */ r(
2685
+ return /* @__PURE__ */ s(
2862
2686
  "button",
2863
2687
  {
2864
2688
  ...n,
2865
- className: S(
2866
- "data-[active]:richtext-bg-accent richtext-flex richtext-size-7 richtext-items-center richtext-justify-center richtext-rounded-sm richtext-text-base",
2689
+ className: T(
2690
+ "data-[active]:bg-accent flex size-7 items-center justify-center rounded-sm text-base",
2867
2691
  t
2868
2692
  ),
2869
2693
  "data-slot": "emoji-picker-emoji",
@@ -2871,55 +2695,55 @@ function ra({
2871
2695
  }
2872
2696
  );
2873
2697
  }
2874
- function sa({
2698
+ function Fa({
2875
2699
  category: e,
2876
2700
  ...t
2877
2701
  }) {
2878
- return /* @__PURE__ */ r(
2702
+ return /* @__PURE__ */ s(
2879
2703
  "div",
2880
2704
  {
2881
2705
  ...t,
2882
- className: "richtext-bg-popover richtext-text-muted-foreground richtext-px-3 richtext-pb-2 richtext-pt-3.5 richtext-text-xs richtext-leading-none",
2706
+ className: "bg-popover text-muted-foreground px-3 pb-2 pt-3.5 text-xs leading-none",
2883
2707
  "data-slot": "emoji-picker-category-header",
2884
2708
  children: e.label
2885
2709
  }
2886
2710
  );
2887
2711
  }
2888
- function ca({
2712
+ function Ua({
2889
2713
  className: e,
2890
2714
  ...t
2891
2715
  }) {
2892
2716
  return /* @__PURE__ */ m(
2893
2717
  W.Viewport,
2894
2718
  {
2895
- className: S("richtext-outline-hidden richtext-relative richtext-flex-1", e),
2719
+ className: T("outline-hidden relative flex-1", e),
2896
2720
  "data-slot": "emoji-picker-viewport",
2897
2721
  ...t,
2898
2722
  children: [
2899
- /* @__PURE__ */ r(
2723
+ /* @__PURE__ */ s(
2900
2724
  W.Loading,
2901
2725
  {
2902
- className: "richtext-absolute richtext-inset-0 richtext-flex richtext-items-center richtext-justify-center richtext-text-muted-foreground",
2726
+ className: "absolute inset-0 flex items-center justify-center text-muted-foreground",
2903
2727
  "data-slot": "emoji-picker-loading",
2904
- children: /* @__PURE__ */ r(gn, { className: "richtext-size-4 richtext-animate-spin" })
2728
+ children: /* @__PURE__ */ s(on, { className: "size-4 animate-spin" })
2905
2729
  }
2906
2730
  ),
2907
- /* @__PURE__ */ r(
2731
+ /* @__PURE__ */ s(
2908
2732
  W.Empty,
2909
2733
  {
2910
- className: "richtext-absolute richtext-inset-0 richtext-flex richtext-items-center richtext-justify-center richtext-text-muted-foreground richtext-text-sm",
2734
+ className: "absolute inset-0 flex items-center justify-center text-muted-foreground text-sm",
2911
2735
  "data-slot": "emoji-picker-empty",
2912
2736
  children: "No emoji found."
2913
2737
  }
2914
2738
  ),
2915
- /* @__PURE__ */ r(
2739
+ /* @__PURE__ */ s(
2916
2740
  W.List,
2917
2741
  {
2918
- className: "richtext-select-none richtext-pb-1",
2742
+ className: "select-none pb-1",
2919
2743
  components: {
2920
- Row: oa,
2921
- Emoji: ra,
2922
- CategoryHeader: sa
2744
+ Row: Oa,
2745
+ Emoji: $a,
2746
+ CategoryHeader: Fa
2923
2747
  },
2924
2748
  "data-slot": "emoji-picker-list"
2925
2749
  }
@@ -2928,47 +2752,47 @@ function ca({
2928
2752
  }
2929
2753
  );
2930
2754
  }
2931
- function la({
2755
+ function qa({
2932
2756
  className: e,
2933
2757
  ...t
2934
2758
  }) {
2935
- return /* @__PURE__ */ r(
2759
+ return /* @__PURE__ */ s(
2936
2760
  "div",
2937
2761
  {
2938
- className: S(
2939
- "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",
2762
+ className: T(
2763
+ "max-w-(--frimousse-viewport-width) flex w-full min-w-0 items-center gap-1 border-t p-2",
2940
2764
  e
2941
2765
  ),
2942
2766
  "data-slot": "emoji-picker-footer",
2943
2767
  ...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…" }) })
2768
+ children: /* @__PURE__ */ s(W.ActiveEmoji, { children: ({ emoji: n }) => n ? /* @__PURE__ */ m(pe, { children: [
2769
+ /* @__PURE__ */ s("div", { className: "flex size-7 flex-none items-center justify-center text-lg", children: n.emoji }),
2770
+ /* @__PURE__ */ s("span", { className: "text-secondary-foreground truncate text-xs", children: n.label })
2771
+ ] }) : /* @__PURE__ */ s("span", { className: "text-muted-foreground ml-1.5 flex h-7 items-center truncate text-xs", children: "Select an emoji…" }) })
2948
2772
  }
2949
2773
  );
2950
2774
  }
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,
2775
+ function Ka({ onSelectEmoji: e, children: t }) {
2776
+ return /* @__PURE__ */ m(ce, { modal: !0, children: [
2777
+ /* @__PURE__ */ s(de, { asChild: !0, children: t }),
2778
+ /* @__PURE__ */ s(
2779
+ ue,
2956
2780
  {
2957
2781
  align: "start",
2958
- className: "richtext-size-full richtext-p-2",
2782
+ className: "size-full p-2",
2959
2783
  hideWhenDetached: !0,
2960
2784
  side: "bottom",
2961
2785
  children: /* @__PURE__ */ m(
2962
- ia,
2786
+ Ba,
2963
2787
  {
2964
- className: "!richtext-h-[342px]",
2788
+ className: "!h-[342px]",
2965
2789
  onEmojiSelect: ({ emoji: n }) => {
2966
2790
  e(n);
2967
2791
  },
2968
2792
  children: [
2969
- /* @__PURE__ */ r(aa, {}),
2970
- /* @__PURE__ */ r(ca, {}),
2971
- /* @__PURE__ */ r(la, {})
2793
+ /* @__PURE__ */ s(Da, {}),
2794
+ /* @__PURE__ */ s(Ua, {}),
2795
+ /* @__PURE__ */ s(qa, {})
2972
2796
  ]
2973
2797
  }
2974
2798
  )
@@ -2976,62 +2800,62 @@ function da({ onSelectEmoji: e, children: t }) {
2976
2800
  )
2977
2801
  ] });
2978
2802
  }
2979
- function ha({ editor: e, icon: t, ...n }) {
2980
- const i = F(
2981
- (a) => {
2982
- const { selection: o } = e.state, { $anchor: s } = o;
2983
- return e.chain().insertContentAt(s.pos, a).run();
2803
+ function Va({ editor: e, icon: t, ...n }) {
2804
+ const a = F(
2805
+ (i) => {
2806
+ const { selection: o } = e.state, { $anchor: r } = o;
2807
+ return e.chain().insertContentAt(r.pos, i).run();
2984
2808
  },
2985
2809
  [e]
2986
2810
  );
2987
- return /* @__PURE__ */ r(da, { onSelectEmoji: i, children: /* @__PURE__ */ r(
2988
- x,
2811
+ return /* @__PURE__ */ s(Ka, { onSelectEmoji: a, children: /* @__PURE__ */ s(
2812
+ p,
2989
2813
  {
2990
2814
  icon: t,
2991
2815
  tooltip: n == null ? void 0 : n.tooltip
2992
2816
  }
2993
2817
  ) });
2994
2818
  }
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);
2999
- }, c = () => {
3000
- a((i + e.items.length - 1) % e.items.length);
3001
- }, h = () => {
3002
- a((i + 1) % e.items.length);
2819
+ const mt = He((e, t) => {
2820
+ const n = G(null), [a, i] = C(0), { t: o } = j(), r = (c) => {
2821
+ const h = e.items[c];
2822
+ h && e.command(h);
2823
+ }, l = () => {
2824
+ i((a + e.items.length - 1) % e.items.length);
2825
+ }, u = () => {
2826
+ i((a + 1) % e.items.length);
3003
2827
  }, d = () => {
3004
- s(i);
2828
+ r(a);
3005
2829
  };
3006
- return M(() => a(0), [e.items]), M(() => {
3007
- if (Number.isNaN(i + 1))
2830
+ return z(() => i(0), [e.items]), z(() => {
2831
+ if (Number.isNaN(a + 1))
3008
2832
  return;
3009
- 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(
2833
+ const c = n.current.querySelector(`span:nth-of-type(${a + 1})`);
2834
+ c && Oe(c, { behavior: "smooth", scrollMode: "if-needed" });
2835
+ }, [a]), ze(t, () => ({
2836
+ onKeyDown: ({ event: c }) => c.key === "ArrowUp" ? (l(), !0) : c.key === "ArrowDown" ? (u(), !0) : c.key === "Enter" ? (d(), !0) : !1
2837
+ })), /* @__PURE__ */ s("div", { className: "max-h-[320px] w-[200px] overflow-y-auto overflow-x-hidden rounded-sm !border bg-popover p-1 text-popover-foreground shadow-md outline-none", children: /* @__PURE__ */ s("div", { ref: n, children: e.items.length > 0 ? e.items.map((c, h) => /* @__PURE__ */ m(
3014
2838
  "span",
3015
2839
  {
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),
2840
+ className: P(" relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent focus:bg-accent focus:text-accent-foreground", h === a ? "bg-accent" : ""),
2841
+ onClick: () => r(h),
3018
2842
  children: [
3019
- l.fallbackImage ? /* @__PURE__ */ r(
2843
+ c.fallbackImage ? /* @__PURE__ */ s(
3020
2844
  "img",
3021
2845
  {
3022
- className: "richtext-size-[1em]",
3023
- src: l.fallbackImage
2846
+ className: "size-[1em]",
2847
+ src: c.fallbackImage
3024
2848
  }
3025
- ) : l.emoji,
2849
+ ) : c.emoji,
3026
2850
  ":",
3027
- l.name,
2851
+ c.name,
3028
2852
  ":"
3029
2853
  ]
3030
2854
  },
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") }) }) }) });
2855
+ `emoji-list-code-${h}`
2856
+ )) : /* @__PURE__ */ s("div", { className: "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors", children: /* @__PURE__ */ s("span", { children: o("no_result_found") }) }) }) });
3033
2857
  });
3034
- xt.displayName = "EmojiList";
2858
+ mt.displayName = "EmojiList";
3035
2859
  const ee = {
3036
2860
  100: "💯",
3037
2861
  1234: "🔢",
@@ -4876,18 +4700,18 @@ Object.keys(ee).reduce((e, t) => {
4876
4700
  const n = ee[t];
4877
4701
  return e[n] = t, e;
4878
4702
  }, {});
4879
- const ua = Object.keys(ee).map((e) => e);
4703
+ const Wa = Object.keys(ee).map((e) => e);
4880
4704
  Object.keys(ee).map((e) => ee[e]);
4881
- function ma(e) {
4882
- return ua.filter((t) => t.startsWith(e)).map((t) => ({
4705
+ function Ga(e) {
4706
+ return Wa.filter((t) => t.startsWith(e)).map((t) => ({
4883
4707
  name: t,
4884
4708
  emoji: ee[t]
4885
4709
  }));
4886
4710
  }
4887
- const fa = 200, _a = new Z("emoji"), Bo = we.create({
4711
+ const Za = 200, Ja = new Z("emoji"), bo = ge.create({
4888
4712
  name: "emoji",
4889
4713
  content: "text*",
4890
- priority: fa,
4714
+ priority: Za,
4891
4715
  addOptions() {
4892
4716
  var e;
4893
4717
  return {
@@ -4895,13 +4719,13 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
4895
4719
  HTMLAttributes: {},
4896
4720
  suggestion: {
4897
4721
  char: ":",
4898
- pluginKey: _a,
4899
- command: ({ editor: t, range: n, props: i }) => {
4900
- t.chain().focus().insertContentAt(n, `${i.emoji} `).run();
4722
+ pluginKey: Ja,
4723
+ command: ({ editor: t, range: n, props: a }) => {
4724
+ t.chain().focus().insertContentAt(n, `${a.emoji} `).run();
4901
4725
  }
4902
4726
  },
4903
4727
  button: ({ editor: t, t: n }) => ({
4904
- component: ha,
4728
+ component: Va,
4905
4729
  componentProps: {
4906
4730
  editor: t,
4907
4731
  action: () => {
@@ -4921,7 +4745,7 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
4921
4745
  },
4922
4746
  addProseMirrorPlugins() {
4923
4747
  return [
4924
- at({
4748
+ Qe({
4925
4749
  editor: this.editor,
4926
4750
  ...this.options.suggestion
4927
4751
  })
@@ -4929,16 +4753,16 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
4929
4753
  }
4930
4754
  }).configure({
4931
4755
  suggestion: {
4932
- items: ({ query: e }) => ma(e),
4756
+ items: ({ query: e }) => Ga(e),
4933
4757
  render: () => {
4934
4758
  let e, t, n;
4935
4759
  return {
4936
- onStart: (i) => {
4937
- n = i.editor.isEditable, n && (e = new Me(xt, {
4938
- props: i,
4939
- editor: i.editor
4940
- }), t = Fe("body", {
4941
- getReferenceClientRect: i.clientRect,
4760
+ onStart: (a) => {
4761
+ n = a.editor.isEditable, n && (e = new Te(mt, {
4762
+ props: a,
4763
+ editor: a.editor
4764
+ }), t = De("body", {
4765
+ getReferenceClientRect: a.clientRect,
4942
4766
  appendTo: () => document.body,
4943
4767
  content: e.element,
4944
4768
  showOnCreate: !0,
@@ -4947,15 +4771,15 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
4947
4771
  placement: "bottom-start"
4948
4772
  }));
4949
4773
  },
4950
- onUpdate(i) {
4951
- n && (e.updateProps(i), t[0].setProps({
4952
- getReferenceClientRect: i.clientRect
4774
+ onUpdate(a) {
4775
+ n && (e.updateProps(a), t[0].setProps({
4776
+ getReferenceClientRect: a.clientRect
4953
4777
  }));
4954
4778
  },
4955
- onKeyDown(i) {
4956
- var a;
4779
+ onKeyDown(a) {
4780
+ var i;
4957
4781
  if (n)
4958
- return i.event.key === "Escape" ? (t[0].hide(), !0) : (a = e.ref) == null ? void 0 : a.onKeyDown(i);
4782
+ return a.event.key === "Escape" ? (t[0].hide(), !0) : (i = e.ref) == null ? void 0 : i.onKeyDown(a);
4959
4783
  },
4960
4784
  onExit() {
4961
4785
  n && (t[0].destroy(), e.destroy());
@@ -4964,7 +4788,7 @@ const fa = 200, _a = new Z("emoji"), Bo = we.create({
4964
4788
  }
4965
4789
  }
4966
4790
  });
4967
- function ga(e) {
4791
+ function Ya(e) {
4968
4792
  const t = document.createElement("iframe");
4969
4793
  t.setAttribute("style", "position: absolute; width: 0; height: 0; top: 0; left: 0;"), document.body.appendChild(t), t.textContent = `
4970
4794
  <!DOCTYPE html>
@@ -4981,8 +4805,8 @@ function ga(e) {
4981
4805
  </body>
4982
4806
  </html>
4983
4807
  `;
4984
- const n = t.contentWindow, i = t.contentDocument || t.contentWindow && t.contentWindow.document, a = document.createElement("link");
4985
- a.rel = "stylesheet", a.href = "https://cdn.jsdelivr.net/npm/reactjs-tiptap-editor@latest/lib/style.css", i.head.appendChild(a), i && (i.open(), i.write(e), i.close()), n && t.addEventListener("load", function() {
4808
+ const n = t.contentWindow, a = t.contentDocument || t.contentWindow && t.contentWindow.document, i = document.createElement("link");
4809
+ i.rel = "stylesheet", i.href = "https://cdn.jsdelivr.net/npm/reactjs-tiptap-editor@latest/lib/style.css", a.head.appendChild(i), a && (a.open(), a.write(e), a.close()), n && t.addEventListener("load", function() {
4986
4810
  try {
4987
4811
  setTimeout(() => {
4988
4812
  n.focus();
@@ -5001,21 +4825,21 @@ function ga(e) {
5001
4825
  }, 100);
5002
4826
  });
5003
4827
  }
5004
- function ba(e) {
4828
+ function Qa(e) {
5005
4829
  const t = e.getHTML();
5006
- return t ? (ga(t), !0) : !1;
4830
+ return t ? (Ya(t), !0) : !1;
5007
4831
  }
5008
- const jo = N.create({
4832
+ const po = A.create({
5009
4833
  name: "exportPdf",
5010
4834
  addOptions() {
5011
4835
  var e;
5012
4836
  return {
5013
4837
  ...(e = this.parent) == null ? void 0 : e.call(this),
5014
4838
  button: ({ editor: t, t: n }) => ({
5015
- component: x,
4839
+ component: p,
5016
4840
  componentProps: {
5017
4841
  action: () => {
5018
- ba(t);
4842
+ Qa(t);
5019
4843
  },
5020
4844
  icon: "ExportPdf",
5021
4845
  tooltip: n("editor.exportPdf.tooltip"),
@@ -5026,99 +4850,99 @@ const jo = N.create({
5026
4850
  };
5027
4851
  }
5028
4852
  });
5029
- function xa(e, t) {
5030
- const n = atob(e.split(",")[1]), i = Array.from({ length: n.length });
4853
+ function Xa(e, t) {
4854
+ const n = atob(e.split(",")[1]), a = Array.from({ length: n.length });
5031
4855
  for (let o = 0; o < n.length; o++)
5032
- i[o] = n.charCodeAt(o);
5033
- const a = new Uint8Array(i);
5034
- return new Blob([a], { type: t });
4856
+ a[o] = n.charCodeAt(o);
4857
+ const i = new Uint8Array(a);
4858
+ return new Blob([i], { type: t });
5035
4859
  }
5036
- function wa(e, t) {
4860
+ function ei(e, t) {
5037
4861
  return new File([e], t, { type: e.type });
5038
4862
  }
5039
- function pa(e) {
5040
- const { toast: t } = In(), { t: n } = B(), [i, a] = v(!1), o = G(null);
5041
- function s() {
5042
- var u;
5043
- (u = o.current) == null || u.click();
4863
+ function ti(e) {
4864
+ const { toast: t } = Nn(), { t: n } = j(), [a, i] = C(!1), o = G(null);
4865
+ function r() {
4866
+ var h;
4867
+ (h = o.current) == null || h.click();
5044
4868
  }
5045
- function c(u) {
5046
- const f = u.target.files[0];
5047
- if (f) {
5048
- if (f.size > e.limit) {
4869
+ function l(h) {
4870
+ const _ = h.target.files[0];
4871
+ if (_) {
4872
+ if (_.size > e.limit) {
5049
4873
  t({
5050
4874
  variant: "destructive",
5051
4875
  title: n("editor.importWord.limitSize")
5052
4876
  });
5053
4877
  return;
5054
4878
  }
5055
- d(f);
4879
+ d(_);
5056
4880
  }
5057
4881
  }
5058
- async function h(u) {
5059
- var T;
5060
- const _ = new DOMParser().parseFromString(u, "text/html"), w = _.querySelectorAll("img");
4882
+ async function u(h) {
4883
+ var L;
4884
+ const f = new DOMParser().parseFromString(h, "text/html"), w = f.querySelectorAll("img");
5061
4885
  if (w.length === 0)
5062
- return _.body.innerHTML;
5063
- if (Bn(e.editor, "image")) {
5064
- const E = (T = e.editor.extensionManager.extensions.find(
4886
+ return f.body.innerHTML;
4887
+ if (An(e.editor, "image")) {
4888
+ const E = (L = e.editor.extensionManager.extensions.find(
5065
4889
  (g) => g.name === "importWord"
5066
- )) == null ? void 0 : T.options;
4890
+ )) == null ? void 0 : L.options;
5067
4891
  if (E && typeof E.upload == "function") {
5068
4892
  const g = [];
5069
- for (const k of w) {
5070
- const H = k.getAttribute("src"), L = xa(H, "image/jpeg"), O = wa(L, "image.jpeg");
4893
+ for (const v of w) {
4894
+ const H = v.getAttribute("src"), S = Xa(H, "image/jpeg"), O = ei(S, "image.jpeg");
5071
4895
  g.push(O);
5072
4896
  }
5073
4897
  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());
4898
+ for (const [v, H] of w.entries()) {
4899
+ H.setAttribute("src", b[v].src);
4900
+ const S = H.parentElement;
4901
+ (S == null ? void 0 : S.tagName) === "P" && (S.insertAdjacentElement("beforebegin", H), !S.hasChildNodes() && S.textContent === "" && S.remove());
5078
4902
  }
5079
- return _.body.innerHTML;
4903
+ return f.body.innerHTML;
5080
4904
  } else
5081
- return console.warn("Image Upload method found, skip image conversion"), _.body.innerHTML;
4905
+ return console.warn("Image Upload method found, skip image conversion"), f.body.innerHTML;
5082
4906
  } else
5083
- return console.error("Image extension not found, unable to convert image"), _.body.innerHTML;
4907
+ return console.error("Image extension not found, unable to convert image"), f.body.innerHTML;
5084
4908
  }
5085
- async function d(u) {
5086
- a(!0);
4909
+ async function d(h) {
4910
+ i(!0);
5087
4911
  try {
5088
4912
  if (e.convert) {
5089
- const f = await e.convert(u);
5090
- l(f);
4913
+ const _ = await e.convert(h);
4914
+ c(_);
5091
4915
  } else {
5092
- const f = await u.arrayBuffer(), { value: _ } = await ln.convertToHtml(
5093
- { arrayBuffer: f },
4916
+ const _ = await h.arrayBuffer(), { value: f } = await Yt.convertToHtml(
4917
+ { arrayBuffer: _ },
5094
4918
  e == null ? void 0 : e.mammothOptions
5095
4919
  );
5096
- l(_);
4920
+ c(f);
5097
4921
  }
5098
4922
  } finally {
5099
- a(!1);
4923
+ i(!1);
5100
4924
  }
5101
4925
  }
5102
- async function l(u) {
5103
- const f = await h(u);
5104
- e.editor.chain().setContent(f, !0).run();
4926
+ async function c(h) {
4927
+ const _ = await u(h);
4928
+ e.editor.chain().setContent(_, !0).run();
5105
4929
  }
5106
4930
  return /* @__PURE__ */ m("div", { children: [
5107
- /* @__PURE__ */ r(
5108
- x,
4931
+ /* @__PURE__ */ s(
4932
+ p,
5109
4933
  {
5110
- action: s,
4934
+ action: r,
5111
4935
  disabled: e == null ? void 0 : e.disabled,
5112
4936
  icon: e == null ? void 0 : e.icon,
5113
- loading: i,
4937
+ loading: a,
5114
4938
  tooltip: e == null ? void 0 : e.tooltip
5115
4939
  }
5116
4940
  ),
5117
- /* @__PURE__ */ r(
4941
+ /* @__PURE__ */ s(
5118
4942
  "input",
5119
4943
  {
5120
4944
  accept: ".docx",
5121
- onChange: c,
4945
+ onChange: l,
5122
4946
  ref: o,
5123
4947
  type: "file",
5124
4948
  style: {
@@ -5128,7 +4952,7 @@ function pa(e) {
5128
4952
  )
5129
4953
  ] });
5130
4954
  }
5131
- const Do = N.create({
4955
+ const wo = A.create({
5132
4956
  name: "importWord",
5133
4957
  addOptions() {
5134
4958
  var e;
@@ -5138,34 +4962,34 @@ const Do = N.create({
5138
4962
  convert: void 0,
5139
4963
  limit: 1024 * 1024 * 10,
5140
4964
  // 10 MB
5141
- button: ({ editor: t, extension: n, t: i }) => {
5142
- const { convert: a, limit: o, mammothOptions: s } = n.options;
4965
+ button: ({ editor: t, extension: n, t: a }) => {
4966
+ const { convert: i, limit: o, mammothOptions: r } = n.options;
5143
4967
  return {
5144
- component: pa,
4968
+ component: ti,
5145
4969
  componentProps: {
5146
4970
  editor: t,
5147
- convert: a,
4971
+ convert: i,
5148
4972
  limit: o,
5149
- mammothOptions: s,
4973
+ mammothOptions: r,
5150
4974
  action: () => t.commands.setHorizontalRule(),
5151
4975
  disabled: !t.can().setHorizontalRule(),
5152
4976
  icon: "Word",
5153
4977
  shortcutKeys: ["alt", "mod", "S"],
5154
- tooltip: i("editor.importWord.tooltip")
4978
+ tooltip: a("editor.importWord.tooltip")
5155
4979
  }
5156
4980
  };
5157
4981
  }
5158
4982
  };
5159
4983
  }
5160
- }), ya = typeof window < "u";
5161
- function ka(e, t) {
5162
- if (ya) {
5163
- const n = window.URL.createObjectURL(e), i = document.createElement("a");
5164
- return i.href = n, i.download = t, i.click(), window.URL.revokeObjectURL(n), Promise.resolve();
4984
+ }), ni = typeof window < "u";
4985
+ function ai(e, t) {
4986
+ if (ni) {
4987
+ const n = window.URL.createObjectURL(e), a = document.createElement("a");
4988
+ return a.href = n, a.download = t, a.click(), window.URL.revokeObjectURL(n), Promise.resolve();
5165
4989
  }
5166
4990
  return console.error("Download is not supported in Node.js"), Promise.resolve();
5167
4991
  }
5168
- const va = {
4992
+ const ii = {
5169
4993
  ...U,
5170
4994
  hardBreak: U.hard_break,
5171
4995
  codeBlock: U.code_block,
@@ -5182,19 +5006,19 @@ const va = {
5182
5006
  tableOptions: {
5183
5007
  width: {
5184
5008
  size: 100,
5185
- type: Jn.PERCENTAGE
5009
+ type: Dn.PERCENTAGE
5186
5010
  }
5187
5011
  }
5188
5012
  });
5189
5013
  }
5190
- }, Ca = new Qn(va, Yn), Oo = N.create({
5014
+ }, oi = new On(ii, $n), yo = A.create({
5191
5015
  name: "exportWord",
5192
5016
  addOptions() {
5193
5017
  var e;
5194
5018
  return {
5195
5019
  ...(e = this.parent) == null ? void 0 : e.call(this),
5196
5020
  button: ({ editor: t, t: n }) => ({
5197
- component: x,
5021
+ component: p,
5198
5022
  componentProps: {
5199
5023
  icon: "ExportWord",
5200
5024
  action: () => {
@@ -5212,48 +5036,48 @@ const va = {
5212
5036
  return {
5213
5037
  exportToWord: () => async ({ editor: e }) => {
5214
5038
  const t = {
5215
- getImageBuffer: async (i) => {
5216
- const o = await (await fetch(i)).arrayBuffer();
5039
+ getImageBuffer: async (a) => {
5040
+ const o = await (await fetch(a)).arrayBuffer();
5217
5041
  return new Uint8Array(o);
5218
5042
  }
5219
- }, n = Ca.serialize(e.state.doc, t);
5220
- return Zn.toBlob(n).then((i) => ka(new Blob([i]), "export-document.docx")), !0;
5043
+ }, n = oi.serialize(e.state.doc, t);
5044
+ return Bn.toBlob(n).then((a) => ai(new Blob([a]), "export-document.docx")), !0;
5221
5045
  }
5222
5046
  };
5223
5047
  }
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
5048
+ }), si = "_toc_aag8a_1", ri = "_visible_aag8a_7", li = "_list_aag8a_11", ci = "_item_aag8a_16", _e = {
5049
+ toc: si,
5050
+ visible: ri,
5051
+ list: li,
5052
+ item: ci
5229
5053
  };
5230
- function Sa(e) {
5054
+ function di(e) {
5231
5055
  const t = [], n = [t];
5232
- return e.forEach((i) => {
5233
- let a = -1, o = n[i.level + a];
5056
+ return e.forEach((a) => {
5057
+ let i = -1, o = n[a.level + i];
5234
5058
  for (; !o; )
5235
- a -= 1, o = n[i.level + a];
5236
- o.push({ ...i, children: n[i.level] = [] });
5059
+ i -= 1, o = n[a.level + i];
5060
+ o.push({ ...a, children: n[a.level] = [] });
5237
5061
  }), t;
5238
5062
  }
5239
- function Ea({ editor: e }) {
5240
- const t = De(), [n, i] = v([]), { t: a } = B(), o = F(() => {
5241
- const s = [], c = e.state.tr;
5242
- e.state.doc.descendants((h, d) => {
5243
- if (h.type.name === "heading") {
5244
- const l = `heading-${s.length + 1}`;
5245
- h.attrs.id !== l && c.setNodeMarkup(d, void 0, {
5246
- ...h.attrs,
5247
- id: l
5248
- }), s.push({
5249
- level: h.attrs.level,
5250
- text: h.textContent,
5251
- id: l
5063
+ function ui({ editor: e }) {
5064
+ const t = Ie(), [n, a] = C([]), { t: i } = j(), o = F(() => {
5065
+ const r = [], l = e.state.tr;
5066
+ e.state.doc.descendants((u, d) => {
5067
+ if (u.type.name === "heading") {
5068
+ const c = `heading-${r.length + 1}`;
5069
+ u.attrs.id !== c && l.setNodeMarkup(d, void 0, {
5070
+ ...u.attrs,
5071
+ id: c
5072
+ }), r.push({
5073
+ level: u.attrs.level,
5074
+ text: u.textContent,
5075
+ id: c
5252
5076
  });
5253
5077
  }
5254
- }), c.setMeta("addToHistory", !1), c.setMeta("preventUpdate", !0), e.view.dispatch(c), i(s), e.eventEmitter && e.eventEmitter.emit("TableOfContents", Sa(s));
5078
+ }), l.setMeta("addToHistory", !1), l.setMeta("preventUpdate", !0), e.view.dispatch(l), a(r), e.eventEmitter && e.eventEmitter.emit("TableOfContents", di(r));
5255
5079
  }, [e]);
5256
- return M(() => {
5080
+ return z(() => {
5257
5081
  if (e) {
5258
5082
  if (!e.options.editable) {
5259
5083
  o();
@@ -5263,62 +5087,62 @@ function Ea({ editor: e }) {
5263
5087
  e.off("update", o);
5264
5088
  };
5265
5089
  }
5266
- }, [e, o]), M(() => {
5090
+ }, [e, o]), z(() => {
5267
5091
  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(
5092
+ }, []), /* @__PURE__ */ s(se, { className: P("tableOfContent", _e.toc, t && _e.visible), children: t ? /* @__PURE__ */ m("div", { style: { position: "relative" }, children: [
5093
+ /* @__PURE__ */ s("p", { className: "text-[20px] mb-[8px] font-semibold", children: i("editor.table_of_content") }),
5094
+ /* @__PURE__ */ s("ul", { className: _e.list, children: n.map((r, l) => /* @__PURE__ */ s(
5271
5095
  "li",
5272
5096
  {
5273
- className: be.item,
5274
- style: { paddingLeft: `${s.level - 1}rem` },
5275
- children: /* @__PURE__ */ r("a", { href: `#${s.id}`, children: s.text })
5097
+ className: _e.item,
5098
+ style: { paddingLeft: `${r.level - 1}rem` },
5099
+ children: /* @__PURE__ */ s("a", { href: `#${r.id}`, children: r.text })
5276
5100
  },
5277
- `table-of-content-${c}`
5101
+ `table-of-content-${l}`
5278
5102
  )) })
5279
5103
  ] }) : null });
5280
5104
  }
5281
- function Ha(e, ...t) {
5282
- const [n, i] = v(!1);
5283
- return M(() => {
5284
- const a = () => {
5285
- i(e.isActive.apply(e, t));
5105
+ function mi(e, ...t) {
5106
+ const [n, a] = C(!1);
5107
+ return z(() => {
5108
+ const i = () => {
5109
+ a(e.isActive.apply(e, t));
5286
5110
  };
5287
- return e.on("selectionUpdate", a), e.on("transaction", a), () => {
5288
- e.off("selectionUpdate", a), e.off("transaction", a);
5111
+ return e.on("selectionUpdate", i), e.on("transaction", i), () => {
5112
+ e.off("selectionUpdate", i), e.off("transaction", i);
5289
5113
  };
5290
- }, [e, t, i]), n;
5114
+ }, [e, t, a]), n;
5291
5115
  }
5292
- function Ma({ editor: e, icon: t, tooltip: n }) {
5293
- const i = Ha(e, Pa.name), a = F(() => {
5294
- if (i) {
5116
+ function hi({ editor: e, icon: t, tooltip: n }) {
5117
+ const a = mi(e, gi.name), i = F(() => {
5118
+ if (a) {
5295
5119
  e.chain().focus().removeTableOfContents().run();
5296
5120
  return;
5297
5121
  }
5298
5122
  e.chain().focus().setTableOfContents().run();
5299
- }, [e, i]);
5300
- return /* @__PURE__ */ r(
5301
- x,
5123
+ }, [e, a]);
5124
+ return /* @__PURE__ */ s(
5125
+ p,
5302
5126
  {
5303
- action: a,
5304
- isActive: () => i || !1,
5127
+ action: i,
5128
+ isActive: () => a || !1,
5305
5129
  icon: t,
5306
5130
  tooltip: n
5307
5131
  }
5308
5132
  );
5309
5133
  }
5310
- function za(e) {
5134
+ function _i(e) {
5311
5135
  return e && e.type.name === "title";
5312
5136
  }
5313
- function Ra(e, t) {
5314
- const i = [e.getJSON()], a = [];
5315
- 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);
5137
+ function fi(e, t) {
5138
+ const a = [e.getJSON()], i = [];
5139
+ for (; a.length > 0; ) {
5140
+ const o = a.shift();
5141
+ o.type === t && i.push(o), o.content && o.content.length > 0 && a.push(...o.content);
5318
5142
  }
5319
- return a;
5143
+ return i;
5320
5144
  }
5321
- const Pa = we.create({
5145
+ const gi = ge.create({
5322
5146
  name: "tableOfContents",
5323
5147
  group: "block",
5324
5148
  atom: !0,
@@ -5332,7 +5156,7 @@ const Pa = we.create({
5332
5156
  lastColumnResizable: !0,
5333
5157
  allowTableNodeSelection: !1,
5334
5158
  button: ({ editor: t, t: n }) => ({
5335
- component: Ma,
5159
+ component: hi,
5336
5160
  componentProps: {
5337
5161
  disabled: !1,
5338
5162
  icon: "BookMarked",
@@ -5350,22 +5174,22 @@ const Pa = we.create({
5350
5174
  ];
5351
5175
  },
5352
5176
  renderHTML({ HTMLAttributes: e }) {
5353
- return ["toc", pe(e)];
5177
+ return ["toc", be(e)];
5354
5178
  },
5355
5179
  addNodeView() {
5356
- return He(Ea);
5180
+ return Se(ui);
5357
5181
  },
5358
5182
  // @ts-expect-error
5359
5183
  addCommands() {
5360
5184
  return {
5361
5185
  setTableOfContents: () => ({ commands: e, editor: t, view: n }) => {
5362
- if (Ra(t, this.name).length > 0) {
5186
+ if (fi(t, this.name).length > 0) {
5363
5187
  this.options.onHasOneBeforeInsert();
5364
5188
  return;
5365
5189
  }
5366
- const a = n.props.state.doc.content.firstChild;
5367
- if (za(a)) {
5368
- const o = (a.firstChild && a.firstChild.nodeSize || 0) + 1;
5190
+ const i = n.props.state.doc.content.firstChild;
5191
+ if (_i(i)) {
5192
+ const o = (i.firstChild && i.firstChild.nodeSize || 0) + 1;
5369
5193
  return e.insertContentAt(o, { type: this.name });
5370
5194
  }
5371
5195
  return e.insertContent({
@@ -5373,11 +5197,11 @@ const Pa = we.create({
5373
5197
  });
5374
5198
  },
5375
5199
  removeTableOfContents: () => ({ state: e, dispatch: t }) => {
5376
- const { tr: n } = e, i = e.schema.nodes.tableOfContents;
5377
- return e.doc.descendants((a, o) => {
5378
- if (a.type === i) {
5379
- const s = o, c = o + a.nodeSize;
5380
- n.delete(s, c);
5200
+ const { tr: n } = e, a = e.schema.nodes.tableOfContents;
5201
+ return e.doc.descendants((i, o) => {
5202
+ if (i.type === a) {
5203
+ const r = o, l = o + i.nodeSize;
5204
+ n.delete(r, l);
5381
5205
  }
5382
5206
  }), n.docChanged ? (t(n), !0) : !1;
5383
5207
  }
@@ -5396,37 +5220,37 @@ const Pa = we.create({
5396
5220
  ];
5397
5221
  }
5398
5222
  });
5399
- function Ia(e) {
5223
+ function bi(e) {
5400
5224
  var n;
5401
- const t = P(() => {
5225
+ const t = R(() => {
5402
5226
  var o;
5403
- const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
5404
- return i && !i.default ? {
5405
- ...i,
5406
- icon: i.icon ? i.icon : e.icon
5227
+ const a = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((r) => r.isActive());
5228
+ return a && !a.default ? {
5229
+ ...a,
5230
+ icon: a.icon ? a.icon : e.icon
5407
5231
  } : {
5408
5232
  title: e == null ? void 0 : e.tooltip,
5409
5233
  icon: e.icon,
5410
5234
  isActive: () => !1
5411
5235
  };
5412
5236
  }, [e]);
5413
- return /* @__PURE__ */ m(ie, { modal: !0, children: [
5414
- /* @__PURE__ */ r(
5415
- ae,
5237
+ return /* @__PURE__ */ m(ce, { modal: !0, children: [
5238
+ /* @__PURE__ */ s(
5239
+ de,
5416
5240
  {
5417
5241
  asChild: !0,
5418
5242
  disabled: e == null ? void 0 : e.disabled,
5419
- children: /* @__PURE__ */ r(
5420
- x,
5243
+ children: /* @__PURE__ */ s(
5244
+ p,
5421
5245
  {
5422
- customClass: "!richtext-w-12 richtext-h-12",
5246
+ customClass: "!w-12 h-12",
5423
5247
  disabled: e == null ? void 0 : e.disabled,
5424
5248
  icon: e == null ? void 0 : e.icon,
5425
5249
  tooltip: e == null ? void 0 : e.tooltip,
5426
- children: /* @__PURE__ */ r(
5427
- z,
5250
+ children: /* @__PURE__ */ s(
5251
+ M,
5428
5252
  {
5429
- className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
5253
+ className: "ml-1 size-3 text-zinc-500",
5430
5254
  name: "MenuDown"
5431
5255
  }
5432
5256
  )
@@ -5434,37 +5258,37 @@ function Ia(e) {
5434
5258
  )
5435
5259
  }
5436
5260
  ),
5437
- /* @__PURE__ */ r(
5438
- oe,
5261
+ /* @__PURE__ */ s(
5262
+ ue,
5439
5263
  {
5440
5264
  align: "start",
5441
- className: "richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",
5265
+ className: "flex w-full min-w-4 flex-row gap-1 !p-[4px]",
5442
5266
  side: "bottom",
5443
- 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,
5267
+ children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((a, i) => {
5268
+ var o, r;
5269
+ return /* @__PURE__ */ m(we, { children: [
5270
+ /* @__PURE__ */ s(ye, { asChild: !0, children: /* @__PURE__ */ s(
5271
+ Be,
5448
5272
  {
5449
- className: "richtext-size-7 richtext-p-1",
5450
- "data-state": t.title === i.title ? "on" : "off",
5451
- onClick: i == null ? void 0 : i.action,
5452
- pressed: t.title === i.title,
5273
+ className: "size-7 p-1",
5274
+ "data-state": t.title === a.title ? "on" : "off",
5275
+ onClick: a == null ? void 0 : a.action,
5276
+ pressed: t.title === a.title,
5453
5277
  size: "sm",
5454
- children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ r(z, { name: i.icon })
5278
+ children: (a == null ? void 0 : a.icon) && /* @__PURE__ */ s(M, { name: a.icon })
5455
5279
  }
5456
5280
  ) }),
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(" ") })
5281
+ /* @__PURE__ */ m(ke, { className: "flex flex-col items-center", children: [
5282
+ /* @__PURE__ */ s("span", { children: a.title }),
5283
+ !!((o = a.shortcutKeys) != null && o.length) && /* @__PURE__ */ s("span", { children: (r = a.shortcutKeys) == null ? void 0 : r.map((l) => je(l)).join(" ") })
5460
5284
  ] })
5461
- ] }, `text-align-${a}`);
5285
+ ] }, `text-align-${i}`);
5462
5286
  })
5463
5287
  }
5464
5288
  )
5465
5289
  ] });
5466
5290
  }
5467
- const $o = N.create({
5291
+ const ko = A.create({
5468
5292
  name: "text-direction",
5469
5293
  addOptions() {
5470
5294
  var e;
@@ -5476,34 +5300,34 @@ const $o = N.create({
5476
5300
  button({
5477
5301
  editor: t,
5478
5302
  extension: n,
5479
- t: i
5303
+ t: a
5480
5304
  }) {
5481
- var h;
5482
- const a = ((h = n.options) == null ? void 0 : h.directions) || [], o = {
5305
+ var u;
5306
+ const i = ((u = n.options) == null ? void 0 : u.directions) || [], o = {
5483
5307
  auto: "TextDirection",
5484
5308
  ltr: "LeftToRight",
5485
5309
  rtl: "RightToLeft"
5486
- }, s = a.map((d) => ({
5487
- title: i(`editor.textDirection.${d}.tooltip`),
5310
+ }, r = i.map((d) => ({
5311
+ title: a(`editor.textDirection.${d}.tooltip`),
5488
5312
  icon: o[d],
5489
5313
  isActive: () => !1,
5490
5314
  action: () => {
5491
- var l, u, f, _;
5315
+ var c, h, _, f;
5492
5316
  if (d === "auto") {
5493
- (u = (l = t.commands) == null ? void 0 : l.unsetTextDirection) == null || u.call(l);
5317
+ (h = (c = t.commands) == null ? void 0 : c.unsetTextDirection) == null || h.call(c);
5494
5318
  return;
5495
5319
  }
5496
- (_ = (f = t.commands) == null ? void 0 : f.setTextDirection) == null || _.call(f, d);
5320
+ (f = (_ = t.commands) == null ? void 0 : _.setTextDirection) == null || f.call(_, d);
5497
5321
  },
5498
5322
  disabled: !1
5499
- })), c = s.filter((d) => d.disabled).length === s.length;
5323
+ })), l = r.filter((d) => d.disabled).length === r.length;
5500
5324
  return {
5501
- component: Ia,
5325
+ component: bi,
5502
5326
  componentProps: {
5503
5327
  icon: "TextDirection",
5504
- tooltip: i("editor.textDirection.tooltip"),
5505
- disabled: c,
5506
- items: s
5328
+ tooltip: a("editor.textDirection.tooltip"),
5329
+ disabled: l,
5330
+ items: r
5507
5331
  }
5508
5332
  };
5509
5333
  }
@@ -5530,38 +5354,38 @@ const $o = N.create({
5530
5354
  unsetTextDirection: () => ({ commands: e }) => this.options.types.every((t) => e.resetAttributes(t, "dir"))
5531
5355
  };
5532
5356
  }
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) => {
5539
- const l = e.items[d];
5540
- l && e.command({ id: l, label: l });
5541
- }, s = () => {
5542
- a((i + e.items.length - 1) % e.items.length);
5543
- }, c = () => {
5544
- a((i + 1) % e.items.length);
5545
- }, h = () => {
5546
- o(i);
5357
+ }), pi = "_listUsers_en3pm_1", wi = "_itemUser_en3pm_10", yi = "_selectedUser_en3pm_31", fe = {
5358
+ listUsers: pi,
5359
+ itemUser: wi,
5360
+ selectedUser: yi
5361
+ }, ki = He((e, t) => {
5362
+ const n = G(null), [a, i] = C(0), o = (d) => {
5363
+ const c = e.items[d];
5364
+ c && e.command({ id: c, label: c });
5365
+ }, r = () => {
5366
+ i((a + e.items.length - 1) % e.items.length);
5367
+ }, l = () => {
5368
+ i((a + 1) % e.items.length);
5369
+ }, u = () => {
5370
+ o(a);
5547
5371
  };
5548
- return M(() => a(0), [e.items]), M(() => {
5549
- if (Number.isNaN(i + 1))
5372
+ return z(() => i(0), [e.items]), z(() => {
5373
+ if (Number.isNaN(a + 1))
5550
5374
  return;
5551
- 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(
5375
+ const d = n.current.querySelector(`span:nth-of-type(${a + 1})`);
5376
+ d && Oe(d, { behavior: "smooth", scrollMode: "if-needed" });
5377
+ }, [a]), ze(t, () => ({
5378
+ onKeyDown: ({ event: d }) => d.key === "ArrowUp" ? (r(), !0) : d.key === "ArrowDown" ? (l(), !0) : d.key === "Enter" ? (u(), !0) : !1
5379
+ })), /* @__PURE__ */ s("div", { className: P("listUsers", fe.listUsers), children: /* @__PURE__ */ s("div", { ref: n, children: e.items.length > 0 ? e.items.map((d, c) => /* @__PURE__ */ s(
5556
5380
  "span",
5557
5381
  {
5558
- className: R("itemUser", xe.itemUser, l === i ? xe.selectedUser : ""),
5559
- onClick: () => o(l),
5382
+ className: P("itemUser", fe.itemUser, c === a ? fe.selectedUser : ""),
5383
+ onClick: () => o(c),
5560
5384
  children: d
5561
5385
  },
5562
- l
5563
- )) : /* @__PURE__ */ r("div", { className: R("itemUserEmpty", xe.itemUser), children: "Empty" }) }) });
5564
- }), $a = [
5386
+ c
5387
+ )) : /* @__PURE__ */ s("div", { className: P("itemUserEmpty", fe.itemUser), children: "Empty" }) }) });
5388
+ }), vi = [
5565
5389
  {
5566
5390
  id: "1",
5567
5391
  name: "John Doe"
@@ -5578,16 +5402,16 @@ const $o = N.create({
5578
5402
  id: "4",
5579
5403
  name: "Bob"
5580
5404
  }
5581
- ], Fa = {
5582
- items: async ({ query: e }) => $a.map((n) => n.name).filter((n) => n.toLowerCase().startsWith(e.toLowerCase())),
5405
+ ], xi = {
5406
+ items: async ({ query: e }) => vi.map((n) => n.name).filter((n) => n.toLowerCase().startsWith(e.toLowerCase())),
5583
5407
  render: () => {
5584
5408
  let e, t;
5585
5409
  return {
5586
5410
  onStart: (n) => {
5587
- e = new Me(Oa, {
5411
+ e = new Te(ki, {
5588
5412
  props: n,
5589
5413
  editor: n.editor
5590
- }), t = Fe("body", {
5414
+ }), t = De("body", {
5591
5415
  getReferenceClientRect: n.clientRect,
5592
5416
  appendTo: () => document.body,
5593
5417
  content: e.element,
@@ -5603,24 +5427,24 @@ const $o = N.create({
5603
5427
  });
5604
5428
  },
5605
5429
  onKeyDown(n) {
5606
- var i;
5607
- return n.event.key === "Escape" ? (t[0].hide(), !0) : (i = e.ref) == null ? void 0 : i.onKeyDown(n);
5430
+ var a;
5431
+ return n.event.key === "Escape" ? (t[0].hide(), !0) : (a = e.ref) == null ? void 0 : a.onKeyDown(n);
5608
5432
  },
5609
5433
  onExit() {
5610
5434
  t[0].destroy(), e.destroy();
5611
5435
  }
5612
5436
  };
5613
5437
  }
5614
- }, Fo = an.extend({
5438
+ }, vo = Wt.extend({
5615
5439
  addAttributes() {
5616
5440
  return {
5617
5441
  id: {
5618
5442
  default: "",
5619
- parseHTML: j("id")
5443
+ parseHTML: B("id")
5620
5444
  },
5621
5445
  label: {
5622
5446
  default: "",
5623
- parseHTML: j("label")
5447
+ parseHTML: B("label")
5624
5448
  }
5625
5449
  };
5626
5450
  }
@@ -5628,8 +5452,8 @@ const $o = N.create({
5628
5452
  HTMLAttributes: {
5629
5453
  class: "mention"
5630
5454
  },
5631
- suggestion: Fa
5632
- }), Ua = {
5455
+ suggestion: xi
5456
+ }), Ci = {
5633
5457
  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
5458
  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
5459
  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,79 +5481,79 @@ const $o = N.create({
5657
5481
  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
5482
  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
5483
  };
5660
- function qa(e) {
5661
- const t = Ua[e], a = new DOMParser().parseFromString(t, "image/svg+xml").documentElement, o = [
5484
+ function Ni(e) {
5485
+ const t = Ci[e], i = new DOMParser().parseFromString(t, "image/svg+xml").documentElement, o = [
5662
5486
  "svg",
5663
5487
  {
5664
- ...Array.from(a.attributes).reduce((s, c) => (s[c.name] = c.value, s), {})
5488
+ ...Array.from(i.attributes).reduce((r, l) => (r[l.name] = l.value, r), {})
5665
5489
  }
5666
5490
  ];
5667
- return Array.from(a.childNodes).forEach((s) => {
5668
- if (s.nodeType === 1) {
5669
- const c = [
5670
- s.tagName.toLowerCase(),
5671
- Array.from(s.attributes).reduce((h, d) => (h[d.name] = d.value, h), {})
5491
+ return Array.from(i.childNodes).forEach((r) => {
5492
+ if (r.nodeType === 1) {
5493
+ const l = [
5494
+ r.tagName.toLowerCase(),
5495
+ Array.from(r.attributes).reduce((u, d) => (u[d.name] = d.value, u), {})
5672
5496
  ];
5673
- s.textContent && c.push(s.textContent), o.push(c);
5497
+ r.textContent && l.push(r.textContent), o.push(l);
5674
5498
  }
5675
5499
  }), o;
5676
5500
  }
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, {})
5501
+ const Ai = {
5502
+ audio: /* @__PURE__ */ s(un, {}),
5503
+ video: /* @__PURE__ */ s(dn, {}),
5504
+ file: /* @__PURE__ */ s(cn, {}),
5505
+ image: /* @__PURE__ */ s(ln, {}),
5506
+ pdf: /* @__PURE__ */ s(Tn, {}),
5507
+ word: /* @__PURE__ */ s(Sn, {}),
5508
+ excel: /* @__PURE__ */ s(rn, {}),
5509
+ ppt: /* @__PURE__ */ s(sn, {})
5686
5510
  };
5687
- function wt(e, t = !1) {
5688
- const n = jn(e), i = Ka[n] || /* @__PURE__ */ r(ye, {});
5689
- return t ? qa(n) : i;
5511
+ function ht(e, t = !1) {
5512
+ const n = Ln(e), a = Ai[n] || /* @__PURE__ */ s(pe, {});
5513
+ return t ? Ni(n) : a;
5690
5514
  }
5691
- const Va = "_wrap_1x1ms_2", Le = {
5692
- wrap: Va
5515
+ const Li = "_wrap_1x1ms_2", Ne = {
5516
+ wrap: Li
5693
5517
  };
5694
- function Wa({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension: a }) {
5518
+ function Si({ editor: e, node: t, updateAttributes: n, deleteNode: a, extension: i }) {
5695
5519
  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(
5699
- async (L) => {
5700
- const O = L.target.files && L.target.files[0];
5520
+ const o = G(null), r = Ie(), { hasTrigger: l, fileName: u, fileSize: d, fileExt: c, fileType: h, url: _, error: f } = t.attrs, [w, y] = C(!1), { t: L } = j(), E = (H = i == null ? void 0 : i.options) == null ? void 0 : H.upload, g = F(() => {
5521
+ !r || _ || r && o.current.click();
5522
+ }, [r, _]), b = F(
5523
+ async (S) => {
5524
+ const O = S.target.files && S.target.files[0];
5701
5525
  if (!O)
5702
5526
  return;
5703
- const pt = {
5704
- fileName: Fn(O.name),
5527
+ const _t = {
5528
+ fileName: Hn(O.name),
5705
5529
  fileSize: O.size,
5706
5530
  fileType: O.type,
5707
- fileExt: $n(O.name)
5531
+ fileExt: En(O.name)
5708
5532
  };
5709
- p(!0);
5533
+ y(!0);
5710
5534
  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 = "";
5535
+ const me = await E(O);
5536
+ n({ ..._t, url: me }), y(!1);
5537
+ } catch (me) {
5538
+ n({ error: `File upload fail: ${me && me.message}` || "Unknown error" }), y(!1), o.current.value = "";
5715
5539
  }
5716
5540
  },
5717
- [p, n]
5541
+ [y, n]
5718
5542
  );
5719
- M(() => {
5720
- !f && !c && (g(), n({ hasTrigger: !0 }));
5721
- }, [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(
5543
+ z(() => {
5544
+ !_ && !l && (g(), n({ hasTrigger: !0 }));
5545
+ }, [_, l, g, n]);
5546
+ const v = F(() => a(), [e]);
5547
+ return r && !_ ? /* @__PURE__ */ s(se, { children: /* @__PURE__ */ m("div", { className: P(Ne.wrap, "render-wrapper"), children: [
5548
+ /* @__PURE__ */ s(
5725
5549
  "p",
5726
5550
  {
5727
5551
  onClick: g,
5728
5552
  style: { cursor: "pointer" },
5729
- children: w ? /* @__PURE__ */ r("span", { children: T("editor.attachment.uploading") }) : /* @__PURE__ */ r("span", { children: T("editor.attachment.please_upload") })
5553
+ children: w ? /* @__PURE__ */ s("span", { children: L("editor.attachment.uploading") }) : /* @__PURE__ */ s("span", { children: L("editor.attachment.please_upload") })
5730
5554
  }
5731
5555
  ),
5732
- /* @__PURE__ */ r(
5556
+ /* @__PURE__ */ s(
5733
5557
  "input",
5734
5558
  {
5735
5559
  hidden: !0,
@@ -5738,45 +5562,45 @@ function Wa({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension:
5738
5562
  type: "file"
5739
5563
  }
5740
5564
  )
5741
- ] }) }) : f ? /* @__PURE__ */ r(le, { children: /* @__PURE__ */ m(
5565
+ ] }) }) : _ ? /* @__PURE__ */ s(se, { children: /* @__PURE__ */ m(
5742
5566
  "div",
5743
5567
  {
5744
- className: R(Le.wrap, "render-wrapper"),
5568
+ className: P(Ne.wrap, "render-wrapper"),
5745
5569
  onClick: g,
5746
5570
  children: [
5747
- /* @__PURE__ */ m("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
5748
- /* @__PURE__ */ r("span", { children: wt(u) }),
5571
+ /* @__PURE__ */ m("div", { className: "flex items-center gap-[4px]", children: [
5572
+ /* @__PURE__ */ s("span", { children: ht(h) }),
5749
5573
  /* @__PURE__ */ m("span", { children: [
5750
- h,
5574
+ u,
5751
5575
  ".",
5752
- l
5576
+ c
5753
5577
  ] }),
5754
5578
  /* @__PURE__ */ m("span", { children: [
5755
5579
  "(",
5756
- st(d),
5580
+ tt(d),
5757
5581
  ")"
5758
5582
  ] })
5759
5583
  ] }),
5760
- /* @__PURE__ */ r(
5761
- x,
5584
+ /* @__PURE__ */ s(
5585
+ p,
5762
5586
  {
5763
- action: k,
5587
+ action: v,
5764
5588
  icon: "Trash2",
5765
- tooltip: T("editor.delete")
5589
+ tooltip: L("editor.delete")
5766
5590
  }
5767
5591
  )
5768
5592
  ]
5769
5593
  }
5770
- ) }) : _ !== "null" ? /* @__PURE__ */ r(le, { children: /* @__PURE__ */ r(
5594
+ ) }) : f !== "null" ? /* @__PURE__ */ s(se, { children: /* @__PURE__ */ s(
5771
5595
  "div",
5772
5596
  {
5773
- className: R(Le.wrap, "render-wrapper"),
5597
+ className: P(Ne.wrap, "render-wrapper"),
5774
5598
  onClick: g,
5775
- children: /* @__PURE__ */ r("p", { children: _ })
5599
+ children: /* @__PURE__ */ s("p", { children: f })
5776
5600
  }
5777
- ) }) : /* @__PURE__ */ r(ye, {});
5601
+ ) }) : /* @__PURE__ */ s(pe, {});
5778
5602
  }
5779
- const Uo = we.create({
5603
+ const xo = ge.create({
5780
5604
  name: "attachment",
5781
5605
  content: "",
5782
5606
  marks: "",
@@ -5792,7 +5616,7 @@ const Uo = we.create({
5792
5616
  class: "attachment"
5793
5617
  },
5794
5618
  button: ({ editor: t, t: n }) => ({
5795
- component: x,
5619
+ component: p,
5796
5620
  componentProps: {
5797
5621
  action: () => t.chain().focus().setAttachment().run(),
5798
5622
  isActive: () => !1,
@@ -5810,13 +5634,13 @@ const Uo = we.create({
5810
5634
  const {
5811
5635
  url: t = "",
5812
5636
  fileName: n = "",
5813
- fileSize: i = "",
5814
- fileType: a = "",
5637
+ fileSize: a = "",
5638
+ fileType: i = "",
5815
5639
  fileExt: o = ""
5816
5640
  } = e || {};
5817
5641
  return [
5818
5642
  "div",
5819
- pe(
5643
+ be(
5820
5644
  // @ts-expect-error
5821
5645
  this.options.HTMLAttributes || {},
5822
5646
  e || {}
@@ -5827,12 +5651,12 @@ const Uo = we.create({
5827
5651
  [
5828
5652
  "span",
5829
5653
  { class: "attachment__icon" },
5830
- wt(a, !0)
5654
+ ht(i, !0)
5831
5655
  ],
5832
5656
  [
5833
5657
  "span",
5834
5658
  { class: "attachment__text" },
5835
- `${n}.${o} (${st(i)})`
5659
+ `${n}.${o} (${tt(a)})`
5836
5660
  ]
5837
5661
  ] : ["div", { class: "attachment__placeholder" }]
5838
5662
  ];
@@ -5841,31 +5665,31 @@ const Uo = we.create({
5841
5665
  return {
5842
5666
  fileName: {
5843
5667
  default: null,
5844
- parseHTML: j("filename")
5668
+ parseHTML: B("filename")
5845
5669
  },
5846
5670
  fileSize: {
5847
5671
  default: null,
5848
- parseHTML: j("filesize")
5672
+ parseHTML: B("filesize")
5849
5673
  },
5850
5674
  fileType: {
5851
5675
  default: null,
5852
- parseHTML: j("filetype")
5676
+ parseHTML: B("filetype")
5853
5677
  },
5854
5678
  fileExt: {
5855
5679
  default: null,
5856
- parseHTML: j("fileext")
5680
+ parseHTML: B("fileext")
5857
5681
  },
5858
5682
  url: {
5859
5683
  default: null,
5860
- parseHTML: j("url")
5684
+ parseHTML: B("url")
5861
5685
  },
5862
5686
  hasTrigger: {
5863
5687
  default: !1,
5864
- parseHTML: (e) => j("hastrigger")(e) === "true"
5688
+ parseHTML: (e) => B("hastrigger")(e) === "true"
5865
5689
  },
5866
5690
  error: {
5867
5691
  default: null,
5868
- parseHTML: j("error")
5692
+ parseHTML: B("error")
5869
5693
  }
5870
5694
  };
5871
5695
  },
@@ -5875,57 +5699,57 @@ const Uo = we.create({
5875
5699
  };
5876
5700
  },
5877
5701
  addNodeView() {
5878
- return He(Wa);
5702
+ return Se(Si);
5879
5703
  }
5880
5704
  });
5881
5705
  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
5706
+ xo as Attachment,
5707
+ co as BaseKit,
5708
+ io as Blockquote,
5709
+ Ui as Bold,
5710
+ eo as BulletList,
5711
+ to as Clear,
5712
+ Wi as Code,
5713
+ ra as CodeBlock,
5714
+ Qi as Color,
5715
+ pn as Column,
5716
+ lo as ColumnActionButton,
5717
+ Ao as Drawer,
5718
+ bo as Emoji,
5719
+ Lo as Excalidraw,
5720
+ po as ExportPdf,
5721
+ yo as ExportWord,
5722
+ Gi as FontFamily,
5723
+ Yi as FontSize,
5724
+ go as FormatPainter,
5725
+ Zi as Heading,
5726
+ Xi as Highlight,
5727
+ ro as History,
5728
+ so as HorizontalRule,
5729
+ So as Iframe,
5730
+ kn as Image,
5731
+ To as ImageGif,
5732
+ wo as ImportWord,
5733
+ ho as Indent,
5734
+ qi as Italic,
5735
+ Eo as Katex,
5736
+ _o as LineHeight,
5737
+ oo as Link,
5738
+ vo as Mention,
5739
+ Ho as Mermaid,
5740
+ mo as MoreMark,
5741
+ wn as MultiColumn,
5742
+ no as OrderedList,
5743
+ ja as SearchAndReplace,
5744
+ fo as SlashCommand,
5745
+ Vi as Strike,
5746
+ uo as SubAndSuperScript,
5747
+ zo as Table,
5748
+ gi as TableOfContents,
5749
+ ao as TaskList,
5750
+ Ji as TextAlign,
5751
+ ko as TextDirection,
5752
+ Mo as Twitter,
5753
+ Ki as Underline,
5754
+ xn as Video
5931
5755
  };