@hep-code-runner/react 3.1.3 → 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 -121
- package/dist/index.mjs +310 -2334
- package/package.json +4 -5
package/dist/index.mjs
CHANGED
|
@@ -1,1792 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
var Ye = { 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 tr;
|
|
17
|
-
function Sr() {
|
|
18
|
-
if (tr) return Oe;
|
|
19
|
-
tr = 1;
|
|
20
|
-
var p = ir, h = Symbol.for("react.element"), n = Symbol.for("react.fragment"), u = Object.prototype.hasOwnProperty, v = 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, x) {
|
|
22
|
-
var w, F = {}, L = null, B = null;
|
|
23
|
-
x !== void 0 && (L = "" + x), m.key !== void 0 && (L = "" + m.key), m.ref !== void 0 && (B = m.ref);
|
|
24
|
-
for (w in m) u.call(m, w) && !A.hasOwnProperty(w) && (F[w] = m[w]);
|
|
25
|
-
if (s && s.defaultProps) for (w in m = s.defaultProps, m) F[w] === void 0 && (F[w] = m[w]);
|
|
26
|
-
return { $$typeof: h, type: s, key: L, ref: B, props: F, _owner: v.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 nr;
|
|
41
|
-
function Ar() {
|
|
42
|
-
return nr || (nr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var p = ir, h = Symbol.for("react.element"), n = Symbol.for("react.portal"), u = Symbol.for("react.fragment"), v = 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"), x = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), F = Symbol.for("react.memo"), L = Symbol.for("react.lazy"), B = Symbol.for("react.offscreen"), Z = Symbol.iterator, C = "@@iterator";
|
|
44
|
-
function b(e) {
|
|
45
|
-
if (e === null || typeof e != "object")
|
|
46
|
-
return null;
|
|
47
|
-
var a = Z && e[Z] || e[C];
|
|
48
|
-
return typeof a == "function" ? a : null;
|
|
49
|
-
}
|
|
50
|
-
var S = 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), E = 1; E < a; E++)
|
|
54
|
-
d[E - 1] = arguments[E];
|
|
55
|
-
t("error", e, d);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function t(e, a, d) {
|
|
59
|
-
{
|
|
60
|
-
var E = S.ReactDebugCurrentFrame, I = E.getStackAddendum();
|
|
61
|
-
I !== "" && (a += "%s", d = d.concat([I]));
|
|
62
|
-
var N = d.map(function(T) {
|
|
63
|
-
return String(T);
|
|
64
|
-
});
|
|
65
|
-
N.unshift("Warning: " + a), Function.prototype.apply.call(console[e], console, N);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
var i = !1, l = !1, o = !1, f = !1, y = !1, g;
|
|
69
|
-
g = Symbol.for("react.module.reference");
|
|
70
|
-
function O(e) {
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e === u || e === A || y || e === v || e === x || e === w || f || e === B || i || l || o || typeof e == "object" && e !== null && (e.$$typeof === L || e.$$typeof === F || 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 === g || e.getModuleId !== void 0));
|
|
76
|
-
}
|
|
77
|
-
function D(e, a, d) {
|
|
78
|
-
var E = e.displayName;
|
|
79
|
-
if (E)
|
|
80
|
-
return E;
|
|
81
|
-
var I = a.displayName || a.name || "";
|
|
82
|
-
return I !== "" ? d + "(" + I + ")" : d;
|
|
83
|
-
}
|
|
84
|
-
function j(e) {
|
|
85
|
-
return e.displayName || "Context";
|
|
86
|
-
}
|
|
87
|
-
function V(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 v:
|
|
102
|
-
return "StrictMode";
|
|
103
|
-
case x:
|
|
104
|
-
return "Suspense";
|
|
105
|
-
case w:
|
|
106
|
-
return "SuspenseList";
|
|
107
|
-
}
|
|
108
|
-
if (typeof e == "object")
|
|
109
|
-
switch (e.$$typeof) {
|
|
110
|
-
case s:
|
|
111
|
-
var a = e;
|
|
112
|
-
return j(a) + ".Consumer";
|
|
113
|
-
case R:
|
|
114
|
-
var d = e;
|
|
115
|
-
return j(d._context) + ".Provider";
|
|
116
|
-
case m:
|
|
117
|
-
return D(e, e.render, "ForwardRef");
|
|
118
|
-
case F:
|
|
119
|
-
var E = e.displayName || null;
|
|
120
|
-
return E !== null ? E : V(e.type) || "Memo";
|
|
121
|
-
case L: {
|
|
122
|
-
var I = e, N = I._payload, T = I._init;
|
|
123
|
-
try {
|
|
124
|
-
return V(T(N));
|
|
125
|
-
} catch {
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
var q = Object.assign, ae = 0, ie, oe, P, H, X, se, z;
|
|
133
|
-
function xe() {
|
|
134
|
-
}
|
|
135
|
-
xe.__reactDisabledLog = !0;
|
|
136
|
-
function W() {
|
|
137
|
-
{
|
|
138
|
-
if (ae === 0) {
|
|
139
|
-
ie = console.log, oe = console.info, P = console.warn, H = console.error, X = console.group, se = console.groupCollapsed, z = console.groupEnd;
|
|
140
|
-
var e = {
|
|
141
|
-
configurable: !0,
|
|
142
|
-
enumerable: !0,
|
|
143
|
-
value: xe,
|
|
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
|
-
ae++;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function le() {
|
|
160
|
-
{
|
|
161
|
-
if (ae--, ae === 0) {
|
|
162
|
-
var e = {
|
|
163
|
-
configurable: !0,
|
|
164
|
-
enumerable: !0,
|
|
165
|
-
writable: !0
|
|
166
|
-
};
|
|
167
|
-
Object.defineProperties(console, {
|
|
168
|
-
log: q({}, e, {
|
|
169
|
-
value: ie
|
|
170
|
-
}),
|
|
171
|
-
info: q({}, e, {
|
|
172
|
-
value: oe
|
|
173
|
-
}),
|
|
174
|
-
warn: q({}, e, {
|
|
175
|
-
value: P
|
|
176
|
-
}),
|
|
177
|
-
error: q({}, e, {
|
|
178
|
-
value: H
|
|
179
|
-
}),
|
|
180
|
-
group: q({}, e, {
|
|
181
|
-
value: X
|
|
182
|
-
}),
|
|
183
|
-
groupCollapsed: q({}, e, {
|
|
184
|
-
value: se
|
|
185
|
-
}),
|
|
186
|
-
groupEnd: q({}, e, {
|
|
187
|
-
value: z
|
|
188
|
-
})
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
ae < 0 && r("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
var J = S.ReactCurrentDispatcher, re;
|
|
195
|
-
function te(e, a, d) {
|
|
196
|
-
{
|
|
197
|
-
if (re === void 0)
|
|
198
|
-
try {
|
|
199
|
-
throw Error();
|
|
200
|
-
} catch (I) {
|
|
201
|
-
var E = I.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
-
re = E && E[1] || "";
|
|
203
|
-
}
|
|
204
|
-
return `
|
|
205
|
-
` + re + e;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
var ne = !1, ce;
|
|
209
|
-
{
|
|
210
|
-
var de = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
-
ce = new de();
|
|
212
|
-
}
|
|
213
|
-
function Q(e, a) {
|
|
214
|
-
if (!e || ne)
|
|
215
|
-
return "";
|
|
216
|
-
{
|
|
217
|
-
var d = ce.get(e);
|
|
218
|
-
if (d !== void 0)
|
|
219
|
-
return d;
|
|
220
|
-
}
|
|
221
|
-
var E;
|
|
222
|
-
ne = !0;
|
|
223
|
-
var I = Error.prepareStackTrace;
|
|
224
|
-
Error.prepareStackTrace = void 0;
|
|
225
|
-
var N;
|
|
226
|
-
N = J.current, J.current = null, W();
|
|
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
|
-
E = K;
|
|
241
|
-
}
|
|
242
|
-
Reflect.construct(e, [], T);
|
|
243
|
-
} else {
|
|
244
|
-
try {
|
|
245
|
-
T.call();
|
|
246
|
-
} catch (K) {
|
|
247
|
-
E = K;
|
|
248
|
-
}
|
|
249
|
-
e.call(T.prototype);
|
|
250
|
-
}
|
|
251
|
-
} else {
|
|
252
|
-
try {
|
|
253
|
-
throw Error();
|
|
254
|
-
} catch (K) {
|
|
255
|
-
E = K;
|
|
256
|
-
}
|
|
257
|
-
e();
|
|
258
|
-
}
|
|
259
|
-
} catch (K) {
|
|
260
|
-
if (K && E && typeof K.stack == "string") {
|
|
261
|
-
for (var k = K.stack.split(`
|
|
262
|
-
`), G = E.stack.split(`
|
|
263
|
-
`), $ = k.length - 1, U = G.length - 1; $ >= 1 && U >= 0 && k[$] !== G[U]; )
|
|
264
|
-
U--;
|
|
265
|
-
for (; $ >= 1 && U >= 0; $--, U--)
|
|
266
|
-
if (k[$] !== G[U]) {
|
|
267
|
-
if ($ !== 1 || U !== 1)
|
|
268
|
-
do
|
|
269
|
-
if ($--, U--, U < 0 || k[$] !== G[U]) {
|
|
270
|
-
var ee = `
|
|
271
|
-
` + k[$].replace(" at new ", " at ");
|
|
272
|
-
return e.displayName && ee.includes("<anonymous>") && (ee = ee.replace("<anonymous>", e.displayName)), typeof e == "function" && ce.set(e, ee), ee;
|
|
273
|
-
}
|
|
274
|
-
while ($ >= 1 && U >= 0);
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
} finally {
|
|
279
|
-
ne = !1, J.current = N, le(), Error.prepareStackTrace = I;
|
|
280
|
-
}
|
|
281
|
-
var Re = e ? e.displayName || e.name : "", Ee = Re ? te(Re) : "";
|
|
282
|
-
return typeof e == "function" && ce.set(e, Ee), Ee;
|
|
283
|
-
}
|
|
284
|
-
function me(e, a, d) {
|
|
285
|
-
return Q(e, !1);
|
|
286
|
-
}
|
|
287
|
-
function $e(e) {
|
|
288
|
-
var a = e.prototype;
|
|
289
|
-
return !!(a && a.isReactComponent);
|
|
290
|
-
}
|
|
291
|
-
function ke(e, a, d) {
|
|
292
|
-
if (e == null)
|
|
293
|
-
return "";
|
|
294
|
-
if (typeof e == "function")
|
|
295
|
-
return Q(e, $e(e));
|
|
296
|
-
if (typeof e == "string")
|
|
297
|
-
return te(e);
|
|
298
|
-
switch (e) {
|
|
299
|
-
case x:
|
|
300
|
-
return te("Suspense");
|
|
301
|
-
case w:
|
|
302
|
-
return te("SuspenseList");
|
|
303
|
-
}
|
|
304
|
-
if (typeof e == "object")
|
|
305
|
-
switch (e.$$typeof) {
|
|
306
|
-
case m:
|
|
307
|
-
return me(e.render);
|
|
308
|
-
case F:
|
|
309
|
-
return ke(e.type, a, d);
|
|
310
|
-
case L: {
|
|
311
|
-
var E = e, I = E._payload, N = E._init;
|
|
312
|
-
try {
|
|
313
|
-
return ke(N(I), a, d);
|
|
314
|
-
} catch {
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return "";
|
|
319
|
-
}
|
|
320
|
-
var be = Object.prototype.hasOwnProperty, Ce = {}, we = S.ReactDebugCurrentFrame;
|
|
321
|
-
function Se(e) {
|
|
322
|
-
if (e) {
|
|
323
|
-
var a = e._owner, d = ke(e.type, e._source, a ? a.type : null);
|
|
324
|
-
we.setExtraStackFrame(d);
|
|
325
|
-
} else
|
|
326
|
-
we.setExtraStackFrame(null);
|
|
327
|
-
}
|
|
328
|
-
function Fe(e, a, d, E, I) {
|
|
329
|
-
{
|
|
330
|
-
var N = Function.call.bind(be);
|
|
331
|
-
for (var T in e)
|
|
332
|
-
if (N(e, T)) {
|
|
333
|
-
var k = void 0;
|
|
334
|
-
try {
|
|
335
|
-
if (typeof e[T] != "function") {
|
|
336
|
-
var G = Error((E || "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 G.name = "Invariant Violation", G;
|
|
338
|
-
}
|
|
339
|
-
k = e[T](a, T, E, d, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
-
} catch ($) {
|
|
341
|
-
k = $;
|
|
342
|
-
}
|
|
343
|
-
k && !(k instanceof Error) && (Se(I), 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).", E || "React class", d, T, typeof k), Se(null)), k instanceof Error && !(k.message in Ce) && (Ce[k.message] = !0, Se(I), r("Failed %s type: %s", d, k.message), Se(null));
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
var Pe = Array.isArray;
|
|
348
|
-
function _(e) {
|
|
349
|
-
return Pe(e);
|
|
350
|
-
}
|
|
351
|
-
function M(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 pe(e) {
|
|
358
|
-
try {
|
|
359
|
-
return he(e), !1;
|
|
360
|
-
} catch {
|
|
361
|
-
return !0;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
function he(e) {
|
|
365
|
-
return "" + e;
|
|
366
|
-
}
|
|
367
|
-
function De(e) {
|
|
368
|
-
if (pe(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.", M(e)), he(e);
|
|
370
|
-
}
|
|
371
|
-
var Ae = S.ReactCurrentOwner, ve = {
|
|
372
|
-
key: !0,
|
|
373
|
-
ref: !0,
|
|
374
|
-
__self: !0,
|
|
375
|
-
__source: !0
|
|
376
|
-
}, fe, ge;
|
|
377
|
-
function Ie(e) {
|
|
378
|
-
if (be.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 je(e) {
|
|
386
|
-
if (be.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 Me(e, a) {
|
|
394
|
-
typeof e.ref == "string" && Ae.current;
|
|
395
|
-
}
|
|
396
|
-
function sr(e, a) {
|
|
397
|
-
{
|
|
398
|
-
var d = function() {
|
|
399
|
-
fe || (fe = !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
|
-
ge || (ge = !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, E, I, N, T) {
|
|
419
|
-
var k = {
|
|
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: N
|
|
429
|
-
};
|
|
430
|
-
return k._store = {}, Object.defineProperty(k._store, "validated", {
|
|
431
|
-
configurable: !1,
|
|
432
|
-
enumerable: !1,
|
|
433
|
-
writable: !0,
|
|
434
|
-
value: !1
|
|
435
|
-
}), Object.defineProperty(k, "_self", {
|
|
436
|
-
configurable: !1,
|
|
437
|
-
enumerable: !1,
|
|
438
|
-
writable: !1,
|
|
439
|
-
value: E
|
|
440
|
-
}), Object.defineProperty(k, "_source", {
|
|
441
|
-
configurable: !1,
|
|
442
|
-
enumerable: !1,
|
|
443
|
-
writable: !1,
|
|
444
|
-
value: I
|
|
445
|
-
}), Object.freeze && (Object.freeze(k.props), Object.freeze(k)), k;
|
|
446
|
-
};
|
|
447
|
-
function ur(e, a, d, E, I) {
|
|
448
|
-
{
|
|
449
|
-
var N, T = {}, k = null, G = null;
|
|
450
|
-
d !== void 0 && (De(d), k = "" + d), je(a) && (De(a.key), k = "" + a.key), Ie(a) && (G = a.ref, Me(a, I));
|
|
451
|
-
for (N in a)
|
|
452
|
-
be.call(a, N) && !ve.hasOwnProperty(N) && (T[N] = a[N]);
|
|
453
|
-
if (e && e.defaultProps) {
|
|
454
|
-
var $ = e.defaultProps;
|
|
455
|
-
for (N in $)
|
|
456
|
-
T[N] === void 0 && (T[N] = $[N]);
|
|
457
|
-
}
|
|
458
|
-
if (k || G) {
|
|
459
|
-
var U = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
460
|
-
k && sr(T, U), G && lr(T, U);
|
|
461
|
-
}
|
|
462
|
-
return cr(e, k, G, I, E, Ae.current, T);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
var Ue = S.ReactCurrentOwner, Xe = S.ReactDebugCurrentFrame;
|
|
466
|
-
function Te(e) {
|
|
467
|
-
if (e) {
|
|
468
|
-
var a = e._owner, d = ke(e.type, e._source, a ? a.type : null);
|
|
469
|
-
Xe.setExtraStackFrame(d);
|
|
470
|
-
} else
|
|
471
|
-
Xe.setExtraStackFrame(null);
|
|
472
|
-
}
|
|
473
|
-
var He;
|
|
474
|
-
He = !1;
|
|
475
|
-
function Be(e) {
|
|
476
|
-
return typeof e == "object" && e !== null && e.$$typeof === h;
|
|
477
|
-
}
|
|
478
|
-
function Ke() {
|
|
479
|
-
{
|
|
480
|
-
if (Ue.current) {
|
|
481
|
-
var e = V(Ue.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 Ze = {};
|
|
494
|
-
function pr(e) {
|
|
495
|
-
{
|
|
496
|
-
var a = Ke();
|
|
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 qe(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 (Ze[d])
|
|
513
|
-
return;
|
|
514
|
-
Ze[d] = !0;
|
|
515
|
-
var E = "";
|
|
516
|
-
e && e._owner && e._owner !== Ue.current && (E = " It was passed a child from " + V(e._owner.type) + "."), Te(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, E), Te(null);
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
function Je(e, a) {
|
|
520
|
-
{
|
|
521
|
-
if (typeof e != "object")
|
|
522
|
-
return;
|
|
523
|
-
if (_(e))
|
|
524
|
-
for (var d = 0; d < e.length; d++) {
|
|
525
|
-
var E = e[d];
|
|
526
|
-
Be(E) && qe(E, a);
|
|
527
|
-
}
|
|
528
|
-
else if (Be(e))
|
|
529
|
-
e._store && (e._store.validated = !0);
|
|
530
|
-
else if (e) {
|
|
531
|
-
var I = b(e);
|
|
532
|
-
if (typeof I == "function" && I !== e.entries)
|
|
533
|
-
for (var N = I.call(e), T; !(T = N.next()).done; )
|
|
534
|
-
Be(T.value) && qe(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 === F))
|
|
549
|
-
d = a.propTypes;
|
|
550
|
-
else
|
|
551
|
-
return;
|
|
552
|
-
if (d) {
|
|
553
|
-
var E = V(a);
|
|
554
|
-
Fe(d, e.props, "prop", E, e);
|
|
555
|
-
} else if (a.PropTypes !== void 0 && !He) {
|
|
556
|
-
He = !0;
|
|
557
|
-
var I = V(a);
|
|
558
|
-
r("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", I || "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 E = a[d];
|
|
567
|
-
if (E !== "children" && E !== "key") {
|
|
568
|
-
Te(e), r("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", E), Te(null);
|
|
569
|
-
break;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
e.ref !== null && (Te(e), r("Invalid attribute `ref` supplied to `React.Fragment`."), Te(null));
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
var Qe = {};
|
|
576
|
-
function er(e, a, d, E, I, N) {
|
|
577
|
-
{
|
|
578
|
-
var T = O(e);
|
|
579
|
-
if (!T) {
|
|
580
|
-
var k = "";
|
|
581
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (k += " 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 G = dr();
|
|
583
|
-
G ? k += G : k += Ke();
|
|
584
|
-
var $;
|
|
585
|
-
e === null ? $ = "null" : _(e) ? $ = "array" : e !== void 0 && e.$$typeof === h ? ($ = "<" + (V(e.type) || "Unknown") + " />", k = " 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", $, k);
|
|
586
|
-
}
|
|
587
|
-
var U = ur(e, a, d, I, N);
|
|
588
|
-
if (U == null)
|
|
589
|
-
return U;
|
|
590
|
-
if (T) {
|
|
591
|
-
var ee = a.children;
|
|
592
|
-
if (ee !== void 0)
|
|
593
|
-
if (E)
|
|
594
|
-
if (_(ee)) {
|
|
595
|
-
for (var Re = 0; Re < ee.length; Re++)
|
|
596
|
-
Je(ee[Re], 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
|
-
Je(ee, e);
|
|
602
|
-
}
|
|
603
|
-
if (be.call(a, "key")) {
|
|
604
|
-
var Ee = V(e), K = Object.keys(a).filter(function(yr) {
|
|
605
|
-
return yr !== "key";
|
|
606
|
-
}), ze = K.length > 0 ? "{key: someKey, " + K.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
607
|
-
if (!Qe[Ee + ze]) {
|
|
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} />`, ze, Ee, Er, Ee), Qe[Ee + ze] = !0;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
return e === u ? fr(U) : hr(U), U;
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
function gr(e, a, d) {
|
|
621
|
-
return er(e, a, d, !0);
|
|
622
|
-
}
|
|
623
|
-
function mr(e, a, d) {
|
|
624
|
-
return er(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" ? Ye.exports = Sr() : Ye.exports = Ar();
|
|
631
|
-
var c = Ye.exports, or = { 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 v = /(?:^|\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 l, o;
|
|
742
|
-
switch (s.util.type(t)) {
|
|
743
|
-
case "Object":
|
|
744
|
-
if (o = s.util.objId(t), i[o])
|
|
745
|
-
return i[o];
|
|
746
|
-
l = /** @type {Record<string, any>} */
|
|
747
|
-
{}, i[o] = l;
|
|
748
|
-
for (var f in t)
|
|
749
|
-
t.hasOwnProperty(f) && (l[f] = r(t[f], i));
|
|
750
|
-
return (
|
|
751
|
-
/** @type {any} */
|
|
752
|
-
l
|
|
753
|
-
);
|
|
754
|
-
case "Array":
|
|
755
|
-
return o = s.util.objId(t), i[o] ? i[o] : (l = [], i[o] = l, /** @type {Array} */
|
|
756
|
-
/** @type {any} */
|
|
757
|
-
t.forEach(function(y, g) {
|
|
758
|
-
l[g] = r(y, i);
|
|
759
|
-
}), /** @type {any} */
|
|
760
|
-
l);
|
|
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 = v.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(v, "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 (l) {
|
|
810
|
-
var r = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(l.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 l = "no-" + t; r; ) {
|
|
841
|
-
var o = r.classList;
|
|
842
|
-
if (o.contains(t))
|
|
843
|
-
return !0;
|
|
844
|
-
if (o.contains(l))
|
|
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 l in t)
|
|
897
|
-
i[l] = t[l];
|
|
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, l) {
|
|
976
|
-
l = l || /** @type {any} */
|
|
977
|
-
s.languages;
|
|
978
|
-
var o = l[r], f = {};
|
|
979
|
-
for (var y in o)
|
|
980
|
-
if (o.hasOwnProperty(y)) {
|
|
981
|
-
if (y == t)
|
|
982
|
-
for (var g in i)
|
|
983
|
-
i.hasOwnProperty(g) && (f[g] = i[g]);
|
|
984
|
-
i.hasOwnProperty(y) || (f[y] = o[y]);
|
|
985
|
-
}
|
|
986
|
-
var O = l[r];
|
|
987
|
-
return l[r] = f, s.languages.DFS(s.languages, function(D, j) {
|
|
988
|
-
j === O && D != r && (this[D] = f);
|
|
989
|
-
}), f;
|
|
990
|
-
},
|
|
991
|
-
// Traverse a language definition with Depth First Search
|
|
992
|
-
DFS: function r(t, i, l, o) {
|
|
993
|
-
o = o || {};
|
|
994
|
-
var f = s.util.objId;
|
|
995
|
-
for (var y in t)
|
|
996
|
-
if (t.hasOwnProperty(y)) {
|
|
997
|
-
i.call(t, y, t[y], l || y);
|
|
998
|
-
var g = t[y], O = s.util.type(g);
|
|
999
|
-
O === "Object" && !o[f(g)] ? (o[f(g)] = !0, r(g, i, null, o)) : O === "Array" && !o[f(g)] && (o[f(g)] = !0, r(g, i, y, o));
|
|
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 l = {
|
|
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", l), l.elements = Array.prototype.slice.apply(l.container.querySelectorAll(l.selector)), s.hooks.run("before-all-elements-highlight", l);
|
|
1041
|
-
for (var o = 0, f; f = l.elements[o++]; )
|
|
1042
|
-
s.highlightElement(f, t === !0, l.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 l = s.util.getLanguage(r), o = s.languages[l];
|
|
1074
|
-
s.util.setLanguage(r, l);
|
|
1075
|
-
var f = r.parentElement;
|
|
1076
|
-
f && f.nodeName.toLowerCase() === "pre" && s.util.setLanguage(f, l);
|
|
1077
|
-
var y = r.textContent, g = {
|
|
1078
|
-
element: r,
|
|
1079
|
-
language: l,
|
|
1080
|
-
grammar: o,
|
|
1081
|
-
code: y
|
|
1082
|
-
};
|
|
1083
|
-
function O(j) {
|
|
1084
|
-
g.highlightedCode = j, s.hooks.run("before-insert", g), g.element.innerHTML = g.highlightedCode, s.hooks.run("after-highlight", g), s.hooks.run("complete", g), i && i.call(g.element);
|
|
1085
|
-
}
|
|
1086
|
-
if (s.hooks.run("before-sanity-check", g), f = g.element.parentElement, f && f.nodeName.toLowerCase() === "pre" && !f.hasAttribute("tabindex") && f.setAttribute("tabindex", "0"), !g.code) {
|
|
1087
|
-
s.hooks.run("complete", g), i && i.call(g.element);
|
|
1088
|
-
return;
|
|
1089
|
-
}
|
|
1090
|
-
if (s.hooks.run("before-highlight", g), !g.grammar) {
|
|
1091
|
-
O(s.util.encode(g.code));
|
|
1092
|
-
return;
|
|
1093
|
-
}
|
|
1094
|
-
if (t && u.Worker) {
|
|
1095
|
-
var D = new Worker(s.filename);
|
|
1096
|
-
D.onmessage = function(j) {
|
|
1097
|
-
O(j.data);
|
|
1098
|
-
}, D.postMessage(JSON.stringify({
|
|
1099
|
-
language: g.language,
|
|
1100
|
-
code: g.code,
|
|
1101
|
-
immediateClose: !0
|
|
1102
|
-
}));
|
|
1103
|
-
} else
|
|
1104
|
-
O(s.highlight(g.code, g.grammar, g.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 l = {
|
|
1128
|
-
code: r,
|
|
1129
|
-
grammar: t,
|
|
1130
|
-
language: i
|
|
1131
|
-
};
|
|
1132
|
-
if (s.hooks.run("before-tokenize", l), !l.grammar)
|
|
1133
|
-
throw new Error('The language "' + l.language + '" has no grammar.');
|
|
1134
|
-
return l.tokens = s.tokenize(l.code, l.grammar), s.hooks.run("after-tokenize", l), m.stringify(s.util.encode(l.tokens), l.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 l in i)
|
|
1164
|
-
t[l] = i[l];
|
|
1165
|
-
delete t.rest;
|
|
1166
|
-
}
|
|
1167
|
-
var o = new F();
|
|
1168
|
-
return L(o, o.head, r), w(r, o, t, o.head, 0), Z(o);
|
|
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 l = 0, o; o = i[l++]; )
|
|
1206
|
-
o(t);
|
|
1207
|
-
}
|
|
1208
|
-
},
|
|
1209
|
-
Token: m
|
|
1210
|
-
};
|
|
1211
|
-
u.Prism = s;
|
|
1212
|
-
function m(r, t, i, l) {
|
|
1213
|
-
this.type = r, this.content = t, this.alias = i, this.length = (l || "").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 l = "";
|
|
1220
|
-
return t.forEach(function(O) {
|
|
1221
|
-
l += r(O, i);
|
|
1222
|
-
}), l;
|
|
1223
|
-
}
|
|
1224
|
-
var o = {
|
|
1225
|
-
type: t.type,
|
|
1226
|
-
content: r(t.content, i),
|
|
1227
|
-
tag: "span",
|
|
1228
|
-
classes: ["token", t.type],
|
|
1229
|
-
attributes: {},
|
|
1230
|
-
language: i
|
|
1231
|
-
}, f = t.alias;
|
|
1232
|
-
f && (Array.isArray(f) ? Array.prototype.push.apply(o.classes, f) : o.classes.push(f)), s.hooks.run("wrap", o);
|
|
1233
|
-
var y = "";
|
|
1234
|
-
for (var g in o.attributes)
|
|
1235
|
-
y += " " + g + '="' + (o.attributes[g] || "").replace(/"/g, """) + '"';
|
|
1236
|
-
return "<" + o.tag + ' class="' + o.classes.join(" ") + '"' + y + ">" + o.content + "</" + o.tag + ">";
|
|
1237
|
-
};
|
|
1238
|
-
function x(r, t, i, l) {
|
|
1239
|
-
r.lastIndex = t;
|
|
1240
|
-
var o = r.exec(i);
|
|
1241
|
-
if (o && l && o[1]) {
|
|
1242
|
-
var f = o[1].length;
|
|
1243
|
-
o.index += f, o[0] = o[0].slice(f);
|
|
1244
|
-
}
|
|
1245
|
-
return o;
|
|
1246
|
-
}
|
|
1247
|
-
function w(r, t, i, l, o, f) {
|
|
1248
|
-
for (var y in i)
|
|
1249
|
-
if (!(!i.hasOwnProperty(y) || !i[y])) {
|
|
1250
|
-
var g = i[y];
|
|
1251
|
-
g = Array.isArray(g) ? g : [g];
|
|
1252
|
-
for (var O = 0; O < g.length; ++O) {
|
|
1253
|
-
if (f && f.cause == y + "," + O)
|
|
1254
|
-
return;
|
|
1255
|
-
var D = g[O], j = D.inside, V = !!D.lookbehind, q = !!D.greedy, ae = D.alias;
|
|
1256
|
-
if (q && !D.pattern.global) {
|
|
1257
|
-
var ie = D.pattern.toString().match(/[imsuy]*$/)[0];
|
|
1258
|
-
D.pattern = RegExp(D.pattern.source, ie + "g");
|
|
1259
|
-
}
|
|
1260
|
-
for (var oe = D.pattern || D, P = l.next, H = o; P !== t.tail && !(f && H >= f.reach); H += P.value.length, P = P.next) {
|
|
1261
|
-
var X = P.value;
|
|
1262
|
-
if (t.length > r.length)
|
|
1263
|
-
return;
|
|
1264
|
-
if (!(X instanceof m)) {
|
|
1265
|
-
var se = 1, z;
|
|
1266
|
-
if (q) {
|
|
1267
|
-
if (z = x(oe, H, r, V), !z || z.index >= r.length)
|
|
1268
|
-
break;
|
|
1269
|
-
var J = z.index, xe = z.index + z[0].length, W = H;
|
|
1270
|
-
for (W += P.value.length; J >= W; )
|
|
1271
|
-
P = P.next, W += P.value.length;
|
|
1272
|
-
if (W -= P.value.length, H = W, P.value instanceof m)
|
|
1273
|
-
continue;
|
|
1274
|
-
for (var le = P; le !== t.tail && (W < xe || typeof le.value == "string"); le = le.next)
|
|
1275
|
-
se++, W += le.value.length;
|
|
1276
|
-
se--, X = r.slice(H, W), z.index -= H;
|
|
1277
|
-
} else if (z = x(oe, 0, X, V), !z)
|
|
1278
|
-
continue;
|
|
1279
|
-
var J = z.index, re = z[0], te = X.slice(0, J), ne = X.slice(J + re.length), ce = H + X.length;
|
|
1280
|
-
f && ce > f.reach && (f.reach = ce);
|
|
1281
|
-
var de = P.prev;
|
|
1282
|
-
te && (de = L(t, de, te), H += te.length), B(t, de, se);
|
|
1283
|
-
var Q = new m(y, j ? s.tokenize(re, j) : re, ae, re);
|
|
1284
|
-
if (P = L(t, de, Q), ne && L(t, P, ne), se > 1) {
|
|
1285
|
-
var me = {
|
|
1286
|
-
cause: y + "," + O,
|
|
1287
|
-
reach: ce
|
|
1288
|
-
};
|
|
1289
|
-
w(r, t, i, P.prev, H, me), f && me.reach > f.reach && (f.reach = me.reach);
|
|
1290
|
-
}
|
|
1291
|
-
}
|
|
1292
|
-
}
|
|
1293
|
-
}
|
|
1294
|
-
}
|
|
1295
|
-
}
|
|
1296
|
-
function F() {
|
|
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 L(r, t, i) {
|
|
1301
|
-
var l = t.next, o = { value: i, prev: t, next: l };
|
|
1302
|
-
return t.next = o, l.prev = o, r.length++, o;
|
|
1303
|
-
}
|
|
1304
|
-
function B(r, t, i) {
|
|
1305
|
-
for (var l = t.next, o = 0; o < i && l !== r.tail; o++)
|
|
1306
|
-
l = l.next;
|
|
1307
|
-
t.next = l, l.prev = t, r.length -= o;
|
|
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, l = t.code, o = t.immediateClose;
|
|
1317
|
-
u.postMessage(s.highlight(l, s.languages[i], i)), o && u.close();
|
|
1318
|
-
}, !1)), s;
|
|
1319
|
-
var C = s.util.currentScript();
|
|
1320
|
-
C && (s.filename = C.src, C.hasAttribute("data-manual") && (s.manual = !0));
|
|
1321
|
-
function b() {
|
|
1322
|
-
s.manual || s.highlightAll();
|
|
1323
|
-
}
|
|
1324
|
-
if (!s.manual) {
|
|
1325
|
-
var S = document.readyState;
|
|
1326
|
-
S === "loading" || S === "interactive" && C && C.defer ? document.addEventListener("DOMContentLoaded", b) : window.requestAnimationFrame ? window.requestAnimationFrame(b) : window.setTimeout(b, 16);
|
|
1327
|
-
}
|
|
1328
|
-
return s;
|
|
1329
|
-
}(h);
|
|
1330
|
-
p.exports && (p.exports = n), typeof rr < "u" && (rr.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(v, 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[v] = {
|
|
1440
|
-
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
1441
|
-
return v;
|
|
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, v) {
|
|
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: [v, "language-" + v],
|
|
1476
|
-
inside: n.languages[v]
|
|
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 v = /(?:"(?:\\(?:\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 + "|" + v.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\\((?:" + v.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
|
1513
|
-
greedy: !0,
|
|
1514
|
-
inside: {
|
|
1515
|
-
function: /^url/i,
|
|
1516
|
-
punctuation: /^\(|\)$/,
|
|
1517
|
-
string: {
|
|
1518
|
-
pattern: RegExp("^" + v.source + "$"),
|
|
1519
|
-
alias: "url"
|
|
1520
|
-
}
|
|
1521
|
-
}
|
|
1522
|
-
},
|
|
1523
|
-
selector: {
|
|
1524
|
-
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + v.source + ")*(?=\\s*\\{)"),
|
|
1525
|
-
lookbehind: !0
|
|
1526
|
-
},
|
|
1527
|
-
string: {
|
|
1528
|
-
pattern: v,
|
|
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…", v = function(C, b) {
|
|
1709
|
-
return "✖ Error " + C + " while fetching file: " + b;
|
|
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", x = "loaded", w = "failed", F = "pre[data-src]:not([" + s + '="' + x + '"]):not([' + s + '="' + m + '"])';
|
|
1721
|
-
function L(C, b, S) {
|
|
1722
|
-
var r = new XMLHttpRequest();
|
|
1723
|
-
r.open("GET", C, !0), r.onreadystatechange = function() {
|
|
1724
|
-
r.readyState == 4 && (r.status < 400 && r.responseText ? b(r.responseText) : r.status >= 400 ? S(v(r.status, r.statusText)) : S(A));
|
|
1725
|
-
}, r.send(null);
|
|
1726
|
-
}
|
|
1727
|
-
function B(C) {
|
|
1728
|
-
var b = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(C || "");
|
|
1729
|
-
if (b) {
|
|
1730
|
-
var S = Number(b[1]), r = b[2], t = b[3];
|
|
1731
|
-
return r ? t ? [S, Number(t)] : [S, void 0] : [S, S];
|
|
1732
|
-
}
|
|
1733
|
-
}
|
|
1734
|
-
n.hooks.add("before-highlightall", function(C) {
|
|
1735
|
-
C.selector += ", " + F;
|
|
1736
|
-
}), n.hooks.add("before-sanity-check", function(C) {
|
|
1737
|
-
var b = (
|
|
1738
|
-
/** @type {HTMLPreElement} */
|
|
1739
|
-
C.element
|
|
1740
|
-
);
|
|
1741
|
-
if (b.matches(F)) {
|
|
1742
|
-
C.code = "", b.setAttribute(s, m);
|
|
1743
|
-
var S = b.appendChild(document.createElement("CODE"));
|
|
1744
|
-
S.textContent = u;
|
|
1745
|
-
var r = b.getAttribute("data-src"), t = C.language;
|
|
1746
|
-
if (t === "none") {
|
|
1747
|
-
var i = (/\.(\w+)$/.exec(r) || [, "none"])[1];
|
|
1748
|
-
t = R[i] || i;
|
|
1749
|
-
}
|
|
1750
|
-
n.util.setLanguage(S, t), n.util.setLanguage(b, t);
|
|
1751
|
-
var l = n.plugins.autoloader;
|
|
1752
|
-
l && l.loadLanguages(t), L(
|
|
1753
|
-
r,
|
|
1754
|
-
function(o) {
|
|
1755
|
-
b.setAttribute(s, x);
|
|
1756
|
-
var f = B(b.getAttribute("data-range"));
|
|
1757
|
-
if (f) {
|
|
1758
|
-
var y = o.split(/\r\n?|\n/g), g = f[0], O = f[1] == null ? y.length : f[1];
|
|
1759
|
-
g < 0 && (g += y.length), g = Math.max(0, Math.min(g - 1, y.length)), O < 0 && (O += y.length), O = Math.max(0, Math.min(O, y.length)), o = y.slice(g, O).join(`
|
|
1760
|
-
`), b.hasAttribute("data-start") || b.setAttribute("data-start", String(g + 1));
|
|
1761
|
-
}
|
|
1762
|
-
S.textContent = o, n.highlightElement(S);
|
|
1763
|
-
},
|
|
1764
|
-
function(o) {
|
|
1765
|
-
b.setAttribute(s, w), S.textContent = o;
|
|
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(b) {
|
|
1778
|
-
for (var S = (b || document).querySelectorAll(F), r = 0, t; t = S[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
|
-
})(or);
|
|
1788
|
-
var Tr = or.exports;
|
|
1789
|
-
const Ve = /* @__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,405 +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 We = 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 v = (await this.getRuntimes()).find(
|
|
2990
|
-
(m) => {
|
|
2991
|
-
var x;
|
|
2992
|
-
return m.language.toLowerCase() === h.toLowerCase() || ((x = m.aliases) == null ? void 0 : x.some((w) => w.toLowerCase() === h.toLowerCase()));
|
|
2993
|
-
}
|
|
2994
|
-
);
|
|
2995
|
-
if (!v)
|
|
2996
|
-
throw new Error(`Language '${h}' is not supported`);
|
|
2997
|
-
const A = this.getFileName(h), R = {
|
|
2998
|
-
language: v.language,
|
|
2999
|
-
version: u.version || v.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 x = await m.json(), w = Date.now() - s, F = x.run.stdout || "", L = x.run.stderr || "";
|
|
3022
|
-
return {
|
|
3023
|
-
success: x.run.code === 0,
|
|
3024
|
-
output: F,
|
|
3025
|
-
stderr: L,
|
|
3026
|
-
code: x.run.code,
|
|
3027
|
-
executionTime: w,
|
|
3028
|
-
compile: x.compile ? {
|
|
3029
|
-
stdout: x.compile.stdout || "",
|
|
3030
|
-
stderr: x.compile.stderr || "",
|
|
3031
|
-
code: x.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 Ge(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: v = !0,
|
|
3183
|
-
showEditor: A = !0,
|
|
3184
|
-
editable: R = !0,
|
|
3185
|
-
defaultCode: s = "",
|
|
3186
|
-
executorLabel: m = "运行",
|
|
3187
|
-
onExecuteStart: x,
|
|
3188
|
-
onExecuteEnd: w,
|
|
3189
|
-
onLanguageChange: F,
|
|
3190
|
-
onChange: L
|
|
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
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
|
|
3204
|
-
return (0.299 * fe + 0.587 * ge + 0.114 * Ie) / 255 > 0.5;
|
|
3205
|
-
})(u) ? "#000" : "#fff";
|
|
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";
|
|
3206
1206
|
return {
|
|
3207
|
-
"--hep-cr-theme-color":
|
|
3208
|
-
"--hep-cr-theme-color-hover":
|
|
3209
|
-
"--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
|
|
3210
1210
|
};
|
|
3211
|
-
}, [
|
|
3212
|
-
|
|
3213
|
-
async function
|
|
3214
|
-
|
|
1211
|
+
}, [o, a]), I = v(() => d.includes(":") ? d.split(":")[0] : d, [d]);
|
|
1212
|
+
w(() => {
|
|
1213
|
+
async function n() {
|
|
1214
|
+
ie(!0), G(null);
|
|
3215
1215
|
try {
|
|
3216
|
-
const
|
|
3217
|
-
|
|
3218
|
-
} catch (
|
|
3219
|
-
|
|
1216
|
+
const c = await X.getRuntimes();
|
|
1217
|
+
l(c);
|
|
1218
|
+
} catch (c) {
|
|
1219
|
+
G(c instanceof Error ? c.message : "Failed to load runtimes");
|
|
3220
1220
|
} finally {
|
|
3221
|
-
|
|
1221
|
+
ie(!1);
|
|
3222
1222
|
}
|
|
3223
1223
|
}
|
|
3224
|
-
|
|
3225
|
-
}, [
|
|
3226
|
-
!
|
|
3227
|
-
}, [
|
|
3228
|
-
|
|
3229
|
-
}, []),
|
|
3230
|
-
!
|
|
3231
|
-
}, [
|
|
3232
|
-
const
|
|
3233
|
-
(
|
|
3234
|
-
const
|
|
3235
|
-
|
|
3236
|
-
const
|
|
3237
|
-
|
|
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);
|
|
3238
1238
|
},
|
|
3239
|
-
[
|
|
3240
|
-
),
|
|
3241
|
-
if (!
|
|
3242
|
-
|
|
1239
|
+
[g]
|
|
1240
|
+
), fe = k(async () => {
|
|
1241
|
+
if (!N) {
|
|
1242
|
+
re(!0), ee(""), te(""), oe(null), G(null), z("stdout"), m == null || m();
|
|
3243
1243
|
try {
|
|
3244
|
-
const
|
|
3245
|
-
|
|
3246
|
-
} catch (
|
|
3247
|
-
const
|
|
3248
|
-
|
|
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({
|
|
3249
1249
|
success: !1,
|
|
3250
1250
|
output: "",
|
|
3251
|
-
stderr:
|
|
1251
|
+
stderr: c,
|
|
3252
1252
|
code: -1
|
|
3253
1253
|
});
|
|
3254
1254
|
} finally {
|
|
3255
|
-
|
|
1255
|
+
re(!1);
|
|
3256
1256
|
}
|
|
3257
1257
|
}
|
|
3258
|
-
}, [
|
|
3259
|
-
await navigator.clipboard.writeText(
|
|
3260
|
-
|
|
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__ */
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
children:
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
/* @__PURE__ */
|
|
3297
|
-
"button",
|
|
3298
|
-
{
|
|
3299
|
-
className: "hep-cr-btn hep-cr-btn-set-default",
|
|
3300
|
-
disabled: j,
|
|
3301
|
-
onClick: C,
|
|
3302
|
-
title: "设为默认语言",
|
|
3303
|
-
children: "★"
|
|
3304
|
-
}
|
|
3305
|
-
)
|
|
3306
|
-
] }) }),
|
|
3307
|
-
/* @__PURE__ */ c.jsxs("div", { className: "hep-cr-actions", children: [
|
|
3308
|
-
/* @__PURE__ */ c.jsxs(
|
|
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(
|
|
1283
|
+
"select",
|
|
1284
|
+
{
|
|
1285
|
+
value: d,
|
|
1286
|
+
onChange: be,
|
|
1287
|
+
className: "hep-cr-language-select",
|
|
1288
|
+
disabled: N,
|
|
1289
|
+
children: [
|
|
1290
|
+
H && /* @__PURE__ */ e("option", { value: "", children: "加载中..." }),
|
|
1291
|
+
ge.map((n) => /* @__PURE__ */ e("option", { value: n.value, children: n.label }, n.value))
|
|
1292
|
+
]
|
|
1293
|
+
}
|
|
1294
|
+
) }) }),
|
|
1295
|
+
/* @__PURE__ */ i("div", { className: "hep-cr-actions", children: [
|
|
1296
|
+
/* @__PURE__ */ i(
|
|
3309
1297
|
"button",
|
|
3310
1298
|
{
|
|
3311
1299
|
className: "hep-cr-btn hep-cr-btn-run",
|
|
3312
|
-
disabled:
|
|
3313
|
-
onClick:
|
|
1300
|
+
disabled: N || H,
|
|
1301
|
+
onClick: fe,
|
|
3314
1302
|
children: [
|
|
3315
|
-
|
|
3316
|
-
|
|
1303
|
+
N ? /* @__PURE__ */ e("span", { className: "hep-cr-spinner" }) : /* @__PURE__ */ e("span", { className: "hep-cr-run-icon", children: "▶" }),
|
|
1304
|
+
N ? "运行中..." : y
|
|
3317
1305
|
]
|
|
3318
1306
|
}
|
|
3319
1307
|
),
|
|
3320
|
-
|
|
3321
|
-
/* @__PURE__ */
|
|
1308
|
+
u && h && /* @__PURE__ */ e("button", { className: "hep-cr-btn hep-cr-btn-reset", onClick: ye, children: "重置" }),
|
|
1309
|
+
/* @__PURE__ */ e(
|
|
3322
1310
|
"button",
|
|
3323
1311
|
{
|
|
3324
1312
|
className: "hep-cr-btn hep-cr-btn-theme",
|
|
3325
|
-
onClick: () =>
|
|
3326
|
-
title:
|
|
3327
|
-
children:
|
|
3328
|
-
/* @__PURE__ */
|
|
3329
|
-
/* @__PURE__ */
|
|
3330
|
-
/* @__PURE__ */
|
|
3331
|
-
/* @__PURE__ */
|
|
3332
|
-
/* @__PURE__ */
|
|
3333
|
-
/* @__PURE__ */
|
|
3334
|
-
/* @__PURE__ */
|
|
3335
|
-
/* @__PURE__ */
|
|
3336
|
-
/* @__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" })
|
|
3337
1325
|
] })
|
|
3338
1326
|
}
|
|
3339
1327
|
)
|
|
3340
1328
|
] })
|
|
3341
1329
|
] }),
|
|
3342
|
-
|
|
3343
|
-
/* @__PURE__ */
|
|
3344
|
-
|
|
3345
|
-
/* @__PURE__ */
|
|
3346
|
-
/* @__PURE__ */
|
|
3347
|
-
/* @__PURE__ */
|
|
3348
|
-
/* @__PURE__ */
|
|
3349
|
-
/* @__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(
|
|
3350
1338
|
"button",
|
|
3351
1339
|
{
|
|
3352
|
-
className: `hep-cr-btn-icon ${
|
|
3353
|
-
disabled:
|
|
3354
|
-
onClick:
|
|
3355
|
-
title:
|
|
3356
|
-
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(
|
|
3357
1345
|
"svg",
|
|
3358
1346
|
{
|
|
3359
1347
|
width: "14",
|
|
@@ -3363,8 +1351,8 @@ const $r = ({
|
|
|
3363
1351
|
stroke: "currentColor",
|
|
3364
1352
|
strokeWidth: "2",
|
|
3365
1353
|
children: [
|
|
3366
|
-
/* @__PURE__ */
|
|
3367
|
-
/* @__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" })
|
|
3368
1356
|
]
|
|
3369
1357
|
}
|
|
3370
1358
|
)
|
|
@@ -3372,57 +1360,57 @@ const $r = ({
|
|
|
3372
1360
|
)
|
|
3373
1361
|
] })
|
|
3374
1362
|
] }),
|
|
3375
|
-
/* @__PURE__ */
|
|
3376
|
-
|
|
1363
|
+
/* @__PURE__ */ e(
|
|
1364
|
+
Fe,
|
|
3377
1365
|
{
|
|
3378
|
-
value:
|
|
3379
|
-
language:
|
|
3380
|
-
theme:
|
|
3381
|
-
disabled: !
|
|
3382
|
-
onChange:
|
|
3383
|
-
onCodeChange:
|
|
1366
|
+
value: T,
|
|
1367
|
+
language: I,
|
|
1368
|
+
theme: x,
|
|
1369
|
+
disabled: !h || N,
|
|
1370
|
+
onChange: B,
|
|
1371
|
+
onCodeChange: S
|
|
3384
1372
|
}
|
|
3385
1373
|
)
|
|
3386
1374
|
] }),
|
|
3387
|
-
|
|
3388
|
-
/* @__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(
|
|
3389
1377
|
"div",
|
|
3390
1378
|
{
|
|
3391
1379
|
className: "hep-cr-output-panel",
|
|
3392
|
-
style: { width:
|
|
1380
|
+
style: { width: u ? `${100 - se}%` : "100%" },
|
|
3393
1381
|
children: [
|
|
3394
|
-
/* @__PURE__ */
|
|
3395
|
-
/* @__PURE__ */
|
|
3396
|
-
/* @__PURE__ */
|
|
1382
|
+
/* @__PURE__ */ i("div", { className: "hep-cr-panel-header", children: [
|
|
1383
|
+
/* @__PURE__ */ i("div", { className: "hep-cr-output-tabs", children: [
|
|
1384
|
+
/* @__PURE__ */ e(
|
|
3397
1385
|
"button",
|
|
3398
1386
|
{
|
|
3399
|
-
className: `hep-cr-tab ${
|
|
3400
|
-
onClick: () =>
|
|
1387
|
+
className: `hep-cr-tab ${L === "stdout" ? "active" : ""}`,
|
|
1388
|
+
onClick: () => z("stdout"),
|
|
3401
1389
|
children: "输出"
|
|
3402
1390
|
}
|
|
3403
1391
|
),
|
|
3404
|
-
|
|
1392
|
+
$ && /* @__PURE__ */ e(
|
|
3405
1393
|
"button",
|
|
3406
1394
|
{
|
|
3407
|
-
className: `hep-cr-tab hep-cr-tab-error ${
|
|
3408
|
-
onClick: () =>
|
|
1395
|
+
className: `hep-cr-tab hep-cr-tab-error ${L === "stderr" ? "active" : ""}`,
|
|
1396
|
+
onClick: () => z("stderr"),
|
|
3409
1397
|
children: "错误"
|
|
3410
1398
|
}
|
|
3411
1399
|
)
|
|
3412
1400
|
] }),
|
|
3413
|
-
/* @__PURE__ */
|
|
3414
|
-
|
|
3415
|
-
|
|
1401
|
+
/* @__PURE__ */ i("div", { className: "hep-cr-output-actions", children: [
|
|
1402
|
+
ne !== null && /* @__PURE__ */ i("span", { className: "hep-cr-execution-time", children: [
|
|
1403
|
+
ne,
|
|
3416
1404
|
"ms"
|
|
3417
1405
|
] }),
|
|
3418
|
-
/* @__PURE__ */
|
|
1406
|
+
/* @__PURE__ */ e(
|
|
3419
1407
|
"button",
|
|
3420
1408
|
{
|
|
3421
|
-
className: `hep-cr-btn-icon ${
|
|
3422
|
-
disabled:
|
|
3423
|
-
onClick:
|
|
3424
|
-
title:
|
|
3425
|
-
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(
|
|
3426
1414
|
"svg",
|
|
3427
1415
|
{
|
|
3428
1416
|
width: "14",
|
|
@@ -3432,8 +1420,8 @@ const $r = ({
|
|
|
3432
1420
|
stroke: "currentColor",
|
|
3433
1421
|
strokeWidth: "2",
|
|
3434
1422
|
children: [
|
|
3435
|
-
/* @__PURE__ */
|
|
3436
|
-
/* @__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" })
|
|
3437
1425
|
]
|
|
3438
1426
|
}
|
|
3439
1427
|
)
|
|
@@ -3441,12 +1429,12 @@ const $r = ({
|
|
|
3441
1429
|
)
|
|
3442
1430
|
] })
|
|
3443
1431
|
] }),
|
|
3444
|
-
/* @__PURE__ */
|
|
1432
|
+
/* @__PURE__ */ e("div", { className: "hep-cr-output-content", children: /* @__PURE__ */ e("pre", { children: L === "stdout" ? N ? "代码执行中..." : K || '点击"运行"执行代码' : $ }) })
|
|
3445
1433
|
]
|
|
3446
1434
|
}
|
|
3447
1435
|
)
|
|
3448
1436
|
] }),
|
|
3449
|
-
/* @__PURE__ */
|
|
1437
|
+
/* @__PURE__ */ e("style", { children: `
|
|
3450
1438
|
.hep-cr-runner {
|
|
3451
1439
|
display: flex;
|
|
3452
1440
|
flex-direction: column;
|
|
@@ -3506,18 +1494,6 @@ const $r = ({
|
|
|
3506
1494
|
.hep-cr-runner-light .hep-cr-btn-theme { color: #f57c00; }
|
|
3507
1495
|
.hep-cr-btn-theme:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
|
|
3508
1496
|
.hep-cr-runner-light .hep-cr-btn-theme:hover { background: rgba(0, 0, 0, 0.05); }
|
|
3509
|
-
.hep-cr-btn-set-default {
|
|
3510
|
-
background: transparent;
|
|
3511
|
-
color: #888;
|
|
3512
|
-
padding: 6px 10px;
|
|
3513
|
-
font-size: 16px;
|
|
3514
|
-
line-height: 1;
|
|
3515
|
-
min-height: 28px;
|
|
3516
|
-
height: auto;
|
|
3517
|
-
}
|
|
3518
|
-
.hep-cr-runner-light .hep-cr-btn-set-default { color: #bbb; }
|
|
3519
|
-
.hep-cr-btn-set-default:hover:not(:disabled) { color: #fdd835; background: transparent; }
|
|
3520
|
-
.hep-cr-runner-light .hep-cr-btn-set-default:hover:not(:disabled) { color: #f57c00; }
|
|
3521
1497
|
.hep-cr-error-message {
|
|
3522
1498
|
padding: 10px 16px;
|
|
3523
1499
|
background: #c62828;
|
|
@@ -3688,35 +1664,35 @@ const $r = ({
|
|
|
3688
1664
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
3689
1665
|
` })
|
|
3690
1666
|
] });
|
|
3691
|
-
},
|
|
1667
|
+
}, Pe = xe(
|
|
3692
1668
|
({
|
|
3693
|
-
open:
|
|
3694
|
-
defaultOpen:
|
|
3695
|
-
title:
|
|
3696
|
-
width:
|
|
3697
|
-
onClose:
|
|
3698
|
-
footer:
|
|
3699
|
-
theme:
|
|
3700
|
-
...
|
|
3701
|
-
},
|
|
3702
|
-
const [
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
}, [
|
|
3706
|
-
const
|
|
3707
|
-
|
|
3708
|
-
}, [
|
|
3709
|
-
|
|
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();
|
|
3710
1686
|
};
|
|
3711
|
-
|
|
3712
|
-
close:
|
|
1687
|
+
Ie(y, () => ({
|
|
1688
|
+
close: A
|
|
3713
1689
|
}));
|
|
3714
|
-
const
|
|
3715
|
-
return
|
|
3716
|
-
/* @__PURE__ */
|
|
3717
|
-
/* @__PURE__ */
|
|
3718
|
-
/* @__PURE__ */
|
|
3719
|
-
/* @__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(
|
|
3720
1696
|
"svg",
|
|
3721
1697
|
{
|
|
3722
1698
|
width: "16",
|
|
@@ -3726,16 +1702,16 @@ const $r = ({
|
|
|
3726
1702
|
stroke: "currentColor",
|
|
3727
1703
|
strokeWidth: "2",
|
|
3728
1704
|
children: [
|
|
3729
|
-
/* @__PURE__ */
|
|
3730
|
-
/* @__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" })
|
|
3731
1707
|
]
|
|
3732
1708
|
}
|
|
3733
1709
|
) })
|
|
3734
1710
|
] }),
|
|
3735
|
-
/* @__PURE__ */
|
|
3736
|
-
|
|
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 })
|
|
3737
1713
|
] }),
|
|
3738
|
-
/* @__PURE__ */
|
|
1714
|
+
/* @__PURE__ */ e("style", { children: `
|
|
3739
1715
|
.hep-cr-dialog-overlay {
|
|
3740
1716
|
position: fixed;
|
|
3741
1717
|
top: 0;
|
|
@@ -3827,9 +1803,9 @@ const $r = ({
|
|
|
3827
1803
|
] }) : null;
|
|
3828
1804
|
}
|
|
3829
1805
|
);
|
|
3830
|
-
|
|
1806
|
+
Pe.displayName = "CodeRunnerDialog";
|
|
3831
1807
|
export {
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
1808
|
+
Ce as CodeRunner,
|
|
1809
|
+
Pe as CodeRunnerDialog,
|
|
1810
|
+
Ce as default
|
|
3835
1811
|
};
|