@tellaro/tql 1.3.8 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/index.js +44 -41
  2. package/dist/node_modules/@kurkle/color/dist/color.esm.js +442 -0
  3. package/dist/node_modules/chart.js/dist/chart.js +6149 -0
  4. package/dist/node_modules/chart.js/dist/chunks/helpers.dataset.js +1685 -0
  5. package/dist/node_modules/chartjs-adapter-luxon/dist/chartjs-adapter-luxon.esm.js +56 -0
  6. package/dist/node_modules/chartjs-plugin-annotation/dist/chartjs-plugin-annotation.esm.js +1655 -0
  7. package/dist/node_modules/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.esm.js +607 -0
  8. package/dist/node_modules/luxon/build/es6/luxon.js +5524 -0
  9. package/dist/src/builder.d.ts +62 -0
  10. package/dist/src/builder.js +56 -0
  11. package/dist/src/chart/colors.d.ts +23 -0
  12. package/dist/src/chart/colors.js +101 -0
  13. package/dist/src/chart/formatters.d.ts +17 -0
  14. package/dist/src/chart/formatters.js +49 -0
  15. package/dist/src/chart/index.d.ts +9 -0
  16. package/dist/src/chart/index.js +31 -0
  17. package/dist/src/chart/mappers.d.ts +849 -0
  18. package/dist/src/chart/mappers.js +613 -0
  19. package/dist/src/completionProvider.js +294 -165
  20. package/dist/src/index.d.ts +2 -1
  21. package/dist/src/parser.d.ts +10 -0
  22. package/dist/src/parser.js +41 -9
  23. package/dist/src/tokenizer.js +124 -103
  24. package/dist/src/types.d.ts +27 -3
  25. package/dist/src/validator.js +10 -9
  26. package/dist/tql.css +1 -1
  27. package/dist/vue/TqlChart.vue.d.ts +2 -0
  28. package/dist/vue/TqlChart.vue.js +7 -0
  29. package/dist/vue/TqlChart.vue2.js +212 -0
  30. package/dist/vue/index.d.ts +1 -0
  31. package/dist/vue/index.js +12 -10
  32. package/dist/vue/useTqlInput.js +80 -80
  33. package/package.json +39 -3
