@forsakringskassan/commitlint-config 1.2.0 → 1.3.0

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