md-editor-v3 4.8.0-beta.1 → 4.8.0

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,40 +1,40 @@
1
- var Bt = Object.defineProperty;
2
- var Ft = (e, o, l) => o in e ? Bt(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
3
- var q = (e, o, l) => (Ft(e, typeof o != "symbol" ? o + "" : o, l), l);
4
- import { defineComponent as P, createVNode as t, inject as A, ref as U, onMounted as Y, reactive as G, computed as Te, watch as O, nextTick as he, Fragment as Mt, cloneVNode as mt, toRef as te, shallowRef as Rt, onBeforeUnmount as Lt } from "vue";
5
- import { p as n, e as Q, n as Pt, b as Wt, d as Ut } from "./chunks/config.mjs";
6
- import { draggingScroll as _t, linkTo as qt, debounce as zt, createSmoothScroll as Gt, throttle as Kt } from "@vavt/util";
7
- import { a as se, D as jt } from "./chunks/index2.mjs";
8
- import { b as v, h as Zt, E as le, U as we, i as Xt, j as ye, R as x, c as Yt, O as Dt, k as Et, l as It, T as Jt } from "./chunks/index4.mjs";
9
- import { a as Qt } from "./chunks/dom.mjs";
10
- import { M as Ht, I as y } from "./chunks/index3.mjs";
11
- import { minimalSetup as el, EditorView as ge } from "codemirror";
12
- import { EditorView as xe, placeholder as tl, keymap as ll } from "@codemirror/view";
13
- import { languages as ol } from "@codemirror/language-data";
14
- import { markdown as al } from "@codemirror/lang-markdown";
15
- import { EditorSelection as z, EditorState as ke, Compartment as be, StateEffect as nl } from "@codemirror/state";
16
- import { deleteLine as rl, indentWithTab as il, undo as sl, redo as cl } from "@codemirror/commands";
17
- import { HighlightStyle as Nt, syntaxHighlighting as Ot, indentUnit as ul } from "@codemirror/language";
1
+ var Ft = Object.defineProperty;
2
+ var Rt = (e, o, l) => o in e ? Ft(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
3
+ var q = (e, o, l) => (Rt(e, typeof o != "symbol" ? o + "" : o, l), l);
4
+ import { defineComponent as P, createVNode as t, inject as A, ref as U, onMounted as Y, reactive as G, computed as we, watch as H, nextTick as ve, Fragment as Lt, cloneVNode as gt, toRef as te, shallowRef as Pt, onBeforeUnmount as It } from "vue";
5
+ import { p as n, e as Q, n as Wt, b as Ut, M as ge, d as _t } from "./chunks/config.mjs";
6
+ import { draggingScroll as qt, linkTo as zt, debounce as Gt, createSmoothScroll as Kt, throttle as jt } from "@vavt/util";
7
+ import { a as se, D as Zt } from "./chunks/index2.mjs";
8
+ import { b as v, h as Xt, E as le, U as xe, i as Yt, j as Te, R as x, c as Jt, O as Dt, k as Et, l as Ht, T as Qt } from "./chunks/index4.mjs";
9
+ import { a as el } from "./chunks/dom.mjs";
10
+ import { M as Nt, I as y } from "./chunks/index3.mjs";
11
+ import { minimalSetup as tl, EditorView as fe } from "codemirror";
12
+ import { EditorView as Se, placeholder as ll, keymap as ol } from "@codemirror/view";
13
+ import { languages as al } from "@codemirror/language-data";
14
+ import { markdown as nl } from "@codemirror/lang-markdown";
15
+ import { EditorSelection as z, EditorState as Ce, Compartment as be, StateEffect as il } from "@codemirror/state";
16
+ import { deleteLine as rl, indentWithTab as sl, undo as cl, redo as ul } from "@codemirror/commands";
17
+ import { HighlightStyle as Bt, syntaxHighlighting as Ot, indentUnit as dl } from "@codemirror/language";
18
18
  import { tags as c } from "@lezer/highlight";
19
- import { autocompletion as dl } from "@codemirror/autocomplete";
20
- import { c as ml, C as gl, e as fl, a as bl, u as hl, b as vl, d as kl, f as Cl, g as pl, h as $l, i as yl, M as Tl } from "./chunks/index.mjs";
19
+ import { autocompletion as ml } from "@codemirror/autocomplete";
20
+ import { c as gl, C as fl, e as hl, a as bl, u as vl, b as kl, d as Cl, f as pl, g as $l, h as yl, i as Tl, M as wl } from "./chunks/index.mjs";
21
21
  import Vt from "./MdCatalog.mjs";
22
- import { g as gt } from "./chunks/vue-tsx.mjs";
23
- import wl from "./NormalToolbar.mjs";
24
- import xl from "./ModalToolbar.mjs";
22
+ import { g as ft } from "./chunks/vue-tsx.mjs";
23
+ import xl from "./NormalToolbar.mjs";
24
+ import Sl from "./ModalToolbar.mjs";
25
25
  import "medium-zoom";
26
26
  import "copy-to-clipboard";
27
27
  import "markdown-it";
28
28
  import "markdown-it-image-figures";
29
29
  import "markdown-it-task-lists";
30
30
  import "lru-cache";
31
- const Sl = /* @__PURE__ */ P({
31
+ const Al = /* @__PURE__ */ P({
32
32
  setup() {
33
33
  return () => t("div", {
34
34
  class: `${n}-divider`
35
35
  }, null);
36
36
  }
37
- }), Al = {
37
+ }), Ml = {
38
38
  noPrettier: {
39
39
  type: Boolean
40
40
  },
@@ -83,11 +83,11 @@ const Sl = /* @__PURE__ */ P({
83
83
  showToolbarName: {
84
84
  type: Boolean
85
85
  }
86
- }, Ml = (e) => {
87
- var u, s, f, w;
86
+ }, Ll = (e) => {
87
+ var u, s, h, w;
88
88
  const o = A("editorId");
89
89
  let l = (s = (u = Q.editorExtensions) == null ? void 0 : u.screenfull) == null ? void 0 : s.instance;
90
- const a = (w = (f = Q.editorExtensions) == null ? void 0 : f.screenfull) == null ? void 0 : w.js, r = U(!1), i = (k) => {
90
+ const a = (w = (h = Q.editorExtensions) == null ? void 0 : h.screenfull) == null ? void 0 : w.js, i = U(!1), r = (C) => {
91
91
  if (!l) {
92
92
  v.emit(o, le, {
93
93
  name: "fullscreen",
@@ -95,26 +95,26 @@ const Sl = /* @__PURE__ */ P({
95
95
  });
96
96
  return;
97
97
  }
98
- l.isEnabled ? (r.value = !0, (k === void 0 ? !l.isFullscreen : k) ? l.request() : l.exit()) : console.error("browser does not support screenfull!");
98
+ l.isEnabled ? (i.value = !0, (C === void 0 ? !l.isFullscreen : C) ? l.request() : l.exit()) : console.error("browser does not support screenfull!");
99
99
  }, m = () => {
100
100
  l && l.isEnabled && l.on("change", () => {
101
- (r.value || e.setting.fullscreen) && (r.value = !1, e.updateSetting("fullscreen"));
101
+ (i.value || e.setting.fullscreen) && (i.value = !1, e.updateSetting("fullscreen"));
102
102
  });
103
103
  }, g = () => {
104
104
  l = window.screenfull, m();
105
105
  };
106
106
  return Y(() => {
107
107
  if (m(), !l) {
108
- const k = document.createElement("script");
109
- k.src = a || Pt, k.onload = g, k.id = `${n}-screenfull`, Qt(k, "screenfull");
108
+ const C = document.createElement("script");
109
+ C.src = a || Wt, C.onload = g, C.id = `${n}-screenfull`, el(C, "screenfull");
110
110
  }
111
111
  }), Y(() => {
112
112
  v.on(o, {
113
- name: Zt,
114
- callback: i
113
+ name: Xt,
114
+ callback: r
115
115
  });
116
- }), { fullscreenHandler: i };
117
- }, Ll = {
116
+ }), { fullscreenHandler: r };
117
+ }, Il = {
118
118
  tableShape: {
119
119
  type: Array,
120
120
  default: () => [6, 4]
@@ -126,7 +126,7 @@ const Sl = /* @__PURE__ */ P({
126
126
  }
127
127
  }, Dl = /* @__PURE__ */ P({
128
128
  name: "TableShape",
129
- props: Ll,
129
+ props: Il,
130
130
  setup(e) {
131
131
  const o = G({
132
132
  x: -1,
@@ -140,20 +140,20 @@ const Sl = /* @__PURE__ */ P({
140
140
  }, [new Array(e.tableShape[1]).fill("").map((l, a) => t("div", {
141
141
  class: `${n}-table-shape-row`,
142
142
  key: `table-shape-row-${a}`
143
- }, [new Array(e.tableShape[0]).fill("").map((r, i) => t("div", {
143
+ }, [new Array(e.tableShape[0]).fill("").map((i, r) => t("div", {
144
144
  class: `${n}-table-shape-col`,
145
- key: `table-shape-col-${i}`,
145
+ key: `table-shape-col-${r}`,
146
146
  onMouseenter: () => {
147
- o.x = a, o.y = i;
147
+ o.x = a, o.y = r;
148
148
  },
149
149
  onClick: () => {
150
150
  e.onSelected(o);
151
151
  }
152
152
  }, [t("div", {
153
- class: [`${n}-table-shape-col-default`, a <= o.x && i <= o.y && `${n}-table-shape-col-include`]
153
+ class: [`${n}-table-shape-col-default`, a <= o.x && r <= o.y && `${n}-table-shape-col-include`]
154
154
  }, null)]))]))]);
155
155
  }
156
- }), El = Dl, Il = {
156
+ }), El = Dl, Hl = {
157
157
  type: {
158
158
  type: String,
159
159
  default: "link"
@@ -172,47 +172,47 @@ const Sl = /* @__PURE__ */ P({
172
172
  default: () => {
173
173
  }
174
174
  }
175
- }, Hl = /* @__PURE__ */ P({
176
- props: Il,
175
+ }, Nl = /* @__PURE__ */ P({
176
+ props: Hl,
177
177
  setup(e) {
178
- const o = A("usedLanguageText"), l = A("editorId"), a = Te(() => {
179
- var i, m;
178
+ const o = A("usedLanguageText"), l = A("editorId"), a = we(() => {
179
+ var r, m;
180
180
  switch (e.type) {
181
181
  case "link":
182
- return (i = o.value.linkModalTips) == null ? void 0 : i.linkTitle;
182
+ return (r = o.value.linkModalTips) == null ? void 0 : r.linkTitle;
183
183
  case "image":
184
184
  return (m = o.value.linkModalTips) == null ? void 0 : m.imageTitle;
185
185
  default:
186
186
  return "";
187
187
  }
188
- }), r = G({
188
+ }), i = G({
189
189
  desc: "",
190
190
  url: ""
191
191
  });
192
- return O(() => e.visible, (i) => {
193
- i || setTimeout(() => {
194
- r.desc = "", r.url = "";
192
+ return H(() => e.visible, (r) => {
193
+ r || setTimeout(() => {
194
+ i.desc = "", i.url = "";
195
195
  }, 200);
196
- }), () => t(Ht, {
196
+ }), () => t(Nt, {
197
197
  title: a.value,
198
198
  visible: e.visible,
199
199
  onClose: e.onCancel
200
200
  }, {
201
201
  default: () => {
202
- var i, m, g, u, s;
202
+ var r, m, g, u, s;
203
203
  return [t("div", {
204
204
  class: `${n}-form-item`
205
205
  }, [t("label", {
206
206
  class: `${n}-label`,
207
207
  for: `link-desc-${l}`
208
- }, [(i = o.value.linkModalTips) == null ? void 0 : i.descLabel]), t("input", {
208
+ }, [(r = o.value.linkModalTips) == null ? void 0 : r.descLabel]), t("input", {
209
209
  placeholder: (m = o.value.linkModalTips) == null ? void 0 : m.descLabelPlaceHolder,
210
210
  class: `${n}-input`,
211
211
  id: `link-desc-${l}`,
212
212
  type: "text",
213
- value: r.desc,
214
- onChange: (f) => {
215
- r.desc = f.target.value;
213
+ value: i.desc,
214
+ onChange: (h) => {
215
+ i.desc = h.target.value;
216
216
  },
217
217
  autocomplete: "off"
218
218
  }, null)]), t("div", {
@@ -225,9 +225,9 @@ const Sl = /* @__PURE__ */ P({
225
225
  class: `${n}-input`,
226
226
  id: `link-url-${l}`,
227
227
  type: "text",
228
- value: r.url,
229
- onChange: (f) => {
230
- r.url = f.target.value;
228
+ value: i.url,
229
+ onChange: (h) => {
230
+ i.url = h.target.value;
231
231
  },
232
232
  autocomplete: "off"
233
233
  }, null)]), t("div", {
@@ -236,13 +236,13 @@ const Sl = /* @__PURE__ */ P({
236
236
  class: [`${n}-btn`, `${n}-btn-row`],
237
237
  type: "button",
238
238
  onClick: () => {
239
- e.onOk(r), r.desc = "", r.url = "";
239
+ e.onOk(i), i.desc = "", i.url = "";
240
240
  }
241
241
  }, [(s = o.value.linkModalTips) == null ? void 0 : s.buttonOK])])];
242
242
  }
243
243
  });
244
244
  }
245
- }), Nl = {
245
+ }), Bl = {
246
246
  visible: {
247
247
  type: Boolean,
248
248
  default: !1
@@ -258,12 +258,12 @@ const Sl = /* @__PURE__ */ P({
258
258
  }
259
259
  }
260
260
  }, Ol = /* @__PURE__ */ P({
261
- props: Nl,
261
+ props: Bl,
262
262
  setup(e) {
263
- var f, w, k;
263
+ var h, w, C;
264
264
  const o = A("usedLanguageText"), l = A("editorId");
265
- let a = (k = (w = (f = Q) == null ? void 0 : f.editorExtensions) == null ? void 0 : w.cropper) == null ? void 0 : k.instance;
266
- const r = U(), i = U(), m = U(), g = G({
265
+ let a = (C = (w = (h = Q) == null ? void 0 : h.editorExtensions) == null ? void 0 : w.cropper) == null ? void 0 : C.instance;
266
+ const i = U(), r = U(), m = U(), g = G({
267
267
  cropperInited: !1,
268
268
  imgSelected: !1,
269
269
  imgSrc: "",
@@ -271,8 +271,8 @@ const Sl = /* @__PURE__ */ P({
271
271
  isFullscreen: !1
272
272
  });
273
273
  let u = null;
274
- O(() => e.visible, () => {
275
- e.visible && !g.cropperInited && (a = a || window.Cropper, r.value.onchange = () => {
274
+ H(() => e.visible, () => {
275
+ e.visible && !g.cropperInited && (a = a || window.Cropper, i.value.onchange = () => {
276
276
  if (!a) {
277
277
  v.emit(l, le, {
278
278
  name: "Cropper",
@@ -280,25 +280,25 @@ const Sl = /* @__PURE__ */ P({
280
280
  });
281
281
  return;
282
282
  }
283
- const d = r.value.files || [];
283
+ const d = i.value.files || [];
284
284
  if (g.imgSelected = !0, (d == null ? void 0 : d.length) > 0) {
285
- const C = new FileReader();
286
- C.onload = (h) => {
287
- g.imgSrc = h.target.result, he(() => {
288
- u = new a(i.value, {
285
+ const k = new FileReader();
286
+ k.onload = (f) => {
287
+ g.imgSrc = f.target.result, ve(() => {
288
+ u = new a(r.value, {
289
289
  viewMode: 2,
290
290
  preview: `.${n}-clip-preview-target`
291
291
  // aspectRatio: 16 / 9,
292
292
  });
293
293
  });
294
- }, C.readAsDataURL(d[0]);
294
+ }, k.readAsDataURL(d[0]);
295
295
  }
296
296
  });
297
- }), O(() => [g.imgSelected], () => {
297
+ }), H(() => [g.imgSelected], () => {
298
298
  m.value.style = "";
299
- }), O(() => g.isFullscreen, () => {
300
- he(() => {
301
- u == null || u.destroy(), m.value.style = "", i.value && (u = new a(i.value, {
299
+ }), H(() => g.isFullscreen, () => {
300
+ ve(() => {
301
+ u == null || u.destroy(), m.value.style = "", r.value && (u = new a(r.value, {
302
302
  viewMode: 2,
303
303
  preview: `.${n}-clip-preview-target`
304
304
  // aspectRatio: 16 / 9,
@@ -306,25 +306,25 @@ const Sl = /* @__PURE__ */ P({
306
306
  });
307
307
  });
308
308
  const s = () => {
309
- u.clear(), u.destroy(), u = null, r.value.value = "", g.imgSelected = !1;
309
+ u.clear(), u.destroy(), u = null, i.value.value = "", g.imgSelected = !1;
310
310
  };
311
311
  return () => {
312
312
  var d;
313
- return t(Ht, {
313
+ return t(Nt, {
314
314
  class: `${n}-modal-clip`,
315
315
  title: (d = o.value.clipModalTips) == null ? void 0 : d.title,
316
316
  visible: e.visible,
317
317
  onClose: e.onCancel,
318
318
  showAdjust: !0,
319
319
  isFullscreen: g.isFullscreen,
320
- onAdjust: (C) => {
321
- g.isFullscreen = C;
320
+ onAdjust: (k) => {
321
+ g.isFullscreen = k;
322
322
  },
323
323
  width: "668px",
324
324
  height: "421px"
325
325
  }, {
326
326
  default: () => {
327
- var C, h;
327
+ var k, f;
328
328
  return [t("div", {
329
329
  class: `${n}-form-item ${n}-clip`
330
330
  }, [t("div", {
@@ -333,7 +333,7 @@ const Sl = /* @__PURE__ */ P({
333
333
  class: `${n}-clip-cropper`
334
334
  }, [t("img", {
335
335
  src: g.imgSrc,
336
- ref: i,
336
+ ref: r,
337
337
  style: {
338
338
  display: "none"
339
339
  },
@@ -346,7 +346,7 @@ const Sl = /* @__PURE__ */ P({
346
346
  }, null)])]) : t("div", {
347
347
  class: `${n}-clip-upload`,
348
348
  onClick: () => {
349
- r.value.click();
349
+ i.value.click();
350
350
  }
351
351
  }, [t(y, {
352
352
  name: "upload"
@@ -363,11 +363,11 @@ const Sl = /* @__PURE__ */ P({
363
363
  onClick: () => {
364
364
  if (u) {
365
365
  const b = u.getCroppedCanvas();
366
- v.emit(l, we, [Xt(b.toDataURL("image/png"))], e.onOk), s();
366
+ v.emit(l, xe, [Yt(b.toDataURL("image/png"))], e.onOk), s();
367
367
  }
368
368
  }
369
- }, [((C = o.value.clipModalTips) == null ? void 0 : C.buttonUpload) || ((h = o.value.linkModalTips) == null ? void 0 : h.buttonOK)])]), t("input", {
370
- ref: r,
369
+ }, [((k = o.value.clipModalTips) == null ? void 0 : k.buttonUpload) || ((f = o.value.linkModalTips) == null ? void 0 : f.buttonOK)])]), t("input", {
370
+ ref: i,
371
371
  accept: "image/*",
372
372
  type: "file",
373
373
  multiple: !1,
@@ -402,10 +402,10 @@ const Sl = /* @__PURE__ */ P({
402
402
  default: () => {
403
403
  }
404
404
  }
405
- }, Bl = /* @__PURE__ */ P({
405
+ }, Fl = /* @__PURE__ */ P({
406
406
  props: Vl,
407
407
  setup(e) {
408
- return () => t(Mt, null, [t(Hl, {
408
+ return () => t(Lt, null, [t(Nl, {
409
409
  type: e.type,
410
410
  visible: e.linkVisible,
411
411
  onOk: e.onOk,
@@ -416,13 +416,13 @@ const Sl = /* @__PURE__ */ P({
416
416
  onCancel: e.onCancel
417
417
  }, null)]);
418
418
  }
419
- }), Fl = /* @__PURE__ */ P({
419
+ }), Rl = /* @__PURE__ */ P({
420
420
  name: "MDEditorToolbar",
421
- props: Al,
421
+ props: Ml,
422
422
  setup(e) {
423
- const o = A("editorId"), l = A("usedLanguageText"), a = A("theme"), r = A("language"), {
424
- fullscreenHandler: i
425
- } = Ml(e), m = `${o}-toolbar-wrapper`, g = U(), u = G({
423
+ const o = A("editorId"), l = A("usedLanguageText"), a = A("theme"), i = A("language"), {
424
+ fullscreenHandler: r
425
+ } = Ll(e), m = `${o}-toolbar-wrapper`, g = U(), u = G({
426
426
  title: !1,
427
427
  catalog: !1,
428
428
  // 图片上传下拉
@@ -434,34 +434,34 @@ const Sl = /* @__PURE__ */ P({
434
434
  katex: !1
435
435
  }), s = (b, p) => {
436
436
  v.emit(o, x, b, p);
437
- }, f = G({
437
+ }, h = G({
438
438
  type: "link",
439
439
  linkVisible: !1,
440
440
  clipVisible: !1
441
441
  }), w = U();
442
442
  Y(() => {
443
443
  v.on(o, {
444
- name: ye,
444
+ name: Te,
445
445
  callback(b) {
446
- f.type = b, f.linkVisible = !0;
446
+ h.type = b, h.linkVisible = !0;
447
447
  }
448
448
  });
449
449
  });
450
- const k = Te(() => {
451
- const b = e.toolbars.filter((D) => !e.toolbarsExclude.includes(D)), p = b.indexOf("="), T = p === -1 ? b : b.slice(0, p + 1), S = p === -1 ? [] : b.slice(p, Number.MAX_SAFE_INTEGER);
450
+ const C = we(() => {
451
+ const b = e.toolbars.filter((I) => !e.toolbarsExclude.includes(I)), p = b.indexOf("="), T = p === -1 ? b : b.slice(0, p + 1), S = p === -1 ? [] : b.slice(p, Number.MAX_SAFE_INTEGER);
452
452
  return [T, S];
453
- }), d = U(), C = () => {
454
- v.emit(o, we, Array.from(d.value.files || [])), d.value.value = "";
453
+ }), d = U(), k = () => {
454
+ v.emit(o, xe, Array.from(d.value.files || [])), d.value.value = "";
455
455
  };
456
456
  Y(() => {
457
- d.value.addEventListener("change", C);
457
+ d.value.addEventListener("change", k);
458
458
  });
459
- const h = (b) => {
460
- var p, T, S, D, E, oe, ae, M, L, _, W, V, H, N, B, K, j, de, ne, J, Z, re, X, F, R, ie, me, Se, Ae, Me, Le, De, Ee, Ie, He, Ne, Oe, Ve, Be, Fe, Re, Pe, We, Ue, _e, qe, ze, Ge, Ke, je, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, rt, it, st, ct, ut, dt;
461
- if (Wt.includes(b))
459
+ const f = (b) => {
460
+ var p, T, S, I, D, oe, ae, M, L, _, W, O, N, B, V, K, j, de, ne, J, Z, ie, X, F, R, re, me, Ae, Me, Le, Ie, De, Ee, He, Ne, Be, Oe, Ve, Fe, Re, Pe, We, Ue, _e, qe, ze, Ge, Ke, je, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, it, rt, st, ct, ut, dt, mt;
461
+ if (Ut.includes(b))
462
462
  switch (b) {
463
463
  case "-":
464
- return t(Sl, null, null);
464
+ return t(Al, null, null);
465
465
  case "bold":
466
466
  return t("div", {
467
467
  class: `${n}-toolbar-item`,
@@ -485,11 +485,11 @@ const Sl = /* @__PURE__ */ P({
485
485
  name: "underline"
486
486
  }, null), e.showToolbarName && t("div", {
487
487
  class: `${n}-toolbar-item-name`
488
- }, [(D = l.value.toolbarTips) == null ? void 0 : D.underline])]);
488
+ }, [(I = l.value.toolbarTips) == null ? void 0 : I.underline])]);
489
489
  case "italic":
490
490
  return t("div", {
491
491
  class: `${n}-toolbar-item`,
492
- title: (E = l.value.toolbarTips) == null ? void 0 : E.italic,
492
+ title: (D = l.value.toolbarTips) == null ? void 0 : D.italic,
493
493
  onClick: () => {
494
494
  s("italic");
495
495
  }
@@ -542,20 +542,20 @@ const Sl = /* @__PURE__ */ P({
542
542
  onClick: () => {
543
543
  s("h4");
544
544
  }
545
- }, [(V = l.value.titleItem) == null ? void 0 : V.h4]), t("li", {
545
+ }, [(O = l.value.titleItem) == null ? void 0 : O.h4]), t("li", {
546
546
  class: `${n}-menu-item ${n}-menu-item-title`,
547
547
  onClick: () => {
548
548
  s("h5");
549
549
  }
550
- }, [(H = l.value.titleItem) == null ? void 0 : H.h5]), t("li", {
550
+ }, [(N = l.value.titleItem) == null ? void 0 : N.h5]), t("li", {
551
551
  class: `${n}-menu-item ${n}-menu-item-title`,
552
552
  onClick: () => {
553
553
  s("h6");
554
554
  }
555
- }, [(N = l.value.titleItem) == null ? void 0 : N.h6])])
555
+ }, [(B = l.value.titleItem) == null ? void 0 : B.h6])])
556
556
  }, {
557
557
  default: () => {
558
- var $, I;
558
+ var $, E;
559
559
  return [t("div", {
560
560
  class: `${n}-toolbar-item`,
561
561
  title: ($ = l.value.toolbarTips) == null ? void 0 : $.title
@@ -563,13 +563,13 @@ const Sl = /* @__PURE__ */ P({
563
563
  name: "title"
564
564
  }, null), e.showToolbarName && t("div", {
565
565
  class: `${n}-toolbar-item-name`
566
- }, [(I = l.value.toolbarTips) == null ? void 0 : I.title])])];
566
+ }, [(E = l.value.toolbarTips) == null ? void 0 : E.title])])];
567
567
  }
568
568
  });
569
569
  case "sub":
570
570
  return t("div", {
571
571
  class: `${n}-toolbar-item`,
572
- title: (B = l.value.toolbarTips) == null ? void 0 : B.sub,
572
+ title: (V = l.value.toolbarTips) == null ? void 0 : V.sub,
573
573
  onClick: () => {
574
574
  s("sub");
575
575
  }
@@ -613,7 +613,7 @@ const Sl = /* @__PURE__ */ P({
613
613
  name: "unordered-list"
614
614
  }, null), e.showToolbarName && t("div", {
615
615
  class: `${n}-toolbar-item-name`
616
- }, [(re = l.value.toolbarTips) == null ? void 0 : re.unorderedList])]);
616
+ }, [(ie = l.value.toolbarTips) == null ? void 0 : ie.unorderedList])]);
617
617
  case "orderedList":
618
618
  return t("div", {
619
619
  class: `${n}-toolbar-item`,
@@ -637,7 +637,7 @@ const Sl = /* @__PURE__ */ P({
637
637
  name: "task"
638
638
  }, null), e.showToolbarName && t("div", {
639
639
  class: `${n}-toolbar-item-name`
640
- }, [(ie = l.value.toolbarTips) == null ? void 0 : ie.task])]);
640
+ }, [(re = l.value.toolbarTips) == null ? void 0 : re.task])]);
641
641
  case "codeRow":
642
642
  return t("div", {
643
643
  class: `${n}-toolbar-item`,
@@ -649,11 +649,11 @@ const Sl = /* @__PURE__ */ P({
649
649
  name: "code-row"
650
650
  }, null), e.showToolbarName && t("div", {
651
651
  class: `${n}-toolbar-item-name`
652
- }, [(Se = l.value.toolbarTips) == null ? void 0 : Se.codeRow])]);
652
+ }, [(Ae = l.value.toolbarTips) == null ? void 0 : Ae.codeRow])]);
653
653
  case "code":
654
654
  return t("div", {
655
655
  class: `${n}-toolbar-item`,
656
- title: (Ae = l.value.toolbarTips) == null ? void 0 : Ae.code,
656
+ title: (Me = l.value.toolbarTips) == null ? void 0 : Me.code,
657
657
  onClick: () => {
658
658
  s("code");
659
659
  }
@@ -661,13 +661,13 @@ const Sl = /* @__PURE__ */ P({
661
661
  name: "code"
662
662
  }, null), e.showToolbarName && t("div", {
663
663
  class: `${n}-toolbar-item-name`
664
- }, [(Me = l.value.toolbarTips) == null ? void 0 : Me.code])]);
664
+ }, [(Le = l.value.toolbarTips) == null ? void 0 : Le.code])]);
665
665
  case "link":
666
666
  return t("div", {
667
667
  class: `${n}-toolbar-item`,
668
- title: (Le = l.value.toolbarTips) == null ? void 0 : Le.link,
668
+ title: (Ie = l.value.toolbarTips) == null ? void 0 : Ie.link,
669
669
  onClick: () => {
670
- f.type = "link", f.linkVisible = !0;
670
+ h.type = "link", h.linkVisible = !0;
671
671
  }
672
672
  }, [t(y, {
673
673
  name: "link"
@@ -679,13 +679,13 @@ const Sl = /* @__PURE__ */ P({
679
679
  class: `${n}-toolbar-item`,
680
680
  title: (Ee = l.value.toolbarTips) == null ? void 0 : Ee.image,
681
681
  onClick: () => {
682
- f.type = "image", f.linkVisible = !0;
682
+ h.type = "image", h.linkVisible = !0;
683
683
  }
684
684
  }, [t(y, {
685
685
  name: "image"
686
686
  }, null), e.showToolbarName && t("div", {
687
687
  class: `${n}-toolbar-item-name`
688
- }, [(Ie = l.value.toolbarTips) == null ? void 0 : Ie.image])]) : t(se, {
688
+ }, [(He = l.value.toolbarTips) == null ? void 0 : He.image])]) : t(se, {
689
689
  relative: `#${m}`,
690
690
  visible: u.image,
691
691
  onChange: ($) => {
@@ -699,22 +699,22 @@ const Sl = /* @__PURE__ */ P({
699
699
  }, [t("li", {
700
700
  class: `${n}-menu-item ${n}-menu-item-image`,
701
701
  onClick: () => {
702
- f.type = "image", f.linkVisible = !0;
702
+ h.type = "image", h.linkVisible = !0;
703
703
  }
704
- }, [(He = l.value.imgTitleItem) == null ? void 0 : He.link]), t("li", {
704
+ }, [(Ne = l.value.imgTitleItem) == null ? void 0 : Ne.link]), t("li", {
705
705
  class: `${n}-menu-item ${n}-menu-item-image`,
706
706
  onClick: () => {
707
707
  d.value.click();
708
708
  }
709
- }, [(Ne = l.value.imgTitleItem) == null ? void 0 : Ne.upload]), t("li", {
709
+ }, [(Be = l.value.imgTitleItem) == null ? void 0 : Be.upload]), t("li", {
710
710
  class: `${n}-menu-item ${n}-menu-item-image`,
711
711
  onClick: () => {
712
- f.clipVisible = !0;
712
+ h.clipVisible = !0;
713
713
  }
714
714
  }, [(Oe = l.value.imgTitleItem) == null ? void 0 : Oe.clip2upload])])
715
715
  }, {
716
716
  default: () => {
717
- var $, I;
717
+ var $, E;
718
718
  return [t("div", {
719
719
  class: `${n}-toolbar-item`,
720
720
  title: ($ = l.value.toolbarTips) == null ? void 0 : $.image
@@ -722,7 +722,7 @@ const Sl = /* @__PURE__ */ P({
722
722
  name: "image"
723
723
  }, null), e.showToolbarName && t("div", {
724
724
  class: `${n}-toolbar-item-name`
725
- }, [(I = l.value.toolbarTips) == null ? void 0 : I.image])])];
725
+ }, [(E = l.value.toolbarTips) == null ? void 0 : E.image])])];
726
726
  }
727
727
  });
728
728
  case "table":
@@ -743,7 +743,7 @@ const Sl = /* @__PURE__ */ P({
743
743
  }, null)
744
744
  }, {
745
745
  default: () => {
746
- var $, I;
746
+ var $, E;
747
747
  return [t("div", {
748
748
  class: `${n}-toolbar-item`,
749
749
  title: ($ = l.value.toolbarTips) == null ? void 0 : $.table
@@ -751,7 +751,7 @@ const Sl = /* @__PURE__ */ P({
751
751
  name: "table"
752
752
  }, null), e.showToolbarName && t("div", {
753
753
  class: `${n}-toolbar-item-name`
754
- }, [(I = l.value.toolbarTips) == null ? void 0 : I.table])])];
754
+ }, [(E = l.value.toolbarTips) == null ? void 0 : E.table])])];
755
755
  }
756
756
  });
757
757
  case "revoke":
@@ -759,17 +759,17 @@ const Sl = /* @__PURE__ */ P({
759
759
  class: `${n}-toolbar-item`,
760
760
  title: (Ve = l.value.toolbarTips) == null ? void 0 : Ve.revoke,
761
761
  onClick: () => {
762
- v.emit(o, It);
762
+ v.emit(o, Ht);
763
763
  }
764
764
  }, [t(y, {
765
765
  name: "revoke"
766
766
  }, null), e.showToolbarName && t("div", {
767
767
  class: `${n}-toolbar-item-name`
768
- }, [(Be = l.value.toolbarTips) == null ? void 0 : Be.revoke])]);
768
+ }, [(Fe = l.value.toolbarTips) == null ? void 0 : Fe.revoke])]);
769
769
  case "next":
770
770
  return t("div", {
771
771
  class: `${n}-toolbar-item`,
772
- title: (Fe = l.value.toolbarTips) == null ? void 0 : Fe.next,
772
+ title: (Re = l.value.toolbarTips) == null ? void 0 : Re.next,
773
773
  onClick: () => {
774
774
  v.emit(o, Et);
775
775
  }
@@ -777,11 +777,11 @@ const Sl = /* @__PURE__ */ P({
777
777
  name: "next"
778
778
  }, null), e.showToolbarName && t("div", {
779
779
  class: `${n}-toolbar-item-name`
780
- }, [(Re = l.value.toolbarTips) == null ? void 0 : Re.next])]);
780
+ }, [(Pe = l.value.toolbarTips) == null ? void 0 : Pe.next])]);
781
781
  case "save":
782
782
  return t("div", {
783
783
  class: `${n}-toolbar-item`,
784
- title: (Pe = l.value.toolbarTips) == null ? void 0 : Pe.save,
784
+ title: (We = l.value.toolbarTips) == null ? void 0 : We.save,
785
785
  onClick: () => {
786
786
  v.emit(o, Dt);
787
787
  }
@@ -789,11 +789,11 @@ const Sl = /* @__PURE__ */ P({
789
789
  name: "baocun"
790
790
  }, null), e.showToolbarName && t("div", {
791
791
  class: `${n}-toolbar-item-name`
792
- }, [(We = l.value.toolbarTips) == null ? void 0 : We.save])]);
792
+ }, [(Ue = l.value.toolbarTips) == null ? void 0 : Ue.save])]);
793
793
  case "prettier":
794
794
  return e.noPrettier ? "" : t("div", {
795
795
  class: `${n}-toolbar-item`,
796
- title: (Ue = l.value.toolbarTips) == null ? void 0 : Ue.prettier,
796
+ title: (_e = l.value.toolbarTips) == null ? void 0 : _e.prettier,
797
797
  onClick: () => {
798
798
  s("prettier");
799
799
  }
@@ -801,11 +801,11 @@ const Sl = /* @__PURE__ */ P({
801
801
  name: "prettier"
802
802
  }, null), e.showToolbarName && t("div", {
803
803
  class: `${n}-toolbar-item-name`
804
- }, [(_e = l.value.toolbarTips) == null ? void 0 : _e.prettier])]);
804
+ }, [(qe = l.value.toolbarTips) == null ? void 0 : qe.prettier])]);
805
805
  case "pageFullscreen":
806
806
  return !e.setting.fullscreen && t("div", {
807
807
  class: `${n}-toolbar-item`,
808
- title: (qe = l.value.toolbarTips) == null ? void 0 : qe.pageFullscreen,
808
+ title: (ze = l.value.toolbarTips) == null ? void 0 : ze.pageFullscreen,
809
809
  onClick: () => {
810
810
  e.updateSetting("pageFullscreen");
811
811
  }
@@ -813,23 +813,23 @@ const Sl = /* @__PURE__ */ P({
813
813
  name: e.setting.pageFullscreen ? "suoxiao" : "fangda"
814
814
  }, null), e.showToolbarName && t("div", {
815
815
  class: `${n}-toolbar-item-name`
816
- }, [(ze = l.value.toolbarTips) == null ? void 0 : ze.pageFullscreen])]);
816
+ }, [(Ge = l.value.toolbarTips) == null ? void 0 : Ge.pageFullscreen])]);
817
817
  case "fullscreen":
818
818
  return t("div", {
819
819
  class: `${n}-toolbar-item`,
820
- title: (Ge = l.value.toolbarTips) == null ? void 0 : Ge.fullscreen,
820
+ title: (Ke = l.value.toolbarTips) == null ? void 0 : Ke.fullscreen,
821
821
  onClick: () => {
822
- i();
822
+ r();
823
823
  }
824
824
  }, [t(y, {
825
825
  name: e.setting.fullscreen ? "fullscreen-exit" : "fullscreen"
826
826
  }, null), e.showToolbarName && t("div", {
827
827
  class: `${n}-toolbar-item-name`
828
- }, [(Ke = l.value.toolbarTips) == null ? void 0 : Ke.fullscreen])]);
828
+ }, [(je = l.value.toolbarTips) == null ? void 0 : je.fullscreen])]);
829
829
  case "preview":
830
830
  return t("div", {
831
831
  class: `${n}-toolbar-item`,
832
- title: (je = l.value.toolbarTips) == null ? void 0 : je.preview,
832
+ title: (Ze = l.value.toolbarTips) == null ? void 0 : Ze.preview,
833
833
  onClick: () => {
834
834
  e.updateSetting("preview");
835
835
  }
@@ -837,11 +837,11 @@ const Sl = /* @__PURE__ */ P({
837
837
  name: "preview"
838
838
  }, null), e.showToolbarName && t("div", {
839
839
  class: `${n}-toolbar-item-name`
840
- }, [(Ze = l.value.toolbarTips) == null ? void 0 : Ze.preview])]);
840
+ }, [(Xe = l.value.toolbarTips) == null ? void 0 : Xe.preview])]);
841
841
  case "htmlPreview":
842
842
  return t("div", {
843
843
  class: `${n}-toolbar-item`,
844
- title: (Xe = l.value.toolbarTips) == null ? void 0 : Xe.htmlPreview,
844
+ title: (Ye = l.value.toolbarTips) == null ? void 0 : Ye.htmlPreview,
845
845
  onClick: () => {
846
846
  e.updateSetting("htmlPreview");
847
847
  }
@@ -849,30 +849,30 @@ const Sl = /* @__PURE__ */ P({
849
849
  name: "coding"
850
850
  }, null), e.showToolbarName && t("div", {
851
851
  class: `${n}-toolbar-item-name`
852
- }, [(Ye = l.value.toolbarTips) == null ? void 0 : Ye.htmlPreview])]);
852
+ }, [(Je = l.value.toolbarTips) == null ? void 0 : Je.htmlPreview])]);
853
853
  case "catalog":
854
854
  return t("div", {
855
855
  class: `${n}-toolbar-item`,
856
- title: (Je = l.value.toolbarTips) == null ? void 0 : Je.catalog,
856
+ title: (Qe = l.value.toolbarTips) == null ? void 0 : Qe.catalog,
857
857
  onClick: () => {
858
- v.emit(o, Yt);
858
+ v.emit(o, Jt);
859
859
  },
860
860
  key: "bar-catalog"
861
861
  }, [t(y, {
862
862
  name: "catalog"
863
863
  }, null), e.showToolbarName && t("div", {
864
864
  class: `${n}-toolbar-item-name`
865
- }, [(Qe = l.value.toolbarTips) == null ? void 0 : Qe.catalog])]);
865
+ }, [(et = l.value.toolbarTips) == null ? void 0 : et.catalog])]);
866
866
  case "github":
867
867
  return t("div", {
868
868
  class: `${n}-toolbar-item`,
869
- title: (et = l.value.toolbarTips) == null ? void 0 : et.github,
870
- onClick: () => qt("https://github.com/imzbf/md-editor-v3")
869
+ title: (tt = l.value.toolbarTips) == null ? void 0 : tt.github,
870
+ onClick: () => zt("https://github.com/imzbf/md-editor-v3")
871
871
  }, [t(y, {
872
872
  name: "github"
873
873
  }, null), e.showToolbarName && t("div", {
874
874
  class: `${n}-toolbar-item-name`
875
- }, [(tt = l.value.toolbarTips) == null ? void 0 : tt.github])]);
875
+ }, [(lt = l.value.toolbarTips) == null ? void 0 : lt.github])]);
876
876
  case "mermaid":
877
877
  return t(se, {
878
878
  relative: `#${m}`,
@@ -890,22 +890,22 @@ const Sl = /* @__PURE__ */ P({
890
890
  onClick: () => {
891
891
  s("flow");
892
892
  }
893
- }, [(lt = l.value.mermaid) == null ? void 0 : lt.flow]), t("li", {
893
+ }, [(ot = l.value.mermaid) == null ? void 0 : ot.flow]), t("li", {
894
894
  class: `${n}-menu-item ${n}-menu-item-mermaid`,
895
895
  onClick: () => {
896
896
  s("sequence");
897
897
  }
898
- }, [(ot = l.value.mermaid) == null ? void 0 : ot.sequence]), t("li", {
898
+ }, [(at = l.value.mermaid) == null ? void 0 : at.sequence]), t("li", {
899
899
  class: `${n}-menu-item ${n}-menu-item-mermaid`,
900
900
  onClick: () => {
901
901
  s("gantt");
902
902
  }
903
- }, [(at = l.value.mermaid) == null ? void 0 : at.gantt]), t("li", {
903
+ }, [(nt = l.value.mermaid) == null ? void 0 : nt.gantt]), t("li", {
904
904
  class: `${n}-menu-item ${n}-menu-item-mermaid`,
905
905
  onClick: () => {
906
906
  s("class");
907
907
  }
908
- }, [(nt = l.value.mermaid) == null ? void 0 : nt.class]), t("li", {
908
+ }, [(it = l.value.mermaid) == null ? void 0 : it.class]), t("li", {
909
909
  class: `${n}-menu-item ${n}-menu-item-mermaid`,
910
910
  onClick: () => {
911
911
  s("state");
@@ -915,21 +915,21 @@ const Sl = /* @__PURE__ */ P({
915
915
  onClick: () => {
916
916
  s("pie");
917
917
  }
918
- }, [(it = l.value.mermaid) == null ? void 0 : it.pie]), t("li", {
918
+ }, [(st = l.value.mermaid) == null ? void 0 : st.pie]), t("li", {
919
919
  class: `${n}-menu-item ${n}-menu-item-mermaid`,
920
920
  onClick: () => {
921
921
  s("relationship");
922
922
  }
923
- }, [(st = l.value.mermaid) == null ? void 0 : st.relationship]), t("li", {
923
+ }, [(ct = l.value.mermaid) == null ? void 0 : ct.relationship]), t("li", {
924
924
  class: `${n}-menu-item ${n}-menu-item-mermaid`,
925
925
  onClick: () => {
926
926
  s("journey");
927
927
  }
928
- }, [(ct = l.value.mermaid) == null ? void 0 : ct.journey])]),
928
+ }, [(ut = l.value.mermaid) == null ? void 0 : ut.journey])]),
929
929
  key: "bar-mermaid"
930
930
  }, {
931
931
  default: () => {
932
- var $, I;
932
+ var $, E;
933
933
  return [t("div", {
934
934
  class: `${n}-toolbar-item`,
935
935
  title: ($ = l.value.toolbarTips) == null ? void 0 : $.mermaid
@@ -937,7 +937,7 @@ const Sl = /* @__PURE__ */ P({
937
937
  name: "mermaid"
938
938
  }, null), e.showToolbarName && t("div", {
939
939
  class: `${n}-toolbar-item-name`
940
- }, [(I = l.value.toolbarTips) == null ? void 0 : I.mermaid])])];
940
+ }, [(E = l.value.toolbarTips) == null ? void 0 : E.mermaid])])];
941
941
  }
