@hep-code-runner/vue3 1.4.0 → 1.5.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/dist/index.d.ts +1 -1
- package/dist/index.js +119 -3
- package/dist/index.mjs +652 -525
- package/dist/style.css +1 -1
- package/package.json +1 -1
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,123 @@ 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;
|
|
2224
|
+
}
|
|
2225
|
+
|
|
2226
|
+
.hep-cr-editor .token.punctuation {
|
|
2227
|
+
color: #f8f8f2;
|
|
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;
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
.hep-cr-editor .token.boolean,
|
|
2239
|
+
.hep-cr-editor .token.number {
|
|
2240
|
+
color: #ae81ff;
|
|
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;
|
|
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;
|
|
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;
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
.hep-cr-editor .token.keyword {
|
|
2269
|
+
color: #66d9ef;
|
|
2270
|
+
}
|
|
2271
|
+
|
|
2272
|
+
.hep-cr-editor .token.regex,
|
|
2273
|
+
.hep-cr-editor .token.important {
|
|
2274
|
+
color: #fd971f;
|
|
2275
|
+
}
|
|
2276
|
+
`, $e = `
|
|
2277
|
+
.hep-cr-editor .token.comment,
|
|
2278
|
+
.hep-cr-editor .token.prolog,
|
|
2279
|
+
.hep-cr-editor .token.doctype,
|
|
2280
|
+
.hep-cr-editor .token.cdata {
|
|
2281
|
+
color: #708090;
|
|
2282
|
+
}
|
|
2283
|
+
|
|
2284
|
+
.hep-cr-editor .token.punctuation {
|
|
2285
|
+
color: #333;
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
.hep-cr-editor .token.property,
|
|
2289
|
+
.hep-cr-editor .token.tag,
|
|
2290
|
+
.hep-cr-editor .token.constant,
|
|
2291
|
+
.hep-cr-editor .token.symbol,
|
|
2292
|
+
.hep-cr-editor .token.deleted {
|
|
2293
|
+
color: #d73a49;
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
.hep-cr-editor .token.boolean,
|
|
2297
|
+
.hep-cr-editor .token.number {
|
|
2298
|
+
color: #005cc5;
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
.hep-cr-editor .token.selector,
|
|
2302
|
+
.hep-cr-editor .token.attr-name,
|
|
2303
|
+
.hep-cr-editor .token.string,
|
|
2304
|
+
.hep-cr-editor .token.char,
|
|
2305
|
+
.hep-cr-editor .token.builtin,
|
|
2306
|
+
.hep-cr-editor .token.inserted {
|
|
2307
|
+
color: #22863a;
|
|
2308
|
+
}
|
|
2309
|
+
|
|
2310
|
+
.hep-cr-editor .token.operator,
|
|
2311
|
+
.hep-cr-editor .token.entity,
|
|
2312
|
+
.hep-cr-editor .token.url,
|
|
2313
|
+
.hep-cr-editor .language-css .hep-cr-editor .token.string,
|
|
2314
|
+
.hep-cr-editor .style .hep-cr-editor .token.string,
|
|
2315
|
+
.hep-cr-editor .token.variable {
|
|
2316
|
+
color: #333;
|
|
2317
|
+
}
|
|
2318
|
+
|
|
2319
|
+
.hep-cr-editor .token.atrule,
|
|
2320
|
+
.hep-cr-editor .token.attr-value,
|
|
2321
|
+
.hep-cr-editor .token.function,
|
|
2322
|
+
.hep-cr-editor .token.class-name {
|
|
2323
|
+
color: #6f42c1;
|
|
2324
|
+
}
|
|
2325
|
+
|
|
2326
|
+
.hep-cr-editor .token.keyword {
|
|
2327
|
+
color: #d73a49;
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2330
|
+
.hep-cr-editor .token.regex,
|
|
2331
|
+
.hep-cr-editor .token.important {
|
|
2332
|
+
color: #e36209;
|
|
2333
|
+
}
|
|
2334
|
+
`, Me = ["innerHTML"], Ue = ["value", "disabled"], He = /* @__PURE__ */ ie({
|
|
2219
2335
|
__name: "CodeEditor",
|
|
2220
2336
|
props: {
|
|
2221
2337
|
modelValue: {},
|
|
@@ -2224,11 +2340,18 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2224
2340
|
disabled: { type: Boolean, default: !1 }
|
|
2225
2341
|
},
|
|
2226
2342
|
emits: ["update:modelValue"],
|
|
2227
|
-
setup(
|
|
2228
|
-
|
|
2229
|
-
|
|
2343
|
+
setup(i, { emit: d }) {
|
|
2344
|
+
be((g) => ({
|
|
2345
|
+
v0de6db6b: m.value
|
|
2230
2346
|
})), typeof window < "u" && (window.Prism = re);
|
|
2231
|
-
|
|
2347
|
+
function n(g) {
|
|
2348
|
+
if (typeof document > "u") return;
|
|
2349
|
+
const p = "hep-cr-prism-styles";
|
|
2350
|
+
let S = document.getElementById(p);
|
|
2351
|
+
const t = g === "dark" ? Pe : $e;
|
|
2352
|
+
S ? S.textContent = t : (S = document.createElement("style"), S.id = p, S.textContent = t, document.head.appendChild(S));
|
|
2353
|
+
}
|
|
2354
|
+
const l = i, h = d, y = N(null), A = N(null), s = {
|
|
2232
2355
|
javascript: "javascript",
|
|
2233
2356
|
js: "javascript",
|
|
2234
2357
|
typescript: "typescript",
|
|
@@ -2259,82 +2382,86 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2259
2382
|
yml: "yaml",
|
|
2260
2383
|
markdown: "markdown",
|
|
2261
2384
|
md: "markdown"
|
|
2262
|
-
},
|
|
2385
|
+
}, f = G(() => s[l.language.toLowerCase()] || "javascript"), m = G(() => l.theme === "dark" ? "#1e1e1e" : "#fafafa"), T = G(() => {
|
|
2263
2386
|
try {
|
|
2264
|
-
const
|
|
2265
|
-
if (
|
|
2266
|
-
return re.highlight(
|
|
2387
|
+
const g = re.languages[f.value];
|
|
2388
|
+
if (g)
|
|
2389
|
+
return re.highlight(l.modelValue || "", g, f.value);
|
|
2267
2390
|
} catch {
|
|
2268
2391
|
}
|
|
2269
|
-
return
|
|
2392
|
+
return L(l.modelValue || "");
|
|
2270
2393
|
});
|
|
2271
|
-
function
|
|
2272
|
-
const
|
|
2273
|
-
return
|
|
2394
|
+
function L(g) {
|
|
2395
|
+
const p = document.createElement("div");
|
|
2396
|
+
return p.textContent = g, p.innerHTML;
|
|
2274
2397
|
}
|
|
2275
|
-
function
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2398
|
+
function I(g) {
|
|
2399
|
+
const p = g.target;
|
|
2400
|
+
h("update:modelValue", p.value);
|
|
2278
2401
|
}
|
|
2279
|
-
function
|
|
2280
|
-
|
|
2402
|
+
function C() {
|
|
2403
|
+
y.value && A.value && (A.value.scrollTop = y.value.scrollTop, A.value.scrollLeft = y.value.scrollLeft);
|
|
2281
2404
|
}
|
|
2282
|
-
function D(
|
|
2283
|
-
if (
|
|
2284
|
-
|
|
2285
|
-
const
|
|
2286
|
-
|
|
2405
|
+
function D(g) {
|
|
2406
|
+
if (g.key === "Tab") {
|
|
2407
|
+
g.preventDefault();
|
|
2408
|
+
const p = g.target, S = p.selectionStart, t = p.selectionEnd, e = p.value;
|
|
2409
|
+
p.value = e.substring(0, S) + " " + e.substring(t), p.selectionStart = p.selectionEnd = S + 2, h("update:modelValue", p.value);
|
|
2287
2410
|
}
|
|
2288
2411
|
}
|
|
2289
|
-
return (
|
|
2290
|
-
|
|
2412
|
+
return pe(() => {
|
|
2413
|
+
n(l.theme);
|
|
2414
|
+
}), le(() => l.theme, (g) => {
|
|
2415
|
+
n(g);
|
|
2416
|
+
}), (g, p) => (_(), R("div", {
|
|
2417
|
+
class: W(["hep-cr-editor", `hep-cr-theme-${i.theme}`])
|
|
2291
2418
|
}, [
|
|
2292
|
-
|
|
2419
|
+
E("pre", {
|
|
2293
2420
|
ref_key: "highlightRef",
|
|
2294
|
-
ref:
|
|
2295
|
-
class: W(["hep-cr-highlight", [`language-${
|
|
2421
|
+
ref: A,
|
|
2422
|
+
class: W(["hep-cr-highlight", [`language-${f.value}`, `hep-cr-prism-${i.theme}`]]),
|
|
2296
2423
|
"aria-hidden": "true"
|
|
2297
2424
|
}, [
|
|
2298
|
-
|
|
2425
|
+
E("code", { innerHTML: T.value }, null, 8, Me)
|
|
2299
2426
|
], 2),
|
|
2300
|
-
|
|
2427
|
+
E("textarea", {
|
|
2301
2428
|
ref_key: "codeRef",
|
|
2302
|
-
ref:
|
|
2429
|
+
ref: y,
|
|
2303
2430
|
class: "hep-cr-input",
|
|
2304
|
-
value:
|
|
2305
|
-
disabled:
|
|
2306
|
-
onInput:
|
|
2307
|
-
onScroll:
|
|
2431
|
+
value: i.modelValue,
|
|
2432
|
+
disabled: i.disabled,
|
|
2433
|
+
onInput: I,
|
|
2434
|
+
onScroll: C,
|
|
2308
2435
|
onKeydown: D,
|
|
2309
2436
|
spellcheck: "false",
|
|
2310
2437
|
placeholder: "Write your code here..."
|
|
2311
|
-
}, null, 40,
|
|
2438
|
+
}, null, 40, Ue)
|
|
2312
2439
|
], 2));
|
|
2313
2440
|
}
|
|
2314
|
-
}),
|
|
2315
|
-
const
|
|
2316
|
-
for (const [l,
|
|
2317
|
-
|
|
2318
|
-
return
|
|
2319
|
-
},
|
|
2441
|
+
}), he = (i, d) => {
|
|
2442
|
+
const n = i.__vccOpts || i;
|
|
2443
|
+
for (const [l, h] of d)
|
|
2444
|
+
n[l] = h;
|
|
2445
|
+
return n;
|
|
2446
|
+
}, Be = /* @__PURE__ */ he(He, [["__scopeId", "data-v-91e77d58"]]), Ge = { class: "hep-cr-header" }, ze = { class: "hep-cr-controls" }, je = ["disabled"], We = {
|
|
2320
2447
|
key: 0,
|
|
2321
2448
|
value: ""
|
|
2322
|
-
},
|
|
2449
|
+
}, Ve = ["value"], Ye = { class: "hep-cr-actions" }, Xe = ["disabled"], Ze = {
|
|
2323
2450
|
key: 0,
|
|
2324
2451
|
class: "hep-cr-spinner"
|
|
2325
|
-
},
|
|
2452
|
+
}, Ke = {
|
|
2326
2453
|
key: 1,
|
|
2327
2454
|
class: "hep-cr-run-icon"
|
|
2328
|
-
},
|
|
2455
|
+
}, qe = ["title"], Je = {
|
|
2329
2456
|
key: 0,
|
|
2330
2457
|
class: "hep-cr-error"
|
|
2331
|
-
},
|
|
2458
|
+
}, 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
2459
|
key: 0,
|
|
2333
2460
|
class: "hep-cr-execution-time"
|
|
2334
|
-
},
|
|
2461
|
+
}, ot = { class: "hep-cr-output-content" }, it = { key: 0 }, lt = {
|
|
2335
2462
|
key: 1,
|
|
2336
2463
|
class: "hep-cr-stderr"
|
|
2337
|
-
},
|
|
2464
|
+
}, ut = /* @__PURE__ */ ie({
|
|
2338
2465
|
__name: "CodeRunner",
|
|
2339
2466
|
props: {
|
|
2340
2467
|
pistonUrl: { default: "/api/piston" },
|
|
@@ -2347,173 +2474,173 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2347
2474
|
executorLabel: { default: "运行" }
|
|
2348
2475
|
},
|
|
2349
2476
|
emits: ["execute-start", "execute-end", "language-change"],
|
|
2350
|
-
setup(
|
|
2351
|
-
const
|
|
2352
|
-
function
|
|
2477
|
+
setup(i, { emit: d }) {
|
|
2478
|
+
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);
|
|
2479
|
+
function p() {
|
|
2353
2480
|
A.value = A.value === "light" ? "dark" : "light";
|
|
2354
2481
|
}
|
|
2355
|
-
const
|
|
2356
|
-
() => new
|
|
2357
|
-
), t = G(() =>
|
|
2358
|
-
value: `${
|
|
2359
|
-
label: `${
|
|
2482
|
+
const S = G(
|
|
2483
|
+
() => new Le({ pistonUrl: n.pistonUrl })
|
|
2484
|
+
), t = G(() => h.value.map((v) => ({
|
|
2485
|
+
value: `${v.language}:${v.version}`,
|
|
2486
|
+
label: `${v.language.charAt(0).toUpperCase() + v.language.slice(1)} ${v.version}`
|
|
2360
2487
|
}))), e = G(() => {
|
|
2361
|
-
const
|
|
2362
|
-
return
|
|
2488
|
+
const v = y.value;
|
|
2489
|
+
return v.includes(":") ? v.split(":")[0] : v;
|
|
2363
2490
|
});
|
|
2364
|
-
async function
|
|
2365
|
-
|
|
2491
|
+
async function a() {
|
|
2492
|
+
D.value = !0, C.value = null;
|
|
2366
2493
|
try {
|
|
2367
|
-
|
|
2368
|
-
} catch (
|
|
2369
|
-
|
|
2494
|
+
h.value = await S.value.getRuntimes();
|
|
2495
|
+
} catch (v) {
|
|
2496
|
+
C.value = v instanceof Error ? v.message : "Failed to load runtimes";
|
|
2370
2497
|
} finally {
|
|
2371
|
-
|
|
2498
|
+
D.value = !1;
|
|
2372
2499
|
}
|
|
2373
2500
|
}
|
|
2374
|
-
|
|
2375
|
-
const w =
|
|
2376
|
-
|
|
2501
|
+
le(y, (v) => {
|
|
2502
|
+
const w = v.includes(":") ? v.split(":")[0] : v, x = ae(w);
|
|
2503
|
+
s.value = x, l("language-change", w, x);
|
|
2377
2504
|
});
|
|
2378
|
-
async function
|
|
2379
|
-
if (!
|
|
2380
|
-
|
|
2505
|
+
async function r() {
|
|
2506
|
+
if (!T.value) {
|
|
2507
|
+
T.value = !0, f.value = "", m.value = "", L.value = null, C.value = null, I.value = "stdout", l("execute-start");
|
|
2381
2508
|
try {
|
|
2382
|
-
const
|
|
2383
|
-
|
|
2384
|
-
} catch (
|
|
2385
|
-
|
|
2509
|
+
const v = await S.value.execute(e.value, s.value);
|
|
2510
|
+
f.value = v.output, m.value = v.stderr, L.value = v.executionTime || null, I.value = v.stderr ? "stderr" : "stdout", l("execute-end", v);
|
|
2511
|
+
} catch (v) {
|
|
2512
|
+
C.value = v instanceof Error ? v.message : "Execution failed", l("execute-end", {
|
|
2386
2513
|
success: !1,
|
|
2387
2514
|
output: "",
|
|
2388
|
-
stderr:
|
|
2515
|
+
stderr: C.value,
|
|
2389
2516
|
code: -1
|
|
2390
2517
|
});
|
|
2391
2518
|
} finally {
|
|
2392
|
-
|
|
2519
|
+
T.value = !1;
|
|
2393
2520
|
}
|
|
2394
2521
|
}
|
|
2395
2522
|
}
|
|
2396
|
-
function
|
|
2397
|
-
|
|
2523
|
+
function o() {
|
|
2524
|
+
f.value = "", m.value = "", L.value = null, C.value = null;
|
|
2398
2525
|
}
|
|
2399
2526
|
async function c() {
|
|
2400
|
-
const
|
|
2401
|
-
await navigator.clipboard.writeText(
|
|
2527
|
+
const v = I.value === "stdout" ? f.value : m.value;
|
|
2528
|
+
await navigator.clipboard.writeText(v);
|
|
2402
2529
|
}
|
|
2403
|
-
function
|
|
2404
|
-
|
|
2530
|
+
function b() {
|
|
2531
|
+
s.value = ae(e.value);
|
|
2405
2532
|
}
|
|
2406
2533
|
let u = !1;
|
|
2407
|
-
function
|
|
2408
|
-
u = !0, document.addEventListener("mousemove",
|
|
2534
|
+
function k(v) {
|
|
2535
|
+
u = !0, document.addEventListener("mousemove", F), document.addEventListener("mouseup", P), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
2409
2536
|
}
|
|
2410
|
-
function
|
|
2537
|
+
function F(v) {
|
|
2411
2538
|
if (!u) return;
|
|
2412
2539
|
const w = document.querySelector(
|
|
2413
2540
|
".hep-cr-main"
|
|
2414
2541
|
);
|
|
2415
2542
|
if (!w) return;
|
|
2416
|
-
const
|
|
2417
|
-
|
|
2543
|
+
const x = w.getBoundingClientRect(), Y = (v.clientX - x.left) / x.width * 100;
|
|
2544
|
+
g.value = Math.max(20, Math.min(80, Y));
|
|
2418
2545
|
}
|
|
2419
2546
|
function P() {
|
|
2420
|
-
u = !1, document.removeEventListener("mousemove",
|
|
2547
|
+
u = !1, document.removeEventListener("mousemove", F), document.removeEventListener("mouseup", P), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
2421
2548
|
}
|
|
2422
|
-
|
|
2423
|
-
await
|
|
2549
|
+
pe(async () => {
|
|
2550
|
+
await a(), s.value || (s.value = n.defaultCode || ae(y.value));
|
|
2424
2551
|
});
|
|
2425
2552
|
const V = G(() => `hep-cr-runner-${A.value}`);
|
|
2426
|
-
return (
|
|
2553
|
+
return (v, w) => (_(), R("div", {
|
|
2427
2554
|
class: W(["hep-cr-runner", V.value])
|
|
2428
2555
|
}, [
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2556
|
+
E("div", Ge, [
|
|
2557
|
+
E("div", ze, [
|
|
2558
|
+
i.showLanguageSelector ? Ee((_(), R("select", {
|
|
2432
2559
|
key: 0,
|
|
2433
|
-
"onUpdate:modelValue": w[0] || (w[0] = (
|
|
2560
|
+
"onUpdate:modelValue": w[0] || (w[0] = (x) => y.value = x),
|
|
2434
2561
|
class: "hep-cr-language-select",
|
|
2435
|
-
disabled:
|
|
2562
|
+
disabled: T.value
|
|
2436
2563
|
}, [
|
|
2437
|
-
|
|
2438
|
-
(
|
|
2439
|
-
key:
|
|
2440
|
-
value:
|
|
2441
|
-
}, H(
|
|
2442
|
-
], 8,
|
|
2443
|
-
[Ae,
|
|
2564
|
+
D.value ? (_(), R("option", We, "加载中...")) : U("", !0),
|
|
2565
|
+
(_(!0), R(ve, null, ye(t.value, (x) => (_(), R("option", {
|
|
2566
|
+
key: x.value,
|
|
2567
|
+
value: x.value
|
|
2568
|
+
}, H(x.label), 9, Ve))), 128))
|
|
2569
|
+
], 8, je)), [
|
|
2570
|
+
[Ae, y.value]
|
|
2444
2571
|
]) : U("", !0)
|
|
2445
2572
|
]),
|
|
2446
|
-
|
|
2447
|
-
|
|
2573
|
+
E("div", Ye, [
|
|
2574
|
+
E("button", {
|
|
2448
2575
|
class: "hep-cr-btn hep-cr-btn-run",
|
|
2449
|
-
disabled:
|
|
2450
|
-
onClick:
|
|
2576
|
+
disabled: T.value || D.value,
|
|
2577
|
+
onClick: r
|
|
2451
2578
|
}, [
|
|
2452
|
-
|
|
2453
|
-
Se(" " + H(
|
|
2454
|
-
], 8,
|
|
2455
|
-
|
|
2579
|
+
T.value ? (_(), R("span", Ze)) : (_(), R("span", Ke, "▶")),
|
|
2580
|
+
Se(" " + H(T.value ? "运行中..." : i.executorLabel), 1)
|
|
2581
|
+
], 8, Xe),
|
|
2582
|
+
i.showEditor && i.editable ? (_(), R("button", {
|
|
2456
2583
|
key: 0,
|
|
2457
2584
|
class: "hep-cr-btn hep-cr-btn-reset",
|
|
2458
|
-
onClick:
|
|
2585
|
+
onClick: b
|
|
2459
2586
|
}, " 重置 ")) : U("", !0),
|
|
2460
|
-
|
|
2587
|
+
E("button", {
|
|
2461
2588
|
class: "hep-cr-btn hep-cr-btn-theme",
|
|
2462
|
-
onClick:
|
|
2589
|
+
onClick: p,
|
|
2463
2590
|
title: A.value === "light" ? "Switch to dark mode" : "Switch to light mode"
|
|
2464
|
-
}, H(A.value === "light" ? "🌙" : "☀️"), 9,
|
|
2591
|
+
}, H(A.value === "light" ? "🌙" : "☀️"), 9, qe)
|
|
2465
2592
|
])
|
|
2466
2593
|
]),
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2594
|
+
C.value ? (_(), R("div", Je, H(C.value), 1)) : U("", !0),
|
|
2595
|
+
E("div", Qe, [
|
|
2596
|
+
i.showEditor ? (_(), R("div", {
|
|
2470
2597
|
key: 0,
|
|
2471
2598
|
class: "hep-cr-editor-panel",
|
|
2472
|
-
style: se({ width:
|
|
2599
|
+
style: se({ width: g.value + "%" })
|
|
2473
2600
|
}, [
|
|
2474
|
-
|
|
2475
|
-
w[4] || (w[4] =
|
|
2476
|
-
|
|
2601
|
+
E("div", et, [
|
|
2602
|
+
w[4] || (w[4] = E("span", { class: "hep-cr-panel-title" }, "编辑器", -1)),
|
|
2603
|
+
E("span", tt, H(e.value), 1)
|
|
2477
2604
|
]),
|
|
2478
|
-
|
|
2479
|
-
modelValue:
|
|
2480
|
-
"onUpdate:modelValue": w[1] || (w[1] = (
|
|
2605
|
+
oe(Be, {
|
|
2606
|
+
modelValue: s.value,
|
|
2607
|
+
"onUpdate:modelValue": w[1] || (w[1] = (x) => s.value = x),
|
|
2481
2608
|
language: e.value,
|
|
2482
2609
|
theme: A.value,
|
|
2483
|
-
disabled: !
|
|
2610
|
+
disabled: !i.editable || T.value
|
|
2484
2611
|
}, null, 8, ["modelValue", "language", "theme", "disabled"])
|
|
2485
2612
|
], 4)) : U("", !0),
|
|
2486
|
-
|
|
2613
|
+
i.showEditor ? (_(), R("div", {
|
|
2487
2614
|
key: 1,
|
|
2488
2615
|
class: "hep-cr-resize-handle",
|
|
2489
|
-
onMousedown:
|
|
2616
|
+
onMousedown: k
|
|
2490
2617
|
}, [...w[5] || (w[5] = [
|
|
2491
|
-
|
|
2618
|
+
E("div", { class: "hep-cr-resize-line" }, null, -1)
|
|
2492
2619
|
])], 32)) : U("", !0),
|
|
2493
|
-
|
|
2620
|
+
E("div", {
|
|
2494
2621
|
class: "hep-cr-output-panel",
|
|
2495
|
-
style: se({ width:
|
|
2622
|
+
style: se({ width: i.showEditor ? 100 - g.value + "%" : "100%" })
|
|
2496
2623
|
}, [
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
class: W(["hep-cr-tab", { active:
|
|
2501
|
-
onClick: w[2] || (w[2] = (
|
|
2624
|
+
E("div", nt, [
|
|
2625
|
+
E("div", at, [
|
|
2626
|
+
E("button", {
|
|
2627
|
+
class: W(["hep-cr-tab", { active: I.value === "stdout" }]),
|
|
2628
|
+
onClick: w[2] || (w[2] = (x) => I.value = "stdout")
|
|
2502
2629
|
}, " 输出 ", 2),
|
|
2503
|
-
|
|
2630
|
+
m.value ? (_(), R("button", {
|
|
2504
2631
|
key: 0,
|
|
2505
|
-
class: W(["hep-cr-tab", { active:
|
|
2506
|
-
onClick: w[3] || (w[3] = (
|
|
2632
|
+
class: W(["hep-cr-tab", { active: I.value === "stderr" }]),
|
|
2633
|
+
onClick: w[3] || (w[3] = (x) => I.value = "stderr")
|
|
2507
2634
|
}, " 错误 ", 2)) : U("", !0)
|
|
2508
2635
|
]),
|
|
2509
|
-
|
|
2510
|
-
L.value !== null ? (
|
|
2511
|
-
|
|
2636
|
+
E("div", rt, [
|
|
2637
|
+
L.value !== null ? (_(), R("span", st, H(L.value) + "ms ", 1)) : U("", !0),
|
|
2638
|
+
E("button", {
|
|
2512
2639
|
class: "hep-cr-btn-icon",
|
|
2513
2640
|
onClick: c,
|
|
2514
2641
|
title: "复制"
|
|
2515
2642
|
}, [...w[6] || (w[6] = [
|
|
2516
|
-
|
|
2643
|
+
E("svg", {
|
|
2517
2644
|
width: "14",
|
|
2518
2645
|
height: "14",
|
|
2519
2646
|
viewBox: "0 0 24 24",
|
|
@@ -2521,7 +2648,7 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2521
2648
|
stroke: "currentColor",
|
|
2522
2649
|
"stroke-width": "2"
|
|
2523
2650
|
}, [
|
|
2524
|
-
|
|
2651
|
+
E("rect", {
|
|
2525
2652
|
x: "9",
|
|
2526
2653
|
y: "9",
|
|
2527
2654
|
width: "13",
|
|
@@ -2529,15 +2656,15 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2529
2656
|
rx: "2",
|
|
2530
2657
|
ry: "2"
|
|
2531
2658
|
}),
|
|
2532
|
-
|
|
2659
|
+
E("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
2533
2660
|
], -1)
|
|
2534
2661
|
])]),
|
|
2535
|
-
|
|
2662
|
+
E("button", {
|
|
2536
2663
|
class: "hep-cr-btn-icon",
|
|
2537
|
-
onClick:
|
|
2664
|
+
onClick: o,
|
|
2538
2665
|
title: "清除"
|
|
2539
2666
|
}, [...w[7] || (w[7] = [
|
|
2540
|
-
|
|
2667
|
+
E("svg", {
|
|
2541
2668
|
width: "14",
|
|
2542
2669
|
height: "14",
|
|
2543
2670
|
viewBox: "0 0 24 24",
|
|
@@ -2545,23 +2672,23 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2545
2672
|
stroke: "currentColor",
|
|
2546
2673
|
"stroke-width": "2"
|
|
2547
2674
|
}, [
|
|
2548
|
-
|
|
2549
|
-
|
|
2675
|
+
E("polyline", { points: "3 6 5 6 21 6" }),
|
|
2676
|
+
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
2677
|
], -1)
|
|
2551
2678
|
])])
|
|
2552
2679
|
])
|
|
2553
2680
|
]),
|
|
2554
|
-
|
|
2555
|
-
|
|
2681
|
+
E("div", ot, [
|
|
2682
|
+
I.value === "stdout" ? (_(), R("pre", it, H(f.value || '点击"运行"执行代码'), 1)) : (_(), R("pre", lt, H(m.value), 1))
|
|
2556
2683
|
])
|
|
2557
2684
|
], 4)
|
|
2558
2685
|
])
|
|
2559
2686
|
], 2));
|
|
2560
2687
|
}
|
|
2561
|
-
}), J = /* @__PURE__ */
|
|
2688
|
+
}), 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
2689
|
key: 0,
|
|
2563
2690
|
class: "hep-cr-dialog-footer"
|
|
2564
|
-
},
|
|
2691
|
+
}, ft = /* @__PURE__ */ ie({
|
|
2565
2692
|
__name: "CodeRunnerDialog",
|
|
2566
2693
|
props: {
|
|
2567
2694
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -2577,41 +2704,41 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2577
2704
|
executorLabel: { default: "运行" }
|
|
2578
2705
|
},
|
|
2579
2706
|
emits: ["update:modelValue", "close"],
|
|
2580
|
-
setup(
|
|
2581
|
-
const l =
|
|
2582
|
-
|
|
2707
|
+
setup(i, { expose: d, emit: n }) {
|
|
2708
|
+
const l = i, h = n, y = N(l.modelValue), A = G(() => l.modelValue !== void 0 ? l.modelValue : y.value);
|
|
2709
|
+
le(
|
|
2583
2710
|
() => l.modelValue,
|
|
2584
|
-
(
|
|
2585
|
-
|
|
2711
|
+
(m) => {
|
|
2712
|
+
m !== void 0 && (y.value = m);
|
|
2586
2713
|
}
|
|
2587
2714
|
);
|
|
2588
|
-
function
|
|
2589
|
-
|
|
2715
|
+
function s() {
|
|
2716
|
+
y.value = !1, h("update:modelValue", !1), h("close");
|
|
2590
2717
|
}
|
|
2591
|
-
function
|
|
2592
|
-
|
|
2718
|
+
function f(m) {
|
|
2719
|
+
m.target === m.currentTarget && s();
|
|
2593
2720
|
}
|
|
2594
2721
|
return d({
|
|
2595
|
-
close:
|
|
2596
|
-
}), (
|
|
2597
|
-
|
|
2722
|
+
close: s
|
|
2723
|
+
}), (m, T) => (_(), ke(we, { to: "body" }, [
|
|
2724
|
+
oe(Te, { name: "hep-cr-dialog-fade" }, {
|
|
2598
2725
|
default: Ie(() => [
|
|
2599
|
-
A.value ? (
|
|
2726
|
+
A.value ? (_(), R("div", {
|
|
2600
2727
|
key: 0,
|
|
2601
2728
|
class: "hep-cr-dialog-overlay",
|
|
2602
|
-
onClick:
|
|
2729
|
+
onClick: f
|
|
2603
2730
|
}, [
|
|
2604
|
-
|
|
2731
|
+
E("div", {
|
|
2605
2732
|
class: "hep-cr-dialog-container",
|
|
2606
|
-
style: se({ width: typeof
|
|
2733
|
+
style: se({ width: typeof i.width == "number" ? i.width + "px" : i.width })
|
|
2607
2734
|
}, [
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2735
|
+
E("div", ct, [
|
|
2736
|
+
E("h3", dt, H(i.title), 1),
|
|
2737
|
+
E("button", {
|
|
2611
2738
|
class: "hep-cr-dialog-close",
|
|
2612
|
-
onClick:
|
|
2613
|
-
}, [...
|
|
2614
|
-
|
|
2739
|
+
onClick: s
|
|
2740
|
+
}, [...T[0] || (T[0] = [
|
|
2741
|
+
E("svg", {
|
|
2615
2742
|
width: "16",
|
|
2616
2743
|
height: "16",
|
|
2617
2744
|
viewBox: "0 0 24 24",
|
|
@@ -2619,13 +2746,13 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2619
2746
|
stroke: "currentColor",
|
|
2620
2747
|
"stroke-width": "2"
|
|
2621
2748
|
}, [
|
|
2622
|
-
|
|
2749
|
+
E("line", {
|
|
2623
2750
|
x1: "18",
|
|
2624
2751
|
y1: "6",
|
|
2625
2752
|
x2: "6",
|
|
2626
2753
|
y2: "18"
|
|
2627
2754
|
}),
|
|
2628
|
-
|
|
2755
|
+
E("line", {
|
|
2629
2756
|
x1: "6",
|
|
2630
2757
|
y1: "6",
|
|
2631
2758
|
x2: "18",
|
|
@@ -2634,11 +2761,11 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2634
2761
|
], -1)
|
|
2635
2762
|
])])
|
|
2636
2763
|
]),
|
|
2637
|
-
|
|
2638
|
-
|
|
2764
|
+
E("div", pt, [
|
|
2765
|
+
oe(J, Fe(_e(m.$attrs)), null, 16)
|
|
2639
2766
|
]),
|
|
2640
|
-
|
|
2641
|
-
Re(
|
|
2767
|
+
m.$slots.footer ? (_(), R("div", gt, [
|
|
2768
|
+
Re(m.$slots, "footer", { close: s })
|
|
2642
2769
|
])) : U("", !0)
|
|
2643
2770
|
], 4)
|
|
2644
2771
|
])) : U("", !0)
|
|
@@ -2648,16 +2775,16 @@ const Pe = ["innerHTML"], $e = ["value", "disabled"], Me = /* @__PURE__ */ oe({
|
|
|
2648
2775
|
]));
|
|
2649
2776
|
}
|
|
2650
2777
|
});
|
|
2651
|
-
J.install = (
|
|
2652
|
-
|
|
2778
|
+
J.install = (i) => {
|
|
2779
|
+
i.component("CodeRunner", J);
|
|
2653
2780
|
};
|
|
2654
|
-
const
|
|
2655
|
-
install(
|
|
2656
|
-
|
|
2781
|
+
const mt = {
|
|
2782
|
+
install(i) {
|
|
2783
|
+
i.component("CodeRunner", J);
|
|
2657
2784
|
}
|
|
2658
2785
|
};
|
|
2659
2786
|
export {
|
|
2660
2787
|
J as CodeRunner,
|
|
2661
|
-
|
|
2662
|
-
|
|
2788
|
+
ft as CodeRunnerDialog,
|
|
2789
|
+
mt as default
|
|
2663
2790
|
};
|