@keycloakify/svelte 0.0.1-rc.1 → 0.0.1-rc.2

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