md-editor-v3 3.0.0-beta.1 → 3.0.0-beta.2

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,28 +1,28 @@
1
- var St = Object.defineProperty;
2
- var xt = (e, t, o) => t in e ? St(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
- var U = (e, t, o) => (xt(e, typeof t != "symbol" ? t + "" : t, o), o);
4
- import { defineComponent as M, createVNode as i, reactive as N, ref as F, watch as T, onMounted as A, onBeforeUnmount as ye, cloneVNode as Et, inject as x, computed as D, nextTick as z, Fragment as Ce, toRef as Q, shallowRef as de, provide as W, isVNode as Lt } from "vue";
5
- import { minimalSetup as Ht, EditorView as ae } from "codemirror";
6
- import { EditorSelection as fe, EditorState as ce, Compartment as It, StateEffect as At } from "@codemirror/state";
7
- import { EditorView as $e, placeholder as Ft, keymap as Mt } from "@codemirror/view";
8
- import { languages as Rt } from "@codemirror/language-data";
9
- import { markdown as jt } from "@codemirror/lang-markdown";
10
- import { deleteLine as Bt, indentWithTab as Pt, undo as Ot, redo as Dt } from "@codemirror/commands";
11
- import { HighlightStyle as bt, syntaxHighlighting as kt, indentUnit as Nt } from "@codemirror/language";
1
+ var Tt = Object.defineProperty;
2
+ var St = (e, t, o) => t in e ? Tt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
+ var U = (e, t, o) => (St(e, typeof t != "symbol" ? t + "" : t, o), o);
4
+ import { defineComponent as M, createVNode as i, reactive as N, ref as F, watch as T, onMounted as A, onBeforeUnmount as ke, cloneVNode as xt, inject as x, computed as D, nextTick as z, Fragment as ye, toRef as Q, shallowRef as se, provide as W, isVNode as Et } from "vue";
5
+ import { minimalSetup as Lt, EditorView as re } from "codemirror";
6
+ import { EditorSelection as me, EditorState as ae, Compartment as Ht, StateEffect as It } from "@codemirror/state";
7
+ import { EditorView as Ce, placeholder as At, keymap as Ft } from "@codemirror/view";
8
+ import { languages as Mt } from "@codemirror/language-data";
9
+ import { markdown as Rt } from "@codemirror/lang-markdown";
10
+ import { deleteLine as jt, indentWithTab as Bt, undo as Pt, redo as Ot } from "@codemirror/commands";
11
+ import { HighlightStyle as pt, syntaxHighlighting as bt, indentUnit as Dt } from "@codemirror/language";
12
12
  import { tags as g } from "@lezer/highlight";
13
- import _t from "medium-zoom";
14
- import Vt from "copy-to-clipboard";
15
- import Ut from "markdown-it";
16
- import qt from "markdown-it-image-figures";
17
- import Wt from "markdown-it-task-lists";
18
- import Gt from "lru-cache";
19
- const s = "md-editor", zt = "md-editor-v3", Kt = "https://at.alicdn.com/t/c/font_2605852_u82y61ve02.js", H = "https://cdnjs.cloudflare.com/ajax/libs", Xt = `${H}/highlight.js/11.7.0/highlight.min.js`, Ke = {
13
+ import Nt from "medium-zoom";
14
+ import _t from "copy-to-clipboard";
15
+ import Vt from "markdown-it";
16
+ import Ut from "markdown-it-image-figures";
17
+ import qt from "markdown-it-task-lists";
18
+ import Wt from "lru-cache";
19
+ const s = "md-editor", Gt = "md-editor-v3", zt = "https://at.alicdn.com/t/c/font_2605852_u82y61ve02.js", H = "https://cdnjs.cloudflare.com/ajax/libs", Kt = `${H}/highlight.js/11.7.0/highlight.min.js`, ze = {
20
20
  main: `${H}/prettier/2.8.0/standalone.js`,
21
21
  markdown: `${H}/prettier/2.8.0/parser-markdown.js`
22
- }, Xe = {
22
+ }, Ke = {
23
23
  css: `${H}/cropperjs/1.5.13/cropper.min.css`,
24
24
  js: `${H}/cropperjs/1.5.13/cropper.min.js`
25
- }, Zt = `${H}/screenfull.js/5.2.0/screenfull.min.js`, yt = [
25
+ }, Xt = `${H}/screenfull.js/5.2.0/screenfull.min.js`, kt = [
26
26
  "bold",
27
27
  "underline",
28
28
  "italic",
@@ -55,7 +55,7 @@ const s = "md-editor", zt = "md-editor-v3", Kt = "https://at.alicdn.com/t/c/font
55
55
  "htmlPreview",
56
56
  "catalog",
57
57
  "github"
58
- ], Ct = ["markdownTotal", "=", "scrollSwitch"], Ze = {
58
+ ], yt = ["markdownTotal", "=", "scrollSwitch"], Xe = {
59
59
  "zh-CN": {
60
60
  toolbarTips: {
61
61
  bold: "加粗",
@@ -218,10 +218,10 @@ const s = "md-editor", zt = "md-editor-v3", Kt = "https://at.alicdn.com/t/c/font
218
218
  scrollAuto: "Scroll Auto"
219
219
  }
220
220
  }
221
- }, Jt = `${H}/mermaid/9.4.0/mermaid.min.js`, Je = {
221
+ }, Zt = `${H}/mermaid/9.4.0/mermaid.min.js`, Ze = {
222
222
  js: `${H}/KaTeX/0.16.3/katex.min.js`,
223
223
  css: `${H}/KaTeX/0.16.3/katex.min.css`
224
- }, Ye = {
224
+ }, Je = {
225
225
  a11y: {
226
226
  light: `${H}/highlight.js/11.7.0/styles/a11y-light.min.css`,
227
227
  dark: `${H}/highlight.js/11.7.0/styles/a11y-dark.min.css`
@@ -263,14 +263,14 @@ const s = "md-editor", zt = "md-editor-v3", Kt = "https://at.alicdn.com/t/c/font
263
263
  codeMirrorExtensions: (e, t) => t,
264
264
  markdownItConfig: () => {
265
265
  }
266
- }, Yt = (e) => {
266
+ }, Jt = (e) => {
267
267
  if (e)
268
268
  for (const t in e) {
269
269
  const o = e[t];
270
270
  o && (I[t] = o);
271
271
  }
272
272
  };
273
- const Qt = /* @__PURE__ */ M({
273
+ const Yt = /* @__PURE__ */ M({
274
274
  setup() {
275
275
  return () => i("div", {
276
276
  class: `${s}-divider`
@@ -284,7 +284,7 @@ const Qt = /* @__PURE__ */ M({
284
284
  const r = (e == null ? void 0 : e.$slots[l]) || (t == null ? void 0 : t.slots[l]);
285
285
  return (r ? r(e) : "") || o[l];
286
286
  };
287
- const el = {
287
+ const Qt = {
288
288
  trigger: {
289
289
  type: String,
290
290
  default: "hover"
@@ -308,7 +308,7 @@ const el = {
308
308
  default: "html"
309
309
  }
310
310
  }, Y = /* @__PURE__ */ M({
311
- props: el,
311
+ props: Qt,
312
312
  setup(e, t) {
313
313
  const o = `${s}-dropdown-hidden`, l = N({
314
314
  overlayClass: [o],
@@ -342,7 +342,7 @@ const el = {
342
342
  };
343
343
  return A(() => {
344
344
  e.trigger === "click" ? (r.value.addEventListener("click", a), document.addEventListener("click", m)) : (r.value.addEventListener("mouseenter", a), r.value.addEventListener("mouseleave", d), n.value.addEventListener("mouseenter", c), n.value.addEventListener("mouseleave", d));
345
- }), ye(() => {
345
+ }), ke(() => {
346
346
  e.trigger === "click" ? (r.value.removeEventListener("click", a), document.removeEventListener("click", m)) : (r.value.removeEventListener("mouseenter", a), r.value.removeEventListener("mouseleave", d), n.value.removeEventListener("mouseenter", c), n.value.removeEventListener("mouseleave", d));
347
347
  }), () => {
348
348
  const f = _({
@@ -350,7 +350,7 @@ const el = {
350
350
  }), h = _({
351
351
  props: e,
352
352
  ctx: t
353
- }, "overlay"), v = Et(f instanceof Array ? f[0] : f, {
353
+ }, "overlay"), v = xt(f instanceof Array ? f[0] : f, {
354
354
  ref: r
355
355
  }), b = i("div", {
356
356
  class: [`${s}-dropdown`, l.overlayClass],
@@ -363,7 +363,7 @@ const el = {
363
363
  };
364
364
  }
365
365
  });
366
- class tl {
366
+ class el {
367
367
  constructor() {
368
368
  // 事件池
369
369
  U(this, "pools", {});
@@ -394,14 +394,14 @@ class tl {
394
394
  });
395
395
  }
396
396
  }
397
- const C = new tl(), ll = (e, t = {
397
+ const C = new el(), tl = (e, t = {
398
398
  newWindow: !0,
399
399
  nofollow: !0
400
400
  }) => {
401
401
  e || console.error("error link!");
402
402
  const o = document.createElement("a");
403
403
  o.href = e, o.style.display = "none", t.newWindow && (o.target = "_blank"), t.nofollow && (o.rel = "noopener noreferrer"), document.body.appendChild(o), o.click(), document.body.removeChild(o);
404
- }, ol = (e, t = "image.png") => {
404
+ }, ll = (e, t = "image.png") => {
405
405
  const o = e.split(","), l = o[0].match(/:(.*?);/);
406
406
  if (l) {
407
407
  const r = l[1], n = atob(o[1]);
@@ -412,7 +412,7 @@ const C = new tl(), ll = (e, t = {
412
412
  return new File([c], t, { type: r });
413
413
  }
414
414
  return null;
415
- }, nl = (e) => {
415
+ }, ol = (e) => {
416
416
  if (!e)
417
417
  return e;
418
418
  const t = e.split(`
@@ -420,14 +420,14 @@ const C = new tl(), ll = (e, t = {
420
420
  return t.forEach(() => {
421
421
  o.push("<span></span>");
422
422
  }), o.push("</span>"), `<span class="code-block">${e}</span>${o.join("")}`;
423
- }, ee = (e, t = 200) => {
423
+ }, de = (e, t = 200) => {
424
424
  let o = 0;
425
425
  return (...l) => new Promise((r) => {
426
426
  o && (clearTimeout(o), r("cancel")), o = window.setTimeout(() => {
427
427
  e.apply(void 0, l), o = 0, r("done");
428
428
  }, t);
429
429
  });
430
- }, rl = (e, t = 200) => {
430
+ }, nl = (e, t = 200) => {
431
431
  let o = 0, l = null;
432
432
  return (...r) => {
433
433
  const n = (a) => {
@@ -435,13 +435,13 @@ const C = new tl(), ll = (e, t = {
435
435
  };
436
436
  l === null && window.requestAnimationFrame(n), l = r;
437
437
  };
438
- }, il = (e, t) => {
438
+ }, rl = (e, t) => {
439
439
  const o = e == null ? void 0 : e.getBoundingClientRect();
440
440
  if (t === document.documentElement)
441
441
  return o.top - t.clientTop;
442
442
  const l = t == null ? void 0 : t.getBoundingClientRect();
443
443
  return o.top - l.top;
444
- }, al = () => `${Date.now().toString(36)}${Math.random().toString(36).substring(2)}`, sl = {
444
+ }, il = () => `${Date.now().toString(36)}${Math.random().toString(36).substring(2)}`, al = {
445
445
  noPrettier: {
446
446
  type: Boolean
447
447
  },
@@ -482,7 +482,7 @@ const C = new tl(), ll = (e, t = {
482
482
  noUploadImg: {
483
483
  type: Boolean
484
484
  }
485
- }, me = "onSave", we = "changeCatalogVisible", $t = "changeFullscreen", Qe = "pageFullscreenChanged", et = "fullscreenChanged", ve = "previewChanged", tt = "htmlPreviewChanged", lt = "catalogVisibleChanged", wt = "textareaFocus", ot = (e, t) => {
485
+ }, ue = "onSave", $e = "changeCatalogVisible", Ct = "changeFullscreen", Ye = "pageFullscreenChanged", Qe = "fullscreenChanged", he = "previewChanged", et = "htmlPreviewChanged", tt = "catalogVisibleChanged", $t = "textareaFocus", lt = (e, t) => {
486
486
  const o = (l) => {
487
487
  const r = e.parentElement || document.body, n = r.offsetWidth, a = r.offsetHeight, { clientWidth: c } = document.documentElement, { clientHeight: m } = document.documentElement, u = l.offsetX, d = l.offsetY, f = (v) => {
488
488
  let b = v.x + document.body.scrollLeft - document.body.clientLeft - u, k = v.y + document.body.scrollTop - document.body.clientTop - d;
@@ -498,14 +498,16 @@ const C = new tl(), ll = (e, t = {
498
498
  e.removeEventListener("mousedown", o);
499
499
  };
500
500
  }, O = (e, t = "") => {
501
- const o = document.getElementById(e.id), l = (r) => {
502
- typeof e.onload == "function" && e.onload(r), e.removeEventListener("load", l);
501
+ const o = document.getElementById(e.id), l = e.onload;
502
+ e.onload = null;
503
+ const r = function(n) {
504
+ typeof l == "function" && l.bind(this)(n), e.removeEventListener("load", r);
503
505
  };
504
- o ? t !== "" && typeof e.onload == "function" && (Reflect.get(window, t) ? e.dispatchEvent(new Event("load")) : o.addEventListener("load", l)) : (e.addEventListener("load", l), document.head.appendChild(e));
505
- }, cl = ee((e, t, o) => {
506
+ o ? t !== "" && (o.addEventListener("load", r), Reflect.get(window, t) && o.dispatchEvent(new Event("load"))) : (e.addEventListener("load", r), document.head.appendChild(e));
507
+ }, sl = de((e, t, o) => {
506
508
  const l = document.getElementById(e);
507
509
  l && l.setAttribute(t, o);
508
- }, 10), dl = (e) => {
510
+ }, 10), cl = (e) => {
509
511
  var m, u, d, f;
510
512
  const t = x("editorId");
511
513
  let o = (u = (m = I.editorExtensions) == null ? void 0 : m.screenfull) == null ? void 0 : u.instance;
@@ -528,15 +530,15 @@ const C = new tl(), ll = (e, t = {
528
530
  return A(() => {
529
531
  if (a(), !o) {
530
532
  const h = document.createElement("script");
531
- h.src = l || Zt, h.onload = c, h.id = `${s}-screenfull`, O(h, "screenfull");
533
+ h.src = l || Xt, h.onload = c, h.id = `${s}-screenfull`, O(h, "screenfull");
532
534
  }
533
535
  }), A(() => {
534
536
  C.on(t, {
535
- name: $t,
537
+ name: Ct,
536
538
  callback: n
537
539
  });
538
540
  }), { fullscreenHandler: n };
539
- }, ul = {
541
+ }, dl = {
540
542
  tableShape: {
541
543
  type: Array,
542
544
  default: () => [6, 4]
@@ -546,9 +548,9 @@ const C = new tl(), ll = (e, t = {
546
548
  default: () => {
547
549
  }
548
550
  }
549
- }, ml = /* @__PURE__ */ M({
551
+ }, ul = /* @__PURE__ */ M({
550
552
  name: "TableShape",
551
- props: ul,
553
+ props: dl,
552
554
  setup(e) {
553
555
  const t = N({
554
556
  x: -1,
@@ -576,7 +578,7 @@ const C = new tl(), ll = (e, t = {
576
578
  }, null)]))]))]);
577
579
  }
578
580
  });
579
- const fl = {
581
+ const ml = {
580
582
  title: {
581
583
  type: String,
582
584
  default: ""
@@ -614,8 +616,8 @@ const fl = {
614
616
  class: {
615
617
  type: String
616
618
  }
617
- }, Te = /* @__PURE__ */ M({
618
- props: fl,
619
+ }, we = /* @__PURE__ */ M({
620
+ props: ml,
619
621
  setup(e, t) {
620
622
  const o = F(e.visible), l = F([`${s}-modal`]), r = F(), n = F();
621
623
  let a = () => {
@@ -637,13 +639,13 @@ const fl = {
637
639
  height: e.height
638
640
  });
639
641
  return A(() => {
640
- a = ot(n.value, (u, d) => {
642
+ a = lt(n.value, (u, d) => {
641
643
  c.initPos.left = u + "px", c.initPos.top = d + "px";
642
644
  });
643
- }), ye(() => {
645
+ }), ke(() => {
644
646
  a();
645
647
  }), T(() => e.isFullscreen, (u) => {
646
- u ? a() : a = ot(n.value, (d, f) => {
648
+ u ? a() : a = lt(n.value, (d, f) => {
647
649
  c.initPos.left = d + "px", c.initPos.top = f + "px";
648
650
  });
649
651
  }), T(() => e.visible, (u) => {
@@ -710,7 +712,7 @@ const fl = {
710
712
  }, null)])])])])]);
711
713
  };
712
714
  }
713
- }), gl = {
715
+ }), fl = {
714
716
  type: {
715
717
  type: String,
716
718
  default: "link"
@@ -729,8 +731,8 @@ const fl = {
729
731
  default: () => {
730
732
  }
731
733
  }
732
- }, hl = /* @__PURE__ */ M({
733
- props: gl,
734
+ }, gl = /* @__PURE__ */ M({
735
+ props: fl,
734
736
  setup(e) {
735
737
  const t = x("usedLanguageText"), o = x("editorId"), l = D(() => {
736
738
  var n, a;
@@ -750,7 +752,7 @@ const fl = {
750
752
  n || setTimeout(() => {
751
753
  r.desc = "", r.url = "";
752
754
  }, 200);
753
- }), () => i(Te, {
755
+ }), () => i(we, {
754
756
  title: l.value,
755
757
  visible: e.visible,
756
758
  onClose: e.onCancel
@@ -800,7 +802,7 @@ const fl = {
800
802
  });
801
803
  }
802
804
  });
803
- const vl = {
805
+ const hl = {
804
806
  visible: {
805
807
  type: Boolean,
806
808
  default: !1
@@ -815,8 +817,8 @@ const vl = {
815
817
  default: () => {
816
818
  }
817
819
  }
818
- }, pl = /* @__PURE__ */ M({
819
- props: vl,
820
+ }, vl = /* @__PURE__ */ M({
821
+ props: hl,
820
822
  setup(e) {
821
823
  var d, f;
822
824
  const t = x("usedLanguageText"), o = x("editorId");
@@ -868,7 +870,7 @@ const vl = {
868
870
  };
869
871
  return () => {
870
872
  var h;
871
- return i(Te, {
873
+ return i(we, {
872
874
  class: `${s}-modal-clip`,
873
875
  title: (h = t.value.clipModalTips) == null ? void 0 : h.title,
874
876
  visible: e.visible,
@@ -927,7 +929,7 @@ const vl = {
927
929
  onClick: () => {
928
930
  if (m) {
929
931
  const k = m.getCroppedCanvas();
930
- C.emit(o, "uploadImage", [ol(k.toDataURL("image/png"))], e.onOk), u();
932
+ C.emit(o, "uploadImage", [ll(k.toDataURL("image/png"))], e.onOk), u();
931
933
  }
932
934
  }
933
935
  }, [((v = t.value.clipModalTips) == null ? void 0 : v.buttonUpload) || ((b = t.value.linkModalTips) == null ? void 0 : b.buttonOK)])]), i("input", {
@@ -943,7 +945,7 @@ const vl = {
943
945
  });
944
946
  };
945
947
  }
946
- }), bl = {
948
+ }), pl = {
947
949
  type: {
948
950
  type: String,
949
951
  default: "link"
@@ -966,27 +968,27 @@ const vl = {
966
968
  default: () => {
967
969
  }
968
970
  }
969
- }, kl = /* @__PURE__ */ M({
970
- props: bl,
971
+ }, bl = /* @__PURE__ */ M({
972
+ props: pl,
971
973
  setup(e) {
972
- return () => i(Ce, null, [i(hl, {
974
+ return () => i(ye, null, [i(gl, {
973
975
  type: e.type,
974
976
  visible: e.linkVisible,
975
977
  onOk: e.onOk,
976
978
  onCancel: e.onCancel
977
- }, null), i(pl, {
979
+ }, null), i(vl, {
978
980
  visible: e.clipVisible,
979
981
  onOk: e.onOk,
980
982
  onCancel: e.onCancel
981
983
  }, null)]);
982
984
  }
983
- }), yl = /* @__PURE__ */ M({
985
+ }), kl = /* @__PURE__ */ M({
984
986
  name: "MDEditorToolbar",
985
- props: sl,
987
+ props: al,
986
988
  setup(e) {
987
989
  const t = x("editorId"), o = x("usedLanguageText"), {
988
990
  fullscreenHandler: l
989
- } = dl(e), r = `${t}-toolbar-wrapper`, n = N({
991
+ } = cl(e), r = `${t}-toolbar-wrapper`, n = N({
990
992
  title: !1,
991
993
  catalog: !1,
992
994
  // 图片上传下拉
@@ -1021,11 +1023,11 @@ const vl = {
1021
1023
  d.value.addEventListener("change", f);
1022
1024
  });
1023
1025
  const h = (v) => {
1024
- var b, k, p, y, $, w, L, S, j, B, q, te, Z, K, P, X, R, V, le, ie, Se, xe, Ee, Le, He, Ie, Ae, Fe, Me, Re, je, Be, Pe, Oe, De, Ne, _e, Ve, Ue, qe, We, Ge, ze;
1025
- if (yt.includes(v))
1026
+ var b, k, p, y, $, w, L, S, j, B, q, ee, X, R, Z, K, P, V, te, ne, Te, Se, xe, Ee, Le, He, Ie, Ae, Fe, Me, Re, je, Be, Pe, Oe, De, Ne, _e, Ve, Ue, qe, We, Ge;
1027
+ if (kt.includes(v))
1026
1028
  switch (v) {
1027
1029
  case "-":
1028
- return i(Qt, null, null);
1030
+ return i(Yt, null, null);
1029
1031
  case "bold":
1030
1032
  return i("div", {
1031
1033
  class: `${s}-toolbar-item`,
@@ -1151,7 +1153,7 @@ const vl = {
1151
1153
  case "sup":
1152
1154
  return i("div", {
1153
1155
  class: `${s}-toolbar-item`,
1154
- title: (te = o.value.toolbarTips) == null ? void 0 : te.sup,
1156
+ title: (ee = o.value.toolbarTips) == null ? void 0 : ee.sup,
1155
1157
  onClick: () => {
1156
1158
  a("sup");
1157
1159
  }
@@ -1164,7 +1166,7 @@ const vl = {
1164
1166
  case "quote":
1165
1167
  return i("div", {
1166
1168
  class: `${s}-toolbar-item`,
1167
- title: (Z = o.value.toolbarTips) == null ? void 0 : Z.quote,
1169
+ title: (X = o.value.toolbarTips) == null ? void 0 : X.quote,
1168
1170
  onClick: () => {
1169
1171
  a("quote");
1170
1172
  }
@@ -1177,7 +1179,7 @@ const vl = {
1177
1179
  case "unorderedList":
1178
1180
  return i("div", {
1179
1181
  class: `${s}-toolbar-item`,
1180
- title: (K = o.value.toolbarTips) == null ? void 0 : K.unorderedList,
1182
+ title: (R = o.value.toolbarTips) == null ? void 0 : R.unorderedList,
1181
1183
  onClick: () => {
1182
1184
  a("unorderedList");
1183
1185
  }
@@ -1190,7 +1192,7 @@ const vl = {
1190
1192
  case "orderedList":
1191
1193
  return i("div", {
1192
1194
  class: `${s}-toolbar-item`,
1193
- title: (P = o.value.toolbarTips) == null ? void 0 : P.orderedList,
1195
+ title: (Z = o.value.toolbarTips) == null ? void 0 : Z.orderedList,
1194
1196
  onClick: () => {
1195
1197
  a("orderedList");
1196
1198
  }
@@ -1203,7 +1205,7 @@ const vl = {
1203
1205
  case "task":
1204
1206
  return i("div", {
1205
1207
  class: `${s}-toolbar-item`,
1206
- title: (X = o.value.toolbarTips) == null ? void 0 : X.task,
1208
+ title: (K = o.value.toolbarTips) == null ? void 0 : K.task,
1207
1209
  onClick: () => {
1208
1210
  a("task");
1209
1211
  }
@@ -1216,7 +1218,7 @@ const vl = {
1216
1218
  case "codeRow":
1217
1219
  return i("div", {
1218
1220
  class: `${s}-toolbar-item`,
1219
- title: (R = o.value.toolbarTips) == null ? void 0 : R.codeRow,
1221
+ title: (P = o.value.toolbarTips) == null ? void 0 : P.codeRow,
1220
1222
  onClick: () => {
1221
1223
  a("codeRow");
1222
1224
  }
@@ -1242,7 +1244,7 @@ const vl = {
1242
1244
  case "link":
1243
1245
  return i("div", {
1244
1246
  class: `${s}-toolbar-item`,
1245
- title: (le = o.value.toolbarTips) == null ? void 0 : le.link,
1247
+ title: (te = o.value.toolbarTips) == null ? void 0 : te.link,
1246
1248
  onClick: () => {
1247
1249
  c.type = "link", c.linkVisible = !0;
1248
1250
  }
@@ -1255,7 +1257,7 @@ const vl = {
1255
1257
  case "image":
1256
1258
  return e.noUploadImg ? i("div", {
1257
1259
  class: `${s}-toolbar-item`,
1258
- title: (ie = o.value.toolbarTips) == null ? void 0 : ie.image,
1260
+ title: (ne = o.value.toolbarTips) == null ? void 0 : ne.image,
1259
1261
  onClick: () => {
1260
1262
  c.type = "image", c.linkVisible = !0;
1261
1263
  }
@@ -1280,17 +1282,17 @@ const vl = {
1280
1282
  onClick: () => {
1281
1283
  c.type = "image", c.linkVisible = !0;
1282
1284
  }
1283
- }, [(Se = o.value.imgTitleItem) == null ? void 0 : Se.link]), i("li", {
1285
+ }, [(Te = o.value.imgTitleItem) == null ? void 0 : Te.link]), i("li", {
1284
1286
  class: `${s}-menu-item`,
1285
1287
  onClick: () => {
1286
1288
  d.value.click();
1287
1289
  }
1288
- }, [(xe = o.value.imgTitleItem) == null ? void 0 : xe.upload]), i("li", {
1290
+ }, [(Se = o.value.imgTitleItem) == null ? void 0 : Se.upload]), i("li", {
1289
1291
  class: `${s}-menu-item`,
1290
1292
  onClick: () => {
1291
1293
  c.clipVisible = !0;
1292
1294
  }
1293
- }, [(Ee = o.value.imgTitleItem) == null ? void 0 : Ee.clip2upload])])
1295
+ }, [(xe = o.value.imgTitleItem) == null ? void 0 : xe.clip2upload])])
1294
1296
  }, {
1295
1297
  default: () => {
1296
1298
  var E;
@@ -1313,7 +1315,7 @@ const vl = {
1313
1315
  n.table = E;
1314
1316
  },
1315
1317
  key: "bar-table",
1316
- overlay: i(ml, {
1318
+ overlay: i(ul, {
1317
1319
  tableShape: e.tableShape,
1318
1320
  onSelected: (E) => {
1319
1321
  a("table", {
@@ -1338,7 +1340,7 @@ const vl = {
1338
1340
  case "revoke":
1339
1341
  return i("div", {
1340
1342
  class: `${s}-toolbar-item`,
1341
- title: (Le = o.value.toolbarTips) == null ? void 0 : Le.revoke,
1343
+ title: (Ee = o.value.toolbarTips) == null ? void 0 : Ee.revoke,
1342
1344
  onClick: () => {
1343
1345
  C.emit(t, "ctrlZ");
1344
1346
  }
@@ -1351,7 +1353,7 @@ const vl = {
1351
1353
  case "next":
1352
1354
  return i("div", {
1353
1355
  class: `${s}-toolbar-item`,
1354
- title: (He = o.value.toolbarTips) == null ? void 0 : He.next,
1356
+ title: (Le = o.value.toolbarTips) == null ? void 0 : Le.next,
1355
1357
  onClick: () => {
1356
1358
  C.emit(t, "ctrlShiftZ");
1357
1359
  }
@@ -1364,9 +1366,9 @@ const vl = {
1364
1366
  case "save":
1365
1367
  return i("div", {
1366
1368
  class: `${s}-toolbar-item`,
1367
- title: (Ie = o.value.toolbarTips) == null ? void 0 : Ie.save,
1369
+ title: (He = o.value.toolbarTips) == null ? void 0 : He.save,
1368
1370
  onClick: () => {
1369
- C.emit(t, me);
1371
+ C.emit(t, ue);
1370
1372
  }
1371
1373
  }, [i("svg", {
1372
1374
  class: `${s}-icon`,
@@ -1377,7 +1379,7 @@ const vl = {
1377
1379
  case "prettier":
1378
1380
  return e.noPrettier ? "" : i("div", {
1379
1381
  class: `${s}-toolbar-item`,
1380
- title: (Ae = o.value.toolbarTips) == null ? void 0 : Ae.prettier,
1382
+ title: (Ie = o.value.toolbarTips) == null ? void 0 : Ie.prettier,
1381
1383
  onClick: () => {
1382
1384
  a("prettier");
1383
1385
  }
@@ -1390,7 +1392,7 @@ const vl = {
1390
1392
  case "pageFullscreen":
1391
1393
  return !e.setting.fullscreen && i("div", {
1392
1394
  class: `${s}-toolbar-item`,
1393
- title: (Fe = o.value.toolbarTips) == null ? void 0 : Fe.pageFullscreen,
1395
+ title: (Ae = o.value.toolbarTips) == null ? void 0 : Ae.pageFullscreen,
1394
1396
  onClick: () => {
1395
1397
  e.updateSetting("pageFullscreen");
1396
1398
  }
@@ -1403,7 +1405,7 @@ const vl = {
1403
1405
  case "fullscreen":
1404
1406
  return i("div", {
1405
1407
  class: `${s}-toolbar-item`,
1406
- title: (Me = o.value.toolbarTips) == null ? void 0 : Me.fullscreen,
1408
+ title: (Fe = o.value.toolbarTips) == null ? void 0 : Fe.fullscreen,
1407
1409
  onClick: () => {
1408
1410
  l();
1409
1411
  }
@@ -1416,7 +1418,7 @@ const vl = {
1416
1418
  case "preview":
1417
1419
  return i("div", {
1418
1420
  class: `${s}-toolbar-item`,
1419
- title: (Re = o.value.toolbarTips) == null ? void 0 : Re.preview,
1421
+ title: (Me = o.value.toolbarTips) == null ? void 0 : Me.preview,
1420
1422
  onClick: () => {
1421
1423
  e.updateSetting("preview");
1422
1424
  }
@@ -1429,7 +1431,7 @@ const vl = {
1429
1431
  case "htmlPreview":
1430
1432
  return i("div", {
1431
1433
  class: `${s}-toolbar-item`,
1432
- title: (je = o.value.toolbarTips) == null ? void 0 : je.htmlPreview,
1434
+ title: (Re = o.value.toolbarTips) == null ? void 0 : Re.htmlPreview,
1433
1435
  onClick: () => {
1434
1436
  e.updateSetting("htmlPreview");
1435
1437
  }
@@ -1442,9 +1444,9 @@ const vl = {
1442
1444
  case "catalog":
1443
1445
  return i("div", {
1444
1446
  class: `${s}-toolbar-item`,
1445
- title: (Be = o.value.toolbarTips) == null ? void 0 : Be.catalog,
1447
+ title: (je = o.value.toolbarTips) == null ? void 0 : je.catalog,
1446
1448
  onClick: () => {
1447
- C.emit(t, we);
1449
+ C.emit(t, $e);
1448
1450
  },
1449
1451
  key: "bar-catalog"
1450
1452
  }, [i("svg", {
@@ -1456,8 +1458,8 @@ const vl = {
1456
1458
  case "github":
1457
1459
  return i("div", {
1458
1460
  class: `${s}-toolbar-item`,
1459
- title: (Pe = o.value.toolbarTips) == null ? void 0 : Pe.github,
1460
- onClick: () => ll("https://github.com/imzbf/md-editor-v3")
1461
+ title: (Be = o.value.toolbarTips) == null ? void 0 : Be.github,
1462
+ onClick: () => tl("https://github.com/imzbf/md-editor-v3")
1461
1463
  }, [i("svg", {
1462
1464
  class: `${s}-icon`,
1463
1465
  "aria-hidden": "true"
@@ -1481,42 +1483,42 @@ const vl = {
1481
1483
  onClick: () => {
1482
1484
  a("flow");
1483
1485
  }
1484
- }, [(Oe = o.value.mermaid) == null ? void 0 : Oe.flow]), i("li", {
1486
+ }, [(Pe = o.value.mermaid) == null ? void 0 : Pe.flow]), i("li", {
1485
1487
  class: `${s}-menu-item`,
1486
1488
  onClick: () => {
1487
1489
  a("sequence");
1488
1490
  }
1489
- }, [(De = o.value.mermaid) == null ? void 0 : De.sequence]), i("li", {
1491
+ }, [(Oe = o.value.mermaid) == null ? void 0 : Oe.sequence]), i("li", {
1490
1492
  class: `${s}-menu-item`,
1491
1493
  onClick: () => {
1492
1494
  a("gantt");
1493
1495
  }
1494
- }, [(Ne = o.value.mermaid) == null ? void 0 : Ne.gantt]), i("li", {
1496
+ }, [(De = o.value.mermaid) == null ? void 0 : De.gantt]), i("li", {
1495
1497
  class: `${s}-menu-item`,
1496
1498
  onClick: () => {
1497
1499
  a("class");
1498
1500
  }
1499
- }, [(_e = o.value.mermaid) == null ? void 0 : _e.class]), i("li", {
1501
+ }, [(Ne = o.value.mermaid) == null ? void 0 : Ne.class]), i("li", {
1500
1502
  class: `${s}-menu-item`,
1501
1503
  onClick: () => {
1502
1504
  a("state");
1503
1505
  }
1504
- }, [(Ve = o.value.mermaid) == null ? void 0 : Ve.state]), i("li", {
1506
+ }, [(_e = o.value.mermaid) == null ? void 0 : _e.state]), i("li", {
1505
1507
  class: `${s}-menu-item`,
1506
1508
  onClick: () => {
1507
1509
  a("pie");
1508
1510
  }
1509
- }, [(Ue = o.value.mermaid) == null ? void 0 : Ue.pie]), i("li", {
1511
+ }, [(Ve = o.value.mermaid) == null ? void 0 : Ve.pie]), i("li", {
1510
1512
  class: `${s}-menu-item`,
1511
1513
  onClick: () => {
1512
1514
  a("relationship");
1513
1515
  }
1514
- }, [(qe = o.value.mermaid) == null ? void 0 : qe.relationship]), i("li", {
1516
+ }, [(Ue = o.value.mermaid) == null ? void 0 : Ue.relationship]), i("li", {
1515
1517
  class: `${s}-menu-item`,
1516
1518
  onClick: () => {
1517
1519
  a("journey");
1518
1520
  }
1519
- }, [(We = o.value.mermaid) == null ? void 0 : We.journey])]),
1521
+ }, [(qe = o.value.mermaid) == null ? void 0 : qe.journey])]),
1520
1522
  key: "bar-mermaid"
1521
1523
  }, {
1522
1524
  default: () => {
@@ -1549,12 +1551,12 @@ const vl = {
1549
1551
  onClick: () => {
1550
1552
  a("katexInline");
1551
1553
  }
1552
- }, [(Ge = o.value.katex) == null ? void 0 : Ge.inline]), i("li", {
1554
+ }, [(We = o.value.katex) == null ? void 0 : We.inline]), i("li", {
1553
1555
  class: `${s}-menu-item`,
1554
1556
  onClick: () => {
1555
1557
  a("katexBlock");
1556
1558
  }
1557
- }, [(ze = o.value.katex) == null ? void 0 : ze.block])]),
1559
+ }, [(Ge = o.value.katex) == null ? void 0 : Ge.block])]),
1558
1560
  key: "bar-katex"
1559
1561
  }, {
1560
1562
  default: () => {
@@ -1576,7 +1578,7 @@ const vl = {
1576
1578
  };
1577
1579
  return () => {
1578
1580
  const v = u.value[0].map((k) => h(k)), b = u.value[1].map((k) => h(k));
1579
- return i(Ce, null, [e.toolbars.length > 0 && i("div", {
1581
+ return i(ye, null, [e.toolbars.length > 0 && i("div", {
1580
1582
  class: `${s}-toolbar-wrapper`,
1581
1583
  id: r
1582
1584
  }, [i("div", {
@@ -1594,7 +1596,7 @@ const vl = {
1594
1596
  style: {
1595
1597
  display: "none"
1596
1598
  }
1597
- }, null), i(kl, {
1599
+ }, null), i(bl, {
1598
1600
  linkVisible: c.linkVisible,
1599
1601
  clipVisible: c.clipVisible,
1600
1602
  type: c.type,
@@ -1610,48 +1612,46 @@ const vl = {
1610
1612
  }, null)]);
1611
1613
  };
1612
1614
  }
1613
- }), oe = (e, t, o) => {
1614
- let l = e.scrollTop;
1615
- const r = () => {
1616
- const n = t - l;
1617
- l = l + n / 5, Math.abs(n) < 1 ? (e.scrollTo(0, t), o && o()) : (e.scrollTo(0, l), requestAnimationFrame(r));
1618
- };
1619
- r();
1620
- }, se = (e) => {
1615
+ }), ie = (e) => {
1621
1616
  const { marginTop: t } = getComputedStyle(e);
1622
1617
  return e.offsetTop - parseFloat(t);
1623
- }, Cl = (e, t) => {
1624
- const o = ee(() => {
1625
- e.removeEventListener("scroll", l), e.addEventListener("scroll", l), t.removeEventListener("scroll", l), t.addEventListener("scroll", l);
1626
- }, 50), l = (r) => {
1618
+ }, yl = (e, t) => {
1619
+ let o = !1;
1620
+ const l = (r) => {
1627
1621
  const n = e.clientHeight, a = t.clientHeight, c = e.scrollHeight, m = t.scrollHeight, u = (c - n) / (m - a);
1628
- r.target === e ? (t.removeEventListener("scroll", l), t.scrollTo({
1629
- top: e.scrollTop / u
1630
- // behavior: 'smooth'
1631
- }), o()) : (e.removeEventListener("scroll", l), e.scrollTo({
1632
- top: t.scrollTop * u
1633
- // behavior: 'smooth'
1634
- }), o());
1622
+ if (r.target === e)
1623
+ o = !0, t.scrollTo({
1624
+ top: e.scrollTop / u
1625
+ // behavior: 'smooth'
1626
+ });
1627
+ else {
1628
+ if (o) {
1629
+ o = !1;
1630
+ return;
1631
+ }
1632
+ o = !0, e.scrollTo({
1633
+ top: t.scrollTop * u
1634
+ // behavior: 'smooth'
1635
+ });
1636
+ }
1635
1637
  };
1636
1638
  return [
1637
1639
  () => {
1638
- o().finally(() => {
1639
- e.dispatchEvent(new Event("scroll"));
1640
- });
1640
+ e.addEventListener("scroll", l, {
1641
+ passive: !0
1642
+ }), t.addEventListener("scroll", l, {
1643
+ passive: !0
1644
+ }), e.dispatchEvent(new Event("scroll"));
1641
1645
  },
1642
1646
  () => {
1643
1647
  e.removeEventListener("scroll", l), t.removeEventListener("scroll", l);
1644
1648
  }
1645
1649
  ];
1646
- }, $l = (e, t, o, l) => {
1650
+ }, Cl = (e, t, o, l) => {
1647
1651
  const { view: r } = o;
1648
- let n = 0;
1649
- const a = ee(() => {
1650
- e.removeEventListener("scroll", u), e.addEventListener("scroll", u), t.removeEventListener("scroll", u), t.addEventListener("scroll", u);
1651
- }, 50);
1652
- let c = [];
1653
- const m = () => {
1654
- c = [];
1652
+ let n = [];
1653
+ const a = () => {
1654
+ n = [];
1655
1655
  const { width: d, lineHeight: f, fontFamily: h, fontSize: v, whiteSpace: b } = getComputedStyle(
1656
1656
  document.querySelector(".cm-content")
1657
1657
  ), k = document.createElement("div");
@@ -1664,49 +1664,56 @@ const vl = {
1664
1664
  lineHeight: k.offsetHeight,
1665
1665
  scrollHeight: p
1666
1666
  };
1667
- c.push($);
1667
+ n.push($);
1668
1668
  }), k.remove();
1669
- }, u = ee((d) => {
1669
+ };
1670
+ let c = !1, m = !1;
1671
+ const u = de((d) => {
1670
1672
  var b, k;
1671
- n++;
1672
1673
  const f = r.lineBlockAtHeight(r.scrollDOM.scrollTop), h = r.state.doc.lineAt(f.from), v = Array.from(t.children[0].children).filter(
1673
1674
  (p) => p.hasAttribute("data-line")
1674
1675
  );
1675
1676
  if (d.target === e) {
1676
- if (t.removeEventListener("scroll", u), e.scrollTop + e.clientHeight >= e.scrollHeight) {
1677
- oe(t, t.scrollHeight - t.clientHeight, () => {
1678
- --n === 0 && a();
1677
+ if (m) {
1678
+ m = !1;
1679
+ return;
1680
+ }
1681
+ if (e.scrollTop + e.clientHeight >= e.scrollHeight) {
1682
+ c = !0, t.scrollTo({
1683
+ top: t.scrollHeight - t.clientHeight
1679
1684
  });
1680
1685
  return;
1681
1686
  }
1682
1687
  const { number: p } = h;
1683
1688
  let y = (b = t.firstElementChild) == null ? void 0 : b.firstElementChild, $ = 1, w = v.length === 0 ? (k = t.firstElementChild) == null ? void 0 : k.lastElementChild : v[0], L = v.length === 0 ? 0 : Number(v[0].dataset.line);
1684
- for (let P = 0; P < v.length; P++) {
1685
- const X = Number(v[P].dataset.line) + 1, R = Number(
1686
- P + 1 >= v.length ? -2 : v[P + 1].dataset.line
1689
+ for (let R = 0; R < v.length; R++) {
1690
+ const Z = Number(v[R].dataset.line) + 1, K = Number(
1691
+ R + 1 >= v.length ? -2 : v[R + 1].dataset.line
1687
1692
  );
1688
- if (p >= X && p <= R) {
1689
- y = v[P], w = v[P + 1], $ = X, L = R;
1693
+ if (p >= Z && p <= K) {
1694
+ y = v[R], w = v[R + 1], $ = Z, L = K;
1690
1695
  break;
1691
1696
  }
1692
1697
  }
1693
- if (!y) {
1694
- n--;
1698
+ if (!y)
1695
1699
  return;
1696
- }
1697
- const S = (r.scrollDOM.scrollTop - c[$ - 1].scrollHeight + c[$ - 1].lineHeight) / (c[L - 1].scrollHeight - c[$ - 1].scrollHeight + c[$ - 1].lineHeight), { marginTop: j } = getComputedStyle(y), B = y.offsetTop - parseFloat(j), { marginTop: q } = getComputedStyle(w), Z = w.offsetTop - parseFloat(q) - B, K = B + Z * S;
1698
- oe(t, K, () => {
1699
- --n === 0 && a();
1700
+ const S = (r.scrollDOM.scrollTop - n[$ - 1].scrollHeight + n[$ - 1].lineHeight) / (n[L - 1].scrollHeight - n[$ - 1].scrollHeight + n[$ - 1].lineHeight), { marginTop: j } = getComputedStyle(y), B = y.offsetTop - parseFloat(j), { marginTop: q } = getComputedStyle(w), X = w.offsetTop - parseFloat(q) - B;
1701
+ c = !0, t.scrollTo({
1702
+ top: B + X * S
1700
1703
  });
1701
1704
  } else {
1702
- if (e.removeEventListener("scroll", u), t.scrollTop === 0) {
1703
- oe(e, 0, () => {
1704
- --n === 0 && a();
1705
+ if (c) {
1706
+ c = !1;
1707
+ return;
1708
+ }
1709
+ if (t.scrollTop === 0) {
1710
+ m = !0, e.scrollTo({
1711
+ top: 0
1705
1712
  });
1706
1713
  return;
1707
1714
  } else if (t.scrollTop + t.clientHeight >= t.scrollHeight) {
1708
- oe(e, e.scrollHeight - e.clientHeight, () => {
1709
- --n === 0 && a();
1715
+ m = !0, e.scrollTo({
1716
+ top: e.scrollHeight - e.clientHeight
1710
1717
  });
1711
1718
  return;
1712
1719
  }
@@ -1714,52 +1721,52 @@ const vl = {
1714
1721
  let $ = Math.floor(
1715
1722
  Number(v[v.length - 1].dataset.line) * (p / y)
1716
1723
  ), w;
1717
- for (let R = $; R >= 0; R--) {
1718
- const V = t.querySelector(`[data-line="${R}"]`);
1724
+ for (let P = $; P >= 0; P--) {
1725
+ const V = t.querySelector(`[data-line="${P}"]`);
1719
1726
  if (V) {
1720
- w = V, $ = R;
1727
+ w = V, $ = P;
1721
1728
  break;
1722
1729
  }
1723
1730
  }
1724
- if (!w) {
1725
- n--;
1731
+ if (!w)
1726
1732
  return;
1727
- }
1728
1733
  let L, S;
1729
1734
  for (; ; ) {
1730
- const R = v.indexOf(w), V = v[R + 1], le = se(w);
1731
- if (le > p) {
1732
- if (R === 0) {
1735
+ const P = v.indexOf(w), V = v[P + 1], te = ie(w);
1736
+ if (te > p) {
1737
+ if (P === 0) {
1733
1738
  L = w, S = V;
1734
1739
  break;
1735
1740
  }
1736
- w = v[R - 1];
1741
+ w = v[P - 1];
1737
1742
  continue;
1738
1743
  }
1739
- const ie = se(V);
1740
- if (le <= p && ie > p) {
1744
+ const ne = ie(V);
1745
+ if (te <= p && ne > p) {
1741
1746
  L = w, S = V;
1742
1747
  break;
1743
1748
  }
1744
1749
  w = V;
1745
1750
  }
1746
- const j = se(L), B = se(S), q = (p - j) / (B - j), te = Number(L.dataset.line), Z = Number(S.dataset.line), K = c[te].scrollHeight, X = c[Z].scrollHeight - K;
1747
- oe(e, K + X * q, () => {
1748
- --n === 0 && a();
1751
+ const j = ie(L), B = ie(S), q = (p - j) / (B - j), ee = Number(L.dataset.line), X = Number(S.dataset.line), R = n[ee].scrollHeight, K = n[X].scrollHeight - R;
1752
+ m = !0, e.scrollTo({
1753
+ top: R + K * q
1749
1754
  });
1750
1755
  }
1751
1756
  }, 6);
1752
1757
  return [
1753
1758
  () => {
1754
- m(), a().finally(() => {
1755
- e.dispatchEvent(new Event("scroll"));
1756
- });
1759
+ a(), e.addEventListener("scroll", u, {
1760
+ passive: !0
1761
+ }), t.addEventListener("scroll", u, {
1762
+ passive: !0
1763
+ }), e.dispatchEvent(new Event("scroll"));
1757
1764
  },
1758
1765
  () => {
1759
- n = 0, e.removeEventListener("scroll", u), t.removeEventListener("scroll", u);
1766
+ e.removeEventListener("scroll", u), t.removeEventListener("scroll", u);
1760
1767
  }
1761
1768
  ];
1762
- }, wl = (e, t, o, l, r) => {
1769
+ }, $l = (e, t, o, l, r) => {
1763
1770
  const n = x("previewOnly");
1764
1771
  let a = () => {
1765
1772
  }, c = () => {
@@ -1767,7 +1774,7 @@ const vl = {
1767
1774
  const m = () => {
1768
1775
  a();
1769
1776
  const u = document.querySelector(".cm-scroller");
1770
- !n && (o.value || l.value) && ([c, a] = (o.value ? $l : Cl)(
1777
+ !n && (o.value || l.value) && ([c, a] = (o.value ? Cl : yl)(
1771
1778
  u,
1772
1779
  o.value || l.value,
1773
1780
  r.value,
@@ -1791,7 +1798,7 @@ const vl = {
1791
1798
  u ? c() : a();
1792
1799
  }
1793
1800
  ), A(m);
1794
- }, Tl = (e, t, o) => {
1801
+ }, wl = (e, t, o) => {
1795
1802
  var d, f, h, v, b, k;
1796
1803
  let l = "", r = 0, n = 0, a = !0, c = !1;
1797
1804
  const m = t.getSelectedText(), u = (d = I.editorConfig) == null ? void 0 : d.mermaidTemplate;
@@ -2003,18 +2010,18 @@ $$
2003
2010
  replaceAll: c
2004
2011
  }
2005
2012
  };
2006
- }, Sl = "#e5c07b", nt = "var(--md-color)", xl = "#56b6c2", El = "#ffffff", ne = "var(--md-color)", rt = "#e5c07b", Ll = "#e5c07b", Hl = "var(--md-color)", it = "#d19a66", Il = "#c678dd", Al = "#21252b", at = "#2c313a", st = "#000", ge = "#353a42", Fl = "#ceedfa33", ct = "#528bff", Ml = $e.theme(
2013
+ }, Tl = "#e5c07b", ot = "var(--md-color)", Sl = "#56b6c2", xl = "#ffffff", le = "var(--md-color)", nt = "#e5c07b", El = "#e5c07b", Ll = "var(--md-color)", rt = "#d19a66", Hl = "#c678dd", Il = "#21252b", it = "#2c313a", at = "#000", fe = "#353a42", Al = "#ceedfa33", st = "#528bff", Fl = Ce.theme(
2007
2014
  {
2008
2015
  "&": {
2009
- color: ne,
2010
- backgroundColor: st
2016
+ color: le,
2017
+ backgroundColor: at
2011
2018
  },
2012
2019
  ".cm-content": {
2013
- caretColor: ct
2020
+ caretColor: st
2014
2021
  },
2015
- ".cm-cursor, .cm-dropCursor": { borderLeftColor: ct },
2016
- "&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Fl },
2017
- ".cm-panels": { backgroundColor: Al, color: ne },
2022
+ ".cm-cursor, .cm-dropCursor": { borderLeftColor: st },
2023
+ "&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Al },
2024
+ ".cm-panels": { backgroundColor: Il, color: le },
2018
2025
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
2019
2026
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
2020
2027
  ".cm-searchMatch": {
@@ -2030,13 +2037,13 @@ $$
2030
2037
  backgroundColor: "#bad0f847"
2031
2038
  },
2032
2039
  ".cm-gutters": {
2033
- backgroundColor: st,
2034
- color: ne,
2040
+ backgroundColor: at,
2041
+ color: le,
2035
2042
  borderRight: "1px solid",
2036
2043
  borderColor: "var(--md-border-color)"
2037
2044
  },
2038
2045
  ".cm-activeLineGutter": {
2039
- backgroundColor: at
2046
+ backgroundColor: it
2040
2047
  },
2041
2048
  ".cm-foldPlaceholder": {
2042
2049
  backgroundColor: "transparent",
@@ -2045,30 +2052,30 @@ $$
2045
2052
  },
2046
2053
  ".cm-tooltip": {
2047
2054
  border: "none",
2048
- backgroundColor: ge
2055
+ backgroundColor: fe
2049
2056
  },
2050
2057
  ".cm-tooltip .cm-tooltip-arrow:before": {
2051
2058
  borderTopColor: "transparent",
2052
2059
  borderBottomColor: "transparent"
2053
2060
  },
2054
2061
  ".cm-tooltip .cm-tooltip-arrow:after": {
2055
- borderTopColor: ge,
2056
- borderBottomColor: ge
2062
+ borderTopColor: fe,
2063
+ borderBottomColor: fe
2057
2064
  },
2058
2065
  ".cm-tooltip-autocomplete": {
2059
2066
  "& > ul > li[aria-selected]": {
2060
- backgroundColor: at,
2061
- color: ne
2067
+ backgroundColor: it,
2068
+ color: le
2062
2069
  }
2063
2070
  }
2064
2071
  },
2065
2072
  { dark: !0 }
2066
- ), Rl = bt.define([
2067
- { tag: g.keyword, color: Il },
2068
- { tag: [g.name, g.deleted, g.character, g.propertyName, g.macroName], color: nt },
2069
- { tag: [g.function(g.variableName), g.labelName], color: Ll },
2070
- { tag: [g.color, g.constant(g.name), g.standard(g.name)], color: it },
2071
- { tag: [g.definition(g.name), g.separator], color: ne },
2073
+ ), Ml = pt.define([
2074
+ { tag: g.keyword, color: Hl },
2075
+ { tag: [g.name, g.deleted, g.character, g.propertyName, g.macroName], color: ot },
2076
+ { tag: [g.function(g.variableName), g.labelName], color: El },
2077
+ { tag: [g.color, g.constant(g.name), g.standard(g.name)], color: rt },
2078
+ { tag: [g.definition(g.name), g.separator], color: le },
2072
2079
  {
2073
2080
  tag: [
2074
2081
  g.typeName,
@@ -2080,7 +2087,7 @@ $$
2080
2087
  g.self,
2081
2088
  g.namespace
2082
2089
  ],
2083
- color: Sl
2090
+ color: Tl
2084
2091
  },
2085
2092
  {
2086
2093
  tag: [
@@ -2092,32 +2099,32 @@ $$
2092
2099
  g.link,
2093
2100
  g.special(g.string)
2094
2101
  ],
2095
- color: xl
2102
+ color: Sl
2096
2103
  },
2097
- { tag: [g.meta, g.comment], color: rt },
2104
+ { tag: [g.meta, g.comment], color: nt },
2098
2105
  { tag: g.strong, fontWeight: "bold" },
2099
2106
  { tag: g.emphasis, fontStyle: "italic" },
2100
2107
  { tag: g.strikethrough, textDecoration: "line-through" },
2101
- { tag: g.link, color: rt, textDecoration: "underline" },
2102
- { tag: g.heading, fontWeight: "bold", color: nt },
2103
- { tag: [g.atom, g.bool, g.special(g.variableName)], color: it },
2104
- { tag: [g.processingInstruction, g.string, g.inserted], color: Hl },
2105
- { tag: g.invalid, color: El }
2106
- ]), jl = [
2107
- Ml,
2108
- kt(Rl)
2109
- ], Bl = "#e5c07b", dt = "#3f4a54", Pl = "#56b6c2", Ol = "#fff", re = "#3f4a54", ut = "#2d8cf0", Dl = "#2d8cf0", Nl = "#3f4a54", mt = "#d19a66", _l = "#c678dd", Vl = "#21252b", ft = "#2c313a", gt = "#fff", he = "#353a42", Ul = "#bad5fa", ht = "#3f4a54", ql = $e.theme(
2108
+ { tag: g.link, color: nt, textDecoration: "underline" },
2109
+ { tag: g.heading, fontWeight: "bold", color: ot },
2110
+ { tag: [g.atom, g.bool, g.special(g.variableName)], color: rt },
2111
+ { tag: [g.processingInstruction, g.string, g.inserted], color: Ll },
2112
+ { tag: g.invalid, color: xl }
2113
+ ]), Rl = [
2114
+ Fl,
2115
+ bt(Ml)
2116
+ ], jl = "#e5c07b", ct = "#3f4a54", Bl = "#56b6c2", Pl = "#fff", oe = "#3f4a54", dt = "#2d8cf0", Ol = "#2d8cf0", Dl = "#3f4a54", ut = "#d19a66", Nl = "#c678dd", _l = "#21252b", mt = "#2c313a", ft = "#fff", ge = "#353a42", Vl = "#bad5fa", gt = "#3f4a54", Ul = Ce.theme(
2110
2117
  {
2111
2118
  "&": {
2112
- color: re,
2113
- backgroundColor: gt
2119
+ color: oe,
2120
+ backgroundColor: ft
2114
2121
  },
2115
2122
  ".cm-content": {
2116
- caretColor: ht
2123
+ caretColor: gt
2117
2124
  },
2118
- ".cm-cursor, .cm-dropCursor": { borderLeftColor: ht },
2119
- "&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Ul },
2120
- ".cm-panels": { backgroundColor: Vl, color: re },
2125
+ ".cm-cursor, .cm-dropCursor": { borderLeftColor: gt },
2126
+ "&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Vl },
2127
+ ".cm-panels": { backgroundColor: _l, color: oe },
2121
2128
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
2122
2129
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
2123
2130
  ".cm-searchMatch": {
@@ -2133,13 +2140,13 @@ $$
2133
2140
  backgroundColor: "#bad0f847"
2134
2141
  },
2135
2142
  ".cm-gutters": {
2136
- backgroundColor: gt,
2137
- color: re,
2143
+ backgroundColor: ft,
2144
+ color: oe,
2138
2145
  borderRight: "1px solid",
2139
2146
  borderColor: "var(--md-border-color)"
2140
2147
  },
2141
2148
  ".cm-activeLineGutter": {
2142
- backgroundColor: ft
2149
+ backgroundColor: mt
2143
2150
  },
2144
2151
  ".cm-foldPlaceholder": {
2145
2152
  backgroundColor: "transparent",
@@ -2148,30 +2155,30 @@ $$
2148
2155
  },
2149
2156
  ".cm-tooltip": {
2150
2157
  border: "none",
2151
- backgroundColor: he
2158
+ backgroundColor: ge
2152
2159
  },
2153
2160
  ".cm-tooltip .cm-tooltip-arrow:before": {
2154
2161
  borderTopColor: "transparent",
2155
2162
  borderBottomColor: "transparent"
2156
2163
  },
2157
2164
  ".cm-tooltip .cm-tooltip-arrow:after": {
2158
- borderTopColor: he,
2159
- borderBottomColor: he
2165
+ borderTopColor: ge,
2166
+ borderBottomColor: ge
2160
2167
  },
2161
2168
  ".cm-tooltip-autocomplete": {
2162
2169
  "& > ul > li[aria-selected]": {
2163
- backgroundColor: ft,
2164
- color: re
2170
+ backgroundColor: mt,
2171
+ color: oe
2165
2172
  }
2166
2173
  }
2167
2174
  },
2168
2175
  { dark: !0 }
2169
- ), Wl = bt.define([
2170
- { tag: g.keyword, color: _l },
2171
- { tag: [g.name, g.deleted, g.character, g.propertyName, g.macroName], color: dt },
2172
- { tag: [g.function(g.variableName), g.labelName], color: Dl },
2173
- { tag: [g.color, g.constant(g.name), g.standard(g.name)], color: mt },
2174
- { tag: [g.definition(g.name), g.separator], color: re },
2176
+ ), ql = pt.define([
2177
+ { tag: g.keyword, color: Nl },
2178
+ { tag: [g.name, g.deleted, g.character, g.propertyName, g.macroName], color: ct },
2179
+ { tag: [g.function(g.variableName), g.labelName], color: Ol },
2180
+ { tag: [g.color, g.constant(g.name), g.standard(g.name)], color: ut },
2181
+ { tag: [g.definition(g.name), g.separator], color: oe },
2175
2182
  {
2176
2183
  tag: [
2177
2184
  g.typeName,
@@ -2183,7 +2190,7 @@ $$
2183
2190
  g.self,
2184
2191
  g.namespace
2185
2192
  ],
2186
- color: Bl
2193
+ color: jl
2187
2194
  },
2188
2195
  {
2189
2196
  tag: [
@@ -2195,27 +2202,27 @@ $$
2195
2202
  g.link,
2196
2203
  g.special(g.string)
2197
2204
  ],
2198
- color: Pl
2205
+ color: Bl
2199
2206
  },
2200
- { tag: [g.meta, g.comment], color: ut },
2207
+ { tag: [g.meta, g.comment], color: dt },
2201
2208
  { tag: g.strong, fontWeight: "bold" },
2202
2209
  { tag: g.emphasis, fontStyle: "italic" },
2203
2210
  { tag: g.strikethrough, textDecoration: "line-through" },
2204
- { tag: g.link, color: ut, textDecoration: "underline" },
2205
- { tag: g.heading, fontWeight: "bold", color: dt },
2206
- { tag: [g.atom, g.bool, g.special(g.variableName)], color: mt },
2207
- { tag: [g.processingInstruction, g.string, g.inserted], color: Nl },
2208
- { tag: g.invalid, color: Ol }
2209
- ]), Gl = [
2210
- ql,
2211
- kt(Wl)
2211
+ { tag: g.link, color: dt, textDecoration: "underline" },
2212
+ { tag: g.heading, fontWeight: "bold", color: ct },
2213
+ { tag: [g.atom, g.bool, g.special(g.variableName)], color: ut },
2214
+ { tag: [g.processingInstruction, g.string, g.inserted], color: Dl },
2215
+ { tag: g.invalid, color: Pl }
2216
+ ]), Wl = [
2217
+ Ul,
2218
+ bt(ql)
2212
2219
  ], J = (e) => {
2213
- const t = new It();
2220
+ const t = new Ht();
2214
2221
  return (l) => (t.get(e.state) ? e.dispatch({ effects: t.reconfigure(l) }) : e.dispatch({
2215
- effects: At.appendConfig.of(t.of(l))
2222
+ effects: It.appendConfig.of(t.of(l))
2216
2223
  }), !0);
2217
2224
  };
2218
- class zl {
2225
+ class Gl {
2219
2226
  constructor(t) {
2220
2227
  U(this, "view");
2221
2228
  // 切换tabSize的执行方法。切换时,Compartment实例需要相同
@@ -2280,10 +2287,10 @@ class zl {
2280
2287
  if (this.view.dispatch(this.view.state.replaceSelection(t)), o.select) {
2281
2288
  const r = l + t.length + o.deviationEnd;
2282
2289
  this.view.dispatch({
2283
- selection: fe.create(
2290
+ selection: me.create(
2284
2291
  [
2285
- fe.range(l + o.deviationStart, r),
2286
- fe.cursor(r)
2292
+ me.range(l + o.deviationStart, r),
2293
+ me.cursor(r)
2287
2294
  ],
2288
2295
  1
2289
2296
  )
@@ -2297,8 +2304,8 @@ class zl {
2297
2304
  */
2298
2305
  setTabSize(t) {
2299
2306
  this.toggleTabSize([
2300
- ce.tabSize.of(t),
2301
- Nt.of(" ".repeat(t))
2307
+ ae.tabSize.of(t),
2308
+ Dt.of(" ".repeat(t))
2302
2309
  ]);
2303
2310
  }
2304
2311
  /**
@@ -2307,24 +2314,24 @@ class zl {
2307
2314
  * @param t 目标内容
2308
2315
  */
2309
2316
  setPlaceholder(t) {
2310
- this.togglePlaceholder(Ft(t));
2317
+ this.togglePlaceholder(At(t));
2311
2318
  }
2312
- foucs() {
2319
+ focus() {
2313
2320
  this.view.focus();
2314
2321
  }
2315
2322
  setDisabled(t) {
2316
- this.toggleDisabled([$e.editable.of(!t)]);
2323
+ this.toggleDisabled([Ce.editable.of(!t)]);
2317
2324
  }
2318
2325
  setReadOnly(t) {
2319
- this.toggleReadOnly([ce.readOnly.of(t)]);
2326
+ this.toggleReadOnly([ae.readOnly.of(t)]);
2320
2327
  }
2321
2328
  setMaxLength(t) {
2322
2329
  this.toggleMaxlength([
2323
- ce.changeFilter.of((o) => o.newDoc.length <= t)
2330
+ ae.changeFilter.of((o) => o.newDoc.length <= t)
2324
2331
  ]);
2325
2332
  }
2326
2333
  }
2327
- const Kl = (e) => {
2334
+ const zl = (e) => {
2328
2335
  const t = x("editorId");
2329
2336
  return (l) => {
2330
2337
  if (l.clipboardData) {
@@ -2345,18 +2352,18 @@ const Kl = (e) => {
2345
2352
  }
2346
2353
  }
2347
2354
  };
2348
- }, Xl = (e) => {
2355
+ }, Kl = (e) => {
2349
2356
  const t = x("editorId");
2350
2357
  A(() => {
2351
2358
  C.on(t, {
2352
- name: wt,
2359
+ name: $t,
2353
2360
  callback() {
2354
2361
  var o;
2355
- (o = e.value) == null || o.foucs();
2362
+ (o = e.value) == null || o.focus();
2356
2363
  }
2357
2364
  });
2358
2365
  });
2359
- }, Zl = (e, t) => [
2366
+ }, Xl = (e, t) => [
2360
2367
  {
2361
2368
  key: "Ctrl-b",
2362
2369
  mac: "Cmd-b",
@@ -2365,13 +2372,13 @@ const Kl = (e) => {
2365
2372
  {
2366
2373
  key: "Ctrl-d",
2367
2374
  mac: "Cmd-d",
2368
- run: Bt,
2375
+ run: jt,
2369
2376
  preventDefault: !0
2370
2377
  },
2371
2378
  {
2372
2379
  key: "Ctrl-s",
2373
2380
  mac: "Cmd-s",
2374
- run: (L) => (C.emit(e, me, L.state.doc.toString()), !0),
2381
+ run: (L) => (C.emit(e, ue, L.state.doc.toString()), !0),
2375
2382
  shift: () => (C.emit(e, "replace", "strikeThrough"), !0)
2376
2383
  },
2377
2384
  {
@@ -2452,52 +2459,52 @@ const Kl = (e) => {
2452
2459
  {
2453
2460
  any: (L, S) => (S.ctrlKey || S.metaKey) && S.altKey && S.shiftKey && S.code === "KeyT" ? (C.emit(e, "replace", "table"), !0) : !1
2454
2461
  }
2455
- ], Jl = (e) => {
2456
- const t = x("tabWidth"), o = x("editorId"), l = x("theme"), r = F(), n = F(), a = Zl(o, e), c = Kl(e), m = [
2457
- Mt.of([...a, Pt]),
2458
- Ht,
2459
- jt({ codeLanguages: Rt }),
2462
+ ], Zl = (e) => {
2463
+ const t = x("tabWidth"), o = x("editorId"), l = x("theme"), r = F(), n = F(), a = Xl(o, e), c = zl(e), m = [
2464
+ Ft.of([...a, Bt]),
2465
+ Lt,
2466
+ Rt({ codeLanguages: Mt }),
2460
2467
  // 横向换行
2461
- ae.lineWrapping,
2462
- ae.updateListener.of((d) => {
2468
+ re.lineWrapping,
2469
+ re.updateListener.of((d) => {
2463
2470
  e.onChange(d.state.doc.toString());
2464
2471
  }),
2465
- ae.domEventHandlers({
2472
+ re.domEventHandlers({
2466
2473
  paste: c,
2467
2474
  blur: e.onBlur,
2468
2475
  focus: e.onFocus
2469
2476
  })
2470
2477
  ], u = () => l.value === "light" ? I.codeMirrorExtensions(
2471
2478
  l.value,
2472
- [...m, Gl],
2479
+ [...m, Wl],
2473
2480
  a
2474
2481
  ) : I.codeMirrorExtensions(
2475
2482
  l.value,
2476
- [...m, jl],
2483
+ [...m, Rl],
2477
2484
  a
2478
2485
  );
2479
2486
  return A(() => {
2480
- const d = ce.create({
2487
+ const d = ae.create({
2481
2488
  doc: e.value
2482
- }), f = new ae({
2489
+ }), f = new re({
2483
2490
  state: d,
2484
2491
  parent: r.value
2485
2492
  });
2486
- n.value = new zl(f), n.value.setTabSize(t), n.value.setExtensions(u()), n.value.setPlaceholder(e.placeholder), n.value.setDisabled(e.disabled), n.value.setReadOnly(e.readonly), e.autofocus && f.focus(), e.maxlength && n.value.setMaxLength(e.maxlength), C.on(o, {
2493
+ n.value = new Gl(f), n.value.setTabSize(t), n.value.setExtensions(u()), n.value.setPlaceholder(e.placeholder), n.value.setDisabled(e.disabled), n.value.setReadOnly(e.readonly), e.autofocus && f.focus(), e.maxlength && n.value.setMaxLength(e.maxlength), C.on(o, {
2487
2494
  name: "ctrlZ",
2488
2495
  callback() {
2489
- Ot(f);
2496
+ Pt(f);
2490
2497
  }
2491
2498
  }), C.on(o, {
2492
2499
  name: "ctrlShiftZ",
2493
2500
  callback() {
2494
- Dt(f);
2501
+ Ot(f);
2495
2502
  }
2496
2503
  }), C.on(o, {
2497
2504
  name: "replace",
2498
2505
  callback(h, v = {}) {
2499
2506
  var p;
2500
- const { text: b, options: k } = Tl(h, n.value, v);
2507
+ const { text: b, options: k } = wl(h, n.value, v);
2501
2508
  (p = n.value) == null || p.replaceSelectedText(b, k);
2502
2509
  }
2503
2510
  });
@@ -2537,19 +2544,19 @@ const Kl = (e) => {
2537
2544
  var d;
2538
2545
  e.maxlength && ((d = n.value) == null || d.setMaxLength(e.maxlength));
2539
2546
  }
2540
- ), Xl(n), {
2547
+ ), Kl(n), {
2541
2548
  inputWrapperRef: r,
2542
2549
  codeMirrorUt: n
2543
2550
  };
2544
- }, Yl = (e, t) => {
2545
- const o = x("editorId"), l = ee(() => {
2551
+ }, Jl = (e, t) => {
2552
+ const o = x("editorId"), l = de(() => {
2546
2553
  const r = document.querySelectorAll(`#${o}-preview img`);
2547
- r.length !== 0 && _t(r, {
2554
+ r.length !== 0 && Nt(r, {
2548
2555
  background: "#00000073"
2549
2556
  });
2550
2557
  });
2551
2558
  A(l), T([t, Q(e.setting, "preview")], l);
2552
- }, Ql = (e, t) => {
2559
+ }, Yl = (e, t) => {
2553
2560
  const o = x("editorId"), l = x("usedLanguageText"), r = () => {
2554
2561
  document.querySelectorAll(`#${o}-preview pre`).forEach((c) => {
2555
2562
  var f, h;
@@ -2559,7 +2566,7 @@ const Kl = (e) => {
2559
2566
  d.setAttribute("class", "copy-button"), d.dataset.tips = u, d.innerHTML = `<svg class="${s}-icon" aria-hidden="true"><use xlink:href="#${s}-icon-copy"></use></svg>`, d.addEventListener("click", () => {
2560
2567
  var y, $;
2561
2568
  clearTimeout(m);
2562
- const v = c.querySelector("code").innerText, b = Vt(e.formatCopiedText(v)), k = ((y = l.value.copyCode) == null ? void 0 : y.successTips) || "已复制!", p = (($ = l.value.copyCode) == null ? void 0 : $.failTips) || "已复制!";
2569
+ const v = c.querySelector("code").innerText, b = _t(e.formatCopiedText(v)), k = ((y = l.value.copyCode) == null ? void 0 : y.successTips) || "已复制!", p = (($ = l.value.copyCode) == null ? void 0 : $.failTips) || "已复制!";
2563
2570
  d.dataset.tips = b ? k : p, m = window.setTimeout(() => {
2564
2571
  d.dataset.tips = u;
2565
2572
  }, 1500);
@@ -2571,9 +2578,9 @@ const Kl = (e) => {
2571
2578
  c && z(r);
2572
2579
  };
2573
2580
  T(() => t.value, n), T(() => e.setting.preview, a), T(() => e.setting.htmlPreview, a), T(() => l.value, r), A(r);
2574
- }, eo = (e) => {
2581
+ }, Ql = (e) => {
2575
2582
  var n;
2576
- const t = (n = I.editorExtensions) == null ? void 0 : n.highlight, o = t == null ? void 0 : t.instance, l = x("highlight"), r = de(o);
2583
+ const t = (n = I.editorExtensions) == null ? void 0 : n.highlight, o = t == null ? void 0 : t.instance, l = x("highlight"), r = se(o);
2577
2584
  return A(() => {
2578
2585
  if (e.noHighlight)
2579
2586
  return;
@@ -2588,11 +2595,11 @@ const Kl = (e) => {
2588
2595
  }), T(
2589
2596
  () => l.value.css,
2590
2597
  (a) => {
2591
- cl(`${s}-hlCss`, "href", a);
2598
+ sl(`${s}-hlCss`, "href", a);
2592
2599
  }
2593
2600
  ), r;
2594
- }, to = (e) => {
2595
- const t = x("theme"), { editorExtensions: o } = I, l = o == null ? void 0 : o.mermaid, r = de(l == null ? void 0 : l.instance), n = de(!1), a = new Gt({
2601
+ }, eo = (e) => {
2602
+ const t = x("theme"), { editorExtensions: o } = I, l = o == null ? void 0 : o.mermaid, r = se(l == null ? void 0 : l.instance), n = se(!1), a = new Wt({
2596
2603
  max: 1e3,
2597
2604
  // 缓存10分钟
2598
2605
  ttl: 6e5
@@ -2612,7 +2619,7 @@ const Kl = (e) => {
2612
2619
  if (!e.noMermaid && !(l != null && l.instance)) {
2613
2620
  const u = document.createElement("script");
2614
2621
  u.id = `${s}-mermaid`;
2615
- const d = (l == null ? void 0 : l.js) || Jt;
2622
+ const d = (l == null ? void 0 : l.js) || Zt;
2616
2623
  /\.mjs/.test(d) ? (u.setAttribute("type", "module"), u.innerHTML = `import mermaid from "${d}";window.mermaid=mermaid;document.getElementById('${s}-mermaid').dispatchEvent(new Event('load'));`) : u.src = d, u.onload = () => {
2617
2624
  r.value = window.mermaid, c();
2618
2625
  }, O(u, "mermaid");
@@ -2624,7 +2631,7 @@ const Kl = (e) => {
2624
2631
  ).forEach(async (d) => {
2625
2632
  let f = a.get(d.innerText);
2626
2633
  if (!f) {
2627
- const v = al(), k = await (r.value.renderAsync || r.value.render)(v, d.innerText);
2634
+ const v = il(), k = await (r.value.renderAsync || r.value.render)(v, d.innerText);
2628
2635
  f = typeof k == "string" ? k : k.svg, a.set(d.innerText, f);
2629
2636
  }
2630
2637
  const h = document.createElement("p");
@@ -2632,37 +2639,37 @@ const Kl = (e) => {
2632
2639
  });
2633
2640
  });
2634
2641
  } };
2635
- }, lo = (e) => {
2642
+ }, to = (e) => {
2636
2643
  var r;
2637
- const t = (r = I.editorExtensions) == null ? void 0 : r.katex, o = t == null ? void 0 : t.instance, l = de(o);
2644
+ const t = (r = I.editorExtensions) == null ? void 0 : r.katex, o = t == null ? void 0 : t.instance, l = se(o);
2638
2645
  return A(() => {
2639
2646
  if (!e.noKatex && !l.value) {
2640
2647
  const n = document.createElement("script");
2641
- n.src = (t == null ? void 0 : t.js) || Je.js, n.onload = () => {
2648
+ n.src = (t == null ? void 0 : t.js) || Ze.js, n.onload = () => {
2642
2649
  l.value = window.katex;
2643
2650
  }, n.id = `${s}-katex`;
2644
2651
  const a = document.createElement("link");
2645
- a.rel = "stylesheet", a.href = (t == null ? void 0 : t.css) || Je.css, a.id = `${s}-katexCss`, O(n, "katex"), O(a);
2652
+ a.rel = "stylesheet", a.href = (t == null ? void 0 : t.css) || Ze.css, a.id = `${s}-katexCss`, O(n, "katex"), O(a);
2646
2653
  }
2647
2654
  }), l;
2648
- }, oo = (e, t) => {
2655
+ }, lo = (e, t) => {
2649
2656
  const o = e.renderer.rules.fence.bind(e.renderer.rules);
2650
2657
  e.renderer.rules.fence = (l, r, n, a, c) => {
2651
2658
  const m = l[r], u = m.content.trim();
2652
2659
  return m.info === "mermaid" ? `<div class="${s}-mermaid" data-mermaid-theme=${t.themeRef.value}>${u}</div>` : o(l, r, n, a, c);
2653
2660
  };
2654
- }, vt = (e, t) => {
2661
+ }, ht = (e, t) => {
2655
2662
  let o = !0, l = !0;
2656
2663
  const r = e.posMax, n = t > 0 ? e.src.charCodeAt(t - 1) : -1, a = t + 1 <= r ? e.src.charCodeAt(t + 1) : -1;
2657
2664
  return (n === 32 || n === 9 || a >= 48 && a <= 57) && (l = !1), (a === 32 || a === 9) && (o = !1), {
2658
2665
  can_open: o,
2659
2666
  can_close: l
2660
2667
  };
2661
- }, no = (e, t) => {
2668
+ }, oo = (e, t) => {
2662
2669
  let o, l, r, n;
2663
2670
  if (e.src[e.pos] !== "$")
2664
2671
  return !1;
2665
- if (r = vt(e, e.pos), !r.can_open)
2672
+ if (r = ht(e, e.pos), !r.can_open)
2666
2673
  return t || (e.pending += "$"), e.pos += 1, !0;
2667
2674
  const a = e.pos + 1;
2668
2675
  for (o = a; (o = e.src.indexOf("$", o)) !== -1; ) {
@@ -2672,8 +2679,8 @@ const Kl = (e) => {
2672
2679
  break;
2673
2680
  o += 1;
2674
2681
  }
2675
- return o === -1 ? (t || (e.pending += "$"), e.pos = a, !0) : o - a === 0 ? (t || (e.pending += "$$"), e.pos = a + 1, !0) : (r = vt(e, o), r.can_close ? (t || (l = e.push("math_inline", "math", 0), l.markup = "$", l.content = e.src.slice(a, o)), e.pos = o + 1, !0) : (t || (e.pending += "$"), e.pos = a, !0));
2676
- }, ro = (e, t, o, l) => {
2682
+ return o === -1 ? (t || (e.pending += "$"), e.pos = a, !0) : o - a === 0 ? (t || (e.pending += "$$"), e.pos = a + 1, !0) : (r = ht(e, o), r.can_close ? (t || (l = e.push("math_inline", "math", 0), l.markup = "$", l.content = e.src.slice(a, o)), e.pos = o + 1, !0) : (t || (e.pending += "$"), e.pos = a, !0));
2683
+ }, no = (e, t, o, l) => {
2677
2684
  let r, n, a, c, m = !1, u = e.bMarks[t] + e.tShift[t], d = e.eMarks[t];
2678
2685
  if (u + 2 > d || e.src.slice(u, u + 2) !== "$$")
2679
2686
  return !1;
@@ -2685,7 +2692,7 @@ const Kl = (e) => {
2685
2692
  const f = e.push("math_block", "math", 0);
2686
2693
  return f.block = !0, f.content = (r && r.trim() ? r + `
2687
2694
  ` : "") + e.getLines(t + 1, a, e.tShift[t], !0) + (n && n.trim() ? n : ""), f.map = [t, e.line], f.markup = "$$", !0;
2688
- }, io = (e, t) => {
2695
+ }, ro = (e, t) => {
2689
2696
  const o = (r) => {
2690
2697
  if (t.katexRef.value) {
2691
2698
  const n = t.katexRef.value.renderToString(r, {
@@ -2704,11 +2711,11 @@ const Kl = (e) => {
2704
2711
  } else
2705
2712
  return `<p class="${s}-katex-block" data-line=${n}>${r}</p>`;
2706
2713
  };
2707
- e.inline.ruler.after("escape", "math_inline", no), e.block.ruler.after("blockquote", "math_block", ro, {
2714
+ e.inline.ruler.after("escape", "math_inline", oo), e.block.ruler.after("blockquote", "math_block", no, {
2708
2715
  alt: ["paragraph", "reference", "blockquote", "list"]
2709
2716
  }), e.renderer.rules.math_inline = (r, n) => o(r[n].content), e.renderer.rules.math_block = (r, n) => l(r[n].content, r[n].map[0]) + `
2710
2717
  `;
2711
- }, ao = (e, t) => {
2718
+ }, io = (e, t) => {
2712
2719
  t = t || {};
2713
2720
  const o = 3, l = t.marker || "!", r = l.charCodeAt(0), n = l.length;
2714
2721
  let a = "", c = "";
@@ -2754,7 +2761,7 @@ const Kl = (e) => {
2754
2761
  alt: ["paragraph", "reference", "blockquote", "list"]
2755
2762
  }
2756
2763
  ), e.renderer.rules.admonition_open = m, e.renderer.rules.admonition_title_open = m, e.renderer.rules.admonition_title_close = m, e.renderer.rules.admonition_close = m;
2757
- }, so = (e, t) => {
2764
+ }, ao = (e, t) => {
2758
2765
  let o;
2759
2766
  e.core.ruler.push("headingLinks", (l) => {
2760
2767
  o || (o = l.Token);
@@ -2768,15 +2775,15 @@ const Kl = (e) => {
2768
2775
  t.mdHeadingId(a, c, t.headsRef.value.length)
2769
2776
  )), e.renderer.renderToken(l, r, t);
2770
2777
  }, e.renderer.rules.heading_close = (l, r, n, a, c) => c.renderToken(l, r, n);
2771
- }, pt = (e) => e.replace(
2778
+ }, vt = (e) => e.replace(
2772
2779
  /<pre><code\sclass="language-([^>]*)">/g,
2773
2780
  '<pre><code class="language-$1" language="$1">'
2774
- ), co = (e) => {
2775
- const { editorConfig: t, markdownItConfig: o } = I, l = x("editorId"), r = x("showCodeRowNumber"), n = x("previewOnly"), a = x("theme"), c = F([]), m = eo(e), u = lo(e), { reRenderRef: d, replaceMermaid: f } = to(e), h = Ut({
2781
+ ), so = (e) => {
2782
+ const { editorConfig: t, markdownItConfig: o } = I, l = x("editorId"), r = x("showCodeRowNumber"), n = x("previewOnly"), a = x("theme"), c = F([]), m = Ql(e), u = to(e), { reRenderRef: d, replaceMermaid: f } = eo(e), h = Vt({
2776
2783
  html: !0,
2777
2784
  breaks: !0
2778
2785
  });
2779
- h.use(oo, { themeRef: a }), h.use(io, { katexRef: u }), h.use(qt, { figcaption: !0 }), h.use(ao), h.use(Wt), h.use(so, { mdHeadingId: e.mdHeadingId, headsRef: c }), h.renderer.rules.paragraph_open = h.renderer.rules.table_open = (p, y, $, w, L) => {
2786
+ h.use(lo, { themeRef: a }), h.use(ro, { katexRef: u }), h.use(Ut, { figcaption: !0 }), h.use(io), h.use(qt), h.use(ao, { mdHeadingId: e.mdHeadingId, headsRef: c }), h.renderer.rules.paragraph_open = h.renderer.rules.table_open = (p, y, $, w, L) => {
2780
2787
  let S;
2781
2788
  return p[y].map && p[y].level === 0 && (S = p[y].map[0], p[y].attrSet("data-line", String(S))), L.renderToken(p, y, $);
2782
2789
  }, h.set({
@@ -2788,12 +2795,12 @@ const Kl = (e) => {
2788
2795
  return $ ? w = m.value.highlight(p, {
2789
2796
  language: y,
2790
2797
  ignoreIllegals: !0
2791
- }).value : w = m.value.highlightAuto(p).value, r ? nl(w.trim()) : `<span class="code-block">${w.trim()}</span>`;
2798
+ }).value : w = m.value.highlightAuto(p).value, r ? ol(w.trim()) : `<span class="code-block">${w.trim()}</span>`;
2792
2799
  }
2793
2800
  }), o(h);
2794
- const v = F(e.sanitize(pt(h.render(e.value)))), b = ee(
2801
+ const v = F(e.sanitize(vt(h.render(e.value)))), b = de(
2795
2802
  async () => {
2796
- c.value = [], v.value = e.sanitize(pt(h.render(e.value))), C.emit(l, "buildFinished", v.value), e.onHtmlChanged(v.value), f();
2803
+ c.value = [], v.value = e.sanitize(vt(h.render(e.value))), C.emit(l, "buildFinished", v.value), e.onHtmlChanged(v.value), f();
2797
2804
  },
2798
2805
  (t == null ? void 0 : t.renderDelay) !== void 0 ? t == null ? void 0 : t.renderDelay : n ? 0 : 500
2799
2806
  ), k = D(() => e.noHighlight || m.value);
@@ -2810,7 +2817,7 @@ const Kl = (e) => {
2810
2817
  }
2811
2818
  });
2812
2819
  }), { html: v };
2813
- }, uo = {
2820
+ }, co = {
2814
2821
  value: {
2815
2822
  type: String,
2816
2823
  default: ""
@@ -2900,17 +2907,17 @@ const Kl = (e) => {
2900
2907
  type: Boolean,
2901
2908
  default: !1
2902
2909
  }
2903
- }, mo = /* @__PURE__ */ M({
2910
+ }, uo = /* @__PURE__ */ M({
2904
2911
  name: "MDEditorContent",
2905
- props: uo,
2912
+ props: co,
2906
2913
  setup(e) {
2907
2914
  const t = x("previewOnly"), o = x("showCodeRowNumber"), l = x("previewTheme"), r = x("editorId"), n = F(), a = F(), {
2908
2915
  inputWrapperRef: c,
2909
2916
  codeMirrorUt: m
2910
- } = Jl(e), {
2917
+ } = Zl(e), {
2911
2918
  html: u
2912
- } = co(e);
2913
- return wl(e, u, n, a, m), Ql(e, u), Yl(e, u), () => i("div", {
2919
+ } = so(e);
2920
+ return $l(e, u, n, a, m), Yl(e, u), Jl(e, u), () => i("div", {
2914
2921
  class: `${s}-content`
2915
2922
  }, [!t && i("div", {
2916
2923
  class: `${s}-input-wrapper`,
@@ -2932,7 +2939,7 @@ const Kl = (e) => {
2932
2939
  class: `${s}-html`
2933
2940
  }, [u.value])])]);
2934
2941
  }
2935
- }), fo = /* @__PURE__ */ M({
2942
+ }), mo = /* @__PURE__ */ M({
2936
2943
  props: {
2937
2944
  modelValue: {
2938
2945
  type: String,
@@ -2951,7 +2958,7 @@ const Kl = (e) => {
2951
2958
  };
2952
2959
  }
2953
2960
  });
2954
- const go = {
2961
+ const fo = {
2955
2962
  checked: {
2956
2963
  type: Boolean,
2957
2964
  default: !1
@@ -2961,8 +2968,8 @@ const go = {
2961
2968
  default: () => {
2962
2969
  }
2963
2970
  }
2964
- }, ho = /* @__PURE__ */ M({
2965
- props: go,
2971
+ }, go = /* @__PURE__ */ M({
2972
+ props: fo,
2966
2973
  setup(e) {
2967
2974
  return () => i("div", {
2968
2975
  class: [`${s}-checkbox`, e.checked && `${s}-checkbox-checked`],
@@ -2971,7 +2978,7 @@ const go = {
2971
2978
  }
2972
2979
  }, null);
2973
2980
  }
2974
- }), vo = {
2981
+ }), ho = {
2975
2982
  scrollAuto: {
2976
2983
  type: Boolean
2977
2984
  },
@@ -2980,8 +2987,8 @@ const go = {
2980
2987
  default: () => {
2981
2988
  }
2982
2989
  }
2983
- }, po = /* @__PURE__ */ M({
2984
- props: vo,
2990
+ }, vo = /* @__PURE__ */ M({
2991
+ props: ho,
2985
2992
  setup(e) {
2986
2993
  const t = x("usedLanguageText");
2987
2994
  return () => {
@@ -2993,13 +3000,13 @@ const go = {
2993
3000
  onClick: () => {
2994
3001
  e.onScrollAutoChange(!e.scrollAuto);
2995
3002
  }
2996
- }, [(o = t.value.footer) == null ? void 0 : o.scrollAuto]), i(ho, {
3003
+ }, [(o = t.value.footer) == null ? void 0 : o.scrollAuto]), i(go, {
2997
3004
  checked: e.scrollAuto,
2998
3005
  onChange: e.onScrollAutoChange
2999
3006
  }, null)]);
3000
3007
  };
3001
3008
  }
3002
- }), bo = {
3009
+ }), po = {
3003
3010
  modelValue: {
3004
3011
  type: String,
3005
3012
  default: ""
@@ -3019,22 +3026,22 @@ const go = {
3019
3026
  defFooters: {
3020
3027
  type: Object
3021
3028
  }
3022
- }, ko = /* @__PURE__ */ M({
3029
+ }, bo = /* @__PURE__ */ M({
3023
3030
  name: "MDEditorFooter",
3024
- props: bo,
3031
+ props: po,
3025
3032
  setup(e) {
3026
3033
  const t = D(() => {
3027
3034
  const l = e.footers.indexOf("="), r = l === -1 ? e.footers : e.footers.slice(0, l), n = l === -1 ? [] : e.footers.slice(l, Number.MAX_SAFE_INTEGER);
3028
3035
  return [r, n];
3029
3036
  }), o = (l) => {
3030
- if (Ct.includes(l))
3037
+ if (yt.includes(l))
3031
3038
  switch (l) {
3032
3039
  case "markdownTotal":
3033
- return i(fo, {
3040
+ return i(mo, {
3034
3041
  modelValue: e.modelValue
3035
3042
  }, null);
3036
3043
  case "scrollSwitch":
3037
- return i(po, {
3044
+ return i(vo, {
3038
3045
  scrollAuto: e.scrollAuto,
3039
3046
  onScrollAutoChange: e.onScrollAutoChange
3040
3047
  }, null);
@@ -3053,7 +3060,7 @@ const go = {
3053
3060
  }, [r])]);
3054
3061
  };
3055
3062
  }
3056
- }), yo = {
3063
+ }), ko = {
3057
3064
  tocItem: {
3058
3065
  type: Object,
3059
3066
  default: () => ({})
@@ -3076,8 +3083,8 @@ const go = {
3076
3083
  type: Number,
3077
3084
  default: 0
3078
3085
  }
3079
- }, Tt = /* @__PURE__ */ M({
3080
- props: yo,
3086
+ }, wt = /* @__PURE__ */ M({
3087
+ props: ko,
3081
3088
  setup(e) {
3082
3089
  return () => {
3083
3090
  const {
@@ -3107,7 +3114,7 @@ const go = {
3107
3114
  title: t.text
3108
3115
  }, [t.text]), i("div", {
3109
3116
  class: `${s}-catalog-wrapper`
3110
- }, [t.children && t.children.map((a) => i(Tt, {
3117
+ }, [t.children && t.children.map((a) => i(wt, {
3111
3118
  mdHeadingId: o,
3112
3119
  key: `${t.text}-link-${a.level}-${a.text}`,
3113
3120
  tocItem: a,
@@ -3118,7 +3125,7 @@ const go = {
3118
3125
  };
3119
3126
  }
3120
3127
  });
3121
- const Co = {
3128
+ const yo = {
3122
3129
  /**
3123
3130
  * 编辑器的Id,务必与需要绑定的编辑器Id相同
3124
3131
  */
@@ -3167,9 +3174,9 @@ const Co = {
3167
3174
  onClick: {
3168
3175
  type: Function
3169
3176
  }
3170
- }, ue = /* @__PURE__ */ M({
3177
+ }, ce = /* @__PURE__ */ M({
3171
3178
  name: "MdCatalog",
3172
- props: Co,
3179
+ props: yo,
3173
3180
  emits: ["onClick"],
3174
3181
  setup(e, t) {
3175
3182
  const o = e.editorId, l = N({
@@ -3228,7 +3235,7 @@ const Co = {
3228
3235
  const n = () => {
3229
3236
  var c;
3230
3237
  const a = l.scrollElement instanceof HTMLElement ? l.scrollElement : document.querySelector(l.scrollElement);
3231
- (c = a === document.documentElement ? window : a) == null || c.addEventListener("scroll", rl(() => {
3238
+ (c = a === document.documentElement ? window : a) == null || c.addEventListener("scroll", nl(() => {
3232
3239
  if (l.list.length === 0)
3233
3240
  return !1;
3234
3241
  const {
@@ -3236,7 +3243,7 @@ const Co = {
3236
3243
  } = l.list.reduce((u, d, f) => {
3237
3244
  const h = document.getElementById(e.mdHeadingId(d.text, d.level, f + 1));
3238
3245
  if (h instanceof HTMLElement) {
3239
- const v = il(h, a);
3246
+ const v = rl(h, a);
3240
3247
  if (v < e.offsetTop && v > u.minTop)
3241
3248
  return {
3242
3249
  activeHead: d,
@@ -3259,14 +3266,14 @@ const Co = {
3259
3266
  };
3260
3267
  return A(() => {
3261
3268
  n(), C.on(o, {
3262
- name: ve,
3269
+ name: he,
3263
3270
  callback(a) {
3264
3271
  a && z(n);
3265
3272
  }
3266
3273
  });
3267
3274
  }), () => i("div", {
3268
3275
  class: `${s}-catalog${e.theme === "dark" ? "-dark" : ""} ${e.class}`
3269
- }, [r.value.map((a) => i(Tt, {
3276
+ }, [r.value.map((a) => i(wt, {
3270
3277
  mdHeadingId: e.mdHeadingId,
3271
3278
  tocItem: a,
3272
3279
  key: `link-${a.level}-${a.text}`,
@@ -3277,7 +3284,7 @@ const Co = {
3277
3284
  scrollElementOffsetTop: e.scrollElementOffsetTop
3278
3285
  }, null))]);
3279
3286
  }
3280
- }), $o = (e, t) => {
3287
+ }), Co = (e, t) => {
3281
3288
  const { editorId: o, previewOnly: l } = e, r = N({
3282
3289
  // 是否已编译成html
3283
3290
  buildFinished: !1,
@@ -3296,7 +3303,7 @@ const Co = {
3296
3303
  r.buildFinished = !0, r.html = n;
3297
3304
  }
3298
3305
  }), C.on(o, {
3299
- name: me,
3306
+ name: ue,
3300
3307
  callback() {
3301
3308
  const n = new Promise((a) => {
3302
3309
  if (r.buildFinished)
@@ -3315,7 +3322,7 @@ const Co = {
3315
3322
  }
3316
3323
  }));
3317
3324
  });
3318
- }, wo = (e) => {
3325
+ }, $o = (e) => {
3319
3326
  var n;
3320
3327
  const { editorId: t, previewOnly: o } = e, l = (n = I == null ? void 0 : I.editorExtensions) == null ? void 0 : n.highlight;
3321
3328
  W("editorId", t), W("tabWidth", e.tabWidth), W(
@@ -3325,42 +3332,42 @@ const Co = {
3325
3332
  "highlight",
3326
3333
  D(() => {
3327
3334
  const a = {
3328
- ...Ye,
3335
+ ...Je,
3329
3336
  ...l == null ? void 0 : l.css
3330
3337
  }, c = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme;
3331
3338
  return {
3332
- js: (l == null ? void 0 : l.js) || Xt,
3333
- css: a[e.codeTheme] ? a[e.codeTheme][c] : Ye.atom[c]
3339
+ js: (l == null ? void 0 : l.js) || Kt,
3340
+ css: a[e.codeTheme] ? a[e.codeTheme][c] : Je.atom[c]
3334
3341
  };
3335
3342
  })
3336
3343
  ), W("previewOnly", o), W("showCodeRowNumber", e.showCodeRowNumber);
3337
3344
  const r = D(() => {
3338
3345
  var c;
3339
3346
  const a = {
3340
- ...Ze,
3347
+ ...Xe,
3341
3348
  ...(c = I == null ? void 0 : I.editorConfig) == null ? void 0 : c.languageUserDefined
3342
3349
  };
3343
- return a[e.language] ? a[e.language] : Ze["zh-CN"];
3350
+ return a[e.language] ? a[e.language] : Xe["zh-CN"];
3344
3351
  });
3345
3352
  W("usedLanguageText", r), W(
3346
3353
  "previewTheme",
3347
3354
  D(() => e.previewTheme)
3348
3355
  );
3349
- }, To = (e) => {
3356
+ }, wo = (e) => {
3350
3357
  var u, d, f, h, v, b;
3351
3358
  const { noPrettier: t, previewOnly: o, noIconfont: l, noUploadImg: r } = e, { editorExtensions: n } = I, a = t || !!((d = (u = I.editorExtensions) == null ? void 0 : u.prettier) != null && d.prettierInstance), c = t || !!((h = (f = I.editorExtensions) == null ? void 0 : f.prettier) != null && h.parserMarkdownInstance), m = r || !!((b = (v = I.editorExtensions) == null ? void 0 : v.cropper) != null && b.instance);
3352
3359
  A(() => {
3353
3360
  var L, S, j, B;
3354
3361
  const k = document.createElement("script");
3355
- k.src = (n == null ? void 0 : n.iconfont) || Kt, k.id = `${s}-icon`;
3362
+ k.src = (n == null ? void 0 : n.iconfont) || zt, k.id = `${s}-icon`;
3356
3363
  const p = document.createElement("script"), y = document.createElement("script");
3357
- p.src = ((L = n == null ? void 0 : n.prettier) == null ? void 0 : L.standaloneJs) || Ke.main, p.id = `${s}-prettier`, y.src = ((S = n == null ? void 0 : n.prettier) == null ? void 0 : S.parserMarkdownJs) || Ke.markdown, y.id = `${s}-prettierMD`;
3364
+ p.src = ((L = n == null ? void 0 : n.prettier) == null ? void 0 : L.standaloneJs) || ze.main, p.id = `${s}-prettier`, y.src = ((S = n == null ? void 0 : n.prettier) == null ? void 0 : S.parserMarkdownJs) || ze.markdown, y.id = `${s}-prettierMD`;
3358
3365
  const $ = document.createElement("link");
3359
- $.rel = "stylesheet", $.href = ((j = n == null ? void 0 : n.cropper) == null ? void 0 : j.css) || Xe.css, $.id = `${s}-cropperCss`;
3366
+ $.rel = "stylesheet", $.href = ((j = n == null ? void 0 : n.cropper) == null ? void 0 : j.css) || Ke.css, $.id = `${s}-cropperCss`;
3360
3367
  const w = document.createElement("script");
3361
- w.src = ((B = n == null ? void 0 : n.cropper) == null ? void 0 : B.js) || Xe.js, w.id = `${s}-cropper`, l || O(k), o || (m || (O($), O(w)), a || O(p), c || O(y));
3368
+ w.src = ((B = n == null ? void 0 : n.cropper) == null ? void 0 : B.js) || Ke.js, w.id = `${s}-cropper`, l || O(k), o || (m || (O($), O(w)), a || O(p), c || O(y));
3362
3369
  });
3363
- }, So = (e, t) => {
3370
+ }, To = (e, t) => {
3364
3371
  const { editorId: o, previewOnly: l } = e, r = N({
3365
3372
  pageFullscreen: e.pageFullscreen,
3366
3373
  fullscreen: !1,
@@ -3387,11 +3394,11 @@ const Co = {
3387
3394
  }
3388
3395
  }), a = document.body.style.overflow, c();
3389
3396
  }), [r, n];
3390
- }, xo = (e) => {
3397
+ }, So = (e) => {
3391
3398
  const { editorId: t } = e, o = F(!1);
3392
3399
  A(() => {
3393
3400
  C.on(t, {
3394
- name: we,
3401
+ name: $e,
3395
3402
  callback: (r) => {
3396
3403
  r === void 0 ? o.value = !o.value : o.value = r;
3397
3404
  }
@@ -3399,37 +3406,37 @@ const Co = {
3399
3406
  });
3400
3407
  const l = D(() => !e.toolbarsExclude.includes("catalog") && e.toolbars.includes("catalog"));
3401
3408
  return [o, l];
3402
- }, Eo = (e, t, o, l, r) => {
3409
+ }, xo = (e, t, o, l, r) => {
3403
3410
  const { editorId: n } = e;
3404
3411
  T(
3405
3412
  () => l.pageFullscreen,
3406
3413
  (c) => {
3407
- C.emit(n, Qe, c);
3414
+ C.emit(n, Ye, c);
3408
3415
  }
3409
3416
  ), T(
3410
3417
  () => l.fullscreen,
3411
3418
  (c) => {
3412
- C.emit(n, et, c);
3419
+ C.emit(n, Qe, c);
3413
3420
  }
3414
3421
  ), T(
3415
3422
  () => l.preview,
3416
3423
  (c) => {
3417
- C.emit(n, ve, c);
3424
+ C.emit(n, he, c);
3418
3425
  }
3419
3426
  ), T(
3420
3427
  () => l.htmlPreview,
3421
3428
  (c) => {
3422
- C.emit(n, tt, c);
3429
+ C.emit(n, et, c);
3423
3430
  }
3424
3431
  ), T(o, (c) => {
3425
- C.emit(n, lt, c);
3432
+ C.emit(n, tt, c);
3426
3433
  });
3427
3434
  const a = {
3428
3435
  on(c, m) {
3429
3436
  switch (c) {
3430
3437
  case "pageFullscreen": {
3431
3438
  C.on(n, {
3432
- name: Qe,
3439
+ name: Ye,
3433
3440
  callback(u) {
3434
3441
  m(u);
3435
3442
  }
@@ -3438,7 +3445,7 @@ const Co = {
3438
3445
  }
3439
3446
  case "fullscreen": {
3440
3447
  C.on(n, {
3441
- name: et,
3448
+ name: Qe,
3442
3449
  callback(u) {
3443
3450
  m(u);
3444
3451
  }
@@ -3447,7 +3454,7 @@ const Co = {
3447
3454
  }
3448
3455
  case "preview": {
3449
3456
  C.on(n, {
3450
- name: ve,
3457
+ name: he,
3451
3458
  callback(u) {
3452
3459
  m(u);
3453
3460
  }
@@ -3456,7 +3463,7 @@ const Co = {
3456
3463
  }
3457
3464
  case "htmlPreview": {
3458
3465
  C.on(n, {
3459
- name: tt,
3466
+ name: et,
3460
3467
  callback(u) {
3461
3468
  m(u);
3462
3469
  }
@@ -3465,7 +3472,7 @@ const Co = {
3465
3472
  }
3466
3473
  case "catalog": {
3467
3474
  C.on(n, {
3468
- name: lt,
3475
+ name: tt,
3469
3476
  callback(u) {
3470
3477
  m(u);
3471
3478
  }
@@ -3478,7 +3485,7 @@ const Co = {
3478
3485
  r("pageFullscreen", c);
3479
3486
  },
3480
3487
  toggleFullscreen(c) {
3481
- C.emit(n, $t, c);
3488
+ C.emit(n, Ct, c);
3482
3489
  },
3483
3490
  togglePreview(c) {
3484
3491
  r("preview", c);
@@ -3487,20 +3494,20 @@ const Co = {
3487
3494
  r("htmlPreview", c);
3488
3495
  },
3489
3496
  toggleCatalog(c) {
3490
- C.emit(n, we, c);
3497
+ C.emit(n, $e, c);
3491
3498
  },
3492
3499
  triggerSave() {
3493
- C.emit(n, me);
3500
+ C.emit(n, ue);
3494
3501
  },
3495
3502
  insert(c) {
3496
3503
  C.emit(n, "replace", "universal", { generate: c });
3497
3504
  },
3498
3505
  focus() {
3499
- C.emit(n, wt);
3506
+ C.emit(n, $t);
3500
3507
  }
3501
3508
  };
3502
3509
  t.expose(a);
3503
- }, Lo = (e) => e, Ho = {
3510
+ }, Eo = (e) => e, Lo = {
3504
3511
  /**
3505
3512
  * 主题
3506
3513
  *
@@ -3598,7 +3605,7 @@ const Co = {
3598
3605
  */
3599
3606
  toolbars: {
3600
3607
  type: Array,
3601
- default: yt
3608
+ default: kt
3602
3609
  },
3603
3610
  /**
3604
3611
  * 工具栏选择不显示
@@ -3637,7 +3644,7 @@ const Co = {
3637
3644
  */
3638
3645
  editorId: {
3639
3646
  type: String,
3640
- default: zt
3647
+ default: Gt
3641
3648
  },
3642
3649
  /**
3643
3650
  * 一个tab等于空格数
@@ -3680,7 +3687,7 @@ const Co = {
3680
3687
  */
3681
3688
  mdHeadingId: {
3682
3689
  type: Function,
3683
- default: Lo
3690
+ default: Eo
3684
3691
  },
3685
3692
  /**
3686
3693
  * 表格预设格子数
@@ -3755,7 +3762,7 @@ const Co = {
3755
3762
  */
3756
3763
  footers: {
3757
3764
  type: Array,
3758
- default: Ct
3765
+ default: yt
3759
3766
  },
3760
3767
  /**
3761
3768
  * 是否默认激活输入框和预览框同步滚动
@@ -3871,7 +3878,7 @@ const Co = {
3871
3878
  type: Boolean,
3872
3879
  default: !1
3873
3880
  }
3874
- }, Io = [
3881
+ }, Ho = [
3875
3882
  "onChange",
3876
3883
  "onSave",
3877
3884
  "onUploadImg",
@@ -3884,8 +3891,8 @@ const Co = {
3884
3891
  ];
3885
3892
  const G = /* @__PURE__ */ M({
3886
3893
  name: "MdEditorV3",
3887
- props: Ho,
3888
- emits: Io,
3894
+ props: Lo,
3895
+ emits: Ho,
3889
3896
  setup(e, t) {
3890
3897
  const {
3891
3898
  editorId: o,
@@ -3898,11 +3905,11 @@ const G = /* @__PURE__ */ M({
3898
3905
  } = e, u = N({
3899
3906
  scrollAuto: e.scrollAuto
3900
3907
  });
3901
- $o(e, t), wo(e), To(e);
3902
- const [d, f] = So(e, t), [h, v] = xo(e);
3903
- return ye(() => {
3908
+ Co(e, t), $o(e), wo(e);
3909
+ const [d, f] = To(e, t), [h, v] = So(e);
3910
+ return ke(() => {
3904
3911
  C.clear(o);
3905
- }), Eo(e, t, h, d, f), () => {
3912
+ }), xo(e, t, h, d, f), () => {
3906
3913
  var p;
3907
3914
  const b = _({
3908
3915
  props: e,
@@ -3915,7 +3922,7 @@ const G = /* @__PURE__ */ M({
3915
3922
  id: o,
3916
3923
  class: [s, e.class, e.theme === "dark" && `${s}-dark`, d.fullscreen || d.pageFullscreen ? `${s}-fullscreen` : "", l && `${s}-previewOnly`],
3917
3924
  style: e.style
3918
- }, [!l && i(yl, {
3925
+ }, [!l && i(kl, {
3919
3926
  noPrettier: a,
3920
3927
  toolbars: e.toolbars,
3921
3928
  toolbarsExclude: e.toolbarsExclude,
@@ -3924,7 +3931,7 @@ const G = /* @__PURE__ */ M({
3924
3931
  tableShape: e.tableShape,
3925
3932
  defToolbars: b,
3926
3933
  noUploadImg: c
3927
- }, null), i(mo, {
3934
+ }, null), i(uo, {
3928
3935
  value: e.modelValue,
3929
3936
  setting: d,
3930
3937
  mdHeadingId: e.mdHeadingId,
@@ -3956,13 +3963,13 @@ const G = /* @__PURE__ */ M({
3956
3963
  onFocus: (y) => {
3957
3964
  e.onFocus ? e.onFocus(y) : t.emit("onFocus", y);
3958
3965
  }
3959
- }, null), !l && ((p = e.footers) == null ? void 0 : p.length) > 0 && i(ko, {
3966
+ }, null), !l && ((p = e.footers) == null ? void 0 : p.length) > 0 && i(bo, {
3960
3967
  modelValue: e.modelValue,
3961
3968
  footers: e.footers,
3962
3969
  defFooters: k,
3963
3970
  scrollAuto: u.scrollAuto,
3964
3971
  onScrollAutoChange: (y) => u.scrollAuto = y
3965
- }, null), v.value && !l && i(ue, {
3972
+ }, null), v.value && !l && i(ce, {
3966
3973
  theme: e.theme,
3967
3974
  style: {
3968
3975
  display: h.value ? "block" : "none"
@@ -3973,7 +3980,7 @@ const G = /* @__PURE__ */ M({
3973
3980
  }, null)]);
3974
3981
  };
3975
3982
  }
3976
- }), Ao = {
3983
+ }), Io = {
3977
3984
  title: {
3978
3985
  type: String,
3979
3986
  default: ""
@@ -3985,9 +3992,9 @@ const G = /* @__PURE__ */ M({
3985
3992
  onClick: {
3986
3993
  type: Function
3987
3994
  }
3988
- }, pe = /* @__PURE__ */ M({
3995
+ }, ve = /* @__PURE__ */ M({
3989
3996
  name: "NormalToolbar",
3990
- props: Ao,
3997
+ props: Io,
3991
3998
  emits: ["onClick"],
3992
3999
  setup(e, t) {
3993
4000
  return () => {
@@ -4004,7 +4011,7 @@ const G = /* @__PURE__ */ M({
4004
4011
  }, [o]);
4005
4012
  };
4006
4013
  }
4007
- }), Fo = {
4014
+ }), Ao = {
4008
4015
  title: {
4009
4016
  type: String,
4010
4017
  default: ""
@@ -4023,9 +4030,9 @@ const G = /* @__PURE__ */ M({
4023
4030
  overlay: {
4024
4031
  type: [String, Object]
4025
4032
  }
4026
- }, be = /* @__PURE__ */ M({
4033
+ }, pe = /* @__PURE__ */ M({
4027
4034
  name: "DropdownToolbar",
4028
- props: Fo,
4035
+ props: Ao,
4029
4036
  emits: ["onChange"],
4030
4037
  setup(e, t) {
4031
4038
  const o = x("editorId");
@@ -4053,10 +4060,10 @@ const G = /* @__PURE__ */ M({
4053
4060
  };
4054
4061
  }
4055
4062
  });
4056
- function Mo(e) {
4057
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Lt(e);
4063
+ function Fo(e) {
4064
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Et(e);
4058
4065
  }
4059
- const Ro = {
4066
+ const Mo = {
4060
4067
  title: {
4061
4068
  type: String,
4062
4069
  default: ""
@@ -4100,9 +4107,9 @@ const Ro = {
4100
4107
  onAdjust: {
4101
4108
  type: Function
4102
4109
  }
4103
- }, ke = /* @__PURE__ */ M({
4110
+ }, be = /* @__PURE__ */ M({
4104
4111
  name: "ModalToolbar",
4105
- props: Ro,
4112
+ props: Mo,
4106
4113
  emits: ["onClick", "onClose", "onAdjust"],
4107
4114
  setup(e, t) {
4108
4115
  return () => {
@@ -4113,13 +4120,13 @@ const Ro = {
4113
4120
  props: e,
4114
4121
  ctx: t
4115
4122
  }, "default");
4116
- return i(Ce, null, [i("div", {
4123
+ return i(ye, null, [i("div", {
4117
4124
  class: `${s}-toolbar-item`,
4118
4125
  title: e.title,
4119
4126
  onClick: () => {
4120
4127
  e.onClick instanceof Function ? e.onClick() : t.emit("onClick");
4121
4128
  }
4122
- }, [o]), i(Te, {
4129
+ }, [o]), i(we, {
4123
4130
  width: e.width,
4124
4131
  height: e.height,
4125
4132
  title: e.modalTitle,
@@ -4132,18 +4139,18 @@ const Ro = {
4132
4139
  onAdjust: (r) => {
4133
4140
  e.onAdjust instanceof Function ? e.onAdjust(r) : t.emit("onAdjust", r);
4134
4141
  }
4135
- }, Mo(l) ? l : {
4142
+ }, Fo(l) ? l : {
4136
4143
  default: () => [l]
4137
4144
  })]);
4138
4145
  };
4139
4146
  }
4140
4147
  });
4141
- G.install = (e) => (e.component(G.name, G), e.component(pe.name, pe), e.component(be.name, be), e.component(ue.name, ue), e.component(ke.name, ke), e);
4142
- G.NormalToolbar = pe;
4143
- G.DropdownToolbar = be;
4144
- G.MdCatalog = ue;
4145
- G.ModalToolbar = ke;
4146
- G.config = Yt;
4148
+ G.install = (e) => (e.component(G.name, G), e.component(ve.name, ve), e.component(pe.name, pe), e.component(ce.name, ce), e.component(be.name, be), e);
4149
+ G.NormalToolbar = ve;
4150
+ G.DropdownToolbar = pe;
4151
+ G.MdCatalog = ce;
4152
+ G.ModalToolbar = be;
4153
+ G.config = Jt;
4147
4154
  export {
4148
4155
  G as default
4149
4156
  };