@abtnode/core 1.16.52-beta-20251002-030549-0f91dab2 → 1.16.52-beta-20251005-235515-42ad5caf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/team.js +579 -47
- package/lib/blocklet/downloader/blocklet-downloader.js +2 -2
- package/lib/blocklet/downloader/bundle-downloader.js +13 -38
- package/lib/blocklet/manager/disk.js +200 -84
- package/lib/blocklet/manager/ensure-blocklet-running.js +3 -2
- package/lib/blocklet/manager/helper/blue-green-get-componentids.js +59 -0
- package/lib/blocklet/manager/helper/blue-green-start-blocklet.js +292 -0
- package/lib/blocklet/manager/helper/blue-green-update-blocklet-status.js +18 -0
- package/lib/blocklet/manager/helper/blue-green-upgrade-blocklet.js +191 -0
- package/lib/blocklet/manager/helper/upgrade-components.js +2 -9
- package/lib/blocklet/migration-dist/migration.cjs +459 -457
- package/lib/blocklet/passport/index.js +8 -2
- package/lib/index.js +18 -0
- package/lib/monitor/blocklet-runtime-monitor.js +12 -7
- package/lib/states/audit-log.js +54 -2
- package/lib/states/blocklet.js +23 -8
- package/lib/states/index.js +3 -0
- package/lib/states/org.js +661 -0
- package/lib/team/manager.js +10 -3
- package/lib/util/blocklet.js +190 -115
- package/lib/util/docker/is-docker-only-single-instances.js +17 -0
- package/lib/util/org.js +99 -0
- package/lib/validators/org.js +19 -0
- package/package.json +26 -26
|
@@ -359,7 +359,7 @@ const MONITOR_RECORD_INTERVAL_SEC = 20;
|
|
|
359
359
|
const MONITOR_HISTORY_LENGTH = 86400 / MONITOR_RECORD_INTERVAL_SEC;
|
|
360
360
|
|
|
361
361
|
const FEDERATED = {
|
|
362
|
-
SYNC_LIMIT:
|
|
362
|
+
SYNC_LIMIT: 30,
|
|
363
363
|
};
|
|
364
364
|
|
|
365
365
|
const ROUTING_RESPONSE_TYPES = [
|
|
@@ -730,6 +730,8 @@ module.exports = Object.freeze({
|
|
|
730
730
|
'deleteBlockletResponseHeaderPolicy',
|
|
731
731
|
'deleteBlockletAccessPolicy',
|
|
732
732
|
'configVault',
|
|
733
|
+
'removeOrgMember',
|
|
734
|
+
'deleteOrg',
|
|
733
735
|
],
|
|
734
736
|
|
|
735
737
|
// 如果是 multiple tenant 的情况下, 这些白名单不会验证 RBAC
|
|
@@ -5429,11 +5431,457 @@ SafeBuffer.allocUnsafeSlow = function (size) {
|
|
|
5429
5431
|
|
|
5430
5432
|
/***/ }),
|
|
5431
5433
|
|
|
5432
|
-
/***/
|
|
5434
|
+
/***/ 4953:
|
|
5435
|
+
/***/ ((module) => {
|
|
5436
|
+
|
|
5437
|
+
"use strict";
|
|
5438
|
+
|
|
5439
|
+
|
|
5440
|
+
module.exports = {
|
|
5441
|
+
"aliceblue": [240, 248, 255],
|
|
5442
|
+
"antiquewhite": [250, 235, 215],
|
|
5443
|
+
"aqua": [0, 255, 255],
|
|
5444
|
+
"aquamarine": [127, 255, 212],
|
|
5445
|
+
"azure": [240, 255, 255],
|
|
5446
|
+
"beige": [245, 245, 220],
|
|
5447
|
+
"bisque": [255, 228, 196],
|
|
5448
|
+
"black": [0, 0, 0],
|
|
5449
|
+
"blanchedalmond": [255, 235, 205],
|
|
5450
|
+
"blue": [0, 0, 255],
|
|
5451
|
+
"blueviolet": [138, 43, 226],
|
|
5452
|
+
"brown": [165, 42, 42],
|
|
5453
|
+
"burlywood": [222, 184, 135],
|
|
5454
|
+
"cadetblue": [95, 158, 160],
|
|
5455
|
+
"chartreuse": [127, 255, 0],
|
|
5456
|
+
"chocolate": [210, 105, 30],
|
|
5457
|
+
"coral": [255, 127, 80],
|
|
5458
|
+
"cornflowerblue": [100, 149, 237],
|
|
5459
|
+
"cornsilk": [255, 248, 220],
|
|
5460
|
+
"crimson": [220, 20, 60],
|
|
5461
|
+
"cyan": [0, 255, 255],
|
|
5462
|
+
"darkblue": [0, 0, 139],
|
|
5463
|
+
"darkcyan": [0, 139, 139],
|
|
5464
|
+
"darkgoldenrod": [184, 134, 11],
|
|
5465
|
+
"darkgray": [169, 169, 169],
|
|
5466
|
+
"darkgreen": [0, 100, 0],
|
|
5467
|
+
"darkgrey": [169, 169, 169],
|
|
5468
|
+
"darkkhaki": [189, 183, 107],
|
|
5469
|
+
"darkmagenta": [139, 0, 139],
|
|
5470
|
+
"darkolivegreen": [85, 107, 47],
|
|
5471
|
+
"darkorange": [255, 140, 0],
|
|
5472
|
+
"darkorchid": [153, 50, 204],
|
|
5473
|
+
"darkred": [139, 0, 0],
|
|
5474
|
+
"darksalmon": [233, 150, 122],
|
|
5475
|
+
"darkseagreen": [143, 188, 143],
|
|
5476
|
+
"darkslateblue": [72, 61, 139],
|
|
5477
|
+
"darkslategray": [47, 79, 79],
|
|
5478
|
+
"darkslategrey": [47, 79, 79],
|
|
5479
|
+
"darkturquoise": [0, 206, 209],
|
|
5480
|
+
"darkviolet": [148, 0, 211],
|
|
5481
|
+
"deeppink": [255, 20, 147],
|
|
5482
|
+
"deepskyblue": [0, 191, 255],
|
|
5483
|
+
"dimgray": [105, 105, 105],
|
|
5484
|
+
"dimgrey": [105, 105, 105],
|
|
5485
|
+
"dodgerblue": [30, 144, 255],
|
|
5486
|
+
"firebrick": [178, 34, 34],
|
|
5487
|
+
"floralwhite": [255, 250, 240],
|
|
5488
|
+
"forestgreen": [34, 139, 34],
|
|
5489
|
+
"fuchsia": [255, 0, 255],
|
|
5490
|
+
"gainsboro": [220, 220, 220],
|
|
5491
|
+
"ghostwhite": [248, 248, 255],
|
|
5492
|
+
"gold": [255, 215, 0],
|
|
5493
|
+
"goldenrod": [218, 165, 32],
|
|
5494
|
+
"gray": [128, 128, 128],
|
|
5495
|
+
"green": [0, 128, 0],
|
|
5496
|
+
"greenyellow": [173, 255, 47],
|
|
5497
|
+
"grey": [128, 128, 128],
|
|
5498
|
+
"honeydew": [240, 255, 240],
|
|
5499
|
+
"hotpink": [255, 105, 180],
|
|
5500
|
+
"indianred": [205, 92, 92],
|
|
5501
|
+
"indigo": [75, 0, 130],
|
|
5502
|
+
"ivory": [255, 255, 240],
|
|
5503
|
+
"khaki": [240, 230, 140],
|
|
5504
|
+
"lavender": [230, 230, 250],
|
|
5505
|
+
"lavenderblush": [255, 240, 245],
|
|
5506
|
+
"lawngreen": [124, 252, 0],
|
|
5507
|
+
"lemonchiffon": [255, 250, 205],
|
|
5508
|
+
"lightblue": [173, 216, 230],
|
|
5509
|
+
"lightcoral": [240, 128, 128],
|
|
5510
|
+
"lightcyan": [224, 255, 255],
|
|
5511
|
+
"lightgoldenrodyellow": [250, 250, 210],
|
|
5512
|
+
"lightgray": [211, 211, 211],
|
|
5513
|
+
"lightgreen": [144, 238, 144],
|
|
5514
|
+
"lightgrey": [211, 211, 211],
|
|
5515
|
+
"lightpink": [255, 182, 193],
|
|
5516
|
+
"lightsalmon": [255, 160, 122],
|
|
5517
|
+
"lightseagreen": [32, 178, 170],
|
|
5518
|
+
"lightskyblue": [135, 206, 250],
|
|
5519
|
+
"lightslategray": [119, 136, 153],
|
|
5520
|
+
"lightslategrey": [119, 136, 153],
|
|
5521
|
+
"lightsteelblue": [176, 196, 222],
|
|
5522
|
+
"lightyellow": [255, 255, 224],
|
|
5523
|
+
"lime": [0, 255, 0],
|
|
5524
|
+
"limegreen": [50, 205, 50],
|
|
5525
|
+
"linen": [250, 240, 230],
|
|
5526
|
+
"magenta": [255, 0, 255],
|
|
5527
|
+
"maroon": [128, 0, 0],
|
|
5528
|
+
"mediumaquamarine": [102, 205, 170],
|
|
5529
|
+
"mediumblue": [0, 0, 205],
|
|
5530
|
+
"mediumorchid": [186, 85, 211],
|
|
5531
|
+
"mediumpurple": [147, 112, 219],
|
|
5532
|
+
"mediumseagreen": [60, 179, 113],
|
|
5533
|
+
"mediumslateblue": [123, 104, 238],
|
|
5534
|
+
"mediumspringgreen": [0, 250, 154],
|
|
5535
|
+
"mediumturquoise": [72, 209, 204],
|
|
5536
|
+
"mediumvioletred": [199, 21, 133],
|
|
5537
|
+
"midnightblue": [25, 25, 112],
|
|
5538
|
+
"mintcream": [245, 255, 250],
|
|
5539
|
+
"mistyrose": [255, 228, 225],
|
|
5540
|
+
"moccasin": [255, 228, 181],
|
|
5541
|
+
"navajowhite": [255, 222, 173],
|
|
5542
|
+
"navy": [0, 0, 128],
|
|
5543
|
+
"oldlace": [253, 245, 230],
|
|
5544
|
+
"olive": [128, 128, 0],
|
|
5545
|
+
"olivedrab": [107, 142, 35],
|
|
5546
|
+
"orange": [255, 165, 0],
|
|
5547
|
+
"orangered": [255, 69, 0],
|
|
5548
|
+
"orchid": [218, 112, 214],
|
|
5549
|
+
"palegoldenrod": [238, 232, 170],
|
|
5550
|
+
"palegreen": [152, 251, 152],
|
|
5551
|
+
"paleturquoise": [175, 238, 238],
|
|
5552
|
+
"palevioletred": [219, 112, 147],
|
|
5553
|
+
"papayawhip": [255, 239, 213],
|
|
5554
|
+
"peachpuff": [255, 218, 185],
|
|
5555
|
+
"peru": [205, 133, 63],
|
|
5556
|
+
"pink": [255, 192, 203],
|
|
5557
|
+
"plum": [221, 160, 221],
|
|
5558
|
+
"powderblue": [176, 224, 230],
|
|
5559
|
+
"purple": [128, 0, 128],
|
|
5560
|
+
"rebeccapurple": [102, 51, 153],
|
|
5561
|
+
"red": [255, 0, 0],
|
|
5562
|
+
"rosybrown": [188, 143, 143],
|
|
5563
|
+
"royalblue": [65, 105, 225],
|
|
5564
|
+
"saddlebrown": [139, 69, 19],
|
|
5565
|
+
"salmon": [250, 128, 114],
|
|
5566
|
+
"sandybrown": [244, 164, 96],
|
|
5567
|
+
"seagreen": [46, 139, 87],
|
|
5568
|
+
"seashell": [255, 245, 238],
|
|
5569
|
+
"sienna": [160, 82, 45],
|
|
5570
|
+
"silver": [192, 192, 192],
|
|
5571
|
+
"skyblue": [135, 206, 235],
|
|
5572
|
+
"slateblue": [106, 90, 205],
|
|
5573
|
+
"slategray": [112, 128, 144],
|
|
5574
|
+
"slategrey": [112, 128, 144],
|
|
5575
|
+
"snow": [255, 250, 250],
|
|
5576
|
+
"springgreen": [0, 255, 127],
|
|
5577
|
+
"steelblue": [70, 130, 180],
|
|
5578
|
+
"tan": [210, 180, 140],
|
|
5579
|
+
"teal": [0, 128, 128],
|
|
5580
|
+
"thistle": [216, 191, 216],
|
|
5581
|
+
"tomato": [255, 99, 71],
|
|
5582
|
+
"turquoise": [64, 224, 208],
|
|
5583
|
+
"violet": [238, 130, 238],
|
|
5584
|
+
"wheat": [245, 222, 179],
|
|
5585
|
+
"white": [255, 255, 255],
|
|
5586
|
+
"whitesmoke": [245, 245, 245],
|
|
5587
|
+
"yellow": [255, 255, 0],
|
|
5588
|
+
"yellowgreen": [154, 205, 50]
|
|
5589
|
+
};
|
|
5590
|
+
|
|
5591
|
+
|
|
5592
|
+
/***/ }),
|
|
5593
|
+
|
|
5594
|
+
/***/ 9407:
|
|
5595
|
+
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5596
|
+
|
|
5597
|
+
/* MIT license */
|
|
5598
|
+
var colorNames = __nccwpck_require__(4953);
|
|
5599
|
+
var swizzle = __nccwpck_require__(4421);
|
|
5600
|
+
var hasOwnProperty = Object.hasOwnProperty;
|
|
5601
|
+
|
|
5602
|
+
var reverseNames = Object.create(null);
|
|
5603
|
+
|
|
5604
|
+
// create a list of reverse color names
|
|
5605
|
+
for (var name in colorNames) {
|
|
5606
|
+
if (hasOwnProperty.call(colorNames, name)) {
|
|
5607
|
+
reverseNames[colorNames[name]] = name;
|
|
5608
|
+
}
|
|
5609
|
+
}
|
|
5610
|
+
|
|
5611
|
+
var cs = module.exports = {
|
|
5612
|
+
to: {},
|
|
5613
|
+
get: {}
|
|
5614
|
+
};
|
|
5615
|
+
|
|
5616
|
+
cs.get = function (string) {
|
|
5617
|
+
var prefix = string.substring(0, 3).toLowerCase();
|
|
5618
|
+
var val;
|
|
5619
|
+
var model;
|
|
5620
|
+
switch (prefix) {
|
|
5621
|
+
case 'hsl':
|
|
5622
|
+
val = cs.get.hsl(string);
|
|
5623
|
+
model = 'hsl';
|
|
5624
|
+
break;
|
|
5625
|
+
case 'hwb':
|
|
5626
|
+
val = cs.get.hwb(string);
|
|
5627
|
+
model = 'hwb';
|
|
5628
|
+
break;
|
|
5629
|
+
default:
|
|
5630
|
+
val = cs.get.rgb(string);
|
|
5631
|
+
model = 'rgb';
|
|
5632
|
+
break;
|
|
5633
|
+
}
|
|
5634
|
+
|
|
5635
|
+
if (!val) {
|
|
5636
|
+
return null;
|
|
5637
|
+
}
|
|
5638
|
+
|
|
5639
|
+
return {model: model, value: val};
|
|
5640
|
+
};
|
|
5641
|
+
|
|
5642
|
+
cs.get.rgb = function (string) {
|
|
5643
|
+
if (!string) {
|
|
5644
|
+
return null;
|
|
5645
|
+
}
|
|
5646
|
+
|
|
5647
|
+
var abbr = /^#([a-f0-9]{3,4})$/i;
|
|
5648
|
+
var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
|
|
5649
|
+
var rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
|
|
5650
|
+
var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
|
|
5651
|
+
var keyword = /^(\w+)$/;
|
|
5652
|
+
|
|
5653
|
+
var rgb = [0, 0, 0, 1];
|
|
5654
|
+
var match;
|
|
5655
|
+
var i;
|
|
5656
|
+
var hexAlpha;
|
|
5657
|
+
|
|
5658
|
+
if (match = string.match(hex)) {
|
|
5659
|
+
hexAlpha = match[2];
|
|
5660
|
+
match = match[1];
|
|
5661
|
+
|
|
5662
|
+
for (i = 0; i < 3; i++) {
|
|
5663
|
+
// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19
|
|
5664
|
+
var i2 = i * 2;
|
|
5665
|
+
rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
|
|
5666
|
+
}
|
|
5667
|
+
|
|
5668
|
+
if (hexAlpha) {
|
|
5669
|
+
rgb[3] = parseInt(hexAlpha, 16) / 255;
|
|
5670
|
+
}
|
|
5671
|
+
} else if (match = string.match(abbr)) {
|
|
5672
|
+
match = match[1];
|
|
5673
|
+
hexAlpha = match[3];
|
|
5674
|
+
|
|
5675
|
+
for (i = 0; i < 3; i++) {
|
|
5676
|
+
rgb[i] = parseInt(match[i] + match[i], 16);
|
|
5677
|
+
}
|
|
5678
|
+
|
|
5679
|
+
if (hexAlpha) {
|
|
5680
|
+
rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
|
|
5681
|
+
}
|
|
5682
|
+
} else if (match = string.match(rgba)) {
|
|
5683
|
+
for (i = 0; i < 3; i++) {
|
|
5684
|
+
rgb[i] = parseInt(match[i + 1], 0);
|
|
5685
|
+
}
|
|
5686
|
+
|
|
5687
|
+
if (match[4]) {
|
|
5688
|
+
if (match[5]) {
|
|
5689
|
+
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
5690
|
+
} else {
|
|
5691
|
+
rgb[3] = parseFloat(match[4]);
|
|
5692
|
+
}
|
|
5693
|
+
}
|
|
5694
|
+
} else if (match = string.match(per)) {
|
|
5695
|
+
for (i = 0; i < 3; i++) {
|
|
5696
|
+
rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
|
|
5697
|
+
}
|
|
5698
|
+
|
|
5699
|
+
if (match[4]) {
|
|
5700
|
+
if (match[5]) {
|
|
5701
|
+
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
5702
|
+
} else {
|
|
5703
|
+
rgb[3] = parseFloat(match[4]);
|
|
5704
|
+
}
|
|
5705
|
+
}
|
|
5706
|
+
} else if (match = string.match(keyword)) {
|
|
5707
|
+
if (match[1] === 'transparent') {
|
|
5708
|
+
return [0, 0, 0, 0];
|
|
5709
|
+
}
|
|
5710
|
+
|
|
5711
|
+
if (!hasOwnProperty.call(colorNames, match[1])) {
|
|
5712
|
+
return null;
|
|
5713
|
+
}
|
|
5714
|
+
|
|
5715
|
+
rgb = colorNames[match[1]];
|
|
5716
|
+
rgb[3] = 1;
|
|
5717
|
+
|
|
5718
|
+
return rgb;
|
|
5719
|
+
} else {
|
|
5720
|
+
return null;
|
|
5721
|
+
}
|
|
5722
|
+
|
|
5723
|
+
for (i = 0; i < 3; i++) {
|
|
5724
|
+
rgb[i] = clamp(rgb[i], 0, 255);
|
|
5725
|
+
}
|
|
5726
|
+
rgb[3] = clamp(rgb[3], 0, 1);
|
|
5727
|
+
|
|
5728
|
+
return rgb;
|
|
5729
|
+
};
|
|
5730
|
+
|
|
5731
|
+
cs.get.hsl = function (string) {
|
|
5732
|
+
if (!string) {
|
|
5733
|
+
return null;
|
|
5734
|
+
}
|
|
5735
|
+
|
|
5736
|
+
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*)?\)$/;
|
|
5737
|
+
var match = string.match(hsl);
|
|
5738
|
+
|
|
5739
|
+
if (match) {
|
|
5740
|
+
var alpha = parseFloat(match[4]);
|
|
5741
|
+
var h = ((parseFloat(match[1]) % 360) + 360) % 360;
|
|
5742
|
+
var s = clamp(parseFloat(match[2]), 0, 100);
|
|
5743
|
+
var l = clamp(parseFloat(match[3]), 0, 100);
|
|
5744
|
+
var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
5745
|
+
|
|
5746
|
+
return [h, s, l, a];
|
|
5747
|
+
}
|
|
5748
|
+
|
|
5749
|
+
return null;
|
|
5750
|
+
};
|
|
5751
|
+
|
|
5752
|
+
cs.get.hwb = function (string) {
|
|
5753
|
+
if (!string) {
|
|
5754
|
+
return null;
|
|
5755
|
+
}
|
|
5756
|
+
|
|
5757
|
+
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*)?\)$/;
|
|
5758
|
+
var match = string.match(hwb);
|
|
5759
|
+
|
|
5760
|
+
if (match) {
|
|
5761
|
+
var alpha = parseFloat(match[4]);
|
|
5762
|
+
var h = ((parseFloat(match[1]) % 360) + 360) % 360;
|
|
5763
|
+
var w = clamp(parseFloat(match[2]), 0, 100);
|
|
5764
|
+
var b = clamp(parseFloat(match[3]), 0, 100);
|
|
5765
|
+
var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
5766
|
+
return [h, w, b, a];
|
|
5767
|
+
}
|
|
5768
|
+
|
|
5769
|
+
return null;
|
|
5770
|
+
};
|
|
5771
|
+
|
|
5772
|
+
cs.to.hex = function () {
|
|
5773
|
+
var rgba = swizzle(arguments);
|
|
5774
|
+
|
|
5775
|
+
return (
|
|
5776
|
+
'#' +
|
|
5777
|
+
hexDouble(rgba[0]) +
|
|
5778
|
+
hexDouble(rgba[1]) +
|
|
5779
|
+
hexDouble(rgba[2]) +
|
|
5780
|
+
(rgba[3] < 1
|
|
5781
|
+
? (hexDouble(Math.round(rgba[3] * 255)))
|
|
5782
|
+
: '')
|
|
5783
|
+
);
|
|
5784
|
+
};
|
|
5785
|
+
|
|
5786
|
+
cs.to.rgb = function () {
|
|
5787
|
+
var rgba = swizzle(arguments);
|
|
5788
|
+
|
|
5789
|
+
return rgba.length < 4 || rgba[3] === 1
|
|
5790
|
+
? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'
|
|
5791
|
+
: 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';
|
|
5792
|
+
};
|
|
5793
|
+
|
|
5794
|
+
cs.to.rgb.percent = function () {
|
|
5795
|
+
var rgba = swizzle(arguments);
|
|
5796
|
+
|
|
5797
|
+
var r = Math.round(rgba[0] / 255 * 100);
|
|
5798
|
+
var g = Math.round(rgba[1] / 255 * 100);
|
|
5799
|
+
var b = Math.round(rgba[2] / 255 * 100);
|
|
5800
|
+
|
|
5801
|
+
return rgba.length < 4 || rgba[3] === 1
|
|
5802
|
+
? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'
|
|
5803
|
+
: 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';
|
|
5804
|
+
};
|
|
5805
|
+
|
|
5806
|
+
cs.to.hsl = function () {
|
|
5807
|
+
var hsla = swizzle(arguments);
|
|
5808
|
+
return hsla.length < 4 || hsla[3] === 1
|
|
5809
|
+
? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'
|
|
5810
|
+
: 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';
|
|
5811
|
+
};
|
|
5812
|
+
|
|
5813
|
+
// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
|
|
5814
|
+
// (hwb have alpha optional & 1 is default value)
|
|
5815
|
+
cs.to.hwb = function () {
|
|
5816
|
+
var hwba = swizzle(arguments);
|
|
5817
|
+
|
|
5818
|
+
var a = '';
|
|
5819
|
+
if (hwba.length >= 4 && hwba[3] !== 1) {
|
|
5820
|
+
a = ', ' + hwba[3];
|
|
5821
|
+
}
|
|
5822
|
+
|
|
5823
|
+
return 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';
|
|
5824
|
+
};
|
|
5825
|
+
|
|
5826
|
+
cs.to.keyword = function (rgb) {
|
|
5827
|
+
return reverseNames[rgb.slice(0, 3)];
|
|
5828
|
+
};
|
|
5829
|
+
|
|
5830
|
+
// helpers
|
|
5831
|
+
function clamp(num, min, max) {
|
|
5832
|
+
return Math.min(Math.max(min, num), max);
|
|
5833
|
+
}
|
|
5834
|
+
|
|
5835
|
+
function hexDouble(num) {
|
|
5836
|
+
var str = Math.round(num).toString(16).toUpperCase();
|
|
5837
|
+
return (str.length < 2) ? '0' + str : str;
|
|
5838
|
+
}
|
|
5839
|
+
|
|
5840
|
+
|
|
5841
|
+
/***/ }),
|
|
5842
|
+
|
|
5843
|
+
/***/ 8107:
|
|
5844
|
+
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5845
|
+
|
|
5846
|
+
"use strict";
|
|
5847
|
+
|
|
5848
|
+
|
|
5849
|
+
var color = __nccwpck_require__(1696)
|
|
5850
|
+
, hex = __nccwpck_require__(5143);
|
|
5851
|
+
|
|
5852
|
+
/**
|
|
5853
|
+
* Generate a color for a given name. But be reasonably smart about it by
|
|
5854
|
+
* understanding name spaces and coloring each namespace a bit lighter so they
|
|
5855
|
+
* still have the same base color as the root.
|
|
5856
|
+
*
|
|
5857
|
+
* @param {string} namespace The namespace
|
|
5858
|
+
* @param {string} [delimiter] The delimiter
|
|
5859
|
+
* @returns {string} color
|
|
5860
|
+
*/
|
|
5861
|
+
module.exports = function colorspace(namespace, delimiter) {
|
|
5862
|
+
var split = namespace.split(delimiter || ':');
|
|
5863
|
+
var base = hex(split[0]);
|
|
5864
|
+
|
|
5865
|
+
if (!split.length) return base;
|
|
5866
|
+
|
|
5867
|
+
for (var i = 0, l = split.length - 1; i < l; i++) {
|
|
5868
|
+
base = color(base)
|
|
5869
|
+
.mix(color(hex(split[i + 1])))
|
|
5870
|
+
.saturate(1)
|
|
5871
|
+
.hex();
|
|
5872
|
+
}
|
|
5873
|
+
|
|
5874
|
+
return base;
|
|
5875
|
+
};
|
|
5876
|
+
|
|
5877
|
+
|
|
5878
|
+
/***/ }),
|
|
5879
|
+
|
|
5880
|
+
/***/ 4618:
|
|
5433
5881
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
5434
5882
|
|
|
5435
5883
|
/* MIT license */
|
|
5436
|
-
var cssKeywords = __nccwpck_require__(
|
|
5884
|
+
var cssKeywords = __nccwpck_require__(8402);
|
|
5437
5885
|
|
|
5438
5886
|
// NOTE: conversions should only return primitive values (i.e. arrays, or
|
|
5439
5887
|
// values that give correct `typeof` results).
|
|
@@ -6304,11 +6752,11 @@ convert.rgb.gray = function (rgb) {
|
|
|
6304
6752
|
|
|
6305
6753
|
/***/ }),
|
|
6306
6754
|
|
|
6307
|
-
/***/
|
|
6755
|
+
/***/ 192:
|
|
6308
6756
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
6309
6757
|
|
|
6310
|
-
var conversions = __nccwpck_require__(
|
|
6311
|
-
var route = __nccwpck_require__(
|
|
6758
|
+
var conversions = __nccwpck_require__(4618);
|
|
6759
|
+
var route = __nccwpck_require__(209);
|
|
6312
6760
|
|
|
6313
6761
|
var convert = {};
|
|
6314
6762
|
|
|
@@ -6389,170 +6837,10 @@ module.exports = convert;
|
|
|
6389
6837
|
|
|
6390
6838
|
/***/ }),
|
|
6391
6839
|
|
|
6392
|
-
/***/
|
|
6393
|
-
/***/ ((module) => {
|
|
6394
|
-
|
|
6395
|
-
"use strict";
|
|
6396
|
-
|
|
6397
|
-
|
|
6398
|
-
module.exports = {
|
|
6399
|
-
"aliceblue": [240, 248, 255],
|
|
6400
|
-
"antiquewhite": [250, 235, 215],
|
|
6401
|
-
"aqua": [0, 255, 255],
|
|
6402
|
-
"aquamarine": [127, 255, 212],
|
|
6403
|
-
"azure": [240, 255, 255],
|
|
6404
|
-
"beige": [245, 245, 220],
|
|
6405
|
-
"bisque": [255, 228, 196],
|
|
6406
|
-
"black": [0, 0, 0],
|
|
6407
|
-
"blanchedalmond": [255, 235, 205],
|
|
6408
|
-
"blue": [0, 0, 255],
|
|
6409
|
-
"blueviolet": [138, 43, 226],
|
|
6410
|
-
"brown": [165, 42, 42],
|
|
6411
|
-
"burlywood": [222, 184, 135],
|
|
6412
|
-
"cadetblue": [95, 158, 160],
|
|
6413
|
-
"chartreuse": [127, 255, 0],
|
|
6414
|
-
"chocolate": [210, 105, 30],
|
|
6415
|
-
"coral": [255, 127, 80],
|
|
6416
|
-
"cornflowerblue": [100, 149, 237],
|
|
6417
|
-
"cornsilk": [255, 248, 220],
|
|
6418
|
-
"crimson": [220, 20, 60],
|
|
6419
|
-
"cyan": [0, 255, 255],
|
|
6420
|
-
"darkblue": [0, 0, 139],
|
|
6421
|
-
"darkcyan": [0, 139, 139],
|
|
6422
|
-
"darkgoldenrod": [184, 134, 11],
|
|
6423
|
-
"darkgray": [169, 169, 169],
|
|
6424
|
-
"darkgreen": [0, 100, 0],
|
|
6425
|
-
"darkgrey": [169, 169, 169],
|
|
6426
|
-
"darkkhaki": [189, 183, 107],
|
|
6427
|
-
"darkmagenta": [139, 0, 139],
|
|
6428
|
-
"darkolivegreen": [85, 107, 47],
|
|
6429
|
-
"darkorange": [255, 140, 0],
|
|
6430
|
-
"darkorchid": [153, 50, 204],
|
|
6431
|
-
"darkred": [139, 0, 0],
|
|
6432
|
-
"darksalmon": [233, 150, 122],
|
|
6433
|
-
"darkseagreen": [143, 188, 143],
|
|
6434
|
-
"darkslateblue": [72, 61, 139],
|
|
6435
|
-
"darkslategray": [47, 79, 79],
|
|
6436
|
-
"darkslategrey": [47, 79, 79],
|
|
6437
|
-
"darkturquoise": [0, 206, 209],
|
|
6438
|
-
"darkviolet": [148, 0, 211],
|
|
6439
|
-
"deeppink": [255, 20, 147],
|
|
6440
|
-
"deepskyblue": [0, 191, 255],
|
|
6441
|
-
"dimgray": [105, 105, 105],
|
|
6442
|
-
"dimgrey": [105, 105, 105],
|
|
6443
|
-
"dodgerblue": [30, 144, 255],
|
|
6444
|
-
"firebrick": [178, 34, 34],
|
|
6445
|
-
"floralwhite": [255, 250, 240],
|
|
6446
|
-
"forestgreen": [34, 139, 34],
|
|
6447
|
-
"fuchsia": [255, 0, 255],
|
|
6448
|
-
"gainsboro": [220, 220, 220],
|
|
6449
|
-
"ghostwhite": [248, 248, 255],
|
|
6450
|
-
"gold": [255, 215, 0],
|
|
6451
|
-
"goldenrod": [218, 165, 32],
|
|
6452
|
-
"gray": [128, 128, 128],
|
|
6453
|
-
"green": [0, 128, 0],
|
|
6454
|
-
"greenyellow": [173, 255, 47],
|
|
6455
|
-
"grey": [128, 128, 128],
|
|
6456
|
-
"honeydew": [240, 255, 240],
|
|
6457
|
-
"hotpink": [255, 105, 180],
|
|
6458
|
-
"indianred": [205, 92, 92],
|
|
6459
|
-
"indigo": [75, 0, 130],
|
|
6460
|
-
"ivory": [255, 255, 240],
|
|
6461
|
-
"khaki": [240, 230, 140],
|
|
6462
|
-
"lavender": [230, 230, 250],
|
|
6463
|
-
"lavenderblush": [255, 240, 245],
|
|
6464
|
-
"lawngreen": [124, 252, 0],
|
|
6465
|
-
"lemonchiffon": [255, 250, 205],
|
|
6466
|
-
"lightblue": [173, 216, 230],
|
|
6467
|
-
"lightcoral": [240, 128, 128],
|
|
6468
|
-
"lightcyan": [224, 255, 255],
|
|
6469
|
-
"lightgoldenrodyellow": [250, 250, 210],
|
|
6470
|
-
"lightgray": [211, 211, 211],
|
|
6471
|
-
"lightgreen": [144, 238, 144],
|
|
6472
|
-
"lightgrey": [211, 211, 211],
|
|
6473
|
-
"lightpink": [255, 182, 193],
|
|
6474
|
-
"lightsalmon": [255, 160, 122],
|
|
6475
|
-
"lightseagreen": [32, 178, 170],
|
|
6476
|
-
"lightskyblue": [135, 206, 250],
|
|
6477
|
-
"lightslategray": [119, 136, 153],
|
|
6478
|
-
"lightslategrey": [119, 136, 153],
|
|
6479
|
-
"lightsteelblue": [176, 196, 222],
|
|
6480
|
-
"lightyellow": [255, 255, 224],
|
|
6481
|
-
"lime": [0, 255, 0],
|
|
6482
|
-
"limegreen": [50, 205, 50],
|
|
6483
|
-
"linen": [250, 240, 230],
|
|
6484
|
-
"magenta": [255, 0, 255],
|
|
6485
|
-
"maroon": [128, 0, 0],
|
|
6486
|
-
"mediumaquamarine": [102, 205, 170],
|
|
6487
|
-
"mediumblue": [0, 0, 205],
|
|
6488
|
-
"mediumorchid": [186, 85, 211],
|
|
6489
|
-
"mediumpurple": [147, 112, 219],
|
|
6490
|
-
"mediumseagreen": [60, 179, 113],
|
|
6491
|
-
"mediumslateblue": [123, 104, 238],
|
|
6492
|
-
"mediumspringgreen": [0, 250, 154],
|
|
6493
|
-
"mediumturquoise": [72, 209, 204],
|
|
6494
|
-
"mediumvioletred": [199, 21, 133],
|
|
6495
|
-
"midnightblue": [25, 25, 112],
|
|
6496
|
-
"mintcream": [245, 255, 250],
|
|
6497
|
-
"mistyrose": [255, 228, 225],
|
|
6498
|
-
"moccasin": [255, 228, 181],
|
|
6499
|
-
"navajowhite": [255, 222, 173],
|
|
6500
|
-
"navy": [0, 0, 128],
|
|
6501
|
-
"oldlace": [253, 245, 230],
|
|
6502
|
-
"olive": [128, 128, 0],
|
|
6503
|
-
"olivedrab": [107, 142, 35],
|
|
6504
|
-
"orange": [255, 165, 0],
|
|
6505
|
-
"orangered": [255, 69, 0],
|
|
6506
|
-
"orchid": [218, 112, 214],
|
|
6507
|
-
"palegoldenrod": [238, 232, 170],
|
|
6508
|
-
"palegreen": [152, 251, 152],
|
|
6509
|
-
"paleturquoise": [175, 238, 238],
|
|
6510
|
-
"palevioletred": [219, 112, 147],
|
|
6511
|
-
"papayawhip": [255, 239, 213],
|
|
6512
|
-
"peachpuff": [255, 218, 185],
|
|
6513
|
-
"peru": [205, 133, 63],
|
|
6514
|
-
"pink": [255, 192, 203],
|
|
6515
|
-
"plum": [221, 160, 221],
|
|
6516
|
-
"powderblue": [176, 224, 230],
|
|
6517
|
-
"purple": [128, 0, 128],
|
|
6518
|
-
"rebeccapurple": [102, 51, 153],
|
|
6519
|
-
"red": [255, 0, 0],
|
|
6520
|
-
"rosybrown": [188, 143, 143],
|
|
6521
|
-
"royalblue": [65, 105, 225],
|
|
6522
|
-
"saddlebrown": [139, 69, 19],
|
|
6523
|
-
"salmon": [250, 128, 114],
|
|
6524
|
-
"sandybrown": [244, 164, 96],
|
|
6525
|
-
"seagreen": [46, 139, 87],
|
|
6526
|
-
"seashell": [255, 245, 238],
|
|
6527
|
-
"sienna": [160, 82, 45],
|
|
6528
|
-
"silver": [192, 192, 192],
|
|
6529
|
-
"skyblue": [135, 206, 235],
|
|
6530
|
-
"slateblue": [106, 90, 205],
|
|
6531
|
-
"slategray": [112, 128, 144],
|
|
6532
|
-
"slategrey": [112, 128, 144],
|
|
6533
|
-
"snow": [255, 250, 250],
|
|
6534
|
-
"springgreen": [0, 255, 127],
|
|
6535
|
-
"steelblue": [70, 130, 180],
|
|
6536
|
-
"tan": [210, 180, 140],
|
|
6537
|
-
"teal": [0, 128, 128],
|
|
6538
|
-
"thistle": [216, 191, 216],
|
|
6539
|
-
"tomato": [255, 99, 71],
|
|
6540
|
-
"turquoise": [64, 224, 208],
|
|
6541
|
-
"violet": [238, 130, 238],
|
|
6542
|
-
"wheat": [245, 222, 179],
|
|
6543
|
-
"white": [255, 255, 255],
|
|
6544
|
-
"whitesmoke": [245, 245, 245],
|
|
6545
|
-
"yellow": [255, 255, 0],
|
|
6546
|
-
"yellowgreen": [154, 205, 50]
|
|
6547
|
-
};
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
/***/ }),
|
|
6551
|
-
|
|
6552
|
-
/***/ 4200:
|
|
6840
|
+
/***/ 209:
|
|
6553
6841
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
6554
6842
|
|
|
6555
|
-
var conversions = __nccwpck_require__(
|
|
6843
|
+
var conversions = __nccwpck_require__(4618);
|
|
6556
6844
|
|
|
6557
6845
|
/*
|
|
6558
6846
|
this function routes a model to all other models.
|
|
@@ -6653,7 +6941,7 @@ module.exports = function (fromModel) {
|
|
|
6653
6941
|
|
|
6654
6942
|
/***/ }),
|
|
6655
6943
|
|
|
6656
|
-
/***/
|
|
6944
|
+
/***/ 8402:
|
|
6657
6945
|
/***/ ((module) => {
|
|
6658
6946
|
|
|
6659
6947
|
"use strict";
|
|
@@ -6811,292 +7099,6 @@ module.exports = {
|
|
|
6811
7099
|
};
|
|
6812
7100
|
|
|
6813
7101
|
|
|
6814
|
-
/***/ }),
|
|
6815
|
-
|
|
6816
|
-
/***/ 9407:
|
|
6817
|
-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
6818
|
-
|
|
6819
|
-
/* MIT license */
|
|
6820
|
-
var colorNames = __nccwpck_require__(4953);
|
|
6821
|
-
var swizzle = __nccwpck_require__(4421);
|
|
6822
|
-
var hasOwnProperty = Object.hasOwnProperty;
|
|
6823
|
-
|
|
6824
|
-
var reverseNames = Object.create(null);
|
|
6825
|
-
|
|
6826
|
-
// create a list of reverse color names
|
|
6827
|
-
for (var name in colorNames) {
|
|
6828
|
-
if (hasOwnProperty.call(colorNames, name)) {
|
|
6829
|
-
reverseNames[colorNames[name]] = name;
|
|
6830
|
-
}
|
|
6831
|
-
}
|
|
6832
|
-
|
|
6833
|
-
var cs = module.exports = {
|
|
6834
|
-
to: {},
|
|
6835
|
-
get: {}
|
|
6836
|
-
};
|
|
6837
|
-
|
|
6838
|
-
cs.get = function (string) {
|
|
6839
|
-
var prefix = string.substring(0, 3).toLowerCase();
|
|
6840
|
-
var val;
|
|
6841
|
-
var model;
|
|
6842
|
-
switch (prefix) {
|
|
6843
|
-
case 'hsl':
|
|
6844
|
-
val = cs.get.hsl(string);
|
|
6845
|
-
model = 'hsl';
|
|
6846
|
-
break;
|
|
6847
|
-
case 'hwb':
|
|
6848
|
-
val = cs.get.hwb(string);
|
|
6849
|
-
model = 'hwb';
|
|
6850
|
-
break;
|
|
6851
|
-
default:
|
|
6852
|
-
val = cs.get.rgb(string);
|
|
6853
|
-
model = 'rgb';
|
|
6854
|
-
break;
|
|
6855
|
-
}
|
|
6856
|
-
|
|
6857
|
-
if (!val) {
|
|
6858
|
-
return null;
|
|
6859
|
-
}
|
|
6860
|
-
|
|
6861
|
-
return {model: model, value: val};
|
|
6862
|
-
};
|
|
6863
|
-
|
|
6864
|
-
cs.get.rgb = function (string) {
|
|
6865
|
-
if (!string) {
|
|
6866
|
-
return null;
|
|
6867
|
-
}
|
|
6868
|
-
|
|
6869
|
-
var abbr = /^#([a-f0-9]{3,4})$/i;
|
|
6870
|
-
var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
|
|
6871
|
-
var rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
|
|
6872
|
-
var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
|
|
6873
|
-
var keyword = /^(\w+)$/;
|
|
6874
|
-
|
|
6875
|
-
var rgb = [0, 0, 0, 1];
|
|
6876
|
-
var match;
|
|
6877
|
-
var i;
|
|
6878
|
-
var hexAlpha;
|
|
6879
|
-
|
|
6880
|
-
if (match = string.match(hex)) {
|
|
6881
|
-
hexAlpha = match[2];
|
|
6882
|
-
match = match[1];
|
|
6883
|
-
|
|
6884
|
-
for (i = 0; i < 3; i++) {
|
|
6885
|
-
// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19
|
|
6886
|
-
var i2 = i * 2;
|
|
6887
|
-
rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
|
|
6888
|
-
}
|
|
6889
|
-
|
|
6890
|
-
if (hexAlpha) {
|
|
6891
|
-
rgb[3] = parseInt(hexAlpha, 16) / 255;
|
|
6892
|
-
}
|
|
6893
|
-
} else if (match = string.match(abbr)) {
|
|
6894
|
-
match = match[1];
|
|
6895
|
-
hexAlpha = match[3];
|
|
6896
|
-
|
|
6897
|
-
for (i = 0; i < 3; i++) {
|
|
6898
|
-
rgb[i] = parseInt(match[i] + match[i], 16);
|
|
6899
|
-
}
|
|
6900
|
-
|
|
6901
|
-
if (hexAlpha) {
|
|
6902
|
-
rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
|
|
6903
|
-
}
|
|
6904
|
-
} else if (match = string.match(rgba)) {
|
|
6905
|
-
for (i = 0; i < 3; i++) {
|
|
6906
|
-
rgb[i] = parseInt(match[i + 1], 0);
|
|
6907
|
-
}
|
|
6908
|
-
|
|
6909
|
-
if (match[4]) {
|
|
6910
|
-
if (match[5]) {
|
|
6911
|
-
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
6912
|
-
} else {
|
|
6913
|
-
rgb[3] = parseFloat(match[4]);
|
|
6914
|
-
}
|
|
6915
|
-
}
|
|
6916
|
-
} else if (match = string.match(per)) {
|
|
6917
|
-
for (i = 0; i < 3; i++) {
|
|
6918
|
-
rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
|
|
6919
|
-
}
|
|
6920
|
-
|
|
6921
|
-
if (match[4]) {
|
|
6922
|
-
if (match[5]) {
|
|
6923
|
-
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
6924
|
-
} else {
|
|
6925
|
-
rgb[3] = parseFloat(match[4]);
|
|
6926
|
-
}
|
|
6927
|
-
}
|
|
6928
|
-
} else if (match = string.match(keyword)) {
|
|
6929
|
-
if (match[1] === 'transparent') {
|
|
6930
|
-
return [0, 0, 0, 0];
|
|
6931
|
-
}
|
|
6932
|
-
|
|
6933
|
-
if (!hasOwnProperty.call(colorNames, match[1])) {
|
|
6934
|
-
return null;
|
|
6935
|
-
}
|
|
6936
|
-
|
|
6937
|
-
rgb = colorNames[match[1]];
|
|
6938
|
-
rgb[3] = 1;
|
|
6939
|
-
|
|
6940
|
-
return rgb;
|
|
6941
|
-
} else {
|
|
6942
|
-
return null;
|
|
6943
|
-
}
|
|
6944
|
-
|
|
6945
|
-
for (i = 0; i < 3; i++) {
|
|
6946
|
-
rgb[i] = clamp(rgb[i], 0, 255);
|
|
6947
|
-
}
|
|
6948
|
-
rgb[3] = clamp(rgb[3], 0, 1);
|
|
6949
|
-
|
|
6950
|
-
return rgb;
|
|
6951
|
-
};
|
|
6952
|
-
|
|
6953
|
-
cs.get.hsl = function (string) {
|
|
6954
|
-
if (!string) {
|
|
6955
|
-
return null;
|
|
6956
|
-
}
|
|
6957
|
-
|
|
6958
|
-
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*)?\)$/;
|
|
6959
|
-
var match = string.match(hsl);
|
|
6960
|
-
|
|
6961
|
-
if (match) {
|
|
6962
|
-
var alpha = parseFloat(match[4]);
|
|
6963
|
-
var h = ((parseFloat(match[1]) % 360) + 360) % 360;
|
|
6964
|
-
var s = clamp(parseFloat(match[2]), 0, 100);
|
|
6965
|
-
var l = clamp(parseFloat(match[3]), 0, 100);
|
|
6966
|
-
var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
6967
|
-
|
|
6968
|
-
return [h, s, l, a];
|
|
6969
|
-
}
|
|
6970
|
-
|
|
6971
|
-
return null;
|
|
6972
|
-
};
|
|
6973
|
-
|
|
6974
|
-
cs.get.hwb = function (string) {
|
|
6975
|
-
if (!string) {
|
|
6976
|
-
return null;
|
|
6977
|
-
}
|
|
6978
|
-
|
|
6979
|
-
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*)?\)$/;
|
|
6980
|
-
var match = string.match(hwb);
|
|
6981
|
-
|
|
6982
|
-
if (match) {
|
|
6983
|
-
var alpha = parseFloat(match[4]);
|
|
6984
|
-
var h = ((parseFloat(match[1]) % 360) + 360) % 360;
|
|
6985
|
-
var w = clamp(parseFloat(match[2]), 0, 100);
|
|
6986
|
-
var b = clamp(parseFloat(match[3]), 0, 100);
|
|
6987
|
-
var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
6988
|
-
return [h, w, b, a];
|
|
6989
|
-
}
|
|
6990
|
-
|
|
6991
|
-
return null;
|
|
6992
|
-
};
|
|
6993
|
-
|
|
6994
|
-
cs.to.hex = function () {
|
|
6995
|
-
var rgba = swizzle(arguments);
|
|
6996
|
-
|
|
6997
|
-
return (
|
|
6998
|
-
'#' +
|
|
6999
|
-
hexDouble(rgba[0]) +
|
|
7000
|
-
hexDouble(rgba[1]) +
|
|
7001
|
-
hexDouble(rgba[2]) +
|
|
7002
|
-
(rgba[3] < 1
|
|
7003
|
-
? (hexDouble(Math.round(rgba[3] * 255)))
|
|
7004
|
-
: '')
|
|
7005
|
-
);
|
|
7006
|
-
};
|
|
7007
|
-
|
|
7008
|
-
cs.to.rgb = function () {
|
|
7009
|
-
var rgba = swizzle(arguments);
|
|
7010
|
-
|
|
7011
|
-
return rgba.length < 4 || rgba[3] === 1
|
|
7012
|
-
? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'
|
|
7013
|
-
: 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';
|
|
7014
|
-
};
|
|
7015
|
-
|
|
7016
|
-
cs.to.rgb.percent = function () {
|
|
7017
|
-
var rgba = swizzle(arguments);
|
|
7018
|
-
|
|
7019
|
-
var r = Math.round(rgba[0] / 255 * 100);
|
|
7020
|
-
var g = Math.round(rgba[1] / 255 * 100);
|
|
7021
|
-
var b = Math.round(rgba[2] / 255 * 100);
|
|
7022
|
-
|
|
7023
|
-
return rgba.length < 4 || rgba[3] === 1
|
|
7024
|
-
? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'
|
|
7025
|
-
: 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';
|
|
7026
|
-
};
|
|
7027
|
-
|
|
7028
|
-
cs.to.hsl = function () {
|
|
7029
|
-
var hsla = swizzle(arguments);
|
|
7030
|
-
return hsla.length < 4 || hsla[3] === 1
|
|
7031
|
-
? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'
|
|
7032
|
-
: 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';
|
|
7033
|
-
};
|
|
7034
|
-
|
|
7035
|
-
// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
|
|
7036
|
-
// (hwb have alpha optional & 1 is default value)
|
|
7037
|
-
cs.to.hwb = function () {
|
|
7038
|
-
var hwba = swizzle(arguments);
|
|
7039
|
-
|
|
7040
|
-
var a = '';
|
|
7041
|
-
if (hwba.length >= 4 && hwba[3] !== 1) {
|
|
7042
|
-
a = ', ' + hwba[3];
|
|
7043
|
-
}
|
|
7044
|
-
|
|
7045
|
-
return 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';
|
|
7046
|
-
};
|
|
7047
|
-
|
|
7048
|
-
cs.to.keyword = function (rgb) {
|
|
7049
|
-
return reverseNames[rgb.slice(0, 3)];
|
|
7050
|
-
};
|
|
7051
|
-
|
|
7052
|
-
// helpers
|
|
7053
|
-
function clamp(num, min, max) {
|
|
7054
|
-
return Math.min(Math.max(min, num), max);
|
|
7055
|
-
}
|
|
7056
|
-
|
|
7057
|
-
function hexDouble(num) {
|
|
7058
|
-
var str = Math.round(num).toString(16).toUpperCase();
|
|
7059
|
-
return (str.length < 2) ? '0' + str : str;
|
|
7060
|
-
}
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
/***/ }),
|
|
7064
|
-
|
|
7065
|
-
/***/ 8107:
|
|
7066
|
-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
7067
|
-
|
|
7068
|
-
"use strict";
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
var color = __nccwpck_require__(1696)
|
|
7072
|
-
, hex = __nccwpck_require__(5143);
|
|
7073
|
-
|
|
7074
|
-
/**
|
|
7075
|
-
* Generate a color for a given name. But be reasonably smart about it by
|
|
7076
|
-
* understanding name spaces and coloring each namespace a bit lighter so they
|
|
7077
|
-
* still have the same base color as the root.
|
|
7078
|
-
*
|
|
7079
|
-
* @param {string} namespace The namespace
|
|
7080
|
-
* @param {string} [delimiter] The delimiter
|
|
7081
|
-
* @returns {string} color
|
|
7082
|
-
*/
|
|
7083
|
-
module.exports = function colorspace(namespace, delimiter) {
|
|
7084
|
-
var split = namespace.split(delimiter || ':');
|
|
7085
|
-
var base = hex(split[0]);
|
|
7086
|
-
|
|
7087
|
-
if (!split.length) return base;
|
|
7088
|
-
|
|
7089
|
-
for (var i = 0, l = split.length - 1; i < l; i++) {
|
|
7090
|
-
base = color(base)
|
|
7091
|
-
.mix(color(hex(split[i + 1])))
|
|
7092
|
-
.saturate(1)
|
|
7093
|
-
.hex();
|
|
7094
|
-
}
|
|
7095
|
-
|
|
7096
|
-
return base;
|
|
7097
|
-
};
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
7102
|
/***/ }),
|
|
7101
7103
|
|
|
7102
7104
|
/***/ 1696:
|
|
@@ -7106,7 +7108,7 @@ module.exports = function colorspace(namespace, delimiter) {
|
|
|
7106
7108
|
|
|
7107
7109
|
|
|
7108
7110
|
var colorString = __nccwpck_require__(9407);
|
|
7109
|
-
var convert = __nccwpck_require__(
|
|
7111
|
+
var convert = __nccwpck_require__(192);
|
|
7110
7112
|
|
|
7111
7113
|
var _slice = [].slice;
|
|
7112
7114
|
|
|
@@ -38946,7 +38948,7 @@ module.exports = require("zlib");
|
|
|
38946
38948
|
/***/ ((module) => {
|
|
38947
38949
|
|
|
38948
38950
|
"use strict";
|
|
38949
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.16.51","description":"","main":"lib/index.js","files":["lib"],"scripts":{"lint":"eslint tests lib --ignore-pattern \'tests/assets/*\'","lint:fix":"eslint --fix tests lib","test":"node tools/jest.js","test:disk":"
|
|
38951
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@abtnode/core","publishConfig":{"access":"public"},"version":"1.16.51","description":"","main":"lib/index.js","files":["lib"],"scripts":{"lint":"eslint tests lib --ignore-pattern \'tests/assets/*\'","lint:fix":"eslint --fix tests lib","test":"node tools/jest.js","test:disk":"CI=true npm run test tests/blocklet/manager/disk.spec.js","coverage":"npm run test -- --coverage"},"keywords":[],"author":"wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)","license":"Apache-2.0","dependencies":{"@abtnode/analytics":"1.16.51","@abtnode/auth":"1.16.51","@abtnode/certificate-manager":"1.16.51","@abtnode/constant":"1.16.51","@abtnode/cron":"1.16.51","@abtnode/db-cache":"1.16.51","@abtnode/docker-utils":"1.16.51","@abtnode/logger":"1.16.51","@abtnode/models":"1.16.51","@abtnode/queue":"1.16.51","@abtnode/rbac":"1.16.51","@abtnode/router-provider":"1.16.51","@abtnode/static-server":"1.16.51","@abtnode/timemachine":"1.16.51","@abtnode/util":"1.16.51","@aigne/aigne-hub":"^0.10.0","@arcblock/did":"1.25.6","@arcblock/did-connect-js":"1.25.6","@arcblock/did-ext":"1.25.6","@arcblock/did-motif":"^1.1.14","@arcblock/did-util":"1.25.6","@arcblock/event-hub":"1.25.6","@arcblock/jwt":"1.25.6","@arcblock/pm2-events":"^0.0.5","@arcblock/validator":"1.25.6","@arcblock/vc":"1.25.6","@blocklet/constant":"1.16.51","@blocklet/did-space-js":"^1.1.29","@blocklet/env":"1.16.51","@blocklet/error":"^0.2.5","@blocklet/meta":"1.16.51","@blocklet/resolver":"1.16.51","@blocklet/sdk":"1.16.51","@blocklet/server-js":"1.16.51","@blocklet/store":"1.16.51","@blocklet/theme":"^3.1.45","@fidm/x509":"^1.2.1","@ocap/mcrypto":"1.25.6","@ocap/util":"1.25.6","@ocap/wallet":"1.25.6","@slack/webhook":"^5.0.4","archiver":"^7.0.1","axios":"^1.7.9","axon":"^2.0.3","chalk":"^4.1.2","cross-spawn":"^7.0.3","dayjs":"^1.11.13","deep-diff":"^1.0.2","detect-port":"^1.5.1","envfile":"^7.1.0","escape-string-regexp":"^4.0.0","fast-glob":"^3.3.2","filesize":"^10.1.1","flat":"^5.0.2","fs-extra":"^11.2.0","get-port":"^5.1.1","hasha":"^5.2.2","is-base64":"^1.1.0","is-cidr":"4","is-ip":"3","is-url":"^1.2.4","joi":"17.12.2","joi-extension-semver":"^5.0.0","js-yaml":"^4.1.0","kill-port":"^2.0.1","lodash":"^4.17.21","node-stream-zip":"^1.15.0","p-all":"^3.0.0","p-limit":"^3.1.0","p-map":"^4.0.0","p-retry":"^4.6.2","p-wait-for":"^3.2.0","private-ip":"^2.3.4","rate-limiter-flexible":"^5.0.5","read-last-lines":"^1.8.0","semver":"^7.6.3","sequelize":"^6.35.0","shelljs":"^0.8.5","slugify":"^1.6.6","ssri":"^8.0.1","stream-throttle":"^0.1.3","stream-to-promise":"^3.0.0","systeminformation":"^5.23.3","tail":"^2.2.4","tar":"^6.1.11","transliteration":"^2.3.5","ua-parser-js":"^1.0.2","ufo":"^1.5.3","uuid":"^11.1.0","valid-url":"^1.0.9","which":"^2.0.2","xbytes":"^1.8.0"},"devDependencies":{"expand-tilde":"^2.0.2","express":"^4.18.2","jest":"^29.7.0","unzipper":"^0.10.11"},"gitHead":"e5764f753181ed6a7c615cd4fc6682aacf0cb7cd"}');
|
|
38950
38952
|
|
|
38951
38953
|
/***/ }),
|
|
38952
38954
|
|