package/dist/index.js CHANGED
@@ -1,67 +1,70 @@
1
- import { AGGREGATION_FUNCTIONS as o, COLLECTION_OPERATORS as i, COMPARISON_OPERATORS as r, KEYWORDS as a, LOGICAL_OPERATORS as T, MUTATORS as l, NEGATION_SYMBOL_OPERATORS as g, SYMBOL_OPERATORS as n, TYPE_HINTS as s, TqlTokenizer as m, VISUALIZATION_TYPES as c, findPreviousToken as O, findTokenAtPosition as d, findTokenBefore as f, findTokensInRange as h, tokenizeTql as p, tokenizeTqlNoWhitespace as C } from "./src/tokenizer.js";
2
- import { TqlParser as A, formatParseError as R, getTqlErrors as P, isValidTql as x, parseTql as E } from "./src/parser.js";
3
- import { TqlValidator as y, formatValidationResult as I, getTqlIssues as L, isValidTqlSyntax as N, validateTql as z } from "./src/validator.js";
4
- import { getCompletionTriggerCharacters as u, getCompletions as M, getWordAtPosition as k, shouldTriggerCompletion as F } from "./src/completionProvider.js";
5
- import { findClosestMatch as G, fuzzyFilter as U, fuzzyMatch as V, highlightMatch as Y, levenshteinDistance as W } from "./src/fuzzyMatcher.js";
6
- import { SchemaCache as D, createSchemaCache as w, getCachedField as H, getCachedFieldNames as K, getCachedFieldType as Z, getSchemaCache as b } from "./src/schemaCache.js";
7
- import { ComplexityAnalyzer as J, analyzeComplexity as Q, getComplexityMetrics as X, getComplexityWarnings as $, isHighComplexity as ee } from "./src/complexityAnalyzer.js";
8
- import { SemanticPreview as oe, flattenLogicTree as ie, formatLogicTreeAscii as re, formatLogicTreeNode as ae, generatePreview as Te, getFieldUsage as le, getLogicTree as ge, getLogicTreeDepth as ne, getOperatorSummary as se, getUniqueFields as me } from "./src/semanticPreview.js";
1
+ import { AGGREGATION_FUNCTIONS as r, COLLECTION_OPERATORS as i, COMPARISON_OPERATORS as o, KEYWORDS as a, LOGICAL_OPERATORS as l, MUTATORS as T, NEGATION_SYMBOL_OPERATORS as n, SYMBOL_OPERATORS as g, TYPE_HINTS as s, TqlTokenizer as m, VISUALIZATION_TYPES as c, findPreviousToken as O, findTokenAtPosition as p, findTokenBefore as d, findTokensInRange as f, tokenizeTql as S, tokenizeTqlNoWhitespace as h } from "./src/tokenizer.js";
2
+ import { TqlParser as A, formatParseError as R, getTqlErrors as x, isValidTql as P, parseTql as y } from "./src/parser.js";
3
+ import { TqlValidator as q, formatValidationResult as I, getTqlIssues as L, isValidTqlSyntax as N, validateTql as u } from "./src/validator.js";
4
+ import { getCompletionTriggerCharacters as _, getCompletions as M, getWordAtPosition as k, shouldTriggerCompletion as F } from "./src/completionProvider.js";
5
+ import { findClosestMatch as v, fuzzyFilter as G, fuzzyMatch as U, highlightMatch as Y, levenshteinDistance as W } from "./src/fuzzyMatcher.js";
6
+ import { SchemaCache as D, createSchemaCache as H, getCachedField as w, getCachedFieldNames as b, getCachedFieldType as K, getSchemaCache as Q } from "./src/schemaCache.js";
7
+ import { ComplexityAnalyzer as j, analyzeComplexity as J, getComplexityMetrics as X, getComplexityWarnings as $, isHighComplexity as ee } from "./src/complexityAnalyzer.js";
8
+ import { SemanticPreview as re, flattenLogicTree as ie, formatLogicTreeAscii as oe, formatLogicTreeNode as ae, generatePreview as le, getFieldUsage as Te, getLogicTree as ne, getLogicTreeDepth as ge, getOperatorSummary as se, getUniqueFields as me } from "./src/semanticPreview.js";
9
+ import { buildStatsQuery as Oe, parseVizHintString as pe } from "./src/builder.js";
9
10
  export {
10
- o as AGGREGATION_FUNCTIONS,
11
+ r as AGGREGATION_FUNCTIONS,
11
12
  i as COLLECTION_OPERATORS,
12
- r as COMPARISON_OPERATORS,
13
- J as ComplexityAnalyzer,
13
+ o as COMPARISON_OPERATORS,
14
+ j as ComplexityAnalyzer,
14
15
  a as KEYWORDS,
15
- T as LOGICAL_OPERATORS,
16
- l as MUTATORS,
17
- g as NEGATION_SYMBOL_OPERATORS,
18
- n as SYMBOL_OPERATORS,
16
+ l as LOGICAL_OPERATORS,
17
+ T as MUTATORS,
18
+ n as NEGATION_SYMBOL_OPERATORS,
19
+ g as SYMBOL_OPERATORS,
19
20
  D as SchemaCache,
20
- oe as SemanticPreview,
21
+ re as SemanticPreview,
21
22
  s as TYPE_HINTS,
22
23
  A as TqlParser,
23
24
  m as TqlTokenizer,
24
- y as TqlValidator,
25
+ q as TqlValidator,
25
26
  c as VISUALIZATION_TYPES,
26
- Q as analyzeComplexity,
27
- w as createSchemaCache,
28
- G as findClosestMatch,
27
+ J as analyzeComplexity,
28
+ Oe as buildStatsQuery,
29
+ H as createSchemaCache,
30
+ v as findClosestMatch,
29
31
  O as findPreviousToken,
30
- d as findTokenAtPosition,
31
- f as findTokenBefore,
32
- h as findTokensInRange,
32
+ p as findTokenAtPosition,
33
+ d as findTokenBefore,
34
+ f as findTokensInRange,
33
35
  ie as flattenLogicTree,
34
- re as formatLogicTreeAscii,
36
+ oe as formatLogicTreeAscii,
35
37
  ae as formatLogicTreeNode,
36
38
  R as formatParseError,
37
39
  I as formatValidationResult,
38
- U as fuzzyFilter,
39
- V as fuzzyMatch,
40
- Te as generatePreview,
41
- H as getCachedField,
42
- K as getCachedFieldNames,
43
- Z as getCachedFieldType,
44
- u as getCompletionTriggerCharacters,
40
+ G as fuzzyFilter,
41
+ U as fuzzyMatch,
42
+ le as generatePreview,
43
+ w as getCachedField,
44
+ b as getCachedFieldNames,
45
+ K as getCachedFieldType,
46
+ _ as getCompletionTriggerCharacters,
45
47
  M as getCompletions,
46
48
  X as getComplexityMetrics,
47
49
  $ as getComplexityWarnings,
48
- le as getFieldUsage,
49
- ge as getLogicTree,
50
- ne as getLogicTreeDepth,
50
+ Te as getFieldUsage,
51
+ ne as getLogicTree,
52
+ ge as getLogicTreeDepth,
51
53
  se as getOperatorSummary,
52
- b as getSchemaCache,
53
- P as getTqlErrors,
54
+ Q as getSchemaCache,
55
+ x as getTqlErrors,
54
56
  L as getTqlIssues,
55
57
  me as getUniqueFields,
56
58
  k as getWordAtPosition,
57
59
  Y as highlightMatch,
58
60
  ee as isHighComplexity,
59
- x as isValidTql,
61
+ P as isValidTql,
60
62
  N as isValidTqlSyntax,
61
63
  W as levenshteinDistance,
62
- E as parseTql,
64
+ y as parseTql,
65
+ pe as parseVizHintString,
63
66
  F as shouldTriggerCompletion,
64
- p as tokenizeTql,
65
- C as tokenizeTqlNoWhitespace,
66
- z as validateTql
67
+ S as tokenizeTql,
68
+ h as tokenizeTqlNoWhitespace,
69
+ u as validateTql
67
70
  };
