@hep-code-runner/react 3.3.10 → 3.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -12
- package/dist/index.mjs +184 -178
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8,24 +8,24 @@ process.env.NODE_ENV === "production" ? He.exports = function() {
|
|
|
8
8
|
if (We) return Fe;
|
|
9
9
|
We = 1;
|
|
10
10
|
var d = Be, t = Symbol.for("react.element"), l = Symbol.for("react.fragment"), p = Object.prototype.hasOwnProperty, m = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, w = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
11
|
-
function s(
|
|
12
|
-
var k,
|
|
13
|
-
for (k in b !== void 0 && (L = "" + b), y.key !== void 0 && (L = "" + y.key), y.ref !== void 0 && (E = y.ref), y) p.call(y, k) && !w.hasOwnProperty(k) && (
|
|
14
|
-
if (
|
|
15
|
-
return { $$typeof: t, type:
|
|
11
|
+
function s(T, y, b) {
|
|
12
|
+
var k, _ = {}, L = null, E = null;
|
|
13
|
+
for (k in b !== void 0 && (L = "" + b), y.key !== void 0 && (L = "" + y.key), y.ref !== void 0 && (E = y.ref), y) p.call(y, k) && !w.hasOwnProperty(k) && (_[k] = y[k]);
|
|
14
|
+
if (T && T.defaultProps) for (k in y = T.defaultProps) _[k] === void 0 && (_[k] = y[k]);
|
|
15
|
+
return { $$typeof: t, type: T, key: L, ref: E, props: _, _owner: m.current };
|
|
16
16
|
}
|
|
17
17
|
return Fe.Fragment = l, Fe.jsx = s, Fe.jsxs = s, Fe;
|
|
18
18
|
}() : He.exports = (Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
|
|
19
|
-
var d, t = Be, l = Symbol.for("react.element"), p = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"),
|
|
19
|
+
var d, t = Be, l = Symbol.for("react.element"), p = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), y = Symbol.for("react.context"), b = Symbol.for("react.forward_ref"), k = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), L = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), N = Symbol.for("react.offscreen"), j = Symbol.iterator, r = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
20
20
|
function n(e) {
|
|
21
21
|
for (var g = arguments.length, f = new Array(g > 1 ? g - 1 : 0), P = 1; P < g; P++) f[P - 1] = arguments[P];
|
|
22
|
-
(function(
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
var $ =
|
|
22
|
+
(function(I, R, A) {
|
|
23
|
+
var O = r.ReactDebugCurrentFrame.getStackAddendum();
|
|
24
|
+
O !== "" && (R += "%s", A = A.concat([O]));
|
|
25
|
+
var $ = A.map(function(M) {
|
|
26
26
|
return String(M);
|
|
27
27
|
});
|
|
28
|
-
$.unshift("Warning: " + R), Function.prototype.apply.call(console[
|
|
28
|
+
$.unshift("Warning: " + R), Function.prototype.apply.call(console[I], console, $);
|
|
29
29
|
})("error", e, f);
|
|
30
30
|
}
|
|
31
31
|
function a(e) {
|
|
@@ -46,28 +46,28 @@ process.env.NODE_ENV === "production" ? He.exports = function() {
|
|
|
46
46
|
return "StrictMode";
|
|
47
47
|
case k:
|
|
48
48
|
return "Suspense";
|
|
49
|
-
case
|
|
49
|
+
case _:
|
|
50
50
|
return "SuspenseList";
|
|
51
51
|
}
|
|
52
52
|
if (typeof e == "object") switch (e.$$typeof) {
|
|
53
53
|
case y:
|
|
54
54
|
return a(e) + ".Consumer";
|
|
55
|
-
case
|
|
55
|
+
case T:
|
|
56
56
|
return a(e._context) + ".Provider";
|
|
57
57
|
case b:
|
|
58
|
-
return function(R,
|
|
58
|
+
return function(R, A, O) {
|
|
59
59
|
var $ = R.displayName;
|
|
60
60
|
if ($) return $;
|
|
61
|
-
var M =
|
|
62
|
-
return M !== "" ?
|
|
61
|
+
var M = A.displayName || A.name || "";
|
|
62
|
+
return M !== "" ? O + "(" + M + ")" : O;
|
|
63
63
|
}(e, e.render, "ForwardRef");
|
|
64
64
|
case L:
|
|
65
65
|
var g = e.displayName || null;
|
|
66
66
|
return g !== null ? g : o(e.type) || "Memo";
|
|
67
67
|
case E:
|
|
68
|
-
var f = e, P = f._payload,
|
|
68
|
+
var f = e, P = f._payload, I = f._init;
|
|
69
69
|
try {
|
|
70
|
-
return o(
|
|
70
|
+
return o(I(P));
|
|
71
71
|
} catch {
|
|
72
72
|
return null;
|
|
73
73
|
}
|
|
@@ -83,8 +83,8 @@ process.env.NODE_ENV === "production" ? He.exports = function() {
|
|
|
83
83
|
function D(e, g, f) {
|
|
84
84
|
if (fe === void 0) try {
|
|
85
85
|
throw Error();
|
|
86
|
-
} catch (
|
|
87
|
-
var P =
|
|
86
|
+
} catch (I) {
|
|
87
|
+
var P = I.stack.trim().match(/\n( *(at )?)/);
|
|
88
88
|
fe = P && P[1] || "";
|
|
89
89
|
}
|
|
90
90
|
return `
|
|
@@ -96,66 +96,66 @@ process.env.NODE_ENV === "production" ? He.exports = function() {
|
|
|
96
96
|
var f, P = G.get(e);
|
|
97
97
|
if (P !== void 0) return P;
|
|
98
98
|
q = !0;
|
|
99
|
-
var
|
|
100
|
-
Error.prepareStackTrace = void 0,
|
|
99
|
+
var I, R = Error.prepareStackTrace;
|
|
100
|
+
Error.prepareStackTrace = void 0, I = ue.current, ue.current = null, function() {
|
|
101
101
|
if (X === 0) {
|
|
102
102
|
i = console.log, h = console.info, u = console.warn, v = console.error, H = console.group, z = console.groupCollapsed, Q = console.groupEnd;
|
|
103
|
-
var
|
|
104
|
-
Object.defineProperties(console, { info:
|
|
103
|
+
var F = { configurable: !0, enumerable: !0, value: be, writable: !0 };
|
|
104
|
+
Object.defineProperties(console, { info: F, log: F, warn: F, error: F, group: F, groupCollapsed: F, groupEnd: F });
|
|
105
105
|
}
|
|
106
106
|
X++;
|
|
107
107
|
}();
|
|
108
108
|
try {
|
|
109
109
|
if (g) {
|
|
110
|
-
var
|
|
110
|
+
var A = function() {
|
|
111
111
|
throw Error();
|
|
112
112
|
};
|
|
113
|
-
if (Object.defineProperty(
|
|
113
|
+
if (Object.defineProperty(A.prototype, "props", { set: function() {
|
|
114
114
|
throw Error();
|
|
115
115
|
} }), typeof Reflect == "object" && Reflect.construct) {
|
|
116
116
|
try {
|
|
117
|
-
Reflect.construct(
|
|
118
|
-
} catch (
|
|
119
|
-
f =
|
|
117
|
+
Reflect.construct(A, []);
|
|
118
|
+
} catch (F) {
|
|
119
|
+
f = F;
|
|
120
120
|
}
|
|
121
|
-
Reflect.construct(e, [],
|
|
121
|
+
Reflect.construct(e, [], A);
|
|
122
122
|
} else {
|
|
123
123
|
try {
|
|
124
|
-
|
|
125
|
-
} catch (
|
|
126
|
-
f =
|
|
124
|
+
A.call();
|
|
125
|
+
} catch (F) {
|
|
126
|
+
f = F;
|
|
127
127
|
}
|
|
128
|
-
e.call(
|
|
128
|
+
e.call(A.prototype);
|
|
129
129
|
}
|
|
130
130
|
} else {
|
|
131
131
|
try {
|
|
132
132
|
throw Error();
|
|
133
|
-
} catch (
|
|
134
|
-
f =
|
|
133
|
+
} catch (F) {
|
|
134
|
+
f = F;
|
|
135
135
|
}
|
|
136
136
|
e();
|
|
137
137
|
}
|
|
138
|
-
} catch (
|
|
139
|
-
if (
|
|
140
|
-
for (var
|
|
138
|
+
} catch (F) {
|
|
139
|
+
if (F && f && typeof F.stack == "string") {
|
|
140
|
+
for (var O = F.stack.split(`
|
|
141
141
|
`), $ = f.stack.split(`
|
|
142
|
-
`), M =
|
|
143
|
-
for (; M >= 1 &&
|
|
144
|
-
if (M !== 1 ||
|
|
145
|
-
if (M--, --
|
|
146
|
-
var
|
|
147
|
-
` +
|
|
148
|
-
return e.displayName &&
|
|
142
|
+
`), M = O.length - 1, C = $.length - 1; M >= 1 && C >= 0 && O[M] !== $[C]; ) C--;
|
|
143
|
+
for (; M >= 1 && C >= 0; M--, C--) if (O[M] !== $[C]) {
|
|
144
|
+
if (M !== 1 || C !== 1) do
|
|
145
|
+
if (M--, --C < 0 || O[M] !== $[C]) {
|
|
146
|
+
var S = `
|
|
147
|
+
` + O[M].replace(" at new ", " at ");
|
|
148
|
+
return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && G.set(e, S), S;
|
|
149
149
|
}
|
|
150
|
-
while (M >= 1 &&
|
|
150
|
+
while (M >= 1 && C >= 0);
|
|
151
151
|
break;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
} finally {
|
|
155
|
-
q = !1, ue.current =
|
|
155
|
+
q = !1, ue.current = I, function() {
|
|
156
156
|
if (--X === 0) {
|
|
157
|
-
var
|
|
158
|
-
Object.defineProperties(console, { log: V({},
|
|
157
|
+
var F = { configurable: !0, enumerable: !0, writable: !0 };
|
|
158
|
+
Object.defineProperties(console, { log: V({}, F, { value: i }), info: V({}, F, { value: h }), warn: V({}, F, { value: u }), error: V({}, F, { value: v }), group: V({}, F, { value: H }), groupCollapsed: V({}, F, { value: z }), groupEnd: V({}, F, { value: Q }) });
|
|
159
159
|
}
|
|
160
160
|
X < 0 && n("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
161
161
|
}(), Error.prepareStackTrace = R;
|
|
@@ -171,7 +171,7 @@ process.env.NODE_ENV === "production" ? He.exports = function() {
|
|
|
171
171
|
switch (e) {
|
|
172
172
|
case k:
|
|
173
173
|
return D("Suspense");
|
|
174
|
-
case
|
|
174
|
+
case _:
|
|
175
175
|
return D("SuspenseList");
|
|
176
176
|
}
|
|
177
177
|
if (typeof e == "object") switch (e.$$typeof) {
|
|
@@ -180,9 +180,9 @@ process.env.NODE_ENV === "production" ? He.exports = function() {
|
|
|
180
180
|
case L:
|
|
181
181
|
return ee(e.type, g, f);
|
|
182
182
|
case E:
|
|
183
|
-
var
|
|
183
|
+
var I = e, R = I._payload, A = I._init;
|
|
184
184
|
try {
|
|
185
|
-
return ee(
|
|
185
|
+
return ee(A(R), g, f);
|
|
186
186
|
} catch {
|
|
187
187
|
}
|
|
188
188
|
}
|
|
@@ -215,45 +215,45 @@ process.env.NODE_ENV === "production" ? He.exports = function() {
|
|
|
215
215
|
}(e)), re(e);
|
|
216
216
|
}
|
|
217
217
|
var ae, Le, ye = r.ReactCurrentOwner, ke = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
218
|
-
function $e(e, g, f, P,
|
|
219
|
-
var R,
|
|
220
|
-
for (R in f !== void 0 && (he(f),
|
|
221
|
-
if (se.call(
|
|
222
|
-
var B = Object.getOwnPropertyDescriptor(
|
|
218
|
+
function $e(e, g, f, P, I) {
|
|
219
|
+
var R, A = {}, O = null, $ = null;
|
|
220
|
+
for (R in f !== void 0 && (he(f), O = "" + f), function(S) {
|
|
221
|
+
if (se.call(S, "key")) {
|
|
222
|
+
var B = Object.getOwnPropertyDescriptor(S, "key").get;
|
|
223
223
|
if (B && B.isReactWarning) return !1;
|
|
224
224
|
}
|
|
225
|
-
return
|
|
226
|
-
}(g) && (he(g.key),
|
|
227
|
-
if (se.call(
|
|
228
|
-
var B = Object.getOwnPropertyDescriptor(
|
|
225
|
+
return S.key !== void 0;
|
|
226
|
+
}(g) && (he(g.key), O = "" + g.key), function(S) {
|
|
227
|
+
if (se.call(S, "ref")) {
|
|
228
|
+
var B = Object.getOwnPropertyDescriptor(S, "ref").get;
|
|
229
229
|
if (B && B.isReactWarning) return !1;
|
|
230
230
|
}
|
|
231
|
-
return
|
|
232
|
-
}(g) && ($ = g.ref, function(
|
|
233
|
-
typeof
|
|
234
|
-
}(g)), g) se.call(g, R) && !ke.hasOwnProperty(R) && (
|
|
231
|
+
return S.ref !== void 0;
|
|
232
|
+
}(g) && ($ = g.ref, function(S) {
|
|
233
|
+
typeof S.ref == "string" && ye.current;
|
|
234
|
+
}(g)), g) se.call(g, R) && !ke.hasOwnProperty(R) && (A[R] = g[R]);
|
|
235
235
|
if (e && e.defaultProps) {
|
|
236
236
|
var M = e.defaultProps;
|
|
237
|
-
for (R in M)
|
|
237
|
+
for (R in M) A[R] === void 0 && (A[R] = M[R]);
|
|
238
238
|
}
|
|
239
|
-
if (
|
|
240
|
-
var
|
|
241
|
-
|
|
239
|
+
if (O || $) {
|
|
240
|
+
var C = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
241
|
+
O && function(S, B) {
|
|
242
242
|
var Y = function() {
|
|
243
243
|
ae || (ae = !0, n("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", B));
|
|
244
244
|
};
|
|
245
|
-
Y.isReactWarning = !0, Object.defineProperty(
|
|
246
|
-
}(
|
|
245
|
+
Y.isReactWarning = !0, Object.defineProperty(S, "key", { get: Y, configurable: !0 });
|
|
246
|
+
}(A, C), $ && function(S, B) {
|
|
247
247
|
var Y = function() {
|
|
248
248
|
Le || (Le = !0, n("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", B));
|
|
249
249
|
};
|
|
250
|
-
Y.isReactWarning = !0, Object.defineProperty(
|
|
251
|
-
}(
|
|
250
|
+
Y.isReactWarning = !0, Object.defineProperty(S, "ref", { get: Y, configurable: !0 });
|
|
251
|
+
}(A, C);
|
|
252
252
|
}
|
|
253
|
-
return function(
|
|
254
|
-
var ce = { $$typeof: l, type:
|
|
255
|
-
return Object.defineProperty(ce._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(ce, "_self", { configurable: !1, enumerable: !1, writable: !1, value:
|
|
256
|
-
}(e,
|
|
253
|
+
return function(S, B, Y, F, U, Pe, Re) {
|
|
254
|
+
var ce = { $$typeof: l, type: S, key: B, ref: Y, props: Re, _owner: Pe, _store: {} };
|
|
255
|
+
return Object.defineProperty(ce._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(ce, "_self", { configurable: !1, enumerable: !1, writable: !1, value: F }), Object.defineProperty(ce, "_source", { configurable: !1, enumerable: !1, writable: !1, value: U }), Object.freeze && (Object.freeze(ce.props), Object.freeze(ce)), ce;
|
|
256
|
+
}(e, O, $, I, P, ye.current, A);
|
|
257
257
|
}
|
|
258
258
|
var Te, _e = r.ReactCurrentOwner, Ce = r.ReactDebugCurrentFrame;
|
|
259
259
|
function me(e) {
|
|
@@ -279,13 +279,13 @@ Check the render method of \`` + e + "`.";
|
|
|
279
279
|
function Ne(e, g) {
|
|
280
280
|
if (e._store && !e._store.validated && e.key == null) {
|
|
281
281
|
e._store.validated = !0;
|
|
282
|
-
var f = function(
|
|
282
|
+
var f = function(I) {
|
|
283
283
|
var R = je();
|
|
284
284
|
if (!R) {
|
|
285
|
-
var
|
|
286
|
-
|
|
285
|
+
var A = typeof I == "string" ? I : I.displayName || I.name;
|
|
286
|
+
A && (R = `
|
|
287
287
|
|
|
288
|
-
Check the top-level render call using <` +
|
|
288
|
+
Check the top-level render call using <` + A + ">.");
|
|
289
289
|
}
|
|
290
290
|
return R;
|
|
291
291
|
}(g);
|
|
@@ -304,12 +304,12 @@ Check the top-level render call using <` + T + ">.");
|
|
|
304
304
|
}
|
|
305
305
|
else if (Ee(e)) e._store && (e._store.validated = !0);
|
|
306
306
|
else if (e) {
|
|
307
|
-
var
|
|
308
|
-
if (
|
|
309
|
-
var $ =
|
|
307
|
+
var I = function(O) {
|
|
308
|
+
if (O === null || typeof O != "object") return null;
|
|
309
|
+
var $ = j && O[j] || O["@@iterator"];
|
|
310
310
|
return typeof $ == "function" ? $ : null;
|
|
311
311
|
}(e);
|
|
312
|
-
if (typeof
|
|
312
|
+
if (typeof I == "function" && I !== e.entries) for (var R, A = I.call(e); !(R = A.next()).done; ) Ee(R.value) && Ne(R.value, g);
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
}
|
|
@@ -323,20 +323,20 @@ Check the top-level render call using <` + T + ">.");
|
|
|
323
323
|
}
|
|
324
324
|
if (g) {
|
|
325
325
|
var P = o(f);
|
|
326
|
-
(function(
|
|
326
|
+
(function(I, R, A, O, $) {
|
|
327
327
|
var M = Function.call.bind(se);
|
|
328
|
-
for (var
|
|
329
|
-
var
|
|
328
|
+
for (var C in I) if (M(I, C)) {
|
|
329
|
+
var S = void 0;
|
|
330
330
|
try {
|
|
331
|
-
if (typeof
|
|
332
|
-
var B = Error((
|
|
331
|
+
if (typeof I[C] != "function") {
|
|
332
|
+
var B = Error((O || "React class") + ": " + A + " type `" + C + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof I[C] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
333
333
|
throw B.name = "Invariant Violation", B;
|
|
334
334
|
}
|
|
335
|
-
|
|
335
|
+
S = I[C](R, C, O, A, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
336
336
|
} catch (Y) {
|
|
337
|
-
|
|
337
|
+
S = Y;
|
|
338
338
|
}
|
|
339
|
-
!
|
|
339
|
+
!S || S instanceof Error || (te($), n("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", O || "React class", A, C, typeof S), te(null)), S instanceof Error && !(S.message in ne) && (ne[S.message] = !0, te($), n("Failed %s type: %s", A, S.message), te(null));
|
|
340
340
|
}
|
|
341
341
|
})(g, e.props, "prop", P, e);
|
|
342
342
|
} else f.PropTypes === void 0 || Te || (Te = !0, n("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o(f) || "Unknown"));
|
|
@@ -344,38 +344,38 @@ Check the top-level render call using <` + T + ">.");
|
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
var ge = {};
|
|
347
|
-
function oe(e, g, f, P,
|
|
348
|
-
var
|
|
349
|
-
return typeof U == "string" || typeof U == "function" || U === m || U === s || U === w || U === k || U ===
|
|
347
|
+
function oe(e, g, f, P, I, R) {
|
|
348
|
+
var A = function(U) {
|
|
349
|
+
return typeof U == "string" || typeof U == "function" || U === m || U === s || U === w || U === k || U === _ || U === N || typeof U == "object" && U !== null && (U.$$typeof === E || U.$$typeof === L || U.$$typeof === T || U.$$typeof === y || U.$$typeof === b || U.$$typeof === d || U.getModuleId !== void 0);
|
|
350
350
|
}(e);
|
|
351
|
-
if (!
|
|
352
|
-
var
|
|
353
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && ($ += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), $ += je(), e === null ?
|
|
351
|
+
if (!A) {
|
|
352
|
+
var O, $ = "";
|
|
353
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && ($ += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."), $ += je(), e === null ? O = "null" : de(e) ? O = "array" : e !== void 0 && e.$$typeof === l ? (O = "<" + (o(e.type) || "Unknown") + " />", $ = " Did you accidentally export a JSX literal instead of a component?") : O = typeof e, n("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", O, $);
|
|
354
354
|
}
|
|
355
|
-
var M = $e(e, g, f,
|
|
355
|
+
var M = $e(e, g, f, I, R);
|
|
356
356
|
if (M == null) return M;
|
|
357
|
-
if (
|
|
358
|
-
var
|
|
359
|
-
if (
|
|
360
|
-
for (var
|
|
361
|
-
Object.freeze && Object.freeze(
|
|
357
|
+
if (A) {
|
|
358
|
+
var C = g.children;
|
|
359
|
+
if (C !== void 0) if (P) if (de(C)) {
|
|
360
|
+
for (var S = 0; S < C.length; S++) x(C[S], e);
|
|
361
|
+
Object.freeze && Object.freeze(C);
|
|
362
362
|
} else n("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
363
|
-
else x(
|
|
363
|
+
else x(C, e);
|
|
364
364
|
}
|
|
365
365
|
if (se.call(g, "key")) {
|
|
366
366
|
var B = o(e), Y = Object.keys(g).filter(function(U) {
|
|
367
367
|
return U !== "key";
|
|
368
|
-
}),
|
|
369
|
-
ge[B +
|
|
368
|
+
}), F = Y.length > 0 ? "{key: someKey, " + Y.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
369
|
+
ge[B + F] || (n(`A props object containing a "key" prop is being spread into JSX:
|
|
370
370
|
let props = %s;
|
|
371
371
|
<%s {...props} />
|
|
372
372
|
React keys must be passed directly to JSX without using spread:
|
|
373
373
|
let props = %s;
|
|
374
|
-
<%s key={someKey} {...props} />`,
|
|
374
|
+
<%s key={someKey} {...props} />`, F, B, Y.length > 0 ? "{" + Y.join(": ..., ") + ": ...}" : "{}", B), ge[B + F] = !0);
|
|
375
375
|
}
|
|
376
376
|
return e === m ? function(U) {
|
|
377
|
-
for (var Pe = Object.keys(U.props),
|
|
378
|
-
var ce = Pe[
|
|
377
|
+
for (var Pe = Object.keys(U.props), Re = 0; Re < Pe.length; Re++) {
|
|
378
|
+
var ce = Pe[Re];
|
|
379
379
|
if (ce !== "children" && ce !== "key") {
|
|
380
380
|
me(U), n("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", ce), me(null);
|
|
381
381
|
break;
|
|
@@ -386,16 +386,16 @@ React keys must be passed directly to JSX without using spread:
|
|
|
386
386
|
}
|
|
387
387
|
var ve = function(e, g, f) {
|
|
388
388
|
return oe(e, g, f, !1);
|
|
389
|
-
},
|
|
389
|
+
}, Oe = function(e, g, f) {
|
|
390
390
|
return oe(e, g, f, !0);
|
|
391
391
|
};
|
|
392
|
-
De.Fragment = m, De.jsx = ve, De.jsxs =
|
|
392
|
+
De.Fragment = m, De.jsx = ve, De.jsxs = Oe;
|
|
393
393
|
}()), De);
|
|
394
394
|
var c = He.exports, Xe = { exports: {} };
|
|
395
395
|
(function(d) {
|
|
396
396
|
var t = function(l) {
|
|
397
397
|
var p = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, m = 0, w = {}, s = { manual: l.Prism && l.Prism.manual, disableWorkerMessageHandler: l.Prism && l.Prism.disableWorkerMessageHandler, util: { encode: function r(n) {
|
|
398
|
-
return n instanceof
|
|
398
|
+
return n instanceof T ? new T(n.type, r(n.content), n.alias) : Array.isArray(n) ? n.map(r) : n.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
399
399
|
}, type: function(r) {
|
|
400
400
|
return Object.prototype.toString.call(r).slice(8, -1);
|
|
401
401
|
}, objId: function(r) {
|
|
@@ -492,7 +492,7 @@ var c = He.exports, Xe = { exports: {} };
|
|
|
492
492
|
}, highlight: function(r, n, a) {
|
|
493
493
|
var o = { code: r, grammar: n, language: a };
|
|
494
494
|
if (s.hooks.run("before-tokenize", o), !o.grammar) throw new Error('The language "' + o.language + '" has no grammar.');
|
|
495
|
-
return o.tokens = s.tokenize(o.code, o.grammar), s.hooks.run("after-tokenize", o),
|
|
495
|
+
return o.tokens = s.tokenize(o.code, o.grammar), s.hooks.run("after-tokenize", o), T.stringify(s.util.encode(o.tokens), o.language);
|
|
496
496
|
}, tokenize: function(r, n) {
|
|
497
497
|
var a = n.rest;
|
|
498
498
|
if (a) {
|
|
@@ -500,7 +500,7 @@ var c = He.exports, Xe = { exports: {} };
|
|
|
500
500
|
delete n.rest;
|
|
501
501
|
}
|
|
502
502
|
var i = new k();
|
|
503
|
-
return
|
|
503
|
+
return _(i, i.head, r), b(r, i, n, i.head, 0), function(h) {
|
|
504
504
|
for (var u = [], v = h.head.next; v !== h.tail; ) u.push(v.value), v = v.next;
|
|
505
505
|
return u;
|
|
506
506
|
}(i);
|
|
@@ -510,8 +510,8 @@ var c = He.exports, Xe = { exports: {} };
|
|
|
510
510
|
}, run: function(r, n) {
|
|
511
511
|
var a = s.hooks.all[r];
|
|
512
512
|
if (a && a.length) for (var o, i = 0; o = a[i++]; ) o(n);
|
|
513
|
-
} }, Token:
|
|
514
|
-
function
|
|
513
|
+
} }, Token: T };
|
|
514
|
+
function T(r, n, a, o) {
|
|
515
515
|
this.type = r, this.content = n, this.alias = a, this.length = 0 | (o || "").length;
|
|
516
516
|
}
|
|
517
517
|
function y(r, n, a, o) {
|
|
@@ -537,13 +537,13 @@ var c = He.exports, Xe = { exports: {} };
|
|
|
537
537
|
for (var ue = z.pattern || z, D = o.next, G = i; D !== n.tail && !(h && G >= h.reach); G += D.value.length, D = D.next) {
|
|
538
538
|
var q = D.value;
|
|
539
539
|
if (n.length > r.length) return;
|
|
540
|
-
if (!(q instanceof
|
|
540
|
+
if (!(q instanceof T)) {
|
|
541
541
|
var Z, ie = 1;
|
|
542
542
|
if (X) {
|
|
543
543
|
if (!(Z = y(ue, G, r, V)) || Z.index >= r.length) break;
|
|
544
544
|
var ee = Z.index, se = Z.index + Z[0].length, ne = G;
|
|
545
545
|
for (ne += D.value.length; ee >= ne; ) ne += (D = D.next).value.length;
|
|
546
|
-
if (G = ne -= D.value.length, D.value instanceof
|
|
546
|
+
if (G = ne -= D.value.length, D.value instanceof T) continue;
|
|
547
547
|
for (var J = D; J !== n.tail && (ne < se || typeof J.value == "string"); J = J.next) ie++, ne += J.value.length;
|
|
548
548
|
ie--, q = r.slice(G, ne), Z.index -= G;
|
|
549
549
|
} else if (!(Z = y(ue, 0, q, V))) continue;
|
|
@@ -551,7 +551,7 @@ var c = He.exports, Xe = { exports: {} };
|
|
|
551
551
|
var te = Z[0], le = q.slice(0, ee), de = q.slice(ee + te.length), re = G + q.length;
|
|
552
552
|
h && re > h.reach && (h.reach = re);
|
|
553
553
|
var he = D.prev;
|
|
554
|
-
if (le && (he =
|
|
554
|
+
if (le && (he = _(n, he, le), G += le.length), L(n, he, ie), D = _(n, he, new T(u, Q ? s.tokenize(te, Q) : te, be, te)), de && _(n, D, de), ie > 1) {
|
|
555
555
|
var ae = { cause: u + "," + H, reach: re };
|
|
556
556
|
b(r, n, a, D.prev, G, ae), h && ae.reach > h.reach && (h.reach = ae.reach);
|
|
557
557
|
}
|
|
@@ -564,7 +564,7 @@ var c = He.exports, Xe = { exports: {} };
|
|
|
564
564
|
var r = { value: null, prev: null, next: null }, n = { value: null, prev: r, next: null };
|
|
565
565
|
r.next = n, this.head = r, this.tail = n, this.length = 0;
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function _(r, n, a) {
|
|
568
568
|
var o = n.next, i = { value: a, prev: n, next: o };
|
|
569
569
|
return n.next = i, o.prev = i, r.length++, i;
|
|
570
570
|
}
|
|
@@ -572,7 +572,7 @@ var c = He.exports, Xe = { exports: {} };
|
|
|
572
572
|
for (var o = n.next, i = 0; i < a && o !== r.tail; i++) o = o.next;
|
|
573
573
|
n.next = o, o.prev = n, r.length -= i;
|
|
574
574
|
}
|
|
575
|
-
if (l.Prism = s,
|
|
575
|
+
if (l.Prism = s, T.stringify = function r(n, a) {
|
|
576
576
|
if (typeof n == "string") return n;
|
|
577
577
|
if (Array.isArray(n)) {
|
|
578
578
|
var o = "";
|
|
@@ -590,12 +590,12 @@ var c = He.exports, Xe = { exports: {} };
|
|
|
590
590
|
l.postMessage(s.highlight(o, s.languages[a], a)), i && l.close();
|
|
591
591
|
}, !1)), s;
|
|
592
592
|
var E = s.util.currentScript();
|
|
593
|
-
function
|
|
593
|
+
function N() {
|
|
594
594
|
s.manual || s.highlightAll();
|
|
595
595
|
}
|
|
596
596
|
if (E && (s.filename = E.src, E.hasAttribute("data-manual") && (s.manual = !0)), !s.manual) {
|
|
597
|
-
var
|
|
598
|
-
|
|
597
|
+
var j = document.readyState;
|
|
598
|
+
j === "loading" || j === "interactive" && E && E.defer ? document.addEventListener("DOMContentLoaded", N) : window.requestAnimationFrame ? window.requestAnimationFrame(N) : window.setTimeout(N, 16);
|
|
599
599
|
}
|
|
600
600
|
return s;
|
|
601
601
|
}(typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {});
|
|
@@ -629,19 +629,19 @@ var c = He.exports, Xe = { exports: {} };
|
|
|
629
629
|
y.code = "", b.setAttribute(p, m);
|
|
630
630
|
var k = b.appendChild(document.createElement("CODE"));
|
|
631
631
|
k.textContent = "Loading…";
|
|
632
|
-
var
|
|
632
|
+
var _ = b.getAttribute("data-src"), L = y.language;
|
|
633
633
|
if (L === "none") {
|
|
634
|
-
var E = (/\.(\w+)$/.exec(
|
|
634
|
+
var E = (/\.(\w+)$/.exec(_) || [, "none"])[1];
|
|
635
635
|
L = l[E] || E;
|
|
636
636
|
}
|
|
637
637
|
t.util.setLanguage(k, L), t.util.setLanguage(b, L);
|
|
638
|
-
var
|
|
639
|
-
|
|
638
|
+
var N = t.plugins.autoloader;
|
|
639
|
+
N && N.loadLanguages(L), function(j, r, n) {
|
|
640
640
|
var a = new XMLHttpRequest();
|
|
641
|
-
a.open("GET",
|
|
641
|
+
a.open("GET", j, !0), a.onreadystatechange = function() {
|
|
642
642
|
a.readyState == 4 && (a.status < 400 && a.responseText ? r(a.responseText) : a.status >= 400 ? n("✖ Error " + a.status + " while fetching file: " + a.statusText) : n("✖ Error: File does not exist or is empty"));
|
|
643
643
|
}, a.send(null);
|
|
644
|
-
}(
|
|
644
|
+
}(_, function(j) {
|
|
645
645
|
b.setAttribute(p, w);
|
|
646
646
|
var r = function(i) {
|
|
647
647
|
var h = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(i || "");
|
|
@@ -651,21 +651,21 @@ var c = He.exports, Xe = { exports: {} };
|
|
|
651
651
|
}
|
|
652
652
|
}(b.getAttribute("data-range"));
|
|
653
653
|
if (r) {
|
|
654
|
-
var n =
|
|
655
|
-
a < 0 && (a += n.length), a = Math.max(0, Math.min(a - 1, n.length)), o < 0 && (o += n.length), o = Math.max(0, Math.min(o, n.length)),
|
|
654
|
+
var n = j.split(/\r\n?|\n/g), a = r[0], o = r[1] == null ? n.length : r[1];
|
|
655
|
+
a < 0 && (a += n.length), a = Math.max(0, Math.min(a - 1, n.length)), o < 0 && (o += n.length), o = Math.max(0, Math.min(o, n.length)), j = n.slice(a, o).join(`
|
|
656
656
|
`), b.hasAttribute("data-start") || b.setAttribute("data-start", String(a + 1));
|
|
657
657
|
}
|
|
658
|
-
k.textContent =
|
|
659
|
-
}, function(
|
|
660
|
-
b.setAttribute(p, "failed"), k.textContent =
|
|
658
|
+
k.textContent = j, t.highlightElement(k);
|
|
659
|
+
}, function(j) {
|
|
660
|
+
b.setAttribute(p, "failed"), k.textContent = j;
|
|
661
661
|
});
|
|
662
662
|
}
|
|
663
663
|
}), t.plugins.fileHighlight = { highlight: function(y) {
|
|
664
|
-
for (var b, k = (y || document).querySelectorAll(s),
|
|
664
|
+
for (var b, k = (y || document).querySelectorAll(s), _ = 0; b = k[_++]; ) t.highlightElement(b);
|
|
665
665
|
} };
|
|
666
|
-
var
|
|
666
|
+
var T = !1;
|
|
667
667
|
t.fileHighlight = function() {
|
|
668
|
-
|
|
668
|
+
T || (T = !0), t.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
669
669
|
};
|
|
670
670
|
}
|
|
671
671
|
}();
|
|
@@ -691,15 +691,15 @@ Prism.languages.clike = { comment: [{ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/
|
|
|
691
691
|
}(Prism), Prism.languages.json = { property: { pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/, lookbehind: !0, greedy: !0 }, string: { pattern: /(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/, lookbehind: !0, greedy: !0 }, comment: { pattern: /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, greedy: !0 }, number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i, punctuation: /[{}[\],]/, operator: /:/, boolean: /\b(?:false|true)\b/, null: { pattern: /\bnull\b/, alias: "keyword" } }, Prism.languages.webmanifest = Prism.languages.json;
|
|
692
692
|
window.Prism = ze;
|
|
693
693
|
const qe = { javascript: "javascript", js: "javascript", typescript: "typescript", ts: "typescript", python: "python", py: "python", java: "java", c: "c", cpp: "cpp", "c++": "cpp", csharp: "csharp", "c#": "csharp", go: "go", golang: "go", rust: "rust", ruby: "ruby", rb: "ruby", php: "php", swift: "swift", kotlin: "kotlin", kt: "kotlin", sql: "sql", bash: "bash", sh: "bash", shell: "bash", json: "json", yaml: "yaml", yml: "yaml", markdown: "markdown", md: "markdown" }, Je = ({ value: d, language: t, theme: l = "dark", disabled: p = !1, onChange: m, onCodeChange: w }) => {
|
|
694
|
-
const s = Ae(null),
|
|
694
|
+
const s = Ae(null), T = Ae(null), y = Ae(null), b = Se(() => qe[t.toLowerCase()] || "javascript", [t]), k = l === "dark" ? "#1e1e1e" : "#fafafa", _ = Se(() => {
|
|
695
695
|
try {
|
|
696
696
|
const E = ze.languages[b];
|
|
697
697
|
if (E) return ze.highlight(d || "", E, b);
|
|
698
698
|
} catch {
|
|
699
699
|
}
|
|
700
700
|
return function(E) {
|
|
701
|
-
const
|
|
702
|
-
return
|
|
701
|
+
const N = document.createElement("div");
|
|
702
|
+
return N.textContent = E, N.innerHTML;
|
|
703
703
|
}(d || "");
|
|
704
704
|
}, [d, b]), L = pe((E) => {
|
|
705
705
|
y.current && clearTimeout(y.current), y.current = setTimeout(() => {
|
|
@@ -711,7 +711,7 @@ const qe = { javascript: "javascript", js: "javascript", typescript: "typescript
|
|
|
711
711
|
}, []), xe(() => {
|
|
712
712
|
(function(E) {
|
|
713
713
|
if (typeof document > "u") return;
|
|
714
|
-
const
|
|
714
|
+
const N = "hep-cr-prism-styles", j = document.getElementById(N), r = E === "dark" ? `
|
|
715
715
|
/* 默认代码颜色 */
|
|
716
716
|
.hep-cr-editor .hep-cr-highlight code,
|
|
717
717
|
.hep-cr-editor .hep-cr-highlight pre {
|
|
@@ -873,21 +873,21 @@ const qe = { javascript: "javascript", js: "javascript", typescript: "typescript
|
|
|
873
873
|
color: #333 !important;
|
|
874
874
|
}
|
|
875
875
|
`;
|
|
876
|
-
|
|
876
|
+
j && j.remove();
|
|
877
877
|
const n = document.createElement("style");
|
|
878
|
-
n.id =
|
|
878
|
+
n.id = N, n.textContent = r, document.head.appendChild(n);
|
|
879
879
|
})(l);
|
|
880
|
-
}, [l]), c.jsxs("div", { className: `hep-cr-editor theme-${l}`, style: { background: k }, children: [c.jsx("pre", { ref:
|
|
881
|
-
const
|
|
882
|
-
m == null || m(
|
|
880
|
+
}, [l]), c.jsxs("div", { className: `hep-cr-editor theme-${l}`, style: { background: k }, children: [c.jsx("pre", { ref: T, className: `hep-cr-highlight language-${b}`, "aria-hidden": "true", children: c.jsx("code", { dangerouslySetInnerHTML: { __html: _ } }) }), c.jsx("textarea", { ref: s, className: "hep-cr-input", value: d, disabled: p, onChange: (E) => {
|
|
881
|
+
const N = E.target.value;
|
|
882
|
+
m == null || m(N), L(N);
|
|
883
883
|
}, onScroll: () => {
|
|
884
|
-
s.current &&
|
|
884
|
+
s.current && T.current && (T.current.scrollTop = s.current.scrollTop, T.current.scrollLeft = s.current.scrollLeft);
|
|
885
885
|
}, onKeyDown: (E) => {
|
|
886
886
|
if (E.key === "Tab") {
|
|
887
887
|
E.preventDefault();
|
|
888
|
-
const
|
|
888
|
+
const N = E.target, j = N.selectionStart, r = N.selectionEnd, n = d.substring(0, j) + " " + d.substring(r);
|
|
889
889
|
m == null || m(n), L(n), requestAnimationFrame(() => {
|
|
890
|
-
|
|
890
|
+
N.selectionStart = N.selectionEnd = j + 2;
|
|
891
891
|
});
|
|
892
892
|
}
|
|
893
893
|
}, spellCheck: !1, placeholder: "请输入代码..." })] });
|
|
@@ -983,14 +983,14 @@ class en {
|
|
|
983
983
|
return y.language.toLowerCase() === t.toLowerCase() || ((b = y.aliases) == null ? void 0 : b.some((k) => k.toLowerCase() === t.toLowerCase()));
|
|
984
984
|
});
|
|
985
985
|
if (!m) throw new Error(`Language '${t}' is not supported`);
|
|
986
|
-
const w = this.getFileName(t), s = { language: m.language, version: p.version || m.version, files: [{ name: w, content: l }], stdin: p.stdin || "", args: p.args || [], run_timeout: p.runTimeout || this.timeout, compile_timeout: this.timeout },
|
|
986
|
+
const w = this.getFileName(t), s = { language: m.language, version: p.version || m.version, files: [{ name: w, content: l }], stdin: p.stdin || "", args: p.args || [], run_timeout: p.runTimeout || this.timeout, compile_timeout: this.timeout }, T = Date.now();
|
|
987
987
|
try {
|
|
988
988
|
const y = await fetch(`${this.baseUrl}/execute`, { method: "POST", headers: this.authHeaders(), body: JSON.stringify(s) });
|
|
989
989
|
if (!y.ok) throw new Error(`Execute failed: ${y.statusText}`);
|
|
990
|
-
const b = await y.json(), k = Date.now() -
|
|
991
|
-
return { success: b.run.code === 0, output:
|
|
990
|
+
const b = await y.json(), k = Date.now() - T, _ = b.run.stdout || "", L = b.run.stderr || "";
|
|
991
|
+
return { success: b.run.code === 0, output: _, stderr: L, code: b.run.code, executionTime: k, compile: b.compile ? { stdout: b.compile.stdout || "", stderr: b.compile.stderr || "", code: b.compile.code } : void 0 };
|
|
992
992
|
} catch (y) {
|
|
993
|
-
return { success: !1, output: "", stderr: y instanceof Error ? y.message : "Unknown error", code: -1, executionTime: Date.now() -
|
|
993
|
+
return { success: !1, output: "", stderr: y instanceof Error ? y.message : "Unknown error", code: -1, executionTime: Date.now() - T };
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
996
|
getFileName(t) {
|
|
@@ -1068,7 +1068,7 @@ function Ie(d) {
|
|
|
1068
1068
|
return nn[t] || `// ${d}
|
|
1069
1069
|
// Write your code here`;
|
|
1070
1070
|
}
|
|
1071
|
-
const tn = ({ pistonUrl: d = "/api/piston", token: t = "", language: l = "javascript", code: p = "", theme: m = "light", themeColor: w = "", showLanguageSelector: s = !0, showEditor:
|
|
1071
|
+
const tn = ({ pistonUrl: d = "/api/piston", token: t = "", language: l = "javascript", code: p = "", theme: m = "light", themeColor: w = "", showLanguageSelector: s = !0, showEditor: T = !0, editable: y = !0, executorLabel: b = "运行", onExecuteStart: k, onExecuteEnd: _, onLanguageChange: L, onLanguageUpdate: E, onCodeUpdate: N, onChange: j }) => {
|
|
1072
1072
|
const [r, n] = K([]), [a, o] = K(l || "javascript"), [i, h] = K(p), [u, v] = K(m), [H, z] = K(""), [Q, V] = K(""), [X, be] = K(!1), [fe, ue] = K(null), [D, G] = K("stdout"), [q, Z] = K(null), [ie, ee] = K(!0), [se, ne] = K(60), [J, te] = K(!1), [le, de] = K(!1);
|
|
1073
1073
|
xe(() => {
|
|
1074
1074
|
l && l !== a && o(l);
|
|
@@ -1080,8 +1080,8 @@ const tn = ({ pistonUrl: d = "/api/piston", token: t = "", language: l = "javasc
|
|
|
1080
1080
|
const re = Se(() => new en({ pistonUrl: d, token: t }), [d, t]), he = Se(() => r.map((x) => ({ value: `${x.language}:${x.version}`, label: `${x.language.charAt(0).toUpperCase() + x.language.slice(1)} ${x.version}` })), [r]), ae = Se(() => a.includes(":") ? a.split(":")[0] : a, [a]), Le = Se(() => {
|
|
1081
1081
|
if (!w) return {};
|
|
1082
1082
|
const x = m === "dark", W = (oe, ve) => {
|
|
1083
|
-
const
|
|
1084
|
-
return "#" + (16777216 + 65536 * Math.min(255, Math.max(0, (
|
|
1083
|
+
const Oe = parseInt(oe.replace("#", ""), 16), e = Math.round(2.55 * ve);
|
|
1084
|
+
return "#" + (16777216 + 65536 * Math.min(255, Math.max(0, (Oe >> 16) + e)) + 256 * Math.min(255, Math.max(0, (Oe >> 8 & 255) + e)) + Math.min(255, Math.max(0, (255 & Oe) + e))).toString(16).slice(1);
|
|
1085
1085
|
}, ge = ((oe) => {
|
|
1086
1086
|
const ve = parseInt(oe.replace("#", ""), 16);
|
|
1087
1087
|
return (0.299 * (ve >> 16 & 255) + 0.587 * (ve >> 8 & 255) + 0.114 * (255 & ve)) / 255 > 0.5;
|
|
@@ -1107,21 +1107,21 @@ const tn = ({ pistonUrl: d = "/api/piston", token: t = "", language: l = "javasc
|
|
|
1107
1107
|
const oe = W.includes(":") ? W.split(":")[0] : W;
|
|
1108
1108
|
L == null || L(oe, i, Ie(oe));
|
|
1109
1109
|
}, [i, E, L]), Te = pe((x) => {
|
|
1110
|
-
h(x), ke.current = !0,
|
|
1111
|
-
}, [
|
|
1110
|
+
h(x), ke.current = !0, N == null || N(x), j == null || j(x);
|
|
1111
|
+
}, [N, j]), _e = pe(async () => {
|
|
1112
1112
|
if (!X) {
|
|
1113
1113
|
be(!0), z(""), V(""), ue(null), Z(null), G("stdout"), k == null || k();
|
|
1114
1114
|
try {
|
|
1115
1115
|
const x = await re.execute(ae, i);
|
|
1116
|
-
z(x.output), V(x.stderr), ue(x.executionTime || null), G(x.stderr ? "stderr" : "stdout"),
|
|
1116
|
+
z(x.output), V(x.stderr), ue(x.executionTime || null), G(x.stderr ? "stderr" : "stdout"), _ == null || _(x);
|
|
1117
1117
|
} catch (x) {
|
|
1118
1118
|
const W = x instanceof Error ? x.message : "Execution failed";
|
|
1119
|
-
Z(W),
|
|
1119
|
+
Z(W), _ == null || _({ success: !1, output: "", stderr: W, code: -1 });
|
|
1120
1120
|
} finally {
|
|
1121
1121
|
be(!1);
|
|
1122
1122
|
}
|
|
1123
1123
|
}
|
|
1124
|
-
}, [X, ae, i, re, k,
|
|
1124
|
+
}, [X, ae, i, re, k, _]), Ce = pe(async () => {
|
|
1125
1125
|
await navigator.clipboard.writeText(i), te(!0), setTimeout(() => {
|
|
1126
1126
|
te(!1);
|
|
1127
1127
|
}, 2e3);
|
|
@@ -1141,7 +1141,7 @@ const tn = ({ pistonUrl: d = "/api/piston", token: t = "", language: l = "javasc
|
|
|
1141
1141
|
}, []), Ne = pe(() => {
|
|
1142
1142
|
Ee.current = !1, document.removeEventListener("mousemove", we), document.removeEventListener("mouseup", Ne), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
1143
1143
|
}, [we]);
|
|
1144
|
-
return c.jsxs("div", { className: `hep-cr-runner hep-cr-runner-${u}`, style: Le, children: [c.jsxs("div", { className: "hep-cr-header", children: [c.jsx("div", { className: "hep-cr-controls", children: s && c.jsx(c.Fragment, { children: c.jsxs("select", { value: a, onChange: $e, className: "hep-cr-language-select", disabled: X, children: [ie && c.jsx("option", { value: "", children: "加载中..." }), he.map((x) => c.jsx("option", { value: x.value, children: x.label }, x.value))] }) }) }), c.jsxs("div", { className: "hep-cr-actions", children: [c.jsxs("button", { className: "hep-cr-btn hep-cr-btn-run", disabled: X || ie, onClick: _e, children: [X ? c.jsx("span", { className: "hep-cr-spinner" }) : c.jsx("span", { className: "hep-cr-run-icon", children: "▶" }), X ? "运行中..." : b] }), c.jsx("button", { className: "hep-cr-btn hep-cr-btn-theme", onClick: () => v(u === "light" ? "dark" : "light"), title: u === "light" ? "Switch to dark mode" : "Switch to light mode", children: u === "light" ? c.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: c.jsx("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) }) : c.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [c.jsx("circle", { cx: "12", cy: "12", r: "5" }), c.jsx("line", { x1: "12", y1: "1", x2: "12", y2: "3" }), c.jsx("line", { x1: "12", y1: "21", x2: "12", y2: "23" }), c.jsx("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }), c.jsx("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }), c.jsx("line", { x1: "1", y1: "12", x2: "3", y2: "12" }), c.jsx("line", { x1: "21", y1: "12", x2: "23", y2: "12" }), c.jsx("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }), c.jsx("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })] }) })] })] }), q && c.jsx("div", { className: "hep-cr-error-message", children: q }), c.jsxs("div", { className: "hep-cr-main", children: [
|
|
1144
|
+
return c.jsxs("div", { className: `hep-cr-runner hep-cr-runner-${u}`, style: Le, children: [c.jsxs("div", { className: "hep-cr-header", children: [c.jsx("div", { className: "hep-cr-controls", children: s && c.jsx(c.Fragment, { children: c.jsxs("select", { value: a, onChange: $e, className: "hep-cr-language-select", disabled: X, children: [ie && c.jsx("option", { value: "", children: "加载中..." }), he.map((x) => c.jsx("option", { value: x.value, children: x.label }, x.value))] }) }) }), c.jsxs("div", { className: "hep-cr-actions", children: [c.jsxs("button", { className: "hep-cr-btn hep-cr-btn-run", disabled: X || ie, onClick: _e, children: [X ? c.jsx("span", { className: "hep-cr-spinner" }) : c.jsx("span", { className: "hep-cr-run-icon", children: "▶" }), X ? "运行中..." : b] }), c.jsx("button", { className: "hep-cr-btn hep-cr-btn-theme", onClick: () => v(u === "light" ? "dark" : "light"), title: u === "light" ? "Switch to dark mode" : "Switch to light mode", children: u === "light" ? c.jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: c.jsx("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) }) : c.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [c.jsx("circle", { cx: "12", cy: "12", r: "5" }), c.jsx("line", { x1: "12", y1: "1", x2: "12", y2: "3" }), c.jsx("line", { x1: "12", y1: "21", x2: "12", y2: "23" }), c.jsx("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }), c.jsx("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }), c.jsx("line", { x1: "1", y1: "12", x2: "3", y2: "12" }), c.jsx("line", { x1: "21", y1: "12", x2: "23", y2: "12" }), c.jsx("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }), c.jsx("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })] }) })] })] }), q && c.jsx("div", { className: "hep-cr-error-message", children: q }), c.jsxs("div", { className: "hep-cr-main", children: [T && c.jsxs("div", { className: "hep-cr-editor-panel", style: { width: `${se}%` }, children: [c.jsxs("div", { className: "hep-cr-panel-header", children: [c.jsx("span", { className: "hep-cr-panel-title", children: "编辑器" }), c.jsxs("div", { className: "hep-cr-output-actions", children: [c.jsx("span", { className: "hep-cr-language-badge", children: ae }), c.jsx("button", { className: "hep-cr-btn-icon " + (J ? "hep-cr-btn-copied" : ""), disabled: J, onClick: Ce, title: J ? "已复制" : "复制", children: J ? c.jsx("span", { className: "hep-cr-copied-text", children: "已复制" }) : c.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [c.jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }), c.jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })] }) })] })] }), c.jsx(Je, { value: i, language: ae, theme: u, disabled: !y || X, onChange: Te, onCodeChange: j })] }), T && c.jsx("div", { className: "hep-cr-resize-handle", onMouseDown: je, children: c.jsx("div", { className: "hep-cr-resize-line" }) }), c.jsxs("div", { className: "hep-cr-output-panel", style: { width: T ? 100 - se + "%" : "100%" }, children: [c.jsxs("div", { className: "hep-cr-panel-header", children: [c.jsxs("div", { className: "hep-cr-output-tabs", children: [c.jsx("button", { className: "hep-cr-tab " + (D === "stdout" ? "active" : ""), onClick: () => G("stdout"), children: "输出" }), Q && c.jsx("button", { className: "hep-cr-tab hep-cr-tab-error " + (D === "stderr" ? "active" : ""), onClick: () => G("stderr"), children: "错误" })] }), c.jsxs("div", { className: "hep-cr-output-actions", children: [fe !== null && c.jsxs("span", { className: "hep-cr-execution-time", children: [fe, "ms"] }), c.jsx("button", { className: "hep-cr-btn-icon " + (le ? "hep-cr-btn-copied" : ""), disabled: le, onClick: me, title: le ? "已复制" : "复制", children: le ? c.jsx("span", { className: "hep-cr-copied-text", children: "已复制" }) : c.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [c.jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }), c.jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })] }) })] })] }), c.jsx("div", { className: "hep-cr-output-content", children: c.jsx("pre", { children: D === "stdout" ? X ? "代码执行中..." : H || '点击"运行"执行代码' : Q }) })] })] }), c.jsx("style", { children: `
|
|
1145
1145
|
.hep-cr-runner {
|
|
1146
1146
|
display: flex;
|
|
1147
1147
|
flex-direction: column;
|
|
@@ -1368,19 +1368,25 @@ const tn = ({ pistonUrl: d = "/api/piston", token: t = "", language: l = "javasc
|
|
|
1368
1368
|
}
|
|
1369
1369
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
1370
1370
|
` })] });
|
|
1371
|
-
}, rn = Ze(({ open: d, defaultOpen: t = !1, title: l = "代码执行器", width: p = 800, onClose: m, footer: w, theme: s = "light", ...
|
|
1372
|
-
const [
|
|
1371
|
+
}, rn = Ze(({ open: d, defaultOpen: t = !1, title: l = "代码执行器", width: p = 800, onClose: m, footer: w, theme: s = "light", closeOnOverlayClick: T = !0, ...y }, b) => {
|
|
1372
|
+
const [k, _] = K(t), [L, E] = K(!1), N = d !== void 0, j = N ? d : k;
|
|
1373
1373
|
xe(() => {
|
|
1374
|
-
|
|
1375
|
-
}, [d,
|
|
1376
|
-
const
|
|
1377
|
-
|
|
1378
|
-
}, [
|
|
1379
|
-
Ke(
|
|
1380
|
-
const
|
|
1381
|
-
return
|
|
1382
|
-
|
|
1383
|
-
},
|
|
1374
|
+
N && d !== k && _(d);
|
|
1375
|
+
}, [d, N]);
|
|
1376
|
+
const r = pe(() => {
|
|
1377
|
+
N || _(!1), m == null || m();
|
|
1378
|
+
}, [N, m]);
|
|
1379
|
+
Ke(b, () => ({ close: r }));
|
|
1380
|
+
const n = typeof p == "number" ? `${p}px` : p;
|
|
1381
|
+
return j ? c.jsxs("div", { className: "hep-cr-dialog-overlay", onMouseDown: (a) => {
|
|
1382
|
+
a.target === a.currentTarget && E(!1);
|
|
1383
|
+
}, onClick: (a) => {
|
|
1384
|
+
T && a.target === a.currentTarget && !L && r();
|
|
1385
|
+
}, children: [c.jsxs("div", { className: "hep-cr-dialog-container", style: { width: n }, onMouseDown: () => {
|
|
1386
|
+
E(!0);
|
|
1387
|
+
}, onMouseUp: () => {
|
|
1388
|
+
E(!1);
|
|
1389
|
+
}, children: [c.jsxs("div", { className: "hep-cr-dialog-header", children: [c.jsx("h3", { className: "hep-cr-dialog-title", children: l }), c.jsx("button", { className: "hep-cr-dialog-close", onClick: r, children: c.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [c.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), c.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) })] }), c.jsx("div", { className: "hep-cr-dialog-body", children: c.jsx(tn, { theme: s, ...y }) }), w && c.jsx("div", { className: "hep-cr-dialog-footer", children: w })] }), c.jsx("style", { children: `
|
|
1384
1390
|
.hep-cr-dialog-overlay {
|
|
1385
1391
|
position: fixed;
|
|
1386
1392
|
top: 0;
|