md-editor-v3 2.10.0-beta.2 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/md-editor-v3.cjs +125 -0
- package/lib/{md-editor-v3.js → md-editor-v3.mjs} +371 -380
- package/lib/md-editor-v3.umd.js +125 -0
- package/package.json +6 -5
- package/lib/md-editor-v3.umd.cjs +0 -125
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var Yn = Object.defineProperty;
|
|
2
2
|
var Jn = (s, e, t) => e in s ? Yn(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
-
var
|
|
3
|
+
var le = (s, e, t) => (Jn(s, typeof e != "symbol" ? e + "" : e, t), t), Zt = (s, e, t) => {
|
|
4
4
|
if (!e.has(s))
|
|
5
5
|
throw TypeError("Cannot " + t);
|
|
6
6
|
};
|
|
@@ -8,19 +8,19 @@ var a = (s, e, t) => (Zt(s, e, "read from private field"), t ? t.call(s) : e.get
|
|
|
8
8
|
if (e.has(s))
|
|
9
9
|
throw TypeError("Cannot add the same private member more than once");
|
|
10
10
|
e instanceof WeakSet ? e.add(s) : e.set(s, t);
|
|
11
|
-
},
|
|
11
|
+
}, R = (s, e, t, n) => (Zt(s, e, "write to private field"), n ? n.call(s, t) : e.set(s, t), t), Lt = (s, e, t, n) => ({
|
|
12
12
|
set _(i) {
|
|
13
|
-
|
|
13
|
+
R(s, e, i, t);
|
|
14
14
|
},
|
|
15
15
|
get _() {
|
|
16
16
|
return a(s, e, n);
|
|
17
17
|
}
|
|
18
|
-
}),
|
|
19
|
-
import { reactive as xe, watch as G, onMounted as ie, onBeforeUnmount as Ct, provide as je, computed as ze, ref as ne, defineComponent as
|
|
20
|
-
const d = "md-editor", ii = "md-editor-v3", si = "https://at.alicdn.com/t/c/font_2605852_u82y61ve02.js", J = "https://cdnjs.cloudflare.com/ajax/libs", li = `${J}/highlight.js/11.7.0/highlight.min.js`,
|
|
18
|
+
}), I = (s, e, t) => (Zt(s, e, "access private method"), t);
|
|
19
|
+
import { reactive as xe, watch as G, onMounted as ie, onBeforeUnmount as Ct, provide as je, computed as ze, ref as ne, defineComponent as ae, createVNode as u, cloneVNode as ei, nextTick as ft, inject as U, Fragment as Kt, toRef as Bt, mergeProps as ti, isVNode as ni } from "vue";
|
|
20
|
+
const d = "md-editor", ii = "md-editor-v3", si = "https://at.alicdn.com/t/c/font_2605852_u82y61ve02.js", J = "https://cdnjs.cloudflare.com/ajax/libs", li = `${J}/highlight.js/11.7.0/highlight.min.js`, mn = {
|
|
21
21
|
main: `${J}/prettier/2.8.0/standalone.js`,
|
|
22
22
|
markdown: `${J}/prettier/2.8.0/parser-markdown.js`
|
|
23
|
-
},
|
|
23
|
+
}, gn = {
|
|
24
24
|
css: `${J}/cropperjs/1.5.13/cropper.min.css`,
|
|
25
25
|
js: `${J}/cropperjs/1.5.13/cropper.min.js`
|
|
26
26
|
}, oi = `${J}/screenfull.js/5.2.0/screenfull.min.js`, Dn = [
|
|
@@ -56,7 +56,7 @@ const d = "md-editor", ii = "md-editor-v3", si = "https://at.alicdn.com/t/c/font
|
|
|
56
56
|
"htmlPreview",
|
|
57
57
|
"catalog",
|
|
58
58
|
"github"
|
|
59
|
-
], Hn = ["markdownTotal", "=", "scrollSwitch"],
|
|
59
|
+
], Hn = ["markdownTotal", "=", "scrollSwitch"], pn = {
|
|
60
60
|
"zh-CN": {
|
|
61
61
|
toolbarTips: {
|
|
62
62
|
bold: "加粗",
|
|
@@ -222,7 +222,7 @@ const d = "md-editor", ii = "md-editor-v3", si = "https://at.alicdn.com/t/c/font
|
|
|
222
222
|
}, ri = `${J}/mermaid/9.4.0/mermaid.min.js`, Nt = {
|
|
223
223
|
js: `${J}/KaTeX/0.16.3/katex.min.js`,
|
|
224
224
|
css: `${J}/KaTeX/0.16.3/katex.min.css`
|
|
225
|
-
},
|
|
225
|
+
}, vn = {
|
|
226
226
|
a11y: {
|
|
227
227
|
light: `${J}/highlight.js/11.7.0/styles/a11y-light.min.css`,
|
|
228
228
|
dark: `${J}/highlight.js/11.7.0/styles/a11y-dark.min.css`
|
|
@@ -271,7 +271,7 @@ const d = "md-editor", ii = "md-editor-v3", si = "https://at.alicdn.com/t/c/font
|
|
|
271
271
|
class ci {
|
|
272
272
|
constructor() {
|
|
273
273
|
// 事件池
|
|
274
|
-
|
|
274
|
+
le(this, "pools", {});
|
|
275
275
|
}
|
|
276
276
|
// 移除事件监听
|
|
277
277
|
remove(e, t, n) {
|
|
@@ -303,7 +303,7 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
303
303
|
s.setSelectionRange ? setTimeout(() => {
|
|
304
304
|
s.setSelectionRange(e, t), s.focus(), n(!0);
|
|
305
305
|
}, 0) : (console.error("Can not reset position!"), i());
|
|
306
|
-
}),
|
|
306
|
+
}), Qt = (s, e, t) => {
|
|
307
307
|
const { deviationStart: n = 0, deviationEnd: i = 0, direct: l = !1, select: r = !1 } = t;
|
|
308
308
|
let o = "";
|
|
309
309
|
if (s.selectionStart || s.selectionStart === 0) {
|
|
@@ -327,7 +327,7 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
327
327
|
s || console.error("error link!");
|
|
328
328
|
const t = document.createElement("a");
|
|
329
329
|
t.href = s, t.style.display = "none", e.newWindow && (t.target = "_blank"), e.nofollow && (t.rel = "noopener noreferrer"), document.body.appendChild(t), t.click(), document.body.removeChild(t);
|
|
330
|
-
},
|
|
330
|
+
}, bn = (s, e) => {
|
|
331
331
|
const t = Gt(() => {
|
|
332
332
|
s.removeEventListener("scroll", n), s.addEventListener("scroll", n), e.removeEventListener("scroll", n), e.addEventListener("scroll", n);
|
|
333
333
|
}, 50), n = (i) => {
|
|
@@ -361,7 +361,7 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
361
361
|
return new File([o], e, { type: i });
|
|
362
362
|
}
|
|
363
363
|
return null;
|
|
364
|
-
},
|
|
364
|
+
}, kn = (s) => {
|
|
365
365
|
if (!s.trim())
|
|
366
366
|
return s;
|
|
367
367
|
const e = s.split(`
|
|
@@ -428,11 +428,11 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
428
428
|
const t = document.getElementById(s.id), n = (i) => {
|
|
429
429
|
typeof s.onload == "function" && s.onload(i), s.removeEventListener("load", n);
|
|
430
430
|
};
|
|
431
|
-
t ? e !== "" && s.onload
|
|
431
|
+
t ? e !== "" && typeof s.onload == "function" && (Reflect.get(window, e) ? s.dispatchEvent(new Event("load")) : t.addEventListener("load", n)) : (s.addEventListener("load", n), document.head.appendChild(s));
|
|
432
432
|
}, vi = Gt((s, e, t) => {
|
|
433
433
|
const n = document.getElementById(s);
|
|
434
434
|
n && n.setAttribute(e, t);
|
|
435
|
-
}, 10), Ut = "onSave",
|
|
435
|
+
}, 10), Ut = "onSave", rn = "changeCatalogVisible", jn = "changeFullscreen", xn = "pageFullscreenChanged", $n = "fullscreenChanged", Yt = "previewChanged", Sn = "htmlPreviewChanged", Cn = "catalogVisibleChanged", Pn = "textareaFocus", bi = (s, e) => {
|
|
436
436
|
const { editorId: t, noPrettier: n, previewOnly: i } = s, l = xe({
|
|
437
437
|
// 是否已编译成html
|
|
438
438
|
buildFinished: !1,
|
|
@@ -598,22 +598,22 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
598
598
|
"highlight",
|
|
599
599
|
ze(() => {
|
|
600
600
|
const r = {
|
|
601
|
-
...
|
|
601
|
+
...vn,
|
|
602
602
|
...n == null ? void 0 : n.css
|
|
603
603
|
}, o = s.codeStyleReverse && s.codeStyleReverseList.includes(s.previewTheme) ? "dark" : s.theme;
|
|
604
604
|
return {
|
|
605
605
|
js: (n == null ? void 0 : n.js) || li,
|
|
606
|
-
css: r[s.codeTheme] ? r[s.codeTheme][o] :
|
|
606
|
+
css: r[s.codeTheme] ? r[s.codeTheme][o] : vn.atom[o]
|
|
607
607
|
};
|
|
608
608
|
})
|
|
609
609
|
), je("historyLength", s.historyLength), je("previewOnly", t), je("showCodeRowNumber", s.showCodeRowNumber);
|
|
610
610
|
const i = ze(() => {
|
|
611
611
|
var o;
|
|
612
612
|
const r = {
|
|
613
|
-
...
|
|
613
|
+
...pn,
|
|
614
614
|
...(o = te == null ? void 0 : te.editorConfig) == null ? void 0 : o.languageUserDefined
|
|
615
615
|
};
|
|
616
|
-
return r[s.language] ? r[s.language] :
|
|
616
|
+
return r[s.language] ? r[s.language] : pn["zh-CN"];
|
|
617
617
|
});
|
|
618
618
|
je("usedLanguageText", i), je(
|
|
619
619
|
"previewTheme",
|
|
@@ -623,15 +623,15 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
623
623
|
var f, h, m, v, g, $;
|
|
624
624
|
const { noPrettier: e, previewOnly: t, noIconfont: n, noUploadImg: i } = s, { editorExtensions: l } = te, r = e || !!((h = (f = te.editorExtensions) == null ? void 0 : f.prettier) != null && h.prettierInstance), o = e || !!((v = (m = te.editorExtensions) == null ? void 0 : m.prettier) != null && v.parserMarkdownInstance), c = i || !!(($ = (g = te.editorExtensions) == null ? void 0 : g.cropper) != null && $.instance);
|
|
625
625
|
ie(() => {
|
|
626
|
-
var C,
|
|
626
|
+
var C, A, M, T;
|
|
627
627
|
const b = document.createElement("script");
|
|
628
628
|
b.src = (l == null ? void 0 : l.iconfont) || si, b.id = `${d}-icon`;
|
|
629
629
|
const k = document.createElement("script"), p = document.createElement("script");
|
|
630
|
-
k.src = ((C = l == null ? void 0 : l.prettier) == null ? void 0 : C.standaloneJs) ||
|
|
630
|
+
k.src = ((C = l == null ? void 0 : l.prettier) == null ? void 0 : C.standaloneJs) || mn.main, k.id = `${d}-prettier`, p.src = ((A = l == null ? void 0 : l.prettier) == null ? void 0 : A.parserMarkdownJs) || mn.markdown, p.id = `${d}-prettierMD`;
|
|
631
631
|
const w = document.createElement("link");
|
|
632
|
-
w.rel = "stylesheet", w.href = ((M = l == null ? void 0 : l.cropper) == null ? void 0 : M.css) ||
|
|
632
|
+
w.rel = "stylesheet", w.href = ((M = l == null ? void 0 : l.cropper) == null ? void 0 : M.css) || gn.css, w.id = `${d}-cropperCss`;
|
|
633
633
|
const S = document.createElement("script");
|
|
634
|
-
S.src = ((T = l == null ? void 0 : l.cropper) == null ? void 0 : T.js) ||
|
|
634
|
+
S.src = ((T = l == null ? void 0 : l.cropper) == null ? void 0 : T.js) || gn.js, S.id = `${d}-cropper`, n || we(b), t || (c || (we(w), we(S)), r || we(k), o || we(p));
|
|
635
635
|
});
|
|
636
636
|
}, wi = (s, e) => {
|
|
637
637
|
const { editorId: t, previewOnly: n } = s, i = xe({
|
|
@@ -664,7 +664,7 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
664
664
|
const { editorId: e } = s, t = ne(!1);
|
|
665
665
|
ie(() => {
|
|
666
666
|
x.on(e, {
|
|
667
|
-
name:
|
|
667
|
+
name: rn,
|
|
668
668
|
callback: (i) => {
|
|
669
669
|
i === void 0 ? t.value = !t.value : t.value = i;
|
|
670
670
|
}
|
|
@@ -687,7 +687,7 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
687
687
|
), G(
|
|
688
688
|
() => n.preview,
|
|
689
689
|
(o) => {
|
|
690
|
-
x.emit(l,
|
|
690
|
+
x.emit(l, Yt, o);
|
|
691
691
|
}
|
|
692
692
|
), G(
|
|
693
693
|
() => n.htmlPreview,
|
|
@@ -720,7 +720,7 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
720
720
|
}
|
|
721
721
|
case "preview": {
|
|
722
722
|
x.on(l, {
|
|
723
|
-
name:
|
|
723
|
+
name: Yt,
|
|
724
724
|
callback(f) {
|
|
725
725
|
c(f);
|
|
726
726
|
}
|
|
@@ -760,7 +760,7 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
760
760
|
i("htmlPreview", o);
|
|
761
761
|
},
|
|
762
762
|
toggleCatalog(o) {
|
|
763
|
-
x.emit(l,
|
|
763
|
+
x.emit(l, rn, o);
|
|
764
764
|
},
|
|
765
765
|
triggerSave() {
|
|
766
766
|
x.emit(l, Ut);
|
|
@@ -774,7 +774,7 @@ const x = new ci(), Pe = (s, e = 0, t = e) => new Promise((n, i) => {
|
|
|
774
774
|
};
|
|
775
775
|
e.expose(r);
|
|
776
776
|
};
|
|
777
|
-
const Si = /* @__PURE__ */
|
|
777
|
+
const Si = /* @__PURE__ */ ae({
|
|
778
778
|
setup() {
|
|
779
779
|
return () => u("div", {
|
|
780
780
|
class: `${d}-divider`
|
|
@@ -811,7 +811,7 @@ const Ci = () => ({
|
|
|
811
811
|
type: String,
|
|
812
812
|
default: "html"
|
|
813
813
|
}
|
|
814
|
-
}), ot = /* @__PURE__ */
|
|
814
|
+
}), ot = /* @__PURE__ */ ae({
|
|
815
815
|
props: Ci(),
|
|
816
816
|
setup(s, e) {
|
|
817
817
|
const t = `${d}-dropdown-hidden`, n = xe({
|
|
@@ -905,7 +905,7 @@ const Ti = () => ({
|
|
|
905
905
|
class: {
|
|
906
906
|
type: String
|
|
907
907
|
}
|
|
908
|
-
}),
|
|
908
|
+
}), an = /* @__PURE__ */ ae({
|
|
909
909
|
props: Ti(),
|
|
910
910
|
setup(s, e) {
|
|
911
911
|
const t = ne(s.visible), n = ne([`${d}-modal`]), i = ne(), l = ne();
|
|
@@ -1020,7 +1020,7 @@ const Ti = () => ({
|
|
|
1020
1020
|
default: () => {
|
|
1021
1021
|
}
|
|
1022
1022
|
}
|
|
1023
|
-
}), zi = /* @__PURE__ */
|
|
1023
|
+
}), zi = /* @__PURE__ */ ae({
|
|
1024
1024
|
props: Ei(),
|
|
1025
1025
|
setup(s) {
|
|
1026
1026
|
const e = U("usedLanguageText"), t = U("editorId"), n = ze(() => {
|
|
@@ -1041,7 +1041,7 @@ const Ti = () => ({
|
|
|
1041
1041
|
l || setTimeout(() => {
|
|
1042
1042
|
i.desc = "", i.url = "";
|
|
1043
1043
|
}, 200);
|
|
1044
|
-
}), () => u(
|
|
1044
|
+
}), () => u(an, {
|
|
1045
1045
|
title: n.value,
|
|
1046
1046
|
visible: s.visible,
|
|
1047
1047
|
onClose: s.onCancel
|
|
@@ -1106,7 +1106,7 @@ const _i = () => ({
|
|
|
1106
1106
|
default: () => {
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
1109
|
-
}), Ai = /* @__PURE__ */
|
|
1109
|
+
}), Ai = /* @__PURE__ */ ae({
|
|
1110
1110
|
props: _i(),
|
|
1111
1111
|
setup(s) {
|
|
1112
1112
|
var h, m;
|
|
@@ -1159,7 +1159,7 @@ const _i = () => ({
|
|
|
1159
1159
|
};
|
|
1160
1160
|
return () => {
|
|
1161
1161
|
var v;
|
|
1162
|
-
return u(
|
|
1162
|
+
return u(an, {
|
|
1163
1163
|
class: `${d}-modal-clip`,
|
|
1164
1164
|
title: (v = e.value.clipModalTips) == null ? void 0 : v.title,
|
|
1165
1165
|
visible: s.visible,
|
|
@@ -1257,7 +1257,7 @@ const _i = () => ({
|
|
|
1257
1257
|
default: () => {
|
|
1258
1258
|
}
|
|
1259
1259
|
}
|
|
1260
|
-
}), Li = /* @__PURE__ */
|
|
1260
|
+
}), Li = /* @__PURE__ */ ae({
|
|
1261
1261
|
props: Ii(),
|
|
1262
1262
|
setup(s) {
|
|
1263
1263
|
return () => u(Kt, null, [u(zi, {
|
|
@@ -1312,7 +1312,7 @@ const _i = () => ({
|
|
|
1312
1312
|
default: () => {
|
|
1313
1313
|
}
|
|
1314
1314
|
}
|
|
1315
|
-
}), Oi = /* @__PURE__ */
|
|
1315
|
+
}), Oi = /* @__PURE__ */ ae({
|
|
1316
1316
|
name: "TableShape",
|
|
1317
1317
|
props: Ri(),
|
|
1318
1318
|
setup(s) {
|
|
@@ -1382,7 +1382,7 @@ const _i = () => ({
|
|
|
1382
1382
|
noUploadImg: {
|
|
1383
1383
|
type: Boolean
|
|
1384
1384
|
}
|
|
1385
|
-
}), Hi = /* @__PURE__ */
|
|
1385
|
+
}), Hi = /* @__PURE__ */ ae({
|
|
1386
1386
|
name: "MDEditorToolbar",
|
|
1387
1387
|
props: Di(),
|
|
1388
1388
|
setup(s) {
|
|
@@ -1423,7 +1423,7 @@ const _i = () => ({
|
|
|
1423
1423
|
h.value.addEventListener("change", m);
|
|
1424
1424
|
});
|
|
1425
1425
|
const v = (g) => {
|
|
1426
|
-
var $, b, k, p, w, S, C,
|
|
1426
|
+
var $, b, k, p, w, S, C, A, M, T, y, X, V, q, _, O, B, W, H, se, F, D, N, ce, de, ve, Ie, He, Xe, qe, Qe, Tt, Et, nt, it, zt, _t, st, At, It, gt, hn, fn;
|
|
1427
1427
|
if (Dn.includes(g))
|
|
1428
1428
|
switch (g) {
|
|
1429
1429
|
case "-":
|
|
@@ -1512,7 +1512,7 @@ const _i = () => ({
|
|
|
1512
1512
|
onClick: () => {
|
|
1513
1513
|
r("h4");
|
|
1514
1514
|
}
|
|
1515
|
-
}, [(
|
|
1515
|
+
}, [(A = t.value.titleItem) == null ? void 0 : A.h4]), u("li", {
|
|
1516
1516
|
class: `${d}-menu-item`,
|
|
1517
1517
|
onClick: () => {
|
|
1518
1518
|
r("h5");
|
|
@@ -1592,7 +1592,7 @@ const _i = () => ({
|
|
|
1592
1592
|
case "orderedList":
|
|
1593
1593
|
return u("div", {
|
|
1594
1594
|
class: `${d}-toolbar-item`,
|
|
1595
|
-
title: (
|
|
1595
|
+
title: (_ = t.value.toolbarTips) == null ? void 0 : _.orderedList,
|
|
1596
1596
|
onClick: () => {
|
|
1597
1597
|
r("orderedList");
|
|
1598
1598
|
}
|
|
@@ -1605,7 +1605,7 @@ const _i = () => ({
|
|
|
1605
1605
|
case "task":
|
|
1606
1606
|
return u("div", {
|
|
1607
1607
|
class: `${d}-toolbar-item`,
|
|
1608
|
-
title: (
|
|
1608
|
+
title: (O = t.value.toolbarTips) == null ? void 0 : O.task,
|
|
1609
1609
|
onClick: () => {
|
|
1610
1610
|
r("task");
|
|
1611
1611
|
}
|
|
@@ -1682,12 +1682,12 @@ const _i = () => ({
|
|
|
1682
1682
|
onClick: () => {
|
|
1683
1683
|
o.type = "image", o.linkVisible = !0;
|
|
1684
1684
|
}
|
|
1685
|
-
}, [(
|
|
1685
|
+
}, [(F = t.value.imgTitleItem) == null ? void 0 : F.link]), u("li", {
|
|
1686
1686
|
class: `${d}-menu-item`,
|
|
1687
1687
|
onClick: () => {
|
|
1688
1688
|
h.value.click();
|
|
1689
1689
|
}
|
|
1690
|
-
}, [(
|
|
1690
|
+
}, [(D = t.value.imgTitleItem) == null ? void 0 : D.upload]), u("li", {
|
|
1691
1691
|
class: `${d}-menu-item`,
|
|
1692
1692
|
onClick: () => {
|
|
1693
1693
|
o.clipVisible = !0;
|
|
@@ -1740,7 +1740,7 @@ const _i = () => ({
|
|
|
1740
1740
|
case "revoke":
|
|
1741
1741
|
return u("div", {
|
|
1742
1742
|
class: `${d}-toolbar-item`,
|
|
1743
|
-
title: (
|
|
1743
|
+
title: (ce = t.value.toolbarTips) == null ? void 0 : ce.revoke,
|
|
1744
1744
|
onClick: () => {
|
|
1745
1745
|
x.emit(e, "ctrlZ");
|
|
1746
1746
|
}
|
|
@@ -1846,7 +1846,7 @@ const _i = () => ({
|
|
|
1846
1846
|
class: `${d}-toolbar-item`,
|
|
1847
1847
|
title: (Tt = t.value.toolbarTips) == null ? void 0 : Tt.catalog,
|
|
1848
1848
|
onClick: () => {
|
|
1849
|
-
x.emit(e,
|
|
1849
|
+
x.emit(e, rn);
|
|
1850
1850
|
},
|
|
1851
1851
|
key: "bar-catalog"
|
|
1852
1852
|
}, [u("svg", {
|
|
@@ -1951,12 +1951,12 @@ const _i = () => ({
|
|
|
1951
1951
|
onClick: () => {
|
|
1952
1952
|
r("katexInline");
|
|
1953
1953
|
}
|
|
1954
|
-
}, [(
|
|
1954
|
+
}, [(hn = t.value.katex) == null ? void 0 : hn.inline]), u("li", {
|
|
1955
1955
|
class: `${d}-menu-item`,
|
|
1956
1956
|
onClick: () => {
|
|
1957
1957
|
r("katexBlock");
|
|
1958
1958
|
}
|
|
1959
|
-
}, [(
|
|
1959
|
+
}, [(fn = t.value.katex) == null ? void 0 : fn.block])]),
|
|
1960
1960
|
key: "bar-katex"
|
|
1961
1961
|
}, {
|
|
1962
1962
|
default: () => {
|
|
@@ -2200,7 +2200,7 @@ function Qi(s, e) {
|
|
|
2200
2200
|
}).join(`
|
|
2201
2201
|
`);
|
|
2202
2202
|
}
|
|
2203
|
-
class
|
|
2203
|
+
class cn {
|
|
2204
2204
|
constructor(e) {
|
|
2205
2205
|
this.options = e || mt;
|
|
2206
2206
|
}
|
|
@@ -2295,14 +2295,14 @@ class un {
|
|
|
2295
2295
|
`, 1)[0].replace(/^\t+/, (C) => " ".repeat(3 * C.length)), m = e.split(`
|
|
2296
2296
|
`, 1)[0], this.options.pedantic ? (r = 2, g = h.trimLeft()) : (r = t[2].search(/[^ ]/), r = r > 4 ? 1 : r, g = h.slice(r), r += t[1].length), c = !1, !h && /^ *$/.test(m) && (n += m + `
|
|
2297
2297
|
`, e = e.substring(m.length + 1), $ = !0), !$) {
|
|
2298
|
-
const C = new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
2298
|
+
const C = new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), A = new RegExp(`^ {0,${Math.min(3, r - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), M = new RegExp(`^ {0,${Math.min(3, r - 1)}}(?:\`\`\`|~~~)`), T = new RegExp(`^ {0,${Math.min(3, r - 1)}}#`);
|
|
2299
2299
|
for (; e && (v = e.split(`
|
|
2300
|
-
`, 1)[0], m = v, this.options.pedantic && (m = m.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(M.test(m) || T.test(m) || C.test(m) ||
|
|
2300
|
+
`, 1)[0], m = v, this.options.pedantic && (m = m.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), !(M.test(m) || T.test(m) || C.test(m) || A.test(e))); ) {
|
|
2301
2301
|
if (m.search(/[^ ]/) >= r || !m.trim())
|
|
2302
2302
|
g += `
|
|
2303
2303
|
` + m.slice(r);
|
|
2304
2304
|
else {
|
|
2305
|
-
if (c || h.search(/[^ ]/) >= 4 || M.test(h) || T.test(h) ||
|
|
2305
|
+
if (c || h.search(/[^ ]/) >= 4 || M.test(h) || T.test(h) || A.test(h))
|
|
2306
2306
|
break;
|
|
2307
2307
|
g += `
|
|
2308
2308
|
` + m;
|
|
@@ -2324,8 +2324,8 @@ class un {
|
|
|
2324
2324
|
const S = p.items.length;
|
|
2325
2325
|
for (o = 0; o < S; o++)
|
|
2326
2326
|
if (this.lexer.state.top = !1, p.items[o].tokens = this.lexer.blockTokens(p.items[o].text, []), !p.loose) {
|
|
2327
|
-
const C = p.items[o].tokens.filter((M) => M.type === "space"),
|
|
2328
|
-
p.loose =
|
|
2327
|
+
const C = p.items[o].tokens.filter((M) => M.type === "space"), A = C.length > 0 && C.some((M) => /\n.*\n/.test(M.raw));
|
|
2328
|
+
p.loose = A;
|
|
2329
2329
|
}
|
|
2330
2330
|
if (p.loose)
|
|
2331
2331
|
for (o = 0; o < S; o++)
|
|
@@ -2617,7 +2617,7 @@ class un {
|
|
|
2617
2617
|
}
|
|
2618
2618
|
}
|
|
2619
2619
|
}
|
|
2620
|
-
const
|
|
2620
|
+
const L = {
|
|
2621
2621
|
newline: /^(?: *(?:\n|$))+/,
|
|
2622
2622
|
code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
|
|
2623
2623
|
fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
|
|
@@ -2634,35 +2634,35 @@ const R = {
|
|
|
2634
2634
|
_paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,
|
|
2635
2635
|
text: /^[^\n]+/
|
|
2636
2636
|
};
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2637
|
+
L._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
|
|
2638
|
+
L._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
|
|
2639
|
+
L.def = Z(L.def).replace("label", L._label).replace("title", L._title).getRegex();
|
|
2640
|
+
L.bullet = /(?:[*+-]|\d{1,9}[.)])/;
|
|
2641
|
+
L.listItemStart = Z(/^( *)(bull) */).replace("bull", L.bullet).getRegex();
|
|
2642
|
+
L.list = Z(L.list).replace(/bull/g, L.bullet).replace("hr", "\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def", "\\n+(?=" + L.def.source + ")").getRegex();
|
|
2643
|
+
L._tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
|
|
2644
|
+
L._comment = /<!--(?!-?>)[\s\S]*?(?:-->|$)/;
|
|
2645
|
+
L.html = Z(L.html, "i").replace("comment", L._comment).replace("tag", L._tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
|
|
2646
|
+
L.paragraph = Z(L._paragraph).replace("hr", L.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", L._tag).getRegex();
|
|
2647
|
+
L.blockquote = Z(L.blockquote).replace("paragraph", L.paragraph).getRegex();
|
|
2648
|
+
L.normal = Ae({}, L);
|
|
2649
|
+
L.gfm = Ae({}, L.normal, {
|
|
2650
2650
|
table: "^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"
|
|
2651
2651
|
// Cells
|
|
2652
2652
|
});
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2653
|
+
L.gfm.table = Z(L.gfm.table).replace("hr", L.hr).replace("heading", " {0,3}#{1,6} ").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", L._tag).getRegex();
|
|
2654
|
+
L.gfm.paragraph = Z(L._paragraph).replace("hr", L.hr).replace("heading", " {0,3}#{1,6} ").replace("|lheading", "").replace("table", L.gfm.table).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", L._tag).getRegex();
|
|
2655
|
+
L.pedantic = Ae({}, L.normal, {
|
|
2656
2656
|
html: Z(
|
|
2657
2657
|
`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`
|
|
2658
|
-
).replace("comment",
|
|
2658
|
+
).replace("comment", L._comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
2659
2659
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
2660
2660
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
2661
2661
|
fences: qt,
|
|
2662
2662
|
// fences not supported
|
|
2663
2663
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
2664
|
-
paragraph: Z(
|
|
2665
|
-
]`).replace("lheading",
|
|
2664
|
+
paragraph: Z(L.normal._paragraph).replace("hr", L.hr).replace("heading", ` *#{1,6} *[^
|
|
2665
|
+
]`).replace("lheading", L.lheading).replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").getRegex()
|
|
2666
2666
|
});
|
|
2667
2667
|
const E = {
|
|
2668
2668
|
escape: /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,
|
|
@@ -2692,7 +2692,7 @@ E._punctuation = "!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";
|
|
|
2692
2692
|
E.punctuation = Z(E.punctuation).replace(/punctuation/g, E._punctuation).getRegex();
|
|
2693
2693
|
E.blockSkip = /\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;
|
|
2694
2694
|
E.escapedEmSt = /(?:^|[^\\])(?:\\\\)*\\[*_]/g;
|
|
2695
|
-
E._comment = Z(
|
|
2695
|
+
E._comment = Z(L._comment).replace("(?:-->|$)", "-->").getRegex();
|
|
2696
2696
|
E.emStrong.lDelim = Z(E.emStrong.lDelim).replace(/punct/g, E._punctuation).getRegex();
|
|
2697
2697
|
E.emStrong.rDelimAst = Z(E.emStrong.rDelimAst, "g").replace(/punct/g, E._punctuation).getRegex();
|
|
2698
2698
|
E.emStrong.rDelimUnd = Z(E.emStrong.rDelimUnd, "g").replace(/punct/g, E._punctuation).getRegex();
|
|
@@ -2706,8 +2706,8 @@ E._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;
|
|
|
2706
2706
|
E._href = /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;
|
|
2707
2707
|
E._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;
|
|
2708
2708
|
E.link = Z(E.link).replace("label", E._label).replace("href", E._href).replace("title", E._title).getRegex();
|
|
2709
|
-
E.reflink = Z(E.reflink).replace("label", E._label).replace("ref",
|
|
2710
|
-
E.nolink = Z(E.nolink).replace("ref",
|
|
2709
|
+
E.reflink = Z(E.reflink).replace("label", E._label).replace("ref", L._label).getRegex();
|
|
2710
|
+
E.nolink = Z(E.nolink).replace("ref", L._label).getRegex();
|
|
2711
2711
|
E.reflinkSearch = Z(E.reflinkSearch, "g").replace("reflink", E.reflink).replace("nolink", E.nolink).getRegex();
|
|
2712
2712
|
E.normal = Ae({}, E);
|
|
2713
2713
|
E.pedantic = Ae({}, E.normal, {
|
|
@@ -2751,23 +2751,23 @@ function In(s) {
|
|
|
2751
2751
|
}
|
|
2752
2752
|
class Ue {
|
|
2753
2753
|
constructor(e) {
|
|
2754
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || mt, this.options.tokenizer = this.options.tokenizer || new
|
|
2754
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || mt, this.options.tokenizer = this.options.tokenizer || new cn(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
2755
2755
|
inLink: !1,
|
|
2756
2756
|
inRawBlock: !1,
|
|
2757
2757
|
top: !0
|
|
2758
2758
|
};
|
|
2759
2759
|
const t = {
|
|
2760
|
-
block:
|
|
2760
|
+
block: L.normal,
|
|
2761
2761
|
inline: E.normal
|
|
2762
2762
|
};
|
|
2763
|
-
this.options.pedantic ? (t.block =
|
|
2763
|
+
this.options.pedantic ? (t.block = L.pedantic, t.inline = E.pedantic) : this.options.gfm && (t.block = L.gfm, this.options.breaks ? t.inline = E.breaks : t.inline = E.gfm), this.tokenizer.rules = t;
|
|
2764
2764
|
}
|
|
2765
2765
|
/**
|
|
2766
2766
|
* Expose Rules
|
|
2767
2767
|
*/
|
|
2768
2768
|
static get rules() {
|
|
2769
2769
|
return {
|
|
2770
|
-
block:
|
|
2770
|
+
block: L,
|
|
2771
2771
|
inline: E
|
|
2772
2772
|
};
|
|
2773
2773
|
}
|
|
@@ -2969,7 +2969,7 @@ class Ue {
|
|
|
2969
2969
|
return t;
|
|
2970
2970
|
}
|
|
2971
2971
|
}
|
|
2972
|
-
class
|
|
2972
|
+
class un {
|
|
2973
2973
|
constructor(e) {
|
|
2974
2974
|
this.options = e || mt;
|
|
2975
2975
|
}
|
|
@@ -3184,7 +3184,7 @@ class Wn {
|
|
|
3184
3184
|
}
|
|
3185
3185
|
class De {
|
|
3186
3186
|
constructor(e) {
|
|
3187
|
-
this.options = e || mt, this.options.renderer = this.options.renderer || new
|
|
3187
|
+
this.options = e || mt, this.options.renderer = this.options.renderer || new un(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new Vn(), this.slugger = new Wn();
|
|
3188
3188
|
}
|
|
3189
3189
|
/**
|
|
3190
3190
|
* Static Parse Method
|
|
@@ -3202,7 +3202,7 @@ class De {
|
|
|
3202
3202
|
* Parse Loop
|
|
3203
3203
|
*/
|
|
3204
3204
|
parse(e, t = !0) {
|
|
3205
|
-
let n = "", i, l, r, o, c, f, h, m, v, g, $, b, k, p, w, S, C,
|
|
3205
|
+
let n = "", i, l, r, o, c, f, h, m, v, g, $, b, k, p, w, S, C, A, M;
|
|
3206
3206
|
const T = e.length;
|
|
3207
3207
|
for (i = 0; i < T; i++) {
|
|
3208
3208
|
if (g = e[i], this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[g.type] && (M = this.options.extensions.renderers[g.type].call({ parser: this }, g), M !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(g.type))) {
|
|
@@ -3256,10 +3256,10 @@ class De {
|
|
|
3256
3256
|
}
|
|
3257
3257
|
case "list": {
|
|
3258
3258
|
for ($ = g.ordered, b = g.start, k = g.loose, o = g.items.length, v = "", l = 0; l < o; l++)
|
|
3259
|
-
w = g.items[l], S = w.checked, C = w.task, p = "", w.task && (
|
|
3259
|
+
w = g.items[l], S = w.checked, C = w.task, p = "", w.task && (A = this.renderer.checkbox(S), k ? w.tokens.length > 0 && w.tokens[0].type === "paragraph" ? (w.tokens[0].text = A + " " + w.tokens[0].text, w.tokens[0].tokens && w.tokens[0].tokens.length > 0 && w.tokens[0].tokens[0].type === "text" && (w.tokens[0].tokens[0].text = A + " " + w.tokens[0].tokens[0].text)) : w.tokens.unshift({
|
|
3260
3260
|
type: "text",
|
|
3261
|
-
text:
|
|
3262
|
-
}) : p +=
|
|
3261
|
+
text: A
|
|
3262
|
+
}) : p += A), p += this.parse(w.tokens, k), v += this.renderer.listitem(p, C, S);
|
|
3263
3263
|
n += this.renderer.list(v, $, b);
|
|
3264
3264
|
continue;
|
|
3265
3265
|
}
|
|
@@ -3437,7 +3437,7 @@ z.use = function(...s) {
|
|
|
3437
3437
|
}
|
|
3438
3438
|
i.childTokens && (e.childTokens[i.name] = i.childTokens);
|
|
3439
3439
|
}), n.extensions = e), t.renderer) {
|
|
3440
|
-
const i = z.defaults.renderer || new
|
|
3440
|
+
const i = z.defaults.renderer || new un();
|
|
3441
3441
|
for (const l in t.renderer) {
|
|
3442
3442
|
const r = i[l];
|
|
3443
3443
|
i[l] = (...o) => {
|
|
@@ -3448,7 +3448,7 @@ z.use = function(...s) {
|
|
|
3448
3448
|
n.renderer = i;
|
|
3449
3449
|
}
|
|
3450
3450
|
if (t.tokenizer) {
|
|
3451
|
-
const i = z.defaults.tokenizer || new
|
|
3451
|
+
const i = z.defaults.tokenizer || new cn();
|
|
3452
3452
|
for (const l in t.tokenizer) {
|
|
3453
3453
|
const r = i[l];
|
|
3454
3454
|
i[l] = (...o) => {
|
|
@@ -3509,11 +3509,11 @@ Please report this to https://github.com/markedjs/marked.`, e.silent)
|
|
|
3509
3509
|
};
|
|
3510
3510
|
z.Parser = De;
|
|
3511
3511
|
z.parser = De.parse;
|
|
3512
|
-
z.Renderer =
|
|
3512
|
+
z.Renderer = un;
|
|
3513
3513
|
z.TextRenderer = Vn;
|
|
3514
3514
|
z.Lexer = Ue;
|
|
3515
3515
|
z.lexer = Ue.lex;
|
|
3516
|
-
z.Tokenizer =
|
|
3516
|
+
z.Tokenizer = cn;
|
|
3517
3517
|
z.Slugger = Wn;
|
|
3518
3518
|
z.parse = z;
|
|
3519
3519
|
z.options;
|
|
@@ -3626,43 +3626,43 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
3626
3626
|
var i = document.createEvent("CustomEvent");
|
|
3627
3627
|
return i.initCustomEvent(e, n.bubbles, n.cancelable, n.detail), i;
|
|
3628
3628
|
}, rs = function s(e) {
|
|
3629
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = window.Promise || function(
|
|
3630
|
-
function
|
|
3629
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = window.Promise || function(_) {
|
|
3630
|
+
function O() {
|
|
3631
3631
|
}
|
|
3632
|
-
|
|
3633
|
-
}, i = function(
|
|
3634
|
-
var
|
|
3635
|
-
if (
|
|
3632
|
+
_(O, O);
|
|
3633
|
+
}, i = function(_) {
|
|
3634
|
+
var O = _.target;
|
|
3635
|
+
if (O === X) {
|
|
3636
3636
|
$();
|
|
3637
3637
|
return;
|
|
3638
3638
|
}
|
|
3639
|
-
S.indexOf(
|
|
3639
|
+
S.indexOf(O) !== -1 && b({ target: O });
|
|
3640
3640
|
}, l = function() {
|
|
3641
|
-
if (!(
|
|
3642
|
-
var
|
|
3643
|
-
Math.abs(M -
|
|
3641
|
+
if (!(A || !y.original)) {
|
|
3642
|
+
var _ = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
3643
|
+
Math.abs(M - _) > T.scrollOffset && setTimeout($, 150);
|
|
3644
3644
|
}
|
|
3645
|
-
}, r = function(
|
|
3646
|
-
var
|
|
3647
|
-
(
|
|
3645
|
+
}, r = function(_) {
|
|
3646
|
+
var O = _.key || _.keyCode;
|
|
3647
|
+
(O === "Escape" || O === "Esc" || O === 27) && $();
|
|
3648
3648
|
}, o = function() {
|
|
3649
|
-
var
|
|
3650
|
-
if (
|
|
3651
|
-
var B = Dt(
|
|
3652
|
-
|
|
3649
|
+
var _ = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, O = _;
|
|
3650
|
+
if (_.background && (X.style.background = _.background), _.container && _.container instanceof Object && (O.container = Ye({}, T.container, _.container)), _.template) {
|
|
3651
|
+
var B = Dt(_.template) ? _.template : document.querySelector(_.template);
|
|
3652
|
+
O.template = B;
|
|
3653
3653
|
}
|
|
3654
|
-
return T = Ye({}, T,
|
|
3654
|
+
return T = Ye({}, T, O), S.forEach(function(W) {
|
|
3655
3655
|
W.dispatchEvent(lt("medium-zoom:update", {
|
|
3656
3656
|
detail: { zoom: V }
|
|
3657
3657
|
}));
|
|
3658
3658
|
}), V;
|
|
3659
3659
|
}, c = function() {
|
|
3660
|
-
var
|
|
3661
|
-
return s(Ye({}, T,
|
|
3660
|
+
var _ = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3661
|
+
return s(Ye({}, T, _));
|
|
3662
3662
|
}, f = function() {
|
|
3663
|
-
for (var
|
|
3664
|
-
|
|
3665
|
-
var W =
|
|
3663
|
+
for (var _ = arguments.length, O = Array(_), B = 0; B < _; B++)
|
|
3664
|
+
O[B] = arguments[B];
|
|
3665
|
+
var W = O.reduce(function(H, se) {
|
|
3666
3666
|
return [].concat(H, Rn(se));
|
|
3667
3667
|
}, []);
|
|
3668
3668
|
return W.filter(function(H) {
|
|
@@ -3670,16 +3670,16 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
3670
3670
|
}).forEach(function(H) {
|
|
3671
3671
|
S.push(H), H.classList.add("medium-zoom-image");
|
|
3672
3672
|
}), C.forEach(function(H) {
|
|
3673
|
-
var se = H.type,
|
|
3673
|
+
var se = H.type, F = H.listener, D = H.options;
|
|
3674
3674
|
W.forEach(function(N) {
|
|
3675
|
-
N.addEventListener(se,
|
|
3675
|
+
N.addEventListener(se, F, D);
|
|
3676
3676
|
});
|
|
3677
3677
|
}), V;
|
|
3678
3678
|
}, h = function() {
|
|
3679
|
-
for (var
|
|
3680
|
-
|
|
3679
|
+
for (var _ = arguments.length, O = Array(_), B = 0; B < _; B++)
|
|
3680
|
+
O[B] = arguments[B];
|
|
3681
3681
|
y.zoomed && $();
|
|
3682
|
-
var W =
|
|
3682
|
+
var W = O.length > 0 ? O.reduce(function(H, se) {
|
|
3683
3683
|
return [].concat(H, Rn(se));
|
|
3684
3684
|
}, []) : S;
|
|
3685
3685
|
return W.forEach(function(H) {
|
|
@@ -3689,20 +3689,20 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
3689
3689
|
}), S = S.filter(function(H) {
|
|
3690
3690
|
return W.indexOf(H) === -1;
|
|
3691
3691
|
}), V;
|
|
3692
|
-
}, m = function(
|
|
3692
|
+
}, m = function(_, O) {
|
|
3693
3693
|
var B = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
3694
3694
|
return S.forEach(function(W) {
|
|
3695
|
-
W.addEventListener("medium-zoom:" +
|
|
3696
|
-
}), C.push({ type: "medium-zoom:" +
|
|
3697
|
-
}, v = function(
|
|
3695
|
+
W.addEventListener("medium-zoom:" + _, O, B);
|
|
3696
|
+
}), C.push({ type: "medium-zoom:" + _, listener: O, options: B }), V;
|
|
3697
|
+
}, v = function(_, O) {
|
|
3698
3698
|
var B = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
3699
3699
|
return S.forEach(function(W) {
|
|
3700
|
-
W.removeEventListener("medium-zoom:" +
|
|
3700
|
+
W.removeEventListener("medium-zoom:" + _, O, B);
|
|
3701
3701
|
}), C = C.filter(function(W) {
|
|
3702
|
-
return !(W.type === "medium-zoom:" +
|
|
3702
|
+
return !(W.type === "medium-zoom:" + _ && W.listener.toString() === O.toString());
|
|
3703
3703
|
}), V;
|
|
3704
3704
|
}, g = function() {
|
|
3705
|
-
var
|
|
3705
|
+
var _ = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, O = _.target, B = function() {
|
|
3706
3706
|
var H = {
|
|
3707
3707
|
width: document.documentElement.clientWidth,
|
|
3708
3708
|
height: document.documentElement.clientHeight,
|
|
@@ -3710,30 +3710,30 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
3710
3710
|
top: 0,
|
|
3711
3711
|
right: 0,
|
|
3712
3712
|
bottom: 0
|
|
3713
|
-
}, se = void 0,
|
|
3713
|
+
}, se = void 0, F = void 0;
|
|
3714
3714
|
if (T.container)
|
|
3715
3715
|
if (T.container instanceof Object)
|
|
3716
|
-
H = Ye({}, H, T.container), se = H.width - H.left - H.right - T.margin * 2,
|
|
3716
|
+
H = Ye({}, H, T.container), se = H.width - H.left - H.right - T.margin * 2, F = H.height - H.top - H.bottom - T.margin * 2;
|
|
3717
3717
|
else {
|
|
3718
|
-
var
|
|
3718
|
+
var D = Dt(T.container) ? T.container : document.querySelector(T.container), N = D.getBoundingClientRect(), ce = N.width, de = N.height, ve = N.left, Ie = N.top;
|
|
3719
3719
|
H = Ye({}, H, {
|
|
3720
|
-
width:
|
|
3720
|
+
width: ce,
|
|
3721
3721
|
height: de,
|
|
3722
3722
|
left: ve,
|
|
3723
3723
|
top: Ie
|
|
3724
3724
|
});
|
|
3725
3725
|
}
|
|
3726
|
-
se = se || H.width - T.margin * 2,
|
|
3727
|
-
var He = y.zoomedHd || y.original, Xe = Fn(He) ? se : He.naturalWidth || se, qe = Fn(He) ?
|
|
3726
|
+
se = se || H.width - T.margin * 2, F = F || H.height - T.margin * 2;
|
|
3727
|
+
var He = y.zoomedHd || y.original, Xe = Fn(He) ? se : He.naturalWidth || se, qe = Fn(He) ? F : He.naturalHeight || F, Qe = He.getBoundingClientRect(), Tt = Qe.top, Et = Qe.left, nt = Qe.width, it = Qe.height, zt = Math.min(Math.max(nt, Xe), se) / nt, _t = Math.min(Math.max(it, qe), F) / it, st = Math.min(zt, _t), At = (-Et + (se - nt) / 2 + T.margin + H.left) / st, It = (-Tt + (F - it) / 2 + T.margin + H.top) / st, gt = "scale(" + st + ") translate3d(" + At + "px, " + It + "px, 0)";
|
|
3728
3728
|
y.zoomed.style.transform = gt, y.zoomedHd && (y.zoomedHd.style.transform = gt);
|
|
3729
3729
|
};
|
|
3730
3730
|
return new n(function(W) {
|
|
3731
|
-
if (
|
|
3731
|
+
if (O && S.indexOf(O) === -1) {
|
|
3732
3732
|
W(V);
|
|
3733
3733
|
return;
|
|
3734
3734
|
}
|
|
3735
|
-
var H = function
|
|
3736
|
-
|
|
3735
|
+
var H = function ce() {
|
|
3736
|
+
A = !1, y.zoomed.removeEventListener("transitionend", ce), y.original.dispatchEvent(lt("medium-zoom:opened", {
|
|
3737
3737
|
detail: { zoom: V }
|
|
3738
3738
|
})), W(V);
|
|
3739
3739
|
};
|
|
@@ -3741,8 +3741,8 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
3741
3741
|
W(V);
|
|
3742
3742
|
return;
|
|
3743
3743
|
}
|
|
3744
|
-
if (
|
|
3745
|
-
y.original =
|
|
3744
|
+
if (O)
|
|
3745
|
+
y.original = O;
|
|
3746
3746
|
else if (S.length > 0) {
|
|
3747
3747
|
var se = S;
|
|
3748
3748
|
y.original = se[0];
|
|
@@ -3752,18 +3752,18 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
3752
3752
|
}
|
|
3753
3753
|
if (y.original.dispatchEvent(lt("medium-zoom:open", {
|
|
3754
3754
|
detail: { zoom: V }
|
|
3755
|
-
})), M = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0,
|
|
3756
|
-
var
|
|
3757
|
-
y.template = document.createElement("div"), y.template.appendChild(
|
|
3755
|
+
})), M = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, A = !0, y.zoomed = os(y.original), document.body.appendChild(X), T.template) {
|
|
3756
|
+
var F = Dt(T.template) ? T.template : document.querySelector(T.template);
|
|
3757
|
+
y.template = document.createElement("div"), y.template.appendChild(F.content.cloneNode(!0)), document.body.appendChild(y.template);
|
|
3758
3758
|
}
|
|
3759
3759
|
if (y.original.parentElement && y.original.parentElement.tagName === "PICTURE" && y.original.currentSrc && (y.zoomed.src = y.original.currentSrc), document.body.appendChild(y.zoomed), window.requestAnimationFrame(function() {
|
|
3760
3760
|
document.body.classList.add("medium-zoom--opened");
|
|
3761
3761
|
}), y.original.classList.add("medium-zoom-image--hidden"), y.zoomed.classList.add("medium-zoom-image--opened"), y.zoomed.addEventListener("click", $), y.zoomed.addEventListener("transitionend", H), y.original.getAttribute("data-zoom-src")) {
|
|
3762
3762
|
y.zoomedHd = y.zoomed.cloneNode(), y.zoomedHd.removeAttribute("srcset"), y.zoomedHd.removeAttribute("sizes"), y.zoomedHd.removeAttribute("loading"), y.zoomedHd.src = y.zoomed.getAttribute("data-zoom-src"), y.zoomedHd.onerror = function() {
|
|
3763
|
-
clearInterval(
|
|
3763
|
+
clearInterval(D), console.warn("Unable to reach the zoom image target " + y.zoomedHd.src), y.zoomedHd = null, B();
|
|
3764
3764
|
};
|
|
3765
|
-
var
|
|
3766
|
-
y.zoomedHd.complete && (clearInterval(
|
|
3765
|
+
var D = setInterval(function() {
|
|
3766
|
+
y.zoomedHd.complete && (clearInterval(D), y.zoomedHd.classList.add("medium-zoom-image--opened"), y.zoomedHd.addEventListener("click", $), document.body.appendChild(y.zoomedHd), B());
|
|
3767
3767
|
}, 10);
|
|
3768
3768
|
} else if (y.original.hasAttribute("srcset")) {
|
|
3769
3769
|
y.zoomedHd = y.zoomed.cloneNode(), y.zoomedHd.removeAttribute("sizes"), y.zoomedHd.removeAttribute("loading");
|
|
@@ -3774,30 +3774,30 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
3774
3774
|
B();
|
|
3775
3775
|
});
|
|
3776
3776
|
}, $ = function() {
|
|
3777
|
-
return new n(function(
|
|
3778
|
-
if (
|
|
3779
|
-
|
|
3777
|
+
return new n(function(_) {
|
|
3778
|
+
if (A || !y.original) {
|
|
3779
|
+
_(V);
|
|
3780
3780
|
return;
|
|
3781
3781
|
}
|
|
3782
|
-
var
|
|
3783
|
-
y.original.classList.remove("medium-zoom-image--hidden"), document.body.removeChild(y.zoomed), y.zoomedHd && document.body.removeChild(y.zoomedHd), document.body.removeChild(X), y.zoomed.classList.remove("medium-zoom-image--opened"), y.template && document.body.removeChild(y.template),
|
|
3782
|
+
var O = function B() {
|
|
3783
|
+
y.original.classList.remove("medium-zoom-image--hidden"), document.body.removeChild(y.zoomed), y.zoomedHd && document.body.removeChild(y.zoomedHd), document.body.removeChild(X), y.zoomed.classList.remove("medium-zoom-image--opened"), y.template && document.body.removeChild(y.template), A = !1, y.zoomed.removeEventListener("transitionend", B), y.original.dispatchEvent(lt("medium-zoom:closed", {
|
|
3784
3784
|
detail: { zoom: V }
|
|
3785
|
-
})), y.original = null, y.zoomed = null, y.zoomedHd = null, y.template = null,
|
|
3785
|
+
})), y.original = null, y.zoomed = null, y.zoomedHd = null, y.template = null, _(V);
|
|
3786
3786
|
};
|
|
3787
|
-
|
|
3787
|
+
A = !0, document.body.classList.remove("medium-zoom--opened"), y.zoomed.style.transform = "", y.zoomedHd && (y.zoomedHd.style.transform = ""), y.template && (y.template.style.transition = "opacity 150ms", y.template.style.opacity = 0), y.original.dispatchEvent(lt("medium-zoom:close", {
|
|
3788
3788
|
detail: { zoom: V }
|
|
3789
|
-
})), y.zoomed.addEventListener("transitionend",
|
|
3789
|
+
})), y.zoomed.addEventListener("transitionend", O);
|
|
3790
3790
|
});
|
|
3791
3791
|
}, b = function() {
|
|
3792
|
-
var
|
|
3793
|
-
return y.original ? $() : g({ target:
|
|
3792
|
+
var _ = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, O = _.target;
|
|
3793
|
+
return y.original ? $() : g({ target: O });
|
|
3794
3794
|
}, k = function() {
|
|
3795
3795
|
return T;
|
|
3796
3796
|
}, p = function() {
|
|
3797
3797
|
return S;
|
|
3798
3798
|
}, w = function() {
|
|
3799
3799
|
return y.original;
|
|
3800
|
-
}, S = [], C = [],
|
|
3800
|
+
}, S = [], C = [], A = !1, M = 0, T = t, y = {
|
|
3801
3801
|
original: null,
|
|
3802
3802
|
zoomed: null,
|
|
3803
3803
|
zoomedHd: null,
|
|
@@ -3850,8 +3850,8 @@ class Ht extends Array {
|
|
|
3850
3850
|
var at;
|
|
3851
3851
|
const rt = class {
|
|
3852
3852
|
constructor(e, t) {
|
|
3853
|
-
|
|
3854
|
-
|
|
3853
|
+
le(this, "heap");
|
|
3854
|
+
le(this, "length");
|
|
3855
3855
|
if (!a(rt, at))
|
|
3856
3856
|
throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
3857
3857
|
this.heap = new t(e), this.length = 0;
|
|
@@ -3860,9 +3860,9 @@ const rt = class {
|
|
|
3860
3860
|
const t = Gn(e);
|
|
3861
3861
|
if (!t)
|
|
3862
3862
|
return [];
|
|
3863
|
-
|
|
3863
|
+
R(rt, at, !0);
|
|
3864
3864
|
const n = new rt(e, t);
|
|
3865
|
-
return
|
|
3865
|
+
return R(rt, at, !1), n;
|
|
3866
3866
|
}
|
|
3867
3867
|
push(e) {
|
|
3868
3868
|
this.heap[this.length++] = e;
|
|
@@ -3874,8 +3874,8 @@ const rt = class {
|
|
|
3874
3874
|
let jt = rt;
|
|
3875
3875
|
at = new WeakMap(), // private constructor
|
|
3876
3876
|
P(jt, at, !1);
|
|
3877
|
-
var $e, be, Le, Se, ct,
|
|
3878
|
-
const
|
|
3877
|
+
var $e, be, Le, Se, ct, oe, Ce, re, Q, j, ge, ke, me, ue, Te, he, Me, Be, Ee, Fe, Ge, pe, yt, en, Je, Ne, wt, ye, Wt, Zn, et, ut, xt, Re, We, Oe, Ke, $t, tn, dt, Pt, ht, Mt, Y, ee, St, nn, tt, kt;
|
|
3878
|
+
const dn = class {
|
|
3879
3879
|
constructor(e) {
|
|
3880
3880
|
P(this, yt);
|
|
3881
3881
|
P(this, Wt);
|
|
@@ -3898,67 +3898,67 @@ const hn = class {
|
|
|
3898
3898
|
/**
|
|
3899
3899
|
* {@link LRUCache.OptionsBase.ttl}
|
|
3900
3900
|
*/
|
|
3901
|
-
|
|
3901
|
+
le(this, "ttl");
|
|
3902
3902
|
/**
|
|
3903
3903
|
* {@link LRUCache.OptionsBase.ttlResolution}
|
|
3904
3904
|
*/
|
|
3905
|
-
|
|
3905
|
+
le(this, "ttlResolution");
|
|
3906
3906
|
/**
|
|
3907
3907
|
* {@link LRUCache.OptionsBase.ttlAutopurge}
|
|
3908
3908
|
*/
|
|
3909
|
-
|
|
3909
|
+
le(this, "ttlAutopurge");
|
|
3910
3910
|
/**
|
|
3911
3911
|
* {@link LRUCache.OptionsBase.updateAgeOnGet}
|
|
3912
3912
|
*/
|
|
3913
|
-
|
|
3913
|
+
le(this, "updateAgeOnGet");
|
|
3914
3914
|
/**
|
|
3915
3915
|
* {@link LRUCache.OptionsBase.updateAgeOnHas}
|
|
3916
3916
|
*/
|
|
3917
|
-
|
|
3917
|
+
le(this, "updateAgeOnHas");
|
|
3918
3918
|
/**
|
|
3919
3919
|
* {@link LRUCache.OptionsBase.allowStale}
|
|
3920
3920
|
*/
|
|
3921
|
-
|
|
3921
|
+
le(this, "allowStale");
|
|
3922
3922
|
/**
|
|
3923
3923
|
* {@link LRUCache.OptionsBase.noDisposeOnSet}
|
|
3924
3924
|
*/
|
|
3925
|
-
|
|
3925
|
+
le(this, "noDisposeOnSet");
|
|
3926
3926
|
/**
|
|
3927
3927
|
* {@link LRUCache.OptionsBase.noUpdateTTL}
|
|
3928
3928
|
*/
|
|
3929
|
-
|
|
3929
|
+
le(this, "noUpdateTTL");
|
|
3930
3930
|
/**
|
|
3931
3931
|
* {@link LRUCache.OptionsBase.maxEntrySize}
|
|
3932
3932
|
*/
|
|
3933
|
-
|
|
3933
|
+
le(this, "maxEntrySize");
|
|
3934
3934
|
/**
|
|
3935
3935
|
* {@link LRUCache.OptionsBase.sizeCalculation}
|
|
3936
3936
|
*/
|
|
3937
|
-
|
|
3937
|
+
le(this, "sizeCalculation");
|
|
3938
3938
|
/**
|
|
3939
3939
|
* {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
|
|
3940
3940
|
*/
|
|
3941
|
-
|
|
3941
|
+
le(this, "noDeleteOnFetchRejection");
|
|
3942
3942
|
/**
|
|
3943
3943
|
* {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
|
|
3944
3944
|
*/
|
|
3945
|
-
|
|
3945
|
+
le(this, "noDeleteOnStaleGet");
|
|
3946
3946
|
/**
|
|
3947
3947
|
* {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
|
|
3948
3948
|
*/
|
|
3949
|
-
|
|
3949
|
+
le(this, "allowStaleOnFetchAbort");
|
|
3950
3950
|
/**
|
|
3951
3951
|
* {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
|
|
3952
3952
|
*/
|
|
3953
|
-
|
|
3953
|
+
le(this, "allowStaleOnFetchRejection");
|
|
3954
3954
|
/**
|
|
3955
3955
|
* {@link LRUCache.OptionsBase.ignoreFetchAbort}
|
|
3956
3956
|
*/
|
|
3957
|
-
|
|
3957
|
+
le(this, "ignoreFetchAbort");
|
|
3958
3958
|
// computed properties
|
|
3959
|
-
P(this,
|
|
3959
|
+
P(this, oe, void 0);
|
|
3960
3960
|
P(this, Ce, void 0);
|
|
3961
|
-
P(this,
|
|
3961
|
+
P(this, re, void 0);
|
|
3962
3962
|
P(this, Q, void 0);
|
|
3963
3963
|
P(this, j, void 0);
|
|
3964
3964
|
P(this, ge, void 0);
|
|
@@ -3991,13 +3991,13 @@ const hn = class {
|
|
|
3991
3991
|
throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");
|
|
3992
3992
|
return 0;
|
|
3993
3993
|
});
|
|
3994
|
-
const { max: t = 0, ttl: n, ttlResolution: i = 1, ttlAutopurge: l, updateAgeOnGet: r, updateAgeOnHas: o, allowStale: c, dispose: f, disposeAfter: h, noDisposeOnSet: m, noUpdateTTL: v, maxSize: g = 0, maxEntrySize: $ = 0, sizeCalculation: b, fetchMethod: k, noDeleteOnFetchRejection: p, noDeleteOnStaleGet: w, allowStaleOnFetchRejection: S, allowStaleOnFetchAbort: C, ignoreFetchAbort:
|
|
3994
|
+
const { max: t = 0, ttl: n, ttlResolution: i = 1, ttlAutopurge: l, updateAgeOnGet: r, updateAgeOnHas: o, allowStale: c, dispose: f, disposeAfter: h, noDisposeOnSet: m, noUpdateTTL: v, maxSize: g = 0, maxEntrySize: $ = 0, sizeCalculation: b, fetchMethod: k, noDeleteOnFetchRejection: p, noDeleteOnStaleGet: w, allowStaleOnFetchRejection: S, allowStaleOnFetchAbort: C, ignoreFetchAbort: A } = e;
|
|
3995
3995
|
if (t !== 0 && !Ve(t))
|
|
3996
3996
|
throw new TypeError("max option must be a nonnegative integer");
|
|
3997
3997
|
const M = t ? Gn(t) : Array;
|
|
3998
3998
|
if (!M)
|
|
3999
3999
|
throw new Error("invalid max value: " + t);
|
|
4000
|
-
if (
|
|
4000
|
+
if (R(this, $e, t), R(this, be, g), this.maxEntrySize = $ || a(this, be), this.sizeCalculation = b, this.sizeCalculation) {
|
|
4001
4001
|
if (!a(this, be) && !this.maxEntrySize)
|
|
4002
4002
|
throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");
|
|
4003
4003
|
if (typeof this.sizeCalculation != "function")
|
|
@@ -4005,23 +4005,23 @@ const hn = class {
|
|
|
4005
4005
|
}
|
|
4006
4006
|
if (k !== void 0 && typeof k != "function")
|
|
4007
4007
|
throw new TypeError("fetchMethod must be a function if specified");
|
|
4008
|
-
if (
|
|
4008
|
+
if (R(this, ct, k), R(this, Ge, !!k), R(this, re, /* @__PURE__ */ new Map()), R(this, Q, new Array(t).fill(void 0)), R(this, j, new Array(t).fill(void 0)), R(this, ge, new M(t)), R(this, ke, new M(t)), R(this, me, 0), R(this, ue, 0), R(this, Te, jt.create(t)), R(this, oe, 0), R(this, Ce, 0), typeof f == "function" && R(this, Le, f), typeof h == "function" ? (R(this, Se, h), R(this, he, [])) : (R(this, Se, void 0), R(this, he, void 0)), R(this, Fe, !!a(this, Le)), R(this, pe, !!a(this, Se)), this.noDisposeOnSet = !!m, this.noUpdateTTL = !!v, this.noDeleteOnFetchRejection = !!p, this.allowStaleOnFetchRejection = !!S, this.allowStaleOnFetchAbort = !!C, this.ignoreFetchAbort = !!A, this.maxEntrySize !== 0) {
|
|
4009
4009
|
if (a(this, be) !== 0 && !Ve(a(this, be)))
|
|
4010
4010
|
throw new TypeError("maxSize must be a positive integer if specified");
|
|
4011
4011
|
if (!Ve(this.maxEntrySize))
|
|
4012
4012
|
throw new TypeError("maxEntrySize must be a positive integer if specified");
|
|
4013
|
-
|
|
4013
|
+
I(this, Wt, Zn).call(this);
|
|
4014
4014
|
}
|
|
4015
4015
|
if (this.allowStale = !!c, this.noDeleteOnStaleGet = !!w, this.updateAgeOnGet = !!r, this.updateAgeOnHas = !!o, this.ttlResolution = Ve(i) || i === 0 ? i : 1, this.ttlAutopurge = !!l, this.ttl = n || 0, this.ttl) {
|
|
4016
4016
|
if (!Ve(this.ttl))
|
|
4017
4017
|
throw new TypeError("ttl must be a positive integer if specified");
|
|
4018
|
-
|
|
4018
|
+
I(this, yt, en).call(this);
|
|
4019
4019
|
}
|
|
4020
4020
|
if (a(this, $e) === 0 && this.ttl === 0 && a(this, be) === 0)
|
|
4021
4021
|
throw new TypeError("At least one of max, maxSize, or ttl is required");
|
|
4022
4022
|
if (!this.ttlAutopurge && !a(this, $e) && !a(this, be)) {
|
|
4023
4023
|
const T = "LRU_CACHE_UNBOUNDED";
|
|
4024
|
-
hs(T) && (Kn.add(T), ds("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", T,
|
|
4024
|
+
hs(T) && (Kn.add(T), ds("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.", "UnboundedCacheWarning", T, dn));
|
|
4025
4025
|
}
|
|
4026
4026
|
}
|
|
4027
4027
|
/**
|
|
@@ -4039,7 +4039,7 @@ const hn = class {
|
|
|
4039
4039
|
starts: a(e, Be),
|
|
4040
4040
|
ttls: a(e, Ee),
|
|
4041
4041
|
sizes: a(e, Me),
|
|
4042
|
-
keyMap: a(e,
|
|
4042
|
+
keyMap: a(e, re),
|
|
4043
4043
|
keyList: a(e, Q),
|
|
4044
4044
|
valList: a(e, j),
|
|
4045
4045
|
next: a(e, ge),
|
|
@@ -4054,23 +4054,23 @@ const hn = class {
|
|
|
4054
4054
|
// methods
|
|
4055
4055
|
isBackgroundFetch: (t) => {
|
|
4056
4056
|
var n;
|
|
4057
|
-
return
|
|
4057
|
+
return I(n = e, Y, ee).call(n, t);
|
|
4058
4058
|
},
|
|
4059
4059
|
backgroundFetch: (t, n, i, l) => {
|
|
4060
4060
|
var r;
|
|
4061
|
-
return
|
|
4061
|
+
return I(r = e, ht, Mt).call(r, t, n, i, l);
|
|
4062
4062
|
},
|
|
4063
4063
|
moveToTail: (t) => {
|
|
4064
4064
|
var n;
|
|
4065
|
-
return
|
|
4065
|
+
return I(n = e, tt, kt).call(n, t);
|
|
4066
4066
|
},
|
|
4067
4067
|
indexes: (t) => {
|
|
4068
4068
|
var n;
|
|
4069
|
-
return
|
|
4069
|
+
return I(n = e, Re, We).call(n, t);
|
|
4070
4070
|
},
|
|
4071
4071
|
rindexes: (t) => {
|
|
4072
4072
|
var n;
|
|
4073
|
-
return
|
|
4073
|
+
return I(n = e, Oe, Ke).call(n, t);
|
|
4074
4074
|
},
|
|
4075
4075
|
isStale: (t) => {
|
|
4076
4076
|
var n;
|
|
@@ -4101,7 +4101,7 @@ const hn = class {
|
|
|
4101
4101
|
* The number of items stored in the cache (read-only)
|
|
4102
4102
|
*/
|
|
4103
4103
|
get size() {
|
|
4104
|
-
return a(this,
|
|
4104
|
+
return a(this, oe);
|
|
4105
4105
|
}
|
|
4106
4106
|
/**
|
|
4107
4107
|
* {@link LRUCache.OptionsBase.fetchMethod} (read-only)
|
|
@@ -4125,15 +4125,15 @@ const hn = class {
|
|
|
4125
4125
|
* Return the remaining TTL time for a given entry key
|
|
4126
4126
|
*/
|
|
4127
4127
|
getRemainingTTL(e) {
|
|
4128
|
-
return a(this,
|
|
4128
|
+
return a(this, re).has(e) ? 1 / 0 : 0;
|
|
4129
4129
|
}
|
|
4130
4130
|
/**
|
|
4131
4131
|
* Return a generator yielding `[key, value]` pairs,
|
|
4132
4132
|
* in order from most recently used to least recently used.
|
|
4133
4133
|
*/
|
|
4134
4134
|
*entries() {
|
|
4135
|
-
for (const e of
|
|
4136
|
-
a(this, j)[e] !== void 0 && a(this, Q)[e] !== void 0 && !
|
|
4135
|
+
for (const e of I(this, Re, We).call(this))
|
|
4136
|
+
a(this, j)[e] !== void 0 && a(this, Q)[e] !== void 0 && !I(this, Y, ee).call(this, a(this, j)[e]) && (yield [a(this, Q)[e], a(this, j)[e]]);
|
|
4137
4137
|
}
|
|
4138
4138
|
/**
|
|
4139
4139
|
* Inverse order version of {@link LRUCache.entries}
|
|
@@ -4142,17 +4142,17 @@ const hn = class {
|
|
|
4142
4142
|
* in order from least recently used to most recently used.
|
|
4143
4143
|
*/
|
|
4144
4144
|
*rentries() {
|
|
4145
|
-
for (const e of
|
|
4146
|
-
a(this, j)[e] !== void 0 && a(this, Q)[e] !== void 0 && !
|
|
4145
|
+
for (const e of I(this, Oe, Ke).call(this))
|
|
4146
|
+
a(this, j)[e] !== void 0 && a(this, Q)[e] !== void 0 && !I(this, Y, ee).call(this, a(this, j)[e]) && (yield [a(this, Q)[e], a(this, j)[e]]);
|
|
4147
4147
|
}
|
|
4148
4148
|
/**
|
|
4149
4149
|
* Return a generator yielding the keys in the cache,
|
|
4150
4150
|
* in order from most recently used to least recently used.
|
|
4151
4151
|
*/
|
|
4152
4152
|
*keys() {
|
|
4153
|
-
for (const e of
|
|
4153
|
+
for (const e of I(this, Re, We).call(this)) {
|
|
4154
4154
|
const t = a(this, Q)[e];
|
|
4155
|
-
t !== void 0 && !
|
|
4155
|
+
t !== void 0 && !I(this, Y, ee).call(this, a(this, j)[e]) && (yield t);
|
|
4156
4156
|
}
|
|
4157
4157
|
}
|
|
4158
4158
|
/**
|
|
@@ -4162,9 +4162,9 @@ const hn = class {
|
|
|
4162
4162
|
* in order from least recently used to most recently used.
|
|
4163
4163
|
*/
|
|
4164
4164
|
*rkeys() {
|
|
4165
|
-
for (const e of
|
|
4165
|
+
for (const e of I(this, Oe, Ke).call(this)) {
|
|
4166
4166
|
const t = a(this, Q)[e];
|
|
4167
|
-
t !== void 0 && !
|
|
4167
|
+
t !== void 0 && !I(this, Y, ee).call(this, a(this, j)[e]) && (yield t);
|
|
4168
4168
|
}
|
|
4169
4169
|
}
|
|
4170
4170
|
/**
|
|
@@ -4172,8 +4172,8 @@ const hn = class {
|
|
|
4172
4172
|
* in order from most recently used to least recently used.
|
|
4173
4173
|
*/
|
|
4174
4174
|
*values() {
|
|
4175
|
-
for (const e of
|
|
4176
|
-
a(this, j)[e] !== void 0 && !
|
|
4175
|
+
for (const e of I(this, Re, We).call(this))
|
|
4176
|
+
a(this, j)[e] !== void 0 && !I(this, Y, ee).call(this, a(this, j)[e]) && (yield a(this, j)[e]);
|
|
4177
4177
|
}
|
|
4178
4178
|
/**
|
|
4179
4179
|
* Inverse order version of {@link LRUCache.values}
|
|
@@ -4182,8 +4182,8 @@ const hn = class {
|
|
|
4182
4182
|
* in order from least recently used to most recently used.
|
|
4183
4183
|
*/
|
|
4184
4184
|
*rvalues() {
|
|
4185
|
-
for (const e of
|
|
4186
|
-
a(this, j)[e] !== void 0 && !
|
|
4185
|
+
for (const e of I(this, Oe, Ke).call(this))
|
|
4186
|
+
a(this, j)[e] !== void 0 && !I(this, Y, ee).call(this, a(this, j)[e]) && (yield a(this, j)[e]);
|
|
4187
4187
|
}
|
|
4188
4188
|
/**
|
|
4189
4189
|
* Iterating over the cache itself yields the same results as
|
|
@@ -4197,8 +4197,8 @@ const hn = class {
|
|
|
4197
4197
|
* similar to Array.find(). fn is called as fn(value, key, cache).
|
|
4198
4198
|
*/
|
|
4199
4199
|
find(e, t = {}) {
|
|
4200
|
-
for (const n of
|
|
4201
|
-
const i = a(this, j)[n], l =
|
|
4200
|
+
for (const n of I(this, Re, We).call(this)) {
|
|
4201
|
+
const i = a(this, j)[n], l = I(this, Y, ee).call(this, i) ? i.__staleWhileFetching : i;
|
|
4202
4202
|
if (l !== void 0 && e(l, a(this, Q)[n], this))
|
|
4203
4203
|
return this.get(a(this, Q)[n], t);
|
|
4204
4204
|
}
|
|
@@ -4210,8 +4210,8 @@ const hn = class {
|
|
|
4210
4210
|
* Does not iterate over stale values.
|
|
4211
4211
|
*/
|
|
4212
4212
|
forEach(e, t = this) {
|
|
4213
|
-
for (const n of
|
|
4214
|
-
const i = a(this, j)[n], l =
|
|
4213
|
+
for (const n of I(this, Re, We).call(this)) {
|
|
4214
|
+
const i = a(this, j)[n], l = I(this, Y, ee).call(this, i) ? i.__staleWhileFetching : i;
|
|
4215
4215
|
l !== void 0 && e.call(t, l, a(this, Q)[n], this);
|
|
4216
4216
|
}
|
|
4217
4217
|
}
|
|
@@ -4220,8 +4220,8 @@ const hn = class {
|
|
|
4220
4220
|
* reverse order. (ie, less recently used items are iterated over first.)
|
|
4221
4221
|
*/
|
|
4222
4222
|
rforEach(e, t = this) {
|
|
4223
|
-
for (const n of
|
|
4224
|
-
const i = a(this, j)[n], l =
|
|
4223
|
+
for (const n of I(this, Oe, Ke).call(this)) {
|
|
4224
|
+
const i = a(this, j)[n], l = I(this, Y, ee).call(this, i) ? i.__staleWhileFetching : i;
|
|
4225
4225
|
l !== void 0 && e.call(t, l, a(this, Q)[n], this);
|
|
4226
4226
|
}
|
|
4227
4227
|
}
|
|
@@ -4231,7 +4231,7 @@ const hn = class {
|
|
|
4231
4231
|
*/
|
|
4232
4232
|
purgeStale() {
|
|
4233
4233
|
let e = !1;
|
|
4234
|
-
for (const t of
|
|
4234
|
+
for (const t of I(this, Oe, Ke).call(this, { allowStale: !0 }))
|
|
4235
4235
|
a(this, ye).call(this, t) && (this.delete(a(this, Q)[t]), e = !0);
|
|
4236
4236
|
return e;
|
|
4237
4237
|
}
|
|
@@ -4241,8 +4241,8 @@ const hn = class {
|
|
|
4241
4241
|
*/
|
|
4242
4242
|
dump() {
|
|
4243
4243
|
const e = [];
|
|
4244
|
-
for (const t of
|
|
4245
|
-
const n = a(this, Q)[t], i = a(this, j)[t], l =
|
|
4244
|
+
for (const t of I(this, Re, We).call(this, { allowStale: !0 })) {
|
|
4245
|
+
const n = a(this, Q)[t], i = a(this, j)[t], l = I(this, Y, ee).call(this, i) ? i.__staleWhileFetching : i;
|
|
4246
4246
|
if (l === void 0 || n === void 0)
|
|
4247
4247
|
continue;
|
|
4248
4248
|
const r = { value: l };
|
|
@@ -4280,22 +4280,22 @@ const hn = class {
|
|
|
4280
4280
|
const h = a(this, xt).call(this, e, t, n.size || 0, o);
|
|
4281
4281
|
if (this.maxEntrySize && h > this.maxEntrySize)
|
|
4282
4282
|
return c && (c.set = "miss", c.maxEntrySizeExceeded = !0), this.delete(e), this;
|
|
4283
|
-
let m = a(this,
|
|
4283
|
+
let m = a(this, oe) === 0 ? void 0 : a(this, re).get(e);
|
|
4284
4284
|
if (m === void 0)
|
|
4285
|
-
m = a(this,
|
|
4285
|
+
m = a(this, oe) === 0 ? a(this, ue) : a(this, Te).length !== 0 ? a(this, Te).pop() : a(this, oe) === a(this, $e) ? I(this, dt, Pt).call(this, !1) : a(this, oe), a(this, Q)[m] = e, a(this, j)[m] = t, a(this, re).set(e, m), a(this, ge)[a(this, ue)] = m, a(this, ke)[m] = a(this, ue), R(this, ue, m), Lt(this, oe)._++, a(this, ut).call(this, m, h, c), c && (c.set = "add"), f = !1;
|
|
4286
4286
|
else {
|
|
4287
|
-
|
|
4287
|
+
I(this, tt, kt).call(this, m);
|
|
4288
4288
|
const b = a(this, j)[m];
|
|
4289
4289
|
if (t !== b) {
|
|
4290
|
-
if (a(this, Ge) &&
|
|
4290
|
+
if (a(this, Ge) && I(this, Y, ee).call(this, b) ? b.__abortController.abort(new Error("replaced")) : r || (a(this, Fe) && ((v = a(this, Le)) == null || v.call(this, b, e, "set")), a(this, pe) && ((g = a(this, he)) == null || g.push([b, e, "set"]))), a(this, et).call(this, m), a(this, ut).call(this, m, h, c), a(this, j)[m] = t, c) {
|
|
4291
4291
|
c.set = "replace";
|
|
4292
|
-
const k = b &&
|
|
4292
|
+
const k = b && I(this, Y, ee).call(this, b) ? b.__staleWhileFetching : b;
|
|
4293
4293
|
k !== void 0 && (c.oldValue = k);
|
|
4294
4294
|
}
|
|
4295
4295
|
} else
|
|
4296
4296
|
c && (c.set = "update");
|
|
4297
4297
|
}
|
|
4298
|
-
if (i !== 0 && !a(this, Ee) &&
|
|
4298
|
+
if (i !== 0 && !a(this, Ee) && I(this, yt, en).call(this), a(this, Ee) && (f || a(this, wt).call(this, m, i, l), c && a(this, Ne).call(this, c, m)), !r && a(this, pe) && a(this, he)) {
|
|
4299
4299
|
const b = a(this, he);
|
|
4300
4300
|
let k;
|
|
4301
4301
|
for (; k = b == null ? void 0 : b.shift(); )
|
|
@@ -4310,9 +4310,9 @@ const hn = class {
|
|
|
4310
4310
|
pop() {
|
|
4311
4311
|
var e;
|
|
4312
4312
|
try {
|
|
4313
|
-
for (; a(this,
|
|
4313
|
+
for (; a(this, oe); ) {
|
|
4314
4314
|
const t = a(this, j)[a(this, me)];
|
|
4315
|
-
if (
|
|
4315
|
+
if (I(this, dt, Pt).call(this, !0), I(this, Y, ee).call(this, t)) {
|
|
4316
4316
|
if (t.__staleWhileFetching)
|
|
4317
4317
|
return t.__staleWhileFetching;
|
|
4318
4318
|
} else if (t !== void 0)
|
|
@@ -4336,7 +4336,7 @@ const hn = class {
|
|
|
4336
4336
|
* {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
|
|
4337
4337
|
*/
|
|
4338
4338
|
has(e, t = {}) {
|
|
4339
|
-
const { updateAgeOnHas: n = this.updateAgeOnHas, status: i } = t, l = a(this,
|
|
4339
|
+
const { updateAgeOnHas: n = this.updateAgeOnHas, status: i } = t, l = a(this, re).get(e);
|
|
4340
4340
|
if (l !== void 0)
|
|
4341
4341
|
if (a(this, ye).call(this, l))
|
|
4342
4342
|
i && (i.has = "stale", a(this, Ne).call(this, i, l));
|
|
@@ -4354,10 +4354,10 @@ const hn = class {
|
|
|
4354
4354
|
* {@link LRUCache.OptionsBase.allowStale} is set.
|
|
4355
4355
|
*/
|
|
4356
4356
|
peek(e, t = {}) {
|
|
4357
|
-
const { allowStale: n = this.allowStale } = t, i = a(this,
|
|
4357
|
+
const { allowStale: n = this.allowStale } = t, i = a(this, re).get(e);
|
|
4358
4358
|
if (i !== void 0 && (n || !a(this, ye).call(this, i))) {
|
|
4359
4359
|
const l = a(this, j)[i];
|
|
4360
|
-
return
|
|
4360
|
+
return I(this, Y, ee).call(this, l) ? l.__staleWhileFetching : l;
|
|
4361
4361
|
}
|
|
4362
4362
|
}
|
|
4363
4363
|
async fetch(e, t = {}) {
|
|
@@ -4405,21 +4405,21 @@ const hn = class {
|
|
|
4405
4405
|
status: p,
|
|
4406
4406
|
signal: w
|
|
4407
4407
|
};
|
|
4408
|
-
let C = a(this,
|
|
4408
|
+
let C = a(this, re).get(e);
|
|
4409
4409
|
if (C === void 0) {
|
|
4410
4410
|
p && (p.fetch = "miss");
|
|
4411
|
-
const
|
|
4412
|
-
return
|
|
4411
|
+
const A = I(this, ht, Mt).call(this, e, C, S, b);
|
|
4412
|
+
return A.__returned = A;
|
|
4413
4413
|
} else {
|
|
4414
|
-
const
|
|
4415
|
-
if (
|
|
4416
|
-
const V = n &&
|
|
4417
|
-
return p && (p.fetch = "inflight", V && (p.returnedStale = !0)), V ?
|
|
4414
|
+
const A = a(this, j)[C];
|
|
4415
|
+
if (I(this, Y, ee).call(this, A)) {
|
|
4416
|
+
const V = n && A.__staleWhileFetching !== void 0;
|
|
4417
|
+
return p && (p.fetch = "inflight", V && (p.returnedStale = !0)), V ? A.__staleWhileFetching : A.__returned = A;
|
|
4418
4418
|
}
|
|
4419
4419
|
const M = a(this, ye).call(this, C);
|
|
4420
4420
|
if (!k && !M)
|
|
4421
|
-
return p && (p.fetch = "hit"),
|
|
4422
|
-
const T =
|
|
4421
|
+
return p && (p.fetch = "hit"), I(this, tt, kt).call(this, C), i && a(this, Je).call(this, C), p && a(this, Ne).call(this, p, C), A;
|
|
4422
|
+
const T = I(this, ht, Mt).call(this, e, C, S, b), X = T.__staleWhileFetching !== void 0 && n;
|
|
4423
4423
|
return p && (p.fetch = M ? "stale" : "refresh", X && M && (p.returnedStale = !0)), X ? T.__staleWhileFetching : T.__returned = T;
|
|
4424
4424
|
}
|
|
4425
4425
|
}
|
|
@@ -4430,10 +4430,10 @@ const hn = class {
|
|
|
4430
4430
|
* If the key is not found, get() will return `undefined`.
|
|
4431
4431
|
*/
|
|
4432
4432
|
get(e, t = {}) {
|
|
4433
|
-
const { allowStale: n = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: l = this.noDeleteOnStaleGet, status: r } = t, o = a(this,
|
|
4433
|
+
const { allowStale: n = this.allowStale, updateAgeOnGet: i = this.updateAgeOnGet, noDeleteOnStaleGet: l = this.noDeleteOnStaleGet, status: r } = t, o = a(this, re).get(e);
|
|
4434
4434
|
if (o !== void 0) {
|
|
4435
|
-
const c = a(this, j)[o], f =
|
|
4436
|
-
return r && a(this, Ne).call(this, r, o), a(this, ye).call(this, o) ? (r && (r.get = "stale"), f ? (r && n && c.__staleWhileFetching !== void 0 && (r.returnedStale = !0), n ? c.__staleWhileFetching : void 0) : (l || this.delete(e), r && n && (r.returnedStale = !0), n ? c : void 0)) : (r && (r.get = "hit"), f ? c.__staleWhileFetching : (
|
|
4435
|
+
const c = a(this, j)[o], f = I(this, Y, ee).call(this, c);
|
|
4436
|
+
return r && a(this, Ne).call(this, r, o), a(this, ye).call(this, o) ? (r && (r.get = "stale"), f ? (r && n && c.__staleWhileFetching !== void 0 && (r.returnedStale = !0), n ? c.__staleWhileFetching : void 0) : (l || this.delete(e), r && n && (r.returnedStale = !0), n ? c : void 0)) : (r && (r.get = "hit"), f ? c.__staleWhileFetching : (I(this, tt, kt).call(this, o), i && a(this, Je).call(this, o), c));
|
|
4437
4437
|
} else
|
|
4438
4438
|
r && (r.get = "miss");
|
|
4439
4439
|
}
|
|
@@ -4444,15 +4444,15 @@ const hn = class {
|
|
|
4444
4444
|
delete(e) {
|
|
4445
4445
|
var n, i, l, r;
|
|
4446
4446
|
let t = !1;
|
|
4447
|
-
if (a(this,
|
|
4448
|
-
const o = a(this,
|
|
4447
|
+
if (a(this, oe) !== 0) {
|
|
4448
|
+
const o = a(this, re).get(e);
|
|
4449
4449
|
if (o !== void 0)
|
|
4450
|
-
if (t = !0, a(this,
|
|
4450
|
+
if (t = !0, a(this, oe) === 1)
|
|
4451
4451
|
this.clear();
|
|
4452
4452
|
else {
|
|
4453
4453
|
a(this, et).call(this, o);
|
|
4454
4454
|
const c = a(this, j)[o];
|
|
4455
|
-
|
|
4455
|
+
I(this, Y, ee).call(this, c) ? c.__abortController.abort(new Error("deleted")) : (a(this, Fe) || a(this, pe)) && (a(this, Fe) && ((n = a(this, Le)) == null || n.call(this, c, e, "delete")), a(this, pe) && ((i = a(this, he)) == null || i.push([c, e, "delete"]))), a(this, re).delete(e), a(this, Q)[o] = void 0, a(this, j)[o] = void 0, o === a(this, ue) ? R(this, ue, a(this, ke)[o]) : o === a(this, me) ? R(this, me, a(this, ge)[o]) : (a(this, ge)[a(this, ke)[o]] = a(this, ge)[o], a(this, ke)[a(this, ge)[o]] = a(this, ke)[o]), Lt(this, oe)._--, a(this, Te).push(o);
|
|
4456
4456
|
}
|
|
4457
4457
|
}
|
|
4458
4458
|
if (a(this, pe) && ((l = a(this, he)) != null && l.length)) {
|
|
@@ -4468,16 +4468,16 @@ const hn = class {
|
|
|
4468
4468
|
*/
|
|
4469
4469
|
clear() {
|
|
4470
4470
|
var e, t, n;
|
|
4471
|
-
for (const i of
|
|
4471
|
+
for (const i of I(this, Oe, Ke).call(this, { allowStale: !0 })) {
|
|
4472
4472
|
const l = a(this, j)[i];
|
|
4473
|
-
if (
|
|
4473
|
+
if (I(this, Y, ee).call(this, l))
|
|
4474
4474
|
l.__abortController.abort(new Error("deleted"));
|
|
4475
4475
|
else {
|
|
4476
4476
|
const r = a(this, Q)[i];
|
|
4477
4477
|
a(this, Fe) && ((e = a(this, Le)) == null || e.call(this, l, r, "delete")), a(this, pe) && ((t = a(this, he)) == null || t.push([l, r, "delete"]));
|
|
4478
4478
|
}
|
|
4479
4479
|
}
|
|
4480
|
-
if (a(this,
|
|
4480
|
+
if (a(this, re).clear(), a(this, j).fill(void 0), a(this, Q).fill(void 0), a(this, Ee) && a(this, Be) && (a(this, Ee).fill(0), a(this, Be).fill(0)), a(this, Me) && a(this, Me).fill(0), R(this, me, 0), R(this, ue, 0), a(this, Te).length = 0, R(this, Ce, 0), R(this, oe, 0), a(this, pe) && a(this, he)) {
|
|
4481
4481
|
const i = a(this, he);
|
|
4482
4482
|
let l;
|
|
4483
4483
|
for (; l = i == null ? void 0 : i.shift(); )
|
|
@@ -4485,19 +4485,19 @@ const hn = class {
|
|
|
4485
4485
|
}
|
|
4486
4486
|
}
|
|
4487
4487
|
};
|
|
4488
|
-
let
|
|
4489
|
-
$e = new WeakMap(), be = new WeakMap(), Le = new WeakMap(), Se = new WeakMap(), ct = new WeakMap(),
|
|
4488
|
+
let Jt = dn;
|
|
4489
|
+
$e = new WeakMap(), be = new WeakMap(), Le = new WeakMap(), Se = new WeakMap(), ct = new WeakMap(), oe = new WeakMap(), Ce = new WeakMap(), re = new WeakMap(), Q = new WeakMap(), j = new WeakMap(), ge = new WeakMap(), ke = new WeakMap(), me = new WeakMap(), ue = new WeakMap(), Te = new WeakMap(), he = new WeakMap(), Me = new WeakMap(), Be = new WeakMap(), Ee = new WeakMap(), Fe = new WeakMap(), Ge = new WeakMap(), pe = new WeakMap(), yt = new WeakSet(), en = function() {
|
|
4490
4490
|
const e = new Ht(a(this, $e)), t = new Ht(a(this, $e));
|
|
4491
|
-
|
|
4491
|
+
R(this, Ee, e), R(this, Be, t), R(this, wt, (l, r, o = pt.now()) => {
|
|
4492
4492
|
if (t[l] = r !== 0 ? o : 0, e[l] = r, r !== 0 && this.ttlAutopurge) {
|
|
4493
4493
|
const c = setTimeout(() => {
|
|
4494
4494
|
a(this, ye).call(this, l) && this.delete(a(this, Q)[l]);
|
|
4495
4495
|
}, r + 1);
|
|
4496
4496
|
c.unref && c.unref();
|
|
4497
4497
|
}
|
|
4498
|
-
}),
|
|
4498
|
+
}), R(this, Je, (l) => {
|
|
4499
4499
|
t[l] = e[l] !== 0 ? pt.now() : 0;
|
|
4500
|
-
}),
|
|
4500
|
+
}), R(this, Ne, (l, r) => {
|
|
4501
4501
|
if (e[r]) {
|
|
4502
4502
|
const o = e[r], c = t[r];
|
|
4503
4503
|
l.ttl = o, l.start = c, l.now = n || i(), l.remainingTTL = l.now + o - c;
|
|
@@ -4514,15 +4514,15 @@ $e = new WeakMap(), be = new WeakMap(), Le = new WeakMap(), Se = new WeakMap(),
|
|
|
4514
4514
|
return l;
|
|
4515
4515
|
};
|
|
4516
4516
|
this.getRemainingTTL = (l) => {
|
|
4517
|
-
const r = a(this,
|
|
4517
|
+
const r = a(this, re).get(l);
|
|
4518
4518
|
return r === void 0 ? 0 : e[r] === 0 || t[r] === 0 ? 1 / 0 : t[r] + e[r] - (n || i());
|
|
4519
|
-
},
|
|
4519
|
+
}, R(this, ye, (l) => e[l] !== 0 && t[l] !== 0 && (n || i()) - t[l] > e[l]);
|
|
4520
4520
|
}, Je = new WeakMap(), Ne = new WeakMap(), wt = new WeakMap(), ye = new WeakMap(), Wt = new WeakSet(), Zn = function() {
|
|
4521
4521
|
const e = new Ht(a(this, $e));
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
}),
|
|
4525
|
-
if (
|
|
4522
|
+
R(this, Ce, 0), R(this, Me, e), R(this, et, (t) => {
|
|
4523
|
+
R(this, Ce, a(this, Ce) - e[t]), e[t] = 0;
|
|
4524
|
+
}), R(this, xt, (t, n, i, l) => {
|
|
4525
|
+
if (I(this, Y, ee).call(this, n))
|
|
4526
4526
|
return 0;
|
|
4527
4527
|
if (!Ve(i))
|
|
4528
4528
|
if (l) {
|
|
@@ -4533,31 +4533,31 @@ $e = new WeakMap(), be = new WeakMap(), Le = new WeakMap(), Se = new WeakMap(),
|
|
|
4533
4533
|
} else
|
|
4534
4534
|
throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
4535
4535
|
return i;
|
|
4536
|
-
}),
|
|
4536
|
+
}), R(this, ut, (t, n, i) => {
|
|
4537
4537
|
if (e[t] = n, a(this, be)) {
|
|
4538
4538
|
const l = a(this, be) - e[t];
|
|
4539
4539
|
for (; a(this, Ce) > l; )
|
|
4540
|
-
|
|
4540
|
+
I(this, dt, Pt).call(this, !0);
|
|
4541
4541
|
}
|
|
4542
|
-
|
|
4542
|
+
R(this, Ce, a(this, Ce) + e[t]), i && (i.entrySize = n, i.totalCalculatedSize = a(this, Ce));
|
|
4543
4543
|
});
|
|
4544
4544
|
}, et = new WeakMap(), ut = new WeakMap(), xt = new WeakMap(), Re = new WeakSet(), We = function* ({ allowStale: e = this.allowStale } = {}) {
|
|
4545
|
-
if (a(this,
|
|
4546
|
-
for (let t = a(this, ue); !(!
|
|
4545
|
+
if (a(this, oe))
|
|
4546
|
+
for (let t = a(this, ue); !(!I(this, $t, tn).call(this, t) || ((e || !a(this, ye).call(this, t)) && (yield t), t === a(this, me))); )
|
|
4547
4547
|
t = a(this, ke)[t];
|
|
4548
4548
|
}, Oe = new WeakSet(), Ke = function* ({ allowStale: e = this.allowStale } = {}) {
|
|
4549
|
-
if (a(this,
|
|
4550
|
-
for (let t = a(this, me); !(!
|
|
4549
|
+
if (a(this, oe))
|
|
4550
|
+
for (let t = a(this, me); !(!I(this, $t, tn).call(this, t) || ((e || !a(this, ye).call(this, t)) && (yield t), t === a(this, ue))); )
|
|
4551
4551
|
t = a(this, ge)[t];
|
|
4552
|
-
}, $t = new WeakSet(),
|
|
4553
|
-
return e !== void 0 && a(this,
|
|
4552
|
+
}, $t = new WeakSet(), tn = function(e) {
|
|
4553
|
+
return e !== void 0 && a(this, re).get(a(this, Q)[e]) === e;
|
|
4554
4554
|
}, dt = new WeakSet(), Pt = function(e) {
|
|
4555
4555
|
var l, r;
|
|
4556
4556
|
const t = a(this, me), n = a(this, Q)[t], i = a(this, j)[t];
|
|
4557
|
-
return a(this, Ge) &&
|
|
4557
|
+
return a(this, Ge) && I(this, Y, ee).call(this, i) ? i.__abortController.abort(new Error("evicted")) : (a(this, Fe) || a(this, pe)) && (a(this, Fe) && ((l = a(this, Le)) == null || l.call(this, i, n, "evict")), a(this, pe) && ((r = a(this, he)) == null || r.push([i, n, "evict"]))), a(this, et).call(this, t), e && (a(this, Q)[t] = void 0, a(this, j)[t] = void 0, a(this, Te).push(t)), a(this, oe) === 1 ? (R(this, me, R(this, ue, 0)), a(this, Te).length = 0) : R(this, me, a(this, ge)[t]), a(this, re).delete(n), Lt(this, oe)._--, t;
|
|
4558
4558
|
}, ht = new WeakSet(), Mt = function(e, t, n, i) {
|
|
4559
4559
|
const l = t === void 0 ? void 0 : a(this, j)[t];
|
|
4560
|
-
if (
|
|
4560
|
+
if (I(this, Y, ee).call(this, l))
|
|
4561
4561
|
return l;
|
|
4562
4562
|
const r = new AbortController(), { signal: o } = n;
|
|
4563
4563
|
o == null || o.addEventListener("abort", () => r.abort(o.reason), {
|
|
@@ -4592,18 +4592,18 @@ $e = new WeakMap(), be = new WeakMap(), Le = new WeakMap(), Se = new WeakMap(),
|
|
|
4592
4592
|
__staleWhileFetching: l,
|
|
4593
4593
|
__returned: void 0
|
|
4594
4594
|
});
|
|
4595
|
-
return t === void 0 ? (this.set(e, $, { ...c.options, status: void 0 }), t = a(this,
|
|
4595
|
+
return t === void 0 ? (this.set(e, $, { ...c.options, status: void 0 }), t = a(this, re).get(e)) : a(this, j)[t] = $, $;
|
|
4596
4596
|
}, Y = new WeakSet(), ee = function(e) {
|
|
4597
4597
|
if (!a(this, Ge))
|
|
4598
4598
|
return !1;
|
|
4599
4599
|
const t = e;
|
|
4600
4600
|
return !!t && t instanceof Promise && t.hasOwnProperty("__staleWhileFetching") && t.__abortController instanceof AbortController;
|
|
4601
|
-
}, St = new WeakSet(),
|
|
4601
|
+
}, St = new WeakSet(), nn = function(e, t) {
|
|
4602
4602
|
a(this, ke)[t] = e, a(this, ge)[e] = t;
|
|
4603
4603
|
}, tt = new WeakSet(), kt = function(e) {
|
|
4604
|
-
e !== a(this, ue) && (e === a(this, me) ?
|
|
4604
|
+
e !== a(this, ue) && (e === a(this, me) ? R(this, me, a(this, ge)[e]) : I(this, St, nn).call(this, a(this, ke)[e], a(this, ge)[e]), I(this, St, nn).call(this, a(this, ue), e), R(this, ue, e));
|
|
4605
4605
|
};
|
|
4606
|
-
const fs =
|
|
4606
|
+
const fs = Jt, vt = (s) => {
|
|
4607
4607
|
const e = s.value, t = e.substring(0, s.selectionStart), n = e.substring(s.selectionEnd, e.length), i = t.lastIndexOf(`
|
|
4608
4608
|
`), l = t.substring(0, i + 1), r = n.indexOf(`
|
|
4609
4609
|
`), o = n.substring(
|
|
@@ -4705,7 +4705,7 @@ ${p}
|
|
|
4705
4705
|
for (let C = 0; C <= w; C++) {
|
|
4706
4706
|
i += `
|
|
4707
4707
|
|`;
|
|
4708
|
-
for (let
|
|
4708
|
+
for (let A = 0; A <= S; A++)
|
|
4709
4709
|
i += " content |";
|
|
4710
4710
|
}
|
|
4711
4711
|
l = 2, r = 5 - i.length, o = !0;
|
|
@@ -4718,7 +4718,7 @@ ${p}
|
|
|
4718
4718
|
}
|
|
4719
4719
|
case "image": {
|
|
4720
4720
|
const { desc: p, url: w, urls: S } = n;
|
|
4721
|
-
S instanceof Array ? i = S.reduce((C,
|
|
4721
|
+
S instanceof Array ? i = S.reduce((C, A) => C + `
|
|
4722
4722
|
`, "") : i = `
|
|
4723
4723
|
`;
|
|
4724
4724
|
break;
|
|
@@ -4728,10 +4728,10 @@ ${p}
|
|
|
4728
4728
|
if (e === "")
|
|
4729
4729
|
i = w;
|
|
4730
4730
|
else if (/\n/.test(e)) {
|
|
4731
|
-
const { prefixStr: S, subfixStr: C, prefixSupply:
|
|
4732
|
-
i = `${
|
|
4731
|
+
const { prefixStr: S, subfixStr: C, prefixSupply: A, subfixSupply: M } = vt(t);
|
|
4732
|
+
i = `${A}${e}${M}`.split(`
|
|
4733
4733
|
`).map((X) => `${w}${X}`).join(`
|
|
4734
|
-
`), c = S.substring(0, S.length -
|
|
4734
|
+
`), c = S.substring(0, S.length - A.length), f = C.substring(M.length, C.length), o = !0, l = p, r = -A.length - M.length;
|
|
4735
4735
|
} else {
|
|
4736
4736
|
const C = t.value.substring(0, t.selectionStart);
|
|
4737
4737
|
/\n$/.test(C) || C === "" ? (i = `${w}${e}`, o = !0) : i = w;
|
|
@@ -4743,19 +4743,19 @@ ${p}
|
|
|
4743
4743
|
prefixStr: w,
|
|
4744
4744
|
prefixStrEndRow: S,
|
|
4745
4745
|
subfixStrEndRow: C,
|
|
4746
|
-
prefixSupply:
|
|
4746
|
+
prefixSupply: A,
|
|
4747
4747
|
subfixSupply: M
|
|
4748
4748
|
} = vt(t), T = new RegExp(`^\\s{${p}}`), y = (X = !1, V = !1) => {
|
|
4749
|
-
const q = `${
|
|
4749
|
+
const q = `${A}${e}${M}`;
|
|
4750
4750
|
if (T.test(q)) {
|
|
4751
|
-
const
|
|
4752
|
-
return Pe(t,
|
|
4751
|
+
const _ = w.length - (V ? 0 : p), O = X ? _ + e.length - p : _;
|
|
4752
|
+
return Pe(t, _, O), `${S}${q.replace(
|
|
4753
4753
|
T,
|
|
4754
4754
|
""
|
|
4755
4755
|
)}${C}`;
|
|
4756
4756
|
} else if (/^\s/.test(q)) {
|
|
4757
|
-
const
|
|
4758
|
-
return Pe(t, B, W), `${S}${
|
|
4757
|
+
const _ = q.replace(/^\s/, ""), O = q.length - _.length, B = t.selectionStart - (V ? 0 : O), W = X ? B + e.length - O : B;
|
|
4758
|
+
return Pe(t, B, W), `${S}${_}${C}`;
|
|
4759
4759
|
} else
|
|
4760
4760
|
i = e;
|
|
4761
4761
|
};
|
|
@@ -4764,15 +4764,15 @@ ${p}
|
|
|
4764
4764
|
if (X)
|
|
4765
4765
|
return X;
|
|
4766
4766
|
} else if (/\n/.test(e)) {
|
|
4767
|
-
const V = `${
|
|
4767
|
+
const V = `${A}${e}${M}`.split(`
|
|
4768
4768
|
`);
|
|
4769
|
-
let [q,
|
|
4770
|
-
const
|
|
4769
|
+
let [q, _] = [0, 0];
|
|
4770
|
+
const O = V.map((B, W) => {
|
|
4771
4771
|
if (T.test(B))
|
|
4772
|
-
return W === 0 && (q = p),
|
|
4772
|
+
return W === 0 && (q = p), _ += p, B.replace(T, "");
|
|
4773
4773
|
if (/^\s/.test(B)) {
|
|
4774
4774
|
const H = B.replace(/^\s/, "");
|
|
4775
|
-
return
|
|
4775
|
+
return _ += B.length - H.length, H;
|
|
4776
4776
|
}
|
|
4777
4777
|
return B;
|
|
4778
4778
|
}).join(`
|
|
@@ -4780,8 +4780,8 @@ ${p}
|
|
|
4780
4780
|
return Pe(
|
|
4781
4781
|
t,
|
|
4782
4782
|
t.selectionStart - q,
|
|
4783
|
-
t.selectionEnd -
|
|
4784
|
-
), `${S}${
|
|
4783
|
+
t.selectionEnd - _
|
|
4784
|
+
), `${S}${O}${C}`;
|
|
4785
4785
|
} else {
|
|
4786
4786
|
const X = y(!0, !0);
|
|
4787
4787
|
if (X)
|
|
@@ -4799,10 +4799,10 @@ ${p}
|
|
|
4799
4799
|
subfixStrEndRow: w,
|
|
4800
4800
|
prefixStr: S,
|
|
4801
4801
|
subfixStr: C,
|
|
4802
|
-
prefixSupply:
|
|
4802
|
+
prefixSupply: A,
|
|
4803
4803
|
subfixSupply: M
|
|
4804
4804
|
} = vt(t);
|
|
4805
|
-
return e === "" ? (bt(`${
|
|
4805
|
+
return e === "" ? (bt(`${A}${M}`), Pe(t, p.length), `${p}${w.replace(/^\n/, "")}`) : (bt(e), Pe(t, S.length), `${S}${C}`);
|
|
4806
4806
|
}
|
|
4807
4807
|
case "ctrlD": {
|
|
4808
4808
|
const { prefixStrEndRow: p, subfixStrEndRow: w } = vt(t);
|
|
@@ -4905,7 +4905,7 @@ $$
|
|
|
4905
4905
|
i = w.targetValue, o = w.select, l = w.deviationStart, r = w.deviationEnd;
|
|
4906
4906
|
}
|
|
4907
4907
|
}
|
|
4908
|
-
return
|
|
4908
|
+
return Qt(t, i, {
|
|
4909
4909
|
deviationStart: l,
|
|
4910
4910
|
deviationEnd: r,
|
|
4911
4911
|
select: o,
|
|
@@ -4993,7 +4993,7 @@ $$
|
|
|
4993
4993
|
"success",
|
|
4994
4994
|
"tip",
|
|
4995
4995
|
"warning"
|
|
4996
|
-
],
|
|
4996
|
+
], Xt = new RegExp(`^!!!\\s*(${Xn.join("|")})\\s*(.*)$`), gs = /^!!!\s*$/, ps = {
|
|
4997
4997
|
name: "alert",
|
|
4998
4998
|
level: "block",
|
|
4999
4999
|
start(s) {
|
|
@@ -5004,12 +5004,12 @@ $$
|
|
|
5004
5004
|
},
|
|
5005
5005
|
tokenizer(s) {
|
|
5006
5006
|
const e = s.split(/\n/);
|
|
5007
|
-
if (
|
|
5007
|
+
if (Xt.test(e[0])) {
|
|
5008
5008
|
const t = { x: -1, y: -1 }, n = [];
|
|
5009
5009
|
for (let i = 0, l = e.length; i < l; i++)
|
|
5010
|
-
|
|
5010
|
+
Xt.test(e[i]) ? t.x = i : gs.test(e[i]) && (t.y = i, t.x >= 0 && (n.push({ ...t }), t.x = -1, t.y = -1));
|
|
5011
5011
|
if (n.length) {
|
|
5012
|
-
const i = n[0], [l, r, o] =
|
|
5012
|
+
const i = n[0], [l, r, o] = Xt.exec(e[i.x]) || [], c = e.slice(i.x + 1, i.y).join(`
|
|
5013
5013
|
`), h = {
|
|
5014
5014
|
type: "alert",
|
|
5015
5015
|
raw: e.slice(i.x, i.y + 1).join(`
|
|
@@ -5144,61 +5144,61 @@ $$
|
|
|
5144
5144
|
max: 1e3,
|
|
5145
5145
|
// 缓存10分钟
|
|
5146
5146
|
ttl: 6e5
|
|
5147
|
-
}), C = $s(s),
|
|
5147
|
+
}), C = $s(s), A = ks(s, z), M = ze(() => (s.noMermaid || C.mermaidInited) && b.value && (s.noKatex || A.value));
|
|
5148
5148
|
let T = new z.Renderer();
|
|
5149
|
-
T.image = (
|
|
5149
|
+
T.image = (F, D, N) => `<span class="figure"><img src="${F}" title="${D || ""}" alt="${N || ""}" zoom><span class="figcaption">${N || ""}</span></span>`, T.listitem = (F, D) => D ? `<li class="li-task">${F}</li>` : `<li>${F}</li>`, e instanceof Function && (T = e(T));
|
|
5150
5150
|
const y = T.code;
|
|
5151
|
-
T.code = (
|
|
5152
|
-
if (!s.noMermaid &&
|
|
5153
|
-
const
|
|
5151
|
+
T.code = (F, D, N) => {
|
|
5152
|
+
if (!s.noMermaid && D === "mermaid") {
|
|
5153
|
+
const ce = pi();
|
|
5154
5154
|
try {
|
|
5155
5155
|
if (vs)
|
|
5156
|
-
return `<p class="${d}-mermaid">${
|
|
5156
|
+
return `<p class="${d}-mermaid">${F}</p>`;
|
|
5157
5157
|
{
|
|
5158
|
-
const ve = S.get(
|
|
5158
|
+
const ve = S.get(F);
|
|
5159
5159
|
if (ve)
|
|
5160
5160
|
return `<p class="${d}-mermaid" data-processed>${ve}</p>`;
|
|
5161
5161
|
const Ie = v || window.mermaid;
|
|
5162
5162
|
if (C.mermaidInited) {
|
|
5163
|
-
const Xe = (Ie.renderAsync || Ie.render)(
|
|
5163
|
+
const Xe = (Ie.renderAsync || Ie.render)(ce, F);
|
|
5164
5164
|
Xe.then((qe) => {
|
|
5165
|
-
S.set(
|
|
5165
|
+
S.set(F, typeof qe == "string" ? qe : qe.svg);
|
|
5166
5166
|
}), p.push(Xe);
|
|
5167
5167
|
} else
|
|
5168
|
-
return `<p class="${d}-mermaid">${
|
|
5168
|
+
return `<p class="${d}-mermaid">${F}</p>`;
|
|
5169
5169
|
}
|
|
5170
|
-
const de = `<script type="text/tmplate">${
|
|
5170
|
+
const de = `<script type="text/tmplate">${ce}<\/script>`;
|
|
5171
5171
|
return w.push(de), de;
|
|
5172
5172
|
} catch (de) {
|
|
5173
5173
|
return `<p class="${d}-mermaid-error">Error: ${(de == null ? void 0 : de.message) || ""}</p>`;
|
|
5174
5174
|
}
|
|
5175
5175
|
}
|
|
5176
|
-
return y.call(T,
|
|
5176
|
+
return y.call(T, F, D, N).replace(
|
|
5177
5177
|
/^<pre><code\sclass="language-([^>]*)">/,
|
|
5178
5178
|
'<pre><code class="language-$1" language="$1">'
|
|
5179
5179
|
);
|
|
5180
5180
|
};
|
|
5181
5181
|
const X = T.heading, V = X !== new z.Renderer().heading;
|
|
5182
|
-
T.heading = (
|
|
5183
|
-
k.value.push({ text: N, level:
|
|
5184
|
-
const de = s.markedHeadingId(N,
|
|
5182
|
+
T.heading = (F, D, N, ce) => {
|
|
5183
|
+
k.value.push({ text: N, level: D });
|
|
5184
|
+
const de = s.markedHeadingId(N, D, k.value.length);
|
|
5185
5185
|
return V ? X.call(
|
|
5186
5186
|
T,
|
|
5187
|
-
_,
|
|
5188
5187
|
F,
|
|
5188
|
+
D,
|
|
5189
5189
|
N,
|
|
5190
|
-
|
|
5190
|
+
ce,
|
|
5191
5191
|
k.value.length,
|
|
5192
5192
|
de
|
|
5193
|
-
) :
|
|
5193
|
+
) : F !== N ? `<h${D} id="${de}">${F}</h${D}>` : `<h${D} id="${de}"><a href="#${de}">${N}</a></h${D}>`;
|
|
5194
5194
|
}, m && z.setOptions({
|
|
5195
|
-
highlight: (
|
|
5195
|
+
highlight: (F, D) => {
|
|
5196
5196
|
let N;
|
|
5197
|
-
const
|
|
5198
|
-
return
|
|
5199
|
-
language:
|
|
5197
|
+
const ce = m.getLanguage(D);
|
|
5198
|
+
return D && ce ? N = m.highlight(F, {
|
|
5199
|
+
language: D,
|
|
5200
5200
|
ignoreIllegals: !0
|
|
5201
|
-
}).value : N = m.highlightAuto(
|
|
5201
|
+
}).value : N = m.highlightAuto(F).value, r ? kn(N) : `<span class="code-block">${N}</span>`;
|
|
5202
5202
|
}
|
|
5203
5203
|
}), z.setOptions({
|
|
5204
5204
|
breaks: !0,
|
|
@@ -5207,78 +5207,68 @@ $$
|
|
|
5207
5207
|
extensions: t
|
|
5208
5208
|
}), z.use({
|
|
5209
5209
|
extensions: [ps]
|
|
5210
|
-
}), m && z.setOptions({
|
|
5211
|
-
highlight: (_, F) => {
|
|
5212
|
-
let N;
|
|
5213
|
-
const le = m.getLanguage(F);
|
|
5214
|
-
return F && le ? N = m.highlight(_, {
|
|
5215
|
-
language: F,
|
|
5216
|
-
ignoreIllegals: !0
|
|
5217
|
-
}).value : N = m.highlightAuto(_).value, r ? Xt(N) : `<span class="code-block">${N}</span>`;
|
|
5218
|
-
}
|
|
5219
5210
|
});
|
|
5220
|
-
const q = ne(s.sanitize(z(s.value || "", { renderer: T }))),
|
|
5221
|
-
let
|
|
5222
|
-
const N = [...p],
|
|
5211
|
+
const q = ne(s.sanitize(z(s.value || "", { renderer: T }))), _ = async (F) => {
|
|
5212
|
+
let D = s.sanitize(z(F, { renderer: T }));
|
|
5213
|
+
const N = [...p], ce = [...w];
|
|
5223
5214
|
return w = [], p = [], (await Promise.allSettled(N)).forEach((ve, Ie) => {
|
|
5224
|
-
ve.status === "fulfilled" ?
|
|
5225
|
-
|
|
5215
|
+
ve.status === "fulfilled" ? D = D.replace(
|
|
5216
|
+
ce[Ie],
|
|
5226
5217
|
`<p class="${d}-mermaid" data-processed>${typeof ve.value == "string" ? ve.value : ve.value.svg}</p>`
|
|
5227
|
-
) :
|
|
5228
|
-
|
|
5218
|
+
) : D = D.replace(
|
|
5219
|
+
ce[Ie],
|
|
5229
5220
|
`<p class="${d}-mermaid-error">${ve.reason || ""}</p>`
|
|
5230
5221
|
);
|
|
5231
|
-
}),
|
|
5232
|
-
},
|
|
5222
|
+
}), D;
|
|
5223
|
+
}, O = Gt(
|
|
5233
5224
|
async () => {
|
|
5234
5225
|
k.value = [];
|
|
5235
|
-
const
|
|
5236
|
-
q.value =
|
|
5226
|
+
const F = await _(s.value || "");
|
|
5227
|
+
q.value = F, x.emit(o, "buildFinished", q.value), s.onHtmlChanged(q.value);
|
|
5237
5228
|
},
|
|
5238
5229
|
(l == null ? void 0 : l.renderDelay) !== void 0 ? l == null ? void 0 : l.renderDelay : f ? 0 : 500
|
|
5239
5230
|
);
|
|
5240
5231
|
G(
|
|
5241
5232
|
[M, Bt(C, "reRender"), Bt(s, "value")],
|
|
5242
|
-
|
|
5233
|
+
O
|
|
5243
5234
|
), G([h], () => {
|
|
5244
5235
|
S.clear();
|
|
5245
5236
|
});
|
|
5246
5237
|
const B = () => {
|
|
5247
5238
|
z.setOptions({
|
|
5248
|
-
highlight: (
|
|
5239
|
+
highlight: (F, D) => {
|
|
5249
5240
|
let N;
|
|
5250
|
-
const
|
|
5251
|
-
return
|
|
5252
|
-
language:
|
|
5241
|
+
const ce = window.hljs.getLanguage(D);
|
|
5242
|
+
return D && ce ? N = window.hljs.highlight(F, {
|
|
5243
|
+
language: D,
|
|
5253
5244
|
ignoreIllegals: !0
|
|
5254
|
-
}).value : N = window.hljs.highlightAuto(
|
|
5245
|
+
}).value : N = window.hljs.highlightAuto(F).value, r ? kn(N) : `<span class="code-block">${N}</span>`;
|
|
5255
5246
|
}
|
|
5256
5247
|
}), b.value = !0;
|
|
5257
5248
|
};
|
|
5258
5249
|
return G(
|
|
5259
5250
|
() => k.value,
|
|
5260
|
-
(
|
|
5261
|
-
s.onGetCatalog(
|
|
5251
|
+
(F) => {
|
|
5252
|
+
s.onGetCatalog(F), x.emit(o, "catalogChanged", F);
|
|
5262
5253
|
}
|
|
5263
5254
|
), ie(() => {
|
|
5264
5255
|
if (!s.noKatex && !g) {
|
|
5265
|
-
const
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
},
|
|
5269
|
-
const
|
|
5270
|
-
|
|
5256
|
+
const D = document.createElement("script");
|
|
5257
|
+
D.src = ($ == null ? void 0 : $.js) || Nt.js, D.onload = () => {
|
|
5258
|
+
A.value = !0;
|
|
5259
|
+
}, D.id = `${d}-katex`;
|
|
5260
|
+
const N = document.createElement("link");
|
|
5261
|
+
N.rel = "stylesheet", N.href = ($ == null ? void 0 : $.css) || Nt.css, N.id = `${d}-katexCss`, we(D, "katex"), we(N);
|
|
5271
5262
|
}
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
F.src = c.value.js, F.onload = B, F.id = `${d}-hljs`, we(_), we(F, "hljs");
|
|
5263
|
+
const F = document.createElement("link");
|
|
5264
|
+
if (F.rel = "stylesheet", F.href = c.value.css, F.id = `${d}-hlCss`, we(F), !m) {
|
|
5265
|
+
const D = document.createElement("script");
|
|
5266
|
+
D.src = c.value.js, D.onload = B, D.id = `${d}-hljs`, we(D, "hljs");
|
|
5277
5267
|
}
|
|
5278
5268
|
}), G(
|
|
5279
5269
|
() => c.value.css,
|
|
5280
|
-
(
|
|
5281
|
-
vi(`${d}-hlCss`, "href",
|
|
5270
|
+
(F) => {
|
|
5271
|
+
vi(`${d}-hlCss`, "href", F);
|
|
5282
5272
|
}
|
|
5283
5273
|
), ie(() => {
|
|
5284
5274
|
x.on(o, {
|
|
@@ -5302,8 +5292,8 @@ $$
|
|
|
5302
5292
|
k.setAttribute("class", "copy-button"), k.dataset.tips = b, k.innerHTML = `<svg class="${d}-icon" aria-hidden="true"><use xlink:href="#${d}-icon-copy"></use></svg>`, k.addEventListener("click", () => {
|
|
5303
5293
|
var T, y;
|
|
5304
5294
|
clearTimeout($);
|
|
5305
|
-
const S = g.querySelector("code").innerText, C = bt(s.formatCopiedText(S)),
|
|
5306
|
-
k.dataset.tips = C ?
|
|
5295
|
+
const S = g.querySelector("code").innerText, C = bt(s.formatCopiedText(S)), A = ((T = r.value.copyCode) == null ? void 0 : T.successTips) || "已复制!", M = ((y = r.value.copyCode) == null ? void 0 : y.failTips) || "已复制!";
|
|
5296
|
+
k.dataset.tips = C ? A : M, $ = window.setTimeout(() => {
|
|
5307
5297
|
k.dataset.tips = b;
|
|
5308
5298
|
}, 1500);
|
|
5309
5299
|
}), g.appendChild(k);
|
|
@@ -5314,7 +5304,7 @@ $$
|
|
|
5314
5304
|
});
|
|
5315
5305
|
}, v = (g) => {
|
|
5316
5306
|
g && !l && ft(() => {
|
|
5317
|
-
c(), [f, c] =
|
|
5307
|
+
c(), [f, c] = bn(
|
|
5318
5308
|
t.value,
|
|
5319
5309
|
n.value || i.value
|
|
5320
5310
|
), f(), h();
|
|
@@ -5326,7 +5316,7 @@ $$
|
|
|
5326
5316
|
g ? f() : c();
|
|
5327
5317
|
}
|
|
5328
5318
|
), ie(() => {
|
|
5329
|
-
h(), !l && (n.value || i.value) && ([f, c] =
|
|
5319
|
+
h(), !l && (n.value || i.value) && ([f, c] = bn(
|
|
5330
5320
|
t.value,
|
|
5331
5321
|
n.value || i.value
|
|
5332
5322
|
)), s.scrollAuto && f();
|
|
@@ -5358,14 +5348,14 @@ $$
|
|
|
5358
5348
|
- [ ] ` : `
|
|
5359
5349
|
- `;
|
|
5360
5350
|
s.onChange(
|
|
5361
|
-
|
|
5351
|
+
Qt(e.value, k, {})
|
|
5362
5352
|
);
|
|
5363
5353
|
} else {
|
|
5364
5354
|
const k = b == null ? void 0 : b.match(/\d+(?=\.)/), p = k && Number(k[0]) + 1 || 1, w = /^\d\.\s+\[[x\s]\]/.test(b) ? `
|
|
5365
5355
|
${p}. [ ] ` : `
|
|
5366
5356
|
${p}. `;
|
|
5367
5357
|
s.onChange(
|
|
5368
|
-
|
|
5358
|
+
Qt(e.value, w, {})
|
|
5369
5359
|
);
|
|
5370
5360
|
}
|
|
5371
5361
|
}
|
|
@@ -5402,7 +5392,8 @@ ${p}. `;
|
|
|
5402
5392
|
reRender: !1,
|
|
5403
5393
|
mermaidInited: !1
|
|
5404
5394
|
}), l = () => {
|
|
5405
|
-
|
|
5395
|
+
const r = (n == null ? void 0 : n.instance) || window.mermaid;
|
|
5396
|
+
!s.noMermaid && r && (r.initialize({
|
|
5406
5397
|
startOnLoad: !1,
|
|
5407
5398
|
theme: e.value === "dark" ? "dark" : "default"
|
|
5408
5399
|
}), i.reRender = !i.reRender);
|
|
@@ -5547,7 +5538,7 @@ ${p}. `;
|
|
|
5547
5538
|
default: () => {
|
|
5548
5539
|
}
|
|
5549
5540
|
}
|
|
5550
|
-
}), zs = /* @__PURE__ */
|
|
5541
|
+
}), zs = /* @__PURE__ */ ae({
|
|
5551
5542
|
name: "MDEditorContent",
|
|
5552
5543
|
props: Es(),
|
|
5553
5544
|
setup(s) {
|
|
@@ -5596,7 +5587,7 @@ ${p}. `;
|
|
|
5596
5587
|
}, [f.value])])])]);
|
|
5597
5588
|
};
|
|
5598
5589
|
}
|
|
5599
|
-
}), _s = /* @__PURE__ */
|
|
5590
|
+
}), _s = /* @__PURE__ */ ae({
|
|
5600
5591
|
props: {
|
|
5601
5592
|
modelValue: {
|
|
5602
5593
|
type: String,
|
|
@@ -5625,7 +5616,7 @@ const As = () => ({
|
|
|
5625
5616
|
default: () => {
|
|
5626
5617
|
}
|
|
5627
5618
|
}
|
|
5628
|
-
}), Is = /* @__PURE__ */
|
|
5619
|
+
}), Is = /* @__PURE__ */ ae({
|
|
5629
5620
|
props: As(),
|
|
5630
5621
|
setup(s) {
|
|
5631
5622
|
return () => u("div", {
|
|
@@ -5644,7 +5635,7 @@ const As = () => ({
|
|
|
5644
5635
|
default: () => {
|
|
5645
5636
|
}
|
|
5646
5637
|
}
|
|
5647
|
-
}), Fs = /* @__PURE__ */
|
|
5638
|
+
}), Fs = /* @__PURE__ */ ae({
|
|
5648
5639
|
props: Ls(),
|
|
5649
5640
|
setup(s) {
|
|
5650
5641
|
const e = U("usedLanguageText");
|
|
@@ -5683,7 +5674,7 @@ const As = () => ({
|
|
|
5683
5674
|
defFooters: {
|
|
5684
5675
|
type: Object
|
|
5685
5676
|
}
|
|
5686
|
-
}), Os = /* @__PURE__ */
|
|
5677
|
+
}), Os = /* @__PURE__ */ ae({
|
|
5687
5678
|
name: "MDEditorFooter",
|
|
5688
5679
|
props: Rs(),
|
|
5689
5680
|
setup(s) {
|
|
@@ -5740,7 +5731,7 @@ const As = () => ({
|
|
|
5740
5731
|
type: Number,
|
|
5741
5732
|
default: 0
|
|
5742
5733
|
}
|
|
5743
|
-
}), Qn = /* @__PURE__ */
|
|
5734
|
+
}), Qn = /* @__PURE__ */ ae({
|
|
5744
5735
|
props: Ds(),
|
|
5745
5736
|
setup(s) {
|
|
5746
5737
|
return () => {
|
|
@@ -5831,7 +5822,7 @@ const Hs = () => ({
|
|
|
5831
5822
|
onClick: {
|
|
5832
5823
|
type: Function
|
|
5833
5824
|
}
|
|
5834
|
-
}), Vt = /* @__PURE__ */
|
|
5825
|
+
}), Vt = /* @__PURE__ */ ae({
|
|
5835
5826
|
name: "MdCatalog",
|
|
5836
5827
|
props: Hs(),
|
|
5837
5828
|
emits: ["onClick"],
|
|
@@ -5923,7 +5914,7 @@ const Hs = () => ({
|
|
|
5923
5914
|
};
|
|
5924
5915
|
return ie(() => {
|
|
5925
5916
|
l(), x.on(t, {
|
|
5926
|
-
name:
|
|
5917
|
+
name: Yt,
|
|
5927
5918
|
callback(r) {
|
|
5928
5919
|
r && ft(l);
|
|
5929
5920
|
}
|
|
@@ -6328,7 +6319,7 @@ const Hs = () => ({
|
|
|
6328
6319
|
"onBlur",
|
|
6329
6320
|
"onFocus"
|
|
6330
6321
|
];
|
|
6331
|
-
const Ze = /* @__PURE__ */
|
|
6322
|
+
const Ze = /* @__PURE__ */ ae({
|
|
6332
6323
|
name: "MdEditorV3",
|
|
6333
6324
|
props: Ps,
|
|
6334
6325
|
emits: Ms,
|
|
@@ -6428,7 +6419,7 @@ const Ze = /* @__PURE__ */ ce({
|
|
|
6428
6419
|
onClick: {
|
|
6429
6420
|
type: Function
|
|
6430
6421
|
}
|
|
6431
|
-
}),
|
|
6422
|
+
}), sn = /* @__PURE__ */ ae({
|
|
6432
6423
|
name: "NormalToolbar",
|
|
6433
6424
|
props: Bs(),
|
|
6434
6425
|
emits: ["onClick"],
|
|
@@ -6466,7 +6457,7 @@ const Ze = /* @__PURE__ */ ce({
|
|
|
6466
6457
|
overlay: {
|
|
6467
6458
|
type: [String, Object]
|
|
6468
6459
|
}
|
|
6469
|
-
}),
|
|
6460
|
+
}), ln = /* @__PURE__ */ ae({
|
|
6470
6461
|
name: "DropdownToolbar",
|
|
6471
6462
|
props: Ns(),
|
|
6472
6463
|
emits: ["onChange"],
|
|
@@ -6543,7 +6534,7 @@ const qs = () => ({
|
|
|
6543
6534
|
onAdjust: {
|
|
6544
6535
|
type: Function
|
|
6545
6536
|
}
|
|
6546
|
-
}),
|
|
6537
|
+
}), on = /* @__PURE__ */ ae({
|
|
6547
6538
|
name: "ModalToolbar",
|
|
6548
6539
|
props: qs(),
|
|
6549
6540
|
emits: ["onClick", "onClose", "onAdjust"],
|
|
@@ -6562,7 +6553,7 @@ const qs = () => ({
|
|
|
6562
6553
|
onClick: () => {
|
|
6563
6554
|
s.onClick instanceof Function ? s.onClick() : e.emit("onClick");
|
|
6564
6555
|
}
|
|
6565
|
-
}, [t]), u(
|
|
6556
|
+
}, [t]), u(an, {
|
|
6566
6557
|
width: s.width,
|
|
6567
6558
|
height: s.height,
|
|
6568
6559
|
title: s.modalTitle,
|
|
@@ -6581,11 +6572,11 @@ const qs = () => ({
|
|
|
6581
6572
|
};
|
|
6582
6573
|
}
|
|
6583
6574
|
});
|
|
6584
|
-
Ze.install = (s) => (s.component(Ze.name, Ze), s.component(
|
|
6585
|
-
Ze.NormalToolbar =
|
|
6586
|
-
Ze.DropdownToolbar =
|
|
6575
|
+
Ze.install = (s) => (s.component(Ze.name, Ze), s.component(sn.name, sn), s.component(ln.name, ln), s.component(Vt.name, Vt), s.component(on.name, on), s);
|
|
6576
|
+
Ze.NormalToolbar = sn;
|
|
6577
|
+
Ze.DropdownToolbar = ln;
|
|
6587
6578
|
Ze.MdCatalog = Vt;
|
|
6588
|
-
Ze.ModalToolbar =
|
|
6579
|
+
Ze.ModalToolbar = on;
|
|
6589
6580
|
Ze.config = ai;
|
|
6590
6581
|
export {
|
|
6591
6582
|
Ze as default
|