@jojovms/scripto 0.0.5 → 0.0.6
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/{scripto.js → scripto.es.js} +1086 -1061
- package/dist/scripto.umd.js +77 -0
- package/package.json +5 -5
- package/dist/scripto.umd.cjs +0 -77
|
@@ -3,7 +3,7 @@ var bn = (l) => {
|
|
|
3
3
|
throw TypeError(l);
|
|
4
4
|
};
|
|
5
5
|
var er = (l, e, t) => e in l ? Jn(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
|
|
6
|
-
var
|
|
6
|
+
var j = (l, e, t) => er(l, typeof e != "symbol" ? e + "" : e, t), tr = (l, e, t) => e.has(l) || bn("Cannot " + t);
|
|
7
7
|
var xn = (l, e, t) => e.has(l) ? bn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(l) : e.set(l, t);
|
|
8
8
|
var Dt = (l, e, t) => (tr(l, e, "access private method"), t);
|
|
9
9
|
import me, { useRef as nr, useState as ye, useEffect as Ye } from "react";
|
|
@@ -21,15 +21,15 @@ var Tn;
|
|
|
21
21
|
function rr() {
|
|
22
22
|
if (Tn) return lt;
|
|
23
23
|
Tn = 1;
|
|
24
|
-
var l = me, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty,
|
|
25
|
-
function
|
|
26
|
-
var h,
|
|
27
|
-
x !== void 0 && (
|
|
28
|
-
for (h in
|
|
29
|
-
if (
|
|
30
|
-
return { $$typeof: e, type:
|
|
31
|
-
}
|
|
32
|
-
return lt.Fragment = t, lt.jsx =
|
|
24
|
+
var l = me, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, r = l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, a = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
25
|
+
function s(c, u, x) {
|
|
26
|
+
var h, w = {}, g = null, E = null;
|
|
27
|
+
x !== void 0 && (g = "" + x), u.key !== void 0 && (g = "" + u.key), u.ref !== void 0 && (E = u.ref);
|
|
28
|
+
for (h in u) n.call(u, h) && !a.hasOwnProperty(h) && (w[h] = u[h]);
|
|
29
|
+
if (c && c.defaultProps) for (h in u = c.defaultProps, u) w[h] === void 0 && (w[h] = u[h]);
|
|
30
|
+
return { $$typeof: e, type: c, key: g, ref: E, props: w, _owner: r.current };
|
|
31
|
+
}
|
|
32
|
+
return lt.Fragment = t, lt.jsx = s, lt.jsxs = s, lt;
|
|
33
33
|
}
|
|
34
34
|
var ct = {};
|
|
35
35
|
/**
|
|
@@ -44,88 +44,88 @@ var ct = {};
|
|
|
44
44
|
var wn;
|
|
45
45
|
function ir() {
|
|
46
46
|
return wn || (wn = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
|
-
var l = me, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"),
|
|
48
|
-
function
|
|
49
|
-
if (
|
|
47
|
+
var l = me, e = Symbol.for("react.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), c = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), T = Symbol.iterator, m = "@@iterator";
|
|
48
|
+
function O(o) {
|
|
49
|
+
if (o === null || typeof o != "object")
|
|
50
50
|
return null;
|
|
51
|
-
var p =
|
|
51
|
+
var p = T && o[T] || o[m];
|
|
52
52
|
return typeof p == "function" ? p : null;
|
|
53
53
|
}
|
|
54
|
-
var
|
|
55
|
-
function
|
|
54
|
+
var M = l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
55
|
+
function N(o) {
|
|
56
56
|
{
|
|
57
|
-
for (var p = arguments.length, k = new Array(p > 1 ? p - 1 : 0),
|
|
58
|
-
k[
|
|
59
|
-
K("error",
|
|
57
|
+
for (var p = arguments.length, k = new Array(p > 1 ? p - 1 : 0), _ = 1; _ < p; _++)
|
|
58
|
+
k[_ - 1] = arguments[_];
|
|
59
|
+
K("error", o, k);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
function K(
|
|
62
|
+
function K(o, p, k) {
|
|
63
63
|
{
|
|
64
|
-
var
|
|
64
|
+
var _ = M.ReactDebugCurrentFrame, S = _.getStackAddendum();
|
|
65
65
|
S !== "" && (p += "%s", k = k.concat([S]));
|
|
66
|
-
var
|
|
67
|
-
return String(
|
|
66
|
+
var I = k.map(function(A) {
|
|
67
|
+
return String(A);
|
|
68
68
|
});
|
|
69
|
-
|
|
69
|
+
I.unshift("Warning: " + p), Function.prototype.apply.call(console[o], console, I);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
var
|
|
72
|
+
var H = !1, oe = !1, Ve = !1, Bt = !1, Wt = !1, Tt;
|
|
73
73
|
Tt = Symbol.for("react.module.reference");
|
|
74
|
-
function Gt(
|
|
75
|
-
return !!(typeof
|
|
74
|
+
function Gt(o) {
|
|
75
|
+
return !!(typeof o == "string" || typeof o == "function" || o === n || o === a || Wt || o === r || o === x || o === h || Bt || o === E || H || oe || Ve || typeof o == "object" && o !== null && (o.$$typeof === g || o.$$typeof === w || o.$$typeof === s || o.$$typeof === c || o.$$typeof === u || // This needs to include all possible module reference object
|
|
76
76
|
// types supported by any Flight configuration anywhere since
|
|
77
77
|
// we don't know which Flight build this will end up being used
|
|
78
78
|
// with.
|
|
79
|
-
|
|
79
|
+
o.$$typeof === Tt || o.getModuleId !== void 0));
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
var
|
|
83
|
-
if (
|
|
84
|
-
return
|
|
81
|
+
function W(o, p, k) {
|
|
82
|
+
var _ = o.displayName;
|
|
83
|
+
if (_)
|
|
84
|
+
return _;
|
|
85
85
|
var S = p.displayName || p.name || "";
|
|
86
86
|
return S !== "" ? k + "(" + S + ")" : k;
|
|
87
87
|
}
|
|
88
|
-
function je(
|
|
89
|
-
return
|
|
88
|
+
function je(o) {
|
|
89
|
+
return o.displayName || "Context";
|
|
90
90
|
}
|
|
91
|
-
function ee(
|
|
92
|
-
if (
|
|
91
|
+
function ee(o) {
|
|
92
|
+
if (o == null)
|
|
93
93
|
return null;
|
|
94
|
-
if (typeof
|
|
95
|
-
return
|
|
96
|
-
if (typeof
|
|
97
|
-
return
|
|
98
|
-
switch (
|
|
94
|
+
if (typeof o.tag == "number" && N("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof o == "function")
|
|
95
|
+
return o.displayName || o.name || null;
|
|
96
|
+
if (typeof o == "string")
|
|
97
|
+
return o;
|
|
98
|
+
switch (o) {
|
|
99
99
|
case n:
|
|
100
100
|
return "Fragment";
|
|
101
101
|
case t:
|
|
102
102
|
return "Portal";
|
|
103
103
|
case a:
|
|
104
104
|
return "Profiler";
|
|
105
|
-
case
|
|
105
|
+
case r:
|
|
106
106
|
return "StrictMode";
|
|
107
107
|
case x:
|
|
108
108
|
return "Suspense";
|
|
109
109
|
case h:
|
|
110
110
|
return "SuspenseList";
|
|
111
111
|
}
|
|
112
|
-
if (typeof
|
|
113
|
-
switch (
|
|
114
|
-
case
|
|
115
|
-
var p =
|
|
112
|
+
if (typeof o == "object")
|
|
113
|
+
switch (o.$$typeof) {
|
|
114
|
+
case c:
|
|
115
|
+
var p = o;
|
|
116
116
|
return je(p) + ".Consumer";
|
|
117
|
-
case
|
|
118
|
-
var k =
|
|
117
|
+
case s:
|
|
118
|
+
var k = o;
|
|
119
119
|
return je(k._context) + ".Provider";
|
|
120
|
-
case
|
|
121
|
-
return
|
|
122
|
-
case
|
|
123
|
-
var
|
|
124
|
-
return
|
|
125
|
-
case
|
|
126
|
-
var S =
|
|
120
|
+
case u:
|
|
121
|
+
return W(o, o.render, "ForwardRef");
|
|
122
|
+
case w:
|
|
123
|
+
var _ = o.displayName || null;
|
|
124
|
+
return _ !== null ? _ : ee(o.type) || "Memo";
|
|
125
|
+
case g: {
|
|
126
|
+
var S = o, I = S._payload, A = S._init;
|
|
127
127
|
try {
|
|
128
|
-
return ee(
|
|
128
|
+
return ee(A(I));
|
|
129
129
|
} catch {
|
|
130
130
|
return null;
|
|
131
131
|
}
|
|
@@ -133,80 +133,80 @@ function ir() {
|
|
|
133
133
|
}
|
|
134
134
|
return null;
|
|
135
135
|
}
|
|
136
|
-
var
|
|
137
|
-
function
|
|
136
|
+
var se = Object.assign, Le = 0, wt, _t, qe, yt, Ze, F, Xe;
|
|
137
|
+
function B() {
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
B.__reactDisabledLog = !0;
|
|
140
140
|
function Et() {
|
|
141
141
|
{
|
|
142
142
|
if (Le === 0) {
|
|
143
|
-
wt = console.log, _t = console.info,
|
|
144
|
-
var
|
|
143
|
+
wt = console.log, _t = console.info, qe = console.warn, yt = console.error, Ze = console.group, F = console.groupCollapsed, Xe = console.groupEnd;
|
|
144
|
+
var o = {
|
|
145
145
|
configurable: !0,
|
|
146
146
|
enumerable: !0,
|
|
147
|
-
value:
|
|
147
|
+
value: B,
|
|
148
148
|
writable: !0
|
|
149
149
|
};
|
|
150
150
|
Object.defineProperties(console, {
|
|
151
|
-
info:
|
|
152
|
-
log:
|
|
153
|
-
warn:
|
|
154
|
-
error:
|
|
155
|
-
group:
|
|
156
|
-
groupCollapsed:
|
|
157
|
-
groupEnd:
|
|
151
|
+
info: o,
|
|
152
|
+
log: o,
|
|
153
|
+
warn: o,
|
|
154
|
+
error: o,
|
|
155
|
+
group: o,
|
|
156
|
+
groupCollapsed: o,
|
|
157
|
+
groupEnd: o
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
Le++;
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function $() {
|
|
164
164
|
{
|
|
165
165
|
if (Le--, Le === 0) {
|
|
166
|
-
var
|
|
166
|
+
var o = {
|
|
167
167
|
configurable: !0,
|
|
168
168
|
enumerable: !0,
|
|
169
169
|
writable: !0
|
|
170
170
|
};
|
|
171
171
|
Object.defineProperties(console, {
|
|
172
|
-
log:
|
|
172
|
+
log: se({}, o, {
|
|
173
173
|
value: wt
|
|
174
174
|
}),
|
|
175
|
-
info:
|
|
175
|
+
info: se({}, o, {
|
|
176
176
|
value: _t
|
|
177
177
|
}),
|
|
178
|
-
warn:
|
|
179
|
-
value:
|
|
178
|
+
warn: se({}, o, {
|
|
179
|
+
value: qe
|
|
180
180
|
}),
|
|
181
|
-
error:
|
|
181
|
+
error: se({}, o, {
|
|
182
182
|
value: yt
|
|
183
183
|
}),
|
|
184
|
-
group:
|
|
184
|
+
group: se({}, o, {
|
|
185
185
|
value: Ze
|
|
186
186
|
}),
|
|
187
|
-
groupCollapsed:
|
|
187
|
+
groupCollapsed: se({}, o, {
|
|
188
188
|
value: F
|
|
189
189
|
}),
|
|
190
|
-
groupEnd:
|
|
190
|
+
groupEnd: se({}, o, {
|
|
191
191
|
value: Xe
|
|
192
192
|
})
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
-
Le < 0 &&
|
|
195
|
+
Le < 0 && N("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
var ge =
|
|
199
|
-
function
|
|
198
|
+
var ge = M.ReactCurrentDispatcher, Ie;
|
|
199
|
+
function ae(o, p, k) {
|
|
200
200
|
{
|
|
201
201
|
if (Ie === void 0)
|
|
202
202
|
try {
|
|
203
203
|
throw Error();
|
|
204
204
|
} catch (S) {
|
|
205
|
-
var
|
|
206
|
-
Ie =
|
|
205
|
+
var _ = S.stack.trim().match(/\n( *(at )?)/);
|
|
206
|
+
Ie = _ && _[1] || "";
|
|
207
207
|
}
|
|
208
208
|
return `
|
|
209
|
-
` + Ie +
|
|
209
|
+
` + Ie + o;
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
var ze = !1, Ee;
|
|
@@ -214,292 +214,292 @@ function ir() {
|
|
|
214
214
|
var vt = typeof WeakMap == "function" ? WeakMap : Map;
|
|
215
215
|
Ee = new vt();
|
|
216
216
|
}
|
|
217
|
-
function Ke(
|
|
218
|
-
if (!
|
|
217
|
+
function Ke(o, p) {
|
|
218
|
+
if (!o || ze)
|
|
219
219
|
return "";
|
|
220
220
|
{
|
|
221
|
-
var k = Ee.get(
|
|
221
|
+
var k = Ee.get(o);
|
|
222
222
|
if (k !== void 0)
|
|
223
223
|
return k;
|
|
224
224
|
}
|
|
225
|
-
var
|
|
225
|
+
var _;
|
|
226
226
|
ze = !0;
|
|
227
227
|
var S = Error.prepareStackTrace;
|
|
228
228
|
Error.prepareStackTrace = void 0;
|
|
229
|
-
var
|
|
230
|
-
|
|
229
|
+
var I;
|
|
230
|
+
I = ge.current, ge.current = null, Et();
|
|
231
231
|
try {
|
|
232
232
|
if (p) {
|
|
233
|
-
var
|
|
233
|
+
var A = function() {
|
|
234
234
|
throw Error();
|
|
235
235
|
};
|
|
236
|
-
if (Object.defineProperty(
|
|
236
|
+
if (Object.defineProperty(A.prototype, "props", {
|
|
237
237
|
set: function() {
|
|
238
238
|
throw Error();
|
|
239
239
|
}
|
|
240
240
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
241
241
|
try {
|
|
242
|
-
Reflect.construct(
|
|
243
|
-
} catch (
|
|
244
|
-
|
|
242
|
+
Reflect.construct(A, []);
|
|
243
|
+
} catch (L) {
|
|
244
|
+
_ = L;
|
|
245
245
|
}
|
|
246
|
-
Reflect.construct(
|
|
246
|
+
Reflect.construct(o, [], A);
|
|
247
247
|
} else {
|
|
248
248
|
try {
|
|
249
|
-
|
|
250
|
-
} catch (
|
|
251
|
-
|
|
249
|
+
A.call();
|
|
250
|
+
} catch (L) {
|
|
251
|
+
_ = L;
|
|
252
252
|
}
|
|
253
|
-
|
|
253
|
+
o.call(A.prototype);
|
|
254
254
|
}
|
|
255
255
|
} else {
|
|
256
256
|
try {
|
|
257
257
|
throw Error();
|
|
258
|
-
} catch (
|
|
259
|
-
|
|
258
|
+
} catch (L) {
|
|
259
|
+
_ = L;
|
|
260
260
|
}
|
|
261
|
-
|
|
261
|
+
o();
|
|
262
262
|
}
|
|
263
|
-
} catch (
|
|
264
|
-
if (
|
|
265
|
-
for (var
|
|
266
|
-
`), G =
|
|
267
|
-
`), d =
|
|
263
|
+
} catch (L) {
|
|
264
|
+
if (L && _ && typeof L.stack == "string") {
|
|
265
|
+
for (var v = L.stack.split(`
|
|
266
|
+
`), G = _.stack.split(`
|
|
267
|
+
`), d = v.length - 1, i = G.length - 1; d >= 1 && i >= 0 && v[d] !== G[i]; )
|
|
268
268
|
i--;
|
|
269
269
|
for (; d >= 1 && i >= 0; d--, i--)
|
|
270
|
-
if (
|
|
270
|
+
if (v[d] !== G[i]) {
|
|
271
271
|
if (d !== 1 || i !== 1)
|
|
272
272
|
do
|
|
273
|
-
if (d--, i--, i < 0 ||
|
|
273
|
+
if (d--, i--, i < 0 || v[d] !== G[i]) {
|
|
274
274
|
var f = `
|
|
275
|
-
` +
|
|
276
|
-
return
|
|
275
|
+
` + v[d].replace(" at new ", " at ");
|
|
276
|
+
return o.displayName && f.includes("<anonymous>") && (f = f.replace("<anonymous>", o.displayName)), typeof o == "function" && Ee.set(o, f), f;
|
|
277
277
|
}
|
|
278
278
|
while (d >= 1 && i >= 0);
|
|
279
279
|
break;
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
282
|
} finally {
|
|
283
|
-
ze = !1, ge.current =
|
|
283
|
+
ze = !1, ge.current = I, $(), Error.prepareStackTrace = S;
|
|
284
284
|
}
|
|
285
|
-
var b =
|
|
286
|
-
return typeof
|
|
285
|
+
var b = o ? o.displayName || o.name : "", C = b ? ae(b) : "";
|
|
286
|
+
return typeof o == "function" && Ee.set(o, C), C;
|
|
287
287
|
}
|
|
288
|
-
function ve(
|
|
289
|
-
return Ke(
|
|
288
|
+
function ve(o, p, k) {
|
|
289
|
+
return Ke(o, !1);
|
|
290
290
|
}
|
|
291
|
-
function $e(
|
|
292
|
-
var p =
|
|
291
|
+
function $e(o) {
|
|
292
|
+
var p = o.prototype;
|
|
293
293
|
return !!(p && p.isReactComponent);
|
|
294
294
|
}
|
|
295
|
-
function te(
|
|
296
|
-
if (
|
|
295
|
+
function te(o, p, k) {
|
|
296
|
+
if (o == null)
|
|
297
297
|
return "";
|
|
298
|
-
if (typeof
|
|
299
|
-
return Ke(
|
|
300
|
-
if (typeof
|
|
301
|
-
return
|
|
302
|
-
switch (
|
|
298
|
+
if (typeof o == "function")
|
|
299
|
+
return Ke(o, $e(o));
|
|
300
|
+
if (typeof o == "string")
|
|
301
|
+
return ae(o);
|
|
302
|
+
switch (o) {
|
|
303
303
|
case x:
|
|
304
|
-
return
|
|
304
|
+
return ae("Suspense");
|
|
305
305
|
case h:
|
|
306
|
-
return
|
|
306
|
+
return ae("SuspenseList");
|
|
307
307
|
}
|
|
308
|
-
if (typeof
|
|
309
|
-
switch (
|
|
310
|
-
case
|
|
311
|
-
return ve(
|
|
312
|
-
case
|
|
313
|
-
return te(
|
|
314
|
-
case
|
|
315
|
-
var
|
|
308
|
+
if (typeof o == "object")
|
|
309
|
+
switch (o.$$typeof) {
|
|
310
|
+
case u:
|
|
311
|
+
return ve(o.render);
|
|
312
|
+
case w:
|
|
313
|
+
return te(o.type, p, k);
|
|
314
|
+
case g: {
|
|
315
|
+
var _ = o, S = _._payload, I = _._init;
|
|
316
316
|
try {
|
|
317
|
-
return te(
|
|
317
|
+
return te(I(S), p, k);
|
|
318
318
|
} catch {
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
return "";
|
|
323
323
|
}
|
|
324
|
-
var ke = Object.prototype.hasOwnProperty, Fe = {}, be =
|
|
325
|
-
function xe(
|
|
326
|
-
if (
|
|
327
|
-
var p =
|
|
324
|
+
var ke = Object.prototype.hasOwnProperty, Fe = {}, be = M.ReactDebugCurrentFrame;
|
|
325
|
+
function xe(o) {
|
|
326
|
+
if (o) {
|
|
327
|
+
var p = o._owner, k = te(o.type, o._source, p ? p.type : null);
|
|
328
328
|
be.setExtraStackFrame(k);
|
|
329
329
|
} else
|
|
330
330
|
be.setExtraStackFrame(null);
|
|
331
331
|
}
|
|
332
|
-
function Ue(
|
|
332
|
+
function Ue(o, p, k, _, S) {
|
|
333
333
|
{
|
|
334
|
-
var
|
|
335
|
-
for (var
|
|
336
|
-
if (
|
|
337
|
-
var
|
|
334
|
+
var I = Function.call.bind(ke);
|
|
335
|
+
for (var A in o)
|
|
336
|
+
if (I(o, A)) {
|
|
337
|
+
var v = void 0;
|
|
338
338
|
try {
|
|
339
|
-
if (typeof
|
|
340
|
-
var G = Error((
|
|
339
|
+
if (typeof o[A] != "function") {
|
|
340
|
+
var G = Error((_ || "React class") + ": " + k + " type `" + A + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof o[A] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
341
341
|
throw G.name = "Invariant Violation", G;
|
|
342
342
|
}
|
|
343
|
-
|
|
343
|
+
v = o[A](p, A, _, k, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
344
344
|
} catch (d) {
|
|
345
|
-
|
|
345
|
+
v = d;
|
|
346
346
|
}
|
|
347
|
-
|
|
347
|
+
v && !(v instanceof Error) && (xe(S), N("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", _ || "React class", k, A, typeof v), xe(null)), v instanceof Error && !(v.message in Fe) && (Fe[v.message] = !0, xe(S), N("Failed %s type: %s", k, v.message), xe(null));
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
var Rt = Array.isArray;
|
|
352
|
-
function
|
|
353
|
-
return Rt(
|
|
352
|
+
function He(o) {
|
|
353
|
+
return Rt(o);
|
|
354
354
|
}
|
|
355
|
-
function Yt(
|
|
355
|
+
function Yt(o) {
|
|
356
356
|
{
|
|
357
|
-
var p = typeof Symbol == "function" && Symbol.toStringTag, k = p &&
|
|
357
|
+
var p = typeof Symbol == "function" && Symbol.toStringTag, k = p && o[Symbol.toStringTag] || o.constructor.name || "Object";
|
|
358
358
|
return k;
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
function Qe(
|
|
361
|
+
function Qe(o) {
|
|
362
362
|
try {
|
|
363
|
-
return Re(
|
|
363
|
+
return Re(o), !1;
|
|
364
364
|
} catch {
|
|
365
365
|
return !0;
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
|
-
function Re(
|
|
369
|
-
return "" +
|
|
368
|
+
function Re(o) {
|
|
369
|
+
return "" + o;
|
|
370
370
|
}
|
|
371
|
-
function Te(
|
|
372
|
-
if (Qe(
|
|
373
|
-
return
|
|
371
|
+
function Te(o) {
|
|
372
|
+
if (Qe(o))
|
|
373
|
+
return N("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Yt(o)), Re(o);
|
|
374
374
|
}
|
|
375
|
-
var Q =
|
|
375
|
+
var Q = M.ReactCurrentOwner, Je = {
|
|
376
376
|
key: !0,
|
|
377
377
|
ref: !0,
|
|
378
378
|
__self: !0,
|
|
379
379
|
__source: !0
|
|
380
380
|
}, et, tt;
|
|
381
|
-
function nt(
|
|
382
|
-
if (ke.call(
|
|
383
|
-
var p = Object.getOwnPropertyDescriptor(
|
|
381
|
+
function nt(o) {
|
|
382
|
+
if (ke.call(o, "ref")) {
|
|
383
|
+
var p = Object.getOwnPropertyDescriptor(o, "ref").get;
|
|
384
384
|
if (p && p.isReactWarning)
|
|
385
385
|
return !1;
|
|
386
386
|
}
|
|
387
|
-
return
|
|
387
|
+
return o.ref !== void 0;
|
|
388
388
|
}
|
|
389
|
-
function At(
|
|
390
|
-
if (ke.call(
|
|
391
|
-
var p = Object.getOwnPropertyDescriptor(
|
|
389
|
+
function At(o) {
|
|
390
|
+
if (ke.call(o, "key")) {
|
|
391
|
+
var p = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
392
392
|
if (p && p.isReactWarning)
|
|
393
393
|
return !1;
|
|
394
394
|
}
|
|
395
|
-
return
|
|
395
|
+
return o.key !== void 0;
|
|
396
396
|
}
|
|
397
|
-
function
|
|
398
|
-
typeof
|
|
397
|
+
function Be(o, p) {
|
|
398
|
+
typeof o.ref == "string" && Q.current;
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function We(o, p) {
|
|
401
401
|
{
|
|
402
402
|
var k = function() {
|
|
403
|
-
et || (et = !0,
|
|
403
|
+
et || (et = !0, N("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", p));
|
|
404
404
|
};
|
|
405
|
-
k.isReactWarning = !0, Object.defineProperty(
|
|
405
|
+
k.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
406
406
|
get: k,
|
|
407
407
|
configurable: !0
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function le(o, p) {
|
|
412
412
|
{
|
|
413
413
|
var k = function() {
|
|
414
|
-
tt || (tt = !0,
|
|
414
|
+
tt || (tt = !0, N("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", p));
|
|
415
415
|
};
|
|
416
|
-
k.isReactWarning = !0, Object.defineProperty(
|
|
416
|
+
k.isReactWarning = !0, Object.defineProperty(o, "ref", {
|
|
417
417
|
get: k,
|
|
418
418
|
configurable: !0
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
var Ae = function(
|
|
423
|
-
var
|
|
422
|
+
var Ae = function(o, p, k, _, S, I, A) {
|
|
423
|
+
var v = {
|
|
424
424
|
// This tag allows us to uniquely identify this as a React Element
|
|
425
425
|
$$typeof: e,
|
|
426
426
|
// Built-in properties that belong on the element
|
|
427
|
-
type:
|
|
427
|
+
type: o,
|
|
428
428
|
key: p,
|
|
429
429
|
ref: k,
|
|
430
|
-
props:
|
|
430
|
+
props: A,
|
|
431
431
|
// Record the component responsible for creating this element.
|
|
432
|
-
_owner:
|
|
432
|
+
_owner: I
|
|
433
433
|
};
|
|
434
|
-
return
|
|
434
|
+
return v._store = {}, Object.defineProperty(v._store, "validated", {
|
|
435
435
|
configurable: !1,
|
|
436
436
|
enumerable: !1,
|
|
437
437
|
writable: !0,
|
|
438
438
|
value: !1
|
|
439
|
-
}), Object.defineProperty(
|
|
439
|
+
}), Object.defineProperty(v, "_self", {
|
|
440
440
|
configurable: !1,
|
|
441
441
|
enumerable: !1,
|
|
442
442
|
writable: !1,
|
|
443
|
-
value:
|
|
444
|
-
}), Object.defineProperty(
|
|
443
|
+
value: _
|
|
444
|
+
}), Object.defineProperty(v, "_source", {
|
|
445
445
|
configurable: !1,
|
|
446
446
|
enumerable: !1,
|
|
447
447
|
writable: !1,
|
|
448
448
|
value: S
|
|
449
|
-
}), Object.freeze && (Object.freeze(
|
|
449
|
+
}), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
|
|
450
450
|
};
|
|
451
|
-
function rt(
|
|
451
|
+
function rt(o, p, k, _, S) {
|
|
452
452
|
{
|
|
453
|
-
var
|
|
454
|
-
k !== void 0 && (Te(k),
|
|
455
|
-
for (
|
|
456
|
-
ke.call(p,
|
|
457
|
-
if (
|
|
458
|
-
var d =
|
|
459
|
-
for (
|
|
460
|
-
|
|
461
|
-
}
|
|
462
|
-
if (
|
|
463
|
-
var i = typeof
|
|
464
|
-
|
|
465
|
-
}
|
|
466
|
-
return Ae(
|
|
453
|
+
var I, A = {}, v = null, G = null;
|
|
454
|
+
k !== void 0 && (Te(k), v = "" + k), At(p) && (Te(p.key), v = "" + p.key), nt(p) && (G = p.ref, Be(p, S));
|
|
455
|
+
for (I in p)
|
|
456
|
+
ke.call(p, I) && !Je.hasOwnProperty(I) && (A[I] = p[I]);
|
|
457
|
+
if (o && o.defaultProps) {
|
|
458
|
+
var d = o.defaultProps;
|
|
459
|
+
for (I in d)
|
|
460
|
+
A[I] === void 0 && (A[I] = d[I]);
|
|
461
|
+
}
|
|
462
|
+
if (v || G) {
|
|
463
|
+
var i = typeof o == "function" ? o.displayName || o.name || "Unknown" : o;
|
|
464
|
+
v && We(A, i), G && le(A, i);
|
|
465
|
+
}
|
|
466
|
+
return Ae(o, v, G, S, _, Q.current, A);
|
|
467
467
|
}
|
|
468
468
|
}
|
|
469
|
-
var De =
|
|
470
|
-
function
|
|
471
|
-
if (
|
|
472
|
-
var p =
|
|
469
|
+
var De = M.ReactCurrentOwner, St = M.ReactDebugCurrentFrame;
|
|
470
|
+
function ce(o) {
|
|
471
|
+
if (o) {
|
|
472
|
+
var p = o._owner, k = te(o.type, o._source, p ? p.type : null);
|
|
473
473
|
St.setExtraStackFrame(k);
|
|
474
474
|
} else
|
|
475
475
|
St.setExtraStackFrame(null);
|
|
476
476
|
}
|
|
477
477
|
var Se;
|
|
478
478
|
Se = !1;
|
|
479
|
-
function it(
|
|
480
|
-
return typeof
|
|
479
|
+
function it(o) {
|
|
480
|
+
return typeof o == "object" && o !== null && o.$$typeof === e;
|
|
481
481
|
}
|
|
482
482
|
function Oe() {
|
|
483
483
|
{
|
|
484
484
|
if (De.current) {
|
|
485
|
-
var
|
|
486
|
-
if (
|
|
485
|
+
var o = ee(De.current.type);
|
|
486
|
+
if (o)
|
|
487
487
|
return `
|
|
488
488
|
|
|
489
|
-
Check the render method of \`` +
|
|
489
|
+
Check the render method of \`` + o + "`.";
|
|
490
490
|
}
|
|
491
491
|
return "";
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function Vt(o) {
|
|
495
495
|
return "";
|
|
496
496
|
}
|
|
497
497
|
var Ot = {};
|
|
498
|
-
function U(
|
|
498
|
+
function U(o) {
|
|
499
499
|
{
|
|
500
500
|
var p = Oe();
|
|
501
501
|
if (!p) {
|
|
502
|
-
var k = typeof
|
|
502
|
+
var k = typeof o == "string" ? o : o.displayName || o.name;
|
|
503
503
|
k && (p = `
|
|
504
504
|
|
|
505
505
|
Check the top-level render call using <` + k + ">.");
|
|
@@ -507,132 +507,132 @@ Check the top-level render call using <` + k + ">.");
|
|
|
507
507
|
return p;
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
|
-
function we(
|
|
510
|
+
function we(o, p) {
|
|
511
511
|
{
|
|
512
|
-
if (!
|
|
512
|
+
if (!o._store || o._store.validated || o.key != null)
|
|
513
513
|
return;
|
|
514
|
-
|
|
514
|
+
o._store.validated = !0;
|
|
515
515
|
var k = U(p);
|
|
516
516
|
if (Ot[k])
|
|
517
517
|
return;
|
|
518
518
|
Ot[k] = !0;
|
|
519
|
-
var
|
|
520
|
-
|
|
519
|
+
var _ = "";
|
|
520
|
+
o && o._owner && o._owner !== De.current && (_ = " It was passed a child from " + ee(o._owner.type) + "."), ce(o), N('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', k, _), ce(null);
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
-
function Ct(
|
|
523
|
+
function Ct(o, p) {
|
|
524
524
|
{
|
|
525
|
-
if (typeof
|
|
525
|
+
if (typeof o != "object")
|
|
526
526
|
return;
|
|
527
|
-
if (
|
|
528
|
-
for (var k = 0; k <
|
|
529
|
-
var
|
|
530
|
-
it(
|
|
527
|
+
if (He(o))
|
|
528
|
+
for (var k = 0; k < o.length; k++) {
|
|
529
|
+
var _ = o[k];
|
|
530
|
+
it(_) && we(_, p);
|
|
531
531
|
}
|
|
532
|
-
else if (it(
|
|
533
|
-
|
|
534
|
-
else if (
|
|
535
|
-
var S =
|
|
536
|
-
if (typeof S == "function" && S !==
|
|
537
|
-
for (var
|
|
538
|
-
it(
|
|
532
|
+
else if (it(o))
|
|
533
|
+
o._store && (o._store.validated = !0);
|
|
534
|
+
else if (o) {
|
|
535
|
+
var S = O(o);
|
|
536
|
+
if (typeof S == "function" && S !== o.entries)
|
|
537
|
+
for (var I = S.call(o), A; !(A = I.next()).done; )
|
|
538
|
+
it(A.value) && we(A.value, p);
|
|
539
539
|
}
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
-
function Lt(
|
|
542
|
+
function Lt(o) {
|
|
543
543
|
{
|
|
544
|
-
var p =
|
|
544
|
+
var p = o.type;
|
|
545
545
|
if (p == null || typeof p == "string")
|
|
546
546
|
return;
|
|
547
547
|
var k;
|
|
548
548
|
if (typeof p == "function")
|
|
549
549
|
k = p.propTypes;
|
|
550
|
-
else if (typeof p == "object" && (p.$$typeof ===
|
|
550
|
+
else if (typeof p == "object" && (p.$$typeof === u || // Note: Memo only checks outer props here.
|
|
551
551
|
// Inner props are checked in the reconciler.
|
|
552
|
-
p.$$typeof ===
|
|
552
|
+
p.$$typeof === w))
|
|
553
553
|
k = p.propTypes;
|
|
554
554
|
else
|
|
555
555
|
return;
|
|
556
556
|
if (k) {
|
|
557
|
-
var
|
|
558
|
-
Ue(k,
|
|
557
|
+
var _ = ee(p);
|
|
558
|
+
Ue(k, o.props, "prop", _, o);
|
|
559
559
|
} else if (p.PropTypes !== void 0 && !Se) {
|
|
560
560
|
Se = !0;
|
|
561
561
|
var S = ee(p);
|
|
562
|
-
|
|
562
|
+
N("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", S || "Unknown");
|
|
563
563
|
}
|
|
564
|
-
typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved &&
|
|
564
|
+
typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved && N("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
|
-
function ot(
|
|
567
|
+
function ot(o) {
|
|
568
568
|
{
|
|
569
|
-
for (var p = Object.keys(
|
|
570
|
-
var
|
|
571
|
-
if (
|
|
572
|
-
|
|
569
|
+
for (var p = Object.keys(o.props), k = 0; k < p.length; k++) {
|
|
570
|
+
var _ = p[k];
|
|
571
|
+
if (_ !== "children" && _ !== "key") {
|
|
572
|
+
ce(o), N("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", _), ce(null);
|
|
573
573
|
break;
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
|
|
576
|
+
o.ref !== null && (ce(o), N("Invalid attribute `ref` supplied to `React.Fragment`."), ce(null));
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
var st = {};
|
|
580
|
-
function at(
|
|
580
|
+
function at(o, p, k, _, S, I) {
|
|
581
581
|
{
|
|
582
|
-
var
|
|
583
|
-
if (!
|
|
584
|
-
var
|
|
585
|
-
(
|
|
586
|
-
var G =
|
|
587
|
-
G ?
|
|
582
|
+
var A = Gt(o);
|
|
583
|
+
if (!A) {
|
|
584
|
+
var v = "";
|
|
585
|
+
(o === void 0 || typeof o == "object" && o !== null && Object.keys(o).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
586
|
+
var G = Vt();
|
|
587
|
+
G ? v += G : v += Oe();
|
|
588
588
|
var d;
|
|
589
|
-
|
|
589
|
+
o === null ? d = "null" : He(o) ? d = "array" : o !== void 0 && o.$$typeof === e ? (d = "<" + (ee(o.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : d = typeof o, N("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, v);
|
|
590
590
|
}
|
|
591
|
-
var i = rt(
|
|
591
|
+
var i = rt(o, p, k, S, I);
|
|
592
592
|
if (i == null)
|
|
593
593
|
return i;
|
|
594
|
-
if (
|
|
594
|
+
if (A) {
|
|
595
595
|
var f = p.children;
|
|
596
596
|
if (f !== void 0)
|
|
597
|
-
if (
|
|
598
|
-
if (
|
|
597
|
+
if (_)
|
|
598
|
+
if (He(f)) {
|
|
599
599
|
for (var b = 0; b < f.length; b++)
|
|
600
|
-
Ct(f[b],
|
|
600
|
+
Ct(f[b], o);
|
|
601
601
|
Object.freeze && Object.freeze(f);
|
|
602
602
|
} else
|
|
603
|
-
|
|
603
|
+
N("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
604
604
|
else
|
|
605
|
-
Ct(f,
|
|
605
|
+
Ct(f, o);
|
|
606
606
|
}
|
|
607
607
|
if (ke.call(p, "key")) {
|
|
608
|
-
var
|
|
609
|
-
return
|
|
610
|
-
}),
|
|
611
|
-
if (!st[
|
|
612
|
-
var
|
|
613
|
-
|
|
608
|
+
var C = ee(o), L = Object.keys(p).filter(function(ue) {
|
|
609
|
+
return ue !== "key";
|
|
610
|
+
}), z = L.length > 0 ? "{key: someKey, " + L.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
611
|
+
if (!st[C + z]) {
|
|
612
|
+
var V = L.length > 0 ? "{" + L.join(": ..., ") + ": ...}" : "{}";
|
|
613
|
+
N(`A props object containing a "key" prop is being spread into JSX:
|
|
614
614
|
let props = %s;
|
|
615
615
|
<%s {...props} />
|
|
616
616
|
React keys must be passed directly to JSX without using spread:
|
|
617
617
|
let props = %s;
|
|
618
|
-
<%s key={someKey} {...props} />`,
|
|
618
|
+
<%s key={someKey} {...props} />`, z, C, V, C), st[C + z] = !0;
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
|
-
return
|
|
621
|
+
return o === n ? ot(i) : Lt(i), i;
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
|
-
function
|
|
625
|
-
return at(
|
|
624
|
+
function qt(o, p, k) {
|
|
625
|
+
return at(o, p, k, !0);
|
|
626
626
|
}
|
|
627
|
-
function ne(
|
|
628
|
-
return at(
|
|
627
|
+
function ne(o, p, k) {
|
|
628
|
+
return at(o, p, k, !1);
|
|
629
629
|
}
|
|
630
|
-
var _e = ne, It =
|
|
630
|
+
var _e = ne, It = qt;
|
|
631
631
|
ct.Fragment = n, ct.jsx = _e, ct.jsxs = It;
|
|
632
632
|
}()), ct;
|
|
633
633
|
}
|
|
634
634
|
process.env.NODE_ENV === "production" ? nn.exports = rr() : nn.exports = ir();
|
|
635
|
-
var
|
|
635
|
+
var y = nn.exports, Mn = {
|
|
636
636
|
color: void 0,
|
|
637
637
|
size: void 0,
|
|
638
638
|
className: void 0,
|
|
@@ -642,15 +642,15 @@ var _ = nn.exports, Mn = {
|
|
|
642
642
|
return Ce = Object.assign || function(l) {
|
|
643
643
|
for (var e, t = 1, n = arguments.length; t < n; t++) {
|
|
644
644
|
e = arguments[t];
|
|
645
|
-
for (var
|
|
645
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (l[r] = e[r]);
|
|
646
646
|
}
|
|
647
647
|
return l;
|
|
648
648
|
}, Ce.apply(this, arguments);
|
|
649
649
|
}, or = function(l, e) {
|
|
650
650
|
var t = {};
|
|
651
651
|
for (var n in l) Object.prototype.hasOwnProperty.call(l, n) && e.indexOf(n) < 0 && (t[n] = l[n]);
|
|
652
|
-
if (l != null && typeof Object.getOwnPropertySymbols == "function") for (var
|
|
653
|
-
e.indexOf(n[
|
|
652
|
+
if (l != null && typeof Object.getOwnPropertySymbols == "function") for (var r = 0, n = Object.getOwnPropertySymbols(l); r < n.length; r++)
|
|
653
|
+
e.indexOf(n[r]) < 0 && Object.prototype.propertyIsEnumerable.call(l, n[r]) && (t[n[r]] = l[n[r]]);
|
|
654
654
|
return t;
|
|
655
655
|
};
|
|
656
656
|
function jn(l) {
|
|
@@ -660,7 +660,7 @@ function jn(l) {
|
|
|
660
660
|
}, e.attr), jn(e.child));
|
|
661
661
|
});
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function ie(l) {
|
|
664
664
|
return function(e) {
|
|
665
665
|
return me.createElement(sr, Ce({
|
|
666
666
|
attr: Ce({}, l.attr)
|
|
@@ -669,18 +669,18 @@ function fe(l) {
|
|
|
669
669
|
}
|
|
670
670
|
function sr(l) {
|
|
671
671
|
var e = function(t) {
|
|
672
|
-
var n = l.attr,
|
|
673
|
-
return t.className && (
|
|
672
|
+
var n = l.attr, r = l.size, a = l.title, s = or(l, ["attr", "size", "title"]), c = r || t.size || "1em", u;
|
|
673
|
+
return t.className && (u = t.className), l.className && (u = (u ? u + " " : "") + l.className), me.createElement("svg", Ce({
|
|
674
674
|
stroke: "currentColor",
|
|
675
675
|
fill: "currentColor",
|
|
676
676
|
strokeWidth: "0"
|
|
677
|
-
}, t.attr, n,
|
|
678
|
-
className:
|
|
677
|
+
}, t.attr, n, s, {
|
|
678
|
+
className: u,
|
|
679
679
|
style: Ce(Ce({
|
|
680
680
|
color: l.color || t.color
|
|
681
681
|
}, t.style), l.style),
|
|
682
|
-
height:
|
|
683
|
-
width:
|
|
682
|
+
height: c,
|
|
683
|
+
width: c,
|
|
684
684
|
xmlns: "http://www.w3.org/2000/svg"
|
|
685
685
|
}), a && me.createElement("title", null, a), l.children);
|
|
686
686
|
};
|
|
@@ -689,129 +689,132 @@ function sr(l) {
|
|
|
689
689
|
}) : e(Mn);
|
|
690
690
|
}
|
|
691
691
|
function ar(l) {
|
|
692
|
-
return
|
|
692
|
+
return ie({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "48", d: "M112 244l144-144 144 144M256 120v292" } }] })(l);
|
|
693
693
|
}
|
|
694
694
|
function lr(l) {
|
|
695
|
-
return
|
|
695
|
+
return ie({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "32", d: "M416 128L192 384l-96-96" } }] })(l);
|
|
696
696
|
}
|
|
697
697
|
function cr(l) {
|
|
698
|
-
return
|
|
698
|
+
return ie({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "32", d: "M368 368L144 144m224 0L144 368" } }] })(l);
|
|
699
699
|
}
|
|
700
700
|
function ur(l) {
|
|
701
|
-
return
|
|
701
|
+
return ie({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "32", d: "M320 367.79h76c55 0 100-29.21 100-83.6s-53-81.47-96-83.6c-8.89-85.06-71-136.8-144-136.8-69 0-113.44 45.79-128 91.2-60 5.7-112 43.88-112 106.4s54 106.4 120 106.4h56" } }, { tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "32", d: "M320 255.79l-64-64-64 64m64 192.42V207.79" } }] })(l);
|
|
702
702
|
}
|
|
703
703
|
function fr(l) {
|
|
704
|
-
return
|
|
704
|
+
return ie({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "rect", attr: { width: "336", height: "336", x: "128", y: "128", fill: "none", strokeLinejoin: "round", strokeWidth: "32", rx: "57", ry: "57" } }, { tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "32", d: "M383.5 128l.5-24a56.16 56.16 0 00-56-56H112a64.19 64.19 0 00-64 64v216a56.16 56.16 0 0056 56h24" } }] })(l);
|
|
705
705
|
}
|
|
706
706
|
function pr(l) {
|
|
707
|
-
return
|
|
707
|
+
return ie({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeLinejoin: "round", strokeWidth: "32", d: "M416 221.25V416a48 48 0 01-48 48H144a48 48 0 01-48-48V96a48 48 0 0148-48h98.75a32 32 0 0122.62 9.37l141.26 141.26a32 32 0 019.37 22.62z" } }, { tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "32", d: "M256 56v120a32 32 0 0032 32h120m-232 80h160m-160 80h160" } }] })(l);
|
|
708
708
|
}
|
|
709
709
|
function hr(l) {
|
|
710
|
-
return
|
|
710
|
+
return ie({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "32", d: "M336 176h40a40 40 0 0140 40v208a40 40 0 01-40 40H136a40 40 0 01-40-40V216a40 40 0 0140-40h40" } }, { tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "32", d: "M176 272l80 80 80-80M256 48v288" } }] })(l);
|
|
711
711
|
}
|
|
712
712
|
function dr(l) {
|
|
713
|
-
return
|
|
713
|
+
return ie({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "32", d: "M160 136c0-30.62 4.51-61.61 16-88C99.57 81.27 48 159.32 48 248c0 119.29 96.71 216 216 216 88.68 0 166.73-51.57 200-128-26.39 11.49-57.38 16-88 16-119.29 0-216-96.71-216-216z" } }] })(l);
|
|
714
714
|
}
|
|
715
715
|
function mr(l) {
|
|
716
|
-
return
|
|
716
|
+
return ie({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeMiterlimit: "10", strokeWidth: "32", d: "M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192 192-86 192-192z" } }, { tag: "path", attr: { d: "M310.4 336H201.6a25.62 25.62 0 01-25.6-25.6V201.6a25.62 25.62 0 0125.6-25.6h108.8a25.62 25.62 0 0125.6 25.6v108.8a25.62 25.62 0 01-25.6 25.6z" } }] })(l);
|
|
717
717
|
}
|
|
718
718
|
function gr(l) {
|
|
719
|
-
return
|
|
719
|
+
return ie({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeMiterlimit: "10", strokeWidth: "32", d: "M256 48v48m0 320v48m147.08-355.08l-33.94 33.94M142.86 369.14l-33.94 33.94M464 256h-48m-320 0H48m355.08 147.08l-33.94-33.94M142.86 142.86l-33.94-33.94" } }, { tag: "circle", attr: { cx: "256", cy: "256", r: "80", fill: "none", strokeLinecap: "round", strokeMiterlimit: "10", strokeWidth: "32" } }] })(l);
|
|
720
720
|
}
|
|
721
721
|
function kr(l) {
|
|
722
|
-
return
|
|
722
|
+
return ie({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "32", d: "M126 192H56a8 8 0 00-8 8v112a8 8 0 008 8h69.65a15.93 15.93 0 0110.14 3.54l91.47 74.89A8 8 0 00240 392V120a8 8 0 00-12.74-6.43l-91.47 74.89A15 15 0 01126 192zm194 128c9.74-19.38 16-40.84 16-64 0-23.48-6-44.42-16-64m48 176c19.48-33.92 32-64.06 32-112s-12-77.74-32-112m48 272c30-46 48-91.43 48-160s-18-113-48-160" } }] })(l);
|
|
723
723
|
}
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
724
|
+
function br(l) {
|
|
725
|
+
return ie({ attr: { viewBox: "0 0 576 512" }, child: [{ tag: "path", attr: { d: "M288 288h-32v-64h32v64zm288-128v192H288v32H160v-32H0V160h576zm-416 32H32v128h64v-96h32v96h32V192zm160 0H192v160h64v-32h64V192zm224 0H352v128h64v-96h32v96h32v-96h32v96h32V192z" } }] })(l);
|
|
726
|
+
}
|
|
727
|
+
const xr = ({ onFileLoaded: l }) => {
|
|
728
|
+
const e = nr(null), [t, n] = ye(!1), [r, a] = ye(""), [s, c] = ye(!1), u = (m) => {
|
|
729
|
+
if (m.length > 0) {
|
|
730
|
+
const O = m[0];
|
|
731
|
+
x(O) ? h(O) : alert("Please upload a valid Markdown (.md) file.");
|
|
732
|
+
}
|
|
733
|
+
}, x = (m) => m.name.endsWith(".md") || m.name.endsWith(".markdown") || m.type === "text/markdown", h = (m) => {
|
|
734
|
+
const O = new FileReader();
|
|
735
|
+
O.onload = (M) => {
|
|
736
|
+
l({ name: m.name, content: M.target.result });
|
|
737
|
+
}, O.readAsText(m);
|
|
738
|
+
}, w = (m) => {
|
|
739
|
+
m.preventDefault(), m.stopPropagation(), m.type === "dragenter" || m.type === "dragover" ? n(!0) : (m.type === "dragleave" || m.type === "drop") && n(!1);
|
|
740
|
+
}, g = (m) => {
|
|
741
|
+
m.preventDefault(), m.stopPropagation(), n(!1), m.dataTransfer.files && m.dataTransfer.files[0] && u(m.dataTransfer.files);
|
|
742
|
+
}, E = async () => {
|
|
743
|
+
const m = r.trim();
|
|
744
|
+
if (m) {
|
|
745
|
+
c(!0);
|
|
743
746
|
try {
|
|
744
|
-
const
|
|
745
|
-
if (!
|
|
746
|
-
throw new Error(`HTTP error! status: ${
|
|
747
|
-
const
|
|
748
|
-
let K =
|
|
749
|
-
K.includes("?") && (K = K.split("?")[0]), l({ name: K, content:
|
|
750
|
-
} catch (
|
|
751
|
-
console.error("Fetch error:",
|
|
747
|
+
const O = T(m), M = await fetch(O);
|
|
748
|
+
if (!M.ok)
|
|
749
|
+
throw new Error(`HTTP error! status: ${M.status}`);
|
|
750
|
+
const N = await M.text();
|
|
751
|
+
let K = m.substring(m.lastIndexOf("/") + 1) || "remote-file.md";
|
|
752
|
+
K.includes("?") && (K = K.split("?")[0]), l({ name: K, content: N });
|
|
753
|
+
} catch (O) {
|
|
754
|
+
console.error("Fetch error:", O), alert(`Failed to load Markdown from URL.
|
|
752
755
|
|
|
753
756
|
Note: This might be due to CORS restrictions. Try a raw GitHub URL.`);
|
|
754
757
|
} finally {
|
|
755
|
-
|
|
758
|
+
c(!1);
|
|
756
759
|
}
|
|
757
760
|
}
|
|
758
|
-
},
|
|
761
|
+
}, T = (m) => {
|
|
759
762
|
try {
|
|
760
|
-
if (new URL(
|
|
761
|
-
return
|
|
763
|
+
if (new URL(m).hostname === "github.com" && m.includes("/blob/"))
|
|
764
|
+
return m.replace("github.com", "raw.githubusercontent.com").replace("/blob/", "/");
|
|
762
765
|
} catch {
|
|
763
766
|
}
|
|
764
|
-
return
|
|
767
|
+
return m;
|
|
765
768
|
};
|
|
766
|
-
return /* @__PURE__ */
|
|
769
|
+
return /* @__PURE__ */ y.jsxs(
|
|
767
770
|
"section",
|
|
768
771
|
{
|
|
769
772
|
className: `upload-zone ${t ? "drag-active" : ""}`,
|
|
770
773
|
onClick: () => e.current.click(),
|
|
771
|
-
onDragEnter:
|
|
772
|
-
onDragLeave:
|
|
773
|
-
onDragOver:
|
|
774
|
-
onDrop:
|
|
774
|
+
onDragEnter: w,
|
|
775
|
+
onDragLeave: w,
|
|
776
|
+
onDragOver: w,
|
|
777
|
+
onDrop: g,
|
|
775
778
|
id: "upload-area",
|
|
776
779
|
children: [
|
|
777
|
-
/* @__PURE__ */
|
|
780
|
+
/* @__PURE__ */ y.jsx(
|
|
778
781
|
"input",
|
|
779
782
|
{
|
|
780
783
|
type: "file",
|
|
781
784
|
ref: e,
|
|
782
785
|
accept: ".md,.markdown",
|
|
783
786
|
hidden: !0,
|
|
784
|
-
onChange: (
|
|
787
|
+
onChange: (m) => u(m.target.files)
|
|
785
788
|
}
|
|
786
789
|
),
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
/* @__PURE__ */
|
|
789
|
-
/* @__PURE__ */
|
|
790
|
-
/* @__PURE__ */
|
|
790
|
+
/* @__PURE__ */ y.jsxs("div", { className: "upload-content", children: [
|
|
791
|
+
/* @__PURE__ */ y.jsx("div", { className: "icon-wrapper", children: /* @__PURE__ */ y.jsx(ur, {}) }),
|
|
792
|
+
/* @__PURE__ */ y.jsx("h2", { children: "Drop your Markdown file here" }),
|
|
793
|
+
/* @__PURE__ */ y.jsxs("p", { children: [
|
|
791
794
|
"or ",
|
|
792
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ y.jsx("span", { className: "browse-btn", children: "browse files" })
|
|
793
796
|
] }),
|
|
794
|
-
/* @__PURE__ */
|
|
795
|
-
/* @__PURE__ */
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
+
/* @__PURE__ */ y.jsx("div", { className: "divider", children: /* @__PURE__ */ y.jsx("span", { children: "OR" }) }),
|
|
798
|
+
/* @__PURE__ */ y.jsxs("div", { className: "url-input-container", onClick: (m) => m.stopPropagation(), children: [
|
|
799
|
+
/* @__PURE__ */ y.jsx(
|
|
797
800
|
"input",
|
|
798
801
|
{
|
|
799
802
|
type: "url",
|
|
800
803
|
id: "url-input",
|
|
801
804
|
placeholder: "Paste a raw Markdown URL...",
|
|
802
805
|
spellCheck: "false",
|
|
803
|
-
value:
|
|
804
|
-
onChange: (
|
|
805
|
-
onKeyDown: (
|
|
806
|
+
value: r,
|
|
807
|
+
onChange: (m) => a(m.target.value),
|
|
808
|
+
onKeyDown: (m) => m.key === "Enter" && E()
|
|
806
809
|
}
|
|
807
810
|
),
|
|
808
|
-
/* @__PURE__ */
|
|
811
|
+
/* @__PURE__ */ y.jsx("button", { id: "url-btn", onClick: E, disabled: s, children: s ? "..." : "Go" })
|
|
809
812
|
] }),
|
|
810
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ y.jsxs("p", { className: "sub-text", children: [
|
|
811
814
|
"Supports ",
|
|
812
|
-
/* @__PURE__ */
|
|
815
|
+
/* @__PURE__ */ y.jsx("span", { style: { color: "aqua" }, children: ".md" }),
|
|
813
816
|
" and ",
|
|
814
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ y.jsx("span", { style: { color: "aqua" }, children: ".markdown" })
|
|
815
818
|
] })
|
|
816
819
|
] })
|
|
817
820
|
]
|
|
@@ -836,33 +839,33 @@ let Me = cn();
|
|
|
836
839
|
function zn(l) {
|
|
837
840
|
Me = l;
|
|
838
841
|
}
|
|
839
|
-
const $n = /[&<>"']/,
|
|
842
|
+
const $n = /[&<>"']/, Tr = new RegExp($n.source, "g"), Fn = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, wr = new RegExp(Fn.source, "g"), _r = {
|
|
840
843
|
"&": "&",
|
|
841
844
|
"<": "<",
|
|
842
845
|
">": ">",
|
|
843
846
|
'"': """,
|
|
844
847
|
"'": "'"
|
|
845
|
-
}, yn = (l) =>
|
|
848
|
+
}, yn = (l) => _r[l];
|
|
846
849
|
function J(l, e) {
|
|
847
850
|
if (e) {
|
|
848
851
|
if ($n.test(l))
|
|
849
|
-
return l.replace(
|
|
852
|
+
return l.replace(Tr, yn);
|
|
850
853
|
} else if (Fn.test(l))
|
|
851
|
-
return l.replace(
|
|
854
|
+
return l.replace(wr, yn);
|
|
852
855
|
return l;
|
|
853
856
|
}
|
|
854
|
-
const
|
|
855
|
-
function
|
|
856
|
-
return l.replace(
|
|
857
|
+
const yr = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
|
|
858
|
+
function Er(l) {
|
|
859
|
+
return l.replace(yr, (e, t) => (t = t.toLowerCase(), t === "colon" ? ":" : t.charAt(0) === "#" ? t.charAt(1) === "x" ? String.fromCharCode(parseInt(t.substring(2), 16)) : String.fromCharCode(+t.substring(1)) : ""));
|
|
857
860
|
}
|
|
858
|
-
const
|
|
861
|
+
const vr = /(^|[^\[])\^/g;
|
|
859
862
|
function P(l, e) {
|
|
860
863
|
let t = typeof l == "string" ? l : l.source;
|
|
861
864
|
e = e || "";
|
|
862
865
|
const n = {
|
|
863
|
-
replace: (
|
|
864
|
-
let
|
|
865
|
-
return
|
|
866
|
+
replace: (r, a) => {
|
|
867
|
+
let s = typeof a == "string" ? a : a.source;
|
|
868
|
+
return s = s.replace(vr, "$1"), t = t.replace(r, s), n;
|
|
866
869
|
},
|
|
867
870
|
getRegex: () => new RegExp(t, e)
|
|
868
871
|
};
|
|
@@ -878,33 +881,33 @@ function En(l) {
|
|
|
878
881
|
}
|
|
879
882
|
const gt = { exec: () => null };
|
|
880
883
|
function vn(l, e) {
|
|
881
|
-
const t = l.replace(/\|/g, (a,
|
|
882
|
-
let
|
|
883
|
-
for (; --x >= 0 &&
|
|
884
|
-
|
|
885
|
-
return
|
|
884
|
+
const t = l.replace(/\|/g, (a, s, c) => {
|
|
885
|
+
let u = !1, x = s;
|
|
886
|
+
for (; --x >= 0 && c[x] === "\\"; )
|
|
887
|
+
u = !u;
|
|
888
|
+
return u ? "|" : " |";
|
|
886
889
|
}), n = t.split(/ \|/);
|
|
887
|
-
let
|
|
890
|
+
let r = 0;
|
|
888
891
|
if (n[0].trim() || n.shift(), n.length > 0 && !n[n.length - 1].trim() && n.pop(), e)
|
|
889
892
|
if (n.length > e)
|
|
890
893
|
n.splice(e);
|
|
891
894
|
else
|
|
892
895
|
for (; n.length < e; )
|
|
893
896
|
n.push("");
|
|
894
|
-
for (;
|
|
895
|
-
n[
|
|
897
|
+
for (; r < n.length; r++)
|
|
898
|
+
n[r] = n[r].trim().replace(/\\\|/g, "|");
|
|
896
899
|
return n;
|
|
897
900
|
}
|
|
898
901
|
function Pt(l, e, t) {
|
|
899
902
|
const n = l.length;
|
|
900
903
|
if (n === 0)
|
|
901
904
|
return "";
|
|
902
|
-
let
|
|
903
|
-
for (;
|
|
904
|
-
|
|
905
|
-
return l.slice(0, n -
|
|
905
|
+
let r = 0;
|
|
906
|
+
for (; r < n && l.charAt(n - r - 1) === e; )
|
|
907
|
+
r++;
|
|
908
|
+
return l.slice(0, n - r);
|
|
906
909
|
}
|
|
907
|
-
function
|
|
910
|
+
function Rr(l, e) {
|
|
908
911
|
if (l.indexOf(e[1]) === -1)
|
|
909
912
|
return -1;
|
|
910
913
|
let t = 0;
|
|
@@ -918,49 +921,49 @@ function vr(l, e) {
|
|
|
918
921
|
return -1;
|
|
919
922
|
}
|
|
920
923
|
function Rn(l, e, t, n) {
|
|
921
|
-
const
|
|
924
|
+
const r = e.href, a = e.title ? J(e.title) : null, s = l[1].replace(/\\([\[\]])/g, "$1");
|
|
922
925
|
if (l[0].charAt(0) !== "!") {
|
|
923
926
|
n.state.inLink = !0;
|
|
924
|
-
const
|
|
927
|
+
const c = {
|
|
925
928
|
type: "link",
|
|
926
929
|
raw: t,
|
|
927
|
-
href:
|
|
930
|
+
href: r,
|
|
928
931
|
title: a,
|
|
929
|
-
text:
|
|
930
|
-
tokens: n.inlineTokens(
|
|
932
|
+
text: s,
|
|
933
|
+
tokens: n.inlineTokens(s)
|
|
931
934
|
};
|
|
932
|
-
return n.state.inLink = !1,
|
|
935
|
+
return n.state.inLink = !1, c;
|
|
933
936
|
}
|
|
934
937
|
return {
|
|
935
938
|
type: "image",
|
|
936
939
|
raw: t,
|
|
937
|
-
href:
|
|
940
|
+
href: r,
|
|
938
941
|
title: a,
|
|
939
|
-
text: J(
|
|
942
|
+
text: J(s)
|
|
940
943
|
};
|
|
941
944
|
}
|
|
942
|
-
function
|
|
945
|
+
function Ar(l, e) {
|
|
943
946
|
const t = l.match(/^(\s+)(?:```)/);
|
|
944
947
|
if (t === null)
|
|
945
948
|
return e;
|
|
946
949
|
const n = t[1];
|
|
947
950
|
return e.split(`
|
|
948
|
-
`).map((
|
|
949
|
-
const a =
|
|
951
|
+
`).map((r) => {
|
|
952
|
+
const a = r.match(/^\s+/);
|
|
950
953
|
if (a === null)
|
|
951
|
-
return
|
|
952
|
-
const [
|
|
953
|
-
return
|
|
954
|
+
return r;
|
|
955
|
+
const [s] = a;
|
|
956
|
+
return s.length >= n.length ? r.slice(n.length) : r;
|
|
954
957
|
}).join(`
|
|
955
958
|
`);
|
|
956
959
|
}
|
|
957
960
|
class $t {
|
|
958
961
|
// set by the lexer
|
|
959
962
|
constructor(e) {
|
|
960
|
-
|
|
961
|
-
|
|
963
|
+
j(this, "options");
|
|
964
|
+
j(this, "rules");
|
|
962
965
|
// set by the lexer
|
|
963
|
-
|
|
966
|
+
j(this, "lexer");
|
|
964
967
|
this.options = e || Me;
|
|
965
968
|
}
|
|
966
969
|
space(e) {
|
|
@@ -987,12 +990,12 @@ class $t {
|
|
|
987
990
|
fences(e) {
|
|
988
991
|
const t = this.rules.block.fences.exec(e);
|
|
989
992
|
if (t) {
|
|
990
|
-
const n = t[0],
|
|
993
|
+
const n = t[0], r = Ar(n, t[3] || "");
|
|
991
994
|
return {
|
|
992
995
|
type: "code",
|
|
993
996
|
raw: n,
|
|
994
997
|
lang: t[2] ? t[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : t[2],
|
|
995
|
-
text:
|
|
998
|
+
text: r
|
|
996
999
|
};
|
|
997
1000
|
}
|
|
998
1001
|
}
|
|
@@ -1001,8 +1004,8 @@ class $t {
|
|
|
1001
1004
|
if (t) {
|
|
1002
1005
|
let n = t[2].trim();
|
|
1003
1006
|
if (/#$/.test(n)) {
|
|
1004
|
-
const
|
|
1005
|
-
(this.options.pedantic || !
|
|
1007
|
+
const r = Pt(n, "#");
|
|
1008
|
+
(this.options.pedantic || !r || / $/.test(r)) && (n = r.trim());
|
|
1006
1009
|
}
|
|
1007
1010
|
return {
|
|
1008
1011
|
type: "heading",
|
|
@@ -1025,10 +1028,10 @@ class $t {
|
|
|
1025
1028
|
const t = this.rules.block.blockquote.exec(e);
|
|
1026
1029
|
if (t) {
|
|
1027
1030
|
const n = Pt(t[0].replace(/^ *>[ \t]?/gm, ""), `
|
|
1028
|
-
`),
|
|
1031
|
+
`), r = this.lexer.state.top;
|
|
1029
1032
|
this.lexer.state.top = !0;
|
|
1030
1033
|
const a = this.lexer.blockTokens(n);
|
|
1031
|
-
return this.lexer.state.top =
|
|
1034
|
+
return this.lexer.state.top = r, {
|
|
1032
1035
|
type: "blockquote",
|
|
1033
1036
|
raw: t[0],
|
|
1034
1037
|
tokens: a,
|
|
@@ -1040,65 +1043,65 @@ class $t {
|
|
|
1040
1043
|
let t = this.rules.block.list.exec(e);
|
|
1041
1044
|
if (t) {
|
|
1042
1045
|
let n = t[1].trim();
|
|
1043
|
-
const
|
|
1046
|
+
const r = n.length > 1, a = {
|
|
1044
1047
|
type: "list",
|
|
1045
1048
|
raw: "",
|
|
1046
|
-
ordered:
|
|
1047
|
-
start:
|
|
1049
|
+
ordered: r,
|
|
1050
|
+
start: r ? +n.slice(0, -1) : "",
|
|
1048
1051
|
loose: !1,
|
|
1049
1052
|
items: []
|
|
1050
1053
|
};
|
|
1051
|
-
n =
|
|
1052
|
-
const
|
|
1053
|
-
let
|
|
1054
|
+
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
1055
|
+
const s = new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);
|
|
1056
|
+
let c = "", u = "", x = !1;
|
|
1054
1057
|
for (; e; ) {
|
|
1055
1058
|
let h = !1;
|
|
1056
|
-
if (!(t =
|
|
1059
|
+
if (!(t = s.exec(e)) || this.rules.block.hr.test(e))
|
|
1057
1060
|
break;
|
|
1058
|
-
|
|
1059
|
-
let
|
|
1060
|
-
`, 1)[0].replace(/^\t+/, (
|
|
1061
|
-
`, 1)[0],
|
|
1062
|
-
this.options.pedantic ? (
|
|
1063
|
-
let
|
|
1064
|
-
if (!
|
|
1065
|
-
`, e = e.substring(
|
|
1066
|
-
const
|
|
1061
|
+
c = t[0], e = e.substring(c.length);
|
|
1062
|
+
let w = t[2].split(`
|
|
1063
|
+
`, 1)[0].replace(/^\t+/, (M) => " ".repeat(3 * M.length)), g = e.split(`
|
|
1064
|
+
`, 1)[0], E = 0;
|
|
1065
|
+
this.options.pedantic ? (E = 2, u = w.trimStart()) : (E = t[2].search(/[^ ]/), E = E > 4 ? 1 : E, u = w.slice(E), E += t[1].length);
|
|
1066
|
+
let T = !1;
|
|
1067
|
+
if (!w && /^ *$/.test(g) && (c += g + `
|
|
1068
|
+
`, e = e.substring(g.length + 1), h = !0), !h) {
|
|
1069
|
+
const M = new RegExp(`^ {0,${Math.min(3, E - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), N = new RegExp(`^ {0,${Math.min(3, E - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), K = new RegExp(`^ {0,${Math.min(3, E - 1)}}(?:\`\`\`|~~~)`), H = new RegExp(`^ {0,${Math.min(3, E - 1)}}#`);
|
|
1067
1070
|
for (; e; ) {
|
|
1068
|
-
const
|
|
1071
|
+
const oe = e.split(`
|
|
1069
1072
|
`, 1)[0];
|
|
1070
|
-
if (
|
|
1073
|
+
if (g = oe, this.options.pedantic && (g = g.replace(/^ {1,4}(?=( {4})*[^ ])/g, " ")), K.test(g) || H.test(g) || M.test(g) || N.test(e))
|
|
1071
1074
|
break;
|
|
1072
|
-
if (
|
|
1073
|
-
|
|
1074
|
-
` +
|
|
1075
|
+
if (g.search(/[^ ]/) >= E || !g.trim())
|
|
1076
|
+
u += `
|
|
1077
|
+
` + g.slice(E);
|
|
1075
1078
|
else {
|
|
1076
|
-
if (
|
|
1079
|
+
if (T || w.search(/[^ ]/) >= 4 || K.test(w) || H.test(w) || N.test(w))
|
|
1077
1080
|
break;
|
|
1078
|
-
|
|
1079
|
-
` +
|
|
1081
|
+
u += `
|
|
1082
|
+
` + g;
|
|
1080
1083
|
}
|
|
1081
|
-
!
|
|
1082
|
-
`, e = e.substring(
|
|
1084
|
+
!T && !g.trim() && (T = !0), c += oe + `
|
|
1085
|
+
`, e = e.substring(oe.length + 1), w = g.slice(E);
|
|
1083
1086
|
}
|
|
1084
1087
|
}
|
|
1085
|
-
a.loose || (x ? a.loose = !0 : /\n *\n *$/.test(
|
|
1086
|
-
let
|
|
1087
|
-
this.options.gfm && (
|
|
1088
|
+
a.loose || (x ? a.loose = !0 : /\n *\n *$/.test(c) && (x = !0));
|
|
1089
|
+
let m = null, O;
|
|
1090
|
+
this.options.gfm && (m = /^\[[ xX]\] /.exec(u), m && (O = m[0] !== "[ ] ", u = u.replace(/^\[[ xX]\] +/, ""))), a.items.push({
|
|
1088
1091
|
type: "list_item",
|
|
1089
|
-
raw:
|
|
1090
|
-
task: !!
|
|
1091
|
-
checked:
|
|
1092
|
+
raw: c,
|
|
1093
|
+
task: !!m,
|
|
1094
|
+
checked: O,
|
|
1092
1095
|
loose: !1,
|
|
1093
|
-
text:
|
|
1096
|
+
text: u,
|
|
1094
1097
|
tokens: []
|
|
1095
|
-
}), a.raw +=
|
|
1098
|
+
}), a.raw += c;
|
|
1096
1099
|
}
|
|
1097
|
-
a.items[a.items.length - 1].raw =
|
|
1100
|
+
a.items[a.items.length - 1].raw = c.trimEnd(), a.items[a.items.length - 1].text = u.trimEnd(), a.raw = a.raw.trimEnd();
|
|
1098
1101
|
for (let h = 0; h < a.items.length; h++)
|
|
1099
1102
|
if (this.lexer.state.top = !1, a.items[h].tokens = this.lexer.blockTokens(a.items[h].text, []), !a.loose) {
|
|
1100
|
-
const
|
|
1101
|
-
a.loose =
|
|
1103
|
+
const w = a.items[h].tokens.filter((E) => E.type === "space"), g = w.length > 0 && w.some((E) => /\n.*\n/.test(E.raw));
|
|
1104
|
+
a.loose = g;
|
|
1102
1105
|
}
|
|
1103
1106
|
if (a.loose)
|
|
1104
1107
|
for (let h = 0; h < a.items.length; h++)
|
|
@@ -1120,12 +1123,12 @@ class $t {
|
|
|
1120
1123
|
def(e) {
|
|
1121
1124
|
const t = this.rules.block.def.exec(e);
|
|
1122
1125
|
if (t) {
|
|
1123
|
-
const n = t[1].toLowerCase().replace(/\s+/g, " "),
|
|
1126
|
+
const n = t[1].toLowerCase().replace(/\s+/g, " "), r = t[2] ? t[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", a = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
|
|
1124
1127
|
return {
|
|
1125
1128
|
type: "def",
|
|
1126
1129
|
tag: n,
|
|
1127
1130
|
raw: t[0],
|
|
1128
|
-
href:
|
|
1131
|
+
href: r,
|
|
1129
1132
|
title: a
|
|
1130
1133
|
};
|
|
1131
1134
|
}
|
|
@@ -1134,28 +1137,28 @@ class $t {
|
|
|
1134
1137
|
const t = this.rules.block.table.exec(e);
|
|
1135
1138
|
if (!t || !/[:|]/.test(t[2]))
|
|
1136
1139
|
return;
|
|
1137
|
-
const n = vn(t[1]),
|
|
1138
|
-
`) : [],
|
|
1140
|
+
const n = vn(t[1]), r = t[2].replace(/^\||\| *$/g, "").split("|"), a = t[3] && t[3].trim() ? t[3].replace(/\n[ \t]*$/, "").split(`
|
|
1141
|
+
`) : [], s = {
|
|
1139
1142
|
type: "table",
|
|
1140
1143
|
raw: t[0],
|
|
1141
1144
|
header: [],
|
|
1142
1145
|
align: [],
|
|
1143
1146
|
rows: []
|
|
1144
1147
|
};
|
|
1145
|
-
if (n.length ===
|
|
1146
|
-
for (const
|
|
1147
|
-
/^ *-+: *$/.test(
|
|
1148
|
-
for (const
|
|
1149
|
-
|
|
1150
|
-
text: u,
|
|
1151
|
-
tokens: this.lexer.inline(u)
|
|
1152
|
-
});
|
|
1153
|
-
for (const u of a)
|
|
1154
|
-
r.rows.push(vn(u, r.header.length).map((c) => ({
|
|
1148
|
+
if (n.length === r.length) {
|
|
1149
|
+
for (const c of r)
|
|
1150
|
+
/^ *-+: *$/.test(c) ? s.align.push("right") : /^ *:-+: *$/.test(c) ? s.align.push("center") : /^ *:-+ *$/.test(c) ? s.align.push("left") : s.align.push(null);
|
|
1151
|
+
for (const c of n)
|
|
1152
|
+
s.header.push({
|
|
1155
1153
|
text: c,
|
|
1156
1154
|
tokens: this.lexer.inline(c)
|
|
1155
|
+
});
|
|
1156
|
+
for (const c of a)
|
|
1157
|
+
s.rows.push(vn(c, s.header.length).map((u) => ({
|
|
1158
|
+
text: u,
|
|
1159
|
+
tokens: this.lexer.inline(u)
|
|
1157
1160
|
})));
|
|
1158
|
-
return
|
|
1161
|
+
return s;
|
|
1159
1162
|
}
|
|
1160
1163
|
}
|
|
1161
1164
|
lheading(e) {
|
|
@@ -1220,24 +1223,24 @@ class $t {
|
|
|
1220
1223
|
if (!this.options.pedantic && /^</.test(n)) {
|
|
1221
1224
|
if (!/>$/.test(n))
|
|
1222
1225
|
return;
|
|
1223
|
-
const
|
|
1224
|
-
if ((n.length -
|
|
1226
|
+
const s = Pt(n.slice(0, -1), "\\");
|
|
1227
|
+
if ((n.length - s.length) % 2 === 0)
|
|
1225
1228
|
return;
|
|
1226
1229
|
} else {
|
|
1227
|
-
const
|
|
1228
|
-
if (
|
|
1229
|
-
const
|
|
1230
|
-
t[2] = t[2].substring(0,
|
|
1230
|
+
const s = Rr(t[2], "()");
|
|
1231
|
+
if (s > -1) {
|
|
1232
|
+
const u = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + s;
|
|
1233
|
+
t[2] = t[2].substring(0, s), t[0] = t[0].substring(0, u).trim(), t[3] = "";
|
|
1231
1234
|
}
|
|
1232
1235
|
}
|
|
1233
|
-
let
|
|
1236
|
+
let r = t[2], a = "";
|
|
1234
1237
|
if (this.options.pedantic) {
|
|
1235
|
-
const
|
|
1236
|
-
|
|
1238
|
+
const s = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);
|
|
1239
|
+
s && (r = s[1], a = s[3]);
|
|
1237
1240
|
} else
|
|
1238
1241
|
a = t[3] ? t[3].slice(1, -1) : "";
|
|
1239
|
-
return
|
|
1240
|
-
href:
|
|
1242
|
+
return r = r.trim(), /^</.test(r) && (this.options.pedantic && !/>$/.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), Rn(t, {
|
|
1243
|
+
href: r && r.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
1241
1244
|
title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
|
|
1242
1245
|
}, t[0], this.lexer);
|
|
1243
1246
|
}
|
|
@@ -1245,55 +1248,55 @@ class $t {
|
|
|
1245
1248
|
reflink(e, t) {
|
|
1246
1249
|
let n;
|
|
1247
1250
|
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
1248
|
-
const
|
|
1251
|
+
const r = (n[2] || n[1]).replace(/\s+/g, " "), a = t[r.toLowerCase()];
|
|
1249
1252
|
if (!a) {
|
|
1250
|
-
const
|
|
1253
|
+
const s = n[0].charAt(0);
|
|
1251
1254
|
return {
|
|
1252
1255
|
type: "text",
|
|
1253
|
-
raw:
|
|
1254
|
-
text:
|
|
1256
|
+
raw: s,
|
|
1257
|
+
text: s
|
|
1255
1258
|
};
|
|
1256
1259
|
}
|
|
1257
1260
|
return Rn(n, a, n[0], this.lexer);
|
|
1258
1261
|
}
|
|
1259
1262
|
}
|
|
1260
1263
|
emStrong(e, t, n = "") {
|
|
1261
|
-
let
|
|
1262
|
-
if (!
|
|
1264
|
+
let r = this.rules.inline.emStrongLDelim.exec(e);
|
|
1265
|
+
if (!r || r[3] && n.match(/[\p{L}\p{N}]/u))
|
|
1263
1266
|
return;
|
|
1264
|
-
if (!(
|
|
1265
|
-
const
|
|
1266
|
-
let
|
|
1267
|
-
const
|
|
1268
|
-
for (
|
|
1269
|
-
if (
|
|
1267
|
+
if (!(r[1] || r[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
|
|
1268
|
+
const s = [...r[0]].length - 1;
|
|
1269
|
+
let c, u, x = s, h = 0;
|
|
1270
|
+
const w = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
1271
|
+
for (w.lastIndex = 0, t = t.slice(-1 * e.length + s); (r = w.exec(t)) != null; ) {
|
|
1272
|
+
if (c = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !c)
|
|
1270
1273
|
continue;
|
|
1271
|
-
if (
|
|
1272
|
-
x +=
|
|
1274
|
+
if (u = [...c].length, r[3] || r[4]) {
|
|
1275
|
+
x += u;
|
|
1273
1276
|
continue;
|
|
1274
|
-
} else if ((
|
|
1275
|
-
h +=
|
|
1277
|
+
} else if ((r[5] || r[6]) && s % 3 && !((s + u) % 3)) {
|
|
1278
|
+
h += u;
|
|
1276
1279
|
continue;
|
|
1277
1280
|
}
|
|
1278
|
-
if (x -=
|
|
1281
|
+
if (x -= u, x > 0)
|
|
1279
1282
|
continue;
|
|
1280
|
-
|
|
1281
|
-
const
|
|
1282
|
-
if (Math.min(
|
|
1283
|
-
const
|
|
1283
|
+
u = Math.min(u, u + x + h);
|
|
1284
|
+
const g = [...r[0]][0].length, E = e.slice(0, s + r.index + g + u);
|
|
1285
|
+
if (Math.min(s, u) % 2) {
|
|
1286
|
+
const m = E.slice(1, -1);
|
|
1284
1287
|
return {
|
|
1285
1288
|
type: "em",
|
|
1286
|
-
raw:
|
|
1287
|
-
text:
|
|
1288
|
-
tokens: this.lexer.inlineTokens(
|
|
1289
|
+
raw: E,
|
|
1290
|
+
text: m,
|
|
1291
|
+
tokens: this.lexer.inlineTokens(m)
|
|
1289
1292
|
};
|
|
1290
1293
|
}
|
|
1291
|
-
const
|
|
1294
|
+
const T = E.slice(2, -2);
|
|
1292
1295
|
return {
|
|
1293
1296
|
type: "strong",
|
|
1294
|
-
raw:
|
|
1295
|
-
text:
|
|
1296
|
-
tokens: this.lexer.inlineTokens(
|
|
1297
|
+
raw: E,
|
|
1298
|
+
text: T,
|
|
1299
|
+
tokens: this.lexer.inlineTokens(T)
|
|
1297
1300
|
};
|
|
1298
1301
|
}
|
|
1299
1302
|
}
|
|
@@ -1302,8 +1305,8 @@ class $t {
|
|
|
1302
1305
|
const t = this.rules.inline.code.exec(e);
|
|
1303
1306
|
if (t) {
|
|
1304
1307
|
let n = t[2].replace(/\n/g, " ");
|
|
1305
|
-
const
|
|
1306
|
-
return
|
|
1308
|
+
const r = /[^ ]/.test(n), a = /^ /.test(n) && / $/.test(n);
|
|
1309
|
+
return r && a && (n = n.substring(1, n.length - 1)), n = J(n, !0), {
|
|
1307
1310
|
type: "codespan",
|
|
1308
1311
|
raw: t[0],
|
|
1309
1312
|
text: n
|
|
@@ -1331,12 +1334,12 @@ class $t {
|
|
|
1331
1334
|
autolink(e) {
|
|
1332
1335
|
const t = this.rules.inline.autolink.exec(e);
|
|
1333
1336
|
if (t) {
|
|
1334
|
-
let n,
|
|
1335
|
-
return t[2] === "@" ? (n = J(t[1]),
|
|
1337
|
+
let n, r;
|
|
1338
|
+
return t[2] === "@" ? (n = J(t[1]), r = "mailto:" + n) : (n = J(t[1]), r = n), {
|
|
1336
1339
|
type: "link",
|
|
1337
1340
|
raw: t[0],
|
|
1338
1341
|
text: n,
|
|
1339
|
-
href:
|
|
1342
|
+
href: r,
|
|
1340
1343
|
tokens: [
|
|
1341
1344
|
{
|
|
1342
1345
|
type: "text",
|
|
@@ -1351,26 +1354,26 @@ class $t {
|
|
|
1351
1354
|
var n;
|
|
1352
1355
|
let t;
|
|
1353
1356
|
if (t = this.rules.inline.url.exec(e)) {
|
|
1354
|
-
let
|
|
1357
|
+
let r, a;
|
|
1355
1358
|
if (t[2] === "@")
|
|
1356
|
-
|
|
1359
|
+
r = J(t[0]), a = "mailto:" + r;
|
|
1357
1360
|
else {
|
|
1358
|
-
let
|
|
1361
|
+
let s;
|
|
1359
1362
|
do
|
|
1360
|
-
|
|
1361
|
-
while (
|
|
1362
|
-
|
|
1363
|
+
s = t[0], t[0] = ((n = this.rules.inline._backpedal.exec(t[0])) == null ? void 0 : n[0]) ?? "";
|
|
1364
|
+
while (s !== t[0]);
|
|
1365
|
+
r = J(t[0]), t[1] === "www." ? a = "http://" + t[0] : a = t[0];
|
|
1363
1366
|
}
|
|
1364
1367
|
return {
|
|
1365
1368
|
type: "link",
|
|
1366
1369
|
raw: t[0],
|
|
1367
|
-
text:
|
|
1370
|
+
text: r,
|
|
1368
1371
|
href: a,
|
|
1369
1372
|
tokens: [
|
|
1370
1373
|
{
|
|
1371
1374
|
type: "text",
|
|
1372
|
-
raw:
|
|
1373
|
-
text:
|
|
1375
|
+
raw: r,
|
|
1376
|
+
text: r
|
|
1374
1377
|
}
|
|
1375
1378
|
]
|
|
1376
1379
|
};
|
|
@@ -1388,25 +1391,25 @@ class $t {
|
|
|
1388
1391
|
}
|
|
1389
1392
|
}
|
|
1390
1393
|
}
|
|
1391
|
-
const
|
|
1392
|
-
blockquote:
|
|
1393
|
-
code:
|
|
1394
|
-
def:
|
|
1395
|
-
fences:
|
|
1396
|
-
heading:
|
|
1394
|
+
const Sr = /^(?: *(?:\n|$))+/, Or = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, Cr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, bt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Lr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Un = /(?:[*+-]|\d{1,9}[.)])/, Hn = P(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, Un).getRegex(), un = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Ir = /^[^\n]+/, fn = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Dr = P(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", fn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Pr = P(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Un).getRegex(), Ht = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", pn = /<!--(?!-?>)[\s\S]*?(?:-->|$)/, Nr = P("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", "i").replace("comment", pn).replace("tag", Ht).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Bn = P(un).replace("hr", bt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ht).getRegex(), Mr = P(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Bn).getRegex(), hn = {
|
|
1395
|
+
blockquote: Mr,
|
|
1396
|
+
code: Or,
|
|
1397
|
+
def: Dr,
|
|
1398
|
+
fences: Cr,
|
|
1399
|
+
heading: Lr,
|
|
1397
1400
|
hr: bt,
|
|
1398
|
-
html:
|
|
1399
|
-
lheading:
|
|
1400
|
-
list:
|
|
1401
|
-
newline:
|
|
1402
|
-
paragraph:
|
|
1401
|
+
html: Nr,
|
|
1402
|
+
lheading: Hn,
|
|
1403
|
+
list: Pr,
|
|
1404
|
+
newline: Sr,
|
|
1405
|
+
paragraph: Bn,
|
|
1403
1406
|
table: gt,
|
|
1404
|
-
text:
|
|
1405
|
-
}, An = P("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", bt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",
|
|
1407
|
+
text: Ir
|
|
1408
|
+
}, An = P("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", bt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ht).getRegex(), jr = {
|
|
1406
1409
|
...hn,
|
|
1407
1410
|
table: An,
|
|
1408
|
-
paragraph: P(un).replace("hr", bt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", An).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",
|
|
1409
|
-
},
|
|
1411
|
+
paragraph: P(un).replace("hr", bt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", An).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Ht).getRegex()
|
|
1412
|
+
}, zr = {
|
|
1410
1413
|
...hn,
|
|
1411
1414
|
html: P(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", pn).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
1412
1415
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
@@ -1415,60 +1418,60 @@ const Ar = /^(?: *(?:\n|$))+/, Sr = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, Or =
|
|
|
1415
1418
|
// fences not supported
|
|
1416
1419
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
1417
1420
|
paragraph: P(un).replace("hr", bt).replace("heading", ` *#{1,6} *[^
|
|
1418
|
-
]`).replace("lheading",
|
|
1419
|
-
},
|
|
1421
|
+
]`).replace("lheading", Hn).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
1422
|
+
}, Wn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, $r = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Gn = /^( {2,}|\\)\n(?!\s*$)/, Fr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, xt = "\\p{P}$+<=>`^|~", Ur = P(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, xt).getRegex(), Hr = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, Br = P(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, xt).getRegex(), Wr = P("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, xt).getRegex(), Gr = P("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, xt).getRegex(), Yr = P(/\\([punct])/, "gu").replace(/punct/g, xt).getRegex(), Vr = P(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), qr = P(pn).replace("(?:-->|$)", "-->").getRegex(), Zr = P("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", qr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Ft = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Xr = P(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", Ft).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Yn = P(/^!?\[(label)\]\[(ref)\]/).replace("label", Ft).replace("ref", fn).getRegex(), Vn = P(/^!?\[(ref)\](?:\[\])?/).replace("ref", fn).getRegex(), Kr = P("reflink|nolink(?!\\()", "g").replace("reflink", Yn).replace("nolink", Vn).getRegex(), dn = {
|
|
1420
1423
|
_backpedal: gt,
|
|
1421
1424
|
// only used for GFM url
|
|
1422
|
-
anyPunctuation:
|
|
1423
|
-
autolink:
|
|
1424
|
-
blockSkip:
|
|
1425
|
+
anyPunctuation: Yr,
|
|
1426
|
+
autolink: Vr,
|
|
1427
|
+
blockSkip: Hr,
|
|
1425
1428
|
br: Gn,
|
|
1426
|
-
code:
|
|
1429
|
+
code: $r,
|
|
1427
1430
|
del: gt,
|
|
1428
1431
|
emStrongLDelim: Br,
|
|
1429
1432
|
emStrongRDelimAst: Wr,
|
|
1430
|
-
emStrongRDelimUnd:
|
|
1431
|
-
escape:
|
|
1432
|
-
link:
|
|
1433
|
-
nolink:
|
|
1434
|
-
punctuation:
|
|
1433
|
+
emStrongRDelimUnd: Gr,
|
|
1434
|
+
escape: Wn,
|
|
1435
|
+
link: Xr,
|
|
1436
|
+
nolink: Vn,
|
|
1437
|
+
punctuation: Ur,
|
|
1435
1438
|
reflink: Yn,
|
|
1436
|
-
reflinkSearch:
|
|
1437
|
-
tag:
|
|
1438
|
-
text:
|
|
1439
|
+
reflinkSearch: Kr,
|
|
1440
|
+
tag: Zr,
|
|
1441
|
+
text: Fr,
|
|
1439
1442
|
url: gt
|
|
1440
|
-
},
|
|
1443
|
+
}, Qr = {
|
|
1441
1444
|
...dn,
|
|
1442
1445
|
link: P(/^!?\[(label)\]\((.*?)\)/).replace("label", Ft).getRegex(),
|
|
1443
1446
|
reflink: P(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Ft).getRegex()
|
|
1444
1447
|
}, rn = {
|
|
1445
1448
|
...dn,
|
|
1446
|
-
escape: P(
|
|
1449
|
+
escape: P(Wn).replace("])", "~|])").getRegex(),
|
|
1447
1450
|
url: P(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
|
|
1448
1451
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1449
1452
|
del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
|
|
1450
1453
|
text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
|
|
1451
|
-
},
|
|
1454
|
+
}, Jr = {
|
|
1452
1455
|
...rn,
|
|
1453
1456
|
br: P(Gn).replace("{2,}", "*").getRegex(),
|
|
1454
1457
|
text: P(rn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
1455
1458
|
}, Nt = {
|
|
1456
1459
|
normal: hn,
|
|
1457
|
-
gfm:
|
|
1458
|
-
pedantic:
|
|
1460
|
+
gfm: jr,
|
|
1461
|
+
pedantic: zr
|
|
1459
1462
|
}, ut = {
|
|
1460
1463
|
normal: dn,
|
|
1461
1464
|
gfm: rn,
|
|
1462
|
-
breaks:
|
|
1463
|
-
pedantic:
|
|
1465
|
+
breaks: Jr,
|
|
1466
|
+
pedantic: Qr
|
|
1464
1467
|
};
|
|
1465
1468
|
class he {
|
|
1466
1469
|
constructor(e) {
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1470
|
+
j(this, "tokens");
|
|
1471
|
+
j(this, "options");
|
|
1472
|
+
j(this, "state");
|
|
1473
|
+
j(this, "tokenizer");
|
|
1474
|
+
j(this, "inlineQueue");
|
|
1472
1475
|
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || Me, this.options.tokenizer = this.options.tokenizer || new $t(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
1473
1476
|
inLink: !1,
|
|
1474
1477
|
inRawBlock: !1,
|
|
@@ -1514,19 +1517,19 @@ class he {
|
|
|
1514
1517
|
return this.inlineQueue = [], this.tokens;
|
|
1515
1518
|
}
|
|
1516
1519
|
blockTokens(e, t = []) {
|
|
1517
|
-
this.options.pedantic ? e = e.replace(/\t/g, " ").replace(/^ +$/gm, "") : e = e.replace(/^( *)(\t+)/gm, (
|
|
1518
|
-
let n,
|
|
1520
|
+
this.options.pedantic ? e = e.replace(/\t/g, " ").replace(/^ +$/gm, "") : e = e.replace(/^( *)(\t+)/gm, (c, u, x) => u + " ".repeat(x.length));
|
|
1521
|
+
let n, r, a, s;
|
|
1519
1522
|
for (; e; )
|
|
1520
|
-
if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((
|
|
1523
|
+
if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((c) => (n = c.call({ lexer: this }, e, t)) ? (e = e.substring(n.raw.length), t.push(n), !0) : !1))) {
|
|
1521
1524
|
if (n = this.tokenizer.space(e)) {
|
|
1522
1525
|
e = e.substring(n.raw.length), n.raw.length === 1 && t.length > 0 ? t[t.length - 1].raw += `
|
|
1523
1526
|
` : t.push(n);
|
|
1524
1527
|
continue;
|
|
1525
1528
|
}
|
|
1526
1529
|
if (n = this.tokenizer.code(e)) {
|
|
1527
|
-
e = e.substring(n.raw.length),
|
|
1528
|
-
` + n.raw,
|
|
1529
|
-
` + n.text, this.inlineQueue[this.inlineQueue.length - 1].src =
|
|
1530
|
+
e = e.substring(n.raw.length), r = t[t.length - 1], r && (r.type === "paragraph" || r.type === "text") ? (r.raw += `
|
|
1531
|
+
` + n.raw, r.text += `
|
|
1532
|
+
` + n.text, this.inlineQueue[this.inlineQueue.length - 1].src = r.text) : t.push(n);
|
|
1530
1533
|
continue;
|
|
1531
1534
|
}
|
|
1532
1535
|
if (n = this.tokenizer.fences(e)) {
|
|
@@ -1554,9 +1557,9 @@ class he {
|
|
|
1554
1557
|
continue;
|
|
1555
1558
|
}
|
|
1556
1559
|
if (n = this.tokenizer.def(e)) {
|
|
1557
|
-
e = e.substring(n.raw.length),
|
|
1558
|
-
` + n.raw,
|
|
1559
|
-
` + n.raw, this.inlineQueue[this.inlineQueue.length - 1].src =
|
|
1560
|
+
e = e.substring(n.raw.length), r = t[t.length - 1], r && (r.type === "paragraph" || r.type === "text") ? (r.raw += `
|
|
1561
|
+
` + n.raw, r.text += `
|
|
1562
|
+
` + n.raw, this.inlineQueue[this.inlineQueue.length - 1].src = r.text) : this.tokens.links[n.tag] || (this.tokens.links[n.tag] = {
|
|
1560
1563
|
href: n.href,
|
|
1561
1564
|
title: n.title
|
|
1562
1565
|
});
|
|
@@ -1571,32 +1574,32 @@ class he {
|
|
|
1571
1574
|
continue;
|
|
1572
1575
|
}
|
|
1573
1576
|
if (a = e, this.options.extensions && this.options.extensions.startBlock) {
|
|
1574
|
-
let
|
|
1575
|
-
const
|
|
1577
|
+
let c = 1 / 0;
|
|
1578
|
+
const u = e.slice(1);
|
|
1576
1579
|
let x;
|
|
1577
1580
|
this.options.extensions.startBlock.forEach((h) => {
|
|
1578
|
-
x = h.call({ lexer: this },
|
|
1579
|
-
}),
|
|
1581
|
+
x = h.call({ lexer: this }, u), typeof x == "number" && x >= 0 && (c = Math.min(c, x));
|
|
1582
|
+
}), c < 1 / 0 && c >= 0 && (a = e.substring(0, c + 1));
|
|
1580
1583
|
}
|
|
1581
1584
|
if (this.state.top && (n = this.tokenizer.paragraph(a))) {
|
|
1582
|
-
|
|
1583
|
-
` + n.raw,
|
|
1584
|
-
` + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src =
|
|
1585
|
+
r = t[t.length - 1], s && r.type === "paragraph" ? (r.raw += `
|
|
1586
|
+
` + n.raw, r.text += `
|
|
1587
|
+
` + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = r.text) : t.push(n), s = a.length !== e.length, e = e.substring(n.raw.length);
|
|
1585
1588
|
continue;
|
|
1586
1589
|
}
|
|
1587
1590
|
if (n = this.tokenizer.text(e)) {
|
|
1588
|
-
e = e.substring(n.raw.length),
|
|
1589
|
-
` + n.raw,
|
|
1590
|
-
` + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src =
|
|
1591
|
+
e = e.substring(n.raw.length), r = t[t.length - 1], r && r.type === "text" ? (r.raw += `
|
|
1592
|
+
` + n.raw, r.text += `
|
|
1593
|
+
` + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = r.text) : t.push(n);
|
|
1591
1594
|
continue;
|
|
1592
1595
|
}
|
|
1593
1596
|
if (e) {
|
|
1594
|
-
const
|
|
1597
|
+
const c = "Infinite loop on byte: " + e.charCodeAt(0);
|
|
1595
1598
|
if (this.options.silent) {
|
|
1596
|
-
console.error(
|
|
1599
|
+
console.error(c);
|
|
1597
1600
|
break;
|
|
1598
1601
|
} else
|
|
1599
|
-
throw new Error(
|
|
1602
|
+
throw new Error(c);
|
|
1600
1603
|
}
|
|
1601
1604
|
}
|
|
1602
1605
|
return this.state.top = !0, t;
|
|
@@ -1608,25 +1611,25 @@ class he {
|
|
|
1608
1611
|
* Lexing/Compiling
|
|
1609
1612
|
*/
|
|
1610
1613
|
inlineTokens(e, t = []) {
|
|
1611
|
-
let n,
|
|
1614
|
+
let n, r, a, s = e, c, u, x;
|
|
1612
1615
|
if (this.tokens.links) {
|
|
1613
1616
|
const h = Object.keys(this.tokens.links);
|
|
1614
1617
|
if (h.length > 0)
|
|
1615
|
-
for (; (
|
|
1616
|
-
h.includes(
|
|
1618
|
+
for (; (c = this.tokenizer.rules.inline.reflinkSearch.exec(s)) != null; )
|
|
1619
|
+
h.includes(c[0].slice(c[0].lastIndexOf("[") + 1, -1)) && (s = s.slice(0, c.index) + "[" + "a".repeat(c[0].length - 2) + "]" + s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
1617
1620
|
}
|
|
1618
|
-
for (; (
|
|
1619
|
-
|
|
1620
|
-
for (; (
|
|
1621
|
-
|
|
1621
|
+
for (; (c = this.tokenizer.rules.inline.blockSkip.exec(s)) != null; )
|
|
1622
|
+
s = s.slice(0, c.index) + "[" + "a".repeat(c[0].length - 2) + "]" + s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
1623
|
+
for (; (c = this.tokenizer.rules.inline.anyPunctuation.exec(s)) != null; )
|
|
1624
|
+
s = s.slice(0, c.index) + "++" + s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
1622
1625
|
for (; e; )
|
|
1623
|
-
if (
|
|
1626
|
+
if (u || (x = ""), u = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((h) => (n = h.call({ lexer: this }, e, t)) ? (e = e.substring(n.raw.length), t.push(n), !0) : !1))) {
|
|
1624
1627
|
if (n = this.tokenizer.escape(e)) {
|
|
1625
1628
|
e = e.substring(n.raw.length), t.push(n);
|
|
1626
1629
|
continue;
|
|
1627
1630
|
}
|
|
1628
1631
|
if (n = this.tokenizer.tag(e)) {
|
|
1629
|
-
e = e.substring(n.raw.length),
|
|
1632
|
+
e = e.substring(n.raw.length), r = t[t.length - 1], r && n.type === "text" && r.type === "text" ? (r.raw += n.raw, r.text += n.text) : t.push(n);
|
|
1630
1633
|
continue;
|
|
1631
1634
|
}
|
|
1632
1635
|
if (n = this.tokenizer.link(e)) {
|
|
@@ -1634,10 +1637,10 @@ class he {
|
|
|
1634
1637
|
continue;
|
|
1635
1638
|
}
|
|
1636
1639
|
if (n = this.tokenizer.reflink(e, this.tokens.links)) {
|
|
1637
|
-
e = e.substring(n.raw.length),
|
|
1640
|
+
e = e.substring(n.raw.length), r = t[t.length - 1], r && n.type === "text" && r.type === "text" ? (r.raw += n.raw, r.text += n.text) : t.push(n);
|
|
1638
1641
|
continue;
|
|
1639
1642
|
}
|
|
1640
|
-
if (n = this.tokenizer.emStrong(e,
|
|
1643
|
+
if (n = this.tokenizer.emStrong(e, s, x)) {
|
|
1641
1644
|
e = e.substring(n.raw.length), t.push(n);
|
|
1642
1645
|
continue;
|
|
1643
1646
|
}
|
|
@@ -1663,14 +1666,14 @@ class he {
|
|
|
1663
1666
|
}
|
|
1664
1667
|
if (a = e, this.options.extensions && this.options.extensions.startInline) {
|
|
1665
1668
|
let h = 1 / 0;
|
|
1666
|
-
const
|
|
1667
|
-
let
|
|
1668
|
-
this.options.extensions.startInline.forEach((
|
|
1669
|
-
|
|
1669
|
+
const w = e.slice(1);
|
|
1670
|
+
let g;
|
|
1671
|
+
this.options.extensions.startInline.forEach((E) => {
|
|
1672
|
+
g = E.call({ lexer: this }, w), typeof g == "number" && g >= 0 && (h = Math.min(h, g));
|
|
1670
1673
|
}), h < 1 / 0 && h >= 0 && (a = e.substring(0, h + 1));
|
|
1671
1674
|
}
|
|
1672
1675
|
if (n = this.tokenizer.inlineText(a)) {
|
|
1673
|
-
e = e.substring(n.raw.length), n.raw.slice(-1) !== "_" && (x = n.raw.slice(-1)),
|
|
1676
|
+
e = e.substring(n.raw.length), n.raw.slice(-1) !== "_" && (x = n.raw.slice(-1)), u = !0, r = t[t.length - 1], r && r.type === "text" ? (r.raw += n.raw, r.text += n.text) : t.push(n);
|
|
1674
1677
|
continue;
|
|
1675
1678
|
}
|
|
1676
1679
|
if (e) {
|
|
@@ -1687,14 +1690,14 @@ class he {
|
|
|
1687
1690
|
}
|
|
1688
1691
|
class Ut {
|
|
1689
1692
|
constructor(e) {
|
|
1690
|
-
|
|
1693
|
+
j(this, "options");
|
|
1691
1694
|
this.options = e || Me;
|
|
1692
1695
|
}
|
|
1693
1696
|
code(e, t, n) {
|
|
1694
1697
|
var a;
|
|
1695
|
-
const
|
|
1698
|
+
const r = (a = (t || "").match(/^\S*/)) == null ? void 0 : a[0];
|
|
1696
1699
|
return e = e.replace(/\n$/, "") + `
|
|
1697
|
-
`,
|
|
1700
|
+
`, r ? '<pre><code class="language-' + J(r) + '">' + (n ? e : J(e, !0)) + `</code></pre>
|
|
1698
1701
|
` : "<pre><code>" + (n ? e : J(e, !0)) + `</code></pre>
|
|
1699
1702
|
`;
|
|
1700
1703
|
}
|
|
@@ -1715,9 +1718,9 @@ ${e}</blockquote>
|
|
|
1715
1718
|
`;
|
|
1716
1719
|
}
|
|
1717
1720
|
list(e, t, n) {
|
|
1718
|
-
const
|
|
1719
|
-
return "<" +
|
|
1720
|
-
` + e + "</" +
|
|
1721
|
+
const r = t ? "ol" : "ul", a = t && n !== 1 ? ' start="' + n + '"' : "";
|
|
1722
|
+
return "<" + r + a + `>
|
|
1723
|
+
` + e + "</" + r + `>
|
|
1721
1724
|
`;
|
|
1722
1725
|
}
|
|
1723
1726
|
listitem(e, t, n) {
|
|
@@ -1767,18 +1770,18 @@ ${e}</tr>
|
|
|
1767
1770
|
return `<del>${e}</del>`;
|
|
1768
1771
|
}
|
|
1769
1772
|
link(e, t, n) {
|
|
1770
|
-
const
|
|
1771
|
-
if (
|
|
1773
|
+
const r = En(e);
|
|
1774
|
+
if (r === null)
|
|
1772
1775
|
return n;
|
|
1773
|
-
e =
|
|
1776
|
+
e = r;
|
|
1774
1777
|
let a = '<a href="' + e + '"';
|
|
1775
1778
|
return t && (a += ' title="' + t + '"'), a += ">" + n + "</a>", a;
|
|
1776
1779
|
}
|
|
1777
1780
|
image(e, t, n) {
|
|
1778
|
-
const
|
|
1779
|
-
if (
|
|
1781
|
+
const r = En(e);
|
|
1782
|
+
if (r === null)
|
|
1780
1783
|
return n;
|
|
1781
|
-
e =
|
|
1784
|
+
e = r;
|
|
1782
1785
|
let a = `<img src="${e}" alt="${n}"`;
|
|
1783
1786
|
return t && (a += ` title="${t}"`), a += ">", a;
|
|
1784
1787
|
}
|
|
@@ -1818,9 +1821,9 @@ class mn {
|
|
|
1818
1821
|
}
|
|
1819
1822
|
class de {
|
|
1820
1823
|
constructor(e) {
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
+
j(this, "options");
|
|
1825
|
+
j(this, "renderer");
|
|
1826
|
+
j(this, "textRenderer");
|
|
1824
1827
|
this.options = e || Me, this.options.renderer = this.options.renderer || new Ut(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new mn();
|
|
1825
1828
|
}
|
|
1826
1829
|
/**
|
|
@@ -1840,12 +1843,12 @@ class de {
|
|
|
1840
1843
|
*/
|
|
1841
1844
|
parse(e, t = !0) {
|
|
1842
1845
|
let n = "";
|
|
1843
|
-
for (let
|
|
1844
|
-
const a = e[
|
|
1846
|
+
for (let r = 0; r < e.length; r++) {
|
|
1847
|
+
const a = e[r];
|
|
1845
1848
|
if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[a.type]) {
|
|
1846
|
-
const
|
|
1847
|
-
if (
|
|
1848
|
-
n +=
|
|
1849
|
+
const s = a, c = this.options.extensions.renderers[s.type].call({ parser: this }, s);
|
|
1850
|
+
if (c !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(s.type)) {
|
|
1851
|
+
n += c || "";
|
|
1849
1852
|
continue;
|
|
1850
1853
|
}
|
|
1851
1854
|
}
|
|
@@ -1857,78 +1860,78 @@ class de {
|
|
|
1857
1860
|
continue;
|
|
1858
1861
|
}
|
|
1859
1862
|
case "heading": {
|
|
1860
|
-
const
|
|
1861
|
-
n += this.renderer.heading(this.parseInline(
|
|
1863
|
+
const s = a;
|
|
1864
|
+
n += this.renderer.heading(this.parseInline(s.tokens), s.depth, Er(this.parseInline(s.tokens, this.textRenderer)));
|
|
1862
1865
|
continue;
|
|
1863
1866
|
}
|
|
1864
1867
|
case "code": {
|
|
1865
|
-
const
|
|
1866
|
-
n += this.renderer.code(
|
|
1868
|
+
const s = a;
|
|
1869
|
+
n += this.renderer.code(s.text, s.lang, !!s.escaped);
|
|
1867
1870
|
continue;
|
|
1868
1871
|
}
|
|
1869
1872
|
case "table": {
|
|
1870
|
-
const
|
|
1871
|
-
let
|
|
1872
|
-
for (let h = 0; h <
|
|
1873
|
-
|
|
1874
|
-
|
|
1873
|
+
const s = a;
|
|
1874
|
+
let c = "", u = "";
|
|
1875
|
+
for (let h = 0; h < s.header.length; h++)
|
|
1876
|
+
u += this.renderer.tablecell(this.parseInline(s.header[h].tokens), { header: !0, align: s.align[h] });
|
|
1877
|
+
c += this.renderer.tablerow(u);
|
|
1875
1878
|
let x = "";
|
|
1876
|
-
for (let h = 0; h <
|
|
1877
|
-
const
|
|
1878
|
-
|
|
1879
|
-
for (let
|
|
1880
|
-
|
|
1881
|
-
x += this.renderer.tablerow(
|
|
1879
|
+
for (let h = 0; h < s.rows.length; h++) {
|
|
1880
|
+
const w = s.rows[h];
|
|
1881
|
+
u = "";
|
|
1882
|
+
for (let g = 0; g < w.length; g++)
|
|
1883
|
+
u += this.renderer.tablecell(this.parseInline(w[g].tokens), { header: !1, align: s.align[g] });
|
|
1884
|
+
x += this.renderer.tablerow(u);
|
|
1882
1885
|
}
|
|
1883
|
-
n += this.renderer.table(
|
|
1886
|
+
n += this.renderer.table(c, x);
|
|
1884
1887
|
continue;
|
|
1885
1888
|
}
|
|
1886
1889
|
case "blockquote": {
|
|
1887
|
-
const
|
|
1888
|
-
n += this.renderer.blockquote(
|
|
1890
|
+
const s = a, c = this.parse(s.tokens);
|
|
1891
|
+
n += this.renderer.blockquote(c);
|
|
1889
1892
|
continue;
|
|
1890
1893
|
}
|
|
1891
1894
|
case "list": {
|
|
1892
|
-
const
|
|
1895
|
+
const s = a, c = s.ordered, u = s.start, x = s.loose;
|
|
1893
1896
|
let h = "";
|
|
1894
|
-
for (let
|
|
1895
|
-
const
|
|
1896
|
-
let
|
|
1897
|
-
if (
|
|
1898
|
-
const
|
|
1899
|
-
x ?
|
|
1897
|
+
for (let w = 0; w < s.items.length; w++) {
|
|
1898
|
+
const g = s.items[w], E = g.checked, T = g.task;
|
|
1899
|
+
let m = "";
|
|
1900
|
+
if (g.task) {
|
|
1901
|
+
const O = this.renderer.checkbox(!!E);
|
|
1902
|
+
x ? g.tokens.length > 0 && g.tokens[0].type === "paragraph" ? (g.tokens[0].text = O + " " + g.tokens[0].text, g.tokens[0].tokens && g.tokens[0].tokens.length > 0 && g.tokens[0].tokens[0].type === "text" && (g.tokens[0].tokens[0].text = O + " " + g.tokens[0].tokens[0].text)) : g.tokens.unshift({
|
|
1900
1903
|
type: "text",
|
|
1901
|
-
text:
|
|
1902
|
-
}) :
|
|
1904
|
+
text: O + " "
|
|
1905
|
+
}) : m += O + " ";
|
|
1903
1906
|
}
|
|
1904
|
-
|
|
1907
|
+
m += this.parse(g.tokens, x), h += this.renderer.listitem(m, T, !!E);
|
|
1905
1908
|
}
|
|
1906
|
-
n += this.renderer.list(h,
|
|
1909
|
+
n += this.renderer.list(h, c, u);
|
|
1907
1910
|
continue;
|
|
1908
1911
|
}
|
|
1909
1912
|
case "html": {
|
|
1910
|
-
const
|
|
1911
|
-
n += this.renderer.html(
|
|
1913
|
+
const s = a;
|
|
1914
|
+
n += this.renderer.html(s.text, s.block);
|
|
1912
1915
|
continue;
|
|
1913
1916
|
}
|
|
1914
1917
|
case "paragraph": {
|
|
1915
|
-
const
|
|
1916
|
-
n += this.renderer.paragraph(this.parseInline(
|
|
1918
|
+
const s = a;
|
|
1919
|
+
n += this.renderer.paragraph(this.parseInline(s.tokens));
|
|
1917
1920
|
continue;
|
|
1918
1921
|
}
|
|
1919
1922
|
case "text": {
|
|
1920
|
-
let
|
|
1921
|
-
for (;
|
|
1922
|
-
|
|
1923
|
-
` + (
|
|
1924
|
-
n += t ? this.renderer.paragraph(
|
|
1923
|
+
let s = a, c = s.tokens ? this.parseInline(s.tokens) : s.text;
|
|
1924
|
+
for (; r + 1 < e.length && e[r + 1].type === "text"; )
|
|
1925
|
+
s = e[++r], c += `
|
|
1926
|
+
` + (s.tokens ? this.parseInline(s.tokens) : s.text);
|
|
1927
|
+
n += t ? this.renderer.paragraph(c) : c;
|
|
1925
1928
|
continue;
|
|
1926
1929
|
}
|
|
1927
1930
|
default: {
|
|
1928
|
-
const
|
|
1931
|
+
const s = 'Token with "' + a.type + '" type was not found.';
|
|
1929
1932
|
if (this.options.silent)
|
|
1930
|
-
return console.error(
|
|
1931
|
-
throw new Error(
|
|
1933
|
+
return console.error(s), "";
|
|
1934
|
+
throw new Error(s);
|
|
1932
1935
|
}
|
|
1933
1936
|
}
|
|
1934
1937
|
}
|
|
@@ -1940,49 +1943,49 @@ class de {
|
|
|
1940
1943
|
parseInline(e, t) {
|
|
1941
1944
|
t = t || this.renderer;
|
|
1942
1945
|
let n = "";
|
|
1943
|
-
for (let
|
|
1944
|
-
const a = e[
|
|
1946
|
+
for (let r = 0; r < e.length; r++) {
|
|
1947
|
+
const a = e[r];
|
|
1945
1948
|
if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[a.type]) {
|
|
1946
|
-
const
|
|
1947
|
-
if (
|
|
1948
|
-
n +=
|
|
1949
|
+
const s = this.options.extensions.renderers[a.type].call({ parser: this }, a);
|
|
1950
|
+
if (s !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(a.type)) {
|
|
1951
|
+
n += s || "";
|
|
1949
1952
|
continue;
|
|
1950
1953
|
}
|
|
1951
1954
|
}
|
|
1952
1955
|
switch (a.type) {
|
|
1953
1956
|
case "escape": {
|
|
1954
|
-
const
|
|
1955
|
-
n += t.text(
|
|
1957
|
+
const s = a;
|
|
1958
|
+
n += t.text(s.text);
|
|
1956
1959
|
break;
|
|
1957
1960
|
}
|
|
1958
1961
|
case "html": {
|
|
1959
|
-
const
|
|
1960
|
-
n += t.html(
|
|
1962
|
+
const s = a;
|
|
1963
|
+
n += t.html(s.text);
|
|
1961
1964
|
break;
|
|
1962
1965
|
}
|
|
1963
1966
|
case "link": {
|
|
1964
|
-
const
|
|
1965
|
-
n += t.link(
|
|
1967
|
+
const s = a;
|
|
1968
|
+
n += t.link(s.href, s.title, this.parseInline(s.tokens, t));
|
|
1966
1969
|
break;
|
|
1967
1970
|
}
|
|
1968
1971
|
case "image": {
|
|
1969
|
-
const
|
|
1970
|
-
n += t.image(
|
|
1972
|
+
const s = a;
|
|
1973
|
+
n += t.image(s.href, s.title, s.text);
|
|
1971
1974
|
break;
|
|
1972
1975
|
}
|
|
1973
1976
|
case "strong": {
|
|
1974
|
-
const
|
|
1975
|
-
n += t.strong(this.parseInline(
|
|
1977
|
+
const s = a;
|
|
1978
|
+
n += t.strong(this.parseInline(s.tokens, t));
|
|
1976
1979
|
break;
|
|
1977
1980
|
}
|
|
1978
1981
|
case "em": {
|
|
1979
|
-
const
|
|
1980
|
-
n += t.em(this.parseInline(
|
|
1982
|
+
const s = a;
|
|
1983
|
+
n += t.em(this.parseInline(s.tokens, t));
|
|
1981
1984
|
break;
|
|
1982
1985
|
}
|
|
1983
1986
|
case "codespan": {
|
|
1984
|
-
const
|
|
1985
|
-
n += t.codespan(
|
|
1987
|
+
const s = a;
|
|
1988
|
+
n += t.codespan(s.text);
|
|
1986
1989
|
break;
|
|
1987
1990
|
}
|
|
1988
1991
|
case "br": {
|
|
@@ -1990,20 +1993,20 @@ class de {
|
|
|
1990
1993
|
break;
|
|
1991
1994
|
}
|
|
1992
1995
|
case "del": {
|
|
1993
|
-
const
|
|
1994
|
-
n += t.del(this.parseInline(
|
|
1996
|
+
const s = a;
|
|
1997
|
+
n += t.del(this.parseInline(s.tokens, t));
|
|
1995
1998
|
break;
|
|
1996
1999
|
}
|
|
1997
2000
|
case "text": {
|
|
1998
|
-
const
|
|
1999
|
-
n += t.text(
|
|
2001
|
+
const s = a;
|
|
2002
|
+
n += t.text(s.text);
|
|
2000
2003
|
break;
|
|
2001
2004
|
}
|
|
2002
2005
|
default: {
|
|
2003
|
-
const
|
|
2006
|
+
const s = 'Token with "' + a.type + '" type was not found.';
|
|
2004
2007
|
if (this.options.silent)
|
|
2005
|
-
return console.error(
|
|
2006
|
-
throw new Error(
|
|
2008
|
+
return console.error(s), "";
|
|
2009
|
+
throw new Error(s);
|
|
2007
2010
|
}
|
|
2008
2011
|
}
|
|
2009
2012
|
}
|
|
@@ -2012,7 +2015,7 @@ class de {
|
|
|
2012
2015
|
}
|
|
2013
2016
|
class kt {
|
|
2014
2017
|
constructor(e) {
|
|
2015
|
-
|
|
2018
|
+
j(this, "options");
|
|
2016
2019
|
this.options = e || Me;
|
|
2017
2020
|
}
|
|
2018
2021
|
/**
|
|
@@ -2034,55 +2037,55 @@ class kt {
|
|
|
2034
2037
|
return e;
|
|
2035
2038
|
}
|
|
2036
2039
|
}
|
|
2037
|
-
|
|
2040
|
+
j(kt, "passThroughHooks", /* @__PURE__ */ new Set([
|
|
2038
2041
|
"preprocess",
|
|
2039
2042
|
"postprocess",
|
|
2040
2043
|
"processAllTokens"
|
|
2041
2044
|
]));
|
|
2042
|
-
var Ne, on,
|
|
2043
|
-
class
|
|
2045
|
+
var Ne, on, qn;
|
|
2046
|
+
class ei {
|
|
2044
2047
|
constructor(...e) {
|
|
2045
2048
|
xn(this, Ne);
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2049
|
+
j(this, "defaults", cn());
|
|
2050
|
+
j(this, "options", this.setOptions);
|
|
2051
|
+
j(this, "parse", Dt(this, Ne, on).call(this, he.lex, de.parse));
|
|
2052
|
+
j(this, "parseInline", Dt(this, Ne, on).call(this, he.lexInline, de.parseInline));
|
|
2053
|
+
j(this, "Parser", de);
|
|
2054
|
+
j(this, "Renderer", Ut);
|
|
2055
|
+
j(this, "TextRenderer", mn);
|
|
2056
|
+
j(this, "Lexer", he);
|
|
2057
|
+
j(this, "Tokenizer", $t);
|
|
2058
|
+
j(this, "Hooks", kt);
|
|
2056
2059
|
this.use(...e);
|
|
2057
2060
|
}
|
|
2058
2061
|
/**
|
|
2059
2062
|
* Run callback for every token
|
|
2060
2063
|
*/
|
|
2061
2064
|
walkTokens(e, t) {
|
|
2062
|
-
var
|
|
2065
|
+
var r, a;
|
|
2063
2066
|
let n = [];
|
|
2064
|
-
for (const
|
|
2065
|
-
switch (n = n.concat(t.call(this,
|
|
2067
|
+
for (const s of e)
|
|
2068
|
+
switch (n = n.concat(t.call(this, s)), s.type) {
|
|
2066
2069
|
case "table": {
|
|
2067
|
-
const
|
|
2068
|
-
for (const
|
|
2069
|
-
n = n.concat(this.walkTokens(
|
|
2070
|
-
for (const
|
|
2071
|
-
for (const x of
|
|
2070
|
+
const c = s;
|
|
2071
|
+
for (const u of c.header)
|
|
2072
|
+
n = n.concat(this.walkTokens(u.tokens, t));
|
|
2073
|
+
for (const u of c.rows)
|
|
2074
|
+
for (const x of u)
|
|
2072
2075
|
n = n.concat(this.walkTokens(x.tokens, t));
|
|
2073
2076
|
break;
|
|
2074
2077
|
}
|
|
2075
2078
|
case "list": {
|
|
2076
|
-
const
|
|
2077
|
-
n = n.concat(this.walkTokens(
|
|
2079
|
+
const c = s;
|
|
2080
|
+
n = n.concat(this.walkTokens(c.items, t));
|
|
2078
2081
|
break;
|
|
2079
2082
|
}
|
|
2080
2083
|
default: {
|
|
2081
|
-
const
|
|
2082
|
-
(a = (
|
|
2083
|
-
const x = u
|
|
2084
|
+
const c = s;
|
|
2085
|
+
(a = (r = this.defaults.extensions) == null ? void 0 : r.childTokens) != null && a[c.type] ? this.defaults.extensions.childTokens[c.type].forEach((u) => {
|
|
2086
|
+
const x = c[u].flat(1 / 0);
|
|
2084
2087
|
n = n.concat(this.walkTokens(x, t));
|
|
2085
|
-
}) :
|
|
2088
|
+
}) : c.tokens && (n = n.concat(this.walkTokens(c.tokens, t)));
|
|
2086
2089
|
}
|
|
2087
2090
|
}
|
|
2088
2091
|
return n;
|
|
@@ -2090,82 +2093,82 @@ class Jr {
|
|
|
2090
2093
|
use(...e) {
|
|
2091
2094
|
const t = this.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
2092
2095
|
return e.forEach((n) => {
|
|
2093
|
-
const
|
|
2094
|
-
if (
|
|
2096
|
+
const r = { ...n };
|
|
2097
|
+
if (r.async = this.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach((a) => {
|
|
2095
2098
|
if (!a.name)
|
|
2096
2099
|
throw new Error("extension name required");
|
|
2097
2100
|
if ("renderer" in a) {
|
|
2098
|
-
const
|
|
2099
|
-
|
|
2100
|
-
let
|
|
2101
|
-
return
|
|
2101
|
+
const s = t.renderers[a.name];
|
|
2102
|
+
s ? t.renderers[a.name] = function(...c) {
|
|
2103
|
+
let u = a.renderer.apply(this, c);
|
|
2104
|
+
return u === !1 && (u = s.apply(this, c)), u;
|
|
2102
2105
|
} : t.renderers[a.name] = a.renderer;
|
|
2103
2106
|
}
|
|
2104
2107
|
if ("tokenizer" in a) {
|
|
2105
2108
|
if (!a.level || a.level !== "block" && a.level !== "inline")
|
|
2106
2109
|
throw new Error("extension level must be 'block' or 'inline'");
|
|
2107
|
-
const
|
|
2108
|
-
|
|
2110
|
+
const s = t[a.level];
|
|
2111
|
+
s ? s.unshift(a.tokenizer) : t[a.level] = [a.tokenizer], a.start && (a.level === "block" ? t.startBlock ? t.startBlock.push(a.start) : t.startBlock = [a.start] : a.level === "inline" && (t.startInline ? t.startInline.push(a.start) : t.startInline = [a.start]));
|
|
2109
2112
|
}
|
|
2110
2113
|
"childTokens" in a && a.childTokens && (t.childTokens[a.name] = a.childTokens);
|
|
2111
|
-
}),
|
|
2114
|
+
}), r.extensions = t), n.renderer) {
|
|
2112
2115
|
const a = this.defaults.renderer || new Ut(this.defaults);
|
|
2113
|
-
for (const
|
|
2114
|
-
if (!(
|
|
2115
|
-
throw new Error(`renderer '${
|
|
2116
|
-
if (
|
|
2116
|
+
for (const s in n.renderer) {
|
|
2117
|
+
if (!(s in a))
|
|
2118
|
+
throw new Error(`renderer '${s}' does not exist`);
|
|
2119
|
+
if (s === "options")
|
|
2117
2120
|
continue;
|
|
2118
|
-
const
|
|
2119
|
-
a[
|
|
2120
|
-
let
|
|
2121
|
-
return
|
|
2121
|
+
const c = s, u = n.renderer[c], x = a[c];
|
|
2122
|
+
a[c] = (...h) => {
|
|
2123
|
+
let w = u.apply(a, h);
|
|
2124
|
+
return w === !1 && (w = x.apply(a, h)), w || "";
|
|
2122
2125
|
};
|
|
2123
2126
|
}
|
|
2124
|
-
|
|
2127
|
+
r.renderer = a;
|
|
2125
2128
|
}
|
|
2126
2129
|
if (n.tokenizer) {
|
|
2127
2130
|
const a = this.defaults.tokenizer || new $t(this.defaults);
|
|
2128
|
-
for (const
|
|
2129
|
-
if (!(
|
|
2130
|
-
throw new Error(`tokenizer '${
|
|
2131
|
-
if (["options", "rules", "lexer"].includes(
|
|
2131
|
+
for (const s in n.tokenizer) {
|
|
2132
|
+
if (!(s in a))
|
|
2133
|
+
throw new Error(`tokenizer '${s}' does not exist`);
|
|
2134
|
+
if (["options", "rules", "lexer"].includes(s))
|
|
2132
2135
|
continue;
|
|
2133
|
-
const
|
|
2134
|
-
a[
|
|
2135
|
-
let
|
|
2136
|
-
return
|
|
2136
|
+
const c = s, u = n.tokenizer[c], x = a[c];
|
|
2137
|
+
a[c] = (...h) => {
|
|
2138
|
+
let w = u.apply(a, h);
|
|
2139
|
+
return w === !1 && (w = x.apply(a, h)), w;
|
|
2137
2140
|
};
|
|
2138
2141
|
}
|
|
2139
|
-
|
|
2142
|
+
r.tokenizer = a;
|
|
2140
2143
|
}
|
|
2141
2144
|
if (n.hooks) {
|
|
2142
2145
|
const a = this.defaults.hooks || new kt();
|
|
2143
|
-
for (const
|
|
2144
|
-
if (!(
|
|
2145
|
-
throw new Error(`hook '${
|
|
2146
|
-
if (
|
|
2146
|
+
for (const s in n.hooks) {
|
|
2147
|
+
if (!(s in a))
|
|
2148
|
+
throw new Error(`hook '${s}' does not exist`);
|
|
2149
|
+
if (s === "options")
|
|
2147
2150
|
continue;
|
|
2148
|
-
const
|
|
2149
|
-
kt.passThroughHooks.has(
|
|
2151
|
+
const c = s, u = n.hooks[c], x = a[c];
|
|
2152
|
+
kt.passThroughHooks.has(s) ? a[c] = (h) => {
|
|
2150
2153
|
if (this.defaults.async)
|
|
2151
|
-
return Promise.resolve(
|
|
2152
|
-
const
|
|
2153
|
-
return x.call(a,
|
|
2154
|
-
} : a[
|
|
2155
|
-
let
|
|
2156
|
-
return
|
|
2154
|
+
return Promise.resolve(u.call(a, h)).then((g) => x.call(a, g));
|
|
2155
|
+
const w = u.call(a, h);
|
|
2156
|
+
return x.call(a, w);
|
|
2157
|
+
} : a[c] = (...h) => {
|
|
2158
|
+
let w = u.apply(a, h);
|
|
2159
|
+
return w === !1 && (w = x.apply(a, h)), w;
|
|
2157
2160
|
};
|
|
2158
2161
|
}
|
|
2159
|
-
|
|
2162
|
+
r.hooks = a;
|
|
2160
2163
|
}
|
|
2161
2164
|
if (n.walkTokens) {
|
|
2162
|
-
const a = this.defaults.walkTokens,
|
|
2163
|
-
|
|
2164
|
-
let
|
|
2165
|
-
return
|
|
2165
|
+
const a = this.defaults.walkTokens, s = n.walkTokens;
|
|
2166
|
+
r.walkTokens = function(c) {
|
|
2167
|
+
let u = [];
|
|
2168
|
+
return u.push(s.call(this, c)), a && (u = u.concat(a.call(this, c))), u;
|
|
2166
2169
|
};
|
|
2167
2170
|
}
|
|
2168
|
-
this.defaults = { ...this.defaults, ...
|
|
2171
|
+
this.defaults = { ...this.defaults, ...r };
|
|
2169
2172
|
}), this;
|
|
2170
2173
|
}
|
|
2171
2174
|
setOptions(e) {
|
|
@@ -2179,77 +2182,77 @@ class Jr {
|
|
|
2179
2182
|
}
|
|
2180
2183
|
}
|
|
2181
2184
|
Ne = new WeakSet(), on = function(e, t) {
|
|
2182
|
-
return (n,
|
|
2183
|
-
const a = { ...
|
|
2184
|
-
this.defaults.async === !0 && a.async === !1 && (
|
|
2185
|
-
const
|
|
2185
|
+
return (n, r) => {
|
|
2186
|
+
const a = { ...r }, s = { ...this.defaults, ...a };
|
|
2187
|
+
this.defaults.async === !0 && a.async === !1 && (s.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), s.async = !0);
|
|
2188
|
+
const c = Dt(this, Ne, qn).call(this, !!s.silent, !!s.async);
|
|
2186
2189
|
if (typeof n > "u" || n === null)
|
|
2187
|
-
return
|
|
2190
|
+
return c(new Error("marked(): input parameter is undefined or null"));
|
|
2188
2191
|
if (typeof n != "string")
|
|
2189
|
-
return
|
|
2190
|
-
if (
|
|
2191
|
-
return Promise.resolve(
|
|
2192
|
+
return c(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
|
|
2193
|
+
if (s.hooks && (s.hooks.options = s), s.async)
|
|
2194
|
+
return Promise.resolve(s.hooks ? s.hooks.preprocess(n) : n).then((u) => e(u, s)).then((u) => s.hooks ? s.hooks.processAllTokens(u) : u).then((u) => s.walkTokens ? Promise.all(this.walkTokens(u, s.walkTokens)).then(() => u) : u).then((u) => t(u, s)).then((u) => s.hooks ? s.hooks.postprocess(u) : u).catch(c);
|
|
2192
2195
|
try {
|
|
2193
|
-
|
|
2194
|
-
let
|
|
2195
|
-
|
|
2196
|
-
let x = t(
|
|
2197
|
-
return
|
|
2198
|
-
} catch (
|
|
2199
|
-
return u
|
|
2196
|
+
s.hooks && (n = s.hooks.preprocess(n));
|
|
2197
|
+
let u = e(n, s);
|
|
2198
|
+
s.hooks && (u = s.hooks.processAllTokens(u)), s.walkTokens && this.walkTokens(u, s.walkTokens);
|
|
2199
|
+
let x = t(u, s);
|
|
2200
|
+
return s.hooks && (x = s.hooks.postprocess(x)), x;
|
|
2201
|
+
} catch (u) {
|
|
2202
|
+
return c(u);
|
|
2200
2203
|
}
|
|
2201
2204
|
};
|
|
2202
|
-
},
|
|
2205
|
+
}, qn = function(e, t) {
|
|
2203
2206
|
return (n) => {
|
|
2204
2207
|
if (n.message += `
|
|
2205
2208
|
Please report this to https://github.com/markedjs/marked.`, e) {
|
|
2206
|
-
const
|
|
2207
|
-
return t ? Promise.resolve(
|
|
2209
|
+
const r = "<p>An error occurred:</p><pre>" + J(n.message + "", !0) + "</pre>";
|
|
2210
|
+
return t ? Promise.resolve(r) : r;
|
|
2208
2211
|
}
|
|
2209
2212
|
if (t)
|
|
2210
2213
|
return Promise.reject(n);
|
|
2211
2214
|
throw n;
|
|
2212
2215
|
};
|
|
2213
2216
|
};
|
|
2214
|
-
const Pe = new
|
|
2215
|
-
function
|
|
2217
|
+
const Pe = new ei();
|
|
2218
|
+
function D(l, e) {
|
|
2216
2219
|
return Pe.parse(l, e);
|
|
2217
2220
|
}
|
|
2218
|
-
|
|
2219
|
-
return Pe.setOptions(l),
|
|
2221
|
+
D.options = D.setOptions = function(l) {
|
|
2222
|
+
return Pe.setOptions(l), D.defaults = Pe.defaults, zn(D.defaults), D;
|
|
2220
2223
|
};
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
return Pe.use(...l),
|
|
2224
|
+
D.getDefaults = cn;
|
|
2225
|
+
D.defaults = Me;
|
|
2226
|
+
D.use = function(...l) {
|
|
2227
|
+
return Pe.use(...l), D.defaults = Pe.defaults, zn(D.defaults), D;
|
|
2225
2228
|
};
|
|
2226
|
-
|
|
2229
|
+
D.walkTokens = function(l, e) {
|
|
2227
2230
|
return Pe.walkTokens(l, e);
|
|
2228
2231
|
};
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2232
|
+
D.parseInline = Pe.parseInline;
|
|
2233
|
+
D.Parser = de;
|
|
2234
|
+
D.parser = de.parse;
|
|
2235
|
+
D.Renderer = Ut;
|
|
2236
|
+
D.TextRenderer = mn;
|
|
2237
|
+
D.Lexer = he;
|
|
2238
|
+
D.lexer = he.lex;
|
|
2239
|
+
D.Tokenizer = $t;
|
|
2240
|
+
D.Hooks = kt;
|
|
2241
|
+
D.parse = D;
|
|
2242
|
+
D.options;
|
|
2243
|
+
D.setOptions;
|
|
2244
|
+
D.use;
|
|
2245
|
+
D.walkTokens;
|
|
2246
|
+
D.parseInline;
|
|
2244
2247
|
de.parse;
|
|
2245
2248
|
he.lex;
|
|
2246
2249
|
/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */
|
|
2247
2250
|
const {
|
|
2248
2251
|
entries: Zn,
|
|
2249
2252
|
setPrototypeOf: Sn,
|
|
2250
|
-
isFrozen:
|
|
2251
|
-
getPrototypeOf:
|
|
2252
|
-
getOwnPropertyDescriptor:
|
|
2253
|
+
isFrozen: ti,
|
|
2254
|
+
getPrototypeOf: ni,
|
|
2255
|
+
getOwnPropertyDescriptor: ri
|
|
2253
2256
|
} = Object;
|
|
2254
2257
|
let {
|
|
2255
2258
|
freeze: Z,
|
|
@@ -2266,91 +2269,91 @@ re || (re = function(e) {
|
|
|
2266
2269
|
return e;
|
|
2267
2270
|
});
|
|
2268
2271
|
an || (an = function(e, t) {
|
|
2269
|
-
for (var n = arguments.length,
|
|
2270
|
-
|
|
2271
|
-
return e.apply(t,
|
|
2272
|
+
for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), a = 2; a < n; a++)
|
|
2273
|
+
r[a - 2] = arguments[a];
|
|
2274
|
+
return e.apply(t, r);
|
|
2272
2275
|
});
|
|
2273
2276
|
ln || (ln = function(e) {
|
|
2274
|
-
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0),
|
|
2275
|
-
n[
|
|
2277
|
+
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
|
|
2278
|
+
n[r - 1] = arguments[r];
|
|
2276
2279
|
return new e(...n);
|
|
2277
2280
|
});
|
|
2278
|
-
const Mt = X(Array.prototype.forEach),
|
|
2281
|
+
const Mt = X(Array.prototype.forEach), ii = X(Array.prototype.lastIndexOf), On = X(Array.prototype.pop), ft = X(Array.prototype.push), oi = X(Array.prototype.splice), zt = X(String.prototype.toLowerCase), Xt = X(String.prototype.toString), Kt = X(String.prototype.match), pt = X(String.prototype.replace), si = X(String.prototype.indexOf), ai = X(String.prototype.trim), fe = X(Object.prototype.hasOwnProperty), q = X(RegExp.prototype.test), ht = li(TypeError);
|
|
2279
2282
|
function X(l) {
|
|
2280
2283
|
return function(e) {
|
|
2281
2284
|
e instanceof RegExp && (e.lastIndex = 0);
|
|
2282
|
-
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0),
|
|
2283
|
-
n[
|
|
2285
|
+
for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
|
|
2286
|
+
n[r - 1] = arguments[r];
|
|
2284
2287
|
return an(l, e, n);
|
|
2285
2288
|
};
|
|
2286
2289
|
}
|
|
2287
|
-
function
|
|
2290
|
+
function li(l) {
|
|
2288
2291
|
return function() {
|
|
2289
2292
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
2290
2293
|
t[n] = arguments[n];
|
|
2291
2294
|
return ln(l, t);
|
|
2292
2295
|
};
|
|
2293
2296
|
}
|
|
2294
|
-
function
|
|
2297
|
+
function R(l, e) {
|
|
2295
2298
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : zt;
|
|
2296
2299
|
Sn && Sn(l, null);
|
|
2297
2300
|
let n = e.length;
|
|
2298
2301
|
for (; n--; ) {
|
|
2299
|
-
let
|
|
2300
|
-
if (typeof
|
|
2301
|
-
const a = t(
|
|
2302
|
-
a !==
|
|
2302
|
+
let r = e[n];
|
|
2303
|
+
if (typeof r == "string") {
|
|
2304
|
+
const a = t(r);
|
|
2305
|
+
a !== r && (ti(e) || (e[n] = a), r = a);
|
|
2303
2306
|
}
|
|
2304
|
-
l[
|
|
2307
|
+
l[r] = !0;
|
|
2305
2308
|
}
|
|
2306
2309
|
return l;
|
|
2307
2310
|
}
|
|
2308
|
-
function
|
|
2311
|
+
function ci(l) {
|
|
2309
2312
|
for (let e = 0; e < l.length; e++)
|
|
2310
|
-
|
|
2313
|
+
fe(l, e) || (l[e] = null);
|
|
2311
2314
|
return l;
|
|
2312
2315
|
}
|
|
2313
2316
|
function pe(l) {
|
|
2314
2317
|
const e = sn(null);
|
|
2315
2318
|
for (const [t, n] of Zn(l))
|
|
2316
|
-
|
|
2319
|
+
fe(l, t) && (Array.isArray(n) ? e[t] = ci(n) : n && typeof n == "object" && n.constructor === Object ? e[t] = pe(n) : e[t] = n);
|
|
2317
2320
|
return e;
|
|
2318
2321
|
}
|
|
2319
2322
|
function dt(l, e) {
|
|
2320
2323
|
for (; l !== null; ) {
|
|
2321
|
-
const n =
|
|
2324
|
+
const n = ri(l, e);
|
|
2322
2325
|
if (n) {
|
|
2323
2326
|
if (n.get)
|
|
2324
2327
|
return X(n.get);
|
|
2325
2328
|
if (typeof n.value == "function")
|
|
2326
2329
|
return X(n.value);
|
|
2327
2330
|
}
|
|
2328
|
-
l =
|
|
2331
|
+
l = ni(l);
|
|
2329
2332
|
}
|
|
2330
2333
|
function t() {
|
|
2331
2334
|
return null;
|
|
2332
2335
|
}
|
|
2333
2336
|
return t;
|
|
2334
2337
|
}
|
|
2335
|
-
const Cn = Z(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Qt = Z(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Jt = Z(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]),
|
|
2338
|
+
const Cn = Z(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Qt = Z(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Jt = Z(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), ui = Z(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), en = Z(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), fi = Z(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ln = Z(["#text"]), In = Z(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), tn = Z(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Dn = Z(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), jt = Z(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), pi = re(/\{\{[\w\W]*|[\w\W]*\}\}/gm), hi = re(/<%[\w\W]*|[\w\W]*%>/gm), di = re(/\$\{[\w\W]*/gm), mi = re(/^data-[\-\w.\u00B7-\uFFFF]+$/), gi = re(/^aria-[\-\w]+$/), Xn = re(
|
|
2336
2339
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
2337
2340
|
// eslint-disable-line no-useless-escape
|
|
2338
|
-
),
|
|
2341
|
+
), ki = re(/^(?:\w+script|data):/i), bi = re(
|
|
2339
2342
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
2340
2343
|
// eslint-disable-line no-control-regex
|
|
2341
|
-
), Kn = re(/^html$/i),
|
|
2344
|
+
), Kn = re(/^html$/i), xi = re(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
2342
2345
|
var Pn = /* @__PURE__ */ Object.freeze({
|
|
2343
2346
|
__proto__: null,
|
|
2344
|
-
ARIA_ATTR:
|
|
2345
|
-
ATTR_WHITESPACE:
|
|
2346
|
-
CUSTOM_ELEMENT:
|
|
2347
|
-
DATA_ATTR:
|
|
2347
|
+
ARIA_ATTR: gi,
|
|
2348
|
+
ATTR_WHITESPACE: bi,
|
|
2349
|
+
CUSTOM_ELEMENT: xi,
|
|
2350
|
+
DATA_ATTR: mi,
|
|
2348
2351
|
DOCTYPE_NAME: Kn,
|
|
2349
|
-
ERB_EXPR:
|
|
2352
|
+
ERB_EXPR: hi,
|
|
2350
2353
|
IS_ALLOWED_URI: Xn,
|
|
2351
|
-
IS_SCRIPT_OR_DATA:
|
|
2352
|
-
MUSTACHE_EXPR:
|
|
2353
|
-
TMPLIT_EXPR:
|
|
2354
|
+
IS_SCRIPT_OR_DATA: ki,
|
|
2355
|
+
MUSTACHE_EXPR: pi,
|
|
2356
|
+
TMPLIT_EXPR: di
|
|
2354
2357
|
});
|
|
2355
2358
|
const mt = {
|
|
2356
2359
|
element: 1,
|
|
@@ -2359,22 +2362,22 @@ const mt = {
|
|
|
2359
2362
|
progressingInstruction: 7,
|
|
2360
2363
|
comment: 8,
|
|
2361
2364
|
document: 9
|
|
2362
|
-
},
|
|
2365
|
+
}, Ti = function() {
|
|
2363
2366
|
return typeof window > "u" ? null : window;
|
|
2364
|
-
},
|
|
2367
|
+
}, wi = function(e, t) {
|
|
2365
2368
|
if (typeof e != "object" || typeof e.createPolicy != "function")
|
|
2366
2369
|
return null;
|
|
2367
2370
|
let n = null;
|
|
2368
|
-
const
|
|
2369
|
-
t && t.hasAttribute(
|
|
2371
|
+
const r = "data-tt-policy-suffix";
|
|
2372
|
+
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
2370
2373
|
const a = "dompurify" + (n ? "#" + n : "");
|
|
2371
2374
|
try {
|
|
2372
2375
|
return e.createPolicy(a, {
|
|
2373
|
-
createHTML(
|
|
2374
|
-
return
|
|
2376
|
+
createHTML(s) {
|
|
2377
|
+
return s;
|
|
2375
2378
|
},
|
|
2376
|
-
createScriptURL(
|
|
2377
|
-
return
|
|
2379
|
+
createScriptURL(s) {
|
|
2380
|
+
return s;
|
|
2378
2381
|
}
|
|
2379
2382
|
});
|
|
2380
2383
|
} catch {
|
|
@@ -2394,56 +2397,56 @@ const mt = {
|
|
|
2394
2397
|
};
|
|
2395
2398
|
};
|
|
2396
2399
|
function Qn() {
|
|
2397
|
-
let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
2400
|
+
let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Ti();
|
|
2398
2401
|
const e = (d) => Qn(d);
|
|
2399
2402
|
if (e.version = "3.3.1", e.removed = [], !l || !l.document || l.document.nodeType !== mt.document || !l.Element)
|
|
2400
2403
|
return e.isSupported = !1, e;
|
|
2401
2404
|
let {
|
|
2402
2405
|
document: t
|
|
2403
2406
|
} = l;
|
|
2404
|
-
const n = t,
|
|
2407
|
+
const n = t, r = n.currentScript, {
|
|
2405
2408
|
DocumentFragment: a,
|
|
2406
|
-
HTMLTemplateElement:
|
|
2407
|
-
Node:
|
|
2408
|
-
Element:
|
|
2409
|
+
HTMLTemplateElement: s,
|
|
2410
|
+
Node: c,
|
|
2411
|
+
Element: u,
|
|
2409
2412
|
NodeFilter: x,
|
|
2410
2413
|
NamedNodeMap: h = l.NamedNodeMap || l.MozNamedAttrMap,
|
|
2411
|
-
HTMLFormElement:
|
|
2412
|
-
DOMParser:
|
|
2413
|
-
trustedTypes:
|
|
2414
|
-
} = l,
|
|
2415
|
-
if (typeof
|
|
2414
|
+
HTMLFormElement: w,
|
|
2415
|
+
DOMParser: g,
|
|
2416
|
+
trustedTypes: E
|
|
2417
|
+
} = l, T = u.prototype, m = dt(T, "cloneNode"), O = dt(T, "remove"), M = dt(T, "nextSibling"), N = dt(T, "childNodes"), K = dt(T, "parentNode");
|
|
2418
|
+
if (typeof s == "function") {
|
|
2416
2419
|
const d = t.createElement("template");
|
|
2417
2420
|
d.content && d.content.ownerDocument && (t = d.content.ownerDocument);
|
|
2418
2421
|
}
|
|
2419
|
-
let
|
|
2422
|
+
let H, oe = "";
|
|
2420
2423
|
const {
|
|
2421
|
-
implementation:
|
|
2422
|
-
createNodeIterator:
|
|
2423
|
-
createDocumentFragment:
|
|
2424
|
+
implementation: Ve,
|
|
2425
|
+
createNodeIterator: Bt,
|
|
2426
|
+
createDocumentFragment: Wt,
|
|
2424
2427
|
getElementsByTagName: Tt
|
|
2425
2428
|
} = t, {
|
|
2426
2429
|
importNode: Gt
|
|
2427
2430
|
} = n;
|
|
2428
|
-
let
|
|
2429
|
-
e.isSupported = typeof Zn == "function" && typeof K == "function" &&
|
|
2431
|
+
let W = Nn();
|
|
2432
|
+
e.isSupported = typeof Zn == "function" && typeof K == "function" && Ve && Ve.createHTMLDocument !== void 0;
|
|
2430
2433
|
const {
|
|
2431
2434
|
MUSTACHE_EXPR: je,
|
|
2432
2435
|
ERB_EXPR: ee,
|
|
2433
|
-
TMPLIT_EXPR:
|
|
2436
|
+
TMPLIT_EXPR: se,
|
|
2434
2437
|
DATA_ATTR: Le,
|
|
2435
2438
|
ARIA_ATTR: wt,
|
|
2436
2439
|
IS_SCRIPT_OR_DATA: _t,
|
|
2437
|
-
ATTR_WHITESPACE:
|
|
2440
|
+
ATTR_WHITESPACE: qe,
|
|
2438
2441
|
CUSTOM_ELEMENT: yt
|
|
2439
2442
|
} = Pn;
|
|
2440
2443
|
let {
|
|
2441
2444
|
IS_ALLOWED_URI: Ze
|
|
2442
2445
|
} = Pn, F = null;
|
|
2443
|
-
const Xe =
|
|
2444
|
-
let
|
|
2445
|
-
const Et =
|
|
2446
|
-
let
|
|
2446
|
+
const Xe = R({}, [...Cn, ...Qt, ...Jt, ...en, ...Ln]);
|
|
2447
|
+
let B = null;
|
|
2448
|
+
const Et = R({}, [...In, ...tn, ...Dn, ...jt]);
|
|
2449
|
+
let $ = Object.seal(sn(null, {
|
|
2447
2450
|
tagNameCheck: {
|
|
2448
2451
|
writable: !0,
|
|
2449
2452
|
configurable: !1,
|
|
@@ -2463,7 +2466,7 @@ function Qn() {
|
|
|
2463
2466
|
value: !1
|
|
2464
2467
|
}
|
|
2465
2468
|
})), ge = null, Ie = null;
|
|
2466
|
-
const
|
|
2469
|
+
const ae = Object.seal(sn(null, {
|
|
2467
2470
|
tagCheck: {
|
|
2468
2471
|
writable: !0,
|
|
2469
2472
|
configurable: !1,
|
|
@@ -2477,20 +2480,20 @@ function Qn() {
|
|
|
2477
2480
|
value: null
|
|
2478
2481
|
}
|
|
2479
2482
|
}));
|
|
2480
|
-
let ze = !0, Ee = !0, vt = !1, Ke = !0, ve = !1, $e = !0, te = !1, ke = !1, Fe = !1, be = !1, xe = !1, Ue = !1, Rt = !0,
|
|
2483
|
+
let ze = !0, Ee = !0, vt = !1, Ke = !0, ve = !1, $e = !0, te = !1, ke = !1, Fe = !1, be = !1, xe = !1, Ue = !1, Rt = !0, He = !1;
|
|
2481
2484
|
const Yt = "user-content-";
|
|
2482
2485
|
let Qe = !0, Re = !1, Te = {}, Q = null;
|
|
2483
|
-
const Je =
|
|
2486
|
+
const Je = R({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
2484
2487
|
let et = null;
|
|
2485
|
-
const tt =
|
|
2488
|
+
const tt = R({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
2486
2489
|
let nt = null;
|
|
2487
|
-
const At =
|
|
2488
|
-
let Ae =
|
|
2489
|
-
const St =
|
|
2490
|
-
let
|
|
2491
|
-
const it =
|
|
2490
|
+
const At = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), Be = "http://www.w3.org/1998/Math/MathML", We = "http://www.w3.org/2000/svg", le = "http://www.w3.org/1999/xhtml";
|
|
2491
|
+
let Ae = le, rt = !1, De = null;
|
|
2492
|
+
const St = R({}, [Be, We, le], Xt);
|
|
2493
|
+
let ce = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Se = R({}, ["annotation-xml"]);
|
|
2494
|
+
const it = R({}, ["title", "style", "font", "a", "script"]);
|
|
2492
2495
|
let Oe = null;
|
|
2493
|
-
const
|
|
2496
|
+
const Vt = ["application/xhtml+xml", "text/html"], Ot = "text/html";
|
|
2494
2497
|
let U = null, we = null;
|
|
2495
2498
|
const Ct = t.createElement("form"), Lt = function(i) {
|
|
2496
2499
|
return i instanceof RegExp || i instanceof Function;
|
|
@@ -2498,24 +2501,24 @@ function Qn() {
|
|
|
2498
2501
|
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2499
2502
|
if (!(we && we === i)) {
|
|
2500
2503
|
if ((!i || typeof i != "object") && (i = {}), i = pe(i), Oe = // eslint-disable-next-line unicorn/prefer-includes
|
|
2501
|
-
|
|
2504
|
+
Vt.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Ot : i.PARSER_MEDIA_TYPE, U = Oe === "application/xhtml+xml" ? Xt : zt, F = fe(i, "ALLOWED_TAGS") ? R({}, i.ALLOWED_TAGS, U) : Xe, B = fe(i, "ALLOWED_ATTR") ? R({}, i.ALLOWED_ATTR, U) : Et, De = fe(i, "ALLOWED_NAMESPACES") ? R({}, i.ALLOWED_NAMESPACES, Xt) : St, nt = fe(i, "ADD_URI_SAFE_ATTR") ? R(pe(At), i.ADD_URI_SAFE_ATTR, U) : At, et = fe(i, "ADD_DATA_URI_TAGS") ? R(pe(tt), i.ADD_DATA_URI_TAGS, U) : tt, Q = fe(i, "FORBID_CONTENTS") ? R({}, i.FORBID_CONTENTS, U) : Je, ge = fe(i, "FORBID_TAGS") ? R({}, i.FORBID_TAGS, U) : pe({}), Ie = fe(i, "FORBID_ATTR") ? R({}, i.FORBID_ATTR, U) : pe({}), Te = fe(i, "USE_PROFILES") ? i.USE_PROFILES : !1, ze = i.ALLOW_ARIA_ATTR !== !1, Ee = i.ALLOW_DATA_ATTR !== !1, vt = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Ke = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ve = i.SAFE_FOR_TEMPLATES || !1, $e = i.SAFE_FOR_XML !== !1, te = i.WHOLE_DOCUMENT || !1, be = i.RETURN_DOM || !1, xe = i.RETURN_DOM_FRAGMENT || !1, Ue = i.RETURN_TRUSTED_TYPE || !1, Fe = i.FORCE_BODY || !1, Rt = i.SANITIZE_DOM !== !1, He = i.SANITIZE_NAMED_PROPS || !1, Qe = i.KEEP_CONTENT !== !1, Re = i.IN_PLACE || !1, Ze = i.ALLOWED_URI_REGEXP || Xn, Ae = i.NAMESPACE || le, ce = i.MATHML_TEXT_INTEGRATION_POINTS || ce, Se = i.HTML_INTEGRATION_POINTS || Se, $ = i.CUSTOM_ELEMENT_HANDLING || {}, i.CUSTOM_ELEMENT_HANDLING && Lt(i.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && ($.tagNameCheck = i.CUSTOM_ELEMENT_HANDLING.tagNameCheck), i.CUSTOM_ELEMENT_HANDLING && Lt(i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && ($.attributeNameCheck = i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && ($.allowCustomizedBuiltInElements = i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), ve && (Ee = !1), xe && (be = !0), Te && (F = R({}, Ln), B = [], Te.html === !0 && (R(F, Cn), R(B, In)), Te.svg === !0 && (R(F, Qt), R(B, tn), R(B, jt)), Te.svgFilters === !0 && (R(F, Jt), R(B, tn), R(B, jt)), Te.mathMl === !0 && (R(F, en), R(B, Dn), R(B, jt))), i.ADD_TAGS && (typeof i.ADD_TAGS == "function" ? ae.tagCheck = i.ADD_TAGS : (F === Xe && (F = pe(F)), R(F, i.ADD_TAGS, U))), i.ADD_ATTR && (typeof i.ADD_ATTR == "function" ? ae.attributeCheck = i.ADD_ATTR : (B === Et && (B = pe(B)), R(B, i.ADD_ATTR, U))), i.ADD_URI_SAFE_ATTR && R(nt, i.ADD_URI_SAFE_ATTR, U), i.FORBID_CONTENTS && (Q === Je && (Q = pe(Q)), R(Q, i.FORBID_CONTENTS, U)), i.ADD_FORBID_CONTENTS && (Q === Je && (Q = pe(Q)), R(Q, i.ADD_FORBID_CONTENTS, U)), Qe && (F["#text"] = !0), te && R(F, ["html", "head", "body"]), F.table && (R(F, ["tbody"]), delete ge.tbody), i.TRUSTED_TYPES_POLICY) {
|
|
2502
2505
|
if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
2503
2506
|
throw ht('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
2504
2507
|
if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
2505
2508
|
throw ht('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
2506
|
-
|
|
2509
|
+
H = i.TRUSTED_TYPES_POLICY, oe = H.createHTML("");
|
|
2507
2510
|
} else
|
|
2508
|
-
|
|
2511
|
+
H === void 0 && (H = wi(E, r)), H !== null && typeof oe == "string" && (oe = H.createHTML(""));
|
|
2509
2512
|
Z && Z(i), we = i;
|
|
2510
2513
|
}
|
|
2511
|
-
}, st =
|
|
2514
|
+
}, st = R({}, [...Qt, ...Jt, ...ui]), at = R({}, [...en, ...fi]), qt = function(i) {
|
|
2512
2515
|
let f = K(i);
|
|
2513
2516
|
(!f || !f.tagName) && (f = {
|
|
2514
2517
|
namespaceURI: Ae,
|
|
2515
2518
|
tagName: "template"
|
|
2516
2519
|
});
|
|
2517
|
-
const b = zt(i.tagName),
|
|
2518
|
-
return De[i.namespaceURI] ? i.namespaceURI ===
|
|
2520
|
+
const b = zt(i.tagName), C = zt(f.tagName);
|
|
2521
|
+
return De[i.namespaceURI] ? i.namespaceURI === We ? f.namespaceURI === le ? b === "svg" : f.namespaceURI === Be ? b === "svg" && (C === "annotation-xml" || ce[C]) : !!st[b] : i.namespaceURI === Be ? f.namespaceURI === le ? b === "math" : f.namespaceURI === We ? b === "math" && Se[C] : !!at[b] : i.namespaceURI === le ? f.namespaceURI === We && !Se[C] || f.namespaceURI === Be && !ce[C] ? !1 : !at[b] && (it[b] || !st[b]) : !!(Oe === "application/xhtml+xml" && De[i.namespaceURI]) : !1;
|
|
2519
2522
|
}, ne = function(i) {
|
|
2520
2523
|
ft(e.removed, {
|
|
2521
2524
|
element: i
|
|
@@ -2523,7 +2526,7 @@ function Qn() {
|
|
|
2523
2526
|
try {
|
|
2524
2527
|
K(i).removeChild(i);
|
|
2525
2528
|
} catch {
|
|
2526
|
-
|
|
2529
|
+
O(i);
|
|
2527
2530
|
}
|
|
2528
2531
|
}, _e = function(i, f) {
|
|
2529
2532
|
try {
|
|
@@ -2553,27 +2556,27 @@ function Qn() {
|
|
|
2553
2556
|
if (Fe)
|
|
2554
2557
|
i = "<remove></remove>" + i;
|
|
2555
2558
|
else {
|
|
2556
|
-
const
|
|
2557
|
-
b =
|
|
2559
|
+
const z = Kt(i, /^[\r\n\t ]+/);
|
|
2560
|
+
b = z && z[0];
|
|
2558
2561
|
}
|
|
2559
|
-
Oe === "application/xhtml+xml" && Ae ===
|
|
2560
|
-
const
|
|
2561
|
-
if (Ae ===
|
|
2562
|
+
Oe === "application/xhtml+xml" && Ae === le && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
|
|
2563
|
+
const C = H ? H.createHTML(i) : i;
|
|
2564
|
+
if (Ae === le)
|
|
2562
2565
|
try {
|
|
2563
|
-
f = new
|
|
2566
|
+
f = new g().parseFromString(C, Oe);
|
|
2564
2567
|
} catch {
|
|
2565
2568
|
}
|
|
2566
2569
|
if (!f || !f.documentElement) {
|
|
2567
|
-
f =
|
|
2570
|
+
f = Ve.createDocument(Ae, "template", null);
|
|
2568
2571
|
try {
|
|
2569
|
-
f.documentElement.innerHTML = rt ?
|
|
2572
|
+
f.documentElement.innerHTML = rt ? oe : C;
|
|
2570
2573
|
} catch {
|
|
2571
2574
|
}
|
|
2572
2575
|
}
|
|
2573
|
-
const
|
|
2574
|
-
return i && b &&
|
|
2575
|
-
},
|
|
2576
|
-
return
|
|
2576
|
+
const L = f.body || f.documentElement;
|
|
2577
|
+
return i && b && L.insertBefore(t.createTextNode(b), L.childNodes[0] || null), Ae === le ? Tt.call(f, te ? "html" : "body")[0] : te ? f.documentElement : L;
|
|
2578
|
+
}, o = function(i) {
|
|
2579
|
+
return Bt.call(
|
|
2577
2580
|
i.ownerDocument || i,
|
|
2578
2581
|
i,
|
|
2579
2582
|
// eslint-disable-next-line no-bitwise
|
|
@@ -2581,64 +2584,64 @@ function Qn() {
|
|
|
2581
2584
|
null
|
|
2582
2585
|
);
|
|
2583
2586
|
}, p = function(i) {
|
|
2584
|
-
return i instanceof
|
|
2587
|
+
return i instanceof w && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof h) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
|
|
2585
2588
|
}, k = function(i) {
|
|
2586
|
-
return typeof
|
|
2589
|
+
return typeof c == "function" && i instanceof c;
|
|
2587
2590
|
};
|
|
2588
|
-
function
|
|
2591
|
+
function _(d, i, f) {
|
|
2589
2592
|
Mt(d, (b) => {
|
|
2590
2593
|
b.call(e, i, f, we);
|
|
2591
2594
|
});
|
|
2592
2595
|
}
|
|
2593
2596
|
const S = function(i) {
|
|
2594
2597
|
let f = null;
|
|
2595
|
-
if (
|
|
2598
|
+
if (_(W.beforeSanitizeElements, i, null), p(i))
|
|
2596
2599
|
return ne(i), !0;
|
|
2597
2600
|
const b = U(i.nodeName);
|
|
2598
|
-
if (
|
|
2601
|
+
if (_(W.uponSanitizeElement, i, {
|
|
2599
2602
|
tagName: b,
|
|
2600
2603
|
allowedTags: F
|
|
2601
|
-
}), $e && i.hasChildNodes() && !k(i.firstElementChild) &&
|
|
2604
|
+
}), $e && i.hasChildNodes() && !k(i.firstElementChild) && q(/<[/\w!]/g, i.innerHTML) && q(/<[/\w!]/g, i.textContent) || i.nodeType === mt.progressingInstruction || $e && i.nodeType === mt.comment && q(/<[/\w]/g, i.data))
|
|
2602
2605
|
return ne(i), !0;
|
|
2603
|
-
if (!(
|
|
2604
|
-
if (!ge[b] &&
|
|
2606
|
+
if (!(ae.tagCheck instanceof Function && ae.tagCheck(b)) && (!F[b] || ge[b])) {
|
|
2607
|
+
if (!ge[b] && A(b) && ($.tagNameCheck instanceof RegExp && q($.tagNameCheck, b) || $.tagNameCheck instanceof Function && $.tagNameCheck(b)))
|
|
2605
2608
|
return !1;
|
|
2606
2609
|
if (Qe && !Q[b]) {
|
|
2607
|
-
const
|
|
2608
|
-
if (
|
|
2609
|
-
const
|
|
2610
|
-
for (let
|
|
2611
|
-
const
|
|
2612
|
-
|
|
2610
|
+
const C = K(i) || i.parentNode, L = N(i) || i.childNodes;
|
|
2611
|
+
if (L && C) {
|
|
2612
|
+
const z = L.length;
|
|
2613
|
+
for (let V = z - 1; V >= 0; --V) {
|
|
2614
|
+
const ue = m(L[V], !0);
|
|
2615
|
+
ue.__removalCount = (i.__removalCount || 0) + 1, C.insertBefore(ue, M(i));
|
|
2613
2616
|
}
|
|
2614
2617
|
}
|
|
2615
2618
|
}
|
|
2616
2619
|
return ne(i), !0;
|
|
2617
2620
|
}
|
|
2618
|
-
return i instanceof
|
|
2619
|
-
f = pt(f,
|
|
2621
|
+
return i instanceof u && !qt(i) || (b === "noscript" || b === "noembed" || b === "noframes") && q(/<\/no(script|embed|frames)/i, i.innerHTML) ? (ne(i), !0) : (ve && i.nodeType === mt.text && (f = i.textContent, Mt([je, ee, se], (C) => {
|
|
2622
|
+
f = pt(f, C, " ");
|
|
2620
2623
|
}), i.textContent !== f && (ft(e.removed, {
|
|
2621
2624
|
element: i.cloneNode()
|
|
2622
|
-
}), i.textContent = f)),
|
|
2623
|
-
},
|
|
2625
|
+
}), i.textContent = f)), _(W.afterSanitizeElements, i, null), !1);
|
|
2626
|
+
}, I = function(i, f, b) {
|
|
2624
2627
|
if (Rt && (f === "id" || f === "name") && (b in t || b in Ct))
|
|
2625
2628
|
return !1;
|
|
2626
|
-
if (!(Ee && !Ie[f] &&
|
|
2627
|
-
if (!(ze &&
|
|
2628
|
-
if (!(
|
|
2629
|
-
if (!
|
|
2629
|
+
if (!(Ee && !Ie[f] && q(Le, f))) {
|
|
2630
|
+
if (!(ze && q(wt, f))) {
|
|
2631
|
+
if (!(ae.attributeCheck instanceof Function && ae.attributeCheck(f, i))) {
|
|
2632
|
+
if (!B[f] || Ie[f]) {
|
|
2630
2633
|
if (
|
|
2631
2634
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
2632
2635
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
2633
2636
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
2634
|
-
!(
|
|
2637
|
+
!(A(i) && ($.tagNameCheck instanceof RegExp && q($.tagNameCheck, i) || $.tagNameCheck instanceof Function && $.tagNameCheck(i)) && ($.attributeNameCheck instanceof RegExp && q($.attributeNameCheck, f) || $.attributeNameCheck instanceof Function && $.attributeNameCheck(f, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
2635
2638
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
2636
|
-
f === "is" &&
|
|
2639
|
+
f === "is" && $.allowCustomizedBuiltInElements && ($.tagNameCheck instanceof RegExp && q($.tagNameCheck, b) || $.tagNameCheck instanceof Function && $.tagNameCheck(b)))
|
|
2637
2640
|
) return !1;
|
|
2638
2641
|
} else if (!nt[f]) {
|
|
2639
|
-
if (!
|
|
2640
|
-
if (!((f === "src" || f === "xlink:href" || f === "href") && i !== "script" &&
|
|
2641
|
-
if (!(vt && !
|
|
2642
|
+
if (!q(Ze, pt(b, qe, ""))) {
|
|
2643
|
+
if (!((f === "src" || f === "xlink:href" || f === "href") && i !== "script" && si(b, "data:") === 0 && et[i])) {
|
|
2644
|
+
if (!(vt && !q(_t, pt(b, qe, "")))) {
|
|
2642
2645
|
if (b)
|
|
2643
2646
|
return !1;
|
|
2644
2647
|
}
|
|
@@ -2649,10 +2652,10 @@ function Qn() {
|
|
|
2649
2652
|
}
|
|
2650
2653
|
}
|
|
2651
2654
|
return !0;
|
|
2652
|
-
},
|
|
2655
|
+
}, A = function(i) {
|
|
2653
2656
|
return i !== "annotation-xml" && Kt(i, yt);
|
|
2654
|
-
},
|
|
2655
|
-
|
|
2657
|
+
}, v = function(i) {
|
|
2658
|
+
_(W.beforeSanitizeAttributes, i, null);
|
|
2656
2659
|
const {
|
|
2657
2660
|
attributes: f
|
|
2658
2661
|
} = i;
|
|
@@ -2662,71 +2665,71 @@ function Qn() {
|
|
|
2662
2665
|
attrName: "",
|
|
2663
2666
|
attrValue: "",
|
|
2664
2667
|
keepAttr: !0,
|
|
2665
|
-
allowedAttributes:
|
|
2668
|
+
allowedAttributes: B,
|
|
2666
2669
|
forceKeepAttr: void 0
|
|
2667
2670
|
};
|
|
2668
|
-
let
|
|
2669
|
-
for (;
|
|
2670
|
-
const
|
|
2671
|
-
name:
|
|
2672
|
-
namespaceURI:
|
|
2673
|
-
value:
|
|
2674
|
-
} =
|
|
2675
|
-
let Y =
|
|
2676
|
-
if (b.attrName = Ge, b.attrValue = Y, b.keepAttr = !0, b.forceKeepAttr = void 0,
|
|
2677
|
-
_e(
|
|
2671
|
+
let C = f.length;
|
|
2672
|
+
for (; C--; ) {
|
|
2673
|
+
const L = f[C], {
|
|
2674
|
+
name: z,
|
|
2675
|
+
namespaceURI: V,
|
|
2676
|
+
value: ue
|
|
2677
|
+
} = L, Ge = U(z), Zt = ue;
|
|
2678
|
+
let Y = z === "value" ? Zt : ai(Zt);
|
|
2679
|
+
if (b.attrName = Ge, b.attrValue = Y, b.keepAttr = !0, b.forceKeepAttr = void 0, _(W.uponSanitizeAttribute, i, b), Y = b.attrValue, He && (Ge === "id" || Ge === "name") && (_e(z, i), Y = Yt + Y), $e && q(/((--!?|])>)|<\/(style|title|textarea)/i, Y)) {
|
|
2680
|
+
_e(z, i);
|
|
2678
2681
|
continue;
|
|
2679
2682
|
}
|
|
2680
2683
|
if (Ge === "attributename" && Kt(Y, "href")) {
|
|
2681
|
-
_e(
|
|
2684
|
+
_e(z, i);
|
|
2682
2685
|
continue;
|
|
2683
2686
|
}
|
|
2684
2687
|
if (b.forceKeepAttr)
|
|
2685
2688
|
continue;
|
|
2686
2689
|
if (!b.keepAttr) {
|
|
2687
|
-
_e(
|
|
2690
|
+
_e(z, i);
|
|
2688
2691
|
continue;
|
|
2689
2692
|
}
|
|
2690
|
-
if (!Ke &&
|
|
2691
|
-
_e(
|
|
2693
|
+
if (!Ke && q(/\/>/i, Y)) {
|
|
2694
|
+
_e(z, i);
|
|
2692
2695
|
continue;
|
|
2693
2696
|
}
|
|
2694
|
-
ve && Mt([je, ee,
|
|
2697
|
+
ve && Mt([je, ee, se], (kn) => {
|
|
2695
2698
|
Y = pt(Y, kn, " ");
|
|
2696
2699
|
});
|
|
2697
2700
|
const gn = U(i.nodeName);
|
|
2698
|
-
if (!
|
|
2699
|
-
_e(
|
|
2701
|
+
if (!I(gn, Ge, Y)) {
|
|
2702
|
+
_e(z, i);
|
|
2700
2703
|
continue;
|
|
2701
2704
|
}
|
|
2702
|
-
if (
|
|
2703
|
-
switch (
|
|
2705
|
+
if (H && typeof E == "object" && typeof E.getAttributeType == "function" && !V)
|
|
2706
|
+
switch (E.getAttributeType(gn, Ge)) {
|
|
2704
2707
|
case "TrustedHTML": {
|
|
2705
|
-
Y =
|
|
2708
|
+
Y = H.createHTML(Y);
|
|
2706
2709
|
break;
|
|
2707
2710
|
}
|
|
2708
2711
|
case "TrustedScriptURL": {
|
|
2709
|
-
Y =
|
|
2712
|
+
Y = H.createScriptURL(Y);
|
|
2710
2713
|
break;
|
|
2711
2714
|
}
|
|
2712
2715
|
}
|
|
2713
2716
|
if (Y !== Zt)
|
|
2714
2717
|
try {
|
|
2715
|
-
|
|
2718
|
+
V ? i.setAttributeNS(V, z, Y) : i.setAttribute(z, Y), p(i) ? ne(i) : On(e.removed);
|
|
2716
2719
|
} catch {
|
|
2717
|
-
_e(
|
|
2720
|
+
_e(z, i);
|
|
2718
2721
|
}
|
|
2719
2722
|
}
|
|
2720
|
-
|
|
2723
|
+
_(W.afterSanitizeAttributes, i, null);
|
|
2721
2724
|
}, G = function d(i) {
|
|
2722
2725
|
let f = null;
|
|
2723
|
-
const b =
|
|
2724
|
-
for (
|
|
2725
|
-
|
|
2726
|
-
|
|
2726
|
+
const b = o(i);
|
|
2727
|
+
for (_(W.beforeSanitizeShadowDOM, i, null); f = b.nextNode(); )
|
|
2728
|
+
_(W.uponSanitizeShadowNode, f, null), S(f), v(f), f.content instanceof a && d(f.content);
|
|
2729
|
+
_(W.afterSanitizeShadowDOM, i, null);
|
|
2727
2730
|
};
|
|
2728
2731
|
return e.sanitize = function(d) {
|
|
2729
|
-
let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, f = null, b = null,
|
|
2732
|
+
let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, f = null, b = null, C = null, L = null;
|
|
2730
2733
|
if (rt = !d, rt && (d = "<!-->"), typeof d != "string" && !k(d))
|
|
2731
2734
|
if (typeof d.toString == "function") {
|
|
2732
2735
|
if (d = d.toString(), typeof d != "string")
|
|
@@ -2737,38 +2740,38 @@ function Qn() {
|
|
|
2737
2740
|
return d;
|
|
2738
2741
|
if (ke || ot(i), e.removed = [], typeof d == "string" && (Re = !1), Re) {
|
|
2739
2742
|
if (d.nodeName) {
|
|
2740
|
-
const
|
|
2741
|
-
if (!F[
|
|
2743
|
+
const ue = U(d.nodeName);
|
|
2744
|
+
if (!F[ue] || ge[ue])
|
|
2742
2745
|
throw ht("root node is forbidden and cannot be sanitized in-place");
|
|
2743
2746
|
}
|
|
2744
|
-
} else if (d instanceof
|
|
2747
|
+
} else if (d instanceof c)
|
|
2745
2748
|
f = It("<!---->"), b = f.ownerDocument.importNode(d, !0), b.nodeType === mt.element && b.nodeName === "BODY" || b.nodeName === "HTML" ? f = b : f.appendChild(b);
|
|
2746
2749
|
else {
|
|
2747
2750
|
if (!be && !ve && !te && // eslint-disable-next-line unicorn/prefer-includes
|
|
2748
2751
|
d.indexOf("<") === -1)
|
|
2749
|
-
return
|
|
2752
|
+
return H && Ue ? H.createHTML(d) : d;
|
|
2750
2753
|
if (f = It(d), !f)
|
|
2751
|
-
return be ? null : Ue ?
|
|
2754
|
+
return be ? null : Ue ? oe : "";
|
|
2752
2755
|
}
|
|
2753
2756
|
f && Fe && ne(f.firstChild);
|
|
2754
|
-
const
|
|
2755
|
-
for (;
|
|
2756
|
-
S(
|
|
2757
|
+
const z = o(Re ? d : f);
|
|
2758
|
+
for (; C = z.nextNode(); )
|
|
2759
|
+
S(C), v(C), C.content instanceof a && G(C.content);
|
|
2757
2760
|
if (Re)
|
|
2758
2761
|
return d;
|
|
2759
2762
|
if (be) {
|
|
2760
2763
|
if (xe)
|
|
2761
|
-
for (
|
|
2762
|
-
|
|
2764
|
+
for (L = Wt.call(f.ownerDocument); f.firstChild; )
|
|
2765
|
+
L.appendChild(f.firstChild);
|
|
2763
2766
|
else
|
|
2764
|
-
|
|
2765
|
-
return (
|
|
2766
|
-
}
|
|
2767
|
-
let
|
|
2768
|
-
return te && F["!doctype"] && f.ownerDocument && f.ownerDocument.doctype && f.ownerDocument.doctype.name &&
|
|
2769
|
-
` +
|
|
2770
|
-
|
|
2771
|
-
}),
|
|
2767
|
+
L = f;
|
|
2768
|
+
return (B.shadowroot || B.shadowrootmode) && (L = Gt.call(n, L, !0)), L;
|
|
2769
|
+
}
|
|
2770
|
+
let V = te ? f.outerHTML : f.innerHTML;
|
|
2771
|
+
return te && F["!doctype"] && f.ownerDocument && f.ownerDocument.doctype && f.ownerDocument.doctype.name && q(Kn, f.ownerDocument.doctype.name) && (V = "<!DOCTYPE " + f.ownerDocument.doctype.name + `>
|
|
2772
|
+
` + V), ve && Mt([je, ee, se], (ue) => {
|
|
2773
|
+
V = pt(V, ue, " ");
|
|
2774
|
+
}), H && Ue ? H.createHTML(V) : V;
|
|
2772
2775
|
}, e.setConfig = function() {
|
|
2773
2776
|
let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2774
2777
|
ot(d), ke = !0;
|
|
@@ -2776,117 +2779,117 @@ function Qn() {
|
|
|
2776
2779
|
we = null, ke = !1;
|
|
2777
2780
|
}, e.isValidAttribute = function(d, i, f) {
|
|
2778
2781
|
we || ot({});
|
|
2779
|
-
const b = U(d),
|
|
2780
|
-
return
|
|
2782
|
+
const b = U(d), C = U(i);
|
|
2783
|
+
return I(b, C, f);
|
|
2781
2784
|
}, e.addHook = function(d, i) {
|
|
2782
|
-
typeof i == "function" && ft(
|
|
2785
|
+
typeof i == "function" && ft(W[d], i);
|
|
2783
2786
|
}, e.removeHook = function(d, i) {
|
|
2784
2787
|
if (i !== void 0) {
|
|
2785
|
-
const f =
|
|
2786
|
-
return f === -1 ? void 0 :
|
|
2788
|
+
const f = ii(W[d], i);
|
|
2789
|
+
return f === -1 ? void 0 : oi(W[d], f, 1)[0];
|
|
2787
2790
|
}
|
|
2788
|
-
return On(
|
|
2791
|
+
return On(W[d]);
|
|
2789
2792
|
}, e.removeHooks = function(d) {
|
|
2790
|
-
|
|
2793
|
+
W[d] = [];
|
|
2791
2794
|
}, e.removeAllHooks = function() {
|
|
2792
|
-
|
|
2795
|
+
W = Nn();
|
|
2793
2796
|
}, e;
|
|
2794
2797
|
}
|
|
2795
|
-
var
|
|
2796
|
-
const
|
|
2798
|
+
var _i = Qn();
|
|
2799
|
+
const yi = {
|
|
2797
2800
|
heading(l, e, t) {
|
|
2798
2801
|
typeof l == "object" && l !== null && (t = l.raw || t, e = l.depth || l.level || e, l = l.text || "");
|
|
2799
|
-
const
|
|
2800
|
-
return `<h${e} id="${
|
|
2802
|
+
const r = (t || String(l)).toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
2803
|
+
return `<h${e} id="${r}">${l}</h${e}>`;
|
|
2801
2804
|
}
|
|
2802
2805
|
};
|
|
2803
|
-
|
|
2804
|
-
function
|
|
2805
|
-
const e =
|
|
2806
|
-
return
|
|
2806
|
+
D.use({ renderer: yi });
|
|
2807
|
+
function Ei(l) {
|
|
2808
|
+
const e = D.parse(l);
|
|
2809
|
+
return _i.sanitize(e, {
|
|
2807
2810
|
ADD_ATTR: ["id", "name"],
|
|
2808
2811
|
// 'name' sometimes used for anchors too
|
|
2809
2812
|
ADD_TAGS: ["h1", "h2", "h3", "h4", "h5", "h6"]
|
|
2810
2813
|
// Ensure headers aren't stripped (redundant but safe)
|
|
2811
2814
|
});
|
|
2812
2815
|
}
|
|
2813
|
-
const
|
|
2814
|
-
const [n,
|
|
2816
|
+
const vi = ({ content: l, filename: e, onClose: t }) => {
|
|
2817
|
+
const [n, r] = ye(""), [a, s] = ye(!1), [c, u] = ye(!1);
|
|
2815
2818
|
Ye(() => {
|
|
2816
2819
|
if (l) {
|
|
2817
|
-
const
|
|
2818
|
-
|
|
2820
|
+
const g = Ei(l);
|
|
2821
|
+
r(g);
|
|
2819
2822
|
}
|
|
2820
2823
|
}, [l]), Ye(() => {
|
|
2821
|
-
const
|
|
2822
|
-
var
|
|
2823
|
-
const
|
|
2824
|
-
if (
|
|
2825
|
-
const
|
|
2826
|
-
|
|
2824
|
+
const g = (T) => {
|
|
2825
|
+
var O;
|
|
2826
|
+
const m = (O = T.target.getAttribute("href")) == null ? void 0 : O.substring(1);
|
|
2827
|
+
if (m) {
|
|
2828
|
+
const M = document.getElementById(m);
|
|
2829
|
+
M && (T.preventDefault(), M.scrollIntoView({ behavior: "smooth", block: "start" }));
|
|
2827
2830
|
}
|
|
2828
|
-
},
|
|
2829
|
-
return
|
|
2830
|
-
|
|
2831
|
+
}, E = document.querySelectorAll('.markdown-body a[href^="#"]');
|
|
2832
|
+
return E.forEach((T) => T.addEventListener("click", g)), () => {
|
|
2833
|
+
E.forEach((T) => T.removeEventListener("click", g));
|
|
2831
2834
|
};
|
|
2832
2835
|
}, [n]);
|
|
2833
2836
|
const x = () => {
|
|
2834
|
-
var
|
|
2837
|
+
var g;
|
|
2835
2838
|
if (a)
|
|
2836
|
-
window.speechSynthesis.cancel(),
|
|
2839
|
+
window.speechSynthesis.cancel(), s(!1);
|
|
2837
2840
|
else {
|
|
2838
|
-
const
|
|
2839
|
-
if (!
|
|
2840
|
-
const
|
|
2841
|
-
|
|
2841
|
+
const E = (g = document.getElementById("markdown-content")) == null ? void 0 : g.innerText;
|
|
2842
|
+
if (!E) return;
|
|
2843
|
+
const T = new SpeechSynthesisUtterance(E);
|
|
2844
|
+
T.rate = 1, T.onend = () => s(!1), T.onerror = () => s(!1), window.speechSynthesis.speak(T), s(!0);
|
|
2842
2845
|
}
|
|
2843
2846
|
};
|
|
2844
2847
|
Ye(() => () => window.speechSynthesis.cancel(), []);
|
|
2845
2848
|
const h = () => {
|
|
2846
|
-
const
|
|
2847
|
-
if (!
|
|
2848
|
-
const
|
|
2849
|
-
"text/html":
|
|
2850
|
-
"text/plain":
|
|
2849
|
+
const g = document.getElementById("markdown-content");
|
|
2850
|
+
if (!g) return;
|
|
2851
|
+
const E = g.innerText, T = g.innerHTML, m = new Blob([T], { type: "text/html" }), O = new Blob([E], { type: "text/plain" }), M = [new ClipboardItem({
|
|
2852
|
+
"text/html": m,
|
|
2853
|
+
"text/plain": O
|
|
2851
2854
|
})];
|
|
2852
|
-
navigator.clipboard.write(
|
|
2853
|
-
|
|
2855
|
+
navigator.clipboard.write(M).then(() => {
|
|
2856
|
+
u(!0), setTimeout(() => u(!1), 2e3);
|
|
2854
2857
|
}).catch(() => {
|
|
2855
|
-
navigator.clipboard.writeText(
|
|
2856
|
-
|
|
2858
|
+
navigator.clipboard.writeText(E).then(() => {
|
|
2859
|
+
u(!0), setTimeout(() => u(!1), 2e3);
|
|
2857
2860
|
});
|
|
2858
2861
|
});
|
|
2859
|
-
},
|
|
2862
|
+
}, w = () => {
|
|
2860
2863
|
alert("💡 Tip: To preserve the visual theme in your PDF, make sure to check 'Background graphics' in the print settings window."), window.print();
|
|
2861
2864
|
};
|
|
2862
|
-
return /* @__PURE__ */
|
|
2863
|
-
/* @__PURE__ */
|
|
2864
|
-
/* @__PURE__ */
|
|
2865
|
-
/* @__PURE__ */
|
|
2866
|
-
/* @__PURE__ */
|
|
2865
|
+
return /* @__PURE__ */ y.jsxs("section", { className: "preview-zone", children: [
|
|
2866
|
+
/* @__PURE__ */ y.jsxs("div", { className: "preview-header", children: [
|
|
2867
|
+
/* @__PURE__ */ y.jsx("span", { id: "filename-display", children: e || "filename.md" }),
|
|
2868
|
+
/* @__PURE__ */ y.jsxs("div", { className: "header-actions", children: [
|
|
2869
|
+
/* @__PURE__ */ y.jsx(
|
|
2867
2870
|
"button",
|
|
2868
2871
|
{
|
|
2869
2872
|
className: `icon-btn ${a ? "speaking" : ""}`,
|
|
2870
2873
|
onClick: x,
|
|
2871
2874
|
title: a ? "Stop Reading" : "Read Aloud",
|
|
2872
|
-
children: a ? /* @__PURE__ */
|
|
2875
|
+
children: a ? /* @__PURE__ */ y.jsx(mr, {}) : /* @__PURE__ */ y.jsx(kr, {})
|
|
2873
2876
|
}
|
|
2874
2877
|
),
|
|
2875
|
-
/* @__PURE__ */
|
|
2878
|
+
/* @__PURE__ */ y.jsx(
|
|
2876
2879
|
"button",
|
|
2877
2880
|
{
|
|
2878
2881
|
className: "icon-btn",
|
|
2879
2882
|
onClick: h,
|
|
2880
2883
|
title: "Copy to Clipboard",
|
|
2881
|
-
style: { color:
|
|
2882
|
-
children:
|
|
2884
|
+
style: { color: c ? "var(--accent-color)" : "" },
|
|
2885
|
+
children: c ? /* @__PURE__ */ y.jsx(lr, {}) : /* @__PURE__ */ y.jsx(fr, {})
|
|
2883
2886
|
}
|
|
2884
2887
|
),
|
|
2885
|
-
/* @__PURE__ */
|
|
2886
|
-
/* @__PURE__ */
|
|
2888
|
+
/* @__PURE__ */ y.jsx("button", { className: "icon-btn", onClick: w, title: "Save as PDF", children: /* @__PURE__ */ y.jsx(hr, {}) }),
|
|
2889
|
+
/* @__PURE__ */ y.jsx("button", { className: "icon-btn", onClick: t, title: "Close File", id: "close-btn", children: /* @__PURE__ */ y.jsx(cr, {}) })
|
|
2887
2890
|
] })
|
|
2888
2891
|
] }),
|
|
2889
|
-
/* @__PURE__ */
|
|
2892
|
+
/* @__PURE__ */ y.jsx(
|
|
2890
2893
|
"div",
|
|
2891
2894
|
{
|
|
2892
2895
|
id: "markdown-content",
|
|
@@ -2895,79 +2898,101 @@ const Ei = ({ content: l, filename: e, onClose: t }) => {
|
|
|
2895
2898
|
}
|
|
2896
2899
|
)
|
|
2897
2900
|
] });
|
|
2898
|
-
},
|
|
2899
|
-
const [
|
|
2901
|
+
}, Si = ({ url: l }) => {
|
|
2902
|
+
const [e, t] = ye("light"), [n, r] = ye(null), [a, s] = ye(!1), c = me.useRef(null);
|
|
2900
2903
|
Ye(() => {
|
|
2901
|
-
const
|
|
2902
|
-
|
|
2904
|
+
const T = localStorage.getItem("theme"), m = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
2905
|
+
t(T || (m ? "dark" : "light"));
|
|
2903
2906
|
}, []);
|
|
2904
2907
|
const u = () => {
|
|
2905
|
-
const
|
|
2906
|
-
|
|
2908
|
+
const T = e === "light" ? "dark" : "light";
|
|
2909
|
+
t(T), localStorage.setItem("theme", T);
|
|
2910
|
+
}, x = (T) => {
|
|
2911
|
+
try {
|
|
2912
|
+
if (new URL(T).hostname === "github.com" && T.includes("/blob/"))
|
|
2913
|
+
return T.replace("github.com", "raw.githubusercontent.com").replace("/blob/", "/");
|
|
2914
|
+
} catch {
|
|
2915
|
+
}
|
|
2916
|
+
return T;
|
|
2917
|
+
}, h = async (T) => {
|
|
2918
|
+
if (T)
|
|
2919
|
+
try {
|
|
2920
|
+
const m = x(T), O = await fetch(m);
|
|
2921
|
+
if (!O.ok) throw new Error("Failed to fetch");
|
|
2922
|
+
const M = await O.text();
|
|
2923
|
+
let N = T.substring(T.lastIndexOf("/") + 1) || "remote-file.md";
|
|
2924
|
+
N.includes("?") && (N = N.split("?")[0]), r({ name: N, content: M });
|
|
2925
|
+
} catch (m) {
|
|
2926
|
+
console.error("Scripto Load Error:", m);
|
|
2927
|
+
}
|
|
2907
2928
|
};
|
|
2908
2929
|
Ye(() => {
|
|
2909
|
-
const
|
|
2910
|
-
if (!
|
|
2930
|
+
const T = c.current;
|
|
2931
|
+
if (!T) return;
|
|
2911
2932
|
const m = () => {
|
|
2912
|
-
|
|
2933
|
+
T.scrollTop > 300 ? s(!0) : s(!1);
|
|
2913
2934
|
};
|
|
2914
|
-
return
|
|
2935
|
+
return T.addEventListener("scroll", m), () => T.removeEventListener("scroll", m);
|
|
2915
2936
|
}, []);
|
|
2916
|
-
const
|
|
2917
|
-
|
|
2918
|
-
},
|
|
2919
|
-
|
|
2920
|
-
},
|
|
2921
|
-
|
|
2922
|
-
const
|
|
2923
|
-
|
|
2937
|
+
const w = () => {
|
|
2938
|
+
c.current && c.current.scrollTo({ top: 0, behavior: "smooth" });
|
|
2939
|
+
}, g = (T) => {
|
|
2940
|
+
r(T), c.current && (c.current.scrollTop = 0);
|
|
2941
|
+
}, E = () => {
|
|
2942
|
+
r(null);
|
|
2943
|
+
const T = new URL(window.location);
|
|
2944
|
+
T.searchParams.delete("url"), window.history.pushState({}, "", T);
|
|
2924
2945
|
};
|
|
2925
2946
|
return Ye(() => {
|
|
2926
|
-
new URLSearchParams(window.location.search).get("url");
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
/* @__PURE__ */
|
|
2931
|
-
/* @__PURE__ */
|
|
2947
|
+
const T = new URLSearchParams(window.location.search), m = l || T.get("url");
|
|
2948
|
+
m && h(m);
|
|
2949
|
+
}, [l]), /* @__PURE__ */ y.jsxs("div", { className: "scripto-wrapper", "data-theme": e, children: [
|
|
2950
|
+
/* @__PURE__ */ y.jsxs("div", { className: "background-blobs", children: [
|
|
2951
|
+
/* @__PURE__ */ y.jsx("div", { className: "blob blob-1" }),
|
|
2952
|
+
/* @__PURE__ */ y.jsx("div", { className: "blob blob-2" }),
|
|
2953
|
+
/* @__PURE__ */ y.jsx("div", { className: "blob blob-3" })
|
|
2932
2954
|
] }),
|
|
2933
|
-
/* @__PURE__ */
|
|
2934
|
-
/* @__PURE__ */
|
|
2935
|
-
/* @__PURE__ */
|
|
2936
|
-
/* @__PURE__ */
|
|
2937
|
-
/* @__PURE__ */
|
|
2938
|
-
/* @__PURE__ */
|
|
2955
|
+
/* @__PURE__ */ y.jsx("button", { id: "theme-toggle", "aria-label": "Toggle Theme", onClick: u, children: e === "light" ? /* @__PURE__ */ y.jsx(gr, {}) : /* @__PURE__ */ y.jsx(dr, {}) }),
|
|
2956
|
+
/* @__PURE__ */ y.jsxs("main", { className: "app-container", ref: c, children: [
|
|
2957
|
+
/* @__PURE__ */ y.jsxs("header", { className: "glass-header", children: [
|
|
2958
|
+
/* @__PURE__ */ y.jsxs("div", { className: "logo", children: [
|
|
2959
|
+
/* @__PURE__ */ y.jsx(pr, {}),
|
|
2960
|
+
/* @__PURE__ */ y.jsxs("h1", { children: [
|
|
2939
2961
|
"Scr!p",
|
|
2940
|
-
/* @__PURE__ */
|
|
2962
|
+
/* @__PURE__ */ y.jsx("span", { children: "tō" })
|
|
2941
2963
|
] })
|
|
2942
2964
|
] }),
|
|
2943
|
-
/* @__PURE__ */
|
|
2965
|
+
/* @__PURE__ */ y.jsx("p", { children: "“Simple, elegant visualization — where every mark becomes meaning.”" })
|
|
2944
2966
|
] }),
|
|
2945
|
-
|
|
2946
|
-
|
|
2967
|
+
n ? /* @__PURE__ */ y.jsx(
|
|
2968
|
+
vi,
|
|
2947
2969
|
{
|
|
2948
|
-
content:
|
|
2949
|
-
filename:
|
|
2950
|
-
onClose:
|
|
2951
|
-
}
|
|
2952
|
-
) : /* @__PURE__ */
|
|
2953
|
-
/* @__PURE__ */
|
|
2970
|
+
content: n.content,
|
|
2971
|
+
filename: n.name,
|
|
2972
|
+
onClose: E
|
|
2973
|
+
}
|
|
2974
|
+
) : /* @__PURE__ */ y.jsx(xr, { onFileLoaded: g }),
|
|
2975
|
+
/* @__PURE__ */ y.jsx("footer", { className: "app-footer", children: /* @__PURE__ */ y.jsxs("p", { children: [
|
|
2976
|
+
" Try it out on ",
|
|
2977
|
+
/* @__PURE__ */ y.jsx("a", { href: "https://www.npmjs.com/package/@jojovms/scripto", target: "_blank", rel: "noopener noreferrer", className: "npm-link", title: "View on NPM", children: /* @__PURE__ */ y.jsx(br, { style: { fontSize: "2.5em", verticalAlign: "middle", marginRight: "5px" } }) }),
|
|
2978
|
+
/* @__PURE__ */ y.jsx("span", { style: { margin: "0 10px", opacity: 0.5 }, children: "|" }),
|
|
2954
2979
|
"🎯 App created by ",
|
|
2955
|
-
/* @__PURE__ */
|
|
2980
|
+
/* @__PURE__ */ y.jsx("a", { href: "https://bio.link/shijoshaji", target: "_blank", rel: "noopener noreferrer", children: "Shijo Shaji" })
|
|
2956
2981
|
] }) })
|
|
2957
2982
|
] }),
|
|
2958
|
-
/* @__PURE__ */
|
|
2983
|
+
/* @__PURE__ */ y.jsx(
|
|
2959
2984
|
"button",
|
|
2960
2985
|
{
|
|
2961
2986
|
id: "scroll-top-btn",
|
|
2962
2987
|
"aria-label": "Scroll to Top",
|
|
2963
|
-
className:
|
|
2964
|
-
onClick:
|
|
2965
|
-
children: /* @__PURE__ */
|
|
2988
|
+
className: a ? "visible" : "",
|
|
2989
|
+
onClick: w,
|
|
2990
|
+
children: /* @__PURE__ */ y.jsx(ar, {})
|
|
2966
2991
|
}
|
|
2967
2992
|
)
|
|
2968
2993
|
] });
|
|
2969
2994
|
};
|
|
2970
2995
|
export {
|
|
2971
|
-
|
|
2972
|
-
|
|
2996
|
+
Si as Scripto,
|
|
2997
|
+
Si as default
|
|
2973
2998
|
};
|