@wemake.cx/sequential-thinking 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -26,6 +26,7 @@ var __export = (target, all) => {
26
26
  set: (newValue) => all[name] = () => newValue
27
27
  });
28
28
  };
29
+ var __require = import.meta.require;
29
30
 
30
31
  // ../../node_modules/uri-js/dist/es5/uri.all.js
31
32
  var require_uri_all = __commonJS((exports, module) => {
@@ -6194,6 +6195,1523 @@ var require_ajv = __commonJS((exports, module) => {
6194
6195
  function noop() {}
6195
6196
  });
6196
6197
 
6198
+ // ../../node_modules/color-name/index.js
6199
+ var require_color_name = __commonJS((exports, module) => {
6200
+ module.exports = {
6201
+ aliceblue: [240, 248, 255],
6202
+ antiquewhite: [250, 235, 215],
6203
+ aqua: [0, 255, 255],
6204
+ aquamarine: [127, 255, 212],
6205
+ azure: [240, 255, 255],
6206
+ beige: [245, 245, 220],
6207
+ bisque: [255, 228, 196],
6208
+ black: [0, 0, 0],
6209
+ blanchedalmond: [255, 235, 205],
6210
+ blue: [0, 0, 255],
6211
+ blueviolet: [138, 43, 226],
6212
+ brown: [165, 42, 42],
6213
+ burlywood: [222, 184, 135],
6214
+ cadetblue: [95, 158, 160],
6215
+ chartreuse: [127, 255, 0],
6216
+ chocolate: [210, 105, 30],
6217
+ coral: [255, 127, 80],
6218
+ cornflowerblue: [100, 149, 237],
6219
+ cornsilk: [255, 248, 220],
6220
+ crimson: [220, 20, 60],
6221
+ cyan: [0, 255, 255],
6222
+ darkblue: [0, 0, 139],
6223
+ darkcyan: [0, 139, 139],
6224
+ darkgoldenrod: [184, 134, 11],
6225
+ darkgray: [169, 169, 169],
6226
+ darkgreen: [0, 100, 0],
6227
+ darkgrey: [169, 169, 169],
6228
+ darkkhaki: [189, 183, 107],
6229
+ darkmagenta: [139, 0, 139],
6230
+ darkolivegreen: [85, 107, 47],
6231
+ darkorange: [255, 140, 0],
6232
+ darkorchid: [153, 50, 204],
6233
+ darkred: [139, 0, 0],
6234
+ darksalmon: [233, 150, 122],
6235
+ darkseagreen: [143, 188, 143],
6236
+ darkslateblue: [72, 61, 139],
6237
+ darkslategray: [47, 79, 79],
6238
+ darkslategrey: [47, 79, 79],
6239
+ darkturquoise: [0, 206, 209],
6240
+ darkviolet: [148, 0, 211],
6241
+ deeppink: [255, 20, 147],
6242
+ deepskyblue: [0, 191, 255],
6243
+ dimgray: [105, 105, 105],
6244
+ dimgrey: [105, 105, 105],
6245
+ dodgerblue: [30, 144, 255],
6246
+ firebrick: [178, 34, 34],
6247
+ floralwhite: [255, 250, 240],
6248
+ forestgreen: [34, 139, 34],
6249
+ fuchsia: [255, 0, 255],
6250
+ gainsboro: [220, 220, 220],
6251
+ ghostwhite: [248, 248, 255],
6252
+ gold: [255, 215, 0],
6253
+ goldenrod: [218, 165, 32],
6254
+ gray: [128, 128, 128],
6255
+ green: [0, 128, 0],
6256
+ greenyellow: [173, 255, 47],
6257
+ grey: [128, 128, 128],
6258
+ honeydew: [240, 255, 240],
6259
+ hotpink: [255, 105, 180],
6260
+ indianred: [205, 92, 92],
6261
+ indigo: [75, 0, 130],
6262
+ ivory: [255, 255, 240],
6263
+ khaki: [240, 230, 140],
6264
+ lavender: [230, 230, 250],
6265
+ lavenderblush: [255, 240, 245],
6266
+ lawngreen: [124, 252, 0],
6267
+ lemonchiffon: [255, 250, 205],
6268
+ lightblue: [173, 216, 230],
6269
+ lightcoral: [240, 128, 128],
6270
+ lightcyan: [224, 255, 255],
6271
+ lightgoldenrodyellow: [250, 250, 210],
6272
+ lightgray: [211, 211, 211],
6273
+ lightgreen: [144, 238, 144],
6274
+ lightgrey: [211, 211, 211],
6275
+ lightpink: [255, 182, 193],
6276
+ lightsalmon: [255, 160, 122],
6277
+ lightseagreen: [32, 178, 170],
6278
+ lightskyblue: [135, 206, 250],
6279
+ lightslategray: [119, 136, 153],
6280
+ lightslategrey: [119, 136, 153],
6281
+ lightsteelblue: [176, 196, 222],
6282
+ lightyellow: [255, 255, 224],
6283
+ lime: [0, 255, 0],
6284
+ limegreen: [50, 205, 50],
6285
+ linen: [250, 240, 230],
6286
+ magenta: [255, 0, 255],
6287
+ maroon: [128, 0, 0],
6288
+ mediumaquamarine: [102, 205, 170],
6289
+ mediumblue: [0, 0, 205],
6290
+ mediumorchid: [186, 85, 211],
6291
+ mediumpurple: [147, 112, 219],
6292
+ mediumseagreen: [60, 179, 113],
6293
+ mediumslateblue: [123, 104, 238],
6294
+ mediumspringgreen: [0, 250, 154],
6295
+ mediumturquoise: [72, 209, 204],
6296
+ mediumvioletred: [199, 21, 133],
6297
+ midnightblue: [25, 25, 112],
6298
+ mintcream: [245, 255, 250],
6299
+ mistyrose: [255, 228, 225],
6300
+ moccasin: [255, 228, 181],
6301
+ navajowhite: [255, 222, 173],
6302
+ navy: [0, 0, 128],
6303
+ oldlace: [253, 245, 230],
6304
+ olive: [128, 128, 0],
6305
+ olivedrab: [107, 142, 35],
6306
+ orange: [255, 165, 0],
6307
+ orangered: [255, 69, 0],
6308
+ orchid: [218, 112, 214],
6309
+ palegoldenrod: [238, 232, 170],
6310
+ palegreen: [152, 251, 152],
6311
+ paleturquoise: [175, 238, 238],
6312
+ palevioletred: [219, 112, 147],
6313
+ papayawhip: [255, 239, 213],
6314
+ peachpuff: [255, 218, 185],
6315
+ peru: [205, 133, 63],
6316
+ pink: [255, 192, 203],
6317
+ plum: [221, 160, 221],
6318
+ powderblue: [176, 224, 230],
6319
+ purple: [128, 0, 128],
6320
+ rebeccapurple: [102, 51, 153],
6321
+ red: [255, 0, 0],
6322
+ rosybrown: [188, 143, 143],
6323
+ royalblue: [65, 105, 225],
6324
+ saddlebrown: [139, 69, 19],
6325
+ salmon: [250, 128, 114],
6326
+ sandybrown: [244, 164, 96],
6327
+ seagreen: [46, 139, 87],
6328
+ seashell: [255, 245, 238],
6329
+ sienna: [160, 82, 45],
6330
+ silver: [192, 192, 192],
6331
+ skyblue: [135, 206, 235],
6332
+ slateblue: [106, 90, 205],
6333
+ slategray: [112, 128, 144],
6334
+ slategrey: [112, 128, 144],
6335
+ snow: [255, 250, 250],
6336
+ springgreen: [0, 255, 127],
6337
+ steelblue: [70, 130, 180],
6338
+ tan: [210, 180, 140],
6339
+ teal: [0, 128, 128],
6340
+ thistle: [216, 191, 216],
6341
+ tomato: [255, 99, 71],
6342
+ turquoise: [64, 224, 208],
6343
+ violet: [238, 130, 238],
6344
+ wheat: [245, 222, 179],
6345
+ white: [255, 255, 255],
6346
+ whitesmoke: [245, 245, 245],
6347
+ yellow: [255, 255, 0],
6348
+ yellowgreen: [154, 205, 50]
6349
+ };
6350
+ });
6351
+
6352
+ // ../../node_modules/color-convert/conversions.js
6353
+ var require_conversions = __commonJS((exports, module) => {
6354
+ var cssKeywords = require_color_name();
6355
+ var reverseKeywords = {};
6356
+ for (const key of Object.keys(cssKeywords)) {
6357
+ reverseKeywords[cssKeywords[key]] = key;
6358
+ }
6359
+ var convert = {
6360
+ rgb: { channels: 3, labels: "rgb" },
6361
+ hsl: { channels: 3, labels: "hsl" },
6362
+ hsv: { channels: 3, labels: "hsv" },
6363
+ hwb: { channels: 3, labels: "hwb" },
6364
+ cmyk: { channels: 4, labels: "cmyk" },
6365
+ xyz: { channels: 3, labels: "xyz" },
6366
+ lab: { channels: 3, labels: "lab" },
6367
+ lch: { channels: 3, labels: "lch" },
6368
+ hex: { channels: 1, labels: ["hex"] },
6369
+ keyword: { channels: 1, labels: ["keyword"] },
6370
+ ansi16: { channels: 1, labels: ["ansi16"] },
6371
+ ansi256: { channels: 1, labels: ["ansi256"] },
6372
+ hcg: { channels: 3, labels: ["h", "c", "g"] },
6373
+ apple: { channels: 3, labels: ["r16", "g16", "b16"] },
6374
+ gray: { channels: 1, labels: ["gray"] }
6375
+ };
6376
+ module.exports = convert;
6377
+ for (const model of Object.keys(convert)) {
6378
+ if (!("channels" in convert[model])) {
6379
+ throw new Error("missing channels property: " + model);
6380
+ }
6381
+ if (!("labels" in convert[model])) {
6382
+ throw new Error("missing channel labels property: " + model);
6383
+ }
6384
+ if (convert[model].labels.length !== convert[model].channels) {
6385
+ throw new Error("channel and label counts mismatch: " + model);
6386
+ }
6387
+ const { channels, labels } = convert[model];
6388
+ delete convert[model].channels;
6389
+ delete convert[model].labels;
6390
+ Object.defineProperty(convert[model], "channels", { value: channels });
6391
+ Object.defineProperty(convert[model], "labels", { value: labels });
6392
+ }
6393
+ convert.rgb.hsl = function(rgb) {
6394
+ const r = rgb[0] / 255;
6395
+ const g = rgb[1] / 255;
6396
+ const b = rgb[2] / 255;
6397
+ const min = Math.min(r, g, b);
6398
+ const max = Math.max(r, g, b);
6399
+ const delta = max - min;
6400
+ let h;
6401
+ let s;
6402
+ if (max === min) {
6403
+ h = 0;
6404
+ } else if (r === max) {
6405
+ h = (g - b) / delta;
6406
+ } else if (g === max) {
6407
+ h = 2 + (b - r) / delta;
6408
+ } else if (b === max) {
6409
+ h = 4 + (r - g) / delta;
6410
+ }
6411
+ h = Math.min(h * 60, 360);
6412
+ if (h < 0) {
6413
+ h += 360;
6414
+ }
6415
+ const l = (min + max) / 2;
6416
+ if (max === min) {
6417
+ s = 0;
6418
+ } else if (l <= 0.5) {
6419
+ s = delta / (max + min);
6420
+ } else {
6421
+ s = delta / (2 - max - min);
6422
+ }
6423
+ return [h, s * 100, l * 100];
6424
+ };
6425
+ convert.rgb.hsv = function(rgb) {
6426
+ let rdif;
6427
+ let gdif;
6428
+ let bdif;
6429
+ let h;
6430
+ let s;
6431
+ const r = rgb[0] / 255;
6432
+ const g = rgb[1] / 255;
6433
+ const b = rgb[2] / 255;
6434
+ const v = Math.max(r, g, b);
6435
+ const diff = v - Math.min(r, g, b);
6436
+ const diffc = function(c) {
6437
+ return (v - c) / 6 / diff + 1 / 2;
6438
+ };
6439
+ if (diff === 0) {
6440
+ h = 0;
6441
+ s = 0;
6442
+ } else {
6443
+ s = diff / v;
6444
+ rdif = diffc(r);
6445
+ gdif = diffc(g);
6446
+ bdif = diffc(b);
6447
+ if (r === v) {
6448
+ h = bdif - gdif;
6449
+ } else if (g === v) {
6450
+ h = 1 / 3 + rdif - bdif;
6451
+ } else if (b === v) {
6452
+ h = 2 / 3 + gdif - rdif;
6453
+ }
6454
+ if (h < 0) {
6455
+ h += 1;
6456
+ } else if (h > 1) {
6457
+ h -= 1;
6458
+ }
6459
+ }
6460
+ return [
6461
+ h * 360,
6462
+ s * 100,
6463
+ v * 100
6464
+ ];
6465
+ };
6466
+ convert.rgb.hwb = function(rgb) {
6467
+ const r = rgb[0];
6468
+ const g = rgb[1];
6469
+ let b = rgb[2];
6470
+ const h = convert.rgb.hsl(rgb)[0];
6471
+ const w = 1 / 255 * Math.min(r, Math.min(g, b));
6472
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
6473
+ return [h, w * 100, b * 100];
6474
+ };
6475
+ convert.rgb.cmyk = function(rgb) {
6476
+ const r = rgb[0] / 255;
6477
+ const g = rgb[1] / 255;
6478
+ const b = rgb[2] / 255;
6479
+ const k = Math.min(1 - r, 1 - g, 1 - b);
6480
+ const c = (1 - r - k) / (1 - k) || 0;
6481
+ const m = (1 - g - k) / (1 - k) || 0;
6482
+ const y = (1 - b - k) / (1 - k) || 0;
6483
+ return [c * 100, m * 100, y * 100, k * 100];
6484
+ };
6485
+ function comparativeDistance(x, y) {
6486
+ return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
6487
+ }
6488
+ convert.rgb.keyword = function(rgb) {
6489
+ const reversed = reverseKeywords[rgb];
6490
+ if (reversed) {
6491
+ return reversed;
6492
+ }
6493
+ let currentClosestDistance = Infinity;
6494
+ let currentClosestKeyword;
6495
+ for (const keyword of Object.keys(cssKeywords)) {
6496
+ const value = cssKeywords[keyword];
6497
+ const distance = comparativeDistance(rgb, value);
6498
+ if (distance < currentClosestDistance) {
6499
+ currentClosestDistance = distance;
6500
+ currentClosestKeyword = keyword;
6501
+ }
6502
+ }
6503
+ return currentClosestKeyword;
6504
+ };
6505
+ convert.keyword.rgb = function(keyword) {
6506
+ return cssKeywords[keyword];
6507
+ };
6508
+ convert.rgb.xyz = function(rgb) {
6509
+ let r = rgb[0] / 255;
6510
+ let g = rgb[1] / 255;
6511
+ let b = rgb[2] / 255;
6512
+ r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
6513
+ g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
6514
+ b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
6515
+ const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
6516
+ const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
6517
+ const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
6518
+ return [x * 100, y * 100, z * 100];
6519
+ };
6520
+ convert.rgb.lab = function(rgb) {
6521
+ const xyz = convert.rgb.xyz(rgb);
6522
+ let x = xyz[0];
6523
+ let y = xyz[1];
6524
+ let z = xyz[2];
6525
+ x /= 95.047;
6526
+ y /= 100;
6527
+ z /= 108.883;
6528
+ x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
6529
+ y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
6530
+ z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
6531
+ const l = 116 * y - 16;
6532
+ const a = 500 * (x - y);
6533
+ const b = 200 * (y - z);
6534
+ return [l, a, b];
6535
+ };
6536
+ convert.hsl.rgb = function(hsl) {
6537
+ const h = hsl[0] / 360;
6538
+ const s = hsl[1] / 100;
6539
+ const l = hsl[2] / 100;
6540
+ let t2;
6541
+ let t3;
6542
+ let val;
6543
+ if (s === 0) {
6544
+ val = l * 255;
6545
+ return [val, val, val];
6546
+ }
6547
+ if (l < 0.5) {
6548
+ t2 = l * (1 + s);
6549
+ } else {
6550
+ t2 = l + s - l * s;
6551
+ }
6552
+ const t1 = 2 * l - t2;
6553
+ const rgb = [0, 0, 0];
6554
+ for (let i = 0;i < 3; i++) {
6555
+ t3 = h + 1 / 3 * -(i - 1);
6556
+ if (t3 < 0) {
6557
+ t3++;
6558
+ }
6559
+ if (t3 > 1) {
6560
+ t3--;
6561
+ }
6562
+ if (6 * t3 < 1) {
6563
+ val = t1 + (t2 - t1) * 6 * t3;
6564
+ } else if (2 * t3 < 1) {
6565
+ val = t2;
6566
+ } else if (3 * t3 < 2) {
6567
+ val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
6568
+ } else {
6569
+ val = t1;
6570
+ }
6571
+ rgb[i] = val * 255;
6572
+ }
6573
+ return rgb;
6574
+ };
6575
+ convert.hsl.hsv = function(hsl) {
6576
+ const h = hsl[0];
6577
+ let s = hsl[1] / 100;
6578
+ let l = hsl[2] / 100;
6579
+ let smin = s;
6580
+ const lmin = Math.max(l, 0.01);
6581
+ l *= 2;
6582
+ s *= l <= 1 ? l : 2 - l;
6583
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
6584
+ const v = (l + s) / 2;
6585
+ const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
6586
+ return [h, sv * 100, v * 100];
6587
+ };
6588
+ convert.hsv.rgb = function(hsv) {
6589
+ const h = hsv[0] / 60;
6590
+ const s = hsv[1] / 100;
6591
+ let v = hsv[2] / 100;
6592
+ const hi = Math.floor(h) % 6;
6593
+ const f = h - Math.floor(h);
6594
+ const p = 255 * v * (1 - s);
6595
+ const q = 255 * v * (1 - s * f);
6596
+ const t = 255 * v * (1 - s * (1 - f));
6597
+ v *= 255;
6598
+ switch (hi) {
6599
+ case 0:
6600
+ return [v, t, p];
6601
+ case 1:
6602
+ return [q, v, p];
6603
+ case 2:
6604
+ return [p, v, t];
6605
+ case 3:
6606
+ return [p, q, v];
6607
+ case 4:
6608
+ return [t, p, v];
6609
+ case 5:
6610
+ return [v, p, q];
6611
+ }
6612
+ };
6613
+ convert.hsv.hsl = function(hsv) {
6614
+ const h = hsv[0];
6615
+ const s = hsv[1] / 100;
6616
+ const v = hsv[2] / 100;
6617
+ const vmin = Math.max(v, 0.01);
6618
+ let sl;
6619
+ let l;
6620
+ l = (2 - s) * v;
6621
+ const lmin = (2 - s) * vmin;
6622
+ sl = s * vmin;
6623
+ sl /= lmin <= 1 ? lmin : 2 - lmin;
6624
+ sl = sl || 0;
6625
+ l /= 2;
6626
+ return [h, sl * 100, l * 100];
6627
+ };
6628
+ convert.hwb.rgb = function(hwb) {
6629
+ const h = hwb[0] / 360;
6630
+ let wh = hwb[1] / 100;
6631
+ let bl = hwb[2] / 100;
6632
+ const ratio = wh + bl;
6633
+ let f;
6634
+ if (ratio > 1) {
6635
+ wh /= ratio;
6636
+ bl /= ratio;
6637
+ }
6638
+ const i = Math.floor(6 * h);
6639
+ const v = 1 - bl;
6640
+ f = 6 * h - i;
6641
+ if ((i & 1) !== 0) {
6642
+ f = 1 - f;
6643
+ }
6644
+ const n = wh + f * (v - wh);
6645
+ let r;
6646
+ let g;
6647
+ let b;
6648
+ switch (i) {
6649
+ default:
6650
+ case 6:
6651
+ case 0:
6652
+ r = v;
6653
+ g = n;
6654
+ b = wh;
6655
+ break;
6656
+ case 1:
6657
+ r = n;
6658
+ g = v;
6659
+ b = wh;
6660
+ break;
6661
+ case 2:
6662
+ r = wh;
6663
+ g = v;
6664
+ b = n;
6665
+ break;
6666
+ case 3:
6667
+ r = wh;
6668
+ g = n;
6669
+ b = v;
6670
+ break;
6671
+ case 4:
6672
+ r = n;
6673
+ g = wh;
6674
+ b = v;
6675
+ break;
6676
+ case 5:
6677
+ r = v;
6678
+ g = wh;
6679
+ b = n;
6680
+ break;
6681
+ }
6682
+ return [r * 255, g * 255, b * 255];
6683
+ };
6684
+ convert.cmyk.rgb = function(cmyk) {
6685
+ const c = cmyk[0] / 100;
6686
+ const m = cmyk[1] / 100;
6687
+ const y = cmyk[2] / 100;
6688
+ const k = cmyk[3] / 100;
6689
+ const r = 1 - Math.min(1, c * (1 - k) + k);
6690
+ const g = 1 - Math.min(1, m * (1 - k) + k);
6691
+ const b = 1 - Math.min(1, y * (1 - k) + k);
6692
+ return [r * 255, g * 255, b * 255];
6693
+ };
6694
+ convert.xyz.rgb = function(xyz) {
6695
+ const x = xyz[0] / 100;
6696
+ const y = xyz[1] / 100;
6697
+ const z = xyz[2] / 100;
6698
+ let r;
6699
+ let g;
6700
+ let b;
6701
+ r = x * 3.2406 + y * -1.5372 + z * -0.4986;
6702
+ g = x * -0.9689 + y * 1.8758 + z * 0.0415;
6703
+ b = x * 0.0557 + y * -0.204 + z * 1.057;
6704
+ r = r > 0.0031308 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
6705
+ g = g > 0.0031308 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
6706
+ b = b > 0.0031308 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
6707
+ r = Math.min(Math.max(0, r), 1);
6708
+ g = Math.min(Math.max(0, g), 1);
6709
+ b = Math.min(Math.max(0, b), 1);
6710
+ return [r * 255, g * 255, b * 255];
6711
+ };
6712
+ convert.xyz.lab = function(xyz) {
6713
+ let x = xyz[0];
6714
+ let y = xyz[1];
6715
+ let z = xyz[2];
6716
+ x /= 95.047;
6717
+ y /= 100;
6718
+ z /= 108.883;
6719
+ x = x > 0.008856 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
6720
+ y = y > 0.008856 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
6721
+ z = z > 0.008856 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
6722
+ const l = 116 * y - 16;
6723
+ const a = 500 * (x - y);
6724
+ const b = 200 * (y - z);
6725
+ return [l, a, b];
6726
+ };
6727
+ convert.lab.xyz = function(lab) {
6728
+ const l = lab[0];
6729
+ const a = lab[1];
6730
+ const b = lab[2];
6731
+ let x;
6732
+ let y;
6733
+ let z;
6734
+ y = (l + 16) / 116;
6735
+ x = a / 500 + y;
6736
+ z = y - b / 200;
6737
+ const y2 = y ** 3;
6738
+ const x2 = x ** 3;
6739
+ const z2 = z ** 3;
6740
+ y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
6741
+ x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
6742
+ z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
6743
+ x *= 95.047;
6744
+ y *= 100;
6745
+ z *= 108.883;
6746
+ return [x, y, z];
6747
+ };
6748
+ convert.lab.lch = function(lab) {
6749
+ const l = lab[0];
6750
+ const a = lab[1];
6751
+ const b = lab[2];
6752
+ let h;
6753
+ const hr = Math.atan2(b, a);
6754
+ h = hr * 360 / 2 / Math.PI;
6755
+ if (h < 0) {
6756
+ h += 360;
6757
+ }
6758
+ const c = Math.sqrt(a * a + b * b);
6759
+ return [l, c, h];
6760
+ };
6761
+ convert.lch.lab = function(lch) {
6762
+ const l = lch[0];
6763
+ const c = lch[1];
6764
+ const h = lch[2];
6765
+ const hr = h / 360 * 2 * Math.PI;
6766
+ const a = c * Math.cos(hr);
6767
+ const b = c * Math.sin(hr);
6768
+ return [l, a, b];
6769
+ };
6770
+ convert.rgb.ansi16 = function(args, saturation = null) {
6771
+ const [r, g, b] = args;
6772
+ let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
6773
+ value = Math.round(value / 50);
6774
+ if (value === 0) {
6775
+ return 30;
6776
+ }
6777
+ let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
6778
+ if (value === 2) {
6779
+ ansi += 60;
6780
+ }
6781
+ return ansi;
6782
+ };
6783
+ convert.hsv.ansi16 = function(args) {
6784
+ return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
6785
+ };
6786
+ convert.rgb.ansi256 = function(args) {
6787
+ const r = args[0];
6788
+ const g = args[1];
6789
+ const b = args[2];
6790
+ if (r === g && g === b) {
6791
+ if (r < 8) {
6792
+ return 16;
6793
+ }
6794
+ if (r > 248) {
6795
+ return 231;
6796
+ }
6797
+ return Math.round((r - 8) / 247 * 24) + 232;
6798
+ }
6799
+ const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
6800
+ return ansi;
6801
+ };
6802
+ convert.ansi16.rgb = function(args) {
6803
+ let color = args % 10;
6804
+ if (color === 0 || color === 7) {
6805
+ if (args > 50) {
6806
+ color += 3.5;
6807
+ }
6808
+ color = color / 10.5 * 255;
6809
+ return [color, color, color];
6810
+ }
6811
+ const mult = (~~(args > 50) + 1) * 0.5;
6812
+ const r = (color & 1) * mult * 255;
6813
+ const g = (color >> 1 & 1) * mult * 255;
6814
+ const b = (color >> 2 & 1) * mult * 255;
6815
+ return [r, g, b];
6816
+ };
6817
+ convert.ansi256.rgb = function(args) {
6818
+ if (args >= 232) {
6819
+ const c = (args - 232) * 10 + 8;
6820
+ return [c, c, c];
6821
+ }
6822
+ args -= 16;
6823
+ let rem;
6824
+ const r = Math.floor(args / 36) / 5 * 255;
6825
+ const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
6826
+ const b = rem % 6 / 5 * 255;
6827
+ return [r, g, b];
6828
+ };
6829
+ convert.rgb.hex = function(args) {
6830
+ const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
6831
+ const string = integer.toString(16).toUpperCase();
6832
+ return "000000".substring(string.length) + string;
6833
+ };
6834
+ convert.hex.rgb = function(args) {
6835
+ const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
6836
+ if (!match) {
6837
+ return [0, 0, 0];
6838
+ }
6839
+ let colorString = match[0];
6840
+ if (match[0].length === 3) {
6841
+ colorString = colorString.split("").map((char) => {
6842
+ return char + char;
6843
+ }).join("");
6844
+ }
6845
+ const integer = parseInt(colorString, 16);
6846
+ const r = integer >> 16 & 255;
6847
+ const g = integer >> 8 & 255;
6848
+ const b = integer & 255;
6849
+ return [r, g, b];
6850
+ };
6851
+ convert.rgb.hcg = function(rgb) {
6852
+ const r = rgb[0] / 255;
6853
+ const g = rgb[1] / 255;
6854
+ const b = rgb[2] / 255;
6855
+ const max = Math.max(Math.max(r, g), b);
6856
+ const min = Math.min(Math.min(r, g), b);
6857
+ const chroma = max - min;
6858
+ let grayscale;
6859
+ let hue;
6860
+ if (chroma < 1) {
6861
+ grayscale = min / (1 - chroma);
6862
+ } else {
6863
+ grayscale = 0;
6864
+ }
6865
+ if (chroma <= 0) {
6866
+ hue = 0;
6867
+ } else if (max === r) {
6868
+ hue = (g - b) / chroma % 6;
6869
+ } else if (max === g) {
6870
+ hue = 2 + (b - r) / chroma;
6871
+ } else {
6872
+ hue = 4 + (r - g) / chroma;
6873
+ }
6874
+ hue /= 6;
6875
+ hue %= 1;
6876
+ return [hue * 360, chroma * 100, grayscale * 100];
6877
+ };
6878
+ convert.hsl.hcg = function(hsl) {
6879
+ const s = hsl[1] / 100;
6880
+ const l = hsl[2] / 100;
6881
+ const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
6882
+ let f = 0;
6883
+ if (c < 1) {
6884
+ f = (l - 0.5 * c) / (1 - c);
6885
+ }
6886
+ return [hsl[0], c * 100, f * 100];
6887
+ };
6888
+ convert.hsv.hcg = function(hsv) {
6889
+ const s = hsv[1] / 100;
6890
+ const v = hsv[2] / 100;
6891
+ const c = s * v;
6892
+ let f = 0;
6893
+ if (c < 1) {
6894
+ f = (v - c) / (1 - c);
6895
+ }
6896
+ return [hsv[0], c * 100, f * 100];
6897
+ };
6898
+ convert.hcg.rgb = function(hcg) {
6899
+ const h = hcg[0] / 360;
6900
+ const c = hcg[1] / 100;
6901
+ const g = hcg[2] / 100;
6902
+ if (c === 0) {
6903
+ return [g * 255, g * 255, g * 255];
6904
+ }
6905
+ const pure = [0, 0, 0];
6906
+ const hi = h % 1 * 6;
6907
+ const v = hi % 1;
6908
+ const w = 1 - v;
6909
+ let mg = 0;
6910
+ switch (Math.floor(hi)) {
6911
+ case 0:
6912
+ pure[0] = 1;
6913
+ pure[1] = v;
6914
+ pure[2] = 0;
6915
+ break;
6916
+ case 1:
6917
+ pure[0] = w;
6918
+ pure[1] = 1;
6919
+ pure[2] = 0;
6920
+ break;
6921
+ case 2:
6922
+ pure[0] = 0;
6923
+ pure[1] = 1;
6924
+ pure[2] = v;
6925
+ break;
6926
+ case 3:
6927
+ pure[0] = 0;
6928
+ pure[1] = w;
6929
+ pure[2] = 1;
6930
+ break;
6931
+ case 4:
6932
+ pure[0] = v;
6933
+ pure[1] = 0;
6934
+ pure[2] = 1;
6935
+ break;
6936
+ default:
6937
+ pure[0] = 1;
6938
+ pure[1] = 0;
6939
+ pure[2] = w;
6940
+ }
6941
+ mg = (1 - c) * g;
6942
+ return [
6943
+ (c * pure[0] + mg) * 255,
6944
+ (c * pure[1] + mg) * 255,
6945
+ (c * pure[2] + mg) * 255
6946
+ ];
6947
+ };
6948
+ convert.hcg.hsv = function(hcg) {
6949
+ const c = hcg[1] / 100;
6950
+ const g = hcg[2] / 100;
6951
+ const v = c + g * (1 - c);
6952
+ let f = 0;
6953
+ if (v > 0) {
6954
+ f = c / v;
6955
+ }
6956
+ return [hcg[0], f * 100, v * 100];
6957
+ };
6958
+ convert.hcg.hsl = function(hcg) {
6959
+ const c = hcg[1] / 100;
6960
+ const g = hcg[2] / 100;
6961
+ const l = g * (1 - c) + 0.5 * c;
6962
+ let s = 0;
6963
+ if (l > 0 && l < 0.5) {
6964
+ s = c / (2 * l);
6965
+ } else if (l >= 0.5 && l < 1) {
6966
+ s = c / (2 * (1 - l));
6967
+ }
6968
+ return [hcg[0], s * 100, l * 100];
6969
+ };
6970
+ convert.hcg.hwb = function(hcg) {
6971
+ const c = hcg[1] / 100;
6972
+ const g = hcg[2] / 100;
6973
+ const v = c + g * (1 - c);
6974
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
6975
+ };
6976
+ convert.hwb.hcg = function(hwb) {
6977
+ const w = hwb[1] / 100;
6978
+ const b = hwb[2] / 100;
6979
+ const v = 1 - b;
6980
+ const c = v - w;
6981
+ let g = 0;
6982
+ if (c < 1) {
6983
+ g = (v - c) / (1 - c);
6984
+ }
6985
+ return [hwb[0], c * 100, g * 100];
6986
+ };
6987
+ convert.apple.rgb = function(apple) {
6988
+ return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
6989
+ };
6990
+ convert.rgb.apple = function(rgb) {
6991
+ return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
6992
+ };
6993
+ convert.gray.rgb = function(args) {
6994
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
6995
+ };
6996
+ convert.gray.hsl = function(args) {
6997
+ return [0, 0, args[0]];
6998
+ };
6999
+ convert.gray.hsv = convert.gray.hsl;
7000
+ convert.gray.hwb = function(gray) {
7001
+ return [0, 100, gray[0]];
7002
+ };
7003
+ convert.gray.cmyk = function(gray) {
7004
+ return [0, 0, 0, gray[0]];
7005
+ };
7006
+ convert.gray.lab = function(gray) {
7007
+ return [gray[0], 0, 0];
7008
+ };
7009
+ convert.gray.hex = function(gray) {
7010
+ const val = Math.round(gray[0] / 100 * 255) & 255;
7011
+ const integer = (val << 16) + (val << 8) + val;
7012
+ const string = integer.toString(16).toUpperCase();
7013
+ return "000000".substring(string.length) + string;
7014
+ };
7015
+ convert.rgb.gray = function(rgb) {
7016
+ const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
7017
+ return [val / 255 * 100];
7018
+ };
7019
+ });
7020
+
7021
+ // ../../node_modules/color-convert/route.js
7022
+ var require_route = __commonJS((exports, module) => {
7023
+ var conversions = require_conversions();
7024
+ function buildGraph() {
7025
+ const graph = {};
7026
+ const models = Object.keys(conversions);
7027
+ for (let len = models.length, i = 0;i < len; i++) {
7028
+ graph[models[i]] = {
7029
+ distance: -1,
7030
+ parent: null
7031
+ };
7032
+ }
7033
+ return graph;
7034
+ }
7035
+ function deriveBFS(fromModel) {
7036
+ const graph = buildGraph();
7037
+ const queue = [fromModel];
7038
+ graph[fromModel].distance = 0;
7039
+ while (queue.length) {
7040
+ const current = queue.pop();
7041
+ const adjacents = Object.keys(conversions[current]);
7042
+ for (let len = adjacents.length, i = 0;i < len; i++) {
7043
+ const adjacent = adjacents[i];
7044
+ const node = graph[adjacent];
7045
+ if (node.distance === -1) {
7046
+ node.distance = graph[current].distance + 1;
7047
+ node.parent = current;
7048
+ queue.unshift(adjacent);
7049
+ }
7050
+ }
7051
+ }
7052
+ return graph;
7053
+ }
7054
+ function link(from, to) {
7055
+ return function(args) {
7056
+ return to(from(args));
7057
+ };
7058
+ }
7059
+ function wrapConversion(toModel, graph) {
7060
+ const path = [graph[toModel].parent, toModel];
7061
+ let fn = conversions[graph[toModel].parent][toModel];
7062
+ let cur = graph[toModel].parent;
7063
+ while (graph[cur].parent) {
7064
+ path.unshift(graph[cur].parent);
7065
+ fn = link(conversions[graph[cur].parent][cur], fn);
7066
+ cur = graph[cur].parent;
7067
+ }
7068
+ fn.conversion = path;
7069
+ return fn;
7070
+ }
7071
+ module.exports = function(fromModel) {
7072
+ const graph = deriveBFS(fromModel);
7073
+ const conversion = {};
7074
+ const models = Object.keys(graph);
7075
+ for (let len = models.length, i = 0;i < len; i++) {
7076
+ const toModel = models[i];
7077
+ const node = graph[toModel];
7078
+ if (node.parent === null) {
7079
+ continue;
7080
+ }
7081
+ conversion[toModel] = wrapConversion(toModel, graph);
7082
+ }
7083
+ return conversion;
7084
+ };
7085
+ });
7086
+
7087
+ // ../../node_modules/color-convert/index.js
7088
+ var require_color_convert = __commonJS((exports, module) => {
7089
+ var conversions = require_conversions();
7090
+ var route = require_route();
7091
+ var convert = {};
7092
+ var models = Object.keys(conversions);
7093
+ function wrapRaw(fn) {
7094
+ const wrappedFn = function(...args) {
7095
+ const arg0 = args[0];
7096
+ if (arg0 === undefined || arg0 === null) {
7097
+ return arg0;
7098
+ }
7099
+ if (arg0.length > 1) {
7100
+ args = arg0;
7101
+ }
7102
+ return fn(args);
7103
+ };
7104
+ if ("conversion" in fn) {
7105
+ wrappedFn.conversion = fn.conversion;
7106
+ }
7107
+ return wrappedFn;
7108
+ }
7109
+ function wrapRounded(fn) {
7110
+ const wrappedFn = function(...args) {
7111
+ const arg0 = args[0];
7112
+ if (arg0 === undefined || arg0 === null) {
7113
+ return arg0;
7114
+ }
7115
+ if (arg0.length > 1) {
7116
+ args = arg0;
7117
+ }
7118
+ const result = fn(args);
7119
+ if (typeof result === "object") {
7120
+ for (let len = result.length, i = 0;i < len; i++) {
7121
+ result[i] = Math.round(result[i]);
7122
+ }
7123
+ }
7124
+ return result;
7125
+ };
7126
+ if ("conversion" in fn) {
7127
+ wrappedFn.conversion = fn.conversion;
7128
+ }
7129
+ return wrappedFn;
7130
+ }
7131
+ models.forEach((fromModel) => {
7132
+ convert[fromModel] = {};
7133
+ Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
7134
+ Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
7135
+ const routes = route(fromModel);
7136
+ const routeModels = Object.keys(routes);
7137
+ routeModels.forEach((toModel) => {
7138
+ const fn = routes[toModel];
7139
+ convert[fromModel][toModel] = wrapRounded(fn);
7140
+ convert[fromModel][toModel].raw = wrapRaw(fn);
7141
+ });
7142
+ });
7143
+ module.exports = convert;
7144
+ });
7145
+
7146
+ // ../../node_modules/ansi-styles/index.js
7147
+ var require_ansi_styles = __commonJS((exports, module) => {
7148
+ var wrapAnsi16 = (fn, offset) => (...args) => {
7149
+ const code = fn(...args);
7150
+ return `\x1B[${code + offset}m`;
7151
+ };
7152
+ var wrapAnsi256 = (fn, offset) => (...args) => {
7153
+ const code = fn(...args);
7154
+ return `\x1B[${38 + offset};5;${code}m`;
7155
+ };
7156
+ var wrapAnsi16m = (fn, offset) => (...args) => {
7157
+ const rgb = fn(...args);
7158
+ return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
7159
+ };
7160
+ var ansi2ansi = (n) => n;
7161
+ var rgb2rgb = (r, g, b) => [r, g, b];
7162
+ var setLazyProperty = (object, property, get) => {
7163
+ Object.defineProperty(object, property, {
7164
+ get: () => {
7165
+ const value = get();
7166
+ Object.defineProperty(object, property, {
7167
+ value,
7168
+ enumerable: true,
7169
+ configurable: true
7170
+ });
7171
+ return value;
7172
+ },
7173
+ enumerable: true,
7174
+ configurable: true
7175
+ });
7176
+ };
7177
+ var colorConvert;
7178
+ var makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
7179
+ if (colorConvert === undefined) {
7180
+ colorConvert = require_color_convert();
7181
+ }
7182
+ const offset = isBackground ? 10 : 0;
7183
+ const styles = {};
7184
+ for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
7185
+ const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
7186
+ if (sourceSpace === targetSpace) {
7187
+ styles[name] = wrap(identity, offset);
7188
+ } else if (typeof suite === "object") {
7189
+ styles[name] = wrap(suite[targetSpace], offset);
7190
+ }
7191
+ }
7192
+ return styles;
7193
+ };
7194
+ function assembleStyles() {
7195
+ const codes = new Map;
7196
+ const styles = {
7197
+ modifier: {
7198
+ reset: [0, 0],
7199
+ bold: [1, 22],
7200
+ dim: [2, 22],
7201
+ italic: [3, 23],
7202
+ underline: [4, 24],
7203
+ inverse: [7, 27],
7204
+ hidden: [8, 28],
7205
+ strikethrough: [9, 29]
7206
+ },
7207
+ color: {
7208
+ black: [30, 39],
7209
+ red: [31, 39],
7210
+ green: [32, 39],
7211
+ yellow: [33, 39],
7212
+ blue: [34, 39],
7213
+ magenta: [35, 39],
7214
+ cyan: [36, 39],
7215
+ white: [37, 39],
7216
+ blackBright: [90, 39],
7217
+ redBright: [91, 39],
7218
+ greenBright: [92, 39],
7219
+ yellowBright: [93, 39],
7220
+ blueBright: [94, 39],
7221
+ magentaBright: [95, 39],
7222
+ cyanBright: [96, 39],
7223
+ whiteBright: [97, 39]
7224
+ },
7225
+ bgColor: {
7226
+ bgBlack: [40, 49],
7227
+ bgRed: [41, 49],
7228
+ bgGreen: [42, 49],
7229
+ bgYellow: [43, 49],
7230
+ bgBlue: [44, 49],
7231
+ bgMagenta: [45, 49],
7232
+ bgCyan: [46, 49],
7233
+ bgWhite: [47, 49],
7234
+ bgBlackBright: [100, 49],
7235
+ bgRedBright: [101, 49],
7236
+ bgGreenBright: [102, 49],
7237
+ bgYellowBright: [103, 49],
7238
+ bgBlueBright: [104, 49],
7239
+ bgMagentaBright: [105, 49],
7240
+ bgCyanBright: [106, 49],
7241
+ bgWhiteBright: [107, 49]
7242
+ }
7243
+ };
7244
+ styles.color.gray = styles.color.blackBright;
7245
+ styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
7246
+ styles.color.grey = styles.color.blackBright;
7247
+ styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
7248
+ for (const [groupName, group] of Object.entries(styles)) {
7249
+ for (const [styleName, style] of Object.entries(group)) {
7250
+ styles[styleName] = {
7251
+ open: `\x1B[${style[0]}m`,
7252
+ close: `\x1B[${style[1]}m`
7253
+ };
7254
+ group[styleName] = styles[styleName];
7255
+ codes.set(style[0], style[1]);
7256
+ }
7257
+ Object.defineProperty(styles, groupName, {
7258
+ value: group,
7259
+ enumerable: false
7260
+ });
7261
+ }
7262
+ Object.defineProperty(styles, "codes", {
7263
+ value: codes,
7264
+ enumerable: false
7265
+ });
7266
+ styles.color.close = "\x1B[39m";
7267
+ styles.bgColor.close = "\x1B[49m";
7268
+ setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
7269
+ setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
7270
+ setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
7271
+ setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
7272
+ setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
7273
+ setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
7274
+ return styles;
7275
+ }
7276
+ Object.defineProperty(module, "exports", {
7277
+ enumerable: true,
7278
+ get: assembleStyles
7279
+ });
7280
+ });
7281
+
7282
+ // ../../node_modules/has-flag/index.js
7283
+ var require_has_flag = __commonJS((exports, module) => {
7284
+ module.exports = (flag, argv = process.argv) => {
7285
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
7286
+ const position = argv.indexOf(prefix + flag);
7287
+ const terminatorPosition = argv.indexOf("--");
7288
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
7289
+ };
7290
+ });
7291
+
7292
+ // ../../node_modules/supports-color/index.js
7293
+ var require_supports_color = __commonJS((exports, module) => {
7294
+ var os = __require("os");
7295
+ var tty = __require("tty");
7296
+ var hasFlag = require_has_flag();
7297
+ var { env } = process;
7298
+ var forceColor;
7299
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
7300
+ forceColor = 0;
7301
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
7302
+ forceColor = 1;
7303
+ }
7304
+ if ("FORCE_COLOR" in env) {
7305
+ if (env.FORCE_COLOR === "true") {
7306
+ forceColor = 1;
7307
+ } else if (env.FORCE_COLOR === "false") {
7308
+ forceColor = 0;
7309
+ } else {
7310
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
7311
+ }
7312
+ }
7313
+ function translateLevel(level) {
7314
+ if (level === 0) {
7315
+ return false;
7316
+ }
7317
+ return {
7318
+ level,
7319
+ hasBasic: true,
7320
+ has256: level >= 2,
7321
+ has16m: level >= 3
7322
+ };
7323
+ }
7324
+ function supportsColor(haveStream, streamIsTTY) {
7325
+ if (forceColor === 0) {
7326
+ return 0;
7327
+ }
7328
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
7329
+ return 3;
7330
+ }
7331
+ if (hasFlag("color=256")) {
7332
+ return 2;
7333
+ }
7334
+ if (haveStream && !streamIsTTY && forceColor === undefined) {
7335
+ return 0;
7336
+ }
7337
+ const min = forceColor || 0;
7338
+ if (env.TERM === "dumb") {
7339
+ return min;
7340
+ }
7341
+ if (process.platform === "win32") {
7342
+ const osRelease = os.release().split(".");
7343
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
7344
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
7345
+ }
7346
+ return 1;
7347
+ }
7348
+ if ("CI" in env) {
7349
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => (sign in env)) || env.CI_NAME === "codeship") {
7350
+ return 1;
7351
+ }
7352
+ return min;
7353
+ }
7354
+ if ("TEAMCITY_VERSION" in env) {
7355
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
7356
+ }
7357
+ if (env.COLORTERM === "truecolor") {
7358
+ return 3;
7359
+ }
7360
+ if ("TERM_PROGRAM" in env) {
7361
+ const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
7362
+ switch (env.TERM_PROGRAM) {
7363
+ case "iTerm.app":
7364
+ return version >= 3 ? 3 : 2;
7365
+ case "Apple_Terminal":
7366
+ return 2;
7367
+ }
7368
+ }
7369
+ if (/-256(color)?$/i.test(env.TERM)) {
7370
+ return 2;
7371
+ }
7372
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
7373
+ return 1;
7374
+ }
7375
+ if ("COLORTERM" in env) {
7376
+ return 1;
7377
+ }
7378
+ return min;
7379
+ }
7380
+ function getSupportLevel(stream) {
7381
+ const level = supportsColor(stream, stream && stream.isTTY);
7382
+ return translateLevel(level);
7383
+ }
7384
+ module.exports = {
7385
+ supportsColor: getSupportLevel,
7386
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
7387
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
7388
+ };
7389
+ });
7390
+
7391
+ // ../../node_modules/chalk/source/util.js
7392
+ var require_util2 = __commonJS((exports, module) => {
7393
+ var stringReplaceAll = (string, substring, replacer) => {
7394
+ let index = string.indexOf(substring);
7395
+ if (index === -1) {
7396
+ return string;
7397
+ }
7398
+ const substringLength = substring.length;
7399
+ let endIndex = 0;
7400
+ let returnValue = "";
7401
+ do {
7402
+ returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
7403
+ endIndex = index + substringLength;
7404
+ index = string.indexOf(substring, endIndex);
7405
+ } while (index !== -1);
7406
+ returnValue += string.substr(endIndex);
7407
+ return returnValue;
7408
+ };
7409
+ var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
7410
+ let endIndex = 0;
7411
+ let returnValue = "";
7412
+ do {
7413
+ const gotCR = string[index - 1] === "\r";
7414
+ returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? `\r
7415
+ ` : `
7416
+ `) + postfix;
7417
+ endIndex = index + 1;
7418
+ index = string.indexOf(`
7419
+ `, endIndex);
7420
+ } while (index !== -1);
7421
+ returnValue += string.substr(endIndex);
7422
+ return returnValue;
7423
+ };
7424
+ module.exports = {
7425
+ stringReplaceAll,
7426
+ stringEncaseCRLFWithFirstIndex
7427
+ };
7428
+ });
7429
+
7430
+ // ../../node_modules/chalk/source/templates.js
7431
+ var require_templates = __commonJS((exports, module) => {
7432
+ 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;
7433
+ var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
7434
+ var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
7435
+ var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
7436
+ var ESCAPES = new Map([
7437
+ ["n", `
7438
+ `],
7439
+ ["r", "\r"],
7440
+ ["t", "\t"],
7441
+ ["b", "\b"],
7442
+ ["f", "\f"],
7443
+ ["v", "\v"],
7444
+ ["0", "\x00"],
7445
+ ["\\", "\\"],
7446
+ ["e", "\x1B"],
7447
+ ["a", "\x07"]
7448
+ ]);
7449
+ function unescape(c) {
7450
+ const u = c[0] === "u";
7451
+ const bracket = c[1] === "{";
7452
+ if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
7453
+ return String.fromCharCode(parseInt(c.slice(1), 16));
7454
+ }
7455
+ if (u && bracket) {
7456
+ return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
7457
+ }
7458
+ return ESCAPES.get(c) || c;
7459
+ }
7460
+ function parseArguments(name, arguments_) {
7461
+ const results = [];
7462
+ const chunks = arguments_.trim().split(/\s*,\s*/g);
7463
+ let matches;
7464
+ for (const chunk of chunks) {
7465
+ const number = Number(chunk);
7466
+ if (!Number.isNaN(number)) {
7467
+ results.push(number);
7468
+ } else if (matches = chunk.match(STRING_REGEX)) {
7469
+ results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
7470
+ } else {
7471
+ throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
7472
+ }
7473
+ }
7474
+ return results;
7475
+ }
7476
+ function parseStyle(style) {
7477
+ STYLE_REGEX.lastIndex = 0;
7478
+ const results = [];
7479
+ let matches;
7480
+ while ((matches = STYLE_REGEX.exec(style)) !== null) {
7481
+ const name = matches[1];
7482
+ if (matches[2]) {
7483
+ const args = parseArguments(name, matches[2]);
7484
+ results.push([name].concat(args));
7485
+ } else {
7486
+ results.push([name]);
7487
+ }
7488
+ }
7489
+ return results;
7490
+ }
7491
+ function buildStyle(chalk, styles) {
7492
+ const enabled = {};
7493
+ for (const layer of styles) {
7494
+ for (const style of layer.styles) {
7495
+ enabled[style[0]] = layer.inverse ? null : style.slice(1);
7496
+ }
7497
+ }
7498
+ let current = chalk;
7499
+ for (const [styleName, styles2] of Object.entries(enabled)) {
7500
+ if (!Array.isArray(styles2)) {
7501
+ continue;
7502
+ }
7503
+ if (!(styleName in current)) {
7504
+ throw new Error(`Unknown Chalk style: ${styleName}`);
7505
+ }
7506
+ current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
7507
+ }
7508
+ return current;
7509
+ }
7510
+ module.exports = (chalk, temporary) => {
7511
+ const styles = [];
7512
+ const chunks = [];
7513
+ let chunk = [];
7514
+ temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
7515
+ if (escapeCharacter) {
7516
+ chunk.push(unescape(escapeCharacter));
7517
+ } else if (style) {
7518
+ const string = chunk.join("");
7519
+ chunk = [];
7520
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
7521
+ styles.push({ inverse, styles: parseStyle(style) });
7522
+ } else if (close) {
7523
+ if (styles.length === 0) {
7524
+ throw new Error("Found extraneous } in Chalk template literal");
7525
+ }
7526
+ chunks.push(buildStyle(chalk, styles)(chunk.join("")));
7527
+ chunk = [];
7528
+ styles.pop();
7529
+ } else {
7530
+ chunk.push(character);
7531
+ }
7532
+ });
7533
+ chunks.push(chunk.join(""));
7534
+ if (styles.length > 0) {
7535
+ const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
7536
+ throw new Error(errMessage);
7537
+ }
7538
+ return chunks.join("");
7539
+ };
7540
+ });
7541
+
7542
+ // ../../node_modules/chalk/source/index.js
7543
+ var require_source = __commonJS((exports, module) => {
7544
+ var ansiStyles = require_ansi_styles();
7545
+ var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color();
7546
+ var {
7547
+ stringReplaceAll,
7548
+ stringEncaseCRLFWithFirstIndex
7549
+ } = require_util2();
7550
+ var { isArray } = Array;
7551
+ var levelMapping = [
7552
+ "ansi",
7553
+ "ansi",
7554
+ "ansi256",
7555
+ "ansi16m"
7556
+ ];
7557
+ var styles = Object.create(null);
7558
+ var applyOptions = (object, options = {}) => {
7559
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
7560
+ throw new Error("The `level` option should be an integer from 0 to 3");
7561
+ }
7562
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
7563
+ object.level = options.level === undefined ? colorLevel : options.level;
7564
+ };
7565
+
7566
+ class ChalkClass {
7567
+ constructor(options) {
7568
+ return chalkFactory(options);
7569
+ }
7570
+ }
7571
+ var chalkFactory = (options) => {
7572
+ const chalk2 = {};
7573
+ applyOptions(chalk2, options);
7574
+ chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
7575
+ Object.setPrototypeOf(chalk2, Chalk.prototype);
7576
+ Object.setPrototypeOf(chalk2.template, chalk2);
7577
+ chalk2.template.constructor = () => {
7578
+ throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
7579
+ };
7580
+ chalk2.template.Instance = ChalkClass;
7581
+ return chalk2.template;
7582
+ };
7583
+ function Chalk(options) {
7584
+ return chalkFactory(options);
7585
+ }
7586
+ for (const [styleName, style] of Object.entries(ansiStyles)) {
7587
+ styles[styleName] = {
7588
+ get() {
7589
+ const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
7590
+ Object.defineProperty(this, styleName, { value: builder });
7591
+ return builder;
7592
+ }
7593
+ };
7594
+ }
7595
+ styles.visible = {
7596
+ get() {
7597
+ const builder = createBuilder(this, this._styler, true);
7598
+ Object.defineProperty(this, "visible", { value: builder });
7599
+ return builder;
7600
+ }
7601
+ };
7602
+ var usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
7603
+ for (const model of usedModels) {
7604
+ styles[model] = {
7605
+ get() {
7606
+ const { level } = this;
7607
+ return function(...arguments_) {
7608
+ const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
7609
+ return createBuilder(this, styler, this._isEmpty);
7610
+ };
7611
+ }
7612
+ };
7613
+ }
7614
+ for (const model of usedModels) {
7615
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
7616
+ styles[bgModel] = {
7617
+ get() {
7618
+ const { level } = this;
7619
+ return function(...arguments_) {
7620
+ const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
7621
+ return createBuilder(this, styler, this._isEmpty);
7622
+ };
7623
+ }
7624
+ };
7625
+ }
7626
+ var proto = Object.defineProperties(() => {}, {
7627
+ ...styles,
7628
+ level: {
7629
+ enumerable: true,
7630
+ get() {
7631
+ return this._generator.level;
7632
+ },
7633
+ set(level) {
7634
+ this._generator.level = level;
7635
+ }
7636
+ }
7637
+ });
7638
+ var createStyler = (open, close, parent) => {
7639
+ let openAll;
7640
+ let closeAll;
7641
+ if (parent === undefined) {
7642
+ openAll = open;
7643
+ closeAll = close;
7644
+ } else {
7645
+ openAll = parent.openAll + open;
7646
+ closeAll = close + parent.closeAll;
7647
+ }
7648
+ return {
7649
+ open,
7650
+ close,
7651
+ openAll,
7652
+ closeAll,
7653
+ parent
7654
+ };
7655
+ };
7656
+ var createBuilder = (self, _styler, _isEmpty) => {
7657
+ const builder = (...arguments_) => {
7658
+ if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
7659
+ return applyStyle(builder, chalkTag(builder, ...arguments_));
7660
+ }
7661
+ return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
7662
+ };
7663
+ Object.setPrototypeOf(builder, proto);
7664
+ builder._generator = self;
7665
+ builder._styler = _styler;
7666
+ builder._isEmpty = _isEmpty;
7667
+ return builder;
7668
+ };
7669
+ var applyStyle = (self, string) => {
7670
+ if (self.level <= 0 || !string) {
7671
+ return self._isEmpty ? "" : string;
7672
+ }
7673
+ let styler = self._styler;
7674
+ if (styler === undefined) {
7675
+ return string;
7676
+ }
7677
+ const { openAll, closeAll } = styler;
7678
+ if (string.indexOf("\x1B") !== -1) {
7679
+ while (styler !== undefined) {
7680
+ string = stringReplaceAll(string, styler.close, styler.open);
7681
+ styler = styler.parent;
7682
+ }
7683
+ }
7684
+ const lfIndex = string.indexOf(`
7685
+ `);
7686
+ if (lfIndex !== -1) {
7687
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
7688
+ }
7689
+ return openAll + string + closeAll;
7690
+ };
7691
+ var template;
7692
+ var chalkTag = (chalk2, ...strings) => {
7693
+ const [firstString] = strings;
7694
+ if (!isArray(firstString) || !isArray(firstString.raw)) {
7695
+ return strings.join(" ");
7696
+ }
7697
+ const arguments_ = strings.slice(1);
7698
+ const parts = [firstString.raw[0]];
7699
+ for (let i = 1;i < firstString.length; i++) {
7700
+ parts.push(String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"), String(firstString.raw[i]));
7701
+ }
7702
+ if (template === undefined) {
7703
+ template = require_templates();
7704
+ }
7705
+ return template(chalk2, parts.join(""));
7706
+ };
7707
+ Object.defineProperties(Chalk.prototype, styles);
7708
+ var chalk = Chalk();
7709
+ chalk.supportsColor = stdoutColor;
7710
+ chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
7711
+ chalk.stderr.supportsColor = stderrColor;
7712
+ module.exports = chalk;
7713
+ });
7714
+
6197
7715
  // ../../node_modules/zod/v3/external.js
