reactjs-tiptap-editor 0.2.11 → 0.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { a as nn, I as an, U as on, S as rn, C as sn, f as Ce, N as he, b as cn, c as ln, R as je, F as dn, H as un, T as hn, E as H, d as mn, e as fn, g as gn, h as Ae, O as _n, i as bn, j as xn, k as pn, L as wn, l as yn, m as Le, n as vn, o as kn, D as Cn, P as Nn, p as Tn, q as An, G as Ln, r as Sn, s as Mn, t as In, u as En, v as Hn, w as zn, x as Mt, y as It, z as Et, A as Ze, J as Rn, K as Pn, M as Dn, Q as On, V as jn, W as Bn } from "./tiptap-DKUVyykT.js";
2
2
  import { P as J, b as Q, $ as me, a0 as ge, al as U, am as $n, T as Ht, A as Fn, an as zt, ak as Rt, ao as _t, ap as bt, aq as Un, a4 as Vn, ar as qn, as as Kn } from "./vendor-K5cb6hwc.js";
3
- import { jsxs as f, jsx as o, Fragment as oe } from "react/jsx-runtime";
3
+ import { jsxs as g, jsx as r, Fragment as oe } from "react/jsx-runtime";
4
4
  import * as V from "react";
5
5
  import Pe, { useMemo as R, useState as k, useRef as X, useCallback as j, Fragment as Je, forwardRef as Qe, useImperativeHandle as et, useEffect as P } from "react";
6
6
  import { ChevronDown as tt, Check as Pt, ChevronUp as Wn, Copy as Gn, CopyCheck as Xn, SearchIcon as Yn, LoaderIcon as Zn, LucideTableProperties as Jn, LucideSheet as Qn, LucideImage as ei, LucideFile as ti, LucideVideo as ni, LucideAudioLines as ii } from "lucide-react";
@@ -20,10 +20,10 @@ import { Packer as zi, WidthType as Ri } from "docx";
20
20
  import { DocxSerializer as Pi, defaultNodes as ne, defaultMarks as Di } from "prosemirror-docx";
