@visulima/pail 2.1.27 → 2.1.28
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/CHANGELOG.md +11 -0
- package/dist/index.browser.cjs +1 -19
- package/dist/index.browser.mjs +1 -14
- package/dist/index.server.cjs +5 -442
- package/dist/index.server.mjs +5 -437
- package/dist/packem_shared/CallerProcessor-DJnmMPMj.cjs +1 -0
- package/dist/packem_shared/CallerProcessor-mNkBei3j.mjs +1 -0
- package/dist/packem_shared/JsonFileReporter-BnxuhH4o.cjs +2 -0
- package/dist/packem_shared/JsonFileReporter-Og8hyKfg.mjs +4 -0
- package/dist/packem_shared/JsonReporter-BdExg5gk.mjs +1 -0
- package/dist/packem_shared/JsonReporter-CjvkrXUp.cjs +1 -0
- package/dist/packem_shared/JsonReporter-DRGJgjAO.mjs +2 -0
- package/dist/packem_shared/JsonReporter-DuF0Ho5i.cjs +2 -0
- package/dist/packem_shared/MessageFormatterProcessor-BjBZzL2D.mjs +1 -0
- package/dist/packem_shared/MessageFormatterProcessor-CCRIUIdT.cjs +1 -0
- package/dist/packem_shared/PrettyReporter-BRFlkORc.mjs +5 -0
- package/dist/packem_shared/PrettyReporter-BuKPqA5T.cjs +5 -0
- package/dist/packem_shared/PrettyReporter-DDsX0vlT.mjs +13 -0
- package/dist/packem_shared/PrettyReporter-Dx1OfdGj.cjs +13 -0
- package/dist/packem_shared/RedactProcessor-BBJysXaX.cjs +1 -0
- package/dist/packem_shared/RedactProcessor-CxKTN42V.mjs +3 -0
- package/dist/packem_shared/SimpleReporter-BV0taliz.mjs +11 -0
- package/dist/packem_shared/SimpleReporter-YuzZZabX.cjs +11 -0
- package/dist/packem_shared/abstract-json-reporter-Z6bVrpPK.cjs +1 -0
- package/dist/packem_shared/abstract-json-reporter-tFmKAzRZ.mjs +1 -0
- package/dist/packem_shared/abstract-pretty-reporter-C2vDqWAQ.cjs +1 -0
- package/dist/packem_shared/abstract-pretty-reporter-CRcf4WZd.mjs +1 -0
- package/dist/packem_shared/constants-BFrKdBPm.cjs +1 -0
- package/dist/packem_shared/constants-BMS51p6Y.mjs +1 -0
- package/dist/packem_shared/format-label-CKRxcWAQ.cjs +8 -0
- package/dist/packem_shared/format-label-D2xt_3df.mjs +8 -0
- package/dist/packem_shared/get-longest-label-7LkwzzHo.cjs +1 -0
- package/dist/packem_shared/get-longest-label-B0NrI-o2.mjs +1 -0
- package/dist/packem_shared/pail.browser-DC6QwLTj.cjs +1 -0
- package/dist/packem_shared/pail.browser-DkNIDzgk.mjs +1 -0
- package/dist/packem_shared/write-console-log-3G15muTS.cjs +1 -0
- package/dist/packem_shared/write-console-log-BP95fgQZ.mjs +1 -0
- package/dist/packem_shared/write-stream-CD8XFv1L.mjs +1 -0
- package/dist/packem_shared/write-stream-Dl-usQqh.cjs +1 -0
- package/dist/processor.browser.cjs +1 -11
- package/dist/processor.browser.mjs +1 -2
- package/dist/processor.server.cjs +1 -13
- package/dist/processor.server.mjs +1 -3
- package/dist/reporter.browser.cjs +1 -11
- package/dist/reporter.browser.mjs +1 -2
- package/dist/reporter.server.cjs +1 -15
- package/dist/reporter.server.mjs +1 -4
- package/package.json +2 -2
- package/dist/packem_shared/CallerProcessor-CNhuyGAa.mjs +0 -58
- package/dist/packem_shared/CallerProcessor-DJ5euiUK.cjs +0 -60
- package/dist/packem_shared/JsonFileReporter-BazAMbEI.mjs +0 -133
- package/dist/packem_shared/JsonFileReporter-PNmBNTr1.cjs +0 -135
- package/dist/packem_shared/JsonReporter-CKWF4Ibl.mjs +0 -20
- package/dist/packem_shared/JsonReporter-CcOVaf3A.cjs +0 -34
- package/dist/packem_shared/JsonReporter-Cg5R1FXn.cjs +0 -22
- package/dist/packem_shared/JsonReporter-DFFyVZyh.mjs +0 -32
- package/dist/packem_shared/MessageFormatterProcessor-Cd4HntPG.mjs +0 -53
- package/dist/packem_shared/MessageFormatterProcessor-t4t6CpzV.cjs +0 -55
- package/dist/packem_shared/PrettyReporter-3oMWkX6j.cjs +0 -200
- package/dist/packem_shared/PrettyReporter-Bx3QLZrW.mjs +0 -162
- package/dist/packem_shared/PrettyReporter-C2hjNe-y.mjs +0 -192
- package/dist/packem_shared/PrettyReporter-mFCjMb0i.cjs +0 -168
- package/dist/packem_shared/RedactProcessor-CfNkF2lC.mjs +0 -26
- package/dist/packem_shared/RedactProcessor-DWE5iqAQ.cjs +0 -26
- package/dist/packem_shared/SimpleReporter-CXXqr1h3.cjs +0 -186
- package/dist/packem_shared/SimpleReporter-TOcMSqJb.mjs +0 -178
- package/dist/packem_shared/abstract-json-reporter-okwLqT9k.cjs +0 -57
- package/dist/packem_shared/abstract-json-reporter-sxnmNIlg.mjs +0 -55
- package/dist/packem_shared/abstract-pretty-reporter-BR_6_JVa.cjs +0 -49
- package/dist/packem_shared/abstract-pretty-reporter-izJgxoMv.mjs +0 -46
- package/dist/packem_shared/constants-BYYZ5WNW.mjs +0 -114
- package/dist/packem_shared/constants-DHfYGxxG.cjs +0 -118
- package/dist/packem_shared/format-label-DYEhjrTZ.cjs +0 -621
- package/dist/packem_shared/format-label-Uj-cxY3j.mjs +0 -609
- package/dist/packem_shared/get-longest-label-CM8kLFWH.mjs +0 -11
- package/dist/packem_shared/get-longest-label-CQ7lRhgD.cjs +0 -13
- package/dist/packem_shared/pail.browser-Bp1fz428.mjs +0 -384
- package/dist/packem_shared/pail.browser-O53Q_cus.cjs +0 -387
- package/dist/packem_shared/write-console-log-Cu0-IDN-.cjs +0 -18
- package/dist/packem_shared/write-console-log-Tptfzg9D.mjs +0 -16
- package/dist/packem_shared/write-stream-BBAF33Zm.mjs +0 -8
- package/dist/packem_shared/write-stream-CkNf2Ju8.cjs +0 -10
|
@@ -1,609 +0,0 @@
|
|
|
1
|
-
import process from 'node:process';
|
|
2
|
-
import { execFileSync } from 'node:child_process';
|
|
3
|
-
import fs from 'node:fs';
|
|
4
|
-
import tty from 'node:tty';
|
|
5
|
-
import { grey, green, cyan, red, yellow, bold, magenta, underline } from '@visulima/colorize';
|
|
6
|
-
|
|
7
|
-
var __defProp$b = Object.defineProperty;
|
|
8
|
-
var __name$b = (target, value) => __defProp$b(target, "name", { value, configurable: true });
|
|
9
|
-
const defaultColumns = 80;
|
|
10
|
-
const defaultRows = 24;
|
|
11
|
-
const exec$1 = /* @__PURE__ */ __name$b((command, arguments_, { shell, env } = {}) => execFileSync(command, arguments_, {
|
|
12
|
-
encoding: "utf8",
|
|
13
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
14
|
-
timeout: 500,
|
|
15
|
-
shell,
|
|
16
|
-
env
|
|
17
|
-
}).trim(), "exec");
|
|
18
|
-
const create = /* @__PURE__ */ __name$b((columns, rows) => ({
|
|
19
|
-
columns: Number.parseInt(columns, 10),
|
|
20
|
-
rows: Number.parseInt(rows, 10)
|
|
21
|
-
}), "create");
|
|
22
|
-
const createIfNotDefault = /* @__PURE__ */ __name$b((maybeColumns, maybeRows) => {
|
|
23
|
-
const { columns, rows } = create(maybeColumns, maybeRows);
|
|
24
|
-
if (Number.isNaN(columns) || Number.isNaN(rows)) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
if (columns === defaultColumns && rows === defaultRows) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
return { columns, rows };
|
|
31
|
-
}, "createIfNotDefault");
|
|
32
|
-
function terminalSize() {
|
|
33
|
-
const { env, stdout, stderr } = process;
|
|
34
|
-
if (stdout?.columns && stdout?.rows) {
|
|
35
|
-
return create(stdout.columns, stdout.rows);
|
|
36
|
-
}
|
|
37
|
-
if (stderr?.columns && stderr?.rows) {
|
|
38
|
-
return create(stderr.columns, stderr.rows);
|
|
39
|
-
}
|
|
40
|
-
if (env.COLUMNS && env.LINES) {
|
|
41
|
-
return create(env.COLUMNS, env.LINES);
|
|
42
|
-
}
|
|
43
|
-
const fallback = {
|
|
44
|
-
columns: defaultColumns,
|
|
45
|
-
rows: defaultRows
|
|
46
|
-
};
|
|
47
|
-
if (process.platform === "win32") {
|
|
48
|
-
return tput() ?? fallback;
|
|
49
|
-
}
|
|
50
|
-
if (process.platform === "darwin") {
|
|
51
|
-
return devTty() ?? tput() ?? fallback;
|
|
52
|
-
}
|
|
53
|
-
return devTty() ?? tput() ?? resize() ?? fallback;
|
|
54
|
-
}
|
|
55
|
-
__name$b(terminalSize, "terminalSize");
|
|
56
|
-
const devTty = /* @__PURE__ */ __name$b(() => {
|
|
57
|
-
try {
|
|
58
|
-
const flags = process.platform === "darwin" ? fs.constants.O_EVTONLY | fs.constants.O_NONBLOCK : fs.constants.O_NONBLOCK;
|
|
59
|
-
const { columns, rows } = tty.WriteStream(fs.openSync("/dev/tty", flags));
|
|
60
|
-
return { columns, rows };
|
|
61
|
-
} catch {
|
|
62
|
-
}
|
|
63
|
-
}, "devTty");
|
|
64
|
-
const tput = /* @__PURE__ */ __name$b(() => {
|
|
65
|
-
try {
|
|
66
|
-
const columns = exec$1("tput", ["cols"], { env: { TERM: "dumb", ...process.env } });
|
|
67
|
-
const rows = exec$1("tput", ["lines"], { env: { TERM: "dumb", ...process.env } });
|
|
68
|
-
if (columns && rows) {
|
|
69
|
-
return createIfNotDefault(columns, rows);
|
|
70
|
-
}
|
|
71
|
-
} catch {
|
|
72
|
-
}
|
|
73
|
-
}, "tput");
|
|
74
|
-
const resize = /* @__PURE__ */ __name$b(() => {
|
|
75
|
-
try {
|
|
76
|
-
const size = exec$1("resize", ["-u"]).match(/\d+/g);
|
|
77
|
-
if (size.length === 2) {
|
|
78
|
-
return createIfNotDefault(size[0], size[1]);
|
|
79
|
-
}
|
|
80
|
-
} catch {
|
|
81
|
-
}
|
|
82
|
-
}, "resize");
|
|
83
|
-
|
|
84
|
-
var __defProp$a = Object.defineProperty;
|
|
85
|
-
var __name$a = (target, value) => __defProp$a(target, "name", { value, configurable: true });
|
|
86
|
-
function ansiRegex({ onlyFirst = false } = {}) {
|
|
87
|
-
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
88
|
-
const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
|
|
89
|
-
const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
|
|
90
|
-
const pattern = `${osc}|${csi}`;
|
|
91
|
-
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
|
92
|
-
}
|
|
93
|
-
__name$a(ansiRegex, "ansiRegex");
|
|
94
|
-
|
|
95
|
-
var __defProp$9 = Object.defineProperty;
|
|
96
|
-
var __name$9 = (target, value) => __defProp$9(target, "name", { value, configurable: true });
|
|
97
|
-
const regex = ansiRegex();
|
|
98
|
-
function stripAnsi(string) {
|
|
99
|
-
if (typeof string !== "string") {
|
|
100
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
101
|
-
}
|
|
102
|
-
return string.replace(regex, "");
|
|
103
|
-
}
|
|
104
|
-
__name$9(stripAnsi, "stripAnsi");
|
|
105
|
-
|
|
106
|
-
var __defProp$8 = Object.defineProperty;
|
|
107
|
-
var __name$8 = (target, value) => __defProp$8(target, "name", { value, configurable: true });
|
|
108
|
-
function isAmbiguous(x) {
|
|
109
|
-
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
110
|
-
}
|
|
111
|
-
__name$8(isAmbiguous, "isAmbiguous");
|
|
112
|
-
function isFullWidth(x) {
|
|
113
|
-
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
114
|
-
}
|
|
115
|
-
__name$8(isFullWidth, "isFullWidth");
|
|
116
|
-
function isWide(x) {
|
|
117
|
-
return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
118
|
-
}
|
|
119
|
-
__name$8(isWide, "isWide");
|
|
120
|
-
function getCategory(x) {
|
|
121
|
-
if (isAmbiguous(x)) return "ambiguous";
|
|
122
|
-
if (isFullWidth(x)) return "fullwidth";
|
|
123
|
-
if (x === 8361 || x >= 65377 && x <= 65470 || x >= 65474 && x <= 65479 || x >= 65482 && x <= 65487 || x >= 65490 && x <= 65495 || x >= 65498 && x <= 65500 || x >= 65512 && x <= 65518) {
|
|
124
|
-
return "halfwidth";
|
|
125
|
-
}
|
|
126
|
-
if (x >= 32 && x <= 126 || x === 162 || x === 163 || x === 165 || x === 166 || x === 172 || x === 175 || x >= 10214 && x <= 10221 || x === 10629 || x === 10630) {
|
|
127
|
-
return "narrow";
|
|
128
|
-
}
|
|
129
|
-
if (isWide(x)) return "wide";
|
|
130
|
-
return "neutral";
|
|
131
|
-
}
|
|
132
|
-
__name$8(getCategory, "getCategory");
|
|
133
|
-
|
|
134
|
-
var __defProp$7 = Object.defineProperty;
|
|
135
|
-
var __name$7 = (target, value) => __defProp$7(target, "name", { value, configurable: true });
|
|
136
|
-
function validate(codePoint) {
|
|
137
|
-
if (!Number.isSafeInteger(codePoint)) {
|
|
138
|
-
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
__name$7(validate, "validate");
|
|
142
|
-
function eastAsianWidthType(codePoint) {
|
|
143
|
-
validate(codePoint);
|
|
144
|
-
return getCategory(codePoint);
|
|
145
|
-
}
|
|
146
|
-
__name$7(eastAsianWidthType, "eastAsianWidthType");
|
|
147
|
-
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
148
|
-
validate(codePoint);
|
|
149
|
-
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
|
|
150
|
-
return 2;
|
|
151
|
-
}
|
|
152
|
-
return 1;
|
|
153
|
-
}
|
|
154
|
-
__name$7(eastAsianWidth, "eastAsianWidth");
|
|
155
|
-
|
|
156
|
-
var __defProp$6 = Object.defineProperty;
|
|
157
|
-
var __name$6 = (target, value) => __defProp$6(target, "name", { value, configurable: true });
|
|
158
|
-
const emojiRegex = /* @__PURE__ */ __name$6(() => {
|
|
159
|
-
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
160
|
-
}, "default");
|
|
161
|
-
|
|
162
|
-
var __defProp$5 = Object.defineProperty;
|
|
163
|
-
var __name$5 = (target, value) => __defProp$5(target, "name", { value, configurable: true });
|
|
164
|
-
const segmenter$1 = new Intl.Segmenter();
|
|
165
|
-
const defaultIgnorableCodePointRegex = new RegExp("^\\p{Default_Ignorable_Code_Point}$", "u");
|
|
166
|
-
function stringWidth(string, options = {}) {
|
|
167
|
-
if (typeof string !== "string" || string.length === 0) {
|
|
168
|
-
return 0;
|
|
169
|
-
}
|
|
170
|
-
const {
|
|
171
|
-
ambiguousIsNarrow = true,
|
|
172
|
-
countAnsiEscapeCodes = false
|
|
173
|
-
} = options;
|
|
174
|
-
if (!countAnsiEscapeCodes) {
|
|
175
|
-
string = stripAnsi(string);
|
|
176
|
-
}
|
|
177
|
-
if (string.length === 0) {
|
|
178
|
-
return 0;
|
|
179
|
-
}
|
|
180
|
-
let width = 0;
|
|
181
|
-
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
182
|
-
for (const { segment: character } of segmenter$1.segment(string)) {
|
|
183
|
-
const codePoint = character.codePointAt(0);
|
|
184
|
-
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
|
|
185
|
-
continue;
|
|
186
|
-
}
|
|
187
|
-
if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
|
|
188
|
-
continue;
|
|
189
|
-
}
|
|
190
|
-
if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
|
|
191
|
-
continue;
|
|
192
|
-
}
|
|
193
|
-
if (codePoint >= 55296 && codePoint <= 57343) {
|
|
194
|
-
continue;
|
|
195
|
-
}
|
|
196
|
-
if (codePoint >= 65024 && codePoint <= 65039) {
|
|
197
|
-
continue;
|
|
198
|
-
}
|
|
199
|
-
if (defaultIgnorableCodePointRegex.test(character)) {
|
|
200
|
-
continue;
|
|
201
|
-
}
|
|
202
|
-
if (emojiRegex().test(character)) {
|
|
203
|
-
width += 2;
|
|
204
|
-
continue;
|
|
205
|
-
}
|
|
206
|
-
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
207
|
-
}
|
|
208
|
-
return width;
|
|
209
|
-
}
|
|
210
|
-
__name$5(stringWidth, "stringWidth");
|
|
211
|
-
|
|
212
|
-
var __defProp$4 = Object.defineProperty;
|
|
213
|
-
var __name$4 = (target, value) => __defProp$4(target, "name", { value, configurable: true });
|
|
214
|
-
const ANSI_BACKGROUND_OFFSET = 10;
|
|
215
|
-
const wrapAnsi16 = /* @__PURE__ */ __name$4((offset = 0) => (code) => `\x1B[${code + offset}m`, "wrapAnsi16");
|
|
216
|
-
const wrapAnsi256 = /* @__PURE__ */ __name$4((offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`, "wrapAnsi256");
|
|
217
|
-
const wrapAnsi16m = /* @__PURE__ */ __name$4((offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`, "wrapAnsi16m");
|
|
218
|
-
const styles = {
|
|
219
|
-
modifier: {
|
|
220
|
-
reset: [0, 0],
|
|
221
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
222
|
-
bold: [1, 22],
|
|
223
|
-
dim: [2, 22],
|
|
224
|
-
italic: [3, 23],
|
|
225
|
-
underline: [4, 24],
|
|
226
|
-
overline: [53, 55],
|
|
227
|
-
inverse: [7, 27],
|
|
228
|
-
hidden: [8, 28],
|
|
229
|
-
strikethrough: [9, 29]
|
|
230
|
-
},
|
|
231
|
-
color: {
|
|
232
|
-
black: [30, 39],
|
|
233
|
-
red: [31, 39],
|
|
234
|
-
green: [32, 39],
|
|
235
|
-
yellow: [33, 39],
|
|
236
|
-
blue: [34, 39],
|
|
237
|
-
magenta: [35, 39],
|
|
238
|
-
cyan: [36, 39],
|
|
239
|
-
white: [37, 39],
|
|
240
|
-
// Bright color
|
|
241
|
-
blackBright: [90, 39],
|
|
242
|
-
gray: [90, 39],
|
|
243
|
-
// Alias of `blackBright`
|
|
244
|
-
grey: [90, 39],
|
|
245
|
-
// Alias of `blackBright`
|
|
246
|
-
redBright: [91, 39],
|
|
247
|
-
greenBright: [92, 39],
|
|
248
|
-
yellowBright: [93, 39],
|
|
249
|
-
blueBright: [94, 39],
|
|
250
|
-
magentaBright: [95, 39],
|
|
251
|
-
cyanBright: [96, 39],
|
|
252
|
-
whiteBright: [97, 39]
|
|
253
|
-
},
|
|
254
|
-
bgColor: {
|
|
255
|
-
bgBlack: [40, 49],
|
|
256
|
-
bgRed: [41, 49],
|
|
257
|
-
bgGreen: [42, 49],
|
|
258
|
-
bgYellow: [43, 49],
|
|
259
|
-
bgBlue: [44, 49],
|
|
260
|
-
bgMagenta: [45, 49],
|
|
261
|
-
bgCyan: [46, 49],
|
|
262
|
-
bgWhite: [47, 49],
|
|
263
|
-
// Bright color
|
|
264
|
-
bgBlackBright: [100, 49],
|
|
265
|
-
bgGray: [100, 49],
|
|
266
|
-
// Alias of `bgBlackBright`
|
|
267
|
-
bgGrey: [100, 49],
|
|
268
|
-
// Alias of `bgBlackBright`
|
|
269
|
-
bgRedBright: [101, 49],
|
|
270
|
-
bgGreenBright: [102, 49],
|
|
271
|
-
bgYellowBright: [103, 49],
|
|
272
|
-
bgBlueBright: [104, 49],
|
|
273
|
-
bgMagentaBright: [105, 49],
|
|
274
|
-
bgCyanBright: [106, 49],
|
|
275
|
-
bgWhiteBright: [107, 49]
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
function assembleStyles() {
|
|
279
|
-
const codes = /* @__PURE__ */ new Map();
|
|
280
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
281
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
282
|
-
styles[styleName] = {
|
|
283
|
-
open: `\x1B[${style[0]}m`,
|
|
284
|
-
close: `\x1B[${style[1]}m`
|
|
285
|
-
};
|
|
286
|
-
group[styleName] = styles[styleName];
|
|
287
|
-
codes.set(style[0], style[1]);
|
|
288
|
-
}
|
|
289
|
-
Object.defineProperty(styles, groupName, {
|
|
290
|
-
value: group,
|
|
291
|
-
enumerable: false
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
Object.defineProperty(styles, "codes", {
|
|
295
|
-
value: codes,
|
|
296
|
-
enumerable: false
|
|
297
|
-
});
|
|
298
|
-
styles.color.close = "\x1B[39m";
|
|
299
|
-
styles.bgColor.close = "\x1B[49m";
|
|
300
|
-
styles.color.ansi = wrapAnsi16();
|
|
301
|
-
styles.color.ansi256 = wrapAnsi256();
|
|
302
|
-
styles.color.ansi16m = wrapAnsi16m();
|
|
303
|
-
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
304
|
-
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
305
|
-
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
306
|
-
Object.defineProperties(styles, {
|
|
307
|
-
rgbToAnsi256: {
|
|
308
|
-
value: /* @__PURE__ */ __name$4((red, green, blue) => {
|
|
309
|
-
if (red === green && green === blue) {
|
|
310
|
-
if (red < 8) {
|
|
311
|
-
return 16;
|
|
312
|
-
}
|
|
313
|
-
if (red > 248) {
|
|
314
|
-
return 231;
|
|
315
|
-
}
|
|
316
|
-
return Math.round((red - 8) / 247 * 24) + 232;
|
|
317
|
-
}
|
|
318
|
-
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
319
|
-
}, "value"),
|
|
320
|
-
enumerable: false
|
|
321
|
-
},
|
|
322
|
-
hexToRgb: {
|
|
323
|
-
value: /* @__PURE__ */ __name$4((hex) => {
|
|
324
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
325
|
-
if (!matches) {
|
|
326
|
-
return [0, 0, 0];
|
|
327
|
-
}
|
|
328
|
-
let [colorString] = matches;
|
|
329
|
-
if (colorString.length === 3) {
|
|
330
|
-
colorString = [...colorString].map((character) => character + character).join("");
|
|
331
|
-
}
|
|
332
|
-
const integer = Number.parseInt(colorString, 16);
|
|
333
|
-
return [
|
|
334
|
-
/* eslint-disable no-bitwise */
|
|
335
|
-
integer >> 16 & 255,
|
|
336
|
-
integer >> 8 & 255,
|
|
337
|
-
integer & 255
|
|
338
|
-
/* eslint-enable no-bitwise */
|
|
339
|
-
];
|
|
340
|
-
}, "value"),
|
|
341
|
-
enumerable: false
|
|
342
|
-
},
|
|
343
|
-
hexToAnsi256: {
|
|
344
|
-
value: /* @__PURE__ */ __name$4((hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)), "value"),
|
|
345
|
-
enumerable: false
|
|
346
|
-
},
|
|
347
|
-
ansi256ToAnsi: {
|
|
348
|
-
value: /* @__PURE__ */ __name$4((code) => {
|
|
349
|
-
if (code < 8) {
|
|
350
|
-
return 30 + code;
|
|
351
|
-
}
|
|
352
|
-
if (code < 16) {
|
|
353
|
-
return 90 + (code - 8);
|
|
354
|
-
}
|
|
355
|
-
let red;
|
|
356
|
-
let green;
|
|
357
|
-
let blue;
|
|
358
|
-
if (code >= 232) {
|
|
359
|
-
red = ((code - 232) * 10 + 8) / 255;
|
|
360
|
-
green = red;
|
|
361
|
-
blue = red;
|
|
362
|
-
} else {
|
|
363
|
-
code -= 16;
|
|
364
|
-
const remainder = code % 36;
|
|
365
|
-
red = Math.floor(code / 36) / 5;
|
|
366
|
-
green = Math.floor(remainder / 6) / 5;
|
|
367
|
-
blue = remainder % 6 / 5;
|
|
368
|
-
}
|
|
369
|
-
const value = Math.max(red, green, blue) * 2;
|
|
370
|
-
if (value === 0) {
|
|
371
|
-
return 30;
|
|
372
|
-
}
|
|
373
|
-
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
374
|
-
if (value === 2) {
|
|
375
|
-
result += 60;
|
|
376
|
-
}
|
|
377
|
-
return result;
|
|
378
|
-
}, "value"),
|
|
379
|
-
enumerable: false
|
|
380
|
-
},
|
|
381
|
-
rgbToAnsi: {
|
|
382
|
-
value: /* @__PURE__ */ __name$4((red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), "value"),
|
|
383
|
-
enumerable: false
|
|
384
|
-
},
|
|
385
|
-
hexToAnsi: {
|
|
386
|
-
value: /* @__PURE__ */ __name$4((hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), "value"),
|
|
387
|
-
enumerable: false
|
|
388
|
-
}
|
|
389
|
-
});
|
|
390
|
-
return styles;
|
|
391
|
-
}
|
|
392
|
-
__name$4(assembleStyles, "assembleStyles");
|
|
393
|
-
const ansiStyles = assembleStyles();
|
|
394
|
-
|
|
395
|
-
var __defProp$3 = Object.defineProperty;
|
|
396
|
-
var __name$3 = (target, value) => __defProp$3(target, "name", { value, configurable: true });
|
|
397
|
-
const ESCAPES = /* @__PURE__ */ new Set([
|
|
398
|
-
"\x1B",
|
|
399
|
-
""
|
|
400
|
-
]);
|
|
401
|
-
const END_CODE = 39;
|
|
402
|
-
const ANSI_ESCAPE_BELL = "\x07";
|
|
403
|
-
const ANSI_CSI = "[";
|
|
404
|
-
const ANSI_OSC = "]";
|
|
405
|
-
const ANSI_SGR_TERMINATOR = "m";
|
|
406
|
-
const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
407
|
-
const wrapAnsiCode = /* @__PURE__ */ __name$3((code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`, "wrapAnsiCode");
|
|
408
|
-
const wrapAnsiHyperlink = /* @__PURE__ */ __name$3((url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`, "wrapAnsiHyperlink");
|
|
409
|
-
const wordLengths = /* @__PURE__ */ __name$3((string) => string.split(" ").map((character) => stringWidth(character)), "wordLengths");
|
|
410
|
-
const wrapWord = /* @__PURE__ */ __name$3((rows, word, columns) => {
|
|
411
|
-
const characters = [...word];
|
|
412
|
-
let isInsideEscape = false;
|
|
413
|
-
let isInsideLinkEscape = false;
|
|
414
|
-
let visible = stringWidth(stripAnsi(rows.at(-1)));
|
|
415
|
-
for (const [index, character] of characters.entries()) {
|
|
416
|
-
const characterLength = stringWidth(character);
|
|
417
|
-
if (visible + characterLength <= columns) {
|
|
418
|
-
rows[rows.length - 1] += character;
|
|
419
|
-
} else {
|
|
420
|
-
rows.push(character);
|
|
421
|
-
visible = 0;
|
|
422
|
-
}
|
|
423
|
-
if (ESCAPES.has(character)) {
|
|
424
|
-
isInsideEscape = true;
|
|
425
|
-
const ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join("");
|
|
426
|
-
isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
|
|
427
|
-
}
|
|
428
|
-
if (isInsideEscape) {
|
|
429
|
-
if (isInsideLinkEscape) {
|
|
430
|
-
if (character === ANSI_ESCAPE_BELL) {
|
|
431
|
-
isInsideEscape = false;
|
|
432
|
-
isInsideLinkEscape = false;
|
|
433
|
-
}
|
|
434
|
-
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
435
|
-
isInsideEscape = false;
|
|
436
|
-
}
|
|
437
|
-
continue;
|
|
438
|
-
}
|
|
439
|
-
visible += characterLength;
|
|
440
|
-
if (visible === columns && index < characters.length - 1) {
|
|
441
|
-
rows.push("");
|
|
442
|
-
visible = 0;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
if (!visible && rows.at(-1).length > 0 && rows.length > 1) {
|
|
446
|
-
rows[rows.length - 2] += rows.pop();
|
|
447
|
-
}
|
|
448
|
-
}, "wrapWord");
|
|
449
|
-
const stringVisibleTrimSpacesRight = /* @__PURE__ */ __name$3((string) => {
|
|
450
|
-
const words = string.split(" ");
|
|
451
|
-
let last = words.length;
|
|
452
|
-
while (last > 0) {
|
|
453
|
-
if (stringWidth(words[last - 1]) > 0) {
|
|
454
|
-
break;
|
|
455
|
-
}
|
|
456
|
-
last--;
|
|
457
|
-
}
|
|
458
|
-
if (last === words.length) {
|
|
459
|
-
return string;
|
|
460
|
-
}
|
|
461
|
-
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
462
|
-
}, "stringVisibleTrimSpacesRight");
|
|
463
|
-
const exec = /* @__PURE__ */ __name$3((string, columns, options = {}) => {
|
|
464
|
-
if (options.trim !== false && string.trim() === "") {
|
|
465
|
-
return "";
|
|
466
|
-
}
|
|
467
|
-
let returnValue = "";
|
|
468
|
-
let escapeCode;
|
|
469
|
-
let escapeUrl;
|
|
470
|
-
const lengths = wordLengths(string);
|
|
471
|
-
let rows = [""];
|
|
472
|
-
for (const [index, word] of string.split(" ").entries()) {
|
|
473
|
-
if (options.trim !== false) {
|
|
474
|
-
rows[rows.length - 1] = rows.at(-1).trimStart();
|
|
475
|
-
}
|
|
476
|
-
let rowLength = stringWidth(rows.at(-1));
|
|
477
|
-
if (index !== 0) {
|
|
478
|
-
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
479
|
-
rows.push("");
|
|
480
|
-
rowLength = 0;
|
|
481
|
-
}
|
|
482
|
-
if (rowLength > 0 || options.trim === false) {
|
|
483
|
-
rows[rows.length - 1] += " ";
|
|
484
|
-
rowLength++;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
if (options.hard && lengths[index] > columns) {
|
|
488
|
-
const remainingColumns = columns - rowLength;
|
|
489
|
-
const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
|
|
490
|
-
const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
|
|
491
|
-
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
492
|
-
rows.push("");
|
|
493
|
-
}
|
|
494
|
-
wrapWord(rows, word, columns);
|
|
495
|
-
continue;
|
|
496
|
-
}
|
|
497
|
-
if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
|
|
498
|
-
if (options.wordWrap === false && rowLength < columns) {
|
|
499
|
-
wrapWord(rows, word, columns);
|
|
500
|
-
continue;
|
|
501
|
-
}
|
|
502
|
-
rows.push("");
|
|
503
|
-
}
|
|
504
|
-
if (rowLength + lengths[index] > columns && options.wordWrap === false) {
|
|
505
|
-
wrapWord(rows, word, columns);
|
|
506
|
-
continue;
|
|
507
|
-
}
|
|
508
|
-
rows[rows.length - 1] += word;
|
|
509
|
-
}
|
|
510
|
-
if (options.trim !== false) {
|
|
511
|
-
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
512
|
-
}
|
|
513
|
-
const preString = rows.join("\n");
|
|
514
|
-
const pre = [...preString];
|
|
515
|
-
let preStringIndex = 0;
|
|
516
|
-
for (const [index, character] of pre.entries()) {
|
|
517
|
-
returnValue += character;
|
|
518
|
-
if (ESCAPES.has(character)) {
|
|
519
|
-
const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || { groups: {} };
|
|
520
|
-
if (groups.code !== void 0) {
|
|
521
|
-
const code2 = Number.parseFloat(groups.code);
|
|
522
|
-
escapeCode = code2 === END_CODE ? void 0 : code2;
|
|
523
|
-
} else if (groups.uri !== void 0) {
|
|
524
|
-
escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
const code = ansiStyles.codes.get(Number(escapeCode));
|
|
528
|
-
if (pre[index + 1] === "\n") {
|
|
529
|
-
if (escapeUrl) {
|
|
530
|
-
returnValue += wrapAnsiHyperlink("");
|
|
531
|
-
}
|
|
532
|
-
if (escapeCode && code) {
|
|
533
|
-
returnValue += wrapAnsiCode(code);
|
|
534
|
-
}
|
|
535
|
-
} else if (character === "\n") {
|
|
536
|
-
if (escapeCode && code) {
|
|
537
|
-
returnValue += wrapAnsiCode(escapeCode);
|
|
538
|
-
}
|
|
539
|
-
if (escapeUrl) {
|
|
540
|
-
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
preStringIndex += character.length;
|
|
544
|
-
}
|
|
545
|
-
return returnValue;
|
|
546
|
-
}, "exec");
|
|
547
|
-
function wrapAnsi(string, columns, options) {
|
|
548
|
-
return String(string).normalize().replaceAll("\r\n", "\n").split("\n").map((line) => exec(line, columns, options)).join("\n");
|
|
549
|
-
}
|
|
550
|
-
__name$3(wrapAnsi, "wrapAnsi");
|
|
551
|
-
|
|
552
|
-
var __defProp$2 = Object.defineProperty;
|
|
553
|
-
var __name$2 = (target, value) => __defProp$2(target, "name", { value, configurable: true });
|
|
554
|
-
const segmenter = new Intl.Segmenter();
|
|
555
|
-
function stringLength(string, { countAnsiEscapeCodes = false } = {}) {
|
|
556
|
-
if (string === "") {
|
|
557
|
-
return 0;
|
|
558
|
-
}
|
|
559
|
-
if (!countAnsiEscapeCodes) {
|
|
560
|
-
string = stripAnsi(string);
|
|
561
|
-
}
|
|
562
|
-
if (string === "") {
|
|
563
|
-
return 0;
|
|
564
|
-
}
|
|
565
|
-
let length = 0;
|
|
566
|
-
for (const _ of segmenter.segment(string)) {
|
|
567
|
-
length++;
|
|
568
|
-
}
|
|
569
|
-
return length;
|
|
570
|
-
}
|
|
571
|
-
__name$2(stringLength, "stringLength");
|
|
572
|
-
|
|
573
|
-
var __defProp$1 = Object.defineProperty;
|
|
574
|
-
var __name$1 = (target, value) => __defProp$1(target, "name", { value, configurable: true });
|
|
575
|
-
const defaultInspectorConfig = {
|
|
576
|
-
indent: 2,
|
|
577
|
-
quoteStyle: "single",
|
|
578
|
-
stylize: /* @__PURE__ */ __name$1((string_, style) => {
|
|
579
|
-
const styles = {
|
|
580
|
-
bigint: yellow,
|
|
581
|
-
boolean: yellow,
|
|
582
|
-
date: magenta,
|
|
583
|
-
null: bold,
|
|
584
|
-
number: yellow,
|
|
585
|
-
regexp: red,
|
|
586
|
-
special: cyan,
|
|
587
|
-
string: green,
|
|
588
|
-
symbol: green,
|
|
589
|
-
undefined: grey
|
|
590
|
-
};
|
|
591
|
-
if (styles[style] === void 0) {
|
|
592
|
-
return string_;
|
|
593
|
-
}
|
|
594
|
-
return styles[style](string_);
|
|
595
|
-
}, "stylize")
|
|
596
|
-
};
|
|
597
|
-
|
|
598
|
-
var __defProp = Object.defineProperty;
|
|
599
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
600
|
-
const formatLabel = /* @__PURE__ */ __name((label, styles) => {
|
|
601
|
-
let formattedLabel = styles.uppercase.label ? label.toUpperCase() : label;
|
|
602
|
-
formattedLabel = styles.underline.label ? underline(formattedLabel) : formattedLabel;
|
|
603
|
-
if (styles.bold.label) {
|
|
604
|
-
formattedLabel = bold(formattedLabel);
|
|
605
|
-
}
|
|
606
|
-
return formattedLabel;
|
|
607
|
-
}, "formatLabel");
|
|
608
|
-
|
|
609
|
-
export { defaultInspectorConfig as d, formatLabel as f, stringLength as s, terminalSize as t, wrapAnsi as w };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
const getLongestLabel = /* @__PURE__ */ __name((types) => {
|
|
4
|
-
const labels = Object.keys(types).map((x) => types[x].label ?? "");
|
|
5
|
-
if (labels.length === 0) {
|
|
6
|
-
return "";
|
|
7
|
-
}
|
|
8
|
-
return labels.reduce((x, y) => x.length > y.length ? x : y);
|
|
9
|
-
}, "getLongestLabel");
|
|
10
|
-
|
|
11
|
-
export { getLongestLabel as g };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
-
const getLongestLabel = /* @__PURE__ */ __name((types) => {
|
|
6
|
-
const labels = Object.keys(types).map((x) => types[x].label ?? "");
|
|
7
|
-
if (labels.length === 0) {
|
|
8
|
-
return "";
|
|
9
|
-
}
|
|
10
|
-
return labels.reduce((x, y) => x.length > y.length ? x : y);
|
|
11
|
-
}, "getLongestLabel");
|
|
12
|
-
|
|
13
|
-
exports.getLongestLabel = getLongestLabel;
|