6198
7716
  var exports_external = {};
6199
7717
  __export(exports_external, {
@@ -11353,496 +12871,9 @@ class StdioServerTransport {
11353
12871
  }
11354
12872
  }
11355
12873
 
11356
- // ../../node_modules/chalk/source/vendor/ansi-styles/index.js
11357
- var ANSI_BACKGROUND_OFFSET = 10;
11358
- var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
11359
- var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
11360
- var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
11361
- var styles = {
11362
- modifier: {
11363
- reset: [0, 0],
11364
- bold: [1, 22],
11365
- dim: [2, 22],
11366
- italic: [3, 23],
11367
- underline: [4, 24],
11368
- overline: [53, 55],
11369
- inverse: [7, 27],
11370
- hidden: [8, 28],
11371
- strikethrough: [9, 29]
11372
- },
11373
- color: {
11374
- black: [30, 39],
11375
- red: [31, 39],
11376
- green: [32, 39],
11377
- yellow: [33, 39],
11378
- blue: [34, 39],
11379
- magenta: [35, 39],
11380
- cyan: [36, 39],
11381
- white: [37, 39],
11382
- blackBright: [90, 39],
11383
- gray: [90, 39],
11384
- grey: [90, 39],
11385
- redBright: [91, 39],
11386
- greenBright: [92, 39],
11387
- yellowBright: [93, 39],
11388
- blueBright: [94, 39],
11389
- magentaBright: [95, 39],
11390
- cyanBright: [96, 39],
11391
- whiteBright: [97, 39]
11392
- },
11393
- bgColor: {
11394
- bgBlack: [40, 49],
11395
- bgRed: [41, 49],
11396
- bgGreen: [42, 49],
11397
- bgYellow: [43, 49],
11398
- bgBlue: [44, 49],
11399
- bgMagenta: [45, 49],
11400
- bgCyan: [46, 49],
11401
- bgWhite: [47, 49],
11402
- bgBlackBright: [100, 49],
11403
- bgGray: [100, 49],
11404
- bgGrey: [100, 49],
11405
- bgRedBright: [101, 49],
11406
- bgGreenBright: [102, 49],
11407
- bgYellowBright: [103, 49],
11408
- bgBlueBright: [104, 49],
11409
- bgMagentaBright: [105, 49],
11410
- bgCyanBright: [106, 49],
11411
- bgWhiteBright: [107, 49]
11412
- }
11413
- };
11414
- var modifierNames = Object.keys(styles.modifier);
11415
- var foregroundColorNames = Object.keys(styles.color);
11416
- var backgroundColorNames = Object.keys(styles.bgColor);
11417
- var colorNames = [...foregroundColorNames, ...backgroundColorNames];
11418
- function assembleStyles() {
11419
- const codes = new Map;
11420
- for (const [groupName, group] of Object.entries(styles)) {
11421
- for (const [styleName, style] of Object.entries(group)) {
11422
- styles[styleName] = {
11423
- open: `\x1B[${style[0]}m`,
11424
- close: `\x1B[${style[1]}m`
11425
- };
11426
- group[styleName] = styles[styleName];
11427
- codes.set(style[0], style[1]);
11428
- }
11429
- Object.defineProperty(styles, groupName, {
11430
- value: group,
11431
- enumerable: false
11432
- });
11433
- }
11434
- Object.defineProperty(styles, "codes", {
11435
- value: codes,
11436
- enumerable: false
11437
- });
11438
- styles.color.close = "\x1B[39m";
11439
- styles.bgColor.close = "\x1B[49m";
11440
- styles.color.ansi = wrapAnsi16();
11441
- styles.color.ansi256 = wrapAnsi256();
11442
- styles.color.ansi16m = wrapAnsi16m();
11443
- styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
11444
- styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
11445
- styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
11446
- Object.defineProperties(styles, {
11447
- rgbToAnsi256: {
11448
- value(red, green, blue) {
11449
- if (red === green && green === blue) {
11450
- if (red < 8) {
11451
- return 16;
11452
- }
11453
- if (red > 248) {
11454
- return 231;
11455
- }
11456
- return Math.round((red - 8) / 247 * 24) + 232;
11457
- }
11458
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
11459
- },
11460
- enumerable: false
11461
- },
11462
- hexToRgb: {
11463
- value(hex) {
11464
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
11465
- if (!matches) {
11466
- return [0, 0, 0];
11467
- }
11468
- let [colorString] = matches;
11469
- if (colorString.length === 3) {
11470
- colorString = [...colorString].map((character) => character + character).join("");
11471
- }
11472
- const integer = Number.parseInt(colorString, 16);
11473
- return [
11474
- integer >> 16 & 255,
11475
- integer >> 8 & 255,
11476
- integer & 255
11477
- ];
11478
- },
11479
- enumerable: false
11480
- },
11481
- hexToAnsi256: {
11482
- value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
11483
- enumerable: false
11484
- },
11485
- ansi256ToAnsi: {
11486
- value(code) {
11487
- if (code < 8) {
11488
- return 30 + code;
11489
- }
11490
- if (code < 16) {
11491
- return 90 + (code - 8);
11492
- }
11493
- let red;
11494
- let green;
11495
- let blue;
11496
- if (code >= 232) {
11497
- red = ((code - 232) * 10 + 8) / 255;
11498
- green = red;
11499
- blue = red;
11500
- } else {
11501
- code -= 16;
11502
- const remainder = code % 36;
11503
- red = Math.floor(code / 36) / 5;
11504
- green = Math.floor(remainder / 6) / 5;
11505
- blue = remainder % 6 / 5;
11506
- }
11507
- const value = Math.max(red, green, blue) * 2;
11508
- if (value === 0) {
11509
- return 30;
11510
- }
11511
- let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
11512
- if (value === 2) {
11513
- result += 60;
11514
- }
11515
- return result;
11516
- },
11517
- enumerable: false
11518
- },
11519
- rgbToAnsi: {
11520
- value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
11521
- enumerable: false
11522
- },
11523
- hexToAnsi: {
11524
- value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
11525
- enumerable: false
11526
- }
11527
- });
11528
- return styles;
11529
- }
11530
- var ansiStyles = assembleStyles();
11531
- var ansi_styles_default = ansiStyles;
11532
-
11533
- // ../../node_modules/chalk/source/vendor/supports-color/index.js
11534
- import process3 from "process";
11535
- import os from "os";
11536
- import tty from "tty";
11537
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process3.argv) {
11538
- const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
11539
- const position = argv.indexOf(prefix + flag);
11540
- const terminatorPosition = argv.indexOf("--");
11541
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
11542
- }
11543
- var { env } = process3;
11544
- var flagForceColor;
11545
- if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
11546
- flagForceColor = 0;
11547
- } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
11548
- flagForceColor = 1;
11549
- }
11550
- function envForceColor() {
11551
- if ("FORCE_COLOR" in env) {
11552
- if (env.FORCE_COLOR === "true") {
11553
- return 1;
11554
- }
11555
- if (env.FORCE_COLOR === "false") {
11556
- return 0;
11557
- }
11558
- return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
11559
- }
11560
- }
11561
- function translateLevel(level) {
11562
- if (level === 0) {
11563
- return false;
11564
- }
11565
- return {
11566
- level,
11567
- hasBasic: true,
11568
- has256: level >= 2,
11569
- has16m: level >= 3
11570
- };
11571
- }
11572
- function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
11573
- const noFlagForceColor = envForceColor();
11574
- if (noFlagForceColor !== undefined) {
11575
- flagForceColor = noFlagForceColor;
11576
- }
11577
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
11578
- if (forceColor === 0) {
11579
- return 0;
11580
- }
11581
- if (sniffFlags) {
11582
- if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
11583
- return 3;
11584
- }
11585
- if (hasFlag("color=256")) {
11586
- return 2;
11587
- }
11588
- }
11589
- if ("TF_BUILD" in env && "AGENT_NAME" in env) {
11590
- return 1;
11591
- }
11592
- if (haveStream && !streamIsTTY && forceColor === undefined) {
11593
- return 0;
11594
- }
11595
- const min = forceColor || 0;
11596
- if (env.TERM === "dumb") {
11597
- return min;
11598
- }
11599
- if (process3.platform === "win32") {
11600
- const osRelease = os.release().split(".");
11601
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
11602
- return Number(osRelease[2]) >= 14931 ? 3 : 2;
11603
- }
11604
- return 1;
11605
- }
11606
- if ("CI" in env) {
11607
- if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in env))) {
11608
- return 3;
11609
- }
11610
- if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env)) || env.CI_NAME === "codeship") {
11611
- return 1;
11612
- }
11613
- return min;
11614
- }
11615
- if ("TEAMCITY_VERSION" in env) {
11616
- return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
11617
- }
11618
- if (env.COLORTERM === "truecolor") {
11619
- return 3;
11620
- }
11621
- if (env.TERM === "xterm-kitty") {
11622
- return 3;
11623
- }
11624
- if (env.TERM === "xterm-ghostty") {
11625
- return 3;
11626
- }
11627
- if (env.TERM === "wezterm") {
11628
- return 3;
11629
- }
11630
- if ("TERM_PROGRAM" in env) {
11631
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
11632
- switch (env.TERM_PROGRAM) {
11633
- case "iTerm.app": {
11634
- return version >= 3 ? 3 : 2;
11635
- }
11636
- case "Apple_Terminal": {
11637
- return 2;
11638
- }
11639
- }
11640
- }
11641
- if (/-256(color)?$/i.test(env.TERM)) {
11642
- return 2;
11643
- }
11644
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
11645
- return 1;
11646
- }
11647
- if ("COLORTERM" in env) {
11648
- return 1;
11649
- }
11650
- return min;
11651
- }
11652
- function createSupportsColor(stream, options = {}) {
11653
- const level = _supportsColor(stream, {
11654
- streamIsTTY: stream && stream.isTTY,
11655
- ...options
11656
- });
11657
- return translateLevel(level);
11658
- }
11659
- var supportsColor = {
11660
- stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
11661
- stderr: createSupportsColor({ isTTY: tty.isatty(2) })
11662
- };
11663
- var supports_color_default = supportsColor;
11664
-
11665
- // ../../node_modules/chalk/source/utilities.js
11666
- function stringReplaceAll(string, substring, replacer) {
11667
- let index = string.indexOf(substring);
11668
- if (index === -1) {
11669
- return string;
11670
- }
11671
- const substringLength = substring.length;
11672
- let endIndex = 0;
11673
- let returnValue = "";
11674
- do {
11675
- returnValue += string.slice(endIndex, index) + substring + replacer;
11676
- endIndex = index + substringLength;
11677
- index = string.indexOf(substring, endIndex);
11678
- } while (index !== -1);
11679
- returnValue += string.slice(endIndex);
11680
- return returnValue;
11681
- }
11682
- function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
11683
- let endIndex = 0;
11684
- let returnValue = "";
11685
- do {
11686
- const gotCR = string[index - 1] === "\r";
11687
- returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? `\r
11688
- ` : `
11689
- `) + postfix;
11690
- endIndex = index + 1;
11691
- index = string.indexOf(`
11692
- `, endIndex);
11693
- } while (index !== -1);
11694
- returnValue += string.slice(endIndex);
11695
- return returnValue;
11696
- }
11697
-
11698
- // ../../node_modules/chalk/source/index.js
11699
- var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default;
11700
- var GENERATOR = Symbol("GENERATOR");
11701
- var STYLER = Symbol("STYLER");
11702
- var IS_EMPTY = Symbol("IS_EMPTY");
11703
- var levelMapping = [
11704
- "ansi",
11705
- "ansi",
11706
- "ansi256",
11707
- "ansi16m"
11708
- ];
11709
- var styles2 = Object.create(null);
11710
- var applyOptions = (object, options = {}) => {
11711
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
11712
- throw new Error("The `level` option should be an integer from 0 to 3");
11713
- }
11714
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
11715
- object.level = options.level === undefined ? colorLevel : options.level;
11716
- };
11717
- var chalkFactory = (options) => {
11718
- const chalk = (...strings) => strings.join(" ");
11719
- applyOptions(chalk, options);
11720
- Object.setPrototypeOf(chalk, createChalk.prototype);
11721
- return chalk;
11722
- };
11723
- function createChalk(options) {
11724
- return chalkFactory(options);
11725
- }
11726
- Object.setPrototypeOf(createChalk.prototype, Function.prototype);
11727
- for (const [styleName, style] of Object.entries(ansi_styles_default)) {
11728
- styles2[styleName] = {
11729
- get() {
11730
- const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
11731
- Object.defineProperty(this, styleName, { value: builder });
11732
- return builder;
11733
- }
11734
- };
11735
- }
11736
- styles2.visible = {
11737
- get() {
11738
- const builder = createBuilder(this, this[STYLER], true);
11739
- Object.defineProperty(this, "visible", { value: builder });
11740
- return builder;
11741
- }
11742
- };
11743
- var getModelAnsi = (model, level, type, ...arguments_) => {
11744
- if (model === "rgb") {
11745
- if (level === "ansi16m") {
11746
- return ansi_styles_default[type].ansi16m(...arguments_);
11747
- }
11748
- if (level === "ansi256") {
11749
- return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
11750
- }
11751
- return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
11752
- }
11753
- if (model === "hex") {
11754
- return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
11755
- }
11756
- return ansi_styles_default[type][model](...arguments_);
11757
- };
11758
- var usedModels = ["rgb", "hex", "ansi256"];
11759
- for (const model of usedModels) {
11760
- styles2[model] = {
11761
- get() {
11762
- const { level } = this;
11763
- return function(...arguments_) {
11764
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
11765
- return createBuilder(this, styler, this[IS_EMPTY]);
11766
- };
11767
- }
11768
- };
11769
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
11770
- styles2[bgModel] = {
11771
- get() {
11772
- const { level } = this;
11773
- return function(...arguments_) {
11774
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
11775
- return createBuilder(this, styler, this[IS_EMPTY]);
11776
- };
11777
- }
11778
- };
11779
- }
11780
- var proto = Object.defineProperties(() => {}, {
11781
- ...styles2,
11782
- level: {
11783
- enumerable: true,
11784
- get() {
11785
- return this[GENERATOR].level;
11786
- },
11787
- set(level) {
11788
- this[GENERATOR].level = level;
11789
- }
11790
- }
11791
- });
11792
- var createStyler = (open, close, parent) => {
11793
- let openAll;
11794
- let closeAll;
11795
- if (parent === undefined) {
11796
- openAll = open;
11797
- closeAll = close;
11798
- } else {
11799
- openAll = parent.openAll + open;
11800
- closeAll = close + parent.closeAll;
11801
- }
11802
- return {
11803
- open,
11804
- close,
11805
- openAll,
11806
- closeAll,
11807
- parent
11808
- };
11809
- };
11810
- var createBuilder = (self, _styler, _isEmpty) => {
11811
- const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
11812
- Object.setPrototypeOf(builder, proto);
11813
- builder[GENERATOR] = self;
11814
- builder[STYLER] = _styler;
11815
- builder[IS_EMPTY] = _isEmpty;
11816
- return builder;
11817
- };
11818
- var applyStyle = (self, string) => {
11819
- if (self.level <= 0 || !string) {
11820
- return self[IS_EMPTY] ? "" : string;
11821
- }
11822
- let styler = self[STYLER];
11823
- if (styler === undefined) {
11824
- return string;
11825
- }
11826
- const { openAll, closeAll } = styler;
11827
- if (string.includes("\x1B")) {
11828
- while (styler !== undefined) {
11829
- string = stringReplaceAll(string, styler.close, styler.open);
11830
- styler = styler.parent;
11831
- }
11832
- }
11833
- const lfIndex = string.indexOf(`
11834
- `);
11835
- if (lfIndex !== -1) {
11836
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
11837
- }
11838
- return openAll + string + closeAll;
11839
- };
11840
- Object.defineProperties(createChalk.prototype, styles2);
11841
- var chalk = createChalk();
11842
- var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
11843
- var source_default = chalk;
11844
-
11845
12874
  // src/index.ts
