@dcodegroup-au/dsg-vue
Version:
Front-end Vue/Tailwind DSG for UntitledUI.
817 lines (816 loc) • 494 kB
JavaScript
import { defineComponent as Ai, useModel as xi, ref as Vn, watch as Di, useTemplateRef as Hi, onMounted as Oi, openBlock as dt, createElementBlock as Tt, createElementVNode as Wn, createBlock as Ni, createCommentVNode as Fn, Fragment as Ri, renderList as Ii, toDisplayString as Pi, mergeModels as qn } from "vue";
import { g as ji } from "./_commonjsHelpers-C6fGbg64.js";
import { _ as Bi } from "./DsgLabel.vue_vue_type_style_index_0_lang-BYL1w85l.js";
var _t = { exports: {} };
/*!
* Vditor v3.11.2 - A markdown editor written in TypeScript.
*
* MIT License
*
* Copyright (c) 2018-present B3log 开源, b3log.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
var Ui = _t.exports, Kn;
function Vi() {
return Kn || (Kn = 1, (function(we, Xt) {
(function(nt, Y) {
we.exports = Y();
})(Ui, function() {
return (
/******/
(() => {
var pt = {
/***/
173: (
/***/
((Z) => {
var E = function() {
this.Diff_Timeout = 1, this.Diff_EditCost = 4, this.Match_Threshold = 0.5, this.Match_Distance = 1e3, this.Patch_DeleteThreshold = 0.5, this.Patch_Margin = 4, this.Match_MaxBits = 32;
}, M = -1, D = 1, A = 0;
E.Diff = function(c, l) {
return [c, l];
}, E.prototype.diff_main = function(c, l, y, p) {
typeof p > "u" && (this.Diff_Timeout <= 0 ? p = Number.MAX_VALUE : p = (/* @__PURE__ */ new Date()).getTime() + this.Diff_Timeout * 1e3);
var m = p;
if (c == null || l == null)
throw new Error("Null input. (diff_main)");
if (c == l)
return c ? [new E.Diff(A, c)] : [];
typeof y > "u" && (y = !0);
var d = y, v = this.diff_commonPrefix(c, l), w = c.substring(0, v);
c = c.substring(v), l = l.substring(v), v = this.diff_commonSuffix(c, l);
var b = c.substring(c.length - v);
c = c.substring(0, c.length - v), l = l.substring(0, l.length - v);
var g = this.diff_compute_(c, l, d, m);
return w && g.unshift(new E.Diff(A, w)), b && g.push(new E.Diff(A, b)), this.diff_cleanupMerge(g), g;
}, E.prototype.diff_compute_ = function(c, l, y, p) {
var m;
if (!c)
return [new E.Diff(D, l)];
if (!l)
return [new E.Diff(M, c)];
var d = c.length > l.length ? c : l, v = c.length > l.length ? l : c, w = d.indexOf(v);
if (w != -1)
return m = [new E.Diff(D, d.substring(0, w)), new E.Diff(A, v), new E.Diff(D, d.substring(w + v.length))], c.length > l.length && (m[0][0] = m[2][0] = M), m;
if (v.length == 1)
return [new E.Diff(M, c), new E.Diff(D, l)];
var b = this.diff_halfMatch_(c, l);
if (b) {
var g = b[0], s = b[1], C = b[2], _ = b[3], x = b[4], L = this.diff_main(g, C, y, p), P = this.diff_main(s, _, y, p);
return L.concat([new E.Diff(A, x)], P);
}
return y && c.length > 100 && l.length > 100 ? this.diff_lineMode_(c, l, p) : this.diff_bisect_(c, l, p);
}, E.prototype.diff_lineMode_ = function(c, l, y) {
var p = this.diff_linesToChars_(c, l);
c = p.chars1, l = p.chars2;
var m = p.lineArray, d = this.diff_main(c, l, !1, y);
this.diff_charsToLines_(d, m), this.diff_cleanupSemantic(d), d.push(new E.Diff(A, ""));
for (var v = 0, w = 0, b = 0, g = "", s = ""; v < d.length; ) {
switch (d[v][0]) {
case D:
b++, s += d[v][1];
break;
case M:
w++, g += d[v][1];
break;
case A:
if (w >= 1 && b >= 1) {
d.splice(v - w - b, w + b), v = v - w - b;
for (var C = this.diff_main(g, s, !1, y), _ = C.length - 1; _ >= 0; _--)
d.splice(v, 0, C[_]);
v = v + C.length;
}
b = 0, w = 0, g = "", s = "";
break;
}
v++;
}
return d.pop(), d;
}, E.prototype.diff_bisect_ = function(c, l, y) {
for (var p = c.length, m = l.length, d = Math.ceil((p + m) / 2), v = d, w = 2 * d, b = new Array(w), g = new Array(w), s = 0; s < w; s++)
b[s] = -1, g[s] = -1;
b[v + 1] = 0, g[v + 1] = 0;
for (var C = p - m, _ = C % 2 != 0, x = 0, L = 0, P = 0, F = 0, z = 0; z < d && !((/* @__PURE__ */ new Date()).getTime() > y); z++) {
for (var Q = -z + x; Q <= z - L; Q += 2) {
var ne = v + Q, oe;
Q == -z || Q != z && b[ne - 1] < b[ne + 1] ? oe = b[ne + 1] : oe = b[ne - 1] + 1;
for (var me = oe - Q; oe < p && me < m && c.charAt(oe) == l.charAt(me); )
oe++, me++;
if (b[ne] = oe, oe > p)
L += 2;
else if (me > m)
x += 2;
else if (_) {
var fe = v + C - Q;
if (fe >= 0 && fe < w && g[fe] != -1) {
var le = p - g[fe];
if (oe >= le)
return this.diff_bisectSplit_(c, l, oe, me, y);
}
}
}
for (var ve = -z + P; ve <= z - F; ve += 2) {
var fe = v + ve, le;
ve == -z || ve != z && g[fe - 1] < g[fe + 1] ? le = g[fe + 1] : le = g[fe - 1] + 1;
for (var Te = le - ve; le < p && Te < m && c.charAt(p - le - 1) == l.charAt(m - Te - 1); )
le++, Te++;
if (g[fe] = le, le > p)
F += 2;
else if (Te > m)
P += 2;
else if (!_) {
var ne = v + C - ve;
if (ne >= 0 && ne < w && b[ne] != -1) {
var oe = b[ne], me = v + oe - ne;
if (le = p - le, oe >= le)
return this.diff_bisectSplit_(c, l, oe, me, y);
}
}
}
}
return [new E.Diff(M, c), new E.Diff(D, l)];
}, E.prototype.diff_bisectSplit_ = function(c, l, y, p, m) {
var d = c.substring(0, y), v = l.substring(0, p), w = c.substring(y), b = l.substring(p), g = this.diff_main(d, v, !1, m), s = this.diff_main(w, b, !1, m);
return g.concat(s);
}, E.prototype.diff_linesToChars_ = function(c, l) {
var y = [], p = {};
y[0] = "";
function m(b) {
for (var g = "", s = 0, C = -1, _ = y.length; C < b.length - 1; ) {
C = b.indexOf(`
`, s), C == -1 && (C = b.length - 1);
var x = b.substring(s, C + 1);
(p.hasOwnProperty ? p.hasOwnProperty(x) : p[x] !== void 0) ? g += String.fromCharCode(p[x]) : (_ == d && (x = b.substring(s), C = b.length), g += String.fromCharCode(_), p[x] = _, y[_++] = x), s = C + 1;
}
return g;
}
var d = 4e4, v = m(c);
d = 65535;
var w = m(l);
return {
chars1: v,
chars2: w,
lineArray: y
};
}, E.prototype.diff_charsToLines_ = function(c, l) {
for (var y = 0; y < c.length; y++) {
for (var p = c[y][1], m = [], d = 0; d < p.length; d++)
m[d] = l[p.charCodeAt(d)];
c[y][1] = m.join("");
}
}, E.prototype.diff_commonPrefix = function(c, l) {
if (!c || !l || c.charAt(0) != l.charAt(0))
return 0;
for (var y = 0, p = Math.min(c.length, l.length), m = p, d = 0; y < m; )
c.substring(d, m) == l.substring(d, m) ? (y = m, d = y) : p = m, m = Math.floor((p - y) / 2 + y);
return m;
}, E.prototype.diff_commonSuffix = function(c, l) {
if (!c || !l || c.charAt(c.length - 1) != l.charAt(l.length - 1))
return 0;
for (var y = 0, p = Math.min(c.length, l.length), m = p, d = 0; y < m; )
c.substring(c.length - m, c.length - d) == l.substring(l.length - m, l.length - d) ? (y = m, d = y) : p = m, m = Math.floor((p - y) / 2 + y);
return m;
}, E.prototype.diff_commonOverlap_ = function(c, l) {
var y = c.length, p = l.length;
if (y == 0 || p == 0)
return 0;
y > p ? c = c.substring(y - p) : y < p && (l = l.substring(0, y));
var m = Math.min(y, p);
if (c == l)
return m;
for (var d = 0, v = 1; ; ) {
var w = c.substring(m - v), b = l.indexOf(w);
if (b == -1)
return d;
v += b, (b == 0 || c.substring(m - v) == l.substring(0, v)) && (d = v, v++);
}
}, E.prototype.diff_halfMatch_ = function(c, l) {
if (this.Diff_Timeout <= 0)
return null;
var y = c.length > l.length ? c : l, p = c.length > l.length ? l : c;
if (y.length < 4 || p.length * 2 < y.length)
return null;
var m = this;
function d(L, P, F) {
for (var z = L.substring(F, F + Math.floor(L.length / 4)), Q = -1, ne = "", oe, me, fe, le; (Q = P.indexOf(z, Q + 1)) != -1; ) {
var ve = m.diff_commonPrefix(L.substring(F), P.substring(Q)), Te = m.diff_commonSuffix(L.substring(0, F), P.substring(0, Q));
ne.length < Te + ve && (ne = P.substring(Q - Te, Q) + P.substring(Q, Q + ve), oe = L.substring(0, F - Te), me = L.substring(F + ve), fe = P.substring(0, Q - Te), le = P.substring(Q + ve));
}
return ne.length * 2 >= L.length ? [oe, me, fe, le, ne] : null;
}
var v = d(y, p, Math.ceil(y.length / 4)), w = d(y, p, Math.ceil(y.length / 2)), b;
if (!v && !w)
return null;
w ? v ? b = v[4].length > w[4].length ? v : w : b = w : b = v;
var g, s, C, _;
c.length > l.length ? (g = b[0], s = b[1], C = b[2], _ = b[3]) : (C = b[0], _ = b[1], g = b[2], s = b[3]);
var x = b[4];
return [g, s, C, _, x];
}, E.prototype.diff_cleanupSemantic = function(c) {
for (var l = !1, y = [], p = 0, m = null, d = 0, v = 0, w = 0, b = 0, g = 0; d < c.length; )
c[d][0] == A ? (y[p++] = d, v = b, w = g, b = 0, g = 0, m = c[d][1]) : (c[d][0] == D ? b += c[d][1].length : g += c[d][1].length, m && m.length <= Math.max(v, w) && m.length <= Math.max(b, g) && (c.splice(y[p - 1], 0, new E.Diff(M, m)), c[y[p - 1] + 1][0] = D, p--, p--, d = p > 0 ? y[p - 1] : -1, v = 0, w = 0, b = 0, g = 0, m = null, l = !0)), d++;
for (l && this.diff_cleanupMerge(c), this.diff_cleanupSemanticLossless(c), d = 1; d < c.length; ) {
if (c[d - 1][0] == M && c[d][0] == D) {
var s = c[d - 1][1], C = c[d][1], _ = this.diff_commonOverlap_(s, C), x = this.diff_commonOverlap_(C, s);
_ >= x ? (_ >= s.length / 2 || _ >= C.length / 2) && (c.splice(d, 0, new E.Diff(A, C.substring(0, _))), c[d - 1][1] = s.substring(0, s.length - _), c[d + 1][1] = C.substring(_), d++) : (x >= s.length / 2 || x >= C.length / 2) && (c.splice(d, 0, new E.Diff(A, s.substring(0, x))), c[d - 1][0] = D, c[d - 1][1] = C.substring(0, C.length - x), c[d + 1][0] = M, c[d + 1][1] = s.substring(x), d++), d++;
}
d++;
}
}, E.prototype.diff_cleanupSemanticLossless = function(c) {
function l(x, L) {
if (!x || !L)
return 6;
var P = x.charAt(x.length - 1), F = L.charAt(0), z = P.match(E.nonAlphaNumericRegex_), Q = F.match(E.nonAlphaNumericRegex_), ne = z && P.match(E.whitespaceRegex_), oe = Q && F.match(E.whitespaceRegex_), me = ne && P.match(E.linebreakRegex_), fe = oe && F.match(E.linebreakRegex_), le = me && x.match(E.blanklineEndRegex_), ve = fe && L.match(E.blanklineStartRegex_);
return le || ve ? 5 : me || fe ? 4 : z && !ne && oe ? 3 : ne || oe ? 2 : z || Q ? 1 : 0;
}
for (var y = 1; y < c.length - 1; ) {
if (c[y - 1][0] == A && c[y + 1][0] == A) {
var p = c[y - 1][1], m = c[y][1], d = c[y + 1][1], v = this.diff_commonSuffix(p, m);
if (v) {
var w = m.substring(m.length - v);
p = p.substring(0, p.length - v), m = w + m.substring(0, m.length - v), d = w + d;
}
for (var b = p, g = m, s = d, C = l(p, m) + l(m, d); m.charAt(0) === d.charAt(0); ) {
p += m.charAt(0), m = m.substring(1) + d.charAt(0), d = d.substring(1);
var _ = l(p, m) + l(m, d);
_ >= C && (C = _, b = p, g = m, s = d);
}
c[y - 1][1] != b && (b ? c[y - 1][1] = b : (c.splice(y - 1, 1), y--), c[y][1] = g, s ? c[y + 1][1] = s : (c.splice(y + 1, 1), y--));
}
y++;
}
}, E.nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/, E.whitespaceRegex_ = /\s/, E.linebreakRegex_ = /[\r\n]/, E.blanklineEndRegex_ = /\n\r?\n$/, E.blanklineStartRegex_ = /^\r?\n\r?\n/, E.prototype.diff_cleanupEfficiency = function(c) {
for (var l = !1, y = [], p = 0, m = null, d = 0, v = !1, w = !1, b = !1, g = !1; d < c.length; )
c[d][0] == A ? (c[d][1].length < this.Diff_EditCost && (b || g) ? (y[p++] = d, v = b, w = g, m = c[d][1]) : (p = 0, m = null), b = g = !1) : (c[d][0] == M ? g = !0 : b = !0, m && (v && w && b && g || m.length < this.Diff_EditCost / 2 && v + w + b + g == 3) && (c.splice(y[p - 1], 0, new E.Diff(M, m)), c[y[p - 1] + 1][0] = D, p--, m = null, v && w ? (b = g = !0, p = 0) : (p--, d = p > 0 ? y[p - 1] : -1, b = g = !1), l = !0)), d++;
l && this.diff_cleanupMerge(c);
}, E.prototype.diff_cleanupMerge = function(c) {
c.push(new E.Diff(A, ""));
for (var l = 0, y = 0, p = 0, m = "", d = "", v; l < c.length; )
switch (c[l][0]) {
case D:
p++, d += c[l][1], l++;
break;
case M:
y++, m += c[l][1], l++;
break;
case A:
y + p > 1 ? (y !== 0 && p !== 0 && (v = this.diff_commonPrefix(d, m), v !== 0 && (l - y - p > 0 && c[l - y - p - 1][0] == A ? c[l - y - p - 1][1] += d.substring(0, v) : (c.splice(0, 0, new E.Diff(A, d.substring(0, v))), l++), d = d.substring(v), m = m.substring(v)), v = this.diff_commonSuffix(d, m), v !== 0 && (c[l][1] = d.substring(d.length - v) + c[l][1], d = d.substring(0, d.length - v), m = m.substring(0, m.length - v))), l -= y + p, c.splice(l, y + p), m.length && (c.splice(l, 0, new E.Diff(M, m)), l++), d.length && (c.splice(l, 0, new E.Diff(D, d)), l++), l++) : l !== 0 && c[l - 1][0] == A ? (c[l - 1][1] += c[l][1], c.splice(l, 1)) : l++, p = 0, y = 0, m = "", d = "";
break;
}
c[c.length - 1][1] === "" && c.pop();
var w = !1;
for (l = 1; l < c.length - 1; )
c[l - 1][0] == A && c[l + 1][0] == A && (c[l][1].substring(c[l][1].length - c[l - 1][1].length) == c[l - 1][1] ? (c[l][1] = c[l - 1][1] + c[l][1].substring(0, c[l][1].length - c[l - 1][1].length), c[l + 1][1] = c[l - 1][1] + c[l + 1][1], c.splice(l - 1, 1), w = !0) : c[l][1].substring(0, c[l + 1][1].length) == c[l + 1][1] && (c[l - 1][1] += c[l + 1][1], c[l][1] = c[l][1].substring(c[l + 1][1].length) + c[l + 1][1], c.splice(l + 1, 1), w = !0)), l++;
w && this.diff_cleanupMerge(c);
}, E.prototype.diff_xIndex = function(c, l) {
var y = 0, p = 0, m = 0, d = 0, v;
for (v = 0; v < c.length && (c[v][0] !== D && (y += c[v][1].length), c[v][0] !== M && (p += c[v][1].length), !(y > l)); v++)
m = y, d = p;
return c.length != v && c[v][0] === M ? d : d + (l - m);
}, E.prototype.diff_prettyHtml = function(c) {
for (var l = [], y = /&/g, p = /</g, m = />/g, d = /\n/g, v = 0; v < c.length; v++) {
var w = c[v][0], b = c[v][1], g = b.replace(y, "&").replace(p, "<").replace(m, ">").replace(d, "¶<br>");
switch (w) {
case D:
l[v] = '<ins style="background:#e6ffe6;">' + g + "</ins>";
break;
case M:
l[v] = '<del style="background:#ffe6e6;">' + g + "</del>";
break;
case A:
l[v] = "<span>" + g + "</span>";
break;
}
}
return l.join("");
}, E.prototype.diff_text1 = function(c) {
for (var l = [], y = 0; y < c.length; y++)
c[y][0] !== D && (l[y] = c[y][1]);
return l.join("");
}, E.prototype.diff_text2 = function(c) {
for (var l = [], y = 0; y < c.length; y++)
c[y][0] !== M && (l[y] = c[y][1]);
return l.join("");
}, E.prototype.diff_levenshtein = function(c) {
for (var l = 0, y = 0, p = 0, m = 0; m < c.length; m++) {
var d = c[m][0], v = c[m][1];
switch (d) {
case D:
y += v.length;
break;
case M:
p += v.length;
break;
case A:
l += Math.max(y, p), y = 0, p = 0;
break;
}
}
return l += Math.max(y, p), l;
}, E.prototype.diff_toDelta = function(c) {
for (var l = [], y = 0; y < c.length; y++)
switch (c[y][0]) {
case D:
l[y] = "+" + encodeURI(c[y][1]);
break;
case M:
l[y] = "-" + c[y][1].length;
break;
case A:
l[y] = "=" + c[y][1].length;
break;
}
return l.join(" ").replace(/%20/g, " ");
}, E.prototype.diff_fromDelta = function(c, l) {
for (var y = [], p = 0, m = 0, d = l.split(/\t/g), v = 0; v < d.length; v++) {
var w = d[v].substring(1);
switch (d[v].charAt(0)) {
case "+":
try {
y[p++] = new E.Diff(D, decodeURI(w));
} catch {
throw new Error("Illegal escape in diff_fromDelta: " + w);
}
break;
case "-":
// Fall through.
case "=":
var b = parseInt(w, 10);
if (isNaN(b) || b < 0)
throw new Error("Invalid number in diff_fromDelta: " + w);
var g = c.substring(m, m += b);
d[v].charAt(0) == "=" ? y[p++] = new E.Diff(A, g) : y[p++] = new E.Diff(M, g);
break;
default:
if (d[v])
throw new Error("Invalid diff operation in diff_fromDelta: " + d[v]);
}
}
if (m != c.length)
throw new Error("Delta length (" + m + ") does not equal source text length (" + c.length + ").");
return y;
}, E.prototype.match_main = function(c, l, y) {
if (c == null || l == null || y == null)
throw new Error("Null input. (match_main)");
return y = Math.max(0, Math.min(y, c.length)), c == l ? 0 : c.length ? c.substring(y, y + l.length) == l ? y : this.match_bitap_(c, l, y) : -1;
}, E.prototype.match_bitap_ = function(c, l, y) {
if (l.length > this.Match_MaxBits)
throw new Error("Pattern too long for this browser.");
var p = this.match_alphabet_(l), m = this;
function d(oe, me) {
var fe = oe / l.length, le = Math.abs(y - me);
return m.Match_Distance ? fe + le / m.Match_Distance : le ? 1 : fe;
}
var v = this.Match_Threshold, w = c.indexOf(l, y);
w != -1 && (v = Math.min(d(0, w), v), w = c.lastIndexOf(l, y + l.length), w != -1 && (v = Math.min(d(0, w), v)));
var b = 1 << l.length - 1;
w = -1;
for (var g, s, C = l.length + c.length, _, x = 0; x < l.length; x++) {
for (g = 0, s = C; g < s; )
d(x, y + s) <= v ? g = s : C = s, s = Math.floor((C - g) / 2 + g);
C = s;
var L = Math.max(1, y - s + 1), P = Math.min(y + s, c.length) + l.length, F = Array(P + 2);
F[P + 1] = (1 << x) - 1;
for (var z = P; z >= L; z--) {
var Q = p[c.charAt(z - 1)];
if (x === 0 ? F[z] = (F[z + 1] << 1 | 1) & Q : F[z] = (F[z + 1] << 1 | 1) & Q | ((_[z + 1] | _[z]) << 1 | 1) | _[z + 1], F[z] & b) {
var ne = d(x, z - 1);
if (ne <= v)
if (v = ne, w = z - 1, w > y)
L = Math.max(1, 2 * y - w);
else
break;
}
}
if (d(x + 1, y) > v)
break;
_ = F;
}
return w;
}, E.prototype.match_alphabet_ = function(c) {
for (var l = {}, y = 0; y < c.length; y++)
l[c.charAt(y)] = 0;
for (var y = 0; y < c.length; y++)
l[c.charAt(y)] |= 1 << c.length - y - 1;
return l;
}, E.prototype.patch_addContext_ = function(c, l) {
if (l.length != 0) {
if (c.start2 === null)
throw Error("patch not initialized");
for (var y = l.substring(c.start2, c.start2 + c.length1), p = 0; l.indexOf(y) != l.lastIndexOf(y) && y.length < this.Match_MaxBits - this.Patch_Margin - this.Patch_Margin; )
p += this.Patch_Margin, y = l.substring(c.start2 - p, c.start2 + c.length1 + p);
p += this.Patch_Margin;
var m = l.substring(c.start2 - p, c.start2);
m && c.diffs.unshift(new E.Diff(A, m));
var d = l.substring(c.start2 + c.length1, c.start2 + c.length1 + p);
d && c.diffs.push(new E.Diff(A, d)), c.start1 -= m.length, c.start2 -= m.length, c.length1 += m.length + d.length, c.length2 += m.length + d.length;
}
}, E.prototype.patch_make = function(c, l, y) {
var p, m;
if (typeof c == "string" && typeof l == "string" && typeof y > "u")
p = /** @type {string} */
c, m = this.diff_main(
p,
/** @type {string} */
l,
!0
), m.length > 2 && (this.diff_cleanupSemantic(m), this.diff_cleanupEfficiency(m));
else if (c && typeof c == "object" && typeof l > "u" && typeof y > "u")
m = /** @type {!Array.<!diff_match_patch.Diff>} */
c, p = this.diff_text1(m);
else if (typeof c == "string" && l && typeof l == "object" && typeof y > "u")
p = /** @type {string} */
c, m = /** @type {!Array.<!diff_match_patch.Diff>} */
l;
else if (typeof c == "string" && typeof l == "string" && y && typeof y == "object")
p = /** @type {string} */
c, m = /** @type {!Array.<!diff_match_patch.Diff>} */
y;
else
throw new Error("Unknown call format to patch_make.");
if (m.length === 0)
return [];
for (var d = [], v = new E.patch_obj(), w = 0, b = 0, g = 0, s = p, C = p, _ = 0; _ < m.length; _++) {
var x = m[_][0], L = m[_][1];
switch (!w && x !== A && (v.start1 = b, v.start2 = g), x) {
case D:
v.diffs[w++] = m[_], v.length2 += L.length, C = C.substring(0, g) + L + C.substring(g);
break;
case M:
v.length1 += L.length, v.diffs[w++] = m[_], C = C.substring(0, g) + C.substring(g + L.length);
break;
case A:
L.length <= 2 * this.Patch_Margin && w && m.length != _ + 1 ? (v.diffs[w++] = m[_], v.length1 += L.length, v.length2 += L.length) : L.length >= 2 * this.Patch_Margin && w && (this.patch_addContext_(v, s), d.push(v), v = new E.patch_obj(), w = 0, s = C, b = g);
break;
}
x !== D && (b += L.length), x !== M && (g += L.length);
}
return w && (this.patch_addContext_(v, s), d.push(v)), d;
}, E.prototype.patch_deepCopy = function(c) {
for (var l = [], y = 0; y < c.length; y++) {
var p = c[y], m = new E.patch_obj();
m.diffs = [];
for (var d = 0; d < p.diffs.length; d++)
m.diffs[d] = new E.Diff(p.diffs[d][0], p.diffs[d][1]);
m.start1 = p.start1, m.start2 = p.start2, m.length1 = p.length1, m.length2 = p.length2, l[y] = m;
}
return l;
}, E.prototype.patch_apply = function(c, l) {
if (c.length == 0)
return [l, []];
c = this.patch_deepCopy(c);
var y = this.patch_addPadding(c);
l = y + l + y, this.patch_splitMax(c);
for (var p = 0, m = [], d = 0; d < c.length; d++) {
var v = c[d].start2 + p, w = this.diff_text1(c[d].diffs), b, g = -1;
if (w.length > this.Match_MaxBits ? (b = this.match_main(l, w.substring(0, this.Match_MaxBits), v), b != -1 && (g = this.match_main(l, w.substring(w.length - this.Match_MaxBits), v + w.length - this.Match_MaxBits), (g == -1 || b >= g) && (b = -1))) : b = this.match_main(l, w, v), b == -1)
m[d] = !1, p -= c[d].length2 - c[d].length1;
else {
m[d] = !0, p = b - v;
var s;
if (g == -1 ? s = l.substring(b, b + w.length) : s = l.substring(b, g + this.Match_MaxBits), w == s)
l = l.substring(0, b) + this.diff_text2(c[d].diffs) + l.substring(b + w.length);
else {
var C = this.diff_main(w, s, !1);
if (w.length > this.Match_MaxBits && this.diff_levenshtein(C) / w.length > this.Patch_DeleteThreshold)
m[d] = !1;
else {
this.diff_cleanupSemanticLossless(C);
for (var _ = 0, x, L = 0; L < c[d].diffs.length; L++) {
var P = c[d].diffs[L];
P[0] !== A && (x = this.diff_xIndex(C, _)), P[0] === D ? l = l.substring(0, b + x) + P[1] + l.substring(b + x) : P[0] === M && (l = l.substring(0, b + x) + l.substring(b + this.diff_xIndex(C, _ + P[1].length))), P[0] !== M && (_ += P[1].length);
}
}
}
}
}
return l = l.substring(y.length, l.length - y.length), [l, m];
}, E.prototype.patch_addPadding = function(c) {
for (var l = this.Patch_Margin, y = "", p = 1; p <= l; p++)
y += String.fromCharCode(p);
for (var p = 0; p < c.length; p++)
c[p].start1 += l, c[p].start2 += l;
var m = c[0], d = m.diffs;
if (d.length == 0 || d[0][0] != A)
d.unshift(new E.Diff(A, y)), m.start1 -= l, m.start2 -= l, m.length1 += l, m.length2 += l;
else if (l > d[0][1].length) {
var v = l - d[0][1].length;
d[0][1] = y.substring(d[0][1].length) + d[0][1], m.start1 -= v, m.start2 -= v, m.length1 += v, m.length2 += v;
}
if (m = c[c.length - 1], d = m.diffs, d.length == 0 || d[d.length - 1][0] != A)
d.push(new E.Diff(A, y)), m.length1 += l, m.length2 += l;
else if (l > d[d.length - 1][1].length) {
var v = l - d[d.length - 1][1].length;
d[d.length - 1][1] += y.substring(0, v), m.length1 += v, m.length2 += v;
}
return y;
}, E.prototype.patch_splitMax = function(c) {
for (var l = this.Match_MaxBits, y = 0; y < c.length; y++)
if (!(c[y].length1 <= l)) {
var p = c[y];
c.splice(y--, 1);
for (var m = p.start1, d = p.start2, v = ""; p.diffs.length !== 0; ) {
var w = new E.patch_obj(), b = !0;
for (w.start1 = m - v.length, w.start2 = d - v.length, v !== "" && (w.length1 = w.length2 = v.length, w.diffs.push(new E.Diff(A, v))); p.diffs.length !== 0 && w.length1 < l - this.Patch_Margin; ) {
var g = p.diffs[0][0], s = p.diffs[0][1];
g === D ? (w.length2 += s.length, d += s.length, w.diffs.push(p.diffs.shift()), b = !1) : g === M && w.diffs.length == 1 && w.diffs[0][0] == A && s.length > 2 * l ? (w.length1 += s.length, m += s.length, b = !1, w.diffs.push(new E.Diff(g, s)), p.diffs.shift()) : (s = s.substring(0, l - w.length1 - this.Patch_Margin), w.length1 += s.length, m += s.length, g === A ? (w.length2 += s.length, d += s.length) : b = !1, w.diffs.push(new E.Diff(g, s)), s == p.diffs[0][1] ? p.diffs.shift() : p.diffs[0][1] = p.diffs[0][1].substring(s.length));
}
v = this.diff_text2(w.diffs), v = v.substring(v.length - this.Patch_Margin);
var C = this.diff_text1(p.diffs).substring(0, this.Patch_Margin);
C !== "" && (w.length1 += C.length, w.length2 += C.length, w.diffs.length !== 0 && w.diffs[w.diffs.length - 1][0] === A ? w.diffs[w.diffs.length - 1][1] += C : w.diffs.push(new E.Diff(A, C))), b || c.splice(++y, 0, w);
}
}
}, E.prototype.patch_toText = function(c) {
for (var l = [], y = 0; y < c.length; y++)
l[y] = c[y];
return l.join("");
}, E.prototype.patch_fromText = function(c) {
var l = [];
if (!c)
return l;
for (var y = c.split(`
`), p = 0, m = /^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/; p < y.length; ) {
var d = y[p].match(m);
if (!d)
throw new Error("Invalid patch string: " + y[p]);
var v = new E.patch_obj();
for (l.push(v), v.start1 = parseInt(d[1], 10), d[2] === "" ? (v.start1--, v.length1 = 1) : d[2] == "0" ? v.length1 = 0 : (v.start1--, v.length1 = parseInt(d[2], 10)), v.start2 = parseInt(d[3], 10), d[4] === "" ? (v.start2--, v.length2 = 1) : d[4] == "0" ? v.length2 = 0 : (v.start2--, v.length2 = parseInt(d[4], 10)), p++; p < y.length; ) {
var w = y[p].charAt(0);
try {
var b = decodeURI(y[p].substring(1));
} catch {
throw new Error("Illegal escape in patch_fromText: " + b);
}
if (w == "-")
v.diffs.push(new E.Diff(M, b));
else if (w == "+")
v.diffs.push(new E.Diff(D, b));
else if (w == " ")
v.diffs.push(new E.Diff(A, b));
else {
if (w == "@")
break;
if (w !== "") throw new Error('Invalid patch mode "' + w + '" in: ' + b);
}
p++;
}
}
return l;
}, E.patch_obj = function() {
this.diffs = [], this.start1 = null, this.start2 = null, this.length1 = 0, this.length2 = 0;
}, E.patch_obj.prototype.toString = function() {
var c, l;
this.length1 === 0 ? c = this.start1 + ",0" : this.length1 == 1 ? c = this.start1 + 1 : c = this.start1 + 1 + "," + this.length1, this.length2 === 0 ? l = this.start2 + ",0" : this.length2 == 1 ? l = this.start2 + 1 : l = this.start2 + 1 + "," + this.length2;
for (var y = ["@@ -" + c + " +" + l + ` @@
`], p, m = 0; m < this.diffs.length; m++) {
switch (this.diffs[m][0]) {
case D:
p = "+";
break;
case M:
p = "-";
break;
case A:
p = " ";
break;
}
y[m + 1] = p + encodeURI(this.diffs[m][1]) + `
`;
}
return y.join("").replace(/%20/g, " ");
}, Z.exports = E, Z.exports.diff_match_patch = E, Z.exports.DIFF_DELETE = M, Z.exports.DIFF_INSERT = D, Z.exports.DIFF_EQUAL = A;
})
),
/***/
408: (
/***/
((Z, E, M) => {
M.d(E, {
default: () => (
/* binding */
Fe
)
});
var D = M(135), A = M(840), c = M(775), l = M(428), y = M(325), p = M(483), m = M(999), d = function(I) {
I === void 0 && (I = document);
var re = function(W) {
var j = document.createElement("img");
j.src = W.getAttribute("data-src"), j.addEventListener("load", function() {
!W.getAttribute("style") && !W.getAttribute("class") && !W.getAttribute("width") && !W.getAttribute("height") && j.naturalHeight > j.naturalWidth && j.naturalWidth / j.naturalHeight < document.querySelector(".vditor-reset").clientWidth / (window.innerHeight - 40) && j.naturalHeight > window.innerHeight - 40 && (W.style.height = window.innerHeight - 40 + "px"), W.src = j.src;
}), W.removeAttribute("data-src");
};
if (!("IntersectionObserver" in window))
return I.querySelectorAll("img").forEach(function(W) {
W.getAttribute("data-src") && re(W);
}), !1;
window.vditorImageIntersectionObserver ? (window.vditorImageIntersectionObserver.disconnect(), I.querySelectorAll("img").forEach(function(W) {
window.vditorImageIntersectionObserver.observe(W);
})) : (window.vditorImageIntersectionObserver = new IntersectionObserver(function(W) {
W.forEach(function(j) {
(typeof j.isIntersecting > "u" ? j.intersectionRatio !== 0 : j.isIntersecting) && j.target.getAttribute("data-src") && re(j.target);
});
}), I.querySelectorAll("img").forEach(function(W) {
window.vditorImageIntersectionObserver.observe(W);
}));
}, v = M(472), w = M(280), b = M(637), g = M(825), s = M(11), C = M(194), _ = M(436), x = M(229), L = M(145), P = M(538), F = M(413), z = M(106), Q = M(673), ne = function(I) {
document.querySelectorAll(".vditor-anchor").forEach(function(re) {
I === 1 && re.classList.add("vditor-anchor--left"), re.onclick = function() {
var W = re.getAttribute("href").substr(1), j = document.getElementById("vditorAnchor-" + W).offsetTop;
document.querySelector("html").scrollTop = j;
};
}), window.onhashchange = function() {
var re = document.getElementById("vditorAnchor-" + decodeURIComponent(window.location.hash.substr(1)));
re && (document.querySelector("html").scrollTop = re.offsetTop);
};
}, oe = M(214), me = M(810), fe = function(I, re) {
if (re === void 0 && (re = "zh_CN"), !(typeof speechSynthesis > "u" || typeof SpeechSynthesisUtterance > "u")) {
var W = function() {
var Me = speechSynthesis.getVoices(), X, de;
return Me.forEach(function(De) {
De.lang === re.replace("_", "-") && (X = De), De.default && (de = De);
}), X || (X = de), X;
}, j = '<svg><use xlink:href="#vditor-icon-play"></use></svg>', pe = '<svg><use xlink:href="#vditor-icon-pause"></use></svg>';
document.getElementById("vditorIconScript") || (j = '<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>', pe = '<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');
var K = document.querySelector(".vditor-speech");
K || (K = document.createElement("button"), K.className = "vditor-speech", I.insertAdjacentElement("beforeend", K), speechSynthesis.onvoiceschanged !== void 0 && (speechSynthesis.onvoiceschanged = W));
var ge = W(), ie = new SpeechSynthesisUtterance();
ie.voice = ge, ie.onend = ie.onerror = function() {
K.style.display = "none", speechSynthesis.cancel(), K.classList.remove("vditor-speech--current"), K.innerHTML = j;
}, I.addEventListener(window.ontouchstart !== void 0 ? "touchend" : "click", function(Me) {
var X = Me.target;
if (X.classList.contains("vditor-speech") || X.parentElement.classList.contains("vditor-speech")) {
K.classList.contains("vditor-speech--current") ? speechSynthesis.speaking && (speechSynthesis.paused ? (speechSynthesis.resume(), K.innerHTML = pe) : (speechSynthesis.pause(), K.innerHTML = j)) : (ie.text = K.getAttribute("data-text"), speechSynthesis.speak(ie), K.classList.add("vditor-speech--current"), K.innerHTML = pe), (0, me.Hc)(window.vditorSpeechRange), I.focus();
return;
}
if (K.style.display = "none", speechSynthesis.cancel(), K.classList.remove("vditor-speech--current"), K.innerHTML = j, getSelection().rangeCount !== 0) {
var de = getSelection().getRangeAt(0), De = de.toString().trim();
if (De) {
window.vditorSpeechRange = de.cloneRange();
var Ne = de.getBoundingClientRect();
K.innerHTML = j, K.style.display = "block", K.style.top = Ne.top + Ne.height + document.querySelector("html").scrollTop - 20 + "px", window.ontouchstart !== void 0 ? K.style.left = Me.changedTouches[Me.changedTouches.length - 1].pageX + 2 + "px" : K.style.left = Me.clientX + 2 + "px", K.setAttribute("data-text", De);
}
}
});
}
}, le = function(I, re, W, j) {
function pe(K) {
return K instanceof W ? K : new W(function(ge) {
ge(K);
});
}
return new (W || (W = Promise))(function(K, ge) {
function ie(de) {
try {
X(j.next(de));
} catch (De) {
ge(De);
}
}
function Me(de) {
try {
X(j.throw(de));
} catch (De) {
ge(De);
}
}
function X(de) {
de.done ? K(de.value) : pe(de.value).then(ie, Me);
}
X((j = j.apply(I, re || [])).next());
});
}, ve = function(I, re) {
var W = { label: 0, sent: function() {
if (K[0] & 1) throw K[1];
return K[1];
}, trys: [], ops: [] }, j, pe, K, ge;
return ge = { next: ie(0), throw: ie(1), return: ie(2) }, typeof Symbol == "function" && (ge[Symbol.iterator] = function() {
return this;
}), ge;
function ie(X) {
return function(de) {
return Me([X, de]);
};
}
function Me(X) {
if (j) throw new TypeError("Generator is already executing.");
for (; ge && (ge = 0, X[0] && (W = 0)), W; ) try {
if (j = 1, pe && (K = X[0] & 2 ? pe.return : X[0] ? pe.throw || ((K = pe.return) && K.call(pe), 0) : pe.next) && !(K = K.call(pe, X[1])).done) return K;
switch (pe = 0, K && (X = [X[0] & 2, K.value]), X[0]) {
case 0:
case 1:
K = X;
break;
case 4:
return W.label++, { value: X[1], done: !1 };
case 5:
W.label++, pe = X[1], X = [0];
continue;
case 7:
X = W.ops.pop(), W.trys.pop();
continue;
default:
if (K = W.trys, !(K = K.length > 0 && K[K.length - 1]) && (X[0] === 6 || X[0] === 2)) {
W = 0;
continue;
}
if (X[0] === 3 && (!K || X[1] > K[0] && X[1] < K[3])) {
W.label = X[1];
break;
}
if (X[0] === 6 && W.label < K[1]) {
W.label = K[1], K = X;
break;
}
if (K && W.label < K[2]) {
W.label = K[2], W.ops.push(X);
break;
}
K[2] && W.ops.pop(), W.trys.pop();
continue;
}
X = re.call(I, W);
} catch (de) {
X = [6, de], pe = 0;
} finally {
j = K = 0;
}
if (X[0] & 5) throw X[1];
return { value: X[0] ? X[1] : void 0, done: !0 };
}
}, Te = function(I) {
var re, W = {
anchor: 0,
cdn: L.g.CDN,
customEmoji: {},
emojiPath: "".concat(L.g.CDN, "/dist/images/emoji"),
hljs: L.g.HLJS_OPTIONS,
icon: "ant",
lang: "zh_CN",
markdown: L.g.MARKDOWN_OPTIONS,
math: L.g.MATH_OPTIONS,
mode: "light",
speech: {
enable: !1
},
render: {
media: {
enable: !0
}
},
theme: L.g.THEME_OPTIONS
};
return I.cdn && (!((re = I.theme) === null || re === void 0) && re.path || (W.theme.path = "".concat(I.cdn, "/dist/css/content-theme")), I.emojiPath || (W.emojiPath = "".concat(I.cdn, "/dist/images/emoji"))), (0, Q.T)(W, I);
}, Ee = function(I, re) {
var W = Te(re);
return (0, F.G)("".concat(W.cdn, "/dist/js/lute/lute.min.js"), "vditorLuteScript").then(function() {
var j = (0, oe.X)({
autoSpace: W.markdown.autoSpace,
gfmAutoLink: W.markdown.gfmAutoLink,
codeBlockPreview: W.markdown.codeBlockPreview,
emojiSite: W.emojiPath,
emojis: W.customEmoji,
fixTermTypo: W.markdown.fixTermTypo,
footnotes: W.markdown.footnotes,
headingAnchor: W.anchor !== 0,
inlineMathDigit: W.math.inlineDigit,
lazyLoadImage: W.lazyLoadImage,
linkBase: W.markdown.linkBase,
linkPrefix: W.markdown.linkPrefix,
listStyle: W.markdown.listStyle,
mark: W.markdown.mark,
mathBlockPreview: W.markdown.mathBlockPreview,
paragraphBeginningSpace: W.markdown.paragraphBeginningSpace,
sanitize: W.markdown.sanitize,
toc: W.markdown.toc
});
return re?.renderers && j.SetJSRenderers({
renderers: {
Md2HTML: re.renderers
}
}), j.SetHeadingID(!0), j.Md2HTML(I);
});
}, k = function(I, re, W) {
return le(void 0, void 0, void 0, function() {
var j, pe, K, ge;
return ve(this, function(ie) {
switch (ie.label) {
case 0:
return j = Te(W), [4, Ee(re, j)];