@tradejs/strategies 2.0.4 → 2.0.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.
Files changed (3) hide show
  1. package/dist/index.js +944 -1113
  2. package/dist/index.mjs +944 -1113
  3. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -5,11 +5,20 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __esm = (fn, res) => function __init() {
9
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
8
+ var __esm = (fn, res, err) => function __init() {
9
+ if (err) throw err[0];
10
+ try {
11
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
+ } catch (e) {
13
+ throw err = [e], e;
14
+ }
10
15
  };
11
16
  var __commonJS = (cb, mod) => function __require() {
12
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
17
+ try {
18
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
19
+ } catch (e) {
20
+ throw mod = 0, e;
21
+ }
13
22
  };
14
23
  var __export = (target, all) => {
15
24
  for (var name in all)
@@ -2662,7 +2671,7 @@ var require_package = __commonJS({
2662
2671
  module2.exports = {
2663
2672
  name: "winston",
2664
2673
  description: "A logger for just about everything.",
2665
- version: "3.17.0",
2674
+ version: "3.19.0",
2666
2675
  author: "Charlie Robbins <charlie.robbins@gmail.com>",
2667
2676
  maintainers: [
2668
2677
  "David Hyde <dabh@alumni.stanford.edu>"
@@ -2685,7 +2694,7 @@ var require_package = __commonJS({
2685
2694
  "stream"
2686
2695
  ],
2687
2696
  dependencies: {
2688
- "@dabh/diagnostics": "^2.0.2",
2697
+ "@dabh/diagnostics": "^2.0.8",
2689
2698
  "@colors/colors": "^1.6.0",
2690
2699
  async: "^3.2.3",
2691
2700
  "is-stream": "^2.0.0",
@@ -2708,9 +2717,8 @@ var require_package = __commonJS({
2708
2717
  "cross-spawn-async": "^2.2.5",
2709
2718
  eslint: "^8.57.0",
2710
2719
  hock: "^1.4.1",
2711
- mocha: "^10.3.0",
2712
- nyc: "^17.1.0",
2713
- rimraf: "5.0.1",
2720
+ jest: "^29.7.0",
2721
+ rimraf: "5.0.10",
2714
2722
  split2: "^4.1.0",
2715
2723
  "std-mocks": "^2.0.0",
2716
2724
  through2: "^4.0.2",
@@ -2721,11 +2729,12 @@ var require_package = __commonJS({
2721
2729
  types: "./index.d.ts",
2722
2730
  scripts: {
2723
2731
  lint: "eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist",
2724
- test: "rimraf test/fixtures/logs/* && mocha",
2725
- "test:coverage": "nyc npm run test:unit",
2726
- "test:unit": "mocha test/unit",
2727
- "test:integration": "mocha test/integration",
2728
- build: "rimraf dist && babel lib -d dist",
2732
+ test: "jest",
2733
+ "test:unit": "jest -c test/jest.config.unit.js",
2734
+ "test:integration": "jest -c test/jest.config.integration.js",
2735
+ "test:typescript": "npx --package typescript tsc --project test",
2736
+ build: "babel lib -d dist",
2737
+ prebuild: "rimraf dist",
2729
2738
  prepublishOnly: "npm run build"
2730
2739
  },
2731
2740
  engines: {
@@ -3256,9 +3265,9 @@ var require_buffer_list = __commonJS({
3256
3265
  }
3257
3266
  });
3258
3267
 
3259
- // ../../node_modules/readable-stream/node_modules/safe-buffer/index.js
3268
+ // ../../node_modules/safe-buffer/index.js
3260
3269
  var require_safe_buffer = __commonJS({
3261
- "../../node_modules/readable-stream/node_modules/safe-buffer/index.js"(exports2, module2) {
3270
+ "../../node_modules/safe-buffer/index.js"(exports2, module2) {
3262
3271
  "use strict";
3263
3272
  var buffer = require("buffer");
3264
3273
  var Buffer2 = buffer.Buffer;
@@ -3315,9 +3324,9 @@ var require_safe_buffer = __commonJS({
3315
3324
  }
3316
3325
  });
3317
3326
 
3318
- // ../../node_modules/readable-stream/node_modules/string_decoder/lib/string_decoder.js
3327
+ // ../../node_modules/string_decoder/lib/string_decoder.js
3319
3328
  var require_string_decoder = __commonJS({
3320
- "../../node_modules/readable-stream/node_modules/string_decoder/lib/string_decoder.js"(exports2) {
3329
+ "../../node_modules/string_decoder/lib/string_decoder.js"(exports2) {
3321
3330
  "use strict";
3322
3331
  var Buffer2 = require_safe_buffer().Buffer;
3323
3332
  var isEncoding = Buffer2.isEncoding || function(encoding) {
@@ -6409,306 +6418,250 @@ var require_production = __commonJS({
6409
6418
  }
6410
6419
  });
6411
6420
 
6412
- // ../../node_modules/color-name/index.js
6413
- var require_color_name = __commonJS({
6414
- "../../node_modules/color-name/index.js"(exports2, module2) {
6415
- "use strict";
6416
- module2.exports = {
6417
- "aliceblue": [240, 248, 255],
6418
- "antiquewhite": [250, 235, 215],
6419
- "aqua": [0, 255, 255],
6420
- "aquamarine": [127, 255, 212],
6421
- "azure": [240, 255, 255],
6422
- "beige": [245, 245, 220],
6423
- "bisque": [255, 228, 196],
6424
- "black": [0, 0, 0],
6425
- "blanchedalmond": [255, 235, 205],
6426
- "blue": [0, 0, 255],
6427
- "blueviolet": [138, 43, 226],
6428
- "brown": [165, 42, 42],
6429
- "burlywood": [222, 184, 135],
6430
- "cadetblue": [95, 158, 160],
6431
- "chartreuse": [127, 255, 0],
6432
- "chocolate": [210, 105, 30],
6433
- "coral": [255, 127, 80],
6434
- "cornflowerblue": [100, 149, 237],
6435
- "cornsilk": [255, 248, 220],
6436
- "crimson": [220, 20, 60],
6437
- "cyan": [0, 255, 255],
6438
- "darkblue": [0, 0, 139],
6439
- "darkcyan": [0, 139, 139],
6440
- "darkgoldenrod": [184, 134, 11],
6441
- "darkgray": [169, 169, 169],
6442
- "darkgreen": [0, 100, 0],
6443
- "darkgrey": [169, 169, 169],
6444
- "darkkhaki": [189, 183, 107],
6445
- "darkmagenta": [139, 0, 139],
6446
- "darkolivegreen": [85, 107, 47],
6447
- "darkorange": [255, 140, 0],
6448
- "darkorchid": [153, 50, 204],
6449
- "darkred": [139, 0, 0],
6450
- "darksalmon": [233, 150, 122],
6451
- "darkseagreen": [143, 188, 143],
6452
- "darkslateblue": [72, 61, 139],
6453
- "darkslategray": [47, 79, 79],
6454
- "darkslategrey": [47, 79, 79],
6455
- "darkturquoise": [0, 206, 209],
6456
- "darkviolet": [148, 0, 211],
6457
- "deeppink": [255, 20, 147],
6458
- "deepskyblue": [0, 191, 255],
6459
- "dimgray": [105, 105, 105],
6460
- "dimgrey": [105, 105, 105],
6461
- "dodgerblue": [30, 144, 255],
6462
- "firebrick": [178, 34, 34],
6463
- "floralwhite": [255, 250, 240],
6464
- "forestgreen": [34, 139, 34],
6465
- "fuchsia": [255, 0, 255],
6466
- "gainsboro": [220, 220, 220],
6467
- "ghostwhite": [248, 248, 255],
6468
- "gold": [255, 215, 0],
6469
- "goldenrod": [218, 165, 32],
6470
- "gray": [128, 128, 128],
6471
- "green": [0, 128, 0],
6472
- "greenyellow": [173, 255, 47],
6473
- "grey": [128, 128, 128],
6474
- "honeydew": [240, 255, 240],
6475
- "hotpink": [255, 105, 180],
6476
- "indianred": [205, 92, 92],
6477
- "indigo": [75, 0, 130],
6478
- "ivory": [255, 255, 240],
6479
- "khaki": [240, 230, 140],
6480
- "lavender": [230, 230, 250],
6481
- "lavenderblush": [255, 240, 245],
6482
- "lawngreen": [124, 252, 0],
6483
- "lemonchiffon": [255, 250, 205],
6484
- "lightblue": [173, 216, 230],
6485
- "lightcoral": [240, 128, 128],
6486
- "lightcyan": [224, 255, 255],
6487
- "lightgoldenrodyellow": [250, 250, 210],
6488
- "lightgray": [211, 211, 211],
6489
- "lightgreen": [144, 238, 144],
6490
- "lightgrey": [211, 211, 211],
6491
- "lightpink": [255, 182, 193],
6492
- "lightsalmon": [255, 160, 122],
6493
- "lightseagreen": [32, 178, 170],
6494
- "lightskyblue": [135, 206, 250],
6495
- "lightslategray": [119, 136, 153],
6496
- "lightslategrey": [119, 136, 153],
6497
- "lightsteelblue": [176, 196, 222],
6498
- "lightyellow": [255, 255, 224],
6499
- "lime": [0, 255, 0],
6500
- "limegreen": [50, 205, 50],
6501
- "linen": [250, 240, 230],
6502
- "magenta": [255, 0, 255],
6503
- "maroon": [128, 0, 0],
6504
- "mediumaquamarine": [102, 205, 170],
6505
- "mediumblue": [0, 0, 205],
6506
- "mediumorchid": [186, 85, 211],
6507
- "mediumpurple": [147, 112, 219],
6508
- "mediumseagreen": [60, 179, 113],
6509
- "mediumslateblue": [123, 104, 238],
6510
- "mediumspringgreen": [0, 250, 154],
6511
- "mediumturquoise": [72, 209, 204],
6512
- "mediumvioletred": [199, 21, 133],
6513
- "midnightblue": [25, 25, 112],
6514
- "mintcream": [245, 255, 250],
6515
- "mistyrose": [255, 228, 225],
6516
- "moccasin": [255, 228, 181],
6517
- "navajowhite": [255, 222, 173],
6518
- "navy": [0, 0, 128],
6519
- "oldlace": [253, 245, 230],
6520
- "olive": [128, 128, 0],
6521
- "olivedrab": [107, 142, 35],
6522
- "orange": [255, 165, 0],
6523
- "orangered": [255, 69, 0],
6524
- "orchid": [218, 112, 214],
6525
- "palegoldenrod": [238, 232, 170],
6526
- "palegreen": [152, 251, 152],
6527
- "paleturquoise": [175, 238, 238],
6528
- "palevioletred": [219, 112, 147],
6529
- "papayawhip": [255, 239, 213],
6530
- "peachpuff": [255, 218, 185],
6531
- "peru": [205, 133, 63],
6532
- "pink": [255, 192, 203],
6533
- "plum": [221, 160, 221],
6534
- "powderblue": [176, 224, 230],
6535
- "purple": [128, 0, 128],
6536
- "rebeccapurple": [102, 51, 153],
6537
- "red": [255, 0, 0],
6538
- "rosybrown": [188, 143, 143],
6539
- "royalblue": [65, 105, 225],
6540
- "saddlebrown": [139, 69, 19],
6541
- "salmon": [250, 128, 114],
6542
- "sandybrown": [244, 164, 96],
6543
- "seagreen": [46, 139, 87],
6544
- "seashell": [255, 245, 238],
6545
- "sienna": [160, 82, 45],
6546
- "silver": [192, 192, 192],
6547
- "skyblue": [135, 206, 235],
6548
- "slateblue": [106, 90, 205],
6549
- "slategray": [112, 128, 144],
6550
- "slategrey": [112, 128, 144],
6551
- "snow": [255, 250, 250],
6552
- "springgreen": [0, 255, 127],
6553
- "steelblue": [70, 130, 180],
6554
- "tan": [210, 180, 140],
6555
- "teal": [0, 128, 128],
6556
- "thistle": [216, 191, 216],
6557
- "tomato": [255, 99, 71],
6558
- "turquoise": [64, 224, 208],
6559
- "violet": [238, 130, 238],
6560
- "wheat": [245, 222, 179],
6561
- "white": [255, 255, 255],
6562
- "whitesmoke": [245, 245, 245],
6563
- "yellow": [255, 255, 0],
6564
- "yellowgreen": [154, 205, 50]
6565
- };
6566
- }
6567
- });
6568
-
6569
- // ../../node_modules/simple-swizzle/node_modules/is-arrayish/index.js
6570
- var require_is_arrayish = __commonJS({
6571
- "../../node_modules/simple-swizzle/node_modules/is-arrayish/index.js"(exports2, module2) {
6572
- "use strict";
6573
- module2.exports = function isArrayish(obj) {
6574
- if (!obj || typeof obj === "string") {
6575
- return false;
6576
- }
6577
- return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && (obj.splice instanceof Function || Object.getOwnPropertyDescriptor(obj, obj.length - 1) && obj.constructor.name !== "String");
6578
- };
6579
- }
6580
- });
6581
-
6582
- // ../../node_modules/simple-swizzle/index.js
6583
- var require_simple_swizzle = __commonJS({
6584
- "../../node_modules/simple-swizzle/index.js"(exports2, module2) {
6421
+ // ../../node_modules/@so-ric/colorspace/dist/index.cjs.js
6422
+ var require_index_cjs = __commonJS({
6423
+ "../../node_modules/@so-ric/colorspace/dist/index.cjs.js"(exports2, module2) {
6585
6424
  "use strict";
6586
- var isArrayish = require_is_arrayish();
6587
- var concat = Array.prototype.concat;
6588
- var slice = Array.prototype.slice;
6589
- var swizzle = module2.exports = function swizzle2(args) {
6590
- var results = [];
6591
- for (var i = 0, len = args.length; i < len; i++) {
6592
- var arg = args[i];
6593
- if (isArrayish(arg)) {
6594
- results = concat.call(results, slice.call(arg));
6595
- } else {
6596
- results.push(arg);
6597
- }
6598
- }
6599
- return results;
6425
+ var cssKeywords = {
6426
+ aliceblue: [240, 248, 255],
6427
+ antiquewhite: [250, 235, 215],
6428
+ aqua: [0, 255, 255],
6429
+ aquamarine: [127, 255, 212],
6430
+ azure: [240, 255, 255],
6431
+ beige: [245, 245, 220],
6432
+ bisque: [255, 228, 196],
6433
+ black: [0, 0, 0],
6434
+ blanchedalmond: [255, 235, 205],
6435
+ blue: [0, 0, 255],
6436
+ blueviolet: [138, 43, 226],
6437
+ brown: [165, 42, 42],
6438
+ burlywood: [222, 184, 135],
6439
+ cadetblue: [95, 158, 160],
6440
+ chartreuse: [127, 255, 0],
6441
+ chocolate: [210, 105, 30],
6442
+ coral: [255, 127, 80],
6443
+ cornflowerblue: [100, 149, 237],
6444
+ cornsilk: [255, 248, 220],
6445
+ crimson: [220, 20, 60],
6446
+ cyan: [0, 255, 255],
6447
+ darkblue: [0, 0, 139],
6448
+ darkcyan: [0, 139, 139],
6449
+ darkgoldenrod: [184, 134, 11],
6450
+ darkgray: [169, 169, 169],
6451
+ darkgreen: [0, 100, 0],
6452
+ darkgrey: [169, 169, 169],
6453
+ darkkhaki: [189, 183, 107],
6454
+ darkmagenta: [139, 0, 139],
6455
+ darkolivegreen: [85, 107, 47],
6456
+ darkorange: [255, 140, 0],
6457
+ darkorchid: [153, 50, 204],
6458
+ darkred: [139, 0, 0],
6459
+ darksalmon: [233, 150, 122],
6460
+ darkseagreen: [143, 188, 143],
6461
+ darkslateblue: [72, 61, 139],
6462
+ darkslategray: [47, 79, 79],
6463
+ darkslategrey: [47, 79, 79],
6464
+ darkturquoise: [0, 206, 209],
6465
+ darkviolet: [148, 0, 211],
6466
+ deeppink: [255, 20, 147],
6467
+ deepskyblue: [0, 191, 255],
6468
+ dimgray: [105, 105, 105],
6469
+ dimgrey: [105, 105, 105],
6470
+ dodgerblue: [30, 144, 255],
6471
+ firebrick: [178, 34, 34],
6472
+ floralwhite: [255, 250, 240],
6473
+ forestgreen: [34, 139, 34],
6474
+ fuchsia: [255, 0, 255],
6475
+ gainsboro: [220, 220, 220],
6476
+ ghostwhite: [248, 248, 255],
6477
+ gold: [255, 215, 0],
6478
+ goldenrod: [218, 165, 32],
6479
+ gray: [128, 128, 128],
6480
+ green: [0, 128, 0],
6481
+ greenyellow: [173, 255, 47],
6482
+ grey: [128, 128, 128],
6483
+ honeydew: [240, 255, 240],
6484
+ hotpink: [255, 105, 180],
6485
+ indianred: [205, 92, 92],
6486
+ indigo: [75, 0, 130],
6487
+ ivory: [255, 255, 240],
6488
+ khaki: [240, 230, 140],
6489
+ lavender: [230, 230, 250],
6490
+ lavenderblush: [255, 240, 245],
6491
+ lawngreen: [124, 252, 0],
6492
+ lemonchiffon: [255, 250, 205],
6493
+ lightblue: [173, 216, 230],
6494
+ lightcoral: [240, 128, 128],
6495
+ lightcyan: [224, 255, 255],
6496
+ lightgoldenrodyellow: [250, 250, 210],
6497
+ lightgray: [211, 211, 211],
6498
+ lightgreen: [144, 238, 144],
6499
+ lightgrey: [211, 211, 211],
6500
+ lightpink: [255, 182, 193],
6501
+ lightsalmon: [255, 160, 122],
6502
+ lightseagreen: [32, 178, 170],
6503
+ lightskyblue: [135, 206, 250],
6504
+ lightslategray: [119, 136, 153],
6505
+ lightslategrey: [119, 136, 153],
6506
+ lightsteelblue: [176, 196, 222],
6507
+ lightyellow: [255, 255, 224],
6508
+ lime: [0, 255, 0],
6509
+ limegreen: [50, 205, 50],
6510
+ linen: [250, 240, 230],
6511
+ magenta: [255, 0, 255],
6512
+ maroon: [128, 0, 0],
6513
+ mediumaquamarine: [102, 205, 170],
6514
+ mediumblue: [0, 0, 205],
6515
+ mediumorchid: [186, 85, 211],
6516
+ mediumpurple: [147, 112, 219],
6517
+ mediumseagreen: [60, 179, 113],
6518
+ mediumslateblue: [123, 104, 238],
6519
+ mediumspringgreen: [0, 250, 154],
6520
+ mediumturquoise: [72, 209, 204],
6521
+ mediumvioletred: [199, 21, 133],
6522
+ midnightblue: [25, 25, 112],
6523
+ mintcream: [245, 255, 250],
6524
+ mistyrose: [255, 228, 225],
6525
+ moccasin: [255, 228, 181],
6526
+ navajowhite: [255, 222, 173],
6527
+ navy: [0, 0, 128],
6528
+ oldlace: [253, 245, 230],
6529
+ olive: [128, 128, 0],
6530
+ olivedrab: [107, 142, 35],
6531
+ orange: [255, 165, 0],
6532
+ orangered: [255, 69, 0],
6533
+ orchid: [218, 112, 214],
6534
+ palegoldenrod: [238, 232, 170],
6535
+ palegreen: [152, 251, 152],
6536
+ paleturquoise: [175, 238, 238],
6537
+ palevioletred: [219, 112, 147],
6538
+ papayawhip: [255, 239, 213],
6539
+ peachpuff: [255, 218, 185],
6540
+ peru: [205, 133, 63],
6541
+ pink: [255, 192, 203],
6542
+ plum: [221, 160, 221],
6543
+ powderblue: [176, 224, 230],
6544
+ purple: [128, 0, 128],
6545
+ rebeccapurple: [102, 51, 153],
6546
+ red: [255, 0, 0],
6547
+ rosybrown: [188, 143, 143],
6548
+ royalblue: [65, 105, 225],
6549
+ saddlebrown: [139, 69, 19],
6550
+ salmon: [250, 128, 114],
6551
+ sandybrown: [244, 164, 96],
6552
+ seagreen: [46, 139, 87],
6553
+ seashell: [255, 245, 238],
6554
+ sienna: [160, 82, 45],
6555
+ silver: [192, 192, 192],
6556
+ skyblue: [135, 206, 235],
6557
+ slateblue: [106, 90, 205],
6558
+ slategray: [112, 128, 144],
6559
+ slategrey: [112, 128, 144],
6560
+ snow: [255, 250, 250],
6561
+ springgreen: [0, 255, 127],
6562
+ steelblue: [70, 130, 180],
6563
+ tan: [210, 180, 140],
6564
+ teal: [0, 128, 128],
6565
+ thistle: [216, 191, 216],
6566
+ tomato: [255, 99, 71],
6567
+ turquoise: [64, 224, 208],
6568
+ violet: [238, 130, 238],
6569
+ wheat: [245, 222, 179],
6570
+ white: [255, 255, 255],
6571
+ whitesmoke: [245, 245, 245],
6572
+ yellow: [255, 255, 0],
6573
+ yellowgreen: [154, 205, 50]
6600
6574
  };
6601
- swizzle.wrap = function(fn) {
6602
- return function() {
6603
- return fn(swizzle(arguments));
6604
- };
6605
- };
6606
- }
6607
- });
6608
-
6609
- // ../../node_modules/color-string/index.js
6610
- var require_color_string = __commonJS({
6611
- "../../node_modules/color-string/index.js"(exports2, module2) {
6612
- "use strict";
6613
- var colorNames = require_color_name();
6614
- var swizzle = require_simple_swizzle();
6615
- var hasOwnProperty = Object.hasOwnProperty;
6616
6575
  var reverseNames = /* @__PURE__ */ Object.create(null);
6617
- for (name in colorNames) {
6618
- if (hasOwnProperty.call(colorNames, name)) {
6619
- reverseNames[colorNames[name]] = name;
6576
+ for (const name in cssKeywords) {
6577
+ if (Object.hasOwn(cssKeywords, name)) {
6578
+ reverseNames[cssKeywords[name]] = name;
6620
6579
  }
6621
6580
  }
6622
- var name;
6623
- var cs = module2.exports = {
6581
+ var cs = {
6624
6582
  to: {},
6625
6583
  get: {}
6626
6584
  };
6627
6585
  cs.get = function(string) {
6628
- var prefix = string.substring(0, 3).toLowerCase();
6629
- var val;
6630
- var model;
6586
+ const prefix = string.slice(0, 3).toLowerCase();
6587
+ let value;
6588
+ let model;
6631
6589
  switch (prefix) {
6632
- case "hsl":
6633
- val = cs.get.hsl(string);
6590
+ case "hsl": {
6591
+ value = cs.get.hsl(string);
6634
6592
  model = "hsl";
6635
6593
  break;
6636
- case "hwb":
6637
- val = cs.get.hwb(string);
6594
+ }
6595
+ case "hwb": {
6596
+ value = cs.get.hwb(string);
6638
6597
  model = "hwb";
6639
6598
  break;
6640
- default:
6641
- val = cs.get.rgb(string);
6599
+ }
6600
+ default: {
6601
+ value = cs.get.rgb(string);
6642
6602
  model = "rgb";
6643
6603
  break;
6604
+ }
6644
6605
  }
6645
- if (!val) {
6606
+ if (!value) {
6646
6607
  return null;
6647
6608
  }
6648
- return { model, value: val };
6609
+ return { model, value };
6649
6610
  };
6650
6611
  cs.get.rgb = function(string) {
6651
6612
  if (!string) {
6652
6613
  return null;
6653
6614
  }
6654
- var abbr = /^#([a-f0-9]{3,4})$/i;
6655
- var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
6656
- var rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
6657
- var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
6658
- var keyword = /^(\w+)$/;
6659
- var rgb = [0, 0, 0, 1];
6660
- var match;
6661
- var i;
6662
- var hexAlpha;
6663
- if (match = string.match(hex)) {
6615
+ const abbr = /^#([a-f\d]{3,4})$/i;
6616
+ const hex2 = /^#([a-f\d]{6})([a-f\d]{2})?$/i;
6617
+ const rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/;
6618
+ const per = /^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/;
6619
+ const keyword = /^(\w+)$/;
6620
+ let rgb = [0, 0, 0, 1];
6621
+ let match;
6622
+ let i;
6623
+ let hexAlpha;
6624
+ if (match = string.match(hex2)) {
6664
6625
  hexAlpha = match[2];
6665
6626
  match = match[1];
6666
6627
  for (i = 0; i < 3; i++) {
6667
- var i2 = i * 2;
6668
- rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
6628
+ const i2 = i * 2;
6629
+ rgb[i] = Number.parseInt(match.slice(i2, i2 + 2), 16);
6669
6630
  }
6670
6631
  if (hexAlpha) {
6671
- rgb[3] = parseInt(hexAlpha, 16) / 255;
6632
+ rgb[3] = Number.parseInt(hexAlpha, 16) / 255;
6672
6633
  }
6673
6634
  } else if (match = string.match(abbr)) {
6674
6635
  match = match[1];
6675
6636
  hexAlpha = match[3];
6676
6637
  for (i = 0; i < 3; i++) {
6677
- rgb[i] = parseInt(match[i] + match[i], 16);
6638
+ rgb[i] = Number.parseInt(match[i] + match[i], 16);
6678
6639
  }
6679
6640
  if (hexAlpha) {
6680
- rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
6641
+ rgb[3] = Number.parseInt(hexAlpha + hexAlpha, 16) / 255;
6681
6642
  }
6682
6643
  } else if (match = string.match(rgba)) {
6683
6644
  for (i = 0; i < 3; i++) {
6684
- rgb[i] = parseInt(match[i + 1], 0);
6645
+ rgb[i] = Number.parseInt(match[i + 1], 10);
6685
6646
  }
6686
6647
  if (match[4]) {
6687
- if (match[5]) {
6688
- rgb[3] = parseFloat(match[4]) * 0.01;
6689
- } else {
6690
- rgb[3] = parseFloat(match[4]);
6691
- }
6648
+ rgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);
6692
6649
  }
6693
6650
  } else if (match = string.match(per)) {
6694
6651
  for (i = 0; i < 3; i++) {
6695
- rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
6652
+ rgb[i] = Math.round(Number.parseFloat(match[i + 1]) * 2.55);
6696
6653
  }
6697
6654
  if (match[4]) {
6698
- if (match[5]) {
6699
- rgb[3] = parseFloat(match[4]) * 0.01;
6700
- } else {
6701
- rgb[3] = parseFloat(match[4]);
6702
- }
6655
+ rgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);
6703
6656
  }
6704
6657
  } else if (match = string.match(keyword)) {
6705
6658
  if (match[1] === "transparent") {
6706
6659
  return [0, 0, 0, 0];
6707
6660
  }
6708
- if (!hasOwnProperty.call(colorNames, match[1])) {
6661
+ if (!Object.hasOwn(cssKeywords, match[1])) {
6709
6662
  return null;
6710
6663
  }
6711
- rgb = colorNames[match[1]];
6664
+ rgb = cssKeywords[match[1]];
6712
6665
  rgb[3] = 1;
6713
6666
  return rgb;
6714
6667
  } else {
@@ -6724,14 +6677,14 @@ var require_color_string = __commonJS({
6724
6677
  if (!string) {
6725
6678
  return null;
6726
6679
  }
6727
- var hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
6728
- var match = string.match(hsl);
6680
+ const hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
6681
+ const match = string.match(hsl);
6729
6682
  if (match) {
6730
- var alpha = parseFloat(match[4]);
6731
- var h = (parseFloat(match[1]) % 360 + 360) % 360;
6732
- var s = clamp3(parseFloat(match[2]), 0, 100);
6733
- var l = clamp3(parseFloat(match[3]), 0, 100);
6734
- var a = clamp3(isNaN(alpha) ? 1 : alpha, 0, 1);
6683
+ const alpha = Number.parseFloat(match[4]);
6684
+ const h = (Number.parseFloat(match[1]) % 360 + 360) % 360;
6685
+ const s = clamp3(Number.parseFloat(match[2]), 0, 100);
6686
+ const l = clamp3(Number.parseFloat(match[3]), 0, 100);
6687
+ const a = clamp3(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
6735
6688
  return [h, s, l, a];
6736
6689
  }
6737
6690
  return null;
@@ -6740,228 +6693,55 @@ var require_color_string = __commonJS({
6740
6693
  if (!string) {
6741
6694
  return null;
6742
6695
  }
6743
- var hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
6744
- var match = string.match(hwb);
6696
+ const hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
6697
+ const match = string.match(hwb);
6745
6698
  if (match) {
6746
- var alpha = parseFloat(match[4]);
6747
- var h = (parseFloat(match[1]) % 360 + 360) % 360;
6748
- var w = clamp3(parseFloat(match[2]), 0, 100);
6749
- var b = clamp3(parseFloat(match[3]), 0, 100);
6750
- var a = clamp3(isNaN(alpha) ? 1 : alpha, 0, 1);
6699
+ const alpha = Number.parseFloat(match[4]);
6700
+ const h = (Number.parseFloat(match[1]) % 360 + 360) % 360;
6701
+ const w = clamp3(Number.parseFloat(match[2]), 0, 100);
6702
+ const b = clamp3(Number.parseFloat(match[3]), 0, 100);
6703
+ const a = clamp3(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
6751
6704
  return [h, w, b, a];
6752
6705
  }
6753
6706
  return null;
6754
6707
  };
6755
- cs.to.hex = function() {
6756
- var rgba = swizzle(arguments);
6708
+ cs.to.hex = function(...rgba) {
6757
6709
  return "#" + hexDouble(rgba[0]) + hexDouble(rgba[1]) + hexDouble(rgba[2]) + (rgba[3] < 1 ? hexDouble(Math.round(rgba[3] * 255)) : "");
6758
6710
  };
6759
- cs.to.rgb = function() {
6760
- var rgba = swizzle(arguments);
6711
+ cs.to.rgb = function(...rgba) {
6761
6712
  return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ")" : "rgba(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ", " + rgba[3] + ")";
6762
6713
  };
6763
- cs.to.rgb.percent = function() {
6764
- var rgba = swizzle(arguments);
6765
- var r = Math.round(rgba[0] / 255 * 100);
6766
- var g = Math.round(rgba[1] / 255 * 100);
6767
- var b = Math.round(rgba[2] / 255 * 100);
6714
+ cs.to.rgb.percent = function(...rgba) {
6715
+ const r = Math.round(rgba[0] / 255 * 100);
6716
+ const g = Math.round(rgba[1] / 255 * 100);
6717
+ const b = Math.round(rgba[2] / 255 * 100);
6768
6718
  return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + r + "%, " + g + "%, " + b + "%)" : "rgba(" + r + "%, " + g + "%, " + b + "%, " + rgba[3] + ")";
6769
6719
  };
6770
- cs.to.hsl = function() {
6771
- var hsla = swizzle(arguments);
6720
+ cs.to.hsl = function(...hsla) {
6772
6721
  return hsla.length < 4 || hsla[3] === 1 ? "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)" : "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, " + hsla[3] + ")";
6773
6722
  };
6774
- cs.to.hwb = function() {
6775
- var hwba = swizzle(arguments);
6776
- var a = "";
6723
+ cs.to.hwb = function(...hwba) {
6724
+ let a = "";
6777
6725
  if (hwba.length >= 4 && hwba[3] !== 1) {
6778
6726
  a = ", " + hwba[3];
6779
6727
  }
6780
6728
  return "hwb(" + hwba[0] + ", " + hwba[1] + "%, " + hwba[2] + "%" + a + ")";
6781
6729
  };
6782
- cs.to.keyword = function(rgb) {
6730
+ cs.to.keyword = function(...rgb) {
6783
6731
  return reverseNames[rgb.slice(0, 3)];
6784
6732
  };
6785
- function clamp3(num, min, max) {
6786
- return Math.min(Math.max(min, num), max);
6733
+ function clamp3(number_, min, max) {
6734
+ return Math.min(Math.max(min, number_), max);
6787
6735
  }
6788
- function hexDouble(num) {
6789
- var str = Math.round(num).toString(16).toUpperCase();
6790
- return str.length < 2 ? "0" + str : str;
6736
+ function hexDouble(number_) {
6737
+ const string_ = Math.round(number_).toString(16).toUpperCase();
6738
+ return string_.length < 2 ? "0" + string_ : string_;
6791
6739
  }
6792
- }
6793
- });
6794
-
6795
- // ../../node_modules/color-convert/node_modules/color-name/index.js
6796
- var require_color_name2 = __commonJS({
6797
- "../../node_modules/color-convert/node_modules/color-name/index.js"(exports2, module2) {
6798
- "use strict";
6799
- module2.exports = {
6800
- "aliceblue": [240, 248, 255],
6801
- "antiquewhite": [250, 235, 215],
6802
- "aqua": [0, 255, 255],
6803
- "aquamarine": [127, 255, 212],
6804
- "azure": [240, 255, 255],
6805
- "beige": [245, 245, 220],
6806
- "bisque": [255, 228, 196],
6807
- "black": [0, 0, 0],
6808
- "blanchedalmond": [255, 235, 205],
6809
- "blue": [0, 0, 255],
6810
- "blueviolet": [138, 43, 226],
6811
- "brown": [165, 42, 42],
6812
- "burlywood": [222, 184, 135],
6813
- "cadetblue": [95, 158, 160],
6814
- "chartreuse": [127, 255, 0],
6815
- "chocolate": [210, 105, 30],
6816
- "coral": [255, 127, 80],
6817
- "cornflowerblue": [100, 149, 237],
6818
- "cornsilk": [255, 248, 220],
6819
- "crimson": [220, 20, 60],
6820
- "cyan": [0, 255, 255],
6821
- "darkblue": [0, 0, 139],
6822
- "darkcyan": [0, 139, 139],
6823
- "darkgoldenrod": [184, 134, 11],
6824
- "darkgray": [169, 169, 169],
6825
- "darkgreen": [0, 100, 0],
6826
- "darkgrey": [169, 169, 169],
6827
- "darkkhaki": [189, 183, 107],
6828
- "darkmagenta": [139, 0, 139],
6829
- "darkolivegreen": [85, 107, 47],
6830
- "darkorange": [255, 140, 0],
6831
- "darkorchid": [153, 50, 204],
6832
- "darkred": [139, 0, 0],
6833
- "darksalmon": [233, 150, 122],
6834
- "darkseagreen": [143, 188, 143],
6835
- "darkslateblue": [72, 61, 139],
6836
- "darkslategray": [47, 79, 79],
6837
- "darkslategrey": [47, 79, 79],
6838
- "darkturquoise": [0, 206, 209],
6839
- "darkviolet": [148, 0, 211],
6840
- "deeppink": [255, 20, 147],
6841
- "deepskyblue": [0, 191, 255],
6842
- "dimgray": [105, 105, 105],
6843
- "dimgrey": [105, 105, 105],
6844
- "dodgerblue": [30, 144, 255],
6845
- "firebrick": [178, 34, 34],
6846
- "floralwhite": [255, 250, 240],
6847
- "forestgreen": [34, 139, 34],
6848
- "fuchsia": [255, 0, 255],
6849
- "gainsboro": [220, 220, 220],
6850
- "ghostwhite": [248, 248, 255],
6851
- "gold": [255, 215, 0],
6852
- "goldenrod": [218, 165, 32],
6853
- "gray": [128, 128, 128],
6854
- "green": [0, 128, 0],
6855
- "greenyellow": [173, 255, 47],
6856
- "grey": [128, 128, 128],
6857
- "honeydew": [240, 255, 240],
6858
- "hotpink": [255, 105, 180],
6859
- "indianred": [205, 92, 92],
6860
- "indigo": [75, 0, 130],
6861
- "ivory": [255, 255, 240],
6862
- "khaki": [240, 230, 140],
6863
- "lavender": [230, 230, 250],
6864
- "lavenderblush": [255, 240, 245],
6865
- "lawngreen": [124, 252, 0],
6866
- "lemonchiffon": [255, 250, 205],
6867
- "lightblue": [173, 216, 230],
6868
- "lightcoral": [240, 128, 128],
6869
- "lightcyan": [224, 255, 255],
6870
- "lightgoldenrodyellow": [250, 250, 210],
6871
- "lightgray": [211, 211, 211],
6872
- "lightgreen": [144, 238, 144],
6873
- "lightgrey": [211, 211, 211],
6874
- "lightpink": [255, 182, 193],
6875
- "lightsalmon": [255, 160, 122],
6876
- "lightseagreen": [32, 178, 170],
6877
- "lightskyblue": [135, 206, 250],
6878
- "lightslategray": [119, 136, 153],
6879
- "lightslategrey": [119, 136, 153],
6880
- "lightsteelblue": [176, 196, 222],
6881
- "lightyellow": [255, 255, 224],
6882
- "lime": [0, 255, 0],
6883
- "limegreen": [50, 205, 50],
6884
- "linen": [250, 240, 230],
6885
- "magenta": [255, 0, 255],
6886
- "maroon": [128, 0, 0],
6887
- "mediumaquamarine": [102, 205, 170],
6888
- "mediumblue": [0, 0, 205],
6889
- "mediumorchid": [186, 85, 211],
6890
- "mediumpurple": [147, 112, 219],
6891
- "mediumseagreen": [60, 179, 113],
6892
- "mediumslateblue": [123, 104, 238],
6893
- "mediumspringgreen": [0, 250, 154],
6894
- "mediumturquoise": [72, 209, 204],
6895
- "mediumvioletred": [199, 21, 133],
6896
- "midnightblue": [25, 25, 112],
6897
- "mintcream": [245, 255, 250],
6898
- "mistyrose": [255, 228, 225],
6899
- "moccasin": [255, 228, 181],
6900
- "navajowhite": [255, 222, 173],
6901
- "navy": [0, 0, 128],
6902
- "oldlace": [253, 245, 230],
6903
- "olive": [128, 128, 0],
6904
- "olivedrab": [107, 142, 35],
6905
- "orange": [255, 165, 0],
6906
- "orangered": [255, 69, 0],
6907
- "orchid": [218, 112, 214],
6908
- "palegoldenrod": [238, 232, 170],
6909
- "palegreen": [152, 251, 152],
6910
- "paleturquoise": [175, 238, 238],
6911
- "palevioletred": [219, 112, 147],
6912
- "papayawhip": [255, 239, 213],
6913
- "peachpuff": [255, 218, 185],
6914
- "peru": [205, 133, 63],
6915
- "pink": [255, 192, 203],
6916
- "plum": [221, 160, 221],
6917
- "powderblue": [176, 224, 230],
6918
- "purple": [128, 0, 128],
6919
- "rebeccapurple": [102, 51, 153],
6920
- "red": [255, 0, 0],
6921
- "rosybrown": [188, 143, 143],
6922
- "royalblue": [65, 105, 225],
6923
- "saddlebrown": [139, 69, 19],
6924
- "salmon": [250, 128, 114],
6925
- "sandybrown": [244, 164, 96],
6926
- "seagreen": [46, 139, 87],
6927
- "seashell": [255, 245, 238],
6928
- "sienna": [160, 82, 45],
6929
- "silver": [192, 192, 192],
6930
- "skyblue": [135, 206, 235],
6931
- "slateblue": [106, 90, 205],
6932
- "slategray": [112, 128, 144],
6933
- "slategrey": [112, 128, 144],
6934
- "snow": [255, 250, 250],
6935
- "springgreen": [0, 255, 127],
6936
- "steelblue": [70, 130, 180],
6937
- "tan": [210, 180, 140],
6938
- "teal": [0, 128, 128],
6939
- "thistle": [216, 191, 216],
6940
- "tomato": [255, 99, 71],
6941
- "turquoise": [64, 224, 208],
6942
- "violet": [238, 130, 238],
6943
- "wheat": [245, 222, 179],
6944
- "white": [255, 255, 255],
6945
- "whitesmoke": [245, 245, 245],
6946
- "yellow": [255, 255, 0],
6947
- "yellowgreen": [154, 205, 50]
6948
- };
6949
- }
6950
- });
6951
-
6952
- // ../../node_modules/color-convert/conversions.js
6953
- var require_conversions = __commonJS({
6954
- "../../node_modules/color-convert/conversions.js"(exports2, module2) {
6955
- "use strict";
6956
- var cssKeywords = require_color_name2();
6957
6740
  var reverseKeywords = {};
6958
- for (key in cssKeywords) {
6959
- if (cssKeywords.hasOwnProperty(key)) {
6960
- reverseKeywords[cssKeywords[key]] = key;
6961
- }
6741
+ for (const key of Object.keys(cssKeywords)) {
6742
+ reverseKeywords[cssKeywords[key]] = key;
6962
6743
  }
6963
- var key;
6964
- var convert = module2.exports = {
6744
+ var convert$1 = {
6965
6745
  rgb: { channels: 3, labels: "rgb" },
6966
6746
  hsl: { channels: 3, labels: "hsl" },
6967
6747
  hsv: { channels: 3, labels: "hsv" },
@@ -6969,7 +6749,9 @@ var require_conversions = __commonJS({
6969
6749
  cmyk: { channels: 4, labels: "cmyk" },
6970
6750
  xyz: { channels: 3, labels: "xyz" },
6971
6751
  lab: { channels: 3, labels: "lab" },
6752
+ oklab: { channels: 3, labels: ["okl", "oka", "okb"] },
6972
6753
  lch: { channels: 3, labels: "lch" },
6754
+ oklch: { channels: 3, labels: ["okl", "okc", "okh"] },
6973
6755
  hex: { channels: 1, labels: ["hex"] },
6974
6756
  keyword: { channels: 1, labels: ["keyword"] },
6975
6757
  ansi16: { channels: 1, labels: ["ansi16"] },
@@ -6978,52 +6760,62 @@ var require_conversions = __commonJS({
6978
6760
  apple: { channels: 3, labels: ["r16", "g16", "b16"] },
6979
6761
  gray: { channels: 1, labels: ["gray"] }
6980
6762
  };
6981
- for (model in convert) {
6982
- if (convert.hasOwnProperty(model)) {
6983
- if (!("channels" in convert[model])) {
6984
- throw new Error("missing channels property: " + model);
6985
- }
6986
- if (!("labels" in convert[model])) {
6987
- throw new Error("missing channel labels property: " + model);
6988
- }
6989
- if (convert[model].labels.length !== convert[model].channels) {
6990
- throw new Error("channel and label counts mismatch: " + model);
6991
- }
6992
- channels = convert[model].channels;
6993
- labels = convert[model].labels;
6994
- delete convert[model].channels;
6995
- delete convert[model].labels;
6996
- Object.defineProperty(convert[model], "channels", { value: channels });
6997
- Object.defineProperty(convert[model], "labels", { value: labels });
6998
- }
6999
- }
7000
- var channels;
7001
- var labels;
7002
- var model;
7003
- convert.rgb.hsl = function(rgb) {
7004
- var r = rgb[0] / 255;
7005
- var g = rgb[1] / 255;
7006
- var b = rgb[2] / 255;
7007
- var min = Math.min(r, g, b);
7008
- var max = Math.max(r, g, b);
7009
- var delta = max - min;
7010
- var h;
7011
- var s;
7012
- var l;
7013
- if (max === min) {
7014
- h = 0;
7015
- } else if (r === max) {
7016
- h = (g - b) / delta;
7017
- } else if (g === max) {
7018
- h = 2 + (b - r) / delta;
7019
- } else if (b === max) {
7020
- h = 4 + (r - g) / delta;
6763
+ var LAB_FT = (6 / 29) ** 3;
6764
+ function srgbNonlinearTransform(c) {
6765
+ const cc = c > 31308e-7 ? 1.055 * c ** (1 / 2.4) - 0.055 : c * 12.92;
6766
+ return Math.min(Math.max(0, cc), 1);
6767
+ }
6768
+ function srgbNonlinearTransformInv(c) {
6769
+ return c > 0.04045 ? ((c + 0.055) / 1.055) ** 2.4 : c / 12.92;
6770
+ }
6771
+ for (const model of Object.keys(convert$1)) {
6772
+ if (!("channels" in convert$1[model])) {
6773
+ throw new Error("missing channels property: " + model);
6774
+ }
6775
+ if (!("labels" in convert$1[model])) {
6776
+ throw new Error("missing channel labels property: " + model);
6777
+ }
6778
+ if (convert$1[model].labels.length !== convert$1[model].channels) {
6779
+ throw new Error("channel and label counts mismatch: " + model);
6780
+ }
6781
+ const { channels, labels } = convert$1[model];
6782
+ delete convert$1[model].channels;
6783
+ delete convert$1[model].labels;
6784
+ Object.defineProperty(convert$1[model], "channels", { value: channels });
6785
+ Object.defineProperty(convert$1[model], "labels", { value: labels });
6786
+ }
6787
+ convert$1.rgb.hsl = function(rgb) {
6788
+ const r = rgb[0] / 255;
6789
+ const g = rgb[1] / 255;
6790
+ const b = rgb[2] / 255;
6791
+ const min = Math.min(r, g, b);
6792
+ const max = Math.max(r, g, b);
6793
+ const delta = max - min;
6794
+ let h;
6795
+ let s;
6796
+ switch (max) {
6797
+ case min: {
6798
+ h = 0;
6799
+ break;
6800
+ }
6801
+ case r: {
6802
+ h = (g - b) / delta;
6803
+ break;
6804
+ }
6805
+ case g: {
6806
+ h = 2 + (b - r) / delta;
6807
+ break;
6808
+ }
6809
+ case b: {
6810
+ h = 4 + (r - g) / delta;
6811
+ break;
6812
+ }
7021
6813
  }
7022
6814
  h = Math.min(h * 60, 360);
7023
6815
  if (h < 0) {
7024
6816
  h += 360;
7025
6817
  }
7026
- l = (min + max) / 2;
6818
+ const l = (min + max) / 2;
7027
6819
  if (max === min) {
7028
6820
  s = 0;
7029
6821
  } else if (l <= 0.5) {
@@ -7033,33 +6825,41 @@ var require_conversions = __commonJS({
7033
6825
  }
7034
6826
  return [h, s * 100, l * 100];
7035
6827
  };
7036
- convert.rgb.hsv = function(rgb) {
7037
- var rdif;
7038
- var gdif;
7039
- var bdif;
7040
- var h;
7041
- var s;
7042
- var r = rgb[0] / 255;
7043
- var g = rgb[1] / 255;
7044
- var b = rgb[2] / 255;
7045
- var v = Math.max(r, g, b);
7046
- var diff = v - Math.min(r, g, b);
7047
- var diffc = function(c) {
6828
+ convert$1.rgb.hsv = function(rgb) {
6829
+ let rdif;
6830
+ let gdif;
6831
+ let bdif;
6832
+ let h;
6833
+ let s;
6834
+ const r = rgb[0] / 255;
6835
+ const g = rgb[1] / 255;
6836
+ const b = rgb[2] / 255;
6837
+ const v = Math.max(r, g, b);
6838
+ const diff = v - Math.min(r, g, b);
6839
+ const diffc = function(c) {
7048
6840
  return (v - c) / 6 / diff + 1 / 2;
7049
6841
  };
7050
6842
  if (diff === 0) {
7051
- h = s = 0;
6843
+ h = 0;
6844
+ s = 0;
7052
6845
  } else {
7053
6846
  s = diff / v;
7054
6847
  rdif = diffc(r);
7055
6848
  gdif = diffc(g);
7056
6849
  bdif = diffc(b);
7057
- if (r === v) {
7058
- h = bdif - gdif;
7059
- } else if (g === v) {
7060
- h = 1 / 3 + rdif - bdif;
7061
- } else if (b === v) {
7062
- h = 2 / 3 + gdif - rdif;
6850
+ switch (v) {
6851
+ case r: {
6852
+ h = bdif - gdif;
6853
+ break;
6854
+ }
6855
+ case g: {
6856
+ h = 1 / 3 + rdif - bdif;
6857
+ break;
6858
+ }
6859
+ case b: {
6860
+ h = 2 / 3 + gdif - rdif;
6861
+ break;
6862
+ }
7063
6863
  }
7064
6864
  if (h < 0) {
7065
6865
  h += 1;
@@ -7073,106 +6873,99 @@ var require_conversions = __commonJS({
7073
6873
  v * 100
7074
6874
  ];
7075
6875
  };
7076
- convert.rgb.hwb = function(rgb) {
7077
- var r = rgb[0];
7078
- var g = rgb[1];
7079
- var b = rgb[2];
7080
- var h = convert.rgb.hsl(rgb)[0];
7081
- var w = 1 / 255 * Math.min(r, Math.min(g, b));
6876
+ convert$1.rgb.hwb = function(rgb) {
6877
+ const r = rgb[0];
6878
+ const g = rgb[1];
6879
+ let b = rgb[2];
6880
+ const h = convert$1.rgb.hsl(rgb)[0];
6881
+ const w = 1 / 255 * Math.min(r, Math.min(g, b));
7082
6882
  b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
7083
6883
  return [h, w * 100, b * 100];
7084
6884
  };
7085
- convert.rgb.cmyk = function(rgb) {
7086
- var r = rgb[0] / 255;
7087
- var g = rgb[1] / 255;
7088
- var b = rgb[2] / 255;
7089
- var c;
7090
- var m;
7091
- var y;
7092
- var k;
7093
- k = Math.min(1 - r, 1 - g, 1 - b);
7094
- c = (1 - r - k) / (1 - k) || 0;
7095
- m = (1 - g - k) / (1 - k) || 0;
7096
- y = (1 - b - k) / (1 - k) || 0;
6885
+ convert$1.rgb.oklab = function(rgb) {
6886
+ const r = srgbNonlinearTransformInv(rgb[0] / 255);
6887
+ const g = srgbNonlinearTransformInv(rgb[1] / 255);
6888
+ const b = srgbNonlinearTransformInv(rgb[2] / 255);
6889
+ const lp = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);
6890
+ const mp = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);
6891
+ const sp = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
6892
+ const l = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 * sp;
6893
+ const aa = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 * sp;
6894
+ const bb = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 * sp;
6895
+ return [l * 100, aa * 100, bb * 100];
6896
+ };
6897
+ convert$1.rgb.cmyk = function(rgb) {
6898
+ const r = rgb[0] / 255;
6899
+ const g = rgb[1] / 255;
6900
+ const b = rgb[2] / 255;
6901
+ const k = Math.min(1 - r, 1 - g, 1 - b);
6902
+ const c = (1 - r - k) / (1 - k) || 0;
6903
+ const m = (1 - g - k) / (1 - k) || 0;
6904
+ const y = (1 - b - k) / (1 - k) || 0;
7097
6905
  return [c * 100, m * 100, y * 100, k * 100];
7098
6906
  };
7099
6907
  function comparativeDistance(x, y) {
7100
- return Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2);
6908
+ return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
7101
6909
  }
7102
- convert.rgb.keyword = function(rgb) {
7103
- var reversed = reverseKeywords[rgb];
6910
+ convert$1.rgb.keyword = function(rgb) {
6911
+ const reversed = reverseKeywords[rgb];
7104
6912
  if (reversed) {
7105
6913
  return reversed;
7106
6914
  }
7107
- var currentClosestDistance = Infinity;
7108
- var currentClosestKeyword;
7109
- for (var keyword in cssKeywords) {
7110
- if (cssKeywords.hasOwnProperty(keyword)) {
7111
- var value = cssKeywords[keyword];
7112
- var distance = comparativeDistance(rgb, value);
7113
- if (distance < currentClosestDistance) {
7114
- currentClosestDistance = distance;
7115
- currentClosestKeyword = keyword;
7116
- }
6915
+ let currentClosestDistance = Number.POSITIVE_INFINITY;
6916
+ let currentClosestKeyword;
6917
+ for (const keyword of Object.keys(cssKeywords)) {
6918
+ const value = cssKeywords[keyword];
6919
+ const distance = comparativeDistance(rgb, value);
6920
+ if (distance < currentClosestDistance) {
6921
+ currentClosestDistance = distance;
6922
+ currentClosestKeyword = keyword;
7117
6923
  }
7118
6924
  }
7119
6925
  return currentClosestKeyword;
7120
6926
  };
7121
- convert.keyword.rgb = function(keyword) {
6927
+ convert$1.keyword.rgb = function(keyword) {
7122
6928
  return cssKeywords[keyword];
7123
6929
  };
7124
- convert.rgb.xyz = function(rgb) {
7125
- var r = rgb[0] / 255;
7126
- var g = rgb[1] / 255;
7127
- var b = rgb[2] / 255;
7128
- r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;
7129
- g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;
7130
- b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92;
7131
- var x = r * 0.4124 + g * 0.3576 + b * 0.1805;
7132
- var y = r * 0.2126 + g * 0.7152 + b * 0.0722;
7133
- var z = r * 0.0193 + g * 0.1192 + b * 0.9505;
6930
+ convert$1.rgb.xyz = function(rgb) {
6931
+ const r = srgbNonlinearTransformInv(rgb[0] / 255);
6932
+ const g = srgbNonlinearTransformInv(rgb[1] / 255);
6933
+ const b = srgbNonlinearTransformInv(rgb[2] / 255);
6934
+ const x = r * 0.4124564 + g * 0.3575761 + b * 0.1804375;
6935
+ const y = r * 0.2126729 + g * 0.7151522 + b * 0.072175;
6936
+ const z = r * 0.0193339 + g * 0.119192 + b * 0.9503041;
7134
6937
  return [x * 100, y * 100, z * 100];
7135
6938
  };
7136
- convert.rgb.lab = function(rgb) {
7137
- var xyz = convert.rgb.xyz(rgb);
7138
- var x = xyz[0];
7139
- var y = xyz[1];
7140
- var z = xyz[2];
7141
- var l;
7142
- var a;
7143
- var b;
6939
+ convert$1.rgb.lab = function(rgb) {
6940
+ const xyz = convert$1.rgb.xyz(rgb);
6941
+ let x = xyz[0];
6942
+ let y = xyz[1];
6943
+ let z = xyz[2];
7144
6944
  x /= 95.047;
7145
6945
  y /= 100;
7146
6946
  z /= 108.883;
7147
- x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
7148
- y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
7149
- z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
7150
- l = 116 * y - 16;
7151
- a = 500 * (x - y);
7152
- b = 200 * (y - z);
6947
+ x = x > LAB_FT ? x ** (1 / 3) : 7.787 * x + 16 / 116;
6948
+ y = y > LAB_FT ? y ** (1 / 3) : 7.787 * y + 16 / 116;
6949
+ z = z > LAB_FT ? z ** (1 / 3) : 7.787 * z + 16 / 116;
6950
+ const l = 116 * y - 16;
6951
+ const a = 500 * (x - y);
6952
+ const b = 200 * (y - z);
7153
6953
  return [l, a, b];
7154
6954
  };
7155
- convert.hsl.rgb = function(hsl) {
7156
- var h = hsl[0] / 360;
7157
- var s = hsl[1] / 100;
7158
- var l = hsl[2] / 100;
7159
- var t1;
7160
- var t2;
7161
- var t3;
7162
- var rgb;
7163
- var val;
6955
+ convert$1.hsl.rgb = function(hsl) {
6956
+ const h = hsl[0] / 360;
6957
+ const s = hsl[1] / 100;
6958
+ const l = hsl[2] / 100;
6959
+ let t3;
6960
+ let value;
7164
6961
  if (s === 0) {
7165
- val = l * 255;
7166
- return [val, val, val];
7167
- }
7168
- if (l < 0.5) {
7169
- t2 = l * (1 + s);
7170
- } else {
7171
- t2 = l + s - l * s;
6962
+ value = l * 255;
6963
+ return [value, value, value];
7172
6964
  }
7173
- t1 = 2 * l - t2;
7174
- rgb = [0, 0, 0];
7175
- for (var i = 0; i < 3; i++) {
6965
+ const t2 = l < 0.5 ? l * (1 + s) : l + s - l * s;
6966
+ const t1 = 2 * l - t2;
6967
+ const rgb = [0, 0, 0];
6968
+ for (let i = 0; i < 3; i++) {
7176
6969
  t3 = h + 1 / 3 * -(i - 1);
7177
6970
  if (t3 < 0) {
7178
6971
  t3++;
@@ -7181,253 +6974,285 @@ var require_conversions = __commonJS({
7181
6974
  t3--;
7182
6975
  }
7183
6976
  if (6 * t3 < 1) {
7184
- val = t1 + (t2 - t1) * 6 * t3;
6977
+ value = t1 + (t2 - t1) * 6 * t3;
7185
6978
  } else if (2 * t3 < 1) {
7186
- val = t2;
6979
+ value = t2;
7187
6980
  } else if (3 * t3 < 2) {
7188
- val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
6981
+ value = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
7189
6982
  } else {
7190
- val = t1;
6983
+ value = t1;
7191
6984
  }
7192
- rgb[i] = val * 255;
6985
+ rgb[i] = value * 255;
7193
6986
  }
7194
6987
  return rgb;
7195
6988
  };
7196
- convert.hsl.hsv = function(hsl) {
7197
- var h = hsl[0];
7198
- var s = hsl[1] / 100;
7199
- var l = hsl[2] / 100;
7200
- var smin = s;
7201
- var lmin = Math.max(l, 0.01);
7202
- var sv;
7203
- var v;
6989
+ convert$1.hsl.hsv = function(hsl) {
6990
+ const h = hsl[0];
6991
+ let s = hsl[1] / 100;
6992
+ let l = hsl[2] / 100;
6993
+ let smin = s;
6994
+ const lmin = Math.max(l, 0.01);
7204
6995
  l *= 2;
7205
6996
  s *= l <= 1 ? l : 2 - l;
7206
6997
  smin *= lmin <= 1 ? lmin : 2 - lmin;
7207
- v = (l + s) / 2;
7208
- sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
6998
+ const v = (l + s) / 2;
6999
+ const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
7209
7000
  return [h, sv * 100, v * 100];
7210
7001
  };
7211
- convert.hsv.rgb = function(hsv) {
7212
- var h = hsv[0] / 60;
7213
- var s = hsv[1] / 100;
7214
- var v = hsv[2] / 100;
7215
- var hi = Math.floor(h) % 6;
7216
- var f = h - Math.floor(h);
7217
- var p = 255 * v * (1 - s);
7218
- var q = 255 * v * (1 - s * f);
7219
- var t = 255 * v * (1 - s * (1 - f));
7002
+ convert$1.hsv.rgb = function(hsv) {
7003
+ const h = hsv[0] / 60;
7004
+ const s = hsv[1] / 100;
7005
+ let v = hsv[2] / 100;
7006
+ const hi = Math.floor(h) % 6;
7007
+ const f = h - Math.floor(h);
7008
+ const p = 255 * v * (1 - s);
7009
+ const q = 255 * v * (1 - s * f);
7010
+ const t = 255 * v * (1 - s * (1 - f));
7220
7011
  v *= 255;
7221
7012
  switch (hi) {
7222
- case 0:
7013
+ case 0: {
7223
7014
  return [v, t, p];
7224
- case 1:
7015
+ }
7016
+ case 1: {
7225
7017
  return [q, v, p];
7226
- case 2:
7018
+ }
7019
+ case 2: {
7227
7020
  return [p, v, t];
7228
- case 3:
7021
+ }
7022
+ case 3: {
7229
7023
  return [p, q, v];
7230
- case 4:
7024
+ }
7025
+ case 4: {
7231
7026
  return [t, p, v];
7232
- case 5:
7027
+ }
7028
+ case 5: {
7233
7029
  return [v, p, q];
7030
+ }
7234
7031
  }
7235
7032
  };
7236
- convert.hsv.hsl = function(hsv) {
7237
- var h = hsv[0];
7238
- var s = hsv[1] / 100;
7239
- var v = hsv[2] / 100;
7240
- var vmin = Math.max(v, 0.01);
7241
- var lmin;
7242
- var sl;
7243
- var l;
7033
+ convert$1.hsv.hsl = function(hsv) {
7034
+ const h = hsv[0];
7035
+ const s = hsv[1] / 100;
7036
+ const v = hsv[2] / 100;
7037
+ const vmin = Math.max(v, 0.01);
7038
+ let sl;
7039
+ let l;
7244
7040
  l = (2 - s) * v;
7245
- lmin = (2 - s) * vmin;
7041
+ const lmin = (2 - s) * vmin;
7246
7042
  sl = s * vmin;
7247
7043
  sl /= lmin <= 1 ? lmin : 2 - lmin;
7248
7044
  sl = sl || 0;
7249
7045
  l /= 2;
7250
7046
  return [h, sl * 100, l * 100];
7251
7047
  };
7252
- convert.hwb.rgb = function(hwb) {
7253
- var h = hwb[0] / 360;
7254
- var wh = hwb[1] / 100;
7255
- var bl = hwb[2] / 100;
7256
- var ratio = wh + bl;
7257
- var i;
7258
- var v;
7259
- var f;
7260
- var n;
7048
+ convert$1.hwb.rgb = function(hwb) {
7049
+ const h = hwb[0] / 360;
7050
+ let wh = hwb[1] / 100;
7051
+ let bl = hwb[2] / 100;
7052
+ const ratio = wh + bl;
7053
+ let f;
7261
7054
  if (ratio > 1) {
7262
7055
  wh /= ratio;
7263
7056
  bl /= ratio;
7264
7057
  }
7265
- i = Math.floor(6 * h);
7266
- v = 1 - bl;
7058
+ const i = Math.floor(6 * h);
7059
+ const v = 1 - bl;
7267
7060
  f = 6 * h - i;
7268
7061
  if ((i & 1) !== 0) {
7269
7062
  f = 1 - f;
7270
7063
  }
7271
- n = wh + f * (v - wh);
7272
- var r;
7273
- var g;
7274
- var b;
7064
+ const n = wh + f * (v - wh);
7065
+ let r;
7066
+ let g;
7067
+ let b;
7275
7068
  switch (i) {
7276
7069
  default:
7277
7070
  case 6:
7278
- case 0:
7071
+ case 0: {
7279
7072
  r = v;
7280
7073
  g = n;
7281
7074
  b = wh;
7282
7075
  break;
7283
- case 1:
7076
+ }
7077
+ case 1: {
7284
7078
  r = n;
7285
7079
  g = v;
7286
7080
  b = wh;
7287
7081
  break;
7288
- case 2:
7082
+ }
7083
+ case 2: {
7289
7084
  r = wh;
7290
7085
  g = v;
7291
7086
  b = n;
7292
7087
  break;
7293
- case 3:
7088
+ }
7089
+ case 3: {
7294
7090
  r = wh;
7295
7091
  g = n;
7296
7092
  b = v;
7297
7093
  break;
7298
- case 4:
7094
+ }
7095
+ case 4: {
7299
7096
  r = n;
7300
7097
  g = wh;
7301
7098
  b = v;
7302
7099
  break;
7303
- case 5:
7100
+ }
7101
+ case 5: {
7304
7102
  r = v;
7305
7103
  g = wh;
7306
7104
  b = n;
7307
7105
  break;
7106
+ }
7308
7107
  }
7309
7108
  return [r * 255, g * 255, b * 255];
7310
7109
  };
7311
- convert.cmyk.rgb = function(cmyk) {
7312
- var c = cmyk[0] / 100;
7313
- var m = cmyk[1] / 100;
7314
- var y = cmyk[2] / 100;
7315
- var k = cmyk[3] / 100;
7316
- var r;
7317
- var g;
7318
- var b;
7319
- r = 1 - Math.min(1, c * (1 - k) + k);
7320
- g = 1 - Math.min(1, m * (1 - k) + k);
7321
- b = 1 - Math.min(1, y * (1 - k) + k);
7110
+ convert$1.cmyk.rgb = function(cmyk) {
7111
+ const c = cmyk[0] / 100;
7112
+ const m = cmyk[1] / 100;
7113
+ const y = cmyk[2] / 100;
7114
+ const k = cmyk[3] / 100;
7115
+ const r = 1 - Math.min(1, c * (1 - k) + k);
7116
+ const g = 1 - Math.min(1, m * (1 - k) + k);
7117
+ const b = 1 - Math.min(1, y * (1 - k) + k);
7322
7118
  return [r * 255, g * 255, b * 255];
7323
7119
  };
7324
- convert.xyz.rgb = function(xyz) {
7325
- var x = xyz[0] / 100;
7326
- var y = xyz[1] / 100;
7327
- var z = xyz[2] / 100;
7328
- var r;
7329
- var g;
7330
- var b;
7331
- r = x * 3.2406 + y * -1.5372 + z * -0.4986;
7332
- g = x * -0.9689 + y * 1.8758 + z * 0.0415;
7333
- b = x * 0.0557 + y * -0.204 + z * 1.057;
7334
- r = r > 31308e-7 ? 1.055 * Math.pow(r, 1 / 2.4) - 0.055 : r * 12.92;
7335
- g = g > 31308e-7 ? 1.055 * Math.pow(g, 1 / 2.4) - 0.055 : g * 12.92;
7336
- b = b > 31308e-7 ? 1.055 * Math.pow(b, 1 / 2.4) - 0.055 : b * 12.92;
7337
- r = Math.min(Math.max(0, r), 1);
7338
- g = Math.min(Math.max(0, g), 1);
7339
- b = Math.min(Math.max(0, b), 1);
7120
+ convert$1.xyz.rgb = function(xyz) {
7121
+ const x = xyz[0] / 100;
7122
+ const y = xyz[1] / 100;
7123
+ const z = xyz[2] / 100;
7124
+ let r;
7125
+ let g;
7126
+ let b;
7127
+ r = x * 3.2404542 + y * -1.5371385 + z * -0.4985314;
7128
+ g = x * -0.969266 + y * 1.8760108 + z * 0.041556;
7129
+ b = x * 0.0556434 + y * -0.2040259 + z * 1.0572252;
7130
+ r = srgbNonlinearTransform(r);
7131
+ g = srgbNonlinearTransform(g);
7132
+ b = srgbNonlinearTransform(b);
7340
7133
  return [r * 255, g * 255, b * 255];
7341
7134
  };
7342
- convert.xyz.lab = function(xyz) {
7343
- var x = xyz[0];
7344
- var y = xyz[1];
7345
- var z = xyz[2];
7346
- var l;
7347
- var a;
7348
- var b;
7135
+ convert$1.xyz.lab = function(xyz) {
7136
+ let x = xyz[0];
7137
+ let y = xyz[1];
7138
+ let z = xyz[2];
7349
7139
  x /= 95.047;
7350
7140
  y /= 100;
7351
7141
  z /= 108.883;
7352
- x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
7353
- y = y > 8856e-6 ? Math.pow(y, 1 / 3) : 7.787 * y + 16 / 116;
7354
- z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116;
7355
- l = 116 * y - 16;
7356
- a = 500 * (x - y);
7357
- b = 200 * (y - z);
7142
+ x = x > LAB_FT ? x ** (1 / 3) : 7.787 * x + 16 / 116;
7143
+ y = y > LAB_FT ? y ** (1 / 3) : 7.787 * y + 16 / 116;
7144
+ z = z > LAB_FT ? z ** (1 / 3) : 7.787 * z + 16 / 116;
7145
+ const l = 116 * y - 16;
7146
+ const a = 500 * (x - y);
7147
+ const b = 200 * (y - z);
7358
7148
  return [l, a, b];
7359
7149
  };
7360
- convert.lab.xyz = function(lab) {
7361
- var l = lab[0];
7362
- var a = lab[1];
7363
- var b = lab[2];
7364
- var x;
7365
- var y;
7366
- var z;
7150
+ convert$1.xyz.oklab = function(xyz) {
7151
+ const x = xyz[0] / 100;
7152
+ const y = xyz[1] / 100;
7153
+ const z = xyz[2] / 100;
7154
+ const lp = Math.cbrt(0.8189330101 * x + 0.3618667424 * y - 0.1288597137 * z);
7155
+ const mp = Math.cbrt(0.0329845436 * x + 0.9293118715 * y + 0.0361456387 * z);
7156
+ const sp = Math.cbrt(0.0482003018 * x + 0.2643662691 * y + 0.633851707 * z);
7157
+ const l = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 * sp;
7158
+ const a = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 * sp;
7159
+ const b = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 * sp;
7160
+ return [l * 100, a * 100, b * 100];
7161
+ };
7162
+ convert$1.oklab.oklch = function(oklab) {
7163
+ return convert$1.lab.lch(oklab);
7164
+ };
7165
+ convert$1.oklab.xyz = function(oklab) {
7166
+ const ll = oklab[0] / 100;
7167
+ const a = oklab[1] / 100;
7168
+ const b = oklab[2] / 100;
7169
+ const l = (0.999999998 * ll + 0.396337792 * a + 0.215803758 * b) ** 3;
7170
+ const m = (1.000000008 * ll - 0.105561342 * a - 0.063854175 * b) ** 3;
7171
+ const s = (1.000000055 * ll - 0.089484182 * a - 1.291485538 * b) ** 3;
7172
+ const x = 1.227013851 * l - 0.55779998 * m + 0.281256149 * s;
7173
+ const y = -0.040580178 * l + 1.11225687 * m - 0.071676679 * s;
7174
+ const z = -0.076381285 * l - 0.421481978 * m + 1.58616322 * s;
7175
+ return [x * 100, y * 100, z * 100];
7176
+ };
7177
+ convert$1.oklab.rgb = function(oklab) {
7178
+ const ll = oklab[0] / 100;
7179
+ const aa = oklab[1] / 100;
7180
+ const bb = oklab[2] / 100;
7181
+ const l = (ll + 0.3963377774 * aa + 0.2158037573 * bb) ** 3;
7182
+ const m = (ll - 0.1055613458 * aa - 0.0638541728 * bb) ** 3;
7183
+ const s = (ll - 0.0894841775 * aa - 1.291485548 * bb) ** 3;
7184
+ const r = srgbNonlinearTransform(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s);
7185
+ const g = srgbNonlinearTransform(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s);
7186
+ const b = srgbNonlinearTransform(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s);
7187
+ return [r * 255, g * 255, b * 255];
7188
+ };
7189
+ convert$1.oklch.oklab = function(oklch) {
7190
+ return convert$1.lch.lab(oklch);
7191
+ };
7192
+ convert$1.lab.xyz = function(lab) {
7193
+ const l = lab[0];
7194
+ const a = lab[1];
7195
+ const b = lab[2];
7196
+ let x;
7197
+ let y;
7198
+ let z;
7367
7199
  y = (l + 16) / 116;
7368
7200
  x = a / 500 + y;
7369
7201
  z = y - b / 200;
7370
- var y2 = Math.pow(y, 3);
7371
- var x2 = Math.pow(x, 3);
7372
- var z2 = Math.pow(z, 3);
7373
- y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
7374
- x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
7375
- z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
7202
+ const y2 = y ** 3;
7203
+ const x2 = x ** 3;
7204
+ const z2 = z ** 3;
7205
+ y = y2 > LAB_FT ? y2 : (y - 16 / 116) / 7.787;
7206
+ x = x2 > LAB_FT ? x2 : (x - 16 / 116) / 7.787;
7207
+ z = z2 > LAB_FT ? z2 : (z - 16 / 116) / 7.787;
7376
7208
  x *= 95.047;
7377
7209
  y *= 100;
7378
7210
  z *= 108.883;
7379
7211
  return [x, y, z];
7380
7212
  };
7381
- convert.lab.lch = function(lab) {
7382
- var l = lab[0];
7383
- var a = lab[1];
7384
- var b = lab[2];
7385
- var hr;
7386
- var h;
7387
- var c;
7388
- hr = Math.atan2(b, a);
7213
+ convert$1.lab.lch = function(lab) {
7214
+ const l = lab[0];
7215
+ const a = lab[1];
7216
+ const b = lab[2];
7217
+ let h;
7218
+ const hr = Math.atan2(b, a);
7389
7219
  h = hr * 360 / 2 / Math.PI;
7390
7220
  if (h < 0) {
7391
7221
  h += 360;
7392
7222
  }
7393
- c = Math.sqrt(a * a + b * b);
7223
+ const c = Math.sqrt(a * a + b * b);
7394
7224
  return [l, c, h];
7395
7225
  };
7396
- convert.lch.lab = function(lch) {
7397
- var l = lch[0];
7398
- var c = lch[1];
7399
- var h = lch[2];
7400
- var a;
7401
- var b;
7402
- var hr;
7403
- hr = h / 360 * 2 * Math.PI;
7404
- a = c * Math.cos(hr);
7405
- b = c * Math.sin(hr);
7226
+ convert$1.lch.lab = function(lch) {
7227
+ const l = lch[0];
7228
+ const c = lch[1];
7229
+ const h = lch[2];
7230
+ const hr = h / 360 * 2 * Math.PI;
7231
+ const a = c * Math.cos(hr);
7232
+ const b = c * Math.sin(hr);
7406
7233
  return [l, a, b];
7407
7234
  };
7408
- convert.rgb.ansi16 = function(args) {
7409
- var r = args[0];
7410
- var g = args[1];
7411
- var b = args[2];
7412
- var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2];
7235
+ convert$1.rgb.ansi16 = function(args, saturation = null) {
7236
+ const [r, g, b] = args;
7237
+ let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation;
7413
7238
  value = Math.round(value / 50);
7414
7239
  if (value === 0) {
7415
7240
  return 30;
7416
7241
  }
7417
- var ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
7242
+ let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
7418
7243
  if (value === 2) {
7419
7244
  ansi += 60;
7420
7245
  }
7421
7246
  return ansi;
7422
7247
  };
7423
- convert.hsv.ansi16 = function(args) {
7424
- return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
7248
+ convert$1.hsv.ansi16 = function(args) {
7249
+ return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
7425
7250
  };
7426
- convert.rgb.ansi256 = function(args) {
7427
- var r = args[0];
7428
- var g = args[1];
7429
- var b = args[2];
7430
- if (r === g && g === b) {
7251
+ convert$1.rgb.ansi256 = function(args) {
7252
+ const r = args[0];
7253
+ const g = args[1];
7254
+ const b = args[2];
7255
+ if (r >> 4 === g >> 4 && g >> 4 === b >> 4) {
7431
7256
  if (r < 8) {
7432
7257
  return 16;
7433
7258
  }
@@ -7436,11 +7261,12 @@ var require_conversions = __commonJS({
7436
7261
  }
7437
7262
  return Math.round((r - 8) / 247 * 24) + 232;
7438
7263
  }
7439
- var ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
7264
+ const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
7440
7265
  return ansi;
7441
7266
  };
7442
- convert.ansi16.rgb = function(args) {
7443
- var color = args % 10;
7267
+ convert$1.ansi16.rgb = function(args) {
7268
+ args = args[0];
7269
+ let color = args % 10;
7444
7270
  if (color === 0 || color === 7) {
7445
7271
  if (args > 50) {
7446
7272
  color += 3.5;
@@ -7448,60 +7274,54 @@ var require_conversions = __commonJS({
7448
7274
  color = color / 10.5 * 255;
7449
7275
  return [color, color, color];
7450
7276
  }
7451
- var mult = (~~(args > 50) + 1) * 0.5;
7452
- var r = (color & 1) * mult * 255;
7453
- var g = (color >> 1 & 1) * mult * 255;
7454
- var b = (color >> 2 & 1) * mult * 255;
7277
+ const mult = (Math.trunc(args > 50) + 1) * 0.5;
7278
+ const r = (color & 1) * mult * 255;
7279
+ const g = (color >> 1 & 1) * mult * 255;
7280
+ const b = (color >> 2 & 1) * mult * 255;
7455
7281
  return [r, g, b];
7456
7282
  };
7457
- convert.ansi256.rgb = function(args) {
7283
+ convert$1.ansi256.rgb = function(args) {
7284
+ args = args[0];
7458
7285
  if (args >= 232) {
7459
- var c = (args - 232) * 10 + 8;
7286
+ const c = (args - 232) * 10 + 8;
7460
7287
  return [c, c, c];
7461
7288
  }
7462
7289
  args -= 16;
7463
- var rem;
7464
- var r = Math.floor(args / 36) / 5 * 255;
7465
- var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
7466
- var b = rem % 6 / 5 * 255;
7290
+ let rem;
7291
+ const r = Math.floor(args / 36) / 5 * 255;
7292
+ const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
7293
+ const b = rem % 6 / 5 * 255;
7467
7294
  return [r, g, b];
7468
7295
  };
7469
- convert.rgb.hex = function(args) {
7470
- var integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
7471
- var string = integer.toString(16).toUpperCase();
7472
- return "000000".substring(string.length) + string;
7296
+ convert$1.rgb.hex = function(args) {
7297
+ const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
7298
+ const string = integer.toString(16).toUpperCase();
7299
+ return "000000".slice(string.length) + string;
7473
7300
  };
7474
- convert.hex.rgb = function(args) {
7475
- var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
7301
+ convert$1.hex.rgb = function(args) {
7302
+ const match = args.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);
7476
7303
  if (!match) {
7477
7304
  return [0, 0, 0];
7478
7305
  }
7479
- var colorString = match[0];
7306
+ let colorString = match[0];
7480
7307
  if (match[0].length === 3) {
7481
- colorString = colorString.split("").map(function(char) {
7482
- return char + char;
7483
- }).join("");
7484
- }
7485
- var integer = parseInt(colorString, 16);
7486
- var r = integer >> 16 & 255;
7487
- var g = integer >> 8 & 255;
7488
- var b = integer & 255;
7308
+ colorString = [...colorString].map((char) => char + char).join("");
7309
+ }
7310
+ const integer = Number.parseInt(colorString, 16);
7311
+ const r = integer >> 16 & 255;
7312
+ const g = integer >> 8 & 255;
7313
+ const b = integer & 255;
7489
7314
  return [r, g, b];
7490
7315
  };
7491
- convert.rgb.hcg = function(rgb) {
7492
- var r = rgb[0] / 255;
7493
- var g = rgb[1] / 255;
7494
- var b = rgb[2] / 255;
7495
- var max = Math.max(Math.max(r, g), b);
7496
- var min = Math.min(Math.min(r, g), b);
7497
- var chroma = max - min;
7498
- var grayscale;
7499
- var hue;
7500
- if (chroma < 1) {
7501
- grayscale = min / (1 - chroma);
7502
- } else {
7503
- grayscale = 0;
7504
- }
7316
+ convert$1.rgb.hcg = function(rgb) {
7317
+ const r = rgb[0] / 255;
7318
+ const g = rgb[1] / 255;
7319
+ const b = rgb[2] / 255;
7320
+ const max = Math.max(Math.max(r, g), b);
7321
+ const min = Math.min(Math.min(r, g), b);
7322
+ const chroma = max - min;
7323
+ let hue;
7324
+ const grayscale = chroma < 1 ? min / (1 - chroma) : 0;
7505
7325
  if (chroma <= 0) {
7506
7326
  hue = 0;
7507
7327
  } else if (max === r) {
@@ -7509,79 +7329,80 @@ var require_conversions = __commonJS({
7509
7329
  } else if (max === g) {
7510
7330
  hue = 2 + (b - r) / chroma;
7511
7331
  } else {
7512
- hue = 4 + (r - g) / chroma + 4;
7332
+ hue = 4 + (r - g) / chroma;
7513
7333
  }
7514
7334
  hue /= 6;
7515
7335
  hue %= 1;
7516
7336
  return [hue * 360, chroma * 100, grayscale * 100];
7517
7337
  };
7518
- convert.hsl.hcg = function(hsl) {
7519
- var s = hsl[1] / 100;
7520
- var l = hsl[2] / 100;
7521
- var c = 1;
7522
- var f = 0;
7523
- if (l < 0.5) {
7524
- c = 2 * s * l;
7525
- } else {
7526
- c = 2 * s * (1 - l);
7527
- }
7338
+ convert$1.hsl.hcg = function(hsl) {
7339
+ const s = hsl[1] / 100;
7340
+ const l = hsl[2] / 100;
7341
+ const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
7342
+ let f = 0;
7528
7343
  if (c < 1) {
7529
7344
  f = (l - 0.5 * c) / (1 - c);
7530
7345
  }
7531
7346
  return [hsl[0], c * 100, f * 100];
7532
7347
  };
7533
- convert.hsv.hcg = function(hsv) {
7534
- var s = hsv[1] / 100;
7535
- var v = hsv[2] / 100;
7536
- var c = s * v;
7537
- var f = 0;
7348
+ convert$1.hsv.hcg = function(hsv) {
7349
+ const s = hsv[1] / 100;
7350
+ const v = hsv[2] / 100;
7351
+ const c = s * v;
7352
+ let f = 0;
7538
7353
  if (c < 1) {
7539
7354
  f = (v - c) / (1 - c);
7540
7355
  }
7541
7356
  return [hsv[0], c * 100, f * 100];
7542
7357
  };
7543
- convert.hcg.rgb = function(hcg) {
7544
- var h = hcg[0] / 360;
7545
- var c = hcg[1] / 100;
7546
- var g = hcg[2] / 100;
7358
+ convert$1.hcg.rgb = function(hcg) {
7359
+ const h = hcg[0] / 360;
7360
+ const c = hcg[1] / 100;
7361
+ const g = hcg[2] / 100;
7547
7362
  if (c === 0) {
7548
7363
  return [g * 255, g * 255, g * 255];
7549
7364
  }
7550
- var pure = [0, 0, 0];
7551
- var hi = h % 1 * 6;
7552
- var v = hi % 1;
7553
- var w = 1 - v;
7554
- var mg = 0;
7365
+ const pure = [0, 0, 0];
7366
+ const hi = h % 1 * 6;
7367
+ const v = hi % 1;
7368
+ const w = 1 - v;
7369
+ let mg = 0;
7555
7370
  switch (Math.floor(hi)) {
7556
- case 0:
7371
+ case 0: {
7557
7372
  pure[0] = 1;
7558
7373
  pure[1] = v;
7559
7374
  pure[2] = 0;
7560
7375
  break;
7561
- case 1:
7376
+ }
7377
+ case 1: {
7562
7378
  pure[0] = w;
7563
7379
  pure[1] = 1;
7564
7380
  pure[2] = 0;
7565
7381
  break;
7566
- case 2:
7382
+ }
7383
+ case 2: {
7567
7384
  pure[0] = 0;
7568
7385
  pure[1] = 1;
7569
7386
  pure[2] = v;
7570
7387
  break;
7571
- case 3:
7388
+ }
7389
+ case 3: {
7572
7390
  pure[0] = 0;
7573
7391
  pure[1] = w;
7574
7392
  pure[2] = 1;
7575
7393
  break;
7576
- case 4:
7394
+ }
7395
+ case 4: {
7577
7396
  pure[0] = v;
7578
7397
  pure[1] = 0;
7579
7398
  pure[2] = 1;
7580
7399
  break;
7581
- default:
7400
+ }
7401
+ default: {
7582
7402
  pure[0] = 1;
7583
7403
  pure[1] = 0;
7584
7404
  pure[2] = w;
7405
+ }
7585
7406
  }
7586
7407
  mg = (1 - c) * g;
7587
7408
  return [
@@ -7590,21 +7411,21 @@ var require_conversions = __commonJS({
7590
7411
  (c * pure[2] + mg) * 255
7591
7412
  ];
7592
7413
  };
7593
- convert.hcg.hsv = function(hcg) {
7594
- var c = hcg[1] / 100;
7595
- var g = hcg[2] / 100;
7596
- var v = c + g * (1 - c);
7597
- var f = 0;
7414
+ convert$1.hcg.hsv = function(hcg) {
7415
+ const c = hcg[1] / 100;
7416
+ const g = hcg[2] / 100;
7417
+ const v = c + g * (1 - c);
7418
+ let f = 0;
7598
7419
  if (v > 0) {
7599
7420
  f = c / v;
7600
7421
  }
7601
7422
  return [hcg[0], f * 100, v * 100];
7602
7423
  };
7603
- convert.hcg.hsl = function(hcg) {
7604
- var c = hcg[1] / 100;
7605
- var g = hcg[2] / 100;
7606
- var l = g * (1 - c) + 0.5 * c;
7607
- var s = 0;
7424
+ convert$1.hcg.hsl = function(hcg) {
7425
+ const c = hcg[1] / 100;
7426
+ const g = hcg[2] / 100;
7427
+ const l = g * (1 - c) + 0.5 * c;
7428
+ let s = 0;
7608
7429
  if (l > 0 && l < 0.5) {
7609
7430
  s = c / (2 * l);
7610
7431
  } else if (l >= 0.5 && l < 1) {
@@ -7612,67 +7433,60 @@ var require_conversions = __commonJS({
7612
7433
  }
7613
7434
  return [hcg[0], s * 100, l * 100];
7614
7435
  };
7615
- convert.hcg.hwb = function(hcg) {
7616
- var c = hcg[1] / 100;
7617
- var g = hcg[2] / 100;
7618
- var v = c + g * (1 - c);
7436
+ convert$1.hcg.hwb = function(hcg) {
7437
+ const c = hcg[1] / 100;
7438
+ const g = hcg[2] / 100;
7439
+ const v = c + g * (1 - c);
7619
7440
  return [hcg[0], (v - c) * 100, (1 - v) * 100];
7620
7441
  };
7621
- convert.hwb.hcg = function(hwb) {
7622
- var w = hwb[1] / 100;
7623
- var b = hwb[2] / 100;
7624
- var v = 1 - b;
7625
- var c = v - w;
7626
- var g = 0;
7442
+ convert$1.hwb.hcg = function(hwb) {
7443
+ const w = hwb[1] / 100;
7444
+ const b = hwb[2] / 100;
7445
+ const v = 1 - b;
7446
+ const c = v - w;
7447
+ let g = 0;
7627
7448
  if (c < 1) {
7628
7449
  g = (v - c) / (1 - c);
7629
7450
  }
7630
7451
  return [hwb[0], c * 100, g * 100];
7631
7452
  };
7632
- convert.apple.rgb = function(apple) {
7453
+ convert$1.apple.rgb = function(apple) {
7633
7454
  return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
7634
7455
  };
7635
- convert.rgb.apple = function(rgb) {
7456
+ convert$1.rgb.apple = function(rgb) {
7636
7457
  return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
7637
7458
  };
7638
- convert.gray.rgb = function(args) {
7459
+ convert$1.gray.rgb = function(args) {
7639
7460
  return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
7640
7461
  };
7641
- convert.gray.hsl = convert.gray.hsv = function(args) {
7462
+ convert$1.gray.hsl = function(args) {
7642
7463
  return [0, 0, args[0]];
7643
7464
  };
7644
- convert.gray.hwb = function(gray) {
7465
+ convert$1.gray.hsv = convert$1.gray.hsl;
7466
+ convert$1.gray.hwb = function(gray) {
7645
7467
  return [0, 100, gray[0]];
7646
7468
  };
7647
- convert.gray.cmyk = function(gray) {
7469
+ convert$1.gray.cmyk = function(gray) {
7648
7470
  return [0, 0, 0, gray[0]];
7649
7471
  };
7650
- convert.gray.lab = function(gray) {
7472
+ convert$1.gray.lab = function(gray) {
7651
7473
  return [gray[0], 0, 0];
7652
7474
  };
7653
- convert.gray.hex = function(gray) {
7654
- var val = Math.round(gray[0] / 100 * 255) & 255;
7655
- var integer = (val << 16) + (val << 8) + val;
7656
- var string = integer.toString(16).toUpperCase();
7657
- return "000000".substring(string.length) + string;
7475
+ convert$1.gray.hex = function(gray) {
7476
+ const value = Math.round(gray[0] / 100 * 255) & 255;
7477
+ const integer = (value << 16) + (value << 8) + value;
7478
+ const string = integer.toString(16).toUpperCase();
7479
+ return "000000".slice(string.length) + string;
7658
7480
  };
7659
- convert.rgb.gray = function(rgb) {
7660
- var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
7661
- return [val / 255 * 100];
7481
+ convert$1.rgb.gray = function(rgb) {
7482
+ const value = (rgb[0] + rgb[1] + rgb[2]) / 3;
7483
+ return [value / 255 * 100];
7662
7484
  };
7663
- }
7664
- });
7665
-
7666
- // ../../node_modules/color-convert/route.js
7667
- var require_route = __commonJS({
7668
- "../../node_modules/color-convert/route.js"(exports2, module2) {
7669
- "use strict";
7670
- var conversions = require_conversions();
7671
7485
  function buildGraph() {
7672
- var graph = {};
7673
- var models = Object.keys(conversions);
7674
- for (var len = models.length, i = 0; i < len; i++) {
7675
- graph[models[i]] = {
7486
+ const graph = {};
7487
+ const models2 = Object.keys(convert$1);
7488
+ for (let { length } = models2, i = 0; i < length; i++) {
7489
+ graph[models2[i]] = {
7676
7490
  // http://jsperf.com/1-vs-infinity
7677
7491
  // micro-opt, but this is simple.
7678
7492
  distance: -1,
@@ -7682,15 +7496,15 @@ var require_route = __commonJS({
7682
7496
  return graph;
7683
7497
  }
7684
7498
  function deriveBFS(fromModel) {
7685
- var graph = buildGraph();
7686
- var queue = [fromModel];
7499
+ const graph = buildGraph();
7500
+ const queue = [fromModel];
7687
7501
  graph[fromModel].distance = 0;
7688
- while (queue.length) {
7689
- var current = queue.pop();
7690
- var adjacents = Object.keys(conversions[current]);
7691
- for (var len = adjacents.length, i = 0; i < len; i++) {
7692
- var adjacent = adjacents[i];
7693
- var node = graph[adjacent];
7502
+ while (queue.length > 0) {
7503
+ const current = queue.pop();
7504
+ const adjacents = Object.keys(convert$1[current]);
7505
+ for (let { length } = adjacents, i = 0; i < length; i++) {
7506
+ const adjacent = adjacents[i];
7507
+ const node = graph[adjacent];
7694
7508
  if (node.distance === -1) {
7695
7509
  node.distance = graph[current].distance + 1;
7696
7510
  node.parent = current;
@@ -7706,49 +7520,41 @@ var require_route = __commonJS({
7706
7520
  };
7707
7521
  }
7708
7522
  function wrapConversion(toModel, graph) {
7709
- var path = [graph[toModel].parent, toModel];
7710
- var fn = conversions[graph[toModel].parent][toModel];
7711
- var cur = graph[toModel].parent;
7523
+ const path = [graph[toModel].parent, toModel];
7524
+ let fn = convert$1[graph[toModel].parent][toModel];
7525
+ let cur = graph[toModel].parent;
7712
7526
  while (graph[cur].parent) {
7713
7527
  path.unshift(graph[cur].parent);
7714
- fn = link(conversions[graph[cur].parent][cur], fn);
7528
+ fn = link(convert$1[graph[cur].parent][cur], fn);
7715
7529
  cur = graph[cur].parent;
7716
7530
  }
7717
7531
  fn.conversion = path;
7718
7532
  return fn;
7719
7533
  }
7720
- module2.exports = function(fromModel) {
7721
- var graph = deriveBFS(fromModel);
7722
- var conversion = {};
7723
- var models = Object.keys(graph);
7724
- for (var len = models.length, i = 0; i < len; i++) {
7725
- var toModel = models[i];
7726
- var node = graph[toModel];
7534
+ function route(fromModel) {
7535
+ const graph = deriveBFS(fromModel);
7536
+ const conversion = {};
7537
+ const models2 = Object.keys(graph);
7538
+ for (let { length } = models2, i = 0; i < length; i++) {
7539
+ const toModel = models2[i];
7540
+ const node = graph[toModel];
7727
7541
  if (node.parent === null) {
7728
7542
  continue;
7729
7543
  }
7730
7544
  conversion[toModel] = wrapConversion(toModel, graph);
7731
7545
  }
7732
7546
  return conversion;
7733
- };
7734
- }
7735
- });
7736
-
7737
- // ../../node_modules/color-convert/index.js
7738
- var require_color_convert = __commonJS({
7739
- "../../node_modules/color-convert/index.js"(exports2, module2) {
7740
- "use strict";
7741
- var conversions = require_conversions();
7742
- var route = require_route();
7547
+ }
7743
7548
  var convert = {};
7744
- var models = Object.keys(conversions);
7549
+ var models = Object.keys(convert$1);
7745
7550
  function wrapRaw(fn) {
7746
- var wrappedFn = function(args) {
7747
- if (args === void 0 || args === null) {
7748
- return args;
7551
+ const wrappedFn = function(...args) {
7552
+ const arg0 = args[0];
7553
+ if (arg0 === void 0 || arg0 === null) {
7554
+ return arg0;
7749
7555
  }
7750
- if (arguments.length > 1) {
7751
- args = Array.prototype.slice.call(arguments);
7556
+ if (arg0.length > 1) {
7557
+ args = arg0;
7752
7558
  }
7753
7559
  return fn(args);
7754
7560
  };
@@ -7758,16 +7564,17 @@ var require_color_convert = __commonJS({
7758
7564
  return wrappedFn;
7759
7565
  }
7760
7566
  function wrapRounded(fn) {
7761
- var wrappedFn = function(args) {
7762
- if (args === void 0 || args === null) {
7763
- return args;
7567
+ const wrappedFn = function(...args) {
7568
+ const arg0 = args[0];
7569
+ if (arg0 === void 0 || arg0 === null) {
7570
+ return arg0;
7764
7571
  }
7765
- if (arguments.length > 1) {
7766
- args = Array.prototype.slice.call(arguments);
7572
+ if (arg0.length > 1) {
7573
+ args = arg0;
7767
7574
  }
7768
- var result = fn(args);
7575
+ const result = fn(args);
7769
7576
  if (typeof result === "object") {
7770
- for (var len = result.length, i = 0; i < len; i++) {
7577
+ for (let { length } = result, i = 0; i < length; i++) {
7771
7578
  result[i] = Math.round(result[i]);
7772
7579
  }
7773
7580
  }
@@ -7778,45 +7585,34 @@ var require_color_convert = __commonJS({
7778
7585
  }
7779
7586
  return wrappedFn;
7780
7587
  }
7781
- models.forEach(function(fromModel) {
7588
+ for (const fromModel of models) {
7782
7589
  convert[fromModel] = {};
7783
- Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels });
7784
- Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels });
7785
- var routes = route(fromModel);
7786
- var routeModels = Object.keys(routes);
7787
- routeModels.forEach(function(toModel) {
7788
- var fn = routes[toModel];
7590
+ Object.defineProperty(convert[fromModel], "channels", { value: convert$1[fromModel].channels });
7591
+ Object.defineProperty(convert[fromModel], "labels", { value: convert$1[fromModel].labels });
7592
+ const routes = route(fromModel);
7593
+ const routeModels = Object.keys(routes);
7594
+ for (const toModel of routeModels) {
7595
+ const fn = routes[toModel];
7789
7596
  convert[fromModel][toModel] = wrapRounded(fn);
7790
7597
  convert[fromModel][toModel].raw = wrapRaw(fn);
7791
- });
7792
- });
7793
- module2.exports = convert;
7794
- }
7795
- });
7796
-
7797
- // ../../node_modules/color/index.js
7798
- var require_color = __commonJS({
7799
- "../../node_modules/color/index.js"(exports2, module2) {
7800
- "use strict";
7801
- var colorString = require_color_string();
7802
- var convert = require_color_convert();
7803
- var _slice = [].slice;
7598
+ }
7599
+ }
7804
7600
  var skippedModels = [
7805
- // to be honest, I don't really feel like keyword belongs in color convert, but eh.
7601
+ // To be honest, I don't really feel like keyword belongs in color convert, but eh.
7806
7602
  "keyword",
7807
- // gray conflicts with some method names, and has its own method defined.
7603
+ // Gray conflicts with some method names, and has its own method defined.
7808
7604
  "gray",
7809
- // shouldn't really be in color-convert either...
7605
+ // Shouldn't really be in color-convert either...
7810
7606
  "hex"
7811
7607
  ];
7812
7608
  var hashedModelKeys = {};
7813
- Object.keys(convert).forEach(function(model) {
7814
- hashedModelKeys[_slice.call(convert[model].labels).sort().join("")] = model;
7815
- });
7609
+ for (const model of Object.keys(convert)) {
7610
+ hashedModelKeys[[...convert[model].labels].sort().join("")] = model;
7611
+ }
7816
7612
  var limiters = {};
7817
- function Color(obj, model) {
7613
+ function Color(object, model) {
7818
7614
  if (!(this instanceof Color)) {
7819
- return new Color(obj, model);
7615
+ return new Color(object, model);
7820
7616
  }
7821
7617
  if (model && model in skippedModels) {
7822
7618
  model = null;
@@ -7824,63 +7620,62 @@ var require_color = __commonJS({
7824
7620
  if (model && !(model in convert)) {
7825
7621
  throw new Error("Unknown model: " + model);
7826
7622
  }
7827
- var i;
7828
- var channels;
7829
- if (obj == null) {
7623
+ let i;
7624
+ let channels;
7625
+ if (object == null) {
7830
7626
  this.model = "rgb";
7831
7627
  this.color = [0, 0, 0];
7832
7628
  this.valpha = 1;
7833
- } else if (obj instanceof Color) {
7834
- this.model = obj.model;
7835
- this.color = obj.color.slice();
7836
- this.valpha = obj.valpha;
7837
- } else if (typeof obj === "string") {
7838
- var result = colorString.get(obj);
7629
+ } else if (object instanceof Color) {
7630
+ this.model = object.model;
7631
+ this.color = [...object.color];
7632
+ this.valpha = object.valpha;
7633
+ } else if (typeof object === "string") {
7634
+ const result = cs.get(object);
7839
7635
  if (result === null) {
7840
- throw new Error("Unable to parse color from string: " + obj);
7636
+ throw new Error("Unable to parse color from string: " + object);
7841
7637
  }
7842
7638
  this.model = result.model;
7843
7639
  channels = convert[this.model].channels;
7844
7640
  this.color = result.value.slice(0, channels);
7845
7641
  this.valpha = typeof result.value[channels] === "number" ? result.value[channels] : 1;
7846
- } else if (obj.length) {
7642
+ } else if (object.length > 0) {
7847
7643
  this.model = model || "rgb";
7848
7644
  channels = convert[this.model].channels;
7849
- var newArr = _slice.call(obj, 0, channels);
7850
- this.color = zeroArray(newArr, channels);
7851
- this.valpha = typeof obj[channels] === "number" ? obj[channels] : 1;
7852
- } else if (typeof obj === "number") {
7853
- obj &= 16777215;
7645
+ const newArray = Array.prototype.slice.call(object, 0, channels);
7646
+ this.color = zeroArray(newArray, channels);
7647
+ this.valpha = typeof object[channels] === "number" ? object[channels] : 1;
7648
+ } else if (typeof object === "number") {
7854
7649
  this.model = "rgb";
7855
7650
  this.color = [
7856
- obj >> 16 & 255,
7857
- obj >> 8 & 255,
7858
- obj & 255
7651
+ object >> 16 & 255,
7652
+ object >> 8 & 255,
7653
+ object & 255
7859
7654
  ];
7860
7655
  this.valpha = 1;
7861
7656
  } else {
7862
7657
  this.valpha = 1;
7863
- var keys = Object.keys(obj);
7864
- if ("alpha" in obj) {
7658
+ const keys = Object.keys(object);
7659
+ if ("alpha" in object) {
7865
7660
  keys.splice(keys.indexOf("alpha"), 1);
7866
- this.valpha = typeof obj.alpha === "number" ? obj.alpha : 0;
7661
+ this.valpha = typeof object.alpha === "number" ? object.alpha : 0;
7867
7662
  }
7868
- var hashedKeys = keys.sort().join("");
7663
+ const hashedKeys = keys.sort().join("");
7869
7664
  if (!(hashedKeys in hashedModelKeys)) {
7870
- throw new Error("Unable to parse color from object: " + JSON.stringify(obj));
7665
+ throw new Error("Unable to parse color from object: " + JSON.stringify(object));
7871
7666
  }
7872
7667
  this.model = hashedModelKeys[hashedKeys];
7873
- var labels = convert[this.model].labels;
7874
- var color = [];
7668
+ const { labels } = convert[this.model];
7669
+ const color = [];
7875
7670
  for (i = 0; i < labels.length; i++) {
7876
- color.push(obj[labels[i]]);
7671
+ color.push(object[labels[i]]);
7877
7672
  }
7878
7673
  this.color = zeroArray(color);
7879
7674
  }
7880
7675
  if (limiters[this.model]) {
7881
7676
  channels = convert[this.model].channels;
7882
7677
  for (i = 0; i < channels; i++) {
7883
- var limit = limiters[this.model][i];
7678
+ const limit = limiters[this.model][i];
7884
7679
  if (limit) {
7885
7680
  this.color[i] = limit(this.color[i]);
7886
7681
  }
@@ -7892,31 +7687,31 @@ var require_color = __commonJS({
7892
7687
  }
7893
7688
  }
7894
7689
  Color.prototype = {
7895
- toString: function() {
7690
+ toString() {
7896
7691
  return this.string();
7897
7692
  },
7898
- toJSON: function() {
7693
+ toJSON() {
7899
7694
  return this[this.model]();
7900
7695
  },
7901
- string: function(places) {
7902
- var self2 = this.model in colorString.to ? this : this.rgb();
7696
+ string(places) {
7697
+ let self2 = this.model in cs.to ? this : this.rgb();
7903
7698
  self2 = self2.round(typeof places === "number" ? places : 1);
7904
- var args = self2.valpha === 1 ? self2.color : self2.color.concat(this.valpha);
7905
- return colorString.to[self2.model](args);
7699
+ const arguments_ = self2.valpha === 1 ? self2.color : [...self2.color, this.valpha];
7700
+ return cs.to[self2.model](...arguments_);
7906
7701
  },
7907
- percentString: function(places) {
7908
- var self2 = this.rgb().round(typeof places === "number" ? places : 1);
7909
- var args = self2.valpha === 1 ? self2.color : self2.color.concat(this.valpha);
7910
- return colorString.to.rgb.percent(args);
7702
+ percentString(places) {
7703
+ const self2 = this.rgb().round(typeof places === "number" ? places : 1);
7704
+ const arguments_ = self2.valpha === 1 ? self2.color : [...self2.color, this.valpha];
7705
+ return cs.to.rgb.percent(...arguments_);
7911
7706
  },
7912
- array: function() {
7913
- return this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);
7707
+ array() {
7708
+ return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
7914
7709
  },
7915
- object: function() {
7916
- var result = {};
7917
- var channels = convert[this.model].channels;
7918
- var labels = convert[this.model].labels;
7919
- for (var i = 0; i < channels; i++) {
7710
+ object() {
7711
+ const result = {};
7712
+ const { channels } = convert[this.model];
7713
+ const { labels } = convert[this.model];
7714
+ for (let i = 0; i < channels; i++) {
7920
7715
  result[labels[i]] = this.color[i];
7921
7716
  }
7922
7717
  if (this.valpha !== 1) {
@@ -7924,8 +7719,8 @@ var require_color = __commonJS({
7924
7719
  }
7925
7720
  return result;
7926
7721
  },
7927
- unitArray: function() {
7928
- var rgb = this.rgb().color;
7722
+ unitArray() {
7723
+ const rgb = this.rgb().color;
7929
7724
  rgb[0] /= 255;
7930
7725
  rgb[1] /= 255;
7931
7726
  rgb[2] /= 255;
@@ -7934,8 +7729,8 @@ var require_color = __commonJS({
7934
7729
  }
7935
7730
  return rgb;
7936
7731
  },
7937
- unitObject: function() {
7938
- var rgb = this.rgb().object();
7732
+ unitObject() {
7733
+ const rgb = this.rgb().object();
7939
7734
  rgb.r /= 255;
7940
7735
  rgb.g /= 255;
7941
7736
  rgb.b /= 255;
@@ -7944,24 +7739,21 @@ var require_color = __commonJS({
7944
7739
  }
7945
7740
  return rgb;
7946
7741
  },
7947
- round: function(places) {
7742
+ round(places) {
7948
7743
  places = Math.max(places || 0, 0);
7949
- return new Color(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);
7744
+ return new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);
7950
7745
  },
7951
- alpha: function(val) {
7952
- if (arguments.length) {
7953
- return new Color(this.color.concat(Math.max(0, Math.min(1, val))), this.model);
7746
+ alpha(value) {
7747
+ if (value !== void 0) {
7748
+ return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
7954
7749
  }
7955
7750
  return this.valpha;
7956
7751
  },
7957
- // rgb
7752
+ // Rgb
7958
7753
  red: getset("rgb", 0, maxfn(255)),
7959
7754
  green: getset("rgb", 1, maxfn(255)),
7960
7755
  blue: getset("rgb", 2, maxfn(255)),
7961
- hue: getset(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, function(val) {
7962
- return (val % 360 + 360) % 360;
7963
- }),
7964
- // eslint-disable-line brace-style
7756
+ hue: getset(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, (value) => (value % 360 + 360) % 360),
7965
7757
  saturationl: getset("hsl", 1, maxfn(100)),
7966
7758
  lightness: getset("hsl", 2, maxfn(100)),
7967
7759
  saturationv: getset("hsv", 1, maxfn(100)),
@@ -7974,127 +7766,138 @@ var require_color = __commonJS({
7974
7766
  magenta: getset("cmyk", 1, maxfn(100)),
7975
7767
  yellow: getset("cmyk", 2, maxfn(100)),
7976
7768
  black: getset("cmyk", 3, maxfn(100)),
7977
- x: getset("xyz", 0, maxfn(100)),
7769
+ x: getset("xyz", 0, maxfn(95.047)),
7978
7770
  y: getset("xyz", 1, maxfn(100)),
7979
- z: getset("xyz", 2, maxfn(100)),
7771
+ z: getset("xyz", 2, maxfn(108.833)),
7980
7772
  l: getset("lab", 0, maxfn(100)),
7981
7773
  a: getset("lab", 1),
7982
7774
  b: getset("lab", 2),
7983
- keyword: function(val) {
7984
- if (arguments.length) {
7985
- return new Color(val);
7775
+ keyword(value) {
7776
+ if (value !== void 0) {
7777
+ return new Color(value);
7986
7778
  }
7987
7779
  return convert[this.model].keyword(this.color);
7988
7780
  },
7989
- hex: function(val) {
7990
- if (arguments.length) {
7991
- return new Color(val);
7781
+ hex(value) {
7782
+ if (value !== void 0) {
7783
+ return new Color(value);
7784
+ }
7785
+ return cs.to.hex(...this.rgb().round().color);
7786
+ },
7787
+ hexa(value) {
7788
+ if (value !== void 0) {
7789
+ return new Color(value);
7790
+ }
7791
+ const rgbArray = this.rgb().round().color;
7792
+ let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
7793
+ if (alphaHex.length === 1) {
7794
+ alphaHex = "0" + alphaHex;
7992
7795
  }
7993
- return colorString.to.hex(this.rgb().round().color);
7796
+ return cs.to.hex(...rgbArray) + alphaHex;
7994
7797
  },
7995
- rgbNumber: function() {
7996
- var rgb = this.rgb().color;
7798
+ rgbNumber() {
7799
+ const rgb = this.rgb().color;
7997
7800
  return (rgb[0] & 255) << 16 | (rgb[1] & 255) << 8 | rgb[2] & 255;
7998
7801
  },
7999
- luminosity: function() {
8000
- var rgb = this.rgb().color;
8001
- var lum = [];
8002
- for (var i = 0; i < rgb.length; i++) {
8003
- var chan = rgb[i] / 255;
8004
- lum[i] = chan <= 0.03928 ? chan / 12.92 : Math.pow((chan + 0.055) / 1.055, 2.4);
7802
+ luminosity() {
7803
+ const rgb = this.rgb().color;
7804
+ const lum = [];
7805
+ for (const [i, element] of rgb.entries()) {
7806
+ const chan = element / 255;
7807
+ lum[i] = chan <= 0.04045 ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
8005
7808
  }
8006
7809
  return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
8007
7810
  },
8008
- contrast: function(color2) {
8009
- var lum1 = this.luminosity();
8010
- var lum2 = color2.luminosity();
7811
+ contrast(color2) {
7812
+ const lum1 = this.luminosity();
7813
+ const lum2 = color2.luminosity();
8011
7814
  if (lum1 > lum2) {
8012
7815
  return (lum1 + 0.05) / (lum2 + 0.05);
8013
7816
  }
8014
7817
  return (lum2 + 0.05) / (lum1 + 0.05);
8015
7818
  },
8016
- level: function(color2) {
8017
- var contrastRatio = this.contrast(color2);
8018
- if (contrastRatio >= 7.1) {
7819
+ level(color2) {
7820
+ const contrastRatio = this.contrast(color2);
7821
+ if (contrastRatio >= 7) {
8019
7822
  return "AAA";
8020
7823
  }
8021
7824
  return contrastRatio >= 4.5 ? "AA" : "";
8022
7825
  },
8023
- isDark: function() {
8024
- var rgb = this.rgb().color;
8025
- var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1e3;
7826
+ isDark() {
7827
+ const rgb = this.rgb().color;
7828
+ const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 1e4;
8026
7829
  return yiq < 128;
8027
7830
  },
8028
- isLight: function() {
7831
+ isLight() {
8029
7832
  return !this.isDark();
8030
7833
  },
8031
- negate: function() {
8032
- var rgb = this.rgb();
8033
- for (var i = 0; i < 3; i++) {
7834
+ negate() {
7835
+ const rgb = this.rgb();
7836
+ for (let i = 0; i < 3; i++) {
8034
7837
  rgb.color[i] = 255 - rgb.color[i];
8035
7838
  }
8036
7839
  return rgb;
8037
7840
  },
8038
- lighten: function(ratio) {
8039
- var hsl = this.hsl();
7841
+ lighten(ratio) {
7842
+ const hsl = this.hsl();
8040
7843
  hsl.color[2] += hsl.color[2] * ratio;
8041
7844
  return hsl;
8042
7845
  },
8043
- darken: function(ratio) {
8044
- var hsl = this.hsl();
7846
+ darken(ratio) {
7847
+ const hsl = this.hsl();
8045
7848
  hsl.color[2] -= hsl.color[2] * ratio;
8046
7849
  return hsl;
8047
7850
  },
8048
- saturate: function(ratio) {
8049
- var hsl = this.hsl();
7851
+ saturate(ratio) {
7852
+ const hsl = this.hsl();
8050
7853
  hsl.color[1] += hsl.color[1] * ratio;
8051
7854
  return hsl;
8052
7855
  },
8053
- desaturate: function(ratio) {
8054
- var hsl = this.hsl();
7856
+ desaturate(ratio) {
7857
+ const hsl = this.hsl();
8055
7858
  hsl.color[1] -= hsl.color[1] * ratio;
8056
7859
  return hsl;
8057
7860
  },
8058
- whiten: function(ratio) {
8059
- var hwb = this.hwb();
7861
+ whiten(ratio) {
7862
+ const hwb = this.hwb();
8060
7863
  hwb.color[1] += hwb.color[1] * ratio;
8061
7864
  return hwb;
8062
7865
  },
8063
- blacken: function(ratio) {
8064
- var hwb = this.hwb();
7866
+ blacken(ratio) {
7867
+ const hwb = this.hwb();
8065
7868
  hwb.color[2] += hwb.color[2] * ratio;
8066
7869
  return hwb;
8067
7870
  },
8068
- grayscale: function() {
8069
- var rgb = this.rgb().color;
8070
- var val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
8071
- return Color.rgb(val, val, val);
7871
+ grayscale() {
7872
+ const rgb = this.rgb().color;
7873
+ const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
7874
+ return Color.rgb(value, value, value);
8072
7875
  },
8073
- fade: function(ratio) {
7876
+ fade(ratio) {
8074
7877
  return this.alpha(this.valpha - this.valpha * ratio);
8075
7878
  },
8076
- opaquer: function(ratio) {
7879
+ opaquer(ratio) {
8077
7880
  return this.alpha(this.valpha + this.valpha * ratio);
8078
7881
  },
8079
- rotate: function(degrees) {
8080
- var hsl = this.hsl();
8081
- var hue = hsl.color[0];
7882
+ rotate(degrees) {
7883
+ const hsl = this.hsl();
7884
+ let hue = hsl.color[0];
8082
7885
  hue = (hue + degrees) % 360;
8083
7886
  hue = hue < 0 ? 360 + hue : hue;
8084
7887
  hsl.color[0] = hue;
8085
7888
  return hsl;
8086
7889
  },
8087
- mix: function(mixinColor, weight) {
7890
+ mix(mixinColor, weight) {
8088
7891
  if (!mixinColor || !mixinColor.rgb) {
8089
7892
  throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
8090
7893
  }
8091
- var color1 = mixinColor.rgb();
8092
- var color2 = this.rgb();
8093
- var p = weight === void 0 ? 0.5 : weight;
8094
- var w = 2 * p - 1;
8095
- var a = color1.alpha() - color2.alpha();
8096
- var w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2;
8097
- var w2 = 1 - w1;
7894
+ const color1 = mixinColor.rgb();
7895
+ const color2 = this.rgb();
7896
+ const p = weight === void 0 ? 0.5 : weight;
7897
+ const w = 2 * p - 1;
7898
+ const a = color1.alpha() - color2.alpha();
7899
+ const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2;
7900
+ const w2 = 1 - w1;
8098
7901
  return Color.rgb(
8099
7902
  w1 * color1.red() + w2 * color2.red(),
8100
7903
  w1 * color1.green() + w2 * color2.green(),
@@ -8103,50 +7906,50 @@ var require_color = __commonJS({
8103
7906
  );
8104
7907
  }
8105
7908
  };
8106
- Object.keys(convert).forEach(function(model) {
8107
- if (skippedModels.indexOf(model) !== -1) {
8108
- return;
7909
+ for (const model of Object.keys(convert)) {
7910
+ if (skippedModels.includes(model)) {
7911
+ continue;
8109
7912
  }
8110
- var channels = convert[model].channels;
8111
- Color.prototype[model] = function() {
7913
+ const { channels } = convert[model];
7914
+ Color.prototype[model] = function(...arguments_) {
8112
7915
  if (this.model === model) {
8113
7916
  return new Color(this);
8114
7917
  }
8115
- if (arguments.length) {
8116
- return new Color(arguments, model);
7918
+ if (arguments_.length > 0) {
7919
+ return new Color(arguments_, model);
8117
7920
  }
8118
- var newAlpha = typeof arguments[channels] === "number" ? channels : this.valpha;
8119
- return new Color(assertArray(convert[this.model][model].raw(this.color)).concat(newAlpha), model);
7921
+ return new Color([...assertArray(convert[this.model][model].raw(this.color)), this.valpha], model);
8120
7922
  };
8121
- Color[model] = function(color) {
7923
+ Color[model] = function(...arguments_) {
7924
+ let color = arguments_[0];
8122
7925
  if (typeof color === "number") {
8123
- color = zeroArray(_slice.call(arguments), channels);
7926
+ color = zeroArray(arguments_, channels);
8124
7927
  }
8125
7928
  return new Color(color, model);
8126
7929
  };
8127
- });
8128
- function roundTo(num, places) {
8129
- return Number(num.toFixed(places));
7930
+ }
7931
+ function roundTo(number, places) {
7932
+ return Number(number.toFixed(places));
8130
7933
  }
8131
7934
  function roundToPlace(places) {
8132
- return function(num) {
8133
- return roundTo(num, places);
7935
+ return function(number) {
7936
+ return roundTo(number, places);
8134
7937
  };
8135
7938
  }
8136
7939
  function getset(model, channel, modifier) {
8137
7940
  model = Array.isArray(model) ? model : [model];
8138
- model.forEach(function(m) {
8139
- (limiters[m] || (limiters[m] = []))[channel] = modifier;
8140
- });
7941
+ for (const m of model) {
7942
+ (limiters[m] ||= [])[channel] = modifier;
7943
+ }
8141
7944
  model = model[0];
8142
- return function(val) {
8143
- var result;
8144
- if (arguments.length) {
7945
+ return function(value) {
7946
+ let result;
7947
+ if (value !== void 0) {
8145
7948
  if (modifier) {
8146
- val = modifier(val);
7949
+ value = modifier(value);
8147
7950
  }
8148
7951
  result = this[model]();
8149
- result.color[channel] = val;
7952
+ result.color[channel] = value;
8150
7953
  return result;
8151
7954
  }
8152
7955
  result = this[model]().color[channel];
@@ -8161,26 +7964,21 @@ var require_color = __commonJS({
8161
7964
  return Math.max(0, Math.min(max, v));
8162
7965
  };
8163
7966
  }
8164
- function assertArray(val) {
8165
- return Array.isArray(val) ? val : [val];
7967
+ function assertArray(value) {
7968
+ return Array.isArray(value) ? value : [value];
8166
7969
  }
8167
- function zeroArray(arr, length) {
8168
- for (var i = 0; i < length; i++) {
8169
- if (typeof arr[i] !== "number") {
8170
- arr[i] = 0;
7970
+ function zeroArray(array, length) {
7971
+ for (let i = 0; i < length; i++) {
7972
+ if (typeof array[i] !== "number") {
7973
+ array[i] = 0;
8171
7974
  }
8172
7975
  }
8173
- return arr;
7976
+ return array;
8174
7977
  }
8175
- module2.exports = Color;
8176
- }
8177
- });
8178
-
8179
- // ../../node_modules/text-hex/index.js
8180
- var require_text_hex = __commonJS({
8181
- "../../node_modules/text-hex/index.js"(exports2, module2) {
8182
- "use strict";
8183
- module2.exports = function hex(str) {
7978
+ function getDefaultExportFromCjs(x) {
7979
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
7980
+ }
7981
+ var textHex = function hex2(str) {
8184
7982
  for (var i = 0, hash = 0; i < str.length; hash = str.charCodeAt(i++) + ((hash << 5) - hash)) ;
8185
7983
  var color = Math.floor(
8186
7984
  Math.abs(
@@ -8189,24 +7987,17 @@ var require_text_hex = __commonJS({
8189
7987
  ).toString(16);
8190
7988
  return "#" + Array(6 - color.length + 1).join("0") + color;
8191
7989
  };
8192
- }
8193
- });
8194
-
8195
- // ../../node_modules/colorspace/index.js
8196
- var require_colorspace = __commonJS({
8197
- "../../node_modules/colorspace/index.js"(exports2, module2) {
8198
- "use strict";
8199
- var color = require_color();
8200
- var hex = require_text_hex();
8201
- module2.exports = function colorspace(namespace, delimiter) {
8202
- var split = namespace.split(delimiter || ":");
8203
- var base = hex(split[0]);
7990
+ var hex = /* @__PURE__ */ getDefaultExportFromCjs(textHex);
7991
+ function colorspace(namespace, delimiter) {
7992
+ const split = namespace.split(delimiter || ":");
7993
+ let base = hex(split[0]);
8204
7994
  if (!split.length) return base;
8205
- for (var i = 0, l = split.length - 1; i < l; i++) {
8206
- base = color(base).mix(color(hex(split[i + 1]))).saturate(1).hex();
7995
+ for (let i = 0, l = split.length - 1; i < l; i++) {
7996
+ base = Color(base).mix(Color(hex(split[i + 1]))).saturate(1).hex();
8207
7997
  }
8208
7998
  return base;
8209
- };
7999
+ }
8000
+ module2.exports = colorspace;
8210
8001
  }
8211
8002
  });
8212
8003
 
@@ -8257,7 +8048,7 @@ var require_kuler = __commonJS({
8257
8048
  var require_namespace_ansi = __commonJS({
8258
8049
  "../../node_modules/@dabh/diagnostics/modifiers/namespace-ansi.js"(exports2, module2) {
8259
8050
  "use strict";
8260
- var colorspace = require_colorspace();
8051
+ var colorspace = require_index_cjs();
8261
8052
  var kuler = require_kuler();
8262
8053
  module2.exports = function ansiModifier(args, options) {
8263
8054
  var namespace = options.namespace;
@@ -8540,6 +8331,28 @@ var require_file = __commonJS({
8540
8331
  }
8541
8332
  }
8542
8333
  }
8334
+ /**
8335
+ * Called by Node.js Writable stream before emitting 'finish'.
8336
+ * Ensures all buffered data is flushed to the underlying file stream
8337
+ * before the transport signals completion.
8338
+ * @param {Function} callback - Callback to signal completion.
8339
+ * @private
8340
+ */
8341
+ _final(callback) {
8342
+ if (this._opening) {
8343
+ this.once("open", () => this._final(callback));
8344
+ return;
8345
+ }
8346
+ this._stream.end();
8347
+ if (!this._dest) {
8348
+ return callback();
8349
+ }
8350
+ if (this._dest.writableFinished) {
8351
+ return callback();
8352
+ }
8353
+ this._dest.once("finish", callback);
8354
+ this._dest.once("error", callback);
8355
+ }
8543
8356
  /**
8544
8357
  * Core logging method exposed to Winston. Metadata is optional.
8545
8358
  * @param {Object} info - TODO: add param description.
@@ -10213,6 +10026,7 @@ var require_logger = __commonJS({
10213
10026
  if (info instanceof Error) {
10214
10027
  infoClone.stack = info.stack;
10215
10028
  infoClone.message = info.message;
10029
+ infoClone.cause = info.cause;
10216
10030
  }
10217
10031
  logger2.write(infoClone);
10218
10032
  }
@@ -10282,6 +10096,23 @@ var require_logger = __commonJS({
10282
10096
  this.rejections.handle(rejectionHandlers);
10283
10097
  }
10284
10098
  }
10099
+ /* eslint-disable valid-jsdoc */
10100
+ /**
10101
+ * Helper method to get the highest logging level associated with a logger
10102
+ *
10103
+ * @returns { number | null } - The highest configured logging level, null
10104
+ * for invalid configuration
10105
+ */
10106
+ getHighestLogLevel() {
10107
+ const configuredLevelValue = getLevelValue(this.levels, this.level);
10108
+ if (!this.transports || this.transports.length === 0) {
10109
+ return configuredLevelValue;
10110
+ }
10111
+ return this.transports.reduce((max, transport) => {
10112
+ const levelValue = getLevelValue(this.levels, transport.level);
10113
+ return levelValue !== null && levelValue > max ? levelValue : max;
10114
+ }, configuredLevelValue);
10115
+ }
10285
10116
  isLevelEnabled(level) {
10286
10117
  const givenLevelValue = getLevelValue(this.levels, level);
10287
10118
  if (givenLevelValue === null) {