12875
+ var import_chalk = __toESM(require_source(), 1);
12876
+
11846
12877
  class SequentialThinkingServer {
11847
12878
  thoughtHistory = [];
11848
12879
  branches = {};
@@ -11881,13 +12912,13 @@ class SequentialThinkingServer {
11881
12912
  let prefix = "";
11882
12913
  let context = "";
11883
12914
  if (isRevision) {
11884
- prefix = source_default.yellow("\uD83D\uDD04 Revision");
12915
+ prefix = import_chalk.default.yellow("\uD83D\uDD04 Revision");
11885
12916
  context = ` (revising thought ${revisesThought})`;
11886
12917
  } else if (branchFromThought) {
11887
- prefix = source_default.green("\uD83C\uDF3F Branch");
12918
+ prefix = import_chalk.default.green("\uD83C\uDF3F Branch");
11888
12919
  context = ` (from thought ${branchFromThought}, ID: ${branchId})`;
11889
12920
  } else {
11890
- prefix = source_default.blue("\uD83D\uDCAD Thought");
12921
+ prefix = import_chalk.default.blue("\uD83D\uDCAD Thought");
11891
12922
  context = "";
11892
12923
  }
11893
12924
  const header = `${prefix} ${thoughtNumber}/${totalThoughts}${context}`;
@@ -12051,7 +13082,7 @@ You should:
12051
13082
  };
12052
13083
  var server = new Server({
12053
13084
  name: "sequential-thinking-server",
12054
- version: "0.2.5"
13085
+ version: "0.2.6"
12055
13086
  }, {
12056
13087
  capabilities: {
12057
13088
  tools: {}
@@ -12085,5 +13116,5 @@ runServer().catch((error) => {
12085
13116
  process.exit(1);
12086
13117
  });
12087
13118
 
12088
- //# debugId=304446D673DF733F64756E2164756E21
13119
+ //# debugId=38E6C71E8958ADFB64756E2164756E21
12089
13120
  //# sourceMappingURL=index.js.map