1 | var __defProp = Object.defineProperty;
|
2 | var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
3 | var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
4 | var __export = (target, all) => {
|
5 | __markAsModule(target);
|
6 | for (var name in all)
|
7 | __defProp(target, name, { get: all[name], enumerable: true });
|
8 | };
|
9 |
|
10 |
|
11 | __export(exports, {
|
12 | main: () => main
|
13 | });
|
14 | var __defProp2 = Object.defineProperty;
|
15 | var __name2 = __name((target, value) => __defProp2(target, "name", { value, configurable: true }), "__name");
|
16 | var __commonJS = __name((cb, mod) => __name(function __require2() {
|
17 | return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
18 | }, "__require2"), "__commonJS");
|
19 | var require_ini = __commonJS({
|
20 | "../../node_modules/.pnpm/ini@2.0.0/node_modules/ini/ini.js"(exports, module2) {
|
21 | var { hasOwnProperty } = Object.prototype;
|
22 | var eol = typeof process !== "undefined" && process.platform === "win32" ? "\r\n" : "\n";
|
23 | var encode = __name2((obj, opt) => {
|
24 | const children = [];
|
25 | let out = "";
|
26 | if (typeof opt === "string") {
|
27 | opt = {
|
28 | section: opt,
|
29 | whitespace: false
|
30 | };
|
31 | } else {
|
32 | opt = opt || Object.create(null);
|
33 | opt.whitespace = opt.whitespace === true;
|
34 | }
|
35 | const separator = opt.whitespace ? " = " : "=";
|
36 | for (const k of Object.keys(obj)) {
|
37 | const val = obj[k];
|
38 | if (val && Array.isArray(val)) {
|
39 | for (const item of val)
|
40 | out += safe(k + "[]") + separator + safe(item) + "\n";
|
41 | } else if (val && typeof val === "object")
|
42 | children.push(k);
|
43 | else
|
44 | out += safe(k) + separator + safe(val) + eol;
|
45 | }
|
46 | if (opt.section && out.length)
|
47 | out = "[" + safe(opt.section) + "]" + eol + out;
|
48 | for (const k of children) {
|
49 | const nk = dotSplit(k).join("\\.");
|
50 | const section = (opt.section ? opt.section + "." : "") + nk;
|
51 | const { whitespace } = opt;
|
52 | const child = encode(obj[k], {
|
53 | section,
|
54 | whitespace
|
55 | });
|
56 | if (out.length && child.length)
|
57 | out += eol;
|
58 | out += child;
|
59 | }
|
60 | return out;
|
61 | }, "encode");
|
62 | var dotSplit = __name2((str) => str.replace(/\1/g, "LITERAL\\1LITERAL").replace(/\\\./g, "").split(/\./).map((part) => part.replace(/\1/g, "\\.").replace(/\2LITERAL\\1LITERAL\2/g, "")), "dotSplit");
|
63 | var decode = __name2((str) => {
|
64 | const out = Object.create(null);
|
65 | let p = out;
|
66 | let section = null;
|
67 | const re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;
|
68 | const lines = str.split(/[\r\n]+/g);
|
69 | for (const line of lines) {
|
70 | if (!line || line.match(/^\s*[;#]/))
|
71 | continue;
|
72 | const match = line.match(re);
|
73 | if (!match)
|
74 | continue;
|
75 | if (match[1] !== void 0) {
|
76 | section = unsafe(match[1]);
|
77 | if (section === "__proto__") {
|
78 | p = Object.create(null);
|
79 | continue;
|
80 | }
|
81 | p = out[section] = out[section] || Object.create(null);
|
82 | continue;
|
83 | }
|
84 | const keyRaw = unsafe(match[2]);
|
85 | const isArray = keyRaw.length > 2 && keyRaw.slice(-2) === "[]";
|
86 | const key = isArray ? keyRaw.slice(0, -2) : keyRaw;
|
87 | if (key === "__proto__")
|
88 | continue;
|
89 | const valueRaw = match[3] ? unsafe(match[4]) : true;
|
90 | const value = valueRaw === "true" || valueRaw === "false" || valueRaw === "null" ? JSON.parse(valueRaw) : valueRaw;
|
91 | if (isArray) {
|
92 | if (!hasOwnProperty.call(p, key))
|
93 | p[key] = [];
|
94 | else if (!Array.isArray(p[key]))
|
95 | p[key] = [p[key]];
|
96 | }
|
97 | if (Array.isArray(p[key]))
|
98 | p[key].push(value);
|
99 | else
|
100 | p[key] = value;
|
101 | }
|
102 | const remove = [];
|
103 | for (const k of Object.keys(out)) {
|
104 | if (!hasOwnProperty.call(out, k) || typeof out[k] !== "object" || Array.isArray(out[k]))
|
105 | continue;
|
106 | const parts = dotSplit(k);
|
107 | let p2 = out;
|
108 | const l = parts.pop();
|
109 | const nl = l.replace(/\\\./g, ".");
|
110 | for (const part of parts) {
|
111 | if (part === "__proto__")
|
112 | continue;
|
113 | if (!hasOwnProperty.call(p2, part) || typeof p2[part] !== "object")
|
114 | p2[part] = Object.create(null);
|
115 | p2 = p2[part];
|
116 | }
|
117 | if (p2 === out && nl === l)
|
118 | continue;
|
119 | p2[nl] = out[k];
|
120 | remove.push(k);
|
121 | }
|
122 | for (const del of remove)
|
123 | delete out[del];
|
124 | return out;
|
125 | }, "decode");
|
126 | var isQuoted = __name2((val) => val.charAt(0) === '"' && val.slice(-1) === '"' || val.charAt(0) === "'" && val.slice(-1) === "'", "isQuoted");
|
127 | var safe = __name2((val) => typeof val !== "string" || val.match(/[=\r\n]/) || val.match(/^\[/) || val.length > 1 && isQuoted(val) || val !== val.trim() ? JSON.stringify(val) : val.replace(/;/g, "\\;").replace(/#/g, "\\#"), "safe");
|
128 | var unsafe = __name2((val, doUnesc) => {
|
129 | val = (val || "").trim();
|
130 | if (isQuoted(val)) {
|
131 | if (val.charAt(0) === "'")
|
132 | val = val.substr(1, val.length - 2);
|
133 | try {
|
134 | val = JSON.parse(val);
|
135 | } catch (_) {
|
136 | }
|
137 | } else {
|
138 | let esc = false;
|
139 | let unesc = "";
|
140 | for (let i = 0, l = val.length; i < l; i++) {
|
141 | const c = val.charAt(i);
|
142 | if (esc) {
|
143 | if ("\\;#".indexOf(c) !== -1)
|
144 | unesc += c;
|
145 | else
|
146 | unesc += "\\" + c;
|
147 | esc = false;
|
148 | } else if (";#".indexOf(c) !== -1)
|
149 | break;
|
150 | else if (c === "\\")
|
151 | esc = true;
|
152 | else
|
153 | unesc += c;
|
154 | }
|
155 | if (esc)
|
156 | unesc += "\\";
|
157 | return unesc.trim();
|
158 | }
|
159 | return val;
|
160 | }, "unsafe");
|
161 | module2.exports = {
|
162 | parse: decode,
|
163 | decode,
|
164 | stringify: encode,
|
165 | encode,
|
166 | safe,
|
167 | unsafe
|
168 | };
|
169 | }
|
170 | });
|
171 | var require_global_dirs = __commonJS({
|
172 | "../../node_modules/.pnpm/global-dirs@3.0.0/node_modules/global-dirs/index.js"(exports) {
|
173 | "use strict";
|
174 | var path2 = require("path");
|
175 | var os = require("os");
|
176 | var fs = require("fs");
|
177 | var ini = require_ini();
|
178 | var isWindows = process.platform === "win32";
|
179 | var readRc = __name2((filePath) => {
|
180 | try {
|
181 | return ini.parse(fs.readFileSync(filePath, "utf8")).prefix;
|
182 | } catch (e) {
|
183 | }
|
184 | }, "readRc");
|
185 | var getEnvNpmPrefix = __name2(() => {
|
186 | return Object.keys(process.env).reduce((prefix, name) => {
|
187 | return /^npm_config_prefix$/i.test(name) ? process.env[name] : prefix;
|
188 | }, void 0);
|
189 | }, "getEnvNpmPrefix");
|
190 | var getGlobalNpmrc = __name2(() => {
|
191 | if (isWindows && process.env.APPDATA) {
|
192 | return path2.join(process.env.APPDATA, "/npm/etc/npmrc");
|
193 | }
|
194 | if (process.execPath.includes("/Cellar/node")) {
|
195 | const homebrewPrefix = process.execPath.slice(0, process.execPath.indexOf("/Cellar/node"));
|
196 | return path2.join(homebrewPrefix, "/lib/node_modules/npm/npmrc");
|
197 | }
|
198 | if (process.execPath.endsWith("/bin/node")) {
|
199 | const installDir = path2.dirname(path2.dirname(process.execPath));
|
200 | return path2.join(installDir, "/etc/npmrc");
|
201 | }
|
202 | }, "getGlobalNpmrc");
|
203 | var getDefaultNpmPrefix = __name2(() => {
|
204 | if (isWindows) {
|
205 | return path2.dirname(process.execPath);
|
206 | }
|
207 | return path2.dirname(path2.dirname(process.execPath));
|
208 | }, "getDefaultNpmPrefix");
|
209 | var getNpmPrefix = __name2(() => {
|
210 | const envPrefix = getEnvNpmPrefix();
|
211 | if (envPrefix) {
|
212 | return envPrefix;
|
213 | }
|
214 | const homePrefix = readRc(path2.join(os.homedir(), ".npmrc"));
|
215 | if (homePrefix) {
|
216 | return homePrefix;
|
217 | }
|
218 | if (process.env.PREFIX) {
|
219 | return process.env.PREFIX;
|
220 | }
|
221 | const globalPrefix = readRc(getGlobalNpmrc());
|
222 | if (globalPrefix) {
|
223 | return globalPrefix;
|
224 | }
|
225 | return getDefaultNpmPrefix();
|
226 | }, "getNpmPrefix");
|
227 | var npmPrefix = path2.resolve(getNpmPrefix());
|
228 | var getYarnWindowsDirectory = __name2(() => {
|
229 | if (isWindows && process.env.LOCALAPPDATA) {
|
230 | const dir = path2.join(process.env.LOCALAPPDATA, "Yarn");
|
231 | if (fs.existsSync(dir)) {
|
232 | return dir;
|
233 | }
|
234 | }
|
235 | return false;
|
236 | }, "getYarnWindowsDirectory");
|
237 | var getYarnPrefix = __name2(() => {
|
238 | if (process.env.PREFIX) {
|
239 | return process.env.PREFIX;
|
240 | }
|
241 | const windowsPrefix = getYarnWindowsDirectory();
|
242 | if (windowsPrefix) {
|
243 | return windowsPrefix;
|
244 | }
|
245 | const configPrefix = path2.join(os.homedir(), ".config/yarn");
|
246 | if (fs.existsSync(configPrefix)) {
|
247 | return configPrefix;
|
248 | }
|
249 | const homePrefix = path2.join(os.homedir(), ".yarn-config");
|
250 | if (fs.existsSync(homePrefix)) {
|
251 | return homePrefix;
|
252 | }
|
253 | return npmPrefix;
|
254 | }, "getYarnPrefix");
|
255 | exports.npm = {};
|
256 | exports.npm.prefix = npmPrefix;
|
257 | exports.npm.packages = path2.join(npmPrefix, isWindows ? "node_modules" : "lib/node_modules");
|
258 | exports.npm.binaries = isWindows ? npmPrefix : path2.join(npmPrefix, "bin");
|
259 | var yarnPrefix = path2.resolve(getYarnPrefix());
|
260 | exports.yarn = {};
|
261 | exports.yarn.prefix = yarnPrefix;
|
262 | exports.yarn.packages = path2.join(yarnPrefix, getYarnWindowsDirectory() ? "Data/global/node_modules" : "global/node_modules");
|
263 | exports.yarn.binaries = path2.join(exports.yarn.packages, ".bin");
|
264 | }
|
265 | });
|
266 | var require_color_name = __commonJS({
|
267 | "../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"(exports, module2) {
|
268 | "use strict";
|
269 | module2.exports = {
|
270 | "aliceblue": [240, 248, 255],
|
271 | "antiquewhite": [250, 235, 215],
|
272 | "aqua": [0, 255, 255],
|
273 | "aquamarine": [127, 255, 212],
|
274 | "azure": [240, 255, 255],
|
275 | "beige": [245, 245, 220],
|
276 | "bisque": [255, 228, 196],
|
277 | "black": [0, 0, 0],
|
278 | "blanchedalmond": [255, 235, 205],
|
279 | "blue": [0, 0, 255],
|
280 | "blueviolet": [138, 43, 226],
|
281 | "brown": [165, 42, 42],
|
282 | "burlywood": [222, 184, 135],
|
283 | "cadetblue": [95, 158, 160],
|
284 | "chartreuse": [127, 255, 0],
|
285 | "chocolate": [210, 105, 30],
|
286 | "coral": [255, 127, 80],
|
287 | "cornflowerblue": [100, 149, 237],
|
288 | "cornsilk": [255, 248, 220],
|
289 | "crimson": [220, 20, 60],
|
290 | "cyan": [0, 255, 255],
|
291 | "darkblue": [0, 0, 139],
|
292 | "darkcyan": [0, 139, 139],
|
293 | "darkgoldenrod": [184, 134, 11],
|
294 | "darkgray": [169, 169, 169],
|
295 | "darkgreen": [0, 100, 0],
|
296 | "darkgrey": [169, 169, 169],
|
297 | "darkkhaki": [189, 183, 107],
|
298 | "darkmagenta": [139, 0, 139],
|
299 | "darkolivegreen": [85, 107, 47],
|
300 | "darkorange": [255, 140, 0],
|
301 | "darkorchid": [153, 50, 204],
|
302 | "darkred": [139, 0, 0],
|
303 | "darksalmon": [233, 150, 122],
|
304 | "darkseagreen": [143, 188, 143],
|
305 | "darkslateblue": [72, 61, 139],
|
306 | "darkslategray": [47, 79, 79],
|
307 | "darkslategrey": [47, 79, 79],
|
308 | "darkturquoise": [0, 206, 209],
|
309 | "darkviolet": [148, 0, 211],
|
310 | "deeppink": [255, 20, 147],
|
311 | "deepskyblue": [0, 191, 255],
|
312 | "dimgray": [105, 105, 105],
|
313 | "dimgrey": [105, 105, 105],
|
314 | "dodgerblue": [30, 144, 255],
|
315 | "firebrick": [178, 34, 34],
|
316 | "floralwhite": [255, 250, 240],
|
317 | "forestgreen": [34, 139, 34],
|
318 | "fuchsia": [255, 0, 255],
|
319 | "gainsboro": [220, 220, 220],
|
320 | "ghostwhite": [248, 248, 255],
|
321 | "gold": [255, 215, 0],
|
322 | "goldenrod": [218, 165, 32],
|
323 | "gray": [128, 128, 128],
|
324 | "green": [0, 128, 0],
|
325 | "greenyellow": [173, 255, 47],
|
326 | "grey": [128, 128, 128],
|
327 | "honeydew": [240, 255, 240],
|
328 | "hotpink": [255, 105, 180],
|
329 | "indianred": [205, 92, 92],
|
330 | "indigo": [75, 0, 130],
|
331 | "ivory": [255, 255, 240],
|
332 | "khaki": [240, 230, 140],
|
333 | "lavender": [230, 230, 250],
|
334 | "lavenderblush": [255, 240, 245],
|
335 | "lawngreen": [124, 252, 0],
|
336 | "lemonchiffon": [255, 250, 205],
|
337 | "lightblue": [173, 216, 230],
|
338 | "lightcoral": [240, 128, 128],
|
339 | "lightcyan": [224, 255, 255],
|
340 | "lightgoldenrodyellow": [250, 250, 210],
|
341 | "lightgray": [211, 211, 211],
|
342 | "lightgreen": [144, 238, 144],
|
343 | "lightgrey": [211, 211, 211],
|
344 | "lightpink": [255, 182, 193],
|
345 | "lightsalmon": [255, 160, 122],
|
346 | "lightseagreen": [32, 178, 170],
|
347 | "lightskyblue": [135, 206, 250],
|
348 | "lightslategray": [119, 136, 153],
|
349 | "lightslategrey": [119, 136, 153],
|
350 | "lightsteelblue": [176, 196, 222],
|
351 | "lightyellow": [255, 255, 224],
|
352 | "lime": [0, 255, 0],
|
353 | "limegreen": [50, 205, 50],
|
354 | "linen": [250, 240, 230],
|
355 | "magenta": [255, 0, 255],
|
356 | "maroon": [128, 0, 0],
|
357 | "mediumaquamarine": [102, 205, 170],
|
358 | "mediumblue": [0, 0, 205],
|
359 | "mediumorchid": [186, 85, 211],
|
360 | "mediumpurple": [147, 112, 219],
|
361 | "mediumseagreen": [60, 179, 113],
|
362 | "mediumslateblue": [123, 104, 238],
|
363 | "mediumspringgreen": [0, 250, 154],
|
364 | "mediumturquoise": [72, 209, 204],
|
365 | "mediumvioletred": [199, 21, 133],
|
366 | "midnightblue": [25, 25, 112],
|
367 | "mintcream": [245, 255, 250],
|
368 | "mistyrose": [255, 228, 225],
|
369 | "moccasin": [255, 228, 181],
|
370 | "navajowhite": [255, 222, 173],
|
371 | "navy": [0, 0, 128],
|
372 | "oldlace": [253, 245, 230],
|
373 | "olive": [128, 128, 0],
|
374 | "olivedrab": [107, 142, 35],
|
375 | "orange": [255, 165, 0],
|
376 | "orangered": [255, 69, 0],
|
377 | "orchid": [218, 112, 214],
|
378 | "palegoldenrod": [238, 232, 170],
|
379 | "palegreen": [152, 251, 152],
|
380 | "paleturquoise": [175, 238, 238],
|
381 | "palevioletred": [219, 112, 147],
|
382 | "papayawhip": [255, 239, 213],
|
383 | "peachpuff": [255, 218, 185],
|
384 | "peru": [205, 133, 63],
|
385 | "pink": [255, 192, 203],
|
386 | "plum": [221, 160, 221],
|
387 | "powderblue": [176, 224, 230],
|
388 | "purple": [128, 0, 128],
|
389 | "rebeccapurple": [102, 51, 153],
|
390 | "red": [255, 0, 0],
|
391 | "rosybrown": [188, 143, 143],
|
392 | "royalblue": [65, 105, 225],
|
393 | "saddlebrown": [139, 69, 19],
|
394 | "salmon": [250, 128, 114],
|
395 | "sandybrown": [244, 164, 96],
|
396 | "seagreen": [46, 139, 87],
|
397 | "seashell": [255, 245, 238],
|
398 | "sienna": [160, 82, 45],
|
399 | "silver": [192, 192, 192],
|
400 | "skyblue": [135, 206, 235],
|
401 | "slateblue": [106, 90, 205],
|
402 | "slategray": [112, 128, 144],
|
403 | "slategrey": [112, 128, 144],
|
404 | "snow": [255, 250, 250],
|
405 | "springgreen": [0, 255, 127],
|
406 | "steelblue": [70, 130, 180],
|
407 | "tan": [210, 180, 140],
|
408 | "teal": [0, 128, 128],
|
409 | "thistle": [216, 191, 216],
|
410 | "tomato": [255, 99, 71],
|
411 | "turquoise": [64, 224, 208],
|
412 | "violet": [238, 130, 238],
|
413 | "wheat": [245, 222, 179],
|
414 | "white": [255, 255, 255],
|
415 | "whitesmoke": [245, 245, 245],
|
416 | "yellow": [255, 255, 0],
|
417 | "yellowgreen": [154, 205, 50]
|
418 | };
|
419 | }
|
420 | });
|
421 | var require_conversions = __commonJS({
|
422 | "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"(exports, module2) {
|
423 | var cssKeywords = require_color_name();
|
424 | var reverseKeywords = {};
|
425 | for (const key of Object.keys(cssKeywords)) {
|
426 | reverseKeywords[cssKeywords[key]] = key;
|
427 | }
|
428 | var convert = {
|
429 | rgb: { channels: 3, labels: "rgb" },
|
430 | hsl: { channels: 3, labels: "hsl" },
|
431 | hsv: { channels: 3, labels: "hsv" },
|
432 | hwb: { channels: 3, labels: "hwb" },
|
433 | cmyk: { channels: 4, labels: "cmyk" },
|
434 | xyz: { channels: 3, labels: "xyz" },
|
435 | lab: { channels: 3, labels: "lab" },
|
436 | lch: { channels: 3, labels: "lch" },
|
437 | hex: { channels: 1, labels: ["hex"] },
|
438 | keyword: { channels: 1, labels: ["keyword"] },
|
439 | ansi16: { channels: 1, labels: ["ansi16"] },
|
440 | ansi256: { channels: 1, labels: ["ansi256"] },
|
441 | hcg: { channels: 3, labels: ["h", "c", "g"] },
|
442 | apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
443 | gray: { channels: 1, labels: ["gray"] }
|
444 | };
|
445 | module2.exports = convert;
|
446 | for (const model of Object.keys(convert)) {
|
447 | if (!("channels" in convert[model])) {
|
448 | throw new Error("missing channels property: " + model);
|
449 | }
|
450 | if (!("labels" in convert[model])) {
|
451 | throw new Error("missing channel labels property: " + model);
|
452 | }
|
453 | if (convert[model].labels.length !== convert[model].channels) {
|
454 | throw new Error("channel and label counts mismatch: " + model);
|
455 | }
|
456 | const { channels, labels } = convert[model];
|
457 | delete convert[model].channels;
|
458 | delete convert[model].labels;
|
459 | Object.defineProperty(convert[model], "channels", { value: channels });
|
460 | Object.defineProperty(convert[model], "labels", { value: labels });
|
461 | }
|
462 | convert.rgb.hsl = function(rgb) {
|
463 | const r = rgb[0] / 255;
|
464 | const g = rgb[1] / 255;
|
465 | const b2 = rgb[2] / 255;
|
466 | const min = Math.min(r, g, b2);
|
467 | const max = Math.max(r, g, b2);
|
468 | const delta = max - min;
|
469 | let h;
|
470 | let s;
|
471 | if (max === min) {
|
472 | h = 0;
|
473 | } else if (r === max) {
|
474 | h = (g - b2) / delta;
|
475 | } else if (g === max) {
|
476 | h = 2 + (b2 - r) / delta;
|
477 | } else if (b2 === max) {
|
478 | h = 4 + (r - g) / delta;
|
479 | }
|
480 | h = Math.min(h * 60, 360);
|
481 | if (h < 0) {
|
482 | h += 360;
|
483 | }
|
484 | const l = (min + max) / 2;
|
485 | if (max === min) {
|
486 | s = 0;
|
487 | } else if (l <= 0.5) {
|
488 | s = delta / (max + min);
|
489 | } else {
|
490 | s = delta / (2 - max - min);
|
491 | }
|
492 | return [h, s * 100, l * 100];
|
493 | };
|
494 | convert.rgb.hsv = function(rgb) {
|
495 | let rdif;
|
496 | let gdif;
|
497 | let bdif;
|
498 | let h;
|
499 | let s;
|
500 | const r = rgb[0] / 255;
|
501 | const g = rgb[1] / 255;
|
502 | const b2 = rgb[2] / 255;
|
503 | const v = Math.max(r, g, b2);
|
504 | const diff = v - Math.min(r, g, b2);
|
505 | const diffc = __name2(function(c) {
|
506 | return (v - c) / 6 / diff + 1 / 2;
|
507 | }, "diffc");
|
508 | if (diff === 0) {
|
509 | h = 0;
|
510 | s = 0;
|
511 | } else {
|
512 | s = diff / v;
|
513 | rdif = diffc(r);
|
514 | gdif = diffc(g);
|
515 | bdif = diffc(b2);
|
516 | if (r === v) {
|
517 | h = bdif - gdif;
|
518 | } else if (g === v) {
|
519 | h = 1 / 3 + rdif - bdif;
|
520 | } else if (b2 === v) {
|
521 | h = 2 / 3 + gdif - rdif;
|
522 | }
|
523 | if (h < 0) {
|
524 | h += 1;
|
525 | } else if (h > 1) {
|
526 | h -= 1;
|
527 | }
|
528 | }
|
529 | return [
|
530 | h * 360,
|
531 | s * 100,
|
532 | v * 100
|
533 | ];
|
534 | };
|
535 | convert.rgb.hwb = function(rgb) {
|
536 | const r = rgb[0];
|
537 | const g = rgb[1];
|
538 | let b2 = rgb[2];
|
539 | const h = convert.rgb.hsl(rgb)[0];
|
540 | const w = 1 / 255 * Math.min(r, Math.min(g, b2));
|
541 | b2 = 1 - 1 / 255 * Math.max(r, Math.max(g, b2));
|
542 | return [h, w * 100, b2 * 100];
|
543 | };
|
544 | convert.rgb.cmyk = function(rgb) {
|
545 | const r = rgb[0] / 255;
|
546 | const g = rgb[1] / 255;
|
547 | const b2 = rgb[2] / 255;
|
548 | const k = Math.min(1 - r, 1 - g, 1 - b2);
|
549 | const c = (1 - r - k) / (1 - k) || 0;
|
550 | const m = (1 - g - k) / (1 - k) || 0;
|
551 | const y = (1 - b2 - k) / (1 - k) || 0;
|
552 | return [c * 100, m * 100, y * 100, k * 100];
|
553 | };
|
554 | function comparativeDistance(x, y) {
|
555 | return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
556 | }
|
557 | __name(comparativeDistance, "comparativeDistance");
|
558 | __name2(comparativeDistance, "comparativeDistance");
|
559 | convert.rgb.keyword = function(rgb) {
|
560 | const reversed = reverseKeywords[rgb];
|
561 | if (reversed) {
|
562 | return reversed;
|
563 | }
|
564 | let currentClosestDistance = Infinity;
|
565 | let currentClosestKeyword;
|
566 | for (const keyword of Object.keys(cssKeywords)) {
|
567 | const value = cssKeywords[keyword];
|
568 | const distance = comparativeDistance(rgb, value);
|
569 | if (distance < currentClosestDistance) {
|
570 | currentClosestDistance = distance;
|
571 | currentClosestKeyword = keyword;
|
572 | }
|
573 | }
|
574 | return currentClosestKeyword;
|
575 | };
|
576 | convert.keyword.rgb = function(keyword) {
|
577 | return cssKeywords[keyword];
|
578 | };
|
579 | convert.rgb.xyz = function(rgb) {
|
580 | let r = rgb[0] / 255;
|
581 | let g = rgb[1] / 255;
|
582 | let b2 = rgb[2] / 255;
|
583 | r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
584 | g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
585 | b2 = b2 > 0.04045 ? ((b2 + 0.055) / 1.055) ** 2.4 : b2 / 12.92;
|
586 | const x = r * 0.4124 + g * 0.3576 + b2 * 0.1805;
|
587 | const y = r * 0.2126 + g * 0.7152 + b2 * 0.0722;
|
588 | const z = r * 0.0193 + g * 0.1192 + b2 * 0.9505;
|
589 | return [x * 100, y * 100, z * 100];
|
590 | };
|
591 | convert.rgb.lab = function(rgb) {
|
592 | const xyz = convert.rgb.xyz(rgb);
|
593 | let x = xyz[0];
|
594 | let y = xyz[1];
|
595 | let z = xyz[2];
|
596 | x /= 95.047;
|
597 | y /= 100;
|
598 | z /= 108.883;
|
599 | x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
600 | y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
601 | z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
602 | const l = 116 * y - 16;
|
603 | const a = 500 * (x - y);
|
604 | const b2 = 200 * (y - z);
|
605 | return [l, a, b2];
|
606 | };
|
607 | convert.hsl.rgb = function(hsl) {
|
608 | const h = hsl[0] / 360;
|
609 | const s = hsl[1] / 100;
|
610 | const l = hsl[2] / 100;
|
611 | let t2;
|
612 | let t3;
|
613 | let val;
|
614 | if (s === 0) {
|
615 | val = l * 255;
|
616 | return [val, val, val];
|
617 | }
|
618 | if (l < 0.5) {
|
619 | t2 = l * (1 + s);
|
620 | } else {
|
621 | t2 = l + s - l * s;
|
622 | }
|
623 | const t1 = 2 * l - t2;
|
624 | const rgb = [0, 0, 0];
|
625 | for (let i = 0; i < 3; i++) {
|
626 | t3 = h + 1 / 3 * -(i - 1);
|
627 | if (t3 < 0) {
|
628 | t3++;
|
629 | }
|
630 | if (t3 > 1) {
|
631 | t3--;
|
632 | }
|
633 | if (6 * t3 < 1) {
|
634 | val = t1 + (t2 - t1) * 6 * t3;
|
635 | } else if (2 * t3 < 1) {
|
636 | val = t2;
|
637 | } else if (3 * t3 < 2) {
|
638 | val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
639 | } else {
|
640 | val = t1;
|
641 | }
|
642 | rgb[i] = val * 255;
|
643 | }
|
644 | return rgb;
|
645 | };
|
646 | convert.hsl.hsv = function(hsl) {
|
647 | const h = hsl[0];
|
648 | let s = hsl[1] / 100;
|
649 | let l = hsl[2] / 100;
|
650 | let smin = s;
|
651 | const lmin = Math.max(l, 0.01);
|
652 | l *= 2;
|
653 | s *= l <= 1 ? l : 2 - l;
|
654 | smin *= lmin <= 1 ? lmin : 2 - lmin;
|
655 | const v = (l + s) / 2;
|
656 | const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
657 | return [h, sv * 100, v * 100];
|
658 | };
|
659 | convert.hsv.rgb = function(hsv) {
|
660 | const h = hsv[0] / 60;
|
661 | const s = hsv[1] / 100;
|
662 | let v = hsv[2] / 100;
|
663 | const hi = Math.floor(h) % 6;
|
664 | const f = h - Math.floor(h);
|
665 | const p = 255 * v * (1 - s);
|
666 | const q = 255 * v * (1 - s * f);
|
667 | const t = 255 * v * (1 - s * (1 - f));
|
668 | v *= 255;
|
669 | switch (hi) {
|
670 | case 0:
|
671 | return [v, t, p];
|
672 | case 1:
|
673 | return [q, v, p];
|
674 | case 2:
|
675 | return [p, v, t];
|
676 | case 3:
|
677 | return [p, q, v];
|
678 | case 4:
|
679 | return [t, p, v];
|
680 | case 5:
|
681 | return [v, p, q];
|
682 | }
|
683 | };
|
684 | convert.hsv.hsl = function(hsv) {
|
685 | const h = hsv[0];
|
686 | const s = hsv[1] / 100;
|
687 | const v = hsv[2] / 100;
|
688 | const vmin = Math.max(v, 0.01);
|
689 | let sl;
|
690 | let l;
|
691 | l = (2 - s) * v;
|
692 | const lmin = (2 - s) * vmin;
|
693 | sl = s * vmin;
|
694 | sl /= lmin <= 1 ? lmin : 2 - lmin;
|
695 | sl = sl || 0;
|
696 | l /= 2;
|
697 | return [h, sl * 100, l * 100];
|
698 | };
|
699 | convert.hwb.rgb = function(hwb) {
|
700 | const h = hwb[0] / 360;
|
701 | let wh = hwb[1] / 100;
|
702 | let bl = hwb[2] / 100;
|
703 | const ratio = wh + bl;
|
704 | let f;
|
705 | if (ratio > 1) {
|
706 | wh /= ratio;
|
707 | bl /= ratio;
|
708 | }
|
709 | const i = Math.floor(6 * h);
|
710 | const v = 1 - bl;
|
711 | f = 6 * h - i;
|
712 | if ((i & 1) !== 0) {
|
713 | f = 1 - f;
|
714 | }
|
715 | const n = wh + f * (v - wh);
|
716 | let r;
|
717 | let g;
|
718 | let b2;
|
719 | switch (i) {
|
720 | default:
|
721 | case 6:
|
722 | case 0:
|
723 | r = v;
|
724 | g = n;
|
725 | b2 = wh;
|
726 | break;
|
727 | case 1:
|
728 | r = n;
|
729 | g = v;
|
730 | b2 = wh;
|
731 | break;
|
732 | case 2:
|
733 | r = wh;
|
734 | g = v;
|
735 | b2 = n;
|
736 | break;
|
737 | case 3:
|
738 | r = wh;
|
739 | g = n;
|
740 | b2 = v;
|
741 | break;
|
742 | case 4:
|
743 | r = n;
|
744 | g = wh;
|
745 | b2 = v;
|
746 | break;
|
747 | case 5:
|
748 | r = v;
|
749 | g = wh;
|
750 | b2 = n;
|
751 | break;
|
752 | }
|
753 | return [r * 255, g * 255, b2 * 255];
|
754 | };
|
755 | convert.cmyk.rgb = function(cmyk) {
|
756 | const c = cmyk[0] / 100;
|
757 | const m = cmyk[1] / 100;
|
758 | const y = cmyk[2] / 100;
|
759 | const k = cmyk[3] / 100;
|
760 | const r = 1 - Math.min(1, c * (1 - k) + k);
|
761 | const g = 1 - Math.min(1, m * (1 - k) + k);
|
762 | const b2 = 1 - Math.min(1, y * (1 - k) + k);
|
763 | return [r * 255, g * 255, b2 * 255];
|
764 | };
|
765 | convert.xyz.rgb = function(xyz) {
|
766 | const x = xyz[0] / 100;
|
767 | const y = xyz[1] / 100;
|
768 | const z = xyz[2] / 100;
|
769 | let r;
|
770 | let g;
|
771 | let b2;
|
772 | r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
773 | g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
774 | b2 = x * 0.0557 + y * -0.204 + z * 1.057;
|
775 | r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
|
776 | g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
777 | b2 = b2 > 31308e-7 ? 1.055 * b2 ** (1 / 2.4) - 0.055 : b2 * 12.92;
|
778 | r = Math.min(Math.max(0, r), 1);
|
779 | g = Math.min(Math.max(0, g), 1);
|
780 | b2 = Math.min(Math.max(0, b2), 1);
|
781 | return [r * 255, g * 255, b2 * 255];
|
782 | };
|
783 | convert.xyz.lab = function(xyz) {
|
784 | let x = xyz[0];
|
785 | let y = xyz[1];
|
786 | let z = xyz[2];
|
787 | x /= 95.047;
|
788 | y /= 100;
|
789 | z /= 108.883;
|
790 | x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
791 | y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
792 | z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
793 | const l = 116 * y - 16;
|
794 | const a = 500 * (x - y);
|
795 | const b2 = 200 * (y - z);
|
796 | return [l, a, b2];
|
797 | };
|
798 | convert.lab.xyz = function(lab) {
|
799 | const l = lab[0];
|
800 | const a = lab[1];
|
801 | const b2 = lab[2];
|
802 | let x;
|
803 | let y;
|
804 | let z;
|
805 | y = (l + 16) / 116;
|
806 | x = a / 500 + y;
|
807 | z = y - b2 / 200;
|
808 | const y2 = y ** 3;
|
809 | const x2 = x ** 3;
|
810 | const z2 = z ** 3;
|
811 | y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
|
812 | x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
|
813 | z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
|
814 | x *= 95.047;
|
815 | y *= 100;
|
816 | z *= 108.883;
|
817 | return [x, y, z];
|
818 | };
|
819 | convert.lab.lch = function(lab) {
|
820 | const l = lab[0];
|
821 | const a = lab[1];
|
822 | const b2 = lab[2];
|
823 | let h;
|
824 | const hr = Math.atan2(b2, a);
|
825 | h = hr * 360 / 2 / Math.PI;
|
826 | if (h < 0) {
|
827 | h += 360;
|
828 | }
|
829 | const c = Math.sqrt(a * a + b2 * b2);
|
830 | return [l, c, h];
|
831 | };
|
832 | convert.lch.lab = function(lch) {
|
833 | const l = lch[0];
|
834 | const c = lch[1];
|
835 | const h = lch[2];
|
836 | const hr = h / 360 * 2 * Math.PI;
|
837 | const a = c * Math.cos(hr);
|
838 | const b2 = c * Math.sin(hr);
|
839 | return [l, a, b2];
|
840 | };
|
841 | convert.rgb.ansi16 = function(args, saturation = null) {
|
842 | const [r, g, b2] = args;
|
843 | let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
844 | value = Math.round(value / 50);
|
845 | if (value === 0) {
|
846 | return 30;
|
847 | }
|
848 | let ansi = 30 + (Math.round(b2 / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
849 | if (value === 2) {
|
850 | ansi += 60;
|
851 | }
|
852 | return ansi;
|
853 | };
|
854 | convert.hsv.ansi16 = function(args) {
|
855 | return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
856 | };
|
857 | convert.rgb.ansi256 = function(args) {
|
858 | const r = args[0];
|
859 | const g = args[1];
|
860 | const b2 = args[2];
|
861 | if (r === g && g === b2) {
|
862 | if (r < 8) {
|
863 | return 16;
|
864 | }
|
865 | if (r > 248) {
|
866 | return 231;
|
867 | }
|
868 | return Math.round((r - 8) / 247 * 24) + 232;
|
869 | }
|
870 | const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b2 / 255 * 5);
|
871 | return ansi;
|
872 | };
|
873 | convert.ansi16.rgb = function(args) {
|
874 | let color = args % 10;
|
875 | if (color === 0 || color === 7) {
|
876 | if (args > 50) {
|
877 | color += 3.5;
|
878 | }
|
879 | color = color / 10.5 * 255;
|
880 | return [color, color, color];
|
881 | }
|
882 | const mult = (~~(args > 50) + 1) * 0.5;
|
883 | const r = (color & 1) * mult * 255;
|
884 | const g = (color >> 1 & 1) * mult * 255;
|
885 | const b2 = (color >> 2 & 1) * mult * 255;
|
886 | return [r, g, b2];
|
887 | };
|
888 | convert.ansi256.rgb = function(args) {
|
889 | if (args >= 232) {
|
890 | const c = (args - 232) * 10 + 8;
|
891 | return [c, c, c];
|
892 | }
|
893 | args -= 16;
|
894 | let rem;
|
895 | const r = Math.floor(args / 36) / 5 * 255;
|
896 | const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
897 | const b2 = rem % 6 / 5 * 255;
|
898 | return [r, g, b2];
|
899 | };
|
900 | convert.rgb.hex = function(args) {
|
901 | const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
902 | const string = integer.toString(16).toUpperCase();
|
903 | return "000000".substring(string.length) + string;
|
904 | };
|
905 | convert.hex.rgb = function(args) {
|
906 | const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
907 | if (!match) {
|
908 | return [0, 0, 0];
|
909 | }
|
910 | let colorString = match[0];
|
911 | if (match[0].length === 3) {
|
912 | colorString = colorString.split("").map((char) => {
|
913 | return char + char;
|
914 | }).join("");
|
915 | }
|
916 | const integer = parseInt(colorString, 16);
|
917 | const r = integer >> 16 & 255;
|
918 | const g = integer >> 8 & 255;
|
919 | const b2 = integer & 255;
|
920 | return [r, g, b2];
|
921 | };
|
922 | convert.rgb.hcg = function(rgb) {
|
923 | const r = rgb[0] / 255;
|
924 | const g = rgb[1] / 255;
|
925 | const b2 = rgb[2] / 255;
|
926 | const max = Math.max(Math.max(r, g), b2);
|
927 | const min = Math.min(Math.min(r, g), b2);
|
928 | const chroma = max - min;
|
929 | let grayscale;
|
930 | let hue;
|
931 | if (chroma < 1) {
|
932 | grayscale = min / (1 - chroma);
|
933 | } else {
|
934 | grayscale = 0;
|
935 | }
|
936 | if (chroma <= 0) {
|
937 | hue = 0;
|
938 | } else if (max === r) {
|
939 | hue = (g - b2) / chroma % 6;
|
940 | } else if (max === g) {
|
941 | hue = 2 + (b2 - r) / chroma;
|
942 | } else {
|
943 | hue = 4 + (r - g) / chroma;
|
944 | }
|
945 | hue /= 6;
|
946 | hue %= 1;
|
947 | return [hue * 360, chroma * 100, grayscale * 100];
|
948 | };
|
949 | convert.hsl.hcg = function(hsl) {
|
950 | const s = hsl[1] / 100;
|
951 | const l = hsl[2] / 100;
|
952 | const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
953 | let f = 0;
|
954 | if (c < 1) {
|
955 | f = (l - 0.5 * c) / (1 - c);
|
956 | }
|
957 | return [hsl[0], c * 100, f * 100];
|
958 | };
|
959 | convert.hsv.hcg = function(hsv) {
|
960 | const s = hsv[1] / 100;
|
961 | const v = hsv[2] / 100;
|
962 | const c = s * v;
|
963 | let f = 0;
|
964 | if (c < 1) {
|
965 | f = (v - c) / (1 - c);
|
966 | }
|
967 | return [hsv[0], c * 100, f * 100];
|
968 | };
|
969 | convert.hcg.rgb = function(hcg) {
|
970 | const h = hcg[0] / 360;
|
971 | const c = hcg[1] / 100;
|
972 | const g = hcg[2] / 100;
|
973 | if (c === 0) {
|
974 | return [g * 255, g * 255, g * 255];
|
975 | }
|
976 | const pure = [0, 0, 0];
|
977 | const hi = h % 1 * 6;
|
978 | const v = hi % 1;
|
979 | const w = 1 - v;
|
980 | let mg = 0;
|
981 | switch (Math.floor(hi)) {
|
982 | case 0:
|
983 | pure[0] = 1;
|
984 | pure[1] = v;
|
985 | pure[2] = 0;
|
986 | break;
|
987 | case 1:
|
988 | pure[0] = w;
|
989 | pure[1] = 1;
|
990 | pure[2] = 0;
|
991 | break;
|
992 | case 2:
|
993 | pure[0] = 0;
|
994 | pure[1] = 1;
|
995 | pure[2] = v;
|
996 | break;
|
997 | case 3:
|
998 | pure[0] = 0;
|
999 | pure[1] = w;
|
1000 | pure[2] = 1;
|
1001 | break;
|
1002 | case 4:
|
1003 | pure[0] = v;
|
1004 | pure[1] = 0;
|
1005 | pure[2] = 1;
|
1006 | break;
|
1007 | default:
|
1008 | pure[0] = 1;
|
1009 | pure[1] = 0;
|
1010 | pure[2] = w;
|
1011 | }
|
1012 | mg = (1 - c) * g;
|
1013 | return [
|
1014 | (c * pure[0] + mg) * 255,
|
1015 | (c * pure[1] + mg) * 255,
|
1016 | (c * pure[2] + mg) * 255
|
1017 | ];
|
1018 | };
|
1019 | convert.hcg.hsv = function(hcg) {
|
1020 | const c = hcg[1] / 100;
|
1021 | const g = hcg[2] / 100;
|
1022 | const v = c + g * (1 - c);
|
1023 | let f = 0;
|
1024 | if (v > 0) {
|
1025 | f = c / v;
|
1026 | }
|
1027 | return [hcg[0], f * 100, v * 100];
|
1028 | };
|
1029 | convert.hcg.hsl = function(hcg) {
|
1030 | const c = hcg[1] / 100;
|
1031 | const g = hcg[2] / 100;
|
1032 | const l = g * (1 - c) + 0.5 * c;
|
1033 | let s = 0;
|
1034 | if (l > 0 && l < 0.5) {
|
1035 | s = c / (2 * l);
|
1036 | } else if (l >= 0.5 && l < 1) {
|
1037 | s = c / (2 * (1 - l));
|
1038 | }
|
1039 | return [hcg[0], s * 100, l * 100];
|
1040 | };
|
1041 | convert.hcg.hwb = function(hcg) {
|
1042 | const c = hcg[1] / 100;
|
1043 | const g = hcg[2] / 100;
|
1044 | const v = c + g * (1 - c);
|
1045 | return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
1046 | };
|
1047 | convert.hwb.hcg = function(hwb) {
|
1048 | const w = hwb[1] / 100;
|
1049 | const b2 = hwb[2] / 100;
|
1050 | const v = 1 - b2;
|
1051 | const c = v - w;
|
1052 | let g = 0;
|
1053 | if (c < 1) {
|
1054 | g = (v - c) / (1 - c);
|
1055 | }
|
1056 | return [hwb[0], c * 100, g * 100];
|
1057 | };
|
1058 | convert.apple.rgb = function(apple) {
|
1059 | return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
1060 | };
|
1061 | convert.rgb.apple = function(rgb) {
|
1062 | return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
1063 | };
|
1064 | convert.gray.rgb = function(args) {
|
1065 | return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
1066 | };
|
1067 | convert.gray.hsl = function(args) {
|
1068 | return [0, 0, args[0]];
|
1069 | };
|
1070 | convert.gray.hsv = convert.gray.hsl;
|
1071 | convert.gray.hwb = function(gray) {
|
1072 | return [0, 100, gray[0]];
|
1073 | };
|
1074 | convert.gray.cmyk = function(gray) {
|
1075 | return [0, 0, 0, gray[0]];
|
1076 | };
|
1077 | convert.gray.lab = function(gray) {
|
1078 | return [gray[0], 0, 0];
|
1079 | };
|
1080 | convert.gray.hex = function(gray) {
|
1081 | const val = Math.round(gray[0] / 100 * 255) & 255;
|
1082 | const integer = (val << 16) + (val << 8) + val;
|
1083 | const string = integer.toString(16).toUpperCase();
|
1084 | return "000000".substring(string.length) + string;
|
1085 | };
|
1086 | convert.rgb.gray = function(rgb) {
|
1087 | const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
1088 | return [val / 255 * 100];
|
1089 | };
|
1090 | }
|
1091 | });
|
1092 | var require_route = __commonJS({
|
1093 | "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"(exports, module2) {
|
1094 | var conversions = require_conversions();
|
1095 | function buildGraph() {
|
1096 | const graph = {};
|
1097 | const models = Object.keys(conversions);
|
1098 | for (let len = models.length, i = 0; i < len; i++) {
|
1099 | graph[models[i]] = {
|
1100 | distance: -1,
|
1101 | parent: null
|
1102 | };
|
1103 | }
|
1104 | return graph;
|
1105 | }
|
1106 | __name(buildGraph, "buildGraph");
|
1107 | __name2(buildGraph, "buildGraph");
|
1108 | function deriveBFS(fromModel) {
|
1109 | const graph = buildGraph();
|
1110 | const queue = [fromModel];
|
1111 | graph[fromModel].distance = 0;
|
1112 | while (queue.length) {
|
1113 | const current = queue.pop();
|
1114 | const adjacents = Object.keys(conversions[current]);
|
1115 | for (let len = adjacents.length, i = 0; i < len; i++) {
|
1116 | const adjacent = adjacents[i];
|
1117 | const node = graph[adjacent];
|
1118 | if (node.distance === -1) {
|
1119 | node.distance = graph[current].distance + 1;
|
1120 | node.parent = current;
|
1121 | queue.unshift(adjacent);
|
1122 | }
|
1123 | }
|
1124 | }
|
1125 | return graph;
|
1126 | }
|
1127 | __name(deriveBFS, "deriveBFS");
|
1128 | __name2(deriveBFS, "deriveBFS");
|
1129 | function link(from, to) {
|
1130 | return function(args) {
|
1131 | return to(from(args));
|
1132 | };
|
1133 | }
|
1134 | __name(link, "link");
|
1135 | __name2(link, "link");
|
1136 | function wrapConversion(toModel, graph) {
|
1137 | const path2 = [graph[toModel].parent, toModel];
|
1138 | let fn = conversions[graph[toModel].parent][toModel];
|
1139 | let cur = graph[toModel].parent;
|
1140 | while (graph[cur].parent) {
|
1141 | path2.unshift(graph[cur].parent);
|
1142 | fn = link(conversions[graph[cur].parent][cur], fn);
|
1143 | cur = graph[cur].parent;
|
1144 | }
|
1145 | fn.conversion = path2;
|
1146 | return fn;
|
1147 | }
|
1148 | __name(wrapConversion, "wrapConversion");
|
1149 | __name2(wrapConversion, "wrapConversion");
|
1150 | module2.exports = function(fromModel) {
|
1151 | const graph = deriveBFS(fromModel);
|
1152 | const conversion = {};
|
1153 | const models = Object.keys(graph);
|
1154 | for (let len = models.length, i = 0; i < len; i++) {
|
1155 | const toModel = models[i];
|
1156 | const node = graph[toModel];
|
1157 | if (node.parent === null) {
|
1158 | continue;
|
1159 | }
|
1160 | conversion[toModel] = wrapConversion(toModel, graph);
|
1161 | }
|
1162 | return conversion;
|
1163 | };
|
1164 | }
|
1165 | });
|
1166 | var require_color_convert = __commonJS({
|
1167 | "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"(exports, module2) {
|
1168 | var conversions = require_conversions();
|
1169 | var route = require_route();
|
1170 | var convert = {};
|
1171 | var models = Object.keys(conversions);
|
1172 | function wrapRaw(fn) {
|
1173 | const wrappedFn = __name2(function(...args) {
|
1174 | const arg0 = args[0];
|
1175 | if (arg0 === void 0 || arg0 === null) {
|
1176 | return arg0;
|
1177 | }
|
1178 | if (arg0.length > 1) {
|
1179 | args = arg0;
|
1180 | }
|
1181 | return fn(args);
|
1182 | }, "wrappedFn");
|
1183 | if ("conversion" in fn) {
|
1184 | wrappedFn.conversion = fn.conversion;
|
1185 | }
|
1186 | return wrappedFn;
|
1187 | }
|
1188 | __name(wrapRaw, "wrapRaw");
|
1189 | __name2(wrapRaw, "wrapRaw");
|
1190 | function wrapRounded(fn) {
|
1191 | const wrappedFn = __name2(function(...args) {
|
1192 | const arg0 = args[0];
|
1193 | if (arg0 === void 0 || arg0 === null) {
|
1194 | return arg0;
|
1195 | }
|
1196 | if (arg0.length > 1) {
|
1197 | args = arg0;
|
1198 | }
|
1199 | const result = fn(args);
|
1200 | if (typeof result === "object") {
|
1201 | for (let len = result.length, i = 0; i < len; i++) {
|
1202 | result[i] = Math.round(result[i]);
|
1203 | }
|
1204 | }
|
1205 | return result;
|
1206 | }, "wrappedFn");
|
1207 | if ("conversion" in fn) {
|
1208 | wrappedFn.conversion = fn.conversion;
|
1209 | }
|
1210 | return wrappedFn;
|
1211 | }
|
1212 | __name(wrapRounded, "wrapRounded");
|
1213 | __name2(wrapRounded, "wrapRounded");
|
1214 | models.forEach((fromModel) => {
|
1215 | convert[fromModel] = {};
|
1216 | Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
1217 | Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
1218 | const routes = route(fromModel);
|
1219 | const routeModels = Object.keys(routes);
|
1220 | routeModels.forEach((toModel) => {
|
1221 | const fn = routes[toModel];
|
1222 | convert[fromModel][toModel] = wrapRounded(fn);
|
1223 | convert[fromModel][toModel].raw = wrapRaw(fn);
|
1224 | });
|
1225 | });
|
1226 | module2.exports = convert;
|
1227 | }
|
1228 | });
|
1229 | var require_ansi_styles = __commonJS({
|
1230 | "../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"(exports, module2) {
|
1231 | "use strict";
|
1232 | var wrapAnsi16 = __name2((fn, offset) => (...args) => {
|
1233 | const code = fn(...args);
|
1234 | return `[${code + offset}m`;
|
1235 | }, "wrapAnsi16");
|
1236 | var wrapAnsi256 = __name2((fn, offset) => (...args) => {
|
1237 | const code = fn(...args);
|
1238 | return `[${38 + offset};5;${code}m`;
|
1239 | }, "wrapAnsi256");
|
1240 | var wrapAnsi16m = __name2((fn, offset) => (...args) => {
|
1241 | const rgb = fn(...args);
|
1242 | return `[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
1243 | }, "wrapAnsi16m");
|
1244 | var ansi2ansi = __name2((n) => n, "ansi2ansi");
|
1245 | var rgb2rgb = __name2((r, g, b2) => [r, g, b2], "rgb2rgb");
|
1246 | var setLazyProperty = __name2((object, property, get) => {
|
1247 | Object.defineProperty(object, property, {
|
1248 | get: () => {
|
1249 | const value = get();
|
1250 | Object.defineProperty(object, property, {
|
1251 | value,
|
1252 | enumerable: true,
|
1253 | configurable: true
|
1254 | });
|
1255 | return value;
|
1256 | },
|
1257 | enumerable: true,
|
1258 | configurable: true
|
1259 | });
|
1260 | }, "setLazyProperty");
|
1261 | var colorConvert;
|
1262 | var makeDynamicStyles = __name2((wrap, targetSpace, identity, isBackground) => {
|
1263 | if (colorConvert === void 0) {
|
1264 | colorConvert = require_color_convert();
|
1265 | }
|
1266 | const offset = isBackground ? 10 : 0;
|
1267 | const styles = {};
|
1268 | for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
|
1269 | const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
1270 | if (sourceSpace === targetSpace) {
|
1271 | styles[name] = wrap(identity, offset);
|
1272 | } else if (typeof suite === "object") {
|
1273 | styles[name] = wrap(suite[targetSpace], offset);
|
1274 | }
|
1275 | }
|
1276 | return styles;
|
1277 | }, "makeDynamicStyles");
|
1278 | function assembleStyles() {
|
1279 | const codes = new Map();
|
1280 | const styles = {
|
1281 | modifier: {
|
1282 | reset: [0, 0],
|
1283 | bold: [1, 22],
|
1284 | dim: [2, 22],
|
1285 | italic: [3, 23],
|
1286 | underline: [4, 24],
|
1287 | inverse: [7, 27],
|
1288 | hidden: [8, 28],
|
1289 | strikethrough: [9, 29]
|
1290 | },
|
1291 | color: {
|
1292 | black: [30, 39],
|
1293 | red: [31, 39],
|
1294 | green: [32, 39],
|
1295 | yellow: [33, 39],
|
1296 | blue: [34, 39],
|
1297 | magenta: [35, 39],
|
1298 | cyan: [36, 39],
|
1299 | white: [37, 39],
|
1300 | blackBright: [90, 39],
|
1301 | redBright: [91, 39],
|
1302 | greenBright: [92, 39],
|
1303 | yellowBright: [93, 39],
|
1304 | blueBright: [94, 39],
|
1305 | magentaBright: [95, 39],
|
1306 | cyanBright: [96, 39],
|
1307 | whiteBright: [97, 39]
|
1308 | },
|
1309 | bgColor: {
|
1310 | bgBlack: [40, 49],
|
1311 | bgRed: [41, 49],
|
1312 | bgGreen: [42, 49],
|
1313 | bgYellow: [43, 49],
|
1314 | bgBlue: [44, 49],
|
1315 | bgMagenta: [45, 49],
|
1316 | bgCyan: [46, 49],
|
1317 | bgWhite: [47, 49],
|
1318 | bgBlackBright: [100, 49],
|
1319 | bgRedBright: [101, 49],
|
1320 | bgGreenBright: [102, 49],
|
1321 | bgYellowBright: [103, 49],
|
1322 | bgBlueBright: [104, 49],
|
1323 | bgMagentaBright: [105, 49],
|
1324 | bgCyanBright: [106, 49],
|
1325 | bgWhiteBright: [107, 49]
|
1326 | }
|
1327 | };
|
1328 | styles.color.gray = styles.color.blackBright;
|
1329 | styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
1330 | styles.color.grey = styles.color.blackBright;
|
1331 | styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
1332 | for (const [groupName, group] of Object.entries(styles)) {
|
1333 | for (const [styleName, style] of Object.entries(group)) {
|
1334 | styles[styleName] = {
|
1335 | open: `[${style[0]}m`,
|
1336 | close: `[${style[1]}m`
|
1337 | };
|
1338 | group[styleName] = styles[styleName];
|
1339 | codes.set(style[0], style[1]);
|
1340 | }
|
1341 | Object.defineProperty(styles, groupName, {
|
1342 | value: group,
|
1343 | enumerable: false
|
1344 | });
|
1345 | }
|
1346 | Object.defineProperty(styles, "codes", {
|
1347 | value: codes,
|
1348 | enumerable: false
|
1349 | });
|
1350 | styles.color.close = "[39m";
|
1351 | styles.bgColor.close = "[49m";
|
1352 | setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
1353 | setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
1354 | setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
1355 | setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
1356 | setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
1357 | setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
1358 | return styles;
|
1359 | }
|
1360 | __name(assembleStyles, "assembleStyles");
|
1361 | __name2(assembleStyles, "assembleStyles");
|
1362 | Object.defineProperty(module2, "exports", {
|
1363 | enumerable: true,
|
1364 | get: assembleStyles
|
1365 | });
|
1366 | }
|
1367 | });
|
1368 | var require_has_flag = __commonJS({
|
1369 | "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module2) {
|
1370 | "use strict";
|
1371 | module2.exports = (flag, argv = process.argv) => {
|
1372 | const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
1373 | const position = argv.indexOf(prefix + flag);
|
1374 | const terminatorPosition = argv.indexOf("--");
|
1375 | return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
1376 | };
|
1377 | }
|
1378 | });
|
1379 | var require_supports_color = __commonJS({
|
1380 | "../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module2) {
|
1381 | "use strict";
|
1382 | var os = require("os");
|
1383 | var tty = require("tty");
|
1384 | var hasFlag = require_has_flag();
|
1385 | var { env } = process;
|
1386 | var forceColor;
|
1387 | if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
1388 | forceColor = 0;
|
1389 | } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
1390 | forceColor = 1;
|
1391 | }
|
1392 | if ("FORCE_COLOR" in env) {
|
1393 | if (env.FORCE_COLOR === "true") {
|
1394 | forceColor = 1;
|
1395 | } else if (env.FORCE_COLOR === "false") {
|
1396 | forceColor = 0;
|
1397 | } else {
|
1398 | forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
1399 | }
|
1400 | }
|
1401 | function translateLevel(level) {
|
1402 | if (level === 0) {
|
1403 | return false;
|
1404 | }
|
1405 | return {
|
1406 | level,
|
1407 | hasBasic: true,
|
1408 | has256: level >= 2,
|
1409 | has16m: level >= 3
|
1410 | };
|
1411 | }
|
1412 | __name(translateLevel, "translateLevel");
|
1413 | __name2(translateLevel, "translateLevel");
|
1414 | function supportsColor(haveStream, streamIsTTY) {
|
1415 | if (forceColor === 0) {
|
1416 | return 0;
|
1417 | }
|
1418 | if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
1419 | return 3;
|
1420 | }
|
1421 | if (hasFlag("color=256")) {
|
1422 | return 2;
|
1423 | }
|
1424 | if (haveStream && !streamIsTTY && forceColor === void 0) {
|
1425 | return 0;
|
1426 | }
|
1427 | const min = forceColor || 0;
|
1428 | if (env.TERM === "dumb") {
|
1429 | return min;
|
1430 | }
|
1431 | if (process.platform === "win32") {
|
1432 | const osRelease = os.release().split(".");
|
1433 | if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
1434 | return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
1435 | }
|
1436 | return 1;
|
1437 | }
|
1438 | if ("CI" in env) {
|
1439 | if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
1440 | return 1;
|
1441 | }
|
1442 | return min;
|
1443 | }
|
1444 | if ("TEAMCITY_VERSION" in env) {
|
1445 | return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
1446 | }
|
1447 | if (env.COLORTERM === "truecolor") {
|
1448 | return 3;
|
1449 | }
|
1450 | if ("TERM_PROGRAM" in env) {
|
1451 | const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
1452 | switch (env.TERM_PROGRAM) {
|
1453 | case "iTerm.app":
|
1454 | return version >= 3 ? 3 : 2;
|
1455 | case "Apple_Terminal":
|
1456 | return 2;
|
1457 | }
|
1458 | }
|
1459 | if (/-256(color)?$/i.test(env.TERM)) {
|
1460 | return 2;
|
1461 | }
|
1462 | if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
1463 | return 1;
|
1464 | }
|
1465 | if ("COLORTERM" in env) {
|
1466 | return 1;
|
1467 | }
|
1468 | return min;
|
1469 | }
|
1470 | __name(supportsColor, "supportsColor");
|
1471 | __name2(supportsColor, "supportsColor");
|
1472 | function getSupportLevel(stream) {
|
1473 | const level = supportsColor(stream, stream && stream.isTTY);
|
1474 | return translateLevel(level);
|
1475 | }
|
1476 | __name(getSupportLevel, "getSupportLevel");
|
1477 | __name2(getSupportLevel, "getSupportLevel");
|
1478 | module2.exports = {
|
1479 | supportsColor: getSupportLevel,
|
1480 | stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
1481 | stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
1482 | };
|
1483 | }
|
1484 | });
|
1485 | var require_util = __commonJS({
|
1486 | "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js"(exports, module2) {
|
1487 | "use strict";
|
1488 | var stringReplaceAll = __name2((string, substring, replacer) => {
|
1489 | let index = string.indexOf(substring);
|
1490 | if (index === -1) {
|
1491 | return string;
|
1492 | }
|
1493 | const substringLength = substring.length;
|
1494 | let endIndex = 0;
|
1495 | let returnValue = "";
|
1496 | do {
|
1497 | returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
1498 | endIndex = index + substringLength;
|
1499 | index = string.indexOf(substring, endIndex);
|
1500 | } while (index !== -1);
|
1501 | returnValue += string.substr(endIndex);
|
1502 | return returnValue;
|
1503 | }, "stringReplaceAll");
|
1504 | var stringEncaseCRLFWithFirstIndex = __name2((string, prefix, postfix, index) => {
|
1505 | let endIndex = 0;
|
1506 | let returnValue = "";
|
1507 | do {
|
1508 | const gotCR = string[index - 1] === "\r";
|
1509 | returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
1510 | endIndex = index + 1;
|
1511 | index = string.indexOf("\n", endIndex);
|
1512 | } while (index !== -1);
|
1513 | returnValue += string.substr(endIndex);
|
1514 | return returnValue;
|
1515 | }, "stringEncaseCRLFWithFirstIndex");
|
1516 | module2.exports = {
|
1517 | stringReplaceAll,
|
1518 | stringEncaseCRLFWithFirstIndex
|
1519 | };
|
1520 | }
|
1521 | });
|
1522 | var require_templates = __commonJS({
|
1523 | "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js"(exports, module2) {
|
1524 | "use strict";
|
1525 | var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
1526 | var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
1527 | var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
1528 | var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
1529 | var ESCAPES = new Map([
|
1530 | ["n", "\n"],
|
1531 | ["r", "\r"],
|
1532 | ["t", " "],
|
1533 | ["b", "\b"],
|
1534 | ["f", "\f"],
|
1535 | ["v", "\v"],
|
1536 | ["0", "\0"],
|
1537 | ["\\", "\\"],
|
1538 | ["e", ""],
|
1539 | ["a", "\x07"]
|
1540 | ]);
|
1541 | function unescape(c) {
|
1542 | const u = c[0] === "u";
|
1543 | const bracket = c[1] === "{";
|
1544 | if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
|
1545 | return String.fromCharCode(parseInt(c.slice(1), 16));
|
1546 | }
|
1547 | if (u && bracket) {
|
1548 | return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
1549 | }
|
1550 | return ESCAPES.get(c) || c;
|
1551 | }
|
1552 | __name(unescape, "unescape");
|
1553 | __name2(unescape, "unescape");
|
1554 | function parseArguments(name, arguments_) {
|
1555 | const results = [];
|
1556 | const chunks = arguments_.trim().split(/\s*,\s*/g);
|
1557 | let matches;
|
1558 | for (const chunk of chunks) {
|
1559 | const number = Number(chunk);
|
1560 | if (!Number.isNaN(number)) {
|
1561 | results.push(number);
|
1562 | } else if (matches = chunk.match(STRING_REGEX)) {
|
1563 | results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
|
1564 | } else {
|
1565 | throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
1566 | }
|
1567 | }
|
1568 | return results;
|
1569 | }
|
1570 | __name(parseArguments, "parseArguments");
|
1571 | __name2(parseArguments, "parseArguments");
|
1572 | function parseStyle(style) {
|
1573 | STYLE_REGEX.lastIndex = 0;
|
1574 | const results = [];
|
1575 | let matches;
|
1576 | while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
1577 | const name = matches[1];
|
1578 | if (matches[2]) {
|
1579 | const args = parseArguments(name, matches[2]);
|
1580 | results.push([name].concat(args));
|
1581 | } else {
|
1582 | results.push([name]);
|
1583 | }
|
1584 | }
|
1585 | return results;
|
1586 | }
|
1587 | __name(parseStyle, "parseStyle");
|
1588 | __name2(parseStyle, "parseStyle");
|
1589 | function buildStyle(chalk, styles) {
|
1590 | const enabled = {};
|
1591 | for (const layer of styles) {
|
1592 | for (const style of layer.styles) {
|
1593 | enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
1594 | }
|
1595 | }
|
1596 | let current = chalk;
|
1597 | for (const [styleName, styles2] of Object.entries(enabled)) {
|
1598 | if (!Array.isArray(styles2)) {
|
1599 | continue;
|
1600 | }
|
1601 | if (!(styleName in current)) {
|
1602 | throw new Error(`Unknown Chalk style: ${styleName}`);
|
1603 | }
|
1604 | current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
|
1605 | }
|
1606 | return current;
|
1607 | }
|
1608 | __name(buildStyle, "buildStyle");
|
1609 | __name2(buildStyle, "buildStyle");
|
1610 | module2.exports = (chalk, temporary) => {
|
1611 | const styles = [];
|
1612 | const chunks = [];
|
1613 | let chunk = [];
|
1614 | temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
1615 | if (escapeCharacter) {
|
1616 | chunk.push(unescape(escapeCharacter));
|
1617 | } else if (style) {
|
1618 | const string = chunk.join("");
|
1619 | chunk = [];
|
1620 | chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
|
1621 | styles.push({ inverse, styles: parseStyle(style) });
|
1622 | } else if (close) {
|
1623 | if (styles.length === 0) {
|
1624 | throw new Error("Found extraneous } in Chalk template literal");
|
1625 | }
|
1626 | chunks.push(buildStyle(chalk, styles)(chunk.join("")));
|
1627 | chunk = [];
|
1628 | styles.pop();
|
1629 | } else {
|
1630 | chunk.push(character);
|
1631 | }
|
1632 | });
|
1633 | chunks.push(chunk.join(""));
|
1634 | if (styles.length > 0) {
|
1635 | const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
1636 | throw new Error(errMessage);
|
1637 | }
|
1638 | return chunks.join("");
|
1639 | };
|
1640 | }
|
1641 | });
|
1642 | var require_source = __commonJS({
|
1643 | "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js"(exports, module2) {
|
1644 | "use strict";
|
1645 | var ansiStyles = require_ansi_styles();
|
1646 | var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
|
1647 | var {
|
1648 | stringReplaceAll,
|
1649 | stringEncaseCRLFWithFirstIndex
|
1650 | } = require_util();
|
1651 | var { isArray } = Array;
|
1652 | var levelMapping = [
|
1653 | "ansi",
|
1654 | "ansi",
|
1655 | "ansi256",
|
1656 | "ansi16m"
|
1657 | ];
|
1658 | var styles = Object.create(null);
|
1659 | var applyOptions = __name2((object, options = {}) => {
|
1660 | if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
1661 | throw new Error("The `level` option should be an integer from 0 to 3");
|
1662 | }
|
1663 | const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
1664 | object.level = options.level === void 0 ? colorLevel : options.level;
|
1665 | }, "applyOptions");
|
1666 | var ChalkClass = __name(class {
|
1667 | constructor(options) {
|
1668 | return chalkFactory(options);
|
1669 | }
|
1670 | }, "ChalkClass");
|
1671 | __name2(ChalkClass, "ChalkClass");
|
1672 | var chalkFactory = __name2((options) => {
|
1673 | const chalk2 = {};
|
1674 | applyOptions(chalk2, options);
|
1675 | chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
|
1676 | Object.setPrototypeOf(chalk2, Chalk.prototype);
|
1677 | Object.setPrototypeOf(chalk2.template, chalk2);
|
1678 | chalk2.template.constructor = () => {
|
1679 | throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
1680 | };
|
1681 | chalk2.template.Instance = ChalkClass;
|
1682 | return chalk2.template;
|
1683 | }, "chalkFactory");
|
1684 | function Chalk(options) {
|
1685 | return chalkFactory(options);
|
1686 | }
|
1687 | __name(Chalk, "Chalk");
|
1688 | __name2(Chalk, "Chalk");
|
1689 | for (const [styleName, style] of Object.entries(ansiStyles)) {
|
1690 | styles[styleName] = {
|
1691 | get() {
|
1692 | const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
1693 | Object.defineProperty(this, styleName, { value: builder });
|
1694 | return builder;
|
1695 | }
|
1696 | };
|
1697 | }
|
1698 | styles.visible = {
|
1699 | get() {
|
1700 | const builder = createBuilder(this, this._styler, true);
|
1701 | Object.defineProperty(this, "visible", { value: builder });
|
1702 | return builder;
|
1703 | }
|
1704 | };
|
1705 | var usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
1706 | for (const model of usedModels) {
|
1707 | styles[model] = {
|
1708 | get() {
|
1709 | const { level } = this;
|
1710 | return function(...arguments_) {
|
1711 | const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
|
1712 | return createBuilder(this, styler, this._isEmpty);
|
1713 | };
|
1714 | }
|
1715 | };
|
1716 | }
|
1717 | for (const model of usedModels) {
|
1718 | const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
1719 | styles[bgModel] = {
|
1720 | get() {
|
1721 | const { level } = this;
|
1722 | return function(...arguments_) {
|
1723 | const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
|
1724 | return createBuilder(this, styler, this._isEmpty);
|
1725 | };
|
1726 | }
|
1727 | };
|
1728 | }
|
1729 | var proto = Object.defineProperties(() => {
|
1730 | }, {
|
1731 | ...styles,
|
1732 | level: {
|
1733 | enumerable: true,
|
1734 | get() {
|
1735 | return this._generator.level;
|
1736 | },
|
1737 | set(level) {
|
1738 | this._generator.level = level;
|
1739 | }
|
1740 | }
|
1741 | });
|
1742 | var createStyler = __name2((open, close, parent) => {
|
1743 | let openAll;
|
1744 | let closeAll;
|
1745 | if (parent === void 0) {
|
1746 | openAll = open;
|
1747 | closeAll = close;
|
1748 | } else {
|
1749 | openAll = parent.openAll + open;
|
1750 | closeAll = close + parent.closeAll;
|
1751 | }
|
1752 | return {
|
1753 | open,
|
1754 | close,
|
1755 | openAll,
|
1756 | closeAll,
|
1757 | parent
|
1758 | };
|
1759 | }, "createStyler");
|
1760 | var createBuilder = __name2((self, _styler, _isEmpty) => {
|
1761 | const builder = __name2((...arguments_) => {
|
1762 | if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
1763 | return applyStyle(builder, chalkTag(builder, ...arguments_));
|
1764 | }
|
1765 | return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
1766 | }, "builder");
|
1767 | Object.setPrototypeOf(builder, proto);
|
1768 | builder._generator = self;
|
1769 | builder._styler = _styler;
|
1770 | builder._isEmpty = _isEmpty;
|
1771 | return builder;
|
1772 | }, "createBuilder");
|
1773 | var applyStyle = __name2((self, string) => {
|
1774 | if (self.level <= 0 || !string) {
|
1775 | return self._isEmpty ? "" : string;
|
1776 | }
|
1777 | let styler = self._styler;
|
1778 | if (styler === void 0) {
|
1779 | return string;
|
1780 | }
|
1781 | const { openAll, closeAll } = styler;
|
1782 | if (string.indexOf("") !== -1) {
|
1783 | while (styler !== void 0) {
|
1784 | string = stringReplaceAll(string, styler.close, styler.open);
|
1785 | styler = styler.parent;
|
1786 | }
|
1787 | }
|
1788 | const lfIndex = string.indexOf("\n");
|
1789 | if (lfIndex !== -1) {
|
1790 | string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
1791 | }
|
1792 | return openAll + string + closeAll;
|
1793 | }, "applyStyle");
|
1794 | var template;
|
1795 | var chalkTag = __name2((chalk2, ...strings) => {
|
1796 | const [firstString] = strings;
|
1797 | if (!isArray(firstString) || !isArray(firstString.raw)) {
|
1798 | return strings.join(" ");
|
1799 | }
|
1800 | const arguments_ = strings.slice(1);
|
1801 | const parts = [firstString.raw[0]];
|
1802 | for (let i = 1; i < firstString.length; i++) {
|
1803 | parts.push(String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"), String(firstString.raw[i]));
|
1804 | }
|
1805 | if (template === void 0) {
|
1806 | template = require_templates();
|
1807 | }
|
1808 | return template(chalk2, parts.join(""));
|
1809 | }, "chalkTag");
|
1810 | Object.defineProperties(Chalk.prototype, styles);
|
1811 | var chalk = Chalk();
|
1812 | chalk.supportsColor = stdoutColor;
|
1813 | chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
1814 | chalk.stderr.supportsColor = stderrColor;
|
1815 | module2.exports = chalk;
|
1816 | }
|
1817 | });
|
1818 | var require_is_fullwidth_code_point = __commonJS({
|
1819 | "../../node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js"(exports, module2) {
|
1820 | "use strict";
|
1821 | var isFullwidthCodePoint = __name2((codePoint) => {
|
1822 | if (Number.isNaN(codePoint)) {
|
1823 | return false;
|
1824 | }
|
1825 | 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)) {
|
1826 | return true;
|
1827 | }
|
1828 | return false;
|
1829 | }, "isFullwidthCodePoint");
|
1830 | module2.exports = isFullwidthCodePoint;
|
1831 | module2.exports.default = isFullwidthCodePoint;
|
1832 | }
|
1833 | });
|
1834 | var require_astral_regex = __commonJS({
|
1835 | "../../node_modules/.pnpm/astral-regex@2.0.0/node_modules/astral-regex/index.js"(exports, module2) {
|
1836 | "use strict";
|
1837 | var regex = "[\uD800-\uDBFF][\uDC00-\uDFFF]";
|
1838 | var astralRegex = __name2((options) => options && options.exact ? new RegExp(`^${regex}$`) : new RegExp(regex, "g"), "astralRegex");
|
1839 | module2.exports = astralRegex;
|
1840 | }
|
1841 | });
|
1842 | var require_slice_ansi = __commonJS({
|
1843 | "../../node_modules/.pnpm/slice-ansi@3.0.0/node_modules/slice-ansi/index.js"(exports, module2) {
|
1844 | "use strict";
|
1845 | var isFullwidthCodePoint = require_is_fullwidth_code_point();
|
1846 | var astralRegex = require_astral_regex();
|
1847 | var ansiStyles = require_ansi_styles();
|
1848 | var ESCAPES = [
|
1849 | "",
|
1850 | "\x9B"
|
1851 | ];
|
1852 | var wrapAnsi = __name2((code) => `${ESCAPES[0]}[${code}m`, "wrapAnsi");
|
1853 | var checkAnsi = __name2((ansiCodes, isEscapes, endAnsiCode) => {
|
1854 | let output = [];
|
1855 | ansiCodes = [...ansiCodes];
|
1856 | for (let ansiCode of ansiCodes) {
|
1857 | const ansiCodeOrigin = ansiCode;
|
1858 | if (ansiCode.match(";")) {
|
1859 | ansiCode = ansiCode.split(";")[0][0] + "0";
|
1860 | }
|
1861 | const item = ansiStyles.codes.get(parseInt(ansiCode, 10));
|
1862 | if (item) {
|
1863 | const indexEscape = ansiCodes.indexOf(item.toString());
|
1864 | if (indexEscape >= 0) {
|
1865 | ansiCodes.splice(indexEscape, 1);
|
1866 | } else {
|
1867 | output.push(wrapAnsi(isEscapes ? item : ansiCodeOrigin));
|
1868 | }
|
1869 | } else if (isEscapes) {
|
1870 | output.push(wrapAnsi(0));
|
1871 | break;
|
1872 | } else {
|
1873 | output.push(wrapAnsi(ansiCodeOrigin));
|
1874 | }
|
1875 | }
|
1876 | if (isEscapes) {
|
1877 | output = output.filter((element, index) => output.indexOf(element) === index);
|
1878 | if (endAnsiCode !== void 0) {
|
1879 | const fistEscapeCode = wrapAnsi(ansiStyles.codes.get(parseInt(endAnsiCode, 10)));
|
1880 | output = output.reduce((current, next) => next === fistEscapeCode ? [next, ...current] : [...current, next], []);
|
1881 | }
|
1882 | }
|
1883 | return output.join("");
|
1884 | }, "checkAnsi");
|
1885 | module2.exports = (string, begin, end) => {
|
1886 | const characters = [...string.normalize()];
|
1887 | const ansiCodes = [];
|
1888 | end = typeof end === "number" ? end : characters.length;
|
1889 | let isInsideEscape = false;
|
1890 | let ansiCode;
|
1891 | let visible = 0;
|
1892 | let output = "";
|
1893 | for (const [index, character] of characters.entries()) {
|
1894 | let leftEscape = false;
|
1895 | if (ESCAPES.includes(character)) {
|
1896 | const code = /\d[^m]*/.exec(string.slice(index, index + 18));
|
1897 | ansiCode = code && code.length > 0 ? code[0] : void 0;
|
1898 | if (visible < end) {
|
1899 | isInsideEscape = true;
|
1900 | if (ansiCode !== void 0) {
|
1901 | ansiCodes.push(ansiCode);
|
1902 | }
|
1903 | }
|
1904 | } else if (isInsideEscape && character === "m") {
|
1905 | isInsideEscape = false;
|
1906 | leftEscape = true;
|
1907 | }
|
1908 | if (!isInsideEscape && !leftEscape) {
|
1909 | ++visible;
|
1910 | }
|
1911 | if (!astralRegex({ exact: true }).test(character) && isFullwidthCodePoint(character.codePointAt())) {
|
1912 | ++visible;
|
1913 | }
|
1914 | if (visible > begin && visible <= end) {
|
1915 | output += character;
|
1916 | } else if (visible === begin && !isInsideEscape && ansiCode !== void 0) {
|
1917 | output = checkAnsi(ansiCodes);
|
1918 | } else if (visible >= end) {
|
1919 | output += checkAnsi(ansiCodes, true, ansiCode);
|
1920 | break;
|
1921 | }
|
1922 | }
|
1923 | return output;
|
1924 | };
|
1925 | }
|
1926 | });
|
1927 | var require_ansi_regex = __commonJS({
|
1928 | "../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"(exports, module2) {
|
1929 | "use strict";
|
1930 | module2.exports = ({ onlyFirst = false } = {}) => {
|
1931 | const pattern = [
|
1932 | "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
1933 | "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
|
1934 | ].join("|");
|
1935 | return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
1936 | };
|
1937 | }
|
1938 | });
|
1939 | var require_strip_ansi = __commonJS({
|
1940 | "../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"(exports, module2) {
|
1941 | "use strict";
|
1942 | var ansiRegex = require_ansi_regex();
|
1943 | module2.exports = (string) => typeof string === "string" ? string.replace(ansiRegex(), "") : string;
|
1944 | }
|
1945 | });
|
1946 | var require_emoji_regex = __commonJS({
|
1947 | "../../node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js"(exports, module2) {
|
1948 | "use strict";
|
1949 | module2.exports = function() {
|
1950 | 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;
|
1951 | };
|
1952 | }
|
1953 | });
|
1954 | var require_string_width = __commonJS({
|
1955 | "../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js"(exports, module2) {
|
1956 | "use strict";
|
1957 | var stripAnsi = require_strip_ansi();
|
1958 | var isFullwidthCodePoint = require_is_fullwidth_code_point();
|
1959 | var emojiRegex = require_emoji_regex();
|
1960 | var stringWidth = __name2((string) => {
|
1961 | if (typeof string !== "string" || string.length === 0) {
|
1962 | return 0;
|
1963 | }
|
1964 | string = stripAnsi(string);
|
1965 | if (string.length === 0) {
|
1966 | return 0;
|
1967 | }
|
1968 | string = string.replace(emojiRegex(), " ");
|
1969 | let width = 0;
|
1970 | for (let i = 0; i < string.length; i++) {
|
1971 | const code = string.codePointAt(i);
|
1972 | if (code <= 31 || code >= 127 && code <= 159) {
|
1973 | continue;
|
1974 | }
|
1975 | if (code >= 768 && code <= 879) {
|
1976 | continue;
|
1977 | }
|
1978 | if (code > 65535) {
|
1979 | i++;
|
1980 | }
|
1981 | width += isFullwidthCodePoint(code) ? 2 : 1;
|
1982 | }
|
1983 | return width;
|
1984 | }, "stringWidth");
|
1985 | module2.exports = stringWidth;
|
1986 | module2.exports.default = stringWidth;
|
1987 | }
|
1988 | });
|
1989 | var require_cli_truncate = __commonJS({
|
1990 | "../../node_modules/.pnpm/cli-truncate@2.1.0/node_modules/cli-truncate/index.js"(exports, module2) {
|
1991 | "use strict";
|
1992 | var sliceAnsi = require_slice_ansi();
|
1993 | var stringWidth = require_string_width();
|
1994 | function getIndexOfNearestSpace(string, index, shouldSearchRight) {
|
1995 | if (string.charAt(index) === " ") {
|
1996 | return index;
|
1997 | }
|
1998 | for (let i = 1; i <= 3; i++) {
|
1999 | if (shouldSearchRight) {
|
2000 | if (string.charAt(index + i) === " ") {
|
2001 | return index + i;
|
2002 | }
|
2003 | } else if (string.charAt(index - i) === " ") {
|
2004 | return index - i;
|
2005 | }
|
2006 | }
|
2007 | return index;
|
2008 | }
|
2009 | __name(getIndexOfNearestSpace, "getIndexOfNearestSpace");
|
2010 | __name2(getIndexOfNearestSpace, "getIndexOfNearestSpace");
|
2011 | module2.exports = (text, columns, options) => {
|
2012 | options = {
|
2013 | position: "end",
|
2014 | preferTruncationOnSpace: false,
|
2015 | ...options
|
2016 | };
|
2017 | const { position, space, preferTruncationOnSpace } = options;
|
2018 | let ellipsis = "\u2026";
|
2019 | let ellipsisWidth = 1;
|
2020 | if (typeof text !== "string") {
|
2021 | throw new TypeError(`Expected \`input\` to be a string, got ${typeof text}`);
|
2022 | }
|
2023 | if (typeof columns !== "number") {
|
2024 | throw new TypeError(`Expected \`columns\` to be a number, got ${typeof columns}`);
|
2025 | }
|
2026 | if (columns < 1) {
|
2027 | return "";
|
2028 | }
|
2029 | if (columns === 1) {
|
2030 | return ellipsis;
|
2031 | }
|
2032 | const length = stringWidth(text);
|
2033 | if (length <= columns) {
|
2034 | return text;
|
2035 | }
|
2036 | if (position === "start") {
|
2037 | if (preferTruncationOnSpace) {
|
2038 | const nearestSpace = getIndexOfNearestSpace(text, length - columns + 1, true);
|
2039 | return ellipsis + sliceAnsi(text, nearestSpace, length).trim();
|
2040 | }
|
2041 | if (space === true) {
|
2042 | ellipsis += " ";
|
2043 | ellipsisWidth = 2;
|
2044 | }
|
2045 | return ellipsis + sliceAnsi(text, length - columns + ellipsisWidth, length);
|
2046 | }
|
2047 | if (position === "middle") {
|
2048 | if (space === true) {
|
2049 | ellipsis = " " + ellipsis + " ";
|
2050 | ellipsisWidth = 3;
|
2051 | }
|
2052 | const half = Math.floor(columns / 2);
|
2053 | if (preferTruncationOnSpace) {
|
2054 | const spaceNearFirstBreakPoint = getIndexOfNearestSpace(text, half);
|
2055 | const spaceNearSecondBreakPoint = getIndexOfNearestSpace(text, length - (columns - half) + 1, true);
|
2056 | return sliceAnsi(text, 0, spaceNearFirstBreakPoint) + ellipsis + sliceAnsi(text, spaceNearSecondBreakPoint, length).trim();
|
2057 | }
|
2058 | return sliceAnsi(text, 0, half) + ellipsis + sliceAnsi(text, length - (columns - half) + ellipsisWidth, length);
|
2059 | }
|
2060 | if (position === "end") {
|
2061 | if (preferTruncationOnSpace) {
|
2062 | const nearestSpace = getIndexOfNearestSpace(text, columns - 1);
|
2063 | return sliceAnsi(text, 0, nearestSpace) + ellipsis;
|
2064 | }
|
2065 | if (space === true) {
|
2066 | ellipsis = " " + ellipsis;
|
2067 | ellipsisWidth = 2;
|
2068 | }
|
2069 | return sliceAnsi(text, 0, columns - ellipsisWidth) + ellipsis;
|
2070 | }
|
2071 | throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${position}`);
|
2072 | };
|
2073 | }
|
2074 | });
|
2075 | var require_drawBox = __commonJS({
|
2076 | "../sdk/dist/drawBox.js"(exports) {
|
2077 | var __create = Object.create;
|
2078 | var __defProp22 = Object.defineProperty;
|
2079 | var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
2080 | var __getOwnPropNames = Object.getOwnPropertyNames;
|
2081 | var __getProtoOf = Object.getPrototypeOf;
|
2082 | var __hasOwnProp = Object.prototype.hasOwnProperty;
|
2083 | var __markAsModule2 = __name2((target) => __defProp22(target, "__esModule", { value: true }), "__markAsModule");
|
2084 | var __name22 = __name2((target, value) => __defProp22(target, "name", { value, configurable: true }), "__name");
|
2085 | var __export2 = __name2((target, all) => {
|
2086 | __markAsModule2(target);
|
2087 | for (var name in all)
|
2088 | __defProp22(target, name, { get: all[name], enumerable: true });
|
2089 | }, "__export");
|
2090 | var __reExport = __name2((target, module2, desc) => {
|
2091 | if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
2092 | for (let key of __getOwnPropNames(module2))
|
2093 | if (!__hasOwnProp.call(target, key) && key !== "default")
|
2094 | __defProp22(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
2095 | }
|
2096 | return target;
|
2097 | }, "__reExport");
|
2098 | var __toModule = __name2((module2) => {
|
2099 | return __reExport(__markAsModule2(__defProp22(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
2100 | }, "__toModule");
|
2101 | __export2(exports, {
|
2102 | drawBox: () => drawBox2
|
2103 | });
|
2104 | var import_chalk = __toModule(require_source());
|
2105 | var import_cli_truncate = __toModule(require_cli_truncate());
|
2106 | var import_string_width = __toModule(require_string_width());
|
2107 | var __defProp222 = Object.defineProperty;
|
2108 | var __name222 = __name22((target, value) => __defProp222(target, "name", { value, configurable: true }), "__name");
|
2109 | var chars = {
|
2110 | topLeft: "\u250C",
|
2111 | topRight: "\u2510",
|
2112 | bottomRight: "\u2518",
|
2113 | bottomLeft: "\u2514",
|
2114 | vertical: "\u2502",
|
2115 | horizontal: "\u2500"
|
2116 | };
|
2117 | function maxLineLength(str) {
|
2118 | return str.split("\n").reduce((max, curr) => Math.max(max, (0, import_string_width.default)(curr)), 0) + 2;
|
2119 | }
|
2120 | __name(maxLineLength, "maxLineLength");
|
2121 | __name2(maxLineLength, "maxLineLength");
|
2122 | __name22(maxLineLength, "maxLineLength");
|
2123 | __name222(maxLineLength, "maxLineLength");
|
2124 | function drawBox2({ title, width, height, str, horizontalPadding }) {
|
2125 | horizontalPadding = horizontalPadding || 0;
|
2126 | width = width || maxLineLength(str) + horizontalPadding * 2;
|
2127 | const topLine = title ? import_chalk.default.grey(chars.topLeft + chars.horizontal) + " " + import_chalk.default.reset.bold(title) + " " + import_chalk.default.grey(chars.horizontal.repeat(width - title.length - 2 - 3) + chars.topRight) + import_chalk.default.reset() : import_chalk.default.grey(chars.topLeft + chars.horizontal) + import_chalk.default.grey(chars.horizontal.repeat(width - 3) + chars.topRight);
|
2128 | const bottomLine = chars.bottomLeft + chars.horizontal.repeat(width - 2) + chars.bottomRight;
|
2129 | const lines = str.split("\n");
|
2130 | if (lines.length < height) {
|
2131 | lines.push(...new Array(height - lines.length).fill(""));
|
2132 | }
|
2133 | const mappedLines = lines.slice(-height).map((l) => {
|
2134 | const lineWidth = Math.min((0, import_string_width.default)(l), width);
|
2135 | const paddingRight = Math.max(width - lineWidth - 2, 0);
|
2136 | return `${import_chalk.default.grey(chars.vertical)}${" ".repeat(horizontalPadding)}${import_chalk.default.reset((0, import_cli_truncate.default)(l, width - 2))}${" ".repeat(paddingRight - horizontalPadding)}${import_chalk.default.grey(chars.vertical)}`;
|
2137 | }).join("\n");
|
2138 | return import_chalk.default.grey(topLine + "\n" + mappedLines + "\n" + bottomLine);
|
2139 | }
|
2140 | __name(drawBox2, "drawBox2");
|
2141 | __name2(drawBox2, "drawBox");
|
2142 | __name22(drawBox2, "drawBox");
|
2143 | __name222(drawBox2, "drawBox");
|
2144 | }
|
2145 | });
|
2146 | var require_is_path_inside = __commonJS({
|
2147 | "../../node_modules/.pnpm/is-path-inside@3.0.3/node_modules/is-path-inside/index.js"(exports, module2) {
|
2148 | "use strict";
|
2149 | var path2 = require("path");
|
2150 | module2.exports = (childPath, parentPath) => {
|
2151 | const relation = path2.relative(parentPath, childPath);
|
2152 | return Boolean(relation && relation !== ".." && !relation.startsWith(`..${path2.sep}`) && relation !== path2.resolve(childPath));
|
2153 | };
|
2154 | }
|
2155 | });
|
2156 | var require_is_installed_globally = __commonJS({
|
2157 | "../../node_modules/.pnpm/is-installed-globally@0.4.0/node_modules/is-installed-globally/index.js"(exports, module2) {
|
2158 | "use strict";
|
2159 | var fs = require("fs");
|
2160 | var globalDirs2 = require_global_dirs();
|
2161 | var isPathInside = require_is_path_inside();
|
2162 | module2.exports = (() => {
|
2163 | try {
|
2164 | return isPathInside(__dirname, globalDirs2.yarn.packages) || isPathInside(__dirname, fs.realpathSync(globalDirs2.npm.packages));
|
2165 | } catch (e) {
|
2166 | return false;
|
2167 | }
|
2168 | })();
|
2169 | }
|
2170 | });
|
2171 | var path = require("path");
|
2172 | var globalDirs = require_global_dirs();
|
2173 | var { drawBox } = require_drawBox();
|
2174 | var isInstalledGlobally = require_is_installed_globally();
|
2175 | var BOLD = "[1m";
|
2176 | var WHITE_BRIGHT = "[37;1m";
|
2177 | var RESET = "[0m";
|
2178 | function isPackageInstalledGlobally(name) {
|
2179 | try {
|
2180 | const pkgPath = require.resolve(path.join(globalDirs.yarn.packages, `${name}/package.json`));
|
2181 | return { pkgManager: "yarn", pkgPath };
|
2182 | } catch (_) {
|
2183 | try {
|
2184 | const pkgPath = require.resolve(path.join(globalDirs.npm.packages, `${name}/package.json`));
|
2185 | return { pkgManager: "npm", pkgPath };
|
2186 | } catch (_2) {
|
2187 | }
|
2188 | }
|
2189 | return null;
|
2190 | }
|
2191 | __name(isPackageInstalledGlobally, "isPackageInstalledGlobally");
|
2192 | __name2(isPackageInstalledGlobally, "isPackageInstalledGlobally");
|
2193 | function prismaIsInstalledGlobally() {
|
2194 | const prisma2InstalledGlobally = isPackageInstalledGlobally("prisma2");
|
2195 | if (prisma2InstalledGlobally) {
|
2196 | return {
|
2197 | ...prisma2InstalledGlobally,
|
2198 | name: "prisma2"
|
2199 | };
|
2200 | }
|
2201 | return null;
|
2202 | }
|
2203 | __name(prismaIsInstalledGlobally, "prismaIsInstalledGlobally");
|
2204 | __name2(prismaIsInstalledGlobally, "prismaIsInstalledGlobally");
|
2205 | var b = __name2((str) => BOLD + str + RESET, "b");
|
2206 | var white = __name2((str) => WHITE_BRIGHT + str + RESET, "white");
|
2207 | function main() {
|
2208 | const nodeVersions = process.version.split(".");
|
2209 | const nodeMajorVersion = parseInt(nodeVersions[0].slice(1));
|
2210 | const nodeMinorVersion = parseInt(nodeVersions[1]);
|
2211 | if (nodeMajorVersion < 12 || nodeMajorVersion === 12 && nodeMinorVersion < 6) {
|
2212 | console.error(drawBox({
|
2213 | str: `Prisma only supports Node.js >= 12.6`,
|
2214 | verticalPadding: 1,
|
2215 | horizontalPadding: 3
|
2216 | }));
|
2217 | process.exit(1);
|
2218 | }
|
2219 | if (__dirname.includes("_npx")) {
|
2220 | process.exit(0);
|
2221 | }
|
2222 | if (!isInstalledGlobally) {
|
2223 | process.exit(0);
|
2224 | }
|
2225 | const installedGlobally = prismaIsInstalledGlobally();
|
2226 | if (!installedGlobally) {
|
2227 | process.exit(0);
|
2228 | }
|
2229 | const pkg = require(installedGlobally.pkgPath);
|
2230 | const parts = pkg.version.split("-");
|
2231 | const isDev = parts.length > 1 ? parts[1].split(".") === "dev" : false;
|
2232 | let message;
|
2233 | if (installedGlobally.name === "prisma2") {
|
2234 | message = `
|
2235 | The package ${white("prisma2")} has been renamed to ${white("prisma")}.
|
2236 |
|
2237 | Please uninstall ${white("prisma2")} globally first.
|
2238 | Then install ${white("prisma")} to continue using ${b("Prisma 2.0")}:
|
2239 |
|
2240 | # Uninstall old CLI
|
2241 | ${white(installedGlobally.pkgManager === "yarn" ? "yarn global remove prisma2" : "npm uninstall -g prisma2")}
|
2242 |
|
2243 | # Install new CLI
|
2244 | ${white(`npm install prisma${isDev ? "@dev" : ""} --save-dev`)}
|
2245 |
|
2246 | # Invoke via npx
|
2247 | ${white("npx prisma --help")}
|
2248 |
|
2249 | Learn more here: https://pris.ly/preview025
|
2250 | `;
|
2251 | }
|
2252 | console.error(drawBox({ str: message, verticalPadding: 1, horizontalPadding: 3 }));
|
2253 | process.exit(1);
|
2254 | }
|
2255 | __name(main, "main");
|
2256 | __name2(main, "main");
|
2257 |
|
2258 | 0 && (module.exports = {
|
2259 | main
|
2260 | });
|