@mkbabb/value.js 0.2.0 → 0.3.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.
- package/dist/value.cjs +8 -8
- package/dist/value.d.ts +132 -0
- package/dist/value.js +1510 -1132
- package/package.json +1 -1
package/dist/value.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
3
|
-
return
|
|
1
|
+
const he = 16.666666666666668, Jn = (e) => !!e && e.constructor === Object;
|
|
2
|
+
function tt(e) {
|
|
3
|
+
return Jn(e) ? Object.entries(e).map(([t, n]) => [t, tt(n)]).reduce((t, [n, r]) => (t[n] = r, t), {}) : e != null && typeof e.clone == "function" ? e.clone() : Array.isArray(e) ? e.map(tt) : e;
|
|
4
4
|
}
|
|
5
|
-
const
|
|
5
|
+
const Ji = (e, t) => {
|
|
6
6
|
if (!e || !t || e.length !== t.length)
|
|
7
7
|
return !1;
|
|
8
8
|
for (let n = 0; n < e.length; n++)
|
|
@@ -10,10 +10,10 @@ const vs = (e, t) => {
|
|
|
10
10
|
return !1;
|
|
11
11
|
return !0;
|
|
12
12
|
};
|
|
13
|
-
async function
|
|
13
|
+
async function Qi(e) {
|
|
14
14
|
return await new Promise((t) => setTimeout(t, e));
|
|
15
15
|
}
|
|
16
|
-
async function
|
|
16
|
+
async function ta(e, t = he) {
|
|
17
17
|
return await new Promise((n) => {
|
|
18
18
|
const r = setInterval(() => {
|
|
19
19
|
if (e())
|
|
@@ -21,7 +21,7 @@ async function Bs(e, t = ee) {
|
|
|
21
21
|
}, t);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function ea(e, t = 100, n = !1) {
|
|
25
25
|
let r = null;
|
|
26
26
|
const o = function(...s) {
|
|
27
27
|
const i = this, a = function() {
|
|
@@ -33,11 +33,11 @@ function Es(e, t = 100, n = !1) {
|
|
|
33
33
|
r && (clearTimeout(r), r = null);
|
|
34
34
|
}, o;
|
|
35
35
|
}
|
|
36
|
-
async function
|
|
36
|
+
async function na(e, t) {
|
|
37
37
|
const n = new TextEncoder().encode(t), r = await crypto.subtle.digest(e, n);
|
|
38
38
|
return Array.from(new Uint8Array(r)).map((s) => s.toString(16).padStart(2, "0")).join("");
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function Xt(e, t = {}) {
|
|
41
41
|
const n = /* @__PURE__ */ new Map(), { maxCacheSize: r = 1 / 0, ttl: o = 1 / 0, keyFn: s = JSON.stringify } = t, i = function(...a) {
|
|
42
42
|
const c = s.apply(this, a), l = Date.now();
|
|
43
43
|
if (n.has(c)) {
|
|
@@ -46,42 +46,42 @@ function _t(e, t = {}) {
|
|
|
46
46
|
return u.value;
|
|
47
47
|
n.delete(c);
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
if (n.set(c, { value:
|
|
49
|
+
const p = e.apply(this, a);
|
|
50
|
+
if (n.set(c, { value: p, timestamp: l }), n.size > r) {
|
|
51
51
|
const u = n.keys().next().value;
|
|
52
52
|
n.delete(u);
|
|
53
53
|
}
|
|
54
|
-
return
|
|
54
|
+
return p;
|
|
55
55
|
};
|
|
56
56
|
return i.cache = n, i;
|
|
57
57
|
}
|
|
58
|
-
const
|
|
58
|
+
const ra = (e) => e.replace(
|
|
59
59
|
/([-_][a-z])/gi,
|
|
60
60
|
(t) => t.toUpperCase().replace("-", "").replace("_", "")
|
|
61
61
|
);
|
|
62
|
-
function
|
|
62
|
+
function oa(e) {
|
|
63
63
|
return e.replace(/([A-Z])/g, (t) => `-${t[0].toLowerCase()}`);
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function sa(e, t, n) {
|
|
66
66
|
for (let r = e - 1; r >= 0; r--)
|
|
67
67
|
if (n(t[r]))
|
|
68
68
|
return r;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function ia(e) {
|
|
71
71
|
if (typeof window < "u" && window.requestAnimationFrame)
|
|
72
72
|
return window.requestAnimationFrame(e);
|
|
73
|
-
let t =
|
|
73
|
+
let t = he, n = Date.now();
|
|
74
74
|
return setTimeout(() => {
|
|
75
75
|
let r = Date.now(), o = r - n;
|
|
76
|
-
n = r, t = Math.max(0,
|
|
76
|
+
n = r, t = Math.max(0, he - o), e(r);
|
|
77
77
|
}, t);
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function aa(e) {
|
|
80
80
|
if (typeof window < "u" && window.cancelAnimationFrame)
|
|
81
81
|
return window.cancelAnimationFrame(e);
|
|
82
82
|
clearTimeout(e);
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const Qn = ["px", "cm", "mm", "Q", "in", "pc", "pt"], tr = [
|
|
85
85
|
"em",
|
|
86
86
|
"ex",
|
|
87
87
|
"ch",
|
|
@@ -100,21 +100,21 @@ const an = ["px", "cm", "mm", "Q", "in", "pc", "pt"], cn = [
|
|
|
100
100
|
"lvh",
|
|
101
101
|
"dvw",
|
|
102
102
|
"dvh"
|
|
103
|
-
],
|
|
104
|
-
...
|
|
105
|
-
...
|
|
106
|
-
],
|
|
107
|
-
...
|
|
108
|
-
...
|
|
109
|
-
...
|
|
110
|
-
...
|
|
111
|
-
...
|
|
112
|
-
...
|
|
113
|
-
...
|
|
114
|
-
...
|
|
103
|
+
], Pt = [
|
|
104
|
+
...Qn,
|
|
105
|
+
...tr
|
|
106
|
+
], Ot = ["s", "ms"], Lt = ["deg", "rad", "grad", "turn"], er = ["%"], zt = ["dpi", "dpcm", "dppx", "cqw"], fe = ["var", "calc"], oo = ["string"], so = ["color"], ca = [
|
|
107
|
+
...Pt,
|
|
108
|
+
...Ot,
|
|
109
|
+
...Lt,
|
|
110
|
+
...er,
|
|
111
|
+
...zt,
|
|
112
|
+
...fe,
|
|
113
|
+
...oo,
|
|
114
|
+
...so,
|
|
115
115
|
"",
|
|
116
116
|
void 0
|
|
117
|
-
],
|
|
117
|
+
], io = ["string", "var", "calc"], ao = [
|
|
118
118
|
"accentColor",
|
|
119
119
|
"additiveSymbols",
|
|
120
120
|
"alignContent",
|
|
@@ -746,8 +746,8 @@ const an = ["px", "cm", "mm", "Q", "in", "pc", "pt"], cn = [
|
|
|
746
746
|
"y",
|
|
747
747
|
"zIndex",
|
|
748
748
|
"zoom"
|
|
749
|
-
],
|
|
750
|
-
let
|
|
749
|
+
], ln = (e, t = 2) => typeof e == "number" && Number.isNaN(e) ? "none" : String(e?.toFixed?.(t) ?? e).trim().replace(/\.0+$/, ""), un = (e, t, n) => `${e}(${t.join(" ")} / ${n})`;
|
|
750
|
+
let V = class {
|
|
751
751
|
constructor(t, n = 1) {
|
|
752
752
|
this.colorSpace = t, this.alpha = n, this.components = /* @__PURE__ */ new Map();
|
|
753
753
|
}
|
|
@@ -756,13 +756,13 @@ let U = class {
|
|
|
756
756
|
const t = Array.from(this.components.values()).map(
|
|
757
757
|
(r) => typeof r == "number" && Number.isNaN(r) ? "none" : r
|
|
758
758
|
), n = typeof this.alpha == "number" && Number.isNaN(this.alpha) ? "none" : this.alpha;
|
|
759
|
-
return
|
|
759
|
+
return un(this.colorSpace, t, n);
|
|
760
760
|
}
|
|
761
761
|
toFormattedString(t = 2) {
|
|
762
762
|
const n = Array.from(this.components.values()).map(
|
|
763
|
-
(o) =>
|
|
764
|
-
), r =
|
|
765
|
-
return
|
|
763
|
+
(o) => ln(o, t)
|
|
764
|
+
), r = ln(this.alpha, t);
|
|
765
|
+
return un(this.colorSpace, n, r);
|
|
766
766
|
}
|
|
767
767
|
valueOf() {
|
|
768
768
|
return [...this.values(), this.alpha];
|
|
@@ -775,8 +775,8 @@ let U = class {
|
|
|
775
775
|
}
|
|
776
776
|
clone() {
|
|
777
777
|
const t = this.constructor, n = new t();
|
|
778
|
-
return n.alpha =
|
|
779
|
-
n.components.set(o,
|
|
778
|
+
return n.alpha = tt(this.alpha), this.components.forEach((r, o) => {
|
|
779
|
+
n.components.set(o, tt(r));
|
|
780
780
|
}), n;
|
|
781
781
|
}
|
|
782
782
|
keys() {
|
|
@@ -795,12 +795,12 @@ let U = class {
|
|
|
795
795
|
this.components.set(t, n);
|
|
796
796
|
}
|
|
797
797
|
};
|
|
798
|
-
class
|
|
798
|
+
class xe extends V {
|
|
799
799
|
constructor(t, n, r) {
|
|
800
800
|
super(t, n), this.whitePoint = r;
|
|
801
801
|
}
|
|
802
802
|
}
|
|
803
|
-
class
|
|
803
|
+
class O extends V {
|
|
804
804
|
constructor(t, n, r, o) {
|
|
805
805
|
super("rgb", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
806
806
|
}
|
|
@@ -823,7 +823,7 @@ class $ extends U {
|
|
|
823
823
|
this.setComponent("b", t);
|
|
824
824
|
}
|
|
825
825
|
}
|
|
826
|
-
class
|
|
826
|
+
class yt extends V {
|
|
827
827
|
constructor(t, n, r, o) {
|
|
828
828
|
super("hsl", o), this.components.set("h", t), this.components.set("s", n), this.components.set("l", r);
|
|
829
829
|
}
|
|
@@ -846,7 +846,7 @@ class St extends U {
|
|
|
846
846
|
this.setComponent("l", t);
|
|
847
847
|
}
|
|
848
848
|
}
|
|
849
|
-
class
|
|
849
|
+
class Te extends V {
|
|
850
850
|
constructor(t, n, r, o) {
|
|
851
851
|
super("hsv", o), this.components.set("h", t), this.components.set("s", n), this.components.set("v", r);
|
|
852
852
|
}
|
|
@@ -869,7 +869,7 @@ class pe extends U {
|
|
|
869
869
|
this.setComponent("v", t);
|
|
870
870
|
}
|
|
871
871
|
}
|
|
872
|
-
class
|
|
872
|
+
class Ee extends V {
|
|
873
873
|
constructor(t, n, r, o) {
|
|
874
874
|
super("hwb", o), this.components.set("h", t), this.components.set("w", n), this.components.set("b", r);
|
|
875
875
|
}
|
|
@@ -892,7 +892,7 @@ class he extends U {
|
|
|
892
892
|
this.setComponent("b", t);
|
|
893
893
|
}
|
|
894
894
|
}
|
|
895
|
-
class
|
|
895
|
+
class Wt extends xe {
|
|
896
896
|
constructor(t, n, r, o) {
|
|
897
897
|
super("lab", o, "D50"), this.components.set("l", t), this.components.set("a", n), this.components.set("b", r);
|
|
898
898
|
}
|
|
@@ -915,7 +915,7 @@ class Lt extends me {
|
|
|
915
915
|
this.setComponent("b", t);
|
|
916
916
|
}
|
|
917
917
|
}
|
|
918
|
-
class
|
|
918
|
+
class Ae extends V {
|
|
919
919
|
constructor(t, n, r, o) {
|
|
920
920
|
super("lch", o), this.components.set("l", t), this.components.set("c", n), this.components.set("h", r);
|
|
921
921
|
}
|
|
@@ -938,7 +938,7 @@ class fe extends U {
|
|
|
938
938
|
this.setComponent("h", t);
|
|
939
939
|
}
|
|
940
940
|
}
|
|
941
|
-
class
|
|
941
|
+
class Ht extends xe {
|
|
942
942
|
constructor(t, n, r, o) {
|
|
943
943
|
super("oklab", o, "D50"), this.components.set("l", t), this.components.set("a", n), this.components.set("b", r);
|
|
944
944
|
}
|
|
@@ -961,7 +961,7 @@ class $t extends me {
|
|
|
961
961
|
this.setComponent("b", t);
|
|
962
962
|
}
|
|
963
963
|
}
|
|
964
|
-
class
|
|
964
|
+
class Me extends V {
|
|
965
965
|
constructor(t, n, r, o) {
|
|
966
966
|
super("oklch", o), this.components.set("l", t), this.components.set("c", n), this.components.set("h", r);
|
|
967
967
|
}
|
|
@@ -984,7 +984,7 @@ class be extends U {
|
|
|
984
984
|
this.setComponent("h", t);
|
|
985
985
|
}
|
|
986
986
|
}
|
|
987
|
-
class
|
|
987
|
+
class U extends xe {
|
|
988
988
|
constructor(t, n, r, o) {
|
|
989
989
|
super("xyz", o, "D65"), this.components.set("x", t), this.components.set("y", n), this.components.set("z", r);
|
|
990
990
|
}
|
|
@@ -1007,7 +1007,7 @@ class D extends me {
|
|
|
1007
1007
|
this.setComponent("z", t);
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
|
-
class
|
|
1010
|
+
class nr extends V {
|
|
1011
1011
|
constructor(t, n) {
|
|
1012
1012
|
super("kelvin", n), this.components.set("kelvin", t);
|
|
1013
1013
|
}
|
|
@@ -1018,7 +1018,7 @@ class un extends U {
|
|
|
1018
1018
|
this.setComponent("kelvin", t);
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
1021
|
-
class
|
|
1021
|
+
class Ie extends V {
|
|
1022
1022
|
constructor(t, n, r, o) {
|
|
1023
1023
|
super("srgb-linear", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
1024
1024
|
}
|
|
@@ -1041,7 +1041,7 @@ class de extends U {
|
|
|
1041
1041
|
this.setComponent("b", t);
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
|
-
class
|
|
1044
|
+
class Re extends V {
|
|
1045
1045
|
constructor(t, n, r, o) {
|
|
1046
1046
|
super("display-p3", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
1047
1047
|
}
|
|
@@ -1064,7 +1064,7 @@ class ge extends U {
|
|
|
1064
1064
|
this.setComponent("b", t);
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
|
-
class
|
|
1067
|
+
class ve extends V {
|
|
1068
1068
|
constructor(t, n, r, o) {
|
|
1069
1069
|
super("a98-rgb", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
1070
1070
|
}
|
|
@@ -1087,7 +1087,7 @@ class we extends U {
|
|
|
1087
1087
|
this.setComponent("b", t);
|
|
1088
1088
|
}
|
|
1089
1089
|
}
|
|
1090
|
-
class
|
|
1090
|
+
class Be extends V {
|
|
1091
1091
|
constructor(t, n, r, o) {
|
|
1092
1092
|
super("prophoto-rgb", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
1093
1093
|
}
|
|
@@ -1110,7 +1110,7 @@ class ke extends U {
|
|
|
1110
1110
|
this.setComponent("b", t);
|
|
1111
1111
|
}
|
|
1112
1112
|
}
|
|
1113
|
-
class
|
|
1113
|
+
class Ne extends V {
|
|
1114
1114
|
constructor(t, n, r, o) {
|
|
1115
1115
|
super("rec2020", o), this.components.set("r", t), this.components.set("g", n), this.components.set("b", r);
|
|
1116
1116
|
}
|
|
@@ -1133,19 +1133,19 @@ class ye extends U {
|
|
|
1133
1133
|
this.setComponent("b", t);
|
|
1134
1134
|
}
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1136
|
+
function be(e) {
|
|
1137
1137
|
return e.unit === "color";
|
|
1138
1138
|
}
|
|
1139
|
-
const
|
|
1139
|
+
const ua = (e) => {
|
|
1140
1140
|
const t = {}, n = (r, o = void 0) => {
|
|
1141
1141
|
if (Array.isArray(r)) {
|
|
1142
1142
|
r.forEach((i, a) => n(i, o));
|
|
1143
1143
|
return;
|
|
1144
|
-
} else if (r instanceof
|
|
1144
|
+
} else if (r instanceof mt) {
|
|
1145
1145
|
let i = r.name;
|
|
1146
1146
|
o && (o.endsWith(r.name) ? i = o : i = `${o}.${r.name}`), r.values.forEach((a, c) => n(a, i));
|
|
1147
1147
|
return;
|
|
1148
|
-
} else if (
|
|
1148
|
+
} else if (Jn(r)) {
|
|
1149
1149
|
for (const [i, a] of Object.entries(r)) {
|
|
1150
1150
|
const c = o ? `${o}.${i}` : i;
|
|
1151
1151
|
n(a, c);
|
|
@@ -1153,10 +1153,10 @@ const Ls = (e) => {
|
|
|
1153
1153
|
return;
|
|
1154
1154
|
}
|
|
1155
1155
|
const s = o;
|
|
1156
|
-
t[s] == null && (t[s] = new
|
|
1156
|
+
t[s] == null && (t[s] = new vt()), t[s].push(r), t[s] = t[s].flat();
|
|
1157
1157
|
};
|
|
1158
1158
|
return n(e), t;
|
|
1159
|
-
},
|
|
1159
|
+
}, pa = (e) => {
|
|
1160
1160
|
const t = {};
|
|
1161
1161
|
for (const [n, r] of Object.entries(e)) {
|
|
1162
1162
|
const o = n.split(".");
|
|
@@ -1167,22 +1167,22 @@ const Ls = (e) => {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
}
|
|
1169
1169
|
return t;
|
|
1170
|
-
},
|
|
1170
|
+
}, ma = (e) => {
|
|
1171
1171
|
const t = {};
|
|
1172
1172
|
for (const [n, r] of Object.entries(e)) {
|
|
1173
1173
|
const o = n.split("."), s = o[0];
|
|
1174
1174
|
let i = t[s] ?? "", a = "", c = "";
|
|
1175
|
-
for (let
|
|
1176
|
-
a += `${o[
|
|
1175
|
+
for (let p = 1; p < o.length; p++)
|
|
1176
|
+
a += `${o[p]}(`, c += ")";
|
|
1177
1177
|
let l = "";
|
|
1178
1178
|
o.length > 1 && Array.isArray(r) ? l = r.join(", ") : l = r.toString(), i += ` ${a}${l}${c}`, t[s] = i.trim();
|
|
1179
1179
|
}
|
|
1180
1180
|
return t;
|
|
1181
|
-
},
|
|
1182
|
-
function
|
|
1183
|
-
return
|
|
1181
|
+
}, co = new Set(ao);
|
|
1182
|
+
function ha(e) {
|
|
1183
|
+
return co.has(e);
|
|
1184
1184
|
}
|
|
1185
|
-
const
|
|
1185
|
+
const lo = (e) => {
|
|
1186
1186
|
const t = e.name, n = e.valueOf();
|
|
1187
1187
|
if (!e.name.startsWith("matrix"))
|
|
1188
1188
|
throw new Error("Input must be a matrix or matrix3d value");
|
|
@@ -1253,11 +1253,11 @@ const mr = (e) => {
|
|
|
1253
1253
|
}
|
|
1254
1254
|
throw new Error("Unsupported matrix type or invalid number of values");
|
|
1255
1255
|
};
|
|
1256
|
-
function
|
|
1256
|
+
function uo(e, t) {
|
|
1257
1257
|
let n = e;
|
|
1258
1258
|
return t === "cm" ? n *= 96 / 2.54 : t === "mm" ? n *= 96 / 25.4 : t === "in" ? n *= 96 : t === "pt" ? n *= 4 / 3 : t === "pc" && (n *= 16), n;
|
|
1259
1259
|
}
|
|
1260
|
-
function
|
|
1260
|
+
function rr(e, t, n, r) {
|
|
1261
1261
|
if (t === "em" && n)
|
|
1262
1262
|
e *= parseFloat(getComputedStyle(n).fontSize);
|
|
1263
1263
|
else if (t === "rem")
|
|
@@ -1275,35 +1275,35 @@ function mn(e, t, n, r) {
|
|
|
1275
1275
|
getComputedStyle(n.parentElement).getPropertyValue(r)
|
|
1276
1276
|
);
|
|
1277
1277
|
e = e / 100 * o;
|
|
1278
|
-
} else t === "ex" || t === "ch" ? e *= parseFloat(getComputedStyle(n).fontSize) ?? 16 : e =
|
|
1278
|
+
} else t === "ex" || t === "ch" ? e *= parseFloat(getComputedStyle(n).fontSize) ?? 16 : e = uo(e, t);
|
|
1279
1279
|
return e;
|
|
1280
1280
|
}
|
|
1281
|
-
function
|
|
1281
|
+
function or(e, t) {
|
|
1282
1282
|
return t === "s" && (e *= 1e3), e;
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1284
|
+
function _e(e, t) {
|
|
1285
1285
|
return t === "grad" ? e *= 0.9 : t === "rad" ? e *= 180 / Math.PI : t === "turn" && (e *= 360), e;
|
|
1286
1286
|
}
|
|
1287
|
-
function
|
|
1287
|
+
function sr(e, t) {
|
|
1288
1288
|
return t === "dpcm" ? e *= 2.54 : t === "dppx" && (e *= 96), e;
|
|
1289
1289
|
}
|
|
1290
|
-
const
|
|
1291
|
-
length:
|
|
1292
|
-
time:
|
|
1293
|
-
angle:
|
|
1294
|
-
resolution:
|
|
1290
|
+
const po = {
|
|
1291
|
+
length: rr,
|
|
1292
|
+
time: or,
|
|
1293
|
+
angle: _e,
|
|
1294
|
+
resolution: sr
|
|
1295
1295
|
};
|
|
1296
|
-
function
|
|
1297
|
-
return
|
|
1296
|
+
function pn(e) {
|
|
1297
|
+
return Pt.includes(e) ? [Pt, "length"] : Ot.includes(e) ? [Ot, "time"] : Lt.includes(e) ? [Lt, "angle"] : zt.includes(e) ? [zt, "resolution"] : null;
|
|
1298
1298
|
}
|
|
1299
|
-
function
|
|
1300
|
-
const o =
|
|
1299
|
+
function fa(e, t, n, r) {
|
|
1300
|
+
const o = pn(t), s = pn(n);
|
|
1301
1301
|
if (!o || !s || o[1] !== s[1])
|
|
1302
1302
|
throw new Error(`Incompatible units: ${t} and ${n}`);
|
|
1303
|
-
const [, i] = o, a =
|
|
1303
|
+
const [, i] = o, a = po[i], c = a(e, t, r), l = a(1, n, r);
|
|
1304
1304
|
return c / l;
|
|
1305
1305
|
}
|
|
1306
|
-
class
|
|
1306
|
+
class S {
|
|
1307
1307
|
constructor(t, n, r, o, s, i) {
|
|
1308
1308
|
this.value = t, this.unit = n, this.superType = r, this.subProperty = o, this.property = s, this.targets = i;
|
|
1309
1309
|
}
|
|
@@ -1323,36 +1323,36 @@ class k {
|
|
|
1323
1323
|
this.value = t;
|
|
1324
1324
|
}
|
|
1325
1325
|
toString() {
|
|
1326
|
-
return this.value == null ? "" : this.unit == null || this.unit === "string" ? `${this.value}` :
|
|
1326
|
+
return this.value == null ? "" : this.unit == null || this.unit === "string" ? `${this.value}` : be(this) ? this.value.toString() : this.unit === "var" ? `var(${this.value})` : this.unit === "calc" ? `calc(${this.value})` : `${this.value}${this.unit}`;
|
|
1327
1327
|
}
|
|
1328
1328
|
toJSON() {
|
|
1329
1329
|
return this.valueOf();
|
|
1330
1330
|
}
|
|
1331
1331
|
toFixed(t = 2) {
|
|
1332
1332
|
const n = Number(this.value).toFixed(t).replace(/\.0+$/, "");
|
|
1333
|
-
return new
|
|
1333
|
+
return new S(n).coalesce(this, !0).toString();
|
|
1334
1334
|
}
|
|
1335
1335
|
clone() {
|
|
1336
|
-
return new
|
|
1337
|
-
|
|
1336
|
+
return new S(
|
|
1337
|
+
tt(this.value),
|
|
1338
1338
|
this.unit,
|
|
1339
|
-
|
|
1339
|
+
tt(this.superType),
|
|
1340
1340
|
this.subProperty,
|
|
1341
1341
|
this.property
|
|
1342
1342
|
);
|
|
1343
1343
|
}
|
|
1344
1344
|
coalesce(t, n = !1) {
|
|
1345
|
-
return t == null ? this :
|
|
1346
|
-
|
|
1345
|
+
return t == null ? this : io.includes(this.unit) ? this : n ? (this.unit ??= t.unit, this.superType ??= t.superType, this.subProperty ??= t.subProperty, this.property ??= t.property, this.targets ??= t.targets, this) : new S(
|
|
1346
|
+
tt(this.value),
|
|
1347
1347
|
this.unit ?? t.unit,
|
|
1348
|
-
|
|
1348
|
+
tt(this.superType ?? t.superType),
|
|
1349
1349
|
this.subProperty ?? t.subProperty,
|
|
1350
1350
|
this.property ?? t.property,
|
|
1351
1351
|
this.targets ?? t.targets
|
|
1352
1352
|
);
|
|
1353
1353
|
}
|
|
1354
1354
|
}
|
|
1355
|
-
class
|
|
1355
|
+
class mt {
|
|
1356
1356
|
constructor(t, n) {
|
|
1357
1357
|
this.name = t, this.values = n, n.forEach((r) => {
|
|
1358
1358
|
this.setSubProperty(t);
|
|
@@ -1382,13 +1382,13 @@ class at {
|
|
|
1382
1382
|
};
|
|
1383
1383
|
}
|
|
1384
1384
|
clone() {
|
|
1385
|
-
return new
|
|
1385
|
+
return new mt(
|
|
1386
1386
|
this.name,
|
|
1387
1387
|
this.values.map((t) => t.clone())
|
|
1388
1388
|
);
|
|
1389
1389
|
}
|
|
1390
1390
|
}
|
|
1391
|
-
class
|
|
1391
|
+
class vt extends Array {
|
|
1392
1392
|
constructor(...t) {
|
|
1393
1393
|
super(...t);
|
|
1394
1394
|
}
|
|
@@ -1414,28 +1414,28 @@ class xt extends Array {
|
|
|
1414
1414
|
return this.map((t) => t.toJSON());
|
|
1415
1415
|
}
|
|
1416
1416
|
clone() {
|
|
1417
|
-
return new
|
|
1417
|
+
return new vt(...this.map((t) => t.clone()));
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
|
-
const
|
|
1421
|
-
function
|
|
1420
|
+
const mn = 4;
|
|
1421
|
+
function hn(e, t = "^", n = !1) {
|
|
1422
1422
|
const r = e.src.split(`
|
|
1423
|
-
`), o = Math.min(r.length - 1, e.getLineNumber()), s = Math.max(o -
|
|
1423
|
+
`), o = Math.min(r.length - 1, e.getLineNumber()), s = Math.max(o - mn, 0), i = Math.min(o + mn + 1, r.length), a = r.slice(s, i);
|
|
1424
1424
|
if (t) {
|
|
1425
1425
|
const l = " ".repeat(e.getColumnNumber()) + t;
|
|
1426
1426
|
a.splice(o - s + 1, 0, l);
|
|
1427
1427
|
}
|
|
1428
|
-
return a.map((l,
|
|
1428
|
+
return a.map((l, p) => ` ${s + p + 1}| ${l}`).join(`
|
|
1429
1429
|
`);
|
|
1430
1430
|
}
|
|
1431
|
-
const
|
|
1432
|
-
function
|
|
1433
|
-
if (
|
|
1434
|
-
return
|
|
1431
|
+
const ct = /* @__PURE__ */ new Map();
|
|
1432
|
+
function ir(e) {
|
|
1433
|
+
if (ct.has(e.id))
|
|
1434
|
+
return ct.get(e.id);
|
|
1435
1435
|
const t = (r, o) => {
|
|
1436
|
-
if (
|
|
1437
|
-
return
|
|
1438
|
-
const { name: s, args: i, parser: a } = r.context, c = a != null ? t(a, o) : "unknown",
|
|
1436
|
+
if (ct.has(r.id))
|
|
1437
|
+
return ct.get(r.id);
|
|
1438
|
+
const { name: s, args: i, parser: a } = r.context, c = a != null ? t(a, o) : "unknown", p = (() => {
|
|
1439
1439
|
switch (s) {
|
|
1440
1440
|
case "string":
|
|
1441
1441
|
return `"${i[0]}"`;
|
|
@@ -1445,8 +1445,8 @@ function fn(e) {
|
|
|
1445
1445
|
return `${i[0]}`;
|
|
1446
1446
|
case "wrap":
|
|
1447
1447
|
case "trim": {
|
|
1448
|
-
const [u,
|
|
1449
|
-
return `${t(u, o)} ${c} ${t(
|
|
1448
|
+
const [u, f] = i;
|
|
1449
|
+
return `${t(u, o)} ${c} ${t(f, o)}`;
|
|
1450
1450
|
}
|
|
1451
1451
|
case "trimWhitespace":
|
|
1452
1452
|
return `${c}?w`;
|
|
@@ -1467,26 +1467,26 @@ function fn(e) {
|
|
|
1467
1467
|
case "all":
|
|
1468
1468
|
case "then":
|
|
1469
1469
|
return `[${i.map(
|
|
1470
|
-
(
|
|
1470
|
+
(f) => t(f, o)
|
|
1471
1471
|
).join(", ")}]`;
|
|
1472
1472
|
case "any":
|
|
1473
1473
|
case "or":
|
|
1474
1474
|
return i.map(
|
|
1475
|
-
(
|
|
1475
|
+
(f) => t(f, o)
|
|
1476
1476
|
).join(" | ");
|
|
1477
1477
|
case "many": {
|
|
1478
|
-
const [u,
|
|
1479
|
-
return `${c} {${
|
|
1478
|
+
const [u, f] = i, C = f === 1 / 0 ? `${u},` : `${u},${f}`;
|
|
1479
|
+
return `${c} {${C}}`;
|
|
1480
1480
|
}
|
|
1481
1481
|
case "sepBy":
|
|
1482
1482
|
return `${c} sepBy ${t(i[0], o)}`;
|
|
1483
1483
|
case "lazy": {
|
|
1484
|
-
const [u] = i,
|
|
1484
|
+
const [u] = i, f = cr(u);
|
|
1485
1485
|
if (o)
|
|
1486
1486
|
return s;
|
|
1487
1487
|
{
|
|
1488
|
-
const
|
|
1489
|
-
return
|
|
1488
|
+
const C = t(f, f.id);
|
|
1489
|
+
return ct.set(f.id, C), C;
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
1492
|
case "debug":
|
|
@@ -1495,39 +1495,39 @@ function fn(e) {
|
|
|
1495
1495
|
return;
|
|
1496
1496
|
}
|
|
1497
1497
|
})() ?? s ?? "unknown";
|
|
1498
|
-
return o &&
|
|
1498
|
+
return o && ct.set(r.id, p), p;
|
|
1499
1499
|
}, n = t(e);
|
|
1500
|
-
return
|
|
1500
|
+
return ct.set(e.id, n), n;
|
|
1501
1501
|
}
|
|
1502
|
-
function
|
|
1503
|
-
const r = String(e.value), o = e.offset >= e.src.length, a = `${`[${e.isError ? "err" : o ? "done" : "ok"}]`} ${t} offset=${e.offset} value=${r}`, c = e.offset >= e.src.length ?
|
|
1502
|
+
function ar(e, t = "", n = "") {
|
|
1503
|
+
const r = String(e.value), o = e.offset >= e.src.length, a = `${`[${e.isError ? "err" : o ? "done" : "ok"}]`} ${t} offset=${e.offset} value=${r}`, c = e.offset >= e.src.length ? hn(e, "", e.isError) : hn(e, "^", e.isError);
|
|
1504
1504
|
return `${a}
|
|
1505
1505
|
${c}`;
|
|
1506
1506
|
}
|
|
1507
|
-
function
|
|
1507
|
+
function mo(e, t = "", n = !1, r = console.log) {
|
|
1508
1508
|
const o = (s) => {
|
|
1509
|
-
const i = e.parser(s), a = n ?
|
|
1509
|
+
const i = e.parser(s), a = n ? ir(e) : e.context.name ?? "", c = ar(
|
|
1510
1510
|
i,
|
|
1511
1511
|
t,
|
|
1512
1512
|
a
|
|
1513
1513
|
);
|
|
1514
1514
|
return r(c), i;
|
|
1515
1515
|
};
|
|
1516
|
-
return new
|
|
1516
|
+
return new x(o, M("debug", e, r));
|
|
1517
1517
|
}
|
|
1518
|
-
class
|
|
1518
|
+
class $t {
|
|
1519
1519
|
constructor(t, n = void 0, r = 0, o = !1, s = 0) {
|
|
1520
1520
|
this.src = t, this.value = n, this.offset = r, this.isError = o, this.furthest = s;
|
|
1521
1521
|
}
|
|
1522
1522
|
ok(t, n = 0) {
|
|
1523
|
-
return n += this.offset, new
|
|
1523
|
+
return n += this.offset, new $t(this.src, t, n, !1);
|
|
1524
1524
|
}
|
|
1525
1525
|
err(t, n = 0) {
|
|
1526
1526
|
const r = this.ok(t, n);
|
|
1527
1527
|
return r.isError = !0, r;
|
|
1528
1528
|
}
|
|
1529
1529
|
from(t, n = 0) {
|
|
1530
|
-
return n += this.offset, new
|
|
1530
|
+
return n += this.offset, new $t(this.src, t, n, this.isError);
|
|
1531
1531
|
}
|
|
1532
1532
|
getColumnNumber() {
|
|
1533
1533
|
const t = this.offset, n = this.src.lastIndexOf(`
|
|
@@ -1541,38 +1541,38 @@ class It {
|
|
|
1541
1541
|
`).length : 0;
|
|
1542
1542
|
}
|
|
1543
1543
|
toString() {
|
|
1544
|
-
return
|
|
1544
|
+
return ar(this);
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
1547
|
-
function
|
|
1547
|
+
function M(e, t, ...n) {
|
|
1548
1548
|
return {
|
|
1549
1549
|
name: e,
|
|
1550
1550
|
parser: t,
|
|
1551
1551
|
args: n
|
|
1552
1552
|
};
|
|
1553
1553
|
}
|
|
1554
|
-
let
|
|
1555
|
-
const
|
|
1556
|
-
let
|
|
1557
|
-
function
|
|
1558
|
-
return (!
|
|
1554
|
+
let ho = 0;
|
|
1555
|
+
const lt = /* @__PURE__ */ new Map(), _t = /* @__PURE__ */ new Map();
|
|
1556
|
+
let At;
|
|
1557
|
+
function F(e) {
|
|
1558
|
+
return (!At || e.offset > At.offset) && (At = e), At;
|
|
1559
1559
|
}
|
|
1560
|
-
function
|
|
1560
|
+
function cr(e) {
|
|
1561
1561
|
return e.parser ? e.parser : e.parser = e();
|
|
1562
1562
|
}
|
|
1563
|
-
class
|
|
1563
|
+
class x {
|
|
1564
1564
|
constructor(t, n = {}) {
|
|
1565
1565
|
this.parser = t, this.context = n;
|
|
1566
1566
|
}
|
|
1567
|
-
id =
|
|
1567
|
+
id = ho++;
|
|
1568
1568
|
state;
|
|
1569
1569
|
reset() {
|
|
1570
|
-
|
|
1570
|
+
At = void 0, lt.clear(), _t.clear();
|
|
1571
1571
|
}
|
|
1572
1572
|
parseState(t) {
|
|
1573
1573
|
this.reset();
|
|
1574
|
-
const n = this.parser(new
|
|
1575
|
-
return this.state =
|
|
1574
|
+
const n = this.parser(new $t(t));
|
|
1575
|
+
return this.state = F(n), this.state.isError = n.isError, this.state.isError, n;
|
|
1576
1576
|
}
|
|
1577
1577
|
parse(t) {
|
|
1578
1578
|
return this.parseState(t).value;
|
|
@@ -1581,38 +1581,38 @@ class y {
|
|
|
1581
1581
|
return `${this.id}${t.offset}`;
|
|
1582
1582
|
}
|
|
1583
1583
|
atLeftRecursionLimit(t) {
|
|
1584
|
-
return (
|
|
1584
|
+
return (_t.get(this.getCijKey(t)) ?? 0) > t.src.length - t.offset;
|
|
1585
1585
|
}
|
|
1586
1586
|
memoize() {
|
|
1587
1587
|
const t = (n) => {
|
|
1588
|
-
const r = this.getCijKey(n), o =
|
|
1589
|
-
let s =
|
|
1588
|
+
const r = this.getCijKey(n), o = _t.get(r) ?? 0;
|
|
1589
|
+
let s = lt.get(this.id);
|
|
1590
1590
|
if (s && s.offset >= n.offset)
|
|
1591
1591
|
return s;
|
|
1592
1592
|
if (this.atLeftRecursionLimit(n))
|
|
1593
1593
|
return n.err(void 0);
|
|
1594
|
-
|
|
1594
|
+
_t.set(r, o + 1);
|
|
1595
1595
|
const i = this.parser(n);
|
|
1596
|
-
return s =
|
|
1596
|
+
return s = lt.get(this.id), s && s.offset > i.offset ? i.offset = s.offset : s || lt.set(this.id, i), i;
|
|
1597
1597
|
};
|
|
1598
|
-
return new
|
|
1598
|
+
return new x(
|
|
1599
1599
|
t,
|
|
1600
|
-
|
|
1600
|
+
M("memoize", this)
|
|
1601
1601
|
);
|
|
1602
1602
|
}
|
|
1603
1603
|
mergeMemos() {
|
|
1604
1604
|
const t = (n) => {
|
|
1605
|
-
let r =
|
|
1605
|
+
let r = lt.get(this.id);
|
|
1606
1606
|
if (r)
|
|
1607
1607
|
return r;
|
|
1608
1608
|
if (this.atLeftRecursionLimit(n))
|
|
1609
1609
|
return n.err(void 0);
|
|
1610
1610
|
const o = this.parser(n);
|
|
1611
|
-
return r =
|
|
1611
|
+
return r = lt.get(this.id), r || lt.set(this.id, o), o;
|
|
1612
1612
|
};
|
|
1613
|
-
return new
|
|
1613
|
+
return new x(
|
|
1614
1614
|
t,
|
|
1615
|
-
|
|
1615
|
+
M("mergeMemo", this)
|
|
1616
1616
|
);
|
|
1617
1617
|
}
|
|
1618
1618
|
then(t) {
|
|
@@ -1623,11 +1623,11 @@ class y {
|
|
|
1623
1623
|
if (!s.isError)
|
|
1624
1624
|
return s.ok([o.value, s.value]);
|
|
1625
1625
|
}
|
|
1626
|
-
return
|
|
1626
|
+
return F(r), r.err(void 0);
|
|
1627
1627
|
};
|
|
1628
|
-
return new
|
|
1628
|
+
return new x(
|
|
1629
1629
|
n,
|
|
1630
|
-
|
|
1630
|
+
M("then", this, this, t)
|
|
1631
1631
|
);
|
|
1632
1632
|
}
|
|
1633
1633
|
or(t) {
|
|
@@ -1635,9 +1635,9 @@ class y {
|
|
|
1635
1635
|
const o = this.parser(r);
|
|
1636
1636
|
return o.isError ? t.parser(r) : o;
|
|
1637
1637
|
};
|
|
1638
|
-
return new
|
|
1638
|
+
return new x(
|
|
1639
1639
|
n,
|
|
1640
|
-
|
|
1640
|
+
M("or", this, this, t)
|
|
1641
1641
|
);
|
|
1642
1642
|
}
|
|
1643
1643
|
chain(t, n = !1) {
|
|
@@ -1645,9 +1645,9 @@ class y {
|
|
|
1645
1645
|
const s = this.parser(o);
|
|
1646
1646
|
return s.isError ? s : s.value || n ? t(s.value).parser(s) : o;
|
|
1647
1647
|
};
|
|
1648
|
-
return new
|
|
1648
|
+
return new x(
|
|
1649
1649
|
r,
|
|
1650
|
-
|
|
1650
|
+
M("chain", this, t)
|
|
1651
1651
|
);
|
|
1652
1652
|
}
|
|
1653
1653
|
map(t, n = !1) {
|
|
@@ -1655,9 +1655,9 @@ class y {
|
|
|
1655
1655
|
const s = this.parser(o);
|
|
1656
1656
|
return !s.isError || n ? s.ok(t(s.value)) : s;
|
|
1657
1657
|
};
|
|
1658
|
-
return new
|
|
1658
|
+
return new x(
|
|
1659
1659
|
r,
|
|
1660
|
-
|
|
1660
|
+
M("map", this)
|
|
1661
1661
|
);
|
|
1662
1662
|
}
|
|
1663
1663
|
mapState(t) {
|
|
@@ -1665,9 +1665,9 @@ class y {
|
|
|
1665
1665
|
const o = this.parser(r);
|
|
1666
1666
|
return t(o, r);
|
|
1667
1667
|
};
|
|
1668
|
-
return new
|
|
1668
|
+
return new x(
|
|
1669
1669
|
n,
|
|
1670
|
-
|
|
1670
|
+
M("mapState", this)
|
|
1671
1671
|
);
|
|
1672
1672
|
}
|
|
1673
1673
|
skip(t) {
|
|
@@ -1678,54 +1678,54 @@ class y {
|
|
|
1678
1678
|
if (!s.isError)
|
|
1679
1679
|
return s.ok(o.value);
|
|
1680
1680
|
}
|
|
1681
|
-
return
|
|
1681
|
+
return F(r), r.err(void 0);
|
|
1682
1682
|
};
|
|
1683
|
-
return new
|
|
1683
|
+
return new x(
|
|
1684
1684
|
n,
|
|
1685
|
-
|
|
1685
|
+
M("skip", this, t)
|
|
1686
1686
|
);
|
|
1687
1687
|
}
|
|
1688
1688
|
next(t) {
|
|
1689
1689
|
const n = this.then(t).map(([, r]) => r);
|
|
1690
|
-
return n.context =
|
|
1690
|
+
return n.context = M("next", this, t), n;
|
|
1691
1691
|
}
|
|
1692
1692
|
opt() {
|
|
1693
1693
|
const t = (n) => {
|
|
1694
1694
|
const r = this.parser(n);
|
|
1695
|
-
return r.isError ? (
|
|
1695
|
+
return r.isError ? (F(n), n.ok(void 0)) : r;
|
|
1696
1696
|
};
|
|
1697
|
-
return new
|
|
1697
|
+
return new x(
|
|
1698
1698
|
t,
|
|
1699
|
-
|
|
1699
|
+
M("opt", this)
|
|
1700
1700
|
);
|
|
1701
1701
|
}
|
|
1702
1702
|
not(t) {
|
|
1703
|
-
const n = (o) => this.parser(o).isError ? (
|
|
1703
|
+
const n = (o) => this.parser(o).isError ? (F(o), o.ok(o.value)) : o.err(void 0), r = (o) => {
|
|
1704
1704
|
const s = this.parser(o);
|
|
1705
|
-
return s.isError ? (
|
|
1705
|
+
return s.isError ? (F(o), s) : t.parser(o).isError ? s : (F(o), o.err(void 0));
|
|
1706
1706
|
};
|
|
1707
|
-
return new
|
|
1707
|
+
return new x(
|
|
1708
1708
|
t ? r : n,
|
|
1709
|
-
|
|
1709
|
+
M("not", this, t)
|
|
1710
1710
|
);
|
|
1711
1711
|
}
|
|
1712
1712
|
wrap(t, n, r = !0) {
|
|
1713
1713
|
if (!r)
|
|
1714
|
-
return
|
|
1714
|
+
return I(t, this, n);
|
|
1715
1715
|
const o = t.next(this).skip(n);
|
|
1716
|
-
return o.context =
|
|
1716
|
+
return o.context = M("wrap", this, t, n), o;
|
|
1717
1717
|
}
|
|
1718
1718
|
trim(t = g, n = !0) {
|
|
1719
1719
|
if (!n)
|
|
1720
|
-
return
|
|
1720
|
+
return I(t, this, t);
|
|
1721
1721
|
if (t.context?.name === "whitespace") {
|
|
1722
1722
|
const r = (o) => {
|
|
1723
|
-
const s =
|
|
1724
|
-
return i.isError ? (
|
|
1723
|
+
const s = bn(o), i = this.parser(s);
|
|
1724
|
+
return i.isError ? (F(o), o.err(void 0)) : bn(i);
|
|
1725
1725
|
};
|
|
1726
|
-
return new
|
|
1726
|
+
return new x(
|
|
1727
1727
|
r,
|
|
1728
|
-
|
|
1728
|
+
M("trimWhitespace", this)
|
|
1729
1729
|
);
|
|
1730
1730
|
}
|
|
1731
1731
|
return this.wrap(t, t);
|
|
@@ -1740,11 +1740,11 @@ class y {
|
|
|
1740
1740
|
break;
|
|
1741
1741
|
s.push(c.value), i = c;
|
|
1742
1742
|
}
|
|
1743
|
-
return s.length >= t ? i.ok(s) : (
|
|
1743
|
+
return s.length >= t ? i.ok(s) : (F(o), o.err([]));
|
|
1744
1744
|
};
|
|
1745
|
-
return new
|
|
1745
|
+
return new x(
|
|
1746
1746
|
r,
|
|
1747
|
-
|
|
1747
|
+
M("many", this, t, n)
|
|
1748
1748
|
);
|
|
1749
1749
|
}
|
|
1750
1750
|
sepBy(t, n = 0, r = 1 / 0) {
|
|
@@ -1756,58 +1756,58 @@ class y {
|
|
|
1756
1756
|
if (l.isError)
|
|
1757
1757
|
break;
|
|
1758
1758
|
a = l, i.push(a.value);
|
|
1759
|
-
const
|
|
1760
|
-
if (
|
|
1759
|
+
const p = t.parser(a);
|
|
1760
|
+
if (p.isError)
|
|
1761
1761
|
break;
|
|
1762
|
-
a =
|
|
1762
|
+
a = p;
|
|
1763
1763
|
}
|
|
1764
|
-
return i.length > n ? a.ok(i) : (
|
|
1764
|
+
return i.length > n ? a.ok(i) : (F(s), s.err([]));
|
|
1765
1765
|
};
|
|
1766
|
-
return new
|
|
1766
|
+
return new x(
|
|
1767
1767
|
o,
|
|
1768
|
-
|
|
1768
|
+
M("sepBy", this, t)
|
|
1769
1769
|
);
|
|
1770
1770
|
}
|
|
1771
1771
|
eof() {
|
|
1772
|
-
const t = this.skip(
|
|
1773
|
-
return t.context =
|
|
1772
|
+
const t = this.skip(fo());
|
|
1773
|
+
return t.context = M("eof", this), t;
|
|
1774
1774
|
}
|
|
1775
1775
|
debug(t = "", n = !1, r = console.log) {
|
|
1776
|
-
return
|
|
1776
|
+
return mo(this, t, n, r);
|
|
1777
1777
|
}
|
|
1778
1778
|
toString() {
|
|
1779
|
-
return
|
|
1779
|
+
return ir(this);
|
|
1780
1780
|
}
|
|
1781
1781
|
static lazy(t) {
|
|
1782
|
-
const n = (r) =>
|
|
1783
|
-
return new
|
|
1782
|
+
const n = (r) => cr(t).parser(r);
|
|
1783
|
+
return new x(
|
|
1784
1784
|
n,
|
|
1785
|
-
|
|
1785
|
+
M("lazy", void 0, t)
|
|
1786
1786
|
);
|
|
1787
1787
|
}
|
|
1788
1788
|
}
|
|
1789
|
-
function
|
|
1790
|
-
const e = (t) => t.offset >= t.src.length ? t.ok(void 0) : (
|
|
1791
|
-
return new
|
|
1789
|
+
function fo() {
|
|
1790
|
+
const e = (t) => t.offset >= t.src.length ? t.ok(void 0) : (F(t), t.err());
|
|
1791
|
+
return new x(
|
|
1792
1792
|
e,
|
|
1793
|
-
|
|
1793
|
+
M("eof", void 0)
|
|
1794
1794
|
);
|
|
1795
1795
|
}
|
|
1796
|
-
function
|
|
1796
|
+
function d(...e) {
|
|
1797
1797
|
const t = (n) => {
|
|
1798
1798
|
for (const r of e) {
|
|
1799
1799
|
const o = r.parser(n);
|
|
1800
1800
|
if (!o.isError)
|
|
1801
1801
|
return o;
|
|
1802
1802
|
}
|
|
1803
|
-
return
|
|
1803
|
+
return F(n), n.err(void 0);
|
|
1804
1804
|
};
|
|
1805
|
-
return new
|
|
1805
|
+
return new x(
|
|
1806
1806
|
e.length === 1 ? e[0].parser : t,
|
|
1807
|
-
|
|
1807
|
+
M("any", void 0, ...e)
|
|
1808
1808
|
);
|
|
1809
1809
|
}
|
|
1810
|
-
function
|
|
1810
|
+
function I(...e) {
|
|
1811
1811
|
const t = (n) => {
|
|
1812
1812
|
const r = [];
|
|
1813
1813
|
let o = n;
|
|
@@ -1817,67 +1817,67 @@ function M(...e) {
|
|
|
1817
1817
|
return i;
|
|
1818
1818
|
i.value !== void 0 && r.push(i.value), o = i;
|
|
1819
1819
|
}
|
|
1820
|
-
return
|
|
1820
|
+
return F(o), o.ok(r);
|
|
1821
1821
|
};
|
|
1822
|
-
return new
|
|
1822
|
+
return new x(
|
|
1823
1823
|
e.length === 1 ? e[0].parser : t,
|
|
1824
|
-
|
|
1824
|
+
M("all", void 0, ...e)
|
|
1825
1825
|
);
|
|
1826
1826
|
}
|
|
1827
|
-
function
|
|
1827
|
+
function B(e) {
|
|
1828
1828
|
const t = (n) => {
|
|
1829
1829
|
if (n.offset >= n.src.length)
|
|
1830
1830
|
return n.err(void 0);
|
|
1831
1831
|
const r = n.src.slice(n.offset, n.offset + e.length);
|
|
1832
|
-
return r === e ? n.ok(r, r.length) : (
|
|
1832
|
+
return r === e ? n.ok(r, r.length) : (F(n), n.err(void 0));
|
|
1833
1833
|
};
|
|
1834
|
-
return new
|
|
1834
|
+
return new x(
|
|
1835
1835
|
t,
|
|
1836
|
-
|
|
1836
|
+
M("string", void 0, e)
|
|
1837
1837
|
);
|
|
1838
1838
|
}
|
|
1839
|
-
function
|
|
1839
|
+
function D(e, t = (n) => n?.[0] ?? null) {
|
|
1840
1840
|
const n = e.flags.replace(/y/g, ""), r = new RegExp(e, n + "y"), o = (s) => {
|
|
1841
1841
|
if (s.offset >= s.src.length)
|
|
1842
1842
|
return s.err(void 0);
|
|
1843
1843
|
r.lastIndex = s.offset;
|
|
1844
1844
|
const i = t(s.src.match(r));
|
|
1845
|
-
return i ? s.ok(i, r.lastIndex - s.offset) : i === "" ? s.ok(void 0) : (
|
|
1845
|
+
return i ? s.ok(i, r.lastIndex - s.offset) : i === "" ? s.ok(void 0) : (F(s), s.err(void 0));
|
|
1846
1846
|
};
|
|
1847
|
-
return new
|
|
1847
|
+
return new x(
|
|
1848
1848
|
o,
|
|
1849
|
-
|
|
1849
|
+
M("regex", void 0, e)
|
|
1850
1850
|
);
|
|
1851
1851
|
}
|
|
1852
|
-
const
|
|
1852
|
+
const fn = /\s*/y, bn = (e) => {
|
|
1853
1853
|
if (e.offset >= e.src.length)
|
|
1854
1854
|
return e;
|
|
1855
|
-
|
|
1856
|
-
const t = e.src.match(
|
|
1855
|
+
fn.lastIndex = e.offset;
|
|
1856
|
+
const t = e.src.match(fn)?.[0] ?? "";
|
|
1857
1857
|
return e.ok(e.value, t.length);
|
|
1858
|
-
}, g =
|
|
1858
|
+
}, g = D(/\s*/);
|
|
1859
1859
|
g.context.name = "whitespace";
|
|
1860
|
-
const
|
|
1860
|
+
const m = (e) => {
|
|
1861
1861
|
const t = new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "i");
|
|
1862
|
-
return
|
|
1863
|
-
},
|
|
1864
|
-
function
|
|
1865
|
-
return new
|
|
1862
|
+
return D(t);
|
|
1863
|
+
}, bo = D(/-?[a-zA-Z][a-zA-Z0-9-]*/), Pe = m("none"), go = D(/-?\d+/).map(Number), et = D(/-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/).map(Number);
|
|
1864
|
+
function wo(e) {
|
|
1865
|
+
return new x((t) => t.ok(e, 0));
|
|
1866
1866
|
}
|
|
1867
|
-
function
|
|
1868
|
-
return new
|
|
1867
|
+
function ko(e) {
|
|
1868
|
+
return new x((t) => t.err(void 0, 0));
|
|
1869
1869
|
}
|
|
1870
|
-
function
|
|
1870
|
+
function Bt(e, t) {
|
|
1871
1871
|
const n = e.parseState(t);
|
|
1872
1872
|
if (n.isError)
|
|
1873
1873
|
throw new Error(`Parse error at offset ${n.offset}`);
|
|
1874
1874
|
return n.value;
|
|
1875
1875
|
}
|
|
1876
|
-
function
|
|
1876
|
+
function ba(e, t) {
|
|
1877
1877
|
const n = e.parseState(t);
|
|
1878
1878
|
return { status: !n.isError, value: n.value };
|
|
1879
1879
|
}
|
|
1880
|
-
function
|
|
1880
|
+
function N(e, t) {
|
|
1881
1881
|
const [n, r, o] = e;
|
|
1882
1882
|
return [
|
|
1883
1883
|
t[0] * n + t[1] * r + t[2] * o,
|
|
@@ -1885,7 +1885,7 @@ function R(e, t) {
|
|
|
1885
1885
|
t[6] * n + t[7] * r + t[8] * o
|
|
1886
1886
|
];
|
|
1887
1887
|
}
|
|
1888
|
-
function
|
|
1888
|
+
function da(e) {
|
|
1889
1889
|
return [
|
|
1890
1890
|
e[0],
|
|
1891
1891
|
e[3],
|
|
@@ -1898,7 +1898,7 @@ function Vs(e) {
|
|
|
1898
1898
|
e[8]
|
|
1899
1899
|
];
|
|
1900
1900
|
}
|
|
1901
|
-
function
|
|
1901
|
+
function ga(e, t) {
|
|
1902
1902
|
return [
|
|
1903
1903
|
e[0] * t[0] + e[1] * t[3] + e[2] * t[6],
|
|
1904
1904
|
e[0] * t[1] + e[1] * t[4] + e[2] * t[7],
|
|
@@ -1911,54 +1911,54 @@ function Ws(e, t) {
|
|
|
1911
1911
|
e[6] * t[2] + e[7] * t[5] + e[8] * t[8]
|
|
1912
1912
|
];
|
|
1913
1913
|
}
|
|
1914
|
-
function
|
|
1915
|
-
const [t, n, r, o, s, i, a, c, l] = e,
|
|
1914
|
+
function nt(e) {
|
|
1915
|
+
const [t, n, r, o, s, i, a, c, l] = e, p = s * l - i * c, u = -(o * l - i * a), f = o * c - s * a, y = 1 / (t * p + n * u + r * f);
|
|
1916
1916
|
return [
|
|
1917
|
-
|
|
1918
|
-
(r * c - n * l) *
|
|
1919
|
-
(n * i - r * s) *
|
|
1920
|
-
u *
|
|
1921
|
-
(t * l - r * a) *
|
|
1922
|
-
(r * o - t * i) *
|
|
1923
|
-
|
|
1924
|
-
(n * a - t * c) *
|
|
1925
|
-
(t * s - n * o) *
|
|
1917
|
+
p * y,
|
|
1918
|
+
(r * c - n * l) * y,
|
|
1919
|
+
(n * i - r * s) * y,
|
|
1920
|
+
u * y,
|
|
1921
|
+
(t * l - r * a) * y,
|
|
1922
|
+
(r * o - t * i) * y,
|
|
1923
|
+
f * y,
|
|
1924
|
+
(n * a - t * c) * y,
|
|
1925
|
+
(t * s - n * o) * y
|
|
1926
1926
|
];
|
|
1927
1927
|
}
|
|
1928
|
-
const
|
|
1928
|
+
const _ = 255, h = {
|
|
1929
1929
|
"%": { min: 0, max: 100 },
|
|
1930
1930
|
number: { min: 0, max: 1 }
|
|
1931
|
-
},
|
|
1931
|
+
}, oe = {
|
|
1932
1932
|
"%": h["%"],
|
|
1933
|
-
number: { min: 0, max:
|
|
1933
|
+
number: { min: 0, max: _ }
|
|
1934
1934
|
}, z = {
|
|
1935
1935
|
"%": h["%"],
|
|
1936
1936
|
number: h.number
|
|
1937
|
-
},
|
|
1937
|
+
}, Et = {
|
|
1938
1938
|
deg: { min: 0, max: 360 },
|
|
1939
1939
|
number: { min: 0, max: 360 },
|
|
1940
1940
|
"%": h["%"]
|
|
1941
|
-
},
|
|
1941
|
+
}, b = {
|
|
1942
1942
|
rgb: {
|
|
1943
|
-
r:
|
|
1944
|
-
g:
|
|
1945
|
-
b:
|
|
1943
|
+
r: oe,
|
|
1944
|
+
g: oe,
|
|
1945
|
+
b: oe,
|
|
1946
1946
|
alpha: h
|
|
1947
1947
|
},
|
|
1948
1948
|
hsl: {
|
|
1949
|
-
h:
|
|
1949
|
+
h: Et,
|
|
1950
1950
|
s: { "%": h["%"], number: h.number },
|
|
1951
1951
|
l: { "%": h["%"], number: h.number },
|
|
1952
1952
|
alpha: h
|
|
1953
1953
|
},
|
|
1954
1954
|
hsv: {
|
|
1955
|
-
h:
|
|
1955
|
+
h: Et,
|
|
1956
1956
|
s: { "%": h["%"], number: h.number },
|
|
1957
1957
|
v: { "%": h["%"], number: h.number },
|
|
1958
1958
|
alpha: h
|
|
1959
1959
|
},
|
|
1960
1960
|
hwb: {
|
|
1961
|
-
h:
|
|
1961
|
+
h: Et,
|
|
1962
1962
|
w: { "%": h["%"], number: h.number },
|
|
1963
1963
|
b: { "%": h["%"], number: h.number },
|
|
1964
1964
|
alpha: h
|
|
@@ -1972,7 +1972,7 @@ const I = 255, h = {
|
|
|
1972
1972
|
lch: {
|
|
1973
1973
|
l: { "%": h["%"], number: h["%"] },
|
|
1974
1974
|
c: { number: { min: 0, max: 150 }, "%": h["%"] },
|
|
1975
|
-
h:
|
|
1975
|
+
h: Et,
|
|
1976
1976
|
alpha: h
|
|
1977
1977
|
},
|
|
1978
1978
|
oklab: {
|
|
@@ -1984,7 +1984,7 @@ const I = 255, h = {
|
|
|
1984
1984
|
oklch: {
|
|
1985
1985
|
l: { "%": h["%"], number: h["%"] },
|
|
1986
1986
|
c: { number: { min: 0, max: 0.5 }, "%": h["%"] },
|
|
1987
|
-
h:
|
|
1987
|
+
h: Et,
|
|
1988
1988
|
alpha: h
|
|
1989
1989
|
},
|
|
1990
1990
|
xyz: {
|
|
@@ -2027,96 +2027,96 @@ const I = 255, h = {
|
|
|
2027
2027
|
b: z,
|
|
2028
2028
|
alpha: h
|
|
2029
2029
|
}
|
|
2030
|
-
},
|
|
2030
|
+
}, $ = "%", lr = {
|
|
2031
2031
|
rgb: {
|
|
2032
2032
|
r: "",
|
|
2033
2033
|
g: "",
|
|
2034
2034
|
b: "",
|
|
2035
|
-
alpha:
|
|
2035
|
+
alpha: $
|
|
2036
2036
|
},
|
|
2037
2037
|
hsl: {
|
|
2038
2038
|
h: "deg",
|
|
2039
2039
|
s: "%",
|
|
2040
2040
|
l: "%",
|
|
2041
|
-
alpha:
|
|
2041
|
+
alpha: $
|
|
2042
2042
|
},
|
|
2043
2043
|
hsv: {
|
|
2044
2044
|
h: "deg",
|
|
2045
2045
|
s: "%",
|
|
2046
2046
|
v: "%",
|
|
2047
|
-
alpha:
|
|
2047
|
+
alpha: $
|
|
2048
2048
|
},
|
|
2049
2049
|
hwb: {
|
|
2050
2050
|
h: "deg",
|
|
2051
2051
|
w: "%",
|
|
2052
2052
|
b: "%",
|
|
2053
|
-
alpha:
|
|
2053
|
+
alpha: $
|
|
2054
2054
|
},
|
|
2055
2055
|
lab: {
|
|
2056
2056
|
l: "%",
|
|
2057
2057
|
a: "",
|
|
2058
2058
|
b: "",
|
|
2059
|
-
alpha:
|
|
2059
|
+
alpha: $
|
|
2060
2060
|
},
|
|
2061
2061
|
lch: {
|
|
2062
2062
|
l: "%",
|
|
2063
2063
|
c: "",
|
|
2064
2064
|
h: "deg",
|
|
2065
|
-
alpha:
|
|
2065
|
+
alpha: $
|
|
2066
2066
|
},
|
|
2067
2067
|
oklab: {
|
|
2068
2068
|
l: "%",
|
|
2069
2069
|
a: "",
|
|
2070
2070
|
b: "",
|
|
2071
|
-
alpha:
|
|
2071
|
+
alpha: $
|
|
2072
2072
|
},
|
|
2073
2073
|
oklch: {
|
|
2074
2074
|
l: "%",
|
|
2075
2075
|
c: "",
|
|
2076
2076
|
h: "deg",
|
|
2077
|
-
alpha:
|
|
2077
|
+
alpha: $
|
|
2078
2078
|
},
|
|
2079
2079
|
xyz: {
|
|
2080
2080
|
x: "%",
|
|
2081
2081
|
y: "%",
|
|
2082
2082
|
z: "%",
|
|
2083
|
-
alpha:
|
|
2083
|
+
alpha: $
|
|
2084
2084
|
},
|
|
2085
2085
|
kelvin: {
|
|
2086
2086
|
kelvin: "K",
|
|
2087
|
-
alpha:
|
|
2087
|
+
alpha: $
|
|
2088
2088
|
},
|
|
2089
2089
|
"srgb-linear": {
|
|
2090
2090
|
r: "",
|
|
2091
2091
|
g: "",
|
|
2092
2092
|
b: "",
|
|
2093
|
-
alpha:
|
|
2093
|
+
alpha: $
|
|
2094
2094
|
},
|
|
2095
2095
|
"display-p3": {
|
|
2096
2096
|
r: "",
|
|
2097
2097
|
g: "",
|
|
2098
2098
|
b: "",
|
|
2099
|
-
alpha:
|
|
2099
|
+
alpha: $
|
|
2100
2100
|
},
|
|
2101
2101
|
"a98-rgb": {
|
|
2102
2102
|
r: "",
|
|
2103
2103
|
g: "",
|
|
2104
2104
|
b: "",
|
|
2105
|
-
alpha:
|
|
2105
|
+
alpha: $
|
|
2106
2106
|
},
|
|
2107
2107
|
"prophoto-rgb": {
|
|
2108
2108
|
r: "",
|
|
2109
2109
|
g: "",
|
|
2110
2110
|
b: "",
|
|
2111
|
-
alpha:
|
|
2111
|
+
alpha: $
|
|
2112
2112
|
},
|
|
2113
2113
|
rec2020: {
|
|
2114
2114
|
r: "",
|
|
2115
2115
|
g: "",
|
|
2116
2116
|
b: "",
|
|
2117
|
-
alpha:
|
|
2117
|
+
alpha: $
|
|
2118
2118
|
}
|
|
2119
|
-
},
|
|
2119
|
+
}, wa = {
|
|
2120
2120
|
rgb: "RGB",
|
|
2121
2121
|
hsl: "HSL",
|
|
2122
2122
|
hsv: "HSV",
|
|
@@ -2132,15 +2132,15 @@ const I = 255, h = {
|
|
|
2132
2132
|
"a98-rgb": "Adobe RGB",
|
|
2133
2133
|
"prophoto-rgb": "ProPhoto RGB",
|
|
2134
2134
|
rec2020: "Rec. 2020"
|
|
2135
|
-
},
|
|
2135
|
+
}, So = [
|
|
2136
2136
|
0.3127 / 0.329,
|
|
2137
2137
|
1,
|
|
2138
2138
|
(1 - 0.3127 - 0.329) / 0.329
|
|
2139
|
-
],
|
|
2139
|
+
], yo = [
|
|
2140
2140
|
0.3457 / 0.3585,
|
|
2141
2141
|
1,
|
|
2142
2142
|
(1 - 0.3457 - 0.3585) / 0.3585
|
|
2143
|
-
],
|
|
2143
|
+
], Oe = [
|
|
2144
2144
|
1.0479297925449969,
|
|
2145
2145
|
0.022946870601609652,
|
|
2146
2146
|
-0.05019226628920524,
|
|
@@ -2150,10 +2150,10 @@ const I = 255, h = {
|
|
|
2150
2150
|
-0.009243040646204504,
|
|
2151
2151
|
0.015055191490298152,
|
|
2152
2152
|
0.7518742814281371
|
|
2153
|
-
],
|
|
2154
|
-
D65:
|
|
2155
|
-
D50:
|
|
2156
|
-
},
|
|
2153
|
+
], ur = nt(Oe), pr = {
|
|
2154
|
+
D65: So,
|
|
2155
|
+
D50: yo
|
|
2156
|
+
}, mr = [
|
|
2157
2157
|
0.819022437996703,
|
|
2158
2158
|
0.3619062600528904,
|
|
2159
2159
|
-0.1288737815209879,
|
|
@@ -2163,7 +2163,7 @@ const I = 255, h = {
|
|
|
2163
2163
|
0.0481771893596242,
|
|
2164
2164
|
0.2642395317527308,
|
|
2165
2165
|
0.6335478284694309
|
|
2166
|
-
],
|
|
2166
|
+
], Co = nt(mr), hr = [
|
|
2167
2167
|
0.210454268309314,
|
|
2168
2168
|
0.7936177747023054,
|
|
2169
2169
|
-0.0040720430116193,
|
|
@@ -2173,7 +2173,7 @@ const I = 255, h = {
|
|
|
2173
2173
|
0.0259040424655478,
|
|
2174
2174
|
0.7827717124575296,
|
|
2175
2175
|
-0.8086757549230774
|
|
2176
|
-
],
|
|
2176
|
+
], xo = nt(hr), k = [
|
|
2177
2177
|
4.0767416621,
|
|
2178
2178
|
-3.3077115913,
|
|
2179
2179
|
0.2309699292,
|
|
@@ -2183,7 +2183,7 @@ const I = 255, h = {
|
|
|
2183
2183
|
-0.0041960863,
|
|
2184
2184
|
-0.7034186147,
|
|
2185
2185
|
1.707614701
|
|
2186
|
-
],
|
|
2186
|
+
], j = [
|
|
2187
2187
|
0.4122214708,
|
|
2188
2188
|
0.5363325363,
|
|
2189
2189
|
0.0514459929,
|
|
@@ -2193,11 +2193,11 @@ const I = 255, h = {
|
|
|
2193
2193
|
0.0883024619,
|
|
2194
2194
|
0.2817188376,
|
|
2195
2195
|
0.6299787005
|
|
2196
|
-
],
|
|
2196
|
+
], P = {
|
|
2197
2197
|
l: [1, 0.3963377774, 0.2158037573],
|
|
2198
2198
|
m: [1, -0.1055613458, -0.0638541728],
|
|
2199
2199
|
s: [1, -0.0894841775, -1.291485548]
|
|
2200
|
-
},
|
|
2200
|
+
}, To = [
|
|
2201
2201
|
{
|
|
2202
2202
|
// Red sector: -1.88170328*a - 0.80936493*b > 1
|
|
2203
2203
|
test: (e, t) => -1.88170328 * e - 0.80936493 * t > 1,
|
|
@@ -2234,7 +2234,7 @@ const I = 255, h = {
|
|
|
2234
2234
|
wm: -0.7034186147,
|
|
2235
2235
|
ws: 1.707614701
|
|
2236
2236
|
}
|
|
2237
|
-
],
|
|
2237
|
+
], dn = {
|
|
2238
2238
|
aliceblue: "#f0f8ff",
|
|
2239
2239
|
antiquewhite: "#faebd7",
|
|
2240
2240
|
aqua: "#00ffff",
|
|
@@ -2389,184 +2389,184 @@ const I = 255, h = {
|
|
|
2389
2389
|
shadyshroom: "oklch(53% 0.07 21.60deg / 100%)",
|
|
2390
2390
|
patriarchalplum: "oklch(31.20% 0.11 19.80deg / 100%)"
|
|
2391
2391
|
};
|
|
2392
|
-
function
|
|
2392
|
+
function v(e, t, n) {
|
|
2393
2393
|
return Math.min(Math.max(e, t), n);
|
|
2394
2394
|
}
|
|
2395
|
-
function
|
|
2395
|
+
function R(e, t, n, r = 0, o = 1) {
|
|
2396
2396
|
const s = (o - r) / (n - t);
|
|
2397
2397
|
if (n === t)
|
|
2398
2398
|
throw new Error("fromMax and fromMin cannot be equal");
|
|
2399
2399
|
return (e - t) * s + r;
|
|
2400
2400
|
}
|
|
2401
|
-
function
|
|
2401
|
+
function de(e, t, n) {
|
|
2402
2402
|
return (1 - e) * t + e * n;
|
|
2403
2403
|
}
|
|
2404
|
-
function
|
|
2404
|
+
function ka(e, t, n) {
|
|
2405
2405
|
return t = t === 0 ? 1e-9 : t, t * Math.pow(n / t, e);
|
|
2406
2406
|
}
|
|
2407
|
-
function
|
|
2407
|
+
function Ft(e, t) {
|
|
2408
2408
|
const n = t.length - 1, r = [...t];
|
|
2409
2409
|
for (let o = 1; o <= n; o++)
|
|
2410
2410
|
for (let s = 0; s <= n - o; s++)
|
|
2411
|
-
r[s] =
|
|
2411
|
+
r[s] = de(e, r[s], r[s + 1]);
|
|
2412
2412
|
return r[0];
|
|
2413
2413
|
}
|
|
2414
|
-
function
|
|
2415
|
-
return [
|
|
2414
|
+
function fr(e, t, n, r, o) {
|
|
2415
|
+
return [Ft(e, [0, t, r, 1]), Ft(e, [0, n, o, 1])];
|
|
2416
2416
|
}
|
|
2417
|
-
function
|
|
2417
|
+
function jt(e, t) {
|
|
2418
2418
|
const n = t.map((o) => o[0]), r = t.map((o) => o[1]);
|
|
2419
|
-
return [
|
|
2419
|
+
return [Ft(e, n), Ft(e, r)];
|
|
2420
2420
|
}
|
|
2421
|
-
function
|
|
2421
|
+
function Sa(e, t, n, r) {
|
|
2422
2422
|
let o = "M0 0";
|
|
2423
2423
|
for (let s = 0; s <= 1; s += 1e-3) {
|
|
2424
|
-
const [i, a] =
|
|
2424
|
+
const [i, a] = fr(s, e, t, n, r);
|
|
2425
2425
|
o += ` L${i} ${a}`;
|
|
2426
2426
|
}
|
|
2427
2427
|
return `<path d="${o}"/>`;
|
|
2428
2428
|
}
|
|
2429
|
-
function
|
|
2429
|
+
function ya(e, t, n, r) {
|
|
2430
2430
|
const o = (s) => s.toFixed(2);
|
|
2431
2431
|
return `cubic-bezier(${o(e)}, ${o(t)}, ${o(n)}, ${o(r)})`;
|
|
2432
2432
|
}
|
|
2433
|
-
const
|
|
2434
|
-
function
|
|
2433
|
+
const br = 2.4, Gt = 0.055, Le = 12.92, Eo = 0.04045, dr = Eo / Le;
|
|
2434
|
+
function se(e) {
|
|
2435
2435
|
const t = e < 0 ? -1 : 1, n = e * t;
|
|
2436
|
-
return n <=
|
|
2436
|
+
return n <= dr ? e / Le : t * ((n + Gt) / (1 + Gt)) ** br;
|
|
2437
2437
|
}
|
|
2438
|
-
function
|
|
2438
|
+
function ie(e) {
|
|
2439
2439
|
const t = e < 0 ? -1 : 1, n = e * t;
|
|
2440
|
-
return n <=
|
|
2440
|
+
return n <= dr ? e * Le : t * ((1 + Gt) * n ** (1 / br) - Gt);
|
|
2441
2441
|
}
|
|
2442
|
-
function
|
|
2442
|
+
function ae(e, t, n) {
|
|
2443
2443
|
return Math.min(Math.max(e, t), n);
|
|
2444
2444
|
}
|
|
2445
|
-
const
|
|
2446
|
-
function
|
|
2445
|
+
const Ca = 0.02;
|
|
2446
|
+
function xa(e, t, n, r, o, s) {
|
|
2447
2447
|
const i = e - r, a = t - o, c = n - s;
|
|
2448
2448
|
return Math.sqrt(i * i + a * a + c * c);
|
|
2449
2449
|
}
|
|
2450
|
-
function
|
|
2451
|
-
const r = e +
|
|
2450
|
+
function ze(e, t, n) {
|
|
2451
|
+
const r = e + P.l[1] * t + P.l[2] * n, o = e + P.m[1] * t + P.m[2] * n, s = e + P.s[1] * t + P.s[2] * n, i = r * r * r, a = o * o * o, c = s * s * s;
|
|
2452
2452
|
return [
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2453
|
+
k[0] * i + k[1] * a + k[2] * c,
|
|
2454
|
+
k[3] * i + k[4] * a + k[5] * c,
|
|
2455
|
+
k[6] * i + k[7] * a + k[8] * c
|
|
2456
2456
|
];
|
|
2457
2457
|
}
|
|
2458
|
-
function
|
|
2458
|
+
function Ao(e, t, n) {
|
|
2459
2459
|
return e >= 0 && e <= 1 && t >= 0 && t <= 1 && n >= 0 && n <= 1;
|
|
2460
2460
|
}
|
|
2461
|
-
function
|
|
2462
|
-
const n =
|
|
2461
|
+
function Mo(e, t) {
|
|
2462
|
+
const n = To.find((T) => T.test(e, t)), { k0: r, k1: o, k2: s, k3: i, k4: a, wl: c, wm: l, ws: p } = n;
|
|
2463
2463
|
let u = r + o * e + s * t + i * e * e + a * e * t;
|
|
2464
|
-
const
|
|
2464
|
+
const f = P.l[1] * e + P.l[2] * t, C = P.m[1] * e + P.m[2] * t, y = P.s[1] * e + P.s[2] * t;
|
|
2465
2465
|
{
|
|
2466
|
-
const
|
|
2467
|
-
u = u -
|
|
2466
|
+
const T = 1 + u * f, w = 1 + u * C, E = 1 + u * y, A = T * T * T, L = w * w * w, X = E * E * E, ot = 3 * f * T * T, st = 3 * C * w * w, it = 3 * y * E * E, Ct = 6 * f * f * T, xt = 6 * C * C * w, Tt = 6 * y * y * E, ht = c * A + l * L + p * X, at = c * ot + l * st + p * it, Nt = c * Ct + l * xt + p * Tt;
|
|
2467
|
+
u = u - ht * at / (at * at - 0.5 * ht * Nt);
|
|
2468
2468
|
}
|
|
2469
2469
|
return u;
|
|
2470
2470
|
}
|
|
2471
|
-
function
|
|
2472
|
-
const n =
|
|
2471
|
+
function Io(e, t) {
|
|
2472
|
+
const n = Mo(e, t), [r, o, s] = ze(1, n * e, n * t), i = Math.cbrt(1 / Math.max(r, o, s)), a = i * n;
|
|
2473
2473
|
return { L: i, C: a };
|
|
2474
2474
|
}
|
|
2475
|
-
function
|
|
2475
|
+
function Ro(e, t, n, r, o, s) {
|
|
2476
2476
|
let i;
|
|
2477
2477
|
if ((n - o) * s.C - (s.L - o) * r <= 0)
|
|
2478
2478
|
i = s.C * o / (r * s.L + s.C * (o - n));
|
|
2479
2479
|
else {
|
|
2480
2480
|
i = s.C * (o - 1) / (r * (s.L - 1) + s.C * (o - n));
|
|
2481
|
-
const a = n - o, c = r, l =
|
|
2481
|
+
const a = n - o, c = r, l = P.l[1] * e + P.l[2] * t, p = P.m[1] * e + P.m[2] * t, u = P.s[1] * e + P.s[2] * t, f = a + c * l, C = a + c * p, y = a + c * u;
|
|
2482
2482
|
{
|
|
2483
|
-
const
|
|
2484
|
-
let
|
|
2485
|
-
const
|
|
2486
|
-
let
|
|
2487
|
-
const
|
|
2488
|
-
let
|
|
2489
|
-
|
|
2483
|
+
const T = o * (1 - i) + i * n, w = i * r, E = T + w * l, A = T + w * p, L = T + w * u, X = E * E * E, ot = A * A * A, st = L * L * L, it = 3 * f * E * E, Ct = 3 * C * A * A, xt = 3 * y * L * L, Tt = 6 * f * f * E, ht = 6 * C * C * A, at = 6 * y * y * L, Nt = k[0] * X + k[1] * ot + k[2] * st - 1, Jt = k[0] * it + k[1] * Ct + k[2] * xt, eo = k[0] * Tt + k[1] * ht + k[2] * at, rn = Jt / (Jt * Jt - 0.5 * Nt * eo);
|
|
2484
|
+
let Qt = -Nt * rn;
|
|
2485
|
+
const on = k[3] * X + k[4] * ot + k[5] * st - 1, te = k[3] * it + k[4] * Ct + k[5] * xt, no = k[3] * Tt + k[4] * ht + k[5] * at, sn = te / (te * te - 0.5 * on * no);
|
|
2486
|
+
let ee = -on * sn;
|
|
2487
|
+
const an = k[6] * X + k[7] * ot + k[8] * st - 1, ne = k[6] * it + k[7] * Ct + k[8] * xt, ro = k[6] * Tt + k[7] * ht + k[8] * at, cn = ne / (ne * ne - 0.5 * an * ro);
|
|
2488
|
+
let re = -an * cn;
|
|
2489
|
+
Qt = rn >= 0 ? Qt : 1 / 0, ee = sn >= 0 ? ee : 1 / 0, re = cn >= 0 ? re : 1 / 0, i += Math.min(Qt, ee, re);
|
|
2490
2490
|
}
|
|
2491
2491
|
}
|
|
2492
2492
|
return i;
|
|
2493
2493
|
}
|
|
2494
|
-
const
|
|
2495
|
-
function
|
|
2496
|
-
const [r, o, s] =
|
|
2497
|
-
if (
|
|
2494
|
+
const vo = 1e-5, Bo = 0.05;
|
|
2495
|
+
function No(e, t, n) {
|
|
2496
|
+
const [r, o, s] = ze(e, t, n);
|
|
2497
|
+
if (Ao(r, o, s))
|
|
2498
2498
|
return [e, t, n];
|
|
2499
|
-
const i = Math.max(
|
|
2500
|
-
return [
|
|
2499
|
+
const i = Math.max(vo, Math.sqrt(t * t + n * n)), a = t / i, c = n / i, l = Io(a, c), p = e - 0.5, u = 0.5 + Math.abs(p) + Bo * i, f = 0.5 * (1 + Math.sign(p) * (u - Math.sqrt(u * u - 2 * Math.abs(p)))), C = Ro(a, c, e, i, f, l), y = f * (1 - C) + C * e, T = C * i;
|
|
2500
|
+
return [y, T * a, T * c];
|
|
2501
2501
|
}
|
|
2502
|
-
function
|
|
2503
|
-
const r =
|
|
2502
|
+
function _o(e, t, n) {
|
|
2503
|
+
const r = se(e), o = se(t), s = se(n), i = Math.cbrt(j[0] * r + j[1] * o + j[2] * s), a = Math.cbrt(j[3] * r + j[4] * o + j[5] * s), c = Math.cbrt(j[6] * r + j[7] * o + j[8] * s);
|
|
2504
2504
|
return [
|
|
2505
2505
|
0.2104542553 * i + 0.793617785 * a - 0.0040720468 * c,
|
|
2506
2506
|
1.9779984951 * i - 2.428592205 * a + 0.4505937099 * c,
|
|
2507
2507
|
0.0259040371 * i + 0.7827717662 * a - 0.808675766 * c
|
|
2508
2508
|
];
|
|
2509
2509
|
}
|
|
2510
|
-
function
|
|
2510
|
+
function Po(e, t, n) {
|
|
2511
2511
|
if (e >= 0 && e <= 1 && t >= 0 && t <= 1 && n >= 0 && n <= 1)
|
|
2512
2512
|
return [e, t, n];
|
|
2513
|
-
const [r, o, s] =
|
|
2513
|
+
const [r, o, s] = _o(e, t, n), [i, a, c] = No(r, o, s), [l, p, u] = ze(i, a, c);
|
|
2514
2514
|
return [
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2515
|
+
ae(ie(l), 0, 1),
|
|
2516
|
+
ae(ie(p), 0, 1),
|
|
2517
|
+
ae(ie(u), 0, 1)
|
|
2518
2518
|
];
|
|
2519
2519
|
}
|
|
2520
|
-
const
|
|
2521
|
-
const t =
|
|
2520
|
+
const Ta = (e) => {
|
|
2521
|
+
const t = b[e], n = lr[e];
|
|
2522
2522
|
return Object.entries(t).reduce((r, [o, s]) => {
|
|
2523
2523
|
const i = n[o];
|
|
2524
2524
|
let { min: a, max: c } = s[i] ?? s.number;
|
|
2525
2525
|
return a = `${a}${i}`, c = `${c}${i}`, r[o] = { min: a, max: c }, r;
|
|
2526
2526
|
}, {});
|
|
2527
|
-
},
|
|
2527
|
+
}, Y = 16, Oo = (e) => {
|
|
2528
2528
|
if (e = e.slice(1), e.length <= 4) {
|
|
2529
|
-
const t = parseInt(e[0] + e[0],
|
|
2530
|
-
return new
|
|
2529
|
+
const t = parseInt(e[0] + e[0], Y), n = parseInt(e[1] + e[1], Y), r = parseInt(e[2] + e[2], Y), o = e[3] ? parseInt(e[3] + e[3], Y) / _ : 1;
|
|
2530
|
+
return new O(t, n, r, o);
|
|
2531
2531
|
} else {
|
|
2532
|
-
const t = parseInt(e.slice(0, 2),
|
|
2533
|
-
return new
|
|
2532
|
+
const t = parseInt(e.slice(0, 2), Y), n = parseInt(e.slice(2, 4), Y), r = parseInt(e.slice(4, 6), Y), o = e.length === 8 ? parseInt(e.slice(6, 8), Y) / _ : 1;
|
|
2533
|
+
return new O(t, n, r, o);
|
|
2534
2534
|
}
|
|
2535
|
-
},
|
|
2535
|
+
}, Ea = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
2536
2536
|
const o = (s) => {
|
|
2537
|
-
const i = s.toString(
|
|
2537
|
+
const i = s.toString(Y);
|
|
2538
2538
|
return i.length === 1 ? "0" + i : i;
|
|
2539
2539
|
};
|
|
2540
|
-
return `#${o(e)}${o(t)}${o(n)}${r < 1 ? o(Math.round(r *
|
|
2541
|
-
},
|
|
2542
|
-
e =
|
|
2540
|
+
return `#${o(e)}${o(t)}${o(n)}${r < 1 ? o(Math.round(r * _)) : ""}`;
|
|
2541
|
+
}, gr = 1e3, wr = 4e4, kr = 100, Sr = ({ kelvin: e, alpha: t }) => {
|
|
2542
|
+
e = v(e, gr, wr) / kr;
|
|
2543
2543
|
let n, r, o;
|
|
2544
|
-
return e <= 66 ? n =
|
|
2545
|
-
},
|
|
2546
|
-
e =
|
|
2544
|
+
return e <= 66 ? n = _ : (n = e - 60, n = 329.698727446 * n ** -0.1332047592), n = v(n, 0, _) / _, e <= 66 ? (r = e, r = 99.4708025861 * Math.log(r) - 161.1195681661) : (r = e - 60, r = 288.1221695283 * r ** -0.0755148492), r = v(r, 0, _) / _, e >= 66 ? o = _ : e <= 19 ? o = 0 : (o = e - 10, o = 138.5177312231 * Math.log(o) - 305.0447927307), o = v(o, 0, _) / _, new O(n, r, o, t);
|
|
2545
|
+
}, Lo = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
2546
|
+
e = v(e * _, 0, _), t = v(t * _, 0, _), n = v(n * _, 0, _);
|
|
2547
2547
|
let o;
|
|
2548
|
-
if (n ===
|
|
2548
|
+
if (n === _ ? o = 6600 : n === 0 ? o = 1900 : o = Math.exp((n + 305.0447927307) / 138.5177312231) + 10, e < _) {
|
|
2549
2549
|
const i = (329.698727446 / e) ** -7.507239275877164 + 60;
|
|
2550
2550
|
o = Math.max(o, i);
|
|
2551
2551
|
}
|
|
2552
2552
|
const s = o <= 6600 ? Math.exp((t + 161.1195681661) / 99.4708025861) : (288.1221695283 / t) ** (1 / -0.0755148492) + 60;
|
|
2553
|
-
return o = (o + s) / 2, o =
|
|
2554
|
-
},
|
|
2553
|
+
return o = (o + s) / 2, o = v(Math.round(o * kr), gr, wr), new nr(o, r);
|
|
2554
|
+
}, yr = ({ h: e, s: t, v: n, alpha: r }) => {
|
|
2555
2555
|
const o = n - n * t / 2;
|
|
2556
2556
|
let s;
|
|
2557
|
-
return o === 0 || o === 1 ? s = 0 : s = (n - o) / Math.min(o, 1 - o), new
|
|
2558
|
-
},
|
|
2557
|
+
return o === 0 || o === 1 ? s = 0 : s = (n - o) / Math.min(o, 1 - o), new yt(e, s, o, r);
|
|
2558
|
+
}, Cr = ({ h: e, s: t, l: n, alpha: r }) => {
|
|
2559
2559
|
const o = n + t * Math.min(n, 1 - n);
|
|
2560
2560
|
let s;
|
|
2561
|
-
return o === 0 ? s = 0 : s = 2 * (1 - n / o), new
|
|
2562
|
-
},
|
|
2561
|
+
return o === 0 ? s = 0 : s = 2 * (1 - n / o), new Te(e, s, o, r);
|
|
2562
|
+
}, zo = ({ h: e, w: t, b: n, alpha: r }) => {
|
|
2563
2563
|
let o, s;
|
|
2564
2564
|
const i = t + n;
|
|
2565
|
-
return i >= 1 ? (s = t / i, o = 0) : (s = 1 - n, o = s === 0 ? 0 : 1 - t / s),
|
|
2566
|
-
},
|
|
2567
|
-
const { h: o, s, v: i } =
|
|
2568
|
-
return new
|
|
2569
|
-
},
|
|
2565
|
+
return i >= 1 ? (s = t / i, o = 0) : (s = 1 - n, o = s === 0 ? 0 : 1 - t / s), yr(new Te(e, o, s, r));
|
|
2566
|
+
}, $o = ({ h: e, s: t, l: n, alpha: r }) => {
|
|
2567
|
+
const { h: o, s, v: i } = Cr(new yt(e, t, n, r));
|
|
2568
|
+
return new Ee(o, i * (1 - s), 1 - i, r);
|
|
2569
|
+
}, xr = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
2570
2570
|
const o = Math.max(e, t, n), s = Math.min(e, t, n);
|
|
2571
2571
|
let [i, a, c] = [0, 0, (o + s) / 2];
|
|
2572
2572
|
const l = o - s;
|
|
@@ -2581,73 +2581,73 @@ const Js = (e) => {
|
|
|
2581
2581
|
i = (e - t) / l + 4;
|
|
2582
2582
|
break;
|
|
2583
2583
|
}
|
|
2584
|
-
return i /= 6, a < 0 && (i = (i + 0.5) % 1, a = Math.abs(a) % 1), i >= 1 && (i -= 1), new
|
|
2584
|
+
return i /= 6, a < 0 && (i = (i + 0.5) % 1, a = Math.abs(a) % 1), i >= 1 && (i -= 1), new yt(i, a, c, r);
|
|
2585
2585
|
};
|
|
2586
|
-
function
|
|
2586
|
+
function Fo({ h: e, s: t, l: n, alpha: r }) {
|
|
2587
2587
|
const o = (1 - Math.abs(2 * n - 1)) * t, s = o * (1 - Math.abs(e * 6 % 2 - 1)), i = n - o / 2;
|
|
2588
2588
|
let a, c, l;
|
|
2589
|
-
return e < 1 / 6 ? [a, c, l] = [o, s, 0] : e < 2 / 6 ? [a, c, l] = [s, o, 0] : e < 3 / 6 ? [a, c, l] = [0, o, s] : e < 4 / 6 ? [a, c, l] = [0, s, o] : e < 5 / 6 ? [a, c, l] = [s, 0, o] : [a, c, l] = [o, 0, s], new
|
|
2589
|
+
return e < 1 / 6 ? [a, c, l] = [o, s, 0] : e < 2 / 6 ? [a, c, l] = [s, o, 0] : e < 3 / 6 ? [a, c, l] = [0, o, s] : e < 4 / 6 ? [a, c, l] = [0, s, o] : e < 5 / 6 ? [a, c, l] = [s, 0, o] : [a, c, l] = [o, 0, s], new O(a + i, c + i, l + i, r);
|
|
2590
2590
|
}
|
|
2591
|
-
const
|
|
2592
|
-
function
|
|
2591
|
+
const Go = 216 / 24389, Uo = 24 / 116, ge = 24389 / 27, Do = 8, It = 16, Rt = 116, Tr = 500, Er = 200;
|
|
2592
|
+
function Vo(e) {
|
|
2593
2593
|
if (e.whitePoint === "D50") return [e.x, e.y, e.z];
|
|
2594
|
-
if (e.whitePoint === "D65") return
|
|
2594
|
+
if (e.whitePoint === "D65") return N([e.x, e.y, e.z], Oe);
|
|
2595
2595
|
throw new Error(`Unsupported white point: ${e.whitePoint}`);
|
|
2596
2596
|
}
|
|
2597
|
-
function
|
|
2597
|
+
function Xo(e) {
|
|
2598
2598
|
if (e.whitePoint === "D65") return [e.x, e.y, e.z];
|
|
2599
|
-
if (e.whitePoint === "D50") return
|
|
2599
|
+
if (e.whitePoint === "D50") return N([e.x, e.y, e.z], ur);
|
|
2600
2600
|
throw new Error(`Unsupported white point: ${e.whitePoint}`);
|
|
2601
2601
|
}
|
|
2602
|
-
function
|
|
2603
|
-
const n = (
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2602
|
+
function $e(e, t = "D50") {
|
|
2603
|
+
const n = (E) => E > Go ? Math.cbrt(E) : (ge * E + It) / Rt, r = pr[t], [o, s, i] = Vo(e), a = o / r[0], c = s / r[1], l = i / r[2], p = n(a), u = n(c), f = n(l), C = Rt * u - It, y = Tr * (p - u), T = Er * (u - f), w = new Wt(
|
|
2604
|
+
R(
|
|
2605
|
+
C,
|
|
2606
|
+
b.lab.l.number.min,
|
|
2607
|
+
b.lab.l.number.max
|
|
2608
2608
|
),
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2609
|
+
R(
|
|
2610
|
+
y,
|
|
2611
|
+
b.lab.a.number.min,
|
|
2612
|
+
b.lab.a.number.max
|
|
2613
2613
|
),
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2614
|
+
R(
|
|
2615
|
+
T,
|
|
2616
|
+
b.lab.b.number.min,
|
|
2617
|
+
b.lab.b.number.max
|
|
2618
2618
|
),
|
|
2619
2619
|
e.alpha
|
|
2620
2620
|
);
|
|
2621
|
-
return
|
|
2621
|
+
return w.whitePoint = t, w;
|
|
2622
2622
|
}
|
|
2623
|
-
function
|
|
2624
|
-
const t = (
|
|
2623
|
+
function Fe(e) {
|
|
2624
|
+
const t = (A) => A > Uo ? A ** 3 : (Rt * A - It) / ge, n = (A) => A > Do ? ((A + It) / Rt) ** 3 : A / ge, r = pr[e.whitePoint];
|
|
2625
2625
|
let { l: o, a: s, b: i, alpha: a } = e;
|
|
2626
|
-
o =
|
|
2626
|
+
o = R(
|
|
2627
2627
|
o,
|
|
2628
2628
|
0,
|
|
2629
2629
|
1,
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
), s =
|
|
2630
|
+
b.lab.l.number.min,
|
|
2631
|
+
b.lab.l.number.max
|
|
2632
|
+
), s = R(
|
|
2633
2633
|
s,
|
|
2634
2634
|
0,
|
|
2635
2635
|
1,
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
), i =
|
|
2636
|
+
b.lab.a.number.min,
|
|
2637
|
+
b.lab.a.number.max
|
|
2638
|
+
), i = R(
|
|
2639
2639
|
i,
|
|
2640
2640
|
0,
|
|
2641
2641
|
1,
|
|
2642
|
-
|
|
2643
|
-
|
|
2642
|
+
b.lab.b.number.min,
|
|
2643
|
+
b.lab.b.number.max
|
|
2644
2644
|
);
|
|
2645
|
-
const c = (o +
|
|
2646
|
-
let
|
|
2647
|
-
const
|
|
2648
|
-
return
|
|
2645
|
+
const c = (o + It) / Rt, l = s / Tr + c, p = c - i / Er, [u, f, C] = [t(l), n(o), t(p)];
|
|
2646
|
+
let y = u * r[0], T = f * r[1], w = C * r[2];
|
|
2647
|
+
const E = new U(y, T, w, a);
|
|
2648
|
+
return E.whitePoint = e.whitePoint, [y, T, w] = Xo(E), E.whitePoint = "D65", E.x = y, E.y = T, E.z = w, E;
|
|
2649
2649
|
}
|
|
2650
|
-
const
|
|
2650
|
+
const Ge = [
|
|
2651
2651
|
0.41239079926595934,
|
|
2652
2652
|
0.357584339383878,
|
|
2653
2653
|
0.1804807884018343,
|
|
@@ -2657,221 +2657,221 @@ const Ee = [
|
|
|
2657
2657
|
0.01933081871559182,
|
|
2658
2658
|
0.11919477979462598,
|
|
2659
2659
|
0.9505321522496607
|
|
2660
|
-
],
|
|
2661
|
-
function
|
|
2660
|
+
], Ar = nt(Ge), Mr = 2.4, Ut = 0.055, Ue = 12.92, Wo = 0.04045, Ir = Wo / Ue;
|
|
2661
|
+
function wt(e) {
|
|
2662
2662
|
const t = e < 0 ? -1 : 1, n = e * t;
|
|
2663
|
-
return n <=
|
|
2663
|
+
return n <= Ir ? e / Ue : t * ((n + Ut) / (1 + Ut)) ** Mr;
|
|
2664
2664
|
}
|
|
2665
|
-
function
|
|
2665
|
+
function Rr(e) {
|
|
2666
2666
|
const t = e < 0 ? -1 : 1, n = e * t;
|
|
2667
|
-
return n <=
|
|
2667
|
+
return n <= Ir ? e * Ue : t * ((1 + Ut) * n ** (1 / Mr) - Ut);
|
|
2668
2668
|
}
|
|
2669
|
-
function
|
|
2670
|
-
const o = [
|
|
2671
|
-
return new
|
|
2669
|
+
function De({ r: e, g: t, b: n, alpha: r }) {
|
|
2670
|
+
const o = [wt(e), wt(t), wt(n)], [s, i, a] = N(o, Ge);
|
|
2671
|
+
return new U(s, i, a, r);
|
|
2672
2672
|
}
|
|
2673
|
-
const
|
|
2674
|
-
const s =
|
|
2673
|
+
const Ve = ({ x: e, y: t, z: n, alpha: r }, o = !0) => {
|
|
2674
|
+
const s = N([e, t, n], Ar), [i, a, c] = s.map(Rr);
|
|
2675
2675
|
if (o) {
|
|
2676
|
-
const l =
|
|
2677
|
-
return new
|
|
2676
|
+
const l = xs(new O(i, a, c, r));
|
|
2677
|
+
return new O(l.r, l.g, l.b, r);
|
|
2678
2678
|
} else
|
|
2679
|
-
return new
|
|
2679
|
+
return new O(i, a, c, r);
|
|
2680
2680
|
};
|
|
2681
|
-
function
|
|
2682
|
-
t =
|
|
2681
|
+
function Ho({ l: e, c: t, h: n, alpha: r }) {
|
|
2682
|
+
t = R(
|
|
2683
2683
|
t,
|
|
2684
2684
|
0,
|
|
2685
2685
|
1,
|
|
2686
|
-
|
|
2687
|
-
|
|
2686
|
+
b.lch.c.number.min,
|
|
2687
|
+
b.lch.c.number.max
|
|
2688
2688
|
);
|
|
2689
2689
|
const o = n * 2 * Math.PI, s = Math.cos(o) * t, i = Math.sin(o) * t;
|
|
2690
|
-
return new
|
|
2690
|
+
return new Wt(
|
|
2691
2691
|
e,
|
|
2692
|
-
|
|
2692
|
+
R(
|
|
2693
2693
|
s,
|
|
2694
|
-
|
|
2695
|
-
|
|
2694
|
+
b.lab.a.number.min,
|
|
2695
|
+
b.lab.a.number.max
|
|
2696
2696
|
),
|
|
2697
|
-
|
|
2697
|
+
R(
|
|
2698
2698
|
i,
|
|
2699
|
-
|
|
2700
|
-
|
|
2699
|
+
b.lab.b.number.min,
|
|
2700
|
+
b.lab.b.number.max
|
|
2701
2701
|
),
|
|
2702
2702
|
r
|
|
2703
2703
|
);
|
|
2704
2704
|
}
|
|
2705
|
-
function
|
|
2706
|
-
t =
|
|
2705
|
+
function jo({ l: e, a: t, b: n, alpha: r }) {
|
|
2706
|
+
t = R(
|
|
2707
2707
|
t,
|
|
2708
2708
|
0,
|
|
2709
2709
|
1,
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
), n =
|
|
2710
|
+
b.lab.a.number.min,
|
|
2711
|
+
b.lab.a.number.max
|
|
2712
|
+
), n = R(
|
|
2713
2713
|
n,
|
|
2714
2714
|
0,
|
|
2715
2715
|
1,
|
|
2716
|
-
|
|
2717
|
-
|
|
2716
|
+
b.lab.b.number.min,
|
|
2717
|
+
b.lab.b.number.max
|
|
2718
2718
|
);
|
|
2719
2719
|
const o = Math.hypot(t, n);
|
|
2720
2720
|
let s = Math.atan2(n, t) / (2 * Math.PI);
|
|
2721
|
-
return s < 0 && (s += 1), new
|
|
2721
|
+
return s < 0 && (s += 1), new Ae(
|
|
2722
2722
|
e,
|
|
2723
|
-
|
|
2723
|
+
R(
|
|
2724
2724
|
o,
|
|
2725
|
-
|
|
2726
|
-
|
|
2725
|
+
b.lch.c.number.min,
|
|
2726
|
+
b.lch.c.number.max
|
|
2727
2727
|
),
|
|
2728
2728
|
s,
|
|
2729
2729
|
r
|
|
2730
2730
|
);
|
|
2731
2731
|
}
|
|
2732
|
-
function
|
|
2733
|
-
t =
|
|
2732
|
+
function Xe({ l: e, a: t, b: n, alpha: r }) {
|
|
2733
|
+
t = R(
|
|
2734
2734
|
t,
|
|
2735
2735
|
0,
|
|
2736
2736
|
1,
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
), n =
|
|
2737
|
+
b.oklab.a.number.min,
|
|
2738
|
+
b.oklab.a.number.max
|
|
2739
|
+
), n = R(
|
|
2740
2740
|
n,
|
|
2741
2741
|
0,
|
|
2742
2742
|
1,
|
|
2743
|
-
|
|
2744
|
-
|
|
2743
|
+
b.oklab.b.number.min,
|
|
2744
|
+
b.oklab.b.number.max
|
|
2745
2745
|
);
|
|
2746
|
-
const o =
|
|
2747
|
-
return new
|
|
2746
|
+
const o = N([e, t, n], xo), s = [o[0] * o[0] * o[0], o[1] * o[1] * o[1], o[2] * o[2] * o[2]], [i, a, c] = N(s, Co);
|
|
2747
|
+
return new U(i, a, c, r);
|
|
2748
2748
|
}
|
|
2749
|
-
function
|
|
2750
|
-
const { x: t, y: n, z: r } = e, o =
|
|
2751
|
-
return new
|
|
2749
|
+
function We(e) {
|
|
2750
|
+
const { x: t, y: n, z: r } = e, o = N([t, n, r], mr), s = [Math.cbrt(o[0]), Math.cbrt(o[1]), Math.cbrt(o[2])], [i, a, c] = N(s, hr);
|
|
2751
|
+
return new Ht(
|
|
2752
2752
|
i,
|
|
2753
|
-
|
|
2753
|
+
R(
|
|
2754
2754
|
a,
|
|
2755
|
-
|
|
2756
|
-
|
|
2755
|
+
b.oklab.a.number.min,
|
|
2756
|
+
b.oklab.a.number.max
|
|
2757
2757
|
),
|
|
2758
|
-
|
|
2758
|
+
R(
|
|
2759
2759
|
c,
|
|
2760
|
-
|
|
2761
|
-
|
|
2760
|
+
b.oklab.b.number.min,
|
|
2761
|
+
b.oklab.b.number.max
|
|
2762
2762
|
),
|
|
2763
2763
|
e.alpha
|
|
2764
2764
|
);
|
|
2765
2765
|
}
|
|
2766
|
-
function
|
|
2767
|
-
const t =
|
|
2768
|
-
return
|
|
2766
|
+
function Yo(e) {
|
|
2767
|
+
const t = Xe(e);
|
|
2768
|
+
return $e(t);
|
|
2769
2769
|
}
|
|
2770
|
-
function
|
|
2771
|
-
const t =
|
|
2772
|
-
return
|
|
2770
|
+
function Zo(e) {
|
|
2771
|
+
const t = Fe(e);
|
|
2772
|
+
return We(t);
|
|
2773
2773
|
}
|
|
2774
|
-
function
|
|
2775
|
-
t =
|
|
2774
|
+
function vr({ l: e, a: t, b: n, alpha: r }) {
|
|
2775
|
+
t = R(t, 0, 1, b.oklab.a.number.min, b.oklab.a.number.max), n = R(n, 0, 1, b.oklab.b.number.min, b.oklab.b.number.max);
|
|
2776
2776
|
const o = Math.hypot(t, n);
|
|
2777
2777
|
let s = Math.atan2(n, t) / (2 * Math.PI);
|
|
2778
|
-
return s < 0 && (s += 1), new
|
|
2778
|
+
return s < 0 && (s += 1), new Me(
|
|
2779
2779
|
e,
|
|
2780
|
-
|
|
2780
|
+
R(o, b.oklch.c.number.min, b.oklch.c.number.max),
|
|
2781
2781
|
s,
|
|
2782
2782
|
r
|
|
2783
2783
|
);
|
|
2784
2784
|
}
|
|
2785
|
-
function
|
|
2786
|
-
t =
|
|
2785
|
+
function Br({ l: e, c: t, h: n, alpha: r }) {
|
|
2786
|
+
t = R(t, 0, 1, b.oklch.c.number.min, b.oklch.c.number.max);
|
|
2787
2787
|
const o = n * 2 * Math.PI, s = Math.cos(o) * t, i = Math.sin(o) * t;
|
|
2788
|
-
return new
|
|
2788
|
+
return new Ht(
|
|
2789
2789
|
e,
|
|
2790
|
-
|
|
2791
|
-
|
|
2790
|
+
R(s, b.oklab.a.number.min, b.oklab.a.number.max),
|
|
2791
|
+
R(i, b.oklab.b.number.min, b.oklab.b.number.max),
|
|
2792
2792
|
r
|
|
2793
2793
|
);
|
|
2794
2794
|
}
|
|
2795
|
-
function
|
|
2796
|
-
return
|
|
2795
|
+
function Aa(e) {
|
|
2796
|
+
return Yo(Br(e));
|
|
2797
2797
|
}
|
|
2798
|
-
function
|
|
2799
|
-
return
|
|
2798
|
+
function Ma(e) {
|
|
2799
|
+
return vr(Zo(e));
|
|
2800
2800
|
}
|
|
2801
|
-
function
|
|
2802
|
-
const t =
|
|
2803
|
-
return
|
|
2801
|
+
function He(e) {
|
|
2802
|
+
const t = Fo(e);
|
|
2803
|
+
return De(t);
|
|
2804
2804
|
}
|
|
2805
|
-
function
|
|
2806
|
-
const t =
|
|
2807
|
-
return
|
|
2805
|
+
function je(e) {
|
|
2806
|
+
const t = Ve(e);
|
|
2807
|
+
return xr(t);
|
|
2808
2808
|
}
|
|
2809
|
-
function
|
|
2810
|
-
const t =
|
|
2811
|
-
return
|
|
2809
|
+
function qo(e) {
|
|
2810
|
+
const t = yr(e);
|
|
2811
|
+
return He(t);
|
|
2812
2812
|
}
|
|
2813
|
-
function
|
|
2814
|
-
const t =
|
|
2815
|
-
return
|
|
2813
|
+
function Ko(e) {
|
|
2814
|
+
const t = je(e);
|
|
2815
|
+
return Cr(t);
|
|
2816
2816
|
}
|
|
2817
|
-
function
|
|
2818
|
-
const t =
|
|
2819
|
-
return
|
|
2817
|
+
function Jo(e) {
|
|
2818
|
+
const t = zo(e);
|
|
2819
|
+
return He(t);
|
|
2820
2820
|
}
|
|
2821
|
-
function
|
|
2822
|
-
const t =
|
|
2823
|
-
return
|
|
2821
|
+
function Qo(e) {
|
|
2822
|
+
const t = je(e);
|
|
2823
|
+
return $o(t);
|
|
2824
2824
|
}
|
|
2825
|
-
function
|
|
2826
|
-
const t =
|
|
2827
|
-
return
|
|
2825
|
+
function ts(e) {
|
|
2826
|
+
const t = Ho(e);
|
|
2827
|
+
return Fe(t);
|
|
2828
2828
|
}
|
|
2829
|
-
function
|
|
2830
|
-
const t =
|
|
2831
|
-
return
|
|
2829
|
+
function es(e) {
|
|
2830
|
+
const t = $e(e);
|
|
2831
|
+
return jo(t);
|
|
2832
2832
|
}
|
|
2833
|
-
function
|
|
2834
|
-
const t =
|
|
2835
|
-
return
|
|
2833
|
+
function ns(e) {
|
|
2834
|
+
const t = Br(e);
|
|
2835
|
+
return Xe(t);
|
|
2836
2836
|
}
|
|
2837
|
-
function
|
|
2838
|
-
const t =
|
|
2839
|
-
return
|
|
2837
|
+
function rs(e) {
|
|
2838
|
+
const t = We(e);
|
|
2839
|
+
return vr(t);
|
|
2840
2840
|
}
|
|
2841
|
-
function
|
|
2842
|
-
const t =
|
|
2843
|
-
return
|
|
2841
|
+
function os(e) {
|
|
2842
|
+
const t = Sr(e);
|
|
2843
|
+
return De(t);
|
|
2844
2844
|
}
|
|
2845
|
-
function
|
|
2846
|
-
const t =
|
|
2847
|
-
return
|
|
2845
|
+
function ss(e) {
|
|
2846
|
+
const t = Ve(e);
|
|
2847
|
+
return Lo(t);
|
|
2848
2848
|
}
|
|
2849
|
-
const
|
|
2850
|
-
function
|
|
2851
|
-
return (e < 0 ? -1 : 1) * Math.abs(e) **
|
|
2849
|
+
const Nr = 563 / 256;
|
|
2850
|
+
function ce(e) {
|
|
2851
|
+
return (e < 0 ? -1 : 1) * Math.abs(e) ** Nr;
|
|
2852
2852
|
}
|
|
2853
|
-
function
|
|
2854
|
-
return (e < 0 ? -1 : 1) * Math.abs(e) ** (1 /
|
|
2853
|
+
function is(e) {
|
|
2854
|
+
return (e < 0 ? -1 : 1) * Math.abs(e) ** (1 / Nr);
|
|
2855
2855
|
}
|
|
2856
|
-
const
|
|
2857
|
-
function
|
|
2856
|
+
const _r = 1 / 512, Pr = 1.8;
|
|
2857
|
+
function le(e) {
|
|
2858
2858
|
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
2859
|
-
return t * (n <=
|
|
2859
|
+
return t * (n <= _r * 16 ? n / 16 : n ** Pr);
|
|
2860
2860
|
}
|
|
2861
|
-
function
|
|
2861
|
+
function as(e) {
|
|
2862
2862
|
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
2863
|
-
return t * (n >=
|
|
2863
|
+
return t * (n >= _r ? n ** (1 / Pr) : n * 16);
|
|
2864
2864
|
}
|
|
2865
|
-
const
|
|
2866
|
-
function
|
|
2865
|
+
const Dt = 1.09929682680944, Or = 0.018053968510807;
|
|
2866
|
+
function ue(e) {
|
|
2867
2867
|
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
2868
|
-
return n <
|
|
2868
|
+
return n < Or * 4.5 ? t * n / 4.5 : t * ((n + Dt - 1) / Dt) ** (1 / 0.45);
|
|
2869
2869
|
}
|
|
2870
|
-
function
|
|
2870
|
+
function cs(e) {
|
|
2871
2871
|
const t = e < 0 ? -1 : 1, n = Math.abs(e);
|
|
2872
|
-
return n >=
|
|
2872
|
+
return n >= Or ? t * (Dt * n ** 0.45 - (Dt - 1)) : t * 4.5 * n;
|
|
2873
2873
|
}
|
|
2874
|
-
const
|
|
2874
|
+
const Lr = [
|
|
2875
2875
|
0.4865709486482162,
|
|
2876
2876
|
0.26566769316909306,
|
|
2877
2877
|
0.1982172852343625,
|
|
@@ -2881,7 +2881,7 @@ const Un = [
|
|
|
2881
2881
|
0,
|
|
2882
2882
|
0.04511338185890264,
|
|
2883
2883
|
1.043944368900976
|
|
2884
|
-
],
|
|
2884
|
+
], ls = nt(Lr), zr = [
|
|
2885
2885
|
0.5766690429101305,
|
|
2886
2886
|
0.1855582379065463,
|
|
2887
2887
|
0.1882286462349947,
|
|
@@ -2891,7 +2891,7 @@ const Un = [
|
|
|
2891
2891
|
0.02703136138641234,
|
|
2892
2892
|
0.07068885253582723,
|
|
2893
2893
|
0.9913375368376388
|
|
2894
|
-
],
|
|
2894
|
+
], us = nt(zr), $r = [
|
|
2895
2895
|
0.7977604896723027,
|
|
2896
2896
|
0.13518583717574031,
|
|
2897
2897
|
0.0313493495815248,
|
|
@@ -2901,7 +2901,7 @@ const Un = [
|
|
|
2901
2901
|
0,
|
|
2902
2902
|
0,
|
|
2903
2903
|
0.8251046025104602
|
|
2904
|
-
],
|
|
2904
|
+
], ps = nt($r), Fr = [
|
|
2905
2905
|
0.6369580483012914,
|
|
2906
2906
|
0.14461690358620832,
|
|
2907
2907
|
0.1688809751641721,
|
|
@@ -2911,90 +2911,90 @@ const Un = [
|
|
|
2911
2911
|
0,
|
|
2912
2912
|
0.028072693049087428,
|
|
2913
2913
|
1.0609850577107909
|
|
2914
|
-
],
|
|
2915
|
-
function
|
|
2916
|
-
const [o, s, i] =
|
|
2917
|
-
return new
|
|
2918
|
-
}
|
|
2919
|
-
function
|
|
2920
|
-
const [o, s, i] =
|
|
2921
|
-
return new
|
|
2922
|
-
}
|
|
2923
|
-
function
|
|
2924
|
-
const o = [
|
|
2925
|
-
return new
|
|
2926
|
-
}
|
|
2927
|
-
function
|
|
2928
|
-
const o =
|
|
2929
|
-
return new
|
|
2930
|
-
}
|
|
2931
|
-
function
|
|
2932
|
-
const o = [
|
|
2933
|
-
return new
|
|
2934
|
-
}
|
|
2935
|
-
function
|
|
2936
|
-
const o =
|
|
2937
|
-
return new
|
|
2938
|
-
}
|
|
2939
|
-
function
|
|
2940
|
-
const o = [
|
|
2941
|
-
return new
|
|
2942
|
-
}
|
|
2943
|
-
function
|
|
2944
|
-
const o =
|
|
2945
|
-
return new
|
|
2946
|
-
}
|
|
2947
|
-
function
|
|
2948
|
-
const o = [
|
|
2949
|
-
return new
|
|
2950
|
-
}
|
|
2951
|
-
function
|
|
2952
|
-
const o =
|
|
2953
|
-
return new
|
|
2954
|
-
}
|
|
2955
|
-
const
|
|
2956
|
-
rgb: { to:
|
|
2957
|
-
hsl: { to:
|
|
2958
|
-
hsv: { to:
|
|
2959
|
-
hwb: { to:
|
|
2960
|
-
lab: { to:
|
|
2961
|
-
lch: { to:
|
|
2962
|
-
oklab: { to:
|
|
2963
|
-
oklch: { to:
|
|
2964
|
-
kelvin: { to:
|
|
2914
|
+
], ms = nt(Fr);
|
|
2915
|
+
function hs({ r: e, g: t, b: n, alpha: r }) {
|
|
2916
|
+
const [o, s, i] = N([e, t, n], Ge);
|
|
2917
|
+
return new U(o, s, i, r);
|
|
2918
|
+
}
|
|
2919
|
+
function fs({ x: e, y: t, z: n, alpha: r }) {
|
|
2920
|
+
const [o, s, i] = N([e, t, n], Ar);
|
|
2921
|
+
return new Ie(o, s, i, r);
|
|
2922
|
+
}
|
|
2923
|
+
function bs({ r: e, g: t, b: n, alpha: r }) {
|
|
2924
|
+
const o = [wt(e), wt(t), wt(n)], [s, i, a] = N(o, Lr);
|
|
2925
|
+
return new U(s, i, a, r);
|
|
2926
|
+
}
|
|
2927
|
+
function ds({ x: e, y: t, z: n, alpha: r }) {
|
|
2928
|
+
const o = N([e, t, n], ls), [s, i, a] = o.map(Rr);
|
|
2929
|
+
return new Re(s, i, a, r);
|
|
2930
|
+
}
|
|
2931
|
+
function gs({ r: e, g: t, b: n, alpha: r }) {
|
|
2932
|
+
const o = [ce(e), ce(t), ce(n)], [s, i, a] = N(o, zr);
|
|
2933
|
+
return new U(s, i, a, r);
|
|
2934
|
+
}
|
|
2935
|
+
function ws({ x: e, y: t, z: n, alpha: r }) {
|
|
2936
|
+
const o = N([e, t, n], us), [s, i, a] = o.map(is);
|
|
2937
|
+
return new ve(s, i, a, r);
|
|
2938
|
+
}
|
|
2939
|
+
function ks({ r: e, g: t, b: n, alpha: r }) {
|
|
2940
|
+
const o = [le(e), le(t), le(n)], s = N(o, $r), [i, a, c] = N(s, ur);
|
|
2941
|
+
return new U(i, a, c, r);
|
|
2942
|
+
}
|
|
2943
|
+
function Ss({ x: e, y: t, z: n, alpha: r }) {
|
|
2944
|
+
const o = N([e, t, n], Oe), s = N(o, ps), [i, a, c] = s.map(as);
|
|
2945
|
+
return new Be(i, a, c, r);
|
|
2946
|
+
}
|
|
2947
|
+
function ys({ r: e, g: t, b: n, alpha: r }) {
|
|
2948
|
+
const o = [ue(e), ue(t), ue(n)], [s, i, a] = N(o, Fr);
|
|
2949
|
+
return new U(s, i, a, r);
|
|
2950
|
+
}
|
|
2951
|
+
function Cs({ x: e, y: t, z: n, alpha: r }) {
|
|
2952
|
+
const o = N([e, t, n], ms), [s, i, a] = o.map(cs);
|
|
2953
|
+
return new Ne(s, i, a, r);
|
|
2954
|
+
}
|
|
2955
|
+
const gn = {
|
|
2956
|
+
rgb: { to: De, from: Ve },
|
|
2957
|
+
hsl: { to: He, from: je },
|
|
2958
|
+
hsv: { to: qo, from: Ko },
|
|
2959
|
+
hwb: { to: Jo, from: Qo },
|
|
2960
|
+
lab: { to: Fe, from: $e },
|
|
2961
|
+
lch: { to: ts, from: es },
|
|
2962
|
+
oklab: { to: Xe, from: We },
|
|
2963
|
+
oklch: { to: ns, from: rs },
|
|
2964
|
+
kelvin: { to: os, from: ss },
|
|
2965
2965
|
xyz: { to: (e) => e, from: (e) => e },
|
|
2966
|
-
"srgb-linear": { to:
|
|
2967
|
-
"display-p3": { to:
|
|
2968
|
-
"a98-rgb": { to:
|
|
2969
|
-
"prophoto-rgb": { to:
|
|
2970
|
-
rec2020: { to:
|
|
2966
|
+
"srgb-linear": { to: hs, from: fs },
|
|
2967
|
+
"display-p3": { to: bs, from: ds },
|
|
2968
|
+
"a98-rgb": { to: gs, from: ws },
|
|
2969
|
+
"prophoto-rgb": { to: ks, from: Ss },
|
|
2970
|
+
rec2020: { to: ys, from: Cs }
|
|
2971
2971
|
};
|
|
2972
|
-
function
|
|
2972
|
+
function pt(e, t) {
|
|
2973
2973
|
if (e.colorSpace === t)
|
|
2974
2974
|
return e;
|
|
2975
|
-
const n =
|
|
2975
|
+
const n = gn[e.colorSpace].to, r = n(e), o = gn[t].from;
|
|
2976
2976
|
return o(r);
|
|
2977
2977
|
}
|
|
2978
|
-
const
|
|
2979
|
-
function
|
|
2980
|
-
const t =
|
|
2978
|
+
const ft = 1e-6;
|
|
2979
|
+
function xs(e) {
|
|
2980
|
+
const t = pt(e, "rgb"), n = Number.isNaN(t.r) ? 0 : t.r, r = Number.isNaN(t.g) ? 0 : t.g, o = Number.isNaN(t.b) ? 0 : t.b;
|
|
2981
2981
|
if (n >= 0 && n <= 1 && r >= 0 && r <= 1 && o >= 0 && o <= 1)
|
|
2982
2982
|
return e;
|
|
2983
|
-
if (n >= -
|
|
2984
|
-
const l = new
|
|
2985
|
-
return
|
|
2983
|
+
if (n >= -ft && n <= 1 + ft && r >= -ft && r <= 1 + ft && o >= -ft && o <= 1 + ft) {
|
|
2984
|
+
const l = new O(v(n, 0, 1), v(r, 0, 1), v(o, 0, 1), e.alpha);
|
|
2985
|
+
return pt(l, e.colorSpace);
|
|
2986
2986
|
}
|
|
2987
|
-
const [s, i, a] =
|
|
2988
|
-
return
|
|
2987
|
+
const [s, i, a] = Po(n, r, o), c = new O(s, i, a, e.alpha);
|
|
2988
|
+
return pt(c, e.colorSpace);
|
|
2989
2989
|
}
|
|
2990
|
-
const
|
|
2990
|
+
const Ts = {
|
|
2991
2991
|
hsl: "h",
|
|
2992
2992
|
hsv: "h",
|
|
2993
2993
|
hwb: "h",
|
|
2994
2994
|
lch: "h",
|
|
2995
2995
|
oklch: "h"
|
|
2996
2996
|
};
|
|
2997
|
-
function
|
|
2997
|
+
function Es(e, t, n, r = "shorter") {
|
|
2998
2998
|
if (Number.isNaN(e) && Number.isNaN(t)) return 0;
|
|
2999
2999
|
if (Number.isNaN(e)) return t;
|
|
3000
3000
|
if (Number.isNaN(t)) return e;
|
|
@@ -3016,40 +3016,40 @@ function Ao(e, t, n, r = "shorter") {
|
|
|
3016
3016
|
let s = e + n * (t - e);
|
|
3017
3017
|
return s = (s % 1 + 1) % 1, s;
|
|
3018
3018
|
}
|
|
3019
|
-
function
|
|
3020
|
-
const i =
|
|
3019
|
+
function As(e, t, n, r, o = "oklab", s = "shorter") {
|
|
3020
|
+
const i = pt(e, o), a = pt(t, o);
|
|
3021
3021
|
n < 0 && (n = 0), r < 0 && (r = 0);
|
|
3022
3022
|
const c = n + r;
|
|
3023
3023
|
c === 0 ? (n = 0.5, r = 0.5) : c !== 1 && (n = n / c, r = r / c);
|
|
3024
|
-
const l = Math.min(c, 1),
|
|
3025
|
-
for (const
|
|
3026
|
-
let
|
|
3027
|
-
if (Number.isNaN(
|
|
3028
|
-
|
|
3024
|
+
const l = Math.min(c, 1), p = Ts[o], u = i.keys().filter((A) => A !== "alpha"), f = Number.isNaN(i.alpha) ? a.alpha : i.alpha, C = Number.isNaN(a.alpha) ? i.alpha : a.alpha, y = de(r, f, C) * l, T = [];
|
|
3025
|
+
for (const A of u) {
|
|
3026
|
+
let L = i[A], X = a[A];
|
|
3027
|
+
if (Number.isNaN(L) && Number.isNaN(X)) {
|
|
3028
|
+
T.push(0);
|
|
3029
3029
|
continue;
|
|
3030
3030
|
}
|
|
3031
|
-
if (Number.isNaN(
|
|
3032
|
-
|
|
3031
|
+
if (Number.isNaN(L) && (L = X), Number.isNaN(X) && (X = L), A === p)
|
|
3032
|
+
T.push(Es(L, X, r, s));
|
|
3033
3033
|
else {
|
|
3034
|
-
const
|
|
3035
|
-
|
|
3034
|
+
const ot = L * f, st = X * C, it = de(r, ot, st);
|
|
3035
|
+
T.push(y > 0 ? it / y : 0);
|
|
3036
3036
|
}
|
|
3037
3037
|
}
|
|
3038
|
-
const
|
|
3039
|
-
return new
|
|
3038
|
+
const w = i.constructor;
|
|
3039
|
+
return new w(...T, y);
|
|
3040
3040
|
}
|
|
3041
|
-
const
|
|
3042
|
-
const r =
|
|
3041
|
+
const Ms = (e, t, n) => {
|
|
3042
|
+
const r = b[t][n];
|
|
3043
3043
|
return r[e] ?? r.number;
|
|
3044
|
-
},
|
|
3045
|
-
t = o ?
|
|
3046
|
-
const { min: s, max: i } =
|
|
3047
|
-
return new
|
|
3048
|
-
},
|
|
3044
|
+
}, Is = (e, t, n, r, o = !1) => {
|
|
3045
|
+
t = o ? lr[n][r] : t;
|
|
3046
|
+
const { min: s, max: i } = Ms(t, n, r), [a, c, l, p] = o ? [s, i, 0, 1] : [0, 1, s, i], u = R(e, l, p, a, c);
|
|
3047
|
+
return new S(u, o ? t : "");
|
|
3048
|
+
}, Rs = (e, t = !1) => {
|
|
3049
3049
|
const n = e.colorSpace;
|
|
3050
3050
|
return e.keys().forEach((r) => {
|
|
3051
|
-
const o = e[r] instanceof
|
|
3052
|
-
e[r] =
|
|
3051
|
+
const o = e[r] instanceof S ? e[r].value : e[r];
|
|
3052
|
+
e[r] = Is(
|
|
3053
3053
|
o,
|
|
3054
3054
|
e[r]?.unit,
|
|
3055
3055
|
n,
|
|
@@ -3057,38 +3057,38 @@ const Ro = (e, t, n) => {
|
|
|
3057
3057
|
t
|
|
3058
3058
|
);
|
|
3059
3059
|
}), e;
|
|
3060
|
-
},
|
|
3060
|
+
}, we = (e, t = !1, n = !1) => {
|
|
3061
3061
|
e = n ? e : e.clone();
|
|
3062
|
-
const r =
|
|
3063
|
-
return n ? e : new
|
|
3064
|
-
},
|
|
3065
|
-
const s = n ? o ? e : e.clone() :
|
|
3062
|
+
const r = Rs(e.value, t);
|
|
3063
|
+
return n ? e : new S(r).coalesce(e, !0);
|
|
3064
|
+
}, wn = (e, t = "lab", n = !1, r = !1, o = !1) => {
|
|
3065
|
+
const s = n ? o ? e : e.clone() : we(e, !1, o), i = pt(s.toJSON(), t);
|
|
3066
3066
|
return i.entries().forEach(([a, c]) => {
|
|
3067
|
-
i[a] = new
|
|
3068
|
-
}), s.value = i, s.superType[1] = t, r ?
|
|
3069
|
-
},
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
],
|
|
3067
|
+
i[a] = new S(c);
|
|
3068
|
+
}), s.value = i, s.superType[1] = t, r ? we(s, !0, !0) : s;
|
|
3069
|
+
}, vs = (e, t, n = "lab", r = !1, o = !1, s = !1) => [
|
|
3070
|
+
wn(e, n, r, o, s),
|
|
3071
|
+
wn(t, n, r, o, s)
|
|
3072
|
+
], G = (e) => new S(
|
|
3073
3073
|
e,
|
|
3074
3074
|
"color",
|
|
3075
3075
|
["color", e.colorSpace],
|
|
3076
3076
|
void 0,
|
|
3077
3077
|
"color"
|
|
3078
3078
|
);
|
|
3079
|
-
function
|
|
3080
|
-
const n =
|
|
3079
|
+
function ke(e) {
|
|
3080
|
+
const n = we(e).value, r = n.clone();
|
|
3081
3081
|
for (const o of n.keys()) {
|
|
3082
3082
|
const s = n[o];
|
|
3083
|
-
r[o] = s instanceof
|
|
3083
|
+
r[o] = s instanceof S ? s.value : s;
|
|
3084
3084
|
}
|
|
3085
3085
|
return r;
|
|
3086
3086
|
}
|
|
3087
|
-
function
|
|
3087
|
+
function Bs(e) {
|
|
3088
3088
|
const t = e.replace(/[^0-9.+\-*/() e]/g, "");
|
|
3089
3089
|
return new Function(`return (${t})`)();
|
|
3090
3090
|
}
|
|
3091
|
-
function
|
|
3091
|
+
function kn(e, t) {
|
|
3092
3092
|
switch (e.type) {
|
|
3093
3093
|
case "ref":
|
|
3094
3094
|
return t[e.name] ?? 0;
|
|
@@ -3101,32 +3101,32 @@ function rn(e, t) {
|
|
|
3101
3101
|
const r = Object.keys(t).sort((o, s) => s.length - o.length);
|
|
3102
3102
|
for (const o of r)
|
|
3103
3103
|
n = n.replace(new RegExp(`\\b${o}\\b`, "g"), String(t[o]));
|
|
3104
|
-
return
|
|
3104
|
+
return Bs(n);
|
|
3105
3105
|
}
|
|
3106
3106
|
}
|
|
3107
3107
|
}
|
|
3108
|
-
function
|
|
3109
|
-
const o =
|
|
3110
|
-
for (const [
|
|
3111
|
-
i[
|
|
3112
|
-
const a = n.map((
|
|
3113
|
-
rgb:
|
|
3114
|
-
hsl:
|
|
3115
|
-
hwb:
|
|
3116
|
-
lab:
|
|
3117
|
-
lch:
|
|
3118
|
-
oklab:
|
|
3119
|
-
oklch:
|
|
3120
|
-
xyz:
|
|
3121
|
-
"srgb-linear":
|
|
3122
|
-
"display-p3":
|
|
3123
|
-
"a98-rgb":
|
|
3124
|
-
"prophoto-rgb":
|
|
3125
|
-
rec2020:
|
|
3126
|
-
}[t] ??
|
|
3127
|
-
return
|
|
3128
|
-
}
|
|
3129
|
-
const
|
|
3108
|
+
function Ns(e, t, n, r) {
|
|
3109
|
+
const o = ke(e), s = pt(o, t), i = {};
|
|
3110
|
+
for (const [f, C] of s.entries())
|
|
3111
|
+
i[f] = C;
|
|
3112
|
+
const a = n.map((f) => kn(f, i)), c = r ? kn(r, i) : i.alpha ?? 1, p = {
|
|
3113
|
+
rgb: O,
|
|
3114
|
+
hsl: yt,
|
|
3115
|
+
hwb: Ee,
|
|
3116
|
+
lab: Wt,
|
|
3117
|
+
lch: Ae,
|
|
3118
|
+
oklab: Ht,
|
|
3119
|
+
oklch: Me,
|
|
3120
|
+
xyz: U,
|
|
3121
|
+
"srgb-linear": Ie,
|
|
3122
|
+
"display-p3": Re,
|
|
3123
|
+
"a98-rgb": ve,
|
|
3124
|
+
"prophoto-rgb": Be,
|
|
3125
|
+
rec2020: Ne
|
|
3126
|
+
}[t] ?? O, u = new p(...a, c);
|
|
3127
|
+
return G(u);
|
|
3128
|
+
}
|
|
3129
|
+
const _s = {
|
|
3130
3130
|
srgb: "rgb",
|
|
3131
3131
|
"srgb-linear": "srgb-linear",
|
|
3132
3132
|
"display-p3": "display-p3",
|
|
@@ -3142,352 +3142,352 @@ const Lo = {
|
|
|
3142
3142
|
xyz: "xyz",
|
|
3143
3143
|
"xyz-d65": "xyz",
|
|
3144
3144
|
"xyz-d50": "xyz"
|
|
3145
|
-
},
|
|
3146
|
-
srgb: { space: "rgb", ctor:
|
|
3147
|
-
"srgb-linear": { space: "srgb-linear", ctor:
|
|
3148
|
-
"display-p3": { space: "display-p3", ctor:
|
|
3149
|
-
"a98-rgb": { space: "a98-rgb", ctor:
|
|
3150
|
-
"prophoto-rgb": { space: "prophoto-rgb", ctor:
|
|
3151
|
-
rec2020: { space: "rec2020", ctor:
|
|
3152
|
-
xyz: { space: "xyz", ctor:
|
|
3153
|
-
"xyz-d65": { space: "xyz", ctor:
|
|
3154
|
-
"xyz-d50": { space: "xyz", ctor:
|
|
3155
|
-
},
|
|
3145
|
+
}, Ps = {
|
|
3146
|
+
srgb: { space: "rgb", ctor: O },
|
|
3147
|
+
"srgb-linear": { space: "srgb-linear", ctor: Ie },
|
|
3148
|
+
"display-p3": { space: "display-p3", ctor: Re },
|
|
3149
|
+
"a98-rgb": { space: "a98-rgb", ctor: ve },
|
|
3150
|
+
"prophoto-rgb": { space: "prophoto-rgb", ctor: Be },
|
|
3151
|
+
rec2020: { space: "rec2020", ctor: Ne },
|
|
3152
|
+
xyz: { space: "xyz", ctor: U },
|
|
3153
|
+
"xyz-d65": { space: "xyz", ctor: U },
|
|
3154
|
+
"xyz-d50": { space: "xyz", ctor: U }
|
|
3155
|
+
}, Os = B(","), Ls = D(/\s+/), Yt = B("/"), Zt = B("("), qt = B(")"), Vt = d(Os.trim(g), Ls), Gr = d(Yt.trim(g), Vt), W = x.lazy(() => d(
|
|
3156
3156
|
H.Percentage,
|
|
3157
3157
|
H.Angle.map((e) => {
|
|
3158
|
-
const t =
|
|
3159
|
-
return new
|
|
3158
|
+
const t = _e(e.value, e.unit);
|
|
3159
|
+
return new S(t, "deg", ["angle"]);
|
|
3160
3160
|
}),
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
)),
|
|
3161
|
+
d(et, go).map((e) => new S(e)),
|
|
3162
|
+
Pe.map(() => new S(NaN))
|
|
3163
|
+
)), Mt = d(
|
|
3164
3164
|
// calc(...)
|
|
3165
|
-
|
|
3166
|
-
|
|
3165
|
+
m("calc").next(
|
|
3166
|
+
D(/\(([^)]+)\)/, (e) => e?.[1] ?? null)
|
|
3167
3167
|
).map((e) => ({ type: "calc", expr: e })),
|
|
3168
3168
|
// none
|
|
3169
|
-
|
|
3169
|
+
Pe.map(() => ({ type: "none" })),
|
|
3170
3170
|
// component reference (alpha must be tried before single 'a')
|
|
3171
|
-
|
|
3171
|
+
D(/\b(alpha|r|g|b|h|s|l|c|w|a|x|y|z)\b/).map(
|
|
3172
3172
|
(e) => ({ type: "ref", name: e })
|
|
3173
3173
|
),
|
|
3174
3174
|
// literal number / percentage / angle
|
|
3175
3175
|
W.map((e) => ({ type: "literal", value: e.value }))
|
|
3176
|
-
),
|
|
3177
|
-
const t =
|
|
3178
|
-
|
|
3176
|
+
), q = (e) => {
|
|
3177
|
+
const t = B(e).skip(m("a").opt()), n = d(
|
|
3178
|
+
I(W.skip(Gr), W),
|
|
3179
3179
|
W.map((o) => [o])
|
|
3180
|
-
), r =
|
|
3181
|
-
W.skip(
|
|
3182
|
-
W.skip(
|
|
3180
|
+
), r = I(
|
|
3181
|
+
W.skip(Vt),
|
|
3182
|
+
W.skip(Vt),
|
|
3183
3183
|
n
|
|
3184
|
-
).trim(g).wrap(
|
|
3185
|
-
return t.next(r).map(([o, s, [i, a]]) => [o, s, i, a ?? new
|
|
3184
|
+
).trim(g).wrap(Zt, qt);
|
|
3185
|
+
return t.next(r).map(([o, s, [i, a]]) => [o, s, i, a ?? new S(1)]);
|
|
3186
3186
|
};
|
|
3187
|
-
function
|
|
3188
|
-
return
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
g.next(
|
|
3192
|
-
g.next(
|
|
3193
|
-
g.next(
|
|
3194
|
-
|
|
3195
|
-
).trim(g).wrap(
|
|
3196
|
-
).map(([n, r, o, s, i]) =>
|
|
3197
|
-
}
|
|
3198
|
-
const
|
|
3199
|
-
const { r: t, g: n, b: r, alpha: o } =
|
|
3200
|
-
return
|
|
3201
|
-
}),
|
|
3202
|
-
const t =
|
|
3203
|
-
return
|
|
3204
|
-
}),
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
([e, t, n, r]) =>
|
|
3187
|
+
function rt(e, t) {
|
|
3188
|
+
return B(e).skip(m("a").opt()).next(
|
|
3189
|
+
I(
|
|
3190
|
+
m("from").skip(g).next(x.lazy(() => Ye.Value)),
|
|
3191
|
+
g.next(Mt),
|
|
3192
|
+
g.next(Mt),
|
|
3193
|
+
g.next(Mt),
|
|
3194
|
+
Yt.trim(g).next(Mt).opt()
|
|
3195
|
+
).trim(g).wrap(Zt, qt)
|
|
3196
|
+
).map(([n, r, o, s, i]) => Ns(n, t, [r, o, s], i));
|
|
3197
|
+
}
|
|
3198
|
+
const zs = D(/#[0-9a-fA-F]{3,8}/).map((e) => {
|
|
3199
|
+
const { r: t, g: n, b: r, alpha: o } = Oo(e);
|
|
3200
|
+
return G(new O(t, n, r, o));
|
|
3201
|
+
}), $s = et.skip(m("k")).map((e) => {
|
|
3202
|
+
const t = Sr(new nr(e));
|
|
3203
|
+
return G(t);
|
|
3204
|
+
}), Fs = d(
|
|
3205
|
+
rt("rgb", "rgb"),
|
|
3206
|
+
q("rgb").map(
|
|
3207
|
+
([e, t, n, r]) => G(new O(e, t, n, r))
|
|
3208
3208
|
)
|
|
3209
|
-
),
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
([e, t, n, r]) =>
|
|
3209
|
+
), Gs = d(
|
|
3210
|
+
rt("hsl", "hsl"),
|
|
3211
|
+
q("hsl").map(
|
|
3212
|
+
([e, t, n, r]) => G(new yt(e, t, n, r))
|
|
3213
3213
|
)
|
|
3214
|
-
),
|
|
3215
|
-
([e, t, n, r]) =>
|
|
3216
|
-
),
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
([e, t, n, r]) =>
|
|
3214
|
+
), Us = q("hsv").map(
|
|
3215
|
+
([e, t, n, r]) => G(new Te(e, t, n, r))
|
|
3216
|
+
), Ds = d(
|
|
3217
|
+
rt("hwb", "hwb"),
|
|
3218
|
+
q("hwb").map(
|
|
3219
|
+
([e, t, n, r]) => G(new Ee(e, t, n, r))
|
|
3220
3220
|
)
|
|
3221
|
-
),
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
([e, t, n, r]) =>
|
|
3221
|
+
), Vs = d(
|
|
3222
|
+
rt("lab", "lab"),
|
|
3223
|
+
q("lab").map(
|
|
3224
|
+
([e, t, n, r]) => G(new Wt(e, t, n, r))
|
|
3225
3225
|
)
|
|
3226
|
-
),
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
([e, t, n, r]) =>
|
|
3226
|
+
), Xs = d(
|
|
3227
|
+
rt("lch", "lch"),
|
|
3228
|
+
q("lch").map(
|
|
3229
|
+
([e, t, n, r]) => G(new Ae(e, t, n, r))
|
|
3230
3230
|
)
|
|
3231
|
-
),
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
([e, t, n, r]) =>
|
|
3231
|
+
), Ws = d(
|
|
3232
|
+
rt("oklab", "oklab"),
|
|
3233
|
+
q("oklab").map(
|
|
3234
|
+
([e, t, n, r]) => G(new Ht(e, t, n, r))
|
|
3235
3235
|
)
|
|
3236
|
-
),
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
([e, t, n, r]) =>
|
|
3236
|
+
), Hs = d(
|
|
3237
|
+
rt("oklch", "oklch"),
|
|
3238
|
+
q("oklch").map(
|
|
3239
|
+
([e, t, n, r]) => G(new Me(e, t, n, r))
|
|
3240
3240
|
)
|
|
3241
|
-
),
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
([e, t, n, r]) =>
|
|
3241
|
+
), js = d(
|
|
3242
|
+
rt("xyz", "xyz"),
|
|
3243
|
+
q("xyz").map(
|
|
3244
|
+
([e, t, n, r]) => G(new U(e, t, n, r))
|
|
3245
3245
|
)
|
|
3246
|
-
),
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
),
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
).skip(g).skip(
|
|
3268
|
-
() =>
|
|
3269
|
-
|
|
3246
|
+
), Ys = d(
|
|
3247
|
+
m("srgb-linear").map(() => "srgb-linear"),
|
|
3248
|
+
m("srgb").map(() => "srgb"),
|
|
3249
|
+
m("display-p3").map(() => "display-p3"),
|
|
3250
|
+
m("a98-rgb").map(() => "a98-rgb"),
|
|
3251
|
+
m("prophoto-rgb").map(() => "prophoto-rgb"),
|
|
3252
|
+
m("rec2020").map(() => "rec2020"),
|
|
3253
|
+
m("oklab").map(() => "oklab"),
|
|
3254
|
+
m("oklch").map(() => "oklch"),
|
|
3255
|
+
m("lab").map(() => "lab"),
|
|
3256
|
+
m("lch").map(() => "lch"),
|
|
3257
|
+
m("hsl").map(() => "hsl"),
|
|
3258
|
+
m("hwb").map(() => "hwb"),
|
|
3259
|
+
m("xyz-d65").map(() => "xyz-d65"),
|
|
3260
|
+
m("xyz-d50").map(() => "xyz-d50"),
|
|
3261
|
+
m("xyz").map(() => "xyz")
|
|
3262
|
+
), Zs = d(
|
|
3263
|
+
m("shorter"),
|
|
3264
|
+
m("longer"),
|
|
3265
|
+
m("increasing"),
|
|
3266
|
+
m("decreasing")
|
|
3267
|
+
).skip(g).skip(m("hue")), Sn = x.lazy(
|
|
3268
|
+
() => I(
|
|
3269
|
+
Ye.Value,
|
|
3270
3270
|
g.next(H.Percentage).opt()
|
|
3271
3271
|
)
|
|
3272
|
-
),
|
|
3273
|
-
|
|
3272
|
+
), qs = m("color-mix").next(
|
|
3273
|
+
I(
|
|
3274
3274
|
// "in <space> [<hueMethod>]"
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
g.next(
|
|
3275
|
+
m("in").skip(g).next(
|
|
3276
|
+
I(
|
|
3277
|
+
Ys,
|
|
3278
|
+
g.next(Zs).opt()
|
|
3279
3279
|
)
|
|
3280
3280
|
),
|
|
3281
3281
|
// ", <color> [<pct>]?"
|
|
3282
|
-
|
|
3282
|
+
B(",").trim(g).next(Sn),
|
|
3283
3283
|
// ", <color> [<pct>]?"
|
|
3284
|
-
|
|
3285
|
-
).trim(g).wrap(
|
|
3284
|
+
B(",").trim(g).next(Sn)
|
|
3285
|
+
).trim(g).wrap(Zt, qt)
|
|
3286
3286
|
).map(([[e, t], [n, r], [o, s]]) => {
|
|
3287
|
-
const i =
|
|
3287
|
+
const i = _s[e] ?? "oklab", a = t ?? "shorter";
|
|
3288
3288
|
let c = r != null ? r.value / 100 : -1, l = s != null ? s.value / 100 : -1;
|
|
3289
3289
|
c < 0 && l < 0 ? (c = 0.5, l = 0.5) : c < 0 ? c = 1 - l : l < 0 && (l = 1 - c);
|
|
3290
|
-
const
|
|
3291
|
-
return
|
|
3292
|
-
}),
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
),
|
|
3303
|
-
|
|
3304
|
-
|
|
3290
|
+
const p = ke(n), u = ke(o), f = As(p, u, c, l, i, a);
|
|
3291
|
+
return G(f);
|
|
3292
|
+
}), Ks = d(
|
|
3293
|
+
m("srgb-linear").map(() => "srgb-linear"),
|
|
3294
|
+
m("srgb").map(() => "srgb"),
|
|
3295
|
+
m("display-p3").map(() => "display-p3"),
|
|
3296
|
+
m("a98-rgb").map(() => "a98-rgb"),
|
|
3297
|
+
m("prophoto-rgb").map(() => "prophoto-rgb"),
|
|
3298
|
+
m("rec2020").map(() => "rec2020"),
|
|
3299
|
+
m("xyz-d65").map(() => "xyz-d65"),
|
|
3300
|
+
m("xyz-d50").map(() => "xyz-d50"),
|
|
3301
|
+
m("xyz").map(() => "xyz")
|
|
3302
|
+
), Js = m("color").next(
|
|
3303
|
+
I(
|
|
3304
|
+
Ks.skip(g),
|
|
3305
3305
|
W.skip(g),
|
|
3306
3306
|
W.skip(g),
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
W.skip(
|
|
3307
|
+
d(
|
|
3308
|
+
I(
|
|
3309
|
+
W.skip(Yt.trim(g)),
|
|
3310
3310
|
W
|
|
3311
3311
|
),
|
|
3312
3312
|
W.map((e) => [e, void 0])
|
|
3313
3313
|
)
|
|
3314
|
-
).trim(g).wrap(
|
|
3314
|
+
).trim(g).wrap(Zt, qt)
|
|
3315
3315
|
).map(([e, t, n, [r, o]]) => {
|
|
3316
|
-
const s =
|
|
3316
|
+
const s = Ps[e];
|
|
3317
3317
|
if (!s)
|
|
3318
3318
|
throw new Error(`Unknown color() space: ${e}`);
|
|
3319
|
-
const i = o ?? new
|
|
3319
|
+
const i = o ?? new S(1);
|
|
3320
3320
|
if (e === "srgb") {
|
|
3321
3321
|
const c = (l) => l.value * 255;
|
|
3322
|
-
return
|
|
3322
|
+
return G(new O(c(t), c(n), c(r), i.value));
|
|
3323
3323
|
}
|
|
3324
3324
|
const a = new s.ctor(t, n, r, i);
|
|
3325
|
-
return
|
|
3326
|
-
}),
|
|
3327
|
-
...Object.keys(
|
|
3325
|
+
return G(a);
|
|
3326
|
+
}), Qs = d(
|
|
3327
|
+
...Object.keys(dn).sort((e, t) => t.length - e.length).map(m)
|
|
3328
3328
|
).chain((e) => {
|
|
3329
|
-
const t =
|
|
3329
|
+
const t = dn[e.toLowerCase()];
|
|
3330
3330
|
if (t) {
|
|
3331
|
-
const n =
|
|
3331
|
+
const n = Yr(t);
|
|
3332
3332
|
if (n)
|
|
3333
|
-
return
|
|
3334
|
-
}
|
|
3335
|
-
return
|
|
3336
|
-
}),
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
).trim(g),
|
|
3352
|
-
Value:
|
|
3333
|
+
return wo(n);
|
|
3334
|
+
}
|
|
3335
|
+
return ko();
|
|
3336
|
+
}), Ur = d(
|
|
3337
|
+
qs,
|
|
3338
|
+
Js,
|
|
3339
|
+
zs,
|
|
3340
|
+
$s,
|
|
3341
|
+
Fs,
|
|
3342
|
+
Gs,
|
|
3343
|
+
Us,
|
|
3344
|
+
Ds,
|
|
3345
|
+
Vs,
|
|
3346
|
+
Xs,
|
|
3347
|
+
Ws,
|
|
3348
|
+
Hs,
|
|
3349
|
+
js,
|
|
3350
|
+
Qs
|
|
3351
|
+
).trim(g), Ye = {
|
|
3352
|
+
Value: Ur,
|
|
3353
3353
|
colorValue: W,
|
|
3354
|
-
componentExpr:
|
|
3355
|
-
sep:
|
|
3356
|
-
alphaSep:
|
|
3357
|
-
div:
|
|
3354
|
+
componentExpr: Mt,
|
|
3355
|
+
sep: Vt,
|
|
3356
|
+
alphaSep: Gr,
|
|
3357
|
+
div: Yt
|
|
3358
3358
|
};
|
|
3359
|
-
function
|
|
3360
|
-
return
|
|
3359
|
+
function Ia(e) {
|
|
3360
|
+
return Bt(Ur, e);
|
|
3361
3361
|
}
|
|
3362
|
-
const
|
|
3362
|
+
const ti = d(...Pt.map(m)), ei = d(...Lt.map(m)), ni = d(...Ot.map(m)), ri = d(...zt.map(m)), oi = d(...er.map(m)), si = B(","), ii = B(" "), ai = d(si, ii).trim(g), Dr = I(et, ti).map(([e, t]) => {
|
|
3363
3363
|
const n = ["length"];
|
|
3364
|
-
return
|
|
3365
|
-
}),
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
).map(([e, t]) => new
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3364
|
+
return tr.includes(t) ? n.push("relative") : Qn.includes(t) && n.push("absolute"), new S(e, t, n);
|
|
3365
|
+
}), Vr = I(et, ei).map(([e, t]) => new S(e, t, ["angle"])), Ze = I(et, ni).map(([e, t]) => new S(e, t, ["time"])), ci = x.lazy(() => d(qe, Ze)), Xr = I(et, ri).map(([e, t]) => new S(e, t, ["resolution"])), qe = d(
|
|
3366
|
+
I(et, oi),
|
|
3367
|
+
m("from").map(() => [0, "%"]),
|
|
3368
|
+
m("to").map(() => [100, "%"])
|
|
3369
|
+
).map(([e, t]) => new S(e, t, ["percentage"])), Wr = x.lazy(() => Ye.Value), Hr = B("/").trim(g).map(() => new S("/", "string")), jr = d(
|
|
3370
|
+
Dr,
|
|
3371
|
+
Vr,
|
|
3372
|
+
Ze,
|
|
3373
|
+
Xr,
|
|
3374
|
+
qe,
|
|
3375
|
+
Wr,
|
|
3376
|
+
Hr,
|
|
3377
|
+
et.map((e) => new S(e)),
|
|
3378
|
+
Pe.map(() => new S(NaN))
|
|
3379
3379
|
).trim(g), H = {
|
|
3380
|
-
Length:
|
|
3381
|
-
Angle:
|
|
3382
|
-
Time:
|
|
3383
|
-
TimePercentage:
|
|
3384
|
-
Resolution:
|
|
3385
|
-
Percentage:
|
|
3386
|
-
Color:
|
|
3387
|
-
Slash:
|
|
3388
|
-
Value:
|
|
3389
|
-
sep:
|
|
3380
|
+
Length: Dr,
|
|
3381
|
+
Angle: Vr,
|
|
3382
|
+
Time: Ze,
|
|
3383
|
+
TimePercentage: ci,
|
|
3384
|
+
Resolution: Xr,
|
|
3385
|
+
Percentage: qe,
|
|
3386
|
+
Color: Wr,
|
|
3387
|
+
Slash: Hr,
|
|
3388
|
+
Value: jr,
|
|
3389
|
+
sep: ai
|
|
3390
3390
|
};
|
|
3391
|
-
function
|
|
3392
|
-
return
|
|
3393
|
-
}
|
|
3394
|
-
const
|
|
3395
|
-
() =>
|
|
3396
|
-
),
|
|
3397
|
-
e ||
|
|
3398
|
-
|
|
3399
|
-
),
|
|
3400
|
-
const e =
|
|
3401
|
-
return
|
|
3402
|
-
},
|
|
3403
|
-
const e =
|
|
3404
|
-
() =>
|
|
3405
|
-
|
|
3406
|
-
e.many(1).wrap(
|
|
3391
|
+
function Yr(e) {
|
|
3392
|
+
return Bt(jr, e);
|
|
3393
|
+
}
|
|
3394
|
+
const kt = B("("), St = B(")"), Se = B(","), Zr = x.lazy(
|
|
3395
|
+
() => Qe.sepBy(d(Se, g)).trim(g).map((e) => new vt(...e))
|
|
3396
|
+
), Ke = (e) => I(
|
|
3397
|
+
e || bo,
|
|
3398
|
+
Zr.wrap(kt, St)
|
|
3399
|
+
), li = () => {
|
|
3400
|
+
const e = D(/[^)]+/);
|
|
3401
|
+
return B("var").next(e.trim(g).wrap(kt, St)).map((t) => new S(t, "var"));
|
|
3402
|
+
}, ui = () => {
|
|
3403
|
+
const e = x.lazy(
|
|
3404
|
+
() => d(
|
|
3405
|
+
D(/[^()]+/),
|
|
3406
|
+
e.many(1).wrap(kt, St).map((t) => `(${t.join(" ")})`)
|
|
3407
3407
|
).many(1)
|
|
3408
3408
|
);
|
|
3409
|
-
return
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
e.wrap(
|
|
3409
|
+
return B("calc").next(
|
|
3410
|
+
d(
|
|
3411
|
+
x.lazy(() => Qe).trim(g).wrap(kt, St),
|
|
3412
|
+
e.wrap(kt, St).map((t) => t.join(" "))
|
|
3413
3413
|
)
|
|
3414
|
-
).map((t) => t instanceof
|
|
3415
|
-
},
|
|
3416
|
-
const e =
|
|
3417
|
-
|
|
3418
|
-
|
|
3414
|
+
).map((t) => t instanceof S ? t : new S(t, "calc"));
|
|
3415
|
+
}, pi = ["translate", "scale", "rotate", "skew"], ye = ["x", "y", "z"], mi = ye.map(m), hi = pi.map(m), fi = () => {
|
|
3416
|
+
const e = I(
|
|
3417
|
+
d(...hi),
|
|
3418
|
+
d(...mi, B(""))
|
|
3419
3419
|
), t = (r, o) => r + o.toUpperCase();
|
|
3420
|
-
return
|
|
3420
|
+
return Ke(e).map(([[r, o], s]) => {
|
|
3421
3421
|
const i = r.toLowerCase(), a = {};
|
|
3422
3422
|
if (o) {
|
|
3423
3423
|
const l = i + o.toUpperCase();
|
|
3424
3424
|
a[l] = s[0];
|
|
3425
|
-
} else s.length === 1 ?
|
|
3426
|
-
const
|
|
3427
|
-
a[
|
|
3428
|
-
}) : s.forEach((l,
|
|
3429
|
-
const u = t(i,
|
|
3425
|
+
} else s.length === 1 ? ye.forEach((l) => {
|
|
3426
|
+
const p = t(i, l);
|
|
3427
|
+
a[p] = s[0];
|
|
3428
|
+
}) : s.forEach((l, p) => {
|
|
3429
|
+
const u = t(i, ye[p]);
|
|
3430
3430
|
a[u] = l;
|
|
3431
3431
|
});
|
|
3432
|
-
const c = Object.entries(a).map(([l,
|
|
3433
|
-
return new
|
|
3432
|
+
const c = Object.entries(a).map(([l, p]) => new mt(l, [p]));
|
|
3433
|
+
return new vt(...c);
|
|
3434
3434
|
});
|
|
3435
|
-
},
|
|
3435
|
+
}, bi = {
|
|
3436
3436
|
left: "270",
|
|
3437
3437
|
right: "90",
|
|
3438
3438
|
top: "0",
|
|
3439
3439
|
bottom: "180"
|
|
3440
|
-
},
|
|
3441
|
-
const e =
|
|
3442
|
-
|
|
3443
|
-
|
|
3440
|
+
}, di = () => {
|
|
3441
|
+
const e = d(...["linear-gradient", "radial-gradient"].map(m)), t = I(
|
|
3442
|
+
B("to").skip(g),
|
|
3443
|
+
d(...["left", "right", "top", "bottom"].map(m))
|
|
3444
3444
|
).map(([, a]) => {
|
|
3445
|
-
const c =
|
|
3446
|
-
return new
|
|
3447
|
-
}), n =
|
|
3445
|
+
const c = bi[a.toLowerCase()];
|
|
3446
|
+
return new S(c, "deg");
|
|
3447
|
+
}), n = d(H.Angle, t), r = d(H.Length, H.Percentage), o = I(
|
|
3448
3448
|
H.Color,
|
|
3449
3449
|
r.sepBy(g)
|
|
3450
|
-
).map(([a, c]) => !c || c.length === 0 ? [a] : [a, ...c]), s =
|
|
3450
|
+
).map(([a, c]) => !c || c.length === 0 ? [a] : [a, ...c]), s = I(
|
|
3451
3451
|
o,
|
|
3452
|
-
|
|
3452
|
+
Se.trim(g).next(d(o, r)).many()
|
|
3453
3453
|
).map(([a, c]) => [a, ...c]);
|
|
3454
|
-
return
|
|
3454
|
+
return I(
|
|
3455
3455
|
e,
|
|
3456
|
-
|
|
3457
|
-
).map(([a, c]) => new
|
|
3458
|
-
},
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
),
|
|
3466
|
-
Function:
|
|
3467
|
-
Value:
|
|
3468
|
-
FunctionArgs:
|
|
3469
|
-
},
|
|
3456
|
+
I(n.skip(Se).opt(), s).trim(g).wrap(kt, St).map(([a, c]) => a ? [a, ...c].flat() : [c])
|
|
3457
|
+
).map(([a, c]) => new mt(a, c));
|
|
3458
|
+
}, gi = () => Ke(B("cubic-bezier")).map((e) => new mt("cubic-bezier", e[1])), qr = D(/[^\(\)\{\}\s,;]+/).map((e) => new S(e)), Je = d(
|
|
3459
|
+
fi(),
|
|
3460
|
+
li(),
|
|
3461
|
+
ui(),
|
|
3462
|
+
di(),
|
|
3463
|
+
gi(),
|
|
3464
|
+
Ke().map(([e, t]) => new mt(e, t))
|
|
3465
|
+
), Qe = d(H.Value, Je, qr).trim(g), Ra = {
|
|
3466
|
+
Function: Je,
|
|
3467
|
+
Value: Qe,
|
|
3468
|
+
FunctionArgs: Zr
|
|
3469
|
+
}, wi = I(B("{"), D(/[^{}]+/), B("}")).map(
|
|
3470
3470
|
(e) => {
|
|
3471
3471
|
const t = e.join(`
|
|
3472
3472
|
`);
|
|
3473
3473
|
let n = JSON.parse(t);
|
|
3474
|
-
return new
|
|
3475
|
-
}
|
|
3476
|
-
),
|
|
3477
|
-
Value:
|
|
3478
|
-
Values:
|
|
3479
|
-
},
|
|
3480
|
-
(e) =>
|
|
3481
|
-
),
|
|
3474
|
+
return new S(n, "json");
|
|
3475
|
+
}
|
|
3476
|
+
), Ce = d(H.Value, Je, wi, qr).trim(g), va = {
|
|
3477
|
+
Value: Ce,
|
|
3478
|
+
Values: Ce.sepBy(g)
|
|
3479
|
+
}, ki = Xt((e) => Bt(Ce, e)), Ba = Xt(
|
|
3480
|
+
(e) => Bt(H.Percentage, String(e)).valueOf()
|
|
3481
|
+
), Na = Xt((e) => Bt(
|
|
3482
3482
|
H.Time.map((t) => t.unit === "ms" ? t.value : t.unit === "s" ? t.value * 1e3 : t.value),
|
|
3483
3483
|
e
|
|
3484
|
-
)),
|
|
3484
|
+
)), _a = Xt(
|
|
3485
3485
|
(e, t) => (() => {
|
|
3486
3486
|
if (!t)
|
|
3487
3487
|
return e;
|
|
3488
3488
|
if (e.unit === "var") {
|
|
3489
3489
|
const o = getComputedStyle(t).getPropertyValue(e.value);
|
|
3490
|
-
return
|
|
3490
|
+
return Yr(o);
|
|
3491
3491
|
}
|
|
3492
3492
|
if (e.unit === "calc" && e.property && e.subProperty && e.value && t) {
|
|
3493
3493
|
const o = e.property, s = t.style[o], i = e.subProperty ? `${e.subProperty}(${e.toString()})` : e.toString();
|
|
@@ -3496,13 +3496,13 @@ const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
|
|
|
3496
3496
|
o
|
|
3497
3497
|
);
|
|
3498
3498
|
t.style[o] = s;
|
|
3499
|
-
const c =
|
|
3500
|
-
if (c instanceof
|
|
3499
|
+
const c = ki(a);
|
|
3500
|
+
if (c instanceof S)
|
|
3501
3501
|
return c;
|
|
3502
3502
|
if (c.name.startsWith("matrix")) {
|
|
3503
|
-
const
|
|
3504
|
-
if (
|
|
3505
|
-
return new
|
|
3503
|
+
const p = lo(c)[e.subProperty];
|
|
3504
|
+
if (p != null)
|
|
3505
|
+
return new S(p, "px", [
|
|
3506
3506
|
"length",
|
|
3507
3507
|
"absolute"
|
|
3508
3508
|
]);
|
|
@@ -3511,29 +3511,29 @@ const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
|
|
|
3511
3511
|
return e;
|
|
3512
3512
|
})().coalesce(e),
|
|
3513
3513
|
{ keyFn: (e, t) => `${e.toString()}-${JSON.stringify(t)}` }
|
|
3514
|
-
),
|
|
3514
|
+
), Si = (e, t, n = !1) => {
|
|
3515
3515
|
if (e?.superType?.[0] !== t?.superType?.[0])
|
|
3516
3516
|
return n ? [e, t] : [e.clone(), t.clone()];
|
|
3517
3517
|
const r = (i) => {
|
|
3518
3518
|
switch (i?.superType?.[0]) {
|
|
3519
3519
|
case "length":
|
|
3520
3520
|
return {
|
|
3521
|
-
value:
|
|
3521
|
+
value: rr(i.value, i.unit, i.targets?.[0]),
|
|
3522
3522
|
unit: "px"
|
|
3523
3523
|
};
|
|
3524
3524
|
case "angle":
|
|
3525
3525
|
return {
|
|
3526
|
-
value:
|
|
3526
|
+
value: _e(i.value, i.unit),
|
|
3527
3527
|
unit: "deg"
|
|
3528
3528
|
};
|
|
3529
3529
|
case "time":
|
|
3530
3530
|
return {
|
|
3531
|
-
value:
|
|
3531
|
+
value: or(i.value, i.unit),
|
|
3532
3532
|
unit: "ms"
|
|
3533
3533
|
};
|
|
3534
3534
|
case "resolution":
|
|
3535
3535
|
return {
|
|
3536
|
-
value:
|
|
3536
|
+
value: sr(i.value, i.unit),
|
|
3537
3537
|
unit: "dpi"
|
|
3538
3538
|
};
|
|
3539
3539
|
default:
|
|
@@ -3541,7 +3541,7 @@ const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
|
|
|
3541
3541
|
}
|
|
3542
3542
|
}, [o, s] = [r(e), r(t)];
|
|
3543
3543
|
return n ? (e.value = o.value, e.unit = o.unit, t.value = s.value, t.unit = s.unit, [e, t]) : [
|
|
3544
|
-
new
|
|
3544
|
+
new S(
|
|
3545
3545
|
o.value,
|
|
3546
3546
|
o.unit,
|
|
3547
3547
|
e.superType,
|
|
@@ -3549,7 +3549,7 @@ const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
|
|
|
3549
3549
|
e.property,
|
|
3550
3550
|
e.targets
|
|
3551
3551
|
),
|
|
3552
|
-
new
|
|
3552
|
+
new S(
|
|
3553
3553
|
s.value,
|
|
3554
3554
|
s.unit,
|
|
3555
3555
|
t.superType,
|
|
@@ -3559,15 +3559,15 @@ const mt = A("("), pt = A(")"), ce = A(","), er = y.lazy(
|
|
|
3559
3559
|
)
|
|
3560
3560
|
];
|
|
3561
3561
|
};
|
|
3562
|
-
function
|
|
3562
|
+
function Pa(e, t) {
|
|
3563
3563
|
e = e.coalesce(t, !0), t = t.coalesce(e, !0);
|
|
3564
3564
|
const n = {
|
|
3565
3565
|
start: e,
|
|
3566
3566
|
stop: t,
|
|
3567
3567
|
value: e.clone()
|
|
3568
3568
|
};
|
|
3569
|
-
if (
|
|
3570
|
-
const [r, o] =
|
|
3569
|
+
if (be(e) && be(t)) {
|
|
3570
|
+
const [r, o] = vs(
|
|
3571
3571
|
e,
|
|
3572
3572
|
t,
|
|
3573
3573
|
"lab",
|
|
@@ -3576,206 +3576,584 @@ function ci(e, t) {
|
|
|
3576
3576
|
n.start = r, n.stop = o, n.value = r.clone();
|
|
3577
3577
|
}
|
|
3578
3578
|
if (e.unit !== t.unit) {
|
|
3579
|
-
const [r, o] =
|
|
3579
|
+
const [r, o] = Si(
|
|
3580
3580
|
e,
|
|
3581
3581
|
t,
|
|
3582
3582
|
!0
|
|
3583
3583
|
);
|
|
3584
3584
|
n.start = r, n.stop = o, n.value = r.clone();
|
|
3585
3585
|
}
|
|
3586
|
-
return n.computed =
|
|
3586
|
+
return n.computed = fe.includes(e.unit) || fe.includes(t.unit), n;
|
|
3587
|
+
}
|
|
3588
|
+
function yi(e) {
|
|
3589
|
+
const t = (n, r = 1) => Math.round(e[n] * r);
|
|
3590
|
+
return `invert(${t(0)}%) sepia(${t(1)}%) saturate(${t(2)}%) hue-rotate(${t(3, 3.6)}deg) brightness(${t(4)}%) contrast(${t(5)}%)`;
|
|
3591
|
+
}
|
|
3592
|
+
const tn = (e) => [e.r, e.g, e.b], Kt = (e, t, n) => new O(e, t, n), Ci = (e, t, n) => new yt(e, t, n), Kr = (e) => {
|
|
3593
|
+
const t = xr(e);
|
|
3594
|
+
return Ci(t.h, t.s, t.l);
|
|
3595
|
+
}, xi = 1, Ti = 1 / 6, Ei = 5, Ai = 15, Mi = 100, Ii = 7500, Ri = 200, pe = 360, vi = 50, Bi = 20, Ni = 3750, _i = 50, Pi = 100, Oi = 100, K = 0.2126, J = 0.7152, Q = 0.0722;
|
|
3596
|
+
function Li(e, t = 0) {
|
|
3597
|
+
const n = Math.sin(t * Math.PI / 180), r = Math.cos(t * Math.PI / 180), o = [
|
|
3598
|
+
K + r * (1 - K) - n * K,
|
|
3599
|
+
J - r * J - n * J,
|
|
3600
|
+
Q - r * Q + n * (1 - Q),
|
|
3601
|
+
K - r * K + n * 0.143,
|
|
3602
|
+
J + r * (1 - J) + n * 0.14,
|
|
3603
|
+
Q - r * Q - n * 0.283,
|
|
3604
|
+
K - r * K - n * (1 - K),
|
|
3605
|
+
J - r * J + n * J,
|
|
3606
|
+
Q + r * (1 - Q) + n * Q
|
|
3607
|
+
];
|
|
3608
|
+
return en(e, o);
|
|
3609
|
+
}
|
|
3610
|
+
const yn = 0.393, Cn = 0.769, xn = 0.189, Tn = 0.349, En = 0.686, An = 0.168, Mn = 0.272, In = 0.534, Rn = 0.131;
|
|
3611
|
+
function zi(e, t = 1) {
|
|
3612
|
+
const n = [
|
|
3613
|
+
yn + (1 - yn) * (1 - t),
|
|
3614
|
+
Cn - Cn * (1 - t),
|
|
3615
|
+
xn - xn * (1 - t),
|
|
3616
|
+
Tn - Tn * (1 - t),
|
|
3617
|
+
En + (1 - En) * (1 - t),
|
|
3618
|
+
An - An * (1 - t),
|
|
3619
|
+
Mn - Mn * (1 - t),
|
|
3620
|
+
In - In * (1 - t),
|
|
3621
|
+
Rn + (1 - Rn) * (1 - t)
|
|
3622
|
+
];
|
|
3623
|
+
return en(e, n);
|
|
3624
|
+
}
|
|
3625
|
+
const bt = 0.213, dt = 0.715, gt = 0.072;
|
|
3626
|
+
function $i(e, t = 1) {
|
|
3627
|
+
const n = [
|
|
3628
|
+
bt + (1 - bt) * t,
|
|
3629
|
+
dt - dt * t,
|
|
3630
|
+
gt - gt * t,
|
|
3631
|
+
bt - bt * t,
|
|
3632
|
+
dt + (1 - dt) * t,
|
|
3633
|
+
gt - gt * t,
|
|
3634
|
+
bt - bt * t,
|
|
3635
|
+
dt - dt * t,
|
|
3636
|
+
gt + (1 - gt) * t
|
|
3637
|
+
];
|
|
3638
|
+
return en(e, n);
|
|
3587
3639
|
}
|
|
3640
|
+
function en(e, t) {
|
|
3641
|
+
const n = N(tn(e), t);
|
|
3642
|
+
return Kt(v(n[0], 0, 255), v(n[1], 0, 255), v(n[2], 0, 255));
|
|
3643
|
+
}
|
|
3644
|
+
function Fi(e, t = 1) {
|
|
3645
|
+
return Jr(e, t);
|
|
3646
|
+
}
|
|
3647
|
+
function Gi(e, t = 1) {
|
|
3648
|
+
return Jr(e, t, -(0.5 * t) + 0.5);
|
|
3649
|
+
}
|
|
3650
|
+
function Jr(e, t = 1, n = 0) {
|
|
3651
|
+
const r = tn(e);
|
|
3652
|
+
return Kt(
|
|
3653
|
+
v(r[0] * t + n * 255, 0, 255),
|
|
3654
|
+
v(r[1] * t + n * 255, 0, 255),
|
|
3655
|
+
v(r[2] * t + n * 255, 0, 255)
|
|
3656
|
+
);
|
|
3657
|
+
}
|
|
3658
|
+
function Ui(e, t = 1) {
|
|
3659
|
+
const n = tn(e);
|
|
3660
|
+
return Kt(
|
|
3661
|
+
v((t + n[0] / 255 * (1 - 2 * t)) * 255, 0, 255),
|
|
3662
|
+
v((t + n[1] / 255 * (1 - 2 * t)) * 255, 0, 255),
|
|
3663
|
+
v((t + n[2] / 255 * (1 - 2 * t)) * 255, 0, 255)
|
|
3664
|
+
);
|
|
3665
|
+
}
|
|
3666
|
+
function me(e, t, n) {
|
|
3667
|
+
let r = Kt(0, 0, 0);
|
|
3668
|
+
r = Ui(r, e[0] / 100), r = zi(r, e[1] / 100), r = $i(r, e[2] / 100), r = Li(r, e[3] * 3.6), r = Fi(r, e[4] / 100), r = Gi(r, e[5] / 100);
|
|
3669
|
+
const o = Kr(r);
|
|
3670
|
+
return Math.abs(r.r - t.r) + Math.abs(r.g - t.g) + Math.abs(r.b - t.b) + Math.abs(o.h - n.h) + Math.abs(o.s - n.s) + Math.abs(o.l - n.l);
|
|
3671
|
+
}
|
|
3672
|
+
function Qr(e, t, n, r, o, s, i) {
|
|
3673
|
+
let a = null, c = 1 / 0;
|
|
3674
|
+
const l = new Array(6), p = new Array(6), u = new Array(6);
|
|
3675
|
+
for (let f = 0; f < o; f++) {
|
|
3676
|
+
const C = n / Math.pow(f + 1, Ti);
|
|
3677
|
+
for (let w = 0; w < 6; w++)
|
|
3678
|
+
l[w] = Math.random() > 0.5 ? 1 : -1, p[w] = r[w] + C * l[w], u[w] = r[w] - C * l[w];
|
|
3679
|
+
const y = me(p, s, i) - me(u, s, i);
|
|
3680
|
+
for (let w = 0; w < 6; w++) {
|
|
3681
|
+
const E = y / (2 * C) * l[w], A = t[w] / Math.pow(e + f + 1, xi);
|
|
3682
|
+
r[w] = Di(r[w] - A * E, w);
|
|
3683
|
+
}
|
|
3684
|
+
const T = me(r, s, i);
|
|
3685
|
+
T < c && (a = [...r], c = T);
|
|
3686
|
+
}
|
|
3687
|
+
return { values: a ?? [...r], loss: c };
|
|
3688
|
+
}
|
|
3689
|
+
function Di(e, t) {
|
|
3690
|
+
let n = Mi;
|
|
3691
|
+
return t === 2 ? n = Ii : (t === 4 || t === 5) && (n = Ri), t === 3 ? (e % pe + pe) % pe : v(e, 0, n);
|
|
3692
|
+
}
|
|
3693
|
+
function Vi(e, t, n) {
|
|
3694
|
+
const r = e.loss, o = 2, s = r + 1, i = [0.25 * s, 0.25 * s, s, 0.25 * s, 0.2 * s, 0.2 * s];
|
|
3695
|
+
return Qr(r, i, o, e.values, 500, t, n);
|
|
3696
|
+
}
|
|
3697
|
+
function Xi(e, t) {
|
|
3698
|
+
const n = [60, 180, 18e3, 600, 1.2, 1.2];
|
|
3699
|
+
let r = { loss: 1 / 0, values: [] };
|
|
3700
|
+
for (let o = 0; o < 3; o++)
|
|
3701
|
+
if (r.loss > 25) {
|
|
3702
|
+
const i = Qr(
|
|
3703
|
+
Ei,
|
|
3704
|
+
n,
|
|
3705
|
+
Ai,
|
|
3706
|
+
[
|
|
3707
|
+
vi,
|
|
3708
|
+
Bi,
|
|
3709
|
+
Ni,
|
|
3710
|
+
_i,
|
|
3711
|
+
Pi,
|
|
3712
|
+
Oi
|
|
3713
|
+
],
|
|
3714
|
+
1e3,
|
|
3715
|
+
e,
|
|
3716
|
+
t
|
|
3717
|
+
);
|
|
3718
|
+
i.loss < r.loss && (r = i);
|
|
3719
|
+
}
|
|
3720
|
+
return r;
|
|
3721
|
+
}
|
|
3722
|
+
function Wi(e) {
|
|
3723
|
+
const t = Kr(e), n = Vi(Xi(e, t), e, t);
|
|
3724
|
+
return {
|
|
3725
|
+
values: n.values,
|
|
3726
|
+
loss: n.loss,
|
|
3727
|
+
filter: yi(n.values)
|
|
3728
|
+
};
|
|
3729
|
+
}
|
|
3730
|
+
function Oa(e) {
|
|
3731
|
+
return Wi(e);
|
|
3732
|
+
}
|
|
3733
|
+
function Hi(e) {
|
|
3734
|
+
return e;
|
|
3735
|
+
}
|
|
3736
|
+
function vn(e) {
|
|
3737
|
+
return e * e;
|
|
3738
|
+
}
|
|
3739
|
+
function Bn(e) {
|
|
3740
|
+
return -e * (e - 2);
|
|
3741
|
+
}
|
|
3742
|
+
function Nn(e) {
|
|
3743
|
+
return (e /= 0.5) < 1 ? 0.5 * e * e : -0.5 * (--e * (e - 2) - 1);
|
|
3744
|
+
}
|
|
3745
|
+
function _n(e) {
|
|
3746
|
+
return e * e * e;
|
|
3747
|
+
}
|
|
3748
|
+
function Pn(e) {
|
|
3749
|
+
return (e = e - 1) * e * e + 1;
|
|
3750
|
+
}
|
|
3751
|
+
function On(e) {
|
|
3752
|
+
return (e /= 0.5) < 1 ? 0.5 * e * e * e : 0.5 * ((e -= 2) * e * e + 2);
|
|
3753
|
+
}
|
|
3754
|
+
function Ln(e) {
|
|
3755
|
+
return e * e * (3 - 2 * e);
|
|
3756
|
+
}
|
|
3757
|
+
const Z = (e, t, n, r) => (o) => (o = fr(o, e, t, n, r)[1], o);
|
|
3758
|
+
function zn(e) {
|
|
3759
|
+
return e = Z(0.09, 0.91, 0.5, 1.5)(e), e;
|
|
3760
|
+
}
|
|
3761
|
+
function $n(e) {
|
|
3762
|
+
return e = Z(0.09, 0.91, 0.5, 1.5)(e), e;
|
|
3763
|
+
}
|
|
3764
|
+
function Fn(e) {
|
|
3765
|
+
return e = jt(e, [
|
|
3766
|
+
[0, 0],
|
|
3767
|
+
[0.026, 1.746],
|
|
3768
|
+
[0.633, 1.06],
|
|
3769
|
+
[1, 0]
|
|
3770
|
+
])[1], e;
|
|
3771
|
+
}
|
|
3772
|
+
function Gn(e) {
|
|
3773
|
+
return e = jt(e, [
|
|
3774
|
+
[0, 0],
|
|
3775
|
+
[0.367, 0.94],
|
|
3776
|
+
[0.974, 0.254],
|
|
3777
|
+
[1, 0]
|
|
3778
|
+
])[1], e;
|
|
3779
|
+
}
|
|
3780
|
+
function Un(e) {
|
|
3781
|
+
return e = jt(e, [
|
|
3782
|
+
[0, 0],
|
|
3783
|
+
[0.026, 1.746],
|
|
3784
|
+
[0.633, 1.06],
|
|
3785
|
+
[1, 0]
|
|
3786
|
+
])[1], e;
|
|
3787
|
+
}
|
|
3788
|
+
function Dn(e) {
|
|
3789
|
+
return e = jt(e, [
|
|
3790
|
+
[0, 0],
|
|
3791
|
+
[0.026, 1.746],
|
|
3792
|
+
[0.633, 1.06],
|
|
3793
|
+
[1, 0]
|
|
3794
|
+
])[1], e;
|
|
3795
|
+
}
|
|
3796
|
+
function Vn(e) {
|
|
3797
|
+
return 1 - Math.cos(e * Math.PI / 2);
|
|
3798
|
+
}
|
|
3799
|
+
function Xn(e) {
|
|
3800
|
+
return Math.sin(e * Math.PI / 2);
|
|
3801
|
+
}
|
|
3802
|
+
function Wn(e) {
|
|
3803
|
+
return -(Math.cos(Math.PI * e) - 1) / 2;
|
|
3804
|
+
}
|
|
3805
|
+
function Hn(e) {
|
|
3806
|
+
return 1 - Math.sqrt(1 - e * e);
|
|
3807
|
+
}
|
|
3808
|
+
function jn(e) {
|
|
3809
|
+
return Math.sqrt(1 - --e * e);
|
|
3810
|
+
}
|
|
3811
|
+
function Yn(e) {
|
|
3812
|
+
return (e /= 0.5) < 1 ? -(Math.sqrt(1 - e * e) - 1) / 2 : (Math.sqrt(1 - (e -= 2) * e) + 1) / 2;
|
|
3813
|
+
}
|
|
3814
|
+
function Zn(e) {
|
|
3815
|
+
return e === 0 ? 0 : Math.pow(2, 10 * (e - 1));
|
|
3816
|
+
}
|
|
3817
|
+
function qn(e) {
|
|
3818
|
+
return e === 1 ? 1 : 1 - Math.pow(2, -10 * e);
|
|
3819
|
+
}
|
|
3820
|
+
function Kn(e) {
|
|
3821
|
+
return e === 0 ? 0 : e === 1 ? 1 : (e /= 0.5) < 1 ? 0.5 * Math.pow(2, 10 * (e - 1)) : 0.5 * (2 - Math.pow(2, -10 * --e));
|
|
3822
|
+
}
|
|
3823
|
+
const La = [
|
|
3824
|
+
"jump-start",
|
|
3825
|
+
"jump-end",
|
|
3826
|
+
"jump-none",
|
|
3827
|
+
"jump-both",
|
|
3828
|
+
"start",
|
|
3829
|
+
"end",
|
|
3830
|
+
"both"
|
|
3831
|
+
];
|
|
3832
|
+
function to(e, t) {
|
|
3833
|
+
return Math.floor(e * t) / t;
|
|
3834
|
+
}
|
|
3835
|
+
function ji(e, t) {
|
|
3836
|
+
return Math.ceil(e * t) / t;
|
|
3837
|
+
}
|
|
3838
|
+
function Yi(e, t) {
|
|
3839
|
+
return e === 0 || e === 1 ? e : to(e, t);
|
|
3840
|
+
}
|
|
3841
|
+
function Zi(e, t) {
|
|
3842
|
+
return Math.round(e * t) / t;
|
|
3843
|
+
}
|
|
3844
|
+
function nn(e, t = "jump-start") {
|
|
3845
|
+
switch (t) {
|
|
3846
|
+
case "jump-none":
|
|
3847
|
+
return (n) => Zi(n, e);
|
|
3848
|
+
case "jump-start":
|
|
3849
|
+
case "start":
|
|
3850
|
+
return (n) => to(n, e);
|
|
3851
|
+
case "jump-end":
|
|
3852
|
+
case "end":
|
|
3853
|
+
return (n) => ji(n, e);
|
|
3854
|
+
case "jump-both":
|
|
3855
|
+
case "both":
|
|
3856
|
+
return (n) => Yi(n, e);
|
|
3857
|
+
}
|
|
3858
|
+
}
|
|
3859
|
+
function qi() {
|
|
3860
|
+
return nn(1, "jump-start");
|
|
3861
|
+
}
|
|
3862
|
+
function Ki() {
|
|
3863
|
+
return nn(1, "jump-end");
|
|
3864
|
+
}
|
|
3865
|
+
const ut = {
|
|
3866
|
+
ease: [0.25, 0.1, 0.25, 1],
|
|
3867
|
+
"ease-in": [0.42, 0, 1, 1],
|
|
3868
|
+
"ease-out": [0, 0, 0.58, 1],
|
|
3869
|
+
"ease-in-out": [0.42, 0, 0.58, 1],
|
|
3870
|
+
"ease-in-back": [0.6, -0.28, 0.735, 0.045],
|
|
3871
|
+
"ease-out-back": [0.175, 0.885, 0.32, 1.275],
|
|
3872
|
+
"ease-in-out-back": [0.68, -0.55, 0.265, 1.55]
|
|
3873
|
+
}, za = {
|
|
3874
|
+
linear: Hi,
|
|
3875
|
+
easeInQuad: vn,
|
|
3876
|
+
"ease-in-quad": vn,
|
|
3877
|
+
// "easeInQuad",
|
|
3878
|
+
easeOutQuad: Bn,
|
|
3879
|
+
"ease-out-quad": Bn,
|
|
3880
|
+
// "easeOutQuad",
|
|
3881
|
+
easeInOutQuad: Nn,
|
|
3882
|
+
"ease-in-out-quad": Nn,
|
|
3883
|
+
// "easeInOutQuad",
|
|
3884
|
+
easeInCubic: _n,
|
|
3885
|
+
"ease-in-cubic": _n,
|
|
3886
|
+
easeOutCubic: Pn,
|
|
3887
|
+
"ease-out-cubic": Pn,
|
|
3888
|
+
easeInOutCubic: On,
|
|
3889
|
+
"ease-in-out-cubic": On,
|
|
3890
|
+
easeInBounce: zn,
|
|
3891
|
+
"ease-in-bounce": zn,
|
|
3892
|
+
// "easeInBounce",
|
|
3893
|
+
bounceInEase: $n,
|
|
3894
|
+
"bounce-in-ease": $n,
|
|
3895
|
+
bounceInEaseHalf: Fn,
|
|
3896
|
+
"bounce-in-ease-half": Fn,
|
|
3897
|
+
bounceOutEase: Gn,
|
|
3898
|
+
"bounce-out-ease": Gn,
|
|
3899
|
+
bounceOutEaseHalf: Un,
|
|
3900
|
+
"bounce-out-ease-half": Un,
|
|
3901
|
+
bounceInOutEase: Dn,
|
|
3902
|
+
"bounce-in-out-ease": Dn,
|
|
3903
|
+
easeInSine: Vn,
|
|
3904
|
+
"ease-in-sine": Vn,
|
|
3905
|
+
easeOutSine: Xn,
|
|
3906
|
+
"ease-out-sine": Xn,
|
|
3907
|
+
easeInOutSine: Wn,
|
|
3908
|
+
"ease-in-out-sine": Wn,
|
|
3909
|
+
easeInCirc: Hn,
|
|
3910
|
+
"ease-in-circ": Hn,
|
|
3911
|
+
easeOutCirc: jn,
|
|
3912
|
+
"ease-out-circ": jn,
|
|
3913
|
+
easeInOutCirc: Yn,
|
|
3914
|
+
"ease-in-out-circ": Yn,
|
|
3915
|
+
easeInExpo: Zn,
|
|
3916
|
+
"ease-in-expo": Zn,
|
|
3917
|
+
easeOutExpo: qn,
|
|
3918
|
+
"ease-out-expo": qn,
|
|
3919
|
+
easeInOutExpo: Kn,
|
|
3920
|
+
"ease-in-out-expo": Kn,
|
|
3921
|
+
smoothStep3: Ln,
|
|
3922
|
+
"smooth-step-3": Ln,
|
|
3923
|
+
ease: Z(...ut.ease),
|
|
3924
|
+
"ease-in": Z(...ut["ease-in"]),
|
|
3925
|
+
"ease-out": Z(...ut["ease-out"]),
|
|
3926
|
+
"ease-in-out": Z(...ut["ease-in-out"]),
|
|
3927
|
+
"ease-in-back": Z(...ut["ease-in-back"]),
|
|
3928
|
+
"ease-out-back": Z(...ut["ease-out-back"]),
|
|
3929
|
+
"ease-in-out-back": Z(...ut["ease-in-out-back"]),
|
|
3930
|
+
steps: nn,
|
|
3931
|
+
"step-start": qi,
|
|
3932
|
+
"step-end": Ki
|
|
3933
|
+
};
|
|
3588
3934
|
export {
|
|
3589
|
-
|
|
3590
|
-
|
|
3935
|
+
Qn as ABSOLUTE_LENGTH_UNITS,
|
|
3936
|
+
$ as ALPHA_DENORM_UNIT,
|
|
3591
3937
|
h as ALPHA_RANGE,
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3938
|
+
Lt as ANGLE_UNITS,
|
|
3939
|
+
ve as AdobeRGBColor,
|
|
3940
|
+
io as BLACKLISTED_COALESCE_UNITS,
|
|
3941
|
+
dn as COLOR_NAMES,
|
|
3942
|
+
lr as COLOR_SPACE_DENORM_UNITS,
|
|
3943
|
+
wa as COLOR_SPACE_NAMES,
|
|
3944
|
+
b as COLOR_SPACE_RANGES,
|
|
3945
|
+
so as COLOR_UNITS,
|
|
3946
|
+
fe as COMPUTED_UNITS,
|
|
3947
|
+
Ye as CSSColor,
|
|
3948
|
+
Z as CSSCubicBezier,
|
|
3949
|
+
Ra as CSSFunction,
|
|
3950
|
+
wi as CSSJSON,
|
|
3951
|
+
qr as CSSString,
|
|
3605
3952
|
H as CSSValueUnit,
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3953
|
+
va as CSSValues,
|
|
3954
|
+
Ts as CYLINDRICAL_HUE_COMPONENT,
|
|
3955
|
+
V as Color,
|
|
3956
|
+
Ca as DELTA_E_OK_JND,
|
|
3957
|
+
Re as DisplayP3Color,
|
|
3958
|
+
he as FRAME_RATE,
|
|
3959
|
+
mt as FunctionValue,
|
|
3960
|
+
To as GAMUT_SECTOR_COEFFICIENTS,
|
|
3961
|
+
yt as HSLColor,
|
|
3962
|
+
Te as HSVColor,
|
|
3963
|
+
Et as HUE_RANGE,
|
|
3964
|
+
Ee as HWBColor,
|
|
3965
|
+
nr as KelvinColor,
|
|
3966
|
+
Wt as LABColor,
|
|
3967
|
+
Ae as LCHColor,
|
|
3968
|
+
Pt as LENGTH_UNITS,
|
|
3969
|
+
j as LINEAR_SRGB_TO_LMS,
|
|
3970
|
+
k as LMS_TO_LINEAR_SRGB,
|
|
3971
|
+
hr as LMS_TO_OKLAB_MATRIX,
|
|
3972
|
+
Co as LMS_TO_XYZ_MATRIX,
|
|
3973
|
+
Ie as LinearSRGBColor,
|
|
3974
|
+
Ht as OKLABColor,
|
|
3975
|
+
P as OKLAB_TO_LMS_COEFF,
|
|
3976
|
+
xo as OKLAB_TO_LMS_MATRIX,
|
|
3977
|
+
Me as OKLCHColor,
|
|
3978
|
+
er as PERCENTAGE_UNITS,
|
|
3979
|
+
Be as ProPhotoRGBColor,
|
|
3980
|
+
tr as RELATIVE_LENGTH_UNITS,
|
|
3981
|
+
zt as RESOLUTION_UNITS,
|
|
3982
|
+
_ as RGBA_MAX,
|
|
3983
|
+
O as RGBColor,
|
|
3984
|
+
oe as RGB_RANGE,
|
|
3985
|
+
Ne as Rec2020Color,
|
|
3986
|
+
oo as STRING_UNITS,
|
|
3987
|
+
ao as STYLE_NAMES,
|
|
3988
|
+
Ot as TIME_UNITS,
|
|
3989
|
+
ca as UNITS,
|
|
3643
3990
|
z as UNIT_RANGE,
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3991
|
+
vt as ValueArray,
|
|
3992
|
+
S as ValueUnit,
|
|
3993
|
+
pr as WHITE_POINTS,
|
|
3994
|
+
yo as WHITE_POINT_D50,
|
|
3995
|
+
ur as WHITE_POINT_D50_D65,
|
|
3996
|
+
So as WHITE_POINT_D65,
|
|
3997
|
+
Oe as WHITE_POINT_D65_D50,
|
|
3998
|
+
U as XYZColor,
|
|
3999
|
+
mr as XYZ_TO_LMS_MATRIX,
|
|
4000
|
+
gs as adobeRgb2xyz,
|
|
4001
|
+
ce as adobeRgbToLinear,
|
|
4002
|
+
Ji as arrayEquals,
|
|
4003
|
+
ut as bezierPresets,
|
|
4004
|
+
$n as bounceInEase,
|
|
4005
|
+
Fn as bounceInEaseHalf,
|
|
4006
|
+
Dn as bounceInOutEase,
|
|
4007
|
+
Gn as bounceOutEase,
|
|
4008
|
+
Un as bounceOutEaseHalf,
|
|
4009
|
+
oa as camelCaseToHyphen,
|
|
4010
|
+
aa as cancelAnimationFrame,
|
|
4011
|
+
v as clamp,
|
|
4012
|
+
tt as clone,
|
|
4013
|
+
pt as color2,
|
|
4014
|
+
wn as colorUnit2,
|
|
4015
|
+
Mo as computeMaxSaturation,
|
|
4016
|
+
fa as convert2,
|
|
4017
|
+
uo as convertAbsoluteUnitToPixels,
|
|
4018
|
+
sr as convertToDPI,
|
|
4019
|
+
_e as convertToDegrees,
|
|
4020
|
+
or as convertToMs,
|
|
4021
|
+
rr as convertToPixels,
|
|
4022
|
+
na as createHash,
|
|
4023
|
+
yi as cssFiltersToString,
|
|
4024
|
+
fr as cubicBezier,
|
|
4025
|
+
Sa as cubicBezierToSVG,
|
|
4026
|
+
ya as cubicBezierToString,
|
|
4027
|
+
Ft as deCasteljau,
|
|
4028
|
+
ea as debounce,
|
|
4029
|
+
xa as deltaEOK,
|
|
4030
|
+
bs as displayP32xyz,
|
|
4031
|
+
zn as easeInBounce,
|
|
4032
|
+
Hn as easeInCirc,
|
|
4033
|
+
_n as easeInCubic,
|
|
4034
|
+
Zn as easeInExpo,
|
|
4035
|
+
Yn as easeInOutCirc,
|
|
4036
|
+
On as easeInOutCubic,
|
|
4037
|
+
Kn as easeInOutExpo,
|
|
4038
|
+
Nn as easeInOutQuad,
|
|
4039
|
+
Wn as easeInOutSine,
|
|
4040
|
+
vn as easeInQuad,
|
|
4041
|
+
Vn as easeInSine,
|
|
4042
|
+
jn as easeOutCirc,
|
|
4043
|
+
Pn as easeOutCubic,
|
|
4044
|
+
qn as easeOutExpo,
|
|
4045
|
+
Bn as easeOutQuad,
|
|
4046
|
+
Xn as easeOutSine,
|
|
4047
|
+
ko as fail,
|
|
4048
|
+
Io as findCusp,
|
|
4049
|
+
Ro as findGamutIntersection,
|
|
4050
|
+
ua as flattenObject,
|
|
4051
|
+
xs as gamutMap,
|
|
4052
|
+
No as gamutMapOKLab,
|
|
4053
|
+
Po as gamutMapSRGB,
|
|
4054
|
+
_a as getComputedValue,
|
|
4055
|
+
Ta as getFormattedColorSpaceRange,
|
|
4056
|
+
Oo as hex2rgb,
|
|
4057
|
+
Cr as hsl2hsv,
|
|
4058
|
+
$o as hsl2hwb,
|
|
4059
|
+
Fo as hsl2rgb,
|
|
4060
|
+
He as hsl2xyz,
|
|
4061
|
+
yr as hsv2hsl,
|
|
4062
|
+
qo as hsv2xyz,
|
|
4063
|
+
zo as hwb2hsl,
|
|
4064
|
+
Jo as hwb2xyz,
|
|
4065
|
+
ra as hyphenToCamelCase,
|
|
4066
|
+
bo as identifier,
|
|
4067
|
+
go as integer,
|
|
4068
|
+
jt as interpBezier,
|
|
4069
|
+
Es as interpolateHue,
|
|
4070
|
+
nt as invertMat3,
|
|
4071
|
+
ha as isCSSStyleName,
|
|
4072
|
+
be as isColorUnit,
|
|
4073
|
+
Ao as isInSRGBGamut,
|
|
4074
|
+
Jn as isObject,
|
|
4075
|
+
m as istring,
|
|
4076
|
+
La as jumpTerms,
|
|
4077
|
+
Sr as kelvin2rgb,
|
|
4078
|
+
os as kelvin2xyz,
|
|
4079
|
+
jo as lab2lch,
|
|
4080
|
+
Zo as lab2oklab,
|
|
4081
|
+
Ma as lab2oklch,
|
|
4082
|
+
Fe as lab2xyz,
|
|
4083
|
+
Ho as lch2lab,
|
|
4084
|
+
ts as lch2xyz,
|
|
4085
|
+
de as lerp,
|
|
4086
|
+
Hi as linear,
|
|
4087
|
+
hs as linearSrgb2xyz,
|
|
4088
|
+
is as linearToAdobeRgb,
|
|
4089
|
+
as as linearToProPhoto,
|
|
4090
|
+
cs as linearToRec2020,
|
|
4091
|
+
Rr as linearToSrgb,
|
|
4092
|
+
ka as logerp,
|
|
4093
|
+
Xt as memoize,
|
|
4094
|
+
As as mixColors,
|
|
4095
|
+
ga as multiplyMat3,
|
|
4096
|
+
Pe as none,
|
|
4097
|
+
Rs as normalizeColor,
|
|
4098
|
+
we as normalizeColorUnit,
|
|
4099
|
+
Is as normalizeColorUnitComponent,
|
|
4100
|
+
vs as normalizeColorUnits,
|
|
4101
|
+
Si as normalizeNumericUnits,
|
|
4102
|
+
Pa as normalizeValueUnits,
|
|
4103
|
+
et as number,
|
|
4104
|
+
Yo as oklab2lab,
|
|
4105
|
+
vr as oklab2oklch,
|
|
4106
|
+
Xe as oklab2xyz,
|
|
4107
|
+
ze as oklabToLinearSRGB,
|
|
4108
|
+
Aa as oklch2lab,
|
|
4109
|
+
Br as oklch2oklab,
|
|
4110
|
+
ns as oklch2xyz,
|
|
4111
|
+
Ia as parseCSSColor,
|
|
4112
|
+
Ba as parseCSSPercent,
|
|
4113
|
+
Na as parseCSSTime,
|
|
4114
|
+
ki as parseCSSValue,
|
|
4115
|
+
Yr as parseCSSValueUnit,
|
|
4116
|
+
ba as parseResult,
|
|
4117
|
+
ks as proPhoto2xyz,
|
|
4118
|
+
le as proPhotoToLinear,
|
|
4119
|
+
ys as rec20202xyz,
|
|
4120
|
+
ue as rec2020ToLinear,
|
|
4121
|
+
ia as requestAnimationFrame,
|
|
4122
|
+
Oa as rgb2ColorFilter,
|
|
4123
|
+
Ea as rgb2hex,
|
|
4124
|
+
xr as rgb2hsl,
|
|
4125
|
+
Lo as rgb2kelvin,
|
|
4126
|
+
De as rgb2xyz,
|
|
4127
|
+
R as scale,
|
|
4128
|
+
sa as seekPreviousValue,
|
|
4129
|
+
Qi as sleep,
|
|
4130
|
+
Ln as smoothStep3,
|
|
4131
|
+
wt as srgbToLinear,
|
|
4132
|
+
_o as srgbToOKLab,
|
|
4133
|
+
Ki as stepEnd,
|
|
4134
|
+
qi as stepStart,
|
|
4135
|
+
nn as steppedEase,
|
|
4136
|
+
wo as succeed,
|
|
4137
|
+
za as timingFunctions,
|
|
4138
|
+
N as transformMat3,
|
|
4139
|
+
da as transposeMat3,
|
|
4140
|
+
Bt as tryParse,
|
|
4141
|
+
pa as unflattenObject,
|
|
4142
|
+
ma as unflattenObjectToString,
|
|
4143
|
+
lo as unpackMatrixValues,
|
|
4144
|
+
ta as waitUntil,
|
|
4145
|
+
ws as xyz2adobeRgb,
|
|
4146
|
+
ds as xyz2displayP3,
|
|
4147
|
+
je as xyz2hsl,
|
|
4148
|
+
Ko as xyz2hsv,
|
|
4149
|
+
Qo as xyz2hwb,
|
|
4150
|
+
ss as xyz2kelvin,
|
|
4151
|
+
$e as xyz2lab,
|
|
4152
|
+
es as xyz2lch,
|
|
4153
|
+
fs as xyz2linearSrgb,
|
|
4154
|
+
We as xyz2oklab,
|
|
4155
|
+
rs as xyz2oklch,
|
|
4156
|
+
Ss as xyz2proPhoto,
|
|
4157
|
+
Cs as xyz2rec2020,
|
|
4158
|
+
Ve as xyz2rgb
|
|
3781
4159
|
};
|