@storm-software/untyped 0.24.53 → 0.24.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/untyped.cjs +1911 -45201
- package/bin/untyped.js +1912 -45408
- package/dist/{chunk-N77CW7VO.cjs → chunk-4G3IU22J.cjs} +2 -51
- package/dist/chunk-4U6ARZBV.js +259 -0
- package/dist/{chunk-VZDVVM3H.cjs → chunk-AA55W4PI.cjs} +5 -7
- package/dist/{chunk-SEXIX2W6.js → chunk-AXIV4HBX.js} +3 -5
- package/dist/chunk-BY5UJMXQ.js +0 -0
- package/dist/{chunk-EOEWGN5V.cjs → chunk-DNUXDRL4.cjs} +5 -7
- package/dist/chunk-DUNUNFJ4.cjs +259 -0
- package/dist/{chunk-R7JBK4EB.js → chunk-EF33M72U.js} +8 -80
- package/dist/{chunk-2YNZOLYK.cjs → chunk-GXKBPF6R.cjs} +13 -79
- package/dist/{chunk-RRGVVEU6.cjs → chunk-NS7A3OHM.cjs} +33 -105
- package/dist/{chunk-7WW4JGOJ.js → chunk-NTN5YK5X.js} +0 -42
- package/dist/{chunk-H6DCXSE3.js → chunk-OKI3BIEA.js} +3 -5
- package/dist/chunk-TQVHFPJA.cjs +1 -0
- package/dist/{chunk-LWOW6NBO.js → chunk-USMEAXKV.js} +5 -71
- package/dist/generate.cjs +7 -7
- package/dist/generate.js +6 -6
- package/dist/index.cjs +8 -12
- package/dist/index.js +8 -12
- package/dist/utilities.cjs +2 -2
- package/dist/utilities.js +1 -1
- package/package.json +3 -2
- package/dist/chunk-GNDAXJ3C.js +0 -6
- package/dist/chunk-H3BI2RS6.js +0 -1840
- package/dist/chunk-OFYCXEXT.cjs +0 -1832
- package/dist/chunk-X4AHMOF6.cjs +0 -6
package/dist/chunk-H3BI2RS6.js
DELETED
|
@@ -1,1840 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__commonJS,
|
|
3
|
-
__toESM,
|
|
4
|
-
init_esm_shims
|
|
5
|
-
} from "./chunk-7WW4JGOJ.js";
|
|
6
|
-
|
|
7
|
-
// ../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js
|
|
8
|
-
var require_color_name = __commonJS({
|
|
9
|
-
"../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"(exports, module) {
|
|
10
|
-
"use strict";
|
|
11
|
-
init_esm_shims();
|
|
12
|
-
module.exports = {
|
|
13
|
-
"aliceblue": [240, 248, 255],
|
|
14
|
-
"antiquewhite": [250, 235, 215],
|
|
15
|
-
"aqua": [0, 255, 255],
|
|
16
|
-
"aquamarine": [127, 255, 212],
|
|
17
|
-
"azure": [240, 255, 255],
|
|
18
|
-
"beige": [245, 245, 220],
|
|
19
|
-
"bisque": [255, 228, 196],
|
|
20
|
-
"black": [0, 0, 0],
|
|
21
|
-
"blanchedalmond": [255, 235, 205],
|
|
22
|
-
"blue": [0, 0, 255],
|
|
23
|
-
"blueviolet": [138, 43, 226],
|
|
24
|
-
"brown": [165, 42, 42],
|
|
25
|
-
"burlywood": [222, 184, 135],
|
|
26
|
-
"cadetblue": [95, 158, 160],
|
|
27
|
-
"chartreuse": [127, 255, 0],
|
|
28
|
-
"chocolate": [210, 105, 30],
|
|
29
|
-
"coral": [255, 127, 80],
|
|
30
|
-
"cornflowerblue": [100, 149, 237],
|
|
31
|
-
"cornsilk": [255, 248, 220],
|
|
32
|
-
"crimson": [220, 20, 60],
|
|
33
|
-
"cyan": [0, 255, 255],
|
|
34
|
-
"darkblue": [0, 0, 139],
|
|
35
|
-
"darkcyan": [0, 139, 139],
|
|
36
|
-
"darkgoldenrod": [184, 134, 11],
|
|
37
|
-
"darkgray": [169, 169, 169],
|
|
38
|
-
"darkgreen": [0, 100, 0],
|
|
39
|
-
"darkgrey": [169, 169, 169],
|
|
40
|
-
"darkkhaki": [189, 183, 107],
|
|
41
|
-
"darkmagenta": [139, 0, 139],
|
|
42
|
-
"darkolivegreen": [85, 107, 47],
|
|
43
|
-
"darkorange": [255, 140, 0],
|
|
44
|
-
"darkorchid": [153, 50, 204],
|
|
45
|
-
"darkred": [139, 0, 0],
|
|
46
|
-
"darksalmon": [233, 150, 122],
|
|
47
|
-
"darkseagreen": [143, 188, 143],
|
|
48
|
-
"darkslateblue": [72, 61, 139],
|
|
49
|
-
"darkslategray": [47, 79, 79],
|
|
50
|
-
"darkslategrey": [47, 79, 79],
|
|
51
|
-
"darkturquoise": [0, 206, 209],
|
|
52
|
-
"darkviolet": [148, 0, 211],
|
|
53
|
-
"deeppink": [255, 20, 147],
|
|
54
|
-
"deepskyblue": [0, 191, 255],
|
|
55
|
-
"dimgray": [105, 105, 105],
|
|
56
|
-
"dimgrey": [105, 105, 105],
|
|
57
|
-
"dodgerblue": [30, 144, 255],
|
|
58
|
-
"firebrick": [178, 34, 34],
|
|
59
|
-
"floralwhite": [255, 250, 240],
|
|
60
|
-
"forestgreen": [34, 139, 34],
|
|
61
|
-
"fuchsia": [255, 0, 255],
|
|
62
|
-
"gainsboro": [220, 220, 220],
|
|
63
|
-
"ghostwhite": [248, 248, 255],
|
|
64
|
-
"gold": [255, 215, 0],
|
|
65
|
-
"goldenrod": [218, 165, 32],
|
|
66
|
-
"gray": [128, 128, 128],
|
|
67
|
-
"green": [0, 128, 0],
|
|
68
|
-
"greenyellow": [173, 255, 47],
|
|
69
|
-
"grey": [128, 128, 128],
|
|
70
|
-
"honeydew": [240, 255, 240],
|
|
71
|
-
"hotpink": [255, 105, 180],
|
|
72
|
-
"indianred": [205, 92, 92],
|
|
73
|
-
"indigo": [75, 0, 130],
|
|
74
|
-
"ivory": [255, 255, 240],
|
|
75
|
-
"khaki": [240, 230, 140],
|
|
76
|
-
"lavender": [230, 230, 250],
|
|
77
|
-
"lavenderblush": [255, 240, 245],
|
|
78
|
-
"lawngreen": [124, 252, 0],
|
|
79
|
-
"lemonchiffon": [255, 250, 205],
|
|
80
|
-
"lightblue": [173, 216, 230],
|
|
81
|
-
"lightcoral": [240, 128, 128],
|
|
82
|
-
"lightcyan": [224, 255, 255],
|
|
83
|
-
"lightgoldenrodyellow": [250, 250, 210],
|
|
84
|
-
"lightgray": [211, 211, 211],
|
|
85
|
-
"lightgreen": [144, 238, 144],
|
|
86
|
-
"lightgrey": [211, 211, 211],
|
|
87
|
-
"lightpink": [255, 182, 193],
|
|
88
|
-
"lightsalmon": [255, 160, 122],
|
|
89
|
-
"lightseagreen": [32, 178, 170],
|
|
90
|
-
"lightskyblue": [135, 206, 250],
|
|
91
|
-
"lightslategray": [119, 136, 153],
|
|
92
|
-
"lightslategrey": [119, 136, 153],
|
|
93
|
-
"lightsteelblue": [176, 196, 222],
|
|
94
|
-
"lightyellow": [255, 255, 224],
|
|
95
|
-
"lime": [0, 255, 0],
|
|
96
|
-
"limegreen": [50, 205, 50],
|
|
97
|
-
"linen": [250, 240, 230],
|
|
98
|
-
"magenta": [255, 0, 255],
|
|
99
|
-
"maroon": [128, 0, 0],
|
|
100
|
-
"mediumaquamarine": [102, 205, 170],
|
|
101
|
-
"mediumblue": [0, 0, 205],
|
|
102
|
-
"mediumorchid": [186, 85, 211],
|
|
103
|
-
"mediumpurple": [147, 112, 219],
|
|
104
|
-
"mediumseagreen": [60, 179, 113],
|
|
105
|
-
"mediumslateblue": [123, 104, 238],
|
|
106
|
-
"mediumspringgreen": [0, 250, 154],
|
|
107
|
-
"mediumturquoise": [72, 209, 204],
|
|
108
|
-
"mediumvioletred": [199, 21, 133],
|
|
109
|
-
"midnightblue": [25, 25, 112],
|
|
110
|
-
"mintcream": [245, 255, 250],
|
|
111
|
-
"mistyrose": [255, 228, 225],
|
|
112
|
-
"moccasin": [255, 228, 181],
|
|
113
|
-
"navajowhite": [255, 222, 173],
|
|
114
|
-
"navy": [0, 0, 128],
|
|
115
|
-
"oldlace": [253, 245, 230],
|
|
116
|
-
"olive": [128, 128, 0],
|
|
117
|
-
"olivedrab": [107, 142, 35],
|
|
118
|
-
"orange": [255, 165, 0],
|
|
119
|
-
"orangered": [255, 69, 0],
|
|
120
|
-
"orchid": [218, 112, 214],
|
|
121
|
-
"palegoldenrod": [238, 232, 170],
|
|
122
|
-
"palegreen": [152, 251, 152],
|
|
123
|
-
"paleturquoise": [175, 238, 238],
|
|
124
|
-
"palevioletred": [219, 112, 147],
|
|
125
|
-
"papayawhip": [255, 239, 213],
|
|
126
|
-
"peachpuff": [255, 218, 185],
|
|
127
|
-
"peru": [205, 133, 63],
|
|
128
|
-
"pink": [255, 192, 203],
|
|
129
|
-
"plum": [221, 160, 221],
|
|
130
|
-
"powderblue": [176, 224, 230],
|
|
131
|
-
"purple": [128, 0, 128],
|
|
132
|
-
"rebeccapurple": [102, 51, 153],
|
|
133
|
-
"red": [255, 0, 0],
|
|
134
|
-
"rosybrown": [188, 143, 143],
|
|
135
|
-
"royalblue": [65, 105, 225],
|
|
136
|
-
"saddlebrown": [139, 69, 19],
|
|
137
|
-
"salmon": [250, 128, 114],
|
|
138
|
-
"sandybrown": [244, 164, 96],
|
|
139
|
-
"seagreen": [46, 139, 87],
|
|
140
|
-
"seashell": [255, 245, 238],
|
|
141
|
-
"sienna": [160, 82, 45],
|
|
142
|
-
"silver": [192, 192, 192],
|
|
143
|
-
"skyblue": [135, 206, 235],
|
|
144
|
-
"slateblue": [106, 90, 205],
|
|
145
|
-
"slategray": [112, 128, 144],
|
|
146
|
-
"slategrey": [112, 128, 144],
|
|
147
|
-
"snow": [255, 250, 250],
|
|
148
|
-
"springgreen": [0, 255, 127],
|
|
149
|
-
"steelblue": [70, 130, 180],
|
|
150
|
-
"tan": [210, 180, 140],
|
|
151
|
-
"teal": [0, 128, 128],
|
|
152
|
-
"thistle": [216, 191, 216],
|
|
153
|
-
"tomato": [255, 99, 71],
|
|
154
|
-
"turquoise": [64, 224, 208],
|
|
155
|
-
"violet": [238, 130, 238],
|
|
156
|
-
"wheat": [245, 222, 179],
|
|
157
|
-
"white": [255, 255, 255],
|
|
158
|
-
"whitesmoke": [245, 245, 245],
|
|
159
|
-
"yellow": [255, 255, 0],
|
|
160
|
-
"yellowgreen": [154, 205, 50]
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
// ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js
|
|
166
|
-
var require_conversions = __commonJS({
|
|
167
|
-
"../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"(exports, module) {
|
|
168
|
-
init_esm_shims();
|
|
169
|
-
var __import_colorName = __toESM(require_color_name());
|
|
170
|
-
var cssKeywords = __import_colorName;
|
|
171
|
-
var reverseKeywords = {};
|
|
172
|
-
for (const key of Object.keys(cssKeywords)) {
|
|
173
|
-
reverseKeywords[cssKeywords[key]] = key;
|
|
174
|
-
}
|
|
175
|
-
var convert = {
|
|
176
|
-
rgb: { channels: 3, labels: "rgb" },
|
|
177
|
-
hsl: { channels: 3, labels: "hsl" },
|
|
178
|
-
hsv: { channels: 3, labels: "hsv" },
|
|
179
|
-
hwb: { channels: 3, labels: "hwb" },
|
|
180
|
-
cmyk: { channels: 4, labels: "cmyk" },
|
|
181
|
-
xyz: { channels: 3, labels: "xyz" },
|
|
182
|
-
lab: { channels: 3, labels: "lab" },
|
|
183
|
-
lch: { channels: 3, labels: "lch" },
|
|
184
|
-
hex: { channels: 1, labels: ["hex"] },
|
|
185
|
-
keyword: { channels: 1, labels: ["keyword"] },
|
|
186
|
-
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
187
|
-
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
188
|
-
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
189
|
-
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
190
|
-
gray: { channels: 1, labels: ["gray"] }
|
|
191
|
-
};
|
|
192
|
-
module.exports = convert;
|
|
193
|
-
for (const model of Object.keys(convert)) {
|
|
194
|
-
if (!("channels" in convert[model])) {
|
|
195
|
-
throw new Error("missing channels property: " + model);
|
|
196
|
-
}
|
|
197
|
-
if (!("labels" in convert[model])) {
|
|
198
|
-
throw new Error("missing channel labels property: " + model);
|
|
199
|
-
}
|
|
200
|
-
if (convert[model].labels.length !== convert[model].channels) {
|
|
201
|
-
throw new Error("channel and label counts mismatch: " + model);
|
|
202
|
-
}
|
|
203
|
-
const { channels, labels } = convert[model];
|
|
204
|
-
delete convert[model].channels;
|
|
205
|
-
delete convert[model].labels;
|
|
206
|
-
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
207
|
-
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
208
|
-
}
|
|
209
|
-
convert.rgb.hsl = function(rgb) {
|
|
210
|
-
const r = rgb[0] / 255;
|
|
211
|
-
const g = rgb[1] / 255;
|
|
212
|
-
const b = rgb[2] / 255;
|
|
213
|
-
const min = Math.min(r, g, b);
|
|
214
|
-
const max = Math.max(r, g, b);
|
|
215
|
-
const delta = max - min;
|
|
216
|
-
let h;
|
|
217
|
-
let s;
|
|
218
|
-
if (max === min) {
|
|
219
|
-
h = 0;
|
|
220
|
-
} else if (r === max) {
|
|
221
|
-
h = (g - b) / delta;
|
|
222
|
-
} else if (g === max) {
|
|
223
|
-
h = 2 + (b - r) / delta;
|
|
224
|
-
} else if (b === max) {
|
|
225
|
-
h = 4 + (r - g) / delta;
|
|
226
|
-
}
|
|
227
|
-
h = Math.min(h * 60, 360);
|
|
228
|
-
if (h < 0) {
|
|
229
|
-
h += 360;
|
|
230
|
-
}
|
|
231
|
-
const l = (min + max) / 2;
|
|
232
|
-
if (max === min) {
|
|
233
|
-
s = 0;
|
|
234
|
-
} else if (l <= 0.5) {
|
|
235
|
-
s = delta / (max + min);
|
|
236
|
-
} else {
|
|
237
|
-
s = delta / (2 - max - min);
|
|
238
|
-
}
|
|
239
|
-
return [h, s * 100, l * 100];
|
|
240
|
-
};
|
|
241
|
-
convert.rgb.hsv = function(rgb) {
|
|
242
|
-
let rdif;
|
|
243
|
-
let gdif;
|
|
244
|
-
let bdif;
|
|
245
|
-
let h;
|
|
246
|
-
let s;
|
|
247
|
-
const r = rgb[0] / 255;
|
|
248
|
-
const g = rgb[1] / 255;
|
|
249
|
-
const b = rgb[2] / 255;
|
|
250
|
-
const v = Math.max(r, g, b);
|
|
251
|
-
const diff = v - Math.min(r, g, b);
|
|
252
|
-
const diffc = function(c) {
|
|
253
|
-
return (v - c) / 6 / diff + 1 / 2;
|
|
254
|
-
};
|
|
255
|
-
if (diff === 0) {
|
|
256
|
-
h = 0;
|
|
257
|
-
s = 0;
|
|
258
|
-
} else {
|
|
259
|
-
s = diff / v;
|
|
260
|
-
rdif = diffc(r);
|
|
261
|
-
gdif = diffc(g);
|
|
262
|
-
bdif = diffc(b);
|
|
263
|
-
if (r === v) {
|
|
264
|
-
h = bdif - gdif;
|
|
265
|
-
} else if (g === v) {
|
|
266
|
-
h = 1 / 3 + rdif - bdif;
|
|
267
|
-
} else if (b === v) {
|
|
268
|
-
h = 2 / 3 + gdif - rdif;
|
|
269
|
-
}
|
|
270
|
-
if (h < 0) {
|
|
271
|
-
h += 1;
|
|
272
|
-
} else if (h > 1) {
|
|
273
|
-
h -= 1;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
return [
|
|
277
|
-
h * 360,
|
|
278
|
-
s * 100,
|
|
279
|
-
v * 100
|
|
280
|
-
];
|
|
281
|
-
};
|
|
282
|
-
convert.rgb.hwb = function(rgb) {
|
|
283
|
-
const r = rgb[0];
|
|
284
|
-
const g = rgb[1];
|
|
285
|
-
let b = rgb[2];
|
|
286
|
-
const h = convert.rgb.hsl(rgb)[0];
|
|
287
|
-
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
288
|
-
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
289
|
-
return [h, w * 100, b * 100];
|
|
290
|
-
};
|
|
291
|
-
convert.rgb.cmyk = function(rgb) {
|
|
292
|
-
const r = rgb[0] / 255;
|
|
293
|
-
const g = rgb[1] / 255;
|
|
294
|
-
const b = rgb[2] / 255;
|
|
295
|
-
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
296
|
-
const c = (1 - r - k) / (1 - k) || 0;
|
|
297
|
-
const m = (1 - g - k) / (1 - k) || 0;
|
|
298
|
-
const y = (1 - b - k) / (1 - k) || 0;
|
|
299
|
-
return [c * 100, m * 100, y * 100, k * 100];
|
|
300
|
-
};
|
|
301
|
-
function comparativeDistance(x, y) {
|
|
302
|
-
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
303
|
-
}
|
|
304
|
-
convert.rgb.keyword = function(rgb) {
|
|
305
|
-
const reversed = reverseKeywords[rgb];
|
|
306
|
-
if (reversed) {
|
|
307
|
-
return reversed;
|
|
308
|
-
}
|
|
309
|
-
let currentClosestDistance = Infinity;
|
|
310
|
-
let currentClosestKeyword;
|
|
311
|
-
for (const keyword of Object.keys(cssKeywords)) {
|
|
312
|
-
const value = cssKeywords[keyword];
|
|
313
|
-
const distance = comparativeDistance(rgb, value);
|
|
314
|
-
if (distance < currentClosestDistance) {
|
|
315
|
-
currentClosestDistance = distance;
|
|
316
|
-
currentClosestKeyword = keyword;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
return currentClosestKeyword;
|
|
320
|
-
};
|
|
321
|
-
convert.keyword.rgb = function(keyword) {
|
|
322
|
-
return cssKeywords[keyword];
|
|
323
|
-
};
|
|
324
|
-
convert.rgb.xyz = function(rgb) {
|
|
325
|
-
let r = rgb[0] / 255;
|
|
326
|
-
let g = rgb[1] / 255;
|
|
327
|
-
let b = rgb[2] / 255;
|
|
328
|
-
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
|
329
|
-
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
|
330
|
-
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
331
|
-
const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
332
|
-
const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
333
|
-
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
334
|
-
return [x * 100, y * 100, z * 100];
|
|
335
|
-
};
|
|
336
|
-
convert.rgb.lab = function(rgb) {
|
|
337
|
-
const xyz = convert.rgb.xyz(rgb);
|
|
338
|
-
let x = xyz[0];
|
|
339
|
-
let y = xyz[1];
|
|
340
|
-
let z = xyz[2];
|
|
341
|
-
x /= 95.047;
|
|
342
|
-
y /= 100;
|
|
343
|
-
z /= 108.883;
|
|
344
|
-
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
345
|
-
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
346
|
-
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
347
|
-
const l = 116 * y - 16;
|
|
348
|
-
const a = 500 * (x - y);
|
|
349
|
-
const b = 200 * (y - z);
|
|
350
|
-
return [l, a, b];
|
|
351
|
-
};
|
|
352
|
-
convert.hsl.rgb = function(hsl) {
|
|
353
|
-
const h = hsl[0] / 360;
|
|
354
|
-
const s = hsl[1] / 100;
|
|
355
|
-
const l = hsl[2] / 100;
|
|
356
|
-
let t2;
|
|
357
|
-
let t3;
|
|
358
|
-
let val;
|
|
359
|
-
if (s === 0) {
|
|
360
|
-
val = l * 255;
|
|
361
|
-
return [val, val, val];
|
|
362
|
-
}
|
|
363
|
-
if (l < 0.5) {
|
|
364
|
-
t2 = l * (1 + s);
|
|
365
|
-
} else {
|
|
366
|
-
t2 = l + s - l * s;
|
|
367
|
-
}
|
|
368
|
-
const t1 = 2 * l - t2;
|
|
369
|
-
const rgb = [0, 0, 0];
|
|
370
|
-
for (let i = 0; i < 3; i++) {
|
|
371
|
-
t3 = h + 1 / 3 * -(i - 1);
|
|
372
|
-
if (t3 < 0) {
|
|
373
|
-
t3++;
|
|
374
|
-
}
|
|
375
|
-
if (t3 > 1) {
|
|
376
|
-
t3--;
|
|
377
|
-
}
|
|
378
|
-
if (6 * t3 < 1) {
|
|
379
|
-
val = t1 + (t2 - t1) * 6 * t3;
|
|
380
|
-
} else if (2 * t3 < 1) {
|
|
381
|
-
val = t2;
|
|
382
|
-
} else if (3 * t3 < 2) {
|
|
383
|
-
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
384
|
-
} else {
|
|
385
|
-
val = t1;
|
|
386
|
-
}
|
|
387
|
-
rgb[i] = val * 255;
|
|
388
|
-
}
|
|
389
|
-
return rgb;
|
|
390
|
-
};
|
|
391
|
-
convert.hsl.hsv = function(hsl) {
|
|
392
|
-
const h = hsl[0];
|
|
393
|
-
let s = hsl[1] / 100;
|
|
394
|
-
let l = hsl[2] / 100;
|
|
395
|
-
let smin = s;
|
|
396
|
-
const lmin = Math.max(l, 0.01);
|
|
397
|
-
l *= 2;
|
|
398
|
-
s *= l <= 1 ? l : 2 - l;
|
|
399
|
-
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
400
|
-
const v = (l + s) / 2;
|
|
401
|
-
const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
402
|
-
return [h, sv * 100, v * 100];
|
|
403
|
-
};
|
|
404
|
-
convert.hsv.rgb = function(hsv) {
|
|
405
|
-
const h = hsv[0] / 60;
|
|
406
|
-
const s = hsv[1] / 100;
|
|
407
|
-
let v = hsv[2] / 100;
|
|
408
|
-
const hi = Math.floor(h) % 6;
|
|
409
|
-
const f = h - Math.floor(h);
|
|
410
|
-
const p = 255 * v * (1 - s);
|
|
411
|
-
const q = 255 * v * (1 - s * f);
|
|
412
|
-
const t = 255 * v * (1 - s * (1 - f));
|
|
413
|
-
v *= 255;
|
|
414
|
-
switch (hi) {
|
|
415
|
-
case 0:
|
|
416
|
-
return [v, t, p];
|
|
417
|
-
case 1:
|
|
418
|
-
return [q, v, p];
|
|
419
|
-
case 2:
|
|
420
|
-
return [p, v, t];
|
|
421
|
-
case 3:
|
|
422
|
-
return [p, q, v];
|
|
423
|
-
case 4:
|
|
424
|
-
return [t, p, v];
|
|
425
|
-
case 5:
|
|
426
|
-
return [v, p, q];
|
|
427
|
-
}
|
|
428
|
-
};
|
|
429
|
-
convert.hsv.hsl = function(hsv) {
|
|
430
|
-
const h = hsv[0];
|
|
431
|
-
const s = hsv[1] / 100;
|
|
432
|
-
const v = hsv[2] / 100;
|
|
433
|
-
const vmin = Math.max(v, 0.01);
|
|
434
|
-
let sl;
|
|
435
|
-
let l;
|
|
436
|
-
l = (2 - s) * v;
|
|
437
|
-
const lmin = (2 - s) * vmin;
|
|
438
|
-
sl = s * vmin;
|
|
439
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
440
|
-
sl = sl || 0;
|
|
441
|
-
l /= 2;
|
|
442
|
-
return [h, sl * 100, l * 100];
|
|
443
|
-
};
|
|
444
|
-
convert.hwb.rgb = function(hwb) {
|
|
445
|
-
const h = hwb[0] / 360;
|
|
446
|
-
let wh = hwb[1] / 100;
|
|
447
|
-
let bl = hwb[2] / 100;
|
|
448
|
-
const ratio = wh + bl;
|
|
449
|
-
let f;
|
|
450
|
-
if (ratio > 1) {
|
|
451
|
-
wh /= ratio;
|
|
452
|
-
bl /= ratio;
|
|
453
|
-
}
|
|
454
|
-
const i = Math.floor(6 * h);
|
|
455
|
-
const v = 1 - bl;
|
|
456
|
-
f = 6 * h - i;
|
|
457
|
-
if ((i & 1) !== 0) {
|
|
458
|
-
f = 1 - f;
|
|
459
|
-
}
|
|
460
|
-
const n = wh + f * (v - wh);
|
|
461
|
-
let r;
|
|
462
|
-
let g;
|
|
463
|
-
let b;
|
|
464
|
-
switch (i) {
|
|
465
|
-
default:
|
|
466
|
-
case 6:
|
|
467
|
-
case 0:
|
|
468
|
-
r = v;
|
|
469
|
-
g = n;
|
|
470
|
-
b = wh;
|
|
471
|
-
break;
|
|
472
|
-
case 1:
|
|
473
|
-
r = n;
|
|
474
|
-
g = v;
|
|
475
|
-
b = wh;
|
|
476
|
-
break;
|
|
477
|
-
case 2:
|
|
478
|
-
r = wh;
|
|
479
|
-
g = v;
|
|
480
|
-
b = n;
|
|
481
|
-
break;
|
|
482
|
-
case 3:
|
|
483
|
-
r = wh;
|
|
484
|
-
g = n;
|
|
485
|
-
b = v;
|
|
486
|
-
break;
|
|
487
|
-
case 4:
|
|
488
|
-
r = n;
|
|
489
|
-
g = wh;
|
|
490
|
-
b = v;
|
|
491
|
-
break;
|
|
492
|
-
case 5:
|
|
493
|
-
r = v;
|
|
494
|
-
g = wh;
|
|
495
|
-
b = n;
|
|
496
|
-
break;
|
|
497
|
-
}
|
|
498
|
-
return [r * 255, g * 255, b * 255];
|
|
499
|
-
};
|
|
500
|
-
convert.cmyk.rgb = function(cmyk) {
|
|
501
|
-
const c = cmyk[0] / 100;
|
|
502
|
-
const m = cmyk[1] / 100;
|
|
503
|
-
const y = cmyk[2] / 100;
|
|
504
|
-
const k = cmyk[3] / 100;
|
|
505
|
-
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
506
|
-
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
507
|
-
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
508
|
-
return [r * 255, g * 255, b * 255];
|
|
509
|
-
};
|
|
510
|
-
convert.xyz.rgb = function(xyz) {
|
|
511
|
-
const x = xyz[0] / 100;
|
|
512
|
-
const y = xyz[1] / 100;
|
|
513
|
-
const z = xyz[2] / 100;
|
|
514
|
-
let r;
|
|
515
|
-
let g;
|
|
516
|
-
let b;
|
|
517
|
-
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
518
|
-
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
519
|
-
b = x * 0.0557 + y * -0.204 + z * 1.057;
|
|
520
|
-
r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
|
|
521
|
-
g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
|
522
|
-
b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
|
|
523
|
-
r = Math.min(Math.max(0, r), 1);
|
|
524
|
-
g = Math.min(Math.max(0, g), 1);
|
|
525
|
-
b = Math.min(Math.max(0, b), 1);
|
|
526
|
-
return [r * 255, g * 255, b * 255];
|
|
527
|
-
};
|
|
528
|
-
convert.xyz.lab = function(xyz) {
|
|
529
|
-
let x = xyz[0];
|
|
530
|
-
let y = xyz[1];
|
|
531
|
-
let z = xyz[2];
|
|
532
|
-
x /= 95.047;
|
|
533
|
-
y /= 100;
|
|
534
|
-
z /= 108.883;
|
|
535
|
-
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
536
|
-
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
537
|
-
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
538
|
-
const l = 116 * y - 16;
|
|
539
|
-
const a = 500 * (x - y);
|
|
540
|
-
const b = 200 * (y - z);
|
|
541
|
-
return [l, a, b];
|
|
542
|
-
};
|
|
543
|
-
convert.lab.xyz = function(lab) {
|
|
544
|
-
const l = lab[0];
|
|
545
|
-
const a = lab[1];
|
|
546
|
-
const b = lab[2];
|
|
547
|
-
let x;
|
|
548
|
-
let y;
|
|
549
|
-
let z;
|
|
550
|
-
y = (l + 16) / 116;
|
|
551
|
-
x = a / 500 + y;
|
|
552
|
-
z = y - b / 200;
|
|
553
|
-
const y2 = y ** 3;
|
|
554
|
-
const x2 = x ** 3;
|
|
555
|
-
const z2 = z ** 3;
|
|
556
|
-
y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
|
|
557
|
-
x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
|
|
558
|
-
z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
|
|
559
|
-
x *= 95.047;
|
|
560
|
-
y *= 100;
|
|
561
|
-
z *= 108.883;
|
|
562
|
-
return [x, y, z];
|
|
563
|
-
};
|
|
564
|
-
convert.lab.lch = function(lab) {
|
|
565
|
-
const l = lab[0];
|
|
566
|
-
const a = lab[1];
|
|
567
|
-
const b = lab[2];
|
|
568
|
-
let h;
|
|
569
|
-
const hr = Math.atan2(b, a);
|
|
570
|
-
h = hr * 360 / 2 / Math.PI;
|
|
571
|
-
if (h < 0) {
|
|
572
|
-
h += 360;
|
|
573
|
-
}
|
|
574
|
-
const c = Math.sqrt(a * a + b * b);
|
|
575
|
-
return [l, c, h];
|
|
576
|
-
};
|
|
577
|
-
convert.lch.lab = function(lch) {
|
|
578
|
-
const l = lch[0];
|
|
579
|
-
const c = lch[1];
|
|
580
|
-
const h = lch[2];
|
|
581
|
-
const hr = h / 360 * 2 * Math.PI;
|
|
582
|
-
const a = c * Math.cos(hr);
|
|
583
|
-
const b = c * Math.sin(hr);
|
|
584
|
-
return [l, a, b];
|
|
585
|
-
};
|
|
586
|
-
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
587
|
-
const [r, g, b] = args;
|
|
588
|
-
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
589
|
-
value = Math.round(value / 50);
|
|
590
|
-
if (value === 0) {
|
|
591
|
-
return 30;
|
|
592
|
-
}
|
|
593
|
-
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
594
|
-
if (value === 2) {
|
|
595
|
-
ansi += 60;
|
|
596
|
-
}
|
|
597
|
-
return ansi;
|
|
598
|
-
};
|
|
599
|
-
convert.hsv.ansi16 = function(args) {
|
|
600
|
-
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
601
|
-
};
|
|
602
|
-
convert.rgb.ansi256 = function(args) {
|
|
603
|
-
const r = args[0];
|
|
604
|
-
const g = args[1];
|
|
605
|
-
const b = args[2];
|
|
606
|
-
if (r === g && g === b) {
|
|
607
|
-
if (r < 8) {
|
|
608
|
-
return 16;
|
|
609
|
-
}
|
|
610
|
-
if (r > 248) {
|
|
611
|
-
return 231;
|
|
612
|
-
}
|
|
613
|
-
return Math.round((r - 8) / 247 * 24) + 232;
|
|
614
|
-
}
|
|
615
|
-
const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
616
|
-
return ansi;
|
|
617
|
-
};
|
|
618
|
-
convert.ansi16.rgb = function(args) {
|
|
619
|
-
let color = args % 10;
|
|
620
|
-
if (color === 0 || color === 7) {
|
|
621
|
-
if (args > 50) {
|
|
622
|
-
color += 3.5;
|
|
623
|
-
}
|
|
624
|
-
color = color / 10.5 * 255;
|
|
625
|
-
return [color, color, color];
|
|
626
|
-
}
|
|
627
|
-
const mult = (~~(args > 50) + 1) * 0.5;
|
|
628
|
-
const r = (color & 1) * mult * 255;
|
|
629
|
-
const g = (color >> 1 & 1) * mult * 255;
|
|
630
|
-
const b = (color >> 2 & 1) * mult * 255;
|
|
631
|
-
return [r, g, b];
|
|
632
|
-
};
|
|
633
|
-
convert.ansi256.rgb = function(args) {
|
|
634
|
-
if (args >= 232) {
|
|
635
|
-
const c = (args - 232) * 10 + 8;
|
|
636
|
-
return [c, c, c];
|
|
637
|
-
}
|
|
638
|
-
args -= 16;
|
|
639
|
-
let rem;
|
|
640
|
-
const r = Math.floor(args / 36) / 5 * 255;
|
|
641
|
-
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
642
|
-
const b = rem % 6 / 5 * 255;
|
|
643
|
-
return [r, g, b];
|
|
644
|
-
};
|
|
645
|
-
convert.rgb.hex = function(args) {
|
|
646
|
-
const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
647
|
-
const string = integer.toString(16).toUpperCase();
|
|
648
|
-
return "000000".substring(string.length) + string;
|
|
649
|
-
};
|
|
650
|
-
convert.hex.rgb = function(args) {
|
|
651
|
-
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
652
|
-
if (!match) {
|
|
653
|
-
return [0, 0, 0];
|
|
654
|
-
}
|
|
655
|
-
let colorString = match[0];
|
|
656
|
-
if (match[0].length === 3) {
|
|
657
|
-
colorString = colorString.split("").map((char) => {
|
|
658
|
-
return char + char;
|
|
659
|
-
}).join("");
|
|
660
|
-
}
|
|
661
|
-
const integer = parseInt(colorString, 16);
|
|
662
|
-
const r = integer >> 16 & 255;
|
|
663
|
-
const g = integer >> 8 & 255;
|
|
664
|
-
const b = integer & 255;
|
|
665
|
-
return [r, g, b];
|
|
666
|
-
};
|
|
667
|
-
convert.rgb.hcg = function(rgb) {
|
|
668
|
-
const r = rgb[0] / 255;
|
|
669
|
-
const g = rgb[1] / 255;
|
|
670
|
-
const b = rgb[2] / 255;
|
|
671
|
-
const max = Math.max(Math.max(r, g), b);
|
|
672
|
-
const min = Math.min(Math.min(r, g), b);
|
|
673
|
-
const chroma = max - min;
|
|
674
|
-
let grayscale;
|
|
675
|
-
let hue;
|
|
676
|
-
if (chroma < 1) {
|
|
677
|
-
grayscale = min / (1 - chroma);
|
|
678
|
-
} else {
|
|
679
|
-
grayscale = 0;
|
|
680
|
-
}
|
|
681
|
-
if (chroma <= 0) {
|
|
682
|
-
hue = 0;
|
|
683
|
-
} else if (max === r) {
|
|
684
|
-
hue = (g - b) / chroma % 6;
|
|
685
|
-
} else if (max === g) {
|
|
686
|
-
hue = 2 + (b - r) / chroma;
|
|
687
|
-
} else {
|
|
688
|
-
hue = 4 + (r - g) / chroma;
|
|
689
|
-
}
|
|
690
|
-
hue /= 6;
|
|
691
|
-
hue %= 1;
|
|
692
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
|
693
|
-
};
|
|
694
|
-
convert.hsl.hcg = function(hsl) {
|
|
695
|
-
const s = hsl[1] / 100;
|
|
696
|
-
const l = hsl[2] / 100;
|
|
697
|
-
const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
|
698
|
-
let f = 0;
|
|
699
|
-
if (c < 1) {
|
|
700
|
-
f = (l - 0.5 * c) / (1 - c);
|
|
701
|
-
}
|
|
702
|
-
return [hsl[0], c * 100, f * 100];
|
|
703
|
-
};
|
|
704
|
-
convert.hsv.hcg = function(hsv) {
|
|
705
|
-
const s = hsv[1] / 100;
|
|
706
|
-
const v = hsv[2] / 100;
|
|
707
|
-
const c = s * v;
|
|
708
|
-
let f = 0;
|
|
709
|
-
if (c < 1) {
|
|
710
|
-
f = (v - c) / (1 - c);
|
|
711
|
-
}
|
|
712
|
-
return [hsv[0], c * 100, f * 100];
|
|
713
|
-
};
|
|
714
|
-
convert.hcg.rgb = function(hcg) {
|
|
715
|
-
const h = hcg[0] / 360;
|
|
716
|
-
const c = hcg[1] / 100;
|
|
717
|
-
const g = hcg[2] / 100;
|
|
718
|
-
if (c === 0) {
|
|
719
|
-
return [g * 255, g * 255, g * 255];
|
|
720
|
-
}
|
|
721
|
-
const pure = [0, 0, 0];
|
|
722
|
-
const hi = h % 1 * 6;
|
|
723
|
-
const v = hi % 1;
|
|
724
|
-
const w = 1 - v;
|
|
725
|
-
let mg = 0;
|
|
726
|
-
switch (Math.floor(hi)) {
|
|
727
|
-
case 0:
|
|
728
|
-
pure[0] = 1;
|
|
729
|
-
pure[1] = v;
|
|
730
|
-
pure[2] = 0;
|
|
731
|
-
break;
|
|
732
|
-
case 1:
|
|
733
|
-
pure[0] = w;
|
|
734
|
-
pure[1] = 1;
|
|
735
|
-
pure[2] = 0;
|
|
736
|
-
break;
|
|
737
|
-
case 2:
|
|
738
|
-
pure[0] = 0;
|
|
739
|
-
pure[1] = 1;
|
|
740
|
-
pure[2] = v;
|
|
741
|
-
break;
|
|
742
|
-
case 3:
|
|
743
|
-
pure[0] = 0;
|
|
744
|
-
pure[1] = w;
|
|
745
|
-
pure[2] = 1;
|
|
746
|
-
break;
|
|
747
|
-
case 4:
|
|
748
|
-
pure[0] = v;
|
|
749
|
-
pure[1] = 0;
|
|
750
|
-
pure[2] = 1;
|
|
751
|
-
break;
|
|
752
|
-
default:
|
|
753
|
-
pure[0] = 1;
|
|
754
|
-
pure[1] = 0;
|
|
755
|
-
pure[2] = w;
|
|
756
|
-
}
|
|
757
|
-
mg = (1 - c) * g;
|
|
758
|
-
return [
|
|
759
|
-
(c * pure[0] + mg) * 255,
|
|
760
|
-
(c * pure[1] + mg) * 255,
|
|
761
|
-
(c * pure[2] + mg) * 255
|
|
762
|
-
];
|
|
763
|
-
};
|
|
764
|
-
convert.hcg.hsv = function(hcg) {
|
|
765
|
-
const c = hcg[1] / 100;
|
|
766
|
-
const g = hcg[2] / 100;
|
|
767
|
-
const v = c + g * (1 - c);
|
|
768
|
-
let f = 0;
|
|
769
|
-
if (v > 0) {
|
|
770
|
-
f = c / v;
|
|
771
|
-
}
|
|
772
|
-
return [hcg[0], f * 100, v * 100];
|
|
773
|
-
};
|
|
774
|
-
convert.hcg.hsl = function(hcg) {
|
|
775
|
-
const c = hcg[1] / 100;
|
|
776
|
-
const g = hcg[2] / 100;
|
|
777
|
-
const l = g * (1 - c) + 0.5 * c;
|
|
778
|
-
let s = 0;
|
|
779
|
-
if (l > 0 && l < 0.5) {
|
|
780
|
-
s = c / (2 * l);
|
|
781
|
-
} else if (l >= 0.5 && l < 1) {
|
|
782
|
-
s = c / (2 * (1 - l));
|
|
783
|
-
}
|
|
784
|
-
return [hcg[0], s * 100, l * 100];
|
|
785
|
-
};
|
|
786
|
-
convert.hcg.hwb = function(hcg) {
|
|
787
|
-
const c = hcg[1] / 100;
|
|
788
|
-
const g = hcg[2] / 100;
|
|
789
|
-
const v = c + g * (1 - c);
|
|
790
|
-
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
791
|
-
};
|
|
792
|
-
convert.hwb.hcg = function(hwb) {
|
|
793
|
-
const w = hwb[1] / 100;
|
|
794
|
-
const b = hwb[2] / 100;
|
|
795
|
-
const v = 1 - b;
|
|
796
|
-
const c = v - w;
|
|
797
|
-
let g = 0;
|
|
798
|
-
if (c < 1) {
|
|
799
|
-
g = (v - c) / (1 - c);
|
|
800
|
-
}
|
|
801
|
-
return [hwb[0], c * 100, g * 100];
|
|
802
|
-
};
|
|
803
|
-
convert.apple.rgb = function(apple) {
|
|
804
|
-
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
805
|
-
};
|
|
806
|
-
convert.rgb.apple = function(rgb) {
|
|
807
|
-
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
808
|
-
};
|
|
809
|
-
convert.gray.rgb = function(args) {
|
|
810
|
-
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
811
|
-
};
|
|
812
|
-
convert.gray.hsl = function(args) {
|
|
813
|
-
return [0, 0, args[0]];
|
|
814
|
-
};
|
|
815
|
-
convert.gray.hsv = convert.gray.hsl;
|
|
816
|
-
convert.gray.hwb = function(gray) {
|
|
817
|
-
return [0, 100, gray[0]];
|
|
818
|
-
};
|
|
819
|
-
convert.gray.cmyk = function(gray) {
|
|
820
|
-
return [0, 0, 0, gray[0]];
|
|
821
|
-
};
|
|
822
|
-
convert.gray.lab = function(gray) {
|
|
823
|
-
return [gray[0], 0, 0];
|
|
824
|
-
};
|
|
825
|
-
convert.gray.hex = function(gray) {
|
|
826
|
-
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
827
|
-
const integer = (val << 16) + (val << 8) + val;
|
|
828
|
-
const string = integer.toString(16).toUpperCase();
|
|
829
|
-
return "000000".substring(string.length) + string;
|
|
830
|
-
};
|
|
831
|
-
convert.rgb.gray = function(rgb) {
|
|
832
|
-
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
833
|
-
return [val / 255 * 100];
|
|
834
|
-
};
|
|
835
|
-
}
|
|
836
|
-
});
|
|
837
|
-
|
|
838
|
-
// ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js
|
|
839
|
-
var require_route = __commonJS({
|
|
840
|
-
"../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"(exports, module) {
|
|
841
|
-
init_esm_shims();
|
|
842
|
-
var __import___conversions = __toESM(require_conversions());
|
|
843
|
-
var conversions = __import___conversions;
|
|
844
|
-
function buildGraph() {
|
|
845
|
-
const graph = {};
|
|
846
|
-
const models = Object.keys(conversions);
|
|
847
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
848
|
-
graph[models[i]] = {
|
|
849
|
-
// http://jsperf.com/1-vs-infinity
|
|
850
|
-
// micro-opt, but this is simple.
|
|
851
|
-
distance: -1,
|
|
852
|
-
parent: null
|
|
853
|
-
};
|
|
854
|
-
}
|
|
855
|
-
return graph;
|
|
856
|
-
}
|
|
857
|
-
function deriveBFS(fromModel) {
|
|
858
|
-
const graph = buildGraph();
|
|
859
|
-
const queue = [fromModel];
|
|
860
|
-
graph[fromModel].distance = 0;
|
|
861
|
-
while (queue.length) {
|
|
862
|
-
const current = queue.pop();
|
|
863
|
-
const adjacents = Object.keys(conversions[current]);
|
|
864
|
-
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
865
|
-
const adjacent = adjacents[i];
|
|
866
|
-
const node = graph[adjacent];
|
|
867
|
-
if (node.distance === -1) {
|
|
868
|
-
node.distance = graph[current].distance + 1;
|
|
869
|
-
node.parent = current;
|
|
870
|
-
queue.unshift(adjacent);
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
return graph;
|
|
875
|
-
}
|
|
876
|
-
function link(from, to) {
|
|
877
|
-
return function(args) {
|
|
878
|
-
return to(from(args));
|
|
879
|
-
};
|
|
880
|
-
}
|
|
881
|
-
function wrapConversion(toModel, graph) {
|
|
882
|
-
const path = [graph[toModel].parent, toModel];
|
|
883
|
-
let fn = conversions[graph[toModel].parent][toModel];
|
|
884
|
-
let cur = graph[toModel].parent;
|
|
885
|
-
while (graph[cur].parent) {
|
|
886
|
-
path.unshift(graph[cur].parent);
|
|
887
|
-
fn = link(conversions[graph[cur].parent][cur], fn);
|
|
888
|
-
cur = graph[cur].parent;
|
|
889
|
-
}
|
|
890
|
-
fn.conversion = path;
|
|
891
|
-
return fn;
|
|
892
|
-
}
|
|
893
|
-
module.exports = function(fromModel) {
|
|
894
|
-
const graph = deriveBFS(fromModel);
|
|
895
|
-
const conversion = {};
|
|
896
|
-
const models = Object.keys(graph);
|
|
897
|
-
for (let len = models.length, i = 0; i < len; i++) {
|
|
898
|
-
const toModel = models[i];
|
|
899
|
-
const node = graph[toModel];
|
|
900
|
-
if (node.parent === null) {
|
|
901
|
-
continue;
|
|
902
|
-
}
|
|
903
|
-
conversion[toModel] = wrapConversion(toModel, graph);
|
|
904
|
-
}
|
|
905
|
-
return conversion;
|
|
906
|
-
};
|
|
907
|
-
}
|
|
908
|
-
});
|
|
909
|
-
|
|
910
|
-
// ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js
|
|
911
|
-
var require_color_convert = __commonJS({
|
|
912
|
-
"../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"(exports, module) {
|
|
913
|
-
init_esm_shims();
|
|
914
|
-
var __import___conversions = __toESM(require_conversions());
|
|
915
|
-
var __import___route = __toESM(require_route());
|
|
916
|
-
var conversions = __import___conversions;
|
|
917
|
-
var route = __import___route;
|
|
918
|
-
var convert = {};
|
|
919
|
-
var models = Object.keys(conversions);
|
|
920
|
-
function wrapRaw(fn) {
|
|
921
|
-
const wrappedFn = function(...args) {
|
|
922
|
-
const arg0 = args[0];
|
|
923
|
-
if (arg0 === void 0 || arg0 === null) {
|
|
924
|
-
return arg0;
|
|
925
|
-
}
|
|
926
|
-
if (arg0.length > 1) {
|
|
927
|
-
args = arg0;
|
|
928
|
-
}
|
|
929
|
-
return fn(args);
|
|
930
|
-
};
|
|
931
|
-
if ("conversion" in fn) {
|
|
932
|
-
wrappedFn.conversion = fn.conversion;
|
|
933
|
-
}
|
|
934
|
-
return wrappedFn;
|
|
935
|
-
}
|
|
936
|
-
function wrapRounded(fn) {
|
|
937
|
-
const wrappedFn = function(...args) {
|
|
938
|
-
const arg0 = args[0];
|
|
939
|
-
if (arg0 === void 0 || arg0 === null) {
|
|
940
|
-
return arg0;
|
|
941
|
-
}
|
|
942
|
-
if (arg0.length > 1) {
|
|
943
|
-
args = arg0;
|
|
944
|
-
}
|
|
945
|
-
const result = fn(args);
|
|
946
|
-
if (typeof result === "object") {
|
|
947
|
-
for (let len = result.length, i = 0; i < len; i++) {
|
|
948
|
-
result[i] = Math.round(result[i]);
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
return result;
|
|
952
|
-
};
|
|
953
|
-
if ("conversion" in fn) {
|
|
954
|
-
wrappedFn.conversion = fn.conversion;
|
|
955
|
-
}
|
|
956
|
-
return wrappedFn;
|
|
957
|
-
}
|
|
958
|
-
models.forEach((fromModel) => {
|
|
959
|
-
convert[fromModel] = {};
|
|
960
|
-
Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
|
|
961
|
-
Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
|
|
962
|
-
const routes = route(fromModel);
|
|
963
|
-
const routeModels = Object.keys(routes);
|
|
964
|
-
routeModels.forEach((toModel) => {
|
|
965
|
-
const fn = routes[toModel];
|
|
966
|
-
convert[fromModel][toModel] = wrapRounded(fn);
|
|
967
|
-
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
968
|
-
});
|
|
969
|
-
});
|
|
970
|
-
module.exports = convert;
|
|
971
|
-
}
|
|
972
|
-
});
|
|
973
|
-
|
|
974
|
-
// ../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js
|
|
975
|
-
var require_ansi_styles = __commonJS({
|
|
976
|
-
"../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"(exports, module) {
|
|
977
|
-
init_esm_shims();
|
|
978
|
-
var __import_colorConvert = __toESM(require_color_convert());
|
|
979
|
-
var wrapAnsi16 = (fn, offset) => (...args) => {
|
|
980
|
-
const code = fn(...args);
|
|
981
|
-
return `\x1B[${code + offset}m`;
|
|
982
|
-
};
|
|
983
|
-
var wrapAnsi256 = (fn, offset) => (...args) => {
|
|
984
|
-
const code = fn(...args);
|
|
985
|
-
return `\x1B[${38 + offset};5;${code}m`;
|
|
986
|
-
};
|
|
987
|
-
var wrapAnsi16m = (fn, offset) => (...args) => {
|
|
988
|
-
const rgb = fn(...args);
|
|
989
|
-
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
990
|
-
};
|
|
991
|
-
var ansi2ansi = (n) => n;
|
|
992
|
-
var rgb2rgb = (r, g, b) => [r, g, b];
|
|
993
|
-
var setLazyProperty = (object, property, get) => {
|
|
994
|
-
Object.defineProperty(object, property, {
|
|
995
|
-
get: () => {
|
|
996
|
-
const value = get();
|
|
997
|
-
Object.defineProperty(object, property, {
|
|
998
|
-
value,
|
|
999
|
-
enumerable: true,
|
|
1000
|
-
configurable: true
|
|
1001
|
-
});
|
|
1002
|
-
return value;
|
|
1003
|
-
},
|
|
1004
|
-
enumerable: true,
|
|
1005
|
-
configurable: true
|
|
1006
|
-
});
|
|
1007
|
-
};
|
|
1008
|
-
var colorConvert;
|
|
1009
|
-
var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
1010
|
-
if (colorConvert === void 0) {
|
|
1011
|
-
colorConvert = __import_colorConvert;
|
|
1012
|
-
}
|
|
1013
|
-
const offset = isBackground ? 10 : 0;
|
|
1014
|
-
const styles = {};
|
|
1015
|
-
for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
|
|
1016
|
-
const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
1017
|
-
if (sourceSpace === targetSpace) {
|
|
1018
|
-
styles[name] = wrap(identity, offset);
|
|
1019
|
-
} else if (typeof suite === "object") {
|
|
1020
|
-
styles[name] = wrap(suite[targetSpace], offset);
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
return styles;
|
|
1024
|
-
};
|
|
1025
|
-
function assembleStyles() {
|
|
1026
|
-
const codes = /* @__PURE__ */ new Map();
|
|
1027
|
-
const styles = {
|
|
1028
|
-
modifier: {
|
|
1029
|
-
reset: [0, 0],
|
|
1030
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
1031
|
-
bold: [1, 22],
|
|
1032
|
-
dim: [2, 22],
|
|
1033
|
-
italic: [3, 23],
|
|
1034
|
-
underline: [4, 24],
|
|
1035
|
-
inverse: [7, 27],
|
|
1036
|
-
hidden: [8, 28],
|
|
1037
|
-
strikethrough: [9, 29]
|
|
1038
|
-
},
|
|
1039
|
-
color: {
|
|
1040
|
-
black: [30, 39],
|
|
1041
|
-
red: [31, 39],
|
|
1042
|
-
green: [32, 39],
|
|
1043
|
-
yellow: [33, 39],
|
|
1044
|
-
blue: [34, 39],
|
|
1045
|
-
magenta: [35, 39],
|
|
1046
|
-
cyan: [36, 39],
|
|
1047
|
-
white: [37, 39],
|
|
1048
|
-
// Bright color
|
|
1049
|
-
blackBright: [90, 39],
|
|
1050
|
-
redBright: [91, 39],
|
|
1051
|
-
greenBright: [92, 39],
|
|
1052
|
-
yellowBright: [93, 39],
|
|
1053
|
-
blueBright: [94, 39],
|
|
1054
|
-
magentaBright: [95, 39],
|
|
1055
|
-
cyanBright: [96, 39],
|
|
1056
|
-
whiteBright: [97, 39]
|
|
1057
|
-
},
|
|
1058
|
-
bgColor: {
|
|
1059
|
-
bgBlack: [40, 49],
|
|
1060
|
-
bgRed: [41, 49],
|
|
1061
|
-
bgGreen: [42, 49],
|
|
1062
|
-
bgYellow: [43, 49],
|
|
1063
|
-
bgBlue: [44, 49],
|
|
1064
|
-
bgMagenta: [45, 49],
|
|
1065
|
-
bgCyan: [46, 49],
|
|
1066
|
-
bgWhite: [47, 49],
|
|
1067
|
-
// Bright color
|
|
1068
|
-
bgBlackBright: [100, 49],
|
|
1069
|
-
bgRedBright: [101, 49],
|
|
1070
|
-
bgGreenBright: [102, 49],
|
|
1071
|
-
bgYellowBright: [103, 49],
|
|
1072
|
-
bgBlueBright: [104, 49],
|
|
1073
|
-
bgMagentaBright: [105, 49],
|
|
1074
|
-
bgCyanBright: [106, 49],
|
|
1075
|
-
bgWhiteBright: [107, 49]
|
|
1076
|
-
}
|
|
1077
|
-
};
|
|
1078
|
-
styles.color.gray = styles.color.blackBright;
|
|
1079
|
-
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
|
|
1080
|
-
styles.color.grey = styles.color.blackBright;
|
|
1081
|
-
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
|
|
1082
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
1083
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
1084
|
-
styles[styleName] = {
|
|
1085
|
-
open: `\x1B[${style[0]}m`,
|
|
1086
|
-
close: `\x1B[${style[1]}m`
|
|
1087
|
-
};
|
|
1088
|
-
group[styleName] = styles[styleName];
|
|
1089
|
-
codes.set(style[0], style[1]);
|
|
1090
|
-
}
|
|
1091
|
-
Object.defineProperty(styles, groupName, {
|
|
1092
|
-
value: group,
|
|
1093
|
-
enumerable: false
|
|
1094
|
-
});
|
|
1095
|
-
}
|
|
1096
|
-
Object.defineProperty(styles, "codes", {
|
|
1097
|
-
value: codes,
|
|
1098
|
-
enumerable: false
|
|
1099
|
-
});
|
|
1100
|
-
styles.color.close = "\x1B[39m";
|
|
1101
|
-
styles.bgColor.close = "\x1B[49m";
|
|
1102
|
-
setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
1103
|
-
setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
1104
|
-
setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
1105
|
-
setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
1106
|
-
setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
1107
|
-
setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
1108
|
-
return styles;
|
|
1109
|
-
}
|
|
1110
|
-
Object.defineProperty(module, "exports", {
|
|
1111
|
-
enumerable: true,
|
|
1112
|
-
get: assembleStyles
|
|
1113
|
-
});
|
|
1114
|
-
}
|
|
1115
|
-
});
|
|
1116
|
-
|
|
1117
|
-
// ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
|
|
1118
|
-
var require_has_flag = __commonJS({
|
|
1119
|
-
"../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module) {
|
|
1120
|
-
"use strict";
|
|
1121
|
-
init_esm_shims();
|
|
1122
|
-
module.exports = (flag, argv = process.argv) => {
|
|
1123
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
1124
|
-
const position = argv.indexOf(prefix + flag);
|
|
1125
|
-
const terminatorPosition = argv.indexOf("--");
|
|
1126
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
1127
|
-
};
|
|
1128
|
-
}
|
|
1129
|
-
});
|
|
1130
|
-
|
|
1131
|
-
// ../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js
|
|
1132
|
-
import * as __import_os from "os";
|
|
1133
|
-
import * as __import_tty from "tty";
|
|
1134
|
-
var require_supports_color = __commonJS({
|
|
1135
|
-
"../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports, module) {
|
|
1136
|
-
init_esm_shims();
|
|
1137
|
-
var __import_hasFlag = __toESM(require_has_flag());
|
|
1138
|
-
var os = __import_os;
|
|
1139
|
-
var tty = __import_tty;
|
|
1140
|
-
var hasFlag = __import_hasFlag;
|
|
1141
|
-
var { env } = process;
|
|
1142
|
-
var forceColor;
|
|
1143
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
1144
|
-
forceColor = 0;
|
|
1145
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
1146
|
-
forceColor = 1;
|
|
1147
|
-
}
|
|
1148
|
-
if ("FORCE_COLOR" in env) {
|
|
1149
|
-
if (env.FORCE_COLOR === "true") {
|
|
1150
|
-
forceColor = 1;
|
|
1151
|
-
} else if (env.FORCE_COLOR === "false") {
|
|
1152
|
-
forceColor = 0;
|
|
1153
|
-
} else {
|
|
1154
|
-
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
|
-
function translateLevel(level) {
|
|
1158
|
-
if (level === 0) {
|
|
1159
|
-
return false;
|
|
1160
|
-
}
|
|
1161
|
-
return {
|
|
1162
|
-
level,
|
|
1163
|
-
hasBasic: true,
|
|
1164
|
-
has256: level >= 2,
|
|
1165
|
-
has16m: level >= 3
|
|
1166
|
-
};
|
|
1167
|
-
}
|
|
1168
|
-
function supportsColor(haveStream, streamIsTTY) {
|
|
1169
|
-
if (forceColor === 0) {
|
|
1170
|
-
return 0;
|
|
1171
|
-
}
|
|
1172
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
1173
|
-
return 3;
|
|
1174
|
-
}
|
|
1175
|
-
if (hasFlag("color=256")) {
|
|
1176
|
-
return 2;
|
|
1177
|
-
}
|
|
1178
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
1179
|
-
return 0;
|
|
1180
|
-
}
|
|
1181
|
-
const min = forceColor || 0;
|
|
1182
|
-
if (env.TERM === "dumb") {
|
|
1183
|
-
return min;
|
|
1184
|
-
}
|
|
1185
|
-
if (process.platform === "win32") {
|
|
1186
|
-
const osRelease = os.release().split(".");
|
|
1187
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
1188
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
1189
|
-
}
|
|
1190
|
-
return 1;
|
|
1191
|
-
}
|
|
1192
|
-
if ("CI" in env) {
|
|
1193
|
-
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
1194
|
-
return 1;
|
|
1195
|
-
}
|
|
1196
|
-
return min;
|
|
1197
|
-
}
|
|
1198
|
-
if ("TEAMCITY_VERSION" in env) {
|
|
1199
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
1200
|
-
}
|
|
1201
|
-
if (env.COLORTERM === "truecolor") {
|
|
1202
|
-
return 3;
|
|
1203
|
-
}
|
|
1204
|
-
if ("TERM_PROGRAM" in env) {
|
|
1205
|
-
const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
1206
|
-
switch (env.TERM_PROGRAM) {
|
|
1207
|
-
case "iTerm.app":
|
|
1208
|
-
return version >= 3 ? 3 : 2;
|
|
1209
|
-
case "Apple_Terminal":
|
|
1210
|
-
return 2;
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
1214
|
-
return 2;
|
|
1215
|
-
}
|
|
1216
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
1217
|
-
return 1;
|
|
1218
|
-
}
|
|
1219
|
-
if ("COLORTERM" in env) {
|
|
1220
|
-
return 1;
|
|
1221
|
-
}
|
|
1222
|
-
return min;
|
|
1223
|
-
}
|
|
1224
|
-
function getSupportLevel(stream) {
|
|
1225
|
-
const level = supportsColor(stream, stream && stream.isTTY);
|
|
1226
|
-
return translateLevel(level);
|
|
1227
|
-
}
|
|
1228
|
-
module.exports = {
|
|
1229
|
-
supportsColor: getSupportLevel,
|
|
1230
|
-
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
1231
|
-
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
1232
|
-
};
|
|
1233
|
-
}
|
|
1234
|
-
});
|
|
1235
|
-
|
|
1236
|
-
// ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js
|
|
1237
|
-
var require_util = __commonJS({
|
|
1238
|
-
"../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js"(exports, module) {
|
|
1239
|
-
"use strict";
|
|
1240
|
-
init_esm_shims();
|
|
1241
|
-
var stringReplaceAll = (string, substring, replacer) => {
|
|
1242
|
-
let index = string.indexOf(substring);
|
|
1243
|
-
if (index === -1) {
|
|
1244
|
-
return string;
|
|
1245
|
-
}
|
|
1246
|
-
const substringLength = substring.length;
|
|
1247
|
-
let endIndex = 0;
|
|
1248
|
-
let returnValue = "";
|
|
1249
|
-
do {
|
|
1250
|
-
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
1251
|
-
endIndex = index + substringLength;
|
|
1252
|
-
index = string.indexOf(substring, endIndex);
|
|
1253
|
-
} while (index !== -1);
|
|
1254
|
-
returnValue += string.substr(endIndex);
|
|
1255
|
-
return returnValue;
|
|
1256
|
-
};
|
|
1257
|
-
var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
|
|
1258
|
-
let endIndex = 0;
|
|
1259
|
-
let returnValue = "";
|
|
1260
|
-
do {
|
|
1261
|
-
const gotCR = string[index - 1] === "\r";
|
|
1262
|
-
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
1263
|
-
endIndex = index + 1;
|
|
1264
|
-
index = string.indexOf("\n", endIndex);
|
|
1265
|
-
} while (index !== -1);
|
|
1266
|
-
returnValue += string.substr(endIndex);
|
|
1267
|
-
return returnValue;
|
|
1268
|
-
};
|
|
1269
|
-
module.exports = {
|
|
1270
|
-
stringReplaceAll,
|
|
1271
|
-
stringEncaseCRLFWithFirstIndex
|
|
1272
|
-
};
|
|
1273
|
-
}
|
|
1274
|
-
});
|
|
1275
|
-
|
|
1276
|
-
// ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js
|
|
1277
|
-
var require_templates = __commonJS({
|
|
1278
|
-
"../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js"(exports, module) {
|
|
1279
|
-
"use strict";
|
|
1280
|
-
init_esm_shims();
|
|
1281
|
-
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;
|
|
1282
|
-
var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
1283
|
-
var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
1284
|
-
var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
1285
|
-
var ESCAPES = /* @__PURE__ */ new Map([
|
|
1286
|
-
["n", "\n"],
|
|
1287
|
-
["r", "\r"],
|
|
1288
|
-
["t", " "],
|
|
1289
|
-
["b", "\b"],
|
|
1290
|
-
["f", "\f"],
|
|
1291
|
-
["v", "\v"],
|
|
1292
|
-
["0", "\0"],
|
|
1293
|
-
["\\", "\\"],
|
|
1294
|
-
["e", "\x1B"],
|
|
1295
|
-
["a", "\x07"]
|
|
1296
|
-
]);
|
|
1297
|
-
function unescape(c) {
|
|
1298
|
-
const u = c[0] === "u";
|
|
1299
|
-
const bracket = c[1] === "{";
|
|
1300
|
-
if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
|
|
1301
|
-
return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
1302
|
-
}
|
|
1303
|
-
if (u && bracket) {
|
|
1304
|
-
return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
|
1305
|
-
}
|
|
1306
|
-
return ESCAPES.get(c) || c;
|
|
1307
|
-
}
|
|
1308
|
-
function parseArguments(name, arguments_) {
|
|
1309
|
-
const results = [];
|
|
1310
|
-
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
1311
|
-
let matches;
|
|
1312
|
-
for (const chunk of chunks) {
|
|
1313
|
-
const number = Number(chunk);
|
|
1314
|
-
if (!Number.isNaN(number)) {
|
|
1315
|
-
results.push(number);
|
|
1316
|
-
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
1317
|
-
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
|
|
1318
|
-
} else {
|
|
1319
|
-
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
|
|
1320
|
-
}
|
|
1321
|
-
}
|
|
1322
|
-
return results;
|
|
1323
|
-
}
|
|
1324
|
-
function parseStyle(style) {
|
|
1325
|
-
STYLE_REGEX.lastIndex = 0;
|
|
1326
|
-
const results = [];
|
|
1327
|
-
let matches;
|
|
1328
|
-
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
1329
|
-
const name = matches[1];
|
|
1330
|
-
if (matches[2]) {
|
|
1331
|
-
const args = parseArguments(name, matches[2]);
|
|
1332
|
-
results.push([name].concat(args));
|
|
1333
|
-
} else {
|
|
1334
|
-
results.push([name]);
|
|
1335
|
-
}
|
|
1336
|
-
}
|
|
1337
|
-
return results;
|
|
1338
|
-
}
|
|
1339
|
-
function buildStyle(chalk2, styles) {
|
|
1340
|
-
const enabled = {};
|
|
1341
|
-
for (const layer of styles) {
|
|
1342
|
-
for (const style of layer.styles) {
|
|
1343
|
-
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
1344
|
-
}
|
|
1345
|
-
}
|
|
1346
|
-
let current = chalk2;
|
|
1347
|
-
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
1348
|
-
if (!Array.isArray(styles2)) {
|
|
1349
|
-
continue;
|
|
1350
|
-
}
|
|
1351
|
-
if (!(styleName in current)) {
|
|
1352
|
-
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
1353
|
-
}
|
|
1354
|
-
current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
|
|
1355
|
-
}
|
|
1356
|
-
return current;
|
|
1357
|
-
}
|
|
1358
|
-
module.exports = (chalk2, temporary) => {
|
|
1359
|
-
const styles = [];
|
|
1360
|
-
const chunks = [];
|
|
1361
|
-
let chunk = [];
|
|
1362
|
-
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
1363
|
-
if (escapeCharacter) {
|
|
1364
|
-
chunk.push(unescape(escapeCharacter));
|
|
1365
|
-
} else if (style) {
|
|
1366
|
-
const string = chunk.join("");
|
|
1367
|
-
chunk = [];
|
|
1368
|
-
chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
|
|
1369
|
-
styles.push({ inverse, styles: parseStyle(style) });
|
|
1370
|
-
} else if (close) {
|
|
1371
|
-
if (styles.length === 0) {
|
|
1372
|
-
throw new Error("Found extraneous } in Chalk template literal");
|
|
1373
|
-
}
|
|
1374
|
-
chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
|
|
1375
|
-
chunk = [];
|
|
1376
|
-
styles.pop();
|
|
1377
|
-
} else {
|
|
1378
|
-
chunk.push(character);
|
|
1379
|
-
}
|
|
1380
|
-
});
|
|
1381
|
-
chunks.push(chunk.join(""));
|
|
1382
|
-
if (styles.length > 0) {
|
|
1383
|
-
const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
|
|
1384
|
-
throw new Error(errMessage);
|
|
1385
|
-
}
|
|
1386
|
-
return chunks.join("");
|
|
1387
|
-
};
|
|
1388
|
-
}
|
|
1389
|
-
});
|
|
1390
|
-
|
|
1391
|
-
// ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js
|
|
1392
|
-
var require_source = __commonJS({
|
|
1393
|
-
"../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js"(exports, module) {
|
|
1394
|
-
init_esm_shims();
|
|
1395
|
-
var __import_ansiStyles = __toESM(require_ansi_styles());
|
|
1396
|
-
var __import_supportsColor = __toESM(require_supports_color());
|
|
1397
|
-
var __import___util = __toESM(require_util());
|
|
1398
|
-
var __import___templates = __toESM(require_templates());
|
|
1399
|
-
var ansiStyles = __import_ansiStyles;
|
|
1400
|
-
var { stdout: stdoutColor, stderr: stderrColor } = __import_supportsColor;
|
|
1401
|
-
var {
|
|
1402
|
-
stringReplaceAll,
|
|
1403
|
-
stringEncaseCRLFWithFirstIndex
|
|
1404
|
-
} = __import___util;
|
|
1405
|
-
var { isArray } = Array;
|
|
1406
|
-
var levelMapping = [
|
|
1407
|
-
"ansi",
|
|
1408
|
-
"ansi",
|
|
1409
|
-
"ansi256",
|
|
1410
|
-
"ansi16m"
|
|
1411
|
-
];
|
|
1412
|
-
var styles = /* @__PURE__ */ Object.create(null);
|
|
1413
|
-
var applyOptions = (object, options = {}) => {
|
|
1414
|
-
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
1415
|
-
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
1416
|
-
}
|
|
1417
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
1418
|
-
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
1419
|
-
};
|
|
1420
|
-
var ChalkClass = class {
|
|
1421
|
-
constructor(options) {
|
|
1422
|
-
return chalkFactory(options);
|
|
1423
|
-
}
|
|
1424
|
-
};
|
|
1425
|
-
var chalkFactory = (options) => {
|
|
1426
|
-
const chalk3 = {};
|
|
1427
|
-
applyOptions(chalk3, options);
|
|
1428
|
-
chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
|
|
1429
|
-
Object.setPrototypeOf(chalk3, Chalk.prototype);
|
|
1430
|
-
Object.setPrototypeOf(chalk3.template, chalk3);
|
|
1431
|
-
chalk3.template.constructor = () => {
|
|
1432
|
-
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
1433
|
-
};
|
|
1434
|
-
chalk3.template.Instance = ChalkClass;
|
|
1435
|
-
return chalk3.template;
|
|
1436
|
-
};
|
|
1437
|
-
function Chalk(options) {
|
|
1438
|
-
return chalkFactory(options);
|
|
1439
|
-
}
|
|
1440
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
1441
|
-
styles[styleName] = {
|
|
1442
|
-
get() {
|
|
1443
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
1444
|
-
Object.defineProperty(this, styleName, { value: builder });
|
|
1445
|
-
return builder;
|
|
1446
|
-
}
|
|
1447
|
-
};
|
|
1448
|
-
}
|
|
1449
|
-
styles.visible = {
|
|
1450
|
-
get() {
|
|
1451
|
-
const builder = createBuilder(this, this._styler, true);
|
|
1452
|
-
Object.defineProperty(this, "visible", { value: builder });
|
|
1453
|
-
return builder;
|
|
1454
|
-
}
|
|
1455
|
-
};
|
|
1456
|
-
var usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
1457
|
-
for (const model of usedModels) {
|
|
1458
|
-
styles[model] = {
|
|
1459
|
-
get() {
|
|
1460
|
-
const { level } = this;
|
|
1461
|
-
return function(...arguments_) {
|
|
1462
|
-
const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
|
|
1463
|
-
return createBuilder(this, styler, this._isEmpty);
|
|
1464
|
-
};
|
|
1465
|
-
}
|
|
1466
|
-
};
|
|
1467
|
-
}
|
|
1468
|
-
for (const model of usedModels) {
|
|
1469
|
-
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
1470
|
-
styles[bgModel] = {
|
|
1471
|
-
get() {
|
|
1472
|
-
const { level } = this;
|
|
1473
|
-
return function(...arguments_) {
|
|
1474
|
-
const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
|
|
1475
|
-
return createBuilder(this, styler, this._isEmpty);
|
|
1476
|
-
};
|
|
1477
|
-
}
|
|
1478
|
-
};
|
|
1479
|
-
}
|
|
1480
|
-
var proto = Object.defineProperties(() => {
|
|
1481
|
-
}, {
|
|
1482
|
-
...styles,
|
|
1483
|
-
level: {
|
|
1484
|
-
enumerable: true,
|
|
1485
|
-
get() {
|
|
1486
|
-
return this._generator.level;
|
|
1487
|
-
},
|
|
1488
|
-
set(level) {
|
|
1489
|
-
this._generator.level = level;
|
|
1490
|
-
}
|
|
1491
|
-
}
|
|
1492
|
-
});
|
|
1493
|
-
var createStyler = (open, close, parent) => {
|
|
1494
|
-
let openAll;
|
|
1495
|
-
let closeAll;
|
|
1496
|
-
if (parent === void 0) {
|
|
1497
|
-
openAll = open;
|
|
1498
|
-
closeAll = close;
|
|
1499
|
-
} else {
|
|
1500
|
-
openAll = parent.openAll + open;
|
|
1501
|
-
closeAll = close + parent.closeAll;
|
|
1502
|
-
}
|
|
1503
|
-
return {
|
|
1504
|
-
open,
|
|
1505
|
-
close,
|
|
1506
|
-
openAll,
|
|
1507
|
-
closeAll,
|
|
1508
|
-
parent
|
|
1509
|
-
};
|
|
1510
|
-
};
|
|
1511
|
-
var createBuilder = (self, _styler, _isEmpty) => {
|
|
1512
|
-
const builder = (...arguments_) => {
|
|
1513
|
-
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
1514
|
-
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
1515
|
-
}
|
|
1516
|
-
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
1517
|
-
};
|
|
1518
|
-
Object.setPrototypeOf(builder, proto);
|
|
1519
|
-
builder._generator = self;
|
|
1520
|
-
builder._styler = _styler;
|
|
1521
|
-
builder._isEmpty = _isEmpty;
|
|
1522
|
-
return builder;
|
|
1523
|
-
};
|
|
1524
|
-
var applyStyle = (self, string) => {
|
|
1525
|
-
if (self.level <= 0 || !string) {
|
|
1526
|
-
return self._isEmpty ? "" : string;
|
|
1527
|
-
}
|
|
1528
|
-
let styler = self._styler;
|
|
1529
|
-
if (styler === void 0) {
|
|
1530
|
-
return string;
|
|
1531
|
-
}
|
|
1532
|
-
const { openAll, closeAll } = styler;
|
|
1533
|
-
if (string.indexOf("\x1B") !== -1) {
|
|
1534
|
-
while (styler !== void 0) {
|
|
1535
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
1536
|
-
styler = styler.parent;
|
|
1537
|
-
}
|
|
1538
|
-
}
|
|
1539
|
-
const lfIndex = string.indexOf("\n");
|
|
1540
|
-
if (lfIndex !== -1) {
|
|
1541
|
-
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
1542
|
-
}
|
|
1543
|
-
return openAll + string + closeAll;
|
|
1544
|
-
};
|
|
1545
|
-
var template;
|
|
1546
|
-
var chalkTag = (chalk3, ...strings) => {
|
|
1547
|
-
const [firstString] = strings;
|
|
1548
|
-
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
1549
|
-
return strings.join(" ");
|
|
1550
|
-
}
|
|
1551
|
-
const arguments_ = strings.slice(1);
|
|
1552
|
-
const parts = [firstString.raw[0]];
|
|
1553
|
-
for (let i = 1; i < firstString.length; i++) {
|
|
1554
|
-
parts.push(
|
|
1555
|
-
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
1556
|
-
String(firstString.raw[i])
|
|
1557
|
-
);
|
|
1558
|
-
}
|
|
1559
|
-
if (template === void 0) {
|
|
1560
|
-
template = __import___templates;
|
|
1561
|
-
}
|
|
1562
|
-
return template(chalk3, parts.join(""));
|
|
1563
|
-
};
|
|
1564
|
-
Object.defineProperties(Chalk.prototype, styles);
|
|
1565
|
-
var chalk2 = Chalk();
|
|
1566
|
-
chalk2.supportsColor = stdoutColor;
|
|
1567
|
-
chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
1568
|
-
chalk2.stderr.supportsColor = stderrColor;
|
|
1569
|
-
module.exports = chalk2;
|
|
1570
|
-
}
|
|
1571
|
-
});
|
|
1572
|
-
|
|
1573
|
-
// ../config-tools/src/logger/console.ts
|
|
1574
|
-
init_esm_shims();
|
|
1575
|
-
|
|
1576
|
-
// ../config-tools/src/types.ts
|
|
1577
|
-
init_esm_shims();
|
|
1578
|
-
var LogLevel = {
|
|
1579
|
-
SILENT: 0,
|
|
1580
|
-
FATAL: 10,
|
|
1581
|
-
ERROR: 20,
|
|
1582
|
-
WARN: 30,
|
|
1583
|
-
SUCCESS: 35,
|
|
1584
|
-
INFO: 40,
|
|
1585
|
-
DEBUG: 60,
|
|
1586
|
-
TRACE: 70,
|
|
1587
|
-
ALL: 100
|
|
1588
|
-
};
|
|
1589
|
-
var LogLevelLabel = {
|
|
1590
|
-
SILENT: "silent",
|
|
1591
|
-
FATAL: "fatal",
|
|
1592
|
-
ERROR: "error",
|
|
1593
|
-
WARN: "warn",
|
|
1594
|
-
SUCCESS: "success",
|
|
1595
|
-
INFO: "info",
|
|
1596
|
-
DEBUG: "debug",
|
|
1597
|
-
TRACE: "trace",
|
|
1598
|
-
ALL: "all"
|
|
1599
|
-
};
|
|
1600
|
-
|
|
1601
|
-
// ../config-tools/src/utilities/colors.ts
|
|
1602
|
-
init_esm_shims();
|
|
1603
|
-
var DEFAULT_COLOR_CONFIG = {
|
|
1604
|
-
light: {
|
|
1605
|
-
background: "#fafafa",
|
|
1606
|
-
foreground: "#1d1e22",
|
|
1607
|
-
brand: "#1fb2a6",
|
|
1608
|
-
alternate: "#db2777",
|
|
1609
|
-
help: "#5C4EE5",
|
|
1610
|
-
success: "#087f5b",
|
|
1611
|
-
info: "#0550ae",
|
|
1612
|
-
warning: "#e3b341",
|
|
1613
|
-
danger: "#D8314A",
|
|
1614
|
-
fatal: "#51070f",
|
|
1615
|
-
link: "#3fa6ff",
|
|
1616
|
-
positive: "#22c55e",
|
|
1617
|
-
negative: "#dc2626",
|
|
1618
|
-
gradient: ["#1fb2a6", "#db2777", "#5C4EE5"]
|
|
1619
|
-
},
|
|
1620
|
-
dark: {
|
|
1621
|
-
background: "#1d1e22",
|
|
1622
|
-
foreground: "#cbd5e1",
|
|
1623
|
-
brand: "#2dd4bf",
|
|
1624
|
-
alternate: "#db2777",
|
|
1625
|
-
help: "#818cf8",
|
|
1626
|
-
success: "#10b981",
|
|
1627
|
-
info: "#58a6ff",
|
|
1628
|
-
warning: "#f3d371",
|
|
1629
|
-
danger: "#D8314A",
|
|
1630
|
-
fatal: "#a40e26",
|
|
1631
|
-
link: "#3fa6ff",
|
|
1632
|
-
positive: "#22c55e",
|
|
1633
|
-
negative: "#dc2626",
|
|
1634
|
-
gradient: ["#1fb2a6", "#db2777", "#818cf8"]
|
|
1635
|
-
}
|
|
1636
|
-
};
|
|
1637
|
-
|
|
1638
|
-
// ../config-tools/src/logger/chalk.ts
|
|
1639
|
-
init_esm_shims();
|
|
1640
|
-
var import_chalk = __toESM(require_source(), 1);
|
|
1641
|
-
var chalkDefault = {
|
|
1642
|
-
hex: (_) => (message) => message,
|
|
1643
|
-
bgHex: (_) => ({
|
|
1644
|
-
whiteBright: (message) => message,
|
|
1645
|
-
white: (message) => message
|
|
1646
|
-
}),
|
|
1647
|
-
white: (message) => message,
|
|
1648
|
-
whiteBright: (message) => message,
|
|
1649
|
-
gray: (message) => message,
|
|
1650
|
-
bold: {
|
|
1651
|
-
hex: (_) => (message) => message,
|
|
1652
|
-
bgHex: (_) => ({
|
|
1653
|
-
whiteBright: (message) => message,
|
|
1654
|
-
white: (message) => message
|
|
1655
|
-
}),
|
|
1656
|
-
whiteBright: (message) => message,
|
|
1657
|
-
white: (message) => message
|
|
1658
|
-
},
|
|
1659
|
-
dim: {
|
|
1660
|
-
hex: (_) => (message) => message,
|
|
1661
|
-
gray: (message) => message
|
|
1662
|
-
}
|
|
1663
|
-
};
|
|
1664
|
-
var getChalk = () => {
|
|
1665
|
-
let _chalk = import_chalk.default;
|
|
1666
|
-
if (!_chalk?.hex || !_chalk?.bold?.hex || !_chalk?.bgHex || !_chalk?.whiteBright || !_chalk?.white) {
|
|
1667
|
-
_chalk = chalkDefault;
|
|
1668
|
-
}
|
|
1669
|
-
return _chalk;
|
|
1670
|
-
};
|
|
1671
|
-
|
|
1672
|
-
// ../config-tools/src/logger/console-icons.ts
|
|
1673
|
-
init_esm_shims();
|
|
1674
|
-
|
|
1675
|
-
// ../config-tools/src/logger/is-unicode-supported.ts
|
|
1676
|
-
init_esm_shims();
|
|
1677
|
-
function isUnicodeSupported() {
|
|
1678
|
-
if (process.platform !== "win32") {
|
|
1679
|
-
return process.env.TERM !== "linux";
|
|
1680
|
-
}
|
|
1681
|
-
return Boolean(process.env.WT_SESSION) || // Windows Terminal
|
|
1682
|
-
Boolean(process.env.TERMINUS_SUBLIME) || // Terminus (<0.2.27)
|
|
1683
|
-
process.env.ConEmuTask === "{cmd::Cmder}" || // ConEmu and cmder
|
|
1684
|
-
process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERM === "rxvt-unicode" || process.env.TERM === "rxvt-unicode-256color" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
1685
|
-
}
|
|
1686
|
-
|
|
1687
|
-
// ../config-tools/src/logger/console-icons.ts
|
|
1688
|
-
var useIcon = (c, fallback) => isUnicodeSupported() ? c : fallback;
|
|
1689
|
-
var CONSOLE_ICONS = {
|
|
1690
|
-
[LogLevelLabel.ERROR]: useIcon("\u2718", "\xD7"),
|
|
1691
|
-
[LogLevelLabel.FATAL]: useIcon("\u{1F480}", "\xD7"),
|
|
1692
|
-
[LogLevelLabel.WARN]: useIcon("\u26A0", "\u203C"),
|
|
1693
|
-
[LogLevelLabel.INFO]: useIcon("\u2139", "i"),
|
|
1694
|
-
[LogLevelLabel.SUCCESS]: useIcon("\u2714", "\u221A"),
|
|
1695
|
-
[LogLevelLabel.DEBUG]: useIcon("\u{1F6E0}", "D"),
|
|
1696
|
-
[LogLevelLabel.TRACE]: useIcon("\u{1F6E0}", "T"),
|
|
1697
|
-
[LogLevelLabel.ALL]: useIcon("\u2709", "\u2192")
|
|
1698
|
-
};
|
|
1699
|
-
|
|
1700
|
-
// ../config-tools/src/logger/format-timestamp.ts
|
|
1701
|
-
init_esm_shims();
|
|
1702
|
-
var formatTimestamp = (date = /* @__PURE__ */ new Date()) => {
|
|
1703
|
-
return `${date.toLocaleDateString()} ${date.toLocaleTimeString()}`;
|
|
1704
|
-
};
|
|
1705
|
-
|
|
1706
|
-
// ../config-tools/src/logger/get-log-level.ts
|
|
1707
|
-
init_esm_shims();
|
|
1708
|
-
var getLogLevel = (label) => {
|
|
1709
|
-
switch (label) {
|
|
1710
|
-
case "all":
|
|
1711
|
-
return LogLevel.ALL;
|
|
1712
|
-
case "trace":
|
|
1713
|
-
return LogLevel.TRACE;
|
|
1714
|
-
case "debug":
|
|
1715
|
-
return LogLevel.DEBUG;
|
|
1716
|
-
case "info":
|
|
1717
|
-
return LogLevel.INFO;
|
|
1718
|
-
case "warn":
|
|
1719
|
-
return LogLevel.WARN;
|
|
1720
|
-
case "error":
|
|
1721
|
-
return LogLevel.ERROR;
|
|
1722
|
-
case "fatal":
|
|
1723
|
-
return LogLevel.FATAL;
|
|
1724
|
-
case "silent":
|
|
1725
|
-
return LogLevel.SILENT;
|
|
1726
|
-
default:
|
|
1727
|
-
return LogLevel.INFO;
|
|
1728
|
-
}
|
|
1729
|
-
};
|
|
1730
|
-
|
|
1731
|
-
// ../config-tools/src/logger/console.ts
|
|
1732
|
-
var getLogFn = (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
1733
|
-
const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
|
|
1734
|
-
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
1735
|
-
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
1736
|
-
return (_) => {
|
|
1737
|
-
};
|
|
1738
|
-
}
|
|
1739
|
-
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
1740
|
-
return (message) => {
|
|
1741
|
-
console.error(
|
|
1742
|
-
`
|
|
1743
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? DEFAULT_COLOR_CONFIG.dark.fatal)(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
1744
|
-
`
|
|
1745
|
-
);
|
|
1746
|
-
};
|
|
1747
|
-
}
|
|
1748
|
-
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
1749
|
-
return (message) => {
|
|
1750
|
-
console.error(
|
|
1751
|
-
`
|
|
1752
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? DEFAULT_COLOR_CONFIG.dark.danger)(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
1753
|
-
`
|
|
1754
|
-
);
|
|
1755
|
-
};
|
|
1756
|
-
}
|
|
1757
|
-
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
1758
|
-
return (message) => {
|
|
1759
|
-
console.warn(
|
|
1760
|
-
`
|
|
1761
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? DEFAULT_COLOR_CONFIG.dark.warning)(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
1762
|
-
`
|
|
1763
|
-
);
|
|
1764
|
-
};
|
|
1765
|
-
}
|
|
1766
|
-
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
1767
|
-
return (message) => {
|
|
1768
|
-
console.info(
|
|
1769
|
-
`
|
|
1770
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? DEFAULT_COLOR_CONFIG.dark.success)(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
1771
|
-
`
|
|
1772
|
-
);
|
|
1773
|
-
};
|
|
1774
|
-
}
|
|
1775
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
1776
|
-
return (message) => {
|
|
1777
|
-
console.info(
|
|
1778
|
-
`
|
|
1779
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
1780
|
-
`
|
|
1781
|
-
);
|
|
1782
|
-
};
|
|
1783
|
-
}
|
|
1784
|
-
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
1785
|
-
return (message) => {
|
|
1786
|
-
console.debug(
|
|
1787
|
-
`
|
|
1788
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
1789
|
-
`
|
|
1790
|
-
);
|
|
1791
|
-
};
|
|
1792
|
-
}
|
|
1793
|
-
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
1794
|
-
return (message) => {
|
|
1795
|
-
console.debug(
|
|
1796
|
-
`
|
|
1797
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? DEFAULT_COLOR_CONFIG.dark.info)(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
1798
|
-
`
|
|
1799
|
-
);
|
|
1800
|
-
};
|
|
1801
|
-
}
|
|
1802
|
-
return (message) => {
|
|
1803
|
-
console.log(
|
|
1804
|
-
`
|
|
1805
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? DEFAULT_COLOR_CONFIG.dark.brand)(`[${CONSOLE_ICONS[LogLevelLabel.ALL]} System] `)}${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
1806
|
-
`
|
|
1807
|
-
);
|
|
1808
|
-
};
|
|
1809
|
-
};
|
|
1810
|
-
var writeError = (message, config) => getLogFn(LogLevel.ERROR, config)(message);
|
|
1811
|
-
var writeTrace = (message, config) => getLogFn(LogLevel.TRACE, config)(message);
|
|
1812
|
-
var MAX_DEPTH = 4;
|
|
1813
|
-
var formatLogMessage = (message, options = {}, depth = 0) => {
|
|
1814
|
-
if (depth > MAX_DEPTH) {
|
|
1815
|
-
return "<max depth>";
|
|
1816
|
-
}
|
|
1817
|
-
const prefix = options.prefix ?? "-";
|
|
1818
|
-
const skip = options.skip ?? [];
|
|
1819
|
-
return typeof message === "undefined" || message === null || !message && typeof message !== "boolean" ? "<none>" : typeof message === "string" ? message : Array.isArray(message) ? `
|
|
1820
|
-
${message.map((item, index) => ` ${prefix}> #${index} = ${formatLogMessage(item, { prefix: `${prefix}-`, skip }, depth + 1)}`).join("\n")}` : typeof message === "object" ? `
|
|
1821
|
-
${Object.keys(message).filter((key) => !skip.includes(key)).map(
|
|
1822
|
-
(key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(
|
|
1823
|
-
message[key],
|
|
1824
|
-
{ prefix: `${prefix}-`, skip },
|
|
1825
|
-
depth + 1
|
|
1826
|
-
) : message[key]}`
|
|
1827
|
-
).join("\n")}` : message;
|
|
1828
|
-
};
|
|
1829
|
-
var _isFunction = (value) => {
|
|
1830
|
-
try {
|
|
1831
|
-
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
1832
|
-
} catch {
|
|
1833
|
-
return false;
|
|
1834
|
-
}
|
|
1835
|
-
};
|
|
1836
|
-
|
|
1837
|
-
export {
|
|
1838
|
-
writeError,
|
|
1839
|
-
writeTrace
|
|
1840
|
-
};
|