21
21
  const mt = Pe.forwardRef(
22
22
  ({ asChild: e, ...t }, n) => {
23
- var r;
23
+ var o;
24
24
  const i = nt[t.icon];
25
- return /* @__PURE__ */ f(Be, { children: [
26
- /* @__PURE__ */ o($e, { asChild: !0, children: /* @__PURE__ */ o(
25
+ return /* @__PURE__ */ g(Be, { children: [
26
+ /* @__PURE__ */ r($e, { asChild: !0, children: /* @__PURE__ */ r(
27
27
  e ? Ei : O,
28
28
  {
29
29
  className: "richtext-h-[32px] richtext-min-w-24 richtext-overflow-hidden richtext-px-[5px] richtext-py-0",
@@ -31,15 +31,15 @@ const mt = Pe.forwardRef(
31
31
  ref: n,
32
32
  variant: "ghost",
33
33
  ...t,
34
- children: /* @__PURE__ */ f("div", { className: "richtext-flex richtext-h-full richtext-items-center richtext-font-normal", children: [
35
- (t == null ? void 0 : t.title) && /* @__PURE__ */ o("div", { className: "richtext-grow richtext-truncate richtext-text-left richtext-text-sm", children: t == null ? void 0 : t.title }),
36
- i && /* @__PURE__ */ o(i, { className: "richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500" })
34
+ children: /* @__PURE__ */ g("div", { className: "richtext-flex richtext-h-full richtext-items-center richtext-font-normal", children: [
35
+ (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 }),
36
+ i && /* @__PURE__ */ r(i, { className: "richtext-ml-1 richtext-size-3 richtext-shrink-0 richtext-text-zinc-500" })
37
37
  ] })
38
38
  }
39
39
  ) }),
40
- /* @__PURE__ */ o(Fe, { children: /* @__PURE__ */ f("div", { className: "richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center", children: [
41
- (t == null ? void 0 : t.tooltip) && /* @__PURE__ */ o("div", { children: t == null ? void 0 : t.tooltip }),
42
- /* @__PURE__ */ o("div", { className: "richtext-flex", children: !!((r = t == null ? void 0 : t.shortcutKeys) != null && r.length) && /* @__PURE__ */ o("span", { children: it(t == null ? void 0 : t.shortcutKeys) }) })
40
+ /* @__PURE__ */ r(Fe, { children: /* @__PURE__ */ g("div", { className: "richtext-flex richtext-max-w-24 richtext-flex-col richtext-items-center richtext-text-center", children: [
41
+ (t == null ? void 0 : t.tooltip) && /* @__PURE__ */ r("div", { children: t == null ? void 0 : t.tooltip }),
42
+ /* @__PURE__ */ r("div", { className: "richtext-flex", children: !!((o = t == null ? void 0 : t.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: it(t == null ? void 0 : t.shortcutKeys) }) })
43
43
  ] }) })
44
44
  ] });
45
45
  }
@@ -169,7 +169,7 @@ async function Bi({
169
169
  defaultTheme: n,
170
170
  defaultLanguage: i
171
171
  }) {
172
- const a = Ce(e, (c) => c.type.name === t), r = [
172
+ const a = Ce(e, (c) => c.type.name === t), o = [
173
173
  ...a.map((c) => c.node.attrs.theme),
174
174
  n
175
175
  ], s = [
@@ -177,9 +177,9 @@ async function Bi({
177
177
  i
178
178
  ];
179
179
  G ? await Promise.all([
180
- ...r.flatMap((c) => Ut(c)),
180
+ ...o.flatMap((c) => Ut(c)),
181
181
  ...s.flatMap((c) => !!c && Vt(c))
182
- ]) : await ji({ languages: s, themes: r });
182
+ ]) : await ji({ languages: s, themes: o });
183
183
  }
184
184
  function vt({
185
185
  doc: e,
@@ -194,12 +194,12 @@ function vt({
194
194
  if (!d)
195
195
  return;
196
196
  d.getLoadedLanguages().includes(l) || (l = "plaintext");
197
- const g = d.getLoadedThemes().includes(u) ? u : d.getLoadedThemes()[0], h = d.codeToTokensBase(s.node.textContent, {
197
+ const f = d.getLoadedThemes().includes(u) ? u : d.getLoadedThemes()[0], m = d.codeToTokensBase(s.node.textContent, {
198
198
  lang: l,
199
- theme: g
199
+ theme: f
200
200
  });
201
- for (const m of h) {
202
- for (const b of m) {
201
+ for (const h of m) {
202
+ for (const b of h) {
203
203
  const x = c + b.content.length, N = ge.inline(c, x, {
204
204
  style: `color: ${b.color}`
205
205
  });
@@ -217,7 +217,7 @@ function $i({
217
217
  const i = new J({
218
218
  key: new Q("shiki"),
219
219
  view(a) {
220
- class r {
220
+ class o {
221
221
  constructor() {
222
222
  this.initDecorations();
223
223
  }
@@ -251,29 +251,29 @@ function $i({
251
251
  }
252
252
  }
253
253
  }
254
- return new r();
254
+ return new o();
255
255
  },
256
256
  state: {
257
- init: (a, { doc: r }) => vt({
258
- doc: r,
257
+ init: (a, { doc: o }) => vt({
258
+ doc: o,
259
259
  name: e,
260
260
  defaultLanguage: t,
261
261
  defaultTheme: n
262
262
  }),
263
- apply: (a, r, s, c) => {
263
+ apply: (a, o, s, c) => {
264
264
  const l = s.selection.$head.parent.type.name, u = c.selection.$head.parent.type.name, d = Ce(
265
265
  s.doc,
266
- (m) => m.type.name === e
267
- ), g = Ce(
266
+ (h) => h.type.name === e
267
+ ), f = Ce(
268
268
  c.doc,
269
- (m) => m.type.name === e
270
- ), h = a.docChanged && ([l, u].includes(e) || g.length !== d.length || a.steps.some((m) => m.from !== void 0 && m.to !== void 0 && d.some((b) => b.pos >= m.from && b.pos + b.node.nodeSize <= m.to)));
271
- return a.getMeta("shikiPluginForceDecoration") || h ? vt({
269
+ (h) => h.type.name === e
270
+ ), m = a.docChanged && ([l, u].includes(e) || f.length !== d.length || a.steps.some((h) => h.from !== void 0 && h.to !== void 0 && d.some((b) => b.pos >= h.from && b.pos + b.node.nodeSize <= h.to)));
271
+ return a.getMeta("shikiPluginForceDecoration") || m ? vt({
272
272
  doc: a.doc,
273
273
  name: e,
274
274
  defaultLanguage: t,
275
275
  defaultTheme: n
276
- }) : r.map(a.mapping, a.doc);
276
+ }) : o.map(a.mapping, a.doc);
277
277
  }
278
278
  },
279
279
  props: {
@@ -286,15 +286,15 @@ function $i({
286
286
  return i;
287
287
  }
288
288
  function Fi({ action: e, languages: t, ...n }) {
289
- const i = (r) => {
290
- e(r);
291
- }, a = R(() => t == null ? void 0 : t.map((r) => ({
292
- title: Ni[r] || r,
289
+ const i = (o) => {
290
+ e(o);
291
+ }, a = R(() => t == null ? void 0 : t.map((o) => ({
292
+ title: Ni[o] || o,
293
293
  // icon: language.icon,
294
- language: r
294
+ language: o
295
295
  })), [t]);
296
- return /* @__PURE__ */ f(re, { children: [
297
- /* @__PURE__ */ o(se, { disabled: n == null ? void 0 : n.disabled, asChild: !0, children: /* @__PURE__ */ o(
296
+ return /* @__PURE__ */ g(re, { children: [
297
+ /* @__PURE__ */ r(se, { disabled: n == null ? void 0 : n.disabled, asChild: !0, children: /* @__PURE__ */ r(
298
298
  y,
299
299
  {
300
300
  tooltip: n == null ? void 0 : n.tooltip,
@@ -302,10 +302,10 @@ function Fi({ action: e, languages: t, ...n }) {
302
302
  icon: n == null ? void 0 : n.icon
303
303
  }
304
304
  ) }),
305
- /* @__PURE__ */ o(ce, { className: "richtext-w-full !richtext-max-h-[180px] !richtext-overflow-y-scroll", children: a == null ? void 0 : a.map((r) => /* @__PURE__ */ o(ai, { onClick: () => i(r.language), children: /* @__PURE__ */ o("div", { className: "richtext-h-full richtext-ml-1", children: r.title }) }, `codeblock-${r.title}`)) })
305
+ /* @__PURE__ */ r(ce, { className: "richtext-w-full !richtext-max-h-[180px] !richtext-overflow-y-scroll", children: a == null ? void 0 : a.map((o) => /* @__PURE__ */ r(ai, { onClick: () => i(o.language), children: /* @__PURE__ */ r("div", { className: "richtext-h-full richtext-ml-1", children: o.title }) }, `codeblock-${o.title}`)) })
306
306
  ] });
307
307
  }
308
- const Ui = I.Root, Vi = I.Value, qt = V.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ f(
308
+ const Ui = I.Root, Vi = I.Value, qt = V.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ g(
309
309
  I.Trigger,
310
310
  {
311
311
  ref: i,
@@ -316,12 +316,12 @@ const Ui = I.Root, Vi = I.Value, qt = V.forwardRef(({ className: e, children: t,
316
316
  ...n,
317
317
  children: [
318
318
  t,
319
- /* @__PURE__ */ o(I.Icon, { asChild: !0, children: /* @__PURE__ */ o(tt, { className: "richtext-h-4 richtext-w-4 richtext-opacity-50" }) })
319
+ /* @__PURE__ */ r(I.Icon, { asChild: !0, children: /* @__PURE__ */ r(tt, { className: "richtext-h-4 richtext-w-4 richtext-opacity-50" }) })
320
320
  ]
321
321
  }
322
322
  ));
323
323
  qt.displayName = I.Trigger.displayName;
324
- const Kt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
324
+ const Kt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
325
325
  I.ScrollUpButton,
326
326
  {
327
327
  ref: n,
@@ -330,11 +330,11 @@ const Kt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
330
330
  e
331
331
  ),
332
332
  ...t,
333
- children: /* @__PURE__ */ o(Wn, { className: "richtext-h-4 richtext-w-4" })
333
+ children: /* @__PURE__ */ r(Wn, { className: "richtext-h-4 richtext-w-4" })
334
334
  }
335
335
  ));
336
336
  Kt.displayName = I.ScrollUpButton.displayName;
337
- const Wt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
337
+ const Wt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
338
338
  I.ScrollDownButton,
339
339
  {
340
340
  ref: n,
@@ -343,11 +343,11 @@ const Wt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
343
343
  e
344
344
  ),
345
345
  ...t,
346
- children: /* @__PURE__ */ o(tt, { className: "richtext-h-4 richtext-w-4" })
346
+ children: /* @__PURE__ */ r(tt, { className: "richtext-h-4 richtext-w-4" })
347
347
  }
348
348
  ));
349
349
  Wt.displayName = I.ScrollDownButton.displayName;
350
- const Gt = V.forwardRef(({ className: e, children: t, position: n = "popper", ...i }, a) => /* @__PURE__ */ o(I.Portal, { children: /* @__PURE__ */ f(
350
+ const Gt = V.forwardRef(({ className: e, children: t, position: n = "popper", ...i }, a) => /* @__PURE__ */ r(I.Portal, { children: /* @__PURE__ */ g(
351
351
  I.Content,
352
352
  {
353
353
  ref: a,
@@ -359,8 +359,8 @@ const Gt = V.forwardRef(({ className: e, children: t, position: n = "popper", ..
359
359
  position: n,
360
360
  ...i,
361
361
  children: [
362
- /* @__PURE__ */ o(Kt, {}),
363
- /* @__PURE__ */ o(
362
+ /* @__PURE__ */ r(Kt, {}),
363
+ /* @__PURE__ */ r(
364
364
  I.Viewport,
365
365
  {
366
366
  className: E(
@@ -370,12 +370,12 @@ const Gt = V.forwardRef(({ className: e, children: t, position: n = "popper", ..
370
370
  children: t
371
371
  }
372
372
  ),
373
- /* @__PURE__ */ o(Wt, {})
373
+ /* @__PURE__ */ r(Wt, {})
374
374
  ]
375
375
  }
376
376
  ) }));
377
377
  Gt.displayName = I.Content.displayName;
378
- const qi = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
378
+ const qi = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
379
379
  I.Label,
380
380
  {
381
381
  ref: n,
@@ -384,7 +384,7 @@ const qi = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
384
384
  }
385
385
  ));
386
386
  qi.displayName = I.Label.displayName;
387
- const Xe = V.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ f(
387
+ const Xe = V.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__ */ g(
388
388
  I.Item,
389
389
  {
390
390
  ref: i,
@@ -394,13 +394,13 @@ const Xe = V.forwardRef(({ className: e, children: t, ...n }, i) => /* @__PURE__
394
394
  ),
395
395
  ...n,
396
396
  children: [
397
- /* @__PURE__ */ o("span", { className: "richtext-absolute richtext-left-2 richtext-flex richtext-h-3.5 richtext-w-3.5 richtext-items-center richtext-justify-center", children: /* @__PURE__ */ o(I.ItemIndicator, { children: /* @__PURE__ */ o(Pt, { className: "richtext-h-4 richtext-w-4" }) }) }),
398
- /* @__PURE__ */ o(I.ItemText, { children: t })
397
+ /* @__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(I.ItemIndicator, { children: /* @__PURE__ */ r(Pt, { className: "richtext-h-4 richtext-w-4" }) }) }),
398
+ /* @__PURE__ */ r(I.ItemText, { children: t })
399
399
  ]
400
400
  }
401
401
  ));
402
402
  Xe.displayName = I.Item.displayName;
403
- const Ki = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
403
+ const Ki = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
404
404
  I.Separator,
405
405
  {
406
406
  ref: n,
@@ -430,33 +430,33 @@ const Gi = "_wrap_134f4_1", Xi = "_maxHeight_134f4_10", Yi = "_btnCopy_134f4_13"
430
430
  copied: ta
431
431
  };
432
432
  function na({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }) {
433
- var h, m;
434
- const { isCopied: a, copyToClipboard: r } = Wi(), s = R(() => {
433
+ var m, h;
434
+ const { isCopied: a, copyToClipboard: o } = Wi(), s = R(() => {
435
435
  var b;
436
436
  return (b = i.options.languages) != null && b.length ? i.options.languages : jt;
437
- }, [i.options.languages]), c = at(), l = (m = (h = e == null ? void 0 : e.options) == null ? void 0 : h.editorProps) == null ? void 0 : m.print, { language: u } = t, d = X(null), g = j(() => oi(ia.name, e), [e]);
438
- return /* @__PURE__ */ f(he, { className: U(Z.wrap, !l && Z.maxHeight, "render-wrapper"), children: [
439
- /* @__PURE__ */ f(
437
+ }, [i.options.languages]), c = at(), l = (h = (m = e == null ? void 0 : e.options) == null ? void 0 : m.editorProps) == null ? void 0 : h.print, { language: u } = t, d = X(null), f = j(() => oi(ia.name, e), [e]);
438
+ return /* @__PURE__ */ g(he, { className: U(Z.wrap, !l && Z.maxHeight, "render-wrapper"), children: [
439
+ /* @__PURE__ */ g(
440
440
  "div",
441
441
  {
442
442
  className: U(Z.blockInfo, {
443
443
  [Z.blockInfoEditable]: !c
444
444
  }),
445
445
  children: [
446
- /* @__PURE__ */ o(
446
+ /* @__PURE__ */ r(
447
447
  "span",
448
448
  {
449
449
  className: U(Z.btnCopy, a && Z.copied),
450
- onClick: () => r(d.current.innerText),
451
- children: a ? /* @__PURE__ */ o(Xn, { size: 16 }) : /* @__PURE__ */ o(Gn, { size: 16 })
450
+ onClick: () => o(d.current.innerText),
451
+ children: a ? /* @__PURE__ */ r(Xn, { size: 16 }) : /* @__PURE__ */ r(Gn, { size: 16 })
452
452
  }
453
453
  ),
454
- /* @__PURE__ */ o(
454
+ /* @__PURE__ */ r(
455
455
  "span",
456
456
  {
457
457
  className: Z.btnDelete,
458
- onClick: g,
459
- children: /* @__PURE__ */ o(
458
+ onClick: f,
459
+ children: /* @__PURE__ */ r(
460
460
  D,
461
461
  {
462
462
  name: "Trash2"
@@ -464,17 +464,17 @@ function na({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }
464
464
  )
465
465
  }
466
466
  ),
467
- /* @__PURE__ */ o("div", { className: Z.selectLang, children: /* @__PURE__ */ f(
467
+ /* @__PURE__ */ r("div", { className: Z.selectLang, children: /* @__PURE__ */ g(
468
468
  Ui,
469
469
  {
470
470
  defaultValue: u || "auto",
471
471
  disabled: !c,
472
472
  onValueChange: (b) => n({ language: b }),
473
473
  children: [
474
- /* @__PURE__ */ o(qt, { children: /* @__PURE__ */ o(Vi, { placeholder: "Language" }) }),
475
- /* @__PURE__ */ f(Gt, { className: "richtext-max-h-60 richtext-overflow-y-auto", children: [
476
- /* @__PURE__ */ o(Xe, { value: "auto", children: "Auto" }),
477
- s.map((b, x) => /* @__PURE__ */ o(
474
+ /* @__PURE__ */ r(qt, { children: /* @__PURE__ */ r(Vi, { placeholder: "Language" }) }),
475
+ /* @__PURE__ */ g(Gt, { className: "richtext-max-h-60 richtext-overflow-y-auto", children: [
476
+ /* @__PURE__ */ r(Xe, { value: "auto", children: "Auto" }),
477
+ s.map((b, x) => /* @__PURE__ */ r(
478
478
  Xe,
479
479
  {
480
480
  value: b,
@@ -489,7 +489,7 @@ function na({ editor: e, node: { attrs: t }, updateAttributes: n, extension: i }
489
489
  ]
490
490
  }
491
491
  ),
492
- /* @__PURE__ */ o("pre", { ref: d, children: /* @__PURE__ */ o(cn, { as: "code" }) })
492
+ /* @__PURE__ */ r("pre", { ref: d, children: /* @__PURE__ */ r(cn, { as: "code" }) })
493
493
  ] });
494
494
  }
495
495
  const ia = ln.extend({
@@ -499,8 +499,8 @@ const ia = ln.extend({
499
499
  ...(e = this.parent) == null ? void 0 : e.call(this),
500
500
  languages: [],
501
501
  button: ({ editor: t, t: n, extension: i }) => {
502
- var r, s, c;
503
- const a = (s = (r = i == null ? void 0 : i.options) == null ? void 0 : r.languages) != null && s.length ? (c = i == null ? void 0 : i.options) == null ? void 0 : c.languages : jt;
502
+ var o, s, c;
503
+ 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 : jt;
504
504
  return {
505
505
  component: Fi,
506
506
  componentProps: {
@@ -533,7 +533,7 @@ const ia = ln.extend({
533
533
  }
534
534
  });
535
535
  function aa(e) {
536
- var a, r, s;
536
+ var a, o, s;
537
537
  const { t, lang: n } = B(), i = R(() => {
538
538
  var u;
539
539
  const c = (u = e == null ? void 0 : e.items) == null ? void 0 : u.find((d) => d.isActive());
@@ -547,32 +547,32 @@ function aa(e) {
547
547
  action: () => e.editor.chain().focus().unsetFontFamily().run()
548
548
  };
549
549
  }, [t, n, e]);
550
- return /* @__PURE__ */ f(re, { children: [
551
- /* @__PURE__ */ o(
550
+ return /* @__PURE__ */ g(re, { children: [
551
+ /* @__PURE__ */ r(
552
552
  se,
553
553
  {
554
554
  asChild: !0,
555
555
  disabled: e == null ? void 0 : e.disabled,
556
- children: /* @__PURE__ */ o(
556
+ children: /* @__PURE__ */ r(
557
557
  mt,
558
558
  {
559
559
  disabled: e == null ? void 0 : e.disabled,
560
560
  icon: "MenuDown",
561
- title: ((a = i == null ? void 0 : i.font) == null ? void 0 : a.length) > 7 ? `${(r = i == null ? void 0 : i.font) == null ? void 0 : r.slice(0, 6)}...` : i == null ? void 0 : i.font,
561
+ 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,
562
562
  tooltip: e == null ? void 0 : e.tooltip
563
563
  }
564
564
  )
565
565
  }
566
566
  ),
567
- /* @__PURE__ */ o(ce, { className: "richtext-w-full", children: (s = e == null ? void 0 : e.items) == null ? void 0 : s.map((c, l) => {
567
+ /* @__PURE__ */ r(ce, { className: "richtext-w-full", children: (s = e == null ? void 0 : e.items) == null ? void 0 : s.map((c, l) => {
568
568
  const u = c.font === t("editor.fontFamily.default.tooltip") ? {} : { fontFamily: c.font };
569
- return /* @__PURE__ */ f(Je, { children: [
570
- /* @__PURE__ */ o(
569
+ return /* @__PURE__ */ g(Je, { children: [
570
+ /* @__PURE__ */ r(
571
571
  be,
572
572
  {
573
573
  checked: (i == null ? void 0 : i.font) === c.font,
574
574
  onClick: c.action,
575
- children: /* @__PURE__ */ o(
575
+ children: /* @__PURE__ */ r(
576
576
  "div",
577
577
  {
578
578
  className: "richtext-ml-1 richtext-h-full",
@@ -582,7 +582,7 @@ function aa(e) {
582
582
  )
583
583
  }
584
584
  ),
585
- c.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ o(Dt, {})
585
+ c.font === t("editor.fontFamily.default.tooltip") && /* @__PURE__ */ r(Dt, {})
586
586
  ] }, `font-family-${l}`);
587
587
  }) })
588
588
  ] });
@@ -595,9 +595,9 @@ const gr = dn.extend({
595
595
  fontFamilyList: Ti,
596
596
  button({ editor: t, extension: n, t: i }) {
597
597
  var u;
598
- const { extensions: a = [] } = t.extensionManager ?? [], r = We(((u = n == null ? void 0 : n.options) == null ? void 0 : u.fontFamilyList) || []), s = a.find(
598
+ const { extensions: a = [] } = t.extensionManager ?? [], o = We(((u = n == null ? void 0 : n.options) == null ? void 0 : u.fontFamilyList) || []), s = a.find(
599
599
  (d) => d.name === "base-kit"
600
- ), c = r.map((d) => ({
600
+ ), c = o.map((d) => ({
601
601
  action: () => {
602
602
  t.chain().focus().setFontFamily(d.value).run();
603
603
  },
@@ -630,8 +630,8 @@ const gr = dn.extend({
630
630
  function oa(e) {
631
631
  var n;
632
632
  const t = R(() => {
633
- var r;
634
- const i = (r = e == null ? void 0 : e.items) == null ? void 0 : r.find((s) => s.isActive());
633
+ var o;
634
+ const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
635
635
  return i && !i.default ? {
636
636
  ...i
637
637
  } : {
@@ -640,13 +640,13 @@ function oa(e) {
640
640
  isActive: () => !1
641
641
  };
642
642
  }, [e]);
643
- return /* @__PURE__ */ f(re, { children: [
644
- /* @__PURE__ */ o(
643
+ return /* @__PURE__ */ g(re, { children: [
644
+ /* @__PURE__ */ r(
645
645
  se,
646
646
  {
647
647
  asChild: !0,
648
648
  disabled: e == null ? void 0 : e.disabled,
649
- children: /* @__PURE__ */ o(
649
+ children: /* @__PURE__ */ r(
650
650
  mt,
651
651
  {
652
652
  disabled: e == null ? void 0 : e.disabled,
@@ -657,21 +657,21 @@ function oa(e) {
657
657
  )
658
658
  }
659
659
  ),
660
- /* @__PURE__ */ o(ce, { className: "richtext-w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
661
- var r, s;
662
- return /* @__PURE__ */ f(Je, { children: [
663
- /* @__PURE__ */ f(
660
+ /* @__PURE__ */ r(ce, { className: "richtext-w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
661
+ var o, s;
662
+ return /* @__PURE__ */ g(Je, { children: [
663
+ /* @__PURE__ */ g(
664
664
  be,
665
665
  {
666
666
  checked: (t == null ? void 0 : t.title) === i.title,
667
667
  onClick: i.action,
668
668
  children: [
669
- /* @__PURE__ */ o("div", { className: `heading- richtext-ml-1 richtext-h-full${i.level}`, children: i.title }),
670
- !!((r = i == null ? void 0 : i.shortcutKeys) != null && r.length) && /* @__PURE__ */ o(ri, { className: "richtext-pl-4", children: (s = i == null ? void 0 : i.shortcutKeys) == null ? void 0 : s.map((c) => ot(c)).join(" ") })
669
+ /* @__PURE__ */ r("div", { className: `heading- richtext-ml-1 richtext-h-full${i.level}`, children: i.title }),
670
+ !!((o = i == null ? void 0 : i.shortcutKeys) != null && o.length) && /* @__PURE__ */ r(ri, { className: "richtext-pl-4", children: (s = i == null ? void 0 : i.shortcutKeys) == null ? void 0 : s.map((c) => ot(c)).join(" ") })
671
671
  ]
672
672
  }
673
673
  ),
674
- i.level === 0 && /* @__PURE__ */ o(Dt, {})
674
+ i.level === 0 && /* @__PURE__ */ r(Dt, {})
675
675
  ] }, `heading-k-${a}`);
676
676
  }) })
677
677
  ] });
@@ -684,9 +684,9 @@ const _r = un.extend({
684
684
  levels: [1, 2, 3, 4, 5, 6],
685
685
  button({ editor: t, extension: n, t: i }) {
686
686
  var u;
687
- const { extensions: a = [] } = t.extensionManager ?? [], r = ((u = n.options) == null ? void 0 : u.levels) || [], s = a.find(
687
+ const { extensions: a = [] } = t.extensionManager ?? [], o = ((u = n.options) == null ? void 0 : u.levels) || [], s = a.find(
688
688
  (d) => d.name === "base-kit"
689
- ), c = r.map((d) => ({
689
+ ), c = o.map((d) => ({
690
690
  action: () => t.commands.toggleHeading({ level: d }),
691
691
  isActive: () => t.isActive("heading", { level: d }) || !1,
692
692
  disabled: !t.can().toggleHeading({ level: d }),
@@ -715,7 +715,7 @@ const _r = un.extend({
715
715
  }
716
716
  };
717
717
  }
718
- }), Xt = le.Root, ft = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
718
+ }), Xt = le.Root, ft = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
719
719
  le.List,
720
720
  {
721
721
  ref: n,
@@ -727,7 +727,7 @@ const _r = un.extend({
727
727
  }
728
728
  ));
729
729
  ft.displayName = le.List.displayName;
730
- const Ne = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
730
+ const Ne = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
731
731
  le.Trigger,
732
732
  {
733
733
  ref: n,
@@ -739,7 +739,7 @@ const Ne = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
739
739
  }
740
740
  ));
741
741
  Ne.displayName = le.Trigger.displayName;
742
- const Te = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
742
+ const Te = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
743
743
  le.Content,
744
744
  {
745
745
  ref: n,
@@ -751,7 +751,7 @@ const Te = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
751
751
  }
752
752
  ));
753
753
  Te.displayName = le.Content.displayName;
754
- const Yt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
754
+ const Yt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ r(
755
755
  Ge.Root,
756
756
  {
757
757
  ref: n,
@@ -760,11 +760,11 @@ const Yt = V.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ o(
760
760
  e
761
761
  ),
762
762
  ...t,
763
- children: /* @__PURE__ */ o(
763
+ children: /* @__PURE__ */ r(
764
764
  Ge.Indicator,
765
765
  {
766
766
  className: E("!richtext-flex !richtext-p-0 !richtext-items-center !richtext-justify-center !richtext-text-current"),
767
- children: /* @__PURE__ */ o(Pt, { className: "!richtext-h-4 !richtext-w-4" })
767
+ children: /* @__PURE__ */ r(Pt, { className: "!richtext-h-4 !richtext-w-4" })
768
768
  }
769
769
  )
770
770
  }
@@ -773,8 +773,8 @@ Yt.displayName = Ge.Root.displayName;
773
773
  function ra(e) {
774
774
  var n;
775
775
  const t = R(() => {
776
- var r;
777
- const i = (r = e == null ? void 0 : e.items) == null ? void 0 : r.find((s) => s.isActive());
776
+ var o;
777
+ const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
778
778
  return i && !i.default ? {
779
779
  ...i,
780
780
  icon: i.icon ? i.icon : e.icon
@@ -784,20 +784,20 @@ function ra(e) {
784
784
  isActive: () => !1
785
785
  };
786
786
  }, [e]);
787
- return /* @__PURE__ */ f(xe, { modal: !0, children: [
788
- /* @__PURE__ */ o(
787
+ return /* @__PURE__ */ g(xe, { modal: !0, children: [
788
+ /* @__PURE__ */ r(
789
789
  pe,
790
790
  {
791
791
  asChild: !0,
792
792
  disabled: e == null ? void 0 : e.disabled,
793
- children: /* @__PURE__ */ o(
793
+ children: /* @__PURE__ */ r(
794
794
  y,
795
795
  {
796
796
  customClass: "!richtext-w-12 richtext-h-12",
797
797
  disabled: e == null ? void 0 : e.disabled,
798
798
  icon: e == null ? void 0 : e.icon,
799
799
  tooltip: e == null ? void 0 : e.tooltip,
800
- children: /* @__PURE__ */ o(
800
+ children: /* @__PURE__ */ r(
801
801
  D,
802
802
  {
803
803
  className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
@@ -808,16 +808,16 @@ function ra(e) {
808
808
  )
809
809
  }
810
810
  ),
811
- /* @__PURE__ */ o(
811
+ /* @__PURE__ */ r(
812
812
  we,
813
813
  {
814
814
  align: "start",
815
815
  className: "richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",
816
816
  side: "bottom",
817
817
  children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
818
- var r, s;
819
- return /* @__PURE__ */ f(Be, { children: [
820
- /* @__PURE__ */ o($e, { asChild: !0, children: /* @__PURE__ */ o(
818
+ var o, s;
819
+ return /* @__PURE__ */ g(Be, { children: [
820
+ /* @__PURE__ */ r($e, { asChild: !0, children: /* @__PURE__ */ r(
821
821
  rt,
822
822
  {
823
823
  className: "richtext-size-7 richtext-p-1",
@@ -825,12 +825,12 @@ function ra(e) {
825
825
  onClick: i == null ? void 0 : i.action,
826
826
  pressed: t.title === i.title,
827
827
  size: "sm",
828
- children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ o(D, { name: i.icon })
828
+ children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ r(D, { name: i.icon })
829
829
  }
830
830
  ) }),
831
- /* @__PURE__ */ f(Fe, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
832
- /* @__PURE__ */ o("span", { children: i.title }),
833
- !!((r = i.shortcutKeys) != null && r.length) && /* @__PURE__ */ o("span", { children: (s = i.shortcutKeys) == null ? void 0 : s.map((c) => ot(c)).join(" ") })
831
+ /* @__PURE__ */ g(Fe, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
832
+ /* @__PURE__ */ r("span", { children: i.title }),
833
+ !!((o = i.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: (s = i.shortcutKeys) == null ? void 0 : s.map((c) => ot(c)).join(" ") })
834
834
  ] })
835
835
  ] }, `text-align-${a}`);
836
836
  })
@@ -850,7 +850,7 @@ const br = hn.extend({
850
850
  t: i
851
851
  }) {
852
852
  var u;
853
- const a = ((u = n.options) == null ? void 0 : u.alignments) || [], r = {
853
+ const a = ((u = n.options) == null ? void 0 : u.alignments) || [], o = {
854
854
  left: ["mod", "Shift", "L"],
855
855
  center: ["mod", "Shift", "E"],
856
856
  right: ["mod", "Shift", "R"],
@@ -861,17 +861,17 @@ const br = hn.extend({
861
861
  right: "AlignRight",
862
862
  justify: "AlignJustify"
863
863
  }, c = a.map((d) => {
864
- var g, h, m;
864
+ var f, m, h;
865
865
  return {
866
866
  title: i(`editor.textalign.${d}.tooltip`),
867
867
  icon: s[d],
868
- shortcutKeys: r[d],
868
+ shortcutKeys: o[d],
869
869
  isActive: () => t.isActive({ textAlign: d }) || !1,
870
870
  action: () => {
871
871
  var b, x;
872
872
  return (x = (b = t.commands) == null ? void 0 : b.setTextAlign) == null ? void 0 : x.call(b, d);
873
873
  },
874
- disabled: !((m = (h = (g = t == null ? void 0 : t.can) == null ? void 0 : g.call(t)) == null ? void 0 : h.setTextAlign) != null && m.call(h, d))
874
+ disabled: !((h = (m = (f = t == null ? void 0 : t.can) == null ? void 0 : f.call(t)) == null ? void 0 : m.setTextAlign) != null && h.call(m, d))
875
875
  };
876
876
  }), l = c.filter((d) => d.disabled).length === c.length;
877
877
  return {
@@ -896,13 +896,13 @@ function sa(e) {
896
896
  isActive: () => !1
897
897
  };
898
898
  }, [e]);
899
- return /* @__PURE__ */ f(re, { children: [
900
- /* @__PURE__ */ o(
899
+ return /* @__PURE__ */ g(re, { children: [
900
+ /* @__PURE__ */ r(
901
901
  se,
902
902
  {
903
903
  asChild: !0,
904
904
  disabled: e == null ? void 0 : e.disabled,
905
- children: /* @__PURE__ */ o(
905
+ children: /* @__PURE__ */ r(
906
906
  mt,
907
907
  {
908
908
  disabled: e == null ? void 0 : e.disabled,
@@ -913,14 +913,14 @@ function sa(e) {
913
913
  )
914
914
  }
915
915
  ),
916
- /* @__PURE__ */ o(ce, { className: "richtext-max-h-96 richtext-w-32 richtext-overflow-y-auto", children: (i = e == null ? void 0 : e.items) == null ? void 0 : i.map((a, r) => /* @__PURE__ */ o(
916
+ /* @__PURE__ */ r(ce, { 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(
917
917
  be,
918
918
  {
919
919
  checked: n.title === a.title,
920
920
  onClick: a.action,
921
- children: /* @__PURE__ */ o("div", { className: "richtext-ml-1 richtext-h-full", children: a.title })
921
+ children: /* @__PURE__ */ r("div", { className: "richtext-ml-1 richtext-h-full", children: a.title })
922
922
  },
923
- `font-size-${r}`
923
+ `font-size-${o}`
924
924
  )) })
925
925
  ] });
926
926
  }
@@ -934,22 +934,22 @@ const xr = H.create({
934
934
  fontSizes: [...Ai],
935
935
  button({ editor: t, extension: n, t: i }) {
936
936
  var l;
937
- const a = We(((l = n.options) == null ? void 0 : l.fontSizes) || pt), r = We([pt])[0], s = a.map((u) => ({
938
- title: u.value === r.value ? i("editor.fontSize.default.tooltip") : String(u.name),
937
+ const a = We(((l = n.options) == null ? void 0 : l.fontSizes) || pt), o = We([pt])[0], s = a.map((u) => ({
938
+ title: u.value === o.value ? i("editor.fontSize.default.tooltip") : String(u.name),
939
939
  isActive: () => {
940
940
  const { fontSize: d } = t.getAttributes("textStyle");
941
- return u.value === r.value && d === void 0 ? !0 : t.isActive({ fontSize: String(u.value) }) || !1;
941
+ return u.value === o.value && d === void 0 ? !0 : t.isActive({ fontSize: String(u.value) }) || !1;
942
942
  },
943
943
  action: () => {
944
- if (u.value === r.value) {
944
+ if (u.value === o.value) {
945
945
  t.commands.unsetFontSize();
946
946
  return;
947
947
  }
948
948
  t.commands.setFontSize(String(u.value));
949
949
  },
950
950
  disabled: !t.can().setFontSize(String(u.value)),
951
- divider: u.value === r.value || !1,
952
- default: u.value === r.value || !1
951
+ divider: u.value === o.value || !1,
952
+ default: u.value === o.value || !1
953
953
  })), c = s.filter((u) => u.disabled).length === s.length;
954
954
  return {
955
955
  component: sa,
@@ -988,7 +988,7 @@ const xr = H.create({
988
988
  }
989
989
  });
990
990
  function ca({ fill: e }) {
991
- return /* @__PURE__ */ o(
991
+ return /* @__PURE__ */ r(
992
992
  "svg",
993
993
  {
994
994
  width: "18px",
@@ -996,8 +996,8 @@ function ca({ fill: e }) {
996
996
  viewBox: "0 0 240 240",
997
997
  version: "1.1",
998
998
  xmlns: "http://www.w3.org/2000/svg",
999
- children: /* @__PURE__ */ o("g", { stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ o("g", { transform: "translate(0.000000, 0.500000)", children: /* @__PURE__ */ f("g", { transform: "translate(39.000000, 17.353553)", children: [
1000
- /* @__PURE__ */ o(
999
+ children: /* @__PURE__ */ r("g", { stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd", children: /* @__PURE__ */ r("g", { transform: "translate(0.000000, 0.500000)", children: /* @__PURE__ */ g("g", { transform: "translate(39.000000, 17.353553)", children: [
1000
+ /* @__PURE__ */ r(
1001
1001
  "path",
1002
1002
  {
1003
1003
  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",
@@ -1006,7 +1006,7 @@ function ca({ fill: e }) {
1006
1006
  fillRule: "evenodd"
1007
1007
  }
1008
1008
  ),
1009
- /* @__PURE__ */ o(
1009
+ /* @__PURE__ */ r(
1010
1010
  "path",
1011
1011
  {
1012
1012
  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",
@@ -1015,7 +1015,7 @@ function ca({ fill: e }) {
1015
1015
  fillRule: "nonzero"
1016
1016
  }
1017
1017
  ),
1018
- /* @__PURE__ */ o(
1018
+ /* @__PURE__ */ r(
1019
1019
  "path",
1020
1020
  {
1021
1021
  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",
@@ -1038,24 +1038,24 @@ function la(e) {
1038
1038
  var s;
1039
1039
  (s = e.action) == null || s.call(e, t);
1040
1040
  }
1041
- const r = j(
1041
+ const o = j(
1042
1042
  $n((s) => {
1043
1043
  n(s);
1044
1044
  }, 350),
1045
1045
  []
1046
1046
  );
1047
- return /* @__PURE__ */ f("div", { className: "richtext-flex richtext-items-center richtext-h-[32px]", children: [
1048
- /* @__PURE__ */ o(y, { tooltip: e == null ? void 0 : e.tooltip, disabled: e == null ? void 0 : e.disabled, action: a, children: /* @__PURE__ */ o("span", { className: "richtext-flex richtext-items-center richtext-justify-center richtext-text-sm", children: /* @__PURE__ */ o(ca, { fill: t }) }) }),
1049
- /* @__PURE__ */ o(
1047
+ return /* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-h-[32px]", children: [
1048
+ /* @__PURE__ */ r(y, { 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(ca, { fill: t }) }) }),
1049
+ /* @__PURE__ */ r(
1050
1050
  si,
1051
1051
  {
1052
1052
  selectedColor: t,
1053
- setSelectedColor: r,
1053
+ setSelectedColor: o,
1054
1054
  onChange: i,
1055
1055
  disabled: e == null ? void 0 : e.disabled,
1056
1056
  colors: e == null ? void 0 : e.colors,
1057
1057
  defaultColor: e == null ? void 0 : e.defaultColor,
1058
- children: /* @__PURE__ */ o(O, { variant: "ghost", size: "icon", className: "r!ichtext-h-[32px] !richtext-w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ o(D, { className: "!richtext-w-3 !richtext-h-3 richtext-text-zinc-500", name: "MenuDown" }) })
1058
+ children: /* @__PURE__ */ r(O, { variant: "ghost", size: "icon", className: "r!ichtext-h-[32px] !richtext-w-3", disabled: e == null ? void 0 : e.disabled, children: /* @__PURE__ */ r(D, { className: "!richtext-w-3 !richtext-h-3 richtext-text-zinc-500", name: "MenuDown" }) })
1059
1059
  }
1060
1060
  )
1061
1061
  ] });
@@ -1213,20 +1213,20 @@ const pr = mn.extend({
1213
1213
  });
1214
1214
  function da(e) {
1215
1215
  const [t, n] = k(!1);
1216
- function i(a, r, s) {
1217
- e.action && (e.action({ link: a, text: r, openInNewTab: s }), n(!1));
1216
+ function i(a, o, s) {
1217
+ e.action && (e.action({ link: a, text: o, openInNewTab: s }), n(!1));
1218
1218
  }
1219
- return /* @__PURE__ */ f(xe, { modal: !0, open: t, onOpenChange: n, children: [
1220
- /* @__PURE__ */ o(pe, { disabled: e == null ? void 0 : e.disabled, asChild: !0, children: /* @__PURE__ */ o(
1219
+ return /* @__PURE__ */ g(xe, { modal: !0, open: t, onOpenChange: n, children: [
1220
+ /* @__PURE__ */ r(pe, { disabled: e == null ? void 0 : e.disabled, asChild: !0, children: /* @__PURE__ */ r(
1221
1221
  y,
1222
1222
  {
1223
1223
  tooltip: e == null ? void 0 : e.tooltip,
1224
1224
  isActive: e == null ? void 0 : e.isActive,
1225
1225
  disabled: e == null ? void 0 : e.disabled,
1226
- children: /* @__PURE__ */ o(D, { name: e == null ? void 0 : e.icon })
1226
+ children: /* @__PURE__ */ r(D, { name: e == null ? void 0 : e.icon })
1227
1227
  }
1228
1228
  ) }),
1229
- /* @__PURE__ */ o(we, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ o(li, { editor: e.editor, onSetLink: i }) })
1229
+ /* @__PURE__ */ r(we, { hideWhenDetached: !0, className: "richtext-w-full", align: "start", side: "bottom", children: /* @__PURE__ */ r(li, { editor: e.editor, onSetLink: i }) })
1230
1230
  ] });
1231
1231
  }
1232
1232
  const Tr = wn.extend({
@@ -1257,10 +1257,10 @@ const Tr = wn.extend({
1257
1257
  componentProps: {
1258
1258
  editor: t,
1259
1259
  action: (i) => {
1260
- const { link: a, text: r, openInNewTab: s } = i;
1260
+ const { link: a, text: o, openInNewTab: s } = i;
1261
1261
  t.chain().extendMarkRange("link").insertContent({
1262
1262
  type: "text",
1263
- text: r,
1263
+ text: o,
1264
1264
  marks: [
1265
1265
  {
1266
1266
  type: "link",
@@ -1286,10 +1286,10 @@ const Tr = wn.extend({
1286
1286
  new J({
1287
1287
  props: {
1288
1288
  handleClick: (e, t) => {
1289
- const { schema: n, doc: i, tr: a } = e.state, r = yn(i.resolve(t), n.marks.link);
1290
- if (!r)
1289
+ const { schema: n, doc: i, tr: a } = e.state, o = yn(i.resolve(t), n.marks.link);
1290
+ if (!o)
1291
1291
  return !1;
1292
- const s = i.resolve(r.from), c = i.resolve(r.to), l = a.setSelection(new Ht(s, c));
1292
+ const s = i.resolve(o.from), c = i.resolve(o.to), l = a.setSelection(new Ht(s, c));
1293
1293
  e.dispatch(l);
1294
1294
  }
1295
1295
  }
@@ -1340,27 +1340,27 @@ function ua(e) {
1340
1340
  // loading = false,
1341
1341
  // shortcutKeys = undefined,
1342
1342
  tooltipOptions: a = {},
1343
- action: r = void 0,
1343
+ action: o = void 0,
1344
1344
  isActive: s = void 0,
1345
1345
  children: c
1346
1346
  } = e, l = nt[t];
1347
- return /* @__PURE__ */ f(Be, { children: [
1348
- /* @__PURE__ */ o($e, { asChild: !0, children: /* @__PURE__ */ f(
1347
+ return /* @__PURE__ */ g(Be, { children: [
1348
+ /* @__PURE__ */ r($e, { asChild: !0, children: /* @__PURE__ */ g(
1349
1349
  rt,
1350
1350
  {
1351
1351
  size: "sm",
1352
1352
  className: `richtext-w-[32px] richtext-h-[32px] ${i}`,
1353
1353
  disabled: s == null ? void 0 : s(),
1354
- onClick: r,
1354
+ onClick: o,
1355
1355
  children: [
1356
- l && /* @__PURE__ */ o(l, { className: "richtext-w-4 richtext-h-4" }),
1357
- c && /* @__PURE__ */ o(oe, { children: c })
1356
+ l && /* @__PURE__ */ r(l, { className: "richtext-w-4 richtext-h-4" }),
1357
+ c && /* @__PURE__ */ r(oe, { children: c })
1358
1358
  ]
1359
1359
  }
1360
1360
  ) }),
1361
- n && /* @__PURE__ */ o(Fe, { ...a, children: /* @__PURE__ */ f("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24", children: [
1362
- /* @__PURE__ */ o("div", { children: n }),
1363
- !!((u = e == null ? void 0 : e.shortcutKeys) != null && u.length) && /* @__PURE__ */ o("span", { children: it(e == null ? void 0 : e.shortcutKeys) })
1361
+ n && /* @__PURE__ */ r(Fe, { ...a, children: /* @__PURE__ */ g("div", { className: "richtext-flex richtext-flex-col richtext-items-center richtext-text-center richtext-max-w-24", children: [
1362
+ /* @__PURE__ */ r("div", { children: n }),
1363
+ !!((u = e == null ? void 0 : e.shortcutKeys) != null && u.length) && /* @__PURE__ */ r("span", { children: it(e == null ? void 0 : e.shortcutKeys) })
1364
1364
  ] }) })
1365
1365
  ] });
1366
1366
  }
@@ -1495,46 +1495,46 @@ function ga(e) {
1495
1495
  ], [e.editor, t]), i = R(() => n.findLast((a) => a.isActive()) ?? {
1496
1496
  label: "Empty"
1497
1497
  }, [n]);
1498
- return /* @__PURE__ */ f(re, { children: [
1499
- /* @__PURE__ */ o(se, { asChild: !0, children: /* @__PURE__ */ f(
1498
+ return /* @__PURE__ */ g(re, { children: [
1499
+ /* @__PURE__ */ r(se, { asChild: !0, children: /* @__PURE__ */ g(
1500
1500
  O,
1501
1501
  {
1502
1502
  className: "richtext-flex richtext-h-[32px] richtext-gap-1 richtext-px-1.5",
1503
1503
  variant: "ghost",
1504
1504
  children: [
1505
- /* @__PURE__ */ f("span", { className: "richtext-whitespace-nowrap richtext-text-sm richtext-font-normal", children: [
1505
+ /* @__PURE__ */ g("span", { className: "richtext-whitespace-nowrap richtext-text-sm richtext-font-normal", children: [
1506
1506
  " ",
1507
1507
  i == null ? void 0 : i.label
1508
1508
  ] }),
1509
- /* @__PURE__ */ o(tt, { className: "richtext-size-4" })
1509
+ /* @__PURE__ */ r(tt, { className: "richtext-size-4" })
1510
1510
  ]
1511
1511
  }
1512
1512
  ) }),
1513
- /* @__PURE__ */ o(
1513
+ /* @__PURE__ */ r(
1514
1514
  ce,
1515
1515
  {
1516
1516
  align: "start",
1517
1517
  className: "richtext-w-full richtext-p-1",
1518
1518
  hideWhenDetached: !0,
1519
1519
  sideOffset: 5,
1520
- children: n.map((a, r) => {
1520
+ children: n.map((a, o) => {
1521
1521
  var c;
1522
1522
  const s = nt[a.iconName];
1523
- return /* @__PURE__ */ o(
1523
+ return /* @__PURE__ */ r(
1524
1524
  be,
1525
1525
  {
1526
1526
  checked: ((c = a.isActive) == null ? void 0 : c.call(a)) || !1,
1527
1527
  className: "richtext-cursor-pointer",
1528
1528
  onClick: () => a.action(),
1529
- children: /* @__PURE__ */ f("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-px-2", children: [
1530
- /* @__PURE__ */ o(s, { className: "richtext-h3 richtext-w-3" }),
1531
- /* @__PURE__ */ f("span", { children: [
1529
+ children: /* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-gap-2 richtext-px-2", children: [
1530
+ /* @__PURE__ */ r(s, { className: "richtext-h3 richtext-w-3" }),
1531
+ /* @__PURE__ */ g("span", { children: [
1532
1532
  " ",
1533
1533
  a.label
1534
1534
  ] })
1535
1535
  ] })
1536
1536
  },
1537
- `text-bubble-${r}`
1537
+ `text-bubble-${o}`
1538
1538
  );
1539
1539
  })
1540
1540
  }
@@ -1572,7 +1572,7 @@ const ba = H.create({
1572
1572
  new J({
1573
1573
  key: e,
1574
1574
  appendTransaction: (n, i, a) => {
1575
- const { doc: r, tr: s, schema: c } = a, l = e.getState(a), u = r.content.size, d = c.nodes[this.options.node];
1575
+ const { doc: o, tr: s, schema: c } = a, l = e.getState(a), u = o.content.size, d = c.nodes[this.options.node];
1576
1576
  if (l)
1577
1577
  return s.insert(u, d.create());
1578
1578
  },
@@ -1598,8 +1598,8 @@ const ba = H.create({
1598
1598
  return this.options.document !== !1 && e.push(ma.configure()), this.options.placeholder !== !1 && e.push(
1599
1599
  Nn.configure({
1600
1600
  placeholder: ({ node: t, pos: n, editor: i }) => {
1601
- var a, r, s, c, l;
1602
- return ((a = t == null ? void 0 : t.type) == null ? void 0 : a.name) === "columns" || ((r = t == null ? void 0 : t.content) == null ? void 0 : r.size) !== 0 ? "" : ((s = t == null ? void 0 : t.type) == null ? void 0 : s.name) === "heading" ? `${z.t(`editor.heading.h${t.attrs.level}.tooltip`)}` : ((c = t == null ? void 0 : t.type) == null ? void 0 : c.name) === "codeBlock" || ((l = t == null ? void 0 : t.type) == null ? void 0 : l.name) === "table" ? "" : i.extensionManager.extensions.some((u) => u.name === "slashCommand") ? z.t("editor.slash") : n === 0 ? z.t("editor.content") : z.t("editor.content");
1601
+ var a, o, s, c, l;
1602
+ 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" ? `${z.t(`editor.heading.h${t.attrs.level}.tooltip`)}` : ((c = t == null ? void 0 : t.type) == null ? void 0 : c.name) === "codeBlock" || ((l = t == null ? void 0 : t.type) == null ? void 0 : l.name) === "table" ? "" : i.extensionManager.extensions.some((u) => u.name === "slashCommand") ? z.t("editor.slash") : n === 0 ? z.t("editor.content") : z.t("editor.content");
1603
1603
  },
1604
1604
  ...this.options.placeholder
1605
1605
  })
@@ -1623,7 +1623,7 @@ const ba = H.create({
1623
1623
  return {
1624
1624
  ...(e = this.parent) == null ? void 0 : e.call(this),
1625
1625
  button: ({ editor: t, extension: n, t: i }) => {
1626
- const a = n.options.subscript, r = n.options.superscript, s = {
1626
+ const a = n.options.subscript, o = n.options.superscript, s = {
1627
1627
  component: y,
1628
1628
  componentProps: {
1629
1629
  action: () => t.commands.toggleSubscript(),
@@ -1642,7 +1642,7 @@ const ba = H.create({
1642
1642
  tooltip: i("editor.superscript.tooltip")
1643
1643
  }
1644
1644
  }, l = [];
1645
- return a !== !1 && l.push(s), r !== !1 && l.push(c), l;
1645
+ return a !== !1 && l.push(s), o !== !1 && l.push(c), l;
1646
1646
  }
1647
1647
  };
1648
1648
  },
@@ -1654,8 +1654,8 @@ const ba = H.create({
1654
1654
  function xa(e) {
1655
1655
  var n;
1656
1656
  const t = R(() => {
1657
- var r;
1658
- const i = (r = e == null ? void 0 : e.items) == null ? void 0 : r.find((s) => s.isActive());
1657
+ var o;
1658
+ const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
1659
1659
  return i && !i.default ? {
1660
1660
  ...i,
1661
1661
  icon: i != null && i.icon ? i == null ? void 0 : i.icon : e == null ? void 0 : e.icon
@@ -1665,34 +1665,34 @@ function xa(e) {
1665
1665
  isActive: () => !1
1666
1666
  };
1667
1667
  }, [e]);
1668
- return /* @__PURE__ */ f(re, { children: [
1669
- /* @__PURE__ */ o(
1668
+ return /* @__PURE__ */ g(re, { children: [
1669
+ /* @__PURE__ */ r(
1670
1670
  se,
1671
1671
  {
1672
1672
  asChild: !0,
1673
1673
  disabled: e == null ? void 0 : e.disabled,
1674
- children: /* @__PURE__ */ o(
1674
+ children: /* @__PURE__ */ r(
1675
1675
  y,
1676
1676
  {
1677
1677
  customClass: "!richtext-w-12 richtext-h-12",
1678
1678
  disabled: e == null ? void 0 : e.disabled,
1679
1679
  icon: e == null ? void 0 : e.icon,
1680
1680
  tooltip: e == null ? void 0 : e.tooltip,
1681
- children: /* @__PURE__ */ o(hi, { className: "richtext-size-3 richtext-text-gray-500" })
1681
+ children: /* @__PURE__ */ r(hi, { className: "richtext-size-3 richtext-text-gray-500" })
1682
1682
  }
1683
1683
  )
1684
1684
  }
1685
1685
  ),
1686
- /* @__PURE__ */ o(ce, { className: "w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => /* @__PURE__ */ f(
1686
+ /* @__PURE__ */ r(ce, { className: "w-full", children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => /* @__PURE__ */ g(
1687
1687
  be,
1688
1688
  {
1689
1689
  checked: t.title === i.title,
1690
1690
  className: "richtext-flex richtext-items-center richtext-gap-3",
1691
1691
  onClick: i.action,
1692
1692
  children: [
1693
- /* @__PURE__ */ o(D, { name: i == null ? void 0 : i.icon }),
1694
- /* @__PURE__ */ o("span", { className: "richtext-ml-1", children: i.title }),
1695
- !!(i != null && i.shortcutKeys) && /* @__PURE__ */ o("span", { className: "richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", children: it(i.shortcutKeys) })
1693
+ /* @__PURE__ */ r(D, { name: i == null ? void 0 : i.icon }),
1694
+ /* @__PURE__ */ r("span", { className: "richtext-ml-1", children: i.title }),
1695
+ !!(i != null && i.shortcutKeys) && /* @__PURE__ */ r("span", { className: "richtext-ml-auto richtext-text-xs richtext-tracking-widest richtext-opacity-60", children: it(i.shortcutKeys) })
1696
1696
  ]
1697
1697
  },
1698
1698
  `more-mark-${a}`
@@ -1706,7 +1706,7 @@ const Er = H.create({
1706
1706
  return {
1707
1707
  ...(e = this.parent) == null ? void 0 : e.call(this),
1708
1708
  button({ editor: t, extension: n, t: i }) {
1709
- const a = n.options.subscript, r = n.options.superscript, s = {
1709
+ const a = n.options.subscript, o = n.options.superscript, s = {
1710
1710
  action: () => t.commands.toggleSubscript(),
1711
1711
  isActive: () => t.isActive("subscript") || !1,
1712
1712
  disabled: !t.can().toggleSubscript(),
@@ -1721,7 +1721,7 @@ const Er = H.create({
1721
1721
  title: i("editor.superscript.tooltip"),
1722
1722
  shortcutKeys: ["mod", ","]
1723
1723
  }, l = [];
1724
- return a !== !1 && l.push(s), r !== !1 && l.push(c), {
1724
+ return a !== !1 && l.push(s), o !== !1 && l.push(c), {
1725
1725
  component: xa,
1726
1726
  componentProps: {
1727
1727
  icon: "Type",
@@ -1818,7 +1818,7 @@ function wa(e) {
1818
1818
  function a(s) {
1819
1819
  s === "default" ? e.editor.commands.unsetLineHeight() : e.editor.commands.setLineHeight(s), i(s);
1820
1820
  }
1821
- const r = R(() => {
1821
+ const o = R(() => {
1822
1822
  const l = e.editor.extensionManager.extensions.find(
1823
1823
  (u) => u.name === "lineHeight"
1824
1824
  ).options.lineHeights.map((u) => ({
@@ -1830,20 +1830,20 @@ function wa(e) {
1830
1830
  value: "default"
1831
1831
  }), l;
1832
1832
  }, [e]);
1833
- return /* @__PURE__ */ f(re, { children: [
1834
- /* @__PURE__ */ o(
1833
+ return /* @__PURE__ */ g(re, { children: [
1834
+ /* @__PURE__ */ r(
1835
1835
  se,
1836
1836
  {
1837
1837
  asChild: !0,
1838
1838
  disabled: e == null ? void 0 : e.disabled,
1839
- children: /* @__PURE__ */ o(
1839
+ children: /* @__PURE__ */ r(
1840
1840
  y,
1841
1841
  {
1842
1842
  customClass: "!richtext-w-12 richtext-h-12",
1843
1843
  disabled: e == null ? void 0 : e.disabled,
1844
1844
  icon: "LineHeight",
1845
1845
  tooltip: e == null ? void 0 : e.tooltip,
1846
- children: /* @__PURE__ */ o(
1846
+ children: /* @__PURE__ */ r(
1847
1847
  D,
1848
1848
  {
1849
1849
  className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
@@ -1854,7 +1854,7 @@ function wa(e) {
1854
1854
  )
1855
1855
  }
1856
1856
  ),
1857
- /* @__PURE__ */ o(ce, { className: "richtext-min-w-24", children: r == null ? void 0 : r.map((s, c) => /* @__PURE__ */ o(
1857
+ /* @__PURE__ */ r(ce, { className: "richtext-min-w-24", children: o == null ? void 0 : o.map((s, c) => /* @__PURE__ */ r(
1858
1858
  be,
1859
1859
  {
1860
1860
  checked: s.value === n,
@@ -1870,8 +1870,8 @@ function va(e, t) {
1870
1870
  const { selection: n, doc: i } = e;
1871
1871
  if (!n || !i || !(n instanceof Ht || n instanceof Fn))
1872
1872
  return e;
1873
- const { from: a, to: r } = n, s = [], c = t && t !== Bt ? t : null;
1874
- if (i.nodesBetween(a, r, (l, u) => {
1873
+ const { from: a, to: o } = n, s = [], c = t && t !== Bt ? t : null;
1874
+ if (i.nodesBetween(a, o, (l, u) => {
1875
1875
  const d = l.type;
1876
1876
  return ya.includes(d.name) ? ((l.attrs.lineHeight || null) !== c && s.push({
1877
1877
  node: l,
@@ -1881,12 +1881,12 @@ function va(e, t) {
1881
1881
  }), s.length === 0)
1882
1882
  return e;
1883
1883
  for (const l of s) {
1884
- const { node: u, pos: d, nodeType: g } = l;
1885
- let { attrs: h } = u;
1886
- h = {
1887
- ...h,
1884
+ const { node: u, pos: d, nodeType: f } = l;
1885
+ let { attrs: m } = u;
1886
+ m = {
1887
+ ...m,
1888
1888
  lineHeight: c
1889
- }, e = e.setNodeMarkup(d, g, h, u.marks);
1889
+ }, e = e.setNodeMarkup(d, f, m, u.marks);
1890
1890
  }
1891
1891
  return e;
1892
1892
  }
@@ -1974,8 +1974,8 @@ function Ta(e) {
1974
1974
  label: z.t(`editor.heading.h${i}.tooltip`),
1975
1975
  aliases: [`h${i}`, "bt", `bt${i}`],
1976
1976
  iconName: `Heading${i}`,
1977
- action: ({ editor: a, range: r }) => {
1978
- a.chain().focus().deleteRange(r).setHeading({ level: i }).run();
1977
+ action: ({ editor: a, range: o }) => {
1978
+ a.chain().focus().deleteRange(o).setHeading({ level: i }).run();
1979
1979
  }
1980
1980
  });
1981
1981
  }), n.name.toLowerCase() === "bulletlist" && t[0].commands.push({
@@ -2072,59 +2072,59 @@ function Ta(e) {
2072
2072
  }), t;
2073
2073
  }
2074
2074
  function Aa(e, t) {
2075
- var N, L;
2076
- const [n, i] = k(0), [a, r] = k(0), s = X(null), { t: c } = B(), l = X([]);
2075
+ var N, S;
2076
+ const [n, i] = k(0), [a, o] = k(0), s = X(null), { t: c } = B(), l = X([]);
2077
2077
  et(t, () => ({
2078
2078
  onKeyDown: u
2079
2079
  })), P(() => {
2080
2080
  if (!s.current)
2081
2081
  return;
2082
- const w = a * 1e3 + n, _ = l.current[w];
2082
+ const p = a * 1e3 + n, _ = l.current[p];
2083
2083
  _ && _.scrollIntoView({
2084
2084
  behavior: "smooth",
2085
2085
  block: "nearest"
2086
2086
  });
2087
2087
  }, [n, a]);
2088
- function u({ event: w }) {
2089
- return w.key === "ArrowUp" ? (d(), !0) : w.key === "ArrowDown" ? (g(), !0) : w.key === "Enter" ? (h(), !0) : !1;
2088
+ function u({ event: p }) {
2089
+ return p.key === "ArrowUp" ? (d(), !0) : p.key === "ArrowDown" ? (f(), !0) : p.key === "Enter" ? (m(), !0) : !1;
2090
2090
  }
2091
2091
  function d() {
2092
- var p;
2092
+ var w;
2093
2093
  if (e.items.length === 0)
2094
2094
  return !1;
2095
- let w = n - 1, _ = a;
2096
- w < 0 && (_ = a - 1, w = ((p = e.items[_]) == null ? void 0 : p.commands.length) - 1 || 0), _ < 0 && (_ = e.items.length - 1, w = e.items[_].commands.length - 1), i(w), r(_);
2095
+ let p = n - 1, _ = a;
2096
+ p < 0 && (_ = a - 1, p = ((w = e.items[_]) == null ? void 0 : w.commands.length) - 1 || 0), _ < 0 && (_ = e.items.length - 1, p = e.items[_].commands.length - 1), i(p), o(_);
2097
2097
  }
2098
- function g() {
2098
+ function f() {
2099
2099
  if (e.items.length === 0)
2100
2100
  return !1;
2101
- const w = e.items[a].commands;
2102
- let _ = n + 1, p = a;
2103
- w.length - 1 < _ && (_ = 0, p = a + 1), e.items.length - 1 < p && (p = 0), i(_), r(p);
2101
+ const p = e.items[a].commands;
2102
+ let _ = n + 1, w = a;
2103
+ p.length - 1 < _ && (_ = 0, w = a + 1), e.items.length - 1 < w && (w = 0), i(_), o(w);
2104
2104
  }
2105
- function h() {
2105
+ function m() {
2106
2106
  if (e.items.length === 0 || a === -1 || n === -1)
2107
2107
  return !1;
2108
- m(a, n);
2108
+ h(a, n);
2109
2109
  }
2110
- function m(w, _) {
2111
- const p = e.items[w].commands[_];
2112
- e.command(p);
2110
+ function h(p, _) {
2111
+ const w = e.items[p].commands[_];
2112
+ e.command(w);
2113
2113
  }
2114
- function b(w, _) {
2115
- m(w, _);
2114
+ function b(p, _) {
2115
+ h(p, _);
2116
2116
  }
2117
- function x(w, _, p) {
2118
- l.current[w * 1e3 + _] = p;
2117
+ function x(p, _, w) {
2118
+ l.current[p * 1e3 + _] = w;
2119
2119
  }
2120
- return /* @__PURE__ */ o(
2120
+ return /* @__PURE__ */ r(
2121
2121
  "div",
2122
2122
  {
2123
2123
  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",
2124
2124
  ref: s,
2125
- children: (N = e == null ? void 0 : e.items) != null && N.length ? /* @__PURE__ */ o("div", { className: "richtext-grid richtext-min-w-48 richtext-grid-cols-1 richtext-gap-0.5", children: (L = e == null ? void 0 : e.items) == null ? void 0 : L.map((w, _) => /* @__PURE__ */ f(Je, { children: [
2126
- /* @__PURE__ */ o("div", { className: "richtext-col-[1/-1] richtext-mx-2 richtext-mt-2 richtext-select-none richtext-text-[0.65rem] richtext-font-semibold richtext-uppercase richtext-tracking-wider !richtext-text-neutral-500 first:richtext-mt-0.5", children: w.title }),
2127
- w.commands.map((p, C) => /* @__PURE__ */ f(
2125
+ children: (N = e == null ? void 0 : e.items) != null && N.length ? /* @__PURE__ */ r("div", { className: "richtext-grid richtext-min-w-48 richtext-grid-cols-1 richtext-gap-0.5", children: (S = e == null ? void 0 : e.items) == null ? void 0 : S.map((p, _) => /* @__PURE__ */ g(Je, { children: [
2126
+ /* @__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: p.title }),
2127
+ p.commands.map((w, C) => /* @__PURE__ */ g(
2128
2128
  "button",
2129
2129
  {
2130
2130
  onClick: () => b(_, C),
@@ -2133,27 +2133,27 @@ function Aa(e, t) {
2133
2133
  "slash-command-active": a === _ && n === C
2134
2134
  }),
2135
2135
  children: [
2136
- p.iconUrl && /* @__PURE__ */ o(
2136
+ w.iconUrl && /* @__PURE__ */ r(
2137
2137
  "img",
2138
2138
  {
2139
2139
  alt: "",
2140
2140
  className: "richtext-size-6",
2141
- src: p.iconUrl
2141
+ src: w.iconUrl
2142
2142
  }
2143
2143
  ),
2144
- p.iconName && /* @__PURE__ */ o(
2144
+ w.iconName && /* @__PURE__ */ r(
2145
2145
  D,
2146
2146
  {
2147
2147
  className: "!richtext-mr-1 !richtext-text-lg",
2148
- name: p.iconName
2148
+ name: w.iconName
2149
2149
  }
2150
2150
  ),
2151
- p.label
2151
+ w.label
2152
2152
  ]
2153
2153
  },
2154
2154
  `command-${C}`
2155
2155
  ))
2156
- ] }, `slash-${w.title}`)) }) : /* @__PURE__ */ o("div", { className: "richtext-p-3", children: /* @__PURE__ */ o("span", { className: "richtext-text-xs richtext-text-gray-800 dark:richtext-text-gray-100", children: c("editor.slash.empty") }) })
2156
+ ] }, `slash-${p.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") }) })
2157
2157
  }
2158
2158
  );
2159
2159
  }
@@ -2190,11 +2190,11 @@ const Rr = H.create({
2190
2190
  startOfLine: !0,
2191
2191
  pluginKey: new Q(ie),
2192
2192
  allow: ({ state: e, range: t }) => {
2193
- var u, d, g;
2194
- const n = e.doc.resolve(t.from), i = n.depth === 1, a = n.parent.type.name === "paragraph", r = ((u = n.parent.textContent) == null ? void 0 : u.charAt(0)) === "/", s = this.editor.isActive("column"), c = (g = n.parent.textContent) == null ? void 0 : g.slice(
2193
+ var u, d, f;
2194
+ const n = e.doc.resolve(t.from), i = n.depth === 1, a = n.parent.type.name === "paragraph", o = ((u = n.parent.textContent) == null ? void 0 : u.charAt(0)) === "/", s = this.editor.isActive("column"), c = (f = n.parent.textContent) == null ? void 0 : f.slice(
2195
2195
  Math.max(0, (d = n.parent.textContent) == null ? void 0 : d.indexOf("/"))
2196
2196
  ), l = !(c != null && c.endsWith(" "));
2197
- return (i && a && r || s && a && r) && l;
2197
+ return (i && a && o || s && a && o) && l;
2198
2198
  },
2199
2199
  command: ({ editor: e, range: t, props: n }) => {
2200
2200
  const { view: i } = e;
@@ -2205,8 +2205,8 @@ const Rr = H.create({
2205
2205
  commands: s.commands.filter((c) => {
2206
2206
  const l = c.label.toLowerCase().trim(), u = e.toLowerCase().trim();
2207
2207
  if (c.aliases) {
2208
- const d = c.aliases.map((m) => m.toLowerCase().trim()), g = l.match(u), h = d.some((m) => m.match(u));
2209
- return g || h;
2208
+ const d = c.aliases.map((h) => h.toLowerCase().trim()), f = l.match(u), m = d.some((h) => h.match(u));
2209
+ return f || m;
2210
2210
  }
2211
2211
  return l.match(u);
2212
2212
  }).filter(
@@ -2223,7 +2223,7 @@ const Rr = H.create({
2223
2223
  let e, t = null;
2224
2224
  return {
2225
2225
  onStart: (n) => {
2226
- var r;
2226
+ var o;
2227
2227
  e = new Ze(La, {
2228
2228
  props: n,
2229
2229
  editor: n.editor
@@ -2245,7 +2245,7 @@ const Rr = H.create({
2245
2245
  A == null || A[0].setProps({
2246
2246
  getReferenceClientRect: a
2247
2247
  });
2248
- }, (r = i.dom.parentElement) == null || r.addEventListener("scroll", t), A == null || A[0].setProps({
2248
+ }, (o = i.dom.parentElement) == null || o.addEventListener("scroll", t), A == null || A[0].setProps({
2249
2249
  getReferenceClientRect: a,
2250
2250
  appendTo: () => document.body,
2251
2251
  content: e.element
@@ -2259,12 +2259,12 @@ const Rr = H.create({
2259
2259
  return n.editor.storage[ie].rect;
2260
2260
  const c = n.clientRect();
2261
2261
  return c ? new DOMRect(c.x, c.y, c.width, c.height) : n.editor.storage[ie].rect;
2262
- }, r = () => {
2262
+ }, o = () => {
2263
2263
  A == null || A[0].setProps({
2264
2264
  getReferenceClientRect: a
2265
2265
  });
2266
2266
  };
2267
- (s = i.dom.parentElement) == null || s.addEventListener("scroll", r), n.editor.storage[ie].rect = n.clientRect ? a() : {
2267
+ (s = i.dom.parentElement) == null || s.addEventListener("scroll", o), n.editor.storage[ie].rect = n.clientRect ? a() : {
2268
2268
  width: 0,
2269
2269
  height: 0,
2270
2270
  left: 0,
@@ -2306,40 +2306,40 @@ const Rr = H.create({
2306
2306
  }
2307
2307
  });
2308
2308
  function Sa({ editor: e, imageInline: t, onClose: n }) {
2309
- const { t: i } = B(), [a, r] = k(!1), s = Pe.useRef(null), [c, l] = Pe.useState(), [u, d] = Pe.useState(""), g = X(null), [h, m] = k({
2309
+ const { t: i } = B(), [a, o] = k(!1), s = Pe.useRef(null), [c, l] = Pe.useState(), [u, d] = Pe.useState(""), f = X(null), [m, h] = k({
2310
2310
  src: "",
2311
2311
  file: null
2312
2312
  });
2313
2313
  function b(_) {
2314
2314
  if (s.current && _.width && _.height) {
2315
- const p = x(s.current, _);
2316
- d(p);
2315
+ const w = x(s.current, _);
2316
+ d(w);
2317
2317
  }
2318
2318
  }
2319
- function x(_, p) {
2320
- const C = document.createElement("canvas"), T = _.naturalWidth / _.width, S = _.naturalHeight / _.height;
2321
- C.width = p.width * T, C.height = p.height * S;
2319
+ function x(_, w) {
2320
+ const C = document.createElement("canvas"), T = _.naturalWidth / _.width, L = _.naturalHeight / _.height;
2321
+ C.width = w.width * T, C.height = w.height * L;
2322
2322
  const q = C.getContext("2d");
2323
2323
  return q && (q.imageSmoothingEnabled = !1, q.drawImage(
2324
2324
  _,
2325
- p.x * T,
2326
- p.y * S,
2327
- p.width * T,
2328
- p.height * S,
2325
+ w.x * T,
2326
+ w.y * L,
2327
+ w.width * T,
2328
+ w.height * L,
2329
2329
  0,
2330
2330
  0,
2331
- p.width * T,
2332
- p.height * S
2331
+ w.width * T,
2332
+ w.height * L
2333
2333
  )), C.toDataURL("image/png", 1);
2334
2334
  }
2335
2335
  async function N() {
2336
- var _, p;
2336
+ var _, w;
2337
2337
  try {
2338
- const C = fi(u, ((_ = h == null ? void 0 : h.file) == null ? void 0 : _.name) || "image.png"), T = (p = e.extensionManager.extensions.find(
2338
+ const C = fi(u, ((_ = m == null ? void 0 : m.file) == null ? void 0 : _.name) || "image.png"), T = (w = e.extensionManager.extensions.find(
2339
2339
  (q) => q.name === "image"
2340
- )) == null ? void 0 : p.options;
2341
- let S = "";
2342
- T.upload ? S = await T.upload(C) : S = URL.createObjectURL(C), e.chain().focus().setImageInline({ src: S, inline: t }).run(), r(!1), m({
2340
+ )) == null ? void 0 : w.options;
2341
+ let L = "";
2342
+ T.upload ? L = await T.upload(C) : L = URL.createObjectURL(C), e.chain().focus().setImageInline({ src: L, inline: t }).run(), o(!1), h({
2343
2343
  src: "",
2344
2344
  file: null
2345
2345
  }), n();
@@ -2347,65 +2347,65 @@ function Sa({ editor: e, imageInline: t, onClose: n }) {
2347
2347
  console.log("Error cropping image", C);
2348
2348
  }
2349
2349
  }
2350
- function L(_) {
2351
- var p;
2352
- _.preventDefault(), (p = g.current) == null || p.click();
2350
+ function S(_) {
2351
+ var w;
2352
+ _.preventDefault(), (w = f.current) == null || w.click();
2353
2353
  }
2354
- const w = async (_) => {
2355
- var S;
2356
- const p = (S = _ == null ? void 0 : _.target) == null ? void 0 : S.files;
2357
- if (!e || e.isDestroyed || p.length === 0)
2354
+ const p = async (_) => {
2355
+ var L;
2356
+ const w = (L = _ == null ? void 0 : _.target) == null ? void 0 : L.files;
2357
+ if (!e || e.isDestroyed || w.length === 0)
2358
2358
  return;
2359
- const C = p[0], T = await gi(C);
2360
- r(!0), m({
2359
+ const C = w[0], T = await gi(C);
2360
+ o(!0), h({
2361
2361
  src: T.src,
2362
2362
  file: C
2363
2363
  });
2364
2364
  };
2365
- return /* @__PURE__ */ f(oe, { children: [
2366
- /* @__PURE__ */ o(
2365
+ return /* @__PURE__ */ g(oe, { children: [
2366
+ /* @__PURE__ */ r(
2367
2367
  O,
2368
2368
  {
2369
2369
  className: "richtext-mt-1 richtext-w-full",
2370
- onClick: L,
2370
+ onClick: S,
2371
2371
  size: "sm",
2372
2372
  children: i("editor.image.dialog.tab.uploadCrop")
2373
2373
  }
2374
2374
  ),
2375
- /* @__PURE__ */ f(st, { open: a, children: [
2376
- /* @__PURE__ */ o(ct, {}),
2377
- /* @__PURE__ */ f(lt, { children: [
2378
- /* @__PURE__ */ o(dt, { children: i("editor.image.dialog.tab.uploadCrop") }),
2379
- /* @__PURE__ */ o("div", { children: h.src && /* @__PURE__ */ o(
2375
+ /* @__PURE__ */ g(st, { open: a, children: [
2376
+ /* @__PURE__ */ r(ct, {}),
2377
+ /* @__PURE__ */ g(lt, { children: [
2378
+ /* @__PURE__ */ r(dt, { children: i("editor.image.dialog.tab.uploadCrop") }),
2379
+ /* @__PURE__ */ r("div", { children: m.src && /* @__PURE__ */ r(
2380
2380
  Hi,
2381
2381
  {
2382
2382
  className: "richtext-w-full",
2383
2383
  crop: c,
2384
2384
  onChange: (_) => l(_),
2385
2385
  onComplete: (_) => b(_),
2386
- children: /* @__PURE__ */ o(
2386
+ children: /* @__PURE__ */ r(
2387
2387
  "img",
2388
2388
  {
2389
2389
  alt: "Crop me",
2390
2390
  ref: s,
2391
- src: h.src
2391
+ src: m.src
2392
2392
  }
2393
2393
  )
2394
2394
  }
2395
2395
  ) }),
2396
- /* @__PURE__ */ f(mi, { children: [
2397
- /* @__PURE__ */ f(
2396
+ /* @__PURE__ */ g(mi, { children: [
2397
+ /* @__PURE__ */ g(
2398
2398
  O,
2399
2399
  {
2400
2400
  onClick: () => {
2401
- r(!1), m({
2401
+ o(!1), h({
2402
2402
  src: "",
2403
2403
  file: null
2404
2404
  });
2405
2405
  },
2406
2406
  children: [
2407
2407
  i("editor.imageUpload.cancel"),
2408
- /* @__PURE__ */ o(
2408
+ /* @__PURE__ */ r(
2409
2409
  D,
2410
2410
  {
2411
2411
  className: "richtext-ml-[4px]",
@@ -2415,14 +2415,14 @@ function Sa({ editor: e, imageInline: t, onClose: n }) {
2415
2415
  ]
2416
2416
  }
2417
2417
  ),
2418
- /* @__PURE__ */ f(
2418
+ /* @__PURE__ */ g(
2419
2419
  O,
2420
2420
  {
2421
2421
  className: "richtext-w-fit",
2422
2422
  onClick: N,
2423
2423
  children: [
2424
2424
  i("editor.imageUpload.crop"),
2425
- /* @__PURE__ */ o(
2425
+ /* @__PURE__ */ r(
2426
2426
  D,
2427
2427
  {
2428
2428
  className: "richtext-ml-[4px]",
@@ -2435,13 +2435,13 @@ function Sa({ editor: e, imageInline: t, onClose: n }) {
2435
2435
  ] })
2436
2436
  ] })
2437
2437
  ] }),
2438
- /* @__PURE__ */ o(
2438
+ /* @__PURE__ */ r(
2439
2439
  "input",
2440
2440
  {
2441
2441
  accept: "image/*",
2442
2442
  multiple: !0,
2443
- onChange: w,
2444
- ref: g,
2443
+ onChange: p,
2444
+ ref: f,
2445
2445
  type: "file",
2446
2446
  style: {
2447
2447
  display: "none"
@@ -2451,38 +2451,38 @@ function Sa({ editor: e, imageInline: t, onClose: n }) {
2451
2451
  ] });
2452
2452
  }
2453
2453
  function Ma(e) {
2454
- var h;
2455
- const { t } = B(), n = Ca(), [i, a] = k(""), r = X(null), [s, c] = k(((h = e.editor.extensionManager.extensions.find(
2456
- (m) => m.name === Ct.name
2457
- )) == null ? void 0 : h.options.defaultInline) || !1), l = R(() => {
2454
+ var m;
2455
+ const { t } = B(), n = Ca(), [i, a] = k(""), o = X(null), [s, c] = k(((m = e.editor.extensionManager.extensions.find(
2456
+ (h) => h.name === Ct.name
2457
+ )) == null ? void 0 : m.options.defaultInline) || !1), l = R(() => {
2458
2458
  var b;
2459
2459
  return (b = e.editor.extensionManager.extensions.find(
2460
2460
  (x) => x.name === Ct.name
2461
2461
  )) == null ? void 0 : b.options;
2462
2462
  }, [e.editor]);
2463
- async function u(m) {
2464
- var L;
2465
- const b = (L = m == null ? void 0 : m.target) == null ? void 0 : L.files;
2463
+ async function u(h) {
2464
+ var S;
2465
+ const b = (S = h == null ? void 0 : h.target) == null ? void 0 : S.files;
2466
2466
  if (!e.editor || e.editor.isDestroyed || b.length === 0)
2467
2467
  return;
2468
2468
  const x = b[0];
2469
2469
  let N = "";
2470
2470
  l.upload ? N = await l.upload(x) : N = URL.createObjectURL(x), e.editor.chain().focus().setImageInline({ src: N, inline: s }).run(), ue.setOpen(!1), c(!1);
2471
2471
  }
2472
- function d(m) {
2473
- m.preventDefault(), m.stopPropagation(), e.editor.chain().focus().setImageInline({ src: i, inline: s }).run(), ue.setOpen(!1), c(!1), a("");
2472
+ function d(h) {
2473
+ h.preventDefault(), h.stopPropagation(), e.editor.chain().focus().setImageInline({ src: i, inline: s }).run(), ue.setOpen(!1), c(!1), a("");
2474
2474
  }
2475
- function g(m) {
2475
+ function f(h) {
2476
2476
  var b;
2477
- m.preventDefault(), (b = r.current) == null || b.click();
2477
+ h.preventDefault(), (b = o.current) == null || b.click();
2478
2478
  }
2479
- return /* @__PURE__ */ f(
2479
+ return /* @__PURE__ */ g(
2480
2480
  st,
2481
2481
  {
2482
2482
  onOpenChange: ue.setOpen,
2483
2483
  open: n,
2484
2484
  children: [
2485
- /* @__PURE__ */ o(ct, { asChild: !0, children: /* @__PURE__ */ o(
2485
+ /* @__PURE__ */ r(ct, { asChild: !0, children: /* @__PURE__ */ r(
2486
2486
  y,
2487
2487
  {
2488
2488
  action: () => ue.setOpen(!0),
@@ -2490,42 +2490,42 @@ function Ma(e) {
2490
2490
  tooltip: e.tooltip
2491
2491
  }
2492
2492
  ) }),
2493
- /* @__PURE__ */ f(lt, { children: [
2494
- /* @__PURE__ */ o(dt, { children: t("editor.image.dialog.title") }),
2495
- /* @__PURE__ */ f(
2493
+ /* @__PURE__ */ g(lt, { children: [
2494
+ /* @__PURE__ */ r(dt, { children: t("editor.image.dialog.title") }),
2495
+ /* @__PURE__ */ g(
2496
2496
  Xt,
2497
2497
  {
2498
2498
  activationMode: "manual",
2499
2499
  defaultValue: l.resourceImage === "both" || l.resourceImage === "upload" ? "upload" : "link",
2500
2500
  children: [
2501
- /* @__PURE__ */ f(ft, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
2502
- l.resourceImage === "both" || l.resourceImage === "upload" ? /* @__PURE__ */ o(Ne, { value: "upload", children: t("editor.image.dialog.tab.upload") }) : /* @__PURE__ */ o(oe, {}),
2503
- l.resourceImage === "both" || l.resourceImage === "link" ? /* @__PURE__ */ o(Ne, { value: "link", children: t("editor.image.dialog.tab.url") }) : /* @__PURE__ */ o(oe, {})
2501
+ /* @__PURE__ */ g(ft, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
2502
+ l.resourceImage === "both" || l.resourceImage === "upload" ? /* @__PURE__ */ r(Ne, { value: "upload", children: t("editor.image.dialog.tab.upload") }) : /* @__PURE__ */ r(oe, {}),
2503
+ l.resourceImage === "both" || l.resourceImage === "link" ? /* @__PURE__ */ r(Ne, { value: "link", children: t("editor.image.dialog.tab.url") }) : /* @__PURE__ */ r(oe, {})
2504
2504
  ] }),
2505
- /* @__PURE__ */ f("div", { className: "richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]", children: [
2506
- /* @__PURE__ */ o(
2505
+ /* @__PURE__ */ g("div", { className: "richtext-my-[10px] richtext-flex richtext-items-center richtext-gap-[4px]", children: [
2506
+ /* @__PURE__ */ r(
2507
2507
  Yt,
2508
2508
  {
2509
2509
  checked: s,
2510
- onCheckedChange: (m) => {
2511
- c(m);
2510
+ onCheckedChange: (h) => {
2511
+ c(h);
2512
2512
  }
2513
2513
  }
2514
2514
  ),
2515
- /* @__PURE__ */ o(De, { children: t("editor.link.dialog.inline") })
2515
+ /* @__PURE__ */ r(De, { children: t("editor.link.dialog.inline") })
2516
2516
  ] }),
2517
- /* @__PURE__ */ f(Te, { value: "upload", children: [
2518
- /* @__PURE__ */ f("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
2519
- /* @__PURE__ */ o(
2517
+ /* @__PURE__ */ g(Te, { value: "upload", children: [
2518
+ /* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
2519
+ /* @__PURE__ */ r(
2520
2520
  O,
2521
2521
  {
2522
2522
  className: "richtext-mt-1 richtext-w-full",
2523
- onClick: g,
2523
+ onClick: f,
2524
2524
  size: "sm",
2525
2525
  children: t("editor.image.dialog.tab.upload")
2526
2526
  }
2527
2527
  ),
2528
- /* @__PURE__ */ o(
2528
+ /* @__PURE__ */ r(
2529
2529
  Sa,
2530
2530
  {
2531
2531
  editor: e.editor,
@@ -2534,13 +2534,13 @@ function Ma(e) {
2534
2534
  }
2535
2535
  )
2536
2536
  ] }),
2537
- /* @__PURE__ */ o(
2537
+ /* @__PURE__ */ r(
2538
2538
  "input",
2539
2539
  {
2540
2540
  accept: "image/*",
2541
2541
  multiple: !0,
2542
2542
  onChange: u,
2543
- ref: r,
2543
+ ref: o,
2544
2544
  type: "file",
2545
2545
  style: {
2546
2546
  display: "none"
@@ -2548,19 +2548,19 @@ function Ma(e) {
2548
2548
  }
2549
2549
  )
2550
2550
  ] }),
2551
- /* @__PURE__ */ o(Te, { value: "link", children: /* @__PURE__ */ o("form", { onSubmit: d, children: /* @__PURE__ */ f("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
2552
- /* @__PURE__ */ o(
2551
+ /* @__PURE__ */ r(Te, { value: "link", children: /* @__PURE__ */ r("form", { onSubmit: d, children: /* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
2552
+ /* @__PURE__ */ r(
2553
2553
  Oe,
2554
2554
  {
2555
2555
  autoFocus: !0,
2556
- onChange: (m) => a(m.target.value),
2556
+ onChange: (h) => a(h.target.value),
2557
2557
  placeholder: t("editor.image.dialog.placeholder"),
2558
2558
  required: !0,
2559
2559
  type: "url",
2560
2560
  value: i
2561
2561
  }
2562
2562
  ),
2563
- /* @__PURE__ */ o(O, { type: "submit", children: t("editor.image.dialog.button.apply") })
2563
+ /* @__PURE__ */ r(O, { type: "submit", children: t("editor.image.dialog.button.apply") })
2564
2564
  ] }) }) })
2565
2565
  ]
2566
2566
  }
@@ -2577,14 +2577,14 @@ const He = {
2577
2577
  BOTTOM_RIGHT: "br"
2578
2578
  };
2579
2579
  function Ia(e) {
2580
- var S, q;
2580
+ var L, q;
2581
2581
  const [t, n] = k({
2582
2582
  width: wt,
2583
2583
  height: wt
2584
2584
  }), [i, a] = k({
2585
2585
  width: 0,
2586
2586
  height: 0
2587
- }), [r] = k([
2587
+ }), [o] = k([
2588
2588
  He.TOP_LEFT,
2589
2589
  He.TOP_RIGHT,
2590
2590
  He.BOTTOM_LEFT,
@@ -2595,7 +2595,7 @@ function Ia(e) {
2595
2595
  w: 0,
2596
2596
  h: 0,
2597
2597
  dir: ""
2598
- }), { align: d, inline: g } = (S = e == null ? void 0 : e.node) == null ? void 0 : S.attrs, h = R(() => {
2598
+ }), { align: d, inline: f } = (L = e == null ? void 0 : e.node) == null ? void 0 : L.attrs, m = R(() => {
2599
2599
  var gt;
2600
2600
  const { src: v, alt: $, width: F, height: ee, flipX: te, flipY: M } = (gt = e == null ? void 0 : e.node) == null ? void 0 : gt.attrs, K = _t(F) ? `${F}px` : F, W = _t(ee) ? `${ee}px` : ee, Ue = [];
2601
2601
  te && Ue.push("rotateX(180deg)"), M && Ue.push("rotateY(180deg)");
@@ -2609,12 +2609,12 @@ function Ia(e) {
2609
2609
  transform: tn || "none"
2610
2610
  }
2611
2611
  };
2612
- }, [(q = e == null ? void 0 : e.node) == null ? void 0 : q.attrs]), m = R(() => {
2612
+ }, [(q = e == null ? void 0 : e.node) == null ? void 0 : q.attrs]), h = R(() => {
2613
2613
  const {
2614
2614
  style: { width: v }
2615
- } = h;
2615
+ } = m;
2616
2616
  return { width: v === "100%" ? v : void 0 };
2617
- }, [h]);
2617
+ }, [m]);
2618
2618
  function b(v) {
2619
2619
  a({
2620
2620
  width: v.target.width,
@@ -2635,7 +2635,7 @@ function Ia(e) {
2635
2635
  }, yt),
2636
2636
  [e == null ? void 0 : e.editor]
2637
2637
  );
2638
- function L(v, $) {
2638
+ function S(v, $) {
2639
2639
  v.preventDefault(), v.stopPropagation();
2640
2640
  const F = i.width, ee = i.height, te = F / ee;
2641
2641
  let M = Number(e.node.attrs.width), K = Number(e.node.attrs.height);
@@ -2648,7 +2648,7 @@ function Ia(e) {
2648
2648
  dir: $
2649
2649
  });
2650
2650
  }
2651
- const w = j(
2651
+ const p = j(
2652
2652
  bt((v) => {
2653
2653
  if (v.preventDefault(), v.stopPropagation(), !s)
2654
2654
  return;
@@ -2670,48 +2670,48 @@ function Ia(e) {
2670
2670
  }), c(!1), x());
2671
2671
  },
2672
2672
  [s, x]
2673
- ), p = j(() => {
2674
- document == null || document.addEventListener("mousemove", w, !0), document == null || document.addEventListener("mouseup", _, !0);
2675
- }, [w, _]), C = j(() => {
2676
- document == null || document.removeEventListener("mousemove", w, !0), document == null || document.removeEventListener("mouseup", _, !0);
2677
- }, [w, _]);
2678
- P(() => (s ? p() : C(), () => {
2673
+ ), w = j(() => {
2674
+ document == null || document.addEventListener("mousemove", p, !0), document == null || document.addEventListener("mouseup", _, !0);
2675
+ }, [p, _]), C = j(() => {
2676
+ document == null || document.removeEventListener("mousemove", p, !0), document == null || document.removeEventListener("mouseup", _, !0);
2677
+ }, [p, _]);
2678
+ P(() => (s ? w() : C(), () => {
2679
2679
  C();
2680
- }), [s, p, C]);
2680
+ }), [s, w, C]);
2681
2681
  const T = R(() => new ResizeObserver(() => N()), [N]);
2682
2682
  return P(() => (T.observe(e.editor.view.dom), () => {
2683
2683
  T.disconnect();
2684
- }), [e.editor.view.dom, T]), /* @__PURE__ */ o(
2684
+ }), [e.editor.view.dom, T]), /* @__PURE__ */ r(
2685
2685
  he,
2686
2686
  {
2687
- as: g ? "span" : "div",
2687
+ as: f ? "span" : "div",
2688
2688
  className: "image-view",
2689
- style: { ...m, textAlign: d, display: g ? "inline" : "block" },
2690
- children: /* @__PURE__ */ f(
2689
+ style: { ...h, textAlign: d, display: f ? "inline" : "block" },
2690
+ children: /* @__PURE__ */ g(
2691
2691
  "div",
2692
2692
  {
2693
2693
  "data-drag-handle": !0,
2694
2694
  draggable: "true",
2695
- style: m,
2695
+ style: h,
2696
2696
  className: `image-view__body ${e != null && e.selected ? "image-view__body--focused" : ""} ${s ? "image-view__body--resizing" : ""}`,
2697
2697
  children: [
2698
- /* @__PURE__ */ o(
2698
+ /* @__PURE__ */ r(
2699
2699
  "img",
2700
2700
  {
2701
- alt: h.alt,
2701
+ alt: m.alt,
2702
2702
  className: "image-view__body__image block",
2703
2703
  height: "auto",
2704
2704
  onClick: x,
2705
2705
  onLoad: b,
2706
- src: h.src,
2707
- style: h.style
2706
+ src: m.src,
2707
+ style: m.style
2708
2708
  }
2709
2709
  ),
2710
- (e == null ? void 0 : e.editor.view.editable) && ((e == null ? void 0 : e.selected) || s) && /* @__PURE__ */ o("div", { className: "image-resizer", children: r == null ? void 0 : r.map((v) => /* @__PURE__ */ o(
2710
+ (e == null ? void 0 : e.editor.view.editable) && ((e == null ? void 0 : e.selected) || s) && /* @__PURE__ */ r("div", { className: "image-resizer", children: o == null ? void 0 : o.map((v) => /* @__PURE__ */ r(
2711
2711
  "span",
2712
2712
  {
2713
2713
  className: `image-resizer__handler image-resizer__handler--${v}`,
2714
- onMouseDown: ($) => L($, v)
2714
+ onMouseDown: ($) => S($, v)
2715
2715
  },
2716
2716
  `image-dir-${v}`
2717
2717
  )) })
@@ -2733,8 +2733,8 @@ function Ea() {
2733
2733
  t = t.map(e.mapping, e.doc);
2734
2734
  const n = e.getMeta(fe);
2735
2735
  if (n != null && n.add)
2736
- for (const { id: i, pos: a, src: r } of n.add) {
2737
- const s = Ha(r), c = ge.widget(a, s, { id: i });
2736
+ for (const { id: i, pos: a, src: o } of n.add) {
2737
+ const s = Ha(o), c = ge.widget(a, s, { id: i });
2738
2738
  t = t.add(e.doc, [c]);
2739
2739
  }
2740
2740
  else if (n != null && n.remove)
@@ -2758,38 +2758,41 @@ function Ha(e) {
2758
2758
  }
2759
2759
  function za(e, t) {
2760
2760
  var a;
2761
- const i = fe.getState(e).find(void 0, void 0, (r) => r.id === t);
2761
+ const i = fe.getState(e).find(void 0, void 0, (o) => o.id === t);
2762
2762
  return i.length > 0 ? (a = i[0]) == null ? void 0 : a.from : null;
2763
2763
  }
2764
- function Ra({ validateFn: e, onUpload: t, postUpload: n }) {
2765
- return (i, a, r) => {
2766
- for (const s of i) {
2767
- if (e && !e(s))
2764
+ function Ra({ validateFn: e, onUpload: t, postUpload: n, defaultInline: i = !1 }) {
2765
+ return (a, o, s) => {
2766
+ for (const c of a) {
2767
+ if (e && !e(c))
2768
2768
  continue;
2769
- const c = Date.now().toString(), l = a.state.tr;
2770
- l.selection.empty || l.deleteSelection();
2771
- const u = URL.createObjectURL(s);
2772
- l.setMeta(fe, {
2773
- add: [{ id: c, pos: r, src: u }]
2774
- }), a.dispatch(l), t(s).then(
2775
- async (d) => {
2776
- var L;
2777
- n && typeof d == "string" && (d = await n(d));
2778
- const { schema: g } = a.state;
2779
- let h = za(a.state, c);
2769
+ const l = Date.now().toString(), u = o.state.tr;
2770
+ u.selection.empty || u.deleteSelection();
2771
+ const d = URL.createObjectURL(c);
2772
+ u.setMeta(fe, {
2773
+ add: [{ id: l, pos: s, src: d }]
2774
+ }), o.dispatch(u), t(c).then(
2775
+ async (f) => {
2776
+ var p;
2777
+ n && typeof f == "string" && (f = await n(f));
2778
+ const { schema: m } = o.state;
2779
+ let h = za(o.state, l);
2780
2780
  if (h === null)
2781
2781
  return;
2782
- const m = typeof d == "object" ? u : d, b = (L = g.nodes.image) == null ? void 0 : L.create({ src: m });
2783
- if (!b)
2782
+ const b = typeof f == "object" ? d : f, x = (p = m.nodes.image) == null ? void 0 : p.create({
2783
+ src: b,
2784
+ inline: i
2785
+ });
2786
+ if (!x)
2784
2787
  return;
2785
- const { doc: x } = a.state;
2786
- h > x.content.size && (h = x.content.size - 1);
2787
- const N = a.state.tr.replaceWith(h, h, b).setMeta(fe, { remove: [c] });
2788
- a.dispatch(N);
2788
+ const { doc: N } = o.state;
2789
+ h > N.content.size && (h = N.content.size - 1);
2790
+ const S = o.state.tr.replaceWith(h, h, x).setMeta(fe, { remove: [l] });
2791
+ o.dispatch(S);
2789
2792
  },
2790
2793
  () => {
2791
- const d = a.state.tr.delete(r, r).setMeta(fe, { remove: [c] });
2792
- a.dispatch(d);
2794
+ const f = o.state.tr.delete(s, s).setMeta(fe, { remove: [l] });
2795
+ o.dispatch(f);
2793
2796
  }
2794
2797
  );
2795
2798
  }
@@ -2800,14 +2803,14 @@ function Pa(e, t, n) {
2800
2803
  const i = [...((a = t.clipboardData) == null ? void 0 : a.files) || []];
2801
2804
  if (i.length > 0) {
2802
2805
  t.preventDefault();
2803
- const r = e.state.selection.from;
2804
- return n(i, e, r + 1), !0;
2806
+ const o = e.state.selection.from;
2807
+ return n(i, e, o + 1), !0;
2805
2808
  }
2806
2809
  return !1;
2807
2810
  }
2808
2811
  function Da(e, t, n, i) {
2809
- var r;
2810
- const a = [...((r = t.dataTransfer) == null ? void 0 : r.files) || []];
2812
+ var o;
2813
+ const a = [...((o = t.dataTransfer) == null ? void 0 : o.files) || []];
2811
2814
  if (!n && a.length > 0) {
2812
2815
  t.preventDefault();
2813
2816
  const s = e.posAtCoords({
@@ -2842,14 +2845,14 @@ const Oa = {
2842
2845
  extension: n,
2843
2846
  t: i
2844
2847
  }) => {
2845
- var a, r;
2848
+ var a, o;
2846
2849
  return {
2847
2850
  component: Ma,
2848
2851
  componentProps: {
2849
2852
  action: () => !0,
2850
2853
  upload: n.options.upload,
2851
2854
  /* If setImage is not available(when Image Component is not imported), the button is disabled */
2852
- disabled: !((r = (a = t.can()).setImage) != null && r.call(a, {})),
2855
+ disabled: !((o = (a = t.can()).setImage) != null && o.call(a, {})),
2853
2856
  icon: "ImageUp",
2854
2857
  tooltip: i("editor.image.tooltip"),
2855
2858
  editor: t
@@ -2913,7 +2916,7 @@ const Oa = {
2913
2916
  };
2914
2917
  },
2915
2918
  renderHTML({ HTMLAttributes: e }) {
2916
- const { flipX: t, flipY: n, align: i, inline: a } = e, r = t || n ? `transform: rotateX(${t ? "180" : "0"}deg) rotateY(${n ? "180" : "0"}deg);` : "", s = i ? `text-align: ${i};` : "";
2919
+ const { flipX: t, flipY: n, align: i, inline: a } = e, o = t || n ? `transform: rotateX(${t ? "180" : "0"}deg) rotateY(${n ? "180" : "0"}deg);` : "", s = i ? `text-align: ${i};` : "";
2917
2920
  return [
2918
2921
  a ? "span" : "div",
2919
2922
  {
@@ -2925,7 +2928,7 @@ const Oa = {
2925
2928
  Le(
2926
2929
  {
2927
2930
  height: "auto",
2928
- style: r
2931
+ style: o
2929
2932
  },
2930
2933
  this.options.HTMLAttributes,
2931
2934
  e
@@ -2938,14 +2941,14 @@ const Oa = {
2938
2941
  {
2939
2942
  tag: "span.image img",
2940
2943
  getAttrs: (e) => {
2941
- var r;
2944
+ var o;
2942
2945
  const t = e == null ? void 0 : e.parentElement, n = e == null ? void 0 : e.getAttribute("width"), i = (e == null ? void 0 : e.getAttribute("flipx")) || !1, a = (e == null ? void 0 : e.getAttribute("flipy")) || !1;
2943
2946
  return {
2944
2947
  src: e == null ? void 0 : e.getAttribute("src"),
2945
2948
  alt: e == null ? void 0 : e.getAttribute("alt"),
2946
2949
  caption: e == null ? void 0 : e.getAttribute("caption"),
2947
2950
  width: n ? Number.parseInt(n, 10) : null,
2948
- align: (e == null ? void 0 : e.getAttribute("align")) || ((r = t == null ? void 0 : t.style) == null ? void 0 : r.textAlign) || null,
2951
+ align: (e == null ? void 0 : e.getAttribute("align")) || ((o = t == null ? void 0 : t.style) == null ? void 0 : o.textAlign) || null,
2949
2952
  inline: (e == null ? void 0 : e.getAttribute("inline")) || !1,
2950
2953
  flipX: i === "true",
2951
2954
  flipY: a === "true"
@@ -2979,8 +2982,8 @@ const Oa = {
2979
2982
  return [
2980
2983
  new J({
2981
2984
  props: {
2982
- handlePaste: (n, i) => !i.clipboardData || [...i.clipboardData.files || []].some((r) => r.type === "text/html") ? !1 : Pa(n, i, t),
2983
- handleDrop: (n, i, a, r) => (!(i instanceof DragEvent) || !i.dataTransfer || Da(n, i, r, t), !1)
2985
+ handlePaste: (n, i) => !i.clipboardData || [...i.clipboardData.files || []].some((o) => o.type === "text/html") ? !1 : Pa(n, i, t),
2986
+ handleDrop: (n, i, a, o) => (!(i instanceof DragEvent) || !i.dataTransfer || Da(n, i, o, t), !1)
2984
2987
  }
2985
2988
  }),
2986
2989
  Ea()
@@ -2991,36 +2994,36 @@ function ja(e) {
2991
2994
  return /\.(?:mp4|webm|ogg|mov)$/i.test(e);
2992
2995
  }
2993
2996
  function Ba(e) {
2994
- const { t } = B(), [n, i] = k(""), a = X(null), r = Na(), [s, c] = k(""), l = R(() => {
2995
- var m;
2996
- return (m = e.editor.extensionManager.extensions.find(
2997
+ const { t } = B(), [n, i] = k(""), a = X(null), o = Na(), [s, c] = k(""), l = R(() => {
2998
+ var h;
2999
+ return (h = e.editor.extensionManager.extensions.find(
2997
3000
  (b) => b.name === Fa.name
2998
- )) == null ? void 0 : m.options;
3001
+ )) == null ? void 0 : h.options;
2999
3002
  }, [e.editor]);
3000
- async function u(h) {
3003
+ async function u(m) {
3001
3004
  var N;
3002
- const m = (N = h == null ? void 0 : h.target) == null ? void 0 : N.files;
3003
- if (!e.editor || e.editor.isDestroyed || m.length === 0)
3005
+ const h = (N = m == null ? void 0 : m.target) == null ? void 0 : N.files;
3006
+ if (!e.editor || e.editor.isDestroyed || h.length === 0)
3004
3007
  return;
3005
- const b = m[0];
3008
+ const b = h[0];
3006
3009
  let x = "";
3007
3010
  l.upload ? x = await l.upload(b) : x = URL.createObjectURL(b), e.editor.chain().setVideo({
3008
3011
  src: x,
3009
3012
  width: "100%"
3010
3013
  }).focus().run(), ke.setOpen(!1);
3011
3014
  }
3012
- function d(h) {
3013
- h.preventDefault(), h.stopPropagation(), n && (e.editor.chain().setVideo({
3015
+ function d(m) {
3016
+ m.preventDefault(), m.stopPropagation(), n && (e.editor.chain().setVideo({
3014
3017
  src: n,
3015
3018
  width: "100%"
3016
3019
  }).focus().run(), ke.setOpen(!1));
3017
3020
  }
3018
- function g(h) {
3019
- var m;
3020
- h.preventDefault(), (m = a.current) == null || m.click();
3021
+ function f(m) {
3022
+ var h;
3023
+ m.preventDefault(), (h = a.current) == null || h.click();
3021
3024
  }
3022
- return /* @__PURE__ */ f(st, { open: r, onOpenChange: ke.setOpen, children: [
3023
- /* @__PURE__ */ o(ct, { asChild: !0, children: /* @__PURE__ */ o(
3025
+ return /* @__PURE__ */ g(st, { open: o, onOpenChange: ke.setOpen, children: [
3026
+ /* @__PURE__ */ r(ct, { asChild: !0, children: /* @__PURE__ */ r(
3024
3027
  y,
3025
3028
  {
3026
3029
  icon: e.icon,
@@ -3028,21 +3031,21 @@ function Ba(e) {
3028
3031
  tooltip: e.tooltip
3029
3032
  }
3030
3033
  ) }),
3031
- /* @__PURE__ */ f(lt, { children: [
3032
- /* @__PURE__ */ o(dt, { children: t("editor.video.dialog.title") }),
3033
- /* @__PURE__ */ f(
3034
+ /* @__PURE__ */ g(lt, { children: [
3035
+ /* @__PURE__ */ r(dt, { children: t("editor.video.dialog.title") }),
3036
+ /* @__PURE__ */ g(
3034
3037
  Xt,
3035
3038
  {
3036
3039
  defaultValue: (l == null ? void 0 : l.resourceVideo) === "both" || (l == null ? void 0 : l.resourceVideo) === "upload" ? "upload" : "link",
3037
3040
  activationMode: "manual",
3038
3041
  children: [
3039
- /* @__PURE__ */ f(ft, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
3040
- ((l == null ? void 0 : l.resourceVideo) === "both" || (l == null ? void 0 : l.resourceVideo) === "upload") && /* @__PURE__ */ o(Ne, { value: "upload", children: t("editor.video.dialog.tab.upload") }),
3041
- ((l == null ? void 0 : l.resourceVideo) === "both" || (l == null ? void 0 : l.resourceVideo) === "link") && /* @__PURE__ */ o(Ne, { value: "link", children: t("editor.video.dialog.link") })
3042
+ /* @__PURE__ */ g(ft, { className: "richtext-grid richtext-w-full richtext-grid-cols-2", children: [
3043
+ ((l == null ? void 0 : l.resourceVideo) === "both" || (l == null ? void 0 : l.resourceVideo) === "upload") && /* @__PURE__ */ r(Ne, { value: "upload", children: t("editor.video.dialog.tab.upload") }),
3044
+ ((l == null ? void 0 : l.resourceVideo) === "both" || (l == null ? void 0 : l.resourceVideo) === "link") && /* @__PURE__ */ r(Ne, { value: "link", children: t("editor.video.dialog.link") })
3042
3045
  ] }),
3043
- /* @__PURE__ */ f(Te, { value: "upload", children: [
3044
- /* @__PURE__ */ o("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: /* @__PURE__ */ o(O, { className: "richtext-w-full richtext-mt-1", size: "sm", onClick: g, children: t("editor.video.dialog.tab.upload") }) }),
3045
- /* @__PURE__ */ o(
3046
+ /* @__PURE__ */ g(Te, { value: "upload", children: [
3047
+ /* @__PURE__ */ r("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: /* @__PURE__ */ r(O, { className: "richtext-w-full richtext-mt-1", size: "sm", onClick: f, children: t("editor.video.dialog.tab.upload") }) }),
3048
+ /* @__PURE__ */ r(
3046
3049
  "input",
3047
3050
  {
3048
3051
  type: "file",
@@ -3056,29 +3059,29 @@ function Ba(e) {
3056
3059
  }
3057
3060
  )
3058
3061
  ] }),
3059
- /* @__PURE__ */ f(Te, { value: "link", children: [
3060
- /* @__PURE__ */ o("form", { onSubmit: d, children: /* @__PURE__ */ f("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
3061
- /* @__PURE__ */ o(
3062
+ /* @__PURE__ */ g(Te, { value: "link", children: [
3063
+ /* @__PURE__ */ r("form", { onSubmit: d, children: /* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-gap-2", children: [
3064
+ /* @__PURE__ */ r(
3062
3065
  Oe,
3063
3066
  {
3064
3067
  type: "url",
3065
3068
  autoFocus: !0,
3066
3069
  value: n,
3067
- onChange: (h) => {
3068
- const m = h.target.value;
3069
- if (!ja(m)) {
3070
+ onChange: (m) => {
3071
+ const h = m.target.value;
3072
+ if (!ja(h)) {
3070
3073
  c("Invalid video URL"), i("");
3071
3074
  return;
3072
3075
  }
3073
- c(""), i(m);
3076
+ c(""), i(h);
3074
3077
  },
3075
3078
  required: !0,
3076
3079
  placeholder: t("editor.video.dialog.placeholder")
3077
3080
  }
3078
3081
  ),
3079
- /* @__PURE__ */ o(O, { type: "submit", children: t("editor.video.dialog.button.apply") })
3082
+ /* @__PURE__ */ r(O, { type: "submit", children: t("editor.video.dialog.button.apply") })
3080
3083
  ] }) }),
3081
- s && /* @__PURE__ */ o("div", { className: "richtext-text-red-500 richtext-my-[5px]", children: s })
3084
+ s && /* @__PURE__ */ r("div", { className: "richtext-text-red-500 richtext-my-[5px]", children: s })
3082
3085
  ] })
3083
3086
  ]
3084
3087
  }
@@ -3191,14 +3194,14 @@ function Ua(e, t, n) {
3191
3194
  }
3192
3195
  function Va(e, t, n) {
3193
3196
  const { doc: i, selection: a } = e;
3194
- return !i || !a || !(a instanceof Vn) || a.forEachCell((r, s) => {
3197
+ return !i || !a || !(a instanceof Vn) || a.forEachCell((o, s) => {
3195
3198
  e = Ua(e, s, n);
3196
3199
  }), e;
3197
3200
  }
3198
3201
  function Nt(e, t) {
3199
3202
  return ({ tr: n, state: i, dispatch: a }) => {
3200
- const { selection: r } = i;
3201
- return n = n.setSelection(r), n = Va(n, t, e), n.docChanged ? (a == null || a(n), !0) : !1;
3203
+ const { selection: o } = i;
3204
+ return n = n.setSelection(o), n = Va(n, t, e), n.docChanged ? (a == null || a(n), !0) : !1;
3202
3205
  };
3203
3206
  }
3204
3207
  const qa = H.create({
@@ -3241,24 +3244,24 @@ function Xa(e) {
3241
3244
  const [t, n] = k(!0), [i, a] = k({
3242
3245
  rows: Tt() ? Me : Ie,
3243
3246
  cols: Tt() ? Me : Ie
3244
- }), [r, s] = k({
3247
+ }), [o, s] = k({
3245
3248
  rows: Ee,
3246
3249
  cols: Ee
3247
3250
  });
3248
- function c(g, h) {
3249
- g === i.rows && a((m) => ({
3250
- ...m,
3251
- rows: Math.min(g + 1, Me)
3252
- })), h === i.cols && a((m) => ({
3253
- ...m,
3254
- cols: Math.min(h + 1, Me)
3251
+ function c(f, m) {
3252
+ f === i.rows && a((h) => ({
3253
+ ...h,
3254
+ rows: Math.min(f + 1, Me)
3255
+ })), m === i.cols && a((h) => ({
3256
+ ...h,
3257
+ cols: Math.min(m + 1, Me)
3255
3258
  })), s({
3256
- rows: g,
3257
- cols: h
3259
+ rows: f,
3260
+ cols: m
3258
3261
  });
3259
3262
  }
3260
- function l(g, h) {
3261
- e == null || e.createTable({ rows: g, cols: h, withHeaderRow: t }), u();
3263
+ function l(f, m) {
3264
+ e == null || e.createTable({ rows: f, cols: m, withHeaderRow: t }), u();
3262
3265
  }
3263
3266
  function u() {
3264
3267
  n(!1), a({
@@ -3269,40 +3272,40 @@ function Xa(e) {
3269
3272
  cols: Ee
3270
3273
  });
3271
3274
  }
3272
- return /* @__PURE__ */ f(xe, { modal: !0, children: [
3273
- /* @__PURE__ */ o(pe, { asChild: !0, children: e == null ? void 0 : e.children }),
3274
- /* @__PURE__ */ o(
3275
+ return /* @__PURE__ */ g(xe, { modal: !0, children: [
3276
+ /* @__PURE__ */ r(pe, { asChild: !0, children: e == null ? void 0 : e.children }),
3277
+ /* @__PURE__ */ r(
3275
3278
  we,
3276
3279
  {
3277
3280
  align: "start",
3278
3281
  className: "richtext-w-full !richtext-p-2",
3279
3282
  side: "bottom",
3280
- children: /* @__PURE__ */ f("div", { className: "table-grid-size-editor richtext-p-0", children: [
3281
- /* @__PURE__ */ o("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (d = At(i == null ? void 0 : i.rows)) == null ? void 0 : d.map((g) => {
3282
- var h;
3283
- return /* @__PURE__ */ o(
3283
+ children: /* @__PURE__ */ g("div", { className: "table-grid-size-editor richtext-p-0", children: [
3284
+ /* @__PURE__ */ r("div", { className: "richtext-flex richtext-flex-col richtext-flex-wrap richtext-justify-between richtext-gap-1", children: (d = At(i == null ? void 0 : i.rows)) == null ? void 0 : d.map((f) => {
3285
+ var m;
3286
+ return /* @__PURE__ */ r(
3284
3287
  "div",
3285
3288
  {
3286
3289
  className: "richtext-flex richtext-gap-1",
3287
- children: (h = At(i == null ? void 0 : i.cols)) == null ? void 0 : h.map((m) => /* @__PURE__ */ o(
3290
+ children: (m = At(i == null ? void 0 : i.cols)) == null ? void 0 : m.map((h) => /* @__PURE__ */ r(
3288
3291
  "div",
3289
3292
  {
3290
- onMouseDown: () => l(g, m),
3291
- onMouseOver: () => c(g, m),
3292
- className: `richtext-cursor-pointer richtext-border-border ${m <= r.cols && g <= r.rows && "tableCellActive !richtext-bg-foreground"}`,
3293
- children: /* @__PURE__ */ o("div", { className: "richtext-box-border richtext-size-4 richtext-rounded-[2px] !richtext-border richtext-border-solid !richtext-border-border richtext-p-1" })
3293
+ onMouseDown: () => l(f, h),
3294
+ onMouseOver: () => c(f, h),
3295
+ className: `richtext-cursor-pointer richtext-border-border ${h <= o.cols && f <= o.rows && "tableCellActive !richtext-bg-foreground"}`,
3296
+ 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" })
3294
3297
  },
3295
- `c-${m}`
3298
+ `c-${h}`
3296
3299
  ))
3297
3300
  },
3298
- `r-${g}`
3301
+ `r-${f}`
3299
3302
  );
3300
3303
  }) }),
3301
- /* @__PURE__ */ f("div", { className: "richtext-mt-2 richtext-text-center richtext-text-sm richtext-text-zinc-600", children: [
3302
- r.rows,
3304
+ /* @__PURE__ */ g("div", { className: "richtext-mt-2 richtext-text-center richtext-text-sm richtext-text-zinc-600", children: [
3305
+ o.rows,
3303
3306
  " ",
3304
3307
  "x",
3305
- r.cols
3308
+ o.cols
3306
3309
  ] })
3307
3310
  ] })
3308
3311
  }
@@ -3313,7 +3316,7 @@ function Ya(e) {
3313
3316
  function t(n) {
3314
3317
  e.disabled || e.editor.chain().focus().insertTable({ ...n, withHeaderRow: !1 }).run();
3315
3318
  }
3316
- return /* @__PURE__ */ o(Xa, { createTable: t, children: /* @__PURE__ */ o(
3319
+ return /* @__PURE__ */ r(Xa, { createTable: t, children: /* @__PURE__ */ r(
3317
3320
  y,
3318
3321
  {
3319
3322
  icon: e == null ? void 0 : e.icon,
@@ -3405,12 +3408,12 @@ const Pr = Pn.extend({
3405
3408
  document.removeEventListener("mouseup", n);
3406
3409
  let {
3407
3410
  dispatch: i,
3408
- state: { tr: a, selection: r },
3411
+ state: { tr: a, selection: o },
3409
3412
  dom: s
3410
3413
  } = e;
3411
- s.style.cursor = "", a = a.removeMark(r.from, r.to);
3414
+ s.style.cursor = "", a = a.removeMark(o.from, o.to);
3412
3415
  for (const c of t)
3413
- c.type.name !== "link" && (a = a.addMark(r.from, r.to, c));
3416
+ c.type.name !== "link" && (a = a.addMark(o.from, o.to, c));
3414
3417
  i(a.setMeta("painterAction", { type: "end" }));
3415
3418
  };
3416
3419
  return document.addEventListener("mouseup", n), !0;
@@ -3422,51 +3425,51 @@ const Pr = Pn.extend({
3422
3425
  }
3423
3426
  });
3424
3427
  function Za({ editor: e, ...t }) {
3425
- const { t: n } = B(), [i, a] = k(-1), [r, s] = k([]), [c, l] = k(""), [u, d] = k(""), [g, h] = k(!1), [m, b] = k(!1);
3428
+ const { t: n } = B(), [i, a] = k(-1), [o, s] = k([]), [c, l] = k(""), [u, d] = k(""), [f, m] = k(!1), [h, b] = k(!1);
3426
3429
  return P(() => {
3427
- g || (l(""), d(""), a(-1), s([]), e.commands.setSearchTerm(""), e.commands.setReplaceTerm(""));
3428
- }, [e, g]), P(() => {
3429
- g && e && e.commands && e.commands.setSearchTerm && e.commands.setSearchTerm(c);
3430
- }, [g, c, e]), P(() => {
3431
- g && e && e.commands && e.commands.setReplaceTerm && e.commands.setReplaceTerm(u);
3432
- }, [g, u, e]), P(() => {
3430
+ f || (l(""), d(""), a(-1), s([]), e.commands.setSearchTerm(""), e.commands.setReplaceTerm(""));
3431
+ }, [e, f]), P(() => {
3432
+ f && e && e.commands && e.commands.setSearchTerm && e.commands.setSearchTerm(c);
3433
+ }, [f, c, e]), P(() => {
3434
+ f && e && e.commands && e.commands.setReplaceTerm && e.commands.setReplaceTerm(u);
3435
+ }, [f, u, e]), P(() => {
3433
3436
  if (!e)
3434
3437
  return;
3435
- const x = e.extensionManager.extensions.find((L) => L.name === no.name);
3438
+ const x = e.extensionManager.extensions.find((S) => S.name === no.name);
3436
3439
  if (!x)
3437
3440
  return;
3438
3441
  const N = () => {
3439
- if (!g)
3442
+ if (!f)
3440
3443
  return;
3441
- const L = x ? x.storage.currentIndex : -1, w = x ? x.storage.results : [];
3442
- a((_) => _ !== L ? L : _), s((_) => qn(_, w) ? _ : w);
3444
+ const S = x ? x.storage.currentIndex : -1, p = x ? x.storage.results : [];
3445
+ a((_) => _ !== S ? S : _), s((_) => qn(_, p) ? _ : p);
3443
3446
  };
3444
3447
  return window.addEventListener(Ye, N), () => {
3445
3448
  x && window.removeEventListener(Ye, N);
3446
3449
  };
3447
- }, [g, e]), /* @__PURE__ */ f(
3450
+ }, [f, e]), /* @__PURE__ */ g(
3448
3451
  xe,
3449
3452
  {
3450
- open: g,
3451
- onOpenChange: h,
3453
+ open: f,
3454
+ onOpenChange: m,
3452
3455
  children: [
3453
- /* @__PURE__ */ o(
3456
+ /* @__PURE__ */ r(
3454
3457
  pe,
3455
3458
  {
3456
3459
  disabled: t == null ? void 0 : t.disabled,
3457
3460
  asChild: !0,
3458
- children: /* @__PURE__ */ o(
3461
+ children: /* @__PURE__ */ r(
3459
3462
  y,
3460
3463
  {
3461
3464
  tooltip: t == null ? void 0 : t.tooltip,
3462
3465
  isActive: t == null ? void 0 : t.isActive,
3463
3466
  disabled: t == null ? void 0 : t.disabled,
3464
- children: /* @__PURE__ */ o(D, { name: t == null ? void 0 : t.icon })
3467
+ children: /* @__PURE__ */ r(D, { name: t == null ? void 0 : t.icon })
3465
3468
  }
3466
3469
  )
3467
3470
  }
3468
3471
  ),
3469
- /* @__PURE__ */ f(
3472
+ /* @__PURE__ */ g(
3470
3473
  we,
3471
3474
  {
3472
3475
  hideWhenDetached: !0,
@@ -3474,12 +3477,12 @@ function Za({ editor: e, ...t }) {
3474
3477
  align: "start",
3475
3478
  side: "bottom",
3476
3479
  children: [
3477
- /* @__PURE__ */ f("div", { className: "richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between", children: [
3478
- /* @__PURE__ */ o(De, { children: n("editor.search.dialog.text") }),
3479
- /* @__PURE__ */ o("span", { className: "richtext-font-semibold", children: r.length > 0 ? `${i + 1}/${r.length}` : "0/0" })
3480
+ /* @__PURE__ */ g("div", { className: "richtext-mb-[6px] richtext-flex richtext-items-center richtext-justify-between", children: [
3481
+ /* @__PURE__ */ r(De, { children: n("editor.search.dialog.text") }),
3482
+ /* @__PURE__ */ r("span", { className: "richtext-font-semibold", children: o.length > 0 ? `${i + 1}/${o.length}` : "0/0" })
3480
3483
  ] }),
3481
- /* @__PURE__ */ f("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[10px]", children: [
3482
- /* @__PURE__ */ o(
3484
+ /* @__PURE__ */ g("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[10px]", children: [
3485
+ /* @__PURE__ */ r(
3483
3486
  Oe,
3484
3487
  {
3485
3488
  type: "text",
@@ -3491,11 +3494,11 @@ function Za({ editor: e, ...t }) {
3491
3494
  onChange: (x) => l(x.target.value)
3492
3495
  }
3493
3496
  ),
3494
- /* @__PURE__ */ o(O, { disabled: r.length === 0, className: "richtext-flex-1", onClick: e.commands.goToPrevSearchResult, children: /* @__PURE__ */ o(D, { name: "ChevronUp" }) }),
3495
- /* @__PURE__ */ o(O, { disabled: r.length === 0, className: "richtext-flex-1", onClick: e.commands.goToNextSearchResult, children: /* @__PURE__ */ o(D, { name: "ChevronDown" }) })
3497
+ /* @__PURE__ */ r(O, { disabled: o.length === 0, className: "richtext-flex-1", onClick: e.commands.goToPrevSearchResult, children: /* @__PURE__ */ r(D, { name: "ChevronUp" }) }),
3498
+ /* @__PURE__ */ r(O, { disabled: o.length === 0, className: "richtext-flex-1", onClick: e.commands.goToNextSearchResult, children: /* @__PURE__ */ r(D, { name: "ChevronDown" }) })
3496
3499
  ] }),
3497
- /* @__PURE__ */ o(De, { className: "richtext-mb-[6px]", children: n("editor.replace.dialog.text") }),
3498
- /* @__PURE__ */ o("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[5px]", children: /* @__PURE__ */ o("div", { className: "richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ o(
3500
+ /* @__PURE__ */ r(De, { className: "richtext-mb-[6px]", children: n("editor.replace.dialog.text") }),
3501
+ /* @__PURE__ */ r("div", { className: "richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5 richtext-mb-[5px]", children: /* @__PURE__ */ r("div", { className: "richtext-relative richtext-items-center richtext-w-full richtext-max-w-sm", children: /* @__PURE__ */ r(
3499
3502
  Oe,
3500
3503
  {
3501
3504
  type: "text",
@@ -3506,21 +3509,21 @@ function Za({ editor: e, ...t }) {
3506
3509
  onChange: (x) => d(x.target.value)
3507
3510
  }
3508
3511
  ) }) }),
3509
- /* @__PURE__ */ f("div", { className: "richtext-flex richtext-items-center richtext-space-x-2 richtext-mb-[10px]", children: [
3510
- /* @__PURE__ */ o(
3512
+ /* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-space-x-2 richtext-mb-[10px]", children: [
3513
+ /* @__PURE__ */ r(
3511
3514
  bi,
3512
3515
  {
3513
- checked: m,
3516
+ checked: h,
3514
3517
  onCheckedChange: (x) => {
3515
3518
  b(x), e.commands.setCaseSensitive(x);
3516
3519
  }
3517
3520
  }
3518
3521
  ),
3519
- /* @__PURE__ */ o(De, { children: n("editor.replace.caseSensitive") })
3522
+ /* @__PURE__ */ r(De, { children: n("editor.replace.caseSensitive") })
3520
3523
  ] }),
3521
- /* @__PURE__ */ f("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
3522
- /* @__PURE__ */ o(O, { disabled: r.length === 0, className: "richtext-flex-1", onClick: e.commands.replace, children: n("editor.replace.dialog.text") }),
3523
- /* @__PURE__ */ o(O, { disabled: r.length === 0, className: "richtext-flex-1", onClick: e.commands.replaceAll, children: n("editor.replaceAll.dialog.text") })
3524
+ /* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-gap-[10px]", children: [
3525
+ /* @__PURE__ */ r(O, { disabled: o.length === 0, className: "richtext-flex-1", onClick: e.commands.replace, children: n("editor.replace.dialog.text") }),
3526
+ /* @__PURE__ */ r(O, { disabled: o.length === 0, className: "richtext-flex-1", onClick: e.commands.replaceAll, children: n("editor.replaceAll.dialog.text") })
3524
3527
  ] })
3525
3528
  ]
3526
3529
  }
@@ -3536,7 +3539,7 @@ function Ja(e, t, n) {
3536
3539
  function Qa(e, t, n) {
3537
3540
  const i = [];
3538
3541
  let a = [];
3539
- const r = [];
3542
+ const o = [];
3540
3543
  let s = 0;
3541
3544
  if (!t)
3542
3545
  return { decorationsToReturn: [], results: [] };
@@ -3554,53 +3557,53 @@ function Qa(e, t, n) {
3554
3557
  for (const d of u) {
3555
3558
  if (d[0] === "")
3556
3559
  break;
3557
- d.index !== void 0 && r.push({
3560
+ d.index !== void 0 && o.push({
3558
3561
  from: l + d.index,
3559
3562
  to: l + d.index + d[0].length
3560
3563
  });
3561
3564
  }
3562
3565
  }
3563
- for (const c of r)
3566
+ for (const c of o)
3564
3567
  i.push(ge.inline(c.from, c.to, { class: n }));
3565
3568
  return {
3566
3569
  decorationsToReturn: i,
3567
- results: r
3570
+ results: o
3568
3571
  };
3569
3572
  }
3570
3573
  function Lt(e, t, { state: n, dispatch: i }) {
3571
3574
  if (!t[0])
3572
3575
  return;
3573
- const { from: r, to: s } = t[0];
3574
- i && i(n.tr.insertText(e, r, s));
3576
+ const { from: o, to: s } = t[0];
3577
+ i && i(n.tr.insertText(e, o, s));
3575
3578
  }
3576
3579
  function eo(e, t, n, i) {
3577
3580
  const a = t + 1;
3578
3581
  if (!i[a])
3579
3582
  return null;
3580
- const { from: r, to: s } = i[t], c = s - r - e.length + n, { from: l, to: u } = i[a];
3583
+ const { from: o, to: s } = i[t], c = s - o - e.length + n, { from: l, to: u } = i[a];
3581
3584
  return i[a] = {
3582
3585
  to: u - c,
3583
3586
  from: l - c
3584
3587
  }, [c, i];
3585
3588
  }
3586
3589
  function to(e, t, { tr: n, dispatch: i }) {
3587
- let a = 0, r = t.slice();
3588
- if (r.length === 0)
3590
+ let a = 0, o = t.slice();
3591
+ if (o.length === 0)
3589
3592
  return !1;
3590
- for (let s = 0; s < r.length; s += 1) {
3591
- const { from: c, to: l } = r[s];
3593
+ for (let s = 0; s < o.length; s += 1) {
3594
+ const { from: c, to: l } = o[s];
3592
3595
  n.insertText(e, c, l);
3593
- const u = eo(e, s, a, r);
3594
- u && (a = u[0], r = u[1]);
3596
+ const u = eo(e, s, a, o);
3597
+ u && (a = u[0], o = u[1]);
3595
3598
  }
3596
3599
  return i(n), !0;
3597
3600
  }
3598
3601
  function St({ view: e, tr: t, searchResults: n, searchResultCurrentClass: i, gotoIndex: a }) {
3599
- const r = n[a];
3600
- if (r) {
3602
+ const o = n[a];
3603
+ if (o) {
3601
3604
  const s = t.setMeta("directDecoration", {
3602
- fromPos: r.from,
3603
- toPos: r.to,
3605
+ fromPos: o.from,
3606
+ toPos: o.to,
3604
3607
  attrs: { class: i }
3605
3608
  });
3606
3609
  return e == null || e.dispatch(s), setTimeout(() => {
@@ -3652,31 +3655,31 @@ const Ye = "ON_SEARCH_RESULTS", de = new CustomEvent(Ye), no = H.create({
3652
3655
  setReplaceTerm: (e) => ({ state: t, dispatch: n }) => (this.options.replaceTerm = e, ve(t, n), !1),
3653
3656
  setCaseSensitive: (e) => ({ state: t, dispatch: n }) => (this.options.caseSensitive = e, ve(t, n), !1),
3654
3657
  replace: () => ({ state: e, dispatch: t }) => {
3655
- const { replaceTerm: n } = this.options, { currentIndex: i, results: a } = this.storage, r = a[i];
3656
- return r ? (Lt(n, [r], { state: e, dispatch: t }), this.storage.results.splice(i, 1)) : (Lt(n, a, { state: e, dispatch: t }), this.storage.results.shift()), window.dispatchEvent(de), ve(e, t), !1;
3658
+ const { replaceTerm: n } = this.options, { currentIndex: i, results: a } = this.storage, o = a[i];
3659
+ return o ? (Lt(n, [o], { state: e, dispatch: t }), this.storage.results.splice(i, 1)) : (Lt(n, a, { state: e, dispatch: t }), this.storage.results.shift()), window.dispatchEvent(de), ve(e, t), !1;
3657
3660
  },
3658
3661
  replaceAll: () => ({ state: e, tr: t, dispatch: n }) => {
3659
3662
  const { replaceTerm: i } = this.options, { results: a } = this.storage;
3660
3663
  return to(i, a, { tr: t, dispatch: n }), this.storage.currentIndex = -1, this.storage.results = [], window.dispatchEvent(de), ve(e, n), !1;
3661
3664
  },
3662
3665
  goToPrevSearchResult: () => ({ view: e, tr: t }) => {
3663
- const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, r = (i + a.length - 1) % a.length;
3664
- return this.storage.currentIndex = r, window.dispatchEvent(de), St({
3666
+ const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, o = (i + a.length - 1) % a.length;
3667
+ return this.storage.currentIndex = o, window.dispatchEvent(de), St({
3665
3668
  view: e,
3666
3669
  tr: t,
3667
3670
  searchResults: a,
3668
3671
  searchResultCurrentClass: n,
3669
- gotoIndex: r
3672
+ gotoIndex: o
3670
3673
  });
3671
3674
  },
3672
3675
  goToNextSearchResult: () => ({ view: e, tr: t }) => {
3673
- const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, r = (i + 1) % a.length;
3674
- return this.storage.currentIndex = r, this.options.onChange && this.options.onChange(), window.dispatchEvent(de), St({
3676
+ const { searchResultCurrentClass: n } = this.options, { currentIndex: i, results: a } = this.storage, o = (i + 1) % a.length;
3677
+ return this.storage.currentIndex = o, this.options.onChange && this.options.onChange(), window.dispatchEvent(de), St({
3675
3678
  view: e,
3676
3679
  tr: t,
3677
3680
  searchResults: a,
3678
3681
  searchResultCurrentClass: n,
3679
- gotoIndex: r
3682
+ gotoIndex: o
3680
3683
  });
3681
3684
  }
3682
3685
  };
@@ -3691,16 +3694,16 @@ const Ye = "ON_SEARCH_RESULTS", de = new CustomEvent(Ye), no = H.create({
3691
3694
  return me.empty;
3692
3695
  },
3693
3696
  apply(t) {
3694
- const { doc: n, docChanged: i } = t, { searchTerm: a, searchResultClass: r, searchResultCurrentClass: s, disableRegex: c, caseSensitive: l } = e.options;
3697
+ const { doc: n, docChanged: i } = t, { searchTerm: a, searchResultClass: o, searchResultCurrentClass: s, disableRegex: c, caseSensitive: l } = e.options;
3695
3698
  if (i || a) {
3696
3699
  const { decorationsToReturn: u, results: d } = Qa(
3697
3700
  n,
3698
3701
  Ja(a, c, l),
3699
- r
3702
+ o
3700
3703
  );
3701
3704
  if (e.storage.results = d, e.storage.currentIndex > d.length - 1 && (e.storage.currentIndex = 0), window.dispatchEvent(de), t.getMeta("directDecoration")) {
3702
- const { fromPos: g, toPos: h, attrs: m } = t.getMeta("directDecoration");
3703
- u.push(ge.inline(g, h, m));
3705
+ const { fromPos: f, toPos: m, attrs: h } = t.getMeta("directDecoration");
3706
+ u.push(ge.inline(f, m, h));
3704
3707
  } else
3705
3708
  d.length > 0 && (u[0] = ge.inline(d[0].from, d[0].to, {
3706
3709
  class: s
@@ -3723,7 +3726,7 @@ function io({
3723
3726
  className: e,
3724
3727
  ...t
3725
3728
  }) {
3726
- return /* @__PURE__ */ o(
3729
+ return /* @__PURE__ */ r(
3727
3730
  ae.Root,
3728
3731
  {
3729
3732
  className: E(
@@ -3739,14 +3742,14 @@ function ao({
3739
3742
  className: e,
3740
3743
  ...t
3741
3744
  }) {
3742
- return /* @__PURE__ */ f(
3745
+ return /* @__PURE__ */ g(
3743
3746
  "div",
3744
3747
  {
3745
3748
  className: E("richtext-flex richtext-h-9 richtext-items-center richtext-gap-2 richtext-border-b richtext-px-3", e),
3746
3749
  "data-slot": "emoji-picker-search-wrapper",
3747
3750
  children: [
3748
- /* @__PURE__ */ o(Yn, { className: "richtext-size-4 richtext-shrink-0 richtext-opacity-50" }),
3749
- /* @__PURE__ */ o(
3751
+ /* @__PURE__ */ r(Yn, { className: "richtext-size-4 richtext-shrink-0 richtext-opacity-50" }),
3752
+ /* @__PURE__ */ r(
3750
3753
  ae.Search,
3751
3754
  {
3752
3755
  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",
@@ -3759,14 +3762,14 @@ function ao({
3759
3762
  );
3760
3763
  }
3761
3764
  function oo({ children: e, ...t }) {
3762
- return /* @__PURE__ */ o("div", { ...t, className: "richtext-scroll-my-1 richtext-px-1", "data-slot": "emoji-picker-row", children: e });
3765
+ return /* @__PURE__ */ r("div", { ...t, className: "richtext-scroll-my-1 richtext-px-1", "data-slot": "emoji-picker-row", children: e });
3763
3766
  }
3764
3767
  function ro({
3765
3768
  emoji: e,
3766
3769
  className: t,
3767
3770
  ...n
3768
3771
  }) {
3769
- return /* @__PURE__ */ o(
3772
+ return /* @__PURE__ */ r(
3770
3773
  "button",
3771
3774
  {
3772
3775
  ...n,
@@ -3783,7 +3786,7 @@ function so({
3783
3786
  category: e,
3784
3787
  ...t
3785
3788
  }) {
3786
- return /* @__PURE__ */ o(
3789
+ return /* @__PURE__ */ r(
3787
3790
  "div",
3788
3791
  {
3789
3792
  ...t,
@@ -3797,22 +3800,22 @@ function co({
3797
3800
  className: e,
3798
3801
  ...t
3799
3802
  }) {
3800
- return /* @__PURE__ */ f(
3803
+ return /* @__PURE__ */ g(
3801
3804
  ae.Viewport,
3802
3805
  {
3803
3806
  className: E("richtext-outline-hidden richtext-relative richtext-flex-1", e),
3804
3807
  "data-slot": "emoji-picker-viewport",
3805
3808
  ...t,
3806
3809
  children: [
3807
- /* @__PURE__ */ o(
3810
+ /* @__PURE__ */ r(
3808
3811
  ae.Loading,
3809
3812
  {
3810
3813
  className: "richtext-absolute richtext-inset-0 richtext-flex richtext-items-center richtext-justify-center richtext-text-muted-foreground",
3811
3814
  "data-slot": "emoji-picker-loading",
3812
- children: /* @__PURE__ */ o(Zn, { className: "richtext-size-4 richtext-animate-spin" })
3815
+ children: /* @__PURE__ */ r(Zn, { className: "richtext-size-4 richtext-animate-spin" })
3813
3816
  }
3814
3817
  ),
3815
- /* @__PURE__ */ o(
3818
+ /* @__PURE__ */ r(
3816
3819
  ae.Empty,
3817
3820
  {
3818
3821
  className: "richtext-absolute richtext-inset-0 richtext-flex richtext-items-center richtext-justify-center richtext-text-muted-foreground richtext-text-sm",
@@ -3820,7 +3823,7 @@ function co({
3820
3823
  children: "No emoji found."
3821
3824
  }
3822
3825
  ),
3823
- /* @__PURE__ */ o(
3826
+ /* @__PURE__ */ r(
3824
3827
  ae.List,
3825
3828
  {
3826
3829
  className: "richtext-select-none richtext-pb-1",
@@ -3840,7 +3843,7 @@ function lo({
3840
3843
  className: e,
3841
3844
  ...t
3842
3845
  }) {
3843
- return /* @__PURE__ */ o(
3846
+ return /* @__PURE__ */ r(
3844
3847
  "div",
3845
3848
  {
3846
3849
  className: E(
@@ -3849,24 +3852,24 @@ function lo({
3849
3852
  ),
3850
3853
  "data-slot": "emoji-picker-footer",
3851
3854
  ...t,
3852
- children: /* @__PURE__ */ o(ae.ActiveEmoji, { children: ({ emoji: n }) => n ? /* @__PURE__ */ f(oe, { children: [
3853
- /* @__PURE__ */ o("div", { className: "richtext-flex richtext-size-7 richtext-flex-none richtext-items-center richtext-justify-center richtext-text-lg", children: n.emoji }),
3854
- /* @__PURE__ */ o("span", { className: "richtext-text-secondary-foreground richtext-truncate richtext-text-xs", children: n.label })
3855
- ] }) : /* @__PURE__ */ o("span", { className: "richtext-text-muted-foreground richtext-ml-1.5 richtext-flex richtext-h-7 richtext-items-center richtext-truncate richtext-text-xs", children: "Select an emoji…" }) })
3855
+ children: /* @__PURE__ */ r(ae.ActiveEmoji, { children: ({ emoji: n }) => n ? /* @__PURE__ */ g(oe, { children: [
3856
+ /* @__PURE__ */ r("div", { className: "richtext-flex richtext-size-7 richtext-flex-none richtext-items-center richtext-justify-center richtext-text-lg", children: n.emoji }),
3857
+ /* @__PURE__ */ r("span", { className: "richtext-text-secondary-foreground richtext-truncate richtext-text-xs", children: n.label })
3858
+ ] }) : /* @__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…" }) })
3856
3859
  }
3857
3860
  );
3858
3861
  }
3859
3862
  function uo({ onSelectEmoji: e, children: t }) {
3860
- return /* @__PURE__ */ f(xe, { modal: !0, children: [
3861
- /* @__PURE__ */ o(pe, { asChild: !0, children: t }),
3862
- /* @__PURE__ */ o(
3863
+ return /* @__PURE__ */ g(xe, { modal: !0, children: [
3864
+ /* @__PURE__ */ r(pe, { asChild: !0, children: t }),
3865
+ /* @__PURE__ */ r(
3863
3866
  we,
3864
3867
  {
3865
3868
  align: "start",
3866
3869
  className: "richtext-size-full richtext-p-2",
3867
3870
  hideWhenDetached: !0,
3868
3871
  side: "bottom",
3869
- children: /* @__PURE__ */ f(
3872
+ children: /* @__PURE__ */ g(
3870
3873
  io,
3871
3874
  {
3872
3875
  className: "!richtext-h-[342px]",
@@ -3874,9 +3877,9 @@ function uo({ onSelectEmoji: e, children: t }) {
3874
3877
  e(n);
3875
3878
  },
3876
3879
  children: [
3877
- /* @__PURE__ */ o(ao, {}),
3878
- /* @__PURE__ */ o(co, {}),
3879
- /* @__PURE__ */ o(lo, {})
3880
+ /* @__PURE__ */ r(ao, {}),
3881
+ /* @__PURE__ */ r(co, {}),
3882
+ /* @__PURE__ */ r(lo, {})
3880
3883
  ]
3881
3884
  }
3882
3885
  )
@@ -3887,12 +3890,12 @@ function uo({ onSelectEmoji: e, children: t }) {
3887
3890
  function ho({ editor: e, icon: t, ...n }) {
3888
3891
  const i = j(
3889
3892
  (a) => {
3890
- const { selection: r } = e.state, { $anchor: s } = r;
3893
+ const { selection: o } = e.state, { $anchor: s } = o;
3891
3894
  return e.chain().insertContentAt(s.pos, a).run();
3892
3895
  },
3893
3896
  [e]
3894
3897
  );
3895
- return /* @__PURE__ */ o(uo, { onSelectEmoji: i, children: /* @__PURE__ */ o(
3898
+ return /* @__PURE__ */ r(uo, { onSelectEmoji: i, children: /* @__PURE__ */ r(
3896
3899
  y,
3897
3900
  {
3898
3901
  icon: t,
@@ -3901,9 +3904,9 @@ function ho({ editor: e, icon: t, ...n }) {
3901
3904
  ) });
3902
3905
  }
3903
3906
  const Qt = Qe((e, t) => {
3904
- const n = X(null), [i, a] = k(0), { t: r } = B(), s = (d) => {
3905
- const g = e.items[d];
3906
- g && e.command(g);
3907
+ const n = X(null), [i, a] = k(0), { t: o } = B(), s = (d) => {
3908
+ const f = e.items[d];
3909
+ f && e.command(f);
3907
3910
  }, c = () => {
3908
3911
  a((i + e.items.length - 1) % e.items.length);
3909
3912
  }, l = () => {
@@ -3918,13 +3921,13 @@ const Qt = Qe((e, t) => {
3918
3921
  d && ht(d, { behavior: "smooth", scrollMode: "if-needed" });
3919
3922
  }, [i]), et(t, () => ({
3920
3923
  onKeyDown: ({ event: d }) => d.key === "ArrowUp" ? (c(), !0) : d.key === "ArrowDown" ? (l(), !0) : d.key === "Enter" ? (u(), !0) : !1
3921
- })), /* @__PURE__ */ o("div", { className: "richtext-max-h-[320px] richtext-w-[200px] richtext-overflow-y-auto richtext-overflow-x-hidden richtext-rounded-sm !richtext-border richtext-bg-popover richtext-p-1 richtext-text-popover-foreground richtext-shadow-md richtext-outline-none", children: /* @__PURE__ */ o("div", { ref: n, children: e.items.length > 0 ? e.items.map((d, g) => /* @__PURE__ */ f(
3924
+ })), /* @__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((d, f) => /* @__PURE__ */ g(
3922
3925
  "span",
3923
3926
  {
3924
- className: U(" 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", g === i ? "bg-accent" : ""),
3925
- onClick: () => s(g),
3927
+ className: U(" 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", f === i ? "bg-accent" : ""),
3928
+ onClick: () => s(f),
3926
3929
  children: [
3927
- d.fallbackImage ? /* @__PURE__ */ o(
3930
+ d.fallbackImage ? /* @__PURE__ */ r(
3928
3931
  "img",
3929
3932
  {
3930
3933
  className: "richtext-size-[1em]",
@@ -3936,8 +3939,8 @@ const Qt = Qe((e, t) => {
3936
3939
  ":"
3937
3940
  ]
3938
3941
  },
3939
- `emoji-list-code-${g}`
3940
- )) : /* @__PURE__ */ o("div", { className: "richtext-relative richtext-flex richtext-cursor-default richtext-select-none richtext-items-center richtext-rounded-sm richtext-px-2 richtext-py-1.5 richtext-text-sm richtext-outline-none richtext-transition-colors", children: /* @__PURE__ */ o("span", { children: r("no_result_found") }) }) }) });
3942
+ `emoji-list-code-${f}`
3943
+ )) : /* @__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") }) }) }) });
3941
3944
  });
3942
3945
  Qt.displayName = "EmojiList";
3943
3946
  const _e = {
@@ -5901,8 +5904,8 @@ function bo(e) {
5901
5904
  }
5902
5905
  n.close();
5903
5906
  }, 10);
5904
- } catch (r) {
5905
- console.error(r);
5907
+ } catch (o) {
5908
+ console.error(o);
5906
5909
  }
5907
5910
  setTimeout(() => {
5908
5911
  document.body.removeChild(t);
@@ -5936,8 +5939,8 @@ const jr = H.create({
5936
5939
  });
5937
5940
  function po(e, t) {
5938
5941
  const n = atob(e.split(",")[1]), i = Array.from({ length: n.length });
5939
- for (let r = 0; r < n.length; r++)
5940
- i[r] = n.charCodeAt(r);
5942
+ for (let o = 0; o < n.length; o++)
5943
+ i[o] = n.charCodeAt(o);
5941
5944
  const a = new Uint8Array(i);
5942
5945
  return new Blob([a], { type: t });
5943
5946
  }
@@ -5945,74 +5948,74 @@ function wo(e, t) {
5945
5948
  return new File([e], t, { type: e.type });
5946
5949
  }
5947
5950
  function yo(e) {
5948
- const { toast: t } = xi(), { t: n } = B(), [i, a] = k(!1), r = X(null);
5951
+ const { toast: t } = xi(), { t: n } = B(), [i, a] = k(!1), o = X(null);
5949
5952
  function s() {
5950
- var g;
5951
- (g = r.current) == null || g.click();
5953
+ var f;
5954
+ (f = o.current) == null || f.click();
5952
5955
  }
5953
- function c(g) {
5954
- const h = g.target.files[0];
5955
- if (h) {
5956
- if (h.size > e.limit) {
5956
+ function c(f) {
5957
+ const m = f.target.files[0];
5958
+ if (m) {
5959
+ if (m.size > e.limit) {
5957
5960
  t({
5958
5961
  variant: "destructive",
5959
5962
  title: n("editor.importWord.limitSize")
5960
5963
  });
5961
5964
  return;
5962
5965
  }
5963
- u(h);
5966
+ u(m);
5964
5967
  }
5965
5968
  }
5966
- async function l(g) {
5969
+ async function l(f) {
5967
5970
  var N;
5968
- const m = new DOMParser().parseFromString(g, "text/html"), b = m.querySelectorAll("img");
5971
+ const h = new DOMParser().parseFromString(f, "text/html"), b = h.querySelectorAll("img");
5969
5972
  if (b.length === 0)
5970
- return m.body.innerHTML;
5973
+ return h.body.innerHTML;
5971
5974
  if (pi(e.editor, "image")) {
5972
- const L = (N = e.editor.extensionManager.extensions.find(
5973
- (w) => w.name === "importWord"
5975
+ const S = (N = e.editor.extensionManager.extensions.find(
5976
+ (p) => p.name === "importWord"
5974
5977
  )) == null ? void 0 : N.options;
5975
- if (L && typeof L.upload == "function") {
5976
- const w = [];
5977
- for (const p of b) {
5978
- const C = p.getAttribute("src"), T = po(C, "image/jpeg"), S = wo(T, "image.jpeg");
5979
- w.push(S);
5978
+ if (S && typeof S.upload == "function") {
5979
+ const p = [];
5980
+ for (const w of b) {
5981
+ const C = w.getAttribute("src"), T = po(C, "image/jpeg"), L = wo(T, "image.jpeg");
5982
+ p.push(L);
5980
5983
  }
5981
- const _ = await L.upload(w);
5982
- for (const [p, C] of b.entries()) {
5983
- C.setAttribute("src", _[p].src);
5984
+ const _ = await S.upload(p);
5985
+ for (const [w, C] of b.entries()) {
5986
+ C.setAttribute("src", _[w].src);
5984
5987
  const T = C.parentElement;
5985
5988
  (T == null ? void 0 : T.tagName) === "P" && (T.insertAdjacentElement("beforebegin", C), !T.hasChildNodes() && T.textContent === "" && T.remove());
5986
5989
  }
5987
- return m.body.innerHTML;
5990
+ return h.body.innerHTML;
5988
5991
  } else
5989
- return console.warn("Image Upload method found, skip image conversion"), m.body.innerHTML;
5992
+ return console.warn("Image Upload method found, skip image conversion"), h.body.innerHTML;
5990
5993
  } else
5991
- return console.error("Image extension not found, unable to convert image"), m.body.innerHTML;
5994
+ return console.error("Image extension not found, unable to convert image"), h.body.innerHTML;
5992
5995
  }
5993
- async function u(g) {
5996
+ async function u(f) {
5994
5997
  a(!0);
5995
5998
  try {
5996
5999
  if (e.convert) {
5997
- const h = await e.convert(g);
5998
- d(h);
6000
+ const m = await e.convert(f);
6001
+ d(m);
5999
6002
  } else {
6000
- const h = await g.arrayBuffer(), { value: m } = await Kn.convertToHtml(
6001
- { arrayBuffer: h },
6003
+ const m = await f.arrayBuffer(), { value: h } = await Kn.convertToHtml(
6004
+ { arrayBuffer: m },
6002
6005
  e == null ? void 0 : e.mammothOptions
6003
6006
  );
6004
- d(m);
6007
+ d(h);
6005
6008
  }
6006
6009
  } finally {
6007
6010
  a(!1);
6008
6011
  }
6009
6012
  }
6010
- async function d(g) {
6011
- const h = await l(g);
6012
- e.editor.chain().setContent(h, !0).run();
6013
+ async function d(f) {
6014
+ const m = await l(f);
6015
+ e.editor.chain().setContent(m, !0).run();
6013
6016
  }
6014
- return /* @__PURE__ */ f("div", { children: [
6015
- /* @__PURE__ */ o(
6017
+ return /* @__PURE__ */ g("div", { children: [
6018
+ /* @__PURE__ */ r(
6016
6019
  y,
6017
6020
  {
6018
6021
  action: s,
@@ -6022,12 +6025,12 @@ function yo(e) {
6022
6025
  tooltip: e == null ? void 0 : e.tooltip
6023
6026
  }
6024
6027
  ),
6025
- /* @__PURE__ */ o(
6028
+ /* @__PURE__ */ r(
6026
6029
  "input",
6027
6030
  {
6028
6031
  accept: ".docx",
6029
6032
  onChange: c,
6030
- ref: r,
6033
+ ref: o,
6031
6034
  type: "file",
6032
6035
  style: {
6033
6036
  display: "none"
@@ -6047,13 +6050,13 @@ const Br = H.create({
6047
6050
  limit: 1024 * 1024 * 10,
6048
6051
  // 10 MB
6049
6052
  button: ({ editor: t, extension: n, t: i }) => {
6050
- const { convert: a, limit: r, mammothOptions: s } = n.options;
6053
+ const { convert: a, limit: o, mammothOptions: s } = n.options;
6051
6054
  return {
6052
6055
  component: yo,
6053
6056
  componentProps: {
6054
6057
  editor: t,
6055
6058
  convert: a,
6056
- limit: r,
6059
+ limit: o,
6057
6060
  mammothOptions: s,
6058
6061
  action: () => t.commands.setHorizontalRule(),
6059
6062
  disabled: !t.can().setHorizontalRule(),
@@ -6121,8 +6124,8 @@ const Co = {
6121
6124
  exportToWord: () => async ({ editor: e }) => {
6122
6125
  const t = {
6123
6126
  getImageBuffer: async (i) => {
6124
- const r = await (await fetch(i)).arrayBuffer();
6125
- return new Uint8Array(r);
6127
+ const o = await (await fetch(i)).arrayBuffer();
6128
+ return new Uint8Array(o);
6126
6129
  }
6127
6130
  }, n = No.serialize(e.state.doc, t);
6128
6131
  return zi.toBlob(n).then((i) => ko(new Blob([i]), "export-document.docx")), !0;
@@ -6138,14 +6141,14 @@ const Co = {
6138
6141
  function Mo(e) {
6139
6142
  const t = [], n = [t];
6140
6143
  return e.forEach((i) => {
6141
- let a = -1, r = n[i.level + a];
6142
- for (; !r; )
6143
- a -= 1, r = n[i.level + a];
6144
- r.push({ ...i, children: n[i.level] = [] });
6144
+ let a = -1, o = n[i.level + a];
6145
+ for (; !o; )
6146
+ a -= 1, o = n[i.level + a];
6147
+ o.push({ ...i, children: n[i.level] = [] });
6145
6148
  }), t;
6146
6149
  }
6147
6150
  function Io({ editor: e }) {
6148
- const t = at(), [n, i] = k([]), { t: a } = B(), r = j(() => {
6151
+ const t = at(), [n, i] = k([]), { t: a } = B(), o = j(() => {
6149
6152
  const s = [], c = e.state.tr;
6150
6153
  e.state.doc.descendants((l, u) => {
6151
6154
  if (l.type.name === "heading") {
@@ -6164,23 +6167,23 @@ function Io({ editor: e }) {
6164
6167
  return P(() => {
6165
6168
  if (e) {
6166
6169
  if (!e.options.editable) {
6167
- r();
6170
+ o();
6168
6171
  return;
6169
6172
  }
6170
- return e.on("update", r), () => {
6171
- e.off("update", r);
6173
+ return e.on("update", o), () => {
6174
+ e.off("update", o);
6172
6175
  };
6173
6176
  }
6174
- }, [e, r]), P(() => {
6175
- r();
6176
- }, []), /* @__PURE__ */ o(he, { className: U("tableOfContent", ze.toc, t && ze.visible), children: t ? /* @__PURE__ */ f("div", { style: { position: "relative" }, children: [
6177
- /* @__PURE__ */ o("p", { className: "text-[20px] richtext-mb-[8px] richtext-font-semibold", children: a("editor.table_of_content") }),
6178
- /* @__PURE__ */ o("ul", { className: ze.list, children: n.map((s, c) => /* @__PURE__ */ o(
6177
+ }, [e, o]), P(() => {
6178
+ o();
6179
+ }, []), /* @__PURE__ */ r(he, { className: U("tableOfContent", ze.toc, t && ze.visible), children: t ? /* @__PURE__ */ g("div", { style: { position: "relative" }, children: [
6180
+ /* @__PURE__ */ r("p", { className: "text-[20px] richtext-mb-[8px] richtext-font-semibold", children: a("editor.table_of_content") }),
6181
+ /* @__PURE__ */ r("ul", { className: ze.list, children: n.map((s, c) => /* @__PURE__ */ r(
6179
6182
  "li",
6180
6183
  {
6181
6184
  className: ze.item,
6182
6185
  style: { paddingLeft: `${s.level - 1}rem` },
6183
- children: /* @__PURE__ */ o("a", { href: `#${s.id}`, children: s.text })
6186
+ children: /* @__PURE__ */ r("a", { href: `#${s.id}`, children: s.text })
6184
6187
  },
6185
6188
  `table-of-content-${c}`
6186
6189
  )) })
@@ -6205,7 +6208,7 @@ function Ho({ editor: e, icon: t, tooltip: n }) {
6205
6208
  }
6206
6209
  e.chain().focus().setTableOfContents().run();
6207
6210
  }, [e, i]);
6208
- return /* @__PURE__ */ o(
6211
+ return /* @__PURE__ */ r(
6209
6212
  y,
6210
6213
  {
6211
6214
  action: a,
@@ -6221,8 +6224,8 @@ function zo(e) {
6221
6224
  function Ro(e, t) {
6222
6225
  const i = [e.getJSON()], a = [];
6223
6226
  for (; i.length > 0; ) {
6224
- const r = i.shift();
6225
- r.type === t && a.push(r), r.content && r.content.length > 0 && i.push(...r.content);
6227
+ const o = i.shift();
6228
+ o.type === t && a.push(o), o.content && o.content.length > 0 && i.push(...o.content);
6226
6229
  }
6227
6230
  return a;
6228
6231
  }
@@ -6273,8 +6276,8 @@ const Po = Ae.create({
6273
6276
  }
6274
6277
  const a = n.props.state.doc.content.firstChild;
6275
6278
  if (zo(a)) {
6276
- const r = (a.firstChild && a.firstChild.nodeSize || 0) + 1;
6277
- return e.insertContentAt(r, { type: this.name });
6279
+ const o = (a.firstChild && a.firstChild.nodeSize || 0) + 1;
6280
+ return e.insertContentAt(o, { type: this.name });
6278
6281
  }
6279
6282
  return e.insertContent({
6280
6283
  type: this.name
@@ -6282,9 +6285,9 @@ const Po = Ae.create({
6282
6285
  },
6283
6286
  removeTableOfContents: () => ({ state: e, dispatch: t }) => {
6284
6287
  const { tr: n } = e, i = e.schema.nodes.tableOfContents;
6285
- return e.doc.descendants((a, r) => {
6288
+ return e.doc.descendants((a, o) => {
6286
6289
  if (a.type === i) {
6287
- const s = r, c = r + a.nodeSize;
6290
+ const s = o, c = o + a.nodeSize;
6288
6291
  n.delete(s, c);
6289
6292
  }
6290
6293
  }), n.docChanged ? (t(n), !0) : !1;
@@ -6307,8 +6310,8 @@ const Po = Ae.create({
6307
6310
  function Do(e) {
6308
6311
  var n;
6309
6312
  const t = R(() => {
6310
- var r;
6311
- const i = (r = e == null ? void 0 : e.items) == null ? void 0 : r.find((s) => s.isActive());
6313
+ var o;
6314
+ const i = (o = e == null ? void 0 : e.items) == null ? void 0 : o.find((s) => s.isActive());
6312
6315
  return i && !i.default ? {
6313
6316
  ...i,
6314
6317
  icon: i.icon ? i.icon : e.icon
@@ -6318,20 +6321,20 @@ function Do(e) {
6318
6321
  isActive: () => !1
6319
6322
  };
6320
6323
  }, [e]);
6321
- return /* @__PURE__ */ f(xe, { modal: !0, children: [
6322
- /* @__PURE__ */ o(
6324
+ return /* @__PURE__ */ g(xe, { modal: !0, children: [
6325
+ /* @__PURE__ */ r(
6323
6326
  pe,
6324
6327
  {
6325
6328
  asChild: !0,
6326
6329
  disabled: e == null ? void 0 : e.disabled,
6327
- children: /* @__PURE__ */ o(
6330
+ children: /* @__PURE__ */ r(
6328
6331
  y,
6329
6332
  {
6330
6333
  customClass: "!richtext-w-12 richtext-h-12",
6331
6334
  disabled: e == null ? void 0 : e.disabled,
6332
6335
  icon: e == null ? void 0 : e.icon,
6333
6336
  tooltip: e == null ? void 0 : e.tooltip,
6334
- children: /* @__PURE__ */ o(
6337
+ children: /* @__PURE__ */ r(
6335
6338
  D,
6336
6339
  {
6337
6340
  className: "richtext-ml-1 richtext-size-3 richtext-text-zinc-500",
@@ -6342,16 +6345,16 @@ function Do(e) {
6342
6345
  )
6343
6346
  }
6344
6347
  ),
6345
- /* @__PURE__ */ o(
6348
+ /* @__PURE__ */ r(
6346
6349
  we,
6347
6350
  {
6348
6351
  align: "start",
6349
6352
  className: "richtext-flex richtext-w-full richtext-min-w-4 richtext-flex-row richtext-gap-1 !richtext-p-[4px]",
6350
6353
  side: "bottom",
6351
6354
  children: (n = e == null ? void 0 : e.items) == null ? void 0 : n.map((i, a) => {
6352
- var r, s;
6353
- return /* @__PURE__ */ f(Be, { children: [
6354
- /* @__PURE__ */ o($e, { asChild: !0, children: /* @__PURE__ */ o(
6355
+ var o, s;
6356
+ return /* @__PURE__ */ g(Be, { children: [
6357
+ /* @__PURE__ */ r($e, { asChild: !0, children: /* @__PURE__ */ r(
6355
6358
  rt,
6356
6359
  {
6357
6360
  className: "richtext-size-7 richtext-p-1",
@@ -6359,12 +6362,12 @@ function Do(e) {
6359
6362
  onClick: i == null ? void 0 : i.action,
6360
6363
  pressed: t.title === i.title,
6361
6364
  size: "sm",
6362
- children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ o(D, { name: i.icon })
6365
+ children: (i == null ? void 0 : i.icon) && /* @__PURE__ */ r(D, { name: i.icon })
6363
6366
  }
6364
6367
  ) }),
6365
- /* @__PURE__ */ f(Fe, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
6366
- /* @__PURE__ */ o("span", { children: i.title }),
6367
- !!((r = i.shortcutKeys) != null && r.length) && /* @__PURE__ */ o("span", { children: (s = i.shortcutKeys) == null ? void 0 : s.map((c) => ot(c)).join(" ") })
6368
+ /* @__PURE__ */ g(Fe, { className: "richtext-flex richtext-flex-col richtext-items-center", children: [
6369
+ /* @__PURE__ */ r("span", { children: i.title }),
6370
+ !!((o = i.shortcutKeys) != null && o.length) && /* @__PURE__ */ r("span", { children: (s = i.shortcutKeys) == null ? void 0 : s.map((c) => ot(c)).join(" ") })
6368
6371
  ] })
6369
6372
  ] }, `text-align-${a}`);
6370
6373
  })
@@ -6387,21 +6390,21 @@ const Fr = H.create({
6387
6390
  t: i
6388
6391
  }) {
6389
6392
  var l;
6390
- const a = ((l = n.options) == null ? void 0 : l.directions) || [], r = {
6393
+ const a = ((l = n.options) == null ? void 0 : l.directions) || [], o = {
6391
6394
  auto: "TextDirection",
6392
6395
  ltr: "LeftToRight",
6393
6396
  rtl: "RightToLeft"
6394
6397
  }, s = a.map((u) => ({
6395
6398
  title: i(`editor.textDirection.${u}.tooltip`),
6396
- icon: r[u],
6399
+ icon: o[u],
6397
6400
  isActive: () => !1,
6398
6401
  action: () => {
6399
- var d, g, h, m;
6402
+ var d, f, m, h;
6400
6403
  if (u === "auto") {
6401
- (g = (d = t.commands) == null ? void 0 : d.unsetTextDirection) == null || g.call(d);
6404
+ (f = (d = t.commands) == null ? void 0 : d.unsetTextDirection) == null || f.call(d);
6402
6405
  return;
6403
6406
  }
6404
- (m = (h = t.commands) == null ? void 0 : h.setTextDirection) == null || m.call(h, u);
6407
+ (h = (m = t.commands) == null ? void 0 : m.setTextDirection) == null || h.call(m, u);
6405
6408
  },
6406
6409
  disabled: !1
6407
6410
  })), c = s.filter((u) => u.disabled).length === s.length;
@@ -6443,7 +6446,7 @@ const Fr = H.create({
6443
6446
  itemUser: jo,
6444
6447
  selectedUser: Bo
6445
6448
  }, $o = Qe((e, t) => {
6446
- const n = X(null), [i, a] = k(0), r = (u) => {
6449
+ const n = X(null), [i, a] = k(0), o = (u) => {
6447
6450
  const d = e.items[u];
6448
6451
  d && e.command({ id: d, label: d });
6449
6452
  }, s = () => {
@@ -6451,7 +6454,7 @@ const Fr = H.create({
6451
6454
  }, c = () => {
6452
6455
  a((i + 1) % e.items.length);
6453
6456
  }, l = () => {
6454
- r(i);
6457
+ o(i);
6455
6458
  };
6456
6459
  return P(() => a(0), [e.items]), P(() => {
6457
6460
  if (Number.isNaN(i + 1))
@@ -6460,15 +6463,15 @@ const Fr = H.create({
6460
6463
  u && ht(u, { behavior: "smooth", scrollMode: "if-needed" });
6461
6464
  }, [i]), et(t, () => ({
6462
6465
  onKeyDown: ({ event: u }) => u.key === "ArrowUp" ? (s(), !0) : u.key === "ArrowDown" ? (c(), !0) : u.key === "Enter" ? (l(), !0) : !1
6463
- })), /* @__PURE__ */ o("div", { className: U("listUsers", Re.listUsers), children: /* @__PURE__ */ o("div", { ref: n, children: e.items.length > 0 ? e.items.map((u, d) => /* @__PURE__ */ o(
6466
+ })), /* @__PURE__ */ r("div", { className: U("listUsers", Re.listUsers), children: /* @__PURE__ */ r("div", { ref: n, children: e.items.length > 0 ? e.items.map((u, d) => /* @__PURE__ */ r(
6464
6467
  "span",
6465
6468
  {
6466
6469
  className: U("itemUser", Re.itemUser, d === i ? Re.selectedUser : ""),
6467
- onClick: () => r(d),
6470
+ onClick: () => o(d),
6468
6471
  children: u
6469
6472
  },
6470
6473
  d
6471
- )) : /* @__PURE__ */ o("div", { className: U("itemUserEmpty", Re.itemUser), children: "Empty" }) }) });
6474
+ )) : /* @__PURE__ */ r("div", { className: U("itemUserEmpty", Re.itemUser), children: "Empty" }) }) });
6472
6475
  }), Fo = [
6473
6476
  {
6474
6477
  id: "1",
@@ -6566,7 +6569,7 @@ const Fr = H.create({
6566
6569
  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>'
6567
6570
  };
6568
6571
  function qo(e) {
6569
- const t = Vo[e], a = new DOMParser().parseFromString(t, "image/svg+xml").documentElement, r = [
6572
+ const t = Vo[e], a = new DOMParser().parseFromString(t, "image/svg+xml").documentElement, o = [
6570
6573
  "svg",
6571
6574
  {
6572
6575
  ...Array.from(a.attributes).reduce((s, c) => (s[c.name] = c.value, s), {})
@@ -6578,22 +6581,22 @@ function qo(e) {
6578
6581
  s.tagName.toLowerCase(),
6579
6582
  Array.from(s.attributes).reduce((l, u) => (l[u.name] = u.value, l), {})
6580
6583
  ];
6581
- s.textContent && c.push(s.textContent), r.push(c);
6584
+ s.textContent && c.push(s.textContent), o.push(c);
6582
6585
  }
6583
- }), r;
6586
+ }), o;
6584
6587
  }
6585
6588
  const Ko = {
6586
- audio: /* @__PURE__ */ o(ii, {}),
6587
- video: /* @__PURE__ */ o(ni, {}),
6588
- file: /* @__PURE__ */ o(ti, {}),
6589
- image: /* @__PURE__ */ o(ei, {}),
6590
- pdf: /* @__PURE__ */ o(vi, {}),
6591
- word: /* @__PURE__ */ o(yi, {}),
6592
- excel: /* @__PURE__ */ o(Qn, {}),
6593
- ppt: /* @__PURE__ */ o(Jn, {})
6589
+ audio: /* @__PURE__ */ r(ii, {}),
6590
+ video: /* @__PURE__ */ r(ni, {}),
6591
+ file: /* @__PURE__ */ r(ti, {}),
6592
+ image: /* @__PURE__ */ r(ei, {}),
6593
+ pdf: /* @__PURE__ */ r(vi, {}),
6594
+ word: /* @__PURE__ */ r(yi, {}),
6595
+ excel: /* @__PURE__ */ r(Qn, {}),
6596
+ ppt: /* @__PURE__ */ r(Jn, {})
6594
6597
  };
6595
6598
  function en(e, t = !1) {
6596
- const n = wi(e), i = Ko[n] || /* @__PURE__ */ o(oe, {});
6599
+ const n = wi(e), i = Ko[n] || /* @__PURE__ */ r(oe, {});
6597
6600
  return t ? qo(n) : i;
6598
6601
  }
6599
6602
  const Wo = "_wrap_1x1ms_2", Ke = {
@@ -6601,88 +6604,88 @@ const Wo = "_wrap_1x1ms_2", Ke = {
6601
6604
  };
6602
6605
  function Go({ editor: e, node: t, updateAttributes: n, deleteNode: i, extension: a }) {
6603
6606
  var C;
6604
- const r = X(null), s = at(), { hasTrigger: c, fileName: l, fileSize: u, fileExt: d, fileType: g, url: h, error: m } = t.attrs, [b, x] = k(!1), { t: N } = B(), L = (C = a == null ? void 0 : a.options) == null ? void 0 : C.upload, w = j(() => {
6605
- !s || h || s && r.current.click();
6606
- }, [s, h]), _ = j(
6607
+ const o = X(null), s = at(), { hasTrigger: c, fileName: l, fileSize: u, fileExt: d, fileType: f, url: m, error: h } = t.attrs, [b, x] = k(!1), { t: N } = B(), S = (C = a == null ? void 0 : a.options) == null ? void 0 : C.upload, p = j(() => {
6608
+ !s || m || s && o.current.click();
6609
+ }, [s, m]), _ = j(
6607
6610
  async (T) => {
6608
- const S = T.target.files && T.target.files[0];
6609
- if (!S)
6611
+ const L = T.target.files && T.target.files[0];
6612
+ if (!L)
6610
6613
  return;
6611
6614
  const q = {
6612
- fileName: Ci(S.name),
6613
- fileSize: S.size,
6614
- fileType: S.type,
6615
- fileExt: ki(S.name)
6615
+ fileName: Ci(L.name),
6616
+ fileSize: L.size,
6617
+ fileType: L.type,
6618
+ fileExt: ki(L.name)
6616
6619
  };
6617
6620
  x(!0);
6618
6621
  try {
6619
- const v = await L(S);
6622
+ const v = await S(L);
6620
6623
  n({ ...q, url: v }), x(!1);
6621
6624
  } catch (v) {
6622
- n({ error: `File upload fail: ${v && v.message}` || "Unknown error" }), x(!1), r.current.value = "";
6625
+ n({ error: `File upload fail: ${v && v.message}` || "Unknown error" }), x(!1), o.current.value = "";
6623
6626
  }
6624
6627
  },
6625
6628
  [x, n]
6626
6629
  );
6627
6630
  P(() => {
6628
- !h && !c && (w(), n({ hasTrigger: !0 }));
6629
- }, [h, c, w, n]);
6630
- const p = j(() => i(), [e]);
6631
- return s && !h ? /* @__PURE__ */ o(he, { children: /* @__PURE__ */ f("div", { className: U(Ke.wrap, "render-wrapper"), children: [
6632
- /* @__PURE__ */ o(
6631
+ !m && !c && (p(), n({ hasTrigger: !0 }));
6632
+ }, [m, c, p, n]);
6633
+ const w = j(() => i(), [e]);
6634
+ return s && !m ? /* @__PURE__ */ r(he, { children: /* @__PURE__ */ g("div", { className: U(Ke.wrap, "render-wrapper"), children: [
6635
+ /* @__PURE__ */ r(
6633
6636
  "p",
6634
6637
  {
6635
- onClick: w,
6638
+ onClick: p,
6636
6639
  style: { cursor: "pointer" },
6637
- children: b ? /* @__PURE__ */ o("span", { children: N("editor.attachment.uploading") }) : /* @__PURE__ */ o("span", { children: N("editor.attachment.please_upload") })
6640
+ children: b ? /* @__PURE__ */ r("span", { children: N("editor.attachment.uploading") }) : /* @__PURE__ */ r("span", { children: N("editor.attachment.please_upload") })
6638
6641
  }
6639
6642
  ),
6640
- /* @__PURE__ */ o(
6643
+ /* @__PURE__ */ r(
6641
6644
  "input",
6642
6645
  {
6643
6646
  hidden: !0,
6644
6647
  onChange: _,
6645
- ref: r,
6648
+ ref: o,
6646
6649
  type: "file"
6647
6650
  }
6648
6651
  )
6649
- ] }) }) : h ? /* @__PURE__ */ o(he, { children: /* @__PURE__ */ f(
6652
+ ] }) }) : m ? /* @__PURE__ */ r(he, { children: /* @__PURE__ */ g(
6650
6653
  "div",
6651
6654
  {
6652
6655
  className: U(Ke.wrap, "render-wrapper"),
6653
- onClick: w,
6656
+ onClick: p,
6654
6657
  children: [
6655
- /* @__PURE__ */ f("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
6656
- /* @__PURE__ */ o("span", { children: en(g) }),
6657
- /* @__PURE__ */ f("span", { children: [
6658
+ /* @__PURE__ */ g("div", { className: "richtext-flex richtext-items-center richtext-gap-[4px]", children: [
6659
+ /* @__PURE__ */ r("span", { children: en(f) }),
6660
+ /* @__PURE__ */ g("span", { children: [
6658
6661
  l,
6659
6662
  ".",
6660
6663
  d
6661
6664
  ] }),
6662
- /* @__PURE__ */ f("span", { children: [
6665
+ /* @__PURE__ */ g("span", { children: [
6663
6666
  "(",
6664
6667
  Ot(u),
6665
6668
  ")"
6666
6669
  ] })
6667
6670
  ] }),
6668
- /* @__PURE__ */ o(
6671
+ /* @__PURE__ */ r(
6669
6672
  y,
6670
6673
  {
6671
- action: p,
6674
+ action: w,
6672
6675
  icon: "Trash2",
6673
6676
  tooltip: N("editor.delete")
6674
6677
  }
6675
6678
  )
6676
6679
  ]
6677
6680
  }
6678
- ) }) : m !== "null" ? /* @__PURE__ */ o(he, { children: /* @__PURE__ */ o(
6681
+ ) }) : h !== "null" ? /* @__PURE__ */ r(he, { children: /* @__PURE__ */ r(
6679
6682
  "div",
6680
6683
  {
6681
6684
  className: U(Ke.wrap, "render-wrapper"),
6682
- onClick: w,
6683
- children: /* @__PURE__ */ o("p", { children: m })
6685
+ onClick: p,
6686
+ children: /* @__PURE__ */ r("p", { children: h })
6684
6687
  }
6685
- ) }) : /* @__PURE__ */ o(oe, {});
6688
+ ) }) : /* @__PURE__ */ r(oe, {});
6686
6689
  }
6687
6690
  const Vr = Ae.create({
6688
6691
  name: "attachment",
@@ -6720,7 +6723,7 @@ const Vr = Ae.create({
6720
6723
  fileName: n = "",
6721
6724
  fileSize: i = "",
6722
6725
  fileType: a = "",
6723
- fileExt: r = ""
6726
+ fileExt: o = ""
6724
6727
  } = e || {};
6725
6728
  return [
6726
6729
  "div",
@@ -6740,7 +6743,7 @@ const Vr = Ae.create({
6740
6743
  [
6741
6744
  "span",
6742
6745
  { class: "attachment__text" },
6743
- `${n}.${r} (${Ot(i)})`
6746
+ `${n}.${o} (${Ot(i)})`
6744
6747
  ]
6745
6748
  ] : ["div", { class: "attachment__placeholder" }]
6746
6749
  ];