@flock/wirespec 0.8.47 → 0.8.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/arrow-arrow-atomic.js +16 -16
  2. package/arrow-arrow-continuations.js +3 -3
  3. package/arrow-arrow-core.js +109 -88
  4. package/arrow-arrow-core.js.map +1 -1
  5. package/clikt-clikt.js +6790 -0
  6. package/clikt-clikt.js.map +1 -0
  7. package/colormath-root-colormath.js +1403 -0
  8. package/colormath-root-colormath.js.map +1 -0
  9. package/kotlin-kotlin-stdlib-js-ir.js +4150 -2107
  10. package/kotlin-kotlin-stdlib-js-ir.js.map +1 -1
  11. package/kotlin-openapi-bindings.js +3574 -3574
  12. package/kotlin-openapi-bindings.js.map +1 -1
  13. package/kotlinx-serialization-kotlinx-serialization-core-js-ir.js +1551 -1550
  14. package/kotlinx-serialization-kotlinx-serialization-core-js-ir.js.map +1 -1
  15. package/kotlinx-serialization-kotlinx-serialization-json-js-ir.js +1183 -1172
  16. package/kotlinx-serialization-kotlinx-serialization-json-js-ir.js.map +1 -1
  17. package/markdown.js +6858 -0
  18. package/markdown.js.map +1 -0
  19. package/mordant-mordant.js +11604 -0
  20. package/mordant-mordant.js.map +1 -0
  21. package/package.json +3 -3
  22. package/wirespec-bin.js +3 -0
  23. package/wirespec-src-compiler-core.js +2436 -1676
  24. package/wirespec-src-compiler-core.js.map +1 -1
  25. package/wirespec-src-compiler-lib.js +502 -471
  26. package/wirespec-src-compiler-lib.js.map +1 -1
  27. package/wirespec-src-converter-openapi.js +571 -571
  28. package/wirespec-src-converter-openapi.js.map +1 -1
  29. package/wirespec-src-plugin-arguments.js +543 -0
  30. package/wirespec-src-plugin-arguments.js.map +1 -0
  31. package/wirespec-src-plugin-cli.js +1027 -0
  32. package/wirespec-src-plugin-cli.js.map +1 -0
  33. package/wirespec-src-compiler-lib.d.ts +0 -356
