vue-api-request-builder 0.2.8 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +684 -684
- package/dist/index.umd.js +13 -13
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Pr = Object.defineProperty;
|
|
2
2
|
var Tr = Object.getPrototypeOf;
|
|
3
3
|
var Lr = Reflect.get;
|
|
4
4
|
var Tn = (t) => {
|
|
5
5
|
throw TypeError(t);
|
|
6
6
|
};
|
|
7
|
-
var jr = (t, e, n) => e in t ?
|
|
7
|
+
var jr = (t, e, n) => e in t ? Pr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
8
8
|
var h = (t, e, n) => jr(t, typeof e != "symbol" ? e + "" : e, n), Mt = (t, e, n) => e.has(t) || Tn("Cannot " + n);
|
|
9
9
|
var K = (t, e, n) => (Mt(t, e, "read from private field"), n ? n.call(t) : e.get(t)), Ce = (t, e, n) => e.has(t) ? Tn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), se = (t, e, n, a) => (Mt(t, e, "write to private field"), a ? a.call(t, n) : e.set(t, n), n), Ot = (t, e, n) => (Mt(t, e, "access private method"), n);
|
|
10
10
|
var Ln = (t, e, n) => Lr(Tr(t), n, e);
|
|
@@ -25,24 +25,24 @@ const zr = { class: "key-value-input flex flex-col gap-1" }, qr = { class: "flex
|
|
|
25
25
|
const n = t, a = e, r = L(n.modelValue);
|
|
26
26
|
Qe(
|
|
27
27
|
() => n.modelValue,
|
|
28
|
-
(
|
|
29
|
-
r.value =
|
|
28
|
+
(i) => {
|
|
29
|
+
r.value = i;
|
|
30
30
|
}
|
|
31
31
|
), Qe(
|
|
32
32
|
r,
|
|
33
|
-
(
|
|
34
|
-
a("update:modelValue",
|
|
33
|
+
(i) => {
|
|
34
|
+
a("update:modelValue", i);
|
|
35
35
|
},
|
|
36
36
|
{ deep: !0 }
|
|
37
37
|
);
|
|
38
38
|
const s = () => {
|
|
39
39
|
r.value.push({ key: "", value: "" });
|
|
40
|
-
}, o = (
|
|
41
|
-
r.value.splice(
|
|
42
|
-
},
|
|
40
|
+
}, o = (i) => {
|
|
41
|
+
r.value.splice(i, 1);
|
|
42
|
+
}, l = () => {
|
|
43
43
|
r.value = [];
|
|
44
44
|
};
|
|
45
|
-
return (
|
|
45
|
+
return (i, c) => {
|
|
46
46
|
const u = j("a-button"), p = j("a-popconfirm"), d = j("a-input"), f = j("a-typography-paragraph"), m = j("a-typography");
|
|
47
47
|
return M(), J("div", zr, [
|
|
48
48
|
N("div", qr, [
|
|
@@ -53,7 +53,7 @@ const zr = { class: "key-value-input flex flex-col gap-1" }, qr = { class: "flex
|
|
|
53
53
|
size: "small"
|
|
54
54
|
}, {
|
|
55
55
|
default: R(() => [
|
|
56
|
-
D(Ee(
|
|
56
|
+
D(Ee(i.addButtonText), 1)
|
|
57
57
|
]),
|
|
58
58
|
_: 1
|
|
59
59
|
}),
|
|
@@ -63,7 +63,7 @@ const zr = { class: "key-value-input flex flex-col gap-1" }, qr = { class: "flex
|
|
|
63
63
|
description: "确定要清空所有参数吗?",
|
|
64
64
|
"ok-text": "确认",
|
|
65
65
|
"cancel-text": "取消",
|
|
66
|
-
onConfirm:
|
|
66
|
+
onConfirm: l
|
|
67
67
|
}, {
|
|
68
68
|
default: R(() => [
|
|
69
69
|
E(u, {
|
|
@@ -117,14 +117,14 @@ const zr = { class: "key-value-input flex flex-col gap-1" }, qr = { class: "flex
|
|
|
117
117
|
])
|
|
118
118
|
]))), 128))
|
|
119
119
|
])) : te("", !0),
|
|
120
|
-
|
|
120
|
+
i.showPreview ? (M(), me(m, {
|
|
121
121
|
key: 1,
|
|
122
122
|
class: "m-0"
|
|
123
123
|
}, {
|
|
124
124
|
default: R(() => [
|
|
125
125
|
E(f, { class: "!m-0" }, {
|
|
126
126
|
default: R(() => [
|
|
127
|
-
N("pre", null, Ee(
|
|
127
|
+
N("pre", null, Ee(i.previewText), 1)
|
|
128
128
|
]),
|
|
129
129
|
_: 1
|
|
130
130
|
})
|
|
@@ -165,7 +165,7 @@ const zr = { class: "key-value-input flex flex-col gap-1" }, qr = { class: "flex
|
|
|
165
165
|
},
|
|
166
166
|
emits: ["update:modelValue"],
|
|
167
167
|
setup(t, { emit: e }) {
|
|
168
|
-
const n = t, a = e, r = L(n.modelValue.method), s = L(n.modelValue.url), o = L(n.modelValue.auth.type),
|
|
168
|
+
const n = t, a = e, r = L(n.modelValue.method), s = L(n.modelValue.url), o = L(n.modelValue.auth.type), l = L(n.modelValue.path), i = L(n.modelValue.auth.username || ""), c = L(n.modelValue.auth.password || ""), u = L(n.modelValue.auth.token || ""), p = L(n.modelValue.params), d = L(n.modelValue.headers), f = L(n.modelValue.body.formData || []), m = L(n.modelValue.body.type), _ = L(n.modelValue.body.json || ""), g = L(n.modelValue.body.raw || ""), b = L("");
|
|
169
169
|
function w(x, $) {
|
|
170
170
|
let T;
|
|
171
171
|
return function(...ue) {
|
|
@@ -176,7 +176,7 @@ const zr = { class: "key-value-input flex flex-col gap-1" }, qr = { class: "flex
|
|
|
176
176
|
const x = {
|
|
177
177
|
method: r.value,
|
|
178
178
|
url: s.value,
|
|
179
|
-
path:
|
|
179
|
+
path: l.value,
|
|
180
180
|
auth: { type: "none" },
|
|
181
181
|
// 默认提供一个空的auth对象
|
|
182
182
|
params: p.value,
|
|
@@ -189,7 +189,7 @@ const zr = { class: "key-value-input flex flex-col gap-1" }, qr = { class: "flex
|
|
|
189
189
|
return n.showAuth && (x.auth = {
|
|
190
190
|
type: o.value,
|
|
191
191
|
...o.value === "Basic" ? {
|
|
192
|
-
username:
|
|
192
|
+
username: i.value,
|
|
193
193
|
password: c.value
|
|
194
194
|
} : o.value === "Bearer" ? {
|
|
195
195
|
token: u.value
|
|
@@ -202,9 +202,9 @@ const zr = { class: "key-value-input flex flex-col gap-1" }, qr = { class: "flex
|
|
|
202
202
|
[
|
|
203
203
|
r,
|
|
204
204
|
s,
|
|
205
|
-
i,
|
|
206
|
-
o,
|
|
207
205
|
l,
|
|
206
|
+
o,
|
|
207
|
+
i,
|
|
208
208
|
c,
|
|
209
209
|
u,
|
|
210
210
|
p,
|
|
@@ -222,7 +222,7 @@ const zr = { class: "key-value-input flex flex-col gap-1" }, qr = { class: "flex
|
|
|
222
222
|
() => n.modelValue,
|
|
223
223
|
(x) => {
|
|
224
224
|
const $ = k();
|
|
225
|
-
JSON.stringify(x) !== JSON.stringify($) && (r.value = x.method, s.value = x.url,
|
|
225
|
+
JSON.stringify(x) !== JSON.stringify($) && (r.value = x.method, s.value = x.url, l.value = x.path, n.showAuth && x.auth && (o.value = x.auth.type, i.value = x.auth.username || "", c.value = x.auth.password || "", u.value = x.auth.token || ""), p.value = x.params, d.value = x.headers, m.value = x.body.type, f.value = x.body.formData || [], _.value = x.body.json || "", g.value = x.body.raw || "");
|
|
226
226
|
},
|
|
227
227
|
{ deep: !0 }
|
|
228
228
|
);
|
|
@@ -261,7 +261,7 @@ ${T.value}\r
|
|
|
261
261
|
}, q = () => {
|
|
262
262
|
try {
|
|
263
263
|
const x = s.value, $ = new URL(x);
|
|
264
|
-
s.value = `${$.protocol}//${$.host}`,
|
|
264
|
+
s.value = `${$.protocol}//${$.host}`, l.value = $.pathname;
|
|
265
265
|
const T = new URLSearchParams($.search), ue = [];
|
|
266
266
|
T.forEach((W, ie) => {
|
|
267
267
|
ue.push({ key: ie, value: W });
|
|
@@ -279,9 +279,9 @@ ${T.value}\r
|
|
|
279
279
|
}
|
|
280
280
|
});
|
|
281
281
|
return (x, $) => {
|
|
282
|
-
const T = j("a-input"), ue = j("a-button"), W = j("a-select-option"), ie = j("a-select"), ye = j("a-card"), Le = j("a-radio-button"),
|
|
282
|
+
const T = j("a-input"), ue = j("a-button"), W = j("a-select-option"), ie = j("a-select"), ye = j("a-card"), Le = j("a-radio-button"), Pn = j("a-radio-group"), Rr = j("a-input-password"), jt = j("a-textarea"), Nr = j("a-alert"), Br = j("a-form");
|
|
283
283
|
return M(), J("div", Zr, [
|
|
284
|
-
E(
|
|
284
|
+
E(Br, { layout: "vertical" }, {
|
|
285
285
|
default: R(() => [
|
|
286
286
|
E(ye, {
|
|
287
287
|
title: "URL配置",
|
|
@@ -293,7 +293,7 @@ ${T.value}\r
|
|
|
293
293
|
N("div", Jr, [
|
|
294
294
|
E(T, {
|
|
295
295
|
value: s.value,
|
|
296
|
-
"onUpdate:value": $[0] || ($[0] = (
|
|
296
|
+
"onUpdate:value": $[0] || ($[0] = (P) => s.value = P),
|
|
297
297
|
placeholder: "基础URL",
|
|
298
298
|
size: "small"
|
|
299
299
|
}, null, 8, ["value"]),
|
|
@@ -312,7 +312,7 @@ ${T.value}\r
|
|
|
312
312
|
N("div", Qr, [
|
|
313
313
|
E(ie, {
|
|
314
314
|
value: r.value,
|
|
315
|
-
"onUpdate:value": $[1] || ($[1] = (
|
|
315
|
+
"onUpdate:value": $[1] || ($[1] = (P) => r.value = P),
|
|
316
316
|
class: "w-40",
|
|
317
317
|
size: "small"
|
|
318
318
|
}, {
|
|
@@ -351,8 +351,8 @@ ${T.value}\r
|
|
|
351
351
|
_: 1
|
|
352
352
|
}, 8, ["value"]),
|
|
353
353
|
E(T, {
|
|
354
|
-
value:
|
|
355
|
-
"onUpdate:value": $[2] || ($[2] = (
|
|
354
|
+
value: l.value,
|
|
355
|
+
"onUpdate:value": $[2] || ($[2] = (P) => l.value = P),
|
|
356
356
|
placeholder: "路径",
|
|
357
357
|
size: "small"
|
|
358
358
|
}, null, 8, ["value"])
|
|
@@ -361,10 +361,10 @@ ${T.value}\r
|
|
|
361
361
|
N("div", Yr, [
|
|
362
362
|
E(Ft, {
|
|
363
363
|
modelValue: p.value,
|
|
364
|
-
"onUpdate:modelValue": $[3] || ($[3] = (
|
|
364
|
+
"onUpdate:modelValue": $[3] || ($[3] = (P) => p.value = P),
|
|
365
365
|
"add-button-text": "添加参数",
|
|
366
366
|
"show-preview": !0,
|
|
367
|
-
"preview-text": s.value +
|
|
367
|
+
"preview-text": s.value + l.value + A.value
|
|
368
368
|
}, null, 8, ["modelValue", "preview-text"])
|
|
369
369
|
])
|
|
370
370
|
]),
|
|
@@ -377,9 +377,9 @@ ${T.value}\r
|
|
|
377
377
|
size: "small"
|
|
378
378
|
}, {
|
|
379
379
|
default: R(() => [
|
|
380
|
-
E(
|
|
380
|
+
E(Pn, {
|
|
381
381
|
value: o.value,
|
|
382
|
-
"onUpdate:value": $[4] || ($[4] = (
|
|
382
|
+
"onUpdate:value": $[4] || ($[4] = (P) => o.value = P),
|
|
383
383
|
"button-style": "solid",
|
|
384
384
|
size: "small"
|
|
385
385
|
}, {
|
|
@@ -409,8 +409,8 @@ ${T.value}\r
|
|
|
409
409
|
N("div", ts, [
|
|
410
410
|
$[22] || ($[22] = N("p", { class: "m-0 w-16" }, "用户名", -1)),
|
|
411
411
|
E(T, {
|
|
412
|
-
value:
|
|
413
|
-
"onUpdate:value": $[5] || ($[5] = (
|
|
412
|
+
value: i.value,
|
|
413
|
+
"onUpdate:value": $[5] || ($[5] = (P) => i.value = P),
|
|
414
414
|
size: "small"
|
|
415
415
|
}, null, 8, ["value"])
|
|
416
416
|
]),
|
|
@@ -418,7 +418,7 @@ ${T.value}\r
|
|
|
418
418
|
$[23] || ($[23] = N("p", { class: "m-0 w-16" }, "密码", -1)),
|
|
419
419
|
E(Rr, {
|
|
420
420
|
value: c.value,
|
|
421
|
-
"onUpdate:value": $[6] || ($[6] = (
|
|
421
|
+
"onUpdate:value": $[6] || ($[6] = (P) => c.value = P),
|
|
422
422
|
size: "small"
|
|
423
423
|
}, null, 8, ["value"])
|
|
424
424
|
])
|
|
@@ -428,7 +428,7 @@ ${T.value}\r
|
|
|
428
428
|
$[24] || ($[24] = N("p", { class: "m-0 w-16 h-full" }, "Token", -1)),
|
|
429
429
|
E(jt, {
|
|
430
430
|
value: u.value,
|
|
431
|
-
"onUpdate:value": $[7] || ($[7] = (
|
|
431
|
+
"onUpdate:value": $[7] || ($[7] = (P) => u.value = P),
|
|
432
432
|
size: "small",
|
|
433
433
|
class: "mt-1",
|
|
434
434
|
rows: "4",
|
|
@@ -447,7 +447,7 @@ ${T.value}\r
|
|
|
447
447
|
default: R(() => [
|
|
448
448
|
E(Ft, {
|
|
449
449
|
modelValue: d.value,
|
|
450
|
-
"onUpdate:modelValue": $[8] || ($[8] = (
|
|
450
|
+
"onUpdate:modelValue": $[8] || ($[8] = (P) => d.value = P),
|
|
451
451
|
"add-button-text": "添加请求头",
|
|
452
452
|
"show-preview": !1
|
|
453
453
|
}, null, 8, ["modelValue"])
|
|
@@ -461,9 +461,9 @@ ${T.value}\r
|
|
|
461
461
|
size: "small"
|
|
462
462
|
}, {
|
|
463
463
|
default: R(() => [
|
|
464
|
-
E(
|
|
464
|
+
E(Pn, {
|
|
465
465
|
value: m.value,
|
|
466
|
-
"onUpdate:value": $[9] || ($[9] = (
|
|
466
|
+
"onUpdate:value": $[9] || ($[9] = (P) => m.value = P),
|
|
467
467
|
"button-style": "solid",
|
|
468
468
|
size: "small",
|
|
469
469
|
class: "mb-1"
|
|
@@ -493,7 +493,7 @@ ${T.value}\r
|
|
|
493
493
|
m.value === "application/json" ? (M(), J(_n, { key: 0 }, [
|
|
494
494
|
E(jt, {
|
|
495
495
|
value: _.value,
|
|
496
|
-
"onUpdate:value": $[10] || ($[10] = (
|
|
496
|
+
"onUpdate:value": $[10] || ($[10] = (P) => _.value = P),
|
|
497
497
|
rows: 6,
|
|
498
498
|
placeholder: "请输入 JSON 数据",
|
|
499
499
|
onInput: I
|
|
@@ -509,14 +509,14 @@ ${T.value}\r
|
|
|
509
509
|
m.value === "multipart/form-data" ? (M(), me(Ft, {
|
|
510
510
|
key: 1,
|
|
511
511
|
modelValue: f.value,
|
|
512
|
-
"onUpdate:modelValue": $[11] || ($[11] = (
|
|
512
|
+
"onUpdate:modelValue": $[11] || ($[11] = (P) => f.value = P),
|
|
513
513
|
"add-button-text": "添加表单字段",
|
|
514
514
|
"show-preview": !1
|
|
515
515
|
}, null, 8, ["modelValue"])) : te("", !0),
|
|
516
516
|
m.value === "text/plain" ? (M(), me(jt, {
|
|
517
517
|
key: 2,
|
|
518
518
|
value: g.value,
|
|
519
|
-
"onUpdate:value": $[12] || ($[12] = (
|
|
519
|
+
"onUpdate:value": $[12] || ($[12] = (P) => g.value = P),
|
|
520
520
|
rows: 6,
|
|
521
521
|
placeholder: "请输入原始数据"
|
|
522
522
|
}, null, 8, ["value"])) : te("", !0),
|
|
@@ -556,8 +556,8 @@ async function is(t) {
|
|
|
556
556
|
break;
|
|
557
557
|
case "multipart/form-data":
|
|
558
558
|
const o = new FormData();
|
|
559
|
-
(s = t.body.formData) == null || s.forEach((
|
|
560
|
-
|
|
559
|
+
(s = t.body.formData) == null || s.forEach((l) => {
|
|
560
|
+
l.key && o.append(l.key, l.value);
|
|
561
561
|
}), r.body = o;
|
|
562
562
|
break;
|
|
563
563
|
case "text/plain":
|
|
@@ -565,24 +565,24 @@ async function is(t) {
|
|
|
565
565
|
break;
|
|
566
566
|
}
|
|
567
567
|
try {
|
|
568
|
-
const o = await fetch(n, r),
|
|
568
|
+
const o = await fetch(n, r), l = {};
|
|
569
569
|
o.headers.forEach((u, p) => {
|
|
570
|
-
|
|
570
|
+
l[p.toLowerCase()] = u;
|
|
571
571
|
});
|
|
572
|
-
let
|
|
573
|
-
if ((
|
|
572
|
+
let i = "";
|
|
573
|
+
if ((l["content-type"] || "").startsWith("application/json"))
|
|
574
574
|
try {
|
|
575
575
|
const u = await o.json();
|
|
576
|
-
|
|
576
|
+
i = JSON.stringify(u, null, 2);
|
|
577
577
|
} catch {
|
|
578
|
-
|
|
578
|
+
i = await o.text();
|
|
579
579
|
}
|
|
580
580
|
else
|
|
581
|
-
|
|
581
|
+
i = await o.text();
|
|
582
582
|
return {
|
|
583
583
|
status: o.status.toString(),
|
|
584
|
-
headers:
|
|
585
|
-
body:
|
|
584
|
+
headers: l,
|
|
585
|
+
body: i
|
|
586
586
|
};
|
|
587
587
|
} catch {
|
|
588
588
|
throw new Error("Request failed");
|
|
@@ -590,9 +590,9 @@ async function is(t) {
|
|
|
590
590
|
}
|
|
591
591
|
async function ls(t) {
|
|
592
592
|
return new Promise((e, n) => {
|
|
593
|
-
var
|
|
594
|
-
const a = new XMLHttpRequest(), r = t.auth.type === "Basic" ? t.auth.username : null, s = t.auth.type === "Basic" ? t.auth.password : null, o = t.params.filter((c) => !!c.key).map((c) => `${c.key}=${encodeURIComponent(c.value)}`).join("&"),
|
|
595
|
-
if (a.open(t.method,
|
|
593
|
+
var i;
|
|
594
|
+
const a = new XMLHttpRequest(), r = t.auth.type === "Basic" ? t.auth.username : null, s = t.auth.type === "Basic" ? t.auth.password : null, o = t.params.filter((c) => !!c.key).map((c) => `${c.key}=${encodeURIComponent(c.value)}`).join("&"), l = `${t.url}${t.path}${o ? "?" + o : ""}`;
|
|
595
|
+
if (a.open(t.method, l, !0, r, s), t.headers.forEach((c) => {
|
|
596
596
|
c.key && a.setRequestHeader(c.key, c.value);
|
|
597
597
|
}), t.auth.type === "Bearer" && t.auth.token && a.setRequestHeader("Authorization", `Bearer ${t.auth.token}`), t.method === "POST" || t.method === "PUT") {
|
|
598
598
|
let c = "";
|
|
@@ -602,7 +602,7 @@ async function ls(t) {
|
|
|
602
602
|
break;
|
|
603
603
|
case "multipart/form-data":
|
|
604
604
|
const u = new FormData();
|
|
605
|
-
(
|
|
605
|
+
(i = t.body.formData) == null || i.forEach((p) => {
|
|
606
606
|
p.key && u.append(p.key, p.value);
|
|
607
607
|
}), c = u;
|
|
608
608
|
break;
|
|
@@ -636,8 +636,8 @@ async function ls(t) {
|
|
|
636
636
|
function cs(t) {
|
|
637
637
|
const e = t.getAllResponseHeaders().trim().split(/[\r\n]+/), n = {};
|
|
638
638
|
return e.forEach(function(a) {
|
|
639
|
-
var
|
|
640
|
-
const r = a.split(": "), s = ((
|
|
639
|
+
var l;
|
|
640
|
+
const r = a.split(": "), s = ((l = r.shift()) == null ? void 0 : l.toLowerCase()) || "", o = r.join(": ");
|
|
641
641
|
n[s] = o;
|
|
642
642
|
}), n;
|
|
643
643
|
}
|
|
@@ -655,24 +655,24 @@ const us = { style: { display: "flex", "align-items": "center", gap: "8px", "mar
|
|
|
655
655
|
headers: {},
|
|
656
656
|
body: "",
|
|
657
657
|
timing: 0
|
|
658
|
-
}), r = L(""), s = (
|
|
659
|
-
const c = Number(
|
|
658
|
+
}), r = L(""), s = (i) => {
|
|
659
|
+
const c = Number(i);
|
|
660
660
|
return c >= 200 && c < 300 ? "success" : c >= 300 && c < 400 ? "warning" : c >= 400 && c < 500 || c >= 500 ? "error" : "default";
|
|
661
|
-
}, o = (
|
|
661
|
+
}, o = (i) => i instanceof Error ? i.message : "请求失败", l = async () => {
|
|
662
662
|
r.value = "";
|
|
663
|
-
const
|
|
663
|
+
const i = Date.now();
|
|
664
664
|
try {
|
|
665
|
-
a.value = await os(e.modelValue, n.value), a.value.timing = Date.now() -
|
|
665
|
+
a.value = await os(e.modelValue, n.value), a.value.timing = Date.now() - i;
|
|
666
666
|
} catch (c) {
|
|
667
667
|
r.value = o(c), a.value = {
|
|
668
668
|
status: "Error",
|
|
669
669
|
headers: {},
|
|
670
670
|
body: c instanceof Error ? c.message : "Request failed",
|
|
671
|
-
timing: Date.now() -
|
|
671
|
+
timing: Date.now() - i
|
|
672
672
|
};
|
|
673
673
|
}
|
|
674
674
|
};
|
|
675
|
-
return (
|
|
675
|
+
return (i, c) => {
|
|
676
676
|
const u = j("a-radio-button"), p = j("a-radio-group"), d = j("a-button"), f = j("a-alert"), m = j("a-tag"), _ = j("a-textarea"), g = j("a-card");
|
|
677
677
|
return M(), me(g, {
|
|
678
678
|
title: "响应",
|
|
@@ -705,7 +705,7 @@ const us = { style: { display: "flex", "align-items": "center", gap: "8px", "mar
|
|
|
705
705
|
}, 8, ["value"]),
|
|
706
706
|
E(d, {
|
|
707
707
|
type: "primary",
|
|
708
|
-
onClick:
|
|
708
|
+
onClick: l,
|
|
709
709
|
size: "small"
|
|
710
710
|
}, {
|
|
711
711
|
default: R(() => c[4] || (c[4] = [
|
|
@@ -804,18 +804,18 @@ var Dt = /\$(\d+)|\${(\d+):\/(downcase|upcase)}/g, ct = class {
|
|
|
804
804
|
}
|
|
805
805
|
static replaceCaptures(t, e, n) {
|
|
806
806
|
return t.replace(Dt, (a, r, s, o) => {
|
|
807
|
-
let
|
|
808
|
-
if (
|
|
809
|
-
let
|
|
810
|
-
for (;
|
|
811
|
-
|
|
807
|
+
let l = n[parseInt(r || s, 10)];
|
|
808
|
+
if (l) {
|
|
809
|
+
let i = e.substring(l.start, l.end);
|
|
810
|
+
for (; i[0] === "."; )
|
|
811
|
+
i = i.substring(1);
|
|
812
812
|
switch (o) {
|
|
813
813
|
case "downcase":
|
|
814
|
-
return
|
|
814
|
+
return i.toLowerCase();
|
|
815
815
|
case "upcase":
|
|
816
|
-
return
|
|
816
|
+
return i.toUpperCase();
|
|
817
817
|
default:
|
|
818
|
-
return
|
|
818
|
+
return i;
|
|
819
819
|
}
|
|
820
820
|
} else
|
|
821
821
|
return a;
|
|
@@ -969,28 +969,28 @@ function vs(t) {
|
|
|
969
969
|
let o = e[r];
|
|
970
970
|
if (!o.settings)
|
|
971
971
|
continue;
|
|
972
|
-
let
|
|
972
|
+
let l;
|
|
973
973
|
if (typeof o.scope == "string") {
|
|
974
974
|
let p = o.scope;
|
|
975
|
-
p = p.replace(/^[,]+/, ""), p = p.replace(/[,]+$/, ""),
|
|
976
|
-
} else Array.isArray(o.scope) ?
|
|
977
|
-
let
|
|
975
|
+
p = p.replace(/^[,]+/, ""), p = p.replace(/[,]+$/, ""), l = p.split(",");
|
|
976
|
+
} else Array.isArray(o.scope) ? l = o.scope : l = [""];
|
|
977
|
+
let i = -1;
|
|
978
978
|
if (typeof o.settings.fontStyle == "string") {
|
|
979
|
-
|
|
979
|
+
i = 0;
|
|
980
980
|
let p = o.settings.fontStyle.split(" ");
|
|
981
981
|
for (let d = 0, f = p.length; d < f; d++)
|
|
982
982
|
switch (p[d]) {
|
|
983
983
|
case "italic":
|
|
984
|
-
|
|
984
|
+
i = i | 1;
|
|
985
985
|
break;
|
|
986
986
|
case "bold":
|
|
987
|
-
|
|
987
|
+
i = i | 2;
|
|
988
988
|
break;
|
|
989
989
|
case "underline":
|
|
990
|
-
|
|
990
|
+
i = i | 4;
|
|
991
991
|
break;
|
|
992
992
|
case "strikethrough":
|
|
993
|
-
|
|
993
|
+
i = i | 8;
|
|
994
994
|
break;
|
|
995
995
|
}
|
|
996
996
|
}
|
|
@@ -998,13 +998,13 @@ function vs(t) {
|
|
|
998
998
|
typeof o.settings.foreground == "string" && jn(o.settings.foreground) && (c = o.settings.foreground);
|
|
999
999
|
let u = null;
|
|
1000
1000
|
typeof o.settings.background == "string" && jn(o.settings.background) && (u = o.settings.background);
|
|
1001
|
-
for (let p = 0, d =
|
|
1002
|
-
let m =
|
|
1001
|
+
for (let p = 0, d = l.length; p < d; p++) {
|
|
1002
|
+
let m = l[p].trim().split(" "), _ = m[m.length - 1], g = null;
|
|
1003
1003
|
m.length > 1 && (g = m.slice(0, m.length - 1), g.reverse()), n[a++] = new Cs(
|
|
1004
1004
|
_,
|
|
1005
1005
|
g,
|
|
1006
1006
|
r,
|
|
1007
|
-
|
|
1007
|
+
i,
|
|
1008
1008
|
c,
|
|
1009
1009
|
u
|
|
1010
1010
|
);
|
|
@@ -1018,21 +1018,21 @@ var Cs = class {
|
|
|
1018
1018
|
}
|
|
1019
1019
|
}, Z = /* @__PURE__ */ ((t) => (t[t.NotSet = -1] = "NotSet", t[t.None = 0] = "None", t[t.Italic = 1] = "Italic", t[t.Bold = 2] = "Bold", t[t.Underline = 4] = "Underline", t[t.Strikethrough = 8] = "Strikethrough", t))(Z || {});
|
|
1020
1020
|
function xs(t, e) {
|
|
1021
|
-
t.sort((
|
|
1022
|
-
let u = Ea(
|
|
1023
|
-
return u !== 0 || (u = Aa(
|
|
1021
|
+
t.sort((i, c) => {
|
|
1022
|
+
let u = Ea(i.scope, c.scope);
|
|
1023
|
+
return u !== 0 || (u = Aa(i.parentScopes, c.parentScopes), u !== 0) ? u : i.index - c.index;
|
|
1024
1024
|
});
|
|
1025
1025
|
let n = 0, a = "#000000", r = "#ffffff";
|
|
1026
1026
|
for (; t.length >= 1 && t[0].scope === ""; ) {
|
|
1027
|
-
let
|
|
1028
|
-
|
|
1027
|
+
let i = t.shift();
|
|
1028
|
+
i.fontStyle !== -1 && (n = i.fontStyle), i.foreground !== null && (a = i.foreground), i.background !== null && (r = i.background);
|
|
1029
1029
|
}
|
|
1030
|
-
let s = new Ss(e), o = new Na(n, s.getId(a), s.getId(r)),
|
|
1031
|
-
for (let
|
|
1032
|
-
let u = t[
|
|
1033
|
-
|
|
1030
|
+
let s = new Ss(e), o = new Na(n, s.getId(a), s.getId(r)), l = new As(new tn(0, null, -1, 0, 0), []);
|
|
1031
|
+
for (let i = 0, c = t.length; i < c; i++) {
|
|
1032
|
+
let u = t[i];
|
|
1033
|
+
l.insert(0, u.scope, u.parentScopes, u.fontStyle, s.getId(u.foreground), s.getId(u.background));
|
|
1034
1034
|
}
|
|
1035
|
-
return new yt(s, o,
|
|
1035
|
+
return new yt(s, o, l);
|
|
1036
1036
|
}
|
|
1037
1037
|
var Ss = class {
|
|
1038
1038
|
constructor(t) {
|
|
@@ -1061,7 +1061,7 @@ var Ss = class {
|
|
|
1061
1061
|
getColorMap() {
|
|
1062
1062
|
return this._id2color.slice(0);
|
|
1063
1063
|
}
|
|
1064
|
-
}, Es = Object.freeze([]), tn = class
|
|
1064
|
+
}, Es = Object.freeze([]), tn = class Ba {
|
|
1065
1065
|
constructor(e, n, a, r, s) {
|
|
1066
1066
|
h(this, "scopeDepth");
|
|
1067
1067
|
h(this, "parentScopes");
|
|
@@ -1071,7 +1071,7 @@ var Ss = class {
|
|
|
1071
1071
|
this.scopeDepth = e, this.parentScopes = n || Es, this.fontStyle = a, this.foreground = r, this.background = s;
|
|
1072
1072
|
}
|
|
1073
1073
|
clone() {
|
|
1074
|
-
return new
|
|
1074
|
+
return new Ba(this.scopeDepth, this.parentScopes, this.fontStyle, this.foreground, this.background);
|
|
1075
1075
|
}
|
|
1076
1076
|
static cloneArr(e) {
|
|
1077
1077
|
let n = [];
|
|
@@ -1113,20 +1113,20 @@ var Ss = class {
|
|
|
1113
1113
|
this._doInsertHere(e, a, r, s, o);
|
|
1114
1114
|
return;
|
|
1115
1115
|
}
|
|
1116
|
-
let
|
|
1117
|
-
|
|
1116
|
+
let l = n.indexOf("."), i, c;
|
|
1117
|
+
l === -1 ? (i = n, c = "") : (i = n.substring(0, l), c = n.substring(l + 1));
|
|
1118
1118
|
let u;
|
|
1119
|
-
this._children.hasOwnProperty(
|
|
1119
|
+
this._children.hasOwnProperty(i) ? u = this._children[i] : (u = new nn(this._mainRule.clone(), tn.cloneArr(this._rulesWithParentScopes)), this._children[i] = u), u.insert(e + 1, c, a, r, s, o);
|
|
1120
1120
|
}
|
|
1121
1121
|
_doInsertHere(e, n, a, r, s) {
|
|
1122
1122
|
if (n === null) {
|
|
1123
1123
|
this._mainRule.acceptOverwrite(e, a, r, s);
|
|
1124
1124
|
return;
|
|
1125
1125
|
}
|
|
1126
|
-
for (let o = 0,
|
|
1127
|
-
let
|
|
1128
|
-
if (Aa(
|
|
1129
|
-
|
|
1126
|
+
for (let o = 0, l = this._rulesWithParentScopes.length; o < l; o++) {
|
|
1127
|
+
let i = this._rulesWithParentScopes[o];
|
|
1128
|
+
if (Aa(i.parentScopes, n) === 0) {
|
|
1129
|
+
i.acceptOverwrite(e, a, r, s);
|
|
1130
1130
|
return;
|
|
1131
1131
|
}
|
|
1132
1132
|
}
|
|
@@ -1168,23 +1168,23 @@ var Ss = class {
|
|
|
1168
1168
|
* Updates the fields in `metadata`.
|
|
1169
1169
|
* A value of `0`, `NotSet` or `null` indicates that the corresponding field should be left as is.
|
|
1170
1170
|
*/
|
|
1171
|
-
static set(e, n, a, r, s, o,
|
|
1172
|
-
let
|
|
1173
|
-
return n !== 0 && (
|
|
1171
|
+
static set(e, n, a, r, s, o, l) {
|
|
1172
|
+
let i = ee.getLanguageId(e), c = ee.getTokenType(e), u = ee.containsBalancedBrackets(e) ? 1 : 0, p = ee.getFontStyle(e), d = ee.getForeground(e), f = ee.getBackground(e);
|
|
1173
|
+
return n !== 0 && (i = n), a !== 8 && (c = a), r !== null && (u = r ? 1 : 0), s !== -1 && (p = s), o !== 0 && (d = o), l !== 0 && (f = l), (i << 0 | c << 8 | u << 10 | p << 11 | d << 15 | f << 24) >>> 0;
|
|
1174
1174
|
}
|
|
1175
1175
|
};
|
|
1176
1176
|
function _t(t, e) {
|
|
1177
1177
|
const n = [], a = Is(t);
|
|
1178
1178
|
let r = a.next();
|
|
1179
1179
|
for (; r !== null; ) {
|
|
1180
|
-
let
|
|
1180
|
+
let i = 0;
|
|
1181
1181
|
if (r.length === 2 && r.charAt(1) === ":") {
|
|
1182
1182
|
switch (r.charAt(0)) {
|
|
1183
1183
|
case "R":
|
|
1184
|
-
|
|
1184
|
+
i = 1;
|
|
1185
1185
|
break;
|
|
1186
1186
|
case "L":
|
|
1187
|
-
|
|
1187
|
+
i = -1;
|
|
1188
1188
|
break;
|
|
1189
1189
|
default:
|
|
1190
1190
|
console.log(`Unknown priority ${r} in scope selector`);
|
|
@@ -1192,7 +1192,7 @@ function _t(t, e) {
|
|
|
1192
1192
|
r = a.next();
|
|
1193
1193
|
}
|
|
1194
1194
|
let c = o();
|
|
1195
|
-
if (n.push({ matcher: c, priority:
|
|
1195
|
+
if (n.push({ matcher: c, priority: i }), r !== ",")
|
|
1196
1196
|
break;
|
|
1197
1197
|
r = a.next();
|
|
1198
1198
|
}
|
|
@@ -1200,40 +1200,40 @@ function _t(t, e) {
|
|
|
1200
1200
|
function s() {
|
|
1201
1201
|
if (r === "-") {
|
|
1202
1202
|
r = a.next();
|
|
1203
|
-
const
|
|
1204
|
-
return (c) => !!
|
|
1203
|
+
const i = s();
|
|
1204
|
+
return (c) => !!i && !i(c);
|
|
1205
1205
|
}
|
|
1206
1206
|
if (r === "(") {
|
|
1207
1207
|
r = a.next();
|
|
1208
|
-
const
|
|
1209
|
-
return r === ")" && (r = a.next()),
|
|
1208
|
+
const i = l();
|
|
1209
|
+
return r === ")" && (r = a.next()), i;
|
|
1210
1210
|
}
|
|
1211
1211
|
if (Mn(r)) {
|
|
1212
|
-
const
|
|
1212
|
+
const i = [];
|
|
1213
1213
|
do
|
|
1214
|
-
|
|
1214
|
+
i.push(r), r = a.next();
|
|
1215
1215
|
while (Mn(r));
|
|
1216
|
-
return (c) => e(
|
|
1216
|
+
return (c) => e(i, c);
|
|
1217
1217
|
}
|
|
1218
1218
|
return null;
|
|
1219
1219
|
}
|
|
1220
1220
|
function o() {
|
|
1221
|
-
const
|
|
1221
|
+
const i = [];
|
|
1222
1222
|
let c = s();
|
|
1223
1223
|
for (; c; )
|
|
1224
|
-
|
|
1225
|
-
return (u) =>
|
|
1224
|
+
i.push(c), c = s();
|
|
1225
|
+
return (u) => i.every((p) => p(u));
|
|
1226
1226
|
}
|
|
1227
|
-
function
|
|
1228
|
-
const
|
|
1227
|
+
function l() {
|
|
1228
|
+
const i = [];
|
|
1229
1229
|
let c = o();
|
|
1230
|
-
for (; c && (
|
|
1230
|
+
for (; c && (i.push(c), r === "|" || r === ","); ) {
|
|
1231
1231
|
do
|
|
1232
1232
|
r = a.next();
|
|
1233
1233
|
while (r === "|" || r === ",");
|
|
1234
1234
|
c = o();
|
|
1235
1235
|
}
|
|
1236
|
-
return (u) =>
|
|
1236
|
+
return (u) => i.some((p) => p(u));
|
|
1237
1237
|
}
|
|
1238
1238
|
}
|
|
1239
1239
|
function Mn(t) {
|
|
@@ -1250,7 +1250,7 @@ function Is(t) {
|
|
|
1250
1250
|
}
|
|
1251
1251
|
};
|
|
1252
1252
|
}
|
|
1253
|
-
function
|
|
1253
|
+
function Pa(t) {
|
|
1254
1254
|
typeof t.dispose == "function" && t.dispose();
|
|
1255
1255
|
}
|
|
1256
1256
|
var Ye = class {
|
|
@@ -1280,7 +1280,7 @@ var Ye = class {
|
|
|
1280
1280
|
const e = t.toKey();
|
|
1281
1281
|
this._seenReferenceKeys.has(e) || (this._seenReferenceKeys.add(e), this._references.push(t));
|
|
1282
1282
|
}
|
|
1283
|
-
},
|
|
1283
|
+
}, Bs = class {
|
|
1284
1284
|
constructor(t, e) {
|
|
1285
1285
|
h(this, "seenFullScopeRequests", /* @__PURE__ */ new Set());
|
|
1286
1286
|
h(this, "seenPartialScopeRequests", /* @__PURE__ */ new Set());
|
|
@@ -1292,7 +1292,7 @@ var Ye = class {
|
|
|
1292
1292
|
this.Q = [];
|
|
1293
1293
|
const e = new Ns();
|
|
1294
1294
|
for (const n of t)
|
|
1295
|
-
|
|
1295
|
+
Ps(n, this.initialScopeName, this.repo, e);
|
|
1296
1296
|
for (const n of e.references)
|
|
1297
1297
|
if (n instanceof Ye) {
|
|
1298
1298
|
if (this.seenFullScopeRequests.has(n.scopeName))
|
|
@@ -1305,7 +1305,7 @@ var Ye = class {
|
|
|
1305
1305
|
}
|
|
1306
1306
|
}
|
|
1307
1307
|
};
|
|
1308
|
-
function
|
|
1308
|
+
function Ps(t, e, n, a) {
|
|
1309
1309
|
const r = n.lookup(t.scopeName);
|
|
1310
1310
|
if (!r) {
|
|
1311
1311
|
if (t.scopeName === e)
|
|
@@ -1320,8 +1320,8 @@ function Bs(t, e, n, a) {
|
|
|
1320
1320
|
);
|
|
1321
1321
|
const o = n.injections(t.scopeName);
|
|
1322
1322
|
if (o)
|
|
1323
|
-
for (const
|
|
1324
|
-
a.add(new Ye(
|
|
1323
|
+
for (const l of o)
|
|
1324
|
+
a.add(new Ye(l));
|
|
1325
1325
|
}
|
|
1326
1326
|
function an(t, e, n) {
|
|
1327
1327
|
if (e.repository && e.repository[t]) {
|
|
@@ -1363,10 +1363,10 @@ function $t(t, e, n) {
|
|
|
1363
1363
|
break;
|
|
1364
1364
|
case 3:
|
|
1365
1365
|
case 4:
|
|
1366
|
-
const
|
|
1367
|
-
if (
|
|
1368
|
-
const
|
|
1369
|
-
o.kind === 4 ? an(o.ruleName,
|
|
1366
|
+
const l = o.scopeName === e.selfGrammar.scopeName ? e.selfGrammar : o.scopeName === e.baseGrammar.scopeName ? e.baseGrammar : void 0;
|
|
1367
|
+
if (l) {
|
|
1368
|
+
const i = { baseGrammar: e.baseGrammar, selfGrammar: l, repository: r };
|
|
1369
|
+
o.kind === 4 ? an(o.ruleName, i, n) : gt(i, n);
|
|
1370
1370
|
} else
|
|
1371
1371
|
o.kind === 4 ? n.add(new Rs(o.scopeName, o.ruleName)) : n.add(new Ye(o.scopeName));
|
|
1372
1372
|
break;
|
|
@@ -1501,7 +1501,7 @@ var ot = class {
|
|
|
1501
1501
|
return this._cachedCompiledPatterns || (this._cachedCompiledPatterns = new tt(), this.collectPatterns(e, this._cachedCompiledPatterns)), this._cachedCompiledPatterns;
|
|
1502
1502
|
}
|
|
1503
1503
|
}, rn = class extends ot {
|
|
1504
|
-
constructor(e, n, a, r, s, o,
|
|
1504
|
+
constructor(e, n, a, r, s, o, l, i, c, u) {
|
|
1505
1505
|
super(e, n, a, r);
|
|
1506
1506
|
h(this, "_begin");
|
|
1507
1507
|
h(this, "beginCaptures");
|
|
@@ -1512,7 +1512,7 @@ var ot = class {
|
|
|
1512
1512
|
h(this, "hasMissingPatterns");
|
|
1513
1513
|
h(this, "patterns");
|
|
1514
1514
|
h(this, "_cachedCompiledPatterns");
|
|
1515
|
-
this._begin = new et(s, this.id), this.beginCaptures = o, this._end = new et(
|
|
1515
|
+
this._begin = new et(s, this.id), this.beginCaptures = o, this._end = new et(l || "", -1), this.endHasBackReferences = this._end.hasBackReferences, this.endCaptures = i, this.applyEndPatternLast = c || !1, this.patterns = u.patterns, this.hasMissingPatterns = u.hasMissingPatterns, this._cachedCompiledPatterns = null;
|
|
1516
1516
|
}
|
|
1517
1517
|
dispose() {
|
|
1518
1518
|
this._cachedCompiledPatterns && (this._cachedCompiledPatterns.dispose(), this._cachedCompiledPatterns = null);
|
|
@@ -1545,7 +1545,7 @@ var ot = class {
|
|
|
1545
1545
|
return this._end.hasBackReferences && (this.applyEndPatternLast ? this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length() - 1, n) : this._cachedCompiledPatterns.setSource(0, n)), this._cachedCompiledPatterns;
|
|
1546
1546
|
}
|
|
1547
1547
|
}, wt = class extends ot {
|
|
1548
|
-
constructor(e, n, a, r, s, o,
|
|
1548
|
+
constructor(e, n, a, r, s, o, l, i, c) {
|
|
1549
1549
|
super(e, n, a, r);
|
|
1550
1550
|
h(this, "_begin");
|
|
1551
1551
|
h(this, "beginCaptures");
|
|
@@ -1556,7 +1556,7 @@ var ot = class {
|
|
|
1556
1556
|
h(this, "patterns");
|
|
1557
1557
|
h(this, "_cachedCompiledPatterns");
|
|
1558
1558
|
h(this, "_cachedCompiledWhilePatterns");
|
|
1559
|
-
this._begin = new et(s, this.id), this.beginCaptures = o, this.whileCaptures =
|
|
1559
|
+
this._begin = new et(s, this.id), this.beginCaptures = o, this.whileCaptures = i, this._while = new et(l, La), this.whileHasBackReferences = this._while.hasBackReferences, this.patterns = c.patterns, this.hasMissingPatterns = c.hasMissingPatterns, this._cachedCompiledPatterns = null, this._cachedCompiledWhilePatterns = null;
|
|
1560
1560
|
}
|
|
1561
1561
|
dispose() {
|
|
1562
1562
|
this._cachedCompiledPatterns && (this._cachedCompiledPatterns.dispose(), this._cachedCompiledPatterns = null), this._cachedCompiledWhilePatterns && (this._cachedCompiledWhilePatterns.dispose(), this._cachedCompiledWhilePatterns = null);
|
|
@@ -1652,17 +1652,17 @@ var ot = class {
|
|
|
1652
1652
|
for (const o in e) {
|
|
1653
1653
|
if (o === "$vscodeTextmateLocation")
|
|
1654
1654
|
continue;
|
|
1655
|
-
const
|
|
1656
|
-
|
|
1655
|
+
const l = parseInt(o, 10);
|
|
1656
|
+
l > s && (s = l);
|
|
1657
1657
|
}
|
|
1658
1658
|
for (let o = 0; o <= s; o++)
|
|
1659
1659
|
r[o] = null;
|
|
1660
1660
|
for (const o in e) {
|
|
1661
1661
|
if (o === "$vscodeTextmateLocation")
|
|
1662
1662
|
continue;
|
|
1663
|
-
const
|
|
1664
|
-
let
|
|
1665
|
-
e[o].patterns && (
|
|
1663
|
+
const l = parseInt(o, 10);
|
|
1664
|
+
let i = 0;
|
|
1665
|
+
e[o].patterns && (i = V.getCompiledRuleId(e[o], n, a)), r[l] = V.createCaptureRule(n, e[o].$vscodeTextmateLocation, e[o].name, e[o].contentName, i);
|
|
1666
1666
|
}
|
|
1667
1667
|
}
|
|
1668
1668
|
return r;
|
|
@@ -1671,18 +1671,18 @@ var ot = class {
|
|
|
1671
1671
|
let r = [];
|
|
1672
1672
|
if (e)
|
|
1673
1673
|
for (let s = 0, o = e.length; s < o; s++) {
|
|
1674
|
-
const
|
|
1675
|
-
let
|
|
1676
|
-
if (
|
|
1677
|
-
const c = Ta(
|
|
1674
|
+
const l = e[s];
|
|
1675
|
+
let i = -1;
|
|
1676
|
+
if (l.include) {
|
|
1677
|
+
const c = Ta(l.include);
|
|
1678
1678
|
switch (c.kind) {
|
|
1679
1679
|
case 0:
|
|
1680
1680
|
case 1:
|
|
1681
|
-
|
|
1681
|
+
i = V.getCompiledRuleId(a[l.include], n, a);
|
|
1682
1682
|
break;
|
|
1683
1683
|
case 2:
|
|
1684
1684
|
let u = a[c.ruleName];
|
|
1685
|
-
u && (
|
|
1685
|
+
u && (i = V.getCompiledRuleId(u, n, a));
|
|
1686
1686
|
break;
|
|
1687
1687
|
case 3:
|
|
1688
1688
|
case 4:
|
|
@@ -1690,19 +1690,19 @@ var ot = class {
|
|
|
1690
1690
|
if (f)
|
|
1691
1691
|
if (d) {
|
|
1692
1692
|
let m = f.repository[d];
|
|
1693
|
-
m && (
|
|
1693
|
+
m && (i = V.getCompiledRuleId(m, n, f.repository));
|
|
1694
1694
|
} else
|
|
1695
|
-
|
|
1695
|
+
i = V.getCompiledRuleId(f.repository.$self, n, f.repository);
|
|
1696
1696
|
break;
|
|
1697
1697
|
}
|
|
1698
1698
|
} else
|
|
1699
|
-
|
|
1700
|
-
if (
|
|
1701
|
-
const c = n.getRule(
|
|
1699
|
+
i = V.getCompiledRuleId(l, n, a);
|
|
1700
|
+
if (i !== -1) {
|
|
1701
|
+
const c = n.getRule(i);
|
|
1702
1702
|
let u = !1;
|
|
1703
1703
|
if ((c instanceof Gn || c instanceof rn || c instanceof wt) && c.hasMissingPatterns && c.patterns.length === 0 && (u = !0), u)
|
|
1704
1704
|
continue;
|
|
1705
|
-
r.push(
|
|
1705
|
+
r.push(i);
|
|
1706
1706
|
}
|
|
1707
1707
|
}
|
|
1708
1708
|
return {
|
|
@@ -1720,10 +1720,10 @@ var ot = class {
|
|
|
1720
1720
|
if (e && typeof e == "string") {
|
|
1721
1721
|
const a = e.length;
|
|
1722
1722
|
let r = 0, s = [], o = !1;
|
|
1723
|
-
for (let
|
|
1724
|
-
if (e.charAt(
|
|
1725
|
-
const c = e.charAt(
|
|
1726
|
-
c === "z" ? (s.push(e.substring(r,
|
|
1723
|
+
for (let l = 0; l < a; l++)
|
|
1724
|
+
if (e.charAt(l) === "\\" && l + 1 < a) {
|
|
1725
|
+
const c = e.charAt(l + 1);
|
|
1726
|
+
c === "z" ? (s.push(e.substring(r, l)), s.push("$(?!\\n)(?<!\\n)"), r = l + 2) : (c === "A" || c === "G") && (o = !0), l++;
|
|
1727
1727
|
}
|
|
1728
1728
|
this.hasAnchor = o, r === 0 ? this.source = e : (s.push(e.substring(r, a)), this.source = s.join(""));
|
|
1729
1729
|
} else
|
|
@@ -1745,9 +1745,9 @@ var ot = class {
|
|
|
1745
1745
|
_buildAnchorCache() {
|
|
1746
1746
|
if (typeof this.source != "string")
|
|
1747
1747
|
throw new Error("This method should only be called if the source is a string");
|
|
1748
|
-
let e = [], n = [], a = [], r = [], s, o,
|
|
1748
|
+
let e = [], n = [], a = [], r = [], s, o, l, i;
|
|
1749
1749
|
for (s = 0, o = this.source.length; s < o; s++)
|
|
1750
|
-
|
|
1750
|
+
l = this.source.charAt(s), e[s] = l, n[s] = l, a[s] = l, r[s] = l, l === "\\" && s + 1 < o && (i = this.source.charAt(s + 1), i === "A" ? (e[s + 1] = "", n[s + 1] = "", a[s + 1] = "A", r[s + 1] = "A") : i === "G" ? (e[s + 1] = "", n[s + 1] = "G", a[s + 1] = "", r[s + 1] = "G") : (e[s + 1] = i, n[s + 1] = i, a[s + 1] = i, r[s + 1] = i), s++);
|
|
1751
1751
|
return {
|
|
1752
1752
|
A0_G0: e.join(""),
|
|
1753
1753
|
A0_G1: n.join(""),
|
|
@@ -1903,8 +1903,8 @@ var Dn = class {
|
|
|
1903
1903
|
this.stack = t, this.stoppedEarly = e;
|
|
1904
1904
|
}
|
|
1905
1905
|
};
|
|
1906
|
-
function Oa(t, e, n, a, r, s, o,
|
|
1907
|
-
const
|
|
1906
|
+
function Oa(t, e, n, a, r, s, o, l) {
|
|
1907
|
+
const i = e.content.length;
|
|
1908
1908
|
let c = !1, u = -1;
|
|
1909
1909
|
if (o) {
|
|
1910
1910
|
const f = Hs(
|
|
@@ -1919,7 +1919,7 @@ function Oa(t, e, n, a, r, s, o, i) {
|
|
|
1919
1919
|
}
|
|
1920
1920
|
const p = Date.now();
|
|
1921
1921
|
for (; !c; ) {
|
|
1922
|
-
if (
|
|
1922
|
+
if (l !== 0 && Date.now() - p > l)
|
|
1923
1923
|
return new Dn(r, !0);
|
|
1924
1924
|
d();
|
|
1925
1925
|
}
|
|
@@ -1934,7 +1934,7 @@ function Oa(t, e, n, a, r, s, o, i) {
|
|
|
1934
1934
|
u
|
|
1935
1935
|
);
|
|
1936
1936
|
if (!f) {
|
|
1937
|
-
s.produce(r,
|
|
1937
|
+
s.produce(r, i), c = !0;
|
|
1938
1938
|
return;
|
|
1939
1939
|
}
|
|
1940
1940
|
const m = f.captureIndices, _ = f.matchedRuleId, g = m && m.length > 0 ? m[0].end > a : !1;
|
|
@@ -1951,7 +1951,7 @@ function Oa(t, e, n, a, r, s, o, i) {
|
|
|
1951
1951
|
), s.produce(r, m[0].end);
|
|
1952
1952
|
const w = r;
|
|
1953
1953
|
if (r = r.parent, u = w.getAnchorPos(), !g && w.getEnterPos() === a) {
|
|
1954
|
-
r = w, s.produce(r,
|
|
1954
|
+
r = w, s.produce(r, i), c = !0;
|
|
1955
1955
|
return;
|
|
1956
1956
|
}
|
|
1957
1957
|
} else {
|
|
@@ -1965,7 +1965,7 @@ function Oa(t, e, n, a, r, s, o, i) {
|
|
|
1965
1965
|
_,
|
|
1966
1966
|
a,
|
|
1967
1967
|
u,
|
|
1968
|
-
m[0].end ===
|
|
1968
|
+
m[0].end === i,
|
|
1969
1969
|
null,
|
|
1970
1970
|
v,
|
|
1971
1971
|
v
|
|
@@ -1993,7 +1993,7 @@ function Oa(t, e, n, a, r, s, o, i) {
|
|
|
1993
1993
|
m
|
|
1994
1994
|
)
|
|
1995
1995
|
)), !g && w.hasSameRuleAs(r)) {
|
|
1996
|
-
r = r.pop(), s.produce(r,
|
|
1996
|
+
r = r.pop(), s.produce(r, i), c = !0;
|
|
1997
1997
|
return;
|
|
1998
1998
|
}
|
|
1999
1999
|
} else if (b instanceof wt) {
|
|
@@ -2020,7 +2020,7 @@ function Oa(t, e, n, a, r, s, o, i) {
|
|
|
2020
2020
|
m
|
|
2021
2021
|
)
|
|
2022
2022
|
)), !g && w.hasSameRuleAs(r)) {
|
|
2023
|
-
r = r.pop(), s.produce(r,
|
|
2023
|
+
r = r.pop(), s.produce(r, i), c = !0;
|
|
2024
2024
|
return;
|
|
2025
2025
|
}
|
|
2026
2026
|
} else if (Ze(
|
|
@@ -2032,7 +2032,7 @@ function Oa(t, e, n, a, r, s, o, i) {
|
|
|
2032
2032
|
b.captures,
|
|
2033
2033
|
m
|
|
2034
2034
|
), s.produce(r, m[0].end), r = r.pop(), !g) {
|
|
2035
|
-
r = r.safePop(), s.produce(r,
|
|
2035
|
+
r = r.safePop(), s.produce(r, i), c = !0;
|
|
2036
2036
|
return;
|
|
2037
2037
|
}
|
|
2038
2038
|
}
|
|
@@ -2041,50 +2041,50 @@ function Oa(t, e, n, a, r, s, o, i) {
|
|
|
2041
2041
|
}
|
|
2042
2042
|
function Hs(t, e, n, a, r, s) {
|
|
2043
2043
|
let o = r.beginRuleCapturedEOL ? 0 : -1;
|
|
2044
|
-
const
|
|
2045
|
-
for (let
|
|
2046
|
-
const c =
|
|
2047
|
-
c instanceof wt &&
|
|
2044
|
+
const l = [];
|
|
2045
|
+
for (let i = r; i; i = i.pop()) {
|
|
2046
|
+
const c = i.getRule(t);
|
|
2047
|
+
c instanceof wt && l.push({
|
|
2048
2048
|
rule: c,
|
|
2049
|
-
stack:
|
|
2049
|
+
stack: i
|
|
2050
2050
|
});
|
|
2051
2051
|
}
|
|
2052
|
-
for (let
|
|
2053
|
-
const { ruleScanner: c, findOptions: u } = Zs(
|
|
2052
|
+
for (let i = l.pop(); i; i = l.pop()) {
|
|
2053
|
+
const { ruleScanner: c, findOptions: u } = Zs(i.rule, t, i.stack.endRule, n, a === o), p = c.findNextMatchSync(e, a, u);
|
|
2054
2054
|
if (p) {
|
|
2055
2055
|
if (p.ruleId !== La) {
|
|
2056
|
-
r =
|
|
2056
|
+
r = i.stack.pop();
|
|
2057
2057
|
break;
|
|
2058
2058
|
}
|
|
2059
|
-
p.captureIndices && p.captureIndices.length && (s.produce(
|
|
2059
|
+
p.captureIndices && p.captureIndices.length && (s.produce(i.stack, p.captureIndices[0].start), Ze(t, e, n, i.stack, s, i.rule.whileCaptures, p.captureIndices), s.produce(i.stack, p.captureIndices[0].end), o = p.captureIndices[0].end, p.captureIndices[0].end > a && (a = p.captureIndices[0].end, n = !1));
|
|
2060
2060
|
} else {
|
|
2061
|
-
r =
|
|
2061
|
+
r = i.stack.pop();
|
|
2062
2062
|
break;
|
|
2063
2063
|
}
|
|
2064
2064
|
}
|
|
2065
2065
|
return { stack: r, linePos: a, anchorPosition: o, isFirstLine: n };
|
|
2066
2066
|
}
|
|
2067
2067
|
function Ws(t, e, n, a, r, s) {
|
|
2068
|
-
const o = Vs(t, e, n, a, r, s),
|
|
2069
|
-
if (
|
|
2068
|
+
const o = Vs(t, e, n, a, r, s), l = t.getInjections();
|
|
2069
|
+
if (l.length === 0)
|
|
2070
2070
|
return o;
|
|
2071
|
-
const
|
|
2072
|
-
if (!
|
|
2071
|
+
const i = Xs(l, t, e, n, a, r, s);
|
|
2072
|
+
if (!i)
|
|
2073
2073
|
return o;
|
|
2074
2074
|
if (!o)
|
|
2075
|
-
return
|
|
2076
|
-
const c = o.captureIndices[0].start, u =
|
|
2077
|
-
return u < c ||
|
|
2075
|
+
return i;
|
|
2076
|
+
const c = o.captureIndices[0].start, u = i.captureIndices[0].start;
|
|
2077
|
+
return u < c || i.priorityMatch && u === c ? i : o;
|
|
2078
2078
|
}
|
|
2079
2079
|
function Vs(t, e, n, a, r, s) {
|
|
2080
|
-
const o = r.getRule(t), { ruleScanner:
|
|
2080
|
+
const o = r.getRule(t), { ruleScanner: l, findOptions: i } = Ga(o, t, r.endRule, n, a === s), c = l.findNextMatchSync(e, a, i);
|
|
2081
2081
|
return c ? {
|
|
2082
2082
|
captureIndices: c.captureIndices,
|
|
2083
2083
|
matchedRuleId: c.ruleId
|
|
2084
2084
|
} : null;
|
|
2085
2085
|
}
|
|
2086
2086
|
function Xs(t, e, n, a, r, s, o) {
|
|
2087
|
-
let
|
|
2087
|
+
let l = Number.MAX_VALUE, i = null, c, u = 0;
|
|
2088
2088
|
const p = s.contentNameScopesList.getScopeNames();
|
|
2089
2089
|
for (let d = 0, f = t.length; d < f; d++) {
|
|
2090
2090
|
const m = t[d];
|
|
@@ -2094,12 +2094,12 @@ function Xs(t, e, n, a, r, s, o) {
|
|
|
2094
2094
|
if (!w)
|
|
2095
2095
|
continue;
|
|
2096
2096
|
const k = w.captureIndices[0].start;
|
|
2097
|
-
if (!(k >=
|
|
2097
|
+
if (!(k >= l) && (l = k, i = w.captureIndices, c = w.ruleId, u = m.priority, l === r))
|
|
2098
2098
|
break;
|
|
2099
2099
|
}
|
|
2100
|
-
return
|
|
2100
|
+
return i ? {
|
|
2101
2101
|
priorityMatch: u === -1,
|
|
2102
|
-
captureIndices:
|
|
2102
|
+
captureIndices: i,
|
|
2103
2103
|
matchedRuleId: c
|
|
2104
2104
|
} : null;
|
|
2105
2105
|
}
|
|
@@ -2120,8 +2120,8 @@ function Zs(t, e, n, a, r) {
|
|
|
2120
2120
|
function Ze(t, e, n, a, r, s, o) {
|
|
2121
2121
|
if (s.length === 0)
|
|
2122
2122
|
return;
|
|
2123
|
-
const
|
|
2124
|
-
for (let p = 0; p <
|
|
2123
|
+
const l = e.content, i = Math.min(s.length, o.length), c = [], u = o[0].end;
|
|
2124
|
+
for (let p = 0; p < i; p++) {
|
|
2125
2125
|
const d = s[p];
|
|
2126
2126
|
if (d === null)
|
|
2127
2127
|
continue;
|
|
@@ -2133,7 +2133,7 @@ function Ze(t, e, n, a, r, s, o) {
|
|
|
2133
2133
|
for (; c.length > 0 && c[c.length - 1].endPos <= f.start; )
|
|
2134
2134
|
r.produceFromScopes(c[c.length - 1].scopes, c[c.length - 1].endPos), c.pop();
|
|
2135
2135
|
if (c.length > 0 ? r.produceFromScopes(c[c.length - 1].scopes, f.start) : r.produce(a, f.start), d.retokenizeCapturedWithRuleId) {
|
|
2136
|
-
const _ = d.getName(
|
|
2136
|
+
const _ = d.getName(l, o), g = a.contentNameScopesList.pushAttributed(_, t), b = d.getContentName(l, o), w = g.pushAttributed(b, t), k = a.push(d.retokenizeCapturedWithRuleId, f.start, -1, !1, null, g, w), v = t.createOnigString(l.substring(0, f.end));
|
|
2137
2137
|
Oa(
|
|
2138
2138
|
t,
|
|
2139
2139
|
v,
|
|
@@ -2144,10 +2144,10 @@ function Ze(t, e, n, a, r, s, o) {
|
|
|
2144
2144
|
!1,
|
|
2145
2145
|
/* no time limit */
|
|
2146
2146
|
0
|
|
2147
|
-
),
|
|
2147
|
+
), Pa(v);
|
|
2148
2148
|
continue;
|
|
2149
2149
|
}
|
|
2150
|
-
const m = d.getName(
|
|
2150
|
+
const m = d.getName(l, o);
|
|
2151
2151
|
if (m !== null) {
|
|
2152
2152
|
const g = (c.length > 0 ? c[c.length - 1].scopes : a.contentNameScopesList).pushAttributed(m, t);
|
|
2153
2153
|
c.push(new Ks(g, f.end));
|
|
@@ -2163,7 +2163,7 @@ var Ks = class {
|
|
|
2163
2163
|
this.scopes = t, this.endPos = e;
|
|
2164
2164
|
}
|
|
2165
2165
|
};
|
|
2166
|
-
function Js(t, e, n, a, r, s, o,
|
|
2166
|
+
function Js(t, e, n, a, r, s, o, l) {
|
|
2167
2167
|
return new Ys(
|
|
2168
2168
|
t,
|
|
2169
2169
|
e,
|
|
@@ -2172,18 +2172,18 @@ function Js(t, e, n, a, r, s, o, i) {
|
|
|
2172
2172
|
r,
|
|
2173
2173
|
s,
|
|
2174
2174
|
o,
|
|
2175
|
-
|
|
2175
|
+
l
|
|
2176
2176
|
);
|
|
2177
2177
|
}
|
|
2178
2178
|
function Un(t, e, n, a, r) {
|
|
2179
2179
|
const s = _t(e, kt), o = ja.getCompiledRuleId(n, a, r.repository);
|
|
2180
|
-
for (const
|
|
2180
|
+
for (const l of s)
|
|
2181
2181
|
t.push({
|
|
2182
2182
|
debugSelector: e,
|
|
2183
|
-
matcher:
|
|
2183
|
+
matcher: l.matcher,
|
|
2184
2184
|
ruleId: o,
|
|
2185
2185
|
grammar: r,
|
|
2186
|
-
priority:
|
|
2186
|
+
priority: l.priority
|
|
2187
2187
|
});
|
|
2188
2188
|
}
|
|
2189
2189
|
function kt(t, e) {
|
|
@@ -2206,7 +2206,7 @@ function Qs(t, e) {
|
|
|
2206
2206
|
return t.length > n && t.substr(0, n) === e && t[n] === ".";
|
|
2207
2207
|
}
|
|
2208
2208
|
var Ys = class {
|
|
2209
|
-
constructor(t, e, n, a, r, s, o,
|
|
2209
|
+
constructor(t, e, n, a, r, s, o, l) {
|
|
2210
2210
|
h(this, "_rootId");
|
|
2211
2211
|
h(this, "_lastRuleId");
|
|
2212
2212
|
h(this, "_ruleId2desc");
|
|
@@ -2216,16 +2216,16 @@ var Ys = class {
|
|
|
2216
2216
|
h(this, "_injections");
|
|
2217
2217
|
h(this, "_basicScopeAttributesProvider");
|
|
2218
2218
|
h(this, "_tokenTypeMatchers");
|
|
2219
|
-
if (this._rootScopeName = t, this.balancedBracketSelectors = s, this._onigLib =
|
|
2219
|
+
if (this._rootScopeName = t, this.balancedBracketSelectors = s, this._onigLib = l, this._basicScopeAttributesProvider = new zs(
|
|
2220
2220
|
n,
|
|
2221
2221
|
a
|
|
2222
2222
|
), this._rootId = -1, this._lastRuleId = 0, this._ruleId2desc = [null], this._includedGrammars = {}, this._grammarRepository = o, this._grammar = zn(e, null), this._injections = null, this._tokenTypeMatchers = [], r)
|
|
2223
|
-
for (const
|
|
2224
|
-
const c = _t(
|
|
2223
|
+
for (const i of Object.keys(r)) {
|
|
2224
|
+
const c = _t(i, kt);
|
|
2225
2225
|
for (const u of c)
|
|
2226
2226
|
this._tokenTypeMatchers.push({
|
|
2227
2227
|
matcher: u.matcher,
|
|
2228
|
-
type: r[
|
|
2228
|
+
type: r[i]
|
|
2229
2229
|
});
|
|
2230
2230
|
}
|
|
2231
2231
|
}
|
|
@@ -2263,15 +2263,15 @@ var Ys = class {
|
|
|
2263
2263
|
);
|
|
2264
2264
|
const s = this._grammarRepository.injections(n);
|
|
2265
2265
|
s && s.forEach((o) => {
|
|
2266
|
-
const
|
|
2267
|
-
if (
|
|
2268
|
-
const
|
|
2269
|
-
|
|
2266
|
+
const l = this.getExternalGrammar(o);
|
|
2267
|
+
if (l) {
|
|
2268
|
+
const i = l.injectionSelector;
|
|
2269
|
+
i && Un(
|
|
2270
2270
|
e,
|
|
2271
|
-
l,
|
|
2272
2271
|
i,
|
|
2272
|
+
l,
|
|
2273
2273
|
this,
|
|
2274
|
-
|
|
2274
|
+
l
|
|
2275
2275
|
);
|
|
2276
2276
|
}
|
|
2277
2277
|
});
|
|
@@ -2359,26 +2359,26 @@ var Ys = class {
|
|
|
2359
2359
|
r = !1, e.reset();
|
|
2360
2360
|
t = t + `
|
|
2361
2361
|
`;
|
|
2362
|
-
const s = this.createOnigString(t), o = s.content.length,
|
|
2362
|
+
const s = this.createOnigString(t), o = s.content.length, l = new to(
|
|
2363
2363
|
n,
|
|
2364
2364
|
t,
|
|
2365
2365
|
this._tokenTypeMatchers,
|
|
2366
2366
|
this.balancedBracketSelectors
|
|
2367
|
-
),
|
|
2367
|
+
), i = Oa(
|
|
2368
2368
|
this,
|
|
2369
2369
|
s,
|
|
2370
2370
|
r,
|
|
2371
2371
|
0,
|
|
2372
2372
|
e,
|
|
2373
|
-
|
|
2373
|
+
l,
|
|
2374
2374
|
!0,
|
|
2375
2375
|
a
|
|
2376
2376
|
);
|
|
2377
|
-
return
|
|
2377
|
+
return Pa(s), {
|
|
2378
2378
|
lineLength: o,
|
|
2379
|
-
lineTokens:
|
|
2380
|
-
ruleStack:
|
|
2381
|
-
stoppedEarly:
|
|
2379
|
+
lineTokens: l,
|
|
2380
|
+
ruleStack: i.stack,
|
|
2381
|
+
stoppedEarly: i.stoppedEarly
|
|
2382
2382
|
};
|
|
2383
2383
|
}
|
|
2384
2384
|
};
|
|
@@ -2411,12 +2411,12 @@ var Ke = class le {
|
|
|
2411
2411
|
return new le(null, new Ut(null, e), n);
|
|
2412
2412
|
}
|
|
2413
2413
|
static createRootAndLookUpScopeName(e, n, a) {
|
|
2414
|
-
const r = a.getMetadataForScope(e), s = new Ut(null, e), o = a.themeProvider.themeMatch(s),
|
|
2414
|
+
const r = a.getMetadataForScope(e), s = new Ut(null, e), o = a.themeProvider.themeMatch(s), l = le.mergeAttributes(
|
|
2415
2415
|
n,
|
|
2416
2416
|
r,
|
|
2417
2417
|
o
|
|
2418
2418
|
);
|
|
2419
|
-
return new le(null, s,
|
|
2419
|
+
return new le(null, s, l);
|
|
2420
2420
|
}
|
|
2421
2421
|
get scopeName() {
|
|
2422
2422
|
return this.scopePath.scopeName;
|
|
@@ -2460,12 +2460,12 @@ var Ke = class le {
|
|
|
2460
2460
|
return r;
|
|
2461
2461
|
}
|
|
2462
2462
|
static _pushAttributed(e, n, a) {
|
|
2463
|
-
const r = a.getMetadataForScope(n), s = e.scopePath.push(n), o = a.themeProvider.themeMatch(s),
|
|
2463
|
+
const r = a.getMetadataForScope(n), s = e.scopePath.push(n), o = a.themeProvider.themeMatch(s), l = le.mergeAttributes(
|
|
2464
2464
|
e.tokenAttributes,
|
|
2465
2465
|
r,
|
|
2466
2466
|
o
|
|
2467
2467
|
);
|
|
2468
|
-
return new le(e, s,
|
|
2468
|
+
return new le(e, s, l);
|
|
2469
2469
|
}
|
|
2470
2470
|
getScopeNames() {
|
|
2471
2471
|
return this.scopePath.getSegments();
|
|
@@ -2493,7 +2493,7 @@ var Ke = class le {
|
|
|
2493
2493
|
* }
|
|
2494
2494
|
* ```
|
|
2495
2495
|
*/
|
|
2496
|
-
constructor(e, n, a, r, s, o,
|
|
2496
|
+
constructor(e, n, a, r, s, o, l, i) {
|
|
2497
2497
|
h(this, "_stackElementBrand");
|
|
2498
2498
|
/**
|
|
2499
2499
|
* The position on the current line where this state was pushed.
|
|
@@ -2511,7 +2511,7 @@ var Ke = class le {
|
|
|
2511
2511
|
* The depth of the stack.
|
|
2512
2512
|
*/
|
|
2513
2513
|
h(this, "depth");
|
|
2514
|
-
this.parent = e, this.ruleId = n, this.beginRuleCapturedEOL = s, this.endRule = o, this.nameScopesList =
|
|
2514
|
+
this.parent = e, this.ruleId = n, this.beginRuleCapturedEOL = s, this.endRule = o, this.nameScopesList = l, this.contentNameScopesList = i, this.depth = this.parent ? this.parent.depth + 1 : 1, this._enterPos = a, this._anchorPos = r;
|
|
2515
2515
|
}
|
|
2516
2516
|
equals(e) {
|
|
2517
2517
|
return e === null ? !1 : ne._equals(this, e);
|
|
@@ -2547,7 +2547,7 @@ var Ke = class le {
|
|
|
2547
2547
|
safePop() {
|
|
2548
2548
|
return this.parent ? this.parent : this;
|
|
2549
2549
|
}
|
|
2550
|
-
push(e, n, a, r, s, o,
|
|
2550
|
+
push(e, n, a, r, s, o, l) {
|
|
2551
2551
|
return new ne(
|
|
2552
2552
|
this,
|
|
2553
2553
|
e,
|
|
@@ -2556,7 +2556,7 @@ var Ke = class le {
|
|
|
2556
2556
|
r,
|
|
2557
2557
|
s,
|
|
2558
2558
|
o,
|
|
2559
|
-
|
|
2559
|
+
l
|
|
2560
2560
|
);
|
|
2561
2561
|
}
|
|
2562
2562
|
getEnterPos() {
|
|
@@ -2698,11 +2698,11 @@ h(ne, "NULL", new ne(
|
|
|
2698
2698
|
let r = (t == null ? void 0 : t.tokenAttributes) ?? 0, s = !1;
|
|
2699
2699
|
if ((a = this.balancedBracketSelectors) != null && a.matchesAlways && (s = !0), this._tokenTypeOverrides.length > 0 || this.balancedBracketSelectors && !this.balancedBracketSelectors.matchesAlways && !this.balancedBracketSelectors.matchesNever) {
|
|
2700
2700
|
const o = (t == null ? void 0 : t.getScopeNames()) ?? [];
|
|
2701
|
-
for (const
|
|
2702
|
-
|
|
2701
|
+
for (const l of this._tokenTypeOverrides)
|
|
2702
|
+
l.matcher(o) && (r = ze.set(
|
|
2703
2703
|
r,
|
|
2704
2704
|
0,
|
|
2705
|
-
|
|
2705
|
+
l.type,
|
|
2706
2706
|
null,
|
|
2707
2707
|
-1,
|
|
2708
2708
|
0,
|
|
@@ -2867,9 +2867,9 @@ h(ne, "NULL", new ne(
|
|
|
2867
2867
|
return this._loadGrammar(e, 0, null, null, null);
|
|
2868
2868
|
}
|
|
2869
2869
|
_loadGrammar(e, n, a, r, s) {
|
|
2870
|
-
const o = new
|
|
2870
|
+
const o = new Bs(this._syncRegistry, e);
|
|
2871
2871
|
for (; o.Q.length > 0; )
|
|
2872
|
-
o.Q.map((
|
|
2872
|
+
o.Q.map((l) => this._loadSingleGrammar(l.scopeName)), o.processQueue();
|
|
2873
2873
|
return this._grammarForScopeName(
|
|
2874
2874
|
e,
|
|
2875
2875
|
n,
|
|
@@ -2982,7 +2982,7 @@ Q.prototype.property = "";
|
|
|
2982
2982
|
Q.prototype.spaceSeparated = !1;
|
|
2983
2983
|
Q.prototype.space = void 0;
|
|
2984
2984
|
let so = 0;
|
|
2985
|
-
const S = Te(), F = Te(), cn = Te(), y = Te(),
|
|
2985
|
+
const S = Te(), F = Te(), cn = Te(), y = Te(), B = Te(), De = Te(), Y = Te();
|
|
2986
2986
|
function Te() {
|
|
2987
2987
|
return 2 ** ++so;
|
|
2988
2988
|
}
|
|
@@ -2994,7 +2994,7 @@ const un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2994
2994
|
commaSeparated: De,
|
|
2995
2995
|
number: y,
|
|
2996
2996
|
overloadedBoolean: cn,
|
|
2997
|
-
spaceSeparated:
|
|
2997
|
+
spaceSeparated: B
|
|
2998
2998
|
}, Symbol.toStringTag, { value: "Module" })), qt = (
|
|
2999
2999
|
/** @type {ReadonlyArray<keyof typeof types>} */
|
|
3000
3000
|
Object.keys(un)
|
|
@@ -3049,36 +3049,36 @@ const Da = qe({
|
|
|
3049
3049
|
ariaColCount: y,
|
|
3050
3050
|
ariaColIndex: y,
|
|
3051
3051
|
ariaColSpan: y,
|
|
3052
|
-
ariaControls:
|
|
3052
|
+
ariaControls: B,
|
|
3053
3053
|
ariaCurrent: null,
|
|
3054
|
-
ariaDescribedBy:
|
|
3054
|
+
ariaDescribedBy: B,
|
|
3055
3055
|
ariaDetails: null,
|
|
3056
3056
|
ariaDisabled: F,
|
|
3057
|
-
ariaDropEffect:
|
|
3057
|
+
ariaDropEffect: B,
|
|
3058
3058
|
ariaErrorMessage: null,
|
|
3059
3059
|
ariaExpanded: F,
|
|
3060
|
-
ariaFlowTo:
|
|
3060
|
+
ariaFlowTo: B,
|
|
3061
3061
|
ariaGrabbed: F,
|
|
3062
3062
|
ariaHasPopup: null,
|
|
3063
3063
|
ariaHidden: F,
|
|
3064
3064
|
ariaInvalid: null,
|
|
3065
3065
|
ariaKeyShortcuts: null,
|
|
3066
3066
|
ariaLabel: null,
|
|
3067
|
-
ariaLabelledBy:
|
|
3067
|
+
ariaLabelledBy: B,
|
|
3068
3068
|
ariaLevel: y,
|
|
3069
3069
|
ariaLive: null,
|
|
3070
3070
|
ariaModal: F,
|
|
3071
3071
|
ariaMultiLine: F,
|
|
3072
3072
|
ariaMultiSelectable: F,
|
|
3073
3073
|
ariaOrientation: null,
|
|
3074
|
-
ariaOwns:
|
|
3074
|
+
ariaOwns: B,
|
|
3075
3075
|
ariaPlaceholder: null,
|
|
3076
3076
|
ariaPosInSet: y,
|
|
3077
3077
|
ariaPressed: F,
|
|
3078
3078
|
ariaReadOnly: F,
|
|
3079
3079
|
ariaRelevant: null,
|
|
3080
3080
|
ariaRequired: F,
|
|
3081
|
-
ariaRoleDescription:
|
|
3081
|
+
ariaRoleDescription: B,
|
|
3082
3082
|
ariaRowCount: y,
|
|
3083
3083
|
ariaRowIndex: y,
|
|
3084
3084
|
ariaRowSpan: y,
|
|
@@ -3113,8 +3113,8 @@ const oo = qe({
|
|
|
3113
3113
|
// Standard Properties.
|
|
3114
3114
|
abbr: null,
|
|
3115
3115
|
accept: De,
|
|
3116
|
-
acceptCharset:
|
|
3117
|
-
accessKey:
|
|
3116
|
+
acceptCharset: B,
|
|
3117
|
+
accessKey: B,
|
|
3118
3118
|
action: null,
|
|
3119
3119
|
allow: null,
|
|
3120
3120
|
allowFullScreen: S,
|
|
@@ -3124,21 +3124,21 @@ const oo = qe({
|
|
|
3124
3124
|
as: null,
|
|
3125
3125
|
async: S,
|
|
3126
3126
|
autoCapitalize: null,
|
|
3127
|
-
autoComplete:
|
|
3127
|
+
autoComplete: B,
|
|
3128
3128
|
autoFocus: S,
|
|
3129
3129
|
autoPlay: S,
|
|
3130
|
-
blocking:
|
|
3130
|
+
blocking: B,
|
|
3131
3131
|
capture: null,
|
|
3132
3132
|
charSet: null,
|
|
3133
3133
|
checked: S,
|
|
3134
3134
|
cite: null,
|
|
3135
|
-
className:
|
|
3135
|
+
className: B,
|
|
3136
3136
|
cols: y,
|
|
3137
3137
|
colSpan: null,
|
|
3138
3138
|
content: null,
|
|
3139
3139
|
contentEditable: F,
|
|
3140
3140
|
controls: S,
|
|
3141
|
-
controlsList:
|
|
3141
|
+
controlsList: B,
|
|
3142
3142
|
coords: y | De,
|
|
3143
3143
|
crossOrigin: null,
|
|
3144
3144
|
data: null,
|
|
@@ -3160,14 +3160,14 @@ const oo = qe({
|
|
|
3160
3160
|
formMethod: null,
|
|
3161
3161
|
formNoValidate: S,
|
|
3162
3162
|
formTarget: null,
|
|
3163
|
-
headers:
|
|
3163
|
+
headers: B,
|
|
3164
3164
|
height: y,
|
|
3165
3165
|
hidden: cn,
|
|
3166
3166
|
high: y,
|
|
3167
3167
|
href: null,
|
|
3168
3168
|
hrefLang: null,
|
|
3169
|
-
htmlFor:
|
|
3170
|
-
httpEquiv:
|
|
3169
|
+
htmlFor: B,
|
|
3170
|
+
httpEquiv: B,
|
|
3171
3171
|
id: null,
|
|
3172
3172
|
imageSizes: null,
|
|
3173
3173
|
imageSrcSet: null,
|
|
@@ -3177,10 +3177,10 @@ const oo = qe({
|
|
|
3177
3177
|
is: null,
|
|
3178
3178
|
isMap: S,
|
|
3179
3179
|
itemId: null,
|
|
3180
|
-
itemProp:
|
|
3181
|
-
itemRef:
|
|
3180
|
+
itemProp: B,
|
|
3181
|
+
itemRef: B,
|
|
3182
3182
|
itemScope: S,
|
|
3183
|
-
itemType:
|
|
3183
|
+
itemType: B,
|
|
3184
3184
|
kind: null,
|
|
3185
3185
|
label: null,
|
|
3186
3186
|
lang: null,
|
|
@@ -3293,7 +3293,7 @@ const oo = qe({
|
|
|
3293
3293
|
open: S,
|
|
3294
3294
|
optimum: y,
|
|
3295
3295
|
pattern: null,
|
|
3296
|
-
ping:
|
|
3296
|
+
ping: B,
|
|
3297
3297
|
placeholder: null,
|
|
3298
3298
|
playsInline: S,
|
|
3299
3299
|
popover: null,
|
|
@@ -3303,12 +3303,12 @@ const oo = qe({
|
|
|
3303
3303
|
preload: null,
|
|
3304
3304
|
readOnly: S,
|
|
3305
3305
|
referrerPolicy: null,
|
|
3306
|
-
rel:
|
|
3306
|
+
rel: B,
|
|
3307
3307
|
required: S,
|
|
3308
3308
|
reversed: S,
|
|
3309
3309
|
rows: y,
|
|
3310
3310
|
rowSpan: y,
|
|
3311
|
-
sandbox:
|
|
3311
|
+
sandbox: B,
|
|
3312
3312
|
scope: null,
|
|
3313
3313
|
scoped: S,
|
|
3314
3314
|
seamless: S,
|
|
@@ -3346,7 +3346,7 @@ const oo = qe({
|
|
|
3346
3346
|
// Several. Use CSS `text-align` instead,
|
|
3347
3347
|
aLink: null,
|
|
3348
3348
|
// `<body>`. Use CSS `a:active {color}` instead
|
|
3349
|
-
archive:
|
|
3349
|
+
archive: B,
|
|
3350
3350
|
// `<object>`. List of URIs to archives
|
|
3351
3351
|
axis: null,
|
|
3352
3352
|
// `<td>` and `<th>`. Use `scope` on `<th>`
|
|
@@ -3661,7 +3661,7 @@ const oo = qe({
|
|
|
3661
3661
|
by: null,
|
|
3662
3662
|
calcMode: null,
|
|
3663
3663
|
capHeight: y,
|
|
3664
|
-
className:
|
|
3664
|
+
className: B,
|
|
3665
3665
|
clip: null,
|
|
3666
3666
|
clipPath: null,
|
|
3667
3667
|
clipPathUnits: null,
|
|
@@ -3896,7 +3896,7 @@ const oo = qe({
|
|
|
3896
3896
|
patternTransform: null,
|
|
3897
3897
|
patternUnits: null,
|
|
3898
3898
|
phase: null,
|
|
3899
|
-
ping:
|
|
3899
|
+
ping: B,
|
|
3900
3900
|
pitch: null,
|
|
3901
3901
|
playbackOrder: null,
|
|
3902
3902
|
pointerEvents: null,
|
|
@@ -4078,10 +4078,10 @@ function ho(t, e) {
|
|
|
4078
4078
|
const n = e || {};
|
|
4079
4079
|
function a(r, ...s) {
|
|
4080
4080
|
let o = a.invalid;
|
|
4081
|
-
const
|
|
4081
|
+
const l = a.handlers;
|
|
4082
4082
|
if (r && Wn.call(r, t)) {
|
|
4083
|
-
const
|
|
4084
|
-
o = Wn.call(
|
|
4083
|
+
const i = String(r[t]);
|
|
4084
|
+
o = Wn.call(l, i) ? l[i] : a.unknown;
|
|
4085
4085
|
}
|
|
4086
4086
|
if (o)
|
|
4087
4087
|
return o.call(this, r, ...s);
|
|
@@ -4533,14 +4533,14 @@ function No(t, e, n) {
|
|
|
4533
4533
|
function Ue(t, e) {
|
|
4534
4534
|
return $o(t, Object.assign({ format: No }, e));
|
|
4535
4535
|
}
|
|
4536
|
-
const
|
|
4536
|
+
const Bo = /^>|^->|<!--|-->|--!>|<!-$/g, Po = [">"], To = ["<", ">"];
|
|
4537
4537
|
function Lo(t, e, n, a) {
|
|
4538
4538
|
return a.settings.bogusComments ? "<?" + Ue(
|
|
4539
4539
|
t.value,
|
|
4540
4540
|
Object.assign({}, a.settings.characterReferences, {
|
|
4541
|
-
subset:
|
|
4541
|
+
subset: Po
|
|
4542
4542
|
})
|
|
4543
|
-
) + ">" : "<!--" + t.value.replace(
|
|
4543
|
+
) + ">" : "<!--" + t.value.replace(Bo, r) + "-->";
|
|
4544
4544
|
function r(s) {
|
|
4545
4545
|
return Ue(
|
|
4546
4546
|
s,
|
|
@@ -4583,11 +4583,11 @@ function Ka(t) {
|
|
|
4583
4583
|
return e;
|
|
4584
4584
|
function e(n, a, r) {
|
|
4585
4585
|
const s = n ? n.children : Fo;
|
|
4586
|
-
let o = (a || 0) + t,
|
|
4586
|
+
let o = (a || 0) + t, l = s[o];
|
|
4587
4587
|
if (!r)
|
|
4588
|
-
for (;
|
|
4589
|
-
o += t,
|
|
4590
|
-
return
|
|
4588
|
+
for (; l && kn(l); )
|
|
4589
|
+
o += t, l = s[o];
|
|
4590
|
+
return l;
|
|
4591
4591
|
}
|
|
4592
4592
|
}
|
|
4593
4593
|
const Do = {}.hasOwnProperty;
|
|
@@ -4744,13 +4744,13 @@ const pt = {
|
|
|
4744
4744
|
function oi(t, e, n, a) {
|
|
4745
4745
|
const r = a.schema, s = r.space === "svg" ? !1 : a.settings.omitOptionalTags;
|
|
4746
4746
|
let o = r.space === "svg" ? a.settings.closeEmptyElements : a.settings.voids.includes(t.tagName.toLowerCase());
|
|
4747
|
-
const
|
|
4748
|
-
let
|
|
4747
|
+
const l = [];
|
|
4748
|
+
let i;
|
|
4749
4749
|
r.space === "html" && t.tagName === "svg" && (a.schema = Va);
|
|
4750
4750
|
const c = ii(a, t.properties), u = a.all(
|
|
4751
4751
|
r.space === "html" && t.tagName === "template" ? t.content : t
|
|
4752
4752
|
);
|
|
4753
|
-
return a.schema = r, u && (o = !1), (c || !s || !ei(t, e, n)) && (
|
|
4753
|
+
return a.schema = r, u && (o = !1), (c || !s || !ei(t, e, n)) && (l.push("<", t.tagName, c ? " " + c : ""), o && (r.space === "svg" || a.settings.closeSelfClosing) && (i = c.charAt(c.length - 1), (!a.settings.tightSelfClosing || i === "/" || i && i !== '"' && i !== "'") && l.push(" "), l.push("/")), l.push(">")), l.push(u), !o && (!s || !vn(t, e, n)) && l.push("</" + t.tagName + ">"), l.join("");
|
|
4754
4754
|
}
|
|
4755
4755
|
function ii(t, e) {
|
|
4756
4756
|
const n = [];
|
|
@@ -4770,10 +4770,10 @@ function ii(t, e) {
|
|
|
4770
4770
|
}
|
|
4771
4771
|
function li(t, e, n) {
|
|
4772
4772
|
const a = uo(t.schema, e), r = t.settings.allowParseErrors && t.schema.space === "html" ? 0 : 1, s = t.settings.allowDangerousCharacters ? 0 : 1;
|
|
4773
|
-
let o = t.quote,
|
|
4773
|
+
let o = t.quote, l;
|
|
4774
4774
|
if (a.overloadedBoolean && (n === a.attribute || n === "") ? n = !0 : (a.boolean || a.overloadedBoolean) && (typeof n != "string" || n === a.attribute || n === "") && (n = !!n), n == null || n === !1 || typeof n == "number" && Number.isNaN(n))
|
|
4775
4775
|
return "";
|
|
4776
|
-
const
|
|
4776
|
+
const i = Ue(
|
|
4777
4777
|
a.attribute,
|
|
4778
4778
|
Object.assign({}, t.settings.characterReferences, {
|
|
4779
4779
|
// Always encode without parse errors in non-HTML.
|
|
@@ -4782,20 +4782,20 @@ function li(t, e, n) {
|
|
|
4782
4782
|
);
|
|
4783
4783
|
return n === !0 || (n = Array.isArray(n) ? (a.commaSeparated ? Mo : Oo)(n, {
|
|
4784
4784
|
padLeft: !t.settings.tightCommaSeparatedLists
|
|
4785
|
-
}) : String(n), t.settings.collapseEmptyAttributes && !n) ?
|
|
4785
|
+
}) : String(n), t.settings.collapseEmptyAttributes && !n) ? i : (t.settings.preferUnquoted && (l = Ue(
|
|
4786
4786
|
n,
|
|
4787
4787
|
Object.assign({}, t.settings.characterReferences, {
|
|
4788
4788
|
attribute: !0,
|
|
4789
4789
|
subset: pt.unquoted[r][s]
|
|
4790
4790
|
})
|
|
4791
|
-
)),
|
|
4791
|
+
)), l !== n && (t.settings.quoteSmart && Xn(n, o) > Xn(n, t.alternative) && (o = t.alternative), l = o + Ue(
|
|
4792
4792
|
n,
|
|
4793
4793
|
Object.assign({}, t.settings.characterReferences, {
|
|
4794
4794
|
// Always encode without parse errors in non-HTML.
|
|
4795
4795
|
subset: (o === "'" ? pt.single : pt.double)[r][s],
|
|
4796
4796
|
attribute: !0
|
|
4797
4797
|
})
|
|
4798
|
-
) + o),
|
|
4798
|
+
) + o), i + (l && "=" + l));
|
|
4799
4799
|
}
|
|
4800
4800
|
const ci = ["<", "&"];
|
|
4801
4801
|
function Qa(t, e, n, a) {
|
|
@@ -4916,8 +4916,8 @@ function Nt(t, e = !1) {
|
|
|
4916
4916
|
let a = 0;
|
|
4917
4917
|
const r = [];
|
|
4918
4918
|
for (let o = 0; o < n.length; o += 2) {
|
|
4919
|
-
const
|
|
4920
|
-
r.push([
|
|
4919
|
+
const l = e ? n[o] + (n[o + 1] || "") : n[o];
|
|
4920
|
+
r.push([l, a]), a += n[o].length, a += ((s = n[o + 1]) == null ? void 0 : s.length) || 0;
|
|
4921
4921
|
}
|
|
4922
4922
|
return r;
|
|
4923
4923
|
}
|
|
@@ -4930,17 +4930,17 @@ function Ci(t) {
|
|
|
4930
4930
|
character: e[e.length - 1].length
|
|
4931
4931
|
};
|
|
4932
4932
|
let s = r, o = 0;
|
|
4933
|
-
for (const
|
|
4934
|
-
if (s <
|
|
4933
|
+
for (const l of e) {
|
|
4934
|
+
if (s < l.length)
|
|
4935
4935
|
break;
|
|
4936
|
-
s -=
|
|
4936
|
+
s -= l.length, o++;
|
|
4937
4937
|
}
|
|
4938
4938
|
return { line: o, character: s };
|
|
4939
4939
|
}
|
|
4940
4940
|
function a(r, s) {
|
|
4941
4941
|
let o = 0;
|
|
4942
|
-
for (let
|
|
4943
|
-
o += e[
|
|
4942
|
+
for (let l = 0; l < r; l++)
|
|
4943
|
+
o += e[l].length;
|
|
4944
4944
|
return o += s, o;
|
|
4945
4945
|
}
|
|
4946
4946
|
return {
|
|
@@ -4967,7 +4967,7 @@ function xi(t, e) {
|
|
|
4967
4967
|
function Si(t, e) {
|
|
4968
4968
|
const n = Array.from(e instanceof Set ? e : new Set(e)).sort((a, r) => a - r);
|
|
4969
4969
|
return n.length ? t.map((a) => a.flatMap((r) => {
|
|
4970
|
-
const s = n.filter((o) => r.offset < o && o < r.offset + r.content.length).map((o) => o - r.offset).sort((o,
|
|
4970
|
+
const s = n.filter((o) => r.offset < o && o < r.offset + r.content.length).map((o) => o - r.offset).sort((o, l) => o - l);
|
|
4971
4971
|
return s.length ? xi(r, s) : r;
|
|
4972
4972
|
})) : t;
|
|
4973
4973
|
}
|
|
@@ -4976,18 +4976,18 @@ function Ei(t, e, n, a) {
|
|
|
4976
4976
|
content: t.content,
|
|
4977
4977
|
explanation: t.explanation,
|
|
4978
4978
|
offset: t.offset
|
|
4979
|
-
}, s = e.map((
|
|
4980
|
-
return s.forEach((
|
|
4979
|
+
}, s = e.map((i) => Ct(t.variants[i])), o = new Set(s.flatMap((i) => Object.keys(i))), l = {};
|
|
4980
|
+
return s.forEach((i, c) => {
|
|
4981
4981
|
for (const u of o) {
|
|
4982
|
-
const p =
|
|
4982
|
+
const p = i[u] || "inherit";
|
|
4983
4983
|
if (c === 0 && a)
|
|
4984
|
-
|
|
4984
|
+
l[u] = p;
|
|
4985
4985
|
else {
|
|
4986
4986
|
const d = u === "color" ? "" : u === "background-color" ? "-bg" : `-${u}`, f = n + e[c] + (u === "color" ? "" : d);
|
|
4987
|
-
|
|
4987
|
+
l[f] = p;
|
|
4988
4988
|
}
|
|
4989
4989
|
}
|
|
4990
|
-
}), r.htmlStyle =
|
|
4990
|
+
}), r.htmlStyle = l, r;
|
|
4991
4991
|
}
|
|
4992
4992
|
function Ct(t) {
|
|
4993
4993
|
const e = {};
|
|
@@ -5002,7 +5002,7 @@ function dn(t) {
|
|
|
5002
5002
|
return typeof t == "string" ? t : Object.entries(t).map(([e, n]) => `${e}:${n}`).join(";");
|
|
5003
5003
|
}
|
|
5004
5004
|
const tr = /* @__PURE__ */ new WeakMap();
|
|
5005
|
-
function
|
|
5005
|
+
function Bt(t, e) {
|
|
5006
5006
|
tr.set(t, e);
|
|
5007
5007
|
}
|
|
5008
5008
|
function nt(t) {
|
|
@@ -5090,11 +5090,11 @@ function Ri() {
|
|
|
5090
5090
|
offset: o
|
|
5091
5091
|
};
|
|
5092
5092
|
} else {
|
|
5093
|
-
const
|
|
5094
|
-
if (
|
|
5093
|
+
const l = r.lines[o.line];
|
|
5094
|
+
if (l === void 0)
|
|
5095
5095
|
throw new X(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${r.lines.length}`);
|
|
5096
|
-
if (o.character < 0 || o.character >
|
|
5097
|
-
throw new X(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${
|
|
5096
|
+
if (o.character < 0 || o.character > l.length)
|
|
5097
|
+
throw new X(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${l.length}`);
|
|
5098
5098
|
return {
|
|
5099
5099
|
...o,
|
|
5100
5100
|
offset: r.posToIndex(o.line, o.character)
|
|
@@ -5120,7 +5120,7 @@ function Ri() {
|
|
|
5120
5120
|
var o;
|
|
5121
5121
|
if (!((o = this.options.decorations) != null && o.length))
|
|
5122
5122
|
return;
|
|
5123
|
-
const r = e(this).decorations.flatMap((
|
|
5123
|
+
const r = e(this).decorations.flatMap((l) => [l.start.offset, l.end.offset]);
|
|
5124
5124
|
return Si(n, r);
|
|
5125
5125
|
},
|
|
5126
5126
|
code(n) {
|
|
@@ -5142,9 +5142,9 @@ function Ri() {
|
|
|
5142
5142
|
throw new X(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);
|
|
5143
5143
|
const k = _.children.slice(b, w);
|
|
5144
5144
|
if (!m.alwaysWrap && k.length === _.children.length)
|
|
5145
|
-
|
|
5145
|
+
l(_, m, "line");
|
|
5146
5146
|
else if (!m.alwaysWrap && k.length === 1 && k[0].type === "element")
|
|
5147
|
-
|
|
5147
|
+
l(k[0], m, "token");
|
|
5148
5148
|
else {
|
|
5149
5149
|
const v = {
|
|
5150
5150
|
type: "element",
|
|
@@ -5152,13 +5152,13 @@ function Ri() {
|
|
|
5152
5152
|
properties: {},
|
|
5153
5153
|
children: k
|
|
5154
5154
|
};
|
|
5155
|
-
|
|
5155
|
+
l(v, m, "wrapper"), _.children.splice(b, k.length, v);
|
|
5156
5156
|
}
|
|
5157
5157
|
}
|
|
5158
5158
|
function o(p, d) {
|
|
5159
|
-
r[p] =
|
|
5159
|
+
r[p] = l(r[p], d, "line");
|
|
5160
5160
|
}
|
|
5161
|
-
function
|
|
5161
|
+
function l(p, d, f) {
|
|
5162
5162
|
var g;
|
|
5163
5163
|
const m = d.properties || {}, _ = d.transform || ((b) => b);
|
|
5164
5164
|
return p.tagName = d.tagName || "span", p.properties = {
|
|
@@ -5167,7 +5167,7 @@ function Ri() {
|
|
|
5167
5167
|
class: p.properties.class
|
|
5168
5168
|
}, (g = d.properties) != null && g.class && er(p, d.properties.class), p = _(p, f) || p, p;
|
|
5169
5169
|
}
|
|
5170
|
-
const
|
|
5170
|
+
const i = [], c = a.decorations.sort((p, d) => d.start.offset - p.start.offset || p.end.offset - d.end.offset);
|
|
5171
5171
|
for (const p of c) {
|
|
5172
5172
|
const { start: d, end: f } = p;
|
|
5173
5173
|
if (d.line === f.line)
|
|
@@ -5175,11 +5175,11 @@ function Ri() {
|
|
|
5175
5175
|
else if (d.line < f.line) {
|
|
5176
5176
|
s(d.line, d.character, Number.POSITIVE_INFINITY, p);
|
|
5177
5177
|
for (let m = d.line + 1; m < f.line; m++)
|
|
5178
|
-
|
|
5178
|
+
i.unshift(() => o(m, p));
|
|
5179
5179
|
s(f.line, 0, f.character, p);
|
|
5180
5180
|
}
|
|
5181
5181
|
}
|
|
5182
|
-
|
|
5182
|
+
i.forEach((p) => p());
|
|
5183
5183
|
}
|
|
5184
5184
|
};
|
|
5185
5185
|
}
|
|
@@ -5189,9 +5189,9 @@ function Ni(t) {
|
|
|
5189
5189
|
if (n.start.offset > n.end.offset)
|
|
5190
5190
|
throw new X(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);
|
|
5191
5191
|
for (let a = e + 1; a < t.length; a++) {
|
|
5192
|
-
const r = t[a], s = n.start.offset <= r.start.offset && r.start.offset < n.end.offset, o = n.start.offset < r.end.offset && r.end.offset <= n.end.offset,
|
|
5193
|
-
if (s || o ||
|
|
5194
|
-
if (s && o ||
|
|
5192
|
+
const r = t[a], s = n.start.offset <= r.start.offset && r.start.offset < n.end.offset, o = n.start.offset < r.end.offset && r.end.offset <= n.end.offset, l = r.start.offset <= n.start.offset && n.start.offset < r.end.offset, i = r.start.offset < n.end.offset && n.end.offset <= r.end.offset;
|
|
5193
|
+
if (s || o || l || i) {
|
|
5194
|
+
if (s && o || l && i)
|
|
5195
5195
|
continue;
|
|
5196
5196
|
throw new X(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`);
|
|
5197
5197
|
}
|
|
@@ -5201,13 +5201,13 @@ function Ni(t) {
|
|
|
5201
5201
|
function nr(t) {
|
|
5202
5202
|
return t.type === "text" ? t.value : t.type === "element" ? t.children.map(nr).join("") : "";
|
|
5203
5203
|
}
|
|
5204
|
-
const
|
|
5204
|
+
const Bi = [
|
|
5205
5205
|
/* @__PURE__ */ Ri()
|
|
5206
5206
|
];
|
|
5207
5207
|
function xt(t) {
|
|
5208
5208
|
return [
|
|
5209
5209
|
...t.transformers || [],
|
|
5210
|
-
...
|
|
5210
|
+
...Bi
|
|
5211
5211
|
];
|
|
5212
5212
|
}
|
|
5213
5213
|
var Ie = [
|
|
@@ -5236,7 +5236,7 @@ var Ie = [
|
|
|
5236
5236
|
8: "hidden",
|
|
5237
5237
|
9: "strikethrough"
|
|
5238
5238
|
};
|
|
5239
|
-
function
|
|
5239
|
+
function Pi(t, e) {
|
|
5240
5240
|
const n = t.indexOf("\x1B", e);
|
|
5241
5241
|
if (n !== -1 && t[n + 1] === "[") {
|
|
5242
5242
|
const a = t.indexOf("m", n);
|
|
@@ -5340,17 +5340,17 @@ function Li() {
|
|
|
5340
5340
|
const r = [];
|
|
5341
5341
|
let s = 0;
|
|
5342
5342
|
do {
|
|
5343
|
-
const o =
|
|
5344
|
-
if (
|
|
5345
|
-
value:
|
|
5343
|
+
const o = Pi(a, s), l = o.sequence ? a.substring(s, o.startPosition) : a.substring(s);
|
|
5344
|
+
if (l.length > 0 && r.push({
|
|
5345
|
+
value: l,
|
|
5346
5346
|
foreground: t,
|
|
5347
5347
|
background: e,
|
|
5348
5348
|
decorations: new Set(n)
|
|
5349
5349
|
}), o.sequence) {
|
|
5350
|
-
const
|
|
5351
|
-
for (const c of
|
|
5350
|
+
const i = Ti(o.sequence);
|
|
5351
|
+
for (const c of i)
|
|
5352
5352
|
c.type === "resetAll" ? (t = null, e = null, n.clear()) : c.type === "resetForegroundColor" ? t = null : c.type === "resetBackgroundColor" ? e = null : c.type === "resetDecoration" && n.delete(c.value);
|
|
5353
|
-
for (const c of
|
|
5353
|
+
for (const c of i)
|
|
5354
5354
|
c.type === "setForegroundColor" ? t = c.value : c.type === "setBackgroundColor" ? e = c.value : c.type === "setDecoration" && n.add(c.value);
|
|
5355
5355
|
}
|
|
5356
5356
|
s = o.position;
|
|
@@ -5378,11 +5378,11 @@ var ji = {
|
|
|
5378
5378
|
brightWhite: "#ffffff"
|
|
5379
5379
|
};
|
|
5380
5380
|
function Mi(t = ji) {
|
|
5381
|
-
function e(
|
|
5382
|
-
return t[
|
|
5381
|
+
function e(l) {
|
|
5382
|
+
return t[l];
|
|
5383
5383
|
}
|
|
5384
|
-
function n(
|
|
5385
|
-
return `#${
|
|
5384
|
+
function n(l) {
|
|
5385
|
+
return `#${l.map((i) => Math.max(0, Math.min(i, 255)).toString(16).padStart(2, "0")).join("")}`;
|
|
5386
5386
|
}
|
|
5387
5387
|
let a;
|
|
5388
5388
|
function r() {
|
|
@@ -5391,27 +5391,27 @@ function Mi(t = ji) {
|
|
|
5391
5391
|
a = [];
|
|
5392
5392
|
for (let c = 0; c < Ie.length; c++)
|
|
5393
5393
|
a.push(e(Ie[c]));
|
|
5394
|
-
let
|
|
5394
|
+
let l = [0, 95, 135, 175, 215, 255];
|
|
5395
5395
|
for (let c = 0; c < 6; c++)
|
|
5396
5396
|
for (let u = 0; u < 6; u++)
|
|
5397
5397
|
for (let p = 0; p < 6; p++)
|
|
5398
|
-
a.push(n([
|
|
5399
|
-
let
|
|
5400
|
-
for (let c = 0; c < 24; c++,
|
|
5401
|
-
a.push(n([
|
|
5398
|
+
a.push(n([l[c], l[u], l[p]]));
|
|
5399
|
+
let i = 8;
|
|
5400
|
+
for (let c = 0; c < 24; c++, i += 10)
|
|
5401
|
+
a.push(n([i, i, i]));
|
|
5402
5402
|
return a;
|
|
5403
5403
|
}
|
|
5404
|
-
function s(
|
|
5405
|
-
return r()[
|
|
5404
|
+
function s(l) {
|
|
5405
|
+
return r()[l];
|
|
5406
5406
|
}
|
|
5407
|
-
function o(
|
|
5408
|
-
switch (
|
|
5407
|
+
function o(l) {
|
|
5408
|
+
switch (l.type) {
|
|
5409
5409
|
case "named":
|
|
5410
|
-
return e(
|
|
5410
|
+
return e(l.name);
|
|
5411
5411
|
case "rgb":
|
|
5412
|
-
return n(
|
|
5412
|
+
return n(l.rgb);
|
|
5413
5413
|
case "table":
|
|
5414
|
-
return s(
|
|
5414
|
+
return s(l.index);
|
|
5415
5415
|
}
|
|
5416
5416
|
}
|
|
5417
5417
|
return {
|
|
@@ -5421,23 +5421,23 @@ function Mi(t = ji) {
|
|
|
5421
5421
|
function Oi(t, e, n) {
|
|
5422
5422
|
const a = vt(t, n), r = Nt(e), s = Mi(
|
|
5423
5423
|
Object.fromEntries(
|
|
5424
|
-
Ie.map((
|
|
5425
|
-
var
|
|
5424
|
+
Ie.map((l) => {
|
|
5425
|
+
var i;
|
|
5426
5426
|
return [
|
|
5427
|
-
|
|
5428
|
-
(
|
|
5427
|
+
l,
|
|
5428
|
+
(i = t.colors) == null ? void 0 : i[`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`]
|
|
5429
5429
|
];
|
|
5430
5430
|
})
|
|
5431
5431
|
)
|
|
5432
5432
|
), o = Li();
|
|
5433
5433
|
return r.map(
|
|
5434
|
-
(
|
|
5434
|
+
(l) => o.parse(l[0]).map((i) => {
|
|
5435
5435
|
let c, u;
|
|
5436
|
-
|
|
5436
|
+
i.decorations.has("reverse") ? (c = i.background ? s.value(i.background) : t.bg, u = i.foreground ? s.value(i.foreground) : t.fg) : (c = i.foreground ? s.value(i.foreground) : t.fg, u = i.background ? s.value(i.background) : void 0), c = Ae(c, a), u = Ae(u, a), i.decorations.has("dim") && (c = Gi(c));
|
|
5437
5437
|
let p = Z.None;
|
|
5438
|
-
return
|
|
5439
|
-
content:
|
|
5440
|
-
offset:
|
|
5438
|
+
return i.decorations.has("bold") && (p |= Z.Bold), i.decorations.has("italic") && (p |= Z.Italic), i.decorations.has("underline") && (p |= Z.Underline), i.decorations.has("strikethrough") && (p |= Z.Strikethrough), {
|
|
5439
|
+
content: i.value,
|
|
5440
|
+
offset: l[1],
|
|
5441
5441
|
// TODO: more accurate offset? might need to fork ansi-sequence-parser
|
|
5442
5442
|
color: c,
|
|
5443
5443
|
bgColor: u,
|
|
@@ -5462,18 +5462,18 @@ function Sn(t, e, n = {}) {
|
|
|
5462
5462
|
theme: r = t.getLoadedThemes()[0]
|
|
5463
5463
|
} = n;
|
|
5464
5464
|
if (Cn(a) || xn(r))
|
|
5465
|
-
return Nt(e).map((
|
|
5465
|
+
return Nt(e).map((i) => [{ content: i[0], offset: i[1] }]);
|
|
5466
5466
|
const { theme: s, colorMap: o } = t.setTheme(r);
|
|
5467
5467
|
if (a === "ansi")
|
|
5468
5468
|
return Oi(s, e, n);
|
|
5469
|
-
const
|
|
5469
|
+
const l = t.getLanguage(a);
|
|
5470
5470
|
if (n.grammarState) {
|
|
5471
|
-
if (n.grammarState.lang !==
|
|
5472
|
-
throw new X(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${
|
|
5471
|
+
if (n.grammarState.lang !== l.name)
|
|
5472
|
+
throw new X(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);
|
|
5473
5473
|
if (!n.grammarState.themes.includes(s.name))
|
|
5474
5474
|
throw new X(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`);
|
|
5475
5475
|
}
|
|
5476
|
-
return Di(e,
|
|
5476
|
+
return Di(e, l, s, o, n);
|
|
5477
5477
|
}
|
|
5478
5478
|
function Fi(...t) {
|
|
5479
5479
|
if (t.length === 2)
|
|
@@ -5486,10 +5486,10 @@ function Fi(...t) {
|
|
|
5486
5486
|
throw new X("Plain language does not have grammar state");
|
|
5487
5487
|
if (r === "ansi")
|
|
5488
5488
|
throw new X("ANSI language does not have grammar state");
|
|
5489
|
-
const { theme: o, colorMap:
|
|
5489
|
+
const { theme: o, colorMap: l } = e.setTheme(s), i = e.getLanguage(r);
|
|
5490
5490
|
return new He(
|
|
5491
|
-
St(n,
|
|
5492
|
-
|
|
5491
|
+
St(n, i, o, l, a).stateStack,
|
|
5492
|
+
i.name,
|
|
5493
5493
|
o.name
|
|
5494
5494
|
);
|
|
5495
5495
|
}
|
|
@@ -5499,13 +5499,13 @@ function Di(t, e, n, a, r) {
|
|
|
5499
5499
|
e.name,
|
|
5500
5500
|
n.name
|
|
5501
5501
|
);
|
|
5502
|
-
return
|
|
5502
|
+
return Bt(s.tokens, o), s.tokens;
|
|
5503
5503
|
}
|
|
5504
5504
|
function St(t, e, n, a, r) {
|
|
5505
5505
|
const s = vt(n, r), {
|
|
5506
5506
|
tokenizeMaxLineLength: o = 0,
|
|
5507
|
-
tokenizeTimeLimit:
|
|
5508
|
-
} = r,
|
|
5507
|
+
tokenizeTimeLimit: l = 500
|
|
5508
|
+
} = r, i = Nt(t);
|
|
5509
5509
|
let c = r.grammarState ? Ii(r.grammarState, n.name) ?? on : r.grammarContextCode != null ? St(
|
|
5510
5510
|
r.grammarContextCode,
|
|
5511
5511
|
e,
|
|
@@ -5518,8 +5518,8 @@ function St(t, e, n, a, r) {
|
|
|
5518
5518
|
}
|
|
5519
5519
|
).stateStack : on, u = [];
|
|
5520
5520
|
const p = [];
|
|
5521
|
-
for (let d = 0, f =
|
|
5522
|
-
const [m, _] =
|
|
5521
|
+
for (let d = 0, f = i.length; d < f; d++) {
|
|
5522
|
+
const [m, _] = i[d];
|
|
5523
5523
|
if (m === "") {
|
|
5524
5524
|
u = [], p.push([]);
|
|
5525
5525
|
continue;
|
|
@@ -5534,8 +5534,8 @@ function St(t, e, n, a, r) {
|
|
|
5534
5534
|
continue;
|
|
5535
5535
|
}
|
|
5536
5536
|
let g, b, w;
|
|
5537
|
-
r.includeExplanation && (g = e.tokenizeLine(m, c,
|
|
5538
|
-
const k = e.tokenizeLine2(m, c,
|
|
5537
|
+
r.includeExplanation && (g = e.tokenizeLine(m, c, l), b = g.tokens, w = 0);
|
|
5538
|
+
const k = e.tokenizeLine2(m, c, l), v = k.tokens.length / 2;
|
|
5539
5539
|
for (let A = 0; A < v; A++) {
|
|
5540
5540
|
const O = k.tokens[2 * A], I = A + 1 < v ? k.tokens[2 * A + 2] : m.length;
|
|
5541
5541
|
if (O === I)
|
|
@@ -5632,20 +5632,20 @@ function Hi(t, e, n) {
|
|
|
5632
5632
|
return a;
|
|
5633
5633
|
}
|
|
5634
5634
|
function ar(t, e, n) {
|
|
5635
|
-
const a = Object.entries(n.themes).filter((
|
|
5635
|
+
const a = Object.entries(n.themes).filter((i) => i[1]).map((i) => ({ color: i[0], theme: i[1] })), r = a.map((i) => {
|
|
5636
5636
|
const c = Sn(t, e, {
|
|
5637
5637
|
...n,
|
|
5638
|
-
theme:
|
|
5639
|
-
}), u = nt(c), p = typeof
|
|
5638
|
+
theme: i.theme
|
|
5639
|
+
}), u = nt(c), p = typeof i.theme == "string" ? i.theme : i.theme.name;
|
|
5640
5640
|
return {
|
|
5641
5641
|
tokens: c,
|
|
5642
5642
|
state: u,
|
|
5643
5643
|
theme: p
|
|
5644
5644
|
};
|
|
5645
5645
|
}), s = Wi(
|
|
5646
|
-
...r.map((
|
|
5646
|
+
...r.map((i) => i.tokens)
|
|
5647
5647
|
), o = s[0].map(
|
|
5648
|
-
(
|
|
5648
|
+
(i, c) => i.map((u, p) => {
|
|
5649
5649
|
const d = {
|
|
5650
5650
|
content: u.content,
|
|
5651
5651
|
variants: {},
|
|
@@ -5661,32 +5661,32 @@ function ar(t, e, n) {
|
|
|
5661
5661
|
d.variants[a[m].color] = w;
|
|
5662
5662
|
}), d;
|
|
5663
5663
|
})
|
|
5664
|
-
),
|
|
5665
|
-
Object.fromEntries(r.map((
|
|
5664
|
+
), l = r[0].state ? new He(
|
|
5665
|
+
Object.fromEntries(r.map((i) => {
|
|
5666
5666
|
var c;
|
|
5667
|
-
return [
|
|
5667
|
+
return [i.theme, (c = i.state) == null ? void 0 : c.getInternalStack(i.theme)];
|
|
5668
5668
|
})),
|
|
5669
5669
|
r[0].state.lang
|
|
5670
5670
|
) : void 0;
|
|
5671
|
-
return
|
|
5671
|
+
return l && Bt(o, l), o;
|
|
5672
5672
|
}
|
|
5673
5673
|
function Wi(...t) {
|
|
5674
5674
|
const e = t.map(() => []), n = t.length;
|
|
5675
5675
|
for (let a = 0; a < t[0].length; a++) {
|
|
5676
|
-
const r = t.map((
|
|
5677
|
-
e.forEach((
|
|
5678
|
-
const o = r.map(() => 0),
|
|
5679
|
-
for (;
|
|
5680
|
-
const
|
|
5676
|
+
const r = t.map((i) => i[a]), s = e.map(() => []);
|
|
5677
|
+
e.forEach((i, c) => i.push(s[c]));
|
|
5678
|
+
const o = r.map(() => 0), l = r.map((i) => i[0]);
|
|
5679
|
+
for (; l.every((i) => i); ) {
|
|
5680
|
+
const i = Math.min(...l.map((c) => c.content.length));
|
|
5681
5681
|
for (let c = 0; c < n; c++) {
|
|
5682
|
-
const u =
|
|
5683
|
-
u.content.length ===
|
|
5682
|
+
const u = l[c];
|
|
5683
|
+
u.content.length === i ? (s[c].push(u), o[c] += 1, l[c] = r[c][o[c]]) : (s[c].push({
|
|
5684
5684
|
...u,
|
|
5685
|
-
content: u.content.slice(0,
|
|
5686
|
-
}),
|
|
5685
|
+
content: u.content.slice(0, i)
|
|
5686
|
+
}), l[c] = {
|
|
5687
5687
|
...u,
|
|
5688
|
-
content: u.content.slice(
|
|
5689
|
-
offset: u.offset +
|
|
5688
|
+
content: u.content.slice(i),
|
|
5689
|
+
offset: u.offset + i
|
|
5690
5690
|
});
|
|
5691
5691
|
}
|
|
5692
5692
|
}
|
|
@@ -5694,7 +5694,7 @@ function Wi(...t) {
|
|
|
5694
5694
|
return e;
|
|
5695
5695
|
}
|
|
5696
5696
|
function Et(t, e, n) {
|
|
5697
|
-
let a, r, s, o,
|
|
5697
|
+
let a, r, s, o, l, i;
|
|
5698
5698
|
if ("themes" in n) {
|
|
5699
5699
|
const {
|
|
5700
5700
|
defaultColor: c = "light",
|
|
@@ -5707,12 +5707,12 @@ function Et(t, e, n) {
|
|
|
5707
5707
|
e,
|
|
5708
5708
|
n
|
|
5709
5709
|
);
|
|
5710
|
-
if (
|
|
5710
|
+
if (i = nt(d), c && !p.find((g) => g.color === c))
|
|
5711
5711
|
throw new X(`\`themes\` option must contain the defaultColor key \`${c}\``);
|
|
5712
5712
|
const f = p.map((g) => t.getTheme(g.theme)), m = p.map((g) => g.color);
|
|
5713
|
-
s = d.map((g) => g.map((b) => Ei(b, m, u, c))),
|
|
5713
|
+
s = d.map((g) => g.map((b) => Ei(b, m, u, c))), i && Bt(s, i);
|
|
5714
5714
|
const _ = p.map((g) => vt(g.theme, n));
|
|
5715
|
-
r = p.map((g, b) => (b === 0 && c ? "" : `${u + g.color}:`) + (Ae(f[b].fg, _[b]) || "inherit")).join(";"), a = p.map((g, b) => (b === 0 && c ? "" : `${u + g.color}-bg:`) + (Ae(f[b].bg, _[b]) || "inherit")).join(";"), o = `shiki-themes ${f.map((g) => g.name).join(" ")}`,
|
|
5715
|
+
r = p.map((g, b) => (b === 0 && c ? "" : `${u + g.color}:`) + (Ae(f[b].fg, _[b]) || "inherit")).join(";"), a = p.map((g, b) => (b === 0 && c ? "" : `${u + g.color}-bg:`) + (Ae(f[b].bg, _[b]) || "inherit")).join(";"), o = `shiki-themes ${f.map((g) => g.name).join(" ")}`, l = c ? void 0 : [r, a].join(";");
|
|
5716
5716
|
} else if ("theme" in n) {
|
|
5717
5717
|
const c = vt(n.theme, n);
|
|
5718
5718
|
s = Sn(
|
|
@@ -5721,7 +5721,7 @@ function Et(t, e, n) {
|
|
|
5721
5721
|
n
|
|
5722
5722
|
);
|
|
5723
5723
|
const u = t.getTheme(n.theme);
|
|
5724
|
-
a = Ae(u.bg, c), r = Ae(u.fg, c), o = u.name,
|
|
5724
|
+
a = Ae(u.bg, c), r = Ae(u.fg, c), o = u.name, i = nt(s);
|
|
5725
5725
|
} else
|
|
5726
5726
|
throw new X("Invalid options, either `theme` or `themes` must be provided");
|
|
5727
5727
|
return {
|
|
@@ -5729,8 +5729,8 @@ function Et(t, e, n) {
|
|
|
5729
5729
|
fg: r,
|
|
5730
5730
|
bg: a,
|
|
5731
5731
|
themeName: o,
|
|
5732
|
-
rootStyle:
|
|
5733
|
-
grammarState:
|
|
5732
|
+
rootStyle: l,
|
|
5733
|
+
grammarState: i
|
|
5734
5734
|
};
|
|
5735
5735
|
}
|
|
5736
5736
|
function At(t, e, n, a = {
|
|
@@ -5746,8 +5746,8 @@ function At(t, e, n, a = {
|
|
|
5746
5746
|
let {
|
|
5747
5747
|
tokens: s,
|
|
5748
5748
|
fg: o,
|
|
5749
|
-
bg:
|
|
5750
|
-
themeName:
|
|
5749
|
+
bg: l,
|
|
5750
|
+
themeName: i,
|
|
5751
5751
|
rootStyle: c,
|
|
5752
5752
|
grammarState: u
|
|
5753
5753
|
} = Et(t, r, n);
|
|
@@ -5769,8 +5769,8 @@ function At(t, e, n, a = {
|
|
|
5769
5769
|
{
|
|
5770
5770
|
...n,
|
|
5771
5771
|
fg: o,
|
|
5772
|
-
bg:
|
|
5773
|
-
themeName:
|
|
5772
|
+
bg: l,
|
|
5773
|
+
themeName: i,
|
|
5774
5774
|
rootStyle: c
|
|
5775
5775
|
},
|
|
5776
5776
|
f,
|
|
@@ -5783,8 +5783,8 @@ function Vi(t, e, n, a = nt(t)) {
|
|
|
5783
5783
|
type: "root",
|
|
5784
5784
|
children: []
|
|
5785
5785
|
}, {
|
|
5786
|
-
structure:
|
|
5787
|
-
tabindex:
|
|
5786
|
+
structure: l = "classic",
|
|
5787
|
+
tabindex: i = "0"
|
|
5788
5788
|
} = e;
|
|
5789
5789
|
let c = {
|
|
5790
5790
|
type: "element",
|
|
@@ -5792,8 +5792,8 @@ function Vi(t, e, n, a = nt(t)) {
|
|
|
5792
5792
|
properties: {
|
|
5793
5793
|
class: `shiki ${e.themeName || ""}`,
|
|
5794
5794
|
style: e.rootStyle || `background-color:${e.bg};color:${e.fg}`,
|
|
5795
|
-
...
|
|
5796
|
-
tabindex:
|
|
5795
|
+
...i !== !1 && i != null ? {
|
|
5796
|
+
tabindex: i.toString()
|
|
5797
5797
|
} : {},
|
|
5798
5798
|
...Object.fromEntries(
|
|
5799
5799
|
Array.from(
|
|
@@ -5810,7 +5810,7 @@ function Vi(t, e, n, a = nt(t)) {
|
|
|
5810
5810
|
};
|
|
5811
5811
|
const p = [], d = {
|
|
5812
5812
|
...n,
|
|
5813
|
-
structure:
|
|
5813
|
+
structure: l,
|
|
5814
5814
|
addClassToHast: er,
|
|
5815
5815
|
get source() {
|
|
5816
5816
|
return n.source;
|
|
@@ -5836,7 +5836,7 @@ function Vi(t, e, n, a = nt(t)) {
|
|
|
5836
5836
|
};
|
|
5837
5837
|
if (t.forEach((b, w) => {
|
|
5838
5838
|
var A, O;
|
|
5839
|
-
w && (
|
|
5839
|
+
w && (l === "inline" ? o.children.push({ type: "element", tagName: "br", properties: {}, children: [] }) : l === "classic" && s.push({ type: "text", value: `
|
|
5840
5840
|
` }));
|
|
5841
5841
|
let k = {
|
|
5842
5842
|
type: "element",
|
|
@@ -5857,14 +5857,14 @@ function Vi(t, e, n, a = nt(t)) {
|
|
|
5857
5857
|
ce && (q.properties.style = ce);
|
|
5858
5858
|
for (const x of r)
|
|
5859
5859
|
q = ((A = x == null ? void 0 : x.span) == null ? void 0 : A.call(d, q, w + 1, v, k, I)) || q;
|
|
5860
|
-
|
|
5860
|
+
l === "inline" ? o.children.push(q) : l === "classic" && k.children.push(q), v += I.content.length;
|
|
5861
5861
|
}
|
|
5862
|
-
if (
|
|
5862
|
+
if (l === "classic") {
|
|
5863
5863
|
for (const I of r)
|
|
5864
5864
|
k = ((O = I == null ? void 0 : I.line) == null ? void 0 : O.call(d, k, w + 1)) || k;
|
|
5865
5865
|
p.push(k), s.push(k);
|
|
5866
5866
|
}
|
|
5867
|
-
}),
|
|
5867
|
+
}), l === "classic") {
|
|
5868
5868
|
for (const b of r)
|
|
5869
5869
|
u = ((m = b == null ? void 0 : b.code) == null ? void 0 : m.call(d, u)) || u;
|
|
5870
5870
|
c.children.push(u);
|
|
@@ -5875,15 +5875,15 @@ function Vi(t, e, n, a = nt(t)) {
|
|
|
5875
5875
|
let f = o;
|
|
5876
5876
|
for (const b of r)
|
|
5877
5877
|
f = ((g = b == null ? void 0 : b.root) == null ? void 0 : g.call(d, f)) || f;
|
|
5878
|
-
return a &&
|
|
5878
|
+
return a && Bt(f, a), f;
|
|
5879
5879
|
}
|
|
5880
5880
|
function Xi(t) {
|
|
5881
5881
|
return t.map((e) => {
|
|
5882
5882
|
const n = [];
|
|
5883
5883
|
let a = "", r = 0;
|
|
5884
5884
|
return e.forEach((s, o) => {
|
|
5885
|
-
const
|
|
5886
|
-
|
|
5885
|
+
const i = !(s.fontStyle && (s.fontStyle & Z.Underline || s.fontStyle & Z.Strikethrough));
|
|
5886
|
+
i && s.content.match(/^\s+$/) && e[o + 1] ? (r || (r = s.offset), a += s.content) : a ? (i ? n.push({
|
|
5887
5887
|
...s,
|
|
5888
5888
|
offset: r,
|
|
5889
5889
|
content: a + s.content
|
|
@@ -5907,18 +5907,18 @@ function Zi(t) {
|
|
|
5907
5907
|
const [, r, s, o] = a;
|
|
5908
5908
|
if (!r && !o)
|
|
5909
5909
|
return n;
|
|
5910
|
-
const
|
|
5910
|
+
const l = [{
|
|
5911
5911
|
...n,
|
|
5912
5912
|
offset: n.offset + r.length,
|
|
5913
5913
|
content: s
|
|
5914
5914
|
}];
|
|
5915
|
-
return r &&
|
|
5915
|
+
return r && l.unshift({
|
|
5916
5916
|
content: r,
|
|
5917
5917
|
offset: n.offset
|
|
5918
|
-
}), o &&
|
|
5918
|
+
}), o && l.push({
|
|
5919
5919
|
content: o,
|
|
5920
5920
|
offset: n.offset + r.length + s.length
|
|
5921
|
-
}),
|
|
5921
|
+
}), l;
|
|
5922
5922
|
}));
|
|
5923
5923
|
}
|
|
5924
5924
|
function Ki(t) {
|
|
@@ -5929,8 +5929,8 @@ function Ki(t) {
|
|
|
5929
5929
|
n.push({ ...a });
|
|
5930
5930
|
continue;
|
|
5931
5931
|
}
|
|
5932
|
-
const r = n[n.length - 1], s = r.htmlStyle || dn(Ct(r)), o = a.htmlStyle || dn(Ct(a)),
|
|
5933
|
-
!
|
|
5932
|
+
const r = n[n.length - 1], s = r.htmlStyle || dn(Ct(r)), o = a.htmlStyle || dn(Ct(a)), l = r.fontStyle && (r.fontStyle & Z.Underline || r.fontStyle & Z.Strikethrough), i = a.fontStyle && (a.fontStyle & Z.Underline || a.fontStyle & Z.Strikethrough);
|
|
5933
|
+
!l && !i && s === o ? r.content += a.content : n.push({ ...a });
|
|
5934
5934
|
}
|
|
5935
5935
|
return n;
|
|
5936
5936
|
});
|
|
@@ -5941,8 +5941,8 @@ function Qi(t, e, n) {
|
|
|
5941
5941
|
const a = {
|
|
5942
5942
|
meta: {},
|
|
5943
5943
|
options: n,
|
|
5944
|
-
codeToHast: (o,
|
|
5945
|
-
codeToTokens: (o,
|
|
5944
|
+
codeToHast: (o, l) => At(t, o, l),
|
|
5945
|
+
codeToTokens: (o, l) => Et(t, o, l)
|
|
5946
5946
|
};
|
|
5947
5947
|
let r = Ji(At(t, e, n, a));
|
|
5948
5948
|
for (const o of xt(n))
|
|
@@ -5951,7 +5951,7 @@ function Qi(t, e, n) {
|
|
|
5951
5951
|
}
|
|
5952
5952
|
const ea = { light: "#333333", dark: "#bbbbbb" }, ta = { light: "#fffffe", dark: "#1e1e1e" }, na = "__shiki_resolved";
|
|
5953
5953
|
function En(t) {
|
|
5954
|
-
var
|
|
5954
|
+
var l, i, c, u, p;
|
|
5955
5955
|
if (t != null && t[na])
|
|
5956
5956
|
return t;
|
|
5957
5957
|
const e = {
|
|
@@ -5961,7 +5961,7 @@ function En(t) {
|
|
|
5961
5961
|
let { bg: n, fg: a } = e;
|
|
5962
5962
|
if (!n || !a) {
|
|
5963
5963
|
const d = e.settings ? e.settings.find((f) => !f.name && !f.scope) : void 0;
|
|
5964
|
-
(
|
|
5964
|
+
(l = d == null ? void 0 : d.settings) != null && l.foreground && (a = d.settings.foreground), (i = d == null ? void 0 : d.settings) != null && i.background && (n = d.settings.background), !a && ((c = e == null ? void 0 : e.colors) != null && c["editor.foreground"]) && (a = e.colors["editor.foreground"]), !n && ((u = e == null ? void 0 : e.colors) != null && u["editor.background"]) && (n = e.colors["editor.background"]), a || (a = e.type === "light" ? ea.light : ea.dark), n || (n = e.type === "light" ? ta.light : ta.dark), e.fg = a, e.bg = n;
|
|
5965
5965
|
}
|
|
5966
5966
|
e.settings[0] && e.settings[0].settings && !e.settings[0].scope || e.settings.unshift({
|
|
5967
5967
|
settings: {
|
|
@@ -6075,7 +6075,7 @@ class tl extends ao {
|
|
|
6075
6075
|
return this._resolvedGrammars.get(n);
|
|
6076
6076
|
}
|
|
6077
6077
|
loadLanguage(n) {
|
|
6078
|
-
var o,
|
|
6078
|
+
var o, l, i, c;
|
|
6079
6079
|
if (this.getGrammar(n.name))
|
|
6080
6080
|
return;
|
|
6081
6081
|
const a = new Set(
|
|
@@ -6095,7 +6095,7 @@ class tl extends ao {
|
|
|
6095
6095
|
this._alias[u] = n.name;
|
|
6096
6096
|
}), this._loadedLanguagesCache = null, a.size)
|
|
6097
6097
|
for (const u of a)
|
|
6098
|
-
this._resolvedGrammars.delete(u.name), this._loadedLanguagesCache = null, (
|
|
6098
|
+
this._resolvedGrammars.delete(u.name), this._loadedLanguagesCache = null, (l = (o = this._syncRegistry) == null ? void 0 : o._injectionGrammars) == null || l.delete(u.scopeName), (c = (i = this._syncRegistry) == null ? void 0 : i._grammars) == null || c.delete(u.scopeName), this.loadLanguage(this._langMap.get(u.name));
|
|
6099
6099
|
}
|
|
6100
6100
|
dispose() {
|
|
6101
6101
|
super.dispose(), this._resolvedThemes.clear(), this._resolvedGrammars.clear(), this._langMap.clear(), this._langGraph.clear(), this._loadedThemesCache = null;
|
|
@@ -6105,9 +6105,9 @@ class tl extends ao {
|
|
|
6105
6105
|
this.resolveEmbeddedLanguages(s);
|
|
6106
6106
|
const a = Array.from(this._langGraph.entries()), r = a.filter(([s, o]) => !o);
|
|
6107
6107
|
if (r.length) {
|
|
6108
|
-
const s = a.filter(([o,
|
|
6109
|
-
var
|
|
6110
|
-
return
|
|
6108
|
+
const s = a.filter(([o, l]) => {
|
|
6109
|
+
var i;
|
|
6110
|
+
return l && ((i = l.embeddedLangs) == null ? void 0 : i.some((c) => r.map(([u]) => u).includes(c)));
|
|
6111
6111
|
}).filter((o) => !r.includes(o));
|
|
6112
6112
|
throw new Fe(`Missing languages ${r.map(([o]) => `\`${o}\``).join(", ")}, required by ${s.map(([o]) => `\`${o}\``).join(", ")}`);
|
|
6113
6113
|
}
|
|
@@ -6172,14 +6172,14 @@ function al(t) {
|
|
|
6172
6172
|
throw new Fe("`engine` option is required for synchronous mode");
|
|
6173
6173
|
const n = (t.langs || []).flat(1), a = (t.themes || []).flat(1).map(En), r = new nl(t.engine, n), s = new tl(r, a, n, t.langAlias);
|
|
6174
6174
|
let o;
|
|
6175
|
-
function
|
|
6175
|
+
function l(w) {
|
|
6176
6176
|
g();
|
|
6177
6177
|
const k = s.getGrammar(typeof w == "string" ? w : w.name);
|
|
6178
6178
|
if (!k)
|
|
6179
6179
|
throw new Fe(`Language \`${w}\` not found, you may need to load it first`);
|
|
6180
6180
|
return k;
|
|
6181
6181
|
}
|
|
6182
|
-
function
|
|
6182
|
+
function i(w) {
|
|
6183
6183
|
if (w === "none")
|
|
6184
6184
|
return { bg: "", fg: "", name: "none", settings: [], type: "dark" };
|
|
6185
6185
|
g();
|
|
@@ -6190,7 +6190,7 @@ function al(t) {
|
|
|
6190
6190
|
}
|
|
6191
6191
|
function c(w) {
|
|
6192
6192
|
g();
|
|
6193
|
-
const k =
|
|
6193
|
+
const k = i(w);
|
|
6194
6194
|
o !== w && (s.setTheme(k), o = w);
|
|
6195
6195
|
const v = s.getColorMap();
|
|
6196
6196
|
return {
|
|
@@ -6227,8 +6227,8 @@ function al(t) {
|
|
|
6227
6227
|
}
|
|
6228
6228
|
return {
|
|
6229
6229
|
setTheme: c,
|
|
6230
|
-
getTheme:
|
|
6231
|
-
getLanguage:
|
|
6230
|
+
getTheme: i,
|
|
6231
|
+
getLanguage: l,
|
|
6232
6232
|
getLoadedThemes: u,
|
|
6233
6233
|
getLoadedLanguages: p,
|
|
6234
6234
|
loadLanguage: f,
|
|
@@ -6331,19 +6331,19 @@ function ul(t, e = {}) {
|
|
|
6331
6331
|
}, replaceCurrentModX(p) {
|
|
6332
6332
|
r[r.length - 1] = p;
|
|
6333
6333
|
}, singleline: n.rules.singleline };
|
|
6334
|
-
let o = [],
|
|
6335
|
-
for (dt.lastIndex = 0;
|
|
6336
|
-
const p = pl(s, t,
|
|
6334
|
+
let o = [], l;
|
|
6335
|
+
for (dt.lastIndex = 0; l = dt.exec(t); ) {
|
|
6336
|
+
const p = pl(s, t, l[0], dt.lastIndex);
|
|
6337
6337
|
p.tokens ? o.push(...p.tokens) : p.token && o.push(p.token), p.lastIndex !== void 0 && (dt.lastIndex = p.lastIndex);
|
|
6338
6338
|
}
|
|
6339
|
-
const
|
|
6339
|
+
const i = [];
|
|
6340
6340
|
let c = 0;
|
|
6341
6341
|
o.filter((p) => p.type === "GroupOpen").forEach((p) => {
|
|
6342
|
-
p.kind === "capturing" ? p.number = ++c : p.raw === "(" &&
|
|
6343
|
-
}), c ||
|
|
6342
|
+
p.kind === "capturing" ? p.number = ++c : p.raw === "(" && i.push(p);
|
|
6343
|
+
}), c || i.forEach((p, d) => {
|
|
6344
6344
|
p.kind = "capturing", p.number = d + 1;
|
|
6345
6345
|
});
|
|
6346
|
-
const u = c ||
|
|
6346
|
+
const u = c || i.length;
|
|
6347
6347
|
return { tokens: o.map((p) => p.type === "EscapedNumber" ? Nl(p, u) : p).flat(), flags: a };
|
|
6348
6348
|
}
|
|
6349
6349
|
function pl(t, e, n, a) {
|
|
@@ -6407,7 +6407,7 @@ function pl(t, e, n, a) {
|
|
|
6407
6407
|
const o = t.singleline ? { "^": H`\A`, $: H`\Z` }[n] : n;
|
|
6408
6408
|
return { token: aa(o, n) };
|
|
6409
6409
|
}
|
|
6410
|
-
return n === "|" ? { token: fl(n) } : In.test(n) ? { tokens:
|
|
6410
|
+
return n === "|" ? { token: fl(n) } : In.test(n) ? { tokens: Bl(n) } : { token: ge(We(n), n) };
|
|
6411
6411
|
}
|
|
6412
6412
|
function dl(t, e, n) {
|
|
6413
6413
|
const a = [ra(e[1] === "^", e)];
|
|
@@ -6419,8 +6419,8 @@ function dl(t, e, n) {
|
|
|
6419
6419
|
if (a.at(-1).type === "CharacterClassOpen") a.push(ge(93, o));
|
|
6420
6420
|
else if (r--, a.push(hl(o)), !r) break;
|
|
6421
6421
|
} else {
|
|
6422
|
-
const
|
|
6423
|
-
Array.isArray(
|
|
6422
|
+
const l = ml(o);
|
|
6423
|
+
Array.isArray(l) ? a.push(...l) : a.push(l);
|
|
6424
6424
|
}
|
|
6425
6425
|
}
|
|
6426
6426
|
return { tokens: a, lastIndex: Xt.lastIndex || t.length };
|
|
@@ -6446,8 +6446,8 @@ function lr(t, { inCharClass: e }) {
|
|
|
6446
6446
|
if (new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}", "u").test(t)) try {
|
|
6447
6447
|
const a = t.split(/\\x/).slice(1).map((o) => parseInt(o, 16)), r = new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }).decode(new Uint8Array(a)), s = new TextEncoder();
|
|
6448
6448
|
return [...r].map((o) => {
|
|
6449
|
-
const
|
|
6450
|
-
return ge(We(o),
|
|
6449
|
+
const l = [...s.encode(o)].map((i) => `\\x${i.toString(16)}`).join("");
|
|
6450
|
+
return ge(We(o), l);
|
|
6451
6451
|
});
|
|
6452
6452
|
} catch {
|
|
6453
6453
|
throw new Error(`Multibyte code "${t}" incomplete or invalid in Oniguruma`);
|
|
@@ -6517,9 +6517,9 @@ function Cl(t) {
|
|
|
6517
6517
|
function xl(t, e) {
|
|
6518
6518
|
let { on: n, off: a } = /^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(t).groups;
|
|
6519
6519
|
a ?? (a = "");
|
|
6520
|
-
const r = (e.getCurrentModX() || n.includes("x")) && !a.includes("x"), s = ia(n), o = ia(a),
|
|
6521
|
-
if (s && (
|
|
6522
|
-
if (t.endsWith(":")) return e.pushModX(r), e.numOpenGroups++, Oe("group", t, { ...(s || o) && { flags:
|
|
6520
|
+
const r = (e.getCurrentModX() || n.includes("x")) && !a.includes("x"), s = ia(n), o = ia(a), l = {};
|
|
6521
|
+
if (s && (l.enable = s), o && (l.disable = o), t.endsWith(")")) return e.replaceCurrentModX(r), ur("flags", t, { flags: l });
|
|
6522
|
+
if (t.endsWith(":")) return e.pushModX(r), e.numOpenGroups++, Oe("group", t, { ...(s || o) && { flags: l } });
|
|
6523
6523
|
throw new Error(`Unexpected flag modifier "${t}"`);
|
|
6524
6524
|
}
|
|
6525
6525
|
function Sl(t) {
|
|
@@ -6528,7 +6528,7 @@ function Sl(t) {
|
|
|
6528
6528
|
const { name: n, tag: a, args: r } = e.groups;
|
|
6529
6529
|
if (!n) throw new Error(`Invalid named callout "${t}"`);
|
|
6530
6530
|
if (a === "") throw new Error(`Named callout tag with empty value not allowed "${t}"`);
|
|
6531
|
-
const s = r ? r.split(",").filter((u) => u !== "").map((u) => /^[+-]?\d+$/.test(u) ? +u : u) : [], [o,
|
|
6531
|
+
const s = r ? r.split(",").filter((u) => u !== "").map((u) => /^[+-]?\d+$/.test(u) ? +u : u) : [], [o, l, i] = s, c = vl.has(n) ? n.toLowerCase() : "custom";
|
|
6532
6532
|
switch (c) {
|
|
6533
6533
|
case "fail":
|
|
6534
6534
|
case "mismatch":
|
|
@@ -6542,7 +6542,7 @@ function Sl(t) {
|
|
|
6542
6542
|
case "max":
|
|
6543
6543
|
if (!s.length || s.length > 2) throw new Error(`Named callout must have one or two arguments "${s}"`);
|
|
6544
6544
|
if (typeof o == "string" && !/^[A-Za-z_]\w*$/.test(o)) throw new Error(`Named callout argument one must be a tag or number "${o}"`);
|
|
6545
|
-
if (s.length === 2 && (typeof
|
|
6545
|
+
if (s.length === 2 && (typeof l == "number" || !/^[<>X]$/.test(l))) throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${l}"`);
|
|
6546
6546
|
break;
|
|
6547
6547
|
case "count":
|
|
6548
6548
|
case "total_count":
|
|
@@ -6552,8 +6552,8 @@ function Sl(t) {
|
|
|
6552
6552
|
case "cmp":
|
|
6553
6553
|
if (s.length !== 3) throw new Error(`Named callout must have three arguments "${s}"`);
|
|
6554
6554
|
if (typeof o == "string" && !/^[A-Za-z_]\w*$/.test(o)) throw new Error(`Named callout argument one must be a tag or number "${o}"`);
|
|
6555
|
-
if (typeof
|
|
6556
|
-
if (typeof
|
|
6555
|
+
if (typeof l == "number" || !/^(?:[<>!=]=|[<>])$/.test(l)) throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${l}"`);
|
|
6556
|
+
if (typeof i == "string" && !/^[A-Za-z_]\w*$/.test(i)) throw new Error(`Named callout argument three must be a tag or number "${i}"`);
|
|
6557
6557
|
break;
|
|
6558
6558
|
case "custom":
|
|
6559
6559
|
throw new Error(`Undefined callout name "${n}"`);
|
|
@@ -6609,17 +6609,17 @@ function Nl(t, e) {
|
|
|
6609
6609
|
const { raw: n, inCharClass: a } = t, r = n.slice(1);
|
|
6610
6610
|
if (!a && (r !== "0" && r.length === 1 || r[0] !== "0" && +r <= e)) return [cr(n)];
|
|
6611
6611
|
const s = [], o = r.match(/^[0-7]+|\d/g);
|
|
6612
|
-
for (let
|
|
6613
|
-
const
|
|
6612
|
+
for (let l = 0; l < o.length; l++) {
|
|
6613
|
+
const i = o[l];
|
|
6614
6614
|
let c;
|
|
6615
|
-
if (
|
|
6616
|
-
if (c = parseInt(
|
|
6617
|
-
} else c = We(
|
|
6618
|
-
s.push(ge(c, (
|
|
6615
|
+
if (l === 0 && i !== "8" && i !== "9") {
|
|
6616
|
+
if (c = parseInt(i, 8), c > 127) throw new Error(H`Octal encoded byte above 177 unsupported "${n}"`);
|
|
6617
|
+
} else c = We(i);
|
|
6618
|
+
s.push(ge(c, (l === 0 ? "\\" : "") + i));
|
|
6619
6619
|
}
|
|
6620
6620
|
return s;
|
|
6621
6621
|
}
|
|
6622
|
-
function
|
|
6622
|
+
function Bl(t) {
|
|
6623
6623
|
const e = [], n = new RegExp(In, "gy");
|
|
6624
6624
|
let a;
|
|
6625
6625
|
for (; a = n.exec(t); ) {
|
|
@@ -6627,8 +6627,8 @@ function Pl(t) {
|
|
|
6627
6627
|
if (r[0] === "{") {
|
|
6628
6628
|
const s = /^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(r);
|
|
6629
6629
|
if (s) {
|
|
6630
|
-
const { min: o, max:
|
|
6631
|
-
if (+o > +
|
|
6630
|
+
const { min: o, max: l } = s.groups;
|
|
6631
|
+
if (+o > +l && r.endsWith("?")) {
|
|
6632
6632
|
n.lastIndex--, e.push(oa(r.slice(0, -1)));
|
|
6633
6633
|
continue;
|
|
6634
6634
|
}
|
|
@@ -6644,7 +6644,7 @@ function pr(t, e) {
|
|
|
6644
6644
|
const n = t.body[0];
|
|
6645
6645
|
return !e || Object.keys(e).every((a) => e[a] === n[a]);
|
|
6646
6646
|
}
|
|
6647
|
-
function
|
|
6647
|
+
function Pl(t) {
|
|
6648
6648
|
return Tl.has(t.type);
|
|
6649
6649
|
}
|
|
6650
6650
|
const Tl = /* @__PURE__ */ new Set(["AbsenceFunction", "Backreference", "CapturingGroup", "Character", "CharacterClass", "CharacterSet", "Group", "Quantifier", "Subroutine"]);
|
|
@@ -6653,13 +6653,13 @@ function dr(t, e = {}) {
|
|
|
6653
6653
|
const m = a.tokens[s.nextIndex];
|
|
6654
6654
|
switch (s.parent = d, s.nextIndex++, m.type) {
|
|
6655
6655
|
case "Alternator":
|
|
6656
|
-
return
|
|
6656
|
+
return Pe();
|
|
6657
6657
|
case "Assertion":
|
|
6658
6658
|
return Ll(m);
|
|
6659
6659
|
case "Backreference":
|
|
6660
6660
|
return jl(m, s);
|
|
6661
6661
|
case "Character":
|
|
6662
|
-
return
|
|
6662
|
+
return Pt(m.value, { useLastValid: !!f.isCheckingRangeEnd });
|
|
6663
6663
|
case "CharacterClassHyphen":
|
|
6664
6664
|
return Ml(m, s, f);
|
|
6665
6665
|
case "CharacterClassOpen":
|
|
@@ -6680,16 +6680,16 @@ function dr(t, e = {}) {
|
|
|
6680
6680
|
throw new Error(`Unexpected token type "${m.type}"`);
|
|
6681
6681
|
}
|
|
6682
6682
|
}, s = { capturingGroups: [], hasNumberedRef: !1, namedGroupsByName: /* @__PURE__ */ new Map(), nextIndex: 0, normalizeUnknownPropertyNames: n.normalizeUnknownPropertyNames, parent: null, skipBackrefValidation: n.skipBackrefValidation, skipLookbehindValidation: n.skipLookbehindValidation, skipPropertyNameValidation: n.skipPropertyNameValidation, subroutines: [], tokens: a.tokens, unicodePropertyMap: n.unicodePropertyMap, walk: r }, o = Zl(Wl(a.flags));
|
|
6683
|
-
let
|
|
6683
|
+
let l = o.body[0];
|
|
6684
6684
|
for (; s.nextIndex < a.tokens.length; ) {
|
|
6685
|
-
const d = r(
|
|
6686
|
-
d.type === "Alternative" ? (o.body.push(d),
|
|
6685
|
+
const d = r(l, {});
|
|
6686
|
+
d.type === "Alternative" ? (o.body.push(d), l = d) : l.body.push(d);
|
|
6687
6687
|
}
|
|
6688
|
-
const { capturingGroups:
|
|
6688
|
+
const { capturingGroups: i, hasNumberedRef: c, namedGroupsByName: u, subroutines: p } = s;
|
|
6689
6689
|
if (c && u.size && !n.rules.captureGroup) throw new Error("Numbered backref/subroutine not allowed when using named capture");
|
|
6690
6690
|
for (const { ref: d } of p) if (typeof d == "number") {
|
|
6691
|
-
if (d >
|
|
6692
|
-
d && (
|
|
6691
|
+
if (d > i.length) throw new Error("Subroutine uses a group number that's not defined");
|
|
6692
|
+
d && (i[d - 1].isSubroutined = !0);
|
|
6693
6693
|
} else if (u.has(d)) {
|
|
6694
6694
|
if (u.get(d).length > 1) throw new Error(H`Subroutine uses a duplicate group name "\g<${d}>"`);
|
|
6695
6695
|
u.get(d)[0].isSubroutined = !0;
|
|
@@ -6701,11 +6701,11 @@ function Ll({ kind: t }) {
|
|
|
6701
6701
|
}
|
|
6702
6702
|
function jl({ raw: t }, e) {
|
|
6703
6703
|
const n = /^\\k[<']/.test(t), a = n ? t.slice(3, -1) : t.slice(1), r = (s, o = !1) => {
|
|
6704
|
-
const
|
|
6705
|
-
let
|
|
6706
|
-
if (s >
|
|
6704
|
+
const l = e.capturingGroups.length;
|
|
6705
|
+
let i = !1;
|
|
6706
|
+
if (s > l) if (e.skipBackrefValidation) i = !0;
|
|
6707
6707
|
else throw new Error(`Not enough capturing groups defined to the left "${t}"`);
|
|
6708
|
-
return e.hasNumberedRef = !0, fn(o ?
|
|
6708
|
+
return e.hasNumberedRef = !0, fn(o ? l + 1 - s : s, { orphan: i });
|
|
6709
6709
|
};
|
|
6710
6710
|
if (n) {
|
|
6711
6711
|
const s = /^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(a);
|
|
@@ -6717,45 +6717,45 @@ function jl({ raw: t }, e) {
|
|
|
6717
6717
|
return r(+a);
|
|
6718
6718
|
}
|
|
6719
6719
|
function Ml(t, e, n) {
|
|
6720
|
-
const { tokens: a, walk: r } = e, s = e.parent, o = s.body.at(-1),
|
|
6721
|
-
if (!n.isCheckingRangeEnd && o && o.type !== "CharacterClass" && o.type !== "CharacterClassRange" &&
|
|
6722
|
-
const
|
|
6723
|
-
if (o.type === "Character" &&
|
|
6720
|
+
const { tokens: a, walk: r } = e, s = e.parent, o = s.body.at(-1), l = a[e.nextIndex];
|
|
6721
|
+
if (!n.isCheckingRangeEnd && o && o.type !== "CharacterClass" && o.type !== "CharacterClassRange" && l && l.type !== "CharacterClassOpen" && l.type !== "CharacterClassClose" && l.type !== "CharacterClassIntersector") {
|
|
6722
|
+
const i = r(s, { ...n, isCheckingRangeEnd: !0 });
|
|
6723
|
+
if (o.type === "Character" && i.type === "Character") return s.body.pop(), ql(o, i);
|
|
6724
6724
|
throw new Error("Invalid character class range");
|
|
6725
6725
|
}
|
|
6726
|
-
return
|
|
6726
|
+
return Pt(We("-"));
|
|
6727
6727
|
}
|
|
6728
6728
|
function Ol({ negate: t }, e, n) {
|
|
6729
6729
|
const { tokens: a, walk: r } = e, s = a[e.nextIndex], o = [bt()];
|
|
6730
|
-
let
|
|
6731
|
-
for (;
|
|
6732
|
-
if (
|
|
6730
|
+
let l = ua(s);
|
|
6731
|
+
for (; l.type !== "CharacterClassClose"; ) {
|
|
6732
|
+
if (l.type === "CharacterClassIntersector") o.push(bt()), e.nextIndex++;
|
|
6733
6733
|
else {
|
|
6734
6734
|
const c = o.at(-1);
|
|
6735
6735
|
c.body.push(r(c, n));
|
|
6736
6736
|
}
|
|
6737
|
-
|
|
6737
|
+
l = ua(a[e.nextIndex], s);
|
|
6738
6738
|
}
|
|
6739
|
-
const
|
|
6740
|
-
return o.length === 1 ?
|
|
6739
|
+
const i = bt({ negate: t });
|
|
6740
|
+
return o.length === 1 ? i.body = o[0].body : (i.kind = "intersection", i.body = o.map((c) => c.body.length === 1 ? c.body[0] : c)), e.nextIndex++, i;
|
|
6741
6741
|
}
|
|
6742
6742
|
function Gl({ kind: t, negate: e, value: n }, a) {
|
|
6743
6743
|
const { normalizeUnknownPropertyNames: r, skipPropertyNameValidation: s, unicodePropertyMap: o } = a;
|
|
6744
6744
|
if (t === "property") {
|
|
6745
|
-
const
|
|
6746
|
-
if (An.has(
|
|
6745
|
+
const l = Tt(n);
|
|
6746
|
+
if (An.has(l) && !(o != null && o.has(l))) t = "posix", n = l;
|
|
6747
6747
|
else return Ge(n, { negate: e, normalizeUnknownPropertyNames: r, skipPropertyNameValidation: s, unicodePropertyMap: o });
|
|
6748
6748
|
}
|
|
6749
6749
|
return t === "posix" ? Xl(n, { negate: e }) : hn(t, { negate: e });
|
|
6750
6750
|
}
|
|
6751
6751
|
function Fl(t, e, n) {
|
|
6752
|
-
const { tokens: a, capturingGroups: r, namedGroupsByName: s, skipLookbehindValidation: o, walk:
|
|
6753
|
-
if (
|
|
6752
|
+
const { tokens: a, capturingGroups: r, namedGroupsByName: s, skipLookbehindValidation: o, walk: l } = e, i = Kl(t), c = i.type === "AbsenceFunction", u = ca(i), p = u && i.negate;
|
|
6753
|
+
if (i.type === "CapturingGroup" && (r.push(i), i.name && cl(s, i.name, []).push(i)), c && n.isInAbsenceFunction) throw new Error("Nested absence function not supported by Oniguruma");
|
|
6754
6754
|
let d = pa(a[e.nextIndex]);
|
|
6755
6755
|
for (; d.type !== "GroupClose"; ) {
|
|
6756
|
-
if (d.type === "Alternator")
|
|
6756
|
+
if (d.type === "Alternator") i.body.push(Pe()), e.nextIndex++;
|
|
6757
6757
|
else {
|
|
6758
|
-
const f =
|
|
6758
|
+
const f = i.body.at(-1), m = l(f, { ...n, isInAbsenceFunction: n.isInAbsenceFunction || c, isInLookbehind: n.isInLookbehind || u, isInNegLookbehind: n.isInNegLookbehind || p });
|
|
6759
6759
|
if (f.body.push(m), (u || n.isInLookbehind) && !o) {
|
|
6760
6760
|
const _ = "Lookbehind includes a pattern not allowed by Oniguruma";
|
|
6761
6761
|
if (p || n.isInNegLookbehind) {
|
|
@@ -6765,11 +6765,11 @@ function Fl(t, e, n) {
|
|
|
6765
6765
|
}
|
|
6766
6766
|
d = pa(a[e.nextIndex]);
|
|
6767
6767
|
}
|
|
6768
|
-
return e.nextIndex++,
|
|
6768
|
+
return e.nextIndex++, i;
|
|
6769
6769
|
}
|
|
6770
6770
|
function Dl({ kind: t, min: e, max: n }, a) {
|
|
6771
6771
|
const r = a.parent, s = r.body.at(-1);
|
|
6772
|
-
if (!s || !
|
|
6772
|
+
if (!s || !Pl(s)) throw new Error("Quantifier requires a repeatable token");
|
|
6773
6773
|
const o = fr(t, e, n, s);
|
|
6774
6774
|
return r.body.pop(), o;
|
|
6775
6775
|
}
|
|
@@ -6778,8 +6778,8 @@ function Ul({ raw: t }, e) {
|
|
|
6778
6778
|
let r = t.slice(3, -1);
|
|
6779
6779
|
const s = /^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(r);
|
|
6780
6780
|
if (s) {
|
|
6781
|
-
const
|
|
6782
|
-
if (e.hasNumberedRef = !0, r = { "":
|
|
6781
|
+
const l = +s.groups.num, i = n.length;
|
|
6782
|
+
if (e.hasNumberedRef = !0, r = { "": l, "+": i + l, "-": i + 1 - l }[s.groups.sign], r < 1) throw new Error("Invalid subroutine number");
|
|
6783
6783
|
} else r === "0" && (r = 0);
|
|
6784
6784
|
const o = hr(r);
|
|
6785
6785
|
return a.push(o), o;
|
|
@@ -6787,7 +6787,7 @@ function Ul({ raw: t }, e) {
|
|
|
6787
6787
|
function zl(t, e) {
|
|
6788
6788
|
return { type: "AbsenceFunction", kind: t, body: lt(e == null ? void 0 : e.body) };
|
|
6789
6789
|
}
|
|
6790
|
-
function
|
|
6790
|
+
function Pe(t) {
|
|
6791
6791
|
return { type: "Alternative", body: gr(t == null ? void 0 : t.body) };
|
|
6792
6792
|
}
|
|
6793
6793
|
function mn(t, e) {
|
|
@@ -6803,7 +6803,7 @@ function mr(t, e) {
|
|
|
6803
6803
|
if (n.name !== void 0 && !Jl(n.name)) throw new Error(`Group name "${n.name}" invalid in Oniguruma`);
|
|
6804
6804
|
return { type: "CapturingGroup", number: t, ...n.name && { name: n.name }, ...n.isSubroutined && { isSubroutined: n.isSubroutined }, body: lt(e == null ? void 0 : e.body) };
|
|
6805
6805
|
}
|
|
6806
|
-
function
|
|
6806
|
+
function Pt(t, e) {
|
|
6807
6807
|
const n = { useLastValid: !1, ...e };
|
|
6808
6808
|
if (t > 1114111) {
|
|
6809
6809
|
const a = t.toString(16);
|
|
@@ -6887,7 +6887,7 @@ function Kl({ flags: t, kind: e, name: n, negate: a, number: r }) {
|
|
|
6887
6887
|
}
|
|
6888
6888
|
}
|
|
6889
6889
|
function lt(t) {
|
|
6890
|
-
if (t === void 0) t = [
|
|
6890
|
+
if (t === void 0) t = [Pe()];
|
|
6891
6891
|
else if (!Array.isArray(t) || !t.length || !t.every((e) => e.type === "Alternative")) throw new Error("Invalid body; expected array of one or more Alternative nodes");
|
|
6892
6892
|
return t;
|
|
6893
6893
|
}
|
|
@@ -6919,29 +6919,29 @@ function pa(t) {
|
|
|
6919
6919
|
}
|
|
6920
6920
|
function Je(t, e, n = null) {
|
|
6921
6921
|
function a(s, o) {
|
|
6922
|
-
for (let
|
|
6923
|
-
const
|
|
6924
|
-
|
|
6922
|
+
for (let l = 0; l < s.length; l++) {
|
|
6923
|
+
const i = r(s[l], o, l, s);
|
|
6924
|
+
l = Math.max(-1, l + i);
|
|
6925
6925
|
}
|
|
6926
6926
|
}
|
|
6927
|
-
function r(s, o = null,
|
|
6927
|
+
function r(s, o = null, l = null, i = null) {
|
|
6928
6928
|
var b, w;
|
|
6929
6929
|
let c = 0, u = !1;
|
|
6930
|
-
const p = { node: s, parent: o, key:
|
|
6931
|
-
mt(
|
|
6930
|
+
const p = { node: s, parent: o, key: l, container: i, root: t, remove() {
|
|
6931
|
+
mt(i).splice(Math.max(0, je(l) + c), 1), c--, u = !0;
|
|
6932
6932
|
}, removeAllNextSiblings() {
|
|
6933
|
-
return mt(
|
|
6933
|
+
return mt(i).splice(je(l) + 1);
|
|
6934
6934
|
}, removeAllPrevSiblings() {
|
|
6935
|
-
const k = je(
|
|
6936
|
-
return c -= k, mt(
|
|
6935
|
+
const k = je(l) + c;
|
|
6936
|
+
return c -= k, mt(i).splice(0, Math.max(0, k));
|
|
6937
6937
|
}, replaceWith(k, v = {}) {
|
|
6938
6938
|
const A = !!v.traverse;
|
|
6939
|
-
|
|
6939
|
+
i ? i[Math.max(0, je(l) + c)] = k : Ve(o, "Can't replace root node")[l] = k, A && r(k, o, l, i), u = !0;
|
|
6940
6940
|
}, replaceWithMultiple(k, v = {}) {
|
|
6941
6941
|
const A = !!v.traverse;
|
|
6942
|
-
if (mt(
|
|
6942
|
+
if (mt(i).splice(Math.max(0, je(l) + c), 1, ...k), c += k.length - 1, A) {
|
|
6943
6943
|
let O = 0;
|
|
6944
|
-
for (let I = 0; I < k.length; I++) O += r(k[I], o, je(
|
|
6944
|
+
for (let I = 0; I < k.length; I++) O += r(k[I], o, je(l) + I + O, i);
|
|
6945
6945
|
}
|
|
6946
6946
|
u = !0;
|
|
6947
6947
|
}, skip() {
|
|
@@ -7007,19 +7007,19 @@ const re = Object.freeze({
|
|
|
7007
7007
|
});
|
|
7008
7008
|
function Rn(t, e, n, a) {
|
|
7009
7009
|
const r = new RegExp(String.raw`${e}|(?<$skip>\[\^?|\\?.)`, "gsu"), s = [!1];
|
|
7010
|
-
let o = 0,
|
|
7011
|
-
for (const
|
|
7012
|
-
const { 0: c, groups: { $skip: u } } =
|
|
7010
|
+
let o = 0, l = "";
|
|
7011
|
+
for (const i of t.matchAll(r)) {
|
|
7012
|
+
const { 0: c, groups: { $skip: u } } = i;
|
|
7013
7013
|
if (!u && (!a || a === re.DEFAULT == !o)) {
|
|
7014
|
-
n instanceof Function ?
|
|
7014
|
+
n instanceof Function ? l += n(i, {
|
|
7015
7015
|
context: o ? re.CHAR_CLASS : re.DEFAULT,
|
|
7016
7016
|
negated: s[s.length - 1]
|
|
7017
|
-
}) :
|
|
7017
|
+
}) : l += n;
|
|
7018
7018
|
continue;
|
|
7019
7019
|
}
|
|
7020
|
-
c[0] === "[" ? (o++, s.push(c[1] === "^")) : c === "]" && o && (o--, s.pop()),
|
|
7020
|
+
c[0] === "[" ? (o++, s.push(c[1] === "^")) : c === "]" && o && (o--, s.pop()), l += c;
|
|
7021
7021
|
}
|
|
7022
|
-
return
|
|
7022
|
+
return l;
|
|
7023
7023
|
}
|
|
7024
7024
|
function br(t, e, n, a) {
|
|
7025
7025
|
Rn(t, e, n, a);
|
|
@@ -7031,10 +7031,10 @@ function nc(t, e, n = 0, a) {
|
|
|
7031
7031
|
r.lastIndex = n;
|
|
7032
7032
|
let s = 0, o;
|
|
7033
7033
|
for (; o = r.exec(t); ) {
|
|
7034
|
-
const { 0:
|
|
7035
|
-
if (!
|
|
7034
|
+
const { 0: l, groups: { $skip: i } } = o;
|
|
7035
|
+
if (!i && (!a || a === re.DEFAULT == !s))
|
|
7036
7036
|
return o;
|
|
7037
|
-
|
|
7037
|
+
l === "[" ? s++ : l === "]" && s && s--, r.lastIndex == o.index && r.lastIndex++;
|
|
7038
7038
|
}
|
|
7039
7039
|
return null;
|
|
7040
7040
|
}
|
|
@@ -7046,14 +7046,14 @@ function ac(t, e) {
|
|
|
7046
7046
|
n.lastIndex = e;
|
|
7047
7047
|
let a = t.length, r = 0, s = 1, o;
|
|
7048
7048
|
for (; o = n.exec(t); ) {
|
|
7049
|
-
const [
|
|
7050
|
-
if (
|
|
7049
|
+
const [l] = o;
|
|
7050
|
+
if (l === "[")
|
|
7051
7051
|
r++;
|
|
7052
7052
|
else if (r)
|
|
7053
|
-
|
|
7054
|
-
else if (
|
|
7053
|
+
l === "]" && r--;
|
|
7054
|
+
else if (l === "(")
|
|
7055
7055
|
s++;
|
|
7056
|
-
else if (
|
|
7056
|
+
else if (l === ")" && (s--, !s)) {
|
|
7057
7057
|
a = o.index;
|
|
7058
7058
|
break;
|
|
7059
7059
|
}
|
|
@@ -7070,8 +7070,8 @@ function rc(t, e) {
|
|
|
7070
7070
|
captureTransfers: a,
|
|
7071
7071
|
hiddenCaptures: n
|
|
7072
7072
|
};
|
|
7073
|
-
const r = "(?>", s = "(?:(?=(", o = [0],
|
|
7074
|
-
let
|
|
7073
|
+
const r = "(?>", s = "(?:(?=(", o = [0], l = [];
|
|
7074
|
+
let i = 0, c = 0, u = NaN, p;
|
|
7075
7075
|
do {
|
|
7076
7076
|
p = !1;
|
|
7077
7077
|
let d = 0, f = 0, m = !1, _;
|
|
@@ -7086,12 +7086,12 @@ function rc(t, e) {
|
|
|
7086
7086
|
else if (m && k)
|
|
7087
7087
|
f++;
|
|
7088
7088
|
else if (w)
|
|
7089
|
-
m ? f++ : (
|
|
7089
|
+
m ? f++ : (i++, o.push(i + c));
|
|
7090
7090
|
else if (g === ")" && m) {
|
|
7091
7091
|
if (!f) {
|
|
7092
7092
|
c++;
|
|
7093
|
-
const v =
|
|
7094
|
-
if (t = `${t.slice(0, u)}${s}${t.slice(u + r.length, b)}))<$$${v}>)${t.slice(b + 1)}`, p = !0,
|
|
7093
|
+
const v = i + c;
|
|
7094
|
+
if (t = `${t.slice(0, u)}${s}${t.slice(u + r.length, b)}))<$$${v}>)${t.slice(b + 1)}`, p = !0, l.push(v), ec(n, v), a.size) {
|
|
7095
7095
|
const A = /* @__PURE__ */ new Map();
|
|
7096
7096
|
a.forEach((O, I) => {
|
|
7097
7097
|
A.set(
|
|
@@ -7106,7 +7106,7 @@ function rc(t, e) {
|
|
|
7106
7106
|
}
|
|
7107
7107
|
}
|
|
7108
7108
|
} while (p);
|
|
7109
|
-
return n.push(...
|
|
7109
|
+
return n.push(...l), t = Rn(
|
|
7110
7110
|
t,
|
|
7111
7111
|
String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,
|
|
7112
7112
|
({ 0: d, groups: { backrefNum: f, wrappedBackrefNum: m } }) => {
|
|
@@ -7149,31 +7149,31 @@ function sc(t) {
|
|
|
7149
7149
|
const e = [];
|
|
7150
7150
|
let n = null, a = null, r = "", s = 0, o;
|
|
7151
7151
|
for (Zt.lastIndex = 0; o = Zt.exec(t); ) {
|
|
7152
|
-
const { 0:
|
|
7153
|
-
if (
|
|
7154
|
-
s || (a =
|
|
7155
|
-
else if (
|
|
7152
|
+
const { 0: l, index: i, groups: { qBase: c, qMod: u, invalidQ: p } } = o;
|
|
7153
|
+
if (l === "[")
|
|
7154
|
+
s || (a = i), s++;
|
|
7155
|
+
else if (l === "]")
|
|
7156
7156
|
s ? s-- : a = null;
|
|
7157
7157
|
else if (!s)
|
|
7158
7158
|
if (u === "+" && r && !r.startsWith("(")) {
|
|
7159
7159
|
if (p)
|
|
7160
|
-
throw new Error(`Invalid quantifier "${
|
|
7160
|
+
throw new Error(`Invalid quantifier "${l}"`);
|
|
7161
7161
|
let d = -1;
|
|
7162
7162
|
if (/^\{\d+\}$/.test(c))
|
|
7163
|
-
t = tc(t,
|
|
7163
|
+
t = tc(t, i + c.length, u, "");
|
|
7164
7164
|
else {
|
|
7165
7165
|
if (r === ")" || r === "]") {
|
|
7166
7166
|
const f = r === ")" ? n : a;
|
|
7167
7167
|
if (f === null)
|
|
7168
7168
|
throw new Error(`Invalid unmatched "${r}"`);
|
|
7169
|
-
t = `${t.slice(0, f)}(?>${t.slice(f,
|
|
7169
|
+
t = `${t.slice(0, f)}(?>${t.slice(f, i)}${c})${t.slice(i + l.length)}`;
|
|
7170
7170
|
} else
|
|
7171
|
-
t = `${t.slice(0,
|
|
7171
|
+
t = `${t.slice(0, i - r.length)}(?>${r}${c})${t.slice(i + l.length)}`;
|
|
7172
7172
|
d += 4;
|
|
7173
7173
|
}
|
|
7174
7174
|
Zt.lastIndex += d;
|
|
7175
|
-
} else
|
|
7176
|
-
r =
|
|
7175
|
+
} else l[0] === "(" ? e.push(i) : l === ")" && (n = e.length ? e.pop() : null);
|
|
7176
|
+
r = l;
|
|
7177
7177
|
}
|
|
7178
7178
|
return {
|
|
7179
7179
|
pattern: t
|
|
@@ -7195,7 +7195,7 @@ function ic(t, e) {
|
|
|
7195
7195
|
};
|
|
7196
7196
|
if (a === "plugin" && ft(t, ae`\(\?\(DEFINE\)`, re.DEFAULT))
|
|
7197
7197
|
throw new Error("DEFINE groups cannot be used with recursion");
|
|
7198
|
-
const s = [], o = ft(t, ae`\\[1-9]`, re.DEFAULT),
|
|
7198
|
+
const s = [], o = ft(t, ae`\\[1-9]`, re.DEFAULT), l = /* @__PURE__ */ new Map(), i = [];
|
|
7199
7199
|
let c = !1, u = 0, p = 0, d;
|
|
7200
7200
|
for (xe.lastIndex = 0; d = xe.exec(t); ) {
|
|
7201
7201
|
const { 0: f, groups: { captureName: m, rDepth: _, gRNameOrNum: g, gRDepth: b } } = d;
|
|
@@ -7236,7 +7236,7 @@ function ic(t, e) {
|
|
|
7236
7236
|
} else if (g) {
|
|
7237
7237
|
ma(b);
|
|
7238
7238
|
let w = !1;
|
|
7239
|
-
for (const T of
|
|
7239
|
+
for (const T of i)
|
|
7240
7240
|
if (T.name === g || T.num === +g) {
|
|
7241
7241
|
if (w = !0, T.hasRecursedWithin)
|
|
7242
7242
|
throw new Error(Kt);
|
|
@@ -7244,7 +7244,7 @@ function ic(t, e) {
|
|
|
7244
7244
|
}
|
|
7245
7245
|
if (!w)
|
|
7246
7246
|
throw new Error(ae`Recursive \g cannot be used outside the referenced group "${a === "external" ? g : ae`\g<${g}&R=${b}>`}"`);
|
|
7247
|
-
const k =
|
|
7247
|
+
const k = l.get(g), v = ac(t, k);
|
|
7248
7248
|
if (o && ft(v, ae`${Lt}|\((?!\?)`, re.DEFAULT))
|
|
7249
7249
|
throw new Error(
|
|
7250
7250
|
// When used in `external` mode by transpilers other than Regex+, backrefs might have
|
|
@@ -7269,16 +7269,16 @@ function ic(t, e) {
|
|
|
7269
7269
|
p
|
|
7270
7270
|
);
|
|
7271
7271
|
const x = t.slice(0, k), $ = t.slice(k + v.length);
|
|
7272
|
-
t = `${x}${ce}${$}`, xe.lastIndex += ce.length - f.length - A.length - O.length,
|
|
7272
|
+
t = `${x}${ce}${$}`, xe.lastIndex += ce.length - f.length - A.length - O.length, i.forEach((T) => T.hasRecursedWithin = !0), c = !0;
|
|
7273
7273
|
} else if (m)
|
|
7274
|
-
p++,
|
|
7274
|
+
p++, l.set(String(p), xe.lastIndex), l.set(m, xe.lastIndex), i.push({
|
|
7275
7275
|
num: p,
|
|
7276
7276
|
name: m
|
|
7277
7277
|
});
|
|
7278
7278
|
else if (f[0] === "(") {
|
|
7279
7279
|
const w = f === "(";
|
|
7280
|
-
w && (p++,
|
|
7281
|
-
} else f === ")" &&
|
|
7280
|
+
w && (p++, l.set(String(p), xe.lastIndex)), i.push(w ? { num: p } : {});
|
|
7281
|
+
} else f === ")" && i.pop();
|
|
7282
7282
|
}
|
|
7283
7283
|
return n.push(...s), {
|
|
7284
7284
|
pattern: t,
|
|
@@ -7294,24 +7294,24 @@ function ma(t) {
|
|
|
7294
7294
|
throw new Error(e);
|
|
7295
7295
|
}
|
|
7296
7296
|
function fa(t, e, n, a, r, s, o) {
|
|
7297
|
-
const
|
|
7297
|
+
const l = /* @__PURE__ */ new Set();
|
|
7298
7298
|
a && br(t + e, Lt, ({ groups: { captureName: c } }) => {
|
|
7299
|
-
|
|
7299
|
+
l.add(c);
|
|
7300
7300
|
}, re.DEFAULT);
|
|
7301
|
-
const
|
|
7301
|
+
const i = [
|
|
7302
7302
|
n,
|
|
7303
|
-
a ?
|
|
7303
|
+
a ? l : null,
|
|
7304
7304
|
r,
|
|
7305
7305
|
s,
|
|
7306
7306
|
o
|
|
7307
7307
|
];
|
|
7308
|
-
return `${t}${ha(`(?:${t}`, "forward", ...
|
|
7308
|
+
return `${t}${ha(`(?:${t}`, "forward", ...i)}(?:)${ha(`${e})`, "backward", ...i)}${e}`;
|
|
7309
7309
|
}
|
|
7310
7310
|
function ha(t, e, n, a, r, s, o) {
|
|
7311
|
-
const
|
|
7311
|
+
const i = (u) => e === "forward" ? u + 2 : n - u + 2 - 1;
|
|
7312
7312
|
let c = "";
|
|
7313
7313
|
for (let u = 0; u < n; u++) {
|
|
7314
|
-
const p =
|
|
7314
|
+
const p = i(u);
|
|
7315
7315
|
c += Rn(
|
|
7316
7316
|
t,
|
|
7317
7317
|
ae`${_r}|\\k<(?<backref>[^>]+)>`,
|
|
@@ -7338,22 +7338,22 @@ function ga(t, e, n, a, r, s) {
|
|
|
7338
7338
|
if (t.size && a) {
|
|
7339
7339
|
let o = 0;
|
|
7340
7340
|
br(e, _r, () => o++, re.DEFAULT);
|
|
7341
|
-
const
|
|
7341
|
+
const l = s - o + r, i = /* @__PURE__ */ new Map();
|
|
7342
7342
|
return t.forEach((c, u) => {
|
|
7343
|
-
const p = (a - o * n) / n, d = o * n, f = u >
|
|
7343
|
+
const p = (a - o * n) / n, d = o * n, f = u > l + o ? u + a : u, m = [];
|
|
7344
7344
|
for (const _ of c)
|
|
7345
|
-
if (_ <=
|
|
7345
|
+
if (_ <= l)
|
|
7346
7346
|
m.push(_);
|
|
7347
|
-
else if (_ >
|
|
7347
|
+
else if (_ > l + o + p)
|
|
7348
7348
|
m.push(_ + a);
|
|
7349
|
-
else if (_ <=
|
|
7349
|
+
else if (_ <= l + o)
|
|
7350
7350
|
for (let g = 0; g <= n; g++)
|
|
7351
7351
|
m.push(_ + o * g);
|
|
7352
7352
|
else
|
|
7353
7353
|
for (let g = 0; g <= n; g++)
|
|
7354
7354
|
m.push(_ + d + p * g);
|
|
7355
|
-
|
|
7356
|
-
}),
|
|
7355
|
+
i.set(f, m);
|
|
7356
|
+
}), i;
|
|
7357
7357
|
}
|
|
7358
7358
|
return t;
|
|
7359
7359
|
}
|
|
@@ -7727,19 +7727,19 @@ var _c = {
|
|
|
7727
7727
|
}
|
|
7728
7728
|
}
|
|
7729
7729
|
},
|
|
7730
|
-
Assertion({ node: t, parent: e, key: n, container: a, root: r, remove: s, replaceWith: o },
|
|
7731
|
-
const { kind:
|
|
7732
|
-
if (
|
|
7730
|
+
Assertion({ node: t, parent: e, key: n, container: a, root: r, remove: s, replaceWith: o }, l) {
|
|
7731
|
+
const { kind: i, negate: c } = t, { asciiWordBoundaries: u, avoidSubclass: p, supportedGNodes: d, wordIsAscii: f } = l;
|
|
7732
|
+
if (i === "text_segment_boundary")
|
|
7733
7733
|
throw new Error(`Unsupported text segment boundary "\\${c ? "Y" : "y"}"`);
|
|
7734
|
-
if (
|
|
7734
|
+
if (i === "line_end")
|
|
7735
7735
|
o(G(Se({ body: [
|
|
7736
|
-
|
|
7737
|
-
|
|
7736
|
+
Pe({ body: [mn("string_end")] }),
|
|
7737
|
+
Pe({ body: [Pt(10)] })
|
|
7738
7738
|
// `\n`
|
|
7739
7739
|
] }), e));
|
|
7740
|
-
else if (
|
|
7740
|
+
else if (i === "line_start")
|
|
7741
7741
|
o(G(de(C`(?<=\A|\n(?!\z))`, { skipLookbehindValidation: !0 }), e));
|
|
7742
|
-
else if (
|
|
7742
|
+
else if (i === "search_start")
|
|
7743
7743
|
if (d.has(t))
|
|
7744
7744
|
r.flags.sticky = !0, s();
|
|
7745
7745
|
else {
|
|
@@ -7749,18 +7749,18 @@ var _c = {
|
|
|
7749
7749
|
else {
|
|
7750
7750
|
if (p)
|
|
7751
7751
|
throw new Error(C`Uses "\G" in a way that requires a subclass`);
|
|
7752
|
-
o($e(mn("string_start"), e)),
|
|
7752
|
+
o($e(mn("string_start"), e)), l.strategy = "clip_search";
|
|
7753
7753
|
}
|
|
7754
7754
|
}
|
|
7755
|
-
else if (!(
|
|
7755
|
+
else if (!(i === "string_end" || i === "string_start")) if (i === "string_end_newline")
|
|
7756
7756
|
o(G(de(C`(?=\n?\z)`), e));
|
|
7757
|
-
else if (
|
|
7757
|
+
else if (i === "word_boundary") {
|
|
7758
7758
|
if (!f && !u) {
|
|
7759
7759
|
const m = `(?:(?<=${pe})(?!${pe})|(?<!${pe})(?=${pe}))`, _ = `(?:(?<=${pe})(?=${pe})|(?<!${pe})(?!${pe}))`;
|
|
7760
7760
|
o(G(de(c ? _ : m), e));
|
|
7761
7761
|
}
|
|
7762
7762
|
} else
|
|
7763
|
-
throw new Error(`Unexpected assertion kind "${
|
|
7763
|
+
throw new Error(`Unexpected assertion kind "${i}"`);
|
|
7764
7764
|
},
|
|
7765
7765
|
Backreference({ node: t }, { jsGroupNameMap: e }) {
|
|
7766
7766
|
let { ref: n } = t;
|
|
@@ -7776,25 +7776,25 @@ var _c = {
|
|
|
7776
7776
|
n(G(a, e), { traverse: !0 });
|
|
7777
7777
|
}
|
|
7778
7778
|
},
|
|
7779
|
-
CharacterSet({ node: t, parent: e, replaceWith: n }, { accuracy: a, minTargetEs2024: r, digitIsAscii: s, spaceIsAscii: o, wordIsAscii:
|
|
7780
|
-
const { kind:
|
|
7781
|
-
if (s && (
|
|
7779
|
+
CharacterSet({ node: t, parent: e, replaceWith: n }, { accuracy: a, minTargetEs2024: r, digitIsAscii: s, spaceIsAscii: o, wordIsAscii: l }) {
|
|
7780
|
+
const { kind: i, negate: c, value: u } = t;
|
|
7781
|
+
if (s && (i === "digit" || u === "digit")) {
|
|
7782
7782
|
n($e(hn("digit", { negate: c }), e));
|
|
7783
7783
|
return;
|
|
7784
7784
|
}
|
|
7785
|
-
if (o && (
|
|
7785
|
+
if (o && (i === "space" || u === "space")) {
|
|
7786
7786
|
n(G(en(de(pc), c), e));
|
|
7787
7787
|
return;
|
|
7788
7788
|
}
|
|
7789
|
-
if (
|
|
7789
|
+
if (l && (i === "word" || u === "word")) {
|
|
7790
7790
|
n($e(hn("word", { negate: c }), e));
|
|
7791
7791
|
return;
|
|
7792
7792
|
}
|
|
7793
|
-
if (
|
|
7793
|
+
if (i === "any")
|
|
7794
7794
|
n($e(Ge("Any"), e));
|
|
7795
|
-
else if (
|
|
7795
|
+
else if (i === "digit")
|
|
7796
7796
|
n($e(Ge("Nd", { negate: c }), e));
|
|
7797
|
-
else if (
|
|
7797
|
+
else if (i !== "dot") if (i === "text_segment") {
|
|
7798
7798
|
if (a === "strict")
|
|
7799
7799
|
throw new Error(C`Use of "\X" requires non-strict accuracy`);
|
|
7800
7800
|
const p = "\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?", d = C`\p{RI}{2}|${p}(?:\u200D${p})*`;
|
|
@@ -7804,14 +7804,14 @@ var _c = {
|
|
|
7804
7804
|
// Allow JS property `RGI_Emoji` through
|
|
7805
7805
|
{ skipPropertyNameValidation: !0 }
|
|
7806
7806
|
), e));
|
|
7807
|
-
} else if (
|
|
7807
|
+
} else if (i === "hex")
|
|
7808
7808
|
n($e(Ge("AHex", { negate: c }), e));
|
|
7809
|
-
else if (
|
|
7809
|
+
else if (i === "newline")
|
|
7810
7810
|
n(G(de(c ? `[^
|
|
7811
7811
|
]` : `(?>\r
|
|
7812
7812
|
?|[
|
|
7813
7813
|
\v\f
\u2028\u2029])`), e));
|
|
7814
|
-
else if (
|
|
7814
|
+
else if (i === "posix")
|
|
7815
7815
|
if (!r && (u === "graph" || u === "print")) {
|
|
7816
7816
|
if (a === "strict")
|
|
7817
7817
|
throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);
|
|
@@ -7822,25 +7822,25 @@ var _c = {
|
|
|
7822
7822
|
c && (p = `\0-${U(p.codePointAt(0) - 1)}${U(p.codePointAt(2) + 1)}-`), n(G(de(`[${p}]`), e));
|
|
7823
7823
|
} else
|
|
7824
7824
|
n(G(en(de(gc.get(u)), c), e));
|
|
7825
|
-
else if (
|
|
7825
|
+
else if (i === "property")
|
|
7826
7826
|
Nn.has(Tt(u)) || (t.key = "sc");
|
|
7827
|
-
else if (
|
|
7827
|
+
else if (i === "space")
|
|
7828
7828
|
n($e(Ge("space", { negate: c }), e));
|
|
7829
|
-
else if (
|
|
7829
|
+
else if (i === "word")
|
|
7830
7830
|
n(G(en(de(pe), c), e));
|
|
7831
7831
|
else
|
|
7832
|
-
throw new Error(`Unexpected character set kind "${
|
|
7832
|
+
throw new Error(`Unexpected character set kind "${i}"`);
|
|
7833
7833
|
},
|
|
7834
7834
|
Directive({ node: t, parent: e, root: n, remove: a, replaceWith: r, removeAllPrevSiblings: s, removeAllNextSiblings: o }) {
|
|
7835
|
-
const { kind:
|
|
7836
|
-
if (
|
|
7837
|
-
if (!
|
|
7835
|
+
const { kind: l, flags: i } = t;
|
|
7836
|
+
if (l === "flags")
|
|
7837
|
+
if (!i.enable && !i.disable)
|
|
7838
7838
|
a();
|
|
7839
7839
|
else {
|
|
7840
|
-
const c = oe({ flags:
|
|
7840
|
+
const c = oe({ flags: i });
|
|
7841
7841
|
c.body[0].body = o(), r(G(c, e), { traverse: !0 });
|
|
7842
7842
|
}
|
|
7843
|
-
else if (
|
|
7843
|
+
else if (l === "keep") {
|
|
7844
7844
|
const c = n.body[0], p = n.body.length === 1 && // Not emulatable if within a `CapturingGroup`
|
|
7845
7845
|
pr(c, { type: "Group" }) && c.body[0].body.length === 1 ? c.body[0] : n;
|
|
7846
7846
|
if (e.parent !== p || p.body.length > 1)
|
|
@@ -7848,7 +7848,7 @@ var _c = {
|
|
|
7848
7848
|
const d = Se({ behind: !0 });
|
|
7849
7849
|
d.body[0].body = s(), r(G(d, e));
|
|
7850
7850
|
} else
|
|
7851
|
-
throw new Error(`Unexpected directive kind "${
|
|
7851
|
+
throw new Error(`Unexpected directive kind "${l}"`);
|
|
7852
7852
|
},
|
|
7853
7853
|
Flags({ node: t, parent: e }) {
|
|
7854
7854
|
if (t.posixIsAscii)
|
|
@@ -7958,16 +7958,16 @@ var _c = {
|
|
|
7958
7958
|
groupOriginByCopy: r,
|
|
7959
7959
|
groupsByName: s,
|
|
7960
7960
|
multiplexCapturesToLeftByRef: o,
|
|
7961
|
-
openRefs:
|
|
7962
|
-
reffedNodesByReferencer:
|
|
7961
|
+
openRefs: l,
|
|
7962
|
+
reffedNodesByReferencer: i
|
|
7963
7963
|
}) {
|
|
7964
7964
|
const c = r.get(t);
|
|
7965
|
-
if (c &&
|
|
7965
|
+
if (c && l.has(t.number)) {
|
|
7966
7966
|
const p = $e(ya(t.number), e);
|
|
7967
|
-
|
|
7967
|
+
i.set(p, l.get(t.number)), n(p);
|
|
7968
7968
|
return;
|
|
7969
7969
|
}
|
|
7970
|
-
|
|
7970
|
+
l.set(t.number, t), o.set(t.number, []), t.name && at(o, t.name, []);
|
|
7971
7971
|
const u = o.get(t.name ?? t.number);
|
|
7972
7972
|
for (let p = 0; p < u.length; p++) {
|
|
7973
7973
|
const d = u[p];
|
|
@@ -8017,21 +8017,21 @@ var _c = {
|
|
|
8017
8017
|
a.reffedNodesByReferencer.set(t, u);
|
|
8018
8018
|
return;
|
|
8019
8019
|
}
|
|
8020
|
-
const o = a.subroutineRefMap.get(s),
|
|
8020
|
+
const o = a.subroutineRefMap.get(s), l = s === 0, i = l ? ya(0) : (
|
|
8021
8021
|
// The reffed group might itself contain subroutines, which are expanded during sub-traversal
|
|
8022
8022
|
Cr(o, a.groupOriginByCopy, null)
|
|
8023
8023
|
);
|
|
8024
|
-
let c =
|
|
8025
|
-
if (!
|
|
8024
|
+
let c = i;
|
|
8025
|
+
if (!l) {
|
|
8026
8026
|
const u = xr(Cc(
|
|
8027
8027
|
o,
|
|
8028
8028
|
(d) => d.type === "Group" && !!d.flags
|
|
8029
8029
|
)), p = u ? It(a.globalFlags, u) : a.globalFlags;
|
|
8030
8030
|
kc(p, a.currentFlags) || (c = oe({
|
|
8031
8031
|
flags: xc(p)
|
|
8032
|
-
}), c.body[0].body.push(
|
|
8032
|
+
}), c.body[0].body.push(i));
|
|
8033
8033
|
}
|
|
8034
|
-
n(G(c, e), { traverse: !
|
|
8034
|
+
n(G(c, e), { traverse: !l });
|
|
8035
8035
|
}
|
|
8036
8036
|
}, wc = {
|
|
8037
8037
|
Backreference({ node: t, parent: e, replaceWith: n }, a) {
|
|
@@ -8045,8 +8045,8 @@ var _c = {
|
|
|
8045
8045
|
else if (s.length > 1) {
|
|
8046
8046
|
const o = oe({
|
|
8047
8047
|
atomic: !0,
|
|
8048
|
-
body: s.reverse().map((
|
|
8049
|
-
body: [fn(
|
|
8048
|
+
body: s.reverse().map((l) => Pe({
|
|
8049
|
+
body: [fn(l.number)]
|
|
8050
8050
|
}))
|
|
8051
8051
|
});
|
|
8052
8052
|
n(G(o, e));
|
|
@@ -8212,7 +8212,7 @@ function Ic(t, e) {
|
|
|
8212
8212
|
const n = $r(e), a = bn(n.target, "ES2024"), r = bn(n.target, "ES2025"), s = n.rules.recursionLimit;
|
|
8213
8213
|
if (!Number.isInteger(s) || s < 2 || s > 20)
|
|
8214
8214
|
throw new Error("Invalid recursionLimit; use 2-20");
|
|
8215
|
-
let o = null,
|
|
8215
|
+
let o = null, l = null;
|
|
8216
8216
|
if (!r) {
|
|
8217
8217
|
const f = [t.flags.ignoreCase];
|
|
8218
8218
|
Je(t, Rc, {
|
|
@@ -8224,22 +8224,22 @@ function Ic(t, e) {
|
|
|
8224
8224
|
f.push(m);
|
|
8225
8225
|
},
|
|
8226
8226
|
setHasCasedChar() {
|
|
8227
|
-
f.at(-1) ? o = !0 :
|
|
8227
|
+
f.at(-1) ? o = !0 : l = !0;
|
|
8228
8228
|
}
|
|
8229
8229
|
});
|
|
8230
8230
|
}
|
|
8231
|
-
const
|
|
8231
|
+
const i = {
|
|
8232
8232
|
dotAll: t.flags.dotAll,
|
|
8233
8233
|
// - Turn global flag i on if a case insensitive node was used and no case sensitive nodes were
|
|
8234
8234
|
// used (to avoid unnecessary node expansion).
|
|
8235
8235
|
// - Turn global flag i off if a case sensitive node was used (since case sensitivity can't be
|
|
8236
8236
|
// forced without the use of ES2025 flag groups)
|
|
8237
|
-
ignoreCase: !!((t.flags.ignoreCase || o) && !
|
|
8237
|
+
ignoreCase: !!((t.flags.ignoreCase || o) && !l)
|
|
8238
8238
|
};
|
|
8239
8239
|
let c = t;
|
|
8240
8240
|
const u = {
|
|
8241
8241
|
accuracy: n.accuracy,
|
|
8242
|
-
appliedGlobalFlags:
|
|
8242
|
+
appliedGlobalFlags: i,
|
|
8243
8243
|
captureMap: /* @__PURE__ */ new Map(),
|
|
8244
8244
|
currentFlags: {
|
|
8245
8245
|
dotAll: t.flags.dotAll,
|
|
@@ -8249,7 +8249,7 @@ function Ic(t, e) {
|
|
|
8249
8249
|
lastNode: c,
|
|
8250
8250
|
originMap: t._originMap,
|
|
8251
8251
|
recursionLimit: s,
|
|
8252
|
-
useAppliedIgnoreCase: !!(!r && o &&
|
|
8252
|
+
useAppliedIgnoreCase: !!(!r && o && l),
|
|
8253
8253
|
useFlagMods: r,
|
|
8254
8254
|
useFlagV: a,
|
|
8255
8255
|
verbose: n.verbose
|
|
@@ -8285,7 +8285,7 @@ var Rc = {
|
|
|
8285
8285
|
e.setHasCasedChar();
|
|
8286
8286
|
},
|
|
8287
8287
|
Character({ node: t }, e) {
|
|
8288
|
-
|
|
8288
|
+
Bn(U(t.value)) && e.setHasCasedChar();
|
|
8289
8289
|
},
|
|
8290
8290
|
CharacterClassRange({ node: t, skip: e }, n) {
|
|
8291
8291
|
e(), Ir(t, { firstOnly: !0 }).length && n.setHasCasedChar();
|
|
@@ -8326,8 +8326,8 @@ var Rc = {
|
|
|
8326
8326
|
@param {CapturingGroupNode} node
|
|
8327
8327
|
*/
|
|
8328
8328
|
CapturingGroup(t, e, n) {
|
|
8329
|
-
const { body: a, name: r, number: s } = t, o = { ignoreCase: e.currentFlags.ignoreCase },
|
|
8330
|
-
return
|
|
8329
|
+
const { body: a, name: r, number: s } = t, o = { ignoreCase: e.currentFlags.ignoreCase }, l = e.originMap.get(t);
|
|
8330
|
+
return l && (o.hidden = !0, s > l.number && (o.transferTo = l.number)), e.captureMap.set(s, o), `(${r ? `?<${r}>` : ""}${a.map(n).join("|")})`;
|
|
8331
8331
|
},
|
|
8332
8332
|
/**
|
|
8333
8333
|
@param {CharacterNode} node
|
|
@@ -8340,7 +8340,7 @@ var Rc = {
|
|
|
8340
8340
|
});
|
|
8341
8341
|
if (a !== n)
|
|
8342
8342
|
return a;
|
|
8343
|
-
if (e.useAppliedIgnoreCase && e.currentFlags.ignoreCase &&
|
|
8343
|
+
if (e.useAppliedIgnoreCase && e.currentFlags.ignoreCase && Bn(n)) {
|
|
8344
8344
|
const r = wr(n);
|
|
8345
8345
|
return e.inCharClass ? r.join("") : r.length > 1 ? `[${r.join("")}]` : r[0];
|
|
8346
8346
|
}
|
|
@@ -8354,8 +8354,8 @@ var Rc = {
|
|
|
8354
8354
|
let { body: o } = t;
|
|
8355
8355
|
if (a === "intersection" && !e.useFlagV)
|
|
8356
8356
|
throw new Error("Use of class intersection requires min target ES2024");
|
|
8357
|
-
be.bugFlagVLiteralHyphenIsRange && e.useFlagV && o.some(wa) && (o = [
|
|
8358
|
-
const
|
|
8357
|
+
be.bugFlagVLiteralHyphenIsRange && e.useFlagV && o.some(wa) && (o = [Pt(45), ...o.filter((c) => !wa(c))]);
|
|
8358
|
+
const l = () => `[${r ? "^" : ""}${o.map(n).join(a === "intersection" ? "&&" : "")}]`;
|
|
8359
8359
|
if (!e.inCharClass) {
|
|
8360
8360
|
if (
|
|
8361
8361
|
// Already established `kind !== 'intersection'` if `!state.useFlagV`; don't check again
|
|
@@ -8367,26 +8367,26 @@ var Rc = {
|
|
|
8367
8367
|
if (u.length) {
|
|
8368
8368
|
const p = oe(), d = p.body[0];
|
|
8369
8369
|
return p.parent = s, d.parent = p, o = o.filter((f) => !u.includes(f)), t.body = o, o.length ? (t.parent = d, d.body.push(t)) : p.body.pop(), u.forEach((f) => {
|
|
8370
|
-
const m =
|
|
8370
|
+
const m = Pe({ body: [f] });
|
|
8371
8371
|
f.parent = m, m.parent = p, p.body.push(m);
|
|
8372
8372
|
}), n(p);
|
|
8373
8373
|
}
|
|
8374
8374
|
}
|
|
8375
8375
|
e.inCharClass = !0;
|
|
8376
|
-
const c =
|
|
8376
|
+
const c = l();
|
|
8377
8377
|
return e.inCharClass = !1, c;
|
|
8378
8378
|
}
|
|
8379
|
-
const
|
|
8379
|
+
const i = o[0];
|
|
8380
8380
|
if (
|
|
8381
8381
|
// Already established that the parent is a char class via `inCharClass`; don't check again
|
|
8382
|
-
a === "union" && !r &&
|
|
8382
|
+
a === "union" && !r && i && // Allows many nested classes to work with `target` ES2018 which doesn't support nesting
|
|
8383
8383
|
((!e.useFlagV || !e.verbose) && s.kind === "union" && !(be.bugFlagVLiteralHyphenIsRange && e.useFlagV) || !e.verbose && s.kind === "intersection" && // JS doesn't allow intersection with union or ranges
|
|
8384
|
-
o.length === 1 &&
|
|
8384
|
+
o.length === 1 && i.type !== "CharacterClassRange")
|
|
8385
8385
|
)
|
|
8386
8386
|
return o.map(n).join("");
|
|
8387
8387
|
if (!e.useFlagV && s.type === "CharacterClass")
|
|
8388
8388
|
throw new Error("Use of nested character class requires min target ES2024");
|
|
8389
|
-
return
|
|
8389
|
+
return l();
|
|
8390
8390
|
},
|
|
8391
8391
|
/**
|
|
8392
8392
|
@param {CharacterClassRangeNode} node
|
|
@@ -8396,16 +8396,16 @@ var Rc = {
|
|
|
8396
8396
|
escDigit: !1,
|
|
8397
8397
|
inCharClass: !0,
|
|
8398
8398
|
useFlagV: e.useFlagV
|
|
8399
|
-
}, s = Me(n, r), o = Me(a, r),
|
|
8399
|
+
}, s = Me(n, r), o = Me(a, r), l = /* @__PURE__ */ new Set();
|
|
8400
8400
|
if (e.useAppliedIgnoreCase && e.currentFlags.ignoreCase) {
|
|
8401
|
-
const
|
|
8402
|
-
jc(
|
|
8403
|
-
|
|
8401
|
+
const i = Ir(t);
|
|
8402
|
+
jc(i).forEach((u) => {
|
|
8403
|
+
l.add(
|
|
8404
8404
|
Array.isArray(u) ? `${Me(u[0], r)}-${Me(u[1], r)}` : Me(u, r)
|
|
8405
8405
|
);
|
|
8406
8406
|
});
|
|
8407
8407
|
}
|
|
8408
|
-
return `${s}-${o}${[...
|
|
8408
|
+
return `${s}-${o}${[...l].join("")}`;
|
|
8409
8409
|
},
|
|
8410
8410
|
/**
|
|
8411
8411
|
@param {CharacterSetNode} node
|
|
@@ -8446,9 +8446,9 @@ var Rc = {
|
|
|
8446
8446
|
Group({ atomic: t, body: e, flags: n, parent: a }, r, s) {
|
|
8447
8447
|
const o = r.currentFlags;
|
|
8448
8448
|
n && (r.currentFlags = It(o, n));
|
|
8449
|
-
const
|
|
8450
|
-
a.type !== "Quantifier" && !t && (!r.useFlagMods || !n) ?
|
|
8451
|
-
return r.currentFlags = o,
|
|
8449
|
+
const l = e.map(s).join("|"), i = !r.verbose && e.length === 1 && // Single alt
|
|
8450
|
+
a.type !== "Quantifier" && !t && (!r.useFlagMods || !n) ? l : `(?${Mc(t, n, r.useFlagMods)}${l})`;
|
|
8451
|
+
return r.currentFlags = o, i;
|
|
8452
8452
|
},
|
|
8453
8453
|
/**
|
|
8454
8454
|
@param {LookaroundAssertionNode} node
|
|
@@ -8471,7 +8471,7 @@ var Rc = {
|
|
|
8471
8471
|
const a = n.recursionLimit;
|
|
8472
8472
|
return e === 0 ? `(?R=${a})` : C`\g<${e}&R=${a}>`;
|
|
8473
8473
|
}
|
|
8474
|
-
},
|
|
8474
|
+
}, Bc = /* @__PURE__ */ new Set([
|
|
8475
8475
|
"$",
|
|
8476
8476
|
"(",
|
|
8477
8477
|
")",
|
|
@@ -8486,7 +8486,7 @@ var Rc = {
|
|
|
8486
8486
|
"{",
|
|
8487
8487
|
"|",
|
|
8488
8488
|
"}"
|
|
8489
|
-
]),
|
|
8489
|
+
]), Pc = /* @__PURE__ */ new Set([
|
|
8490
8490
|
"-",
|
|
8491
8491
|
"\\",
|
|
8492
8492
|
"]",
|
|
@@ -8543,7 +8543,7 @@ var Rc = {
|
|
|
8543
8543
|
[65279, C`\uFEFF`]
|
|
8544
8544
|
// ZWNBSP/BOM
|
|
8545
8545
|
]), Lc = new RegExp("^\\p{Cased}$", "u");
|
|
8546
|
-
function
|
|
8546
|
+
function Bn(t) {
|
|
8547
8547
|
return Lc.test(t);
|
|
8548
8548
|
}
|
|
8549
8549
|
function Ir(t, e) {
|
|
@@ -8551,14 +8551,14 @@ function Ir(t, e) {
|
|
|
8551
8551
|
if (a < 65 && (r === 65535 || r >= 131071) || a === 65536 && r >= 131071)
|
|
8552
8552
|
return s;
|
|
8553
8553
|
for (let o = a; o <= r; o++) {
|
|
8554
|
-
const
|
|
8555
|
-
if (!
|
|
8554
|
+
const l = U(o);
|
|
8555
|
+
if (!Bn(l))
|
|
8556
8556
|
continue;
|
|
8557
|
-
const
|
|
8557
|
+
const i = wr(l).filter((c) => {
|
|
8558
8558
|
const u = c.codePointAt(0);
|
|
8559
8559
|
return u < a || u > r;
|
|
8560
8560
|
});
|
|
8561
|
-
if (
|
|
8561
|
+
if (i.length && (s.push(...i), n))
|
|
8562
8562
|
break;
|
|
8563
8563
|
}
|
|
8564
8564
|
return s;
|
|
@@ -8573,7 +8573,7 @@ function Me(t, { escDigit: e, inCharClass: n, useFlagV: a }) {
|
|
|
8573
8573
|
e && Gc(t)
|
|
8574
8574
|
)
|
|
8575
8575
|
return t > 255 ? `\\u{${t.toString(16).toUpperCase()}}` : `\\x${t.toString(16).toUpperCase().padStart(2, "0")}`;
|
|
8576
|
-
const r = n ? a ? Tc :
|
|
8576
|
+
const r = n ? a ? Tc : Pc : Bc, s = U(t);
|
|
8577
8577
|
return (r.has(s) ? "\\" : "") + s;
|
|
8578
8578
|
}
|
|
8579
8579
|
function jc(t) {
|
|
@@ -8610,7 +8610,7 @@ function Gc(t) {
|
|
|
8610
8610
|
function wa({ type: t, value: e }) {
|
|
8611
8611
|
return t === "Character" && e === 45;
|
|
8612
8612
|
}
|
|
8613
|
-
var we, fe, Ne, ke,
|
|
8613
|
+
var we, fe, Ne, ke, Be, rt, yn, ve, Fc = (ve = class extends RegExp {
|
|
8614
8614
|
/**
|
|
8615
8615
|
@overload
|
|
8616
8616
|
@param {string} pattern
|
|
@@ -8641,7 +8641,7 @@ var we, fe, Ne, ke, Pe, rt, yn, ve, Fc = (ve = class extends RegExp {
|
|
|
8641
8641
|
Ce(this, ke, null), /**
|
|
8642
8642
|
@type {string?}
|
|
8643
8643
|
*/
|
|
8644
|
-
Ce(this,
|
|
8644
|
+
Ce(this, Be, null), /**
|
|
8645
8645
|
Can be used to serialize the instance.
|
|
8646
8646
|
@type {EmulatedRegExpOptions}
|
|
8647
8647
|
*/
|
|
@@ -8651,7 +8651,7 @@ var we, fe, Ne, ke, Pe, rt, yn, ve, Fc = (ve = class extends RegExp {
|
|
|
8651
8651
|
if (r)
|
|
8652
8652
|
throw new Error("Cannot provide options when copying a regexp");
|
|
8653
8653
|
const o = n;
|
|
8654
|
-
e(o, a), se(this, Ne, o.source), o instanceof ve && (se(this, we, K(o, we)), se(this, ke, K(o, ke)), se(this,
|
|
8654
|
+
e(o, a), se(this, Ne, o.source), o instanceof ve && (se(this, we, K(o, we)), se(this, ke, K(o, ke)), se(this, Be, K(o, Be)), this.rawOptions = o.rawOptions);
|
|
8655
8655
|
} else {
|
|
8656
8656
|
const o = {
|
|
8657
8657
|
hiddenCaptures: [],
|
|
@@ -8659,7 +8659,7 @@ var we, fe, Ne, ke, Pe, rt, yn, ve, Fc = (ve = class extends RegExp {
|
|
|
8659
8659
|
transfers: [],
|
|
8660
8660
|
...r
|
|
8661
8661
|
};
|
|
8662
|
-
e(s ? "" : n, a), se(this, Ne, n), se(this, we, Uc(o.hiddenCaptures, o.transfers)), se(this,
|
|
8662
|
+
e(s ? "" : n, a), se(this, Ne, n), se(this, we, Uc(o.hiddenCaptures, o.transfers)), se(this, Be, o.strategy), this.rawOptions = r ?? {};
|
|
8663
8663
|
}
|
|
8664
8664
|
s || se(this, fe, this);
|
|
8665
8665
|
}
|
|
@@ -8679,14 +8679,14 @@ var we, fe, Ne, ke, Pe, rt, yn, ve, Fc = (ve = class extends RegExp {
|
|
|
8679
8679
|
se(this, fe, new ve(K(this, Ne), this.flags, o));
|
|
8680
8680
|
}
|
|
8681
8681
|
const a = this.global || this.sticky, r = this.lastIndex;
|
|
8682
|
-
if (K(this,
|
|
8682
|
+
if (K(this, Be) === "clip_search" && a && r) {
|
|
8683
8683
|
this.lastIndex = 0;
|
|
8684
8684
|
const s = Ot(this, rt, yn).call(this, n.slice(r));
|
|
8685
8685
|
return s && (Dc(s, r, n, this.hasIndices), this.lastIndex += r), s;
|
|
8686
8686
|
}
|
|
8687
8687
|
return Ot(this, rt, yn).call(this, n);
|
|
8688
8688
|
}
|
|
8689
|
-
}, we = new WeakMap(), fe = new WeakMap(), Ne = new WeakMap(), ke = new WeakMap(),
|
|
8689
|
+
}, we = new WeakMap(), fe = new WeakMap(), Ne = new WeakMap(), ke = new WeakMap(), Be = new WeakMap(), rt = new WeakSet(), /**
|
|
8690
8690
|
Adds support for hidden and transfer captures.
|
|
8691
8691
|
@param {string} str
|
|
8692
8692
|
@returns
|
|
@@ -8701,16 +8701,16 @@ yn = function(n) {
|
|
|
8701
8701
|
let s;
|
|
8702
8702
|
this.hasIndices && (s = [...a.indices], a.indices.length = 1);
|
|
8703
8703
|
const o = [0];
|
|
8704
|
-
for (let
|
|
8705
|
-
const { hidden:
|
|
8706
|
-
if (
|
|
8704
|
+
for (let l = 1; l < r.length; l++) {
|
|
8705
|
+
const { hidden: i, transferTo: c } = K(this, we).get(l) ?? {};
|
|
8706
|
+
if (i ? o.push(null) : (o.push(a.length), a.push(r[l]), this.hasIndices && a.indices.push(s[l])), c && r[l] !== void 0) {
|
|
8707
8707
|
const u = o[c];
|
|
8708
8708
|
if (!u)
|
|
8709
8709
|
throw new Error(`Invalid capture transfer to "${u}"`);
|
|
8710
|
-
if (a[u] = r[
|
|
8710
|
+
if (a[u] = r[l], this.hasIndices && (a.indices[u] = s[l]), a.groups) {
|
|
8711
8711
|
K(this, ke) || se(this, ke, zc(this.source));
|
|
8712
8712
|
const p = K(this, ke).get(c);
|
|
8713
|
-
p && (a.groups[p] = r[
|
|
8713
|
+
p && (a.groups[p] = r[l], this.hasIndices && (a.indices.groups[p] = s[l]));
|
|
8714
8714
|
}
|
|
8715
8715
|
}
|
|
8716
8716
|
}
|
|
@@ -8720,13 +8720,13 @@ function Dc(t, e, n, a) {
|
|
|
8720
8720
|
if (t.index += e, t.input = n, a) {
|
|
8721
8721
|
const r = t.indices;
|
|
8722
8722
|
for (let o = 0; o < r.length; o++) {
|
|
8723
|
-
const
|
|
8724
|
-
|
|
8723
|
+
const l = r[o];
|
|
8724
|
+
l && (r[o] = [l[0] + e, l[1] + e]);
|
|
8725
8725
|
}
|
|
8726
8726
|
const s = r.groups;
|
|
8727
8727
|
s && Object.keys(s).forEach((o) => {
|
|
8728
|
-
const
|
|
8729
|
-
|
|
8728
|
+
const l = s[o];
|
|
8729
|
+
l && (s[o] = [l[0] + e, l[1] + e]);
|
|
8730
8730
|
});
|
|
8731
8731
|
}
|
|
8732
8732
|
}
|
|
@@ -8745,8 +8745,8 @@ function zc(t) {
|
|
|
8745
8745
|
const e = /(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu, n = /* @__PURE__ */ new Map();
|
|
8746
8746
|
let a = 0, r = 0, s;
|
|
8747
8747
|
for (; s = e.exec(t); ) {
|
|
8748
|
-
const { 0: o, groups: { capture:
|
|
8749
|
-
o === "[" ? a++ : a ? o === "]" && a-- :
|
|
8748
|
+
const { 0: o, groups: { capture: l, name: i } } = s;
|
|
8749
|
+
o === "[" ? a++ : a ? o === "]" && a-- : l && (r++, i && n.set(r, i));
|
|
8750
8750
|
}
|
|
8751
8751
|
return n;
|
|
8752
8752
|
}
|
|
@@ -8773,18 +8773,18 @@ function Hc(t, e) {
|
|
|
8773
8773
|
captureTransfers: s._captureTransfers,
|
|
8774
8774
|
hiddenCaptures: s._hiddenCaptures,
|
|
8775
8775
|
mode: "external"
|
|
8776
|
-
}),
|
|
8776
|
+
}), l = sc(o.pattern), i = rc(l.pattern, {
|
|
8777
8777
|
captureTransfers: o.captureTransfers,
|
|
8778
8778
|
hiddenCaptures: o.hiddenCaptures
|
|
8779
8779
|
}), c = {
|
|
8780
|
-
pattern:
|
|
8780
|
+
pattern: i.pattern,
|
|
8781
8781
|
flags: `${n.hasIndices ? "d" : ""}${n.global ? "g" : ""}${s.flags}${s.options.disable.v ? "u" : "v"}`
|
|
8782
8782
|
};
|
|
8783
8783
|
if (n.avoidSubclass) {
|
|
8784
8784
|
if (n.lazyCompileLength !== 1 / 0)
|
|
8785
8785
|
throw new Error("Lazy compilation requires subclass");
|
|
8786
8786
|
} else {
|
|
8787
|
-
const u =
|
|
8787
|
+
const u = i.hiddenCaptures.sort((m, _) => m - _), p = Array.from(i.captureTransfers), d = r._strategy, f = c.pattern.length >= n.lazyCompileLength;
|
|
8788
8788
|
(u.length || p.length || d || f) && (c.options = {
|
|
8789
8789
|
...u.length && { hiddenCaptures: u },
|
|
8790
8790
|
...p.length && { transfers: p },
|
|
@@ -8809,30 +8809,30 @@ class Wc {
|
|
|
8809
8809
|
this.regexps = e.map((o) => {
|
|
8810
8810
|
if (typeof o != "string")
|
|
8811
8811
|
return o;
|
|
8812
|
-
const
|
|
8813
|
-
if (
|
|
8814
|
-
if (
|
|
8815
|
-
return
|
|
8812
|
+
const l = r == null ? void 0 : r.get(o);
|
|
8813
|
+
if (l) {
|
|
8814
|
+
if (l instanceof RegExp)
|
|
8815
|
+
return l;
|
|
8816
8816
|
if (a)
|
|
8817
8817
|
return null;
|
|
8818
|
-
throw
|
|
8818
|
+
throw l;
|
|
8819
8819
|
}
|
|
8820
8820
|
try {
|
|
8821
|
-
const
|
|
8822
|
-
return r == null || r.set(o,
|
|
8823
|
-
} catch (
|
|
8824
|
-
if (r == null || r.set(o,
|
|
8821
|
+
const i = s(o);
|
|
8822
|
+
return r == null || r.set(o, i), i;
|
|
8823
|
+
} catch (i) {
|
|
8824
|
+
if (r == null || r.set(o, i), a)
|
|
8825
8825
|
return null;
|
|
8826
|
-
throw
|
|
8826
|
+
throw i;
|
|
8827
8827
|
}
|
|
8828
8828
|
});
|
|
8829
8829
|
}
|
|
8830
8830
|
findNextMatchSync(e, n, a) {
|
|
8831
8831
|
const r = typeof e == "string" ? e : e.content, s = [];
|
|
8832
|
-
function o(
|
|
8832
|
+
function o(l, i, c = 0) {
|
|
8833
8833
|
return {
|
|
8834
|
-
index:
|
|
8835
|
-
captureIndices:
|
|
8834
|
+
index: l,
|
|
8835
|
+
captureIndices: i.indices.map((u) => u == null ? {
|
|
8836
8836
|
start: ka,
|
|
8837
8837
|
end: ka,
|
|
8838
8838
|
length: 0
|
|
@@ -8843,17 +8843,17 @@ class Wc {
|
|
|
8843
8843
|
})
|
|
8844
8844
|
};
|
|
8845
8845
|
}
|
|
8846
|
-
for (let
|
|
8847
|
-
const
|
|
8848
|
-
if (
|
|
8846
|
+
for (let l = 0; l < this.regexps.length; l++) {
|
|
8847
|
+
const i = this.regexps[l];
|
|
8848
|
+
if (i)
|
|
8849
8849
|
try {
|
|
8850
|
-
|
|
8851
|
-
const c =
|
|
8850
|
+
i.lastIndex = n;
|
|
8851
|
+
const c = i.exec(r);
|
|
8852
8852
|
if (!c)
|
|
8853
8853
|
continue;
|
|
8854
8854
|
if (c.index === n)
|
|
8855
|
-
return o(
|
|
8856
|
-
s.push([
|
|
8855
|
+
return o(l, c, 0);
|
|
8856
|
+
s.push([l, c, 0]);
|
|
8857
8857
|
} catch (c) {
|
|
8858
8858
|
if (this.options.forgiving)
|
|
8859
8859
|
continue;
|
|
@@ -8861,10 +8861,10 @@ class Wc {
|
|
|
8861
8861
|
}
|
|
8862
8862
|
}
|
|
8863
8863
|
if (s.length) {
|
|
8864
|
-
const
|
|
8865
|
-
for (const [
|
|
8866
|
-
if (c.index ===
|
|
8867
|
-
return o(
|
|
8864
|
+
const l = Math.min(...s.map((i) => i[1].index));
|
|
8865
|
+
for (const [i, c, u] of s)
|
|
8866
|
+
if (c.index === l)
|
|
8867
|
+
return o(i, c, u);
|
|
8868
8868
|
}
|
|
8869
8869
|
return null;
|
|
8870
8870
|
}
|
|
@@ -8954,14 +8954,14 @@ const Zc = { class: "relative float-left min-w-full" }, Kc = ["innerHTML"], Jc =
|
|
|
8954
8954
|
}
|
|
8955
8955
|
})();
|
|
8956
8956
|
const s = L(), o = L();
|
|
8957
|
-
function
|
|
8957
|
+
function l() {
|
|
8958
8958
|
if (!o.value || !s.value) return;
|
|
8959
8959
|
const c = o.value.children[0];
|
|
8960
8960
|
c && (c.scrollLeft = s.value.scrollLeft);
|
|
8961
8961
|
}
|
|
8962
|
-
function
|
|
8962
|
+
function i() {
|
|
8963
8963
|
Fr().then(() => {
|
|
8964
|
-
|
|
8964
|
+
l();
|
|
8965
8965
|
});
|
|
8966
8966
|
}
|
|
8967
8967
|
return (c, u) => (M(), J("div", {
|
|
@@ -8984,8 +8984,8 @@ const Zc = { class: "relative float-left min-w-full" }, Kc = ["innerHTML"], Jc =
|
|
|
8984
8984
|
autocorrect: "off",
|
|
8985
8985
|
autocapitalize: "off",
|
|
8986
8986
|
spellcheck: "false",
|
|
8987
|
-
onInput:
|
|
8988
|
-
onScroll:
|
|
8987
|
+
onInput: i,
|
|
8988
|
+
onScroll: l
|
|
8989
8989
|
}, null, 544), [
|
|
8990
8990
|
[Gr, e.value]
|
|
8991
8991
|
])
|
|
@@ -9020,8 +9020,8 @@ function lu(t, e) {
|
|
|
9020
9020
|
return e;
|
|
9021
9021
|
try {
|
|
9022
9022
|
let n = t;
|
|
9023
|
-
const a =
|
|
9024
|
-
return
|
|
9023
|
+
const a = n.trim(), r = /^\s*function\s+transformData\s*\(\s*data\s*\)\s*\{([\s\S]*)\}\s*$/, s = a.match(r);
|
|
9024
|
+
return s ? n = s[1].trim() : n = a, new Function("data", n)(e);
|
|
9025
9025
|
} catch (n) {
|
|
9026
9026
|
return console.error("执行数据转换函数失败:", n), e;
|
|
9027
9027
|
}
|
|
@@ -9031,8 +9031,8 @@ function cu(t) {
|
|
|
9031
9031
|
return !1;
|
|
9032
9032
|
try {
|
|
9033
9033
|
let e = t;
|
|
9034
|
-
const n =
|
|
9035
|
-
return
|
|
9034
|
+
const n = e.trim(), a = /^\s*function\s+transformData\s*\(\s*data\s*\)\s*\{([\s\S]*)\}\s*$/, r = n.match(a);
|
|
9035
|
+
return r ? e = r[1].trim() : e = n, new Function("data", e), !0;
|
|
9036
9036
|
} catch (e) {
|
|
9037
9037
|
return console.error("数据转换函数无效:", e), !1;
|
|
9038
9038
|
}
|