@pagehub/sdk 0.1.4 → 0.1.6
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/README.md +1 -1
- package/dist/chrome/viewport/Viewport/hooks/usePageLoadIndicator.d.ts +2 -2
- package/dist/chrome/viewport/design-system/hooks/useDesignSystem.d.ts +2 -2
- package/dist/chrome/viewport/design-system/hooks/usePaletteState.d.ts +2 -2
- package/dist/chunks/ActionEditorPanel-9v50QUwu.js +89 -0
- package/dist/chunks/ActionInput-CTt7sOs6.js +929 -0
- package/dist/chunks/ActionsAddPicker-BeTPUUor.js +51 -0
- package/dist/chunks/ActionsInput-D0h-zLYj.js +174 -0
- package/dist/chunks/AnchoredPopover-CckPTxXu.js +2676 -0
- package/dist/chunks/AnimationEditorPanel-CXNmsTqV.js +26 -0
- package/dist/chunks/AnimationsInput-Djyz0uXG.js +292 -0
- package/dist/chunks/AnimationsInputPopover-B2-oNebx.js +71 -0
- package/dist/chunks/AnimationsPanel-DungA9qb.js +25 -0
- package/dist/chunks/Audio.render-CsR69fZ9.js +22 -0
- package/dist/chunks/AudioMainTab-BljM2NMQ.js +70 -0
- package/dist/chunks/BackdropEditorPanel-CA2k-6SR.js +26 -0
- package/dist/chunks/BackgroundImageInputPopover-vB_217Ig.js +94 -0
- package/dist/chunks/BackgroundImagePanel-BvMhF9eU.js +100 -0
- package/dist/chunks/BackgroundMainTab-CI4c5DEF.js +10 -0
- package/dist/chunks/BundleRowPanel-BcYfyfGQ.js +33 -0
- package/dist/chunks/ButtonMainTab-Civy_DoA.js +43 -0
- package/dist/chunks/CSSEditorInput-C1ITwAh3.js +73 -0
- package/dist/chunks/ClassNameInput-Ce0fGQES.js +720 -0
- package/dist/chunks/CodeEditor-axBXmPH8.js +33370 -0
- package/dist/chunks/ColorInput-BSfMNt86.js +187 -0
- package/dist/chunks/ColorPanel-DOLrT-gS.js +562 -0
- package/dist/chunks/ComponentImportExportPanel-DVcnGhGx.js +161 -0
- package/dist/chunks/ComponentImportExportPopover-BY1_oxU8.js +26 -0
- package/dist/chunks/ConditionEditorPanel-DLbqYaSF.js +43 -0
- package/dist/chunks/ConditionsAddPicker-SsHJlc1E.js +54 -0
- package/dist/chunks/ConditionsInput-B_5Nge8o.js +474 -0
- package/dist/chunks/ContainerMainTab-kkktm1Ns.js +1107 -0
- package/dist/chunks/ContainerOverflowSectionPanel-ibKXf-1N.js +120 -0
- package/dist/chunks/ContainerOverflowSectionPopover-CRQ9EPsn.js +24 -0
- package/dist/chunks/ContainerPaddingOverlay-Cd3xOv-S.js +340 -0
- package/dist/chunks/ContainerScrollEffectSection-Dbztqdnr.js +123 -0
- package/dist/chunks/ContainerStateSection-DY_gjBJL.js +478 -0
- package/dist/chunks/ConversionFields-Bpfl-SGP.js +135 -0
- package/dist/chunks/CraftListEditor-_TIy1ogW.js +73 -0
- package/dist/chunks/CreateTokenDialog-DNWtWqJd.js +147 -0
- package/dist/chunks/Data.render-DTmaqSyz.js +10 -0
- package/dist/chunks/DataAttributesPanel-mYhisO_O.js +125 -0
- package/dist/chunks/DataMainTab-Batm515E.js +23 -0
- package/dist/chunks/DataSourceSectionSlot-BKoO6Vxn.js +10 -0
- package/dist/chunks/EditorEmptyLeafHintView-D3E3UN_0.js +78 -0
- package/dist/chunks/EffectRowInputPopover-CYhfjFwJ.js +323 -0
- package/dist/chunks/EffectsClassInput-Yujuchwy.js +315 -0
- package/dist/chunks/Embed.render-BgKpUV8n.js +17 -0
- package/dist/chunks/EmbedMainTab-d_-Bnkug.js +225 -0
- package/dist/chunks/FilterEditorPanel-CRa0IpLr.js +26 -0
- package/dist/chunks/FlexDirectionInput-C5gYjk5W.js +78 -0
- package/dist/chunks/FloatingPanel-DJP5Vhua.js +553 -0
- package/dist/chunks/FontFamilyInput-CVNnVylt.js +111 -0
- package/dist/chunks/Form.render-6GjcmL2u.js +54 -0
- package/dist/chunks/FormElement.render-DWrG-2ID.js +36 -0
- package/dist/chunks/FormElementMainTab-DSbF3F6e.js +470 -0
- package/dist/chunks/FormMainTab-SHny1HxF.js +240 -0
- package/dist/chunks/GradientInputPopover-1K6O9jBq.js +103 -0
- package/dist/chunks/GradientPanel-DSRQKkaB.js +194 -0
- package/dist/chunks/HTMLCodeInput-CCe4Bj5z.js +69 -0
- package/dist/chunks/HandlerEditorPanel-DiOXobsl.js +93 -0
- package/dist/chunks/HandlersAddPicker-DWTgjKgo.js +101 -0
- package/dist/chunks/HandlersInput-p49STTn8.js +132 -0
- package/dist/chunks/IconDialogInput-C-81_L2n.js +105 -0
- package/dist/chunks/IconInput-D2Gy7Hvf.js +182 -0
- package/dist/chunks/IconMainTab-CNrVjDWP.js +26 -0
- package/dist/chunks/IconPickerPanel-BjNOlCh6.js +670 -0
- package/dist/chunks/ImageMainTab-C4O7RjX0.js +66 -0
- package/dist/chunks/ImageSettingsPanel-dvOmGg3C.js +485 -0
- package/dist/chunks/LayoutPresetPanel-CNAVAcvw.js +81 -0
- package/dist/chunks/LayoutPresetSlot-BqMTdE33.js +16 -0
- package/dist/chunks/LinkMainTab-BfFZx0AU.js +13 -0
- package/dist/chunks/ListEditor-mD-CmRNE.js +178 -0
- package/dist/chunks/Map.render-DFkmncHz.js +82 -0
- package/dist/chunks/MapLeaflet-DOfmZ3Pk.js +6588 -0
- package/dist/chunks/MapMainTab-CxI7IS1_.js +165 -0
- package/dist/chunks/MapPoint.render-0OAfCZTp.js +16 -0
- package/dist/chunks/MapPointMainTab-CmLcaSR5.js +60 -0
- package/dist/chunks/MediaInput-DHs3D8TJ.js +672 -0
- package/dist/chunks/MediaManagerModal-Dc5PK3dn.js +240 -0
- package/dist/chunks/MiniPreviewTile-B4zxTj9Y.js +32 -0
- package/dist/chunks/ModifierChipList-CwsWklih.js +33 -0
- package/dist/chunks/ModifiersAddPicker-D-vSYw7O.js +74 -0
- package/dist/chunks/ModifiersPickerPanel-CTefidBx.js +243 -0
- package/dist/chunks/NodeAiContextInputPopover-D5bn5o_T.js +66 -0
- package/dist/chunks/NodeAiContextPanel-Bx4rcjiM.js +81 -0
- package/dist/chunks/NumberSettingsPanel-DASi_l6V.js +56 -0
- package/dist/chunks/PageSettingsModal-D6o450IR.js +2678 -0
- package/dist/chunks/PatternInputPopover-qMWBv_nl.js +100 -0
- package/dist/chunks/PatternPanel-D2fgWDd-.js +352 -0
- package/dist/chunks/PeekTargetButton-ClrJX7zh.js +26 -0
- package/dist/chunks/PermissionsSection-DwobrV40.js +82 -0
- package/dist/chunks/PresetAddChildList-D6a0xdt8.js +35 -0
- package/dist/chunks/PropertiesInput-9O39ngbb.js +125 -0
- package/dist/chunks/PropertiesPanel-DO0RlalO.js +76 -0
- package/dist/chunks/SaveModifierPanel-B6mjKyrT.js +130 -0
- package/dist/chunks/ScrollEffectEditorPanel-CllGUhui.js +26 -0
- package/dist/chunks/SearchInput-DRUztbM0.js +76 -0
- package/dist/chunks/SearchableMenuPopover-DZKVXiEl.js +1251 -0
- package/dist/chunks/SlotRenderer-CaLf_2_C.js +38 -0
- package/dist/chunks/StateBindingEditorPanel-DKdcG5py.js +101 -0
- package/dist/chunks/StateBindingsAddPicker-DxMNAWAD.js +91 -0
- package/dist/chunks/StateBindingsInput-iWiqvAVB.js +103 -0
- package/dist/chunks/TailwindInput-660FZtyK.js +24 -0
- package/dist/chunks/TextEditor-B2O7DlN8.js +22032 -0
- package/dist/chunks/TextMainTab-B5udsXsk.js +260 -0
- package/dist/chunks/TextStyleEditorPanel-GRNPGzUL.js +381 -0
- package/dist/chunks/TextStylePickerPanel-l108SmGQ.js +140 -0
- package/dist/chunks/TextareaSettingsPanel-C1rQuF1O.js +50 -0
- package/dist/chunks/TokenPicker-Q0LToF_p.js +291 -0
- package/dist/chunks/ToolbarDashedButton-DbUxGmDg.js +23 -0
- package/dist/chunks/TransformEditorPanel-BGwyznZ6.js +26 -0
- package/dist/chunks/TransitionEditorPanel-BSvk58Ow.js +26 -0
- package/dist/chunks/TypographyPresetInput-DqnGSgR2.js +296 -0
- package/dist/chunks/ValidationPanel-CmA9SfoF.js +56 -0
- package/dist/chunks/Video.render-Dg6xvis4.js +21 -0
- package/dist/chunks/VideoMainTab-v5UFhUm-.js +174 -0
- package/dist/chunks/YouTube.esm-EbHnLU1Z.js +744 -0
- package/dist/chunks/dialogAtoms-CeQ2G05l.js +59 -0
- package/dist/chunks/extends-hS2Bh-Yp.js +12 -0
- package/dist/chunks/formatStorage-C3o2s3dk.js +22 -0
- package/dist/chunks/googleFonts-Dj4AntNi.js +323 -0
- package/dist/chunks/helpers-Cll72tMn.js +18 -0
- package/dist/chunks/index-B-GJd039.js +2875 -0
- package/dist/chunks/index-C66dAl3Q.js +32177 -0
- package/dist/chunks/index.esm-mqFx3NOs.js +644 -0
- package/dist/chunks/popoverOpenRequestAtom-hBS_siXv.js +22 -0
- package/dist/chunks/propertyRegistry-CMhVNOgl.js +38 -0
- package/dist/chunks/resolveAnchorsViaCraft-Cixm6ZyJ.js +31 -0
- package/dist/chunks/toolboxUtils-DjTMslSn.js +370 -0
- package/dist/chunks/uiPrimitives-BtohldWg.js +15 -0
- package/dist/chunks/use-event-listener-DO3Sk7g0.js +15 -0
- package/dist/chunks/useElementPicker-DoNuXNMQ.js +41 -0
- package/dist/chunks/useLayoutPreset-wOMV5YnO.js +528 -0
- package/dist/chunks/useMediaManager-CmKDbFfw.js +4629 -0
- package/dist/chunks/usePopoverAutoOpen-CxIjt0ez.js +25 -0
- package/dist/chunks/usePopoverPosition-83Vti7Aw.js +15 -0
- package/dist/render/static/index.js +9 -0
- package/package.json +22 -13
- package/dist/pagehub-viewer.umd.cjs +0 -574
- package/dist/pagehub.umd.cjs +0 -1130
|
@@ -0,0 +1,2676 @@
|
|
|
1
|
+
import { _ as St } from "./extends-hS2Bh-Yp.js";
|
|
2
|
+
import h, { useState as de, useRef as pe, useEffect as ne, useMemo as ae, createContext as Kt, useContext as Yt, PureComponent as Ie, Component as De, isValidElement as qt, useId as Zt, useLayoutEffect as Jt, useCallback as Qt } from "react";
|
|
3
|
+
import { useEditor as er } from "@craftjs/core";
|
|
4
|
+
import { jsx as tr } from "react/jsx-runtime";
|
|
5
|
+
import rr from "react-dom";
|
|
6
|
+
import { a as nr } from "./FloatingPanel-DJP5Vhua.js";
|
|
7
|
+
import { cR as ar, cS as ir, cT as sr, cU as or, cV as ur, ct as lr, cW as fr, cX as cr } from "./index-C66dAl3Q.js";
|
|
8
|
+
function F(e) {
|
|
9
|
+
var t = typeof e;
|
|
10
|
+
return e != null && (t == "object" || t == "function");
|
|
11
|
+
}
|
|
12
|
+
var Et = typeof global == "object" && global && global.Object === Object && global, hr = typeof self == "object" && self && self.Object === Object && self, L = Et || hr || Function("return this")(), Se = function() {
|
|
13
|
+
return L.Date.now();
|
|
14
|
+
}, dr = /\s/;
|
|
15
|
+
function pr(e) {
|
|
16
|
+
for (var t = e.length; t-- && dr.test(e.charAt(t)); )
|
|
17
|
+
;
|
|
18
|
+
return t;
|
|
19
|
+
}
|
|
20
|
+
var gr = /^\s+/;
|
|
21
|
+
function br(e) {
|
|
22
|
+
return e && e.slice(0, pr(e) + 1).replace(gr, "");
|
|
23
|
+
}
|
|
24
|
+
var J = L.Symbol, At = Object.prototype, vr = At.hasOwnProperty, mr = At.toString, Q = J ? J.toStringTag : void 0;
|
|
25
|
+
function yr(e) {
|
|
26
|
+
var t = vr.call(e, Q), r = e[Q];
|
|
27
|
+
try {
|
|
28
|
+
e[Q] = void 0;
|
|
29
|
+
var n = !0;
|
|
30
|
+
} catch {
|
|
31
|
+
}
|
|
32
|
+
var i = mr.call(e);
|
|
33
|
+
return n && (t ? e[Q] = r : delete e[Q]), i;
|
|
34
|
+
}
|
|
35
|
+
var _r = Object.prototype, xr = _r.toString;
|
|
36
|
+
function wr(e) {
|
|
37
|
+
return xr.call(e);
|
|
38
|
+
}
|
|
39
|
+
var Sr = "[object Null]", Er = "[object Undefined]", We = J ? J.toStringTag : void 0;
|
|
40
|
+
function X(e) {
|
|
41
|
+
return e == null ? e === void 0 ? Er : Sr : We && We in Object(e) ? yr(e) : wr(e);
|
|
42
|
+
}
|
|
43
|
+
function V(e) {
|
|
44
|
+
return e != null && typeof e == "object";
|
|
45
|
+
}
|
|
46
|
+
var Ar = "[object Symbol]";
|
|
47
|
+
function Cr(e) {
|
|
48
|
+
return typeof e == "symbol" || V(e) && X(e) == Ar;
|
|
49
|
+
}
|
|
50
|
+
var Xe = NaN, Tr = /^[-+]0x[0-9a-f]+$/i, Mr = /^0b[01]+$/i, Or = /^0o[0-7]+$/i, $r = parseInt;
|
|
51
|
+
function Ke(e) {
|
|
52
|
+
if (typeof e == "number")
|
|
53
|
+
return e;
|
|
54
|
+
if (Cr(e))
|
|
55
|
+
return Xe;
|
|
56
|
+
if (F(e)) {
|
|
57
|
+
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
58
|
+
e = F(t) ? t + "" : t;
|
|
59
|
+
}
|
|
60
|
+
if (typeof e != "string")
|
|
61
|
+
return e === 0 ? e : +e;
|
|
62
|
+
e = br(e);
|
|
63
|
+
var r = Mr.test(e);
|
|
64
|
+
return r || Or.test(e) ? $r(e.slice(2), r ? 2 : 8) : Tr.test(e) ? Xe : +e;
|
|
65
|
+
}
|
|
66
|
+
var Rr = "Expected a function", Pr = Math.max, Lr = Math.min;
|
|
67
|
+
function Hr(e, t, r) {
|
|
68
|
+
var n, i, a, s, o, u, l = 0, c = !1, f = !1, g = !0;
|
|
69
|
+
if (typeof e != "function")
|
|
70
|
+
throw new TypeError(Rr);
|
|
71
|
+
t = Ke(t) || 0, F(r) && (c = !!r.leading, f = "maxWait" in r, a = f ? Pr(Ke(r.maxWait) || 0, t) : a, g = "trailing" in r ? !!r.trailing : g);
|
|
72
|
+
function p(y) {
|
|
73
|
+
var E = n, O = i;
|
|
74
|
+
return n = i = void 0, l = y, s = e.apply(O, E), s;
|
|
75
|
+
}
|
|
76
|
+
function b(y) {
|
|
77
|
+
return l = y, o = setTimeout(m, t), c ? p(y) : s;
|
|
78
|
+
}
|
|
79
|
+
function v(y) {
|
|
80
|
+
var E = y - u, O = y - l, M = t - E;
|
|
81
|
+
return f ? Lr(M, a - O) : M;
|
|
82
|
+
}
|
|
83
|
+
function S(y) {
|
|
84
|
+
var E = y - u, O = y - l;
|
|
85
|
+
return u === void 0 || E >= t || E < 0 || f && O >= a;
|
|
86
|
+
}
|
|
87
|
+
function m() {
|
|
88
|
+
var y = Se();
|
|
89
|
+
if (S(y))
|
|
90
|
+
return x(y);
|
|
91
|
+
o = setTimeout(m, v(y));
|
|
92
|
+
}
|
|
93
|
+
function x(y) {
|
|
94
|
+
return o = void 0, g && n ? p(y) : (n = i = void 0, s);
|
|
95
|
+
}
|
|
96
|
+
function T() {
|
|
97
|
+
o !== void 0 && clearTimeout(o), l = 0, n = u = i = o = void 0;
|
|
98
|
+
}
|
|
99
|
+
function H() {
|
|
100
|
+
return o === void 0 ? s : x(Se());
|
|
101
|
+
}
|
|
102
|
+
function A() {
|
|
103
|
+
var y = Se(), E = S(y);
|
|
104
|
+
if (n = arguments, i = this, u = y, E) {
|
|
105
|
+
if (o === void 0)
|
|
106
|
+
return b(u);
|
|
107
|
+
if (f)
|
|
108
|
+
return clearTimeout(o), o = setTimeout(m, t), p(u);
|
|
109
|
+
}
|
|
110
|
+
return o === void 0 && (o = setTimeout(m, t)), s;
|
|
111
|
+
}
|
|
112
|
+
return A.cancel = T, A.flush = H, A;
|
|
113
|
+
}
|
|
114
|
+
function Fr() {
|
|
115
|
+
this.__data__ = [], this.size = 0;
|
|
116
|
+
}
|
|
117
|
+
function ue(e, t) {
|
|
118
|
+
return e === t || e !== e && t !== t;
|
|
119
|
+
}
|
|
120
|
+
function _e(e, t) {
|
|
121
|
+
for (var r = e.length; r--; )
|
|
122
|
+
if (ue(e[r][0], t))
|
|
123
|
+
return r;
|
|
124
|
+
return -1;
|
|
125
|
+
}
|
|
126
|
+
var Ir = Array.prototype, Dr = Ir.splice;
|
|
127
|
+
function jr(e) {
|
|
128
|
+
var t = this.__data__, r = _e(t, e);
|
|
129
|
+
if (r < 0)
|
|
130
|
+
return !1;
|
|
131
|
+
var n = t.length - 1;
|
|
132
|
+
return r == n ? t.pop() : Dr.call(t, r, 1), --this.size, !0;
|
|
133
|
+
}
|
|
134
|
+
function kr(e) {
|
|
135
|
+
var t = this.__data__, r = _e(t, e);
|
|
136
|
+
return r < 0 ? void 0 : t[r][1];
|
|
137
|
+
}
|
|
138
|
+
function Nr(e) {
|
|
139
|
+
return _e(this.__data__, e) > -1;
|
|
140
|
+
}
|
|
141
|
+
function Ur(e, t) {
|
|
142
|
+
var r = this.__data__, n = _e(r, e);
|
|
143
|
+
return n < 0 ? (++this.size, r.push([e, t])) : r[n][1] = t, this;
|
|
144
|
+
}
|
|
145
|
+
function N(e) {
|
|
146
|
+
var t = -1, r = e == null ? 0 : e.length;
|
|
147
|
+
for (this.clear(); ++t < r; ) {
|
|
148
|
+
var n = e[t];
|
|
149
|
+
this.set(n[0], n[1]);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
N.prototype.clear = Fr;
|
|
153
|
+
N.prototype.delete = jr;
|
|
154
|
+
N.prototype.get = kr;
|
|
155
|
+
N.prototype.has = Nr;
|
|
156
|
+
N.prototype.set = Ur;
|
|
157
|
+
function Br() {
|
|
158
|
+
this.__data__ = new N(), this.size = 0;
|
|
159
|
+
}
|
|
160
|
+
function Vr(e) {
|
|
161
|
+
var t = this.__data__, r = t.delete(e);
|
|
162
|
+
return this.size = t.size, r;
|
|
163
|
+
}
|
|
164
|
+
function Gr(e) {
|
|
165
|
+
return this.__data__.get(e);
|
|
166
|
+
}
|
|
167
|
+
function zr(e) {
|
|
168
|
+
return this.__data__.has(e);
|
|
169
|
+
}
|
|
170
|
+
var Wr = "[object AsyncFunction]", Xr = "[object Function]", Kr = "[object GeneratorFunction]", Yr = "[object Proxy]";
|
|
171
|
+
function je(e) {
|
|
172
|
+
if (!F(e))
|
|
173
|
+
return !1;
|
|
174
|
+
var t = X(e);
|
|
175
|
+
return t == Xr || t == Kr || t == Wr || t == Yr;
|
|
176
|
+
}
|
|
177
|
+
var Ee = L["__core-js_shared__"], Ye = (function() {
|
|
178
|
+
var e = /[^.]+$/.exec(Ee && Ee.keys && Ee.keys.IE_PROTO || "");
|
|
179
|
+
return e ? "Symbol(src)_1." + e : "";
|
|
180
|
+
})();
|
|
181
|
+
function qr(e) {
|
|
182
|
+
return !!Ye && Ye in e;
|
|
183
|
+
}
|
|
184
|
+
var Zr = Function.prototype, Jr = Zr.toString;
|
|
185
|
+
function K(e) {
|
|
186
|
+
if (e != null) {
|
|
187
|
+
try {
|
|
188
|
+
return Jr.call(e);
|
|
189
|
+
} catch {
|
|
190
|
+
}
|
|
191
|
+
try {
|
|
192
|
+
return e + "";
|
|
193
|
+
} catch {
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return "";
|
|
197
|
+
}
|
|
198
|
+
var Qr = /[\\^$.*+?()[\]{}|]/g, en = /^\[object .+?Constructor\]$/, tn = Function.prototype, rn = Object.prototype, nn = tn.toString, an = rn.hasOwnProperty, sn = RegExp(
|
|
199
|
+
"^" + nn.call(an).replace(Qr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
200
|
+
);
|
|
201
|
+
function on(e) {
|
|
202
|
+
if (!F(e) || qr(e))
|
|
203
|
+
return !1;
|
|
204
|
+
var t = je(e) ? sn : en;
|
|
205
|
+
return t.test(K(e));
|
|
206
|
+
}
|
|
207
|
+
function un(e, t) {
|
|
208
|
+
return e == null ? void 0 : e[t];
|
|
209
|
+
}
|
|
210
|
+
function Y(e, t) {
|
|
211
|
+
var r = un(e, t);
|
|
212
|
+
return on(r) ? r : void 0;
|
|
213
|
+
}
|
|
214
|
+
var ie = Y(L, "Map"), se = Y(Object, "create");
|
|
215
|
+
function ln() {
|
|
216
|
+
this.__data__ = se ? se(null) : {}, this.size = 0;
|
|
217
|
+
}
|
|
218
|
+
function fn(e) {
|
|
219
|
+
var t = this.has(e) && delete this.__data__[e];
|
|
220
|
+
return this.size -= t ? 1 : 0, t;
|
|
221
|
+
}
|
|
222
|
+
var cn = "__lodash_hash_undefined__", hn = Object.prototype, dn = hn.hasOwnProperty;
|
|
223
|
+
function pn(e) {
|
|
224
|
+
var t = this.__data__;
|
|
225
|
+
if (se) {
|
|
226
|
+
var r = t[e];
|
|
227
|
+
return r === cn ? void 0 : r;
|
|
228
|
+
}
|
|
229
|
+
return dn.call(t, e) ? t[e] : void 0;
|
|
230
|
+
}
|
|
231
|
+
var gn = Object.prototype, bn = gn.hasOwnProperty;
|
|
232
|
+
function vn(e) {
|
|
233
|
+
var t = this.__data__;
|
|
234
|
+
return se ? t[e] !== void 0 : bn.call(t, e);
|
|
235
|
+
}
|
|
236
|
+
var mn = "__lodash_hash_undefined__";
|
|
237
|
+
function yn(e, t) {
|
|
238
|
+
var r = this.__data__;
|
|
239
|
+
return this.size += this.has(e) ? 0 : 1, r[e] = se && t === void 0 ? mn : t, this;
|
|
240
|
+
}
|
|
241
|
+
function z(e) {
|
|
242
|
+
var t = -1, r = e == null ? 0 : e.length;
|
|
243
|
+
for (this.clear(); ++t < r; ) {
|
|
244
|
+
var n = e[t];
|
|
245
|
+
this.set(n[0], n[1]);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
z.prototype.clear = ln;
|
|
249
|
+
z.prototype.delete = fn;
|
|
250
|
+
z.prototype.get = pn;
|
|
251
|
+
z.prototype.has = vn;
|
|
252
|
+
z.prototype.set = yn;
|
|
253
|
+
function _n() {
|
|
254
|
+
this.size = 0, this.__data__ = {
|
|
255
|
+
hash: new z(),
|
|
256
|
+
map: new (ie || N)(),
|
|
257
|
+
string: new z()
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function xn(e) {
|
|
261
|
+
var t = typeof e;
|
|
262
|
+
return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
|
|
263
|
+
}
|
|
264
|
+
function xe(e, t) {
|
|
265
|
+
var r = e.__data__;
|
|
266
|
+
return xn(t) ? r[typeof t == "string" ? "string" : "hash"] : r.map;
|
|
267
|
+
}
|
|
268
|
+
function wn(e) {
|
|
269
|
+
var t = xe(this, e).delete(e);
|
|
270
|
+
return this.size -= t ? 1 : 0, t;
|
|
271
|
+
}
|
|
272
|
+
function Sn(e) {
|
|
273
|
+
return xe(this, e).get(e);
|
|
274
|
+
}
|
|
275
|
+
function En(e) {
|
|
276
|
+
return xe(this, e).has(e);
|
|
277
|
+
}
|
|
278
|
+
function An(e, t) {
|
|
279
|
+
var r = xe(this, e), n = r.size;
|
|
280
|
+
return r.set(e, t), this.size += r.size == n ? 0 : 1, this;
|
|
281
|
+
}
|
|
282
|
+
function q(e) {
|
|
283
|
+
var t = -1, r = e == null ? 0 : e.length;
|
|
284
|
+
for (this.clear(); ++t < r; ) {
|
|
285
|
+
var n = e[t];
|
|
286
|
+
this.set(n[0], n[1]);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
q.prototype.clear = _n;
|
|
290
|
+
q.prototype.delete = wn;
|
|
291
|
+
q.prototype.get = Sn;
|
|
292
|
+
q.prototype.has = En;
|
|
293
|
+
q.prototype.set = An;
|
|
294
|
+
var Cn = 200;
|
|
295
|
+
function Tn(e, t) {
|
|
296
|
+
var r = this.__data__;
|
|
297
|
+
if (r instanceof N) {
|
|
298
|
+
var n = r.__data__;
|
|
299
|
+
if (!ie || n.length < Cn - 1)
|
|
300
|
+
return n.push([e, t]), this.size = ++r.size, this;
|
|
301
|
+
r = this.__data__ = new q(n);
|
|
302
|
+
}
|
|
303
|
+
return r.set(e, t), this.size = r.size, this;
|
|
304
|
+
}
|
|
305
|
+
function k(e) {
|
|
306
|
+
var t = this.__data__ = new N(e);
|
|
307
|
+
this.size = t.size;
|
|
308
|
+
}
|
|
309
|
+
k.prototype.clear = Br;
|
|
310
|
+
k.prototype.delete = Vr;
|
|
311
|
+
k.prototype.get = Gr;
|
|
312
|
+
k.prototype.has = zr;
|
|
313
|
+
k.prototype.set = Tn;
|
|
314
|
+
var Mn = "__lodash_hash_undefined__";
|
|
315
|
+
function On(e) {
|
|
316
|
+
return this.__data__.set(e, Mn), this;
|
|
317
|
+
}
|
|
318
|
+
function $n(e) {
|
|
319
|
+
return this.__data__.has(e);
|
|
320
|
+
}
|
|
321
|
+
function ge(e) {
|
|
322
|
+
var t = -1, r = e == null ? 0 : e.length;
|
|
323
|
+
for (this.__data__ = new q(); ++t < r; )
|
|
324
|
+
this.add(e[t]);
|
|
325
|
+
}
|
|
326
|
+
ge.prototype.add = ge.prototype.push = On;
|
|
327
|
+
ge.prototype.has = $n;
|
|
328
|
+
function Rn(e, t) {
|
|
329
|
+
for (var r = -1, n = e == null ? 0 : e.length; ++r < n; )
|
|
330
|
+
if (t(e[r], r, e))
|
|
331
|
+
return !0;
|
|
332
|
+
return !1;
|
|
333
|
+
}
|
|
334
|
+
function Pn(e, t) {
|
|
335
|
+
return e.has(t);
|
|
336
|
+
}
|
|
337
|
+
var Ln = 1, Hn = 2;
|
|
338
|
+
function Ct(e, t, r, n, i, a) {
|
|
339
|
+
var s = r & Ln, o = e.length, u = t.length;
|
|
340
|
+
if (o != u && !(s && u > o))
|
|
341
|
+
return !1;
|
|
342
|
+
var l = a.get(e), c = a.get(t);
|
|
343
|
+
if (l && c)
|
|
344
|
+
return l == t && c == e;
|
|
345
|
+
var f = -1, g = !0, p = r & Hn ? new ge() : void 0;
|
|
346
|
+
for (a.set(e, t), a.set(t, e); ++f < o; ) {
|
|
347
|
+
var b = e[f], v = t[f];
|
|
348
|
+
if (n)
|
|
349
|
+
var S = s ? n(v, b, f, t, e, a) : n(b, v, f, e, t, a);
|
|
350
|
+
if (S !== void 0) {
|
|
351
|
+
if (S)
|
|
352
|
+
continue;
|
|
353
|
+
g = !1;
|
|
354
|
+
break;
|
|
355
|
+
}
|
|
356
|
+
if (p) {
|
|
357
|
+
if (!Rn(t, function(m, x) {
|
|
358
|
+
if (!Pn(p, x) && (b === m || i(b, m, r, n, a)))
|
|
359
|
+
return p.push(x);
|
|
360
|
+
})) {
|
|
361
|
+
g = !1;
|
|
362
|
+
break;
|
|
363
|
+
}
|
|
364
|
+
} else if (!(b === v || i(b, v, r, n, a))) {
|
|
365
|
+
g = !1;
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
return a.delete(e), a.delete(t), g;
|
|
370
|
+
}
|
|
371
|
+
var be = L.Uint8Array;
|
|
372
|
+
function Fn(e) {
|
|
373
|
+
var t = -1, r = Array(e.size);
|
|
374
|
+
return e.forEach(function(n, i) {
|
|
375
|
+
r[++t] = [i, n];
|
|
376
|
+
}), r;
|
|
377
|
+
}
|
|
378
|
+
function In(e) {
|
|
379
|
+
var t = -1, r = Array(e.size);
|
|
380
|
+
return e.forEach(function(n) {
|
|
381
|
+
r[++t] = n;
|
|
382
|
+
}), r;
|
|
383
|
+
}
|
|
384
|
+
var Dn = 1, jn = 2, kn = "[object Boolean]", Nn = "[object Date]", Un = "[object Error]", Bn = "[object Map]", Vn = "[object Number]", Gn = "[object RegExp]", zn = "[object Set]", Wn = "[object String]", Xn = "[object Symbol]", Kn = "[object ArrayBuffer]", Yn = "[object DataView]", qe = J ? J.prototype : void 0, Ae = qe ? qe.valueOf : void 0;
|
|
385
|
+
function qn(e, t, r, n, i, a, s) {
|
|
386
|
+
switch (r) {
|
|
387
|
+
case Yn:
|
|
388
|
+
if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset)
|
|
389
|
+
return !1;
|
|
390
|
+
e = e.buffer, t = t.buffer;
|
|
391
|
+
case Kn:
|
|
392
|
+
return !(e.byteLength != t.byteLength || !a(new be(e), new be(t)));
|
|
393
|
+
case kn:
|
|
394
|
+
case Nn:
|
|
395
|
+
case Vn:
|
|
396
|
+
return ue(+e, +t);
|
|
397
|
+
case Un:
|
|
398
|
+
return e.name == t.name && e.message == t.message;
|
|
399
|
+
case Gn:
|
|
400
|
+
case Wn:
|
|
401
|
+
return e == t + "";
|
|
402
|
+
case Bn:
|
|
403
|
+
var o = Fn;
|
|
404
|
+
case zn:
|
|
405
|
+
var u = n & Dn;
|
|
406
|
+
if (o || (o = In), e.size != t.size && !u)
|
|
407
|
+
return !1;
|
|
408
|
+
var l = s.get(e);
|
|
409
|
+
if (l)
|
|
410
|
+
return l == t;
|
|
411
|
+
n |= jn, s.set(e, t);
|
|
412
|
+
var c = Ct(o(e), o(t), n, i, a, s);
|
|
413
|
+
return s.delete(e), c;
|
|
414
|
+
case Xn:
|
|
415
|
+
if (Ae)
|
|
416
|
+
return Ae.call(e) == Ae.call(t);
|
|
417
|
+
}
|
|
418
|
+
return !1;
|
|
419
|
+
}
|
|
420
|
+
function Zn(e, t) {
|
|
421
|
+
for (var r = -1, n = t.length, i = e.length; ++r < n; )
|
|
422
|
+
e[i + r] = t[r];
|
|
423
|
+
return e;
|
|
424
|
+
}
|
|
425
|
+
var W = Array.isArray;
|
|
426
|
+
function Jn(e, t, r) {
|
|
427
|
+
var n = t(e);
|
|
428
|
+
return W(e) ? n : Zn(n, r(e));
|
|
429
|
+
}
|
|
430
|
+
function Qn(e, t) {
|
|
431
|
+
for (var r = -1, n = e == null ? 0 : e.length, i = 0, a = []; ++r < n; ) {
|
|
432
|
+
var s = e[r];
|
|
433
|
+
t(s, r, e) && (a[i++] = s);
|
|
434
|
+
}
|
|
435
|
+
return a;
|
|
436
|
+
}
|
|
437
|
+
function ea() {
|
|
438
|
+
return [];
|
|
439
|
+
}
|
|
440
|
+
var ta = Object.prototype, ra = ta.propertyIsEnumerable, Ze = Object.getOwnPropertySymbols, na = Ze ? function(e) {
|
|
441
|
+
return e == null ? [] : (e = Object(e), Qn(Ze(e), function(t) {
|
|
442
|
+
return ra.call(e, t);
|
|
443
|
+
}));
|
|
444
|
+
} : ea;
|
|
445
|
+
function aa(e, t) {
|
|
446
|
+
for (var r = -1, n = Array(e); ++r < e; )
|
|
447
|
+
n[r] = t(r);
|
|
448
|
+
return n;
|
|
449
|
+
}
|
|
450
|
+
var ia = "[object Arguments]";
|
|
451
|
+
function Je(e) {
|
|
452
|
+
return V(e) && X(e) == ia;
|
|
453
|
+
}
|
|
454
|
+
var Tt = Object.prototype, sa = Tt.hasOwnProperty, oa = Tt.propertyIsEnumerable, Me = Je(/* @__PURE__ */ (function() {
|
|
455
|
+
return arguments;
|
|
456
|
+
})()) ? Je : function(e) {
|
|
457
|
+
return V(e) && sa.call(e, "callee") && !oa.call(e, "callee");
|
|
458
|
+
};
|
|
459
|
+
function ua() {
|
|
460
|
+
return !1;
|
|
461
|
+
}
|
|
462
|
+
var Mt = typeof exports == "object" && exports && !exports.nodeType && exports, Qe = Mt && typeof module == "object" && module && !module.nodeType && module, la = Qe && Qe.exports === Mt, et = la ? L.Buffer : void 0, fa = et ? et.isBuffer : void 0, ve = fa || ua, ca = 9007199254740991, ha = /^(?:0|[1-9]\d*)$/;
|
|
463
|
+
function Ot(e, t) {
|
|
464
|
+
var r = typeof e;
|
|
465
|
+
return t = t ?? ca, !!t && (r == "number" || r != "symbol" && ha.test(e)) && e > -1 && e % 1 == 0 && e < t;
|
|
466
|
+
}
|
|
467
|
+
var da = 9007199254740991;
|
|
468
|
+
function $t(e) {
|
|
469
|
+
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= da;
|
|
470
|
+
}
|
|
471
|
+
var pa = "[object Arguments]", ga = "[object Array]", ba = "[object Boolean]", va = "[object Date]", ma = "[object Error]", ya = "[object Function]", _a = "[object Map]", xa = "[object Number]", wa = "[object Object]", Sa = "[object RegExp]", Ea = "[object Set]", Aa = "[object String]", Ca = "[object WeakMap]", Ta = "[object ArrayBuffer]", Ma = "[object DataView]", Oa = "[object Float32Array]", $a = "[object Float64Array]", Ra = "[object Int8Array]", Pa = "[object Int16Array]", La = "[object Int32Array]", Ha = "[object Uint8Array]", Fa = "[object Uint8ClampedArray]", Ia = "[object Uint16Array]", Da = "[object Uint32Array]", _ = {};
|
|
472
|
+
_[Oa] = _[$a] = _[Ra] = _[Pa] = _[La] = _[Ha] = _[Fa] = _[Ia] = _[Da] = !0;
|
|
473
|
+
_[pa] = _[ga] = _[Ta] = _[ba] = _[Ma] = _[va] = _[ma] = _[ya] = _[_a] = _[xa] = _[wa] = _[Sa] = _[Ea] = _[Aa] = _[Ca] = !1;
|
|
474
|
+
function ja(e) {
|
|
475
|
+
return V(e) && $t(e.length) && !!_[X(e)];
|
|
476
|
+
}
|
|
477
|
+
function ka(e) {
|
|
478
|
+
return function(t) {
|
|
479
|
+
return e(t);
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
var Rt = typeof exports == "object" && exports && !exports.nodeType && exports, re = Rt && typeof module == "object" && module && !module.nodeType && module, Na = re && re.exports === Rt, Ce = Na && Et.process, tt = (function() {
|
|
483
|
+
try {
|
|
484
|
+
var e = re && re.require && re.require("util").types;
|
|
485
|
+
return e || Ce && Ce.binding && Ce.binding("util");
|
|
486
|
+
} catch {
|
|
487
|
+
}
|
|
488
|
+
})(), rt = tt && tt.isTypedArray, ke = rt ? ka(rt) : ja, Ua = Object.prototype, Ba = Ua.hasOwnProperty;
|
|
489
|
+
function Pt(e, t) {
|
|
490
|
+
var r = W(e), n = !r && Me(e), i = !r && !n && ve(e), a = !r && !n && !i && ke(e), s = r || n || i || a, o = s ? aa(e.length, String) : [], u = o.length;
|
|
491
|
+
for (var l in e)
|
|
492
|
+
(t || Ba.call(e, l)) && !(s && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
493
|
+
(l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
494
|
+
i && (l == "offset" || l == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
495
|
+
a && (l == "buffer" || l == "byteLength" || l == "byteOffset") || // Skip index properties.
|
|
496
|
+
Ot(l, u))) && o.push(l);
|
|
497
|
+
return o;
|
|
498
|
+
}
|
|
499
|
+
var Va = Object.prototype;
|
|
500
|
+
function Ne(e) {
|
|
501
|
+
var t = e && e.constructor, r = typeof t == "function" && t.prototype || Va;
|
|
502
|
+
return e === r;
|
|
503
|
+
}
|
|
504
|
+
function Lt(e, t) {
|
|
505
|
+
return function(r) {
|
|
506
|
+
return e(t(r));
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
var Ga = Lt(Object.keys, Object), za = Object.prototype, Wa = za.hasOwnProperty;
|
|
510
|
+
function Xa(e) {
|
|
511
|
+
if (!Ne(e))
|
|
512
|
+
return Ga(e);
|
|
513
|
+
var t = [];
|
|
514
|
+
for (var r in Object(e))
|
|
515
|
+
Wa.call(e, r) && r != "constructor" && t.push(r);
|
|
516
|
+
return t;
|
|
517
|
+
}
|
|
518
|
+
function le(e) {
|
|
519
|
+
return e != null && $t(e.length) && !je(e);
|
|
520
|
+
}
|
|
521
|
+
function Ht(e) {
|
|
522
|
+
return le(e) ? Pt(e) : Xa(e);
|
|
523
|
+
}
|
|
524
|
+
function nt(e) {
|
|
525
|
+
return Jn(e, Ht, na);
|
|
526
|
+
}
|
|
527
|
+
var Ka = 1, Ya = Object.prototype, qa = Ya.hasOwnProperty;
|
|
528
|
+
function Za(e, t, r, n, i, a) {
|
|
529
|
+
var s = r & Ka, o = nt(e), u = o.length, l = nt(t), c = l.length;
|
|
530
|
+
if (u != c && !s)
|
|
531
|
+
return !1;
|
|
532
|
+
for (var f = u; f--; ) {
|
|
533
|
+
var g = o[f];
|
|
534
|
+
if (!(s ? g in t : qa.call(t, g)))
|
|
535
|
+
return !1;
|
|
536
|
+
}
|
|
537
|
+
var p = a.get(e), b = a.get(t);
|
|
538
|
+
if (p && b)
|
|
539
|
+
return p == t && b == e;
|
|
540
|
+
var v = !0;
|
|
541
|
+
a.set(e, t), a.set(t, e);
|
|
542
|
+
for (var S = s; ++f < u; ) {
|
|
543
|
+
g = o[f];
|
|
544
|
+
var m = e[g], x = t[g];
|
|
545
|
+
if (n)
|
|
546
|
+
var T = s ? n(x, m, g, t, e, a) : n(m, x, g, e, t, a);
|
|
547
|
+
if (!(T === void 0 ? m === x || i(m, x, r, n, a) : T)) {
|
|
548
|
+
v = !1;
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
S || (S = g == "constructor");
|
|
552
|
+
}
|
|
553
|
+
if (v && !S) {
|
|
554
|
+
var H = e.constructor, A = t.constructor;
|
|
555
|
+
H != A && "constructor" in e && "constructor" in t && !(typeof H == "function" && H instanceof H && typeof A == "function" && A instanceof A) && (v = !1);
|
|
556
|
+
}
|
|
557
|
+
return a.delete(e), a.delete(t), v;
|
|
558
|
+
}
|
|
559
|
+
var Oe = Y(L, "DataView"), $e = Y(L, "Promise"), Re = Y(L, "Set"), Pe = Y(L, "WeakMap"), at = "[object Map]", Ja = "[object Object]", it = "[object Promise]", st = "[object Set]", ot = "[object WeakMap]", ut = "[object DataView]", Qa = K(Oe), ei = K(ie), ti = K($e), ri = K(Re), ni = K(Pe), B = X;
|
|
560
|
+
(Oe && B(new Oe(new ArrayBuffer(1))) != ut || ie && B(new ie()) != at || $e && B($e.resolve()) != it || Re && B(new Re()) != st || Pe && B(new Pe()) != ot) && (B = function(e) {
|
|
561
|
+
var t = X(e), r = t == Ja ? e.constructor : void 0, n = r ? K(r) : "";
|
|
562
|
+
if (n)
|
|
563
|
+
switch (n) {
|
|
564
|
+
case Qa:
|
|
565
|
+
return ut;
|
|
566
|
+
case ei:
|
|
567
|
+
return at;
|
|
568
|
+
case ti:
|
|
569
|
+
return it;
|
|
570
|
+
case ri:
|
|
571
|
+
return st;
|
|
572
|
+
case ni:
|
|
573
|
+
return ot;
|
|
574
|
+
}
|
|
575
|
+
return t;
|
|
576
|
+
});
|
|
577
|
+
var ai = 1, lt = "[object Arguments]", ft = "[object Array]", ce = "[object Object]", ii = Object.prototype, ct = ii.hasOwnProperty;
|
|
578
|
+
function si(e, t, r, n, i, a) {
|
|
579
|
+
var s = W(e), o = W(t), u = s ? ft : B(e), l = o ? ft : B(t);
|
|
580
|
+
u = u == lt ? ce : u, l = l == lt ? ce : l;
|
|
581
|
+
var c = u == ce, f = l == ce, g = u == l;
|
|
582
|
+
if (g && ve(e)) {
|
|
583
|
+
if (!ve(t))
|
|
584
|
+
return !1;
|
|
585
|
+
s = !0, c = !1;
|
|
586
|
+
}
|
|
587
|
+
if (g && !c)
|
|
588
|
+
return a || (a = new k()), s || ke(e) ? Ct(e, t, r, n, i, a) : qn(e, t, u, r, n, i, a);
|
|
589
|
+
if (!(r & ai)) {
|
|
590
|
+
var p = c && ct.call(e, "__wrapped__"), b = f && ct.call(t, "__wrapped__");
|
|
591
|
+
if (p || b) {
|
|
592
|
+
var v = p ? e.value() : e, S = b ? t.value() : t;
|
|
593
|
+
return a || (a = new k()), i(v, S, r, n, a);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
return g ? (a || (a = new k()), Za(e, t, r, n, i, a)) : !1;
|
|
597
|
+
}
|
|
598
|
+
function Ft(e, t, r, n, i) {
|
|
599
|
+
return e === t ? !0 : e == null || t == null || !V(e) && !V(t) ? e !== e && t !== t : si(e, t, r, n, Ft, i);
|
|
600
|
+
}
|
|
601
|
+
function oi(e, t) {
|
|
602
|
+
return Ft(e, t);
|
|
603
|
+
}
|
|
604
|
+
function ui(e, t) {
|
|
605
|
+
for (var r = -1, n = e == null ? 0 : e.length; ++r < n && t(e[r], r, e) !== !1; )
|
|
606
|
+
;
|
|
607
|
+
return e;
|
|
608
|
+
}
|
|
609
|
+
function li(e) {
|
|
610
|
+
return function(t, r, n) {
|
|
611
|
+
for (var i = -1, a = Object(t), s = n(t), o = s.length; o--; ) {
|
|
612
|
+
var u = s[++i];
|
|
613
|
+
if (r(a[u], u, a) === !1)
|
|
614
|
+
break;
|
|
615
|
+
}
|
|
616
|
+
return t;
|
|
617
|
+
};
|
|
618
|
+
}
|
|
619
|
+
var It = li();
|
|
620
|
+
function fi(e, t) {
|
|
621
|
+
return e && It(e, t, Ht);
|
|
622
|
+
}
|
|
623
|
+
function ci(e, t) {
|
|
624
|
+
return function(r, n) {
|
|
625
|
+
if (r == null)
|
|
626
|
+
return r;
|
|
627
|
+
if (!le(r))
|
|
628
|
+
return e(r, n);
|
|
629
|
+
for (var i = r.length, a = -1, s = Object(r); ++a < i && n(s[a], a, s) !== !1; )
|
|
630
|
+
;
|
|
631
|
+
return r;
|
|
632
|
+
};
|
|
633
|
+
}
|
|
634
|
+
var hi = ci(fi);
|
|
635
|
+
function Ue(e) {
|
|
636
|
+
return e;
|
|
637
|
+
}
|
|
638
|
+
function di(e) {
|
|
639
|
+
return typeof e == "function" ? e : Ue;
|
|
640
|
+
}
|
|
641
|
+
function pi(e, t) {
|
|
642
|
+
var r = W(e) ? ui : hi;
|
|
643
|
+
return r(e, di(t));
|
|
644
|
+
}
|
|
645
|
+
function me(e) {
|
|
646
|
+
"@babel/helpers - typeof";
|
|
647
|
+
return me = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
648
|
+
return typeof t;
|
|
649
|
+
} : function(t) {
|
|
650
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
651
|
+
}, me(e);
|
|
652
|
+
}
|
|
653
|
+
var gi = /^\s+/, bi = /\s+$/;
|
|
654
|
+
function d(e, t) {
|
|
655
|
+
if (e = e || "", t = t || {}, e instanceof d)
|
|
656
|
+
return e;
|
|
657
|
+
if (!(this instanceof d))
|
|
658
|
+
return new d(e, t);
|
|
659
|
+
var r = vi(e);
|
|
660
|
+
this._originalInput = e, this._r = r.r, this._g = r.g, this._b = r.b, this._a = r.a, this._roundA = Math.round(100 * this._a) / 100, this._format = t.format || r.format, this._gradientType = t.gradientType, this._r < 1 && (this._r = Math.round(this._r)), this._g < 1 && (this._g = Math.round(this._g)), this._b < 1 && (this._b = Math.round(this._b)), this._ok = r.ok;
|
|
661
|
+
}
|
|
662
|
+
d.prototype = {
|
|
663
|
+
isDark: function() {
|
|
664
|
+
return this.getBrightness() < 128;
|
|
665
|
+
},
|
|
666
|
+
isLight: function() {
|
|
667
|
+
return !this.isDark();
|
|
668
|
+
},
|
|
669
|
+
isValid: function() {
|
|
670
|
+
return this._ok;
|
|
671
|
+
},
|
|
672
|
+
getOriginalInput: function() {
|
|
673
|
+
return this._originalInput;
|
|
674
|
+
},
|
|
675
|
+
getFormat: function() {
|
|
676
|
+
return this._format;
|
|
677
|
+
},
|
|
678
|
+
getAlpha: function() {
|
|
679
|
+
return this._a;
|
|
680
|
+
},
|
|
681
|
+
getBrightness: function() {
|
|
682
|
+
var t = this.toRgb();
|
|
683
|
+
return (t.r * 299 + t.g * 587 + t.b * 114) / 1e3;
|
|
684
|
+
},
|
|
685
|
+
getLuminance: function() {
|
|
686
|
+
var t = this.toRgb(), r, n, i, a, s, o;
|
|
687
|
+
return r = t.r / 255, n = t.g / 255, i = t.b / 255, r <= 0.03928 ? a = r / 12.92 : a = Math.pow((r + 0.055) / 1.055, 2.4), n <= 0.03928 ? s = n / 12.92 : s = Math.pow((n + 0.055) / 1.055, 2.4), i <= 0.03928 ? o = i / 12.92 : o = Math.pow((i + 0.055) / 1.055, 2.4), 0.2126 * a + 0.7152 * s + 0.0722 * o;
|
|
688
|
+
},
|
|
689
|
+
setAlpha: function(t) {
|
|
690
|
+
return this._a = Dt(t), this._roundA = Math.round(100 * this._a) / 100, this;
|
|
691
|
+
},
|
|
692
|
+
toHsv: function() {
|
|
693
|
+
var t = dt(this._r, this._g, this._b);
|
|
694
|
+
return {
|
|
695
|
+
h: t.h * 360,
|
|
696
|
+
s: t.s,
|
|
697
|
+
v: t.v,
|
|
698
|
+
a: this._a
|
|
699
|
+
};
|
|
700
|
+
},
|
|
701
|
+
toHsvString: function() {
|
|
702
|
+
var t = dt(this._r, this._g, this._b), r = Math.round(t.h * 360), n = Math.round(t.s * 100), i = Math.round(t.v * 100);
|
|
703
|
+
return this._a == 1 ? "hsv(" + r + ", " + n + "%, " + i + "%)" : "hsva(" + r + ", " + n + "%, " + i + "%, " + this._roundA + ")";
|
|
704
|
+
},
|
|
705
|
+
toHsl: function() {
|
|
706
|
+
var t = ht(this._r, this._g, this._b);
|
|
707
|
+
return {
|
|
708
|
+
h: t.h * 360,
|
|
709
|
+
s: t.s,
|
|
710
|
+
l: t.l,
|
|
711
|
+
a: this._a
|
|
712
|
+
};
|
|
713
|
+
},
|
|
714
|
+
toHslString: function() {
|
|
715
|
+
var t = ht(this._r, this._g, this._b), r = Math.round(t.h * 360), n = Math.round(t.s * 100), i = Math.round(t.l * 100);
|
|
716
|
+
return this._a == 1 ? "hsl(" + r + ", " + n + "%, " + i + "%)" : "hsla(" + r + ", " + n + "%, " + i + "%, " + this._roundA + ")";
|
|
717
|
+
},
|
|
718
|
+
toHex: function(t) {
|
|
719
|
+
return pt(this._r, this._g, this._b, t);
|
|
720
|
+
},
|
|
721
|
+
toHexString: function(t) {
|
|
722
|
+
return "#" + this.toHex(t);
|
|
723
|
+
},
|
|
724
|
+
toHex8: function(t) {
|
|
725
|
+
return xi(this._r, this._g, this._b, this._a, t);
|
|
726
|
+
},
|
|
727
|
+
toHex8String: function(t) {
|
|
728
|
+
return "#" + this.toHex8(t);
|
|
729
|
+
},
|
|
730
|
+
toRgb: function() {
|
|
731
|
+
return {
|
|
732
|
+
r: Math.round(this._r),
|
|
733
|
+
g: Math.round(this._g),
|
|
734
|
+
b: Math.round(this._b),
|
|
735
|
+
a: this._a
|
|
736
|
+
};
|
|
737
|
+
},
|
|
738
|
+
toRgbString: function() {
|
|
739
|
+
return this._a == 1 ? "rgb(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ")" : "rgba(" + Math.round(this._r) + ", " + Math.round(this._g) + ", " + Math.round(this._b) + ", " + this._roundA + ")";
|
|
740
|
+
},
|
|
741
|
+
toPercentageRgb: function() {
|
|
742
|
+
return {
|
|
743
|
+
r: Math.round(w(this._r, 255) * 100) + "%",
|
|
744
|
+
g: Math.round(w(this._g, 255) * 100) + "%",
|
|
745
|
+
b: Math.round(w(this._b, 255) * 100) + "%",
|
|
746
|
+
a: this._a
|
|
747
|
+
};
|
|
748
|
+
},
|
|
749
|
+
toPercentageRgbString: function() {
|
|
750
|
+
return this._a == 1 ? "rgb(" + Math.round(w(this._r, 255) * 100) + "%, " + Math.round(w(this._g, 255) * 100) + "%, " + Math.round(w(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(w(this._r, 255) * 100) + "%, " + Math.round(w(this._g, 255) * 100) + "%, " + Math.round(w(this._b, 255) * 100) + "%, " + this._roundA + ")";
|
|
751
|
+
},
|
|
752
|
+
toName: function() {
|
|
753
|
+
return this._a === 0 ? "transparent" : this._a < 1 ? !1 : Li[pt(this._r, this._g, this._b, !0)] || !1;
|
|
754
|
+
},
|
|
755
|
+
toFilter: function(t) {
|
|
756
|
+
var r = "#" + gt(this._r, this._g, this._b, this._a), n = r, i = this._gradientType ? "GradientType = 1, " : "";
|
|
757
|
+
if (t) {
|
|
758
|
+
var a = d(t);
|
|
759
|
+
n = "#" + gt(a._r, a._g, a._b, a._a);
|
|
760
|
+
}
|
|
761
|
+
return "progid:DXImageTransform.Microsoft.gradient(" + i + "startColorstr=" + r + ",endColorstr=" + n + ")";
|
|
762
|
+
},
|
|
763
|
+
toString: function(t) {
|
|
764
|
+
var r = !!t;
|
|
765
|
+
t = t || this._format;
|
|
766
|
+
var n = !1, i = this._a < 1 && this._a >= 0, a = !r && i && (t === "hex" || t === "hex6" || t === "hex3" || t === "hex4" || t === "hex8" || t === "name");
|
|
767
|
+
return a ? t === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (t === "rgb" && (n = this.toRgbString()), t === "prgb" && (n = this.toPercentageRgbString()), (t === "hex" || t === "hex6") && (n = this.toHexString()), t === "hex3" && (n = this.toHexString(!0)), t === "hex4" && (n = this.toHex8String(!0)), t === "hex8" && (n = this.toHex8String()), t === "name" && (n = this.toName()), t === "hsl" && (n = this.toHslString()), t === "hsv" && (n = this.toHsvString()), n || this.toHexString());
|
|
768
|
+
},
|
|
769
|
+
clone: function() {
|
|
770
|
+
return d(this.toString());
|
|
771
|
+
},
|
|
772
|
+
_applyModification: function(t, r) {
|
|
773
|
+
var n = t.apply(null, [this].concat([].slice.call(r)));
|
|
774
|
+
return this._r = n._r, this._g = n._g, this._b = n._b, this.setAlpha(n._a), this;
|
|
775
|
+
},
|
|
776
|
+
lighten: function() {
|
|
777
|
+
return this._applyModification(Ai, arguments);
|
|
778
|
+
},
|
|
779
|
+
brighten: function() {
|
|
780
|
+
return this._applyModification(Ci, arguments);
|
|
781
|
+
},
|
|
782
|
+
darken: function() {
|
|
783
|
+
return this._applyModification(Ti, arguments);
|
|
784
|
+
},
|
|
785
|
+
desaturate: function() {
|
|
786
|
+
return this._applyModification(wi, arguments);
|
|
787
|
+
},
|
|
788
|
+
saturate: function() {
|
|
789
|
+
return this._applyModification(Si, arguments);
|
|
790
|
+
},
|
|
791
|
+
greyscale: function() {
|
|
792
|
+
return this._applyModification(Ei, arguments);
|
|
793
|
+
},
|
|
794
|
+
spin: function() {
|
|
795
|
+
return this._applyModification(Mi, arguments);
|
|
796
|
+
},
|
|
797
|
+
_applyCombination: function(t, r) {
|
|
798
|
+
return t.apply(null, [this].concat([].slice.call(r)));
|
|
799
|
+
},
|
|
800
|
+
analogous: function() {
|
|
801
|
+
return this._applyCombination(Ri, arguments);
|
|
802
|
+
},
|
|
803
|
+
complement: function() {
|
|
804
|
+
return this._applyCombination(Oi, arguments);
|
|
805
|
+
},
|
|
806
|
+
monochromatic: function() {
|
|
807
|
+
return this._applyCombination(Pi, arguments);
|
|
808
|
+
},
|
|
809
|
+
splitcomplement: function() {
|
|
810
|
+
return this._applyCombination($i, arguments);
|
|
811
|
+
},
|
|
812
|
+
// Disabled until https://github.com/bgrins/TinyColor/issues/254
|
|
813
|
+
// polyad: function (number) {
|
|
814
|
+
// return this._applyCombination(polyad, [number]);
|
|
815
|
+
// },
|
|
816
|
+
triad: function() {
|
|
817
|
+
return this._applyCombination(bt, [3]);
|
|
818
|
+
},
|
|
819
|
+
tetrad: function() {
|
|
820
|
+
return this._applyCombination(bt, [4]);
|
|
821
|
+
}
|
|
822
|
+
};
|
|
823
|
+
d.fromRatio = function(e, t) {
|
|
824
|
+
if (me(e) == "object") {
|
|
825
|
+
var r = {};
|
|
826
|
+
for (var n in e)
|
|
827
|
+
e.hasOwnProperty(n) && (n === "a" ? r[n] = e[n] : r[n] = te(e[n]));
|
|
828
|
+
e = r;
|
|
829
|
+
}
|
|
830
|
+
return d(e, t);
|
|
831
|
+
};
|
|
832
|
+
function vi(e) {
|
|
833
|
+
var t = {
|
|
834
|
+
r: 0,
|
|
835
|
+
g: 0,
|
|
836
|
+
b: 0
|
|
837
|
+
}, r = 1, n = null, i = null, a = null, s = !1, o = !1;
|
|
838
|
+
return typeof e == "string" && (e = Di(e)), me(e) == "object" && (j(e.r) && j(e.g) && j(e.b) ? (t = mi(e.r, e.g, e.b), s = !0, o = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : j(e.h) && j(e.s) && j(e.v) ? (n = te(e.s), i = te(e.v), t = _i(e.h, n, i), s = !0, o = "hsv") : j(e.h) && j(e.s) && j(e.l) && (n = te(e.s), a = te(e.l), t = yi(e.h, n, a), s = !0, o = "hsl"), e.hasOwnProperty("a") && (r = e.a)), r = Dt(r), {
|
|
839
|
+
ok: s,
|
|
840
|
+
format: e.format || o,
|
|
841
|
+
r: Math.min(255, Math.max(t.r, 0)),
|
|
842
|
+
g: Math.min(255, Math.max(t.g, 0)),
|
|
843
|
+
b: Math.min(255, Math.max(t.b, 0)),
|
|
844
|
+
a: r
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
function mi(e, t, r) {
|
|
848
|
+
return {
|
|
849
|
+
r: w(e, 255) * 255,
|
|
850
|
+
g: w(t, 255) * 255,
|
|
851
|
+
b: w(r, 255) * 255
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
function ht(e, t, r) {
|
|
855
|
+
e = w(e, 255), t = w(t, 255), r = w(r, 255);
|
|
856
|
+
var n = Math.max(e, t, r), i = Math.min(e, t, r), a, s, o = (n + i) / 2;
|
|
857
|
+
if (n == i)
|
|
858
|
+
a = s = 0;
|
|
859
|
+
else {
|
|
860
|
+
var u = n - i;
|
|
861
|
+
switch (s = o > 0.5 ? u / (2 - n - i) : u / (n + i), n) {
|
|
862
|
+
case e:
|
|
863
|
+
a = (t - r) / u + (t < r ? 6 : 0);
|
|
864
|
+
break;
|
|
865
|
+
case t:
|
|
866
|
+
a = (r - e) / u + 2;
|
|
867
|
+
break;
|
|
868
|
+
case r:
|
|
869
|
+
a = (e - t) / u + 4;
|
|
870
|
+
break;
|
|
871
|
+
}
|
|
872
|
+
a /= 6;
|
|
873
|
+
}
|
|
874
|
+
return {
|
|
875
|
+
h: a,
|
|
876
|
+
s,
|
|
877
|
+
l: o
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
function yi(e, t, r) {
|
|
881
|
+
var n, i, a;
|
|
882
|
+
e = w(e, 360), t = w(t, 100), r = w(r, 100);
|
|
883
|
+
function s(l, c, f) {
|
|
884
|
+
return f < 0 && (f += 1), f > 1 && (f -= 1), f < 1 / 6 ? l + (c - l) * 6 * f : f < 1 / 2 ? c : f < 2 / 3 ? l + (c - l) * (2 / 3 - f) * 6 : l;
|
|
885
|
+
}
|
|
886
|
+
if (t === 0)
|
|
887
|
+
n = i = a = r;
|
|
888
|
+
else {
|
|
889
|
+
var o = r < 0.5 ? r * (1 + t) : r + t - r * t, u = 2 * r - o;
|
|
890
|
+
n = s(u, o, e + 1 / 3), i = s(u, o, e), a = s(u, o, e - 1 / 3);
|
|
891
|
+
}
|
|
892
|
+
return {
|
|
893
|
+
r: n * 255,
|
|
894
|
+
g: i * 255,
|
|
895
|
+
b: a * 255
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
function dt(e, t, r) {
|
|
899
|
+
e = w(e, 255), t = w(t, 255), r = w(r, 255);
|
|
900
|
+
var n = Math.max(e, t, r), i = Math.min(e, t, r), a, s, o = n, u = n - i;
|
|
901
|
+
if (s = n === 0 ? 0 : u / n, n == i)
|
|
902
|
+
a = 0;
|
|
903
|
+
else {
|
|
904
|
+
switch (n) {
|
|
905
|
+
case e:
|
|
906
|
+
a = (t - r) / u + (t < r ? 6 : 0);
|
|
907
|
+
break;
|
|
908
|
+
case t:
|
|
909
|
+
a = (r - e) / u + 2;
|
|
910
|
+
break;
|
|
911
|
+
case r:
|
|
912
|
+
a = (e - t) / u + 4;
|
|
913
|
+
break;
|
|
914
|
+
}
|
|
915
|
+
a /= 6;
|
|
916
|
+
}
|
|
917
|
+
return {
|
|
918
|
+
h: a,
|
|
919
|
+
s,
|
|
920
|
+
v: o
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
function _i(e, t, r) {
|
|
924
|
+
e = w(e, 360) * 6, t = w(t, 100), r = w(r, 100);
|
|
925
|
+
var n = Math.floor(e), i = e - n, a = r * (1 - t), s = r * (1 - i * t), o = r * (1 - (1 - i) * t), u = n % 6, l = [r, s, a, a, o, r][u], c = [o, r, r, s, a, a][u], f = [a, a, o, r, r, s][u];
|
|
926
|
+
return {
|
|
927
|
+
r: l * 255,
|
|
928
|
+
g: c * 255,
|
|
929
|
+
b: f * 255
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
function pt(e, t, r, n) {
|
|
933
|
+
var i = [P(Math.round(e).toString(16)), P(Math.round(t).toString(16)), P(Math.round(r).toString(16))];
|
|
934
|
+
return n && i[0].charAt(0) == i[0].charAt(1) && i[1].charAt(0) == i[1].charAt(1) && i[2].charAt(0) == i[2].charAt(1) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) : i.join("");
|
|
935
|
+
}
|
|
936
|
+
function xi(e, t, r, n, i) {
|
|
937
|
+
var a = [P(Math.round(e).toString(16)), P(Math.round(t).toString(16)), P(Math.round(r).toString(16)), P(jt(n))];
|
|
938
|
+
return i && a[0].charAt(0) == a[0].charAt(1) && a[1].charAt(0) == a[1].charAt(1) && a[2].charAt(0) == a[2].charAt(1) && a[3].charAt(0) == a[3].charAt(1) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) + a[3].charAt(0) : a.join("");
|
|
939
|
+
}
|
|
940
|
+
function gt(e, t, r, n) {
|
|
941
|
+
var i = [P(jt(n)), P(Math.round(e).toString(16)), P(Math.round(t).toString(16)), P(Math.round(r).toString(16))];
|
|
942
|
+
return i.join("");
|
|
943
|
+
}
|
|
944
|
+
d.equals = function(e, t) {
|
|
945
|
+
return !e || !t ? !1 : d(e).toRgbString() == d(t).toRgbString();
|
|
946
|
+
};
|
|
947
|
+
d.random = function() {
|
|
948
|
+
return d.fromRatio({
|
|
949
|
+
r: Math.random(),
|
|
950
|
+
g: Math.random(),
|
|
951
|
+
b: Math.random()
|
|
952
|
+
});
|
|
953
|
+
};
|
|
954
|
+
function wi(e, t) {
|
|
955
|
+
t = t === 0 ? 0 : t || 10;
|
|
956
|
+
var r = d(e).toHsl();
|
|
957
|
+
return r.s -= t / 100, r.s = we(r.s), d(r);
|
|
958
|
+
}
|
|
959
|
+
function Si(e, t) {
|
|
960
|
+
t = t === 0 ? 0 : t || 10;
|
|
961
|
+
var r = d(e).toHsl();
|
|
962
|
+
return r.s += t / 100, r.s = we(r.s), d(r);
|
|
963
|
+
}
|
|
964
|
+
function Ei(e) {
|
|
965
|
+
return d(e).desaturate(100);
|
|
966
|
+
}
|
|
967
|
+
function Ai(e, t) {
|
|
968
|
+
t = t === 0 ? 0 : t || 10;
|
|
969
|
+
var r = d(e).toHsl();
|
|
970
|
+
return r.l += t / 100, r.l = we(r.l), d(r);
|
|
971
|
+
}
|
|
972
|
+
function Ci(e, t) {
|
|
973
|
+
t = t === 0 ? 0 : t || 10;
|
|
974
|
+
var r = d(e).toRgb();
|
|
975
|
+
return r.r = Math.max(0, Math.min(255, r.r - Math.round(255 * -(t / 100)))), r.g = Math.max(0, Math.min(255, r.g - Math.round(255 * -(t / 100)))), r.b = Math.max(0, Math.min(255, r.b - Math.round(255 * -(t / 100)))), d(r);
|
|
976
|
+
}
|
|
977
|
+
function Ti(e, t) {
|
|
978
|
+
t = t === 0 ? 0 : t || 10;
|
|
979
|
+
var r = d(e).toHsl();
|
|
980
|
+
return r.l -= t / 100, r.l = we(r.l), d(r);
|
|
981
|
+
}
|
|
982
|
+
function Mi(e, t) {
|
|
983
|
+
var r = d(e).toHsl(), n = (r.h + t) % 360;
|
|
984
|
+
return r.h = n < 0 ? 360 + n : n, d(r);
|
|
985
|
+
}
|
|
986
|
+
function Oi(e) {
|
|
987
|
+
var t = d(e).toHsl();
|
|
988
|
+
return t.h = (t.h + 180) % 360, d(t);
|
|
989
|
+
}
|
|
990
|
+
function bt(e, t) {
|
|
991
|
+
if (isNaN(t) || t <= 0)
|
|
992
|
+
throw new Error("Argument to polyad must be a positive number");
|
|
993
|
+
for (var r = d(e).toHsl(), n = [d(e)], i = 360 / t, a = 1; a < t; a++)
|
|
994
|
+
n.push(d({
|
|
995
|
+
h: (r.h + a * i) % 360,
|
|
996
|
+
s: r.s,
|
|
997
|
+
l: r.l
|
|
998
|
+
}));
|
|
999
|
+
return n;
|
|
1000
|
+
}
|
|
1001
|
+
function $i(e) {
|
|
1002
|
+
var t = d(e).toHsl(), r = t.h;
|
|
1003
|
+
return [d(e), d({
|
|
1004
|
+
h: (r + 72) % 360,
|
|
1005
|
+
s: t.s,
|
|
1006
|
+
l: t.l
|
|
1007
|
+
}), d({
|
|
1008
|
+
h: (r + 216) % 360,
|
|
1009
|
+
s: t.s,
|
|
1010
|
+
l: t.l
|
|
1011
|
+
})];
|
|
1012
|
+
}
|
|
1013
|
+
function Ri(e, t, r) {
|
|
1014
|
+
t = t || 6, r = r || 30;
|
|
1015
|
+
var n = d(e).toHsl(), i = 360 / r, a = [d(e)];
|
|
1016
|
+
for (n.h = (n.h - (i * t >> 1) + 720) % 360; --t; )
|
|
1017
|
+
n.h = (n.h + i) % 360, a.push(d(n));
|
|
1018
|
+
return a;
|
|
1019
|
+
}
|
|
1020
|
+
function Pi(e, t) {
|
|
1021
|
+
t = t || 6;
|
|
1022
|
+
for (var r = d(e).toHsv(), n = r.h, i = r.s, a = r.v, s = [], o = 1 / t; t--; )
|
|
1023
|
+
s.push(d({
|
|
1024
|
+
h: n,
|
|
1025
|
+
s: i,
|
|
1026
|
+
v: a
|
|
1027
|
+
})), a = (a + o) % 1;
|
|
1028
|
+
return s;
|
|
1029
|
+
}
|
|
1030
|
+
d.mix = function(e, t, r) {
|
|
1031
|
+
r = r === 0 ? 0 : r || 50;
|
|
1032
|
+
var n = d(e).toRgb(), i = d(t).toRgb(), a = r / 100, s = {
|
|
1033
|
+
r: (i.r - n.r) * a + n.r,
|
|
1034
|
+
g: (i.g - n.g) * a + n.g,
|
|
1035
|
+
b: (i.b - n.b) * a + n.b,
|
|
1036
|
+
a: (i.a - n.a) * a + n.a
|
|
1037
|
+
};
|
|
1038
|
+
return d(s);
|
|
1039
|
+
};
|
|
1040
|
+
d.readability = function(e, t) {
|
|
1041
|
+
var r = d(e), n = d(t);
|
|
1042
|
+
return (Math.max(r.getLuminance(), n.getLuminance()) + 0.05) / (Math.min(r.getLuminance(), n.getLuminance()) + 0.05);
|
|
1043
|
+
};
|
|
1044
|
+
d.isReadable = function(e, t, r) {
|
|
1045
|
+
var n = d.readability(e, t), i, a;
|
|
1046
|
+
switch (a = !1, i = ji(r), i.level + i.size) {
|
|
1047
|
+
case "AAsmall":
|
|
1048
|
+
case "AAAlarge":
|
|
1049
|
+
a = n >= 4.5;
|
|
1050
|
+
break;
|
|
1051
|
+
case "AAlarge":
|
|
1052
|
+
a = n >= 3;
|
|
1053
|
+
break;
|
|
1054
|
+
case "AAAsmall":
|
|
1055
|
+
a = n >= 7;
|
|
1056
|
+
break;
|
|
1057
|
+
}
|
|
1058
|
+
return a;
|
|
1059
|
+
};
|
|
1060
|
+
d.mostReadable = function(e, t, r) {
|
|
1061
|
+
var n = null, i = 0, a, s, o, u;
|
|
1062
|
+
r = r || {}, s = r.includeFallbackColors, o = r.level, u = r.size;
|
|
1063
|
+
for (var l = 0; l < t.length; l++)
|
|
1064
|
+
a = d.readability(e, t[l]), a > i && (i = a, n = d(t[l]));
|
|
1065
|
+
return d.isReadable(e, n, {
|
|
1066
|
+
level: o,
|
|
1067
|
+
size: u
|
|
1068
|
+
}) || !s ? n : (r.includeFallbackColors = !1, d.mostReadable(e, ["#fff", "#000"], r));
|
|
1069
|
+
};
|
|
1070
|
+
var Le = d.names = {
|
|
1071
|
+
aliceblue: "f0f8ff",
|
|
1072
|
+
antiquewhite: "faebd7",
|
|
1073
|
+
aqua: "0ff",
|
|
1074
|
+
aquamarine: "7fffd4",
|
|
1075
|
+
azure: "f0ffff",
|
|
1076
|
+
beige: "f5f5dc",
|
|
1077
|
+
bisque: "ffe4c4",
|
|
1078
|
+
black: "000",
|
|
1079
|
+
blanchedalmond: "ffebcd",
|
|
1080
|
+
blue: "00f",
|
|
1081
|
+
blueviolet: "8a2be2",
|
|
1082
|
+
brown: "a52a2a",
|
|
1083
|
+
burlywood: "deb887",
|
|
1084
|
+
burntsienna: "ea7e5d",
|
|
1085
|
+
cadetblue: "5f9ea0",
|
|
1086
|
+
chartreuse: "7fff00",
|
|
1087
|
+
chocolate: "d2691e",
|
|
1088
|
+
coral: "ff7f50",
|
|
1089
|
+
cornflowerblue: "6495ed",
|
|
1090
|
+
cornsilk: "fff8dc",
|
|
1091
|
+
crimson: "dc143c",
|
|
1092
|
+
cyan: "0ff",
|
|
1093
|
+
darkblue: "00008b",
|
|
1094
|
+
darkcyan: "008b8b",
|
|
1095
|
+
darkgoldenrod: "b8860b",
|
|
1096
|
+
darkgray: "a9a9a9",
|
|
1097
|
+
darkgreen: "006400",
|
|
1098
|
+
darkgrey: "a9a9a9",
|
|
1099
|
+
darkkhaki: "bdb76b",
|
|
1100
|
+
darkmagenta: "8b008b",
|
|
1101
|
+
darkolivegreen: "556b2f",
|
|
1102
|
+
darkorange: "ff8c00",
|
|
1103
|
+
darkorchid: "9932cc",
|
|
1104
|
+
darkred: "8b0000",
|
|
1105
|
+
darksalmon: "e9967a",
|
|
1106
|
+
darkseagreen: "8fbc8f",
|
|
1107
|
+
darkslateblue: "483d8b",
|
|
1108
|
+
darkslategray: "2f4f4f",
|
|
1109
|
+
darkslategrey: "2f4f4f",
|
|
1110
|
+
darkturquoise: "00ced1",
|
|
1111
|
+
darkviolet: "9400d3",
|
|
1112
|
+
deeppink: "ff1493",
|
|
1113
|
+
deepskyblue: "00bfff",
|
|
1114
|
+
dimgray: "696969",
|
|
1115
|
+
dimgrey: "696969",
|
|
1116
|
+
dodgerblue: "1e90ff",
|
|
1117
|
+
firebrick: "b22222",
|
|
1118
|
+
floralwhite: "fffaf0",
|
|
1119
|
+
forestgreen: "228b22",
|
|
1120
|
+
fuchsia: "f0f",
|
|
1121
|
+
gainsboro: "dcdcdc",
|
|
1122
|
+
ghostwhite: "f8f8ff",
|
|
1123
|
+
gold: "ffd700",
|
|
1124
|
+
goldenrod: "daa520",
|
|
1125
|
+
gray: "808080",
|
|
1126
|
+
green: "008000",
|
|
1127
|
+
greenyellow: "adff2f",
|
|
1128
|
+
grey: "808080",
|
|
1129
|
+
honeydew: "f0fff0",
|
|
1130
|
+
hotpink: "ff69b4",
|
|
1131
|
+
indianred: "cd5c5c",
|
|
1132
|
+
indigo: "4b0082",
|
|
1133
|
+
ivory: "fffff0",
|
|
1134
|
+
khaki: "f0e68c",
|
|
1135
|
+
lavender: "e6e6fa",
|
|
1136
|
+
lavenderblush: "fff0f5",
|
|
1137
|
+
lawngreen: "7cfc00",
|
|
1138
|
+
lemonchiffon: "fffacd",
|
|
1139
|
+
lightblue: "add8e6",
|
|
1140
|
+
lightcoral: "f08080",
|
|
1141
|
+
lightcyan: "e0ffff",
|
|
1142
|
+
lightgoldenrodyellow: "fafad2",
|
|
1143
|
+
lightgray: "d3d3d3",
|
|
1144
|
+
lightgreen: "90ee90",
|
|
1145
|
+
lightgrey: "d3d3d3",
|
|
1146
|
+
lightpink: "ffb6c1",
|
|
1147
|
+
lightsalmon: "ffa07a",
|
|
1148
|
+
lightseagreen: "20b2aa",
|
|
1149
|
+
lightskyblue: "87cefa",
|
|
1150
|
+
lightslategray: "789",
|
|
1151
|
+
lightslategrey: "789",
|
|
1152
|
+
lightsteelblue: "b0c4de",
|
|
1153
|
+
lightyellow: "ffffe0",
|
|
1154
|
+
lime: "0f0",
|
|
1155
|
+
limegreen: "32cd32",
|
|
1156
|
+
linen: "faf0e6",
|
|
1157
|
+
magenta: "f0f",
|
|
1158
|
+
maroon: "800000",
|
|
1159
|
+
mediumaquamarine: "66cdaa",
|
|
1160
|
+
mediumblue: "0000cd",
|
|
1161
|
+
mediumorchid: "ba55d3",
|
|
1162
|
+
mediumpurple: "9370db",
|
|
1163
|
+
mediumseagreen: "3cb371",
|
|
1164
|
+
mediumslateblue: "7b68ee",
|
|
1165
|
+
mediumspringgreen: "00fa9a",
|
|
1166
|
+
mediumturquoise: "48d1cc",
|
|
1167
|
+
mediumvioletred: "c71585",
|
|
1168
|
+
midnightblue: "191970",
|
|
1169
|
+
mintcream: "f5fffa",
|
|
1170
|
+
mistyrose: "ffe4e1",
|
|
1171
|
+
moccasin: "ffe4b5",
|
|
1172
|
+
navajowhite: "ffdead",
|
|
1173
|
+
navy: "000080",
|
|
1174
|
+
oldlace: "fdf5e6",
|
|
1175
|
+
olive: "808000",
|
|
1176
|
+
olivedrab: "6b8e23",
|
|
1177
|
+
orange: "ffa500",
|
|
1178
|
+
orangered: "ff4500",
|
|
1179
|
+
orchid: "da70d6",
|
|
1180
|
+
palegoldenrod: "eee8aa",
|
|
1181
|
+
palegreen: "98fb98",
|
|
1182
|
+
paleturquoise: "afeeee",
|
|
1183
|
+
palevioletred: "db7093",
|
|
1184
|
+
papayawhip: "ffefd5",
|
|
1185
|
+
peachpuff: "ffdab9",
|
|
1186
|
+
peru: "cd853f",
|
|
1187
|
+
pink: "ffc0cb",
|
|
1188
|
+
plum: "dda0dd",
|
|
1189
|
+
powderblue: "b0e0e6",
|
|
1190
|
+
purple: "800080",
|
|
1191
|
+
rebeccapurple: "663399",
|
|
1192
|
+
red: "f00",
|
|
1193
|
+
rosybrown: "bc8f8f",
|
|
1194
|
+
royalblue: "4169e1",
|
|
1195
|
+
saddlebrown: "8b4513",
|
|
1196
|
+
salmon: "fa8072",
|
|
1197
|
+
sandybrown: "f4a460",
|
|
1198
|
+
seagreen: "2e8b57",
|
|
1199
|
+
seashell: "fff5ee",
|
|
1200
|
+
sienna: "a0522d",
|
|
1201
|
+
silver: "c0c0c0",
|
|
1202
|
+
skyblue: "87ceeb",
|
|
1203
|
+
slateblue: "6a5acd",
|
|
1204
|
+
slategray: "708090",
|
|
1205
|
+
slategrey: "708090",
|
|
1206
|
+
snow: "fffafa",
|
|
1207
|
+
springgreen: "00ff7f",
|
|
1208
|
+
steelblue: "4682b4",
|
|
1209
|
+
tan: "d2b48c",
|
|
1210
|
+
teal: "008080",
|
|
1211
|
+
thistle: "d8bfd8",
|
|
1212
|
+
tomato: "ff6347",
|
|
1213
|
+
turquoise: "40e0d0",
|
|
1214
|
+
violet: "ee82ee",
|
|
1215
|
+
wheat: "f5deb3",
|
|
1216
|
+
white: "fff",
|
|
1217
|
+
whitesmoke: "f5f5f5",
|
|
1218
|
+
yellow: "ff0",
|
|
1219
|
+
yellowgreen: "9acd32"
|
|
1220
|
+
}, Li = d.hexNames = Hi(Le);
|
|
1221
|
+
function Hi(e) {
|
|
1222
|
+
var t = {};
|
|
1223
|
+
for (var r in e)
|
|
1224
|
+
e.hasOwnProperty(r) && (t[e[r]] = r);
|
|
1225
|
+
return t;
|
|
1226
|
+
}
|
|
1227
|
+
function Dt(e) {
|
|
1228
|
+
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
1229
|
+
}
|
|
1230
|
+
function w(e, t) {
|
|
1231
|
+
Fi(e) && (e = "100%");
|
|
1232
|
+
var r = Ii(e);
|
|
1233
|
+
return e = Math.min(t, Math.max(0, parseFloat(e))), r && (e = parseInt(e * t, 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : e % t / parseFloat(t);
|
|
1234
|
+
}
|
|
1235
|
+
function we(e) {
|
|
1236
|
+
return Math.min(1, Math.max(0, e));
|
|
1237
|
+
}
|
|
1238
|
+
function $(e) {
|
|
1239
|
+
return parseInt(e, 16);
|
|
1240
|
+
}
|
|
1241
|
+
function Fi(e) {
|
|
1242
|
+
return typeof e == "string" && e.indexOf(".") != -1 && parseFloat(e) === 1;
|
|
1243
|
+
}
|
|
1244
|
+
function Ii(e) {
|
|
1245
|
+
return typeof e == "string" && e.indexOf("%") != -1;
|
|
1246
|
+
}
|
|
1247
|
+
function P(e) {
|
|
1248
|
+
return e.length == 1 ? "0" + e : "" + e;
|
|
1249
|
+
}
|
|
1250
|
+
function te(e) {
|
|
1251
|
+
return e <= 1 && (e = e * 100 + "%"), e;
|
|
1252
|
+
}
|
|
1253
|
+
function jt(e) {
|
|
1254
|
+
return Math.round(parseFloat(e) * 255).toString(16);
|
|
1255
|
+
}
|
|
1256
|
+
function vt(e) {
|
|
1257
|
+
return $(e) / 255;
|
|
1258
|
+
}
|
|
1259
|
+
var R = (function() {
|
|
1260
|
+
var e = "[-\\+]?\\d+%?", t = "[-\\+]?\\d*\\.\\d+%?", r = "(?:" + t + ")|(?:" + e + ")", n = "[\\s|\\(]+(" + r + ")[,|\\s]+(" + r + ")[,|\\s]+(" + r + ")\\s*\\)?", i = "[\\s|\\(]+(" + r + ")[,|\\s]+(" + r + ")[,|\\s]+(" + r + ")[,|\\s]+(" + r + ")\\s*\\)?";
|
|
1261
|
+
return {
|
|
1262
|
+
CSS_UNIT: new RegExp(r),
|
|
1263
|
+
rgb: new RegExp("rgb" + n),
|
|
1264
|
+
rgba: new RegExp("rgba" + i),
|
|
1265
|
+
hsl: new RegExp("hsl" + n),
|
|
1266
|
+
hsla: new RegExp("hsla" + i),
|
|
1267
|
+
hsv: new RegExp("hsv" + n),
|
|
1268
|
+
hsva: new RegExp("hsva" + i),
|
|
1269
|
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
1270
|
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
1271
|
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
1272
|
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
1273
|
+
};
|
|
1274
|
+
})();
|
|
1275
|
+
function j(e) {
|
|
1276
|
+
return !!R.CSS_UNIT.exec(e);
|
|
1277
|
+
}
|
|
1278
|
+
function Di(e) {
|
|
1279
|
+
e = e.replace(gi, "").replace(bi, "").toLowerCase();
|
|
1280
|
+
var t = !1;
|
|
1281
|
+
if (Le[e])
|
|
1282
|
+
e = Le[e], t = !0;
|
|
1283
|
+
else if (e == "transparent")
|
|
1284
|
+
return {
|
|
1285
|
+
r: 0,
|
|
1286
|
+
g: 0,
|
|
1287
|
+
b: 0,
|
|
1288
|
+
a: 0,
|
|
1289
|
+
format: "name"
|
|
1290
|
+
};
|
|
1291
|
+
var r;
|
|
1292
|
+
return (r = R.rgb.exec(e)) ? {
|
|
1293
|
+
r: r[1],
|
|
1294
|
+
g: r[2],
|
|
1295
|
+
b: r[3]
|
|
1296
|
+
} : (r = R.rgba.exec(e)) ? {
|
|
1297
|
+
r: r[1],
|
|
1298
|
+
g: r[2],
|
|
1299
|
+
b: r[3],
|
|
1300
|
+
a: r[4]
|
|
1301
|
+
} : (r = R.hsl.exec(e)) ? {
|
|
1302
|
+
h: r[1],
|
|
1303
|
+
s: r[2],
|
|
1304
|
+
l: r[3]
|
|
1305
|
+
} : (r = R.hsla.exec(e)) ? {
|
|
1306
|
+
h: r[1],
|
|
1307
|
+
s: r[2],
|
|
1308
|
+
l: r[3],
|
|
1309
|
+
a: r[4]
|
|
1310
|
+
} : (r = R.hsv.exec(e)) ? {
|
|
1311
|
+
h: r[1],
|
|
1312
|
+
s: r[2],
|
|
1313
|
+
v: r[3]
|
|
1314
|
+
} : (r = R.hsva.exec(e)) ? {
|
|
1315
|
+
h: r[1],
|
|
1316
|
+
s: r[2],
|
|
1317
|
+
v: r[3],
|
|
1318
|
+
a: r[4]
|
|
1319
|
+
} : (r = R.hex8.exec(e)) ? {
|
|
1320
|
+
r: $(r[1]),
|
|
1321
|
+
g: $(r[2]),
|
|
1322
|
+
b: $(r[3]),
|
|
1323
|
+
a: vt(r[4]),
|
|
1324
|
+
format: t ? "name" : "hex8"
|
|
1325
|
+
} : (r = R.hex6.exec(e)) ? {
|
|
1326
|
+
r: $(r[1]),
|
|
1327
|
+
g: $(r[2]),
|
|
1328
|
+
b: $(r[3]),
|
|
1329
|
+
format: t ? "name" : "hex"
|
|
1330
|
+
} : (r = R.hex4.exec(e)) ? {
|
|
1331
|
+
r: $(r[1] + "" + r[1]),
|
|
1332
|
+
g: $(r[2] + "" + r[2]),
|
|
1333
|
+
b: $(r[3] + "" + r[3]),
|
|
1334
|
+
a: vt(r[4] + "" + r[4]),
|
|
1335
|
+
format: t ? "name" : "hex8"
|
|
1336
|
+
} : (r = R.hex3.exec(e)) ? {
|
|
1337
|
+
r: $(r[1] + "" + r[1]),
|
|
1338
|
+
g: $(r[2] + "" + r[2]),
|
|
1339
|
+
b: $(r[3] + "" + r[3]),
|
|
1340
|
+
format: t ? "name" : "hex"
|
|
1341
|
+
} : !1;
|
|
1342
|
+
}
|
|
1343
|
+
function ji(e) {
|
|
1344
|
+
var t, r;
|
|
1345
|
+
return e = e || {
|
|
1346
|
+
level: "AA",
|
|
1347
|
+
size: "small"
|
|
1348
|
+
}, t = (e.level || "AA").toUpperCase(), r = (e.size || "small").toLowerCase(), t !== "AA" && t !== "AAA" && (t = "AA"), r !== "small" && r !== "large" && (r = "small"), {
|
|
1349
|
+
level: t,
|
|
1350
|
+
size: r
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
function oe(e) {
|
|
1354
|
+
"@babel/helpers - typeof";
|
|
1355
|
+
return oe = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
1356
|
+
return typeof t;
|
|
1357
|
+
} : function(t) {
|
|
1358
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1359
|
+
}, oe(e);
|
|
1360
|
+
}
|
|
1361
|
+
function ki(e, t) {
|
|
1362
|
+
if (oe(e) != "object" || !e) return e;
|
|
1363
|
+
var r = e[Symbol.toPrimitive];
|
|
1364
|
+
if (r !== void 0) {
|
|
1365
|
+
var n = r.call(e, t);
|
|
1366
|
+
if (oe(n) != "object") return n;
|
|
1367
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1368
|
+
}
|
|
1369
|
+
return (t === "string" ? String : Number)(e);
|
|
1370
|
+
}
|
|
1371
|
+
function Ni(e) {
|
|
1372
|
+
var t = ki(e, "string");
|
|
1373
|
+
return oe(t) == "symbol" ? t : t + "";
|
|
1374
|
+
}
|
|
1375
|
+
function C(e, t, r) {
|
|
1376
|
+
return (t = Ni(t)) in e ? Object.defineProperty(e, t, {
|
|
1377
|
+
value: r,
|
|
1378
|
+
enumerable: !0,
|
|
1379
|
+
configurable: !0,
|
|
1380
|
+
writable: !0
|
|
1381
|
+
}) : e[t] = r, e;
|
|
1382
|
+
}
|
|
1383
|
+
var ye = (function() {
|
|
1384
|
+
try {
|
|
1385
|
+
var e = Y(Object, "defineProperty");
|
|
1386
|
+
return e({}, "", {}), e;
|
|
1387
|
+
} catch {
|
|
1388
|
+
}
|
|
1389
|
+
})();
|
|
1390
|
+
function Be(e, t, r) {
|
|
1391
|
+
t == "__proto__" && ye ? ye(e, t, {
|
|
1392
|
+
configurable: !0,
|
|
1393
|
+
enumerable: !0,
|
|
1394
|
+
value: r,
|
|
1395
|
+
writable: !0
|
|
1396
|
+
}) : e[t] = r;
|
|
1397
|
+
}
|
|
1398
|
+
function He(e, t, r) {
|
|
1399
|
+
(r !== void 0 && !ue(e[t], r) || r === void 0 && !(t in e)) && Be(e, t, r);
|
|
1400
|
+
}
|
|
1401
|
+
var kt = typeof exports == "object" && exports && !exports.nodeType && exports, mt = kt && typeof module == "object" && module && !module.nodeType && module, Ui = mt && mt.exports === kt, yt = Ui ? L.Buffer : void 0;
|
|
1402
|
+
yt && yt.allocUnsafe;
|
|
1403
|
+
function Bi(e, t) {
|
|
1404
|
+
return e.slice();
|
|
1405
|
+
}
|
|
1406
|
+
function Vi(e) {
|
|
1407
|
+
var t = new e.constructor(e.byteLength);
|
|
1408
|
+
return new be(t).set(new be(e)), t;
|
|
1409
|
+
}
|
|
1410
|
+
function Gi(e, t) {
|
|
1411
|
+
var r = Vi(e.buffer);
|
|
1412
|
+
return new e.constructor(r, e.byteOffset, e.length);
|
|
1413
|
+
}
|
|
1414
|
+
function zi(e, t) {
|
|
1415
|
+
var r = -1, n = e.length;
|
|
1416
|
+
for (t || (t = Array(n)); ++r < n; )
|
|
1417
|
+
t[r] = e[r];
|
|
1418
|
+
return t;
|
|
1419
|
+
}
|
|
1420
|
+
var _t = Object.create, Wi = /* @__PURE__ */ (function() {
|
|
1421
|
+
function e() {
|
|
1422
|
+
}
|
|
1423
|
+
return function(t) {
|
|
1424
|
+
if (!F(t))
|
|
1425
|
+
return {};
|
|
1426
|
+
if (_t)
|
|
1427
|
+
return _t(t);
|
|
1428
|
+
e.prototype = t;
|
|
1429
|
+
var r = new e();
|
|
1430
|
+
return e.prototype = void 0, r;
|
|
1431
|
+
};
|
|
1432
|
+
})(), Nt = Lt(Object.getPrototypeOf, Object);
|
|
1433
|
+
function Xi(e) {
|
|
1434
|
+
return typeof e.constructor == "function" && !Ne(e) ? Wi(Nt(e)) : {};
|
|
1435
|
+
}
|
|
1436
|
+
function Ki(e) {
|
|
1437
|
+
return V(e) && le(e);
|
|
1438
|
+
}
|
|
1439
|
+
var Yi = "[object Object]", qi = Function.prototype, Zi = Object.prototype, Ut = qi.toString, Ji = Zi.hasOwnProperty, Qi = Ut.call(Object);
|
|
1440
|
+
function es(e) {
|
|
1441
|
+
if (!V(e) || X(e) != Yi)
|
|
1442
|
+
return !1;
|
|
1443
|
+
var t = Nt(e);
|
|
1444
|
+
if (t === null)
|
|
1445
|
+
return !0;
|
|
1446
|
+
var r = Ji.call(t, "constructor") && t.constructor;
|
|
1447
|
+
return typeof r == "function" && r instanceof r && Ut.call(r) == Qi;
|
|
1448
|
+
}
|
|
1449
|
+
function Fe(e, t) {
|
|
1450
|
+
if (!(t === "constructor" && typeof e[t] == "function") && t != "__proto__")
|
|
1451
|
+
return e[t];
|
|
1452
|
+
}
|
|
1453
|
+
var ts = Object.prototype, rs = ts.hasOwnProperty;
|
|
1454
|
+
function ns(e, t, r) {
|
|
1455
|
+
var n = e[t];
|
|
1456
|
+
(!(rs.call(e, t) && ue(n, r)) || r === void 0 && !(t in e)) && Be(e, t, r);
|
|
1457
|
+
}
|
|
1458
|
+
function as(e, t, r, n) {
|
|
1459
|
+
var i = !r;
|
|
1460
|
+
r || (r = {});
|
|
1461
|
+
for (var a = -1, s = t.length; ++a < s; ) {
|
|
1462
|
+
var o = t[a], u = void 0;
|
|
1463
|
+
u === void 0 && (u = e[o]), i ? Be(r, o, u) : ns(r, o, u);
|
|
1464
|
+
}
|
|
1465
|
+
return r;
|
|
1466
|
+
}
|
|
1467
|
+
function is(e) {
|
|
1468
|
+
var t = [];
|
|
1469
|
+
if (e != null)
|
|
1470
|
+
for (var r in Object(e))
|
|
1471
|
+
t.push(r);
|
|
1472
|
+
return t;
|
|
1473
|
+
}
|
|
1474
|
+
var ss = Object.prototype, os = ss.hasOwnProperty;
|
|
1475
|
+
function us(e) {
|
|
1476
|
+
if (!F(e))
|
|
1477
|
+
return is(e);
|
|
1478
|
+
var t = Ne(e), r = [];
|
|
1479
|
+
for (var n in e)
|
|
1480
|
+
n == "constructor" && (t || !os.call(e, n)) || r.push(n);
|
|
1481
|
+
return r;
|
|
1482
|
+
}
|
|
1483
|
+
function Bt(e) {
|
|
1484
|
+
return le(e) ? Pt(e, !0) : us(e);
|
|
1485
|
+
}
|
|
1486
|
+
function ls(e) {
|
|
1487
|
+
return as(e, Bt(e));
|
|
1488
|
+
}
|
|
1489
|
+
function fs(e, t, r, n, i, a, s) {
|
|
1490
|
+
var o = Fe(e, r), u = Fe(t, r), l = s.get(u);
|
|
1491
|
+
if (l) {
|
|
1492
|
+
He(e, r, l);
|
|
1493
|
+
return;
|
|
1494
|
+
}
|
|
1495
|
+
var c = a ? a(o, u, r + "", e, t, s) : void 0, f = c === void 0;
|
|
1496
|
+
if (f) {
|
|
1497
|
+
var g = W(u), p = !g && ve(u), b = !g && !p && ke(u);
|
|
1498
|
+
c = u, g || p || b ? W(o) ? c = o : Ki(o) ? c = zi(o) : p ? (f = !1, c = Bi(u)) : b ? (f = !1, c = Gi(u)) : c = [] : es(u) || Me(u) ? (c = o, Me(o) ? c = ls(o) : (!F(o) || je(o)) && (c = Xi(u))) : f = !1;
|
|
1499
|
+
}
|
|
1500
|
+
f && (s.set(u, c), i(c, u, n, a, s), s.delete(u)), He(e, r, c);
|
|
1501
|
+
}
|
|
1502
|
+
function Vt(e, t, r, n, i) {
|
|
1503
|
+
e !== t && It(t, function(a, s) {
|
|
1504
|
+
if (i || (i = new k()), F(a))
|
|
1505
|
+
fs(e, t, s, r, Vt, n, i);
|
|
1506
|
+
else {
|
|
1507
|
+
var o = n ? n(Fe(e, s), a, s + "", e, t, i) : void 0;
|
|
1508
|
+
o === void 0 && (o = a), He(e, s, o);
|
|
1509
|
+
}
|
|
1510
|
+
}, Bt);
|
|
1511
|
+
}
|
|
1512
|
+
function cs(e, t, r) {
|
|
1513
|
+
switch (r.length) {
|
|
1514
|
+
case 0:
|
|
1515
|
+
return e.call(t);
|
|
1516
|
+
case 1:
|
|
1517
|
+
return e.call(t, r[0]);
|
|
1518
|
+
case 2:
|
|
1519
|
+
return e.call(t, r[0], r[1]);
|
|
1520
|
+
case 3:
|
|
1521
|
+
return e.call(t, r[0], r[1], r[2]);
|
|
1522
|
+
}
|
|
1523
|
+
return e.apply(t, r);
|
|
1524
|
+
}
|
|
1525
|
+
var xt = Math.max;
|
|
1526
|
+
function hs(e, t, r) {
|
|
1527
|
+
return t = xt(t === void 0 ? e.length - 1 : t, 0), function() {
|
|
1528
|
+
for (var n = arguments, i = -1, a = xt(n.length - t, 0), s = Array(a); ++i < a; )
|
|
1529
|
+
s[i] = n[t + i];
|
|
1530
|
+
i = -1;
|
|
1531
|
+
for (var o = Array(t + 1); ++i < t; )
|
|
1532
|
+
o[i] = n[i];
|
|
1533
|
+
return o[t] = r(s), cs(e, this, o);
|
|
1534
|
+
};
|
|
1535
|
+
}
|
|
1536
|
+
function ds(e) {
|
|
1537
|
+
return function() {
|
|
1538
|
+
return e;
|
|
1539
|
+
};
|
|
1540
|
+
}
|
|
1541
|
+
var ps = ye ? function(e, t) {
|
|
1542
|
+
return ye(e, "toString", {
|
|
1543
|
+
configurable: !0,
|
|
1544
|
+
enumerable: !1,
|
|
1545
|
+
value: ds(t),
|
|
1546
|
+
writable: !0
|
|
1547
|
+
});
|
|
1548
|
+
} : Ue, gs = 800, bs = 16, vs = Date.now;
|
|
1549
|
+
function ms(e) {
|
|
1550
|
+
var t = 0, r = 0;
|
|
1551
|
+
return function() {
|
|
1552
|
+
var n = vs(), i = bs - (n - r);
|
|
1553
|
+
if (r = n, i > 0) {
|
|
1554
|
+
if (++t >= gs)
|
|
1555
|
+
return arguments[0];
|
|
1556
|
+
} else
|
|
1557
|
+
t = 0;
|
|
1558
|
+
return e.apply(void 0, arguments);
|
|
1559
|
+
};
|
|
1560
|
+
}
|
|
1561
|
+
var ys = ms(ps);
|
|
1562
|
+
function _s(e, t) {
|
|
1563
|
+
return ys(hs(e, t, Ue), e + "");
|
|
1564
|
+
}
|
|
1565
|
+
function xs(e, t, r) {
|
|
1566
|
+
if (!F(r))
|
|
1567
|
+
return !1;
|
|
1568
|
+
var n = typeof t;
|
|
1569
|
+
return (n == "number" ? le(r) && Ot(t, r.length) : n == "string" && t in r) ? ue(r[t], e) : !1;
|
|
1570
|
+
}
|
|
1571
|
+
function ws(e) {
|
|
1572
|
+
return _s(function(t, r) {
|
|
1573
|
+
var n = -1, i = r.length, a = i > 1 ? r[i - 1] : void 0, s = i > 2 ? r[2] : void 0;
|
|
1574
|
+
for (a = e.length > 3 && typeof a == "function" ? (i--, a) : void 0, s && xs(r[0], r[1], s) && (a = i < 3 ? void 0 : a, i = 1), t = Object(t); ++n < i; ) {
|
|
1575
|
+
var o = r[n];
|
|
1576
|
+
o && e(t, o, n, a);
|
|
1577
|
+
}
|
|
1578
|
+
return t;
|
|
1579
|
+
});
|
|
1580
|
+
}
|
|
1581
|
+
var Ve = ws(function(e, t, r) {
|
|
1582
|
+
Vt(e, t, r);
|
|
1583
|
+
});
|
|
1584
|
+
const wt = (e) => {
|
|
1585
|
+
const t = ["r", "g", "b", "a", "h", "s", "l", "v"];
|
|
1586
|
+
let r = 0, n = 0;
|
|
1587
|
+
return pi(t, (i) => {
|
|
1588
|
+
e[i] && (r += 1, isNaN(e[i]) || (n += 1), (i === "s" || i === "l") && /^\d+%$/.test(e[i]) && (n += 1));
|
|
1589
|
+
}), r === n ? e : !1;
|
|
1590
|
+
}, he = (e, t) => {
|
|
1591
|
+
const r = e.hex ? d(e.hex) : d(e), n = r.toHsl(), i = r.toHsv(), a = r.toRgb(), s = r.toHex();
|
|
1592
|
+
n.s === 0 && (n.h = t || 0, i.h = t || 0);
|
|
1593
|
+
const o = s === "000000" && a.a === 0;
|
|
1594
|
+
return {
|
|
1595
|
+
hsl: n,
|
|
1596
|
+
hex: o ? "transparent" : `#${s}`,
|
|
1597
|
+
rgb: a,
|
|
1598
|
+
hsv: i,
|
|
1599
|
+
oldHue: e.h || t || n.h,
|
|
1600
|
+
source: e.source
|
|
1601
|
+
};
|
|
1602
|
+
}, Ss = (e) => {
|
|
1603
|
+
if (e === "transparent")
|
|
1604
|
+
return !0;
|
|
1605
|
+
const t = String(e).charAt(0) === "#" ? 1 : 0;
|
|
1606
|
+
return e.length !== 4 + t && e.length < 7 + t && d(e).isValid();
|
|
1607
|
+
}, Gt = Kt(void 0);
|
|
1608
|
+
function Es(e) {
|
|
1609
|
+
let {
|
|
1610
|
+
children: t,
|
|
1611
|
+
onChangeComplete: r,
|
|
1612
|
+
onChange: n,
|
|
1613
|
+
onSwatchHover: i,
|
|
1614
|
+
color: a,
|
|
1615
|
+
defaultColor: s = {
|
|
1616
|
+
h: 250,
|
|
1617
|
+
s: 0.5,
|
|
1618
|
+
l: 0.2,
|
|
1619
|
+
a: 1
|
|
1620
|
+
}
|
|
1621
|
+
} = e;
|
|
1622
|
+
const [o, u] = de({
|
|
1623
|
+
...he(a ?? s, 0)
|
|
1624
|
+
}), l = pe(a);
|
|
1625
|
+
oi(l.current, a) || (l.current = a), ne(() => {
|
|
1626
|
+
a && u({
|
|
1627
|
+
...he(a, 0)
|
|
1628
|
+
});
|
|
1629
|
+
}, [l.current]);
|
|
1630
|
+
const c = (b, v, S) => b(v, S), f = ae(() => Hr(c, 100), []);
|
|
1631
|
+
function g(b, v) {
|
|
1632
|
+
if (wt(b)) {
|
|
1633
|
+
const m = he(b, (typeof b != "string" && "h" in b ? b.h : void 0) || o.oldHue);
|
|
1634
|
+
u(m), r && f(r, m, v), n && n(m, v);
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
function p(b, v) {
|
|
1638
|
+
if (wt(b)) {
|
|
1639
|
+
const m = he(b, (typeof b != "string" && "h" in b ? b.h : void 0) || o.oldHue);
|
|
1640
|
+
i && i(m, v);
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
return h.createElement(Gt.Provider, {
|
|
1644
|
+
value: {
|
|
1645
|
+
colors: o,
|
|
1646
|
+
changeColor: g,
|
|
1647
|
+
onSwatchHover: i ? p : void 0
|
|
1648
|
+
}
|
|
1649
|
+
}, t);
|
|
1650
|
+
}
|
|
1651
|
+
const zt = () => Yt(Gt), As = (e) => (t) => h.createElement(Es, t, h.createElement(e, t)), Cs = (e, t, r, n, i) => {
|
|
1652
|
+
const a = i.clientWidth, s = i.clientHeight, o = typeof e.pageX == "number" ? e.pageX : e.touches[0].pageX, u = typeof e.pageY == "number" ? e.pageY : e.touches[0].pageY, l = o - (i.getBoundingClientRect().left + window.pageXOffset), c = u - (i.getBoundingClientRect().top + window.pageYOffset);
|
|
1653
|
+
if (r === "vertical") {
|
|
1654
|
+
let f;
|
|
1655
|
+
if (c < 0 ? f = 0 : c > s ? f = 1 : f = Math.round(c * 100 / s) / 100, t.a !== f)
|
|
1656
|
+
return {
|
|
1657
|
+
h: t.h,
|
|
1658
|
+
s: t.s,
|
|
1659
|
+
l: t.l,
|
|
1660
|
+
a: f,
|
|
1661
|
+
source: "rgb"
|
|
1662
|
+
};
|
|
1663
|
+
} else {
|
|
1664
|
+
let f;
|
|
1665
|
+
if (l < 0 ? f = 0 : l > a ? f = 1 : f = Math.round(l * 100 / a) / 100, n !== f)
|
|
1666
|
+
return {
|
|
1667
|
+
h: t.h,
|
|
1668
|
+
s: t.s,
|
|
1669
|
+
l: t.l,
|
|
1670
|
+
a: f,
|
|
1671
|
+
source: "rgb"
|
|
1672
|
+
};
|
|
1673
|
+
}
|
|
1674
|
+
return null;
|
|
1675
|
+
}, Te = {}, Ts = (e, t, r, n) => {
|
|
1676
|
+
if (typeof document > "u" && !n)
|
|
1677
|
+
return null;
|
|
1678
|
+
const i = n ? new n() : document.createElement("canvas");
|
|
1679
|
+
i.width = r * 2, i.height = r * 2;
|
|
1680
|
+
const a = i.getContext("2d");
|
|
1681
|
+
return a ? (a.fillStyle = e, a.fillRect(0, 0, i.width, i.height), a.fillStyle = t, a.fillRect(0, 0, r, r), a.translate(r, r), a.fillRect(0, 0, r, r), i.toDataURL()) : null;
|
|
1682
|
+
}, Ms = (e, t, r, n) => {
|
|
1683
|
+
const i = `${e}-${t}-${r}${n ? "-server" : ""}`;
|
|
1684
|
+
if (Te[i])
|
|
1685
|
+
return Te[i];
|
|
1686
|
+
const a = Ts(e, t, r, n);
|
|
1687
|
+
return Te[i] = a, a;
|
|
1688
|
+
};
|
|
1689
|
+
function Ge(e) {
|
|
1690
|
+
let {
|
|
1691
|
+
white: t = "transparent",
|
|
1692
|
+
grey: r = "rgba(0,0,0,.08)",
|
|
1693
|
+
size: n = 8,
|
|
1694
|
+
renderers: i = {},
|
|
1695
|
+
borderRadius: a,
|
|
1696
|
+
boxShadow: s,
|
|
1697
|
+
children: o
|
|
1698
|
+
} = e;
|
|
1699
|
+
const u = {
|
|
1700
|
+
grid: {
|
|
1701
|
+
borderRadius: a,
|
|
1702
|
+
boxShadow: s,
|
|
1703
|
+
position: "absolute",
|
|
1704
|
+
inset: "0px",
|
|
1705
|
+
background: `url(${Ms(t, r, n, i.canvas)}) center left`
|
|
1706
|
+
}
|
|
1707
|
+
};
|
|
1708
|
+
return qt(o) ? h.cloneElement(o, {
|
|
1709
|
+
...o.props,
|
|
1710
|
+
style: {
|
|
1711
|
+
...o.props.style,
|
|
1712
|
+
...u.grid
|
|
1713
|
+
}
|
|
1714
|
+
}) : h.createElement("div", {
|
|
1715
|
+
style: u.grid
|
|
1716
|
+
});
|
|
1717
|
+
}
|
|
1718
|
+
let Os = class extends (Ie || De) {
|
|
1719
|
+
constructor() {
|
|
1720
|
+
super(...arguments), C(this, "handleChange", (t) => {
|
|
1721
|
+
const r = Cs(t, this.props.hsl, this.props.direction, this.props.a, this.container);
|
|
1722
|
+
r && typeof this.props.onChange == "function" && this.props.onChange(r, t);
|
|
1723
|
+
}), C(this, "handleMouseDown", (t) => {
|
|
1724
|
+
this.handleChange(t), window.addEventListener("mousemove", this.handleChange), window.addEventListener("mouseup", this.handleMouseUp);
|
|
1725
|
+
}), C(this, "handleMouseUp", () => {
|
|
1726
|
+
this.unbindEventListeners();
|
|
1727
|
+
}), C(this, "unbindEventListeners", () => {
|
|
1728
|
+
window.removeEventListener("mousemove", this.handleChange), window.removeEventListener("mouseup", this.handleMouseUp);
|
|
1729
|
+
});
|
|
1730
|
+
}
|
|
1731
|
+
componentWillUnmount() {
|
|
1732
|
+
this.unbindEventListeners();
|
|
1733
|
+
}
|
|
1734
|
+
render() {
|
|
1735
|
+
const t = this.props.rgb, r = Ve({
|
|
1736
|
+
alpha: {
|
|
1737
|
+
position: "absolute",
|
|
1738
|
+
inset: "0px",
|
|
1739
|
+
borderRadius: this.props.radius
|
|
1740
|
+
},
|
|
1741
|
+
checkboard: {
|
|
1742
|
+
position: "absolute",
|
|
1743
|
+
inset: "0px",
|
|
1744
|
+
overflow: "hidden",
|
|
1745
|
+
borderRadius: this.props.radius
|
|
1746
|
+
},
|
|
1747
|
+
gradient: {
|
|
1748
|
+
position: "absolute",
|
|
1749
|
+
inset: "0px",
|
|
1750
|
+
background: this.props.direction === "vertical" ? `linear-gradient(to bottom, rgba(${t.r},${t.g},${t.b}, 0) 0%,
|
|
1751
|
+
rgba(${t.r},${t.g},${t.b}, 1) 100%)` : `linear-gradient(to right, rgba(${t.r},${t.g},${t.b}, 0) 0%,
|
|
1752
|
+
rgba(${t.r},${t.g},${t.b}, 1) 100%)`,
|
|
1753
|
+
boxShadow: this.props.shadow,
|
|
1754
|
+
borderRadius: this.props.radius
|
|
1755
|
+
},
|
|
1756
|
+
container: {
|
|
1757
|
+
position: "relative",
|
|
1758
|
+
height: "100%",
|
|
1759
|
+
margin: "0 3px"
|
|
1760
|
+
},
|
|
1761
|
+
pointer: {
|
|
1762
|
+
position: "absolute",
|
|
1763
|
+
left: this.props.direction === "vertical" ? 0 : `${t.a * 100}%`,
|
|
1764
|
+
top: this.props.direction === "vertical" ? `${t.a * 100}%` : void 0
|
|
1765
|
+
},
|
|
1766
|
+
slider: {
|
|
1767
|
+
width: "4px",
|
|
1768
|
+
borderRadius: "1px",
|
|
1769
|
+
height: "8px",
|
|
1770
|
+
boxShadow: "0 0 2px rgba(0, 0, 0, .6)",
|
|
1771
|
+
background: "#fff",
|
|
1772
|
+
marginTop: "1px",
|
|
1773
|
+
transform: "translateX(-2px)"
|
|
1774
|
+
}
|
|
1775
|
+
}, this.props.style);
|
|
1776
|
+
return h.createElement("div", {
|
|
1777
|
+
style: r.alpha
|
|
1778
|
+
}, h.createElement("div", {
|
|
1779
|
+
style: r.checkboard
|
|
1780
|
+
}, h.createElement(Ge, {
|
|
1781
|
+
renderers: this.props.renderers
|
|
1782
|
+
})), h.createElement("div", {
|
|
1783
|
+
style: r.gradient
|
|
1784
|
+
}), h.createElement("div", {
|
|
1785
|
+
style: r.container,
|
|
1786
|
+
ref: (n) => this.container = n,
|
|
1787
|
+
onMouseDown: this.handleMouseDown,
|
|
1788
|
+
onTouchMove: this.handleChange,
|
|
1789
|
+
onTouchStart: this.handleChange
|
|
1790
|
+
}, h.createElement("div", {
|
|
1791
|
+
style: r.pointer
|
|
1792
|
+
}, this.props.pointer ? h.createElement(this.props.pointer, this.props) : h.createElement("div", {
|
|
1793
|
+
style: r.slider
|
|
1794
|
+
}))));
|
|
1795
|
+
}
|
|
1796
|
+
};
|
|
1797
|
+
var $s = Os;
|
|
1798
|
+
const Rs = 1, Wt = 38, Ps = 40, Ls = [Wt, Ps], Hs = (e) => Ls.indexOf(e) > -1, Fs = (e) => Number(String(e).replace(/%/g, ""));
|
|
1799
|
+
let Is = 1;
|
|
1800
|
+
class Ds extends (Ie || De) {
|
|
1801
|
+
constructor(t) {
|
|
1802
|
+
super(), C(this, "handleBlur", () => {
|
|
1803
|
+
this.state.blurValue && this.setState({
|
|
1804
|
+
value: this.state.blurValue,
|
|
1805
|
+
blurValue: null
|
|
1806
|
+
});
|
|
1807
|
+
}), C(this, "handleChange", (r) => {
|
|
1808
|
+
this.setUpdatedValue(r.target.value, r);
|
|
1809
|
+
}), C(this, "handleKeyDown", (r) => {
|
|
1810
|
+
const n = Fs(r.target.value);
|
|
1811
|
+
if (!isNaN(n) && Hs(r.keyCode)) {
|
|
1812
|
+
const i = this.getArrowOffset(), a = r.keyCode === Wt ? n + i : n - i;
|
|
1813
|
+
this.setUpdatedValue(a, r);
|
|
1814
|
+
}
|
|
1815
|
+
}), C(this, "handleDrag", (r) => {
|
|
1816
|
+
if (this.props.dragLabel) {
|
|
1817
|
+
const n = Math.round(this.props.value + r.movementX);
|
|
1818
|
+
n >= 0 && n <= this.props.dragMax && this.props.onChange && this.props.onChange(this.getValueObjectWithLabel(n), r);
|
|
1819
|
+
}
|
|
1820
|
+
}), C(this, "handleMouseDown", (r) => {
|
|
1821
|
+
this.props.dragLabel && (r.preventDefault(), this.handleDrag(r), window.addEventListener("mousemove", this.handleDrag), window.addEventListener("mouseup", this.handleMouseUp));
|
|
1822
|
+
}), C(this, "handleMouseUp", () => {
|
|
1823
|
+
this.unbindEventListeners();
|
|
1824
|
+
}), C(this, "unbindEventListeners", () => {
|
|
1825
|
+
window.removeEventListener("mousemove", this.handleDrag), window.removeEventListener("mouseup", this.handleMouseUp);
|
|
1826
|
+
}), this.state = {
|
|
1827
|
+
value: String(t.value).toUpperCase(),
|
|
1828
|
+
blurValue: String(t.value).toUpperCase()
|
|
1829
|
+
}, this.inputId = `rc-editable-input-${Is++}`;
|
|
1830
|
+
}
|
|
1831
|
+
componentDidUpdate(t, r) {
|
|
1832
|
+
this.props.value !== this.state.value && (t.value !== this.props.value || r.value !== this.state.value) && (this.input === document.activeElement ? this.setState({
|
|
1833
|
+
blurValue: String(this.props.value).toUpperCase()
|
|
1834
|
+
}) : this.setState({
|
|
1835
|
+
value: String(this.props.value).toUpperCase(),
|
|
1836
|
+
blurValue: !this.state.blurValue && String(this.props.value).toUpperCase()
|
|
1837
|
+
}));
|
|
1838
|
+
}
|
|
1839
|
+
componentWillUnmount() {
|
|
1840
|
+
this.unbindEventListeners();
|
|
1841
|
+
}
|
|
1842
|
+
getValueObjectWithLabel(t) {
|
|
1843
|
+
return {
|
|
1844
|
+
[this.props.label]: t
|
|
1845
|
+
};
|
|
1846
|
+
}
|
|
1847
|
+
getArrowOffset() {
|
|
1848
|
+
return this.props.arrowOffset || Rs;
|
|
1849
|
+
}
|
|
1850
|
+
setUpdatedValue(t, r) {
|
|
1851
|
+
const n = this.props.label ? this.getValueObjectWithLabel(t) : t;
|
|
1852
|
+
this.props.onChange && this.props.onChange(n, r), this.setState({
|
|
1853
|
+
value: t
|
|
1854
|
+
});
|
|
1855
|
+
}
|
|
1856
|
+
render() {
|
|
1857
|
+
const t = {
|
|
1858
|
+
wrap: {
|
|
1859
|
+
position: "relative"
|
|
1860
|
+
},
|
|
1861
|
+
input: this.props.style && this.props.style.input ? this.props.style.input : {},
|
|
1862
|
+
label: {
|
|
1863
|
+
cursor: this.props["dragLabel-true"] ? "ew-resize" : void 0
|
|
1864
|
+
}
|
|
1865
|
+
};
|
|
1866
|
+
return this.props.style && this.props.style.wrap && (t.wrap = {
|
|
1867
|
+
...t.wrap,
|
|
1868
|
+
...this.props.style.wrap
|
|
1869
|
+
}), this.props.style && this.props.style.label && (t.label = {
|
|
1870
|
+
...t.label,
|
|
1871
|
+
...this.props.style.label
|
|
1872
|
+
}), h.createElement("div", {
|
|
1873
|
+
style: t.wrap
|
|
1874
|
+
}, h.createElement("input", {
|
|
1875
|
+
id: this.inputId,
|
|
1876
|
+
style: t.input,
|
|
1877
|
+
ref: (r) => this.input = r,
|
|
1878
|
+
value: this.state.value,
|
|
1879
|
+
onKeyDown: this.handleKeyDown,
|
|
1880
|
+
onChange: this.handleChange,
|
|
1881
|
+
onBlur: this.handleBlur,
|
|
1882
|
+
placeholder: this.props.placeholder,
|
|
1883
|
+
spellCheck: "false"
|
|
1884
|
+
}), this.props.label && !this.props.hideLabel ? h.createElement("label", {
|
|
1885
|
+
htmlFor: this.inputId,
|
|
1886
|
+
style: t.label,
|
|
1887
|
+
onMouseDown: this.handleMouseDown
|
|
1888
|
+
}, this.props.label) : null);
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
var ee = Ds;
|
|
1892
|
+
const js = (e, t, r, n) => {
|
|
1893
|
+
const i = n.clientWidth, a = n.clientHeight, s = typeof e.pageX == "number" ? e.pageX : e.touches[0].pageX, o = typeof e.pageY == "number" ? e.pageY : e.touches[0].pageY, u = s - (n.getBoundingClientRect().left + window.pageXOffset), l = o - (n.getBoundingClientRect().top + window.pageYOffset);
|
|
1894
|
+
if (t === "vertical") {
|
|
1895
|
+
let c;
|
|
1896
|
+
if (l < 0 ? c = 359 : l > a ? c = 0 : c = 360 * (-(l * 100 / a) + 100) / 100, r.h !== c)
|
|
1897
|
+
return {
|
|
1898
|
+
h: c,
|
|
1899
|
+
s: r.s,
|
|
1900
|
+
l: r.l,
|
|
1901
|
+
a: r.a,
|
|
1902
|
+
source: "hsl"
|
|
1903
|
+
};
|
|
1904
|
+
} else {
|
|
1905
|
+
let c;
|
|
1906
|
+
if (u < 0 ? c = 0 : u > i ? c = 359 : c = 360 * (u * 100 / i) / 100, r.h !== c)
|
|
1907
|
+
return {
|
|
1908
|
+
h: c,
|
|
1909
|
+
s: r.s,
|
|
1910
|
+
l: r.l,
|
|
1911
|
+
a: r.a,
|
|
1912
|
+
source: "hsl"
|
|
1913
|
+
};
|
|
1914
|
+
}
|
|
1915
|
+
return null;
|
|
1916
|
+
};
|
|
1917
|
+
let ks = class extends (Ie || De) {
|
|
1918
|
+
constructor() {
|
|
1919
|
+
super(...arguments), C(this, "handleChange", (t) => {
|
|
1920
|
+
const r = js(t, this.props.direction, this.props.hsl, this.container);
|
|
1921
|
+
r && typeof this.props.onChange == "function" && this.props.onChange(r, t);
|
|
1922
|
+
}), C(this, "handleMouseDown", (t) => {
|
|
1923
|
+
this.handleChange(t), window.addEventListener("mousemove", this.handleChange), window.addEventListener("mouseup", this.handleMouseUp);
|
|
1924
|
+
}), C(this, "handleMouseUp", () => {
|
|
1925
|
+
this.unbindEventListeners();
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1928
|
+
componentWillUnmount() {
|
|
1929
|
+
this.unbindEventListeners();
|
|
1930
|
+
}
|
|
1931
|
+
unbindEventListeners() {
|
|
1932
|
+
window.removeEventListener("mousemove", this.handleChange), window.removeEventListener("mouseup", this.handleMouseUp);
|
|
1933
|
+
}
|
|
1934
|
+
render() {
|
|
1935
|
+
const {
|
|
1936
|
+
direction: t = "horizontal"
|
|
1937
|
+
} = this.props, r = {
|
|
1938
|
+
hue: {
|
|
1939
|
+
position: "absolute",
|
|
1940
|
+
inset: "0px",
|
|
1941
|
+
borderRadius: this.props.radius,
|
|
1942
|
+
boxShadow: this.props.shadow
|
|
1943
|
+
},
|
|
1944
|
+
container: {
|
|
1945
|
+
padding: "0 2px",
|
|
1946
|
+
position: "relative",
|
|
1947
|
+
height: "100%",
|
|
1948
|
+
borderRadius: this.props.radius
|
|
1949
|
+
},
|
|
1950
|
+
pointer: {
|
|
1951
|
+
position: "absolute",
|
|
1952
|
+
left: t === "vertical" ? "0px" : `${this.props.hsl.h * 100 / 360}%`,
|
|
1953
|
+
top: t === "vertical" ? `${-(this.props.hsl.h * 100 / 360) + 100}%` : void 0
|
|
1954
|
+
},
|
|
1955
|
+
slider: {
|
|
1956
|
+
marginTop: "1px",
|
|
1957
|
+
width: "4px",
|
|
1958
|
+
borderRadius: "1px",
|
|
1959
|
+
height: "8px",
|
|
1960
|
+
boxShadow: "0 0 2px rgba(0, 0, 0, .6)",
|
|
1961
|
+
background: "#fff",
|
|
1962
|
+
transform: "translateX(-2px)"
|
|
1963
|
+
}
|
|
1964
|
+
};
|
|
1965
|
+
return h.createElement("div", {
|
|
1966
|
+
style: r.hue
|
|
1967
|
+
}, h.createElement("div", {
|
|
1968
|
+
className: `hue-${t}`,
|
|
1969
|
+
style: r.container,
|
|
1970
|
+
ref: (n) => this.container = n,
|
|
1971
|
+
onMouseDown: this.handleMouseDown,
|
|
1972
|
+
onTouchMove: this.handleChange,
|
|
1973
|
+
onTouchStart: this.handleChange
|
|
1974
|
+
}, h.createElement("style", null, `
|
|
1975
|
+
.hue-horizontal {
|
|
1976
|
+
background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0
|
|
1977
|
+
33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
|
1978
|
+
background: -webkit-linear-gradient(to right, #f00 0%, #ff0
|
|
1979
|
+
17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
.hue-vertical {
|
|
1983
|
+
background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,
|
|
1984
|
+
#0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
|
1985
|
+
background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,
|
|
1986
|
+
#0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
|
1987
|
+
}
|
|
1988
|
+
`), h.createElement("div", {
|
|
1989
|
+
style: r.pointer
|
|
1990
|
+
}, this.props.pointer ? h.createElement(this.props.pointer, this.props) : h.createElement("div", {
|
|
1991
|
+
style: r.slider
|
|
1992
|
+
}))));
|
|
1993
|
+
}
|
|
1994
|
+
};
|
|
1995
|
+
var Ns = ks;
|
|
1996
|
+
function Us(e, t, r) {
|
|
1997
|
+
const {
|
|
1998
|
+
width: n,
|
|
1999
|
+
height: i
|
|
2000
|
+
} = r.getBoundingClientRect(), a = typeof e.pageX == "number" ? e.pageX : e.touches[0].pageX, s = typeof e.pageY == "number" ? e.pageY : e.touches[0].pageY;
|
|
2001
|
+
let o = a - (r.getBoundingClientRect().left + window.pageXOffset), u = s - (r.getBoundingClientRect().top + window.pageYOffset);
|
|
2002
|
+
o < 0 ? o = 0 : o > n && (o = n), u < 0 ? u = 0 : u > i && (u = i);
|
|
2003
|
+
const l = o / n, c = 1 - u / i;
|
|
2004
|
+
return {
|
|
2005
|
+
h: t.h,
|
|
2006
|
+
s: l,
|
|
2007
|
+
v: c,
|
|
2008
|
+
a: t.a,
|
|
2009
|
+
source: "hsv"
|
|
2010
|
+
};
|
|
2011
|
+
}
|
|
2012
|
+
function Bs(e) {
|
|
2013
|
+
let {
|
|
2014
|
+
hsl: t,
|
|
2015
|
+
hsv: r,
|
|
2016
|
+
pointer: n,
|
|
2017
|
+
onChange: i,
|
|
2018
|
+
shadow: a,
|
|
2019
|
+
radius: s,
|
|
2020
|
+
style: o
|
|
2021
|
+
} = e;
|
|
2022
|
+
const u = pe(null);
|
|
2023
|
+
ne(() => () => {
|
|
2024
|
+
g();
|
|
2025
|
+
}, []);
|
|
2026
|
+
function l(T) {
|
|
2027
|
+
i && i(Us(T, t, u.current), T);
|
|
2028
|
+
}
|
|
2029
|
+
function c(T) {
|
|
2030
|
+
l(T), u.current && (u.current.addEventListener("mousemove", l), u.current.addEventListener("mouseup", f));
|
|
2031
|
+
}
|
|
2032
|
+
function f() {
|
|
2033
|
+
g();
|
|
2034
|
+
}
|
|
2035
|
+
function g() {
|
|
2036
|
+
u.current && (u.current.removeEventListener("mousemove", l), u.current.removeEventListener("mouseup", f));
|
|
2037
|
+
}
|
|
2038
|
+
const {
|
|
2039
|
+
color: p,
|
|
2040
|
+
white: b,
|
|
2041
|
+
black: v,
|
|
2042
|
+
pointer: S,
|
|
2043
|
+
circle: m
|
|
2044
|
+
} = o || {};
|
|
2045
|
+
let x = {
|
|
2046
|
+
color: {
|
|
2047
|
+
position: "absolute",
|
|
2048
|
+
inset: "0px",
|
|
2049
|
+
background: `hsl(${t.h},100%, 50%)`,
|
|
2050
|
+
borderRadius: s
|
|
2051
|
+
},
|
|
2052
|
+
white: {
|
|
2053
|
+
position: "absolute",
|
|
2054
|
+
inset: "0px",
|
|
2055
|
+
borderRadius: s
|
|
2056
|
+
},
|
|
2057
|
+
black: {
|
|
2058
|
+
position: "absolute",
|
|
2059
|
+
inset: "0px",
|
|
2060
|
+
boxShadow: a,
|
|
2061
|
+
borderRadius: s
|
|
2062
|
+
},
|
|
2063
|
+
pointer: {
|
|
2064
|
+
position: "absolute",
|
|
2065
|
+
top: `${-(r.v * 100) + 100}%`,
|
|
2066
|
+
left: `${r.s * 100}%`,
|
|
2067
|
+
cursor: "default"
|
|
2068
|
+
},
|
|
2069
|
+
circle: {
|
|
2070
|
+
width: "4px",
|
|
2071
|
+
height: "4px",
|
|
2072
|
+
boxShadow: `0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),
|
|
2073
|
+
0 0 1px 2px rgba(0,0,0,.4)`,
|
|
2074
|
+
borderRadius: "50%",
|
|
2075
|
+
cursor: "hand",
|
|
2076
|
+
transform: "translate(-2px, -2px)"
|
|
2077
|
+
}
|
|
2078
|
+
};
|
|
2079
|
+
return o && (x = Ve(x, {
|
|
2080
|
+
color: p,
|
|
2081
|
+
white: b,
|
|
2082
|
+
black: v,
|
|
2083
|
+
stylePointer: S,
|
|
2084
|
+
circle: m
|
|
2085
|
+
})), h.createElement("div", {
|
|
2086
|
+
style: x.color,
|
|
2087
|
+
ref: u,
|
|
2088
|
+
onMouseDown: c,
|
|
2089
|
+
onTouchMove: l,
|
|
2090
|
+
onTouchStart: l
|
|
2091
|
+
}, h.createElement("style", null, `
|
|
2092
|
+
.saturation-white {
|
|
2093
|
+
background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));
|
|
2094
|
+
background: linear-gradient(to right, #fff, rgba(255,255,255,0));
|
|
2095
|
+
}
|
|
2096
|
+
.saturation-black {
|
|
2097
|
+
background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));
|
|
2098
|
+
background: linear-gradient(to top, #000, rgba(0,0,0,0));
|
|
2099
|
+
}
|
|
2100
|
+
`), h.createElement("div", {
|
|
2101
|
+
style: x.white,
|
|
2102
|
+
className: "saturation-white"
|
|
2103
|
+
}, h.createElement("div", {
|
|
2104
|
+
style: x.black,
|
|
2105
|
+
className: "saturation-black"
|
|
2106
|
+
}), h.createElement("div", {
|
|
2107
|
+
style: x.pointer
|
|
2108
|
+
}, n || h.createElement("div", {
|
|
2109
|
+
style: x.circle
|
|
2110
|
+
}))));
|
|
2111
|
+
}
|
|
2112
|
+
const Vs = function(e) {
|
|
2113
|
+
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "span";
|
|
2114
|
+
return class extends h.Component {
|
|
2115
|
+
constructor() {
|
|
2116
|
+
super(...arguments), C(this, "state", {
|
|
2117
|
+
focus: !1
|
|
2118
|
+
}), C(this, "handleFocus", () => this.setState({
|
|
2119
|
+
focus: !0
|
|
2120
|
+
})), C(this, "handleBlur", () => this.setState({
|
|
2121
|
+
focus: !1
|
|
2122
|
+
}));
|
|
2123
|
+
}
|
|
2124
|
+
render() {
|
|
2125
|
+
return h.createElement(t, {
|
|
2126
|
+
onFocus: this.handleFocus,
|
|
2127
|
+
onBlur: this.handleBlur
|
|
2128
|
+
}, h.createElement(e, St({}, this.props, this.state)));
|
|
2129
|
+
}
|
|
2130
|
+
};
|
|
2131
|
+
}, Gs = 13, zs = (e) => {
|
|
2132
|
+
let {
|
|
2133
|
+
color: t,
|
|
2134
|
+
style: r,
|
|
2135
|
+
onClick: n = () => {
|
|
2136
|
+
},
|
|
2137
|
+
title: i = t,
|
|
2138
|
+
children: a,
|
|
2139
|
+
focus: s,
|
|
2140
|
+
focusStyle: o = {}
|
|
2141
|
+
} = e;
|
|
2142
|
+
const {
|
|
2143
|
+
onSwatchHover: u
|
|
2144
|
+
} = zt(), l = t === "transparent", c = {
|
|
2145
|
+
swatch: {
|
|
2146
|
+
background: t,
|
|
2147
|
+
height: "100%",
|
|
2148
|
+
width: "100%",
|
|
2149
|
+
cursor: "pointer",
|
|
2150
|
+
position: "relative",
|
|
2151
|
+
outline: "none",
|
|
2152
|
+
...r,
|
|
2153
|
+
...s ? o : {}
|
|
2154
|
+
}
|
|
2155
|
+
}, f = (p) => n(t, p), g = (p) => p.keyCode === Gs && n(t, p);
|
|
2156
|
+
return h.createElement("div", {
|
|
2157
|
+
style: c.swatch,
|
|
2158
|
+
onClick: f,
|
|
2159
|
+
title: i,
|
|
2160
|
+
tabIndex: 0,
|
|
2161
|
+
onKeyDown: g,
|
|
2162
|
+
onMouseOver: (p) => {
|
|
2163
|
+
u && u(t, p);
|
|
2164
|
+
}
|
|
2165
|
+
}, a, l && h.createElement(Ge, {
|
|
2166
|
+
borderRadius: c.swatch.borderRadius,
|
|
2167
|
+
boxShadow: "inset 0 0 0 1px rgba(0,0,0,0.1)"
|
|
2168
|
+
}));
|
|
2169
|
+
};
|
|
2170
|
+
var Ws = Vs(zs);
|
|
2171
|
+
const Xs = (e) => {
|
|
2172
|
+
let {
|
|
2173
|
+
onChange: t = () => {
|
|
2174
|
+
},
|
|
2175
|
+
rgb: r,
|
|
2176
|
+
hsl: n,
|
|
2177
|
+
hex: i,
|
|
2178
|
+
disableAlpha: a
|
|
2179
|
+
} = e;
|
|
2180
|
+
const s = {
|
|
2181
|
+
fields: {
|
|
2182
|
+
display: "flex",
|
|
2183
|
+
paddingTop: "4px"
|
|
2184
|
+
},
|
|
2185
|
+
single: {
|
|
2186
|
+
flex: "1",
|
|
2187
|
+
paddingLeft: "6px"
|
|
2188
|
+
},
|
|
2189
|
+
alpha: {
|
|
2190
|
+
flex: "1",
|
|
2191
|
+
paddingLeft: "6px",
|
|
2192
|
+
display: a ? "none" : void 0
|
|
2193
|
+
},
|
|
2194
|
+
double: {
|
|
2195
|
+
flex: "2"
|
|
2196
|
+
},
|
|
2197
|
+
input: {
|
|
2198
|
+
width: "80%",
|
|
2199
|
+
padding: "4px 10% 3px",
|
|
2200
|
+
border: "none",
|
|
2201
|
+
boxShadow: "inset 0 0 0 1px #ccc",
|
|
2202
|
+
fontSize: "11px"
|
|
2203
|
+
},
|
|
2204
|
+
label: {
|
|
2205
|
+
display: "block",
|
|
2206
|
+
textAlign: "center",
|
|
2207
|
+
fontSize: "11px",
|
|
2208
|
+
color: "#222",
|
|
2209
|
+
paddingTop: "3px",
|
|
2210
|
+
paddingBottom: "4px",
|
|
2211
|
+
textTransform: "capitalize"
|
|
2212
|
+
}
|
|
2213
|
+
}, o = (u, l) => {
|
|
2214
|
+
typeof u != "string" && "hex" in u ? Ss(u.hex) && t({
|
|
2215
|
+
hex: u.hex,
|
|
2216
|
+
source: "hex"
|
|
2217
|
+
}, l) : typeof u != "string" && ("r" in u || "g" in u || "b" in u) ? t({
|
|
2218
|
+
r: u.r || r.r,
|
|
2219
|
+
g: u.g || r.g,
|
|
2220
|
+
b: u.b || r.b,
|
|
2221
|
+
a: r.a,
|
|
2222
|
+
source: "rgb"
|
|
2223
|
+
}, l) : typeof u != "string" && u.a && (u.a < 0 ? u.a = 0 : u.a > 100 && (u.a = 100), u.a /= 100, t({
|
|
2224
|
+
h: n.h,
|
|
2225
|
+
s: n.s,
|
|
2226
|
+
l: n.l,
|
|
2227
|
+
a: u.a,
|
|
2228
|
+
source: "rgb"
|
|
2229
|
+
}, l));
|
|
2230
|
+
};
|
|
2231
|
+
return h.createElement("div", {
|
|
2232
|
+
style: s.fields,
|
|
2233
|
+
className: "flexbox-fix"
|
|
2234
|
+
}, h.createElement("div", {
|
|
2235
|
+
style: s.double
|
|
2236
|
+
}, h.createElement(ee, {
|
|
2237
|
+
style: {
|
|
2238
|
+
input: s.input,
|
|
2239
|
+
label: s.label
|
|
2240
|
+
},
|
|
2241
|
+
label: "hex",
|
|
2242
|
+
value: i.replace("#", ""),
|
|
2243
|
+
onChange: o
|
|
2244
|
+
})), h.createElement("div", {
|
|
2245
|
+
style: s.single
|
|
2246
|
+
}, h.createElement(ee, {
|
|
2247
|
+
style: {
|
|
2248
|
+
input: s.input,
|
|
2249
|
+
label: s.label
|
|
2250
|
+
},
|
|
2251
|
+
label: "r",
|
|
2252
|
+
value: r.r,
|
|
2253
|
+
onChange: o,
|
|
2254
|
+
dragLabel: "true",
|
|
2255
|
+
dragMax: "255"
|
|
2256
|
+
})), h.createElement("div", {
|
|
2257
|
+
style: s.single
|
|
2258
|
+
}, h.createElement(ee, {
|
|
2259
|
+
style: {
|
|
2260
|
+
input: s.input,
|
|
2261
|
+
label: s.label
|
|
2262
|
+
},
|
|
2263
|
+
label: "g",
|
|
2264
|
+
value: r.g,
|
|
2265
|
+
onChange: o,
|
|
2266
|
+
dragLabel: "true",
|
|
2267
|
+
dragMax: "255"
|
|
2268
|
+
})), h.createElement("div", {
|
|
2269
|
+
style: s.single
|
|
2270
|
+
}, h.createElement(ee, {
|
|
2271
|
+
style: {
|
|
2272
|
+
input: s.input,
|
|
2273
|
+
label: s.label
|
|
2274
|
+
},
|
|
2275
|
+
label: "b",
|
|
2276
|
+
value: r.b,
|
|
2277
|
+
onChange: o,
|
|
2278
|
+
dragLabel: "true",
|
|
2279
|
+
dragMax: "255"
|
|
2280
|
+
})), h.createElement("div", {
|
|
2281
|
+
style: s.alpha
|
|
2282
|
+
}, h.createElement(ee, {
|
|
2283
|
+
style: {
|
|
2284
|
+
input: s.input,
|
|
2285
|
+
label: s.label
|
|
2286
|
+
},
|
|
2287
|
+
label: "a",
|
|
2288
|
+
value: Math.round((r.a ?? 1) * 100),
|
|
2289
|
+
onChange: o,
|
|
2290
|
+
dragLabel: "true",
|
|
2291
|
+
dragMax: "100"
|
|
2292
|
+
})));
|
|
2293
|
+
};
|
|
2294
|
+
var Ks = Xs;
|
|
2295
|
+
function Ys(e) {
|
|
2296
|
+
let {
|
|
2297
|
+
colors: t,
|
|
2298
|
+
onClick: r = () => {
|
|
2299
|
+
}
|
|
2300
|
+
} = e;
|
|
2301
|
+
const i = {
|
|
2302
|
+
colors: {
|
|
2303
|
+
margin: "0 -10px",
|
|
2304
|
+
padding: "10px 0 0 10px",
|
|
2305
|
+
borderTop: "1px solid #eee",
|
|
2306
|
+
display: !t || !t.length ? "none" : "flex",
|
|
2307
|
+
flexWrap: "wrap",
|
|
2308
|
+
position: "relative"
|
|
2309
|
+
},
|
|
2310
|
+
swatchWrap: {
|
|
2311
|
+
width: "16px",
|
|
2312
|
+
height: "16px",
|
|
2313
|
+
margin: "0 10px 10px 0"
|
|
2314
|
+
},
|
|
2315
|
+
swatch: {
|
|
2316
|
+
borderRadius: "3px",
|
|
2317
|
+
boxShadow: "inset 0 0 0 1px rgba(0,0,0,.15)"
|
|
2318
|
+
}
|
|
2319
|
+
}, a = (s, o) => {
|
|
2320
|
+
r({
|
|
2321
|
+
hex: s,
|
|
2322
|
+
source: "hex"
|
|
2323
|
+
}, o);
|
|
2324
|
+
};
|
|
2325
|
+
return h.createElement("div", {
|
|
2326
|
+
style: i.colors,
|
|
2327
|
+
className: "flexbox-fix"
|
|
2328
|
+
}, t.map((s) => {
|
|
2329
|
+
const o = typeof s == "string" ? {
|
|
2330
|
+
color: s
|
|
2331
|
+
} : s, u = `${o.color}${("title" in o ? o.title : "") || ""}`;
|
|
2332
|
+
return h.createElement("div", {
|
|
2333
|
+
key: u,
|
|
2334
|
+
style: i.swatchWrap
|
|
2335
|
+
}, h.createElement(Ws, St({}, o, {
|
|
2336
|
+
style: i.swatch,
|
|
2337
|
+
onClick: a,
|
|
2338
|
+
focusStyle: {
|
|
2339
|
+
boxShadow: `inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px ${o.color}`
|
|
2340
|
+
}
|
|
2341
|
+
})));
|
|
2342
|
+
}));
|
|
2343
|
+
}
|
|
2344
|
+
function qs(e) {
|
|
2345
|
+
let {
|
|
2346
|
+
width: t = 200,
|
|
2347
|
+
disableAlpha: r = !1,
|
|
2348
|
+
presetColors: n = ["#D0021B", "#F5A623", "#F8E71C", "#8B572A", "#7ED321", "#417505", "#BD10E0", "#9013FE", "#4A90E2", "#50E3C2", "#B8E986", "#000000", "#4A4A4A", "#9B9B9B", "#FFFFFF"],
|
|
2349
|
+
renderers: i,
|
|
2350
|
+
styles: a = {},
|
|
2351
|
+
className: s = ""
|
|
2352
|
+
} = e;
|
|
2353
|
+
const {
|
|
2354
|
+
colors: o,
|
|
2355
|
+
changeColor: u
|
|
2356
|
+
} = zt(), {
|
|
2357
|
+
rgb: l,
|
|
2358
|
+
hex: c,
|
|
2359
|
+
hsv: f,
|
|
2360
|
+
hsl: g
|
|
2361
|
+
} = o, p = Ve({
|
|
2362
|
+
picker: {
|
|
2363
|
+
width: t,
|
|
2364
|
+
padding: "10px 10px 0",
|
|
2365
|
+
boxSizing: "initial",
|
|
2366
|
+
background: "#fff",
|
|
2367
|
+
borderRadius: "4px",
|
|
2368
|
+
boxShadow: "0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)"
|
|
2369
|
+
},
|
|
2370
|
+
saturation: {
|
|
2371
|
+
width: "100%",
|
|
2372
|
+
paddingBottom: "75%",
|
|
2373
|
+
position: "relative",
|
|
2374
|
+
overflow: "hidden"
|
|
2375
|
+
},
|
|
2376
|
+
Saturation: {
|
|
2377
|
+
borderRadius: "3px",
|
|
2378
|
+
boxShadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"
|
|
2379
|
+
},
|
|
2380
|
+
controls: {
|
|
2381
|
+
display: "flex"
|
|
2382
|
+
},
|
|
2383
|
+
sliders: {
|
|
2384
|
+
padding: "4px 0",
|
|
2385
|
+
flex: "1"
|
|
2386
|
+
},
|
|
2387
|
+
color: {
|
|
2388
|
+
width: "24px",
|
|
2389
|
+
height: r ? "10px" : "24px",
|
|
2390
|
+
position: "relative",
|
|
2391
|
+
marginTop: "4px",
|
|
2392
|
+
marginLeft: "4px",
|
|
2393
|
+
borderRadius: "3px"
|
|
2394
|
+
},
|
|
2395
|
+
activeColor: {
|
|
2396
|
+
position: "absolute",
|
|
2397
|
+
inset: "0px",
|
|
2398
|
+
borderRadius: "2px",
|
|
2399
|
+
background: `rgba(${l.r},${l.g},${l.b},${l.a})`,
|
|
2400
|
+
boxShadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"
|
|
2401
|
+
},
|
|
2402
|
+
hue: {
|
|
2403
|
+
position: "relative",
|
|
2404
|
+
height: "10px",
|
|
2405
|
+
overflow: "hidden"
|
|
2406
|
+
},
|
|
2407
|
+
Hue: {
|
|
2408
|
+
borderRadius: "2px",
|
|
2409
|
+
boxShadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"
|
|
2410
|
+
},
|
|
2411
|
+
alpha: {
|
|
2412
|
+
position: "relative",
|
|
2413
|
+
height: "10px",
|
|
2414
|
+
marginTop: "4px",
|
|
2415
|
+
overflow: "hidden",
|
|
2416
|
+
display: r ? "none" : void 0
|
|
2417
|
+
},
|
|
2418
|
+
Alpha: {
|
|
2419
|
+
borderRadius: "2px",
|
|
2420
|
+
boxShadow: "inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"
|
|
2421
|
+
},
|
|
2422
|
+
...a
|
|
2423
|
+
}, a);
|
|
2424
|
+
return h.createElement("div", {
|
|
2425
|
+
style: p.picker,
|
|
2426
|
+
className: `sketch-picker ${s}`
|
|
2427
|
+
}, h.createElement("div", {
|
|
2428
|
+
style: p.saturation
|
|
2429
|
+
}, h.createElement(Bs, {
|
|
2430
|
+
style: p.Saturation,
|
|
2431
|
+
hsl: g,
|
|
2432
|
+
hsv: f,
|
|
2433
|
+
onChange: u
|
|
2434
|
+
})), h.createElement("div", {
|
|
2435
|
+
style: p.controls,
|
|
2436
|
+
className: "flexbox-fix"
|
|
2437
|
+
}, h.createElement("div", {
|
|
2438
|
+
style: p.sliders
|
|
2439
|
+
}, h.createElement("div", {
|
|
2440
|
+
style: p.hue
|
|
2441
|
+
}, h.createElement(Ns, {
|
|
2442
|
+
style: p.Hue,
|
|
2443
|
+
hsl: g,
|
|
2444
|
+
onChange: u
|
|
2445
|
+
})), h.createElement("div", {
|
|
2446
|
+
style: p.alpha
|
|
2447
|
+
}, h.createElement($s, {
|
|
2448
|
+
style: p.Alpha,
|
|
2449
|
+
rgb: l,
|
|
2450
|
+
hsl: g,
|
|
2451
|
+
renderers: i,
|
|
2452
|
+
onChange: u
|
|
2453
|
+
}))), h.createElement("div", {
|
|
2454
|
+
style: p.color
|
|
2455
|
+
}, h.createElement(Ge, null), h.createElement("div", {
|
|
2456
|
+
style: p.activeColor
|
|
2457
|
+
}))), h.createElement(Ks, {
|
|
2458
|
+
rgb: l,
|
|
2459
|
+
hsl: g,
|
|
2460
|
+
hex: c,
|
|
2461
|
+
onChange: u,
|
|
2462
|
+
disableAlpha: r
|
|
2463
|
+
}), h.createElement(Ys, {
|
|
2464
|
+
colors: n,
|
|
2465
|
+
onClick: u
|
|
2466
|
+
}));
|
|
2467
|
+
}
|
|
2468
|
+
var co = As(qs);
|
|
2469
|
+
function ho(e) {
|
|
2470
|
+
const t = er((n) => {
|
|
2471
|
+
var a, s;
|
|
2472
|
+
const i = [];
|
|
2473
|
+
for (const o of Object.keys(n.nodes)) {
|
|
2474
|
+
const u = ((s = (a = n.nodes[o]) == null ? void 0 : a.data) == null ? void 0 : s.props) ?? {};
|
|
2475
|
+
try {
|
|
2476
|
+
i.push({ id: o, serialized: JSON.stringify(u) });
|
|
2477
|
+
} catch {
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
return i;
|
|
2481
|
+
}), r = ae(() => Array.isArray(t) ? t : t && typeof t == "object" ? Object.keys(t).filter((n) => !isNaN(Number(n))).map((n) => t[n]).filter(
|
|
2482
|
+
(n) => n && typeof n == "object" && "id" in n && "serialized" in n
|
|
2483
|
+
) : [], [t]);
|
|
2484
|
+
return ae(() => {
|
|
2485
|
+
if (!e) return { count: 0, nodeIds: [] };
|
|
2486
|
+
const n = `var(${e})`, i = [];
|
|
2487
|
+
for (const { id: a, serialized: s } of r)
|
|
2488
|
+
s.includes(n) && i.push(a);
|
|
2489
|
+
return { count: i.length, nodeIds: i };
|
|
2490
|
+
}, [e, r]);
|
|
2491
|
+
}
|
|
2492
|
+
function Zs({
|
|
2493
|
+
open: e,
|
|
2494
|
+
placement: t = "bottom-start",
|
|
2495
|
+
strategy: r = "fixed",
|
|
2496
|
+
mainAxisOffset: n = 4,
|
|
2497
|
+
crossAxisOffset: i = 0,
|
|
2498
|
+
flipOptions: a,
|
|
2499
|
+
shiftPadding: s = 8,
|
|
2500
|
+
boundary: o = "clippingAncestors",
|
|
2501
|
+
rootBoundary: u = "viewport",
|
|
2502
|
+
maxHeightCeiling: l,
|
|
2503
|
+
maxHeightMin: c = 0,
|
|
2504
|
+
matchReferenceMinMaxWidth: f,
|
|
2505
|
+
middleware: g = [],
|
|
2506
|
+
whileElementsMounted: p = fr,
|
|
2507
|
+
dismiss: b,
|
|
2508
|
+
transform: v = !0
|
|
2509
|
+
}) {
|
|
2510
|
+
const S = pe(b);
|
|
2511
|
+
S.current = b;
|
|
2512
|
+
const m = pe(g);
|
|
2513
|
+
m.current = g;
|
|
2514
|
+
const x = f == null ? void 0 : f.min, T = f == null ? void 0 : f.max, H = ae(() => {
|
|
2515
|
+
const E = [
|
|
2516
|
+
ar({ mainAxis: n, crossAxis: i }),
|
|
2517
|
+
ir(a),
|
|
2518
|
+
sr({ padding: s, boundary: o, rootBoundary: u })
|
|
2519
|
+
];
|
|
2520
|
+
return l != null && E.push(
|
|
2521
|
+
or({
|
|
2522
|
+
boundary: o,
|
|
2523
|
+
rootBoundary: u,
|
|
2524
|
+
apply({ availableHeight: O, rects: M, elements: I }) {
|
|
2525
|
+
const D = Math.min(l, O), U = Math.max(c, D);
|
|
2526
|
+
if (Object.assign(I.floating.style, { maxHeight: `${U}px` }), x != null && T != null) {
|
|
2527
|
+
const Z = M.reference.width, G = Math.min(Math.max(Z, x), T);
|
|
2528
|
+
I.floating.style.minWidth = `${G}px`;
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
})
|
|
2532
|
+
), E.push(...m.current), E;
|
|
2533
|
+
}, [
|
|
2534
|
+
n,
|
|
2535
|
+
i,
|
|
2536
|
+
a,
|
|
2537
|
+
s,
|
|
2538
|
+
o,
|
|
2539
|
+
u,
|
|
2540
|
+
l,
|
|
2541
|
+
c,
|
|
2542
|
+
x,
|
|
2543
|
+
T
|
|
2544
|
+
]), A = ur({
|
|
2545
|
+
open: e,
|
|
2546
|
+
placement: t,
|
|
2547
|
+
strategy: r,
|
|
2548
|
+
middleware: H,
|
|
2549
|
+
whileElementsMounted: p ?? void 0,
|
|
2550
|
+
transform: v
|
|
2551
|
+
});
|
|
2552
|
+
ne(() => {
|
|
2553
|
+
if (!e) return;
|
|
2554
|
+
const E = S.current;
|
|
2555
|
+
if (!E) return;
|
|
2556
|
+
const O = (M) => {
|
|
2557
|
+
var U, Z;
|
|
2558
|
+
if (M.button === 2) return;
|
|
2559
|
+
const I = M.target, D = A.refs.reference.current;
|
|
2560
|
+
if (!(D != null && D.contains(I)) && !((U = A.refs.floating.current) != null && U.contains(I))) {
|
|
2561
|
+
for (const G of E.ignoreFloatingRefs || [])
|
|
2562
|
+
if ((Z = G == null ? void 0 : G.current) != null && Z.contains(I)) return;
|
|
2563
|
+
E.onDismiss();
|
|
2564
|
+
}
|
|
2565
|
+
};
|
|
2566
|
+
return document.addEventListener("pointerdown", O, !0), () => {
|
|
2567
|
+
document.removeEventListener("pointerdown", O, !0);
|
|
2568
|
+
};
|
|
2569
|
+
}, [e, A.refs.reference, A.refs.floating]);
|
|
2570
|
+
const y = Zt();
|
|
2571
|
+
return lr({
|
|
2572
|
+
id: `anchored-popover:${y}`,
|
|
2573
|
+
isOpen: !!(e && b),
|
|
2574
|
+
onDismiss: () => {
|
|
2575
|
+
var E;
|
|
2576
|
+
(E = S.current) == null || E.onDismiss();
|
|
2577
|
+
}
|
|
2578
|
+
}), A;
|
|
2579
|
+
}
|
|
2580
|
+
function Js(e) {
|
|
2581
|
+
return e || (typeof document > "u" ? null : document.querySelector(".pagehub-sdk-root") ?? document.body);
|
|
2582
|
+
}
|
|
2583
|
+
const Qs = 75;
|
|
2584
|
+
function eo(e) {
|
|
2585
|
+
return e ? e instanceof HTMLElement ? e : e.current ?? null : null;
|
|
2586
|
+
}
|
|
2587
|
+
function po({
|
|
2588
|
+
open: e,
|
|
2589
|
+
onOpenChange: t,
|
|
2590
|
+
anchor: r,
|
|
2591
|
+
anchorRect: n,
|
|
2592
|
+
placement: i = "bottom-start",
|
|
2593
|
+
mainAxisOffset: a = 4,
|
|
2594
|
+
crossAxisOffset: s = 0,
|
|
2595
|
+
flipOptions: o,
|
|
2596
|
+
shiftPadding: u = 8,
|
|
2597
|
+
boundary: l = "clippingAncestors",
|
|
2598
|
+
rootBoundary: c = "viewport",
|
|
2599
|
+
maxHeightCeiling: f,
|
|
2600
|
+
matchAnchorWidth: g,
|
|
2601
|
+
immediate: p = !1,
|
|
2602
|
+
zIndex: b = cr,
|
|
2603
|
+
className: v,
|
|
2604
|
+
style: S,
|
|
2605
|
+
portalTarget: m,
|
|
2606
|
+
ignoreOutsideClicks: x,
|
|
2607
|
+
disableDismiss: T = !1,
|
|
2608
|
+
children: H
|
|
2609
|
+
}) {
|
|
2610
|
+
const [A, y] = de(e), [E, O] = de(e ? "open" : "closed");
|
|
2611
|
+
ne(() => {
|
|
2612
|
+
if (e) {
|
|
2613
|
+
y(!0), O("open");
|
|
2614
|
+
return;
|
|
2615
|
+
}
|
|
2616
|
+
if (O((ze) => ze === "open" ? "closed" : ze), p) {
|
|
2617
|
+
y(!1);
|
|
2618
|
+
return;
|
|
2619
|
+
}
|
|
2620
|
+
const fe = window.setTimeout(() => y(!1), Qs);
|
|
2621
|
+
return () => window.clearTimeout(fe);
|
|
2622
|
+
}, [e, p]);
|
|
2623
|
+
const M = Zs({
|
|
2624
|
+
open: A,
|
|
2625
|
+
placement: i,
|
|
2626
|
+
mainAxisOffset: a,
|
|
2627
|
+
crossAxisOffset: s,
|
|
2628
|
+
flipOptions: o,
|
|
2629
|
+
shiftPadding: u,
|
|
2630
|
+
boundary: l,
|
|
2631
|
+
rootBoundary: c,
|
|
2632
|
+
maxHeightCeiling: f,
|
|
2633
|
+
matchReferenceMinMaxWidth: g,
|
|
2634
|
+
dismiss: T ? void 0 : { onDismiss: () => t(!1), ignoreFloatingRefs: x }
|
|
2635
|
+
});
|
|
2636
|
+
Jt(() => {
|
|
2637
|
+
A && (n ? M.refs.setReference({
|
|
2638
|
+
getBoundingClientRect: () => n
|
|
2639
|
+
}) : M.refs.setReference(eo(r)), M.update());
|
|
2640
|
+
}, [A, r, n]);
|
|
2641
|
+
const I = ae(() => Js(m), [m]), D = nr(), [U, Z] = de(null), G = Qt(
|
|
2642
|
+
(fe) => {
|
|
2643
|
+
M.refs.setFloating(fe), Z(fe);
|
|
2644
|
+
},
|
|
2645
|
+
[M.refs]
|
|
2646
|
+
);
|
|
2647
|
+
if (ne(() => {
|
|
2648
|
+
if (!(!U || !D))
|
|
2649
|
+
return D(U);
|
|
2650
|
+
}, [U, D]), !A || !I) return null;
|
|
2651
|
+
const Xt = {
|
|
2652
|
+
...M.floatingStyles,
|
|
2653
|
+
zIndex: b,
|
|
2654
|
+
...S
|
|
2655
|
+
};
|
|
2656
|
+
return rr.createPortal(
|
|
2657
|
+
/* @__PURE__ */ tr(
|
|
2658
|
+
"div",
|
|
2659
|
+
{
|
|
2660
|
+
ref: G,
|
|
2661
|
+
"data-ph-popover": "",
|
|
2662
|
+
"data-state": E,
|
|
2663
|
+
style: Xt,
|
|
2664
|
+
className: v,
|
|
2665
|
+
children: H
|
|
2666
|
+
}
|
|
2667
|
+
),
|
|
2668
|
+
I
|
|
2669
|
+
);
|
|
2670
|
+
}
|
|
2671
|
+
export {
|
|
2672
|
+
po as A,
|
|
2673
|
+
co as S,
|
|
2674
|
+
ho as a,
|
|
2675
|
+
Zs as u
|
|
2676
|
+
};
|