@@ -0,0 +1,442 @@
1
+ function m(f) {
2
+ return f + 0.5 | 0;
3
+ }
4
+ const b = (f, e, t) => Math.max(Math.min(f, t), e);
5
+ function l(f) {
6
+ return b(m(f * 2.55), 0, 255);
7
+ }
8
+ function d(f) {
9
+ return b(m(f * 255), 0, 255);
10
+ }
11
+ function o(f) {
12
+ return b(m(f / 2.55) / 100, 0, 1);
13
+ }
14
+ function X(f) {
15
+ return b(m(f * 100), 0, 100);
16
+ }
17
+ const i = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15 }, w = [..."0123456789ABCDEF"], Z = (f) => w[f & 15], A = (f) => w[(f & 240) >> 4] + w[f & 15], y = (f) => (f & 240) >> 4 === (f & 15), U = (f) => y(f.r) && y(f.g) && y(f.b) && y(f.a);
18
+ function V(f) {
19
+ var e = f.length, t;
20
+ return f[0] === "#" && (e === 4 || e === 5 ? t = {
21
+ r: 255 & i[f[1]] * 17,
22
+ g: 255 & i[f[2]] * 17,
23
+ b: 255 & i[f[3]] * 17,
24
+ a: e === 5 ? i[f[4]] * 17 : 255
25
+ } : (e === 7 || e === 9) && (t = {
26
+ r: i[f[1]] << 4 | i[f[2]],
27
+ g: i[f[3]] << 4 | i[f[4]],
28
+ b: i[f[5]] << 4 | i[f[6]],
29
+ a: e === 9 ? i[f[7]] << 4 | i[f[8]] : 255
30
+ })), t;
31
+ }
32
+ const H = (f, e) => f < 255 ? e(f) : "";
33
+ function W(f) {
34
+ var e = U(f) ? Z : A;
35
+ return f ? "#" + e(f.r) + e(f.g) + e(f.b) + H(f.a, e) : void 0;
36
+ }
37
+ const q = /^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;
38
+ function $(f, e, t) {
39
+ const n = e * Math.min(t, 1 - t), r = (a, s = (a + f / 30) % 12) => t - n * Math.max(Math.min(s - 3, 9 - s, 1), -1);
40
+ return [r(0), r(8), r(4)];
41
+ }
42
+ function L(f, e, t) {
43
+ const n = (r, a = (r + f / 60) % 6) => t - t * e * Math.max(Math.min(a, 4 - a, 1), 0);
44
+ return [n(5), n(3), n(1)];
45
+ }
46
+ function j(f, e, t) {
47
+ const n = $(f, 1, 0.5);
48
+ let r;
49
+ for (e + t > 1 && (r = 1 / (e + t), e *= r, t *= r), r = 0; r < 3; r++)
50
+ n[r] *= 1 - e - t, n[r] += e;
51
+ return n;
52
+ }
53
+ function N(f, e, t, n, r) {
54
+ return f === r ? (e - t) / n + (e < t ? 6 : 0) : e === r ? (t - f) / n + 2 : (f - e) / n + 4;
55
+ }
56
+ function _(f) {
57
+ const t = f.r / 255, n = f.g / 255, r = f.b / 255, a = Math.max(t, n, r), s = Math.min(t, n, r), c = (a + s) / 2;
58
+ let g, h, x;
59
+ return a !== s && (x = a - s, h = c > 0.5 ? x / (2 - a - s) : x / (a + s), g = N(t, n, r, x, a), g = g * 60 + 0.5), [g | 0, h || 0, c];
60
+ }
61
+ function M(f, e, t, n) {
62
+ return (Array.isArray(e) ? f(e[0], e[1], e[2]) : f(e, t, n)).map(d);
63
+ }
64
+ function S(f, e, t) {
65
+ return M($, f, e, t);
66
+ }
67
+ function K(f, e, t) {
68
+ return M(j, f, e, t);
69
+ }
70
+ function B(f, e, t) {
71
+ return M(L, f, e, t);
72
+ }
73
+ function P(f) {
74
+ return (f % 360 + 360) % 360;
75
+ }
76
+ function Q(f) {
77
+ const e = q.exec(f);
78
+ let t = 255, n;
79
+ if (!e)
80
+ return;
81
+ e[5] !== n && (t = e[6] ? l(+e[5]) : d(+e[5]));
82
+ const r = P(+e[2]), a = +e[3] / 100, s = +e[4] / 100;
83
+ return e[1] === "hwb" ? n = K(r, a, s) : e[1] === "hsv" ? n = B(r, a, s) : n = S(r, a, s), {
84
+ r: n[0],
85
+ g: n[1],
86
+ b: n[2],
87
+ a: t
88
+ };
89
+ }
90
+ function C(f, e) {
91
+ var t = _(f);
92
+ t[0] = P(t[0] + e), t = S(t), f.r = t[0], f.g = t[1], f.b = t[2];
93
+ }
94
+ function D(f) {
95
+ if (!f)
96
+ return;
97
+ const e = _(f), t = e[0], n = X(e[1]), r = X(e[2]);
98
+ return f.a < 255 ? `hsla(${t}, ${n}%, ${r}%, ${o(f.a)})` : `hsl(${t}, ${n}%, ${r}%)`;
99
+ }
100
+ const O = {
101
+ x: "dark",
102
+ Z: "light",
103
+ Y: "re",
104
+ X: "blu",
105
+ W: "gr",
106
+ V: "medium",
107
+ U: "slate",
108
+ A: "ee",
109
+ T: "ol",
110
+ S: "or",
111
+ B: "ra",
112
+ C: "lateg",
113
+ D: "ights",
114
+ R: "in",
115
+ Q: "turquois",
116
+ E: "hi",
117
+ P: "ro",
118
+ O: "al",
119
+ N: "le",
120
+ M: "de",
121
+ L: "yello",
122
+ F: "en",
123
+ K: "ch",
124
+ G: "arks",
125
+ H: "ea",
126
+ I: "ightg",
127
+ J: "wh"
128
+ }, E = {
129
+ OiceXe: "f0f8ff",
130
+ antiquewEte: "faebd7",
131
+ aqua: "ffff",
132
+ aquamarRe: "7fffd4",
133
+ azuY: "f0ffff",
134
+ beige: "f5f5dc",
135
+ bisque: "ffe4c4",
136
+ black: "0",
137
+ blanKedOmond: "ffebcd",
138
+ Xe: "ff",
139
+ XeviTet: "8a2be2",
140
+ bPwn: "a52a2a",
141
+ burlywood: "deb887",
142
+ caMtXe: "5f9ea0",
143
+ KartYuse: "7fff00",
144
+ KocTate: "d2691e",
145
+ cSO: "ff7f50",
146
+ cSnflowerXe: "6495ed",
147
+ cSnsilk: "fff8dc",
148
+ crimson: "dc143c",
149
+ cyan: "ffff",
150
+ xXe: "8b",
151
+ xcyan: "8b8b",
152
+ xgTMnPd: "b8860b",
153
+ xWay: "a9a9a9",
154
+ xgYF: "6400",
155
+ xgYy: "a9a9a9",
156
+ xkhaki: "bdb76b",
157
+ xmagFta: "8b008b",
158
+ xTivegYF: "556b2f",
159
+ xSange: "ff8c00",
160
+ xScEd: "9932cc",
161
+ xYd: "8b0000",
162
+ xsOmon: "e9967a",
163
+ xsHgYF: "8fbc8f",
164
+ xUXe: "483d8b",
165
+ xUWay: "2f4f4f",
166
+ xUgYy: "2f4f4f",
167
+ xQe: "ced1",
168
+ xviTet: "9400d3",
169
+ dAppRk: "ff1493",
170
+ dApskyXe: "bfff",
171
+ dimWay: "696969",
172
+ dimgYy: "696969",
173
+ dodgerXe: "1e90ff",
174
+ fiYbrick: "b22222",
175
+ flSOwEte: "fffaf0",
176
+ foYstWAn: "228b22",
177
+ fuKsia: "ff00ff",
178
+ gaRsbSo: "dcdcdc",
179
+ ghostwEte: "f8f8ff",
180
+ gTd: "ffd700",
181
+ gTMnPd: "daa520",
182
+ Way: "808080",
183
+ gYF: "8000",
184
+ gYFLw: "adff2f",
185
+ gYy: "808080",
186
+ honeyMw: "f0fff0",
187
+ hotpRk: "ff69b4",
188
+ RdianYd: "cd5c5c",
189
+ Rdigo: "4b0082",
190
+ ivSy: "fffff0",
191
+ khaki: "f0e68c",
192
+ lavFMr: "e6e6fa",
193
+ lavFMrXsh: "fff0f5",
194
+ lawngYF: "7cfc00",
195
+ NmoncEffon: "fffacd",
196
+ ZXe: "add8e6",
197
+ ZcSO: "f08080",
198
+ Zcyan: "e0ffff",
199
+ ZgTMnPdLw: "fafad2",
200
+ ZWay: "d3d3d3",
201
+ ZgYF: "90ee90",
202
+ ZgYy: "d3d3d3",
203
+ ZpRk: "ffb6c1",
204
+ ZsOmon: "ffa07a",
205
+ ZsHgYF: "20b2aa",
206
+ ZskyXe: "87cefa",
207
+ ZUWay: "778899",
208
+ ZUgYy: "778899",
209
+ ZstAlXe: "b0c4de",
210
+ ZLw: "ffffe0",
211
+ lime: "ff00",
212
+ limegYF: "32cd32",
213
+ lRF: "faf0e6",
214
+ magFta: "ff00ff",
215
+ maPon: "800000",
216
+ VaquamarRe: "66cdaa",
217
+ VXe: "cd",
218
+ VScEd: "ba55d3",
219
+ VpurpN: "9370db",
220
+ VsHgYF: "3cb371",
221
+ VUXe: "7b68ee",
222
+ VsprRggYF: "fa9a",
223
+ VQe: "48d1cc",
224
+ VviTetYd: "c71585",
225
+ midnightXe: "191970",
226
+ mRtcYam: "f5fffa",
227
+ mistyPse: "ffe4e1",
228
+ moccasR: "ffe4b5",
229
+ navajowEte: "ffdead",
230
+ navy: "80",
231
+ Tdlace: "fdf5e6",
232
+ Tive: "808000",
233
+ TivedBb: "6b8e23",
234
+ Sange: "ffa500",
235
+ SangeYd: "ff4500",
236
+ ScEd: "da70d6",
237
+ pOegTMnPd: "eee8aa",
238
+ pOegYF: "98fb98",
239
+ pOeQe: "afeeee",
240
+ pOeviTetYd: "db7093",
241
+ papayawEp: "ffefd5",
242
+ pHKpuff: "ffdab9",
243
+ peru: "cd853f",
244
+ pRk: "ffc0cb",
245
+ plum: "dda0dd",
246
+ powMrXe: "b0e0e6",
247
+ purpN: "800080",
248
+ YbeccapurpN: "663399",
249
+ Yd: "ff0000",
250
+ Psybrown: "bc8f8f",
251
+ PyOXe: "4169e1",
252
+ saddNbPwn: "8b4513",
253
+ sOmon: "fa8072",
254
+ sandybPwn: "f4a460",
255
+ sHgYF: "2e8b57",
256
+ sHshell: "fff5ee",
257
+ siFna: "a0522d",
258
+ silver: "c0c0c0",
259
+ skyXe: "87ceeb",
260
+ UXe: "6a5acd",
261
+ UWay: "708090",
262
+ UgYy: "708090",
263
+ snow: "fffafa",
264
+ sprRggYF: "ff7f",
265
+ stAlXe: "4682b4",
266
+ tan: "d2b48c",
267
+ teO: "8080",
268
+ tEstN: "d8bfd8",
269
+ tomato: "ff6347",
270
+ Qe: "40e0d0",
271
+ viTet: "ee82ee",
272
+ JHt: "f5deb3",
273
+ wEte: "ffffff",
274
+ wEtesmoke: "f5f5f5",
275
+ Lw: "ffff00",
276
+ LwgYF: "9acd32"
277
+ };
278
+ function v() {
279
+ const f = {}, e = Object.keys(E), t = Object.keys(O);
280
+ let n, r, a, s, c;
281
+ for (n = 0; n < e.length; n++) {
282
+ for (s = c = e[n], r = 0; r < t.length; r++)
283
+ a = t[r], c = c.replace(a, O[a]);
284
+ a = parseInt(E[s], 16), f[c] = [a >> 16 & 255, a >> 8 & 255, a & 255];
285
+ }
286
+ return f;
287
+ }
288
+ let F;
289
+ function G(f) {
290
+ F || (F = v(), F.transparent = [0, 0, 0, 0]);
291
+ const e = F[f.toLowerCase()];
292
+ return e && {
293
+ r: e[0],
294
+ g: e[1],
295
+ b: e[2],
296
+ a: e.length === 4 ? e[3] : 255
297
+ };
298
+ }
299
+ const I = /^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;
300
+ function J(f) {
301
+ const e = I.exec(f);
302
+ let t = 255, n, r, a;
303
+ if (e) {
304
+ if (e[7] !== n) {
305
+ const s = +e[7];
306
+ t = e[8] ? l(s) : b(s * 255, 0, 255);
307
+ }
308
+ return n = +e[1], r = +e[3], a = +e[5], n = 255 & (e[2] ? l(n) : b(n, 0, 255)), r = 255 & (e[4] ? l(r) : b(r, 0, 255)), a = 255 & (e[6] ? l(a) : b(a, 0, 255)), {
309
+ r: n,
310
+ g: r,
311
+ b: a,
312
+ a: t
313
+ };
314
+ }
315
+ }
316
+ function z(f) {
317
+ return f && (f.a < 255 ? `rgba(${f.r}, ${f.g}, ${f.b}, ${o(f.a)})` : `rgb(${f.r}, ${f.g}, ${f.b})`);
318
+ }
319
+ const Y = (f) => f <= 31308e-7 ? f * 12.92 : Math.pow(f, 1 / 2.4) * 1.055 - 0.055, u = (f) => f <= 0.04045 ? f / 12.92 : Math.pow((f + 0.055) / 1.055, 2.4);
320
+ function ee(f, e, t) {
321
+ const n = u(o(f.r)), r = u(o(f.g)), a = u(o(f.b));
322
+ return {
323
+ r: d(Y(n + t * (u(o(e.r)) - n))),
324
+ g: d(Y(r + t * (u(o(e.g)) - r))),
325
+ b: d(Y(a + t * (u(o(e.b)) - a))),
326
+ a: f.a + t * (e.a - f.a)
327
+ };
328
+ }
329
+ function p(f, e, t) {
330
+ if (f) {
331
+ let n = _(f);
332
+ n[e] = Math.max(0, Math.min(n[e] + n[e] * t, e === 0 ? 360 : 1)), n = S(n), f.r = n[0], f.g = n[1], f.b = n[2];
333
+ }
334
+ }
335
+ function T(f, e) {
336
+ return f && Object.assign(e || {}, f);
337
+ }
338
+ function R(f) {
339
+ var e = { r: 0, g: 0, b: 0, a: 255 };
340
+ return Array.isArray(f) ? f.length >= 3 && (e = { r: f[0], g: f[1], b: f[2], a: 255 }, f.length > 3 && (e.a = d(f[3]))) : (e = T(f, { r: 0, g: 0, b: 0, a: 1 }), e.a = d(e.a)), e;
341
+ }
342
+ function fe(f) {
343
+ return f.charAt(0) === "r" ? J(f) : Q(f);
344
+ }
345
+ class k {
346
+ constructor(e) {
347
+ if (e instanceof k)
348
+ return e;
349
+ const t = typeof e;
350
+ let n;
351
+ t === "object" ? n = R(e) : t === "string" && (n = V(e) || G(e) || fe(e)), this._rgb = n, this._valid = !!n;
352
+ }
353
+ get valid() {
354
+ return this._valid;
355
+ }
356
+ get rgb() {
357
+ var e = T(this._rgb);
358
+ return e && (e.a = o(e.a)), e;
359
+ }
360
+ set rgb(e) {
361
+ this._rgb = R(e);
362
+ }
363
+ rgbString() {
364
+ return this._valid ? z(this._rgb) : void 0;
365
+ }
366
+ hexString() {
367
+ return this._valid ? W(this._rgb) : void 0;
368
+ }
369
+ hslString() {
370
+ return this._valid ? D(this._rgb) : void 0;
371
+ }
372
+ mix(e, t) {
373
+ if (e) {
374
+ const n = this.rgb, r = e.rgb;
375
+ let a;
376
+ const s = t === a ? 0.5 : t, c = 2 * s - 1, g = n.a - r.a, h = ((c * g === -1 ? c : (c + g) / (1 + c * g)) + 1) / 2;
377
+ a = 1 - h, n.r = 255 & h * n.r + a * r.r + 0.5, n.g = 255 & h * n.g + a * r.g + 0.5, n.b = 255 & h * n.b + a * r.b + 0.5, n.a = s * n.a + (1 - s) * r.a, this.rgb = n;
378
+ }
379
+ return this;
380
+ }
381
+ interpolate(e, t) {
382
+ return e && (this._rgb = ee(this._rgb, e._rgb, t)), this;
383
+ }
384
+ clone() {
385
+ return new k(this.rgb);
386
+ }
387
+ alpha(e) {
388
+ return this._rgb.a = d(e), this;
389
+ }
390
+ clearer(e) {
391
+ const t = this._rgb;
392
+ return t.a *= 1 - e, this;
393
+ }
394
+ greyscale() {
395
+ const e = this._rgb, t = m(e.r * 0.3 + e.g * 0.59 + e.b * 0.11);
396
+ return e.r = e.g = e.b = t, this;
397
+ }
398
+ opaquer(e) {
399
+ const t = this._rgb;
400
+ return t.a *= 1 + e, this;
401
+ }
402
+ negate() {
403
+ const e = this._rgb;
404
+ return e.r = 255 - e.r, e.g = 255 - e.g, e.b = 255 - e.b, this;
405
+ }
406
+ lighten(e) {
407
+ return p(this._rgb, 2, e), this;
408
+ }
409
+ darken(e) {
410
+ return p(this._rgb, 2, -e), this;
411
+ }
412
+ saturate(e) {
413
+ return p(this._rgb, 1, e), this;
414
+ }
415
+ desaturate(e) {
416
+ return p(this._rgb, 1, -e), this;
417
+ }
418
+ rotate(e) {
419
+ return C(this._rgb, e), this;
420
+ }
421
+ }
422
+ export {
423
+ k as Color,
424
+ o as b2n,
425
+ V as hexParse,
426
+ W as hexString,
427
+ S as hsl2rgb,
428
+ D as hslString,
429
+ B as hsv2rgb,
430
+ Q as hueParse,
431
+ K as hwb2rgb,
432
+ b as lim,
433
+ d as n2b,
434
+ X as n2p,
435
+ G as nameParse,
436
+ l as p2b,
437
+ _ as rgb2hsl,
438
+ J as rgbParse,
439
+ z as rgbString,
440
+ C as rotate,
441
+ m as round
442
+ };