@kevisual/cli 0.0.62 → 0.0.63
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/assistant-server.js +2199 -1870
- package/dist/assistant.js +887 -1612
- package/dist/envision.js +2 -14
- package/package.json +1 -1
package/dist/assistant.js
CHANGED
|
@@ -22780,80 +22780,6 @@ var require_dayjs_min = __commonJS((exports, module) => {
|
|
|
22780
22780
|
});
|
|
22781
22781
|
});
|
|
22782
22782
|
|
|
22783
|
-
// ../node_modules/.pnpm/yoctocolors-cjs@2.1.3/node_modules/yoctocolors-cjs/index.js
|
|
22784
|
-
var require_yoctocolors_cjs = __commonJS((exports, module) => {
|
|
22785
|
-
var tty3 = __require("node:tty");
|
|
22786
|
-
var hasColors = tty3?.WriteStream?.prototype?.hasColors?.() ?? false;
|
|
22787
|
-
var format = (open, close) => {
|
|
22788
|
-
if (!hasColors) {
|
|
22789
|
-
return (input) => input;
|
|
22790
|
-
}
|
|
22791
|
-
const openCode = `\x1B[${open}m`;
|
|
22792
|
-
const closeCode = `\x1B[${close}m`;
|
|
22793
|
-
return (input) => {
|
|
22794
|
-
const string2 = input + "";
|
|
22795
|
-
let index = string2.indexOf(closeCode);
|
|
22796
|
-
if (index === -1) {
|
|
22797
|
-
return openCode + string2 + closeCode;
|
|
22798
|
-
}
|
|
22799
|
-
let result = openCode;
|
|
22800
|
-
let lastIndex = 0;
|
|
22801
|
-
const reopenOnNestedClose = close === 22;
|
|
22802
|
-
const replaceCode = (reopenOnNestedClose ? closeCode : "") + openCode;
|
|
22803
|
-
while (index !== -1) {
|
|
22804
|
-
result += string2.slice(lastIndex, index) + replaceCode;
|
|
22805
|
-
lastIndex = index + closeCode.length;
|
|
22806
|
-
index = string2.indexOf(closeCode, lastIndex);
|
|
22807
|
-
}
|
|
22808
|
-
result += string2.slice(lastIndex) + closeCode;
|
|
22809
|
-
return result;
|
|
22810
|
-
};
|
|
22811
|
-
};
|
|
22812
|
-
var colors = {};
|
|
22813
|
-
colors.reset = format(0, 0);
|
|
22814
|
-
colors.bold = format(1, 22);
|
|
22815
|
-
colors.dim = format(2, 22);
|
|
22816
|
-
colors.italic = format(3, 23);
|
|
22817
|
-
colors.underline = format(4, 24);
|
|
22818
|
-
colors.overline = format(53, 55);
|
|
22819
|
-
colors.inverse = format(7, 27);
|
|
22820
|
-
colors.hidden = format(8, 28);
|
|
22821
|
-
colors.strikethrough = format(9, 29);
|
|
22822
|
-
colors.black = format(30, 39);
|
|
22823
|
-
colors.red = format(31, 39);
|
|
22824
|
-
colors.green = format(32, 39);
|
|
22825
|
-
colors.yellow = format(33, 39);
|
|
22826
|
-
colors.blue = format(34, 39);
|
|
22827
|
-
colors.magenta = format(35, 39);
|
|
22828
|
-
colors.cyan = format(36, 39);
|
|
22829
|
-
colors.white = format(37, 39);
|
|
22830
|
-
colors.gray = format(90, 39);
|
|
22831
|
-
colors.bgBlack = format(40, 49);
|
|
22832
|
-
colors.bgRed = format(41, 49);
|
|
22833
|
-
colors.bgGreen = format(42, 49);
|
|
22834
|
-
colors.bgYellow = format(43, 49);
|
|
22835
|
-
colors.bgBlue = format(44, 49);
|
|
22836
|
-
colors.bgMagenta = format(45, 49);
|
|
22837
|
-
colors.bgCyan = format(46, 49);
|
|
22838
|
-
colors.bgWhite = format(47, 49);
|
|
22839
|
-
colors.bgGray = format(100, 49);
|
|
22840
|
-
colors.redBright = format(91, 39);
|
|
22841
|
-
colors.greenBright = format(92, 39);
|
|
22842
|
-
colors.yellowBright = format(93, 39);
|
|
22843
|
-
colors.blueBright = format(94, 39);
|
|
22844
|
-
colors.magentaBright = format(95, 39);
|
|
22845
|
-
colors.cyanBright = format(96, 39);
|
|
22846
|
-
colors.whiteBright = format(97, 39);
|
|
22847
|
-
colors.bgRedBright = format(101, 49);
|
|
22848
|
-
colors.bgGreenBright = format(102, 49);
|
|
22849
|
-
colors.bgYellowBright = format(103, 49);
|
|
22850
|
-
colors.bgBlueBright = format(104, 49);
|
|
22851
|
-
colors.bgMagentaBright = format(105, 49);
|
|
22852
|
-
colors.bgCyanBright = format(106, 49);
|
|
22853
|
-
colors.bgWhiteBright = format(107, 49);
|
|
22854
|
-
module.exports = colors;
|
|
22855
|
-
});
|
|
22856
|
-
|
|
22857
22783
|
// ../node_modules/.pnpm/cli-width@4.1.0/node_modules/cli-width/index.js
|
|
22858
22784
|
var require_cli_width = __commonJS((exports, module) => {
|
|
22859
22785
|
module.exports = cliWidth;
|
|
@@ -22894,1296 +22820,10 @@ var require_cli_width = __commonJS((exports, module) => {
|
|
|
22894
22820
|
}
|
|
22895
22821
|
});
|
|
22896
22822
|
|
|
22897
|
-
// ../node_modules/.pnpm/
|
|
22898
|
-
var require_ansi_regex = __commonJS((exports, module) => {
|
|
22899
|
-
module.exports = ({ onlyFirst = false } = {}) => {
|
|
22900
|
-
const pattern2 = [
|
|
22901
|
-
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
|
22902
|
-
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
|
|
22903
|
-
].join("|");
|
|
22904
|
-
return new RegExp(pattern2, onlyFirst ? undefined : "g");
|
|
22905
|
-
};
|
|
22906
|
-
});
|
|
22907
|
-
|
|
22908
|
-
// ../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js
|
|
22909
|
-
var require_strip_ansi = __commonJS((exports, module) => {
|
|
22910
|
-
var ansiRegex = require_ansi_regex();
|
|
22911
|
-
module.exports = (string2) => typeof string2 === "string" ? string2.replace(ansiRegex(), "") : string2;
|
|
22912
|
-
});
|
|
22913
|
-
|
|
22914
|
-
// ../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js
|
|
22915
|
-
var require_is_fullwidth_code_point = __commonJS((exports, module) => {
|
|
22916
|
-
var isFullwidthCodePoint = (codePoint) => {
|
|
22917
|
-
if (Number.isNaN(codePoint)) {
|
|
22918
|
-
return false;
|
|
22919
|
-
}
|
|
22920
|
-
if (codePoint >= 4352 && (codePoint <= 4447 || codePoint === 9001 || codePoint === 9002 || 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || 12880 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65131 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 262141)) {
|
|
22921
|
-
return true;
|
|
22922
|
-
}
|
|
22923
|
-
return false;
|
|
22924
|
-
};
|
|
22925
|
-
module.exports = isFullwidthCodePoint;
|
|
22926
|
-
module.exports.default = isFullwidthCodePoint;
|
|
22927
|
-
});
|
|
22928
|
-
|
|
22929
|
-
// ../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js
|
|
22823
|
+
// ../node_modules/.pnpm/emoji-regex@10.6.0/node_modules/emoji-regex/index.js
|
|
22930
22824
|
var require_emoji_regex = __commonJS((exports, module) => {
|
|
22931
|
-
module.exports =
|
|
22932
|
-
return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
|
|
22933
|
-
};
|
|
22934
|
-
});
|
|
22935
|
-
|
|
22936
|
-
// ../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js
|
|
22937
|
-
var require_string_width = __commonJS((exports, module) => {
|
|
22938
|
-
var stripAnsi = require_strip_ansi();
|
|
22939
|
-
var isFullwidthCodePoint = require_is_fullwidth_code_point();
|
|
22940
|
-
var emojiRegex = require_emoji_regex();
|
|
22941
|
-
var stringWidth = (string2) => {
|
|
22942
|
-
if (typeof string2 !== "string" || string2.length === 0) {
|
|
22943
|
-
return 0;
|
|
22944
|
-
}
|
|
22945
|
-
string2 = stripAnsi(string2);
|
|
22946
|
-
if (string2.length === 0) {
|
|
22947
|
-
return 0;
|
|
22948
|
-
}
|
|
22949
|
-
string2 = string2.replace(emojiRegex(), " ");
|
|
22950
|
-
let width = 0;
|
|
22951
|
-
for (let i = 0;i < string2.length; i++) {
|
|
22952
|
-
const code = string2.codePointAt(i);
|
|
22953
|
-
if (code <= 31 || code >= 127 && code <= 159) {
|
|
22954
|
-
continue;
|
|
22955
|
-
}
|
|
22956
|
-
if (code >= 768 && code <= 879) {
|
|
22957
|
-
continue;
|
|
22958
|
-
}
|
|
22959
|
-
if (code > 65535) {
|
|
22960
|
-
i++;
|
|
22961
|
-
}
|
|
22962
|
-
width += isFullwidthCodePoint(code) ? 2 : 1;
|
|
22963
|
-
}
|
|
22964
|
-
return width;
|
|
22965
|
-
};
|
|
22966
|
-
module.exports = stringWidth;
|
|
22967
|
-
module.exports.default = stringWidth;
|
|
22968
|
-
});
|
|
22969
|
-
|
|
22970
|
-
// ../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js
|
|
22971
|
-
var require_color_name = __commonJS((exports, module) => {
|
|
22972
|
-
module.exports = {
|
|
22973
|
-
aliceblue: [240, 248, 255],
|
|
22974
|
-
antiquewhite: [250, 235, 215],
|
|
22975
|
-
aqua: [0, 255, 255],
|
|
22976
|
-
aquamarine: [127, 255, 212],
|
|
22977
|
-
azure: [240, 255, 255],
|
|
22978
|
-
beige: [245, 245, 220],
|
|
22979
|
-
bisque: [255, 228, 196],
|
|
22980
|
-
black: [0, 0, 0],
|
|
22981
|
-
blanchedalmond: [255, 235, 205],
|
|
22982
|
-
blue: [0, 0, 255],
|
|
22983
|
-
blueviolet: [138, 43, 226],
|
|
22984
|
-
brown: [165, 42, 42],
|
|
22985
|
-
burlywood: [222, 184, 135],
|
|
22986
|
-
cadetblue: [95, 158, 160],
|
|
22987
|
-
chartreuse: [127, 255, 0],
|
|
22988
|
-
chocolate: [210, 105, 30],
|
|
22989
|
-
coral: [255, 127, 80],
|
|
22990
|
-
cornflowerblue: [100, 149, 237],
|
|
22991
|
-
cornsilk: [255, 248, 220],
|
|
22992
|
-
crimson: [220, 20, 60],
|
|
22993
|
-
cyan: [0, 255, 255],
|
|
22994
|
-
darkblue: [0, 0, 139],
|
|
22995
|
-
darkcyan: [0, 139, 139],
|
|
22996
|
-
darkgoldenrod: [184, 134, 11],
|
|
22997
|
-
darkgray: [169, 169, 169],
|
|
22998
|
-
darkgreen: [0, 100, 0],
|
|
22999
|
-
darkgrey: [169, 169, 169],
|
|
23000
|
-
darkkhaki: [189, 183, 107],
|
|
23001
|
-
darkmagenta: [139, 0, 139],
|
|
23002
|
-
darkolivegreen: [85, 107, 47],
|
|
23003
|
-
darkorange: [255, 140, 0],
|
|
23004
|
-
darkorchid: [153, 50, 204],
|
|
23005
|
-
darkred: [139, 0, 0],
|
|
23006
|
-
darksalmon: [233, 150, 122],
|
|
23007
|
-
darkseagreen: [143, 188, 143],
|
|
23008
|
-
darkslateblue: [72, 61, 139],
|
|
23009
|
-
darkslategray: [47, 79, 79],
|
|
23010
|
-
darkslategrey: [47, 79, 79],
|
|
23011
|
-
darkturquoise: [0, 206, 209],
|
|
23012
|
-
darkviolet: [148, 0, 211],
|
|
23013
|
-
deeppink: [255, 20, 147],
|
|
23014
|
-
deepskyblue: [0, 191, 255],
|
|
23015
|
-
dimgray: [105, 105, 105],
|
|
23016
|
-
dimgrey: [105, 105, 105],
|
|
23017
|
-
dodgerblue: [30, 144, 255],
|
|
23018
|
-
firebrick: [178, 34, 34],
|
|
23019
|
-
floralwhite: [255, 250, 240],
|
|
23020
|
-
forestgreen: [34, 139, 34],
|
|
23021
|
-
fuchsia: [255, 0, 255],
|
|
23022
|
-
gainsboro: [220, 220, 220],
|
|
23023
|
-
ghostwhite: [248, 248, 255],
|
|
23024
|
-
gold: [255, 215, 0],
|
|
23025
|
-
goldenrod: [218, 165, 32],
|
|
23026
|
-
gray: [128, 128, 128],
|
|
23027
|
-
green: [0, 128, 0],
|
|
23028
|
-
greenyellow: [173, 255, 47],
|
|
23029
|
-
grey: [128, 128, 128],
|
|
23030
|
-
honeydew: [240, 255, 240],
|
|
23031
|
-
hotpink: [255, 105, 180],
|
|
23032
|
-
indianred: [205, 92, 92],
|
|
23033
|
-
indigo: [75, 0, 130],
|
|
23034
|
-
ivory: [255, 255, 240],
|
|
23035
|
-
khaki: [240, 230, 140],
|
|
23036
|
-
lavender: [230, 230, 250],
|
|
23037
|
-
lavenderblush: [255, 240, 245],
|
|
23038
|
-
lawngreen: [124, 252, 0],
|
|
23039
|
-
lemonchiffon: [255, 250, 205],
|
|
23040
|
-
lightblue: [173, 216, 230],
|
|
23041
|
-
lightcoral: [240, 128, 128],
|
|
23042
|
-
lightcyan: [224, 255, 255],
|
|
23043
|
-
lightgoldenrodyellow: [250, 250, 210],
|
|
23044
|
-
lightgray: [211, 211, 211],
|
|
23045
|
-
lightgreen: [144, 238, 144],
|
|
23046
|
-
lightgrey: [211, 211, 211],
|
|
23047
|
-
lightpink: [255, 182, 193],
|
|
23048
|
-
lightsalmon: [255, 160, 122],
|
|
23049
|
-
lightseagreen: [32, 178, 170],
|
|
23050
|
-
lightskyblue: [135, 206, 250],
|
|
23051
|
-
lightslategray: [119, 136, 153],
|
|
23052
|
-
lightslategrey: [119, 136, 153],
|
|
23053
|
-
lightsteelblue: [176, 196, 222],
|
|
23054
|
-
lightyellow: [255, 255, 224],
|
|
23055
|
-
lime: [0, 255, 0],
|
|
23056
|
-
limegreen: [50, 205, 50],
|
|
23057
|
-
linen: [250, 240, 230],
|
|
23058
|
-
magenta: [255, 0, 255],
|
|
23059
|
-
maroon: [128, 0, 0],
|
|
23060
|
-
mediumaquamarine: [102, 205, 170],
|
|
23061
|
-
mediumblue: [0, 0, 205],
|
|
23062
|
-
mediumorchid: [186, 85, 211],
|
|
23063
|
-
mediumpurple: [147, 112, 219],
|
|
23064
|
-
mediumseagreen: [60, 179, 113],
|
|
23065
|
-
mediumslateblue: [123, 104, 238],
|
|
23066
|
-
mediumspringgreen: [0, 250, 154],
|
|
23067
|
-
mediumturquoise: [72, 209, 204],
|
|
23068
|
-
mediumvioletred: [199, 21, 133],
|
|
23069
|
-
midnightblue: [25, 25, 112],
|
|
23070
|
-
mintcream: [245, 255, 250],
|
|
23071
|
-
mistyrose: [255, 228, 225],
|
|
23072
|
-
moccasin: [255, 228, 181],
|
|
23073
|
-
navajowhite: [255, 222, 173],
|
|
23074
|
-
navy: [0, 0, 128],
|
|
23075
|
-
oldlace: [253, 245, 230],
|
|
23076
|
-
olive: [128, 128, 0],
|
|
23077
|
-
olivedrab: [107, 142, 35],
|
|
23078
|
-
orange: [255, 165, 0],
|
|
23079
|
-
orangered: [255, 69, 0],
|
|
23080
|
-
orchid: [218, 112, 214],
|
|
23081
|
-
palegoldenrod: [238, 232, 170],
|
|
23082
|
-
palegreen: [152, 251, 152],
|
|
23083
|
-
paleturquoise: [175, 238, 238],
|
|
23084
|
-
palevioletred: [219, 112, 147],
|
|
23085
|
-
papayawhip: [255, 239, 213],
|
|
23086
|
-
peachpuff: [255, 218, 185],
|
|
23087
|
-
peru: [205, 133, 63],
|
|
23088
|
-
pink: [255, 192, 203],
|
|
23089
|
-
plum: [221, 160, 221],
|
|
23090
|
-
powderblue: [176, 224, 230],
|
|
23091
|
-
purple: [128, 0, 128],
|
|
23092
|
-
rebeccapurple: [102, 51, 153],
|
|
23093
|
-
red: [255, 0, 0],
|
|
23094
|
-
rosybrown: [188, 143, 143],
|
|
23095
|
-
royalblue: [65, 105, 225],
|
|
23096
|
-
saddlebrown: [139, 69, 19],
|
|
23097
|
-
salmon: [250, 128, 114],
|
|
23098
|
-
sandybrown: [244, 164, 96],
|
|
23099
|
-
seagreen: [46, 139, 87],
|
|
23100
|
-
seashell: [255, 245, 238],
|
|
23101
|
-
sienna: [160, 82, 45],
|
|
23102
|
-
silver: [192, 192, 192],
|
|
23103
|
-
skyblue: [135, 206, 235],
|
|
23104
|
-
slateblue: [106, 90, 205],
|
|
23105
|
-
slategray: [112, 128, 144],
|
|
23106
|
-
slategrey: [112, 128, 144],
|
|
23107
|
-
snow: [255, 250, 250],
|
|
23108
|
-
springgreen: [0, 255, 127],
|
|
23109
|
-
steelblue: [70, 130, 180],
|
|
23110
|
-
tan: [210, 180, 140],
|
|
23111
|
-
teal: [0, 128, 128],
|
|
23112
|
-
thistle: [216, 191, 216],
|
|
23113
|
-
tomato: [255, 99, 71],
|
|
23114
|
-
turquoise: [64, 224, 208],
|
|
23115
|
-
violet: [238, 130, 238],
|
|
23116
|
-
wheat: [245, 222, 179],
|
|
23117
|
-
white: [255, 255, 255],
|
|
23118
|
-
whitesmoke: [245, 245, 245],
|
|
23119
|
-
yellow: [255, 255, 0],
|
|
23120
|
-
yellowgreen: [154, 205, 50]
|
|
23121
|
-
};
|
|
23122
|
-
});
|
|
23123
|
-
|
|
23124
|
-
// ../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js
|
|
23125
|
-
var require_conversions = __commonJS((exports, module) => {
|
|
23126
|
-
var cssKeywords = require_color_name();
|
|
23127
|
-
var reverseKeywords = {};
|
|
23128
|
-
for (const key of Object.keys(cssKeywords)) {
|
|
23129
|
-
reverseKeywords[cssKeywords[key]] = key;
|
|
23130
|
-
}
|
|
23131
|
-
var convert = {
|
|
23132
|
-
rgb: { channels: 3, labels: "rgb" },
|
|
23133
|
-
hsl: { channels: 3, labels: "hsl" },
|
|
23134
|
-
hsv: { channels: 3, labels: "hsv" },
|
|
23135
|
-
hwb: { channels: 3, labels: "hwb" },
|
|
23136
|
-
cmyk: { channels: 4, labels: "cmyk" },
|
|
23137
|
-
xyz: { channels: 3, labels: "xyz" },
|
|
23138
|
-
lab: { channels: 3, labels: "lab" },
|
|
23139
|
-
lch: { channels: 3, labels: "lch" },
|
|
23140
|
-
hex: { channels: 1, labels: ["hex"] },
|
|
23141
|
-
keyword: { channels: 1, labels: ["keyword"] },
|
|
23142
|
-
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
23143
|
-
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
23144
|
-
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
23145
|
-
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
23146
|
-
gray: { channels: 1, labels: ["gray"] }
|
|
23147
|
-
};
|
|
23148
|
-
module.exports = convert;
|
|
23149
|
-
for (const model of Object.keys(convert)) {
|
|
23150
|
-
if (!("channels" in convert[model])) {
|
|
23151
|
-
throw new Error("missing channels property: " + model);
|
|
23152
|
-
}
|
|
23153
|
-
if (!("labels" in convert[model])) {
|
|
23154
|
-
throw new Error("missing channel labels property: " + model);
|
|
23155
|
-
}
|
|
23156
|
-
if (convert[model].labels.length !== convert[model].channels) {
|
|
23157
|
-
throw new Error("channel and label counts mismatch: " + model);
|
|
23158
|
-
}
|
|
23159
|
-
const { channels, labels } = convert[model];
|
|
23160
|
-
delete convert[model].channels;
|
|
23161
|
-
delete convert[model].labels;
|
|
23162
|
-
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
23163
|
-
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
23164
|
-
}
|
|
23165
|
-
convert.rgb.hsl = function(rgb) {
|
|
23166
|
-
const r = rgb[0] / 255;
|
|
23167
|
-
const g = rgb[1] / 255;
|
|
23168
|
-
const b = rgb[2] / 255;
|
|
23169
|
-
const min = Math.min(r, g, b);
|
|
23170
|
-
const max = Math.max(r, g, b);
|
|
23171
|
-
const delta = max - min;
|
|
23172
|
-
let h;
|
|
23173
|
-
let s;
|
|
23174
|
-
if (max === min) {
|
|
23175
|
-
h = 0;
|
|
23176
|
-
} else if (r === max) {
|
|
23177
|
-
h = (g - b) / delta;
|
|
23178
|
-
} else if (g === max) {
|
|
23179
|
-
h = 2 + (b - r) / delta;
|
|
23180
|
-
} else if (b === max) {
|
|
23181
|
-
h = 4 + (r - g) / delta;
|
|
23182
|
-
}
|
|
23183
|
-
h = Math.min(h * 60, 360);
|
|
23184
|
-
if (h < 0) {
|
|
23185
|
-
h += 360;
|
|
23186
|
-
}
|
|
23187
|
-
const l = (min + max) / 2;
|
|
23188
|
-
if (max === min) {
|
|
23189
|
-
s = 0;
|
|
23190
|
-
} else if (l <= 0.5) {
|
|
23191
|
-
s = delta / (max + min);
|
|
23192
|
-
} else {
|
|
23193
|
-
s = delta / (2 - max - min);
|
|
23194
|
-
}
|
|
23195
|
-
return [h, s * 100, l * 100];
|
|
23196
|
-
};
|
|
23197
|
-
convert.rgb.hsv = function(rgb) {
|
|
23198
|
-
let rdif;
|
|
23199
|
-
let gdif;
|
|
23200
|
-
let bdif;
|
|
23201
|
-
let h;
|
|
23202
|
-
let s;
|
|
23203
|
-
const r = rgb[0] / 255;
|
|
23204
|
-
const g = rgb[1] / 255;
|
|
23205
|
-
const b = rgb[2] / 255;
|
|
23206
|
-
const v = Math.max(r, g, b);
|
|
23207
|
-
const diff = v - Math.min(r, g, b);
|
|
23208
|
-
const diffc = function(c) {
|
|
23209
|
-
return (v - c) / 6 / diff + 1 / 2;
|
|
23210
|
-
};
|
|
23211
|
-
if (diff === 0) {
|
|
23212
|
-
h = 0;
|
|
23213
|
-
s = 0;
|
|
23214
|
-
} else {
|
|
23215
|
-
s = diff / v;
|
|
23216
|
-
rdif = diffc(r);
|
|
23217
|
-
gdif = diffc(g);
|
|
23218
|
-
bdif = diffc(b);
|
|
23219
|
-
if (r === v) {
|
|
23220
|
-
h = bdif - gdif;
|
|
23221
|
-
} else if (g === v) {
|
|
23222
|
-
h = 1 / 3 + rdif - bdif;
|
|
23223
|
-
} else if (b === v) {
|
|
23224
|
-
h = 2 / 3 + gdif - rdif;
|
|
23225
|
-
}
|
|
23226
|
-
if (h < 0) {
|
|
23227
|
-
h += 1;
|
|
23228
|
-
} else if (h > 1) {
|
|
23229
|
-
h -= 1;
|
|
23230
|
-
}
|
|
23231
|
-
}
|
|
23232
|
-
return [
|
|
23233
|
-
h * 360,
|
|
23234
|
-
s * 100,
|
|
23235
|
-
v * 100
|
|
23236
|
-
];
|
|
23237
|
-
};
|
|
23238
|
-
convert.rgb.hwb = function(rgb) {
|
|
23239
|
-
const r = rgb[0];
|
|
23240
|
-
const g = rgb[1];
|
|
23241
|
-
let b = rgb[2];
|
|
23242
|
-
const h = convert.rgb.hsl(rgb)[0];
|
|
23243
|
-
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
23244
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
23245
|
-
return [h, w * 100, b * 100];
|
|
23246
|
-
};
|
|
23247
|
-
convert.rgb.cmyk = function(rgb) {
|
|
23248
|
-
const r = rgb[0] / 255;
|
|
23249
|
-
const g = rgb[1] / 255;
|
|
23250
|
-
const b = rgb[2] / 255;
|
|
23251
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
23252
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
|
23253
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
|
23254
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
|
23255
|
-
return [c * 100, m * 100, y * 100, k * 100];
|
|
23256
|
-
};
|
|
23257
|
-
function comparativeDistance(x, y) {
|
|
23258
|
-
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
23259
|
-
}
|
|
23260
|
-
convert.rgb.keyword = function(rgb) {
|
|
23261
|
-
const reversed = reverseKeywords[rgb];
|
|
23262
|
-
if (reversed) {
|
|
23263
|
-
return reversed;
|
|
23264
|
-
}
|
|
23265
|
-
let currentClosestDistance = Infinity;
|
|
23266
|
-
let currentClosestKeyword;
|
|
23267
|
-
for (const keyword of Object.keys(cssKeywords)) {
|
|
23268
|
-
const value = cssKeywords[keyword];
|
|
23269
|
-
const distance = comparativeDistance(rgb, value);
|
|
23270
|
-
if (distance < currentClosestDistance) {
|
|
23271
|
-
currentClosestDistance = distance;
|
|
23272
|
-
currentClosestKeyword = keyword;
|
|
23273
|
-
}
|
|
23274
|
-
}
|
|
23275
|
-
return currentClosestKeyword;
|
|
23276
|
-
};
|
|
23277
|
-
convert.keyword.rgb = function(keyword) {
|
|
23278
|
-
return cssKeywords[keyword];
|
|
23279
|
-
};
|
|
23280
|
-
convert.rgb.xyz = function(rgb) {
|
|
23281
|
-
let r = rgb[0] / 255;
|
|
23282
|
-
let g = rgb[1] / 255;
|
|
23283
|
-
let b = rgb[2] / 255;
|
|
23284
|
-
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
|
23285
|
-
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
|
23286
|
-
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
23287
|
-
const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
23288
|
-
const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
23289
|
-
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
23290
|
-
return [x * 100, y * 100, z * 100];
|
|
23291
|
-
};
|
|
23292
|
-
convert.rgb.lab = function(rgb) {
|
|
23293
|
-
const xyz = convert.rgb.xyz(rgb);
|
|
23294
|
-
let x = xyz[0];
|
|
23295
|
-
let y = xyz[1];
|
|
23296
|
-
let z = xyz[2];
|
|
23297
|
-
x /= 95.047;
|
|
23298
|
-
y /= 100;
|
|
23299
|
-
z /= 108.883;
|
|
23300
|
-
x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
23301
|
-
y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
23302
|
-
z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
23303
|
-
const l = 116 * y - 16;
|
|
23304
|
-
const a = 500 * (x - y);
|
|
23305
|
-
const b = 200 * (y - z);
|
|
23306
|
-
return [l, a, b];
|
|
23307
|
-
};
|
|
23308
|
-
convert.hsl.rgb = function(hsl) {
|
|
23309
|
-
const h = hsl[0] / 360;
|
|
23310
|
-
const s = hsl[1] / 100;
|
|
23311
|
-
const l = hsl[2] / 100;
|
|
23312
|
-
let t2;
|
|
23313
|
-
let t3;
|
|
23314
|
-
let val;
|
|
23315
|
-
if (s === 0) {
|
|
23316
|
-
val = l * 255;
|
|
23317
|
-
return [val, val, val];
|
|
23318
|
-
}
|
|
23319
|
-
if (l < 0.5) {
|
|
23320
|
-
t2 = l * (1 + s);
|
|
23321
|
-
} else {
|
|
23322
|
-
t2 = l + s - l * s;
|
|
23323
|
-
}
|
|
23324
|
-
const t1 = 2 * l - t2;
|
|
23325
|
-
const rgb = [0, 0, 0];
|
|
23326
|
-
for (let i = 0;i < 3; i++) {
|
|
23327
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
23328
|
-
if (t3 < 0) {
|
|
23329
|
-
t3++;
|
|
23330
|
-
}
|
|
23331
|
-
if (t3 > 1) {
|
|
23332
|
-
t3--;
|
|
23333
|
-
}
|
|
23334
|
-
if (6 * t3 < 1) {
|
|
23335
|
-
val = t1 + (t2 - t1) * 6 * t3;
|
|
23336
|
-
} else if (2 * t3 < 1) {
|
|
23337
|
-
val = t2;
|
|
23338
|
-
} else if (3 * t3 < 2) {
|
|
23339
|
-
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
23340
|
-
} else {
|
|
23341
|
-
val = t1;
|
|
23342
|
-
}
|
|
23343
|
-
rgb[i] = val * 255;
|
|
23344
|
-
}
|
|
23345
|
-
return rgb;
|
|
23346
|
-
};
|
|
23347
|
-
convert.hsl.hsv = function(hsl) {
|
|
23348
|
-
const h = hsl[0];
|
|
23349
|
-
let s = hsl[1] / 100;
|
|
23350
|
-
let l = hsl[2] / 100;
|
|
23351
|
-
let smin = s;
|
|
23352
|
-
const lmin = Math.max(l, 0.01);
|
|
23353
|
-
l *= 2;
|
|
23354
|
-
s *= l <= 1 ? l : 2 - l;
|
|
23355
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
23356
|
-
const v = (l + s) / 2;
|
|
23357
|
-
const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
23358
|
-
return [h, sv * 100, v * 100];
|
|
23359
|
-
};
|
|
23360
|
-
convert.hsv.rgb = function(hsv) {
|
|
23361
|
-
const h = hsv[0] / 60;
|
|
23362
|
-
const s = hsv[1] / 100;
|
|
23363
|
-
let v = hsv[2] / 100;
|
|
23364
|
-
const hi = Math.floor(h) % 6;
|
|
23365
|
-
const f = h - Math.floor(h);
|
|
23366
|
-
const p = 255 * v * (1 - s);
|
|
23367
|
-
const q = 255 * v * (1 - s * f);
|
|
23368
|
-
const t = 255 * v * (1 - s * (1 - f));
|
|
23369
|
-
v *= 255;
|
|
23370
|
-
switch (hi) {
|
|
23371
|
-
case 0:
|
|
23372
|
-
return [v, t, p];
|
|
23373
|
-
case 1:
|
|
23374
|
-
return [q, v, p];
|
|
23375
|
-
case 2:
|
|
23376
|
-
return [p, v, t];
|
|
23377
|
-
case 3:
|
|
23378
|
-
return [p, q, v];
|
|
23379
|
-
case 4:
|
|
23380
|
-
return [t, p, v];
|
|
23381
|
-
case 5:
|
|
23382
|
-
return [v, p, q];
|
|
23383
|
-
}
|
|
23384
|
-
};
|
|
23385
|
-
convert.hsv.hsl = function(hsv) {
|
|
23386
|
-
const h = hsv[0];
|
|
23387
|
-
const s = hsv[1] / 100;
|
|
23388
|
-
const v = hsv[2] / 100;
|
|
23389
|
-
const vmin = Math.max(v, 0.01);
|
|
23390
|
-
let sl;
|
|
23391
|
-
let l;
|
|
23392
|
-
l = (2 - s) * v;
|
|
23393
|
-
const lmin = (2 - s) * vmin;
|
|
23394
|
-
sl = s * vmin;
|
|
23395
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
23396
|
-
sl = sl || 0;
|
|
23397
|
-
l /= 2;
|
|
23398
|
-
return [h, sl * 100, l * 100];
|
|
23399
|
-
};
|
|
23400
|
-
convert.hwb.rgb = function(hwb) {
|
|
23401
|
-
const h = hwb[0] / 360;
|
|
23402
|
-
let wh = hwb[1] / 100;
|
|
23403
|
-
let bl = hwb[2] / 100;
|
|
23404
|
-
const ratio = wh + bl;
|
|
23405
|
-
let f;
|
|
23406
|
-
if (ratio > 1) {
|
|
23407
|
-
wh /= ratio;
|
|
23408
|
-
bl /= ratio;
|
|
23409
|
-
}
|
|
23410
|
-
const i = Math.floor(6 * h);
|
|
23411
|
-
const v = 1 - bl;
|
|
23412
|
-
f = 6 * h - i;
|
|
23413
|
-
if ((i & 1) !== 0) {
|
|
23414
|
-
f = 1 - f;
|
|
23415
|
-
}
|
|
23416
|
-
const n = wh + f * (v - wh);
|
|
23417
|
-
let r;
|
|
23418
|
-
let g;
|
|
23419
|
-
let b;
|
|
23420
|
-
switch (i) {
|
|
23421
|
-
default:
|
|
23422
|
-
case 6:
|
|
23423
|
-
case 0:
|
|
23424
|
-
r = v;
|
|
23425
|
-
g = n;
|
|
23426
|
-
b = wh;
|
|
23427
|
-
break;
|
|
23428
|
-
case 1:
|
|
23429
|
-
r = n;
|
|
23430
|
-
g = v;
|
|
23431
|
-
b = wh;
|
|
23432
|
-
break;
|
|
23433
|
-
case 2:
|
|
23434
|
-
r = wh;
|
|
23435
|
-
g = v;
|
|
23436
|
-
b = n;
|
|
23437
|
-
break;
|
|
23438
|
-
case 3:
|
|
23439
|
-
r = wh;
|
|
23440
|
-
g = n;
|
|
23441
|
-
b = v;
|
|
23442
|
-
break;
|
|
23443
|
-
case 4:
|
|
23444
|
-
r = n;
|
|
23445
|
-
g = wh;
|
|
23446
|
-
b = v;
|
|
23447
|
-
break;
|
|
23448
|
-
case 5:
|
|
23449
|
-
r = v;
|
|
23450
|
-
g = wh;
|
|
23451
|
-
b = n;
|
|
23452
|
-
break;
|
|
23453
|
-
}
|
|
23454
|
-
return [r * 255, g * 255, b * 255];
|
|
23455
|
-
};
|
|
23456
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
23457
|
-
const c = cmyk[0] / 100;
|
|
23458
|
-
const m = cmyk[1] / 100;
|
|
23459
|
-
const y = cmyk[2] / 100;
|
|
23460
|
-
const k = cmyk[3] / 100;
|
|
23461
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
23462
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
23463
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
23464
|
-
return [r * 255, g * 255, b * 255];
|
|
23465
|
-
};
|
|
23466
|
-
convert.xyz.rgb = function(xyz) {
|
|
23467
|
-
const x = xyz[0] / 100;
|
|
23468
|
-
const y = xyz[1] / 100;
|
|
23469
|
-
const z = xyz[2] / 100;
|
|
23470
|
-
let r;
|
|
23471
|
-
let g;
|
|
23472
|
-
let b;
|
|
23473
|
-
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
23474
|
-
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
23475
|
-
b = x * 0.0557 + y * -0.204 + z * 1.057;
|
|
23476
|
-
r = r > 0.0031308 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
|
|
23477
|
-
g = g > 0.0031308 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
|
23478
|
-
b = b > 0.0031308 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
|
|
23479
|
-
r = Math.min(Math.max(0, r), 1);
|
|
23480
|
-
g = Math.min(Math.max(0, g), 1);
|
|
23481
|
-
b = Math.min(Math.max(0, b), 1);
|
|
23482
|
-
return [r * 255, g * 255, b * 255];
|
|
23483
|
-
};
|
|
23484
|
-
convert.xyz.lab = function(xyz) {
|
|
23485
|
-
let x = xyz[0];
|
|
23486
|
-
let y = xyz[1];
|
|
23487
|
-
let z = xyz[2];
|
|
23488
|
-
x /= 95.047;
|
|
23489
|
-
y /= 100;
|
|
23490
|
-
z /= 108.883;
|
|
23491
|
-
x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
23492
|
-
y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
23493
|
-
z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
23494
|
-
const l = 116 * y - 16;
|
|
23495
|
-
const a = 500 * (x - y);
|
|
23496
|
-
const b = 200 * (y - z);
|
|
23497
|
-
return [l, a, b];
|
|
23498
|
-
};
|
|
23499
|
-
convert.lab.xyz = function(lab) {
|
|
23500
|
-
const l = lab[0];
|
|
23501
|
-
const a = lab[1];
|
|
23502
|
-
const b = lab[2];
|
|
23503
|
-
let x;
|
|
23504
|
-
let y;
|
|
23505
|
-
let z;
|
|
23506
|
-
y = (l + 16) / 116;
|
|
23507
|
-
x = a / 500 + y;
|
|
23508
|
-
z = y - b / 200;
|
|
23509
|
-
const y2 = y ** 3;
|
|
23510
|
-
const x2 = x ** 3;
|
|
23511
|
-
const z2 = z ** 3;
|
|
23512
|
-
y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
|
|
23513
|
-
x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
|
|
23514
|
-
z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
|
|
23515
|
-
x *= 95.047;
|
|
23516
|
-
y *= 100;
|
|
23517
|
-
z *= 108.883;
|
|
23518
|
-
return [x, y, z];
|
|
23519
|
-
};
|
|
23520
|
-
convert.lab.lch = function(lab) {
|
|
23521
|
-
const l = lab[0];
|
|
23522
|
-
const a = lab[1];
|
|
23523
|
-
const b = lab[2];
|
|
23524
|
-
let h;
|
|
23525
|
-
const hr = Math.atan2(b, a);
|
|
23526
|
-
h = hr * 360 / 2 / Math.PI;
|
|
23527
|
-
if (h < 0) {
|
|
23528
|
-
h += 360;
|
|
23529
|
-
}
|
|
23530
|
-
const c = Math.sqrt(a * a + b * b);
|
|
23531
|
-
return [l, c, h];
|
|
23532
|
-
};
|
|
23533
|
-
convert.lch.lab = function(lch) {
|
|
23534
|
-
const l = lch[0];
|
|
23535
|
-
const c = lch[1];
|
|
23536
|
-
const h = lch[2];
|
|
23537
|
-
const hr = h / 360 * 2 * Math.PI;
|
|
23538
|
-
const a = c * Math.cos(hr);
|
|
23539
|
-
const b = c * Math.sin(hr);
|
|
23540
|
-
return [l, a, b];
|
|
23541
|
-
};
|
|
23542
|
-
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
23543
|
-
const [r, g, b] = args;
|
|
23544
|
-
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
23545
|
-
value = Math.round(value / 50);
|
|
23546
|
-
if (value === 0) {
|
|
23547
|
-
return 30;
|
|
23548
|
-
}
|
|
23549
|
-
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
23550
|
-
if (value === 2) {
|
|
23551
|
-
ansi += 60;
|
|
23552
|
-
}
|
|
23553
|
-
return ansi;
|
|
23554
|
-
};
|
|
23555
|
-
convert.hsv.ansi16 = function(args) {
|
|
23556
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
23557
|
-
};
|
|
23558
|
-
convert.rgb.ansi256 = function(args) {
|
|
23559
|
-
const r = args[0];
|
|
23560
|
-
const g = args[1];
|
|
23561
|
-
const b = args[2];
|
|
23562
|
-
if (r === g && g === b) {
|
|
23563
|
-
if (r < 8) {
|
|
23564
|
-
return 16;
|
|
23565
|
-
}
|
|
23566
|
-
if (r > 248) {
|
|
23567
|
-
return 231;
|
|
23568
|
-
}
|
|
23569
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
23570
|
-
}
|
|
23571
|
-
const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
23572
|
-
return ansi;
|
|
23573
|
-
};
|
|
23574
|
-
convert.ansi16.rgb = function(args) {
|
|
23575
|
-
let color = args % 10;
|
|
23576
|
-
if (color === 0 || color === 7) {
|
|
23577
|
-
if (args > 50) {
|
|
23578
|
-
color += 3.5;
|
|
23579
|
-
}
|
|
23580
|
-
color = color / 10.5 * 255;
|
|
23581
|
-
return [color, color, color];
|
|
23582
|
-
}
|
|
23583
|
-
const mult = (~~(args > 50) + 1) * 0.5;
|
|
23584
|
-
const r = (color & 1) * mult * 255;
|
|
23585
|
-
const g = (color >> 1 & 1) * mult * 255;
|
|
23586
|
-
const b = (color >> 2 & 1) * mult * 255;
|
|
23587
|
-
return [r, g, b];
|
|
23588
|
-
};
|
|
23589
|
-
convert.ansi256.rgb = function(args) {
|
|
23590
|
-
if (args >= 232) {
|
|
23591
|
-
const c = (args - 232) * 10 + 8;
|
|
23592
|
-
return [c, c, c];
|
|
23593
|
-
}
|
|
23594
|
-
args -= 16;
|
|
23595
|
-
let rem;
|
|
23596
|
-
const r = Math.floor(args / 36) / 5 * 255;
|
|
23597
|
-
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
23598
|
-
const b = rem % 6 / 5 * 255;
|
|
23599
|
-
return [r, g, b];
|
|
23600
|
-
};
|
|
23601
|
-
convert.rgb.hex = function(args) {
|
|
23602
|
-
const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
23603
|
-
const string2 = integer.toString(16).toUpperCase();
|
|
23604
|
-
return "000000".substring(string2.length) + string2;
|
|
23605
|
-
};
|
|
23606
|
-
convert.hex.rgb = function(args) {
|
|
23607
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
23608
|
-
if (!match) {
|
|
23609
|
-
return [0, 0, 0];
|
|
23610
|
-
}
|
|
23611
|
-
let colorString = match[0];
|
|
23612
|
-
if (match[0].length === 3) {
|
|
23613
|
-
colorString = colorString.split("").map((char) => {
|
|
23614
|
-
return char + char;
|
|
23615
|
-
}).join("");
|
|
23616
|
-
}
|
|
23617
|
-
const integer = parseInt(colorString, 16);
|
|
23618
|
-
const r = integer >> 16 & 255;
|
|
23619
|
-
const g = integer >> 8 & 255;
|
|
23620
|
-
const b = integer & 255;
|
|
23621
|
-
return [r, g, b];
|
|
23622
|
-
};
|
|
23623
|
-
convert.rgb.hcg = function(rgb) {
|
|
23624
|
-
const r = rgb[0] / 255;
|
|
23625
|
-
const g = rgb[1] / 255;
|
|
23626
|
-
const b = rgb[2] / 255;
|
|
23627
|
-
const max = Math.max(Math.max(r, g), b);
|
|
23628
|
-
const min = Math.min(Math.min(r, g), b);
|
|
23629
|
-
const chroma = max - min;
|
|
23630
|
-
let grayscale;
|
|
23631
|
-
let hue;
|
|
23632
|
-
if (chroma < 1) {
|
|
23633
|
-
grayscale = min / (1 - chroma);
|
|
23634
|
-
} else {
|
|
23635
|
-
grayscale = 0;
|
|
23636
|
-
}
|
|
23637
|
-
if (chroma <= 0) {
|
|
23638
|
-
hue = 0;
|
|
23639
|
-
} else if (max === r) {
|
|
23640
|
-
hue = (g - b) / chroma % 6;
|
|
23641
|
-
} else if (max === g) {
|
|
23642
|
-
hue = 2 + (b - r) / chroma;
|
|
23643
|
-
} else {
|
|
23644
|
-
hue = 4 + (r - g) / chroma;
|
|
23645
|
-
}
|
|
23646
|
-
hue /= 6;
|
|
23647
|
-
hue %= 1;
|
|
23648
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
|
23649
|
-
};
|
|
23650
|
-
convert.hsl.hcg = function(hsl) {
|
|
23651
|
-
const s = hsl[1] / 100;
|
|
23652
|
-
const l = hsl[2] / 100;
|
|
23653
|
-
const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
|
23654
|
-
let f = 0;
|
|
23655
|
-
if (c < 1) {
|
|
23656
|
-
f = (l - 0.5 * c) / (1 - c);
|
|
23657
|
-
}
|
|
23658
|
-
return [hsl[0], c * 100, f * 100];
|
|
23659
|
-
};
|
|
23660
|
-
convert.hsv.hcg = function(hsv) {
|
|
23661
|
-
const s = hsv[1] / 100;
|
|
23662
|
-
const v = hsv[2] / 100;
|
|
23663
|
-
const c = s * v;
|
|
23664
|
-
let f = 0;
|
|
23665
|
-
if (c < 1) {
|
|
23666
|
-
f = (v - c) / (1 - c);
|
|
23667
|
-
}
|
|
23668
|
-
return [hsv[0], c * 100, f * 100];
|
|
23669
|
-
};
|
|
23670
|
-
convert.hcg.rgb = function(hcg) {
|
|
23671
|
-
const h = hcg[0] / 360;
|
|
23672
|
-
const c = hcg[1] / 100;
|
|
23673
|
-
const g = hcg[2] / 100;
|
|
23674
|
-
if (c === 0) {
|
|
23675
|
-
return [g * 255, g * 255, g * 255];
|
|
23676
|
-
}
|
|
23677
|
-
const pure = [0, 0, 0];
|
|
23678
|
-
const hi = h % 1 * 6;
|
|
23679
|
-
const v = hi % 1;
|
|
23680
|
-
const w = 1 - v;
|
|
23681
|
-
let mg = 0;
|
|
23682
|
-
switch (Math.floor(hi)) {
|
|
23683
|
-
case 0:
|
|
23684
|
-
pure[0] = 1;
|
|
23685
|
-
pure[1] = v;
|
|
23686
|
-
pure[2] = 0;
|
|
23687
|
-
break;
|
|
23688
|
-
case 1:
|
|
23689
|
-
pure[0] = w;
|
|
23690
|
-
pure[1] = 1;
|
|
23691
|
-
pure[2] = 0;
|
|
23692
|
-
break;
|
|
23693
|
-
case 2:
|
|
23694
|
-
pure[0] = 0;
|
|
23695
|
-
pure[1] = 1;
|
|
23696
|
-
pure[2] = v;
|
|
23697
|
-
break;
|
|
23698
|
-
case 3:
|
|
23699
|
-
pure[0] = 0;
|
|
23700
|
-
pure[1] = w;
|
|
23701
|
-
pure[2] = 1;
|
|
23702
|
-
break;
|
|
23703
|
-
case 4:
|
|
23704
|
-
pure[0] = v;
|
|
23705
|
-
pure[1] = 0;
|
|
23706
|
-
pure[2] = 1;
|
|
23707
|
-
break;
|
|
23708
|
-
default:
|
|
23709
|
-
pure[0] = 1;
|
|
23710
|
-
pure[1] = 0;
|
|
23711
|
-
pure[2] = w;
|
|
23712
|
-
}
|
|
23713
|
-
mg = (1 - c) * g;
|
|
23714
|
-
return [
|
|
23715
|
-
(c * pure[0] + mg) * 255,
|
|
23716
|
-
(c * pure[1] + mg) * 255,
|
|
23717
|
-
(c * pure[2] + mg) * 255
|
|
23718
|
-
];
|
|
23719
|
-
};
|
|
23720
|
-
convert.hcg.hsv = function(hcg) {
|
|
23721
|
-
const c = hcg[1] / 100;
|
|
23722
|
-
const g = hcg[2] / 100;
|
|
23723
|
-
const v = c + g * (1 - c);
|
|
23724
|
-
let f = 0;
|
|
23725
|
-
if (v > 0) {
|
|
23726
|
-
f = c / v;
|
|
23727
|
-
}
|
|
23728
|
-
return [hcg[0], f * 100, v * 100];
|
|
23729
|
-
};
|
|
23730
|
-
convert.hcg.hsl = function(hcg) {
|
|
23731
|
-
const c = hcg[1] / 100;
|
|
23732
|
-
const g = hcg[2] / 100;
|
|
23733
|
-
const l = g * (1 - c) + 0.5 * c;
|
|
23734
|
-
let s = 0;
|
|
23735
|
-
if (l > 0 && l < 0.5) {
|
|
23736
|
-
s = c / (2 * l);
|
|
23737
|
-
} else if (l >= 0.5 && l < 1) {
|
|
23738
|
-
s = c / (2 * (1 - l));
|
|
23739
|
-
}
|
|
23740
|
-
return [hcg[0], s * 100, l * 100];
|
|
23741
|
-
};
|
|
23742
|
-
convert.hcg.hwb = function(hcg) {
|
|
23743
|
-
const c = hcg[1] / 100;
|
|
23744
|
-
const g = hcg[2] / 100;
|
|
23745
|
-
const v = c + g * (1 - c);
|
|
23746
|
-
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
23747
|
-
};
|
|
23748
|
-
convert.hwb.hcg = function(hwb) {
|
|
23749
|
-
const w = hwb[1] / 100;
|
|
23750
|
-
const b = hwb[2] / 100;
|
|
23751
|
-
const v = 1 - b;
|
|
23752
|
-
const c = v - w;
|
|
23753
|
-
let g = 0;
|
|
23754
|
-
if (c < 1) {
|
|
23755
|
-
g = (v - c) / (1 - c);
|
|
23756
|
-
}
|
|
23757
|
-
return [hwb[0], c * 100, g * 100];
|
|
23758
|
-
};
|
|
23759
|
-
convert.apple.rgb = function(apple) {
|
|
23760
|
-
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
23761
|
-
};
|
|
23762
|
-
convert.rgb.apple = function(rgb) {
|
|
23763
|
-
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
23764
|
-
};
|
|
23765
|
-
convert.gray.rgb = function(args) {
|
|
23766
|
-
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
23767
|
-
};
|
|
23768
|
-
convert.gray.hsl = function(args) {
|
|
23769
|
-
return [0, 0, args[0]];
|
|
23770
|
-
};
|
|
23771
|
-
convert.gray.hsv = convert.gray.hsl;
|
|
23772
|
-
convert.gray.hwb = function(gray) {
|
|
23773
|
-
return [0, 100, gray[0]];
|
|
23774
|
-
};
|
|
23775
|
-
convert.gray.cmyk = function(gray) {
|
|
23776
|
-
return [0, 0, 0, gray[0]];
|
|
23777
|
-
};
|
|
23778
|
-
convert.gray.lab = function(gray) {
|
|
23779
|
-
return [gray[0], 0, 0];
|
|
23780
|
-
};
|
|
23781
|
-
convert.gray.hex = function(gray) {
|
|
23782
|
-
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
23783
|
-
const integer = (val << 16) + (val << 8) + val;
|
|
23784
|
-
const string2 = integer.toString(16).toUpperCase();
|
|
23785
|
-
return "000000".substring(string2.length) + string2;
|
|
23786
|
-
};
|
|
23787
|
-
convert.rgb.gray = function(rgb) {
|
|
23788
|
-
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
23789
|
-
return [val / 255 * 100];
|
|
23790
|
-
};
|
|
23791
|
-
});
|
|
23792
|
-
|
|
23793
|
-
// ../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js
|
|
23794
|
-
var require_route = __commonJS((exports, module) => {
|
|
23795
|
-
var conversions = require_conversions();
|
|
23796
|
-
function buildGraph() {
|
|
23797
|
-
const graph = {};
|
|
23798
|
-
const models = Object.keys(conversions);
|
|
23799
|
-
for (let len = models.length, i = 0;i < len; i++) {
|
|
23800
|
-
graph[models[i]] = {
|
|
23801
|
-
distance: -1,
|
|
23802
|
-
parent: null
|
|
23803
|
-
};
|
|
23804
|
-
}
|
|
23805
|
-
return graph;
|
|
23806
|
-
}
|
|
23807
|
-
function deriveBFS(fromModel) {
|
|
23808
|
-
const graph = buildGraph();
|
|
23809
|
-
const queue2 = [fromModel];
|
|
23810
|
-
graph[fromModel].distance = 0;
|
|
23811
|
-
while (queue2.length) {
|
|
23812
|
-
const current = queue2.pop();
|
|
23813
|
-
const adjacents = Object.keys(conversions[current]);
|
|
23814
|
-
for (let len = adjacents.length, i = 0;i < len; i++) {
|
|
23815
|
-
const adjacent = adjacents[i];
|
|
23816
|
-
const node = graph[adjacent];
|
|
23817
|
-
if (node.distance === -1) {
|
|
23818
|
-
node.distance = graph[current].distance + 1;
|
|
23819
|
-
node.parent = current;
|
|
23820
|
-
queue2.unshift(adjacent);
|
|
23821
|
-
}
|
|
23822
|
-
}
|
|
23823
|
-
}
|
|
23824
|
-
return graph;
|
|
23825
|
-
}
|
|
23826
|
-
function link(from, to) {
|
|
23827
|
-
return function(args) {
|
|
23828
|
-
return to(from(args));
|
|
23829
|
-
};
|
|
23830
|
-
}
|
|
23831
|
-
function wrapConversion(toModel, graph) {
|
|
23832
|
-
const path8 = [graph[toModel].parent, toModel];
|
|
23833
|
-
let fn = conversions[graph[toModel].parent][toModel];
|
|
23834
|
-
let cur = graph[toModel].parent;
|
|
23835
|
-
while (graph[cur].parent) {
|
|
23836
|
-
path8.unshift(graph[cur].parent);
|
|
23837
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
23838
|
-
cur = graph[cur].parent;
|
|
23839
|
-
}
|
|
23840
|
-
fn.conversion = path8;
|
|
23841
|
-
return fn;
|
|
23842
|
-
}
|
|
23843
|
-
module.exports = function(fromModel) {
|
|
23844
|
-
const graph = deriveBFS(fromModel);
|
|
23845
|
-
const conversion = {};
|
|
23846
|
-
const models = Object.keys(graph);
|
|
23847
|
-
for (let len = models.length, i = 0;i < len; i++) {
|
|
23848
|
-
const toModel = models[i];
|
|
23849
|
-
const node = graph[toModel];
|
|
23850
|
-
if (node.parent === null) {
|
|
23851
|
-
continue;
|
|
23852
|
-
}
|
|
23853
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
|
23854
|
-
}
|
|
23855
|
-
return conversion;
|
|
23856
|
-
};
|
|
23857
|
-
});
|
|
23858
|
-
|
|
23859
|
-
// ../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js
|
|
23860
|
-
var require_color_convert = __commonJS((exports, module) => {
|
|
23861
|
-
var conversions = require_conversions();
|
|
23862
|
-
var route = require_route();
|
|
23863
|
-
var convert = {};
|
|
23864
|
-
var models = Object.keys(conversions);
|
|
23865
|
-
function wrapRaw(fn) {
|
|
23866
|
-
const wrappedFn = function(...args) {
|
|
23867
|
-
const arg0 = args[0];
|
|
23868
|
-
if (arg0 === undefined || arg0 === null) {
|
|
23869
|
-
return arg0;
|
|
23870
|
-
}
|
|
23871
|
-
if (arg0.length > 1) {
|
|
23872
|
-
args = arg0;
|
|
23873
|
-
}
|
|
23874
|
-
return fn(args);
|
|
23875
|
-
};
|
|
23876
|
-
if ("conversion" in fn) {
|
|
23877
|
-
wrappedFn.conversion = fn.conversion;
|
|
23878
|
-
}
|
|
23879
|
-
return wrappedFn;
|
|
23880
|
-
}
|
|
23881
|
-
function wrapRounded(fn) {
|
|
23882
|
-
const wrappedFn = function(...args) {
|
|
23883
|
-
const arg0 = args[0];
|
|
23884
|
-
if (arg0 === undefined || arg0 === null) {
|
|
23885
|
-
return arg0;
|
|
23886
|
-
}
|
|
23887
|
-
if (arg0.length > 1) {
|
|
23888
|
-
args = arg0;
|
|
23889
|
-
}
|
|
23890
|
-
const result = fn(args);
|
|
23891
|
-
if (typeof result === "object") {
|
|
23892
|
-
for (let len = result.length, i = 0;i < len; i++) {
|
|
23893
|
-
result[i] = Math.round(result[i]);
|
|
23894
|
-
}
|
|
23895
|
-
}
|
|
23896
|
-
return result;
|
|
23897
|
-
};
|
|
23898
|
-
if ("conversion" in fn) {
|
|
23899
|
-
wrappedFn.conversion = fn.conversion;
|
|
23900
|
-
}
|
|
23901
|
-
return wrappedFn;
|
|
23902
|
-
}
|
|
23903
|
-
models.forEach((fromModel) => {
|
|
23904
|
-
convert[fromModel] = {};
|
|
23905
|
-
Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
|
23906
|
-
Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
23907
|
-
const routes = route(fromModel);
|
|
23908
|
-
const routeModels = Object.keys(routes);
|
|
23909
|
-
routeModels.forEach((toModel) => {
|
|
23910
|
-
const fn = routes[toModel];
|
|
23911
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
23912
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
23913
|
-
});
|
|
23914
|
-
});
|
|
23915
|
-
module.exports = convert;
|
|
23916
|
-
});
|
|
23917
|
-
|
|
23918
|
-
// ../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js
|
|
23919
|
-
var require_ansi_styles = __commonJS((exports, module) => {
|
|
23920
|
-
var wrapAnsi162 = (fn, offset) => (...args) => {
|
|
23921
|
-
const code = fn(...args);
|
|
23922
|
-
return `\x1B[${code + offset}m`;
|
|
23923
|
-
};
|
|
23924
|
-
var wrapAnsi2562 = (fn, offset) => (...args) => {
|
|
23925
|
-
const code = fn(...args);
|
|
23926
|
-
return `\x1B[${38 + offset};5;${code}m`;
|
|
23927
|
-
};
|
|
23928
|
-
var wrapAnsi16m2 = (fn, offset) => (...args) => {
|
|
23929
|
-
const rgb = fn(...args);
|
|
23930
|
-
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
23931
|
-
};
|
|
23932
|
-
var ansi2ansi = (n) => n;
|
|
23933
|
-
var rgb2rgb = (r, g, b) => [r, g, b];
|
|
23934
|
-
var setLazyProperty = (object, property, get) => {
|
|
23935
|
-
Object.defineProperty(object, property, {
|
|
23936
|
-
get: () => {
|
|
23937
|
-
const value = get();
|
|
23938
|
-
Object.defineProperty(object, property, {
|
|
23939
|
-
value,
|
|
23940
|
-
enumerable: true,
|
|
23941
|
-
configurable: true
|
|
23942
|
-
});
|
|
23943
|
-
return value;
|
|
23944
|
-
},
|
|
23945
|
-
enumerable: true,
|
|
23946
|
-
configurable: true
|
|
23947
|
-
});
|
|
23948
|
-
};
|
|
23949
|
-
var colorConvert;
|
|
23950
|
-
var makeDynamicStyles = (wrap, targetSpace, identity2, isBackground) => {
|
|
23951
|
-
if (colorConvert === undefined) {
|
|
23952
|
-
colorConvert = require_color_convert();
|
|
23953
|
-
}
|
|
23954
|
-
const offset = isBackground ? 10 : 0;
|
|
23955
|
-
const styles3 = {};
|
|
23956
|
-
for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
|
|
23957
|
-
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
23958
|
-
if (sourceSpace === targetSpace) {
|
|
23959
|
-
styles3[name] = wrap(identity2, offset);
|
|
23960
|
-
} else if (typeof suite === "object") {
|
|
23961
|
-
styles3[name] = wrap(suite[targetSpace], offset);
|
|
23962
|
-
}
|
|
23963
|
-
}
|
|
23964
|
-
return styles3;
|
|
23965
|
-
};
|
|
23966
|
-
function assembleStyles2() {
|
|
23967
|
-
const codes = new Map;
|
|
23968
|
-
const styles3 = {
|
|
23969
|
-
modifier: {
|
|
23970
|
-
reset: [0, 0],
|
|
23971
|
-
bold: [1, 22],
|
|
23972
|
-
dim: [2, 22],
|
|
23973
|
-
italic: [3, 23],
|
|
23974
|
-
underline: [4, 24],
|
|
23975
|
-
inverse: [7, 27],
|
|
23976
|
-
hidden: [8, 28],
|
|
23977
|
-
strikethrough: [9, 29]
|
|
23978
|
-
},
|
|
23979
|
-
color: {
|
|
23980
|
-
black: [30, 39],
|
|
23981
|
-
red: [31, 39],
|
|
23982
|
-
green: [32, 39],
|
|
23983
|
-
yellow: [33, 39],
|
|
23984
|
-
blue: [34, 39],
|
|
23985
|
-
magenta: [35, 39],
|
|
23986
|
-
cyan: [36, 39],
|
|
23987
|
-
white: [37, 39],
|
|
23988
|
-
blackBright: [90, 39],
|
|
23989
|
-
redBright: [91, 39],
|
|
23990
|
-
greenBright: [92, 39],
|
|
23991
|
-
yellowBright: [93, 39],
|
|
23992
|
-
blueBright: [94, 39],
|
|
23993
|
-
magentaBright: [95, 39],
|
|
23994
|
-
cyanBright: [96, 39],
|
|
23995
|
-
whiteBright: [97, 39]
|
|
23996
|
-
},
|
|
23997
|
-
bgColor: {
|
|
23998
|
-
bgBlack: [40, 49],
|
|
23999
|
-
bgRed: [41, 49],
|
|
24000
|
-
bgGreen: [42, 49],
|
|
24001
|
-
bgYellow: [43, 49],
|
|
24002
|
-
bgBlue: [44, 49],
|
|
24003
|
-
bgMagenta: [45, 49],
|
|
24004
|
-
bgCyan: [46, 49],
|
|
24005
|
-
bgWhite: [47, 49],
|
|
24006
|
-
bgBlackBright: [100, 49],
|
|
24007
|
-
bgRedBright: [101, 49],
|
|
24008
|
-
bgGreenBright: [102, 49],
|
|
24009
|
-
bgYellowBright: [103, 49],
|
|
24010
|
-
bgBlueBright: [104, 49],
|
|
24011
|
-
bgMagentaBright: [105, 49],
|
|
24012
|
-
bgCyanBright: [106, 49],
|
|
24013
|
-
bgWhiteBright: [107, 49]
|
|
24014
|
-
}
|
|
24015
|
-
};
|
|
24016
|
-
styles3.color.gray = styles3.color.blackBright;
|
|
24017
|
-
styles3.bgColor.bgGray = styles3.bgColor.bgBlackBright;
|
|
24018
|
-
styles3.color.grey = styles3.color.blackBright;
|
|
24019
|
-
styles3.bgColor.bgGrey = styles3.bgColor.bgBlackBright;
|
|
24020
|
-
for (const [groupName, group] of Object.entries(styles3)) {
|
|
24021
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
24022
|
-
styles3[styleName] = {
|
|
24023
|
-
open: `\x1B[${style[0]}m`,
|
|
24024
|
-
close: `\x1B[${style[1]}m`
|
|
24025
|
-
};
|
|
24026
|
-
group[styleName] = styles3[styleName];
|
|
24027
|
-
codes.set(style[0], style[1]);
|
|
24028
|
-
}
|
|
24029
|
-
Object.defineProperty(styles3, groupName, {
|
|
24030
|
-
value: group,
|
|
24031
|
-
enumerable: false
|
|
24032
|
-
});
|
|
24033
|
-
}
|
|
24034
|
-
Object.defineProperty(styles3, "codes", {
|
|
24035
|
-
value: codes,
|
|
24036
|
-
enumerable: false
|
|
24037
|
-
});
|
|
24038
|
-
styles3.color.close = "\x1B[39m";
|
|
24039
|
-
styles3.bgColor.close = "\x1B[49m";
|
|
24040
|
-
setLazyProperty(styles3.color, "ansi", () => makeDynamicStyles(wrapAnsi162, "ansi16", ansi2ansi, false));
|
|
24041
|
-
setLazyProperty(styles3.color, "ansi256", () => makeDynamicStyles(wrapAnsi2562, "ansi256", ansi2ansi, false));
|
|
24042
|
-
setLazyProperty(styles3.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m2, "rgb", rgb2rgb, false));
|
|
24043
|
-
setLazyProperty(styles3.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi162, "ansi16", ansi2ansi, true));
|
|
24044
|
-
setLazyProperty(styles3.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi2562, "ansi256", ansi2ansi, true));
|
|
24045
|
-
setLazyProperty(styles3.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m2, "rgb", rgb2rgb, true));
|
|
24046
|
-
return styles3;
|
|
24047
|
-
}
|
|
24048
|
-
Object.defineProperty(module, "exports", {
|
|
24049
|
-
enumerable: true,
|
|
24050
|
-
get: assembleStyles2
|
|
24051
|
-
});
|
|
24052
|
-
});
|
|
24053
|
-
|
|
24054
|
-
// ../node_modules/.pnpm/wrap-ansi@6.2.0/node_modules/wrap-ansi/index.js
|
|
24055
|
-
var require_wrap_ansi = __commonJS((exports, module) => {
|
|
24056
|
-
var stringWidth = require_string_width();
|
|
24057
|
-
var stripAnsi = require_strip_ansi();
|
|
24058
|
-
var ansiStyles2 = require_ansi_styles();
|
|
24059
|
-
var ESCAPES = new Set([
|
|
24060
|
-
"\x1B",
|
|
24061
|
-
""
|
|
24062
|
-
]);
|
|
24063
|
-
var END_CODE = 39;
|
|
24064
|
-
var wrapAnsi = (code) => `${ESCAPES.values().next().value}[${code}m`;
|
|
24065
|
-
var wordLengths = (string2) => string2.split(" ").map((character) => stringWidth(character));
|
|
24066
|
-
var wrapWord = (rows, word, columns) => {
|
|
24067
|
-
const characters = [...word];
|
|
24068
|
-
let isInsideEscape = false;
|
|
24069
|
-
let visible = stringWidth(stripAnsi(rows[rows.length - 1]));
|
|
24070
|
-
for (const [index, character] of characters.entries()) {
|
|
24071
|
-
const characterLength = stringWidth(character);
|
|
24072
|
-
if (visible + characterLength <= columns) {
|
|
24073
|
-
rows[rows.length - 1] += character;
|
|
24074
|
-
} else {
|
|
24075
|
-
rows.push(character);
|
|
24076
|
-
visible = 0;
|
|
24077
|
-
}
|
|
24078
|
-
if (ESCAPES.has(character)) {
|
|
24079
|
-
isInsideEscape = true;
|
|
24080
|
-
} else if (isInsideEscape && character === "m") {
|
|
24081
|
-
isInsideEscape = false;
|
|
24082
|
-
continue;
|
|
24083
|
-
}
|
|
24084
|
-
if (isInsideEscape) {
|
|
24085
|
-
continue;
|
|
24086
|
-
}
|
|
24087
|
-
visible += characterLength;
|
|
24088
|
-
if (visible === columns && index < characters.length - 1) {
|
|
24089
|
-
rows.push("");
|
|
24090
|
-
visible = 0;
|
|
24091
|
-
}
|
|
24092
|
-
}
|
|
24093
|
-
if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
|
|
24094
|
-
rows[rows.length - 2] += rows.pop();
|
|
24095
|
-
}
|
|
24096
|
-
};
|
|
24097
|
-
var stringVisibleTrimSpacesRight = (str) => {
|
|
24098
|
-
const words = str.split(" ");
|
|
24099
|
-
let last = words.length;
|
|
24100
|
-
while (last > 0) {
|
|
24101
|
-
if (stringWidth(words[last - 1]) > 0) {
|
|
24102
|
-
break;
|
|
24103
|
-
}
|
|
24104
|
-
last--;
|
|
24105
|
-
}
|
|
24106
|
-
if (last === words.length) {
|
|
24107
|
-
return str;
|
|
24108
|
-
}
|
|
24109
|
-
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
24110
|
-
};
|
|
24111
|
-
var exec = (string2, columns, options = {}) => {
|
|
24112
|
-
if (options.trim !== false && string2.trim() === "") {
|
|
24113
|
-
return "";
|
|
24114
|
-
}
|
|
24115
|
-
let pre = "";
|
|
24116
|
-
let ret = "";
|
|
24117
|
-
let escapeCode;
|
|
24118
|
-
const lengths = wordLengths(string2);
|
|
24119
|
-
let rows = [""];
|
|
24120
|
-
for (const [index, word] of string2.split(" ").entries()) {
|
|
24121
|
-
if (options.trim !== false) {
|
|
24122
|
-
rows[rows.length - 1] = rows[rows.length - 1].trimLeft();
|
|
24123
|
-
}
|
|
24124
|
-
let rowLength = stringWidth(rows[rows.length - 1]);
|
|
24125
|
-
if (index !== 0) {
|
|
24126
|
-
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
24127
|
-
rows.push("");
|
|
24128
|
-
rowLength = 0;
|
|
24129
|
-
}
|
|
24130
|
-
if (rowLength > 0 || options.trim === false) {
|
|
24131
|
-
rows[rows.length - 1] += " ";
|
|
24132
|
-
rowLength++;
|
|
24133
|
-
}
|
|
24134
|
-
}
|
|
24135
|
-
if (options.hard && lengths[index] > columns) {
|
|
24136
|
-
const remainingColumns = columns - rowLength;
|
|
24137
|
-
const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
|
|
24138
|
-
const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
|
|
24139
|
-
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
24140
|
-
rows.push("");
|
|
24141
|
-
}
|
|
24142
|
-
wrapWord(rows, word, columns);
|
|
24143
|
-
continue;
|
|
24144
|
-
}
|
|
24145
|
-
if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
|
|
24146
|
-
if (options.wordWrap === false && rowLength < columns) {
|
|
24147
|
-
wrapWord(rows, word, columns);
|
|
24148
|
-
continue;
|
|
24149
|
-
}
|
|
24150
|
-
rows.push("");
|
|
24151
|
-
}
|
|
24152
|
-
if (rowLength + lengths[index] > columns && options.wordWrap === false) {
|
|
24153
|
-
wrapWord(rows, word, columns);
|
|
24154
|
-
continue;
|
|
24155
|
-
}
|
|
24156
|
-
rows[rows.length - 1] += word;
|
|
24157
|
-
}
|
|
24158
|
-
if (options.trim !== false) {
|
|
24159
|
-
rows = rows.map(stringVisibleTrimSpacesRight);
|
|
24160
|
-
}
|
|
24161
|
-
pre = rows.join(`
|
|
24162
|
-
`);
|
|
24163
|
-
for (const [index, character] of [...pre].entries()) {
|
|
24164
|
-
ret += character;
|
|
24165
|
-
if (ESCAPES.has(character)) {
|
|
24166
|
-
const code2 = parseFloat(/\d[^m]*/.exec(pre.slice(index, index + 4)));
|
|
24167
|
-
escapeCode = code2 === END_CODE ? null : code2;
|
|
24168
|
-
}
|
|
24169
|
-
const code = ansiStyles2.codes.get(Number(escapeCode));
|
|
24170
|
-
if (escapeCode && code) {
|
|
24171
|
-
if (pre[index + 1] === `
|
|
24172
|
-
`) {
|
|
24173
|
-
ret += wrapAnsi(code);
|
|
24174
|
-
} else if (character === `
|
|
24175
|
-
`) {
|
|
24176
|
-
ret += wrapAnsi(escapeCode);
|
|
24177
|
-
}
|
|
24178
|
-
}
|
|
24179
|
-
}
|
|
24180
|
-
return ret;
|
|
24181
|
-
};
|
|
24182
|
-
module.exports = (string2, columns, options) => {
|
|
24183
|
-
return String(string2).normalize().replace(/\r\n/g, `
|
|
24184
|
-
`).split(`
|
|
24185
|
-
`).map((line) => exec(line, columns, options)).join(`
|
|
24186
|
-
`);
|
|
22825
|
+
module.exports = () => {
|
|
22826
|
+
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
24187
22827
|
};
|
|
24188
22828
|
});
|
|
24189
22829
|
|
|
@@ -43010,7 +41650,7 @@ var import_websocket_server = __toESM(require_websocket_server(), 1);
|
|
|
43010
41650
|
var wss = new import_websocket_server.default({
|
|
43011
41651
|
noServer: true
|
|
43012
41652
|
});
|
|
43013
|
-
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.
|
|
41653
|
+
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.26_supports-color@10.2.2/node_modules/@kevisual/local-app-manager/dist/manager.mjs
|
|
43014
41654
|
var exports_manager = {};
|
|
43015
41655
|
__export(exports_manager, {
|
|
43016
41656
|
onAppShowInfo: () => onAppShowInfo,
|
|
@@ -43087,7 +41727,7 @@ var getConfigFile = (opts) => {
|
|
|
43087
41727
|
return "";
|
|
43088
41728
|
};
|
|
43089
41729
|
|
|
43090
|
-
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.
|
|
41730
|
+
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.26_supports-color@10.2.2/node_modules/@kevisual/local-app-manager/dist/manager.mjs
|
|
43091
41731
|
import path$1 from "node:path";
|
|
43092
41732
|
import fs$4 from "node:fs";
|
|
43093
41733
|
import { fork } from "node:child_process";
|
|
@@ -43112,7 +41752,7 @@ var getAppsPath = () => {
|
|
|
43112
41752
|
}
|
|
43113
41753
|
return useFileStore("apps", { needExists: true });
|
|
43114
41754
|
};
|
|
43115
|
-
var loadAppInfo = async (appsPath, filename = "apps.config.json") => {
|
|
41755
|
+
var loadAppInfo = async (appsPath = "apps", filename = "apps.config.json") => {
|
|
43116
41756
|
let configFile = getConfigFile({
|
|
43117
41757
|
cwd: appsPath,
|
|
43118
41758
|
fileName: filename
|
|
@@ -49560,6 +48200,8 @@ class Pm2Manager {
|
|
|
49560
48200
|
return;
|
|
49561
48201
|
} else if (!app) {
|
|
49562
48202
|
await start(starter);
|
|
48203
|
+
} else {
|
|
48204
|
+
console.log(`pm2 app ${appName} is running`);
|
|
49563
48205
|
}
|
|
49564
48206
|
} catch (e) {
|
|
49565
48207
|
console.error("error", e);
|
|
@@ -49804,9 +48446,11 @@ class Manager {
|
|
|
49804
48446
|
async start(key) {
|
|
49805
48447
|
const app = this.apps.get(key);
|
|
49806
48448
|
if (!app) {
|
|
48449
|
+
console.error("app not found", key);
|
|
49807
48450
|
return;
|
|
49808
48451
|
}
|
|
49809
|
-
if (app.status === "running") {
|
|
48452
|
+
if (app.status === "running" && app.type === "system-app") {
|
|
48453
|
+
console.log(`app ${key} is running`);
|
|
49810
48454
|
return;
|
|
49811
48455
|
}
|
|
49812
48456
|
app.status = "running";
|
|
@@ -49818,7 +48462,8 @@ class Manager {
|
|
|
49818
48462
|
if (!app) {
|
|
49819
48463
|
return;
|
|
49820
48464
|
}
|
|
49821
|
-
if (app.status === "stop") {
|
|
48465
|
+
if (app.status === "stop" && app.type === "system-app") {
|
|
48466
|
+
console.log(`app ${key} is stopped`);
|
|
49822
48467
|
return;
|
|
49823
48468
|
}
|
|
49824
48469
|
app.status = "stop";
|
|
@@ -50005,7 +48650,7 @@ var installAppFromKey = async (key, _appPath) => {
|
|
|
50005
48650
|
};
|
|
50006
48651
|
app.key = key;
|
|
50007
48652
|
if (app.type === "pm2-system-app") {
|
|
50008
|
-
const pm2Cwd = path$1.join(
|
|
48653
|
+
const pm2Cwd = path$1.join(_appPath, "..");
|
|
50009
48654
|
showAppInfo.pm2Options = { cwd: pm2Cwd, ...app.pm2Options };
|
|
50010
48655
|
}
|
|
50011
48656
|
return { pkg, showAppInfo };
|
|
@@ -50035,7 +48680,7 @@ var clearMicroApp = (link) => {
|
|
|
50035
48680
|
console.error(`Failed to unload module ${link}:`, error2);
|
|
50036
48681
|
}
|
|
50037
48682
|
};
|
|
50038
|
-
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.
|
|
48683
|
+
// ../node_modules/.pnpm/@kevisual+local-app-manager@0.1.26_supports-color@10.2.2/node_modules/@kevisual/local-app-manager/dist/pm2.mjs
|
|
50039
48684
|
import pm22 from "pm2";
|
|
50040
48685
|
import { promisify as promisify2 } from "node:util";
|
|
50041
48686
|
var disconnect = promisify2(pm22.disconnect).bind(pm22);
|
|
@@ -50109,6 +48754,224 @@ class AssistantApp extends Manager {
|
|
|
50109
48754
|
return pagesParse;
|
|
50110
48755
|
}
|
|
50111
48756
|
}
|
|
48757
|
+
// ../node_modules/.pnpm/@kevisual+query@0.0.29_@kevisual+ws@8.0.0/node_modules/@kevisual/query/dist/query.js
|
|
48758
|
+
var isTextForContentType = (contentType) => {
|
|
48759
|
+
if (!contentType)
|
|
48760
|
+
return false;
|
|
48761
|
+
const textTypes = ["text/", "xml", "html", "javascript", "css", "csv", "plain", "x-www-form-urlencoded"];
|
|
48762
|
+
return textTypes.some((type) => contentType.includes(type));
|
|
48763
|
+
};
|
|
48764
|
+
var adapter = async (opts = {}, overloadOpts) => {
|
|
48765
|
+
const controller = new AbortController;
|
|
48766
|
+
const signal = controller.signal;
|
|
48767
|
+
const isBlob = opts.isBlob || false;
|
|
48768
|
+
const isText = opts.isText || false;
|
|
48769
|
+
const isPostFile = opts.isPostFile || false;
|
|
48770
|
+
const timeout = opts.timeout || 60000 * 3;
|
|
48771
|
+
const timer = setTimeout(() => {
|
|
48772
|
+
controller.abort();
|
|
48773
|
+
}, timeout);
|
|
48774
|
+
let method = overloadOpts?.method || opts?.method || "POST";
|
|
48775
|
+
let headers = { ...opts?.headers, ...overloadOpts?.headers };
|
|
48776
|
+
let origin = "";
|
|
48777
|
+
let url;
|
|
48778
|
+
if (opts?.url?.startsWith("http")) {
|
|
48779
|
+
url = new URL(opts.url);
|
|
48780
|
+
} else {
|
|
48781
|
+
origin = window?.location?.origin || "http://localhost:51015";
|
|
48782
|
+
url = new URL(opts.url, origin);
|
|
48783
|
+
}
|
|
48784
|
+
const isGet = method === "GET";
|
|
48785
|
+
if (isGet) {
|
|
48786
|
+
url.search = new URLSearchParams(opts.body).toString();
|
|
48787
|
+
}
|
|
48788
|
+
let body = undefined;
|
|
48789
|
+
if (isGet) {
|
|
48790
|
+
body = undefined;
|
|
48791
|
+
} else if (isPostFile) {
|
|
48792
|
+
body = opts.body;
|
|
48793
|
+
} else {
|
|
48794
|
+
headers = {
|
|
48795
|
+
"Content-Type": "application/json",
|
|
48796
|
+
...headers
|
|
48797
|
+
};
|
|
48798
|
+
body = JSON.stringify(opts.body);
|
|
48799
|
+
}
|
|
48800
|
+
return fetch(url, {
|
|
48801
|
+
method: method.toUpperCase(),
|
|
48802
|
+
signal,
|
|
48803
|
+
body,
|
|
48804
|
+
...overloadOpts,
|
|
48805
|
+
headers
|
|
48806
|
+
}).then(async (response) => {
|
|
48807
|
+
const contentType = response.headers.get("Content-Type");
|
|
48808
|
+
if (isBlob) {
|
|
48809
|
+
return await response.blob();
|
|
48810
|
+
}
|
|
48811
|
+
const isJson = contentType && contentType.includes("application/json");
|
|
48812
|
+
if (isJson && !isText) {
|
|
48813
|
+
return await response.json();
|
|
48814
|
+
} else if (isTextForContentType(contentType)) {
|
|
48815
|
+
return {
|
|
48816
|
+
code: 200,
|
|
48817
|
+
status: response.status,
|
|
48818
|
+
data: await response.text()
|
|
48819
|
+
};
|
|
48820
|
+
} else {
|
|
48821
|
+
return response;
|
|
48822
|
+
}
|
|
48823
|
+
}).catch((err) => {
|
|
48824
|
+
if (err.name === "AbortError") {
|
|
48825
|
+
console.log("Request timed out and was aborted");
|
|
48826
|
+
}
|
|
48827
|
+
console.error(err);
|
|
48828
|
+
return {
|
|
48829
|
+
code: 500
|
|
48830
|
+
};
|
|
48831
|
+
}).finally(() => {
|
|
48832
|
+
clearTimeout(timer);
|
|
48833
|
+
});
|
|
48834
|
+
};
|
|
48835
|
+
var setBaseResponse = (res) => {
|
|
48836
|
+
res.success = res.code === 200;
|
|
48837
|
+
res.showError = (fn) => {
|
|
48838
|
+
if (!res.success && !res.noMsg) {
|
|
48839
|
+
fn?.();
|
|
48840
|
+
}
|
|
48841
|
+
};
|
|
48842
|
+
return res;
|
|
48843
|
+
};
|
|
48844
|
+
var wrapperError = ({ code, message }) => {
|
|
48845
|
+
const result = {
|
|
48846
|
+
code: code || 500,
|
|
48847
|
+
success: false,
|
|
48848
|
+
message: message || "api request error",
|
|
48849
|
+
showError: (fn) => {},
|
|
48850
|
+
noMsg: true
|
|
48851
|
+
};
|
|
48852
|
+
return result;
|
|
48853
|
+
};
|
|
48854
|
+
|
|
48855
|
+
class Query {
|
|
48856
|
+
adapter;
|
|
48857
|
+
url;
|
|
48858
|
+
beforeRequest;
|
|
48859
|
+
afterResponse;
|
|
48860
|
+
headers;
|
|
48861
|
+
timeout;
|
|
48862
|
+
stop;
|
|
48863
|
+
qws;
|
|
48864
|
+
constructor(opts) {
|
|
48865
|
+
this.adapter = opts?.adapter || adapter;
|
|
48866
|
+
this.url = opts?.url || "/api/router";
|
|
48867
|
+
this.headers = opts?.headers || {
|
|
48868
|
+
"Content-Type": "application/json"
|
|
48869
|
+
};
|
|
48870
|
+
this.timeout = opts?.timeout || 60000 * 3;
|
|
48871
|
+
}
|
|
48872
|
+
setQueryWs(qws) {
|
|
48873
|
+
this.qws = qws;
|
|
48874
|
+
}
|
|
48875
|
+
setStop(stop3) {
|
|
48876
|
+
this.stop = stop3;
|
|
48877
|
+
}
|
|
48878
|
+
async get(params, options) {
|
|
48879
|
+
return this.post(params, options);
|
|
48880
|
+
}
|
|
48881
|
+
async post(body, options) {
|
|
48882
|
+
const url = options?.url || this.url;
|
|
48883
|
+
const { headers, adapter: adapter2, beforeRequest, afterResponse, timeout, ...rest } = options || {};
|
|
48884
|
+
const _headers = { ...this.headers, ...headers };
|
|
48885
|
+
const _adapter = adapter2 || this.adapter;
|
|
48886
|
+
const _beforeRequest = beforeRequest || this.beforeRequest;
|
|
48887
|
+
const _afterResponse = afterResponse || this.afterResponse;
|
|
48888
|
+
const _timeout = timeout || this.timeout;
|
|
48889
|
+
const req = {
|
|
48890
|
+
url,
|
|
48891
|
+
headers: _headers,
|
|
48892
|
+
body,
|
|
48893
|
+
timeout: _timeout,
|
|
48894
|
+
...rest
|
|
48895
|
+
};
|
|
48896
|
+
try {
|
|
48897
|
+
if (_beforeRequest) {
|
|
48898
|
+
const res = await _beforeRequest(req);
|
|
48899
|
+
if (res === false) {
|
|
48900
|
+
return wrapperError({
|
|
48901
|
+
code: 500,
|
|
48902
|
+
message: "request is cancel",
|
|
48903
|
+
req
|
|
48904
|
+
});
|
|
48905
|
+
}
|
|
48906
|
+
}
|
|
48907
|
+
} catch (e) {
|
|
48908
|
+
console.error("request beforeFn error", e, req);
|
|
48909
|
+
return wrapperError({
|
|
48910
|
+
code: 500,
|
|
48911
|
+
message: "api request beforeFn error"
|
|
48912
|
+
});
|
|
48913
|
+
}
|
|
48914
|
+
if (this.stop && !options?.noStop) {
|
|
48915
|
+
const that = this;
|
|
48916
|
+
await new Promise((resolve) => {
|
|
48917
|
+
let timer = 0;
|
|
48918
|
+
const detect = setInterval(() => {
|
|
48919
|
+
if (!that.stop) {
|
|
48920
|
+
clearInterval(detect);
|
|
48921
|
+
resolve(true);
|
|
48922
|
+
}
|
|
48923
|
+
timer++;
|
|
48924
|
+
if (timer > 30) {
|
|
48925
|
+
console.error("request stop: timeout", req.url, timer);
|
|
48926
|
+
}
|
|
48927
|
+
}, 1000);
|
|
48928
|
+
});
|
|
48929
|
+
}
|
|
48930
|
+
return _adapter(req).then(async (res) => {
|
|
48931
|
+
try {
|
|
48932
|
+
setBaseResponse(res);
|
|
48933
|
+
if (_afterResponse) {
|
|
48934
|
+
return await _afterResponse(res, {
|
|
48935
|
+
req,
|
|
48936
|
+
res,
|
|
48937
|
+
fetch: adapter2
|
|
48938
|
+
});
|
|
48939
|
+
}
|
|
48940
|
+
return res;
|
|
48941
|
+
} catch (e) {
|
|
48942
|
+
console.error("request afterFn error", e, req);
|
|
48943
|
+
return wrapperError({
|
|
48944
|
+
code: 500,
|
|
48945
|
+
message: "api request afterFn error"
|
|
48946
|
+
});
|
|
48947
|
+
}
|
|
48948
|
+
});
|
|
48949
|
+
}
|
|
48950
|
+
before(fn) {
|
|
48951
|
+
this.beforeRequest = fn;
|
|
48952
|
+
}
|
|
48953
|
+
after(fn) {
|
|
48954
|
+
this.afterResponse = fn;
|
|
48955
|
+
}
|
|
48956
|
+
async fetchText(urlOrOptions, options) {
|
|
48957
|
+
let _options = { ...options };
|
|
48958
|
+
if (typeof urlOrOptions === "string" && !_options.url) {
|
|
48959
|
+
_options.url = urlOrOptions;
|
|
48960
|
+
}
|
|
48961
|
+
if (typeof urlOrOptions === "object") {
|
|
48962
|
+
_options = { ...urlOrOptions, ..._options };
|
|
48963
|
+
}
|
|
48964
|
+
const res = await adapter({
|
|
48965
|
+
method: "GET",
|
|
48966
|
+
..._options,
|
|
48967
|
+
headers: {
|
|
48968
|
+
...this.headers,
|
|
48969
|
+
..._options?.headers || {}
|
|
48970
|
+
}
|
|
48971
|
+
});
|
|
48972
|
+
return setBaseResponse(res);
|
|
48973
|
+
}
|
|
48974
|
+
}
|
|
50112
48975
|
// src/config.ts
|
|
50113
48976
|
var _configDir = parseHomeArg(configDir).configDir;
|
|
50114
48977
|
var configDir2 = AssistantConfig.detectConfigDir(_configDir);
|
|
@@ -50637,7 +49500,7 @@ var source_default = chalk;
|
|
|
50637
49500
|
// src/module/chalk.ts
|
|
50638
49501
|
var chalk2 = new Chalk({ level: 3 });
|
|
50639
49502
|
|
|
50640
|
-
// ../node_modules/.pnpm/@kevisual+router@0.0.
|
|
49503
|
+
// ../node_modules/.pnpm/@kevisual+router@0.0.33_supports-color@10.2.2/node_modules/@kevisual/router/dist/router-sign.js
|
|
50641
49504
|
import require$$4 from "node:crypto";
|
|
50642
49505
|
var commonjsGlobal2 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
50643
49506
|
var selfsigned = {};
|
|
@@ -66291,12 +65154,12 @@ function requireLog() {
|
|
|
66291
65154
|
};
|
|
66292
65155
|
}
|
|
66293
65156
|
if (sConsoleLogger !== null && typeof window !== "undefined" && window.location) {
|
|
66294
|
-
var
|
|
66295
|
-
if (
|
|
66296
|
-
forge2.log.setLevel(sConsoleLogger,
|
|
65157
|
+
var query2 = new URL(window.location.href).searchParams;
|
|
65158
|
+
if (query2.has("console.level")) {
|
|
65159
|
+
forge2.log.setLevel(sConsoleLogger, query2.get("console.level").slice(-1)[0]);
|
|
66297
65160
|
}
|
|
66298
|
-
if (
|
|
66299
|
-
var lock =
|
|
65161
|
+
if (query2.has("console.lock")) {
|
|
65162
|
+
var lock = query2.get("console.lock").slice(-1)[0];
|
|
66300
65163
|
if (lock == "true") {
|
|
66301
65164
|
forge2.log.lock(sConsoleLogger);
|
|
66302
65165
|
}
|
|
@@ -67527,6 +66390,7 @@ class HttpsPem {
|
|
|
67527
66390
|
|
|
67528
66391
|
// src/services/init/index.ts
|
|
67529
66392
|
class AssistantInit extends AssistantConfig {
|
|
66393
|
+
#query;
|
|
67530
66394
|
constructor(opts) {
|
|
67531
66395
|
const configDir3 = opts?.path || process.cwd();
|
|
67532
66396
|
super({
|
|
@@ -67551,6 +66415,17 @@ class AssistantInit extends AssistantConfig {
|
|
|
67551
66415
|
this.createOtherConfig();
|
|
67552
66416
|
this.initPnpm();
|
|
67553
66417
|
}
|
|
66418
|
+
get query() {
|
|
66419
|
+
if (!this.#query) {
|
|
66420
|
+
this.setQuery();
|
|
66421
|
+
}
|
|
66422
|
+
return this.#query;
|
|
66423
|
+
}
|
|
66424
|
+
setQuery(query2) {
|
|
66425
|
+
this.#query = query2 || new Query({
|
|
66426
|
+
url: `${this.getConfig()?.pageApi || "https://kevisual.cn"}/api/router`
|
|
66427
|
+
});
|
|
66428
|
+
}
|
|
67554
66429
|
checkConfigPath() {
|
|
67555
66430
|
const assistantPath = path7.join(this.configDir, "assistant-app", "assistant-config.json");
|
|
67556
66431
|
return checkFileExists(assistantPath);
|
|
@@ -67585,7 +66460,7 @@ class AssistantInit extends AssistantConfig {
|
|
|
67585
66460
|
}
|
|
67586
66461
|
}
|
|
67587
66462
|
initPnpm() {
|
|
67588
|
-
const pnpmPath = path7.join(this.configDir, "assistant-app", "pnpm.yaml");
|
|
66463
|
+
const pnpmPath = path7.join(this.configDir, "assistant-app", "pnpm-workspace.yaml");
|
|
67589
66464
|
let create = false;
|
|
67590
66465
|
if (!checkFileExists(pnpmPath, true)) {
|
|
67591
66466
|
create = true;
|
|
@@ -67593,7 +66468,7 @@ class AssistantInit extends AssistantConfig {
|
|
|
67593
66468
|
- 'apps/**/*'
|
|
67594
66469
|
- 'pages/**/*'
|
|
67595
66470
|
`);
|
|
67596
|
-
console.log(chalk2.green("助手 pnpm.yaml 文件创建成功"));
|
|
66471
|
+
console.log(chalk2.green("助手 pnpm-workspace.yaml 文件创建成功"));
|
|
67597
66472
|
}
|
|
67598
66473
|
const packagePath = path7.join(this.configDir, "assistant-app", "package.json");
|
|
67599
66474
|
if (!checkFileExists(packagePath, true)) {
|
|
@@ -67623,6 +66498,7 @@ class AssistantInit extends AssistantConfig {
|
|
|
67623
66498
|
"unstorage": "latest",
|
|
67624
66499
|
"dayjs": "latest",
|
|
67625
66500
|
"es-toolkit": "latest",
|
|
66501
|
+
"node-cron": "latest",
|
|
67626
66502
|
"dotenv": "latest"
|
|
67627
66503
|
},
|
|
67628
66504
|
"devDependencies": {
|
|
@@ -67666,7 +66542,7 @@ class AssistantInit extends AssistantConfig {
|
|
|
67666
66542
|
import path9 from "node:path";
|
|
67667
66543
|
import fs10 from "node:fs";
|
|
67668
66544
|
|
|
67669
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
66545
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/key.js
|
|
67670
66546
|
var isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
|
|
67671
66547
|
var isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
|
|
67672
66548
|
var isSpaceKey = (key) => key.name === "space";
|
|
@@ -67674,7 +66550,7 @@ var isBackspaceKey = (key) => key.name === "backspace";
|
|
|
67674
66550
|
var isTabKey = (key) => key.name === "tab";
|
|
67675
66551
|
var isNumberKey = (key) => "1234567890".includes(key.name);
|
|
67676
66552
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
67677
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
66553
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/errors.js
|
|
67678
66554
|
class AbortPromptError extends Error {
|
|
67679
66555
|
name = "AbortPromptError";
|
|
67680
66556
|
message = "Prompt was aborted";
|
|
@@ -67700,10 +66576,10 @@ class HookError extends Error {
|
|
|
67700
66576
|
class ValidationError extends Error {
|
|
67701
66577
|
name = "ValidationError";
|
|
67702
66578
|
}
|
|
67703
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
66579
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
67704
66580
|
import { AsyncResource as AsyncResource2 } from "node:async_hooks";
|
|
67705
66581
|
|
|
67706
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
66582
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
67707
66583
|
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
67708
66584
|
var hookStorage = new AsyncLocalStorage;
|
|
67709
66585
|
function createStore(rl) {
|
|
@@ -67808,7 +66684,7 @@ var effectScheduler = {
|
|
|
67808
66684
|
}
|
|
67809
66685
|
};
|
|
67810
66686
|
|
|
67811
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
66687
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
67812
66688
|
function useState(defaultValue) {
|
|
67813
66689
|
return withPointer((pointer) => {
|
|
67814
66690
|
const setState = AsyncResource2.bind(function setState(newValue) {
|
|
@@ -67826,7 +66702,7 @@ function useState(defaultValue) {
|
|
|
67826
66702
|
});
|
|
67827
66703
|
}
|
|
67828
66704
|
|
|
67829
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
66705
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
67830
66706
|
function useEffect(cb, depArray) {
|
|
67831
66707
|
withPointer((pointer) => {
|
|
67832
66708
|
const oldDeps = pointer.get();
|
|
@@ -67838,10 +66714,10 @@ function useEffect(cb, depArray) {
|
|
|
67838
66714
|
});
|
|
67839
66715
|
}
|
|
67840
66716
|
|
|
67841
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
67842
|
-
|
|
66717
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/theme.js
|
|
66718
|
+
import { styleText } from "node:util";
|
|
67843
66719
|
|
|
67844
|
-
// ../node_modules/.pnpm/@inquirer+figures@
|
|
66720
|
+
// ../node_modules/.pnpm/@inquirer+figures@2.0.1/node_modules/@inquirer/figures/dist/index.js
|
|
67845
66721
|
import process5 from "node:process";
|
|
67846
66722
|
function isUnicodeSupported() {
|
|
67847
66723
|
if (process5.platform !== "win32") {
|
|
@@ -68127,31 +67003,31 @@ var fallbackSymbols = {
|
|
|
68127
67003
|
};
|
|
68128
67004
|
var shouldUseMain = isUnicodeSupported();
|
|
68129
67005
|
var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
68130
|
-
var
|
|
67006
|
+
var dist_default = figures;
|
|
68131
67007
|
var replacements = Object.entries(specialMainSymbols);
|
|
68132
67008
|
|
|
68133
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
67009
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/theme.js
|
|
68134
67010
|
var defaultTheme = {
|
|
68135
67011
|
prefix: {
|
|
68136
|
-
idle:
|
|
68137
|
-
done:
|
|
67012
|
+
idle: styleText("blue", "?"),
|
|
67013
|
+
done: styleText("green", dist_default.tick)
|
|
68138
67014
|
},
|
|
68139
67015
|
spinner: {
|
|
68140
67016
|
interval: 80,
|
|
68141
|
-
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) =>
|
|
67017
|
+
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => styleText("yellow", frame))
|
|
68142
67018
|
},
|
|
68143
67019
|
style: {
|
|
68144
|
-
answer:
|
|
68145
|
-
message:
|
|
68146
|
-
error: (text) =>
|
|
68147
|
-
defaultAnswer: (text) =>
|
|
68148
|
-
help:
|
|
68149
|
-
highlight:
|
|
68150
|
-
key: (text) =>
|
|
67020
|
+
answer: (text) => styleText("cyan", text),
|
|
67021
|
+
message: (text) => styleText("bold", text),
|
|
67022
|
+
error: (text) => styleText("red", `> ${text}`),
|
|
67023
|
+
defaultAnswer: (text) => styleText("dim", `(${text})`),
|
|
67024
|
+
help: (text) => styleText("dim", text),
|
|
67025
|
+
highlight: (text) => styleText("cyan", text),
|
|
67026
|
+
key: (text) => styleText("cyan", styleText("bold", `<${text}>`))
|
|
68151
67027
|
}
|
|
68152
67028
|
};
|
|
68153
67029
|
|
|
68154
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
67030
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
68155
67031
|
function isPlainObject2(value) {
|
|
68156
67032
|
if (typeof value !== "object" || value === null)
|
|
68157
67033
|
return false;
|
|
@@ -68179,7 +67055,7 @@ function makeTheme(...themes) {
|
|
|
68179
67055
|
return deepMerge(...themesToMerge);
|
|
68180
67056
|
}
|
|
68181
67057
|
|
|
68182
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
67058
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
68183
67059
|
function usePrefix({ status = "idle", theme }) {
|
|
68184
67060
|
const [showLoader, setShowLoader] = useState(false);
|
|
68185
67061
|
const [tick, setTick] = useState(0);
|
|
@@ -68209,7 +67085,7 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
68209
67085
|
const iconName = status === "loading" ? "idle" : status;
|
|
68210
67086
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
68211
67087
|
}
|
|
68212
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
67088
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
68213
67089
|
function useMemo(fn, dependencies) {
|
|
68214
67090
|
return withPointer((pointer) => {
|
|
68215
67091
|
const prev = pointer.get();
|
|
@@ -68221,11 +67097,11 @@ function useMemo(fn, dependencies) {
|
|
|
68221
67097
|
return prev.value;
|
|
68222
67098
|
});
|
|
68223
67099
|
}
|
|
68224
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
67100
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
68225
67101
|
function useRef(val) {
|
|
68226
67102
|
return useState({ current: val })[0];
|
|
68227
67103
|
}
|
|
68228
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
67104
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
68229
67105
|
function useKeypress(userHandler) {
|
|
68230
67106
|
const signal = useRef(userHandler);
|
|
68231
67107
|
signal.current = userHandler;
|
|
@@ -68243,12 +67119,444 @@ function useKeypress(userHandler) {
|
|
|
68243
67119
|
};
|
|
68244
67120
|
}, []);
|
|
68245
67121
|
}
|
|
68246
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
67122
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/utils.js
|
|
68247
67123
|
var import_cli_width = __toESM(require_cli_width(), 1);
|
|
68248
|
-
|
|
67124
|
+
|
|
67125
|
+
// ../node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
|
|
67126
|
+
function ansiRegex({ onlyFirst = false } = {}) {
|
|
67127
|
+
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
67128
|
+
const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
|
|
67129
|
+
const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
|
|
67130
|
+
const pattern2 = `${osc}|${csi}`;
|
|
67131
|
+
return new RegExp(pattern2, onlyFirst ? undefined : "g");
|
|
67132
|
+
}
|
|
67133
|
+
|
|
67134
|
+
// ../node_modules/.pnpm/strip-ansi@7.1.2/node_modules/strip-ansi/index.js
|
|
67135
|
+
var regex = ansiRegex();
|
|
67136
|
+
function stripAnsi(string2) {
|
|
67137
|
+
if (typeof string2 !== "string") {
|
|
67138
|
+
throw new TypeError(`Expected a \`string\`, got \`${typeof string2}\``);
|
|
67139
|
+
}
|
|
67140
|
+
return string2.replace(regex, "");
|
|
67141
|
+
}
|
|
67142
|
+
|
|
67143
|
+
// ../node_modules/.pnpm/get-east-asian-width@1.4.0/node_modules/get-east-asian-width/lookup.js
|
|
67144
|
+
function isAmbiguous(x) {
|
|
67145
|
+
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
67146
|
+
}
|
|
67147
|
+
function isFullWidth(x) {
|
|
67148
|
+
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
67149
|
+
}
|
|
67150
|
+
function isWide(x) {
|
|
67151
|
+
return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x >= 94192 && x <= 94198 || x >= 94208 && x <= 101589 || x >= 101631 && x <= 101662 || x >= 101760 && x <= 101874 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128728 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129674 || x >= 129678 && x <= 129734 || x === 129736 || x >= 129741 && x <= 129756 || x >= 129759 && x <= 129770 || x >= 129775 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
|
|
67152
|
+
}
|
|
67153
|
+
|
|
67154
|
+
// ../node_modules/.pnpm/get-east-asian-width@1.4.0/node_modules/get-east-asian-width/index.js
|
|
67155
|
+
function validate(codePoint) {
|
|
67156
|
+
if (!Number.isSafeInteger(codePoint)) {
|
|
67157
|
+
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
67158
|
+
}
|
|
67159
|
+
}
|
|
67160
|
+
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
67161
|
+
validate(codePoint);
|
|
67162
|
+
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
|
|
67163
|
+
return 2;
|
|
67164
|
+
}
|
|
67165
|
+
return 1;
|
|
67166
|
+
}
|
|
67167
|
+
|
|
67168
|
+
// ../node_modules/.pnpm/string-width@7.2.0/node_modules/string-width/index.js
|
|
67169
|
+
var import_emoji_regex = __toESM(require_emoji_regex(), 1);
|
|
67170
|
+
var segmenter = new Intl.Segmenter;
|
|
67171
|
+
var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
67172
|
+
function stringWidth(string2, options = {}) {
|
|
67173
|
+
if (typeof string2 !== "string" || string2.length === 0) {
|
|
67174
|
+
return 0;
|
|
67175
|
+
}
|
|
67176
|
+
const {
|
|
67177
|
+
ambiguousIsNarrow = true,
|
|
67178
|
+
countAnsiEscapeCodes = false
|
|
67179
|
+
} = options;
|
|
67180
|
+
if (!countAnsiEscapeCodes) {
|
|
67181
|
+
string2 = stripAnsi(string2);
|
|
67182
|
+
}
|
|
67183
|
+
if (string2.length === 0) {
|
|
67184
|
+
return 0;
|
|
67185
|
+
}
|
|
67186
|
+
let width = 0;
|
|
67187
|
+
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
67188
|
+
for (const { segment: character } of segmenter.segment(string2)) {
|
|
67189
|
+
const codePoint = character.codePointAt(0);
|
|
67190
|
+
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
|
|
67191
|
+
continue;
|
|
67192
|
+
}
|
|
67193
|
+
if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
|
|
67194
|
+
continue;
|
|
67195
|
+
}
|
|
67196
|
+
if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
|
|
67197
|
+
continue;
|
|
67198
|
+
}
|
|
67199
|
+
if (codePoint >= 55296 && codePoint <= 57343) {
|
|
67200
|
+
continue;
|
|
67201
|
+
}
|
|
67202
|
+
if (codePoint >= 65024 && codePoint <= 65039) {
|
|
67203
|
+
continue;
|
|
67204
|
+
}
|
|
67205
|
+
if (defaultIgnorableCodePointRegex.test(character)) {
|
|
67206
|
+
continue;
|
|
67207
|
+
}
|
|
67208
|
+
if (import_emoji_regex.default().test(character)) {
|
|
67209
|
+
width += 2;
|
|
67210
|
+
continue;
|
|
67211
|
+
}
|
|
67212
|
+
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
67213
|
+
}
|
|
67214
|
+
return width;
|
|
67215
|
+
}
|
|
67216
|
+
|
|
67217
|
+
// ../node_modules/.pnpm/ansi-styles@6.2.3/node_modules/ansi-styles/index.js
|
|
67218
|
+
var ANSI_BACKGROUND_OFFSET2 = 10;
|
|
67219
|
+
var wrapAnsi162 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
67220
|
+
var wrapAnsi2562 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
67221
|
+
var wrapAnsi16m2 = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
67222
|
+
var styles3 = {
|
|
67223
|
+
modifier: {
|
|
67224
|
+
reset: [0, 0],
|
|
67225
|
+
bold: [1, 22],
|
|
67226
|
+
dim: [2, 22],
|
|
67227
|
+
italic: [3, 23],
|
|
67228
|
+
underline: [4, 24],
|
|
67229
|
+
overline: [53, 55],
|
|
67230
|
+
inverse: [7, 27],
|
|
67231
|
+
hidden: [8, 28],
|
|
67232
|
+
strikethrough: [9, 29]
|
|
67233
|
+
},
|
|
67234
|
+
color: {
|
|
67235
|
+
black: [30, 39],
|
|
67236
|
+
red: [31, 39],
|
|
67237
|
+
green: [32, 39],
|
|
67238
|
+
yellow: [33, 39],
|
|
67239
|
+
blue: [34, 39],
|
|
67240
|
+
magenta: [35, 39],
|
|
67241
|
+
cyan: [36, 39],
|
|
67242
|
+
white: [37, 39],
|
|
67243
|
+
blackBright: [90, 39],
|
|
67244
|
+
gray: [90, 39],
|
|
67245
|
+
grey: [90, 39],
|
|
67246
|
+
redBright: [91, 39],
|
|
67247
|
+
greenBright: [92, 39],
|
|
67248
|
+
yellowBright: [93, 39],
|
|
67249
|
+
blueBright: [94, 39],
|
|
67250
|
+
magentaBright: [95, 39],
|
|
67251
|
+
cyanBright: [96, 39],
|
|
67252
|
+
whiteBright: [97, 39]
|
|
67253
|
+
},
|
|
67254
|
+
bgColor: {
|
|
67255
|
+
bgBlack: [40, 49],
|
|
67256
|
+
bgRed: [41, 49],
|
|
67257
|
+
bgGreen: [42, 49],
|
|
67258
|
+
bgYellow: [43, 49],
|
|
67259
|
+
bgBlue: [44, 49],
|
|
67260
|
+
bgMagenta: [45, 49],
|
|
67261
|
+
bgCyan: [46, 49],
|
|
67262
|
+
bgWhite: [47, 49],
|
|
67263
|
+
bgBlackBright: [100, 49],
|
|
67264
|
+
bgGray: [100, 49],
|
|
67265
|
+
bgGrey: [100, 49],
|
|
67266
|
+
bgRedBright: [101, 49],
|
|
67267
|
+
bgGreenBright: [102, 49],
|
|
67268
|
+
bgYellowBright: [103, 49],
|
|
67269
|
+
bgBlueBright: [104, 49],
|
|
67270
|
+
bgMagentaBright: [105, 49],
|
|
67271
|
+
bgCyanBright: [106, 49],
|
|
67272
|
+
bgWhiteBright: [107, 49]
|
|
67273
|
+
}
|
|
67274
|
+
};
|
|
67275
|
+
var modifierNames2 = Object.keys(styles3.modifier);
|
|
67276
|
+
var foregroundColorNames2 = Object.keys(styles3.color);
|
|
67277
|
+
var backgroundColorNames2 = Object.keys(styles3.bgColor);
|
|
67278
|
+
var colorNames2 = [...foregroundColorNames2, ...backgroundColorNames2];
|
|
67279
|
+
function assembleStyles2() {
|
|
67280
|
+
const codes = new Map;
|
|
67281
|
+
for (const [groupName, group] of Object.entries(styles3)) {
|
|
67282
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
67283
|
+
styles3[styleName] = {
|
|
67284
|
+
open: `\x1B[${style[0]}m`,
|
|
67285
|
+
close: `\x1B[${style[1]}m`
|
|
67286
|
+
};
|
|
67287
|
+
group[styleName] = styles3[styleName];
|
|
67288
|
+
codes.set(style[0], style[1]);
|
|
67289
|
+
}
|
|
67290
|
+
Object.defineProperty(styles3, groupName, {
|
|
67291
|
+
value: group,
|
|
67292
|
+
enumerable: false
|
|
67293
|
+
});
|
|
67294
|
+
}
|
|
67295
|
+
Object.defineProperty(styles3, "codes", {
|
|
67296
|
+
value: codes,
|
|
67297
|
+
enumerable: false
|
|
67298
|
+
});
|
|
67299
|
+
styles3.color.close = "\x1B[39m";
|
|
67300
|
+
styles3.bgColor.close = "\x1B[49m";
|
|
67301
|
+
styles3.color.ansi = wrapAnsi162();
|
|
67302
|
+
styles3.color.ansi256 = wrapAnsi2562();
|
|
67303
|
+
styles3.color.ansi16m = wrapAnsi16m2();
|
|
67304
|
+
styles3.bgColor.ansi = wrapAnsi162(ANSI_BACKGROUND_OFFSET2);
|
|
67305
|
+
styles3.bgColor.ansi256 = wrapAnsi2562(ANSI_BACKGROUND_OFFSET2);
|
|
67306
|
+
styles3.bgColor.ansi16m = wrapAnsi16m2(ANSI_BACKGROUND_OFFSET2);
|
|
67307
|
+
Object.defineProperties(styles3, {
|
|
67308
|
+
rgbToAnsi256: {
|
|
67309
|
+
value(red, green, blue) {
|
|
67310
|
+
if (red === green && green === blue) {
|
|
67311
|
+
if (red < 8) {
|
|
67312
|
+
return 16;
|
|
67313
|
+
}
|
|
67314
|
+
if (red > 248) {
|
|
67315
|
+
return 231;
|
|
67316
|
+
}
|
|
67317
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
67318
|
+
}
|
|
67319
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
67320
|
+
},
|
|
67321
|
+
enumerable: false
|
|
67322
|
+
},
|
|
67323
|
+
hexToRgb: {
|
|
67324
|
+
value(hex) {
|
|
67325
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
67326
|
+
if (!matches) {
|
|
67327
|
+
return [0, 0, 0];
|
|
67328
|
+
}
|
|
67329
|
+
let [colorString] = matches;
|
|
67330
|
+
if (colorString.length === 3) {
|
|
67331
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
67332
|
+
}
|
|
67333
|
+
const integer = Number.parseInt(colorString, 16);
|
|
67334
|
+
return [
|
|
67335
|
+
integer >> 16 & 255,
|
|
67336
|
+
integer >> 8 & 255,
|
|
67337
|
+
integer & 255
|
|
67338
|
+
];
|
|
67339
|
+
},
|
|
67340
|
+
enumerable: false
|
|
67341
|
+
},
|
|
67342
|
+
hexToAnsi256: {
|
|
67343
|
+
value: (hex) => styles3.rgbToAnsi256(...styles3.hexToRgb(hex)),
|
|
67344
|
+
enumerable: false
|
|
67345
|
+
},
|
|
67346
|
+
ansi256ToAnsi: {
|
|
67347
|
+
value(code) {
|
|
67348
|
+
if (code < 8) {
|
|
67349
|
+
return 30 + code;
|
|
67350
|
+
}
|
|
67351
|
+
if (code < 16) {
|
|
67352
|
+
return 90 + (code - 8);
|
|
67353
|
+
}
|
|
67354
|
+
let red;
|
|
67355
|
+
let green;
|
|
67356
|
+
let blue;
|
|
67357
|
+
if (code >= 232) {
|
|
67358
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
67359
|
+
green = red;
|
|
67360
|
+
blue = red;
|
|
67361
|
+
} else {
|
|
67362
|
+
code -= 16;
|
|
67363
|
+
const remainder = code % 36;
|
|
67364
|
+
red = Math.floor(code / 36) / 5;
|
|
67365
|
+
green = Math.floor(remainder / 6) / 5;
|
|
67366
|
+
blue = remainder % 6 / 5;
|
|
67367
|
+
}
|
|
67368
|
+
const value = Math.max(red, green, blue) * 2;
|
|
67369
|
+
if (value === 0) {
|
|
67370
|
+
return 30;
|
|
67371
|
+
}
|
|
67372
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
67373
|
+
if (value === 2) {
|
|
67374
|
+
result += 60;
|
|
67375
|
+
}
|
|
67376
|
+
return result;
|
|
67377
|
+
},
|
|
67378
|
+
enumerable: false
|
|
67379
|
+
},
|
|
67380
|
+
rgbToAnsi: {
|
|
67381
|
+
value: (red, green, blue) => styles3.ansi256ToAnsi(styles3.rgbToAnsi256(red, green, blue)),
|
|
67382
|
+
enumerable: false
|
|
67383
|
+
},
|
|
67384
|
+
hexToAnsi: {
|
|
67385
|
+
value: (hex) => styles3.ansi256ToAnsi(styles3.hexToAnsi256(hex)),
|
|
67386
|
+
enumerable: false
|
|
67387
|
+
}
|
|
67388
|
+
});
|
|
67389
|
+
return styles3;
|
|
67390
|
+
}
|
|
67391
|
+
var ansiStyles2 = assembleStyles2();
|
|
67392
|
+
var ansi_styles_default2 = ansiStyles2;
|
|
67393
|
+
|
|
67394
|
+
// ../node_modules/.pnpm/wrap-ansi@9.0.2/node_modules/wrap-ansi/index.js
|
|
67395
|
+
var ESCAPES = new Set([
|
|
67396
|
+
"\x1B",
|
|
67397
|
+
""
|
|
67398
|
+
]);
|
|
67399
|
+
var END_CODE = 39;
|
|
67400
|
+
var ANSI_ESCAPE_BELL = "\x07";
|
|
67401
|
+
var ANSI_CSI = "[";
|
|
67402
|
+
var ANSI_OSC = "]";
|
|
67403
|
+
var ANSI_SGR_TERMINATOR = "m";
|
|
67404
|
+
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
67405
|
+
var wrapAnsiCode = (code) => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
67406
|
+
var wrapAnsiHyperlink = (url) => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
67407
|
+
var wordLengths = (string2) => string2.split(" ").map((character) => stringWidth(character));
|
|
67408
|
+
var wrapWord = (rows, word, columns) => {
|
|
67409
|
+
const characters = [...word];
|
|
67410
|
+
let isInsideEscape = false;
|
|
67411
|
+
let isInsideLinkEscape = false;
|
|
67412
|
+
let visible = stringWidth(stripAnsi(rows.at(-1)));
|
|
67413
|
+
for (const [index, character] of characters.entries()) {
|
|
67414
|
+
const characterLength = stringWidth(character);
|
|
67415
|
+
if (visible + characterLength <= columns) {
|
|
67416
|
+
rows[rows.length - 1] += character;
|
|
67417
|
+
} else {
|
|
67418
|
+
rows.push(character);
|
|
67419
|
+
visible = 0;
|
|
67420
|
+
}
|
|
67421
|
+
if (ESCAPES.has(character)) {
|
|
67422
|
+
isInsideEscape = true;
|
|
67423
|
+
const ansiEscapeLinkCandidate = characters.slice(index + 1, index + 1 + ANSI_ESCAPE_LINK.length).join("");
|
|
67424
|
+
isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
|
|
67425
|
+
}
|
|
67426
|
+
if (isInsideEscape) {
|
|
67427
|
+
if (isInsideLinkEscape) {
|
|
67428
|
+
if (character === ANSI_ESCAPE_BELL) {
|
|
67429
|
+
isInsideEscape = false;
|
|
67430
|
+
isInsideLinkEscape = false;
|
|
67431
|
+
}
|
|
67432
|
+
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
67433
|
+
isInsideEscape = false;
|
|
67434
|
+
}
|
|
67435
|
+
continue;
|
|
67436
|
+
}
|
|
67437
|
+
visible += characterLength;
|
|
67438
|
+
if (visible === columns && index < characters.length - 1) {
|
|
67439
|
+
rows.push("");
|
|
67440
|
+
visible = 0;
|
|
67441
|
+
}
|
|
67442
|
+
}
|
|
67443
|
+
if (!visible && rows.at(-1).length > 0 && rows.length > 1) {
|
|
67444
|
+
rows[rows.length - 2] += rows.pop();
|
|
67445
|
+
}
|
|
67446
|
+
};
|
|
67447
|
+
var stringVisibleTrimSpacesRight = (string2) => {
|
|
67448
|
+
const words = string2.split(" ");
|
|
67449
|
+
let last = words.length;
|
|
67450
|
+
while (last > 0) {
|
|
67451
|
+
if (stringWidth(words[last - 1]) > 0) {
|
|
67452
|
+
break;
|
|
67453
|
+
}
|
|
67454
|
+
last--;
|
|
67455
|
+
}
|
|
67456
|
+
if (last === words.length) {
|
|
67457
|
+
return string2;
|
|
67458
|
+
}
|
|
67459
|
+
return words.slice(0, last).join(" ") + words.slice(last).join("");
|
|
67460
|
+
};
|
|
67461
|
+
var exec = (string2, columns, options = {}) => {
|
|
67462
|
+
if (options.trim !== false && string2.trim() === "") {
|
|
67463
|
+
return "";
|
|
67464
|
+
}
|
|
67465
|
+
let returnValue = "";
|
|
67466
|
+
let escapeCode;
|
|
67467
|
+
let escapeUrl;
|
|
67468
|
+
const lengths = wordLengths(string2);
|
|
67469
|
+
let rows = [""];
|
|
67470
|
+
for (const [index, word] of string2.split(" ").entries()) {
|
|
67471
|
+
if (options.trim !== false) {
|
|
67472
|
+
rows[rows.length - 1] = rows.at(-1).trimStart();
|
|
67473
|
+
}
|
|
67474
|
+
let rowLength = stringWidth(rows.at(-1));
|
|
67475
|
+
if (index !== 0) {
|
|
67476
|
+
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
67477
|
+
rows.push("");
|
|
67478
|
+
rowLength = 0;
|
|
67479
|
+
}
|
|
67480
|
+
if (rowLength > 0 || options.trim === false) {
|
|
67481
|
+
rows[rows.length - 1] += " ";
|
|
67482
|
+
rowLength++;
|
|
67483
|
+
}
|
|
67484
|
+
}
|
|
67485
|
+
if (options.hard && lengths[index] > columns) {
|
|
67486
|
+
const remainingColumns = columns - rowLength;
|
|
67487
|
+
const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
|
|
67488
|
+
const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
|
|
67489
|
+
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
67490
|
+
rows.push("");
|
|
67491
|
+
}
|
|
67492
|
+
wrapWord(rows, word, columns);
|
|
67493
|
+
continue;
|
|
67494
|
+
}
|
|
67495
|
+
if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
|
|
67496
|
+
if (options.wordWrap === false && rowLength < columns) {
|
|
67497
|
+
wrapWord(rows, word, columns);
|
|
67498
|
+
continue;
|
|
67499
|
+
}
|
|
67500
|
+
rows.push("");
|
|
67501
|
+
}
|
|
67502
|
+
if (rowLength + lengths[index] > columns && options.wordWrap === false) {
|
|
67503
|
+
wrapWord(rows, word, columns);
|
|
67504
|
+
continue;
|
|
67505
|
+
}
|
|
67506
|
+
rows[rows.length - 1] += word;
|
|
67507
|
+
}
|
|
67508
|
+
if (options.trim !== false) {
|
|
67509
|
+
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
67510
|
+
}
|
|
67511
|
+
const preString = rows.join(`
|
|
67512
|
+
`);
|
|
67513
|
+
const pre = [...preString];
|
|
67514
|
+
let preStringIndex = 0;
|
|
67515
|
+
for (const [index, character] of pre.entries()) {
|
|
67516
|
+
returnValue += character;
|
|
67517
|
+
if (ESCAPES.has(character)) {
|
|
67518
|
+
const { groups } = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(preString.slice(preStringIndex)) || { groups: {} };
|
|
67519
|
+
if (groups.code !== undefined) {
|
|
67520
|
+
const code2 = Number.parseFloat(groups.code);
|
|
67521
|
+
escapeCode = code2 === END_CODE ? undefined : code2;
|
|
67522
|
+
} else if (groups.uri !== undefined) {
|
|
67523
|
+
escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;
|
|
67524
|
+
}
|
|
67525
|
+
}
|
|
67526
|
+
const code = ansi_styles_default2.codes.get(Number(escapeCode));
|
|
67527
|
+
if (pre[index + 1] === `
|
|
67528
|
+
`) {
|
|
67529
|
+
if (escapeUrl) {
|
|
67530
|
+
returnValue += wrapAnsiHyperlink("");
|
|
67531
|
+
}
|
|
67532
|
+
if (escapeCode && code) {
|
|
67533
|
+
returnValue += wrapAnsiCode(code);
|
|
67534
|
+
}
|
|
67535
|
+
} else if (character === `
|
|
67536
|
+
`) {
|
|
67537
|
+
if (escapeCode && code) {
|
|
67538
|
+
returnValue += wrapAnsiCode(escapeCode);
|
|
67539
|
+
}
|
|
67540
|
+
if (escapeUrl) {
|
|
67541
|
+
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
67542
|
+
}
|
|
67543
|
+
}
|
|
67544
|
+
preStringIndex += character.length;
|
|
67545
|
+
}
|
|
67546
|
+
return returnValue;
|
|
67547
|
+
};
|
|
67548
|
+
function wrapAnsi(string2, columns, options) {
|
|
67549
|
+
return String(string2).normalize().replaceAll(`\r
|
|
67550
|
+
`, `
|
|
67551
|
+
`).split(`
|
|
67552
|
+
`).map((line) => exec(line, columns, options)).join(`
|
|
67553
|
+
`);
|
|
67554
|
+
}
|
|
67555
|
+
|
|
67556
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/utils.js
|
|
68249
67557
|
function breakLines(content, width) {
|
|
68250
67558
|
return content.split(`
|
|
68251
|
-
`).flatMap((line) =>
|
|
67559
|
+
`).flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }).split(`
|
|
68252
67560
|
`).map((str) => str.trimEnd())).join(`
|
|
68253
67561
|
`);
|
|
68254
67562
|
}
|
|
@@ -68256,7 +67564,7 @@ function readlineWidth() {
|
|
|
68256
67564
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
|
68257
67565
|
}
|
|
68258
67566
|
|
|
68259
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
67567
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
68260
67568
|
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
68261
67569
|
const state = useRef({
|
|
68262
67570
|
lastPointer: active,
|
|
@@ -68322,7 +67630,7 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
68322
67630
|
return pageBuffer.filter((line) => typeof line === "string").join(`
|
|
68323
67631
|
`);
|
|
68324
67632
|
}
|
|
68325
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
67633
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
68326
67634
|
var import_mute_stream = __toESM(require_lib(), 1);
|
|
68327
67635
|
import * as readline2 from "node:readline";
|
|
68328
67636
|
import { AsyncResource as AsyncResource3 } from "node:async_hooks";
|
|
@@ -68535,10 +67843,10 @@ var {
|
|
|
68535
67843
|
unload
|
|
68536
67844
|
} = signalExitWrap(processOk(process6) ? new SignalExit(process6) : new SignalExitFallback);
|
|
68537
67845
|
|
|
68538
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
67846
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
68539
67847
|
import { stripVTControlCharacters } from "node:util";
|
|
68540
67848
|
|
|
68541
|
-
// ../node_modules/.pnpm/@inquirer+ansi@
|
|
67849
|
+
// ../node_modules/.pnpm/@inquirer+ansi@2.0.1/node_modules/@inquirer/ansi/dist/index.js
|
|
68542
67850
|
var ESC = "\x1B[";
|
|
68543
67851
|
var cursorLeft = ESC + "G";
|
|
68544
67852
|
var cursorHide = ESC + "?25l";
|
|
@@ -68554,7 +67862,7 @@ var cursorTo = (x, y) => {
|
|
|
68554
67862
|
var eraseLine = ESC + "2K";
|
|
68555
67863
|
var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
|
|
68556
67864
|
|
|
68557
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
67865
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
68558
67866
|
var height = (content) => content.split(`
|
|
68559
67867
|
`).length;
|
|
68560
67868
|
var lastLine = (content) => content.split(`
|
|
@@ -68619,7 +67927,7 @@ class ScreenManager {
|
|
|
68619
67927
|
}
|
|
68620
67928
|
}
|
|
68621
67929
|
|
|
68622
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
67930
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
|
|
68623
67931
|
class PromisePolyfill extends Promise {
|
|
68624
67932
|
static withResolver() {
|
|
68625
67933
|
let resolve;
|
|
@@ -68632,7 +67940,7 @@ class PromisePolyfill extends Promise {
|
|
|
68632
67940
|
}
|
|
68633
67941
|
}
|
|
68634
67942
|
|
|
68635
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
67943
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
68636
67944
|
function getCallSites() {
|
|
68637
67945
|
const _prepareStackTrace = Error.prepareStackTrace;
|
|
68638
67946
|
let result = [];
|
|
@@ -68718,10 +68026,10 @@ function createPrompt(view) {
|
|
|
68718
68026
|
};
|
|
68719
68027
|
return prompt;
|
|
68720
68028
|
}
|
|
68721
|
-
// ../node_modules/.pnpm/@inquirer+core@
|
|
68722
|
-
|
|
68029
|
+
// ../node_modules/.pnpm/@inquirer+core@11.0.1_@types+node@24.10.1/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
68030
|
+
import { styleText as styleText2 } from "node:util";
|
|
68723
68031
|
class Separator {
|
|
68724
|
-
separator =
|
|
68032
|
+
separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
|
|
68725
68033
|
type = "separator";
|
|
68726
68034
|
constructor(separator) {
|
|
68727
68035
|
if (separator) {
|
|
@@ -68732,21 +68040,20 @@ class Separator {
|
|
|
68732
68040
|
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
68733
68041
|
}
|
|
68734
68042
|
}
|
|
68735
|
-
// ../node_modules/.pnpm/@inquirer+checkbox@
|
|
68736
|
-
|
|
68043
|
+
// ../node_modules/.pnpm/@inquirer+checkbox@5.0.1_@types+node@24.10.1/node_modules/@inquirer/checkbox/dist/index.js
|
|
68044
|
+
import { styleText as styleText3 } from "node:util";
|
|
68737
68045
|
var checkboxTheme = {
|
|
68738
68046
|
icon: {
|
|
68739
|
-
checked:
|
|
68740
|
-
unchecked:
|
|
68741
|
-
cursor:
|
|
68047
|
+
checked: styleText3("green", dist_default.circleFilled),
|
|
68048
|
+
unchecked: dist_default.circle,
|
|
68049
|
+
cursor: dist_default.pointer
|
|
68742
68050
|
},
|
|
68743
68051
|
style: {
|
|
68744
|
-
disabledChoice: (text) =>
|
|
68052
|
+
disabledChoice: (text) => styleText3("dim", `- ${text}`),
|
|
68745
68053
|
renderSelectedChoices: (selectedChoices) => selectedChoices.map((choice) => choice.short).join(", "),
|
|
68746
|
-
description: (text) =>
|
|
68747
|
-
keysHelpTip: (keys) => keys.map(([key, action]) => `${
|
|
68054
|
+
description: (text) => styleText3("cyan", text),
|
|
68055
|
+
keysHelpTip: (keys) => keys.map(([key, action]) => `${styleText3("bold", key)} ${styleText3("dim", action)}`).join(styleText3("dim", " • "))
|
|
68748
68056
|
},
|
|
68749
|
-
helpMode: "always",
|
|
68750
68057
|
keybindings: []
|
|
68751
68058
|
};
|
|
68752
68059
|
function isSelectable(item) {
|
|
@@ -68792,14 +68099,8 @@ function normalizeChoices(choices) {
|
|
|
68792
68099
|
return normalizedChoice;
|
|
68793
68100
|
});
|
|
68794
68101
|
}
|
|
68795
|
-
var
|
|
68796
|
-
const {
|
|
68797
|
-
instructions,
|
|
68798
|
-
pageSize = 7,
|
|
68799
|
-
loop = true,
|
|
68800
|
-
required,
|
|
68801
|
-
validate = () => true
|
|
68802
|
-
} = config2;
|
|
68102
|
+
var dist_default2 = createPrompt((config2, done) => {
|
|
68103
|
+
const { pageSize = 7, loop = true, required, validate: validate2 = () => true } = config2;
|
|
68803
68104
|
const shortcuts = { all: "a", invert: "i", ...config2.shortcuts };
|
|
68804
68105
|
const theme = makeTheme(checkboxTheme, config2.theme);
|
|
68805
68106
|
const { keybindings } = theme;
|
|
@@ -68819,7 +68120,7 @@ var esm_default2 = createPrompt((config2, done) => {
|
|
|
68819
68120
|
useKeypress(async (key) => {
|
|
68820
68121
|
if (isEnterKey(key)) {
|
|
68821
68122
|
const selection = items.filter(isChecked);
|
|
68822
|
-
const isValid = await
|
|
68123
|
+
const isValid = await validate2([...selection]);
|
|
68823
68124
|
if (required && !items.some(isChecked)) {
|
|
68824
68125
|
setError("At least one choice must be selected");
|
|
68825
68126
|
} else if (isValid === true) {
|
|
@@ -68891,23 +68192,16 @@ var esm_default2 = createPrompt((config2, done) => {
|
|
|
68891
68192
|
const answer = theme.style.answer(theme.style.renderSelectedChoices(selection, items));
|
|
68892
68193
|
return [prefix, message, answer].filter(Boolean).join(" ");
|
|
68893
68194
|
}
|
|
68894
|
-
|
|
68895
|
-
|
|
68896
|
-
|
|
68897
|
-
|
|
68898
|
-
|
|
68899
|
-
|
|
68900
|
-
|
|
68901
|
-
|
|
68902
|
-
|
|
68903
|
-
|
|
68904
|
-
keys.push([shortcuts.all, "all"]);
|
|
68905
|
-
if (shortcuts.invert)
|
|
68906
|
-
keys.push([shortcuts.invert, "invert"]);
|
|
68907
|
-
keys.push(["⏎", "submit"]);
|
|
68908
|
-
helpLine = theme.style.keysHelpTip(keys);
|
|
68909
|
-
}
|
|
68910
|
-
}
|
|
68195
|
+
const keys = [
|
|
68196
|
+
["↑↓", "navigate"],
|
|
68197
|
+
["space", "select"]
|
|
68198
|
+
];
|
|
68199
|
+
if (shortcuts.all)
|
|
68200
|
+
keys.push([shortcuts.all, "all"]);
|
|
68201
|
+
if (shortcuts.invert)
|
|
68202
|
+
keys.push([shortcuts.invert, "invert"]);
|
|
68203
|
+
keys.push(["⏎", "submit"]);
|
|
68204
|
+
const helpLine = theme.style.keysHelpTip(keys);
|
|
68911
68205
|
const lines = [
|
|
68912
68206
|
[prefix, message].filter(Boolean).join(" "),
|
|
68913
68207
|
page,
|
|
@@ -68919,7 +68213,7 @@ var esm_default2 = createPrompt((config2, done) => {
|
|
|
68919
68213
|
`).trimEnd();
|
|
68920
68214
|
return `${lines}${cursorHide}`;
|
|
68921
68215
|
});
|
|
68922
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@
|
|
68216
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.1_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/index.js
|
|
68923
68217
|
var import_chardet = __toESM(require_lib2(), 1);
|
|
68924
68218
|
var import_iconv_lite = __toESM(require_lib3(), 1);
|
|
68925
68219
|
import { spawn, spawnSync } from "child_process";
|
|
@@ -68928,7 +68222,7 @@ import path8 from "node:path";
|
|
|
68928
68222
|
import os3 from "node:os";
|
|
68929
68223
|
import { randomUUID } from "node:crypto";
|
|
68930
68224
|
|
|
68931
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@
|
|
68225
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.1_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/CreateFileError.js
|
|
68932
68226
|
class CreateFileError extends Error {
|
|
68933
68227
|
originalError;
|
|
68934
68228
|
constructor(originalError) {
|
|
@@ -68937,7 +68231,7 @@ class CreateFileError extends Error {
|
|
|
68937
68231
|
}
|
|
68938
68232
|
}
|
|
68939
68233
|
|
|
68940
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@
|
|
68234
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.1_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/LaunchEditorError.js
|
|
68941
68235
|
class LaunchEditorError extends Error {
|
|
68942
68236
|
originalError;
|
|
68943
68237
|
constructor(originalError) {
|
|
@@ -68946,7 +68240,7 @@ class LaunchEditorError extends Error {
|
|
|
68946
68240
|
}
|
|
68947
68241
|
}
|
|
68948
68242
|
|
|
68949
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@
|
|
68243
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.1_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/ReadFileError.js
|
|
68950
68244
|
class ReadFileError extends Error {
|
|
68951
68245
|
originalError;
|
|
68952
68246
|
constructor(originalError) {
|
|
@@ -68955,7 +68249,7 @@ class ReadFileError extends Error {
|
|
|
68955
68249
|
}
|
|
68956
68250
|
}
|
|
68957
68251
|
|
|
68958
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@
|
|
68252
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.1_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/errors/RemoveFileError.js
|
|
68959
68253
|
class RemoveFileError extends Error {
|
|
68960
68254
|
originalError;
|
|
68961
68255
|
constructor(originalError) {
|
|
@@ -68964,7 +68258,7 @@ class RemoveFileError extends Error {
|
|
|
68964
68258
|
}
|
|
68965
68259
|
}
|
|
68966
68260
|
|
|
68967
|
-
// ../node_modules/.pnpm/@inquirer+external-editor@
|
|
68261
|
+
// ../node_modules/.pnpm/@inquirer+external-editor@2.0.1_@types+node@24.10.1/node_modules/@inquirer/external-editor/dist/index.js
|
|
68968
68262
|
function editAsync(text = "", callback, fileOptions) {
|
|
68969
68263
|
const editor = new ExternalEditor(text, fileOptions);
|
|
68970
68264
|
editor.runAsync((err, result) => {
|
|
@@ -69119,12 +68413,12 @@ class ExternalEditor {
|
|
|
69119
68413
|
}
|
|
69120
68414
|
}
|
|
69121
68415
|
|
|
69122
|
-
// ../node_modules/.pnpm/@inquirer+editor@
|
|
68416
|
+
// ../node_modules/.pnpm/@inquirer+editor@5.0.1_@types+node@24.10.1/node_modules/@inquirer/editor/dist/index.js
|
|
69123
68417
|
var editorTheme = {
|
|
69124
68418
|
validationFailureMode: "keep"
|
|
69125
68419
|
};
|
|
69126
|
-
var
|
|
69127
|
-
const { waitForUserInput = true, file: { postfix = config2.postfix ?? ".txt", ...fileProps } = {}, validate = () => true } = config2;
|
|
68420
|
+
var dist_default3 = createPrompt((config2, done) => {
|
|
68421
|
+
const { waitForUserInput = true, file: { postfix = config2.postfix ?? ".txt", ...fileProps } = {}, validate: validate2 = () => true } = config2;
|
|
69128
68422
|
const theme = makeTheme(editorTheme, config2.theme);
|
|
69129
68423
|
const [status, setStatus] = useState("idle");
|
|
69130
68424
|
const [value = "", setValue] = useState(config2.default);
|
|
@@ -69139,7 +68433,7 @@ var esm_default3 = createPrompt((config2, done) => {
|
|
|
69139
68433
|
} else {
|
|
69140
68434
|
setStatus("loading");
|
|
69141
68435
|
const finalAnswer = answer ?? "";
|
|
69142
|
-
const isValid = await
|
|
68436
|
+
const isValid = await validate2(finalAnswer);
|
|
69143
68437
|
if (isValid === true) {
|
|
69144
68438
|
setError(undefined);
|
|
69145
68439
|
setStatus("done");
|
|
@@ -69187,7 +68481,7 @@ var esm_default3 = createPrompt((config2, done) => {
|
|
|
69187
68481
|
}
|
|
69188
68482
|
return [[prefix, message, helpTip].filter(Boolean).join(" "), error2];
|
|
69189
68483
|
});
|
|
69190
|
-
// ../node_modules/.pnpm/@inquirer+confirm@
|
|
68484
|
+
// ../node_modules/.pnpm/@inquirer+confirm@6.0.1_@types+node@24.10.1/node_modules/@inquirer/confirm/dist/index.js
|
|
69191
68485
|
function getBooleanValue(value, defaultValue) {
|
|
69192
68486
|
let answer = defaultValue !== false;
|
|
69193
68487
|
if (/^(y|yes)/i.test(value))
|
|
@@ -69199,7 +68493,7 @@ function getBooleanValue(value, defaultValue) {
|
|
|
69199
68493
|
function boolToString(value) {
|
|
69200
68494
|
return value ? "Yes" : "No";
|
|
69201
68495
|
}
|
|
69202
|
-
var
|
|
68496
|
+
var dist_default4 = createPrompt((config2, done) => {
|
|
69203
68497
|
const { transformer = boolToString } = config2;
|
|
69204
68498
|
const [status, setStatus] = useState("idle");
|
|
69205
68499
|
const [value, setValue] = useState("");
|
|
@@ -69232,11 +68526,11 @@ var esm_default4 = createPrompt((config2, done) => {
|
|
|
69232
68526
|
const message = theme.style.message(config2.message, status);
|
|
69233
68527
|
return `${prefix} ${message}${defaultValue} ${formattedValue}`;
|
|
69234
68528
|
});
|
|
69235
|
-
// ../node_modules/.pnpm/@inquirer+input@
|
|
68529
|
+
// ../node_modules/.pnpm/@inquirer+input@5.0.1_@types+node@24.10.1/node_modules/@inquirer/input/dist/index.js
|
|
69236
68530
|
var inputTheme = {
|
|
69237
68531
|
validationFailureMode: "keep"
|
|
69238
68532
|
};
|
|
69239
|
-
var
|
|
68533
|
+
var dist_default5 = createPrompt((config2, done) => {
|
|
69240
68534
|
const { prefill = "tab" } = config2;
|
|
69241
68535
|
const theme = makeTheme(inputTheme, config2.theme);
|
|
69242
68536
|
const [status, setStatus] = useState("idle");
|
|
@@ -69244,7 +68538,7 @@ var esm_default5 = createPrompt((config2, done) => {
|
|
|
69244
68538
|
const [errorMsg, setError] = useState();
|
|
69245
68539
|
const [value, setValue] = useState("");
|
|
69246
68540
|
const prefix = usePrefix({ status, theme });
|
|
69247
|
-
async function
|
|
68541
|
+
async function validate2(value2) {
|
|
69248
68542
|
const { required, pattern: pattern2, patternError = "Invalid input" } = config2;
|
|
69249
68543
|
if (required && !value2) {
|
|
69250
68544
|
return "You must provide a value";
|
|
@@ -69264,7 +68558,7 @@ var esm_default5 = createPrompt((config2, done) => {
|
|
|
69264
68558
|
if (isEnterKey(key)) {
|
|
69265
68559
|
const answer = value || defaultValue;
|
|
69266
68560
|
setStatus("loading");
|
|
69267
|
-
const isValid = await
|
|
68561
|
+
const isValid = await validate2(answer);
|
|
69268
68562
|
if (isValid === true) {
|
|
69269
68563
|
setValue(answer);
|
|
69270
68564
|
setStatus("done");
|
|
@@ -69316,7 +68610,7 @@ var esm_default5 = createPrompt((config2, done) => {
|
|
|
69316
68610
|
error2
|
|
69317
68611
|
];
|
|
69318
68612
|
});
|
|
69319
|
-
// ../node_modules/.pnpm/@inquirer+number@
|
|
68613
|
+
// ../node_modules/.pnpm/@inquirer+number@4.0.1_@types+node@24.10.1/node_modules/@inquirer/number/dist/index.js
|
|
69320
68614
|
function isStepOf(value, step, min) {
|
|
69321
68615
|
const valuePow = value * Math.pow(10, 6);
|
|
69322
68616
|
const stepPow = step * Math.pow(10, 6);
|
|
@@ -69333,8 +68627,8 @@ function validateNumber(value, { min, max, step }) {
|
|
|
69333
68627
|
}
|
|
69334
68628
|
return true;
|
|
69335
68629
|
}
|
|
69336
|
-
var
|
|
69337
|
-
const { validate = () => true, min = -Infinity, max = Infinity, step = 1, required = false } = config2;
|
|
68630
|
+
var dist_default6 = createPrompt((config2, done) => {
|
|
68631
|
+
const { validate: validate2 = () => true, min = -Infinity, max = Infinity, step = 1, required = false } = config2;
|
|
69338
68632
|
const theme = makeTheme(config2.theme);
|
|
69339
68633
|
const [status, setStatus] = useState("idle");
|
|
69340
68634
|
const [value, setValue] = useState("");
|
|
@@ -69355,7 +68649,7 @@ var esm_default6 = createPrompt((config2, done) => {
|
|
|
69355
68649
|
isValid = validateNumber(answer, { min, max, step });
|
|
69356
68650
|
}
|
|
69357
68651
|
if (isValid === true) {
|
|
69358
|
-
isValid = await
|
|
68652
|
+
isValid = await validate2(answer);
|
|
69359
68653
|
}
|
|
69360
68654
|
if (isValid === true) {
|
|
69361
68655
|
setValue(String(answer ?? ""));
|
|
@@ -69396,8 +68690,8 @@ var esm_default6 = createPrompt((config2, done) => {
|
|
|
69396
68690
|
error2
|
|
69397
68691
|
];
|
|
69398
68692
|
});
|
|
69399
|
-
// ../node_modules/.pnpm/@inquirer+expand@
|
|
69400
|
-
|
|
68693
|
+
// ../node_modules/.pnpm/@inquirer+expand@5.0.1_@types+node@24.10.1/node_modules/@inquirer/expand/dist/index.js
|
|
68694
|
+
import { styleText as styleText4 } from "node:util";
|
|
69401
68695
|
function normalizeChoices2(choices) {
|
|
69402
68696
|
return choices.map((choice) => {
|
|
69403
68697
|
if (Separator.isSeparator(choice)) {
|
|
@@ -69417,7 +68711,7 @@ var helpChoice = {
|
|
|
69417
68711
|
name: "Help, list all options",
|
|
69418
68712
|
value: undefined
|
|
69419
68713
|
};
|
|
69420
|
-
var
|
|
68714
|
+
var dist_default7 = createPrompt((config2, done) => {
|
|
69421
68715
|
const { default: defaultKey = "h" } = config2;
|
|
69422
68716
|
const choices = useMemo(() => normalizeChoices2(config2.choices), [config2.choices]);
|
|
69423
68717
|
const [status, setStatus] = useState("idle");
|
|
@@ -69440,7 +68734,7 @@ var esm_default7 = createPrompt((config2, done) => {
|
|
|
69440
68734
|
} else if (value === "") {
|
|
69441
68735
|
setError("Please input a value");
|
|
69442
68736
|
} else {
|
|
69443
|
-
setError(`"${
|
|
68737
|
+
setError(`"${styleText4("red", value)}" isn't an available option`);
|
|
69444
68738
|
}
|
|
69445
68739
|
}
|
|
69446
68740
|
} else {
|
|
@@ -69481,7 +68775,7 @@ var esm_default7 = createPrompt((config2, done) => {
|
|
|
69481
68775
|
let helpTip = "";
|
|
69482
68776
|
const currentOption = choices.find((choice) => !Separator.isSeparator(choice) && choice.key === value.toLowerCase());
|
|
69483
68777
|
if (currentOption) {
|
|
69484
|
-
helpTip = `${
|
|
68778
|
+
helpTip = `${styleText4("cyan", ">>")} ${currentOption.name}`;
|
|
69485
68779
|
}
|
|
69486
68780
|
let error2 = "";
|
|
69487
68781
|
if (errorMsg) {
|
|
@@ -69493,8 +68787,8 @@ var esm_default7 = createPrompt((config2, done) => {
|
|
|
69493
68787
|
`)
|
|
69494
68788
|
];
|
|
69495
68789
|
});
|
|
69496
|
-
// ../node_modules/.pnpm/@inquirer+rawlist@
|
|
69497
|
-
|
|
68790
|
+
// ../node_modules/.pnpm/@inquirer+rawlist@5.0.1_@types+node@24.10.1/node_modules/@inquirer/rawlist/dist/index.js
|
|
68791
|
+
import { styleText as styleText5 } from "node:util";
|
|
69498
68792
|
var numberRegex = /\d+/;
|
|
69499
68793
|
function isSelectableChoice(choice) {
|
|
69500
68794
|
return choice != null && !Separator.isSeparator(choice);
|
|
@@ -69532,7 +68826,7 @@ function getSelectedChoice(input, choices) {
|
|
|
69532
68826
|
}
|
|
69533
68827
|
return selectedChoice ? [selectedChoice, choices.indexOf(selectedChoice)] : [undefined, undefined];
|
|
69534
68828
|
}
|
|
69535
|
-
var
|
|
68829
|
+
var dist_default8 = createPrompt((config2, done) => {
|
|
69536
68830
|
const { loop = true } = config2;
|
|
69537
68831
|
const choices = useMemo(() => normalizeChoices3(config2.choices), [config2.choices]);
|
|
69538
68832
|
const [status, setStatus] = useState("idle");
|
|
@@ -69558,7 +68852,7 @@ var esm_default8 = createPrompt((config2, done) => {
|
|
|
69558
68852
|
} else if (value === "") {
|
|
69559
68853
|
setError("Please input a value");
|
|
69560
68854
|
} else {
|
|
69561
|
-
setError(`"${
|
|
68855
|
+
setError(`"${styleText5("red", value)}" isn't an available option`);
|
|
69562
68856
|
}
|
|
69563
68857
|
} else if (isUpKey(key) || isDownKey(key)) {
|
|
69564
68858
|
rl.clearLine(0);
|
|
@@ -69604,9 +68898,9 @@ var esm_default8 = createPrompt((config2, done) => {
|
|
|
69604
68898
|
`)
|
|
69605
68899
|
];
|
|
69606
68900
|
});
|
|
69607
|
-
// ../node_modules/.pnpm/@inquirer+password@
|
|
69608
|
-
var
|
|
69609
|
-
const { validate = () => true } = config2;
|
|
68901
|
+
// ../node_modules/.pnpm/@inquirer+password@5.0.1_@types+node@24.10.1/node_modules/@inquirer/password/dist/index.js
|
|
68902
|
+
var dist_default9 = createPrompt((config2, done) => {
|
|
68903
|
+
const { validate: validate2 = () => true } = config2;
|
|
69610
68904
|
const theme = makeTheme(config2.theme);
|
|
69611
68905
|
const [status, setStatus] = useState("idle");
|
|
69612
68906
|
const [errorMsg, setError] = useState();
|
|
@@ -69619,7 +68913,7 @@ var esm_default9 = createPrompt((config2, done) => {
|
|
|
69619
68913
|
if (isEnterKey(key)) {
|
|
69620
68914
|
const answer = value;
|
|
69621
68915
|
setStatus("loading");
|
|
69622
|
-
const isValid = await
|
|
68916
|
+
const isValid = await validate2(answer);
|
|
69623
68917
|
if (isValid === true) {
|
|
69624
68918
|
setValue(answer);
|
|
69625
68919
|
setStatus("done");
|
|
@@ -69652,17 +68946,16 @@ var esm_default9 = createPrompt((config2, done) => {
|
|
|
69652
68946
|
}
|
|
69653
68947
|
return [[prefix, message, config2.mask ? formattedValue : helpTip].join(" "), error2];
|
|
69654
68948
|
});
|
|
69655
|
-
// ../node_modules/.pnpm/@inquirer+search@
|
|
69656
|
-
|
|
68949
|
+
// ../node_modules/.pnpm/@inquirer+search@4.0.1_@types+node@24.10.1/node_modules/@inquirer/search/dist/index.js
|
|
68950
|
+
import { styleText as styleText6 } from "node:util";
|
|
69657
68951
|
var searchTheme = {
|
|
69658
|
-
icon: { cursor:
|
|
68952
|
+
icon: { cursor: dist_default.pointer },
|
|
69659
68953
|
style: {
|
|
69660
|
-
disabled: (text) =>
|
|
69661
|
-
searchTerm: (text) =>
|
|
69662
|
-
description: (text) =>
|
|
69663
|
-
keysHelpTip: (keys) => keys.map(([key, action]) => `${
|
|
69664
|
-
}
|
|
69665
|
-
helpMode: "always"
|
|
68954
|
+
disabled: (text) => styleText6("dim", `- ${text}`),
|
|
68955
|
+
searchTerm: (text) => styleText6("cyan", text),
|
|
68956
|
+
description: (text) => styleText6("cyan", text),
|
|
68957
|
+
keysHelpTip: (keys) => keys.map(([key, action]) => `${styleText6("bold", key)} ${styleText6("dim", action)}`).join(styleText6("dim", " • "))
|
|
68958
|
+
}
|
|
69666
68959
|
};
|
|
69667
68960
|
function isSelectable2(item) {
|
|
69668
68961
|
return !Separator.isSeparator(item) && !item.disabled;
|
|
@@ -69692,8 +68985,8 @@ function normalizeChoices4(choices) {
|
|
|
69692
68985
|
return normalizedChoice;
|
|
69693
68986
|
});
|
|
69694
68987
|
}
|
|
69695
|
-
var
|
|
69696
|
-
const { pageSize = 7, validate = () => true } = config2;
|
|
68988
|
+
var dist_default10 = createPrompt((config2, done) => {
|
|
68989
|
+
const { pageSize = 7, validate: validate2 = () => true } = config2;
|
|
69697
68990
|
const theme = makeTheme(searchTheme, config2.theme);
|
|
69698
68991
|
const [status, setStatus] = useState("loading");
|
|
69699
68992
|
const [searchTerm, setSearchTerm] = useState("");
|
|
@@ -69737,7 +69030,7 @@ var esm_default10 = createPrompt((config2, done) => {
|
|
|
69737
69030
|
if (isEnterKey(key)) {
|
|
69738
69031
|
if (selectedChoice) {
|
|
69739
69032
|
setStatus("loading");
|
|
69740
|
-
const isValid = await
|
|
69033
|
+
const isValid = await validate2(selectedChoice.value);
|
|
69741
69034
|
setStatus("idle");
|
|
69742
69035
|
if (isValid === true) {
|
|
69743
69036
|
setStatus("done");
|
|
@@ -69770,18 +69063,10 @@ var esm_default10 = createPrompt((config2, done) => {
|
|
|
69770
69063
|
}
|
|
69771
69064
|
});
|
|
69772
69065
|
const message = theme.style.message(config2.message, status);
|
|
69773
|
-
|
|
69774
|
-
|
|
69775
|
-
|
|
69776
|
-
|
|
69777
|
-
helpLine = theme.style.help(searchResults.length > pageSize ? pager : navigation);
|
|
69778
|
-
} else {
|
|
69779
|
-
helpLine = theme.style.keysHelpTip([
|
|
69780
|
-
["↑↓", "navigate"],
|
|
69781
|
-
["⏎", "select"]
|
|
69782
|
-
]);
|
|
69783
|
-
}
|
|
69784
|
-
}
|
|
69066
|
+
const helpLine = theme.style.keysHelpTip([
|
|
69067
|
+
["↑↓", "navigate"],
|
|
69068
|
+
["⏎", "select"]
|
|
69069
|
+
]);
|
|
69785
69070
|
const page = usePagination({
|
|
69786
69071
|
items: searchResults,
|
|
69787
69072
|
active,
|
|
@@ -69823,16 +69108,15 @@ var esm_default10 = createPrompt((config2, done) => {
|
|
|
69823
69108
|
`).trimEnd();
|
|
69824
69109
|
return [header, body];
|
|
69825
69110
|
});
|
|
69826
|
-
// ../node_modules/.pnpm/@inquirer+select@
|
|
69827
|
-
|
|
69111
|
+
// ../node_modules/.pnpm/@inquirer+select@5.0.1_@types+node@24.10.1/node_modules/@inquirer/select/dist/index.js
|
|
69112
|
+
import { styleText as styleText7 } from "node:util";
|
|
69828
69113
|
var selectTheme = {
|
|
69829
|
-
icon: { cursor:
|
|
69114
|
+
icon: { cursor: dist_default.pointer },
|
|
69830
69115
|
style: {
|
|
69831
|
-
disabled: (text) =>
|
|
69832
|
-
description: (text) =>
|
|
69833
|
-
keysHelpTip: (keys) => keys.map(([key, action]) => `${
|
|
69116
|
+
disabled: (text) => styleText7("dim", `- ${text}`),
|
|
69117
|
+
description: (text) => styleText7("cyan", text),
|
|
69118
|
+
keysHelpTip: (keys) => keys.map(([key, action]) => `${styleText7("bold", key)} ${styleText7("dim", action)}`).join(styleText7("dim", " • "))
|
|
69834
69119
|
},
|
|
69835
|
-
helpMode: "always",
|
|
69836
69120
|
indexMode: "hidden",
|
|
69837
69121
|
keybindings: []
|
|
69838
69122
|
};
|
|
@@ -69864,7 +69148,7 @@ function normalizeChoices5(choices) {
|
|
|
69864
69148
|
return normalizedChoice;
|
|
69865
69149
|
});
|
|
69866
69150
|
}
|
|
69867
|
-
var
|
|
69151
|
+
var dist_default11 = createPrompt((config2, done) => {
|
|
69868
69152
|
const { loop = true, pageSize = 7 } = config2;
|
|
69869
69153
|
const theme = makeTheme(selectTheme, config2.theme);
|
|
69870
69154
|
const { keybindings } = theme;
|
|
@@ -69940,18 +69224,10 @@ var esm_default11 = createPrompt((config2, done) => {
|
|
|
69940
69224
|
clearTimeout(searchTimeoutRef.current);
|
|
69941
69225
|
}, []);
|
|
69942
69226
|
const message = theme.style.message(config2.message, status);
|
|
69943
|
-
|
|
69944
|
-
|
|
69945
|
-
|
|
69946
|
-
|
|
69947
|
-
helpLine = theme.style.help(items.length > pageSize ? pager : navigation);
|
|
69948
|
-
} else {
|
|
69949
|
-
helpLine = theme.style.keysHelpTip([
|
|
69950
|
-
["↑↓", "navigate"],
|
|
69951
|
-
["⏎", "select"]
|
|
69952
|
-
]);
|
|
69953
|
-
}
|
|
69954
|
-
}
|
|
69227
|
+
const helpLine = theme.style.keysHelpTip([
|
|
69228
|
+
["↑↓", "navigate"],
|
|
69229
|
+
["⏎", "select"]
|
|
69230
|
+
]);
|
|
69955
69231
|
let separatorCount = 0;
|
|
69956
69232
|
const page = usePagination({
|
|
69957
69233
|
items,
|
|
@@ -69987,7 +69263,7 @@ var esm_default11 = createPrompt((config2, done) => {
|
|
|
69987
69263
|
`).trimEnd();
|
|
69988
69264
|
return `${lines}${cursorHide}`;
|
|
69989
69265
|
});
|
|
69990
|
-
// ../node_modules/.pnpm/inquirer@
|
|
69266
|
+
// ../node_modules/.pnpm/inquirer@13.0.1_@types+node@24.10.1/node_modules/inquirer/dist/ui/prompt.js
|
|
69991
69267
|
var import_rxjs = __toESM(require_cjs(), 1);
|
|
69992
69268
|
var import_run_async = __toESM(require_run_async(), 1);
|
|
69993
69269
|
var import_mute_stream2 = __toESM(require_lib(), 1);
|
|
@@ -70198,19 +69474,18 @@ class PromptsRunner {
|
|
|
70198
69474
|
};
|
|
70199
69475
|
}
|
|
70200
69476
|
|
|
70201
|
-
// ../node_modules/.pnpm/inquirer@
|
|
69477
|
+
// ../node_modules/.pnpm/inquirer@13.0.1_@types+node@24.10.1/node_modules/inquirer/dist/index.js
|
|
70202
69478
|
var builtInPrompts = {
|
|
70203
|
-
input:
|
|
70204
|
-
select:
|
|
70205
|
-
|
|
70206
|
-
|
|
70207
|
-
|
|
70208
|
-
|
|
70209
|
-
|
|
70210
|
-
|
|
70211
|
-
|
|
70212
|
-
|
|
70213
|
-
search: esm_default10
|
|
69479
|
+
input: dist_default5,
|
|
69480
|
+
select: dist_default11,
|
|
69481
|
+
number: dist_default6,
|
|
69482
|
+
confirm: dist_default4,
|
|
69483
|
+
rawlist: dist_default8,
|
|
69484
|
+
expand: dist_default7,
|
|
69485
|
+
checkbox: dist_default2,
|
|
69486
|
+
password: dist_default9,
|
|
69487
|
+
editor: dist_default3,
|
|
69488
|
+
search: dist_default10
|
|
70214
69489
|
};
|
|
70215
69490
|
function createPromptModule(opt) {
|
|
70216
69491
|
function promptModule(questions, answers) {
|
|
@@ -70245,7 +69520,7 @@ var inquirer = {
|
|
|
70245
69520
|
restoreDefaultPrompts,
|
|
70246
69521
|
Separator
|
|
70247
69522
|
};
|
|
70248
|
-
var
|
|
69523
|
+
var dist_default12 = inquirer;
|
|
70249
69524
|
|
|
70250
69525
|
// src/command/config-manager/index.ts
|
|
70251
69526
|
var Init = new Command("init").description("初始化一个助手客户端,生成配置文件。").option("-p --path <path>", "助手路径,默认为执行命令的目录,如果助手路径不存在则创建。").action((opts) => {
|
|
@@ -70271,7 +69546,7 @@ var removeCommand = new Command("remove").description("删除助手配置文件"
|
|
|
70271
69546
|
const configDir3 = AssistantInit.detectConfigDir(opts.path);
|
|
70272
69547
|
const assistantDir = path9.join(configDir3, "assistant-app");
|
|
70273
69548
|
if (fs10.existsSync(assistantDir)) {
|
|
70274
|
-
|
|
69549
|
+
dist_default12.prompt([
|
|
70275
69550
|
{
|
|
70276
69551
|
type: "confirm",
|
|
70277
69552
|
name: "confirm",
|
|
@@ -70371,7 +69646,7 @@ class AppDownload {
|
|
|
70371
69646
|
return runCommand(command, args);
|
|
70372
69647
|
}
|
|
70373
69648
|
async confirm(message) {
|
|
70374
|
-
const { confirm } = await
|
|
69649
|
+
const { confirm } = await dist_default12.prompt([
|
|
70375
69650
|
{
|
|
70376
69651
|
type: "confirm",
|
|
70377
69652
|
name: "confirm",
|
|
@@ -73370,8 +72645,8 @@ ${underline}`);
|
|
|
73370
72645
|
var path11 = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
73371
72646
|
|
|
73372
72647
|
class Messages extends APIResource {
|
|
73373
|
-
list(completionID,
|
|
73374
|
-
return this._client.getAPIList(path11`/chat/completions/${completionID}/messages`, CursorPage, { query, ...options });
|
|
72648
|
+
list(completionID, query2 = {}, options) {
|
|
72649
|
+
return this._client.getAPIList(path11`/chat/completions/${completionID}/messages`, CursorPage, { query: query2, ...options });
|
|
73375
72650
|
}
|
|
73376
72651
|
}
|
|
73377
72652
|
function isChatCompletionFunctionTool(tool) {
|
|
@@ -74625,8 +73900,8 @@ class Completions extends APIResource {
|
|
|
74625
73900
|
update(completionID, body, options) {
|
|
74626
73901
|
return this._client.post(path11`/chat/completions/${completionID}`, { body, ...options });
|
|
74627
73902
|
}
|
|
74628
|
-
list(
|
|
74629
|
-
return this._client.getAPIList("/chat/completions", CursorPage, { query, ...options });
|
|
73903
|
+
list(query2 = {}, options) {
|
|
73904
|
+
return this._client.getAPIList("/chat/completions", CursorPage, { query: query2, ...options });
|
|
74630
73905
|
}
|
|
74631
73906
|
delete(completionID, options) {
|
|
74632
73907
|
return this._client.delete(path11`/chat/completions/${completionID}`, options);
|
|
@@ -74769,8 +74044,8 @@ class Batches extends APIResource {
|
|
|
74769
74044
|
retrieve(batchID, options) {
|
|
74770
74045
|
return this._client.get(path11`/batches/${batchID}`, options);
|
|
74771
74046
|
}
|
|
74772
|
-
list(
|
|
74773
|
-
return this._client.getAPIList("/batches", CursorPage, { query, ...options });
|
|
74047
|
+
list(query2 = {}, options) {
|
|
74048
|
+
return this._client.getAPIList("/batches", CursorPage, { query: query2, ...options });
|
|
74774
74049
|
}
|
|
74775
74050
|
cancel(batchID, options) {
|
|
74776
74051
|
return this._client.post(path11`/batches/${batchID}/cancel`, options);
|
|
@@ -74798,9 +74073,9 @@ class Assistants extends APIResource {
|
|
|
74798
74073
|
headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
74799
74074
|
});
|
|
74800
74075
|
}
|
|
74801
|
-
list(
|
|
74076
|
+
list(query2 = {}, options) {
|
|
74802
74077
|
return this._client.getAPIList("/assistants", CursorPage, {
|
|
74803
|
-
query,
|
|
74078
|
+
query: query2,
|
|
74804
74079
|
...options,
|
|
74805
74080
|
headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
74806
74081
|
});
|
|
@@ -74866,9 +74141,9 @@ class Threads extends APIResource {
|
|
|
74866
74141
|
headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
|
|
74867
74142
|
});
|
|
74868
74143
|
}
|
|
74869
|
-
list(
|
|
74144
|
+
list(query2 = {}, options) {
|
|
74870
74145
|
return this._client.getAPIList("/chatkit/threads", ConversationCursorPage, {
|
|
74871
|
-
query,
|
|
74146
|
+
query: query2,
|
|
74872
74147
|
...options,
|
|
74873
74148
|
headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
|
|
74874
74149
|
});
|
|
@@ -74879,8 +74154,8 @@ class Threads extends APIResource {
|
|
|
74879
74154
|
headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
|
|
74880
74155
|
});
|
|
74881
74156
|
}
|
|
74882
|
-
listItems(threadID,
|
|
74883
|
-
return this._client.getAPIList(path11`/chatkit/threads/${threadID}/items`, ConversationCursorPage, { query, ...options, headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]) });
|
|
74157
|
+
listItems(threadID, query2 = {}, options) {
|
|
74158
|
+
return this._client.getAPIList(path11`/chatkit/threads/${threadID}/items`, ConversationCursorPage, { query: query2, ...options, headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]) });
|
|
74884
74159
|
}
|
|
74885
74160
|
}
|
|
74886
74161
|
|
|
@@ -74917,9 +74192,9 @@ class Messages2 extends APIResource {
|
|
|
74917
74192
|
headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
74918
74193
|
});
|
|
74919
74194
|
}
|
|
74920
|
-
list(threadID,
|
|
74195
|
+
list(threadID, query2 = {}, options) {
|
|
74921
74196
|
return this._client.getAPIList(path11`/threads/${threadID}/messages`, CursorPage, {
|
|
74922
|
-
query,
|
|
74197
|
+
query: query2,
|
|
74923
74198
|
...options,
|
|
74924
74199
|
headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
74925
74200
|
});
|
|
@@ -74935,17 +74210,17 @@ class Messages2 extends APIResource {
|
|
|
74935
74210
|
|
|
74936
74211
|
class Steps extends APIResource {
|
|
74937
74212
|
retrieve(stepID, params, options) {
|
|
74938
|
-
const { thread_id, run_id, ...
|
|
74213
|
+
const { thread_id, run_id, ...query2 } = params;
|
|
74939
74214
|
return this._client.get(path11`/threads/${thread_id}/runs/${run_id}/steps/${stepID}`, {
|
|
74940
|
-
query,
|
|
74215
|
+
query: query2,
|
|
74941
74216
|
...options,
|
|
74942
74217
|
headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
74943
74218
|
});
|
|
74944
74219
|
}
|
|
74945
74220
|
list(runID, params, options) {
|
|
74946
|
-
const { thread_id, ...
|
|
74221
|
+
const { thread_id, ...query2 } = params;
|
|
74947
74222
|
return this._client.getAPIList(path11`/threads/${thread_id}/runs/${runID}/steps`, CursorPage, {
|
|
74948
|
-
query,
|
|
74223
|
+
query: query2,
|
|
74949
74224
|
...options,
|
|
74950
74225
|
headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
74951
74226
|
});
|
|
@@ -75542,9 +74817,9 @@ class Runs extends APIResource {
|
|
|
75542
74817
|
headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
75543
74818
|
});
|
|
75544
74819
|
}
|
|
75545
|
-
list(threadID,
|
|
74820
|
+
list(threadID, query2 = {}, options) {
|
|
75546
74821
|
return this._client.getAPIList(path11`/threads/${threadID}/runs`, CursorPage, {
|
|
75547
|
-
query,
|
|
74822
|
+
query: query2,
|
|
75548
74823
|
...options,
|
|
75549
74824
|
headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
75550
74825
|
});
|
|
@@ -75720,9 +74995,9 @@ class Files extends APIResource {
|
|
|
75720
74995
|
const { container_id } = params;
|
|
75721
74996
|
return this._client.get(path11`/containers/${container_id}/files/${fileID}`, options);
|
|
75722
74997
|
}
|
|
75723
|
-
list(containerID,
|
|
74998
|
+
list(containerID, query2 = {}, options) {
|
|
75724
74999
|
return this._client.getAPIList(path11`/containers/${containerID}/files`, CursorPage, {
|
|
75725
|
-
query,
|
|
75000
|
+
query: query2,
|
|
75726
75001
|
...options
|
|
75727
75002
|
});
|
|
75728
75003
|
}
|
|
@@ -75747,8 +75022,8 @@ class Containers extends APIResource {
|
|
|
75747
75022
|
retrieve(containerID, options) {
|
|
75748
75023
|
return this._client.get(path11`/containers/${containerID}`, options);
|
|
75749
75024
|
}
|
|
75750
|
-
list(
|
|
75751
|
-
return this._client.getAPIList("/containers", CursorPage, { query, ...options });
|
|
75025
|
+
list(query2 = {}, options) {
|
|
75026
|
+
return this._client.getAPIList("/containers", CursorPage, { query: query2, ...options });
|
|
75752
75027
|
}
|
|
75753
75028
|
delete(containerID, options) {
|
|
75754
75029
|
return this._client.delete(path11`/containers/${containerID}`, {
|
|
@@ -75769,11 +75044,11 @@ class Items extends APIResource {
|
|
|
75769
75044
|
});
|
|
75770
75045
|
}
|
|
75771
75046
|
retrieve(itemID, params, options) {
|
|
75772
|
-
const { conversation_id, ...
|
|
75773
|
-
return this._client.get(path11`/conversations/${conversation_id}/items/${itemID}`, { query, ...options });
|
|
75047
|
+
const { conversation_id, ...query2 } = params;
|
|
75048
|
+
return this._client.get(path11`/conversations/${conversation_id}/items/${itemID}`, { query: query2, ...options });
|
|
75774
75049
|
}
|
|
75775
|
-
list(conversationID,
|
|
75776
|
-
return this._client.getAPIList(path11`/conversations/${conversationID}/items`, ConversationCursorPage, { query, ...options });
|
|
75050
|
+
list(conversationID, query2 = {}, options) {
|
|
75051
|
+
return this._client.getAPIList(path11`/conversations/${conversationID}/items`, ConversationCursorPage, { query: query2, ...options });
|
|
75777
75052
|
}
|
|
75778
75053
|
delete(itemID, params, options) {
|
|
75779
75054
|
const { conversation_id } = params;
|
|
@@ -75837,8 +75112,8 @@ class OutputItems extends APIResource {
|
|
|
75837
75112
|
return this._client.get(path11`/evals/${eval_id}/runs/${run_id}/output_items/${outputItemID}`, options);
|
|
75838
75113
|
}
|
|
75839
75114
|
list(runID, params, options) {
|
|
75840
|
-
const { eval_id, ...
|
|
75841
|
-
return this._client.getAPIList(path11`/evals/${eval_id}/runs/${runID}/output_items`, CursorPage, { query, ...options });
|
|
75115
|
+
const { eval_id, ...query2 } = params;
|
|
75116
|
+
return this._client.getAPIList(path11`/evals/${eval_id}/runs/${runID}/output_items`, CursorPage, { query: query2, ...options });
|
|
75842
75117
|
}
|
|
75843
75118
|
}
|
|
75844
75119
|
|
|
@@ -75854,9 +75129,9 @@ class Runs2 extends APIResource {
|
|
|
75854
75129
|
const { eval_id } = params;
|
|
75855
75130
|
return this._client.get(path11`/evals/${eval_id}/runs/${runID}`, options);
|
|
75856
75131
|
}
|
|
75857
|
-
list(evalID,
|
|
75132
|
+
list(evalID, query2 = {}, options) {
|
|
75858
75133
|
return this._client.getAPIList(path11`/evals/${evalID}/runs`, CursorPage, {
|
|
75859
|
-
query,
|
|
75134
|
+
query: query2,
|
|
75860
75135
|
...options
|
|
75861
75136
|
});
|
|
75862
75137
|
}
|
|
@@ -75885,8 +75160,8 @@ class Evals extends APIResource {
|
|
|
75885
75160
|
update(evalID, body, options) {
|
|
75886
75161
|
return this._client.post(path11`/evals/${evalID}`, { body, ...options });
|
|
75887
75162
|
}
|
|
75888
|
-
list(
|
|
75889
|
-
return this._client.getAPIList("/evals", CursorPage, { query, ...options });
|
|
75163
|
+
list(query2 = {}, options) {
|
|
75164
|
+
return this._client.getAPIList("/evals", CursorPage, { query: query2, ...options });
|
|
75890
75165
|
}
|
|
75891
75166
|
delete(evalID, options) {
|
|
75892
75167
|
return this._client.delete(path11`/evals/${evalID}`, options);
|
|
@@ -75901,8 +75176,8 @@ class Files2 extends APIResource {
|
|
|
75901
75176
|
retrieve(fileID, options) {
|
|
75902
75177
|
return this._client.get(path11`/files/${fileID}`, options);
|
|
75903
75178
|
}
|
|
75904
|
-
list(
|
|
75905
|
-
return this._client.getAPIList("/files", CursorPage, { query, ...options });
|
|
75179
|
+
list(query2 = {}, options) {
|
|
75180
|
+
return this._client.getAPIList("/files", CursorPage, { query: query2, ...options });
|
|
75906
75181
|
}
|
|
75907
75182
|
delete(fileID, options) {
|
|
75908
75183
|
return this._client.delete(path11`/files/${fileID}`, options);
|
|
@@ -75955,9 +75230,9 @@ class Permissions extends APIResource {
|
|
|
75955
75230
|
create(fineTunedModelCheckpoint, body, options) {
|
|
75956
75231
|
return this._client.getAPIList(path11`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, Page, { body, method: "post", ...options });
|
|
75957
75232
|
}
|
|
75958
|
-
retrieve(fineTunedModelCheckpoint,
|
|
75233
|
+
retrieve(fineTunedModelCheckpoint, query2 = {}, options) {
|
|
75959
75234
|
return this._client.get(path11`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, {
|
|
75960
|
-
query,
|
|
75235
|
+
query: query2,
|
|
75961
75236
|
...options
|
|
75962
75237
|
});
|
|
75963
75238
|
}
|
|
@@ -75976,8 +75251,8 @@ class Checkpoints extends APIResource {
|
|
|
75976
75251
|
Checkpoints.Permissions = Permissions;
|
|
75977
75252
|
|
|
75978
75253
|
class Checkpoints2 extends APIResource {
|
|
75979
|
-
list(fineTuningJobID,
|
|
75980
|
-
return this._client.getAPIList(path11`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, { query, ...options });
|
|
75254
|
+
list(fineTuningJobID, query2 = {}, options) {
|
|
75255
|
+
return this._client.getAPIList(path11`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, { query: query2, ...options });
|
|
75981
75256
|
}
|
|
75982
75257
|
}
|
|
75983
75258
|
|
|
@@ -75992,14 +75267,14 @@ class Jobs extends APIResource {
|
|
|
75992
75267
|
retrieve(fineTuningJobID, options) {
|
|
75993
75268
|
return this._client.get(path11`/fine_tuning/jobs/${fineTuningJobID}`, options);
|
|
75994
75269
|
}
|
|
75995
|
-
list(
|
|
75996
|
-
return this._client.getAPIList("/fine_tuning/jobs", CursorPage, { query, ...options });
|
|
75270
|
+
list(query2 = {}, options) {
|
|
75271
|
+
return this._client.getAPIList("/fine_tuning/jobs", CursorPage, { query: query2, ...options });
|
|
75997
75272
|
}
|
|
75998
75273
|
cancel(fineTuningJobID, options) {
|
|
75999
75274
|
return this._client.post(path11`/fine_tuning/jobs/${fineTuningJobID}/cancel`, options);
|
|
76000
75275
|
}
|
|
76001
|
-
listEvents(fineTuningJobID,
|
|
76002
|
-
return this._client.getAPIList(path11`/fine_tuning/jobs/${fineTuningJobID}/events`, CursorPage, { query, ...options });
|
|
75276
|
+
listEvents(fineTuningJobID, query2 = {}, options) {
|
|
75277
|
+
return this._client.getAPIList(path11`/fine_tuning/jobs/${fineTuningJobID}/events`, CursorPage, { query: query2, ...options });
|
|
76003
75278
|
}
|
|
76004
75279
|
pause(fineTuningJobID, options) {
|
|
76005
75280
|
return this._client.post(path11`/fine_tuning/jobs/${fineTuningJobID}/pause`, options);
|
|
@@ -76488,8 +75763,8 @@ function finalizeResponse(snapshot, params) {
|
|
|
76488
75763
|
}
|
|
76489
75764
|
|
|
76490
75765
|
class InputItems extends APIResource {
|
|
76491
|
-
list(responseID,
|
|
76492
|
-
return this._client.getAPIList(path11`/responses/${responseID}/input_items`, CursorPage, { query, ...options });
|
|
75766
|
+
list(responseID, query2 = {}, options) {
|
|
75767
|
+
return this._client.getAPIList(path11`/responses/${responseID}/input_items`, CursorPage, { query: query2, ...options });
|
|
76493
75768
|
}
|
|
76494
75769
|
}
|
|
76495
75770
|
|
|
@@ -76513,11 +75788,11 @@ class Responses extends APIResource {
|
|
|
76513
75788
|
return rsp;
|
|
76514
75789
|
});
|
|
76515
75790
|
}
|
|
76516
|
-
retrieve(responseID,
|
|
75791
|
+
retrieve(responseID, query2 = {}, options) {
|
|
76517
75792
|
return this._client.get(path11`/responses/${responseID}`, {
|
|
76518
|
-
query,
|
|
75793
|
+
query: query2,
|
|
76519
75794
|
...options,
|
|
76520
|
-
stream:
|
|
75795
|
+
stream: query2?.stream ?? false
|
|
76521
75796
|
})._thenUnwrap((rsp) => {
|
|
76522
75797
|
if ("object" in rsp && rsp.object === "response") {
|
|
76523
75798
|
addOutputText(rsp);
|
|
@@ -76611,8 +75886,8 @@ class FileBatches extends APIResource {
|
|
|
76611
75886
|
return await this.poll(vectorStoreId, batch.id, options);
|
|
76612
75887
|
}
|
|
76613
75888
|
listFiles(batchID, params, options) {
|
|
76614
|
-
const { vector_store_id, ...
|
|
76615
|
-
return this._client.getAPIList(path11`/vector_stores/${vector_store_id}/file_batches/${batchID}/files`, CursorPage, { query, ...options, headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]) });
|
|
75889
|
+
const { vector_store_id, ...query2 } = params;
|
|
75890
|
+
return this._client.getAPIList(path11`/vector_stores/${vector_store_id}/file_batches/${batchID}/files`, CursorPage, { query: query2, ...options, headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]) });
|
|
76616
75891
|
}
|
|
76617
75892
|
async poll(vectorStoreID, batchID, options) {
|
|
76618
75893
|
const headers = buildHeaders([
|
|
@@ -76696,9 +75971,9 @@ class Files3 extends APIResource {
|
|
|
76696
75971
|
headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
76697
75972
|
});
|
|
76698
75973
|
}
|
|
76699
|
-
list(vectorStoreID,
|
|
75974
|
+
list(vectorStoreID, query2 = {}, options) {
|
|
76700
75975
|
return this._client.getAPIList(path11`/vector_stores/${vectorStoreID}/files`, CursorPage, {
|
|
76701
|
-
query,
|
|
75976
|
+
query: query2,
|
|
76702
75977
|
...options,
|
|
76703
75978
|
headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
76704
75979
|
});
|
|
@@ -76789,9 +76064,9 @@ class VectorStores extends APIResource {
|
|
|
76789
76064
|
headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
76790
76065
|
});
|
|
76791
76066
|
}
|
|
76792
|
-
list(
|
|
76067
|
+
list(query2 = {}, options) {
|
|
76793
76068
|
return this._client.getAPIList("/vector_stores", CursorPage, {
|
|
76794
|
-
query,
|
|
76069
|
+
query: query2,
|
|
76795
76070
|
...options,
|
|
76796
76071
|
headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
|
|
76797
76072
|
});
|
|
@@ -76821,15 +76096,15 @@ class Videos extends APIResource {
|
|
|
76821
76096
|
retrieve(videoID, options) {
|
|
76822
76097
|
return this._client.get(path11`/videos/${videoID}`, options);
|
|
76823
76098
|
}
|
|
76824
|
-
list(
|
|
76825
|
-
return this._client.getAPIList("/videos", ConversationCursorPage, { query, ...options });
|
|
76099
|
+
list(query2 = {}, options) {
|
|
76100
|
+
return this._client.getAPIList("/videos", ConversationCursorPage, { query: query2, ...options });
|
|
76826
76101
|
}
|
|
76827
76102
|
delete(videoID, options) {
|
|
76828
76103
|
return this._client.delete(path11`/videos/${videoID}`, options);
|
|
76829
76104
|
}
|
|
76830
|
-
downloadContent(videoID,
|
|
76105
|
+
downloadContent(videoID, query2 = {}, options) {
|
|
76831
76106
|
return this._client.get(path11`/videos/${videoID}/content`, {
|
|
76832
|
-
query,
|
|
76107
|
+
query: query2,
|
|
76833
76108
|
...options,
|
|
76834
76109
|
headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]),
|
|
76835
76110
|
__binaryResponse: true
|
|
@@ -77000,8 +76275,8 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
77000
76275
|
async authHeaders(opts) {
|
|
77001
76276
|
return buildHeaders([{ Authorization: `Bearer ${this.apiKey}` }]);
|
|
77002
76277
|
}
|
|
77003
|
-
stringifyQuery(
|
|
77004
|
-
return stringify2(
|
|
76278
|
+
stringifyQuery(query2) {
|
|
76279
|
+
return stringify2(query2, { arrayFormat: "brackets" });
|
|
77005
76280
|
}
|
|
77006
76281
|
getUserAgent() {
|
|
77007
76282
|
return `${this.constructor.name}/JS ${VERSION}`;
|
|
@@ -77030,15 +76305,15 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
77030
76305
|
this.apiKey = token;
|
|
77031
76306
|
return true;
|
|
77032
76307
|
}
|
|
77033
|
-
buildURL(path22,
|
|
76308
|
+
buildURL(path22, query2, defaultBaseURL) {
|
|
77034
76309
|
const baseURL = !__classPrivateFieldGet(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
|
|
77035
76310
|
const url = isAbsoluteURL(path22) ? new URL(path22) : new URL(baseURL + (baseURL.endsWith("/") && path22.startsWith("/") ? path22.slice(1) : path22));
|
|
77036
76311
|
const defaultQuery = this.defaultQuery();
|
|
77037
76312
|
if (!isEmptyObj(defaultQuery)) {
|
|
77038
|
-
|
|
76313
|
+
query2 = { ...defaultQuery, ...query2 };
|
|
77039
76314
|
}
|
|
77040
|
-
if (typeof
|
|
77041
|
-
url.search = this.stringifyQuery(
|
|
76315
|
+
if (typeof query2 === "object" && query2 && !Array.isArray(query2)) {
|
|
76316
|
+
url.search = this.stringifyQuery(query2);
|
|
77042
76317
|
}
|
|
77043
76318
|
return url.toString();
|
|
77044
76319
|
}
|
|
@@ -77246,8 +76521,8 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
77246
76521
|
}
|
|
77247
76522
|
async buildRequest(inputOptions, { retryCount = 0 } = {}) {
|
|
77248
76523
|
const options = { ...inputOptions };
|
|
77249
|
-
const { method, path: path22, query, defaultBaseURL } = options;
|
|
77250
|
-
const url = this.buildURL(path22,
|
|
76524
|
+
const { method, path: path22, query: query2, defaultBaseURL } = options;
|
|
76525
|
+
const url = this.buildURL(path22, query2, defaultBaseURL);
|
|
77251
76526
|
if ("timeout" in options)
|
|
77252
76527
|
validatePositiveInteger("timeout", options.timeout);
|
|
77253
76528
|
options.timeout = options.timeout ?? this.timeout;
|