md-editor-v3 4.11.0 → 4.11.1-beta.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 Rt = Object.defineProperty;
2
- var Pt = (e, o, l) => o in e ? Rt(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
3
- var U = (e, o, l) => (Pt(e, typeof o != "symbol" ? o + "" : o, l), l);
4
- import { defineComponent as W, createVNode as t, inject as I, ref as P, onMounted as Q, reactive as G, computed as we, watch as H, nextTick as ve, Fragment as It, cloneVNode as gt, toRef as te, shallowRef as Wt, onBeforeUnmount as Dt } from "vue";
5
- import { p as n, e as J, n as zt, b as qt, M as fe, d as Ut } from "./chunks/config.mjs";
6
- import { draggingScroll as _t, linkTo as Gt, debounce as Kt, createSmoothScroll as jt, throttle as Zt } from "@vavt/util";
7
- import { a as se, D as Xt } from "./chunks/index2.mjs";
8
- import { b, i as Yt, E as le, U as xe, j as Jt, k as Te, h as x, c as Qt, O as Et, l as Ht, m as Nt } from "./chunks/index4.mjs";
1
+ var Ot = Object.defineProperty;
2
+ var Pt = (e, o, l) => o in e ? Ot(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
3
+ var z = (e, o, l) => (Pt(e, typeof o != "symbol" ? o + "" : o, l), l);
4
+ import { defineComponent as O, createVNode as t, inject as I, ref as R, onMounted as Y, reactive as U, computed as Ce, watch as H, nextTick as de, Fragment as Mt, cloneVNode as gt, toRef as Q, shallowRef as Wt, onBeforeUnmount as Et } from "vue";
5
+ import { p as a, e as X, n as zt, b as _t, M as se, d as Ut } from "./chunks/config.mjs";
6
+ import { draggingScroll as qt, linkTo as Gt, debounce as Kt, createSmoothScroll as jt, throttle as Zt } from "@vavt/util";
7
+ import { a as ae, D as Xt } from "./chunks/index2.mjs";
8
+ import { b as v, i as Yt, E as ee, U as $e, j as Jt, k as ke, h as L, c as Qt, O as Ht, l as Dt, m as Nt } from "./chunks/index4.mjs";
9
9
  import { a as el } from "./chunks/dom.mjs";
10
- import { M as Bt, I as T } from "./chunks/index3.mjs";
11
- import { EditorView as he } from "codemirror";
12
- import { EditorView as Se, placeholder as tl, keymap as ll } from "@codemirror/view";
10
+ import { M as Bt, I as x } from "./chunks/index3.mjs";
11
+ import { EditorView as ce } from "codemirror";
12
+ import { EditorView as pe, placeholder as tl, keymap as ll } from "@codemirror/view";
13
13
  import { languages as ol } from "@codemirror/language-data";
14
14
  import { markdown as al } from "@codemirror/lang-markdown";
15
- import { EditorSelection as _, EditorState as Ce, Compartment as ce, StateEffect as nl } from "@codemirror/state";
15
+ import { EditorSelection as _, EditorState as fe, Compartment as ne, StateEffect as nl } from "@codemirror/state";
16
16
  import { deleteLine as il, defaultKeymap as rl, historyKeymap as sl, indentWithTab as cl, history as ft, undo as ul, redo as dl } from "@codemirror/commands";
17
- import { HighlightStyle as Ot, syntaxHighlighting as Vt, indentUnit as ml } from "@codemirror/language";
17
+ import { HighlightStyle as Vt, syntaxHighlighting as Ft, indentUnit as ml } from "@codemirror/language";
18
18
  import { tags as c } from "@lezer/highlight";
19
19
  import { autocompletion as gl } from "@codemirror/autocomplete";
20
20
  import { c as fl, C as hl, e as bl, a as vl, u as kl, b as Cl, d as $l, f as pl, g as yl, h as Tl, i as wl, M as xl } from "./chunks/index.mjs";
21
- import Ft from "./MdCatalog.mjs";
21
+ import Rt from "./MdCatalog.mjs";
22
22
  import { g as ht } from "./chunks/vue-tsx.mjs";
23
23
  import Sl from "./NormalToolbar.mjs";
24
- import Ml from "./ModalToolbar.mjs";
24
+ import Al 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 Al = /* @__PURE__ */ W({
31
+ const Ll = /* @__PURE__ */ O({
32
32
  setup() {
33
33
  return () => t("div", {
34
- class: `${n}-divider`
34
+ class: `${a}-divider`
35
35
  }, null);
36
36
  }
37
- }), Ll = {
37
+ }), Il = {
38
38
  noPrettier: {
39
39
  type: Boolean
40
40
  },
@@ -83,19 +83,19 @@ const Al = /* @__PURE__ */ W({
83
83
  showToolbarName: {
84
84
  type: Boolean
85
85
  }
86
- }, Il = (e) => {
87
- var d, s, g, p;
86
+ }, Ml = (e) => {
87
+ var d, s, g, w;
88
88
  const o = I("editorId");
89
- let l = (s = (d = J.editorExtensions) == null ? void 0 : d.screenfull) == null ? void 0 : s.instance;
90
- const a = (p = (g = J.editorExtensions) == null ? void 0 : g.screenfull) == null ? void 0 : p.js, r = P(!1), i = (k) => {
89
+ let l = (s = (d = X.editorExtensions) == null ? void 0 : d.screenfull) == null ? void 0 : s.instance;
90
+ const n = (w = (g = X.editorExtensions) == null ? void 0 : g.screenfull) == null ? void 0 : w.js, r = R(!1), i = ($) => {
91
91
  if (!l) {
92
- b.emit(o, le, {
92
+ v.emit(o, ee, {
93
93
  name: "fullscreen",
94
94
  message: "fullscreen is undefined"
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 ? (r.value = !0, ($ === void 0 ? !l.isFullscreen : $) ? l.request() : l.exit()) : console.error("browser does not support screenfull!");
99
99
  }, h = () => {
100
100
  l && l.isEnabled && l.on("change", () => {
101
101
  (r.value || e.setting.fullscreen) && (r.value = !1, e.updateSetting("fullscreen"));
@@ -103,18 +103,18 @@ const Al = /* @__PURE__ */ W({
103
103
  }, f = () => {
104
104
  l = window.screenfull, h();
105
105
  };
106
- return Q(() => {
106
+ return Y(() => {
107
107
  if (h(), !l) {
108
- const k = document.createElement("script");
109
- k.src = a || zt, k.onload = f, k.id = `${n}-screenfull`, el(k, "screenfull");
108
+ const $ = document.createElement("script");
109
+ $.src = n || zt, $.onload = f, $.id = `${a}-screenfull`, el($, "screenfull");
110
110
  }
111
- }), Q(() => {
112
- b.on(o, {
111
+ }), Y(() => {
112
+ v.on(o, {
113
113
  name: Yt,
114
114
  callback: i
115
115
  });
116
116
  }), { fullscreenHandler: i };
117
- }, Dl = {
117
+ }, El = {
118
118
  tableShape: {
119
119
  type: Array,
120
120
  default: () => [6, 4]
@@ -124,36 +124,36 @@ const Al = /* @__PURE__ */ W({
124
124
  default: () => {
125
125
  }
126
126
  }
127
- }, El = /* @__PURE__ */ W({
127
+ }, Hl = /* @__PURE__ */ O({
128
128
  name: "TableShape",
129
- props: Dl,
129
+ props: El,
130
130
  setup(e) {
131
- const o = G({
131
+ const o = U({
132
132
  x: -1,
133
133
  y: -1
134
134
  });
135
135
  return () => t("div", {
136
- class: `${n}-table-shape`,
136
+ class: `${a}-table-shape`,
137
137
  onMouseleave: () => {
138
138
  o.x = -1, o.y = -1;
139
139
  }
140
- }, [new Array(e.tableShape[1]).fill("").map((l, a) => t("div", {
141
- class: `${n}-table-shape-row`,
142
- key: `table-shape-row-${a}`
140
+ }, [new Array(e.tableShape[1]).fill("").map((l, n) => t("div", {
141
+ class: `${a}-table-shape-row`,
142
+ key: `table-shape-row-${n}`
143
143
  }, [new Array(e.tableShape[0]).fill("").map((r, i) => t("div", {
144
- class: `${n}-table-shape-col`,
144
+ class: `${a}-table-shape-col`,
145
145
  key: `table-shape-col-${i}`,
146
146
  onMouseenter: () => {
147
- o.x = a, o.y = i;
147
+ o.x = n, o.y = i;
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: [`${a}-table-shape-col-default`, n <= o.x && i <= o.y && `${a}-table-shape-col-include`]
154
154
  }, null)]))]))]);
155
155
  }
156
- }), Hl = El, Nl = {
156
+ }), Dl = Hl, Nl = {
157
157
  type: {
158
158
  type: String,
159
159
  default: "link"
@@ -172,10 +172,10 @@ const Al = /* @__PURE__ */ W({
172
172
  default: () => {
173
173
  }
174
174
  }
175
- }, Bl = /* @__PURE__ */ W({
175
+ }, Bl = /* @__PURE__ */ O({
176
176
  props: Nl,
177
177
  setup(e) {
178
- const o = I("usedLanguageText"), l = I("editorId"), a = we(() => {
178
+ const o = I("usedLanguageText"), l = I("editorId"), n = Ce(() => {
179
179
  var i, h;
180
180
  switch (e.type) {
181
181
  case "link":
@@ -185,7 +185,7 @@ const Al = /* @__PURE__ */ W({
185
185
  default:
186
186
  return "";
187
187
  }
188
- }), r = G({
188
+ }), r = U({
189
189
  desc: "",
190
190
  url: ""
191
191
  });
@@ -194,20 +194,20 @@ const Al = /* @__PURE__ */ W({
194
194
  r.desc = "", r.url = "";
195
195
  }, 200);
196
196
  }), () => t(Bt, {
197
- title: a.value,
197
+ title: n.value,
198
198
  visible: e.visible,
199
199
  onClose: e.onCancel
200
200
  }, {
201
201
  default: () => {
202
202
  var i, h, f, d, s;
203
203
  return [t("div", {
204
- class: `${n}-form-item`
204
+ class: `${a}-form-item`
205
205
  }, [t("label", {
206
- class: `${n}-label`,
206
+ class: `${a}-label`,
207
207
  for: `link-desc-${l}`
208
208
  }, [(i = o.value.linkModalTips) == null ? void 0 : i.descLabel]), t("input", {
209
209
  placeholder: (h = o.value.linkModalTips) == null ? void 0 : h.descLabelPlaceHolder,
210
- class: `${n}-input`,
210
+ class: `${a}-input`,
211
211
  id: `link-desc-${l}`,
212
212
  type: "text",
213
213
  value: r.desc,
@@ -216,13 +216,13 @@ const Al = /* @__PURE__ */ W({
216
216
  },
217
217
  autocomplete: "off"
218
218
  }, null)]), t("div", {
219
- class: `${n}-form-item`
219
+ class: `${a}-form-item`
220
220
  }, [t("label", {
221
- class: `${n}-label`,
221
+ class: `${a}-label`,
222
222
  for: `link-url-${l}`
223
223
  }, [(f = o.value.linkModalTips) == null ? void 0 : f.urlLabel]), t("input", {
224
224
  placeholder: (d = o.value.linkModalTips) == null ? void 0 : d.urlLabelPlaceHolder,
225
- class: `${n}-input`,
225
+ class: `${a}-input`,
226
226
  id: `link-url-${l}`,
227
227
  type: "text",
228
228
  value: r.url,
@@ -231,9 +231,9 @@ const Al = /* @__PURE__ */ W({
231
231
  },
232
232
  autocomplete: "off"
233
233
  }, null)]), t("div", {
234
- class: `${n}-form-item`
234
+ class: `${a}-form-item`
235
235
  }, [t("button", {
236
- class: [`${n}-btn`, `${n}-btn-row`],
236
+ class: [`${a}-btn`, `${a}-btn-row`],
237
237
  type: "button",
238
238
  onClick: () => {
239
239
  e.onOk(r), r.desc = "", r.url = "";
@@ -242,7 +242,7 @@ const Al = /* @__PURE__ */ W({
242
242
  }
243
243
  });
244
244
  }
245
- }), Ol = {
245
+ }), Vl = {
246
246
  visible: {
247
247
  type: Boolean,
248
248
  default: !1
@@ -257,13 +257,13 @@ const Al = /* @__PURE__ */ W({
257
257
  default: () => {
258
258
  }
259
259
  }
260
- }, Vl = /* @__PURE__ */ W({
261
- props: Ol,
260
+ }, Fl = /* @__PURE__ */ O({
261
+ props: Vl,
262
262
  setup(e) {
263
- var g, p, k;
263
+ var g, w, $;
264
264
  const o = I("usedLanguageText"), l = I("editorId");
265
- let a = (k = (p = (g = J) == null ? void 0 : g.editorExtensions) == null ? void 0 : p.cropper) == null ? void 0 : k.instance;
266
- const r = P(), i = P(), h = P(), f = G({
265
+ let n = ($ = (w = (g = X) == null ? void 0 : g.editorExtensions) == null ? void 0 : w.cropper) == null ? void 0 : $.instance;
266
+ const r = R(), i = R(), h = R(), f = U({
267
267
  cropperInited: !1,
268
268
  imgSelected: !1,
269
269
  imgSrc: "",
@@ -272,35 +272,35 @@ const Al = /* @__PURE__ */ W({
272
272
  });
273
273
  let d = null;
274
274
  H(() => e.visible, () => {
275
- e.visible && !f.cropperInited && (a = a || window.Cropper, r.value.onchange = () => {
276
- if (!a) {
277
- b.emit(l, le, {
275
+ e.visible && !f.cropperInited && (n = n || window.Cropper, r.value.onchange = () => {
276
+ if (!n) {
277
+ v.emit(l, ee, {
278
278
  name: "Cropper",
279
279
  message: "Cropper is undefined"
280
280
  });
281
281
  return;
282
282
  }
283
- const $ = r.value.files || [];
284
- if (f.imgSelected = !0, ($ == null ? void 0 : $.length) > 0) {
283
+ const S = r.value.files || [];
284
+ if (f.imgSelected = !0, (S == null ? void 0 : S.length) > 0) {
285
285
  const m = new FileReader();
286
- m.onload = (v) => {
287
- f.imgSrc = v.target.result, ve(() => {
288
- d = new a(i.value, {
286
+ m.onload = (k) => {
287
+ f.imgSrc = k.target.result, de(() => {
288
+ d = new n(i.value, {
289
289
  viewMode: 2,
290
- preview: `.${n}-clip-preview-target`
290
+ preview: `.${a}-clip-preview-target`
291
291
  // aspectRatio: 16 / 9,
292
292
  });
293
293
  });
294
- }, m.readAsDataURL($[0]);
294
+ }, m.readAsDataURL(S[0]);
295
295
  }
296
296
  });
297
297
  }), H(() => [f.imgSelected], () => {
298
298
  h.value.style = "";
299
299
  }), H(() => f.isFullscreen, () => {
300
- ve(() => {
301
- d == null || d.destroy(), h.value.style = "", i.value && (d = new a(i.value, {
300
+ de(() => {
301
+ d == null || d.destroy(), h.value.style = "", i.value && (d = new n(i.value, {
302
302
  viewMode: 2,
303
- preview: `.${n}-clip-preview-target`
303
+ preview: `.${a}-clip-preview-target`
304
304
  // aspectRatio: 16 / 9,
305
305
  }));
306
306
  });
@@ -309,10 +309,10 @@ const Al = /* @__PURE__ */ W({
309
309
  d.clear(), d.destroy(), d = null, r.value.value = "", f.imgSelected = !1;
310
310
  };
311
311
  return () => {
312
- var $;
312
+ var S;
313
313
  return t(Bt, {
314
- class: `${n}-modal-clip`,
315
- title: ($ = o.value.clipModalTips) == null ? void 0 : $.title,
314
+ class: `${a}-modal-clip`,
315
+ title: (S = o.value.clipModalTips) == null ? void 0 : S.title,
316
316
  visible: e.visible,
317
317
  onClose: e.onCancel,
318
318
  showAdjust: !0,
@@ -324,13 +324,13 @@ const Al = /* @__PURE__ */ W({
324
324
  height: "421px"
325
325
  }, {
326
326
  default: () => {
327
- var m, v;
327
+ var m, k;
328
328
  return [t("div", {
329
- class: `${n}-form-item ${n}-clip`
329
+ class: `${a}-form-item ${a}-clip`
330
330
  }, [t("div", {
331
- class: `${n}-clip-main`
331
+ class: `${a}-clip-main`
332
332
  }, [f.imgSelected ? t("div", {
333
- class: `${n}-clip-cropper`
333
+ class: `${a}-clip-cropper`
334
334
  }, [t("img", {
335
335
  src: f.imgSrc,
336
336
  ref: i,
@@ -339,34 +339,34 @@ const Al = /* @__PURE__ */ W({
339
339
  },
340
340
  alt: ""
341
341
  }, null), t("div", {
342
- class: `${n}-clip-delete`,
342
+ class: `${a}-clip-delete`,
343
343
  onClick: s
344
- }, [t(T, {
344
+ }, [t(x, {
345
345
  name: "delete"
346
346
  }, null)])]) : t("div", {
347
- class: `${n}-clip-upload`,
347
+ class: `${a}-clip-upload`,
348
348
  onClick: () => {
349
349
  r.value.click();
350
350
  }
351
- }, [t(T, {
351
+ }, [t(x, {
352
352
  name: "upload"
353
353
  }, null)])]), t("div", {
354
- class: `${n}-clip-preview`
354
+ class: `${a}-clip-preview`
355
355
  }, [t("div", {
356
- class: `${n}-clip-preview-target`,
356
+ class: `${a}-clip-preview-target`,
357
357
  ref: h
358
358
  }, null)])]), t("div", {
359
- class: `${n}-form-item`
359
+ class: `${a}-form-item`
360
360
  }, [t("button", {
361
- class: `${n}-btn`,
361
+ class: `${a}-btn`,
362
362
  type: "button",
363
363
  onClick: () => {
364
364
  if (d) {
365
365
  const u = d.getCroppedCanvas();
366
- b.emit(l, xe, [Jt(u.toDataURL("image/png"))], e.onOk), s();
366
+ v.emit(l, $e, [Jt(u.toDataURL("image/png"))], e.onOk), s();
367
367
  }
368
368
  }
369
- }, [((m = o.value.clipModalTips) == null ? void 0 : m.buttonUpload) || ((v = o.value.linkModalTips) == null ? void 0 : v.buttonOK)])]), t("input", {
369
+ }, [((m = o.value.clipModalTips) == null ? void 0 : m.buttonUpload) || ((k = o.value.linkModalTips) == null ? void 0 : k.buttonOK)])]), t("input", {
370
370
  ref: r,
371
371
  accept: "image/*",
372
372
  type: "file",
@@ -379,7 +379,7 @@ const Al = /* @__PURE__ */ W({
379
379
  });
380
380
  };
381
381
  }
382
- }), Fl = {
382
+ }), Rl = {
383
383
  type: {
384
384
  type: String,
385
385
  default: "link"
@@ -402,27 +402,27 @@ const Al = /* @__PURE__ */ W({
402
402
  default: () => {
403
403
  }
404
404
  }
405
- }, Rl = /* @__PURE__ */ W({
406
- props: Fl,
405
+ }, Ol = /* @__PURE__ */ O({
406
+ props: Rl,
407
407
  setup(e) {
408
- return () => t(It, null, [t(Bl, {
408
+ return () => t(Mt, null, [t(Bl, {
409
409
  type: e.type,
410
410
  visible: e.linkVisible,
411
411
  onOk: e.onOk,
412
412
  onCancel: e.onCancel
413
- }, null), t(Vl, {
413
+ }, null), t(Fl, {
414
414
  visible: e.clipVisible,
415
415
  onOk: e.onOk,
416
416
  onCancel: e.onCancel
417
417
  }, null)]);
418
418
  }
419
- }), Pl = /* @__PURE__ */ W({
419
+ }), Pl = /* @__PURE__ */ O({
420
420
  name: "MDEditorToolbar",
421
- props: Ll,
421
+ props: Il,
422
422
  setup(e) {
423
- const o = I("editorId"), l = I("usedLanguageText"), a = I("theme"), r = I("language"), {
423
+ const o = I("editorId"), l = I("usedLanguageText"), n = I("theme"), r = I("language"), {
424
424
  fullscreenHandler: i
425
- } = Il(e), h = `${o}-toolbar-wrapper`, f = P(), d = G({
425
+ } = Ml(e), h = `${o}-toolbar-wrapper`, f = R(), d = U({
426
426
  title: !1,
427
427
  catalog: !1,
428
428
  // 图片上传下拉
@@ -432,496 +432,496 @@ const Al = /* @__PURE__ */ W({
432
432
  // mermaid
433
433
  mermaid: !1,
434
434
  katex: !1
435
- }), s = (u, C) => {
436
- b.emit(o, x, u, C);
437
- }, g = G({
435
+ }), s = (u, b) => {
436
+ v.emit(o, L, u, b);
437
+ }, g = U({
438
438
  type: "link",
439
439
  linkVisible: !1,
440
440
  clipVisible: !1
441
- }), p = P();
442
- Q(() => {
443
- b.on(o, {
444
- name: Te,
441
+ }), w = R();
442
+ Y(() => {
443
+ v.on(o, {
444
+ name: ke,
445
445
  callback(u) {
446
446
  g.type = u, g.linkVisible = !0;
447
447
  }
448
448
  });
449
449
  });
450
- const k = we(() => {
451
- const u = e.toolbars.filter((M) => !e.toolbarsExclude.includes(M)), C = u.indexOf("="), w = C === -1 ? u : u.slice(0, C + 1), S = C === -1 ? [] : u.slice(C, Number.MAX_SAFE_INTEGER);
452
- return [w, S];
453
- }), $ = P(), m = () => {
454
- b.emit(o, xe, Array.from($.value.files || [])), $.value.value = "";
450
+ const $ = Ce(() => {
451
+ const u = e.toolbars.filter((C) => !e.toolbarsExclude.includes(C)), b = u.indexOf("="), p = b === -1 ? u : u.slice(0, b + 1), y = b === -1 ? [] : u.slice(b, Number.MAX_SAFE_INTEGER);
452
+ return [p, y];
453
+ }), S = R(), m = () => {
454
+ v.emit(o, $e, Array.from(S.value.files || [])), S.value.value = "";
455
455
  };
456
- Q(() => {
457
- $.value.addEventListener("change", m);
456
+ Y(() => {
457
+ S.value.addEventListener("change", m);
458
458
  });
459
- const v = (u) => {
460
- var C, w, S, M, D, oe, ae, A, L, q, z, O, N, B, V, K, j, me, ne, Y, Z, ie, X, F, R, re, ge, Me, Ae, Le, Ie, De, Ee, He, Ne, Be, Oe, Ve, Fe, Re, Pe, We, ze, qe, Ue, _e, Ge, Ke, je, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, it, rt, st, ct, ut, dt, mt;
461
- if (qt.includes(u))
459
+ const k = (u) => {
460
+ var b, p, y, C, A, P, V, W, q, F, D, N, Z, G, K, te, le, oe, j, B, M, me, ye, Te, we, xe, Se, Ae, Le, Ie, Me, Ee, He, De, Ne, Be, Ve, Fe, Re, Oe, Pe, We, ze, _e, Ue, qe, Ge, Ke, je, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, it, rt, st, ct, ut, dt, mt;
461
+ if (_t.includes(u))
462
462
  switch (u) {
463
463
  case "-":
464
- return t(Al, null, null);
464
+ return t(Ll, null, null);
465
465
  case "bold":
466
466
  return t("div", {
467
- class: `${n}-toolbar-item`,
468
- title: (C = l.value.toolbarTips) == null ? void 0 : C.bold,
467
+ class: `${a}-toolbar-item`,
468
+ title: (b = l.value.toolbarTips) == null ? void 0 : b.bold,
469
469
  onClick: () => {
470
470
  s("bold");
471
471
  }
472
- }, [t(T, {
472
+ }, [t(x, {
473
473
  name: "bold"
474
474
  }, null), e.showToolbarName && t("div", {
475
- class: `${n}-toolbar-item-name`
476
- }, [(w = l.value.toolbarTips) == null ? void 0 : w.bold])]);
475
+ class: `${a}-toolbar-item-name`
476
+ }, [(p = l.value.toolbarTips) == null ? void 0 : p.bold])]);
477
477
  case "underline":
478
478
  return t("div", {
479
- class: `${n}-toolbar-item`,
480
- title: (S = l.value.toolbarTips) == null ? void 0 : S.underline,
479
+ class: `${a}-toolbar-item`,
480
+ title: (y = l.value.toolbarTips) == null ? void 0 : y.underline,
481
481
  onClick: () => {
482
482
  s("underline");
483
483
  }
484
- }, [t(T, {
484
+ }, [t(x, {
485
485
  name: "underline"
486
486
  }, null), e.showToolbarName && t("div", {
487
- class: `${n}-toolbar-item-name`
488
- }, [(M = l.value.toolbarTips) == null ? void 0 : M.underline])]);
487
+ class: `${a}-toolbar-item-name`
488
+ }, [(C = l.value.toolbarTips) == null ? void 0 : C.underline])]);
489
489
  case "italic":
490
490
  return t("div", {
491
- class: `${n}-toolbar-item`,
492
- title: (D = l.value.toolbarTips) == null ? void 0 : D.italic,
491
+ class: `${a}-toolbar-item`,
492
+ title: (A = l.value.toolbarTips) == null ? void 0 : A.italic,
493
493
  onClick: () => {
494
494
  s("italic");
495
495
  }
496
- }, [t(T, {
496
+ }, [t(x, {
497
497
  name: "italic"
498
498
  }, null), e.showToolbarName && t("div", {
499
- class: `${n}-toolbar-item-name`
500
- }, [(oe = l.value.toolbarTips) == null ? void 0 : oe.italic])]);
499
+ class: `${a}-toolbar-item-name`
500
+ }, [(P = l.value.toolbarTips) == null ? void 0 : P.italic])]);
501
501
  case "strikeThrough":
502
502
  return t("div", {
503
- class: `${n}-toolbar-item`,
504
- title: (ae = l.value.toolbarTips) == null ? void 0 : ae.strikeThrough,
503
+ class: `${a}-toolbar-item`,
504
+ title: (V = l.value.toolbarTips) == null ? void 0 : V.strikeThrough,
505
505
  onClick: () => {
506
506
  s("strikeThrough");
507
507
  }
508
- }, [t(T, {
508
+ }, [t(x, {
509
509
  name: "strike-through"
510
510
  }, null), e.showToolbarName && t("div", {
511
- class: `${n}-toolbar-item-name`
512
- }, [(A = l.value.toolbarTips) == null ? void 0 : A.strikeThrough])]);
511
+ class: `${a}-toolbar-item-name`
512
+ }, [(W = l.value.toolbarTips) == null ? void 0 : W.strikeThrough])]);
513
513
  case "title":
514
- return t(se, {
514
+ return t(ae, {
515
515
  relative: `#${h}`,
516
516
  visible: d.title,
517
- onChange: (y) => {
518
- d.title = y;
517
+ onChange: (T) => {
518
+ d.title = T;
519
519
  },
520
520
  overlay: t("ul", {
521
- class: `${n}-menu`,
521
+ class: `${a}-menu`,
522
522
  onClick: () => {
523
523
  d.title = !1;
524
524
  }
525
525
  }, [t("li", {
526
- class: `${n}-menu-item ${n}-menu-item-title`,
526
+ class: `${a}-menu-item ${a}-menu-item-title`,
527
527
  onClick: () => {
528
528
  s("h1");
529
529
  }
530
- }, [(L = l.value.titleItem) == null ? void 0 : L.h1]), t("li", {
531
- class: `${n}-menu-item ${n}-menu-item-title`,
530
+ }, [(q = l.value.titleItem) == null ? void 0 : q.h1]), t("li", {
531
+ class: `${a}-menu-item ${a}-menu-item-title`,
532
532
  onClick: () => {
533
533
  s("h2");
534
534
  }
535
- }, [(q = l.value.titleItem) == null ? void 0 : q.h2]), t("li", {
536
- class: `${n}-menu-item ${n}-menu-item-title`,
535
+ }, [(F = l.value.titleItem) == null ? void 0 : F.h2]), t("li", {
536
+ class: `${a}-menu-item ${a}-menu-item-title`,
537
537
  onClick: () => {
538
538
  s("h3");
539
539
  }
540
- }, [(z = l.value.titleItem) == null ? void 0 : z.h3]), t("li", {
541
- class: `${n}-menu-item ${n}-menu-item-title`,
540
+ }, [(D = l.value.titleItem) == null ? void 0 : D.h3]), t("li", {
541
+ class: `${a}-menu-item ${a}-menu-item-title`,
542
542
  onClick: () => {
543
543
  s("h4");
544
544
  }
545
- }, [(O = l.value.titleItem) == null ? void 0 : O.h4]), t("li", {
546
- class: `${n}-menu-item ${n}-menu-item-title`,
545
+ }, [(N = l.value.titleItem) == null ? void 0 : N.h4]), t("li", {
546
+ class: `${a}-menu-item ${a}-menu-item-title`,
547
547
  onClick: () => {
548
548
  s("h5");
549
549
  }
550
- }, [(N = l.value.titleItem) == null ? void 0 : N.h5]), t("li", {
551
- class: `${n}-menu-item ${n}-menu-item-title`,
550
+ }, [(Z = l.value.titleItem) == null ? void 0 : Z.h5]), t("li", {
551
+ class: `${a}-menu-item ${a}-menu-item-title`,
552
552
  onClick: () => {
553
553
  s("h6");
554
554
  }
555
- }, [(B = l.value.titleItem) == null ? void 0 : B.h6])])
555
+ }, [(G = l.value.titleItem) == null ? void 0 : G.h6])])
556
556
  }, {
557
557
  default: () => {
558
- var y, E;
558
+ var T, E;
559
559
  return [t("div", {
560
- class: `${n}-toolbar-item`,
561
- title: (y = l.value.toolbarTips) == null ? void 0 : y.title
562
- }, [t(T, {
560
+ class: `${a}-toolbar-item`,
561
+ title: (T = l.value.toolbarTips) == null ? void 0 : T.title
562
+ }, [t(x, {
563
563
  name: "title"
564
564
  }, null), e.showToolbarName && t("div", {
565
- class: `${n}-toolbar-item-name`
565
+ class: `${a}-toolbar-item-name`
566
566
  }, [(E = l.value.toolbarTips) == null ? void 0 : E.title])])];
567
567
  }
568
568
  });
569
569
  case "sub":
570
570
  return t("div", {
571
- class: `${n}-toolbar-item`,
572
- title: (V = l.value.toolbarTips) == null ? void 0 : V.sub,
571
+ class: `${a}-toolbar-item`,
572
+ title: (K = l.value.toolbarTips) == null ? void 0 : K.sub,
573
573
  onClick: () => {
574
574
  s("sub");
575
575
  }
576
- }, [t(T, {
576
+ }, [t(x, {
577
577
  name: "sub"
578
578
  }, null), e.showToolbarName && t("div", {
579
- class: `${n}-toolbar-item-name`
580
- }, [(K = l.value.toolbarTips) == null ? void 0 : K.sub])]);
579
+ class: `${a}-toolbar-item-name`
580
+ }, [(te = l.value.toolbarTips) == null ? void 0 : te.sub])]);
581
581
  case "sup":
582
582
  return t("div", {
583
- class: `${n}-toolbar-item`,
584
- title: (j = l.value.toolbarTips) == null ? void 0 : j.sup,
583
+ class: `${a}-toolbar-item`,
584
+ title: (le = l.value.toolbarTips) == null ? void 0 : le.sup,
585
585
  onClick: () => {
586
586
  s("sup");
587
587
  }
588
- }, [t(T, {
588
+ }, [t(x, {
589
589
  name: "sup"
590
590
  }, null), e.showToolbarName && t("div", {
591
- class: `${n}-toolbar-item-name`
592
- }, [(me = l.value.toolbarTips) == null ? void 0 : me.sup])]);
591
+ class: `${a}-toolbar-item-name`
592
+ }, [(oe = l.value.toolbarTips) == null ? void 0 : oe.sup])]);
593
593
  case "quote":
594
594
  return t("div", {
595
- class: `${n}-toolbar-item`,
596
- title: (ne = l.value.toolbarTips) == null ? void 0 : ne.quote,
595
+ class: `${a}-toolbar-item`,
596
+ title: (j = l.value.toolbarTips) == null ? void 0 : j.quote,
597
597
  onClick: () => {
598
598
  s("quote");
599
599
  }
600
- }, [t(T, {
600
+ }, [t(x, {
601
601
  name: "quote"
602
602
  }, null), e.showToolbarName && t("div", {
603
- class: `${n}-toolbar-item-name`
604
- }, [(Y = l.value.toolbarTips) == null ? void 0 : Y.quote])]);
603
+ class: `${a}-toolbar-item-name`
604
+ }, [(B = l.value.toolbarTips) == null ? void 0 : B.quote])]);
605
605
  case "unorderedList":
606
606
  return t("div", {
607
- class: `${n}-toolbar-item`,
608
- title: (Z = l.value.toolbarTips) == null ? void 0 : Z.unorderedList,
607
+ class: `${a}-toolbar-item`,
608
+ title: (M = l.value.toolbarTips) == null ? void 0 : M.unorderedList,
609
609
  onClick: () => {
610
610
  s("unorderedList");
611
611
  }
612
- }, [t(T, {
612
+ }, [t(x, {
613
613
  name: "unordered-list"
614
614
  }, null), e.showToolbarName && t("div", {
615
- class: `${n}-toolbar-item-name`
616
- }, [(ie = l.value.toolbarTips) == null ? void 0 : ie.unorderedList])]);
615
+ class: `${a}-toolbar-item-name`
616
+ }, [(me = l.value.toolbarTips) == null ? void 0 : me.unorderedList])]);
617
617
  case "orderedList":
618
618
  return t("div", {
619
- class: `${n}-toolbar-item`,
620
- title: (X = l.value.toolbarTips) == null ? void 0 : X.orderedList,
619
+ class: `${a}-toolbar-item`,
620
+ title: (ye = l.value.toolbarTips) == null ? void 0 : ye.orderedList,
621
621
  onClick: () => {
622
622
  s("orderedList");
623
623
  }
624
- }, [t(T, {
624
+ }, [t(x, {
625
625
  name: "ordered-list"
626
626
  }, null), e.showToolbarName && t("div", {
627
- class: `${n}-toolbar-item-name`
628
- }, [(F = l.value.toolbarTips) == null ? void 0 : F.orderedList])]);
627
+ class: `${a}-toolbar-item-name`
628
+ }, [(Te = l.value.toolbarTips) == null ? void 0 : Te.orderedList])]);
629
629
  case "task":
630
630
  return t("div", {
631
- class: `${n}-toolbar-item`,
632
- title: (R = l.value.toolbarTips) == null ? void 0 : R.task,
631
+ class: `${a}-toolbar-item`,
632
+ title: (we = l.value.toolbarTips) == null ? void 0 : we.task,
633
633
  onClick: () => {
634
634
  s("task");
635
635
  }
636
- }, [t(T, {
636
+ }, [t(x, {
637
637
  name: "task"
638
638
  }, null), e.showToolbarName && t("div", {
639
- class: `${n}-toolbar-item-name`
640
- }, [(re = l.value.toolbarTips) == null ? void 0 : re.task])]);
639
+ class: `${a}-toolbar-item-name`
640
+ }, [(xe = l.value.toolbarTips) == null ? void 0 : xe.task])]);
641
641
  case "codeRow":
642
642
  return t("div", {
643
- class: `${n}-toolbar-item`,
644
- title: (ge = l.value.toolbarTips) == null ? void 0 : ge.codeRow,
643
+ class: `${a}-toolbar-item`,
644
+ title: (Se = l.value.toolbarTips) == null ? void 0 : Se.codeRow,
645
645
  onClick: () => {
646
646
  s("codeRow");
647
647
  }
648
- }, [t(T, {
648
+ }, [t(x, {
649
649
  name: "code-row"
650
650
  }, null), e.showToolbarName && t("div", {
651
- class: `${n}-toolbar-item-name`
652
- }, [(Me = l.value.toolbarTips) == null ? void 0 : Me.codeRow])]);
651
+ class: `${a}-toolbar-item-name`
652
+ }, [(Ae = l.value.toolbarTips) == null ? void 0 : Ae.codeRow])]);
653
653
  case "code":
654
654
  return t("div", {
655
- class: `${n}-toolbar-item`,
656
- title: (Ae = l.value.toolbarTips) == null ? void 0 : Ae.code,
655
+ class: `${a}-toolbar-item`,
656
+ title: (Le = l.value.toolbarTips) == null ? void 0 : Le.code,
657
657
  onClick: () => {
658
658
  s("code");
659
659
  }
660
- }, [t(T, {
660
+ }, [t(x, {
661
661
  name: "code"
662
662
  }, null), e.showToolbarName && t("div", {
663
- class: `${n}-toolbar-item-name`
664
- }, [(Le = l.value.toolbarTips) == null ? void 0 : Le.code])]);
663
+ class: `${a}-toolbar-item-name`
664
+ }, [(Ie = l.value.toolbarTips) == null ? void 0 : Ie.code])]);
665
665
  case "link":
666
666
  return t("div", {
667
- class: `${n}-toolbar-item`,
668
- title: (Ie = l.value.toolbarTips) == null ? void 0 : Ie.link,
667
+ class: `${a}-toolbar-item`,
668
+ title: (Me = l.value.toolbarTips) == null ? void 0 : Me.link,
669
669
  onClick: () => {
670
670
  g.type = "link", g.linkVisible = !0;
671
671
  }
672
- }, [t(T, {
672
+ }, [t(x, {
673
673
  name: "link"
674
674
  }, null), e.showToolbarName && t("div", {
675
- class: `${n}-toolbar-item-name`
676
- }, [(De = l.value.toolbarTips) == null ? void 0 : De.link])]);
675
+ class: `${a}-toolbar-item-name`
676
+ }, [(Ee = l.value.toolbarTips) == null ? void 0 : Ee.link])]);
677
677
  case "image":
678
678
  return e.noUploadImg ? t("div", {
679
- class: `${n}-toolbar-item`,
680
- title: (Ee = l.value.toolbarTips) == null ? void 0 : Ee.image,
679
+ class: `${a}-toolbar-item`,
680
+ title: (He = l.value.toolbarTips) == null ? void 0 : He.image,
681
681
  onClick: () => {
682
682
  g.type = "image", g.linkVisible = !0;
683
683
  }
684
- }, [t(T, {
684
+ }, [t(x, {
685
685
  name: "image"
686
686
  }, null), e.showToolbarName && t("div", {
687
- class: `${n}-toolbar-item-name`
688
- }, [(He = l.value.toolbarTips) == null ? void 0 : He.image])]) : t(se, {
687
+ class: `${a}-toolbar-item-name`
688
+ }, [(De = l.value.toolbarTips) == null ? void 0 : De.image])]) : t(ae, {
689
689
  relative: `#${h}`,
690
690
  visible: d.image,
691
- onChange: (y) => {
692
- d.image = y;
691
+ onChange: (T) => {
692
+ d.image = T;
693
693
  },
694
694
  overlay: t("ul", {
695
- class: `${n}-menu`,
695
+ class: `${a}-menu`,
696
696
  onClick: () => {
697
697
  d.title = !1;
698
698
  }
699
699
  }, [t("li", {
700
- class: `${n}-menu-item ${n}-menu-item-image`,
700
+ class: `${a}-menu-item ${a}-menu-item-image`,
701
701
  onClick: () => {
702
702
  g.type = "image", g.linkVisible = !0;
703
703
  }
704
704
  }, [(Ne = l.value.imgTitleItem) == null ? void 0 : Ne.link]), t("li", {
705
- class: `${n}-menu-item ${n}-menu-item-image`,
705
+ class: `${a}-menu-item ${a}-menu-item-image`,
706
706
  onClick: () => {
707
- $.value.click();
707
+ S.value.click();
708
708
  }
709
709
  }, [(Be = l.value.imgTitleItem) == null ? void 0 : Be.upload]), t("li", {
710
- class: `${n}-menu-item ${n}-menu-item-image`,
710
+ class: `${a}-menu-item ${a}-menu-item-image`,
711
711
  onClick: () => {
712
712
  g.clipVisible = !0;
713
713
  }
714
- }, [(Oe = l.value.imgTitleItem) == null ? void 0 : Oe.clip2upload])])
714
+ }, [(Ve = l.value.imgTitleItem) == null ? void 0 : Ve.clip2upload])])
715
715
  }, {
716
716
  default: () => {
717
- var y, E;
717
+ var T, E;
718
718
  return [t("div", {
719
- class: `${n}-toolbar-item`,
720
- title: (y = l.value.toolbarTips) == null ? void 0 : y.image
721
- }, [t(T, {
719
+ class: `${a}-toolbar-item`,
720
+ title: (T = l.value.toolbarTips) == null ? void 0 : T.image
721
+ }, [t(x, {
722
722
  name: "image"
723
723
  }, null), e.showToolbarName && t("div", {
724
- class: `${n}-toolbar-item-name`
724
+ class: `${a}-toolbar-item-name`
725
725
  }, [(E = l.value.toolbarTips) == null ? void 0 : E.image])])];
726
726
  }
727
727
  });
728
728
  case "table":
729
- return t(se, {
729
+ return t(ae, {
730
730
  relative: `#${h}`,
731
731
  visible: d.table,
732
- onChange: (y) => {
733
- d.table = y;
732
+ onChange: (T) => {
733
+ d.table = T;
734
734
  },
735
735
  key: "bar-table",
736
- overlay: t(Hl, {
736
+ overlay: t(Dl, {
737
737
  tableShape: e.tableShape,
738
- onSelected: (y) => {
738
+ onSelected: (T) => {
739
739
  s("table", {
740
- selectedShape: y
740
+ selectedShape: T
741
741
  });
742
742
  }
743
743
  }, null)
744
744
  }, {
745
745
  default: () => {
746
- var y, E;
746
+ var T, E;
747
747
  return [t("div", {
748
- class: `${n}-toolbar-item`,
749
- title: (y = l.value.toolbarTips) == null ? void 0 : y.table
750
- }, [t(T, {
748
+ class: `${a}-toolbar-item`,
749
+ title: (T = l.value.toolbarTips) == null ? void 0 : T.table
750
+ }, [t(x, {
751
751
  name: "table"
752
752
  }, null), e.showToolbarName && t("div", {
753
- class: `${n}-toolbar-item-name`
753
+ class: `${a}-toolbar-item-name`
754
754
  }, [(E = l.value.toolbarTips) == null ? void 0 : E.table])])];
755
755
  }
756
756
  });
757
757
  case "revoke":
758
758
  return t("div", {
759
- class: `${n}-toolbar-item`,
760
- title: (Ve = l.value.toolbarTips) == null ? void 0 : Ve.revoke,
759
+ class: `${a}-toolbar-item`,
760
+ title: (Fe = l.value.toolbarTips) == null ? void 0 : Fe.revoke,
761
761
  onClick: () => {
762
- b.emit(o, Nt);
762
+ v.emit(o, Nt);
763
763
  }
764
- }, [t(T, {
764
+ }, [t(x, {
765
765
  name: "revoke"
766
766
  }, null), e.showToolbarName && t("div", {
767
- class: `${n}-toolbar-item-name`
768
- }, [(Fe = l.value.toolbarTips) == null ? void 0 : Fe.revoke])]);
767
+ class: `${a}-toolbar-item-name`
768
+ }, [(Re = l.value.toolbarTips) == null ? void 0 : Re.revoke])]);
769
769
  case "next":
770
770
  return t("div", {
771
- class: `${n}-toolbar-item`,
772
- title: (Re = l.value.toolbarTips) == null ? void 0 : Re.next,
771
+ class: `${a}-toolbar-item`,
772
+ title: (Oe = l.value.toolbarTips) == null ? void 0 : Oe.next,
773
773
  onClick: () => {
774
- b.emit(o, Ht);
774
+ v.emit(o, Dt);
775
775
  }
776
- }, [t(T, {
776
+ }, [t(x, {
777
777
  name: "next"
778
778
  }, null), e.showToolbarName && t("div", {
779
- class: `${n}-toolbar-item-name`
779
+ class: `${a}-toolbar-item-name`
780
780
  }, [(Pe = l.value.toolbarTips) == null ? void 0 : Pe.next])]);
781
781
  case "save":
782
782
  return t("div", {
783
- class: `${n}-toolbar-item`,
783
+ class: `${a}-toolbar-item`,
784
784
  title: (We = l.value.toolbarTips) == null ? void 0 : We.save,
785
785
  onClick: () => {
786
- b.emit(o, Et);
786
+ v.emit(o, Ht);
787
787
  }
788
- }, [t(T, {
788
+ }, [t(x, {
789
789
  name: "baocun"
790
790
  }, null), e.showToolbarName && t("div", {
791
- class: `${n}-toolbar-item-name`
791
+ class: `${a}-toolbar-item-name`
792
792
  }, [(ze = l.value.toolbarTips) == null ? void 0 : ze.save])]);
793
793
  case "prettier":
794
794
  return e.noPrettier ? "" : t("div", {
795
- class: `${n}-toolbar-item`,
796
- title: (qe = l.value.toolbarTips) == null ? void 0 : qe.prettier,
795
+ class: `${a}-toolbar-item`,
796
+ title: (_e = l.value.toolbarTips) == null ? void 0 : _e.prettier,
797
797
  onClick: () => {
798
798
  s("prettier");
799
799
  }
800
- }, [t(T, {
800
+ }, [t(x, {
801
801
  name: "prettier"
802
802
  }, null), e.showToolbarName && t("div", {
803
- class: `${n}-toolbar-item-name`
803
+ class: `${a}-toolbar-item-name`
804
804
  }, [(Ue = l.value.toolbarTips) == null ? void 0 : Ue.prettier])]);
805
805
  case "pageFullscreen":
806
806
  return !e.setting.fullscreen && t("div", {
807
- class: `${n}-toolbar-item`,
808
- title: (_e = l.value.toolbarTips) == null ? void 0 : _e.pageFullscreen,
807
+ class: `${a}-toolbar-item`,
808
+ title: (qe = l.value.toolbarTips) == null ? void 0 : qe.pageFullscreen,
809
809
  onClick: () => {
810
810
  e.updateSetting("pageFullscreen");
811
811
  }
812
- }, [t(T, {
812
+ }, [t(x, {
813
813
  name: e.setting.pageFullscreen ? "suoxiao" : "fangda"
814
814
  }, null), e.showToolbarName && t("div", {
815
- class: `${n}-toolbar-item-name`
815
+ class: `${a}-toolbar-item-name`
816
816
  }, [(Ge = l.value.toolbarTips) == null ? void 0 : Ge.pageFullscreen])]);
817
817
  case "fullscreen":
818
818
  return t("div", {
819
- class: `${n}-toolbar-item`,
819
+ class: `${a}-toolbar-item`,
820
820
  title: (Ke = l.value.toolbarTips) == null ? void 0 : Ke.fullscreen,
821
821
  onClick: () => {
822
822
  i();
823
823
  }
824
- }, [t(T, {
824
+ }, [t(x, {
825
825
  name: e.setting.fullscreen ? "fullscreen-exit" : "fullscreen"
826
826
  }, null), e.showToolbarName && t("div", {
827
- class: `${n}-toolbar-item-name`
827
+ class: `${a}-toolbar-item-name`
828
828
  }, [(je = l.value.toolbarTips) == null ? void 0 : je.fullscreen])]);
829
829
  case "preview":
830
830
  return t("div", {
831
- class: `${n}-toolbar-item`,
831
+ class: `${a}-toolbar-item`,
832
832
  title: (Ze = l.value.toolbarTips) == null ? void 0 : Ze.preview,
833
833
  onClick: () => {
834
834
  e.updateSetting("preview");
835
835
  }
836
- }, [t(T, {
836
+ }, [t(x, {
837
837
  name: "preview"
838
838
  }, null), e.showToolbarName && t("div", {
839
- class: `${n}-toolbar-item-name`
839
+ class: `${a}-toolbar-item-name`
840
840
  }, [(Xe = l.value.toolbarTips) == null ? void 0 : Xe.preview])]);
841
841
  case "htmlPreview":
842
842
  return t("div", {
843
- class: `${n}-toolbar-item`,
843
+ class: `${a}-toolbar-item`,
844
844
  title: (Ye = l.value.toolbarTips) == null ? void 0 : Ye.htmlPreview,
845
845
  onClick: () => {
846
846
  e.updateSetting("htmlPreview");
847
847
  }
848
- }, [t(T, {
848
+ }, [t(x, {
849
849
  name: "coding"
850
850
  }, null), e.showToolbarName && t("div", {
851
- class: `${n}-toolbar-item-name`
851
+ class: `${a}-toolbar-item-name`
852
852
  }, [(Je = l.value.toolbarTips) == null ? void 0 : Je.htmlPreview])]);
853
853
  case "catalog":
854
854
  return t("div", {
855
- class: `${n}-toolbar-item`,
855
+ class: `${a}-toolbar-item`,
856
856
  title: (Qe = l.value.toolbarTips) == null ? void 0 : Qe.catalog,
857
857
  onClick: () => {
858
- b.emit(o, Qt);
858
+ v.emit(o, Qt);
859
859
  },
860
860
  key: "bar-catalog"
861
- }, [t(T, {
861
+ }, [t(x, {
862
862
  name: "catalog"
863
863
  }, null), e.showToolbarName && t("div", {
864
- class: `${n}-toolbar-item-name`
864
+ class: `${a}-toolbar-item-name`
865
865
  }, [(et = l.value.toolbarTips) == null ? void 0 : et.catalog])]);
866
866
  case "github":
867
867
  return t("div", {
868
- class: `${n}-toolbar-item`,
868
+ class: `${a}-toolbar-item`,
869
869
  title: (tt = l.value.toolbarTips) == null ? void 0 : tt.github,
870
870
  onClick: () => Gt("https://github.com/imzbf/md-editor-v3")
871
- }, [t(T, {
871
+ }, [t(x, {
872
872
  name: "github"
873
873
  }, null), e.showToolbarName && t("div", {
874
- class: `${n}-toolbar-item-name`
874
+ class: `${a}-toolbar-item-name`
875
875
  }, [(lt = l.value.toolbarTips) == null ? void 0 : lt.github])]);
876
876
  case "mermaid":
877
- return t(se, {
877
+ return t(ae, {
878
878
  relative: `#${h}`,
879
879
  visible: d.mermaid,
880
- onChange: (y) => {
881
- d.mermaid = y;
880
+ onChange: (T) => {
881
+ d.mermaid = T;
882
882
  },
883
883
  overlay: t("ul", {
884
- class: `${n}-menu`,
884
+ class: `${a}-menu`,
885
885
  onClick: () => {
886
886
  d.mermaid = !1;
887
887
  }
888
888
  }, [t("li", {
889
- class: `${n}-menu-item ${n}-menu-item-mermaid`,
889
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
890
890
  onClick: () => {
891
891
  s("flow");
892
892
  }
893
893
  }, [(ot = l.value.mermaid) == null ? void 0 : ot.flow]), t("li", {
894
- class: `${n}-menu-item ${n}-menu-item-mermaid`,
894
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
895
895
  onClick: () => {
896
896
  s("sequence");
897
897
  }
898
898
  }, [(at = l.value.mermaid) == null ? void 0 : at.sequence]), t("li", {
899
- class: `${n}-menu-item ${n}-menu-item-mermaid`,
899
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
900
900
  onClick: () => {
901
901
  s("gantt");
902
902
  }
903
903
  }, [(nt = l.value.mermaid) == null ? void 0 : nt.gantt]), t("li", {
904
- class: `${n}-menu-item ${n}-menu-item-mermaid`,
904
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
905
905
  onClick: () => {
906
906
  s("class");
907
907
  }
908
908
  }, [(it = l.value.mermaid) == null ? void 0 : it.class]), t("li", {
909
- class: `${n}-menu-item ${n}-menu-item-mermaid`,
909
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
910
910
  onClick: () => {
911
911
  s("state");
912
912
  }
913
913
  }, [(rt = l.value.mermaid) == null ? void 0 : rt.state]), t("li", {
914
- class: `${n}-menu-item ${n}-menu-item-mermaid`,
914
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
915
915
  onClick: () => {
916
916
  s("pie");
917
917
  }
918
918
  }, [(st = l.value.mermaid) == null ? void 0 : st.pie]), t("li", {
919
- class: `${n}-menu-item ${n}-menu-item-mermaid`,
919
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
920
920
  onClick: () => {
921
921
  s("relationship");
922
922
  }
923
923
  }, [(ct = l.value.mermaid) == null ? void 0 : ct.relationship]), t("li", {
924
- class: `${n}-menu-item ${n}-menu-item-mermaid`,
924
+ class: `${a}-menu-item ${a}-menu-item-mermaid`,
925
925
  onClick: () => {
926
926
  s("journey");
927
927
  }
@@ -929,36 +929,36 @@ const Al = /* @__PURE__ */ W({
929
929
  key: "bar-mermaid"
930
930
  }, {
931
931
  default: () => {
932
- var y, E;
932
+ var T, E;
933
933
  return [t("div", {
934
- class: `${n}-toolbar-item`,
935
- title: (y = l.value.toolbarTips) == null ? void 0 : y.mermaid
936
- }, [t(T, {
934
+ class: `${a}-toolbar-item`,
935
+ title: (T = l.value.toolbarTips) == null ? void 0 : T.mermaid
936
+ }, [t(x, {
937
937
  name: "mermaid"
938
938
  }, null), e.showToolbarName && t("div", {
939
- class: `${n}-toolbar-item-name`
939
+ class: `${a}-toolbar-item-name`
940
940
  }, [(E = l.value.toolbarTips) == null ? void 0 : E.mermaid])])];
941
941
  }
942
942
  });
943
943
  case "katex":
944
- return t(se, {
944
+ return t(ae, {
945
945
  relative: `#${h}`,
946
946
  visible: d.katex,
947
- onChange: (y) => {
948
- d.katex = y;
947
+ onChange: (T) => {
948
+ d.katex = T;
949
949
  },
950
950
  overlay: t("ul", {
951
- class: `${n}-menu`,
951
+ class: `${a}-menu`,
952
952
  onClick: () => {
953
953
  d.katex = !1;
954
954
  }
955
955
  }, [t("li", {
956
- class: `${n}-menu-item ${n}-menu-item-katex`,
956
+ class: `${a}-menu-item ${a}-menu-item-katex`,
957
957
  onClick: () => {
958
958
  s("katexInline");
959
959
  }
960
960
  }, [(dt = l.value.katex) == null ? void 0 : dt.inline]), t("li", {
961
- class: `${n}-menu-item ${n}-menu-item-katex`,
961
+ class: `${a}-menu-item ${a}-menu-item-katex`,
962
962
  onClick: () => {
963
963
  s("katexBlock");
964
964
  }
@@ -966,37 +966,37 @@ const Al = /* @__PURE__ */ W({
966
966
  key: "bar-katex"
967
967
  }, {
968
968
  default: () => {
969
- var y, E;
969
+ var T, E;
970
970
  return [t("div", {
971
- class: `${n}-toolbar-item`,
972
- title: (y = l.value.toolbarTips) == null ? void 0 : y.katex
973
- }, [t(T, {
971
+ class: `${a}-toolbar-item`,
972
+ title: (T = l.value.toolbarTips) == null ? void 0 : T.katex
973
+ }, [t(x, {
974
974
  name: "formula"
975
975
  }, null), e.showToolbarName && t("div", {
976
- class: `${n}-toolbar-item-name`
976
+ class: `${a}-toolbar-item-name`
977
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
- const y = e.defToolbars[u];
983
- return y ? gt(y, {
984
- theme: a.value,
982
+ const T = e.defToolbars[u];
983
+ return T ? gt(T, {
984
+ theme: n.value,
985
985
  language: r.value,
986
- insert(ke) {
987
- b.emit(o, x, "universal", {
988
- generate: ke
986
+ insert(ge) {
987
+ v.emit(o, L, "universal", {
988
+ generate: ge
989
989
  });
990
990
  }
991
991
  }) : "";
992
992
  } else if (e.defToolbars && e.defToolbars.children instanceof Array) {
993
- const y = e.defToolbars.children[u];
994
- return y ? gt(y, {
995
- theme: a.value,
993
+ const T = e.defToolbars.children[u];
994
+ return T ? gt(T, {
995
+ theme: n.value,
996
996
  language: r.value,
997
- insert(ke) {
998
- b.emit(o, x, "universal", {
999
- generate: ke
997
+ insert(ge) {
998
+ v.emit(o, L, "universal", {
999
+ generate: ge
1000
1000
  });
1001
1001
  }
1002
1002
  }) : "";
@@ -1004,57 +1004,57 @@ const Al = /* @__PURE__ */ W({
1004
1004
  return "";
1005
1005
  };
1006
1006
  return H(() => e.toolbars, () => {
1007
- ve(() => {
1008
- f.value && _t(f.value);
1007
+ de(() => {
1008
+ f.value && qt(f.value);
1009
1009
  });
1010
1010
  }, {
1011
1011
  immediate: !0
1012
1012
  }), () => {
1013
- const u = k.value[0].map((w) => v(w)), C = k.value[1].map((w) => v(w));
1014
- return t(It, null, [e.toolbars.length > 0 && t("div", {
1015
- class: `${n}-toolbar-wrapper`,
1013
+ const u = $.value[0].map((p) => k(p)), b = $.value[1].map((p) => k(p));
1014
+ return t(Mt, null, [e.toolbars.length > 0 && t("div", {
1015
+ class: `${a}-toolbar-wrapper`,
1016
1016
  ref: f,
1017
1017
  id: h
1018
1018
  }, [t("div", {
1019
- class: [`${n}-toolbar`, e.showToolbarName && `${n}-stn`]
1019
+ class: [`${a}-toolbar`, e.showToolbarName && `${a}-stn`]
1020
1020
  }, [t("div", {
1021
- class: `${n}-toolbar-left`,
1022
- ref: p
1021
+ class: `${a}-toolbar-left`,
1022
+ ref: w
1023
1023
  }, [u]), t("div", {
1024
- class: `${n}-toolbar-right`
1025
- }, [C])])]), t("input", {
1026
- ref: $,
1024
+ class: `${a}-toolbar-right`
1025
+ }, [b])])]), t("input", {
1026
+ ref: S,
1027
1027
  accept: "image/*",
1028
1028
  type: "file",
1029
1029
  multiple: !0,
1030
1030
  style: {
1031
1031
  display: "none"
1032
1032
  }
1033
- }, null), t(Rl, {
1033
+ }, null), t(Ol, {
1034
1034
  linkVisible: g.linkVisible,
1035
1035
  clipVisible: g.clipVisible,
1036
1036
  type: g.type,
1037
1037
  onCancel: () => {
1038
1038
  g.linkVisible = !1, g.clipVisible = !1;
1039
1039
  },
1040
- onOk: (w) => {
1041
- w && s(g.type, {
1042
- desc: w.desc,
1043
- url: w.url
1040
+ onOk: (p) => {
1041
+ p && s(g.type, {
1042
+ desc: p.desc,
1043
+ url: p.url
1044
1044
  }), g.linkVisible = !1, g.clipVisible = !1;
1045
1045
  }
1046
1046
  }, null)]);
1047
1047
  };
1048
1048
  }
1049
- }), Wl = (e, o) => {
1049
+ }), Wl = `.${a}-preview > [data-line]`, zl = (e, o) => {
1050
1050
  const l = Kt(() => {
1051
- e.removeEventListener("scroll", a), e.addEventListener("scroll", a), o.removeEventListener("scroll", a), o.addEventListener("scroll", a);
1052
- }, 50), a = (r) => {
1051
+ e.removeEventListener("scroll", n), e.addEventListener("scroll", n), o.removeEventListener("scroll", n), o.addEventListener("scroll", n);
1052
+ }, 50), n = (r) => {
1053
1053
  const i = e.clientHeight, h = o.clientHeight, f = e.scrollHeight, d = o.scrollHeight, s = (f - i) / (d - h);
1054
- r.target === e ? (o.removeEventListener("scroll", a), o.scrollTo({
1054
+ r.target === e ? (o.removeEventListener("scroll", n), o.scrollTo({
1055
1055
  top: e.scrollTop / s
1056
1056
  // behavior: 'smooth'
1057
- }), l()) : (e.removeEventListener("scroll", a), e.scrollTo({
1057
+ }), l()) : (e.removeEventListener("scroll", n), e.scrollTo({
1058
1058
  top: o.scrollTop * s
1059
1059
  // behavior: 'smooth'
1060
1060
  }), l());
@@ -1066,130 +1066,129 @@ const Al = /* @__PURE__ */ W({
1066
1066
  });
1067
1067
  },
1068
1068
  () => {
1069
- e.removeEventListener("scroll", a), o.removeEventListener("scroll", a);
1069
+ e.removeEventListener("scroll", n), o.removeEventListener("scroll", n);
1070
1070
  }
1071
1071
  ];
1072
- }, zl = (e, o, l) => {
1073
- const { view: a } = l, r = jt(), i = (k) => a.lineBlockAt(a.state.doc.line(k).from).top, h = (k) => a.lineBlockAt(a.state.doc.line(k).from).height;
1074
- let f = [];
1075
- const d = () => {
1076
- f = [];
1077
- const k = Array.from(o.querySelectorAll("[data-line]")).map(
1078
- (u) => Number(u.dataset.line) + 1
1079
- ), { lines: $ } = a.state.doc;
1080
- let m = 1, v = k.shift() ?? $;
1081
- for (let u = 1; u <= $; u++)
1082
- u === v && (m = u, v = k.shift() || $ + 1), f.push({
1083
- start: m,
1084
- end: v - 1
1072
+ }, _l = (e, o, l) => {
1073
+ const { view: n } = l, r = jt(), i = (u) => n.lineBlockAt(n.state.doc.line(u).from).top, h = (u) => n.lineBlockAt(n.state.doc.line(u).from).height;
1074
+ let f = [], d = [], s = [];
1075
+ const g = () => {
1076
+ f = [], d = [], s = [], d = d.concat(
1077
+ Array.from(o.querySelectorAll(Wl))
1078
+ );
1079
+ const u = d.map((C) => Number(C.dataset.line) + 1);
1080
+ s = s.concat(u);
1081
+ const { lines: b } = n.state.doc;
1082
+ let p = 1, y = u.shift() ?? b;
1083
+ for (let C = 1; C <= b; C++)
1084
+ C === y && (p = C, y = u.shift() || b + 1), f.push({
1085
+ start: p,
1086
+ end: y - 1
1085
1087
  });
1086
1088
  };
1087
- let s = 0, g = 0;
1088
- const p = Zt((k) => {
1089
- var C, w, S, M, D, oe, ae;
1090
- if (!((C = o.firstElementChild) != null && C.firstElementChild))
1091
- return;
1092
- const $ = a.lineBlockAtHeight(a.scrollDOM.scrollTop), { number: m } = a.state.doc.lineAt($.from);
1093
- if (m > f.length || a.state.doc.lines < f[f.length - 1].end)
1089
+ let w = 0, $ = 0;
1090
+ const S = () => {
1091
+ var G, K;
1092
+ if ($ !== 0)
1093
+ return !1;
1094
+ w++;
1095
+ const { scrollDOM: u, contentHeight: b } = n;
1096
+ let p = +getComputedStyle(o).paddingTop.replace("px", "");
1097
+ const y = n.lineBlockAtHeight(u.scrollTop), { number: C } = n.state.doc.lineAt(y.from), A = f[C - 1];
1098
+ if (!A)
1099
+ return !1;
1100
+ let P = i(A.end) + h(A.end), V = 0;
1101
+ const W = i(A.start), q = o.querySelector(`[data-line="${A.start - 1}"]`) || ((G = o.firstElementChild) == null ? void 0 : G.firstElementChild), F = o.querySelector(`[data-line="${A.end}"]`) || ((K = o.lastElementChild) == null ? void 0 : K.lastElementChild);
1102
+ let D = 0, N = 0;
1103
+ W === 0 ? (V = u.scrollTop / P, q === F ? (p = 0, P = b - u.offsetHeight, D = F.offsetTop + F.offsetHeight - o.clientHeight) : D = F.offsetTop) : (V = (u.scrollTop - W) / (P - W), N = q.offsetTop, D = F.offsetTop - N), P > u.scrollHeight - u.clientHeight && (V = (u.scrollTop - W) / (u.scrollHeight - u.clientHeight - W), N = q.offsetTop, D = o.scrollHeight - o.clientHeight - N + 10);
1104
+ const Z = N - p + D * V;
1105
+ r(o, Z, () => {
1106
+ w--;
1107
+ });
1108
+ }, m = () => {
1109
+ var Z, G, K, te, le, oe;
1110
+ if (w !== 0)
1094
1111
  return;
1095
- let v = +getComputedStyle(o).paddingTop.replace("px", "");
1096
- const u = +getComputedStyle(o).paddingBottom.replace("px", "");
1097
- if (k.target === e) {
1098
- if (g !== 0)
1099
- return;
1100
- s++;
1101
- const A = f[m - 1];
1102
- let L = i(A.end) + h(A.end), q = 0;
1103
- const z = i(A.start), O = o.querySelector(`[data-line="${A.start - 1}"]`) || ((w = o.firstElementChild) == null ? void 0 : w.firstElementChild), N = o.querySelector(`[data-line="${A.end}"]`) || ((S = o.lastElementChild) == null ? void 0 : S.lastElementChild);
1104
- let B = 0, V = 0;
1105
- z === 0 ? O === N ? (v = 0, L = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight, q = a.scrollDOM.scrollTop / L, B = N.offsetTop + N.offsetHeight - o.clientHeight) : (q = a.scrollDOM.scrollTop / L, B = N.offsetTop) : L > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (q = (a.scrollDOM.scrollTop - z) / (a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight - z), V = O.offsetTop, B = o.scrollHeight - o.clientHeight - V + 10) : (q = (a.scrollDOM.scrollTop - z) / (L - z), V = O.offsetTop, B = N.offsetTop - V);
1106
- const K = V - v + B * q;
1107
- r(o, K, () => {
1108
- s--;
1109
- });
1110
- } else {
1111
- if (s !== 0)
1112
- return;
1113
- g++;
1114
- const A = Array.from(
1115
- o.querySelectorAll("[data-line]")
1116
- ), L = o.scrollTop, q = o.scrollHeight;
1117
- let z = A.length === 0 ? 1 : Math.ceil(
1118
- Number(A[A.length - 1].dataset.line) * (L / q)
1119
- ), O = (M = o.firstElementChild) == null ? void 0 : M.firstElementChild;
1120
- for (let F = z; F >= 0; F--) {
1121
- const R = o.querySelector(`[data-line="${F}"]`);
1122
- if (R && R.offsetTop <= L) {
1123
- O = R, z = F;
1124
- break;
1125
- }
1126
- }
1127
- let N = (D = o.firstElementChild) == null ? void 0 : D.firstElementChild, B = (oe = o.firstElementChild) == null ? void 0 : oe.lastElementChild;
1128
- for (; A.length > 0; ) {
1129
- const F = A.indexOf(O);
1130
- if (F + 1 >= A.length)
1112
+ $++;
1113
+ const { scrollDOM: u } = n, b = o.scrollTop, p = o.scrollHeight;
1114
+ let y = (Z = o.firstElementChild) == null ? void 0 : Z.firstElementChild, C = (G = o.firstElementChild) == null ? void 0 : G.lastElementChild;
1115
+ if (s.length > 0) {
1116
+ let j = Math.ceil(
1117
+ Number(s[s.length - 1]) * (b / p)
1118
+ ), B = s.findLastIndex((M) => M <= j);
1119
+ B = B === -1 ? 0 : B, j = s[B];
1120
+ for (let M = B; M >= 0 && M < s.length; )
1121
+ if (d[M].offsetTop > b) {
1122
+ if (M - 1 >= 0) {
1123
+ M--;
1124
+ continue;
1125
+ }
1126
+ j = -1, B = M;
1131
1127
  break;
1132
- const R = A[F + 1];
1133
- if (F === -1) {
1134
- B = R;
1128
+ } else {
1129
+ if (M + 1 <= s.length && d[M + 1].offsetTop < b) {
1130
+ M++;
1131
+ continue;
1132
+ }
1133
+ j = s[M], B = M;
1135
1134
  break;
1136
1135
  }
1137
- const re = O.offsetTop;
1138
- if (re > L) {
1139
- if (F === 0) {
1140
- N = O, B = R;
1141
- break;
1142
- }
1143
- O = A[F - 1];
1144
- continue;
1136
+ switch (j) {
1137
+ case -1: {
1138
+ y = (K = o.firstElementChild) == null ? void 0 : K.firstElementChild, C = d[B];
1139
+ break;
1145
1140
  }
1146
- const ge = R.offsetTop;
1147
- if (re <= L && ge > L) {
1148
- N = O, B = R;
1141
+ case s.length - 1: {
1142
+ y = d[B], C = (te = o.firstElementChild) == null ? void 0 : te.lastElementChild;
1149
1143
  break;
1150
1144
  }
1151
- O = R;
1145
+ default:
1146
+ y = d[B], C = d[B + 1];
1152
1147
  }
1153
- const V = N.offsetTop;
1154
- let K = B.offsetTop, j = 0;
1155
- const { start: me, end: ne } = f[Number(N.dataset.line || 0)], Y = i(me);
1156
- let Z = i(ne);
1157
- const ie = h(ne);
1158
- let X = 0;
1159
- N === ((ae = o.firstElementChild) == null ? void 0 : ae.firstElementChild) ? (N === B ? (K = B.offsetHeight - o.offsetHeight + v + u, X = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight) : X = Z + ie - Y, 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
- 0
1162
- ), Z = i(a.state.doc.lines) + h(a.state.doc.lines), X = 8 + Z - Y - e.clientHeight) : (j = Math.max(
1163
- (L - V) / (K - V),
1164
- 0
1165
- ), X = Z + ie - Y), r(e, Y + X * j, () => {
1166
- g--;
1167
- });
1168
1148
  }
1169
- }, 10);
1149
+ const A = y === ((le = o.firstElementChild) == null ? void 0 : le.firstElementChild) ? 0 : y.offsetTop;
1150
+ let P = C.offsetTop, V = 0;
1151
+ const { start: W, end: q } = f[Number(y.dataset.line || 0)], F = i(W);
1152
+ let D = i(q + 1), N = 0;
1153
+ D > u.scrollHeight - u.clientHeight || C.scrollTop > o.scrollHeight - o.clientHeight ? (V = Math.max(
1154
+ (b - A) / (o.scrollHeight - A - o.clientHeight),
1155
+ 0
1156
+ ), D = i(n.state.doc.lines) + h(n.state.doc.lines), N = 8 + D - F - e.clientHeight) : y === ((oe = o.firstElementChild) == null ? void 0 : oe.firstElementChild) ? (y === C && (P = C.offsetTop + C.offsetHeight + +getComputedStyle(C).marginBottom.replace("px", "")), N = D, V = Math.max(b / P, 0)) : (V = Math.max(
1157
+ (b - A) / (P - A),
1158
+ 0
1159
+ ), N = D - F), r(e, F + N * V, () => {
1160
+ $--;
1161
+ });
1162
+ }, k = Zt((u) => {
1163
+ var C;
1164
+ const { scrollDOM: b, contentHeight: p } = n, y = b.clientHeight;
1165
+ if (p <= y || o.firstElementChild.clientHeight <= o.clientHeight || n.state.doc.lines < ((C = f[f.length - 1]) == null ? void 0 : C.end))
1166
+ return !1;
1167
+ u.target === e ? S() : m();
1168
+ }, 8);
1170
1169
  return [
1171
1170
  () => {
1172
- d(), e.addEventListener("scroll", p), o.addEventListener("scroll", p), e.dispatchEvent(new Event("scroll"));
1171
+ g(), e.addEventListener("scroll", k), o.addEventListener("scroll", k), e.dispatchEvent(new Event("scroll"));
1173
1172
  },
1174
1173
  () => {
1175
- f = [], e.removeEventListener("scroll", p), o.removeEventListener("scroll", p);
1174
+ e.removeEventListener("scroll", k), o.removeEventListener("scroll", k);
1176
1175
  }
1177
1176
  ];
1178
- }, ql = (e, o, l) => {
1179
- const a = I("editorId");
1177
+ }, Ul = (e, o, l) => {
1178
+ const n = I("editorId");
1180
1179
  let r = () => {
1181
1180
  }, i = () => {
1182
1181
  };
1183
1182
  const h = () => {
1184
1183
  r();
1185
1184
  const f = document.querySelector(
1186
- `#${a} .cm-scroller`
1185
+ `#${n} .cm-scroller`
1187
1186
  ), d = document.querySelector(
1188
- `[id="${a}-preview-wrapper"][data-show="true"]`
1187
+ `[id="${n}-preview-wrapper"][data-show="true"]`
1189
1188
  ), s = document.querySelector(
1190
- `[id="${a}-html-wrapper"][data-show="true"]`
1189
+ `[id="${n}-html-wrapper"][data-show="true"]`
1191
1190
  );
1192
- (d || s) && ([i, r] = (d ? zl : Wl)(
1191
+ (d || s) && ([i, r] = (d ? _l : zl)(
1193
1192
  f,
1194
1193
  d || s,
1195
1194
  l.value
@@ -1198,142 +1197,142 @@ const Al = /* @__PURE__ */ W({
1198
1197
  H(
1199
1198
  [
1200
1199
  o,
1201
- te(e.setting, "preview"),
1202
- te(e.setting, "htmlPreview"),
1203
- te(e.setting, "fullscreen"),
1204
- te(e.setting, "pageFullscreen")
1200
+ Q(e.setting, "preview"),
1201
+ Q(e.setting, "htmlPreview"),
1202
+ Q(e.setting, "fullscreen"),
1203
+ Q(e.setting, "pageFullscreen")
1205
1204
  ],
1206
1205
  () => {
1207
- ve(h);
1206
+ de(h);
1208
1207
  }
1209
1208
  ), H(
1210
1209
  () => e.scrollAuto,
1211
1210
  (f) => {
1212
1211
  f ? i() : r();
1213
1212
  }
1214
- ), Q(h);
1215
- }, Ul = ql, _l = (e, o, l) => {
1216
- var g, p, k, $, m, v;
1217
- let a = "", r = 0, i = 0, h = !0, f = !1;
1218
- const d = o.getSelectedText(), s = (g = J.editorConfig) == null ? void 0 : g.mermaidTemplate;
1213
+ ), Y(h);
1214
+ }, ql = Ul, Gl = (e, o, l) => {
1215
+ var g, w, $, S, m, k;
1216
+ let n = "", r = 0, i = 0, h = !0, f = !1;
1217
+ const d = o.getSelectedText(), s = (g = X.editorConfig) == null ? void 0 : g.mermaidTemplate;
1219
1218
  if (/^h[1-6]{1}$/.test(e)) {
1220
- const u = e.replace(/^h(\d)/, (C, w) => new Array(Number(w)).fill("#", 0, w).join(""));
1221
- a = `${u} ${d}`, r = u.length + 1;
1219
+ const u = e.replace(/^h(\d)/, (b, p) => new Array(Number(p)).fill("#", 0, p).join(""));
1220
+ n = `${u} ${d}`, r = u.length + 1;
1222
1221
  } else if (e === "prettier") {
1223
- const u = window.prettier || ((k = (p = J.editorExtensions) == null ? void 0 : p.prettier) == null ? void 0 : k.prettierInstance), C = [
1224
- (($ = window.prettierPlugins) == null ? void 0 : $.markdown) || ((v = (m = J.editorExtensions) == null ? void 0 : m.prettier) == null ? void 0 : v.parserMarkdownInstance)
1222
+ const u = window.prettier || (($ = (w = X.editorExtensions) == null ? void 0 : w.prettier) == null ? void 0 : $.prettierInstance), b = [
1223
+ ((S = window.prettierPlugins) == null ? void 0 : S.markdown) || ((k = (m = X.editorExtensions) == null ? void 0 : m.prettier) == null ? void 0 : k.parserMarkdownInstance)
1225
1224
  ];
1226
- !u || C[0] === void 0 ? (b.emit(l.editorId, le, {
1225
+ !u || b[0] === void 0 ? (v.emit(l.editorId, ee, {
1227
1226
  name: "prettier",
1228
1227
  message: "prettier is undefined"
1229
- }), a = o.getValue()) : a = u.format(o.getValue(), {
1228
+ }), n = o.getValue()) : n = u.format(o.getValue(), {
1230
1229
  parser: "markdown",
1231
- plugins: C
1230
+ plugins: b
1232
1231
  }), h = !1, f = !0;
1233
1232
  } else
1234
1233
  switch (e) {
1235
1234
  case "bold": {
1236
- a = `**${d}**`, r = 2, i = -2;
1235
+ n = `**${d}**`, r = 2, i = -2;
1237
1236
  break;
1238
1237
  }
1239
1238
  case "underline": {
1240
- a = `<u>${d}</u>`, r = 3, i = -4;
1239
+ n = `<u>${d}</u>`, r = 3, i = -4;
1241
1240
  break;
1242
1241
  }
1243
1242
  case "italic": {
1244
- a = `*${d}*`, r = 1, i = -1;
1243
+ n = `*${d}*`, r = 1, i = -1;
1245
1244
  break;
1246
1245
  }
1247
1246
  case "strikeThrough": {
1248
- a = `~~${d}~~`, r = 2, i = -2;
1247
+ n = `~~${d}~~`, r = 2, i = -2;
1249
1248
  break;
1250
1249
  }
1251
1250
  case "sub": {
1252
- a = `<sub>${d}</sub>`, r = 5, i = -6;
1251
+ n = `<sub>${d}</sub>`, r = 5, i = -6;
1253
1252
  break;
1254
1253
  }
1255
1254
  case "sup": {
1256
- a = `<sup>${d}</sup>`, r = 5, i = -6;
1255
+ n = `<sup>${d}</sup>`, r = 5, i = -6;
1257
1256
  break;
1258
1257
  }
1259
1258
  case "codeRow": {
1260
- a = "`" + d + "`", r = 1, i = -1;
1259
+ n = "`" + d + "`", r = 1, i = -1;
1261
1260
  break;
1262
1261
  }
1263
1262
  case "quote": {
1264
- a = `> ${d}`, r = 2;
1263
+ n = `> ${d}`, r = 2;
1265
1264
  break;
1266
1265
  }
1267
1266
  case "orderedList": {
1268
- a = `1. ${d}`, r = 3;
1267
+ n = `1. ${d}`, r = 3;
1269
1268
  break;
1270
1269
  }
1271
1270
  case "unorderedList": {
1272
- a = `- ${d}`, r = 2;
1271
+ n = `- ${d}`, r = 2;
1273
1272
  break;
1274
1273
  }
1275
1274
  case "task": {
1276
- a = `- [ ] ${d}`, r = 6;
1275
+ n = `- [ ] ${d}`, r = 6;
1277
1276
  break;
1278
1277
  }
1279
1278
  case "code": {
1280
- const u = l.text || d || "", C = l.mode || "language";
1281
- a = `\`\`\`${C}
1279
+ const u = l.text || d || "", b = l.mode || "language";
1280
+ n = `\`\`\`${b}
1282
1281
  ${u}
1283
1282
  \`\`\`
1284
- `, r = 3, i = 3 + C.length - a.length;
1283
+ `, r = 3, i = 3 + b.length - n.length;
1285
1284
  break;
1286
1285
  }
1287
1286
  case "table": {
1288
- a = "|";
1289
- const { selectedShape: u = { x: 1, y: 1 } } = l, { x: C, y: w } = u;
1290
- for (let S = 0; S <= w; S++)
1291
- a += " col |";
1292
- a += `
1287
+ n = "|";
1288
+ const { selectedShape: u = { x: 1, y: 1 } } = l, { x: b, y: p } = u;
1289
+ for (let y = 0; y <= p; y++)
1290
+ n += " col |";
1291
+ n += `
1293
1292
  |`;
1294
- for (let S = 0; S <= w; S++)
1295
- a += " - |";
1296
- for (let S = 0; S <= C; S++) {
1297
- a += `
1293
+ for (let y = 0; y <= p; y++)
1294
+ n += " - |";
1295
+ for (let y = 0; y <= b; y++) {
1296
+ n += `
1298
1297
  |`;
1299
- for (let M = 0; M <= w; M++)
1300
- a += " content |";
1298
+ for (let C = 0; C <= p; C++)
1299
+ n += " content |";
1301
1300
  }
1302
- r = 2, i = 5 - a.length;
1301
+ r = 2, i = 5 - n.length;
1303
1302
  break;
1304
1303
  }
1305
1304
  case "link": {
1306
- const { desc: u, url: C } = l;
1307
- a = `[${u}](${C})`, h = !1;
1305
+ const { desc: u, url: b } = l;
1306
+ n = `[${u}](${b})`, h = !1;
1308
1307
  break;
1309
1308
  }
1310
1309
  case "image": {
1311
- const { desc: u, url: C, urls: w } = l;
1312
- w instanceof Array ? a = w.reduce((S, M) => S + `![${u}](${M})
1313
- `, "") : a = `![${u}](${C})
1310
+ const { desc: u, url: b, urls: p } = l;
1311
+ p instanceof Array ? n = p.reduce((y, C) => y + `![${u}](${C})
1312
+ `, "") : n = `![${u}](${b})
1314
1313
  `, h = !1;
1315
1314
  break;
1316
1315
  }
1317
1316
  case "flow": {
1318
- a = `\`\`\`mermaid
1317
+ n = `\`\`\`mermaid
1319
1318
  ${(s == null ? void 0 : s.flow) || `flowchart TD
1320
1319
  Start --> Stop`}
1321
1320
  \`\`\`
1322
- `, r = 3, i = 10 - a.length;
1321
+ `, r = 3, i = 10 - n.length;
1323
1322
  break;
1324
1323
  }
1325
1324
  case "sequence": {
1326
- a = `\`\`\`mermaid
1325
+ n = `\`\`\`mermaid
1327
1326
  ${(s == null ? void 0 : s.sequence) || `sequenceDiagram
1328
1327
  A->>B: hello!
1329
1328
  B-->>A: hi!
1330
1329
  A-)B: bye!`}
1331
1330
  \`\`\`
1332
- `, r = 3, i = 10 - a.length;
1331
+ `, r = 3, i = 10 - n.length;
1333
1332
  break;
1334
1333
  }
1335
1334
  case "gantt": {
1336
- a = `\`\`\`mermaid
1335
+ n = `\`\`\`mermaid
1337
1336
  ${(s == null ? void 0 : s.gantt) || `gantt
1338
1337
  title A Gantt Diagram
1339
1338
  dateFormat YYYY-MM-DD
@@ -1341,47 +1340,47 @@ section Section
1341
1340
  A task :a1, 2014-01-01, 30d
1342
1341
  Another task :after a1, 20d`}
1343
1342
  \`\`\`
1344
- `, r = 3, i = 10 - a.length;
1343
+ `, r = 3, i = 10 - n.length;
1345
1344
  break;
1346
1345
  }
1347
1346
  case "class": {
1348
- a = `\`\`\`mermaid
1347
+ n = `\`\`\`mermaid
1349
1348
  ${(s == null ? void 0 : s.class) || `classDiagram
1350
1349
  class Animal
1351
1350
  Vehicle <|-- Car`}
1352
1351
  \`\`\`
1353
- `, r = 3, i = 10 - a.length;
1352
+ `, r = 3, i = 10 - n.length;
1354
1353
  break;
1355
1354
  }
1356
1355
  case "state": {
1357
- a = `\`\`\`mermaid
1356
+ n = `\`\`\`mermaid
1358
1357
  ${(s == null ? void 0 : s.state) || `stateDiagram-v2
1359
1358
  s1 --> s2`}
1360
1359
  \`\`\`
1361
- `, r = 3, i = 10 - a.length;
1360
+ `, r = 3, i = 10 - n.length;
1362
1361
  break;
1363
1362
  }
1364
1363
  case "pie": {
1365
- a = `\`\`\`mermaid
1364
+ n = `\`\`\`mermaid
1366
1365
  ${(s == null ? void 0 : s.pie) || `pie title Pets adopted by volunteers
1367
1366
  "Dogs" : 386
1368
1367
  "Cats" : 85
1369
1368
  "Rats" : 15`}
1370
1369
  \`\`\`
1371
- `, r = 3, i = 10 - a.length;
1370
+ `, r = 3, i = 10 - n.length;
1372
1371
  break;
1373
1372
  }
1374
1373
  case "relationship": {
1375
- a = `\`\`\`mermaid
1374
+ n = `\`\`\`mermaid
1376
1375
  ${(s == null ? void 0 : s.relationship) || `erDiagram
1377
1376
  CAR ||--o{ NAMED-DRIVER : allows
1378
1377
  PERSON ||--o{ NAMED-DRIVER : is`}
1379
1378
  \`\`\`
1380
- `, r = 3, i = 10 - a.length;
1379
+ `, r = 3, i = 10 - n.length;
1381
1380
  break;
1382
1381
  }
1383
1382
  case "journey": {
1384
- a = `\`\`\`mermaid
1383
+ n = `\`\`\`mermaid
1385
1384
  ${(s == null ? void 0 : s.journey) || `journey
1386
1385
  title My working day
1387
1386
  section Go to work
@@ -1392,27 +1391,27 @@ ${(s == null ? void 0 : s.journey) || `journey
1392
1391
  Go downstairs: 5: Me
1393
1392
  Sit down: 5: Me`}
1394
1393
  \`\`\`
1395
- `, r = 3, i = 10 - a.length;
1394
+ `, r = 3, i = 10 - n.length;
1396
1395
  break;
1397
1396
  }
1398
1397
  case "katexInline": {
1399
- a = "$$", r = 1, i = -1;
1398
+ n = "$$", r = 1, i = -1;
1400
1399
  break;
1401
1400
  }
1402
1401
  case "katexBlock": {
1403
- a = `$$
1402
+ n = `$$
1404
1403
 
1405
1404
  $$
1406
1405
  `, r = 3, i = -4;
1407
1406
  break;
1408
1407
  }
1409
1408
  case "universal": {
1410
- const { generate: u } = l, C = u(d);
1411
- a = C.targetValue, h = C.select ?? !0, r = C.deviationStart || 0, i = C.deviationEnd || 0;
1409
+ const { generate: u } = l, b = u(d);
1410
+ n = b.targetValue, h = b.select ?? !0, r = b.deviationStart || 0, i = b.deviationEnd || 0;
1412
1411
  }
1413
1412
  }
1414
1413
  return {
1415
- text: a,
1414
+ text: n,
1416
1415
  options: {
1417
1416
  // 是否选中
1418
1417
  select: h,
@@ -1424,18 +1423,18 @@ $$
1424
1423
  replaceAll: f
1425
1424
  }
1426
1425
  };
1427
- }, Gl = "#e5c07b", bt = "var(--md-color)", Kl = "#56b6c2", jl = "#ffffff", ue = "var(--md-color)", vt = "#e5c07b", Zl = "#e5c07b", Xl = "var(--md-color)", kt = "#d19a66", Yl = "#c678dd", Jl = "#21252b", Ql = "#2c313a", Ct = "var(--md-bk-color)", $e = "var(--md-bk-color)", eo = "#ceedfa33", $t = "#528bff", to = Se.theme(
1426
+ }, Kl = "#e5c07b", bt = "var(--md-color)", jl = "#56b6c2", Zl = "#ffffff", ie = "var(--md-color)", vt = "#e5c07b", Xl = "#e5c07b", Yl = "var(--md-color)", kt = "#d19a66", Jl = "#c678dd", Ql = "#21252b", eo = "#2c313a", Ct = "var(--md-bk-color)", he = "var(--md-bk-color)", to = "#ceedfa33", $t = "#528bff", lo = pe.theme(
1428
1427
  {
1429
1428
  "&": {
1430
- color: ue,
1429
+ color: ie,
1431
1430
  backgroundColor: Ct
1432
1431
  },
1433
1432
  ".cm-content": {
1434
1433
  caretColor: $t
1435
1434
  },
1436
1435
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: $t },
1437
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: eo },
1438
- ".cm-panels": { backgroundColor: Jl, color: ue },
1436
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: to },
1437
+ ".cm-panels": { backgroundColor: Ql, color: ie },
1439
1438
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1440
1439
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1441
1440
  ".cm-searchMatch": {
@@ -1452,12 +1451,12 @@ $$
1452
1451
  },
1453
1452
  ".cm-gutters": {
1454
1453
  backgroundColor: Ct,
1455
- color: ue,
1454
+ color: ie,
1456
1455
  borderRight: "1px solid",
1457
1456
  borderColor: "var(--md-border-color)"
1458
1457
  },
1459
1458
  ".cm-activeLineGutter": {
1460
- backgroundColor: Ql
1459
+ backgroundColor: eo
1461
1460
  },
1462
1461
  ".cm-foldPlaceholder": {
1463
1462
  backgroundColor: "transparent",
@@ -1466,29 +1465,29 @@ $$
1466
1465
  },
1467
1466
  ".cm-tooltip": {
1468
1467
  border: "1px solid var(--md-border-color)",
1469
- backgroundColor: $e
1468
+ backgroundColor: he
1470
1469
  },
1471
1470
  ".cm-tooltip .cm-tooltip-arrow:before": {
1472
1471
  borderTopColor: "transparent",
1473
1472
  borderBottomColor: "transparent"
1474
1473
  },
1475
1474
  ".cm-tooltip .cm-tooltip-arrow:after": {
1476
- borderTopColor: $e,
1477
- borderBottomColor: $e
1475
+ borderTopColor: he,
1476
+ borderBottomColor: he
1478
1477
  },
1479
1478
  ".cm-tooltip-autocomplete": {
1480
1479
  "& > ul > li[aria-selected]": {
1481
- color: ue
1480
+ color: ie
1482
1481
  }
1483
1482
  }
1484
1483
  },
1485
1484
  { dark: !0 }
1486
- ), lo = Ot.define([
1487
- { tag: c.keyword, color: Yl },
1485
+ ), oo = Vt.define([
1486
+ { tag: c.keyword, color: Jl },
1488
1487
  { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: bt },
1489
- { tag: [c.function(c.variableName), c.labelName], color: Zl },
1488
+ { tag: [c.function(c.variableName), c.labelName], color: Xl },
1490
1489
  { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: kt },
1491
- { tag: [c.definition(c.name), c.separator], color: ue },
1490
+ { tag: [c.definition(c.name), c.separator], color: ie },
1492
1491
  {
1493
1492
  tag: [
1494
1493
  c.typeName,
@@ -1500,7 +1499,7 @@ $$
1500
1499
  c.self,
1501
1500
  c.namespace
1502
1501
  ],
1503
- color: Gl
1502
+ color: Kl
1504
1503
  },
1505
1504
  {
1506
1505
  tag: [
@@ -1512,7 +1511,7 @@ $$
1512
1511
  c.link,
1513
1512
  c.special(c.string)
1514
1513
  ],
1515
- color: Kl
1514
+ color: jl
1516
1515
  },
1517
1516
  { tag: [c.meta, c.comment], color: vt },
1518
1517
  { tag: c.strong, fontWeight: "bold" },
@@ -1521,23 +1520,23 @@ $$
1521
1520
  { tag: c.link, color: vt, textDecoration: "underline" },
1522
1521
  { tag: c.heading, fontWeight: "bold", color: bt },
1523
1522
  { tag: [c.atom, c.bool, c.special(c.variableName)], color: kt },
1524
- { tag: [c.processingInstruction, c.string, c.inserted], color: Xl },
1525
- { tag: c.invalid, color: jl }
1523
+ { tag: [c.processingInstruction, c.string, c.inserted], color: Yl },
1524
+ { tag: c.invalid, color: Zl }
1526
1525
  ]), pt = [
1527
- to,
1528
- Vt(lo)
1529
- ], oo = "#e5c07b", yt = "#3f4a54", ao = "#56b6c2", no = "#fff", de = "#3f4a54", Tt = "#2d8cf0", io = "#2d8cf0", ro = "#3f4a54", wt = "#d19a66", so = "#c678dd", co = "#21252b", uo = "#ceedfa33", xt = "var(--md-bk-color)", pe = "var(--md-bk-color)", mo = "#bad5fa", St = "#3f4a54", go = Se.theme(
1526
+ lo,
1527
+ Ft(oo)
1528
+ ], ao = "#e5c07b", yt = "#3f4a54", no = "#56b6c2", io = "#fff", re = "#3f4a54", Tt = "#2d8cf0", ro = "#2d8cf0", so = "#3f4a54", wt = "#d19a66", co = "#c678dd", uo = "#21252b", mo = "#ceedfa33", xt = "var(--md-bk-color)", be = "var(--md-bk-color)", go = "#bad5fa", St = "#3f4a54", fo = pe.theme(
1530
1529
  {
1531
1530
  "&": {
1532
- color: de,
1531
+ color: re,
1533
1532
  backgroundColor: xt
1534
1533
  },
1535
1534
  ".cm-content": {
1536
1535
  caretColor: St
1537
1536
  },
1538
1537
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: St },
1539
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: mo },
1540
- ".cm-panels": { backgroundColor: co, color: de },
1538
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: go },
1539
+ ".cm-panels": { backgroundColor: uo, color: re },
1541
1540
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1542
1541
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1543
1542
  ".cm-searchMatch": {
@@ -1554,12 +1553,12 @@ $$
1554
1553
  },
1555
1554
  ".cm-gutters": {
1556
1555
  backgroundColor: xt,
1557
- color: de,
1556
+ color: re,
1558
1557
  borderRight: "1px solid",
1559
1558
  borderColor: "var(--md-border-color)"
1560
1559
  },
1561
1560
  ".cm-activeLineGutter": {
1562
- backgroundColor: uo
1561
+ backgroundColor: mo
1563
1562
  },
1564
1563
  ".cm-foldPlaceholder": {
1565
1564
  backgroundColor: "transparent",
@@ -1568,29 +1567,29 @@ $$
1568
1567
  },
1569
1568
  ".cm-tooltip": {
1570
1569
  border: "1px solid var(--md-border-color)",
1571
- backgroundColor: pe
1570
+ backgroundColor: be
1572
1571
  },
1573
1572
  ".cm-tooltip .cm-tooltip-arrow:before": {
1574
1573
  borderTopColor: "transparent",
1575
1574
  borderBottomColor: "transparent"
1576
1575
  },
1577
1576
  ".cm-tooltip .cm-tooltip-arrow:after": {
1578
- borderTopColor: pe,
1579
- borderBottomColor: pe
1577
+ borderTopColor: be,
1578
+ borderBottomColor: be
1580
1579
  },
1581
1580
  ".cm-tooltip-autocomplete": {
1582
1581
  "& > ul > li[aria-selected]": {
1583
- color: de
1582
+ color: re
1584
1583
  }
1585
1584
  }
1586
1585
  }
1587
1586
  // { dark: true }
1588
- ), fo = Ot.define([
1589
- { tag: c.keyword, color: so },
1587
+ ), ho = Vt.define([
1588
+ { tag: c.keyword, color: co },
1590
1589
  { tag: [c.name, c.deleted, c.character, c.propertyName, c.macroName], color: yt },
1591
- { tag: [c.function(c.variableName), c.labelName], color: io },
1590
+ { tag: [c.function(c.variableName), c.labelName], color: ro },
1592
1591
  { tag: [c.color, c.constant(c.name), c.standard(c.name)], color: wt },
1593
- { tag: [c.definition(c.name), c.separator], color: de },
1592
+ { tag: [c.definition(c.name), c.separator], color: re },
1594
1593
  {
1595
1594
  tag: [
1596
1595
  c.typeName,
@@ -1602,7 +1601,7 @@ $$
1602
1601
  c.self,
1603
1602
  c.namespace
1604
1603
  ],
1605
- color: oo
1604
+ color: ao
1606
1605
  },
1607
1606
  {
1608
1607
  tag: [
@@ -1614,7 +1613,7 @@ $$
1614
1613
  c.link,
1615
1614
  c.special(c.string)
1616
1615
  ],
1617
- color: ao
1616
+ color: no
1618
1617
  },
1619
1618
  { tag: [c.meta, c.comment], color: Tt },
1620
1619
  { tag: c.strong, fontWeight: "bold" },
@@ -1623,14 +1622,14 @@ $$
1623
1622
  { tag: c.link, color: Tt, textDecoration: "underline" },
1624
1623
  { tag: c.heading, fontWeight: "bold", color: yt },
1625
1624
  { tag: [c.atom, c.bool, c.special(c.variableName)], color: wt },
1626
- { tag: [c.processingInstruction, c.string, c.inserted], color: ro },
1627
- { tag: c.invalid, color: no }
1628
- ]), Mt = [
1629
- go,
1630
- Vt(fo)
1631
- ], be = (e, o, l, a, r) => (i, h, f, d) => {
1625
+ { tag: [c.processingInstruction, c.string, c.inserted], color: so },
1626
+ { tag: c.invalid, color: io }
1627
+ ]), At = [
1628
+ fo,
1629
+ Ft(ho)
1630
+ ], ue = (e, o, l, n, r) => (i, h, f, d) => {
1632
1631
  const s = `${e}${o}`.slice(d - f);
1633
- i.dispatch(i.state.replaceSelection(`${s}${l}${a}`));
1632
+ i.dispatch(i.state.replaceSelection(`${s}${l}${n}`));
1634
1633
  const g = f + h.label.length + (r === "title" ? l.length : 0);
1635
1634
  i.dispatch({
1636
1635
  selection: _.create(
@@ -1644,16 +1643,16 @@ $$
1644
1643
  1
1645
1644
  )
1646
1645
  }), i.focus();
1647
- }, At = (e) => (o, l, a, r) => {
1648
- const i = e.slice(r - a);
1646
+ }, Lt = (e) => (o, l, n, r) => {
1647
+ const i = e.slice(r - n);
1649
1648
  o.dispatch(o.state.replaceSelection(`${i} `));
1650
- }, ho = (e) => {
1649
+ }, bo = (e) => {
1651
1650
  const o = (l) => {
1652
- const a = l.matchBefore(
1651
+ const n = l.matchBefore(
1653
1652
  /^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|^\$\$?|!+\s*\w*/
1654
1653
  );
1655
- return a === null || a.from == a.to && l.explicit ? null : {
1656
- from: a.from,
1654
+ return n === null || n.from == n.to && l.explicit ? null : {
1655
+ from: n.from,
1657
1656
  options: [
1658
1657
  // 标题
1659
1658
  ...["h1", "h2", "h3", "h4", "h5", "h6"].map((r, i) => {
@@ -1661,7 +1660,7 @@ $$
1661
1660
  return {
1662
1661
  label: h,
1663
1662
  type: "text",
1664
- apply: At(h)
1663
+ apply: Lt(h)
1665
1664
  };
1666
1665
  }),
1667
1666
  // 任务列表
@@ -1670,7 +1669,7 @@ $$
1670
1669
  return {
1671
1670
  label: i,
1672
1671
  type: "text",
1673
- apply: At(i)
1672
+ apply: Lt(i)
1674
1673
  };
1675
1674
  }),
1676
1675
  // 代码
@@ -1681,7 +1680,7 @@ $$
1681
1680
  ].map((r) => ({
1682
1681
  label: `${r[0]}${r[1]}`,
1683
1682
  type: "text",
1684
- apply: be(r[0], r[1], "", r[0] === "`" ? "`" : "\n```", "type")
1683
+ apply: ue(r[0], r[1], "", r[0] === "`" ? "`" : "\n```", "type")
1685
1684
  })),
1686
1685
  // 链接
1687
1686
  {
@@ -1706,12 +1705,12 @@ $$
1706
1705
  {
1707
1706
  label: "$",
1708
1707
  type: "text",
1709
- apply: be("$", "", "", "$", "type")
1708
+ apply: ue("$", "", "", "$", "type")
1710
1709
  },
1711
1710
  {
1712
1711
  label: "$$",
1713
1712
  type: "text",
1714
- apply: be("$$", "", `
1713
+ apply: ue("$$", "", `
1715
1714
  `, `
1716
1715
  $$`, "title")
1717
1716
  },
@@ -1736,7 +1735,7 @@ $$`, "title")
1736
1735
  ].map((r) => ({
1737
1736
  label: `!!! ${r}`,
1738
1737
  type: "text",
1739
- apply: be("!!!", ` ${r}`, " Title", `
1738
+ apply: ue("!!!", ` ${r}`, " Title", `
1740
1739
 
1741
1740
  !!!`, "title")
1742
1741
  }))
@@ -1746,27 +1745,27 @@ $$`, "title")
1746
1745
  return gl({
1747
1746
  override: e ? [o, ...e] : [o]
1748
1747
  });
1749
- }, Lt = ho, ee = (e) => {
1750
- const o = new ce();
1751
- return (a) => (o.get(e.state) ? e.dispatch({ effects: o.reconfigure(a) }) : e.dispatch({
1752
- effects: nl.appendConfig.of(o.of(a))
1748
+ }, It = bo, J = (e) => {
1749
+ const o = new ne();
1750
+ return (n) => (o.get(e.state) ? e.dispatch({ effects: o.reconfigure(n) }) : e.dispatch({
1751
+ effects: nl.appendConfig.of(o.of(n))
1753
1752
  }), !0);
1754
1753
  };
1755
- class bo {
1754
+ class vo {
1756
1755
  constructor(o) {
1757
- U(this, "view");
1758
- U(this, "maxLength", Number.MAX_SAFE_INTEGER);
1756
+ z(this, "view");
1757
+ z(this, "maxLength", Number.MAX_SAFE_INTEGER);
1759
1758
  // 切换tabSize的执行方法。切换时,Compartment实例需要相同
1760
- U(this, "toggleTabSize");
1761
- U(this, "togglePlaceholder");
1759
+ z(this, "toggleTabSize");
1760
+ z(this, "togglePlaceholder");
1762
1761
  /**
1763
1762
  * 设置全部的扩展
1764
1763
  */
1765
- U(this, "setExtensions");
1766
- U(this, "toggleDisabled");
1767
- U(this, "toggleReadOnly");
1768
- U(this, "toggleMaxlength");
1769
- this.view = o, this.toggleTabSize = ee(this.view), this.togglePlaceholder = ee(this.view), this.setExtensions = ee(this.view), this.toggleDisabled = ee(this.view), this.toggleReadOnly = ee(this.view), this.toggleMaxlength = ee(this.view);
1764
+ z(this, "setExtensions");
1765
+ z(this, "toggleDisabled");
1766
+ z(this, "toggleReadOnly");
1767
+ z(this, "toggleMaxlength");
1768
+ this.view = o, this.toggleTabSize = J(this.view), this.togglePlaceholder = J(this.view), this.setExtensions = J(this.view), this.toggleDisabled = J(this.view), this.toggleReadOnly = J(this.view), this.toggleMaxlength = J(this.view);
1770
1769
  }
1771
1770
  getValue() {
1772
1771
  return this.view.state.doc.toString();
@@ -1778,11 +1777,11 @@ class bo {
1778
1777
  * @param from 插入开始位置
1779
1778
  * @param to 插入结束位置
1780
1779
  */
1781
- setValue(o, l = 0, a = this.view.state.doc.length) {
1780
+ setValue(o, l = 0, n = this.view.state.doc.length) {
1782
1781
  this.view.dispatch({
1783
1782
  changes: {
1784
1783
  from: l,
1785
- to: a,
1784
+ to: n,
1786
1785
  insert: o
1787
1786
  }
1788
1787
  });
@@ -1809,7 +1808,7 @@ class bo {
1809
1808
  deviationEnd: 0,
1810
1809
  // 直接替换所有文本
1811
1810
  replaceAll: !1
1812
- }, a) {
1811
+ }, n) {
1813
1812
  try {
1814
1813
  if (l.replaceAll) {
1815
1814
  if (this.setValue(o), o.length > this.maxLength)
@@ -1834,7 +1833,7 @@ class bo {
1834
1833
  this.view.focus();
1835
1834
  } catch (r) {
1836
1835
  if (r.message === "The input text is too long")
1837
- b.emit(a, le, {
1836
+ v.emit(n, ee, {
1838
1837
  name: "overlength",
1839
1838
  message: r.message,
1840
1839
  data: o
@@ -1850,7 +1849,7 @@ class bo {
1850
1849
  */
1851
1850
  setTabSize(o) {
1852
1851
  this.toggleTabSize([
1853
- Ce.tabSize.of(o),
1852
+ fe.tabSize.of(o),
1854
1853
  ml.of(" ".repeat(o))
1855
1854
  ]);
1856
1855
  }
@@ -1865,71 +1864,71 @@ class bo {
1865
1864
  focus(o) {
1866
1865
  if (this.view.focus(), !o)
1867
1866
  return;
1868
- let l = 0, a = 0, r = 0;
1867
+ let l = 0, n = 0, r = 0;
1869
1868
  switch (o) {
1870
1869
  case "start":
1871
1870
  break;
1872
1871
  case "end": {
1873
- l = a = r = this.getValue().length;
1872
+ l = n = r = this.getValue().length;
1874
1873
  break;
1875
1874
  }
1876
1875
  default:
1877
- l = o.rangeAnchor || o.cursorPos, a = o.rangeHead || o.cursorPos, r = o.cursorPos;
1876
+ l = o.rangeAnchor || o.cursorPos, n = o.rangeHead || o.cursorPos, r = o.cursorPos;
1878
1877
  }
1879
1878
  this.view.dispatch({
1880
1879
  scrollIntoView: !0,
1881
1880
  selection: _.create(
1882
- [_.range(l, a), _.cursor(r)],
1881
+ [_.range(l, n), _.cursor(r)],
1883
1882
  1
1884
1883
  )
1885
1884
  });
1886
1885
  }
1887
1886
  setDisabled(o) {
1888
- this.toggleDisabled([Se.editable.of(!o)]);
1887
+ this.toggleDisabled([pe.editable.of(!o)]);
1889
1888
  }
1890
1889
  setReadOnly(o) {
1891
- this.toggleReadOnly([Ce.readOnly.of(o)]);
1890
+ this.toggleReadOnly([fe.readOnly.of(o)]);
1892
1891
  }
1893
1892
  setMaxLength(o) {
1894
1893
  this.maxLength = o, this.toggleMaxlength([
1895
- Ce.changeFilter.of((l) => l.newDoc.length <= o)
1894
+ fe.changeFilter.of((l) => l.newDoc.length <= o)
1896
1895
  ]);
1897
1896
  }
1898
1897
  }
1899
- const vo = (e) => {
1898
+ const ko = (e) => {
1900
1899
  const o = I("editorId");
1901
- return (a) => {
1902
- if (!a.clipboardData)
1900
+ return (n) => {
1901
+ if (!n.clipboardData)
1903
1902
  return;
1904
- if (a.clipboardData.files.length > 0) {
1905
- const { files: i } = a.clipboardData;
1906
- b.emit(
1903
+ if (n.clipboardData.files.length > 0) {
1904
+ const { files: i } = n.clipboardData;
1905
+ v.emit(
1907
1906
  o,
1908
- xe,
1907
+ $e,
1909
1908
  Array.from(i).filter((h) => /image\/.*/.test(h.type))
1910
- ), a.preventDefault();
1909
+ ), n.preventDefault();
1911
1910
  return;
1912
1911
  }
1913
- if (e.autoDetectCode && a.clipboardData.types.includes("vscode-editor-data")) {
1914
- const i = JSON.parse(a.clipboardData.getData("vscode-editor-data"));
1915
- b.emit(o, x, "code", {
1912
+ if (e.autoDetectCode && n.clipboardData.types.includes("vscode-editor-data")) {
1913
+ const i = JSON.parse(n.clipboardData.getData("vscode-editor-data"));
1914
+ v.emit(o, L, "code", {
1916
1915
  mode: i.mode,
1917
- text: a.clipboardData.getData("text/plain")
1918
- }), a.preventDefault();
1916
+ text: n.clipboardData.getData("text/plain")
1917
+ }), n.preventDefault();
1919
1918
  return;
1920
1919
  }
1921
- const r = a.clipboardData.getData("text/plain");
1922
- e.maxlength && r.length + e.modelValue.length > e.maxlength && b.emit(o, le, {
1920
+ const r = n.clipboardData.getData("text/plain");
1921
+ e.maxlength && r.length + e.modelValue.length > e.maxlength && v.emit(o, ee, {
1923
1922
  name: "overlength",
1924
1923
  message: "The input text is too long",
1925
1924
  data: r
1926
1925
  });
1927
1926
  };
1928
- }, ko = vo, Co = (e, o) => [
1927
+ }, Co = ko, $o = (e, o) => [
1929
1928
  {
1930
1929
  key: "Ctrl-b",
1931
1930
  mac: "Cmd-b",
1932
- run: () => (b.emit(e, x, "bold"), !0)
1931
+ run: () => (v.emit(e, L, "bold"), !0)
1933
1932
  },
1934
1933
  {
1935
1934
  key: "Ctrl-d",
@@ -1940,154 +1939,154 @@ const vo = (e) => {
1940
1939
  {
1941
1940
  key: "Ctrl-s",
1942
1941
  mac: "Cmd-s",
1943
- run: (M) => (b.emit(e, Et, M.state.doc.toString()), !0),
1944
- shift: () => (b.emit(e, x, "strikeThrough"), !0)
1942
+ run: (C) => (v.emit(e, Ht, C.state.doc.toString()), !0),
1943
+ shift: () => (v.emit(e, L, "strikeThrough"), !0)
1945
1944
  },
1946
1945
  {
1947
1946
  key: "Ctrl-u",
1948
1947
  mac: "Cmd-u",
1949
- run: () => (b.emit(e, x, "underline"), !0),
1950
- shift: () => (b.emit(e, x, "unorderedList"), !0)
1948
+ run: () => (v.emit(e, L, "underline"), !0),
1949
+ shift: () => (v.emit(e, L, "unorderedList"), !0)
1951
1950
  },
1952
1951
  {
1953
1952
  key: "Ctrl-i",
1954
1953
  mac: "Cmd-i",
1955
- run: () => (b.emit(e, x, "italic"), !0),
1956
- shift: () => (b.emit(e, Te, "image"), !0)
1954
+ run: () => (v.emit(e, L, "italic"), !0),
1955
+ shift: () => (v.emit(e, ke, "image"), !0)
1957
1956
  },
1958
1957
  {
1959
1958
  key: "Ctrl-1",
1960
1959
  mac: "Cmd-1",
1961
- run: () => (b.emit(e, x, "h1"), !0)
1960
+ run: () => (v.emit(e, L, "h1"), !0)
1962
1961
  },
1963
1962
  {
1964
1963
  key: "Ctrl-2",
1965
1964
  mac: "Cmd-2",
1966
- run: () => (b.emit(e, x, "h2"), !0)
1965
+ run: () => (v.emit(e, L, "h2"), !0)
1967
1966
  },
1968
1967
  {
1969
1968
  key: "Ctrl-3",
1970
1969
  mac: "Cmd-3",
1971
- run: () => (b.emit(e, x, "h3"), !0)
1970
+ run: () => (v.emit(e, L, "h3"), !0)
1972
1971
  },
1973
1972
  {
1974
1973
  key: "Ctrl-4",
1975
1974
  mac: "Cmd-4",
1976
- run: () => (b.emit(e, x, "h4"), !0)
1975
+ run: () => (v.emit(e, L, "h4"), !0)
1977
1976
  },
1978
1977
  {
1979
1978
  key: "Ctrl-5",
1980
1979
  mac: "Cmd-5",
1981
- run: () => (b.emit(e, x, "h5"), !0)
1980
+ run: () => (v.emit(e, L, "h5"), !0)
1982
1981
  },
1983
1982
  {
1984
1983
  key: "Ctrl-6",
1985
1984
  mac: "Cmd-6",
1986
- run: () => (b.emit(e, x, "h6"), !0)
1985
+ run: () => (v.emit(e, L, "h6"), !0)
1987
1986
  },
1988
1987
  {
1989
1988
  key: "Ctrl-ArrowUp",
1990
1989
  mac: "Cmd-ArrowUp",
1991
- run: () => (b.emit(e, x, "sup"), !0)
1990
+ run: () => (v.emit(e, L, "sup"), !0)
1992
1991
  },
1993
1992
  {
1994
1993
  key: "Ctrl-ArrowDown",
1995
1994
  mac: "Cmd-ArrowDown",
1996
- run: () => (b.emit(e, x, "sub"), !0)
1995
+ run: () => (v.emit(e, L, "sub"), !0)
1997
1996
  },
1998
1997
  {
1999
1998
  key: "Ctrl-o",
2000
1999
  mac: "Cmd-o",
2001
- run: () => (b.emit(e, x, "orderedList"), !0)
2000
+ run: () => (v.emit(e, L, "orderedList"), !0)
2002
2001
  },
2003
2002
  {
2004
2003
  key: "Ctrl-c",
2005
2004
  mac: "Cmd-c",
2006
- shift: () => (b.emit(e, x, "code"), !0),
2007
- any(M, D) {
2008
- return (D.ctrlKey || D.metaKey) && D.altKey && D.code === "KeyC" ? (b.emit(e, x, "codeRow"), !0) : !1;
2005
+ shift: () => (v.emit(e, L, "code"), !0),
2006
+ any(C, A) {
2007
+ return (A.ctrlKey || A.metaKey) && A.altKey && A.code === "KeyC" ? (v.emit(e, L, "codeRow"), !0) : !1;
2009
2008
  }
2010
2009
  },
2011
2010
  {
2012
2011
  key: "Ctrl-l",
2013
2012
  mac: "Cmd-l",
2014
- run: () => (b.emit(e, Te, "link"), !0)
2013
+ run: () => (v.emit(e, ke, "link"), !0)
2015
2014
  },
2016
2015
  {
2017
2016
  key: "Ctrl-f",
2018
2017
  mac: "Cmd-f",
2019
- shift: () => o.noPrettier ? !1 : (b.emit(e, x, "prettier"), !0)
2018
+ shift: () => o.noPrettier ? !1 : (v.emit(e, L, "prettier"), !0)
2020
2019
  },
2021
2020
  {
2022
- any: (M, D) => (D.ctrlKey || D.metaKey) && D.altKey && D.shiftKey && D.code === "KeyT" ? (b.emit(e, x, "table"), !0) : !1
2021
+ any: (C, A) => (A.ctrlKey || A.metaKey) && A.altKey && A.shiftKey && A.code === "KeyT" ? (v.emit(e, L, "table"), !0) : !1
2023
2022
  }
2024
- ], $o = Co, po = (e) => {
2025
- const o = I("tabWidth"), l = I("editorId"), a = I("theme"), r = P(), i = Wt(), h = new ce(), f = new ce(), d = new ce(), s = new ce(), g = $o(l, e), p = ko(e), k = [
2023
+ ], po = $o, yo = (e) => {
2024
+ const o = I("tabWidth"), l = I("editorId"), n = I("theme"), r = R(), i = Wt(), h = new ne(), f = new ne(), d = new ne(), s = new ne(), g = po(l, e), w = Co(e), $ = [
2026
2025
  ll.of([...rl, ...sl, ...g, cl]),
2027
2026
  s.of(ft()),
2028
2027
  h.of(al({ codeLanguages: ol })),
2029
2028
  // 横向换行
2030
- he.lineWrapping,
2031
- he.updateListener.of((m) => {
2029
+ ce.lineWrapping,
2030
+ ce.updateListener.of((m) => {
2032
2031
  m.docChanged && e.onChange(m.state.doc.toString());
2033
2032
  }),
2034
- he.domEventHandlers({
2035
- paste: p,
2033
+ ce.domEventHandlers({
2034
+ paste: w,
2036
2035
  blur: e.onBlur,
2037
2036
  focus: e.onFocus,
2038
2037
  drop: e.onDrop,
2039
2038
  input: (m) => {
2040
2039
  e.onInput && e.onInput(m);
2041
- const { data: v } = m;
2042
- e.maxlength && e.modelValue.length + v.length > e.maxlength && b.emit(l, le, {
2040
+ const { data: k } = m;
2041
+ e.maxlength && e.modelValue.length + k.length > e.maxlength && v.emit(l, ee, {
2043
2042
  name: "overlength",
2044
2043
  message: "The input text is too long",
2045
- data: v
2044
+ data: k
2046
2045
  });
2047
2046
  }
2048
2047
  })
2049
- ], $ = () => {
2048
+ ], S = () => {
2050
2049
  const m = [
2051
- ...k,
2052
- f.of(a.value === "light" ? Mt : pt),
2053
- d.of(Lt(e.completions))
2050
+ ...$,
2051
+ f.of(n.value === "light" ? At : pt),
2052
+ d.of(It(e.completions))
2054
2053
  ];
2055
- return J.codeMirrorExtensions(a.value, m, [
2054
+ return X.codeMirrorExtensions(n.value, m, [
2056
2055
  ...g
2057
2056
  ]);
2058
2057
  };
2059
- return Q(() => {
2060
- const m = new he({
2058
+ return Y(() => {
2059
+ const m = new ce({
2061
2060
  doc: e.modelValue,
2062
2061
  parent: r.value,
2063
- extensions: [$()]
2064
- }), v = new bo(m);
2065
- i.value = v, setTimeout(() => {
2066
- v.setTabSize(o), v.setDisabled(e.disabled), v.setReadOnly(e.readonly), e.placeholder && v.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && v.setMaxLength(e.maxlength), e.autofocus && m.focus();
2067
- }, 0), b.on(l, {
2062
+ extensions: [S()]
2063
+ }), k = new vo(m);
2064
+ i.value = k, setTimeout(() => {
2065
+ 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 && m.focus();
2066
+ }, 0), v.on(l, {
2068
2067
  name: Nt,
2069
2068
  callback() {
2070
2069
  ul(m);
2071
2070
  }
2072
- }), b.on(l, {
2073
- name: Ht,
2071
+ }), v.on(l, {
2072
+ name: Dt,
2074
2073
  callback() {
2075
2074
  dl(m);
2076
2075
  }
2077
- }), b.on(l, {
2078
- name: x,
2079
- callback(u, C = {}) {
2080
- var M;
2081
- const { text: w, options: S } = _l(u, i.value, C);
2082
- (M = i.value) == null || M.replaceSelectedText(w, S, l);
2076
+ }), v.on(l, {
2077
+ name: L,
2078
+ callback(u, b = {}) {
2079
+ var C;
2080
+ const { text: p, options: y } = Gl(u, i.value, b);
2081
+ (C = i.value) == null || C.replaceSelectedText(p, y, l);
2083
2082
  }
2084
2083
  });
2085
2084
  }), H(
2086
- a,
2085
+ n,
2087
2086
  () => {
2088
2087
  var m;
2089
2088
  (m = i.value) == null || m.view.dispatch({
2090
- effects: f.reconfigure(a.value === "light" ? Mt : pt)
2089
+ effects: f.reconfigure(n.value === "light" ? At : pt)
2091
2090
  });
2092
2091
  },
2093
2092
  {
@@ -2098,7 +2097,7 @@ const vo = (e) => {
2098
2097
  () => {
2099
2098
  var m;
2100
2099
  (m = i.value) == null || m.view.dispatch({
2101
- effects: d.reconfigure(Lt(e.completions))
2100
+ effects: d.reconfigure(It(e.completions))
2102
2101
  });
2103
2102
  },
2104
2103
  {
@@ -2107,8 +2106,8 @@ const vo = (e) => {
2107
2106
  ), H(
2108
2107
  () => e.modelValue,
2109
2108
  () => {
2110
- var m, v;
2111
- ((m = i.value) == null ? void 0 : m.getValue()) !== e.modelValue && ((v = i.value) == null || v.setValue(e.modelValue));
2109
+ var m, k;
2110
+ ((m = i.value) == null ? void 0 : m.getValue()) !== e.modelValue && ((k = i.value) == null || k.setValue(e.modelValue));
2112
2111
  }
2113
2112
  ), H(
2114
2113
  () => e.placeholder,
@@ -2138,38 +2137,38 @@ const vo = (e) => {
2138
2137
  inputWrapperRef: r,
2139
2138
  codeMirrorUt: i,
2140
2139
  resetHistory() {
2141
- var m, v;
2140
+ var m, k;
2142
2141
  (m = i.value) == null || m.view.dispatch({
2143
2142
  effects: s.reconfigure([])
2144
- }), (v = i.value) == null || v.view.dispatch({
2143
+ }), (k = i.value) == null || k.view.dispatch({
2145
2144
  effects: s.reconfigure(ft())
2146
2145
  });
2147
2146
  }
2148
2147
  };
2149
- }, yo = po, To = (e, o, l) => {
2150
- const a = G({
2148
+ }, To = yo, wo = (e, o, l) => {
2149
+ const n = U({
2151
2150
  resizedWidth: e.inputBoxWitdh
2152
- }), r = G({
2151
+ }), r = U({
2153
2152
  width: e.inputBoxWitdh
2154
- }), i = G({
2153
+ }), i = U({
2155
2154
  left: e.inputBoxWitdh,
2156
2155
  display: "initial"
2157
2156
  }), h = (s) => {
2158
- var m, v, u;
2159
- const g = ((m = o.value) == null ? void 0 : m.offsetWidth) || 0, p = ((v = o.value) == null ? void 0 : v.getBoundingClientRect().x) || 0;
2160
- let k = s.x - p;
2161
- k < fe ? k = fe : k > g - fe && (k = g - fe);
2162
- const $ = `${k}px`;
2163
- r.width = $, i.left = $, a.resizedWidth = $, (u = e.onInputBoxWitdhChange) == null || u.call(e, $);
2157
+ var m, k, u;
2158
+ const g = ((m = o.value) == null ? void 0 : m.offsetWidth) || 0, w = ((k = o.value) == null ? void 0 : k.getBoundingClientRect().x) || 0;
2159
+ let $ = s.x - w;
2160
+ $ < se ? $ = se : $ > g - se && ($ = g - se);
2161
+ const S = `${$}px`;
2162
+ r.width = S, i.left = S, n.resizedWidth = S, (u = e.onInputBoxWitdhChange) == null || u.call(e, S);
2164
2163
  }, f = () => {
2165
2164
  document.addEventListener("mousemove", h);
2166
2165
  }, d = () => {
2167
2166
  document.removeEventListener("mousemove", h);
2168
2167
  };
2169
- return Q(() => {
2168
+ return Y(() => {
2170
2169
  var s;
2171
2170
  (s = l.value) == null || s.addEventListener("mousedown", f), document.addEventListener("mouseup", d);
2172
- }), Dt(() => {
2171
+ }), Et(() => {
2173
2172
  var s, g;
2174
2173
  (s = l.value) == null || s.removeEventListener("mousedown", f), (g = l.value) == null || g.removeEventListener("mouseup", d);
2175
2174
  }), H(
@@ -2178,52 +2177,52 @@ const vo = (e) => {
2178
2177
  s && (r.width = s, i.left = s);
2179
2178
  }
2180
2179
  ), H(
2181
- [te(e.setting, "htmlPreview"), te(e.setting, "preview")],
2180
+ [Q(e.setting, "htmlPreview"), Q(e.setting, "preview")],
2182
2181
  () => {
2183
- !e.setting.htmlPreview && !e.setting.preview ? (r.width = "100%", i.display = "none") : (r.width = a.resizedWidth, i.display = "initial");
2182
+ !e.setting.htmlPreview && !e.setting.preview ? (r.width = "100%", i.display = "none") : (r.width = n.resizedWidth, i.display = "initial");
2184
2183
  },
2185
2184
  {
2186
2185
  immediate: !0
2187
2186
  }
2188
2187
  ), { inputWrapperStyle: r, resizeOperateStyle: i };
2189
- }, wo = To, xo = /* @__PURE__ */ W({
2188
+ }, xo = wo, So = /* @__PURE__ */ O({
2190
2189
  name: "MDEditorContent",
2191
2190
  props: fl,
2192
2191
  setup(e, o) {
2193
- const l = I("editorId"), a = P(""), r = P(), i = P(), {
2192
+ const l = I("editorId"), n = R(""), r = R(), i = R(), {
2194
2193
  inputWrapperRef: h,
2195
2194
  codeMirrorUt: f,
2196
2195
  resetHistory: d
2197
- } = yo(e), {
2196
+ } = To(e), {
2198
2197
  inputWrapperStyle: s,
2199
2198
  resizeOperateStyle: g
2200
- } = wo(e, r, i);
2201
- return Ul(e, a, f), o.expose({
2199
+ } = xo(e, r, i);
2200
+ return ql(e, n, f), o.expose({
2202
2201
  getSelectedText() {
2203
- var p;
2204
- return (p = f.value) == null ? void 0 : p.getSelectedText();
2202
+ var w;
2203
+ return (w = f.value) == null ? void 0 : w.getSelectedText();
2205
2204
  },
2206
- focus(p) {
2207
- var k;
2208
- (k = f.value) == null || k.focus(p);
2205
+ focus(w) {
2206
+ var $;
2207
+ ($ = f.value) == null || $.focus(w);
2209
2208
  },
2210
2209
  resetHistory: d
2211
2210
  }), () => t("div", {
2212
- class: `${n}-content${e.setting.htmlPreview || e.setting.preview ? " has-preview" : ""}`,
2211
+ class: `${a}-content${e.setting.htmlPreview || e.setting.preview ? " has-preview" : ""}`,
2213
2212
  ref: r
2214
2213
  }, [t("div", {
2215
- class: `${n}-input-wrapper`,
2214
+ class: `${a}-input-wrapper`,
2216
2215
  style: s,
2217
2216
  ref: h
2218
2217
  }, null), (e.setting.htmlPreview || e.setting.preview) && t("div", {
2219
- class: `${n}-resize-operate`,
2218
+ class: `${a}-resize-operate`,
2220
2219
  style: g,
2221
2220
  ref: i
2222
2221
  }, null), t(hl, {
2223
2222
  modelValue: e.modelValue,
2224
2223
  setting: e.setting,
2225
- onHtmlChanged: (p) => {
2226
- a.value = p, e.onHtmlChanged(p);
2224
+ onHtmlChanged: (w) => {
2225
+ n.value = w, e.onHtmlChanged(w);
2227
2226
  },
2228
2227
  onGetCatalog: e.onGetCatalog,
2229
2228
  mdHeadingId: e.mdHeadingId,
@@ -2234,15 +2233,15 @@ const vo = (e) => {
2234
2233
  noHighlight: e.noHighlight,
2235
2234
  noImgZoomIn: e.noImgZoomIn,
2236
2235
  sanitizeMermaid: e.sanitizeMermaid
2237
- }, null), e.catalogVisible && t(Ft, {
2236
+ }, null), e.catalogVisible && t(Rt, {
2238
2237
  theme: e.theme,
2239
- class: `${n}-catalog-editor`,
2238
+ class: `${a}-catalog-editor`,
2240
2239
  editorId: l,
2241
2240
  mdHeadingId: e.mdHeadingId,
2242
2241
  key: "internal-catalog"
2243
2242
  }, null)]);
2244
2243
  }
2245
- }), So = /* @__PURE__ */ W({
2244
+ }), Ao = /* @__PURE__ */ O({
2246
2245
  props: {
2247
2246
  modelValue: {
2248
2247
  type: String,
@@ -2252,15 +2251,15 @@ const vo = (e) => {
2252
2251
  setup(e) {
2253
2252
  const o = I("usedLanguageText");
2254
2253
  return () => {
2255
- var l, a;
2254
+ var l, n;
2256
2255
  return t("div", {
2257
- class: `${n}-footer-item`
2256
+ class: `${a}-footer-item`
2258
2257
  }, [t("label", {
2259
- class: `${n}-footer-label`
2260
- }, [`${(l = o.value.footer) == null ? void 0 : l.markdownTotal}:`]), t("span", null, [((a = e.modelValue) == null ? void 0 : a.length) || 0])]);
2258
+ class: `${a}-footer-label`
2259
+ }, [`${(l = o.value.footer) == null ? void 0 : l.markdownTotal}:`]), t("span", null, [((n = e.modelValue) == null ? void 0 : n.length) || 0])]);
2261
2260
  };
2262
2261
  }
2263
- }), Mo = {
2262
+ }), Lo = {
2264
2263
  checked: {
2265
2264
  type: Boolean,
2266
2265
  default: !1
@@ -2270,17 +2269,17 @@ const vo = (e) => {
2270
2269
  default: () => {
2271
2270
  }
2272
2271
  }
2273
- }, Ao = /* @__PURE__ */ W({
2274
- props: Mo,
2272
+ }, Io = /* @__PURE__ */ O({
2273
+ props: Lo,
2275
2274
  setup(e) {
2276
2275
  return () => t("div", {
2277
- class: [`${n}-checkbox`, e.checked && `${n}-checkbox-checked`],
2276
+ class: [`${a}-checkbox`, e.checked && `${a}-checkbox-checked`],
2278
2277
  onClick: () => {
2279
2278
  e.onChange(!e.checked);
2280
2279
  }
2281
2280
  }, null);
2282
2281
  }
2283
- }), Lo = {
2282
+ }), Mo = {
2284
2283
  scrollAuto: {
2285
2284
  type: Boolean
2286
2285
  },
@@ -2289,26 +2288,26 @@ const vo = (e) => {
2289
2288
  default: () => {
2290
2289
  }
2291
2290
  }
2292
- }, Io = /* @__PURE__ */ W({
2293
- props: Lo,
2291
+ }, Eo = /* @__PURE__ */ O({
2292
+ props: Mo,
2294
2293
  setup(e) {
2295
2294
  const o = I("usedLanguageText");
2296
2295
  return () => {
2297
2296
  var l;
2298
2297
  return t("div", {
2299
- class: `${n}-footer-item`
2298
+ class: `${a}-footer-item`
2300
2299
  }, [t("label", {
2301
- class: `${n}-footer-label`,
2300
+ class: `${a}-footer-label`,
2302
2301
  onClick: () => {
2303
2302
  e.onScrollAutoChange(!e.scrollAuto);
2304
2303
  }
2305
- }, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(Ao, {
2304
+ }, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(Io, {
2306
2305
  checked: e.scrollAuto,
2307
2306
  onChange: e.onScrollAutoChange
2308
2307
  }, null)]);
2309
2308
  };
2310
2309
  }
2311
- }), Do = {
2310
+ }), Ho = {
2312
2311
  modelValue: {
2313
2312
  type: String,
2314
2313
  default: ""
@@ -2328,62 +2327,62 @@ const vo = (e) => {
2328
2327
  defFooters: {
2329
2328
  type: Object
2330
2329
  }
2331
- }, Eo = /* @__PURE__ */ W({
2330
+ }, Do = /* @__PURE__ */ O({
2332
2331
  name: "MDEditorFooter",
2333
- props: Do,
2332
+ props: Ho,
2334
2333
  setup(e) {
2335
- const o = we(() => {
2336
- 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);
2334
+ const o = Ce(() => {
2335
+ const n = e.footers.indexOf("="), r = n === -1 ? e.footers : e.footers.slice(0, n), i = n === -1 ? [] : e.footers.slice(n, Number.MAX_SAFE_INTEGER);
2337
2336
  return [r, i];
2338
- }), l = (a) => {
2339
- if (Ut.includes(a))
2340
- switch (a) {
2337
+ }), l = (n) => {
2338
+ if (Ut.includes(n))
2339
+ switch (n) {
2341
2340
  case "markdownTotal":
2342
- return t(So, {
2341
+ return t(Ao, {
2343
2342
  modelValue: e.modelValue
2344
2343
  }, null);
2345
2344
  case "scrollSwitch":
2346
- return t(Io, {
2345
+ return t(Eo, {
2347
2346
  scrollAuto: e.scrollAuto,
2348
2347
  onScrollAutoChange: e.onScrollAutoChange
2349
2348
  }, null);
2350
2349
  }
2351
2350
  else
2352
- return e.defFooters instanceof Array ? e.defFooters[a] || "" : e.defFooters && e.defFooters.children instanceof Array && e.defFooters.children[a] || "";
2351
+ return e.defFooters instanceof Array ? e.defFooters[n] || "" : e.defFooters && e.defFooters.children instanceof Array && e.defFooters.children[n] || "";
2353
2352
  };
2354
2353
  return () => {
2355
- const a = o.value[0].map((i) => l(i)), r = o.value[1].map((i) => l(i));
2354
+ const n = o.value[0].map((i) => l(i)), r = o.value[1].map((i) => l(i));
2356
2355
  return t("div", {
2357
- class: `${n}-footer`
2356
+ class: `${a}-footer`
2358
2357
  }, [t("div", {
2359
- class: `${n}-footer-left`
2360
- }, [a]), t("div", {
2361
- class: `${n}-footer-right`
2358
+ class: `${a}-footer-left`
2359
+ }, [n]), t("div", {
2360
+ class: `${a}-footer-right`
2362
2361
  }, [r])]);
2363
2362
  };
2364
2363
  }
2365
- }), Ho = /* @__PURE__ */ W({
2364
+ }), No = /* @__PURE__ */ O({
2366
2365
  name: "MdEditorV3",
2367
2366
  props: bl,
2368
2367
  emits: vl,
2369
2368
  setup(e, o) {
2370
2369
  const {
2371
2370
  editorId: l,
2372
- noKatex: a,
2371
+ noKatex: n,
2373
2372
  noMermaid: r,
2374
2373
  noPrettier: i,
2375
2374
  noUploadImg: h,
2376
2375
  noHighlight: f
2377
- } = e, d = G({
2376
+ } = e, d = U({
2378
2377
  scrollAuto: e.scrollAuto
2379
- }), s = P();
2378
+ }), s = R();
2380
2379
  kl(e, o), Cl(e), $l(e), pl(e, o);
2381
- const [g, p] = yl(e, o), k = Tl(e);
2382
- return Dt(() => {
2383
- b.clear(l);
2384
- }), wl(e, o, k, g, p, s), () => {
2385
- var v;
2386
- const $ = ht({
2380
+ const [g, w] = yl(e, o), $ = Tl(e);
2381
+ return Et(() => {
2382
+ v.clear(l);
2383
+ }), wl(e, o, $, g, w, s), () => {
2384
+ var k;
2385
+ const S = ht({
2387
2386
  props: e,
2388
2387
  ctx: o
2389
2388
  }, "defToolbars"), m = ht({
@@ -2392,19 +2391,19 @@ const vo = (e) => {
2392
2391
  }, "defFooters");
2393
2392
  return t("div", {
2394
2393
  id: l,
2395
- class: [n, e.class, e.theme === "dark" && `${n}-dark`, g.fullscreen || g.pageFullscreen ? `${n}-fullscreen` : ""],
2394
+ class: [a, e.class, e.theme === "dark" && `${a}-dark`, g.fullscreen || g.pageFullscreen ? `${a}-fullscreen` : ""],
2396
2395
  style: e.style
2397
2396
  }, [t(Pl, {
2398
2397
  noPrettier: i,
2399
2398
  toolbars: e.toolbars,
2400
2399
  toolbarsExclude: e.toolbarsExclude,
2401
2400
  setting: g,
2402
- updateSetting: p,
2401
+ updateSetting: w,
2403
2402
  tableShape: e.tableShape,
2404
- defToolbars: $,
2403
+ defToolbars: S,
2405
2404
  noUploadImg: h,
2406
2405
  showToolbarName: e.showToolbarName
2407
- }, null), t(xo, {
2406
+ }, null), t(So, {
2408
2407
  ref: s,
2409
2408
  modelValue: e.modelValue,
2410
2409
  setting: g,
@@ -2413,7 +2412,7 @@ const vo = (e) => {
2413
2412
  noPrettier: i,
2414
2413
  sanitize: e.sanitize,
2415
2414
  placeholder: e.placeholder,
2416
- noKatex: a,
2415
+ noKatex: n,
2417
2416
  scrollAuto: d.scrollAuto,
2418
2417
  formatCopiedText: e.formatCopiedText,
2419
2418
  autofocus: e.autoFocus,
@@ -2441,7 +2440,7 @@ const vo = (e) => {
2441
2440
  e.onInput && e.onInput(u), o.emit("onInput", u);
2442
2441
  },
2443
2442
  completions: e.completions,
2444
- catalogVisible: k.value,
2443
+ catalogVisible: $.value,
2445
2444
  theme: e.theme,
2446
2445
  noImgZoomIn: e.noImgZoomIn,
2447
2446
  onDrop: (u) => {
@@ -2452,7 +2451,7 @@ const vo = (e) => {
2452
2451
  e.onInputBoxWitdhChange && e.onInputBoxWitdhChange(u), o.emit("onInputBoxWitdhChange", u);
2453
2452
  },
2454
2453
  sanitizeMermaid: e.sanitizeMermaid
2455
- }, null), ((v = e.footers) == null ? void 0 : v.length) > 0 && t(Eo, {
2454
+ }, null), ((k = e.footers) == null ? void 0 : k.length) > 0 && t(Do, {
2456
2455
  modelValue: e.modelValue,
2457
2456
  footers: e.footers,
2458
2457
  defFooters: m,
@@ -2461,8 +2460,8 @@ const vo = (e) => {
2461
2460
  }, null)]);
2462
2461
  };
2463
2462
  }
2464
- }), ye = Ho;
2465
- ye.install = (e) => (e.component(ye.name, ye), e.use(Sl).use(Xt).use(Ml).use(Ft).use(xl), e);
2463
+ }), ve = No;
2464
+ ve.install = (e) => (e.component(ve.name, ve), e.use(Sl).use(Xt).use(Al).use(Rt).use(xl), e);
2466
2465
  export {
2467
- ye as default
2466
+ ve as default
2468
2467
  };