@hep-code-runner/vue3 1.4.0 → 1.5.1
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/dist/index.d.ts +1 -1
- package/dist/index.js +120 -3
- package/dist/index.mjs +653 -525
- package/dist/style.css +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
var xe = Object.defineProperty, Oe = (
|
|
3
|
-
let
|
|
4
|
-
class
|
|
1
|
+
import { defineComponent as ie, useCssVars as be, ref as N, computed as G, onMounted as pe, watch as le, openBlock as _, createElementBlock as R, normalizeClass as W, createElementVNode as E, withDirectives as Ee, createCommentVNode as U, Fragment as ve, renderList as ye, toDisplayString as H, vModelSelect as Ae, createTextVNode as Se, normalizeStyle as se, createVNode as oe, createBlock as ke, Teleport as we, Transition as Te, withCtx as Ie, normalizeProps as Fe, guardReactiveProps as _e, renderSlot as Re } from "vue";
|
|
2
|
+
var xe = Object.defineProperty, Oe = (i, d, n) => d in i ? xe(i, d, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[d] = n, ce = (i, d, n) => Oe(i, typeof d != "symbol" ? d + "" : d, n);
|
|
3
|
+
let ne = null;
|
|
4
|
+
class Le {
|
|
5
5
|
constructor(d = {}) {
|
|
6
|
-
|
|
6
|
+
ce(this, "baseUrl"), ce(this, "timeout"), this.baseUrl = d.pistonUrl || "/api/piston", this.timeout = d.timeout || 3e3;
|
|
7
7
|
}
|
|
8
8
|
async getRuntimes(d = !1) {
|
|
9
|
-
if (
|
|
10
|
-
return
|
|
9
|
+
if (ne && !d)
|
|
10
|
+
return ne;
|
|
11
11
|
try {
|
|
12
|
-
const
|
|
12
|
+
const n = await fetch(`${this.baseUrl}/runtimes`, {
|
|
13
13
|
method: "GET",
|
|
14
14
|
headers: {
|
|
15
15
|
"Content-Type": "application/json"
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
if (!
|
|
19
|
-
throw new Error(`Failed to fetch runtimes: ${
|
|
20
|
-
const l = await
|
|
21
|
-
return
|
|
22
|
-
} catch (
|
|
23
|
-
throw console.error("Failed to fetch runtimes:",
|
|
18
|
+
if (!n.ok)
|
|
19
|
+
throw new Error(`Failed to fetch runtimes: ${n.statusText}`);
|
|
20
|
+
const l = await n.json();
|
|
21
|
+
return ne = l, l;
|
|
22
|
+
} catch (n) {
|
|
23
|
+
throw console.error("Failed to fetch runtimes:", n), n;
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
async execute(d,
|
|
27
|
-
const
|
|
28
|
-
(
|
|
29
|
-
var
|
|
30
|
-
return
|
|
26
|
+
async execute(d, n, l = {}) {
|
|
27
|
+
const h = (await this.getRuntimes()).find(
|
|
28
|
+
(f) => {
|
|
29
|
+
var m;
|
|
30
|
+
return f.language.toLowerCase() === d.toLowerCase() || ((m = f.aliases) == null ? void 0 : m.some((T) => T.toLowerCase() === d.toLowerCase()));
|
|
31
31
|
}
|
|
32
32
|
);
|
|
33
|
-
if (!
|
|
33
|
+
if (!h)
|
|
34
34
|
throw new Error(`Language '${d}' is not supported`);
|
|
35
|
-
const
|
|
36
|
-
language:
|
|
37
|
-
version: l.version ||
|
|
35
|
+
const y = this.getFileName(d), A = {
|
|
36
|
+
language: h.language,
|
|
37
|
+
version: l.version || h.version,
|
|
38
38
|
files: [
|
|
39
39
|
{
|
|
40
|
-
name:
|
|
41
|
-
content:
|
|
40
|
+
name: y,
|
|
41
|
+
content: n
|
|
42
42
|
}
|
|
43
43
|
],
|
|
44
44
|
stdin: l.stdin || "",
|
|
45
45
|
args: l.args || [],
|
|
46
46
|
run_timeout: l.runTimeout || this.timeout,
|
|
47
47
|
compile_timeout: this.timeout
|
|
48
|
-
},
|
|
48
|
+
}, s = Date.now();
|
|
49
49
|
try {
|
|
50
|
-
const
|
|
50
|
+
const f = await fetch(`${this.baseUrl}/execute`, {
|
|
51
51
|
method: "POST",
|
|
52
52
|
headers: {
|
|
53
53
|
"Content-Type": "application/json"
|
|
54
54
|
},
|
|
55
55
|
body: JSON.stringify(A)
|
|
56
56
|
});
|
|
57
|
-
if (!
|
|
58
|
-
throw new Error(`Execute failed: ${
|
|
59
|
-
const
|
|
57
|
+
if (!f.ok)
|
|
58
|
+
throw new Error(`Execute failed: ${f.statusText}`);
|
|
59
|
+
const m = await f.json(), T = Date.now() - s, L = m.run.stdout || "", I = m.run.stderr || "";
|
|
60
60
|
return {
|
|
61
|
-
success:
|
|
61
|
+
success: m.run.code === 0,
|
|
62
62
|
output: L,
|
|
63
|
-
stderr:
|
|
64
|
-
code:
|
|
65
|
-
executionTime:
|
|
66
|
-
compile:
|
|
67
|
-
stdout:
|
|
68
|
-
stderr:
|
|
69
|
-
code:
|
|
63
|
+
stderr: I,
|
|
64
|
+
code: m.run.code,
|
|
65
|
+
executionTime: T,
|
|
66
|
+
compile: m.compile ? {
|
|
67
|
+
stdout: m.compile.stdout || "",
|
|
68
|
+
stderr: m.compile.stderr || "",
|
|
69
|
+
code: m.compile.code
|
|
70
70
|
} : void 0
|
|
71
71
|
};
|
|
72
|
-
} catch (
|
|
72
|
+
} catch (f) {
|
|
73
73
|
return {
|
|
74
74
|
success: !1,
|
|
75
75
|
output: "",
|
|
76
|
-
stderr:
|
|
76
|
+
stderr: f instanceof Error ? f.message : "Unknown error",
|
|
77
77
|
code: -1,
|
|
78
|
-
executionTime: Date.now() -
|
|
78
|
+
executionTime: Date.now() - s
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -109,7 +109,7 @@ class Ne {
|
|
|
109
109
|
}[d.toLowerCase()] || `main.${d}`;
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
const
|
|
112
|
+
const Ne = {
|
|
113
113
|
javascript: 'console.log("Hello, World!");',
|
|
114
114
|
typescript: 'console.log("Hello, World!");',
|
|
115
115
|
python: 'print("Hello, World!")',
|
|
@@ -207,17 +207,17 @@ h1 {
|
|
|
207
207
|
|
|
208
208
|
This is a sample markdown document.`
|
|
209
209
|
};
|
|
210
|
-
function
|
|
211
|
-
const d =
|
|
212
|
-
return
|
|
210
|
+
function ae(i) {
|
|
211
|
+
const d = i.toLowerCase();
|
|
212
|
+
return Ne[d] || `// ${i}
|
|
213
213
|
// Write your code here`;
|
|
214
214
|
}
|
|
215
|
-
var
|
|
216
|
-
function Ce(
|
|
217
|
-
return
|
|
215
|
+
var de = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
216
|
+
function Ce(i) {
|
|
217
|
+
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
|
|
218
218
|
}
|
|
219
|
-
var
|
|
220
|
-
(function(
|
|
219
|
+
var ge = { exports: {} };
|
|
220
|
+
(function(i) {
|
|
221
221
|
var d = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
|
|
222
222
|
/**
|
|
223
223
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
@@ -227,8 +227,8 @@ var pe = { exports: {} };
|
|
|
227
227
|
* @namespace
|
|
228
228
|
* @public
|
|
229
229
|
*/
|
|
230
|
-
var
|
|
231
|
-
var
|
|
230
|
+
var n = function(l) {
|
|
231
|
+
var h = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, y = 0, A = {}, s = {
|
|
232
232
|
/**
|
|
233
233
|
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
|
|
234
234
|
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
|
|
@@ -284,7 +284,7 @@ var pe = { exports: {} };
|
|
|
284
284
|
*/
|
|
285
285
|
util: {
|
|
286
286
|
encode: function t(e) {
|
|
287
|
-
return e instanceof
|
|
287
|
+
return e instanceof f ? new f(e.type, t(e.content), e.alias) : Array.isArray(e) ? e.map(t) : e.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
288
288
|
},
|
|
289
289
|
/**
|
|
290
290
|
* Returns the name of the type of the given value.
|
|
@@ -312,7 +312,7 @@ var pe = { exports: {} };
|
|
|
312
312
|
* @returns {number}
|
|
313
313
|
*/
|
|
314
314
|
objId: function(t) {
|
|
315
|
-
return t.__id || Object.defineProperty(t, "__id", { value: ++
|
|
315
|
+
return t.__id || Object.defineProperty(t, "__id", { value: ++y }), t.__id;
|
|
316
316
|
},
|
|
317
317
|
/**
|
|
318
318
|
* Creates a deep clone of the given object.
|
|
@@ -324,28 +324,28 @@ var pe = { exports: {} };
|
|
|
324
324
|
* @returns {T}
|
|
325
325
|
* @template T
|
|
326
326
|
*/
|
|
327
|
-
clone: function t(e,
|
|
328
|
-
|
|
329
|
-
var
|
|
330
|
-
switch (
|
|
327
|
+
clone: function t(e, a) {
|
|
328
|
+
a = a || {};
|
|
329
|
+
var r, o;
|
|
330
|
+
switch (s.util.type(e)) {
|
|
331
331
|
case "Object":
|
|
332
|
-
if (
|
|
333
|
-
return
|
|
334
|
-
|
|
335
|
-
{},
|
|
332
|
+
if (o = s.util.objId(e), a[o])
|
|
333
|
+
return a[o];
|
|
334
|
+
r = /** @type {Record<string, any>} */
|
|
335
|
+
{}, a[o] = r;
|
|
336
336
|
for (var c in e)
|
|
337
|
-
e.hasOwnProperty(c) && (
|
|
337
|
+
e.hasOwnProperty(c) && (r[c] = t(e[c], a));
|
|
338
338
|
return (
|
|
339
339
|
/** @type {any} */
|
|
340
|
-
|
|
340
|
+
r
|
|
341
341
|
);
|
|
342
342
|
case "Array":
|
|
343
|
-
return
|
|
343
|
+
return o = s.util.objId(e), a[o] ? a[o] : (r = [], a[o] = r, /** @type {Array} */
|
|
344
344
|
/** @type {any} */
|
|
345
|
-
e.forEach(function(
|
|
346
|
-
|
|
345
|
+
e.forEach(function(b, u) {
|
|
346
|
+
r[u] = t(b, a);
|
|
347
347
|
}), /** @type {any} */
|
|
348
|
-
|
|
348
|
+
r);
|
|
349
349
|
default:
|
|
350
350
|
return e;
|
|
351
351
|
}
|
|
@@ -360,7 +360,7 @@ var pe = { exports: {} };
|
|
|
360
360
|
*/
|
|
361
361
|
getLanguage: function(t) {
|
|
362
362
|
for (; t; ) {
|
|
363
|
-
var e =
|
|
363
|
+
var e = h.exec(t.className);
|
|
364
364
|
if (e)
|
|
365
365
|
return e[1].toLowerCase();
|
|
366
366
|
t = t.parentElement;
|
|
@@ -375,7 +375,7 @@ var pe = { exports: {} };
|
|
|
375
375
|
* @returns {void}
|
|
376
376
|
*/
|
|
377
377
|
setLanguage: function(t, e) {
|
|
378
|
-
t.className = t.className.replace(RegExp(
|
|
378
|
+
t.className = t.className.replace(RegExp(h, "gi"), ""), t.classList.add("language-" + e);
|
|
379
379
|
},
|
|
380
380
|
/**
|
|
381
381
|
* Returns the script element that is currently executing.
|
|
@@ -394,13 +394,13 @@ var pe = { exports: {} };
|
|
|
394
394
|
);
|
|
395
395
|
try {
|
|
396
396
|
throw new Error();
|
|
397
|
-
} catch (
|
|
398
|
-
var t = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(
|
|
397
|
+
} catch (r) {
|
|
398
|
+
var t = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack) || [])[1];
|
|
399
399
|
if (t) {
|
|
400
400
|
var e = document.getElementsByTagName("script");
|
|
401
|
-
for (var
|
|
402
|
-
if (e[
|
|
403
|
-
return e[
|
|
401
|
+
for (var a in e)
|
|
402
|
+
if (e[a].src == t)
|
|
403
|
+
return e[a];
|
|
404
404
|
}
|
|
405
405
|
return null;
|
|
406
406
|
}
|
|
@@ -424,16 +424,16 @@ var pe = { exports: {} };
|
|
|
424
424
|
* @param {boolean} [defaultActivation=false]
|
|
425
425
|
* @returns {boolean}
|
|
426
426
|
*/
|
|
427
|
-
isActive: function(t, e,
|
|
428
|
-
for (var
|
|
429
|
-
var
|
|
430
|
-
if (
|
|
427
|
+
isActive: function(t, e, a) {
|
|
428
|
+
for (var r = "no-" + e; t; ) {
|
|
429
|
+
var o = t.classList;
|
|
430
|
+
if (o.contains(e))
|
|
431
431
|
return !0;
|
|
432
|
-
if (
|
|
432
|
+
if (o.contains(r))
|
|
433
433
|
return !1;
|
|
434
434
|
t = t.parentElement;
|
|
435
435
|
}
|
|
436
|
-
return !!
|
|
436
|
+
return !!a;
|
|
437
437
|
}
|
|
438
438
|
},
|
|
439
439
|
/**
|
|
@@ -480,10 +480,10 @@ var pe = { exports: {} };
|
|
|
480
480
|
* });
|
|
481
481
|
*/
|
|
482
482
|
extend: function(t, e) {
|
|
483
|
-
var
|
|
484
|
-
for (var
|
|
485
|
-
|
|
486
|
-
return
|
|
483
|
+
var a = s.util.clone(s.languages[t]);
|
|
484
|
+
for (var r in e)
|
|
485
|
+
a[r] = e[r];
|
|
486
|
+
return a;
|
|
487
487
|
},
|
|
488
488
|
/**
|
|
489
489
|
* Inserts tokens _before_ another token in a language definition or any other grammar.
|
|
@@ -560,31 +560,31 @@ var pe = { exports: {} };
|
|
|
560
560
|
* @returns {Grammar} The new grammar object.
|
|
561
561
|
* @public
|
|
562
562
|
*/
|
|
563
|
-
insertBefore: function(t, e,
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
var
|
|
567
|
-
for (var
|
|
568
|
-
if (
|
|
569
|
-
if (
|
|
570
|
-
for (var u in
|
|
571
|
-
|
|
572
|
-
|
|
563
|
+
insertBefore: function(t, e, a, r) {
|
|
564
|
+
r = r || /** @type {any} */
|
|
565
|
+
s.languages;
|
|
566
|
+
var o = r[t], c = {};
|
|
567
|
+
for (var b in o)
|
|
568
|
+
if (o.hasOwnProperty(b)) {
|
|
569
|
+
if (b == e)
|
|
570
|
+
for (var u in a)
|
|
571
|
+
a.hasOwnProperty(u) && (c[u] = a[u]);
|
|
572
|
+
a.hasOwnProperty(b) || (c[b] = o[b]);
|
|
573
573
|
}
|
|
574
|
-
var
|
|
575
|
-
return
|
|
576
|
-
P ===
|
|
574
|
+
var k = r[t];
|
|
575
|
+
return r[t] = c, s.languages.DFS(s.languages, function(F, P) {
|
|
576
|
+
P === k && F != t && (this[F] = c);
|
|
577
577
|
}), c;
|
|
578
578
|
},
|
|
579
579
|
// Traverse a language definition with Depth First Search
|
|
580
|
-
DFS: function t(e,
|
|
581
|
-
|
|
582
|
-
var c =
|
|
583
|
-
for (var
|
|
584
|
-
if (e.hasOwnProperty(
|
|
585
|
-
|
|
586
|
-
var u = e[
|
|
587
|
-
|
|
580
|
+
DFS: function t(e, a, r, o) {
|
|
581
|
+
o = o || {};
|
|
582
|
+
var c = s.util.objId;
|
|
583
|
+
for (var b in e)
|
|
584
|
+
if (e.hasOwnProperty(b)) {
|
|
585
|
+
a.call(e, b, e[b], r || b);
|
|
586
|
+
var u = e[b], k = s.util.type(u);
|
|
587
|
+
k === "Object" && !o[c(u)] ? (o[c(u)] = !0, t(u, a, null, o)) : k === "Array" && !o[c(u)] && (o[c(u)] = !0, t(u, a, b, o));
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
590
|
},
|
|
@@ -602,7 +602,7 @@ var pe = { exports: {} };
|
|
|
602
602
|
* @public
|
|
603
603
|
*/
|
|
604
604
|
highlightAll: function(t, e) {
|
|
605
|
-
|
|
605
|
+
s.highlightAllUnder(document, t, e);
|
|
606
606
|
},
|
|
607
607
|
/**
|
|
608
608
|
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
|
|
@@ -619,15 +619,15 @@ var pe = { exports: {} };
|
|
|
619
619
|
* @memberof Prism
|
|
620
620
|
* @public
|
|
621
621
|
*/
|
|
622
|
-
highlightAllUnder: function(t, e,
|
|
623
|
-
var
|
|
624
|
-
callback:
|
|
622
|
+
highlightAllUnder: function(t, e, a) {
|
|
623
|
+
var r = {
|
|
624
|
+
callback: a,
|
|
625
625
|
container: t,
|
|
626
626
|
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
|
627
627
|
};
|
|
628
|
-
|
|
629
|
-
for (var
|
|
630
|
-
|
|
628
|
+
s.hooks.run("before-highlightall", r), r.elements = Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)), s.hooks.run("before-all-elements-highlight", r);
|
|
629
|
+
for (var o = 0, c; c = r.elements[o++]; )
|
|
630
|
+
s.highlightElement(c, e === !0, r.callback);
|
|
631
631
|
},
|
|
632
632
|
/**
|
|
633
633
|
* Highlights the code inside a single element.
|
|
@@ -657,39 +657,39 @@ var pe = { exports: {} };
|
|
|
657
657
|
* @memberof Prism
|
|
658
658
|
* @public
|
|
659
659
|
*/
|
|
660
|
-
highlightElement: function(t, e,
|
|
661
|
-
var
|
|
662
|
-
|
|
660
|
+
highlightElement: function(t, e, a) {
|
|
661
|
+
var r = s.util.getLanguage(t), o = s.languages[r];
|
|
662
|
+
s.util.setLanguage(t, r);
|
|
663
663
|
var c = t.parentElement;
|
|
664
|
-
c && c.nodeName.toLowerCase() === "pre" &&
|
|
665
|
-
var
|
|
664
|
+
c && c.nodeName.toLowerCase() === "pre" && s.util.setLanguage(c, r);
|
|
665
|
+
var b = t.textContent, u = {
|
|
666
666
|
element: t,
|
|
667
|
-
language:
|
|
668
|
-
grammar:
|
|
669
|
-
code:
|
|
667
|
+
language: r,
|
|
668
|
+
grammar: o,
|
|
669
|
+
code: b
|
|
670
670
|
};
|
|
671
|
-
function
|
|
672
|
-
u.highlightedCode = P,
|
|
671
|
+
function k(P) {
|
|
672
|
+
u.highlightedCode = P, s.hooks.run("before-insert", u), u.element.innerHTML = u.highlightedCode, s.hooks.run("after-highlight", u), s.hooks.run("complete", u), a && a.call(u.element);
|
|
673
673
|
}
|
|
674
|
-
if (
|
|
675
|
-
|
|
674
|
+
if (s.hooks.run("before-sanity-check", u), c = u.element.parentElement, c && c.nodeName.toLowerCase() === "pre" && !c.hasAttribute("tabindex") && c.setAttribute("tabindex", "0"), !u.code) {
|
|
675
|
+
s.hooks.run("complete", u), a && a.call(u.element);
|
|
676
676
|
return;
|
|
677
677
|
}
|
|
678
|
-
if (
|
|
679
|
-
|
|
678
|
+
if (s.hooks.run("before-highlight", u), !u.grammar) {
|
|
679
|
+
k(s.util.encode(u.code));
|
|
680
680
|
return;
|
|
681
681
|
}
|
|
682
682
|
if (e && l.Worker) {
|
|
683
|
-
var
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
},
|
|
683
|
+
var F = new Worker(s.filename);
|
|
684
|
+
F.onmessage = function(P) {
|
|
685
|
+
k(P.data);
|
|
686
|
+
}, F.postMessage(JSON.stringify({
|
|
687
687
|
language: u.language,
|
|
688
688
|
code: u.code,
|
|
689
689
|
immediateClose: !0
|
|
690
690
|
}));
|
|
691
691
|
} else
|
|
692
|
-
|
|
692
|
+
k(s.highlight(u.code, u.grammar, u.language));
|
|
693
693
|
},
|
|
694
694
|
/**
|
|
695
695
|
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input
|
|
@@ -711,15 +711,15 @@ var pe = { exports: {} };
|
|
|
711
711
|
* @example
|
|
712
712
|
* Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
|
|
713
713
|
*/
|
|
714
|
-
highlight: function(t, e,
|
|
715
|
-
var
|
|
714
|
+
highlight: function(t, e, a) {
|
|
715
|
+
var r = {
|
|
716
716
|
code: t,
|
|
717
717
|
grammar: e,
|
|
718
|
-
language:
|
|
718
|
+
language: a
|
|
719
719
|
};
|
|
720
|
-
if (
|
|
721
|
-
throw new Error('The language "' +
|
|
722
|
-
return
|
|
720
|
+
if (s.hooks.run("before-tokenize", r), !r.grammar)
|
|
721
|
+
throw new Error('The language "' + r.language + '" has no grammar.');
|
|
722
|
+
return r.tokens = s.tokenize(r.code, r.grammar), s.hooks.run("after-tokenize", r), f.stringify(s.util.encode(r.tokens), r.language);
|
|
723
723
|
},
|
|
724
724
|
/**
|
|
725
725
|
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
|
|
@@ -746,14 +746,14 @@ var pe = { exports: {} };
|
|
|
746
746
|
* });
|
|
747
747
|
*/
|
|
748
748
|
tokenize: function(t, e) {
|
|
749
|
-
var
|
|
750
|
-
if (
|
|
751
|
-
for (var
|
|
752
|
-
e[
|
|
749
|
+
var a = e.rest;
|
|
750
|
+
if (a) {
|
|
751
|
+
for (var r in a)
|
|
752
|
+
e[r] = a[r];
|
|
753
753
|
delete e.rest;
|
|
754
754
|
}
|
|
755
|
-
var
|
|
756
|
-
return
|
|
755
|
+
var o = new L();
|
|
756
|
+
return I(o, o.head, t), T(t, o, e, o.head, 0), D(o);
|
|
757
757
|
},
|
|
758
758
|
/**
|
|
759
759
|
* @namespace
|
|
@@ -775,8 +775,8 @@ var pe = { exports: {} };
|
|
|
775
775
|
* @public
|
|
776
776
|
*/
|
|
777
777
|
add: function(t, e) {
|
|
778
|
-
var
|
|
779
|
-
|
|
778
|
+
var a = s.hooks.all;
|
|
779
|
+
a[t] = a[t] || [], a[t].push(e);
|
|
780
780
|
},
|
|
781
781
|
/**
|
|
782
782
|
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
@@ -788,93 +788,93 @@ var pe = { exports: {} };
|
|
|
788
788
|
* @public
|
|
789
789
|
*/
|
|
790
790
|
run: function(t, e) {
|
|
791
|
-
var
|
|
792
|
-
if (!(!
|
|
793
|
-
for (var
|
|
794
|
-
|
|
791
|
+
var a = s.hooks.all[t];
|
|
792
|
+
if (!(!a || !a.length))
|
|
793
|
+
for (var r = 0, o; o = a[r++]; )
|
|
794
|
+
o(e);
|
|
795
795
|
}
|
|
796
796
|
},
|
|
797
|
-
Token:
|
|
797
|
+
Token: f
|
|
798
798
|
};
|
|
799
|
-
l.Prism =
|
|
800
|
-
function
|
|
801
|
-
this.type = t, this.content = e, this.alias =
|
|
799
|
+
l.Prism = s;
|
|
800
|
+
function f(t, e, a, r) {
|
|
801
|
+
this.type = t, this.content = e, this.alias = a, this.length = (r || "").length | 0;
|
|
802
802
|
}
|
|
803
|
-
|
|
803
|
+
f.stringify = function t(e, a) {
|
|
804
804
|
if (typeof e == "string")
|
|
805
805
|
return e;
|
|
806
806
|
if (Array.isArray(e)) {
|
|
807
|
-
var
|
|
808
|
-
return e.forEach(function(
|
|
809
|
-
|
|
810
|
-
}),
|
|
807
|
+
var r = "";
|
|
808
|
+
return e.forEach(function(k) {
|
|
809
|
+
r += t(k, a);
|
|
810
|
+
}), r;
|
|
811
811
|
}
|
|
812
|
-
var
|
|
812
|
+
var o = {
|
|
813
813
|
type: e.type,
|
|
814
|
-
content: t(e.content,
|
|
814
|
+
content: t(e.content, a),
|
|
815
815
|
tag: "span",
|
|
816
816
|
classes: ["token", e.type],
|
|
817
817
|
attributes: {},
|
|
818
|
-
language:
|
|
818
|
+
language: a
|
|
819
819
|
}, c = e.alias;
|
|
820
|
-
c && (Array.isArray(c) ? Array.prototype.push.apply(
|
|
821
|
-
var
|
|
822
|
-
for (var u in
|
|
823
|
-
|
|
824
|
-
return "<" +
|
|
820
|
+
c && (Array.isArray(c) ? Array.prototype.push.apply(o.classes, c) : o.classes.push(c)), s.hooks.run("wrap", o);
|
|
821
|
+
var b = "";
|
|
822
|
+
for (var u in o.attributes)
|
|
823
|
+
b += " " + u + '="' + (o.attributes[u] || "").replace(/"/g, """) + '"';
|
|
824
|
+
return "<" + o.tag + ' class="' + o.classes.join(" ") + '"' + b + ">" + o.content + "</" + o.tag + ">";
|
|
825
825
|
};
|
|
826
|
-
function
|
|
826
|
+
function m(t, e, a, r) {
|
|
827
827
|
t.lastIndex = e;
|
|
828
|
-
var
|
|
829
|
-
if (
|
|
830
|
-
var c =
|
|
831
|
-
|
|
828
|
+
var o = t.exec(a);
|
|
829
|
+
if (o && r && o[1]) {
|
|
830
|
+
var c = o[1].length;
|
|
831
|
+
o.index += c, o[0] = o[0].slice(c);
|
|
832
832
|
}
|
|
833
|
-
return
|
|
833
|
+
return o;
|
|
834
834
|
}
|
|
835
|
-
function
|
|
836
|
-
for (var
|
|
837
|
-
if (!(!
|
|
838
|
-
var u =
|
|
835
|
+
function T(t, e, a, r, o, c) {
|
|
836
|
+
for (var b in a)
|
|
837
|
+
if (!(!a.hasOwnProperty(b) || !a[b])) {
|
|
838
|
+
var u = a[b];
|
|
839
839
|
u = Array.isArray(u) ? u : [u];
|
|
840
|
-
for (var
|
|
841
|
-
if (c && c.cause ==
|
|
840
|
+
for (var k = 0; k < u.length; ++k) {
|
|
841
|
+
if (c && c.cause == b + "," + k)
|
|
842
842
|
return;
|
|
843
|
-
var
|
|
844
|
-
if (
|
|
845
|
-
var
|
|
846
|
-
|
|
843
|
+
var F = u[k], P = F.inside, V = !!F.lookbehind, v = !!F.greedy, w = F.alias;
|
|
844
|
+
if (v && !F.pattern.global) {
|
|
845
|
+
var x = F.pattern.toString().match(/[imsuy]*$/)[0];
|
|
846
|
+
F.pattern = RegExp(F.pattern.source, x + "g");
|
|
847
847
|
}
|
|
848
|
-
for (var Y =
|
|
849
|
-
var z =
|
|
848
|
+
for (var Y = F.pattern || F, O = r.next, M = o; O !== e.tail && !(c && M >= c.reach); M += O.value.length, O = O.next) {
|
|
849
|
+
var z = O.value;
|
|
850
850
|
if (e.length > t.length)
|
|
851
851
|
return;
|
|
852
|
-
if (!(z instanceof
|
|
852
|
+
if (!(z instanceof f)) {
|
|
853
853
|
var X = 1, $;
|
|
854
|
-
if (
|
|
855
|
-
if ($ =
|
|
854
|
+
if (v) {
|
|
855
|
+
if ($ = m(Y, M, t, V), !$ || $.index >= t.length)
|
|
856
856
|
break;
|
|
857
|
-
var Z = $.index,
|
|
858
|
-
for (B +=
|
|
859
|
-
|
|
860
|
-
if (B -=
|
|
857
|
+
var Z = $.index, fe = $.index + $[0].length, B = M;
|
|
858
|
+
for (B += O.value.length; Z >= B; )
|
|
859
|
+
O = O.next, B += O.value.length;
|
|
860
|
+
if (B -= O.value.length, M = B, O.value instanceof f)
|
|
861
861
|
continue;
|
|
862
|
-
for (var j =
|
|
862
|
+
for (var j = O; j !== e.tail && (B < fe || typeof j.value == "string"); j = j.next)
|
|
863
863
|
X++, B += j.value.length;
|
|
864
864
|
X--, z = t.slice(M, B), $.index -= M;
|
|
865
|
-
} else if ($ =
|
|
865
|
+
} else if ($ = m(Y, 0, z, V), !$)
|
|
866
866
|
continue;
|
|
867
|
-
var Z = $.index, K = $[0], Q = z.slice(0, Z),
|
|
867
|
+
var Z = $.index, K = $[0], Q = z.slice(0, Z), ue = z.slice(Z + K.length), ee = M + z.length;
|
|
868
868
|
c && ee > c.reach && (c.reach = ee);
|
|
869
|
-
var q =
|
|
870
|
-
Q && (q =
|
|
871
|
-
var
|
|
872
|
-
if (
|
|
869
|
+
var q = O.prev;
|
|
870
|
+
Q && (q = I(e, q, Q), M += Q.length), C(e, q, X);
|
|
871
|
+
var me = new f(b, P ? s.tokenize(K, P) : K, w, K);
|
|
872
|
+
if (O = I(e, q, me), ue && I(e, O, ue), X > 1) {
|
|
873
873
|
var te = {
|
|
874
|
-
cause:
|
|
874
|
+
cause: b + "," + k,
|
|
875
875
|
reach: ee
|
|
876
876
|
};
|
|
877
|
-
|
|
877
|
+
T(t, e, a, O.prev, M, te), c && te.reach > c.reach && (c.reach = te.reach);
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
880
|
}
|
|
@@ -885,37 +885,37 @@ var pe = { exports: {} };
|
|
|
885
885
|
var t = { value: null, prev: null, next: null }, e = { value: null, prev: t, next: null };
|
|
886
886
|
t.next = e, this.head = t, this.tail = e, this.length = 0;
|
|
887
887
|
}
|
|
888
|
-
function
|
|
889
|
-
var
|
|
890
|
-
return e.next =
|
|
888
|
+
function I(t, e, a) {
|
|
889
|
+
var r = e.next, o = { value: a, prev: e, next: r };
|
|
890
|
+
return e.next = o, r.prev = o, t.length++, o;
|
|
891
891
|
}
|
|
892
|
-
function
|
|
893
|
-
for (var
|
|
894
|
-
|
|
895
|
-
e.next =
|
|
892
|
+
function C(t, e, a) {
|
|
893
|
+
for (var r = e.next, o = 0; o < a && r !== t.tail; o++)
|
|
894
|
+
r = r.next;
|
|
895
|
+
e.next = r, r.prev = e, t.length -= o;
|
|
896
896
|
}
|
|
897
|
-
function
|
|
898
|
-
for (var e = [],
|
|
899
|
-
e.push(
|
|
897
|
+
function D(t) {
|
|
898
|
+
for (var e = [], a = t.head.next; a !== t.tail; )
|
|
899
|
+
e.push(a.value), a = a.next;
|
|
900
900
|
return e;
|
|
901
901
|
}
|
|
902
902
|
if (!l.document)
|
|
903
|
-
return l.addEventListener && (
|
|
904
|
-
var e = JSON.parse(t.data),
|
|
905
|
-
l.postMessage(
|
|
906
|
-
}, !1)),
|
|
907
|
-
var
|
|
908
|
-
|
|
909
|
-
function
|
|
910
|
-
|
|
903
|
+
return l.addEventListener && (s.disableWorkerMessageHandler || l.addEventListener("message", function(t) {
|
|
904
|
+
var e = JSON.parse(t.data), a = e.language, r = e.code, o = e.immediateClose;
|
|
905
|
+
l.postMessage(s.highlight(r, s.languages[a], a)), o && l.close();
|
|
906
|
+
}, !1)), s;
|
|
907
|
+
var g = s.util.currentScript();
|
|
908
|
+
g && (s.filename = g.src, g.hasAttribute("data-manual") && (s.manual = !0));
|
|
909
|
+
function p() {
|
|
910
|
+
s.manual || s.highlightAll();
|
|
911
911
|
}
|
|
912
|
-
if (!
|
|
913
|
-
var
|
|
914
|
-
|
|
912
|
+
if (!s.manual) {
|
|
913
|
+
var S = document.readyState;
|
|
914
|
+
S === "loading" || S === "interactive" && g && g.defer ? document.addEventListener("DOMContentLoaded", p) : window.requestAnimationFrame ? window.requestAnimationFrame(p) : window.setTimeout(p, 16);
|
|
915
915
|
}
|
|
916
|
-
return
|
|
916
|
+
return s;
|
|
917
917
|
}(d);
|
|
918
|
-
|
|
918
|
+
i.exports && (i.exports = n), typeof de < "u" && (de.Prism = n), n.languages.markup = {
|
|
919
919
|
comment: {
|
|
920
920
|
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
921
921
|
greedy: !0
|
|
@@ -992,9 +992,9 @@ var pe = { exports: {} };
|
|
|
992
992
|
},
|
|
993
993
|
/&#x?[\da-f]{1,8};/i
|
|
994
994
|
]
|
|
995
|
-
},
|
|
995
|
+
}, n.languages.markup.tag.inside["attr-value"].inside.entity = n.languages.markup.entity, n.languages.markup.doctype.inside["internal-subset"].inside = n.languages.markup, n.hooks.add("wrap", function(l) {
|
|
996
996
|
l.type === "entity" && (l.attributes.title = l.content.replace(/&/, "&"));
|
|
997
|
-
}), Object.defineProperty(
|
|
997
|
+
}), Object.defineProperty(n.languages.markup.tag, "addInlined", {
|
|
998
998
|
/**
|
|
999
999
|
* Adds an inlined language to markup.
|
|
1000
1000
|
*
|
|
@@ -1006,34 +1006,34 @@ var pe = { exports: {} };
|
|
|
1006
1006
|
* @example
|
|
1007
1007
|
* addInlined('style', 'css');
|
|
1008
1008
|
*/
|
|
1009
|
-
value: function(
|
|
1009
|
+
value: function(h, y) {
|
|
1010
1010
|
var A = {};
|
|
1011
|
-
A["language-" +
|
|
1011
|
+
A["language-" + y] = {
|
|
1012
1012
|
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
1013
1013
|
lookbehind: !0,
|
|
1014
|
-
inside:
|
|
1014
|
+
inside: n.languages[y]
|
|
1015
1015
|
}, A.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
1016
|
-
var
|
|
1016
|
+
var s = {
|
|
1017
1017
|
"included-cdata": {
|
|
1018
1018
|
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
1019
1019
|
inside: A
|
|
1020
1020
|
}
|
|
1021
1021
|
};
|
|
1022
|
-
|
|
1022
|
+
s["language-" + y] = {
|
|
1023
1023
|
pattern: /[\s\S]+/,
|
|
1024
|
-
inside:
|
|
1024
|
+
inside: n.languages[y]
|
|
1025
1025
|
};
|
|
1026
|
-
var
|
|
1027
|
-
|
|
1026
|
+
var f = {};
|
|
1027
|
+
f[h] = {
|
|
1028
1028
|
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
1029
|
-
return
|
|
1029
|
+
return h;
|
|
1030
1030
|
}), "i"),
|
|
1031
1031
|
lookbehind: !0,
|
|
1032
1032
|
greedy: !0,
|
|
1033
|
-
inside:
|
|
1034
|
-
},
|
|
1033
|
+
inside: s
|
|
1034
|
+
}, n.languages.insertBefore("markup", "cdata", f);
|
|
1035
1035
|
}
|
|
1036
|
-
}), Object.defineProperty(
|
|
1036
|
+
}), Object.defineProperty(n.languages.markup.tag, "addAttribute", {
|
|
1037
1037
|
/**
|
|
1038
1038
|
* Adds an pattern to highlight languages embedded in HTML attributes.
|
|
1039
1039
|
*
|
|
@@ -1045,8 +1045,8 @@ var pe = { exports: {} };
|
|
|
1045
1045
|
* @example
|
|
1046
1046
|
* addAttribute('style', 'css');
|
|
1047
1047
|
*/
|
|
1048
|
-
value: function(l,
|
|
1049
|
-
|
|
1048
|
+
value: function(l, h) {
|
|
1049
|
+
n.languages.markup.tag.inside["special-attr"].push({
|
|
1050
1050
|
pattern: RegExp(
|
|
1051
1051
|
/(^|["'\s])/.source + "(?:" + l + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
|
|
1052
1052
|
"i"
|
|
@@ -1060,8 +1060,8 @@ var pe = { exports: {} };
|
|
|
1060
1060
|
value: {
|
|
1061
1061
|
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
1062
1062
|
lookbehind: !0,
|
|
1063
|
-
alias: [
|
|
1064
|
-
inside:
|
|
1063
|
+
alias: [h, "language-" + h],
|
|
1064
|
+
inside: n.languages[h]
|
|
1065
1065
|
},
|
|
1066
1066
|
punctuation: [
|
|
1067
1067
|
{
|
|
@@ -1075,12 +1075,12 @@ var pe = { exports: {} };
|
|
|
1075
1075
|
}
|
|
1076
1076
|
});
|
|
1077
1077
|
}
|
|
1078
|
-
}),
|
|
1079
|
-
var
|
|
1078
|
+
}), n.languages.html = n.languages.markup, n.languages.mathml = n.languages.markup, n.languages.svg = n.languages.markup, n.languages.xml = n.languages.extend("markup", {}), n.languages.ssml = n.languages.xml, n.languages.atom = n.languages.xml, n.languages.rss = n.languages.xml, function(l) {
|
|
1079
|
+
var h = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
1080
1080
|
l.languages.css = {
|
|
1081
1081
|
comment: /\/\*[\s\S]*?\*\//,
|
|
1082
1082
|
atrule: {
|
|
1083
|
-
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" +
|
|
1083
|
+
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + h.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
|
1084
1084
|
inside: {
|
|
1085
1085
|
rule: /^@[\w-]+/,
|
|
1086
1086
|
"selector-function-argument": {
|
|
@@ -1097,23 +1097,23 @@ var pe = { exports: {} };
|
|
|
1097
1097
|
},
|
|
1098
1098
|
url: {
|
|
1099
1099
|
// https://drafts.csswg.org/css-values-3/#urls
|
|
1100
|
-
pattern: RegExp("\\burl\\((?:" +
|
|
1100
|
+
pattern: RegExp("\\burl\\((?:" + h.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
|
1101
1101
|
greedy: !0,
|
|
1102
1102
|
inside: {
|
|
1103
1103
|
function: /^url/i,
|
|
1104
1104
|
punctuation: /^\(|\)$/,
|
|
1105
1105
|
string: {
|
|
1106
|
-
pattern: RegExp("^" +
|
|
1106
|
+
pattern: RegExp("^" + h.source + "$"),
|
|
1107
1107
|
alias: "url"
|
|
1108
1108
|
}
|
|
1109
1109
|
}
|
|
1110
1110
|
},
|
|
1111
1111
|
selector: {
|
|
1112
|
-
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` +
|
|
1112
|
+
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + h.source + ")*(?=\\s*\\{)"),
|
|
1113
1113
|
lookbehind: !0
|
|
1114
1114
|
},
|
|
1115
1115
|
string: {
|
|
1116
|
-
pattern:
|
|
1116
|
+
pattern: h,
|
|
1117
1117
|
greedy: !0
|
|
1118
1118
|
},
|
|
1119
1119
|
property: {
|
|
@@ -1127,9 +1127,9 @@ var pe = { exports: {} };
|
|
|
1127
1127
|
},
|
|
1128
1128
|
punctuation: /[(){};:,]/
|
|
1129
1129
|
}, l.languages.css.atrule.inside.rest = l.languages.css;
|
|
1130
|
-
var
|
|
1131
|
-
|
|
1132
|
-
}(
|
|
1130
|
+
var y = l.languages.markup;
|
|
1131
|
+
y && (y.tag.addInlined("style", "css"), y.tag.addAttribute("style", "css"));
|
|
1132
|
+
}(n), n.languages.clike = {
|
|
1133
1133
|
comment: [
|
|
1134
1134
|
{
|
|
1135
1135
|
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
|
@@ -1159,9 +1159,9 @@ var pe = { exports: {} };
|
|
|
1159
1159
|
number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
|
1160
1160
|
operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
|
1161
1161
|
punctuation: /[{}[\];(),.:]/
|
|
1162
|
-
},
|
|
1162
|
+
}, n.languages.javascript = n.languages.extend("clike", {
|
|
1163
1163
|
"class-name": [
|
|
1164
|
-
|
|
1164
|
+
n.languages.clike["class-name"],
|
|
1165
1165
|
{
|
|
1166
1166
|
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
1167
1167
|
lookbehind: !0
|
|
@@ -1192,7 +1192,7 @@ var pe = { exports: {} };
|
|
|
1192
1192
|
lookbehind: !0
|
|
1193
1193
|
},
|
|
1194
1194
|
operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
1195
|
-
}),
|
|
1195
|
+
}), n.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, n.languages.insertBefore("javascript", "keyword", {
|
|
1196
1196
|
regex: {
|
|
1197
1197
|
pattern: RegExp(
|
|
1198
1198
|
// lookbehind
|
|
@@ -1212,7 +1212,7 @@ var pe = { exports: {} };
|
|
|
1212
1212
|
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
1213
1213
|
lookbehind: !0,
|
|
1214
1214
|
alias: "language-regex",
|
|
1215
|
-
inside:
|
|
1215
|
+
inside: n.languages.regex
|
|
1216
1216
|
},
|
|
1217
1217
|
"regex-delimiter": /^\/|\/$/,
|
|
1218
1218
|
"regex-flags": /^[a-z]+$/
|
|
@@ -1227,26 +1227,26 @@ var pe = { exports: {} };
|
|
|
1227
1227
|
{
|
|
1228
1228
|
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
1229
1229
|
lookbehind: !0,
|
|
1230
|
-
inside:
|
|
1230
|
+
inside: n.languages.javascript
|
|
1231
1231
|
},
|
|
1232
1232
|
{
|
|
1233
1233
|
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
1234
1234
|
lookbehind: !0,
|
|
1235
|
-
inside:
|
|
1235
|
+
inside: n.languages.javascript
|
|
1236
1236
|
},
|
|
1237
1237
|
{
|
|
1238
1238
|
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
1239
1239
|
lookbehind: !0,
|
|
1240
|
-
inside:
|
|
1240
|
+
inside: n.languages.javascript
|
|
1241
1241
|
},
|
|
1242
1242
|
{
|
|
1243
1243
|
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
|
|
1244
1244
|
lookbehind: !0,
|
|
1245
|
-
inside:
|
|
1245
|
+
inside: n.languages.javascript
|
|
1246
1246
|
}
|
|
1247
1247
|
],
|
|
1248
1248
|
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
1249
|
-
}),
|
|
1249
|
+
}), n.languages.insertBefore("javascript", "string", {
|
|
1250
1250
|
hashbang: {
|
|
1251
1251
|
pattern: /^#!.*/,
|
|
1252
1252
|
greedy: !0,
|
|
@@ -1268,7 +1268,7 @@ var pe = { exports: {} };
|
|
|
1268
1268
|
pattern: /^\$\{|\}$/,
|
|
1269
1269
|
alias: "punctuation"
|
|
1270
1270
|
},
|
|
1271
|
-
rest:
|
|
1271
|
+
rest: n.languages.javascript
|
|
1272
1272
|
}
|
|
1273
1273
|
},
|
|
1274
1274
|
string: /[\s\S]+/
|
|
@@ -1280,22 +1280,22 @@ var pe = { exports: {} };
|
|
|
1280
1280
|
greedy: !0,
|
|
1281
1281
|
alias: "property"
|
|
1282
1282
|
}
|
|
1283
|
-
}),
|
|
1283
|
+
}), n.languages.insertBefore("javascript", "operator", {
|
|
1284
1284
|
"literal-property": {
|
|
1285
1285
|
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
|
1286
1286
|
lookbehind: !0,
|
|
1287
1287
|
alias: "property"
|
|
1288
1288
|
}
|
|
1289
|
-
}),
|
|
1289
|
+
}), n.languages.markup && (n.languages.markup.tag.addInlined("script", "javascript"), n.languages.markup.tag.addAttribute(
|
|
1290
1290
|
/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
|
|
1291
1291
|
"javascript"
|
|
1292
|
-
)),
|
|
1293
|
-
if (typeof
|
|
1292
|
+
)), n.languages.js = n.languages.javascript, function() {
|
|
1293
|
+
if (typeof n > "u" || typeof document > "u")
|
|
1294
1294
|
return;
|
|
1295
1295
|
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
1296
|
-
var l = "Loading…",
|
|
1297
|
-
return "✖ Error " +
|
|
1298
|
-
},
|
|
1296
|
+
var l = "Loading…", h = function(g, p) {
|
|
1297
|
+
return "✖ Error " + g + " while fetching file: " + p;
|
|
1298
|
+
}, y = "✖ Error: File does not exist or is empty", A = {
|
|
1299
1299
|
js: "javascript",
|
|
1300
1300
|
py: "python",
|
|
1301
1301
|
rb: "ruby",
|
|
@@ -1305,56 +1305,56 @@ var pe = { exports: {} };
|
|
|
1305
1305
|
bat: "batch",
|
|
1306
1306
|
h: "c",
|
|
1307
1307
|
tex: "latex"
|
|
1308
|
-
},
|
|
1309
|
-
function
|
|
1308
|
+
}, s = "data-src-status", f = "loading", m = "loaded", T = "failed", L = "pre[data-src]:not([" + s + '="' + m + '"]):not([' + s + '="' + f + '"])';
|
|
1309
|
+
function I(g, p, S) {
|
|
1310
1310
|
var t = new XMLHttpRequest();
|
|
1311
|
-
t.open("GET",
|
|
1312
|
-
t.readyState == 4 && (t.status < 400 && t.responseText ?
|
|
1311
|
+
t.open("GET", g, !0), t.onreadystatechange = function() {
|
|
1312
|
+
t.readyState == 4 && (t.status < 400 && t.responseText ? p(t.responseText) : t.status >= 400 ? S(h(t.status, t.statusText)) : S(y));
|
|
1313
1313
|
}, t.send(null);
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1316
|
-
var
|
|
1317
|
-
if (
|
|
1318
|
-
var
|
|
1319
|
-
return t ? e ? [
|
|
1315
|
+
function C(g) {
|
|
1316
|
+
var p = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g || "");
|
|
1317
|
+
if (p) {
|
|
1318
|
+
var S = Number(p[1]), t = p[2], e = p[3];
|
|
1319
|
+
return t ? e ? [S, Number(e)] : [S, void 0] : [S, S];
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
}),
|
|
1325
|
-
var
|
|
1322
|
+
n.hooks.add("before-highlightall", function(g) {
|
|
1323
|
+
g.selector += ", " + L;
|
|
1324
|
+
}), n.hooks.add("before-sanity-check", function(g) {
|
|
1325
|
+
var p = (
|
|
1326
1326
|
/** @type {HTMLPreElement} */
|
|
1327
|
-
|
|
1327
|
+
g.element
|
|
1328
1328
|
);
|
|
1329
|
-
if (
|
|
1330
|
-
|
|
1331
|
-
var
|
|
1332
|
-
|
|
1333
|
-
var t =
|
|
1329
|
+
if (p.matches(L)) {
|
|
1330
|
+
g.code = "", p.setAttribute(s, f);
|
|
1331
|
+
var S = p.appendChild(document.createElement("CODE"));
|
|
1332
|
+
S.textContent = l;
|
|
1333
|
+
var t = p.getAttribute("data-src"), e = g.language;
|
|
1334
1334
|
if (e === "none") {
|
|
1335
|
-
var
|
|
1336
|
-
e = A[
|
|
1335
|
+
var a = (/\.(\w+)$/.exec(t) || [, "none"])[1];
|
|
1336
|
+
e = A[a] || a;
|
|
1337
1337
|
}
|
|
1338
|
-
|
|
1339
|
-
var
|
|
1340
|
-
|
|
1338
|
+
n.util.setLanguage(S, e), n.util.setLanguage(p, e);
|
|
1339
|
+
var r = n.plugins.autoloader;
|
|
1340
|
+
r && r.loadLanguages(e), I(
|
|
1341
1341
|
t,
|
|
1342
|
-
function(
|
|
1343
|
-
|
|
1344
|
-
var c =
|
|
1342
|
+
function(o) {
|
|
1343
|
+
p.setAttribute(s, m);
|
|
1344
|
+
var c = C(p.getAttribute("data-range"));
|
|
1345
1345
|
if (c) {
|
|
1346
|
-
var
|
|
1347
|
-
u < 0 && (u +=
|
|
1348
|
-
`),
|
|
1346
|
+
var b = o.split(/\r\n?|\n/g), u = c[0], k = c[1] == null ? b.length : c[1];
|
|
1347
|
+
u < 0 && (u += b.length), u = Math.max(0, Math.min(u - 1, b.length)), k < 0 && (k += b.length), k = Math.max(0, Math.min(k, b.length)), o = b.slice(u, k).join(`
|
|
1348
|
+
`), p.hasAttribute("data-start") || p.setAttribute("data-start", String(u + 1));
|
|
1349
1349
|
}
|
|
1350
|
-
|
|
1350
|
+
S.textContent = o, n.highlightElement(S);
|
|
1351
1351
|
},
|
|
1352
|
-
function(
|
|
1353
|
-
|
|
1352
|
+
function(o) {
|
|
1353
|
+
p.setAttribute(s, T), S.textContent = o;
|
|
1354
1354
|
}
|
|
1355
1355
|
);
|
|
1356
1356
|
}
|
|
1357
|
-
}),
|
|
1357
|
+
}), n.plugins.fileHighlight = {
|
|
1358
1358
|
/**
|
|
1359
1359
|
* Executes the File Highlight plugin for all matching `pre` elements under the given container.
|
|
1360
1360
|
*
|
|
@@ -1362,18 +1362,18 @@ var pe = { exports: {} };
|
|
|
1362
1362
|
*
|
|
1363
1363
|
* @param {ParentNode} [container=document]
|
|
1364
1364
|
*/
|
|
1365
|
-
highlight: function(
|
|
1366
|
-
for (var
|
|
1367
|
-
|
|
1365
|
+
highlight: function(p) {
|
|
1366
|
+
for (var S = (p || document).querySelectorAll(L), t = 0, e; e = S[t++]; )
|
|
1367
|
+
n.highlightElement(e);
|
|
1368
1368
|
}
|
|
1369
1369
|
};
|
|
1370
|
-
var
|
|
1371
|
-
|
|
1372
|
-
|
|
1370
|
+
var D = !1;
|
|
1371
|
+
n.fileHighlight = function() {
|
|
1372
|
+
D || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), D = !0), n.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
1373
1373
|
};
|
|
1374
1374
|
}();
|
|
1375
|
-
})(
|
|
1376
|
-
var De =
|
|
1375
|
+
})(ge);
|
|
1376
|
+
var De = ge.exports;
|
|
1377
1377
|
const re = /* @__PURE__ */ Ce(De);
|
|
1378
1378
|
Prism.languages.clike = {
|
|
1379
1379
|
comment: [
|
|
@@ -1632,9 +1632,9 @@ Prism.languages.insertBefore("go", "string", {
|
|
|
1632
1632
|
}
|
|
1633
1633
|
});
|
|
1634
1634
|
delete Prism.languages.go["class-name"];
|
|
1635
|
-
(function(
|
|
1636
|
-
var d = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,
|
|
1637
|
-
pattern: RegExp(/(^|[^\w.])/.source +
|
|
1635
|
+
(function(i) {
|
|
1636
|
+
var d = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, n = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, l = {
|
|
1637
|
+
pattern: RegExp(/(^|[^\w.])/.source + n + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
|
|
1638
1638
|
lookbehind: !0,
|
|
1639
1639
|
inside: {
|
|
1640
1640
|
namespace: {
|
|
@@ -1646,7 +1646,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1646
1646
|
punctuation: /\./
|
|
1647
1647
|
}
|
|
1648
1648
|
};
|
|
1649
|
-
|
|
1649
|
+
i.languages.java = i.languages.extend("clike", {
|
|
1650
1650
|
string: {
|
|
1651
1651
|
pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
|
|
1652
1652
|
lookbehind: !0,
|
|
@@ -1657,21 +1657,21 @@ delete Prism.languages.go["class-name"];
|
|
|
1657
1657
|
{
|
|
1658
1658
|
// variables, parameters, and constructor references
|
|
1659
1659
|
// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
|
|
1660
|
-
pattern: RegExp(/(^|[^\w.])/.source +
|
|
1660
|
+
pattern: RegExp(/(^|[^\w.])/.source + n + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),
|
|
1661
1661
|
lookbehind: !0,
|
|
1662
1662
|
inside: l.inside
|
|
1663
1663
|
},
|
|
1664
1664
|
{
|
|
1665
1665
|
// class names based on keyword
|
|
1666
1666
|
// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
|
|
1667
|
-
pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source +
|
|
1667
|
+
pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + n + /[A-Z]\w*\b/.source),
|
|
1668
1668
|
lookbehind: !0,
|
|
1669
1669
|
inside: l.inside
|
|
1670
1670
|
}
|
|
1671
1671
|
],
|
|
1672
1672
|
keyword: d,
|
|
1673
1673
|
function: [
|
|
1674
|
-
|
|
1674
|
+
i.languages.clike.function,
|
|
1675
1675
|
{
|
|
1676
1676
|
pattern: /(::\s*)[a-z_]\w*/,
|
|
1677
1677
|
lookbehind: !0
|
|
@@ -1683,7 +1683,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1683
1683
|
lookbehind: !0
|
|
1684
1684
|
},
|
|
1685
1685
|
constant: /\b[A-Z][A-Z_\d]+\b/
|
|
1686
|
-
}),
|
|
1686
|
+
}), i.languages.insertBefore("java", "string", {
|
|
1687
1687
|
"triple-quoted-string": {
|
|
1688
1688
|
// http://openjdk.java.net/jeps/355#Description
|
|
1689
1689
|
pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
|
|
@@ -1694,7 +1694,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1694
1694
|
pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
|
|
1695
1695
|
greedy: !0
|
|
1696
1696
|
}
|
|
1697
|
-
}),
|
|
1697
|
+
}), i.languages.insertBefore("java", "class-name", {
|
|
1698
1698
|
annotation: {
|
|
1699
1699
|
pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
|
|
1700
1700
|
lookbehind: !0,
|
|
@@ -1711,7 +1711,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1711
1711
|
},
|
|
1712
1712
|
import: [
|
|
1713
1713
|
{
|
|
1714
|
-
pattern: RegExp(/(\bimport\s+)/.source +
|
|
1714
|
+
pattern: RegExp(/(\bimport\s+)/.source + n + /(?:[A-Z]\w*|\*)(?=\s*;)/.source),
|
|
1715
1715
|
lookbehind: !0,
|
|
1716
1716
|
inside: {
|
|
1717
1717
|
namespace: l.inside.namespace,
|
|
@@ -1721,7 +1721,7 @@ delete Prism.languages.go["class-name"];
|
|
|
1721
1721
|
}
|
|
1722
1722
|
},
|
|
1723
1723
|
{
|
|
1724
|
-
pattern: RegExp(/(\bimport\s+static\s+)/.source +
|
|
1724
|
+
pattern: RegExp(/(\bimport\s+static\s+)/.source + n + /(?:\w+|\*)(?=\s*;)/.source),
|
|
1725
1725
|
lookbehind: !0,
|
|
1726
1726
|
alias: "static",
|
|
1727
1727
|
inside: {
|
|
@@ -1822,14 +1822,14 @@ Prism.languages.insertBefore("c", "function", {
|
|
|
1822
1822
|
constant: /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/
|
|
1823
1823
|
});
|
|
1824
1824
|
delete Prism.languages.c.boolean;
|
|
1825
|
-
(function(
|
|
1826
|
-
for (var d = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,
|
|
1825
|
+
(function(i) {
|
|
1826
|
+
for (var d = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, n = 0; n < 2; n++)
|
|
1827
1827
|
d = d.replace(/<self>/g, function() {
|
|
1828
1828
|
return d;
|
|
1829
1829
|
});
|
|
1830
1830
|
d = d.replace(/<self>/g, function() {
|
|
1831
1831
|
return /[^\s\S]/.source;
|
|
1832
|
-
}),
|
|
1832
|
+
}), i.languages.rust = {
|
|
1833
1833
|
comment: [
|
|
1834
1834
|
{
|
|
1835
1835
|
pattern: RegExp(/(^|[^\\])/.source + d),
|
|
@@ -1936,7 +1936,7 @@ delete Prism.languages.c.boolean;
|
|
|
1936
1936
|
boolean: /\b(?:false|true)\b/,
|
|
1937
1937
|
punctuation: /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,
|
|
1938
1938
|
operator: /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/
|
|
1939
|
-
},
|
|
1939
|
+
}, i.languages.rust["closure-params"].inside.rest = i.languages.rust, i.languages.rust.attribute.inside.string = i.languages.rust.string;
|
|
1940
1940
|
})(Prism);
|
|
1941
1941
|
Prism.languages.sql = {
|
|
1942
1942
|
comment: {
|
|
@@ -1971,8 +1971,8 @@ Prism.languages.sql = {
|
|
|
1971
1971
|
operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,
|
|
1972
1972
|
punctuation: /[;[\]()`,.]/
|
|
1973
1973
|
};
|
|
1974
|
-
(function(
|
|
1975
|
-
var d = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",
|
|
1974
|
+
(function(i) {
|
|
1975
|
+
var d = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", n = {
|
|
1976
1976
|
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
1977
1977
|
lookbehind: !0,
|
|
1978
1978
|
alias: "punctuation",
|
|
@@ -1980,7 +1980,7 @@ Prism.languages.sql = {
|
|
|
1980
1980
|
inside: null
|
|
1981
1981
|
// see below
|
|
1982
1982
|
}, l = {
|
|
1983
|
-
bash:
|
|
1983
|
+
bash: n,
|
|
1984
1984
|
environment: {
|
|
1985
1985
|
pattern: RegExp("\\$" + d),
|
|
1986
1986
|
alias: "constant"
|
|
@@ -2033,7 +2033,7 @@ Prism.languages.sql = {
|
|
|
2033
2033
|
// Escape sequences from echo and printf's manuals, and escaped quotes.
|
|
2034
2034
|
entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
|
|
2035
2035
|
};
|
|
2036
|
-
|
|
2036
|
+
i.languages.bash = {
|
|
2037
2037
|
shebang: {
|
|
2038
2038
|
pattern: /^#!\s*\/.*/,
|
|
2039
2039
|
alias: "important"
|
|
@@ -2100,7 +2100,7 @@ Prism.languages.sql = {
|
|
|
2100
2100
|
lookbehind: !0,
|
|
2101
2101
|
greedy: !0,
|
|
2102
2102
|
inside: {
|
|
2103
|
-
bash:
|
|
2103
|
+
bash: n
|
|
2104
2104
|
}
|
|
2105
2105
|
},
|
|
2106
2106
|
// “Normal” string
|
|
@@ -2169,8 +2169,8 @@ Prism.languages.sql = {
|
|
|
2169
2169
|
pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
|
|
2170
2170
|
lookbehind: !0
|
|
2171
2171
|
}
|
|
2172
|
-
},
|
|
2173
|
-
for (var
|
|
2172
|
+
}, n.inside = i.languages.bash;
|
|
2173
|
+
for (var h = [
|
|
2174
2174
|
"comment",
|
|
2175
2175
|
"function-name",
|
|
2176
2176
|
"for-or-select",
|
|
@@ -2186,9 +2186,9 @@ Prism.languages.sql = {
|
|
|
2186
2186
|
"operator",
|
|
2187
2187
|
"punctuation",
|
|
2188
2188
|
"number"
|
|
2189
|
-
],
|
|
2190
|
-
|
|
2191
|
-
|
|
2189
|
+
], y = l.variable[1].inside, A = 0; A < h.length; A++)
|
|
2190
|
+
y[h[A]] = i.languages.bash[h[A]];
|
|
2191
|
+
i.languages.sh = i.languages.bash, i.languages.shell = i.languages.bash;
|
|
2192
2192
|
})(Prism);
|
|
2193
2193
|
Prism.languages.json = {
|
|
2194
2194
|
property: {
|
|
@@ -2215,7 +2215,124 @@ Prism.languages.json = {
|
|
|
2215
2215
|
}
|
|
2216
2216
|
};
|
|
2217
2217
|
Prism.languages.webmanifest = Prism.languages.json;
|
|
2218
|
-
const Pe =
|
|
2218
|
+
const Pe = `
|
|
2219
|
+
.hep-cr-editor .token.comment,
|
|
2220
|
+
.hep-cr-editor .token.prolog,
|
|
2221
|
+
.hep-cr-editor .token.doctype,
|
|
2222
|
+
.hep-cr-editor .token.cdata {
|
|
2223
|
+
color: #8292a2 !important;
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
.hep-cr-editor .token.punctuation {
|
|
2227
|
+
color: #f8f8f2 !important;
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
.hep-cr-editor .token.property,
|
|
2231
|
+
.hep-cr-editor .token.tag,
|
|
2232
|
+
.hep-cr-editor .token.constant,
|
|
2233
|
+
.hep-cr-editor .token.symbol,
|
|
2234
|
+
.hep-cr-editor .token.deleted {
|
|
2235
|
+
color: #f92672 !important;
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
.hep-cr-editor .token.boolean,
|
|
2239
|
+
.hep-cr-editor .token.number {
|
|
2240
|
+
color: #ae81ff !important;
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
.hep-cr-editor .token.selector,
|
|
2244
|
+
.hep-cr-editor .token.attr-name,
|
|
2245
|
+
.hep-cr-editor .token.string,
|
|
2246
|
+
.hep-cr-editor .token.char,
|
|
2247
|
+
.hep-cr-editor .token.builtin,
|
|
2248
|
+
.hep-cr-editor .token.inserted {
|
|
2249
|
+
color: #a6e22e !important;
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2252
|
+
.hep-cr-editor .token.operator,
|
|
2253
|
+
.hep-cr-editor .token.entity,
|
|
2254
|
+
.hep-cr-editor .token.url,
|
|
2255
|
+
.hep-cr-editor .language-css .hep-cr-editor .token.string,
|
|
2256
|
+
.hep-cr-editor .style .hep-cr-editor .token.string,
|
|
2257
|
+
.hep-cr-editor .token.variable {
|
|
2258
|
+
color: #f8f8f2 !important;
|
|
2259
|
+
}
|
|
2260
|
+
|
|
2261
|
+
.hep-cr-editor .token.atrule,
|
|
2262
|
+
.hep-cr-editor .token.attr-value,
|
|
2263
|
+
.hep-cr-editor .token.function,
|
|
2264
|
+
.hep-cr-editor .token.class-name {
|
|
2265
|
+
color: #e6db74 !important;
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
.hep-cr-editor .token.keyword,
|
|
2269
|
+
.hep-cr-editor .token.keyword-control {
|
|
2270
|
+
color: #66d9ef !important;
|
|
2271
|
+
}
|
|
2272
|
+
|
|
2273
|
+
.hep-cr-editor .token.regex,
|
|
2274
|
+
.hep-cr-editor .token.important {
|
|
2275
|
+
color: #fd971f !important;
|
|
2276
|
+
}
|
|
2277
|
+
`, $e = `
|
|
2278
|
+
.hep-cr-editor .token.comment,
|
|
2279
|
+
.hep-cr-editor .token.prolog,
|
|
2280
|
+
.hep-cr-editor .token.doctype,
|
|
2281
|
+
.hep-cr-editor .token.cdata {
|
|
2282
|
+
color: #708090;
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
.hep-cr-editor .token.punctuation {
|
|
2286
|
+
color: #333;
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
.hep-cr-editor .token.property,
|
|
2290
|
+
.hep-cr-editor .token.tag,
|
|
2291
|
+
.hep-cr-editor .token.constant,
|
|
2292
|
+
.hep-cr-editor .token.symbol,
|
|
2293
|
+
.hep-cr-editor .token.deleted {
|
|
2294
|
+
color: #d73a49;
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
.hep-cr-editor .token.boolean,
|
|
2298
|
+
.hep-cr-editor .token.number {
|
|
2299
|
+
color: #005cc5;
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
.hep-cr-editor .token.selector,
|
|
2303
|
+
.hep-cr-editor .token.attr-name,
|
|
2304
|
+
.hep-cr-editor .token.string,
|
|
2305
|
+
.hep-cr-editor .token.char,
|
|
2306
|
+
.hep-cr-editor .token.builtin,
|
|
2307
|
+
.hep-cr-editor .token.inserted {
|
|
2308
|
+
color: #22863a;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
.hep-cr-editor .token.operator,
|
|
2312
|
+
.hep-cr-editor .token.entity,
|
|
2313
|
+
.hep-cr-editor .token.url,
|
|
2314
|
+
.hep-cr-editor .language-css .hep-cr-editor .token.string,
|
|
2315
|
+
.hep-cr-editor .style .hep-cr-editor .token.string,
|
|
2316
|
+
.hep-cr-editor .token.variable {
|
|
2317
|
+
color: #333;
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
.hep-cr-editor .token.atrule,
|
|
2321
|
+
.hep-cr-editor .token.attr-value,
|
|
2322
|
+
.hep-cr-editor .token.function,
|
|
2323
|
+
.hep-cr-editor .token.class-name {
|
|
2324
|
+
color: #6f42c1;
|
|
2325
|
+
}
|
|
2326
|
+
|
|
2327
|
+
.hep-cr-editor .token.keyword {
|
|
2328
|
+
color: #d73a49;
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
.hep-cr-editor .token.regex,
|
|
2332
|
+
.hep-cr-editor .token.important {
|
|
2333
|
+
color: #e36209;
|
|
2334
|
+
}
|
|
2335
|
+
`, Me = ["innerHTML"], Ue = ["value", "disabled"], He = /* @__PURE__ */ ie({
|
|
2219
2336
|
__name: "CodeEditor",
|
|
2220
2337
|
props: {
|
|
2221
2338
|
modelValue: {},
|
|
@@ -2224,11 +2341,18 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2224
2341
|
disabled: { type: Boolean, default: !1 }
|
|
2225
2342
|
},
|
|
2226
2343
|
emits: ["update:modelValue"],
|
|
2227
|
-
setup(
|
|
2228
|
-
|
|
2229
|
-
|
|
2344
|
+
setup(i, { emit: d }) {
|
|
2345
|
+
be((g) => ({
|
|
2346
|
+
v6d72dafb: m.value
|
|
2230
2347
|
})), typeof window < "u" && (window.Prism = re);
|
|
2231
|
-
|
|
2348
|
+
function n(g) {
|
|
2349
|
+
if (typeof document > "u") return;
|
|
2350
|
+
const p = "hep-cr-prism-styles", S = document.getElementById(p), t = g === "dark" ? Pe : $e;
|
|
2351
|
+
S && S.remove();
|
|
2352
|
+
const e = document.createElement("style");
|
|
2353
|
+
e.id = p, e.textContent = t, document.head.appendChild(e);
|
|
2354
|
+
}
|
|
2355
|
+
const l = i, h = d, y = N(null), A = N(null), s = {
|
|
2232
2356
|
javascript: "javascript",
|
|
2233
2357
|
js: "javascript",
|
|
2234
2358
|
typescript: "typescript",
|
|
@@ -2259,82 +2383,86 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2259
2383
|
yml: "yaml",
|
|
2260
2384
|
markdown: "markdown",
|
|
2261
2385
|
md: "markdown"
|
|
2262
|
-
},
|
|
2386
|
+
}, f = G(() => s[l.language.toLowerCase()] || "javascript"), m = G(() => l.theme === "dark" ? "#1e1e1e" : "#fafafa"), T = G(() => {
|
|
2263
2387
|
try {
|
|
2264
|
-
const
|
|
2265
|
-
if (
|
|
2266
|
-
return re.highlight(
|
|
2388
|
+
const g = re.languages[f.value];
|
|
2389
|
+
if (g)
|
|
2390
|
+
return re.highlight(l.modelValue || "", g, f.value);
|
|
2267
2391
|
} catch {
|
|
2268
2392
|
}
|
|
2269
|
-
return
|
|
2393
|
+
return L(l.modelValue || "");
|
|
2270
2394
|
});
|
|
2271
|
-
function
|
|
2272
|
-
const
|
|
2273
|
-
return
|
|
2395
|
+
function L(g) {
|
|
2396
|
+
const p = document.createElement("div");
|
|
2397
|
+
return p.textContent = g, p.innerHTML;
|
|
2274
2398
|
}
|
|
2275
|
-
function
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2399
|
+
function I(g) {
|
|
2400
|
+
const p = g.target;
|
|
2401
|
+
h("update:modelValue", p.value);
|
|
2278
2402
|
}
|
|
2279
|
-
function
|
|
2280
|
-
|
|
2403
|
+
function C() {
|
|
2404
|
+
y.value && A.value && (A.value.scrollTop = y.value.scrollTop, A.value.scrollLeft = y.value.scrollLeft);
|
|
2281
2405
|
}
|
|
2282
|
-
function D(
|
|
2283
|
-
if (
|
|
2284
|
-
|
|
2285
|
-
const
|
|
2286
|
-
|
|
2406
|
+
function D(g) {
|
|
2407
|
+
if (g.key === "Tab") {
|
|
2408
|
+
g.preventDefault();
|
|
2409
|
+
const p = g.target, S = p.selectionStart, t = p.selectionEnd, e = p.value;
|
|
2410
|
+
p.value = e.substring(0, S) + " " + e.substring(t), p.selectionStart = p.selectionEnd = S + 2, h("update:modelValue", p.value);
|
|
2287
2411
|
}
|
|
2288
2412
|
}
|
|
2289
|
-
return (
|
|
2290
|
-
|
|
2413
|
+
return pe(() => {
|
|
2414
|
+
n(l.theme);
|
|
2415
|
+
}), le(() => l.theme, (g) => {
|
|
2416
|
+
n(g);
|
|
2417
|
+
}), (g, p) => (_(), R("div", {
|
|
2418
|
+
class: W(["hep-cr-editor", `hep-cr-theme-${i.theme}`])
|
|
2291
2419
|
}, [
|
|
2292
|
-
|
|
2420
|
+
E("pre", {
|
|
2293
2421
|
ref_key: "highlightRef",
|
|
2294
|
-
ref:
|
|
2295
|
-
class: W(["hep-cr-highlight", [`language-${
|
|
2422
|
+
ref: A,
|
|
2423
|
+
class: W(["hep-cr-highlight", [`language-${f.value}`, `hep-cr-prism-${i.theme}`]]),
|
|
2296
2424
|
"aria-hidden": "true"
|
|
2297
2425
|
}, [
|
|
2298
|
-
|
|
2426
|
+
E("code", { innerHTML: T.value }, null, 8, Me)
|
|
2299
2427
|
], 2),
|
|
2300
|
-
|
|
2428
|
+
E("textarea", {
|
|
2301
2429
|
ref_key: "codeRef",
|
|
2302
|
-
ref:
|
|
2430
|
+
ref: y,
|
|
2303
2431
|
class: "hep-cr-input",
|
|
2304
|
-
value:
|
|
2305
|
-
disabled:
|
|
2306
|
-
onInput:
|
|
2307
|
-
onScroll:
|
|
2432
|
+
value: i.modelValue,
|
|
2433
|
+
disabled: i.disabled,
|
|
2434
|
+
onInput: I,
|
|
2435
|
+
onScroll: C,
|
|
2308
2436
|
onKeydown: D,
|
|
2309
2437
|
spellcheck: "false",
|
|
2310
2438
|
placeholder: "Write your code here..."
|
|
2311
|
-
}, null, 40,
|
|
2439
|
+
}, null, 40, Ue)
|
|
2312
2440
|
], 2));
|
|
2313
2441
|
}
|
|
2314
|
-
}),
|
|
2315
|
-
const
|
|
2316
|
-
for (const [l,
|
|
2317
|
-
|
|
2318
|
-
return
|
|
2319
|
-
},
|
|
2442
|
+
}), he = (i, d) => {
|
|
2443
|
+
const n = i.__vccOpts || i;
|
|
2444
|
+
for (const [l, h] of d)
|
|
2445
|
+
n[l] = h;
|
|
2446
|
+
return n;
|
|
2447
|
+
}, Be = /* @__PURE__ */ he(He, [["__scopeId", "data-v-bf752fa5"]]), Ge = { class: "hep-cr-header" }, ze = { class: "hep-cr-controls" }, je = ["disabled"], We = {
|
|
2320
2448
|
key: 0,
|
|
2321
2449
|
value: ""
|
|
2322
|
-
},
|
|
2450
|
+
}, Ve = ["value"], Ye = { class: "hep-cr-actions" }, Xe = ["disabled"], Ze = {
|
|
2323
2451
|
key: 0,
|
|
2324
2452
|
class: "hep-cr-spinner"
|
|
2325
|
-
},
|
|
2453
|
+
}, Ke = {
|
|
2326
2454
|
key: 1,
|
|
2327
2455
|
class: "hep-cr-run-icon"
|
|
2328
|
-
},
|
|
2456
|
+
}, qe = ["title"], Je = {
|
|
2329
2457
|
key: 0,
|
|
2330
2458
|
class: "hep-cr-error"
|
|
2331
|
-
},
|
|
2459
|
+
}, Qe = { class: "hep-cr-main" }, et = { class: "hep-cr-panel-header" }, tt = { class: "hep-cr-language-badge" }, nt = { class: "hep-cr-panel-header" }, at = { class: "hep-cr-output-tabs" }, rt = { class: "hep-cr-output-actions" }, st = {
|
|
2332
2460
|
key: 0,
|
|
2333
2461
|
class: "hep-cr-execution-time"
|
|
2334
|
-
},
|
|
2462
|
+
}, ot = { class: "hep-cr-output-content" }, it = { key: 0 }, lt = {
|
|
2335
2463
|
key: 1,
|
|
2336
2464
|
class: "hep-cr-stderr"
|
|
2337
|
-
},
|
|
2465
|
+
}, ut = /* @__PURE__ */ ie({
|
|
2338
2466
|
__name: "CodeRunner",
|
|
2339
2467
|
props: {
|
|
2340
2468
|
pistonUrl: { default: "/api/piston" },
|
|
@@ -2347,173 +2475,173 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2347
2475
|
executorLabel: { default: "运行" }
|
|
2348
2476
|
},
|
|
2349
2477
|
emits: ["execute-start", "execute-end", "language-change"],
|
|
2350
|
-
setup(
|
|
2351
|
-
const
|
|
2352
|
-
function
|
|
2478
|
+
setup(i, { emit: d }) {
|
|
2479
|
+
const n = i, l = d, h = N([]), y = N(n.language), A = N(n.theme), s = N(""), f = N(""), m = N(""), T = N(!1), L = N(null), I = N("stdout"), C = N(null), D = N(!1), g = N(60);
|
|
2480
|
+
function p() {
|
|
2353
2481
|
A.value = A.value === "light" ? "dark" : "light";
|
|
2354
2482
|
}
|
|
2355
|
-
const
|
|
2356
|
-
() => new
|
|
2357
|
-
), t = G(() =>
|
|
2358
|
-
value: `${
|
|
2359
|
-
label: `${
|
|
2483
|
+
const S = G(
|
|
2484
|
+
() => new Le({ pistonUrl: n.pistonUrl })
|
|
2485
|
+
), t = G(() => h.value.map((v) => ({
|
|
2486
|
+
value: `${v.language}:${v.version}`,
|
|
2487
|
+
label: `${v.language.charAt(0).toUpperCase() + v.language.slice(1)} ${v.version}`
|
|
2360
2488
|
}))), e = G(() => {
|
|
2361
|
-
const
|
|
2362
|
-
return
|
|
2489
|
+
const v = y.value;
|
|
2490
|
+
return v.includes(":") ? v.split(":")[0] : v;
|
|
2363
2491
|
});
|
|
2364
|
-
async function
|
|
2365
|
-
|
|
2492
|
+
async function a() {
|
|
2493
|
+
D.value = !0, C.value = null;
|
|
2366
2494
|
try {
|
|
2367
|
-
|
|
2368
|
-
} catch (
|
|
2369
|
-
|
|
2495
|
+
h.value = await S.value.getRuntimes();
|
|
2496
|
+
} catch (v) {
|
|
2497
|
+
C.value = v instanceof Error ? v.message : "Failed to load runtimes";
|
|
2370
2498
|
} finally {
|
|
2371
|
-
|
|
2499
|
+
D.value = !1;
|
|
2372
2500
|
}
|
|
2373
2501
|
}
|
|
2374
|
-
|
|
2375
|
-
const w =
|
|
2376
|
-
|
|
2502
|
+
le(y, (v) => {
|
|
2503
|
+
const w = v.includes(":") ? v.split(":")[0] : v, x = ae(w);
|
|
2504
|
+
s.value = x, l("language-change", w, x);
|
|
2377
2505
|
});
|
|
2378
|
-
async function
|
|
2379
|
-
if (!
|
|
2380
|
-
|
|
2506
|
+
async function r() {
|
|
2507
|
+
if (!T.value) {
|
|
2508
|
+
T.value = !0, f.value = "", m.value = "", L.value = null, C.value = null, I.value = "stdout", l("execute-start");
|
|
2381
2509
|
try {
|
|
2382
|
-
const
|
|
2383
|
-
|
|
2384
|
-
} catch (
|
|
2385
|
-
|
|
2510
|
+
const v = await S.value.execute(e.value, s.value);
|
|
2511
|
+
f.value = v.output, m.value = v.stderr, L.value = v.executionTime || null, I.value = v.stderr ? "stderr" : "stdout", l("execute-end", v);
|
|
2512
|
+
} catch (v) {
|
|
2513
|
+
C.value = v instanceof Error ? v.message : "Execution failed", l("execute-end", {
|
|
2386
2514
|
success: !1,
|
|
2387
2515
|
output: "",
|
|
2388
|
-
stderr:
|
|
2516
|
+
stderr: C.value,
|
|
2389
2517
|
code: -1
|
|
2390
2518
|
});
|
|
2391
2519
|
} finally {
|
|
2392
|
-
|
|
2520
|
+
T.value = !1;
|
|
2393
2521
|
}
|
|
2394
2522
|
}
|
|
2395
2523
|
}
|
|
2396
|
-
function
|
|
2397
|
-
|
|
2524
|
+
function o() {
|
|
2525
|
+
f.value = "", m.value = "", L.value = null, C.value = null;
|
|
2398
2526
|
}
|
|
2399
2527
|
async function c() {
|
|
2400
|
-
const
|
|
2401
|
-
await navigator.clipboard.writeText(
|
|
2528
|
+
const v = I.value === "stdout" ? f.value : m.value;
|
|
2529
|
+
await navigator.clipboard.writeText(v);
|
|
2402
2530
|
}
|
|
2403
|
-
function
|
|
2404
|
-
|
|
2531
|
+
function b() {
|
|
2532
|
+
s.value = ae(e.value);
|
|
2405
2533
|
}
|
|
2406
2534
|
let u = !1;
|
|
2407
|
-
function
|
|
2408
|
-
u = !0, document.addEventListener("mousemove",
|
|
2535
|
+
function k(v) {
|
|
2536
|
+
u = !0, document.addEventListener("mousemove", F), document.addEventListener("mouseup", P), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
2409
2537
|
}
|
|
2410
|
-
function
|
|
2538
|
+
function F(v) {
|
|
2411
2539
|
if (!u) return;
|
|
2412
2540
|
const w = document.querySelector(
|
|
2413
2541
|
".hep-cr-main"
|
|
2414
2542
|
);
|
|
2415
2543
|
if (!w) return;
|
|
2416
|
-
const
|
|
2417
|
-
|
|
2544
|
+
const x = w.getBoundingClientRect(), Y = (v.clientX - x.left) / x.width * 100;
|
|
2545
|
+
g.value = Math.max(20, Math.min(80, Y));
|
|
2418
2546
|
}
|
|
2419
2547
|
function P() {
|
|
2420
|
-
u = !1, document.removeEventListener("mousemove",
|
|
2548
|
+
u = !1, document.removeEventListener("mousemove", F), document.removeEventListener("mouseup", P), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
2421
2549
|
}
|
|
2422
|
-
|
|
2423
|
-
await
|
|
2550
|
+
pe(async () => {
|
|
2551
|
+
await a(), s.value || (s.value = n.defaultCode || ae(y.value));
|
|
2424
2552
|
});
|
|
2425
2553
|
const V = G(() => `hep-cr-runner-${A.value}`);
|
|
2426
|
-
return (
|
|
2554
|
+
return (v, w) => (_(), R("div", {
|
|
2427
2555
|
class: W(["hep-cr-runner", V.value])
|
|
2428
2556
|
}, [
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2557
|
+
E("div", Ge, [
|
|
2558
|
+
E("div", ze, [
|
|
2559
|
+
i.showLanguageSelector ? Ee((_(), R("select", {
|
|
2432
2560
|
key: 0,
|
|
2433
|
-
"onUpdate:modelValue": w[0] || (w[0] = (
|
|
2561
|
+
"onUpdate:modelValue": w[0] || (w[0] = (x) => y.value = x),
|
|
2434
2562
|
class: "hep-cr-language-select",
|
|
2435
|
-
disabled:
|
|
2563
|
+
disabled: T.value
|
|
2436
2564
|
}, [
|
|
2437
|
-
|
|
2438
|
-
(
|
|
2439
|
-
key:
|
|
2440
|
-
value:
|
|
2441
|
-
}, H(
|
|
2442
|
-
], 8,
|
|
2443
|
-
[Ae,
|
|
2565
|
+
D.value ? (_(), R("option", We, "加载中...")) : U("", !0),
|
|
2566
|
+
(_(!0), R(ve, null, ye(t.value, (x) => (_(), R("option", {
|
|
2567
|
+
key: x.value,
|
|
2568
|
+
value: x.value
|
|
2569
|
+
}, H(x.label), 9, Ve))), 128))
|
|
2570
|
+
], 8, je)), [
|
|
2571
|
+
[Ae, y.value]
|
|
2444
2572
|
]) : U("", !0)
|
|
2445
2573
|
]),
|
|
2446
|
-
|
|
2447
|
-
|
|
2574
|
+
E("div", Ye, [
|
|
2575
|
+
E("button", {
|
|
2448
2576
|
class: "hep-cr-btn hep-cr-btn-run",
|
|
2449
|
-
disabled:
|
|
2450
|
-
onClick:
|
|
2577
|
+
disabled: T.value || D.value,
|
|
2578
|
+
onClick: r
|
|
2451
2579
|
}, [
|
|
2452
|
-
|
|
2453
|
-
Se(" " + H(
|
|
2454
|
-
], 8,
|
|
2455
|
-
|
|
2580
|
+
T.value ? (_(), R("span", Ze)) : (_(), R("span", Ke, "▶")),
|
|
2581
|
+
Se(" " + H(T.value ? "运行中..." : i.executorLabel), 1)
|
|
2582
|
+
], 8, Xe),
|
|
2583
|
+
i.showEditor && i.editable ? (_(), R("button", {
|
|
2456
2584
|
key: 0,
|
|
2457
2585
|
class: "hep-cr-btn hep-cr-btn-reset",
|
|
2458
|
-
onClick:
|
|
2586
|
+
onClick: b
|
|
2459
2587
|
}, " 重置 ")) : U("", !0),
|
|
2460
|
-
|
|
2588
|
+
E("button", {
|
|
2461
2589
|
class: "hep-cr-btn hep-cr-btn-theme",
|
|
2462
|
-
onClick:
|
|
2590
|
+
onClick: p,
|
|
2463
2591
|
title: A.value === "light" ? "Switch to dark mode" : "Switch to light mode"
|
|
2464
|
-
}, H(A.value === "light" ? "🌙" : "☀️"), 9,
|
|
2592
|
+
}, H(A.value === "light" ? "🌙" : "☀️"), 9, qe)
|
|
2465
2593
|
])
|
|
2466
2594
|
]),
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2595
|
+
C.value ? (_(), R("div", Je, H(C.value), 1)) : U("", !0),
|
|
2596
|
+
E("div", Qe, [
|
|
2597
|
+
i.showEditor ? (_(), R("div", {
|
|
2470
2598
|
key: 0,
|
|
2471
2599
|
class: "hep-cr-editor-panel",
|
|
2472
|
-
style: se({ width:
|
|
2600
|
+
style: se({ width: g.value + "%" })
|
|
2473
2601
|
}, [
|
|
2474
|
-
|
|
2475
|
-
w[4] || (w[4] =
|
|
2476
|
-
|
|
2602
|
+
E("div", et, [
|
|
2603
|
+
w[4] || (w[4] = E("span", { class: "hep-cr-panel-title" }, "编辑器", -1)),
|
|
2604
|
+
E("span", tt, H(e.value), 1)
|
|
2477
2605
|
]),
|
|
2478
|
-
|
|
2479
|
-
modelValue:
|
|
2480
|
-
"onUpdate:modelValue": w[1] || (w[1] = (
|
|
2606
|
+
oe(Be, {
|
|
2607
|
+
modelValue: s.value,
|
|
2608
|
+
"onUpdate:modelValue": w[1] || (w[1] = (x) => s.value = x),
|
|
2481
2609
|
language: e.value,
|
|
2482
2610
|
theme: A.value,
|
|
2483
|
-
disabled: !
|
|
2611
|
+
disabled: !i.editable || T.value
|
|
2484
2612
|
}, null, 8, ["modelValue", "language", "theme", "disabled"])
|
|
2485
2613
|
], 4)) : U("", !0),
|
|
2486
|
-
|
|
2614
|
+
i.showEditor ? (_(), R("div", {
|
|
2487
2615
|
key: 1,
|
|
2488
2616
|
class: "hep-cr-resize-handle",
|
|
2489
|
-
onMousedown:
|
|
2617
|
+
onMousedown: k
|
|
2490
2618
|
}, [...w[5] || (w[5] = [
|
|
2491
|
-
|
|
2619
|
+
E("div", { class: "hep-cr-resize-line" }, null, -1)
|
|
2492
2620
|
])], 32)) : U("", !0),
|
|
2493
|
-
|
|
2621
|
+
E("div", {
|
|
2494
2622
|
class: "hep-cr-output-panel",
|
|
2495
|
-
style: se({ width:
|
|
2623
|
+
style: se({ width: i.showEditor ? 100 - g.value + "%" : "100%" })
|
|
2496
2624
|
}, [
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
class: W(["hep-cr-tab", { active:
|
|
2501
|
-
onClick: w[2] || (w[2] = (
|
|
2625
|
+
E("div", nt, [
|
|
2626
|
+
E("div", at, [
|
|
2627
|
+
E("button", {
|
|
2628
|
+
class: W(["hep-cr-tab", { active: I.value === "stdout" }]),
|
|
2629
|
+
onClick: w[2] || (w[2] = (x) => I.value = "stdout")
|
|
2502
2630
|
}, " 输出 ", 2),
|
|
2503
|
-
|
|
2631
|
+
m.value ? (_(), R("button", {
|
|
2504
2632
|
key: 0,
|
|
2505
|
-
class: W(["hep-cr-tab", { active:
|
|
2506
|
-
onClick: w[3] || (w[3] = (
|
|
2633
|
+
class: W(["hep-cr-tab", { active: I.value === "stderr" }]),
|
|
2634
|
+
onClick: w[3] || (w[3] = (x) => I.value = "stderr")
|
|
2507
2635
|
}, " 错误 ", 2)) : U("", !0)
|
|
2508
2636
|
]),
|
|
2509
|
-
|
|
2510
|
-
L.value !== null ? (
|
|
2511
|
-
|
|
2637
|
+
E("div", rt, [
|
|
2638
|
+
L.value !== null ? (_(), R("span", st, H(L.value) + "ms ", 1)) : U("", !0),
|
|
2639
|
+
E("button", {
|
|
2512
2640
|
class: "hep-cr-btn-icon",
|
|
2513
2641
|
onClick: c,
|
|
2514
2642
|
title: "复制"
|
|
2515
2643
|
}, [...w[6] || (w[6] = [
|
|
2516
|
-
|
|
2644
|
+
E("svg", {
|
|
2517
2645
|
width: "14",
|
|
2518
2646
|
height: "14",
|
|
2519
2647
|
viewBox: "0 0 24 24",
|
|
@@ -2521,7 +2649,7 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2521
2649
|
stroke: "currentColor",
|
|
2522
2650
|
"stroke-width": "2"
|
|
2523
2651
|
}, [
|
|
2524
|
-
|
|
2652
|
+
E("rect", {
|
|
2525
2653
|
x: "9",
|
|
2526
2654
|
y: "9",
|
|
2527
2655
|
width: "13",
|
|
@@ -2529,15 +2657,15 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2529
2657
|
rx: "2",
|
|
2530
2658
|
ry: "2"
|
|
2531
2659
|
}),
|
|
2532
|
-
|
|
2660
|
+
E("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
2533
2661
|
], -1)
|
|
2534
2662
|
])]),
|
|
2535
|
-
|
|
2663
|
+
E("button", {
|
|
2536
2664
|
class: "hep-cr-btn-icon",
|
|
2537
|
-
onClick:
|
|
2665
|
+
onClick: o,
|
|
2538
2666
|
title: "清除"
|
|
2539
2667
|
}, [...w[7] || (w[7] = [
|
|
2540
|
-
|
|
2668
|
+
E("svg", {
|
|
2541
2669
|
width: "14",
|
|
2542
2670
|
height: "14",
|
|
2543
2671
|
viewBox: "0 0 24 24",
|
|
@@ -2545,23 +2673,23 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2545
2673
|
stroke: "currentColor",
|
|
2546
2674
|
"stroke-width": "2"
|
|
2547
2675
|
}, [
|
|
2548
|
-
|
|
2549
|
-
|
|
2676
|
+
E("polyline", { points: "3 6 5 6 21 6" }),
|
|
2677
|
+
E("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
2550
2678
|
], -1)
|
|
2551
2679
|
])])
|
|
2552
2680
|
])
|
|
2553
2681
|
]),
|
|
2554
|
-
|
|
2555
|
-
|
|
2682
|
+
E("div", ot, [
|
|
2683
|
+
I.value === "stdout" ? (_(), R("pre", it, H(f.value || '点击"运行"执行代码'), 1)) : (_(), R("pre", lt, H(m.value), 1))
|
|
2556
2684
|
])
|
|
2557
2685
|
], 4)
|
|
2558
2686
|
])
|
|
2559
2687
|
], 2));
|
|
2560
2688
|
}
|
|
2561
|
-
}), J = /* @__PURE__ */
|
|
2689
|
+
}), J = /* @__PURE__ */ he(ut, [["__scopeId", "data-v-f4bf7f21"]]), ct = { class: "hep-cr-dialog-header" }, dt = { class: "hep-cr-dialog-title" }, pt = { class: "hep-cr-dialog-body" }, gt = {
|
|
2562
2690
|
key: 0,
|
|
2563
2691
|
class: "hep-cr-dialog-footer"
|
|
2564
|
-
},
|
|
2692
|
+
}, ft = /* @__PURE__ */ ie({
|
|
2565
2693
|
__name: "CodeRunnerDialog",
|
|
2566
2694
|
props: {
|
|
2567
2695
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -2577,41 +2705,41 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2577
2705
|
executorLabel: { default: "运行" }
|
|
2578
2706
|
},
|
|
2579
2707
|
emits: ["update:modelValue", "close"],
|
|
2580
|
-
setup(
|
|
2581
|
-
const l =
|
|
2582
|
-
|
|
2708
|
+
setup(i, { expose: d, emit: n }) {
|
|
2709
|
+
const l = i, h = n, y = N(l.modelValue), A = G(() => l.modelValue !== void 0 ? l.modelValue : y.value);
|
|
2710
|
+
le(
|
|
2583
2711
|
() => l.modelValue,
|
|
2584
|
-
(
|
|
2585
|
-
|
|
2712
|
+
(m) => {
|
|
2713
|
+
m !== void 0 && (y.value = m);
|
|
2586
2714
|
}
|
|
2587
2715
|
);
|
|
2588
|
-
function
|
|
2589
|
-
|
|
2716
|
+
function s() {
|
|
2717
|
+
y.value = !1, h("update:modelValue", !1), h("close");
|
|
2590
2718
|
}
|
|
2591
|
-
function
|
|
2592
|
-
|
|
2719
|
+
function f(m) {
|
|
2720
|
+
m.target === m.currentTarget && s();
|
|
2593
2721
|
}
|
|
2594
2722
|
return d({
|
|
2595
|
-
close:
|
|
2596
|
-
}), (
|
|
2597
|
-
|
|
2723
|
+
close: s
|
|
2724
|
+
}), (m, T) => (_(), ke(we, { to: "body" }, [
|
|
2725
|
+
oe(Te, { name: "hep-cr-dialog-fade" }, {
|
|
2598
2726
|
default: Ie(() => [
|
|
2599
|
-
A.value ? (
|
|
2727
|
+
A.value ? (_(), R("div", {
|
|
2600
2728
|
key: 0,
|
|
2601
2729
|
class: "hep-cr-dialog-overlay",
|
|
2602
|
-
onClick:
|
|
2730
|
+
onClick: f
|
|
2603
2731
|
}, [
|
|
2604
|
-
|
|
2732
|
+
E("div", {
|
|
2605
2733
|
class: "hep-cr-dialog-container",
|
|
2606
|
-
style: se({ width: typeof
|
|
2734
|
+
style: se({ width: typeof i.width == "number" ? i.width + "px" : i.width })
|
|
2607
2735
|
}, [
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2736
|
+
E("div", ct, [
|
|
2737
|
+
E("h3", dt, H(i.title), 1),
|
|
2738
|
+
E("button", {
|
|
2611
2739
|
class: "hep-cr-dialog-close",
|
|
2612
|
-
onClick:
|
|
2613
|
-
}, [...
|
|
2614
|
-
|
|
2740
|
+
onClick: s
|
|
2741
|
+
}, [...T[0] || (T[0] = [
|
|
2742
|
+
E("svg", {
|
|
2615
2743
|
width: "16",
|
|
2616
2744
|
height: "16",
|
|
2617
2745
|
viewBox: "0 0 24 24",
|
|
@@ -2619,13 +2747,13 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2619
2747
|
stroke: "currentColor",
|
|
2620
2748
|
"stroke-width": "2"
|
|
2621
2749
|
}, [
|
|
2622
|
-
|
|
2750
|
+
E("line", {
|
|
2623
2751
|
x1: "18",
|
|
2624
2752
|
y1: "6",
|
|
2625
2753
|
x2: "6",
|
|
2626
2754
|
y2: "18"
|
|
2627
2755
|
}),
|
|
2628
|
-
|
|
2756
|
+
E("line", {
|
|
2629
2757
|
x1: "6",
|
|
2630
2758
|
y1: "6",
|
|
2631
2759
|
x2: "18",
|
|
@@ -2634,11 +2762,11 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2634
2762
|
], -1)
|
|
2635
2763
|
])])
|
|
2636
2764
|
]),
|
|
2637
|
-
|
|
2638
|
-
|
|
2765
|
+
E("div", pt, [
|
|
2766
|
+
oe(J, Fe(_e(m.$attrs)), null, 16)
|
|
2639
2767
|
]),
|
|
2640
|
-
|
|
2641
|
-
Re(
|
|
2768
|
+
m.$slots.footer ? (_(), R("div", gt, [
|
|
2769
|
+
Re(m.$slots, "footer", { close: s })
|
|
2642
2770
|
])) : U("", !0)
|
|
2643
2771
|
], 4)
|
|
2644
2772
|
])) : U("", !0)
|
|
@@ -2648,16 +2776,16 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2648
2776
|
]));
|
|
2649
2777
|
}
|
|
2650
2778
|
});
|
|
2651
|
-
J.install = (
|
|
2652
|
-
|
|
2779
|
+
J.install = (i) => {
|
|
2780
|
+
i.component("CodeRunner", J);
|
|
2653
2781
|
};
|
|
2654
|
-
const
|
|
2655
|
-
install(
|
|
2656
|
-
|
|
2782
|
+
const mt = {
|
|
2783
|
+
install(i) {
|
|
2784
|
+
i.component("CodeRunner", J);
|
|
2657
2785
|
}
|
|
2658
2786
|
};
|
|
2659
2787
|
export {
|
|
2660
2788
|
J as CodeRunner,
|
|
2661
|
-
|
|
2662
|
-
|
|
2789
|
+
ft as CodeRunnerDialog,
|
|
2790
|
+
mt as default
|
|
2663
2791
|
};
|