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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,28 +1,28 @@
1
- var Tt = Object.defineProperty;
2
- var St = (e, t, o) => t in e ? Tt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o;
3
- var U = (e, t, o) => (St(e, typeof t != "symbol" ? t + "" : t, o), o);
4
- import { defineComponent as M, createVNode as i, reactive as N, ref as F, watch as T, onMounted as A, onBeforeUnmount as ke, cloneVNode as xt, inject as x, computed as D, nextTick as z, Fragment as ye, toRef as Q, shallowRef as se, provide as W, isVNode as Et } from "vue";
5
- import { minimalSetup as Lt, EditorView as re } from "codemirror";
6
- import { EditorSelection as me, EditorState as ae, Compartment as Ht, StateEffect as It } from "@codemirror/state";
7
- import { EditorView as Ce, placeholder as At, keymap as Ft } from "@codemirror/view";
8
- import { languages as Mt } from "@codemirror/language-data";
9
- import { markdown as Rt } from "@codemirror/lang-markdown";
10
- import { deleteLine as jt, indentWithTab as Bt, undo as Pt, redo as Ot } from "@codemirror/commands";
11
- import { HighlightStyle as pt, syntaxHighlighting as bt, indentUnit as Dt } from "@codemirror/language";
1
+ var wt = Object.defineProperty;
2
+ var Tt = (e, l, o) => l in e ? wt(e, l, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[l] = o;
3
+ var K = (e, l, o) => (Tt(e, typeof l != "symbol" ? l + "" : l, o), o);
4
+ import { defineComponent as M, createVNode as i, reactive as q, ref as B, watch as S, onMounted as H, onBeforeUnmount as Se, cloneVNode as St, inject as x, computed as U, nextTick as Y, Fragment as xe, toRef as ne, shallowRef as de, provide as Z, isVNode as xt } from "vue";
5
+ import { minimalSetup as Et, EditorView as fe } from "codemirror";
6
+ import { EditorSelection as be, EditorState as ge, Compartment as Lt, StateEffect as At } from "@codemirror/state";
7
+ import { EditorView as Ee, placeholder as It, keymap as Ht } from "@codemirror/view";
8
+ import { languages as Ft } from "@codemirror/language-data";
9
+ import { markdown as Mt } from "@codemirror/lang-markdown";
10
+ import { deleteLine as Bt, indentWithTab as Rt, undo as jt, redo as Pt } from "@codemirror/commands";
11
+ import { HighlightStyle as vt, syntaxHighlighting as pt, indentUnit as Dt } from "@codemirror/language";
12
12
  import { tags as g } from "@lezer/highlight";
13
- import Nt from "medium-zoom";
13
+ import Ot from "medium-zoom";
14
14
  import _t from "copy-to-clipboard";
15
- import Vt from "markdown-it";
16
- import Ut from "markdown-it-image-figures";
17
- import qt from "markdown-it-task-lists";
18
- import Wt from "lru-cache";
19
- const s = "md-editor", Gt = "md-editor-v3", zt = "https://at.alicdn.com/t/c/font_2605852_u82y61ve02.js", H = "https://cdnjs.cloudflare.com/ajax/libs", Kt = `${H}/highlight.js/11.7.0/highlight.min.js`, ze = {
20
- main: `${H}/prettier/2.8.0/standalone.js`,
21
- markdown: `${H}/prettier/2.8.0/parser-markdown.js`
15
+ import Nt from "markdown-it";
16
+ import Vt from "markdown-it-image-figures";
17
+ import Ut from "markdown-it-task-lists";
18
+ import qt from "lru-cache";
19
+ const s = "md-editor", Wt = "md-editor-v3", Gt = "https://at.alicdn.com/t/c/font_2605852_u82y61ve02.js", L = "https://cdnjs.cloudflare.com/ajax/libs", Kt = `${L}/highlight.js/11.7.0/highlight.min.js`, Ge = {
20
+ main: `${L}/prettier/2.8.0/standalone.js`,
21
+ markdown: `${L}/prettier/2.8.0/parser-markdown.js`
22
22
  }, Ke = {
23
- css: `${H}/cropperjs/1.5.13/cropper.min.css`,
24
- js: `${H}/cropperjs/1.5.13/cropper.min.js`
25
- }, Xt = `${H}/screenfull.js/5.2.0/screenfull.min.js`, kt = [
23
+ css: `${L}/cropperjs/1.5.13/cropper.min.css`,
24
+ js: `${L}/cropperjs/1.5.13/cropper.min.js`
25
+ }, zt = `${L}/screenfull.js/5.2.0/screenfull.min.js`, bt = [
26
26
  "bold",
27
27
  "underline",
28
28
  "italic",
@@ -55,7 +55,7 @@ const s = "md-editor", Gt = "md-editor-v3", zt = "https://at.alicdn.com/t/c/font
55
55
  "htmlPreview",
56
56
  "catalog",
57
57
  "github"
58
- ], yt = ["markdownTotal", "=", "scrollSwitch"], Xe = {
58
+ ], kt = ["markdownTotal", "=", "scrollSwitch"], ze = {
59
59
  "zh-CN": {
60
60
  toolbarTips: {
61
61
  bold: "加粗",
@@ -218,73 +218,73 @@ const s = "md-editor", Gt = "md-editor-v3", zt = "https://at.alicdn.com/t/c/font
218
218
  scrollAuto: "Scroll Auto"
219
219
  }
220
220
  }
221
- }, Zt = `${H}/mermaid/9.4.0/mermaid.min.js`, Ze = {
222
- js: `${H}/KaTeX/0.16.3/katex.min.js`,
223
- css: `${H}/KaTeX/0.16.3/katex.min.css`
224
- }, Je = {
221
+ }, Xt = `${L}/mermaid/9.4.0/mermaid.min.js`, Xe = {
222
+ js: `${L}/KaTeX/0.16.3/katex.min.js`,
223
+ css: `${L}/KaTeX/0.16.3/katex.min.css`
224
+ }, Ze = {
225
225
  a11y: {
226
- light: `${H}/highlight.js/11.7.0/styles/a11y-light.min.css`,
227
- dark: `${H}/highlight.js/11.7.0/styles/a11y-dark.min.css`
226
+ light: `${L}/highlight.js/11.7.0/styles/a11y-light.min.css`,
227
+ dark: `${L}/highlight.js/11.7.0/styles/a11y-dark.min.css`
228
228
  },
229
229
  atom: {
230
- light: `${H}/highlight.js/11.7.0/styles/atom-one-light.min.css`,
231
- dark: `${H}/highlight.js/11.7.0/styles/atom-one-dark.min.css`
230
+ light: `${L}/highlight.js/11.7.0/styles/atom-one-light.min.css`,
231
+ dark: `${L}/highlight.js/11.7.0/styles/atom-one-dark.min.css`
232
232
  },
233
233
  github: {
234
- light: `${H}/highlight.js/11.7.0/styles/github.min.css`,
235
- dark: `${H}/highlight.js/11.7.0/styles/github-dark.min.css`
234
+ light: `${L}/highlight.js/11.7.0/styles/github.min.css`,
235
+ dark: `${L}/highlight.js/11.7.0/styles/github-dark.min.css`
236
236
  },
237
237
  gradient: {
238
- light: `${H}/highlight.js/11.7.0/styles/gradient-light.min.css`,
239
- dark: `${H}/highlight.js/11.7.0/styles/gradient-dark.min.css`
238
+ light: `${L}/highlight.js/11.7.0/styles/gradient-light.min.css`,
239
+ dark: `${L}/highlight.js/11.7.0/styles/gradient-dark.min.css`
240
240
  },
241
241
  kimbie: {
242
- light: `${H}/highlight.js/11.7.0/styles/kimbie-light.min.css`,
243
- dark: `${H}/highlight.js/11.7.0/styles/kimbie-dark.min.css`
242
+ light: `${L}/highlight.js/11.7.0/styles/kimbie-light.min.css`,
243
+ dark: `${L}/highlight.js/11.7.0/styles/kimbie-dark.min.css`
244
244
  },
245
245
  paraiso: {
246
- light: `${H}/highlight.js/11.7.0/styles/paraiso-light.min.css`,
247
- dark: `${H}/highlight.js/11.7.0/styles/paraiso-dark.min.css`
246
+ light: `${L}/highlight.js/11.7.0/styles/paraiso-light.min.css`,
247
+ dark: `${L}/highlight.js/11.7.0/styles/paraiso-dark.min.css`
248
248
  },
249
249
  qtcreator: {
250
- light: `${H}/highlight.js/11.7.0/styles/qtcreator-light.min.css`,
251
- dark: `${H}/highlight.js/11.7.0/styles/qtcreator-dark.min.css`
250
+ light: `${L}/highlight.js/11.7.0/styles/qtcreator-light.min.css`,
251
+ dark: `${L}/highlight.js/11.7.0/styles/qtcreator-dark.min.css`
252
252
  },
253
253
  stackoverflow: {
254
- light: `${H}/highlight.js/11.7.0/styles/stackoverflow-light.min.css`,
255
- dark: `${H}/highlight.js/11.7.0/styles/stackoverflow-dark.min.css`
254
+ light: `${L}/highlight.js/11.7.0/styles/stackoverflow-light.min.css`,
255
+ dark: `${L}/highlight.js/11.7.0/styles/stackoverflow-dark.min.css`
256
256
  }
257
- }, I = {
257
+ }, A = {
258
258
  // markedRenderer: (r) => r,
259
259
  // markedExtensions: [],
260
260
  // markedOptions: {},
261
261
  editorExtensions: {},
262
262
  editorConfig: {},
263
- codeMirrorExtensions: (e, t) => t,
263
+ codeMirrorExtensions: (e, l) => l,
264
264
  markdownItConfig: () => {
265
265
  }
266
- }, Jt = (e) => {
266
+ }, Zt = (e) => {
267
267
  if (e)
268
- for (const t in e) {
269
- const o = e[t];
270
- o && (I[t] = o);
268
+ for (const l in e) {
269
+ const o = e[l];
270
+ o && (A[l] = o);
271
271
  }
272
272
  };
273
- const Yt = /* @__PURE__ */ M({
273
+ const Jt = /* @__PURE__ */ M({
274
274
  setup() {
275
275
  return () => i("div", {
276
276
  class: `${s}-divider`
277
277
  }, null);
278
278
  }
279
- }), _ = ({
279
+ }), W = ({
280
280
  instance: e,
281
- ctx: t,
281
+ ctx: l,
282
282
  props: o = {}
283
- }, l = "default") => {
284
- const r = (e == null ? void 0 : e.$slots[l]) || (t == null ? void 0 : t.slots[l]);
285
- return (r ? r(e) : "") || o[l];
283
+ }, t = "default") => {
284
+ const r = (e == null ? void 0 : e.$slots[t]) || (l == null ? void 0 : l.slots[t]);
285
+ return (r ? r(e) : "") || o[t];
286
286
  };
287
- const Qt = {
287
+ const Yt = {
288
288
  trigger: {
289
289
  type: String,
290
290
  default: "hover"
@@ -307,141 +307,141 @@ const Qt = {
307
307
  type: String,
308
308
  default: "html"
309
309
  }
310
- }, Y = /* @__PURE__ */ M({
311
- props: Qt,
312
- setup(e, t) {
313
- const o = `${s}-dropdown-hidden`, l = N({
310
+ }, oe = /* @__PURE__ */ M({
311
+ props: Yt,
312
+ setup(e, l) {
313
+ const o = `${s}-dropdown-hidden`, t = q({
314
314
  overlayClass: [o],
315
315
  overlayStyle: {},
316
316
  triggerHover: !1,
317
317
  overlayHover: !1
318
- }), r = F(), n = F(), a = () => {
319
- var w;
320
- e.trigger === "hover" && (l.triggerHover = !0);
321
- const f = r.value, h = n.value, v = f.getBoundingClientRect(), b = f.offsetTop, k = f.offsetLeft, p = v.height, y = v.width, $ = ((w = document.querySelector(e.relative)) == null ? void 0 : w.scrollLeft) || 0;
322
- l.overlayStyle = {
323
- ...l.overlayStyle,
324
- top: b + p + "px",
325
- left: k - h.offsetWidth / 2 + y / 2 - $ + "px"
318
+ }), r = B(), n = B(), a = () => {
319
+ var T;
320
+ e.trigger === "hover" && (t.triggerHover = !0);
321
+ const f = r.value, h = n.value, p = f.getBoundingClientRect(), v = f.offsetTop, b = f.offsetLeft, y = p.height, C = p.width, $ = ((T = document.querySelector(e.relative)) == null ? void 0 : T.scrollLeft) || 0;
322
+ t.overlayStyle = {
323
+ ...t.overlayStyle,
324
+ top: v + y + "px",
325
+ left: b - h.offsetWidth / 2 + C / 2 - $ + "px"
326
326
  }, e.onChange(!0);
327
- }, c = () => {
328
- l.overlayHover = !0;
327
+ }, d = () => {
328
+ t.overlayHover = !0;
329
329
  };
330
- T(() => e.visible, (f) => {
331
- f ? l.overlayClass = l.overlayClass.filter((h) => h !== o) : l.overlayClass.push(o);
330
+ S(() => e.visible, (f) => {
331
+ f ? t.overlayClass = t.overlayClass.filter((h) => h !== o) : t.overlayClass.push(o);
332
332
  });
333
333
  const m = (f) => {
334
- const h = r.value, v = n.value;
335
- !h.contains(f.target) && !v.contains(f.target) && e.onChange(!1);
334
+ const h = r.value, p = n.value;
335
+ !h.contains(f.target) && !p.contains(f.target) && e.onChange(!1);
336
336
  };
337
337
  let u = -1;
338
- const d = (f) => {
339
- r.value === f.target ? l.triggerHover = !1 : l.overlayHover = !1, clearTimeout(u), u = window.setTimeout(() => {
340
- !l.overlayHover && !l.triggerHover && e.onChange(!1);
338
+ const c = (f) => {
339
+ r.value === f.target ? t.triggerHover = !1 : t.overlayHover = !1, clearTimeout(u), u = window.setTimeout(() => {
340
+ !t.overlayHover && !t.triggerHover && e.onChange(!1);
341
341
  }, 10);
342
342
  };
343
- return A(() => {
344
- e.trigger === "click" ? (r.value.addEventListener("click", a), document.addEventListener("click", m)) : (r.value.addEventListener("mouseenter", a), r.value.addEventListener("mouseleave", d), n.value.addEventListener("mouseenter", c), n.value.addEventListener("mouseleave", d));
345
- }), ke(() => {
346
- e.trigger === "click" ? (r.value.removeEventListener("click", a), document.removeEventListener("click", m)) : (r.value.removeEventListener("mouseenter", a), r.value.removeEventListener("mouseleave", d), n.value.removeEventListener("mouseenter", c), n.value.removeEventListener("mouseleave", d));
343
+ return H(() => {
344
+ e.trigger === "click" ? (r.value.addEventListener("click", a), document.addEventListener("click", m)) : (r.value.addEventListener("mouseenter", a), r.value.addEventListener("mouseleave", c), n.value.addEventListener("mouseenter", d), n.value.addEventListener("mouseleave", c));
345
+ }), Se(() => {
346
+ e.trigger === "click" ? (r.value.removeEventListener("click", a), document.removeEventListener("click", m)) : (r.value.removeEventListener("mouseenter", a), r.value.removeEventListener("mouseleave", c), n.value.removeEventListener("mouseenter", d), n.value.removeEventListener("mouseleave", c));
347
347
  }), () => {
348
- const f = _({
349
- ctx: t
350
- }), h = _({
348
+ const f = W({
349
+ ctx: l
350
+ }), h = W({
351
351
  props: e,
352
- ctx: t
353
- }, "overlay"), v = xt(f instanceof Array ? f[0] : f, {
352
+ ctx: l
353
+ }, "overlay"), p = St(f instanceof Array ? f[0] : f, {
354
354
  ref: r
355
- }), b = i("div", {
356
- class: [`${s}-dropdown`, l.overlayClass],
357
- style: l.overlayStyle,
355
+ }), v = i("div", {
356
+ class: [`${s}-dropdown`, t.overlayClass],
357
+ style: t.overlayStyle,
358
358
  ref: n
359
359
  }, [i("div", {
360
360
  class: `${s}-dropdown-overlay`
361
361
  }, [h instanceof Array ? h[0] : h])]);
362
- return [v, b];
362
+ return [p, v];
363
363
  };
364
364
  }
365
365
  });
366
- class el {
366
+ class Qt {
367
367
  constructor() {
368
368
  // 事件池
369
- U(this, "pools", {});
369
+ K(this, "pools", {});
370
370
  }
371
371
  // 移除事件监听
372
- remove(t, o, l) {
373
- const n = this.pools[t] && this.pools[t][o];
374
- n && (this.pools[t][o] = n.filter((a) => a !== l));
372
+ remove(l, o, t) {
373
+ const n = this.pools[l] && this.pools[l][o];
374
+ n && (this.pools[l][o] = n.filter((a) => a !== t));
375
375
  }
376
376
  // 清空全部事件,由于单一实例,多次注册会被共享内容
377
- clear(t) {
378
- this.pools[t] = {};
377
+ clear(l) {
378
+ this.pools[l] = {};
379
379
  }
380
380
  // 注册事件监听
381
- on(t, o) {
382
- return this.pools[t] || (this.pools[t] = {}), this.pools[t][o.name] || (this.pools[t][o.name] = []), this.pools[t][o.name].push(o.callback), this.pools[t][o.name].includes(o.callback);
381
+ on(l, o) {
382
+ return this.pools[l] || (this.pools[l] = {}), this.pools[l][o.name] || (this.pools[l][o.name] = []), this.pools[l][o.name].push(o.callback), this.pools[l][o.name].includes(o.callback);
383
383
  }
384
384
  // 触发事件
385
- emit(t, o, ...l) {
386
- this.pools[t] || (this.pools[t] = {});
387
- const n = this.pools[t][o];
385
+ emit(l, o, ...t) {
386
+ this.pools[l] || (this.pools[l] = {});
387
+ const n = this.pools[l][o];
388
388
  n && n.forEach((a) => {
389
389
  try {
390
- a(...l);
391
- } catch (c) {
392
- console.error(`${o} monitor event exception!`, c);
390
+ a(...t);
391
+ } catch (d) {
392
+ console.error(`${o} monitor event exception!`, d);
393
393
  }
394
394
  });
395
395
  }
396
396
  }
397
- const C = new el(), tl = (e, t = {
397
+ const k = new Qt(), el = (e, l = {
398
398
  newWindow: !0,
399
399
  nofollow: !0
400
400
  }) => {
401
401
  e || console.error("error link!");
402
402
  const o = document.createElement("a");
403
- o.href = e, o.style.display = "none", t.newWindow && (o.target = "_blank"), t.nofollow && (o.rel = "noopener noreferrer"), document.body.appendChild(o), o.click(), document.body.removeChild(o);
404
- }, ll = (e, t = "image.png") => {
405
- const o = e.split(","), l = o[0].match(/:(.*?);/);
406
- if (l) {
407
- const r = l[1], n = atob(o[1]);
403
+ o.href = e, o.style.display = "none", l.newWindow && (o.target = "_blank"), l.nofollow && (o.rel = "noopener noreferrer"), document.body.appendChild(o), o.click(), document.body.removeChild(o);
404
+ }, tl = (e, l = "image.png") => {
405
+ const o = e.split(","), t = o[0].match(/:(.*?);/);
406
+ if (t) {
407
+ const r = t[1], n = atob(o[1]);
408
408
  let a = n.length;
409
- const c = new Uint8Array(a);
409
+ const d = new Uint8Array(a);
410
410
  for (; a--; )
411
- c[a] = n.charCodeAt(a);
412
- return new File([c], t, { type: r });
411
+ d[a] = n.charCodeAt(a);
412
+ return new File([d], l, { type: r });
413
413
  }
414
414
  return null;
415
- }, ol = (e) => {
415
+ }, ll = (e) => {
416
416
  if (!e)
417
417
  return e;
418
- const t = e.split(`
418
+ const l = e.split(`
419
419
  `), o = ['<span rn-wrapper aria-hidden="true">'];
420
- return t.forEach(() => {
420
+ return l.forEach(() => {
421
421
  o.push("<span></span>");
422
422
  }), o.push("</span>"), `<span class="code-block">${e}</span>${o.join("")}`;
423
- }, de = (e, t = 200) => {
423
+ }, ve = (e, l = 200) => {
424
424
  let o = 0;
425
- return (...l) => new Promise((r) => {
425
+ return (...t) => new Promise((r) => {
426
426
  o && (clearTimeout(o), r("cancel")), o = window.setTimeout(() => {
427
- e.apply(void 0, l), o = 0, r("done");
428
- }, t);
427
+ e.apply(void 0, t), o = 0, r("done");
428
+ }, l);
429
429
  });
430
- }, nl = (e, t = 200) => {
431
- let o = 0, l = null;
430
+ }, ol = (e, l = 200) => {
431
+ let o = 0, t = null;
432
432
  return (...r) => {
433
433
  const n = (a) => {
434
- o === 0 && (o = a), a - o >= t ? (e.apply(void 0, l), l = null, o = 0) : window.requestAnimationFrame(n);
434
+ o === 0 && (o = a), a - o >= l ? (e.apply(void 0, t), t = null, o = 0) : window.requestAnimationFrame(n);
435
435
  };
436
- l === null && window.requestAnimationFrame(n), l = r;
436
+ t === null && window.requestAnimationFrame(n), t = r;
437
437
  };
438
- }, rl = (e, t) => {
438
+ }, nl = (e, l) => {
439
439
  const o = e == null ? void 0 : e.getBoundingClientRect();
440
- if (t === document.documentElement)
441
- return o.top - t.clientTop;
442
- const l = t == null ? void 0 : t.getBoundingClientRect();
443
- return o.top - l.top;
444
- }, il = () => `${Date.now().toString(36)}${Math.random().toString(36).substring(2)}`, al = {
440
+ if (l === document.documentElement)
441
+ return o.top - l.clientTop;
442
+ const t = l == null ? void 0 : l.getBoundingClientRect();
443
+ return o.top - t.top;
444
+ }, rl = () => `${Date.now().toString(36)}${Math.random().toString(36).substring(2)}`, il = {
445
445
  noPrettier: {
446
446
  type: Boolean
447
447
  },
@@ -482,11 +482,11 @@ const C = new el(), tl = (e, t = {
482
482
  noUploadImg: {
483
483
  type: Boolean
484
484
  }
485
- }, ue = "onSave", $e = "changeCatalogVisible", Ct = "changeFullscreen", Ye = "pageFullscreenChanged", Qe = "fullscreenChanged", he = "previewChanged", et = "htmlPreviewChanged", tt = "catalogVisibleChanged", $t = "textareaFocus", lt = (e, t) => {
486
- const o = (l) => {
487
- const r = e.parentElement || document.body, n = r.offsetWidth, a = r.offsetHeight, { clientWidth: c } = document.documentElement, { clientHeight: m } = document.documentElement, u = l.offsetX, d = l.offsetY, f = (v) => {
488
- let b = v.x + document.body.scrollLeft - document.body.clientLeft - u, k = v.y + document.body.scrollTop - document.body.clientTop - d;
489
- b = b < 1 ? 1 : b < c - n - 1 ? b : c - n - 1, k = k < 1 ? 1 : k < m - a - 1 ? k : m - a - 1, t ? t(b, k) : (r.style.left = `${b}px`, r.style.top = `${k}px`);
485
+ }, pe = "onSave", Le = "changeCatalogVisible", yt = "changeFullscreen", Je = "pageFullscreenChanged", Ye = "fullscreenChanged", Ce = "previewChanged", Qe = "htmlPreviewChanged", et = "catalogVisibleChanged", Ct = "textareaFocus", tt = (e, l) => {
486
+ const o = (t) => {
487
+ const r = e.parentElement || document.body, n = r.offsetWidth, a = r.offsetHeight, { clientWidth: d } = document.documentElement, { clientHeight: m } = document.documentElement, u = t.offsetX, c = t.offsetY, f = (p) => {
488
+ let v = p.x + document.body.scrollLeft - document.body.clientLeft - u, b = p.y + document.body.scrollTop - document.body.clientTop - c;
489
+ v = v < 1 ? 1 : v < d - n - 1 ? v : d - n - 1, b = b < 1 ? 1 : b < m - a - 1 ? b : m - a - 1, l ? l(v, b) : (r.style.left = `${v}px`, r.style.top = `${b}px`);
490
490
  };
491
491
  document.addEventListener("mousemove", f);
492
492
  const h = () => {
@@ -497,23 +497,23 @@ const C = new el(), tl = (e, t = {
497
497
  return e.addEventListener("mousedown", o), () => {
498
498
  e.removeEventListener("mousedown", o);
499
499
  };
500
- }, O = (e, t = "") => {
501
- const o = document.getElementById(e.id), l = e.onload;
500
+ }, V = (e, l = "") => {
501
+ const o = document.getElementById(e.id), t = e.onload;
502
502
  e.onload = null;
503
503
  const r = function(n) {
504
- typeof l == "function" && l.bind(this)(n), e.removeEventListener("load", r);
504
+ typeof t == "function" && t.bind(this)(n), e.removeEventListener("load", r);
505
505
  };
506
- o ? t !== "" && (o.addEventListener("load", r), Reflect.get(window, t) && o.dispatchEvent(new Event("load"))) : (e.addEventListener("load", r), document.head.appendChild(e));
507
- }, sl = de((e, t, o) => {
508
- const l = document.getElementById(e);
509
- l && l.setAttribute(t, o);
510
- }, 10), cl = (e) => {
511
- var m, u, d, f;
512
- const t = x("editorId");
513
- let o = (u = (m = I.editorExtensions) == null ? void 0 : m.screenfull) == null ? void 0 : u.instance;
514
- const l = (f = (d = I.editorExtensions) == null ? void 0 : d.screenfull) == null ? void 0 : f.js, r = F(!1), n = (h) => {
506
+ o ? l !== "" && (o.addEventListener("load", r), Reflect.get(window, l) && o.dispatchEvent(new Event("load"))) : (e.addEventListener("load", r), document.head.appendChild(e));
507
+ }, al = ve((e, l, o) => {
508
+ const t = document.getElementById(e);
509
+ t && t.setAttribute(l, o);
510
+ }, 10), sl = (e) => {
511
+ var m, u, c, f;
512
+ const l = x("editorId");
513
+ let o = (u = (m = A.editorExtensions) == null ? void 0 : m.screenfull) == null ? void 0 : u.instance;
514
+ const t = (f = (c = A.editorExtensions) == null ? void 0 : c.screenfull) == null ? void 0 : f.js, r = B(!1), n = (h) => {
515
515
  if (!o) {
516
- C.emit(t, "errorCatcher", {
516
+ k.emit(l, "errorCatcher", {
517
517
  name: "fullscreen",
518
518
  message: "fullscreen is undefined"
519
519
  });
@@ -524,21 +524,21 @@ const C = new el(), tl = (e, t = {
524
524
  o && o.isEnabled && o.on("change", () => {
525
525
  (r.value || e.setting.fullscreen) && (r.value = !1, e.updateSetting("fullscreen"));
526
526
  });
527
- }, c = () => {
527
+ }, d = () => {
528
528
  o = window.screenfull, a();
529
529
  };
530
- return A(() => {
530
+ return H(() => {
531
531
  if (a(), !o) {
532
532
  const h = document.createElement("script");
533
- h.src = l || Xt, h.onload = c, h.id = `${s}-screenfull`, O(h, "screenfull");
533
+ h.src = t || zt, h.onload = d, h.id = `${s}-screenfull`, V(h, "screenfull");
534
534
  }
535
- }), A(() => {
536
- C.on(t, {
537
- name: Ct,
535
+ }), H(() => {
536
+ k.on(l, {
537
+ name: yt,
538
538
  callback: n
539
539
  });
540
540
  }), { fullscreenHandler: n };
541
- }, dl = {
541
+ }, cl = {
542
542
  tableShape: {
543
543
  type: Array,
544
544
  default: () => [6, 4]
@@ -548,37 +548,37 @@ const C = new el(), tl = (e, t = {
548
548
  default: () => {
549
549
  }
550
550
  }
551
- }, ul = /* @__PURE__ */ M({
551
+ }, dl = /* @__PURE__ */ M({
552
552
  name: "TableShape",
553
- props: dl,
553
+ props: cl,
554
554
  setup(e) {
555
- const t = N({
555
+ const l = q({
556
556
  x: -1,
557
557
  y: -1
558
558
  });
559
559
  return () => i("div", {
560
560
  class: `${s}-table-shape`,
561
561
  onMouseleave: () => {
562
- t.x = -1, t.y = -1;
562
+ l.x = -1, l.y = -1;
563
563
  }
564
- }, [new Array(e.tableShape[1]).fill("").map((o, l) => i("div", {
564
+ }, [new Array(e.tableShape[1]).fill("").map((o, t) => i("div", {
565
565
  class: `${s}-table-shape-row`,
566
- key: `table-shape-row-${l}`
566
+ key: `table-shape-row-${t}`
567
567
  }, [new Array(e.tableShape[0]).fill("").map((r, n) => i("div", {
568
568
  class: `${s}-table-shape-col`,
569
569
  key: `table-shape-col-${n}`,
570
570
  onMouseenter: () => {
571
- t.x = l, t.y = n;
571
+ l.x = t, l.y = n;
572
572
  },
573
573
  onClick: () => {
574
- e.onSelected(t);
574
+ e.onSelected(l);
575
575
  }
576
576
  }, [i("div", {
577
- class: [`${s}-table-shape-col-default`, l <= t.x && n <= t.y && `${s}-table-shape-col-include`]
577
+ class: [`${s}-table-shape-col-default`, t <= l.x && n <= l.y && `${s}-table-shape-col-include`]
578
578
  }, null)]))]))]);
579
579
  }
580
580
  });
581
- const ml = {
581
+ const ul = {
582
582
  title: {
583
583
  type: String,
584
584
  default: ""
@@ -616,13 +616,13 @@ const ml = {
616
616
  class: {
617
617
  type: String
618
618
  }
619
- }, we = /* @__PURE__ */ M({
620
- props: ml,
621
- setup(e, t) {
622
- const o = F(e.visible), l = F([`${s}-modal`]), r = F(), n = F();
619
+ }, Ae = /* @__PURE__ */ M({
620
+ props: ul,
621
+ setup(e, l) {
622
+ const o = B(e.visible), t = B([`${s}-modal`]), r = B(), n = B();
623
623
  let a = () => {
624
624
  };
625
- const c = N({
625
+ const d = q({
626
626
  initPos: {
627
627
  left: "0px",
628
628
  top: "0px"
@@ -631,38 +631,38 @@ const ml = {
631
631
  left: "0px",
632
632
  top: "0px"
633
633
  }
634
- }), m = D(() => e.isFullscreen ? {
634
+ }), m = U(() => e.isFullscreen ? {
635
635
  width: "100%",
636
636
  height: "100%"
637
637
  } : {
638
638
  width: e.width,
639
639
  height: e.height
640
640
  });
641
- return A(() => {
642
- a = lt(n.value, (u, d) => {
643
- c.initPos.left = u + "px", c.initPos.top = d + "px";
641
+ return H(() => {
642
+ a = tt(n.value, (u, c) => {
643
+ d.initPos.left = u + "px", d.initPos.top = c + "px";
644
644
  });
645
- }), ke(() => {
645
+ }), Se(() => {
646
646
  a();
647
- }), T(() => e.isFullscreen, (u) => {
648
- u ? a() : a = lt(n.value, (d, f) => {
649
- c.initPos.left = d + "px", c.initPos.top = f + "px";
647
+ }), S(() => e.isFullscreen, (u) => {
648
+ u ? a() : a = tt(n.value, (c, f) => {
649
+ d.initPos.left = c + "px", d.initPos.top = f + "px";
650
650
  });
651
- }), T(() => e.visible, (u) => {
652
- u ? (l.value.push("zoom-in"), o.value = u, z(() => {
653
- const d = r.value.offsetWidth / 2, f = r.value.offsetHeight / 2, h = document.documentElement.clientWidth / 2, v = document.documentElement.clientHeight / 2;
654
- c.initPos.left = h - d + "px", c.initPos.top = v - f + "px";
651
+ }), S(() => e.visible, (u) => {
652
+ u ? (t.value.push("zoom-in"), o.value = u, Y(() => {
653
+ const c = r.value.offsetWidth / 2, f = r.value.offsetHeight / 2, h = document.documentElement.clientWidth / 2, p = document.documentElement.clientHeight / 2;
654
+ d.initPos.left = h - c + "px", d.initPos.top = p - f + "px";
655
655
  }), setTimeout(() => {
656
- l.value = l.value.filter((d) => d !== "zoom-in");
657
- }, 140)) : (l.value.push("zoom-out"), setTimeout(() => {
658
- l.value = l.value.filter((d) => d !== "zoom-out"), o.value = u;
656
+ t.value = t.value.filter((c) => c !== "zoom-in");
657
+ }, 140)) : (t.value.push("zoom-out"), setTimeout(() => {
658
+ t.value = t.value.filter((c) => c !== "zoom-out"), o.value = u;
659
659
  }, 130));
660
660
  }), () => {
661
- const u = _({
662
- ctx: t
663
- }), d = _({
661
+ const u = W({
662
+ ctx: l
663
+ }), c = W({
664
664
  props: e,
665
- ctx: t
665
+ ctx: l
666
666
  }, "title");
667
667
  return i("div", {
668
668
  class: [e.class],
@@ -673,23 +673,23 @@ const ml = {
673
673
  class: `${s}-modal-mask`,
674
674
  onClick: e.onClose
675
675
  }, null), i("div", {
676
- class: l.value,
676
+ class: t.value,
677
677
  style: {
678
- ...c.initPos,
678
+ ...d.initPos,
679
679
  ...m.value
680
680
  },
681
681
  ref: r
682
682
  }, [i("div", {
683
683
  class: `${s}-modal-header`,
684
684
  ref: n
685
- }, [d || ""]), i("div", {
685
+ }, [c || ""]), i("div", {
686
686
  class: `${s}-modal-body`
687
687
  }, [u]), i("div", {
688
688
  class: `${s}-modal-func`
689
689
  }, [e.showAdjust && i("div", {
690
690
  class: `${s}-modal-adjust`,
691
691
  onClick: (f) => {
692
- f.stopPropagation(), e.isFullscreen ? c.initPos = c.historyPos : (c.historyPos = c.initPos, c.initPos = {
692
+ f.stopPropagation(), e.isFullscreen ? d.initPos = d.historyPos : (d.historyPos = d.initPos, d.initPos = {
693
693
  left: "0",
694
694
  top: "0"
695
695
  }), e.onAdjust(!e.isFullscreen);
@@ -712,7 +712,7 @@ const ml = {
712
712
  }, null)])])])])]);
713
713
  };
714
714
  }
715
- }), fl = {
715
+ }), ml = {
716
716
  type: {
717
717
  type: String,
718
718
  default: "link"
@@ -731,47 +731,47 @@ const ml = {
731
731
  default: () => {
732
732
  }
733
733
  }
734
- }, gl = /* @__PURE__ */ M({
735
- props: fl,
734
+ }, fl = /* @__PURE__ */ M({
735
+ props: ml,
736
736
  setup(e) {
737
- const t = x("usedLanguageText"), o = x("editorId"), l = D(() => {
737
+ const l = x("usedLanguageText"), o = x("editorId"), t = U(() => {
738
738
  var n, a;
739
739
  switch (e.type) {
740
740
  case "link":
741
- return (n = t.value.linkModalTips) == null ? void 0 : n.linkTitle;
741
+ return (n = l.value.linkModalTips) == null ? void 0 : n.linkTitle;
742
742
  case "image":
743
- return (a = t.value.linkModalTips) == null ? void 0 : a.imageTitle;
743
+ return (a = l.value.linkModalTips) == null ? void 0 : a.imageTitle;
744
744
  default:
745
745
  return "";
746
746
  }
747
- }), r = N({
747
+ }), r = q({
748
748
  desc: "",
749
749
  url: ""
750
750
  });
751
- return T(() => e.visible, (n) => {
751
+ return S(() => e.visible, (n) => {
752
752
  n || setTimeout(() => {
753
753
  r.desc = "", r.url = "";
754
754
  }, 200);
755
- }), () => i(we, {
756
- title: l.value,
755
+ }), () => i(Ae, {
756
+ title: t.value,
757
757
  visible: e.visible,
758
758
  onClose: e.onCancel
759
759
  }, {
760
760
  default: () => {
761
- var n, a, c, m, u;
761
+ var n, a, d, m, u;
762
762
  return [i("div", {
763
763
  class: `${s}-form-item`
764
764
  }, [i("label", {
765
765
  class: `${s}-label`,
766
766
  for: `link-desc-${o}`
767
- }, [(n = t.value.linkModalTips) == null ? void 0 : n.descLabel]), i("input", {
768
- placeholder: (a = t.value.linkModalTips) == null ? void 0 : a.descLabelPlaceHolder,
767
+ }, [(n = l.value.linkModalTips) == null ? void 0 : n.descLabel]), i("input", {
768
+ placeholder: (a = l.value.linkModalTips) == null ? void 0 : a.descLabelPlaceHolder,
769
769
  class: `${s}-input`,
770
770
  id: `link-desc-${o}`,
771
771
  type: "text",
772
772
  value: r.desc,
773
- onChange: (d) => {
774
- r.desc = d.target.value;
773
+ onChange: (c) => {
774
+ r.desc = c.target.value;
775
775
  },
776
776
  autocomplete: "off"
777
777
  }, null)]), i("div", {
@@ -779,14 +779,14 @@ const ml = {
779
779
  }, [i("label", {
780
780
  class: `${s}-label`,
781
781
  for: `link-url-${o}`
782
- }, [(c = t.value.linkModalTips) == null ? void 0 : c.urlLabel]), i("input", {
783
- placeholder: (m = t.value.linkModalTips) == null ? void 0 : m.urlLabelPlaceHolder,
782
+ }, [(d = l.value.linkModalTips) == null ? void 0 : d.urlLabel]), i("input", {
783
+ placeholder: (m = l.value.linkModalTips) == null ? void 0 : m.urlLabelPlaceHolder,
784
784
  class: `${s}-input`,
785
785
  id: `link-url-${o}`,
786
786
  type: "text",
787
787
  value: r.url,
788
- onChange: (d) => {
789
- r.url = d.target.value;
788
+ onChange: (c) => {
789
+ r.url = c.target.value;
790
790
  },
791
791
  autocomplete: "off"
792
792
  }, null)]), i("div", {
@@ -797,12 +797,12 @@ const ml = {
797
797
  onClick: () => {
798
798
  e.onOk(r), r.desc = "", r.url = "";
799
799
  }
800
- }, [(u = t.value.linkModalTips) == null ? void 0 : u.buttonOK])])];
800
+ }, [(u = l.value.linkModalTips) == null ? void 0 : u.buttonOK])])];
801
801
  }
802
802
  });
803
803
  }
804
804
  });
805
- const hl = {
805
+ const gl = {
806
806
  visible: {
807
807
  type: Boolean,
808
808
  default: !1
@@ -817,13 +817,13 @@ const hl = {
817
817
  default: () => {
818
818
  }
819
819
  }
820
- }, vl = /* @__PURE__ */ M({
821
- props: hl,
820
+ }, hl = /* @__PURE__ */ M({
821
+ props: gl,
822
822
  setup(e) {
823
- var d, f;
824
- const t = x("usedLanguageText"), o = x("editorId");
825
- let l = (f = (d = I == null ? void 0 : I.editorExtensions) == null ? void 0 : d.cropper) == null ? void 0 : f.instance;
826
- const r = F(), n = F(), a = F(), c = N({
823
+ var c, f;
824
+ const l = x("usedLanguageText"), o = x("editorId");
825
+ let t = (f = (c = A == null ? void 0 : A.editorExtensions) == null ? void 0 : c.cropper) == null ? void 0 : f.instance;
826
+ const r = B(), n = B(), a = B(), d = q({
827
827
  cropperInited: !1,
828
828
  imgSelected: !1,
829
829
  imgSrc: "",
@@ -831,34 +831,34 @@ const hl = {
831
831
  isFullscreen: !1
832
832
  });
833
833
  let m = null;
834
- T(() => e.visible, () => {
835
- e.visible && !c.cropperInited && (l = l || window.Cropper, r.value.onchange = () => {
836
- if (!l) {
837
- C.emit(o, "errorCatcher", {
834
+ S(() => e.visible, () => {
835
+ e.visible && !d.cropperInited && (t = t || window.Cropper, r.value.onchange = () => {
836
+ if (!t) {
837
+ k.emit(o, "errorCatcher", {
838
838
  name: "Cropper",
839
839
  message: "Cropper is undefined"
840
840
  });
841
841
  return;
842
842
  }
843
843
  const h = r.value.files || [];
844
- if (c.imgSelected = !0, (h == null ? void 0 : h.length) > 0) {
845
- const v = new FileReader();
846
- v.onload = (b) => {
847
- c.imgSrc = b.target.result, z(() => {
848
- m = new l(n.value, {
844
+ if (d.imgSelected = !0, (h == null ? void 0 : h.length) > 0) {
845
+ const p = new FileReader();
846
+ p.onload = (v) => {
847
+ d.imgSrc = v.target.result, Y(() => {
848
+ m = new t(n.value, {
849
849
  viewMode: 2,
850
850
  preview: `.${s}-clip-preview-target`
851
851
  // aspectRatio: 16 / 9,
852
852
  });
853
853
  });
854
- }, v.readAsDataURL(h[0]);
854
+ }, p.readAsDataURL(h[0]);
855
855
  }
856
856
  });
857
- }), T(() => [c.imgSelected], () => {
857
+ }), S(() => [d.imgSelected], () => {
858
858
  a.value.style = "";
859
- }), T(() => c.isFullscreen, () => {
860
- z(() => {
861
- m == null || m.destroy(), a.value.style = "", n.value && (m = new l(n.value, {
859
+ }), S(() => d.isFullscreen, () => {
860
+ Y(() => {
861
+ m == null || m.destroy(), a.value.style = "", n.value && (m = new t(n.value, {
862
862
  viewMode: 2,
863
863
  preview: `.${s}-clip-preview-target`
864
864
  // aspectRatio: 16 / 9,
@@ -866,33 +866,33 @@ const hl = {
866
866
  });
867
867
  });
868
868
  const u = () => {
869
- m.clear(), m.destroy(), m = null, r.value.value = "", c.imgSelected = !1;
869
+ m.clear(), m.destroy(), m = null, r.value.value = "", d.imgSelected = !1;
870
870
  };
871
871
  return () => {
872
872
  var h;
873
- return i(we, {
873
+ return i(Ae, {
874
874
  class: `${s}-modal-clip`,
875
- title: (h = t.value.clipModalTips) == null ? void 0 : h.title,
875
+ title: (h = l.value.clipModalTips) == null ? void 0 : h.title,
876
876
  visible: e.visible,
877
877
  onClose: e.onCancel,
878
878
  showAdjust: !0,
879
- isFullscreen: c.isFullscreen,
880
- onAdjust: (v) => {
881
- c.isFullscreen = v;
879
+ isFullscreen: d.isFullscreen,
880
+ onAdjust: (p) => {
881
+ d.isFullscreen = p;
882
882
  },
883
883
  width: "668px",
884
884
  height: "421px"
885
885
  }, {
886
886
  default: () => {
887
- var v, b;
887
+ var p, v;
888
888
  return [i("div", {
889
889
  class: `${s}-form-item ${s}-clip`
890
890
  }, [i("div", {
891
891
  class: `${s}-clip-main`
892
- }, [c.imgSelected ? i("div", {
892
+ }, [d.imgSelected ? i("div", {
893
893
  class: `${s}-clip-cropper`
894
894
  }, [i("img", {
895
- src: c.imgSrc,
895
+ src: d.imgSrc,
896
896
  ref: n,
897
897
  style: {
898
898
  display: "none"
@@ -928,11 +928,11 @@ const hl = {
928
928
  type: "button",
929
929
  onClick: () => {
930
930
  if (m) {
931
- const k = m.getCroppedCanvas();
932
- C.emit(o, "uploadImage", [ll(k.toDataURL("image/png"))], e.onOk), u();
931
+ const b = m.getCroppedCanvas();
932
+ k.emit(o, "uploadImage", [tl(b.toDataURL("image/png"))], e.onOk), u();
933
933
  }
934
934
  }
935
- }, [((v = t.value.clipModalTips) == null ? void 0 : v.buttonUpload) || ((b = t.value.linkModalTips) == null ? void 0 : b.buttonOK)])]), i("input", {
935
+ }, [((p = l.value.clipModalTips) == null ? void 0 : p.buttonUpload) || ((v = l.value.linkModalTips) == null ? void 0 : v.buttonOK)])]), i("input", {
936
936
  ref: r,
937
937
  accept: "image/*",
938
938
  type: "file",
@@ -945,7 +945,7 @@ const hl = {
945
945
  });
946
946
  };
947
947
  }
948
- }), pl = {
948
+ }), vl = {
949
949
  type: {
950
950
  type: String,
951
951
  default: "link"
@@ -968,27 +968,27 @@ const hl = {
968
968
  default: () => {
969
969
  }
970
970
  }
971
- }, bl = /* @__PURE__ */ M({
972
- props: pl,
971
+ }, pl = /* @__PURE__ */ M({
972
+ props: vl,
973
973
  setup(e) {
974
- return () => i(ye, null, [i(gl, {
974
+ return () => i(xe, null, [i(fl, {
975
975
  type: e.type,
976
976
  visible: e.linkVisible,
977
977
  onOk: e.onOk,
978
978
  onCancel: e.onCancel
979
- }, null), i(vl, {
979
+ }, null), i(hl, {
980
980
  visible: e.clipVisible,
981
981
  onOk: e.onOk,
982
982
  onCancel: e.onCancel
983
983
  }, null)]);
984
984
  }
985
- }), kl = /* @__PURE__ */ M({
985
+ }), bl = /* @__PURE__ */ M({
986
986
  name: "MDEditorToolbar",
987
- props: al,
987
+ props: il,
988
988
  setup(e) {
989
- const t = x("editorId"), o = x("usedLanguageText"), {
990
- fullscreenHandler: l
991
- } = cl(e), r = `${t}-toolbar-wrapper`, n = N({
989
+ const l = x("editorId"), o = x("usedLanguageText"), {
990
+ fullscreenHandler: t
991
+ } = sl(e), r = `${l}-toolbar-wrapper`, n = q({
992
992
  title: !1,
993
993
  catalog: !1,
994
994
  // 图片上传下拉
@@ -998,40 +998,40 @@ const hl = {
998
998
  // mermaid
999
999
  mermaid: !1,
1000
1000
  katex: !1
1001
- }), a = (v, b) => {
1002
- C.emit(t, "replace", v, b);
1003
- }, c = N({
1001
+ }), a = (p, v) => {
1002
+ k.emit(l, "replace", p, v);
1003
+ }, d = q({
1004
1004
  type: "link",
1005
1005
  linkVisible: !1,
1006
1006
  clipVisible: !1
1007
- }), m = F();
1008
- A(() => {
1009
- C.on(t, {
1007
+ }), m = B();
1008
+ H(() => {
1009
+ k.on(l, {
1010
1010
  name: "openModals",
1011
- callback(v) {
1012
- c.type = v, c.linkVisible = !0;
1011
+ callback(p) {
1012
+ d.type = p, d.linkVisible = !0;
1013
1013
  }
1014
1014
  });
1015
1015
  });
1016
- const u = D(() => {
1017
- const v = e.toolbars.filter((y) => !e.toolbarsExclude.includes(y)), b = v.indexOf("="), k = b === -1 ? v : v.slice(0, b + 1), p = b === -1 ? [] : v.slice(b, Number.MAX_SAFE_INTEGER);
1018
- return [k, p];
1019
- }), d = F(), f = () => {
1020
- C.emit(t, "uploadImage", Array.from(d.value.files || [])), d.value.value = "";
1016
+ const u = U(() => {
1017
+ const p = e.toolbars.filter((C) => !e.toolbarsExclude.includes(C)), v = p.indexOf("="), b = v === -1 ? p : p.slice(0, v + 1), y = v === -1 ? [] : p.slice(v, Number.MAX_SAFE_INTEGER);
1018
+ return [b, y];
1019
+ }), c = B(), f = () => {
1020
+ k.emit(l, "uploadImage", Array.from(c.value.files || [])), c.value.value = "";
1021
1021
  };
1022
- A(() => {
1023
- d.value.addEventListener("change", f);
1022
+ H(() => {
1023
+ c.value.addEventListener("change", f);
1024
1024
  });
1025
- const h = (v) => {
1026
- var b, k, p, y, $, w, L, S, j, B, q, ee, X, R, Z, K, P, V, te, ne, Te, Se, xe, Ee, Le, He, Ie, Ae, Fe, Me, Re, je, Be, Pe, Oe, De, Ne, _e, Ve, Ue, qe, We, Ge;
1027
- if (kt.includes(v))
1028
- switch (v) {
1025
+ const h = (p) => {
1026
+ var v, b, y, C, $, T, I, w, F, j, R, P, _, N, D, Q, z, ue, re, ee, X, ie, te, O, G, ae, me, Ie, He, Fe, Me, Be, Re, je, Pe, De, Oe, _e, Ne, Ve, Ue, qe, We;
1027
+ if (bt.includes(p))
1028
+ switch (p) {
1029
1029
  case "-":
1030
- return i(Yt, null, null);
1030
+ return i(Jt, null, null);
1031
1031
  case "bold":
1032
1032
  return i("div", {
1033
1033
  class: `${s}-toolbar-item`,
1034
- title: (b = o.value.toolbarTips) == null ? void 0 : b.bold,
1034
+ title: (v = o.value.toolbarTips) == null ? void 0 : v.bold,
1035
1035
  onClick: () => {
1036
1036
  a("bold");
1037
1037
  }
@@ -1044,7 +1044,7 @@ const hl = {
1044
1044
  case "underline":
1045
1045
  return i("div", {
1046
1046
  class: `${s}-toolbar-item`,
1047
- title: (k = o.value.toolbarTips) == null ? void 0 : k.underline,
1047
+ title: (b = o.value.toolbarTips) == null ? void 0 : b.underline,
1048
1048
  onClick: () => {
1049
1049
  a("underline");
1050
1050
  }
@@ -1057,7 +1057,7 @@ const hl = {
1057
1057
  case "italic":
1058
1058
  return i("div", {
1059
1059
  class: `${s}-toolbar-item`,
1060
- title: (p = o.value.toolbarTips) == null ? void 0 : p.italic,
1060
+ title: (y = o.value.toolbarTips) == null ? void 0 : y.italic,
1061
1061
  onClick: () => {
1062
1062
  a("italic");
1063
1063
  }
@@ -1070,7 +1070,7 @@ const hl = {
1070
1070
  case "strikeThrough":
1071
1071
  return i("div", {
1072
1072
  class: `${s}-toolbar-item`,
1073
- title: (y = o.value.toolbarTips) == null ? void 0 : y.strikeThrough,
1073
+ title: (C = o.value.toolbarTips) == null ? void 0 : C.strikeThrough,
1074
1074
  onClick: () => {
1075
1075
  a("strikeThrough");
1076
1076
  }
@@ -1081,7 +1081,7 @@ const hl = {
1081
1081
  "xlink:href": "#md-editor-icon-strike-through"
1082
1082
  }, null)])]);
1083
1083
  case "title":
1084
- return i(Y, {
1084
+ return i(oe, {
1085
1085
  relative: `#${r}`,
1086
1086
  visible: n.title,
1087
1087
  onChange: (E) => {
@@ -1102,27 +1102,27 @@ const hl = {
1102
1102
  onClick: () => {
1103
1103
  a("h2");
1104
1104
  }
1105
- }, [(w = o.value.titleItem) == null ? void 0 : w.h2]), i("li", {
1105
+ }, [(T = o.value.titleItem) == null ? void 0 : T.h2]), i("li", {
1106
1106
  class: `${s}-menu-item`,
1107
1107
  onClick: () => {
1108
1108
  a("h3");
1109
1109
  }
1110
- }, [(L = o.value.titleItem) == null ? void 0 : L.h3]), i("li", {
1110
+ }, [(I = o.value.titleItem) == null ? void 0 : I.h3]), i("li", {
1111
1111
  class: `${s}-menu-item`,
1112
1112
  onClick: () => {
1113
1113
  a("h4");
1114
1114
  }
1115
- }, [(S = o.value.titleItem) == null ? void 0 : S.h4]), i("li", {
1115
+ }, [(w = o.value.titleItem) == null ? void 0 : w.h4]), i("li", {
1116
1116
  class: `${s}-menu-item`,
1117
1117
  onClick: () => {
1118
1118
  a("h5");
1119
1119
  }
1120
- }, [(j = o.value.titleItem) == null ? void 0 : j.h5]), i("li", {
1120
+ }, [(F = o.value.titleItem) == null ? void 0 : F.h5]), i("li", {
1121
1121
  class: `${s}-menu-item`,
1122
1122
  onClick: () => {
1123
1123
  a("h6");
1124
1124
  }
1125
- }, [(B = o.value.titleItem) == null ? void 0 : B.h6])])
1125
+ }, [(j = o.value.titleItem) == null ? void 0 : j.h6])])
1126
1126
  }, {
1127
1127
  default: () => {
1128
1128
  var E;
@@ -1140,7 +1140,7 @@ const hl = {
1140
1140
  case "sub":
1141
1141
  return i("div", {
1142
1142
  class: `${s}-toolbar-item`,
1143
- title: (q = o.value.toolbarTips) == null ? void 0 : q.sub,
1143
+ title: (R = o.value.toolbarTips) == null ? void 0 : R.sub,
1144
1144
  onClick: () => {
1145
1145
  a("sub");
1146
1146
  }
@@ -1153,7 +1153,7 @@ const hl = {
1153
1153
  case "sup":
1154
1154
  return i("div", {
1155
1155
  class: `${s}-toolbar-item`,
1156
- title: (ee = o.value.toolbarTips) == null ? void 0 : ee.sup,
1156
+ title: (P = o.value.toolbarTips) == null ? void 0 : P.sup,
1157
1157
  onClick: () => {
1158
1158
  a("sup");
1159
1159
  }
@@ -1166,7 +1166,7 @@ const hl = {
1166
1166
  case "quote":
1167
1167
  return i("div", {
1168
1168
  class: `${s}-toolbar-item`,
1169
- title: (X = o.value.toolbarTips) == null ? void 0 : X.quote,
1169
+ title: (_ = o.value.toolbarTips) == null ? void 0 : _.quote,
1170
1170
  onClick: () => {
1171
1171
  a("quote");
1172
1172
  }
@@ -1179,7 +1179,7 @@ const hl = {
1179
1179
  case "unorderedList":
1180
1180
  return i("div", {
1181
1181
  class: `${s}-toolbar-item`,
1182
- title: (R = o.value.toolbarTips) == null ? void 0 : R.unorderedList,
1182
+ title: (N = o.value.toolbarTips) == null ? void 0 : N.unorderedList,
1183
1183
  onClick: () => {
1184
1184
  a("unorderedList");
1185
1185
  }
@@ -1192,7 +1192,7 @@ const hl = {
1192
1192
  case "orderedList":
1193
1193
  return i("div", {
1194
1194
  class: `${s}-toolbar-item`,
1195
- title: (Z = o.value.toolbarTips) == null ? void 0 : Z.orderedList,
1195
+ title: (D = o.value.toolbarTips) == null ? void 0 : D.orderedList,
1196
1196
  onClick: () => {
1197
1197
  a("orderedList");
1198
1198
  }
@@ -1205,7 +1205,7 @@ const hl = {
1205
1205
  case "task":
1206
1206
  return i("div", {
1207
1207
  class: `${s}-toolbar-item`,
1208
- title: (K = o.value.toolbarTips) == null ? void 0 : K.task,
1208
+ title: (Q = o.value.toolbarTips) == null ? void 0 : Q.task,
1209
1209
  onClick: () => {
1210
1210
  a("task");
1211
1211
  }
@@ -1218,7 +1218,7 @@ const hl = {
1218
1218
  case "codeRow":
1219
1219
  return i("div", {
1220
1220
  class: `${s}-toolbar-item`,
1221
- title: (P = o.value.toolbarTips) == null ? void 0 : P.codeRow,
1221
+ title: (z = o.value.toolbarTips) == null ? void 0 : z.codeRow,
1222
1222
  onClick: () => {
1223
1223
  a("codeRow");
1224
1224
  }
@@ -1231,7 +1231,7 @@ const hl = {
1231
1231
  case "code":
1232
1232
  return i("div", {
1233
1233
  class: `${s}-toolbar-item`,
1234
- title: (V = o.value.toolbarTips) == null ? void 0 : V.code,
1234
+ title: (ue = o.value.toolbarTips) == null ? void 0 : ue.code,
1235
1235
  onClick: () => {
1236
1236
  a("code");
1237
1237
  }
@@ -1244,9 +1244,9 @@ const hl = {
1244
1244
  case "link":
1245
1245
  return i("div", {
1246
1246
  class: `${s}-toolbar-item`,
1247
- title: (te = o.value.toolbarTips) == null ? void 0 : te.link,
1247
+ title: (re = o.value.toolbarTips) == null ? void 0 : re.link,
1248
1248
  onClick: () => {
1249
- c.type = "link", c.linkVisible = !0;
1249
+ d.type = "link", d.linkVisible = !0;
1250
1250
  }
1251
1251
  }, [i("svg", {
1252
1252
  class: `${s}-icon`,
@@ -1257,16 +1257,16 @@ const hl = {
1257
1257
  case "image":
1258
1258
  return e.noUploadImg ? i("div", {
1259
1259
  class: `${s}-toolbar-item`,
1260
- title: (ne = o.value.toolbarTips) == null ? void 0 : ne.image,
1260
+ title: (ee = o.value.toolbarTips) == null ? void 0 : ee.image,
1261
1261
  onClick: () => {
1262
- c.type = "image", c.linkVisible = !0;
1262
+ d.type = "image", d.linkVisible = !0;
1263
1263
  }
1264
1264
  }, [i("svg", {
1265
1265
  class: `${s}-icon`,
1266
1266
  "aria-hidden": "true"
1267
1267
  }, [i("use", {
1268
1268
  "xlink:href": "#md-editor-icon-image"
1269
- }, null)])]) : i(Y, {
1269
+ }, null)])]) : i(oe, {
1270
1270
  relative: `#${r}`,
1271
1271
  visible: n.image,
1272
1272
  onChange: (E) => {
@@ -1280,19 +1280,19 @@ const hl = {
1280
1280
  }, [i("li", {
1281
1281
  class: `${s}-menu-item`,
1282
1282
  onClick: () => {
1283
- c.type = "image", c.linkVisible = !0;
1283
+ d.type = "image", d.linkVisible = !0;
1284
1284
  }
1285
- }, [(Te = o.value.imgTitleItem) == null ? void 0 : Te.link]), i("li", {
1285
+ }, [(X = o.value.imgTitleItem) == null ? void 0 : X.link]), i("li", {
1286
1286
  class: `${s}-menu-item`,
1287
1287
  onClick: () => {
1288
- d.value.click();
1288
+ c.value.click();
1289
1289
  }
1290
- }, [(Se = o.value.imgTitleItem) == null ? void 0 : Se.upload]), i("li", {
1290
+ }, [(ie = o.value.imgTitleItem) == null ? void 0 : ie.upload]), i("li", {
1291
1291
  class: `${s}-menu-item`,
1292
1292
  onClick: () => {
1293
- c.clipVisible = !0;
1293
+ d.clipVisible = !0;
1294
1294
  }
1295
- }, [(xe = o.value.imgTitleItem) == null ? void 0 : xe.clip2upload])])
1295
+ }, [(te = o.value.imgTitleItem) == null ? void 0 : te.clip2upload])])
1296
1296
  }, {
1297
1297
  default: () => {
1298
1298
  var E;
@@ -1308,14 +1308,14 @@ const hl = {
1308
1308
  }
1309
1309
  });
1310
1310
  case "table":
1311
- return i(Y, {
1311
+ return i(oe, {
1312
1312
  relative: `#${r}`,
1313
1313
  visible: n.table,
1314
1314
  onChange: (E) => {
1315
1315
  n.table = E;
1316
1316
  },
1317
1317
  key: "bar-table",
1318
- overlay: i(ul, {
1318
+ overlay: i(dl, {
1319
1319
  tableShape: e.tableShape,
1320
1320
  onSelected: (E) => {
1321
1321
  a("table", {
@@ -1340,9 +1340,9 @@ const hl = {
1340
1340
  case "revoke":
1341
1341
  return i("div", {
1342
1342
  class: `${s}-toolbar-item`,
1343
- title: (Ee = o.value.toolbarTips) == null ? void 0 : Ee.revoke,
1343
+ title: (O = o.value.toolbarTips) == null ? void 0 : O.revoke,
1344
1344
  onClick: () => {
1345
- C.emit(t, "ctrlZ");
1345
+ k.emit(l, "ctrlZ");
1346
1346
  }
1347
1347
  }, [i("svg", {
1348
1348
  class: `${s}-icon`,
@@ -1353,9 +1353,9 @@ const hl = {
1353
1353
  case "next":
1354
1354
  return i("div", {
1355
1355
  class: `${s}-toolbar-item`,
1356
- title: (Le = o.value.toolbarTips) == null ? void 0 : Le.next,
1356
+ title: (G = o.value.toolbarTips) == null ? void 0 : G.next,
1357
1357
  onClick: () => {
1358
- C.emit(t, "ctrlShiftZ");
1358
+ k.emit(l, "ctrlShiftZ");
1359
1359
  }
1360
1360
  }, [i("svg", {
1361
1361
  class: `${s}-icon`,
@@ -1366,9 +1366,9 @@ const hl = {
1366
1366
  case "save":
1367
1367
  return i("div", {
1368
1368
  class: `${s}-toolbar-item`,
1369
- title: (He = o.value.toolbarTips) == null ? void 0 : He.save,
1369
+ title: (ae = o.value.toolbarTips) == null ? void 0 : ae.save,
1370
1370
  onClick: () => {
1371
- C.emit(t, ue);
1371
+ k.emit(l, pe);
1372
1372
  }
1373
1373
  }, [i("svg", {
1374
1374
  class: `${s}-icon`,
@@ -1379,7 +1379,7 @@ const hl = {
1379
1379
  case "prettier":
1380
1380
  return e.noPrettier ? "" : i("div", {
1381
1381
  class: `${s}-toolbar-item`,
1382
- title: (Ie = o.value.toolbarTips) == null ? void 0 : Ie.prettier,
1382
+ title: (me = o.value.toolbarTips) == null ? void 0 : me.prettier,
1383
1383
  onClick: () => {
1384
1384
  a("prettier");
1385
1385
  }
@@ -1392,7 +1392,7 @@ const hl = {
1392
1392
  case "pageFullscreen":
1393
1393
  return !e.setting.fullscreen && i("div", {
1394
1394
  class: `${s}-toolbar-item`,
1395
- title: (Ae = o.value.toolbarTips) == null ? void 0 : Ae.pageFullscreen,
1395
+ title: (Ie = o.value.toolbarTips) == null ? void 0 : Ie.pageFullscreen,
1396
1396
  onClick: () => {
1397
1397
  e.updateSetting("pageFullscreen");
1398
1398
  }
@@ -1405,9 +1405,9 @@ const hl = {
1405
1405
  case "fullscreen":
1406
1406
  return i("div", {
1407
1407
  class: `${s}-toolbar-item`,
1408
- title: (Fe = o.value.toolbarTips) == null ? void 0 : Fe.fullscreen,
1408
+ title: (He = o.value.toolbarTips) == null ? void 0 : He.fullscreen,
1409
1409
  onClick: () => {
1410
- l();
1410
+ t();
1411
1411
  }
1412
1412
  }, [i("svg", {
1413
1413
  class: `${s}-icon`,
@@ -1418,7 +1418,7 @@ const hl = {
1418
1418
  case "preview":
1419
1419
  return i("div", {
1420
1420
  class: `${s}-toolbar-item`,
1421
- title: (Me = o.value.toolbarTips) == null ? void 0 : Me.preview,
1421
+ title: (Fe = o.value.toolbarTips) == null ? void 0 : Fe.preview,
1422
1422
  onClick: () => {
1423
1423
  e.updateSetting("preview");
1424
1424
  }
@@ -1431,7 +1431,7 @@ const hl = {
1431
1431
  case "htmlPreview":
1432
1432
  return i("div", {
1433
1433
  class: `${s}-toolbar-item`,
1434
- title: (Re = o.value.toolbarTips) == null ? void 0 : Re.htmlPreview,
1434
+ title: (Me = o.value.toolbarTips) == null ? void 0 : Me.htmlPreview,
1435
1435
  onClick: () => {
1436
1436
  e.updateSetting("htmlPreview");
1437
1437
  }
@@ -1444,9 +1444,9 @@ const hl = {
1444
1444
  case "catalog":
1445
1445
  return i("div", {
1446
1446
  class: `${s}-toolbar-item`,
1447
- title: (je = o.value.toolbarTips) == null ? void 0 : je.catalog,
1447
+ title: (Be = o.value.toolbarTips) == null ? void 0 : Be.catalog,
1448
1448
  onClick: () => {
1449
- C.emit(t, $e);
1449
+ k.emit(l, Le);
1450
1450
  },
1451
1451
  key: "bar-catalog"
1452
1452
  }, [i("svg", {
@@ -1458,8 +1458,8 @@ const hl = {
1458
1458
  case "github":
1459
1459
  return i("div", {
1460
1460
  class: `${s}-toolbar-item`,
1461
- title: (Be = o.value.toolbarTips) == null ? void 0 : Be.github,
1462
- onClick: () => tl("https://github.com/imzbf/md-editor-v3")
1461
+ title: (Re = o.value.toolbarTips) == null ? void 0 : Re.github,
1462
+ onClick: () => el("https://github.com/imzbf/md-editor-v3")
1463
1463
  }, [i("svg", {
1464
1464
  class: `${s}-icon`,
1465
1465
  "aria-hidden": "true"
@@ -1467,7 +1467,7 @@ const hl = {
1467
1467
  "xlink:href": "#md-editor-icon-github"
1468
1468
  }, null)])]);
1469
1469
  case "mermaid":
1470
- return i(Y, {
1470
+ return i(oe, {
1471
1471
  relative: `#${r}`,
1472
1472
  visible: n.mermaid,
1473
1473
  onChange: (E) => {
@@ -1483,12 +1483,12 @@ const hl = {
1483
1483
  onClick: () => {
1484
1484
  a("flow");
1485
1485
  }
1486
- }, [(Pe = o.value.mermaid) == null ? void 0 : Pe.flow]), i("li", {
1486
+ }, [(je = o.value.mermaid) == null ? void 0 : je.flow]), i("li", {
1487
1487
  class: `${s}-menu-item`,
1488
1488
  onClick: () => {
1489
1489
  a("sequence");
1490
1490
  }
1491
- }, [(Oe = o.value.mermaid) == null ? void 0 : Oe.sequence]), i("li", {
1491
+ }, [(Pe = o.value.mermaid) == null ? void 0 : Pe.sequence]), i("li", {
1492
1492
  class: `${s}-menu-item`,
1493
1493
  onClick: () => {
1494
1494
  a("gantt");
@@ -1498,7 +1498,7 @@ const hl = {
1498
1498
  onClick: () => {
1499
1499
  a("class");
1500
1500
  }
1501
- }, [(Ne = o.value.mermaid) == null ? void 0 : Ne.class]), i("li", {
1501
+ }, [(Oe = o.value.mermaid) == null ? void 0 : Oe.class]), i("li", {
1502
1502
  class: `${s}-menu-item`,
1503
1503
  onClick: () => {
1504
1504
  a("state");
@@ -1508,17 +1508,17 @@ const hl = {
1508
1508
  onClick: () => {
1509
1509
  a("pie");
1510
1510
  }
1511
- }, [(Ve = o.value.mermaid) == null ? void 0 : Ve.pie]), i("li", {
1511
+ }, [(Ne = o.value.mermaid) == null ? void 0 : Ne.pie]), i("li", {
1512
1512
  class: `${s}-menu-item`,
1513
1513
  onClick: () => {
1514
1514
  a("relationship");
1515
1515
  }
1516
- }, [(Ue = o.value.mermaid) == null ? void 0 : Ue.relationship]), i("li", {
1516
+ }, [(Ve = o.value.mermaid) == null ? void 0 : Ve.relationship]), i("li", {
1517
1517
  class: `${s}-menu-item`,
1518
1518
  onClick: () => {
1519
1519
  a("journey");
1520
1520
  }
1521
- }, [(qe = o.value.mermaid) == null ? void 0 : qe.journey])]),
1521
+ }, [(Ue = o.value.mermaid) == null ? void 0 : Ue.journey])]),
1522
1522
  key: "bar-mermaid"
1523
1523
  }, {
1524
1524
  default: () => {
@@ -1535,7 +1535,7 @@ const hl = {
1535
1535
  }
1536
1536
  });
1537
1537
  case "katex":
1538
- return i(Y, {
1538
+ return i(oe, {
1539
1539
  relative: `#${r}`,
1540
1540
  visible: n.katex,
1541
1541
  onChange: (E) => {
@@ -1551,12 +1551,12 @@ const hl = {
1551
1551
  onClick: () => {
1552
1552
  a("katexInline");
1553
1553
  }
1554
- }, [(We = o.value.katex) == null ? void 0 : We.inline]), i("li", {
1554
+ }, [(qe = o.value.katex) == null ? void 0 : qe.inline]), i("li", {
1555
1555
  class: `${s}-menu-item`,
1556
1556
  onClick: () => {
1557
1557
  a("katexBlock");
1558
1558
  }
1559
- }, [(Ge = o.value.katex) == null ? void 0 : Ge.block])]),
1559
+ }, [(We = o.value.katex) == null ? void 0 : We.block])]),
1560
1560
  key: "bar-katex"
1561
1561
  }, {
1562
1562
  default: () => {
@@ -1574,11 +1574,11 @@ const hl = {
1574
1574
  });
1575
1575
  }
1576
1576
  else
1577
- return e.defToolbars instanceof Array ? e.defToolbars[v] || "" : e.defToolbars && e.defToolbars.children instanceof Array && e.defToolbars.children[v] || "";
1577
+ return e.defToolbars instanceof Array ? e.defToolbars[p] || "" : e.defToolbars && e.defToolbars.children instanceof Array && e.defToolbars.children[p] || "";
1578
1578
  };
1579
1579
  return () => {
1580
- const v = u.value[0].map((k) => h(k)), b = u.value[1].map((k) => h(k));
1581
- return i(ye, null, [e.toolbars.length > 0 && i("div", {
1580
+ const p = u.value[0].map((b) => h(b)), v = u.value[1].map((b) => h(b));
1581
+ return i(xe, null, [e.toolbars.length > 0 && i("div", {
1582
1582
  class: `${s}-toolbar-wrapper`,
1583
1583
  id: r
1584
1584
  }, [i("div", {
@@ -1586,340 +1586,313 @@ const hl = {
1586
1586
  }, [i("div", {
1587
1587
  class: `${s}-toolbar-left`,
1588
1588
  ref: m
1589
- }, [v]), i("div", {
1589
+ }, [p]), i("div", {
1590
1590
  class: `${s}-toolbar-right`
1591
- }, [b])])]), i("input", {
1592
- ref: d,
1591
+ }, [v])])]), i("input", {
1592
+ ref: c,
1593
1593
  accept: "image/*",
1594
1594
  type: "file",
1595
1595
  multiple: !0,
1596
1596
  style: {
1597
1597
  display: "none"
1598
1598
  }
1599
- }, null), i(bl, {
1600
- linkVisible: c.linkVisible,
1601
- clipVisible: c.clipVisible,
1602
- type: c.type,
1599
+ }, null), i(pl, {
1600
+ linkVisible: d.linkVisible,
1601
+ clipVisible: d.clipVisible,
1602
+ type: d.type,
1603
1603
  onCancel: () => {
1604
- c.linkVisible = !1, c.clipVisible = !1;
1604
+ d.linkVisible = !1, d.clipVisible = !1;
1605
1605
  },
1606
- onOk: (k) => {
1607
- k && a(c.type, {
1608
- desc: k.desc,
1609
- url: k.url
1610
- }), c.linkVisible = !1, c.clipVisible = !1;
1606
+ onOk: (b) => {
1607
+ b && a(d.type, {
1608
+ desc: b.desc,
1609
+ url: b.url
1610
+ }), d.linkVisible = !1, d.clipVisible = !1;
1611
1611
  }
1612
1612
  }, null)]);
1613
1613
  };
1614
1614
  }
1615
- }), ie = (e) => {
1616
- const { marginTop: t } = getComputedStyle(e);
1617
- return e.offsetTop - parseFloat(t);
1618
- }, yl = (e, t) => {
1619
- let o = !1;
1620
- const l = (r) => {
1621
- const n = e.clientHeight, a = t.clientHeight, c = e.scrollHeight, m = t.scrollHeight, u = (c - n) / (m - a);
1622
- if (r.target === e)
1623
- o = !0, t.scrollTo({
1624
- top: e.scrollTop / u
1625
- // behavior: 'smooth'
1626
- });
1627
- else {
1628
- if (o) {
1629
- o = !1;
1630
- return;
1631
- }
1632
- o = !0, e.scrollTo({
1633
- top: t.scrollTop * u
1634
- // behavior: 'smooth'
1635
- });
1636
- }
1615
+ }), lt = (e, l, o) => {
1616
+ let t = e.scrollTop;
1617
+ const r = () => {
1618
+ const n = l - t;
1619
+ t = t + n / 5, Math.abs(n) < 1 ? (e.scrollTo(0, l), o && setTimeout(o, 100)) : (e.scrollTo(0, t), requestAnimationFrame(r));
1620
+ };
1621
+ r();
1622
+ }, kl = (e, l) => {
1623
+ const o = ve(() => {
1624
+ e.removeEventListener("scroll", t), e.addEventListener("scroll", t), l.removeEventListener("scroll", t), l.addEventListener("scroll", t);
1625
+ }, 50), t = (r) => {
1626
+ const n = e.clientHeight, a = l.clientHeight, d = e.scrollHeight, m = l.scrollHeight, u = (d - n) / (m - a);
1627
+ r.target === e ? (l.removeEventListener("scroll", t), l.scrollTo({
1628
+ top: e.scrollTop / u
1629
+ // behavior: 'smooth'
1630
+ }), o()) : (e.removeEventListener("scroll", t), e.scrollTo({
1631
+ top: l.scrollTop * u
1632
+ // behavior: 'smooth'
1633
+ }), o());
1637
1634
  };
1638
1635
  return [
1639
1636
  () => {
1640
- e.addEventListener("scroll", l, {
1641
- passive: !0
1642
- }), t.addEventListener("scroll", l, {
1643
- passive: !0
1644
- }), e.dispatchEvent(new Event("scroll"));
1637
+ o().finally(() => {
1638
+ e.dispatchEvent(new Event("scroll"));
1639
+ });
1645
1640
  },
1646
1641
  () => {
1647
- e.removeEventListener("scroll", l), t.removeEventListener("scroll", l);
1642
+ e.removeEventListener("scroll", t), l.removeEventListener("scroll", t);
1648
1643
  }
1649
1644
  ];
1650
- }, Cl = (e, t, o, l) => {
1651
- const { view: r } = o;
1652
- let n = [];
1653
- const a = () => {
1654
- n = [];
1655
- const { width: d, lineHeight: f, fontFamily: h, fontSize: v, whiteSpace: b } = getComputedStyle(
1656
- document.querySelector(".cm-content")
1657
- ), k = document.createElement("div");
1658
- k.style.visibility = "none", k.style.zIndex = "-1", k.style.width = d, k.style.lineHeight = f, k.style.fontFamily = h, k.style.fontSize = v, k.style.whiteSpace = b, document.body.appendChild(k);
1659
- let p = 0;
1660
- l.split(`
1661
- `).forEach((y) => {
1662
- k.innerText = y || "-", p += k.offsetHeight;
1663
- const $ = {
1664
- lineHeight: k.offsetHeight,
1665
- scrollHeight: p
1666
- };
1667
- n.push($);
1668
- }), k.remove();
1669
- };
1670
- let c = !1, m = !1;
1671
- const u = de((d) => {
1672
- var b, k;
1673
- const f = r.lineBlockAtHeight(r.scrollDOM.scrollTop), h = r.state.doc.lineAt(f.from), v = Array.from(t.children[0].children).filter(
1674
- (p) => p.hasAttribute("data-line")
1675
- );
1676
- if (d.target === e) {
1677
- if (m) {
1678
- m = !1;
1679
- return;
1680
- }
1681
- if (e.scrollTop + e.clientHeight >= e.scrollHeight) {
1682
- c = !0, t.scrollTo({
1683
- top: t.scrollHeight - t.clientHeight
1684
- });
1685
- return;
1686
- }
1687
- const { number: p } = h;
1688
- let y = (b = t.firstElementChild) == null ? void 0 : b.firstElementChild, $ = 1, w = v.length === 0 ? (k = t.firstElementChild) == null ? void 0 : k.lastElementChild : v[0], L = v.length === 0 ? 0 : Number(v[0].dataset.line);
1689
- for (let R = 0; R < v.length; R++) {
1690
- const Z = Number(v[R].dataset.line) + 1, K = Number(
1691
- R + 1 >= v.length ? -2 : v[R + 1].dataset.line
1692
- );
1693
- if (p >= Z && p <= K) {
1694
- y = v[R], w = v[R + 1], $ = Z, L = K;
1695
- break;
1696
- }
1697
- }
1698
- if (!y)
1699
- return;
1700
- const S = (r.scrollDOM.scrollTop - n[$ - 1].scrollHeight + n[$ - 1].lineHeight) / (n[L - 1].scrollHeight - n[$ - 1].scrollHeight + n[$ - 1].lineHeight), { marginTop: j } = getComputedStyle(y), B = y.offsetTop - parseFloat(j), { marginTop: q } = getComputedStyle(w), X = w.offsetTop - parseFloat(q) - B;
1701
- c = !0, t.scrollTo({
1702
- top: B + X * S
1645
+ }, yl = (e, l, o) => {
1646
+ const { view: t } = o, r = (f) => t.lineBlockAt(t.state.doc.line(f).from).top, n = (f) => t.lineBlockAt(t.state.doc.line(f).from).height;
1647
+ let a = [];
1648
+ const d = () => {
1649
+ a = [];
1650
+ const f = Array.from(l.querySelectorAll("[data-line]")).map(
1651
+ (b) => Number(b.dataset.line) + 1
1652
+ ), { lines: h } = t.state.doc;
1653
+ let p = 1, v = f.shift() ?? h;
1654
+ for (let b = 1; b <= h; b++)
1655
+ b === v && (p = b, v = f.shift() || h + 1), a.push({
1656
+ start: p,
1657
+ end: v - 1
1703
1658
  });
1704
- } else {
1705
- if (c) {
1706
- c = !1;
1707
- return;
1708
- }
1709
- if (t.scrollTop === 0) {
1710
- m = !0, e.scrollTo({
1711
- top: 0
1712
- });
1713
- return;
1714
- } else if (t.scrollTop + t.clientHeight >= t.scrollHeight) {
1715
- m = !0, e.scrollTo({
1716
- top: e.scrollHeight - e.clientHeight
1659
+ };
1660
+ let m = 0, u = 0;
1661
+ const c = (f) => {
1662
+ var v, b, y, C, $, T, I;
1663
+ if (!((v = l.firstElementChild) != null && v.firstElementChild))
1664
+ return;
1665
+ const h = t.lineBlockAtHeight(t.scrollDOM.scrollTop), { number: p } = t.state.doc.lineAt(h.from);
1666
+ if (!(p > a.length) && !(t.state.doc.lines < a[a.length - 1].end))
1667
+ if (f.target === e) {
1668
+ if (u !== 0)
1669
+ return;
1670
+ m++;
1671
+ const w = a[p - 1], F = r(w.end) + n(w.end);
1672
+ let j = 0;
1673
+ const R = r(w.start), P = l.querySelector(`[data-line="${w.start - 1}"]`) || ((b = l.firstElementChild) == null ? void 0 : b.firstElementChild), _ = l.querySelector(`[data-line="${w.end}"]`) || ((y = l.lastElementChild) == null ? void 0 : y.lastElementChild);
1674
+ let N = 0, D = 0;
1675
+ R === 0 ? (j = (t.scrollDOM.scrollTop - R) / (F - R), N = _.offsetTop) : F > t.scrollDOM.scrollHeight - t.scrollDOM.clientHeight ? (j = (t.scrollDOM.scrollTop - R) / (t.scrollDOM.scrollHeight - t.scrollDOM.clientHeight - R), D = P.offsetTop, N = l.scrollHeight - l.clientHeight - D + 10) : (j = (t.scrollDOM.scrollTop - R) / (F - R), D = P.offsetTop, N = _.offsetTop - D);
1676
+ const Q = D - 10 + N * j;
1677
+ lt(l, Q, () => {
1678
+ m--;
1717
1679
  });
1718
- return;
1719
- }
1720
- const p = t.scrollTop, y = t.scrollHeight;
1721
- let $ = Math.floor(
1722
- Number(v[v.length - 1].dataset.line) * (p / y)
1723
- ), w;
1724
- for (let P = $; P >= 0; P--) {
1725
- const V = t.querySelector(`[data-line="${P}"]`);
1726
- if (V) {
1727
- w = V, $ = P;
1728
- break;
1729
- }
1730
- }
1731
- if (!w)
1732
- return;
1733
- let L, S;
1734
- for (; ; ) {
1735
- const P = v.indexOf(w), V = v[P + 1], te = ie(w);
1736
- if (te > p) {
1737
- if (P === 0) {
1738
- L = w, S = V;
1680
+ } else {
1681
+ if (m !== 0)
1682
+ return;
1683
+ u++;
1684
+ const w = Array.from(
1685
+ l.querySelectorAll("[data-line]")
1686
+ ), F = l.scrollTop, j = l.scrollHeight;
1687
+ let R = w.length === 0 ? 1 : Math.ceil(
1688
+ Number(w[w.length - 1].dataset.line) * (F / j)
1689
+ ), P = (C = l.firstElementChild) == null ? void 0 : C.firstElementChild;
1690
+ for (let O = R; O >= 0; O--) {
1691
+ const G = l.querySelector(`[data-line="${O}"]`);
1692
+ if (G) {
1693
+ P = G, R = O;
1739
1694
  break;
1740
1695
  }
1741
- w = v[P - 1];
1742
- continue;
1743
1696
  }
1744
- const ne = ie(V);
1745
- if (te <= p && ne > p) {
1746
- L = w, S = V;
1747
- break;
1697
+ let _ = ($ = l.firstElementChild) == null ? void 0 : $.firstElementChild, N = (T = l.firstElementChild) == null ? void 0 : T.lastElementChild;
1698
+ for (; w.length > 0; ) {
1699
+ const O = w.indexOf(P);
1700
+ if (O + 1 >= w.length)
1701
+ break;
1702
+ const G = w[O + 1], ae = P.offsetTop;
1703
+ if (ae > F) {
1704
+ if (O === 0) {
1705
+ _ = P, N = G;
1706
+ break;
1707
+ }
1708
+ P = w[O - 1];
1709
+ continue;
1710
+ }
1711
+ const me = G.offsetTop;
1712
+ if (ae <= F && me > F) {
1713
+ _ = P, N = G;
1714
+ break;
1715
+ }
1716
+ P = G;
1748
1717
  }
1749
- w = V;
1718
+ const D = _.offsetTop, Q = N.offsetTop;
1719
+ let z = 0;
1720
+ const { start: ue, end: re } = a[Number(_.dataset.line || 0)], ee = r(ue);
1721
+ let X = r(re);
1722
+ const ie = n(re);
1723
+ let te = 0;
1724
+ _ === ((I = l.firstElementChild) == null ? void 0 : I.firstElementChild) ? (z = Math.max(F / Q, 0), te = X + ie - ee) : X > t.scrollDOM.scrollHeight - t.scrollDOM.clientHeight ? (z = Math.max(
1725
+ (F - D) / (l.scrollHeight - D - l.clientHeight),
1726
+ 0
1727
+ ), X = r(t.state.doc.lines) + n(t.state.doc.lines), te = 8 + X - ee - e.clientHeight) : (z = Math.max(
1728
+ (F - D) / (Q - D),
1729
+ 0
1730
+ ), te = X + ie - ee), lt(e, ee + te * z, () => {
1731
+ u--;
1732
+ });
1750
1733
  }
1751
- const j = ie(L), B = ie(S), q = (p - j) / (B - j), ee = Number(L.dataset.line), X = Number(S.dataset.line), R = n[ee].scrollHeight, K = n[X].scrollHeight - R;
1752
- m = !0, e.scrollTo({
1753
- top: R + K * q
1754
- });
1755
- }
1756
- }, 6);
1734
+ };
1757
1735
  return [
1758
1736
  () => {
1759
- a(), e.addEventListener("scroll", u, {
1760
- passive: !0
1761
- }), t.addEventListener("scroll", u, {
1762
- passive: !0
1763
- }), e.dispatchEvent(new Event("scroll"));
1737
+ d(), e.addEventListener("scroll", c), l.addEventListener("scroll", c), e.dispatchEvent(new Event("scroll"));
1764
1738
  },
1765
1739
  () => {
1766
- e.removeEventListener("scroll", u), t.removeEventListener("scroll", u);
1740
+ a = [], e.removeEventListener("scroll", c), l.removeEventListener("scroll", c);
1767
1741
  }
1768
1742
  ];
1769
- }, $l = (e, t, o, l, r) => {
1743
+ }, Cl = (e, l, o, t, r) => {
1770
1744
  const n = x("previewOnly");
1771
1745
  let a = () => {
1772
- }, c = () => {
1746
+ }, d = () => {
1773
1747
  };
1774
1748
  const m = () => {
1775
1749
  a();
1776
1750
  const u = document.querySelector(".cm-scroller");
1777
- !n && (o.value || l.value) && ([c, a] = (o.value ? Cl : yl)(
1751
+ !n && (o.value || t.value) && ([d, a] = (o.value ? yl : kl)(
1778
1752
  u,
1779
- o.value || l.value,
1780
- r.value,
1781
- e.value
1782
- )), e.scrollAuto && c();
1753
+ o.value || t.value,
1754
+ r.value
1755
+ )), e.scrollAuto && d();
1783
1756
  };
1784
- T(
1757
+ S(
1785
1758
  [
1786
- t,
1787
- Q(e.setting, "preview"),
1788
- Q(e.setting, "htmlPreview"),
1789
- Q(e.setting, "fullscreen"),
1790
- Q(e.setting, "pageFullscreen")
1759
+ l,
1760
+ ne(e.setting, "preview"),
1761
+ ne(e.setting, "htmlPreview"),
1762
+ ne(e.setting, "fullscreen"),
1763
+ ne(e.setting, "pageFullscreen")
1791
1764
  ],
1792
1765
  () => {
1793
- z(m);
1766
+ Y(m);
1794
1767
  }
1795
- ), T(
1768
+ ), S(
1796
1769
  () => e.scrollAuto,
1797
1770
  (u) => {
1798
- u ? c() : a();
1771
+ u ? d() : a();
1799
1772
  }
1800
- ), A(m);
1801
- }, wl = (e, t, o) => {
1802
- var d, f, h, v, b, k;
1803
- let l = "", r = 0, n = 0, a = !0, c = !1;
1804
- const m = t.getSelectedText(), u = (d = I.editorConfig) == null ? void 0 : d.mermaidTemplate;
1773
+ ), H(m);
1774
+ }, $l = (e, l, o) => {
1775
+ var c, f, h, p, v, b;
1776
+ let t = "", r = 0, n = 0, a = !0, d = !1;
1777
+ const m = l.getSelectedText(), u = (c = A.editorConfig) == null ? void 0 : c.mermaidTemplate;
1805
1778
  if (/^h[1-6]{1}$/.test(e)) {
1806
- const p = e.replace(/^h(\d)/, (y, $) => new Array(Number($)).fill("#", 0, $).join(""));
1807
- l = `${p} ${m}`, r = p.length + 1;
1779
+ const y = e.replace(/^h(\d)/, (C, $) => new Array(Number($)).fill("#", 0, $).join(""));
1780
+ t = `${y} ${m}`, r = y.length + 1;
1808
1781
  } else if (e === "prettier") {
1809
- const p = window.prettier || ((h = (f = I.editorExtensions) == null ? void 0 : f.prettier) == null ? void 0 : h.prettierInstance), y = [
1810
- ((v = window.prettierPlugins) == null ? void 0 : v.markdown) || ((k = (b = I.editorExtensions) == null ? void 0 : b.prettier) == null ? void 0 : k.parserMarkdownInstance)
1782
+ const y = window.prettier || ((h = (f = A.editorExtensions) == null ? void 0 : f.prettier) == null ? void 0 : h.prettierInstance), C = [
1783
+ ((p = window.prettierPlugins) == null ? void 0 : p.markdown) || ((b = (v = A.editorExtensions) == null ? void 0 : v.prettier) == null ? void 0 : b.parserMarkdownInstance)
1811
1784
  ];
1812
- !p || y[0] === void 0 ? (C.emit(o.editorId, "errorCatcher", {
1785
+ !y || C[0] === void 0 ? (k.emit(o.editorId, "errorCatcher", {
1813
1786
  name: "prettier",
1814
1787
  message: "prettier is undefined"
1815
- }), l = t.getValue()) : l = p.format(t.getValue(), {
1788
+ }), t = l.getValue()) : t = y.format(l.getValue(), {
1816
1789
  parser: "markdown",
1817
- plugins: y
1818
- }), a = !1, c = !0;
1790
+ plugins: C
1791
+ }), a = !1, d = !0;
1819
1792
  } else
1820
1793
  switch (e) {
1821
1794
  case "bold": {
1822
- l = `**${m}**`, r = 2, n = -2;
1795
+ t = `**${m}**`, r = 2, n = -2;
1823
1796
  break;
1824
1797
  }
1825
1798
  case "underline": {
1826
- l = `<u>${m}</u>`, r = 3, n = -4;
1799
+ t = `<u>${m}</u>`, r = 3, n = -4;
1827
1800
  break;
1828
1801
  }
1829
1802
  case "italic": {
1830
- l = `*${m}*`, r = 1, n = -1;
1803
+ t = `*${m}*`, r = 1, n = -1;
1831
1804
  break;
1832
1805
  }
1833
1806
  case "strikeThrough": {
1834
- l = `~${m}~`, r = 1, n = -1;
1807
+ t = `~${m}~`, r = 1, n = -1;
1835
1808
  break;
1836
1809
  }
1837
1810
  case "sub": {
1838
- l = `<sub>${m}</sub>`, r = 5, n = -6;
1811
+ t = `<sub>${m}</sub>`, r = 5, n = -6;
1839
1812
  break;
1840
1813
  }
1841
1814
  case "sup": {
1842
- l = `<sup>${m}</sup>`, r = 5, n = -6;
1815
+ t = `<sup>${m}</sup>`, r = 5, n = -6;
1843
1816
  break;
1844
1817
  }
1845
1818
  case "codeRow": {
1846
- l = "`" + m + "`", r = 1, n = -1;
1819
+ t = "`" + m + "`", r = 1, n = -1;
1847
1820
  break;
1848
1821
  }
1849
1822
  case "quote": {
1850
- l = `> ${m}`, r = 2;
1823
+ t = `> ${m}`, r = 2;
1851
1824
  break;
1852
1825
  }
1853
1826
  case "orderedList": {
1854
- l = `1. ${m}`, r = 3;
1827
+ t = `1. ${m}`, r = 3;
1855
1828
  break;
1856
1829
  }
1857
1830
  case "unorderedList": {
1858
- l = `- ${m}`, r = 2;
1831
+ t = `- ${m}`, r = 2;
1859
1832
  break;
1860
1833
  }
1861
1834
  case "task": {
1862
- l = `- [ ] ${m}`, r = 6;
1835
+ t = `- [ ] ${m}`, r = 6;
1863
1836
  break;
1864
1837
  }
1865
1838
  case "code": {
1866
- const p = o.text || m || "", y = o.mode || "language";
1867
- l = `\`\`\`${y}
1868
- ${p}
1839
+ const y = o.text || m || "", C = o.mode || "language";
1840
+ t = `\`\`\`${C}
1841
+ ${y}
1869
1842
  \`\`\`
1870
- `, r = 3, n = 3 + y.length - l.length;
1843
+ `, r = 3, n = 3 + C.length - t.length;
1871
1844
  break;
1872
1845
  }
1873
1846
  case "table": {
1874
- l = "|";
1875
- const { selectedShape: p = { x: 1, y: 1 } } = o, { x: y, y: $ } = p;
1876
- for (let w = 0; w <= $; w++)
1877
- l += " col |";
1878
- l += `
1847
+ t = "|";
1848
+ const { selectedShape: y = { x: 1, y: 1 } } = o, { x: C, y: $ } = y;
1849
+ for (let T = 0; T <= $; T++)
1850
+ t += " col |";
1851
+ t += `
1879
1852
  |`;
1880
- for (let w = 0; w <= $; w++)
1881
- l += " - |";
1882
- for (let w = 0; w <= y; w++) {
1883
- l += `
1853
+ for (let T = 0; T <= $; T++)
1854
+ t += " - |";
1855
+ for (let T = 0; T <= C; T++) {
1856
+ t += `
1884
1857
  |`;
1885
- for (let L = 0; L <= $; L++)
1886
- l += " content |";
1858
+ for (let I = 0; I <= $; I++)
1859
+ t += " content |";
1887
1860
  }
1888
- r = 2, n = 5 - l.length;
1861
+ r = 2, n = 5 - t.length;
1889
1862
  break;
1890
1863
  }
1891
1864
  case "link": {
1892
- const { desc: p, url: y } = o;
1893
- l = `[${p}](${y})`, a = !1;
1865
+ const { desc: y, url: C } = o;
1866
+ t = `[${y}](${C})`, a = !1;
1894
1867
  break;
1895
1868
  }
1896
1869
  case "image": {
1897
- const { desc: p, url: y, urls: $ } = o;
1898
- $ instanceof Array ? l = $.reduce((w, L) => w + `![${p}](${L})
1899
- `, "") : l = `![${p}](${y})
1870
+ const { desc: y, url: C, urls: $ } = o;
1871
+ $ instanceof Array ? t = $.reduce((T, I) => T + `![${y}](${I})
1872
+ `, "") : t = `![${y}](${C})
1900
1873
  `, a = !1;
1901
1874
  break;
1902
1875
  }
1903
1876
  case "flow": {
1904
- l = `\`\`\`mermaid
1877
+ t = `\`\`\`mermaid
1905
1878
  ${(u == null ? void 0 : u.flow) || `flowchart TD
1906
1879
  Start --> Stop`}
1907
1880
  \`\`\`
1908
- `, r = 3, n = 10 - l.length;
1881
+ `, r = 3, n = 10 - t.length;
1909
1882
  break;
1910
1883
  }
1911
1884
  case "sequence": {
1912
- l = `\`\`\`mermaid
1885
+ t = `\`\`\`mermaid
1913
1886
  ${(u == null ? void 0 : u.sequence) || `sequenceDiagram
1914
1887
  A->>B: hello!
1915
1888
  B-->>A: hi!
1916
1889
  A-)B: bye!`}
1917
1890
  \`\`\`
1918
- `, r = 3, n = 10 - l.length;
1891
+ `, r = 3, n = 10 - t.length;
1919
1892
  break;
1920
1893
  }
1921
1894
  case "gantt": {
1922
- l = `\`\`\`mermaid
1895
+ t = `\`\`\`mermaid
1923
1896
  ${(u == null ? void 0 : u.gantt) || `gantt
1924
1897
  title A Gantt Diagram
1925
1898
  dateFormat YYYY-MM-DD
@@ -1927,47 +1900,47 @@ section Section
1927
1900
  A task :a1, 2014-01-01, 30d
1928
1901
  Another task :after a1, 20d`}
1929
1902
  \`\`\`
1930
- `, r = 3, n = 10 - l.length;
1903
+ `, r = 3, n = 10 - t.length;
1931
1904
  break;
1932
1905
  }
1933
1906
  case "class": {
1934
- l = `\`\`\`mermaid
1907
+ t = `\`\`\`mermaid
1935
1908
  ${(u == null ? void 0 : u.class) || `classDiagram
1936
1909
  class Animal
1937
1910
  Vehicle <|-- Car`}
1938
1911
  \`\`\`
1939
- `, r = 3, n = 10 - l.length;
1912
+ `, r = 3, n = 10 - t.length;
1940
1913
  break;
1941
1914
  }
1942
1915
  case "state": {
1943
- l = `\`\`\`mermaid
1916
+ t = `\`\`\`mermaid
1944
1917
  ${(u == null ? void 0 : u.state) || `stateDiagram-v2
1945
1918
  s1 --> s2`}
1946
1919
  \`\`\`
1947
- `, r = 3, n = 10 - l.length;
1920
+ `, r = 3, n = 10 - t.length;
1948
1921
  break;
1949
1922
  }
1950
1923
  case "pie": {
1951
- l = `\`\`\`mermaid
1924
+ t = `\`\`\`mermaid
1952
1925
  ${(u == null ? void 0 : u.pie) || `pie title Pets adopted by volunteers
1953
1926
  "Dogs" : 386
1954
1927
  "Cats" : 85
1955
1928
  "Rats" : 15`}
1956
1929
  \`\`\`
1957
- `, r = 3, n = 10 - l.length;
1930
+ `, r = 3, n = 10 - t.length;
1958
1931
  break;
1959
1932
  }
1960
1933
  case "relationship": {
1961
- l = `\`\`\`mermaid
1934
+ t = `\`\`\`mermaid
1962
1935
  ${(u == null ? void 0 : u.relationship) || `erDiagram
1963
1936
  CAR ||--o{ NAMED-DRIVER : allows
1964
1937
  PERSON ||--o{ NAMED-DRIVER : is`}
1965
1938
  \`\`\`
1966
- `, r = 3, n = 10 - l.length;
1939
+ `, r = 3, n = 10 - t.length;
1967
1940
  break;
1968
1941
  }
1969
1942
  case "journey": {
1970
- l = `\`\`\`mermaid
1943
+ t = `\`\`\`mermaid
1971
1944
  ${(u == null ? void 0 : u.journey) || `journey
1972
1945
  title My working day
1973
1946
  section Go to work
@@ -1978,27 +1951,27 @@ ${(u == null ? void 0 : u.journey) || `journey
1978
1951
  Go downstairs: 5: Me
1979
1952
  Sit down: 5: Me`}
1980
1953
  \`\`\`
1981
- `, r = 3, n = 10 - l.length;
1954
+ `, r = 3, n = 10 - t.length;
1982
1955
  break;
1983
1956
  }
1984
1957
  case "katexInline": {
1985
- l = "$$", r = 1, n = -1;
1958
+ t = "$$", r = 1, n = -1;
1986
1959
  break;
1987
1960
  }
1988
1961
  case "katexBlock": {
1989
- l = `$$
1962
+ t = `$$
1990
1963
 
1991
1964
  $$
1992
1965
  `, r = 3, n = -4;
1993
1966
  break;
1994
1967
  }
1995
1968
  case "universal": {
1996
- const { generate: p } = o, y = p(m);
1997
- l = y.targetValue, a = y.select, r = y.deviationStart, n = y.deviationEnd;
1969
+ const { generate: y } = o, C = y(m);
1970
+ t = C.targetValue, a = C.select, r = C.deviationStart, n = C.deviationEnd;
1998
1971
  }
1999
1972
  }
2000
1973
  return {
2001
- text: l,
1974
+ text: t,
2002
1975
  options: {
2003
1976
  // 是否选中
2004
1977
  select: a,
@@ -2007,21 +1980,21 @@ $$
2007
1980
  // 结束的偏移量
2008
1981
  deviationEnd: n,
2009
1982
  // 是否整个替换
2010
- replaceAll: c
1983
+ replaceAll: d
2011
1984
  }
2012
1985
  };
2013
- }, Tl = "#e5c07b", ot = "var(--md-color)", Sl = "#56b6c2", xl = "#ffffff", le = "var(--md-color)", nt = "#e5c07b", El = "#e5c07b", Ll = "var(--md-color)", rt = "#d19a66", Hl = "#c678dd", Il = "#21252b", it = "#2c313a", at = "#000", fe = "#353a42", Al = "#ceedfa33", st = "#528bff", Fl = Ce.theme(
1986
+ }, wl = "#e5c07b", ot = "var(--md-color)", Tl = "#56b6c2", Sl = "#ffffff", se = "var(--md-color)", nt = "#e5c07b", xl = "#e5c07b", El = "var(--md-color)", rt = "#d19a66", Ll = "#c678dd", Al = "#21252b", it = "#2c313a", at = "#000", ke = "#353a42", Il = "#ceedfa33", st = "#528bff", Hl = Ee.theme(
2014
1987
  {
2015
1988
  "&": {
2016
- color: le,
1989
+ color: se,
2017
1990
  backgroundColor: at
2018
1991
  },
2019
1992
  ".cm-content": {
2020
1993
  caretColor: st
2021
1994
  },
2022
1995
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: st },
2023
- "&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Al },
2024
- ".cm-panels": { backgroundColor: Il, color: le },
1996
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Il },
1997
+ ".cm-panels": { backgroundColor: Al, color: se },
2025
1998
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
2026
1999
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
2027
2000
  ".cm-searchMatch": {
@@ -2038,7 +2011,7 @@ $$
2038
2011
  },
2039
2012
  ".cm-gutters": {
2040
2013
  backgroundColor: at,
2041
- color: le,
2014
+ color: se,
2042
2015
  borderRight: "1px solid",
2043
2016
  borderColor: "var(--md-border-color)"
2044
2017
  },
@@ -2052,30 +2025,30 @@ $$
2052
2025
  },
2053
2026
  ".cm-tooltip": {
2054
2027
  border: "none",
2055
- backgroundColor: fe
2028
+ backgroundColor: ke
2056
2029
  },
2057
2030
  ".cm-tooltip .cm-tooltip-arrow:before": {
2058
2031
  borderTopColor: "transparent",
2059
2032
  borderBottomColor: "transparent"
2060
2033
  },
2061
2034
  ".cm-tooltip .cm-tooltip-arrow:after": {
2062
- borderTopColor: fe,
2063
- borderBottomColor: fe
2035
+ borderTopColor: ke,
2036
+ borderBottomColor: ke
2064
2037
  },
2065
2038
  ".cm-tooltip-autocomplete": {
2066
2039
  "& > ul > li[aria-selected]": {
2067
2040
  backgroundColor: it,
2068
- color: le
2041
+ color: se
2069
2042
  }
2070
2043
  }
2071
2044
  },
2072
2045
  { dark: !0 }
2073
- ), Ml = pt.define([
2074
- { tag: g.keyword, color: Hl },
2046
+ ), Fl = vt.define([
2047
+ { tag: g.keyword, color: Ll },
2075
2048
  { tag: [g.name, g.deleted, g.character, g.propertyName, g.macroName], color: ot },
2076
- { tag: [g.function(g.variableName), g.labelName], color: El },
2049
+ { tag: [g.function(g.variableName), g.labelName], color: xl },
2077
2050
  { tag: [g.color, g.constant(g.name), g.standard(g.name)], color: rt },
2078
- { tag: [g.definition(g.name), g.separator], color: le },
2051
+ { tag: [g.definition(g.name), g.separator], color: se },
2079
2052
  {
2080
2053
  tag: [
2081
2054
  g.typeName,
@@ -2087,7 +2060,7 @@ $$
2087
2060
  g.self,
2088
2061
  g.namespace
2089
2062
  ],
2090
- color: Tl
2063
+ color: wl
2091
2064
  },
2092
2065
  {
2093
2066
  tag: [
@@ -2099,7 +2072,7 @@ $$
2099
2072
  g.link,
2100
2073
  g.special(g.string)
2101
2074
  ],
2102
- color: Sl
2075
+ color: Tl
2103
2076
  },
2104
2077
  { tag: [g.meta, g.comment], color: nt },
2105
2078
  { tag: g.strong, fontWeight: "bold" },
@@ -2108,23 +2081,23 @@ $$
2108
2081
  { tag: g.link, color: nt, textDecoration: "underline" },
2109
2082
  { tag: g.heading, fontWeight: "bold", color: ot },
2110
2083
  { tag: [g.atom, g.bool, g.special(g.variableName)], color: rt },
2111
- { tag: [g.processingInstruction, g.string, g.inserted], color: Ll },
2112
- { tag: g.invalid, color: xl }
2113
- ]), Rl = [
2114
- Fl,
2115
- bt(Ml)
2116
- ], jl = "#e5c07b", ct = "#3f4a54", Bl = "#56b6c2", Pl = "#fff", oe = "#3f4a54", dt = "#2d8cf0", Ol = "#2d8cf0", Dl = "#3f4a54", ut = "#d19a66", Nl = "#c678dd", _l = "#21252b", mt = "#2c313a", ft = "#fff", ge = "#353a42", Vl = "#bad5fa", gt = "#3f4a54", Ul = Ce.theme(
2084
+ { tag: [g.processingInstruction, g.string, g.inserted], color: El },
2085
+ { tag: g.invalid, color: Sl }
2086
+ ]), Ml = [
2087
+ Hl,
2088
+ pt(Fl)
2089
+ ], Bl = "#e5c07b", ct = "#3f4a54", Rl = "#56b6c2", jl = "#fff", ce = "#3f4a54", dt = "#2d8cf0", Pl = "#2d8cf0", Dl = "#3f4a54", ut = "#d19a66", Ol = "#c678dd", _l = "#21252b", mt = "#ceedfa33", ft = "#fff", ye = "#353a42", Nl = "#bad5fa", gt = "#3f4a54", Vl = Ee.theme(
2117
2090
  {
2118
2091
  "&": {
2119
- color: oe,
2092
+ color: ce,
2120
2093
  backgroundColor: ft
2121
2094
  },
2122
2095
  ".cm-content": {
2123
2096
  caretColor: gt
2124
2097
  },
2125
2098
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: gt },
2126
- "&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Vl },
2127
- ".cm-panels": { backgroundColor: _l, color: oe },
2099
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Nl },
2100
+ ".cm-panels": { backgroundColor: _l, color: ce },
2128
2101
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
2129
2102
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
2130
2103
  ".cm-searchMatch": {
@@ -2141,7 +2114,7 @@ $$
2141
2114
  },
2142
2115
  ".cm-gutters": {
2143
2116
  backgroundColor: ft,
2144
- color: oe,
2117
+ color: ce,
2145
2118
  borderRight: "1px solid",
2146
2119
  borderColor: "var(--md-border-color)"
2147
2120
  },
@@ -2155,30 +2128,30 @@ $$
2155
2128
  },
2156
2129
  ".cm-tooltip": {
2157
2130
  border: "none",
2158
- backgroundColor: ge
2131
+ backgroundColor: ye
2159
2132
  },
2160
2133
  ".cm-tooltip .cm-tooltip-arrow:before": {
2161
2134
  borderTopColor: "transparent",
2162
2135
  borderBottomColor: "transparent"
2163
2136
  },
2164
2137
  ".cm-tooltip .cm-tooltip-arrow:after": {
2165
- borderTopColor: ge,
2166
- borderBottomColor: ge
2138
+ borderTopColor: ye,
2139
+ borderBottomColor: ye
2167
2140
  },
2168
2141
  ".cm-tooltip-autocomplete": {
2169
2142
  "& > ul > li[aria-selected]": {
2170
2143
  backgroundColor: mt,
2171
- color: oe
2144
+ color: ce
2172
2145
  }
2173
2146
  }
2174
2147
  },
2175
2148
  { dark: !0 }
2176
- ), ql = pt.define([
2177
- { tag: g.keyword, color: Nl },
2149
+ ), Ul = vt.define([
2150
+ { tag: g.keyword, color: Ol },
2178
2151
  { tag: [g.name, g.deleted, g.character, g.propertyName, g.macroName], color: ct },
2179
- { tag: [g.function(g.variableName), g.labelName], color: Ol },
2152
+ { tag: [g.function(g.variableName), g.labelName], color: Pl },
2180
2153
  { tag: [g.color, g.constant(g.name), g.standard(g.name)], color: ut },
2181
- { tag: [g.definition(g.name), g.separator], color: oe },
2154
+ { tag: [g.definition(g.name), g.separator], color: ce },
2182
2155
  {
2183
2156
  tag: [
2184
2157
  g.typeName,
@@ -2190,7 +2163,7 @@ $$
2190
2163
  g.self,
2191
2164
  g.namespace
2192
2165
  ],
2193
- color: jl
2166
+ color: Bl
2194
2167
  },
2195
2168
  {
2196
2169
  tag: [
@@ -2202,7 +2175,7 @@ $$
2202
2175
  g.link,
2203
2176
  g.special(g.string)
2204
2177
  ],
2205
- color: Bl
2178
+ color: Rl
2206
2179
  },
2207
2180
  { tag: [g.meta, g.comment], color: dt },
2208
2181
  { tag: g.strong, fontWeight: "bold" },
@@ -2212,30 +2185,30 @@ $$
2212
2185
  { tag: g.heading, fontWeight: "bold", color: ct },
2213
2186
  { tag: [g.atom, g.bool, g.special(g.variableName)], color: ut },
2214
2187
  { tag: [g.processingInstruction, g.string, g.inserted], color: Dl },
2215
- { tag: g.invalid, color: Pl }
2216
- ]), Wl = [
2217
- Ul,
2218
- bt(ql)
2219
- ], J = (e) => {
2220
- const t = new Ht();
2221
- return (l) => (t.get(e.state) ? e.dispatch({ effects: t.reconfigure(l) }) : e.dispatch({
2222
- effects: It.appendConfig.of(t.of(l))
2188
+ { tag: g.invalid, color: jl }
2189
+ ]), ql = [
2190
+ Vl,
2191
+ pt(Ul)
2192
+ ], le = (e) => {
2193
+ const l = new Lt();
2194
+ return (t) => (l.get(e.state) ? e.dispatch({ effects: l.reconfigure(t) }) : e.dispatch({
2195
+ effects: At.appendConfig.of(l.of(t))
2223
2196
  }), !0);
2224
2197
  };
2225
- class Gl {
2226
- constructor(t) {
2227
- U(this, "view");
2198
+ class Wl {
2199
+ constructor(l) {
2200
+ K(this, "view");
2228
2201
  // 切换tabSize的执行方法。切换时,Compartment实例需要相同
2229
- U(this, "toggleTabSize");
2230
- U(this, "togglePlaceholder");
2202
+ K(this, "toggleTabSize");
2203
+ K(this, "togglePlaceholder");
2231
2204
  /**
2232
2205
  * 设置全部的扩展
2233
2206
  */
2234
- U(this, "setExtensions");
2235
- U(this, "toggleDisabled");
2236
- U(this, "toggleReadOnly");
2237
- U(this, "toggleMaxlength");
2238
- this.view = t, 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);
2207
+ K(this, "setExtensions");
2208
+ K(this, "toggleDisabled");
2209
+ K(this, "toggleReadOnly");
2210
+ K(this, "toggleMaxlength");
2211
+ this.view = l, this.toggleTabSize = le(this.view), this.togglePlaceholder = le(this.view), this.setExtensions = le(this.view), this.toggleDisabled = le(this.view), this.toggleReadOnly = le(this.view), this.toggleMaxlength = le(this.view);
2239
2212
  }
2240
2213
  getValue() {
2241
2214
  return this.view.state.doc.toString();
@@ -2247,12 +2220,12 @@ class Gl {
2247
2220
  * @param from 插入开始位置
2248
2221
  * @param to 插入结束位置
2249
2222
  */
2250
- setValue(t, o = 0, l = this.view.state.doc.length) {
2223
+ setValue(l, o = 0, t = this.view.state.doc.length) {
2251
2224
  this.view.dispatch({
2252
2225
  changes: {
2253
2226
  from: o,
2254
- to: l,
2255
- insert: t
2227
+ to: t,
2228
+ insert: l
2256
2229
  }
2257
2230
  });
2258
2231
  }
@@ -2260,8 +2233,8 @@ class Gl {
2260
2233
  * 获取选中的文本
2261
2234
  */
2262
2235
  getSelectedText() {
2263
- const { from: t, to: o } = this.view.state.selection.main;
2264
- return this.view.state.sliceDoc(t, o);
2236
+ const { from: l, to: o } = this.view.state.selection.main;
2237
+ return this.view.state.sliceDoc(l, o);
2265
2238
  }
2266
2239
  /**
2267
2240
  * 使用新的内容替换选中的内容
@@ -2269,7 +2242,7 @@ class Gl {
2269
2242
  * @param text 待替换内容
2270
2243
  * @param options 替换后是否选中
2271
2244
  */
2272
- replaceSelectedText(t, o = {
2245
+ replaceSelectedText(l, o = {
2273
2246
  // 是否选中
2274
2247
  select: !0,
2275
2248
  // 选中时,开始位置的偏移量
@@ -2280,17 +2253,17 @@ class Gl {
2280
2253
  replaceAll: !1
2281
2254
  }) {
2282
2255
  if (o.replaceAll) {
2283
- this.setValue(t);
2256
+ this.setValue(l);
2284
2257
  return;
2285
2258
  }
2286
- const { from: l } = this.view.state.selection.main;
2287
- if (this.view.dispatch(this.view.state.replaceSelection(t)), o.select) {
2288
- const r = l + t.length + o.deviationEnd;
2259
+ const { from: t } = this.view.state.selection.main;
2260
+ if (this.view.dispatch(this.view.state.replaceSelection(l)), o.select) {
2261
+ const r = t + l.length + o.deviationEnd;
2289
2262
  this.view.dispatch({
2290
- selection: me.create(
2263
+ selection: be.create(
2291
2264
  [
2292
- me.range(l + o.deviationStart, r),
2293
- me.cursor(r)
2265
+ be.range(t + o.deviationStart, r),
2266
+ be.cursor(r)
2294
2267
  ],
2295
2268
  1
2296
2269
  )
@@ -2302,10 +2275,10 @@ class Gl {
2302
2275
  *
2303
2276
  * @param tabSize 需要切换的大小
2304
2277
  */
2305
- setTabSize(t) {
2278
+ setTabSize(l) {
2306
2279
  this.toggleTabSize([
2307
- ae.tabSize.of(t),
2308
- Dt.of(" ".repeat(t))
2280
+ ge.tabSize.of(l),
2281
+ Dt.of(" ".repeat(l))
2309
2282
  ]);
2310
2283
  }
2311
2284
  /**
@@ -2313,364 +2286,368 @@ class Gl {
2313
2286
  *
2314
2287
  * @param t 目标内容
2315
2288
  */
2316
- setPlaceholder(t) {
2317
- this.togglePlaceholder(At(t));
2289
+ setPlaceholder(l) {
2290
+ this.togglePlaceholder(It(l));
2318
2291
  }
2319
2292
  focus() {
2320
2293
  this.view.focus();
2321
2294
  }
2322
- setDisabled(t) {
2323
- this.toggleDisabled([Ce.editable.of(!t)]);
2295
+ setDisabled(l) {
2296
+ this.toggleDisabled([Ee.editable.of(!l)]);
2324
2297
  }
2325
- setReadOnly(t) {
2326
- this.toggleReadOnly([ae.readOnly.of(t)]);
2298
+ setReadOnly(l) {
2299
+ this.toggleReadOnly([ge.readOnly.of(l)]);
2327
2300
  }
2328
- setMaxLength(t) {
2301
+ setMaxLength(l) {
2329
2302
  this.toggleMaxlength([
2330
- ae.changeFilter.of((o) => o.newDoc.length <= t)
2303
+ ge.changeFilter.of((o) => o.newDoc.length <= l)
2331
2304
  ]);
2332
2305
  }
2333
2306
  }
2334
- const zl = (e) => {
2335
- const t = x("editorId");
2336
- return (l) => {
2337
- if (l.clipboardData) {
2338
- if (l.clipboardData.files.length > 0) {
2339
- const { files: r } = l.clipboardData;
2340
- C.emit(
2341
- t,
2307
+ const Gl = (e) => {
2308
+ const l = x("editorId");
2309
+ return (t) => {
2310
+ if (t.clipboardData) {
2311
+ if (t.clipboardData.files.length > 0) {
2312
+ const { files: r } = t.clipboardData;
2313
+ k.emit(
2314
+ l,
2342
2315
  "uploadImage",
2343
2316
  Array.from(r).filter((n) => /image\/.*/.test(n.type))
2344
- ), l.preventDefault();
2317
+ ), t.preventDefault();
2345
2318
  }
2346
- if (e.autoDetectCode && l.clipboardData.types.includes("vscode-editor-data")) {
2347
- const r = JSON.parse(l.clipboardData.getData("vscode-editor-data"));
2348
- C.emit(t, "replace", "code", {
2319
+ if (e.autoDetectCode && t.clipboardData.types.includes("vscode-editor-data")) {
2320
+ const r = JSON.parse(t.clipboardData.getData("vscode-editor-data"));
2321
+ k.emit(l, "replace", "code", {
2349
2322
  mode: r.mode,
2350
- text: l.clipboardData.getData("text/plain")
2351
- }), l.preventDefault();
2323
+ text: t.clipboardData.getData("text/plain")
2324
+ }), t.preventDefault();
2352
2325
  }
2353
2326
  }
2354
2327
  };
2355
2328
  }, Kl = (e) => {
2356
- const t = x("editorId");
2357
- A(() => {
2358
- C.on(t, {
2359
- name: $t,
2329
+ const l = x("editorId");
2330
+ H(() => {
2331
+ k.on(l, {
2332
+ name: Ct,
2360
2333
  callback() {
2361
2334
  var o;
2362
2335
  (o = e.value) == null || o.focus();
2363
2336
  }
2364
2337
  });
2365
2338
  });
2366
- }, Xl = (e, t) => [
2339
+ }, zl = (e, l) => [
2367
2340
  {
2368
2341
  key: "Ctrl-b",
2369
2342
  mac: "Cmd-b",
2370
- run: () => (C.emit(e, "replace", "bold"), !0)
2343
+ run: () => (k.emit(e, "replace", "bold"), !0)
2371
2344
  },
2372
2345
  {
2373
2346
  key: "Ctrl-d",
2374
2347
  mac: "Cmd-d",
2375
- run: jt,
2348
+ run: Bt,
2376
2349
  preventDefault: !0
2377
2350
  },
2378
2351
  {
2379
2352
  key: "Ctrl-s",
2380
2353
  mac: "Cmd-s",
2381
- run: (L) => (C.emit(e, ue, L.state.doc.toString()), !0),
2382
- shift: () => (C.emit(e, "replace", "strikeThrough"), !0)
2354
+ run: (I) => (k.emit(e, pe, I.state.doc.toString()), !0),
2355
+ shift: () => (k.emit(e, "replace", "strikeThrough"), !0)
2383
2356
  },
2384
2357
  {
2385
2358
  key: "Ctrl-u",
2386
2359
  mac: "Cmd-u",
2387
- run: () => (C.emit(e, "replace", "underline"), !0),
2388
- shift: () => (C.emit(e, "replace", "unorderedList"), !0)
2360
+ run: () => (k.emit(e, "replace", "underline"), !0),
2361
+ shift: () => (k.emit(e, "replace", "unorderedList"), !0)
2389
2362
  },
2390
2363
  {
2391
2364
  key: "Ctrl-i",
2392
2365
  mac: "Cmd-i",
2393
- run: () => (C.emit(e, "replace", "italic"), !0),
2394
- shift: () => (C.emit(e, "openModals", "image"), !0)
2366
+ run: () => (k.emit(e, "replace", "italic"), !0),
2367
+ shift: () => (k.emit(e, "openModals", "image"), !0)
2395
2368
  },
2396
2369
  {
2397
2370
  key: "Ctrl-1",
2398
2371
  mac: "Cmd-1",
2399
- run: () => (C.emit(e, "replace", "h1"), !0)
2372
+ run: () => (k.emit(e, "replace", "h1"), !0)
2400
2373
  },
2401
2374
  {
2402
2375
  key: "Ctrl-2",
2403
2376
  mac: "Cmd-2",
2404
- run: () => (C.emit(e, "replace", "h2"), !0)
2377
+ run: () => (k.emit(e, "replace", "h2"), !0)
2405
2378
  },
2406
2379
  {
2407
2380
  key: "Ctrl-3",
2408
2381
  mac: "Cmd-3",
2409
- run: () => (C.emit(e, "replace", "h3"), !0)
2382
+ run: () => (k.emit(e, "replace", "h3"), !0)
2410
2383
  },
2411
2384
  {
2412
2385
  key: "Ctrl-4",
2413
2386
  mac: "Cmd-4",
2414
- run: () => (C.emit(e, "replace", "h4"), !0)
2387
+ run: () => (k.emit(e, "replace", "h4"), !0)
2415
2388
  },
2416
2389
  {
2417
2390
  key: "Ctrl-5",
2418
2391
  mac: "Cmd-5",
2419
- run: () => (C.emit(e, "replace", "h5"), !0)
2392
+ run: () => (k.emit(e, "replace", "h5"), !0)
2420
2393
  },
2421
2394
  {
2422
2395
  key: "Ctrl-6",
2423
2396
  mac: "Cmd-6",
2424
- run: () => (C.emit(e, "replace", "h6"), !0)
2397
+ run: () => (k.emit(e, "replace", "h6"), !0)
2425
2398
  },
2426
2399
  {
2427
2400
  key: "Ctrl-ArrowUp",
2428
2401
  mac: "Cmd-ArrowUp",
2429
- run: () => (C.emit(e, "replace", "sup"), !0)
2402
+ run: () => (k.emit(e, "replace", "sup"), !0)
2430
2403
  },
2431
2404
  {
2432
2405
  key: "Ctrl-ArrowDown",
2433
2406
  mac: "Cmd-ArrowDown",
2434
- run: () => (C.emit(e, "replace", "sub"), !0)
2407
+ run: () => (k.emit(e, "replace", "sub"), !0)
2435
2408
  },
2436
2409
  {
2437
2410
  key: "Ctrl-o",
2438
2411
  mac: "Cmd-o",
2439
- run: () => (C.emit(e, "replace", "orderedList"), !0)
2412
+ run: () => (k.emit(e, "replace", "orderedList"), !0)
2440
2413
  },
2441
2414
  {
2442
2415
  key: "Ctrl-c",
2443
2416
  mac: "Cmd-c",
2444
- shift: () => (C.emit(e, "replace", "code"), !0),
2445
- any(L, S) {
2446
- return (S.ctrlKey || S.metaKey) && S.altKey && S.code === "KeyC" ? (C.emit(e, "replace", "codeRow"), !0) : !1;
2417
+ shift: () => (k.emit(e, "replace", "code"), !0),
2418
+ any(I, w) {
2419
+ return (w.ctrlKey || w.metaKey) && w.altKey && w.code === "KeyC" ? (k.emit(e, "replace", "codeRow"), !0) : !1;
2447
2420
  }
2448
2421
  },
2449
2422
  {
2450
2423
  key: "Ctrl-l",
2451
2424
  mac: "Cmd-l",
2452
- run: () => (C.emit(e, "openModals", "link"), !0)
2425
+ run: () => (k.emit(e, "openModals", "link"), !0)
2453
2426
  },
2454
2427
  {
2455
2428
  key: "Ctrl-f",
2456
2429
  mac: "Cmd-f",
2457
- shift: () => t.noPrettier ? !1 : (C.emit(e, "replace", "prettier"), !0)
2430
+ shift: () => l.noPrettier ? !1 : (k.emit(e, "replace", "prettier"), !0)
2458
2431
  },
2459
2432
  {
2460
- any: (L, S) => (S.ctrlKey || S.metaKey) && S.altKey && S.shiftKey && S.code === "KeyT" ? (C.emit(e, "replace", "table"), !0) : !1
2433
+ any: (I, w) => (w.ctrlKey || w.metaKey) && w.altKey && w.shiftKey && w.code === "KeyT" ? (k.emit(e, "replace", "table"), !0) : !1
2461
2434
  }
2462
- ], Zl = (e) => {
2463
- const t = x("tabWidth"), o = x("editorId"), l = x("theme"), r = F(), n = F(), a = Xl(o, e), c = zl(e), m = [
2464
- Ft.of([...a, Bt]),
2465
- Lt,
2466
- Rt({ codeLanguages: Mt }),
2435
+ ], Xl = (e) => {
2436
+ const l = x("tabWidth"), o = x("editorId"), t = x("theme"), r = B(), n = de(), a = zl(o, e), d = Gl(e), m = [
2437
+ Ht.of([...a, Rt]),
2438
+ Et,
2439
+ Mt({ codeLanguages: Ft }),
2467
2440
  // 横向换行
2468
- re.lineWrapping,
2469
- re.updateListener.of((d) => {
2470
- e.onChange(d.state.doc.toString());
2441
+ fe.lineWrapping,
2442
+ fe.updateListener.of((c) => {
2443
+ c.docChanged && e.onChange(c.state.doc.toString());
2471
2444
  }),
2472
- re.domEventHandlers({
2473
- paste: c,
2445
+ fe.domEventHandlers({
2446
+ paste: d,
2474
2447
  blur: e.onBlur,
2475
2448
  focus: e.onFocus
2476
2449
  })
2477
- ], u = () => l.value === "light" ? I.codeMirrorExtensions(
2478
- l.value,
2479
- [...m, Wl],
2450
+ ], u = () => t.value === "light" ? A.codeMirrorExtensions(
2451
+ t.value,
2452
+ [...m, ql],
2480
2453
  a
2481
- ) : I.codeMirrorExtensions(
2482
- l.value,
2483
- [...m, Rl],
2454
+ ) : A.codeMirrorExtensions(
2455
+ t.value,
2456
+ [...m, Ml],
2484
2457
  a
2485
2458
  );
2486
- return A(() => {
2487
- const d = ae.create({
2459
+ return H(() => {
2460
+ const c = ge.create({
2488
2461
  doc: e.value
2489
- }), f = new re({
2490
- state: d,
2462
+ }), f = new fe({
2463
+ state: c,
2491
2464
  parent: r.value
2492
2465
  });
2493
- n.value = new Gl(f), n.value.setTabSize(t), n.value.setExtensions(u()), n.value.setPlaceholder(e.placeholder), n.value.setDisabled(e.disabled), n.value.setReadOnly(e.readonly), e.autofocus && f.focus(), e.maxlength && n.value.setMaxLength(e.maxlength), C.on(o, {
2466
+ n.value = new Wl(f), n.value.setTabSize(l), n.value.setExtensions(u()), n.value.setPlaceholder(e.placeholder), n.value.setDisabled(e.disabled), n.value.setReadOnly(e.readonly), e.autofocus && f.focus(), e.maxlength && n.value.setMaxLength(e.maxlength), k.on(o, {
2494
2467
  name: "ctrlZ",
2495
2468
  callback() {
2496
- Pt(f);
2469
+ jt(f);
2497
2470
  }
2498
- }), C.on(o, {
2471
+ }), k.on(o, {
2499
2472
  name: "ctrlShiftZ",
2500
2473
  callback() {
2501
- Ot(f);
2474
+ Pt(f);
2502
2475
  }
2503
- }), C.on(o, {
2476
+ }), k.on(o, {
2504
2477
  name: "replace",
2505
- callback(h, v = {}) {
2506
- var p;
2507
- const { text: b, options: k } = wl(h, n.value, v);
2508
- (p = n.value) == null || p.replaceSelectedText(b, k);
2478
+ callback(h, p = {}) {
2479
+ var y;
2480
+ const { text: v, options: b } = $l(h, n.value, p);
2481
+ (y = n.value) == null || y.replaceSelectedText(v, b);
2509
2482
  }
2510
2483
  });
2511
- }), T(
2512
- () => l.value,
2484
+ }), S(
2485
+ () => t.value,
2513
2486
  () => {
2514
- var d, f;
2515
- l.value === "dark" ? (d = n.value) == null || d.setExtensions(u()) : (f = n.value) == null || f.setExtensions(u());
2487
+ var c, f;
2488
+ t.value === "dark" ? (c = n.value) == null || c.setExtensions(u()) : (f = n.value) == null || f.setExtensions(u());
2516
2489
  }
2517
- ), T(
2490
+ ), S(
2518
2491
  () => e.value,
2519
2492
  () => {
2520
- var d, f;
2521
- ((d = n.value) == null ? void 0 : d.getValue()) !== e.value && ((f = n.value) == null || f.setValue(e.value));
2493
+ var c, f;
2494
+ ((c = n.value) == null ? void 0 : c.getValue()) !== e.value && ((f = n.value) == null || f.setValue(e.value));
2522
2495
  }
2523
- ), T(
2496
+ ), S(
2524
2497
  () => e.value,
2525
2498
  () => {
2526
- var d;
2527
- (d = n.value) == null || d.setPlaceholder(e.placeholder);
2499
+ var c;
2500
+ (c = n.value) == null || c.setPlaceholder(e.placeholder);
2528
2501
  }
2529
- ), T(
2502
+ ), S(
2530
2503
  () => e.disabled,
2531
2504
  () => {
2532
- var d;
2533
- (d = n.value) == null || d.setDisabled(e.disabled);
2505
+ var c;
2506
+ (c = n.value) == null || c.setDisabled(e.disabled);
2534
2507
  }
2535
- ), T(
2508
+ ), S(
2536
2509
  () => e.readonly,
2537
2510
  () => {
2538
- var d;
2539
- (d = n.value) == null || d.setDisabled(e.readonly);
2511
+ var c;
2512
+ (c = n.value) == null || c.setDisabled(e.readonly);
2540
2513
  }
2541
- ), T(
2514
+ ), S(
2542
2515
  () => e.maxlength,
2543
2516
  () => {
2544
- var d;
2545
- e.maxlength && ((d = n.value) == null || d.setMaxLength(e.maxlength));
2517
+ var c;
2518
+ e.maxlength && ((c = n.value) == null || c.setMaxLength(e.maxlength));
2546
2519
  }
2547
2520
  ), Kl(n), {
2548
2521
  inputWrapperRef: r,
2549
2522
  codeMirrorUt: n
2550
2523
  };
2551
- }, Jl = (e, t) => {
2552
- const o = x("editorId"), l = de(() => {
2524
+ }, Zl = (e, l) => {
2525
+ const o = x("editorId"), t = ve(() => {
2553
2526
  const r = document.querySelectorAll(`#${o}-preview img`);
2554
- r.length !== 0 && Nt(r, {
2527
+ r.length !== 0 && Ot(r, {
2555
2528
  background: "#00000073"
2556
2529
  });
2557
2530
  });
2558
- A(l), T([t, Q(e.setting, "preview")], l);
2559
- }, Yl = (e, t) => {
2560
- const o = x("editorId"), l = x("usedLanguageText"), r = () => {
2561
- document.querySelectorAll(`#${o}-preview pre`).forEach((c) => {
2531
+ H(t), S([l, ne(e.setting, "preview")], t);
2532
+ }, Jl = (e, l) => {
2533
+ const o = x("editorId"), t = x("usedLanguageText"), r = () => {
2534
+ document.querySelectorAll(`#${o}-preview pre`).forEach((d) => {
2562
2535
  var f, h;
2563
2536
  let m = -1;
2564
- (f = c.querySelector(".copy-button")) == null || f.remove();
2565
- const u = ((h = l.value.copyCode) == null ? void 0 : h.text) || "复制代码", d = document.createElement("span");
2566
- d.setAttribute("class", "copy-button"), d.dataset.tips = u, d.innerHTML = `<svg class="${s}-icon" aria-hidden="true"><use xlink:href="#${s}-icon-copy"></use></svg>`, d.addEventListener("click", () => {
2567
- var y, $;
2537
+ (f = d.querySelector(".copy-button")) == null || f.remove();
2538
+ const u = ((h = t.value.copyCode) == null ? void 0 : h.text) || "复制代码", c = document.createElement("span");
2539
+ c.setAttribute("class", "copy-button"), c.dataset.tips = u, c.innerHTML = `<svg class="${s}-icon" aria-hidden="true"><use xlink:href="#${s}-icon-copy"></use></svg>`, c.addEventListener("click", () => {
2540
+ var C, $;
2568
2541
  clearTimeout(m);
2569
- const v = c.querySelector("code").innerText, b = _t(e.formatCopiedText(v)), k = ((y = l.value.copyCode) == null ? void 0 : y.successTips) || "已复制!", p = (($ = l.value.copyCode) == null ? void 0 : $.failTips) || "已复制!";
2570
- d.dataset.tips = b ? k : p, m = window.setTimeout(() => {
2571
- d.dataset.tips = u;
2542
+ const p = d.querySelector("code").innerText, v = _t(e.formatCopiedText(p)), b = ((C = t.value.copyCode) == null ? void 0 : C.successTips) || "已复制!", y = (($ = t.value.copyCode) == null ? void 0 : $.failTips) || "已复制!";
2543
+ c.dataset.tips = v ? b : y, m = window.setTimeout(() => {
2544
+ c.dataset.tips = u;
2572
2545
  }, 1500);
2573
- }), c.appendChild(d);
2546
+ }), d.appendChild(c);
2574
2547
  });
2575
2548
  }, n = () => {
2576
- z(r);
2577
- }, a = (c) => {
2578
- c && z(r);
2549
+ Y(r);
2550
+ }, a = (d) => {
2551
+ d && Y(r);
2579
2552
  };
2580
- T(() => t.value, n), T(() => e.setting.preview, a), T(() => e.setting.htmlPreview, a), T(() => l.value, r), A(r);
2581
- }, Ql = (e) => {
2553
+ S(() => l.value, n), S(() => e.setting.preview, a), S(() => e.setting.htmlPreview, a), S(() => t.value, r), H(r);
2554
+ }, Yl = (e) => {
2582
2555
  var n;
2583
- const t = (n = I.editorExtensions) == null ? void 0 : n.highlight, o = t == null ? void 0 : t.instance, l = x("highlight"), r = se(o);
2584
- return A(() => {
2556
+ const l = (n = A.editorExtensions) == null ? void 0 : n.highlight, o = l == null ? void 0 : l.instance, t = x("highlight"), r = de(o);
2557
+ return H(() => {
2585
2558
  if (e.noHighlight)
2586
2559
  return;
2587
2560
  if (!r.value) {
2588
- const c = document.createElement("script");
2589
- c.src = l.value.js, c.onload = () => {
2561
+ const d = document.createElement("script");
2562
+ d.src = t.value.js, d.onload = () => {
2590
2563
  r.value = window.hljs;
2591
- }, c.id = `${s}-hljs`, O(c, "hljs");
2564
+ }, d.id = `${s}-hljs`, V(d, "hljs");
2592
2565
  }
2593
2566
  const a = document.createElement("link");
2594
- a.rel = "stylesheet", a.href = l.value.css, a.id = `${s}-hlCss`, O(a);
2595
- }), T(
2596
- () => l.value.css,
2567
+ a.rel = "stylesheet", a.href = t.value.css, a.id = `${s}-hlCss`, V(a);
2568
+ }), S(
2569
+ () => t.value.css,
2597
2570
  (a) => {
2598
- sl(`${s}-hlCss`, "href", a);
2571
+ al(`${s}-hlCss`, "href", a);
2599
2572
  }
2600
2573
  ), r;
2601
- }, eo = (e) => {
2602
- const t = x("theme"), { editorExtensions: o } = I, l = o == null ? void 0 : o.mermaid, r = se(l == null ? void 0 : l.instance), n = se(!1), a = new Wt({
2574
+ }, Ql = (e) => {
2575
+ const l = x("theme"), { editorExtensions: o } = A, t = o == null ? void 0 : o.mermaid, r = de(t == null ? void 0 : t.instance), n = de(!1), a = new qt({
2603
2576
  max: 1e3,
2604
2577
  // 缓存10分钟
2605
2578
  ttl: 6e5
2606
- }), c = () => {
2607
- const u = (l == null ? void 0 : l.instance) || window.mermaid;
2579
+ }), d = () => {
2580
+ const u = (t == null ? void 0 : t.instance) || window.mermaid;
2608
2581
  !e.noMermaid && u && (u.initialize({
2609
2582
  startOnLoad: !1,
2610
- theme: t.value === "dark" ? "dark" : "default"
2583
+ theme: l.value === "dark" ? "dark" : "default"
2611
2584
  }), n.value = !n.value);
2612
2585
  };
2613
- return T(
2614
- () => t.value,
2586
+ return S(
2587
+ () => l.value,
2615
2588
  () => {
2616
- a.clear(), c();
2589
+ a.clear(), d();
2617
2590
  }
2618
- ), A(() => {
2619
- if (!e.noMermaid && !(l != null && l.instance)) {
2591
+ ), H(() => {
2592
+ if (!e.noMermaid && !(t != null && t.instance)) {
2620
2593
  const u = document.createElement("script");
2621
2594
  u.id = `${s}-mermaid`;
2622
- const d = (l == null ? void 0 : l.js) || Zt;
2623
- /\.mjs/.test(d) ? (u.setAttribute("type", "module"), u.innerHTML = `import mermaid from "${d}";window.mermaid=mermaid;document.getElementById('${s}-mermaid').dispatchEvent(new Event('load'));`) : u.src = d, u.onload = () => {
2624
- r.value = window.mermaid, c();
2625
- }, O(u, "mermaid");
2595
+ const c = (t == null ? void 0 : t.js) || Xt;
2596
+ /\.mjs/.test(c) ? (u.setAttribute("type", "module"), u.innerHTML = `import mermaid from "${c}";window.mermaid=mermaid;document.getElementById('${s}-mermaid').dispatchEvent(new Event('load'));`) : u.src = c, u.onload = () => {
2597
+ r.value = window.mermaid, d();
2598
+ }, V(u, "mermaid");
2626
2599
  }
2627
2600
  }), { mermaidRef: r, reRenderRef: n, replaceMermaid: () => {
2628
- z(() => {
2601
+ Y(() => {
2629
2602
  !e.noMermaid && r.value && document.querySelectorAll(
2630
2603
  `div.${s}-mermaid`
2631
- ).forEach(async (d) => {
2632
- let f = a.get(d.innerText);
2604
+ ).forEach(async (c) => {
2605
+ let f = a.get(c.innerText);
2633
2606
  if (!f) {
2634
- const v = il(), k = await (r.value.renderAsync || r.value.render)(v, d.innerText);
2635
- f = typeof k == "string" ? k : k.svg, a.set(d.innerText, f);
2607
+ const p = rl(), b = await (r.value.renderAsync || r.value.render)(p, c.innerText);
2608
+ f = typeof b == "string" ? b : b.svg, a.set(c.innerText, f);
2636
2609
  }
2637
2610
  const h = document.createElement("p");
2638
- h.className = `${s}-mermaid`, h.setAttribute("data-processed", ""), h.innerHTML = f, d.replaceWith(h);
2611
+ h.className = `${s}-mermaid`, h.setAttribute("data-processed", ""), h.innerHTML = f, c.dataset.line !== void 0 && (h.dataset.line = c.dataset.line), c.replaceWith(h);
2639
2612
  });
2640
2613
  });
2641
2614
  } };
2642
- }, to = (e) => {
2615
+ }, eo = (e) => {
2643
2616
  var r;
2644
- const t = (r = I.editorExtensions) == null ? void 0 : r.katex, o = t == null ? void 0 : t.instance, l = se(o);
2645
- return A(() => {
2646
- if (!e.noKatex && !l.value) {
2617
+ const l = (r = A.editorExtensions) == null ? void 0 : r.katex, o = l == null ? void 0 : l.instance, t = de(o);
2618
+ return H(() => {
2619
+ if (!e.noKatex && !t.value) {
2647
2620
  const n = document.createElement("script");
2648
- n.src = (t == null ? void 0 : t.js) || Ze.js, n.onload = () => {
2649
- l.value = window.katex;
2621
+ n.src = (l == null ? void 0 : l.js) || Xe.js, n.onload = () => {
2622
+ t.value = window.katex;
2650
2623
  }, n.id = `${s}-katex`;
2651
2624
  const a = document.createElement("link");
2652
- a.rel = "stylesheet", a.href = (t == null ? void 0 : t.css) || Ze.css, a.id = `${s}-katexCss`, O(n, "katex"), O(a);
2625
+ a.rel = "stylesheet", a.href = (l == null ? void 0 : l.css) || Xe.css, a.id = `${s}-katexCss`, V(n, "katex"), V(a);
2653
2626
  }
2654
- }), l;
2655
- }, lo = (e, t) => {
2627
+ }), t;
2628
+ }, to = (e, l) => {
2656
2629
  const o = e.renderer.rules.fence.bind(e.renderer.rules);
2657
- e.renderer.rules.fence = (l, r, n, a, c) => {
2658
- const m = l[r], u = m.content.trim();
2659
- return m.info === "mermaid" ? `<div class="${s}-mermaid" data-mermaid-theme=${t.themeRef.value}>${u}</div>` : o(l, r, n, a, c);
2630
+ e.renderer.rules.fence = (t, r, n, a, d) => {
2631
+ const m = t[r], u = m.content.trim();
2632
+ if (m.info === "mermaid") {
2633
+ let c;
2634
+ return t[r].map && t[r].level === 0 && (c = t[r].map[0], t[r].attrSet("data-line", String(c))), `<div class="${s}-mermaid" ${c !== void 0 ? "data-line=" + c : ""} data-mermaid-theme=${l.themeRef.value}>${u}</div>`;
2635
+ }
2636
+ return o(t, r, n, a, d);
2660
2637
  };
2661
- }, ht = (e, t) => {
2662
- let o = !0, l = !0;
2663
- const r = e.posMax, n = t > 0 ? e.src.charCodeAt(t - 1) : -1, a = t + 1 <= r ? e.src.charCodeAt(t + 1) : -1;
2664
- return (n === 32 || n === 9 || a >= 48 && a <= 57) && (l = !1), (a === 32 || a === 9) && (o = !1), {
2638
+ }, ht = (e, l) => {
2639
+ let o = !0, t = !0;
2640
+ const r = e.posMax, n = l > 0 ? e.src.charCodeAt(l - 1) : -1, a = l + 1 <= r ? e.src.charCodeAt(l + 1) : -1;
2641
+ return (n === 32 || n === 9 || a >= 48 && a <= 57) && (t = !1), (a === 32 || a === 9) && (o = !1), {
2665
2642
  can_open: o,
2666
- can_close: l
2643
+ can_close: t
2667
2644
  };
2668
- }, oo = (e, t) => {
2669
- let o, l, r, n;
2645
+ }, lo = (e, l) => {
2646
+ let o, t, r, n;
2670
2647
  if (e.src[e.pos] !== "$")
2671
2648
  return !1;
2672
2649
  if (r = ht(e, e.pos), !r.can_open)
2673
- return t || (e.pending += "$"), e.pos += 1, !0;
2650
+ return l || (e.pending += "$"), e.pos += 1, !0;
2674
2651
  const a = e.pos + 1;
2675
2652
  for (o = a; (o = e.src.indexOf("$", o)) !== -1; ) {
2676
2653
  for (n = o - 1; e.src[n] === "\\"; )
@@ -2679,31 +2656,31 @@ const zl = (e) => {
2679
2656
  break;
2680
2657
  o += 1;
2681
2658
  }
2682
- return o === -1 ? (t || (e.pending += "$"), e.pos = a, !0) : o - a === 0 ? (t || (e.pending += "$$"), e.pos = a + 1, !0) : (r = ht(e, o), r.can_close ? (t || (l = e.push("math_inline", "math", 0), l.markup = "$", l.content = e.src.slice(a, o)), e.pos = o + 1, !0) : (t || (e.pending += "$"), e.pos = a, !0));
2683
- }, no = (e, t, o, l) => {
2684
- let r, n, a, c, m = !1, u = e.bMarks[t] + e.tShift[t], d = e.eMarks[t];
2685
- if (u + 2 > d || e.src.slice(u, u + 2) !== "$$")
2659
+ return o === -1 ? (l || (e.pending += "$"), e.pos = a, !0) : o - a === 0 ? (l || (e.pending += "$$"), e.pos = a + 1, !0) : (r = ht(e, o), r.can_close ? (l || (t = e.push("math_inline", "math", 0), t.markup = "$", t.content = e.src.slice(a, o)), e.pos = o + 1, !0) : (l || (e.pending += "$"), e.pos = a, !0));
2660
+ }, oo = (e, l, o, t) => {
2661
+ let r, n, a, d, m = !1, u = e.bMarks[l] + e.tShift[l], c = e.eMarks[l];
2662
+ if (u + 2 > c || e.src.slice(u, u + 2) !== "$$")
2686
2663
  return !1;
2687
- if (u += 2, r = e.src.slice(u, d), l)
2664
+ if (u += 2, r = e.src.slice(u, c), t)
2688
2665
  return !0;
2689
- for (r.trim().slice(-2) === "$$" && (r = r.trim().slice(0, -2), m = !0), a = t; !m && (a++, !(a >= o || (u = e.bMarks[a] + e.tShift[a], d = e.eMarks[a], u < d && e.tShift[a] < e.blkIndent))); )
2690
- e.src.slice(u, d).trim().slice(-2) === "$$" && (c = e.src.slice(0, d).lastIndexOf("$$"), n = e.src.slice(u, c), m = !0);
2666
+ for (r.trim().slice(-2) === "$$" && (r = r.trim().slice(0, -2), m = !0), a = l; !m && (a++, !(a >= o || (u = e.bMarks[a] + e.tShift[a], c = e.eMarks[a], u < c && e.tShift[a] < e.blkIndent))); )
2667
+ e.src.slice(u, c).trim().slice(-2) === "$$" && (d = e.src.slice(0, c).lastIndexOf("$$"), n = e.src.slice(u, d), m = !0);
2691
2668
  e.line = a + 1;
2692
2669
  const f = e.push("math_block", "math", 0);
2693
2670
  return f.block = !0, f.content = (r && r.trim() ? r + `
2694
- ` : "") + e.getLines(t + 1, a, e.tShift[t], !0) + (n && n.trim() ? n : ""), f.map = [t, e.line], f.markup = "$$", !0;
2695
- }, ro = (e, t) => {
2671
+ ` : "") + e.getLines(l + 1, a, e.tShift[l], !0) + (n && n.trim() ? n : ""), f.map = [l, e.line], f.markup = "$$", !0;
2672
+ }, no = (e, l) => {
2696
2673
  const o = (r) => {
2697
- if (t.katexRef.value) {
2698
- const n = t.katexRef.value.renderToString(r, {
2674
+ if (l.katexRef.value) {
2675
+ const n = l.katexRef.value.renderToString(r, {
2699
2676
  throwOnError: !1
2700
2677
  });
2701
2678
  return `<span class="${s}-katex-inline" data-processed>${n}</span>`;
2702
2679
  } else
2703
2680
  return `<span class="${s}-katex-inline">${r}</span>`;
2704
- }, l = (r, n) => {
2705
- if (t.katexRef.value) {
2706
- const a = t.katexRef.value.renderToString(r, {
2681
+ }, t = (r, n) => {
2682
+ if (l.katexRef.value) {
2683
+ const a = l.katexRef.value.renderToString(r, {
2707
2684
  throwOnError: !1,
2708
2685
  displayMode: !0
2709
2686
  });
@@ -2711,112 +2688,126 @@ const zl = (e) => {
2711
2688
  } else
2712
2689
  return `<p class="${s}-katex-block" data-line=${n}>${r}</p>`;
2713
2690
  };
2714
- e.inline.ruler.after("escape", "math_inline", oo), e.block.ruler.after("blockquote", "math_block", no, {
2691
+ e.inline.ruler.after("escape", "math_inline", lo), e.block.ruler.after("blockquote", "math_block", oo, {
2715
2692
  alt: ["paragraph", "reference", "blockquote", "list"]
2716
- }), e.renderer.rules.math_inline = (r, n) => o(r[n].content), e.renderer.rules.math_block = (r, n) => l(r[n].content, r[n].map[0]) + `
2693
+ }), e.renderer.rules.math_inline = (r, n) => o(r[n].content), e.renderer.rules.math_block = (r, n) => t(r[n].content, r[n].map[0]) + `
2717
2694
  `;
2718
- }, io = (e, t) => {
2719
- t = t || {};
2720
- const o = 3, l = t.marker || "!", r = l.charCodeAt(0), n = l.length;
2721
- let a = "", c = "";
2722
- const m = (d, f, h, v, b) => {
2723
- const k = d[f];
2724
- return k.type === "admonition_open" ? (d[f].attrPush([
2695
+ }, ro = (e, l) => {
2696
+ l = l || {};
2697
+ const o = 3, t = l.marker || "!", r = t.charCodeAt(0), n = t.length;
2698
+ let a = "", d = "";
2699
+ const m = (c, f, h, p, v) => {
2700
+ const b = c[f];
2701
+ return b.type === "admonition_open" ? (c[f].attrPush([
2725
2702
  "class",
2726
- `${s}-admonition ${s}-admonition-${k.info}`
2727
- ]), d[f].attrSet("data-line", String(d[f].map[0]))) : k.type === "admonition_title_open" && d[f].attrPush(["class", `${s}-admonition-title`]), b.renderToken(d, f, h);
2728
- }, u = (d) => {
2729
- const f = d.trim().split(" ", 2);
2730
- c = "", a = f[0], f.length > 1 && (c = d.substring(a.length + 2)), (c === "" || !c) && (c = a);
2703
+ `${s}-admonition ${s}-admonition-${b.info}`
2704
+ ]), c[f].attrSet("data-line", String(c[f].map[0]))) : b.type === "admonition_title_open" && c[f].attrPush(["class", `${s}-admonition-title`]), v.renderToken(c, f, h);
2705
+ }, u = (c) => {
2706
+ const f = c.trim().split(" ", 2);
2707
+ d = "", a = f[0], f.length > 1 && (d = c.substring(a.length + 2)), (d === "" || !d) && (d = a);
2731
2708
  };
2732
2709
  e.block.ruler.before(
2733
2710
  "code",
2734
2711
  "admonition",
2735
- (d, f, h, v) => {
2736
- let b, k, p, y = !1, $ = d.bMarks[f] + d.tShift[f], w = d.eMarks[f];
2737
- if (r !== d.src.charCodeAt($))
2712
+ (c, f, h, p) => {
2713
+ let v, b, y, C = !1, $ = c.bMarks[f] + c.tShift[f], T = c.eMarks[f];
2714
+ if (r !== c.src.charCodeAt($))
2738
2715
  return !1;
2739
- for (b = $ + 1; b <= w && l[(b - $) % n] === d.src[b]; b++)
2716
+ for (v = $ + 1; v <= T && t[(v - $) % n] === c.src[v]; v++)
2740
2717
  ;
2741
- const L = Math.floor((b - $) / n);
2742
- if (L !== o)
2718
+ const I = Math.floor((v - $) / n);
2719
+ if (I !== o)
2743
2720
  return !1;
2744
- b -= (b - $) % n;
2745
- const S = d.src.slice($, b), j = d.src.slice(b, w);
2746
- if (u(j), v)
2721
+ v -= (v - $) % n;
2722
+ const w = c.src.slice($, v), F = c.src.slice(v, T);
2723
+ if (u(F), p)
2747
2724
  return !0;
2748
- for (k = f; k++, !(k >= h || ($ = d.bMarks[k] + d.tShift[k], w = d.eMarks[k], $ < w && d.sCount[k] < d.blkIndent)); )
2749
- if (r === d.src.charCodeAt($) && !(d.sCount[k] - d.blkIndent >= 4)) {
2750
- for (b = $ + 1; b <= w && l[(b - $) % n] === d.src[b]; b++)
2725
+ for (b = f; b++, !(b >= h || ($ = c.bMarks[b] + c.tShift[b], T = c.eMarks[b], $ < T && c.sCount[b] < c.blkIndent)); )
2726
+ if (r === c.src.charCodeAt($) && !(c.sCount[b] - c.blkIndent >= 4)) {
2727
+ for (v = $ + 1; v <= T && t[(v - $) % n] === c.src[v]; v++)
2751
2728
  ;
2752
- if (!(Math.floor((b - $) / n) < L) && (b -= (b - $) % n, b = d.skipSpaces(b), !(b < w))) {
2753
- y = !0;
2729
+ if (!(Math.floor((v - $) / n) < I) && (v -= (v - $) % n, v = c.skipSpaces(v), !(v < T))) {
2730
+ C = !0;
2754
2731
  break;
2755
2732
  }
2756
2733
  }
2757
- const B = d.parentType, q = d.lineMax;
2758
- return d.parentType = "root", d.lineMax = k, p = d.push("admonition_open", "div", 1), p.markup = S, p.block = !0, p.info = a, p.map = [f, k], p = d.push("admonition_title_open", "p", 1), p.markup = S + " " + a, p.map = [f, k], p = d.push("inline", "", 0), p.content = c, p.map = [f, d.line - 1], p.children = [], p = d.push("admonition_title_close", "p", -1), p.markup = S + " " + a, d.md.block.tokenize(d, f + 1, k), p = d.push("admonition_close", "div", -1), p.markup = d.src.slice($, b), p.block = !0, d.parentType = B, d.lineMax = q, d.line = k + (y ? 1 : 0), !0;
2734
+ const j = c.parentType, R = c.lineMax;
2735
+ return c.parentType = "root", c.lineMax = b, y = c.push("admonition_open", "div", 1), y.markup = w, y.block = !0, y.info = a, y.map = [f, b], y = c.push("admonition_title_open", "p", 1), y.markup = w + " " + a, y.map = [f, b], y = c.push("inline", "", 0), y.content = d, y.map = [f, c.line - 1], y.children = [], y = c.push("admonition_title_close", "p", -1), y.markup = w + " " + a, c.md.block.tokenize(c, f + 1, b), y = c.push("admonition_close", "div", -1), y.markup = c.src.slice($, v), y.block = !0, c.parentType = j, c.lineMax = R, c.line = b + (C ? 1 : 0), !0;
2759
2736
  },
2760
2737
  {
2761
2738
  alt: ["paragraph", "reference", "blockquote", "list"]
2762
2739
  }
2763
2740
  ), e.renderer.rules.admonition_open = m, e.renderer.rules.admonition_title_open = m, e.renderer.rules.admonition_title_close = m, e.renderer.rules.admonition_close = m;
2764
- }, ao = (e, t) => {
2741
+ }, io = (e, l) => {
2765
2742
  let o;
2766
- e.core.ruler.push("headingLinks", (l) => {
2767
- o || (o = l.Token);
2768
- }), e.renderer.rules.heading_open = (l, r) => {
2769
- const n = l[r], a = l[r + 1].content, c = n.markup.length;
2770
- return t.headsRef.value.push({
2743
+ e.core.ruler.push("headingLinks", (t) => {
2744
+ o || (o = t.Token);
2745
+ }), e.renderer.rules.heading_open = (t, r) => {
2746
+ const n = t[r], a = t[r + 1].content, d = n.markup.length;
2747
+ return l.headsRef.value.push({
2771
2748
  text: a,
2772
- level: c
2749
+ level: d
2773
2750
  }), n.map && n.level === 0 && (n.attrSet("data-line", String(n.map[0])), n.attrSet(
2774
2751
  "id",
2775
- t.mdHeadingId(a, c, t.headsRef.value.length)
2776
- )), e.renderer.renderToken(l, r, t);
2777
- }, e.renderer.rules.heading_close = (l, r, n, a, c) => c.renderToken(l, r, n);
2778
- }, vt = (e) => e.replace(
2779
- /<pre><code\sclass="language-([^>]*)">/g,
2780
- '<pre><code class="language-$1" language="$1">'
2781
- ), so = (e) => {
2782
- const { editorConfig: t, markdownItConfig: o } = I, l = x("editorId"), r = x("showCodeRowNumber"), n = x("previewOnly"), a = x("theme"), c = F([]), m = Ql(e), u = to(e), { reRenderRef: d, replaceMermaid: f } = eo(e), h = Vt({
2752
+ l.mdHeadingId(a, d, l.headsRef.value.length)
2753
+ )), e.renderer.renderToken(t, r, l);
2754
+ }, e.renderer.rules.heading_close = (t, r, n, a, d) => d.renderToken(t, r, n);
2755
+ }, ao = (e) => {
2756
+ [
2757
+ "paragraph_open",
2758
+ "table_open",
2759
+ "ordered_list_open",
2760
+ "bullet_list_open",
2761
+ "blockquote_open",
2762
+ "hr"
2763
+ ].forEach((l) => {
2764
+ e.renderer.rules[l] = (o, t, r, n, a) => {
2765
+ let d;
2766
+ return o[t].map && o[t].level === 0 && (d = o[t].map[0], o[t].attrSet("data-line", String(d))), a.renderToken(o, t, r);
2767
+ };
2768
+ }), ["html_block", "fence"].forEach((l) => {
2769
+ const o = e.renderer.rules[l];
2770
+ e.renderer.rules[l] = (t, r, n, a, d) => {
2771
+ let m;
2772
+ const u = o(t, r, n, a, d);
2773
+ return t[r].map && t[r].level === 0 ? (m = t[r].map[0], u.replace(/^(<[^>]*)/, `$1 data-line="${m}"`)) : u;
2774
+ };
2775
+ });
2776
+ }, so = (e) => {
2777
+ const { editorConfig: l, markdownItConfig: o } = A, t = x("editorId"), r = x("showCodeRowNumber"), n = x("previewOnly"), a = x("theme"), d = B([]), m = Yl(e), u = eo(e), { reRenderRef: c, replaceMermaid: f } = Ql(e), h = Nt({
2783
2778
  html: !0,
2784
2779
  breaks: !0
2785
2780
  });
2786
- h.use(lo, { themeRef: a }), h.use(ro, { katexRef: u }), h.use(Ut, { figcaption: !0 }), h.use(io), h.use(qt), h.use(ao, { mdHeadingId: e.mdHeadingId, headsRef: c }), h.renderer.rules.paragraph_open = h.renderer.rules.table_open = (p, y, $, w, L) => {
2787
- let S;
2788
- return p[y].map && p[y].level === 0 && (S = p[y].map[0], p[y].attrSet("data-line", String(S))), L.renderToken(p, y, $);
2789
- }, h.set({
2790
- highlight: (p, y) => {
2791
- if (e.noHighlight || !m.value)
2792
- return p;
2793
- const $ = m.value.getLanguage(y);
2794
- let w;
2795
- return $ ? w = m.value.highlight(p, {
2796
- language: y,
2781
+ h.use(no, { katexRef: u }), h.use(Vt, { figcaption: !0 }), h.use(ro), h.use(Ut), h.use(io, { mdHeadingId: e.mdHeadingId, headsRef: d }), e.noMermaid || h.use(to, { themeRef: a }), h.set({
2782
+ highlight: (y, C) => {
2783
+ let $;
2784
+ !e.noHighlight && m.value ? m.value.getLanguage(C) ? $ = m.value.highlight(y, {
2785
+ language: C,
2797
2786
  ignoreIllegals: !0
2798
- }).value : w = m.value.highlightAuto(p).value, r ? ol(w.trim()) : `<span class="code-block">${w.trim()}</span>`;
2787
+ }).value : $ = m.value.highlightAuto(y).value : $ = h.utils.escapeHtml(y);
2788
+ const T = r ? ll($.trim()) : `<span class="code-block">${$.trim()}</span>`;
2789
+ return `<pre><code class="language-${C}" language=${C}>${T}</code></pre>`;
2799
2790
  }
2800
- }), o(h);
2801
- const v = F(e.sanitize(vt(h.render(e.value)))), b = de(
2791
+ }), ao(h), o(h);
2792
+ const p = B(e.sanitize(h.render(e.value))), v = ve(
2802
2793
  async () => {
2803
- c.value = [], v.value = e.sanitize(vt(h.render(e.value))), C.emit(l, "buildFinished", v.value), e.onHtmlChanged(v.value), f();
2794
+ d.value = [], p.value = e.sanitize(h.render(e.value)), k.emit(t, "buildFinished", p.value), e.onHtmlChanged(p.value), f();
2804
2795
  },
2805
- (t == null ? void 0 : t.renderDelay) !== void 0 ? t == null ? void 0 : t.renderDelay : n ? 0 : 500
2806
- ), k = D(() => e.noHighlight || m.value);
2807
- return T([Q(e, "value"), k, d], b), T(
2808
- () => c.value,
2809
- (p) => {
2810
- e.onGetCatalog(p), C.emit(l, "catalogChanged", p);
2796
+ (l == null ? void 0 : l.renderDelay) !== void 0 ? l == null ? void 0 : l.renderDelay : n ? 0 : 500
2797
+ ), b = U(() => e.noHighlight || m.value);
2798
+ return S([ne(e, "value"), b, c], v), S(
2799
+ () => d.value,
2800
+ (y) => {
2801
+ e.onGetCatalog(y), k.emit(t, "catalogChanged", y);
2811
2802
  }
2812
- ), A(() => {
2813
- C.on(l, {
2803
+ ), H(() => {
2804
+ k.on(t, {
2814
2805
  name: "pushCatalog",
2815
2806
  callback() {
2816
- C.emit(l, "catalogChanged", c.value);
2807
+ k.emit(t, "catalogChanged", d.value);
2817
2808
  }
2818
2809
  });
2819
- }), { html: v };
2810
+ }), { html: p };
2820
2811
  }, co = {
2821
2812
  value: {
2822
2813
  type: String,
@@ -2911,17 +2902,17 @@ const zl = (e) => {
2911
2902
  name: "MDEditorContent",
2912
2903
  props: co,
2913
2904
  setup(e) {
2914
- const t = x("previewOnly"), o = x("showCodeRowNumber"), l = x("previewTheme"), r = x("editorId"), n = F(), a = F(), {
2915
- inputWrapperRef: c,
2905
+ const l = x("previewOnly"), o = x("showCodeRowNumber"), t = x("previewTheme"), r = x("editorId"), n = B(), a = B(), {
2906
+ inputWrapperRef: d,
2916
2907
  codeMirrorUt: m
2917
- } = Zl(e), {
2908
+ } = Xl(e), {
2918
2909
  html: u
2919
2910
  } = so(e);
2920
- return $l(e, u, n, a, m), Yl(e, u), Jl(e, u), () => i("div", {
2911
+ return Cl(e, u, n, a, m), Jl(e, u), Zl(e, u), () => i("div", {
2921
2912
  class: `${s}-content`
2922
- }, [!t && i("div", {
2913
+ }, [!l && i("div", {
2923
2914
  class: `${s}-input-wrapper`,
2924
- ref: c
2915
+ ref: d
2925
2916
  }, null), e.setting.preview && i("div", {
2926
2917
  id: `${r}-preview-wrapper`,
2927
2918
  class: `${s}-preview-wrapper`,
@@ -2929,7 +2920,7 @@ const zl = (e) => {
2929
2920
  key: "content-preview-wrapper"
2930
2921
  }, [i("article", {
2931
2922
  id: `${r}-preview`,
2932
- class: [`${s}-preview`, `${l == null ? void 0 : l.value}-theme`, o && `${s}-scrn`],
2923
+ class: [`${s}-preview`, `${t == null ? void 0 : t.value}-theme`, o && `${s}-scrn`],
2933
2924
  innerHTML: u.value
2934
2925
  }, null)]), e.setting.htmlPreview && i("div", {
2935
2926
  class: `${s}-preview-wrapper`,
@@ -2947,14 +2938,14 @@ const zl = (e) => {
2947
2938
  }
2948
2939
  },
2949
2940
  setup(e) {
2950
- const t = x("usedLanguageText");
2941
+ const l = x("usedLanguageText");
2951
2942
  return () => {
2952
- var o, l;
2943
+ var o, t;
2953
2944
  return i("div", {
2954
2945
  class: `${s}-footer-item`
2955
2946
  }, [i("label", {
2956
2947
  class: `${s}-footer-label`
2957
- }, [`${(o = t.value.footer) == null ? void 0 : o.markdownTotal}:`]), i("span", null, [((l = e.modelValue) == null ? void 0 : l.length) || 0])]);
2948
+ }, [`${(o = l.value.footer) == null ? void 0 : o.markdownTotal}:`]), i("span", null, [((t = e.modelValue) == null ? void 0 : t.length) || 0])]);
2958
2949
  };
2959
2950
  }
2960
2951
  });
@@ -2990,7 +2981,7 @@ const fo = {
2990
2981
  }, vo = /* @__PURE__ */ M({
2991
2982
  props: ho,
2992
2983
  setup(e) {
2993
- const t = x("usedLanguageText");
2984
+ const l = x("usedLanguageText");
2994
2985
  return () => {
2995
2986
  var o;
2996
2987
  return i("div", {
@@ -3000,7 +2991,7 @@ const fo = {
3000
2991
  onClick: () => {
3001
2992
  e.onScrollAutoChange(!e.scrollAuto);
3002
2993
  }
3003
- }, [(o = t.value.footer) == null ? void 0 : o.scrollAuto]), i(go, {
2994
+ }, [(o = l.value.footer) == null ? void 0 : o.scrollAuto]), i(go, {
3004
2995
  checked: e.scrollAuto,
3005
2996
  onChange: e.onScrollAutoChange
3006
2997
  }, null)]);
@@ -3030,12 +3021,12 @@ const fo = {
3030
3021
  name: "MDEditorFooter",
3031
3022
  props: po,
3032
3023
  setup(e) {
3033
- const t = D(() => {
3034
- const l = e.footers.indexOf("="), r = l === -1 ? e.footers : e.footers.slice(0, l), n = l === -1 ? [] : e.footers.slice(l, Number.MAX_SAFE_INTEGER);
3024
+ const l = U(() => {
3025
+ const t = e.footers.indexOf("="), r = t === -1 ? e.footers : e.footers.slice(0, t), n = t === -1 ? [] : e.footers.slice(t, Number.MAX_SAFE_INTEGER);
3035
3026
  return [r, n];
3036
- }), o = (l) => {
3037
- if (yt.includes(l))
3038
- switch (l) {
3027
+ }), o = (t) => {
3028
+ if (kt.includes(t))
3029
+ switch (t) {
3039
3030
  case "markdownTotal":
3040
3031
  return i(mo, {
3041
3032
  modelValue: e.modelValue
@@ -3047,15 +3038,15 @@ const fo = {
3047
3038
  }, null);
3048
3039
  }
3049
3040
  else
3050
- return e.defFooters instanceof Array ? e.defFooters[l] || "" : e.defFooters && e.defFooters.children instanceof Array && e.defFooters.children[l] || "";
3041
+ return e.defFooters instanceof Array ? e.defFooters[t] || "" : e.defFooters && e.defFooters.children instanceof Array && e.defFooters.children[t] || "";
3051
3042
  };
3052
3043
  return () => {
3053
- const l = t.value[0].map((n) => o(n)), r = t.value[1].map((n) => o(n));
3044
+ const t = l.value[0].map((n) => o(n)), r = l.value[1].map((n) => o(n));
3054
3045
  return i("div", {
3055
3046
  class: `${s}-footer`
3056
3047
  }, [i("div", {
3057
3048
  class: `${s}-footer-left`
3058
- }, [l]), i("div", {
3049
+ }, [t]), i("div", {
3059
3050
  class: `${s}-footer-right`
3060
3051
  }, [r])]);
3061
3052
  };
@@ -3083,27 +3074,27 @@ const fo = {
3083
3074
  type: Number,
3084
3075
  default: 0
3085
3076
  }
3086
- }, wt = /* @__PURE__ */ M({
3077
+ }, $t = /* @__PURE__ */ M({
3087
3078
  props: ko,
3088
3079
  setup(e) {
3089
3080
  return () => {
3090
3081
  const {
3091
- tocItem: t,
3082
+ tocItem: l,
3092
3083
  mdHeadingId: o,
3093
- scrollElement: l,
3084
+ scrollElement: t,
3094
3085
  onClick: r,
3095
3086
  scrollElementOffsetTop: n
3096
3087
  } = e;
3097
3088
  return i("div", {
3098
- class: [`${s}-catalog-link`, t.active && `${s}-catalog-active`],
3089
+ class: [`${s}-catalog-link`, l.active && `${s}-catalog-active`],
3099
3090
  onClick: (a) => {
3100
- r(a, t), a.stopPropagation();
3101
- const c = o(t.text, t.level, t.index), m = document.getElementById(c), u = l instanceof Element ? l : document.querySelector(l);
3091
+ r(a, l), a.stopPropagation();
3092
+ const d = o(l.text, l.level, l.index), m = document.getElementById(d), u = t instanceof Element ? t : document.querySelector(t);
3102
3093
  if (m && u) {
3103
- let d = m.offsetParent, f = m.offsetTop;
3104
- if (u.contains(d))
3105
- for (; d && u != d; )
3106
- f += d == null ? void 0 : d.offsetTop, d = d == null ? void 0 : d.offsetParent;
3094
+ let c = m.offsetParent, f = m.offsetTop;
3095
+ if (u.contains(c))
3096
+ for (; c && u != c; )
3097
+ f += c == null ? void 0 : c.offsetTop, c = c == null ? void 0 : c.offsetParent;
3107
3098
  u == null || u.scrollTo({
3108
3099
  top: f - n,
3109
3100
  behavior: "smooth"
@@ -3111,14 +3102,14 @@ const fo = {
3111
3102
  }
3112
3103
  }
3113
3104
  }, [i("span", {
3114
- title: t.text
3115
- }, [t.text]), i("div", {
3105
+ title: l.text
3106
+ }, [l.text]), i("div", {
3116
3107
  class: `${s}-catalog-wrapper`
3117
- }, [t.children && t.children.map((a) => i(wt, {
3108
+ }, [l.children && l.children.map((a) => i($t, {
3118
3109
  mdHeadingId: o,
3119
- key: `${t.text}-link-${a.level}-${a.text}`,
3110
+ key: `${l.text}-link-${a.level}-${a.text}`,
3120
3111
  tocItem: a,
3121
- scrollElement: l,
3112
+ scrollElement: t,
3122
3113
  onClick: r,
3123
3114
  scrollElementOffsetTop: n
3124
3115
  }, null))])]);
@@ -3174,26 +3165,26 @@ const yo = {
3174
3165
  onClick: {
3175
3166
  type: Function
3176
3167
  }
3177
- }, ce = /* @__PURE__ */ M({
3168
+ }, he = /* @__PURE__ */ M({
3178
3169
  name: "MdCatalog",
3179
3170
  props: yo,
3180
3171
  emits: ["onClick"],
3181
- setup(e, t) {
3182
- const o = e.editorId, l = N({
3172
+ setup(e, l) {
3173
+ const o = e.editorId, t = q({
3183
3174
  list: [],
3184
3175
  show: !1,
3185
3176
  scrollElement: e.scrollElement || `#${o}-preview-wrapper`
3186
- }), r = D(() => {
3177
+ }), r = U(() => {
3187
3178
  const a = [];
3188
- return l.list.forEach(({
3189
- text: c,
3179
+ return t.list.forEach(({
3180
+ text: d,
3190
3181
  level: m,
3191
3182
  active: u
3192
- }, d) => {
3183
+ }, c) => {
3193
3184
  const f = {
3194
3185
  level: m,
3195
- text: c,
3196
- index: d + 1,
3186
+ text: d,
3187
+ index: c + 1,
3197
3188
  active: !!u
3198
3189
  };
3199
3190
  if (a.length === 0)
@@ -3201,16 +3192,16 @@ const yo = {
3201
3192
  else {
3202
3193
  let h = a[a.length - 1];
3203
3194
  if (f.level > h.level)
3204
- for (let v = h.level + 1; v <= 6; v++) {
3195
+ for (let p = h.level + 1; p <= 6; p++) {
3205
3196
  const {
3206
- children: b
3197
+ children: v
3207
3198
  } = h;
3208
- if (!b) {
3199
+ if (!v) {
3209
3200
  h.children = [f];
3210
3201
  break;
3211
3202
  }
3212
- if (h = b[b.length - 1], f.level <= h.level) {
3213
- b.push(f);
3203
+ if (h = v[v.length - 1], f.level <= h.level) {
3204
+ v.push(f);
3214
3205
  break;
3215
3206
  }
3216
3207
  }
@@ -3219,43 +3210,43 @@ const yo = {
3219
3210
  }
3220
3211
  }), a;
3221
3212
  });
3222
- A(() => {
3223
- C.on(o, {
3213
+ H(() => {
3214
+ k.on(o, {
3224
3215
  name: "catalogChanged",
3225
3216
  callback: (a) => {
3226
- l.list = a.map((c, m) => m === 0 ? {
3227
- ...c,
3217
+ t.list = a.map((d, m) => m === 0 ? {
3218
+ ...d,
3228
3219
  active: !0
3229
3220
  } : {
3230
- ...c
3221
+ ...d
3231
3222
  });
3232
3223
  }
3233
- }), C.emit(o, "pushCatalog");
3224
+ }), k.emit(o, "pushCatalog");
3234
3225
  });
3235
3226
  const n = () => {
3236
- var c;
3237
- const a = l.scrollElement instanceof HTMLElement ? l.scrollElement : document.querySelector(l.scrollElement);
3238
- (c = a === document.documentElement ? window : a) == null || c.addEventListener("scroll", nl(() => {
3239
- if (l.list.length === 0)
3227
+ var d;
3228
+ const a = t.scrollElement instanceof HTMLElement ? t.scrollElement : document.querySelector(t.scrollElement);
3229
+ (d = a === document.documentElement ? window : a) == null || d.addEventListener("scroll", ol(() => {
3230
+ if (t.list.length === 0)
3240
3231
  return !1;
3241
3232
  const {
3242
3233
  activeHead: m
3243
- } = l.list.reduce((u, d, f) => {
3244
- const h = document.getElementById(e.mdHeadingId(d.text, d.level, f + 1));
3234
+ } = t.list.reduce((u, c, f) => {
3235
+ const h = document.getElementById(e.mdHeadingId(c.text, c.level, f + 1));
3245
3236
  if (h instanceof HTMLElement) {
3246
- const v = rl(h, a);
3247
- if (v < e.offsetTop && v > u.minTop)
3237
+ const p = nl(h, a);
3238
+ if (p < e.offsetTop && p > u.minTop)
3248
3239
  return {
3249
- activeHead: d,
3250
- minTop: v
3240
+ activeHead: c,
3241
+ minTop: p
3251
3242
  };
3252
3243
  }
3253
3244
  return u;
3254
3245
  }, {
3255
- activeHead: l.list[0],
3246
+ activeHead: t.list[0],
3256
3247
  minTop: Number.MIN_SAFE_INTEGER
3257
3248
  });
3258
- l.list = l.list.map((u) => u === m ? {
3249
+ t.list = t.list.map((u) => u === m ? {
3259
3250
  ...u,
3260
3251
  active: !0
3261
3252
  } : {
@@ -3264,111 +3255,111 @@ const yo = {
3264
3255
  });
3265
3256
  }));
3266
3257
  };
3267
- return A(() => {
3268
- n(), C.on(o, {
3269
- name: he,
3258
+ return H(() => {
3259
+ n(), k.on(o, {
3260
+ name: Ce,
3270
3261
  callback(a) {
3271
- a && z(n);
3262
+ a && Y(n);
3272
3263
  }
3273
3264
  });
3274
3265
  }), () => i("div", {
3275
3266
  class: `${s}-catalog${e.theme === "dark" ? "-dark" : ""} ${e.class}`
3276
- }, [r.value.map((a) => i(wt, {
3267
+ }, [r.value.map((a) => i($t, {
3277
3268
  mdHeadingId: e.mdHeadingId,
3278
3269
  tocItem: a,
3279
3270
  key: `link-${a.level}-${a.text}`,
3280
- scrollElement: l.scrollElement,
3281
- onClick: (c, m) => {
3282
- e.onClick ? e.onClick(c, m) : t.emit("onClick", c, m);
3271
+ scrollElement: t.scrollElement,
3272
+ onClick: (d, m) => {
3273
+ e.onClick ? e.onClick(d, m) : l.emit("onClick", d, m);
3283
3274
  },
3284
3275
  scrollElementOffsetTop: e.scrollElementOffsetTop
3285
3276
  }, null))]);
3286
3277
  }
3287
- }), Co = (e, t) => {
3288
- const { editorId: o, previewOnly: l } = e, r = N({
3278
+ }), Co = (e, l) => {
3279
+ const { editorId: o, previewOnly: t } = e, r = q({
3289
3280
  // 是否已编译成html
3290
3281
  buildFinished: !1,
3291
3282
  // 存储当前最新的html
3292
3283
  html: ""
3293
3284
  });
3294
- T(
3285
+ S(
3295
3286
  () => e.modelValue,
3296
3287
  () => {
3297
3288
  r.buildFinished = !1;
3298
3289
  }
3299
- ), A(() => {
3300
- l || (C.on(o, {
3290
+ ), H(() => {
3291
+ t || (k.on(o, {
3301
3292
  name: "buildFinished",
3302
3293
  callback(n) {
3303
3294
  r.buildFinished = !0, r.html = n;
3304
3295
  }
3305
- }), C.on(o, {
3306
- name: ue,
3296
+ }), k.on(o, {
3297
+ name: pe,
3307
3298
  callback() {
3308
3299
  const n = new Promise((a) => {
3309
3300
  if (r.buildFinished)
3310
3301
  a(r.html);
3311
3302
  else {
3312
- const c = (m) => {
3313
- a(m), C.remove(o, "buildFinished", c);
3303
+ const d = (m) => {
3304
+ a(m), k.remove(o, "buildFinished", d);
3314
3305
  };
3315
- C.on(o, {
3306
+ k.on(o, {
3316
3307
  name: "buildFinished",
3317
- callback: c
3308
+ callback: d
3318
3309
  });
3319
3310
  }
3320
3311
  });
3321
- e.onSave ? e.onSave(e.modelValue, n) : t.emit("onSave", e.modelValue, n);
3312
+ e.onSave ? e.onSave(e.modelValue, n) : l.emit("onSave", e.modelValue, n);
3322
3313
  }
3323
3314
  }));
3324
3315
  });
3325
3316
  }, $o = (e) => {
3326
3317
  var n;
3327
- const { editorId: t, previewOnly: o } = e, l = (n = I == null ? void 0 : I.editorExtensions) == null ? void 0 : n.highlight;
3328
- W("editorId", t), W("tabWidth", e.tabWidth), W(
3318
+ const { editorId: l, previewOnly: o } = e, t = (n = A == null ? void 0 : A.editorExtensions) == null ? void 0 : n.highlight;
3319
+ Z("editorId", l), Z("tabWidth", e.tabWidth), Z(
3329
3320
  "theme",
3330
- D(() => e.theme)
3331
- ), W(
3321
+ U(() => e.theme)
3322
+ ), Z(
3332
3323
  "highlight",
3333
- D(() => {
3324
+ U(() => {
3334
3325
  const a = {
3335
- ...Je,
3336
- ...l == null ? void 0 : l.css
3337
- }, c = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme;
3326
+ ...Ze,
3327
+ ...t == null ? void 0 : t.css
3328
+ }, d = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme;
3338
3329
  return {
3339
- js: (l == null ? void 0 : l.js) || Kt,
3340
- css: a[e.codeTheme] ? a[e.codeTheme][c] : Je.atom[c]
3330
+ js: (t == null ? void 0 : t.js) || Kt,
3331
+ css: a[e.codeTheme] ? a[e.codeTheme][d] : Ze.atom[d]
3341
3332
  };
3342
3333
  })
3343
- ), W("previewOnly", o), W("showCodeRowNumber", e.showCodeRowNumber);
3344
- const r = D(() => {
3345
- var c;
3334
+ ), Z("previewOnly", o), Z("showCodeRowNumber", e.showCodeRowNumber);
3335
+ const r = U(() => {
3336
+ var d;
3346
3337
  const a = {
3347
- ...Xe,
3348
- ...(c = I == null ? void 0 : I.editorConfig) == null ? void 0 : c.languageUserDefined
3338
+ ...ze,
3339
+ ...(d = A == null ? void 0 : A.editorConfig) == null ? void 0 : d.languageUserDefined
3349
3340
  };
3350
- return a[e.language] ? a[e.language] : Xe["zh-CN"];
3341
+ return a[e.language] ? a[e.language] : ze["zh-CN"];
3351
3342
  });
3352
- W("usedLanguageText", r), W(
3343
+ Z("usedLanguageText", r), Z(
3353
3344
  "previewTheme",
3354
- D(() => e.previewTheme)
3345
+ U(() => e.previewTheme)
3355
3346
  );
3356
3347
  }, wo = (e) => {
3357
- var u, d, f, h, v, b;
3358
- const { noPrettier: t, previewOnly: o, noIconfont: l, noUploadImg: r } = e, { editorExtensions: n } = I, a = t || !!((d = (u = I.editorExtensions) == null ? void 0 : u.prettier) != null && d.prettierInstance), c = t || !!((h = (f = I.editorExtensions) == null ? void 0 : f.prettier) != null && h.parserMarkdownInstance), m = r || !!((b = (v = I.editorExtensions) == null ? void 0 : v.cropper) != null && b.instance);
3359
- A(() => {
3360
- var L, S, j, B;
3361
- const k = document.createElement("script");
3362
- k.src = (n == null ? void 0 : n.iconfont) || zt, k.id = `${s}-icon`;
3363
- const p = document.createElement("script"), y = document.createElement("script");
3364
- p.src = ((L = n == null ? void 0 : n.prettier) == null ? void 0 : L.standaloneJs) || ze.main, p.id = `${s}-prettier`, y.src = ((S = n == null ? void 0 : n.prettier) == null ? void 0 : S.parserMarkdownJs) || ze.markdown, y.id = `${s}-prettierMD`;
3348
+ var u, c, f, h, p, v;
3349
+ const { noPrettier: l, previewOnly: o, noIconfont: t, noUploadImg: r } = e, { editorExtensions: n } = A, a = l || !!((c = (u = A.editorExtensions) == null ? void 0 : u.prettier) != null && c.prettierInstance), d = l || !!((h = (f = A.editorExtensions) == null ? void 0 : f.prettier) != null && h.parserMarkdownInstance), m = r || !!((v = (p = A.editorExtensions) == null ? void 0 : p.cropper) != null && v.instance);
3350
+ H(() => {
3351
+ var I, w, F, j;
3352
+ const b = document.createElement("script");
3353
+ b.src = (n == null ? void 0 : n.iconfont) || Gt, b.id = `${s}-icon`;
3354
+ const y = document.createElement("script"), C = document.createElement("script");
3355
+ y.src = ((I = n == null ? void 0 : n.prettier) == null ? void 0 : I.standaloneJs) || Ge.main, y.id = `${s}-prettier`, C.src = ((w = n == null ? void 0 : n.prettier) == null ? void 0 : w.parserMarkdownJs) || Ge.markdown, C.id = `${s}-prettierMD`;
3365
3356
  const $ = document.createElement("link");
3366
- $.rel = "stylesheet", $.href = ((j = n == null ? void 0 : n.cropper) == null ? void 0 : j.css) || Ke.css, $.id = `${s}-cropperCss`;
3367
- const w = document.createElement("script");
3368
- w.src = ((B = n == null ? void 0 : n.cropper) == null ? void 0 : B.js) || Ke.js, w.id = `${s}-cropper`, l || O(k), o || (m || (O($), O(w)), a || O(p), c || O(y));
3357
+ $.rel = "stylesheet", $.href = ((F = n == null ? void 0 : n.cropper) == null ? void 0 : F.css) || Ke.css, $.id = `${s}-cropperCss`;
3358
+ const T = document.createElement("script");
3359
+ T.src = ((j = n == null ? void 0 : n.cropper) == null ? void 0 : j.js) || Ke.js, T.id = `${s}-cropper`, t || V(b), o || (m || (V($), V(T)), a || V(y), d || V(C));
3369
3360
  });
3370
- }, To = (e, t) => {
3371
- const { editorId: o, previewOnly: l } = e, r = N({
3361
+ }, To = (e, l) => {
3362
+ const { editorId: o, previewOnly: t } = e, r = q({
3372
3363
  pageFullscreen: e.pageFullscreen,
3373
3364
  fullscreen: !1,
3374
3365
  preview: e.preview,
@@ -3377,66 +3368,66 @@ const yo = {
3377
3368
  r[m] = u === void 0 ? !r[m] : u, m === "preview" && r.preview ? r.htmlPreview = !1 : m === "htmlPreview" && r.htmlPreview && (r.preview = !1);
3378
3369
  };
3379
3370
  let a = "";
3380
- const c = () => {
3371
+ const d = () => {
3381
3372
  r.pageFullscreen || r.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = a;
3382
3373
  };
3383
- return T(() => [r.pageFullscreen, r.fullscreen], c), A(() => {
3384
- l || C.on(o, {
3374
+ return S(() => [r.pageFullscreen, r.fullscreen], d), H(() => {
3375
+ t || k.on(o, {
3385
3376
  name: "uploadImage",
3386
3377
  callback(m, u) {
3387
- const d = (f) => {
3388
- C.emit(o, "replace", "image", {
3378
+ const c = (f) => {
3379
+ k.emit(o, "replace", "image", {
3389
3380
  desc: "",
3390
3381
  urls: f
3391
3382
  }), u && u();
3392
3383
  };
3393
- e.onUploadImg ? e.onUploadImg(m, d) : t.emit("onUploadImg", m, d);
3384
+ e.onUploadImg ? e.onUploadImg(m, c) : l.emit("onUploadImg", m, c);
3394
3385
  }
3395
- }), a = document.body.style.overflow, c();
3386
+ }), a = document.body.style.overflow, d();
3396
3387
  }), [r, n];
3397
3388
  }, So = (e) => {
3398
- const { editorId: t } = e, o = F(!1);
3399
- A(() => {
3400
- C.on(t, {
3401
- name: $e,
3389
+ const { editorId: l } = e, o = B(!1);
3390
+ H(() => {
3391
+ k.on(l, {
3392
+ name: Le,
3402
3393
  callback: (r) => {
3403
3394
  r === void 0 ? o.value = !o.value : o.value = r;
3404
3395
  }
3405
3396
  });
3406
3397
  });
3407
- const l = D(() => !e.toolbarsExclude.includes("catalog") && e.toolbars.includes("catalog"));
3408
- return [o, l];
3409
- }, xo = (e, t, o, l, r) => {
3398
+ const t = U(() => !e.toolbarsExclude.includes("catalog") && e.toolbars.includes("catalog"));
3399
+ return [o, t];
3400
+ }, xo = (e, l, o, t, r) => {
3410
3401
  const { editorId: n } = e;
3411
- T(
3412
- () => l.pageFullscreen,
3413
- (c) => {
3414
- C.emit(n, Ye, c);
3402
+ S(
3403
+ () => t.pageFullscreen,
3404
+ (d) => {
3405
+ k.emit(n, Je, d);
3415
3406
  }
3416
- ), T(
3417
- () => l.fullscreen,
3418
- (c) => {
3419
- C.emit(n, Qe, c);
3407
+ ), S(
3408
+ () => t.fullscreen,
3409
+ (d) => {
3410
+ k.emit(n, Ye, d);
3420
3411
  }
3421
- ), T(
3422
- () => l.preview,
3423
- (c) => {
3424
- C.emit(n, he, c);
3412
+ ), S(
3413
+ () => t.preview,
3414
+ (d) => {
3415
+ k.emit(n, Ce, d);
3425
3416
  }
3426
- ), T(
3427
- () => l.htmlPreview,
3428
- (c) => {
3429
- C.emit(n, et, c);
3417
+ ), S(
3418
+ () => t.htmlPreview,
3419
+ (d) => {
3420
+ k.emit(n, Qe, d);
3430
3421
  }
3431
- ), T(o, (c) => {
3432
- C.emit(n, tt, c);
3422
+ ), S(o, (d) => {
3423
+ k.emit(n, et, d);
3433
3424
  });
3434
3425
  const a = {
3435
- on(c, m) {
3436
- switch (c) {
3426
+ on(d, m) {
3427
+ switch (d) {
3437
3428
  case "pageFullscreen": {
3438
- C.on(n, {
3439
- name: Ye,
3429
+ k.on(n, {
3430
+ name: Je,
3440
3431
  callback(u) {
3441
3432
  m(u);
3442
3433
  }
@@ -3444,8 +3435,8 @@ const yo = {
3444
3435
  break;
3445
3436
  }
3446
3437
  case "fullscreen": {
3447
- C.on(n, {
3448
- name: Qe,
3438
+ k.on(n, {
3439
+ name: Ye,
3449
3440
  callback(u) {
3450
3441
  m(u);
3451
3442
  }
@@ -3453,8 +3444,8 @@ const yo = {
3453
3444
  break;
3454
3445
  }
3455
3446
  case "preview": {
3456
- C.on(n, {
3457
- name: he,
3447
+ k.on(n, {
3448
+ name: Ce,
3458
3449
  callback(u) {
3459
3450
  m(u);
3460
3451
  }
@@ -3462,8 +3453,8 @@ const yo = {
3462
3453
  break;
3463
3454
  }
3464
3455
  case "htmlPreview": {
3465
- C.on(n, {
3466
- name: et,
3456
+ k.on(n, {
3457
+ name: Qe,
3467
3458
  callback(u) {
3468
3459
  m(u);
3469
3460
  }
@@ -3471,8 +3462,8 @@ const yo = {
3471
3462
  break;
3472
3463
  }
3473
3464
  case "catalog": {
3474
- C.on(n, {
3475
- name: tt,
3465
+ k.on(n, {
3466
+ name: et,
3476
3467
  callback(u) {
3477
3468
  m(u);
3478
3469
  }
@@ -3481,32 +3472,32 @@ const yo = {
3481
3472
  }
3482
3473
  }
3483
3474
  },
3484
- togglePageFullscreen(c) {
3485
- r("pageFullscreen", c);
3475
+ togglePageFullscreen(d) {
3476
+ r("pageFullscreen", d);
3486
3477
  },
3487
- toggleFullscreen(c) {
3488
- C.emit(n, Ct, c);
3478
+ toggleFullscreen(d) {
3479
+ k.emit(n, yt, d);
3489
3480
  },
3490
- togglePreview(c) {
3491
- r("preview", c);
3481
+ togglePreview(d) {
3482
+ r("preview", d);
3492
3483
  },
3493
- toggleHtmlPreview(c) {
3494
- r("htmlPreview", c);
3484
+ toggleHtmlPreview(d) {
3485
+ r("htmlPreview", d);
3495
3486
  },
3496
- toggleCatalog(c) {
3497
- C.emit(n, $e, c);
3487
+ toggleCatalog(d) {
3488
+ k.emit(n, Le, d);
3498
3489
  },
3499
3490
  triggerSave() {
3500
- C.emit(n, ue);
3491
+ k.emit(n, pe);
3501
3492
  },
3502
- insert(c) {
3503
- C.emit(n, "replace", "universal", { generate: c });
3493
+ insert(d) {
3494
+ k.emit(n, "replace", "universal", { generate: d });
3504
3495
  },
3505
3496
  focus() {
3506
- C.emit(n, $t);
3497
+ k.emit(n, Ct);
3507
3498
  }
3508
3499
  };
3509
- t.expose(a);
3500
+ l.expose(a);
3510
3501
  }, Eo = (e) => e, Lo = {
3511
3502
  /**
3512
3503
  * 主题
@@ -3605,7 +3596,7 @@ const yo = {
3605
3596
  */
3606
3597
  toolbars: {
3607
3598
  type: Array,
3608
- default: kt
3599
+ default: bt
3609
3600
  },
3610
3601
  /**
3611
3602
  * 工具栏选择不显示
@@ -3644,7 +3635,7 @@ const yo = {
3644
3635
  */
3645
3636
  editorId: {
3646
3637
  type: String,
3647
- default: Gt
3638
+ default: Wt
3648
3639
  },
3649
3640
  /**
3650
3641
  * 一个tab等于空格数
@@ -3762,7 +3753,7 @@ const yo = {
3762
3753
  */
3763
3754
  footers: {
3764
3755
  type: Array,
3765
- default: yt
3756
+ default: kt
3766
3757
  },
3767
3758
  /**
3768
3759
  * 是否默认激活输入框和预览框同步滚动
@@ -3878,7 +3869,7 @@ const yo = {
3878
3869
  type: Boolean,
3879
3870
  default: !1
3880
3871
  }
3881
- }, Ho = [
3872
+ }, Ao = [
3882
3873
  "onChange",
3883
3874
  "onSave",
3884
3875
  "onUploadImg",
@@ -3889,51 +3880,51 @@ const yo = {
3889
3880
  "onBlur",
3890
3881
  "onFocus"
3891
3882
  ];
3892
- const G = /* @__PURE__ */ M({
3883
+ const J = /* @__PURE__ */ M({
3893
3884
  name: "MdEditorV3",
3894
3885
  props: Lo,
3895
- emits: Ho,
3896
- setup(e, t) {
3886
+ emits: Ao,
3887
+ setup(e, l) {
3897
3888
  const {
3898
3889
  editorId: o,
3899
- previewOnly: l,
3890
+ previewOnly: t,
3900
3891
  noKatex: r,
3901
3892
  noMermaid: n,
3902
3893
  noPrettier: a,
3903
- noUploadImg: c,
3894
+ noUploadImg: d,
3904
3895
  noHighlight: m
3905
- } = e, u = N({
3896
+ } = e, u = q({
3906
3897
  scrollAuto: e.scrollAuto
3907
3898
  });
3908
- Co(e, t), $o(e), wo(e);
3909
- const [d, f] = To(e, t), [h, v] = So(e);
3910
- return ke(() => {
3911
- C.clear(o);
3912
- }), xo(e, t, h, d, f), () => {
3913
- var p;
3914
- const b = _({
3899
+ Co(e, l), $o(e), wo(e);
3900
+ const [c, f] = To(e, l), [h, p] = So(e);
3901
+ return Se(() => {
3902
+ k.clear(o);
3903
+ }), xo(e, l, h, c, f), () => {
3904
+ var y;
3905
+ const v = W({
3915
3906
  props: e,
3916
- ctx: t
3917
- }, "defToolbars"), k = _({
3907
+ ctx: l
3908
+ }, "defToolbars"), b = W({
3918
3909
  props: e,
3919
- ctx: t
3910
+ ctx: l
3920
3911
  }, "defFooters");
3921
3912
  return i("div", {
3922
3913
  id: o,
3923
- class: [s, e.class, e.theme === "dark" && `${s}-dark`, d.fullscreen || d.pageFullscreen ? `${s}-fullscreen` : "", l && `${s}-previewOnly`],
3914
+ class: [s, e.class, e.theme === "dark" && `${s}-dark`, c.fullscreen || c.pageFullscreen ? `${s}-fullscreen` : "", t && `${s}-previewOnly`],
3924
3915
  style: e.style
3925
- }, [!l && i(kl, {
3916
+ }, [!t && i(bl, {
3926
3917
  noPrettier: a,
3927
3918
  toolbars: e.toolbars,
3928
3919
  toolbarsExclude: e.toolbarsExclude,
3929
- setting: d,
3920
+ setting: c,
3930
3921
  updateSetting: f,
3931
3922
  tableShape: e.tableShape,
3932
- defToolbars: b,
3933
- noUploadImg: c
3923
+ defToolbars: v,
3924
+ noUploadImg: d
3934
3925
  }, null), i(uo, {
3935
3926
  value: e.modelValue,
3936
- setting: d,
3927
+ setting: c,
3937
3928
  mdHeadingId: e.mdHeadingId,
3938
3929
  noMermaid: n,
3939
3930
  noPrettier: a,
@@ -3948,28 +3939,28 @@ const G = /* @__PURE__ */ M({
3948
3939
  maxlength: e.maxLength,
3949
3940
  autoDetectCode: e.autoDetectCode,
3950
3941
  noHighlight: m,
3951
- onChange: (y) => {
3952
- e.onChange ? e.onChange(y) : (t.emit("update:modelValue", y), t.emit("onChange", y));
3942
+ onChange: (C) => {
3943
+ e.onChange ? e.onChange(C) : (l.emit("update:modelValue", C), l.emit("onChange", C));
3953
3944
  },
3954
- onHtmlChanged: (y) => {
3955
- e.onHtmlChanged ? e.onHtmlChanged(y) : t.emit("onHtmlChanged", y);
3945
+ onHtmlChanged: (C) => {
3946
+ e.onHtmlChanged ? e.onHtmlChanged(C) : l.emit("onHtmlChanged", C);
3956
3947
  },
3957
- onGetCatalog: (y) => {
3958
- e.onGetCatalog ? e.onGetCatalog(y) : t.emit("onGetCatalog", y);
3948
+ onGetCatalog: (C) => {
3949
+ e.onGetCatalog ? e.onGetCatalog(C) : l.emit("onGetCatalog", C);
3959
3950
  },
3960
- onBlur: (y) => {
3961
- e.onBlur ? e.onBlur(y) : t.emit("onBlur", y);
3951
+ onBlur: (C) => {
3952
+ e.onBlur ? e.onBlur(C) : l.emit("onBlur", C);
3962
3953
  },
3963
- onFocus: (y) => {
3964
- e.onFocus ? e.onFocus(y) : t.emit("onFocus", y);
3954
+ onFocus: (C) => {
3955
+ e.onFocus ? e.onFocus(C) : l.emit("onFocus", C);
3965
3956
  }
3966
- }, null), !l && ((p = e.footers) == null ? void 0 : p.length) > 0 && i(bo, {
3957
+ }, null), !t && ((y = e.footers) == null ? void 0 : y.length) > 0 && i(bo, {
3967
3958
  modelValue: e.modelValue,
3968
3959
  footers: e.footers,
3969
- defFooters: k,
3960
+ defFooters: b,
3970
3961
  scrollAuto: u.scrollAuto,
3971
- onScrollAutoChange: (y) => u.scrollAuto = y
3972
- }, null), v.value && !l && i(ce, {
3962
+ onScrollAutoChange: (C) => u.scrollAuto = C
3963
+ }, null), p.value && !t && i(he, {
3973
3964
  theme: e.theme,
3974
3965
  style: {
3975
3966
  display: h.value ? "block" : "none"
@@ -3992,26 +3983,26 @@ const G = /* @__PURE__ */ M({
3992
3983
  onClick: {
3993
3984
  type: Function
3994
3985
  }
3995
- }, ve = /* @__PURE__ */ M({
3986
+ }, $e = /* @__PURE__ */ M({
3996
3987
  name: "NormalToolbar",
3997
3988
  props: Io,
3998
3989
  emits: ["onClick"],
3999
- setup(e, t) {
3990
+ setup(e, l) {
4000
3991
  return () => {
4001
- const o = _({
3992
+ const o = W({
4002
3993
  props: e,
4003
- ctx: t
3994
+ ctx: l
4004
3995
  }, "trigger");
4005
3996
  return i("div", {
4006
3997
  class: `${s}-toolbar-item`,
4007
3998
  title: e.title,
4008
- onClick: (l) => {
4009
- e.onClick instanceof Function ? e.onClick(l) : t.emit("onClick", l);
3999
+ onClick: (t) => {
4000
+ e.onClick instanceof Function ? e.onClick(t) : l.emit("onClick", t);
4010
4001
  }
4011
4002
  }, [o]);
4012
4003
  };
4013
4004
  }
4014
- }), Ao = {
4005
+ }), Ho = {
4015
4006
  title: {
4016
4007
  type: String,
4017
4008
  default: ""
@@ -4030,38 +4021,38 @@ const G = /* @__PURE__ */ M({
4030
4021
  overlay: {
4031
4022
  type: [String, Object]
4032
4023
  }
4033
- }, pe = /* @__PURE__ */ M({
4024
+ }, we = /* @__PURE__ */ M({
4034
4025
  name: "DropdownToolbar",
4035
- props: Ao,
4026
+ props: Ho,
4036
4027
  emits: ["onChange"],
4037
- setup(e, t) {
4028
+ setup(e, l) {
4038
4029
  const o = x("editorId");
4039
4030
  return () => {
4040
- const l = _({
4031
+ const t = W({
4041
4032
  props: e,
4042
- ctx: t
4043
- }, "trigger"), r = _({
4033
+ ctx: l
4034
+ }, "trigger"), r = W({
4044
4035
  props: e,
4045
- ctx: t
4036
+ ctx: l
4046
4037
  }, "overlay");
4047
- return i(Y, {
4038
+ return i(oe, {
4048
4039
  relative: `#${o}-toolbar-wrapper`,
4049
4040
  visible: e.visible,
4050
4041
  onChange: (n) => {
4051
- e.onChange instanceof Function ? e.onChange(n) : t.emit("onChange", n);
4042
+ e.onChange instanceof Function ? e.onChange(n) : l.emit("onChange", n);
4052
4043
  },
4053
4044
  overlay: r
4054
4045
  }, {
4055
4046
  default: () => [i("div", {
4056
4047
  class: `${s}-toolbar-item`,
4057
4048
  title: e.title || ""
4058
- }, [l])]
4049
+ }, [t])]
4059
4050
  });
4060
4051
  };
4061
4052
  }
4062
4053
  });
4063
4054
  function Fo(e) {
4064
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Et(e);
4055
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !xt(e);
4065
4056
  }
4066
4057
  const Mo = {
4067
4058
  title: {
@@ -4107,50 +4098,50 @@ const Mo = {
4107
4098
  onAdjust: {
4108
4099
  type: Function
4109
4100
  }
4110
- }, be = /* @__PURE__ */ M({
4101
+ }, Te = /* @__PURE__ */ M({
4111
4102
  name: "ModalToolbar",
4112
4103
  props: Mo,
4113
4104
  emits: ["onClick", "onClose", "onAdjust"],
4114
- setup(e, t) {
4105
+ setup(e, l) {
4115
4106
  return () => {
4116
- const o = _({
4107
+ const o = W({
4117
4108
  props: e,
4118
- ctx: t
4119
- }, "trigger"), l = _({
4109
+ ctx: l
4110
+ }, "trigger"), t = W({
4120
4111
  props: e,
4121
- ctx: t
4112
+ ctx: l
4122
4113
  }, "default");
4123
- return i(ye, null, [i("div", {
4114
+ return i(xe, null, [i("div", {
4124
4115
  class: `${s}-toolbar-item`,
4125
4116
  title: e.title,
4126
4117
  onClick: () => {
4127
- e.onClick instanceof Function ? e.onClick() : t.emit("onClick");
4118
+ e.onClick instanceof Function ? e.onClick() : l.emit("onClick");
4128
4119
  }
4129
- }, [o]), i(we, {
4120
+ }, [o]), i(Ae, {
4130
4121
  width: e.width,
4131
4122
  height: e.height,
4132
4123
  title: e.modalTitle,
4133
4124
  visible: e.visible,
4134
4125
  onClose: () => {
4135
- e.onClose instanceof Function ? e.onClose() : t.emit("onClose");
4126
+ e.onClose instanceof Function ? e.onClose() : l.emit("onClose");
4136
4127
  },
4137
4128
  showAdjust: e.showAdjust,
4138
4129
  isFullscreen: e.isFullscreen,
4139
4130
  onAdjust: (r) => {
4140
- e.onAdjust instanceof Function ? e.onAdjust(r) : t.emit("onAdjust", r);
4131
+ e.onAdjust instanceof Function ? e.onAdjust(r) : l.emit("onAdjust", r);
4141
4132
  }
4142
- }, Fo(l) ? l : {
4143
- default: () => [l]
4133
+ }, Fo(t) ? t : {
4134
+ default: () => [t]
4144
4135
  })]);
4145
4136
  };
4146
4137
  }
4147
4138
  });
4148
- G.install = (e) => (e.component(G.name, G), e.component(ve.name, ve), e.component(pe.name, pe), e.component(ce.name, ce), e.component(be.name, be), e);
4149
- G.NormalToolbar = ve;
4150
- G.DropdownToolbar = pe;
4151
- G.MdCatalog = ce;
4152
- G.ModalToolbar = be;
4153
- G.config = Jt;
4139
+ J.install = (e) => (e.component(J.name, J), e.component($e.name, $e), e.component(we.name, we), e.component(he.name, he), e.component(Te.name, Te), e);
4140
+ J.NormalToolbar = $e;
4141
+ J.DropdownToolbar = we;
4142
+ J.MdCatalog = he;
4143
+ J.ModalToolbar = Te;
4144
+ J.config = Zt;
4154
4145
  export {
4155
- G as default
4146
+ J as default
4156
4147
  };