942
942
  });
943
943
  case "katex":
@@ -957,16 +957,16 @@ const Sl = /* @__PURE__ */ P({
957
957
  onClick: () => {
958
958
  s("katexInline");
959
959
  }
960
- }, [(ut = l.value.katex) == null ? void 0 : ut.inline]), t("li", {
960
+ }, [(dt = l.value.katex) == null ? void 0 : dt.inline]), t("li", {
961
961
  class: `${n}-menu-item ${n}-menu-item-katex`,
962
962
  onClick: () => {
963
963
  s("katexBlock");
964
964
  }
965
- }, [(dt = l.value.katex) == null ? void 0 : dt.block])]),
965
+ }, [(mt = l.value.katex) == null ? void 0 : mt.block])]),
966
966
  key: "bar-katex"
967
967
  }, {
968
968
  default: () => {
969
- var $, I;
969
+ var $, E;
970
970
  return [t("div", {
971
971
  class: `${n}-toolbar-item`,
972
972
  title: ($ = l.value.toolbarTips) == null ? void 0 : $.katex
@@ -974,44 +974,44 @@ const Sl = /* @__PURE__ */ P({
974
974
  name: "formula"
975
975
  }, null), e.showToolbarName && t("div", {
976
976
  class: `${n}-toolbar-item-name`
977
- }, [(I = l.value.toolbarTips) == null ? void 0 : I.katex])])];
977
+ }, [(E = l.value.toolbarTips) == null ? void 0 : E.katex])])];
978
978
  }
