v-code-diff 1.10.0 → 1.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/README.md +19 -18
- package/dist/v2/index.cjs.js +14 -14
- package/dist/v2/index.es.js +742 -736
- package/dist/v2/index.umd.js +14 -14
- package/dist/v2.7/index.cjs.js +10 -10
- package/dist/v2.7/index.es.js +599 -598
- package/dist/v2.7/index.umd.js +10 -10
- package/dist/v3/index.cjs.js +14 -14
- package/dist/v3/index.es.js +809 -808
- package/dist/v3/index.umd.js +13 -13
- package/package.json +3 -2
- package/src/CodeDiff.vue +4 -2
- package/src/utils.ts +6 -4
package/dist/v2/index.es.js
CHANGED
|
@@ -10,12 +10,12 @@ function ne() {
|
|
|
10
10
|
}
|
|
11
11
|
ne.prototype = {
|
|
12
12
|
diff: function(n, a) {
|
|
13
|
-
var u = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {},
|
|
14
|
-
typeof u == "function" && (
|
|
13
|
+
var u = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, g = u.callback;
|
|
14
|
+
typeof u == "function" && (g = u, u = {}), this.options = u;
|
|
15
15
|
var t = this;
|
|
16
16
|
function r(p) {
|
|
17
|
-
return
|
|
18
|
-
|
|
17
|
+
return g ? (setTimeout(function() {
|
|
18
|
+
g(void 0, p);
|
|
19
19
|
}, 0), !0) : p;
|
|
20
20
|
}
|
|
21
21
|
n = this.castInput(n), a = this.castInput(a), n = this.removeEmpty(this.tokenize(n)), a = this.removeEmpty(this.tokenize(a));
|
|
@@ -30,40 +30,40 @@ ne.prototype = {
|
|
|
30
30
|
value: this.join(a),
|
|
31
31
|
count: a.length
|
|
32
32
|
}]);
|
|
33
|
-
function
|
|
33
|
+
function h() {
|
|
34
34
|
for (var p = -1 * o; p <= o; p += 2) {
|
|
35
|
-
var _ = void 0,
|
|
36
|
-
|
|
37
|
-
var
|
|
38
|
-
if (!
|
|
35
|
+
var _ = void 0, v = c[p - 1], E = c[p + 1], m = (E ? E.newPos : 0) - p;
|
|
36
|
+
v && (c[p - 1] = void 0);
|
|
37
|
+
var N = v && v.newPos + 1 < i, D = E && 0 <= m && m < s;
|
|
38
|
+
if (!N && !D) {
|
|
39
39
|
c[p] = void 0;
|
|
40
40
|
continue;
|
|
41
41
|
}
|
|
42
|
-
if (!
|
|
42
|
+
if (!N || D && v.newPos < E.newPos ? (_ = Wn(E), t.pushComponent(_.components, void 0, !0)) : (_ = v, _.newPos++, t.pushComponent(_.components, !0, void 0)), m = t.extractCommon(_, a, n, p), _.newPos + 1 >= i && m + 1 >= s)
|
|
43
43
|
return r(Kn(t, _.components, a, n, t.useLongestToken));
|
|
44
44
|
c[p] = _;
|
|
45
45
|
}
|
|
46
46
|
o++;
|
|
47
47
|
}
|
|
48
|
-
if (
|
|
48
|
+
if (g)
|
|
49
49
|
(function p() {
|
|
50
50
|
setTimeout(function() {
|
|
51
51
|
if (o > l)
|
|
52
|
-
return
|
|
53
|
-
|
|
52
|
+
return g();
|
|
53
|
+
h() || p();
|
|
54
54
|
}, 0);
|
|
55
55
|
})();
|
|
56
56
|
else
|
|
57
57
|
for (; o <= l; ) {
|
|
58
|
-
var d =
|
|
58
|
+
var d = h();
|
|
59
59
|
if (d)
|
|
60
60
|
return d;
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
pushComponent: function(n, a, u) {
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
count:
|
|
64
|
+
var g = n[n.length - 1];
|
|
65
|
+
g && g.added === a && g.removed === u ? n[n.length - 1] = {
|
|
66
|
+
count: g.count + 1,
|
|
67
67
|
added: a,
|
|
68
68
|
removed: u
|
|
69
69
|
} : n.push({
|
|
@@ -72,8 +72,8 @@ ne.prototype = {
|
|
|
72
72
|
removed: u
|
|
73
73
|
});
|
|
74
74
|
},
|
|
75
|
-
extractCommon: function(n, a, u,
|
|
76
|
-
for (var t = a.length, r = u.length, i = n.newPos, s = i -
|
|
75
|
+
extractCommon: function(n, a, u, g) {
|
|
76
|
+
for (var t = a.length, r = u.length, i = n.newPos, s = i - g, o = 0; i + 1 < t && s + 1 < r && this.equals(a[i + 1], u[s + 1]); )
|
|
77
77
|
i++, s++, o++;
|
|
78
78
|
return o && n.components.push({
|
|
79
79
|
count: o
|
|
@@ -97,7 +97,7 @@ ne.prototype = {
|
|
|
97
97
|
return n.join("");
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
-
function Kn(e, n, a, u,
|
|
100
|
+
function Kn(e, n, a, u, g) {
|
|
101
101
|
for (var t = 0, r = n.length, i = 0, s = 0; t < r; t++) {
|
|
102
102
|
var o = n[t];
|
|
103
103
|
if (o.removed) {
|
|
@@ -106,11 +106,11 @@ function Kn(e, n, a, u, h) {
|
|
|
106
106
|
n[t - 1] = n[t], n[t] = c;
|
|
107
107
|
}
|
|
108
108
|
} else {
|
|
109
|
-
if (!o.added &&
|
|
109
|
+
if (!o.added && g) {
|
|
110
110
|
var l = a.slice(i, i + o.count);
|
|
111
|
-
l = l.map(function(
|
|
111
|
+
l = l.map(function(h, d) {
|
|
112
112
|
var p = u[s + d];
|
|
113
|
-
return p.length >
|
|
113
|
+
return p.length > h.length ? p : h;
|
|
114
114
|
}), o.value = e.join(l);
|
|
115
115
|
} else
|
|
116
116
|
o.value = e.join(a.slice(i, i + o.count));
|
|
@@ -126,9 +126,9 @@ function Wn(e) {
|
|
|
126
126
|
components: e.components.slice(0)
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
|
-
var
|
|
130
|
-
function
|
|
131
|
-
return
|
|
129
|
+
var qn = new ne();
|
|
130
|
+
function Qn(e, n, a) {
|
|
131
|
+
return qn.diff(e, n, a);
|
|
132
132
|
}
|
|
133
133
|
function Zn(e, n) {
|
|
134
134
|
if (typeof e == "function")
|
|
@@ -157,8 +157,8 @@ hn.tokenize = function(e) {
|
|
|
157
157
|
var n = [], a = e.split(/(\n|\r\n)/);
|
|
158
158
|
a[a.length - 1] || a.pop();
|
|
159
159
|
for (var u = 0; u < a.length; u++) {
|
|
160
|
-
var
|
|
161
|
-
u % 2 && !this.options.newlineIsToken ? n[n.length - 1] +=
|
|
160
|
+
var g = a[u];
|
|
161
|
+
u % 2 && !this.options.newlineIsToken ? n[n.length - 1] += g : (this.options.ignoreWhitespace && (g = g.trim()), n.push(g));
|
|
162
162
|
}
|
|
163
163
|
return n;
|
|
164
164
|
};
|
|
@@ -182,16 +182,16 @@ var Xn = Object.prototype.toString, he = new ne();
|
|
|
182
182
|
he.useLongestToken = !0;
|
|
183
183
|
he.tokenize = hn.tokenize;
|
|
184
184
|
he.castInput = function(e) {
|
|
185
|
-
var n = this.options, a = n.undefinedReplacement, u = n.stringifyReplacer,
|
|
185
|
+
var n = this.options, a = n.undefinedReplacement, u = n.stringifyReplacer, g = u === void 0 ? function(t, r) {
|
|
186
186
|
return typeof r == "undefined" ? a : r;
|
|
187
187
|
} : u;
|
|
188
|
-
return typeof e == "string" ? e : JSON.stringify(Be(e, null, null,
|
|
188
|
+
return typeof e == "string" ? e : JSON.stringify(Be(e, null, null, g), g, " ");
|
|
189
189
|
};
|
|
190
190
|
he.equals = function(e, n) {
|
|
191
191
|
return ne.prototype.equals.call(he, e.replace(/,([\r\n])/g, "$1"), n.replace(/,([\r\n])/g, "$1"));
|
|
192
192
|
};
|
|
193
|
-
function Be(e, n, a, u,
|
|
194
|
-
n = n || [], a = a || [], u && (e = u(
|
|
193
|
+
function Be(e, n, a, u, g) {
|
|
194
|
+
n = n || [], a = a || [], u && (e = u(g, e));
|
|
195
195
|
var t;
|
|
196
196
|
for (t = 0; t < n.length; t += 1)
|
|
197
197
|
if (n[t] === e)
|
|
@@ -199,7 +199,7 @@ function Be(e, n, a, u, h) {
|
|
|
199
199
|
var r;
|
|
200
200
|
if (Xn.call(e) === "[object Array]") {
|
|
201
201
|
for (n.push(e), r = new Array(e.length), a.push(r), t = 0; t < e.length; t += 1)
|
|
202
|
-
r[t] = Be(e[t], n, a, u,
|
|
202
|
+
r[t] = Be(e[t], n, a, u, g);
|
|
203
203
|
return n.pop(), a.pop(), r;
|
|
204
204
|
}
|
|
205
205
|
if (e && e.toJSON && (e = e.toJSON()), Te(e) === "object" && e !== null) {
|
|
@@ -228,7 +228,7 @@ var dn = { exports: {} };
|
|
|
228
228
|
(function(e) {
|
|
229
229
|
var n = function() {
|
|
230
230
|
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;
|
|
231
|
-
}, a = -1, u = 1,
|
|
231
|
+
}, a = -1, u = 1, g = 0;
|
|
232
232
|
n.Diff = function(t, r) {
|
|
233
233
|
return [t, r];
|
|
234
234
|
}, n.prototype.diff_main = function(t, r, i, s) {
|
|
@@ -237,14 +237,14 @@ var dn = { exports: {} };
|
|
|
237
237
|
if (t == null || r == null)
|
|
238
238
|
throw new Error("Null input. (diff_main)");
|
|
239
239
|
if (t == r)
|
|
240
|
-
return t ? [new n.Diff(
|
|
240
|
+
return t ? [new n.Diff(g, t)] : [];
|
|
241
241
|
typeof i == "undefined" && (i = !0);
|
|
242
242
|
var l = i, c = this.diff_commonPrefix(t, r), f = t.substring(0, c);
|
|
243
243
|
t = t.substring(c), r = r.substring(c), c = this.diff_commonSuffix(t, r);
|
|
244
|
-
var
|
|
244
|
+
var h = t.substring(t.length - c);
|
|
245
245
|
t = t.substring(0, t.length - c), r = r.substring(0, r.length - c);
|
|
246
246
|
var d = this.diff_compute_(t, r, l, o);
|
|
247
|
-
return f && d.unshift(new n.Diff(
|
|
247
|
+
return f && d.unshift(new n.Diff(g, f)), h && d.push(new n.Diff(g, h)), this.diff_cleanupMerge(d), d;
|
|
248
248
|
}, n.prototype.diff_compute_ = function(t, r, i, s) {
|
|
249
249
|
var o;
|
|
250
250
|
if (!t)
|
|
@@ -255,7 +255,7 @@ var dn = { exports: {} };
|
|
|
255
255
|
if (f != -1)
|
|
256
256
|
return o = [
|
|
257
257
|
new n.Diff(u, l.substring(0, f)),
|
|
258
|
-
new n.Diff(
|
|
258
|
+
new n.Diff(g, c),
|
|
259
259
|
new n.Diff(
|
|
260
260
|
u,
|
|
261
261
|
l.substring(f + c.length)
|
|
@@ -266,12 +266,12 @@ var dn = { exports: {} };
|
|
|
266
266
|
new n.Diff(a, t),
|
|
267
267
|
new n.Diff(u, r)
|
|
268
268
|
];
|
|
269
|
-
var
|
|
270
|
-
if (
|
|
271
|
-
var d =
|
|
272
|
-
return
|
|
273
|
-
[new n.Diff(
|
|
274
|
-
|
|
269
|
+
var h = this.diff_halfMatch_(t, r);
|
|
270
|
+
if (h) {
|
|
271
|
+
var d = h[0], p = h[1], _ = h[2], v = h[3], E = h[4], m = this.diff_main(d, _, i, s), N = this.diff_main(p, v, i, s);
|
|
272
|
+
return m.concat(
|
|
273
|
+
[new n.Diff(g, E)],
|
|
274
|
+
N
|
|
275
275
|
);
|
|
276
276
|
}
|
|
277
277
|
return i && t.length > 100 && r.length > 100 ? this.diff_lineMode_(t, r, s) : this.diff_bisect_(t, r, s);
|
|
@@ -279,69 +279,69 @@ var dn = { exports: {} };
|
|
|
279
279
|
var s = this.diff_linesToChars_(t, r);
|
|
280
280
|
t = s.chars1, r = s.chars2;
|
|
281
281
|
var o = s.lineArray, l = this.diff_main(t, r, !1, i);
|
|
282
|
-
this.diff_charsToLines_(l, o), this.diff_cleanupSemantic(l), l.push(new n.Diff(
|
|
283
|
-
for (var c = 0, f = 0,
|
|
282
|
+
this.diff_charsToLines_(l, o), this.diff_cleanupSemantic(l), l.push(new n.Diff(g, ""));
|
|
283
|
+
for (var c = 0, f = 0, h = 0, d = "", p = ""; c < l.length; ) {
|
|
284
284
|
switch (l[c][0]) {
|
|
285
285
|
case u:
|
|
286
|
-
|
|
286
|
+
h++, p += l[c][1];
|
|
287
287
|
break;
|
|
288
288
|
case a:
|
|
289
289
|
f++, d += l[c][1];
|
|
290
290
|
break;
|
|
291
|
-
case
|
|
292
|
-
if (f >= 1 &&
|
|
291
|
+
case g:
|
|
292
|
+
if (f >= 1 && h >= 1) {
|
|
293
293
|
l.splice(
|
|
294
|
-
c - f -
|
|
295
|
-
f +
|
|
296
|
-
), c = c - f -
|
|
297
|
-
for (var _ = this.diff_main(d, p, !1, i),
|
|
298
|
-
l.splice(c, 0, _[
|
|
294
|
+
c - f - h,
|
|
295
|
+
f + h
|
|
296
|
+
), c = c - f - h;
|
|
297
|
+
for (var _ = this.diff_main(d, p, !1, i), v = _.length - 1; v >= 0; v--)
|
|
298
|
+
l.splice(c, 0, _[v]);
|
|
299
299
|
c = c + _.length;
|
|
300
300
|
}
|
|
301
|
-
|
|
301
|
+
h = 0, f = 0, d = "", p = "";
|
|
302
302
|
break;
|
|
303
303
|
}
|
|
304
304
|
c++;
|
|
305
305
|
}
|
|
306
306
|
return l.pop(), l;
|
|
307
307
|
}, n.prototype.diff_bisect_ = function(t, r, i) {
|
|
308
|
-
for (var s = t.length, o = r.length, l = Math.ceil((s + o) / 2), c = l, f = 2 * l,
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
for (var _ = s - o,
|
|
312
|
-
for (var
|
|
313
|
-
var
|
|
314
|
-
|
|
315
|
-
for (var
|
|
316
|
-
|
|
317
|
-
if (
|
|
318
|
-
|
|
319
|
-
else if (
|
|
320
|
-
|
|
321
|
-
else if (
|
|
322
|
-
var
|
|
323
|
-
if (
|
|
324
|
-
var
|
|
325
|
-
if (
|
|
326
|
-
return this.diff_bisectSplit_(t, r,
|
|
308
|
+
for (var s = t.length, o = r.length, l = Math.ceil((s + o) / 2), c = l, f = 2 * l, h = new Array(f), d = new Array(f), p = 0; p < f; p++)
|
|
309
|
+
h[p] = -1, d[p] = -1;
|
|
310
|
+
h[c + 1] = 0, d[c + 1] = 0;
|
|
311
|
+
for (var _ = s - o, v = _ % 2 != 0, E = 0, m = 0, N = 0, D = 0, S = 0; S < l && !((/* @__PURE__ */ new Date()).getTime() > i); S++) {
|
|
312
|
+
for (var A = -S + E; A <= S - m; A += 2) {
|
|
313
|
+
var R = c + A, C;
|
|
314
|
+
A == -S || A != S && h[R - 1] < h[R + 1] ? C = h[R + 1] : C = h[R - 1] + 1;
|
|
315
|
+
for (var I = C - A; C < s && I < o && t.charAt(C) == r.charAt(I); )
|
|
316
|
+
C++, I++;
|
|
317
|
+
if (h[R] = C, C > s)
|
|
318
|
+
m += 2;
|
|
319
|
+
else if (I > o)
|
|
320
|
+
E += 2;
|
|
321
|
+
else if (v) {
|
|
322
|
+
var $ = c + _ - A;
|
|
323
|
+
if ($ >= 0 && $ < f && d[$] != -1) {
|
|
324
|
+
var B = s - d[$];
|
|
325
|
+
if (C >= B)
|
|
326
|
+
return this.diff_bisectSplit_(t, r, C, I, i);
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
for (var F = -
|
|
331
|
-
var
|
|
332
|
-
F == -
|
|
333
|
-
for (var K =
|
|
334
|
-
|
|
335
|
-
if (d[
|
|
336
|
-
|
|
330
|
+
for (var F = -S + N; F <= S - D; F += 2) {
|
|
331
|
+
var $ = c + F, B;
|
|
332
|
+
F == -S || F != S && d[$ - 1] < d[$ + 1] ? B = d[$ + 1] : B = d[$ - 1] + 1;
|
|
333
|
+
for (var K = B - F; B < s && K < o && t.charAt(s - B - 1) == r.charAt(o - K - 1); )
|
|
334
|
+
B++, K++;
|
|
335
|
+
if (d[$] = B, B > s)
|
|
336
|
+
D += 2;
|
|
337
337
|
else if (K > o)
|
|
338
|
-
|
|
339
|
-
else if (!
|
|
340
|
-
var
|
|
341
|
-
if (
|
|
342
|
-
var
|
|
343
|
-
if (
|
|
344
|
-
return this.diff_bisectSplit_(t, r,
|
|
338
|
+
N += 2;
|
|
339
|
+
else if (!v) {
|
|
340
|
+
var R = c + _ - F;
|
|
341
|
+
if (R >= 0 && R < f && h[R] != -1) {
|
|
342
|
+
var C = h[R], I = c + C - R;
|
|
343
|
+
if (B = s - B, C >= B)
|
|
344
|
+
return this.diff_bisectSplit_(t, r, C, I, i);
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
}
|
|
@@ -351,17 +351,17 @@ var dn = { exports: {} };
|
|
|
351
351
|
new n.Diff(u, r)
|
|
352
352
|
];
|
|
353
353
|
}, n.prototype.diff_bisectSplit_ = function(t, r, i, s, o) {
|
|
354
|
-
var l = t.substring(0, i), c = r.substring(0, s), f = t.substring(i),
|
|
354
|
+
var l = t.substring(0, i), c = r.substring(0, s), f = t.substring(i), h = r.substring(s), d = this.diff_main(l, c, !1, o), p = this.diff_main(f, h, !1, o);
|
|
355
355
|
return d.concat(p);
|
|
356
356
|
}, n.prototype.diff_linesToChars_ = function(t, r) {
|
|
357
357
|
var i = [], s = {};
|
|
358
358
|
i[0] = "";
|
|
359
|
-
function o(
|
|
360
|
-
for (var d = "", p = 0, _ = -1,
|
|
361
|
-
_ =
|
|
362
|
-
`, p), _ == -1 && (_ =
|
|
363
|
-
var
|
|
364
|
-
(s.hasOwnProperty ? s.hasOwnProperty(
|
|
359
|
+
function o(h) {
|
|
360
|
+
for (var d = "", p = 0, _ = -1, v = i.length; _ < h.length - 1; ) {
|
|
361
|
+
_ = h.indexOf(`
|
|
362
|
+
`, p), _ == -1 && (_ = h.length - 1);
|
|
363
|
+
var E = h.substring(p, _ + 1);
|
|
364
|
+
(s.hasOwnProperty ? s.hasOwnProperty(E) : s[E] !== void 0) ? d += String.fromCharCode(s[E]) : (v == l && (E = h.substring(p), _ = h.length), d += String.fromCharCode(v), s[E] = v, i[v++] = E), p = _ + 1;
|
|
365
365
|
}
|
|
366
366
|
return d;
|
|
367
367
|
}
|
|
@@ -396,10 +396,10 @@ var dn = { exports: {} };
|
|
|
396
396
|
if (t == r)
|
|
397
397
|
return o;
|
|
398
398
|
for (var l = 0, c = 1; ; ) {
|
|
399
|
-
var f = t.substring(o - c),
|
|
400
|
-
if (
|
|
399
|
+
var f = t.substring(o - c), h = r.indexOf(f);
|
|
400
|
+
if (h == -1)
|
|
401
401
|
return l;
|
|
402
|
-
c +=
|
|
402
|
+
c += h, (h == 0 || t.substring(o - c) == r.substring(0, c)) && (l = c, c++);
|
|
403
403
|
}
|
|
404
404
|
}, n.prototype.diff_halfMatch_ = function(t, r) {
|
|
405
405
|
if (this.Diff_Timeout <= 0)
|
|
@@ -408,23 +408,23 @@ var dn = { exports: {} };
|
|
|
408
408
|
if (i.length < 4 || s.length * 2 < i.length)
|
|
409
409
|
return null;
|
|
410
410
|
var o = this;
|
|
411
|
-
function l(
|
|
412
|
-
for (var
|
|
411
|
+
function l(m, N, D) {
|
|
412
|
+
for (var S = m.substring(D, D + Math.floor(m.length / 4)), A = -1, R = "", C, I, $, B; (A = N.indexOf(S, A + 1)) != -1; ) {
|
|
413
413
|
var F = o.diff_commonPrefix(
|
|
414
|
-
|
|
415
|
-
|
|
414
|
+
m.substring(D),
|
|
415
|
+
N.substring(A)
|
|
416
416
|
), K = o.diff_commonSuffix(
|
|
417
|
-
|
|
418
|
-
|
|
417
|
+
m.substring(0, D),
|
|
418
|
+
N.substring(0, A)
|
|
419
419
|
);
|
|
420
|
-
|
|
420
|
+
R.length < K + F && (R = N.substring(A - K, A) + N.substring(A, A + F), C = m.substring(0, D - K), I = m.substring(D + F), $ = N.substring(0, A - K), B = N.substring(A + F));
|
|
421
421
|
}
|
|
422
|
-
return
|
|
423
|
-
|
|
422
|
+
return R.length * 2 >= m.length ? [
|
|
423
|
+
C,
|
|
424
|
+
I,
|
|
424
425
|
$,
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
C
|
|
426
|
+
B,
|
|
427
|
+
R
|
|
428
428
|
] : null;
|
|
429
429
|
}
|
|
430
430
|
var c = l(
|
|
@@ -435,70 +435,70 @@ var dn = { exports: {} };
|
|
|
435
435
|
i,
|
|
436
436
|
s,
|
|
437
437
|
Math.ceil(i.length / 2)
|
|
438
|
-
),
|
|
438
|
+
), h;
|
|
439
439
|
if (!c && !f)
|
|
440
440
|
return null;
|
|
441
|
-
f ? c ?
|
|
442
|
-
var d, p, _,
|
|
443
|
-
t.length > r.length ? (d =
|
|
444
|
-
var
|
|
445
|
-
return [d, p, _,
|
|
441
|
+
f ? c ? h = c[4].length > f[4].length ? c : f : h = f : h = c;
|
|
442
|
+
var d, p, _, v;
|
|
443
|
+
t.length > r.length ? (d = h[0], p = h[1], _ = h[2], v = h[3]) : (_ = h[0], v = h[1], d = h[2], p = h[3]);
|
|
444
|
+
var E = h[4];
|
|
445
|
+
return [d, p, _, v, E];
|
|
446
446
|
}, n.prototype.diff_cleanupSemantic = function(t) {
|
|
447
|
-
for (var r = !1, i = [], s = 0, o = null, l = 0, c = 0, f = 0,
|
|
448
|
-
t[l][0] ==
|
|
449
|
-
|
|
447
|
+
for (var r = !1, i = [], s = 0, o = null, l = 0, c = 0, f = 0, h = 0, d = 0; l < t.length; )
|
|
448
|
+
t[l][0] == g ? (i[s++] = l, c = h, f = d, h = 0, d = 0, o = t[l][1]) : (t[l][0] == u ? h += t[l][1].length : d += t[l][1].length, o && o.length <= Math.max(c, f) && o.length <= Math.max(
|
|
449
|
+
h,
|
|
450
450
|
d
|
|
451
451
|
) && (t.splice(
|
|
452
452
|
i[s - 1],
|
|
453
453
|
0,
|
|
454
454
|
new n.Diff(a, o)
|
|
455
|
-
), t[i[s - 1] + 1][0] = u, s--, s--, l = s > 0 ? i[s - 1] : -1, c = 0, f = 0,
|
|
455
|
+
), t[i[s - 1] + 1][0] = u, s--, s--, l = s > 0 ? i[s - 1] : -1, c = 0, f = 0, h = 0, d = 0, o = null, r = !0)), l++;
|
|
456
456
|
for (r && this.diff_cleanupMerge(t), this.diff_cleanupSemanticLossless(t), l = 1; l < t.length; ) {
|
|
457
457
|
if (t[l - 1][0] == a && t[l][0] == u) {
|
|
458
|
-
var p = t[l - 1][1], _ = t[l][1],
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
_.substring(0,
|
|
462
|
-
)), t[l - 1][1] = p.substring(0, p.length -
|
|
463
|
-
|
|
464
|
-
p.substring(0,
|
|
465
|
-
)), t[l - 1][0] = u, t[l - 1][1] = _.substring(0, _.length -
|
|
458
|
+
var p = t[l - 1][1], _ = t[l][1], v = this.diff_commonOverlap_(p, _), E = this.diff_commonOverlap_(_, p);
|
|
459
|
+
v >= E ? (v >= p.length / 2 || v >= _.length / 2) && (t.splice(l, 0, new n.Diff(
|
|
460
|
+
g,
|
|
461
|
+
_.substring(0, v)
|
|
462
|
+
)), t[l - 1][1] = p.substring(0, p.length - v), t[l + 1][1] = _.substring(v), l++) : (E >= p.length / 2 || E >= _.length / 2) && (t.splice(l, 0, new n.Diff(
|
|
463
|
+
g,
|
|
464
|
+
p.substring(0, E)
|
|
465
|
+
)), t[l - 1][0] = u, t[l - 1][1] = _.substring(0, _.length - E), t[l + 1][0] = a, t[l + 1][1] = p.substring(E), l++), l++;
|
|
466
466
|
}
|
|
467
467
|
l++;
|
|
468
468
|
}
|
|
469
469
|
}, n.prototype.diff_cleanupSemanticLossless = function(t) {
|
|
470
|
-
function r(
|
|
471
|
-
if (!
|
|
470
|
+
function r(E, m) {
|
|
471
|
+
if (!E || !m)
|
|
472
472
|
return 6;
|
|
473
|
-
var
|
|
474
|
-
return
|
|
473
|
+
var N = E.charAt(E.length - 1), D = m.charAt(0), S = N.match(n.nonAlphaNumericRegex_), A = D.match(n.nonAlphaNumericRegex_), R = S && N.match(n.whitespaceRegex_), C = A && D.match(n.whitespaceRegex_), I = R && N.match(n.linebreakRegex_), $ = C && D.match(n.linebreakRegex_), B = I && E.match(n.blanklineEndRegex_), F = $ && m.match(n.blanklineStartRegex_);
|
|
474
|
+
return B || F ? 5 : I || $ ? 4 : S && !R && C ? 3 : R || C ? 2 : S || A ? 1 : 0;
|
|
475
475
|
}
|
|
476
476
|
for (var i = 1; i < t.length - 1; ) {
|
|
477
|
-
if (t[i - 1][0] ==
|
|
477
|
+
if (t[i - 1][0] == g && t[i + 1][0] == g) {
|
|
478
478
|
var s = t[i - 1][1], o = t[i][1], l = t[i + 1][1], c = this.diff_commonSuffix(s, o);
|
|
479
479
|
if (c) {
|
|
480
480
|
var f = o.substring(o.length - c);
|
|
481
481
|
s = s.substring(0, s.length - c), o = f + o.substring(0, o.length - c), l = f + l;
|
|
482
482
|
}
|
|
483
|
-
for (var
|
|
483
|
+
for (var h = s, d = o, p = l, _ = r(s, o) + r(o, l); o.charAt(0) === l.charAt(0); ) {
|
|
484
484
|
s += o.charAt(0), o = o.substring(1) + l.charAt(0), l = l.substring(1);
|
|
485
|
-
var
|
|
486
|
-
|
|
485
|
+
var v = r(s, o) + r(o, l);
|
|
486
|
+
v >= _ && (_ = v, h = s, d = o, p = l);
|
|
487
487
|
}
|
|
488
|
-
t[i - 1][1] !=
|
|
488
|
+
t[i - 1][1] != h && (h ? t[i - 1][1] = h : (t.splice(i - 1, 1), i--), t[i][1] = d, p ? t[i + 1][1] = p : (t.splice(i + 1, 1), i--));
|
|
489
489
|
}
|
|
490
490
|
i++;
|
|
491
491
|
}
|
|
492
492
|
}, n.nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/, n.whitespaceRegex_ = /\s/, n.linebreakRegex_ = /[\r\n]/, n.blanklineEndRegex_ = /\n\r?\n$/, n.blanklineStartRegex_ = /^\r?\n\r?\n/, n.prototype.diff_cleanupEfficiency = function(t) {
|
|
493
|
-
for (var r = !1, i = [], s = 0, o = null, l = 0, c = !1, f = !1,
|
|
494
|
-
t[l][0] ==
|
|
493
|
+
for (var r = !1, i = [], s = 0, o = null, l = 0, c = !1, f = !1, h = !1, d = !1; l < t.length; )
|
|
494
|
+
t[l][0] == g ? (t[l][1].length < this.Diff_EditCost && (h || d) ? (i[s++] = l, c = h, f = d, o = t[l][1]) : (s = 0, o = null), h = d = !1) : (t[l][0] == a ? d = !0 : h = !0, o && (c && f && h && d || o.length < this.Diff_EditCost / 2 && c + f + h + d == 3) && (t.splice(
|
|
495
495
|
i[s - 1],
|
|
496
496
|
0,
|
|
497
497
|
new n.Diff(a, o)
|
|
498
|
-
), t[i[s - 1] + 1][0] = u, s--, o = null, c && f ? (
|
|
498
|
+
), t[i[s - 1] + 1][0] = u, s--, o = null, c && f ? (h = d = !0, s = 0) : (s--, l = s > 0 ? i[s - 1] : -1, h = d = !1), r = !0)), l++;
|
|
499
499
|
r && this.diff_cleanupMerge(t);
|
|
500
500
|
}, n.prototype.diff_cleanupMerge = function(t) {
|
|
501
|
-
t.push(new n.Diff(
|
|
501
|
+
t.push(new n.Diff(g, ""));
|
|
502
502
|
for (var r = 0, i = 0, s = 0, o = "", l = "", c; r < t.length; )
|
|
503
503
|
switch (t[r][0]) {
|
|
504
504
|
case u:
|
|
@@ -507,9 +507,9 @@ var dn = { exports: {} };
|
|
|
507
507
|
case a:
|
|
508
508
|
i++, o += t[r][1], r++;
|
|
509
509
|
break;
|
|
510
|
-
case
|
|
511
|
-
i + s > 1 ? (i !== 0 && s !== 0 && (c = this.diff_commonPrefix(l, o), c !== 0 && (r - i - s > 0 && t[r - i - s - 1][0] ==
|
|
512
|
-
|
|
510
|
+
case g:
|
|
511
|
+
i + s > 1 ? (i !== 0 && s !== 0 && (c = this.diff_commonPrefix(l, o), c !== 0 && (r - i - s > 0 && t[r - i - s - 1][0] == g ? t[r - i - s - 1][1] += l.substring(0, c) : (t.splice(0, 0, new n.Diff(
|
|
512
|
+
g,
|
|
513
513
|
l.substring(0, c)
|
|
514
514
|
)), r++), l = l.substring(c), o = o.substring(c)), c = this.diff_commonSuffix(l, o), c !== 0 && (t[r][1] = l.substring(l.length - c) + t[r][1], l = l.substring(0, l.length - c), o = o.substring(0, o.length - c))), r -= i + s, t.splice(r, i + s), o.length && (t.splice(
|
|
515
515
|
r,
|
|
@@ -519,13 +519,13 @@ var dn = { exports: {} };
|
|
|
519
519
|
r,
|
|
520
520
|
0,
|
|
521
521
|
new n.Diff(u, l)
|
|
522
|
-
), r++), r++) : r !== 0 && t[r - 1][0] ==
|
|
522
|
+
), r++), r++) : r !== 0 && t[r - 1][0] == g ? (t[r - 1][1] += t[r][1], t.splice(r, 1)) : r++, s = 0, i = 0, o = "", l = "";
|
|
523
523
|
break;
|
|
524
524
|
}
|
|
525
525
|
t[t.length - 1][1] === "" && t.pop();
|
|
526
526
|
var f = !1;
|
|
527
527
|
for (r = 1; r < t.length - 1; )
|
|
528
|
-
t[r - 1][0] ==
|
|
528
|
+
t[r - 1][0] == g && t[r + 1][0] == g && (t[r][1].substring(t[r][1].length - t[r - 1][1].length) == t[r - 1][1] ? (t[r][1] = t[r - 1][1] + t[r][1].substring(0, t[r][1].length - t[r - 1][1].length), t[r + 1][1] = t[r - 1][1] + t[r + 1][1], t.splice(r - 1, 1), f = !0) : t[r][1].substring(0, t[r + 1][1].length) == t[r + 1][1] && (t[r - 1][1] += t[r + 1][1], t[r][1] = t[r][1].substring(t[r + 1][1].length) + t[r + 1][1], t.splice(r + 1, 1), f = !0)), r++;
|
|
529
529
|
f && this.diff_cleanupMerge(t);
|
|
530
530
|
}, n.prototype.diff_xIndex = function(t, r) {
|
|
531
531
|
var i = 0, s = 0, o = 0, l = 0, c;
|
|
@@ -534,7 +534,7 @@ var dn = { exports: {} };
|
|
|
534
534
|
return t.length != c && t[c][0] === a ? l : l + (r - o);
|
|
535
535
|
}, n.prototype.diff_prettyHtml = function(t) {
|
|
536
536
|
for (var r = [], i = /&/g, s = /</g, o = />/g, l = /\n/g, c = 0; c < t.length; c++) {
|
|
537
|
-
var f = t[c][0],
|
|
537
|
+
var f = t[c][0], h = t[c][1], d = h.replace(i, "&").replace(s, "<").replace(o, ">").replace(l, "¶<br>");
|
|
538
538
|
switch (f) {
|
|
539
539
|
case u:
|
|
540
540
|
r[c] = '<ins style="background:#e6ffe6;">' + d + "</ins>";
|
|
@@ -542,7 +542,7 @@ var dn = { exports: {} };
|
|
|
542
542
|
case a:
|
|
543
543
|
r[c] = '<del style="background:#ffe6e6;">' + d + "</del>";
|
|
544
544
|
break;
|
|
545
|
-
case
|
|
545
|
+
case g:
|
|
546
546
|
r[c] = "<span>" + d + "</span>";
|
|
547
547
|
break;
|
|
548
548
|
}
|
|
@@ -566,7 +566,7 @@ var dn = { exports: {} };
|
|
|
566
566
|
case a:
|
|
567
567
|
s += c.length;
|
|
568
568
|
break;
|
|
569
|
-
case
|
|
569
|
+
case g:
|
|
570
570
|
r += Math.max(i, s), i = 0, s = 0;
|
|
571
571
|
break;
|
|
572
572
|
}
|
|
@@ -581,7 +581,7 @@ var dn = { exports: {} };
|
|
|
581
581
|
case a:
|
|
582
582
|
r[i] = "-" + t[i][1].length;
|
|
583
583
|
break;
|
|
584
|
-
case
|
|
584
|
+
case g:
|
|
585
585
|
r[i] = "=" + t[i][1].length;
|
|
586
586
|
break;
|
|
587
587
|
}
|
|
@@ -599,11 +599,11 @@ var dn = { exports: {} };
|
|
|
599
599
|
break;
|
|
600
600
|
case "-":
|
|
601
601
|
case "=":
|
|
602
|
-
var
|
|
603
|
-
if (isNaN(
|
|
602
|
+
var h = parseInt(f, 10);
|
|
603
|
+
if (isNaN(h) || h < 0)
|
|
604
604
|
throw new Error("Invalid number in diff_fromDelta: " + f);
|
|
605
|
-
var d = t.substring(o, o +=
|
|
606
|
-
l[c].charAt(0) == "=" ? i[s++] = new n.Diff(
|
|
605
|
+
var d = t.substring(o, o += h);
|
|
606
|
+
l[c].charAt(0) == "=" ? i[s++] = new n.Diff(g, d) : i[s++] = new n.Diff(a, d);
|
|
607
607
|
break;
|
|
608
608
|
default:
|
|
609
609
|
if (l[c])
|
|
@@ -621,34 +621,34 @@ var dn = { exports: {} };
|
|
|
621
621
|
if (r.length > this.Match_MaxBits)
|
|
622
622
|
throw new Error("Pattern too long for this browser.");
|
|
623
623
|
var s = this.match_alphabet_(r), o = this;
|
|
624
|
-
function l(
|
|
625
|
-
var
|
|
626
|
-
return o.Match_Distance ?
|
|
624
|
+
function l(C, I) {
|
|
625
|
+
var $ = C / r.length, B = Math.abs(i - I);
|
|
626
|
+
return o.Match_Distance ? $ + B / o.Match_Distance : B ? 1 : $;
|
|
627
627
|
}
|
|
628
628
|
var c = this.Match_Threshold, f = t.indexOf(r, i);
|
|
629
629
|
f != -1 && (c = Math.min(l(0, f), c), f = t.lastIndexOf(r, i + r.length), f != -1 && (c = Math.min(l(0, f), c)));
|
|
630
|
-
var
|
|
630
|
+
var h = 1 << r.length - 1;
|
|
631
631
|
f = -1;
|
|
632
|
-
for (var d, p, _ = r.length + t.length,
|
|
632
|
+
for (var d, p, _ = r.length + t.length, v, E = 0; E < r.length; E++) {
|
|
633
633
|
for (d = 0, p = _; d < p; )
|
|
634
|
-
l(
|
|
634
|
+
l(E, i + p) <= c ? d = p : _ = p, p = Math.floor((_ - d) / 2 + d);
|
|
635
635
|
_ = p;
|
|
636
|
-
var
|
|
637
|
-
|
|
638
|
-
for (var
|
|
639
|
-
var
|
|
640
|
-
if (
|
|
641
|
-
var
|
|
642
|
-
if (
|
|
643
|
-
if (c =
|
|
644
|
-
|
|
636
|
+
var m = Math.max(1, i - p + 1), N = Math.min(i + p, t.length) + r.length, D = Array(N + 2);
|
|
637
|
+
D[N + 1] = (1 << E) - 1;
|
|
638
|
+
for (var S = N; S >= m; S--) {
|
|
639
|
+
var A = s[t.charAt(S - 1)];
|
|
640
|
+
if (E === 0 ? D[S] = (D[S + 1] << 1 | 1) & A : D[S] = (D[S + 1] << 1 | 1) & A | ((v[S + 1] | v[S]) << 1 | 1) | v[S + 1], D[S] & h) {
|
|
641
|
+
var R = l(E, S - 1);
|
|
642
|
+
if (R <= c)
|
|
643
|
+
if (c = R, f = S - 1, f > i)
|
|
644
|
+
m = Math.max(1, 2 * i - f);
|
|
645
645
|
else
|
|
646
646
|
break;
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
|
-
if (l(
|
|
649
|
+
if (l(E + 1, i) > c)
|
|
650
650
|
break;
|
|
651
|
-
|
|
651
|
+
v = D;
|
|
652
652
|
}
|
|
653
653
|
return f;
|
|
654
654
|
}, n.prototype.match_alphabet_ = function(t) {
|
|
@@ -668,12 +668,12 @@ var dn = { exports: {} };
|
|
|
668
668
|
);
|
|
669
669
|
s += this.Patch_Margin;
|
|
670
670
|
var o = r.substring(t.start2 - s, t.start2);
|
|
671
|
-
o && t.diffs.unshift(new n.Diff(
|
|
671
|
+
o && t.diffs.unshift(new n.Diff(g, o));
|
|
672
672
|
var l = r.substring(
|
|
673
673
|
t.start2 + t.length1,
|
|
674
674
|
t.start2 + t.length1 + s
|
|
675
675
|
);
|
|
676
|
-
l && t.diffs.push(new n.Diff(
|
|
676
|
+
l && t.diffs.push(new n.Diff(g, l)), t.start1 -= o.length, t.start2 -= o.length, t.length1 += o.length + l.length, t.length2 += o.length + l.length;
|
|
677
677
|
}
|
|
678
678
|
}, n.prototype.patch_make = function(t, r, i) {
|
|
679
679
|
var s, o;
|
|
@@ -700,20 +700,20 @@ var dn = { exports: {} };
|
|
|
700
700
|
throw new Error("Unknown call format to patch_make.");
|
|
701
701
|
if (o.length === 0)
|
|
702
702
|
return [];
|
|
703
|
-
for (var l = [], c = new n.patch_obj(), f = 0,
|
|
704
|
-
var
|
|
705
|
-
switch (!f &&
|
|
703
|
+
for (var l = [], c = new n.patch_obj(), f = 0, h = 0, d = 0, p = s, _ = s, v = 0; v < o.length; v++) {
|
|
704
|
+
var E = o[v][0], m = o[v][1];
|
|
705
|
+
switch (!f && E !== g && (c.start1 = h, c.start2 = d), E) {
|
|
706
706
|
case u:
|
|
707
|
-
c.diffs[f++] = o[
|
|
707
|
+
c.diffs[f++] = o[v], c.length2 += m.length, _ = _.substring(0, d) + m + _.substring(d);
|
|
708
708
|
break;
|
|
709
709
|
case a:
|
|
710
|
-
c.length1 +=
|
|
710
|
+
c.length1 += m.length, c.diffs[f++] = o[v], _ = _.substring(0, d) + _.substring(d + m.length);
|
|
711
711
|
break;
|
|
712
|
-
case
|
|
713
|
-
|
|
712
|
+
case g:
|
|
713
|
+
m.length <= 2 * this.Patch_Margin && f && o.length != v + 1 ? (c.diffs[f++] = o[v], c.length1 += m.length, c.length2 += m.length) : m.length >= 2 * this.Patch_Margin && f && (this.patch_addContext_(c, p), l.push(c), c = new n.patch_obj(), f = 0, p = _, h = d);
|
|
714
714
|
break;
|
|
715
715
|
}
|
|
716
|
-
|
|
716
|
+
E !== u && (h += m.length), E !== a && (d += m.length);
|
|
717
717
|
}
|
|
718
718
|
return f && (this.patch_addContext_(c, p), l.push(c)), l;
|
|
719
719
|
}, n.prototype.patch_deepCopy = function(t) {
|
|
@@ -732,34 +732,34 @@ var dn = { exports: {} };
|
|
|
732
732
|
var i = this.patch_addPadding(t);
|
|
733
733
|
r = i + r + i, this.patch_splitMax(t);
|
|
734
734
|
for (var s = 0, o = [], l = 0; l < t.length; l++) {
|
|
735
|
-
var c = t[l].start2 + s, f = this.diff_text1(t[l].diffs),
|
|
736
|
-
if (f.length > this.Match_MaxBits ? (
|
|
735
|
+
var c = t[l].start2 + s, f = this.diff_text1(t[l].diffs), h, d = -1;
|
|
736
|
+
if (f.length > this.Match_MaxBits ? (h = this.match_main(
|
|
737
737
|
r,
|
|
738
738
|
f.substring(0, this.Match_MaxBits),
|
|
739
739
|
c
|
|
740
|
-
),
|
|
740
|
+
), h != -1 && (d = this.match_main(
|
|
741
741
|
r,
|
|
742
742
|
f.substring(f.length - this.Match_MaxBits),
|
|
743
743
|
c + f.length - this.Match_MaxBits
|
|
744
|
-
), (d == -1 ||
|
|
744
|
+
), (d == -1 || h >= d) && (h = -1))) : h = this.match_main(r, f, c), h == -1)
|
|
745
745
|
o[l] = !1, s -= t[l].length2 - t[l].length1;
|
|
746
746
|
else {
|
|
747
|
-
o[l] = !0, s =
|
|
747
|
+
o[l] = !0, s = h - c;
|
|
748
748
|
var p;
|
|
749
|
-
if (d == -1 ? p = r.substring(
|
|
750
|
-
r = r.substring(0,
|
|
749
|
+
if (d == -1 ? p = r.substring(h, h + f.length) : p = r.substring(h, d + this.Match_MaxBits), f == p)
|
|
750
|
+
r = r.substring(0, h) + this.diff_text2(t[l].diffs) + r.substring(h + f.length);
|
|
751
751
|
else {
|
|
752
752
|
var _ = this.diff_main(f, p, !1);
|
|
753
753
|
if (f.length > this.Match_MaxBits && this.diff_levenshtein(_) / f.length > this.Patch_DeleteThreshold)
|
|
754
754
|
o[l] = !1;
|
|
755
755
|
else {
|
|
756
756
|
this.diff_cleanupSemanticLossless(_);
|
|
757
|
-
for (var
|
|
758
|
-
var
|
|
759
|
-
|
|
757
|
+
for (var v = 0, E, m = 0; m < t[l].diffs.length; m++) {
|
|
758
|
+
var N = t[l].diffs[m];
|
|
759
|
+
N[0] !== g && (E = this.diff_xIndex(_, v)), N[0] === u ? r = r.substring(0, h + E) + N[1] + r.substring(h + E) : N[0] === a && (r = r.substring(0, h + E) + r.substring(h + this.diff_xIndex(
|
|
760
760
|
_,
|
|
761
|
-
|
|
762
|
-
))),
|
|
761
|
+
v + N[1].length
|
|
762
|
+
))), N[0] !== a && (v += N[1].length);
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
765
|
}
|
|
@@ -772,14 +772,14 @@ var dn = { exports: {} };
|
|
|
772
772
|
for (var s = 0; s < t.length; s++)
|
|
773
773
|
t[s].start1 += r, t[s].start2 += r;
|
|
774
774
|
var o = t[0], l = o.diffs;
|
|
775
|
-
if (l.length == 0 || l[0][0] !=
|
|
776
|
-
l.unshift(new n.Diff(
|
|
775
|
+
if (l.length == 0 || l[0][0] != g)
|
|
776
|
+
l.unshift(new n.Diff(g, i)), o.start1 -= r, o.start2 -= r, o.length1 += r, o.length2 += r;
|
|
777
777
|
else if (r > l[0][1].length) {
|
|
778
778
|
var c = r - l[0][1].length;
|
|
779
779
|
l[0][1] = i.substring(l[0][1].length) + l[0][1], o.start1 -= c, o.start2 -= c, o.length1 += c, o.length2 += c;
|
|
780
780
|
}
|
|
781
|
-
if (o = t[t.length - 1], l = o.diffs, l.length == 0 || l[l.length - 1][0] !=
|
|
782
|
-
l.push(new n.Diff(
|
|
781
|
+
if (o = t[t.length - 1], l = o.diffs, l.length == 0 || l[l.length - 1][0] != g)
|
|
782
|
+
l.push(new n.Diff(g, i)), o.length1 += r, o.length2 += r;
|
|
783
783
|
else if (r > l[l.length - 1][1].length) {
|
|
784
784
|
var c = r - l[l.length - 1][1].length;
|
|
785
785
|
l[l.length - 1][1] += i.substring(0, c), o.length1 += c, o.length2 += c;
|
|
@@ -791,17 +791,17 @@ var dn = { exports: {} };
|
|
|
791
791
|
var s = t[i];
|
|
792
792
|
t.splice(i--, 1);
|
|
793
793
|
for (var o = s.start1, l = s.start2, c = ""; s.diffs.length !== 0; ) {
|
|
794
|
-
var f = new n.patch_obj(),
|
|
795
|
-
for (f.start1 = o - c.length, f.start2 = l - c.length, c !== "" && (f.length1 = f.length2 = c.length, f.diffs.push(new n.Diff(
|
|
794
|
+
var f = new n.patch_obj(), h = !0;
|
|
795
|
+
for (f.start1 = o - c.length, f.start2 = l - c.length, c !== "" && (f.length1 = f.length2 = c.length, f.diffs.push(new n.Diff(g, c))); s.diffs.length !== 0 && f.length1 < r - this.Patch_Margin; ) {
|
|
796
796
|
var d = s.diffs[0][0], p = s.diffs[0][1];
|
|
797
|
-
d === u ? (f.length2 += p.length, l += p.length, f.diffs.push(s.diffs.shift()),
|
|
797
|
+
d === u ? (f.length2 += p.length, l += p.length, f.diffs.push(s.diffs.shift()), h = !1) : d === a && f.diffs.length == 1 && f.diffs[0][0] == g && p.length > 2 * r ? (f.length1 += p.length, o += p.length, h = !1, f.diffs.push(new n.Diff(d, p)), s.diffs.shift()) : (p = p.substring(
|
|
798
798
|
0,
|
|
799
799
|
r - f.length1 - this.Patch_Margin
|
|
800
|
-
), f.length1 += p.length, o += p.length, d ===
|
|
800
|
+
), f.length1 += p.length, o += p.length, d === g ? (f.length2 += p.length, l += p.length) : h = !1, f.diffs.push(new n.Diff(d, p)), p == s.diffs[0][1] ? s.diffs.shift() : s.diffs[0][1] = s.diffs[0][1].substring(p.length));
|
|
801
801
|
}
|
|
802
802
|
c = this.diff_text2(f.diffs), c = c.substring(c.length - this.Patch_Margin);
|
|
803
803
|
var _ = this.diff_text1(s.diffs).substring(0, this.Patch_Margin);
|
|
804
|
-
_ !== "" && (f.length1 += _.length, f.length2 += _.length, f.diffs.length !== 0 && f.diffs[f.diffs.length - 1][0] ===
|
|
804
|
+
_ !== "" && (f.length1 += _.length, f.length2 += _.length, f.diffs.length !== 0 && f.diffs[f.diffs.length - 1][0] === g ? f.diffs[f.diffs.length - 1][1] += _ : f.diffs.push(new n.Diff(g, _))), h || t.splice(++i, 0, f);
|
|
805
805
|
}
|
|
806
806
|
}
|
|
807
807
|
}, n.prototype.patch_toText = function(t) {
|
|
@@ -821,21 +821,21 @@ var dn = { exports: {} };
|
|
|
821
821
|
for (r.push(c), c.start1 = parseInt(l[1], 10), l[2] === "" ? (c.start1--, c.length1 = 1) : l[2] == "0" ? c.length1 = 0 : (c.start1--, c.length1 = parseInt(l[2], 10)), c.start2 = parseInt(l[3], 10), l[4] === "" ? (c.start2--, c.length2 = 1) : l[4] == "0" ? c.length2 = 0 : (c.start2--, c.length2 = parseInt(l[4], 10)), s++; s < i.length; ) {
|
|
822
822
|
var f = i[s].charAt(0);
|
|
823
823
|
try {
|
|
824
|
-
var
|
|
824
|
+
var h = decodeURI(i[s].substring(1));
|
|
825
825
|
} catch (d) {
|
|
826
|
-
throw new Error("Illegal escape in patch_fromText: " +
|
|
826
|
+
throw new Error("Illegal escape in patch_fromText: " + h);
|
|
827
827
|
}
|
|
828
828
|
if (f == "-")
|
|
829
|
-
c.diffs.push(new n.Diff(a,
|
|
829
|
+
c.diffs.push(new n.Diff(a, h));
|
|
830
830
|
else if (f == "+")
|
|
831
|
-
c.diffs.push(new n.Diff(u,
|
|
831
|
+
c.diffs.push(new n.Diff(u, h));
|
|
832
832
|
else if (f == " ")
|
|
833
|
-
c.diffs.push(new n.Diff(
|
|
833
|
+
c.diffs.push(new n.Diff(g, h));
|
|
834
834
|
else {
|
|
835
835
|
if (f == "@")
|
|
836
836
|
break;
|
|
837
837
|
if (f !== "")
|
|
838
|
-
throw new Error('Invalid patch mode "' + f + '" in: ' +
|
|
838
|
+
throw new Error('Invalid patch mode "' + f + '" in: ' + h);
|
|
839
839
|
}
|
|
840
840
|
s++;
|
|
841
841
|
}
|
|
@@ -855,7 +855,7 @@ var dn = { exports: {} };
|
|
|
855
855
|
case a:
|
|
856
856
|
s = "-";
|
|
857
857
|
break;
|
|
858
|
-
case
|
|
858
|
+
case g:
|
|
859
859
|
s = " ";
|
|
860
860
|
break;
|
|
861
861
|
}
|
|
@@ -863,7 +863,7 @@ var dn = { exports: {} };
|
|
|
863
863
|
`;
|
|
864
864
|
}
|
|
865
865
|
return i.join("").replace(/%20/g, " ");
|
|
866
|
-
}, e.exports = n, e.exports.diff_match_patch = n, e.exports.DIFF_DELETE = a, e.exports.DIFF_INSERT = u, e.exports.DIFF_EQUAL =
|
|
866
|
+
}, e.exports = n, e.exports.diff_match_patch = n, e.exports.DIFF_DELETE = a, e.exports.DIFF_INSERT = u, e.exports.DIFF_EQUAL = g;
|
|
867
867
|
})(dn);
|
|
868
868
|
var Ie = dn.exports;
|
|
869
869
|
function pn(e) {
|
|
@@ -895,8 +895,8 @@ function re(e, ...n) {
|
|
|
895
895
|
for (const u in e)
|
|
896
896
|
a[u] = e[u];
|
|
897
897
|
return n.forEach(function(u) {
|
|
898
|
-
for (const
|
|
899
|
-
a[
|
|
898
|
+
for (const g in u)
|
|
899
|
+
a[g] = u[g];
|
|
900
900
|
}), /** @type {T} */
|
|
901
901
|
a;
|
|
902
902
|
}
|
|
@@ -907,7 +907,7 @@ const et = "</span>", Je = (e) => !!e.scope, nt = (e, { prefix: n }) => {
|
|
|
907
907
|
const a = e.split(".");
|
|
908
908
|
return [
|
|
909
909
|
`${n}${a.shift()}`,
|
|
910
|
-
...a.map((u,
|
|
910
|
+
...a.map((u, g) => `${u}${"_".repeat(g + 1)}`)
|
|
911
911
|
].join(" ");
|
|
912
912
|
}
|
|
913
913
|
return `${n}${e}`;
|
|
@@ -1090,7 +1090,7 @@ function Fe(e, { joinWith: n }) {
|
|
|
1090
1090
|
let a = 0;
|
|
1091
1091
|
return e.map((u) => {
|
|
1092
1092
|
a += 1;
|
|
1093
|
-
const
|
|
1093
|
+
const g = a;
|
|
1094
1094
|
let t = de(u), r = "";
|
|
1095
1095
|
for (; t.length > 0; ) {
|
|
1096
1096
|
const i = lt.exec(t);
|
|
@@ -1098,7 +1098,7 @@ function Fe(e, { joinWith: n }) {
|
|
|
1098
1098
|
r += t;
|
|
1099
1099
|
break;
|
|
1100
1100
|
}
|
|
1101
|
-
r += t.substring(0, i.index), t = t.substring(i.index + i[0].length), i[0][0] === "\\" && i[1] ? r += "\\" + String(Number(i[1]) +
|
|
1101
|
+
r += t.substring(0, i.index), t = t.substring(i.index + i[0].length), i[0][0] === "\\" && i[1] ? r += "\\" + String(Number(i[1]) + g) : (r += i[0], i[0] === "(" && a++);
|
|
1102
1102
|
}
|
|
1103
1103
|
return r;
|
|
1104
1104
|
}).map((u) => `(${u})`).join(n);
|
|
@@ -1137,7 +1137,7 @@ const ct = /\b\B/, En = "[a-zA-Z]\\w*", ze = "[a-zA-Z_]\\w*", mn = "\\b\\d+(\\.\
|
|
|
1137
1137
|
contains: [pe]
|
|
1138
1138
|
}, dt = {
|
|
1139
1139
|
begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
|
|
1140
|
-
},
|
|
1140
|
+
}, Ce = function(e, n, a = {}) {
|
|
1141
1141
|
const u = re(
|
|
1142
1142
|
{
|
|
1143
1143
|
scope: "comment",
|
|
@@ -1156,7 +1156,7 @@ const ct = /\b\B/, En = "[a-zA-Z]\\w*", ze = "[a-zA-Z_]\\w*", mn = "\\b\\d+(\\.\
|
|
|
1156
1156
|
excludeBegin: !0,
|
|
1157
1157
|
relevance: 0
|
|
1158
1158
|
});
|
|
1159
|
-
const
|
|
1159
|
+
const g = He(
|
|
1160
1160
|
// list of common 1 and 2 letter words in English
|
|
1161
1161
|
"I",
|
|
1162
1162
|
"a",
|
|
@@ -1196,14 +1196,14 @@ const ct = /\b\B/, En = "[a-zA-Z]\\w*", ze = "[a-zA-Z_]\\w*", mn = "\\b\\d+(\\.\
|
|
|
1196
1196
|
/[ ]+/,
|
|
1197
1197
|
// necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
|
|
1198
1198
|
"(",
|
|
1199
|
-
|
|
1199
|
+
g,
|
|
1200
1200
|
/[.]?[:]?([.][ ]|[ ])/,
|
|
1201
1201
|
"){3}"
|
|
1202
1202
|
)
|
|
1203
1203
|
// look for 3 words in a row
|
|
1204
1204
|
}
|
|
1205
1205
|
), u;
|
|
1206
|
-
}, pt =
|
|
1206
|
+
}, pt = Ce("//", "$"), _t = Ce("/\\*", "\\*/"), bt = Ce("#", "$"), vt = {
|
|
1207
1207
|
scope: "number",
|
|
1208
1208
|
begin: mn,
|
|
1209
1209
|
relevance: 0
|
|
@@ -1261,7 +1261,7 @@ var Ne = /* @__PURE__ */ Object.freeze({
|
|
|
1261
1261
|
BACKSLASH_ESCAPE: pe,
|
|
1262
1262
|
BINARY_NUMBER_MODE: mt,
|
|
1263
1263
|
BINARY_NUMBER_RE: wn,
|
|
1264
|
-
COMMENT:
|
|
1264
|
+
COMMENT: Ce,
|
|
1265
1265
|
C_BLOCK_COMMENT_MODE: _t,
|
|
1266
1266
|
C_LINE_COMMENT_MODE: pt,
|
|
1267
1267
|
C_NUMBER_MODE: Et,
|
|
@@ -1291,10 +1291,10 @@ function St(e, n) {
|
|
|
1291
1291
|
function Dt(e, n) {
|
|
1292
1292
|
n && e.beginKeywords && (e.begin = "\\b(" + e.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", e.__beforeBegin = Tt, e.keywords = e.keywords || e.beginKeywords, delete e.beginKeywords, e.relevance === void 0 && (e.relevance = 0));
|
|
1293
1293
|
}
|
|
1294
|
-
function
|
|
1294
|
+
function Ct(e, n) {
|
|
1295
1295
|
Array.isArray(e.illegal) && (e.illegal = He(...e.illegal));
|
|
1296
1296
|
}
|
|
1297
|
-
function
|
|
1297
|
+
function Rt(e, n) {
|
|
1298
1298
|
if (e.match) {
|
|
1299
1299
|
if (e.begin || e.end)
|
|
1300
1300
|
throw new Error("begin & end are not supported with match");
|
|
@@ -1336,13 +1336,13 @@ const Ot = (e, n) => {
|
|
|
1336
1336
|
], kt = "keyword";
|
|
1337
1337
|
function Nn(e, n, a = kt) {
|
|
1338
1338
|
const u = /* @__PURE__ */ Object.create(null);
|
|
1339
|
-
return typeof e == "string" ?
|
|
1339
|
+
return typeof e == "string" ? g(a, e.split(" ")) : Array.isArray(e) ? g(a, e) : Object.keys(e).forEach(function(t) {
|
|
1340
1340
|
Object.assign(
|
|
1341
1341
|
u,
|
|
1342
1342
|
Nn(e[t], n, t)
|
|
1343
1343
|
);
|
|
1344
1344
|
}), u;
|
|
1345
|
-
function
|
|
1345
|
+
function g(t, r) {
|
|
1346
1346
|
n && (r = r.map((i) => i.toLowerCase())), r.forEach(function(i) {
|
|
1347
1347
|
const s = i.split("|");
|
|
1348
1348
|
u[s[0]] = [t, Bt(s[0], s[1])];
|
|
@@ -1364,9 +1364,9 @@ const nn = {}, se = (e) => {
|
|
|
1364
1364
|
}, Se = new Error();
|
|
1365
1365
|
function An(e, n, { key: a }) {
|
|
1366
1366
|
let u = 0;
|
|
1367
|
-
const
|
|
1367
|
+
const g = e[a], t = {}, r = {};
|
|
1368
1368
|
for (let i = 1; i <= n.length; i++)
|
|
1369
|
-
r[i + u] =
|
|
1369
|
+
r[i + u] = g[i], t[i + u] = !0, u += vn(n[i - 1]);
|
|
1370
1370
|
e[a] = r, e[a]._emit = t, e[a]._multi = !0;
|
|
1371
1371
|
}
|
|
1372
1372
|
function Ut(e) {
|
|
@@ -1456,7 +1456,7 @@ function Ft(e) {
|
|
|
1456
1456
|
return o && (this.regexIndex += o.position + 1, this.regexIndex === this.count && this.considerAll()), o;
|
|
1457
1457
|
}
|
|
1458
1458
|
}
|
|
1459
|
-
function
|
|
1459
|
+
function g(r) {
|
|
1460
1460
|
const i = new u();
|
|
1461
1461
|
return r.contains.forEach((s) => i.addRule(s.begin, { rule: s, type: "begin" })), r.terminatorEnd && i.addRule(r.terminatorEnd, { type: "end" }), r.illegal && i.addRule(r.illegal, { type: "illegal" }), i;
|
|
1462
1462
|
}
|
|
@@ -1471,14 +1471,14 @@ function Ft(e) {
|
|
|
1471
1471
|
St,
|
|
1472
1472
|
// do this early so compiler extensions generally don't have to worry about
|
|
1473
1473
|
// the distinction between match/begin
|
|
1474
|
-
|
|
1474
|
+
Rt,
|
|
1475
1475
|
Ht,
|
|
1476
1476
|
Ot
|
|
1477
1477
|
].forEach((l) => l(r, i)), e.compilerExtensions.forEach((l) => l(r, i)), r.__beforeBegin = null, [
|
|
1478
1478
|
Dt,
|
|
1479
1479
|
// do this later so compiler extensions that come earlier have access to the
|
|
1480
1480
|
// raw array if they wanted to perhaps manipulate it, etc.
|
|
1481
|
-
|
|
1481
|
+
Ct,
|
|
1482
1482
|
// default to 1 relevance if not specified
|
|
1483
1483
|
Lt
|
|
1484
1484
|
].forEach((l) => l(r, i)), r.isCompiled = !0;
|
|
@@ -1494,7 +1494,7 @@ function Ft(e) {
|
|
|
1494
1494
|
l,
|
|
1495
1495
|
s
|
|
1496
1496
|
);
|
|
1497
|
-
}), r.starts && t(r.starts, i), s.matcher =
|
|
1497
|
+
}), r.starts && t(r.starts, i), s.matcher = g(s), s;
|
|
1498
1498
|
}
|
|
1499
1499
|
if (e.compilerExtensions || (e.compilerExtensions = []), e.contains && e.contains.includes("self"))
|
|
1500
1500
|
throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");
|
|
@@ -1519,7 +1519,7 @@ class Kt extends Error {
|
|
|
1519
1519
|
}
|
|
1520
1520
|
const ke = _n, rn = re, sn = Symbol("nomatch"), Wt = 7, Tn = function(e) {
|
|
1521
1521
|
const n = /* @__PURE__ */ Object.create(null), a = /* @__PURE__ */ Object.create(null), u = [];
|
|
1522
|
-
let
|
|
1522
|
+
let g = !0;
|
|
1523
1523
|
const t = "Could not find the language '{}', did you forget to load/include a language module?", r = { disableAutodetect: !0, name: "Plain text", contains: [] };
|
|
1524
1524
|
let i = {
|
|
1525
1525
|
ignoreUnescapedHTML: !1,
|
|
@@ -1533,393 +1533,393 @@ const ke = _n, rn = re, sn = Symbol("nomatch"), Wt = 7, Tn = function(e) {
|
|
|
1533
1533
|
// https://github.com/highlightjs/highlight.js/issues/1086
|
|
1534
1534
|
__emitter: rt
|
|
1535
1535
|
};
|
|
1536
|
-
function s(
|
|
1537
|
-
return i.noHighlightRe.test(
|
|
1536
|
+
function s(b) {
|
|
1537
|
+
return i.noHighlightRe.test(b);
|
|
1538
1538
|
}
|
|
1539
|
-
function o(
|
|
1540
|
-
let
|
|
1541
|
-
|
|
1542
|
-
const
|
|
1543
|
-
if (
|
|
1544
|
-
const
|
|
1545
|
-
return
|
|
1539
|
+
function o(b) {
|
|
1540
|
+
let w = b.className + " ";
|
|
1541
|
+
w += b.parentNode ? b.parentNode.className : "";
|
|
1542
|
+
const L = i.languageDetectRe.exec(w);
|
|
1543
|
+
if (L) {
|
|
1544
|
+
const U = C(L[1]);
|
|
1545
|
+
return U || (tn(t.replace("{}", L[1])), tn("Falling back to no-highlight mode for this block.", b)), U ? L[1] : "no-highlight";
|
|
1546
1546
|
}
|
|
1547
|
-
return
|
|
1547
|
+
return w.split(/\s+/).find((U) => s(U) || C(U));
|
|
1548
1548
|
}
|
|
1549
|
-
function l(
|
|
1550
|
-
let
|
|
1551
|
-
typeof
|
|
1552
|
-
https://github.com/highlightjs/highlight.js/issues/2277`), H =
|
|
1549
|
+
function l(b, w, L) {
|
|
1550
|
+
let U = "", H = "";
|
|
1551
|
+
typeof w == "object" ? (U = b, L = w.ignoreIllegals, H = w.language) : (le("10.7.0", "highlight(lang, code, ...args) has been deprecated."), le("10.7.0", `Please use highlight(code, options) instead.
|
|
1552
|
+
https://github.com/highlightjs/highlight.js/issues/2277`), H = b, U = w), L === void 0 && (L = !0);
|
|
1553
1553
|
const W = {
|
|
1554
|
-
code:
|
|
1554
|
+
code: U,
|
|
1555
1555
|
language: H
|
|
1556
1556
|
};
|
|
1557
1557
|
te("before:highlight", W);
|
|
1558
|
-
const Y = W.result ? W.result : c(W.language, W.code,
|
|
1558
|
+
const Y = W.result ? W.result : c(W.language, W.code, L);
|
|
1559
1559
|
return Y.code = W.code, te("after:highlight", Y), Y;
|
|
1560
1560
|
}
|
|
1561
|
-
function c(
|
|
1561
|
+
function c(b, w, L, U) {
|
|
1562
1562
|
const H = /* @__PURE__ */ Object.create(null);
|
|
1563
|
-
function W(
|
|
1564
|
-
return
|
|
1563
|
+
function W(y, M) {
|
|
1564
|
+
return y.keywords[M];
|
|
1565
1565
|
}
|
|
1566
1566
|
function Y() {
|
|
1567
|
-
if (!
|
|
1567
|
+
if (!O.keywords) {
|
|
1568
1568
|
z.addText(x);
|
|
1569
1569
|
return;
|
|
1570
1570
|
}
|
|
1571
|
-
let
|
|
1572
|
-
|
|
1573
|
-
let M =
|
|
1571
|
+
let y = 0;
|
|
1572
|
+
O.keywordPatternRe.lastIndex = 0;
|
|
1573
|
+
let M = O.keywordPatternRe.exec(x), k = "";
|
|
1574
1574
|
for (; M; ) {
|
|
1575
|
-
|
|
1576
|
-
const
|
|
1575
|
+
k += x.substring(y, M.index);
|
|
1576
|
+
const P = V.case_insensitive ? M[0].toLowerCase() : M[0], G = W(O, P);
|
|
1577
1577
|
if (G) {
|
|
1578
1578
|
const [X, Pn] = G;
|
|
1579
|
-
if (z.addText(
|
|
1580
|
-
|
|
1579
|
+
if (z.addText(k), k = "", H[P] = (H[P] || 0) + 1, H[P] <= Wt && (we += Pn), X.startsWith("_"))
|
|
1580
|
+
k += M[0];
|
|
1581
1581
|
else {
|
|
1582
1582
|
const xn = V.classNameAliases[X] || X;
|
|
1583
1583
|
j(M[0], xn);
|
|
1584
1584
|
}
|
|
1585
1585
|
} else
|
|
1586
|
-
|
|
1587
|
-
|
|
1586
|
+
k += M[0];
|
|
1587
|
+
y = O.keywordPatternRe.lastIndex, M = O.keywordPatternRe.exec(x);
|
|
1588
1588
|
}
|
|
1589
|
-
|
|
1589
|
+
k += x.substring(y), z.addText(k);
|
|
1590
1590
|
}
|
|
1591
1591
|
function me() {
|
|
1592
1592
|
if (x === "")
|
|
1593
1593
|
return;
|
|
1594
|
-
let
|
|
1595
|
-
if (typeof
|
|
1596
|
-
if (!n[
|
|
1594
|
+
let y = null;
|
|
1595
|
+
if (typeof O.subLanguage == "string") {
|
|
1596
|
+
if (!n[O.subLanguage]) {
|
|
1597
1597
|
z.addText(x);
|
|
1598
1598
|
return;
|
|
1599
1599
|
}
|
|
1600
|
-
|
|
1601
|
-
|
|
1600
|
+
y = c(O.subLanguage, x, !0, Ye[O.subLanguage]), Ye[O.subLanguage] = /** @type {CompiledMode} */
|
|
1601
|
+
y._top;
|
|
1602
1602
|
} else
|
|
1603
|
-
|
|
1604
|
-
|
|
1603
|
+
y = h(x, O.subLanguage.length ? O.subLanguage : null);
|
|
1604
|
+
O.relevance > 0 && (we += y.relevance), z.__addSublanguage(y._emitter, y.language);
|
|
1605
1605
|
}
|
|
1606
|
-
function
|
|
1607
|
-
|
|
1606
|
+
function q() {
|
|
1607
|
+
O.subLanguage != null ? me() : Y(), x = "";
|
|
1608
1608
|
}
|
|
1609
|
-
function j(
|
|
1610
|
-
|
|
1609
|
+
function j(y, M) {
|
|
1610
|
+
y !== "" && (z.startScope(M), z.addText(y), z.endScope());
|
|
1611
1611
|
}
|
|
1612
|
-
function We(
|
|
1613
|
-
let
|
|
1614
|
-
const
|
|
1615
|
-
for (;
|
|
1616
|
-
if (!
|
|
1617
|
-
|
|
1612
|
+
function We(y, M) {
|
|
1613
|
+
let k = 1;
|
|
1614
|
+
const P = M.length - 1;
|
|
1615
|
+
for (; k <= P; ) {
|
|
1616
|
+
if (!y._emit[k]) {
|
|
1617
|
+
k++;
|
|
1618
1618
|
continue;
|
|
1619
1619
|
}
|
|
1620
|
-
const G = V.classNameAliases[
|
|
1621
|
-
G ? j(X, G) : (x = X, Y(), x = ""),
|
|
1620
|
+
const G = V.classNameAliases[y[k]] || y[k], X = M[k];
|
|
1621
|
+
G ? j(X, G) : (x = X, Y(), x = ""), k++;
|
|
1622
1622
|
}
|
|
1623
1623
|
}
|
|
1624
|
-
function
|
|
1625
|
-
return
|
|
1624
|
+
function qe(y, M) {
|
|
1625
|
+
return y.scope && typeof y.scope == "string" && z.openNode(V.classNameAliases[y.scope] || y.scope), y.beginScope && (y.beginScope._wrap ? (j(x, V.classNameAliases[y.beginScope._wrap] || y.beginScope._wrap), x = "") : y.beginScope._multi && (We(y.beginScope, M), x = "")), O = Object.create(y, { parent: { value: O } }), O;
|
|
1626
1626
|
}
|
|
1627
|
-
function
|
|
1628
|
-
let
|
|
1629
|
-
if (
|
|
1630
|
-
if (
|
|
1631
|
-
const G = new Xe(
|
|
1632
|
-
|
|
1627
|
+
function Qe(y, M, k) {
|
|
1628
|
+
let P = ot(y.endRe, k);
|
|
1629
|
+
if (P) {
|
|
1630
|
+
if (y["on:end"]) {
|
|
1631
|
+
const G = new Xe(y);
|
|
1632
|
+
y["on:end"](M, G), G.isMatchIgnored && (P = !1);
|
|
1633
1633
|
}
|
|
1634
|
-
if (
|
|
1635
|
-
for (;
|
|
1636
|
-
|
|
1637
|
-
return
|
|
1634
|
+
if (P) {
|
|
1635
|
+
for (; y.endsParent && y.parent; )
|
|
1636
|
+
y = y.parent;
|
|
1637
|
+
return y;
|
|
1638
1638
|
}
|
|
1639
1639
|
}
|
|
1640
|
-
if (
|
|
1641
|
-
return
|
|
1640
|
+
if (y.endsWithParent)
|
|
1641
|
+
return Qe(y.parent, M, k);
|
|
1642
1642
|
}
|
|
1643
|
-
function In(
|
|
1644
|
-
return
|
|
1643
|
+
function In(y) {
|
|
1644
|
+
return O.matcher.regexIndex === 0 ? (x += y[0], 1) : (Oe = !0, 0);
|
|
1645
1645
|
}
|
|
1646
|
-
function kn(
|
|
1647
|
-
const M =
|
|
1646
|
+
function kn(y) {
|
|
1647
|
+
const M = y[0], k = y.rule, P = new Xe(k), G = [k.__beforeBegin, k["on:begin"]];
|
|
1648
1648
|
for (const X of G)
|
|
1649
|
-
if (X && (X(
|
|
1649
|
+
if (X && (X(y, P), P.isMatchIgnored))
|
|
1650
1650
|
return In(M);
|
|
1651
|
-
return
|
|
1651
|
+
return k.skip ? x += M : (k.excludeBegin && (x += M), q(), !k.returnBegin && !k.excludeBegin && (x = M)), qe(k, y), k.returnBegin ? 0 : M.length;
|
|
1652
1652
|
}
|
|
1653
|
-
function Bn(
|
|
1654
|
-
const M =
|
|
1655
|
-
if (!
|
|
1653
|
+
function Bn(y) {
|
|
1654
|
+
const M = y[0], k = w.substring(y.index), P = Qe(O, y, k);
|
|
1655
|
+
if (!P)
|
|
1656
1656
|
return sn;
|
|
1657
|
-
const G =
|
|
1658
|
-
|
|
1657
|
+
const G = O;
|
|
1658
|
+
O.endScope && O.endScope._wrap ? (q(), j(M, O.endScope._wrap)) : O.endScope && O.endScope._multi ? (q(), We(O.endScope, y)) : G.skip ? x += M : (G.returnEnd || G.excludeEnd || (x += M), q(), G.excludeEnd && (x = M));
|
|
1659
1659
|
do
|
|
1660
|
-
|
|
1661
|
-
while (
|
|
1662
|
-
return
|
|
1660
|
+
O.scope && z.closeNode(), !O.skip && !O.subLanguage && (we += O.relevance), O = O.parent;
|
|
1661
|
+
while (O !== P.parent);
|
|
1662
|
+
return P.starts && qe(P.starts, y), G.returnEnd ? 0 : M.length;
|
|
1663
1663
|
}
|
|
1664
1664
|
function $n() {
|
|
1665
|
-
const
|
|
1666
|
-
for (let M =
|
|
1667
|
-
M.scope &&
|
|
1668
|
-
|
|
1665
|
+
const y = [];
|
|
1666
|
+
for (let M = O; M !== V; M = M.parent)
|
|
1667
|
+
M.scope && y.unshift(M.scope);
|
|
1668
|
+
y.forEach((M) => z.openNode(M));
|
|
1669
1669
|
}
|
|
1670
1670
|
let ye = {};
|
|
1671
|
-
function Ze(
|
|
1672
|
-
const
|
|
1673
|
-
if (x +=
|
|
1674
|
-
return
|
|
1675
|
-
if (ye.type === "begin" && M.type === "end" && ye.index === M.index &&
|
|
1676
|
-
if (x +=
|
|
1677
|
-
const
|
|
1678
|
-
throw
|
|
1671
|
+
function Ze(y, M) {
|
|
1672
|
+
const k = M && M[0];
|
|
1673
|
+
if (x += y, k == null)
|
|
1674
|
+
return q(), 0;
|
|
1675
|
+
if (ye.type === "begin" && M.type === "end" && ye.index === M.index && k === "") {
|
|
1676
|
+
if (x += w.slice(M.index, M.index + 1), !g) {
|
|
1677
|
+
const P = new Error(`0 width match regex (${b})`);
|
|
1678
|
+
throw P.languageName = b, P.badRule = ye.rule, P;
|
|
1679
1679
|
}
|
|
1680
1680
|
return 1;
|
|
1681
1681
|
}
|
|
1682
1682
|
if (ye = M, M.type === "begin")
|
|
1683
1683
|
return kn(M);
|
|
1684
|
-
if (M.type === "illegal" && !
|
|
1685
|
-
const
|
|
1686
|
-
throw
|
|
1684
|
+
if (M.type === "illegal" && !L) {
|
|
1685
|
+
const P = new Error('Illegal lexeme "' + k + '" for mode "' + (O.scope || "<unnamed>") + '"');
|
|
1686
|
+
throw P.mode = O, P;
|
|
1687
1687
|
} else if (M.type === "end") {
|
|
1688
|
-
const
|
|
1689
|
-
if (
|
|
1690
|
-
return
|
|
1688
|
+
const P = Bn(M);
|
|
1689
|
+
if (P !== sn)
|
|
1690
|
+
return P;
|
|
1691
1691
|
}
|
|
1692
|
-
if (M.type === "illegal" &&
|
|
1692
|
+
if (M.type === "illegal" && k === "")
|
|
1693
1693
|
return 1;
|
|
1694
1694
|
if (Le > 1e5 && Le > M.index * 3)
|
|
1695
1695
|
throw new Error("potential infinite loop, way more iterations than matches");
|
|
1696
|
-
return x +=
|
|
1696
|
+
return x += k, k.length;
|
|
1697
1697
|
}
|
|
1698
|
-
const V =
|
|
1698
|
+
const V = C(b);
|
|
1699
1699
|
if (!V)
|
|
1700
|
-
throw se(t.replace("{}",
|
|
1700
|
+
throw se(t.replace("{}", b)), new Error('Unknown language: "' + b + '"');
|
|
1701
1701
|
const Un = Ft(V);
|
|
1702
|
-
let
|
|
1702
|
+
let Re = "", O = U || Un;
|
|
1703
1703
|
const Ye = {}, z = new i.__emitter(i);
|
|
1704
1704
|
$n();
|
|
1705
1705
|
let x = "", we = 0, ie = 0, Le = 0, Oe = !1;
|
|
1706
1706
|
try {
|
|
1707
1707
|
if (V.__emitTokens)
|
|
1708
|
-
V.__emitTokens(
|
|
1708
|
+
V.__emitTokens(w, z);
|
|
1709
1709
|
else {
|
|
1710
|
-
for (
|
|
1711
|
-
Le++, Oe ? Oe = !1 :
|
|
1712
|
-
const
|
|
1713
|
-
if (!
|
|
1710
|
+
for (O.matcher.considerAll(); ; ) {
|
|
1711
|
+
Le++, Oe ? Oe = !1 : O.matcher.considerAll(), O.matcher.lastIndex = ie;
|
|
1712
|
+
const y = O.matcher.exec(w);
|
|
1713
|
+
if (!y)
|
|
1714
1714
|
break;
|
|
1715
|
-
const M =
|
|
1716
|
-
ie =
|
|
1715
|
+
const M = w.substring(ie, y.index), k = Ze(M, y);
|
|
1716
|
+
ie = y.index + k;
|
|
1717
1717
|
}
|
|
1718
|
-
Ze(
|
|
1718
|
+
Ze(w.substring(ie));
|
|
1719
1719
|
}
|
|
1720
|
-
return z.finalize(),
|
|
1721
|
-
language:
|
|
1722
|
-
value:
|
|
1720
|
+
return z.finalize(), Re = z.toHTML(), {
|
|
1721
|
+
language: b,
|
|
1722
|
+
value: Re,
|
|
1723
1723
|
relevance: we,
|
|
1724
1724
|
illegal: !1,
|
|
1725
1725
|
_emitter: z,
|
|
1726
|
-
_top:
|
|
1726
|
+
_top: O
|
|
1727
1727
|
};
|
|
1728
|
-
} catch (
|
|
1729
|
-
if (
|
|
1728
|
+
} catch (y) {
|
|
1729
|
+
if (y.message && y.message.includes("Illegal"))
|
|
1730
1730
|
return {
|
|
1731
|
-
language:
|
|
1732
|
-
value: ke(
|
|
1731
|
+
language: b,
|
|
1732
|
+
value: ke(w),
|
|
1733
1733
|
illegal: !0,
|
|
1734
1734
|
relevance: 0,
|
|
1735
1735
|
_illegalBy: {
|
|
1736
|
-
message:
|
|
1736
|
+
message: y.message,
|
|
1737
1737
|
index: ie,
|
|
1738
|
-
context:
|
|
1739
|
-
mode:
|
|
1740
|
-
resultSoFar:
|
|
1738
|
+
context: w.slice(ie - 100, ie + 100),
|
|
1739
|
+
mode: y.mode,
|
|
1740
|
+
resultSoFar: Re
|
|
1741
1741
|
},
|
|
1742
1742
|
_emitter: z
|
|
1743
1743
|
};
|
|
1744
|
-
if (
|
|
1744
|
+
if (g)
|
|
1745
1745
|
return {
|
|
1746
|
-
language:
|
|
1747
|
-
value: ke(
|
|
1746
|
+
language: b,
|
|
1747
|
+
value: ke(w),
|
|
1748
1748
|
illegal: !1,
|
|
1749
1749
|
relevance: 0,
|
|
1750
|
-
errorRaised:
|
|
1750
|
+
errorRaised: y,
|
|
1751
1751
|
_emitter: z,
|
|
1752
|
-
_top:
|
|
1752
|
+
_top: O
|
|
1753
1753
|
};
|
|
1754
|
-
throw
|
|
1754
|
+
throw y;
|
|
1755
1755
|
}
|
|
1756
1756
|
}
|
|
1757
|
-
function f(
|
|
1758
|
-
const
|
|
1759
|
-
value: ke(
|
|
1757
|
+
function f(b) {
|
|
1758
|
+
const w = {
|
|
1759
|
+
value: ke(b),
|
|
1760
1760
|
illegal: !1,
|
|
1761
1761
|
relevance: 0,
|
|
1762
1762
|
_top: r,
|
|
1763
1763
|
_emitter: new i.__emitter(i)
|
|
1764
1764
|
};
|
|
1765
|
-
return
|
|
1765
|
+
return w._emitter.addText(b), w;
|
|
1766
1766
|
}
|
|
1767
|
-
function
|
|
1768
|
-
|
|
1769
|
-
const
|
|
1770
|
-
(
|
|
1767
|
+
function h(b, w) {
|
|
1768
|
+
w = w || i.languages || Object.keys(n);
|
|
1769
|
+
const L = f(b), U = w.filter(C).filter($).map(
|
|
1770
|
+
(q) => c(q, b, !1)
|
|
1771
1771
|
);
|
|
1772
|
-
|
|
1773
|
-
const H =
|
|
1774
|
-
if (
|
|
1775
|
-
return j.relevance -
|
|
1776
|
-
if (
|
|
1777
|
-
if (
|
|
1772
|
+
U.unshift(L);
|
|
1773
|
+
const H = U.sort((q, j) => {
|
|
1774
|
+
if (q.relevance !== j.relevance)
|
|
1775
|
+
return j.relevance - q.relevance;
|
|
1776
|
+
if (q.language && j.language) {
|
|
1777
|
+
if (C(q.language).supersetOf === j.language)
|
|
1778
1778
|
return 1;
|
|
1779
|
-
if (
|
|
1779
|
+
if (C(j.language).supersetOf === q.language)
|
|
1780
1780
|
return -1;
|
|
1781
1781
|
}
|
|
1782
1782
|
return 0;
|
|
1783
1783
|
}), [W, Y] = H, me = W;
|
|
1784
1784
|
return me.secondBest = Y, me;
|
|
1785
1785
|
}
|
|
1786
|
-
function d(
|
|
1787
|
-
const
|
|
1788
|
-
|
|
1786
|
+
function d(b, w, L) {
|
|
1787
|
+
const U = w && a[w] || L;
|
|
1788
|
+
b.classList.add("hljs"), b.classList.add(`language-${U}`);
|
|
1789
1789
|
}
|
|
1790
|
-
function p(
|
|
1791
|
-
let
|
|
1792
|
-
const
|
|
1793
|
-
if (s(
|
|
1790
|
+
function p(b) {
|
|
1791
|
+
let w = null;
|
|
1792
|
+
const L = o(b);
|
|
1793
|
+
if (s(L))
|
|
1794
1794
|
return;
|
|
1795
1795
|
if (te(
|
|
1796
1796
|
"before:highlightElement",
|
|
1797
|
-
{ el:
|
|
1798
|
-
),
|
|
1799
|
-
console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",
|
|
1797
|
+
{ el: b, language: L }
|
|
1798
|
+
), b.dataset.highlighted) {
|
|
1799
|
+
console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.", b);
|
|
1800
1800
|
return;
|
|
1801
1801
|
}
|
|
1802
|
-
if (
|
|
1802
|
+
if (b.children.length > 0 && (i.ignoreUnescapedHTML || (console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), console.warn("The element with unescaped HTML:"), console.warn(b)), i.throwUnescapedHTML))
|
|
1803
1803
|
throw new Kt(
|
|
1804
1804
|
"One of your code blocks includes unescaped HTML.",
|
|
1805
|
-
|
|
1805
|
+
b.innerHTML
|
|
1806
1806
|
);
|
|
1807
|
-
|
|
1808
|
-
const
|
|
1809
|
-
|
|
1807
|
+
w = b;
|
|
1808
|
+
const U = w.textContent, H = L ? l(U, { language: L, ignoreIllegals: !0 }) : h(U);
|
|
1809
|
+
b.innerHTML = H.value, b.dataset.highlighted = "yes", d(b, L, H.language), b.result = {
|
|
1810
1810
|
language: H.language,
|
|
1811
1811
|
// TODO: remove with version 11.0
|
|
1812
1812
|
re: H.relevance,
|
|
1813
1813
|
relevance: H.relevance
|
|
1814
|
-
}, H.secondBest && (
|
|
1814
|
+
}, H.secondBest && (b.secondBest = {
|
|
1815
1815
|
language: H.secondBest.language,
|
|
1816
1816
|
relevance: H.secondBest.relevance
|
|
1817
|
-
}), te("after:highlightElement", { el:
|
|
1817
|
+
}), te("after:highlightElement", { el: b, result: H, text: U });
|
|
1818
1818
|
}
|
|
1819
|
-
function _(
|
|
1820
|
-
i = rn(i,
|
|
1819
|
+
function _(b) {
|
|
1820
|
+
i = rn(i, b);
|
|
1821
1821
|
}
|
|
1822
|
-
const
|
|
1823
|
-
|
|
1822
|
+
const v = () => {
|
|
1823
|
+
N(), le("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
|
|
1824
1824
|
};
|
|
1825
|
-
function
|
|
1826
|
-
|
|
1825
|
+
function E() {
|
|
1826
|
+
N(), le("10.6.0", "initHighlightingOnLoad() deprecated. Use highlightAll() now.");
|
|
1827
1827
|
}
|
|
1828
|
-
let
|
|
1829
|
-
function
|
|
1828
|
+
let m = !1;
|
|
1829
|
+
function N() {
|
|
1830
1830
|
if (document.readyState === "loading") {
|
|
1831
|
-
|
|
1831
|
+
m = !0;
|
|
1832
1832
|
return;
|
|
1833
1833
|
}
|
|
1834
1834
|
document.querySelectorAll(i.cssSelector).forEach(p);
|
|
1835
1835
|
}
|
|
1836
|
-
function
|
|
1837
|
-
|
|
1836
|
+
function D() {
|
|
1837
|
+
m && N();
|
|
1838
1838
|
}
|
|
1839
|
-
typeof window != "undefined" && window.addEventListener && window.addEventListener("DOMContentLoaded",
|
|
1840
|
-
function
|
|
1841
|
-
let
|
|
1839
|
+
typeof window != "undefined" && window.addEventListener && window.addEventListener("DOMContentLoaded", D, !1);
|
|
1840
|
+
function S(b, w) {
|
|
1841
|
+
let L = null;
|
|
1842
1842
|
try {
|
|
1843
|
-
|
|
1844
|
-
} catch (
|
|
1845
|
-
if (se("Language definition for '{}' could not be registered.".replace("{}",
|
|
1846
|
-
se(
|
|
1843
|
+
L = w(e);
|
|
1844
|
+
} catch (U) {
|
|
1845
|
+
if (se("Language definition for '{}' could not be registered.".replace("{}", b)), g)
|
|
1846
|
+
se(U);
|
|
1847
1847
|
else
|
|
1848
|
-
throw
|
|
1849
|
-
|
|
1848
|
+
throw U;
|
|
1849
|
+
L = r;
|
|
1850
1850
|
}
|
|
1851
|
-
|
|
1851
|
+
L.name || (L.name = b), n[b] = L, L.rawDefinition = w.bind(null, e), L.aliases && I(L.aliases, { languageName: b });
|
|
1852
1852
|
}
|
|
1853
|
-
function
|
|
1854
|
-
delete n[
|
|
1855
|
-
for (const
|
|
1856
|
-
a[
|
|
1853
|
+
function A(b) {
|
|
1854
|
+
delete n[b];
|
|
1855
|
+
for (const w of Object.keys(a))
|
|
1856
|
+
a[w] === b && delete a[w];
|
|
1857
1857
|
}
|
|
1858
|
-
function
|
|
1858
|
+
function R() {
|
|
1859
1859
|
return Object.keys(n);
|
|
1860
1860
|
}
|
|
1861
|
-
function
|
|
1862
|
-
return
|
|
1861
|
+
function C(b) {
|
|
1862
|
+
return b = (b || "").toLowerCase(), n[b] || n[a[b]];
|
|
1863
1863
|
}
|
|
1864
|
-
function
|
|
1865
|
-
typeof
|
|
1866
|
-
a[
|
|
1864
|
+
function I(b, { languageName: w }) {
|
|
1865
|
+
typeof b == "string" && (b = [b]), b.forEach((L) => {
|
|
1866
|
+
a[L.toLowerCase()] = w;
|
|
1867
1867
|
});
|
|
1868
1868
|
}
|
|
1869
|
-
function
|
|
1870
|
-
const
|
|
1871
|
-
return
|
|
1869
|
+
function $(b) {
|
|
1870
|
+
const w = C(b);
|
|
1871
|
+
return w && !w.disableAutodetect;
|
|
1872
1872
|
}
|
|
1873
|
-
function
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
Object.assign({ block:
|
|
1873
|
+
function B(b) {
|
|
1874
|
+
b["before:highlightBlock"] && !b["before:highlightElement"] && (b["before:highlightElement"] = (w) => {
|
|
1875
|
+
b["before:highlightBlock"](
|
|
1876
|
+
Object.assign({ block: w.el }, w)
|
|
1877
1877
|
);
|
|
1878
|
-
}),
|
|
1879
|
-
|
|
1880
|
-
Object.assign({ block:
|
|
1878
|
+
}), b["after:highlightBlock"] && !b["after:highlightElement"] && (b["after:highlightElement"] = (w) => {
|
|
1879
|
+
b["after:highlightBlock"](
|
|
1880
|
+
Object.assign({ block: w.el }, w)
|
|
1881
1881
|
);
|
|
1882
1882
|
});
|
|
1883
1883
|
}
|
|
1884
|
-
function F(
|
|
1885
|
-
|
|
1884
|
+
function F(b) {
|
|
1885
|
+
B(b), u.push(b);
|
|
1886
1886
|
}
|
|
1887
|
-
function K(
|
|
1888
|
-
const
|
|
1889
|
-
|
|
1887
|
+
function K(b) {
|
|
1888
|
+
const w = u.indexOf(b);
|
|
1889
|
+
w !== -1 && u.splice(w, 1);
|
|
1890
1890
|
}
|
|
1891
|
-
function te(
|
|
1892
|
-
const
|
|
1893
|
-
u.forEach(function(
|
|
1894
|
-
|
|
1891
|
+
function te(b, w) {
|
|
1892
|
+
const L = b;
|
|
1893
|
+
u.forEach(function(U) {
|
|
1894
|
+
U[L] && U[L](w);
|
|
1895
1895
|
});
|
|
1896
1896
|
}
|
|
1897
|
-
function oe(
|
|
1898
|
-
return le("10.7.0", "highlightBlock will be removed entirely in v12.0"), le("10.7.0", "Please use highlightElement now."), p(
|
|
1897
|
+
function oe(b) {
|
|
1898
|
+
return le("10.7.0", "highlightBlock will be removed entirely in v12.0"), le("10.7.0", "Please use highlightElement now."), p(b);
|
|
1899
1899
|
}
|
|
1900
1900
|
Object.assign(e, {
|
|
1901
1901
|
highlight: l,
|
|
1902
|
-
highlightAuto:
|
|
1903
|
-
highlightAll:
|
|
1902
|
+
highlightAuto: h,
|
|
1903
|
+
highlightAll: N,
|
|
1904
1904
|
highlightElement: p,
|
|
1905
1905
|
// TODO: Remove with v12 API
|
|
1906
1906
|
highlightBlock: oe,
|
|
1907
1907
|
configure: _,
|
|
1908
|
-
initHighlighting:
|
|
1909
|
-
initHighlightingOnLoad:
|
|
1910
|
-
registerLanguage:
|
|
1911
|
-
unregisterLanguage:
|
|
1912
|
-
listLanguages:
|
|
1913
|
-
getLanguage:
|
|
1914
|
-
registerAliases:
|
|
1915
|
-
autoDetection:
|
|
1908
|
+
initHighlighting: v,
|
|
1909
|
+
initHighlightingOnLoad: E,
|
|
1910
|
+
registerLanguage: S,
|
|
1911
|
+
unregisterLanguage: A,
|
|
1912
|
+
listLanguages: R,
|
|
1913
|
+
getLanguage: C,
|
|
1914
|
+
registerAliases: I,
|
|
1915
|
+
autoDetection: $,
|
|
1916
1916
|
inherit: rn,
|
|
1917
1917
|
addPlugin: F,
|
|
1918
1918
|
removePlugin: K
|
|
1919
1919
|
}), e.debugMode = function() {
|
|
1920
|
-
|
|
1920
|
+
g = !1;
|
|
1921
1921
|
}, e.safeMode = function() {
|
|
1922
|
-
|
|
1922
|
+
g = !0;
|
|
1923
1923
|
}, e.versionString = Gt, e.regex = {
|
|
1924
1924
|
concat: ae,
|
|
1925
1925
|
lookahead: bn,
|
|
@@ -1927,17 +1927,17 @@ https://github.com/highlightjs/highlight.js/issues/2277`), H = v, B = N), O ===
|
|
|
1927
1927
|
optional: st,
|
|
1928
1928
|
anyNumberOfTimes: it
|
|
1929
1929
|
};
|
|
1930
|
-
for (const
|
|
1931
|
-
typeof Ne[
|
|
1930
|
+
for (const b in Ne)
|
|
1931
|
+
typeof Ne[b] == "object" && pn(Ne[b]);
|
|
1932
1932
|
return Object.assign(e, Ne), e;
|
|
1933
1933
|
}, ue = Tn({});
|
|
1934
1934
|
ue.newInstance = () => Tn({});
|
|
1935
|
-
var
|
|
1935
|
+
var qt = ue;
|
|
1936
1936
|
ue.HighlightJS = ue;
|
|
1937
1937
|
ue.default = ue;
|
|
1938
|
-
const Z = /* @__PURE__ */ Jn(
|
|
1939
|
-
function
|
|
1940
|
-
const n = e.regex, a = n.concat(/[\p{L}_]/u, n.optional(/[\p{L}0-9_.-]*:/u), /[\p{L}0-9_.-]*/u), u = /[\p{L}0-9._:-]+/u,
|
|
1938
|
+
const Z = /* @__PURE__ */ Jn(qt);
|
|
1939
|
+
function Qt(e) {
|
|
1940
|
+
const n = e.regex, a = n.concat(/[\p{L}_]/u, n.optional(/[\p{L}0-9_.-]*:/u), /[\p{L}0-9_.-]*/u), u = /[\p{L}0-9._:-]+/u, g = {
|
|
1941
1941
|
className: "symbol",
|
|
1942
1942
|
begin: /&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/
|
|
1943
1943
|
}, t = {
|
|
@@ -1973,12 +1973,12 @@ function qt(e) {
|
|
|
1973
1973
|
{
|
|
1974
1974
|
begin: /"/,
|
|
1975
1975
|
end: /"/,
|
|
1976
|
-
contains: [
|
|
1976
|
+
contains: [g]
|
|
1977
1977
|
},
|
|
1978
1978
|
{
|
|
1979
1979
|
begin: /'/,
|
|
1980
1980
|
end: /'/,
|
|
1981
|
-
contains: [
|
|
1981
|
+
contains: [g]
|
|
1982
1982
|
},
|
|
1983
1983
|
{ begin: /[^\s"'=<>`]+/ }
|
|
1984
1984
|
]
|
|
@@ -2043,7 +2043,7 @@ function qt(e) {
|
|
|
2043
2043
|
end: /\]\]>/,
|
|
2044
2044
|
relevance: 10
|
|
2045
2045
|
},
|
|
2046
|
-
|
|
2046
|
+
g,
|
|
2047
2047
|
// xml processing instructions
|
|
2048
2048
|
{
|
|
2049
2049
|
className: "meta",
|
|
@@ -2261,7 +2261,7 @@ const an = "[A-Za-z$_][0-9A-Za-z$_]*", Zt = [
|
|
|
2261
2261
|
"SyntaxError",
|
|
2262
2262
|
"TypeError",
|
|
2263
2263
|
"URIError"
|
|
2264
|
-
],
|
|
2264
|
+
], Cn = [
|
|
2265
2265
|
"setInterval",
|
|
2266
2266
|
"setTimeout",
|
|
2267
2267
|
"clearInterval",
|
|
@@ -2292,15 +2292,15 @@ const an = "[A-Za-z$_][0-9A-Za-z$_]*", Zt = [
|
|
|
2292
2292
|
"global"
|
|
2293
2293
|
// Node.js
|
|
2294
2294
|
], Vt = [].concat(
|
|
2295
|
-
|
|
2295
|
+
Cn,
|
|
2296
2296
|
Sn,
|
|
2297
2297
|
Dn
|
|
2298
2298
|
);
|
|
2299
2299
|
function Xt(e) {
|
|
2300
|
-
const n = e.regex, a = (
|
|
2301
|
-
const
|
|
2302
|
-
return
|
|
2303
|
-
}, u = an,
|
|
2300
|
+
const n = e.regex, a = (w, { after: L }) => {
|
|
2301
|
+
const U = "</" + w[0].slice(1);
|
|
2302
|
+
return w.input.indexOf(U, L) !== -1;
|
|
2303
|
+
}, u = an, g = {
|
|
2304
2304
|
begin: "<>",
|
|
2305
2305
|
end: "</>"
|
|
2306
2306
|
}, t = /<[A-Za-z0-9\\._:-]+\s*\/>/, r = {
|
|
@@ -2310,8 +2310,8 @@ function Xt(e) {
|
|
|
2310
2310
|
* @param {RegExpMatchArray} match
|
|
2311
2311
|
* @param {CallbackResponse} response
|
|
2312
2312
|
*/
|
|
2313
|
-
isTrulyOpeningTag: (
|
|
2314
|
-
const
|
|
2313
|
+
isTrulyOpeningTag: (w, L) => {
|
|
2314
|
+
const U = w[0].length + w.index, H = w.input[U];
|
|
2315
2315
|
if (
|
|
2316
2316
|
// HTML should not include another raw `<` inside a tag
|
|
2317
2317
|
// nested type?
|
|
@@ -2320,18 +2320,18 @@ function Xt(e) {
|
|
|
2320
2320
|
// `<T, A extends keyof T, V>`
|
|
2321
2321
|
H === ","
|
|
2322
2322
|
) {
|
|
2323
|
-
|
|
2323
|
+
L.ignoreMatch();
|
|
2324
2324
|
return;
|
|
2325
2325
|
}
|
|
2326
|
-
H === ">" && (a(
|
|
2326
|
+
H === ">" && (a(w, { after: U }) || L.ignoreMatch());
|
|
2327
2327
|
let W;
|
|
2328
|
-
const Y =
|
|
2328
|
+
const Y = w.input.substring(U);
|
|
2329
2329
|
if (W = Y.match(/^\s*=/)) {
|
|
2330
|
-
|
|
2330
|
+
L.ignoreMatch();
|
|
2331
2331
|
return;
|
|
2332
2332
|
}
|
|
2333
2333
|
if ((W = Y.match(/^\s+extends\s+/)) && W.index === 0) {
|
|
2334
|
-
|
|
2334
|
+
L.ignoreMatch();
|
|
2335
2335
|
return;
|
|
2336
2336
|
}
|
|
2337
2337
|
}
|
|
@@ -2365,7 +2365,7 @@ function Xt(e) {
|
|
|
2365
2365
|
keywords: i,
|
|
2366
2366
|
contains: []
|
|
2367
2367
|
// defined later
|
|
2368
|
-
},
|
|
2368
|
+
}, h = {
|
|
2369
2369
|
begin: "html`",
|
|
2370
2370
|
end: "",
|
|
2371
2371
|
starts: {
|
|
@@ -2409,7 +2409,7 @@ function Xt(e) {
|
|
|
2409
2409
|
e.BACKSLASH_ESCAPE,
|
|
2410
2410
|
f
|
|
2411
2411
|
]
|
|
2412
|
-
},
|
|
2412
|
+
}, E = {
|
|
2413
2413
|
className: "comment",
|
|
2414
2414
|
variants: [
|
|
2415
2415
|
e.COMMENT(
|
|
@@ -2454,10 +2454,10 @@ function Xt(e) {
|
|
|
2454
2454
|
e.C_BLOCK_COMMENT_MODE,
|
|
2455
2455
|
e.C_LINE_COMMENT_MODE
|
|
2456
2456
|
]
|
|
2457
|
-
},
|
|
2457
|
+
}, m = [
|
|
2458
2458
|
e.APOS_STRING_MODE,
|
|
2459
2459
|
e.QUOTE_STRING_MODE,
|
|
2460
|
-
|
|
2460
|
+
h,
|
|
2461
2461
|
d,
|
|
2462
2462
|
p,
|
|
2463
2463
|
_,
|
|
@@ -2468,7 +2468,7 @@ function Xt(e) {
|
|
|
2468
2468
|
// See https://github.com/highlightjs/highlight.js/issues/3288
|
|
2469
2469
|
// hljs.REGEXP_MODE
|
|
2470
2470
|
];
|
|
2471
|
-
f.contains =
|
|
2471
|
+
f.contains = m.concat({
|
|
2472
2472
|
// we need to pair up {} inside our subst to prevent
|
|
2473
2473
|
// it from ending too early by matching another }
|
|
2474
2474
|
begin: /\{/,
|
|
@@ -2476,25 +2476,25 @@ function Xt(e) {
|
|
|
2476
2476
|
keywords: i,
|
|
2477
2477
|
contains: [
|
|
2478
2478
|
"self"
|
|
2479
|
-
].concat(
|
|
2479
|
+
].concat(m)
|
|
2480
2480
|
});
|
|
2481
|
-
const
|
|
2481
|
+
const N = [].concat(E, f.contains), D = N.concat([
|
|
2482
2482
|
// eat recursive parens in sub expressions
|
|
2483
2483
|
{
|
|
2484
2484
|
begin: /\(/,
|
|
2485
2485
|
end: /\)/,
|
|
2486
2486
|
keywords: i,
|
|
2487
|
-
contains: ["self"].concat(
|
|
2487
|
+
contains: ["self"].concat(N)
|
|
2488
2488
|
}
|
|
2489
|
-
]),
|
|
2489
|
+
]), S = {
|
|
2490
2490
|
className: "params",
|
|
2491
2491
|
begin: /\(/,
|
|
2492
2492
|
end: /\)/,
|
|
2493
2493
|
excludeBegin: !0,
|
|
2494
2494
|
excludeEnd: !0,
|
|
2495
2495
|
keywords: i,
|
|
2496
|
-
contains:
|
|
2497
|
-
},
|
|
2496
|
+
contains: D
|
|
2497
|
+
}, A = {
|
|
2498
2498
|
variants: [
|
|
2499
2499
|
// class Car extends vehicle
|
|
2500
2500
|
{
|
|
@@ -2527,7 +2527,7 @@ function Xt(e) {
|
|
|
2527
2527
|
}
|
|
2528
2528
|
}
|
|
2529
2529
|
]
|
|
2530
|
-
},
|
|
2530
|
+
}, R = {
|
|
2531
2531
|
relevance: 0,
|
|
2532
2532
|
match: n.either(
|
|
2533
2533
|
// Hard coded exceptions
|
|
@@ -2551,12 +2551,12 @@ function Xt(e) {
|
|
|
2551
2551
|
...Dn
|
|
2552
2552
|
]
|
|
2553
2553
|
}
|
|
2554
|
-
},
|
|
2554
|
+
}, C = {
|
|
2555
2555
|
label: "use_strict",
|
|
2556
2556
|
className: "meta",
|
|
2557
2557
|
relevance: 10,
|
|
2558
2558
|
begin: /^\s*['"]use (strict|asm)['"]/
|
|
2559
|
-
},
|
|
2559
|
+
}, I = {
|
|
2560
2560
|
variants: [
|
|
2561
2561
|
{
|
|
2562
2562
|
match: [
|
|
@@ -2579,21 +2579,21 @@ function Xt(e) {
|
|
|
2579
2579
|
3: "title.function"
|
|
2580
2580
|
},
|
|
2581
2581
|
label: "func.def",
|
|
2582
|
-
contains: [
|
|
2582
|
+
contains: [S],
|
|
2583
2583
|
illegal: /%/
|
|
2584
|
-
},
|
|
2584
|
+
}, $ = {
|
|
2585
2585
|
relevance: 0,
|
|
2586
2586
|
match: /\b[A-Z][A-Z_0-9]+\b/,
|
|
2587
2587
|
className: "variable.constant"
|
|
2588
2588
|
};
|
|
2589
|
-
function
|
|
2590
|
-
return n.concat("(?!",
|
|
2589
|
+
function B(w) {
|
|
2590
|
+
return n.concat("(?!", w.join("|"), ")");
|
|
2591
2591
|
}
|
|
2592
2592
|
const F = {
|
|
2593
2593
|
match: n.concat(
|
|
2594
2594
|
/\b/,
|
|
2595
|
-
|
|
2596
|
-
...
|
|
2595
|
+
B([
|
|
2596
|
+
...Cn,
|
|
2597
2597
|
"super",
|
|
2598
2598
|
"import"
|
|
2599
2599
|
]),
|
|
@@ -2627,9 +2627,9 @@ function Xt(e) {
|
|
|
2627
2627
|
// eat to avoid empty params
|
|
2628
2628
|
begin: /\(\)/
|
|
2629
2629
|
},
|
|
2630
|
-
|
|
2630
|
+
S
|
|
2631
2631
|
]
|
|
2632
|
-
}, oe = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>",
|
|
2632
|
+
}, oe = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>", b = {
|
|
2633
2633
|
match: [
|
|
2634
2634
|
/const|var|let/,
|
|
2635
2635
|
/\s+/,
|
|
@@ -2646,7 +2646,7 @@ function Xt(e) {
|
|
|
2646
2646
|
3: "title.function"
|
|
2647
2647
|
},
|
|
2648
2648
|
contains: [
|
|
2649
|
-
|
|
2649
|
+
S
|
|
2650
2650
|
]
|
|
2651
2651
|
};
|
|
2652
2652
|
return {
|
|
@@ -2654,7 +2654,7 @@ function Xt(e) {
|
|
|
2654
2654
|
aliases: ["js", "jsx", "mjs", "cjs"],
|
|
2655
2655
|
keywords: i,
|
|
2656
2656
|
// this will be extended by TypeScript
|
|
2657
|
-
exports: { PARAMS_CONTAINS:
|
|
2657
|
+
exports: { PARAMS_CONTAINS: D, CLASS_REFERENCE: R },
|
|
2658
2658
|
illegal: /#(?![$_A-z])/,
|
|
2659
2659
|
contains: [
|
|
2660
2660
|
e.SHEBANG({
|
|
@@ -2662,31 +2662,31 @@ function Xt(e) {
|
|
|
2662
2662
|
binary: "node",
|
|
2663
2663
|
relevance: 5
|
|
2664
2664
|
}),
|
|
2665
|
-
|
|
2665
|
+
C,
|
|
2666
2666
|
e.APOS_STRING_MODE,
|
|
2667
2667
|
e.QUOTE_STRING_MODE,
|
|
2668
|
-
|
|
2668
|
+
h,
|
|
2669
2669
|
d,
|
|
2670
2670
|
p,
|
|
2671
2671
|
_,
|
|
2672
|
-
|
|
2672
|
+
E,
|
|
2673
2673
|
// Skip numbers when they are part of a variable name
|
|
2674
2674
|
{ match: /\$\d+/ },
|
|
2675
2675
|
c,
|
|
2676
|
-
|
|
2676
|
+
R,
|
|
2677
2677
|
{
|
|
2678
2678
|
className: "attr",
|
|
2679
2679
|
begin: u + n.lookahead(":"),
|
|
2680
2680
|
relevance: 0
|
|
2681
2681
|
},
|
|
2682
|
-
|
|
2682
|
+
b,
|
|
2683
2683
|
{
|
|
2684
2684
|
// "value" container
|
|
2685
2685
|
begin: "(" + e.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
|
|
2686
2686
|
keywords: "return throw case",
|
|
2687
2687
|
relevance: 0,
|
|
2688
2688
|
contains: [
|
|
2689
|
-
|
|
2689
|
+
E,
|
|
2690
2690
|
e.REGEXP_MODE,
|
|
2691
2691
|
{
|
|
2692
2692
|
className: "function",
|
|
@@ -2715,7 +2715,7 @@ function Xt(e) {
|
|
|
2715
2715
|
excludeBegin: !0,
|
|
2716
2716
|
excludeEnd: !0,
|
|
2717
2717
|
keywords: i,
|
|
2718
|
-
contains:
|
|
2718
|
+
contains: D
|
|
2719
2719
|
}
|
|
2720
2720
|
]
|
|
2721
2721
|
}
|
|
@@ -2733,7 +2733,7 @@ function Xt(e) {
|
|
|
2733
2733
|
{
|
|
2734
2734
|
// JSX
|
|
2735
2735
|
variants: [
|
|
2736
|
-
{ begin:
|
|
2736
|
+
{ begin: g.begin, end: g.end },
|
|
2737
2737
|
{ match: t },
|
|
2738
2738
|
{
|
|
2739
2739
|
begin: r.begin,
|
|
@@ -2755,7 +2755,7 @@ function Xt(e) {
|
|
|
2755
2755
|
}
|
|
2756
2756
|
]
|
|
2757
2757
|
},
|
|
2758
|
-
|
|
2758
|
+
I,
|
|
2759
2759
|
{
|
|
2760
2760
|
// prevent this from getting swallowed up by function
|
|
2761
2761
|
// since they appear "function like"
|
|
@@ -2770,7 +2770,7 @@ function Xt(e) {
|
|
|
2770
2770
|
returnBegin: !0,
|
|
2771
2771
|
label: "func.def",
|
|
2772
2772
|
contains: [
|
|
2773
|
-
|
|
2773
|
+
S,
|
|
2774
2774
|
e.inherit(e.TITLE_MODE, { begin: u, className: "title.function" })
|
|
2775
2775
|
]
|
|
2776
2776
|
},
|
|
@@ -2790,11 +2790,11 @@ function Xt(e) {
|
|
|
2790
2790
|
{
|
|
2791
2791
|
match: [/\bconstructor(?=\s*\()/],
|
|
2792
2792
|
className: { 1: "title.function" },
|
|
2793
|
-
contains: [
|
|
2793
|
+
contains: [S]
|
|
2794
2794
|
},
|
|
2795
2795
|
F,
|
|
2796
|
-
|
|
2797
|
-
|
|
2796
|
+
$,
|
|
2797
|
+
A,
|
|
2798
2798
|
te,
|
|
2799
2799
|
{
|
|
2800
2800
|
match: /\$[(.]/
|
|
@@ -2816,7 +2816,7 @@ function Jt(e) {
|
|
|
2816
2816
|
"true",
|
|
2817
2817
|
"false",
|
|
2818
2818
|
"null"
|
|
2819
|
-
],
|
|
2819
|
+
], g = {
|
|
2820
2820
|
scope: "literal",
|
|
2821
2821
|
beginKeywords: u.join(" ")
|
|
2822
2822
|
};
|
|
@@ -2829,7 +2829,7 @@ function Jt(e) {
|
|
|
2829
2829
|
n,
|
|
2830
2830
|
a,
|
|
2831
2831
|
e.QUOTE_STRING_MODE,
|
|
2832
|
-
|
|
2832
|
+
g,
|
|
2833
2833
|
e.C_NUMBER_MODE,
|
|
2834
2834
|
e.C_LINE_COMMENT_MODE,
|
|
2835
2835
|
e.C_BLOCK_COMMENT_MODE
|
|
@@ -2851,7 +2851,7 @@ function er(e) {
|
|
|
2851
2851
|
begin: "'\\w[\\w :\\/.-]*':(?=[ ]|$)"
|
|
2852
2852
|
}
|
|
2853
2853
|
]
|
|
2854
|
-
},
|
|
2854
|
+
}, g = {
|
|
2855
2855
|
className: "template-variable",
|
|
2856
2856
|
variants: [
|
|
2857
2857
|
{
|
|
@@ -2881,7 +2881,7 @@ function er(e) {
|
|
|
2881
2881
|
],
|
|
2882
2882
|
contains: [
|
|
2883
2883
|
e.BACKSLASH_ESCAPE,
|
|
2884
|
-
|
|
2884
|
+
g
|
|
2885
2885
|
]
|
|
2886
2886
|
}, r = e.inherit(t, { variants: [
|
|
2887
2887
|
{
|
|
@@ -2902,7 +2902,7 @@ function er(e) {
|
|
|
2902
2902
|
excludeEnd: !0,
|
|
2903
2903
|
keywords: n,
|
|
2904
2904
|
relevance: 0
|
|
2905
|
-
},
|
|
2905
|
+
}, h = {
|
|
2906
2906
|
begin: /\{/,
|
|
2907
2907
|
end: /\}/,
|
|
2908
2908
|
contains: [f],
|
|
@@ -2990,7 +2990,7 @@ function er(e) {
|
|
|
2990
2990
|
begin: e.C_NUMBER_RE + "\\b",
|
|
2991
2991
|
relevance: 0
|
|
2992
2992
|
},
|
|
2993
|
-
|
|
2993
|
+
h,
|
|
2994
2994
|
d,
|
|
2995
2995
|
t
|
|
2996
2996
|
], _ = [...p];
|
|
@@ -3237,7 +3237,7 @@ function tr(e) {
|
|
|
3237
3237
|
e.APOS_STRING_MODE,
|
|
3238
3238
|
e.QUOTE_STRING_MODE
|
|
3239
3239
|
]
|
|
3240
|
-
}, f = "[0-9](_?[0-9])*",
|
|
3240
|
+
}, f = "[0-9](_?[0-9])*", h = `(\\b(${f}))?\\.(${f})|\\b(${f})\\.`, d = `\\b|${u.join("|")}`, p = {
|
|
3241
3241
|
className: "number",
|
|
3242
3242
|
relevance: 0,
|
|
3243
3243
|
variants: [
|
|
@@ -3252,10 +3252,10 @@ function tr(e) {
|
|
|
3252
3252
|
// because both MUST contain a decimal point and so cannot be confused with
|
|
3253
3253
|
// the interior part of an identifier
|
|
3254
3254
|
{
|
|
3255
|
-
begin: `(\\b(${f})|(${
|
|
3255
|
+
begin: `(\\b(${f})|(${h}))[eE][+-]?(${f})[jJ]?(?=${d})`
|
|
3256
3256
|
},
|
|
3257
3257
|
{
|
|
3258
|
-
begin: `(${
|
|
3258
|
+
begin: `(${h})[jJ]?`
|
|
3259
3259
|
},
|
|
3260
3260
|
// decinteger, bininteger, octinteger, hexinteger
|
|
3261
3261
|
// https://docs.python.org/3.9/reference/lexical_analysis.html#integer-literals
|
|
@@ -3298,7 +3298,7 @@ function tr(e) {
|
|
|
3298
3298
|
endsWithParent: !0
|
|
3299
3299
|
}
|
|
3300
3300
|
]
|
|
3301
|
-
},
|
|
3301
|
+
}, v = {
|
|
3302
3302
|
className: "params",
|
|
3303
3303
|
variants: [
|
|
3304
3304
|
// Exclude params in functions without params
|
|
@@ -3363,7 +3363,7 @@ function tr(e) {
|
|
|
3363
3363
|
1: "keyword",
|
|
3364
3364
|
3: "title.function"
|
|
3365
3365
|
},
|
|
3366
|
-
contains: [
|
|
3366
|
+
contains: [v]
|
|
3367
3367
|
},
|
|
3368
3368
|
{
|
|
3369
3369
|
variants: [
|
|
@@ -3398,7 +3398,7 @@ function tr(e) {
|
|
|
3398
3398
|
end: /(?=#)|$/,
|
|
3399
3399
|
contains: [
|
|
3400
3400
|
p,
|
|
3401
|
-
|
|
3401
|
+
v,
|
|
3402
3402
|
c
|
|
3403
3403
|
]
|
|
3404
3404
|
}
|
|
@@ -3428,11 +3428,11 @@ var ce = "[0-9](_*[0-9])*", Ae = `\\.(${ce})`, Me = "[0-9a-fA-F](_*[0-9a-fA-F])*
|
|
|
3428
3428
|
],
|
|
3429
3429
|
relevance: 0
|
|
3430
3430
|
};
|
|
3431
|
-
function
|
|
3432
|
-
return a === -1 ? "" : e.replace(n, (u) =>
|
|
3431
|
+
function Rn(e, n, a) {
|
|
3432
|
+
return a === -1 ? "" : e.replace(n, (u) => Rn(e, n, a - 1));
|
|
3433
3433
|
}
|
|
3434
3434
|
function rr(e) {
|
|
3435
|
-
const n = e.regex, a = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", u = a +
|
|
3435
|
+
const n = e.regex, a = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", u = a + Rn("(?:<" + a + "~~~(?:\\s*,\\s*" + a + "~~~)*>)?", /~~~/g, 2), s = {
|
|
3436
3436
|
keyword: [
|
|
3437
3437
|
"synchronized",
|
|
3438
3438
|
"abstract",
|
|
@@ -3665,7 +3665,7 @@ function ir(e) {
|
|
|
3665
3665
|
u
|
|
3666
3666
|
]
|
|
3667
3667
|
});
|
|
3668
|
-
const
|
|
3668
|
+
const g = {
|
|
3669
3669
|
className: "subst",
|
|
3670
3670
|
begin: /\$\(/,
|
|
3671
3671
|
end: /\)/,
|
|
@@ -3686,10 +3686,10 @@ function ir(e) {
|
|
|
3686
3686
|
contains: [
|
|
3687
3687
|
e.BACKSLASH_ESCAPE,
|
|
3688
3688
|
a,
|
|
3689
|
-
|
|
3689
|
+
g
|
|
3690
3690
|
]
|
|
3691
3691
|
};
|
|
3692
|
-
|
|
3692
|
+
g.contains.push(r);
|
|
3693
3693
|
const i = {
|
|
3694
3694
|
match: /\\"/
|
|
3695
3695
|
}, s = {
|
|
@@ -3722,7 +3722,7 @@ function ir(e) {
|
|
|
3722
3722
|
], f = e.SHEBANG({
|
|
3723
3723
|
binary: `(${c.join("|")})`,
|
|
3724
3724
|
relevance: 10
|
|
3725
|
-
}),
|
|
3725
|
+
}), h = {
|
|
3726
3726
|
className: "function",
|
|
3727
3727
|
begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
|
|
3728
3728
|
returnBegin: !0,
|
|
@@ -3747,7 +3747,7 @@ function ir(e) {
|
|
|
3747
3747
|
], p = [
|
|
3748
3748
|
"true",
|
|
3749
3749
|
"false"
|
|
3750
|
-
], _ = { match: /(\/[a-z._-]+)+/ },
|
|
3750
|
+
], _ = { match: /(\/[a-z._-]+)+/ }, v = [
|
|
3751
3751
|
"break",
|
|
3752
3752
|
"cd",
|
|
3753
3753
|
"continue",
|
|
@@ -3766,7 +3766,7 @@ function ir(e) {
|
|
|
3766
3766
|
"trap",
|
|
3767
3767
|
"umask",
|
|
3768
3768
|
"unset"
|
|
3769
|
-
],
|
|
3769
|
+
], E = [
|
|
3770
3770
|
"alias",
|
|
3771
3771
|
"bind",
|
|
3772
3772
|
"builtin",
|
|
@@ -3788,7 +3788,7 @@ function ir(e) {
|
|
|
3788
3788
|
"typeset",
|
|
3789
3789
|
"ulimit",
|
|
3790
3790
|
"unalias"
|
|
3791
|
-
],
|
|
3791
|
+
], m = [
|
|
3792
3792
|
"autoload",
|
|
3793
3793
|
"bg",
|
|
3794
3794
|
"bindkey",
|
|
@@ -3857,7 +3857,7 @@ function ir(e) {
|
|
|
3857
3857
|
"zsocket",
|
|
3858
3858
|
"zstyle",
|
|
3859
3859
|
"ztcp"
|
|
3860
|
-
],
|
|
3860
|
+
], N = [
|
|
3861
3861
|
"chcon",
|
|
3862
3862
|
"chgrp",
|
|
3863
3863
|
"chown",
|
|
@@ -3970,13 +3970,13 @@ function ir(e) {
|
|
|
3970
3970
|
keyword: d,
|
|
3971
3971
|
literal: p,
|
|
3972
3972
|
built_in: [
|
|
3973
|
+
...v,
|
|
3973
3974
|
...E,
|
|
3974
|
-
...b,
|
|
3975
3975
|
// Shell modifiers
|
|
3976
3976
|
"set",
|
|
3977
3977
|
"shopt",
|
|
3978
|
-
...
|
|
3979
|
-
...
|
|
3978
|
+
...m,
|
|
3979
|
+
...N
|
|
3980
3980
|
]
|
|
3981
3981
|
},
|
|
3982
3982
|
contains: [
|
|
@@ -3984,7 +3984,7 @@ function ir(e) {
|
|
|
3984
3984
|
// to catch known shells and boost relevancy
|
|
3985
3985
|
e.SHEBANG(),
|
|
3986
3986
|
// to catch unknown shells but still highlight the shebang
|
|
3987
|
-
|
|
3987
|
+
h,
|
|
3988
3988
|
l,
|
|
3989
3989
|
e.HASH_COMMENT_MODE,
|
|
3990
3990
|
t,
|
|
@@ -4007,7 +4007,7 @@ function sr(e) {
|
|
|
4007
4007
|
contains: [{ begin: /''/ }]
|
|
4008
4008
|
}
|
|
4009
4009
|
]
|
|
4010
|
-
},
|
|
4010
|
+
}, g = {
|
|
4011
4011
|
begin: /"/,
|
|
4012
4012
|
end: /"/,
|
|
4013
4013
|
contains: [{ begin: /""/ }]
|
|
@@ -4546,27 +4546,27 @@ function sr(e) {
|
|
|
4546
4546
|
"nulls last",
|
|
4547
4547
|
"depth first",
|
|
4548
4548
|
"breadth first"
|
|
4549
|
-
],
|
|
4549
|
+
], h = l, d = [
|
|
4550
4550
|
...o,
|
|
4551
4551
|
...s
|
|
4552
|
-
].filter((
|
|
4552
|
+
].filter((m) => !l.includes(m)), p = {
|
|
4553
4553
|
className: "variable",
|
|
4554
4554
|
begin: /@[a-z0-9][a-z0-9_]*/
|
|
4555
4555
|
}, _ = {
|
|
4556
4556
|
className: "operator",
|
|
4557
4557
|
begin: /[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,
|
|
4558
4558
|
relevance: 0
|
|
4559
|
-
},
|
|
4560
|
-
begin: n.concat(/\b/, n.either(...
|
|
4559
|
+
}, v = {
|
|
4560
|
+
begin: n.concat(/\b/, n.either(...h), /\s*\(/),
|
|
4561
4561
|
relevance: 0,
|
|
4562
|
-
keywords: { built_in:
|
|
4562
|
+
keywords: { built_in: h }
|
|
4563
4563
|
};
|
|
4564
|
-
function
|
|
4565
|
-
exceptions:
|
|
4566
|
-
when:
|
|
4564
|
+
function E(m, {
|
|
4565
|
+
exceptions: N,
|
|
4566
|
+
when: D
|
|
4567
4567
|
} = {}) {
|
|
4568
|
-
const
|
|
4569
|
-
return
|
|
4568
|
+
const S = D;
|
|
4569
|
+
return N = N || [], m.map((A) => A.match(/\|\d+$/) || N.includes(A) ? A : S(A) ? `${A}|0` : A);
|
|
4570
4570
|
}
|
|
4571
4571
|
return {
|
|
4572
4572
|
name: "SQL",
|
|
@@ -4575,7 +4575,7 @@ function sr(e) {
|
|
|
4575
4575
|
illegal: /[{}]|<\//,
|
|
4576
4576
|
keywords: {
|
|
4577
4577
|
$pattern: /\b[\w\.]+/,
|
|
4578
|
-
keyword:
|
|
4578
|
+
keyword: E(d, { when: (m) => m.length < 3 }),
|
|
4579
4579
|
literal: t,
|
|
4580
4580
|
type: i,
|
|
4581
4581
|
built_in: c
|
|
@@ -4595,10 +4595,10 @@ function sr(e) {
|
|
|
4595
4595
|
className: "type",
|
|
4596
4596
|
begin: n.either(...r)
|
|
4597
4597
|
},
|
|
4598
|
-
|
|
4598
|
+
v,
|
|
4599
4599
|
p,
|
|
4600
4600
|
u,
|
|
4601
|
-
|
|
4601
|
+
g,
|
|
4602
4602
|
e.C_NUMBER_MODE,
|
|
4603
4603
|
e.C_BLOCK_COMMENT_MODE,
|
|
4604
4604
|
a,
|
|
@@ -4606,7 +4606,7 @@ function sr(e) {
|
|
|
4606
4606
|
]
|
|
4607
4607
|
};
|
|
4608
4608
|
}
|
|
4609
|
-
Z.registerLanguage("xml",
|
|
4609
|
+
Z.registerLanguage("xml", Qt);
|
|
4610
4610
|
Z.registerLanguage("javascript", Xt);
|
|
4611
4611
|
Z.registerLanguage("json", Jt);
|
|
4612
4612
|
Z.registerLanguage("yaml", er);
|
|
@@ -4615,18 +4615,18 @@ Z.registerLanguage("python", tr);
|
|
|
4615
4615
|
Z.registerLanguage("java", rr);
|
|
4616
4616
|
Z.registerLanguage("bash", ir);
|
|
4617
4617
|
Z.registerLanguage("sql", sr);
|
|
4618
|
-
var
|
|
4618
|
+
var T = /* @__PURE__ */ ((e) => (e.EQUAL = "equal", e.DELETE = "removed", e.ADD = "added", e.EMPTY = "empty", e))(T || {});
|
|
4619
4619
|
const J = "<code-diff-modified>", ee = "</code-diff-modified>", ar = J.replace("<", "<").replace(">", ">"), or = ee.replace("<", "<").replace(">", ">");
|
|
4620
4620
|
function fe(e) {
|
|
4621
|
-
return e === void 0 ?
|
|
4621
|
+
return e === void 0 ? T.EQUAL : e.added ? T.ADD : e.removed ? T.DELETE : T.EQUAL;
|
|
4622
4622
|
}
|
|
4623
4623
|
function De(e, n, a = "word") {
|
|
4624
|
-
return typeof e == "undefined" ? n : typeof n == "undefined" ? e : (a === "char" ?
|
|
4625
|
-
(
|
|
4624
|
+
return typeof e == "undefined" ? n : typeof n == "undefined" ? e : (a === "char" ? Qn : Yn)(e, n).filter((g) => fe(g) !== T.DELETE).map(
|
|
4625
|
+
(g) => fe(g) === T.ADD ? `${J}${g.value}${ee}` : g.value
|
|
4626
4626
|
).join("");
|
|
4627
4627
|
}
|
|
4628
4628
|
function Ln(e, n) {
|
|
4629
|
-
const a = new Ie.diff_match_patch(), u = a.diff_linesToChars_(e, n),
|
|
4629
|
+
const a = new Ie.diff_match_patch(), u = a.diff_linesToChars_(e, n), g = u.chars1, t = u.chars2, r = u.lineArray, i = a.diff_main(g, t, !1);
|
|
4630
4630
|
return a.diff_charsToLines_(i, r), i.map((s) => {
|
|
4631
4631
|
const [o, l] = s;
|
|
4632
4632
|
return {
|
|
@@ -4638,12 +4638,12 @@ function Ln(e, n) {
|
|
|
4638
4638
|
};
|
|
4639
4639
|
});
|
|
4640
4640
|
}
|
|
4641
|
-
function
|
|
4641
|
+
function Q(e, n) {
|
|
4642
4642
|
if (!n.match(new RegExp(`(${J}|${ee})`, "g")))
|
|
4643
4643
|
return Z.highlight(n, { language: e }).value;
|
|
4644
4644
|
let u = n;
|
|
4645
|
-
const
|
|
4646
|
-
t.innerHTML = Z.highlight(
|
|
4645
|
+
const g = n.replace(new RegExp(`(${J}|${ee})`, "g"), ""), t = document.createElement("div");
|
|
4646
|
+
t.innerHTML = Z.highlight(g, { language: e }).value;
|
|
4647
4647
|
let r = !1;
|
|
4648
4648
|
const i = (s) => {
|
|
4649
4649
|
s.childNodes.forEach((o) => {
|
|
@@ -4660,7 +4660,7 @@ function q(e, n) {
|
|
|
4660
4660
|
u = u.slice(ee.length), c = c + ee, r = !1;
|
|
4661
4661
|
continue;
|
|
4662
4662
|
}
|
|
4663
|
-
const f = u.match(new RegExp(`(${J}|${ee})`)),
|
|
4663
|
+
const f = u.match(new RegExp(`(${J}|${ee})`)), h = f && f.index ? f.index : u.length, d = Math.min(h, l.length);
|
|
4664
4664
|
c = c + u.substring(0, d), u = u.slice(d), l = l.slice(d);
|
|
4665
4665
|
}
|
|
4666
4666
|
r && (c = c + ee), o.textContent = c;
|
|
@@ -4671,12 +4671,12 @@ function q(e, n) {
|
|
|
4671
4671
|
}
|
|
4672
4672
|
function On(e, n) {
|
|
4673
4673
|
const a = (s, o) => (s.match(new RegExp(o, "g")) || []).length, u = (s) => s.filter((o) => n == null ? void 0 : n.test(o)).length;
|
|
4674
|
-
let
|
|
4674
|
+
let g = 0, t = 0, r = 0, i = 0;
|
|
4675
4675
|
for (const s of e) {
|
|
4676
4676
|
if (s.added) {
|
|
4677
4677
|
const o = u(s.value.trim().split(`
|
|
4678
4678
|
`));
|
|
4679
|
-
|
|
4679
|
+
g += a(s.value.trim(), `
|
|
4680
4680
|
`) + 1 - o, r += o;
|
|
4681
4681
|
continue;
|
|
4682
4682
|
}
|
|
@@ -4689,205 +4689,205 @@ function On(e, n) {
|
|
|
4689
4689
|
}
|
|
4690
4690
|
}
|
|
4691
4691
|
return {
|
|
4692
|
-
additionsNum:
|
|
4692
|
+
additionsNum: g,
|
|
4693
4693
|
deletionsNum: t,
|
|
4694
4694
|
ignoreAdditionsNum: r,
|
|
4695
4695
|
ignoreDeletionsNum: i
|
|
4696
4696
|
};
|
|
4697
4697
|
}
|
|
4698
|
-
function lr(e, n, a = "plaintext", u = "word",
|
|
4699
|
-
const
|
|
4700
|
-
let
|
|
4701
|
-
const
|
|
4702
|
-
changes:
|
|
4698
|
+
function lr(e, n, a = "plaintext", u = "word", g = !1, t = 10, r) {
|
|
4699
|
+
const i = () => ({ type: T.EMPTY }), s = (E, m, N) => ({ type: E, num: m, code: N }), o = Ln(e, n), l = r ? new RegExp(r) : void 0;
|
|
4700
|
+
let c = 0, f = 0, h = !1;
|
|
4701
|
+
const d = [], p = {
|
|
4702
|
+
changes: d,
|
|
4703
4703
|
collector: [],
|
|
4704
|
-
stat: On(
|
|
4704
|
+
stat: On(o, l)
|
|
4705
4705
|
};
|
|
4706
|
-
for (let E = 0; E <
|
|
4707
|
-
if (
|
|
4708
|
-
|
|
4706
|
+
for (let E = 0; E < o.length; E++) {
|
|
4707
|
+
if (h) {
|
|
4708
|
+
h = !1;
|
|
4709
4709
|
continue;
|
|
4710
4710
|
}
|
|
4711
|
-
const [
|
|
4711
|
+
const [m, N] = [o[E], o[E + 1]], [D, S] = [fe(m), fe(N)], A = m.value.replace(/\n$/, "").split(`
|
|
4712
4712
|
`);
|
|
4713
|
-
if (
|
|
4714
|
-
for (const C of
|
|
4715
|
-
let
|
|
4716
|
-
const
|
|
4717
|
-
|
|
4713
|
+
if (N === void 0) {
|
|
4714
|
+
for (const C of A) {
|
|
4715
|
+
let I = i(), $ = i();
|
|
4716
|
+
const B = Q(a, C);
|
|
4717
|
+
D === T.EQUAL && (c++, f++, I = s(T.EQUAL, c, B), $ = s(T.EQUAL, f, B)), D === T.DELETE && (c++, I = s(T.DELETE, c, B), $ = i()), D === T.ADD && (f++, I = i(), $ = s(T.ADD, f, B)), d.push({ left: I, right: $ });
|
|
4718
4718
|
}
|
|
4719
4719
|
break;
|
|
4720
4720
|
}
|
|
4721
|
-
if (
|
|
4722
|
-
for (const C of
|
|
4723
|
-
|
|
4724
|
-
const
|
|
4725
|
-
|
|
4726
|
-
left:
|
|
4727
|
-
right:
|
|
4721
|
+
if (D === T.EQUAL)
|
|
4722
|
+
for (const C of A) {
|
|
4723
|
+
c++, f++;
|
|
4724
|
+
const I = Q(a, C);
|
|
4725
|
+
d.push({
|
|
4726
|
+
left: s(T.EQUAL, c, I),
|
|
4727
|
+
right: s(T.EQUAL, f, I)
|
|
4728
4728
|
});
|
|
4729
4729
|
}
|
|
4730
|
-
const
|
|
4730
|
+
const R = N.value.replace(/\n$/, "").split(`
|
|
4731
4731
|
`);
|
|
4732
|
-
if (
|
|
4733
|
-
if (
|
|
4734
|
-
for (const C of
|
|
4735
|
-
|
|
4736
|
-
left:
|
|
4737
|
-
right:
|
|
4732
|
+
if (D === T.DELETE) {
|
|
4733
|
+
if (S === T.EQUAL)
|
|
4734
|
+
for (const C of A)
|
|
4735
|
+
c++, d.push({
|
|
4736
|
+
left: s(T.DELETE, c, Q(a, C)),
|
|
4737
|
+
right: i()
|
|
4738
4738
|
});
|
|
4739
|
-
if (
|
|
4740
|
-
|
|
4741
|
-
const C = Math.max(
|
|
4742
|
-
for (let
|
|
4743
|
-
|
|
4744
|
-
const [$,
|
|
4745
|
-
|
|
4739
|
+
if (S === T.ADD) {
|
|
4740
|
+
h = !0;
|
|
4741
|
+
const C = Math.max(m.count, N.count);
|
|
4742
|
+
for (let I = 0; I < C; I++) {
|
|
4743
|
+
I < m.count && c++, I < N.count && f++;
|
|
4744
|
+
const [$, B] = [A[I], R[I]], F = g || A.length === R.length, K = F ? De(B, $, u) : $, te = F ? De($, B, u) : B, oe = l != null && l.test($) ? T.EQUAL : T.DELETE, b = l != null && l.test(B) ? T.EQUAL : T.ADD, w = I < m.count ? s(oe, c, Q(a, K)) : i(), L = I < N.count ? s(b, f, Q(a, te)) : i();
|
|
4745
|
+
d.push({ left: w, right: L });
|
|
4746
4746
|
}
|
|
4747
4747
|
}
|
|
4748
4748
|
}
|
|
4749
|
-
if (
|
|
4750
|
-
for (const C of
|
|
4751
|
-
|
|
4752
|
-
left:
|
|
4753
|
-
right:
|
|
4749
|
+
if (D === T.ADD)
|
|
4750
|
+
for (const C of A)
|
|
4751
|
+
f++, d.push({
|
|
4752
|
+
left: i(),
|
|
4753
|
+
right: s(T.ADD, f, Q(a, C))
|
|
4754
4754
|
});
|
|
4755
4755
|
}
|
|
4756
4756
|
if (e === n) {
|
|
4757
|
-
for (let E = 0; E <
|
|
4758
|
-
|
|
4759
|
-
return
|
|
4757
|
+
for (let E = 0; E < d.length; E++)
|
|
4758
|
+
d[E].fold = !1;
|
|
4759
|
+
return p;
|
|
4760
4760
|
}
|
|
4761
|
-
for (let E = 0; E <
|
|
4762
|
-
const
|
|
4763
|
-
if (
|
|
4764
|
-
const [
|
|
4765
|
-
for (let
|
|
4766
|
-
|
|
4761
|
+
for (let E = 0; E < d.length; E++) {
|
|
4762
|
+
const m = d[E];
|
|
4763
|
+
if (m.left.type === T.DELETE || m.right.type === T.ADD) {
|
|
4764
|
+
const [N, D] = [Math.max(E - t, 0), Math.min(E + t + 1, d.length)];
|
|
4765
|
+
for (let S = N; S < D; S++)
|
|
4766
|
+
d[S].fold = !1;
|
|
4767
4767
|
}
|
|
4768
|
-
|
|
4768
|
+
m.fold === void 0 && (m.fold = !0);
|
|
4769
4769
|
}
|
|
4770
|
-
const
|
|
4771
|
-
let
|
|
4772
|
-
for (let E = 0; E <
|
|
4773
|
-
const
|
|
4774
|
-
if (
|
|
4775
|
-
|
|
4776
|
-
lines:
|
|
4770
|
+
const _ = [];
|
|
4771
|
+
let v = [];
|
|
4772
|
+
for (let E = 0; E < d.length; E++) {
|
|
4773
|
+
const m = d[E];
|
|
4774
|
+
if (m.fold === !1) {
|
|
4775
|
+
v.length && (v[0].hideIndex = p.collector.length, p.collector.push({
|
|
4776
|
+
lines: v,
|
|
4777
4777
|
fold: !0
|
|
4778
|
-
}),
|
|
4778
|
+
}), v = []), _.push(m);
|
|
4779
4779
|
continue;
|
|
4780
4780
|
}
|
|
4781
|
-
|
|
4781
|
+
m.hide = !0, v.push(m), _.push(m);
|
|
4782
4782
|
}
|
|
4783
|
-
return
|
|
4784
|
-
lines:
|
|
4783
|
+
return v.length && (v[0].hideIndex = p.collector.length, p.collector.push({
|
|
4784
|
+
lines: v,
|
|
4785
4785
|
fold: !0
|
|
4786
|
-
}),
|
|
4786
|
+
}), v = []), p.changes = _, p;
|
|
4787
4787
|
}
|
|
4788
|
-
function cr(e, n, a = "plaintext", u = "word",
|
|
4789
|
-
const
|
|
4790
|
-
let
|
|
4791
|
-
const
|
|
4792
|
-
changes:
|
|
4788
|
+
function cr(e, n, a = "plaintext", u = "word", g = !1, t = 10, r) {
|
|
4789
|
+
const i = Ln(e, n), s = r ? new RegExp(r) : void 0;
|
|
4790
|
+
let o = 0, l = 0, c = !1;
|
|
4791
|
+
const f = [], h = {
|
|
4792
|
+
changes: f,
|
|
4793
4793
|
collector: [],
|
|
4794
|
-
stat: On(
|
|
4794
|
+
stat: On(i, s)
|
|
4795
4795
|
};
|
|
4796
|
-
for (let
|
|
4797
|
-
if (
|
|
4798
|
-
|
|
4796
|
+
for (let _ = 0; _ < i.length; _++) {
|
|
4797
|
+
if (c) {
|
|
4798
|
+
c = !1;
|
|
4799
4799
|
continue;
|
|
4800
4800
|
}
|
|
4801
|
-
const [
|
|
4801
|
+
const [v, E] = [i[_], i[_ + 1]], [m, N] = [fe(v), fe(E)], D = v.value.replace(/\n$/, "").split(`
|
|
4802
4802
|
`);
|
|
4803
4803
|
if (E === void 0) {
|
|
4804
|
-
for (const
|
|
4805
|
-
|
|
4806
|
-
const
|
|
4807
|
-
|
|
4808
|
-
type:
|
|
4809
|
-
code:
|
|
4810
|
-
addNum:
|
|
4811
|
-
delNum:
|
|
4804
|
+
for (const A of D) {
|
|
4805
|
+
m === T.EQUAL && (o++, l++), m === T.DELETE && o++, m === T.ADD && l++;
|
|
4806
|
+
const R = Q(a, A);
|
|
4807
|
+
f.push({
|
|
4808
|
+
type: m,
|
|
4809
|
+
code: R,
|
|
4810
|
+
addNum: m === T.DELETE ? void 0 : l,
|
|
4811
|
+
delNum: m === T.ADD ? void 0 : o
|
|
4812
4812
|
});
|
|
4813
4813
|
}
|
|
4814
4814
|
break;
|
|
4815
4815
|
}
|
|
4816
|
-
if (
|
|
4817
|
-
for (const
|
|
4818
|
-
|
|
4819
|
-
const
|
|
4820
|
-
|
|
4816
|
+
if (m === T.EQUAL)
|
|
4817
|
+
for (const A of D) {
|
|
4818
|
+
o++, l++;
|
|
4819
|
+
const R = Q(a, A);
|
|
4820
|
+
f.push({ type: T.EQUAL, code: R, delNum: o, addNum: l });
|
|
4821
4821
|
}
|
|
4822
|
-
const
|
|
4822
|
+
const S = E.value.replace(/\n$/, "").split(`
|
|
4823
4823
|
`);
|
|
4824
|
-
if (
|
|
4825
|
-
if (
|
|
4826
|
-
for (let
|
|
4827
|
-
const
|
|
4828
|
-
|
|
4829
|
-
const
|
|
4830
|
-
|
|
4831
|
-
type:
|
|
4832
|
-
code:
|
|
4833
|
-
delNum:
|
|
4824
|
+
if (m === T.DELETE)
|
|
4825
|
+
if (N === T.ADD && (D.length === S.length || g)) {
|
|
4826
|
+
for (let A = 0; A < D.length; A++) {
|
|
4827
|
+
const R = D[A], C = S[A];
|
|
4828
|
+
o++;
|
|
4829
|
+
const I = Q(a, De(C, R, u));
|
|
4830
|
+
f.push({
|
|
4831
|
+
type: s != null && s.test(R) ? T.EQUAL : T.DELETE,
|
|
4832
|
+
code: I,
|
|
4833
|
+
delNum: o
|
|
4834
4834
|
});
|
|
4835
4835
|
}
|
|
4836
|
-
for (let
|
|
4837
|
-
const
|
|
4838
|
-
|
|
4839
|
-
const
|
|
4840
|
-
|
|
4841
|
-
type:
|
|
4842
|
-
code:
|
|
4843
|
-
addNum:
|
|
4836
|
+
for (let A = 0; A < S.length; A++) {
|
|
4837
|
+
const R = D[A], C = S[A];
|
|
4838
|
+
l++;
|
|
4839
|
+
const I = Q(a, De(R, C, u));
|
|
4840
|
+
f.push({
|
|
4841
|
+
type: s != null && s.test(C) ? T.EQUAL : T.ADD,
|
|
4842
|
+
code: I,
|
|
4843
|
+
addNum: l
|
|
4844
4844
|
});
|
|
4845
4845
|
}
|
|
4846
|
-
|
|
4846
|
+
c = !0;
|
|
4847
4847
|
} else
|
|
4848
|
-
for (const
|
|
4849
|
-
|
|
4850
|
-
const
|
|
4851
|
-
|
|
4848
|
+
for (const A of D) {
|
|
4849
|
+
o++;
|
|
4850
|
+
const R = Q(a, A);
|
|
4851
|
+
f.push({ type: T.DELETE, code: R, delNum: o });
|
|
4852
4852
|
}
|
|
4853
|
-
if (
|
|
4854
|
-
for (const
|
|
4855
|
-
|
|
4856
|
-
const
|
|
4857
|
-
|
|
4853
|
+
if (m === T.ADD)
|
|
4854
|
+
for (const A of D) {
|
|
4855
|
+
l++;
|
|
4856
|
+
const R = Q(a, A);
|
|
4857
|
+
f.push({ type: T.ADD, code: R, addNum: l });
|
|
4858
4858
|
}
|
|
4859
4859
|
}
|
|
4860
|
-
for (let
|
|
4861
|
-
const
|
|
4862
|
-
if (
|
|
4863
|
-
const [E,
|
|
4864
|
-
for (let
|
|
4865
|
-
|
|
4860
|
+
for (let _ = 0; _ < f.length; _++) {
|
|
4861
|
+
const v = f[_];
|
|
4862
|
+
if (v.type === T.DELETE || v.type === T.ADD) {
|
|
4863
|
+
const [E, m] = [Math.max(_ - t, 0), Math.min(_ + t + 1, f.length)];
|
|
4864
|
+
for (let N = E; N < m; N++)
|
|
4865
|
+
f[N].fold = !1;
|
|
4866
4866
|
}
|
|
4867
|
-
|
|
4867
|
+
v.fold === void 0 && (v.fold = !0);
|
|
4868
4868
|
}
|
|
4869
4869
|
if (e === n) {
|
|
4870
|
-
for (let
|
|
4871
|
-
|
|
4872
|
-
return
|
|
4870
|
+
for (let _ = 0; _ < f.length; _++)
|
|
4871
|
+
f[_].fold = !1;
|
|
4872
|
+
return h;
|
|
4873
4873
|
}
|
|
4874
|
-
const
|
|
4875
|
-
let
|
|
4876
|
-
for (let
|
|
4877
|
-
const
|
|
4878
|
-
if (
|
|
4879
|
-
|
|
4880
|
-
lines:
|
|
4874
|
+
const d = [];
|
|
4875
|
+
let p = [];
|
|
4876
|
+
for (let _ = 0; _ < f.length; _++) {
|
|
4877
|
+
const v = f[_];
|
|
4878
|
+
if (v.fold === !1) {
|
|
4879
|
+
p.length && (p[0].hideIndex = h.collector.length, h.collector.push({
|
|
4880
|
+
lines: p,
|
|
4881
4881
|
fold: !0
|
|
4882
|
-
}),
|
|
4882
|
+
}), p = []), d.push(v);
|
|
4883
4883
|
continue;
|
|
4884
4884
|
}
|
|
4885
|
-
|
|
4885
|
+
v.type === "equal" && (v.hide = !0, p.push(v)), d.push(v);
|
|
4886
4886
|
}
|
|
4887
|
-
return
|
|
4888
|
-
lines:
|
|
4887
|
+
return p.length && (p[0].hideIndex = h.collector.length, h.collector.push({
|
|
4888
|
+
lines: p,
|
|
4889
4889
|
fold: !0
|
|
4890
|
-
}),
|
|
4890
|
+
}), p = []), h.changes = d, h;
|
|
4891
4891
|
}
|
|
4892
4892
|
const Ge = {};
|
|
4893
4893
|
Ge.props = {
|
|
@@ -4899,11 +4899,11 @@ Ge.props = {
|
|
|
4899
4899
|
};
|
|
4900
4900
|
Ge.setup = (e, n) => {
|
|
4901
4901
|
const a = n.emit;
|
|
4902
|
-
function u(
|
|
4903
|
-
return
|
|
4902
|
+
function u(g) {
|
|
4903
|
+
return g === T.DELETE ? "-" : g === T.ADD ? "+" : "";
|
|
4904
4904
|
}
|
|
4905
4905
|
return {
|
|
4906
|
-
DiffType:
|
|
4906
|
+
DiffType: T,
|
|
4907
4907
|
emit: a,
|
|
4908
4908
|
getCodeMarker: u
|
|
4909
4909
|
};
|
|
@@ -4959,25 +4959,25 @@ var ur = function() {
|
|
|
4959
4959
|
}
|
|
4960
4960
|
})])]);
|
|
4961
4961
|
}, fr = [];
|
|
4962
|
-
function Ee(e, n, a, u,
|
|
4962
|
+
function Ee(e, n, a, u, g, t, r, i) {
|
|
4963
4963
|
var s = typeof e == "function" ? e.options : e;
|
|
4964
4964
|
n && (s.render = n, s.staticRenderFns = a, s._compiled = !0), u && (s.functional = !0), t && (s._scopeId = "data-v-" + t);
|
|
4965
4965
|
var o;
|
|
4966
4966
|
if (r ? (o = function(f) {
|
|
4967
4967
|
f = f || // cached call
|
|
4968
4968
|
this.$vnode && this.$vnode.ssrContext || // stateful
|
|
4969
|
-
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !f && typeof __VUE_SSR_CONTEXT__ != "undefined" && (f = __VUE_SSR_CONTEXT__),
|
|
4970
|
-
}, s._ssrRegister = o) :
|
|
4971
|
-
|
|
4969
|
+
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext, !f && typeof __VUE_SSR_CONTEXT__ != "undefined" && (f = __VUE_SSR_CONTEXT__), g && g.call(this, f), f && f._registeredComponents && f._registeredComponents.add(r);
|
|
4970
|
+
}, s._ssrRegister = o) : g && (o = i ? function() {
|
|
4971
|
+
g.call(
|
|
4972
4972
|
this,
|
|
4973
4973
|
(s.functional ? this.parent : this).$root.$options.shadowRoot
|
|
4974
4974
|
);
|
|
4975
|
-
} :
|
|
4975
|
+
} : g), o)
|
|
4976
4976
|
if (s.functional) {
|
|
4977
4977
|
s._injectStyles = o;
|
|
4978
4978
|
var l = s.render;
|
|
4979
|
-
s.render = function(
|
|
4980
|
-
return o.call(d), l(
|
|
4979
|
+
s.render = function(h, d) {
|
|
4980
|
+
return o.call(d), l(h, d);
|
|
4981
4981
|
};
|
|
4982
4982
|
} else {
|
|
4983
4983
|
var c = s.beforeCreate;
|
|
@@ -5016,9 +5016,9 @@ _e.props = {
|
|
|
5016
5016
|
_e.setup = (e, n) => {
|
|
5017
5017
|
const a = e;
|
|
5018
5018
|
function u({
|
|
5019
|
-
hideIndex:
|
|
5019
|
+
hideIndex: g
|
|
5020
5020
|
}) {
|
|
5021
|
-
|
|
5021
|
+
g !== void 0 && a.diffChange.collector[g].lines.forEach((t) => {
|
|
5022
5022
|
t.hide = !1, t.fold = !1;
|
|
5023
5023
|
});
|
|
5024
5024
|
}
|
|
@@ -5033,11 +5033,11 @@ var pr = function() {
|
|
|
5033
5033
|
var e, n = this, a = n.$createElement, u = n._self._c || a;
|
|
5034
5034
|
return u("table", {
|
|
5035
5035
|
staticClass: "diff-table"
|
|
5036
|
-
}, [u("tbody", n._l((e = n.diffChange) === null || e === void 0 ? void 0 : e.changes, function(
|
|
5036
|
+
}, [u("tbody", n._l((e = n.diffChange) === null || e === void 0 ? void 0 : e.changes, function(g, t) {
|
|
5037
5037
|
return u("UnifiedLine", {
|
|
5038
5038
|
key: t,
|
|
5039
5039
|
attrs: {
|
|
5040
|
-
line:
|
|
5040
|
+
line: g
|
|
5041
5041
|
},
|
|
5042
5042
|
on: {
|
|
5043
5043
|
expand: n.expandHandler
|
|
@@ -5073,9 +5073,9 @@ Ke.props = {
|
|
|
5073
5073
|
Ke.setup = (e, n) => {
|
|
5074
5074
|
const a = n.emit;
|
|
5075
5075
|
function u(t) {
|
|
5076
|
-
return t ===
|
|
5076
|
+
return t === T.DELETE ? "-" : t === T.ADD ? "+" : "";
|
|
5077
5077
|
}
|
|
5078
|
-
function
|
|
5078
|
+
function g(t) {
|
|
5079
5079
|
window.getSelection().removeAllRanges();
|
|
5080
5080
|
const r = document.querySelectorAll(".file-diff-split .split-side-left"), i = document.querySelectorAll(".file-diff-split .split-side-right");
|
|
5081
5081
|
for (const s of i)
|
|
@@ -5084,10 +5084,10 @@ Ke.setup = (e, n) => {
|
|
|
5084
5084
|
s.classList.toggle("no-select", t === "right");
|
|
5085
5085
|
}
|
|
5086
5086
|
return {
|
|
5087
|
-
DiffType:
|
|
5087
|
+
DiffType: T,
|
|
5088
5088
|
emit: a,
|
|
5089
5089
|
getCodeMarker: u,
|
|
5090
|
-
onSplitLineMousedown:
|
|
5090
|
+
onSplitLineMousedown: g
|
|
5091
5091
|
};
|
|
5092
5092
|
};
|
|
5093
5093
|
var mr = function() {
|
|
@@ -5108,7 +5108,7 @@ var mr = function() {
|
|
|
5108
5108
|
colspan: "3",
|
|
5109
5109
|
align: "left"
|
|
5110
5110
|
}
|
|
5111
|
-
}, [e._v(" ⋯ ")])]) : e.splitLine.hide ? e._e() : a("tr", [e._l([e.splitLine.left, e.splitLine.right], function(u,
|
|
5111
|
+
}, [e._v(" ⋯ ")])]) : e.splitLine.hide ? e._e() : a("tr", [e._l([e.splitLine.left, e.splitLine.right], function(u, g) {
|
|
5112
5112
|
return [u.type === e.DiffType.EMPTY ? [a("td", {
|
|
5113
5113
|
staticClass: "blob-num blob-num-empty empty-cell"
|
|
5114
5114
|
}), a("td", {
|
|
@@ -5128,12 +5128,12 @@ var mr = function() {
|
|
|
5128
5128
|
"blob-code-addition": u.type === e.DiffType.ADD,
|
|
5129
5129
|
"blob-code-context": u.type === e.DiffType.EQUAL,
|
|
5130
5130
|
"blob-code-hunk": e.splitLine.hide !== void 0,
|
|
5131
|
-
"split-side-left":
|
|
5132
|
-
"split-side-right":
|
|
5131
|
+
"split-side-left": g === 0,
|
|
5132
|
+
"split-side-right": g === 1
|
|
5133
5133
|
},
|
|
5134
5134
|
on: {
|
|
5135
5135
|
mousedown: function(t) {
|
|
5136
|
-
return e.onSplitLineMousedown(
|
|
5136
|
+
return e.onSplitLineMousedown(g === 0 ? "left" : "right");
|
|
5137
5137
|
}
|
|
5138
5138
|
}
|
|
5139
5139
|
}, [a("span", {
|
|
@@ -5175,9 +5175,9 @@ be.props = {
|
|
|
5175
5175
|
be.setup = (e, n) => {
|
|
5176
5176
|
const a = e;
|
|
5177
5177
|
function u({
|
|
5178
|
-
hideIndex:
|
|
5178
|
+
hideIndex: g
|
|
5179
5179
|
}) {
|
|
5180
|
-
|
|
5180
|
+
g !== void 0 && a.diffChange.collector[g].lines.forEach((t) => {
|
|
5181
5181
|
t.hide = !1, t.fold = !1;
|
|
5182
5182
|
});
|
|
5183
5183
|
}
|
|
@@ -5192,11 +5192,11 @@ var Mr = function() {
|
|
|
5192
5192
|
var e, n = this, a = n.$createElement, u = n._self._c || a;
|
|
5193
5193
|
return u("table", {
|
|
5194
5194
|
staticClass: "file-diff-split diff-table"
|
|
5195
|
-
}, [n._m(0), u("tbody", n._l((e = n.diffChange) === null || e === void 0 ? void 0 : e.changes, function(
|
|
5195
|
+
}, [n._m(0), u("tbody", n._l((e = n.diffChange) === null || e === void 0 ? void 0 : e.changes, function(g, t) {
|
|
5196
5196
|
return u("SplitLine", {
|
|
5197
5197
|
key: t,
|
|
5198
5198
|
attrs: {
|
|
5199
|
-
"split-line":
|
|
5199
|
+
"split-line": g
|
|
5200
5200
|
},
|
|
5201
5201
|
on: {
|
|
5202
5202
|
expand: n.expandHandler
|
|
@@ -5230,7 +5230,7 @@ function Dr(e) {
|
|
|
5230
5230
|
for (let n in fn)
|
|
5231
5231
|
this[n] = fn[n];
|
|
5232
5232
|
}
|
|
5233
|
-
const
|
|
5233
|
+
const Cr = /* @__PURE__ */ function() {
|
|
5234
5234
|
return Sr.exports;
|
|
5235
5235
|
}();
|
|
5236
5236
|
const ve = {};
|
|
@@ -5263,6 +5263,12 @@ ve.props = {
|
|
|
5263
5263
|
type: String,
|
|
5264
5264
|
default: "word"
|
|
5265
5265
|
},
|
|
5266
|
+
forceInlineComparison: {
|
|
5267
|
+
key: "forceInlineComparison",
|
|
5268
|
+
required: !1,
|
|
5269
|
+
type: Boolean,
|
|
5270
|
+
default: !1
|
|
5271
|
+
},
|
|
5266
5272
|
outputFormat: {
|
|
5267
5273
|
key: "outputFormat",
|
|
5268
5274
|
required: !1,
|
|
@@ -5325,7 +5331,7 @@ ve.props = {
|
|
|
5325
5331
|
}
|
|
5326
5332
|
};
|
|
5327
5333
|
ve.setup = (e, n) => {
|
|
5328
|
-
const a = e, u = n.emit,
|
|
5334
|
+
const a = e, u = n.emit, g = ge(() => a.outputFormat === "line-by-line"), t = ge(() => {
|
|
5329
5335
|
let l = a.oldString || "";
|
|
5330
5336
|
return l = a.trim ? l.trim() : l, l = a.noDiffLineFeed ? l.replace(/(\r\n)/g, `
|
|
5331
5337
|
`) : l, l;
|
|
@@ -5333,7 +5339,7 @@ ve.setup = (e, n) => {
|
|
|
5333
5339
|
let l = a.newString || "";
|
|
5334
5340
|
return l = a.trim ? l.trim() : l, l = a.noDiffLineFeed ? l.replace(/(\r\n)/g, `
|
|
5335
5341
|
`) : l, l;
|
|
5336
|
-
}), i = ge(() =>
|
|
5342
|
+
}), i = ge(() => g.value ? cr(t.value, r.value, a.language, a.diffStyle, a.forceInlineComparison, a.context, a.ignoreMatchingLines) : lr(t.value, r.value, a.language, a.diffStyle, a.forceInlineComparison, a.context, a.ignoreMatchingLines)), s = Fn(i.value), o = ge(() => s.value.stat.additionsNum === 0 && s.value.stat.deletionsNum === 0);
|
|
5337
5343
|
return zn(() => a, () => {
|
|
5338
5344
|
s.value = i.value, u("diff", {
|
|
5339
5345
|
stat: {
|
|
@@ -5346,15 +5352,15 @@ ve.setup = (e, n) => {
|
|
|
5346
5352
|
deep: !0,
|
|
5347
5353
|
immediate: !0
|
|
5348
5354
|
}), {
|
|
5349
|
-
isUnifiedViewer:
|
|
5355
|
+
isUnifiedViewer: g,
|
|
5350
5356
|
diffChange: s
|
|
5351
5357
|
};
|
|
5352
5358
|
};
|
|
5353
5359
|
ve.components = Object.assign({
|
|
5354
5360
|
UnifiedViewer: Er,
|
|
5355
|
-
SplitViewer:
|
|
5361
|
+
SplitViewer: Cr
|
|
5356
5362
|
}, ve.components);
|
|
5357
|
-
var
|
|
5363
|
+
var Rr = function() {
|
|
5358
5364
|
var e = this, n = e.$createElement, a = e._self._c || n;
|
|
5359
5365
|
return a("div", {
|
|
5360
5366
|
staticClass: "code-diff-view",
|
|
@@ -5415,7 +5421,7 @@ var Cr = function() {
|
|
|
5415
5421
|
const gn = {};
|
|
5416
5422
|
var Or = /* @__PURE__ */ Ee(
|
|
5417
5423
|
ve,
|
|
5418
|
-
|
|
5424
|
+
Rr,
|
|
5419
5425
|
Lr,
|
|
5420
5426
|
!1,
|
|
5421
5427
|
Ir,
|