@opengis/form 0.0.192 → 0.0.194-npm

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,8 +1,8 @@
1
- import { ref as $, getCurrentInstance as st, resolveComponent as Z, createElementBlock as w, openBlock as v, normalizeClass as E, createVNode as C, createElementVNode as d, unref as L, createBlock as W, Teleport as Ge, createCommentVNode as U, Transition as Ye, withCtx as q, toDisplayString as Y, renderSlot as we, defineComponent as it, withDirectives as de, mergeProps as ct, vModelDynamic as dt, Fragment as ae, vModelCheckbox as ut, nextTick as ue, watch as me, onMounted as be, onBeforeUnmount as Qe, normalizeStyle as se, vShow as $e, computed as N, renderList as ie, onUnmounted as Le, resolveDynamicComponent as Ee, vModelText as ft, withModifiers as pt, createStaticVNode as gt, mergeModels as ht, useModel as vt, shallowRef as mt, markRaw as bt } from "vue";
2
- import { r as De, _ as Q, a as yt, b as xt } from "./index-DqCGQjZs.js";
3
- import { Quote as wt, List as kt, ListOrdered as _t, CodeXml as $t, Bold as Ct, Italic as At, Underline as Ft, Strikethrough as St, X as Pe, Mail as Tt, Search as Lt, Link2 as Bt, ExternalLink as Et, Trash2 as It, Table2 as Pt, AlignJustify as jt, AlignRight as Mt, AlignCenter as Ht, AlignLeft as Nt, Check as ke, Eraser as zt, PaintBucket as Dt, Highlighter as Vt, ChevronDown as je, ALargeSmall as Ot, Superscript as Rt, Subscript as Ut, RemoveFormatting as qt, Image as Kt, Undo2 as Wt, Redo2 as Xt, CircleHelp as Gt, Minus as Yt, Maximize as Qt } from "lucide-vue-next";
4
- import { notify as Se } from "@opengis/core";
5
- function Zt() {
1
+ import { ref as $, getCurrentInstance as it, resolveComponent as Z, createElementBlock as w, openBlock as v, normalizeClass as E, createVNode as C, createElementVNode as d, unref as L, createBlock as W, Teleport as Ge, createCommentVNode as U, Transition as Ye, withCtx as q, toDisplayString as Y, renderSlot as we, defineComponent as ct, withDirectives as de, mergeProps as dt, vModelDynamic as ut, Fragment as ae, vModelCheckbox as ft, nextTick as ue, watch as me, onMounted as ye, onBeforeUnmount as Qe, normalizeStyle as se, vShow as $e, computed as N, renderList as ie, onUnmounted as Le, resolveDynamicComponent as Ee, vModelText as pt, withModifiers as gt, createStaticVNode as ht, mergeModels as vt, useModel as mt, shallowRef as yt, markRaw as bt } from "vue";
2
+ import { r as De, _ as Q, a as xt, b as wt } from "./index-DGAgz5vJ.js";
3
+ import { Quote as kt, List as _t, ListOrdered as $t, CodeXml as Ct, Bold as At, Italic as St, Underline as Ft, Strikethrough as Tt, X as Me, Mail as Lt, Search as Bt, Link2 as Et, ExternalLink as It, Trash2 as Mt, Table2 as Pt, AlignJustify as jt, AlignRight as Ht, AlignCenter as Nt, AlignLeft as zt, Check as ke, Eraser as Dt, PaintBucket as Vt, Highlighter as Ot, ChevronDown as Pe, ALargeSmall as Rt, Superscript as Ut, Subscript as qt, RemoveFormatting as Kt, Image as Wt, Undo2 as Xt, Redo2 as Gt, CircleHelp as Yt, Minus as Qt, Maximize as Zt } from "lucide-vue-next";
4
+ import { notify as Fe } from "@opengis/core";
5
+ function Jt() {
6
6
  const t = $(!1);
7
7
  return {
8
8
  isFullscreen: t,
@@ -11,7 +11,7 @@ function Zt() {
11
11
  }
12
12
  };
13
13
  }
14
- const Jt = "https://esm.sh", le = "3.7.2", Ze = "3.7.2", er = `?deps=@tiptap/core@${le},@tiptap/pm@${Ze}`, te = (t) => `${Jt}/${t}${er}`, re = {
14
+ const er = "https://esm.sh", le = "3.7.2", Ze = "3.7.2", tr = `?deps=@tiptap/core@${le},@tiptap/pm@${Ze}`, te = (t) => `${er}/${t}${tr}`, re = {
15
15
  core: te(`@tiptap/core@${le}`),
16
16
  starterKit: te(`@tiptap/starter-kit@${le}`),
17
17
  textStyle: te(`@tiptap/extension-text-style@${le}`),
@@ -25,17 +25,38 @@ const Jt = "https://esm.sh", le = "3.7.2", Ze = "3.7.2", er = `?deps=@tiptap/cor
25
25
  heading: te(`@tiptap/extension-heading@${le}`),
26
26
  paragraph: te(`@tiptap/extension-paragraph@${le}`),
27
27
  pmModel: te(`@tiptap/pm@${Ze}/model`)
28
- }, ye = "__vs_form_tiptap_loader__", oe = (t) => import(
28
+ }, be = "__vs_form_tiptap_loader__", oe = (t) => import(
29
29
  /* @vite-ignore */
30
30
  t
31
- ), K = (t, e) => t?.[e] || t?.default?.[e] || t?.default?.default?.[e] || t?.default || t, tr = (t) => t.extend({
31
+ ), K = (t, e) => t?.[e] || t?.default?.[e] || t?.default?.default?.[e] || t?.default || t, rr = (t) => t && t.split(";").map((a) => a.trim()).filter((a) => a && !/^text-align\s*:/i.test(a)).join("; ") || null, or = (t) => t.style ? { style: String(t.style).replace(/;\s*$/, "") } : {}, Je = ({ stripTextAlign: t = !1 } = {}) => ({
32
+ default: null,
33
+ parseHTML: (e) => {
34
+ const a = e.getAttribute("style");
35
+ return t ? rr(a) : a || null;
36
+ },
37
+ renderHTML: (e) => or(e)
38
+ }), lr = (t) => t.extend({
39
+ addAttributes() {
40
+ return {
41
+ ...this.parent?.(),
42
+ style: Je({ stripTextAlign: !0 })
43
+ };
44
+ }
45
+ }), ar = (t) => t.extend({
46
+ addAttributes() {
47
+ return {
48
+ ...this.parent?.(),
49
+ style: Je()
50
+ };
51
+ }
52
+ }), nr = (t) => t.extend({
32
53
  addOptions() {
33
54
  return {
34
55
  ...this.parent?.(),
35
56
  levels: [1, 2, 3, 4, 5, 6]
36
57
  };
37
58
  }
38
- }), rr = (t, e, a, s, n) => {
59
+ }), sr = (t, e, a, s, n) => {
39
60
  const o = e.extend({
40
61
  addAttributes() {
41
62
  return {
@@ -91,7 +112,7 @@ const Jt = "https://esm.sh", le = "3.7.2", Ze = "3.7.2", er = `?deps=@tiptap/cor
91
112
  ];
92
113
  }
93
114
  });
94
- }, or = (t) => t.extend({
115
+ }, ir = (t) => t.extend({
95
116
  addAttributes() {
96
117
  return {
97
118
  ...this.parent?.(),
@@ -137,7 +158,7 @@ const Jt = "https://esm.sh", le = "3.7.2", Ze = "3.7.2", er = `?deps=@tiptap/cor
137
158
  unsetBackgroundColor: () => ({ chain: e }) => e().setMark("textStyle", { backgroundColor: null }).removeEmptyTextStyle().run()
138
159
  };
139
160
  }
140
- }), lr = (t) => t.create({
161
+ }), cr = (t) => t.create({
141
162
  name: "iframe",
142
163
  group: "block",
143
164
  inline: !1,
@@ -165,10 +186,10 @@ const Jt = "https://esm.sh", le = "3.7.2", Ze = "3.7.2", er = `?deps=@tiptap/cor
165
186
  return ["iframe", e];
166
187
  }
167
188
  });
168
- async function ar() {
189
+ async function dr() {
169
190
  if (typeof window > "u") return null;
170
191
  const t = window;
171
- return t[ye] || (t[ye] = Promise.all([
192
+ return t[be] || (t[be] = Promise.all([
172
193
  oe(re.core),
173
194
  oe(re.starterKit),
174
195
  oe(re.textStyle),
@@ -193,32 +214,32 @@ async function ar() {
193
214
  r,
194
215
  i,
195
216
  x,
196
- b,
217
+ y,
197
218
  f,
198
219
  p
199
220
  ]) => {
200
- const I = K(e, "Editor"), V = K(e, "Node"), O = K(a, "StarterKit"), R = K(s, "TextStyle"), J = K(n, "TableKit"), P = K(n, "Table"), ee = K(n, "TableRow"), ne = K(n, "TableCell"), pe = K(n, "TableHeader"), ge = K(o, "Highlight"), m = K(l, "Subscript"), k = K(c, "Superscript"), u = K(r, "Link"), _ = K(i, "Image"), y = K(x, "TextAlign"), T = K(b, "Heading"), h = K(f, "Paragraph"), S = K(p, "DOMParser");
201
- if (!I || !V || !O || !R || !J || !P || !ee || !ne || !pe || !ge || !m || !k || !u || !_ || !y || !T || !h || !S)
221
+ const I = K(e, "Editor"), V = K(e, "Node"), O = K(a, "StarterKit"), R = K(s, "TextStyle"), J = K(n, "TableKit"), M = K(n, "Table"), ee = K(n, "TableRow"), ne = K(n, "TableCell"), pe = K(n, "TableHeader"), ge = K(o, "Highlight"), m = K(l, "Subscript"), k = K(c, "Superscript"), u = K(r, "Link"), _ = K(i, "Image"), b = K(x, "TextAlign"), T = K(y, "Heading"), h = K(f, "Paragraph"), F = K(p, "DOMParser");
222
+ if (!I || !V || !O || !R || !J || !M || !ee || !ne || !pe || !ge || !m || !k || !u || !_ || !b || !T || !h || !F)
202
223
  throw new Error("Failed to resolve one or more Tiptap modules");
203
224
  return {
204
225
  Editor: I,
205
- ProseMirrorDOMParser: S,
226
+ ProseMirrorDOMParser: F,
206
227
  StarterKit: O,
207
- ExtendedTextStyle: or(R),
228
+ ExtendedTextStyle: ir(R),
208
229
  Highlight: ge,
209
230
  Subscript: m,
210
231
  Superscript: k,
211
- Link: u,
232
+ CustomLink: ar(u),
212
233
  Image: _,
213
- TextAlign: y,
214
- CustomHeading: tr(T),
215
- CustomParagraph: h,
216
- CustomTableKit: rr(J, P, ee, ne, pe),
217
- Iframe: lr(V)
234
+ TextAlign: b,
235
+ CustomHeading: nr(T),
236
+ CustomParagraph: lr(h),
237
+ CustomTableKit: sr(J, M, ee, ne, pe),
238
+ Iframe: cr(V)
218
239
  };
219
240
  }).catch((e) => {
220
- throw delete t[ye], e;
221
- })), t[ye];
241
+ throw delete t[be], e;
242
+ })), t[be];
222
243
  }
223
244
  const ce = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;"), Ce = (t) => {
224
245
  let e = ce(t || "");
@@ -229,7 +250,7 @@ const ce = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "
229
250
  const l = o ? ` title="${ce(o)}"` : "";
230
251
  return `<a href="${ce(n)}"${l} target="_blank" rel="noopener noreferrer">${s}</a>`;
231
252
  }), e = e.replace(/`([^`]+)`/g, "<code>$1</code>"), e = e.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>"), e = e.replace(/__([^_]+)__/g, "<strong>$1</strong>"), e = e.replace(/~~([^~]+)~~/g, "<del>$1</del>"), e = e.replace(/\*([^*\n]+)\*/g, "<em>$1</em>"), e = e.replace(/_([^_\n]+)_/g, "<em>$1</em>"), e;
232
- }, _e = (t) => /^\s*\d+\.\s+/.test(t), Me = (t) => /^\s*[-*+]\s+/.test(t), Je = (t) => /^\s*[-*+]\s+\[[ xX]\]\s+/.test(t), Ie = (t) => /^\s*>\s?/.test(t), He = (t) => /^\s*\|?(?:\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?\s*$/.test(t), Ve = (t) => t.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((e) => Ce(e.trim())), nr = (t, e) => {
253
+ }, _e = (t) => /^\s*\d+\.\s+/.test(t), je = (t) => /^\s*[-*+]\s+/.test(t), et = (t) => /^\s*[-*+]\s+\[[ xX]\]\s+/.test(t), Ie = (t) => /^\s*>\s?/.test(t), He = (t) => /^\s*\|?(?:\s*:?-{3,}:?\s*\|)+\s*:?-{3,}:?\s*\|?\s*$/.test(t), Ve = (t) => t.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((e) => Ce(e.trim())), ur = (t, e) => {
233
254
  const a = t[e], s = t[e + 1];
234
255
  if (!a || !s || !a.includes("|") || !He(s))
235
256
  return null;
@@ -244,12 +265,12 @@ const ce = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "
244
265
  html: `<table>${c}${r}</table>`,
245
266
  nextIndex: l
246
267
  };
247
- }, sr = (t, e) => {
268
+ }, fr = (t, e) => {
248
269
  const a = _e(t[e]), s = a ? "ol" : "ul", n = [];
249
270
  let o = e;
250
271
  for (; o < t.length; ) {
251
272
  const l = t[o];
252
- if (l.trim() === "" || !(a ? _e(l) : (Me(l) || Je(l)) && !_e(l))) break;
273
+ if (l.trim() === "" || !(a ? _e(l) : (je(l) || et(l)) && !_e(l))) break;
253
274
  const r = l.match(/^\s*[-*+]\s+\[([ xX])\]\s+(.*)$/);
254
275
  if (r) {
255
276
  const i = r[1].toLowerCase() === "x";
@@ -264,7 +285,7 @@ const ce = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "
264
285
  html: `<${s}>${n.join("")}</${s}>`,
265
286
  nextIndex: o
266
287
  };
267
- }, ir = (t, e) => {
288
+ }, pr = (t, e) => {
268
289
  const s = t[e].replace(/^```/, "").trim(), n = [];
269
290
  let o = e + 1;
270
291
  for (; o < t.length && !t[o].startsWith("```"); )
@@ -274,12 +295,12 @@ const ce = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "
274
295
  `))}</code></pre>`,
275
296
  nextIndex: o < t.length ? o + 1 : o
276
297
  };
277
- }, cr = (t, e) => {
298
+ }, gr = (t, e) => {
278
299
  const a = [];
279
300
  let s = e;
280
301
  for (; s < t.length; ) {
281
302
  const n = t[s];
282
- if (n.trim() === "" || n.startsWith("```") || /^#{1,6}\s+/.test(n) || /^---+$/.test(n.trim()) || /^\*\*\*+$/.test(n.trim()) || Ie(n) || _e(n) || Me(n) || s + 1 < t.length && n.includes("|") && He(t[s + 1]))
303
+ if (n.trim() === "" || n.startsWith("```") || /^#{1,6}\s+/.test(n) || /^---+$/.test(n.trim()) || /^\*\*\*+$/.test(n.trim()) || Ie(n) || _e(n) || je(n) || s + 1 < t.length && n.includes("|") && He(t[s + 1]))
283
304
  break;
284
305
  a.push(n.trim()), s += 1;
285
306
  }
@@ -287,7 +308,7 @@ const ce = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "
287
308
  html: `<p>${Ce(a.join(" "))}</p>`,
288
309
  nextIndex: s
289
310
  };
290
- }, et = (t) => {
311
+ }, tt = (t) => {
291
312
  const a = (t || "").replace(/\r\n/g, `
292
313
  `).split(`
293
314
  `), s = [];
@@ -299,7 +320,7 @@ const ce = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "
299
320
  continue;
300
321
  }
301
322
  if (o.startsWith("```")) {
302
- const i = ir(a, n);
323
+ const i = pr(a, n);
303
324
  s.push(i.html), n = i.nextIndex;
304
325
  continue;
305
326
  }
@@ -314,7 +335,7 @@ const ce = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "
314
335
  continue;
315
336
  }