979
979
  });
980
980
  }
981
981
  else if (e.defToolbars instanceof Array) {
982
982
  const $ = e.defToolbars[b];
983
- return $ ? mt($, {
983
+ return $ ? gt($, {
984
984
  theme: a.value,
985
- language: r.value,
986
- insert(ve) {
985
+ language: i.value,
986
+ insert(ke) {
987
987
  v.emit(o, x, "universal", {
988
- generate: ve
988
+ generate: ke
989
989
  });
990
990
  }
991
991
  }) : "";
992
992
  } else if (e.defToolbars && e.defToolbars.children instanceof Array) {
993
993
  const $ = e.defToolbars.children[b];
994
- return $ ? mt($, {
994
+ return $ ? gt($, {
995
995
  theme: a.value,
996
- language: r.value,
997
- insert(ve) {
996
+ language: i.value,
997
+ insert(ke) {
998
998
  v.emit(o, x, "universal", {
999
- generate: ve
999
+ generate: ke
1000
1000
  });
1001
1001
  }
1002
1002
  }) : "";
1003
1003
  } else
1004
1004
  return "";
1005
1005
  };
1006
- return O(() => e.toolbars, () => {
1007
- he(() => {
1008
- g.value && _t(g.value);
1006
+ return H(() => e.toolbars, () => {
1007
+ ve(() => {
1008
+ g.value && qt(g.value);
1009
1009
  });
1010
1010
  }, {
1011
1011
  immediate: !0
1012
1012
  }), () => {
1013
- const b = k.value[0].map((T) => h(T)), p = k.value[1].map((T) => h(T));
1014
- return t(Mt, null, [e.toolbars.length > 0 && t("div", {
1013
+ const b = C.value[0].map((T) => f(T)), p = C.value[1].map((T) => f(T));
1014
+ return t(Lt, null, [e.toolbars.length > 0 && t("div", {
1015
1015
  class: `${n}-toolbar-wrapper`,
1016
1016
  ref: g,
1017
1017
  id: m
@@ -1030,28 +1030,28 @@ const Sl = /* @__PURE__ */ P({
1030
1030
  style: {
1031
1031
  display: "none"
1032
1032
  }
1033
- }, null), t(Bl, {
1034
- linkVisible: f.linkVisible,
1035
- clipVisible: f.clipVisible,
1036
- type: f.type,
1033
+ }, null), t(Fl, {
1034
+ linkVisible: h.linkVisible,
1035
+ clipVisible: h.clipVisible,
1036
+ type: h.type,
1037
1037
  onCancel: () => {
1038
- f.linkVisible = !1, f.clipVisible = !1;
1038
+ h.linkVisible = !1, h.clipVisible = !1;
1039
1039
  },
1040
1040
  onOk: (T) => {
1041
- T && s(f.type, {
1041
+ T && s(h.type, {
1042
1042
  desc: T.desc,
1043
1043
  url: T.url
1044
- }), f.linkVisible = !1, f.clipVisible = !1;
1044
+ }), h.linkVisible = !1, h.clipVisible = !1;
1045
1045
  }
1046
1046
  }, null)]);
1047
1047
  };
1048
1048
  }
1049
- }), Rl = (e, o) => {
1050
- const l = zt(() => {
1049
+ }), Pl = (e, o) => {
1050
+ const l = Gt(() => {
1051
1051
  e.removeEventListener("scroll", a), e.addEventListener("scroll", a), o.removeEventListener("scroll", a), o.addEventListener("scroll", a);
1052
- }, 50), a = (r) => {
1053
- const i = e.clientHeight, m = o.clientHeight, g = e.scrollHeight, u = o.scrollHeight, s = (g - i) / (u - m);
1054
- r.target === e ? (o.removeEventListener("scroll", a), o.scrollTo({
1052
+ }, 50), a = (i) => {
1053
+ const r = e.clientHeight, m = o.clientHeight, g = e.scrollHeight, u = o.scrollHeight, s = (g - r) / (u - m);
1054
+ i.target === e ? (o.removeEventListener("scroll", a), o.scrollTo({
1055
1055
  top: e.scrollTop / s
1056
1056
  // behavior: 'smooth'
1057
1057
  }), l()) : (e.removeEventListener("scroll", a), e.scrollTo({
@@ -1069,101 +1069,101 @@ const Sl = /* @__PURE__ */ P({
1069
1069
  e.removeEventListener("scroll", a), o.removeEventListener("scroll", a);
1070
1070
  }
1071
1071
  ];
1072
- }, Pl = (e, o, l) => {
1073
- const { view: a } = l, r = Gt(), i = (k) => a.lineBlockAt(a.state.doc.line(k).from).top, m = (k) => a.lineBlockAt(a.state.doc.line(k).from).height;
1072
+ }, Wl = (e, o, l) => {
1073
+ const { view: a } = l, i = Kt(), r = (C) => a.lineBlockAt(a.state.doc.line(C).from).top, m = (C) => a.lineBlockAt(a.state.doc.line(C).from).height;
1074
1074
  let g = [];
1075
1075
  const u = () => {
1076
1076
  g = [];
1077
- const k = Array.from(o.querySelectorAll("[data-line]")).map(
1077
+ const C = Array.from(o.querySelectorAll("[data-line]")).map(
1078
1078
  (b) => Number(b.dataset.line) + 1
1079
1079
  ), { lines: d } = a.state.doc;
1080
- let C = 1, h = k.shift() ?? d;
1080
+ let k = 1, f = C.shift() ?? d;
1081
1081
  for (let b = 1; b <= d; b++)
1082
- b === h && (C = b, h = k.shift() || d + 1), g.push({
1083
- start: C,
1084
- end: h - 1
1082
+ b === f && (k = b, f = C.shift() || d + 1), g.push({
1083
+ start: k,
1084
+ end: f - 1
1085
1085
  });
1086
1086
  };
1087
- let s = 0, f = 0;
1088
- const w = Kt((k) => {
1089
- var p, T, S, D, E, oe, ae;
1087
+ let s = 0, h = 0;
1088
+ const w = jt((C) => {
1089
+ var p, T, S, I, D, oe, ae;
1090
1090
  if (!((p = o.firstElementChild) != null && p.firstElementChild))
1091
1091
  return;
1092
- const d = a.lineBlockAtHeight(a.scrollDOM.scrollTop), { number: C } = a.state.doc.lineAt(d.from);
1093
- if (C > g.length || a.state.doc.lines < g[g.length - 1].end)
1092
+ const d = a.lineBlockAtHeight(a.scrollDOM.scrollTop), { number: k } = a.state.doc.lineAt(d.from);
1093
+ if (k > g.length || a.state.doc.lines < g[g.length - 1].end)
1094
1094
  return;
1095
- let h = +getComputedStyle(o).paddingTop.replace("px", "");
1095
+ let f = +getComputedStyle(o).paddingTop.replace("px", "");
1096
1096
  const b = +getComputedStyle(o).paddingBottom.replace("px", "");
1097
- if (k.target === e) {
1098
- if (f !== 0)
1097
+ if (C.target === e) {
1098
+ if (h !== 0)
1099
1099
  return;
1100
1100
  s++;
1101
- const M = g[C - 1];
1102
- let L = i(M.end) + m(M.end), _ = 0;
1103
- const W = i(M.start), V = o.querySelector(`[data-line="${M.start - 1}"]`) || ((T = o.firstElementChild) == null ? void 0 : T.firstElementChild), H = o.querySelector(`[data-line="${M.end}"]`) || ((S = o.lastElementChild) == null ? void 0 : S.lastElementChild);
1104
- let N = 0, B = 0;
1105
- W === 0 ? V === H ? (h = 0, L = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight, _ = a.scrollDOM.scrollTop / L, N = H.offsetTop + H.offsetHeight - o.clientHeight) : (_ = a.scrollDOM.scrollTop / L, N = H.offsetTop) : L > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (_ = (a.scrollDOM.scrollTop - W) / (a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight - W), B = V.offsetTop, N = o.scrollHeight - o.clientHeight - B + 10) : (_ = (a.scrollDOM.scrollTop - W) / (L - W), B = V.offsetTop, N = H.offsetTop - B);
1106
- const K = B - h + N * _;
1107
- r(o, K, () => {
1101
+ const M = g[k - 1];
1102
+ let L = r(M.end) + m(M.end), _ = 0;
1103
+ const W = r(M.start), O = o.querySelector(`[data-line="${M.start - 1}"]`) || ((T = o.firstElementChild) == null ? void 0 : T.firstElementChild), N = o.querySelector(`[data-line="${M.end}"]`) || ((S = o.lastElementChild) == null ? void 0 : S.lastElementChild);
1104
+ let B = 0, V = 0;
1105
+ W === 0 ? O === N ? (f = 0, L = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight, _ = a.scrollDOM.scrollTop / L, B = N.offsetTop + N.offsetHeight - o.clientHeight) : (_ = a.scrollDOM.scrollTop / L, B = N.offsetTop) : L > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (_ = (a.scrollDOM.scrollTop - W) / (a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight - W), V = O.offsetTop, B = o.scrollHeight - o.clientHeight - V + 10) : (_ = (a.scrollDOM.scrollTop - W) / (L - W), V = O.offsetTop, B = N.offsetTop - V);
1106
+ const K = V - f + B * _;
1107
+ i(o, K, () => {
1108
1108
  s--;
1109
1109
  });
1110
1110
  } else {
1111
1111
  if (s !== 0)
1112
1112
  return;
1113
- f++;
1113
+ h++;
1114
1114
  const M = Array.from(
1115
1115
  o.querySelectorAll("[data-line]")
1116
1116
  ), L = o.scrollTop, _ = o.scrollHeight;
1117
1117
  let W = M.length === 0 ? 1 : Math.ceil(
1118
1118
  Number(M[M.length - 1].dataset.line) * (L / _)
1119
- ), V = (D = o.firstElementChild) == null ? void 0 : D.firstElementChild;
1119
+ ), O = (I = o.firstElementChild) == null ? void 0 : I.firstElementChild;
1120
1120
  for (let F = W; F >= 0; F--) {
1121
1121
  const R = o.querySelector(`[data-line="${F}"]`);
1122
1122
  if (R && R.offsetTop <= L) {
1123
- V = R, W = F;
1123
+ O = R, W = F;
1124
1124
  break;
1125
1125
  }
1126
1126
  }
1127
- let H = (E = o.firstElementChild) == null ? void 0 : E.firstElementChild, N = (oe = o.firstElementChild) == null ? void 0 : oe.lastElementChild;
1127
+ let N = (D = o.firstElementChild) == null ? void 0 : D.firstElementChild, B = (oe = o.firstElementChild) == null ? void 0 : oe.lastElementChild;
1128
1128
  for (; M.length > 0; ) {
1129
- const F = M.indexOf(V);
1129
+ const F = M.indexOf(O);
1130
1130
  if (F + 1 >= M.length)
1131
1131
  break;
1132
1132
  const R = M[F + 1];
1133
1133
  if (F === -1) {
1134
- N = R;
1134
+ B = R;
1135
1135
  break;
1136
1136
  }
1137
- const ie = V.offsetTop;
1138
- if (ie > L) {
1137
+ const re = O.offsetTop;
1138
+ if (re > L) {
1139
1139
  if (F === 0) {
1140
- H = V, N = R;
1140
+ N = O, B = R;
1141
1141
  break;
1142
1142
  }
1143
- V = M[F - 1];
1143
+ O = M[F - 1];
1144
1144
  continue;
1145
1145
  }
1146
1146
  const me = R.offsetTop;
1147
- if (ie <= L && me > L) {
1148
- H = V, N = R;
1147
+ if (re <= L && me > L) {
1148
+ N = O, B = R;
1149
1149
  break;
1150
1150
  }
1151
- V = R;
1151
+ O = R;
1152
1152
  }
1153
- const B = H.offsetTop;
1154
- let K = N.offsetTop, j = 0;
1155
- const { start: de, end: ne } = g[Number(H.dataset.line || 0)], J = i(de);
1156
- let Z = i(ne);
1157
- const re = m(ne);
1153
+ const V = N.offsetTop;
1154
+ let K = B.offsetTop, j = 0;
1155
+ const { start: de, end: ne } = g[Number(N.dataset.line || 0)], J = r(de);
1156
+ let Z = r(ne);
1157
+ const ie = m(ne);
1158
1158
  let X = 0;
1159
- H === ((ae = o.firstElementChild) == null ? void 0 : ae.firstElementChild) ? (H === N ? (K = N.offsetHeight - o.offsetHeight + h + b, X = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight) : X = Z + re - J, j = Math.max(L / K, 0)) : Z > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (j = Math.max(
1160
- (L - B) / (o.scrollHeight - B - o.clientHeight),
1159
+ N === ((ae = o.firstElementChild) == null ? void 0 : ae.firstElementChild) ? (N === B ? (K = B.offsetHeight - o.offsetHeight + f + b, X = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight) : X = Z + ie - J, j = Math.max(L / K, 0)) : Z > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (j = Math.max(
1160
+ (L - V) / (o.scrollHeight - V - o.clientHeight),
1161
1161
  0
1162
- ), Z = i(a.state.doc.lines) + m(a.state.doc.lines), X = 8 + Z - J - e.clientHeight) : (j = Math.max(
1163
- (L - B) / (K - B),
1162
+ ), Z = r(a.state.doc.lines) + m(a.state.doc.lines), X = 8 + Z - J - e.clientHeight) : (j = Math.max(
1163
+ (L - V) / (K - V),
1164
1164
  0
1165
- ), X = Z + re - J), r(e, J + X * j, () => {
1166
- f--;
1165
+ ), X = Z + ie - J), i(e, J + X * j, () => {
1166
+ h--;
1167
1167
  });
1168
1168
  }
1169
1169
  }, 10);
@@ -1175,13 +1175,13 @@ const Sl = /* @__PURE__ */ P({
1175
1175
  g = [], e.removeEventListener("scroll", w), o.removeEventListener("scroll", w);
1176
1176
  }
1177
1177
  ];
1178
- }, Wl = (e, o, l) => {
1178
+ }, Ul = (e, o, l) => {
1179
1179
  const a = A("editorId");
1180
- let r = () => {
1181
- }, i = () => {
1180
+ let i = () => {
1181
+ }, r = () => {
1182
1182
  };
1183
1183
  const m = () => {
1184
- r();
1184
+ i();
1185
1185
  const g = document.querySelector(
1186
1186
  `#${a} .cm-scroller`
1187
1187
  ), u = document.querySelector(
@@ -1189,13 +1189,13 @@ const Sl = /* @__PURE__ */ P({
1189
1189
  ), s = document.querySelector(
1190
1190
  `[id="${a}-html-wrapper"][data-show="true"]`
1191
1191
  );
1192
- (u || s) && ([i, r] = (u ? Pl : Rl)(
1192
+ (u || s) && ([r, i] = (u ? Wl : Pl)(
1193
1193
  g,
1194
1194
  u || s,
1195
1195
  l.value
1196
- )), e.scrollAuto && i();
1196
+ )), e.scrollAuto && r();
1197
1197
  };
1198
- O(
1198
+ H(
1199
1199
  [
1200
1200
  o,
1201
1201
  te(e.setting, "preview"),
@@ -1204,24 +1204,24 @@ const Sl = /* @__PURE__ */ P({
1204
1204
  te(e.setting, "pageFullscreen")
1205
1205
  ],
1206
1206
  () => {
1207
- he(m);
1207
+ ve(m);
1208
1208
  }
1209
- ), O(
1209
+ ), H(
1210
1210
  () => e.scrollAuto,
1211
1211
  (g) => {
1212
- g ? i() : r();
1212
+ g ? r() : i();
1213
1213
  }
1214
1214
  ), Y(m);
1215
- }, Ul = Wl, _l = (e, o, l) => {
1216
- var f, w, k, d, C, h;
1217
- let a = "", r = 0, i = 0, m = !0, g = !1;
1218
- const u = o.getSelectedText(), s = (f = Q.editorConfig) == null ? void 0 : f.mermaidTemplate;
1215
+ }, _l = Ul, ql = (e, o, l) => {
1216
+ var h, w, C, d, k, f;
1217
+ let a = "", i = 0, r = 0, m = !0, g = !1;
1218
+ const u = o.getSelectedText(), s = (h = Q.editorConfig) == null ? void 0 : h.mermaidTemplate;
1219
1219
  if (/^h[1-6]{1}$/.test(e)) {
1220
1220
  const b = e.replace(/^h(\d)/, (p, T) => new Array(Number(T)).fill("#", 0, T).join(""));
1221
- a = `${b} ${u}`, r = b.length + 1;
1221
+ a = `${b} ${u}`, i = b.length + 1;
1222
1222
  } else if (e === "prettier") {
1223
- const b = window.prettier || ((k = (w = Q.editorExtensions) == null ? void 0 : w.prettier) == null ? void 0 : k.prettierInstance), p = [
1224
- ((d = window.prettierPlugins) == null ? void 0 : d.markdown) || ((h = (C = Q.editorExtensions) == null ? void 0 : C.prettier) == null ? void 0 : h.parserMarkdownInstance)
1223
+ const b = window.prettier || ((C = (w = Q.editorExtensions) == null ? void 0 : w.prettier) == null ? void 0 : C.prettierInstance), p = [
1224
+ ((d = window.prettierPlugins) == null ? void 0 : d.markdown) || ((f = (k = Q.editorExtensions) == null ? void 0 : k.prettier) == null ? void 0 : f.parserMarkdownInstance)
1225
1225
  ];
1226
1226
  !b || p[0] === void 0 ? (v.emit(l.editorId, le, {
1227
1227
  name: "prettier",
@@ -1233,47 +1233,47 @@ const Sl = /* @__PURE__ */ P({
1233
1233
  } else
1234
1234
  switch (e) {
1235
1235
  case "bold": {
1236
- a = `**${u}**`, r = 2, i = -2;
1236
+ a = `**${u}**`, i = 2, r = -2;
1237
1237
  break;
1238
1238
  }
1239
1239
  case "underline": {
1240
- a = `<u>${u}</u>`, r = 3, i = -4;
1240
+ a = `<u>${u}</u>`, i = 3, r = -4;
1241
1241
  break;
1242
1242
  }
1243
1243
  case "italic": {
1244
- a = `*${u}*`, r = 1, i = -1;
1244
+ a = `*${u}*`, i = 1, r = -1;
1245
1245
  break;
1246
1246
  }
1247
1247
  case "strikeThrough": {
1248
- a = `~~${u}~~`, r = 2, i = -2;
1248
+ a = `~~${u}~~`, i = 2, r = -2;
1249
1249
  break;
1250
1250
  }
1251
1251
  case "sub": {
1252
- a = `<sub>${u}</sub>`, r = 5, i = -6;
1252
+ a = `<sub>${u}</sub>`, i = 5, r = -6;
1253
1253
  break;
1254
1254
  }
1255
1255
  case "sup": {
1256
- a = `<sup>${u}</sup>`, r = 5, i = -6;
1256
+ a = `<sup>${u}</sup>`, i = 5, r = -6;
1257
1257
  break;
1258
1258
  }
1259
1259
  case "codeRow": {
1260
- a = "`" + u + "`", r = 1, i = -1;
1260
+ a = "`" + u + "`", i = 1, r = -1;
1261
1261
  break;
1262
1262
  }
1263
1263
  case "quote": {
1264
- a = `> ${u}`, r = 2;
1264
+ a = `> ${u}`, i = 2;
1265
1265
  break;
1266
1266
  }
1267
1267
  case "orderedList": {
1268
- a = `1. ${u}`, r = 3;
1268
+ a = `1. ${u}`, i = 3;
1269
1269
  break;
1270
1270
  }
1271
1271
  case "unorderedList": {
1272
- a = `- ${u}`, r = 2;
1272
+ a = `- ${u}`, i = 2;
1273
1273
  break;
1274
1274
  }
1275
1275
  case "task": {
1276
- a = `- [ ] ${u}`, r = 6;
1276
+ a = `- [ ] ${u}`, i = 6;
1277
1277
  break;
1278
1278
  }
1279
1279
  case "code": {
@@ -1281,7 +1281,7 @@ const Sl = /* @__PURE__ */ P({
1281
1281
  a = `\`\`\`${p}
1282
1282
  ${b}
1283
1283
  \`\`\`
1284
- `, r = 3, i = 3 + p.length - a.length;
1284
+ `, i = 3, r = 3 + p.length - a.length;
1285
1285
  break;
1286
1286
  }
1287
1287
  case "table": {
@@ -1296,10 +1296,10 @@ ${b}
1296
1296
  for (let S = 0; S <= p; S++) {
1297
1297
  a += `
1298
1298
  |`;
1299
- for (let D = 0; D <= T; D++)
1299
+ for (let I = 0; I <= T; I++)
1300
1300
  a += " content |";
1301
1301
  }
1302
- r = 2, i = 5 - a.length;
1302
+ i = 2, r = 5 - a.length;
1303
1303
  break;
1304
1304
  }
1305
1305
  case "link": {
@@ -1309,7 +1309,7 @@ ${b}
1309
1309
  }
1310
1310
  case "image": {
1311
1311
  const { desc: b, url: p, urls: T } = l;
1312
- T instanceof Array ? a = T.reduce((S, D) => S + `![${b}](${D})
1312
+ T instanceof Array ? a = T.reduce((S, I) => S + `![${b}](${I})
1313
1313
  `, "") : a = `![${b}](${p})
1314
1314
  `, m = !1;
1315
1315
  break;
@@ -1319,7 +1319,7 @@ ${b}
1319
1319
  ${(s == null ? void 0 : s.flow) || `flowchart TD
1320
1320
  Start --> Stop`}
1321
1321
  \`\`\`
1322
- `, r = 3, i = 10 - a.length;
1322
+ `, i = 3, r = 10 - a.length;
1323
1323
  break;
1324
1324
  }
1325
1325
  case "sequence": {
@@ -1329,7 +1329,7 @@ ${(s == null ? void 0 : s.sequence) || `sequenceDiagram
1329
1329
  B-->>A: hi!
1330
1330
  A-)B: bye!`}
1331
1331
  \`\`\`
1332
- `, r = 3, i = 10 - a.length;
1332
+ `, i = 3, r = 10 - a.length;
1333
1333
  break;
1334
1334
  }
1335
1335
  case "gantt": {
@@ -1341,7 +1341,7 @@ section Section
1341
1341
  A task :a1, 2014-01-01, 30d
1342
1342
  Another task :after a1, 20d`}
1343
1343
  \`\`\`
1344
- `, r = 3, i = 10 - a.length;
1344
+ `, i = 3, r = 10 - a.length;
1345
1345
  break;
1346
1346
  }
1347
1347
  case "class": {
@@ -1350,7 +1350,7 @@ ${(s == null ? void 0 : s.class) || `classDiagram
1350
1350
  class Animal
1351
1351
  Vehicle <|-- Car`}
1352
1352
  \`\`\`
1353
- `, r = 3, i = 10 - a.length;
1353
+ `, i = 3, r = 10 - a.length;
1354
1354
  break;
1355
1355
  }
1356
1356
  case "state": {
@@ -1358,7 +1358,7 @@ ${(s == null ? void 0 : s.class) || `classDiagram
1358
1358
  ${(s == null ? void 0 : s.state) || `stateDiagram-v2
1359
1359
  s1 --> s2`}
1360
1360
  \`\`\`
1361
- `, r = 3, i = 10 - a.length;
1361
+ `, i = 3, r = 10 - a.length;
1362
1362
  break;
1363
1363
  }
1364
1364
  case "pie": {
@@ -1368,7 +1368,7 @@ ${(s == null ? void 0 : s.pie) || `pie title Pets adopted by volunteers
1368
1368
  "Cats" : 85
1369
1369
  "Rats" : 15`}
1370
1370
  \`\`\`
1371
- `, r = 3, i = 10 - a.length;
1371
+ `, i = 3, r = 10 - a.length;
1372
1372
  break;
1373
1373
  }
1374
1374
  case "relationship": {
@@ -1377,7 +1377,7 @@ ${(s == null ? void 0 : s.relationship) || `erDiagram
1377
1377
  CAR ||--o{ NAMED-DRIVER : allows
1378
1378
  PERSON ||--o{ NAMED-DRIVER : is`}
1379
1379
  \`\`\`
1380
- `, r = 3, i = 10 - a.length;
1380
+ `, i = 3, r = 10 - a.length;
1381
1381
  break;
1382
1382
  }
1383
1383
  case "journey": {
@@ -1392,23 +1392,23 @@ ${(s == null ? void 0 : s.journey) || `journey
1392
1392
  Go downstairs: 5: Me
1393
1393
  Sit down: 5: Me`}
1394
1394
  \`\`\`
1395
- `, r = 3, i = 10 - a.length;
1395
+ `, i = 3, r = 10 - a.length;
1396
1396
  break;
1397
1397
  }
1398
1398
  case "katexInline": {
1399
- a = "$$", r = 1, i = -1;
1399
+ a = "$$", i = 1, r = -1;
1400
1400
  break;
1401
1401
  }
1402
1402
  case "katexBlock": {
1403
1403
  a = `$$
1404
1404
 
1405
1405
  $$
1406
- `, r = 3, i = -4;
1406
+ `, i = 3, r = -4;
1407
1407
  break;
1408
1408
  }
1409
1409
  case "universal": {
1410
1410
  const { generate: b } = l, p = b(u);
1411
- a = p.targetValue, m = p.select, r = p.deviationStart, i = p.deviationEnd;
1411
+ a = p.targetValue, m = p.select, i = p.deviationStart, r = p.deviationEnd;
1412
1412
  }
1413
1413
  }
1414
1414
  return {
@@ -1417,25 +1417,25 @@ $$
1417
1417
  // 是否选中
1418
1418
  select: m,
1419
1419
  // 选中时,开始位置的偏移量
1420
- deviationStart: r,
1420
+ deviationStart: i,
1421
1421
  // 结束的偏移量
1422
- deviationEnd: i,
1422
+ deviationEnd: r,
1423
1423
  // 是否整个替换
1424
1424
  replaceAll: g
1425
1425
  }
1426
1426
  };
1427
- }, ql = "#e5c07b", ft = "var(--md-color)", zl = "#56b6c2", Gl = "#ffffff", ce = "var(--md-color)", bt = "#e5c07b", Kl = "#e5c07b", jl = "var(--md-color)", ht = "#d19a66", Zl = "#c678dd", Xl = "#21252b", Yl = "#2c313a", vt = "var(--md-bk-color)", Ce = "var(--md-bk-color)", Jl = "#ceedfa33", kt = "#528bff", Ql = xe.theme(
1427
+ }, zl = "#e5c07b", ht = "var(--md-color)", Gl = "#56b6c2", Kl = "#ffffff", ce = "var(--md-color)", bt = "#e5c07b", jl = "#e5c07b", Zl = "var(--md-color)", vt = "#d19a66", Xl = "#c678dd", Yl = "#21252b", Jl = "#2c313a", kt = "var(--md-bk-color)", pe = "var(--md-bk-color)", Ql = "#ceedfa33", Ct = "#528bff", eo = Se.theme(
1428
1428
  {
1429
1429
  "&": {
1430
1430
  color: ce,
1431
- backgroundColor: vt
1431
+ backgroundColor: kt
1432
1432
  },
1433
1433
  ".cm-content": {
1434
- caretColor: kt
1434
+ caretColor: Ct
1435
1435
  },
1436
- ".cm-cursor, .cm-dropCursor": { borderLeftColor: kt },
1437
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Jl },
1438
- ".cm-panels": { backgroundColor: Xl, color: ce },
1436
+ ".cm-cursor, .cm-dropCursor": { borderLeftColor: Ct },
1437
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Ql },
1438
+ ".cm-panels": { backgroundColor: Yl, color: ce },
1439
1439
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1440
1440
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1441
1441
  ".cm-searchMatch": {
@@ -1451,13 +1451,13 @@ $$
1451
1451
  backgroundColor: "#bad0f847"
1452
1452
  },
1453
1453
  ".cm-gutters": {
1454
- backgroundColor: vt,
1454
+ backgroundColor: kt,
1455
1455
  color: ce,
1456
1456
  borderRight: "1px solid",
1457
1457
  borderColor: "var(--md-border-color)"
1458
1458
  },
1459
1459
  ".cm-activeLineGutter": {
1460
- backgroundColor: Yl
1460
+ backgroundColor: Jl
1461
1461
  },
1462
1462
  ".cm-foldPlaceholder": {
1463
1463
  backgroundColor: "transparent",
@@ -1466,15 +1466,15 @@ $$
1466
1466
  },
1467
1467
  ".cm-tooltip": {
1468
1468
  border: "1px solid var(--md-border-color)",
1469
- backgroundColor: Ce
1469
+ backgroundColor: pe
1470
1470
  },
1471
1471
  ".cm-tooltip .cm-tooltip-arrow:before": {
1472
1472
  borderTopColor: "transparent",
1473
1473
  borderBottomColor: "transparent"
1474
1474
  },
1475
1475
  ".cm-tooltip .cm-tooltip-arrow:after": {
1476
- borderTopColor: Ce,
1477
- borderBottomColor: Ce
1476
+ borderTopColor: pe,
1477
+ borderBottomColor: pe
1478
1478
  },
1479
1479
  ".cm-tooltip-autocomplete": {
1480
1480
  "& > ul > li[aria-selected]": {
@@ -1483,11 +1483,11 @@ $$
1483
1483
  }
1484
1484
  },
1485
1485
  { dark: !0 }
1486
- ), eo = Nt.define([
1487
- { tag: c.keyword, color: Zl },
1488
- { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: ft },
1489
- { tag: [c.function(c.variableName), c.labelName], color: Kl },
1490
- { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: ht },
1486
+ ), to = Bt.define([
1487
+ { tag: c.keyword, color: Xl },
1488
+ { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: ht },
1489
+ { tag: [c.function(c.variableName), c.labelName], color: jl },
1490
+ { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: vt },
1491
1491
  { tag: [c.definition(c.name), c.separator], color: ce },
1492
1492
  {
1493
1493
  tag: [
@@ -1500,7 +1500,7 @@ $$
1500
1500
  c.self,
1501
1501
  c.namespace
1502
1502
  ],
1503
- color: ql
1503
+ color: zl
1504
1504
  },
1505
1505
  {
1506
1506
  tag: [
@@ -1512,32 +1512,32 @@ $$
1512
1512
  c.link,
1513
1513
  c.special(c.string)
1514
1514
  ],
1515
- color: zl
1515
+ color: Gl
1516
1516
  },
1517
1517
  { tag: [c.meta, c.comment], color: bt },
1518
1518
  { tag: c.strong, fontWeight: "bold" },
1519
1519
  { tag: c.emphasis, fontStyle: "italic" },
1520
1520
  { tag: c.strikethrough, textDecoration: "line-through" },
1521
1521
  { tag: c.link, color: bt, textDecoration: "underline" },
1522
- { tag: c.heading, fontWeight: "bold", color: ft },
1523
- { tag: [c.atom, c.bool, c.special(c.variableName)], color: ht },
1524
- { tag: [c.processingInstruction, c.string, c.inserted], color: jl },
1525
- { tag: c.invalid, color: Gl }
1526
- ]), Ct = [
1527
- Ql,
1528
- Ot(eo)
1529
- ], to = "#e5c07b", pt = "#3f4a54", lo = "#56b6c2", oo = "#fff", ue = "#3f4a54", $t = "#2d8cf0", ao = "#2d8cf0", no = "#3f4a54", yt = "#d19a66", ro = "#c678dd", io = "#21252b", so = "#ceedfa33", Tt = "var(--md-bk-color)", pe = "var(--md-bk-color)", co = "#bad5fa", wt = "#3f4a54", uo = xe.theme(
1522
+ { tag: c.heading, fontWeight: "bold", color: ht },
1523
+ { tag: [c.atom, c.bool, c.special(c.variableName)], color: vt },
1524
+ { tag: [c.processingInstruction, c.string, c.inserted], color: Zl },
1525
+ { tag: c.invalid, color: Kl }
1526
+ ]), pt = [
1527
+ eo,
1528
+ Ot(to)
1529
+ ], lo = "#e5c07b", $t = "#3f4a54", oo = "#56b6c2", ao = "#fff", ue = "#3f4a54", yt = "#2d8cf0", no = "#2d8cf0", io = "#3f4a54", Tt = "#d19a66", ro = "#c678dd", so = "#21252b", co = "#ceedfa33", wt = "var(--md-bk-color)", $e = "var(--md-bk-color)", uo = "#bad5fa", xt = "#3f4a54", mo = Se.theme(
1530
1530
  {
1531
1531
  "&": {
1532
1532
  color: ue,
1533
- backgroundColor: Tt
1533
+ backgroundColor: wt
1534
1534
  },
1535
1535
  ".cm-content": {
1536
- caretColor: wt
1536
+ caretColor: xt
1537
1537
  },
1538
- ".cm-cursor, .cm-dropCursor": { borderLeftColor: wt },
1539
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: co },
1540
- ".cm-panels": { backgroundColor: io, color: ue },
1538
+ ".cm-cursor, .cm-dropCursor": { borderLeftColor: xt },
1539
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: uo },
1540
+ ".cm-panels": { backgroundColor: so, color: ue },
1541
1541
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1542
1542
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1543
1543
  ".cm-searchMatch": {
@@ -1553,13 +1553,13 @@ $$
1553
1553
  backgroundColor: "#bad0f847"
1554
1554
  },
1555
1555
  ".cm-gutters": {
1556
- backgroundColor: Tt,
1556
+ backgroundColor: wt,
1557
1557
  color: ue,
1558
1558
  borderRight: "1px solid",
1559
1559
  borderColor: "var(--md-border-color)"
1560
1560
  },
1561
1561
  ".cm-activeLineGutter": {
1562
- backgroundColor: so
1562
+ backgroundColor: co
1563
1563
  },
1564
1564
  ".cm-foldPlaceholder": {
1565
1565
  backgroundColor: "transparent",
@@ -1568,15 +1568,15 @@ $$
1568
1568
  },
1569
1569
  ".cm-tooltip": {
1570
1570
  border: "1px solid var(--md-border-color)",
1571
- backgroundColor: pe
1571
+ backgroundColor: $e
1572
1572
  },
1573
1573
  ".cm-tooltip .cm-tooltip-arrow:before": {
1574
1574
  borderTopColor: "transparent",
1575
1575
  borderBottomColor: "transparent"
1576
1576
  },
1577
1577
  ".cm-tooltip .cm-tooltip-arrow:after": {
1578
- borderTopColor: pe,
1579
- borderBottomColor: pe
1578
+ borderTopColor: $e,
1579
+ borderBottomColor: $e
1580
1580
  },
1581
1581
  ".cm-tooltip-autocomplete": {
1582
1582
  "& > ul > li[aria-selected]": {
@@ -1585,11 +1585,11 @@ $$
1585
1585
  }
1586
1586
  }
1587
1587
  // { dark: true }
1588
- ), mo = Nt.define([
1588
+ ), go = Bt.define([
1589
1589
  { tag: c.keyword, color: ro },
1590
- { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: pt },
1591
- { tag: [c.function(c.variableName), c.labelName], color: ao },
1592
- { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: yt },
1590
+ { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: $t },
1591
+ { tag: [c.function(c.variableName), c.labelName], color: no },
1592
+ { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: Tt },
1593
1593
  { tag: [c.definition(c.name), c.separator], color: ue },
1594
1594
  {
1595
1595
  tag: [
@@ -1602,7 +1602,7 @@ $$
1602
1602
  c.self,
1603
1603
  c.namespace
1604
1604
  ],
1605
- color: to
1605
+ color: lo
1606
1606
  },
1607
1607
  {
1608
1608
  tag: [
@@ -1614,40 +1614,40 @@ $$
1614
1614
  c.link,
1615
1615
  c.special(c.string)
1616
1616
  ],
1617
- color: lo
1617
+ color: oo
1618
1618
  },
1619
- { tag: [c.meta, c.comment], color: $t },
1619
+ { tag: [c.meta, c.comment], color: yt },
1620
1620
  { tag: c.strong, fontWeight: "bold" },
1621
1621
  { tag: c.emphasis, fontStyle: "italic" },
1622
1622
  { tag: c.strikethrough, textDecoration: "line-through" },
1623
- { tag: c.link, color: $t, textDecoration: "underline" },
1624
- { tag: c.heading, fontWeight: "bold", color: pt },
1625
- { tag: [c.atom, c.bool, c.special(c.variableName)], color: yt },
1626
- { tag: [c.processingInstruction, c.string, c.inserted], color: no },
1627
- { tag: c.invalid, color: oo }
1628
- ]), xt = [
1629
- uo,
1630
- Ot(mo)
1631
- ], fe = (e, o, l, a, r) => (i, m, g, u) => {
1623
+ { tag: c.link, color: yt, textDecoration: "underline" },
1624
+ { tag: c.heading, fontWeight: "bold", color: $t },
1625
+ { tag: [c.atom, c.bool, c.special(c.variableName)], color: Tt },
1626
+ { tag: [c.processingInstruction, c.string, c.inserted], color: io },
1627
+ { tag: c.invalid, color: ao }
1628
+ ]), St = [
1629
+ mo,
1630
+ Ot(go)
1631
+ ], he = (e, o, l, a, i) => (r, m, g, u) => {
1632
1632
  const s = `${e}${o}`.slice(u - g);
1633
- i.dispatch(i.state.replaceSelection(`${s}${l}${a}`));
1634
- const f = g + m.label.length + (r === "title" ? l.length : 0);
1635
- i.dispatch({
1633
+ r.dispatch(r.state.replaceSelection(`${s}${l}${a}`));
1634
+ const h = g + m.label.length + (i === "title" ? l.length : 0);
1635
+ r.dispatch({
1636
1636
  selection: z.create(
1637
1637
  [
1638
1638
  z.range(
1639
- g + m.label.length + (r === "title" ? 1 : -o.length),
1640
- f
1639
+ g + m.label.length + (i === "title" ? 1 : -o.length),
1640
+ h
1641
1641
  ),
1642
- z.cursor(f)
1642
+ z.cursor(h)
1643
1643
  ],
1644
1644
  1
1645
1645
  )
1646
- }), i.focus();
1647
- }, St = (e) => (o, l, a, r) => {
1648
- const i = e.slice(r - a);
1649
- o.dispatch(o.state.replaceSelection(`${i} `));
1650
- }, go = (e) => {
1646
+ }), r.focus();
1647
+ }, At = (e) => (o, l, a, i) => {
1648
+ const r = e.slice(i - a);
1649
+ o.dispatch(o.state.replaceSelection(`${r} `));
1650
+ }, fo = (e) => {
1651
1651
  const o = (l) => {
1652
1652
  const a = l.matchBefore(
1653
1653
  /^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|^\$\$?|!+\s*\w*/
@@ -1656,21 +1656,21 @@ $$
1656
1656
  from: a.from,
1657
1657
  options: [
1658
1658
  // 标题
1659
- ...["h1", "h2", "h3", "h4", "h5", "h6"].map((r, i) => {
1660
- const m = new Array(i + 1).fill("#").join("");
1659
+ ...["h1", "h2", "h3", "h4", "h5", "h6"].map((i, r) => {
1660
+ const m = new Array(r + 1).fill("#").join("");
1661
1661
  return {
1662
1662
  label: m,
1663
1663
  type: "text",
1664
- apply: St(m)
1664
+ apply: At(m)
1665
1665
  };
1666
1666
  }),
1667
1667
  // 任务列表
1668
- ...["unchecked", "checked"].map((r) => {
1669
- const i = r === "checked" ? "- [x]" : "- [ ]";
1668
+ ...["unchecked", "checked"].map((i) => {
1669
+ const r = i === "checked" ? "- [x]" : "- [ ]";
1670
1670
  return {
1671
- label: i,
1671
+ label: r,
1672
1672
  type: "text",
1673
- apply: St(i)
1673
+ apply: At(r)
1674
1674
  };
1675
1675
  }),
1676
1676
  // 代码
@@ -1678,10 +1678,10 @@ $$
1678
1678
  ["`", ""],
1679
1679
  ["```", "language"],
1680
1680
  ["```mermaid\n", ""]
1681
- ].map((r) => ({
1682
- label: `${r[0]}${r[1]}`,
1681
+ ].map((i) => ({
1682
+ label: `${i[0]}${i[1]}`,
1683
1683
  type: "text",
1684
- apply: fe(r[0], r[1], "", r[0] === "`" ? "`" : "\n```", "type")
1684
+ apply: he(i[0], i[1], "", i[0] === "`" ? "`" : "\n```", "type")
1685
1685
  })),
1686
1686
  // 链接
1687
1687
  {
@@ -1706,12 +1706,12 @@ $$
1706
1706
  {
1707
1707
  label: "$",
1708
1708
  type: "text",
1709
- apply: fe("$", "", "", "$", "type")
1709
+ apply: he("$", "", "", "$", "type")
1710
1710
  },
1711
1711
  {
1712
1712
  label: "$$",
1713
1713
  type: "text",
1714
- apply: fe("$$", "", `
1714
+ apply: he("$$", "", `
1715
1715
  `, `
1716
1716
  $$`, "title")
1717
1717
  },
@@ -1733,26 +1733,26 @@ $$`, "title")
1733
1733
  "caution",
1734
1734
  "error",
1735
1735
  "attention"
1736
- ].map((r) => ({
1737
- label: `!!! ${r}`,
1736
+ ].map((i) => ({
1737
+ label: `!!! ${i}`,
1738
1738
  type: "text",
1739
- apply: fe("!!!", ` ${r}`, " Title", `
1739
+ apply: he("!!!", ` ${i}`, " Title", `
1740
1740
 
1741
1741
  !!!`, "title")
1742
1742
  }))
1743
1743
  ]
1744
1744
  };
1745
1745
  };
1746
- return dl({
1746
+ return ml({
1747
1747
  override: e ? [o, ...e] : [o]
1748
1748
  });
1749
- }, At = go, ee = (e) => {
1749
+ }, Mt = fo, ee = (e) => {
1750
1750
  const o = new be();
1751
1751
  return (a) => (o.get(e.state) ? e.dispatch({ effects: o.reconfigure(a) }) : e.dispatch({
1752
- effects: nl.appendConfig.of(o.of(a))
1752
+ effects: il.appendConfig.of(o.of(a))
1753
1753
  }), !0);
1754
1754
  };
1755
- class fo {
1755
+ class ho {
1756
1756
  constructor(o) {
1757
1757
  q(this, "view");
1758
1758
  q(this, "maxLength", Number.MAX_SAFE_INTEGER);
@@ -1818,29 +1818,29 @@ class fo {
1818
1818
  }
1819
1819
  if (this.view.state.doc.length - this.getSelectedText().length + o.length > this.maxLength)
1820
1820
  throw new Error("The input text is too long");
1821
- const { from: r } = this.view.state.selection.main;
1821
+ const { from: i } = this.view.state.selection.main;
1822
1822
  if (this.view.dispatch(this.view.state.replaceSelection(o)), l.select) {
1823
- const i = r + o.length + l.deviationEnd;
1823
+ const r = i + o.length + l.deviationEnd;
1824
1824
  this.view.dispatch({
1825
1825
  selection: z.create(
1826
1826
  [
1827
- z.range(r + l.deviationStart, i),
1828
- z.cursor(i)
1827
+ z.range(i + l.deviationStart, r),
1828
+ z.cursor(r)
1829
1829
  ],
1830
1830
  1
1831
1831
  )
1832
1832
  });
1833
1833
  }
1834
1834
  this.view.focus();
1835
- } catch (r) {
1836
- if (r.message === "The input text is too long")
1835
+ } catch (i) {
1836
+ if (i.message === "The input text is too long")
1837
1837
  v.emit(a, le, {
1838
1838
  name: "overlength",
1839
- message: r.message,
1839
+ message: i.message,
1840
1840
  data: o
1841
1841
  });
1842
1842
  else
1843
- throw r;
1843
+ throw i;
1844
1844
  }
1845
1845
  }
1846
1846
  /**
@@ -1850,8 +1850,8 @@ class fo {
1850
1850
  */
1851
1851
  setTabSize(o) {
1852
1852
  this.toggleTabSize([
1853
- ke.tabSize.of(o),
1854
- ul.of(" ".repeat(o))
1853
+ Ce.tabSize.of(o),
1854
+ dl.of(" ".repeat(o))
1855
1855
  ]);
1856
1856
  }
1857
1857
  /**
@@ -1860,39 +1860,39 @@ class fo {
1860
1860
  * @param t 目标内容
1861
1861
  */
1862
1862
  setPlaceholder(o) {
1863
- this.togglePlaceholder(tl(o));
1863
+ this.togglePlaceholder(ll(o));
1864
1864
  }
1865
1865
  focus(o) {
1866
1866
  if (this.view.focus(), !o)
1867
1867
  return;
1868
- let l = 0, a = 0, r = 0;
1868
+ let l = 0, a = 0, i = 0;
1869
1869
  switch (o) {
1870
1870
  case "start":
1871
1871
  break;
1872
1872
  case "end": {
1873
- l = a = r = this.getValue().length;
1873
+ l = a = i = this.getValue().length;
1874
1874
  break;
1875
1875
  }
1876
1876
  default:
1877
- l = o.rangeAnchor || o.cursorPos, a = o.rangeHead || o.cursorPos, r = o.cursorPos;
1877
+ l = o.rangeAnchor || o.cursorPos, a = o.rangeHead || o.cursorPos, i = o.cursorPos;
1878
1878
  }
1879
1879
  this.view.dispatch({
1880
1880
  scrollIntoView: !0,
1881
1881
  selection: z.create(
1882
- [z.range(l, a), z.cursor(r)],
1882
+ [z.range(l, a), z.cursor(i)],
1883
1883
  1
1884
1884
  )
1885
1885
  });
1886
1886
  }
1887
1887
  setDisabled(o) {
1888
- this.toggleDisabled([xe.editable.of(!o)]);
1888
+ this.toggleDisabled([Se.editable.of(!o)]);
1889
1889
  }
1890
1890
  setReadOnly(o) {
1891
- this.toggleReadOnly([ke.readOnly.of(o)]);
1891
+ this.toggleReadOnly([Ce.readOnly.of(o)]);
1892
1892
  }
1893
1893
  setMaxLength(o) {
1894
1894
  this.maxLength = o, this.toggleMaxlength([
1895
- ke.changeFilter.of((l) => l.newDoc.length <= o)
1895
+ Ce.changeFilter.of((l) => l.newDoc.length <= o)
1896
1896
  ]);
1897
1897
  }
1898
1898
  }
@@ -1902,41 +1902,41 @@ const bo = (e) => {
1902
1902
  if (!a.clipboardData)
1903
1903
  return;
1904
1904
  if (a.clipboardData.files.length > 0) {
1905
- const { files: i } = a.clipboardData;
1905
+ const { files: r } = a.clipboardData;
1906
1906
  v.emit(
1907
1907
  o,
1908
- we,
1909
- Array.from(i).filter((m) => /image\/.*/.test(m.type))
1908
+ xe,
1909
+ Array.from(r).filter((m) => /image\/.*/.test(m.type))
1910
1910
  ), a.preventDefault();
1911
1911
  return;
1912
1912
  }
1913
1913
  if (e.autoDetectCode && a.clipboardData.types.includes("vscode-editor-data")) {
1914
- const i = JSON.parse(a.clipboardData.getData("vscode-editor-data"));
1914
+ const r = JSON.parse(a.clipboardData.getData("vscode-editor-data"));
1915
1915
  v.emit(o, x, "code", {
1916
- mode: i.mode,
1916
+ mode: r.mode,
1917
1917
  text: a.clipboardData.getData("text/plain")
1918
1918
  }), a.preventDefault();
1919
1919
  return;
1920
1920
  }
1921
- const r = a.clipboardData.getData("text/plain");
1922
- e.maxlength && r.length + e.modelValue.length > e.maxlength && v.emit(o, le, {
1921
+ const i = a.clipboardData.getData("text/plain");
1922
+ e.maxlength && i.length + e.modelValue.length > e.maxlength && v.emit(o, le, {
1923
1923
  name: "overlength",
1924
1924
  message: "The input text is too long",
1925
- data: r
1925
+ data: i
1926
1926
  });
1927
1927
  };
1928
- }, ho = bo, vo = (e) => {
1928
+ }, vo = bo, ko = (e) => {
1929
1929
  const o = A("editorId");
1930
1930
  Y(() => {
1931
1931
  v.on(o, {
1932
- name: Jt,
1932
+ name: Qt,
1933
1933
  callback(l) {
1934
1934
  var a;
1935
1935
  (a = e.value) == null || a.focus(l);
1936
1936
  }
1937
1937
  });
1938
1938
  });
1939
- }, ko = vo, Co = (e, o) => [
1939
+ }, Co = ko, po = (e, o) => [
1940
1940
  {
1941
1941
  key: "Ctrl-b",
1942
1942
  mac: "Cmd-b",
@@ -1951,7 +1951,7 @@ const bo = (e) => {
1951
1951
  {
1952
1952
  key: "Ctrl-s",
1953
1953
  mac: "Cmd-s",
1954
- run: (D) => (v.emit(e, Dt, D.state.doc.toString()), !0),
1954
+ run: (I) => (v.emit(e, Dt, I.state.doc.toString()), !0),
1955
1955
  shift: () => (v.emit(e, x, "strikeThrough"), !0)
1956
1956
  },
1957
1957
  {
@@ -1964,7 +1964,7 @@ const bo = (e) => {
1964
1964
  key: "Ctrl-i",
1965
1965
  mac: "Cmd-i",
1966
1966
  run: () => (v.emit(e, x, "italic"), !0),
1967
- shift: () => (v.emit(e, ye, "image"), !0)
1967
+ shift: () => (v.emit(e, Te, "image"), !0)
1968
1968
  },
1969
1969
  {
1970
1970
  key: "Ctrl-1",
@@ -2015,14 +2015,14 @@ const bo = (e) => {
2015
2015
  key: "Ctrl-c",
2016
2016
  mac: "Cmd-c",
2017
2017
  shift: () => (v.emit(e, x, "code"), !0),
2018
- any(D, E) {
2019
- return (E.ctrlKey || E.metaKey) && E.altKey && E.code === "KeyC" ? (v.emit(e, x, "codeRow"), !0) : !1;
2018
+ any(I, D) {
2019
+ return (D.ctrlKey || D.metaKey) && D.altKey && D.code === "KeyC" ? (v.emit(e, x, "codeRow"), !0) : !1;
2020
2020
  }
2021
2021
  },
2022
2022
  {
2023
2023
  key: "Ctrl-l",
2024
2024
  mac: "Cmd-l",
2025
- run: () => (v.emit(e, ye, "link"), !0)
2025
+ run: () => (v.emit(e, Te, "link"), !0)
2026
2026
  },
2027
2027
  {
2028
2028
  key: "Ctrl-f",
@@ -2030,138 +2030,140 @@ const bo = (e) => {
2030
2030
  shift: () => o.noPrettier ? !1 : (v.emit(e, x, "prettier"), !0)
2031
2031
  },
2032
2032
  {
2033
- any: (D, E) => (E.ctrlKey || E.metaKey) && E.altKey && E.shiftKey && E.code === "KeyT" ? (v.emit(e, x, "table"), !0) : !1
2033
+ any: (I, D) => (D.ctrlKey || D.metaKey) && D.altKey && D.shiftKey && D.code === "KeyT" ? (v.emit(e, x, "table"), !0) : !1
2034
2034
  }
2035
- ], po = Co, $o = (e) => {
2036
- const o = A("tabWidth"), l = A("editorId"), a = A("theme"), r = U(), i = Rt(), m = new be(), g = new be(), u = new be(), s = po(l, e), f = ho(e), w = [
2037
- ll.of([...s, il]),
2038
- el,
2039
- m.of(al({ codeLanguages: ol })),
2035
+ ], $o = po, yo = (e) => {
2036
+ const o = A("tabWidth"), l = A("editorId"), a = A("theme"), i = U(), r = Pt(), m = new be(), g = new be(), u = new be(), s = $o(l, e), h = vo(e), w = [
2037
+ ol.of([...s, sl]),
2038
+ tl,
2039
+ m.of(nl({ codeLanguages: al })),
2040
2040
  // 横向换行
2041
- ge.lineWrapping,
2042
- ge.updateListener.of((d) => {
2041
+ fe.lineWrapping,
2042
+ fe.updateListener.of((d) => {
2043
2043
  d.docChanged && e.onChange(d.state.doc.toString());
2044
2044
  }),
2045
- ge.domEventHandlers({
2046
- paste: f,
2045
+ fe.domEventHandlers({
2046
+ paste: h,
2047
2047
  blur: e.onBlur,
2048
2048
  focus: e.onFocus,
2049
2049
  drop: e.onDrop,
2050
2050
  input: (d) => {
2051
2051
  e.onInput && e.onInput(d);
2052
- const { data: C } = d;
2053
- e.maxlength && e.modelValue.length + C.length > e.maxlength && v.emit(l, le, {
2052
+ const { data: k } = d;
2053
+ e.maxlength && e.modelValue.length + k.length > e.maxlength && v.emit(l, le, {
2054
2054
  name: "overlength",
2055
2055
  message: "The input text is too long",
2056
- data: C
2056
+ data: k
2057
2057
  });
2058
2058
  }
2059
2059
  })
2060
- ], k = () => {
2060
+ ], C = () => {
2061
2061
  const d = [
2062
2062
  ...w,
2063
- g.of(a.value === "light" ? xt : Ct),
2064
- u.of(At(e.completions))
2063
+ g.of(a.value === "light" ? St : pt),
2064
+ u.of(Mt(e.completions))
2065
2065
  ];
2066
2066
  return Q.codeMirrorExtensions(a.value, d, [
2067
2067
  ...s
2068
2068
  ]);
2069
2069
  };
2070
2070
  return Y(() => {
2071
- const d = new ge({
2071
+ const d = new fe({
2072
2072
  doc: e.modelValue,
2073
- parent: r.value,
2074
- extensions: [k()]
2075
- }), C = new fo(d);
2076
- i.value = C, setTimeout(() => {
2077
- C.setTabSize(o), C.setDisabled(e.disabled), C.setReadOnly(e.readonly), e.placeholder && C.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && C.setMaxLength(e.maxlength), e.autofocus && d.focus();
2073
+ parent: i.value,
2074
+ extensions: [C()]
2075
+ }), k = new ho(d);
2076
+ r.value = k, setTimeout(() => {
2077
+ k.setTabSize(o), k.setDisabled(e.disabled), k.setReadOnly(e.readonly), e.placeholder && k.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && k.setMaxLength(e.maxlength), e.autofocus && d.focus();
2078
2078
  }, 0), v.on(l, {
2079
- name: It,
2079
+ name: Ht,
2080
2080
  callback() {
2081
- sl(d);
2081
+ cl(d);
2082
2082
  }
2083
2083
  }), v.on(l, {
2084
2084
  name: Et,
2085
2085
  callback() {
2086
- cl(d);
2086
+ ul(d);
2087
2087
  }
2088
2088
  }), v.on(l, {
2089
2089
  name: x,
2090
- callback(h, b = {}) {
2090
+ callback(f, b = {}) {
2091
2091
  var S;
2092
- const { text: p, options: T } = _l(h, i.value, b);
2093
- (S = i.value) == null || S.replaceSelectedText(p, T, l);
2092
+ const { text: p, options: T } = ql(f, r.value, b);
2093
+ (S = r.value) == null || S.replaceSelectedText(p, T, l);
2094
2094
  }
2095
2095
  });
2096
- }), O(
2096
+ }), H(
2097
2097
  a,
2098
2098
  () => {
2099
2099
  var d;
2100
- (d = i.value) == null || d.view.dispatch({
2101
- effects: g.reconfigure(a.value === "light" ? xt : Ct)
2100
+ (d = r.value) == null || d.view.dispatch({
2101
+ effects: g.reconfigure(a.value === "light" ? St : pt)
2102
2102
  });
2103
2103
  },
2104
2104
  {
2105
2105
  deep: !0
2106
2106
  }
2107
- ), O(
2107
+ ), H(
2108
2108
  () => e.completions,
2109
2109
  () => {
2110
2110
  var d;
2111
- (d = i.value) == null || d.view.dispatch({
2112
- effects: u.reconfigure(At(e.completions))
2111
+ (d = r.value) == null || d.view.dispatch({
2112
+ effects: u.reconfigure(Mt(e.completions))
2113
2113
  });
2114
2114
  },
2115
2115
  {
2116
2116
  deep: !0
2117
2117
  }
2118
- ), O(
2118
+ ), H(
2119
2119
  () => e.modelValue,
2120
2120
  () => {
2121
- var d, C;
2122
- ((d = i.value) == null ? void 0 : d.getValue()) !== e.modelValue && ((C = i.value) == null || C.setValue(e.modelValue));
2121
+ var d, k;
2122
+ ((d = r.value) == null ? void 0 : d.getValue()) !== e.modelValue && ((k = r.value) == null || k.setValue(e.modelValue));
2123
2123
  }
2124
- ), O(
2124
+ ), H(
2125
2125
  () => e.placeholder,
2126
2126
  () => {
2127
2127
  var d;
2128
- (d = i.value) == null || d.setPlaceholder(e.placeholder);
2128
+ (d = r.value) == null || d.setPlaceholder(e.placeholder);
2129
2129
  }
2130
- ), O(
2130
+ ), H(
2131
2131
  () => e.disabled,
2132
2132
  () => {
2133
2133
  var d;
2134
- (d = i.value) == null || d.setDisabled(e.disabled);
2134
+ (d = r.value) == null || d.setDisabled(e.disabled);
2135
2135
  }
2136
- ), O(
2136
+ ), H(
2137
2137
  () => e.readonly,
2138
2138
  () => {
2139
2139
  var d;
2140
- (d = i.value) == null || d.setDisabled(e.readonly);
2140
+ (d = r.value) == null || d.setDisabled(e.readonly);
2141
2141
  }
2142
- ), O(
2142
+ ), H(
2143
2143
  () => e.maxlength,
2144
2144
  () => {
2145
2145
  var d;
2146
- e.maxlength && ((d = i.value) == null || d.setMaxLength(e.maxlength));
2146
+ e.maxlength && ((d = r.value) == null || d.setMaxLength(e.maxlength));
2147
2147
  }
2148
- ), ko(i), {
2149
- inputWrapperRef: r,
2150
- codeMirrorUt: i
2148
+ ), Co(r), {
2149
+ inputWrapperRef: i,
2150
+ codeMirrorUt: r
2151
2151
  };
2152
- }, yo = $o, To = (e, o, l) => {
2152
+ }, To = yo, wo = (e, o, l) => {
2153
2153
  const a = G({
2154
2154
  resizedWidth: e.inputBoxWitdh
2155
- }), r = G({
2156
- width: e.inputBoxWitdh
2157
2155
  }), i = G({
2156
+ width: e.inputBoxWitdh
2157
+ }), r = G({
2158
2158
  left: e.inputBoxWitdh,
2159
2159
  display: "initial"
2160
2160
  }), m = (s) => {
2161
- var d, C;
2162
- const f = ((d = o.value) == null ? void 0 : d.offsetWidth) || 0, w = ((C = o.value) == null ? void 0 : C.getBoundingClientRect().x) || 0;
2163
- let k = s.x - w;
2164
- k < 100 ? k = 100 : k > f - 100 && (k = f - 100), r.width = `${k}px`, i.left = `${k}px`, a.resizedWidth = `${k}px`;
2161
+ var k, f, b;
2162
+ const h = ((k = o.value) == null ? void 0 : k.offsetWidth) || 0, w = ((f = o.value) == null ? void 0 : f.getBoundingClientRect().x) || 0;
2163
+ let C = s.x - w;
2164
+ C < ge ? C = ge : C > h - ge && (C = h - ge);
2165
+ const d = `${C}px`;
2166
+ i.width = d, r.left = d, a.resizedWidth = d, (b = e.onInputBoxWitdhChange) == null || b.call(e, d);
2165
2167
  }, g = () => {
2166
2168
  document.addEventListener("mousemove", m);
2167
2169
  }, u = () => {
@@ -2170,41 +2172,46 @@ const bo = (e) => {
2170
2172
  return Y(() => {
2171
2173
  var s;
2172
2174
  (s = l.value) == null || s.addEventListener("mousedown", g), document.addEventListener("mouseup", u);
2173
- }), Lt(() => {
2174
- var s, f;
2175
- (s = l.value) == null || s.removeEventListener("mousedown", g), (f = l.value) == null || f.removeEventListener("mouseup", u);
2176
- }), O(
2175
+ }), It(() => {
2176
+ var s, h;
2177
+ (s = l.value) == null || s.removeEventListener("mousedown", g), (h = l.value) == null || h.removeEventListener("mouseup", u);
2178
+ }), H(
2179
+ () => e.inputBoxWitdh,
2180
+ (s) => {
2181
+ s && (i.width = s, r.left = s);
2182
+ }
2183
+ ), H(
2177
2184
  [te(e.setting, "htmlPreview"), te(e.setting, "preview")],
2178
2185
  () => {
2179
- !e.setting.htmlPreview && !e.setting.preview ? (a.resizedWidth = r.width, r.width = "100%", i.display = "none") : (r.width = a.resizedWidth, i.display = "initial");
2186
+ !e.setting.htmlPreview && !e.setting.preview ? (i.width = "100%", r.display = "none") : (i.width = a.resizedWidth, r.display = "initial");
2180
2187
  },
2181
2188
  {
2182
2189
  immediate: !0
2183
2190
  }
2184
- ), { inputWrapperStyle: r, resizeOperateStyle: i };
2185
- }, wo = To, xo = /* @__PURE__ */ P({
2191
+ ), { inputWrapperStyle: i, resizeOperateStyle: r };
2192
+ }, xo = wo, So = /* @__PURE__ */ P({
2186
2193
  name: "MDEditorContent",
2187
- props: ml,
2194
+ props: gl,
2188
2195
  setup(e) {
2189
- const o = A("editorId"), l = U(""), a = U(), r = U(), {
2190
- inputWrapperRef: i,
2196
+ const o = A("editorId"), l = U(""), a = U(), i = U(), {
2197
+ inputWrapperRef: r,
2191
2198
  codeMirrorUt: m
2192
- } = yo(e), {
2199
+ } = To(e), {
2193
2200
  inputWrapperStyle: g,
2194
2201
  resizeOperateStyle: u
2195
- } = wo(e, a, r);
2196
- return Ul(e, l, m), () => t("div", {
2202
+ } = xo(e, a, i);
2203
+ return _l(e, l, m), () => t("div", {
2197
2204
  class: `${n}-content`,
2198
2205
  ref: a
2199
2206
  }, [t("div", {
2200
2207
  class: `${n}-input-wrapper`,
2201
2208
  style: g,
2202
- ref: i
2209
+ ref: r
2203
2210
  }, null), t("div", {
2204
2211
  class: `${n}-resize-operate`,
2205
2212
  style: u,
2206
- ref: r
2207
- }, null), t(gl, {
2213
+ ref: i
2214
+ }, null), t(fl, {
2208
2215
  modelValue: e.modelValue,
2209
2216
  setting: e.setting,
2210
2217
  onHtmlChanged: (s) => {
@@ -2226,7 +2233,7 @@ const bo = (e) => {
2226
2233
  key: "internal-catalog"
2227
2234
  }, null)]);
2228
2235
  }
2229
- }), So = /* @__PURE__ */ P({
2236
+ }), Ao = /* @__PURE__ */ P({
2230
2237
  props: {
2231
2238
  modelValue: {
2232
2239
  type: String,
@@ -2244,7 +2251,7 @@ const bo = (e) => {
2244
2251
  }, [`${(l = o.value.footer) == null ? void 0 : l.markdownTotal}:`]), t("span", null, [((a = e.modelValue) == null ? void 0 : a.length) || 0])]);
2245
2252
  };
2246
2253
  }
2247
- }), Ao = {
2254
+ }), Mo = {
2248
2255
  checked: {
2249
2256
  type: Boolean,
2250
2257
  default: !1
@@ -2254,8 +2261,8 @@ const bo = (e) => {
2254
2261
  default: () => {
2255
2262
  }
2256
2263
  }
2257
- }, Mo = /* @__PURE__ */ P({
2258
- props: Ao,
2264
+ }, Lo = /* @__PURE__ */ P({
2265
+ props: Mo,
2259
2266
  setup(e) {
2260
2267
  return () => t("div", {
2261
2268
  class: [`${n}-checkbox`, e.checked && `${n}-checkbox-checked`],
@@ -2264,7 +2271,7 @@ const bo = (e) => {
2264
2271
  }
2265
2272
  }, null);
2266
2273
  }
2267
- }), Lo = {
2274
+ }), Io = {
2268
2275
  scrollAuto: {
2269
2276
  type: Boolean
2270
2277
  },
@@ -2274,7 +2281,7 @@ const bo = (e) => {
2274
2281
  }
2275
2282
  }
2276
2283
  }, Do = /* @__PURE__ */ P({
2277
- props: Lo,
2284
+ props: Io,
2278
2285
  setup(e) {
2279
2286
  const o = A("usedLanguageText");
2280
2287
  return () => {
@@ -2286,7 +2293,7 @@ const bo = (e) => {
2286
2293
  onClick: () => {
2287
2294
  e.onScrollAutoChange(!e.scrollAuto);
2288
2295
  }
2289
- }, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(Mo, {
2296
+ }, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(Lo, {
2290
2297
  checked: e.scrollAuto,
2291
2298
  onChange: e.onScrollAutoChange
2292
2299
  }, null)]);
@@ -2312,18 +2319,18 @@ const bo = (e) => {
2312
2319
  defFooters: {
2313
2320
  type: Object
2314
2321
  }
2315
- }, Io = /* @__PURE__ */ P({
2322
+ }, Ho = /* @__PURE__ */ P({
2316
2323
  name: "MDEditorFooter",
2317
2324
  props: Eo,
2318
2325
  setup(e) {
2319
- const o = Te(() => {
2320
- const a = e.footers.indexOf("="), r = a === -1 ? e.footers : e.footers.slice(0, a), i = a === -1 ? [] : e.footers.slice(a, Number.MAX_SAFE_INTEGER);
2321
- return [r, i];
2326
+ const o = we(() => {
2327
+ const a = e.footers.indexOf("="), i = a === -1 ? e.footers : e.footers.slice(0, a), r = a === -1 ? [] : e.footers.slice(a, Number.MAX_SAFE_INTEGER);
2328
+ return [i, r];
2322
2329
  }), l = (a) => {
2323
- if (Ut.includes(a))
2330
+ if (_t.includes(a))
2324
2331
  switch (a) {
2325
2332
  case "markdownTotal":
2326
- return t(So, {
2333
+ return t(Ao, {
2327
2334
  modelValue: e.modelValue
2328
2335
  }, null);
2329
2336
  case "scrollSwitch":
@@ -2336,41 +2343,41 @@ const bo = (e) => {
2336
2343
  return e.defFooters instanceof Array ? e.defFooters[a] || "" : e.defFooters && e.defFooters.children instanceof Array && e.defFooters.children[a] || "";
2337
2344
  };
2338
2345
  return () => {
2339
- const a = o.value[0].map((i) => l(i)), r = o.value[1].map((i) => l(i));
2346
+ const a = o.value[0].map((r) => l(r)), i = o.value[1].map((r) => l(r));
2340
2347
  return t("div", {
2341
2348
  class: `${n}-footer`
2342
2349
  }, [t("div", {
2343
2350
  class: `${n}-footer-left`
2344
2351
  }, [a]), t("div", {
2345
2352
  class: `${n}-footer-right`
2346
- }, [r])]);
2353
+ }, [i])]);
2347
2354
  };
2348
2355
  }
2349
- }), Ho = /* @__PURE__ */ P({
2356
+ }), No = /* @__PURE__ */ P({
2350
2357
  name: "MdEditorV3",
2351
- props: fl,
2358
+ props: hl,
2352
2359
  emits: bl,
2353
2360
  setup(e, o) {
2354
2361
  const {
2355
2362
  editorId: l,
2356
2363
  noKatex: a,
2357
- noMermaid: r,
2358
- noPrettier: i,
2364
+ noMermaid: i,
2365
+ noPrettier: r,
2359
2366
  noUploadImg: m,
2360
2367
  noHighlight: g
2361
2368
  } = e, u = G({
2362
2369
  scrollAuto: e.scrollAuto
2363
2370
  });
2364
- hl(e, o), vl(e), kl(e), Cl(e, o);
2365
- const [s, f] = pl(e, o), w = $l(e);
2366
- return Lt(() => {
2371
+ vl(e, o), kl(e), Cl(e), pl(e, o);
2372
+ const [s, h] = $l(e, o), w = yl(e);
2373
+ return It(() => {
2367
2374
  v.clear(l);
2368
- }), yl(e, o, w, s, f), () => {
2369
- var C;
2370
- const k = gt({
2375
+ }), Tl(e, o, w, s, h), () => {
2376
+ var k;
2377
+ const C = ft({
2371
2378
  props: e,
2372
2379
  ctx: o
2373
- }, "defToolbars"), d = gt({
2380
+ }, "defToolbars"), d = ft({
2374
2381
  props: e,
2375
2382
  ctx: o
2376
2383
  }, "defFooters");
@@ -2378,22 +2385,22 @@ const bo = (e) => {
2378
2385
  id: l,
2379
2386
  class: [n, e.class, e.theme === "dark" && `${n}-dark`, s.fullscreen || s.pageFullscreen ? `${n}-fullscreen` : ""],
2380
2387
  style: e.style
2381
- }, [t(Fl, {
2382
- noPrettier: i,
2388
+ }, [t(Rl, {
2389
+ noPrettier: r,
2383
2390
  toolbars: e.toolbars,
2384
2391
  toolbarsExclude: e.toolbarsExclude,
2385
2392
  setting: s,
2386
- updateSetting: f,
2393
+ updateSetting: h,
2387
2394
  tableShape: e.tableShape,
2388
- defToolbars: k,
2395
+ defToolbars: C,
2389
2396
  noUploadImg: m,
2390
2397
  showToolbarName: e.showToolbarName
2391
- }, null), t(xo, {
2398
+ }, null), t(So, {
2392
2399
  modelValue: e.modelValue,
2393
2400
  setting: s,
2394
2401
  mdHeadingId: e.mdHeadingId,
2395
- noMermaid: r,
2396
- noPrettier: i,
2402
+ noMermaid: i,
2403
+ noPrettier: r,
2397
2404
  sanitize: e.sanitize,
2398
2405
  placeholder: e.placeholder,
2399
2406
  noKatex: a,
@@ -2405,43 +2412,46 @@ const bo = (e) => {
2405
2412
  maxlength: e.maxLength,
2406
2413
  autoDetectCode: e.autoDetectCode,
2407
2414
  noHighlight: g,
2408
- onChange: (h) => {
2409
- e.onChange ? e.onChange(h) : (o.emit("update:modelValue", h), o.emit("onChange", h));
2415
+ onChange: (f) => {
2416
+ e.onChange ? e.onChange(f) : (o.emit("update:modelValue", f), o.emit("onChange", f));
2410
2417
  },
2411
- onHtmlChanged: (h) => {
2412
- e.onHtmlChanged ? e.onHtmlChanged(h) : o.emit("onHtmlChanged", h);
2418
+ onHtmlChanged: (f) => {
2419
+ e.onHtmlChanged ? e.onHtmlChanged(f) : o.emit("onHtmlChanged", f);
2413
2420
  },
2414
- onGetCatalog: (h) => {
2415
- e.onGetCatalog ? e.onGetCatalog(h) : o.emit("onGetCatalog", h);
2421
+ onGetCatalog: (f) => {
2422
+ e.onGetCatalog ? e.onGetCatalog(f) : o.emit("onGetCatalog", f);
2416
2423
  },
2417
- onBlur: (h) => {
2418
- e.onBlur ? e.onBlur(h) : o.emit("onBlur", h);
2424
+ onBlur: (f) => {
2425
+ e.onBlur ? e.onBlur(f) : o.emit("onBlur", f);
2419
2426
  },
2420
- onFocus: (h) => {
2421
- e.onFocus ? e.onFocus(h) : o.emit("onFocus", h);
2427
+ onFocus: (f) => {
2428
+ e.onFocus ? e.onFocus(f) : o.emit("onFocus", f);
2422
2429
  },
2423
- onInput: (h) => {
2424
- e.onInput ? e.onInput(h) : o.emit("onInput", h);
2430
+ onInput: (f) => {
2431
+ e.onInput ? e.onInput(f) : o.emit("onInput", f);
2425
2432
  },
2426
2433
  completions: e.completions,
2427
2434
  catalogVisible: w.value,
2428
2435
  theme: e.theme,
2429
2436
  noImgZoomIn: e.noImgZoomIn,
2430
- onDrop: (h) => {
2431
- e.onDrop ? e.onDrop(h) : o.emit("onDrop", h);
2437
+ onDrop: (f) => {
2438
+ e.onDrop ? e.onDrop(f) : o.emit("onDrop", f);
2432
2439
  },
2433
- inputBoxWitdh: e.inputBoxWitdh
2434
- }, null), ((C = e.footers) == null ? void 0 : C.length) > 0 && t(Io, {
2440
+ inputBoxWitdh: e.inputBoxWitdh,
2441
+ onInputBoxWitdhChange: (f) => {
2442
+ e.onInputBoxWitdhChange ? e.onInputBoxWitdhChange(f) : o.emit("onInputBoxWitdhChange", f);
2443
+ }
2444
+ }, null), ((k = e.footers) == null ? void 0 : k.length) > 0 && t(Ho, {
2435
2445
  modelValue: e.modelValue,
2436
2446
  footers: e.footers,
2437
2447
  defFooters: d,
2438
2448
  scrollAuto: u.scrollAuto,
2439
- onScrollAutoChange: (h) => u.scrollAuto = h
2449
+ onScrollAutoChange: (f) => u.scrollAuto = f
2440
2450
  }, null)]);
2441
2451
  };
2442
2452
  }
2443
- }), $e = Ho;
2444
- $e.install = (e) => (e.component($e.name, $e), e.use(wl).use(jt).use(xl).use(Vt).use(Tl), e);
2453
+ }), ye = No;
2454
+ ye.install = (e) => (e.component(ye.name, ye), e.use(xl).use(Zt).use(Sl).use(Vt).use(wl), e);
2445
2455
  export {
2446
- $e as default
2456
+ ye as default
2447
2457
  };