@hep-code-runner/react 3.1.2 → 3.2.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.js +6 -109
- package/dist/index.mjs +304 -2304
- package/package.json +4 -5
package/dist/index.mjs
CHANGED
|
@@ -1,1792 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
var Be = { exports: {} }, Oe = {};
|
|
7
|
-
/**
|
|
8
|
-
* @license React
|
|
9
|
-
* react-jsx-runtime.production.min.js
|
|
10
|
-
*
|
|
11
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
12
|
-
*
|
|
13
|
-
* This source code is licensed under the MIT license found in the
|
|
14
|
-
* LICENSE file in the root directory of this source tree.
|
|
15
|
-
*/
|
|
16
|
-
var Qe;
|
|
17
|
-
function Sr() {
|
|
18
|
-
if (Qe) return Oe;
|
|
19
|
-
Qe = 1;
|
|
20
|
-
var p = tr, h = Symbol.for("react.element"), n = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, b = p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, A = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
21
|
-
function R(s, m, k) {
|
|
22
|
-
var S, I = {}, C = null, U = null;
|
|
23
|
-
k !== void 0 && (C = "" + k), m.key !== void 0 && (C = "" + m.key), m.ref !== void 0 && (U = m.ref);
|
|
24
|
-
for (S in m) u.call(m, S) && !A.hasOwnProperty(S) && (I[S] = m[S]);
|
|
25
|
-
if (s && s.defaultProps) for (S in m = s.defaultProps, m) I[S] === void 0 && (I[S] = m[S]);
|
|
26
|
-
return { $$typeof: h, type: s, key: C, ref: U, props: I, _owner: b.current };
|
|
27
|
-
}
|
|
28
|
-
return Oe.Fragment = n, Oe.jsx = R, Oe.jsxs = R, Oe;
|
|
29
|
-
}
|
|
30
|
-
var Ne = {};
|
|
31
|
-
/**
|
|
32
|
-
* @license React
|
|
33
|
-
* react-jsx-runtime.development.js
|
|
34
|
-
*
|
|
35
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
36
|
-
*
|
|
37
|
-
* This source code is licensed under the MIT license found in the
|
|
38
|
-
* LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/
|
|
40
|
-
var er;
|
|
41
|
-
function Ar() {
|
|
42
|
-
return er || (er = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var p = tr, h = Symbol.for("react.element"), n = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), A = Symbol.for("react.profiler"), R = Symbol.for("react.provider"), s = Symbol.for("react.context"), m = Symbol.for("react.forward_ref"), k = Symbol.for("react.suspense"), S = Symbol.for("react.suspense_list"), I = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), U = Symbol.for("react.offscreen"), Z = Symbol.iterator, _ = "@@iterator";
|
|
44
|
-
function E(e) {
|
|
45
|
-
if (e === null || typeof e != "object")
|
|
46
|
-
return null;
|
|
47
|
-
var a = Z && e[Z] || e[_];
|
|
48
|
-
return typeof a == "function" ? a : null;
|
|
49
|
-
}
|
|
50
|
-
var y = p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
-
function r(e) {
|
|
52
|
-
{
|
|
53
|
-
for (var a = arguments.length, d = new Array(a > 1 ? a - 1 : 0), v = 1; v < a; v++)
|
|
54
|
-
d[v - 1] = arguments[v];
|
|
55
|
-
t("error", e, d);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function t(e, a, d) {
|
|
59
|
-
{
|
|
60
|
-
var v = y.ReactDebugCurrentFrame, O = v.getStackAddendum();
|
|
61
|
-
O !== "" && (a += "%s", d = d.concat([O]));
|
|
62
|
-
var L = d.map(function(T) {
|
|
63
|
-
return String(T);
|
|
64
|
-
});
|
|
65
|
-
L.unshift("Warning: " + a), Function.prototype.apply.call(console[e], console, L);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
var i = !1, o = !1, l = !1, g = !1, x = !1, f;
|
|
69
|
-
f = Symbol.for("react.module.reference");
|
|
70
|
-
function N(e) {
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e === u || e === A || x || e === b || e === k || e === S || g || e === U || i || o || l || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === I || e.$$typeof === R || e.$$typeof === s || e.$$typeof === m || // This needs to include all possible module reference object
|
|
72
|
-
// types supported by any Flight configuration anywhere since
|
|
73
|
-
// we don't know which Flight build this will end up being used
|
|
74
|
-
// with.
|
|
75
|
-
e.$$typeof === f || e.getModuleId !== void 0));
|
|
76
|
-
}
|
|
77
|
-
function j(e, a, d) {
|
|
78
|
-
var v = e.displayName;
|
|
79
|
-
if (v)
|
|
80
|
-
return v;
|
|
81
|
-
var O = a.displayName || a.name || "";
|
|
82
|
-
return O !== "" ? d + "(" + O + ")" : d;
|
|
83
|
-
}
|
|
84
|
-
function W(e) {
|
|
85
|
-
return e.displayName || "Context";
|
|
86
|
-
}
|
|
87
|
-
function H(e) {
|
|
88
|
-
if (e == null)
|
|
89
|
-
return null;
|
|
90
|
-
if (typeof e.tag == "number" && r("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
91
|
-
return e.displayName || e.name || null;
|
|
92
|
-
if (typeof e == "string")
|
|
93
|
-
return e;
|
|
94
|
-
switch (e) {
|
|
95
|
-
case u:
|
|
96
|
-
return "Fragment";
|
|
97
|
-
case n:
|
|
98
|
-
return "Portal";
|
|
99
|
-
case A:
|
|
100
|
-
return "Profiler";
|
|
101
|
-
case b:
|
|
102
|
-
return "StrictMode";
|
|
103
|
-
case k:
|
|
104
|
-
return "Suspense";
|
|
105
|
-
case S:
|
|
106
|
-
return "SuspenseList";
|
|
107
|
-
}
|
|
108
|
-
if (typeof e == "object")
|
|
109
|
-
switch (e.$$typeof) {
|
|
110
|
-
case s:
|
|
111
|
-
var a = e;
|
|
112
|
-
return W(a) + ".Consumer";
|
|
113
|
-
case R:
|
|
114
|
-
var d = e;
|
|
115
|
-
return W(d._context) + ".Provider";
|
|
116
|
-
case m:
|
|
117
|
-
return j(e, e.render, "ForwardRef");
|
|
118
|
-
case I:
|
|
119
|
-
var v = e.displayName || null;
|
|
120
|
-
return v !== null ? v : H(e.type) || "Memo";
|
|
121
|
-
case C: {
|
|
122
|
-
var O = e, L = O._payload, T = O._init;
|
|
123
|
-
try {
|
|
124
|
-
return H(T(L));
|
|
125
|
-
} catch {
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
var G = Object.assign, ne = 0, ae, ue, D, z, re, J, B;
|
|
133
|
-
function le() {
|
|
134
|
-
}
|
|
135
|
-
le.__reactDisabledLog = !0;
|
|
136
|
-
function q() {
|
|
137
|
-
{
|
|
138
|
-
if (ne === 0) {
|
|
139
|
-
ae = console.log, ue = console.info, D = console.warn, z = console.error, re = console.group, J = console.groupCollapsed, B = console.groupEnd;
|
|
140
|
-
var e = {
|
|
141
|
-
configurable: !0,
|
|
142
|
-
enumerable: !0,
|
|
143
|
-
value: le,
|
|
144
|
-
writable: !0
|
|
145
|
-
};
|
|
146
|
-
Object.defineProperties(console, {
|
|
147
|
-
info: e,
|
|
148
|
-
log: e,
|
|
149
|
-
warn: e,
|
|
150
|
-
error: e,
|
|
151
|
-
group: e,
|
|
152
|
-
groupCollapsed: e,
|
|
153
|
-
groupEnd: e
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
ne++;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function Q() {
|
|
160
|
-
{
|
|
161
|
-
if (ne--, ne === 0) {
|
|
162
|
-
var e = {
|
|
163
|
-
configurable: !0,
|
|
164
|
-
enumerable: !0,
|
|
165
|
-
writable: !0
|
|
166
|
-
};
|
|
167
|
-
Object.defineProperties(console, {
|
|
168
|
-
log: G({}, e, {
|
|
169
|
-
value: ae
|
|
170
|
-
}),
|
|
171
|
-
info: G({}, e, {
|
|
172
|
-
value: ue
|
|
173
|
-
}),
|
|
174
|
-
warn: G({}, e, {
|
|
175
|
-
value: D
|
|
176
|
-
}),
|
|
177
|
-
error: G({}, e, {
|
|
178
|
-
value: z
|
|
179
|
-
}),
|
|
180
|
-
group: G({}, e, {
|
|
181
|
-
value: re
|
|
182
|
-
}),
|
|
183
|
-
groupCollapsed: G({}, e, {
|
|
184
|
-
value: J
|
|
185
|
-
}),
|
|
186
|
-
groupEnd: G({}, e, {
|
|
187
|
-
value: B
|
|
188
|
-
})
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
ne < 0 && r("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
var ie = y.ReactCurrentDispatcher, oe;
|
|
195
|
-
function Y(e, a, d) {
|
|
196
|
-
{
|
|
197
|
-
if (oe === void 0)
|
|
198
|
-
try {
|
|
199
|
-
throw Error();
|
|
200
|
-
} catch (O) {
|
|
201
|
-
var v = O.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
-
oe = v && v[1] || "";
|
|
203
|
-
}
|
|
204
|
-
return `
|
|
205
|
-
` + oe + e;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
var de = !1, se;
|
|
209
|
-
{
|
|
210
|
-
var pe = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
-
se = new pe();
|
|
212
|
-
}
|
|
213
|
-
function ye(e, a) {
|
|
214
|
-
if (!e || de)
|
|
215
|
-
return "";
|
|
216
|
-
{
|
|
217
|
-
var d = se.get(e);
|
|
218
|
-
if (d !== void 0)
|
|
219
|
-
return d;
|
|
220
|
-
}
|
|
221
|
-
var v;
|
|
222
|
-
de = !0;
|
|
223
|
-
var O = Error.prepareStackTrace;
|
|
224
|
-
Error.prepareStackTrace = void 0;
|
|
225
|
-
var L;
|
|
226
|
-
L = ie.current, ie.current = null, q();
|
|
227
|
-
try {
|
|
228
|
-
if (a) {
|
|
229
|
-
var T = function() {
|
|
230
|
-
throw Error();
|
|
231
|
-
};
|
|
232
|
-
if (Object.defineProperty(T.prototype, "props", {
|
|
233
|
-
set: function() {
|
|
234
|
-
throw Error();
|
|
235
|
-
}
|
|
236
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
|
-
try {
|
|
238
|
-
Reflect.construct(T, []);
|
|
239
|
-
} catch (K) {
|
|
240
|
-
v = K;
|
|
241
|
-
}
|
|
242
|
-
Reflect.construct(e, [], T);
|
|
243
|
-
} else {
|
|
244
|
-
try {
|
|
245
|
-
T.call();
|
|
246
|
-
} catch (K) {
|
|
247
|
-
v = K;
|
|
248
|
-
}
|
|
249
|
-
e.call(T.prototype);
|
|
250
|
-
}
|
|
251
|
-
} else {
|
|
252
|
-
try {
|
|
253
|
-
throw Error();
|
|
254
|
-
} catch (K) {
|
|
255
|
-
v = K;
|
|
256
|
-
}
|
|
257
|
-
e();
|
|
258
|
-
}
|
|
259
|
-
} catch (K) {
|
|
260
|
-
if (K && v && typeof K.stack == "string") {
|
|
261
|
-
for (var w = K.stack.split(`
|
|
262
|
-
`), V = v.stack.split(`
|
|
263
|
-
`), $ = w.length - 1, M = V.length - 1; $ >= 1 && M >= 0 && w[$] !== V[M]; )
|
|
264
|
-
M--;
|
|
265
|
-
for (; $ >= 1 && M >= 0; $--, M--)
|
|
266
|
-
if (w[$] !== V[M]) {
|
|
267
|
-
if ($ !== 1 || M !== 1)
|
|
268
|
-
do
|
|
269
|
-
if ($--, M--, M < 0 || w[$] !== V[M]) {
|
|
270
|
-
var ee = `
|
|
271
|
-
` + w[$].replace(" at new ", " at ");
|
|
272
|
-
return e.displayName && ee.includes("<anonymous>") && (ee = ee.replace("<anonymous>", e.displayName)), typeof e == "function" && se.set(e, ee), ee;
|
|
273
|
-
}
|
|
274
|
-
while ($ >= 1 && M >= 0);
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
} finally {
|
|
279
|
-
de = !1, ie.current = L, Q(), Error.prepareStackTrace = O;
|
|
280
|
-
}
|
|
281
|
-
var Se = e ? e.displayName || e.name : "", Ee = Se ? Y(Se) : "";
|
|
282
|
-
return typeof e == "function" && se.set(e, Ee), Ee;
|
|
283
|
-
}
|
|
284
|
-
function me(e, a, d) {
|
|
285
|
-
return ye(e, !1);
|
|
286
|
-
}
|
|
287
|
-
function Re(e) {
|
|
288
|
-
var a = e.prototype;
|
|
289
|
-
return !!(a && a.isReactComponent);
|
|
290
|
-
}
|
|
291
|
-
function xe(e, a, d) {
|
|
292
|
-
if (e == null)
|
|
293
|
-
return "";
|
|
294
|
-
if (typeof e == "function")
|
|
295
|
-
return ye(e, Re(e));
|
|
296
|
-
if (typeof e == "string")
|
|
297
|
-
return Y(e);
|
|
298
|
-
switch (e) {
|
|
299
|
-
case k:
|
|
300
|
-
return Y("Suspense");
|
|
301
|
-
case S:
|
|
302
|
-
return Y("SuspenseList");
|
|
303
|
-
}
|
|
304
|
-
if (typeof e == "object")
|
|
305
|
-
switch (e.$$typeof) {
|
|
306
|
-
case m:
|
|
307
|
-
return me(e.render);
|
|
308
|
-
case I:
|
|
309
|
-
return xe(e.type, a, d);
|
|
310
|
-
case C: {
|
|
311
|
-
var v = e, O = v._payload, L = v._init;
|
|
312
|
-
try {
|
|
313
|
-
return xe(L(O), a, d);
|
|
314
|
-
} catch {
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return "";
|
|
319
|
-
}
|
|
320
|
-
var ce = Object.prototype.hasOwnProperty, _e = {}, F = y.ReactDebugCurrentFrame;
|
|
321
|
-
function P(e) {
|
|
322
|
-
if (e) {
|
|
323
|
-
var a = e._owner, d = xe(e.type, e._source, a ? a.type : null);
|
|
324
|
-
F.setExtraStackFrame(d);
|
|
325
|
-
} else
|
|
326
|
-
F.setExtraStackFrame(null);
|
|
327
|
-
}
|
|
328
|
-
function he(e, a, d, v, O) {
|
|
329
|
-
{
|
|
330
|
-
var L = Function.call.bind(ce);
|
|
331
|
-
for (var T in e)
|
|
332
|
-
if (L(e, T)) {
|
|
333
|
-
var w = void 0;
|
|
334
|
-
try {
|
|
335
|
-
if (typeof e[T] != "function") {
|
|
336
|
-
var V = Error((v || "React class") + ": " + d + " type `" + T + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[T] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
|
-
throw V.name = "Invariant Violation", V;
|
|
338
|
-
}
|
|
339
|
-
w = e[T](a, T, v, d, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
-
} catch ($) {
|
|
341
|
-
w = $;
|
|
342
|
-
}
|
|
343
|
-
w && !(w instanceof Error) && (P(O), r("%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).", v || "React class", d, T, typeof w), P(null)), w instanceof Error && !(w.message in _e) && (_e[w.message] = !0, P(O), r("Failed %s type: %s", d, w.message), P(null));
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
var be = Array.isArray;
|
|
348
|
-
function Fe(e) {
|
|
349
|
-
return be(e);
|
|
350
|
-
}
|
|
351
|
-
function Ie(e) {
|
|
352
|
-
{
|
|
353
|
-
var a = typeof Symbol == "function" && Symbol.toStringTag, d = a && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
354
|
-
return d;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
function ve(e) {
|
|
358
|
-
try {
|
|
359
|
-
return fe(e), !1;
|
|
360
|
-
} catch {
|
|
361
|
-
return !0;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
function fe(e) {
|
|
365
|
-
return "" + e;
|
|
366
|
-
}
|
|
367
|
-
function ge(e) {
|
|
368
|
-
if (ve(e))
|
|
369
|
-
return r("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ie(e)), fe(e);
|
|
370
|
-
}
|
|
371
|
-
var ke = y.ReactCurrentOwner, Le = {
|
|
372
|
-
key: !0,
|
|
373
|
-
ref: !0,
|
|
374
|
-
__self: !0,
|
|
375
|
-
__source: !0
|
|
376
|
-
}, Ce, We;
|
|
377
|
-
function ar(e) {
|
|
378
|
-
if (ce.call(e, "ref")) {
|
|
379
|
-
var a = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
380
|
-
if (a && a.isReactWarning)
|
|
381
|
-
return !1;
|
|
382
|
-
}
|
|
383
|
-
return e.ref !== void 0;
|
|
384
|
-
}
|
|
385
|
-
function ir(e) {
|
|
386
|
-
if (ce.call(e, "key")) {
|
|
387
|
-
var a = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
388
|
-
if (a && a.isReactWarning)
|
|
389
|
-
return !1;
|
|
390
|
-
}
|
|
391
|
-
return e.key !== void 0;
|
|
392
|
-
}
|
|
393
|
-
function or(e, a) {
|
|
394
|
-
typeof e.ref == "string" && ke.current;
|
|
395
|
-
}
|
|
396
|
-
function sr(e, a) {
|
|
397
|
-
{
|
|
398
|
-
var d = function() {
|
|
399
|
-
Ce || (Ce = !0, r("%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)", a));
|
|
400
|
-
};
|
|
401
|
-
d.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
402
|
-
get: d,
|
|
403
|
-
configurable: !0
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
function lr(e, a) {
|
|
408
|
-
{
|
|
409
|
-
var d = function() {
|
|
410
|
-
We || (We = !0, r("%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)", a));
|
|
411
|
-
};
|
|
412
|
-
d.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
413
|
-
get: d,
|
|
414
|
-
configurable: !0
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
var cr = function(e, a, d, v, O, L, T) {
|
|
419
|
-
var w = {
|
|
420
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
421
|
-
$$typeof: h,
|
|
422
|
-
// Built-in properties that belong on the element
|
|
423
|
-
type: e,
|
|
424
|
-
key: a,
|
|
425
|
-
ref: d,
|
|
426
|
-
props: T,
|
|
427
|
-
// Record the component responsible for creating this element.
|
|
428
|
-
_owner: L
|
|
429
|
-
};
|
|
430
|
-
return w._store = {}, Object.defineProperty(w._store, "validated", {
|
|
431
|
-
configurable: !1,
|
|
432
|
-
enumerable: !1,
|
|
433
|
-
writable: !0,
|
|
434
|
-
value: !1
|
|
435
|
-
}), Object.defineProperty(w, "_self", {
|
|
436
|
-
configurable: !1,
|
|
437
|
-
enumerable: !1,
|
|
438
|
-
writable: !1,
|
|
439
|
-
value: v
|
|
440
|
-
}), Object.defineProperty(w, "_source", {
|
|
441
|
-
configurable: !1,
|
|
442
|
-
enumerable: !1,
|
|
443
|
-
writable: !1,
|
|
444
|
-
value: O
|
|
445
|
-
}), Object.freeze && (Object.freeze(w.props), Object.freeze(w)), w;
|
|
446
|
-
};
|
|
447
|
-
function ur(e, a, d, v, O) {
|
|
448
|
-
{
|
|
449
|
-
var L, T = {}, w = null, V = null;
|
|
450
|
-
d !== void 0 && (ge(d), w = "" + d), ir(a) && (ge(a.key), w = "" + a.key), ar(a) && (V = a.ref, or(a, O));
|
|
451
|
-
for (L in a)
|
|
452
|
-
ce.call(a, L) && !Le.hasOwnProperty(L) && (T[L] = a[L]);
|
|
453
|
-
if (e && e.defaultProps) {
|
|
454
|
-
var $ = e.defaultProps;
|
|
455
|
-
for (L in $)
|
|
456
|
-
T[L] === void 0 && (T[L] = $[L]);
|
|
457
|
-
}
|
|
458
|
-
if (w || V) {
|
|
459
|
-
var M = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
460
|
-
w && sr(T, M), V && lr(T, M);
|
|
461
|
-
}
|
|
462
|
-
return cr(e, w, V, O, v, ke.current, T);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
var De = y.ReactCurrentOwner, Ge = y.ReactDebugCurrentFrame;
|
|
466
|
-
function we(e) {
|
|
467
|
-
if (e) {
|
|
468
|
-
var a = e._owner, d = xe(e.type, e._source, a ? a.type : null);
|
|
469
|
-
Ge.setExtraStackFrame(d);
|
|
470
|
-
} else
|
|
471
|
-
Ge.setExtraStackFrame(null);
|
|
472
|
-
}
|
|
473
|
-
var je;
|
|
474
|
-
je = !1;
|
|
475
|
-
function $e(e) {
|
|
476
|
-
return typeof e == "object" && e !== null && e.$$typeof === h;
|
|
477
|
-
}
|
|
478
|
-
function Ye() {
|
|
479
|
-
{
|
|
480
|
-
if (De.current) {
|
|
481
|
-
var e = H(De.current.type);
|
|
482
|
-
if (e)
|
|
483
|
-
return `
|
|
484
|
-
|
|
485
|
-
Check the render method of \`` + e + "`.";
|
|
486
|
-
}
|
|
487
|
-
return "";
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
function dr(e) {
|
|
491
|
-
return "";
|
|
492
|
-
}
|
|
493
|
-
var Ve = {};
|
|
494
|
-
function pr(e) {
|
|
495
|
-
{
|
|
496
|
-
var a = Ye();
|
|
497
|
-
if (!a) {
|
|
498
|
-
var d = typeof e == "string" ? e : e.displayName || e.name;
|
|
499
|
-
d && (a = `
|
|
500
|
-
|
|
501
|
-
Check the top-level render call using <` + d + ">.");
|
|
502
|
-
}
|
|
503
|
-
return a;
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
function Xe(e, a) {
|
|
507
|
-
{
|
|
508
|
-
if (!e._store || e._store.validated || e.key != null)
|
|
509
|
-
return;
|
|
510
|
-
e._store.validated = !0;
|
|
511
|
-
var d = pr(a);
|
|
512
|
-
if (Ve[d])
|
|
513
|
-
return;
|
|
514
|
-
Ve[d] = !0;
|
|
515
|
-
var v = "";
|
|
516
|
-
e && e._owner && e._owner !== De.current && (v = " It was passed a child from " + H(e._owner.type) + "."), we(e), r('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', d, v), we(null);
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
function Ke(e, a) {
|
|
520
|
-
{
|
|
521
|
-
if (typeof e != "object")
|
|
522
|
-
return;
|
|
523
|
-
if (Fe(e))
|
|
524
|
-
for (var d = 0; d < e.length; d++) {
|
|
525
|
-
var v = e[d];
|
|
526
|
-
$e(v) && Xe(v, a);
|
|
527
|
-
}
|
|
528
|
-
else if ($e(e))
|
|
529
|
-
e._store && (e._store.validated = !0);
|
|
530
|
-
else if (e) {
|
|
531
|
-
var O = E(e);
|
|
532
|
-
if (typeof O == "function" && O !== e.entries)
|
|
533
|
-
for (var L = O.call(e), T; !(T = L.next()).done; )
|
|
534
|
-
$e(T.value) && Xe(T.value, a);
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
function hr(e) {
|
|
539
|
-
{
|
|
540
|
-
var a = e.type;
|
|
541
|
-
if (a == null || typeof a == "string")
|
|
542
|
-
return;
|
|
543
|
-
var d;
|
|
544
|
-
if (typeof a == "function")
|
|
545
|
-
d = a.propTypes;
|
|
546
|
-
else if (typeof a == "object" && (a.$$typeof === m || // Note: Memo only checks outer props here.
|
|
547
|
-
// Inner props are checked in the reconciler.
|
|
548
|
-
a.$$typeof === I))
|
|
549
|
-
d = a.propTypes;
|
|
550
|
-
else
|
|
551
|
-
return;
|
|
552
|
-
if (d) {
|
|
553
|
-
var v = H(a);
|
|
554
|
-
he(d, e.props, "prop", v, e);
|
|
555
|
-
} else if (a.PropTypes !== void 0 && !je) {
|
|
556
|
-
je = !0;
|
|
557
|
-
var O = H(a);
|
|
558
|
-
r("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", O || "Unknown");
|
|
559
|
-
}
|
|
560
|
-
typeof a.getDefaultProps == "function" && !a.getDefaultProps.isReactClassApproved && r("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
function fr(e) {
|
|
564
|
-
{
|
|
565
|
-
for (var a = Object.keys(e.props), d = 0; d < a.length; d++) {
|
|
566
|
-
var v = a[d];
|
|
567
|
-
if (v !== "children" && v !== "key") {
|
|
568
|
-
we(e), r("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", v), we(null);
|
|
569
|
-
break;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
e.ref !== null && (we(e), r("Invalid attribute `ref` supplied to `React.Fragment`."), we(null));
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
var Ze = {};
|
|
576
|
-
function qe(e, a, d, v, O, L) {
|
|
577
|
-
{
|
|
578
|
-
var T = N(e);
|
|
579
|
-
if (!T) {
|
|
580
|
-
var w = "";
|
|
581
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (w += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
582
|
-
var V = dr();
|
|
583
|
-
V ? w += V : w += Ye();
|
|
584
|
-
var $;
|
|
585
|
-
e === null ? $ = "null" : Fe(e) ? $ = "array" : e !== void 0 && e.$$typeof === h ? ($ = "<" + (H(e.type) || "Unknown") + " />", w = " Did you accidentally export a JSX literal instead of a component?") : $ = typeof e, r("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", $, w);
|
|
586
|
-
}
|
|
587
|
-
var M = ur(e, a, d, O, L);
|
|
588
|
-
if (M == null)
|
|
589
|
-
return M;
|
|
590
|
-
if (T) {
|
|
591
|
-
var ee = a.children;
|
|
592
|
-
if (ee !== void 0)
|
|
593
|
-
if (v)
|
|
594
|
-
if (Fe(ee)) {
|
|
595
|
-
for (var Se = 0; Se < ee.length; Se++)
|
|
596
|
-
Ke(ee[Se], e);
|
|
597
|
-
Object.freeze && Object.freeze(ee);
|
|
598
|
-
} else
|
|
599
|
-
r("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
600
|
-
else
|
|
601
|
-
Ke(ee, e);
|
|
602
|
-
}
|
|
603
|
-
if (ce.call(a, "key")) {
|
|
604
|
-
var Ee = H(e), K = Object.keys(a).filter(function(yr) {
|
|
605
|
-
return yr !== "key";
|
|
606
|
-
}), Me = K.length > 0 ? "{key: someKey, " + K.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
607
|
-
if (!Ze[Ee + Me]) {
|
|
608
|
-
var Er = K.length > 0 ? "{" + K.join(": ..., ") + ": ...}" : "{}";
|
|
609
|
-
r(`A props object containing a "key" prop is being spread into JSX:
|
|
610
|
-
let props = %s;
|
|
611
|
-
<%s {...props} />
|
|
612
|
-
React keys must be passed directly to JSX without using spread:
|
|
613
|
-
let props = %s;
|
|
614
|
-
<%s key={someKey} {...props} />`, Me, Ee, Er, Ee), Ze[Ee + Me] = !0;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
return e === u ? fr(M) : hr(M), M;
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
function gr(e, a, d) {
|
|
621
|
-
return qe(e, a, d, !0);
|
|
622
|
-
}
|
|
623
|
-
function mr(e, a, d) {
|
|
624
|
-
return qe(e, a, d, !1);
|
|
625
|
-
}
|
|
626
|
-
var br = mr, vr = gr;
|
|
627
|
-
Ne.Fragment = u, Ne.jsx = br, Ne.jsxs = vr;
|
|
628
|
-
}()), Ne;
|
|
629
|
-
}
|
|
630
|
-
process.env.NODE_ENV === "production" ? Be.exports = Sr() : Be.exports = Ar();
|
|
631
|
-
var c = Be.exports, nr = { exports: {} };
|
|
632
|
-
(function(p) {
|
|
633
|
-
var h = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
|
|
634
|
-
/**
|
|
635
|
-
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
636
|
-
*
|
|
637
|
-
* @license MIT <https://opensource.org/licenses/MIT>
|
|
638
|
-
* @author Lea Verou <https://lea.verou.me>
|
|
639
|
-
* @namespace
|
|
640
|
-
* @public
|
|
641
|
-
*/
|
|
642
|
-
var n = function(u) {
|
|
643
|
-
var b = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, A = 0, R = {}, s = {
|
|
644
|
-
/**
|
|
645
|
-
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
|
|
646
|
-
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
|
|
647
|
-
* additional languages or plugins yourself.
|
|
648
|
-
*
|
|
649
|
-
* By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
|
|
650
|
-
*
|
|
651
|
-
* You obviously have to change this value before the automatic highlighting started. To do this, you can add an
|
|
652
|
-
* empty Prism object into the global scope before loading the Prism script like this:
|
|
653
|
-
*
|
|
654
|
-
* ```js
|
|
655
|
-
* window.Prism = window.Prism || {};
|
|
656
|
-
* Prism.manual = true;
|
|
657
|
-
* // add a new <script> to load Prism's script
|
|
658
|
-
* ```
|
|
659
|
-
*
|
|
660
|
-
* @default false
|
|
661
|
-
* @type {boolean}
|
|
662
|
-
* @memberof Prism
|
|
663
|
-
* @public
|
|
664
|
-
*/
|
|
665
|
-
manual: u.Prism && u.Prism.manual,
|
|
666
|
-
/**
|
|
667
|
-
* By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
|
|
668
|
-
* `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
|
|
669
|
-
* own worker, you don't want it to do this.
|
|
670
|
-
*
|
|
671
|
-
* By setting this value to `true`, Prism will not add its own listeners to the worker.
|
|
672
|
-
*
|
|
673
|
-
* You obviously have to change this value before Prism executes. To do this, you can add an
|
|
674
|
-
* empty Prism object into the global scope before loading the Prism script like this:
|
|
675
|
-
*
|
|
676
|
-
* ```js
|
|
677
|
-
* window.Prism = window.Prism || {};
|
|
678
|
-
* Prism.disableWorkerMessageHandler = true;
|
|
679
|
-
* // Load Prism's script
|
|
680
|
-
* ```
|
|
681
|
-
*
|
|
682
|
-
* @default false
|
|
683
|
-
* @type {boolean}
|
|
684
|
-
* @memberof Prism
|
|
685
|
-
* @public
|
|
686
|
-
*/
|
|
687
|
-
disableWorkerMessageHandler: u.Prism && u.Prism.disableWorkerMessageHandler,
|
|
688
|
-
/**
|
|
689
|
-
* A namespace for utility methods.
|
|
690
|
-
*
|
|
691
|
-
* All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
|
|
692
|
-
* change or disappear at any time.
|
|
693
|
-
*
|
|
694
|
-
* @namespace
|
|
695
|
-
* @memberof Prism
|
|
696
|
-
*/
|
|
697
|
-
util: {
|
|
698
|
-
encode: function r(t) {
|
|
699
|
-
return t instanceof m ? new m(t.type, r(t.content), t.alias) : Array.isArray(t) ? t.map(r) : t.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
700
|
-
},
|
|
701
|
-
/**
|
|
702
|
-
* Returns the name of the type of the given value.
|
|
703
|
-
*
|
|
704
|
-
* @param {any} o
|
|
705
|
-
* @returns {string}
|
|
706
|
-
* @example
|
|
707
|
-
* type(null) === 'Null'
|
|
708
|
-
* type(undefined) === 'Undefined'
|
|
709
|
-
* type(123) === 'Number'
|
|
710
|
-
* type('foo') === 'String'
|
|
711
|
-
* type(true) === 'Boolean'
|
|
712
|
-
* type([1, 2]) === 'Array'
|
|
713
|
-
* type({}) === 'Object'
|
|
714
|
-
* type(String) === 'Function'
|
|
715
|
-
* type(/abc+/) === 'RegExp'
|
|
716
|
-
*/
|
|
717
|
-
type: function(r) {
|
|
718
|
-
return Object.prototype.toString.call(r).slice(8, -1);
|
|
719
|
-
},
|
|
720
|
-
/**
|
|
721
|
-
* Returns a unique number for the given object. Later calls will still return the same number.
|
|
722
|
-
*
|
|
723
|
-
* @param {Object} obj
|
|
724
|
-
* @returns {number}
|
|
725
|
-
*/
|
|
726
|
-
objId: function(r) {
|
|
727
|
-
return r.__id || Object.defineProperty(r, "__id", { value: ++A }), r.__id;
|
|
728
|
-
},
|
|
729
|
-
/**
|
|
730
|
-
* Creates a deep clone of the given object.
|
|
731
|
-
*
|
|
732
|
-
* The main intended use of this function is to clone language definitions.
|
|
733
|
-
*
|
|
734
|
-
* @param {T} o
|
|
735
|
-
* @param {Record<number, any>} [visited]
|
|
736
|
-
* @returns {T}
|
|
737
|
-
* @template T
|
|
738
|
-
*/
|
|
739
|
-
clone: function r(t, i) {
|
|
740
|
-
i = i || {};
|
|
741
|
-
var o, l;
|
|
742
|
-
switch (s.util.type(t)) {
|
|
743
|
-
case "Object":
|
|
744
|
-
if (l = s.util.objId(t), i[l])
|
|
745
|
-
return i[l];
|
|
746
|
-
o = /** @type {Record<string, any>} */
|
|
747
|
-
{}, i[l] = o;
|
|
748
|
-
for (var g in t)
|
|
749
|
-
t.hasOwnProperty(g) && (o[g] = r(t[g], i));
|
|
750
|
-
return (
|
|
751
|
-
/** @type {any} */
|
|
752
|
-
o
|
|
753
|
-
);
|
|
754
|
-
case "Array":
|
|
755
|
-
return l = s.util.objId(t), i[l] ? i[l] : (o = [], i[l] = o, /** @type {Array} */
|
|
756
|
-
/** @type {any} */
|
|
757
|
-
t.forEach(function(x, f) {
|
|
758
|
-
o[f] = r(x, i);
|
|
759
|
-
}), /** @type {any} */
|
|
760
|
-
o);
|
|
761
|
-
default:
|
|
762
|
-
return t;
|
|
763
|
-
}
|
|
764
|
-
},
|
|
765
|
-
/**
|
|
766
|
-
* Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
|
|
767
|
-
*
|
|
768
|
-
* If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
|
|
769
|
-
*
|
|
770
|
-
* @param {Element} element
|
|
771
|
-
* @returns {string}
|
|
772
|
-
*/
|
|
773
|
-
getLanguage: function(r) {
|
|
774
|
-
for (; r; ) {
|
|
775
|
-
var t = b.exec(r.className);
|
|
776
|
-
if (t)
|
|
777
|
-
return t[1].toLowerCase();
|
|
778
|
-
r = r.parentElement;
|
|
779
|
-
}
|
|
780
|
-
return "none";
|
|
781
|
-
},
|
|
782
|
-
/**
|
|
783
|
-
* Sets the Prism `language-xxxx` class of the given element.
|
|
784
|
-
*
|
|
785
|
-
* @param {Element} element
|
|
786
|
-
* @param {string} language
|
|
787
|
-
* @returns {void}
|
|
788
|
-
*/
|
|
789
|
-
setLanguage: function(r, t) {
|
|
790
|
-
r.className = r.className.replace(RegExp(b, "gi"), ""), r.classList.add("language-" + t);
|
|
791
|
-
},
|
|
792
|
-
/**
|
|
793
|
-
* Returns the script element that is currently executing.
|
|
794
|
-
*
|
|
795
|
-
* This does __not__ work for line script element.
|
|
796
|
-
*
|
|
797
|
-
* @returns {HTMLScriptElement | null}
|
|
798
|
-
*/
|
|
799
|
-
currentScript: function() {
|
|
800
|
-
if (typeof document > "u")
|
|
801
|
-
return null;
|
|
802
|
-
if (document.currentScript && document.currentScript.tagName === "SCRIPT")
|
|
803
|
-
return (
|
|
804
|
-
/** @type {any} */
|
|
805
|
-
document.currentScript
|
|
806
|
-
);
|
|
807
|
-
try {
|
|
808
|
-
throw new Error();
|
|
809
|
-
} catch (o) {
|
|
810
|
-
var r = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(o.stack) || [])[1];
|
|
811
|
-
if (r) {
|
|
812
|
-
var t = document.getElementsByTagName("script");
|
|
813
|
-
for (var i in t)
|
|
814
|
-
if (t[i].src == r)
|
|
815
|
-
return t[i];
|
|
816
|
-
}
|
|
817
|
-
return null;
|
|
818
|
-
}
|
|
819
|
-
},
|
|
820
|
-
/**
|
|
821
|
-
* Returns whether a given class is active for `element`.
|
|
822
|
-
*
|
|
823
|
-
* The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
|
|
824
|
-
* if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
|
|
825
|
-
* given class is just the given class with a `no-` prefix.
|
|
826
|
-
*
|
|
827
|
-
* Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
|
|
828
|
-
* closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
|
|
829
|
-
* ancestors have the given class or the negated version of it, then the default activation will be returned.
|
|
830
|
-
*
|
|
831
|
-
* In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
|
|
832
|
-
* version of it, the class is considered active.
|
|
833
|
-
*
|
|
834
|
-
* @param {Element} element
|
|
835
|
-
* @param {string} className
|
|
836
|
-
* @param {boolean} [defaultActivation=false]
|
|
837
|
-
* @returns {boolean}
|
|
838
|
-
*/
|
|
839
|
-
isActive: function(r, t, i) {
|
|
840
|
-
for (var o = "no-" + t; r; ) {
|
|
841
|
-
var l = r.classList;
|
|
842
|
-
if (l.contains(t))
|
|
843
|
-
return !0;
|
|
844
|
-
if (l.contains(o))
|
|
845
|
-
return !1;
|
|
846
|
-
r = r.parentElement;
|
|
847
|
-
}
|
|
848
|
-
return !!i;
|
|
849
|
-
}
|
|
850
|
-
},
|
|
851
|
-
/**
|
|
852
|
-
* This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
|
|
853
|
-
*
|
|
854
|
-
* @namespace
|
|
855
|
-
* @memberof Prism
|
|
856
|
-
* @public
|
|
857
|
-
*/
|
|
858
|
-
languages: {
|
|
859
|
-
/**
|
|
860
|
-
* The grammar for plain, unformatted text.
|
|
861
|
-
*/
|
|
862
|
-
plain: R,
|
|
863
|
-
plaintext: R,
|
|
864
|
-
text: R,
|
|
865
|
-
txt: R,
|
|
866
|
-
/**
|
|
867
|
-
* Creates a deep copy of the language with the given id and appends the given tokens.
|
|
868
|
-
*
|
|
869
|
-
* If a token in `redef` also appears in the copied language, then the existing token in the copied language
|
|
870
|
-
* will be overwritten at its original position.
|
|
871
|
-
*
|
|
872
|
-
* ## Best practices
|
|
873
|
-
*
|
|
874
|
-
* Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
|
|
875
|
-
* doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
|
|
876
|
-
* understand the language definition because, normally, the order of tokens matters in Prism grammars.
|
|
877
|
-
*
|
|
878
|
-
* Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
|
|
879
|
-
* Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
|
|
880
|
-
*
|
|
881
|
-
* @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
|
|
882
|
-
* @param {Grammar} redef The new tokens to append.
|
|
883
|
-
* @returns {Grammar} The new language created.
|
|
884
|
-
* @public
|
|
885
|
-
* @example
|
|
886
|
-
* Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
|
|
887
|
-
* // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
|
|
888
|
-
* // at its original position
|
|
889
|
-
* 'comment': { ... },
|
|
890
|
-
* // CSS doesn't have a 'color' token, so this token will be appended
|
|
891
|
-
* 'color': /\b(?:red|green|blue)\b/
|
|
892
|
-
* });
|
|
893
|
-
*/
|
|
894
|
-
extend: function(r, t) {
|
|
895
|
-
var i = s.util.clone(s.languages[r]);
|
|
896
|
-
for (var o in t)
|
|
897
|
-
i[o] = t[o];
|
|
898
|
-
return i;
|
|
899
|
-
},
|
|
900
|
-
/**
|
|
901
|
-
* Inserts tokens _before_ another token in a language definition or any other grammar.
|
|
902
|
-
*
|
|
903
|
-
* ## Usage
|
|
904
|
-
*
|
|
905
|
-
* This helper method makes it easy to modify existing languages. For example, the CSS language definition
|
|
906
|
-
* not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
|
|
907
|
-
* in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
|
|
908
|
-
* appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
|
|
909
|
-
* this:
|
|
910
|
-
*
|
|
911
|
-
* ```js
|
|
912
|
-
* Prism.languages.markup.style = {
|
|
913
|
-
* // token
|
|
914
|
-
* };
|
|
915
|
-
* ```
|
|
916
|
-
*
|
|
917
|
-
* then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
|
|
918
|
-
* before existing tokens. For the CSS example above, you would use it like this:
|
|
919
|
-
*
|
|
920
|
-
* ```js
|
|
921
|
-
* Prism.languages.insertBefore('markup', 'cdata', {
|
|
922
|
-
* 'style': {
|
|
923
|
-
* // token
|
|
924
|
-
* }
|
|
925
|
-
* });
|
|
926
|
-
* ```
|
|
927
|
-
*
|
|
928
|
-
* ## Special cases
|
|
929
|
-
*
|
|
930
|
-
* If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
|
|
931
|
-
* will be ignored.
|
|
932
|
-
*
|
|
933
|
-
* This behavior can be used to insert tokens after `before`:
|
|
934
|
-
*
|
|
935
|
-
* ```js
|
|
936
|
-
* Prism.languages.insertBefore('markup', 'comment', {
|
|
937
|
-
* 'comment': Prism.languages.markup.comment,
|
|
938
|
-
* // tokens after 'comment'
|
|
939
|
-
* });
|
|
940
|
-
* ```
|
|
941
|
-
*
|
|
942
|
-
* ## Limitations
|
|
943
|
-
*
|
|
944
|
-
* The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
|
|
945
|
-
* properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
|
|
946
|
-
* differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
|
|
947
|
-
* deleting properties which is necessary to insert at arbitrary positions.
|
|
948
|
-
*
|
|
949
|
-
* To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
|
|
950
|
-
* Instead, it will create a new object and replace all references to the target object with the new one. This
|
|
951
|
-
* can be done without temporarily deleting properties, so the iteration order is well-defined.
|
|
952
|
-
*
|
|
953
|
-
* However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
|
|
954
|
-
* you hold the target object in a variable, then the value of the variable will not change.
|
|
955
|
-
*
|
|
956
|
-
* ```js
|
|
957
|
-
* var oldMarkup = Prism.languages.markup;
|
|
958
|
-
* var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
|
|
959
|
-
*
|
|
960
|
-
* assert(oldMarkup !== Prism.languages.markup);
|
|
961
|
-
* assert(newMarkup === Prism.languages.markup);
|
|
962
|
-
* ```
|
|
963
|
-
*
|
|
964
|
-
* @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
|
|
965
|
-
* object to be modified.
|
|
966
|
-
* @param {string} before The key to insert before.
|
|
967
|
-
* @param {Grammar} insert An object containing the key-value pairs to be inserted.
|
|
968
|
-
* @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
|
|
969
|
-
* object to be modified.
|
|
970
|
-
*
|
|
971
|
-
* Defaults to `Prism.languages`.
|
|
972
|
-
* @returns {Grammar} The new grammar object.
|
|
973
|
-
* @public
|
|
974
|
-
*/
|
|
975
|
-
insertBefore: function(r, t, i, o) {
|
|
976
|
-
o = o || /** @type {any} */
|
|
977
|
-
s.languages;
|
|
978
|
-
var l = o[r], g = {};
|
|
979
|
-
for (var x in l)
|
|
980
|
-
if (l.hasOwnProperty(x)) {
|
|
981
|
-
if (x == t)
|
|
982
|
-
for (var f in i)
|
|
983
|
-
i.hasOwnProperty(f) && (g[f] = i[f]);
|
|
984
|
-
i.hasOwnProperty(x) || (g[x] = l[x]);
|
|
985
|
-
}
|
|
986
|
-
var N = o[r];
|
|
987
|
-
return o[r] = g, s.languages.DFS(s.languages, function(j, W) {
|
|
988
|
-
W === N && j != r && (this[j] = g);
|
|
989
|
-
}), g;
|
|
990
|
-
},
|
|
991
|
-
// Traverse a language definition with Depth First Search
|
|
992
|
-
DFS: function r(t, i, o, l) {
|
|
993
|
-
l = l || {};
|
|
994
|
-
var g = s.util.objId;
|
|
995
|
-
for (var x in t)
|
|
996
|
-
if (t.hasOwnProperty(x)) {
|
|
997
|
-
i.call(t, x, t[x], o || x);
|
|
998
|
-
var f = t[x], N = s.util.type(f);
|
|
999
|
-
N === "Object" && !l[g(f)] ? (l[g(f)] = !0, r(f, i, null, l)) : N === "Array" && !l[g(f)] && (l[g(f)] = !0, r(f, i, x, l));
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
},
|
|
1003
|
-
plugins: {},
|
|
1004
|
-
/**
|
|
1005
|
-
* This is the most high-level function in Prism’s API.
|
|
1006
|
-
* It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
|
|
1007
|
-
* each one of them.
|
|
1008
|
-
*
|
|
1009
|
-
* This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
|
|
1010
|
-
*
|
|
1011
|
-
* @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
|
|
1012
|
-
* @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
|
|
1013
|
-
* @memberof Prism
|
|
1014
|
-
* @public
|
|
1015
|
-
*/
|
|
1016
|
-
highlightAll: function(r, t) {
|
|
1017
|
-
s.highlightAllUnder(document, r, t);
|
|
1018
|
-
},
|
|
1019
|
-
/**
|
|
1020
|
-
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
|
|
1021
|
-
* {@link Prism.highlightElement} on each one of them.
|
|
1022
|
-
*
|
|
1023
|
-
* The following hooks will be run:
|
|
1024
|
-
* 1. `before-highlightall`
|
|
1025
|
-
* 2. `before-all-elements-highlight`
|
|
1026
|
-
* 3. All hooks of {@link Prism.highlightElement} for each element.
|
|
1027
|
-
*
|
|
1028
|
-
* @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
|
|
1029
|
-
* @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
|
|
1030
|
-
* @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
|
|
1031
|
-
* @memberof Prism
|
|
1032
|
-
* @public
|
|
1033
|
-
*/
|
|
1034
|
-
highlightAllUnder: function(r, t, i) {
|
|
1035
|
-
var o = {
|
|
1036
|
-
callback: i,
|
|
1037
|
-
container: r,
|
|
1038
|
-
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
|
1039
|
-
};
|
|
1040
|
-
s.hooks.run("before-highlightall", o), o.elements = Array.prototype.slice.apply(o.container.querySelectorAll(o.selector)), s.hooks.run("before-all-elements-highlight", o);
|
|
1041
|
-
for (var l = 0, g; g = o.elements[l++]; )
|
|
1042
|
-
s.highlightElement(g, t === !0, o.callback);
|
|
1043
|
-
},
|
|
1044
|
-
/**
|
|
1045
|
-
* Highlights the code inside a single element.
|
|
1046
|
-
*
|
|
1047
|
-
* The following hooks will be run:
|
|
1048
|
-
* 1. `before-sanity-check`
|
|
1049
|
-
* 2. `before-highlight`
|
|
1050
|
-
* 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
|
|
1051
|
-
* 4. `before-insert`
|
|
1052
|
-
* 5. `after-highlight`
|
|
1053
|
-
* 6. `complete`
|
|
1054
|
-
*
|
|
1055
|
-
* Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
|
|
1056
|
-
* the element's language.
|
|
1057
|
-
*
|
|
1058
|
-
* @param {Element} element The element containing the code.
|
|
1059
|
-
* It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
|
|
1060
|
-
* @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
|
|
1061
|
-
* to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
|
|
1062
|
-
* [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
|
|
1063
|
-
*
|
|
1064
|
-
* Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
|
|
1065
|
-
* asynchronous highlighting to work. You can build your own bundle on the
|
|
1066
|
-
* [Download page](https://prismjs.com/download.html).
|
|
1067
|
-
* @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
|
|
1068
|
-
* Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
|
|
1069
|
-
* @memberof Prism
|
|
1070
|
-
* @public
|
|
1071
|
-
*/
|
|
1072
|
-
highlightElement: function(r, t, i) {
|
|
1073
|
-
var o = s.util.getLanguage(r), l = s.languages[o];
|
|
1074
|
-
s.util.setLanguage(r, o);
|
|
1075
|
-
var g = r.parentElement;
|
|
1076
|
-
g && g.nodeName.toLowerCase() === "pre" && s.util.setLanguage(g, o);
|
|
1077
|
-
var x = r.textContent, f = {
|
|
1078
|
-
element: r,
|
|
1079
|
-
language: o,
|
|
1080
|
-
grammar: l,
|
|
1081
|
-
code: x
|
|
1082
|
-
};
|
|
1083
|
-
function N(W) {
|
|
1084
|
-
f.highlightedCode = W, s.hooks.run("before-insert", f), f.element.innerHTML = f.highlightedCode, s.hooks.run("after-highlight", f), s.hooks.run("complete", f), i && i.call(f.element);
|
|
1085
|
-
}
|
|
1086
|
-
if (s.hooks.run("before-sanity-check", f), g = f.element.parentElement, g && g.nodeName.toLowerCase() === "pre" && !g.hasAttribute("tabindex") && g.setAttribute("tabindex", "0"), !f.code) {
|
|
1087
|
-
s.hooks.run("complete", f), i && i.call(f.element);
|
|
1088
|
-
return;
|
|
1089
|
-
}
|
|
1090
|
-
if (s.hooks.run("before-highlight", f), !f.grammar) {
|
|
1091
|
-
N(s.util.encode(f.code));
|
|
1092
|
-
return;
|
|
1093
|
-
}
|
|
1094
|
-
if (t && u.Worker) {
|
|
1095
|
-
var j = new Worker(s.filename);
|
|
1096
|
-
j.onmessage = function(W) {
|
|
1097
|
-
N(W.data);
|
|
1098
|
-
}, j.postMessage(JSON.stringify({
|
|
1099
|
-
language: f.language,
|
|
1100
|
-
code: f.code,
|
|
1101
|
-
immediateClose: !0
|
|
1102
|
-
}));
|
|
1103
|
-
} else
|
|
1104
|
-
N(s.highlight(f.code, f.grammar, f.language));
|
|
1105
|
-
},
|
|
1106
|
-
/**
|
|
1107
|
-
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input
|
|
1108
|
-
* and the language definitions to use, and returns a string with the HTML produced.
|
|
1109
|
-
*
|
|
1110
|
-
* The following hooks will be run:
|
|
1111
|
-
* 1. `before-tokenize`
|
|
1112
|
-
* 2. `after-tokenize`
|
|
1113
|
-
* 3. `wrap`: On each {@link Token}.
|
|
1114
|
-
*
|
|
1115
|
-
* @param {string} text A string with the code to be highlighted.
|
|
1116
|
-
* @param {Grammar} grammar An object containing the tokens to use.
|
|
1117
|
-
*
|
|
1118
|
-
* Usually a language definition like `Prism.languages.markup`.
|
|
1119
|
-
* @param {string} language The name of the language definition passed to `grammar`.
|
|
1120
|
-
* @returns {string} The highlighted HTML.
|
|
1121
|
-
* @memberof Prism
|
|
1122
|
-
* @public
|
|
1123
|
-
* @example
|
|
1124
|
-
* Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
|
|
1125
|
-
*/
|
|
1126
|
-
highlight: function(r, t, i) {
|
|
1127
|
-
var o = {
|
|
1128
|
-
code: r,
|
|
1129
|
-
grammar: t,
|
|
1130
|
-
language: i
|
|
1131
|
-
};
|
|
1132
|
-
if (s.hooks.run("before-tokenize", o), !o.grammar)
|
|
1133
|
-
throw new Error('The language "' + o.language + '" has no grammar.');
|
|
1134
|
-
return o.tokens = s.tokenize(o.code, o.grammar), s.hooks.run("after-tokenize", o), m.stringify(s.util.encode(o.tokens), o.language);
|
|
1135
|
-
},
|
|
1136
|
-
/**
|
|
1137
|
-
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
|
|
1138
|
-
* and the language definitions to use, and returns an array with the tokenized code.
|
|
1139
|
-
*
|
|
1140
|
-
* When the language definition includes nested tokens, the function is called recursively on each of these tokens.
|
|
1141
|
-
*
|
|
1142
|
-
* This method could be useful in other contexts as well, as a very crude parser.
|
|
1143
|
-
*
|
|
1144
|
-
* @param {string} text A string with the code to be highlighted.
|
|
1145
|
-
* @param {Grammar} grammar An object containing the tokens to use.
|
|
1146
|
-
*
|
|
1147
|
-
* Usually a language definition like `Prism.languages.markup`.
|
|
1148
|
-
* @returns {TokenStream} An array of strings and tokens, a token stream.
|
|
1149
|
-
* @memberof Prism
|
|
1150
|
-
* @public
|
|
1151
|
-
* @example
|
|
1152
|
-
* let code = `var foo = 0;`;
|
|
1153
|
-
* let tokens = Prism.tokenize(code, Prism.languages.javascript);
|
|
1154
|
-
* tokens.forEach(token => {
|
|
1155
|
-
* if (token instanceof Prism.Token && token.type === 'number') {
|
|
1156
|
-
* console.log(`Found numeric literal: ${token.content}`);
|
|
1157
|
-
* }
|
|
1158
|
-
* });
|
|
1159
|
-
*/
|
|
1160
|
-
tokenize: function(r, t) {
|
|
1161
|
-
var i = t.rest;
|
|
1162
|
-
if (i) {
|
|
1163
|
-
for (var o in i)
|
|
1164
|
-
t[o] = i[o];
|
|
1165
|
-
delete t.rest;
|
|
1166
|
-
}
|
|
1167
|
-
var l = new I();
|
|
1168
|
-
return C(l, l.head, r), S(r, l, t, l.head, 0), Z(l);
|
|
1169
|
-
},
|
|
1170
|
-
/**
|
|
1171
|
-
* @namespace
|
|
1172
|
-
* @memberof Prism
|
|
1173
|
-
* @public
|
|
1174
|
-
*/
|
|
1175
|
-
hooks: {
|
|
1176
|
-
all: {},
|
|
1177
|
-
/**
|
|
1178
|
-
* Adds the given callback to the list of callbacks for the given hook.
|
|
1179
|
-
*
|
|
1180
|
-
* The callback will be invoked when the hook it is registered for is run.
|
|
1181
|
-
* Hooks are usually directly run by a highlight function but you can also run hooks yourself.
|
|
1182
|
-
*
|
|
1183
|
-
* One callback function can be registered to multiple hooks and the same hook multiple times.
|
|
1184
|
-
*
|
|
1185
|
-
* @param {string} name The name of the hook.
|
|
1186
|
-
* @param {HookCallback} callback The callback function which is given environment variables.
|
|
1187
|
-
* @public
|
|
1188
|
-
*/
|
|
1189
|
-
add: function(r, t) {
|
|
1190
|
-
var i = s.hooks.all;
|
|
1191
|
-
i[r] = i[r] || [], i[r].push(t);
|
|
1192
|
-
},
|
|
1193
|
-
/**
|
|
1194
|
-
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
1195
|
-
*
|
|
1196
|
-
* Callbacks will be invoked synchronously and in the order in which they were registered.
|
|
1197
|
-
*
|
|
1198
|
-
* @param {string} name The name of the hook.
|
|
1199
|
-
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
|
1200
|
-
* @public
|
|
1201
|
-
*/
|
|
1202
|
-
run: function(r, t) {
|
|
1203
|
-
var i = s.hooks.all[r];
|
|
1204
|
-
if (!(!i || !i.length))
|
|
1205
|
-
for (var o = 0, l; l = i[o++]; )
|
|
1206
|
-
l(t);
|
|
1207
|
-
}
|
|
1208
|
-
},
|
|
1209
|
-
Token: m
|
|
1210
|
-
};
|
|
1211
|
-
u.Prism = s;
|
|
1212
|
-
function m(r, t, i, o) {
|
|
1213
|
-
this.type = r, this.content = t, this.alias = i, this.length = (o || "").length | 0;
|
|
1214
|
-
}
|
|
1215
|
-
m.stringify = function r(t, i) {
|
|
1216
|
-
if (typeof t == "string")
|
|
1217
|
-
return t;
|
|
1218
|
-
if (Array.isArray(t)) {
|
|
1219
|
-
var o = "";
|
|
1220
|
-
return t.forEach(function(N) {
|
|
1221
|
-
o += r(N, i);
|
|
1222
|
-
}), o;
|
|
1223
|
-
}
|
|
1224
|
-
var l = {
|
|
1225
|
-
type: t.type,
|
|
1226
|
-
content: r(t.content, i),
|
|
1227
|
-
tag: "span",
|
|
1228
|
-
classes: ["token", t.type],
|
|
1229
|
-
attributes: {},
|
|
1230
|
-
language: i
|
|
1231
|
-
}, g = t.alias;
|
|
1232
|
-
g && (Array.isArray(g) ? Array.prototype.push.apply(l.classes, g) : l.classes.push(g)), s.hooks.run("wrap", l);
|
|
1233
|
-
var x = "";
|
|
1234
|
-
for (var f in l.attributes)
|
|
1235
|
-
x += " " + f + '="' + (l.attributes[f] || "").replace(/"/g, """) + '"';
|
|
1236
|
-
return "<" + l.tag + ' class="' + l.classes.join(" ") + '"' + x + ">" + l.content + "</" + l.tag + ">";
|
|
1237
|
-
};
|
|
1238
|
-
function k(r, t, i, o) {
|
|
1239
|
-
r.lastIndex = t;
|
|
1240
|
-
var l = r.exec(i);
|
|
1241
|
-
if (l && o && l[1]) {
|
|
1242
|
-
var g = l[1].length;
|
|
1243
|
-
l.index += g, l[0] = l[0].slice(g);
|
|
1244
|
-
}
|
|
1245
|
-
return l;
|
|
1246
|
-
}
|
|
1247
|
-
function S(r, t, i, o, l, g) {
|
|
1248
|
-
for (var x in i)
|
|
1249
|
-
if (!(!i.hasOwnProperty(x) || !i[x])) {
|
|
1250
|
-
var f = i[x];
|
|
1251
|
-
f = Array.isArray(f) ? f : [f];
|
|
1252
|
-
for (var N = 0; N < f.length; ++N) {
|
|
1253
|
-
if (g && g.cause == x + "," + N)
|
|
1254
|
-
return;
|
|
1255
|
-
var j = f[N], W = j.inside, H = !!j.lookbehind, G = !!j.greedy, ne = j.alias;
|
|
1256
|
-
if (G && !j.pattern.global) {
|
|
1257
|
-
var ae = j.pattern.toString().match(/[imsuy]*$/)[0];
|
|
1258
|
-
j.pattern = RegExp(j.pattern.source, ae + "g");
|
|
1259
|
-
}
|
|
1260
|
-
for (var ue = j.pattern || j, D = o.next, z = l; D !== t.tail && !(g && z >= g.reach); z += D.value.length, D = D.next) {
|
|
1261
|
-
var re = D.value;
|
|
1262
|
-
if (t.length > r.length)
|
|
1263
|
-
return;
|
|
1264
|
-
if (!(re instanceof m)) {
|
|
1265
|
-
var J = 1, B;
|
|
1266
|
-
if (G) {
|
|
1267
|
-
if (B = k(ue, z, r, H), !B || B.index >= r.length)
|
|
1268
|
-
break;
|
|
1269
|
-
var ie = B.index, le = B.index + B[0].length, q = z;
|
|
1270
|
-
for (q += D.value.length; ie >= q; )
|
|
1271
|
-
D = D.next, q += D.value.length;
|
|
1272
|
-
if (q -= D.value.length, z = q, D.value instanceof m)
|
|
1273
|
-
continue;
|
|
1274
|
-
for (var Q = D; Q !== t.tail && (q < le || typeof Q.value == "string"); Q = Q.next)
|
|
1275
|
-
J++, q += Q.value.length;
|
|
1276
|
-
J--, re = r.slice(z, q), B.index -= z;
|
|
1277
|
-
} else if (B = k(ue, 0, re, H), !B)
|
|
1278
|
-
continue;
|
|
1279
|
-
var ie = B.index, oe = B[0], Y = re.slice(0, ie), de = re.slice(ie + oe.length), se = z + re.length;
|
|
1280
|
-
g && se > g.reach && (g.reach = se);
|
|
1281
|
-
var pe = D.prev;
|
|
1282
|
-
Y && (pe = C(t, pe, Y), z += Y.length), U(t, pe, J);
|
|
1283
|
-
var ye = new m(x, W ? s.tokenize(oe, W) : oe, ne, oe);
|
|
1284
|
-
if (D = C(t, pe, ye), de && C(t, D, de), J > 1) {
|
|
1285
|
-
var me = {
|
|
1286
|
-
cause: x + "," + N,
|
|
1287
|
-
reach: se
|
|
1288
|
-
};
|
|
1289
|
-
S(r, t, i, D.prev, z, me), g && me.reach > g.reach && (g.reach = me.reach);
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
function I() {
|
|
1297
|
-
var r = { value: null, prev: null, next: null }, t = { value: null, prev: r, next: null };
|
|
1298
|
-
r.next = t, this.head = r, this.tail = t, this.length = 0;
|
|
1299
|
-
}
|
|
1300
|
-
function C(r, t, i) {
|
|
1301
|
-
var o = t.next, l = { value: i, prev: t, next: o };
|
|
1302
|
-
return t.next = l, o.prev = l, r.length++, l;
|
|
1303
|
-
}
|
|
1304
|
-
function U(r, t, i) {
|
|
1305
|
-
for (var o = t.next, l = 0; l < i && o !== r.tail; l++)
|
|
1306
|
-
o = o.next;
|
|
1307
|
-
t.next = o, o.prev = t, r.length -= l;
|
|
1308
|
-
}
|
|
1309
|
-
function Z(r) {
|
|
1310
|
-
for (var t = [], i = r.head.next; i !== r.tail; )
|
|
1311
|
-
t.push(i.value), i = i.next;
|
|
1312
|
-
return t;
|
|
1313
|
-
}
|
|
1314
|
-
if (!u.document)
|
|
1315
|
-
return u.addEventListener && (s.disableWorkerMessageHandler || u.addEventListener("message", function(r) {
|
|
1316
|
-
var t = JSON.parse(r.data), i = t.language, o = t.code, l = t.immediateClose;
|
|
1317
|
-
u.postMessage(s.highlight(o, s.languages[i], i)), l && u.close();
|
|
1318
|
-
}, !1)), s;
|
|
1319
|
-
var _ = s.util.currentScript();
|
|
1320
|
-
_ && (s.filename = _.src, _.hasAttribute("data-manual") && (s.manual = !0));
|
|
1321
|
-
function E() {
|
|
1322
|
-
s.manual || s.highlightAll();
|
|
1323
|
-
}
|
|
1324
|
-
if (!s.manual) {
|
|
1325
|
-
var y = document.readyState;
|
|
1326
|
-
y === "loading" || y === "interactive" && _ && _.defer ? document.addEventListener("DOMContentLoaded", E) : window.requestAnimationFrame ? window.requestAnimationFrame(E) : window.setTimeout(E, 16);
|
|
1327
|
-
}
|
|
1328
|
-
return s;
|
|
1329
|
-
}(h);
|
|
1330
|
-
p.exports && (p.exports = n), typeof Je < "u" && (Je.Prism = n), n.languages.markup = {
|
|
1331
|
-
comment: {
|
|
1332
|
-
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
1333
|
-
greedy: !0
|
|
1334
|
-
},
|
|
1335
|
-
prolog: {
|
|
1336
|
-
pattern: /<\?[\s\S]+?\?>/,
|
|
1337
|
-
greedy: !0
|
|
1338
|
-
},
|
|
1339
|
-
doctype: {
|
|
1340
|
-
// https://www.w3.org/TR/xml/#NT-doctypedecl
|
|
1341
|
-
pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
|
|
1342
|
-
greedy: !0,
|
|
1343
|
-
inside: {
|
|
1344
|
-
"internal-subset": {
|
|
1345
|
-
pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
|
|
1346
|
-
lookbehind: !0,
|
|
1347
|
-
greedy: !0,
|
|
1348
|
-
inside: null
|
|
1349
|
-
// see below
|
|
1350
|
-
},
|
|
1351
|
-
string: {
|
|
1352
|
-
pattern: /"[^"]*"|'[^']*'/,
|
|
1353
|
-
greedy: !0
|
|
1354
|
-
},
|
|
1355
|
-
punctuation: /^<!|>$|[[\]]/,
|
|
1356
|
-
"doctype-tag": /^DOCTYPE/i,
|
|
1357
|
-
name: /[^\s<>'"]+/
|
|
1358
|
-
}
|
|
1359
|
-
},
|
|
1360
|
-
cdata: {
|
|
1361
|
-
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
1362
|
-
greedy: !0
|
|
1363
|
-
},
|
|
1364
|
-
tag: {
|
|
1365
|
-
pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
|
|
1366
|
-
greedy: !0,
|
|
1367
|
-
inside: {
|
|
1368
|
-
tag: {
|
|
1369
|
-
pattern: /^<\/?[^\s>\/]+/,
|
|
1370
|
-
inside: {
|
|
1371
|
-
punctuation: /^<\/?/,
|
|
1372
|
-
namespace: /^[^\s>\/:]+:/
|
|
1373
|
-
}
|
|
1374
|
-
},
|
|
1375
|
-
"special-attr": [],
|
|
1376
|
-
"attr-value": {
|
|
1377
|
-
pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
|
|
1378
|
-
inside: {
|
|
1379
|
-
punctuation: [
|
|
1380
|
-
{
|
|
1381
|
-
pattern: /^=/,
|
|
1382
|
-
alias: "attr-equals"
|
|
1383
|
-
},
|
|
1384
|
-
{
|
|
1385
|
-
pattern: /^(\s*)["']|["']$/,
|
|
1386
|
-
lookbehind: !0
|
|
1387
|
-
}
|
|
1388
|
-
]
|
|
1389
|
-
}
|
|
1390
|
-
},
|
|
1391
|
-
punctuation: /\/?>/,
|
|
1392
|
-
"attr-name": {
|
|
1393
|
-
pattern: /[^\s>\/]+/,
|
|
1394
|
-
inside: {
|
|
1395
|
-
namespace: /^[^\s>\/:]+:/
|
|
1396
|
-
}
|
|
1397
|
-
}
|
|
1398
|
-
}
|
|
1399
|
-
},
|
|
1400
|
-
entity: [
|
|
1401
|
-
{
|
|
1402
|
-
pattern: /&[\da-z]{1,8};/i,
|
|
1403
|
-
alias: "named-entity"
|
|
1404
|
-
},
|
|
1405
|
-
/&#x?[\da-f]{1,8};/i
|
|
1406
|
-
]
|
|
1407
|
-
}, n.languages.markup.tag.inside["attr-value"].inside.entity = n.languages.markup.entity, n.languages.markup.doctype.inside["internal-subset"].inside = n.languages.markup, n.hooks.add("wrap", function(u) {
|
|
1408
|
-
u.type === "entity" && (u.attributes.title = u.content.replace(/&/, "&"));
|
|
1409
|
-
}), Object.defineProperty(n.languages.markup.tag, "addInlined", {
|
|
1410
|
-
/**
|
|
1411
|
-
* Adds an inlined language to markup.
|
|
1412
|
-
*
|
|
1413
|
-
* An example of an inlined language is CSS with `<style>` tags.
|
|
1414
|
-
*
|
|
1415
|
-
* @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
|
|
1416
|
-
* case insensitive.
|
|
1417
|
-
* @param {string} lang The language key.
|
|
1418
|
-
* @example
|
|
1419
|
-
* addInlined('style', 'css');
|
|
1420
|
-
*/
|
|
1421
|
-
value: function(b, A) {
|
|
1422
|
-
var R = {};
|
|
1423
|
-
R["language-" + A] = {
|
|
1424
|
-
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
1425
|
-
lookbehind: !0,
|
|
1426
|
-
inside: n.languages[A]
|
|
1427
|
-
}, R.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
1428
|
-
var s = {
|
|
1429
|
-
"included-cdata": {
|
|
1430
|
-
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
1431
|
-
inside: R
|
|
1432
|
-
}
|
|
1433
|
-
};
|
|
1434
|
-
s["language-" + A] = {
|
|
1435
|
-
pattern: /[\s\S]+/,
|
|
1436
|
-
inside: n.languages[A]
|
|
1437
|
-
};
|
|
1438
|
-
var m = {};
|
|
1439
|
-
m[b] = {
|
|
1440
|
-
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
1441
|
-
return b;
|
|
1442
|
-
}), "i"),
|
|
1443
|
-
lookbehind: !0,
|
|
1444
|
-
greedy: !0,
|
|
1445
|
-
inside: s
|
|
1446
|
-
}, n.languages.insertBefore("markup", "cdata", m);
|
|
1447
|
-
}
|
|
1448
|
-
}), Object.defineProperty(n.languages.markup.tag, "addAttribute", {
|
|
1449
|
-
/**
|
|
1450
|
-
* Adds an pattern to highlight languages embedded in HTML attributes.
|
|
1451
|
-
*
|
|
1452
|
-
* An example of an inlined language is CSS with `style` attributes.
|
|
1453
|
-
*
|
|
1454
|
-
* @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
|
|
1455
|
-
* case insensitive.
|
|
1456
|
-
* @param {string} lang The language key.
|
|
1457
|
-
* @example
|
|
1458
|
-
* addAttribute('style', 'css');
|
|
1459
|
-
*/
|
|
1460
|
-
value: function(u, b) {
|
|
1461
|
-
n.languages.markup.tag.inside["special-attr"].push({
|
|
1462
|
-
pattern: RegExp(
|
|
1463
|
-
/(^|["'\s])/.source + "(?:" + u + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
|
|
1464
|
-
"i"
|
|
1465
|
-
),
|
|
1466
|
-
lookbehind: !0,
|
|
1467
|
-
inside: {
|
|
1468
|
-
"attr-name": /^[^\s=]+/,
|
|
1469
|
-
"attr-value": {
|
|
1470
|
-
pattern: /=[\s\S]+/,
|
|
1471
|
-
inside: {
|
|
1472
|
-
value: {
|
|
1473
|
-
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
1474
|
-
lookbehind: !0,
|
|
1475
|
-
alias: [b, "language-" + b],
|
|
1476
|
-
inside: n.languages[b]
|
|
1477
|
-
},
|
|
1478
|
-
punctuation: [
|
|
1479
|
-
{
|
|
1480
|
-
pattern: /^=/,
|
|
1481
|
-
alias: "attr-equals"
|
|
1482
|
-
},
|
|
1483
|
-
/"|'/
|
|
1484
|
-
]
|
|
1485
|
-
}
|
|
1486
|
-
}
|
|
1487
|
-
}
|
|
1488
|
-
});
|
|
1489
|
-
}
|
|
1490
|
-
}), n.languages.html = n.languages.markup, n.languages.mathml = n.languages.markup, n.languages.svg = n.languages.markup, n.languages.xml = n.languages.extend("markup", {}), n.languages.ssml = n.languages.xml, n.languages.atom = n.languages.xml, n.languages.rss = n.languages.xml, function(u) {
|
|
1491
|
-
var b = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
1492
|
-
u.languages.css = {
|
|
1493
|
-
comment: /\/\*[\s\S]*?\*\//,
|
|
1494
|
-
atrule: {
|
|
1495
|
-
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + b.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
|
1496
|
-
inside: {
|
|
1497
|
-
rule: /^@[\w-]+/,
|
|
1498
|
-
"selector-function-argument": {
|
|
1499
|
-
pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
|
|
1500
|
-
lookbehind: !0,
|
|
1501
|
-
alias: "selector"
|
|
1502
|
-
},
|
|
1503
|
-
keyword: {
|
|
1504
|
-
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
|
|
1505
|
-
lookbehind: !0
|
|
1506
|
-
}
|
|
1507
|
-
// See rest below
|
|
1508
|
-
}
|
|
1509
|
-
},
|
|
1510
|
-
url: {
|
|
1511
|
-
// https://drafts.csswg.org/css-values-3/#urls
|
|
1512
|
-
pattern: RegExp("\\burl\\((?:" + b.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
|
1513
|
-
greedy: !0,
|
|
1514
|
-
inside: {
|
|
1515
|
-
function: /^url/i,
|
|
1516
|
-
punctuation: /^\(|\)$/,
|
|
1517
|
-
string: {
|
|
1518
|
-
pattern: RegExp("^" + b.source + "$"),
|
|
1519
|
-
alias: "url"
|
|
1520
|
-
}
|
|
1521
|
-
}
|
|
1522
|
-
},
|
|
1523
|
-
selector: {
|
|
1524
|
-
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + b.source + ")*(?=\\s*\\{)"),
|
|
1525
|
-
lookbehind: !0
|
|
1526
|
-
},
|
|
1527
|
-
string: {
|
|
1528
|
-
pattern: b,
|
|
1529
|
-
greedy: !0
|
|
1530
|
-
},
|
|
1531
|
-
property: {
|
|
1532
|
-
pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
|
|
1533
|
-
lookbehind: !0
|
|
1534
|
-
},
|
|
1535
|
-
important: /!important\b/i,
|
|
1536
|
-
function: {
|
|
1537
|
-
pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
|
|
1538
|
-
lookbehind: !0
|
|
1539
|
-
},
|
|
1540
|
-
punctuation: /[(){};:,]/
|
|
1541
|
-
}, u.languages.css.atrule.inside.rest = u.languages.css;
|
|
1542
|
-
var A = u.languages.markup;
|
|
1543
|
-
A && (A.tag.addInlined("style", "css"), A.tag.addAttribute("style", "css"));
|
|
1544
|
-
}(n), n.languages.clike = {
|
|
1545
|
-
comment: [
|
|
1546
|
-
{
|
|
1547
|
-
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
|
1548
|
-
lookbehind: !0,
|
|
1549
|
-
greedy: !0
|
|
1550
|
-
},
|
|
1551
|
-
{
|
|
1552
|
-
pattern: /(^|[^\\:])\/\/.*/,
|
|
1553
|
-
lookbehind: !0,
|
|
1554
|
-
greedy: !0
|
|
1555
|
-
}
|
|
1556
|
-
],
|
|
1557
|
-
string: {
|
|
1558
|
-
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
|
1559
|
-
greedy: !0
|
|
1560
|
-
},
|
|
1561
|
-
"class-name": {
|
|
1562
|
-
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
|
1563
|
-
lookbehind: !0,
|
|
1564
|
-
inside: {
|
|
1565
|
-
punctuation: /[.\\]/
|
|
1566
|
-
}
|
|
1567
|
-
},
|
|
1568
|
-
keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
|
|
1569
|
-
boolean: /\b(?:false|true)\b/,
|
|
1570
|
-
function: /\b\w+(?=\()/,
|
|
1571
|
-
number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
|
1572
|
-
operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
|
1573
|
-
punctuation: /[{}[\];(),.:]/
|
|
1574
|
-
}, n.languages.javascript = n.languages.extend("clike", {
|
|
1575
|
-
"class-name": [
|
|
1576
|
-
n.languages.clike["class-name"],
|
|
1577
|
-
{
|
|
1578
|
-
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
1579
|
-
lookbehind: !0
|
|
1580
|
-
}
|
|
1581
|
-
],
|
|
1582
|
-
keyword: [
|
|
1583
|
-
{
|
|
1584
|
-
pattern: /((?:^|\})\s*)catch\b/,
|
|
1585
|
-
lookbehind: !0
|
|
1586
|
-
},
|
|
1587
|
-
{
|
|
1588
|
-
pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
|
|
1589
|
-
lookbehind: !0
|
|
1590
|
-
}
|
|
1591
|
-
],
|
|
1592
|
-
// Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
|
|
1593
|
-
function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
|
1594
|
-
number: {
|
|
1595
|
-
pattern: RegExp(
|
|
1596
|
-
/(^|[^\w$])/.source + "(?:" + // constant
|
|
1597
|
-
(/NaN|Infinity/.source + "|" + // binary integer
|
|
1598
|
-
/0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
|
|
1599
|
-
/0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
|
|
1600
|
-
/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
|
|
1601
|
-
/\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
|
|
1602
|
-
/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
|
|
1603
|
-
),
|
|
1604
|
-
lookbehind: !0
|
|
1605
|
-
},
|
|
1606
|
-
operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
1607
|
-
}), n.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, n.languages.insertBefore("javascript", "keyword", {
|
|
1608
|
-
regex: {
|
|
1609
|
-
pattern: RegExp(
|
|
1610
|
-
// lookbehind
|
|
1611
|
-
// eslint-disable-next-line regexp/no-dupe-characters-character-class
|
|
1612
|
-
/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
|
|
1613
|
-
// There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
|
|
1614
|
-
// classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
|
|
1615
|
-
// with the only syntax, so we have to define 2 different regex patterns.
|
|
1616
|
-
/\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
|
|
1617
|
-
/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
|
|
1618
|
-
/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
|
|
1619
|
-
),
|
|
1620
|
-
lookbehind: !0,
|
|
1621
|
-
greedy: !0,
|
|
1622
|
-
inside: {
|
|
1623
|
-
"regex-source": {
|
|
1624
|
-
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
1625
|
-
lookbehind: !0,
|
|
1626
|
-
alias: "language-regex",
|
|
1627
|
-
inside: n.languages.regex
|
|
1628
|
-
},
|
|
1629
|
-
"regex-delimiter": /^\/|\/$/,
|
|
1630
|
-
"regex-flags": /^[a-z]+$/
|
|
1631
|
-
}
|
|
1632
|
-
},
|
|
1633
|
-
// This must be declared before keyword because we use "function" inside the look-forward
|
|
1634
|
-
"function-variable": {
|
|
1635
|
-
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
|
|
1636
|
-
alias: "function"
|
|
1637
|
-
},
|
|
1638
|
-
parameter: [
|
|
1639
|
-
{
|
|
1640
|
-
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
1641
|
-
lookbehind: !0,
|
|
1642
|
-
inside: n.languages.javascript
|
|
1643
|
-
},
|
|
1644
|
-
{
|
|
1645
|
-
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
1646
|
-
lookbehind: !0,
|
|
1647
|
-
inside: n.languages.javascript
|
|
1648
|
-
},
|
|
1649
|
-
{
|
|
1650
|
-
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
1651
|
-
lookbehind: !0,
|
|
1652
|
-
inside: n.languages.javascript
|
|
1653
|
-
},
|
|
1654
|
-
{
|
|
1655
|
-
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
|
|
1656
|
-
lookbehind: !0,
|
|
1657
|
-
inside: n.languages.javascript
|
|
1658
|
-
}
|
|
1659
|
-
],
|
|
1660
|
-
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
1661
|
-
}), n.languages.insertBefore("javascript", "string", {
|
|
1662
|
-
hashbang: {
|
|
1663
|
-
pattern: /^#!.*/,
|
|
1664
|
-
greedy: !0,
|
|
1665
|
-
alias: "comment"
|
|
1666
|
-
},
|
|
1667
|
-
"template-string": {
|
|
1668
|
-
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
1669
|
-
greedy: !0,
|
|
1670
|
-
inside: {
|
|
1671
|
-
"template-punctuation": {
|
|
1672
|
-
pattern: /^`|`$/,
|
|
1673
|
-
alias: "string"
|
|
1674
|
-
},
|
|
1675
|
-
interpolation: {
|
|
1676
|
-
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
1677
|
-
lookbehind: !0,
|
|
1678
|
-
inside: {
|
|
1679
|
-
"interpolation-punctuation": {
|
|
1680
|
-
pattern: /^\$\{|\}$/,
|
|
1681
|
-
alias: "punctuation"
|
|
1682
|
-
},
|
|
1683
|
-
rest: n.languages.javascript
|
|
1684
|
-
}
|
|
1685
|
-
},
|
|
1686
|
-
string: /[\s\S]+/
|
|
1687
|
-
}
|
|
1688
|
-
},
|
|
1689
|
-
"string-property": {
|
|
1690
|
-
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
1691
|
-
lookbehind: !0,
|
|
1692
|
-
greedy: !0,
|
|
1693
|
-
alias: "property"
|
|
1694
|
-
}
|
|
1695
|
-
}), n.languages.insertBefore("javascript", "operator", {
|
|
1696
|
-
"literal-property": {
|
|
1697
|
-
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
|
1698
|
-
lookbehind: !0,
|
|
1699
|
-
alias: "property"
|
|
1700
|
-
}
|
|
1701
|
-
}), n.languages.markup && (n.languages.markup.tag.addInlined("script", "javascript"), n.languages.markup.tag.addAttribute(
|
|
1702
|
-
/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
|
|
1703
|
-
"javascript"
|
|
1704
|
-
)), n.languages.js = n.languages.javascript, function() {
|
|
1705
|
-
if (typeof n > "u" || typeof document > "u")
|
|
1706
|
-
return;
|
|
1707
|
-
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
1708
|
-
var u = "Loading…", b = function(_, E) {
|
|
1709
|
-
return "✖ Error " + _ + " while fetching file: " + E;
|
|
1710
|
-
}, A = "✖ Error: File does not exist or is empty", R = {
|
|
1711
|
-
js: "javascript",
|
|
1712
|
-
py: "python",
|
|
1713
|
-
rb: "ruby",
|
|
1714
|
-
ps1: "powershell",
|
|
1715
|
-
psm1: "powershell",
|
|
1716
|
-
sh: "bash",
|
|
1717
|
-
bat: "batch",
|
|
1718
|
-
h: "c",
|
|
1719
|
-
tex: "latex"
|
|
1720
|
-
}, s = "data-src-status", m = "loading", k = "loaded", S = "failed", I = "pre[data-src]:not([" + s + '="' + k + '"]):not([' + s + '="' + m + '"])';
|
|
1721
|
-
function C(_, E, y) {
|
|
1722
|
-
var r = new XMLHttpRequest();
|
|
1723
|
-
r.open("GET", _, !0), r.onreadystatechange = function() {
|
|
1724
|
-
r.readyState == 4 && (r.status < 400 && r.responseText ? E(r.responseText) : r.status >= 400 ? y(b(r.status, r.statusText)) : y(A));
|
|
1725
|
-
}, r.send(null);
|
|
1726
|
-
}
|
|
1727
|
-
function U(_) {
|
|
1728
|
-
var E = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(_ || "");
|
|
1729
|
-
if (E) {
|
|
1730
|
-
var y = Number(E[1]), r = E[2], t = E[3];
|
|
1731
|
-
return r ? t ? [y, Number(t)] : [y, void 0] : [y, y];
|
|
1732
|
-
}
|
|
1733
|
-
}
|
|
1734
|
-
n.hooks.add("before-highlightall", function(_) {
|
|
1735
|
-
_.selector += ", " + I;
|
|
1736
|
-
}), n.hooks.add("before-sanity-check", function(_) {
|
|
1737
|
-
var E = (
|
|
1738
|
-
/** @type {HTMLPreElement} */
|
|
1739
|
-
_.element
|
|
1740
|
-
);
|
|
1741
|
-
if (E.matches(I)) {
|
|
1742
|
-
_.code = "", E.setAttribute(s, m);
|
|
1743
|
-
var y = E.appendChild(document.createElement("CODE"));
|
|
1744
|
-
y.textContent = u;
|
|
1745
|
-
var r = E.getAttribute("data-src"), t = _.language;
|
|
1746
|
-
if (t === "none") {
|
|
1747
|
-
var i = (/\.(\w+)$/.exec(r) || [, "none"])[1];
|
|
1748
|
-
t = R[i] || i;
|
|
1749
|
-
}
|
|
1750
|
-
n.util.setLanguage(y, t), n.util.setLanguage(E, t);
|
|
1751
|
-
var o = n.plugins.autoloader;
|
|
1752
|
-
o && o.loadLanguages(t), C(
|
|
1753
|
-
r,
|
|
1754
|
-
function(l) {
|
|
1755
|
-
E.setAttribute(s, k);
|
|
1756
|
-
var g = U(E.getAttribute("data-range"));
|
|
1757
|
-
if (g) {
|
|
1758
|
-
var x = l.split(/\r\n?|\n/g), f = g[0], N = g[1] == null ? x.length : g[1];
|
|
1759
|
-
f < 0 && (f += x.length), f = Math.max(0, Math.min(f - 1, x.length)), N < 0 && (N += x.length), N = Math.max(0, Math.min(N, x.length)), l = x.slice(f, N).join(`
|
|
1760
|
-
`), E.hasAttribute("data-start") || E.setAttribute("data-start", String(f + 1));
|
|
1761
|
-
}
|
|
1762
|
-
y.textContent = l, n.highlightElement(y);
|
|
1763
|
-
},
|
|
1764
|
-
function(l) {
|
|
1765
|
-
E.setAttribute(s, S), y.textContent = l;
|
|
1766
|
-
}
|
|
1767
|
-
);
|
|
1768
|
-
}
|
|
1769
|
-
}), n.plugins.fileHighlight = {
|
|
1770
|
-
/**
|
|
1771
|
-
* Executes the File Highlight plugin for all matching `pre` elements under the given container.
|
|
1772
|
-
*
|
|
1773
|
-
* Note: Elements which are already loaded or currently loading will not be touched by this method.
|
|
1774
|
-
*
|
|
1775
|
-
* @param {ParentNode} [container=document]
|
|
1776
|
-
*/
|
|
1777
|
-
highlight: function(E) {
|
|
1778
|
-
for (var y = (E || document).querySelectorAll(I), r = 0, t; t = y[r++]; )
|
|
1779
|
-
n.highlightElement(t);
|
|
1780
|
-
}
|
|
1781
|
-
};
|
|
1782
|
-
var Z = !1;
|
|
1783
|
-
n.fileHighlight = function() {
|
|
1784
|
-
Z || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), Z = !0), n.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
1785
|
-
};
|
|
1786
|
-
}();
|
|
1787
|
-
})(nr);
|
|
1788
|
-
var Tr = nr.exports;
|
|
1789
|
-
const ze = /* @__PURE__ */ wr(Tr);
|
|
1
|
+
import { jsxs as i, jsx as e, Fragment as Ne } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as P, useMemo as v, useCallback as k, useEffect as w, useState as p, forwardRef as xe, useImperativeHandle as Ie } from "react";
|
|
3
|
+
import J from "prismjs";
|
|
4
|
+
import { PistonClient as we, getSnippet as Q } from "@hep-code-runner/core";
|
|
1790
5
|
Prism.languages.clike = {
|
|
1791
6
|
comment: [
|
|
1792
7
|
{
|
|
@@ -2044,9 +259,9 @@ Prism.languages.insertBefore("go", "string", {
|
|
|
2044
259
|
}
|
|
2045
260
|
});
|
|
2046
261
|
delete Prism.languages.go["class-name"];
|
|
2047
|
-
(function(
|
|
2048
|
-
var
|
|
2049
|
-
pattern: RegExp(/(^|[^\w.])/.source +
|
|
262
|
+
(function(t) {
|
|
263
|
+
var r = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/, a = /(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source, o = {
|
|
264
|
+
pattern: RegExp(/(^|[^\w.])/.source + a + /[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),
|
|
2050
265
|
lookbehind: !0,
|
|
2051
266
|
inside: {
|
|
2052
267
|
namespace: {
|
|
@@ -2058,32 +273,32 @@ delete Prism.languages.go["class-name"];
|
|
|
2058
273
|
punctuation: /\./
|
|
2059
274
|
}
|
|
2060
275
|
};
|
|
2061
|
-
|
|
276
|
+
t.languages.java = t.languages.extend("clike", {
|
|
2062
277
|
string: {
|
|
2063
278
|
pattern: /(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,
|
|
2064
279
|
lookbehind: !0,
|
|
2065
280
|
greedy: !0
|
|
2066
281
|
},
|
|
2067
282
|
"class-name": [
|
|
2068
|
-
|
|
283
|
+
o,
|
|
2069
284
|
{
|
|
2070
285
|
// variables, parameters, and constructor references
|
|
2071
286
|
// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
|
|
2072
|
-
pattern: RegExp(/(^|[^\w.])/.source +
|
|
287
|
+
pattern: RegExp(/(^|[^\w.])/.source + a + /[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),
|
|
2073
288
|
lookbehind: !0,
|
|
2074
|
-
inside:
|
|
289
|
+
inside: o.inside
|
|
2075
290
|
},
|
|
2076
291
|
{
|
|
2077
292
|
// class names based on keyword
|
|
2078
293
|
// this to support class names (or generic parameters) which do not contain a lower case letter (also works for methods)
|
|
2079
|
-
pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source +
|
|
294
|
+
pattern: RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source + a + /[A-Z]\w*\b/.source),
|
|
2080
295
|
lookbehind: !0,
|
|
2081
|
-
inside:
|
|
296
|
+
inside: o.inside
|
|
2082
297
|
}
|
|
2083
298
|
],
|
|
2084
|
-
keyword:
|
|
299
|
+
keyword: r,
|
|
2085
300
|
function: [
|
|
2086
|
-
|
|
301
|
+
t.languages.clike.function,
|
|
2087
302
|
{
|
|
2088
303
|
pattern: /(::\s*)[a-z_]\w*/,
|
|
2089
304
|
lookbehind: !0
|
|
@@ -2095,7 +310,7 @@ delete Prism.languages.go["class-name"];
|
|
|
2095
310
|
lookbehind: !0
|
|
2096
311
|
},
|
|
2097
312
|
constant: /\b[A-Z][A-Z_\d]+\b/
|
|
2098
|
-
}),
|
|
313
|
+
}), t.languages.insertBefore("java", "string", {
|
|
2099
314
|
"triple-quoted-string": {
|
|
2100
315
|
// http://openjdk.java.net/jeps/355#Description
|
|
2101
316
|
pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,
|
|
@@ -2106,7 +321,7 @@ delete Prism.languages.go["class-name"];
|
|
|
2106
321
|
pattern: /'(?:\\.|[^'\\\r\n]){1,6}'/,
|
|
2107
322
|
greedy: !0
|
|
2108
323
|
}
|
|
2109
|
-
}),
|
|
324
|
+
}), t.languages.insertBefore("java", "class-name", {
|
|
2110
325
|
annotation: {
|
|
2111
326
|
pattern: /(^|[^.])@\w+(?:\s*\.\s*\w+)*/,
|
|
2112
327
|
lookbehind: !0,
|
|
@@ -2115,29 +330,29 @@ delete Prism.languages.go["class-name"];
|
|
|
2115
330
|
generics: {
|
|
2116
331
|
pattern: /<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,
|
|
2117
332
|
inside: {
|
|
2118
|
-
"class-name":
|
|
2119
|
-
keyword:
|
|
333
|
+
"class-name": o,
|
|
334
|
+
keyword: r,
|
|
2120
335
|
punctuation: /[<>(),.:]/,
|
|
2121
336
|
operator: /[?&|]/
|
|
2122
337
|
}
|
|
2123
338
|
},
|
|
2124
339
|
import: [
|
|
2125
340
|
{
|
|
2126
|
-
pattern: RegExp(/(\bimport\s+)/.source +
|
|
341
|
+
pattern: RegExp(/(\bimport\s+)/.source + a + /(?:[A-Z]\w*|\*)(?=\s*;)/.source),
|
|
2127
342
|
lookbehind: !0,
|
|
2128
343
|
inside: {
|
|
2129
|
-
namespace:
|
|
344
|
+
namespace: o.inside.namespace,
|
|
2130
345
|
punctuation: /\./,
|
|
2131
346
|
operator: /\*/,
|
|
2132
347
|
"class-name": /\w+/
|
|
2133
348
|
}
|
|
2134
349
|
},
|
|
2135
350
|
{
|
|
2136
|
-
pattern: RegExp(/(\bimport\s+static\s+)/.source +
|
|
351
|
+
pattern: RegExp(/(\bimport\s+static\s+)/.source + a + /(?:\w+|\*)(?=\s*;)/.source),
|
|
2137
352
|
lookbehind: !0,
|
|
2138
353
|
alias: "static",
|
|
2139
354
|
inside: {
|
|
2140
|
-
namespace:
|
|
355
|
+
namespace: o.inside.namespace,
|
|
2141
356
|
static: /\b\w+$/,
|
|
2142
357
|
punctuation: /\./,
|
|
2143
358
|
operator: /\*/,
|
|
@@ -2148,7 +363,7 @@ delete Prism.languages.go["class-name"];
|
|
|
2148
363
|
namespace: {
|
|
2149
364
|
pattern: RegExp(
|
|
2150
365
|
/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g, function() {
|
|
2151
|
-
return
|
|
366
|
+
return r.source;
|
|
2152
367
|
})
|
|
2153
368
|
),
|
|
2154
369
|
lookbehind: !0,
|
|
@@ -2234,17 +449,17 @@ Prism.languages.insertBefore("c", "function", {
|
|
|
2234
449
|
constant: /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/
|
|
2235
450
|
});
|
|
2236
451
|
delete Prism.languages.c.boolean;
|
|
2237
|
-
(function(
|
|
2238
|
-
for (var
|
|
2239
|
-
|
|
2240
|
-
return
|
|
452
|
+
(function(t) {
|
|
453
|
+
for (var r = /\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source, a = 0; a < 2; a++)
|
|
454
|
+
r = r.replace(/<self>/g, function() {
|
|
455
|
+
return r;
|
|
2241
456
|
});
|
|
2242
|
-
|
|
457
|
+
r = r.replace(/<self>/g, function() {
|
|
2243
458
|
return /[^\s\S]/.source;
|
|
2244
|
-
}),
|
|
459
|
+
}), t.languages.rust = {
|
|
2245
460
|
comment: [
|
|
2246
461
|
{
|
|
2247
|
-
pattern: RegExp(/(^|[^\\])/.source +
|
|
462
|
+
pattern: RegExp(/(^|[^\\])/.source + r),
|
|
2248
463
|
lookbehind: !0,
|
|
2249
464
|
greedy: !0
|
|
2250
465
|
},
|
|
@@ -2348,7 +563,7 @@ delete Prism.languages.c.boolean;
|
|
|
2348
563
|
boolean: /\b(?:false|true)\b/,
|
|
2349
564
|
punctuation: /->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,
|
|
2350
565
|
operator: /[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/
|
|
2351
|
-
},
|
|
566
|
+
}, t.languages.rust["closure-params"].inside.rest = t.languages.rust, t.languages.rust.attribute.inside.string = t.languages.rust.string;
|
|
2352
567
|
})(Prism);
|
|
2353
568
|
Prism.languages.sql = {
|
|
2354
569
|
comment: {
|
|
@@ -2383,18 +598,18 @@ Prism.languages.sql = {
|
|
|
2383
598
|
operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,
|
|
2384
599
|
punctuation: /[;[\]()`,.]/
|
|
2385
600
|
};
|
|
2386
|
-
(function(
|
|
2387
|
-
var
|
|
601
|
+
(function(t) {
|
|
602
|
+
var r = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", a = {
|
|
2388
603
|
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
2389
604
|
lookbehind: !0,
|
|
2390
605
|
alias: "punctuation",
|
|
2391
606
|
// this looks reasonably well in all themes
|
|
2392
607
|
inside: null
|
|
2393
608
|
// see below
|
|
2394
|
-
},
|
|
2395
|
-
bash:
|
|
609
|
+
}, o = {
|
|
610
|
+
bash: a,
|
|
2396
611
|
environment: {
|
|
2397
|
-
pattern: RegExp("\\$" +
|
|
612
|
+
pattern: RegExp("\\$" + r),
|
|
2398
613
|
alias: "constant"
|
|
2399
614
|
},
|
|
2400
615
|
variable: [
|
|
@@ -2434,7 +649,7 @@ Prism.languages.sql = {
|
|
|
2434
649
|
operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
|
|
2435
650
|
punctuation: /[\[\]]/,
|
|
2436
651
|
environment: {
|
|
2437
|
-
pattern: RegExp("(\\{)" +
|
|
652
|
+
pattern: RegExp("(\\{)" + r),
|
|
2438
653
|
lookbehind: !0,
|
|
2439
654
|
alias: "constant"
|
|
2440
655
|
}
|
|
@@ -2445,7 +660,7 @@ Prism.languages.sql = {
|
|
|
2445
660
|
// Escape sequences from echo and printf's manuals, and escaped quotes.
|
|
2446
661
|
entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
|
|
2447
662
|
};
|
|
2448
|
-
|
|
663
|
+
t.languages.bash = {
|
|
2449
664
|
shebang: {
|
|
2450
665
|
pattern: /^#!\s*\/.*/,
|
|
2451
666
|
alias: "important"
|
|
@@ -2483,7 +698,7 @@ Prism.languages.sql = {
|
|
|
2483
698
|
pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
|
|
2484
699
|
inside: {
|
|
2485
700
|
environment: {
|
|
2486
|
-
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" +
|
|
701
|
+
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + r),
|
|
2487
702
|
lookbehind: !0,
|
|
2488
703
|
alias: "constant"
|
|
2489
704
|
}
|
|
@@ -2503,7 +718,7 @@ Prism.languages.sql = {
|
|
|
2503
718
|
pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
|
|
2504
719
|
lookbehind: !0,
|
|
2505
720
|
greedy: !0,
|
|
2506
|
-
inside:
|
|
721
|
+
inside: o
|
|
2507
722
|
},
|
|
2508
723
|
// Here-document with quotes around the tag
|
|
2509
724
|
// → No expansion (so no “inside”).
|
|
@@ -2512,7 +727,7 @@ Prism.languages.sql = {
|
|
|
2512
727
|
lookbehind: !0,
|
|
2513
728
|
greedy: !0,
|
|
2514
729
|
inside: {
|
|
2515
|
-
bash:
|
|
730
|
+
bash: a
|
|
2516
731
|
}
|
|
2517
732
|
},
|
|
2518
733
|
// “Normal” string
|
|
@@ -2521,7 +736,7 @@ Prism.languages.sql = {
|
|
|
2521
736
|
pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
|
|
2522
737
|
lookbehind: !0,
|
|
2523
738
|
greedy: !0,
|
|
2524
|
-
inside:
|
|
739
|
+
inside: o
|
|
2525
740
|
},
|
|
2526
741
|
{
|
|
2527
742
|
// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
|
|
@@ -2534,15 +749,15 @@ Prism.languages.sql = {
|
|
|
2534
749
|
pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
|
|
2535
750
|
greedy: !0,
|
|
2536
751
|
inside: {
|
|
2537
|
-
entity:
|
|
752
|
+
entity: o.entity
|
|
2538
753
|
}
|
|
2539
754
|
}
|
|
2540
755
|
],
|
|
2541
756
|
environment: {
|
|
2542
|
-
pattern: RegExp("\\$?" +
|
|
757
|
+
pattern: RegExp("\\$?" + r),
|
|
2543
758
|
alias: "constant"
|
|
2544
759
|
},
|
|
2545
|
-
variable:
|
|
760
|
+
variable: o.variable,
|
|
2546
761
|
function: {
|
|
2547
762
|
pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
|
|
2548
763
|
lookbehind: !0
|
|
@@ -2581,8 +796,8 @@ Prism.languages.sql = {
|
|
|
2581
796
|
pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
|
|
2582
797
|
lookbehind: !0
|
|
2583
798
|
}
|
|
2584
|
-
},
|
|
2585
|
-
for (var
|
|
799
|
+
}, a.inside = t.languages.bash;
|
|
800
|
+
for (var s = [
|
|
2586
801
|
"comment",
|
|
2587
802
|
"function-name",
|
|
2588
803
|
"for-or-select",
|
|
@@ -2598,9 +813,9 @@ Prism.languages.sql = {
|
|
|
2598
813
|
"operator",
|
|
2599
814
|
"punctuation",
|
|
2600
815
|
"number"
|
|
2601
|
-
],
|
|
2602
|
-
|
|
2603
|
-
|
|
816
|
+
], u = o.variable[1].inside, h = 0; h < s.length; h++)
|
|
817
|
+
u[s[h]] = t.languages.bash[s[h]];
|
|
818
|
+
t.languages.sh = t.languages.bash, t.languages.shell = t.languages.bash;
|
|
2604
819
|
})(Prism);
|
|
2605
820
|
Prism.languages.json = {
|
|
2606
821
|
property: {
|
|
@@ -2627,7 +842,7 @@ Prism.languages.json = {
|
|
|
2627
842
|
}
|
|
2628
843
|
};
|
|
2629
844
|
Prism.languages.webmanifest = Prism.languages.json;
|
|
2630
|
-
const
|
|
845
|
+
const Re = `
|
|
2631
846
|
/* 默认代码颜色 */
|
|
2632
847
|
.hep-cr-editor .hep-cr-highlight code,
|
|
2633
848
|
.hep-cr-editor .hep-cr-highlight pre {
|
|
@@ -2711,7 +926,7 @@ const Rr = `
|
|
|
2711
926
|
.hep-cr-editor .token.console {
|
|
2712
927
|
color: #f8f8f2 !important;
|
|
2713
928
|
}
|
|
2714
|
-
`,
|
|
929
|
+
`, ve = `
|
|
2715
930
|
/* 默认代码颜色 */
|
|
2716
931
|
.hep-cr-editor .hep-cr-highlight code,
|
|
2717
932
|
.hep-cr-editor .hep-cr-highlight pre {
|
|
@@ -2789,15 +1004,15 @@ const Rr = `
|
|
|
2789
1004
|
color: #333 !important;
|
|
2790
1005
|
}
|
|
2791
1006
|
`;
|
|
2792
|
-
window.Prism =
|
|
2793
|
-
function
|
|
1007
|
+
window.Prism = J;
|
|
1008
|
+
function Oe(t) {
|
|
2794
1009
|
if (typeof document > "u") return;
|
|
2795
|
-
const
|
|
2796
|
-
|
|
2797
|
-
const
|
|
2798
|
-
|
|
1010
|
+
const r = "hep-cr-prism-styles", a = document.getElementById(r), o = t === "dark" ? Re : ve;
|
|
1011
|
+
a && a.remove();
|
|
1012
|
+
const s = document.createElement("style");
|
|
1013
|
+
s.id = r, s.textContent = o, document.head.appendChild(s);
|
|
2799
1014
|
}
|
|
2800
|
-
const
|
|
1015
|
+
const Le = {
|
|
2801
1016
|
javascript: "javascript",
|
|
2802
1017
|
js: "javascript",
|
|
2803
1018
|
typescript: "typescript",
|
|
@@ -2829,74 +1044,74 @@ const Ir = {
|
|
|
2829
1044
|
markdown: "markdown",
|
|
2830
1045
|
md: "markdown"
|
|
2831
1046
|
};
|
|
2832
|
-
function
|
|
2833
|
-
const
|
|
2834
|
-
return
|
|
1047
|
+
function _e(t) {
|
|
1048
|
+
const r = document.createElement("div");
|
|
1049
|
+
return r.textContent = t, r.innerHTML;
|
|
2835
1050
|
}
|
|
2836
|
-
const
|
|
2837
|
-
value:
|
|
2838
|
-
language:
|
|
2839
|
-
theme:
|
|
2840
|
-
disabled:
|
|
2841
|
-
onChange:
|
|
2842
|
-
onCodeChange:
|
|
1051
|
+
const Fe = ({
|
|
1052
|
+
value: t,
|
|
1053
|
+
language: r,
|
|
1054
|
+
theme: a = "dark",
|
|
1055
|
+
disabled: o = !1,
|
|
1056
|
+
onChange: s,
|
|
1057
|
+
onCodeChange: u
|
|
2843
1058
|
}) => {
|
|
2844
|
-
const
|
|
1059
|
+
const h = P(null), f = P(null), y = P(null), m = v(() => Le[r.toLowerCase()] || "javascript", [r]), b = a === "dark" ? "#1e1e1e" : "#fafafa", g = v(() => {
|
|
2845
1060
|
try {
|
|
2846
|
-
const
|
|
2847
|
-
if (
|
|
2848
|
-
return
|
|
1061
|
+
const l = J.languages[m];
|
|
1062
|
+
if (l)
|
|
1063
|
+
return J.highlight(t || "", l, m);
|
|
2849
1064
|
} catch {
|
|
2850
1065
|
}
|
|
2851
|
-
return
|
|
2852
|
-
}, [
|
|
2853
|
-
|
|
2854
|
-
|
|
1066
|
+
return _e(t || "");
|
|
1067
|
+
}, [t, m]), S = k((l) => {
|
|
1068
|
+
y.current && clearTimeout(y.current), y.current = setTimeout(() => {
|
|
1069
|
+
u == null || u(l);
|
|
2855
1070
|
}, 500);
|
|
2856
|
-
}, [
|
|
2857
|
-
const
|
|
2858
|
-
|
|
2859
|
-
},
|
|
2860
|
-
|
|
2861
|
-
},
|
|
2862
|
-
if (
|
|
2863
|
-
|
|
2864
|
-
const
|
|
2865
|
-
|
|
2866
|
-
|
|
1071
|
+
}, [u]), A = (l) => {
|
|
1072
|
+
const d = l.target.value;
|
|
1073
|
+
s == null || s(d), S(d);
|
|
1074
|
+
}, O = () => {
|
|
1075
|
+
h.current && f.current && (f.current.scrollTop = h.current.scrollTop, f.current.scrollLeft = h.current.scrollLeft);
|
|
1076
|
+
}, E = (l) => {
|
|
1077
|
+
if (l.key === "Tab") {
|
|
1078
|
+
l.preventDefault();
|
|
1079
|
+
const d = l.target, M = d.selectionStart, x = d.selectionEnd, U = t.substring(0, M) + " " + t.substring(x);
|
|
1080
|
+
s == null || s(U), S(U), requestAnimationFrame(() => {
|
|
1081
|
+
d.selectionStart = d.selectionEnd = M + 2;
|
|
2867
1082
|
});
|
|
2868
1083
|
}
|
|
2869
1084
|
};
|
|
2870
|
-
return
|
|
2871
|
-
|
|
2872
|
-
}, []),
|
|
2873
|
-
|
|
2874
|
-
}, [
|
|
2875
|
-
/* @__PURE__ */
|
|
1085
|
+
return w(() => () => {
|
|
1086
|
+
y.current && clearTimeout(y.current);
|
|
1087
|
+
}, []), w(() => {
|
|
1088
|
+
Oe(a);
|
|
1089
|
+
}, [a]), /* @__PURE__ */ i("div", { className: `hep-cr-editor theme-${a}`, style: { background: b }, children: [
|
|
1090
|
+
/* @__PURE__ */ e(
|
|
2876
1091
|
"pre",
|
|
2877
1092
|
{
|
|
2878
|
-
ref:
|
|
2879
|
-
className: `hep-cr-highlight language-${
|
|
1093
|
+
ref: f,
|
|
1094
|
+
className: `hep-cr-highlight language-${m}`,
|
|
2880
1095
|
"aria-hidden": "true",
|
|
2881
|
-
children: /* @__PURE__ */
|
|
1096
|
+
children: /* @__PURE__ */ e("code", { dangerouslySetInnerHTML: { __html: g } })
|
|
2882
1097
|
}
|
|
2883
1098
|
),
|
|
2884
|
-
/* @__PURE__ */
|
|
1099
|
+
/* @__PURE__ */ e(
|
|
2885
1100
|
"textarea",
|
|
2886
1101
|
{
|
|
2887
|
-
ref:
|
|
1102
|
+
ref: h,
|
|
2888
1103
|
className: "hep-cr-input",
|
|
2889
|
-
value:
|
|
2890
|
-
disabled:
|
|
2891
|
-
onChange:
|
|
2892
|
-
onScroll:
|
|
2893
|
-
onKeyDown:
|
|
1104
|
+
value: t,
|
|
1105
|
+
disabled: o,
|
|
1106
|
+
onChange: A,
|
|
1107
|
+
onScroll: O,
|
|
1108
|
+
onKeyDown: E,
|
|
2894
1109
|
spellCheck: !1,
|
|
2895
1110
|
placeholder: "Write your code here..."
|
|
2896
1111
|
}
|
|
2897
1112
|
)
|
|
2898
1113
|
] });
|
|
2899
|
-
},
|
|
1114
|
+
}, De = `
|
|
2900
1115
|
.hep-cr-editor {
|
|
2901
1116
|
position: relative;
|
|
2902
1117
|
flex: 1;
|
|
@@ -2955,393 +1170,178 @@ const Nr = ({
|
|
|
2955
1170
|
}
|
|
2956
1171
|
`;
|
|
2957
1172
|
if (typeof document < "u") {
|
|
2958
|
-
const
|
|
2959
|
-
if (!document.getElementById(
|
|
2960
|
-
const
|
|
2961
|
-
|
|
1173
|
+
const t = "hep-cr-editor-styles";
|
|
1174
|
+
if (!document.getElementById(t)) {
|
|
1175
|
+
const r = document.createElement("style");
|
|
1176
|
+
r.id = t, r.textContent = De, document.head.appendChild(r);
|
|
2962
1177
|
}
|
|
2963
1178
|
}
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
}
|
|
2979
|
-
});
|
|
2980
|
-
if (!n.ok)
|
|
2981
|
-
throw new Error(`Failed to fetch runtimes: ${n.statusText}`);
|
|
2982
|
-
const u = await n.json();
|
|
2983
|
-
return Ue = u, u;
|
|
2984
|
-
} catch (n) {
|
|
2985
|
-
throw console.error("Failed to fetch runtimes:", n), n;
|
|
2986
|
-
}
|
|
2987
|
-
}
|
|
2988
|
-
async execute(h, n, u = {}) {
|
|
2989
|
-
const b = (await this.getRuntimes()).find(
|
|
2990
|
-
(m) => {
|
|
2991
|
-
var k;
|
|
2992
|
-
return m.language.toLowerCase() === h.toLowerCase() || ((k = m.aliases) == null ? void 0 : k.some((S) => S.toLowerCase() === h.toLowerCase()));
|
|
2993
|
-
}
|
|
2994
|
-
);
|
|
2995
|
-
if (!b)
|
|
2996
|
-
throw new Error(`Language '${h}' is not supported`);
|
|
2997
|
-
const A = this.getFileName(h), R = {
|
|
2998
|
-
language: b.language,
|
|
2999
|
-
version: u.version || b.version,
|
|
3000
|
-
files: [
|
|
3001
|
-
{
|
|
3002
|
-
name: A,
|
|
3003
|
-
content: n
|
|
3004
|
-
}
|
|
3005
|
-
],
|
|
3006
|
-
stdin: u.stdin || "",
|
|
3007
|
-
args: u.args || [],
|
|
3008
|
-
run_timeout: u.runTimeout || this.timeout,
|
|
3009
|
-
compile_timeout: this.timeout
|
|
3010
|
-
}, s = Date.now();
|
|
3011
|
-
try {
|
|
3012
|
-
const m = await fetch(`${this.baseUrl}/execute`, {
|
|
3013
|
-
method: "POST",
|
|
3014
|
-
headers: {
|
|
3015
|
-
"Content-Type": "application/json"
|
|
3016
|
-
},
|
|
3017
|
-
body: JSON.stringify(R)
|
|
3018
|
-
});
|
|
3019
|
-
if (!m.ok)
|
|
3020
|
-
throw new Error(`Execute failed: ${m.statusText}`);
|
|
3021
|
-
const k = await m.json(), S = Date.now() - s, I = k.run.stdout || "", C = k.run.stderr || "";
|
|
3022
|
-
return {
|
|
3023
|
-
success: k.run.code === 0,
|
|
3024
|
-
output: I,
|
|
3025
|
-
stderr: C,
|
|
3026
|
-
code: k.run.code,
|
|
3027
|
-
executionTime: S,
|
|
3028
|
-
compile: k.compile ? {
|
|
3029
|
-
stdout: k.compile.stdout || "",
|
|
3030
|
-
stderr: k.compile.stderr || "",
|
|
3031
|
-
code: k.compile.code
|
|
3032
|
-
} : void 0
|
|
3033
|
-
};
|
|
3034
|
-
} catch (m) {
|
|
3035
|
-
return {
|
|
3036
|
-
success: !1,
|
|
3037
|
-
output: "",
|
|
3038
|
-
stderr: m instanceof Error ? m.message : "Unknown error",
|
|
3039
|
-
code: -1,
|
|
3040
|
-
executionTime: Date.now() - s
|
|
3041
|
-
};
|
|
3042
|
-
}
|
|
3043
|
-
}
|
|
3044
|
-
getFileName(h) {
|
|
3045
|
-
return {
|
|
3046
|
-
javascript: "main.js",
|
|
3047
|
-
typescript: "main.ts",
|
|
3048
|
-
python: "main.py",
|
|
3049
|
-
python3: "main.py",
|
|
3050
|
-
go: "main.go",
|
|
3051
|
-
rust: "main.rs",
|
|
3052
|
-
java: "Main.java",
|
|
3053
|
-
c: "main.c",
|
|
3054
|
-
cpp: "main.cpp",
|
|
3055
|
-
csharp: "Main.cs",
|
|
3056
|
-
ruby: "main.rb",
|
|
3057
|
-
php: "main.php",
|
|
3058
|
-
bash: "main.sh",
|
|
3059
|
-
shell: "main.sh",
|
|
3060
|
-
perl: "main.pl",
|
|
3061
|
-
lua: "main.lua",
|
|
3062
|
-
swift: "main.swift",
|
|
3063
|
-
kotlin: "Main.kt",
|
|
3064
|
-
scala: "Main.scala",
|
|
3065
|
-
haskell: "main.hs",
|
|
3066
|
-
dart: "main.dart",
|
|
3067
|
-
html: "index.html",
|
|
3068
|
-
css: "style.css",
|
|
3069
|
-
sql: "query.sql",
|
|
3070
|
-
markdown: "readme.md"
|
|
3071
|
-
}[h.toLowerCase()] || `main.${h}`;
|
|
3072
|
-
}
|
|
3073
|
-
}
|
|
3074
|
-
const jr = {
|
|
3075
|
-
javascript: 'console.log("Hello, World!");',
|
|
3076
|
-
typescript: 'console.log("Hello, World!");',
|
|
3077
|
-
python: 'print("Hello, World!")',
|
|
3078
|
-
python3: 'print("Hello, World!")',
|
|
3079
|
-
go: `package main
|
|
3080
|
-
|
|
3081
|
-
import "fmt"
|
|
3082
|
-
|
|
3083
|
-
func main() {
|
|
3084
|
-
fmt.Println("Hello, World!")
|
|
3085
|
-
}`,
|
|
3086
|
-
rust: `fn main() {
|
|
3087
|
-
println!("Hello, World!");
|
|
3088
|
-
}`,
|
|
3089
|
-
java: `public class Main {
|
|
3090
|
-
public static void main(String[] args) {
|
|
3091
|
-
System.out.println("Hello, World!");
|
|
3092
|
-
}
|
|
3093
|
-
}`,
|
|
3094
|
-
c: `#include <stdio.h>
|
|
3095
|
-
|
|
3096
|
-
int main() {
|
|
3097
|
-
printf("Hello, World!\\n");
|
|
3098
|
-
return 0;
|
|
3099
|
-
}`,
|
|
3100
|
-
cpp: `#include <iostream>
|
|
3101
|
-
|
|
3102
|
-
int main() {
|
|
3103
|
-
std::cout << "Hello, World!" << std::endl;
|
|
3104
|
-
return 0;
|
|
3105
|
-
}`,
|
|
3106
|
-
csharp: `using System;
|
|
3107
|
-
|
|
3108
|
-
class Main {
|
|
3109
|
-
static void Main() {
|
|
3110
|
-
Console.WriteLine("Hello, World!");
|
|
3111
|
-
}
|
|
3112
|
-
}`,
|
|
3113
|
-
ruby: 'puts "Hello, World!"',
|
|
3114
|
-
php: `<?php
|
|
3115
|
-
echo "Hello, World!";
|
|
3116
|
-
?>`,
|
|
3117
|
-
bash: 'echo "Hello, World!"',
|
|
3118
|
-
shell: 'echo "Hello, World!"',
|
|
3119
|
-
perl: 'print "Hello, World!\\n";',
|
|
3120
|
-
lua: 'print("Hello, World!")',
|
|
3121
|
-
r: 'print("Hello, World!")',
|
|
3122
|
-
swift: 'print("Hello, World!")',
|
|
3123
|
-
kotlin: `fun main() {
|
|
3124
|
-
println("Hello, World!")
|
|
3125
|
-
}`,
|
|
3126
|
-
scala: `object Main extends App {
|
|
3127
|
-
println("Hello, World!")
|
|
3128
|
-
}`,
|
|
3129
|
-
haskell: 'main = putStrLn "Hello, World!"',
|
|
3130
|
-
elixir: 'IO.puts "Hello, World!"',
|
|
3131
|
-
erlang: 'main() -> io:fwrite("Hello, World!~n").',
|
|
3132
|
-
clojure: '(println "Hello, World!")',
|
|
3133
|
-
fsharp: 'printfn "Hello, World!"',
|
|
3134
|
-
dart: `void main() {
|
|
3135
|
-
print("Hello, World!");
|
|
3136
|
-
}`,
|
|
3137
|
-
assembly: `section .data
|
|
3138
|
-
msg db 'Hello, World!', 0
|
|
3139
|
-
section .text
|
|
3140
|
-
global _start
|
|
3141
|
-
_start:
|
|
3142
|
-
mov rax, 1
|
|
3143
|
-
mov rdi, 1
|
|
3144
|
-
mov rsi, msg
|
|
3145
|
-
mov rdx, 13
|
|
3146
|
-
syscall
|
|
3147
|
-
mov rax, 60
|
|
3148
|
-
xor rdi, rdi
|
|
3149
|
-
syscall`,
|
|
3150
|
-
html: `<!DOCTYPE html>
|
|
3151
|
-
<html>
|
|
3152
|
-
<head>
|
|
3153
|
-
<title>Hello</title>
|
|
3154
|
-
</head>
|
|
3155
|
-
<body>
|
|
3156
|
-
<h1>Hello, World!</h1>
|
|
3157
|
-
</body>
|
|
3158
|
-
</html>`,
|
|
3159
|
-
css: `body {
|
|
3160
|
-
background-color: #f0f0f0;
|
|
3161
|
-
font-family: Arial, sans-serif;
|
|
3162
|
-
}
|
|
3163
|
-
|
|
3164
|
-
h1 {
|
|
3165
|
-
color: #333;
|
|
3166
|
-
}`,
|
|
3167
|
-
sql: "SELECT 'Hello, World!' AS message;",
|
|
3168
|
-
markdown: `# Hello, World!
|
|
3169
|
-
|
|
3170
|
-
This is a sample markdown document.`
|
|
3171
|
-
};
|
|
3172
|
-
function He(p) {
|
|
3173
|
-
const h = p.toLowerCase();
|
|
3174
|
-
return jr[h] || `// ${p}
|
|
3175
|
-
// Write your code here`;
|
|
3176
|
-
}
|
|
3177
|
-
const $r = ({
|
|
3178
|
-
pistonUrl: p = "/api/piston",
|
|
3179
|
-
language: h = "javascript",
|
|
3180
|
-
theme: n = "light",
|
|
3181
|
-
themeColor: u = "",
|
|
3182
|
-
showLanguageSelector: b = !0,
|
|
3183
|
-
showEditor: A = !0,
|
|
3184
|
-
editable: R = !0,
|
|
3185
|
-
defaultCode: s = "",
|
|
3186
|
-
executorLabel: m = "运行",
|
|
3187
|
-
onExecuteStart: k,
|
|
3188
|
-
onExecuteEnd: S,
|
|
3189
|
-
onLanguageChange: I,
|
|
3190
|
-
onChange: C
|
|
1179
|
+
const Ce = ({
|
|
1180
|
+
pistonUrl: t = "/api/piston",
|
|
1181
|
+
language: r = "javascript",
|
|
1182
|
+
theme: a = "light",
|
|
1183
|
+
themeColor: o = "",
|
|
1184
|
+
showLanguageSelector: s = !0,
|
|
1185
|
+
showEditor: u = !0,
|
|
1186
|
+
editable: h = !0,
|
|
1187
|
+
defaultCode: f = "",
|
|
1188
|
+
executorLabel: y = "运行",
|
|
1189
|
+
onExecuteStart: m,
|
|
1190
|
+
onExecuteEnd: b,
|
|
1191
|
+
onLanguageChange: g,
|
|
1192
|
+
onChange: S
|
|
3191
1193
|
}) => {
|
|
3192
|
-
const [
|
|
3193
|
-
value: `${
|
|
3194
|
-
label: `${
|
|
3195
|
-
})), [
|
|
3196
|
-
if (!
|
|
3197
|
-
const
|
|
3198
|
-
const
|
|
3199
|
-
return "#" + (16777216 +
|
|
3200
|
-
},
|
|
3201
|
-
const
|
|
3202
|
-
return (0.299 *
|
|
3203
|
-
})(
|
|
1194
|
+
const A = "hep-cr-default-language", O = () => typeof window > "u" ? r : localStorage.getItem(A) || r, [E, l] = p([]), [d, M] = p(O()), [x, U] = p(a), [T, B] = p(f), [K, ee] = p(""), [$, te] = p(""), [N, re] = p(!1), [ne, oe] = p(null), [L, z] = p("stdout"), [ae, G] = p(null), [H, ie] = p(!0), [se, he] = p(60), [j, ce] = p(!1), [Y, le] = p(!1), de = P(!1), X = v(() => new we({ pistonUrl: t }), [t]), ge = v(() => E.map((n) => ({
|
|
1195
|
+
value: `${n.language}:${n.version}`,
|
|
1196
|
+
label: `${n.language.charAt(0).toUpperCase() + n.language.slice(1)} ${n.version}`
|
|
1197
|
+
})), [E]), me = v(() => {
|
|
1198
|
+
if (!o) return {};
|
|
1199
|
+
const n = a === "dark", c = (Z, F) => {
|
|
1200
|
+
const D = parseInt(Z.replace("#", ""), 16), C = Math.round(2.55 * F), q = Math.min(255, Math.max(0, (D >> 16) + C)), ue = Math.min(255, Math.max(0, (D >> 8 & 255) + C)), Ae = Math.min(255, Math.max(0, (D & 255) + C));
|
|
1201
|
+
return "#" + (16777216 + q * 65536 + ue * 256 + Ae).toString(16).slice(1);
|
|
1202
|
+
}, Te = ((Z) => {
|
|
1203
|
+
const F = parseInt(Z.replace("#", ""), 16), D = F >> 16 & 255, C = F >> 8 & 255, q = F & 255;
|
|
1204
|
+
return (0.299 * D + 0.587 * C + 0.114 * q) / 255 > 0.5;
|
|
1205
|
+
})(o) ? "#000" : "#fff";
|
|
3204
1206
|
return {
|
|
3205
|
-
"--hep-cr-theme-color":
|
|
3206
|
-
"--hep-cr-theme-color-hover":
|
|
3207
|
-
"--hep-cr-tab-active-color":
|
|
1207
|
+
"--hep-cr-theme-color": o,
|
|
1208
|
+
"--hep-cr-theme-color-hover": n ? c(o, 20) : c(o, -20),
|
|
1209
|
+
"--hep-cr-tab-active-color": Te
|
|
3208
1210
|
};
|
|
3209
|
-
}, [
|
|
3210
|
-
|
|
3211
|
-
async function
|
|
3212
|
-
|
|
1211
|
+
}, [o, a]), I = v(() => d.includes(":") ? d.split(":")[0] : d, [d]);
|
|
1212
|
+
w(() => {
|
|
1213
|
+
async function n() {
|
|
1214
|
+
ie(!0), G(null);
|
|
3213
1215
|
try {
|
|
3214
|
-
const
|
|
3215
|
-
|
|
3216
|
-
} catch (
|
|
3217
|
-
|
|
1216
|
+
const c = await X.getRuntimes();
|
|
1217
|
+
l(c);
|
|
1218
|
+
} catch (c) {
|
|
1219
|
+
G(c instanceof Error ? c.message : "Failed to load runtimes");
|
|
3218
1220
|
} finally {
|
|
3219
|
-
|
|
1221
|
+
ie(!1);
|
|
3220
1222
|
}
|
|
3221
1223
|
}
|
|
3222
|
-
|
|
3223
|
-
}, [
|
|
3224
|
-
!
|
|
3225
|
-
}, [
|
|
3226
|
-
|
|
3227
|
-
}, [])
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
const
|
|
3233
|
-
|
|
1224
|
+
n();
|
|
1225
|
+
}, [X]), w(() => {
|
|
1226
|
+
!T && E.length > 0 && B(f || Q(I));
|
|
1227
|
+
}, [E, T, f, I]), w(() => {
|
|
1228
|
+
S == null || S(T);
|
|
1229
|
+
}, []), w(() => {
|
|
1230
|
+
!H && E.length > 0 && g && !de.current && (de.current = !0, g(I, T));
|
|
1231
|
+
}, [H, E.length]);
|
|
1232
|
+
const be = k(
|
|
1233
|
+
(n) => {
|
|
1234
|
+
const c = n.target.value, R = c.includes(":") ? c.split(":")[0] : c;
|
|
1235
|
+
M(c);
|
|
1236
|
+
const _ = Q(R);
|
|
1237
|
+
B(_), g == null || g(R, _), typeof window < "u" && localStorage.setItem(A, c);
|
|
3234
1238
|
},
|
|
3235
|
-
[
|
|
3236
|
-
),
|
|
3237
|
-
if (!
|
|
3238
|
-
|
|
1239
|
+
[g]
|
|
1240
|
+
), fe = k(async () => {
|
|
1241
|
+
if (!N) {
|
|
1242
|
+
re(!0), ee(""), te(""), oe(null), G(null), z("stdout"), m == null || m();
|
|
3239
1243
|
try {
|
|
3240
|
-
const
|
|
3241
|
-
|
|
3242
|
-
} catch (
|
|
3243
|
-
const
|
|
3244
|
-
|
|
1244
|
+
const n = await X.execute(I, T);
|
|
1245
|
+
ee(n.output), te(n.stderr), oe(n.executionTime || null), z(n.stderr ? "stderr" : "stdout"), b == null || b(n);
|
|
1246
|
+
} catch (n) {
|
|
1247
|
+
const c = n instanceof Error ? n.message : "Execution failed";
|
|
1248
|
+
G(c), b == null || b({
|
|
3245
1249
|
success: !1,
|
|
3246
1250
|
output: "",
|
|
3247
|
-
stderr:
|
|
1251
|
+
stderr: c,
|
|
3248
1252
|
code: -1
|
|
3249
1253
|
});
|
|
3250
1254
|
} finally {
|
|
3251
|
-
|
|
1255
|
+
re(!1);
|
|
3252
1256
|
}
|
|
3253
1257
|
}
|
|
3254
|
-
}, [
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
}, []);
|
|
3258
|
-
const pe = te(async () => {
|
|
3259
|
-
await navigator.clipboard.writeText(t), B(!0), setTimeout(() => {
|
|
3260
|
-
B(!1);
|
|
1258
|
+
}, [N, d, T, X, m, b]), Ee = k(async () => {
|
|
1259
|
+
await navigator.clipboard.writeText(T), ce(!0), setTimeout(() => {
|
|
1260
|
+
ce(!1);
|
|
3261
1261
|
}, 2e3);
|
|
3262
|
-
}, [
|
|
3263
|
-
const
|
|
3264
|
-
await navigator.clipboard.writeText(
|
|
3265
|
-
|
|
1262
|
+
}, [T]), ke = k(async () => {
|
|
1263
|
+
const n = L === "stdout" ? K : $;
|
|
1264
|
+
await navigator.clipboard.writeText(n), le(!0), setTimeout(() => {
|
|
1265
|
+
le(!1);
|
|
3266
1266
|
}, 2e3);
|
|
3267
|
-
}, [
|
|
3268
|
-
|
|
3269
|
-
}, [
|
|
3270
|
-
|
|
3271
|
-
}, []),
|
|
3272
|
-
if (!
|
|
3273
|
-
const
|
|
3274
|
-
if (!
|
|
3275
|
-
const
|
|
3276
|
-
|
|
3277
|
-
}, []),
|
|
3278
|
-
|
|
3279
|
-
}, [
|
|
3280
|
-
return /* @__PURE__ */
|
|
3281
|
-
/* @__PURE__ */
|
|
3282
|
-
/* @__PURE__ */
|
|
1267
|
+
}, [L, K, $]), ye = k(() => {
|
|
1268
|
+
B(Q(I));
|
|
1269
|
+
}, [d]), W = P(!1), Se = k((n) => {
|
|
1270
|
+
W.current = !0, document.addEventListener("mousemove", V), document.addEventListener("mouseup", pe), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
1271
|
+
}, []), V = k((n) => {
|
|
1272
|
+
if (!W.current) return;
|
|
1273
|
+
const c = document.querySelector(".hep-cr-main");
|
|
1274
|
+
if (!c) return;
|
|
1275
|
+
const R = c.getBoundingClientRect(), _ = (n.clientX - R.left) / R.width * 100;
|
|
1276
|
+
he(Math.max(20, Math.min(80, _)));
|
|
1277
|
+
}, []), pe = k(() => {
|
|
1278
|
+
W.current = !1, document.removeEventListener("mousemove", V), document.removeEventListener("mouseup", pe), document.body.style.cursor = "", document.body.style.userSelect = "";
|
|
1279
|
+
}, [V]);
|
|
1280
|
+
return /* @__PURE__ */ i("div", { className: `hep-cr-runner hep-cr-runner-${x}`, style: me, children: [
|
|
1281
|
+
/* @__PURE__ */ i("div", { className: "hep-cr-header", children: [
|
|
1282
|
+
/* @__PURE__ */ e("div", { className: "hep-cr-controls", children: s && /* @__PURE__ */ e(Ne, { children: /* @__PURE__ */ i(
|
|
3283
1283
|
"select",
|
|
3284
1284
|
{
|
|
3285
|
-
value:
|
|
3286
|
-
onChange:
|
|
1285
|
+
value: d,
|
|
1286
|
+
onChange: be,
|
|
3287
1287
|
className: "hep-cr-language-select",
|
|
3288
|
-
disabled:
|
|
1288
|
+
disabled: N,
|
|
3289
1289
|
children: [
|
|
3290
|
-
|
|
3291
|
-
|
|
1290
|
+
H && /* @__PURE__ */ e("option", { value: "", children: "加载中..." }),
|
|
1291
|
+
ge.map((n) => /* @__PURE__ */ e("option", { value: n.value, children: n.label }, n.value))
|
|
3292
1292
|
]
|
|
3293
1293
|
}
|
|
3294
|
-
) }),
|
|
3295
|
-
/* @__PURE__ */
|
|
3296
|
-
/* @__PURE__ */
|
|
1294
|
+
) }) }),
|
|
1295
|
+
/* @__PURE__ */ i("div", { className: "hep-cr-actions", children: [
|
|
1296
|
+
/* @__PURE__ */ i(
|
|
3297
1297
|
"button",
|
|
3298
1298
|
{
|
|
3299
1299
|
className: "hep-cr-btn hep-cr-btn-run",
|
|
3300
|
-
disabled:
|
|
3301
|
-
onClick:
|
|
1300
|
+
disabled: N || H,
|
|
1301
|
+
onClick: fe,
|
|
3302
1302
|
children: [
|
|
3303
|
-
|
|
3304
|
-
|
|
1303
|
+
N ? /* @__PURE__ */ e("span", { className: "hep-cr-spinner" }) : /* @__PURE__ */ e("span", { className: "hep-cr-run-icon", children: "▶" }),
|
|
1304
|
+
N ? "运行中..." : y
|
|
3305
1305
|
]
|
|
3306
1306
|
}
|
|
3307
1307
|
),
|
|
3308
|
-
|
|
3309
|
-
/* @__PURE__ */
|
|
1308
|
+
u && h && /* @__PURE__ */ e("button", { className: "hep-cr-btn hep-cr-btn-reset", onClick: ye, children: "重置" }),
|
|
1309
|
+
/* @__PURE__ */ e(
|
|
3310
1310
|
"button",
|
|
3311
1311
|
{
|
|
3312
1312
|
className: "hep-cr-btn hep-cr-btn-theme",
|
|
3313
|
-
onClick: () =>
|
|
3314
|
-
title:
|
|
3315
|
-
children:
|
|
3316
|
-
/* @__PURE__ */
|
|
3317
|
-
/* @__PURE__ */
|
|
3318
|
-
/* @__PURE__ */
|
|
3319
|
-
/* @__PURE__ */
|
|
3320
|
-
/* @__PURE__ */
|
|
3321
|
-
/* @__PURE__ */
|
|
3322
|
-
/* @__PURE__ */
|
|
3323
|
-
/* @__PURE__ */
|
|
3324
|
-
/* @__PURE__ */
|
|
1313
|
+
onClick: () => U(x === "light" ? "dark" : "light"),
|
|
1314
|
+
title: x === "light" ? "Switch to dark mode" : "Switch to light mode",
|
|
1315
|
+
children: x === "light" ? /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ e("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) }) : /* @__PURE__ */ i("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
1316
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "5" }),
|
|
1317
|
+
/* @__PURE__ */ e("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
|
|
1318
|
+
/* @__PURE__ */ e("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
|
|
1319
|
+
/* @__PURE__ */ e("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
|
|
1320
|
+
/* @__PURE__ */ e("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
|
|
1321
|
+
/* @__PURE__ */ e("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
|
|
1322
|
+
/* @__PURE__ */ e("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
|
|
1323
|
+
/* @__PURE__ */ e("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
|
|
1324
|
+
/* @__PURE__ */ e("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
|
|
3325
1325
|
] })
|
|
3326
1326
|
}
|
|
3327
1327
|
)
|
|
3328
1328
|
] })
|
|
3329
1329
|
] }),
|
|
3330
|
-
|
|
3331
|
-
/* @__PURE__ */
|
|
3332
|
-
|
|
3333
|
-
/* @__PURE__ */
|
|
3334
|
-
/* @__PURE__ */
|
|
3335
|
-
/* @__PURE__ */
|
|
3336
|
-
/* @__PURE__ */
|
|
3337
|
-
/* @__PURE__ */
|
|
1330
|
+
ae && /* @__PURE__ */ e("div", { className: "hep-cr-error-message", children: ae }),
|
|
1331
|
+
/* @__PURE__ */ i("div", { className: "hep-cr-main", children: [
|
|
1332
|
+
u && /* @__PURE__ */ i("div", { className: "hep-cr-editor-panel", style: { width: `${se}%` }, children: [
|
|
1333
|
+
/* @__PURE__ */ i("div", { className: "hep-cr-panel-header", children: [
|
|
1334
|
+
/* @__PURE__ */ e("span", { className: "hep-cr-panel-title", children: "编辑器" }),
|
|
1335
|
+
/* @__PURE__ */ i("div", { className: "hep-cr-output-actions", children: [
|
|
1336
|
+
/* @__PURE__ */ e("span", { className: "hep-cr-language-badge", children: I }),
|
|
1337
|
+
/* @__PURE__ */ e(
|
|
3338
1338
|
"button",
|
|
3339
1339
|
{
|
|
3340
|
-
className: `hep-cr-btn-icon ${
|
|
3341
|
-
disabled:
|
|
3342
|
-
onClick:
|
|
3343
|
-
title:
|
|
3344
|
-
children:
|
|
1340
|
+
className: `hep-cr-btn-icon ${j ? "hep-cr-btn-copied" : ""}`,
|
|
1341
|
+
disabled: j,
|
|
1342
|
+
onClick: Ee,
|
|
1343
|
+
title: j ? "已复制" : "复制",
|
|
1344
|
+
children: j ? /* @__PURE__ */ e("span", { className: "hep-cr-copied-text", children: "已复制" }) : /* @__PURE__ */ i(
|
|
3345
1345
|
"svg",
|
|
3346
1346
|
{
|
|
3347
1347
|
width: "14",
|
|
@@ -3351,8 +1351,8 @@ const $r = ({
|
|
|
3351
1351
|
stroke: "currentColor",
|
|
3352
1352
|
strokeWidth: "2",
|
|
3353
1353
|
children: [
|
|
3354
|
-
/* @__PURE__ */
|
|
3355
|
-
/* @__PURE__ */
|
|
1354
|
+
/* @__PURE__ */ e("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
|
|
1355
|
+
/* @__PURE__ */ e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
3356
1356
|
]
|
|
3357
1357
|
}
|
|
3358
1358
|
)
|
|
@@ -3360,57 +1360,57 @@ const $r = ({
|
|
|
3360
1360
|
)
|
|
3361
1361
|
] })
|
|
3362
1362
|
] }),
|
|
3363
|
-
/* @__PURE__ */
|
|
3364
|
-
|
|
1363
|
+
/* @__PURE__ */ e(
|
|
1364
|
+
Fe,
|
|
3365
1365
|
{
|
|
3366
|
-
value:
|
|
3367
|
-
language:
|
|
3368
|
-
theme:
|
|
3369
|
-
disabled: !
|
|
3370
|
-
onChange:
|
|
3371
|
-
onCodeChange:
|
|
1366
|
+
value: T,
|
|
1367
|
+
language: I,
|
|
1368
|
+
theme: x,
|
|
1369
|
+
disabled: !h || N,
|
|
1370
|
+
onChange: B,
|
|
1371
|
+
onCodeChange: S
|
|
3372
1372
|
}
|
|
3373
1373
|
)
|
|
3374
1374
|
] }),
|
|
3375
|
-
|
|
3376
|
-
/* @__PURE__ */
|
|
1375
|
+
u && /* @__PURE__ */ e("div", { className: "hep-cr-resize-handle", onMouseDown: Se, children: /* @__PURE__ */ e("div", { className: "hep-cr-resize-line" }) }),
|
|
1376
|
+
/* @__PURE__ */ i(
|
|
3377
1377
|
"div",
|
|
3378
1378
|
{
|
|
3379
1379
|
className: "hep-cr-output-panel",
|
|
3380
|
-
style: { width:
|
|
1380
|
+
style: { width: u ? `${100 - se}%` : "100%" },
|
|
3381
1381
|
children: [
|
|
3382
|
-
/* @__PURE__ */
|
|
3383
|
-
/* @__PURE__ */
|
|
3384
|
-
/* @__PURE__ */
|
|
1382
|
+
/* @__PURE__ */ i("div", { className: "hep-cr-panel-header", children: [
|
|
1383
|
+
/* @__PURE__ */ i("div", { className: "hep-cr-output-tabs", children: [
|
|
1384
|
+
/* @__PURE__ */ e(
|
|
3385
1385
|
"button",
|
|
3386
1386
|
{
|
|
3387
|
-
className: `hep-cr-tab ${
|
|
3388
|
-
onClick: () =>
|
|
1387
|
+
className: `hep-cr-tab ${L === "stdout" ? "active" : ""}`,
|
|
1388
|
+
onClick: () => z("stdout"),
|
|
3389
1389
|
children: "输出"
|
|
3390
1390
|
}
|
|
3391
1391
|
),
|
|
3392
|
-
|
|
1392
|
+
$ && /* @__PURE__ */ e(
|
|
3393
1393
|
"button",
|
|
3394
1394
|
{
|
|
3395
|
-
className: `hep-cr-tab hep-cr-tab-error ${
|
|
3396
|
-
onClick: () =>
|
|
1395
|
+
className: `hep-cr-tab hep-cr-tab-error ${L === "stderr" ? "active" : ""}`,
|
|
1396
|
+
onClick: () => z("stderr"),
|
|
3397
1397
|
children: "错误"
|
|
3398
1398
|
}
|
|
3399
1399
|
)
|
|
3400
1400
|
] }),
|
|
3401
|
-
/* @__PURE__ */
|
|
3402
|
-
|
|
3403
|
-
|
|
1401
|
+
/* @__PURE__ */ i("div", { className: "hep-cr-output-actions", children: [
|
|
1402
|
+
ne !== null && /* @__PURE__ */ i("span", { className: "hep-cr-execution-time", children: [
|
|
1403
|
+
ne,
|
|
3404
1404
|
"ms"
|
|
3405
1405
|
] }),
|
|
3406
|
-
/* @__PURE__ */
|
|
1406
|
+
/* @__PURE__ */ e(
|
|
3407
1407
|
"button",
|
|
3408
1408
|
{
|
|
3409
|
-
className: `hep-cr-btn-icon ${
|
|
3410
|
-
disabled:
|
|
3411
|
-
onClick:
|
|
3412
|
-
title:
|
|
3413
|
-
children:
|
|
1409
|
+
className: `hep-cr-btn-icon ${Y ? "hep-cr-btn-copied" : ""}`,
|
|
1410
|
+
disabled: Y,
|
|
1411
|
+
onClick: ke,
|
|
1412
|
+
title: Y ? "已复制" : "复制",
|
|
1413
|
+
children: Y ? /* @__PURE__ */ e("span", { className: "hep-cr-copied-text", children: "已复制" }) : /* @__PURE__ */ i(
|
|
3414
1414
|
"svg",
|
|
3415
1415
|
{
|
|
3416
1416
|
width: "14",
|
|
@@ -3420,8 +1420,8 @@ const $r = ({
|
|
|
3420
1420
|
stroke: "currentColor",
|
|
3421
1421
|
strokeWidth: "2",
|
|
3422
1422
|
children: [
|
|
3423
|
-
/* @__PURE__ */
|
|
3424
|
-
/* @__PURE__ */
|
|
1423
|
+
/* @__PURE__ */ e("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
|
|
1424
|
+
/* @__PURE__ */ e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
3425
1425
|
]
|
|
3426
1426
|
}
|
|
3427
1427
|
)
|
|
@@ -3429,12 +1429,12 @@ const $r = ({
|
|
|
3429
1429
|
)
|
|
3430
1430
|
] })
|
|
3431
1431
|
] }),
|
|
3432
|
-
/* @__PURE__ */
|
|
1432
|
+
/* @__PURE__ */ e("div", { className: "hep-cr-output-content", children: /* @__PURE__ */ e("pre", { children: L === "stdout" ? N ? "代码执行中..." : K || '点击"运行"执行代码' : $ }) })
|
|
3433
1433
|
]
|
|
3434
1434
|
}
|
|
3435
1435
|
)
|
|
3436
1436
|
] }),
|
|
3437
|
-
/* @__PURE__ */
|
|
1437
|
+
/* @__PURE__ */ e("style", { children: `
|
|
3438
1438
|
.hep-cr-runner {
|
|
3439
1439
|
display: flex;
|
|
3440
1440
|
flex-direction: column;
|
|
@@ -3664,35 +1664,35 @@ const $r = ({
|
|
|
3664
1664
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
3665
1665
|
` })
|
|
3666
1666
|
] });
|
|
3667
|
-
},
|
|
1667
|
+
}, Pe = xe(
|
|
3668
1668
|
({
|
|
3669
|
-
open:
|
|
3670
|
-
defaultOpen:
|
|
3671
|
-
title:
|
|
3672
|
-
width:
|
|
3673
|
-
onClose:
|
|
3674
|
-
footer:
|
|
3675
|
-
theme:
|
|
3676
|
-
...
|
|
3677
|
-
},
|
|
3678
|
-
const [
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
}, [
|
|
3682
|
-
const
|
|
3683
|
-
|
|
3684
|
-
}, [
|
|
3685
|
-
|
|
1669
|
+
open: t,
|
|
1670
|
+
defaultOpen: r = !1,
|
|
1671
|
+
title: a = "代码执行器",
|
|
1672
|
+
width: o = 800,
|
|
1673
|
+
onClose: s,
|
|
1674
|
+
footer: u,
|
|
1675
|
+
theme: h = "light",
|
|
1676
|
+
...f
|
|
1677
|
+
}, y) => {
|
|
1678
|
+
const [m, b] = p(r), g = t !== void 0, S = g ? t : m;
|
|
1679
|
+
w(() => {
|
|
1680
|
+
g && t !== m && b(t);
|
|
1681
|
+
}, [t, g]);
|
|
1682
|
+
const A = k(() => {
|
|
1683
|
+
g || b(!1), s == null || s();
|
|
1684
|
+
}, [g, s]), O = (l) => {
|
|
1685
|
+
l.target === l.currentTarget && A();
|
|
3686
1686
|
};
|
|
3687
|
-
|
|
3688
|
-
close:
|
|
1687
|
+
Ie(y, () => ({
|
|
1688
|
+
close: A
|
|
3689
1689
|
}));
|
|
3690
|
-
const
|
|
3691
|
-
return
|
|
3692
|
-
/* @__PURE__ */
|
|
3693
|
-
/* @__PURE__ */
|
|
3694
|
-
/* @__PURE__ */
|
|
3695
|
-
/* @__PURE__ */
|
|
1690
|
+
const E = typeof o == "number" ? `${o}px` : o;
|
|
1691
|
+
return S ? /* @__PURE__ */ i("div", { className: "hep-cr-dialog-overlay", onClick: O, children: [
|
|
1692
|
+
/* @__PURE__ */ i("div", { className: "hep-cr-dialog-container", style: { width: E }, children: [
|
|
1693
|
+
/* @__PURE__ */ i("div", { className: "hep-cr-dialog-header", children: [
|
|
1694
|
+
/* @__PURE__ */ e("h3", { className: "hep-cr-dialog-title", children: a }),
|
|
1695
|
+
/* @__PURE__ */ e("button", { className: "hep-cr-dialog-close", onClick: A, children: /* @__PURE__ */ i(
|
|
3696
1696
|
"svg",
|
|
3697
1697
|
{
|
|
3698
1698
|
width: "16",
|
|
@@ -3702,16 +1702,16 @@ const $r = ({
|
|
|
3702
1702
|
stroke: "currentColor",
|
|
3703
1703
|
strokeWidth: "2",
|
|
3704
1704
|
children: [
|
|
3705
|
-
/* @__PURE__ */
|
|
3706
|
-
/* @__PURE__ */
|
|
1705
|
+
/* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
1706
|
+
/* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
3707
1707
|
]
|
|
3708
1708
|
}
|
|
3709
1709
|
) })
|
|
3710
1710
|
] }),
|
|
3711
|
-
/* @__PURE__ */
|
|
3712
|
-
|
|
1711
|
+
/* @__PURE__ */ e("div", { className: "hep-cr-dialog-body", children: /* @__PURE__ */ e(Ce, { theme: h, ...f }) }),
|
|
1712
|
+
u && /* @__PURE__ */ e("div", { className: "hep-cr-dialog-footer", children: u })
|
|
3713
1713
|
] }),
|
|
3714
|
-
/* @__PURE__ */
|
|
1714
|
+
/* @__PURE__ */ e("style", { children: `
|
|
3715
1715
|
.hep-cr-dialog-overlay {
|
|
3716
1716
|
position: fixed;
|
|
3717
1717
|
top: 0;
|
|
@@ -3803,9 +1803,9 @@ const $r = ({
|
|
|
3803
1803
|
] }) : null;
|
|
3804
1804
|
}
|
|
3805
1805
|
);
|
|
3806
|
-
|
|
1806
|
+
Pe.displayName = "CodeRunnerDialog";
|
|
3807
1807
|
export {
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
1808
|
+
Ce as CodeRunner,
|
|
1809
|
+
Pe as CodeRunnerDialog,
|
|
1810
|
+
Ce as default
|
|
3811
1811
|
};
|