zudoku 0.55.1 → 0.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/main.d.ts +1 -1
- package/dist/app/main.js +11 -4
- package/dist/app/main.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.d.ts +4 -0
- package/dist/config/validators/InputNavigationSchema.js +1 -0
- package/dist/config/validators/InputNavigationSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +1 -0
- package/dist/config/validators/validate.js +1 -0
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/flat-config.d.ts +329 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/components/BuildCheck.js +7 -0
- package/dist/lib/components/BuildCheck.js.map +1 -1
- package/dist/lib/components/Header.js +1 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Layout.js +4 -7
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Meta.d.ts +2 -0
- package/dist/lib/components/Meta.js +11 -0
- package/dist/lib/components/Meta.js.map +1 -0
- package/dist/lib/components/context/ZudokuContext.js +1 -1
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/index.js +2 -0
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/NavigationItem.js +3 -2
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.js +12 -11
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +1 -0
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/plugins/custom-pages/index.js +3 -0
- package/dist/lib/plugins/custom-pages/index.js.map +1 -1
- package/dist/lib/ui/CodeBlock.js +2 -2
- package/dist/lib/ui/CodeBlock.js.map +1 -1
- package/dist/lib/ui/Dialog.js +2 -2
- package/dist/lib/ui/Dialog.js.map +1 -1
- package/dist/vite/plugin-mdx.js +1 -1
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/sitemap.js +10 -9
- package/dist/vite/sitemap.js.map +1 -1
- package/lib/{CodeBlock-CVT6z0PP.js → CodeBlock-yJjjRwj-.js} +3 -3
- package/lib/CodeBlock-yJjjRwj-.js.map +1 -0
- package/lib/{Command-BYukybsa.js → Command-CfgGXMfJ.js} +2 -2
- package/lib/{Command-BYukybsa.js.map → Command-CfgGXMfJ.js.map} +1 -1
- package/lib/Dialog-B7YnrNnG.js +114 -0
- package/lib/Dialog-B7YnrNnG.js.map +1 -0
- package/lib/{MdxPage-BKyikAKk.js → MdxPage-D49lfheg.js} +7 -7
- package/lib/{MdxPage-BKyikAKk.js.map → MdxPage-D49lfheg.js.map} +1 -1
- package/lib/{OAuthErrorPage--neTdY8H.js → OAuthErrorPage-COKL9zOi.js} +6 -6
- package/lib/{OAuthErrorPage--neTdY8H.js.map → OAuthErrorPage-COKL9zOi.js.map} +1 -1
- package/lib/{OasProvider-yysXhMVI.js → OasProvider-CCv_-asV.js} +2 -2
- package/lib/{OasProvider-yysXhMVI.js.map → OasProvider-CCv_-asV.js.map} +1 -1
- package/lib/{OperationList-CSYrpcpD.js → OperationList-DkS0B0y1.js} +11 -11
- package/lib/{OperationList-CSYrpcpD.js.map → OperationList-DkS0B0y1.js.map} +1 -1
- package/lib/{Pagination-QsyyJuoq.js → Pagination-VfR2DCXf.js} +2 -2
- package/lib/{Pagination-QsyyJuoq.js.map → Pagination-VfR2DCXf.js.map} +1 -1
- package/lib/{RouteGuard-D17dUEM_.js → RouteGuard-CSi9-hSR.js} +4 -4
- package/lib/{RouteGuard-D17dUEM_.js.map → RouteGuard-CSi9-hSR.js.map} +1 -1
- package/lib/{SchemaList-CSZkqmwI.js → SchemaList-B7ezc5Uy.js} +8 -8
- package/lib/{SchemaList-CSZkqmwI.js.map → SchemaList-B7ezc5Uy.js.map} +1 -1
- package/lib/{SchemaView-bhJ_U4vL.js → SchemaView-BuL-ycaR.js} +4 -4
- package/lib/{SchemaView-bhJ_U4vL.js.map → SchemaView-BuL-ycaR.js.map} +1 -1
- package/lib/{Select-DlfI9FFO.js → Select-B9h5k2Pz.js} +3 -3
- package/lib/{Select-DlfI9FFO.js.map → Select-B9h5k2Pz.js.map} +1 -1
- package/lib/{SignUp-C6ogvx5s.js → SignUp-Cn_gZ7UN.js} +3 -3
- package/lib/{SignUp-C6ogvx5s.js.map → SignUp-Cn_gZ7UN.js.map} +1 -1
- package/lib/{Slot-Dgy8tqef.js → Slot-BFCJzl5J.js} +358 -358
- package/lib/{Slot-Dgy8tqef.js.map → Slot-BFCJzl5J.js.map} +1 -1
- package/lib/{SyntaxHighlight-BD_Z_Csq.js → SyntaxHighlight-CSW4eaIJ.js} +313 -313
- package/lib/SyntaxHighlight-CSW4eaIJ.js.map +1 -0
- package/lib/{Toc-CjX59Ljo.js → Toc-B9K7a2FS.js} +2 -2
- package/lib/{Toc-CjX59Ljo.js.map → Toc-B9K7a2FS.js.map} +1 -1
- package/lib/{ZudokuContext-Coxa0DfE.js → ZudokuContext-mDDq1hft.js} +76 -68
- package/lib/{ZudokuContext-Coxa0DfE.js.map → ZudokuContext-mDDq1hft.js.map} +1 -1
- package/lib/{circular-Q4G1nwyb.js → circular-BMUvC5RK.js} +2 -2
- package/lib/{circular-Q4G1nwyb.js.map → circular-BMUvC5RK.js.map} +1 -1
- package/lib/{createServer-Dtstxqn7.js → createServer-I8dX2VSu.js} +4 -4
- package/lib/{createServer-Dtstxqn7.js.map → createServer-I8dX2VSu.js.map} +1 -1
- package/lib/{errors-BoJYHL2E.js → errors-D2Qdkul6.js} +2 -2
- package/lib/{errors-BoJYHL2E.js.map → errors-D2Qdkul6.js.map} +1 -1
- package/lib/{hook-DEPqwjke.js → hook-CGx8MPrU.js} +2 -2
- package/lib/{hook-DEPqwjke.js.map → hook-CGx8MPrU.js.map} +1 -1
- package/lib/{index-DYs8gxKX.js → index-Cc70HIQT.js} +106 -101
- package/lib/index-Cc70HIQT.js.map +1 -0
- package/lib/{index-Bl1W774G.js → index-ChOC1gfC.js} +2 -2
- package/lib/{index-Bl1W774G.js.map → index-ChOC1gfC.js.map} +1 -1
- package/lib/{index-DRkS-pvf.js → index-DZqSbZzE.js} +16 -16
- package/lib/{index-DRkS-pvf.js.map → index-DZqSbZzE.js.map} +1 -1
- package/lib/ui/CodeBlock.js +1 -1
- package/lib/ui/Command.js +1 -1
- package/lib/ui/Dialog.js +56 -41
- package/lib/ui/Dialog.js.map +1 -1
- package/lib/ui/SyntaxHighlight.js +3 -3
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-azureb2c.js +5 -5
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +5 -5
- package/lib/zudoku.auth-supabase.js +2 -2
- package/lib/zudoku.components.js +19 -18
- package/lib/zudoku.hooks.js +3 -3
- package/lib/zudoku.plugin-api-catalog.js +6 -6
- package/lib/zudoku.plugin-api-keys.js +6 -6
- package/lib/zudoku.plugin-custom-pages.js +8 -5
- package/lib/zudoku.plugin-custom-pages.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +3 -3
- package/lib/zudoku.plugin-search-pagefind.js +5 -5
- package/package.json +6 -6
- package/src/app/main.tsx +18 -4
- package/src/lib/components/BuildCheck.tsx +10 -0
- package/src/lib/components/Header.tsx +3 -2
- package/src/lib/components/Layout.tsx +2 -21
- package/src/lib/components/Meta.tsx +32 -0
- package/src/lib/components/context/ZudokuContext.ts +1 -1
- package/src/lib/components/index.ts +2 -0
- package/src/lib/components/navigation/NavigationItem.tsx +4 -2
- package/src/lib/components/navigation/utils.ts +12 -12
- package/src/lib/core/ZudokuContext.ts +1 -0
- package/src/lib/plugins/custom-pages/index.tsx +3 -0
- package/src/lib/ui/CodeBlock.tsx +2 -2
- package/src/lib/ui/Dialog.tsx +12 -3
- package/lib/CodeBlock-CVT6z0PP.js.map +0 -1
- package/lib/Dialog-u9Uz9sTt.js +0 -99
- package/lib/Dialog-u9Uz9sTt.js.map +0 -1
- package/lib/SyntaxHighlight-BD_Z_Csq.js.map +0 -1
- package/lib/index-DYs8gxKX.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as at } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { Fragment as rs, memo as os } from "react";
|
|
3
|
-
import { c as ss } from "./ZudokuContext-
|
|
3
|
+
import { c as ss } from "./ZudokuContext-mDDq1hft.js";
|
|
4
4
|
import { c as as } from "./cn-dYga0KKN.js";
|
|
5
5
|
import { g as is, i as ls } from "./invariant-Bm-FVUQE.js";
|
|
6
|
-
import { C as us } from "./CodeBlock-
|
|
6
|
+
import { C as us } from "./CodeBlock-yJjjRwj-.js";
|
|
7
7
|
import { EmbeddedCodeBlock as cs } from "./ui/EmbeddedCodeBlock.js";
|
|
8
8
|
function eh() {
|
|
9
9
|
}
|
|
@@ -25,9 +25,9 @@ function Ir(t, e) {
|
|
|
25
25
|
(n.padRight ? " " : "") + "," + (n.padLeft === !1 ? "" : " ")
|
|
26
26
|
).trim();
|
|
27
27
|
}
|
|
28
|
-
const hs = /^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,
|
|
28
|
+
const hs = /^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u, fs = /^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u, ps = {};
|
|
29
29
|
function In(t, e) {
|
|
30
|
-
return (
|
|
30
|
+
return (ps.jsx ? fs : hs).test(t);
|
|
31
31
|
}
|
|
32
32
|
const ds = /[ \t\n\f\r]/g;
|
|
33
33
|
function Ct(t) {
|
|
@@ -1198,7 +1198,7 @@ function Ss(t) {
|
|
|
1198
1198
|
function ks(t) {
|
|
1199
1199
|
return t.charAt(1).toUpperCase();
|
|
1200
1200
|
}
|
|
1201
|
-
const vs = Nr([Pr, ms, Mr, Or, Dr], "html"),
|
|
1201
|
+
const vs = Nr([Pr, ms, Mr, Or, Dr], "html"), fn = Nr([Pr, ys, Mr, Or, Dr], "svg");
|
|
1202
1202
|
function ah(t) {
|
|
1203
1203
|
const e = String(t || "").trim();
|
|
1204
1204
|
return e ? e.split(/[ \t\n\r\f]+/g) : [];
|
|
@@ -1211,7 +1211,7 @@ function xs() {
|
|
|
1211
1211
|
if ($n) return Rt;
|
|
1212
1212
|
$n = 1;
|
|
1213
1213
|
var t = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g, e = /\n/g, n = /^\s*/, r = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/, o = /^:\s*/, s = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/, a = /^[;\s]*/, i = /^\s+|\s+$/g, l = `
|
|
1214
|
-
`, u = "/", c = "*", h = "",
|
|
1214
|
+
`, u = "/", c = "*", h = "", p = "comment", d = "declaration";
|
|
1215
1215
|
Rt = function(g, C) {
|
|
1216
1216
|
if (typeof g != "string")
|
|
1217
1217
|
throw new TypeError("First argument must be a string");
|
|
@@ -1265,7 +1265,7 @@ function xs() {
|
|
|
1265
1265
|
return D("End of comment missing");
|
|
1266
1266
|
var G = g.slice(2, k - 2);
|
|
1267
1267
|
return m += 2, _(G), g = g.slice(k), m += 2, R({
|
|
1268
|
-
type:
|
|
1268
|
+
type: p,
|
|
1269
1269
|
comment: G
|
|
1270
1270
|
});
|
|
1271
1271
|
}
|
|
@@ -1276,8 +1276,8 @@ function xs() {
|
|
|
1276
1276
|
if (ee(), !L(o)) return D("property missing ':'");
|
|
1277
1277
|
var G = L(s), Te = R({
|
|
1278
1278
|
type: d,
|
|
1279
|
-
property:
|
|
1280
|
-
value: G ?
|
|
1279
|
+
property: f(k[0].replace(t, h)),
|
|
1280
|
+
value: G ? f(G[0].replace(t, h)) : h
|
|
1281
1281
|
});
|
|
1282
1282
|
return L(a), Te;
|
|
1283
1283
|
}
|
|
@@ -1291,7 +1291,7 @@ function xs() {
|
|
|
1291
1291
|
}
|
|
1292
1292
|
return j(), te();
|
|
1293
1293
|
};
|
|
1294
|
-
function
|
|
1294
|
+
function f(g) {
|
|
1295
1295
|
return g ? g.replace(i, h) : h;
|
|
1296
1296
|
}
|
|
1297
1297
|
return Rt;
|
|
@@ -1467,7 +1467,7 @@ H.prototype.fatal = void 0;
|
|
|
1467
1467
|
H.prototype.place = void 0;
|
|
1468
1468
|
H.prototype.ruleId = void 0;
|
|
1469
1469
|
H.prototype.source = void 0;
|
|
1470
|
-
const
|
|
1470
|
+
const pn = {}.hasOwnProperty, $s = /* @__PURE__ */ new Map(), Ts = /[A-Z]/g, Ms = /* @__PURE__ */ new Set(["table", "tbody", "thead", "tfoot", "tr"]), Os = /* @__PURE__ */ new Set(["td", "th"]), jr = "https://github.com/syntax-tree/hast-util-to-jsx-runtime";
|
|
1471
1471
|
function Ds(t, e) {
|
|
1472
1472
|
if (!e || e.Fragment === void 0)
|
|
1473
1473
|
throw new TypeError("Expected `Fragment` in options");
|
|
@@ -1497,7 +1497,7 @@ function Ds(t, e) {
|
|
|
1497
1497
|
ignoreInvalidStyle: e.ignoreInvalidStyle || !1,
|
|
1498
1498
|
passKeys: e.passKeys !== !1,
|
|
1499
1499
|
passNode: e.passNode || !1,
|
|
1500
|
-
schema: e.space === "svg" ?
|
|
1500
|
+
schema: e.space === "svg" ? fn : vs,
|
|
1501
1501
|
stylePropertyNameCase: e.stylePropertyNameCase || "dom",
|
|
1502
1502
|
tableCellAlignToStyle: e.tableCellAlignToStyle !== !1
|
|
1503
1503
|
}, s = Ur(o, t, void 0);
|
|
@@ -1525,7 +1525,7 @@ function Ur(t, e, n) {
|
|
|
1525
1525
|
function Gs(t, e, n) {
|
|
1526
1526
|
const r = t.schema;
|
|
1527
1527
|
let o = r;
|
|
1528
|
-
e.tagName.toLowerCase() === "svg" && r.space === "html" && (o =
|
|
1528
|
+
e.tagName.toLowerCase() === "svg" && r.space === "html" && (o = fn, t.schema = o), t.ancestors.push(e);
|
|
1529
1529
|
const s = Hr(t, e.tagName, !1), a = Vs(t, e);
|
|
1530
1530
|
let i = gn(t, e);
|
|
1531
1531
|
return Ms.has(e.tagName) && (i = i.filter(function(l) {
|
|
@@ -1551,7 +1551,7 @@ function Bs(t, e) {
|
|
|
1551
1551
|
function js(t, e, n) {
|
|
1552
1552
|
const r = t.schema;
|
|
1553
1553
|
let o = r;
|
|
1554
|
-
e.name === "svg" && r.space === "html" && (o =
|
|
1554
|
+
e.name === "svg" && r.space === "html" && (o = fn, t.schema = o), t.ancestors.push(e);
|
|
1555
1555
|
const s = e.name === null ? t.Fragment : Hr(t, e.name, !0), a = qs(t, e), i = gn(t, e);
|
|
1556
1556
|
return zr(t, a, s, e), dn(a, i), t.ancestors.pop(), t.schema = r, t.create(e, s, a, n);
|
|
1557
1557
|
}
|
|
@@ -1600,7 +1600,7 @@ function Vs(t, e) {
|
|
|
1600
1600
|
const n = {};
|
|
1601
1601
|
let r, o;
|
|
1602
1602
|
for (o in e.properties)
|
|
1603
|
-
if (o !== "children" &&
|
|
1603
|
+
if (o !== "children" && pn.call(e.properties, o)) {
|
|
1604
1604
|
const s = Xs(t, o, e.properties[o]);
|
|
1605
1605
|
if (s) {
|
|
1606
1606
|
const [a, i] = s;
|
|
@@ -1723,7 +1723,7 @@ function Hr(t, e, n) {
|
|
|
1723
1723
|
/** @type {string | number} */
|
|
1724
1724
|
r.value
|
|
1725
1725
|
);
|
|
1726
|
-
return
|
|
1726
|
+
return pn.call(t.components, o) ? t.components[o] : o;
|
|
1727
1727
|
}
|
|
1728
1728
|
if (t.evaluater)
|
|
1729
1729
|
return t.evaluater.evaluateExpression(r);
|
|
@@ -1745,7 +1745,7 @@ function Ys(t) {
|
|
|
1745
1745
|
const e = {};
|
|
1746
1746
|
let n;
|
|
1747
1747
|
for (n in t)
|
|
1748
|
-
|
|
1748
|
+
pn.call(t, n) && (e[Js(n)] = t[n]);
|
|
1749
1749
|
return e;
|
|
1750
1750
|
}
|
|
1751
1751
|
function Js(t) {
|
|
@@ -1855,13 +1855,13 @@ function aa(t, e, n, r) {
|
|
|
1855
1855
|
typeof h.name == "string" ? h.name : void 0
|
|
1856
1856
|
)
|
|
1857
1857
|
);
|
|
1858
|
-
Object.defineProperty(
|
|
1858
|
+
Object.defineProperty(p, "name", {
|
|
1859
1859
|
value: "node (" + (l.type + (d ? "<" + d + ">" : "")) + ")"
|
|
1860
1860
|
});
|
|
1861
1861
|
}
|
|
1862
|
-
return
|
|
1863
|
-
function
|
|
1864
|
-
let d = Vr,
|
|
1862
|
+
return p;
|
|
1863
|
+
function p() {
|
|
1864
|
+
let d = Vr, f, g, C;
|
|
1865
1865
|
if ((!e || s(l, u, c[c.length - 1] || void 0)) && (d = ia(n(l, c)), d[0] === Fn))
|
|
1866
1866
|
return d;
|
|
1867
1867
|
if ("children" in l && l.children) {
|
|
@@ -1872,9 +1872,9 @@ function aa(t, e, n, r) {
|
|
|
1872
1872
|
if (y.children && d[0] !== sa)
|
|
1873
1873
|
for (g = (r ? y.children.length : -1) + a, C = c.concat(y); g > -1 && g < y.children.length; ) {
|
|
1874
1874
|
const m = y.children[g];
|
|
1875
|
-
if (
|
|
1876
|
-
return
|
|
1877
|
-
g = typeof
|
|
1875
|
+
if (f = i(m, g, C)(), f[0] === Fn)
|
|
1876
|
+
return f;
|
|
1877
|
+
g = typeof f[1] == "number" ? f[1] : g + a;
|
|
1878
1878
|
}
|
|
1879
1879
|
}
|
|
1880
1880
|
return d;
|
|
@@ -1947,7 +1947,7 @@ function ca(t) {
|
|
|
1947
1947
|
return mn(t);
|
|
1948
1948
|
}
|
|
1949
1949
|
function mn(t) {
|
|
1950
|
-
return Array.isArray(t) ? ha(t) : t instanceof RegExp ? t : typeof t == "object" ?
|
|
1950
|
+
return Array.isArray(t) ? ha(t) : t instanceof RegExp ? t : typeof t == "object" ? fa(t) : t;
|
|
1951
1951
|
}
|
|
1952
1952
|
function ha(t) {
|
|
1953
1953
|
let e = [];
|
|
@@ -1955,7 +1955,7 @@ function ha(t) {
|
|
|
1955
1955
|
e[n] = mn(t[n]);
|
|
1956
1956
|
return e;
|
|
1957
1957
|
}
|
|
1958
|
-
function
|
|
1958
|
+
function fa(t) {
|
|
1959
1959
|
let e = {};
|
|
1960
1960
|
for (let n in t)
|
|
1961
1961
|
e[n] = mn(t[n]);
|
|
@@ -2056,7 +2056,7 @@ var Qr = class {
|
|
|
2056
2056
|
if (t === null)
|
|
2057
2057
|
return this._defaults;
|
|
2058
2058
|
const e = t.scopeName, r = this._cachedMatchRoot.get(e).find(
|
|
2059
|
-
(o) =>
|
|
2059
|
+
(o) => pa(t.parent, o.parentScopes)
|
|
2060
2060
|
);
|
|
2061
2061
|
return r ? new eo(
|
|
2062
2062
|
r.fontStyle,
|
|
@@ -2103,7 +2103,7 @@ var Qr = class {
|
|
|
2103
2103
|
return r === e ? n.reverse() : void 0;
|
|
2104
2104
|
}
|
|
2105
2105
|
};
|
|
2106
|
-
function
|
|
2106
|
+
function pa(t, e) {
|
|
2107
2107
|
if (e.length === 0)
|
|
2108
2108
|
return !0;
|
|
2109
2109
|
for (let n = 0; n < e.length; n++) {
|
|
@@ -2151,8 +2151,8 @@ function ga(t) {
|
|
|
2151
2151
|
if (typeof a.settings.fontStyle == "string") {
|
|
2152
2152
|
l = 0;
|
|
2153
2153
|
let h = a.settings.fontStyle.split(" ");
|
|
2154
|
-
for (let
|
|
2155
|
-
switch (h[
|
|
2154
|
+
for (let p = 0, d = h.length; p < d; p++)
|
|
2155
|
+
switch (h[p]) {
|
|
2156
2156
|
case "italic":
|
|
2157
2157
|
l = l | 1;
|
|
2158
2158
|
break;
|
|
@@ -2171,9 +2171,9 @@ function ga(t) {
|
|
|
2171
2171
|
typeof a.settings.foreground == "string" && Un(a.settings.foreground) && (u = a.settings.foreground);
|
|
2172
2172
|
let c = null;
|
|
2173
2173
|
typeof a.settings.background == "string" && Un(a.settings.background) && (c = a.settings.background);
|
|
2174
|
-
for (let h = 0,
|
|
2175
|
-
let
|
|
2176
|
-
|
|
2174
|
+
for (let h = 0, p = i.length; h < p; h++) {
|
|
2175
|
+
let f = i[h].trim().split(" "), g = f[f.length - 1], C = null;
|
|
2176
|
+
f.length > 1 && (C = f.slice(0, f.length - 1), C.reverse()), n[r++] = new ma(
|
|
2177
2177
|
g,
|
|
2178
2178
|
C,
|
|
2179
2179
|
o,
|
|
@@ -2342,8 +2342,8 @@ var ba = class {
|
|
|
2342
2342
|
* A value of `0`, `NotSet` or `null` indicates that the corresponding field should be left as is.
|
|
2343
2343
|
*/
|
|
2344
2344
|
static set(e, n, r, o, s, a, i) {
|
|
2345
|
-
let l = K.getLanguageId(e), u = K.getTokenType(e), c = K.containsBalancedBrackets(e) ? 1 : 0, h = K.getFontStyle(e),
|
|
2346
|
-
return n !== 0 && (l = n), r !== 8 && (u = r), o !== null && (c = o ? 1 : 0), s !== -1 && (h = s), a !== 0 && (
|
|
2345
|
+
let l = K.getLanguageId(e), u = K.getTokenType(e), c = K.containsBalancedBrackets(e) ? 1 : 0, h = K.getFontStyle(e), p = K.getForeground(e), d = K.getBackground(e);
|
|
2346
|
+
return n !== 0 && (l = n), r !== 8 && (u = r), o !== null && (c = o ? 1 : 0), s !== -1 && (h = s), a !== 0 && (p = a), i !== 0 && (d = i), (l << 0 | u << 8 | c << 10 | h << 11 | p << 15 | d << 24) >>> 0;
|
|
2347
2347
|
}
|
|
2348
2348
|
};
|
|
2349
2349
|
function lt(t, e) {
|
|
@@ -2848,11 +2848,11 @@ var Xe = class {
|
|
|
2848
2848
|
break;
|
|
2849
2849
|
case 3:
|
|
2850
2850
|
case 4:
|
|
2851
|
-
const h = u.scopeName,
|
|
2851
|
+
const h = u.scopeName, p = u.kind === 4 ? u.ruleName : null, d = n.getExternalGrammar(h, r);
|
|
2852
2852
|
if (d)
|
|
2853
|
-
if (
|
|
2854
|
-
let
|
|
2855
|
-
|
|
2853
|
+
if (p) {
|
|
2854
|
+
let f = d.repository[p];
|
|
2855
|
+
f && (l = U.getCompiledRuleId(f, n, d.repository));
|
|
2856
2856
|
} else
|
|
2857
2857
|
l = U.getCompiledRuleId(d.repository.$self, n, d.repository);
|
|
2858
2858
|
break;
|
|
@@ -3085,10 +3085,10 @@ function io(t, e, n, r, o, s, a, i) {
|
|
|
3085
3085
|
for (; !u; ) {
|
|
3086
3086
|
if (i !== 0 && Date.now() - h > i)
|
|
3087
3087
|
return new qn(o, !0);
|
|
3088
|
-
|
|
3088
|
+
p();
|
|
3089
3089
|
}
|
|
3090
3090
|
return new qn(o, !1);
|
|
3091
|
-
function
|
|
3091
|
+
function p() {
|
|
3092
3092
|
const d = Ga(
|
|
3093
3093
|
t,
|
|
3094
3094
|
e,
|
|
@@ -3101,18 +3101,18 @@ function io(t, e, n, r, o, s, a, i) {
|
|
|
3101
3101
|
s.produce(o, l), u = !0;
|
|
3102
3102
|
return;
|
|
3103
3103
|
}
|
|
3104
|
-
const
|
|
3104
|
+
const f = d.captureIndices, g = d.matchedRuleId, C = f && f.length > 0 ? f[0].end > r : !1;
|
|
3105
3105
|
if (g === Pa) {
|
|
3106
3106
|
const y = o.getRule(t);
|
|
3107
|
-
s.produce(o,
|
|
3107
|
+
s.produce(o, f[0].start), o = o.withContentNameScopesList(o.nameScopesList), Ge(
|
|
3108
3108
|
t,
|
|
3109
3109
|
e,
|
|
3110
3110
|
n,
|
|
3111
3111
|
o,
|
|
3112
3112
|
s,
|
|
3113
3113
|
y.endCaptures,
|
|
3114
|
-
|
|
3115
|
-
), s.produce(o,
|
|
3114
|
+
f
|
|
3115
|
+
), s.produce(o, f[0].end);
|
|
3116
3116
|
const m = o;
|
|
3117
3117
|
if (o = o.parent, c = m.getAnchorPos(), !C && m.getEnterPos() === r) {
|
|
3118
3118
|
o = m, s.produce(o, l), u = !0;
|
|
@@ -3120,8 +3120,8 @@ function io(t, e, n, r, o, s, a, i) {
|
|
|
3120
3120
|
}
|
|
3121
3121
|
} else {
|
|
3122
3122
|
const y = t.getRule(g);
|
|
3123
|
-
s.produce(o,
|
|
3124
|
-
const m = o, _ = y.getName(e.content,
|
|
3123
|
+
s.produce(o, f[0].start);
|
|
3124
|
+
const m = o, _ = y.getName(e.content, f), S = o.contentNameScopesList.pushAttributed(
|
|
3125
3125
|
_,
|
|
3126
3126
|
t
|
|
3127
3127
|
);
|
|
@@ -3129,7 +3129,7 @@ function io(t, e, n, r, o, s, a, i) {
|
|
|
3129
3129
|
g,
|
|
3130
3130
|
r,
|
|
3131
3131
|
c,
|
|
3132
|
-
|
|
3132
|
+
f[0].end === l,
|
|
3133
3133
|
null,
|
|
3134
3134
|
S,
|
|
3135
3135
|
S
|
|
@@ -3142,11 +3142,11 @@ function io(t, e, n, r, o, s, a, i) {
|
|
|
3142
3142
|
o,
|
|
3143
3143
|
s,
|
|
3144
3144
|
A.beginCaptures,
|
|
3145
|
-
|
|
3146
|
-
), s.produce(o,
|
|
3145
|
+
f
|
|
3146
|
+
), s.produce(o, f[0].end), c = f[0].end;
|
|
3147
3147
|
const D = A.getContentName(
|
|
3148
3148
|
e.content,
|
|
3149
|
-
|
|
3149
|
+
f
|
|
3150
3150
|
), L = S.pushAttributed(
|
|
3151
3151
|
D,
|
|
3152
3152
|
t
|
|
@@ -3154,7 +3154,7 @@ function io(t, e, n, r, o, s, a, i) {
|
|
|
3154
3154
|
if (o = o.withContentNameScopesList(L), A.endHasBackReferences && (o = o.withEndRule(
|
|
3155
3155
|
A.getEndWithResolvedBackReferences(
|
|
3156
3156
|
e.content,
|
|
3157
|
-
|
|
3157
|
+
f
|
|
3158
3158
|
)
|
|
3159
3159
|
)), !C && m.hasSameRuleAs(o)) {
|
|
3160
3160
|
o = o.pop(), s.produce(o, l), u = !0;
|
|
@@ -3169,11 +3169,11 @@ function io(t, e, n, r, o, s, a, i) {
|
|
|
3169
3169
|
o,
|
|
3170
3170
|
s,
|
|
3171
3171
|
A.beginCaptures,
|
|
3172
|
-
|
|
3173
|
-
), s.produce(o,
|
|
3172
|
+
f
|
|
3173
|
+
), s.produce(o, f[0].end), c = f[0].end;
|
|
3174
3174
|
const D = A.getContentName(
|
|
3175
3175
|
e.content,
|
|
3176
|
-
|
|
3176
|
+
f
|
|
3177
3177
|
), L = S.pushAttributed(
|
|
3178
3178
|
D,
|
|
3179
3179
|
t
|
|
@@ -3181,7 +3181,7 @@ function io(t, e, n, r, o, s, a, i) {
|
|
|
3181
3181
|
if (o = o.withContentNameScopesList(L), A.whileHasBackReferences && (o = o.withEndRule(
|
|
3182
3182
|
A.getWhileWithResolvedBackReferences(
|
|
3183
3183
|
e.content,
|
|
3184
|
-
|
|
3184
|
+
f
|
|
3185
3185
|
)
|
|
3186
3186
|
)), !C && m.hasSameRuleAs(o)) {
|
|
3187
3187
|
o = o.pop(), s.produce(o, l), u = !0;
|
|
@@ -3194,13 +3194,13 @@ function io(t, e, n, r, o, s, a, i) {
|
|
|
3194
3194
|
o,
|
|
3195
3195
|
s,
|
|
3196
3196
|
y.captures,
|
|
3197
|
-
|
|
3198
|
-
), s.produce(o,
|
|
3197
|
+
f
|
|
3198
|
+
), s.produce(o, f[0].end), o = o.pop(), !C) {
|
|
3199
3199
|
o = o.safePop(), s.produce(o, l), u = !0;
|
|
3200
3200
|
return;
|
|
3201
3201
|
}
|
|
3202
3202
|
}
|
|
3203
|
-
|
|
3203
|
+
f[0].end > r && (r = f[0].end, n = !1);
|
|
3204
3204
|
}
|
|
3205
3205
|
}
|
|
3206
3206
|
function Da(t, e, n, r, o, s) {
|
|
@@ -3250,15 +3250,15 @@ function Fa(t, e, n, r, o, s) {
|
|
|
3250
3250
|
function Ba(t, e, n, r, o, s, a) {
|
|
3251
3251
|
let i = Number.MAX_VALUE, l = null, u, c = 0;
|
|
3252
3252
|
const h = s.contentNameScopesList.getScopeNames();
|
|
3253
|
-
for (let
|
|
3254
|
-
const
|
|
3255
|
-
if (!
|
|
3253
|
+
for (let p = 0, d = t.length; p < d; p++) {
|
|
3254
|
+
const f = t[p];
|
|
3255
|
+
if (!f.matcher(h))
|
|
3256
3256
|
continue;
|
|
3257
|
-
const g = e.getRule(
|
|
3257
|
+
const g = e.getRule(f.ruleId), { ruleScanner: C, findOptions: y } = lo(g, e, null, r, o === a), m = C.findNextMatchSync(n, o, y);
|
|
3258
3258
|
if (!m)
|
|
3259
3259
|
continue;
|
|
3260
3260
|
const _ = m.captureIndices[0].start;
|
|
3261
|
-
if (!(_ >= i) && (i = _, l = m.captureIndices, u = m.ruleId, c =
|
|
3261
|
+
if (!(_ >= i) && (i = _, l = m.captureIndices, u = m.ruleId, c = f.priority, i === o))
|
|
3262
3262
|
break;
|
|
3263
3263
|
}
|
|
3264
3264
|
return l ? {
|
|
@@ -3286,8 +3286,8 @@ function Ge(t, e, n, r, o, s, a) {
|
|
|
3286
3286
|
return;
|
|
3287
3287
|
const i = e.content, l = Math.min(s.length, a.length), u = [], c = a[0].end;
|
|
3288
3288
|
for (let h = 0; h < l; h++) {
|
|
3289
|
-
const
|
|
3290
|
-
if (
|
|
3289
|
+
const p = s[h];
|
|
3290
|
+
if (p === null)
|
|
3291
3291
|
continue;
|
|
3292
3292
|
const d = a[h];
|
|
3293
3293
|
if (d.length === 0)
|
|
@@ -3296,8 +3296,8 @@ function Ge(t, e, n, r, o, s, a) {
|
|
|
3296
3296
|
break;
|
|
3297
3297
|
for (; u.length > 0 && u[u.length - 1].endPos <= d.start; )
|
|
3298
3298
|
o.produceFromScopes(u[u.length - 1].scopes, u[u.length - 1].endPos), u.pop();
|
|
3299
|
-
if (u.length > 0 ? o.produceFromScopes(u[u.length - 1].scopes, d.start) : o.produce(r, d.start),
|
|
3300
|
-
const g =
|
|
3299
|
+
if (u.length > 0 ? o.produceFromScopes(u[u.length - 1].scopes, d.start) : o.produce(r, d.start), p.retokenizeCapturedWithRuleId) {
|
|
3300
|
+
const g = p.getName(i, a), C = r.contentNameScopesList.pushAttributed(g, t), y = p.getContentName(i, a), m = C.pushAttributed(y, t), _ = r.push(p.retokenizeCapturedWithRuleId, d.start, -1, !1, null, C, m), S = t.createOnigString(i.substring(0, d.end));
|
|
3301
3301
|
io(
|
|
3302
3302
|
t,
|
|
3303
3303
|
S,
|
|
@@ -3311,9 +3311,9 @@ function Ge(t, e, n, r, o, s, a) {
|
|
|
3311
3311
|
), no(S);
|
|
3312
3312
|
continue;
|
|
3313
3313
|
}
|
|
3314
|
-
const
|
|
3315
|
-
if (
|
|
3316
|
-
const C = (u.length > 0 ? u[u.length - 1].scopes : r.contentNameScopesList).pushAttributed(
|
|
3314
|
+
const f = p.getName(i, a);
|
|
3315
|
+
if (f !== null) {
|
|
3316
|
+
const C = (u.length > 0 ? u[u.length - 1].scopes : r.contentNameScopesList).pushAttributed(f, t);
|
|
3317
3317
|
u.push(new Ua(C, d.end));
|
|
3318
3318
|
}
|
|
3319
3319
|
}
|
|
@@ -3497,13 +3497,13 @@ var Wa = class {
|
|
|
3497
3497
|
c.fontStyle,
|
|
3498
3498
|
c.foregroundId,
|
|
3499
3499
|
c.backgroundId
|
|
3500
|
-
),
|
|
3500
|
+
), p = this.getRule(this._rootId).getName(
|
|
3501
3501
|
null,
|
|
3502
3502
|
null
|
|
3503
3503
|
);
|
|
3504
3504
|
let d;
|
|
3505
|
-
|
|
3506
|
-
|
|
3505
|
+
p ? d = Fe.createRootAndLookUpScopeName(
|
|
3506
|
+
p,
|
|
3507
3507
|
h,
|
|
3508
3508
|
this
|
|
3509
3509
|
) : d = Fe.createRoot(
|
|
@@ -3644,7 +3644,7 @@ var Fe = class ne {
|
|
|
3644
3644
|
}), r = r.parent;
|
|
3645
3645
|
return r === e ? n.reverse() : void 0;
|
|
3646
3646
|
}
|
|
3647
|
-
}, Jt = class
|
|
3647
|
+
}, Jt = class fe {
|
|
3648
3648
|
/**
|
|
3649
3649
|
* Invariant:
|
|
3650
3650
|
* ```
|
|
@@ -3661,7 +3661,7 @@ var Fe = class ne {
|
|
|
3661
3661
|
}
|
|
3662
3662
|
_stackElementBrand = void 0;
|
|
3663
3663
|
// TODO remove me
|
|
3664
|
-
static NULL = new
|
|
3664
|
+
static NULL = new fe(
|
|
3665
3665
|
null,
|
|
3666
3666
|
0,
|
|
3667
3667
|
0,
|
|
@@ -3688,7 +3688,7 @@ var Fe = class ne {
|
|
|
3688
3688
|
*/
|
|
3689
3689
|
depth;
|
|
3690
3690
|
equals(e) {
|
|
3691
|
-
return e === null ? !1 :
|
|
3691
|
+
return e === null ? !1 : fe._equals(this, e);
|
|
3692
3692
|
}
|
|
3693
3693
|
static _equals(e, n) {
|
|
3694
3694
|
return e === n ? !0 : this._structuralEquals(e, n) ? Fe.equals(e.contentNameScopesList, n.contentNameScopesList) : !1;
|
|
@@ -3713,7 +3713,7 @@ var Fe = class ne {
|
|
|
3713
3713
|
e._enterPos = -1, e._anchorPos = -1, e = e.parent;
|
|
3714
3714
|
}
|
|
3715
3715
|
reset() {
|
|
3716
|
-
|
|
3716
|
+
fe._reset(this);
|
|
3717
3717
|
}
|
|
3718
3718
|
pop() {
|
|
3719
3719
|
return this.parent;
|
|
@@ -3722,7 +3722,7 @@ var Fe = class ne {
|
|
|
3722
3722
|
return this.parent ? this.parent : this;
|
|
3723
3723
|
}
|
|
3724
3724
|
push(e, n, r, o, s, a, i) {
|
|
3725
|
-
return new
|
|
3725
|
+
return new fe(
|
|
3726
3726
|
this,
|
|
3727
3727
|
e,
|
|
3728
3728
|
n,
|
|
@@ -3761,7 +3761,7 @@ var Fe = class ne {
|
|
|
3761
3761
|
);
|
|
3762
3762
|
}
|
|
3763
3763
|
withEndRule(e) {
|
|
3764
|
-
return this.endRule === e ? this : new
|
|
3764
|
+
return this.endRule === e ? this : new fe(
|
|
3765
3765
|
this.parent,
|
|
3766
3766
|
this.ruleId,
|
|
3767
3767
|
this._enterPos,
|
|
@@ -3793,7 +3793,7 @@ var Fe = class ne {
|
|
|
3793
3793
|
}
|
|
3794
3794
|
static pushFrame(e, n) {
|
|
3795
3795
|
const r = Fe.fromExtension(e?.nameScopesList ?? null, n.nameScopesList);
|
|
3796
|
-
return new
|
|
3796
|
+
return new fe(
|
|
3797
3797
|
e,
|
|
3798
3798
|
n.ruleId,
|
|
3799
3799
|
n.enterPos ?? -1,
|
|
@@ -4237,7 +4237,7 @@ const co = Ne({
|
|
|
4237
4237
|
function ho(t, e) {
|
|
4238
4238
|
return e in t ? t[e] : e;
|
|
4239
4239
|
}
|
|
4240
|
-
function
|
|
4240
|
+
function fo(t, e) {
|
|
4241
4241
|
return ho(t, e.toLowerCase());
|
|
4242
4242
|
}
|
|
4243
4243
|
const Ja = Ne({
|
|
@@ -4600,7 +4600,7 @@ const Ja = Ne({
|
|
|
4600
4600
|
unselectable: null
|
|
4601
4601
|
},
|
|
4602
4602
|
space: "html",
|
|
4603
|
-
transform:
|
|
4603
|
+
transform: fo
|
|
4604
4604
|
}), Za = Ne({
|
|
4605
4605
|
attributes: {
|
|
4606
4606
|
accentHeight: "accent-height",
|
|
@@ -5160,7 +5160,7 @@ const Ja = Ne({
|
|
|
5160
5160
|
},
|
|
5161
5161
|
space: "svg",
|
|
5162
5162
|
transform: ho
|
|
5163
|
-
}),
|
|
5163
|
+
}), po = Ne({
|
|
5164
5164
|
properties: {
|
|
5165
5165
|
xLinkActuate: null,
|
|
5166
5166
|
xLinkArcRole: null,
|
|
@@ -5178,7 +5178,7 @@ const Ja = Ne({
|
|
|
5178
5178
|
attributes: { xmlnsxlink: "xmlns:xlink" },
|
|
5179
5179
|
properties: { xmlnsXLink: null, xmlns: null },
|
|
5180
5180
|
space: "xmlns",
|
|
5181
|
-
transform:
|
|
5181
|
+
transform: fo
|
|
5182
5182
|
}), mo = Ne({
|
|
5183
5183
|
properties: { xmlBase: null, xmlLang: null, xmlSpace: null },
|
|
5184
5184
|
space: "xml",
|
|
@@ -5212,7 +5212,7 @@ function ni(t) {
|
|
|
5212
5212
|
function ri(t) {
|
|
5213
5213
|
return t.charAt(1).toUpperCase();
|
|
5214
5214
|
}
|
|
5215
|
-
const oi = uo([co, Ja,
|
|
5215
|
+
const oi = uo([co, Ja, po, go, mo], "html"), yo = uo([co, Za, po, go, mo], "svg"), si = /["&'<>`]/g, ai = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, ii = (
|
|
5216
5216
|
// eslint-disable-next-line no-control-regex, unicorn/no-hex-escape
|
|
5217
5217
|
/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g
|
|
5218
5218
|
), li = /[|\\{}()[\]^$+*?.]/g, Zn = /* @__PURE__ */ new WeakMap();
|
|
@@ -5249,10 +5249,10 @@ function hi(t) {
|
|
|
5249
5249
|
e.push(t[n].replace(li, "\\$&"));
|
|
5250
5250
|
return new RegExp("(?:" + e.join("|") + ")", "g");
|
|
5251
5251
|
}
|
|
5252
|
-
const
|
|
5253
|
-
function
|
|
5252
|
+
const fi = /[\dA-Fa-f]/;
|
|
5253
|
+
function pi(t, e, n) {
|
|
5254
5254
|
const r = "&#x" + t.toString(16).toUpperCase();
|
|
5255
|
-
return n && e && !
|
|
5255
|
+
return n && e && !fi.test(String.fromCharCode(e)) ? r : r + ";";
|
|
5256
5256
|
}
|
|
5257
5257
|
const di = /\d/;
|
|
5258
5258
|
function gi(t, e, n) {
|
|
@@ -5642,7 +5642,7 @@ function wi(t, e, n, r) {
|
|
|
5642
5642
|
return "";
|
|
5643
5643
|
}
|
|
5644
5644
|
function Ci(t, e, n) {
|
|
5645
|
-
let r =
|
|
5645
|
+
let r = pi(t, e, n.omitOptionalSemicolons), o;
|
|
5646
5646
|
if ((n.useNamedReferences || n.useShortestReferences) && (o = wi(
|
|
5647
5647
|
t,
|
|
5648
5648
|
e,
|
|
@@ -5972,7 +5972,7 @@ function al(t) {
|
|
|
5972
5972
|
e[r] = this.one(n[r], r, t);
|
|
5973
5973
|
return e.join("");
|
|
5974
5974
|
}
|
|
5975
|
-
function
|
|
5975
|
+
function ft(t, e) {
|
|
5976
5976
|
const n = typeof t == "string" ? {} : { ...t.colorReplacements }, r = typeof t == "string" ? t : t.name;
|
|
5977
5977
|
for (const [o, s] of Object.entries(e?.colorReplacements || {}))
|
|
5978
5978
|
typeof s == "string" ? n[o] = s : o === r && Object.assign(n, s);
|
|
@@ -6062,40 +6062,40 @@ function hl(t, e) {
|
|
|
6062
6062
|
offset: t.offset + n
|
|
6063
6063
|
}), r;
|
|
6064
6064
|
}
|
|
6065
|
-
function
|
|
6065
|
+
function fl(t, e) {
|
|
6066
6066
|
const n = Array.from(e instanceof Set ? e : new Set(e)).sort((r, o) => r - o);
|
|
6067
6067
|
return n.length ? t.map((r) => r.flatMap((o) => {
|
|
6068
6068
|
const s = n.filter((a) => o.offset < a && a < o.offset + o.content.length).map((a) => a - o.offset).sort((a, i) => a - i);
|
|
6069
6069
|
return s.length ? hl(o, s) : o;
|
|
6070
6070
|
})) : t;
|
|
6071
6071
|
}
|
|
6072
|
-
function
|
|
6072
|
+
function pl(t, e, n, r, o = "css-vars") {
|
|
6073
6073
|
const s = {
|
|
6074
6074
|
content: t.content,
|
|
6075
6075
|
explanation: t.explanation,
|
|
6076
6076
|
offset: t.offset
|
|
6077
|
-
}, a = e.map((c) =>
|
|
6078
|
-
const
|
|
6079
|
-
return n + e[c] + (h === "color" ? "" :
|
|
6077
|
+
}, a = e.map((c) => pt(t.variants[c])), i = new Set(a.flatMap((c) => Object.keys(c))), l = {}, u = (c, h) => {
|
|
6078
|
+
const p = h === "color" ? "" : h === "background-color" ? "-bg" : `-${h}`;
|
|
6079
|
+
return n + e[c] + (h === "color" ? "" : p);
|
|
6080
6080
|
};
|
|
6081
6081
|
return a.forEach((c, h) => {
|
|
6082
|
-
for (const
|
|
6083
|
-
const d = c[
|
|
6084
|
-
if (h === 0 && r && cl.includes(
|
|
6082
|
+
for (const p of i) {
|
|
6083
|
+
const d = c[p] || "inherit";
|
|
6084
|
+
if (h === 0 && r && cl.includes(p))
|
|
6085
6085
|
if (r === _n && a.length > 1) {
|
|
6086
|
-
const
|
|
6087
|
-
if (
|
|
6086
|
+
const f = e.findIndex((m) => m === "light"), g = e.findIndex((m) => m === "dark");
|
|
6087
|
+
if (f === -1 || g === -1)
|
|
6088
6088
|
throw new F('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');
|
|
6089
|
-
const C = a[
|
|
6090
|
-
l[
|
|
6089
|
+
const C = a[f][p] || "inherit", y = a[g][p] || "inherit";
|
|
6090
|
+
l[p] = `light-dark(${C}, ${y})`, o === "css-vars" && (l[u(h, p)] = d);
|
|
6091
6091
|
} else
|
|
6092
|
-
l[
|
|
6092
|
+
l[p] = d;
|
|
6093
6093
|
else
|
|
6094
|
-
o === "css-vars" && (l[u(h,
|
|
6094
|
+
o === "css-vars" && (l[u(h, p)] = d);
|
|
6095
6095
|
}
|
|
6096
6096
|
}), s.htmlStyle = l, s;
|
|
6097
6097
|
}
|
|
6098
|
-
function
|
|
6098
|
+
function pt(t) {
|
|
6099
6099
|
const e = {};
|
|
6100
6100
|
if (t.color && (e.color = t.color), t.bgColor && (e["background-color"] = t.bgColor), t.fontStyle) {
|
|
6101
6101
|
t.fontStyle & z.Italic && (e["font-style"] = "italic"), t.fontStyle & z.Bold && (e["font-weight"] = "bold");
|
|
@@ -6225,7 +6225,7 @@ function ml() {
|
|
|
6225
6225
|
if (!this.options.decorations?.length)
|
|
6226
6226
|
return;
|
|
6227
6227
|
const o = e(this).decorations.flatMap((a) => [a.start.offset, a.end.offset]);
|
|
6228
|
-
return
|
|
6228
|
+
return fl(n, o);
|
|
6229
6229
|
},
|
|
6230
6230
|
code(n) {
|
|
6231
6231
|
if (!this.options.decorations?.length)
|
|
@@ -6233,19 +6233,19 @@ function ml() {
|
|
|
6233
6233
|
const r = e(this), o = Array.from(n.children).filter((c) => c.type === "element" && c.tagName === "span");
|
|
6234
6234
|
if (o.length !== r.converter.lines.length)
|
|
6235
6235
|
throw new F(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);
|
|
6236
|
-
function s(c, h,
|
|
6237
|
-
const
|
|
6236
|
+
function s(c, h, p, d) {
|
|
6237
|
+
const f = o[c];
|
|
6238
6238
|
let g = "", C = -1, y = -1;
|
|
6239
|
-
if (h === 0 && (C = 0),
|
|
6240
|
-
for (let _ = 0; _ <
|
|
6241
|
-
g += Ao(
|
|
6239
|
+
if (h === 0 && (C = 0), p === 0 && (y = 0), p === Number.POSITIVE_INFINITY && (y = f.children.length), C === -1 || y === -1)
|
|
6240
|
+
for (let _ = 0; _ < f.children.length; _++)
|
|
6241
|
+
g += Ao(f.children[_]), C === -1 && g.length === h && (C = _ + 1), y === -1 && g.length === p && (y = _ + 1);
|
|
6242
6242
|
if (C === -1)
|
|
6243
6243
|
throw new F(`Failed to find start index for decoration ${JSON.stringify(d.start)}`);
|
|
6244
6244
|
if (y === -1)
|
|
6245
6245
|
throw new F(`Failed to find end index for decoration ${JSON.stringify(d.end)}`);
|
|
6246
|
-
const m =
|
|
6247
|
-
if (!d.alwaysWrap && m.length ===
|
|
6248
|
-
i(
|
|
6246
|
+
const m = f.children.slice(C, y);
|
|
6247
|
+
if (!d.alwaysWrap && m.length === f.children.length)
|
|
6248
|
+
i(f, d, "line");
|
|
6249
6249
|
else if (!d.alwaysWrap && m.length === 1 && m[0].type === "element")
|
|
6250
6250
|
i(m[0], d, "token");
|
|
6251
6251
|
else {
|
|
@@ -6255,30 +6255,30 @@ function ml() {
|
|
|
6255
6255
|
properties: {},
|
|
6256
6256
|
children: m
|
|
6257
6257
|
};
|
|
6258
|
-
i(_, d, "wrapper"),
|
|
6258
|
+
i(_, d, "wrapper"), f.children.splice(C, m.length, _);
|
|
6259
6259
|
}
|
|
6260
6260
|
}
|
|
6261
6261
|
function a(c, h) {
|
|
6262
6262
|
o[c] = i(o[c], h, "line");
|
|
6263
6263
|
}
|
|
6264
|
-
function i(c, h,
|
|
6265
|
-
const d = h.properties || {},
|
|
6264
|
+
function i(c, h, p) {
|
|
6265
|
+
const d = h.properties || {}, f = h.transform || ((g) => g);
|
|
6266
6266
|
return c.tagName = h.tagName || "span", c.properties = {
|
|
6267
6267
|
...c.properties,
|
|
6268
6268
|
...d,
|
|
6269
6269
|
class: c.properties.class
|
|
6270
|
-
}, h.properties?.class && xo(c, h.properties.class), c =
|
|
6270
|
+
}, h.properties?.class && xo(c, h.properties.class), c = f(c, p) || c, c;
|
|
6271
6271
|
}
|
|
6272
6272
|
const l = [], u = r.decorations.sort((c, h) => h.start.offset - c.start.offset || c.end.offset - h.end.offset);
|
|
6273
6273
|
for (const c of u) {
|
|
6274
|
-
const { start: h, end:
|
|
6275
|
-
if (h.line ===
|
|
6276
|
-
s(h.line, h.character,
|
|
6277
|
-
else if (h.line <
|
|
6274
|
+
const { start: h, end: p } = c;
|
|
6275
|
+
if (h.line === p.line)
|
|
6276
|
+
s(h.line, h.character, p.character, c);
|
|
6277
|
+
else if (h.line < p.line) {
|
|
6278
6278
|
s(h.line, h.character, Number.POSITIVE_INFINITY, c);
|
|
6279
|
-
for (let d = h.line + 1; d <
|
|
6279
|
+
for (let d = h.line + 1; d < p.line; d++)
|
|
6280
6280
|
l.unshift(() => a(d, c));
|
|
6281
|
-
s(
|
|
6281
|
+
s(p.line, 0, p.character, c);
|
|
6282
6282
|
}
|
|
6283
6283
|
}
|
|
6284
6284
|
l.forEach((c) => c());
|
|
@@ -6293,7 +6293,7 @@ function yl(t) {
|
|
|
6293
6293
|
for (let r = e + 1; r < t.length; r++) {
|
|
6294
6294
|
const o = t[r], s = n.start.offset <= o.start.offset && o.start.offset < n.end.offset, a = n.start.offset < o.end.offset && o.end.offset <= n.end.offset, i = o.start.offset <= n.start.offset && n.start.offset < o.end.offset, l = o.start.offset < n.end.offset && n.end.offset <= o.end.offset;
|
|
6295
6295
|
if (s || a || i || l) {
|
|
6296
|
-
if (s && a || i && l)
|
|
6296
|
+
if (s && a || i && l || i && n.start.offset === n.end.offset || a && o.start.offset === o.end.offset)
|
|
6297
6297
|
continue;
|
|
6298
6298
|
throw new F(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`);
|
|
6299
6299
|
}
|
|
@@ -6521,7 +6521,7 @@ function kl(t = Sl) {
|
|
|
6521
6521
|
};
|
|
6522
6522
|
}
|
|
6523
6523
|
function vl(t, e, n) {
|
|
6524
|
-
const r =
|
|
6524
|
+
const r = ft(t, n), o = St(e), s = kl(
|
|
6525
6525
|
Object.fromEntries(
|
|
6526
6526
|
de.map((i) => [
|
|
6527
6527
|
i,
|
|
@@ -6601,7 +6601,7 @@ function Al(t, e, n, r, o) {
|
|
|
6601
6601
|
return kt(s.tokens, a), s.tokens;
|
|
6602
6602
|
}
|
|
6603
6603
|
function gt(t, e, n, r, o) {
|
|
6604
|
-
const s =
|
|
6604
|
+
const s = ft(n, o), {
|
|
6605
6605
|
tokenizeMaxLineLength: a = 0,
|
|
6606
6606
|
tokenizeTimeLimit: i = 500
|
|
6607
6607
|
} = o, l = St(t);
|
|
@@ -6617,15 +6617,15 @@ function gt(t, e, n, r, o) {
|
|
|
6617
6617
|
}
|
|
6618
6618
|
).stateStack : Zt, c = [];
|
|
6619
6619
|
const h = [];
|
|
6620
|
-
for (let
|
|
6621
|
-
const [
|
|
6622
|
-
if (
|
|
6620
|
+
for (let p = 0, d = l.length; p < d; p++) {
|
|
6621
|
+
const [f, g] = l[p];
|
|
6622
|
+
if (f === "") {
|
|
6623
6623
|
c = [], h.push([]);
|
|
6624
6624
|
continue;
|
|
6625
6625
|
}
|
|
6626
|
-
if (a > 0 &&
|
|
6626
|
+
if (a > 0 && f.length >= a) {
|
|
6627
6627
|
c = [], h.push([{
|
|
6628
|
-
content:
|
|
6628
|
+
content: f,
|
|
6629
6629
|
offset: g,
|
|
6630
6630
|
color: "",
|
|
6631
6631
|
fontStyle: 0
|
|
@@ -6633,17 +6633,17 @@ function gt(t, e, n, r, o) {
|
|
|
6633
6633
|
continue;
|
|
6634
6634
|
}
|
|
6635
6635
|
let C, y, m;
|
|
6636
|
-
o.includeExplanation && (C = e.tokenizeLine(
|
|
6637
|
-
const _ = e.tokenizeLine2(
|
|
6636
|
+
o.includeExplanation && (C = e.tokenizeLine(f, u, i), y = C.tokens, m = 0);
|
|
6637
|
+
const _ = e.tokenizeLine2(f, u, i), S = _.tokens.length / 2;
|
|
6638
6638
|
for (let A = 0; A < S; A++) {
|
|
6639
|
-
const D = _.tokens[2 * A], L = A + 1 < S ? _.tokens[2 * A + 2] :
|
|
6639
|
+
const D = _.tokens[2 * A], L = A + 1 < S ? _.tokens[2 * A + 2] : f.length;
|
|
6640
6640
|
if (D === L)
|
|
6641
6641
|
continue;
|
|
6642
6642
|
const j = _.tokens[2 * A + 1], Z = ue(
|
|
6643
6643
|
r[Re.getForeground(j)],
|
|
6644
6644
|
s
|
|
6645
6645
|
), ee = Re.getFontStyle(j), ce = {
|
|
6646
|
-
content:
|
|
6646
|
+
content: f.substring(D, L),
|
|
6647
6647
|
offset: g + D,
|
|
6648
6648
|
color: Z,
|
|
6649
6649
|
fontStyle: ee
|
|
@@ -6671,7 +6671,7 @@ function gt(t, e, n, r, o) {
|
|
|
6671
6671
|
ce.explanation = [];
|
|
6672
6672
|
let R = 0;
|
|
6673
6673
|
for (; D + R < L; ) {
|
|
6674
|
-
const k = y[m], G =
|
|
6674
|
+
const k = y[m], G = f.substring(
|
|
6675
6675
|
k.startIndex,
|
|
6676
6676
|
k.endIndex
|
|
6677
6677
|
);
|
|
@@ -6745,20 +6745,20 @@ function Ro(t, e, n) {
|
|
|
6745
6745
|
...o.map((l) => l.tokens)
|
|
6746
6746
|
), a = s[0].map(
|
|
6747
6747
|
(l, u) => l.map((c, h) => {
|
|
6748
|
-
const
|
|
6748
|
+
const p = {
|
|
6749
6749
|
content: c.content,
|
|
6750
6750
|
variants: {},
|
|
6751
6751
|
offset: c.offset
|
|
6752
6752
|
};
|
|
6753
|
-
return "includeExplanation" in n && n.includeExplanation && (
|
|
6753
|
+
return "includeExplanation" in n && n.includeExplanation && (p.explanation = c.explanation), s.forEach((d, f) => {
|
|
6754
6754
|
const {
|
|
6755
6755
|
content: g,
|
|
6756
6756
|
explanation: C,
|
|
6757
6757
|
offset: y,
|
|
6758
6758
|
...m
|
|
6759
6759
|
} = d[u][h];
|
|
6760
|
-
|
|
6761
|
-
}),
|
|
6760
|
+
p.variants[r[f].color] = m;
|
|
6761
|
+
}), p;
|
|
6762
6762
|
})
|
|
6763
6763
|
), i = o[0].state ? new Le(
|
|
6764
6764
|
Object.fromEntries(o.map((l) => [l.theme, l.state?.getInternalStack(l.theme)])),
|
|
@@ -6796,22 +6796,22 @@ function mt(t, e, n) {
|
|
|
6796
6796
|
defaultColor: u = "light",
|
|
6797
6797
|
cssVariablePrefix: c = "--shiki-",
|
|
6798
6798
|
colorsRendering: h = "css-vars"
|
|
6799
|
-
} = n,
|
|
6800
|
-
if (
|
|
6799
|
+
} = n, p = Object.entries(n.themes).filter((y) => y[1]).map((y) => ({ color: y[0], theme: y[1] })).sort((y, m) => y.color === u ? -1 : m.color === u ? 1 : 0);
|
|
6800
|
+
if (p.length === 0)
|
|
6801
6801
|
throw new F("`themes` option must not be empty");
|
|
6802
6802
|
const d = Ro(
|
|
6803
6803
|
t,
|
|
6804
6804
|
e,
|
|
6805
6805
|
n
|
|
6806
6806
|
);
|
|
6807
|
-
if (l = We(d), u && _n !== u && !
|
|
6807
|
+
if (l = We(d), u && _n !== u && !p.find((y) => y.color === u))
|
|
6808
6808
|
throw new F(`\`themes\` option must contain the defaultColor key \`${u}\``);
|
|
6809
|
-
const
|
|
6810
|
-
s = d.map((y) => y.map((m) =>
|
|
6811
|
-
const C =
|
|
6812
|
-
o = rr(
|
|
6809
|
+
const f = p.map((y) => t.getTheme(y.theme)), g = p.map((y) => y.color);
|
|
6810
|
+
s = d.map((y) => y.map((m) => pl(m, g, c, u, h))), l && kt(s, l);
|
|
6811
|
+
const C = p.map((y) => ft(y.theme, n));
|
|
6812
|
+
o = rr(p, f, C, c, u, "fg", h), r = rr(p, f, C, c, u, "bg", h), a = `shiki-themes ${f.map((y) => y.name).join(" ")}`, i = u ? void 0 : [o, r].join(";");
|
|
6813
6813
|
} else if ("theme" in n) {
|
|
6814
|
-
const u =
|
|
6814
|
+
const u = ft(n.theme, n);
|
|
6815
6815
|
s = Sn(
|
|
6816
6816
|
t,
|
|
6817
6817
|
e,
|
|
@@ -6835,11 +6835,11 @@ function rr(t, e, n, r, o, s, a) {
|
|
|
6835
6835
|
const u = ue(e[l][s], n[l]) || "inherit", c = `${r + i.color}${s === "bg" ? "-bg" : ""}:${u}`;
|
|
6836
6836
|
if (l === 0 && o) {
|
|
6837
6837
|
if (o === _n && t.length > 1) {
|
|
6838
|
-
const h = t.findIndex((g) => g.color === "light"),
|
|
6839
|
-
if (h === -1 ||
|
|
6838
|
+
const h = t.findIndex((g) => g.color === "light"), p = t.findIndex((g) => g.color === "dark");
|
|
6839
|
+
if (h === -1 || p === -1)
|
|
6840
6840
|
throw new F('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');
|
|
6841
|
-
const d = ue(e[h][s], n[h]) || "inherit",
|
|
6842
|
-
return `light-dark(${d}, ${
|
|
6841
|
+
const d = ue(e[h][s], n[h]) || "inherit", f = ue(e[p][s], n[p]) || "inherit";
|
|
6842
|
+
return `light-dark(${d}, ${f});${c}`;
|
|
6843
6843
|
}
|
|
6844
6844
|
return u;
|
|
6845
6845
|
}
|
|
@@ -6853,8 +6853,8 @@ function yt(t, e, n, r = {
|
|
|
6853
6853
|
codeToTokens: (o, s) => mt(t, o, s)
|
|
6854
6854
|
}) {
|
|
6855
6855
|
let o = e;
|
|
6856
|
-
for (const
|
|
6857
|
-
o =
|
|
6856
|
+
for (const f of dt(n))
|
|
6857
|
+
o = f.preprocess?.call(r, o, n) || o;
|
|
6858
6858
|
let {
|
|
6859
6859
|
tokens: s,
|
|
6860
6860
|
fg: a,
|
|
@@ -6865,17 +6865,17 @@ function yt(t, e, n, r = {
|
|
|
6865
6865
|
} = mt(t, o, n);
|
|
6866
6866
|
const {
|
|
6867
6867
|
mergeWhitespaces: h = !0,
|
|
6868
|
-
mergeSameStyleTokens:
|
|
6868
|
+
mergeSameStyleTokens: p = !1
|
|
6869
6869
|
} = n;
|
|
6870
|
-
h === !0 ? s = Tl(s) : h === "never" && (s = Ml(s)),
|
|
6870
|
+
h === !0 ? s = Tl(s) : h === "never" && (s = Ml(s)), p && (s = Ol(s));
|
|
6871
6871
|
const d = {
|
|
6872
6872
|
...r,
|
|
6873
6873
|
get source() {
|
|
6874
6874
|
return o;
|
|
6875
6875
|
}
|
|
6876
6876
|
};
|
|
6877
|
-
for (const
|
|
6878
|
-
s =
|
|
6877
|
+
for (const f of dt(n))
|
|
6878
|
+
s = f.tokens?.call(d, s) || s;
|
|
6879
6879
|
return $l(
|
|
6880
6880
|
s,
|
|
6881
6881
|
{
|
|
@@ -6909,7 +6909,7 @@ function $l(t, e, n, r = We(t)) {
|
|
|
6909
6909
|
...Object.fromEntries(
|
|
6910
6910
|
Array.from(
|
|
6911
6911
|
Object.entries(e.meta || {})
|
|
6912
|
-
).filter(([
|
|
6912
|
+
).filter(([f]) => !f.startsWith("_"))
|
|
6913
6913
|
)
|
|
6914
6914
|
},
|
|
6915
6915
|
children: []
|
|
@@ -6919,7 +6919,7 @@ function $l(t, e, n, r = We(t)) {
|
|
|
6919
6919
|
properties: {},
|
|
6920
6920
|
children: s
|
|
6921
6921
|
};
|
|
6922
|
-
const h = [],
|
|
6922
|
+
const h = [], p = {
|
|
6923
6923
|
...n,
|
|
6924
6924
|
structure: i,
|
|
6925
6925
|
addClassToHast: xo,
|
|
@@ -6945,7 +6945,7 @@ function $l(t, e, n, r = We(t)) {
|
|
|
6945
6945
|
return h;
|
|
6946
6946
|
}
|
|
6947
6947
|
};
|
|
6948
|
-
if (t.forEach((
|
|
6948
|
+
if (t.forEach((f, g) => {
|
|
6949
6949
|
g && (i === "inline" ? a.children.push({ type: "element", tagName: "br", properties: {}, children: [] }) : i === "classic" && s.push({ type: "text", value: `
|
|
6950
6950
|
` }));
|
|
6951
6951
|
let C = {
|
|
@@ -6954,7 +6954,7 @@ function $l(t, e, n, r = We(t)) {
|
|
|
6954
6954
|
properties: { class: "line" },
|
|
6955
6955
|
children: []
|
|
6956
6956
|
}, y = 0;
|
|
6957
|
-
for (const m of
|
|
6957
|
+
for (const m of f) {
|
|
6958
6958
|
let _ = {
|
|
6959
6959
|
type: "element",
|
|
6960
6960
|
tagName: "span",
|
|
@@ -6963,28 +6963,28 @@ function $l(t, e, n, r = We(t)) {
|
|
|
6963
6963
|
},
|
|
6964
6964
|
children: [{ type: "text", value: m.content }]
|
|
6965
6965
|
};
|
|
6966
|
-
const S = rn(m.htmlStyle ||
|
|
6966
|
+
const S = rn(m.htmlStyle || pt(m));
|
|
6967
6967
|
S && (_.properties.style = S);
|
|
6968
6968
|
for (const A of o)
|
|
6969
|
-
_ = A?.span?.call(
|
|
6969
|
+
_ = A?.span?.call(p, _, g + 1, y, C, m) || _;
|
|
6970
6970
|
i === "inline" ? a.children.push(_) : i === "classic" && C.children.push(_), y += m.content.length;
|
|
6971
6971
|
}
|
|
6972
6972
|
if (i === "classic") {
|
|
6973
6973
|
for (const m of o)
|
|
6974
|
-
C = m?.line?.call(
|
|
6974
|
+
C = m?.line?.call(p, C, g + 1) || C;
|
|
6975
6975
|
h.push(C), s.push(C);
|
|
6976
6976
|
}
|
|
6977
6977
|
}), i === "classic") {
|
|
6978
|
-
for (const
|
|
6979
|
-
c =
|
|
6978
|
+
for (const f of o)
|
|
6979
|
+
c = f?.code?.call(p, c) || c;
|
|
6980
6980
|
u.children.push(c);
|
|
6981
|
-
for (const
|
|
6982
|
-
u =
|
|
6981
|
+
for (const f of o)
|
|
6982
|
+
u = f?.pre?.call(p, u) || u;
|
|
6983
6983
|
a.children.push(u);
|
|
6984
6984
|
}
|
|
6985
6985
|
let d = a;
|
|
6986
|
-
for (const
|
|
6987
|
-
d =
|
|
6986
|
+
for (const f of o)
|
|
6987
|
+
d = f?.root?.call(p, d) || d;
|
|
6988
6988
|
return r && kt(d, r), d;
|
|
6989
6989
|
}
|
|
6990
6990
|
function Tl(t) {
|
|
@@ -7039,7 +7039,7 @@ function Ol(t) {
|
|
|
7039
7039
|
n.push({ ...r });
|
|
7040
7040
|
continue;
|
|
7041
7041
|
}
|
|
7042
|
-
const o = n[n.length - 1], s = rn(o.htmlStyle ||
|
|
7042
|
+
const o = n[n.length - 1], s = rn(o.htmlStyle || pt(o)), a = rn(r.htmlStyle || pt(r)), i = o.fontStyle && (o.fontStyle & z.Underline || o.fontStyle & z.Strikethrough), l = r.fontStyle && (r.fontStyle & z.Underline || r.fontStyle & z.Strikethrough);
|
|
7043
7043
|
!i && !l && s === a ? o.content += r.content : n.push({ ...r });
|
|
7044
7044
|
}
|
|
7045
7045
|
return n;
|
|
@@ -7302,19 +7302,19 @@ function zl(t) {
|
|
|
7302
7302
|
function h() {
|
|
7303
7303
|
return C(), s.getLoadedLanguages();
|
|
7304
7304
|
}
|
|
7305
|
-
function
|
|
7305
|
+
function p(...m) {
|
|
7306
7306
|
C(), s.loadLanguages(m.flat(1));
|
|
7307
7307
|
}
|
|
7308
7308
|
async function d(...m) {
|
|
7309
|
-
return
|
|
7309
|
+
return p(await Io(m));
|
|
7310
7310
|
}
|
|
7311
|
-
function
|
|
7311
|
+
function f(...m) {
|
|
7312
7312
|
C();
|
|
7313
7313
|
for (const _ of m.flat(1))
|
|
7314
7314
|
s.loadTheme(_);
|
|
7315
7315
|
}
|
|
7316
7316
|
async function g(...m) {
|
|
7317
|
-
return C(),
|
|
7317
|
+
return C(), f(await No(m));
|
|
7318
7318
|
}
|
|
7319
7319
|
function C() {
|
|
7320
7320
|
if (e)
|
|
@@ -7330,9 +7330,9 @@ function zl(t) {
|
|
|
7330
7330
|
getLoadedThemes: c,
|
|
7331
7331
|
getLoadedLanguages: h,
|
|
7332
7332
|
loadLanguage: d,
|
|
7333
|
-
loadLanguageSync:
|
|
7333
|
+
loadLanguageSync: p,
|
|
7334
7334
|
loadTheme: g,
|
|
7335
|
-
loadThemeSync:
|
|
7335
|
+
loadThemeSync: f,
|
|
7336
7336
|
dispose: y,
|
|
7337
7337
|
[Symbol.dispose]: y
|
|
7338
7338
|
};
|
|
@@ -7420,8 +7420,8 @@ function Yl(t, e) {
|
|
|
7420
7420
|
lazy: c = !1,
|
|
7421
7421
|
...h
|
|
7422
7422
|
} = e;
|
|
7423
|
-
function
|
|
7424
|
-
const y = `${d}:${g}:${
|
|
7423
|
+
function p(d, f, g = "", C = {}) {
|
|
7424
|
+
const y = `${d}:${g}:${f}`, m = o?.get(y);
|
|
7425
7425
|
if (m)
|
|
7426
7426
|
return m;
|
|
7427
7427
|
const _ = {
|
|
@@ -7441,10 +7441,10 @@ function Yl(t, e) {
|
|
|
7441
7441
|
return this.addClassToHast(S, `${Kl}${d}`), S;
|
|
7442
7442
|
}
|
|
7443
7443
|
}
|
|
7444
|
-
]), l &&
|
|
7445
|
-
`) && (
|
|
7444
|
+
]), l && f.endsWith(`
|
|
7445
|
+
`) && (f = f.slice(0, -1));
|
|
7446
7446
|
try {
|
|
7447
|
-
const S = t.codeToHast(
|
|
7447
|
+
const S = t.codeToHast(f, _);
|
|
7448
7448
|
return o?.set(y, S), S;
|
|
7449
7449
|
} catch (S) {
|
|
7450
7450
|
if (i)
|
|
@@ -7454,7 +7454,7 @@ function Yl(t, e) {
|
|
|
7454
7454
|
}
|
|
7455
7455
|
}
|
|
7456
7456
|
return (d) => {
|
|
7457
|
-
const
|
|
7457
|
+
const f = [];
|
|
7458
7458
|
if (qr(d, "element", (g, C, y) => {
|
|
7459
7459
|
let m;
|
|
7460
7460
|
if (!y || C == null)
|
|
@@ -7472,7 +7472,7 @@ function Yl(t, e) {
|
|
|
7472
7472
|
if (_.lang ? t.getLoadedLanguages().includes(_.lang) || vo(_.lang) ? S = _.lang : c ? (A = !0, S = _.lang) : a && (S = a) : S = s, !S)
|
|
7473
7473
|
return;
|
|
7474
7474
|
const D = _.meta ? r?.(_.meta, g, d) : void 0, L = (j) => {
|
|
7475
|
-
const Z =
|
|
7475
|
+
const Z = p(j, _.code, _.meta, D ?? {});
|
|
7476
7476
|
if (Z) {
|
|
7477
7477
|
if (_.type === "inline") {
|
|
7478
7478
|
const ee = Z.children[0];
|
|
@@ -7483,7 +7483,7 @@ function Yl(t, e) {
|
|
|
7483
7483
|
};
|
|
7484
7484
|
if (A)
|
|
7485
7485
|
try {
|
|
7486
|
-
|
|
7486
|
+
f.push(t.loadLanguage(S).then(() => L(S)));
|
|
7487
7487
|
} catch (j) {
|
|
7488
7488
|
if (a)
|
|
7489
7489
|
return L(a);
|
|
@@ -7494,9 +7494,9 @@ function Yl(t, e) {
|
|
|
7494
7494
|
else
|
|
7495
7495
|
L(S);
|
|
7496
7496
|
return "skip";
|
|
7497
|
-
}),
|
|
7497
|
+
}), f.length > 0) {
|
|
7498
7498
|
async function g() {
|
|
7499
|
-
await Promise.all(
|
|
7499
|
+
await Promise.all(f);
|
|
7500
7500
|
}
|
|
7501
7501
|
return g();
|
|
7502
7502
|
}
|
|
@@ -7630,8 +7630,8 @@ function ru(t, e = {}) {
|
|
|
7630
7630
|
let u = 0;
|
|
7631
7631
|
a.filter((h) => h.type === "GroupOpen").forEach((h) => {
|
|
7632
7632
|
h.kind === "capturing" ? h.number = ++u : h.raw === "(" && l.push(h);
|
|
7633
|
-
}), u || l.forEach((h,
|
|
7634
|
-
h.kind = "capturing", h.number =
|
|
7633
|
+
}), u || l.forEach((h, p) => {
|
|
7634
|
+
h.kind = "capturing", h.number = p + 1;
|
|
7635
7635
|
});
|
|
7636
7636
|
const c = u || l.length;
|
|
7637
7637
|
return { tokens: a.map((h) => h.type === "EscapedNumber" ? vu(h, c) : h).flat(), flags: r };
|
|
@@ -7679,7 +7679,7 @@ function ou(t, e, n, r) {
|
|
|
7679
7679
|
}
|
|
7680
7680
|
if (n === ")") {
|
|
7681
7681
|
if (t.popModX(), t.numOpenGroups--, t.numOpenGroups < 0) throw new Error('Unmatched ")"');
|
|
7682
|
-
return { token:
|
|
7682
|
+
return { token: fu(n) };
|
|
7683
7683
|
}
|
|
7684
7684
|
if (t.getCurrentModX()) {
|
|
7685
7685
|
if (n === "#") {
|
|
@@ -7783,13 +7783,13 @@ function Do(t, e, n = {}) {
|
|
|
7783
7783
|
function hu(t, e) {
|
|
7784
7784
|
return { type: "EscapedNumber", inCharClass: t, raw: e };
|
|
7785
7785
|
}
|
|
7786
|
-
function
|
|
7786
|
+
function fu(t) {
|
|
7787
7787
|
return { type: "GroupClose", raw: t };
|
|
7788
7788
|
}
|
|
7789
7789
|
function Se(t, e, n = {}) {
|
|
7790
7790
|
return { type: "GroupOpen", kind: t, ...n, raw: e };
|
|
7791
7791
|
}
|
|
7792
|
-
function
|
|
7792
|
+
function pu(t, e, n, r) {
|
|
7793
7793
|
return { type: "NamedCallout", kind: t, tag: e, arguments: n, raw: r };
|
|
7794
7794
|
}
|
|
7795
7795
|
function du(t, e, n, r) {
|
|
@@ -7807,7 +7807,7 @@ function yu(t) {
|
|
|
7807
7807
|
function bu(t, e) {
|
|
7808
7808
|
let { on: n, off: r } = /^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(t).groups;
|
|
7809
7809
|
r ??= "";
|
|
7810
|
-
const o = (e.getCurrentModX() || n.includes("x")) && !r.includes("x"), s =
|
|
7810
|
+
const o = (e.getCurrentModX() || n.includes("x")) && !r.includes("x"), s = pr(n), a = pr(r), i = {};
|
|
7811
7811
|
if (s && (i.enable = s), a && (i.disable = a), t.endsWith(")")) return e.replaceCurrentModX(o), Do("flags", t, { flags: i });
|
|
7812
7812
|
if (t.endsWith(":")) return e.pushModX(o), e.numOpenGroups++, Se("group", t, { ...(s || a) && { flags: i } });
|
|
7813
7813
|
throw new Error(`Unexpected flag modifier "${t}"`);
|
|
@@ -7850,9 +7850,9 @@ function wu(t) {
|
|
|
7850
7850
|
default:
|
|
7851
7851
|
throw new Error(`Unexpected named callout kind "${u}"`);
|
|
7852
7852
|
}
|
|
7853
|
-
return
|
|
7853
|
+
return pu(u, r ?? null, o?.split(",") ?? null, t);
|
|
7854
7854
|
}
|
|
7855
|
-
function
|
|
7855
|
+
function fr(t) {
|
|
7856
7856
|
let e = null, n, r;
|
|
7857
7857
|
if (t[0] === "{") {
|
|
7858
7858
|
const { minStr: o, maxStr: s } = /^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(t).groups, a = 1e5;
|
|
@@ -7872,7 +7872,7 @@ function _u(t) {
|
|
|
7872
7872
|
const { p: e, neg: n, value: r } = /^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(t).groups;
|
|
7873
7873
|
return ge("property", t, { value: r, negate: e === "P" && !n || e === "p" && !!n });
|
|
7874
7874
|
}
|
|
7875
|
-
function
|
|
7875
|
+
function pr(t) {
|
|
7876
7876
|
const e = {};
|
|
7877
7877
|
return t.includes("i") && (e.ignoreCase = !0), t.includes("m") && (e.dotAll = !0), t.includes("x") && (e.extended = !0), Object.keys(e).length ? e : null;
|
|
7878
7878
|
}
|
|
@@ -7919,12 +7919,12 @@ function xu(t) {
|
|
|
7919
7919
|
if (s) {
|
|
7920
7920
|
const { min: a, max: i } = s.groups;
|
|
7921
7921
|
if (+a > +i && o.endsWith("?")) {
|
|
7922
|
-
n.lastIndex--, e.push(
|
|
7922
|
+
n.lastIndex--, e.push(fr(o.slice(0, -1)));
|
|
7923
7923
|
continue;
|
|
7924
7924
|
}
|
|
7925
7925
|
}
|
|
7926
7926
|
}
|
|
7927
|
-
e.push(
|
|
7927
|
+
e.push(fr(o));
|
|
7928
7928
|
}
|
|
7929
7929
|
return e;
|
|
7930
7930
|
}
|
|
@@ -7939,51 +7939,51 @@ function Eu(t) {
|
|
|
7939
7939
|
}
|
|
7940
7940
|
const Au = /* @__PURE__ */ new Set(["AbsenceFunction", "Backreference", "CapturingGroup", "Character", "CharacterClass", "CharacterSet", "Group", "Quantifier", "Subroutine"]);
|
|
7941
7941
|
function Fo(t, e = {}) {
|
|
7942
|
-
const n = { flags: "", normalizeUnknownPropertyNames: !1, skipBackrefValidation: !1, skipLookbehindValidation: !1, skipPropertyNameValidation: !1, unicodePropertyMap: null, ...e, rules: { captureGroup: !1, singleline: !1, ...e.rules } }, r = ru(t, { flags: n.flags, rules: { captureGroup: n.rules.captureGroup, singleline: n.rules.singleline } }), o = (
|
|
7943
|
-
const
|
|
7944
|
-
switch (s.parent =
|
|
7942
|
+
const n = { flags: "", normalizeUnknownPropertyNames: !1, skipBackrefValidation: !1, skipLookbehindValidation: !1, skipPropertyNameValidation: !1, unicodePropertyMap: null, ...e, rules: { captureGroup: !1, singleline: !1, ...e.rules } }, r = ru(t, { flags: n.flags, rules: { captureGroup: n.rules.captureGroup, singleline: n.rules.singleline } }), o = (p, d) => {
|
|
7943
|
+
const f = r.tokens[s.nextIndex];
|
|
7944
|
+
switch (s.parent = p, s.nextIndex++, f.type) {
|
|
7945
7945
|
case "Alternator":
|
|
7946
7946
|
return me();
|
|
7947
7947
|
case "Assertion":
|
|
7948
|
-
return Ru(
|
|
7948
|
+
return Ru(f);
|
|
7949
7949
|
case "Backreference":
|
|
7950
|
-
return Iu(
|
|
7950
|
+
return Iu(f, s);
|
|
7951
7951
|
case "Character":
|
|
7952
|
-
return vt(
|
|
7952
|
+
return vt(f.value, { useLastValid: !!d.isCheckingRangeEnd });
|
|
7953
7953
|
case "CharacterClassHyphen":
|
|
7954
|
-
return Nu(
|
|
7954
|
+
return Nu(f, s, d);
|
|
7955
7955
|
case "CharacterClassOpen":
|
|
7956
|
-
return Lu(
|
|
7956
|
+
return Lu(f, s, d);
|
|
7957
7957
|
case "CharacterSet":
|
|
7958
|
-
return Pu(
|
|
7958
|
+
return Pu(f, s);
|
|
7959
7959
|
case "Directive":
|
|
7960
|
-
return Gu(
|
|
7960
|
+
return Gu(f.kind, { flags: f.flags });
|
|
7961
7961
|
case "GroupOpen":
|
|
7962
|
-
return $u(
|
|
7962
|
+
return $u(f, s, d);
|
|
7963
7963
|
case "NamedCallout":
|
|
7964
|
-
return Bu(
|
|
7964
|
+
return Bu(f.kind, f.tag, f.arguments);
|
|
7965
7965
|
case "Quantifier":
|
|
7966
|
-
return Tu(
|
|
7966
|
+
return Tu(f, s);
|
|
7967
7967
|
case "Subroutine":
|
|
7968
|
-
return Mu(
|
|
7968
|
+
return Mu(f, s);
|
|
7969
7969
|
default:
|
|
7970
|
-
throw new Error(`Unexpected token type "${
|
|
7970
|
+
throw new Error(`Unexpected token type "${f.type}"`);
|
|
7971
7971
|
}
|
|
7972
7972
|
}, 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: r.tokens, unicodePropertyMap: n.unicodePropertyMap, walk: o }, a = Uu(Fu(r.flags));
|
|
7973
7973
|
let i = a.body[0];
|
|
7974
7974
|
for (; s.nextIndex < r.tokens.length; ) {
|
|
7975
|
-
const
|
|
7976
|
-
|
|
7975
|
+
const p = o(i, {});
|
|
7976
|
+
p.type === "Alternative" ? (a.body.push(p), i = p) : i.body.push(p);
|
|
7977
7977
|
}
|
|
7978
7978
|
const { capturingGroups: l, hasNumberedRef: u, namedGroupsByName: c, subroutines: h } = s;
|
|
7979
7979
|
if (u && c.size && !n.rules.captureGroup) throw new Error("Numbered backref/subroutine not allowed when using named capture");
|
|
7980
|
-
for (const { ref:
|
|
7981
|
-
if (
|
|
7982
|
-
|
|
7983
|
-
} else if (c.has(
|
|
7984
|
-
if (c.get(
|
|
7985
|
-
c.get(
|
|
7986
|
-
} else throw new Error(B`Subroutine uses a group name that's not defined "\g<${
|
|
7980
|
+
for (const { ref: p } of h) if (typeof p == "number") {
|
|
7981
|
+
if (p > l.length) throw new Error("Subroutine uses a group number that's not defined");
|
|
7982
|
+
p && (l[p - 1].isSubroutined = !0);
|
|
7983
|
+
} else if (c.has(p)) {
|
|
7984
|
+
if (c.get(p).length > 1) throw new Error(B`Subroutine uses a duplicate group name "\g<${p}>"`);
|
|
7985
|
+
c.get(p)[0].isSubroutined = !0;
|
|
7986
|
+
} else throw new Error(B`Subroutine uses a group name that's not defined "\g<${p}>"`);
|
|
7987
7987
|
return a;
|
|
7988
7988
|
}
|
|
7989
7989
|
function Ru({ kind: t }) {
|
|
@@ -8041,19 +8041,19 @@ function Pu({ kind: t, negate: e, value: n }, r) {
|
|
|
8041
8041
|
function $u(t, e, n) {
|
|
8042
8042
|
const { tokens: r, capturingGroups: o, namedGroupsByName: s, skipLookbehindValidation: a, walk: i } = e, l = zu(t), u = l.type === "AbsenceFunction", c = gr(l), h = c && l.negate;
|
|
8043
8043
|
if (l.type === "CapturingGroup" && (o.push(l), l.name && nu(s, l.name, []).push(l)), u && n.isInAbsenceFunction) throw new Error("Nested absence function not supported by Oniguruma");
|
|
8044
|
-
let
|
|
8045
|
-
for (;
|
|
8046
|
-
if (
|
|
8044
|
+
let p = yr(r[e.nextIndex]);
|
|
8045
|
+
for (; p.type !== "GroupClose"; ) {
|
|
8046
|
+
if (p.type === "Alternator") l.body.push(me()), e.nextIndex++;
|
|
8047
8047
|
else {
|
|
8048
|
-
const d = l.body.at(-1),
|
|
8049
|
-
if (d.body.push(
|
|
8048
|
+
const d = l.body.at(-1), f = i(d, { ...n, isInAbsenceFunction: n.isInAbsenceFunction || u, isInLookbehind: n.isInLookbehind || c, isInNegLookbehind: n.isInNegLookbehind || h });
|
|
8049
|
+
if (d.body.push(f), (c || n.isInLookbehind) && !a) {
|
|
8050
8050
|
const g = "Lookbehind includes a pattern not allowed by Oniguruma";
|
|
8051
8051
|
if (h || n.isInNegLookbehind) {
|
|
8052
|
-
if (dr(
|
|
8053
|
-
} else if (dr(
|
|
8052
|
+
if (dr(f) || f.type === "CapturingGroup") throw new Error(g);
|
|
8053
|
+
} else if (dr(f) || gr(f) && f.negate) throw new Error(g);
|
|
8054
8054
|
}
|
|
8055
8055
|
}
|
|
8056
|
-
|
|
8056
|
+
p = yr(r[e.nextIndex]);
|
|
8057
8057
|
}
|
|
8058
8058
|
return e.nextIndex++, l;
|
|
8059
8059
|
}
|
|
@@ -8127,7 +8127,7 @@ function Q(t) {
|
|
|
8127
8127
|
if (e && n) throw new Error("Atomic group cannot have flags");
|
|
8128
8128
|
return { type: "Group", ...e && { atomic: e }, ...n && { flags: n }, body: Ye(t?.body) };
|
|
8129
8129
|
}
|
|
8130
|
-
function
|
|
8130
|
+
function pe(t) {
|
|
8131
8131
|
const e = { behind: !1, negate: !1, ...t };
|
|
8132
8132
|
return { type: "LookaroundAssertion", kind: e.behind ? "lookbehind" : "lookahead", negate: e.negate, body: Ye(t?.body) };
|
|
8133
8133
|
}
|
|
@@ -8170,7 +8170,7 @@ function zu({ flags: t, kind: e, name: n, negate: r, number: o }) {
|
|
|
8170
8170
|
return Q({ flags: t });
|
|
8171
8171
|
case "lookahead":
|
|
8172
8172
|
case "lookbehind":
|
|
8173
|
-
return
|
|
8173
|
+
return pe({ behind: e === "lookbehind", negate: r });
|
|
8174
8174
|
default:
|
|
8175
8175
|
throw new Error(`Unexpected group kind "${e}"`);
|
|
8176
8176
|
}
|
|
@@ -8234,8 +8234,8 @@ function Be(t, e, n = null) {
|
|
|
8234
8234
|
c = !0;
|
|
8235
8235
|
}, skip() {
|
|
8236
8236
|
c = !0;
|
|
8237
|
-
} }, { type:
|
|
8238
|
-
if (g?.(h, n), C?.(h, n), !c) switch (
|
|
8237
|
+
} }, { type: p } = s, d = e["*"], f = e[p], g = typeof d == "function" ? d : d?.enter, C = typeof f == "function" ? f : f?.enter;
|
|
8238
|
+
if (g?.(h, n), C?.(h, n), !c) switch (p) {
|
|
8239
8239
|
case "AbsenceFunction":
|
|
8240
8240
|
case "CapturingGroup":
|
|
8241
8241
|
case "Group":
|
|
@@ -8267,9 +8267,9 @@ function Be(t, e, n = null) {
|
|
|
8267
8267
|
r(s.body, s), o(s.flags, s, "flags");
|
|
8268
8268
|
break;
|
|
8269
8269
|
default:
|
|
8270
|
-
throw new Error(`Unexpected node type "${
|
|
8270
|
+
throw new Error(`Unexpected node type "${p}"`);
|
|
8271
8271
|
}
|
|
8272
|
-
return
|
|
8272
|
+
return f?.exit?.(h, n), d?.exit?.(h, n), u;
|
|
8273
8273
|
}
|
|
8274
8274
|
return o(t), t;
|
|
8275
8275
|
}
|
|
@@ -8362,20 +8362,20 @@ function Ju(t, e) {
|
|
|
8362
8362
|
let l = 0, u = 0, c = NaN, h;
|
|
8363
8363
|
do {
|
|
8364
8364
|
h = !1;
|
|
8365
|
-
let
|
|
8365
|
+
let p = 0, d = 0, f = !1, g;
|
|
8366
8366
|
for (br.lastIndex = Number.isNaN(c) ? 0 : c + s.length; g = br.exec(t); ) {
|
|
8367
8367
|
const { 0: C, index: y, groups: { capturingStart: m, noncapturingStart: _ } } = g;
|
|
8368
8368
|
if (C === "[")
|
|
8369
|
-
|
|
8370
|
-
else if (
|
|
8371
|
-
C === "]" &&
|
|
8372
|
-
else if (C === o && !
|
|
8373
|
-
c = y,
|
|
8374
|
-
else if (
|
|
8369
|
+
p++;
|
|
8370
|
+
else if (p)
|
|
8371
|
+
C === "]" && p--;
|
|
8372
|
+
else if (C === o && !f)
|
|
8373
|
+
c = y, f = !0;
|
|
8374
|
+
else if (f && _)
|
|
8375
8375
|
d++;
|
|
8376
8376
|
else if (m)
|
|
8377
|
-
|
|
8378
|
-
else if (C === ")" &&
|
|
8377
|
+
f ? d++ : (l++, a.push(l + u));
|
|
8378
|
+
else if (C === ")" && f) {
|
|
8379
8379
|
if (!d) {
|
|
8380
8380
|
u++;
|
|
8381
8381
|
const S = l + u;
|
|
@@ -8397,14 +8397,14 @@ function Ju(t, e) {
|
|
|
8397
8397
|
return n.push(...i), t = En(
|
|
8398
8398
|
t,
|
|
8399
8399
|
String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,
|
|
8400
|
-
({ 0:
|
|
8400
|
+
({ 0: p, groups: { backrefNum: d, wrappedBackrefNum: f } }) => {
|
|
8401
8401
|
if (d) {
|
|
8402
8402
|
const g = +d;
|
|
8403
8403
|
if (g > a.length - 1)
|
|
8404
|
-
throw new Error(`Backref "${
|
|
8404
|
+
throw new Error(`Backref "${p}" greater than number of captures`);
|
|
8405
8405
|
return `\\${a[g]}`;
|
|
8406
8406
|
}
|
|
8407
|
-
return `\\${
|
|
8407
|
+
return `\\${f}`;
|
|
8408
8408
|
},
|
|
8409
8409
|
J.DEFAULT
|
|
8410
8410
|
), {
|
|
@@ -8446,7 +8446,7 @@ function Zu(t) {
|
|
|
8446
8446
|
if (c === "+" && o && !o.startsWith("(")) {
|
|
8447
8447
|
if (h)
|
|
8448
8448
|
throw new Error(`Invalid quantifier "${i}"`);
|
|
8449
|
-
let
|
|
8449
|
+
let p = -1;
|
|
8450
8450
|
if (/^\{\d+\}$/.test(u))
|
|
8451
8451
|
t = Xu(t, l + u.length, c, "");
|
|
8452
8452
|
else {
|
|
@@ -8457,9 +8457,9 @@ function Zu(t) {
|
|
|
8457
8457
|
t = `${t.slice(0, d)}(?>${t.slice(d, l)}${u})${t.slice(l + i.length)}`;
|
|
8458
8458
|
} else
|
|
8459
8459
|
t = `${t.slice(0, l - o.length)}(?>${o}${u})${t.slice(l + i.length)}`;
|
|
8460
|
-
|
|
8460
|
+
p += 4;
|
|
8461
8461
|
}
|
|
8462
|
-
Dt.lastIndex +=
|
|
8462
|
+
Dt.lastIndex += p;
|
|
8463
8463
|
} else i[0] === "(" ? e.push(l) : i === ")" && (n = e.length ? e.pop() : null);
|
|
8464
8464
|
o = i;
|
|
8465
8465
|
}
|
|
@@ -8484,9 +8484,9 @@ function ec(t, e) {
|
|
|
8484
8484
|
if (r === "plugin" && nt(t, Y`\(\?\(DEFINE\)`, J.DEFAULT))
|
|
8485
8485
|
throw new Error("DEFINE groups cannot be used with recursion");
|
|
8486
8486
|
const s = [], a = nt(t, Y`\\[1-9]`, J.DEFAULT), i = /* @__PURE__ */ new Map(), l = [];
|
|
8487
|
-
let u = !1, c = 0, h = 0,
|
|
8488
|
-
for (he.lastIndex = 0;
|
|
8489
|
-
const { 0: d, groups: { captureName:
|
|
8487
|
+
let u = !1, c = 0, h = 0, p;
|
|
8488
|
+
for (he.lastIndex = 0; p = he.exec(t); ) {
|
|
8489
|
+
const { 0: d, groups: { captureName: f, rDepth: g, gRNameOrNum: C, gRDepth: y } } = p;
|
|
8490
8490
|
if (d === "[")
|
|
8491
8491
|
c++;
|
|
8492
8492
|
else if (c)
|
|
@@ -8500,7 +8500,7 @@ function ec(t, e) {
|
|
|
8500
8500
|
// gone through conversion from named to numbered, so avoid a misleading error
|
|
8501
8501
|
`${r === "external" ? "Backrefs" : "Numbered backrefs"} cannot be used with global recursion`
|
|
8502
8502
|
);
|
|
8503
|
-
const m = t.slice(0,
|
|
8503
|
+
const m = t.slice(0, p.index), _ = t.slice(he.lastIndex);
|
|
8504
8504
|
if (nt(_, ln, J.DEFAULT))
|
|
8505
8505
|
throw new Error(Gt);
|
|
8506
8506
|
const S = +g - 1;
|
|
@@ -8539,7 +8539,7 @@ function ec(t, e) {
|
|
|
8539
8539
|
// gone through conversion from named to numbered, so avoid a misleading error
|
|
8540
8540
|
`${r === "external" ? "Backrefs" : "Numbered backrefs"} cannot be used with recursion of capturing groups`
|
|
8541
8541
|
);
|
|
8542
|
-
const A = t.slice(_,
|
|
8542
|
+
const A = t.slice(_, p.index), D = S.slice(A.length + d.length), L = s.length, j = +y - 1, Z = Cr(
|
|
8543
8543
|
A,
|
|
8544
8544
|
D,
|
|
8545
8545
|
j,
|
|
@@ -8558,10 +8558,10 @@ function ec(t, e) {
|
|
|
8558
8558
|
);
|
|
8559
8559
|
const ee = t.slice(0, _), ce = t.slice(_ + S.length);
|
|
8560
8560
|
t = `${ee}${Z}${ce}`, he.lastIndex += Z.length - d.length - A.length - D.length, l.forEach((te) => te.hasRecursedWithin = !0), u = !0;
|
|
8561
|
-
} else if (
|
|
8562
|
-
h++, i.set(String(h), he.lastIndex), i.set(
|
|
8561
|
+
} else if (f)
|
|
8562
|
+
h++, i.set(String(h), he.lastIndex), i.set(f, he.lastIndex), l.push({
|
|
8563
8563
|
num: h,
|
|
8564
|
-
name:
|
|
8564
|
+
name: f
|
|
8565
8565
|
});
|
|
8566
8566
|
else if (d[0] === "(") {
|
|
8567
8567
|
const m = d === "(";
|
|
@@ -8603,13 +8603,13 @@ function _r(t, e, n, r, o, s, a) {
|
|
|
8603
8603
|
u += En(
|
|
8604
8604
|
t,
|
|
8605
8605
|
Y`${Vo}|\\k<(?<backref>[^>]+)>`,
|
|
8606
|
-
({ 0:
|
|
8606
|
+
({ 0: p, groups: { captureName: d, unnamed: f, backref: g } }) => {
|
|
8607
8607
|
if (g && r && !r.has(g))
|
|
8608
|
-
return
|
|
8608
|
+
return p;
|
|
8609
8609
|
const C = `_$${h}`;
|
|
8610
|
-
if (
|
|
8610
|
+
if (f || d) {
|
|
8611
8611
|
const y = a + s.length + 1;
|
|
8612
|
-
return s.push(y), tc(o, y),
|
|
8612
|
+
return s.push(y), tc(o, y), f ? p : `(?<${d}${C}>`;
|
|
8613
8613
|
}
|
|
8614
8614
|
return Y`\k<${g}${C}>`;
|
|
8615
8615
|
},
|
|
@@ -8628,19 +8628,19 @@ function Sr(t, e, n, r, o, s) {
|
|
|
8628
8628
|
Ho(e, Vo, () => a++, J.DEFAULT);
|
|
8629
8629
|
const i = s - a + o, l = /* @__PURE__ */ new Map();
|
|
8630
8630
|
return t.forEach((u, c) => {
|
|
8631
|
-
const h = (r - a * n) / n,
|
|
8631
|
+
const h = (r - a * n) / n, p = a * n, d = c > i + a ? c + r : c, f = [];
|
|
8632
8632
|
for (const g of u)
|
|
8633
8633
|
if (g <= i)
|
|
8634
|
-
|
|
8634
|
+
f.push(g);
|
|
8635
8635
|
else if (g > i + a + h)
|
|
8636
|
-
|
|
8636
|
+
f.push(g + r);
|
|
8637
8637
|
else if (g <= i + a)
|
|
8638
8638
|
for (let C = 0; C <= n; C++)
|
|
8639
|
-
|
|
8639
|
+
f.push(g + a * C);
|
|
8640
8640
|
else
|
|
8641
8641
|
for (let C = 0; C <= n; C++)
|
|
8642
|
-
|
|
8643
|
-
l.set(d,
|
|
8642
|
+
f.push(g + p + h * C);
|
|
8643
|
+
l.set(d, f);
|
|
8644
8644
|
}), l;
|
|
8645
8645
|
}
|
|
8646
8646
|
return t;
|
|
@@ -8955,7 +8955,7 @@ function hc(t, e) {
|
|
|
8955
8955
|
spaceIsAscii: t.flags.spaceIsAscii,
|
|
8956
8956
|
wordIsAscii: t.flags.wordIsAscii
|
|
8957
8957
|
};
|
|
8958
|
-
Be(t,
|
|
8958
|
+
Be(t, fc, r);
|
|
8959
8959
|
const o = {
|
|
8960
8960
|
dotAll: t.flags.dotAll,
|
|
8961
8961
|
ignoreCase: t.flags.ignoreCase
|
|
@@ -8970,7 +8970,7 @@ function hc(t, e) {
|
|
|
8970
8970
|
reffedNodesByReferencer: /* @__PURE__ */ new Map(),
|
|
8971
8971
|
subroutineRefMap: r.subroutineRefMap
|
|
8972
8972
|
};
|
|
8973
|
-
Be(t,
|
|
8973
|
+
Be(t, pc, s);
|
|
8974
8974
|
const a = {
|
|
8975
8975
|
groupsByName: s.groupsByName,
|
|
8976
8976
|
highestOrphanBackref: 0,
|
|
@@ -8979,14 +8979,14 @@ function hc(t, e) {
|
|
|
8979
8979
|
};
|
|
8980
8980
|
return Be(t, dc, a), t._originMap = s.groupOriginByCopy, t._strategy = r.strategy, t;
|
|
8981
8981
|
}
|
|
8982
|
-
var
|
|
8982
|
+
var fc = {
|
|
8983
8983
|
AbsenceFunction({ node: t, parent: e, replaceWith: n }) {
|
|
8984
8984
|
const { body: r, kind: o } = t;
|
|
8985
8985
|
if (o === "repeater") {
|
|
8986
8986
|
const s = Q();
|
|
8987
8987
|
s.body[0].body.push(
|
|
8988
8988
|
// Insert own alts as `body`
|
|
8989
|
-
|
|
8989
|
+
pe({ negate: !0, body: r }),
|
|
8990
8990
|
ke("Any")
|
|
8991
8991
|
);
|
|
8992
8992
|
const a = Q();
|
|
@@ -9015,11 +9015,11 @@ var pc = {
|
|
|
9015
9015
|
}
|
|
9016
9016
|
},
|
|
9017
9017
|
Assertion({ node: t, parent: e, key: n, container: r, root: o, remove: s, replaceWith: a }, i) {
|
|
9018
|
-
const { kind: l, negate: u } = t, { asciiWordBoundaries: c, avoidSubclass: h, supportedGNodes:
|
|
9018
|
+
const { kind: l, negate: u } = t, { asciiWordBoundaries: c, avoidSubclass: h, supportedGNodes: p, wordIsAscii: d } = i;
|
|
9019
9019
|
if (l === "text_segment_boundary")
|
|
9020
9020
|
throw new Error(`Unsupported text segment boundary "\\${u ? "Y" : "y"}"`);
|
|
9021
9021
|
if (l === "line_end")
|
|
9022
|
-
a(P(
|
|
9022
|
+
a(P(pe({ body: [
|
|
9023
9023
|
me({ body: [on("string_end")] }),
|
|
9024
9024
|
me({ body: [vt(10)] })
|
|
9025
9025
|
// `\n`
|
|
@@ -9027,12 +9027,12 @@ var pc = {
|
|
|
9027
9027
|
else if (l === "line_start")
|
|
9028
9028
|
a(P(oe(v`(?<=\A|\n(?!\z))`, { skipLookbehindValidation: !0 }), e));
|
|
9029
9029
|
else if (l === "search_start")
|
|
9030
|
-
if (
|
|
9030
|
+
if (p.has(t))
|
|
9031
9031
|
o.flags.sticky = !0, s();
|
|
9032
9032
|
else {
|
|
9033
|
-
const
|
|
9034
|
-
if (
|
|
9035
|
-
a(P(
|
|
9033
|
+
const f = r[n - 1];
|
|
9034
|
+
if (f && Cc(f))
|
|
9035
|
+
a(P(pe({ negate: !0 }), e));
|
|
9036
9036
|
else {
|
|
9037
9037
|
if (h)
|
|
9038
9038
|
throw new Error(v`Uses "\G" in a way that requires a subclass`);
|
|
@@ -9043,8 +9043,8 @@ var pc = {
|
|
|
9043
9043
|
a(P(oe(v`(?=\n?\z)`), e));
|
|
9044
9044
|
else if (l === "word_boundary") {
|
|
9045
9045
|
if (!d && !c) {
|
|
9046
|
-
const
|
|
9047
|
-
a(P(oe(u ? g :
|
|
9046
|
+
const f = `(?:(?<=${re})(?!${re})|(?<!${re})(?=${re}))`, g = `(?:(?<=${re})(?=${re})|(?<!${re})(?!${re}))`;
|
|
9047
|
+
a(P(oe(u ? g : f), e));
|
|
9048
9048
|
}
|
|
9049
9049
|
} else
|
|
9050
9050
|
throw new Error(`Unexpected assertion kind "${l}"`);
|
|
@@ -9084,10 +9084,10 @@ var pc = {
|
|
|
9084
9084
|
else if (l !== "dot") if (l === "text_segment") {
|
|
9085
9085
|
if (r === "strict")
|
|
9086
9086
|
throw new Error(v`Use of "\X" requires non-strict accuracy`);
|
|
9087
|
-
const h = "\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",
|
|
9087
|
+
const h = "\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?", p = v`\p{RI}{2}|${h}(?:\u200D${h})*`;
|
|
9088
9088
|
n(P(oe(
|
|
9089
9089
|
// Close approximation of an extended grapheme cluster; see: <unicode.org/reports/tr29/>
|
|
9090
|
-
v`(?>\r\n|${o ? v`\p{RGI_Emoji}` :
|
|
9090
|
+
v`(?>\r\n|${o ? v`\p{RGI_Emoji}` : p}|\P{M}\p{M}*)`,
|
|
9091
9091
|
// Allow JS property `RGI_Emoji` through
|
|
9092
9092
|
{ skipPropertyNameValidation: !0 }
|
|
9093
9093
|
), e));
|
|
@@ -9132,8 +9132,8 @@ var pc = {
|
|
|
9132
9132
|
Go(u, { type: "Group" }) && u.body[0].body.length === 1 ? u.body[0] : n;
|
|
9133
9133
|
if (e.parent !== h || h.body.length > 1)
|
|
9134
9134
|
throw new Error(v`Uses "\K" in a way that's unsupported`);
|
|
9135
|
-
const
|
|
9136
|
-
|
|
9135
|
+
const p = pe({ behind: !0 });
|
|
9136
|
+
p.body[0].body = s(), o(P(p, e));
|
|
9137
9137
|
} else
|
|
9138
9138
|
throw new Error(`Unexpected directive kind "${i}"`);
|
|
9139
9139
|
},
|
|
@@ -9198,7 +9198,7 @@ var pc = {
|
|
|
9198
9198
|
NamedCallout({ node: t, parent: e, replaceWith: n }) {
|
|
9199
9199
|
const { kind: r } = t;
|
|
9200
9200
|
if (r === "fail")
|
|
9201
|
-
n(P(
|
|
9201
|
+
n(P(pe({ negate: !0 }), e));
|
|
9202
9202
|
else
|
|
9203
9203
|
throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`);
|
|
9204
9204
|
},
|
|
@@ -9230,7 +9230,7 @@ var pc = {
|
|
|
9230
9230
|
let { ref: n } = t;
|
|
9231
9231
|
typeof n == "string" && !jt(n) && (n = Bt(n, e), t.ref = n);
|
|
9232
9232
|
}
|
|
9233
|
-
},
|
|
9233
|
+
}, pc = {
|
|
9234
9234
|
Backreference({ node: t }, { multiplexCapturesToLeftByRef: e, reffedNodesByReferencer: n }) {
|
|
9235
9235
|
const { orphan: r, ref: o } = t;
|
|
9236
9236
|
r || n.set(t, [...e.get(o).map(({ node: s }) => s)]);
|
|
@@ -9257,13 +9257,13 @@ var pc = {
|
|
|
9257
9257
|
i.set(t.number, t), a.set(t.number, []), t.name && Ve(a, t.name, []);
|
|
9258
9258
|
const c = a.get(t.name ?? t.number);
|
|
9259
9259
|
for (let h = 0; h < c.length; h++) {
|
|
9260
|
-
const
|
|
9260
|
+
const p = c[h];
|
|
9261
9261
|
if (
|
|
9262
9262
|
// This group is from subroutine expansion, and there's a multiplex value from either the
|
|
9263
9263
|
// origin node or a prior subroutine expansion group with the same origin
|
|
9264
|
-
u ===
|
|
9264
|
+
u === p.node || u && u === p.origin || // This group is not from subroutine expansion, and it comes after a subroutine expansion
|
|
9265
9265
|
// group that refers to this group
|
|
9266
|
-
t ===
|
|
9266
|
+
t === p.origin
|
|
9267
9267
|
) {
|
|
9268
9268
|
c.splice(h, 1);
|
|
9269
9269
|
break;
|
|
@@ -9271,16 +9271,16 @@ var pc = {
|
|
|
9271
9271
|
}
|
|
9272
9272
|
if (a.get(t.number).push({ node: t, origin: u }), t.name && a.get(t.name).push({ node: t, origin: u }), t.name) {
|
|
9273
9273
|
const h = Ve(s, t.name, /* @__PURE__ */ new Map());
|
|
9274
|
-
let
|
|
9274
|
+
let p = !1;
|
|
9275
9275
|
if (u)
|
|
9276
|
-
|
|
9276
|
+
p = !0;
|
|
9277
9277
|
else
|
|
9278
9278
|
for (const d of h.values())
|
|
9279
9279
|
if (!d.hasDuplicateNameToRemove) {
|
|
9280
|
-
|
|
9280
|
+
p = !0;
|
|
9281
9281
|
break;
|
|
9282
9282
|
}
|
|
9283
|
-
s.get(t.name).set(t, { node: t, hasDuplicateNameToRemove:
|
|
9283
|
+
s.get(t.name).set(t, { node: t, hasDuplicateNameToRemove: p });
|
|
9284
9284
|
}
|
|
9285
9285
|
},
|
|
9286
9286
|
exit({ node: t }, { openRefs: e }) {
|
|
@@ -9312,7 +9312,7 @@ var pc = {
|
|
|
9312
9312
|
if (!i) {
|
|
9313
9313
|
const c = Zo(yc(
|
|
9314
9314
|
a,
|
|
9315
|
-
(
|
|
9315
|
+
(p) => p.type === "Group" && !!p.flags
|
|
9316
9316
|
)), h = c ? bt(r.globalFlags, c) : r.globalFlags;
|
|
9317
9317
|
gc(h, r.currentFlags) || (u = Q({
|
|
9318
9318
|
flags: bc(h)
|
|
@@ -9328,7 +9328,7 @@ var pc = {
|
|
|
9328
9328
|
}
|
|
9329
9329
|
const s = r.reffedNodesByReferencer.get(t).filter((a) => mc(a, t));
|
|
9330
9330
|
if (!s.length)
|
|
9331
|
-
n(P(
|
|
9331
|
+
n(P(pe({ negate: !0 }), e));
|
|
9332
9332
|
else if (s.length > 1) {
|
|
9333
9333
|
const a = Q({
|
|
9334
9334
|
atomic: !0,
|
|
@@ -9506,8 +9506,8 @@ function Sc(t, e) {
|
|
|
9506
9506
|
popModI() {
|
|
9507
9507
|
d.pop();
|
|
9508
9508
|
},
|
|
9509
|
-
pushModI(
|
|
9510
|
-
d.push(
|
|
9509
|
+
pushModI(f) {
|
|
9510
|
+
d.push(f);
|
|
9511
9511
|
},
|
|
9512
9512
|
setHasCasedChar() {
|
|
9513
9513
|
d.at(-1) ? a = !0 : i = !0;
|
|
@@ -9543,15 +9543,15 @@ function Sc(t, e) {
|
|
|
9543
9543
|
function h(d) {
|
|
9544
9544
|
return c.lastNode = u, u = d, nc(vc[d.type], `Unexpected node type "${d.type}"`)(d, c, h);
|
|
9545
9545
|
}
|
|
9546
|
-
const
|
|
9546
|
+
const p = {
|
|
9547
9547
|
pattern: t.body.map(h).join("|"),
|
|
9548
9548
|
// Could reset `lastNode` at this point via `lastNode = ast`, but it isn't needed by flags
|
|
9549
9549
|
flags: h(t.flags),
|
|
9550
9550
|
options: { ...t.options }
|
|
9551
9551
|
};
|
|
9552
|
-
return r || (delete
|
|
9553
|
-
d.hidden &&
|
|
9554
|
-
}),
|
|
9552
|
+
return r || (delete p.options.force.v, p.options.disable.v = !0, p.options.unicodeSetsPlugin = null), p._captureTransfers = /* @__PURE__ */ new Map(), p._hiddenCaptures = [], c.captureMap.forEach((d, f) => {
|
|
9553
|
+
d.hidden && p._hiddenCaptures.push(f), d.transferTo && Ve(p._captureTransfers, d.transferTo, []).push(f);
|
|
9554
|
+
}), p;
|
|
9555
9555
|
}
|
|
9556
9556
|
var kc = {
|
|
9557
9557
|
"*": {
|
|
@@ -9651,10 +9651,10 @@ var kc = {
|
|
|
9651
9651
|
(h) => h.type === "CharacterClass" && h.kind === "union" && h.negate
|
|
9652
9652
|
);
|
|
9653
9653
|
if (c.length) {
|
|
9654
|
-
const h = Q(),
|
|
9655
|
-
return h.parent = s,
|
|
9656
|
-
const
|
|
9657
|
-
d.parent =
|
|
9654
|
+
const h = Q(), p = h.body[0];
|
|
9655
|
+
return h.parent = s, p.parent = h, a = a.filter((d) => !c.includes(d)), t.body = a, a.length ? (t.parent = p, p.body.push(t)) : h.body.pop(), c.forEach((d) => {
|
|
9656
|
+
const f = me({ body: [d] });
|
|
9657
|
+
d.parent = f, f.parent = h, h.body.push(f);
|
|
9658
9658
|
}), n(h);
|
|
9659
9659
|
}
|
|
9660
9660
|
}
|
|
@@ -10076,11 +10076,11 @@ function Gc(t, e) {
|
|
|
10076
10076
|
if (n.lazyCompileLength !== 1 / 0)
|
|
10077
10077
|
throw new Error("Lazy compilation requires subclass");
|
|
10078
10078
|
} else {
|
|
10079
|
-
const c = l.hiddenCaptures.sort((
|
|
10080
|
-
(c.length || h.length ||
|
|
10079
|
+
const c = l.hiddenCaptures.sort((f, g) => f - g), h = Array.from(l.captureTransfers), p = o._strategy, d = u.pattern.length >= n.lazyCompileLength;
|
|
10080
|
+
(c.length || h.length || p || d) && (u.options = {
|
|
10081
10081
|
...c.length && { hiddenCaptures: c },
|
|
10082
10082
|
...h.length && { transfers: h },
|
|
10083
|
-
...
|
|
10083
|
+
...p && { strategy: p },
|
|
10084
10084
|
...d && { lazyCompile: d }
|
|
10085
10085
|
});
|
|
10086
10086
|
}
|
|
@@ -10305,4 +10305,4 @@ export {
|
|
|
10305
10305
|
qr as v,
|
|
10306
10306
|
la as z
|
|
10307
10307
|
};
|
|
10308
|
-
//# sourceMappingURL=SyntaxHighlight-
|
|
10308
|
+
//# sourceMappingURL=SyntaxHighlight-CSW4eaIJ.js.map
|