react-semaphor 0.1.602 → 0.1.604
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/activity/index.js +1 -73
- package/dist/analytics-protocol/index.js +1 -1451
- package/dist/appearance/index.js +1 -12
- package/dist/appearance-runtime/index.js +1 -5
- package/dist/assistant-context/index.js +1 -11
- package/dist/assistant-protocol/index.js +1 -152
- package/dist/brand-studio/index.js +4 -1594
- package/dist/briefings/index.js +1 -70
- package/dist/chunks/add-to-dashboard-DeHEBEqG.js +12 -0
- package/dist/chunks/analytics-base-schemas-BREc5WGv.js +1 -0
- package/dist/chunks/appearance-context-BqBZrijL.js +1 -0
- package/dist/chunks/appearance-runtime-provider-DmbCrOOG.js +1 -0
- package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
- package/dist/chunks/assistant-chat-CjYrwVDa.js +56 -0
- package/dist/chunks/attribution-BEFSsbNn.js +1 -0
- package/dist/chunks/availability-3AIOf6Z-.js +1 -0
- package/dist/chunks/bookmark-impact-C89zBLq3.js +1 -0
- package/dist/chunks/bookmark-state-69YYnRql.js +1 -0
- package/dist/chunks/brand-DCaZyRt6.js +1 -0
- package/dist/chunks/card-filter-builder-CTp6RAz1.js +17 -0
- package/dist/chunks/column-bands-DwxbZ6UI.js +1 -0
- package/dist/chunks/comparison-window-caption-C312mn3s.js +1 -0
- package/dist/chunks/context-ALdccLHw.js +2 -0
- package/dist/chunks/conversation-JMK2kyTK.js +1 -0
- package/dist/chunks/dashboard-BX28ld6s.js +1 -0
- package/dist/chunks/dashboard-briefing-launcher-qo7GH4EO.js +37 -0
- package/dist/chunks/dashboard-controls-DhRjB7MA.js +42 -0
- package/dist/chunks/dashboard-json-9cHzhSjC.js +1 -0
- package/dist/chunks/dates-D-KP8G-z.js +1 -0
- package/dist/chunks/edit-DEAK0UZo.js +1 -0
- package/dist/chunks/edit-dashboard-visual-Duq_QkB_.js +93 -0
- package/dist/chunks/export-file-format-B-wQNHIn.js +4 -0
- package/dist/chunks/filter-line-CwQrqORc.js +1 -0
- package/dist/chunks/filter-reach-preview-gixPFlZj.js +1 -0
- package/dist/chunks/filter-value-text-B3tXakhd.js +1 -0
- package/dist/chunks/index-B-VF1ogs.js +1 -0
- package/dist/chunks/index-BE1DfxNs.js +1 -0
- package/dist/chunks/index-DViPGDFj.js +1 -0
- package/dist/chunks/layout-grid-BWtlgw0T.js +6 -0
- package/dist/chunks/matrix-analytical-definition-CtFqWyCK.js +1 -0
- package/dist/chunks/matrix-member-presentation-Q0MCJ-YK.js +1 -0
- package/dist/chunks/matrix-operation-contract-D1RC1bfi.js +1 -0
- package/dist/chunks/metric-comparison-DEZYXROZ.js +1 -0
- package/dist/chunks/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
- package/dist/chunks/paintbrush-BjS3SbrH.js +6 -0
- package/dist/chunks/palette-BzC-CGOc.js +6 -0
- package/dist/chunks/pickers-DuBrUht0.js +1 -0
- package/dist/chunks/pivot-result-contract-expectations-DTQAgr4n.js +1 -0
- package/dist/chunks/pivot-result-identity-DTNCB--h.js +1 -0
- package/dist/chunks/raw-temporal-value-DeyEhL0S.js +1 -0
- package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
- package/dist/chunks/report-preferences-dialog-B_gUmCzG.js +1 -0
- package/dist/chunks/report-runtime-context-BWzIHCKK.js +1 -0
- package/dist/chunks/resolve-dashboard-input-context-B-TtRqxu.js +8 -0
- package/dist/chunks/resolver-AN9ChBfZ.js +1 -0
- package/dist/chunks/save-DdFUZcbi.js +6 -0
- package/dist/chunks/saved-dashboard-context-BAJ5tWiq.js +1 -0
- package/dist/chunks/schema-MC0cQSAb.js +4 -0
- package/dist/chunks/selection-filter-compiler-CCoCD25M.js +1 -0
- package/dist/chunks/semaphor-ready-indicator-DzjorP3t.js +999 -0
- package/dist/chunks/set-DuJfGkbY.js +1 -0
- package/dist/chunks/shelf-drop-preview-context-BlLJ5RsT.js +6 -0
- package/dist/chunks/stored-dashboard-Ctcpkllg.js +1 -0
- package/dist/chunks/style-sheet-parts-BRGt9O05.js +178 -0
- package/dist/chunks/table-export-sheet-rC5pKmXg.js +2 -0
- package/dist/chunks/token-types-Bj9iMy0w.js +1 -0
- package/dist/chunks/validators-CqV3Yka1.js +1 -0
- package/dist/chunks/variable-draft-DJrfUyhv.js +1 -0
- package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
- package/dist/dashboard/index.js +1 -7
- package/dist/dashboard-authoring/index.js +1 -4491
- package/dist/format-utils/index.js +1 -424
- package/dist/index.js +1 -554
- package/dist/layouts/index.js +1 -7
- package/dist/live-channel/index.js +1 -124
- package/dist/pdf-export-policy/index.js +1 -92
- package/dist/pdf-table-layout/index.js +1 -993
- package/dist/report-runtime-context/index.js +1 -9
- package/dist/shared/index.js +1 -6
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -9
- package/dist/types/components/ui-custom/date-range-presets.d.ts +8 -0
- package/dist/types/index.js +1 -88
- package/dist/types/lib/document/document-edits.d.ts +0 -4
- package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
- package/dist/types/lib/stores/explorer-actions.d.ts +7 -6
- package/dist/types/lib/types/common-types.d.ts +0 -2
- package/dist/types/lib/types/explorer-types.d.ts +1 -1
- package/dist/types/lib/types/semantic-types.d.ts +6 -10
- package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +18 -0
- package/dist/types/shared/analytics-protocol/analyze-result-types.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/comparison-choices.d.ts +92 -0
- package/dist/types/shared/analytics-protocol/comparison-placement.d.ts +30 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +11 -5
- package/dist/types/shared/analytics-protocol/date-window.d.ts +105 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +27 -0
- package/dist/types/shared/analytics-protocol/fixtures.d.ts +4 -2
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/metric-comparison.d.ts +93 -11
- package/dist/types/shared/assistant-protocol/context.d.ts +16 -16
- package/dist/types/shared/dashboard-authoring/calculations/calculated-column.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +132 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
- package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +2 -1
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +0 -3
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +21 -358
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/dashboard-variable-card.d.ts +2 -4
- package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +115 -0
- package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +6 -1
- package/dist/types/shared/dashboard-authoring/kpi-date-context.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/comparison.d.ts +8 -7
- package/dist/types/shared/dashboard-authoring/measure-calculations/dates.d.ts +11 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/index.d.ts +2 -2
- package/dist/types/shared/dashboard-authoring/measure-calculations/options.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/read.d.ts +18 -1
- package/dist/types/shared/dashboard-authoring/measure-calculations/resolve.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/measure-calculations/schemas.d.ts +46 -88
- package/dist/types/shared/dashboard-authoring/operations/calculated-field-operations.d.ts +33 -8
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +0 -2
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
- package/dist/types/shared/format-utils/comparison-detail.d.ts +34 -0
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/partial-period.d.ts +4 -2
- package/dist/types/shared/temporal/calendar-periods.d.ts +11 -0
- package/dist/types/shared/temporal/index.d.ts +2 -0
- package/dist/types/shared/temporal/temporal-text.d.ts +33 -0
- package/dist/types/shared/temporal/temporal.d.ts +27 -0
- package/dist/types/shared/temporal/zoned-wall-clock.d.ts +4 -3
- package/dist/usage-events/index.js +1 -285
- package/dist/value-format-preferences/index.js +1 -635
- package/package.json +6 -2
- package/dist/chunks/add-to-dashboard-ClhEIFst.js +0 -291
- package/dist/chunks/analytics-base-schemas-DevrgqQb.js +0 -678
- package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
- package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
- package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
- package/dist/chunks/assistant-chat-BWF3GYip.js +0 -6115
- package/dist/chunks/attribution-BvoKvhcj.js +0 -32
- package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
- package/dist/chunks/bookmark-impact-BF3iRx5a.js +0 -76
- package/dist/chunks/bookmark-state-CBSTdW6q.js +0 -1666
- package/dist/chunks/brand-BoUV0iHF.js +0 -54
- package/dist/chunks/card-filter-builder-B8XHwMY6.js +0 -4069
- package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
- package/dist/chunks/comparison-window-caption-W83qB4V5.js +0 -741
- package/dist/chunks/context-BJoEFgNl.js +0 -369
- package/dist/chunks/conversation-sQiWYUOb.js +0 -16
- package/dist/chunks/dashboard-DG5EIYYB.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-CBSrhyWZ.js +0 -4875
- package/dist/chunks/dashboard-controls-D6ECO4N1.js +0 -2290
- package/dist/chunks/dashboard-json-DrJftBSL.js +0 -66
- package/dist/chunks/dates-Bz-qM5px.js +0 -164
- package/dist/chunks/edit-9df1zOWe.js +0 -226
- package/dist/chunks/edit-dashboard-visual-BDYAJIbb.js +0 -18605
- package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
- package/dist/chunks/filter-line-BXT6y303.js +0 -703
- package/dist/chunks/filter-reach-copy-BukhZmzm.js +0 -5250
- package/dist/chunks/filter-value-text-D3-bf3_b.js +0 -153
- package/dist/chunks/index-BVKzKl5d.js +0 -90
- package/dist/chunks/index-BW0yozjs.js +0 -2795
- package/dist/chunks/index-CV_Kzou0.js +0 -595
- package/dist/chunks/layout-grid-Ds0diMeY.js +0 -16
- package/dist/chunks/matrix-analytical-definition-CgQgVeeI.js +0 -1162
- package/dist/chunks/matrix-member-presentation-DSBIIudt.js +0 -258
- package/dist/chunks/matrix-operation-contract--DkNCOzd.js +0 -1412
- package/dist/chunks/metric-comparison-zMylnIkc.js +0 -541
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
- package/dist/chunks/paintbrush-CX8pao1j.js +0 -27
- package/dist/chunks/palette-CuA0HlzF.js +0 -23
- package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
- package/dist/chunks/pivot-result-contract-expectations-C8KL7hPx.js +0 -5046
- package/dist/chunks/pivot-result-identity-C1AOH1PS.js +0 -77
- package/dist/chunks/raw-temporal-value-E416F-0L.js +0 -454
- package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
- package/dist/chunks/report-preferences-dialog-CbuVNDGi.js +0 -1637
- package/dist/chunks/report-runtime-context-E7USjN7E.js +0 -388
- package/dist/chunks/resolve-dashboard-input-context-CULCE_hM.js +0 -25172
- package/dist/chunks/resolver-DG_tfEpt.js +0 -156
- package/dist/chunks/save-BKHlDONy.js +0 -21
- package/dist/chunks/saved-dashboard-context-C1WlOx5z.js +0 -632
- package/dist/chunks/schema-C9NPiIru.js +0 -2568
- package/dist/chunks/selection-filter-compiler-ifT8JCXS.js +0 -131
- package/dist/chunks/semaphor-ready-indicator-CBIRcDWs.js +0 -145326
- package/dist/chunks/shelf-drop-preview-context-xR69SMA8.js +0 -2466
- package/dist/chunks/stored-dashboard-BuM8vnWf.js +0 -4070
- package/dist/chunks/style-sheet-parts-Bt9ZNre8.js +0 -8674
- package/dist/chunks/table-export-sheet-DVljtHkG.js +0 -949
- package/dist/chunks/token-types-D_xKgyVS.js +0 -8
- package/dist/chunks/upload-Dll_M7XQ.js +0 -15
- package/dist/chunks/validators-ClWHpYql.js +0 -3686
- package/dist/chunks/variable-draft-CDGGl53R.js +0 -242
- package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
|
@@ -1,2568 +0,0 @@
|
|
|
1
|
-
const at = (e, n) => {
|
|
2
|
-
if (typeof e == "number") {
|
|
3
|
-
if (n === 3)
|
|
4
|
-
return {
|
|
5
|
-
mode: "rgb",
|
|
6
|
-
r: (e >> 8 & 15 | e >> 4 & 240) / 255,
|
|
7
|
-
g: (e >> 4 & 15 | e & 240) / 255,
|
|
8
|
-
b: (e & 15 | e << 4 & 240) / 255
|
|
9
|
-
};
|
|
10
|
-
if (n === 4)
|
|
11
|
-
return {
|
|
12
|
-
mode: "rgb",
|
|
13
|
-
r: (e >> 12 & 15 | e >> 8 & 240) / 255,
|
|
14
|
-
g: (e >> 8 & 15 | e >> 4 & 240) / 255,
|
|
15
|
-
b: (e >> 4 & 15 | e & 240) / 255,
|
|
16
|
-
alpha: (e & 15 | e << 4 & 240) / 255
|
|
17
|
-
};
|
|
18
|
-
if (n === 6)
|
|
19
|
-
return {
|
|
20
|
-
mode: "rgb",
|
|
21
|
-
r: (e >> 16 & 255) / 255,
|
|
22
|
-
g: (e >> 8 & 255) / 255,
|
|
23
|
-
b: (e & 255) / 255
|
|
24
|
-
};
|
|
25
|
-
if (n === 8)
|
|
26
|
-
return {
|
|
27
|
-
mode: "rgb",
|
|
28
|
-
r: (e >> 24 & 255) / 255,
|
|
29
|
-
g: (e >> 16 & 255) / 255,
|
|
30
|
-
b: (e >> 8 & 255) / 255,
|
|
31
|
-
alpha: (e & 255) / 255
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
}, jt = {
|
|
35
|
-
aliceblue: 15792383,
|
|
36
|
-
antiquewhite: 16444375,
|
|
37
|
-
aqua: 65535,
|
|
38
|
-
aquamarine: 8388564,
|
|
39
|
-
azure: 15794175,
|
|
40
|
-
beige: 16119260,
|
|
41
|
-
bisque: 16770244,
|
|
42
|
-
black: 0,
|
|
43
|
-
blanchedalmond: 16772045,
|
|
44
|
-
blue: 255,
|
|
45
|
-
blueviolet: 9055202,
|
|
46
|
-
brown: 10824234,
|
|
47
|
-
burlywood: 14596231,
|
|
48
|
-
cadetblue: 6266528,
|
|
49
|
-
chartreuse: 8388352,
|
|
50
|
-
chocolate: 13789470,
|
|
51
|
-
coral: 16744272,
|
|
52
|
-
cornflowerblue: 6591981,
|
|
53
|
-
cornsilk: 16775388,
|
|
54
|
-
crimson: 14423100,
|
|
55
|
-
cyan: 65535,
|
|
56
|
-
darkblue: 139,
|
|
57
|
-
darkcyan: 35723,
|
|
58
|
-
darkgoldenrod: 12092939,
|
|
59
|
-
darkgray: 11119017,
|
|
60
|
-
darkgreen: 25600,
|
|
61
|
-
darkgrey: 11119017,
|
|
62
|
-
darkkhaki: 12433259,
|
|
63
|
-
darkmagenta: 9109643,
|
|
64
|
-
darkolivegreen: 5597999,
|
|
65
|
-
darkorange: 16747520,
|
|
66
|
-
darkorchid: 10040012,
|
|
67
|
-
darkred: 9109504,
|
|
68
|
-
darksalmon: 15308410,
|
|
69
|
-
darkseagreen: 9419919,
|
|
70
|
-
darkslateblue: 4734347,
|
|
71
|
-
darkslategray: 3100495,
|
|
72
|
-
darkslategrey: 3100495,
|
|
73
|
-
darkturquoise: 52945,
|
|
74
|
-
darkviolet: 9699539,
|
|
75
|
-
deeppink: 16716947,
|
|
76
|
-
deepskyblue: 49151,
|
|
77
|
-
dimgray: 6908265,
|
|
78
|
-
dimgrey: 6908265,
|
|
79
|
-
dodgerblue: 2003199,
|
|
80
|
-
firebrick: 11674146,
|
|
81
|
-
floralwhite: 16775920,
|
|
82
|
-
forestgreen: 2263842,
|
|
83
|
-
fuchsia: 16711935,
|
|
84
|
-
gainsboro: 14474460,
|
|
85
|
-
ghostwhite: 16316671,
|
|
86
|
-
gold: 16766720,
|
|
87
|
-
goldenrod: 14329120,
|
|
88
|
-
gray: 8421504,
|
|
89
|
-
green: 32768,
|
|
90
|
-
greenyellow: 11403055,
|
|
91
|
-
grey: 8421504,
|
|
92
|
-
honeydew: 15794160,
|
|
93
|
-
hotpink: 16738740,
|
|
94
|
-
indianred: 13458524,
|
|
95
|
-
indigo: 4915330,
|
|
96
|
-
ivory: 16777200,
|
|
97
|
-
khaki: 15787660,
|
|
98
|
-
lavender: 15132410,
|
|
99
|
-
lavenderblush: 16773365,
|
|
100
|
-
lawngreen: 8190976,
|
|
101
|
-
lemonchiffon: 16775885,
|
|
102
|
-
lightblue: 11393254,
|
|
103
|
-
lightcoral: 15761536,
|
|
104
|
-
lightcyan: 14745599,
|
|
105
|
-
lightgoldenrodyellow: 16448210,
|
|
106
|
-
lightgray: 13882323,
|
|
107
|
-
lightgreen: 9498256,
|
|
108
|
-
lightgrey: 13882323,
|
|
109
|
-
lightpink: 16758465,
|
|
110
|
-
lightsalmon: 16752762,
|
|
111
|
-
lightseagreen: 2142890,
|
|
112
|
-
lightskyblue: 8900346,
|
|
113
|
-
lightslategray: 7833753,
|
|
114
|
-
lightslategrey: 7833753,
|
|
115
|
-
lightsteelblue: 11584734,
|
|
116
|
-
lightyellow: 16777184,
|
|
117
|
-
lime: 65280,
|
|
118
|
-
limegreen: 3329330,
|
|
119
|
-
linen: 16445670,
|
|
120
|
-
magenta: 16711935,
|
|
121
|
-
maroon: 8388608,
|
|
122
|
-
mediumaquamarine: 6737322,
|
|
123
|
-
mediumblue: 205,
|
|
124
|
-
mediumorchid: 12211667,
|
|
125
|
-
mediumpurple: 9662683,
|
|
126
|
-
mediumseagreen: 3978097,
|
|
127
|
-
mediumslateblue: 8087790,
|
|
128
|
-
mediumspringgreen: 64154,
|
|
129
|
-
mediumturquoise: 4772300,
|
|
130
|
-
mediumvioletred: 13047173,
|
|
131
|
-
midnightblue: 1644912,
|
|
132
|
-
mintcream: 16121850,
|
|
133
|
-
mistyrose: 16770273,
|
|
134
|
-
moccasin: 16770229,
|
|
135
|
-
navajowhite: 16768685,
|
|
136
|
-
navy: 128,
|
|
137
|
-
oldlace: 16643558,
|
|
138
|
-
olive: 8421376,
|
|
139
|
-
olivedrab: 7048739,
|
|
140
|
-
orange: 16753920,
|
|
141
|
-
orangered: 16729344,
|
|
142
|
-
orchid: 14315734,
|
|
143
|
-
palegoldenrod: 15657130,
|
|
144
|
-
palegreen: 10025880,
|
|
145
|
-
paleturquoise: 11529966,
|
|
146
|
-
palevioletred: 14381203,
|
|
147
|
-
papayawhip: 16773077,
|
|
148
|
-
peachpuff: 16767673,
|
|
149
|
-
peru: 13468991,
|
|
150
|
-
pink: 16761035,
|
|
151
|
-
plum: 14524637,
|
|
152
|
-
powderblue: 11591910,
|
|
153
|
-
purple: 8388736,
|
|
154
|
-
// Added in CSS Colors Level 4:
|
|
155
|
-
// https://drafts.csswg.org/css-color/#changes-from-3
|
|
156
|
-
rebeccapurple: 6697881,
|
|
157
|
-
red: 16711680,
|
|
158
|
-
rosybrown: 12357519,
|
|
159
|
-
royalblue: 4286945,
|
|
160
|
-
saddlebrown: 9127187,
|
|
161
|
-
salmon: 16416882,
|
|
162
|
-
sandybrown: 16032864,
|
|
163
|
-
seagreen: 3050327,
|
|
164
|
-
seashell: 16774638,
|
|
165
|
-
sienna: 10506797,
|
|
166
|
-
silver: 12632256,
|
|
167
|
-
skyblue: 8900331,
|
|
168
|
-
slateblue: 6970061,
|
|
169
|
-
slategray: 7372944,
|
|
170
|
-
slategrey: 7372944,
|
|
171
|
-
snow: 16775930,
|
|
172
|
-
springgreen: 65407,
|
|
173
|
-
steelblue: 4620980,
|
|
174
|
-
tan: 13808780,
|
|
175
|
-
teal: 32896,
|
|
176
|
-
thistle: 14204888,
|
|
177
|
-
tomato: 16737095,
|
|
178
|
-
turquoise: 4251856,
|
|
179
|
-
violet: 15631086,
|
|
180
|
-
wheat: 16113331,
|
|
181
|
-
white: 16777215,
|
|
182
|
-
whitesmoke: 16119285,
|
|
183
|
-
yellow: 16776960,
|
|
184
|
-
yellowgreen: 10145074
|
|
185
|
-
}, Yt = (e) => at(jt[e.toLowerCase()], 6), Dt = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i, Zt = (e) => {
|
|
186
|
-
let n;
|
|
187
|
-
return (n = e.match(Dt)) ? at(parseInt(n[1], 16), n[1].length) : void 0;
|
|
188
|
-
}, E = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)", oe = `${E}%`, gn = `(?:${E}%|${E})`, Bt = `(?:${E}(deg|grad|rad|turn)|${E})`, U = "\\s*,\\s*", Ut = new RegExp(
|
|
189
|
-
`^rgba?\\(\\s*${E}${U}${E}${U}${E}\\s*(?:,\\s*${gn}\\s*)?\\)$`
|
|
190
|
-
), Wt = new RegExp(
|
|
191
|
-
`^rgba?\\(\\s*${oe}${U}${oe}${U}${oe}\\s*(?:,\\s*${gn}\\s*)?\\)$`
|
|
192
|
-
), Gt = (e) => {
|
|
193
|
-
let n = { mode: "rgb" }, t;
|
|
194
|
-
if (t = e.match(Ut))
|
|
195
|
-
t[1] !== void 0 && (n.r = t[1] / 255), t[2] !== void 0 && (n.g = t[2] / 255), t[3] !== void 0 && (n.b = t[3] / 255);
|
|
196
|
-
else if (t = e.match(Wt))
|
|
197
|
-
t[1] !== void 0 && (n.r = t[1] / 100), t[2] !== void 0 && (n.g = t[2] / 100), t[3] !== void 0 && (n.b = t[3] / 100);
|
|
198
|
-
else
|
|
199
|
-
return;
|
|
200
|
-
return t[4] !== void 0 ? n.alpha = Math.max(0, Math.min(1, t[4] / 100)) : t[5] !== void 0 && (n.alpha = Math.max(0, Math.min(1, +t[5]))), n;
|
|
201
|
-
}, Jt = (e, n) => e === void 0 ? void 0 : typeof e != "object" ? mn(e) : e.mode !== void 0 ? e : n ? { ...e, mode: n } : void 0, it = (e = "rgb") => (n) => (n = Jt(n, e)) !== void 0 ? (
|
|
202
|
-
// if the color's mode corresponds to our target mode
|
|
203
|
-
n.mode === e ? (
|
|
204
|
-
// then just return the color
|
|
205
|
-
n
|
|
206
|
-
) : (
|
|
207
|
-
// otherwise check to see if we have a dedicated
|
|
208
|
-
// converter for the target mode
|
|
209
|
-
C[n.mode][e] ? (
|
|
210
|
-
// and return its result...
|
|
211
|
-
C[n.mode][e](n)
|
|
212
|
-
) : (
|
|
213
|
-
// ...otherwise pass through RGB as an intermediary step.
|
|
214
|
-
// if the target mode is RGB...
|
|
215
|
-
e === "rgb" ? (
|
|
216
|
-
// just return the RGB
|
|
217
|
-
C[n.mode].rgb(n)
|
|
218
|
-
) : (
|
|
219
|
-
// otherwise convert color.mode -> RGB -> target_mode
|
|
220
|
-
C.rgb[e](C[n.mode].rgb(n))
|
|
221
|
-
)
|
|
222
|
-
)
|
|
223
|
-
)
|
|
224
|
-
) : void 0, C = {}, ot = {}, be = [], dt = {}, Vt = (e) => e, p = (e) => (C[e.mode] = {
|
|
225
|
-
...C[e.mode],
|
|
226
|
-
...e.toMode
|
|
227
|
-
}, Object.keys(e.fromMode || {}).forEach((n) => {
|
|
228
|
-
C[n] || (C[n] = {}), C[n][e.mode] = e.fromMode[n];
|
|
229
|
-
}), e.ranges || (e.ranges = {}), e.difference || (e.difference = {}), e.channels.forEach((n) => {
|
|
230
|
-
if (e.ranges[n] === void 0 && (e.ranges[n] = [0, 1]), !e.interpolate[n])
|
|
231
|
-
throw new Error(`Missing interpolator for: ${n}`);
|
|
232
|
-
typeof e.interpolate[n] == "function" && (e.interpolate[n] = {
|
|
233
|
-
use: e.interpolate[n]
|
|
234
|
-
}), e.interpolate[n].fixup || (e.interpolate[n].fixup = Vt);
|
|
235
|
-
}), ot[e.mode] = e, (e.parse || []).forEach((n) => {
|
|
236
|
-
Qt(n, e.mode);
|
|
237
|
-
}), it(e.mode)), Kt = (e) => ot[e], Qt = (e, n) => {
|
|
238
|
-
if (typeof e == "string") {
|
|
239
|
-
if (!n)
|
|
240
|
-
throw new Error("'mode' required when 'parser' is a string");
|
|
241
|
-
dt[e] = n;
|
|
242
|
-
} else typeof e == "function" && be.indexOf(e) < 0 && be.push(e);
|
|
243
|
-
}, ln = /[^\x00-\x7F]|[a-zA-Z_]/, e0 = /[^\x00-\x7F]|[-\w]/, f = {
|
|
244
|
-
Function: "function",
|
|
245
|
-
Ident: "ident",
|
|
246
|
-
Number: "number",
|
|
247
|
-
Percentage: "percentage",
|
|
248
|
-
ParenClose: ")",
|
|
249
|
-
None: "none",
|
|
250
|
-
Hue: "hue",
|
|
251
|
-
Alpha: "alpha"
|
|
252
|
-
};
|
|
253
|
-
let c = 0;
|
|
254
|
-
function ue(e) {
|
|
255
|
-
let n = e[c], t = e[c + 1];
|
|
256
|
-
return n === "-" || n === "+" ? /\d/.test(t) || t === "." && /\d/.test(e[c + 2]) : n === "." ? /\d/.test(t) : /\d/.test(n);
|
|
257
|
-
}
|
|
258
|
-
function sn(e) {
|
|
259
|
-
if (c >= e.length)
|
|
260
|
-
return !1;
|
|
261
|
-
let n = e[c];
|
|
262
|
-
if (ln.test(n))
|
|
263
|
-
return !0;
|
|
264
|
-
if (n === "-") {
|
|
265
|
-
if (e.length - c < 2)
|
|
266
|
-
return !1;
|
|
267
|
-
let t = e[c + 1];
|
|
268
|
-
return !!(t === "-" || ln.test(t));
|
|
269
|
-
}
|
|
270
|
-
return !1;
|
|
271
|
-
}
|
|
272
|
-
const n0 = {
|
|
273
|
-
deg: 1,
|
|
274
|
-
rad: 180 / Math.PI,
|
|
275
|
-
grad: 9 / 10,
|
|
276
|
-
turn: 360
|
|
277
|
-
};
|
|
278
|
-
function ae(e) {
|
|
279
|
-
let n = "";
|
|
280
|
-
if ((e[c] === "-" || e[c] === "+") && (n += e[c++]), n += ce(e), e[c] === "." && /\d/.test(e[c + 1]) && (n += e[c++] + ce(e)), (e[c] === "e" || e[c] === "E") && ((e[c + 1] === "-" || e[c + 1] === "+") && /\d/.test(e[c + 2]) ? n += e[c++] + e[c++] + ce(e) : /\d/.test(e[c + 1]) && (n += e[c++] + ce(e))), sn(e)) {
|
|
281
|
-
let t = pe(e);
|
|
282
|
-
return t === "deg" || t === "rad" || t === "turn" || t === "grad" ? { type: f.Hue, value: n * n0[t] } : void 0;
|
|
283
|
-
}
|
|
284
|
-
return e[c] === "%" ? (c++, { type: f.Percentage, value: +n }) : { type: f.Number, value: +n };
|
|
285
|
-
}
|
|
286
|
-
function ce(e) {
|
|
287
|
-
let n = "";
|
|
288
|
-
for (; /\d/.test(e[c]); )
|
|
289
|
-
n += e[c++];
|
|
290
|
-
return n;
|
|
291
|
-
}
|
|
292
|
-
function pe(e) {
|
|
293
|
-
let n = "";
|
|
294
|
-
for (; c < e.length && e0.test(e[c]); )
|
|
295
|
-
n += e[c++];
|
|
296
|
-
return n;
|
|
297
|
-
}
|
|
298
|
-
function t0(e) {
|
|
299
|
-
let n = pe(e);
|
|
300
|
-
return e[c] === "(" ? (c++, { type: f.Function, value: n }) : n === "none" ? { type: f.None, value: void 0 } : { type: f.Ident, value: n };
|
|
301
|
-
}
|
|
302
|
-
function r0(e = "") {
|
|
303
|
-
let n = e.trim(), t = [], a;
|
|
304
|
-
for (c = 0; c < n.length; ) {
|
|
305
|
-
if (a = n[c++], a === `
|
|
306
|
-
` || a === " " || a === " ") {
|
|
307
|
-
for (; c < n.length && (n[c] === `
|
|
308
|
-
` || n[c] === " " || n[c] === " "); )
|
|
309
|
-
c++;
|
|
310
|
-
continue;
|
|
311
|
-
}
|
|
312
|
-
if (a === ",")
|
|
313
|
-
return;
|
|
314
|
-
if (a === ")") {
|
|
315
|
-
t.push({ type: f.ParenClose });
|
|
316
|
-
continue;
|
|
317
|
-
}
|
|
318
|
-
if (a === "+") {
|
|
319
|
-
if (c--, ue(n)) {
|
|
320
|
-
t.push(ae(n));
|
|
321
|
-
continue;
|
|
322
|
-
}
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
if (a === "-") {
|
|
326
|
-
if (c--, ue(n)) {
|
|
327
|
-
t.push(ae(n));
|
|
328
|
-
continue;
|
|
329
|
-
}
|
|
330
|
-
if (sn(n)) {
|
|
331
|
-
t.push({ type: f.Ident, value: pe(n) });
|
|
332
|
-
continue;
|
|
333
|
-
}
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
if (a === ".") {
|
|
337
|
-
if (c--, ue(n)) {
|
|
338
|
-
t.push(ae(n));
|
|
339
|
-
continue;
|
|
340
|
-
}
|
|
341
|
-
return;
|
|
342
|
-
}
|
|
343
|
-
if (a === "/") {
|
|
344
|
-
for (; c < n.length && (n[c] === `
|
|
345
|
-
` || n[c] === " " || n[c] === " "); )
|
|
346
|
-
c++;
|
|
347
|
-
let r;
|
|
348
|
-
if (ue(n) && (r = ae(n), r.type !== f.Hue)) {
|
|
349
|
-
t.push({ type: f.Alpha, value: r });
|
|
350
|
-
continue;
|
|
351
|
-
}
|
|
352
|
-
if (sn(n) && pe(n) === "none") {
|
|
353
|
-
t.push({
|
|
354
|
-
type: f.Alpha,
|
|
355
|
-
value: { type: f.None, value: void 0 }
|
|
356
|
-
});
|
|
357
|
-
continue;
|
|
358
|
-
}
|
|
359
|
-
return;
|
|
360
|
-
}
|
|
361
|
-
if (/\d/.test(a)) {
|
|
362
|
-
c--, t.push(ae(n));
|
|
363
|
-
continue;
|
|
364
|
-
}
|
|
365
|
-
if (ln.test(a)) {
|
|
366
|
-
c--, t.push(t0(n));
|
|
367
|
-
continue;
|
|
368
|
-
}
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
return t;
|
|
372
|
-
}
|
|
373
|
-
function a0(e) {
|
|
374
|
-
e._i = 0;
|
|
375
|
-
let n = e[e._i++];
|
|
376
|
-
if (!n || n.type !== f.Function || n.value !== "color" || (n = e[e._i++], n.type !== f.Ident))
|
|
377
|
-
return;
|
|
378
|
-
const t = dt[n.value];
|
|
379
|
-
if (!t)
|
|
380
|
-
return;
|
|
381
|
-
const a = { mode: t }, r = ft(e, !1);
|
|
382
|
-
if (!r)
|
|
383
|
-
return;
|
|
384
|
-
const i = Kt(t).channels;
|
|
385
|
-
for (let o = 0, d, s; o < i.length; o++)
|
|
386
|
-
d = r[o], s = i[o], d.type !== f.None && (a[s] = d.type === f.Number ? d.value : d.value / 100, s === "alpha" && (a[s] = Math.max(0, Math.min(1, a[s]))));
|
|
387
|
-
return a;
|
|
388
|
-
}
|
|
389
|
-
function ft(e, n) {
|
|
390
|
-
const t = [];
|
|
391
|
-
let a;
|
|
392
|
-
for (; e._i < e.length; ) {
|
|
393
|
-
if (a = e[e._i++], a.type === f.None || a.type === f.Number || a.type === f.Alpha || a.type === f.Percentage || n && a.type === f.Hue) {
|
|
394
|
-
t.push(a);
|
|
395
|
-
continue;
|
|
396
|
-
}
|
|
397
|
-
if (a.type === f.ParenClose) {
|
|
398
|
-
if (e._i < e.length)
|
|
399
|
-
return;
|
|
400
|
-
continue;
|
|
401
|
-
}
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
if (!(t.length < 3 || t.length > 4)) {
|
|
405
|
-
if (t.length === 4) {
|
|
406
|
-
if (t[3].type !== f.Alpha)
|
|
407
|
-
return;
|
|
408
|
-
t[3] = t[3].value;
|
|
409
|
-
}
|
|
410
|
-
return t.length === 3 && t.push({ type: f.None, value: void 0 }), t.every((r) => r.type !== f.Alpha) ? t : void 0;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
function i0(e, n) {
|
|
414
|
-
e._i = 0;
|
|
415
|
-
let t = e[e._i++];
|
|
416
|
-
if (!t || t.type !== f.Function)
|
|
417
|
-
return;
|
|
418
|
-
let a = ft(e, n);
|
|
419
|
-
if (a)
|
|
420
|
-
return a.unshift(t.value), a;
|
|
421
|
-
}
|
|
422
|
-
const mn = (e) => {
|
|
423
|
-
if (typeof e != "string")
|
|
424
|
-
return;
|
|
425
|
-
const n = r0(e), t = n ? i0(n, !0) : void 0;
|
|
426
|
-
let a, r = 0, i = be.length;
|
|
427
|
-
for (; r < i; )
|
|
428
|
-
if ((a = be[r++](e, t)) !== void 0)
|
|
429
|
-
return a;
|
|
430
|
-
return n ? a0(n) : void 0;
|
|
431
|
-
};
|
|
432
|
-
function o0(e, n) {
|
|
433
|
-
if (!n || n[0] !== "rgb" && n[0] !== "rgba")
|
|
434
|
-
return;
|
|
435
|
-
const t = { mode: "rgb" }, [, a, r, i, o] = n;
|
|
436
|
-
if (!(a.type === f.Hue || r.type === f.Hue || i.type === f.Hue))
|
|
437
|
-
return a.type !== f.None && (t.r = a.type === f.Number ? a.value / 255 : a.value / 100), r.type !== f.None && (t.g = r.type === f.Number ? r.value / 255 : r.value / 100), i.type !== f.None && (t.b = i.type === f.Number ? i.value / 255 : i.value / 100), o.type !== f.None && (t.alpha = Math.min(
|
|
438
|
-
1,
|
|
439
|
-
Math.max(
|
|
440
|
-
0,
|
|
441
|
-
o.type === f.Number ? o.value : o.value / 100
|
|
442
|
-
)
|
|
443
|
-
)), t;
|
|
444
|
-
}
|
|
445
|
-
const d0 = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha: 0 } : void 0, f0 = (e, n, t) => e + t * (n - e), l0 = (e) => {
|
|
446
|
-
let n = [];
|
|
447
|
-
for (let t = 0; t < e.length - 1; t++) {
|
|
448
|
-
let a = e[t], r = e[t + 1];
|
|
449
|
-
a === void 0 && r === void 0 ? n.push(void 0) : a !== void 0 && r !== void 0 ? n.push([a, r]) : n.push(a !== void 0 ? [a, a] : [r, r]);
|
|
450
|
-
}
|
|
451
|
-
return n;
|
|
452
|
-
}, s0 = (e) => (n) => {
|
|
453
|
-
let t = l0(n);
|
|
454
|
-
return (a) => {
|
|
455
|
-
let r = a * t.length, i = a >= 1 ? t.length - 1 : Math.max(Math.floor(r), 0), o = t[i];
|
|
456
|
-
return o === void 0 ? void 0 : e(o[0], o[1], r - i);
|
|
457
|
-
};
|
|
458
|
-
}, l = s0(f0), k = (e) => {
|
|
459
|
-
let n = !1, t = e.map((a) => a !== void 0 ? (n = !0, a) : 1);
|
|
460
|
-
return n ? t : e;
|
|
461
|
-
}, W = {
|
|
462
|
-
mode: "rgb",
|
|
463
|
-
channels: ["r", "g", "b", "alpha"],
|
|
464
|
-
parse: [
|
|
465
|
-
o0,
|
|
466
|
-
Zt,
|
|
467
|
-
Gt,
|
|
468
|
-
Yt,
|
|
469
|
-
d0,
|
|
470
|
-
"srgb"
|
|
471
|
-
],
|
|
472
|
-
serialize: "srgb",
|
|
473
|
-
interpolate: {
|
|
474
|
-
r: l,
|
|
475
|
-
g: l,
|
|
476
|
-
b: l,
|
|
477
|
-
alpha: { use: l, fixup: k }
|
|
478
|
-
},
|
|
479
|
-
gamut: !0,
|
|
480
|
-
white: { r: 1, g: 1, b: 1 },
|
|
481
|
-
black: { r: 0, g: 0, b: 0 }
|
|
482
|
-
}, Xe = (e = 0) => Math.pow(Math.abs(e), 563 / 256) * Math.sign(e), Cn = (e) => {
|
|
483
|
-
let n = Xe(e.r), t = Xe(e.g), a = Xe(e.b), r = {
|
|
484
|
-
mode: "xyz65",
|
|
485
|
-
x: 0.5766690429101305 * n + 0.1855582379065463 * t + 0.1882286462349947 * a,
|
|
486
|
-
y: 0.297344975250536 * n + 0.6273635662554661 * t + 0.0752914584939979 * a,
|
|
487
|
-
z: 0.0270313613864123 * n + 0.0706888525358272 * t + 0.9913375368376386 * a
|
|
488
|
-
};
|
|
489
|
-
return e.alpha !== void 0 && (r.alpha = e.alpha), r;
|
|
490
|
-
}, Le = (e) => Math.pow(Math.abs(e), 256 / 563) * Math.sign(e), Rn = ({ x: e, y: n, z: t, alpha: a }) => {
|
|
491
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
492
|
-
let r = {
|
|
493
|
-
mode: "a98",
|
|
494
|
-
r: Le(
|
|
495
|
-
e * 2.0415879038107465 - n * 0.5650069742788597 - 0.3447313507783297 * t
|
|
496
|
-
),
|
|
497
|
-
g: Le(
|
|
498
|
-
e * -0.9692436362808798 + n * 1.8759675015077206 + 0.0415550574071756 * t
|
|
499
|
-
),
|
|
500
|
-
b: Le(
|
|
501
|
-
e * 0.0134442806320312 - n * 0.1183623922310184 + 1.0151749943912058 * t
|
|
502
|
-
)
|
|
503
|
-
};
|
|
504
|
-
return a !== void 0 && (r.alpha = a), r;
|
|
505
|
-
}, qe = (e = 0) => {
|
|
506
|
-
const n = Math.abs(e);
|
|
507
|
-
return n <= 0.04045 ? e / 12.92 : (Math.sign(e) || 1) * Math.pow((n + 0.055) / 1.055, 2.4);
|
|
508
|
-
}, G = ({ r: e, g: n, b: t, alpha: a }) => {
|
|
509
|
-
let r = {
|
|
510
|
-
mode: "lrgb",
|
|
511
|
-
r: qe(e),
|
|
512
|
-
g: qe(n),
|
|
513
|
-
b: qe(t)
|
|
514
|
-
};
|
|
515
|
-
return a !== void 0 && (r.alpha = a), r;
|
|
516
|
-
}, Y = (e) => {
|
|
517
|
-
let { r: n, g: t, b: a, alpha: r } = G(e), i = {
|
|
518
|
-
mode: "xyz65",
|
|
519
|
-
x: 0.4123907992659593 * n + 0.357584339383878 * t + 0.1804807884018343 * a,
|
|
520
|
-
y: 0.2126390058715102 * n + 0.715168678767756 * t + 0.0721923153607337 * a,
|
|
521
|
-
z: 0.0193308187155918 * n + 0.119194779794626 * t + 0.9505321522496607 * a
|
|
522
|
-
};
|
|
523
|
-
return r !== void 0 && (i.alpha = r), i;
|
|
524
|
-
}, je = (e = 0) => {
|
|
525
|
-
const n = Math.abs(e);
|
|
526
|
-
return n > 31308e-7 ? (Math.sign(e) || 1) * (1.055 * Math.pow(n, 1 / 2.4) - 0.055) : e * 12.92;
|
|
527
|
-
}, J = ({ r: e, g: n, b: t, alpha: a }, r = "rgb") => {
|
|
528
|
-
let i = {
|
|
529
|
-
mode: r,
|
|
530
|
-
r: je(e),
|
|
531
|
-
g: je(n),
|
|
532
|
-
b: je(t)
|
|
533
|
-
};
|
|
534
|
-
return a !== void 0 && (i.alpha = a), i;
|
|
535
|
-
}, D = ({ x: e, y: n, z: t, alpha: a }) => {
|
|
536
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
537
|
-
let r = J({
|
|
538
|
-
r: e * 3.2409699419045226 - n * 1.537383177570094 - 0.4986107602930034 * t,
|
|
539
|
-
g: e * -0.9692436362808796 + n * 1.8759675015077204 + 0.0415550574071756 * t,
|
|
540
|
-
b: e * 0.0556300796969936 - n * 0.2039769588889765 + 1.0569715142428784 * t
|
|
541
|
-
});
|
|
542
|
-
return a !== void 0 && (r.alpha = a), r;
|
|
543
|
-
}, u0 = {
|
|
544
|
-
...W,
|
|
545
|
-
mode: "a98",
|
|
546
|
-
parse: ["a98-rgb"],
|
|
547
|
-
serialize: "a98-rgb",
|
|
548
|
-
fromMode: {
|
|
549
|
-
rgb: (e) => Rn(Y(e)),
|
|
550
|
-
xyz65: Rn
|
|
551
|
-
},
|
|
552
|
-
toMode: {
|
|
553
|
-
rgb: (e) => D(Cn(e)),
|
|
554
|
-
xyz65: Cn
|
|
555
|
-
}
|
|
556
|
-
}, z = (e) => (e = e % 360) < 0 ? e + 360 : e, c0 = (e, n) => e.map((t, a, r) => {
|
|
557
|
-
if (t === void 0)
|
|
558
|
-
return t;
|
|
559
|
-
let i = z(t);
|
|
560
|
-
return a === 0 || e[a - 1] === void 0 ? i : n(i - z(r[a - 1]));
|
|
561
|
-
}).reduce((t, a) => !t.length || a === void 0 || t[t.length - 1] === void 0 ? (t.push(a), t) : (t.push(a + t[t.length - 1]), t), []), R = (e) => c0(e, (n) => Math.abs(n) <= 180 ? n : n - 360 * Math.sign(n)), $ = [-0.14861, 1.78277, -0.29227, -0.90649, 1.97294, 0], h0 = Math.PI / 180, b0 = 180 / Math.PI;
|
|
562
|
-
let An = $[3] * $[4], Fn = $[1] * $[4], En = $[1] * $[2] - $[0] * $[3];
|
|
563
|
-
const p0 = ({ r: e, g: n, b: t, alpha: a }) => {
|
|
564
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
565
|
-
let r = (En * t + e * An - n * Fn) / (En + An - Fn), i = t - r, o = ($[4] * (n - r) - $[2] * i) / $[3], d = {
|
|
566
|
-
mode: "cubehelix",
|
|
567
|
-
l: r,
|
|
568
|
-
s: r === 0 || r === 1 ? void 0 : Math.sqrt(i * i + o * o) / ($[4] * r * (1 - r))
|
|
569
|
-
};
|
|
570
|
-
return d.s && (d.h = Math.atan2(o, i) * b0 - 120), a !== void 0 && (d.alpha = a), d;
|
|
571
|
-
}, g0 = ({ h: e, s: n, l: t, alpha: a }) => {
|
|
572
|
-
let r = { mode: "rgb" };
|
|
573
|
-
e = (e === void 0 ? 0 : e + 120) * h0, t === void 0 && (t = 0);
|
|
574
|
-
let i = n === void 0 ? 0 : n * t * (1 - t), o = Math.cos(e), d = Math.sin(e);
|
|
575
|
-
return r.r = t + i * ($[0] * o + $[1] * d), r.g = t + i * ($[2] * o + $[3] * d), r.b = t + i * ($[4] * o + $[5] * d), a !== void 0 && (r.alpha = a), r;
|
|
576
|
-
}, ve = (e, n) => {
|
|
577
|
-
if (e.h === void 0 || n.h === void 0 || !e.s || !n.s)
|
|
578
|
-
return 0;
|
|
579
|
-
let t = z(e.h), a = z(n.h), r = Math.sin((a - t + 360) / 2 * Math.PI / 180);
|
|
580
|
-
return 2 * Math.sqrt(e.s * n.s) * r;
|
|
581
|
-
}, m0 = (e, n) => {
|
|
582
|
-
if (e.h === void 0 || n.h === void 0)
|
|
583
|
-
return 0;
|
|
584
|
-
let t = z(e.h), a = z(n.h);
|
|
585
|
-
return Math.abs(a - t) > 180 ? t - (a - 360 * Math.sign(a - t)) : a - t;
|
|
586
|
-
}, ke = (e, n) => {
|
|
587
|
-
if (e.h === void 0 || n.h === void 0 || !e.c || !n.c)
|
|
588
|
-
return 0;
|
|
589
|
-
let t = z(e.h), a = z(n.h), r = Math.sin((a - t + 360) / 2 * Math.PI / 180);
|
|
590
|
-
return 2 * Math.sqrt(e.c * n.c) * r;
|
|
591
|
-
}, A = (e) => {
|
|
592
|
-
let n = e.reduce(
|
|
593
|
-
(a, r) => {
|
|
594
|
-
if (r !== void 0) {
|
|
595
|
-
let i = r * Math.PI / 180;
|
|
596
|
-
a.sin += Math.sin(i), a.cos += Math.cos(i);
|
|
597
|
-
}
|
|
598
|
-
return a;
|
|
599
|
-
},
|
|
600
|
-
{ sin: 0, cos: 0 }
|
|
601
|
-
), t = Math.atan2(n.sin, n.cos) * 180 / Math.PI;
|
|
602
|
-
return t < 0 ? 360 + t : t;
|
|
603
|
-
}, x0 = {
|
|
604
|
-
mode: "cubehelix",
|
|
605
|
-
channels: ["h", "s", "l", "alpha"],
|
|
606
|
-
parse: ["--cubehelix"],
|
|
607
|
-
serialize: "--cubehelix",
|
|
608
|
-
ranges: {
|
|
609
|
-
h: [0, 360],
|
|
610
|
-
s: [0, 4.614],
|
|
611
|
-
l: [0, 1]
|
|
612
|
-
},
|
|
613
|
-
fromMode: {
|
|
614
|
-
rgb: p0
|
|
615
|
-
},
|
|
616
|
-
toMode: {
|
|
617
|
-
rgb: g0
|
|
618
|
-
},
|
|
619
|
-
interpolate: {
|
|
620
|
-
h: {
|
|
621
|
-
use: l,
|
|
622
|
-
fixup: R
|
|
623
|
-
},
|
|
624
|
-
s: l,
|
|
625
|
-
l,
|
|
626
|
-
alpha: {
|
|
627
|
-
use: l,
|
|
628
|
-
fixup: k
|
|
629
|
-
}
|
|
630
|
-
},
|
|
631
|
-
difference: {
|
|
632
|
-
h: ve
|
|
633
|
-
},
|
|
634
|
-
average: {
|
|
635
|
-
h: A
|
|
636
|
-
}
|
|
637
|
-
}, I = ({ l: e, a: n, b: t, alpha: a }, r = "lch") => {
|
|
638
|
-
n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
639
|
-
let i = Math.sqrt(n * n + t * t), o = { mode: r, l: e, c: i };
|
|
640
|
-
return i && (o.h = z(Math.atan2(t, n) * 180 / Math.PI)), a !== void 0 && (o.alpha = a), o;
|
|
641
|
-
}, O = ({ l: e, c: n, h: t, alpha: a }, r = "lab") => {
|
|
642
|
-
t === void 0 && (t = 0);
|
|
643
|
-
let i = {
|
|
644
|
-
mode: r,
|
|
645
|
-
l: e,
|
|
646
|
-
a: n ? n * Math.cos(t / 180 * Math.PI) : 0,
|
|
647
|
-
b: n ? n * Math.sin(t / 180 * Math.PI) : 0
|
|
648
|
-
};
|
|
649
|
-
return a !== void 0 && (i.alpha = a), i;
|
|
650
|
-
}, lt = Math.pow(29, 3) / Math.pow(3, 3), st = Math.pow(6, 3) / Math.pow(29, 3), y = {
|
|
651
|
-
X: 0.3457 / 0.3585,
|
|
652
|
-
Y: 1,
|
|
653
|
-
Z: (1 - 0.3457 - 0.3585) / 0.3585
|
|
654
|
-
}, B = {
|
|
655
|
-
X: 0.3127 / 0.329,
|
|
656
|
-
Y: 1,
|
|
657
|
-
Z: (1 - 0.3127 - 0.329) / 0.329
|
|
658
|
-
};
|
|
659
|
-
let Ye = (e) => Math.pow(e, 3) > st ? Math.pow(e, 3) : (116 * e - 16) / lt;
|
|
660
|
-
const ut = ({ l: e, a: n, b: t, alpha: a }) => {
|
|
661
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
662
|
-
let r = (e + 16) / 116, i = n / 500 + r, o = r - t / 200, d = {
|
|
663
|
-
mode: "xyz65",
|
|
664
|
-
x: Ye(i) * B.X,
|
|
665
|
-
y: Ye(r) * B.Y,
|
|
666
|
-
z: Ye(o) * B.Z
|
|
667
|
-
};
|
|
668
|
-
return a !== void 0 && (d.alpha = a), d;
|
|
669
|
-
}, _e = (e) => D(ut(e)), De = (e) => e > st ? Math.cbrt(e) : (lt * e + 16) / 116, ct = ({ x: e, y: n, z: t, alpha: a }) => {
|
|
670
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
671
|
-
let r = De(e / B.X), i = De(n / B.Y), o = De(t / B.Z), d = {
|
|
672
|
-
mode: "lab65",
|
|
673
|
-
l: 116 * i - 16,
|
|
674
|
-
a: 500 * (r - i),
|
|
675
|
-
b: 200 * (i - o)
|
|
676
|
-
};
|
|
677
|
-
return a !== void 0 && (d.alpha = a), d;
|
|
678
|
-
}, $e = (e) => {
|
|
679
|
-
let n = ct(Y(e));
|
|
680
|
-
return e.r === e.b && e.b === e.g && (n.a = n.b = 0), n;
|
|
681
|
-
}, ge = 1, ht = 1, de = 26 / 180 * Math.PI, me = Math.cos(de), xe = Math.sin(de), bt = 100 / Math.log(139 / 100), un = ({ l: e, c: n, h: t, alpha: a }) => {
|
|
682
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
683
|
-
let r = {
|
|
684
|
-
mode: "lab65",
|
|
685
|
-
l: (Math.exp(e * ge / bt) - 1) / 39e-4
|
|
686
|
-
}, i = (Math.exp(0.0435 * n * ht * ge) - 1) / 0.075, o = i * Math.cos(t / 180 * Math.PI - de), d = i * Math.sin(t / 180 * Math.PI - de);
|
|
687
|
-
return r.a = o * me - d / 0.83 * xe, r.b = o * xe + d / 0.83 * me, a !== void 0 && (r.alpha = a), r;
|
|
688
|
-
}, cn = ({ l: e, a: n, b: t, alpha: a }) => {
|
|
689
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
690
|
-
let r = n * me + t * xe, i = 0.83 * (t * me - n * xe), o = Math.sqrt(r * r + i * i), d = {
|
|
691
|
-
mode: "dlch",
|
|
692
|
-
l: bt / ge * Math.log(1 + 39e-4 * e),
|
|
693
|
-
c: Math.log(1 + 0.075 * o) / (0.0435 * ht * ge)
|
|
694
|
-
};
|
|
695
|
-
return d.c && (d.h = z((Math.atan2(i, r) + de) / Math.PI * 180)), a !== void 0 && (d.alpha = a), d;
|
|
696
|
-
}, Hn = (e) => un(I(e, "dlch")), In = (e) => O(cn(e), "dlab"), M0 = {
|
|
697
|
-
mode: "dlab",
|
|
698
|
-
parse: ["--din99o-lab"],
|
|
699
|
-
serialize: "--din99o-lab",
|
|
700
|
-
toMode: {
|
|
701
|
-
lab65: Hn,
|
|
702
|
-
rgb: (e) => _e(Hn(e))
|
|
703
|
-
},
|
|
704
|
-
fromMode: {
|
|
705
|
-
lab65: In,
|
|
706
|
-
rgb: (e) => In($e(e))
|
|
707
|
-
},
|
|
708
|
-
channels: ["l", "a", "b", "alpha"],
|
|
709
|
-
ranges: {
|
|
710
|
-
l: [0, 100],
|
|
711
|
-
a: [-40.09, 45.501],
|
|
712
|
-
b: [-40.469, 44.344]
|
|
713
|
-
},
|
|
714
|
-
interpolate: {
|
|
715
|
-
l,
|
|
716
|
-
a: l,
|
|
717
|
-
b: l,
|
|
718
|
-
alpha: {
|
|
719
|
-
use: l,
|
|
720
|
-
fixup: k
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
}, y0 = {
|
|
724
|
-
mode: "dlch",
|
|
725
|
-
parse: ["--din99o-lch"],
|
|
726
|
-
serialize: "--din99o-lch",
|
|
727
|
-
toMode: {
|
|
728
|
-
lab65: un,
|
|
729
|
-
dlab: (e) => O(e, "dlab"),
|
|
730
|
-
rgb: (e) => _e(un(e))
|
|
731
|
-
},
|
|
732
|
-
fromMode: {
|
|
733
|
-
lab65: cn,
|
|
734
|
-
dlab: (e) => I(e, "dlch"),
|
|
735
|
-
rgb: (e) => cn($e(e))
|
|
736
|
-
},
|
|
737
|
-
channels: ["l", "c", "h", "alpha"],
|
|
738
|
-
ranges: {
|
|
739
|
-
l: [0, 100],
|
|
740
|
-
c: [0, 51.484],
|
|
741
|
-
h: [0, 360]
|
|
742
|
-
},
|
|
743
|
-
interpolate: {
|
|
744
|
-
l,
|
|
745
|
-
c: l,
|
|
746
|
-
h: {
|
|
747
|
-
use: l,
|
|
748
|
-
fixup: R
|
|
749
|
-
},
|
|
750
|
-
alpha: {
|
|
751
|
-
use: l,
|
|
752
|
-
fixup: k
|
|
753
|
-
}
|
|
754
|
-
},
|
|
755
|
-
difference: {
|
|
756
|
-
h: ke
|
|
757
|
-
},
|
|
758
|
-
average: {
|
|
759
|
-
h: A
|
|
760
|
-
}
|
|
761
|
-
};
|
|
762
|
-
function v0({ h: e, s: n, i: t, alpha: a }) {
|
|
763
|
-
e = z(e !== void 0 ? e : 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
764
|
-
let r = Math.abs(e / 60 % 2 - 1), i;
|
|
765
|
-
switch (Math.floor(e / 60)) {
|
|
766
|
-
case 0:
|
|
767
|
-
i = {
|
|
768
|
-
r: t * (1 + n * (3 / (2 - r) - 1)),
|
|
769
|
-
g: t * (1 + n * (3 * (1 - r) / (2 - r) - 1)),
|
|
770
|
-
b: t * (1 - n)
|
|
771
|
-
};
|
|
772
|
-
break;
|
|
773
|
-
case 1:
|
|
774
|
-
i = {
|
|
775
|
-
r: t * (1 + n * (3 * (1 - r) / (2 - r) - 1)),
|
|
776
|
-
g: t * (1 + n * (3 / (2 - r) - 1)),
|
|
777
|
-
b: t * (1 - n)
|
|
778
|
-
};
|
|
779
|
-
break;
|
|
780
|
-
case 2:
|
|
781
|
-
i = {
|
|
782
|
-
r: t * (1 - n),
|
|
783
|
-
g: t * (1 + n * (3 / (2 - r) - 1)),
|
|
784
|
-
b: t * (1 + n * (3 * (1 - r) / (2 - r) - 1))
|
|
785
|
-
};
|
|
786
|
-
break;
|
|
787
|
-
case 3:
|
|
788
|
-
i = {
|
|
789
|
-
r: t * (1 - n),
|
|
790
|
-
g: t * (1 + n * (3 * (1 - r) / (2 - r) - 1)),
|
|
791
|
-
b: t * (1 + n * (3 / (2 - r) - 1))
|
|
792
|
-
};
|
|
793
|
-
break;
|
|
794
|
-
case 4:
|
|
795
|
-
i = {
|
|
796
|
-
r: t * (1 + n * (3 * (1 - r) / (2 - r) - 1)),
|
|
797
|
-
g: t * (1 - n),
|
|
798
|
-
b: t * (1 + n * (3 / (2 - r) - 1))
|
|
799
|
-
};
|
|
800
|
-
break;
|
|
801
|
-
case 5:
|
|
802
|
-
i = {
|
|
803
|
-
r: t * (1 + n * (3 / (2 - r) - 1)),
|
|
804
|
-
g: t * (1 - n),
|
|
805
|
-
b: t * (1 + n * (3 * (1 - r) / (2 - r) - 1))
|
|
806
|
-
};
|
|
807
|
-
break;
|
|
808
|
-
default:
|
|
809
|
-
i = { r: t * (1 - n), g: t * (1 - n), b: t * (1 - n) };
|
|
810
|
-
}
|
|
811
|
-
return i.mode = "rgb", a !== void 0 && (i.alpha = a), i;
|
|
812
|
-
}
|
|
813
|
-
function k0({ r: e, g: n, b: t, alpha: a }) {
|
|
814
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
815
|
-
let r = Math.max(e, n, t), i = Math.min(e, n, t), o = {
|
|
816
|
-
mode: "hsi",
|
|
817
|
-
s: e + n + t === 0 ? 0 : 1 - 3 * i / (e + n + t),
|
|
818
|
-
i: (e + n + t) / 3
|
|
819
|
-
};
|
|
820
|
-
return r - i !== 0 && (o.h = (r === e ? (n - t) / (r - i) + (n < t) * 6 : r === n ? (t - e) / (r - i) + 2 : (e - n) / (r - i) + 4) * 60), a !== void 0 && (o.alpha = a), o;
|
|
821
|
-
}
|
|
822
|
-
const _0 = {
|
|
823
|
-
mode: "hsi",
|
|
824
|
-
toMode: {
|
|
825
|
-
rgb: v0
|
|
826
|
-
},
|
|
827
|
-
parse: ["--hsi"],
|
|
828
|
-
serialize: "--hsi",
|
|
829
|
-
fromMode: {
|
|
830
|
-
rgb: k0
|
|
831
|
-
},
|
|
832
|
-
channels: ["h", "s", "i", "alpha"],
|
|
833
|
-
ranges: {
|
|
834
|
-
h: [0, 360]
|
|
835
|
-
},
|
|
836
|
-
gamut: "rgb",
|
|
837
|
-
interpolate: {
|
|
838
|
-
h: { use: l, fixup: R },
|
|
839
|
-
s: l,
|
|
840
|
-
i: l,
|
|
841
|
-
alpha: { use: l, fixup: k }
|
|
842
|
-
},
|
|
843
|
-
difference: {
|
|
844
|
-
h: ve
|
|
845
|
-
},
|
|
846
|
-
average: {
|
|
847
|
-
h: A
|
|
848
|
-
}
|
|
849
|
-
};
|
|
850
|
-
function $0({ h: e, s: n, l: t, alpha: a }) {
|
|
851
|
-
e = z(e !== void 0 ? e : 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
852
|
-
let r = t + n * (t < 0.5 ? t : 1 - t), i = r - (r - t) * 2 * Math.abs(e / 60 % 2 - 1), o;
|
|
853
|
-
switch (Math.floor(e / 60)) {
|
|
854
|
-
case 0:
|
|
855
|
-
o = { r, g: i, b: 2 * t - r };
|
|
856
|
-
break;
|
|
857
|
-
case 1:
|
|
858
|
-
o = { r: i, g: r, b: 2 * t - r };
|
|
859
|
-
break;
|
|
860
|
-
case 2:
|
|
861
|
-
o = { r: 2 * t - r, g: r, b: i };
|
|
862
|
-
break;
|
|
863
|
-
case 3:
|
|
864
|
-
o = { r: 2 * t - r, g: i, b: r };
|
|
865
|
-
break;
|
|
866
|
-
case 4:
|
|
867
|
-
o = { r: i, g: 2 * t - r, b: r };
|
|
868
|
-
break;
|
|
869
|
-
case 5:
|
|
870
|
-
o = { r, g: 2 * t - r, b: i };
|
|
871
|
-
break;
|
|
872
|
-
default:
|
|
873
|
-
o = { r: 2 * t - r, g: 2 * t - r, b: 2 * t - r };
|
|
874
|
-
}
|
|
875
|
-
return o.mode = "rgb", a !== void 0 && (o.alpha = a), o;
|
|
876
|
-
}
|
|
877
|
-
function w0({ r: e, g: n, b: t, alpha: a }) {
|
|
878
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
879
|
-
let r = Math.max(e, n, t), i = Math.min(e, n, t), o = {
|
|
880
|
-
mode: "hsl",
|
|
881
|
-
s: r === i ? 0 : (r - i) / (1 - Math.abs(r + i - 1)),
|
|
882
|
-
l: 0.5 * (r + i)
|
|
883
|
-
};
|
|
884
|
-
return r - i !== 0 && (o.h = (r === e ? (n - t) / (r - i) + (n < t) * 6 : r === n ? (t - e) / (r - i) + 2 : (e - n) / (r - i) + 4) * 60), a !== void 0 && (o.alpha = a), o;
|
|
885
|
-
}
|
|
886
|
-
const z0 = (e, n) => {
|
|
887
|
-
switch (n) {
|
|
888
|
-
case "deg":
|
|
889
|
-
return +e;
|
|
890
|
-
case "rad":
|
|
891
|
-
return e / Math.PI * 180;
|
|
892
|
-
case "grad":
|
|
893
|
-
return e / 10 * 9;
|
|
894
|
-
case "turn":
|
|
895
|
-
return e * 360;
|
|
896
|
-
}
|
|
897
|
-
}, T0 = new RegExp(
|
|
898
|
-
`^hsla?\\(\\s*${Bt}${U}${oe}${U}${oe}\\s*(?:,\\s*${gn}\\s*)?\\)$`
|
|
899
|
-
), P0 = (e) => {
|
|
900
|
-
let n = e.match(T0);
|
|
901
|
-
if (!n) return;
|
|
902
|
-
let t = { mode: "hsl" };
|
|
903
|
-
return n[3] !== void 0 ? t.h = +n[3] : n[1] !== void 0 && n[2] !== void 0 && (t.h = z0(n[1], n[2])), n[4] !== void 0 && (t.s = Math.min(Math.max(0, n[4] / 100), 1)), n[5] !== void 0 && (t.l = Math.min(Math.max(0, n[5] / 100), 1)), n[6] !== void 0 ? t.alpha = Math.max(0, Math.min(1, n[6] / 100)) : n[7] !== void 0 && (t.alpha = Math.max(0, Math.min(1, +n[7]))), t;
|
|
904
|
-
};
|
|
905
|
-
function S0(e, n) {
|
|
906
|
-
if (!n || n[0] !== "hsl" && n[0] !== "hsla")
|
|
907
|
-
return;
|
|
908
|
-
const t = { mode: "hsl" }, [, a, r, i, o] = n;
|
|
909
|
-
if (a.type !== f.None) {
|
|
910
|
-
if (a.type === f.Percentage)
|
|
911
|
-
return;
|
|
912
|
-
t.h = a.value;
|
|
913
|
-
}
|
|
914
|
-
if (r.type !== f.None) {
|
|
915
|
-
if (r.type === f.Hue)
|
|
916
|
-
return;
|
|
917
|
-
t.s = r.value / 100;
|
|
918
|
-
}
|
|
919
|
-
if (i.type !== f.None) {
|
|
920
|
-
if (i.type === f.Hue)
|
|
921
|
-
return;
|
|
922
|
-
t.l = i.value / 100;
|
|
923
|
-
}
|
|
924
|
-
return o.type !== f.None && (t.alpha = Math.min(
|
|
925
|
-
1,
|
|
926
|
-
Math.max(
|
|
927
|
-
0,
|
|
928
|
-
o.type === f.Number ? o.value : o.value / 100
|
|
929
|
-
)
|
|
930
|
-
)), t;
|
|
931
|
-
}
|
|
932
|
-
const pt = {
|
|
933
|
-
mode: "hsl",
|
|
934
|
-
toMode: {
|
|
935
|
-
rgb: $0
|
|
936
|
-
},
|
|
937
|
-
fromMode: {
|
|
938
|
-
rgb: w0
|
|
939
|
-
},
|
|
940
|
-
channels: ["h", "s", "l", "alpha"],
|
|
941
|
-
ranges: {
|
|
942
|
-
h: [0, 360]
|
|
943
|
-
},
|
|
944
|
-
gamut: "rgb",
|
|
945
|
-
parse: [S0, P0],
|
|
946
|
-
serialize: (e) => `hsl(${e.h !== void 0 ? e.h : "none"} ${e.s !== void 0 ? e.s * 100 + "%" : "none"} ${e.l !== void 0 ? e.l * 100 + "%" : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
947
|
-
interpolate: {
|
|
948
|
-
h: { use: l, fixup: R },
|
|
949
|
-
s: l,
|
|
950
|
-
l,
|
|
951
|
-
alpha: { use: l, fixup: k }
|
|
952
|
-
},
|
|
953
|
-
difference: {
|
|
954
|
-
h: ve
|
|
955
|
-
},
|
|
956
|
-
average: {
|
|
957
|
-
h: A
|
|
958
|
-
}
|
|
959
|
-
};
|
|
960
|
-
function gt({ h: e, s: n, v: t, alpha: a }) {
|
|
961
|
-
e = z(e !== void 0 ? e : 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
962
|
-
let r = Math.abs(e / 60 % 2 - 1), i;
|
|
963
|
-
switch (Math.floor(e / 60)) {
|
|
964
|
-
case 0:
|
|
965
|
-
i = { r: t, g: t * (1 - n * r), b: t * (1 - n) };
|
|
966
|
-
break;
|
|
967
|
-
case 1:
|
|
968
|
-
i = { r: t * (1 - n * r), g: t, b: t * (1 - n) };
|
|
969
|
-
break;
|
|
970
|
-
case 2:
|
|
971
|
-
i = { r: t * (1 - n), g: t, b: t * (1 - n * r) };
|
|
972
|
-
break;
|
|
973
|
-
case 3:
|
|
974
|
-
i = { r: t * (1 - n), g: t * (1 - n * r), b: t };
|
|
975
|
-
break;
|
|
976
|
-
case 4:
|
|
977
|
-
i = { r: t * (1 - n * r), g: t * (1 - n), b: t };
|
|
978
|
-
break;
|
|
979
|
-
case 5:
|
|
980
|
-
i = { r: t, g: t * (1 - n), b: t * (1 - n * r) };
|
|
981
|
-
break;
|
|
982
|
-
default:
|
|
983
|
-
i = { r: t * (1 - n), g: t * (1 - n), b: t * (1 - n) };
|
|
984
|
-
}
|
|
985
|
-
return i.mode = "rgb", a !== void 0 && (i.alpha = a), i;
|
|
986
|
-
}
|
|
987
|
-
function mt({ r: e, g: n, b: t, alpha: a }) {
|
|
988
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
989
|
-
let r = Math.max(e, n, t), i = Math.min(e, n, t), o = {
|
|
990
|
-
mode: "hsv",
|
|
991
|
-
s: r === 0 ? 0 : 1 - i / r,
|
|
992
|
-
v: r
|
|
993
|
-
};
|
|
994
|
-
return r - i !== 0 && (o.h = (r === e ? (n - t) / (r - i) + (n < t) * 6 : r === n ? (t - e) / (r - i) + 2 : (e - n) / (r - i) + 4) * 60), a !== void 0 && (o.alpha = a), o;
|
|
995
|
-
}
|
|
996
|
-
const xt = {
|
|
997
|
-
mode: "hsv",
|
|
998
|
-
toMode: {
|
|
999
|
-
rgb: gt
|
|
1000
|
-
},
|
|
1001
|
-
parse: ["--hsv"],
|
|
1002
|
-
serialize: "--hsv",
|
|
1003
|
-
fromMode: {
|
|
1004
|
-
rgb: mt
|
|
1005
|
-
},
|
|
1006
|
-
channels: ["h", "s", "v", "alpha"],
|
|
1007
|
-
ranges: {
|
|
1008
|
-
h: [0, 360]
|
|
1009
|
-
},
|
|
1010
|
-
gamut: "rgb",
|
|
1011
|
-
interpolate: {
|
|
1012
|
-
h: { use: l, fixup: R },
|
|
1013
|
-
s: l,
|
|
1014
|
-
v: l,
|
|
1015
|
-
alpha: { use: l, fixup: k }
|
|
1016
|
-
},
|
|
1017
|
-
difference: {
|
|
1018
|
-
h: ve
|
|
1019
|
-
},
|
|
1020
|
-
average: {
|
|
1021
|
-
h: A
|
|
1022
|
-
}
|
|
1023
|
-
};
|
|
1024
|
-
function N0({ h: e, w: n, b: t, alpha: a }) {
|
|
1025
|
-
if (n === void 0 && (n = 0), t === void 0 && (t = 0), n + t > 1) {
|
|
1026
|
-
let r = n + t;
|
|
1027
|
-
n /= r, t /= r;
|
|
1028
|
-
}
|
|
1029
|
-
return gt({
|
|
1030
|
-
h: e,
|
|
1031
|
-
s: t === 1 ? 1 : 1 - n / (1 - t),
|
|
1032
|
-
v: 1 - t,
|
|
1033
|
-
alpha: a
|
|
1034
|
-
});
|
|
1035
|
-
}
|
|
1036
|
-
function C0(e) {
|
|
1037
|
-
let n = mt(e);
|
|
1038
|
-
if (n === void 0) return;
|
|
1039
|
-
let t = n.s !== void 0 ? n.s : 0, a = n.v !== void 0 ? n.v : 0, r = {
|
|
1040
|
-
mode: "hwb",
|
|
1041
|
-
w: (1 - t) * a,
|
|
1042
|
-
b: 1 - a
|
|
1043
|
-
};
|
|
1044
|
-
return n.h !== void 0 && (r.h = n.h), n.alpha !== void 0 && (r.alpha = n.alpha), r;
|
|
1045
|
-
}
|
|
1046
|
-
function R0(e, n) {
|
|
1047
|
-
if (!n || n[0] !== "hwb")
|
|
1048
|
-
return;
|
|
1049
|
-
const t = { mode: "hwb" }, [, a, r, i, o] = n;
|
|
1050
|
-
if (a.type !== f.None) {
|
|
1051
|
-
if (a.type === f.Percentage)
|
|
1052
|
-
return;
|
|
1053
|
-
t.h = a.value;
|
|
1054
|
-
}
|
|
1055
|
-
if (r.type !== f.None) {
|
|
1056
|
-
if (r.type === f.Hue)
|
|
1057
|
-
return;
|
|
1058
|
-
t.w = r.value / 100;
|
|
1059
|
-
}
|
|
1060
|
-
if (i.type !== f.None) {
|
|
1061
|
-
if (i.type === f.Hue)
|
|
1062
|
-
return;
|
|
1063
|
-
t.b = i.value / 100;
|
|
1064
|
-
}
|
|
1065
|
-
return o.type !== f.None && (t.alpha = Math.min(
|
|
1066
|
-
1,
|
|
1067
|
-
Math.max(
|
|
1068
|
-
0,
|
|
1069
|
-
o.type === f.Number ? o.value : o.value / 100
|
|
1070
|
-
)
|
|
1071
|
-
)), t;
|
|
1072
|
-
}
|
|
1073
|
-
const A0 = {
|
|
1074
|
-
mode: "hwb",
|
|
1075
|
-
toMode: {
|
|
1076
|
-
rgb: N0
|
|
1077
|
-
},
|
|
1078
|
-
fromMode: {
|
|
1079
|
-
rgb: C0
|
|
1080
|
-
},
|
|
1081
|
-
channels: ["h", "w", "b", "alpha"],
|
|
1082
|
-
ranges: {
|
|
1083
|
-
h: [0, 360]
|
|
1084
|
-
},
|
|
1085
|
-
gamut: "rgb",
|
|
1086
|
-
parse: [R0],
|
|
1087
|
-
serialize: (e) => `hwb(${e.h !== void 0 ? e.h : "none"} ${e.w !== void 0 ? e.w * 100 + "%" : "none"} ${e.b !== void 0 ? e.b * 100 + "%" : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
1088
|
-
interpolate: {
|
|
1089
|
-
h: { use: l, fixup: R },
|
|
1090
|
-
w: l,
|
|
1091
|
-
b: l,
|
|
1092
|
-
alpha: { use: l, fixup: k }
|
|
1093
|
-
},
|
|
1094
|
-
difference: {
|
|
1095
|
-
h: m0
|
|
1096
|
-
},
|
|
1097
|
-
average: {
|
|
1098
|
-
h: A
|
|
1099
|
-
}
|
|
1100
|
-
}, Mt = 203, we = 0.1593017578125, yt = 78.84375, ze = 0.8359375, Te = 18.8515625, Pe = 18.6875;
|
|
1101
|
-
function Ze(e) {
|
|
1102
|
-
if (e < 0) return 0;
|
|
1103
|
-
const n = Math.pow(e, 1 / yt);
|
|
1104
|
-
return 1e4 * Math.pow(Math.max(0, n - ze) / (Te - Pe * n), 1 / we);
|
|
1105
|
-
}
|
|
1106
|
-
function Be(e) {
|
|
1107
|
-
if (e < 0) return 0;
|
|
1108
|
-
const n = Math.pow(e / 1e4, we);
|
|
1109
|
-
return Math.pow((ze + Te * n) / (1 + Pe * n), yt);
|
|
1110
|
-
}
|
|
1111
|
-
const Ue = (e) => Math.max(e / Mt, 0), On = ({ i: e, t: n, p: t, alpha: a }) => {
|
|
1112
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
1113
|
-
const r = Ze(
|
|
1114
|
-
e + 0.008609037037932761 * n + 0.11102962500302593 * t
|
|
1115
|
-
), i = Ze(
|
|
1116
|
-
e - 0.00860903703793275 * n - 0.11102962500302599 * t
|
|
1117
|
-
), o = Ze(
|
|
1118
|
-
e + 0.5600313357106791 * n - 0.32062717498731885 * t
|
|
1119
|
-
), d = {
|
|
1120
|
-
mode: "xyz65",
|
|
1121
|
-
x: Ue(
|
|
1122
|
-
2.070152218389422 * r - 1.3263473389671556 * i + 0.2066510476294051 * o
|
|
1123
|
-
),
|
|
1124
|
-
y: Ue(
|
|
1125
|
-
0.3647385209748074 * r + 0.680566024947227 * i - 0.0453045459220346 * o
|
|
1126
|
-
),
|
|
1127
|
-
z: Ue(
|
|
1128
|
-
-0.049747207535812 * r - 0.0492609666966138 * i + 1.1880659249923042 * o
|
|
1129
|
-
)
|
|
1130
|
-
};
|
|
1131
|
-
return a !== void 0 && (d.alpha = a), d;
|
|
1132
|
-
}, We = (e = 0) => Math.max(e * Mt, 0), Xn = ({ x: e, y: n, z: t, alpha: a }) => {
|
|
1133
|
-
const r = We(e), i = We(n), o = We(t), d = Be(
|
|
1134
|
-
0.3592832590121217 * r + 0.6976051147779502 * i - 0.0358915932320289 * o
|
|
1135
|
-
), s = Be(
|
|
1136
|
-
-0.1920808463704995 * r + 1.1004767970374323 * i + 0.0753748658519118 * o
|
|
1137
|
-
), u = Be(
|
|
1138
|
-
0.0070797844607477 * r + 0.0748396662186366 * i + 0.8433265453898765 * o
|
|
1139
|
-
), h = 0.5 * d + 0.5 * s, b = 1.61376953125 * d - 3.323486328125 * s + 1.709716796875 * u, g = 4.378173828125 * d - 4.24560546875 * s - 0.132568359375 * u, M = { mode: "itp", i: h, t: b, p: g };
|
|
1140
|
-
return a !== void 0 && (M.alpha = a), M;
|
|
1141
|
-
}, F0 = {
|
|
1142
|
-
mode: "itp",
|
|
1143
|
-
channels: ["i", "t", "p", "alpha"],
|
|
1144
|
-
parse: ["--ictcp"],
|
|
1145
|
-
serialize: "--ictcp",
|
|
1146
|
-
toMode: {
|
|
1147
|
-
xyz65: On,
|
|
1148
|
-
rgb: (e) => D(On(e))
|
|
1149
|
-
},
|
|
1150
|
-
fromMode: {
|
|
1151
|
-
xyz65: Xn,
|
|
1152
|
-
rgb: (e) => Xn(Y(e))
|
|
1153
|
-
},
|
|
1154
|
-
ranges: {
|
|
1155
|
-
i: [0, 0.581],
|
|
1156
|
-
t: [-0.369, 0.272],
|
|
1157
|
-
p: [-0.164, 0.331]
|
|
1158
|
-
},
|
|
1159
|
-
interpolate: {
|
|
1160
|
-
i: l,
|
|
1161
|
-
t: l,
|
|
1162
|
-
p: l,
|
|
1163
|
-
alpha: { use: l, fixup: k }
|
|
1164
|
-
}
|
|
1165
|
-
}, E0 = 134.03437499999998, H0 = 16295499532821565e-27, Ge = (e) => {
|
|
1166
|
-
if (e < 0) return 0;
|
|
1167
|
-
let n = Math.pow(e / 1e4, we);
|
|
1168
|
-
return Math.pow((ze + Te * n) / (1 + Pe * n), E0);
|
|
1169
|
-
}, Je = (e = 0) => Math.max(e * 203, 0), vt = ({ x: e, y: n, z: t, alpha: a }) => {
|
|
1170
|
-
e = Je(e), n = Je(n), t = Je(t);
|
|
1171
|
-
let r = 1.15 * e - 0.15 * t, i = 0.66 * n + 0.34 * e, o = Ge(0.41478972 * r + 0.579999 * i + 0.014648 * t), d = Ge(-0.20151 * r + 1.120649 * i + 0.0531008 * t), s = Ge(-0.0166008 * r + 0.2648 * i + 0.6684799 * t), u = (o + d) / 2, h = {
|
|
1172
|
-
mode: "jab",
|
|
1173
|
-
j: 0.44 * u / (1 - 0.56 * u) - H0,
|
|
1174
|
-
a: 3.524 * o - 4.066708 * d + 0.542708 * s,
|
|
1175
|
-
b: 0.199076 * o + 1.096799 * d - 1.295875 * s
|
|
1176
|
-
};
|
|
1177
|
-
return a !== void 0 && (h.alpha = a), h;
|
|
1178
|
-
}, I0 = 134.03437499999998, Ln = 16295499532821565e-27, Ve = (e) => {
|
|
1179
|
-
if (e < 0) return 0;
|
|
1180
|
-
let n = Math.pow(e, 1 / I0);
|
|
1181
|
-
return 1e4 * Math.pow((ze - n) / (Pe * n - Te), 1 / we);
|
|
1182
|
-
}, Ke = (e) => e / 203, kt = ({ j: e, a: n, b: t, alpha: a }) => {
|
|
1183
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
1184
|
-
let r = (e + Ln) / (0.44 + 0.56 * (e + Ln)), i = Ve(r + 0.13860504 * n + 0.058047316 * t), o = Ve(r - 0.13860504 * n - 0.058047316 * t), d = Ve(r - 0.096019242 * n - 0.8118919 * t), s = {
|
|
1185
|
-
mode: "xyz65",
|
|
1186
|
-
x: Ke(
|
|
1187
|
-
1.661373024652174 * i - 0.914523081304348 * o + 0.23136208173913045 * d
|
|
1188
|
-
),
|
|
1189
|
-
y: Ke(
|
|
1190
|
-
-0.3250758611844533 * i + 1.571847026732543 * o - 0.21825383453227928 * d
|
|
1191
|
-
),
|
|
1192
|
-
z: Ke(-0.090982811 * i - 0.31272829 * o + 1.5227666 * d)
|
|
1193
|
-
};
|
|
1194
|
-
return a !== void 0 && (s.alpha = a), s;
|
|
1195
|
-
}, _t = (e) => {
|
|
1196
|
-
let n = vt(Y(e));
|
|
1197
|
-
return e.r === e.b && e.b === e.g && (n.a = n.b = 0), n;
|
|
1198
|
-
}, $t = (e) => D(kt(e)), O0 = {
|
|
1199
|
-
mode: "jab",
|
|
1200
|
-
channels: ["j", "a", "b", "alpha"],
|
|
1201
|
-
parse: ["--jzazbz"],
|
|
1202
|
-
serialize: "--jzazbz",
|
|
1203
|
-
fromMode: {
|
|
1204
|
-
rgb: _t,
|
|
1205
|
-
xyz65: vt
|
|
1206
|
-
},
|
|
1207
|
-
toMode: {
|
|
1208
|
-
rgb: $t,
|
|
1209
|
-
xyz65: kt
|
|
1210
|
-
},
|
|
1211
|
-
ranges: {
|
|
1212
|
-
j: [0, 0.222],
|
|
1213
|
-
a: [-0.109, 0.129],
|
|
1214
|
-
b: [-0.185, 0.134]
|
|
1215
|
-
},
|
|
1216
|
-
interpolate: {
|
|
1217
|
-
j: l,
|
|
1218
|
-
a: l,
|
|
1219
|
-
b: l,
|
|
1220
|
-
alpha: { use: l, fixup: k }
|
|
1221
|
-
}
|
|
1222
|
-
}, qn = ({ j: e, a: n, b: t, alpha: a }) => {
|
|
1223
|
-
n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
1224
|
-
let r = Math.sqrt(n * n + t * t), i = {
|
|
1225
|
-
mode: "jch",
|
|
1226
|
-
j: e,
|
|
1227
|
-
c: r
|
|
1228
|
-
};
|
|
1229
|
-
return r && (i.h = z(Math.atan2(t, n) * 180 / Math.PI)), a !== void 0 && (i.alpha = a), i;
|
|
1230
|
-
}, jn = ({ j: e, c: n, h: t, alpha: a }) => {
|
|
1231
|
-
t === void 0 && (t = 0);
|
|
1232
|
-
let r = {
|
|
1233
|
-
mode: "jab",
|
|
1234
|
-
j: e,
|
|
1235
|
-
a: n ? n * Math.cos(t / 180 * Math.PI) : 0,
|
|
1236
|
-
b: n ? n * Math.sin(t / 180 * Math.PI) : 0
|
|
1237
|
-
};
|
|
1238
|
-
return a !== void 0 && (r.alpha = a), r;
|
|
1239
|
-
}, X0 = {
|
|
1240
|
-
mode: "jch",
|
|
1241
|
-
parse: ["--jzczhz"],
|
|
1242
|
-
serialize: "--jzczhz",
|
|
1243
|
-
toMode: {
|
|
1244
|
-
jab: jn,
|
|
1245
|
-
rgb: (e) => $t(jn(e))
|
|
1246
|
-
},
|
|
1247
|
-
fromMode: {
|
|
1248
|
-
rgb: (e) => qn(_t(e)),
|
|
1249
|
-
jab: qn
|
|
1250
|
-
},
|
|
1251
|
-
channels: ["j", "c", "h", "alpha"],
|
|
1252
|
-
ranges: {
|
|
1253
|
-
j: [0, 0.221],
|
|
1254
|
-
c: [0, 0.19],
|
|
1255
|
-
h: [0, 360]
|
|
1256
|
-
},
|
|
1257
|
-
interpolate: {
|
|
1258
|
-
h: { use: l, fixup: R },
|
|
1259
|
-
c: l,
|
|
1260
|
-
j: l,
|
|
1261
|
-
alpha: { use: l, fixup: k }
|
|
1262
|
-
},
|
|
1263
|
-
difference: {
|
|
1264
|
-
h: ke
|
|
1265
|
-
},
|
|
1266
|
-
average: {
|
|
1267
|
-
h: A
|
|
1268
|
-
}
|
|
1269
|
-
}, Se = Math.pow(29, 3) / Math.pow(3, 3), xn = Math.pow(6, 3) / Math.pow(29, 3);
|
|
1270
|
-
let Qe = (e) => Math.pow(e, 3) > xn ? Math.pow(e, 3) : (116 * e - 16) / Se;
|
|
1271
|
-
const Mn = ({ l: e, a: n, b: t, alpha: a }) => {
|
|
1272
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
1273
|
-
let r = (e + 16) / 116, i = n / 500 + r, o = r - t / 200, d = {
|
|
1274
|
-
mode: "xyz50",
|
|
1275
|
-
x: Qe(i) * y.X,
|
|
1276
|
-
y: Qe(r) * y.Y,
|
|
1277
|
-
z: Qe(o) * y.Z
|
|
1278
|
-
};
|
|
1279
|
-
return a !== void 0 && (d.alpha = a), d;
|
|
1280
|
-
}, fe = ({ x: e, y: n, z: t, alpha: a }) => {
|
|
1281
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
1282
|
-
let r = J({
|
|
1283
|
-
r: e * 3.1341359569958707 - n * 1.6173863321612538 - 0.4906619460083532 * t,
|
|
1284
|
-
g: e * -0.978795502912089 + n * 1.916254567259524 + 0.03344273116131949 * t,
|
|
1285
|
-
b: e * 0.07195537988411677 - n * 0.2289768264158322 + 1.405386058324125 * t
|
|
1286
|
-
});
|
|
1287
|
-
return a !== void 0 && (r.alpha = a), r;
|
|
1288
|
-
}, wt = (e) => fe(Mn(e)), le = (e) => {
|
|
1289
|
-
let { r: n, g: t, b: a, alpha: r } = G(e), i = {
|
|
1290
|
-
mode: "xyz50",
|
|
1291
|
-
x: 0.436065742824811 * n + 0.3851514688337912 * t + 0.14307845442264197 * a,
|
|
1292
|
-
y: 0.22249319175623702 * n + 0.7168870538238823 * t + 0.06061979053616537 * a,
|
|
1293
|
-
z: 0.013923904500943465 * n + 0.09708128566574634 * t + 0.7140993584005155 * a
|
|
1294
|
-
};
|
|
1295
|
-
return r !== void 0 && (i.alpha = r), i;
|
|
1296
|
-
}, en = (e) => e > xn ? Math.cbrt(e) : (Se * e + 16) / 116, yn = ({ x: e, y: n, z: t, alpha: a }) => {
|
|
1297
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
1298
|
-
let r = en(e / y.X), i = en(n / y.Y), o = en(t / y.Z), d = {
|
|
1299
|
-
mode: "lab",
|
|
1300
|
-
l: 116 * i - 16,
|
|
1301
|
-
a: 500 * (r - i),
|
|
1302
|
-
b: 200 * (i - o)
|
|
1303
|
-
};
|
|
1304
|
-
return a !== void 0 && (d.alpha = a), d;
|
|
1305
|
-
}, zt = (e) => {
|
|
1306
|
-
let n = yn(le(e));
|
|
1307
|
-
return e.r === e.b && e.b === e.g && (n.a = n.b = 0), n;
|
|
1308
|
-
};
|
|
1309
|
-
function L0(e, n) {
|
|
1310
|
-
if (!n || n[0] !== "lab")
|
|
1311
|
-
return;
|
|
1312
|
-
const t = { mode: "lab" }, [, a, r, i, o] = n;
|
|
1313
|
-
if (!(a.type === f.Hue || r.type === f.Hue || i.type === f.Hue))
|
|
1314
|
-
return a.type !== f.None && (t.l = Math.min(Math.max(0, a.value), 100)), r.type !== f.None && (t.a = r.type === f.Number ? r.value : r.value * 125 / 100), i.type !== f.None && (t.b = i.type === f.Number ? i.value : i.value * 125 / 100), o.type !== f.None && (t.alpha = Math.min(
|
|
1315
|
-
1,
|
|
1316
|
-
Math.max(
|
|
1317
|
-
0,
|
|
1318
|
-
o.type === f.Number ? o.value : o.value / 100
|
|
1319
|
-
)
|
|
1320
|
-
)), t;
|
|
1321
|
-
}
|
|
1322
|
-
const vn = {
|
|
1323
|
-
mode: "lab",
|
|
1324
|
-
toMode: {
|
|
1325
|
-
xyz50: Mn,
|
|
1326
|
-
rgb: wt
|
|
1327
|
-
},
|
|
1328
|
-
fromMode: {
|
|
1329
|
-
xyz50: yn,
|
|
1330
|
-
rgb: zt
|
|
1331
|
-
},
|
|
1332
|
-
channels: ["l", "a", "b", "alpha"],
|
|
1333
|
-
ranges: {
|
|
1334
|
-
l: [0, 100],
|
|
1335
|
-
a: [-125, 125],
|
|
1336
|
-
b: [-125, 125]
|
|
1337
|
-
},
|
|
1338
|
-
parse: [L0],
|
|
1339
|
-
serialize: (e) => `lab(${e.l !== void 0 ? e.l : "none"} ${e.a !== void 0 ? e.a : "none"} ${e.b !== void 0 ? e.b : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
1340
|
-
interpolate: {
|
|
1341
|
-
l,
|
|
1342
|
-
a: l,
|
|
1343
|
-
b: l,
|
|
1344
|
-
alpha: { use: l, fixup: k }
|
|
1345
|
-
}
|
|
1346
|
-
}, q0 = {
|
|
1347
|
-
...vn,
|
|
1348
|
-
mode: "lab65",
|
|
1349
|
-
parse: ["--lab-d65"],
|
|
1350
|
-
serialize: "--lab-d65",
|
|
1351
|
-
toMode: {
|
|
1352
|
-
xyz65: ut,
|
|
1353
|
-
rgb: _e
|
|
1354
|
-
},
|
|
1355
|
-
fromMode: {
|
|
1356
|
-
xyz65: ct,
|
|
1357
|
-
rgb: $e
|
|
1358
|
-
},
|
|
1359
|
-
ranges: {
|
|
1360
|
-
l: [0, 100],
|
|
1361
|
-
a: [-125, 125],
|
|
1362
|
-
b: [-125, 125]
|
|
1363
|
-
}
|
|
1364
|
-
};
|
|
1365
|
-
function j0(e, n) {
|
|
1366
|
-
if (!n || n[0] !== "lch")
|
|
1367
|
-
return;
|
|
1368
|
-
const t = { mode: "lch" }, [, a, r, i, o] = n;
|
|
1369
|
-
if (a.type !== f.None) {
|
|
1370
|
-
if (a.type === f.Hue)
|
|
1371
|
-
return;
|
|
1372
|
-
t.l = Math.min(Math.max(0, a.value), 100);
|
|
1373
|
-
}
|
|
1374
|
-
if (r.type !== f.None && (t.c = Math.max(
|
|
1375
|
-
0,
|
|
1376
|
-
r.type === f.Number ? r.value : r.value * 150 / 100
|
|
1377
|
-
)), i.type !== f.None) {
|
|
1378
|
-
if (i.type === f.Percentage)
|
|
1379
|
-
return;
|
|
1380
|
-
t.h = i.value;
|
|
1381
|
-
}
|
|
1382
|
-
return o.type !== f.None && (t.alpha = Math.min(
|
|
1383
|
-
1,
|
|
1384
|
-
Math.max(
|
|
1385
|
-
0,
|
|
1386
|
-
o.type === f.Number ? o.value : o.value / 100
|
|
1387
|
-
)
|
|
1388
|
-
)), t;
|
|
1389
|
-
}
|
|
1390
|
-
const kn = {
|
|
1391
|
-
mode: "lch",
|
|
1392
|
-
toMode: {
|
|
1393
|
-
lab: O,
|
|
1394
|
-
rgb: (e) => wt(O(e))
|
|
1395
|
-
},
|
|
1396
|
-
fromMode: {
|
|
1397
|
-
rgb: (e) => I(zt(e)),
|
|
1398
|
-
lab: I
|
|
1399
|
-
},
|
|
1400
|
-
channels: ["l", "c", "h", "alpha"],
|
|
1401
|
-
ranges: {
|
|
1402
|
-
l: [0, 100],
|
|
1403
|
-
c: [0, 150],
|
|
1404
|
-
h: [0, 360]
|
|
1405
|
-
},
|
|
1406
|
-
parse: [j0],
|
|
1407
|
-
serialize: (e) => `lch(${e.l !== void 0 ? e.l : "none"} ${e.c !== void 0 ? e.c : "none"} ${e.h !== void 0 ? e.h : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
1408
|
-
interpolate: {
|
|
1409
|
-
h: { use: l, fixup: R },
|
|
1410
|
-
c: l,
|
|
1411
|
-
l,
|
|
1412
|
-
alpha: { use: l, fixup: k }
|
|
1413
|
-
},
|
|
1414
|
-
difference: {
|
|
1415
|
-
h: ke
|
|
1416
|
-
},
|
|
1417
|
-
average: {
|
|
1418
|
-
h: A
|
|
1419
|
-
}
|
|
1420
|
-
}, Y0 = {
|
|
1421
|
-
...kn,
|
|
1422
|
-
mode: "lch65",
|
|
1423
|
-
parse: ["--lch-d65"],
|
|
1424
|
-
serialize: "--lch-d65",
|
|
1425
|
-
toMode: {
|
|
1426
|
-
lab65: (e) => O(e, "lab65"),
|
|
1427
|
-
rgb: (e) => _e(O(e, "lab65"))
|
|
1428
|
-
},
|
|
1429
|
-
fromMode: {
|
|
1430
|
-
rgb: (e) => I($e(e), "lch65"),
|
|
1431
|
-
lab65: (e) => I(e, "lch65")
|
|
1432
|
-
},
|
|
1433
|
-
ranges: {
|
|
1434
|
-
l: [0, 100],
|
|
1435
|
-
c: [0, 150],
|
|
1436
|
-
h: [0, 360]
|
|
1437
|
-
}
|
|
1438
|
-
}, Tt = ({ l: e, u: n, v: t, alpha: a }) => {
|
|
1439
|
-
n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
1440
|
-
let r = Math.sqrt(n * n + t * t), i = {
|
|
1441
|
-
mode: "lchuv",
|
|
1442
|
-
l: e,
|
|
1443
|
-
c: r
|
|
1444
|
-
};
|
|
1445
|
-
return r && (i.h = z(Math.atan2(t, n) * 180 / Math.PI)), a !== void 0 && (i.alpha = a), i;
|
|
1446
|
-
}, Pt = ({ l: e, c: n, h: t, alpha: a }) => {
|
|
1447
|
-
t === void 0 && (t = 0);
|
|
1448
|
-
let r = {
|
|
1449
|
-
mode: "luv",
|
|
1450
|
-
l: e,
|
|
1451
|
-
u: n ? n * Math.cos(t / 180 * Math.PI) : 0,
|
|
1452
|
-
v: n ? n * Math.sin(t / 180 * Math.PI) : 0
|
|
1453
|
-
};
|
|
1454
|
-
return a !== void 0 && (r.alpha = a), r;
|
|
1455
|
-
}, St = (e, n, t) => 4 * e / (e + 15 * n + 3 * t), Nt = (e, n, t) => 9 * n / (e + 15 * n + 3 * t), D0 = St(y.X, y.Y, y.Z), Z0 = Nt(y.X, y.Y, y.Z), B0 = (e) => e <= xn ? Se * e : 116 * Math.cbrt(e) - 16, hn = ({ x: e, y: n, z: t, alpha: a }) => {
|
|
1456
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
1457
|
-
let r = B0(n / y.Y), i = St(e, n, t), o = Nt(e, n, t);
|
|
1458
|
-
!isFinite(i) || !isFinite(o) ? r = i = o = 0 : (i = 13 * r * (i - D0), o = 13 * r * (o - Z0));
|
|
1459
|
-
let d = {
|
|
1460
|
-
mode: "luv",
|
|
1461
|
-
l: r,
|
|
1462
|
-
u: i,
|
|
1463
|
-
v: o
|
|
1464
|
-
};
|
|
1465
|
-
return a !== void 0 && (d.alpha = a), d;
|
|
1466
|
-
}, U0 = (e, n, t) => 4 * e / (e + 15 * n + 3 * t), W0 = (e, n, t) => 9 * n / (e + 15 * n + 3 * t), G0 = U0(y.X, y.Y, y.Z), J0 = W0(y.X, y.Y, y.Z), bn = ({ l: e, u: n, v: t, alpha: a }) => {
|
|
1467
|
-
if (e === void 0 && (e = 0), e === 0)
|
|
1468
|
-
return { mode: "xyz50", x: 0, y: 0, z: 0 };
|
|
1469
|
-
n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
1470
|
-
let r = n / (13 * e) + G0, i = t / (13 * e) + J0, o = y.Y * (e <= 8 ? e / Se : Math.pow((e + 16) / 116, 3)), d = o * (9 * r) / (4 * i), s = o * (12 - 3 * r - 20 * i) / (4 * i), u = { mode: "xyz50", x: d, y: o, z: s };
|
|
1471
|
-
return a !== void 0 && (u.alpha = a), u;
|
|
1472
|
-
}, V0 = (e) => Tt(hn(le(e))), K0 = (e) => fe(bn(Pt(e))), Q0 = {
|
|
1473
|
-
mode: "lchuv",
|
|
1474
|
-
toMode: {
|
|
1475
|
-
luv: Pt,
|
|
1476
|
-
rgb: K0
|
|
1477
|
-
},
|
|
1478
|
-
fromMode: {
|
|
1479
|
-
rgb: V0,
|
|
1480
|
-
luv: Tt
|
|
1481
|
-
},
|
|
1482
|
-
channels: ["l", "c", "h", "alpha"],
|
|
1483
|
-
parse: ["--lchuv"],
|
|
1484
|
-
serialize: "--lchuv",
|
|
1485
|
-
ranges: {
|
|
1486
|
-
l: [0, 100],
|
|
1487
|
-
c: [0, 176.956],
|
|
1488
|
-
h: [0, 360]
|
|
1489
|
-
},
|
|
1490
|
-
interpolate: {
|
|
1491
|
-
h: { use: l, fixup: R },
|
|
1492
|
-
c: l,
|
|
1493
|
-
l,
|
|
1494
|
-
alpha: { use: l, fixup: k }
|
|
1495
|
-
},
|
|
1496
|
-
difference: {
|
|
1497
|
-
h: ke
|
|
1498
|
-
},
|
|
1499
|
-
average: {
|
|
1500
|
-
h: A
|
|
1501
|
-
}
|
|
1502
|
-
}, er = {
|
|
1503
|
-
...W,
|
|
1504
|
-
mode: "lrgb",
|
|
1505
|
-
toMode: {
|
|
1506
|
-
rgb: J
|
|
1507
|
-
},
|
|
1508
|
-
fromMode: {
|
|
1509
|
-
rgb: G
|
|
1510
|
-
},
|
|
1511
|
-
parse: ["srgb-linear"],
|
|
1512
|
-
serialize: "srgb-linear"
|
|
1513
|
-
}, nr = {
|
|
1514
|
-
mode: "luv",
|
|
1515
|
-
toMode: {
|
|
1516
|
-
xyz50: bn,
|
|
1517
|
-
rgb: (e) => fe(bn(e))
|
|
1518
|
-
},
|
|
1519
|
-
fromMode: {
|
|
1520
|
-
xyz50: hn,
|
|
1521
|
-
rgb: (e) => hn(le(e))
|
|
1522
|
-
},
|
|
1523
|
-
channels: ["l", "u", "v", "alpha"],
|
|
1524
|
-
parse: ["--luv"],
|
|
1525
|
-
serialize: "--luv",
|
|
1526
|
-
ranges: {
|
|
1527
|
-
l: [0, 100],
|
|
1528
|
-
u: [-84.936, 175.042],
|
|
1529
|
-
v: [-125.882, 87.243]
|
|
1530
|
-
},
|
|
1531
|
-
interpolate: {
|
|
1532
|
-
l,
|
|
1533
|
-
u: l,
|
|
1534
|
-
v: l,
|
|
1535
|
-
alpha: { use: l, fixup: k }
|
|
1536
|
-
}
|
|
1537
|
-
}, Ct = ({ r: e, g: n, b: t, alpha: a }) => {
|
|
1538
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
1539
|
-
let r = Math.cbrt(
|
|
1540
|
-
0.412221469470763 * e + 0.5363325372617348 * n + 0.0514459932675022 * t
|
|
1541
|
-
), i = Math.cbrt(
|
|
1542
|
-
0.2119034958178252 * e + 0.6806995506452344 * n + 0.1073969535369406 * t
|
|
1543
|
-
), o = Math.cbrt(
|
|
1544
|
-
0.0883024591900564 * e + 0.2817188391361215 * n + 0.6299787016738222 * t
|
|
1545
|
-
), d = {
|
|
1546
|
-
mode: "oklab",
|
|
1547
|
-
l: 0.210454268309314 * r + 0.7936177747023054 * i - 0.0040720430116193 * o,
|
|
1548
|
-
a: 1.9779985324311684 * r - 2.42859224204858 * i + 0.450593709617411 * o,
|
|
1549
|
-
b: 0.0259040424655478 * r + 0.7827717124575296 * i - 0.8086757549230774 * o
|
|
1550
|
-
};
|
|
1551
|
-
return a !== void 0 && (d.alpha = a), d;
|
|
1552
|
-
}, Ne = (e) => {
|
|
1553
|
-
let n = Ct(G(e));
|
|
1554
|
-
return e.r === e.b && e.b === e.g && (n.a = n.b = 0), n;
|
|
1555
|
-
}, se = ({ l: e, a: n, b: t, alpha: a }) => {
|
|
1556
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
1557
|
-
let r = Math.pow(e + 0.3963377773761749 * n + 0.2158037573099136 * t, 3), i = Math.pow(e - 0.1055613458156586 * n - 0.0638541728258133 * t, 3), o = Math.pow(e - 0.0894841775298119 * n - 1.2914855480194092 * t, 3), d = {
|
|
1558
|
-
mode: "lrgb",
|
|
1559
|
-
r: 4.076741636075957 * r - 3.3077115392580616 * i + 0.2309699031821044 * o,
|
|
1560
|
-
g: -1.2684379732850317 * r + 2.6097573492876887 * i - 0.3413193760026573 * o,
|
|
1561
|
-
b: -0.0041960761386756 * r - 0.7034186179359362 * i + 1.7076146940746117 * o
|
|
1562
|
-
};
|
|
1563
|
-
return a !== void 0 && (d.alpha = a), d;
|
|
1564
|
-
}, Ce = (e) => J(se(e));
|
|
1565
|
-
function pn(e) {
|
|
1566
|
-
const a = 1.170873786407767;
|
|
1567
|
-
return 0.5 * (a * e - 0.206 + Math.sqrt((a * e - 0.206) * (a * e - 0.206) + 4 * 0.03 * a * e));
|
|
1568
|
-
}
|
|
1569
|
-
function Me(e) {
|
|
1570
|
-
return (e * e + 0.206 * e) / (1.170873786407767 * (e + 0.03));
|
|
1571
|
-
}
|
|
1572
|
-
function tr(e, n) {
|
|
1573
|
-
let t, a, r, i, o, d, s, u;
|
|
1574
|
-
-1.88170328 * e - 0.80936493 * n > 1 ? (t = 1.19086277, a = 1.76576728, r = 0.59662641, i = 0.75515197, o = 0.56771245, d = 4.0767416621, s = -3.3077115913, u = 0.2309699292) : 1.81444104 * e - 1.19445276 * n > 1 ? (t = 0.73956515, a = -0.45954404, r = 0.08285427, i = 0.1254107, o = 0.14503204, d = -1.2684380046, s = 2.6097574011, u = -0.3413193965) : (t = 1.35733652, a = -915799e-8, r = -1.1513021, i = -0.50559606, o = 692167e-8, d = -0.0041960863, s = -0.7034186147, u = 1.707614701);
|
|
1575
|
-
let h = t + a * e + r * n + i * e * e + o * e * n, b = 0.3963377774 * e + 0.2158037573 * n, g = -0.1055613458 * e - 0.0638541728 * n, M = -0.0894841775 * e - 1.291485548 * n;
|
|
1576
|
-
{
|
|
1577
|
-
let v = 1 + h * b, w = 1 + h * g, _ = 1 + h * M, N = v * v * v, P = w * w * w, F = _ * _ * _, V = 3 * b * v * v, K = 3 * g * w * w, Q = 3 * M * _ * _, ee = 6 * b * b * v, ne = 6 * g * g * w, te = 6 * M * M * _, Z = d * N + s * P + u * F, X = d * V + s * K + u * Q, re = d * ee + s * ne + u * te;
|
|
1578
|
-
h = h - Z * X / (X * X - 0.5 * Z * re);
|
|
1579
|
-
}
|
|
1580
|
-
return h;
|
|
1581
|
-
}
|
|
1582
|
-
function _n(e, n) {
|
|
1583
|
-
let t = tr(e, n), a = se({ l: 1, a: t * e, b: t * n }), r = Math.cbrt(1 / Math.max(a.r, a.g, a.b)), i = r * t;
|
|
1584
|
-
return [r, i];
|
|
1585
|
-
}
|
|
1586
|
-
function rr(e, n, t, a, r, i = null) {
|
|
1587
|
-
i || (i = _n(e, n));
|
|
1588
|
-
let o;
|
|
1589
|
-
if ((t - r) * i[1] - (i[0] - r) * a <= 0)
|
|
1590
|
-
o = i[1] * r / (a * i[0] + i[1] * (r - t));
|
|
1591
|
-
else {
|
|
1592
|
-
o = i[1] * (r - 1) / (a * (i[0] - 1) + i[1] * (r - t));
|
|
1593
|
-
{
|
|
1594
|
-
let d = t - r, s = a, u = 0.3963377774 * e + 0.2158037573 * n, h = -0.1055613458 * e - 0.0638541728 * n, b = -0.0894841775 * e - 1.291485548 * n, g = d + s * u, M = d + s * h, v = d + s * b;
|
|
1595
|
-
{
|
|
1596
|
-
let w = r * (1 - o) + o * t, _ = o * a, N = w + _ * u, P = w + _ * h, F = w + _ * b, V = N * N * N, K = P * P * P, Q = F * F * F, ee = 3 * g * N * N, ne = 3 * M * P * P, te = 3 * v * F * F, Z = 6 * g * g * N, X = 6 * M * M * P, re = 6 * v * v * F, wn = 4.0767416621 * V - 3.3077115913 * K + 0.2309699292 * Q - 1, Ae = 4.0767416621 * ee - 3.3077115913 * ne + 0.2309699292 * te, Xt = 4.0767416621 * Z - 3.3077115913 * X + 0.2309699292 * re, zn = Ae / (Ae * Ae - 0.5 * wn * Xt), Fe = -wn * zn, Tn = -1.2684380046 * V + 2.6097574011 * K - 0.3413193965 * Q - 1, Ee = -1.2684380046 * ee + 2.6097574011 * ne - 0.3413193965 * te, Lt = -1.2684380046 * Z + 2.6097574011 * X - 0.3413193965 * re, Pn = Ee / (Ee * Ee - 0.5 * Tn * Lt), He = -Tn * Pn, Sn = -0.0041960863 * V - 0.7034186147 * K + 1.707614701 * Q - 1, Ie = -0.0041960863 * ee - 0.7034186147 * ne + 1.707614701 * te, qt = -0.0041960863 * Z - 0.7034186147 * X + 1.707614701 * re, Nn = Ie / (Ie * Ie - 0.5 * Sn * qt), Oe = -Sn * Nn;
|
|
1597
|
-
Fe = zn >= 0 ? Fe : 1e6, He = Pn >= 0 ? He : 1e6, Oe = Nn >= 0 ? Oe : 1e6, o += Math.min(Fe, Math.min(He, Oe));
|
|
1598
|
-
}
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
return o;
|
|
1602
|
-
}
|
|
1603
|
-
function $n(e, n, t = null) {
|
|
1604
|
-
t || (t = _n(e, n));
|
|
1605
|
-
let a = t[0], r = t[1];
|
|
1606
|
-
return [r / a, r / (1 - a)];
|
|
1607
|
-
}
|
|
1608
|
-
function Rt(e, n, t) {
|
|
1609
|
-
let a = _n(n, t), r = rr(n, t, e, 1, e, a), i = $n(n, t, a), o = 0.11516993 + 1 / (7.4477897 + 4.1590124 * t + n * (-2.19557347 + 1.75198401 * t + n * (-2.13704948 - 10.02301043 * t + n * (-4.24894561 + 5.38770819 * t + 4.69891013 * n)))), d = 0.11239642 + 1 / (1.6132032 - 0.68124379 * t + n * (0.40370612 + 0.90148123 * t + n * (-0.27087943 + 0.6122399 * t + n * (299215e-8 - 0.45399568 * t - 0.14661872 * n)))), s = r / Math.min(e * i[0], (1 - e) * i[1]), u = e * o, h = (1 - e) * d, b = 0.9 * s * Math.sqrt(
|
|
1610
|
-
Math.sqrt(
|
|
1611
|
-
1 / (1 / (u * u * u * u) + 1 / (h * h * h * h))
|
|
1612
|
-
)
|
|
1613
|
-
);
|
|
1614
|
-
return u = e * 0.4, h = (1 - e) * 0.8, [Math.sqrt(1 / (1 / (u * u) + 1 / (h * h))), b, r];
|
|
1615
|
-
}
|
|
1616
|
-
function Yn(e) {
|
|
1617
|
-
const n = e.l !== void 0 ? e.l : 0, t = e.a !== void 0 ? e.a : 0, a = e.b !== void 0 ? e.b : 0, r = { mode: "okhsl", l: pn(n) };
|
|
1618
|
-
e.alpha !== void 0 && (r.alpha = e.alpha);
|
|
1619
|
-
let i = Math.sqrt(t * t + a * a);
|
|
1620
|
-
if (!i)
|
|
1621
|
-
return r.s = 0, r;
|
|
1622
|
-
let [o, d, s] = Rt(n, t / i, a / i), u;
|
|
1623
|
-
if (i < d) {
|
|
1624
|
-
let h = 0, b = 0.8 * o, g = 1 - b / d;
|
|
1625
|
-
u = (i - h) / (b + g * (i - h)) * 0.8;
|
|
1626
|
-
} else {
|
|
1627
|
-
let h = d, b = 0.2 * d * d * 1.25 * 1.25 / o, g = 1 - b / (s - d);
|
|
1628
|
-
u = 0.8 + 0.2 * ((i - h) / (b + g * (i - h)));
|
|
1629
|
-
}
|
|
1630
|
-
return u && (r.s = u, r.h = z(Math.atan2(a, t) * 180 / Math.PI)), r;
|
|
1631
|
-
}
|
|
1632
|
-
function Dn(e) {
|
|
1633
|
-
let n = e.h !== void 0 ? e.h : 0, t = e.s !== void 0 ? e.s : 0, a = e.l !== void 0 ? e.l : 0;
|
|
1634
|
-
const r = { mode: "oklab", l: Me(a) };
|
|
1635
|
-
if (e.alpha !== void 0 && (r.alpha = e.alpha), !t || a === 1)
|
|
1636
|
-
return r.a = r.b = 0, r;
|
|
1637
|
-
let i = Math.cos(n / 180 * Math.PI), o = Math.sin(n / 180 * Math.PI), [d, s, u] = Rt(r.l, i, o), h, b, g, M;
|
|
1638
|
-
t < 0.8 ? (h = 1.25 * t, b = 0, g = 0.8 * d, M = 1 - g / s) : (h = 5 * (t - 0.8), b = s, g = 0.2 * s * s * 1.25 * 1.25 / d, M = 1 - g / (u - s));
|
|
1639
|
-
let v = b + h * g / (1 - M * h);
|
|
1640
|
-
return r.a = v * i, r.b = v * o, r;
|
|
1641
|
-
}
|
|
1642
|
-
const ar = {
|
|
1643
|
-
...pt,
|
|
1644
|
-
mode: "okhsl",
|
|
1645
|
-
channels: ["h", "s", "l", "alpha"],
|
|
1646
|
-
parse: ["--okhsl"],
|
|
1647
|
-
serialize: "--okhsl",
|
|
1648
|
-
fromMode: {
|
|
1649
|
-
oklab: Yn,
|
|
1650
|
-
rgb: (e) => Yn(Ne(e))
|
|
1651
|
-
},
|
|
1652
|
-
toMode: {
|
|
1653
|
-
oklab: Dn,
|
|
1654
|
-
rgb: (e) => Ce(Dn(e))
|
|
1655
|
-
}
|
|
1656
|
-
};
|
|
1657
|
-
function Zn(e) {
|
|
1658
|
-
let n = e.l !== void 0 ? e.l : 0, t = e.a !== void 0 ? e.a : 0, a = e.b !== void 0 ? e.b : 0, r = Math.sqrt(t * t + a * a), i = r ? t / r : 1, o = r ? a / r : 1, [d, s] = $n(i, o), u = 0.5, h = 1 - u / d, b = s / (r + n * s), g = b * n, M = b * r, v = Me(g), w = M * v / g, _ = se({ l: v, a: i * w, b: o * w }), N = Math.cbrt(
|
|
1659
|
-
1 / Math.max(_.r, _.g, _.b, 0)
|
|
1660
|
-
);
|
|
1661
|
-
n = n / N, r = r / N * pn(n) / n, n = pn(n);
|
|
1662
|
-
const P = {
|
|
1663
|
-
mode: "okhsv",
|
|
1664
|
-
s: r ? (u + s) * M / (s * u + s * h * M) : 0,
|
|
1665
|
-
v: n ? n / g : 0
|
|
1666
|
-
};
|
|
1667
|
-
return P.s && (P.h = z(Math.atan2(a, t) * 180 / Math.PI)), e.alpha !== void 0 && (P.alpha = e.alpha), P;
|
|
1668
|
-
}
|
|
1669
|
-
function Bn(e) {
|
|
1670
|
-
const n = { mode: "oklab" };
|
|
1671
|
-
e.alpha !== void 0 && (n.alpha = e.alpha);
|
|
1672
|
-
const t = e.h !== void 0 ? e.h : 0, a = e.s !== void 0 ? e.s : 0, r = e.v !== void 0 ? e.v : 0, i = Math.cos(t / 180 * Math.PI), o = Math.sin(t / 180 * Math.PI), [d, s] = $n(i, o), u = 0.5, h = 1 - u / d, b = 1 - a * u / (u + s - s * h * a), g = a * s * u / (u + s - s * h * a), M = Me(b), v = g * M / b, w = se({
|
|
1673
|
-
l: M,
|
|
1674
|
-
a: i * v,
|
|
1675
|
-
b: o * v
|
|
1676
|
-
}), _ = Math.cbrt(
|
|
1677
|
-
1 / Math.max(w.r, w.g, w.b, 0)
|
|
1678
|
-
), N = Me(r * b), P = g * N / b;
|
|
1679
|
-
return n.l = N * _, n.a = P * i * _, n.b = P * o * _, n;
|
|
1680
|
-
}
|
|
1681
|
-
const ir = {
|
|
1682
|
-
...xt,
|
|
1683
|
-
mode: "okhsv",
|
|
1684
|
-
channels: ["h", "s", "v", "alpha"],
|
|
1685
|
-
parse: ["--okhsv"],
|
|
1686
|
-
serialize: "--okhsv",
|
|
1687
|
-
fromMode: {
|
|
1688
|
-
oklab: Zn,
|
|
1689
|
-
rgb: (e) => Zn(Ne(e))
|
|
1690
|
-
},
|
|
1691
|
-
toMode: {
|
|
1692
|
-
oklab: Bn,
|
|
1693
|
-
rgb: (e) => Ce(Bn(e))
|
|
1694
|
-
}
|
|
1695
|
-
};
|
|
1696
|
-
function or(e, n) {
|
|
1697
|
-
if (!n || n[0] !== "oklab")
|
|
1698
|
-
return;
|
|
1699
|
-
const t = { mode: "oklab" }, [, a, r, i, o] = n;
|
|
1700
|
-
if (!(a.type === f.Hue || r.type === f.Hue || i.type === f.Hue))
|
|
1701
|
-
return a.type !== f.None && (t.l = Math.min(
|
|
1702
|
-
Math.max(0, a.type === f.Number ? a.value : a.value / 100),
|
|
1703
|
-
1
|
|
1704
|
-
)), r.type !== f.None && (t.a = r.type === f.Number ? r.value : r.value * 0.4 / 100), i.type !== f.None && (t.b = i.type === f.Number ? i.value : i.value * 0.4 / 100), o.type !== f.None && (t.alpha = Math.min(
|
|
1705
|
-
1,
|
|
1706
|
-
Math.max(
|
|
1707
|
-
0,
|
|
1708
|
-
o.type === f.Number ? o.value : o.value / 100
|
|
1709
|
-
)
|
|
1710
|
-
)), t;
|
|
1711
|
-
}
|
|
1712
|
-
const dr = {
|
|
1713
|
-
...vn,
|
|
1714
|
-
mode: "oklab",
|
|
1715
|
-
toMode: {
|
|
1716
|
-
lrgb: se,
|
|
1717
|
-
rgb: Ce
|
|
1718
|
-
},
|
|
1719
|
-
fromMode: {
|
|
1720
|
-
lrgb: Ct,
|
|
1721
|
-
rgb: Ne
|
|
1722
|
-
},
|
|
1723
|
-
ranges: {
|
|
1724
|
-
l: [0, 1],
|
|
1725
|
-
a: [-0.4, 0.4],
|
|
1726
|
-
b: [-0.4, 0.4]
|
|
1727
|
-
},
|
|
1728
|
-
parse: [or],
|
|
1729
|
-
serialize: (e) => `oklab(${e.l !== void 0 ? e.l : "none"} ${e.a !== void 0 ? e.a : "none"} ${e.b !== void 0 ? e.b : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`
|
|
1730
|
-
};
|
|
1731
|
-
function fr(e, n) {
|
|
1732
|
-
if (!n || n[0] !== "oklch")
|
|
1733
|
-
return;
|
|
1734
|
-
const t = { mode: "oklch" }, [, a, r, i, o] = n;
|
|
1735
|
-
if (a.type !== f.None) {
|
|
1736
|
-
if (a.type === f.Hue)
|
|
1737
|
-
return;
|
|
1738
|
-
t.l = Math.min(
|
|
1739
|
-
Math.max(0, a.type === f.Number ? a.value : a.value / 100),
|
|
1740
|
-
1
|
|
1741
|
-
);
|
|
1742
|
-
}
|
|
1743
|
-
if (r.type !== f.None && (t.c = Math.max(
|
|
1744
|
-
0,
|
|
1745
|
-
r.type === f.Number ? r.value : r.value * 0.4 / 100
|
|
1746
|
-
)), i.type !== f.None) {
|
|
1747
|
-
if (i.type === f.Percentage)
|
|
1748
|
-
return;
|
|
1749
|
-
t.h = i.value;
|
|
1750
|
-
}
|
|
1751
|
-
return o.type !== f.None && (t.alpha = Math.min(
|
|
1752
|
-
1,
|
|
1753
|
-
Math.max(
|
|
1754
|
-
0,
|
|
1755
|
-
o.type === f.Number ? o.value : o.value / 100
|
|
1756
|
-
)
|
|
1757
|
-
)), t;
|
|
1758
|
-
}
|
|
1759
|
-
const lr = {
|
|
1760
|
-
...kn,
|
|
1761
|
-
mode: "oklch",
|
|
1762
|
-
toMode: {
|
|
1763
|
-
oklab: (e) => O(e, "oklab"),
|
|
1764
|
-
rgb: (e) => Ce(O(e, "oklab"))
|
|
1765
|
-
},
|
|
1766
|
-
fromMode: {
|
|
1767
|
-
rgb: (e) => I(Ne(e), "oklch"),
|
|
1768
|
-
oklab: (e) => I(e, "oklch")
|
|
1769
|
-
},
|
|
1770
|
-
parse: [fr],
|
|
1771
|
-
serialize: (e) => `oklch(${e.l !== void 0 ? e.l : "none"} ${e.c !== void 0 ? e.c : "none"} ${e.h !== void 0 ? e.h : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
1772
|
-
ranges: {
|
|
1773
|
-
l: [0, 1],
|
|
1774
|
-
c: [0, 0.4],
|
|
1775
|
-
h: [0, 360]
|
|
1776
|
-
}
|
|
1777
|
-
}, Un = (e) => {
|
|
1778
|
-
let { r: n, g: t, b: a, alpha: r } = G(e), i = {
|
|
1779
|
-
mode: "xyz65",
|
|
1780
|
-
x: 0.486570948648216 * n + 0.265667693169093 * t + 0.1982172852343625 * a,
|
|
1781
|
-
y: 0.2289745640697487 * n + 0.6917385218365062 * t + 0.079286914093745 * a,
|
|
1782
|
-
z: 0 * n + 0.0451133818589026 * t + 1.043944368900976 * a
|
|
1783
|
-
};
|
|
1784
|
-
return r !== void 0 && (i.alpha = r), i;
|
|
1785
|
-
}, Wn = ({ x: e, y: n, z: t, alpha: a }) => {
|
|
1786
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
1787
|
-
let r = J(
|
|
1788
|
-
{
|
|
1789
|
-
r: e * 2.4934969119414263 - n * 0.9313836179191242 - 0.402710784450717 * t,
|
|
1790
|
-
g: e * -0.8294889695615749 + n * 1.7626640603183465 + 0.0236246858419436 * t,
|
|
1791
|
-
b: e * 0.0358458302437845 - n * 0.0761723892680418 + 0.9568845240076871 * t
|
|
1792
|
-
},
|
|
1793
|
-
"p3"
|
|
1794
|
-
);
|
|
1795
|
-
return a !== void 0 && (r.alpha = a), r;
|
|
1796
|
-
}, sr = {
|
|
1797
|
-
...W,
|
|
1798
|
-
mode: "p3",
|
|
1799
|
-
parse: ["display-p3"],
|
|
1800
|
-
serialize: "display-p3",
|
|
1801
|
-
fromMode: {
|
|
1802
|
-
rgb: (e) => Wn(Y(e)),
|
|
1803
|
-
xyz65: Wn
|
|
1804
|
-
},
|
|
1805
|
-
toMode: {
|
|
1806
|
-
rgb: (e) => D(Un(e)),
|
|
1807
|
-
xyz65: Un
|
|
1808
|
-
}
|
|
1809
|
-
}, nn = (e) => {
|
|
1810
|
-
let n = Math.abs(e);
|
|
1811
|
-
return n >= 1 / 512 ? Math.sign(e) * Math.pow(n, 1 / 1.8) : 16 * e;
|
|
1812
|
-
}, Gn = ({ x: e, y: n, z: t, alpha: a }) => {
|
|
1813
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
1814
|
-
let r = {
|
|
1815
|
-
mode: "prophoto",
|
|
1816
|
-
r: nn(
|
|
1817
|
-
e * 1.3457868816471585 - n * 0.2555720873797946 - 0.0511018649755453 * t
|
|
1818
|
-
),
|
|
1819
|
-
g: nn(
|
|
1820
|
-
e * -0.5446307051249019 + n * 1.5082477428451466 + 0.0205274474364214 * t
|
|
1821
|
-
),
|
|
1822
|
-
b: nn(e * 0 + n * 0 + 1.2119675456389452 * t)
|
|
1823
|
-
};
|
|
1824
|
-
return a !== void 0 && (r.alpha = a), r;
|
|
1825
|
-
}, tn = (e = 0) => {
|
|
1826
|
-
let n = Math.abs(e);
|
|
1827
|
-
return n >= 16 / 512 ? Math.sign(e) * Math.pow(n, 1.8) : e / 16;
|
|
1828
|
-
}, Jn = (e) => {
|
|
1829
|
-
let n = tn(e.r), t = tn(e.g), a = tn(e.b), r = {
|
|
1830
|
-
mode: "xyz50",
|
|
1831
|
-
x: 0.7977666449006423 * n + 0.1351812974005331 * t + 0.0313477341283922 * a,
|
|
1832
|
-
y: 0.2880748288194013 * n + 0.7118352342418731 * t + 899369387256e-16 * a,
|
|
1833
|
-
z: 0 * n + 0 * t + 0.8251046025104602 * a
|
|
1834
|
-
};
|
|
1835
|
-
return e.alpha !== void 0 && (r.alpha = e.alpha), r;
|
|
1836
|
-
}, ur = {
|
|
1837
|
-
...W,
|
|
1838
|
-
mode: "prophoto",
|
|
1839
|
-
parse: ["prophoto-rgb"],
|
|
1840
|
-
serialize: "prophoto-rgb",
|
|
1841
|
-
fromMode: {
|
|
1842
|
-
xyz50: Gn,
|
|
1843
|
-
rgb: (e) => Gn(le(e))
|
|
1844
|
-
},
|
|
1845
|
-
toMode: {
|
|
1846
|
-
xyz50: Jn,
|
|
1847
|
-
rgb: (e) => fe(Jn(e))
|
|
1848
|
-
}
|
|
1849
|
-
}, Vn = 1.09929682680944, cr = 0.018053968510807, rn = (e) => {
|
|
1850
|
-
const n = Math.abs(e);
|
|
1851
|
-
return n > cr ? (Math.sign(e) || 1) * (Vn * Math.pow(n, 0.45) - (Vn - 1)) : 4.5 * e;
|
|
1852
|
-
}, Kn = ({ x: e, y: n, z: t, alpha: a }) => {
|
|
1853
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
1854
|
-
let r = {
|
|
1855
|
-
mode: "rec2020",
|
|
1856
|
-
r: rn(
|
|
1857
|
-
e * 1.7166511879712683 - n * 0.3556707837763925 - 0.2533662813736599 * t
|
|
1858
|
-
),
|
|
1859
|
-
g: rn(
|
|
1860
|
-
e * -0.6666843518324893 + n * 1.6164812366349395 + 0.0157685458139111 * t
|
|
1861
|
-
),
|
|
1862
|
-
b: rn(
|
|
1863
|
-
e * 0.0176398574453108 - n * 0.0427706132578085 + 0.9421031212354739 * t
|
|
1864
|
-
)
|
|
1865
|
-
};
|
|
1866
|
-
return a !== void 0 && (r.alpha = a), r;
|
|
1867
|
-
}, Qn = 1.09929682680944, hr = 0.018053968510807, an = (e = 0) => {
|
|
1868
|
-
let n = Math.abs(e);
|
|
1869
|
-
return n < hr * 4.5 ? e / 4.5 : (Math.sign(e) || 1) * Math.pow((n + Qn - 1) / Qn, 1 / 0.45);
|
|
1870
|
-
}, et = (e) => {
|
|
1871
|
-
let n = an(e.r), t = an(e.g), a = an(e.b), r = {
|
|
1872
|
-
mode: "xyz65",
|
|
1873
|
-
x: 0.6369580483012911 * n + 0.1446169035862083 * t + 0.1688809751641721 * a,
|
|
1874
|
-
y: 0.262700212011267 * n + 0.6779980715188708 * t + 0.059301716469862 * a,
|
|
1875
|
-
z: 0 * n + 0.0280726930490874 * t + 1.0609850577107909 * a
|
|
1876
|
-
};
|
|
1877
|
-
return e.alpha !== void 0 && (r.alpha = e.alpha), r;
|
|
1878
|
-
}, br = {
|
|
1879
|
-
...W,
|
|
1880
|
-
mode: "rec2020",
|
|
1881
|
-
fromMode: {
|
|
1882
|
-
xyz65: Kn,
|
|
1883
|
-
rgb: (e) => Kn(Y(e))
|
|
1884
|
-
},
|
|
1885
|
-
toMode: {
|
|
1886
|
-
xyz65: et,
|
|
1887
|
-
rgb: (e) => D(et(e))
|
|
1888
|
-
},
|
|
1889
|
-
parse: ["rec2020"],
|
|
1890
|
-
serialize: "rec2020"
|
|
1891
|
-
}, j = 0.0037930732552754493, At = Math.cbrt(j), on = (e) => Math.cbrt(e) - At, pr = (e) => {
|
|
1892
|
-
const { r: n, g: t, b: a, alpha: r } = G(e), i = on(0.3 * n + 0.622 * t + 0.078 * a + j), o = on(0.23 * n + 0.692 * t + 0.078 * a + j), d = on(
|
|
1893
|
-
0.2434226892454782 * n + 0.2047674442449682 * t + 0.5518098665095535 * a + j
|
|
1894
|
-
), s = {
|
|
1895
|
-
mode: "xyb",
|
|
1896
|
-
x: (i - o) / 2,
|
|
1897
|
-
y: (i + o) / 2,
|
|
1898
|
-
/* Apply default chroma from luma (subtract Y from B) */
|
|
1899
|
-
b: d - (i + o) / 2
|
|
1900
|
-
};
|
|
1901
|
-
return r !== void 0 && (s.alpha = r), s;
|
|
1902
|
-
}, dn = (e) => Math.pow(e + At, 3), gr = ({ x: e, y: n, b: t, alpha: a }) => {
|
|
1903
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
1904
|
-
const r = dn(e + n) - j, i = dn(n - e) - j, o = dn(t + n) - j, d = J({
|
|
1905
|
-
r: 11.031566904639861 * r - 9.866943908131562 * i - 0.16462299650829934 * o,
|
|
1906
|
-
g: -3.2541473810744237 * r + 4.418770377582723 * i - 0.16462299650829934 * o,
|
|
1907
|
-
b: -3.6588512867136815 * r + 2.7129230459360922 * i + 1.9459282407775895 * o
|
|
1908
|
-
});
|
|
1909
|
-
return a !== void 0 && (d.alpha = a), d;
|
|
1910
|
-
}, mr = {
|
|
1911
|
-
mode: "xyb",
|
|
1912
|
-
channels: ["x", "y", "b", "alpha"],
|
|
1913
|
-
parse: ["--xyb"],
|
|
1914
|
-
serialize: "--xyb",
|
|
1915
|
-
toMode: {
|
|
1916
|
-
rgb: gr
|
|
1917
|
-
},
|
|
1918
|
-
fromMode: {
|
|
1919
|
-
rgb: pr
|
|
1920
|
-
},
|
|
1921
|
-
ranges: {
|
|
1922
|
-
x: [-0.0154, 0.0281],
|
|
1923
|
-
y: [0, 0.8453],
|
|
1924
|
-
b: [-0.2778, 0.388]
|
|
1925
|
-
},
|
|
1926
|
-
interpolate: {
|
|
1927
|
-
x: l,
|
|
1928
|
-
y: l,
|
|
1929
|
-
b: l,
|
|
1930
|
-
alpha: { use: l, fixup: k }
|
|
1931
|
-
}
|
|
1932
|
-
}, xr = {
|
|
1933
|
-
mode: "xyz50",
|
|
1934
|
-
parse: ["xyz-d50"],
|
|
1935
|
-
serialize: "xyz-d50",
|
|
1936
|
-
toMode: {
|
|
1937
|
-
rgb: fe,
|
|
1938
|
-
lab: yn
|
|
1939
|
-
},
|
|
1940
|
-
fromMode: {
|
|
1941
|
-
rgb: le,
|
|
1942
|
-
lab: Mn
|
|
1943
|
-
},
|
|
1944
|
-
channels: ["x", "y", "z", "alpha"],
|
|
1945
|
-
ranges: {
|
|
1946
|
-
x: [0, 0.964],
|
|
1947
|
-
y: [0, 0.999],
|
|
1948
|
-
z: [0, 0.825]
|
|
1949
|
-
},
|
|
1950
|
-
interpolate: {
|
|
1951
|
-
x: l,
|
|
1952
|
-
y: l,
|
|
1953
|
-
z: l,
|
|
1954
|
-
alpha: { use: l, fixup: k }
|
|
1955
|
-
}
|
|
1956
|
-
}, Mr = (e) => {
|
|
1957
|
-
let { x: n, y: t, z: a, alpha: r } = e;
|
|
1958
|
-
n === void 0 && (n = 0), t === void 0 && (t = 0), a === void 0 && (a = 0);
|
|
1959
|
-
let i = {
|
|
1960
|
-
mode: "xyz50",
|
|
1961
|
-
x: 1.0479298208405488 * n + 0.0229467933410191 * t - 0.0501922295431356 * a,
|
|
1962
|
-
y: 0.0296278156881593 * n + 0.990434484573249 * t - 0.0170738250293851 * a,
|
|
1963
|
-
z: -0.0092430581525912 * n + 0.0150551448965779 * t + 0.7518742899580008 * a
|
|
1964
|
-
};
|
|
1965
|
-
return r !== void 0 && (i.alpha = r), i;
|
|
1966
|
-
}, yr = (e) => {
|
|
1967
|
-
let { x: n, y: t, z: a, alpha: r } = e;
|
|
1968
|
-
n === void 0 && (n = 0), t === void 0 && (t = 0), a === void 0 && (a = 0);
|
|
1969
|
-
let i = {
|
|
1970
|
-
mode: "xyz65",
|
|
1971
|
-
x: 0.9554734527042182 * n - 0.0230985368742614 * t + 0.0632593086610217 * a,
|
|
1972
|
-
y: -0.0283697069632081 * n + 1.0099954580058226 * t + 0.021041398966943 * a,
|
|
1973
|
-
z: 0.0123140016883199 * n - 0.0205076964334779 * t + 1.3303659366080753 * a
|
|
1974
|
-
};
|
|
1975
|
-
return r !== void 0 && (i.alpha = r), i;
|
|
1976
|
-
}, vr = {
|
|
1977
|
-
mode: "xyz65",
|
|
1978
|
-
toMode: {
|
|
1979
|
-
rgb: D,
|
|
1980
|
-
xyz50: Mr
|
|
1981
|
-
},
|
|
1982
|
-
fromMode: {
|
|
1983
|
-
rgb: Y,
|
|
1984
|
-
xyz50: yr
|
|
1985
|
-
},
|
|
1986
|
-
ranges: {
|
|
1987
|
-
x: [0, 0.95],
|
|
1988
|
-
y: [0, 1],
|
|
1989
|
-
z: [0, 1.088]
|
|
1990
|
-
},
|
|
1991
|
-
channels: ["x", "y", "z", "alpha"],
|
|
1992
|
-
parse: ["xyz", "xyz-d65"],
|
|
1993
|
-
serialize: "xyz-d65",
|
|
1994
|
-
interpolate: {
|
|
1995
|
-
x: l,
|
|
1996
|
-
y: l,
|
|
1997
|
-
z: l,
|
|
1998
|
-
alpha: { use: l, fixup: k }
|
|
1999
|
-
}
|
|
2000
|
-
}, kr = ({ r: e, g: n, b: t, alpha: a }) => {
|
|
2001
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
2002
|
-
const r = {
|
|
2003
|
-
mode: "yiq",
|
|
2004
|
-
y: 0.29889531 * e + 0.58662247 * n + 0.11448223 * t,
|
|
2005
|
-
i: 0.59597799 * e - 0.2741761 * n - 0.32180189 * t,
|
|
2006
|
-
q: 0.21147017 * e - 0.52261711 * n + 0.31114694 * t
|
|
2007
|
-
};
|
|
2008
|
-
return a !== void 0 && (r.alpha = a), r;
|
|
2009
|
-
}, _r = ({ y: e, i: n, q: t, alpha: a }) => {
|
|
2010
|
-
e === void 0 && (e = 0), n === void 0 && (n = 0), t === void 0 && (t = 0);
|
|
2011
|
-
const r = {
|
|
2012
|
-
mode: "rgb",
|
|
2013
|
-
r: e + 0.95608445 * n + 0.6208885 * t,
|
|
2014
|
-
g: e - 0.27137664 * n - 0.6486059 * t,
|
|
2015
|
-
b: e - 1.10561724 * n + 1.70250126 * t
|
|
2016
|
-
};
|
|
2017
|
-
return a !== void 0 && (r.alpha = a), r;
|
|
2018
|
-
}, $r = {
|
|
2019
|
-
mode: "yiq",
|
|
2020
|
-
toMode: {
|
|
2021
|
-
rgb: _r
|
|
2022
|
-
},
|
|
2023
|
-
fromMode: {
|
|
2024
|
-
rgb: kr
|
|
2025
|
-
},
|
|
2026
|
-
channels: ["y", "i", "q", "alpha"],
|
|
2027
|
-
parse: ["--yiq"],
|
|
2028
|
-
serialize: "--yiq",
|
|
2029
|
-
ranges: {
|
|
2030
|
-
i: [-0.595, 0.595],
|
|
2031
|
-
q: [-0.522, 0.522]
|
|
2032
|
-
},
|
|
2033
|
-
interpolate: {
|
|
2034
|
-
y: l,
|
|
2035
|
-
i: l,
|
|
2036
|
-
q: l,
|
|
2037
|
-
alpha: { use: l, fixup: k }
|
|
2038
|
-
}
|
|
2039
|
-
};
|
|
2040
|
-
p(u0);
|
|
2041
|
-
p(x0);
|
|
2042
|
-
p(M0);
|
|
2043
|
-
p(y0);
|
|
2044
|
-
p(_0);
|
|
2045
|
-
p(pt);
|
|
2046
|
-
p(xt);
|
|
2047
|
-
p(A0);
|
|
2048
|
-
p(F0);
|
|
2049
|
-
p(O0);
|
|
2050
|
-
p(X0);
|
|
2051
|
-
p(vn);
|
|
2052
|
-
p(q0);
|
|
2053
|
-
p(kn);
|
|
2054
|
-
p(Y0);
|
|
2055
|
-
p(Q0);
|
|
2056
|
-
p(er);
|
|
2057
|
-
p(nr);
|
|
2058
|
-
p(ar);
|
|
2059
|
-
p(ir);
|
|
2060
|
-
p(dr);
|
|
2061
|
-
p(lr);
|
|
2062
|
-
p(sr);
|
|
2063
|
-
p(ur);
|
|
2064
|
-
p(br);
|
|
2065
|
-
p(W);
|
|
2066
|
-
p(mr);
|
|
2067
|
-
p(xr);
|
|
2068
|
-
p(vr);
|
|
2069
|
-
p($r);
|
|
2070
|
-
const Ft = it("rgb");
|
|
2071
|
-
function Et(e) {
|
|
2072
|
-
const n = mn(e);
|
|
2073
|
-
if (!n) return null;
|
|
2074
|
-
const t = Ft(n);
|
|
2075
|
-
return !t || t.alpha !== void 0 && t.alpha !== 1 || !L(t.r) || !L(t.g) || !L(t.b) ? null : {
|
|
2076
|
-
r: q(t.r) * 255,
|
|
2077
|
-
g: q(t.g) * 255,
|
|
2078
|
-
b: q(t.b) * 255
|
|
2079
|
-
};
|
|
2080
|
-
}
|
|
2081
|
-
function na(e) {
|
|
2082
|
-
const n = mn(e);
|
|
2083
|
-
if (!n) return null;
|
|
2084
|
-
const t = Ft(n);
|
|
2085
|
-
if (!t || !L(t.r) || !L(t.g) || !L(t.b))
|
|
2086
|
-
return null;
|
|
2087
|
-
const a = t.alpha ?? 1;
|
|
2088
|
-
return L(a) ? {
|
|
2089
|
-
r: q(t.r) * 255,
|
|
2090
|
-
g: q(t.g) * 255,
|
|
2091
|
-
b: q(t.b) * 255,
|
|
2092
|
-
alpha: q(a)
|
|
2093
|
-
} : null;
|
|
2094
|
-
}
|
|
2095
|
-
function wr({ r: e, g: n, b: t }) {
|
|
2096
|
-
const a = e / 255, r = n / 255, i = t / 255, o = Math.max(a, r, i), d = Math.min(a, r, i), s = o - d;
|
|
2097
|
-
let u = 0;
|
|
2098
|
-
const h = (o + d) / 2, b = s === 0 ? 0 : s / (1 - Math.abs(2 * h - 1));
|
|
2099
|
-
if (s !== 0) {
|
|
2100
|
-
switch (o) {
|
|
2101
|
-
case a:
|
|
2102
|
-
u = (r - i) / s % 6;
|
|
2103
|
-
break;
|
|
2104
|
-
case r:
|
|
2105
|
-
u = (i - a) / s + 2;
|
|
2106
|
-
break;
|
|
2107
|
-
case i:
|
|
2108
|
-
u = (a - r) / s + 4;
|
|
2109
|
-
break;
|
|
2110
|
-
}
|
|
2111
|
-
u *= 60, u < 0 && (u += 360);
|
|
2112
|
-
}
|
|
2113
|
-
return {
|
|
2114
|
-
h: Math.round(u),
|
|
2115
|
-
s: Number((b * 100).toFixed(1)),
|
|
2116
|
-
l: Number((h * 100).toFixed(1))
|
|
2117
|
-
};
|
|
2118
|
-
}
|
|
2119
|
-
function zr(e) {
|
|
2120
|
-
const { h: n, s: t, l: a } = wr(e);
|
|
2121
|
-
return `${n} ${t}% ${a}%`;
|
|
2122
|
-
}
|
|
2123
|
-
function ta(e) {
|
|
2124
|
-
const n = Et(e);
|
|
2125
|
-
return n ? zr(n) : null;
|
|
2126
|
-
}
|
|
2127
|
-
function L(e) {
|
|
2128
|
-
return typeof e == "number" && Number.isFinite(e);
|
|
2129
|
-
}
|
|
2130
|
-
function q(e) {
|
|
2131
|
-
return Math.min(1, Math.max(0, e));
|
|
2132
|
-
}
|
|
2133
|
-
const Tr = 1, ye = '"Open Sans", Arial, ui-sans-serif, system-ui, sans-serif', nt = ye, tt = 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace', ra = [
|
|
2134
|
-
{
|
|
2135
|
-
id: "open-sans",
|
|
2136
|
-
label: "Semaphor default / Open Sans",
|
|
2137
|
-
value: ye
|
|
2138
|
-
},
|
|
2139
|
-
{
|
|
2140
|
-
id: "inter",
|
|
2141
|
-
label: "Inter",
|
|
2142
|
-
value: 'Inter, "Open Sans", Arial, ui-sans-serif, system-ui, sans-serif'
|
|
2143
|
-
},
|
|
2144
|
-
{
|
|
2145
|
-
id: "ibm-plex-sans",
|
|
2146
|
-
label: "IBM Plex Sans",
|
|
2147
|
-
value: '"IBM Plex Sans", "Open Sans", Arial, ui-sans-serif, system-ui, sans-serif'
|
|
2148
|
-
},
|
|
2149
|
-
{
|
|
2150
|
-
id: "system",
|
|
2151
|
-
label: "System UI",
|
|
2152
|
-
value: 'ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'
|
|
2153
|
-
}
|
|
2154
|
-
], Pr = [
|
|
2155
|
-
"#2563eb",
|
|
2156
|
-
"#db2777",
|
|
2157
|
-
"#eda100",
|
|
2158
|
-
"#0891b2",
|
|
2159
|
-
"#eb6834",
|
|
2160
|
-
"#8b5cf6",
|
|
2161
|
-
"#008300",
|
|
2162
|
-
"#e87ba4"
|
|
2163
|
-
], Sr = [
|
|
2164
|
-
"#3b82f6",
|
|
2165
|
-
"#db2777",
|
|
2166
|
-
"#c98500",
|
|
2167
|
-
"#00a6b0",
|
|
2168
|
-
"#d95926",
|
|
2169
|
-
"#9085e9",
|
|
2170
|
-
"#008300",
|
|
2171
|
-
"#d55181"
|
|
2172
|
-
], Nr = {
|
|
2173
|
-
version: 1,
|
|
2174
|
-
mode: "system",
|
|
2175
|
-
schemes: {
|
|
2176
|
-
light: {
|
|
2177
|
-
tokens: {
|
|
2178
|
-
color: {
|
|
2179
|
-
background: "hsl(0 0% 100%)",
|
|
2180
|
-
foreground: "hsl(240 5.9% 10%)",
|
|
2181
|
-
muted: "hsl(0 0% 98%)",
|
|
2182
|
-
mutedForeground: "hsl(240 3.8% 46.1%)",
|
|
2183
|
-
border: "hsl(240 5.9% 90%)",
|
|
2184
|
-
input: "hsl(240 5.9% 90%)",
|
|
2185
|
-
primary: "hsl(240 5.9% 10%)",
|
|
2186
|
-
primaryForeground: "hsl(0 0% 98%)",
|
|
2187
|
-
accent: "hsl(240 4.8% 95.9%)",
|
|
2188
|
-
accentForeground: "hsl(240 5.9% 10%)",
|
|
2189
|
-
selection: "hsl(217 91% 53%)",
|
|
2190
|
-
card: "hsl(0 0% 100%)",
|
|
2191
|
-
cardForeground: "hsl(240 5.9% 10%)",
|
|
2192
|
-
positive: "#16a34a",
|
|
2193
|
-
negative: "#dc2626",
|
|
2194
|
-
warning: "#d97706",
|
|
2195
|
-
info: "#0284c7",
|
|
2196
|
-
destructive: "hsl(0 72.2% 50.6%)",
|
|
2197
|
-
destructiveForeground: "hsl(0 0% 98%)"
|
|
2198
|
-
},
|
|
2199
|
-
typography: {
|
|
2200
|
-
fontFamily: ye,
|
|
2201
|
-
headingFontFamily: nt,
|
|
2202
|
-
monoFontFamily: tt,
|
|
2203
|
-
baseFontSize: 14,
|
|
2204
|
-
density: "comfortable"
|
|
2205
|
-
},
|
|
2206
|
-
radius: {
|
|
2207
|
-
control: 5,
|
|
2208
|
-
card: 5,
|
|
2209
|
-
table: 5,
|
|
2210
|
-
badge: 999
|
|
2211
|
-
},
|
|
2212
|
-
spacing: {
|
|
2213
|
-
dashboardPadding: 10,
|
|
2214
|
-
gridGap: 10,
|
|
2215
|
-
cardPadding: 16,
|
|
2216
|
-
controlGap: 8,
|
|
2217
|
-
tableCellX: 12,
|
|
2218
|
-
tableCellY: 8
|
|
2219
|
-
},
|
|
2220
|
-
shadow: {
|
|
2221
|
-
card: "none",
|
|
2222
|
-
popover: "0 12px 32px rgba(15, 23, 42, 0.14)",
|
|
2223
|
-
focusRing: "0 0 0 2px rgba(37, 99, 235, 0.35)"
|
|
2224
|
-
}
|
|
2225
|
-
},
|
|
2226
|
-
components: {
|
|
2227
|
-
dashboard: {
|
|
2228
|
-
background: "muted"
|
|
2229
|
-
},
|
|
2230
|
-
card: {
|
|
2231
|
-
borderWidth: 1
|
|
2232
|
-
},
|
|
2233
|
-
chart: {
|
|
2234
|
-
palette: Pr,
|
|
2235
|
-
barRadius: 0
|
|
2236
|
-
},
|
|
2237
|
-
table: {
|
|
2238
|
-
density: "compact"
|
|
2239
|
-
}
|
|
2240
|
-
}
|
|
2241
|
-
},
|
|
2242
|
-
dark: {
|
|
2243
|
-
tokens: {
|
|
2244
|
-
color: {
|
|
2245
|
-
background: "hsl(240 10% 3.9%)",
|
|
2246
|
-
foreground: "hsl(0 0% 93%)",
|
|
2247
|
-
muted: "hsl(240 5.9% 10%)",
|
|
2248
|
-
mutedForeground: "hsl(240 5% 64.9%)",
|
|
2249
|
-
border: "hsl(240 3.7% 15.9%)",
|
|
2250
|
-
input: "hsl(240 3.7% 15.9%)",
|
|
2251
|
-
primary: "hsl(0 0% 98%)",
|
|
2252
|
-
primaryForeground: "hsl(240 5.9% 10%)",
|
|
2253
|
-
accent: "hsl(240 3.7% 15.9%)",
|
|
2254
|
-
accentForeground: "hsl(0 0% 93%)",
|
|
2255
|
-
selection: "hsl(217 91% 64%)",
|
|
2256
|
-
card: "hsl(240 10% 3.9%)",
|
|
2257
|
-
cardForeground: "hsl(0 0% 93%)",
|
|
2258
|
-
positive: "#22c55e",
|
|
2259
|
-
negative: "#f87171",
|
|
2260
|
-
warning: "#fbbf24",
|
|
2261
|
-
info: "#38bdf8",
|
|
2262
|
-
destructive: "hsl(0 62.8% 30.6%)",
|
|
2263
|
-
destructiveForeground: "hsl(0 0% 93%)"
|
|
2264
|
-
},
|
|
2265
|
-
typography: {
|
|
2266
|
-
fontFamily: ye,
|
|
2267
|
-
headingFontFamily: nt,
|
|
2268
|
-
monoFontFamily: tt,
|
|
2269
|
-
baseFontSize: 14,
|
|
2270
|
-
density: "comfortable"
|
|
2271
|
-
},
|
|
2272
|
-
radius: {
|
|
2273
|
-
control: 5,
|
|
2274
|
-
card: 5,
|
|
2275
|
-
table: 5,
|
|
2276
|
-
badge: 999
|
|
2277
|
-
},
|
|
2278
|
-
spacing: {
|
|
2279
|
-
dashboardPadding: 10,
|
|
2280
|
-
gridGap: 10,
|
|
2281
|
-
cardPadding: 16,
|
|
2282
|
-
controlGap: 8,
|
|
2283
|
-
tableCellX: 12,
|
|
2284
|
-
tableCellY: 8
|
|
2285
|
-
},
|
|
2286
|
-
shadow: {
|
|
2287
|
-
card: "none",
|
|
2288
|
-
popover: "0 12px 32px rgba(0, 0, 0, 0.45)",
|
|
2289
|
-
focusRing: "0 0 0 2px rgba(96, 165, 250, 0.35)"
|
|
2290
|
-
}
|
|
2291
|
-
},
|
|
2292
|
-
components: {
|
|
2293
|
-
dashboard: {
|
|
2294
|
-
background: "muted"
|
|
2295
|
-
},
|
|
2296
|
-
card: {
|
|
2297
|
-
borderWidth: 1
|
|
2298
|
-
},
|
|
2299
|
-
chart: {
|
|
2300
|
-
palette: Sr,
|
|
2301
|
-
barRadius: 0,
|
|
2302
|
-
// slate-800: the dark grid charts have always drawn.
|
|
2303
|
-
gridColor: "#1e293b"
|
|
2304
|
-
},
|
|
2305
|
-
table: {
|
|
2306
|
-
density: "compact"
|
|
2307
|
-
}
|
|
2308
|
-
}
|
|
2309
|
-
}
|
|
2310
|
-
}
|
|
2311
|
-
}, aa = Ht(
|
|
2312
|
-
Nr
|
|
2313
|
-
);
|
|
2314
|
-
function Ht(e) {
|
|
2315
|
-
if (typeof e != "object" || e === null || Object.isFrozen(e))
|
|
2316
|
-
return e;
|
|
2317
|
-
Object.freeze(e);
|
|
2318
|
-
for (const n of Object.values(e))
|
|
2319
|
-
Ht(n);
|
|
2320
|
-
return e;
|
|
2321
|
-
}
|
|
2322
|
-
const Cr = /* @__PURE__ */ new Set(["light", "dark", "system"]), Rr = /* @__PURE__ */ new Set([
|
|
2323
|
-
"compact",
|
|
2324
|
-
"comfortable",
|
|
2325
|
-
"spacious"
|
|
2326
|
-
]), Ar = Object.fromEntries(
|
|
2327
|
-
[
|
|
2328
|
-
"background",
|
|
2329
|
-
"foreground",
|
|
2330
|
-
"muted",
|
|
2331
|
-
"mutedForeground",
|
|
2332
|
-
"border",
|
|
2333
|
-
"input",
|
|
2334
|
-
"primary",
|
|
2335
|
-
"primaryForeground",
|
|
2336
|
-
"accent",
|
|
2337
|
-
"accentForeground",
|
|
2338
|
-
"selection",
|
|
2339
|
-
"card",
|
|
2340
|
-
"cardForeground",
|
|
2341
|
-
"positive",
|
|
2342
|
-
"negative",
|
|
2343
|
-
"warning",
|
|
2344
|
-
"info",
|
|
2345
|
-
"destructive",
|
|
2346
|
-
"destructiveForeground"
|
|
2347
|
-
].map((e) => [e, m])
|
|
2348
|
-
), Fr = {
|
|
2349
|
-
fontFamily: H,
|
|
2350
|
-
headingFontFamily: H,
|
|
2351
|
-
monoFontFamily: H,
|
|
2352
|
-
baseFontSize: ie,
|
|
2353
|
-
density: It
|
|
2354
|
-
}, Er = {
|
|
2355
|
-
control: S,
|
|
2356
|
-
card: S,
|
|
2357
|
-
table: S,
|
|
2358
|
-
badge: S
|
|
2359
|
-
}, Hr = {
|
|
2360
|
-
dashboardPadding: S,
|
|
2361
|
-
gridGap: S,
|
|
2362
|
-
cardPadding: S,
|
|
2363
|
-
controlGap: S,
|
|
2364
|
-
tableCellX: S,
|
|
2365
|
-
tableCellY: S
|
|
2366
|
-
}, Ir = {
|
|
2367
|
-
card: H,
|
|
2368
|
-
popover: H,
|
|
2369
|
-
focusRing: H
|
|
2370
|
-
}, Re = {
|
|
2371
|
-
background: m,
|
|
2372
|
-
foreground: m,
|
|
2373
|
-
borderColor: m,
|
|
2374
|
-
borderRadius: S,
|
|
2375
|
-
shadow: H,
|
|
2376
|
-
padding: S
|
|
2377
|
-
}, Or = {
|
|
2378
|
-
...Re,
|
|
2379
|
-
background: Qr
|
|
2380
|
-
}, Xr = {
|
|
2381
|
-
...Re,
|
|
2382
|
-
borderWidth: ea
|
|
2383
|
-
}, Lr = {
|
|
2384
|
-
...Re,
|
|
2385
|
-
toolbarBackground: m
|
|
2386
|
-
}, qr = {
|
|
2387
|
-
palette: Kr,
|
|
2388
|
-
barRadius: S,
|
|
2389
|
-
background: m,
|
|
2390
|
-
foreground: m,
|
|
2391
|
-
gridColor: m,
|
|
2392
|
-
axisColor: m
|
|
2393
|
-
}, jr = {
|
|
2394
|
-
background: m,
|
|
2395
|
-
borderColor: m,
|
|
2396
|
-
borderRadius: S,
|
|
2397
|
-
shadow: H
|
|
2398
|
-
}, he = {
|
|
2399
|
-
density: It,
|
|
2400
|
-
container: x(jr),
|
|
2401
|
-
header: x({
|
|
2402
|
-
background: m,
|
|
2403
|
-
foreground: m,
|
|
2404
|
-
dividerColor: m,
|
|
2405
|
-
fontWeight: ie,
|
|
2406
|
-
uppercase: fn,
|
|
2407
|
-
sticky: fn
|
|
2408
|
-
}),
|
|
2409
|
-
row: x({
|
|
2410
|
-
height: ie,
|
|
2411
|
-
dividerColor: m,
|
|
2412
|
-
zebra: fn,
|
|
2413
|
-
zebraBackground: m,
|
|
2414
|
-
hoverBackground: m,
|
|
2415
|
-
selectedBackground: m
|
|
2416
|
-
}),
|
|
2417
|
-
cell: x({
|
|
2418
|
-
paddingX: S,
|
|
2419
|
-
paddingY: S,
|
|
2420
|
-
verticalAlign: Jr,
|
|
2421
|
-
wrap: Vr
|
|
2422
|
-
}),
|
|
2423
|
-
subtotal: x({
|
|
2424
|
-
background: m,
|
|
2425
|
-
foreground: m,
|
|
2426
|
-
fontWeight: ie
|
|
2427
|
-
}),
|
|
2428
|
-
grandTotal: x({
|
|
2429
|
-
background: m,
|
|
2430
|
-
foreground: m,
|
|
2431
|
-
fontWeight: ie,
|
|
2432
|
-
borderColor: m
|
|
2433
|
-
}),
|
|
2434
|
-
pagination: x({
|
|
2435
|
-
background: m,
|
|
2436
|
-
foreground: m,
|
|
2437
|
-
borderColor: m
|
|
2438
|
-
})
|
|
2439
|
-
}, Yr = {
|
|
2440
|
-
color: x(Ar),
|
|
2441
|
-
typography: x(Fr),
|
|
2442
|
-
radius: x(Er),
|
|
2443
|
-
spacing: x(Hr),
|
|
2444
|
-
shadow: x(Ir)
|
|
2445
|
-
}, Dr = {
|
|
2446
|
-
dashboard: x(Or),
|
|
2447
|
-
card: x(Xr),
|
|
2448
|
-
interactive: x(Lr),
|
|
2449
|
-
chart: x(qr),
|
|
2450
|
-
table: x(he),
|
|
2451
|
-
pivotTable: x(he),
|
|
2452
|
-
matrixTable: x(he),
|
|
2453
|
-
aggregateTable: x(he),
|
|
2454
|
-
pagination: x(Re)
|
|
2455
|
-
}, rt = {
|
|
2456
|
-
tokens: x(Yr),
|
|
2457
|
-
components: x(Dr)
|
|
2458
|
-
}, Zr = {
|
|
2459
|
-
light: x(rt),
|
|
2460
|
-
dark: x(rt)
|
|
2461
|
-
}, Br = {
|
|
2462
|
-
version: Wr,
|
|
2463
|
-
mode: Gr,
|
|
2464
|
-
schemes: x(Zr)
|
|
2465
|
-
};
|
|
2466
|
-
function Ur(e) {
|
|
2467
|
-
const n = [];
|
|
2468
|
-
return x(Br)(e, "$", n), Ot(e) && !("version" in e) && T(n, "$.version", "invalid_version", "version must be 1"), n.length > 0 ? { success: !1, issues: n } : {
|
|
2469
|
-
success: !0,
|
|
2470
|
-
value: e,
|
|
2471
|
-
issues: []
|
|
2472
|
-
};
|
|
2473
|
-
}
|
|
2474
|
-
function ia(e) {
|
|
2475
|
-
const n = Ur(e);
|
|
2476
|
-
if (n.success) return;
|
|
2477
|
-
const t = n.issues[0];
|
|
2478
|
-
throw new Error(
|
|
2479
|
-
`Invalid AppearanceSpec at ${t.path}: ${t.message}`
|
|
2480
|
-
);
|
|
2481
|
-
}
|
|
2482
|
-
function x(e) {
|
|
2483
|
-
return (n, t, a) => {
|
|
2484
|
-
if (!Ot(n)) {
|
|
2485
|
-
T(a, t, "invalid_type", "expected an object");
|
|
2486
|
-
return;
|
|
2487
|
-
}
|
|
2488
|
-
for (const r of Object.keys(n)) {
|
|
2489
|
-
const i = e[r], o = `${t}.${r}`;
|
|
2490
|
-
if (!i) {
|
|
2491
|
-
T(a, o, "unsupported_field", "field is not supported in AppearanceSpec V1");
|
|
2492
|
-
continue;
|
|
2493
|
-
}
|
|
2494
|
-
i(n[r], o, a);
|
|
2495
|
-
}
|
|
2496
|
-
};
|
|
2497
|
-
}
|
|
2498
|
-
function Wr(e, n, t) {
|
|
2499
|
-
e !== Tr && T(t, n, "invalid_version", "version must be 1");
|
|
2500
|
-
}
|
|
2501
|
-
function Gr(e, n, t) {
|
|
2502
|
-
(typeof e != "string" || !Cr.has(e)) && T(t, n, "invalid_value", "mode must be light, dark, or system");
|
|
2503
|
-
}
|
|
2504
|
-
function It(e, n, t) {
|
|
2505
|
-
(typeof e != "string" || !Rr.has(e)) && T(t, n, "invalid_value", "density must be compact, comfortable, or spacious");
|
|
2506
|
-
}
|
|
2507
|
-
function Jr(e, n, t) {
|
|
2508
|
-
e !== "top" && e !== "middle" && e !== "bottom" && T(t, n, "invalid_value", "verticalAlign must be top, middle, or bottom");
|
|
2509
|
-
}
|
|
2510
|
-
function Vr(e, n, t) {
|
|
2511
|
-
e !== "wrap" && e !== "nowrap" && T(t, n, "invalid_value", "wrap must be wrap or nowrap");
|
|
2512
|
-
}
|
|
2513
|
-
function fn(e, n, t) {
|
|
2514
|
-
typeof e != "boolean" && T(t, n, "invalid_type", "expected a boolean");
|
|
2515
|
-
}
|
|
2516
|
-
function m(e, n, t) {
|
|
2517
|
-
if (typeof e != "string" || e.trim() === "") {
|
|
2518
|
-
T(t, n, "invalid_type", "color must be a non-empty string");
|
|
2519
|
-
return;
|
|
2520
|
-
}
|
|
2521
|
-
Et(e) || T(t, n, "invalid_color", "color must be a valid opaque CSS color");
|
|
2522
|
-
}
|
|
2523
|
-
function Kr(e, n, t) {
|
|
2524
|
-
if (!Array.isArray(e)) {
|
|
2525
|
-
T(t, n, "invalid_type", "expected an array of colors");
|
|
2526
|
-
return;
|
|
2527
|
-
}
|
|
2528
|
-
if (e.length === 0) {
|
|
2529
|
-
T(t, n, "invalid_value", "palette must contain at least one color");
|
|
2530
|
-
return;
|
|
2531
|
-
}
|
|
2532
|
-
e.forEach((a, r) => m(a, `${n}[${r}]`, t));
|
|
2533
|
-
}
|
|
2534
|
-
function H(e, n, t) {
|
|
2535
|
-
(typeof e != "string" || e.trim() === "") && T(t, n, "invalid_type", "expected a non-empty string");
|
|
2536
|
-
}
|
|
2537
|
-
function ie(e, n, t) {
|
|
2538
|
-
(typeof e != "number" || !Number.isFinite(e) || e <= 0) && T(t, n, "invalid_value", "expected a positive number");
|
|
2539
|
-
}
|
|
2540
|
-
function Qr(e, n, t) {
|
|
2541
|
-
e === "muted" || e === "background" || m(e, n, t);
|
|
2542
|
-
}
|
|
2543
|
-
function ea(e, n, t) {
|
|
2544
|
-
e === 0 || e === 1 || T(t, n, "invalid_value", "borderWidth must be 0 or 1");
|
|
2545
|
-
}
|
|
2546
|
-
function S(e, n, t) {
|
|
2547
|
-
(typeof e != "number" || !Number.isFinite(e) || e < 0) && T(t, n, "invalid_value", "expected a non-negative number");
|
|
2548
|
-
}
|
|
2549
|
-
function T(e, n, t, a) {
|
|
2550
|
-
e.push({ path: n, code: t, message: a });
|
|
2551
|
-
}
|
|
2552
|
-
function Ot(e) {
|
|
2553
|
-
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
2554
|
-
return !1;
|
|
2555
|
-
const n = Object.getPrototypeOf(e);
|
|
2556
|
-
return n === Object.prototype || n === null;
|
|
2557
|
-
}
|
|
2558
|
-
export {
|
|
2559
|
-
Tr as A,
|
|
2560
|
-
aa as S,
|
|
2561
|
-
Pr as a,
|
|
2562
|
-
ia as b,
|
|
2563
|
-
ta as c,
|
|
2564
|
-
ra as d,
|
|
2565
|
-
na as e,
|
|
2566
|
-
Et as p,
|
|
2567
|
-
Ur as v
|
|
2568
|
-
};
|