@hep-code-runner/vue3 1.5.3 → 2.0.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.mjs CHANGED
@@ -1,5 +1,5 @@
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 oe, createVNode as se, 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);
1
+ import { defineComponent as ie, useCssVars as be, ref as O, computed as B, onMounted as pe, watch as le, openBlock as T, createElementBlock as x, normalizeClass as G, createElementVNode as E, withDirectives as Ee, createCommentVNode as M, Fragment as ve, renderList as ye, toDisplayString as H, vModelSelect as Ae, createTextVNode as ke, createStaticVNode as Se, normalizeStyle as oe, createVNode as se, createBlock as we, Teleport as Te, Transition as _e, withCtx as xe, normalizeProps as Ie, guardReactiveProps as Fe, renderSlot as Re } from "vue";
2
+ var Oe = Object.defineProperty, Ne = (i, d, n) => d in i ? Oe(i, d, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[d] = n, ce = (i, d, n) => Ne(i, typeof d != "symbol" ? d + "" : d, n);
3
3
  let ne = null;
4
4
  class Le {
5
5
  constructor(d = {}) {
@@ -27,17 +27,17 @@ class Le {
27
27
  const h = (await this.getRuntimes()).find(
28
28
  (f) => {
29
29
  var m;
30
- return f.language.toLowerCase() === d.toLowerCase() || ((m = f.aliases) == null ? void 0 : m.some((T) => T.toLowerCase() === d.toLowerCase()));
30
+ return f.language.toLowerCase() === d.toLowerCase() || ((m = f.aliases) == null ? void 0 : m.some((I) => I.toLowerCase() === d.toLowerCase()));
31
31
  }
32
32
  );
33
33
  if (!h)
34
34
  throw new Error(`Language '${d}' is not supported`);
35
- const y = this.getFileName(d), A = {
35
+ const A = this.getFileName(d), k = {
36
36
  language: h.language,
37
37
  version: l.version || h.version,
38
38
  files: [
39
39
  {
40
- name: y,
40
+ name: A,
41
41
  content: n
42
42
  }
43
43
  ],
@@ -52,17 +52,17 @@ class Le {
52
52
  headers: {
53
53
  "Content-Type": "application/json"
54
54
  },
55
- body: JSON.stringify(A)
55
+ body: JSON.stringify(k)
56
56
  });
57
57
  if (!f.ok)
58
58
  throw new Error(`Execute failed: ${f.statusText}`);
59
- const m = await f.json(), T = Date.now() - o, L = m.run.stdout || "", I = m.run.stderr || "";
59
+ const m = await f.json(), I = Date.now() - o, N = m.run.stdout || "", R = m.run.stderr || "";
60
60
  return {
61
61
  success: m.run.code === 0,
62
- output: L,
63
- stderr: I,
62
+ output: N,
63
+ stderr: R,
64
64
  code: m.run.code,
65
- executionTime: T,
65
+ executionTime: I,
66
66
  compile: m.compile ? {
67
67
  stdout: m.compile.stdout || "",
68
68
  stderr: m.compile.stderr || "",
@@ -109,7 +109,7 @@ class Le {
109
109
  }[d.toLowerCase()] || `main.${d}`;
110
110
  }
111
111
  }
112
- const Ne = {
112
+ const Ce = {
113
113
  javascript: 'console.log("Hello, World!");',
114
114
  typescript: 'console.log("Hello, World!");',
115
115
  python: 'print("Hello, World!")',
@@ -207,13 +207,13 @@ h1 {
207
207
 
208
208
  This is a sample markdown document.`
209
209
  };
210
- function re(i) {
210
+ function ae(i) {
211
211
  const d = i.toLowerCase();
212
- return Ne[d] || `// ${i}
212
+ return Ce[d] || `// ${i}
213
213
  // Write your code here`;
214
214
  }
215
215
  var de = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
216
- function Ce(i) {
216
+ function De(i) {
217
217
  return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
218
218
  }
219
219
  var ge = { exports: {} };
@@ -228,7 +228,7 @@ var ge = { exports: {} };
228
228
  * @public
229
229
  */
230
230
  var n = function(l) {
231
- var h = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, y = 0, A = {}, o = {
231
+ var h = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, A = 0, k = {}, o = {
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
@@ -312,7 +312,7 @@ var ge = { exports: {} };
312
312
  * @returns {number}
313
313
  */
314
314
  objId: function(t) {
315
- return t.__id || Object.defineProperty(t, "__id", { value: ++y }), t.__id;
315
+ return t.__id || Object.defineProperty(t, "__id", { value: ++A }), t.__id;
316
316
  },
317
317
  /**
318
318
  * Creates a deep clone of the given object.
@@ -326,26 +326,26 @@ var ge = { exports: {} };
326
326
  */
327
327
  clone: function t(e, r) {
328
328
  r = r || {};
329
- var a, s;
329
+ var s, a;
330
330
  switch (o.util.type(e)) {
331
331
  case "Object":
332
- if (s = o.util.objId(e), r[s])
333
- return r[s];
334
- a = /** @type {Record<string, any>} */
335
- {}, r[s] = a;
336
- for (var c in e)
337
- e.hasOwnProperty(c) && (a[c] = t(e[c], r));
332
+ if (a = o.util.objId(e), r[a])
333
+ return r[a];
334
+ s = /** @type {Record<string, any>} */
335
+ {}, r[a] = s;
336
+ for (var u in e)
337
+ e.hasOwnProperty(u) && (s[u] = t(e[u], r));
338
338
  return (
339
339
  /** @type {any} */
340
- a
340
+ s
341
341
  );
342
342
  case "Array":
343
- return s = o.util.objId(e), r[s] ? r[s] : (a = [], r[s] = a, /** @type {Array} */
343
+ return a = o.util.objId(e), r[a] ? r[a] : (s = [], r[a] = s, /** @type {Array} */
344
344
  /** @type {any} */
345
- e.forEach(function(b, u) {
346
- a[u] = t(b, r);
345
+ e.forEach(function(b, c) {
346
+ s[c] = t(b, r);
347
347
  }), /** @type {any} */
348
- a);
348
+ s);
349
349
  default:
350
350
  return e;
351
351
  }
@@ -394,8 +394,8 @@ var ge = { exports: {} };
394
394
  );
395
395
  try {
396
396
  throw new Error();
397
- } catch (a) {
398
- var t = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(a.stack) || [])[1];
397
+ } catch (s) {
398
+ var t = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(s.stack) || [])[1];
399
399
  if (t) {
400
400
  var e = document.getElementsByTagName("script");
401
401
  for (var r in e)
@@ -425,11 +425,11 @@ var ge = { exports: {} };
425
425
  * @returns {boolean}
426
426
  */
427
427
  isActive: function(t, e, r) {
428
- for (var a = "no-" + e; t; ) {
429
- var s = t.classList;
430
- if (s.contains(e))
428
+ for (var s = "no-" + e; t; ) {
429
+ var a = t.classList;
430
+ if (a.contains(e))
431
431
  return !0;
432
- if (s.contains(a))
432
+ if (a.contains(s))
433
433
  return !1;
434
434
  t = t.parentElement;
435
435
  }
@@ -447,10 +447,10 @@ var ge = { exports: {} };
447
447
  /**
448
448
  * The grammar for plain, unformatted text.
449
449
  */
450
- plain: A,
451
- plaintext: A,
452
- text: A,
453
- txt: A,
450
+ plain: k,
451
+ plaintext: k,
452
+ text: k,
453
+ txt: k,
454
454
  /**
455
455
  * Creates a deep copy of the language with the given id and appends the given tokens.
456
456
  *
@@ -481,8 +481,8 @@ var ge = { exports: {} };
481
481
  */
482
482
  extend: function(t, e) {
483
483
  var r = o.util.clone(o.languages[t]);
484
- for (var a in e)
485
- r[a] = e[a];
484
+ for (var s in e)
485
+ r[s] = e[s];
486
486
  return r;
487
487
  },
488
488
  /**
@@ -560,31 +560,31 @@ var ge = { exports: {} };
560
560
  * @returns {Grammar} The new grammar object.
561
561
  * @public
562
562
  */
563
- insertBefore: function(t, e, r, a) {
564
- a = a || /** @type {any} */
563
+ insertBefore: function(t, e, r, s) {
564
+ s = s || /** @type {any} */
565
565
  o.languages;
566
- var s = a[t], c = {};
567
- for (var b in s)
568
- if (s.hasOwnProperty(b)) {
566
+ var a = s[t], u = {};
567
+ for (var b in a)
568
+ if (a.hasOwnProperty(b)) {
569
569
  if (b == e)
570
- for (var u in r)
571
- r.hasOwnProperty(u) && (c[u] = r[u]);
572
- r.hasOwnProperty(b) || (c[b] = s[b]);
570
+ for (var c in r)
571
+ r.hasOwnProperty(c) && (u[c] = r[c]);
572
+ r.hasOwnProperty(b) || (u[b] = a[b]);
573
573
  }
574
- var k = a[t];
575
- return a[t] = c, o.languages.DFS(o.languages, function(F, P) {
576
- P === k && F != t && (this[F] = c);
577
- }), c;
574
+ var _ = s[t];
575
+ return s[t] = u, o.languages.DFS(o.languages, function(F, $) {
576
+ $ === _ && F != t && (this[F] = u);
577
+ }), u;
578
578
  },
579
579
  // Traverse a language definition with Depth First Search
580
- DFS: function t(e, r, a, s) {
581
- s = s || {};
582
- var c = o.util.objId;
580
+ DFS: function t(e, r, s, a) {
581
+ a = a || {};
582
+ var u = o.util.objId;
583
583
  for (var b in e)
584
584
  if (e.hasOwnProperty(b)) {
585
- r.call(e, b, e[b], a || b);
586
- var u = e[b], k = o.util.type(u);
587
- k === "Object" && !s[c(u)] ? (s[c(u)] = !0, t(u, r, null, s)) : k === "Array" && !s[c(u)] && (s[c(u)] = !0, t(u, r, b, s));
585
+ r.call(e, b, e[b], s || b);
586
+ var c = e[b], _ = o.util.type(c);
587
+ _ === "Object" && !a[u(c)] ? (a[u(c)] = !0, t(c, r, null, a)) : _ === "Array" && !a[u(c)] && (a[u(c)] = !0, t(c, r, b, a));
588
588
  }
589
589
  }
590
590
  },
@@ -620,14 +620,14 @@ var ge = { exports: {} };
620
620
  * @public
621
621
  */
622
622
  highlightAllUnder: function(t, e, r) {
623
- var a = {
623
+ var s = {
624
624
  callback: r,
625
625
  container: t,
626
626
  selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
627
627
  };
628
- o.hooks.run("before-highlightall", a), a.elements = Array.prototype.slice.apply(a.container.querySelectorAll(a.selector)), o.hooks.run("before-all-elements-highlight", a);
629
- for (var s = 0, c; c = a.elements[s++]; )
630
- o.highlightElement(c, e === !0, a.callback);
628
+ o.hooks.run("before-highlightall", s), s.elements = Array.prototype.slice.apply(s.container.querySelectorAll(s.selector)), o.hooks.run("before-all-elements-highlight", s);
629
+ for (var a = 0, u; u = s.elements[a++]; )
630
+ o.highlightElement(u, e === !0, s.callback);
631
631
  },
632
632
  /**
633
633
  * Highlights the code inside a single element.
@@ -658,38 +658,38 @@ var ge = { exports: {} };
658
658
  * @public
659
659
  */
660
660
  highlightElement: function(t, e, r) {
661
- var a = o.util.getLanguage(t), s = o.languages[a];
662
- o.util.setLanguage(t, a);
663
- var c = t.parentElement;
664
- c && c.nodeName.toLowerCase() === "pre" && o.util.setLanguage(c, a);
665
- var b = t.textContent, u = {
661
+ var s = o.util.getLanguage(t), a = o.languages[s];
662
+ o.util.setLanguage(t, s);
663
+ var u = t.parentElement;
664
+ u && u.nodeName.toLowerCase() === "pre" && o.util.setLanguage(u, s);
665
+ var b = t.textContent, c = {
666
666
  element: t,
667
- language: a,
668
- grammar: s,
667
+ language: s,
668
+ grammar: a,
669
669
  code: b
670
670
  };
671
- function k(P) {
672
- u.highlightedCode = P, o.hooks.run("before-insert", u), u.element.innerHTML = u.highlightedCode, o.hooks.run("after-highlight", u), o.hooks.run("complete", u), r && r.call(u.element);
671
+ function _($) {
672
+ c.highlightedCode = $, o.hooks.run("before-insert", c), c.element.innerHTML = c.highlightedCode, o.hooks.run("after-highlight", c), o.hooks.run("complete", c), r && r.call(c.element);
673
673
  }
674
- if (o.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
- o.hooks.run("complete", u), r && r.call(u.element);
674
+ if (o.hooks.run("before-sanity-check", c), u = c.element.parentElement, u && u.nodeName.toLowerCase() === "pre" && !u.hasAttribute("tabindex") && u.setAttribute("tabindex", "0"), !c.code) {
675
+ o.hooks.run("complete", c), r && r.call(c.element);
676
676
  return;
677
677
  }
678
- if (o.hooks.run("before-highlight", u), !u.grammar) {
679
- k(o.util.encode(u.code));
678
+ if (o.hooks.run("before-highlight", c), !c.grammar) {
679
+ _(o.util.encode(c.code));
680
680
  return;
681
681
  }
682
682
  if (e && l.Worker) {
683
683
  var F = new Worker(o.filename);
684
- F.onmessage = function(P) {
685
- k(P.data);
684
+ F.onmessage = function($) {
685
+ _($.data);
686
686
  }, F.postMessage(JSON.stringify({
687
- language: u.language,
688
- code: u.code,
687
+ language: c.language,
688
+ code: c.code,
689
689
  immediateClose: !0
690
690
  }));
691
691
  } else
692
- k(o.highlight(u.code, u.grammar, u.language));
692
+ _(o.highlight(c.code, c.grammar, c.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
@@ -712,14 +712,14 @@ var ge = { exports: {} };
712
712
  * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
713
713
  */
714
714
  highlight: function(t, e, r) {
715
- var a = {
715
+ var s = {
716
716
  code: t,
717
717
  grammar: e,
718
718
  language: r
719
719
  };
720
- if (o.hooks.run("before-tokenize", a), !a.grammar)
721
- throw new Error('The language "' + a.language + '" has no grammar.');
722
- return a.tokens = o.tokenize(a.code, a.grammar), o.hooks.run("after-tokenize", a), f.stringify(o.util.encode(a.tokens), a.language);
720
+ if (o.hooks.run("before-tokenize", s), !s.grammar)
721
+ throw new Error('The language "' + s.language + '" has no grammar.');
722
+ return s.tokens = o.tokenize(s.code, s.grammar), o.hooks.run("after-tokenize", s), f.stringify(o.util.encode(s.tokens), s.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
@@ -748,12 +748,12 @@ var ge = { exports: {} };
748
748
  tokenize: function(t, e) {
749
749
  var r = e.rest;
750
750
  if (r) {
751
- for (var a in r)
752
- e[a] = r[a];
751
+ for (var s in r)
752
+ e[s] = r[s];
753
753
  delete e.rest;
754
754
  }
755
- var s = new L();
756
- return I(s, s.head, t), T(t, s, e, s.head, 0), D(s);
755
+ var a = new N();
756
+ return R(a, a.head, t), I(t, a, e, a.head, 0), D(a);
757
757
  },
758
758
  /**
759
759
  * @namespace
@@ -790,109 +790,109 @@ var ge = { exports: {} };
790
790
  run: function(t, e) {
791
791
  var r = o.hooks.all[t];
792
792
  if (!(!r || !r.length))
793
- for (var a = 0, s; s = r[a++]; )
794
- s(e);
793
+ for (var s = 0, a; a = r[s++]; )
794
+ a(e);
795
795
  }
796
796
  },
797
797
  Token: f
798
798
  };
799
799
  l.Prism = o;
800
- function f(t, e, r, a) {
801
- this.type = t, this.content = e, this.alias = r, this.length = (a || "").length | 0;
800
+ function f(t, e, r, s) {
801
+ this.type = t, this.content = e, this.alias = r, this.length = (s || "").length | 0;
802
802
  }
803
803
  f.stringify = function t(e, r) {
804
804
  if (typeof e == "string")
805
805
  return e;
806
806
  if (Array.isArray(e)) {
807
- var a = "";
808
- return e.forEach(function(k) {
809
- a += t(k, r);
810
- }), a;
807
+ var s = "";
808
+ return e.forEach(function(_) {
809
+ s += t(_, r);
810
+ }), s;
811
811
  }
812
- var s = {
812
+ var a = {
813
813
  type: e.type,
814
814
  content: t(e.content, r),
815
815
  tag: "span",
816
816
  classes: ["token", e.type],
817
817
  attributes: {},
818
818
  language: r
819
- }, c = e.alias;
820
- c && (Array.isArray(c) ? Array.prototype.push.apply(s.classes, c) : s.classes.push(c)), o.hooks.run("wrap", s);
819
+ }, u = e.alias;
820
+ u && (Array.isArray(u) ? Array.prototype.push.apply(a.classes, u) : a.classes.push(u)), o.hooks.run("wrap", a);
821
821
  var b = "";
822
- for (var u in s.attributes)
823
- b += " " + u + '="' + (s.attributes[u] || "").replace(/"/g, "&quot;") + '"';
824
- return "<" + s.tag + ' class="' + s.classes.join(" ") + '"' + b + ">" + s.content + "</" + s.tag + ">";
822
+ for (var c in a.attributes)
823
+ b += " " + c + '="' + (a.attributes[c] || "").replace(/"/g, "&quot;") + '"';
824
+ return "<" + a.tag + ' class="' + a.classes.join(" ") + '"' + b + ">" + a.content + "</" + a.tag + ">";
825
825
  };
826
- function m(t, e, r, a) {
826
+ function m(t, e, r, s) {
827
827
  t.lastIndex = e;
828
- var s = t.exec(r);
829
- if (s && a && s[1]) {
830
- var c = s[1].length;
831
- s.index += c, s[0] = s[0].slice(c);
828
+ var a = t.exec(r);
829
+ if (a && s && a[1]) {
830
+ var u = a[1].length;
831
+ a.index += u, a[0] = a[0].slice(u);
832
832
  }
833
- return s;
833
+ return a;
834
834
  }
835
- function T(t, e, r, a, s, c) {
835
+ function I(t, e, r, s, a, u) {
836
836
  for (var b in r)
837
837
  if (!(!r.hasOwnProperty(b) || !r[b])) {
838
- var u = r[b];
839
- u = Array.isArray(u) ? u : [u];
840
- for (var k = 0; k < u.length; ++k) {
841
- if (c && c.cause == b + "," + k)
838
+ var c = r[b];
839
+ c = Array.isArray(c) ? c : [c];
840
+ for (var _ = 0; _ < c.length; ++_) {
841
+ if (u && u.cause == b + "," + _)
842
842
  return;
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");
843
+ var F = c[_], $ = F.inside, j = !!F.lookbehind, W = !!F.greedy, J = F.alias;
844
+ if (W && !F.pattern.global) {
845
+ var v = F.pattern.toString().match(/[imsuy]*$/)[0];
846
+ F.pattern = RegExp(F.pattern.source, v + "g");
847
847
  }
848
- for (var Y = F.pattern || F, O = a.next, M = s; O !== e.tail && !(c && M >= c.reach); M += O.value.length, O = O.next) {
849
- var z = O.value;
848
+ for (var S = F.pattern || F, y = s.next, C = a; y !== e.tail && !(u && C >= u.reach); C += y.value.length, y = y.next) {
849
+ var z = y.value;
850
850
  if (e.length > t.length)
851
851
  return;
852
852
  if (!(z instanceof f)) {
853
- var X = 1, $;
854
- if (v) {
855
- if ($ = m(Y, M, t, V), !$ || $.index >= t.length)
853
+ var Y = 1, P;
854
+ if (W) {
855
+ if (P = m(S, C, t, j), !P || P.index >= t.length)
856
856
  break;
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)
857
+ var X = P.index, fe = P.index + P[0].length, U = C;
858
+ for (U += y.value.length; X >= U; )
859
+ y = y.next, U += y.value.length;
860
+ if (U -= y.value.length, C = U, y.value instanceof f)
861
861
  continue;
862
- for (var j = O; j !== e.tail && (B < fe || typeof j.value == "string"); j = j.next)
863
- X++, B += j.value.length;
864
- X--, z = t.slice(M, B), $.index -= M;
865
- } else if ($ = m(Y, 0, z, V), !$)
862
+ for (var V = y; V !== e.tail && (U < fe || typeof V.value == "string"); V = V.next)
863
+ Y++, U += V.value.length;
864
+ Y--, z = t.slice(C, U), P.index -= C;
865
+ } else if (P = m(S, 0, z, j), !P)
866
866
  continue;
867
- var Z = $.index, K = $[0], Q = z.slice(0, Z), ue = z.slice(Z + K.length), ee = M + z.length;
868
- c && ee > c.reach && (c.reach = ee);
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 ? o.tokenize(K, P) : K, w, K);
872
- if (O = I(e, q, me), ue && I(e, O, ue), X > 1) {
867
+ var X = P.index, Z = P[0], Q = z.slice(0, X), ue = z.slice(X + Z.length), ee = C + z.length;
868
+ u && ee > u.reach && (u.reach = ee);
869
+ var K = y.prev;
870
+ Q && (K = R(e, K, Q), C += Q.length), L(e, K, Y);
871
+ var me = new f(b, $ ? o.tokenize(Z, $) : Z, J, Z);
872
+ if (y = R(e, K, me), ue && R(e, y, ue), Y > 1) {
873
873
  var te = {
874
- cause: b + "," + k,
874
+ cause: b + "," + _,
875
875
  reach: ee
876
876
  };
877
- T(t, e, r, O.prev, M, te), c && te.reach > c.reach && (c.reach = te.reach);
877
+ I(t, e, r, y.prev, C, te), u && te.reach > u.reach && (u.reach = te.reach);
878
878
  }
879
879
  }
880
880
  }
881
881
  }
882
882
  }
883
883
  }
884
- function L() {
884
+ function N() {
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 I(t, e, r) {
889
- var a = e.next, s = { value: r, prev: e, next: a };
890
- return e.next = s, a.prev = s, t.length++, s;
888
+ function R(t, e, r) {
889
+ var s = e.next, a = { value: r, prev: e, next: s };
890
+ return e.next = a, s.prev = a, t.length++, a;
891
891
  }
892
- function C(t, e, r) {
893
- for (var a = e.next, s = 0; s < r && a !== t.tail; s++)
894
- a = a.next;
895
- e.next = a, a.prev = e, t.length -= s;
892
+ function L(t, e, r) {
893
+ for (var s = e.next, a = 0; a < r && s !== t.tail; a++)
894
+ s = s.next;
895
+ e.next = s, s.prev = e, t.length -= a;
896
896
  }
897
897
  function D(t) {
898
898
  for (var e = [], r = t.head.next; r !== t.tail; )
@@ -901,8 +901,8 @@ var ge = { exports: {} };
901
901
  }
902
902
  if (!l.document)
903
903
  return l.addEventListener && (o.disableWorkerMessageHandler || l.addEventListener("message", function(t) {
904
- var e = JSON.parse(t.data), r = e.language, a = e.code, s = e.immediateClose;
905
- l.postMessage(o.highlight(a, o.languages[r], r)), s && l.close();
904
+ var e = JSON.parse(t.data), r = e.language, s = e.code, a = e.immediateClose;
905
+ l.postMessage(o.highlight(s, o.languages[r], r)), a && l.close();
906
906
  }, !1)), o;
907
907
  var g = o.util.currentScript();
908
908
  g && (o.filename = g.src, g.hasAttribute("data-manual") && (o.manual = !0));
@@ -910,8 +910,8 @@ var ge = { exports: {} };
910
910
  o.manual || o.highlightAll();
911
911
  }
912
912
  if (!o.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);
913
+ var w = document.readyState;
914
+ w === "loading" || w === "interactive" && g && g.defer ? document.addEventListener("DOMContentLoaded", p) : window.requestAnimationFrame ? window.requestAnimationFrame(p) : window.setTimeout(p, 16);
915
915
  }
916
916
  return o;
917
917
  }(d);
@@ -1006,22 +1006,22 @@ var ge = { exports: {} };
1006
1006
  * @example
1007
1007
  * addInlined('style', 'css');
1008
1008
  */
1009
- value: function(h, y) {
1010
- var A = {};
1011
- A["language-" + y] = {
1009
+ value: function(h, A) {
1010
+ var k = {};
1011
+ k["language-" + A] = {
1012
1012
  pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1013
1013
  lookbehind: !0,
1014
- inside: n.languages[y]
1015
- }, A.cdata = /^<!\[CDATA\[|\]\]>$/i;
1014
+ inside: n.languages[A]
1015
+ }, k.cdata = /^<!\[CDATA\[|\]\]>$/i;
1016
1016
  var o = {
1017
1017
  "included-cdata": {
1018
1018
  pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1019
- inside: A
1019
+ inside: k
1020
1020
  }
1021
1021
  };
1022
- o["language-" + y] = {
1022
+ o["language-" + A] = {
1023
1023
  pattern: /[\s\S]+/,
1024
- inside: n.languages[y]
1024
+ inside: n.languages[A]
1025
1025
  };
1026
1026
  var f = {};
1027
1027
  f[h] = {
@@ -1127,8 +1127,8 @@ var ge = { exports: {} };
1127
1127
  },
1128
1128
  punctuation: /[(){};:,]/
1129
1129
  }, l.languages.css.atrule.inside.rest = l.languages.css;
1130
- var y = l.languages.markup;
1131
- y && (y.tag.addInlined("style", "css"), y.tag.addAttribute("style", "css"));
1130
+ var A = l.languages.markup;
1131
+ A && (A.tag.addInlined("style", "css"), A.tag.addAttribute("style", "css"));
1132
1132
  }(n), n.languages.clike = {
1133
1133
  comment: [
1134
1134
  {
@@ -1295,7 +1295,7 @@ var ge = { exports: {} };
1295
1295
  Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
1296
1296
  var l = "Loading…", h = function(g, p) {
1297
1297
  return "✖ Error " + g + " while fetching file: " + p;
1298
- }, y = "✖ Error: File does not exist or is empty", A = {
1298
+ }, A = "✖ Error: File does not exist or is empty", k = {
1299
1299
  js: "javascript",
1300
1300
  py: "python",
1301
1301
  rb: "ruby",
@@ -1305,52 +1305,52 @@ var ge = { exports: {} };
1305
1305
  bat: "batch",
1306
1306
  h: "c",
1307
1307
  tex: "latex"
1308
- }, o = "data-src-status", f = "loading", m = "loaded", T = "failed", L = "pre[data-src]:not([" + o + '="' + m + '"]):not([' + o + '="' + f + '"])';
1309
- function I(g, p, S) {
1308
+ }, o = "data-src-status", f = "loading", m = "loaded", I = "failed", N = "pre[data-src]:not([" + o + '="' + m + '"]):not([' + o + '="' + f + '"])';
1309
+ function R(g, p, w) {
1310
1310
  var t = new XMLHttpRequest();
1311
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));
1312
+ t.readyState == 4 && (t.status < 400 && t.responseText ? p(t.responseText) : t.status >= 400 ? w(h(t.status, t.statusText)) : w(A));
1313
1313
  }, t.send(null);
1314
1314
  }
1315
- function C(g) {
1315
+ function L(g) {
1316
1316
  var p = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g || "");
1317
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];
1318
+ var w = Number(p[1]), t = p[2], e = p[3];
1319
+ return t ? e ? [w, Number(e)] : [w, void 0] : [w, w];
1320
1320
  }
1321
1321
  }
1322
1322
  n.hooks.add("before-highlightall", function(g) {
1323
- g.selector += ", " + L;
1323
+ g.selector += ", " + N;
1324
1324
  }), n.hooks.add("before-sanity-check", function(g) {
1325
1325
  var p = (
1326
1326
  /** @type {HTMLPreElement} */
1327
1327
  g.element
1328
1328
  );
1329
- if (p.matches(L)) {
1329
+ if (p.matches(N)) {
1330
1330
  g.code = "", p.setAttribute(o, f);
1331
- var S = p.appendChild(document.createElement("CODE"));
1332
- S.textContent = l;
1331
+ var w = p.appendChild(document.createElement("CODE"));
1332
+ w.textContent = l;
1333
1333
  var t = p.getAttribute("data-src"), e = g.language;
1334
1334
  if (e === "none") {
1335
1335
  var r = (/\.(\w+)$/.exec(t) || [, "none"])[1];
1336
- e = A[r] || r;
1336
+ e = k[r] || r;
1337
1337
  }
1338
- n.util.setLanguage(S, e), n.util.setLanguage(p, e);
1339
- var a = n.plugins.autoloader;
1340
- a && a.loadLanguages(e), I(
1338
+ n.util.setLanguage(w, e), n.util.setLanguage(p, e);
1339
+ var s = n.plugins.autoloader;
1340
+ s && s.loadLanguages(e), R(
1341
1341
  t,
1342
- function(s) {
1342
+ function(a) {
1343
1343
  p.setAttribute(o, m);
1344
- var c = C(p.getAttribute("data-range"));
1345
- if (c) {
1346
- var b = s.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)), s = b.slice(u, k).join(`
1348
- `), p.hasAttribute("data-start") || p.setAttribute("data-start", String(u + 1));
1344
+ var u = L(p.getAttribute("data-range"));
1345
+ if (u) {
1346
+ var b = a.split(/\r\n?|\n/g), c = u[0], _ = u[1] == null ? b.length : u[1];
1347
+ c < 0 && (c += b.length), c = Math.max(0, Math.min(c - 1, b.length)), _ < 0 && (_ += b.length), _ = Math.max(0, Math.min(_, b.length)), a = b.slice(c, _).join(`
1348
+ `), p.hasAttribute("data-start") || p.setAttribute("data-start", String(c + 1));
1349
1349
  }
1350
- S.textContent = s, n.highlightElement(S);
1350
+ w.textContent = a, n.highlightElement(w);
1351
1351
  },
1352
- function(s) {
1353
- p.setAttribute(o, T), S.textContent = s;
1352
+ function(a) {
1353
+ p.setAttribute(o, I), w.textContent = a;
1354
1354
  }
1355
1355
  );
1356
1356
  }
@@ -1363,7 +1363,7 @@ var ge = { exports: {} };
1363
1363
  * @param {ParentNode} [container=document]
1364
1364
  */
1365
1365
  highlight: function(p) {
1366
- for (var S = (p || document).querySelectorAll(L), t = 0, e; e = S[t++]; )
1366
+ for (var w = (p || document).querySelectorAll(N), t = 0, e; e = w[t++]; )
1367
1367
  n.highlightElement(e);
1368
1368
  }
1369
1369
  };
@@ -1373,8 +1373,8 @@ var ge = { exports: {} };
1373
1373
  };
1374
1374
  }();
1375
1375
  })(ge);
1376
- var De = ge.exports;
1377
- const ae = /* @__PURE__ */ Ce(De);
1376
+ var Pe = ge.exports;
1377
+ const re = /* @__PURE__ */ De(Pe);
1378
1378
  Prism.languages.clike = {
1379
1379
  comment: [
1380
1380
  {
@@ -2186,8 +2186,8 @@ Prism.languages.sql = {
2186
2186
  "operator",
2187
2187
  "punctuation",
2188
2188
  "number"
2189
- ], y = l.variable[1].inside, A = 0; A < h.length; A++)
2190
- y[h[A]] = i.languages.bash[h[A]];
2189
+ ], A = l.variable[1].inside, k = 0; k < h.length; k++)
2190
+ A[h[k]] = i.languages.bash[h[k]];
2191
2191
  i.languages.sh = i.languages.bash, i.languages.shell = i.languages.bash;
2192
2192
  })(Prism);
2193
2193
  Prism.languages.json = {
@@ -2215,7 +2215,7 @@ Prism.languages.json = {
2215
2215
  }
2216
2216
  };
2217
2217
  Prism.languages.webmanifest = Prism.languages.json;
2218
- const Pe = `
2218
+ const $e = `
2219
2219
  /* 默认代码颜色 */
2220
2220
  .hep-cr-editor .hep-cr-highlight code,
2221
2221
  .hep-cr-editor .hep-cr-highlight pre {
@@ -2301,7 +2301,7 @@ const Pe = `
2301
2301
  .hep-cr-editor .token.console {
2302
2302
  color: #f8f8f2 !important;
2303
2303
  }
2304
- `, $e = `
2304
+ `, Me = `
2305
2305
  /* 默认代码颜色 */
2306
2306
  .hep-cr-editor .hep-cr-highlight code,
2307
2307
  .hep-cr-editor .hep-cr-highlight pre {
@@ -2378,7 +2378,7 @@ const Pe = `
2378
2378
  .hep-cr-editor .token.console {
2379
2379
  color: #333 !important;
2380
2380
  }
2381
- `, Me = ["innerHTML"], Ue = ["value", "disabled"], He = /* @__PURE__ */ ie({
2381
+ `, Ue = ["innerHTML"], He = ["value", "disabled"], Be = /* @__PURE__ */ ie({
2382
2382
  __name: "CodeEditor",
2383
2383
  props: {
2384
2384
  modelValue: {},
@@ -2390,15 +2390,15 @@ const Pe = `
2390
2390
  setup(i, { emit: d }) {
2391
2391
  be((g) => ({
2392
2392
  v6d72dafb: m.value
2393
- })), typeof window < "u" && (window.Prism = ae);
2393
+ })), typeof window < "u" && (window.Prism = re);
2394
2394
  function n(g) {
2395
2395
  if (typeof document > "u") return;
2396
- const p = "hep-cr-prism-styles", S = document.getElementById(p), t = g === "dark" ? Pe : $e;
2397
- S && S.remove();
2396
+ const p = "hep-cr-prism-styles", w = document.getElementById(p), t = g === "dark" ? $e : Me;
2397
+ w && w.remove();
2398
2398
  const e = document.createElement("style");
2399
2399
  e.id = p, e.textContent = t, document.head.appendChild(e);
2400
2400
  }
2401
- const l = i, h = d, y = N(null), A = N(null), o = {
2401
+ const l = i, h = d, A = O(null), k = O(null), o = {
2402
2402
  javascript: "javascript",
2403
2403
  js: "javascript",
2404
2404
  typescript: "typescript",
@@ -2429,60 +2429,60 @@ const Pe = `
2429
2429
  yml: "yaml",
2430
2430
  markdown: "markdown",
2431
2431
  md: "markdown"
2432
- }, f = G(() => o[l.language.toLowerCase()] || "javascript"), m = G(() => l.theme === "dark" ? "#1e1e1e" : "#fafafa"), T = G(() => {
2432
+ }, f = B(() => o[l.language.toLowerCase()] || "javascript"), m = B(() => l.theme === "dark" ? "#1e1e1e" : "#fafafa"), I = B(() => {
2433
2433
  try {
2434
- const g = ae.languages[f.value];
2434
+ const g = re.languages[f.value];
2435
2435
  if (g)
2436
- return ae.highlight(l.modelValue || "", g, f.value);
2436
+ return re.highlight(l.modelValue || "", g, f.value);
2437
2437
  } catch {
2438
2438
  }
2439
- return L(l.modelValue || "");
2439
+ return N(l.modelValue || "");
2440
2440
  });
2441
- function L(g) {
2441
+ function N(g) {
2442
2442
  const p = document.createElement("div");
2443
2443
  return p.textContent = g, p.innerHTML;
2444
2444
  }
2445
- function I(g) {
2445
+ function R(g) {
2446
2446
  const p = g.target;
2447
2447
  h("update:modelValue", p.value);
2448
2448
  }
2449
- function C() {
2450
- y.value && A.value && (A.value.scrollTop = y.value.scrollTop, A.value.scrollLeft = y.value.scrollLeft);
2449
+ function L() {
2450
+ A.value && k.value && (k.value.scrollTop = A.value.scrollTop, k.value.scrollLeft = A.value.scrollLeft);
2451
2451
  }
2452
2452
  function D(g) {
2453
2453
  if (g.key === "Tab") {
2454
2454
  g.preventDefault();
2455
- const p = g.target, S = p.selectionStart, t = p.selectionEnd, e = p.value;
2456
- p.value = e.substring(0, S) + " " + e.substring(t), p.selectionStart = p.selectionEnd = S + 2, h("update:modelValue", p.value);
2455
+ const p = g.target, w = p.selectionStart, t = p.selectionEnd, e = p.value;
2456
+ p.value = e.substring(0, w) + " " + e.substring(t), p.selectionStart = p.selectionEnd = w + 2, h("update:modelValue", p.value);
2457
2457
  }
2458
2458
  }
2459
2459
  return pe(() => {
2460
2460
  n(l.theme);
2461
2461
  }), le(() => l.theme, (g) => {
2462
2462
  n(g);
2463
- }), (g, p) => (_(), R("div", {
2464
- class: W(["hep-cr-editor", `hep-cr-theme-${i.theme}`])
2463
+ }), (g, p) => (T(), x("div", {
2464
+ class: G(["hep-cr-editor", `hep-cr-theme-${i.theme}`])
2465
2465
  }, [
2466
2466
  E("pre", {
2467
2467
  ref_key: "highlightRef",
2468
- ref: A,
2469
- class: W(["hep-cr-highlight", [`language-${f.value}`, `hep-cr-prism-${i.theme}`]]),
2468
+ ref: k,
2469
+ class: G(["hep-cr-highlight", [`language-${f.value}`, `hep-cr-prism-${i.theme}`]]),
2470
2470
  "aria-hidden": "true"
2471
2471
  }, [
2472
- E("code", { innerHTML: T.value }, null, 8, Me)
2472
+ E("code", { innerHTML: I.value }, null, 8, Ue)
2473
2473
  ], 2),
2474
2474
  E("textarea", {
2475
2475
  ref_key: "codeRef",
2476
- ref: y,
2476
+ ref: A,
2477
2477
  class: "hep-cr-input",
2478
2478
  value: i.modelValue,
2479
2479
  disabled: i.disabled,
2480
- onInput: I,
2481
- onScroll: C,
2480
+ onInput: R,
2481
+ onScroll: L,
2482
2482
  onKeydown: D,
2483
2483
  spellcheck: "false",
2484
2484
  placeholder: "Write your code here..."
2485
- }, null, 40, Ue)
2485
+ }, null, 40, He)
2486
2486
  ], 2));
2487
2487
  }
2488
2488
  }), he = (i, d) => {
@@ -2490,25 +2490,63 @@ const Pe = `
2490
2490
  for (const [l, h] of d)
2491
2491
  n[l] = h;
2492
2492
  return n;
2493
- }, Be = /* @__PURE__ */ he(He, [["__scopeId", "data-v-bf752fa5"]]), Ge = { class: "hep-cr-header" }, ze = { class: "hep-cr-controls" }, je = ["disabled"], We = {
2493
+ }, Ge = /* @__PURE__ */ he(Be, [["__scopeId", "data-v-bf752fa5"]]), ze = { class: "hep-cr-header" }, je = { class: "hep-cr-controls" }, We = ["disabled"], Ve = {
2494
2494
  key: 0,
2495
2495
  value: ""
2496
- }, Ve = ["value"], Ye = { class: "hep-cr-actions" }, Xe = ["disabled"], Ze = {
2496
+ }, Ye = ["value"], Xe = { class: "hep-cr-actions" }, Ze = ["disabled"], Ke = {
2497
2497
  key: 0,
2498
2498
  class: "hep-cr-spinner"
2499
- }, Ke = {
2499
+ }, qe = {
2500
2500
  key: 1,
2501
2501
  class: "hep-cr-run-icon"
2502
- }, qe = ["title"], Je = {
2502
+ }, Je = ["title"], Qe = {
2503
+ key: 0,
2504
+ width: "16",
2505
+ height: "16",
2506
+ viewBox: "0 0 24 24",
2507
+ fill: "none",
2508
+ stroke: "currentColor",
2509
+ "stroke-width": "2"
2510
+ }, et = {
2511
+ key: 1,
2512
+ width: "16",
2513
+ height: "16",
2514
+ viewBox: "0 0 24 24",
2515
+ fill: "none",
2516
+ stroke: "currentColor",
2517
+ "stroke-width": "2"
2518
+ }, tt = {
2503
2519
  key: 0,
2504
2520
  class: "hep-cr-error"
2505
- }, Qe = { class: "hep-cr-main" }, et = { class: "hep-cr-panel-header" }, tt = { class: "hep-cr-language-badge" }, nt = { class: "hep-cr-panel-header" }, rt = { class: "hep-cr-output-tabs" }, at = { class: "hep-cr-output-actions" }, ot = {
2521
+ }, nt = { class: "hep-cr-main" }, at = { class: "hep-cr-panel-header" }, rt = { class: "hep-cr-output-actions" }, ot = { class: "hep-cr-language-badge" }, st = ["disabled", "title"], it = {
2522
+ key: 0,
2523
+ width: "14",
2524
+ height: "14",
2525
+ viewBox: "0 0 24 24",
2526
+ fill: "none",
2527
+ stroke: "currentColor",
2528
+ "stroke-width": "2"
2529
+ }, lt = {
2530
+ key: 1,
2531
+ class: "hep-cr-copied-text"
2532
+ }, ut = { class: "hep-cr-panel-header" }, ct = { class: "hep-cr-output-tabs" }, dt = { class: "hep-cr-output-actions" }, pt = {
2506
2533
  key: 0,
2507
2534
  class: "hep-cr-execution-time"
2508
- }, st = { class: "hep-cr-output-content" }, it = { key: 0 }, lt = {
2535
+ }, gt = ["disabled", "title"], ht = {
2536
+ key: 0,
2537
+ width: "14",
2538
+ height: "14",
2539
+ viewBox: "0 0 24 24",
2540
+ fill: "none",
2541
+ stroke: "currentColor",
2542
+ "stroke-width": "2"
2543
+ }, ft = {
2544
+ key: 1,
2545
+ class: "hep-cr-copied-text"
2546
+ }, mt = { class: "hep-cr-output-content" }, bt = { key: 0 }, Et = {
2509
2547
  key: 1,
2510
2548
  class: "hep-cr-stderr"
2511
- }, ut = /* @__PURE__ */ ie({
2549
+ }, vt = /* @__PURE__ */ ie({
2512
2550
  __name: "CodeRunner",
2513
2551
  props: {
2514
2552
  pistonUrl: { default: "/api/piston" },
@@ -2522,179 +2560,204 @@ const Pe = `
2522
2560
  },
2523
2561
  emits: ["execute-start", "execute-end", "language-change"],
2524
2562
  setup(i, { emit: d }) {
2525
- const n = i, l = d, h = N([]), y = N(n.language), A = N(n.theme), o = N(""), f = N(""), m = N(""), T = N(!1), L = N(null), I = N("stdout"), C = N(null), D = N(!1), g = N(60);
2563
+ const n = i, l = d, h = O([]), A = O(n.language), k = O(n.theme), o = O(""), f = O(""), m = O(""), I = O(!1), N = O(null), R = O("stdout"), L = O(null), D = O(!1), g = O(60);
2526
2564
  function p() {
2527
- A.value = A.value === "light" ? "dark" : "light";
2565
+ k.value = k.value === "light" ? "dark" : "light";
2528
2566
  }
2529
- const S = G(
2567
+ const w = B(
2530
2568
  () => new Le({ pistonUrl: n.pistonUrl })
2531
- ), t = G(() => h.value.map((v) => ({
2569
+ ), t = B(() => h.value.map((v) => ({
2532
2570
  value: `${v.language}:${v.version}`,
2533
2571
  label: `${v.language.charAt(0).toUpperCase() + v.language.slice(1)} ${v.version}`
2534
- }))), e = G(() => {
2535
- const v = y.value;
2572
+ }))), e = B(() => {
2573
+ const v = A.value;
2536
2574
  return v.includes(":") ? v.split(":")[0] : v;
2537
2575
  });
2538
2576
  async function r() {
2539
- D.value = !0, C.value = null;
2577
+ D.value = !0, L.value = null;
2540
2578
  try {
2541
- h.value = await S.value.getRuntimes();
2579
+ h.value = await w.value.getRuntimes();
2542
2580
  } catch (v) {
2543
- C.value = v instanceof Error ? v.message : "Failed to load runtimes";
2581
+ L.value = v instanceof Error ? v.message : "Failed to load runtimes";
2544
2582
  } finally {
2545
2583
  D.value = !1;
2546
2584
  }
2547
2585
  }
2548
- le(y, (v) => {
2549
- const w = v.includes(":") ? v.split(":")[0] : v, x = re(w);
2550
- o.value = x, l("language-change", w, x);
2586
+ le(A, (v) => {
2587
+ const S = v.includes(":") ? v.split(":")[0] : v, y = ae(S);
2588
+ o.value = y, l("language-change", S, y);
2551
2589
  });
2552
- async function a() {
2553
- if (!T.value) {
2554
- T.value = !0, f.value = "", m.value = "", L.value = null, C.value = null, I.value = "stdout", l("execute-start");
2590
+ async function s() {
2591
+ if (!I.value) {
2592
+ I.value = !0, f.value = "", m.value = "", N.value = null, L.value = null, R.value = "stdout", l("execute-start");
2555
2593
  try {
2556
- const v = await S.value.execute(e.value, o.value);
2557
- f.value = v.output, m.value = v.stderr, L.value = v.executionTime || null, I.value = v.stderr ? "stderr" : "stdout", l("execute-end", v);
2594
+ const v = await w.value.execute(e.value, o.value);
2595
+ f.value = v.output, m.value = v.stderr, N.value = v.executionTime || null, R.value = v.stderr ? "stderr" : "stdout", l("execute-end", v);
2558
2596
  } catch (v) {
2559
- C.value = v instanceof Error ? v.message : "Execution failed", l("execute-end", {
2597
+ L.value = v instanceof Error ? v.message : "Execution failed", l("execute-end", {
2560
2598
  success: !1,
2561
2599
  output: "",
2562
- stderr: C.value,
2600
+ stderr: L.value,
2563
2601
  code: -1
2564
2602
  });
2565
2603
  } finally {
2566
- T.value = !1;
2604
+ I.value = !1;
2567
2605
  }
2568
2606
  }
2569
2607
  }
2570
- function s() {
2571
- f.value = "", m.value = "", L.value = null, C.value = null;
2608
+ const a = O(!1), u = O(!1);
2609
+ async function b() {
2610
+ await navigator.clipboard.writeText(o.value), a.value = !0, setTimeout(() => {
2611
+ a.value = !1;
2612
+ }, 2e3);
2572
2613
  }
2573
2614
  async function c() {
2574
- const v = I.value === "stdout" ? f.value : m.value;
2575
- await navigator.clipboard.writeText(v);
2615
+ const v = R.value === "stdout" ? f.value : m.value;
2616
+ await navigator.clipboard.writeText(v), u.value = !0, setTimeout(() => {
2617
+ u.value = !1;
2618
+ }, 2e3);
2576
2619
  }
2577
- function b() {
2578
- o.value = re(e.value);
2620
+ function _() {
2621
+ o.value = ae(e.value);
2579
2622
  }
2580
- let u = !1;
2581
- function k(v) {
2582
- u = !0, document.addEventListener("mousemove", F), document.addEventListener("mouseup", P), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
2623
+ let F = !1;
2624
+ function $(v) {
2625
+ F = !0, document.addEventListener("mousemove", j), document.addEventListener("mouseup", W), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
2583
2626
  }
2584
- function F(v) {
2585
- if (!u) return;
2586
- const w = document.querySelector(
2627
+ function j(v) {
2628
+ if (!F) return;
2629
+ const S = document.querySelector(
2587
2630
  ".hep-cr-main"
2588
2631
  );
2589
- if (!w) return;
2590
- const x = w.getBoundingClientRect(), Y = (v.clientX - x.left) / x.width * 100;
2591
- g.value = Math.max(20, Math.min(80, Y));
2632
+ if (!S) return;
2633
+ const y = S.getBoundingClientRect(), C = (v.clientX - y.left) / y.width * 100;
2634
+ g.value = Math.max(20, Math.min(80, C));
2592
2635
  }
2593
- function P() {
2594
- u = !1, document.removeEventListener("mousemove", F), document.removeEventListener("mouseup", P), document.body.style.cursor = "", document.body.style.userSelect = "";
2636
+ function W() {
2637
+ F = !1, document.removeEventListener("mousemove", j), document.removeEventListener("mouseup", W), document.body.style.cursor = "", document.body.style.userSelect = "";
2595
2638
  }
2596
2639
  pe(async () => {
2597
- await r(), o.value || (o.value = n.defaultCode || re(y.value));
2640
+ await r(), o.value || (o.value = n.defaultCode || ae(A.value));
2598
2641
  });
2599
- const V = G(() => `hep-cr-runner-${A.value}`);
2600
- return (v, w) => (_(), R("div", {
2601
- class: W(["hep-cr-runner", V.value])
2642
+ const J = B(() => `hep-cr-runner-${k.value}`);
2643
+ return (v, S) => (T(), x("div", {
2644
+ class: G(["hep-cr-runner", J.value])
2602
2645
  }, [
2603
- E("div", Ge, [
2604
- E("div", ze, [
2605
- i.showLanguageSelector ? Ee((_(), R("select", {
2646
+ E("div", ze, [
2647
+ E("div", je, [
2648
+ i.showLanguageSelector ? Ee((T(), x("select", {
2606
2649
  key: 0,
2607
- "onUpdate:modelValue": w[0] || (w[0] = (x) => y.value = x),
2650
+ "onUpdate:modelValue": S[0] || (S[0] = (y) => A.value = y),
2608
2651
  class: "hep-cr-language-select",
2609
- disabled: T.value
2652
+ disabled: I.value
2610
2653
  }, [
2611
- D.value ? (_(), R("option", We, "加载中...")) : U("", !0),
2612
- (_(!0), R(ve, null, ye(t.value, (x) => (_(), R("option", {
2613
- key: x.value,
2614
- value: x.value
2615
- }, H(x.label), 9, Ve))), 128))
2616
- ], 8, je)), [
2617
- [Ae, y.value]
2618
- ]) : U("", !0)
2654
+ D.value ? (T(), x("option", Ve, "加载中...")) : M("", !0),
2655
+ (T(!0), x(ve, null, ye(t.value, (y) => (T(), x("option", {
2656
+ key: y.value,
2657
+ value: y.value
2658
+ }, H(y.label), 9, Ye))), 128))
2659
+ ], 8, We)), [
2660
+ [Ae, A.value]
2661
+ ]) : M("", !0)
2619
2662
  ]),
2620
- E("div", Ye, [
2663
+ E("div", Xe, [
2621
2664
  E("button", {
2622
2665
  class: "hep-cr-btn hep-cr-btn-run",
2623
- disabled: T.value || D.value,
2624
- onClick: a
2666
+ disabled: I.value || D.value,
2667
+ onClick: s
2625
2668
  }, [
2626
- T.value ? (_(), R("span", Ze)) : (_(), R("span", Ke, "▶")),
2627
- Se(" " + H(T.value ? "运行中..." : i.executorLabel), 1)
2628
- ], 8, Xe),
2629
- i.showEditor && i.editable ? (_(), R("button", {
2669
+ I.value ? (T(), x("span", Ke)) : (T(), x("span", qe, "▶")),
2670
+ ke(" " + H(I.value ? "运行中..." : i.executorLabel), 1)
2671
+ ], 8, Ze),
2672
+ i.showEditor && i.editable ? (T(), x("button", {
2630
2673
  key: 0,
2631
2674
  class: "hep-cr-btn hep-cr-btn-reset",
2632
- onClick: b
2633
- }, " 重置 ")) : U("", !0),
2675
+ onClick: _
2676
+ }, " 重置 ")) : M("", !0),
2634
2677
  E("button", {
2635
2678
  class: "hep-cr-btn hep-cr-btn-theme",
2636
2679
  onClick: p,
2637
- title: A.value === "light" ? "Switch to dark mode" : "Switch to light mode"
2638
- }, H(A.value === "light" ? "🌙" : "☀️"), 9, qe)
2680
+ title: k.value === "light" ? "Switch to dark mode" : "Switch to light mode"
2681
+ }, [
2682
+ k.value === "light" ? (T(), x("svg", Qe, [...S[4] || (S[4] = [
2683
+ E("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)
2684
+ ])])) : (T(), x("svg", et, [...S[5] || (S[5] = [
2685
+ Se('<circle cx="12" cy="12" r="5" data-v-00f5b2e7></circle><line x1="12" y1="1" x2="12" y2="3" data-v-00f5b2e7></line><line x1="12" y1="21" x2="12" y2="23" data-v-00f5b2e7></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64" data-v-00f5b2e7></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78" data-v-00f5b2e7></line><line x1="1" y1="12" x2="3" y2="12" data-v-00f5b2e7></line><line x1="21" y1="12" x2="23" y2="12" data-v-00f5b2e7></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36" data-v-00f5b2e7></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22" data-v-00f5b2e7></line>', 9)
2686
+ ])]))
2687
+ ], 8, Je)
2639
2688
  ])
2640
2689
  ]),
2641
- C.value ? (_(), R("div", Je, H(C.value), 1)) : U("", !0),
2642
- E("div", Qe, [
2643
- i.showEditor ? (_(), R("div", {
2690
+ L.value ? (T(), x("div", tt, H(L.value), 1)) : M("", !0),
2691
+ E("div", nt, [
2692
+ i.showEditor ? (T(), x("div", {
2644
2693
  key: 0,
2645
2694
  class: "hep-cr-editor-panel",
2646
2695
  style: oe({ width: g.value + "%" })
2647
2696
  }, [
2648
- E("div", et, [
2649
- w[4] || (w[4] = E("span", { class: "hep-cr-panel-title" }, "编辑器", -1)),
2650
- E("span", tt, H(e.value), 1)
2697
+ E("div", at, [
2698
+ S[7] || (S[7] = E("span", { class: "hep-cr-panel-title" }, "编辑器", -1)),
2699
+ E("div", rt, [
2700
+ E("span", ot, H(e.value), 1),
2701
+ E("button", {
2702
+ class: G(["hep-cr-btn-icon", { "hep-cr-btn-copied": a.value }]),
2703
+ disabled: a.value,
2704
+ onClick: b,
2705
+ title: a.value ? "已复制" : "复制"
2706
+ }, [
2707
+ a.value ? (T(), x("span", lt, "已复制")) : (T(), x("svg", it, [...S[6] || (S[6] = [
2708
+ E("rect", {
2709
+ x: "9",
2710
+ y: "9",
2711
+ width: "13",
2712
+ height: "13",
2713
+ rx: "2",
2714
+ ry: "2"
2715
+ }, null, -1),
2716
+ E("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
2717
+ ])]))
2718
+ ], 10, st)
2719
+ ])
2651
2720
  ]),
2652
- se(Be, {
2721
+ se(Ge, {
2653
2722
  modelValue: o.value,
2654
- "onUpdate:modelValue": w[1] || (w[1] = (x) => o.value = x),
2723
+ "onUpdate:modelValue": S[1] || (S[1] = (y) => o.value = y),
2655
2724
  language: e.value,
2656
- theme: A.value,
2657
- disabled: !i.editable || T.value
2725
+ theme: k.value,
2726
+ disabled: !i.editable || I.value
2658
2727
  }, null, 8, ["modelValue", "language", "theme", "disabled"])
2659
- ], 4)) : U("", !0),
2660
- i.showEditor ? (_(), R("div", {
2728
+ ], 4)) : M("", !0),
2729
+ i.showEditor ? (T(), x("div", {
2661
2730
  key: 1,
2662
2731
  class: "hep-cr-resize-handle",
2663
- onMousedown: k
2664
- }, [...w[5] || (w[5] = [
2732
+ onMousedown: $
2733
+ }, [...S[8] || (S[8] = [
2665
2734
  E("div", { class: "hep-cr-resize-line" }, null, -1)
2666
- ])], 32)) : U("", !0),
2735
+ ])], 32)) : M("", !0),
2667
2736
  E("div", {
2668
2737
  class: "hep-cr-output-panel",
2669
2738
  style: oe({ width: i.showEditor ? 100 - g.value + "%" : "100%" })
2670
2739
  }, [
2671
- E("div", nt, [
2672
- E("div", rt, [
2740
+ E("div", ut, [
2741
+ E("div", ct, [
2673
2742
  E("button", {
2674
- class: W(["hep-cr-tab", { active: I.value === "stdout" }]),
2675
- onClick: w[2] || (w[2] = (x) => I.value = "stdout")
2743
+ class: G(["hep-cr-tab", { active: R.value === "stdout" }]),
2744
+ onClick: S[2] || (S[2] = (y) => R.value = "stdout")
2676
2745
  }, " 输出 ", 2),
2677
- m.value ? (_(), R("button", {
2746
+ m.value ? (T(), x("button", {
2678
2747
  key: 0,
2679
- class: W(["hep-cr-tab", { active: I.value === "stderr" }]),
2680
- onClick: w[3] || (w[3] = (x) => I.value = "stderr")
2681
- }, " 错误 ", 2)) : U("", !0)
2748
+ class: G(["hep-cr-tab", "hep-cr-tab-error", { active: R.value === "stderr" }]),
2749
+ onClick: S[3] || (S[3] = (y) => R.value = "stderr")
2750
+ }, " 错误 ", 2)) : M("", !0)
2682
2751
  ]),
2683
- E("div", at, [
2684
- L.value !== null ? (_(), R("span", ot, H(L.value) + "ms ", 1)) : U("", !0),
2752
+ E("div", dt, [
2753
+ N.value !== null ? (T(), x("span", pt, H(N.value) + "ms ", 1)) : M("", !0),
2685
2754
  E("button", {
2686
- class: "hep-cr-btn-icon",
2755
+ class: G(["hep-cr-btn-icon", { "hep-cr-btn-copied": u.value }]),
2756
+ disabled: u.value,
2687
2757
  onClick: c,
2688
- title: "复制"
2689
- }, [...w[6] || (w[6] = [
2690
- E("svg", {
2691
- width: "14",
2692
- height: "14",
2693
- viewBox: "0 0 24 24",
2694
- fill: "none",
2695
- stroke: "currentColor",
2696
- "stroke-width": "2"
2697
- }, [
2758
+ title: u.value ? "已复制" : "复制"
2759
+ }, [
2760
+ u.value ? (T(), x("span", ft, "已复制")) : (T(), x("svg", ht, [...S[9] || (S[9] = [
2698
2761
  E("rect", {
2699
2762
  x: "9",
2700
2763
  y: "9",
@@ -2702,40 +2765,23 @@ const Pe = `
2702
2765
  height: "13",
2703
2766
  rx: "2",
2704
2767
  ry: "2"
2705
- }),
2706
- E("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
2707
- ], -1)
2708
- ])]),
2709
- E("button", {
2710
- class: "hep-cr-btn-icon",
2711
- onClick: s,
2712
- title: "清除"
2713
- }, [...w[7] || (w[7] = [
2714
- E("svg", {
2715
- width: "14",
2716
- height: "14",
2717
- viewBox: "0 0 24 24",
2718
- fill: "none",
2719
- stroke: "currentColor",
2720
- "stroke-width": "2"
2721
- }, [
2722
- E("polyline", { points: "3 6 5 6 21 6" }),
2723
- 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" })
2724
- ], -1)
2725
- ])])
2768
+ }, null, -1),
2769
+ E("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)
2770
+ ])]))
2771
+ ], 10, gt)
2726
2772
  ])
2727
2773
  ]),
2728
- E("div", st, [
2729
- I.value === "stdout" ? (_(), R("pre", it, H(f.value || '点击"运行"执行代码'), 1)) : (_(), R("pre", lt, H(m.value), 1))
2774
+ E("div", mt, [
2775
+ R.value === "stdout" ? (T(), x("pre", bt, H(I.value ? "代码执行中..." : f.value || '点击"运行"执行代码'), 1)) : (T(), x("pre", Et, H(m.value), 1))
2730
2776
  ])
2731
2777
  ], 4)
2732
2778
  ])
2733
2779
  ], 2));
2734
2780
  }
2735
- }), 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 = {
2781
+ }), q = /* @__PURE__ */ he(vt, [["__scopeId", "data-v-00f5b2e7"]]), yt = { class: "hep-cr-dialog-header" }, At = { class: "hep-cr-dialog-title" }, kt = { class: "hep-cr-dialog-body" }, St = {
2736
2782
  key: 0,
2737
2783
  class: "hep-cr-dialog-footer"
2738
- }, ft = /* @__PURE__ */ ie({
2784
+ }, Tt = /* @__PURE__ */ ie({
2739
2785
  __name: "CodeRunnerDialog",
2740
2786
  props: {
2741
2787
  modelValue: { type: Boolean, default: !1 },
@@ -2752,25 +2798,25 @@ const Pe = `
2752
2798
  },
2753
2799
  emits: ["update:modelValue", "close"],
2754
2800
  setup(i, { expose: d, emit: n }) {
2755
- const l = i, h = n, y = N(l.modelValue), A = G(() => l.modelValue !== void 0 ? l.modelValue : y.value);
2801
+ const l = i, h = n, A = O(l.modelValue), k = B(() => l.modelValue !== void 0 ? l.modelValue : A.value);
2756
2802
  le(
2757
2803
  () => l.modelValue,
2758
2804
  (m) => {
2759
- m !== void 0 && (y.value = m);
2805
+ m !== void 0 && (A.value = m);
2760
2806
  }
2761
2807
  );
2762
2808
  function o() {
2763
- y.value = !1, h("update:modelValue", !1), h("close");
2809
+ A.value = !1, h("update:modelValue", !1), h("close");
2764
2810
  }
2765
2811
  function f(m) {
2766
2812
  m.target === m.currentTarget && o();
2767
2813
  }
2768
2814
  return d({
2769
2815
  close: o
2770
- }), (m, T) => (_(), ke(we, { to: "body" }, [
2771
- se(Te, { name: "hep-cr-dialog-fade" }, {
2772
- default: Ie(() => [
2773
- A.value ? (_(), R("div", {
2816
+ }), (m, I) => (T(), we(Te, { to: "body" }, [
2817
+ se(_e, { name: "hep-cr-dialog-fade" }, {
2818
+ default: xe(() => [
2819
+ k.value ? (T(), x("div", {
2774
2820
  key: 0,
2775
2821
  class: "hep-cr-dialog-overlay",
2776
2822
  onClick: f
@@ -2779,12 +2825,12 @@ const Pe = `
2779
2825
  class: "hep-cr-dialog-container",
2780
2826
  style: oe({ width: typeof i.width == "number" ? i.width + "px" : i.width })
2781
2827
  }, [
2782
- E("div", ct, [
2783
- E("h3", dt, H(i.title), 1),
2828
+ E("div", yt, [
2829
+ E("h3", At, H(i.title), 1),
2784
2830
  E("button", {
2785
2831
  class: "hep-cr-dialog-close",
2786
2832
  onClick: o
2787
- }, [...T[0] || (T[0] = [
2833
+ }, [...I[0] || (I[0] = [
2788
2834
  E("svg", {
2789
2835
  width: "16",
2790
2836
  height: "16",
@@ -2808,30 +2854,30 @@ const Pe = `
2808
2854
  ], -1)
2809
2855
  ])])
2810
2856
  ]),
2811
- E("div", pt, [
2812
- se(J, Fe(_e(m.$attrs)), null, 16)
2857
+ E("div", kt, [
2858
+ se(q, Ie(Fe(m.$attrs)), null, 16)
2813
2859
  ]),
2814
- m.$slots.footer ? (_(), R("div", gt, [
2860
+ m.$slots.footer ? (T(), x("div", St, [
2815
2861
  Re(m.$slots, "footer", { close: o })
2816
- ])) : U("", !0)
2862
+ ])) : M("", !0)
2817
2863
  ], 4)
2818
- ])) : U("", !0)
2864
+ ])) : M("", !0)
2819
2865
  ]),
2820
2866
  _: 3
2821
2867
  })
2822
2868
  ]));
2823
2869
  }
2824
2870
  });
2825
- J.install = (i) => {
2826
- i.component("CodeRunner", J);
2871
+ q.install = (i) => {
2872
+ i.component("CodeRunner", q);
2827
2873
  };
2828
- const mt = {
2874
+ const _t = {
2829
2875
  install(i) {
2830
- i.component("CodeRunner", J);
2876
+ i.component("CodeRunner", q);
2831
2877
  }
2832
2878
  };
2833
2879
  export {
2834
- J as CodeRunner,
2835
- ft as CodeRunnerDialog,
2836
- mt as default
2880
+ q as CodeRunner,
2881
+ Tt as CodeRunnerDialog,
2882
+ _t as default
2837
2883
  };