@@ -0,0 +1,1403 @@
1
+ (function (root, factory) {
2
+ if (typeof define === 'function' && define.amd)
3
+ define(['exports', './kotlin-kotlin-stdlib-js-ir.js'], factory);
4
+ else if (typeof exports === 'object')
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib-js-ir.js'));
6
+ else {
7
+ if (typeof this['kotlin-kotlin-stdlib-js-ir'] === 'undefined') {
8
+ throw new Error("Error loading module 'colormath-root-colormath'. Its dependency 'kotlin-kotlin-stdlib-js-ir' was not found. Please, check whether 'kotlin-kotlin-stdlib-js-ir' is loaded prior to 'colormath-root-colormath'.");
9
+ }
10
+ root['colormath-root-colormath'] = factory(typeof this['colormath-root-colormath'] === 'undefined' ? {} : this['colormath-root-colormath'], this['kotlin-kotlin-stdlib-js-ir']);
11
+ }
12
+ }(this, function (_, kotlin_kotlin) {
13
+ 'use strict';
14
+ //region block: imports
15
+ var imul = Math.imul;
16
+ var log2 = Math.log2;
17
+ var protoOf = kotlin_kotlin.$_$.q9;
18
+ var classMeta = kotlin_kotlin.$_$.l8;
19
+ var VOID = kotlin_kotlin.$_$.ke;
20
+ var setMetadataFor = kotlin_kotlin.$_$.r9;
21
+ var getStringHashCode = kotlin_kotlin.$_$.s8;
22
+ var THROW_CCE = kotlin_kotlin.$_$.ld;
23
+ var objectMeta = kotlin_kotlin.$_$.p9;
24
+ var charSequenceLength = kotlin_kotlin.$_$.j8;
25
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.i;
26
+ var charSequenceGet = kotlin_kotlin.$_$.i8;
27
+ var toString = kotlin_kotlin.$_$.v1;
28
+ var copyToArray = kotlin_kotlin.$_$.d5;
29
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.r1;
30
+ var plus = kotlin_kotlin.$_$.v6;
31
+ var asList = kotlin_kotlin.$_$.l4;
32
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.q4;
33
+ var arrayConcat = kotlin_kotlin.$_$.a;
34
+ var listOf = kotlin_kotlin.$_$.l6;
35
+ var withSign = kotlin_kotlin.$_$.x9;
36
+ var coerceAtLeast = kotlin_kotlin.$_$.z9;
37
+ var getNumberHashCode = kotlin_kotlin.$_$.q8;
38
+ var equals = kotlin_kotlin.$_$.o8;
39
+ var numberToDouble = kotlin_kotlin.$_$.m9;
40
+ var interfaceMeta = kotlin_kotlin.$_$.u8;
41
+ var roundToInt = kotlin_kotlin.$_$.w9;
42
+ var coerceIn = kotlin_kotlin.$_$.da;
43
+ var DoubleCompanionObject_getInstance = kotlin_kotlin.$_$.f3;
44
+ var hashCode = kotlin_kotlin.$_$.t8;
45
+ var Char = kotlin_kotlin.$_$.wc;
46
+ var toInt = kotlin_kotlin.$_$.kc;
47
+ var numberRangeToNumber = kotlin_kotlin.$_$.k9;
48
+ var slice = kotlin_kotlin.$_$.zb;
49
+ var toString_0 = kotlin_kotlin.$_$.v9;
50
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.f1;
51
+ var startsWith = kotlin_kotlin.$_$.cc;
52
+ var coerceAtLeast_0 = kotlin_kotlin.$_$.ba;
53
+ var objectCreate = kotlin_kotlin.$_$.o9;
54
+ //endregion
55
+ //region block: pre-declaration
56
+ setMetadataFor(ColorComponentInfo, 'ColorComponentInfo', classMeta);
57
+ setMetadataFor(WhitePoint, 'WhitePoint', classMeta);
58
+ setMetadataFor(Illuminant, 'Illuminant', objectMeta);
59
+ setMetadataFor(Companion, 'Companion', objectMeta);
60
+ setMetadataFor(Ansi16, 'Ansi16', classMeta);
61
+ setMetadataFor(Companion_0, 'Companion', objectMeta);
62
+ setMetadataFor(Ansi256, 'Ansi256', classMeta);
63
+ setMetadataFor(Companion_1, 'Companion', objectMeta);
64
+ setMetadataFor(HSV, 'HSV', classMeta);
65
+ setMetadataFor(GammaTransferFunctions, 'GammaTransferFunctions', classMeta);
66
+ setMetadataFor(LinearTransferFunctions, 'LinearTransferFunctions', objectMeta);
67
+ function invoke$default(r, g, b, alpha, $super) {
68
+ alpha = alpha === VOID ? 1.0 : alpha;
69
+ return $super === VOID ? this.t2t(r, g, b, alpha) : $super.t2t.call(this, r, g, b, alpha);
70
+ }
71
+ function invoke(r, g, b, alpha) {
72
+ return this.t2t(numberToDouble(r), numberToDouble(g), numberToDouble(b), numberToDouble(alpha));
73
+ }
74
+ function invoke$default_0(r, g, b, alpha, $super) {
75
+ alpha = alpha === VOID ? 1.0 : alpha;
76
+ return $super === VOID ? this.d2u(r, g, b, alpha) : invoke(r, g, b, alpha);
77
+ }
78
+ function from255(r, g, b, alpha) {
79
+ return this.t2t(r / 255.0, g / 255.0, b / 255.0, alpha / 255.0);
80
+ }
81
+ function from255$default(r, g, b, alpha, $super) {
82
+ alpha = alpha === VOID ? 255 : alpha;
83
+ return $super === VOID ? this.e2u(r, g, b, alpha) : from255(r, g, b, alpha);
84
+ }
85
+ function invoke_0(hex) {
86
+ var tmp = parseHex(validateHex(hex), 0);
87
+ var tmp_0 = parseHex(hex, 1);
88
+ var tmp_1 = parseHex(hex, 2);
89
+ var tmp_2;
90
+ var tmp$ret$1;
91
+ // Inline function 'kotlin.let' call
92
+ var tmp0_let = get_hexLength(hex);
93
+ // Inline function 'kotlin.contracts.contract' call
94
+ var tmp$ret$0;
95
+ // Inline function 'com.github.ajalt.colormath.model.RGBColorSpace.invoke.<anonymous>' call
96
+ tmp$ret$0 = tmp0_let === 4 ? true : tmp0_let === 8;
97
+ tmp$ret$1 = tmp$ret$0;
98
+ if (tmp$ret$1) {
99
+ tmp_2 = parseHex(hex, 3);
100
+ } else {
101
+ tmp_2 = 255;
102
+ }
103
+ return this.e2u(tmp, tmp_0, tmp_1, tmp_2);
104
+ }
105
+ setMetadataFor(RGBColorSpace, 'RGBColorSpace', interfaceMeta);
106
+ setMetadataFor(Companion_2, 'Companion', objectMeta, VOID, [RGBColorSpace]);
107
+ setMetadataFor(RGB, 'RGB', classMeta);
108
+ setMetadataFor(RGBColorSpaces, 'RGBColorSpaces', objectMeta);
109
+ setMetadataFor(SRGB, 'SRGB', objectMeta, VOID, [RGBColorSpace]);
110
+ setMetadataFor(ACESccTransferFunctions, 'ACESccTransferFunctions', objectMeta);
111
+ setMetadataFor(ACEScctTransferFunctions, 'ACEScctTransferFunctions', objectMeta);
112
+ setMetadataFor(BT2020Space, 'BT2020Space', objectMeta, VOID, [RGBColorSpace]);
113
+ setMetadataFor(BT709TransferFunctions, 'BT709TransferFunctions', objectMeta);
114
+ setMetadataFor(SRGBTransferFunctions, 'SRGBTransferFunctions', objectMeta);
115
+ setMetadataFor(ROMMTransferFunctions, 'ROMMTransferFunctions', objectMeta);
116
+ setMetadataFor(RGBColorSpaceImpl, 'RGBColorSpaceImpl', classMeta, VOID, [RGBColorSpace]);
117
+ setMetadataFor(BT2020TransferFunctions, 'BT2020TransferFunctions', objectMeta);
118
+ setMetadataFor(Companion_3, 'Companion', objectMeta);
119
+ setMetadataFor(XYZ, 'XYZ', classMeta);
120
+ setMetadataFor(XYZColorSpaces, 'XYZColorSpaces', objectMeta);
121
+ setMetadataFor(XYZColorSpaceImpl, 'XYZColorSpaceImpl', classMeta);
122
+ setMetadataFor(xyY, 'xyY', classMeta);
123
+ //endregion
124
+ function ColorComponentInfo(name, isPolar) {
125
+ this.n2s_1 = name;
126
+ this.o2s_1 = isPolar;
127
+ }
128
+ function WhitePoint(name, chromaticity) {
129
+ this.p2s_1 = name;
130
+ this.q2s_1 = chromaticity;
131
+ }
132
+ protoOf(WhitePoint).toString = function () {
133
+ return this.p2s_1;
134
+ };
135
+ protoOf(WhitePoint).hashCode = function () {
136
+ var result = getStringHashCode(this.p2s_1);
137
+ result = imul(result, 31) + this.q2s_1.hashCode() | 0;
138
+ return result;
139
+ };
140
+ protoOf(WhitePoint).equals = function (other) {
141
+ if (this === other)
142
+ return true;
143
+ if (!(other instanceof WhitePoint))
144
+ return false;
145
+ var tmp0_other_with_cast = other instanceof WhitePoint ? other : THROW_CCE();
146
+ if (!(this.p2s_1 === tmp0_other_with_cast.p2s_1))
147
+ return false;
148
+ if (!this.q2s_1.equals(tmp0_other_with_cast.q2s_1))
149
+ return false;
150
+ return true;
151
+ };
152
+ function Illuminant() {
153
+ Illuminant_instance = this;
154
+ this.r2s_1 = new WhitePoint('A', xyY_init_$Create$(0.44758, 0.40745));
155
+ this.s2s_1 = new WhitePoint('B', xyY_init_$Create$(0.34842, 0.35161));
156
+ this.t2s_1 = new WhitePoint('C', xyY_init_$Create$(0.31006, 0.31616));
157
+ this.u2s_1 = new WhitePoint('D50', xyY_init_$Create$(0.3457, 0.3585));
158
+ this.v2s_1 = new WhitePoint('D55', xyY_init_$Create$(0.33243, 0.34744));
159
+ this.w2s_1 = new WhitePoint('D65', xyY_init_$Create$(0.3127, 0.329));
160
+ this.x2s_1 = new WhitePoint('D75', xyY_init_$Create$(0.29903, 0.31488));
161
+ this.y2s_1 = new WhitePoint('E', xyY_init_$Create$(0.3333333333333333, 0.3333333333333333));
162
+ }
163
+ var Illuminant_instance;
164
+ function Illuminant_getInstance() {
165
+ if (Illuminant_instance == null)
166
+ new Illuminant();
167
+ return Illuminant_instance;
168
+ }
169
+ function rectangularComponentInfo(name) {
170
+ var tmp$ret$3;
171
+ // Inline function 'kotlin.collections.toTypedArray' call
172
+ // Inline function 'kotlin.text.map' call
173
+ // Inline function 'kotlin.text.mapTo' call
174
+ var tmp0_mapTo = ArrayList_init_$Create$(charSequenceLength(name));
175
+ var inductionVariable = 0;
176
+ var last = name.length;
177
+ while (inductionVariable < last) {
178
+ var item = charSequenceGet(name, inductionVariable);
179
+ inductionVariable = inductionVariable + 1 | 0;
180
+ var tmp$ret$0;
181
+ // Inline function 'com.github.ajalt.colormath.internal.rectangularComponentInfo.<anonymous>' call
182
+ tmp$ret$0 = toString(item);
183
+ tmp0_mapTo.a(tmp$ret$0);
184
+ }
185
+ tmp$ret$3 = copyToArray(tmp0_mapTo);
186
+ return rectangularComponentInfo_0(tmp$ret$3.slice());
187
+ }
188
+ function polarComponentInfo(name) {
189
+ // Inline function 'kotlin.text.map' call
190
+ // Inline function 'kotlin.text.mapTo' call
191
+ var tmp0_mapTo = ArrayList_init_$Create$(charSequenceLength(name));
192
+ var inductionVariable = 0;
193
+ var last = name.length;
194
+ while (inductionVariable < last) {
195
+ var item = charSequenceGet(name, inductionVariable);
196
+ inductionVariable = inductionVariable + 1 | 0;
197
+ var tmp$ret$0;
198
+ // Inline function 'com.github.ajalt.colormath.internal.polarComponentInfo.<anonymous>' call
199
+ tmp$ret$0 = new ColorComponentInfo(toString(item), item === _Char___init__impl__6a9atx(72));
200
+ tmp0_mapTo.a(tmp$ret$0);
201
+ }
202
+ return plus(tmp0_mapTo, new ColorComponentInfo('alpha', false));
203
+ }
204
+ function rectangularComponentInfo_0(names) {
205
+ // Inline function 'kotlin.collections.map' call
206
+ var tmp0_map = plus(asList(names), 'alpha');
207
+ // Inline function 'kotlin.collections.mapTo' call
208
+ var tmp0_mapTo = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_map, 10));
209
+ var tmp0_iterator = tmp0_map.c();
210
+ while (tmp0_iterator.d()) {
211
+ var item = tmp0_iterator.e();
212
+ var tmp$ret$0;
213
+ // Inline function 'com.github.ajalt.colormath.internal.rectangularComponentInfo.<anonymous>' call
214
+ tmp$ret$0 = new ColorComponentInfo(item, false);
215
+ tmp0_mapTo.a(tmp$ret$0);
216
+ }
217
+ return tmp0_mapTo;
218
+ }
219
+ function componentInfoList(c) {
220
+ return listOf(arrayConcat([c, [new ColorComponentInfo('alpha', false)]]));
221
+ }
222
+ function get_CAT02_XYZ_TO_LMS() {
223
+ _init_properties_Constants_kt__atb1ur();
224
+ return CAT02_XYZ_TO_LMS;
225
+ }
226
+ var CAT02_XYZ_TO_LMS;
227
+ function get_CAT02_LMS_TO_XYZ() {
228
+ _init_properties_Constants_kt__atb1ur();
229
+ return CAT02_LMS_TO_XYZ;
230
+ }
231
+ var CAT02_LMS_TO_XYZ;
232
+ var properties_initialized_Constants_kt_w4w61t;
233
+ function _init_properties_Constants_kt__atb1ur() {
234
+ if (!properties_initialized_Constants_kt_w4w61t) {
235
+ properties_initialized_Constants_kt_w4w61t = true;
236
+ CAT02_XYZ_TO_LMS = _Matrix___init__impl__q3kp4w_0(0.7328, 0.4296, -0.1624, -0.7036, 1.6975, 0.0061, 0.003, 0.0136, 0.9834);
237
+ CAT02_LMS_TO_XYZ = inverse(get_CAT02_XYZ_TO_LMS());
238
+ }
239
+ }
240
+ function spow(_this__u8e3s4, p) {
241
+ return spow_0(_this__u8e3s4, p);
242
+ }
243
+ function normalizeDeg(_this__u8e3s4) {
244
+ return (_this__u8e3s4 % 360.0 + 360.0) % 360.0;
245
+ }
246
+ function spow_0(_this__u8e3s4, p) {
247
+ var tmp$ret$1;
248
+ // Inline function 'kotlin.math.pow' call
249
+ // Inline function 'kotlin.math.absoluteValue' call
250
+ var tmp0_pow = Math.abs(_this__u8e3s4);
251
+ tmp$ret$1 = Math.pow(tmp0_pow, p);
252
+ return withSign(tmp$ret$1, _this__u8e3s4);
253
+ }
254
+ function normalizeDeg_0(_this__u8e3s4) {
255
+ return (_this__u8e3s4 % 360.0 + 360.0) % 360.0;
256
+ }
257
+ function _Matrix___init__impl__q3kp4w(rowMajor) {
258
+ return rowMajor;
259
+ }
260
+ function _Matrix___get_rowMajor__impl__vmgxkq($this) {
261
+ return $this;
262
+ }
263
+ function _Matrix___init__impl__q3kp4w_0(v00, v10, v20, v01, v11, v21, v02, v12, v22) {
264
+ var tmp$ret$0;
265
+ // Inline function 'kotlin.floatArrayOf' call
266
+ tmp$ret$0 = new Float32Array([v00, v10, v20, v01, v11, v21, v02, v12, v22]);
267
+ return _Matrix___init__impl__q3kp4w(tmp$ret$0);
268
+ }
269
+ function Matrix__copy_impl_kmkvzd($this) {
270
+ var tmp$ret$1;
271
+ // Inline function 'kotlin.collections.copyOf' call
272
+ // Inline function 'kotlin.js.asDynamic' call
273
+ tmp$ret$1 = _Matrix___get_rowMajor__impl__vmgxkq($this).slice();
274
+ return _Matrix___init__impl__q3kp4w(tmp$ret$1);
275
+ }
276
+ function Matrix__get_impl_xogbpk($this, x, y) {
277
+ return _Matrix___get_rowMajor__impl__vmgxkq($this)[imul(y, 3) + x | 0];
278
+ }
279
+ function Matrix__set_impl_s2l54c($this, x, y, value) {
280
+ _Matrix___get_rowMajor__impl__vmgxkq($this)[imul(y, 3) + x | 0] = value;
281
+ }
282
+ function Matrix__set_impl_s2l54c_0($this, x, y, value) {
283
+ return Matrix__set_impl_s2l54c($this, x, y, value);
284
+ }
285
+ function inverse(_this__u8e3s4, inPlace) {
286
+ inPlace = inPlace === VOID ? false : inPlace;
287
+ var a = Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 0);
288
+ var b = Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 0);
289
+ var c = Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 0);
290
+ var d = Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 1);
291
+ var e = Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 1);
292
+ var f = Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 1);
293
+ var g = Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 2);
294
+ var h = Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 2);
295
+ var i = Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 2);
296
+ var A = e * i - h * f;
297
+ var B = h * c - b * i;
298
+ var C = b * f - e * c;
299
+ var det = a * A + d * B + g * C;
300
+ var out = inPlace ? _this__u8e3s4 : Matrix__copy_impl_kmkvzd(_this__u8e3s4);
301
+ Matrix__set_impl_s2l54c_0(out, 0, 0, A / det);
302
+ Matrix__set_impl_s2l54c_0(out, 0, 1, (g * f - d * i) / det);
303
+ Matrix__set_impl_s2l54c_0(out, 0, 2, (d * h - g * e) / det);
304
+ Matrix__set_impl_s2l54c_0(out, 1, 0, B / det);
305
+ Matrix__set_impl_s2l54c_0(out, 1, 1, (a * i - g * c) / det);
306
+ Matrix__set_impl_s2l54c_0(out, 1, 2, (g * b - a * h) / det);
307
+ Matrix__set_impl_s2l54c_0(out, 2, 0, C / det);
308
+ Matrix__set_impl_s2l54c_0(out, 2, 1, (d * c - a * f) / det);
309
+ Matrix__set_impl_s2l54c_0(out, 2, 2, (a * e - d * b) / det);
310
+ return out;
311
+ }
312
+ function dot(_this__u8e3s4, other) {
313
+ return _Matrix___init__impl__q3kp4w_0(dot$f(_this__u8e3s4, other, 0, 0), dot$f(_this__u8e3s4, other, 1, 0), dot$f(_this__u8e3s4, other, 2, 0), dot$f(_this__u8e3s4, other, 0, 1), dot$f(_this__u8e3s4, other, 1, 1), dot$f(_this__u8e3s4, other, 2, 1), dot$f(_this__u8e3s4, other, 0, 2), dot$f(_this__u8e3s4, other, 1, 2), dot$f(_this__u8e3s4, other, 2, 2));
314
+ }
315
+ function dotDiagonal(_this__u8e3s4, v0, v1, v2) {
316
+ return _Matrix___init__impl__q3kp4w_0(Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 0) * v0, Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 0) * v1, Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 0) * v2, Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 1) * v0, Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 1) * v1, Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 1) * v2, Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 2) * v0, Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 2) * v1, Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 2) * v2);
317
+ }
318
+ function _Vector___init__impl__y7x4qq(values) {
319
+ return values;
320
+ }
321
+ function _Vector___get_values__impl__3gdbp5($this) {
322
+ return $this;
323
+ }
324
+ function _Vector___init__impl__y7x4qq_0(v0, v1, v2) {
325
+ var tmp$ret$0;
326
+ // Inline function 'kotlin.floatArrayOf' call
327
+ tmp$ret$0 = new Float32Array([v0, v1, v2]);
328
+ return _Vector___init__impl__y7x4qq(tmp$ret$0);
329
+ }
330
+ function _Vector___get_l__impl__envr1l($this) {
331
+ return _Vector___get_values__impl__3gdbp5($this)[0];
332
+ }
333
+ function _Vector___get_m__impl__e5qq0m($this) {
334
+ return _Vector___get_values__impl__3gdbp5($this)[1];
335
+ }
336
+ function _Vector___get_s__impl__pzuljk($this) {
337
+ return _Vector___get_values__impl__3gdbp5($this)[2];
338
+ }
339
+ function dot_0(_this__u8e3s4, v0, v1, v2) {
340
+ // Inline function 'com.github.ajalt.colormath.internal.dot' call
341
+ return _Vector___init__impl__y7x4qq_0(Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 0) * v0 + Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 0) * v1 + Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 0) * v2, Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 1) * v0 + Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 1) * v1 + Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 1) * v2, Matrix__get_impl_xogbpk(_this__u8e3s4, 0, 2) * v0 + Matrix__get_impl_xogbpk(_this__u8e3s4, 1, 2) * v1 + Matrix__get_impl_xogbpk(_this__u8e3s4, 2, 2) * v2);
342
+ }
343
+ function dot$f($this_dot, $other, x, y) {
344
+ return Matrix__get_impl_xogbpk($this_dot, 0, y) * Matrix__get_impl_xogbpk($other, x, 0) + Matrix__get_impl_xogbpk($this_dot, 1, y) * Matrix__get_impl_xogbpk($other, x, 1) + Matrix__get_impl_xogbpk($this_dot, 2, y) * Matrix__get_impl_xogbpk($other, x, 2);
345
+ }
346
+ function Companion() {
347
+ Companion_instance = this;
348
+ this.z2s_1 = componentInfoList([new ColorComponentInfo('code', false)]);
349
+ }
350
+ var Companion_instance;
351
+ function Companion_getInstance() {
352
+ if (Companion_instance == null)
353
+ new Companion();
354
+ return Companion_instance;
355
+ }
356
+ function Ansi16(code) {
357
+ Companion_getInstance();
358
+ this.a2t_1 = code;
359
+ }
360
+ protoOf(Ansi16).b2t = function () {
361
+ switch (this.a2t_1) {
362
+ case 30:
363
+ case 40:
364
+ return Companion_getInstance_2().c2t(0.0, 0.0, 0.0);
365
+ case 90:
366
+ case 100:
367
+ return Companion_getInstance_2().d2t(128, 128, 128);
368
+ case 37:
369
+ case 47:
370
+ return Companion_getInstance_2().d2t(192, 192, 192);
371
+ case 97:
372
+ case 107:
373
+ return Companion_getInstance_2().c2t(1.0, 1.0, 1.0);
374
+ }
375
+ var color = this.a2t_1 % 10 | 0;
376
+ var mul = this.a2t_1 > 50 ? 1.0 : 0.5;
377
+ var r = (color % 2 | 0) * mul;
378
+ var g = ((color / 2 | 0) % 2 | 0) * mul;
379
+ var b = ((color / 4 | 0) % 2 | 0) * mul;
380
+ return Companion_getInstance_2().c2t(r, g, b);
381
+ };
382
+ protoOf(Ansi16).toString = function () {
383
+ return 'Ansi16(code=' + this.a2t_1 + ')';
384
+ };
385
+ protoOf(Ansi16).hashCode = function () {
386
+ return this.a2t_1;
387
+ };
388
+ protoOf(Ansi16).equals = function (other) {
389
+ if (this === other)
390
+ return true;
391
+ if (!(other instanceof Ansi16))
392
+ return false;
393
+ var tmp0_other_with_cast = other instanceof Ansi16 ? other : THROW_CCE();
394
+ if (!(this.a2t_1 === tmp0_other_with_cast.a2t_1))
395
+ return false;
396
+ return true;
397
+ };
398
+ function Companion_0() {
399
+ Companion_instance_0 = this;
400
+ this.e2t_1 = componentInfoList([new ColorComponentInfo('code', false)]);
401
+ }
402
+ var Companion_instance_0;
403
+ function Companion_getInstance_0() {
404
+ if (Companion_instance_0 == null)
405
+ new Companion_0();
406
+ return Companion_instance_0;
407
+ }
408
+ function Ansi256(code) {
409
+ Companion_getInstance_0();
410
+ this.f2t_1 = code;
411
+ }
412
+ protoOf(Ansi256).b2t = function () {
413
+ if (this.f2t_1 < 16)
414
+ return this.g2t().b2t();
415
+ if (this.f2t_1 >= 232) {
416
+ var c = imul(this.f2t_1 - 232 | 0, 10) + 8 | 0;
417
+ return Companion_getInstance_2().d2t(c, c, c);
418
+ }
419
+ var c_0 = this.f2t_1 - 16 | 0;
420
+ var rem = c_0 % 36 | 0;
421
+ // Inline function 'kotlin.math.floor' call
422
+ var tmp0_floor = c_0 / 36.0;
423
+ var r = Math.floor(tmp0_floor) / 5.0;
424
+ // Inline function 'kotlin.math.floor' call
425
+ var tmp1_floor = rem / 6.0;
426
+ var g = Math.floor(tmp1_floor) / 5.0;
427
+ var b = (rem % 6 | 0) / 5.0;
428
+ return Companion_getInstance_2().h2t(r, g, b);
429
+ };
430
+ protoOf(Ansi256).g2t = function () {
431
+ return this.f2t_1 < 8 ? new Ansi16(this.f2t_1 + 30 | 0) : this.f2t_1 < 16 ? new Ansi16((this.f2t_1 - 8 | 0) + 90 | 0) : this.b2t().g2t();
432
+ };
433
+ protoOf(Ansi256).toString = function () {
434
+ return 'Ansi256(code=' + this.f2t_1 + ')';
435
+ };
436
+ protoOf(Ansi256).hashCode = function () {
437
+ return this.f2t_1;
438
+ };
439
+ protoOf(Ansi256).equals = function (other) {
440
+ if (this === other)
441
+ return true;
442
+ if (!(other instanceof Ansi256))
443
+ return false;
444
+ var tmp0_other_with_cast = other instanceof Ansi256 ? other : THROW_CCE();
445
+ if (!(this.f2t_1 === tmp0_other_with_cast.f2t_1))
446
+ return false;
447
+ return true;
448
+ };
449
+ function Companion_1() {
450
+ Companion_instance_1 = this;
451
+ this.n2t_1 = polarComponentInfo('HSV');
452
+ }
453
+ var Companion_instance_1;
454
+ function Companion_getInstance_1() {
455
+ if (Companion_instance_1 == null)
456
+ new Companion_1();
457
+ return Companion_instance_1;
458
+ }
459
+ function toSRGB$f(h, v, s, n) {
460
+ var k = (n + h) % 6;
461
+ var tmp = v * s;
462
+ var tmp$ret$0;
463
+ // Inline function 'kotlin.comparisons.minOf' call
464
+ var tmp0_minOf = 4 - k;
465
+ tmp$ret$0 = Math.min(k, tmp0_minOf, 1.0);
466
+ return v - tmp * coerceAtLeast(tmp$ret$0, 0.0);
467
+ }
468
+ function HSV(h, s, v, alpha) {
469
+ Companion_getInstance_1();
470
+ alpha = alpha === VOID ? 1.0 : alpha;
471
+ this.o2t_1 = h;
472
+ this.p2t_1 = s;
473
+ this.q2t_1 = v;
474
+ this.r2t_1 = alpha;
475
+ }
476
+ protoOf(HSV).b2t = function () {
477
+ if (this.p2t_1 < 1.0E-7)
478
+ return Companion_getInstance_2().t2t(this.q2t_1, this.q2t_1, this.q2t_1, this.r2t_1);
479
+ var v = this.q2t_1;
480
+ var h = normalizeDeg_0(this.o2t_1) / 60.0;
481
+ var s = this.p2t_1;
482
+ return SRGB_getInstance().t2t(toSRGB$f(h, v, s, 5), toSRGB$f(h, v, s, 3), toSRGB$f(h, v, s, 1), this.r2t_1);
483
+ };
484
+ protoOf(HSV).toString = function () {
485
+ return 'HSV(h=' + this.o2t_1 + ', s=' + this.p2t_1 + ', v=' + this.q2t_1 + ', alpha=' + this.r2t_1 + ')';
486
+ };
487
+ protoOf(HSV).hashCode = function () {
488
+ var result = getNumberHashCode(this.o2t_1);
489
+ result = imul(result, 31) + getNumberHashCode(this.p2t_1) | 0;
490
+ result = imul(result, 31) + getNumberHashCode(this.q2t_1) | 0;
491
+ result = imul(result, 31) + getNumberHashCode(this.r2t_1) | 0;
492
+ return result;
493
+ };
494
+ protoOf(HSV).equals = function (other) {
495
+ if (this === other)
496
+ return true;
497
+ if (!(other instanceof HSV))
498
+ return false;
499
+ var tmp0_other_with_cast = other instanceof HSV ? other : THROW_CCE();
500
+ if (!equals(this.o2t_1, tmp0_other_with_cast.o2t_1))
501
+ return false;
502
+ if (!equals(this.p2t_1, tmp0_other_with_cast.p2t_1))
503
+ return false;
504
+ if (!equals(this.q2t_1, tmp0_other_with_cast.q2t_1))
505
+ return false;
506
+ if (!equals(this.r2t_1, tmp0_other_with_cast.r2t_1))
507
+ return false;
508
+ return true;
509
+ };
510
+ function GammaTransferFunctions(gamma) {
511
+ this.a2u_1 = gamma;
512
+ }
513
+ protoOf(GammaTransferFunctions).b2u = function (x) {
514
+ return spow(x, this.a2u_1);
515
+ };
516
+ protoOf(GammaTransferFunctions).c2u = function (x) {
517
+ return spow(x, 1.0 / this.a2u_1);
518
+ };
519
+ protoOf(GammaTransferFunctions).toString = function () {
520
+ return 'GammaTransferFunctions(gamma=' + this.a2u_1 + ')';
521
+ };
522
+ protoOf(GammaTransferFunctions).hashCode = function () {
523
+ return getNumberHashCode(this.a2u_1);
524
+ };
525
+ protoOf(GammaTransferFunctions).equals = function (other) {
526
+ if (this === other)
527
+ return true;
528
+ if (!(other instanceof GammaTransferFunctions))
529
+ return false;
530
+ var tmp0_other_with_cast = other instanceof GammaTransferFunctions ? other : THROW_CCE();
531
+ if (!equals(this.a2u_1, tmp0_other_with_cast.a2u_1))
532
+ return false;
533
+ return true;
534
+ };
535
+ function LinearTransferFunctions() {
536
+ LinearTransferFunctions_instance = this;
537
+ }
538
+ protoOf(LinearTransferFunctions).b2u = function (x) {
539
+ return x;
540
+ };
541
+ protoOf(LinearTransferFunctions).c2u = function (x) {
542
+ return x;
543
+ };
544
+ var LinearTransferFunctions_instance;
545
+ function LinearTransferFunctions_getInstance() {
546
+ if (LinearTransferFunctions_instance == null)
547
+ new LinearTransferFunctions();
548
+ return LinearTransferFunctions_instance;
549
+ }
550
+ function RGBColorSpace() {
551
+ }
552
+ function Companion_2() {
553
+ Companion_instance_2 = this;
554
+ this.s2t_1 = RGBColorSpaces_getInstance().k2u_1;
555
+ }
556
+ protoOf(Companion_2).i2u = function () {
557
+ return this.s2t_1.i2u();
558
+ };
559
+ protoOf(Companion_2).h2u = function () {
560
+ return this.s2t_1.h2u();
561
+ };
562
+ protoOf(Companion_2).g2u = function () {
563
+ return this.s2t_1.g2u();
564
+ };
565
+ protoOf(Companion_2).j2u = function () {
566
+ return this.s2t_1.j2u();
567
+ };
568
+ protoOf(Companion_2).e2u = function (r, g, b, alpha) {
569
+ return this.s2t_1.e2u(r, g, b, alpha);
570
+ };
571
+ protoOf(Companion_2).t2t = function (r, g, b, alpha) {
572
+ return this.s2t_1.t2t(r, g, b, alpha);
573
+ };
574
+ protoOf(Companion_2).d2u = function (r, g, b, alpha) {
575
+ return this.s2t_1.d2u(r, g, b, alpha);
576
+ };
577
+ protoOf(Companion_2).f2u = function (hex) {
578
+ return this.s2t_1.f2u(hex);
579
+ };
580
+ var Companion_instance_2;
581
+ function Companion_getInstance_2() {
582
+ if (Companion_instance_2 == null)
583
+ new Companion_2();
584
+ return Companion_instance_2;
585
+ }
586
+ function RGB(r, g, b, alpha, space) {
587
+ Companion_getInstance_2();
588
+ this.i2t_1 = r;
589
+ this.j2t_1 = g;
590
+ this.k2t_1 = b;
591
+ this.l2t_1 = alpha;
592
+ this.m2t_1 = space;
593
+ }
594
+ protoOf(RGB).w2u = function () {
595
+ // Inline function 'kotlin.math.roundToInt' call
596
+ var tmp0_roundToInt = this.i2t_1 * 255;
597
+ return roundToInt(tmp0_roundToInt);
598
+ };
599
+ protoOf(RGB).x2u = function () {
600
+ // Inline function 'kotlin.math.roundToInt' call
601
+ var tmp0_roundToInt = this.j2t_1 * 255;
602
+ return roundToInt(tmp0_roundToInt);
603
+ };
604
+ protoOf(RGB).y2u = function () {
605
+ // Inline function 'kotlin.math.roundToInt' call
606
+ var tmp0_roundToInt = this.k2t_1 * 255;
607
+ return roundToInt(tmp0_roundToInt);
608
+ };
609
+ protoOf(RGB).z2u = function (space) {
610
+ var f = SRGB_getInstance().x2t_1;
611
+ return equals(this.m2t_1, space) ? this : (equals(this.m2t_1, SRGB_getInstance()) ? equals(space, RGBColorSpaces_getInstance().l2u_1) : false) ? space.t2t(f.b2u(this.i2t_1), f.b2u(this.j2t_1), f.b2u(this.k2t_1), this.l2t_1) : (equals(this.m2t_1, RGBColorSpaces_getInstance().l2u_1) ? equals(space, SRGB_getInstance()) : false) ? space.t2t(f.c2u(this.i2t_1), f.c2u(this.j2t_1), f.c2u(this.k2t_1), this.l2t_1) : this.a2v().g2v(space);
612
+ };
613
+ protoOf(RGB).h2v = function () {
614
+ return this.i2v(coerceIn(this.i2t_1, 0.0, 1.0), coerceIn(this.j2t_1, 0.0, 1.0), coerceIn(this.k2t_1, 0.0, 1.0), coerceIn(this.l2t_1, 0.0, 1.0));
615
+ };
616
+ protoOf(RGB).j2v = function () {
617
+ var tmp$ret$3;
618
+ $l$block: {
619
+ // Inline function 'com.github.ajalt.colormath.model.RGB.srgbHueMinMaxChroma' call
620
+ // Inline function 'com.github.ajalt.colormath.model.RGB.toSRGB' call
621
+ var tmp0_anonymous = this.z2u(SRGB_getInstance());
622
+ var r = tmp0_anonymous.i2t_1;
623
+ var g = tmp0_anonymous.j2t_1;
624
+ var b = tmp0_anonymous.k2t_1;
625
+ // Inline function 'kotlin.comparisons.minOf' call
626
+ var min = Math.min(r, g, b);
627
+ // Inline function 'kotlin.comparisons.maxOf' call
628
+ var max = Math.max(r, g, b);
629
+ var chroma = max - min;
630
+ var tmp;
631
+ if (chroma < 1.0E-7) {
632
+ DoubleCompanionObject_getInstance();
633
+ tmp = NaN;
634
+ } else if (r === max) {
635
+ tmp = (g - b) / chroma;
636
+ } else if (g === max) {
637
+ tmp = 2 + (b - r) / chroma;
638
+ } else if (b === max) {
639
+ tmp = 4 + (r - g) / chroma;
640
+ } else {
641
+ tmp = 0.0;
642
+ }
643
+ var h = tmp * 60;
644
+ // Inline function 'com.github.ajalt.colormath.model.RGB.toHSV.<anonymous>' call
645
+ var tmp0_anonymous_0 = normalizeDeg(h);
646
+ var s = max === 0.0 ? 0.0 : chroma / max;
647
+ tmp$ret$3 = new HSV(tmp0_anonymous_0, s, max, this.l2t_1);
648
+ break $l$block;
649
+ }
650
+ return tmp$ret$3;
651
+ };
652
+ protoOf(RGB).a2v = function () {
653
+ var f = this.m2t_1.g2u();
654
+ // Inline function 'com.github.ajalt.colormath.internal.dot' call
655
+ var tmp0_dot = _Matrix___init__impl__q3kp4w(this.m2t_1.h2u());
656
+ var tmp1_dot = f.b2u(this.i2t_1);
657
+ var tmp2_dot = f.b2u(this.j2t_1);
658
+ var tmp3_dot = f.b2u(this.k2t_1);
659
+ // Inline function 'com.github.ajalt.colormath.model.RGB.toXYZ.<anonymous>' call
660
+ var tmp4_anonymous = Matrix__get_impl_xogbpk(tmp0_dot, 0, 0) * tmp1_dot + Matrix__get_impl_xogbpk(tmp0_dot, 1, 0) * tmp2_dot + Matrix__get_impl_xogbpk(tmp0_dot, 2, 0) * tmp3_dot;
661
+ var tmp5_anonymous = Matrix__get_impl_xogbpk(tmp0_dot, 0, 1) * tmp1_dot + Matrix__get_impl_xogbpk(tmp0_dot, 1, 1) * tmp2_dot + Matrix__get_impl_xogbpk(tmp0_dot, 2, 1) * tmp3_dot;
662
+ var tmp6_anonymous = Matrix__get_impl_xogbpk(tmp0_dot, 0, 2) * tmp1_dot + Matrix__get_impl_xogbpk(tmp0_dot, 1, 2) * tmp2_dot + Matrix__get_impl_xogbpk(tmp0_dot, 2, 2) * tmp3_dot;
663
+ return XYZColorSpace(this.m2t_1.j2u()).t2t(tmp4_anonymous, tmp5_anonymous, tmp6_anonymous, this.l2t_1);
664
+ };
665
+ protoOf(RGB).g2t = function () {
666
+ // Inline function 'com.github.ajalt.colormath.model.RGB.toSRGB' call
667
+ var tmp0_anonymous = this.z2u(SRGB_getInstance());
668
+ // Inline function 'kotlin.math.roundToInt' call
669
+ var tmp0_roundToInt = tmp0_anonymous.j2v().q2t_1 * 100;
670
+ var value = roundToInt(tmp0_roundToInt);
671
+ if (value === 30)
672
+ return new Ansi16(30);
673
+ var v = value / 50 | 0;
674
+ var tmp$ret$1;
675
+ // Inline function 'kotlin.math.roundToInt' call
676
+ var tmp1_roundToInt = tmp0_anonymous.k2t_1;
677
+ tmp$ret$1 = roundToInt(tmp1_roundToInt);
678
+ var tmp = imul(tmp$ret$1, 4);
679
+ var tmp$ret$2;
680
+ // Inline function 'kotlin.math.roundToInt' call
681
+ var tmp2_roundToInt = tmp0_anonymous.j2t_1;
682
+ tmp$ret$2 = roundToInt(tmp2_roundToInt);
683
+ var tmp_0 = tmp | imul(tmp$ret$2, 2);
684
+ // Inline function 'kotlin.math.roundToInt' call
685
+ var tmp3_roundToInt = tmp0_anonymous.i2t_1;
686
+ var ansi = 30 + (tmp_0 | roundToInt(tmp3_roundToInt)) | 0;
687
+ return new Ansi16(v === 2 ? ansi + 60 | 0 : ansi);
688
+ };
689
+ protoOf(RGB).k2v = function () {
690
+ // Inline function 'com.github.ajalt.colormath.model.RGB.toSRGB' call
691
+ var tmp0_anonymous = this.z2u(SRGB_getInstance());
692
+ var ri = tmp0_anonymous.w2u();
693
+ var gi = tmp0_anonymous.x2u();
694
+ var bi = tmp0_anonymous.y2u();
695
+ var tmp;
696
+ if (ri === gi ? gi === bi : false) {
697
+ tmp = ri < 8 ? 16 : ri > 248 ? 231 : roundToInt((ri - 8 | 0) / 247.0 * 24.0) + 232 | 0;
698
+ } else {
699
+ var tmp$ret$0;
700
+ // Inline function 'kotlin.math.roundToInt' call
701
+ var tmp0_roundToInt = tmp0_anonymous.i2t_1 * 5;
702
+ tmp$ret$0 = roundToInt(tmp0_roundToInt);
703
+ var tmp_0 = 16 + imul(36, tmp$ret$0) | 0;
704
+ var tmp$ret$1;
705
+ // Inline function 'kotlin.math.roundToInt' call
706
+ var tmp1_roundToInt = tmp0_anonymous.j2t_1 * 5;
707
+ tmp$ret$1 = roundToInt(tmp1_roundToInt);
708
+ var tmp_1 = tmp_0 + imul(6, tmp$ret$1) | 0;
709
+ // Inline function 'kotlin.math.roundToInt' call
710
+ var tmp2_roundToInt = tmp0_anonymous.k2t_1 * 5;
711
+ tmp = tmp_1 + roundToInt(tmp2_roundToInt) | 0;
712
+ }
713
+ var code = tmp;
714
+ return new Ansi256(code);
715
+ };
716
+ protoOf(RGB).b2t = function () {
717
+ return this.z2u(RGBColorSpaces_getInstance().k2u_1);
718
+ };
719
+ protoOf(RGB).l2v = function (r, g, b, alpha, space) {
720
+ return new RGB(r, g, b, alpha, space);
721
+ };
722
+ protoOf(RGB).i2v = function (r, g, b, alpha, space, $super) {
723
+ r = r === VOID ? this.i2t_1 : r;
724
+ g = g === VOID ? this.j2t_1 : g;
725
+ b = b === VOID ? this.k2t_1 : b;
726
+ alpha = alpha === VOID ? this.l2t_1 : alpha;
727
+ space = space === VOID ? this.m2t_1 : space;
728
+ return $super === VOID ? this.l2v(r, g, b, alpha, space) : $super.l2v.call(this, r, g, b, alpha, space);
729
+ };
730
+ protoOf(RGB).toString = function () {
731
+ return 'RGB(r=' + this.i2t_1 + ', g=' + this.j2t_1 + ', b=' + this.k2t_1 + ', alpha=' + this.l2t_1 + ', space=' + this.m2t_1 + ')';
732
+ };
733
+ protoOf(RGB).hashCode = function () {
734
+ var result = getNumberHashCode(this.i2t_1);
735
+ result = imul(result, 31) + getNumberHashCode(this.j2t_1) | 0;
736
+ result = imul(result, 31) + getNumberHashCode(this.k2t_1) | 0;
737
+ result = imul(result, 31) + getNumberHashCode(this.l2t_1) | 0;
738
+ result = imul(result, 31) + hashCode(this.m2t_1) | 0;
739
+ return result;
740
+ };
741
+ protoOf(RGB).equals = function (other) {
742
+ if (this === other)
743
+ return true;
744
+ if (!(other instanceof RGB))
745
+ return false;
746
+ var tmp0_other_with_cast = other instanceof RGB ? other : THROW_CCE();
747
+ if (!equals(this.i2t_1, tmp0_other_with_cast.i2t_1))
748
+ return false;
749
+ if (!equals(this.j2t_1, tmp0_other_with_cast.j2t_1))
750
+ return false;
751
+ if (!equals(this.k2t_1, tmp0_other_with_cast.k2t_1))
752
+ return false;
753
+ if (!equals(this.l2t_1, tmp0_other_with_cast.l2t_1))
754
+ return false;
755
+ if (!equals(this.m2t_1, tmp0_other_with_cast.m2t_1))
756
+ return false;
757
+ return true;
758
+ };
759
+ function parseHex(_this__u8e3s4, startIndex) {
760
+ var tmp;
761
+ if (get_hexLength(_this__u8e3s4) > 4) {
762
+ var i = charSequenceGet(_this__u8e3s4, 0) === _Char___init__impl__6a9atx(35) ? imul(startIndex, 2) + 1 | 0 : imul(startIndex, 2);
763
+ tmp = toInt(slice(_this__u8e3s4, numberRangeToNumber(i, i + 1 | 0)), 16);
764
+ } else {
765
+ var i_0 = charSequenceGet(_this__u8e3s4, 0) === _Char___init__impl__6a9atx(35) ? startIndex + 1 | 0 : startIndex;
766
+ var tmp$ret$1;
767
+ // Inline function 'kotlin.let' call
768
+ var tmp0_let = charSequenceGet(_this__u8e3s4, i_0);
769
+ // Inline function 'kotlin.contracts.contract' call
770
+ // Inline function 'com.github.ajalt.colormath.model.parseHex.<anonymous>' call
771
+ tmp$ret$1 = '' + new Char(tmp0_let) + new Char(tmp0_let);
772
+ tmp = toInt(tmp$ret$1, 16);
773
+ }
774
+ return tmp;
775
+ }
776
+ function validateHex(_this__u8e3s4) {
777
+ // Inline function 'kotlin.apply' call
778
+ // Inline function 'kotlin.contracts.contract' call
779
+ // Inline function 'com.github.ajalt.colormath.model.validateHex.<anonymous>' call
780
+ // Inline function 'kotlin.require' call
781
+ // Inline function 'kotlin.let' call
782
+ var tmp0_let = get_hexLength(_this__u8e3s4);
783
+ // Inline function 'kotlin.contracts.contract' call
784
+ var tmp$ret$0;
785
+ // Inline function 'com.github.ajalt.colormath.model.validateHex.<anonymous>.<anonymous>' call
786
+ switch (tmp0_let) {
787
+ case 3:
788
+ case 4:
789
+ case 6:
790
+ tmp$ret$0 = true;
791
+ break;
792
+ default:
793
+ tmp$ret$0 = tmp0_let === 8;
794
+ break;
795
+ }
796
+ // Inline function 'kotlin.contracts.contract' call
797
+ if (!tmp$ret$0) {
798
+ // Inline function 'com.github.ajalt.colormath.model.validateHex.<anonymous>.<anonymous>' call
799
+ var message = 'Hex string must be in the format "#ffffff" or "ffffff"';
800
+ throw IllegalArgumentException_init_$Create$(toString_0(message));
801
+ }
802
+ return _this__u8e3s4;
803
+ }
804
+ function get_hexLength(_this__u8e3s4) {
805
+ return startsWith(_this__u8e3s4, '#') ? _this__u8e3s4.length - 1 | 0 : _this__u8e3s4.length;
806
+ }
807
+ function get_SRGB_R() {
808
+ _init_properties_RGBColorSpaces_kt__nc9fsz();
809
+ return SRGB_R;
810
+ }
811
+ var SRGB_R;
812
+ function get_SRGB_G() {
813
+ _init_properties_RGBColorSpaces_kt__nc9fsz();
814
+ return SRGB_G;
815
+ }
816
+ var SRGB_G;
817
+ function get_SRGB_B() {
818
+ _init_properties_RGBColorSpaces_kt__nc9fsz();
819
+ return SRGB_B;
820
+ }
821
+ var SRGB_B;
822
+ function get_ACES_WHITE_POINT() {
823
+ _init_properties_RGBColorSpaces_kt__nc9fsz();
824
+ return ACES_WHITE_POINT;
825
+ }
826
+ var ACES_WHITE_POINT;
827
+ function get_ACES_AP0_R() {
828
+ _init_properties_RGBColorSpaces_kt__nc9fsz();
829
+ return ACES_AP0_R;
830
+ }
831
+ var ACES_AP0_R;
832
+ function get_ACES_AP0_G() {
833
+ _init_properties_RGBColorSpaces_kt__nc9fsz();
834
+ return ACES_AP0_G;
835
+ }
836
+ var ACES_AP0_G;
837
+ function get_ACES_AP0_B() {
838
+ _init_properties_RGBColorSpaces_kt__nc9fsz();
839
+ return ACES_AP0_B;
840
+ }
841
+ var ACES_AP0_B;
842
+ function get_ACES_AP1_R() {
843
+ _init_properties_RGBColorSpaces_kt__nc9fsz();
844
+ return ACES_AP1_R;
845
+ }
846
+ var ACES_AP1_R;
847
+ function get_ACES_AP1_G() {
848
+ _init_properties_RGBColorSpaces_kt__nc9fsz();
849
+ return ACES_AP1_G;
850
+ }
851
+ var ACES_AP1_G;
852
+ function get_ACES_AP1_B() {
853
+ _init_properties_RGBColorSpaces_kt__nc9fsz();
854
+ return ACES_AP1_B;
855
+ }
856
+ var ACES_AP1_B;
857
+ function RGBColorSpaces() {
858
+ RGBColorSpaces_instance = this;
859
+ this.k2u_1 = SRGB_getInstance();
860
+ this.l2u_1 = RGBColorSpace_0('Linear sRGB', Illuminant_getInstance().w2s_1, LinearTransferFunctions_getInstance(), get_SRGB_R(), get_SRGB_G(), get_SRGB_B());
861
+ this.m2u_1 = RGBColorSpace_0('ACES2065-1', get_ACES_WHITE_POINT(), LinearTransferFunctions_getInstance(), get_ACES_AP0_R(), get_ACES_AP0_G(), get_ACES_AP0_B());
862
+ this.n2u_1 = RGBColorSpace_0('ACEScc', get_ACES_WHITE_POINT(), ACESccTransferFunctions_getInstance(), get_ACES_AP1_R(), get_ACES_AP1_G(), get_ACES_AP1_B());
863
+ this.o2u_1 = RGBColorSpace_0('ACEScct', get_ACES_WHITE_POINT(), ACEScctTransferFunctions_getInstance(), get_ACES_AP1_R(), get_ACES_AP1_G(), get_ACES_AP1_B());
864
+ this.p2u_1 = RGBColorSpace_0('ACEScg', get_ACES_WHITE_POINT(), LinearTransferFunctions_getInstance(), get_ACES_AP1_R(), get_ACES_AP1_G(), get_ACES_AP1_B());
865
+ this.q2u_1 = RGBColorSpace_0('Adobe RGB', Illuminant_getInstance().w2s_1, new GammaTransferFunctions(2.19921875), xyY_init_$Create$(0.64, 0.33), xyY_init_$Create$(0.21, 0.71), xyY_init_$Create$(0.15, 0.06));
866
+ this.r2u_1 = BT2020Space_getInstance();
867
+ this.s2u_1 = RGBColorSpace_0('BT.709', Illuminant_getInstance().w2s_1, BT709TransferFunctions_getInstance(), xyY_init_$Create$(0.64, 0.33), xyY_init_$Create$(0.3, 0.6), xyY_init_$Create$(0.15, 0.06));
868
+ this.t2u_1 = RGBColorSpace_0('DCI P3', new WhitePoint('DCI P3', xyY_init_$Create$(0.314, 0.351)), new GammaTransferFunctions(2.6), xyY_init_$Create$(0.68, 0.32), xyY_init_$Create$(0.265, 0.69), xyY_init_$Create$(0.15, 0.06));
869
+ this.u2u_1 = RGBColorSpace_0('Display P3', Illuminant_getInstance().w2s_1, SRGBTransferFunctions_getInstance(), xyY_init_$Create$(0.68, 0.32), xyY_init_$Create$(0.265, 0.69), xyY_init_$Create$(0.15, 0.06));
870
+ this.v2u_1 = RGBColorSpace_0('ROMM RGB', Illuminant_getInstance().u2s_1, ROMMTransferFunctions_getInstance(), xyY_init_$Create$(0.7347, 0.2653), xyY_init_$Create$(0.1596, 0.8404), xyY_init_$Create$(0.0366, 1.0E-4));
871
+ }
872
+ var RGBColorSpaces_instance;
873
+ function RGBColorSpaces_getInstance() {
874
+ if (RGBColorSpaces_instance == null)
875
+ new RGBColorSpaces();
876
+ return RGBColorSpaces_instance;
877
+ }
878
+ function SRGB() {
879
+ SRGB_instance = this;
880
+ this.u2t_1 = 'sRGB';
881
+ this.v2t_1 = rectangularComponentInfo('RGB');
882
+ this.w2t_1 = Illuminant_getInstance().w2s_1;
883
+ this.x2t_1 = SRGBTransferFunctions_getInstance();
884
+ this.y2t_1 = _Matrix___get_rowMajor__impl__vmgxkq(rgbToXyzMatrix(this.w2t_1, get_SRGB_R(), get_SRGB_G(), get_SRGB_B()));
885
+ this.z2t_1 = _Matrix___get_rowMajor__impl__vmgxkq(inverse(_Matrix___init__impl__q3kp4w(this.y2t_1)));
886
+ }
887
+ protoOf(SRGB).j2u = function () {
888
+ return this.w2t_1;
889
+ };
890
+ protoOf(SRGB).g2u = function () {
891
+ return this.x2t_1;
892
+ };
893
+ protoOf(SRGB).h2u = function () {
894
+ return this.y2t_1;
895
+ };
896
+ protoOf(SRGB).i2u = function () {
897
+ return this.z2t_1;
898
+ };
899
+ protoOf(SRGB).toString = function () {
900
+ return this.u2t_1;
901
+ };
902
+ protoOf(SRGB).t2t = function (r, g, b, alpha) {
903
+ return new RGB(r, g, b, alpha, this);
904
+ };
905
+ var SRGB_instance;
906
+ function SRGB_getInstance() {
907
+ if (SRGB_instance == null)
908
+ new SRGB();
909
+ return SRGB_instance;
910
+ }
911
+ function RGBColorSpace_0(name, whitePoint, transferFunctions, r, g, b) {
912
+ _init_properties_RGBColorSpaces_kt__nc9fsz();
913
+ return new RGBColorSpaceImpl(name, whitePoint, transferFunctions, r, g, b);
914
+ }
915
+ function ACESccTransferFunctions() {
916
+ ACESccTransferFunctions_instance = this;
917
+ this.m2v_1 = 3.0517578125E-5;
918
+ this.n2v_1 = 1.52587890625E-5;
919
+ this.o2v_1 = -0.3013698630136986;
920
+ var tmp = this;
921
+ // Inline function 'kotlin.math.log2' call
922
+ tmp.p2v_1 = (log2(65504.0) + 9.72) / 17.52;
923
+ }
924
+ protoOf(ACESccTransferFunctions).b2u = function (x) {
925
+ var tmp;
926
+ if (x <= -0.3013698630136986) {
927
+ tmp = (spow_0(2.0, x * 17.52 - 9.72) - 1.52587890625E-5) * 2.0;
928
+ } else if (x < this.p2v_1) {
929
+ // Inline function 'kotlin.math.pow' call
930
+ var tmp0_pow = x * 17.52 - 9.72;
931
+ tmp = Math.pow(2.0, tmp0_pow);
932
+ } else {
933
+ tmp = 65504.0;
934
+ }
935
+ return tmp;
936
+ };
937
+ protoOf(ACESccTransferFunctions).c2u = function (x) {
938
+ var tmp;
939
+ if (x < 3.0517578125E-5) {
940
+ // Inline function 'kotlin.math.log2' call
941
+ var tmp0_log2 = 1.52587890625E-5 + coerceAtLeast_0(x, 0.0) / 2.0;
942
+ tmp = (log2(tmp0_log2) + 9.72) / 17.52;
943
+ } else {
944
+ // Inline function 'kotlin.math.log2' call
945
+ tmp = (log2(x) + 9.72) / 17.52;
946
+ }
947
+ return tmp;
948
+ };
949
+ var ACESccTransferFunctions_instance;
950
+ function ACESccTransferFunctions_getInstance() {
951
+ if (ACESccTransferFunctions_instance == null)
952
+ new ACESccTransferFunctions();
953
+ return ACESccTransferFunctions_instance;
954
+ }
955
+ function ACEScctTransferFunctions() {
956
+ ACEScctTransferFunctions_instance = this;
957
+ this.q2v_1 = 10.5402377416545;
958
+ this.r2v_1 = 0.0729055341958355;
959
+ var tmp = this;
960
+ // Inline function 'kotlin.math.log2' call
961
+ tmp.s2v_1 = (log2(65504.0) + 9.72) / 17.52;
962
+ }
963
+ protoOf(ACEScctTransferFunctions).b2u = function (x) {
964
+ var tmp;
965
+ if (x <= 0.155251141552511) {
966
+ tmp = (x - 0.0729055341958355) / 10.5402377416545;
967
+ } else if (x < this.s2v_1) {
968
+ // Inline function 'kotlin.math.pow' call
969
+ var tmp0_pow = x * 17.52 - 9.72;
970
+ tmp = Math.pow(2.0, tmp0_pow);
971
+ } else {
972
+ tmp = 65504.0;
973
+ }
974
+ return tmp;
975
+ };
976
+ protoOf(ACEScctTransferFunctions).c2u = function (x) {
977
+ var tmp;
978
+ if (x < 0.0078125) {
979
+ tmp = 10.5402377416545 * x + 0.0729055341958355;
980
+ } else {
981
+ // Inline function 'kotlin.math.log2' call
982
+ tmp = (log2(x) + 9.72) / 17.52;
983
+ }
984
+ return tmp;
985
+ };
986
+ var ACEScctTransferFunctions_instance;
987
+ function ACEScctTransferFunctions_getInstance() {
988
+ if (ACEScctTransferFunctions_instance == null)
989
+ new ACEScctTransferFunctions();
990
+ return ACEScctTransferFunctions_instance;
991
+ }
992
+ function BT2020Space() {
993
+ BT2020Space_instance = this;
994
+ this.t2v_1 = 'BT.2020';
995
+ this.u2v_1 = rectangularComponentInfo('RGB');
996
+ this.v2v_1 = Illuminant_getInstance().w2s_1;
997
+ this.w2v_1 = BT2020TransferFunctions_getInstance();
998
+ this.x2v_1 = _Matrix___get_rowMajor__impl__vmgxkq(rgbToXyzMatrix(this.v2v_1, xyY_init_$Create$(0.708, 0.292), xyY_init_$Create$(0.17, 0.797), xyY_init_$Create$(0.131, 0.046)));
999
+ this.y2v_1 = _Matrix___get_rowMajor__impl__vmgxkq(inverse(_Matrix___init__impl__q3kp4w(this.x2v_1)));
1000
+ }
1001
+ protoOf(BT2020Space).j2u = function () {
1002
+ return this.v2v_1;
1003
+ };
1004
+ protoOf(BT2020Space).g2u = function () {
1005
+ return this.w2v_1;
1006
+ };
1007
+ protoOf(BT2020Space).t2t = function (r, g, b, alpha) {
1008
+ return new RGB(r, g, b, alpha, this);
1009
+ };
1010
+ protoOf(BT2020Space).h2u = function () {
1011
+ return this.x2v_1;
1012
+ };
1013
+ protoOf(BT2020Space).i2u = function () {
1014
+ return this.y2v_1;
1015
+ };
1016
+ protoOf(BT2020Space).toString = function () {
1017
+ return this.t2v_1;
1018
+ };
1019
+ var BT2020Space_instance;
1020
+ function BT2020Space_getInstance() {
1021
+ if (BT2020Space_instance == null)
1022
+ new BT2020Space();
1023
+ return BT2020Space_instance;
1024
+ }
1025
+ function BT709TransferFunctions() {
1026
+ BT709TransferFunctions_instance = this;
1027
+ this.z2v_1 = 1.099 * spow_0(0.018, 0.45) - 0.099;
1028
+ }
1029
+ protoOf(BT709TransferFunctions).b2u = function (x) {
1030
+ return numberToDouble(x < this.z2v_1 ? x / 4.5 : spow_0((x + 0.099) / 1.099, 2.2222222222222223));
1031
+ };
1032
+ protoOf(BT709TransferFunctions).c2u = function (x) {
1033
+ return x < 0.018 ? 4.5 * x : 1.099 * spow(x, 0.45) - 0.099;
1034
+ };
1035
+ var BT709TransferFunctions_instance;
1036
+ function BT709TransferFunctions_getInstance() {
1037
+ if (BT709TransferFunctions_instance == null)
1038
+ new BT709TransferFunctions();
1039
+ return BT709TransferFunctions_instance;
1040
+ }
1041
+ function SRGBTransferFunctions() {
1042
+ SRGBTransferFunctions_instance = this;
1043
+ }
1044
+ protoOf(SRGBTransferFunctions).c2u = function (x) {
1045
+ return x <= 0.0031308 ? x * 12.92 : 1.055 * spow(x, 0.4166666666666667) - 0.055;
1046
+ };
1047
+ protoOf(SRGBTransferFunctions).b2u = function (x) {
1048
+ return x <= 0.04045 ? x / 12.92 : spow_0((x + 0.055) / 1.055, 2.4);
1049
+ };
1050
+ var SRGBTransferFunctions_instance;
1051
+ function SRGBTransferFunctions_getInstance() {
1052
+ if (SRGBTransferFunctions_instance == null)
1053
+ new SRGBTransferFunctions();
1054
+ return SRGBTransferFunctions_instance;
1055
+ }
1056
+ function ROMMTransferFunctions() {
1057
+ ROMMTransferFunctions_instance = this;
1058
+ this.a2w_1 = 0.001953;
1059
+ }
1060
+ protoOf(ROMMTransferFunctions).b2u = function (x) {
1061
+ return x < 0.031248 ? x / 16.0 : spow(x, 1.8);
1062
+ };
1063
+ protoOf(ROMMTransferFunctions).c2u = function (x) {
1064
+ return x < 0.001953 ? x * 16.0 : spow(x, 0.5555555555555556);
1065
+ };
1066
+ var ROMMTransferFunctions_instance;
1067
+ function ROMMTransferFunctions_getInstance() {
1068
+ if (ROMMTransferFunctions_instance == null)
1069
+ new ROMMTransferFunctions();
1070
+ return ROMMTransferFunctions_instance;
1071
+ }
1072
+ function rgbToXyzMatrix(whitePoint, r, g, b) {
1073
+ _init_properties_RGBColorSpaces_kt__nc9fsz();
1074
+ var primaries = _Matrix___init__impl__q3kp4w_0(r.b2w_1, g.b2w_1, b.b2w_1, r.c2w_1, g.c2w_1, b.c2w_1, r.e2w(), g.e2w(), b.e2w());
1075
+ var wp = whitePoint.q2s_1;
1076
+ // Inline function 'com.github.ajalt.colormath.internal.dot' call
1077
+ var tmp0_dot = inverse(primaries);
1078
+ var tmp1_dot = wp.f2w();
1079
+ var tmp2_dot = wp.d2w_1;
1080
+ var tmp3_dot = wp.g2w();
1081
+ // Inline function 'com.github.ajalt.colormath.model.rgbToXyzMatrix.<anonymous>' call
1082
+ var tmp4_anonymous = Matrix__get_impl_xogbpk(tmp0_dot, 0, 0) * tmp1_dot + Matrix__get_impl_xogbpk(tmp0_dot, 1, 0) * tmp2_dot + Matrix__get_impl_xogbpk(tmp0_dot, 2, 0) * tmp3_dot;
1083
+ var tmp5_anonymous = Matrix__get_impl_xogbpk(tmp0_dot, 0, 1) * tmp1_dot + Matrix__get_impl_xogbpk(tmp0_dot, 1, 1) * tmp2_dot + Matrix__get_impl_xogbpk(tmp0_dot, 2, 1) * tmp3_dot;
1084
+ var tmp6_anonymous = Matrix__get_impl_xogbpk(tmp0_dot, 0, 2) * tmp1_dot + Matrix__get_impl_xogbpk(tmp0_dot, 1, 2) * tmp2_dot + Matrix__get_impl_xogbpk(tmp0_dot, 2, 2) * tmp3_dot;
1085
+ return dotDiagonal(primaries, tmp4_anonymous, tmp5_anonymous, tmp6_anonymous);
1086
+ }
1087
+ function RGBColorSpaceImpl(name, whitePoint, transferFunctions, r, g, b) {
1088
+ this.h2w_1 = name;
1089
+ this.i2w_1 = whitePoint;
1090
+ this.j2w_1 = transferFunctions;
1091
+ this.k2w_1 = r;
1092
+ this.l2w_1 = g;
1093
+ this.m2w_1 = b;
1094
+ this.n2w_1 = rectangularComponentInfo('RGB');
1095
+ this.o2w_1 = _Matrix___get_rowMajor__impl__vmgxkq(rgbToXyzMatrix(this.i2w_1, this.k2w_1, this.l2w_1, this.m2w_1));
1096
+ this.p2w_1 = _Matrix___get_rowMajor__impl__vmgxkq(inverse(_Matrix___init__impl__q3kp4w(this.o2w_1)));
1097
+ }
1098
+ protoOf(RGBColorSpaceImpl).j2u = function () {
1099
+ return this.i2w_1;
1100
+ };
1101
+ protoOf(RGBColorSpaceImpl).g2u = function () {
1102
+ return this.j2w_1;
1103
+ };
1104
+ protoOf(RGBColorSpaceImpl).h2u = function () {
1105
+ return this.o2w_1;
1106
+ };
1107
+ protoOf(RGBColorSpaceImpl).i2u = function () {
1108
+ return this.p2w_1;
1109
+ };
1110
+ protoOf(RGBColorSpaceImpl).toString = function () {
1111
+ return this.h2w_1;
1112
+ };
1113
+ protoOf(RGBColorSpaceImpl).t2t = function (r, g, b, alpha) {
1114
+ return new RGB(r, g, b, alpha, this);
1115
+ };
1116
+ protoOf(RGBColorSpaceImpl).hashCode = function () {
1117
+ var result = getStringHashCode(this.h2w_1);
1118
+ result = imul(result, 31) + this.i2w_1.hashCode() | 0;
1119
+ result = imul(result, 31) + hashCode(this.j2w_1) | 0;
1120
+ result = imul(result, 31) + this.k2w_1.hashCode() | 0;
1121
+ result = imul(result, 31) + this.l2w_1.hashCode() | 0;
1122
+ result = imul(result, 31) + this.m2w_1.hashCode() | 0;
1123
+ return result;
1124
+ };
1125
+ protoOf(RGBColorSpaceImpl).equals = function (other) {
1126
+ if (this === other)
1127
+ return true;
1128
+ if (!(other instanceof RGBColorSpaceImpl))
1129
+ return false;
1130
+ var tmp0_other_with_cast = other instanceof RGBColorSpaceImpl ? other : THROW_CCE();
1131
+ if (!(this.h2w_1 === tmp0_other_with_cast.h2w_1))
1132
+ return false;
1133
+ if (!this.i2w_1.equals(tmp0_other_with_cast.i2w_1))
1134
+ return false;
1135
+ if (!equals(this.j2w_1, tmp0_other_with_cast.j2w_1))
1136
+ return false;
1137
+ if (!this.k2w_1.equals(tmp0_other_with_cast.k2w_1))
1138
+ return false;
1139
+ if (!this.l2w_1.equals(tmp0_other_with_cast.l2w_1))
1140
+ return false;
1141
+ if (!this.m2w_1.equals(tmp0_other_with_cast.m2w_1))
1142
+ return false;
1143
+ return true;
1144
+ };
1145
+ function BT2020TransferFunctions() {
1146
+ BT2020TransferFunctions_instance = this;
1147
+ this.q2w_1 = 1.0993;
1148
+ this.r2w_1 = 0.0181;
1149
+ var tmp = this;
1150
+ // Inline function 'kotlin.math.pow' call
1151
+ tmp.s2w_1 = 1.0993 * Math.pow(0.0181, 0.45) - 0.09929999999999994;
1152
+ }
1153
+ protoOf(BT2020TransferFunctions).b2u = function (x) {
1154
+ return numberToDouble(x < this.s2w_1 ? x / 4.5 : spow_0((x + 0.09929999999999994) / 1.0993, 2.2222222222222223));
1155
+ };
1156
+ protoOf(BT2020TransferFunctions).c2u = function (x) {
1157
+ return x < 0.0181 ? 4.5 * x : 1.0993 * spow(x, 0.45) - 0.09929999999999994;
1158
+ };
1159
+ var BT2020TransferFunctions_instance;
1160
+ function BT2020TransferFunctions_getInstance() {
1161
+ if (BT2020TransferFunctions_instance == null)
1162
+ new BT2020TransferFunctions();
1163
+ return BT2020TransferFunctions_instance;
1164
+ }
1165
+ var properties_initialized_RGBColorSpaces_kt_fsnpad;
1166
+ function _init_properties_RGBColorSpaces_kt__nc9fsz() {
1167
+ if (!properties_initialized_RGBColorSpaces_kt_fsnpad) {
1168
+ properties_initialized_RGBColorSpaces_kt_fsnpad = true;
1169
+ SRGB_R = xyY_init_$Create$(0.64, 0.33);
1170
+ SRGB_G = xyY_init_$Create$(0.3, 0.6);
1171
+ SRGB_B = xyY_init_$Create$(0.15, 0.06);
1172
+ ACES_WHITE_POINT = new WhitePoint('ACES', xyY_init_$Create$(0.32168, 0.33767));
1173
+ ACES_AP0_R = xyY_init_$Create$(0.7347, 0.2653);
1174
+ ACES_AP0_G = xyY_init_$Create$(0.0, 1.0);
1175
+ ACES_AP0_B = xyY_init_$Create$(1.0E-4, -0.077);
1176
+ ACES_AP1_R = xyY_init_$Create$(0.713, 0.293);
1177
+ ACES_AP1_G = xyY_init_$Create$(0.165, 0.83);
1178
+ ACES_AP1_B = xyY_init_$Create$(0.128, 0.044);
1179
+ }
1180
+ }
1181
+ function Companion_3() {
1182
+ Companion_instance_3 = this;
1183
+ this.t2w_1 = XYZColorSpaces_getInstance().u2w_1;
1184
+ }
1185
+ protoOf(Companion_3).j2u = function () {
1186
+ return this.t2w_1.j2u();
1187
+ };
1188
+ protoOf(Companion_3).t2t = function (x, y, z, alpha) {
1189
+ return this.t2w_1.t2t(x, y, z, alpha);
1190
+ };
1191
+ var Companion_instance_3;
1192
+ function Companion_getInstance_3() {
1193
+ if (Companion_instance_3 == null)
1194
+ new Companion_3();
1195
+ return Companion_instance_3;
1196
+ }
1197
+ function adaptToM($this, space, m, mi) {
1198
+ if (space.j2u().equals($this.f2v_1.j2u()))
1199
+ return $this;
1200
+ var transform = chromaticAdaptationMatrix(space, $this.f2v_1.j2u().q2s_1, m, mi);
1201
+ // Inline function 'com.github.ajalt.colormath.internal.dot' call
1202
+ var tmp0_dot = $this.b2v_1;
1203
+ var tmp1_dot = $this.c2v_1;
1204
+ var tmp2_dot = $this.d2v_1;
1205
+ // Inline function 'com.github.ajalt.colormath.model.XYZ.adaptToM.<anonymous>' call
1206
+ var tmp3_anonymous = Matrix__get_impl_xogbpk(transform, 0, 0) * tmp0_dot + Matrix__get_impl_xogbpk(transform, 1, 0) * tmp1_dot + Matrix__get_impl_xogbpk(transform, 2, 0) * tmp2_dot;
1207
+ var tmp4_anonymous = Matrix__get_impl_xogbpk(transform, 0, 1) * tmp0_dot + Matrix__get_impl_xogbpk(transform, 1, 1) * tmp1_dot + Matrix__get_impl_xogbpk(transform, 2, 1) * tmp2_dot;
1208
+ var tmp5_anonymous = Matrix__get_impl_xogbpk(transform, 0, 2) * tmp0_dot + Matrix__get_impl_xogbpk(transform, 1, 2) * tmp1_dot + Matrix__get_impl_xogbpk(transform, 2, 2) * tmp2_dot;
1209
+ return space.t2t(tmp3_anonymous, tmp4_anonymous, tmp5_anonymous, $this.e2v_1);
1210
+ }
1211
+ function XYZ(x, y, z, alpha, space) {
1212
+ Companion_getInstance_3();
1213
+ this.b2v_1 = x;
1214
+ this.c2v_1 = y;
1215
+ this.d2v_1 = z;
1216
+ this.e2v_1 = alpha;
1217
+ this.f2v_1 = space;
1218
+ }
1219
+ protoOf(XYZ).w2w = function (space) {
1220
+ return adaptToM(this, space, get_CAT02_XYZ_TO_LMS(), get_CAT02_LMS_TO_XYZ());
1221
+ };
1222
+ protoOf(XYZ).g2v = function (space) {
1223
+ var tmp0_container = this.w2w(XYZColorSpace(space.j2u()));
1224
+ var x = tmp0_container.e3();
1225
+ var y = tmp0_container.f3();
1226
+ var z = tmp0_container.c8();
1227
+ var f = space.g2u();
1228
+ // Inline function 'com.github.ajalt.colormath.internal.dot' call
1229
+ var tmp0_dot = _Matrix___init__impl__q3kp4w(space.i2u());
1230
+ // Inline function 'com.github.ajalt.colormath.model.XYZ.toRGB.<anonymous>' call
1231
+ var tmp1_anonymous = Matrix__get_impl_xogbpk(tmp0_dot, 0, 0) * x + Matrix__get_impl_xogbpk(tmp0_dot, 1, 0) * y + Matrix__get_impl_xogbpk(tmp0_dot, 2, 0) * z;
1232
+ var tmp2_anonymous = Matrix__get_impl_xogbpk(tmp0_dot, 0, 1) * x + Matrix__get_impl_xogbpk(tmp0_dot, 1, 1) * y + Matrix__get_impl_xogbpk(tmp0_dot, 2, 1) * z;
1233
+ var tmp3_anonymous = Matrix__get_impl_xogbpk(tmp0_dot, 0, 2) * x + Matrix__get_impl_xogbpk(tmp0_dot, 1, 2) * y + Matrix__get_impl_xogbpk(tmp0_dot, 2, 2) * z;
1234
+ return space.t2t(f.c2u(tmp1_anonymous), f.c2u(tmp2_anonymous), f.c2u(tmp3_anonymous), this.e2v_1);
1235
+ };
1236
+ protoOf(XYZ).b2t = function () {
1237
+ return this.g2v(RGBColorSpaces_getInstance().k2u_1);
1238
+ };
1239
+ protoOf(XYZ).e3 = function () {
1240
+ return this.b2v_1;
1241
+ };
1242
+ protoOf(XYZ).f3 = function () {
1243
+ return this.c2v_1;
1244
+ };
1245
+ protoOf(XYZ).c8 = function () {
1246
+ return this.d2v_1;
1247
+ };
1248
+ protoOf(XYZ).toString = function () {
1249
+ return 'XYZ(x=' + this.b2v_1 + ', y=' + this.c2v_1 + ', z=' + this.d2v_1 + ', alpha=' + this.e2v_1 + ', space=' + this.f2v_1 + ')';
1250
+ };
1251
+ protoOf(XYZ).hashCode = function () {
1252
+ var result = getNumberHashCode(this.b2v_1);
1253
+ result = imul(result, 31) + getNumberHashCode(this.c2v_1) | 0;
1254
+ result = imul(result, 31) + getNumberHashCode(this.d2v_1) | 0;
1255
+ result = imul(result, 31) + getNumberHashCode(this.e2v_1) | 0;
1256
+ result = imul(result, 31) + hashCode(this.f2v_1) | 0;
1257
+ return result;
1258
+ };
1259
+ protoOf(XYZ).equals = function (other) {
1260
+ if (this === other)
1261
+ return true;
1262
+ if (!(other instanceof XYZ))
1263
+ return false;
1264
+ var tmp0_other_with_cast = other instanceof XYZ ? other : THROW_CCE();
1265
+ if (!equals(this.b2v_1, tmp0_other_with_cast.b2v_1))
1266
+ return false;
1267
+ if (!equals(this.c2v_1, tmp0_other_with_cast.c2v_1))
1268
+ return false;
1269
+ if (!equals(this.d2v_1, tmp0_other_with_cast.d2v_1))
1270
+ return false;
1271
+ if (!equals(this.e2v_1, tmp0_other_with_cast.e2v_1))
1272
+ return false;
1273
+ if (!equals(this.f2v_1, tmp0_other_with_cast.f2v_1))
1274
+ return false;
1275
+ return true;
1276
+ };
1277
+ function XYZColorSpace(whitePoint) {
1278
+ return whitePoint.equals(Illuminant_getInstance().w2s_1) ? XYZColorSpaces_getInstance().u2w_1 : whitePoint.equals(Illuminant_getInstance().u2s_1) ? XYZColorSpaces_getInstance().v2w_1 : new XYZColorSpaceImpl(whitePoint);
1279
+ }
1280
+ function XYZColorSpaces() {
1281
+ XYZColorSpaces_instance = this;
1282
+ this.u2w_1 = new XYZColorSpaceImpl(Illuminant_getInstance().w2s_1);
1283
+ this.v2w_1 = new XYZColorSpaceImpl(Illuminant_getInstance().u2s_1);
1284
+ }
1285
+ var XYZColorSpaces_instance;
1286
+ function XYZColorSpaces_getInstance() {
1287
+ if (XYZColorSpaces_instance == null)
1288
+ new XYZColorSpaces();
1289
+ return XYZColorSpaces_instance;
1290
+ }
1291
+ function chromaticAdaptationMatrix(_this__u8e3s4, srcWp, xyzToLms, lmsToXyz) {
1292
+ xyzToLms = xyzToLms === VOID ? get_CAT02_XYZ_TO_LMS() : xyzToLms;
1293
+ lmsToXyz = lmsToXyz === VOID ? get_CAT02_LMS_TO_XYZ() : lmsToXyz;
1294
+ var dstWp = _this__u8e3s4.j2u().q2s_1;
1295
+ var src = dot_0(xyzToLms, srcWp.f2w(), srcWp.d2w_1, srcWp.g2w());
1296
+ var dst = dot_0(xyzToLms, dstWp.f2w(), dstWp.d2w_1, dstWp.g2w());
1297
+ return dot(dotDiagonal(lmsToXyz, _Vector___get_l__impl__envr1l(dst) / _Vector___get_l__impl__envr1l(src), _Vector___get_m__impl__e5qq0m(dst) / _Vector___get_m__impl__e5qq0m(src), _Vector___get_s__impl__pzuljk(dst) / _Vector___get_s__impl__pzuljk(src)), xyzToLms);
1298
+ }
1299
+ function XYZColorSpaceImpl(whitePoint) {
1300
+ this.x2w_1 = whitePoint;
1301
+ this.y2w_1 = rectangularComponentInfo('XYZ');
1302
+ }
1303
+ protoOf(XYZColorSpaceImpl).j2u = function () {
1304
+ return this.x2w_1;
1305
+ };
1306
+ protoOf(XYZColorSpaceImpl).toString = function () {
1307
+ return 'XYZColorSpace(' + this.x2w_1 + ')';
1308
+ };
1309
+ protoOf(XYZColorSpaceImpl).t2t = function (x, y, z, alpha) {
1310
+ return new XYZ(x, y, z, alpha, this);
1311
+ };
1312
+ protoOf(XYZColorSpaceImpl).hashCode = function () {
1313
+ return this.x2w_1.hashCode();
1314
+ };
1315
+ protoOf(XYZColorSpaceImpl).equals = function (other) {
1316
+ if (this === other)
1317
+ return true;
1318
+ if (!(other instanceof XYZColorSpaceImpl))
1319
+ return false;
1320
+ var tmp0_other_with_cast = other instanceof XYZColorSpaceImpl ? other : THROW_CCE();
1321
+ if (!this.x2w_1.equals(tmp0_other_with_cast.x2w_1))
1322
+ return false;
1323
+ return true;
1324
+ };
1325
+ function xyY_init_$Init$(x, y, Y, $this) {
1326
+ Y = Y === VOID ? 1.0 : Y;
1327
+ xyY.call($this, numberToDouble(x), numberToDouble(y), numberToDouble(Y));
1328
+ return $this;
1329
+ }
1330
+ function xyY_init_$Create$(x, y, Y) {
1331
+ return xyY_init_$Init$(x, y, Y, objectCreate(protoOf(xyY)));
1332
+ }
1333
+ function xyY(x, y, Y) {
1334
+ Y = Y === VOID ? 1.0 : Y;
1335
+ this.b2w_1 = x;
1336
+ this.c2w_1 = y;
1337
+ this.d2w_1 = Y;
1338
+ }
1339
+ protoOf(xyY).e2w = function () {
1340
+ return 1 - this.b2w_1 - this.c2w_1;
1341
+ };
1342
+ protoOf(xyY).f2w = function () {
1343
+ return this.b2w_1 * this.d2w_1 / this.c2w_1;
1344
+ };
1345
+ protoOf(xyY).g2w = function () {
1346
+ return (1 - this.b2w_1 - this.c2w_1) * this.d2w_1 / this.c2w_1;
1347
+ };
1348
+ protoOf(xyY).toString = function () {
1349
+ return 'xyY(x=' + this.b2w_1 + ', y=' + this.c2w_1 + ', Y=' + this.d2w_1 + ')';
1350
+ };
1351
+ protoOf(xyY).hashCode = function () {
1352
+ var result = getNumberHashCode(this.b2w_1);
1353
+ result = imul(result, 31) + getNumberHashCode(this.c2w_1) | 0;
1354
+ result = imul(result, 31) + getNumberHashCode(this.d2w_1) | 0;
1355
+ return result;
1356
+ };
1357
+ protoOf(xyY).equals = function (other) {
1358
+ if (this === other)
1359
+ return true;
1360
+ if (!(other instanceof xyY))
1361
+ return false;
1362
+ var tmp0_other_with_cast = other instanceof xyY ? other : THROW_CCE();
1363
+ if (!equals(this.b2w_1, tmp0_other_with_cast.b2w_1))
1364
+ return false;
1365
+ if (!equals(this.c2w_1, tmp0_other_with_cast.c2w_1))
1366
+ return false;
1367
+ if (!equals(this.d2w_1, tmp0_other_with_cast.d2w_1))
1368
+ return false;
1369
+ return true;
1370
+ };
1371
+ //region block: post-declaration
1372
+ protoOf(Companion_2).d2t = from255$default;
1373
+ protoOf(Companion_2).c2t = invoke$default;
1374
+ protoOf(Companion_2).h2t = invoke$default_0;
1375
+ protoOf(SRGB).c2t = invoke$default;
1376
+ protoOf(SRGB).d2u = invoke;
1377
+ protoOf(SRGB).h2t = invoke$default_0;
1378
+ protoOf(SRGB).f2u = invoke_0;
1379
+ protoOf(SRGB).e2u = from255;
1380
+ protoOf(SRGB).d2t = from255$default;
1381
+ protoOf(BT2020Space).c2t = invoke$default;
1382
+ protoOf(BT2020Space).d2u = invoke;
1383
+ protoOf(BT2020Space).h2t = invoke$default_0;
1384
+ protoOf(BT2020Space).f2u = invoke_0;
1385
+ protoOf(BT2020Space).e2u = from255;
1386
+ protoOf(BT2020Space).d2t = from255$default;
1387
+ protoOf(RGBColorSpaceImpl).c2t = invoke$default;
1388
+ protoOf(RGBColorSpaceImpl).d2u = invoke;
1389
+ protoOf(RGBColorSpaceImpl).h2t = invoke$default_0;
1390
+ protoOf(RGBColorSpaceImpl).f2u = invoke_0;
1391
+ protoOf(RGBColorSpaceImpl).e2u = from255;
1392
+ protoOf(RGBColorSpaceImpl).d2t = from255$default;
1393
+ //endregion
1394
+ //region block: exports
1395
+ _.$_$ = _.$_$ || {};
1396
+ _.$_$.a = Ansi16;
1397
+ _.$_$.b = Ansi256;
1398
+ _.$_$.c = Companion_getInstance_2;
1399
+ //endregion
1400
+ return _;
1401
+ }));
1402
+
1403
+ //# sourceMappingURL=colormath-root-colormath.js.map