316
337
  if (o.includes("|") && n + 1 < a.length && He(a[n + 1])) {
317
- const i = nr(a, n);
338
+ const i = ur(a, n);
318
339
  if (i) {
319
340
  s.push(i.html), n = i.nextIndex;
320
341
  continue;
@@ -324,23 +345,23 @@ const ce = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "
324
345
  const i = [];
325
346
  for (; n < a.length && Ie(a[n]); )
326
347
  i.push(a[n].replace(/^\s*>\s?/, "")), n += 1;
327
- s.push(`<blockquote>${et(i.join(`
348
+ s.push(`<blockquote>${tt(i.join(`
328
349
  `))}</blockquote>`);
329
350
  continue;
330
351
  }
331
- if (_e(o) || Me(o) || Je(o)) {
332
- const i = sr(a, n);
352
+ if (_e(o) || je(o) || et(o)) {
353
+ const i = fr(a, n);
333
354
  s.push(i.html), n = i.nextIndex;
334
355
  continue;
335
356
  }
336
- const r = cr(a, n);
357
+ const r = gr(a, n);
337
358
  s.push(r.html), n = r.nextIndex;
338
359
  }
339
360
  return s.join("");
340
- }, Be = (t) => (t.textContent || "").replace(/\u00a0/g, " "), tt = (t) => Array.from(t.childNodes).map((e) => Ne(e)).join(""), dr = (t) => {
361
+ }, Be = (t) => (t.textContent || "").replace(/\u00a0/g, " "), rt = (t) => Array.from(t.childNodes).map((e) => Ne(e)).join(""), hr = (t) => {
341
362
  const e = Array.from(t.querySelectorAll("tr"));
342
363
  if (!e.length) return "";
343
- const a = (c) => `| ${Array.from(c.children).map((i) => tt(i).trim()).join(" | ")} |`, s = e[0], n = s ? Array.from(s.children).length : 0, o = `| ${Array(Math.max(n, 1)).fill("---").join(" | ")} |`, l = e.slice(1).map((c) => a(c));
364
+ const a = (c) => `| ${Array.from(c.children).map((i) => rt(i).trim()).join(" | ")} |`, s = e[0], n = s ? Array.from(s.children).length : 0, o = `| ${Array(Math.max(n, 1)).fill("---").join(" | ")} |`, l = e.slice(1).map((c) => a(c));
344
365
  return [a(s), o, ...l].join(`
345
366
  `);
346
367
  }, Oe = (t, e = !1) => Array.from(t.children).filter((a) => a.nodeType === Node.ELEMENT_NODE).map((a, s) => {
@@ -353,7 +374,7 @@ function Ne(t) {
353
374
  return Be(t);
354
375
  if (t.nodeType !== Node.ELEMENT_NODE)
355
376
  return "";
356
- const e = t, a = e.tagName.toLowerCase(), s = tt(e);
377
+ const e = t, a = e.tagName.toLowerCase(), s = rt(e);
357
378
  switch (a) {
358
379
  case "br":
359
380
  return `
@@ -419,14 +440,14 @@ ${r}
419
440
 
420
441
  `;
421
442
  case "table":
422
- return `${dr(e)}
443
+ return `${hr(e)}
423
444
 
424
445
  `;
425
446
  default:
426
447
  return s;
427
448
  }
428
449
  }
429
- const rt = (t) => {
450
+ const ot = (t) => {
430
451
  if (!t) return "";
431
452
  if (typeof window > "u" || typeof DOMParser > "u")
432
453
  return t;
@@ -434,7 +455,7 @@ const rt = (t) => {
434
455
  return Array.from(a.body.childNodes).map((s) => Ne(s)).join("").replace(/\n{3,}/g, `
435
456
 
436
457
  `).trim();
437
- }, ur = /* @__PURE__ */ new Set([
458
+ }, vr = /* @__PURE__ */ new Set([
438
459
  "area",
439
460
  "base",
440
461
  "br",
@@ -449,7 +470,7 @@ const rt = (t) => {
449
470
  "source",
450
471
  "track",
451
472
  "wbr"
452
- ]), fr = (t) => {
473
+ ]), mr = (t) => {
453
474
  if (!t) return "";
454
475
  if (typeof window > "u" || typeof DOMParser > "u")
455
476
  return t;
@@ -460,25 +481,25 @@ const rt = (t) => {
460
481
  }
461
482
  if (o.nodeType !== Node.ELEMENT_NODE)
462
483
  return [];
463
- const c = o, r = c.tagName.toLowerCase(), i = Array.from(c.attributes).map((p) => `${p.name}="${p.value}"`).join(" "), x = i ? `<${r} ${i}>` : `<${r}>`, b = `</${r}>`;
464
- if (ur.has(r))
484
+ const c = o, r = c.tagName.toLowerCase(), i = Array.from(c.attributes).map((p) => `${p.name}="${p.value}"`).join(" "), x = i ? `<${r} ${i}>` : `<${r}>`, y = `</${r}>`;
485
+ if (vr.has(r))
465
486
  return [`${s.repeat(l)}${x}`];
466
487
  const f = Array.from(c.childNodes).flatMap((p) => n(p, l + 1));
467
488
  if (!f.length)
468
- return [`${s.repeat(l)}${x}${b}`];
489
+ return [`${s.repeat(l)}${x}${y}`];
469
490
  if (c.childNodes.length === 1 && c.firstChild?.nodeType === Node.TEXT_NODE && f.length === 1) {
470
491
  const p = f[0].trim();
471
- return [`${s.repeat(l)}${x}${p}${b}`];
492
+ return [`${s.repeat(l)}${x}${p}${y}`];
472
493
  }
473
494
  return [
474
495
  `${s.repeat(l)}${x}`,
475
496
  ...f,
476
- `${s.repeat(l)}${b}`
497
+ `${s.repeat(l)}${y}`
477
498
  ];
478
499
  };
479
500
  return Array.from(a.body.childNodes).flatMap((o) => n(o, 0)).join(`
480
501
  `);
481
- }, pr = (t) => t.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Te = (t) => {
502
+ }, yr = (t) => t.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), Te = (t) => {
482
503
  if (!t) return "";
483
504
  if (typeof window > "u" || typeof DOMParser > "u")
484
505
  return t.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi, "");
@@ -505,9 +526,9 @@ const rt = (t) => {
505
526
  };
506
527
  }, Ue = (t, e) => {
507
528
  if (!e) return t || "";
508
- const a = (e.attributes || []).map(({ name: n, value: o }) => `${n}="${pr(o)}"`).join(" ");
529
+ const a = (e.attributes || []).map(({ name: n, value: o }) => `${n}="${yr(o)}"`).join(" ");
509
530
  return `${a ? `<${e.tag} ${a}>` : `<${e.tag}>`}${t || ""}</${e.tag}>`;
510
- }, qe = async (t, e) => e !== "md" ? t || "" : et(t || ""), Ke = async (t, e) => e !== "md" ? fr(t || "") : rt(t || ""), gr = async (t, e) => e !== "md" ? t || "" : rt(t || ""), hr = async (t) => {
531
+ }, qe = async (t, e) => e !== "md" ? t || "" : tt(t || ""), Ke = async (t, e) => e !== "md" ? mr(t || "") : ot(t || ""), br = async (t, e) => e !== "md" ? t || "" : ot(t || ""), xr = async (t) => {
511
532
  try {
512
533
  const e = new FormData();
513
534
  return e.append("unique", "true"), e.append("file", t), (await (await fetch("/file/upload/uploads?id=&form=&table=", {
@@ -517,12 +538,12 @@ const rt = (t) => {
517
538
  } catch (e) {
518
539
  console.error(e);
519
540
  }
520
- }, vr = async (t, e, a) => {
541
+ }, wr = async (t, e, a) => {
521
542
  const s = e.clipboardData?.items;
522
543
  if (s) {
523
544
  const n = e.clipboardData?.getData("text/html"), o = e.clipboardData?.getData("text/plain");
524
545
  if (n) {
525
- const { state: l, dispatch: c } = t, { tr: r } = l, i = a.fromSchema(t.state.schema), x = new DOMParser().parseFromString(n, "text/html").body, b = i.parse(x), f = r.replaceSelectionWith(b);
546
+ const { state: l, dispatch: c } = t, { tr: r } = l, i = a.fromSchema(t.state.schema), x = new DOMParser().parseFromString(n, "text/html").body, y = i.parse(x), f = r.replaceSelectionWith(y);
526
547
  return c(f), e.preventDefault(), !0;
527
548
  }
528
549
  if (o) {
@@ -534,23 +555,23 @@ const rt = (t) => {
534
555
  if (c.type.startsWith("image/")) {
535
556
  const r = c.getAsFile();
536
557
  if (r) {
537
- const i = await hr(r), { schema: x } = t.state, b = x.nodes.image.create({
558
+ const i = await xr(r), { schema: x } = t.state, y = x.nodes.image.create({
538
559
  src: i?.file_path
539
- }), f = t.state.tr.replaceSelectionWith(b);
560
+ }), f = t.state.tr.replaceSelectionWith(y);
540
561
  return t.dispatch(f), e.preventDefault(), !0;
541
562
  }
542
563
  }
543
564
  }
544
565
  }
545
566
  return !1;
546
- }, mr = (t) => String(t).trim().toLowerCase().split("-")[0], br = () => typeof window > "u" ? "uk" : mr(
567
+ }, kr = (t) => String(t).trim().toLowerCase().split("-")[0], _r = () => typeof window > "u" ? "uk" : kr(
547
568
  localStorage.getItem("language") || localStorage.getItem("locale") || navigator.language || "uk"
548
- ), yr = (t, e) => {
569
+ ), $r = (t, e) => {
549
570
  const a = e.replace(/^form\.richtext\./, "");
550
571
  return De?.[t]?.form?.richtext?.[a] || De?.uk?.form?.richtext?.[a] || e;
551
572
  }, We = (t) => t.startsWith("form.richtext.") ? t : `form.richtext.${t}`;
552
573
  function ze() {
553
- const e = st()?.appContext?.config?.globalProperties, a = e?.$i18n;
574
+ const e = it()?.appContext?.config?.globalProperties, a = e?.$i18n;
554
575
  return { t: (n) => {
555
576
  const o = e?.$t, l = e?.$te, c = typeof a?.te == "function" ? a.te.bind(a) : null;
556
577
  if (typeof o == "function") {
@@ -561,11 +582,11 @@ function ze() {
561
582
  return x;
562
583
  }
563
584
  }
564
- return yr(br(), We(n));
585
+ return $r(_r(), We(n));
565
586
  } };
566
587
  }
567
- const xr = {
568
- components: { Quote: wt },
588
+ const Cr = {
589
+ components: { Quote: kt },
569
590
  props: { editor: Object },
570
591
  methods: {
571
592
  toggleBlockquote() {
@@ -573,7 +594,7 @@ const xr = {
573
594
  }
574
595
  }
575
596
  };
576
- function wr(t, e, a, s, n, o) {
597
+ function Ar(t, e, a, s, n, o) {
577
598
  const l = Z("Quote");
578
599
  return v(), w("button", {
579
600
  title: "Blockquote",
@@ -583,8 +604,8 @@ function wr(t, e, a, s, n, o) {
583
604
  C(l, { class: "h-4 w-4" })
584
605
  ], 2);
585
606
  }
586
- const kr = /* @__PURE__ */ Q(xr, [["render", wr]]), _r = {
587
- components: { List: kt },
607
+ const Sr = /* @__PURE__ */ Q(Cr, [["render", Ar]]), Fr = {
608
+ components: { List: _t },
588
609
  props: { editor: Object },
589
610
  methods: {
590
611
  toggleBulletList() {
@@ -592,7 +613,7 @@ const kr = /* @__PURE__ */ Q(xr, [["render", wr]]), _r = {
592
613
  }
593
614
  }
594
615
  };
595
- function $r(t, e, a, s, n, o) {
616
+ function Tr(t, e, a, s, n, o) {
596
617
  const l = Z("List");
597
618
  return v(), w("button", {
598
619
  title: "Bullet List",
@@ -602,8 +623,8 @@ function $r(t, e, a, s, n, o) {
602
623
  C(l, { class: "h-4 w-4" })
603
624
  ], 2);
604
625
  }
605
- const Cr = /* @__PURE__ */ Q(_r, [["render", $r]]), Ar = {
606
- components: { ListOrdered: _t },
626
+ const Lr = /* @__PURE__ */ Q(Fr, [["render", Tr]]), Br = {
627
+ components: { ListOrdered: $t },
607
628
  props: { editor: Object },
608
629
  methods: {
609
630
  toggleOrderedList() {
@@ -611,7 +632,7 @@ const Cr = /* @__PURE__ */ Q(_r, [["render", $r]]), Ar = {
611
632
  }
612
633
  }
613
634
  };
614
- function Fr(t, e, a, s, n, o) {
635
+ function Er(t, e, a, s, n, o) {
615
636
  const l = Z("ListOrdered");
616
637
  return v(), w("button", {
617
638
  title: "Ordered List",
@@ -621,8 +642,8 @@ function Fr(t, e, a, s, n, o) {
621
642
  C(l, { class: "h-4 w-4" })
622
643
  ], 2);
623
644
  }
624
- const Sr = /* @__PURE__ */ Q(Ar, [["render", Fr]]), Tr = {
625
- components: { CodeXml: $t },
645
+ const Ir = /* @__PURE__ */ Q(Br, [["render", Er]]), Mr = {
646
+ components: { CodeXml: Ct },
626
647
  props: { editor: Object },
627
648
  methods: {
628
649
  toggleCodeBlock() {
@@ -630,7 +651,7 @@ const Sr = /* @__PURE__ */ Q(Ar, [["render", Fr]]), Tr = {
630
651
  }
631
652
  }
632
653
  };
633
- function Lr(t, e, a, s, n, o) {
654
+ function Pr(t, e, a, s, n, o) {
634
655
  const l = Z("CodeXml");
635
656
  return v(), w("button", {
636
657
  title: "Code Block",
@@ -640,8 +661,8 @@ function Lr(t, e, a, s, n, o) {
640
661
  C(l, { class: "h-4 w-4" })
641
662
  ], 2);
642
663
  }
643
- const Br = /* @__PURE__ */ Q(Tr, [["render", Lr]]), Er = {
644
- components: { Bold: Ct },
664
+ const jr = /* @__PURE__ */ Q(Mr, [["render", Pr]]), Hr = {
665
+ components: { Bold: At },
645
666
  props: {
646
667
  editor: Object
647
668
  },
@@ -651,7 +672,7 @@ const Br = /* @__PURE__ */ Q(Tr, [["render", Lr]]), Er = {
651
672
  }
652
673
  }
653
674
  };
654
- function Ir(t, e, a, s, n, o) {
675
+ function Nr(t, e, a, s, n, o) {
655
676
  const l = Z("Bold");
656
677
  return v(), w("button", {
657
678
  title: "Bold Text",
@@ -662,8 +683,8 @@ function Ir(t, e, a, s, n, o) {
662
683
  e[1] || (e[1] = d("span", { class: "sr-only" }, "Bold", -1))
663
684
  ], 2);
664
685
  }
665
- const Pr = /* @__PURE__ */ Q(Er, [["render", Ir]]), jr = {
666
- components: { Italic: At },
686
+ const zr = /* @__PURE__ */ Q(Hr, [["render", Nr]]), Dr = {
687
+ components: { Italic: St },
667
688
  props: {
668
689
  editor: Object
669
690
  },
@@ -673,7 +694,7 @@ const Pr = /* @__PURE__ */ Q(Er, [["render", Ir]]), jr = {
673
694
  }
674
695
  }
675
696
  };
676
- function Mr(t, e, a, s, n, o) {
697
+ function Vr(t, e, a, s, n, o) {
677
698
  const l = Z("Italic");
678
699
  return v(), w("button", {
679
700
  title: "Italic Text",
@@ -684,7 +705,7 @@ function Mr(t, e, a, s, n, o) {
684
705
  e[1] || (e[1] = d("span", { class: "sr-only" }, "Italic", -1))
685
706
  ], 2);
686
707
  }
687
- const Hr = /* @__PURE__ */ Q(jr, [["render", Mr]]), Nr = {
708
+ const Or = /* @__PURE__ */ Q(Dr, [["render", Vr]]), Rr = {
688
709
  __name: "vs-editor-underline",
689
710
  props: { editor: Object },
690
711
  setup(t) {
@@ -701,7 +722,7 @@ const Hr = /* @__PURE__ */ Q(jr, [["render", Mr]]), Nr = {
701
722
  C(L(Ft), { class: "h-4 w-4" })
702
723
  ], 2));
703
724
  }
704
- }, zr = {
725
+ }, Ur = {
705
726
  __name: "vs-editor-strike",
706
727
  props: { editor: Object },
707
728
  setup(t) {
@@ -715,11 +736,11 @@ const Hr = /* @__PURE__ */ Q(jr, [["render", Mr]]), Nr = {
715
736
  t.editor?.isActive("strike") ? "bg-gray-100 text-gray-900" : "text-gray-500"
716
737
  ]])
717
738
  }, [
718
- C(L(St), { class: "h-4 w-4" })
739
+ C(L(Tt), { class: "h-4 w-4" })
719
740
  ], 2));
720
741
  }
721
- }, Dr = {
722
- components: { X: Pe },
742
+ }, qr = {
743
+ components: { X: Me },
723
744
  props: {
724
745
  visible: { type: Boolean, default: () => !1 },
725
746
  modelValue: { type: Boolean, default: () => !1 },
@@ -761,17 +782,17 @@ const Hr = /* @__PURE__ */ Q(jr, [["render", Mr]]), Nr = {
761
782
  e && t.target.classList.contains("vs-dialog-overlay") && this.handleClose();
762
783
  }
763
784
  }
764
- }, Vr = {
785
+ }, Kr = {
765
786
  key: 0,
766
787
  class: "vsTailwind ui-dialog__wrapper"
767
- }, Or = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, Rr = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, Ur = { class: "ui-dialog__content p-4" }, qr = {
788
+ }, Wr = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, Xr = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, Gr = { class: "ui-dialog__content p-4" }, Yr = {
768
789
  key: 0,
769
790
  class: "flex justify-end gap-x-2"
770
791
  };
771
- function Kr(t, e, a, s, n, o) {
792
+ function Qr(t, e, a, s, n, o) {
772
793
  const l = Z("X");
773
794
  return v(), W(Ge, { to: "body" }, [
774
- a.visible || a.modelValue ? (v(), w("div", Vr, [
795
+ a.visible || a.modelValue ? (v(), w("div", Kr, [
775
796
  d("div", {
776
797
  onMousedown: e[1] || (e[1] = (c) => o.closeByClickBack(c, a.closeClickBack)),
777
798
  class: "vs-dialog-overlay vs-dialog w-full h-full fixed top-0 start-0 z-[100001] bg-black bg-opacity-50"
@@ -784,8 +805,8 @@ function Kr(t, e, a, s, n, o) {
784
805
  d("div", {
785
806
  class: E(["ui-dialog__modal opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl", [o.checkSize]])
786
807
  }, [
787
- d("div", Or, [
788
- d("h3", Rr, Y(a.title), 1),
808
+ d("div", Wr, [
809
+ d("h3", Xr, Y(a.title), 1),
789
810
  d("button", {
790
811
  type: "button",
791
812
  class: "size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600",
@@ -795,10 +816,10 @@ function Kr(t, e, a, s, n, o) {
795
816
  C(l, { class: "h-4 w-4 flex-shrink-0" })
796
817
  ])
797
818
  ]),
798
- d("div", Ur, [
819
+ d("div", Gr, [
799
820
  we(t.$slots, "default", {}, void 0, !0)
800
821
  ]),
801
- o.hasSlot ? (v(), w("div", qr, [
822
+ o.hasSlot ? (v(), w("div", Yr, [
802
823
  we(t.$slots, "footer", {
803
824
  handleClose: o.handleClose,
804
825
  handleConfirm: o.handleConfirm,
@@ -813,11 +834,11 @@ function Kr(t, e, a, s, n, o) {
813
834
  ])) : U("", !0)
814
835
  ]);
815
836
  }
816
- const ot = /* @__PURE__ */ Q(Dr, [["render", Kr], ["__scopeId", "data-v-56ad9010"]]), Wr = it({
837
+ const lt = /* @__PURE__ */ Q(qr, [["render", Qr], ["__scopeId", "data-v-56ad9010"]]), Zr = ct({
817
838
  components: {
818
- IconClose: Pe,
819
- IconSearch: Lt,
820
- IconEmail: Tt
839
+ IconClose: Me,
840
+ IconSearch: Bt,
841
+ IconEmail: Lt
821
842
  },
822
843
  inheritAttrs: !1,
823
844
  props: {
@@ -896,13 +917,13 @@ const ot = /* @__PURE__ */ Q(Dr, [["render", Kr], ["__scopeId", "data-v-56ad9010
896
917
  await this.$refs.vsText?.focus();
897
918
  }
898
919
  }
899
- }), Xr = { class: "vs-form-text relative bg-white rounded-lg" }, Gr = {
920
+ }), Jr = { class: "vs-form-text relative bg-white rounded-lg" }, eo = {
900
921
  key: 2,
901
922
  class: "absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"
902
- }, Yr = ["disabled", "type", "placeholder"];
903
- function Qr(t, e, a, s, n, o) {
923
+ }, to = ["disabled", "type", "placeholder"];
924
+ function ro(t, e, a, s, n, o) {
904
925
  const l = Z("IconClose"), c = Z("IconSearch"), r = Z("IconEmail");
905
- return v(), w("div", Xr, [
926
+ return v(), w("div", Jr, [
906
927
  t.clearable && t.value ? (v(), w("div", {
907
928
  key: 0,
908
929
  class: "absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer",
@@ -915,7 +936,7 @@ function Qr(t, e, a, s, n, o) {
915
936
  class: E(["absolute bottom-2/4 translate-y-2/4 cursor-pointer", t.iconStylePosition])
916
937
  }, [
917
938
  C(c, { class: "h-4 w-4 stroke-gray-500 transition-all" })
918
- ], 2)) : t.icon && t.icon === "email" ? (v(), w("div", Gr, [
939
+ ], 2)) : t.icon && t.icon === "email" ? (v(), w("div", eo, [
919
940
  C(r, { class: "h-4 w-4 stroke-gray-500 transition-all" })
920
941
  ])) : (v(), w("i", {
921
942
  key: 3,
@@ -928,7 +949,7 @@ function Qr(t, e, a, s, n, o) {
928
949
  }, [
929
950
  C(l, { class: "h-4 w-4 stroke-gray-500 transition-all hover:stroke-red-500" })
930
951
  ])) : U("", !0),
931
- de(d("input", ct({
952
+ de(d("input", dt({
932
953
  ref: "vsText",
933
954
  disabled: t.disabled,
934
955
  type: t.type,
@@ -939,18 +960,18 @@ function Qr(t, e, a, s, n, o) {
939
960
  onFocus: e[4] || (e[4] = (...i) => t.handleFocus && t.handleFocus(...i)),
940
961
  onBlur: e[5] || (e[5] = (...i) => t.handleBlur && t.handleBlur(...i)),
941
962
  class: [[t.inputStyle, t.checkSize], "py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"]
942
- }), null, 16, Yr), [
943
- [dt, t.value]
963
+ }), null, 16, to), [
964
+ [ut, t.value]
944
965
  ])
945
966
  ]);
946
967
  }
947
- const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f"]]), Zr = ["title"], Jr = { class: "flex flex-col gap-3 p-[20px]" }, eo = { class: "relative flex items-center gap-2" }, to = { class: "flex-1" }, ro = {
968
+ const at = /* @__PURE__ */ Q(Zr, [["render", ro], ["__scopeId", "data-v-eb21a54f"]]), oo = ["title"], lo = { class: "flex flex-col gap-3 p-[20px]" }, ao = { class: "relative flex items-center gap-2" }, no = { class: "flex-1" }, so = {
948
969
  key: 0,
949
970
  class: "flex items-center gap-2 flex-shrink-0"
950
- }, oo = ["title"], lo = ["title"], ao = { class: "flex items-center gap-2" }, no = {
971
+ }, io = ["title"], co = ["title"], uo = { class: "flex items-center gap-2" }, fo = {
951
972
  for: "openInNewTab",
952
973
  class: "text-sm text-gray-700 cursor-pointer"
953
- }, so = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, io = /* @__PURE__ */ Object.assign({
974
+ }, po = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, go = /* @__PURE__ */ Object.assign({
954
975
  inheritAttrs: !1
955
976
  }, {
956
977
  __name: "vs-editor-link",
@@ -972,7 +993,7 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
972
993
  }).run(), r();
973
994
  }, x = () => {
974
995
  a.editor && (a.editor.chain().focus().unsetLink().run(), r());
975
- }, b = () => {
996
+ }, y = () => {
976
997
  if (!n.value) return;
977
998
  let f = n.value.trim();
978
999
  f.match(/^https?:\/\//i) || (f = "https://" + f), window.open(f, "_blank", "noopener,noreferrer");
@@ -983,16 +1004,16 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
983
1004
  onClick: c,
984
1005
  class: E(["text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none", { "bg-gray-100 text-gray-900": t.editor?.isActive("link") }])
985
1006
  }, [
986
- C(L(Bt), { class: "h-4 w-4" })
987
- ], 10, Zr),
988
- C(ot, {
1007
+ C(L(Et), { class: "h-4 w-4" })
1008
+ ], 10, oo),
1009
+ C(lt, {
989
1010
  title: o.value ? L(e)("form.richtext.editLink") || "Редагувати посилання" : L(e)("form.richtext.linkTitle") || "Додати посилання",
990
1011
  visible: s.value,
991
1012
  "onUpdate:visible": p[2] || (p[2] = (I) => s.value = I),
992
1013
  size: "small"
993
1014
  }, {
994
1015
  footer: q(() => [
995
- d("div", so, [
1016
+ d("div", po, [
996
1017
  d("button", {
997
1018
  style: { border: "1px solid #000" },
998
1019
  onClick: r,
@@ -1005,43 +1026,43 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1005
1026
  ])
1006
1027
  ]),
1007
1028
  default: q(() => [
1008
- d("div", Jr, [
1009
- d("div", eo, [
1010
- d("div", to, [
1011
- C(lt, {
1029
+ d("div", lo, [
1030
+ d("div", ao, [
1031
+ d("div", no, [
1032
+ C(at, {
1012
1033
  modelValue: n.value,
1013
1034
  "onUpdate:modelValue": p[0] || (p[0] = (I) => n.value = I),
1014
1035
  placeholder: L(e)("form.richtext.linkUrl") || "Введіть URL",
1015
1036
  class: "w-full"
1016
1037
  }, null, 8, ["modelValue", "placeholder"])
1017
1038
  ]),
1018
- o.value ? (v(), w("div", ro, [
1039
+ o.value ? (v(), w("div", so, [
1019
1040
  d("button", {
1020
- onClick: b,
1041
+ onClick: y,
1021
1042
  class: "text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 focus:outline-none transition-colors",
1022
1043
  title: L(e)("form.richtext.openLink") || "Відкрити посилання"
1023
1044
  }, [
1024
- C(L(Et), { class: "h-4 w-4" })
1025
- ], 8, oo),
1045
+ C(L(It), { class: "h-4 w-4" })
1046
+ ], 8, io),
1026
1047
  d("button", {
1027
1048
  onClick: x,
1028
1049
  class: "text-gray-500 w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-red-600 hover:bg-red-50 focus:outline-none transition-colors",
1029
1050
  title: L(e)("form.richtext.removeLink") || "Видалити посилання"
1030
1051
  }, [
1031
- C(L(It), { class: "h-4 w-4" })
1032
- ], 8, lo)
1052
+ C(L(Mt), { class: "h-4 w-4" })
1053
+ ], 8, co)
1033
1054
  ])) : U("", !0)
1034
1055
  ]),
1035
- d("div", ao, [
1056
+ d("div", uo, [
1036
1057
  de(d("input", {
1037
1058
  type: "checkbox",
1038
1059
  id: "openInNewTab",
1039
1060
  "onUpdate:modelValue": p[1] || (p[1] = (I) => l.value = I),
1040
1061
  class: "w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"
1041
1062
  }, null, 512), [
1042
- [ut, l.value]
1063
+ [ft, l.value]
1043
1064
  ]),
1044
- d("label", no, Y(L(e)("form.richtext.openInNewTab") || "Відкривати в новій вкладці"), 1)
1065
+ d("label", fo, Y(L(e)("form.richtext.openInNewTab") || "Відкривати в новій вкладці"), 1)
1045
1066
  ])
1046
1067
  ])
1047
1068
  ]),
@@ -1054,12 +1075,12 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1054
1075
  await ue();
1055
1076
  const n = await a?.getBoundingClientRect(), o = await e?.getBoundingClientRect();
1056
1077
  if (!o || !n) return;
1057
- const l = await parseInt(e?.getBoundingClientRect()?.height), c = await parseInt(e?.getBoundingClientRect()?.width), r = await parseInt(a?.getBoundingClientRect()?.height), i = await parseInt(a?.getBoundingClientRect()?.width), x = await window.innerHeight, b = await window.innerWidth;
1078
+ const l = await parseInt(e?.getBoundingClientRect()?.height), c = await parseInt(e?.getBoundingClientRect()?.width), r = await parseInt(a?.getBoundingClientRect()?.height), i = await parseInt(a?.getBoundingClientRect()?.width), x = await window.innerHeight, y = await window.innerWidth;
1058
1079
  let f = 0, p = 0;
1059
1080
  const I = o.bottom + s + r;
1060
1081
  switch (t) {
1061
1082
  case "top":
1062
- o.top - n.height - s < 0 ? f = o.top - n.height + s + r + l : f = o.top - n.height - s, b > i + o.right + 30 ? p = o.left - n.width / 2 + o.width / 2 : p = b - 30 - i;
1083
+ o.top - n.height - s < 0 ? f = o.top - n.height + s + r + l : f = o.top - n.height - s, y > i + o.right + 30 ? p = o.left - n.width / 2 + o.width / 2 : p = y - 30 - i;
1063
1084
  break;
1064
1085
  case "bottom":
1065
1086
  x > I ? f = o.bottom + s : f = o.bottom - s - r - l, p = o.left - n.width / 2 + o.width / 2;
@@ -1068,10 +1089,10 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1068
1089
  f = o.top - n.height / 2 + o.height / 2, o.left - n.width - s > 0 ? p = o.left - n.width - s : p = 10;
1069
1090
  break;
1070
1091
  case "right":
1071
- f = o.top - n.height / 2 + o.height / 2, b - c > i ? p = o.right + s : p = b - 30 - i;
1092
+ f = o.top - n.height / 2 + o.height / 2, y - c > i ? p = o.right + s : p = y - 30 - i;
1072
1093
  break;
1073
1094
  case "top-right":
1074
- o.top - n.height - s < 0 ? f = o.top - n.height + s + r + l : f = o.top - n.height - s, b - c > i ? p = o.right + s : p = b - 30 - i;
1095
+ o.top - n.height - s < 0 ? f = o.top - n.height + s + r + l : f = o.top - n.height - s, y - c > i ? p = o.right + s : p = y - 30 - i;
1075
1096
  break;
1076
1097
  case "top-left":
1077
1098
  o.top - n.height - s < 0 ? f = o.top - n.height + s + r + l : f = o.top - n.height - s, o.left - n.width - s > 0 ? p = o.left - n.width - s : p = 10;
@@ -1080,7 +1101,7 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1080
1101
  o.top - n.height - s < 0 ? f = o.top - n.height + s + r + l : f = o.top - n.height - s, o.left > 0 ? p = o.left : p = 10;
1081
1102
  break;
1082
1103
  case "bottom-right":
1083
- x > I ? f = o.bottom + s : f = o.bottom - s - r - l, b - c > i ? p = o.left : p = b - 30 - i;
1104
+ x > I ? f = o.bottom + s : f = o.bottom - s - r - l, y - c > i ? p = o.left : p = y - 30 - i;
1084
1105
  break;
1085
1106
  case "bottom-left":
1086
1107
  x > I ? f = o.bottom + s : f = o.bottom - s - r - l, o.left > 0 ? p = o.right - i : p = 10;
@@ -1089,8 +1110,8 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1089
1110
  x > I ? f = o.bottom + s : f = o.bottom - s - r - l, o.left > 0 ? p = o.left : p = 10;
1090
1111
  break;
1091
1112
  }
1092
- f + r > x ? f = x - r - s : f < 0 && (f = s), p + i > b ? p = b - i - s : p < 0 && (p = s), a instanceof HTMLElement && (a.style.top = `${f}px`, a.style.left = `${p}px`, a.style.position = "fixed");
1093
- }, co = { class: "text-center" }, uo = { class: "py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, fe = /* @__PURE__ */ Object.assign({
1113
+ f + r > x ? f = x - r - s : f < 0 && (f = s), p + i > y ? p = y - i - s : p < 0 && (p = s), a instanceof HTMLElement && (a.style.top = `${f}px`, a.style.left = `${p}px`, a.style.position = "fixed");
1114
+ }, ho = { class: "text-center" }, vo = { class: "py-2 px-4 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, fe = /* @__PURE__ */ Object.assign({
1094
1115
  inheritAttrs: !1
1095
1116
  }, {
1096
1117
  __name: "vs-popover",
@@ -1106,27 +1127,27 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1106
1127
  emits: ["isvisible"],
1107
1128
  setup(t, { expose: e, emit: a }) {
1108
1129
  const s = t, n = a, o = $(!1), l = $([]), c = $(null), r = $(null), i = $(null);
1109
- me(o, (P) => {
1110
- P ? (x(), window.addEventListener(
1130
+ me(o, (M) => {
1131
+ M ? (x(), window.addEventListener(
1111
1132
  "resize",
1112
1133
  () => xe(s.placement, r.value, i.value)
1113
1134
  ), xe(s.placement, r.value, i.value)) : window.removeEventListener(
1114
1135
  "resize",
1115
1136
  () => xe(s.placement, r.value, i.value)
1116
- ), n("isvisible", P);
1117
- }), be(() => {
1137
+ ), n("isvisible", M);
1138
+ }), ye(() => {
1118
1139
  window.addEventListener("click", O), window.addEventListener("popstate", R), window.addEventListener("scroll", J, !0), x();
1119
1140
  }), Qe(() => {
1120
- window.removeEventListener("click", O), window.removeEventListener("popstate", R), b();
1141
+ window.removeEventListener("click", O), window.removeEventListener("popstate", R), y();
1121
1142
  });
1122
1143
  const x = () => {
1123
- let P = c.value;
1124
- for (; P && P !== document.body; )
1125
- (P.scrollHeight > P.clientHeight || P.scrollWidth > P.clientWidth) && (P.addEventListener("scroll", V), l.value.push(P)), P = P.parentElement;
1144
+ let M = c.value;
1145
+ for (; M && M !== document.body; )
1146
+ (M.scrollHeight > M.clientHeight || M.scrollWidth > M.clientWidth) && (M.addEventListener("scroll", V), l.value.push(M)), M = M.parentElement;
1126
1147
  document.body && (document.body.addEventListener("scroll", V), l.value.push(document.body));
1127
- }, b = () => {
1128
- l.value.forEach((P) => {
1129
- P.removeEventListener("scroll", V);
1148
+ }, y = () => {
1149
+ l.value.forEach((M) => {
1150
+ M.removeEventListener("scroll", V);
1130
1151
  }), l.value = [];
1131
1152
  }, f = () => {
1132
1153
  o.value = !0, xe(s.placement, r.value, i.value);
@@ -1136,25 +1157,25 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1136
1157
  await xe(s.placement, r.value, i.value), o.value = !o.value;
1137
1158
  }, V = () => {
1138
1159
  o.value = !1;
1139
- }, O = (P) => {
1140
- if (!P) {
1160
+ }, O = (M) => {
1161
+ if (!M) {
1141
1162
  o.value = !1;
1142
1163
  return;
1143
1164
  }
1144
- r.value?.contains(P.target) || i.value?.contains(P.target) || (o.value = !1);
1165
+ r.value?.contains(M.target) || i.value?.contains(M.target) || (o.value = !1);
1145
1166
  }, R = () => {
1146
1167
  o.value && (o.value = !1);
1147
- }, J = (P) => {
1148
- o.value && i.value && !i.value.contains(P.target) && (o.value = !1);
1168
+ }, J = (M) => {
1169
+ o.value && i.value && !i.value.contains(M.target) && (o.value = !1);
1149
1170
  };
1150
1171
  return e({
1151
1172
  togglePopover: I
1152
- }), (P, ee) => (v(), w("div", {
1173
+ }), (M, ee) => (v(), w("div", {
1153
1174
  ref_key: "popover",
1154
1175
  ref: c,
1155
1176
  class: "vs-popover inline-block"
1156
1177
  }, [
1157
- d("div", co, [
1178
+ d("div", ho, [
1158
1179
  t.trigger === "click" ? (v(), w("div", {
1159
1180
  key: 0,
1160
1181
  ref_key: "popoverRef",
@@ -1162,7 +1183,7 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1162
1183
  onClick: I,
1163
1184
  class: E({ "pointer-events-none": t.disabled })
1164
1185
  }, [
1165
- we(P.$slots, "reference", {}, () => [
1186
+ we(M.$slots, "reference", {}, () => [
1166
1187
  ee[0] || (ee[0] = d("button", null, "Click me!", -1))
1167
1188
  ])
1168
1189
  ], 2)) : U("", !0),
@@ -1174,7 +1195,7 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1174
1195
  onMouseleave: p,
1175
1196
  class: E({ "pointer-events-none": t.disabled })
1176
1197
  }, [
1177
- we(P.$slots, "reference", {}, () => [
1198
+ we(M.$slots, "reference", {}, () => [
1178
1199
  ee[1] || (ee[1] = d("button", null, "Click me!", -1))
1179
1200
  ])
1180
1201
  ], 34)) : U("", !0),
@@ -1190,8 +1211,8 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1190
1211
  zIndex: 100001
1191
1212
  })
1192
1213
  }, [
1193
- d("div", uo, [
1194
- we(P.$slots, "default", {}, () => [
1214
+ d("div", vo, [
1215
+ we(M.$slots, "default", {}, () => [
1195
1216
  ee[2] || (ee[2] = d("span", null, "Popover content", -1))
1196
1217
  ])
1197
1218
  ])
@@ -1205,7 +1226,7 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1205
1226
  ])
1206
1227
  ], 512));
1207
1228
  }
1208
- }), fo = { class: "flex flex-col gap-[2px] p-[2px]" }, po = ["onClick"], go = {
1229
+ }), mo = { class: "flex flex-col gap-[2px] p-[2px]" }, yo = ["onClick"], bo = {
1209
1230
  __name: "vs-editor-table",
1210
1231
  props: { editor: Object },
1211
1232
  setup(t) {
@@ -1221,7 +1242,7 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1221
1242
  a.editor && (a.editor.chain().focus().deleteRow().run(), n.value.togglePopover());
1222
1243
  }, x = () => {
1223
1244
  a.editor && (a.editor.chain().focus().deleteTable().run(), n.value.togglePopover());
1224
- }, b = () => {
1245
+ }, y = () => {
1225
1246
  a.editor && (a.editor.chain().focus().mergeCells().run(), n.value.togglePopover());
1226
1247
  }, f = () => {
1227
1248
  a.editor && (a.editor.chain().focus().splitCell().run(), n.value.togglePopover());
@@ -1232,7 +1253,7 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1232
1253
  { text: e("form.richtext.deleteColumn"), function: r },
1233
1254
  { text: e("form.richtext.deleteRow"), function: i },
1234
1255
  { text: e("form.richtext.deleteTable"), function: x },
1235
- { text: e("form.richtext.mergeCells"), function: b },
1256
+ { text: e("form.richtext.mergeCells"), function: y },
1236
1257
  { text: e("form.richtext.splitCells"), function: f }
1237
1258
  ]);
1238
1259
  return (I, V) => (v(), W(fe, {
@@ -1250,35 +1271,35 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1250
1271
  ], 2)
1251
1272
  ]),
1252
1273
  default: q(() => [
1253
- d("div", fo, [
1274
+ d("div", mo, [
1254
1275
  (v(!0), w(ae, null, ie(p.value, (O, R) => (v(), w("button", {
1255
1276
  key: R,
1256
1277
  onClick: O?.function,
1257
1278
  class: "px-2 py-1 text-gray-500 text-start hover:text-gray-900 hover:bg-gray-100 rounded"
1258
- }, Y(O.text), 9, po))), 128))
1279
+ }, Y(O.text), 9, yo))), 128))
1259
1280
  ])
1260
1281
  ]),
1261
1282
  _: 1
1262
1283
  }, 512));
1263
1284
  }
1264
- }, ho = { class: "flex gap-[4px] p-1" }, vo = ["title", "onClick"], mo = {
1285
+ }, xo = { class: "flex gap-[4px] p-1" }, wo = ["title", "onClick"], ko = {
1265
1286
  __name: "vs-editor-align",
1266
1287
  props: { editor: Object },
1267
1288
  setup(t) {
1268
1289
  const e = t, a = {
1269
- left: Nt,
1270
- center: Ht,
1271
- right: Mt,
1290
+ left: zt,
1291
+ center: Nt,
1292
+ right: Ht,
1272
1293
  justify: jt
1273
- }, s = $(!1), n = $("popover"), o = $("left"), l = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "left" }) || e.editor.isActive("heading", { textAlign: "left" }) : !1), c = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "right" }) || e.editor.isActive("heading", { textAlign: "right" }) : !1), r = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "center" }) || e.editor.isActive("heading", { textAlign: "center" }) : !1), i = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "justify" }) || e.editor.isActive("heading", { textAlign: "justify" }) : !1), x = N(() => l.value || c.value || r.value || i.value), b = () => {
1294
+ }, s = $(!1), n = $("popover"), o = $("left"), l = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "left" }) || e.editor.isActive("heading", { textAlign: "left" }) : !1), c = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "right" }) || e.editor.isActive("heading", { textAlign: "right" }) : !1), r = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "center" }) || e.editor.isActive("heading", { textAlign: "center" }) : !1), i = N(() => e.editor ? e.editor.isActive("paragraph", { textAlign: "justify" }) || e.editor.isActive("heading", { textAlign: "justify" }) : !1), x = N(() => l.value || c.value || r.value || i.value), y = () => {
1274
1295
  c.value ? o.value = "right" : r.value ? o.value = "center" : i.value ? o.value = "justify" : o.value = "left";
1275
1296
  };
1276
1297
  me([l, c, r, i], () => {
1277
- b();
1278
- }, { immediate: !0 }), be(() => {
1279
- e.editor && (e.editor.on("selectionUpdate", b), e.editor.on("update", b));
1298
+ y();
1299
+ }, { immediate: !0 }), ye(() => {
1300
+ e.editor && (e.editor.on("selectionUpdate", y), e.editor.on("update", y));
1280
1301
  }), Le(() => {
1281
- e.editor && (e.editor.off("selectionUpdate", b), e.editor.off("update", b));
1302
+ e.editor && (e.editor.off("selectionUpdate", y), e.editor.off("update", y));
1282
1303
  });
1283
1304
  const f = (I) => {
1284
1305
  e.editor && (e.editor.chain().focus().setTextAlign(I).run(), o.value = I);
@@ -1306,7 +1327,7 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1306
1327
  ], 2)
1307
1328
  ]),
1308
1329
  default: q(() => [
1309
- d("div", ho, [
1330
+ d("div", xo, [
1310
1331
  (v(!0), w(ae, null, ie(p.value, (O) => (v(), w("button", {
1311
1332
  title: "Text align " + O?.id,
1312
1333
  class: E(["w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded hover:text-gray-900 hover:bg-gray-100", { "bg-gray-100 text-gray-900": O?.isActive }]),
@@ -1317,14 +1338,14 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1317
1338
  height: "16",
1318
1339
  width: "16"
1319
1340
  }))
1320
- ], 10, vo))), 128))
1341
+ ], 10, wo))), 128))
1321
1342
  ])
1322
1343
  ]),
1323
1344
  _: 1
1324
1345
  }, 512));
1325
1346
  }
1326
- }, bo = {
1327
- components: { VsText: lt },
1347
+ }, _o = {
1348
+ components: { VsText: at },
1328
1349
  inheritAttrs: !1,
1329
1350
  events: ["update:modelValue"],
1330
1351
  props: {
@@ -1343,17 +1364,17 @@ const lt = /* @__PURE__ */ Q(Wr, [["render", Qr], ["__scopeId", "data-v-eb21a54f
1343
1364
  }
1344
1365
  }
1345
1366
  }
1346
- }, yo = { class: "flex items-center w-full max-w-[182px]" }, xo = ["disabled"];
1347
- function wo(t, e, a, s, n, o) {
1367
+ }, $o = { class: "flex items-center w-full max-w-[182px]" }, Co = ["disabled"];
1368
+ function Ao(t, e, a, s, n, o) {
1348
1369
  const l = Z("vs-text");
1349
- return v(), w("div", yo, [
1370
+ return v(), w("div", $o, [
1350
1371
  de(d("input", {
1351
1372
  "onUpdate:modelValue": e[0] || (e[0] = (c) => o.value = c),
1352
1373
  type: "color",
1353
1374
  class: E(["w-[38px] h-[38px] min-h-[38px] min-w-[38px] py-[2px] px-[3px] -ml-1 dark:bg-neutral-800 border dark:border-neutral-700 border-stone-200 rounded-lg", a.disabled ? "cursor-not-allowed" : "cursor-pointer"]),
1354
1375
  disabled: a.disabled
1355
- }, null, 10, xo), [
1356
- [ft, o.value]
1376
+ }, null, 10, Co), [
1377
+ [pt, o.value]
1357
1378
  ]),
1358
1379
  a.isTextInputShown ? (v(), W(l, {
1359
1380
  key: 0,
@@ -1365,7 +1386,7 @@ function wo(t, e, a, s, n, o) {
1365
1386
  }, null, 8, ["modelValue", "disabled", "clearable"])) : U("", !0)
1366
1387
  ]);
1367
1388
  }
1368
- const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px] mb-[8px]" }, _o = { class: "grid grid-rows-3 grid-cols-7" }, $o = { class: "w-full h-full rounded border border-gray-300 overflow-hidden" }, Co = ["onClick", "title"], Ao = {
1389
+ const nt = /* @__PURE__ */ Q(_o, [["render", Ao]]), So = { class: "flex gap-[4px] mb-[8px]" }, Fo = { class: "grid grid-rows-3 grid-cols-7" }, To = { class: "w-full h-full rounded border border-gray-300 overflow-hidden" }, Lo = ["onClick", "title"], Bo = {
1369
1390
  __name: "vs-editor-color",
1370
1391
  props: {
1371
1392
  editor: Object
@@ -1374,7 +1395,7 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1374
1395
  const e = t, a = $(null), s = $("#000000"), n = N(() => e.editor && e.editor.getAttributes("textStyle").color || "#000000"), o = N(() => n.value !== "#000000"), l = () => {
1375
1396
  e.editor && (s.value = n.value);
1376
1397
  };
1377
- be(() => {
1398
+ ye(() => {
1378
1399
  e.editor && (e.editor.on("selectionUpdate", l), e.editor.on("update", l), l());
1379
1400
  }), Le(() => {
1380
1401
  e.editor && (e.editor.off("selectionUpdate", l), e.editor.off("update", l));
@@ -1401,11 +1422,11 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1401
1422
  "#FFF0B3",
1402
1423
  "#FFBDAD",
1403
1424
  "#EAE6FF"
1404
- ]), r = (b) => {
1405
- e.editor && (e.editor.chain().focus().setColor(b).run(), s.value = b, a.value && a.value.togglePopover());
1425
+ ]), r = (y) => {
1426
+ e.editor && (e.editor.chain().focus().setColor(y).run(), s.value = y, a.value && a.value.togglePopover());
1406
1427
  }, i = () => {
1407
1428
  r(s.value);
1408
- }, x = (b) => ({
1429
+ }, x = (y) => ({
1409
1430
  "#172B4D": "Default",
1410
1431
  "#0747A6": "Bright blue",
1411
1432
  "#008DA6": "Bright blue-green",
@@ -1427,8 +1448,8 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1427
1448
  "#FFF0B3": "Bright yellow",
1428
1449
  "#FFBDAD": "Bright red",
1429
1450
  "#EAE6FF": "Bright purple"
1430
- })[b] || b;
1431
- return (b, f) => (v(), W(fe, {
1451
+ })[y] || y;
1452
+ return (y, f) => (v(), W(fe, {
1432
1453
  ref_key: "popover",
1433
1454
  ref: a,
1434
1455
  placement: "bottom"
@@ -1447,8 +1468,8 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1447
1468
  ]),
1448
1469
  default: q(() => [
1449
1470
  d("div", null, [
1450
- d("div", ko, [
1451
- C(at, {
1471
+ d("div", So, [
1472
+ C(nt, {
1452
1473
  modelValue: s.value,
1453
1474
  "onUpdate:modelValue": f[0] || (f[0] = (p) => s.value = p)
1454
1475
  }, null, 8, ["modelValue"]),
@@ -1459,12 +1480,12 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1459
1480
  C(L(ke), { class: "h-4 w-4 text-white" })
1460
1481
  ])
1461
1482
  ]),
1462
- d("div", _o, [
1483
+ d("div", Fo, [
1463
1484
  (v(!0), w(ae, null, ie(c.value, (p) => (v(), w("div", {
1464
1485
  key: p,
1465
1486
  class: "h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"
1466
1487
  }, [
1467
- d("div", $o, [
1488
+ d("div", To, [
1468
1489
  d("button", {
1469
1490
  class: "flex items-center justify-center w-full h-full",
1470
1491
  style: se({ backgroundColor: p }),
@@ -1475,7 +1496,7 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1475
1496
  key: 0,
1476
1497
  class: "h-4 w-4 text-gray-500"
1477
1498
  })) : U("", !0)
1478
- ], 12, Co)
1499
+ ], 12, Lo)
1479
1500
  ])
1480
1501
  ]))), 128))
1481
1502
  ])
@@ -1484,7 +1505,7 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1484
1505
  _: 1
1485
1506
  }, 512));
1486
1507
  }
1487
- }, Fo = { class: "flex gap-[4px] mb-[8px]" }, So = { class: "grid grid-rows-3 grid-cols-7" }, To = { class: "w-full h-full rounded border border-gray-300 overflow-hidden" }, Lo = ["onClick", "title"], Bo = ["onClick", "title"], Eo = {
1508
+ }, Eo = { class: "flex gap-[4px] mb-[8px]" }, Io = { class: "grid grid-rows-3 grid-cols-7" }, Mo = { class: "w-full h-full rounded border border-gray-300 overflow-hidden" }, Po = ["onClick", "title"], jo = ["onClick", "title"], Ho = {
1488
1509
  __name: "vs-editor-background-color",
1489
1510
  props: {
1490
1511
  editor: Object
@@ -1493,7 +1514,7 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1493
1514
  const e = t, a = $(null), s = $("transparent"), n = N(() => e.editor && e.editor.getAttributes("textStyle").backgroundColor || "transparent"), o = N(() => n.value !== "transparent" && n.value !== ""), l = () => {
1494
1515
  e.editor && (s.value = n.value);
1495
1516
  };
1496
- be(() => {
1517
+ ye(() => {
1497
1518
  e.editor && (e.editor.on("selectionUpdate", l), e.editor.on("update", l), l());
1498
1519
  }), Le(() => {
1499
1520
  e.editor && (e.editor.off("selectionUpdate", l), e.editor.off("update", l));
@@ -1520,11 +1541,11 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1520
1541
  "#FFF0B3",
1521
1542
  "#FFBDAD",
1522
1543
  "#EAE6FF"
1523
- ]), r = (b) => {
1524
- e.editor && (e.editor.chain().focus().setBackgroundColor(b).run(), s.value = b, a.value && a.value.togglePopover());
1544
+ ]), r = (y) => {
1545
+ e.editor && (e.editor.chain().focus().setBackgroundColor(y).run(), s.value = y, a.value && a.value.togglePopover());
1525
1546
  }, i = () => {
1526
1547
  r(s.value);
1527
- }, x = (b) => ({
1548
+ }, x = (y) => ({
1528
1549
  "#172B4D": "Default",
1529
1550
  "#0747A6": "Bright blue",
1530
1551
  "#008DA6": "Bright blue-green",
@@ -1546,8 +1567,8 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1546
1567
  "#FFF0B3": "Bright yellow",
1547
1568
  "#FFBDAD": "Bright red",
1548
1569
  "#EAE6FF": "Bright purple"
1549
- })[b] || b;
1550
- return (b, f) => (v(), W(fe, {
1570
+ })[y] || y;
1571
+ return (y, f) => (v(), W(fe, {
1551
1572
  ref_key: "popover",
1552
1573
  ref: a,
1553
1574
  placement: "bottom"
@@ -1557,7 +1578,7 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1557
1578
  title: "Background Color",
1558
1579
  class: E(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex", { "bg-gray-100": o.value }])
1559
1580
  }, [
1560
- C(L(Dt), { class: "h-4 w-4" }),
1581
+ C(L(Vt), { class: "h-4 w-4" }),
1561
1582
  d("span", {
1562
1583
  class: "block h-1 w-5",
1563
1584
  style: se({ backgroundColor: s.value })
@@ -1566,8 +1587,8 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1566
1587
  ]),
1567
1588
  default: q(() => [
1568
1589
  d("div", null, [
1569
- d("div", Fo, [
1570
- C(at, {
1590
+ d("div", Eo, [
1591
+ C(nt, {
1571
1592
  modelValue: s.value,
1572
1593
  "onUpdate:modelValue": f[0] || (f[0] = (p) => s.value = p)
1573
1594
  }, null, 8, ["modelValue"]),
@@ -1578,19 +1599,19 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1578
1599
  C(L(ke), { class: "h-4 w-4 text-white" })
1579
1600
  ])
1580
1601
  ]),
1581
- d("div", So, [
1602
+ d("div", Io, [
1582
1603
  d("button", {
1583
1604
  onClick: f[1] || (f[1] = (p) => r("transparent")),
1584
1605
  class: "col-span-7 flex items-center justify-center gap-2 bg-gray-100 rounded-md py-1 mb-2 hover:bg-gray-200"
1585
1606
  }, [
1586
- C(L(zt), { class: "h-4 w-4" }),
1607
+ C(L(Dt), { class: "h-4 w-4" }),
1587
1608
  f[2] || (f[2] = d("p", null, "no color", -1))
1588
1609
  ]),
1589
1610
  (v(!0), w(ae, null, ie(c.value, (p) => (v(), w("div", {
1590
1611
  key: p,
1591
1612
  class: "h-8 w-8 p-0.5 rounded border border-transparent hover:border-gray-200 transition-transform cursor-pointer"
1592
1613
  }, [
1593
- d("div", To, [
1614
+ d("div", Mo, [
1594
1615
  p !== "transparent" ? (v(), w("button", {
1595
1616
  key: 0,
1596
1617
  class: "flex items-center justify-center w-full h-full",
@@ -1602,7 +1623,7 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1602
1623
  key: 0,
1603
1624
  class: "h-4 w-4 text-gray-500"
1604
1625
  })) : U("", !0)
1605
- ], 12, Lo)) : U("", !0),
1626
+ ], 12, Po)) : U("", !0),
1606
1627
  p === "transparent" ? (v(), w("button", {
1607
1628
  key: 1,
1608
1629
  class: "flex items-center justify-center w-full h-full",
@@ -1613,7 +1634,7 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1613
1634
  key: 0,
1614
1635
  class: "h-4 w-4 text-gray-500"
1615
1636
  })) : U("", !0)
1616
- ], 8, Bo)) : U("", !0)
1637
+ ], 8, jo)) : U("", !0)
1617
1638
  ])
1618
1639
  ]))), 128))
1619
1640
  ])
@@ -1622,7 +1643,7 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1622
1643
  _: 1
1623
1644
  }, 512));
1624
1645
  }
1625
- }, Io = {
1646
+ }, No = {
1626
1647
  __name: "vs-editor-highlight",
1627
1648
  props: {
1628
1649
  editor: Object
@@ -1636,10 +1657,10 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1636
1657
  onClick: s,
1637
1658
  class: E(["flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex", { "bg-gray-200": a.value }])
1638
1659
  }, [
1639
- C(L(Vt), { class: "h-4 w-4" })
1660
+ C(L(Ot), { class: "h-4 w-4" })
1640
1661
  ], 2));
1641
1662
  }
1642
- }, Po = { class: "truncate" }, jo = { class: "w-[200px]" }, Mo = { class: "max-h-[200px] overflow-y-auto" }, Ho = ["onClick"], No = {
1663
+ }, zo = { class: "truncate" }, Do = { class: "w-[200px]" }, Vo = { class: "max-h-[200px] overflow-y-auto" }, Oo = ["onClick"], Ro = {
1643
1664
  __name: "vs-editor-font-family",
1644
1665
  props: {
1645
1666
  editor: Object
@@ -1669,7 +1690,7 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1669
1690
  ref_key: "popover",
1670
1691
  ref: a,
1671
1692
  placement: "bottom",
1672
- onIsvisible: x[0] || (x[0] = (b) => s.value = b)
1693
+ onIsvisible: x[0] || (x[0] = (y) => s.value = y)
1673
1694
  }, {
1674
1695
  reference: q(() => [
1675
1696
  d("button", {
@@ -1677,26 +1698,26 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1677
1698
  class: E(["h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm", [s.value ? "bg-gray-100 text-gray-900" : "text-gray-700"]]),
1678
1699
  style: se({ fontFamily: o.value })
1679
1700
  }, [
1680
- d("span", Po, Y(l.value), 1),
1681
- C(L(je), { class: "ml-1 h-3 w-3 text-gray-400" })
1701
+ d("span", zo, Y(l.value), 1),
1702
+ C(L(Pe), { class: "ml-1 h-3 w-3 text-gray-400" })
1682
1703
  ], 6)
1683
1704
  ]),
1684
1705
  default: q(() => [
1685
- d("div", jo, [
1686
- d("ul", Mo, [
1687
- (v(!0), w(ae, null, ie(n.value, (b) => (v(), w("li", {
1688
- key: b.value,
1689
- class: E(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm", { "bg-gray-100": c(b.value) }]),
1690
- style: se({ fontFamily: b.value }),
1691
- onClick: (f) => r(b.value)
1692
- }, Y(b.label), 15, Ho))), 128))
1706
+ d("div", Do, [
1707
+ d("ul", Vo, [
1708
+ (v(!0), w(ae, null, ie(n.value, (y) => (v(), w("li", {
1709
+ key: y.value,
1710
+ class: E(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm", { "bg-gray-100": c(y.value) }]),
1711
+ style: se({ fontFamily: y.value }),
1712
+ onClick: (f) => r(y.value)
1713
+ }, Y(y.label), 15, Oo))), 128))
1693
1714
  ])
1694
1715
  ])
1695
1716
  ]),
1696
1717
  _: 1
1697
1718
  }, 512));
1698
1719
  }
1699
- }, zo = { class: "w-[120px]" }, Do = { class: "max-h-[200px] overflow-y-auto" }, Vo = ["onClick"], Oo = {
1720
+ }, Uo = { class: "w-[120px]" }, qo = { class: "max-h-[200px] overflow-y-auto" }, Ko = ["onClick"], Wo = {
1700
1721
  __name: "vs-editor-font-size",
1701
1722
  props: {
1702
1723
  editor: Object
@@ -1705,7 +1726,7 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1705
1726
  const e = t, a = $("popover"), s = $("14px"), n = N(() => e.editor && e.editor.getAttributes("textStyle").fontSize || "14px"), o = N(() => n.value !== "14px"), l = () => {
1706
1727
  e.editor && (s.value = n.value);
1707
1728
  };
1708
- be(() => {
1729
+ ye(() => {
1709
1730
  e.editor && (e.editor.on("selectionUpdate", l), e.editor.on("update", l), l());
1710
1731
  }), Le(() => {
1711
1732
  e.editor && (e.editor.off("selectionUpdate", l), e.editor.off("update", l));
@@ -1739,26 +1760,26 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1739
1760
  title: "Font Size",
1740
1761
  class: E(["h-[30px] px-2 min-w-[30px] rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700 space-x-1", { "bg-gray-100 text-gray-900": o.value }])
1741
1762
  }, [
1742
- C(L(Ot), { class: "h-4 w-4" }),
1743
- C(L(je), { class: "h-3 w-3 text-gray-400" })
1763
+ C(L(Rt), { class: "h-4 w-4" }),
1764
+ C(L(Pe), { class: "h-3 w-3 text-gray-400" })
1744
1765
  ], 2)
1745
1766
  ]),
1746
1767
  default: q(() => [
1747
- d("div", zo, [
1748
- d("ul", Do, [
1749
- (v(!0), w(ae, null, ie(c.value, (b) => (v(), w("li", {
1750
- key: b.value,
1768
+ d("div", Uo, [
1769
+ d("ul", qo, [
1770
+ (v(!0), w(ae, null, ie(c.value, (y) => (v(), w("li", {
1771
+ key: y.value,
1751
1772
  class: "px-3 py-2 hover:bg-gray-100 cursor-pointer",
1752
- onClick: (f) => r(b.value)
1753
- }, Y(b.label), 9, Vo))), 128))
1773
+ onClick: (f) => r(y.value)
1774
+ }, Y(y.label), 9, Ko))), 128))
1754
1775
  ])
1755
1776
  ])
1756
1777
  ]),
1757
1778
  _: 1
1758
1779
  }, 512));
1759
1780
  }
1760
- }, Ro = {
1761
- components: { Superscript: Rt },
1781
+ }, Xo = {
1782
+ components: { Superscript: Ut },
1762
1783
  props: {
1763
1784
  editor: Object
1764
1785
  },
@@ -1768,7 +1789,7 @@ const at = /* @__PURE__ */ Q(bo, [["render", wo]]), ko = { class: "flex gap-[4px
1768
1789
  }
1769
1790
  }
1770
1791
  };
1771
- function Uo(t, e, a, s, n, o) {
1792
+ function Go(t, e, a, s, n, o) {
1772
1793
  const l = Z("Superscript");
1773
1794
  return v(), w("button", {
1774
1795
  title: "Superscript",
@@ -1779,8 +1800,8 @@ function Uo(t, e, a, s, n, o) {
1779
1800
  e[1] || (e[1] = d("span", { class: "sr-only" }, "Superscript", -1))
1780
1801
  ], 2);
1781
1802
  }
1782
- const qo = /* @__PURE__ */ Q(Ro, [["render", Uo]]), Ko = {
1783
- components: { Subscript: Ut },
1803
+ const Yo = /* @__PURE__ */ Q(Xo, [["render", Go]]), Qo = {
1804
+ components: { Subscript: qt },
1784
1805
  props: {
1785
1806
  editor: Object
1786
1807
  },
@@ -1790,7 +1811,7 @@ const qo = /* @__PURE__ */ Q(Ro, [["render", Uo]]), Ko = {
1790
1811
  }
1791
1812
  }
1792
1813
  };
1793
- function Wo(t, e, a, s, n, o) {
1814
+ function Zo(t, e, a, s, n, o) {
1794
1815
  const l = Z("Subscript");
1795
1816
  return v(), w("button", {
1796
1817
  title: "Subscript",
@@ -1801,10 +1822,10 @@ function Wo(t, e, a, s, n, o) {
1801
1822
  e[1] || (e[1] = d("span", { class: "sr-only" }, "Subscript", -1))
1802
1823
  ], 2);
1803
1824
  }
1804
- const Xo = /* @__PURE__ */ Q(Ko, [["render", Wo]]), Go = {
1825
+ const Jo = /* @__PURE__ */ Q(Qo, [["render", Zo]]), el = {
1805
1826
  title: "Heading",
1806
1827
  class: "h-[30px] px-2 rounded-full hover:bg-gray-100 justify-center items-center flex text-sm text-gray-700"
1807
- }, Yo = { class: "truncate" }, Qo = { class: "max-h-[200px] overflow-y-auto" }, Zo = ["onClick"], Jo = {
1828
+ }, tl = { class: "truncate" }, rl = { class: "max-h-[200px] overflow-y-auto" }, ol = ["onClick"], ll = {
1808
1829
  __name: "vs-editor-heading",
1809
1830
  props: {
1810
1831
  editor: Object
@@ -1841,20 +1862,20 @@ const Xo = /* @__PURE__ */ Q(Ko, [["render", Wo]]), Go = {
1841
1862
  placement: "bottom"
1842
1863
  }, {
1843
1864
  reference: q(() => [
1844
- d("button", Go, [
1845
- d("span", Yo, Y(n.value), 1),
1846
- C(L(je), { class: "ml-1 h-3 w-3 text-gray-400" })
1865
+ d("button", el, [
1866
+ d("span", tl, Y(n.value), 1),
1867
+ C(L(Pe), { class: "ml-1 h-3 w-3 text-gray-400" })
1847
1868
  ])
1848
1869
  ]),
1849
1870
  default: q(() => [
1850
1871
  d("div", null, [
1851
- d("ul", Qo, [
1872
+ d("ul", rl, [
1852
1873
  (v(!0), w(ae, null, ie(s.value, (x) => (v(), w("li", {
1853
1874
  key: x.value,
1854
1875
  class: E(["px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm", `heading-level-${x.value}`]),
1855
1876
  style: se(o(x.value)),
1856
- onClick: (b) => l(x.value)
1857
- }, Y(x.label), 15, Zo))), 128)),
1877
+ onClick: (y) => l(x.value)
1878
+ }, Y(x.label), 15, ol))), 128)),
1858
1879
  d("li", {
1859
1880
  class: "px-3 py-2 hover:bg-gray-100 cursor-pointer text-sm border-t border-gray-200 mt-1 pt-2",
1860
1881
  onClick: c
@@ -1865,8 +1886,8 @@ const Xo = /* @__PURE__ */ Q(Ko, [["render", Wo]]), Go = {
1865
1886
  _: 1
1866
1887
  }, 512));
1867
1888
  }
1868
- }, el = /* @__PURE__ */ Q(Jo, [["__scopeId", "data-v-96f02f2a"]]), tl = {
1869
- components: { RemoveFormatting: qt },
1889
+ }, al = /* @__PURE__ */ Q(ll, [["__scopeId", "data-v-96f02f2a"]]), nl = {
1890
+ components: { RemoveFormatting: Kt },
1870
1891
  props: {
1871
1892
  editor: Object
1872
1893
  },
@@ -1876,7 +1897,7 @@ const Xo = /* @__PURE__ */ Q(Ko, [["render", Wo]]), Go = {
1876
1897
  }
1877
1898
  }
1878
1899
  };
1879
- function rl(t, e, a, s, n, o) {
1900
+ function sl(t, e, a, s, n, o) {
1880
1901
  const l = Z("RemoveFormatting");
1881
1902
  return v(), w("button", {
1882
1903
  title: "Clear Formatting",
@@ -1887,16 +1908,16 @@ function rl(t, e, a, s, n, o) {
1887
1908
  e[1] || (e[1] = d("span", { class: "sr-only" }, "Clear Formatting", -1))
1888
1909
  ]);
1889
1910
  }
1890
- const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" }, al = {
1911
+ const il = /* @__PURE__ */ Q(nl, [["render", sl]]), cl = { class: "relative" }, dl = {
1891
1912
  key: 0,
1892
1913
  class: "mt-4"
1893
- }, nl = ["src", "alt", "title"], sl = {
1914
+ }, ul = ["src", "alt", "title"], fl = {
1894
1915
  key: 0,
1895
1916
  class: "text-sm text-red-500"
1896
- }, il = {
1917
+ }, pl = {
1897
1918
  key: 1,
1898
1919
  class: "mt-4"
1899
- }, cl = { class: "text-sm text-gray-600 mb-2" }, dl = { class: "flex flex-wrap gap-2" }, ul = ["src", "alt", "onError"], fl = ["onClick"], pl = { class: "flex justify-end gap-x-2 p-[20px]" }, gl = /* @__PURE__ */ Object.assign({
1920
+ }, gl = { class: "text-sm text-gray-600 mb-2" }, hl = { class: "flex flex-wrap gap-2" }, vl = ["src", "alt", "onError"], ml = ["onClick"], yl = { class: "flex justify-end gap-x-2 p-[20px]" }, bl = /* @__PURE__ */ Object.assign({
1900
1921
  inheritAttrs: !1
1901
1922
  }, {
1902
1923
  __name: "vs-editor-image",
@@ -1923,7 +1944,7 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
1923
1944
  return m.length + k.length > 1;
1924
1945
  }
1925
1946
  return r.value.file instanceof FileList ? r.value.file.length > 1 : !1;
1926
- }), x = N(() => Array.isArray(r.value.file) ? r.value.file.filter((m) => m instanceof File).length === 1 : r.value.file instanceof FileList ? r.value.file.length === 1 : r.value.file instanceof File), b = N(() => {
1947
+ }), x = N(() => Array.isArray(r.value.file) ? r.value.file.filter((m) => m instanceof File).length === 1 : r.value.file instanceof FileList ? r.value.file.length === 1 : r.value.file instanceof File), y = N(() => {
1927
1948
  if (i.value)
1928
1949
  return "";
1929
1950
  if (r.value.src)
@@ -2003,26 +2024,26 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2003
2024
  if (!e.editor) return;
2004
2025
  if (e.editor.isActive("image")) {
2005
2026
  const { state: k } = e.editor, { selection: u } = k, { $from: _ } = u;
2006
- let y = null, T = null;
2027
+ let b = null, T = null;
2007
2028
  if (_.parent.type.name === "image")
2008
- y = _.before(_.depth), T = _.parent;
2029
+ b = _.before(_.depth), T = _.parent;
2009
2030
  else
2010
2031
  for (let H = _.depth; H > 0; H--) {
2011
2032
  const X = _.node(H), g = _.before(H);
2012
2033
  X.type.name === "paragraph" && X.forEach((A, B) => {
2013
2034
  if (A.type.name === "image") {
2014
2035
  const D = g + B + 1;
2015
- (y === null || Math.abs(D - u.$from.pos) < Math.abs(y - u.$from.pos)) && (y = D, T = A);
2036
+ (b === null || Math.abs(D - u.$from.pos) < Math.abs(b - u.$from.pos)) && (b = D, T = A);
2016
2037
  }
2017
2038
  });
2018
2039
  }
2019
- if (y !== null && T) {
2040
+ if (b !== null && T) {
2020
2041
  try {
2021
- e.editor.chain().focus().setNodeSelection(y).run();
2042
+ e.editor.chain().focus().setNodeSelection(b).run();
2022
2043
  } catch {
2023
- e.editor.chain().focus().setTextSelection(y).run();
2044
+ e.editor.chain().focus().setTextSelection(b).run();
2024
2045
  }
2025
- c.value = y;
2046
+ c.value = b;
2026
2047
  } else {
2027
2048
  e.editor.chain().focus().selectParentNode().run();
2028
2049
  const { state: H } = e.editor;
@@ -2030,20 +2051,20 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2030
2051
  }
2031
2052
  const h = T ? T.attrs : e.editor.getAttributes("image");
2032
2053
  o.value = !0;
2033
- let S = "", M = !1;
2054
+ let F = "", j = !1;
2034
2055
  const z = e.editor.getAttributes("link");
2035
- z && z.href && (S = z.href, M = z.target === "_blank");
2036
- const j = h.src || "", F = j ? [j] : [];
2056
+ z && z.href && (F = z.href, j = z.target === "_blank");
2057
+ const P = h.src || "", S = P ? [P] : [];
2037
2058
  r.value = {
2038
- src: j,
2039
- file: F,
2059
+ src: P,
2060
+ file: S,
2040
2061
  // Масив з поточним зображенням
2041
2062
  alt: h.alt || "",
2042
2063
  title: h.title || "",
2043
2064
  width: h.width || "",
2044
2065
  height: h.height || "",
2045
- link: S,
2046
- openInNewTab: M
2066
+ link: F,
2067
+ openInNewTab: j
2047
2068
  };
2048
2069
  } else
2049
2070
  o.value = !1, r.value = {
@@ -2075,18 +2096,18 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2075
2096
  return;
2076
2097
  const k = [];
2077
2098
  for (const u of m)
2078
- if (u && u.type && u.type.startsWith("image/") && !l.value.some((y) => y.file === u)) {
2079
- const y = new Promise((T, h) => {
2080
- const S = new FileReader();
2081
- S.onload = (M) => {
2099
+ if (u && u.type && u.type.startsWith("image/") && !l.value.some((b) => b.file === u)) {
2100
+ const b = new Promise((T, h) => {
2101
+ const F = new FileReader();
2102
+ F.onload = (j) => {
2082
2103
  l.value.push({
2083
2104
  file: u,
2084
- preview: M.target.result,
2105
+ preview: j.target.result,
2085
2106
  error: !1
2086
2107
  }), T();
2087
- }, S.onerror = h, S.readAsDataURL(u);
2108
+ }, F.onerror = h, F.readAsDataURL(u);
2088
2109
  });
2089
- k.push(y);
2110
+ k.push(b);
2090
2111
  }
2091
2112
  await Promise.all(k);
2092
2113
  }, O = (m) => {
@@ -2100,10 +2121,10 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2100
2121
  if (!h || !h.dom) return;
2101
2122
  h.dom.querySelectorAll("img.editor-image[width][height]").forEach((z) => {
2102
2123
  if (z instanceof HTMLImageElement) {
2103
- const j = z.getAttribute("width"), F = z.getAttribute("height");
2104
- j && F && j !== "auto" && F !== "auto" && j !== "" && F !== "" && !isNaN(Number(j)) && !isNaN(Number(F)) && (z.style.cssText = `
2105
- width: ${j}px !important;
2106
- height: ${F}px !important;
2124
+ const P = z.getAttribute("width"), S = z.getAttribute("height");
2125
+ P && S && P !== "auto" && S !== "auto" && P !== "" && S !== "" && !isNaN(Number(P)) && !isNaN(Number(S)) && (z.style.cssText = `
2126
+ width: ${P}px !important;
2127
+ height: ${S}px !important;
2107
2128
  max-width: none !important;
2108
2129
  max-height: none !important;
2109
2130
  min-width: auto !important;
@@ -2112,19 +2133,19 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2112
2133
  `.replace(/\s+/g, " ").trim());
2113
2134
  }
2114
2135
  });
2115
- }, y = r.value.width, T = r.value.height;
2116
- y && T && y !== "" && T !== "" ? [0, u, u * 2, u * 3, u * 4].forEach((S) => {
2117
- setTimeout(_, S);
2136
+ }, b = r.value.width, T = r.value.height;
2137
+ b && T && b !== "" && T !== "" ? [0, u, u * 2, u * 3, u * 4].forEach((F) => {
2138
+ setTimeout(_, F);
2118
2139
  }) : (_(), setTimeout(_, u));
2119
- }, P = async () => {
2140
+ }, M = async () => {
2120
2141
  let m = [], k = [];
2121
2142
  if (Array.isArray(r.value.file) ? (m = r.value.file.filter((h) => h instanceof File), k = r.value.file.filter((h) => typeof h == "string" && h.trim() !== "")) : r.value.file instanceof FileList ? m = Array.from(r.value.file) : r.value.file instanceof File ? m = [r.value.file] : typeof r.value.file == "string" && r.value.file.trim() !== "" && (k = [r.value.file]), m.length === 0 && k.length === 0 && n.value && n.value.file) {
2122
2143
  const h = n.value.file;
2123
- Array.isArray(h) ? (m = h.filter((S) => S instanceof File), k = h.filter((S) => typeof S == "string" && S.trim() !== "")) : h instanceof FileList ? m = Array.from(h) : h instanceof File ? m = [h] : typeof h == "string" && h.trim() !== "" && (k = [h]);
2144
+ Array.isArray(h) ? (m = h.filter((F) => F instanceof File), k = h.filter((F) => typeof F == "string" && F.trim() !== "")) : h instanceof FileList ? m = Array.from(h) : h instanceof File ? m = [h] : typeof h == "string" && h.trim() !== "" && (k = [h]);
2124
2145
  }
2125
2146
  if (k.length > 0 && !o.value) {
2126
2147
  for (const h of k)
2127
- l.value.some((S) => S.url === h) || l.value.push({
2148
+ l.value.some((F) => F.url === h) || l.value.push({
2128
2149
  url: h,
2129
2150
  preview: h,
2130
2151
  error: !1
@@ -2138,7 +2159,7 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2138
2159
  if (!(o.value && u <= 1)) {
2139
2160
  if (u > 0) {
2140
2161
  const h = m.filter(
2141
- (S) => !l.value.some((M) => M.file === S)
2162
+ (F) => !l.value.some((j) => j.file === F)
2142
2163
  );
2143
2164
  h.length > 0 && await V(h);
2144
2165
  }
@@ -2162,31 +2183,31 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2162
2183
  return;
2163
2184
  }
2164
2185
  }
2165
- let y = r.value.src;
2186
+ let b = r.value.src;
2166
2187
  if (x.value) {
2167
2188
  let h = null;
2168
2189
  if (Array.isArray(r.value.file) || r.value.file instanceof FileList ? h = r.value.file[0] : (r.value.file instanceof File || typeof r.value.file == "string") && (h = r.value.file), h instanceof File)
2169
2190
  try {
2170
- const S = new FileReader(), M = await new Promise((z, j) => {
2171
- S.onload = (F) => z(F.target.result), S.onerror = j, S.readAsDataURL(h);
2191
+ const F = new FileReader(), j = await new Promise((z, P) => {
2192
+ F.onload = (S) => z(S.target.result), F.onerror = P, F.readAsDataURL(h);
2172
2193
  });
2173
- y = M, o.value && (r.value.src = M);
2174
- } catch (S) {
2175
- console.error("Помилка при читанні файлу:", S), Se({
2194
+ b = j, o.value && (r.value.src = j);
2195
+ } catch (F) {
2196
+ console.error("Помилка при читанні файлу:", F), Fe({
2176
2197
  type: "error",
2177
2198
  title: "Помилка",
2178
2199
  message: "Не вдалося прочитати файл"
2179
2200
  });
2180
2201
  return;
2181
2202
  }
2182
- else typeof h == "string" && h.trim() !== "" && (y = h.trim(), o.value && h.trim() !== r.value.src && (r.value.src = h.trim(), y = h.trim()));
2203
+ else typeof h == "string" && h.trim() !== "" && (b = h.trim(), o.value && h.trim() !== r.value.src && (r.value.src = h.trim(), b = h.trim()));
2183
2204
  } else if (Array.isArray(r.value.file) && r.value.file.length === 1) {
2184
2205
  const h = r.value.file[0];
2185
- typeof h == "string" && h.trim() !== "" && (y = h.trim(), (!r.value.src || r.value.src !== h.trim()) && (r.value.src = h.trim()));
2186
- } else typeof r.value.file == "string" && r.value.file.trim() !== "" && (y = r.value.file.trim(), (!r.value.src || r.value.src !== r.value.file.trim()) && (r.value.src = r.value.file.trim()));
2187
- const T = y || Array.isArray(r.value.file) && r.value.file.length > 0 && (r.value.file.some((h) => h instanceof File) || r.value.file.some((h) => typeof h == "string" && h.trim() !== "")) || r.value.file instanceof FileList && r.value.file.length > 0 || typeof r.value.file == "string" && r.value.file.trim() !== "";
2188
- if (!y && !T) {
2189
- Se({
2206
+ typeof h == "string" && h.trim() !== "" && (b = h.trim(), (!r.value.src || r.value.src !== h.trim()) && (r.value.src = h.trim()));
2207
+ } else typeof r.value.file == "string" && r.value.file.trim() !== "" && (b = r.value.file.trim(), (!r.value.src || r.value.src !== r.value.file.trim()) && (r.value.src = r.value.file.trim()));
2208
+ const T = b || Array.isArray(r.value.file) && r.value.file.length > 0 && (r.value.file.some((h) => h instanceof File) || r.value.file.some((h) => typeof h == "string" && h.trim() !== "")) || r.value.file instanceof FileList && r.value.file.length > 0 || typeof r.value.file == "string" && r.value.file.trim() !== "";
2209
+ if (!b && !T) {
2210
+ Fe({
2190
2211
  type: "warning",
2191
2212
  title: "Попередження",
2192
2213
  message: "Будь ласка, введіть URL зображення або виберіть файл"
@@ -2194,14 +2215,14 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2194
2215
  return;
2195
2216
  }
2196
2217
  if (!i.value && !T && await n.value.validate()) {
2197
- Se({
2218
+ Fe({
2198
2219
  type: "warning",
2199
2220
  title: "Попередження",
2200
2221
  message: "Будь ласка, заповніть всі обов'язкові поля"
2201
2222
  });
2202
2223
  return;
2203
2224
  }
2204
- if (e.editor && y)
2225
+ if (e.editor && b)
2205
2226
  if (o.value && c.value !== null) {
2206
2227
  const { state: h } = e.editor;
2207
2228
  try {
@@ -2209,48 +2230,48 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2209
2230
  } catch {
2210
2231
  e.editor.chain().focus().setTextSelection(c.value).run();
2211
2232
  }
2212
- const S = e.editor.getAttributes("link"), M = S && S.href, z = R(), j = {
2213
- src: y,
2233
+ const F = e.editor.getAttributes("link"), j = F && F.href, z = R(), P = {
2234
+ src: b,
2214
2235
  alt: r.value.alt || "",
2215
2236
  title: r.value.title || "",
2216
2237
  ...z
2217
2238
  };
2218
- if ((!r.value.width || r.value.width === "") && (j.width = void 0), (!r.value.height || r.value.height === "") && (j.height = void 0), e.editor.chain().focus().updateAttributes("image", j).run(), setTimeout(() => {
2219
- const { view: F } = e.editor;
2220
- if (!F || !F.dom) return;
2221
- F.dom.querySelectorAll("img.editor-image").forEach((g) => {
2239
+ if ((!r.value.width || r.value.width === "") && (P.width = void 0), (!r.value.height || r.value.height === "") && (P.height = void 0), e.editor.chain().focus().updateAttributes("image", P).run(), setTimeout(() => {
2240
+ const { view: S } = e.editor;
2241
+ if (!S || !S.dom) return;
2242
+ S.dom.querySelectorAll("img.editor-image").forEach((g) => {
2222
2243
  if (g instanceof HTMLImageElement) {
2223
2244
  const A = g.getAttribute("src") || g.src;
2224
- (A === y || A.includes(y.split("/").pop())) && (r.value.width && r.value.height ? (g.style.setProperty("width", `${r.value.width}px`, "important"), g.style.setProperty("height", `${r.value.height}px`, "important"), g.style.setProperty("object-fit", "fill", "important"), g.style.setProperty("max-width", "none", "important"), g.style.setProperty("max-height", "none", "important")) : (g.style.removeProperty("width"), g.style.removeProperty("height"), g.style.removeProperty("object-fit"), g.style.removeProperty("max-width"), g.style.removeProperty("max-height")));
2245
+ (A === b || A.includes(b.split("/").pop())) && (r.value.width && r.value.height ? (g.style.setProperty("width", `${r.value.width}px`, "important"), g.style.setProperty("height", `${r.value.height}px`, "important"), g.style.setProperty("object-fit", "fill", "important"), g.style.setProperty("max-width", "none", "important"), g.style.setProperty("max-height", "none", "important")) : (g.style.removeProperty("width"), g.style.removeProperty("height"), g.style.removeProperty("object-fit"), g.style.removeProperty("max-width"), g.style.removeProperty("max-height")));
2225
2246
  }
2226
2247
  });
2227
2248
  }, 20), r.value.link && r.value.link.trim() !== "") {
2228
- let F = r.value.link.trim();
2229
- F.match(/^https?:\/\//i) || (F = "https://" + F), M ? e.editor.chain().focus().extendMarkRange("link").setLink({
2230
- href: F,
2249
+ let S = r.value.link.trim();
2250
+ S.match(/^https?:\/\//i) || (S = "https://" + S), j ? e.editor.chain().focus().extendMarkRange("link").setLink({
2251
+ href: S,
2231
2252
  target: r.value.openInNewTab ? "_blank" : null
2232
2253
  }).run() : e.editor.chain().focus().selectParentNode().setLink({
2233
- href: F,
2254
+ href: S,
2234
2255
  target: r.value.openInNewTab ? "_blank" : null
2235
2256
  }).run();
2236
- } else M && e.editor.chain().focus().extendMarkRange("link").unsetLink().run();
2257
+ } else j && e.editor.chain().focus().extendMarkRange("link").unsetLink().run();
2237
2258
  } else {
2238
- const { state: h } = e.editor, { selection: S } = h, { $anchor: M } = S;
2259
+ const { state: h } = e.editor, { selection: F } = h, { $anchor: j } = F;
2239
2260
  let z = null;
2240
- for (let F = M.depth; F > 0; F--) {
2241
- const H = M.node(F);
2261
+ for (let S = j.depth; S > 0; S--) {
2262
+ const H = j.node(S);
2242
2263
  if (H && H.type.name === "paragraph") {
2243
2264
  z = H;
2244
2265
  break;
2245
2266
  }
2246
2267
  }
2247
2268
  if (z && z.content.content.some(
2248
- (F) => F.type.name === "image"
2269
+ (S) => S.type.name === "image"
2249
2270
  )) {
2250
- const F = ee(z, M.before(M.depth));
2251
- if (F !== null) {
2271
+ const S = ee(z, j.before(j.depth));
2272
+ if (S !== null) {
2252
2273
  const H = R(), X = h.schema.nodes.image.create({
2253
- src: y,
2274
+ src: b,
2254
2275
  alt: r.value.alt || "",
2255
2276
  title: r.value.title || "",
2256
2277
  ...H
@@ -2262,13 +2283,13 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2262
2283
  href: g,
2263
2284
  target: r.value.openInNewTab ? "_blank" : null
2264
2285
  }), B = X.type.create(X.attrs, X.content, [A]);
2265
- e.editor.chain().focus().insertContentAt(F + 1, B).run(), J(e.editor, y);
2286
+ e.editor.chain().focus().insertContentAt(S + 1, B).run(), J(e.editor, b);
2266
2287
  } else
2267
- e.editor.chain().focus().insertContentAt(F + 1, X).run(), J(e.editor, y);
2288
+ e.editor.chain().focus().insertContentAt(S + 1, X).run(), J(e.editor, b);
2268
2289
  } else if (r.value.link && r.value.link.trim() !== "") {
2269
2290
  const H = R();
2270
2291
  e.editor.chain().focus().setImage({
2271
- src: y,
2292
+ src: b,
2272
2293
  alt: r.value.alt || "",
2273
2294
  title: r.value.title || "",
2274
2295
  ...H
@@ -2277,46 +2298,46 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2277
2298
  X.match(/^https?:\/\//i) || (X = "https://" + X), e.editor.chain().focus().selectParentNode().setLink({
2278
2299
  href: X,
2279
2300
  target: r.value.openInNewTab ? "_blank" : null
2280
- }).run(), J(e.editor, y, 20);
2301
+ }).run(), J(e.editor, b, 20);
2281
2302
  }, 10);
2282
2303
  } else {
2283
2304
  const H = R();
2284
2305
  e.editor.chain().focus().setImage({
2285
- src: y,
2306
+ src: b,
2286
2307
  alt: r.value.alt || "",
2287
2308
  title: r.value.title || "",
2288
2309
  ...H
2289
- }).run(), J(e.editor, y);
2310
+ }).run(), J(e.editor, b);
2290
2311
  }
2291
2312
  } else if (r.value.link && r.value.link.trim() !== "") {
2292
- const F = R();
2313
+ const S = R();
2293
2314
  e.editor.chain().focus().setImage({
2294
- src: y,
2315
+ src: b,
2295
2316
  alt: r.value.alt || "",
2296
2317
  title: r.value.title || "",
2297
- ...F
2318
+ ...S
2298
2319
  }).run(), setTimeout(() => {
2299
2320
  let H = r.value.link.trim();
2300
2321
  H.match(/^https?:\/\//i) || (H = "https://" + H), e.editor.chain().focus().selectParentNode().setLink({
2301
2322
  href: H,
2302
2323
  target: r.value.openInNewTab ? "_blank" : null
2303
- }).run(), J(e.editor, y, 20);
2324
+ }).run(), J(e.editor, b, 20);
2304
2325
  }, 10);
2305
2326
  } else {
2306
- const F = R();
2327
+ const S = R();
2307
2328
  e.editor.chain().focus().setImage({
2308
- src: y,
2329
+ src: b,
2309
2330
  alt: r.value.alt || "",
2310
2331
  title: r.value.title || "",
2311
- ...F
2312
- }).run(), J(e.editor, y);
2332
+ ...S
2333
+ }).run(), J(e.editor, b);
2313
2334
  }
2314
2335
  }
2315
2336
  I();
2316
2337
  }, ee = (m, k) => {
2317
2338
  let u = null;
2318
- return m.forEach((_, y) => {
2319
- _.type.name === "image" && (u = k + y + 1);
2339
+ return m.forEach((_, b) => {
2340
+ _.type.name === "image" && (u = k + b + 1);
2320
2341
  }), u;
2321
2342
  }, ne = async () => {
2322
2343
  if (e.editor) {
@@ -2337,48 +2358,48 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2337
2358
  for (const u of l.value) {
2338
2359
  const _ = u.url || u.preview || "";
2339
2360
  if (!_) continue;
2340
- const y = e.editor.schema.nodes.image.create({
2361
+ const b = e.editor.schema.nodes.image.create({
2341
2362
  src: _,
2342
2363
  alt: r.value.alt || "",
2343
2364
  title: r.value.title || "",
2344
2365
  ...k
2345
2366
  });
2346
- m.push(y);
2367
+ m.push(b);
2347
2368
  }
2348
2369
  m.length > 0 && (e.editor.chain().focus().command(({ tr: u, dispatch: _ }) => {
2349
2370
  if (_) {
2350
- const { selection: y } = u, { $anchor: T } = y;
2351
- let h = y.$anchor.pos, S = null, M = null;
2352
- for (let j = T.depth; j > 0; j--) {
2353
- const F = T.node(j);
2354
- if (F && F.type.name === "paragraph") {
2355
- S = F, M = T.start(j);
2371
+ const { selection: b } = u, { $anchor: T } = b;
2372
+ let h = b.$anchor.pos, F = null, j = null;
2373
+ for (let P = T.depth; P > 0; P--) {
2374
+ const S = T.node(P);
2375
+ if (S && S.type.name === "paragraph") {
2376
+ F = S, j = T.start(P);
2356
2377
  break;
2357
2378
  }
2358
2379
  }
2359
- if (S) {
2360
- let j = null;
2361
- S.forEach((F, H) => {
2362
- F.type.name === "image" && (j = M + H + 1);
2363
- }), j !== null ? h = j + 1 : h = M + S.content.size;
2380
+ if (F) {
2381
+ let P = null;
2382
+ F.forEach((S, H) => {
2383
+ S.type.name === "image" && (P = j + H + 1);
2384
+ }), P !== null ? h = P + 1 : h = j + F.content.size;
2364
2385
  }
2365
2386
  let z = h;
2366
- return m.forEach((j) => {
2367
- u.insert(z, j), z += j.nodeSize;
2387
+ return m.forEach((P) => {
2388
+ u.insert(z, P), z += P.nodeSize;
2368
2389
  }), !0;
2369
2390
  }
2370
2391
  return !1;
2371
2392
  }).run(), r.value.width && r.value.height && setTimeout(() => {
2372
2393
  const { view: u } = e.editor;
2373
2394
  u && u.dom && u.dom.querySelectorAll("img.editor-image").forEach((T) => {
2374
- T instanceof HTMLImageElement && Array.from(l.value).some((S) => {
2375
- const M = S.url || S.preview || "", z = T.src || T.getAttribute("src") || "";
2376
- return z === M || z.includes(M.split("/").pop());
2395
+ T instanceof HTMLImageElement && Array.from(l.value).some((F) => {
2396
+ const j = F.url || F.preview || "", z = T.src || T.getAttribute("src") || "";
2397
+ return z === j || z.includes(j.split("/").pop());
2377
2398
  }) && (T.style.setProperty("width", `${r.value.width}px`, "important"), T.style.setProperty("height", `${r.value.height}px`, "important"), T.style.setProperty("object-fit", "fill", "important"), T.style.setProperty("max-width", "none", "important"), T.style.setProperty("max-height", "none", "important"));
2378
2399
  });
2379
2400
  }, 50)), I();
2380
2401
  } catch (m) {
2381
- console.error("Помилка при додаванні зображень:", m), Se({
2402
+ console.error("Помилка при додаванні зображень:", m), Fe({
2382
2403
  type: "error",
2383
2404
  title: "Помилка",
2384
2405
  message: "Не вдалося додати зображення"
@@ -2386,36 +2407,36 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2386
2407
  }
2387
2408
  }
2388
2409
  }, pe = async () => {
2389
- await P();
2410
+ await M();
2390
2411
  }, ge = () => {
2391
2412
  I();
2392
2413
  };
2393
2414
  return me(() => r.value.file, async (m, k) => {
2394
2415
  if (s.value = !1, !(o.value && Array.isArray(m) && m.length === 1 && typeof m[0] == "string" && !m.some((_) => _ instanceof File)))
2395
2416
  if (Array.isArray(m) && m.length > 0) {
2396
- const u = m.filter((y) => y instanceof File), _ = m.filter((y) => typeof y == "string" && y.trim() !== "");
2417
+ const u = m.filter((b) => b instanceof File), _ = m.filter((b) => typeof b == "string" && b.trim() !== "");
2397
2418
  if (u.length > 0 && (o.value ? o.value && u.length === 1 && _.length === 0 && (l.value = []) : l.value = [], (!o.value || u.length > 1 || _.length > 0) && await V(u), o.value && u.length === 1 && _.length === 0)) {
2398
- const y = new FileReader();
2399
- y.onload = (T) => {
2419
+ const b = new FileReader();
2420
+ b.onload = (T) => {
2400
2421
  r.value.src = T.target.result;
2401
- }, y.readAsDataURL(u[0]);
2422
+ }, b.readAsDataURL(u[0]);
2402
2423
  }
2403
2424
  if (_.length > 0)
2404
2425
  if (o.value)
2405
2426
  o.value && _.length === 1 && u.length === 0 && (r.value.src = _[0]);
2406
2427
  else {
2407
2428
  u.length === 0 && (l.value = []);
2408
- for (const y of _)
2409
- l.value.some((T) => T.url === y || T.preview === y) || l.value.push({
2410
- url: y,
2411
- preview: y,
2429
+ for (const b of _)
2430
+ l.value.some((T) => T.url === b || T.preview === b) || l.value.push({
2431
+ url: b,
2432
+ preview: b,
2412
2433
  error: !1
2413
2434
  });
2414
2435
  }
2415
2436
  } else m && typeof m == "object" && m instanceof FileList ? (o.value || (l.value = []), await V(Array.from(m))) : m && typeof m == "object" && !Array.isArray(m) && m instanceof File ? (o.value || (l.value = []), await V([m])) : o.value || (l.value = []);
2416
2437
  }, { immediate: !1 }), me(() => r.value.src, () => {
2417
2438
  s.value = !1;
2418
- }), (m, k) => (v(), w("div", ll, [
2439
+ }), (m, k) => (v(), w("div", cl, [
2419
2440
  d("button", {
2420
2441
  onClick: p,
2421
2442
  class: E([
@@ -2424,16 +2445,16 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2424
2445
  ]),
2425
2446
  title: "Додати зображення"
2426
2447
  }, [
2427
- C(L(Kt), { class: "h-4 w-4" }),
2448
+ C(L(Wt), { class: "h-4 w-4" }),
2428
2449
  k[4] || (k[4] = d("span", { class: "sr-only" }, "Додати зображення", -1))
2429
2450
  ], 2),
2430
- C(ot, {
2451
+ C(lt, {
2431
2452
  modelValue: a.value,
2432
2453
  "onUpdate:modelValue": k[3] || (k[3] = (u) => a.value = u),
2433
2454
  title: o.value ? "Редагувати зображення" : "Додати зображення"
2434
2455
  }, {
2435
2456
  footer: q(() => [
2436
- d("div", pl, [
2457
+ d("div", yl, [
2437
2458
  d("button", {
2438
2459
  onClick: ge,
2439
2460
  type: "button",
@@ -2447,30 +2468,30 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2447
2468
  ])
2448
2469
  ]),
2449
2470
  default: q(() => [
2450
- C(yt, {
2471
+ C(xt, {
2451
2472
  modelValue: r.value,
2452
2473
  "onUpdate:modelValue": k[0] || (k[0] = (u) => r.value = u),
2453
2474
  schema: f.value,
2454
2475
  form: n.value,
2455
2476
  "onUpdate:form": k[1] || (k[1] = (u) => n.value = u)
2456
2477
  }, null, 8, ["modelValue", "schema", "form"]),
2457
- b.value && !i.value ? (v(), w("div", al, [
2478
+ y.value && !i.value ? (v(), w("div", dl, [
2458
2479
  k[5] || (k[5] = d("p", { class: "text-sm text-gray-600 mb-2" }, "Попередній перегляд:", -1)),
2459
2480
  de(d("img", {
2460
- src: b.value,
2481
+ src: y.value,
2461
2482
  alt: r.value.alt || "Попередній перегляд зображення",
2462
2483
  title: r.value.title,
2463
2484
  class: "max-w-full h-auto max-h-32 rounded border",
2464
2485
  onError: k[2] || (k[2] = (u) => s.value = !0)
2465
- }, null, 40, nl), [
2486
+ }, null, 40, ul), [
2466
2487
  [$e, !s.value]
2467
2488
  ]),
2468
- s.value ? (v(), w("p", sl, " Не вдалося завантажити попередній перегляд зображення ")) : U("", !0)
2489
+ s.value ? (v(), w("p", fl, " Не вдалося завантажити попередній перегляд зображення ")) : U("", !0)
2469
2490
  ])) : U("", !0),
2470
- l.value.length > 0 ? (v(), w("div", il, [
2471
- d("p", cl, "Попередній перегляд (" + Y(l.value.length) + " зображень):", 1),
2491
+ l.value.length > 0 ? (v(), w("div", pl, [
2492
+ d("p", gl, "Попередній перегляд (" + Y(l.value.length) + " зображень):", 1),
2472
2493
  k[6] || (k[6] = d("p", { class: "text-xs text-gray-500 mb-2" }, " Зображення будуть розміщені в ряд, якщо вони помістяться по ширині ", -1)),
2473
- d("div", dl, [
2494
+ d("div", hl, [
2474
2495
  (v(!0), w(ae, null, ie(l.value, (u, _) => (v(), w("div", {
2475
2496
  key: _,
2476
2497
  class: "relative"
@@ -2479,15 +2500,15 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2479
2500
  src: u.preview,
2480
2501
  alt: `Попередній перегляд ${_ + 1}`,
2481
2502
  class: "max-w-[100px] max-h-[100px] rounded border object-contain",
2482
- onError: (y) => u.error = !0
2483
- }, null, 40, ul), [
2503
+ onError: (b) => u.error = !0
2504
+ }, null, 40, vl), [
2484
2505
  [$e, !u.error]
2485
2506
  ]),
2486
2507
  d("button", {
2487
- onClick: (y) => O(_),
2508
+ onClick: (b) => O(_),
2488
2509
  class: "absolute -top-2 -right-2 bg-red-500 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-red-600",
2489
2510
  type: "button"
2490
- }, " × ", 8, fl)
2511
+ }, " × ", 8, ml)
2491
2512
  ]))), 128))
2492
2513
  ])
2493
2514
  ])) : U("", !0)
@@ -2496,7 +2517,7 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2496
2517
  }, 8, ["modelValue", "title"])
2497
2518
  ]));
2498
2519
  }
2499
- }), hl = { class: "flex items-center" }, vl = ["disabled"], ml = ["disabled"], bl = /* @__PURE__ */ Object.assign({
2520
+ }), xl = { class: "flex items-center" }, wl = ["disabled"], kl = ["disabled"], _l = /* @__PURE__ */ Object.assign({
2500
2521
  inheritAttrs: !1
2501
2522
  }, {
2502
2523
  __name: "vs-editor-history",
@@ -2507,7 +2528,7 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2507
2528
  }, s = () => {
2508
2529
  e.editor?.can().redo() && e.editor.chain().focus().redo().run();
2509
2530
  };
2510
- return (n, o) => (v(), w("div", hl, [
2531
+ return (n, o) => (v(), w("div", xl, [
2511
2532
  d("button", {
2512
2533
  onClick: a,
2513
2534
  class: E(["w-[30px] h-[30px] flex items-center justify-center rounded-l-full hover:text-gray-900 hover:bg-gray-100 border-r border-gray-200", [
@@ -2516,8 +2537,8 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2516
2537
  disabled: !t.editor?.can().undo(),
2517
2538
  title: "Undo (Ctrl+Z)"
2518
2539
  }, [
2519
- C(L(Wt), { class: "h-4 w-4" })
2520
- ], 10, vl),
2540
+ C(L(Xt), { class: "h-4 w-4" })
2541
+ ], 10, wl),
2521
2542
  d("button", {
2522
2543
  onClick: s,
2523
2544
  class: E(["w-[30px] h-[30px] flex items-center justify-center rounded-r-full hover:text-gray-900 hover:bg-gray-100", [
@@ -2526,11 +2547,11 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2526
2547
  disabled: !t.editor?.can().redo(),
2527
2548
  title: "Redo (Ctrl+Y)"
2528
2549
  }, [
2529
- C(L(Xt), { class: "h-4 w-4" })
2530
- ], 10, ml)
2550
+ C(L(Gt), { class: "h-4 w-4" })
2551
+ ], 10, kl)
2531
2552
  ]));
2532
2553
  }
2533
- }), yl = /* @__PURE__ */ Q(bl, [["__scopeId", "data-v-6a87fc55"]]), xl = { class: "relative" }, wl = { class: "p-6" }, kl = { class: "flex justify-between items-center mb-4" }, _l = /* @__PURE__ */ Object.assign({
2554
+ }), $l = /* @__PURE__ */ Q(_l, [["__scopeId", "data-v-6a87fc55"]]), Cl = { class: "relative" }, Al = { class: "p-6" }, Sl = { class: "flex justify-between items-center mb-4" }, Fl = /* @__PURE__ */ Object.assign({
2534
2555
  inheritAttrs: !1
2535
2556
  }, {
2536
2557
  __name: "vs-editor-help",
@@ -2541,7 +2562,7 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2541
2562
  }, n = () => {
2542
2563
  e.value = !1;
2543
2564
  };
2544
- return (o, l) => (v(), w("div", xl, [
2565
+ return (o, l) => (v(), w("div", Cl, [
2545
2566
  d("button", {
2546
2567
  ref_key: "helpButton",
2547
2568
  ref: a,
@@ -2549,7 +2570,7 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2549
2570
  class: E(["w-[30px] h-[30px] flex items-center justify-center rounded-full hover:text-gray-900 hover:bg-gray-100 text-gray-500", [e.value ? "bg-gray-100 text-gray-900" : "text-gray-500"]]),
2550
2571
  title: "Markdown Shortcuts Help"
2551
2572
  }, [
2552
- C(L(Gt), { class: "h-4 w-4" })
2573
+ C(L(Yt), { class: "h-4 w-4" })
2553
2574
  ], 2),
2554
2575
  e.value ? (v(), w("div", {
2555
2576
  key: 0,
@@ -2558,26 +2579,26 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2558
2579
  }, [
2559
2580
  d("div", {
2560
2581
  class: "bg-white rounded-lg shadow-xl max-w-2xl w-full mx-4 max-h-[80vh] overflow-y-auto",
2561
- onClick: l[0] || (l[0] = pt(() => {
2582
+ onClick: l[0] || (l[0] = gt(() => {
2562
2583
  }, ["stop"]))
2563
2584
  }, [
2564
- d("div", wl, [
2565
- d("div", kl, [
2585
+ d("div", Al, [
2586
+ d("div", Sl, [
2566
2587
  l[1] || (l[1] = d("h2", { class: "text-xl font-semibold text-gray-900" }, "Common Markdown Syntax & Shortcuts", -1)),
2567
2588
  d("button", {
2568
2589
  onClick: n,
2569
2590
  class: "text-gray-400 hover:text-gray-600 transition-colors"
2570
2591
  }, [
2571
- C(L(Pe), { class: "h-6 w-6" })
2592
+ C(L(Me), { class: "h-6 w-6" })
2572
2593
  ])
2573
2594
  ]),
2574
- l[2] || (l[2] = gt('<div class="space-y-6" data-v-92c21275><div data-v-92c21275><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-92c21275>Markdown Syntax</h3><div class="overflow-x-auto" data-v-92c21275><table class="w-full border-collapse" data-v-92c21275><thead data-v-92c21275><tr class="bg-gray-50" data-v-92c21275><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Element</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Example</th></tr></thead><tbody class="text-sm" data-v-92c21275><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Bold</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>**bold text**</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>__bold text__</code></td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Italics</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>*italic text*</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>_italic text_</code></td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Strikethrough</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>~strikethrough text~</code></td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Headings</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275># Heading 1</code>, <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>## Heading 2</code>, etc., up to <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>###### Heading 6</code></td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Unordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use an asterisk (*), dash (-), or plus sign (+) followed by a space. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Ordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use a number followed by a period and a space (e.g., <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>1. First item</code>). </td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Blockquotes</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Start with a greater-than sign (&gt;) followed by a space. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Inline Code</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Surround with backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>`</code>). </td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Code Blocks</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Enclose with three backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>```</code>) before and after the code. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Images</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>![alt text](url)</code> syntax. </td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Links</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>[Link Text](url)</code> syntax. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Checklists</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Create a list item with <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>- [ ]</code> for an incomplete task or <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>- [x]</code> for a completed one. </td></tr></tbody></table></div></div><div data-v-92c21275><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-92c21275>Common Editing Shortcuts</h3><div class="overflow-x-auto" data-v-92c21275><table class="w-full border-collapse" data-v-92c21275><thead data-v-92c21275><tr class="bg-gray-50" data-v-92c21275><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Shortcut</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Action</th></tr></thead><tbody class="text-sm" data-v-92c21275><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+A</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Select all text</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+B</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Apply bold formatting</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+C</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Copy selected text</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+I</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Apply italic formatting</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+K</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Open the insert link dialog</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+S</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Save the current document</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+V</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Paste copied text</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+X</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Cut selected text</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+Y</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Redo the last action</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Alt+Shift+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Redo the last action</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+Z</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Undo the last action</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Alt+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Undo the last action</td></tr></tbody></table></div></div></div>', 1))
2595
+ l[2] || (l[2] = ht('<div class="space-y-6" data-v-92c21275><div data-v-92c21275><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-92c21275>Markdown Syntax</h3><div class="overflow-x-auto" data-v-92c21275><table class="w-full border-collapse" data-v-92c21275><thead data-v-92c21275><tr class="bg-gray-50" data-v-92c21275><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Element</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Example</th></tr></thead><tbody class="text-sm" data-v-92c21275><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Bold</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>**bold text**</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>__bold text__</code></td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Italics</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>*italic text*</code> or <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>_italic text_</code></td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Strikethrough</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>~strikethrough text~</code></td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Headings</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275># Heading 1</code>, <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>## Heading 2</code>, etc., up to <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>###### Heading 6</code></td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Unordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use an asterisk (*), dash (-), or plus sign (+) followed by a space. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Ordered Lists</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use a number followed by a period and a space (e.g., <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>1. First item</code>). </td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Blockquotes</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Start with a greater-than sign (&gt;) followed by a space. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Inline Code</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Surround with backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>`</code>). </td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Code Blocks</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Enclose with three backticks (<code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>```</code>) before and after the code. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Images</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>![alt text](url)</code> syntax. </td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Links</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Use <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>[Link Text](url)</code> syntax. </td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275>Checklists</td><td class="border border-gray-200 px-3 py-2" data-v-92c21275> Create a list item with <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>- [ ]</code> for an incomplete task or <code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>- [x]</code> for a completed one. </td></tr></tbody></table></div></div><div data-v-92c21275><h3 class="text-lg font-medium text-gray-800 mb-3" data-v-92c21275>Common Editing Shortcuts</h3><div class="overflow-x-auto" data-v-92c21275><table class="w-full border-collapse" data-v-92c21275><thead data-v-92c21275><tr class="bg-gray-50" data-v-92c21275><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Shortcut</th><th class="border border-gray-200 px-3 py-2 text-left font-medium text-gray-700" data-v-92c21275>Action</th></tr></thead><tbody class="text-sm" data-v-92c21275><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+A</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Select all text</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+B</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Apply bold formatting</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+C</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Copy selected text</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+I</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Apply italic formatting</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+K</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Open the insert link dialog</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+S</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Save the current document</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+V</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Paste copied text</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+X</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Cut selected text</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+Y</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Redo the last action</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Alt+Shift+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Redo the last action</td></tr><tr data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Ctrl+Z</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Undo the last action</td></tr><tr class="bg-gray-25" data-v-92c21275><td class="border border-gray-200 px-3 py-2 font-medium" data-v-92c21275><code class="bg-gray-100 px-2 py-1 rounded" data-v-92c21275>Alt+Backspace</code></td><td class="border border-gray-200 px-3 py-2" data-v-92c21275>Undo the last action</td></tr></tbody></table></div></div></div>', 1))
2575
2596
  ])
2576
2597
  ])
2577
2598
  ])) : U("", !0)
2578
2599
  ]));
2579
2600
  }
2580
- }), $l = /* @__PURE__ */ Q(_l, [["__scopeId", "data-v-92c21275"]]), Cl = {
2601
+ }), Tl = /* @__PURE__ */ Q(Fl, [["__scopeId", "data-v-92c21275"]]), Ll = {
2581
2602
  __name: "vs-editor-horizontal-rule",
2582
2603
  props: {
2583
2604
  editor: Object
@@ -2591,10 +2612,10 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2591
2612
  onClick: a,
2592
2613
  class: "flex flex-col h-[30px] px-1 rounded-full hover:bg-gray-100 justify-center items-center relative flex"
2593
2614
  }, [
2594
- C(L(Yt), { class: "h-4 w-4" })
2615
+ C(L(Qt), { class: "h-4 w-4" })
2595
2616
  ]));
2596
2617
  }
2597
- }, Al = {
2618
+ }, Bl = {
2598
2619
  __name: "vs-editor-fullscreen",
2599
2620
  props: {
2600
2621
  editor: Object
@@ -2609,35 +2630,35 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2609
2630
  onClick: s,
2610
2631
  class: "w-[30px] h-[30px] flex items-center justify-center text-gray-500 rounded-full hover:text-gray-900 hover:bg-gray-100"
2611
2632
  }, [
2612
- C(L(Qt), { class: "h-4 w-4" })
2633
+ C(L(Zt), { class: "h-4 w-4" })
2613
2634
  ]));
2614
2635
  }
2615
- }, Fl = {
2616
- bold: Pr,
2617
- italic: Hr,
2618
- color: Ao,
2619
- background_color: Eo,
2620
- highlight: Io,
2621
- bullet_list: Cr,
2622
- ordered_list: Sr,
2623
- blockquote: kr,
2624
- codeblock: Br,
2625
- underline: Nr,
2626
- strike: zr,
2627
- link: io,
2628
- table: go,
2629
- text_align: mo,
2630
- font_family: No,
2631
- font_size: Oo,
2632
- superscript: qo,
2633
- subscript: Xo,
2634
- heading: el,
2635
- clear_formatting: ol,
2636
- image: gl,
2637
- history: yl,
2638
- help: $l,
2639
- horizontal_rule: Cl,
2640
- fullscreen: Al
2636
+ }, El = {
2637
+ bold: zr,
2638
+ italic: Or,
2639
+ color: Bo,
2640
+ background_color: Ho,
2641
+ highlight: No,
2642
+ bullet_list: Lr,
2643
+ ordered_list: Ir,
2644
+ blockquote: Sr,
2645
+ codeblock: jr,
2646
+ underline: Rr,
2647
+ strike: Ur,
2648
+ link: go,
2649
+ table: bo,
2650
+ text_align: ko,
2651
+ font_family: Ro,
2652
+ font_size: Wo,
2653
+ superscript: Yo,
2654
+ subscript: Jo,
2655
+ heading: al,
2656
+ clear_formatting: il,
2657
+ image: bl,
2658
+ history: $l,
2659
+ help: Tl,
2660
+ horizontal_rule: Ll,
2661
+ fullscreen: Bl
2641
2662
  }, Xe = {
2642
2663
  // Базовий набір - мінімальний функціонал
2643
2664
  basic: [
@@ -2712,17 +2733,17 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2712
2733
  "fullscreen",
2713
2734
  "help"
2714
2735
  ]
2715
- }, Sl = { class: "flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent" }, Tl = { class: "editor-body" }, Ll = {
2736
+ }, Il = { class: "flex align-middle gap-x-0.5 border-b flex-wrap border-b-gray-200 px-[10px] py-[6px] border-solid border-transparent" }, Ml = { class: "editor-body" }, Pl = {
2716
2737
  key: 0,
2717
2738
  class: "richtext-loading text-sm text-gray-500"
2718
- }, Bl = {
2739
+ }, jl = {
2719
2740
  key: 1,
2720
2741
  class: "richtext-error text-sm text-red-600"
2721
- }, El = { class: "html-source-editor" }, Il = { class: "flex justify-end border-t border-[#e5e7eb] bg-[#f8fafc] px-4 min-h-[38px] items-start overflow-visible" }, Pl = { class: "inline-flex items-stretch -mt-px" }, zl = /* @__PURE__ */ Object.assign({
2742
+ }, Hl = { class: "html-source-editor" }, Nl = { class: "flex justify-end border-t border-[#e5e7eb] bg-[#f8fafc] px-4 min-h-[38px] items-start overflow-visible" }, zl = { class: "inline-flex items-stretch -mt-px" }, Ul = /* @__PURE__ */ Object.assign({
2722
2743
  inheritAttrs: !1
2723
2744
  }, {
2724
2745
  __name: "vs-richtext",
2725
- props: /* @__PURE__ */ ht({
2746
+ props: /* @__PURE__ */ vt({
2726
2747
  modelValue: { type: String, default: () => "" },
2727
2748
  height: { type: String, default: () => "300px" },
2728
2749
  format: { type: String, default: () => "html" },
@@ -2736,13 +2757,13 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2736
2757
  }),
2737
2758
  emits: ["update:modelValue"],
2738
2759
  setup(t) {
2739
- const e = t, a = vt(t, "modelValue"), s = $(null), n = $(null), o = mt(null), l = $(!1), c = $(""), r = $(!1), i = $(null), x = $(""), b = $(""), f = $(null), p = $(!1), I = $(!1), { isFullscreen: V, toggleFullscreen: O } = Zt(), { t: R } = ze(), J = N(() => e.format === "md" ? "markdown" : "html"), P = N(
2760
+ const e = t, a = mt(t, "modelValue"), s = $(null), n = $(null), o = yt(null), l = $(!1), c = $(""), r = $(!1), i = $(null), x = $(""), y = $(""), f = $(null), p = $(!1), I = $(!1), { isFullscreen: V, toggleFullscreen: O } = Jt(), { t: R } = ze(), J = N(() => e.format === "md" ? "markdown" : "html"), M = N(
2740
2761
  () => e.format === "md" ? R("form.richtext.markdown") : R("form.richtext.html")
2741
- ), ee = N(() => o.value || null), ne = N(() => typeof e.toolbar == "string" ? Xe[e.toolbar] || Xe.default : e.toolbar), pe = N(() => ne.value.map((g) => Fl[g]).filter(Boolean)), ge = N(() => (i.value?.attributes || []).find((A) => A.name === "class")?.value || ""), m = N(() => {
2762
+ ), ee = N(() => o.value || null), ne = N(() => typeof e.toolbar == "string" ? Xe[e.toolbar] || Xe.default : e.toolbar), pe = N(() => ne.value.map((g) => El[g]).filter(Boolean)), ge = N(() => (i.value?.attributes || []).find((A) => A.name === "class")?.value || ""), m = N(() => {
2742
2763
  const A = (i.value?.attributes || []).find((D) => D.name === "style")?.value || "", B = {};
2743
2764
  return A.split(";").forEach((D) => {
2744
2765
  const [G, ...Ae] = D.split(":"), he = G?.trim(), ve = Ae.join(":").trim();
2745
- !he || !ve || he !== "height" && (B[he.replace(/-([a-z])/g, (Fe, nt) => nt.toUpperCase())] = ve);
2766
+ !he || !ve || he !== "height" && (B[he.replace(/-([a-z])/g, (Se, st) => st.toUpperCase())] = ve);
2746
2767
  }), B;
2747
2768
  }), k = (g) => {
2748
2769
  const A = (g || "").trim();
@@ -2750,7 +2771,7 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2750
2771
  }, u = (g) => k(g) ? "" : g || "", _ = (g) => {
2751
2772
  const A = g || "";
2752
2773
  f.value = A, a.value = A;
2753
- }, y = (g) => {
2774
+ }, b = (g) => {
2754
2775
  if (!g || !g.view || !g.view.dom) return;
2755
2776
  g.view.dom.querySelectorAll("img.editor-image[width][height]").forEach((B) => {
2756
2777
  if (B instanceof HTMLImageElement) {
@@ -2769,12 +2790,12 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2769
2790
  }, T = async (g, { force: A = !1 } = {}) => {
2770
2791
  if (x.value = g || "", !o.value || r.value && !A) return;
2771
2792
  u(o.value.getHTML()) !== (g || "") && (o.value.commands.setContent(g || "", !1), ue(() => {
2772
- y(o.value);
2793
+ b(o.value);
2773
2794
  }));
2774
2795
  }, h = async (g) => {
2775
- I.value = !0, b.value = g || "", await ue(), I.value = !1;
2776
- }, S = async (g) => e.format === "html" ? Te(g || "") : g || "", M = async () => {
2777
- const g = await S(b.value);
2796
+ I.value = !0, y.value = g || "", await ue(), I.value = !1;
2797
+ }, F = async (g) => e.format === "html" ? Te(g || "") : g || "", j = async () => {
2798
+ const g = await F(y.value);
2778
2799
  g !== (a.value || "") ? _(g) : f.value = g;
2779
2800
  }, z = async (g) => {
2780
2801
  const A = g || "";
@@ -2788,26 +2809,26 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2788
2809
  await T(B || ""), r.value && await h(A);
2789
2810
  }
2790
2811
  f.value = A;
2791
- }, j = async () => {
2812
+ }, P = async () => {
2792
2813
  if (e.format === "html") {
2793
2814
  const A = u(o.value?.getHTML() || x.value || ""), B = Ue(A, i.value);
2794
2815
  return Ke(Te(B), "html");
2795
2816
  }
2796
2817
  const g = u(o.value?.getHTML() || x.value || "");
2797
2818
  return Ke(g, e.format);
2798
- }, F = async (g) => {
2819
+ }, S = async (g) => {
2799
2820
  if (r.value !== g) {
2800
2821
  if (g) {
2801
- p.value = !0, r.value = !0, await h(await j()), ue(() => {
2822
+ p.value = !0, r.value = !0, await h(await P()), ue(() => {
2802
2823
  n.value?.focus?.();
2803
2824
  });
2804
2825
  return;
2805
2826
  }
2806
- if (await M(), e.format === "html") {
2807
- const A = Te(b.value || ""), B = Re(A);
2827
+ if (await j(), e.format === "html") {
2828
+ const A = Te(y.value || ""), B = Re(A);
2808
2829
  i.value = B.wrapper, await T(B.bodyHtml || "", { force: !0 });
2809
2830
  } else {
2810
- const A = await qe(b.value || "", e.format);
2831
+ const A = await qe(y.value || "", e.format);
2811
2832
  await T(A || "", { force: !0 });
2812
2833
  }
2813
2834
  r.value = !1, p.value = !1, ue(() => {
@@ -2820,7 +2841,7 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2820
2841
  if (!s.value) return null;
2821
2842
  l.value = !0, c.value = "";
2822
2843
  try {
2823
- const g = await ar();
2844
+ const g = await dr();
2824
2845
  if (!g) return null;
2825
2846
  const A = new g.Editor({
2826
2847
  element: s.value,
@@ -2861,7 +2882,7 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2861
2882
  g.TextAlign.configure({
2862
2883
  types: ["heading", "paragraph"]
2863
2884
  }),
2864
- g.Link.configure({
2885
+ g.CustomLink.configure({
2865
2886
  HTMLAttributes: {
2866
2887
  class: "editor-link"
2867
2888
  },
@@ -2872,14 +2893,14 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2872
2893
  g.Iframe
2873
2894
  ],
2874
2895
  editorProps: {
2875
- handlePaste: (B, D) => vr(B, D, g.ProseMirrorDOMParser),
2896
+ handlePaste: (B, D) => wr(B, D, g.ProseMirrorDOMParser),
2876
2897
  handleKeyDown: (B, D) => {
2877
2898
  if (D.key === "Tab") {
2878
2899
  const G = B.state, { $anchor: Ae } = G.selection;
2879
2900
  let he = !1;
2880
2901
  for (let ve = Ae.depth; ve > 0; ve--) {
2881
- const Fe = Ae.node(ve);
2882
- if (Fe && (Fe.type.name === "bulletList" || Fe.type.name === "orderedList")) {
2902
+ const Se = Ae.node(ve);
2903
+ if (Se && (Se.type.name === "bulletList" || Se.type.name === "orderedList")) {
2883
2904
  he = !0;
2884
2905
  break;
2885
2906
  }
@@ -2897,14 +2918,14 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2897
2918
  const G = Ue(D, i.value);
2898
2919
  G !== a.value && _(G);
2899
2920
  } else {
2900
- const G = await gr(D, e.format);
2921
+ const G = await br(D, e.format);
2901
2922
  G !== a.value && _(G);
2902
2923
  }
2903
2924
  setTimeout(() => {
2904
- y(B);
2925
+ b(B);
2905
2926
  }, 10);
2906
2927
  }), ue(() => {
2907
- y(o.value);
2928
+ b(o.value);
2908
2929
  }), A;
2909
2930
  } catch (g) {
2910
2931
  return c.value = "Failed to load rich text editor dependencies.", console.error("Failed to initialize rich text editor", g), null;
@@ -2920,20 +2941,20 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2920
2941
  A !== f.value && await z(A);
2921
2942
  },
2922
2943
  { immediate: !0 }
2923
- ), me(b, async () => {
2924
- !r.value || !p.value || I.value || await M();
2925
- }), be(async () => {
2944
+ ), me(y, async () => {
2945
+ !r.value || !p.value || I.value || await j();
2946
+ }), ye(async () => {
2926
2947
  await X(), ue(() => {
2927
2948
  o.value && setTimeout(() => {
2928
- y(o.value);
2949
+ b(o.value);
2929
2950
  }, 100);
2930
2951
  });
2931
2952
  }), Qe(async () => {
2932
- r.value && p.value && await M(), o.value?.destroy?.(), o.value = null;
2953
+ r.value && p.value && await j(), o.value?.destroy?.(), o.value = null;
2933
2954
  }), (g, A) => (v(), w("div", {
2934
2955
  class: E(["bg-white rounded-md w-full", { "fixed left-0 right-0 top-0 bottom-0 z-[100000]": L(V) }])
2935
2956
  }, [
2936
- d("div", Sl, [
2957
+ d("div", Il, [
2937
2958
  (v(!0), w(ae, null, ie(pe.value, (B) => (v(), w(ae, { key: B }, [
2938
2959
  o.value ? (v(), W(Ee(B), {
2939
2960
  key: 0,
@@ -2947,7 +2968,7 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2947
2968
  class: "relative w-full px-4 py-2 bg-white rounded-b-lg editor-content",
2948
2969
  style: se({ height: L(V) ? "calc(95vh - 44px)" : t.height })
2949
2970
  }, [
2950
- d("div", Tl, [
2971
+ d("div", Ml, [
2951
2972
  de(d("div", {
2952
2973
  class: E(["rich-text-scroll-wrapper", ge.value]),
2953
2974
  style: se(m.value)
@@ -2957,17 +2978,17 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2957
2978
  ref: s,
2958
2979
  class: "relative w-full"
2959
2980
  }, null, 512),
2960
- l.value ? (v(), w("div", Ll, "Loading editor...")) : U("", !0),
2961
- c.value ? (v(), w("div", Bl, Y(c.value), 1)) : U("", !0)
2981
+ l.value ? (v(), w("div", Pl, "Loading editor...")) : U("", !0),
2982
+ c.value ? (v(), w("div", jl, Y(c.value), 1)) : U("", !0)
2962
2983
  ], 6), [
2963
2984
  [$e, !r.value]
2964
2985
  ]),
2965
- de(d("div", El, [
2966
- C(xt, {
2986
+ de(d("div", Hl, [
2987
+ C(wt, {
2967
2988
  ref_key: "htmlTextarea",
2968
2989
  ref: n,
2969
- modelValue: b.value,
2970
- "onUpdate:modelValue": A[0] || (A[0] = (B) => b.value = B),
2990
+ modelValue: y.value,
2991
+ "onUpdate:modelValue": A[0] || (A[0] = (B) => y.value = B),
2971
2992
  height: "100%",
2972
2993
  syntax: J.value,
2973
2994
  theme: "vs-light"
@@ -2977,15 +2998,15 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2977
2998
  ])
2978
2999
  ])
2979
3000
  ], 4),
2980
- d("div", Il, [
2981
- d("div", Pl, [
3001
+ d("div", Nl, [
3002
+ d("div", zl, [
2982
3003
  d("button", {
2983
3004
  type: "button",
2984
3005
  class: E([
2985
3006
  "min-w-[96px] h-[30px] px-[14px] border border-[#cfd6e0] bg-[#f3f5f8] text-[8px] font-bold uppercase tracking-[0.06em] leading-none cursor-pointer transition-colors duration-200 border-b-[1px] border-b-[#cfd6e0] rounded-none rounded-bl-[8px] hover:bg-[#eef1f5] hover:text-[#667284]",
2986
3007
  r.value ? "text-[#8f99aa]" : "!bg-white text-[#49556a] border-[#cfd6e0] border-t-transparent relative z-[1]"
2987
3008
  ]),
2988
- onClick: A[1] || (A[1] = (B) => F(!1))
3009
+ onClick: A[1] || (A[1] = (B) => S(!1))
2989
3010
  }, Y(L(R)("form.richtext.editor")), 3),
2990
3011
  d("button", {
2991
3012
  type: "button",
@@ -2993,13 +3014,13 @@ const ol = /* @__PURE__ */ Q(tl, [["render", rl]]), ll = { class: "relative" },
2993
3014
  "min-w-[96px] h-[30px] px-[14px] border border-[#cfd6e0] border-l-0 bg-[#f3f5f8] text-[8px] font-bold uppercase tracking-[0.06em] leading-none cursor-pointer transition-colors duration-200 border-b-[1px] border-b-[#cfd6e0] rounded-none rounded-br-[8px] hover:bg-[#eef1f5] hover:text-[#667284]",
2994
3015
  r.value ? "!bg-white text-[#49556a] border-[#cfd6e0] border-t-transparent relative z-[1]" : "text-[#8f99aa]"
2995
3016
  ]),
2996
- onClick: A[2] || (A[2] = (B) => F(!0))
2997
- }, Y(P.value), 3)
3017
+ onClick: A[2] || (A[2] = (B) => S(!0))
3018
+ }, Y(M.value), 3)
2998
3019
  ])
2999
3020
  ])
3000
3021
  ], 2));
3001
3022
  }
3002
3023
  });
3003
3024
  export {
3004
- zl as default
3025
+ Ul as default
3005
3026
  };