semantic-release-lerna 2.9.0 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +272 -1762
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -332,8 +332,8 @@ var require_escape = __commonJS({
|
|
|
332
332
|
}
|
|
333
333
|
function escapeArgument(arg, doubleEscapeMetaChars) {
|
|
334
334
|
arg = `${arg}`;
|
|
335
|
-
arg = arg.replace(/(
|
|
336
|
-
arg = arg.replace(/(
|
|
335
|
+
arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
|
|
336
|
+
arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
337
337
|
arg = `"${arg}"`;
|
|
338
338
|
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
339
339
|
if (doubleEscapeMetaChars) {
|
|
@@ -479,7 +479,7 @@ var require_enoent = __commonJS({
|
|
|
479
479
|
const originalEmit = cp.emit;
|
|
480
480
|
cp.emit = function(name, arg1) {
|
|
481
481
|
if (name === "exit") {
|
|
482
|
-
const err = verifyENOENT(arg1, parsed
|
|
482
|
+
const err = verifyENOENT(arg1, parsed);
|
|
483
483
|
if (err) {
|
|
484
484
|
return originalEmit.call(cp, "error", err);
|
|
485
485
|
}
|
|
@@ -9067,7 +9067,7 @@ var require_hosts = __commonJS({
|
|
|
9067
9067
|
"use strict";
|
|
9068
9068
|
var maybeJoin = (...args) => args.every((arg) => arg) ? args.join("") : "";
|
|
9069
9069
|
var maybeEncode = (arg) => arg ? encodeURIComponent(arg) : "";
|
|
9070
|
-
var formatHashFragment = (f) => f.toLowerCase().replace(/^\W
|
|
9070
|
+
var formatHashFragment = (f) => f.toLowerCase().replace(/^\W+/g, "").replace(/(?<!\W)\W+$/, "").replace(/\//g, "").replace(/\W+/g, "-");
|
|
9071
9071
|
var defaults2 = {
|
|
9072
9072
|
sshtemplate: ({ domain, user, project, committish }) => `git@${domain}:${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
9073
9073
|
sshurltemplate: ({ domain, user, project, committish }) => `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
|
|
@@ -11200,6 +11200,7 @@ var require_npa = __commonJS({
|
|
|
11200
11200
|
var isURL = /^(?:git[+])?[a-z]+:/i;
|
|
11201
11201
|
var isGit = /^[^@]+@[^:.]+\.[^:]+:.+$/i;
|
|
11202
11202
|
var isFilename = /[.](?:tgz|tar.gz|tar)$/i;
|
|
11203
|
+
var isPortNumber = /:[0-9]+(\/|$)/i;
|
|
11203
11204
|
function npa2(arg, where) {
|
|
11204
11205
|
let name;
|
|
11205
11206
|
let spec;
|
|
@@ -11447,7 +11448,7 @@ var require_npa = __commonJS({
|
|
|
11447
11448
|
res.saveSpec = rawSpec;
|
|
11448
11449
|
if (rawSpec.startsWith("git+ssh:")) {
|
|
11449
11450
|
const matched = rawSpec.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i);
|
|
11450
|
-
if (matched && !matched[1].match(
|
|
11451
|
+
if (matched && !matched[1].match(isPortNumber)) {
|
|
11451
11452
|
res.type = "git";
|
|
11452
11453
|
setGitAttrs(res, matched[2]);
|
|
11453
11454
|
res.fetchSpec = matched[1];
|
|
@@ -11746,50 +11747,64 @@ var require_common3 = __commonJS({
|
|
|
11746
11747
|
createDebug2.namespaces = namespaces;
|
|
11747
11748
|
createDebug2.names = [];
|
|
11748
11749
|
createDebug2.skips = [];
|
|
11749
|
-
|
|
11750
|
-
|
|
11751
|
-
|
|
11752
|
-
|
|
11753
|
-
|
|
11754
|
-
|
|
11750
|
+
const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
|
|
11751
|
+
for (const ns of split) {
|
|
11752
|
+
if (ns[0] === "-") {
|
|
11753
|
+
createDebug2.skips.push(ns.slice(1));
|
|
11754
|
+
} else {
|
|
11755
|
+
createDebug2.names.push(ns);
|
|
11755
11756
|
}
|
|
11756
|
-
|
|
11757
|
-
|
|
11758
|
-
|
|
11757
|
+
}
|
|
11758
|
+
}
|
|
11759
|
+
function matchesTemplate(search, template) {
|
|
11760
|
+
let searchIndex = 0;
|
|
11761
|
+
let templateIndex = 0;
|
|
11762
|
+
let starIndex = -1;
|
|
11763
|
+
let matchIndex = 0;
|
|
11764
|
+
while (searchIndex < search.length) {
|
|
11765
|
+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
11766
|
+
if (template[templateIndex] === "*") {
|
|
11767
|
+
starIndex = templateIndex;
|
|
11768
|
+
matchIndex = searchIndex;
|
|
11769
|
+
templateIndex++;
|
|
11770
|
+
} else {
|
|
11771
|
+
searchIndex++;
|
|
11772
|
+
templateIndex++;
|
|
11773
|
+
}
|
|
11774
|
+
} else if (starIndex !== -1) {
|
|
11775
|
+
templateIndex = starIndex + 1;
|
|
11776
|
+
matchIndex++;
|
|
11777
|
+
searchIndex = matchIndex;
|
|
11759
11778
|
} else {
|
|
11760
|
-
|
|
11779
|
+
return false;
|
|
11761
11780
|
}
|
|
11762
11781
|
}
|
|
11782
|
+
while (templateIndex < template.length && template[templateIndex] === "*") {
|
|
11783
|
+
templateIndex++;
|
|
11784
|
+
}
|
|
11785
|
+
return templateIndex === template.length;
|
|
11763
11786
|
}
|
|
11764
11787
|
function disable() {
|
|
11765
11788
|
const namespaces = [
|
|
11766
|
-
...createDebug2.names
|
|
11767
|
-
...createDebug2.skips.map(
|
|
11789
|
+
...createDebug2.names,
|
|
11790
|
+
...createDebug2.skips.map((namespace) => "-" + namespace)
|
|
11768
11791
|
].join(",");
|
|
11769
11792
|
createDebug2.enable("");
|
|
11770
11793
|
return namespaces;
|
|
11771
11794
|
}
|
|
11772
11795
|
function enabled(name) {
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
}
|
|
11776
|
-
let i2;
|
|
11777
|
-
let len;
|
|
11778
|
-
for (i2 = 0, len = createDebug2.skips.length; i2 < len; i2++) {
|
|
11779
|
-
if (createDebug2.skips[i2].test(name)) {
|
|
11796
|
+
for (const skip of createDebug2.skips) {
|
|
11797
|
+
if (matchesTemplate(name, skip)) {
|
|
11780
11798
|
return false;
|
|
11781
11799
|
}
|
|
11782
11800
|
}
|
|
11783
|
-
for (
|
|
11784
|
-
if (
|
|
11801
|
+
for (const ns of createDebug2.names) {
|
|
11802
|
+
if (matchesTemplate(name, ns)) {
|
|
11785
11803
|
return true;
|
|
11786
11804
|
}
|
|
11787
11805
|
}
|
|
11788
11806
|
return false;
|
|
11789
11807
|
}
|
|
11790
|
-
function toNamespace(regexp) {
|
|
11791
|
-
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
|
|
11792
|
-
}
|
|
11793
11808
|
function coerce(val) {
|
|
11794
11809
|
if (val instanceof Error) {
|
|
11795
11810
|
return val.stack || val.message;
|
|
@@ -11980,12 +11995,11 @@ var require_browser = __commonJS({
|
|
|
11980
11995
|
var require_has_flag = __commonJS({
|
|
11981
11996
|
"node_modules/has-flag/index.js"(exports, module) {
|
|
11982
11997
|
"use strict";
|
|
11983
|
-
module.exports = (flag, argv) => {
|
|
11984
|
-
argv = argv || process.argv;
|
|
11998
|
+
module.exports = (flag, argv = process.argv) => {
|
|
11985
11999
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
11986
|
-
const
|
|
11987
|
-
const
|
|
11988
|
-
return
|
|
12000
|
+
const position = argv.indexOf(prefix + flag);
|
|
12001
|
+
const terminatorPosition = argv.indexOf("--");
|
|
12002
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
11989
12003
|
};
|
|
11990
12004
|
}
|
|
11991
12005
|
});
|
|
@@ -11995,16 +12009,23 @@ var require_supports_color = __commonJS({
|
|
|
11995
12009
|
"node_modules/supports-color/index.js"(exports, module) {
|
|
11996
12010
|
"use strict";
|
|
11997
12011
|
var os3 = __require("os");
|
|
12012
|
+
var tty3 = __require("tty");
|
|
11998
12013
|
var hasFlag = require_has_flag();
|
|
11999
|
-
var env = process
|
|
12014
|
+
var { env } = process;
|
|
12000
12015
|
var forceColor;
|
|
12001
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) {
|
|
12002
|
-
forceColor =
|
|
12016
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
12017
|
+
forceColor = 0;
|
|
12003
12018
|
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
12004
|
-
forceColor =
|
|
12019
|
+
forceColor = 1;
|
|
12005
12020
|
}
|
|
12006
12021
|
if ("FORCE_COLOR" in env) {
|
|
12007
|
-
|
|
12022
|
+
if (env.FORCE_COLOR === "true") {
|
|
12023
|
+
forceColor = 1;
|
|
12024
|
+
} else if (env.FORCE_COLOR === "false") {
|
|
12025
|
+
forceColor = 0;
|
|
12026
|
+
} else {
|
|
12027
|
+
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
12028
|
+
}
|
|
12008
12029
|
}
|
|
12009
12030
|
function translateLevel(level) {
|
|
12010
12031
|
if (level === 0) {
|
|
@@ -12017,8 +12038,8 @@ var require_supports_color = __commonJS({
|
|
|
12017
12038
|
has16m: level >= 3
|
|
12018
12039
|
};
|
|
12019
12040
|
}
|
|
12020
|
-
function supportsColor(
|
|
12021
|
-
if (forceColor ===
|
|
12041
|
+
function supportsColor(haveStream, streamIsTTY) {
|
|
12042
|
+
if (forceColor === 0) {
|
|
12022
12043
|
return 0;
|
|
12023
12044
|
}
|
|
12024
12045
|
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
@@ -12027,19 +12048,22 @@ var require_supports_color = __commonJS({
|
|
|
12027
12048
|
if (hasFlag("color=256")) {
|
|
12028
12049
|
return 2;
|
|
12029
12050
|
}
|
|
12030
|
-
if (
|
|
12051
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
12031
12052
|
return 0;
|
|
12032
12053
|
}
|
|
12033
|
-
const min = forceColor
|
|
12054
|
+
const min = forceColor || 0;
|
|
12055
|
+
if (env.TERM === "dumb") {
|
|
12056
|
+
return min;
|
|
12057
|
+
}
|
|
12034
12058
|
if (process.platform === "win32") {
|
|
12035
12059
|
const osRelease = os3.release().split(".");
|
|
12036
|
-
if (Number(
|
|
12060
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
12037
12061
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
12038
12062
|
}
|
|
12039
12063
|
return 1;
|
|
12040
12064
|
}
|
|
12041
12065
|
if ("CI" in env) {
|
|
12042
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
12066
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
12043
12067
|
return 1;
|
|
12044
12068
|
}
|
|
12045
12069
|
return min;
|
|
@@ -12068,19 +12092,16 @@ var require_supports_color = __commonJS({
|
|
|
12068
12092
|
if ("COLORTERM" in env) {
|
|
12069
12093
|
return 1;
|
|
12070
12094
|
}
|
|
12071
|
-
if (env.TERM === "dumb") {
|
|
12072
|
-
return min;
|
|
12073
|
-
}
|
|
12074
12095
|
return min;
|
|
12075
12096
|
}
|
|
12076
12097
|
function getSupportLevel(stream) {
|
|
12077
|
-
const level = supportsColor(stream);
|
|
12098
|
+
const level = supportsColor(stream, stream && stream.isTTY);
|
|
12078
12099
|
return translateLevel(level);
|
|
12079
12100
|
}
|
|
12080
12101
|
module.exports = {
|
|
12081
12102
|
supportsColor: getSupportLevel,
|
|
12082
|
-
stdout:
|
|
12083
|
-
stderr:
|
|
12103
|
+
stdout: translateLevel(supportsColor(true, tty3.isatty(1))),
|
|
12104
|
+
stderr: translateLevel(supportsColor(true, tty3.isatty(2)))
|
|
12084
12105
|
};
|
|
12085
12106
|
}
|
|
12086
12107
|
});
|
|
@@ -12270,6 +12291,78 @@ var require_src = __commonJS({
|
|
|
12270
12291
|
}
|
|
12271
12292
|
});
|
|
12272
12293
|
|
|
12294
|
+
// node_modules/picocolors/picocolors.js
|
|
12295
|
+
var require_picocolors = __commonJS({
|
|
12296
|
+
"node_modules/picocolors/picocolors.js"(exports, module) {
|
|
12297
|
+
var p = process || {};
|
|
12298
|
+
var argv = p.argv || [];
|
|
12299
|
+
var env = p.env || {};
|
|
12300
|
+
var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
12301
|
+
var formatter = (open, close, replace = open) => (input) => {
|
|
12302
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
12303
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
12304
|
+
};
|
|
12305
|
+
var replaceClose = (string, close, replace, index) => {
|
|
12306
|
+
let result = "", cursor = 0;
|
|
12307
|
+
do {
|
|
12308
|
+
result += string.substring(cursor, index) + replace;
|
|
12309
|
+
cursor = index + close.length;
|
|
12310
|
+
index = string.indexOf(close, cursor);
|
|
12311
|
+
} while (~index);
|
|
12312
|
+
return result + string.substring(cursor);
|
|
12313
|
+
};
|
|
12314
|
+
var createColors = (enabled = isColorSupported) => {
|
|
12315
|
+
let f = enabled ? formatter : () => String;
|
|
12316
|
+
return {
|
|
12317
|
+
isColorSupported: enabled,
|
|
12318
|
+
reset: f("\x1B[0m", "\x1B[0m"),
|
|
12319
|
+
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
12320
|
+
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
12321
|
+
italic: f("\x1B[3m", "\x1B[23m"),
|
|
12322
|
+
underline: f("\x1B[4m", "\x1B[24m"),
|
|
12323
|
+
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
12324
|
+
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
12325
|
+
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
12326
|
+
black: f("\x1B[30m", "\x1B[39m"),
|
|
12327
|
+
red: f("\x1B[31m", "\x1B[39m"),
|
|
12328
|
+
green: f("\x1B[32m", "\x1B[39m"),
|
|
12329
|
+
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
12330
|
+
blue: f("\x1B[34m", "\x1B[39m"),
|
|
12331
|
+
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
12332
|
+
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
12333
|
+
white: f("\x1B[37m", "\x1B[39m"),
|
|
12334
|
+
gray: f("\x1B[90m", "\x1B[39m"),
|
|
12335
|
+
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
12336
|
+
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
12337
|
+
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
12338
|
+
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
12339
|
+
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
12340
|
+
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
12341
|
+
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
12342
|
+
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
12343
|
+
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
12344
|
+
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
12345
|
+
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
12346
|
+
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
12347
|
+
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
12348
|
+
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
12349
|
+
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
12350
|
+
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
12351
|
+
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
12352
|
+
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
12353
|
+
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
12354
|
+
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
12355
|
+
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
12356
|
+
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
12357
|
+
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
12358
|
+
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
12359
|
+
};
|
|
12360
|
+
};
|
|
12361
|
+
module.exports = createColors();
|
|
12362
|
+
module.exports.createColors = createColors;
|
|
12363
|
+
}
|
|
12364
|
+
});
|
|
12365
|
+
|
|
12273
12366
|
// node_modules/js-tokens/index.js
|
|
12274
12367
|
var require_js_tokens = __commonJS({
|
|
12275
12368
|
"node_modules/js-tokens/index.js"(exports) {
|
|
@@ -12463,1568 +12556,49 @@ var require_lib4 = __commonJS({
|
|
|
12463
12556
|
}
|
|
12464
12557
|
});
|
|
12465
12558
|
|
|
12466
|
-
// node_modules/
|
|
12467
|
-
var require_picocolors = __commonJS({
|
|
12468
|
-
"node_modules/picocolors/picocolors.js"(exports, module) {
|
|
12469
|
-
var argv = process.argv || [];
|
|
12470
|
-
var env = process.env;
|
|
12471
|
-
var isColorSupported = !("NO_COLOR" in env || argv.includes("--no-color")) && ("FORCE_COLOR" in env || argv.includes("--color") || process.platform === "win32" || __require != null && __require("tty").isatty(1) && env.TERM !== "dumb" || "CI" in env);
|
|
12472
|
-
var formatter = (open, close, replace = open) => (input) => {
|
|
12473
|
-
let string = "" + input;
|
|
12474
|
-
let index = string.indexOf(close, open.length);
|
|
12475
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
12476
|
-
};
|
|
12477
|
-
var replaceClose = (string, close, replace, index) => {
|
|
12478
|
-
let result = "";
|
|
12479
|
-
let cursor = 0;
|
|
12480
|
-
do {
|
|
12481
|
-
result += string.substring(cursor, index) + replace;
|
|
12482
|
-
cursor = index + close.length;
|
|
12483
|
-
index = string.indexOf(close, cursor);
|
|
12484
|
-
} while (~index);
|
|
12485
|
-
return result + string.substring(cursor);
|
|
12486
|
-
};
|
|
12487
|
-
var createColors = (enabled = isColorSupported) => {
|
|
12488
|
-
let init = enabled ? formatter : () => String;
|
|
12489
|
-
return {
|
|
12490
|
-
isColorSupported: enabled,
|
|
12491
|
-
reset: init("\x1B[0m", "\x1B[0m"),
|
|
12492
|
-
bold: init("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
12493
|
-
dim: init("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
12494
|
-
italic: init("\x1B[3m", "\x1B[23m"),
|
|
12495
|
-
underline: init("\x1B[4m", "\x1B[24m"),
|
|
12496
|
-
inverse: init("\x1B[7m", "\x1B[27m"),
|
|
12497
|
-
hidden: init("\x1B[8m", "\x1B[28m"),
|
|
12498
|
-
strikethrough: init("\x1B[9m", "\x1B[29m"),
|
|
12499
|
-
black: init("\x1B[30m", "\x1B[39m"),
|
|
12500
|
-
red: init("\x1B[31m", "\x1B[39m"),
|
|
12501
|
-
green: init("\x1B[32m", "\x1B[39m"),
|
|
12502
|
-
yellow: init("\x1B[33m", "\x1B[39m"),
|
|
12503
|
-
blue: init("\x1B[34m", "\x1B[39m"),
|
|
12504
|
-
magenta: init("\x1B[35m", "\x1B[39m"),
|
|
12505
|
-
cyan: init("\x1B[36m", "\x1B[39m"),
|
|
12506
|
-
white: init("\x1B[37m", "\x1B[39m"),
|
|
12507
|
-
gray: init("\x1B[90m", "\x1B[39m"),
|
|
12508
|
-
bgBlack: init("\x1B[40m", "\x1B[49m"),
|
|
12509
|
-
bgRed: init("\x1B[41m", "\x1B[49m"),
|
|
12510
|
-
bgGreen: init("\x1B[42m", "\x1B[49m"),
|
|
12511
|
-
bgYellow: init("\x1B[43m", "\x1B[49m"),
|
|
12512
|
-
bgBlue: init("\x1B[44m", "\x1B[49m"),
|
|
12513
|
-
bgMagenta: init("\x1B[45m", "\x1B[49m"),
|
|
12514
|
-
bgCyan: init("\x1B[46m", "\x1B[49m"),
|
|
12515
|
-
bgWhite: init("\x1B[47m", "\x1B[49m"),
|
|
12516
|
-
blackBright: init("\x1B[90m", "\x1B[39m"),
|
|
12517
|
-
redBright: init("\x1B[91m", "\x1B[39m"),
|
|
12518
|
-
greenBright: init("\x1B[92m", "\x1B[39m"),
|
|
12519
|
-
yellowBright: init("\x1B[93m", "\x1B[39m"),
|
|
12520
|
-
blueBright: init("\x1B[94m", "\x1B[39m"),
|
|
12521
|
-
magentaBright: init("\x1B[95m", "\x1B[39m"),
|
|
12522
|
-
cyanBright: init("\x1B[96m", "\x1B[39m"),
|
|
12523
|
-
whiteBright: init("\x1B[97m", "\x1B[39m"),
|
|
12524
|
-
bgBlackBright: init("\x1B[100m", "\x1B[49m"),
|
|
12525
|
-
bgRedBright: init("\x1B[101m", "\x1B[49m"),
|
|
12526
|
-
bgGreenBright: init("\x1B[102m", "\x1B[49m"),
|
|
12527
|
-
bgYellowBright: init("\x1B[103m", "\x1B[49m"),
|
|
12528
|
-
bgBlueBright: init("\x1B[104m", "\x1B[49m"),
|
|
12529
|
-
bgMagentaBright: init("\x1B[105m", "\x1B[49m"),
|
|
12530
|
-
bgCyanBright: init("\x1B[106m", "\x1B[49m"),
|
|
12531
|
-
bgWhiteBright: init("\x1B[107m", "\x1B[49m")
|
|
12532
|
-
};
|
|
12533
|
-
};
|
|
12534
|
-
module.exports = createColors();
|
|
12535
|
-
module.exports.createColors = createColors;
|
|
12536
|
-
}
|
|
12537
|
-
});
|
|
12538
|
-
|
|
12539
|
-
// node_modules/escape-string-regexp/index.js
|
|
12540
|
-
var require_escape_string_regexp = __commonJS({
|
|
12541
|
-
"node_modules/escape-string-regexp/index.js"(exports, module) {
|
|
12542
|
-
"use strict";
|
|
12543
|
-
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
|
|
12544
|
-
module.exports = function(str2) {
|
|
12545
|
-
if (typeof str2 !== "string") {
|
|
12546
|
-
throw new TypeError("Expected a string");
|
|
12547
|
-
}
|
|
12548
|
-
return str2.replace(matchOperatorsRe, "\\$&");
|
|
12549
|
-
};
|
|
12550
|
-
}
|
|
12551
|
-
});
|
|
12552
|
-
|
|
12553
|
-
// node_modules/color-name/index.js
|
|
12554
|
-
var require_color_name = __commonJS({
|
|
12555
|
-
"node_modules/color-name/index.js"(exports, module) {
|
|
12556
|
-
"use strict";
|
|
12557
|
-
module.exports = {
|
|
12558
|
-
"aliceblue": [240, 248, 255],
|
|
12559
|
-
"antiquewhite": [250, 235, 215],
|
|
12560
|
-
"aqua": [0, 255, 255],
|
|
12561
|
-
"aquamarine": [127, 255, 212],
|
|
12562
|
-
"azure": [240, 255, 255],
|
|
12563
|
-
"beige": [245, 245, 220],
|
|
12564
|
-
"bisque": [255, 228, 196],
|
|
12565
|
-
"black": [0, 0, 0],
|
|
12566
|
-
"blanchedalmond": [255, 235, 205],
|
|
12567
|
-
"blue": [0, 0, 255],
|
|
12568
|
-
"blueviolet": [138, 43, 226],
|
|
12569
|
-
"brown": [165, 42, 42],
|
|
12570
|
-
"burlywood": [222, 184, 135],
|
|
12571
|
-
"cadetblue": [95, 158, 160],
|
|
12572
|
-
"chartreuse": [127, 255, 0],
|
|
12573
|
-
"chocolate": [210, 105, 30],
|
|
12574
|
-
"coral": [255, 127, 80],
|
|
12575
|
-
"cornflowerblue": [100, 149, 237],
|
|
12576
|
-
"cornsilk": [255, 248, 220],
|
|
12577
|
-
"crimson": [220, 20, 60],
|
|
12578
|
-
"cyan": [0, 255, 255],
|
|
12579
|
-
"darkblue": [0, 0, 139],
|
|
12580
|
-
"darkcyan": [0, 139, 139],
|
|
12581
|
-
"darkgoldenrod": [184, 134, 11],
|
|
12582
|
-
"darkgray": [169, 169, 169],
|
|
12583
|
-
"darkgreen": [0, 100, 0],
|
|
12584
|
-
"darkgrey": [169, 169, 169],
|
|
12585
|
-
"darkkhaki": [189, 183, 107],
|
|
12586
|
-
"darkmagenta": [139, 0, 139],
|
|
12587
|
-
"darkolivegreen": [85, 107, 47],
|
|
12588
|
-
"darkorange": [255, 140, 0],
|
|
12589
|
-
"darkorchid": [153, 50, 204],
|
|
12590
|
-
"darkred": [139, 0, 0],
|
|
12591
|
-
"darksalmon": [233, 150, 122],
|
|
12592
|
-
"darkseagreen": [143, 188, 143],
|
|
12593
|
-
"darkslateblue": [72, 61, 139],
|
|
12594
|
-
"darkslategray": [47, 79, 79],
|
|
12595
|
-
"darkslategrey": [47, 79, 79],
|
|
12596
|
-
"darkturquoise": [0, 206, 209],
|
|
12597
|
-
"darkviolet": [148, 0, 211],
|
|
12598
|
-
"deeppink": [255, 20, 147],
|
|
12599
|
-
"deepskyblue": [0, 191, 255],
|
|
12600
|
-
"dimgray": [105, 105, 105],
|
|
12601
|
-
"dimgrey": [105, 105, 105],
|
|
12602
|
-
"dodgerblue": [30, 144, 255],
|
|
12603
|
-
"firebrick": [178, 34, 34],
|
|
12604
|
-
"floralwhite": [255, 250, 240],
|
|
12605
|
-
"forestgreen": [34, 139, 34],
|
|
12606
|
-
"fuchsia": [255, 0, 255],
|
|
12607
|
-
"gainsboro": [220, 220, 220],
|
|
12608
|
-
"ghostwhite": [248, 248, 255],
|
|
12609
|
-
"gold": [255, 215, 0],
|
|
12610
|
-
"goldenrod": [218, 165, 32],
|
|
12611
|
-
"gray": [128, 128, 128],
|
|
12612
|
-
"green": [0, 128, 0],
|
|
12613
|
-
"greenyellow": [173, 255, 47],
|
|
12614
|
-
"grey": [128, 128, 128],
|
|
12615
|
-
"honeydew": [240, 255, 240],
|
|
12616
|
-
"hotpink": [255, 105, 180],
|
|
12617
|
-
"indianred": [205, 92, 92],
|
|
12618
|
-
"indigo": [75, 0, 130],
|
|
12619
|
-
"ivory": [255, 255, 240],
|
|
12620
|
-
"khaki": [240, 230, 140],
|
|
12621
|
-
"lavender": [230, 230, 250],
|
|
12622
|
-
"lavenderblush": [255, 240, 245],
|
|
12623
|
-
"lawngreen": [124, 252, 0],
|
|
12624
|
-
"lemonchiffon": [255, 250, 205],
|
|
12625
|
-
"lightblue": [173, 216, 230],
|
|
12626
|
-
"lightcoral": [240, 128, 128],
|
|
12627
|
-
"lightcyan": [224, 255, 255],
|
|
12628
|
-
"lightgoldenrodyellow": [250, 250, 210],
|
|
12629
|
-
"lightgray": [211, 211, 211],
|
|
12630
|
-
"lightgreen": [144, 238, 144],
|
|
12631
|
-
"lightgrey": [211, 211, 211],
|
|
12632
|
-
"lightpink": [255, 182, 193],
|
|
12633
|
-
"lightsalmon": [255, 160, 122],
|
|
12634
|
-
"lightseagreen": [32, 178, 170],
|
|
12635
|
-
"lightskyblue": [135, 206, 250],
|
|
12636
|
-
"lightslategray": [119, 136, 153],
|
|
12637
|
-
"lightslategrey": [119, 136, 153],
|
|
12638
|
-
"lightsteelblue": [176, 196, 222],
|
|
12639
|
-
"lightyellow": [255, 255, 224],
|
|
12640
|
-
"lime": [0, 255, 0],
|
|
12641
|
-
"limegreen": [50, 205, 50],
|
|
12642
|
-
"linen": [250, 240, 230],
|
|
12643
|
-
"magenta": [255, 0, 255],
|
|
12644
|
-
"maroon": [128, 0, 0],
|
|
12645
|
-
"mediumaquamarine": [102, 205, 170],
|
|
12646
|
-
"mediumblue": [0, 0, 205],
|
|
12647
|
-
"mediumorchid": [186, 85, 211],
|
|
12648
|
-
"mediumpurple": [147, 112, 219],
|
|
12649
|
-
"mediumseagreen": [60, 179, 113],
|
|
12650
|
-
"mediumslateblue": [123, 104, 238],
|
|
12651
|
-
"mediumspringgreen": [0, 250, 154],
|
|
12652
|
-
"mediumturquoise": [72, 209, 204],
|
|
12653
|
-
"mediumvioletred": [199, 21, 133],
|
|
12654
|
-
"midnightblue": [25, 25, 112],
|
|
12655
|
-
"mintcream": [245, 255, 250],
|
|
12656
|
-
"mistyrose": [255, 228, 225],
|
|
12657
|
-
"moccasin": [255, 228, 181],
|
|
12658
|
-
"navajowhite": [255, 222, 173],
|
|
12659
|
-
"navy": [0, 0, 128],
|
|
12660
|
-
"oldlace": [253, 245, 230],
|
|
12661
|
-
"olive": [128, 128, 0],
|
|
12662
|
-
"olivedrab": [107, 142, 35],
|
|
12663
|
-
"orange": [255, 165, 0],
|
|
12664
|
-
"orangered": [255, 69, 0],
|
|
12665
|
-
"orchid": [218, 112, 214],
|
|
12666
|
-
"palegoldenrod": [238, 232, 170],
|
|
12667
|
-
"palegreen": [152, 251, 152],
|
|
12668
|
-
"paleturquoise": [175, 238, 238],
|
|
12669
|
-
"palevioletred": [219, 112, 147],
|
|
12670
|
-
"papayawhip": [255, 239, 213],
|
|
12671
|
-
"peachpuff": [255, 218, 185],
|
|
12672
|
-
"peru": [205, 133, 63],
|
|
12673
|
-
"pink": [255, 192, 203],
|
|
12674
|
-
"plum": [221, 160, 221],
|
|
12675
|
-
"powderblue": [176, 224, 230],
|
|
12676
|
-
"purple": [128, 0, 128],
|
|
12677
|
-
"rebeccapurple": [102, 51, 153],
|
|
12678
|
-
"red": [255, 0, 0],
|
|
12679
|
-
"rosybrown": [188, 143, 143],
|
|
12680
|
-
"royalblue": [65, 105, 225],
|
|
12681
|
-
"saddlebrown": [139, 69, 19],
|
|
12682
|
-
"salmon": [250, 128, 114],
|
|
12683
|
-
"sandybrown": [244, 164, 96],
|
|
12684
|
-
"seagreen": [46, 139, 87],
|
|
12685
|
-
"seashell": [255, 245, 238],
|
|
12686
|
-
"sienna": [160, 82, 45],
|
|
12687
|
-
"silver": [192, 192, 192],
|
|
12688
|
-
"skyblue": [135, 206, 235],
|
|
12689
|
-
"slateblue": [106, 90, 205],
|
|
12690
|
-
"slategray": [112, 128, 144],
|
|
12691
|
-
"slategrey": [112, 128, 144],
|
|
12692
|
-
"snow": [255, 250, 250],
|
|
12693
|
-
"springgreen": [0, 255, 127],
|
|
12694
|
-
"steelblue": [70, 130, 180],
|
|
12695
|
-
"tan": [210, 180, 140],
|
|
12696
|
-
"teal": [0, 128, 128],
|
|
12697
|
-
"thistle": [216, 191, 216],
|
|
12698
|
-
"tomato": [255, 99, 71],
|
|
12699
|
-
"turquoise": [64, 224, 208],
|
|
12700
|
-
"violet": [238, 130, 238],
|
|
12701
|
-
"wheat": [245, 222, 179],
|
|
12702
|
-
"white": [255, 255, 255],
|
|
12703
|
-
"whitesmoke": [245, 245, 245],
|
|
12704
|
-
"yellow": [255, 255, 0],
|
|
12705
|
-
"yellowgreen": [154, 205, 50]
|
|
12706
|
-
};
|
|
12707
|
-
}
|
|
12708
|
-
});
|
|
12709
|
-
|
|
12710
|
-
// node_modules/color-convert/conversions.js
|
|
12711
|
-
var require_conversions = __commonJS({
|
|
12712
|
-
"node_modules/color-convert/conversions.js"(exports, module) {
|
|
12713
|
-
var cssKeywords = require_color_name();
|
|
12714
|
-
var reverseKeywords = {};
|
|
12715
|
-
for (key in cssKeywords) {
|
|
12716
|
-
if (cssKeywords.hasOwnProperty(key)) {
|
|
12717
|
-
reverseKeywords[cssKeywords[key]] = key;
|
|
12718
|
-
}
|
|
12719
|
-
}
|
|
12720
|
-
var key;
|
|
12721
|
-
var convert = module.exports = {
|
|
12722
|
-
rgb: { channels: 3, labels: "rgb" },
|
|
12723
|
-
hsl: { channels: 3, labels: "hsl" },
|
|
12724
|
-
hsv: { channels: 3, labels: "hsv" },
|
|
12725
|
-
hwb: { channels: 3, labels: "hwb" },
|
|
12726
|
-
cmyk: { channels: 4, labels: "cmyk" },
|
|
12727
|
-
xyz: { channels: 3, labels: "xyz" },
|
|
12728
|
-
lab: { channels: 3, labels: "lab" },
|
|
12729
|
-
lch: { channels: 3, labels: "lch" },
|
|
12730
|
-
hex: { channels: 1, labels: ["hex"] },
|
|
12731
|
-
keyword: { channels: 1, labels: ["keyword"] },
|
|
12732
|
-
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
12733
|
-
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
12734
|
-
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
12735
|
-
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
12736
|
-
gray: { channels: 1, labels: ["gray"] }
|
|
12737
|
-
};
|
|
12738
|
-
for (model in convert) {
|
|
12739
|
-
if (convert.hasOwnProperty(model)) {
|
|
12740
|
-
if (!("channels" in convert[model])) {
|
|
12741
|
-
throw new Error("missing channels property: " + model);
|
|
12742
|
-
}
|
|
12743
|
-
if (!("labels" in convert[model])) {
|
|
12744
|
-
throw new Error("missing channel labels property: " + model);
|
|
12745
|
-
}
|
|
12746
|
-
if (convert[model].labels.length !== convert[model].channels) {
|
|
12747
|
-
throw new Error("channel and label counts mismatch: " + model);
|
|
12748
|
-
}
|
|
12749
|
-
channels = convert[model].channels;
|
|
12750
|
-
labels = convert[model].labels;
|
|
12751
|
-
delete convert[model].channels;
|
|
12752
|
-
delete convert[model].labels;
|
|
12753
|
-
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
12754
|
-
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
12755
|
-
}
|
|
12756
|
-
}
|
|
12757
|
-
var channels;
|
|
12758
|
-
var labels;
|
|
12759
|
-
var model;
|
|
12760
|
-
convert.rgb.hsl = function(rgb) {
|
|
12761
|
-
var r = rgb[0] / 255;
|
|
12762
|
-
var g = rgb[1] / 255;
|
|
12763
|
-
var b = rgb[2] / 255;
|
|
12764
|
-
var min = Math.min(r, g, b);
|
|
12765
|
-
var max = Math.max(r, g, b);
|
|
12766
|
-
var delta = max - min;
|
|
12767
|
-
var h2;
|
|
12768
|
-
var s;
|
|
12769
|
-
var l;
|
|
12770
|
-
if (max === min) {
|
|
12771
|
-
h2 = 0;
|
|
12772
|
-
} else if (r === max) {
|
|
12773
|
-
h2 = (g - b) / delta;
|
|
12774
|
-
} else if (g === max) {
|
|
12775
|
-
h2 = 2 + (b - r) / delta;
|
|
12776
|
-
} else if (b === max) {
|
|
12777
|
-
h2 = 4 + (r - g) / delta;
|
|
12778
|
-
}
|
|
12779
|
-
h2 = Math.min(h2 * 60, 360);
|
|
12780
|
-
if (h2 < 0) {
|
|
12781
|
-
h2 += 360;
|
|
12782
|
-
}
|
|
12783
|
-
l = (min + max) / 2;
|
|
12784
|
-
if (max === min) {
|
|
12785
|
-
s = 0;
|
|
12786
|
-
} else if (l <= 0.5) {
|
|
12787
|
-
s = delta / (max + min);
|
|
12788
|
-
} else {
|
|
12789
|
-
s = delta / (2 - max - min);
|
|
12790
|
-
}
|
|
12791
|
-
return [h2, s * 100, l * 100];
|
|
12792
|
-
};
|
|
12793
|
-
convert.rgb.hsv = function(rgb) {
|
|
12794
|
-
var rdif;
|
|
12795
|
-
var gdif;
|
|
12796
|
-
var bdif;
|
|
12797
|
-
var h2;
|
|
12798
|
-
var s;
|
|
12799
|
-
var r = rgb[0] / 255;
|
|
12800
|
-
var g = rgb[1] / 255;
|
|
12801
|
-
var b = rgb[2] / 255;
|
|
12802
|
-
var v = Math.max(r, g, b);
|
|
12803
|
-
var diff = v - Math.min(r, g, b);
|
|
12804
|
-
var diffc = function(c3) {
|
|
12805
|
-
return (v - c3) / 6 / diff + 1 / 2;
|
|
12806
|
-
};
|
|
12807
|
-
if (diff === 0) {
|
|
12808
|
-
h2 = s = 0;
|
|
12809
|
-
} else {
|
|
12810
|
-
s = diff / v;
|
|
12811
|
-
rdif = diffc(r);
|
|
12812
|
-
gdif = diffc(g);
|
|
12813
|
-
bdif = diffc(b);
|
|
12814
|
-
if (r === v) {
|
|
12815
|
-
h2 = bdif - gdif;
|
|
12816
|
-
} else if (g === v) {
|
|
12817
|
-
h2 = 1 / 3 + rdif - bdif;
|
|
12818
|
-
} else if (b === v) {
|
|
12819
|
-
h2 = 2 / 3 + gdif - rdif;
|
|
12820
|
-
}
|
|
12821
|
-
if (h2 < 0) {
|
|
12822
|
-
h2 += 1;
|
|
12823
|
-
} else if (h2 > 1) {
|
|
12824
|
-
h2 -= 1;
|
|
12825
|
-
}
|
|
12826
|
-
}
|
|
12827
|
-
return [
|
|
12828
|
-
h2 * 360,
|
|
12829
|
-
s * 100,
|
|
12830
|
-
v * 100
|
|
12831
|
-
];
|
|
12832
|
-
};
|
|
12833
|
-
convert.rgb.hwb = function(rgb) {
|
|
12834
|
-
var r = rgb[0];
|
|
12835
|
-
var g = rgb[1];
|
|
12836
|
-
var b = rgb[2];
|
|
12837
|
-
var h2 = convert.rgb.hsl(rgb)[0];
|
|
12838
|
-
var w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
12839
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
12840
|
-
return [h2, w * 100, b * 100];
|
|
12841
|
-
};
|
|
12842
|
-
convert.rgb.cmyk = function(rgb) {
|
|
12843
|
-
var r = rgb[0] / 255;
|
|
12844
|
-
var g = rgb[1] / 255;
|
|
12845
|
-
var b = rgb[2] / 255;
|
|
12846
|
-
var c3;
|
|
12847
|
-
var m;
|
|
12848
|
-
var y;
|
|
12849
|
-
var k;
|
|
12850
|
-
k = Math.min(1 - r, 1 - g, 1 - b);
|
|
12851
|
-
c3 = (1 - r - k) / (1 - k) || 0;
|
|
12852
|
-
m = (1 - g - k) / (1 - k) || 0;
|
|
12853
|
-
y = (1 - b - k) / (1 - k) || 0;
|
|
12854
|
-
return [c3 * 100, m * 100, y * 100, k * 100];
|
|
12855
|
-
};
|
|
12856
|
-
function comparativeDistance(x, y) {
|
|
12857
|
-
return Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2);
|
|
12858
|
-
}
|
|
12859
|
-
convert.rgb.keyword = function(rgb) {
|
|
12860
|
-
var reversed = reverseKeywords[rgb];
|
|
12861
|
-
if (reversed) {
|
|
12862
|
-
return reversed;
|
|
12863
|
-
}
|
|
12864
|
-
var currentClosestDistance = Infinity;
|
|
12865
|
-
var currentClosestKeyword;
|
|
12866
|
-
for (var keyword in cssKeywords) {
|
|
12867
|
-
if (cssKeywords.hasOwnProperty(keyword)) {
|
|
12868
|
-
var value = cssKeywords[keyword];
|
|
12869
|
-
var distance = comparativeDistance(rgb, value);
|
|
12870
|
-
if (distance < currentClosestDistance) {
|
|
12871
|
-
currentClosestDistance = distance;
|
|
12872
|
-
currentClosestKeyword = keyword;
|
|
12873
|
-
}
|
|
12874
|
-
}
|
|
12875
|
-
}
|
|
12876
|
-
return currentClosestKeyword;
|
|
12877
|
-
};
|
|
12878
|
-
convert.keyword.rgb = function(keyword) {
|
|
12879
|
-
return cssKeywords[keyword];
|
|
12880
|
-
};
|
|
12881
|
-
convert.rgb.xyz = function(rgb) {
|
|
12882
|
-
var r = rgb[0] / 255;
|
|
12883
|
-
var g = rgb[1] / 255;
|
|
12884
|
-
var b = rgb[2] / 255;
|
|
12885
|
-
r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;
|
|
12886
|
-
g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;
|
|
12887
|
-
b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92;
|
|
12888
|
-
var x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
12889
|
-
var y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
12890
|
-
var z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
12891
|
-
return [x * 100, y * 100, z * 100];
|
|
12892
|
-
};
|
|
12893
|
-
convert.rgb.lab = function(rgb) {
|
|
12894
|
-
var xyz = convert.rgb.xyz(rgb);
|
|
12895
|
-
var x = xyz[0];
|
|
12896
|
-
var y = xyz[1];
|
|
12897
|
-
var z = xyz[2];
|
|
12898
|
-
var l;
|
|
12899
|
-
var a2;
|
|
12900
|
-
var b;
|
|
12901
|
-
x /= 95.047;
|
|
12902
|
-
y /= 100;
|
|
12903
|
-
z /= 108.883;
|
|
12904
|
-
x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
|
|
12905
|
-
y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
|
|
12906
|
-
z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
|
|
12907
|
-
l = 116 * y - 16;
|
|
12908
|
-
a2 = 500 * (x - y);
|
|
12909
|
-
b = 200 * (y - z);
|
|
12910
|
-
return [l, a2, b];
|
|
12911
|
-
};
|
|
12912
|
-
convert.hsl.rgb = function(hsl) {
|
|
12913
|
-
var h2 = hsl[0] / 360;
|
|
12914
|
-
var s = hsl[1] / 100;
|
|
12915
|
-
var l = hsl[2] / 100;
|
|
12916
|
-
var t1;
|
|
12917
|
-
var t2;
|
|
12918
|
-
var t3;
|
|
12919
|
-
var rgb;
|
|
12920
|
-
var val;
|
|
12921
|
-
if (s === 0) {
|
|
12922
|
-
val = l * 255;
|
|
12923
|
-
return [val, val, val];
|
|
12924
|
-
}
|
|
12925
|
-
if (l < 0.5) {
|
|
12926
|
-
t2 = l * (1 + s);
|
|
12927
|
-
} else {
|
|
12928
|
-
t2 = l + s - l * s;
|
|
12929
|
-
}
|
|
12930
|
-
t1 = 2 * l - t2;
|
|
12931
|
-
rgb = [0, 0, 0];
|
|
12932
|
-
for (var i2 = 0; i2 < 3; i2++) {
|
|
12933
|
-
t3 = h2 + 1 / 3 * -(i2 - 1);
|
|
12934
|
-
if (t3 < 0) {
|
|
12935
|
-
t3++;
|
|
12936
|
-
}
|
|
12937
|
-
if (t3 > 1) {
|
|
12938
|
-
t3--;
|
|
12939
|
-
}
|
|
12940
|
-
if (6 * t3 < 1) {
|
|
12941
|
-
val = t1 + (t2 - t1) * 6 * t3;
|
|
12942
|
-
} else if (2 * t3 < 1) {
|
|
12943
|
-
val = t2;
|
|
12944
|
-
} else if (3 * t3 < 2) {
|
|
12945
|
-
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
12946
|
-
} else {
|
|
12947
|
-
val = t1;
|
|
12948
|
-
}
|
|
12949
|
-
rgb[i2] = val * 255;
|
|
12950
|
-
}
|
|
12951
|
-
return rgb;
|
|
12952
|
-
};
|
|
12953
|
-
convert.hsl.hsv = function(hsl) {
|
|
12954
|
-
var h2 = hsl[0];
|
|
12955
|
-
var s = hsl[1] / 100;
|
|
12956
|
-
var l = hsl[2] / 100;
|
|
12957
|
-
var smin = s;
|
|
12958
|
-
var lmin = Math.max(l, 0.01);
|
|
12959
|
-
var sv;
|
|
12960
|
-
var v;
|
|
12961
|
-
l *= 2;
|
|
12962
|
-
s *= l <= 1 ? l : 2 - l;
|
|
12963
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
12964
|
-
v = (l + s) / 2;
|
|
12965
|
-
sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
12966
|
-
return [h2, sv * 100, v * 100];
|
|
12967
|
-
};
|
|
12968
|
-
convert.hsv.rgb = function(hsv) {
|
|
12969
|
-
var h2 = hsv[0] / 60;
|
|
12970
|
-
var s = hsv[1] / 100;
|
|
12971
|
-
var v = hsv[2] / 100;
|
|
12972
|
-
var hi = Math.floor(h2) % 6;
|
|
12973
|
-
var f = h2 - Math.floor(h2);
|
|
12974
|
-
var p = 255 * v * (1 - s);
|
|
12975
|
-
var q = 255 * v * (1 - s * f);
|
|
12976
|
-
var t = 255 * v * (1 - s * (1 - f));
|
|
12977
|
-
v *= 255;
|
|
12978
|
-
switch (hi) {
|
|
12979
|
-
case 0:
|
|
12980
|
-
return [v, t, p];
|
|
12981
|
-
case 1:
|
|
12982
|
-
return [q, v, p];
|
|
12983
|
-
case 2:
|
|
12984
|
-
return [p, v, t];
|
|
12985
|
-
case 3:
|
|
12986
|
-
return [p, q, v];
|
|
12987
|
-
case 4:
|
|
12988
|
-
return [t, p, v];
|
|
12989
|
-
case 5:
|
|
12990
|
-
return [v, p, q];
|
|
12991
|
-
}
|
|
12992
|
-
};
|
|
12993
|
-
convert.hsv.hsl = function(hsv) {
|
|
12994
|
-
var h2 = hsv[0];
|
|
12995
|
-
var s = hsv[1] / 100;
|
|
12996
|
-
var v = hsv[2] / 100;
|
|
12997
|
-
var vmin = Math.max(v, 0.01);
|
|
12998
|
-
var lmin;
|
|
12999
|
-
var sl;
|
|
13000
|
-
var l;
|
|
13001
|
-
l = (2 - s) * v;
|
|
13002
|
-
lmin = (2 - s) * vmin;
|
|
13003
|
-
sl = s * vmin;
|
|
13004
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
13005
|
-
sl = sl || 0;
|
|
13006
|
-
l /= 2;
|
|
13007
|
-
return [h2, sl * 100, l * 100];
|
|
13008
|
-
};
|
|
13009
|
-
convert.hwb.rgb = function(hwb) {
|
|
13010
|
-
var h2 = hwb[0] / 360;
|
|
13011
|
-
var wh = hwb[1] / 100;
|
|
13012
|
-
var bl = hwb[2] / 100;
|
|
13013
|
-
var ratio = wh + bl;
|
|
13014
|
-
var i2;
|
|
13015
|
-
var v;
|
|
13016
|
-
var f;
|
|
13017
|
-
var n2;
|
|
13018
|
-
if (ratio > 1) {
|
|
13019
|
-
wh /= ratio;
|
|
13020
|
-
bl /= ratio;
|
|
13021
|
-
}
|
|
13022
|
-
i2 = Math.floor(6 * h2);
|
|
13023
|
-
v = 1 - bl;
|
|
13024
|
-
f = 6 * h2 - i2;
|
|
13025
|
-
if ((i2 & 1) !== 0) {
|
|
13026
|
-
f = 1 - f;
|
|
13027
|
-
}
|
|
13028
|
-
n2 = wh + f * (v - wh);
|
|
13029
|
-
var r;
|
|
13030
|
-
var g;
|
|
13031
|
-
var b;
|
|
13032
|
-
switch (i2) {
|
|
13033
|
-
default:
|
|
13034
|
-
case 6:
|
|
13035
|
-
case 0:
|
|
13036
|
-
r = v;
|
|
13037
|
-
g = n2;
|
|
13038
|
-
b = wh;
|
|
13039
|
-
break;
|
|
13040
|
-
case 1:
|
|
13041
|
-
r = n2;
|
|
13042
|
-
g = v;
|
|
13043
|
-
b = wh;
|
|
13044
|
-
break;
|
|
13045
|
-
case 2:
|
|
13046
|
-
r = wh;
|
|
13047
|
-
g = v;
|
|
13048
|
-
b = n2;
|
|
13049
|
-
break;
|
|
13050
|
-
case 3:
|
|
13051
|
-
r = wh;
|
|
13052
|
-
g = n2;
|
|
13053
|
-
b = v;
|
|
13054
|
-
break;
|
|
13055
|
-
case 4:
|
|
13056
|
-
r = n2;
|
|
13057
|
-
g = wh;
|
|
13058
|
-
b = v;
|
|
13059
|
-
break;
|
|
13060
|
-
case 5:
|
|
13061
|
-
r = v;
|
|
13062
|
-
g = wh;
|
|
13063
|
-
b = n2;
|
|
13064
|
-
break;
|
|
13065
|
-
}
|
|
13066
|
-
return [r * 255, g * 255, b * 255];
|
|
13067
|
-
};
|
|
13068
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
13069
|
-
var c3 = cmyk[0] / 100;
|
|
13070
|
-
var m = cmyk[1] / 100;
|
|
13071
|
-
var y = cmyk[2] / 100;
|
|
13072
|
-
var k = cmyk[3] / 100;
|
|
13073
|
-
var r;
|
|
13074
|
-
var g;
|
|
13075
|
-
var b;
|
|
13076
|
-
r = 1 - Math.min(1, c3 * (1 - k) + k);
|
|
13077
|
-
g = 1 - Math.min(1, m * (1 - k) + k);
|
|
13078
|
-
b = 1 - Math.min(1, y * (1 - k) + k);
|
|
13079
|
-
return [r * 255, g * 255, b * 255];
|
|
13080
|
-
};
|
|
13081
|
-
convert.xyz.rgb = function(xyz) {
|
|
13082
|
-
var x = xyz[0] / 100;
|
|
13083
|
-
var y = xyz[1] / 100;
|
|
13084
|
-
var z = xyz[2] / 100;
|
|
13085
|
-
var r;
|
|
13086
|
-
var g;
|
|
13087
|
-
var b;
|
|
13088
|
-
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
13089
|
-
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
13090
|
-
b = x * 0.0557 + y * -0.204 + z * 1.057;
|
|
13091
|
-
r = r > 31308e-7 ? 1.055 * Math.pow(r, 1 / 2.4) - 0.055 : r * 12.92;
|
|
13092
|
-
g = g > 31308e-7 ? 1.055 * Math.pow(g, 1 / 2.4) - 0.055 : g * 12.92;
|
|
13093
|
-
b = b > 31308e-7 ? 1.055 * Math.pow(b, 1 / 2.4) - 0.055 : b * 12.92;
|
|
13094
|
-
r = Math.min(Math.max(0, r), 1);
|
|
13095
|
-
g = Math.min(Math.max(0, g), 1);
|
|
13096
|
-
b = Math.min(Math.max(0, b), 1);
|
|
13097
|
-
return [r * 255, g * 255, b * 255];
|
|
13098
|
-
};
|
|
13099
|
-
convert.xyz.lab = function(xyz) {
|
|
13100
|
-
var x = xyz[0];
|
|
13101
|
-
var y = xyz[1];
|
|
13102
|
-
var z = xyz[2];
|
|
13103
|
-
var l;
|
|
13104
|
-
var a2;
|
|
13105
|
-
var b;
|
|
13106
|
-
x /= 95.047;
|
|
13107
|
-
y /= 100;
|
|
13108
|
-
z /= 108.883;
|
|
13109
|
-
x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
|
|
13110
|
-
y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
|
|
13111
|
-
z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
|
|
13112
|
-
l = 116 * y - 16;
|
|
13113
|
-
a2 = 500 * (x - y);
|
|
13114
|
-
b = 200 * (y - z);
|
|
13115
|
-
return [l, a2, b];
|
|
13116
|
-
};
|
|
13117
|
-
convert.lab.xyz = function(lab) {
|
|
13118
|
-
var l = lab[0];
|
|
13119
|
-
var a2 = lab[1];
|
|
13120
|
-
var b = lab[2];
|
|
13121
|
-
var x;
|
|
13122
|
-
var y;
|
|
13123
|
-
var z;
|
|
13124
|
-
y = (l + 16) / 116;
|
|
13125
|
-
x = a2 / 500 + y;
|
|
13126
|
-
z = y - b / 200;
|
|
13127
|
-
var y2 = Math.pow(y, 3);
|
|
13128
|
-
var x2 = Math.pow(x, 3);
|
|
13129
|
-
var z2 = Math.pow(z, 3);
|
|
13130
|
-
y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
|
|
13131
|
-
x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
|
|
13132
|
-
z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
|
|
13133
|
-
x *= 95.047;
|
|
13134
|
-
y *= 100;
|
|
13135
|
-
z *= 108.883;
|
|
13136
|
-
return [x, y, z];
|
|
13137
|
-
};
|
|
13138
|
-
convert.lab.lch = function(lab) {
|
|
13139
|
-
var l = lab[0];
|
|
13140
|
-
var a2 = lab[1];
|
|
13141
|
-
var b = lab[2];
|
|
13142
|
-
var hr;
|
|
13143
|
-
var h2;
|
|
13144
|
-
var c3;
|
|
13145
|
-
hr = Math.atan2(b, a2);
|
|
13146
|
-
h2 = hr * 360 / 2 / Math.PI;
|
|
13147
|
-
if (h2 < 0) {
|
|
13148
|
-
h2 += 360;
|
|
13149
|
-
}
|
|
13150
|
-
c3 = Math.sqrt(a2 * a2 + b * b);
|
|
13151
|
-
return [l, c3, h2];
|
|
13152
|
-
};
|
|
13153
|
-
convert.lch.lab = function(lch) {
|
|
13154
|
-
var l = lch[0];
|
|
13155
|
-
var c3 = lch[1];
|
|
13156
|
-
var h2 = lch[2];
|
|
13157
|
-
var a2;
|
|
13158
|
-
var b;
|
|
13159
|
-
var hr;
|
|
13160
|
-
hr = h2 / 360 * 2 * Math.PI;
|
|
13161
|
-
a2 = c3 * Math.cos(hr);
|
|
13162
|
-
b = c3 * Math.sin(hr);
|
|
13163
|
-
return [l, a2, b];
|
|
13164
|
-
};
|
|
13165
|
-
convert.rgb.ansi16 = function(args) {
|
|
13166
|
-
var r = args[0];
|
|
13167
|
-
var g = args[1];
|
|
13168
|
-
var b = args[2];
|
|
13169
|
-
var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2];
|
|
13170
|
-
value = Math.round(value / 50);
|
|
13171
|
-
if (value === 0) {
|
|
13172
|
-
return 30;
|
|
13173
|
-
}
|
|
13174
|
-
var ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
13175
|
-
if (value === 2) {
|
|
13176
|
-
ansi += 60;
|
|
13177
|
-
}
|
|
13178
|
-
return ansi;
|
|
13179
|
-
};
|
|
13180
|
-
convert.hsv.ansi16 = function(args) {
|
|
13181
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
13182
|
-
};
|
|
13183
|
-
convert.rgb.ansi256 = function(args) {
|
|
13184
|
-
var r = args[0];
|
|
13185
|
-
var g = args[1];
|
|
13186
|
-
var b = args[2];
|
|
13187
|
-
if (r === g && g === b) {
|
|
13188
|
-
if (r < 8) {
|
|
13189
|
-
return 16;
|
|
13190
|
-
}
|
|
13191
|
-
if (r > 248) {
|
|
13192
|
-
return 231;
|
|
13193
|
-
}
|
|
13194
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
13195
|
-
}
|
|
13196
|
-
var ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
13197
|
-
return ansi;
|
|
13198
|
-
};
|
|
13199
|
-
convert.ansi16.rgb = function(args) {
|
|
13200
|
-
var color = args % 10;
|
|
13201
|
-
if (color === 0 || color === 7) {
|
|
13202
|
-
if (args > 50) {
|
|
13203
|
-
color += 3.5;
|
|
13204
|
-
}
|
|
13205
|
-
color = color / 10.5 * 255;
|
|
13206
|
-
return [color, color, color];
|
|
13207
|
-
}
|
|
13208
|
-
var mult = (~~(args > 50) + 1) * 0.5;
|
|
13209
|
-
var r = (color & 1) * mult * 255;
|
|
13210
|
-
var g = (color >> 1 & 1) * mult * 255;
|
|
13211
|
-
var b = (color >> 2 & 1) * mult * 255;
|
|
13212
|
-
return [r, g, b];
|
|
13213
|
-
};
|
|
13214
|
-
convert.ansi256.rgb = function(args) {
|
|
13215
|
-
if (args >= 232) {
|
|
13216
|
-
var c3 = (args - 232) * 10 + 8;
|
|
13217
|
-
return [c3, c3, c3];
|
|
13218
|
-
}
|
|
13219
|
-
args -= 16;
|
|
13220
|
-
var rem;
|
|
13221
|
-
var r = Math.floor(args / 36) / 5 * 255;
|
|
13222
|
-
var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
13223
|
-
var b = rem % 6 / 5 * 255;
|
|
13224
|
-
return [r, g, b];
|
|
13225
|
-
};
|
|
13226
|
-
convert.rgb.hex = function(args) {
|
|
13227
|
-
var integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
13228
|
-
var string = integer.toString(16).toUpperCase();
|
|
13229
|
-
return "000000".substring(string.length) + string;
|
|
13230
|
-
};
|
|
13231
|
-
convert.hex.rgb = function(args) {
|
|
13232
|
-
var match2 = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
13233
|
-
if (!match2) {
|
|
13234
|
-
return [0, 0, 0];
|
|
13235
|
-
}
|
|
13236
|
-
var colorString = match2[0];
|
|
13237
|
-
if (match2[0].length === 3) {
|
|
13238
|
-
colorString = colorString.split("").map(function(char) {
|
|
13239
|
-
return char + char;
|
|
13240
|
-
}).join("");
|
|
13241
|
-
}
|
|
13242
|
-
var integer = parseInt(colorString, 16);
|
|
13243
|
-
var r = integer >> 16 & 255;
|
|
13244
|
-
var g = integer >> 8 & 255;
|
|
13245
|
-
var b = integer & 255;
|
|
13246
|
-
return [r, g, b];
|
|
13247
|
-
};
|
|
13248
|
-
convert.rgb.hcg = function(rgb) {
|
|
13249
|
-
var r = rgb[0] / 255;
|
|
13250
|
-
var g = rgb[1] / 255;
|
|
13251
|
-
var b = rgb[2] / 255;
|
|
13252
|
-
var max = Math.max(Math.max(r, g), b);
|
|
13253
|
-
var min = Math.min(Math.min(r, g), b);
|
|
13254
|
-
var chroma = max - min;
|
|
13255
|
-
var grayscale;
|
|
13256
|
-
var hue;
|
|
13257
|
-
if (chroma < 1) {
|
|
13258
|
-
grayscale = min / (1 - chroma);
|
|
13259
|
-
} else {
|
|
13260
|
-
grayscale = 0;
|
|
13261
|
-
}
|
|
13262
|
-
if (chroma <= 0) {
|
|
13263
|
-
hue = 0;
|
|
13264
|
-
} else if (max === r) {
|
|
13265
|
-
hue = (g - b) / chroma % 6;
|
|
13266
|
-
} else if (max === g) {
|
|
13267
|
-
hue = 2 + (b - r) / chroma;
|
|
13268
|
-
} else {
|
|
13269
|
-
hue = 4 + (r - g) / chroma + 4;
|
|
13270
|
-
}
|
|
13271
|
-
hue /= 6;
|
|
13272
|
-
hue %= 1;
|
|
13273
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
|
13274
|
-
};
|
|
13275
|
-
convert.hsl.hcg = function(hsl) {
|
|
13276
|
-
var s = hsl[1] / 100;
|
|
13277
|
-
var l = hsl[2] / 100;
|
|
13278
|
-
var c3 = 1;
|
|
13279
|
-
var f = 0;
|
|
13280
|
-
if (l < 0.5) {
|
|
13281
|
-
c3 = 2 * s * l;
|
|
13282
|
-
} else {
|
|
13283
|
-
c3 = 2 * s * (1 - l);
|
|
13284
|
-
}
|
|
13285
|
-
if (c3 < 1) {
|
|
13286
|
-
f = (l - 0.5 * c3) / (1 - c3);
|
|
13287
|
-
}
|
|
13288
|
-
return [hsl[0], c3 * 100, f * 100];
|
|
13289
|
-
};
|
|
13290
|
-
convert.hsv.hcg = function(hsv) {
|
|
13291
|
-
var s = hsv[1] / 100;
|
|
13292
|
-
var v = hsv[2] / 100;
|
|
13293
|
-
var c3 = s * v;
|
|
13294
|
-
var f = 0;
|
|
13295
|
-
if (c3 < 1) {
|
|
13296
|
-
f = (v - c3) / (1 - c3);
|
|
13297
|
-
}
|
|
13298
|
-
return [hsv[0], c3 * 100, f * 100];
|
|
13299
|
-
};
|
|
13300
|
-
convert.hcg.rgb = function(hcg) {
|
|
13301
|
-
var h2 = hcg[0] / 360;
|
|
13302
|
-
var c3 = hcg[1] / 100;
|
|
13303
|
-
var g = hcg[2] / 100;
|
|
13304
|
-
if (c3 === 0) {
|
|
13305
|
-
return [g * 255, g * 255, g * 255];
|
|
13306
|
-
}
|
|
13307
|
-
var pure = [0, 0, 0];
|
|
13308
|
-
var hi = h2 % 1 * 6;
|
|
13309
|
-
var v = hi % 1;
|
|
13310
|
-
var w = 1 - v;
|
|
13311
|
-
var mg = 0;
|
|
13312
|
-
switch (Math.floor(hi)) {
|
|
13313
|
-
case 0:
|
|
13314
|
-
pure[0] = 1;
|
|
13315
|
-
pure[1] = v;
|
|
13316
|
-
pure[2] = 0;
|
|
13317
|
-
break;
|
|
13318
|
-
case 1:
|
|
13319
|
-
pure[0] = w;
|
|
13320
|
-
pure[1] = 1;
|
|
13321
|
-
pure[2] = 0;
|
|
13322
|
-
break;
|
|
13323
|
-
case 2:
|
|
13324
|
-
pure[0] = 0;
|
|
13325
|
-
pure[1] = 1;
|
|
13326
|
-
pure[2] = v;
|
|
13327
|
-
break;
|
|
13328
|
-
case 3:
|
|
13329
|
-
pure[0] = 0;
|
|
13330
|
-
pure[1] = w;
|
|
13331
|
-
pure[2] = 1;
|
|
13332
|
-
break;
|
|
13333
|
-
case 4:
|
|
13334
|
-
pure[0] = v;
|
|
13335
|
-
pure[1] = 0;
|
|
13336
|
-
pure[2] = 1;
|
|
13337
|
-
break;
|
|
13338
|
-
default:
|
|
13339
|
-
pure[0] = 1;
|
|
13340
|
-
pure[1] = 0;
|
|
13341
|
-
pure[2] = w;
|
|
13342
|
-
}
|
|
13343
|
-
mg = (1 - c3) * g;
|
|
13344
|
-
return [
|
|
13345
|
-
(c3 * pure[0] + mg) * 255,
|
|
13346
|
-
(c3 * pure[1] + mg) * 255,
|
|
13347
|
-
(c3 * pure[2] + mg) * 255
|
|
13348
|
-
];
|
|
13349
|
-
};
|
|
13350
|
-
convert.hcg.hsv = function(hcg) {
|
|
13351
|
-
var c3 = hcg[1] / 100;
|
|
13352
|
-
var g = hcg[2] / 100;
|
|
13353
|
-
var v = c3 + g * (1 - c3);
|
|
13354
|
-
var f = 0;
|
|
13355
|
-
if (v > 0) {
|
|
13356
|
-
f = c3 / v;
|
|
13357
|
-
}
|
|
13358
|
-
return [hcg[0], f * 100, v * 100];
|
|
13359
|
-
};
|
|
13360
|
-
convert.hcg.hsl = function(hcg) {
|
|
13361
|
-
var c3 = hcg[1] / 100;
|
|
13362
|
-
var g = hcg[2] / 100;
|
|
13363
|
-
var l = g * (1 - c3) + 0.5 * c3;
|
|
13364
|
-
var s = 0;
|
|
13365
|
-
if (l > 0 && l < 0.5) {
|
|
13366
|
-
s = c3 / (2 * l);
|
|
13367
|
-
} else if (l >= 0.5 && l < 1) {
|
|
13368
|
-
s = c3 / (2 * (1 - l));
|
|
13369
|
-
}
|
|
13370
|
-
return [hcg[0], s * 100, l * 100];
|
|
13371
|
-
};
|
|
13372
|
-
convert.hcg.hwb = function(hcg) {
|
|
13373
|
-
var c3 = hcg[1] / 100;
|
|
13374
|
-
var g = hcg[2] / 100;
|
|
13375
|
-
var v = c3 + g * (1 - c3);
|
|
13376
|
-
return [hcg[0], (v - c3) * 100, (1 - v) * 100];
|
|
13377
|
-
};
|
|
13378
|
-
convert.hwb.hcg = function(hwb) {
|
|
13379
|
-
var w = hwb[1] / 100;
|
|
13380
|
-
var b = hwb[2] / 100;
|
|
13381
|
-
var v = 1 - b;
|
|
13382
|
-
var c3 = v - w;
|
|
13383
|
-
var g = 0;
|
|
13384
|
-
if (c3 < 1) {
|
|
13385
|
-
g = (v - c3) / (1 - c3);
|
|
13386
|
-
}
|
|
13387
|
-
return [hwb[0], c3 * 100, g * 100];
|
|
13388
|
-
};
|
|
13389
|
-
convert.apple.rgb = function(apple) {
|
|
13390
|
-
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
13391
|
-
};
|
|
13392
|
-
convert.rgb.apple = function(rgb) {
|
|
13393
|
-
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
13394
|
-
};
|
|
13395
|
-
convert.gray.rgb = function(args) {
|
|
13396
|
-
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
13397
|
-
};
|
|
13398
|
-
convert.gray.hsl = convert.gray.hsv = function(args) {
|
|
13399
|
-
return [0, 0, args[0]];
|
|
13400
|
-
};
|
|
13401
|
-
convert.gray.hwb = function(gray2) {
|
|
13402
|
-
return [0, 100, gray2[0]];
|
|
13403
|
-
};
|
|
13404
|
-
convert.gray.cmyk = function(gray2) {
|
|
13405
|
-
return [0, 0, 0, gray2[0]];
|
|
13406
|
-
};
|
|
13407
|
-
convert.gray.lab = function(gray2) {
|
|
13408
|
-
return [gray2[0], 0, 0];
|
|
13409
|
-
};
|
|
13410
|
-
convert.gray.hex = function(gray2) {
|
|
13411
|
-
var val = Math.round(gray2[0] / 100 * 255) & 255;
|
|
13412
|
-
var integer = (val << 16) + (val << 8) + val;
|
|
13413
|
-
var string = integer.toString(16).toUpperCase();
|
|
13414
|
-
return "000000".substring(string.length) + string;
|
|
13415
|
-
};
|
|
13416
|
-
convert.rgb.gray = function(rgb) {
|
|
13417
|
-
var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
13418
|
-
return [val / 255 * 100];
|
|
13419
|
-
};
|
|
13420
|
-
}
|
|
13421
|
-
});
|
|
13422
|
-
|
|
13423
|
-
// node_modules/color-convert/route.js
|
|
13424
|
-
var require_route = __commonJS({
|
|
13425
|
-
"node_modules/color-convert/route.js"(exports, module) {
|
|
13426
|
-
var conversions = require_conversions();
|
|
13427
|
-
function buildGraph() {
|
|
13428
|
-
var graph = {};
|
|
13429
|
-
var models = Object.keys(conversions);
|
|
13430
|
-
for (var len = models.length, i2 = 0; i2 < len; i2++) {
|
|
13431
|
-
graph[models[i2]] = {
|
|
13432
|
-
// http://jsperf.com/1-vs-infinity
|
|
13433
|
-
// micro-opt, but this is simple.
|
|
13434
|
-
distance: -1,
|
|
13435
|
-
parent: null
|
|
13436
|
-
};
|
|
13437
|
-
}
|
|
13438
|
-
return graph;
|
|
13439
|
-
}
|
|
13440
|
-
function deriveBFS(fromModel) {
|
|
13441
|
-
var graph = buildGraph();
|
|
13442
|
-
var queue = [fromModel];
|
|
13443
|
-
graph[fromModel].distance = 0;
|
|
13444
|
-
while (queue.length) {
|
|
13445
|
-
var current = queue.pop();
|
|
13446
|
-
var adjacents = Object.keys(conversions[current]);
|
|
13447
|
-
for (var len = adjacents.length, i2 = 0; i2 < len; i2++) {
|
|
13448
|
-
var adjacent = adjacents[i2];
|
|
13449
|
-
var node = graph[adjacent];
|
|
13450
|
-
if (node.distance === -1) {
|
|
13451
|
-
node.distance = graph[current].distance + 1;
|
|
13452
|
-
node.parent = current;
|
|
13453
|
-
queue.unshift(adjacent);
|
|
13454
|
-
}
|
|
13455
|
-
}
|
|
13456
|
-
}
|
|
13457
|
-
return graph;
|
|
13458
|
-
}
|
|
13459
|
-
function link(from, to) {
|
|
13460
|
-
return function(args) {
|
|
13461
|
-
return to(from(args));
|
|
13462
|
-
};
|
|
13463
|
-
}
|
|
13464
|
-
function wrapConversion(toModel, graph) {
|
|
13465
|
-
var path22 = [graph[toModel].parent, toModel];
|
|
13466
|
-
var fn = conversions[graph[toModel].parent][toModel];
|
|
13467
|
-
var cur = graph[toModel].parent;
|
|
13468
|
-
while (graph[cur].parent) {
|
|
13469
|
-
path22.unshift(graph[cur].parent);
|
|
13470
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
13471
|
-
cur = graph[cur].parent;
|
|
13472
|
-
}
|
|
13473
|
-
fn.conversion = path22;
|
|
13474
|
-
return fn;
|
|
13475
|
-
}
|
|
13476
|
-
module.exports = function(fromModel) {
|
|
13477
|
-
var graph = deriveBFS(fromModel);
|
|
13478
|
-
var conversion = {};
|
|
13479
|
-
var models = Object.keys(graph);
|
|
13480
|
-
for (var len = models.length, i2 = 0; i2 < len; i2++) {
|
|
13481
|
-
var toModel = models[i2];
|
|
13482
|
-
var node = graph[toModel];
|
|
13483
|
-
if (node.parent === null) {
|
|
13484
|
-
continue;
|
|
13485
|
-
}
|
|
13486
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
|
13487
|
-
}
|
|
13488
|
-
return conversion;
|
|
13489
|
-
};
|
|
13490
|
-
}
|
|
13491
|
-
});
|
|
13492
|
-
|
|
13493
|
-
// node_modules/color-convert/index.js
|
|
13494
|
-
var require_color_convert = __commonJS({
|
|
13495
|
-
"node_modules/color-convert/index.js"(exports, module) {
|
|
13496
|
-
var conversions = require_conversions();
|
|
13497
|
-
var route = require_route();
|
|
13498
|
-
var convert = {};
|
|
13499
|
-
var models = Object.keys(conversions);
|
|
13500
|
-
function wrapRaw(fn) {
|
|
13501
|
-
var wrappedFn = function(args) {
|
|
13502
|
-
if (args === void 0 || args === null) {
|
|
13503
|
-
return args;
|
|
13504
|
-
}
|
|
13505
|
-
if (arguments.length > 1) {
|
|
13506
|
-
args = Array.prototype.slice.call(arguments);
|
|
13507
|
-
}
|
|
13508
|
-
return fn(args);
|
|
13509
|
-
};
|
|
13510
|
-
if ("conversion" in fn) {
|
|
13511
|
-
wrappedFn.conversion = fn.conversion;
|
|
13512
|
-
}
|
|
13513
|
-
return wrappedFn;
|
|
13514
|
-
}
|
|
13515
|
-
function wrapRounded(fn) {
|
|
13516
|
-
var wrappedFn = function(args) {
|
|
13517
|
-
if (args === void 0 || args === null) {
|
|
13518
|
-
return args;
|
|
13519
|
-
}
|
|
13520
|
-
if (arguments.length > 1) {
|
|
13521
|
-
args = Array.prototype.slice.call(arguments);
|
|
13522
|
-
}
|
|
13523
|
-
var result = fn(args);
|
|
13524
|
-
if (typeof result === "object") {
|
|
13525
|
-
for (var len = result.length, i2 = 0; i2 < len; i2++) {
|
|
13526
|
-
result[i2] = Math.round(result[i2]);
|
|
13527
|
-
}
|
|
13528
|
-
}
|
|
13529
|
-
return result;
|
|
13530
|
-
};
|
|
13531
|
-
if ("conversion" in fn) {
|
|
13532
|
-
wrappedFn.conversion = fn.conversion;
|
|
13533
|
-
}
|
|
13534
|
-
return wrappedFn;
|
|
13535
|
-
}
|
|
13536
|
-
models.forEach(function(fromModel) {
|
|
13537
|
-
convert[fromModel] = {};
|
|
13538
|
-
Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
|
13539
|
-
Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
13540
|
-
var routes = route(fromModel);
|
|
13541
|
-
var routeModels = Object.keys(routes);
|
|
13542
|
-
routeModels.forEach(function(toModel) {
|
|
13543
|
-
var fn = routes[toModel];
|
|
13544
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
13545
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
13546
|
-
});
|
|
13547
|
-
});
|
|
13548
|
-
module.exports = convert;
|
|
13549
|
-
}
|
|
13550
|
-
});
|
|
13551
|
-
|
|
13552
|
-
// node_modules/ansi-styles/index.js
|
|
13553
|
-
var require_ansi_styles = __commonJS({
|
|
13554
|
-
"node_modules/ansi-styles/index.js"(exports, module) {
|
|
13555
|
-
"use strict";
|
|
13556
|
-
var colorConvert = require_color_convert();
|
|
13557
|
-
var wrapAnsi16 = (fn, offset) => function() {
|
|
13558
|
-
const code = fn.apply(colorConvert, arguments);
|
|
13559
|
-
return `\x1B[${code + offset}m`;
|
|
13560
|
-
};
|
|
13561
|
-
var wrapAnsi256 = (fn, offset) => function() {
|
|
13562
|
-
const code = fn.apply(colorConvert, arguments);
|
|
13563
|
-
return `\x1B[${38 + offset};5;${code}m`;
|
|
13564
|
-
};
|
|
13565
|
-
var wrapAnsi16m = (fn, offset) => function() {
|
|
13566
|
-
const rgb = fn.apply(colorConvert, arguments);
|
|
13567
|
-
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
13568
|
-
};
|
|
13569
|
-
function assembleStyles() {
|
|
13570
|
-
const codes2 = /* @__PURE__ */ new Map();
|
|
13571
|
-
const styles = {
|
|
13572
|
-
modifier: {
|
|
13573
|
-
reset: [0, 0],
|
|
13574
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
13575
|
-
bold: [1, 22],
|
|
13576
|
-
dim: [2, 22],
|
|
13577
|
-
italic: [3, 23],
|
|
13578
|
-
underline: [4, 24],
|
|
13579
|
-
inverse: [7, 27],
|
|
13580
|
-
hidden: [8, 28],
|
|
13581
|
-
strikethrough: [9, 29]
|
|
13582
|
-
},
|
|
13583
|
-
color: {
|
|
13584
|
-
black: [30, 39],
|
|
13585
|
-
red: [31, 39],
|
|
13586
|
-
green: [32, 39],
|
|
13587
|
-
yellow: [33, 39],
|
|
13588
|
-
blue: [34, 39],
|
|
13589
|
-
magenta: [35, 39],
|
|
13590
|
-
cyan: [36, 39],
|
|
13591
|
-
white: [37, 39],
|
|
13592
|
-
gray: [90, 39],
|
|
13593
|
-
// Bright color
|
|
13594
|
-
redBright: [91, 39],
|
|
13595
|
-
greenBright: [92, 39],
|
|
13596
|
-
yellowBright: [93, 39],
|
|
13597
|
-
blueBright: [94, 39],
|
|
13598
|
-
magentaBright: [95, 39],
|
|
13599
|
-
cyanBright: [96, 39],
|
|
13600
|
-
whiteBright: [97, 39]
|
|
13601
|
-
},
|
|
13602
|
-
bgColor: {
|
|
13603
|
-
bgBlack: [40, 49],
|
|
13604
|
-
bgRed: [41, 49],
|
|
13605
|
-
bgGreen: [42, 49],
|
|
13606
|
-
bgYellow: [43, 49],
|
|
13607
|
-
bgBlue: [44, 49],
|
|
13608
|
-
bgMagenta: [45, 49],
|
|
13609
|
-
bgCyan: [46, 49],
|
|
13610
|
-
bgWhite: [47, 49],
|
|
13611
|
-
// Bright color
|
|
13612
|
-
bgBlackBright: [100, 49],
|
|
13613
|
-
bgRedBright: [101, 49],
|
|
13614
|
-
bgGreenBright: [102, 49],
|
|
13615
|
-
bgYellowBright: [103, 49],
|
|
13616
|
-
bgBlueBright: [104, 49],
|
|
13617
|
-
bgMagentaBright: [105, 49],
|
|
13618
|
-
bgCyanBright: [106, 49],
|
|
13619
|
-
bgWhiteBright: [107, 49]
|
|
13620
|
-
}
|
|
13621
|
-
};
|
|
13622
|
-
styles.color.grey = styles.color.gray;
|
|
13623
|
-
for (const groupName of Object.keys(styles)) {
|
|
13624
|
-
const group = styles[groupName];
|
|
13625
|
-
for (const styleName of Object.keys(group)) {
|
|
13626
|
-
const style = group[styleName];
|
|
13627
|
-
styles[styleName] = {
|
|
13628
|
-
open: `\x1B[${style[0]}m`,
|
|
13629
|
-
close: `\x1B[${style[1]}m`
|
|
13630
|
-
};
|
|
13631
|
-
group[styleName] = styles[styleName];
|
|
13632
|
-
codes2.set(style[0], style[1]);
|
|
13633
|
-
}
|
|
13634
|
-
Object.defineProperty(styles, groupName, {
|
|
13635
|
-
value: group,
|
|
13636
|
-
enumerable: false
|
|
13637
|
-
});
|
|
13638
|
-
Object.defineProperty(styles, "codes", {
|
|
13639
|
-
value: codes2,
|
|
13640
|
-
enumerable: false
|
|
13641
|
-
});
|
|
13642
|
-
}
|
|
13643
|
-
const ansi2ansi = (n2) => n2;
|
|
13644
|
-
const rgb2rgb = (r, g, b) => [r, g, b];
|
|
13645
|
-
styles.color.close = "\x1B[39m";
|
|
13646
|
-
styles.bgColor.close = "\x1B[49m";
|
|
13647
|
-
styles.color.ansi = {
|
|
13648
|
-
ansi: wrapAnsi16(ansi2ansi, 0)
|
|
13649
|
-
};
|
|
13650
|
-
styles.color.ansi256 = {
|
|
13651
|
-
ansi256: wrapAnsi256(ansi2ansi, 0)
|
|
13652
|
-
};
|
|
13653
|
-
styles.color.ansi16m = {
|
|
13654
|
-
rgb: wrapAnsi16m(rgb2rgb, 0)
|
|
13655
|
-
};
|
|
13656
|
-
styles.bgColor.ansi = {
|
|
13657
|
-
ansi: wrapAnsi16(ansi2ansi, 10)
|
|
13658
|
-
};
|
|
13659
|
-
styles.bgColor.ansi256 = {
|
|
13660
|
-
ansi256: wrapAnsi256(ansi2ansi, 10)
|
|
13661
|
-
};
|
|
13662
|
-
styles.bgColor.ansi16m = {
|
|
13663
|
-
rgb: wrapAnsi16m(rgb2rgb, 10)
|
|
13664
|
-
};
|
|
13665
|
-
for (let key of Object.keys(colorConvert)) {
|
|
13666
|
-
if (typeof colorConvert[key] !== "object") {
|
|
13667
|
-
continue;
|
|
13668
|
-
}
|
|
13669
|
-
const suite = colorConvert[key];
|
|
13670
|
-
if (key === "ansi16") {
|
|
13671
|
-
key = "ansi";
|
|
13672
|
-
}
|
|
13673
|
-
if ("ansi16" in suite) {
|
|
13674
|
-
styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
|
|
13675
|
-
styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
|
|
13676
|
-
}
|
|
13677
|
-
if ("ansi256" in suite) {
|
|
13678
|
-
styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
|
|
13679
|
-
styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
|
|
13680
|
-
}
|
|
13681
|
-
if ("rgb" in suite) {
|
|
13682
|
-
styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
|
|
13683
|
-
styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
|
|
13684
|
-
}
|
|
13685
|
-
}
|
|
13686
|
-
return styles;
|
|
13687
|
-
}
|
|
13688
|
-
Object.defineProperty(module, "exports", {
|
|
13689
|
-
enumerable: true,
|
|
13690
|
-
get: assembleStyles
|
|
13691
|
-
});
|
|
13692
|
-
}
|
|
13693
|
-
});
|
|
13694
|
-
|
|
13695
|
-
// node_modules/chalk/templates.js
|
|
13696
|
-
var require_templates = __commonJS({
|
|
13697
|
-
"node_modules/chalk/templates.js"(exports, module) {
|
|
13698
|
-
"use strict";
|
|
13699
|
-
var TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
13700
|
-
var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
13701
|
-
var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
13702
|
-
var ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
13703
|
-
var ESCAPES = /* @__PURE__ */ new Map([
|
|
13704
|
-
["n", "\n"],
|
|
13705
|
-
["r", "\r"],
|
|
13706
|
-
["t", " "],
|
|
13707
|
-
["b", "\b"],
|
|
13708
|
-
["f", "\f"],
|
|
13709
|
-
["v", "\v"],
|
|
13710
|
-
["0", "\0"],
|
|
13711
|
-
["\\", "\\"],
|
|
13712
|
-
["e", "\x1B"],
|
|
13713
|
-
["a", "\x07"]
|
|
13714
|
-
]);
|
|
13715
|
-
function unescape2(c3) {
|
|
13716
|
-
if (c3[0] === "u" && c3.length === 5 || c3[0] === "x" && c3.length === 3) {
|
|
13717
|
-
return String.fromCharCode(parseInt(c3.slice(1), 16));
|
|
13718
|
-
}
|
|
13719
|
-
return ESCAPES.get(c3) || c3;
|
|
13720
|
-
}
|
|
13721
|
-
function parseArguments2(name, args) {
|
|
13722
|
-
const results = [];
|
|
13723
|
-
const chunks = args.trim().split(/\s*,\s*/g);
|
|
13724
|
-
let matches;
|
|
13725
|
-
for (const chunk of chunks) {
|
|
13726
|
-
if (!isNaN(chunk)) {
|
|
13727
|
-
results.push(Number(chunk));
|
|
13728
|
-
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
13729
|
-
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape2, chr) => escape2 ? unescape2(escape2) : chr));
|
|
13730
|
-
} else {
|
|
13731
|
-
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
13732
|
-
}
|
|
13733
|
-
}
|
|
13734
|
-
return results;
|
|
13735
|
-
}
|
|
13736
|
-
function parseStyle(style) {
|
|
13737
|
-
STYLE_REGEX.lastIndex = 0;
|
|
13738
|
-
const results = [];
|
|
13739
|
-
let matches;
|
|
13740
|
-
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
13741
|
-
const name = matches[1];
|
|
13742
|
-
if (matches[2]) {
|
|
13743
|
-
const args = parseArguments2(name, matches[2]);
|
|
13744
|
-
results.push([name].concat(args));
|
|
13745
|
-
} else {
|
|
13746
|
-
results.push([name]);
|
|
13747
|
-
}
|
|
13748
|
-
}
|
|
13749
|
-
return results;
|
|
13750
|
-
}
|
|
13751
|
-
function buildStyle(chalk, styles) {
|
|
13752
|
-
const enabled = {};
|
|
13753
|
-
for (const layer of styles) {
|
|
13754
|
-
for (const style of layer.styles) {
|
|
13755
|
-
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
13756
|
-
}
|
|
13757
|
-
}
|
|
13758
|
-
let current = chalk;
|
|
13759
|
-
for (const styleName of Object.keys(enabled)) {
|
|
13760
|
-
if (Array.isArray(enabled[styleName])) {
|
|
13761
|
-
if (!(styleName in current)) {
|
|
13762
|
-
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
13763
|
-
}
|
|
13764
|
-
if (enabled[styleName].length > 0) {
|
|
13765
|
-
current = current[styleName].apply(current, enabled[styleName]);
|
|
13766
|
-
} else {
|
|
13767
|
-
current = current[styleName];
|
|
13768
|
-
}
|
|
13769
|
-
}
|
|
13770
|
-
}
|
|
13771
|
-
return current;
|
|
13772
|
-
}
|
|
13773
|
-
module.exports = (chalk, tmp) => {
|
|
13774
|
-
const styles = [];
|
|
13775
|
-
const chunks = [];
|
|
13776
|
-
let chunk = [];
|
|
13777
|
-
tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse2, style, close, chr) => {
|
|
13778
|
-
if (escapeChar) {
|
|
13779
|
-
chunk.push(unescape2(escapeChar));
|
|
13780
|
-
} else if (style) {
|
|
13781
|
-
const str2 = chunk.join("");
|
|
13782
|
-
chunk = [];
|
|
13783
|
-
chunks.push(styles.length === 0 ? str2 : buildStyle(chalk, styles)(str2));
|
|
13784
|
-
styles.push({ inverse: inverse2, styles: parseStyle(style) });
|
|
13785
|
-
} else if (close) {
|
|
13786
|
-
if (styles.length === 0) {
|
|
13787
|
-
throw new Error("Found extraneous } in Chalk template literal");
|
|
13788
|
-
}
|
|
13789
|
-
chunks.push(buildStyle(chalk, styles)(chunk.join("")));
|
|
13790
|
-
chunk = [];
|
|
13791
|
-
styles.pop();
|
|
13792
|
-
} else {
|
|
13793
|
-
chunk.push(chr);
|
|
13794
|
-
}
|
|
13795
|
-
});
|
|
13796
|
-
chunks.push(chunk.join(""));
|
|
13797
|
-
if (styles.length > 0) {
|
|
13798
|
-
const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
13799
|
-
throw new Error(errMsg);
|
|
13800
|
-
}
|
|
13801
|
-
return chunks.join("");
|
|
13802
|
-
};
|
|
13803
|
-
}
|
|
13804
|
-
});
|
|
13805
|
-
|
|
13806
|
-
// node_modules/chalk/index.js
|
|
13807
|
-
var require_chalk = __commonJS({
|
|
13808
|
-
"node_modules/chalk/index.js"(exports, module) {
|
|
13809
|
-
"use strict";
|
|
13810
|
-
var escapeStringRegexp2 = require_escape_string_regexp();
|
|
13811
|
-
var ansiStyles = require_ansi_styles();
|
|
13812
|
-
var stdoutColor = require_supports_color().stdout;
|
|
13813
|
-
var template = require_templates();
|
|
13814
|
-
var isSimpleWindowsTerm = process.platform === "win32" && !(process.env.TERM || "").toLowerCase().startsWith("xterm");
|
|
13815
|
-
var levelMapping = ["ansi", "ansi", "ansi256", "ansi16m"];
|
|
13816
|
-
var skipModels = /* @__PURE__ */ new Set(["gray"]);
|
|
13817
|
-
var styles = /* @__PURE__ */ Object.create(null);
|
|
13818
|
-
function applyOptions(obj, options) {
|
|
13819
|
-
options = options || {};
|
|
13820
|
-
const scLevel = stdoutColor ? stdoutColor.level : 0;
|
|
13821
|
-
obj.level = options.level === void 0 ? scLevel : options.level;
|
|
13822
|
-
obj.enabled = "enabled" in options ? options.enabled : obj.level > 0;
|
|
13823
|
-
}
|
|
13824
|
-
function Chalk(options) {
|
|
13825
|
-
if (!this || !(this instanceof Chalk) || this.template) {
|
|
13826
|
-
const chalk = {};
|
|
13827
|
-
applyOptions(chalk, options);
|
|
13828
|
-
chalk.template = function() {
|
|
13829
|
-
const args = [].slice.call(arguments);
|
|
13830
|
-
return chalkTag.apply(null, [chalk.template].concat(args));
|
|
13831
|
-
};
|
|
13832
|
-
Object.setPrototypeOf(chalk, Chalk.prototype);
|
|
13833
|
-
Object.setPrototypeOf(chalk.template, chalk);
|
|
13834
|
-
chalk.template.constructor = Chalk;
|
|
13835
|
-
return chalk.template;
|
|
13836
|
-
}
|
|
13837
|
-
applyOptions(this, options);
|
|
13838
|
-
}
|
|
13839
|
-
if (isSimpleWindowsTerm) {
|
|
13840
|
-
ansiStyles.blue.open = "\x1B[94m";
|
|
13841
|
-
}
|
|
13842
|
-
for (const key of Object.keys(ansiStyles)) {
|
|
13843
|
-
ansiStyles[key].closeRe = new RegExp(escapeStringRegexp2(ansiStyles[key].close), "g");
|
|
13844
|
-
styles[key] = {
|
|
13845
|
-
get() {
|
|
13846
|
-
const codes2 = ansiStyles[key];
|
|
13847
|
-
return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, key);
|
|
13848
|
-
}
|
|
13849
|
-
};
|
|
13850
|
-
}
|
|
13851
|
-
styles.visible = {
|
|
13852
|
-
get() {
|
|
13853
|
-
return build.call(this, this._styles || [], true, "visible");
|
|
13854
|
-
}
|
|
13855
|
-
};
|
|
13856
|
-
ansiStyles.color.closeRe = new RegExp(escapeStringRegexp2(ansiStyles.color.close), "g");
|
|
13857
|
-
for (const model of Object.keys(ansiStyles.color.ansi)) {
|
|
13858
|
-
if (skipModels.has(model)) {
|
|
13859
|
-
continue;
|
|
13860
|
-
}
|
|
13861
|
-
styles[model] = {
|
|
13862
|
-
get() {
|
|
13863
|
-
const level = this.level;
|
|
13864
|
-
return function() {
|
|
13865
|
-
const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
|
|
13866
|
-
const codes2 = {
|
|
13867
|
-
open,
|
|
13868
|
-
close: ansiStyles.color.close,
|
|
13869
|
-
closeRe: ansiStyles.color.closeRe
|
|
13870
|
-
};
|
|
13871
|
-
return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, model);
|
|
13872
|
-
};
|
|
13873
|
-
}
|
|
13874
|
-
};
|
|
13875
|
-
}
|
|
13876
|
-
ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp2(ansiStyles.bgColor.close), "g");
|
|
13877
|
-
for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
|
|
13878
|
-
if (skipModels.has(model)) {
|
|
13879
|
-
continue;
|
|
13880
|
-
}
|
|
13881
|
-
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
13882
|
-
styles[bgModel] = {
|
|
13883
|
-
get() {
|
|
13884
|
-
const level = this.level;
|
|
13885
|
-
return function() {
|
|
13886
|
-
const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
|
|
13887
|
-
const codes2 = {
|
|
13888
|
-
open,
|
|
13889
|
-
close: ansiStyles.bgColor.close,
|
|
13890
|
-
closeRe: ansiStyles.bgColor.closeRe
|
|
13891
|
-
};
|
|
13892
|
-
return build.call(this, this._styles ? this._styles.concat(codes2) : [codes2], this._empty, model);
|
|
13893
|
-
};
|
|
13894
|
-
}
|
|
13895
|
-
};
|
|
13896
|
-
}
|
|
13897
|
-
var proto = Object.defineProperties(() => {
|
|
13898
|
-
}, styles);
|
|
13899
|
-
function build(_styles, _empty, key) {
|
|
13900
|
-
const builder = function() {
|
|
13901
|
-
return applyStyle.apply(builder, arguments);
|
|
13902
|
-
};
|
|
13903
|
-
builder._styles = _styles;
|
|
13904
|
-
builder._empty = _empty;
|
|
13905
|
-
const self = this;
|
|
13906
|
-
Object.defineProperty(builder, "level", {
|
|
13907
|
-
enumerable: true,
|
|
13908
|
-
get() {
|
|
13909
|
-
return self.level;
|
|
13910
|
-
},
|
|
13911
|
-
set(level) {
|
|
13912
|
-
self.level = level;
|
|
13913
|
-
}
|
|
13914
|
-
});
|
|
13915
|
-
Object.defineProperty(builder, "enabled", {
|
|
13916
|
-
enumerable: true,
|
|
13917
|
-
get() {
|
|
13918
|
-
return self.enabled;
|
|
13919
|
-
},
|
|
13920
|
-
set(enabled) {
|
|
13921
|
-
self.enabled = enabled;
|
|
13922
|
-
}
|
|
13923
|
-
});
|
|
13924
|
-
builder.hasGrey = this.hasGrey || key === "gray" || key === "grey";
|
|
13925
|
-
builder.__proto__ = proto;
|
|
13926
|
-
return builder;
|
|
13927
|
-
}
|
|
13928
|
-
function applyStyle() {
|
|
13929
|
-
const args = arguments;
|
|
13930
|
-
const argsLen = args.length;
|
|
13931
|
-
let str2 = String(arguments[0]);
|
|
13932
|
-
if (argsLen === 0) {
|
|
13933
|
-
return "";
|
|
13934
|
-
}
|
|
13935
|
-
if (argsLen > 1) {
|
|
13936
|
-
for (let a2 = 1; a2 < argsLen; a2++) {
|
|
13937
|
-
str2 += " " + args[a2];
|
|
13938
|
-
}
|
|
13939
|
-
}
|
|
13940
|
-
if (!this.enabled || this.level <= 0 || !str2) {
|
|
13941
|
-
return this._empty ? "" : str2;
|
|
13942
|
-
}
|
|
13943
|
-
const originalDim = ansiStyles.dim.open;
|
|
13944
|
-
if (isSimpleWindowsTerm && this.hasGrey) {
|
|
13945
|
-
ansiStyles.dim.open = "";
|
|
13946
|
-
}
|
|
13947
|
-
for (const code of this._styles.slice().reverse()) {
|
|
13948
|
-
str2 = code.open + str2.replace(code.closeRe, code.open) + code.close;
|
|
13949
|
-
str2 = str2.replace(/\r?\n/g, `${code.close}$&${code.open}`);
|
|
13950
|
-
}
|
|
13951
|
-
ansiStyles.dim.open = originalDim;
|
|
13952
|
-
return str2;
|
|
13953
|
-
}
|
|
13954
|
-
function chalkTag(chalk, strings) {
|
|
13955
|
-
if (!Array.isArray(strings)) {
|
|
13956
|
-
return [].slice.call(arguments, 1).join(" ");
|
|
13957
|
-
}
|
|
13958
|
-
const args = [].slice.call(arguments, 2);
|
|
13959
|
-
const parts = [strings.raw[0]];
|
|
13960
|
-
for (let i2 = 1; i2 < strings.length; i2++) {
|
|
13961
|
-
parts.push(String(args[i2 - 1]).replace(/[{}\\]/g, "\\$&"));
|
|
13962
|
-
parts.push(String(strings.raw[i2]));
|
|
13963
|
-
}
|
|
13964
|
-
return template(chalk, parts.join(""));
|
|
13965
|
-
}
|
|
13966
|
-
Object.defineProperties(Chalk.prototype, styles);
|
|
13967
|
-
module.exports = Chalk();
|
|
13968
|
-
module.exports.supportsColor = stdoutColor;
|
|
13969
|
-
module.exports.default = module.exports;
|
|
13970
|
-
}
|
|
13971
|
-
});
|
|
13972
|
-
|
|
13973
|
-
// node_modules/@babel/highlight/lib/index.js
|
|
12559
|
+
// node_modules/@babel/code-frame/lib/index.js
|
|
13974
12560
|
var require_lib5 = __commonJS({
|
|
13975
|
-
"node_modules/@babel/
|
|
12561
|
+
"node_modules/@babel/code-frame/lib/index.js"(exports) {
|
|
13976
12562
|
"use strict";
|
|
13977
|
-
Object.defineProperty(exports, "__esModule", {
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
13983
|
-
|
|
13984
|
-
var _picocolors = _interopRequireWildcard(require_picocolors(), true);
|
|
13985
|
-
function _getRequireWildcardCache(e) {
|
|
13986
|
-
if ("function" != typeof WeakMap) return null;
|
|
13987
|
-
var r = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap();
|
|
13988
|
-
return (_getRequireWildcardCache = function(e2) {
|
|
13989
|
-
return e2 ? t : r;
|
|
13990
|
-
})(e);
|
|
13991
|
-
}
|
|
13992
|
-
function _interopRequireWildcard(e, r) {
|
|
13993
|
-
if (!r && e && e.__esModule) return e;
|
|
13994
|
-
if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };
|
|
13995
|
-
var t = _getRequireWildcardCache(r);
|
|
13996
|
-
if (t && t.has(e)) return t.get(e);
|
|
13997
|
-
var n2 = { __proto__: null }, a2 = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
13998
|
-
for (var u2 in e) if ("default" !== u2 && {}.hasOwnProperty.call(e, u2)) {
|
|
13999
|
-
var i2 = a2 ? Object.getOwnPropertyDescriptor(e, u2) : null;
|
|
14000
|
-
i2 && (i2.get || i2.set) ? Object.defineProperty(n2, u2, i2) : n2[u2] = e[u2];
|
|
14001
|
-
}
|
|
14002
|
-
return n2.default = e, t && t.set(e, n2), n2;
|
|
14003
|
-
}
|
|
14004
|
-
var colors = typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? (0, _picocolors.createColors)(false) : _picocolors.default;
|
|
12563
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12564
|
+
var picocolors = require_picocolors();
|
|
12565
|
+
var jsTokens = require_js_tokens();
|
|
12566
|
+
var helperValidatorIdentifier = require_lib4();
|
|
12567
|
+
function isColorSupported() {
|
|
12568
|
+
return typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? false : picocolors.isColorSupported;
|
|
12569
|
+
}
|
|
14005
12570
|
var compose = (f, g) => (v) => f(g(v));
|
|
14006
|
-
|
|
14007
|
-
function getDefs(colors2) {
|
|
12571
|
+
function buildDefs(colors) {
|
|
14008
12572
|
return {
|
|
14009
|
-
keyword:
|
|
14010
|
-
capitalized:
|
|
14011
|
-
jsxIdentifier:
|
|
14012
|
-
punctuator:
|
|
14013
|
-
number:
|
|
14014
|
-
string:
|
|
14015
|
-
regex:
|
|
14016
|
-
comment:
|
|
14017
|
-
invalid: compose(compose(
|
|
12573
|
+
keyword: colors.cyan,
|
|
12574
|
+
capitalized: colors.yellow,
|
|
12575
|
+
jsxIdentifier: colors.yellow,
|
|
12576
|
+
punctuator: colors.yellow,
|
|
12577
|
+
number: colors.magenta,
|
|
12578
|
+
string: colors.green,
|
|
12579
|
+
regex: colors.magenta,
|
|
12580
|
+
comment: colors.gray,
|
|
12581
|
+
invalid: compose(compose(colors.white, colors.bgRed), colors.bold),
|
|
12582
|
+
gutter: colors.gray,
|
|
12583
|
+
marker: compose(colors.red, colors.bold),
|
|
12584
|
+
message: compose(colors.red, colors.bold),
|
|
12585
|
+
reset: colors.reset
|
|
14018
12586
|
};
|
|
14019
12587
|
}
|
|
14020
|
-
var
|
|
12588
|
+
var defsOn = buildDefs(picocolors.createColors(true));
|
|
12589
|
+
var defsOff = buildDefs(picocolors.createColors(false));
|
|
12590
|
+
function getDefs(enabled) {
|
|
12591
|
+
return enabled ? defsOn : defsOff;
|
|
12592
|
+
}
|
|
12593
|
+
var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
|
|
12594
|
+
var NEWLINE$1 = /\r\n|[\n\r\u2028\u2029]/;
|
|
14021
12595
|
var BRACKET = /^[()[\]{}]$/;
|
|
14022
12596
|
var tokenize;
|
|
14023
12597
|
{
|
|
14024
12598
|
const JSX_TAG = /^[a-z][\w-]*$/i;
|
|
14025
12599
|
const getTokenType = function(token, offset, text) {
|
|
14026
12600
|
if (token.type === "name") {
|
|
14027
|
-
if (
|
|
12601
|
+
if (helperValidatorIdentifier.isKeyword(token.value) || helperValidatorIdentifier.isStrictReservedWord(token.value, true) || sometimesKeywords.has(token.value)) {
|
|
14028
12602
|
return "keyword";
|
|
14029
12603
|
}
|
|
14030
12604
|
if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) === "</")) {
|
|
@@ -14044,8 +12618,8 @@ var require_lib5 = __commonJS({
|
|
|
14044
12618
|
};
|
|
14045
12619
|
tokenize = function* (text) {
|
|
14046
12620
|
let match2;
|
|
14047
|
-
while (match2 =
|
|
14048
|
-
const token =
|
|
12621
|
+
while (match2 = jsTokens.default.exec(text)) {
|
|
12622
|
+
const token = jsTokens.matchToToken(match2);
|
|
14049
12623
|
yield {
|
|
14050
12624
|
type: getTokenType(token, match2.index, text),
|
|
14051
12625
|
value: token.value
|
|
@@ -14053,111 +12627,23 @@ var require_lib5 = __commonJS({
|
|
|
14053
12627
|
}
|
|
14054
12628
|
};
|
|
14055
12629
|
}
|
|
14056
|
-
function
|
|
12630
|
+
function highlight(text) {
|
|
12631
|
+
if (text === "") return "";
|
|
12632
|
+
const defs = getDefs(true);
|
|
14057
12633
|
let highlighted = "";
|
|
14058
12634
|
for (const {
|
|
14059
12635
|
type: type2,
|
|
14060
12636
|
value
|
|
14061
12637
|
} of tokenize(text)) {
|
|
14062
|
-
|
|
14063
|
-
|
|
14064
|
-
highlighted += value.split(NEWLINE).map((str2) => colorize(str2)).join("\n");
|
|
12638
|
+
if (type2 in defs) {
|
|
12639
|
+
highlighted += value.split(NEWLINE$1).map((str2) => defs[type2](str2)).join("\n");
|
|
14065
12640
|
} else {
|
|
14066
12641
|
highlighted += value;
|
|
14067
12642
|
}
|
|
14068
12643
|
}
|
|
14069
12644
|
return highlighted;
|
|
14070
12645
|
}
|
|
14071
|
-
function shouldHighlight(options) {
|
|
14072
|
-
return colors.isColorSupported || options.forceColor;
|
|
14073
|
-
}
|
|
14074
|
-
var pcWithForcedColor = void 0;
|
|
14075
|
-
function getColors(forceColor) {
|
|
14076
|
-
if (forceColor) {
|
|
14077
|
-
var _pcWithForcedColor;
|
|
14078
|
-
(_pcWithForcedColor = pcWithForcedColor) != null ? _pcWithForcedColor : pcWithForcedColor = (0, _picocolors.createColors)(true);
|
|
14079
|
-
return pcWithForcedColor;
|
|
14080
|
-
}
|
|
14081
|
-
return colors;
|
|
14082
|
-
}
|
|
14083
|
-
function highlight(code, options = {}) {
|
|
14084
|
-
if (code !== "" && shouldHighlight(options)) {
|
|
14085
|
-
const defs = getDefs(getColors(options.forceColor));
|
|
14086
|
-
return highlightTokens(defs, code);
|
|
14087
|
-
} else {
|
|
14088
|
-
return code;
|
|
14089
|
-
}
|
|
14090
|
-
}
|
|
14091
|
-
{
|
|
14092
|
-
let chalk, chalkWithForcedColor;
|
|
14093
|
-
exports.getChalk = ({
|
|
14094
|
-
forceColor
|
|
14095
|
-
}) => {
|
|
14096
|
-
var _chalk;
|
|
14097
|
-
(_chalk = chalk) != null ? _chalk : chalk = require_chalk();
|
|
14098
|
-
if (forceColor) {
|
|
14099
|
-
var _chalkWithForcedColor;
|
|
14100
|
-
(_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new chalk.constructor({
|
|
14101
|
-
enabled: true,
|
|
14102
|
-
level: 1
|
|
14103
|
-
});
|
|
14104
|
-
return chalkWithForcedColor;
|
|
14105
|
-
}
|
|
14106
|
-
return chalk;
|
|
14107
|
-
};
|
|
14108
|
-
}
|
|
14109
|
-
}
|
|
14110
|
-
});
|
|
14111
|
-
|
|
14112
|
-
// node_modules/@babel/code-frame/lib/index.js
|
|
14113
|
-
var require_lib6 = __commonJS({
|
|
14114
|
-
"node_modules/@babel/code-frame/lib/index.js"(exports) {
|
|
14115
|
-
"use strict";
|
|
14116
|
-
Object.defineProperty(exports, "__esModule", {
|
|
14117
|
-
value: true
|
|
14118
|
-
});
|
|
14119
|
-
exports.codeFrameColumns = codeFrameColumns2;
|
|
14120
|
-
exports.default = _default2;
|
|
14121
|
-
var _highlight = require_lib5();
|
|
14122
|
-
var _picocolors = _interopRequireWildcard(require_picocolors(), true);
|
|
14123
|
-
function _getRequireWildcardCache(e) {
|
|
14124
|
-
if ("function" != typeof WeakMap) return null;
|
|
14125
|
-
var r = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap();
|
|
14126
|
-
return (_getRequireWildcardCache = function(e2) {
|
|
14127
|
-
return e2 ? t : r;
|
|
14128
|
-
})(e);
|
|
14129
|
-
}
|
|
14130
|
-
function _interopRequireWildcard(e, r) {
|
|
14131
|
-
if (!r && e && e.__esModule) return e;
|
|
14132
|
-
if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };
|
|
14133
|
-
var t = _getRequireWildcardCache(r);
|
|
14134
|
-
if (t && t.has(e)) return t.get(e);
|
|
14135
|
-
var n2 = { __proto__: null }, a2 = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
14136
|
-
for (var u2 in e) if ("default" !== u2 && {}.hasOwnProperty.call(e, u2)) {
|
|
14137
|
-
var i2 = a2 ? Object.getOwnPropertyDescriptor(e, u2) : null;
|
|
14138
|
-
i2 && (i2.get || i2.set) ? Object.defineProperty(n2, u2, i2) : n2[u2] = e[u2];
|
|
14139
|
-
}
|
|
14140
|
-
return n2.default = e, t && t.set(e, n2), n2;
|
|
14141
|
-
}
|
|
14142
|
-
var colors = typeof process === "object" && (process.env.FORCE_COLOR === "0" || process.env.FORCE_COLOR === "false") ? (0, _picocolors.createColors)(false) : _picocolors.default;
|
|
14143
|
-
var compose = (f, g) => (v) => f(g(v));
|
|
14144
|
-
var pcWithForcedColor = void 0;
|
|
14145
|
-
function getColors(forceColor) {
|
|
14146
|
-
if (forceColor) {
|
|
14147
|
-
var _pcWithForcedColor;
|
|
14148
|
-
(_pcWithForcedColor = pcWithForcedColor) != null ? _pcWithForcedColor : pcWithForcedColor = (0, _picocolors.createColors)(true);
|
|
14149
|
-
return pcWithForcedColor;
|
|
14150
|
-
}
|
|
14151
|
-
return colors;
|
|
14152
|
-
}
|
|
14153
12646
|
var deprecationWarningShown = false;
|
|
14154
|
-
function getDefs(colors2) {
|
|
14155
|
-
return {
|
|
14156
|
-
gutter: colors2.gray,
|
|
14157
|
-
marker: compose(colors2.red, colors2.bold),
|
|
14158
|
-
message: compose(colors2.red, colors2.bold)
|
|
14159
|
-
};
|
|
14160
|
-
}
|
|
14161
12647
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
14162
12648
|
function getMarkerLines(loc, source, opts) {
|
|
14163
12649
|
const startLoc = Object.assign({
|
|
@@ -14216,12 +12702,8 @@ var require_lib6 = __commonJS({
|
|
|
14216
12702
|
};
|
|
14217
12703
|
}
|
|
14218
12704
|
function codeFrameColumns2(rawLines, loc, opts = {}) {
|
|
14219
|
-
const
|
|
14220
|
-
const
|
|
14221
|
-
const defs = getDefs(colors2);
|
|
14222
|
-
const maybeHighlight = (fmt, string) => {
|
|
14223
|
-
return highlighted ? fmt(string) : string;
|
|
14224
|
-
};
|
|
12705
|
+
const shouldHighlight = opts.forceColor || isColorSupported() && opts.highlightCode;
|
|
12706
|
+
const defs = getDefs(shouldHighlight);
|
|
14225
12707
|
const lines = rawLines.split(NEWLINE);
|
|
14226
12708
|
const {
|
|
14227
12709
|
start,
|
|
@@ -14230,9 +12712,9 @@ var require_lib6 = __commonJS({
|
|
|
14230
12712
|
} = getMarkerLines(loc, lines, opts);
|
|
14231
12713
|
const hasColumns = loc.start && typeof loc.start.column === "number";
|
|
14232
12714
|
const numberMaxWidth = String(end).length;
|
|
14233
|
-
const highlightedLines =
|
|
14234
|
-
let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line,
|
|
14235
|
-
const number = start + 1 +
|
|
12715
|
+
const highlightedLines = shouldHighlight ? highlight(rawLines) : rawLines;
|
|
12716
|
+
let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index2) => {
|
|
12717
|
+
const number = start + 1 + index2;
|
|
14236
12718
|
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
|
14237
12719
|
const gutter = ` ${paddedNumber} |`;
|
|
14238
12720
|
const hasMarker = markerLines[number];
|
|
@@ -14242,27 +12724,27 @@ var require_lib6 = __commonJS({
|
|
|
14242
12724
|
if (Array.isArray(hasMarker)) {
|
|
14243
12725
|
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
|
|
14244
12726
|
const numberOfMarkers = hasMarker[1] || 1;
|
|
14245
|
-
markerLine = ["\n ",
|
|
12727
|
+
markerLine = ["\n ", defs.gutter(gutter.replace(/\d/g, " ")), " ", markerSpacing, defs.marker("^").repeat(numberOfMarkers)].join("");
|
|
14246
12728
|
if (lastMarkerLine && opts.message) {
|
|
14247
|
-
markerLine += " " +
|
|
12729
|
+
markerLine += " " + defs.message(opts.message);
|
|
14248
12730
|
}
|
|
14249
12731
|
}
|
|
14250
|
-
return [
|
|
12732
|
+
return [defs.marker(">"), defs.gutter(gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
|
|
14251
12733
|
} else {
|
|
14252
|
-
return ` ${
|
|
12734
|
+
return ` ${defs.gutter(gutter)}${line.length > 0 ? ` ${line}` : ""}`;
|
|
14253
12735
|
}
|
|
14254
12736
|
}).join("\n");
|
|
14255
12737
|
if (opts.message && !hasColumns) {
|
|
14256
12738
|
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}
|
|
14257
12739
|
${frame}`;
|
|
14258
12740
|
}
|
|
14259
|
-
if (
|
|
14260
|
-
return
|
|
12741
|
+
if (shouldHighlight) {
|
|
12742
|
+
return defs.reset(frame);
|
|
14261
12743
|
} else {
|
|
14262
12744
|
return frame;
|
|
14263
12745
|
}
|
|
14264
12746
|
}
|
|
14265
|
-
function
|
|
12747
|
+
function index(rawLines, lineNumber, colNumber, opts = {}) {
|
|
14266
12748
|
if (!deprecationWarningShown) {
|
|
14267
12749
|
deprecationWarningShown = true;
|
|
14268
12750
|
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
|
|
@@ -14283,6 +12765,9 @@ ${frame}`;
|
|
|
14283
12765
|
};
|
|
14284
12766
|
return codeFrameColumns2(rawLines, location, opts);
|
|
14285
12767
|
}
|
|
12768
|
+
exports.codeFrameColumns = codeFrameColumns2;
|
|
12769
|
+
exports.default = index;
|
|
12770
|
+
exports.highlight = highlight;
|
|
14286
12771
|
}
|
|
14287
12772
|
});
|
|
14288
12773
|
|
|
@@ -17361,7 +15846,7 @@ var require_from_url2 = __commonJS({
|
|
|
17361
15846
|
});
|
|
17362
15847
|
|
|
17363
15848
|
// node_modules/hosted-git-info/lib/index.js
|
|
17364
|
-
var
|
|
15849
|
+
var require_lib6 = __commonJS({
|
|
17365
15850
|
"node_modules/hosted-git-info/lib/index.js"(exports, module) {
|
|
17366
15851
|
"use strict";
|
|
17367
15852
|
var { LRUCache } = require_commonjs2();
|
|
@@ -17567,7 +16052,7 @@ var require_fixer = __commonJS({
|
|
|
17567
16052
|
var isValidSemver = require_valid();
|
|
17568
16053
|
var cleanSemver = require_clean();
|
|
17569
16054
|
var validateLicense = require_validate_npm_package_license();
|
|
17570
|
-
var hostedGitInfo =
|
|
16055
|
+
var hostedGitInfo = require_lib6();
|
|
17571
16056
|
var moduleBuiltin = __require("node:module");
|
|
17572
16057
|
var depTypes = ["dependencies", "devDependencies", "optionalDependencies"];
|
|
17573
16058
|
var extractDescription = require_extract_description();
|
|
@@ -18151,7 +16636,7 @@ function indentString(string, count2 = 1, options = {}) {
|
|
|
18151
16636
|
return string.replace(regex, indent.repeat(count2));
|
|
18152
16637
|
}
|
|
18153
16638
|
|
|
18154
|
-
// node_modules/
|
|
16639
|
+
// node_modules/escape-string-regexp/index.js
|
|
18155
16640
|
function escapeStringRegexp(string) {
|
|
18156
16641
|
if (typeof string !== "string") {
|
|
18157
16642
|
throw new TypeError("Expected a string");
|
|
@@ -18380,12 +16865,14 @@ function isPlainObject(value) {
|
|
|
18380
16865
|
// node_modules/execa/lib/arguments/file-url.js
|
|
18381
16866
|
import { fileURLToPath } from "node:url";
|
|
18382
16867
|
var safeNormalizeFileUrl = (file, name) => {
|
|
18383
|
-
const fileString = normalizeFileUrl(file);
|
|
16868
|
+
const fileString = normalizeFileUrl(normalizeDenoExecPath(file));
|
|
18384
16869
|
if (typeof fileString !== "string") {
|
|
18385
16870
|
throw new TypeError(`${name} must be a string or a file URL: ${fileString}.`);
|
|
18386
16871
|
}
|
|
18387
16872
|
return fileString;
|
|
18388
16873
|
};
|
|
16874
|
+
var normalizeDenoExecPath = (file) => isDenoExecPath(file) ? file.toString() : file;
|
|
16875
|
+
var isDenoExecPath = (file) => typeof file !== "string" && file && Object.getPrototypeOf(file) === String.prototype;
|
|
18389
16876
|
var normalizeFileUrl = (file) => file instanceof URL ? fileURLToPath(file) : file;
|
|
18390
16877
|
|
|
18391
16878
|
// node_modules/execa/lib/methods/parameters.js
|
|
@@ -18507,7 +16994,10 @@ var splitByWhitespaces = (template, rawTemplate) => {
|
|
|
18507
16994
|
templateStart = templateIndex + 1;
|
|
18508
16995
|
} else if (rawCharacter === "\\") {
|
|
18509
16996
|
const nextRawCharacter = rawTemplate[rawIndex + 1];
|
|
18510
|
-
if (nextRawCharacter === "
|
|
16997
|
+
if (nextRawCharacter === "\n") {
|
|
16998
|
+
templateIndex -= 1;
|
|
16999
|
+
rawIndex += 1;
|
|
17000
|
+
} else if (nextRawCharacter === "u" && rawTemplate[rawIndex + 2] === "{") {
|
|
18511
17001
|
rawIndex = rawTemplate.indexOf("}", rawIndex + 3);
|
|
18512
17002
|
} else {
|
|
18513
17003
|
rawIndex += ESCAPE_LENGTH[nextRawCharacter] ?? 1;
|
|
@@ -18652,7 +17142,6 @@ var isVerboseFunction = (fdVerbose) => typeof fdVerbose === "function";
|
|
|
18652
17142
|
var VERBOSE_VALUES = ["none", "short", "full"];
|
|
18653
17143
|
|
|
18654
17144
|
// node_modules/execa/lib/verbose/log.js
|
|
18655
|
-
import { writeFileSync } from "node:fs";
|
|
18656
17145
|
import { inspect } from "node:util";
|
|
18657
17146
|
|
|
18658
17147
|
// node_modules/execa/lib/arguments/escape.js
|
|
@@ -19116,7 +17605,9 @@ var verboseLog = ({ type: type2, verboseMessage, fdNumber, verboseInfo, result }
|
|
|
19116
17605
|
const verboseObject = getVerboseObject({ type: type2, result, verboseInfo });
|
|
19117
17606
|
const printedLines = getPrintedLines(verboseMessage, verboseObject);
|
|
19118
17607
|
const finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber);
|
|
19119
|
-
|
|
17608
|
+
if (finalLines !== "") {
|
|
17609
|
+
console.warn(finalLines.slice(0, -1));
|
|
17610
|
+
}
|
|
19120
17611
|
};
|
|
19121
17612
|
var getVerboseObject = ({
|
|
19122
17613
|
type: type2,
|
|
@@ -19136,7 +17627,6 @@ var getPrintedLine = (verboseObject) => {
|
|
|
19136
17627
|
const verboseLine = defaultVerboseFunction(verboseObject);
|
|
19137
17628
|
return { verboseLine, verboseObject };
|
|
19138
17629
|
};
|
|
19139
|
-
var STDERR_FD = 2;
|
|
19140
17630
|
var serializeVerboseMessage = (message) => {
|
|
19141
17631
|
const messageString = typeof message === "string" ? message : inspect(message);
|
|
19142
17632
|
const escapedMessage = escapeLines(messageString);
|
|
@@ -21481,38 +19971,48 @@ function prettyMilliseconds(milliseconds, options) {
|
|
|
21481
19971
|
};
|
|
21482
19972
|
const parsed = parseMilliseconds(milliseconds);
|
|
21483
19973
|
const days = BigInt(parsed.days);
|
|
21484
|
-
|
|
21485
|
-
|
|
21486
|
-
|
|
19974
|
+
if (options.hideYearAndDays) {
|
|
19975
|
+
add(BigInt(days) * 24n + BigInt(parsed.hours), "hour", "h");
|
|
19976
|
+
} else {
|
|
19977
|
+
if (options.hideYear) {
|
|
19978
|
+
add(days, "day", "d");
|
|
19979
|
+
} else {
|
|
19980
|
+
add(days / 365n, "year", "y");
|
|
19981
|
+
add(days % 365n, "day", "d");
|
|
19982
|
+
}
|
|
19983
|
+
add(Number(parsed.hours), "hour", "h");
|
|
19984
|
+
}
|
|
21487
19985
|
add(Number(parsed.minutes), "minute", "m");
|
|
21488
|
-
if (
|
|
21489
|
-
|
|
21490
|
-
|
|
21491
|
-
|
|
21492
|
-
|
|
21493
|
-
|
|
21494
|
-
|
|
21495
|
-
|
|
21496
|
-
|
|
21497
|
-
|
|
19986
|
+
if (!options.hideSeconds) {
|
|
19987
|
+
if (options.separateMilliseconds || options.formatSubMilliseconds || !options.colonNotation && milliseconds < 1e3) {
|
|
19988
|
+
const seconds = Number(parsed.seconds);
|
|
19989
|
+
const milliseconds2 = Number(parsed.milliseconds);
|
|
19990
|
+
const microseconds = Number(parsed.microseconds);
|
|
19991
|
+
const nanoseconds = Number(parsed.nanoseconds);
|
|
19992
|
+
add(seconds, "second", "s");
|
|
19993
|
+
if (options.formatSubMilliseconds) {
|
|
19994
|
+
add(milliseconds2, "millisecond", "ms");
|
|
19995
|
+
add(microseconds, "microsecond", "\xB5s");
|
|
19996
|
+
add(nanoseconds, "nanosecond", "ns");
|
|
19997
|
+
} else {
|
|
19998
|
+
const millisecondsAndBelow = milliseconds2 + microseconds / 1e3 + nanoseconds / 1e6;
|
|
19999
|
+
const millisecondsDecimalDigits = typeof options.millisecondsDecimalDigits === "number" ? options.millisecondsDecimalDigits : 0;
|
|
20000
|
+
const roundedMilliseconds = millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow);
|
|
20001
|
+
const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : roundedMilliseconds;
|
|
20002
|
+
add(
|
|
20003
|
+
Number.parseFloat(millisecondsString),
|
|
20004
|
+
"millisecond",
|
|
20005
|
+
"ms",
|
|
20006
|
+
millisecondsString
|
|
20007
|
+
);
|
|
20008
|
+
}
|
|
21498
20009
|
} else {
|
|
21499
|
-
const
|
|
21500
|
-
const
|
|
21501
|
-
const
|
|
21502
|
-
const
|
|
21503
|
-
add(
|
|
21504
|
-
Number.parseFloat(millisecondsString),
|
|
21505
|
-
"millisecond",
|
|
21506
|
-
"ms",
|
|
21507
|
-
millisecondsString
|
|
21508
|
-
);
|
|
20010
|
+
const seconds = (isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60;
|
|
20011
|
+
const secondsDecimalDigits = typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1;
|
|
20012
|
+
const secondsFixed = floorDecimals(seconds, secondsDecimalDigits);
|
|
20013
|
+
const secondsString = options.keepDecimalsOnWholeSeconds ? secondsFixed : secondsFixed.replace(/\.0+$/, "");
|
|
20014
|
+
add(Number.parseFloat(secondsString), "second", "s", secondsString);
|
|
21509
20015
|
}
|
|
21510
|
-
} else {
|
|
21511
|
-
const seconds = (isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60;
|
|
21512
|
-
const secondsDecimalDigits = typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1;
|
|
21513
|
-
const secondsFixed = floorDecimals(seconds, secondsDecimalDigits);
|
|
21514
|
-
const secondsString = options.keepDecimalsOnWholeSeconds ? secondsFixed : secondsFixed.replace(/\.0+$/, "");
|
|
21515
|
-
add(Number.parseFloat(secondsString), "second", "s", secondsString);
|
|
21516
20016
|
}
|
|
21517
20017
|
if (result.length === 0) {
|
|
21518
20018
|
return sign + "0" + (options.verbose ? " milliseconds" : "ms");
|
|
@@ -21658,7 +20158,8 @@ var isSyncGenerator = (value) => Object.prototype.toString.call(value) === "[obj
|
|
|
21658
20158
|
var isTransformOptions = (value) => isPlainObject(value) && (value.transform !== void 0 || value.final !== void 0);
|
|
21659
20159
|
var isUrl = (value) => Object.prototype.toString.call(value) === "[object URL]";
|
|
21660
20160
|
var isRegularUrl = (value) => isUrl(value) && value.protocol !== "file:";
|
|
21661
|
-
var isFilePathObject = (value) => isPlainObject(value) && Object.keys(value).length
|
|
20161
|
+
var isFilePathObject = (value) => isPlainObject(value) && Object.keys(value).length > 0 && Object.keys(value).every((key) => FILE_PATH_KEYS.has(key)) && isFilePathString(value.file);
|
|
20162
|
+
var FILE_PATH_KEYS = /* @__PURE__ */ new Set(["file", "append"]);
|
|
21662
20163
|
var isFilePathString = (file) => typeof file === "string";
|
|
21663
20164
|
var isUnknownStdioString = (type2, value) => type2 === "native" && typeof value === "string" && !KNOWN_STDIO_STRINGS.has(value);
|
|
21664
20165
|
var KNOWN_STDIO_STRINGS = /* @__PURE__ */ new Set(["ipc", "ignore", "inherit", "overlapped", "pipe"]);
|
|
@@ -22270,7 +20771,7 @@ var addPropertiesSync = {
|
|
|
22270
20771
|
output: {
|
|
22271
20772
|
...addProperties,
|
|
22272
20773
|
fileUrl: ({ value }) => ({ path: value }),
|
|
22273
|
-
filePath: ({ value: { file } }) => ({ path: file }),
|
|
20774
|
+
filePath: ({ value: { file, append } }) => ({ path: file, append }),
|
|
22274
20775
|
fileNumber: ({ value }) => ({ path: value }),
|
|
22275
20776
|
iterable: forbiddenIfSync,
|
|
22276
20777
|
string: forbiddenIfSync,
|
|
@@ -22607,7 +21108,7 @@ var validateSerializable = (newContents) => {
|
|
|
22607
21108
|
};
|
|
22608
21109
|
|
|
22609
21110
|
// node_modules/execa/lib/io/output-sync.js
|
|
22610
|
-
import { writeFileSync
|
|
21111
|
+
import { writeFileSync, appendFileSync } from "node:fs";
|
|
22611
21112
|
|
|
22612
21113
|
// node_modules/execa/lib/verbose/output.js
|
|
22613
21114
|
var shouldLogOutput = ({ stdioItems, encoding, verboseInfo, fdNumber }) => fdNumber !== "all" && isFullVerbose(verboseInfo, fdNumber) && !BINARY_ENCODINGS.has(encoding) && fdUsesVerbose(fdNumber) && (stdioItems.some(({ type: type2, value }) => type2 === "native" && PIPED_STDIO_VALUES.has(value)) || stdioItems.every(({ type: type2 }) => TRANSFORM_TYPES.has(type2)));
|
|
@@ -22728,13 +21229,13 @@ var logOutputSync = ({ serializedResult, fdNumber, state, verboseInfo, encoding,
|
|
|
22728
21229
|
}
|
|
22729
21230
|
};
|
|
22730
21231
|
var writeToFiles = (serializedResult, stdioItems, outputFiles) => {
|
|
22731
|
-
for (const { path: path22 } of stdioItems.filter(({ type: type2 }) => FILE_TYPES.has(type2))) {
|
|
21232
|
+
for (const { path: path22, append } of stdioItems.filter(({ type: type2 }) => FILE_TYPES.has(type2))) {
|
|
22732
21233
|
const pathString = typeof path22 === "string" ? path22 : path22.toString();
|
|
22733
|
-
if (outputFiles.has(pathString)) {
|
|
21234
|
+
if (append || outputFiles.has(pathString)) {
|
|
22734
21235
|
appendFileSync(path22, serializedResult);
|
|
22735
21236
|
} else {
|
|
22736
21237
|
outputFiles.add(pathString);
|
|
22737
|
-
|
|
21238
|
+
writeFileSync(path22, serializedResult);
|
|
22738
21239
|
}
|
|
22739
21240
|
}
|
|
22740
21241
|
};
|
|
@@ -23218,7 +21719,7 @@ var addPropertiesAsync = {
|
|
|
23218
21719
|
output: {
|
|
23219
21720
|
...addProperties2,
|
|
23220
21721
|
fileUrl: ({ value }) => ({ stream: createWriteStream(value) }),
|
|
23221
|
-
filePath: ({ value: { file } }) => ({ stream: createWriteStream(file) }),
|
|
21722
|
+
filePath: ({ value: { file, append } }) => ({ stream: createWriteStream(file, append ? { flags: "a" } : {}) }),
|
|
23222
21723
|
webStream: ({ value }) => ({ stream: Writable2.fromWeb(value) }),
|
|
23223
21724
|
iterable: forbiddenIfAsync,
|
|
23224
21725
|
asyncIterable: forbiddenIfAsync,
|
|
@@ -23848,7 +22349,7 @@ var getDestination = (boundOptions, createNested, firstArgument, ...pipeArgument
|
|
|
23848
22349
|
const destination = createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments);
|
|
23849
22350
|
return { destination, pipeOptions: boundOptions };
|
|
23850
22351
|
}
|
|
23851
|
-
if (typeof firstArgument === "string" || firstArgument instanceof URL) {
|
|
22352
|
+
if (typeof firstArgument === "string" || firstArgument instanceof URL || isDenoExecPath(firstArgument)) {
|
|
23852
22353
|
if (Object.keys(boundOptions).length > 0) {
|
|
23853
22354
|
throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');
|
|
23854
22355
|
}
|
|
@@ -28410,7 +26911,7 @@ async function pMap(iterable, mapper, {
|
|
|
28410
26911
|
stopOnError = true,
|
|
28411
26912
|
signal
|
|
28412
26913
|
} = {}) {
|
|
28413
|
-
return new Promise((
|
|
26914
|
+
return new Promise((resolve_, reject_) => {
|
|
28414
26915
|
if (iterable[Symbol.iterator] === void 0 && iterable[Symbol.asyncIterator] === void 0) {
|
|
28415
26916
|
throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
|
|
28416
26917
|
}
|
|
@@ -28429,18 +26930,27 @@ async function pMap(iterable, mapper, {
|
|
|
28429
26930
|
let resolvingCount = 0;
|
|
28430
26931
|
let currentIndex = 0;
|
|
28431
26932
|
const iterator = iterable[Symbol.iterator] === void 0 ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
|
|
26933
|
+
const signalListener = () => {
|
|
26934
|
+
reject(signal.reason);
|
|
26935
|
+
};
|
|
26936
|
+
const cleanup = () => {
|
|
26937
|
+
signal?.removeEventListener("abort", signalListener);
|
|
26938
|
+
};
|
|
26939
|
+
const resolve2 = (value) => {
|
|
26940
|
+
resolve_(value);
|
|
26941
|
+
cleanup();
|
|
26942
|
+
};
|
|
28432
26943
|
const reject = (reason) => {
|
|
28433
26944
|
isRejected = true;
|
|
28434
26945
|
isResolved = true;
|
|
28435
26946
|
reject_(reason);
|
|
26947
|
+
cleanup();
|
|
28436
26948
|
};
|
|
28437
26949
|
if (signal) {
|
|
28438
26950
|
if (signal.aborted) {
|
|
28439
26951
|
reject(signal.reason);
|
|
28440
26952
|
}
|
|
28441
|
-
signal.addEventListener("abort",
|
|
28442
|
-
reject(signal.reason);
|
|
28443
|
-
});
|
|
26953
|
+
signal.addEventListener("abort", signalListener, { once: true });
|
|
28444
26954
|
}
|
|
28445
26955
|
const next = async () => {
|
|
28446
26956
|
if (isResolved) {
|
|
@@ -32758,7 +31268,7 @@ import fsPromises4 from "node:fs/promises";
|
|
|
32758
31268
|
import path19 from "node:path";
|
|
32759
31269
|
|
|
32760
31270
|
// node_modules/read-package-up/node_modules/parse-json/index.js
|
|
32761
|
-
var import_code_frame = __toESM(
|
|
31271
|
+
var import_code_frame = __toESM(require_lib5(), 1);
|
|
32762
31272
|
|
|
32763
31273
|
// node_modules/index-to-position/index.js
|
|
32764
31274
|
var safeLastIndexOf = (string, searchString, index) => index < 0 ? -1 : string.lastIndexOf(searchString, index);
|