vue-pane 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +424 -0
- package/dist/src/components/PButton.vue.d.ts +11 -0
- package/dist/src/components/PCheckbox.vue.d.ts +15 -0
- package/dist/src/components/PColor.vue.d.ts +16 -0
- package/dist/src/components/PFolder.vue.d.ts +27 -0
- package/dist/src/components/PGraph.vue.d.ts +10 -0
- package/dist/src/components/PLabel.vue.d.ts +17 -0
- package/dist/src/components/PMonitor.vue.d.ts +8 -0
- package/dist/src/components/PMonitorMulti.vue.d.ts +8 -0
- package/dist/src/components/PNumber.vue.d.ts +18 -0
- package/dist/src/components/PPoint2d.vue.d.ts +26 -0
- package/dist/src/components/PSelect.vue.d.ts +19 -0
- package/dist/src/components/PSeparator.vue.d.ts +3 -0
- package/dist/src/components/PSlider.vue.d.ts +18 -0
- package/dist/src/components/PTab.vue.d.ts +25 -0
- package/dist/src/components/PText.vue.d.ts +15 -0
- package/dist/src/components/PTooltipIcon.vue.d.ts +3 -0
- package/dist/src/components/VPane.vue.d.ts +28 -0
- package/dist/src/composables/useFoldable.d.ts +5 -0
- package/dist/src/composables/usePaneConfig.d.ts +8 -0
- package/dist/src/composables/usePickerFold.d.ts +2 -0
- package/dist/src/composables/useTooltip.d.ts +19 -0
- package/dist/src/index.d.ts +19 -0
- package/dist/vue-pane.css +2 -0
- package/dist/vue-pane.js +3076 -0
- package/dist/vue-pane.umd.cjs +1 -0
- package/package.json +79 -0
- package/src/components/PButton.vue +53 -0
- package/src/components/PCheckbox.vue +37 -0
- package/src/components/PColor.vue +107 -0
- package/src/components/PConfig.vue +10 -0
- package/src/components/PFolder.vue +81 -0
- package/src/components/PGraph.vue +49 -0
- package/src/components/PLabel.vue +50 -0
- package/src/components/PMonitor.vue +28 -0
- package/src/components/PMonitorMulti.vue +30 -0
- package/src/components/PNumber.vue +162 -0
- package/src/components/PPoint2d.vue +191 -0
- package/src/components/PSelect.vue +44 -0
- package/src/components/PSeparator.vue +8 -0
- package/src/components/PSlider.vue +96 -0
- package/src/components/PTab.vue +73 -0
- package/src/components/PText.vue +30 -0
- package/src/components/PTooltipIcon.vue +30 -0
- package/src/components/VPane.vue +61 -0
- package/src/composables/useFoldable.ts +128 -0
- package/src/composables/usePaneConfig.ts +25 -0
- package/src/composables/usePickerFold.ts +46 -0
- package/src/composables/useTooltip.ts +27 -0
- package/src/index.ts +38 -0
- package/src/styles/_vp.scss +12 -0
- package/src/styles/common/_defs.scss +56 -0
- package/src/styles/index.scss +1 -0
- package/src/styles/view/_button.scss +12 -0
- package/src/styles/view/_checkbox.scss +54 -0
- package/src/styles/view/_color.scss +57 -0
- package/src/styles/view/_folder.scss +70 -0
- package/src/styles/view/_graph.scss +11 -0
- package/src/styles/view/_label.scss +37 -0
- package/src/styles/view/_list.scss +17 -0
- package/src/styles/view/_log.scss +13 -0
- package/src/styles/view/_monitor-multi.scss +18 -0
- package/src/styles/view/_number.scss +110 -0
- package/src/styles/view/_point-2d.scss +61 -0
- package/src/styles/view/_root.scss +126 -0
- package/src/styles/view/_separator.scss +15 -0
- package/src/styles/view/_slider.scss +32 -0
- package/src/styles/view/_tab.scss +139 -0
- package/src/styles/view/_text.scss +24 -0
- package/src/styles/view/_tooltip.scss +17 -0
- package/src/styles/view/_views.scss +2 -0
- package/src/styles/view/placeholder/_button.scss +28 -0
- package/src/styles/view/placeholder/_container.scss +80 -0
- package/src/styles/view/placeholder/_folder.scss +102 -0
- package/src/styles/view/placeholder/_input.scss +26 -0
- package/src/styles/view/placeholder/_list.scss +35 -0
- package/src/styles/view/placeholder/_monitor.scss +26 -0
- package/src/styles/view/placeholder/_texts.scss +11 -0
- package/src/styles/view/placeholder/_theme.scss +111 -0
package/dist/vue-pane.js
ADDED
|
@@ -0,0 +1,3076 @@
|
|
|
1
|
+
import * as e from "vue";
|
|
2
|
+
import { Fragment as t, Teleport as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, inject as d, isRef as f, mergeModels as p, nextTick as m, normalizeClass as h, normalizeStyle as g, onMounted as _, onUnmounted as v, openBlock as y, provide as b, ref as x, renderList as S, renderSlot as C, resolveDynamicComponent as w, toDisplayString as T, unref as E, useCssVars as D, useModel as O, useTemplateRef as ee, vModelText as te, vShow as ne, watch as k, withCtx as A, withDirectives as re, withKeys as ie } from "vue";
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
4
|
+
var ae = Object.defineProperty, oe = Object.getOwnPropertyDescriptor, se = Object.getOwnPropertyNames, ce = Object.prototype.hasOwnProperty, le = (e, t) => {
|
|
5
|
+
let n = {};
|
|
6
|
+
for (var r in e) ae(n, r, {
|
|
7
|
+
get: e[r],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
return t || ae(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
11
|
+
}, ue = (e, t, n, r) => {
|
|
12
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = se(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !ce.call(e, s) && s !== n && ae(e, s, {
|
|
13
|
+
get: ((e) => t[e]).bind(null, s),
|
|
14
|
+
enumerable: !(r = oe(t, s)) || r.enumerable
|
|
15
|
+
});
|
|
16
|
+
return e;
|
|
17
|
+
}, de = (e, t, n) => (ue(e, t, "default"), n && ue(n, t, "default")), fe = (e, t) => {
|
|
18
|
+
let n = e.__vccOpts || e;
|
|
19
|
+
for (let [e, r] of t) n[e] = r;
|
|
20
|
+
return n;
|
|
21
|
+
}, pe = {}, me = {
|
|
22
|
+
viewBox: "0 0 16 16",
|
|
23
|
+
width: "10",
|
|
24
|
+
height: "10",
|
|
25
|
+
fill: "none"
|
|
26
|
+
};
|
|
27
|
+
function he(e, t) {
|
|
28
|
+
return y(), o("svg", me, [...t[0] ||= [
|
|
29
|
+
s("circle", {
|
|
30
|
+
cx: "8",
|
|
31
|
+
cy: "8",
|
|
32
|
+
r: "7",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
"stroke-width": "1.5"
|
|
35
|
+
}, null, -1),
|
|
36
|
+
s("circle", {
|
|
37
|
+
cx: "8",
|
|
38
|
+
cy: "5.5",
|
|
39
|
+
r: "1",
|
|
40
|
+
fill: "currentColor"
|
|
41
|
+
}, null, -1),
|
|
42
|
+
s("rect", {
|
|
43
|
+
x: "7",
|
|
44
|
+
y: "7.5",
|
|
45
|
+
width: "2",
|
|
46
|
+
height: "4",
|
|
47
|
+
rx: "1",
|
|
48
|
+
fill: "currentColor"
|
|
49
|
+
}, null, -1)
|
|
50
|
+
]]);
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/composables/usePaneConfig.ts
|
|
54
|
+
var ge = {
|
|
55
|
+
expandedDefault: !0,
|
|
56
|
+
tooltipIcon: /* @__PURE__ */ fe(pe, [["render", he]])
|
|
57
|
+
}, _e = Symbol("vp-config");
|
|
58
|
+
function j() {
|
|
59
|
+
return d(_e, ge);
|
|
60
|
+
}
|
|
61
|
+
function ve(e = null) {
|
|
62
|
+
b(_e, {
|
|
63
|
+
...j(),
|
|
64
|
+
...e
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/composables/useFoldable.ts
|
|
69
|
+
function ye(e, t) {
|
|
70
|
+
let n = e.parentElement;
|
|
71
|
+
if (!n) return 0;
|
|
72
|
+
let r = n.classList.contains(t);
|
|
73
|
+
e.style.transition = "none", r || (n.classList.add(t), e.style.height = "auto"), e.offsetHeight;
|
|
74
|
+
let i = e.clientHeight;
|
|
75
|
+
return r || (n.classList.remove(t), e.style.height = ""), e.offsetHeight, e.style.transition = "", i;
|
|
76
|
+
}
|
|
77
|
+
function be(e, t, n, r = "vp-folder--expanded") {
|
|
78
|
+
let i = null;
|
|
79
|
+
n && (i = localStorage?.getItem?.(n) ?? null);
|
|
80
|
+
let a = j(), o = (e) => t.value = e, s = t.value, c = x(s === void 0 ? i === null ? a.expandedDefault ?? !0 : i === "true" : s);
|
|
81
|
+
k(c, (e) => {
|
|
82
|
+
n && typeof localStorage < "u" && localStorage.setItem(n, String(e)), o(e);
|
|
83
|
+
}), _(() => {
|
|
84
|
+
let t = e.value;
|
|
85
|
+
t && c.value && (t.style.height = "auto");
|
|
86
|
+
});
|
|
87
|
+
function l(e) {
|
|
88
|
+
let t = ye(e, r);
|
|
89
|
+
c.value = !0, m(() => {
|
|
90
|
+
if (t === 0) {
|
|
91
|
+
e.style.height = "auto";
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
e.style.paddingTop = "0", e.style.paddingBottom = "0", e.offsetHeight, e.style.height = t + "px", e.style.paddingTop = "", e.style.paddingBottom = "", e.addEventListener("transitionend", (t) => {
|
|
95
|
+
t.propertyName === "height" && c.value && (e.style.height = "auto");
|
|
96
|
+
}, { once: !0 });
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function u(e) {
|
|
100
|
+
e.style.transition = "none", e.style.height = e.clientHeight + "px", e.offsetHeight, e.style.transition = "", e.offsetHeight, e.style.height = "0", c.value = !1, e.addEventListener("transitionend", (t) => {
|
|
101
|
+
t.propertyName === "height" && (e.style.height = "");
|
|
102
|
+
}, { once: !0 });
|
|
103
|
+
}
|
|
104
|
+
k(() => t.value, (t) => {
|
|
105
|
+
if (t === void 0 || t === c.value) return;
|
|
106
|
+
let n = e.value;
|
|
107
|
+
n && (t ? l(n) : u(n));
|
|
108
|
+
});
|
|
109
|
+
function d() {
|
|
110
|
+
let t = e.value;
|
|
111
|
+
t && (c.value ? u(t) : l(t));
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
isExpanded: c,
|
|
115
|
+
toggle: d
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region src/components/VPane.vue
|
|
120
|
+
var xe = /* @__PURE__ */ u({
|
|
121
|
+
__name: "VPane",
|
|
122
|
+
props: /*@__PURE__*/ p({
|
|
123
|
+
title: {},
|
|
124
|
+
id: {},
|
|
125
|
+
disabled: { type: Boolean },
|
|
126
|
+
config: {}
|
|
127
|
+
}, {
|
|
128
|
+
expanded: {
|
|
129
|
+
type: Boolean,
|
|
130
|
+
default: void 0
|
|
131
|
+
},
|
|
132
|
+
expandedModifiers: {}
|
|
133
|
+
}),
|
|
134
|
+
emits: ["update:expanded"],
|
|
135
|
+
setup(e) {
|
|
136
|
+
let t = O(e, "expanded");
|
|
137
|
+
e.config && ve(e.config);
|
|
138
|
+
let n = e.id ?? e.title, i = r(() => !!e.title), l = x(null), { isExpanded: u, toggle: d } = be(l, t, n ? `vp-pane-${n}` : void 0);
|
|
139
|
+
return (t, n) => (y(), o("div", { class: h(["vp-pane", {
|
|
140
|
+
"vp-pane--expanded": E(u),
|
|
141
|
+
"vp-pane--no-title": !i.value,
|
|
142
|
+
"vp--disabled": e.disabled
|
|
143
|
+
}]) }, [i.value ? (y(), o("button", {
|
|
144
|
+
key: 0,
|
|
145
|
+
class: "vp-pane__title",
|
|
146
|
+
onClick: n[0] ||= (...e) => E(d) && E(d)(...e)
|
|
147
|
+
}, [c(T(e.title) + " ", 1), n[1] ||= s("div", { class: "vp-pane__chevron" }, null, -1)])) : a("", !0), s("div", {
|
|
148
|
+
ref_key: "containerRef",
|
|
149
|
+
ref: l,
|
|
150
|
+
class: "vp-pane__content"
|
|
151
|
+
}, [C(t.$slots, "default")], 512)], 2));
|
|
152
|
+
}
|
|
153
|
+
}), Se = Math.min, Ce = Math.max, we = Math.round, M = (e) => ({
|
|
154
|
+
x: e,
|
|
155
|
+
y: e
|
|
156
|
+
}), Te = {
|
|
157
|
+
left: "right",
|
|
158
|
+
right: "left",
|
|
159
|
+
bottom: "top",
|
|
160
|
+
top: "bottom"
|
|
161
|
+
};
|
|
162
|
+
function Ee(e, t, n) {
|
|
163
|
+
return Ce(e, Se(t, n));
|
|
164
|
+
}
|
|
165
|
+
function De(e, t) {
|
|
166
|
+
return typeof e == "function" ? e(t) : e;
|
|
167
|
+
}
|
|
168
|
+
function N(e) {
|
|
169
|
+
return e.split("-")[0];
|
|
170
|
+
}
|
|
171
|
+
function Oe(e) {
|
|
172
|
+
return e.split("-")[1];
|
|
173
|
+
}
|
|
174
|
+
function ke(e) {
|
|
175
|
+
return e === "x" ? "y" : "x";
|
|
176
|
+
}
|
|
177
|
+
function Ae(e) {
|
|
178
|
+
return e === "y" ? "height" : "width";
|
|
179
|
+
}
|
|
180
|
+
function P(e) {
|
|
181
|
+
let t = e[0];
|
|
182
|
+
return t === "t" || t === "b" ? "y" : "x";
|
|
183
|
+
}
|
|
184
|
+
function je(e) {
|
|
185
|
+
return ke(P(e));
|
|
186
|
+
}
|
|
187
|
+
function Me(e, t, n) {
|
|
188
|
+
n === void 0 && (n = !1);
|
|
189
|
+
let r = Oe(e), i = je(e), a = Ae(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
190
|
+
return t.reference[a] > t.floating[a] && (o = Ve(o)), [o, Ve(o)];
|
|
191
|
+
}
|
|
192
|
+
function Ne(e) {
|
|
193
|
+
let t = Ve(e);
|
|
194
|
+
return [
|
|
195
|
+
Pe(e),
|
|
196
|
+
t,
|
|
197
|
+
Pe(t)
|
|
198
|
+
];
|
|
199
|
+
}
|
|
200
|
+
function Pe(e) {
|
|
201
|
+
return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
|
|
202
|
+
}
|
|
203
|
+
var Fe = ["left", "right"], Ie = ["right", "left"], Le = ["top", "bottom"], Re = ["bottom", "top"];
|
|
204
|
+
function ze(e, t, n) {
|
|
205
|
+
switch (e) {
|
|
206
|
+
case "top":
|
|
207
|
+
case "bottom": return n ? t ? Ie : Fe : t ? Fe : Ie;
|
|
208
|
+
case "left":
|
|
209
|
+
case "right": return t ? Le : Re;
|
|
210
|
+
default: return [];
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function Be(e, t, n, r) {
|
|
214
|
+
let i = Oe(e), a = ze(N(e), n === "start", r);
|
|
215
|
+
return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(Pe)))), a;
|
|
216
|
+
}
|
|
217
|
+
function Ve(e) {
|
|
218
|
+
let t = N(e);
|
|
219
|
+
return Te[t] + e.slice(t.length);
|
|
220
|
+
}
|
|
221
|
+
function He(e) {
|
|
222
|
+
return {
|
|
223
|
+
top: 0,
|
|
224
|
+
right: 0,
|
|
225
|
+
bottom: 0,
|
|
226
|
+
left: 0,
|
|
227
|
+
...e
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
function Ue(e) {
|
|
231
|
+
return typeof e == "number" ? {
|
|
232
|
+
top: e,
|
|
233
|
+
right: e,
|
|
234
|
+
bottom: e,
|
|
235
|
+
left: e
|
|
236
|
+
} : He(e);
|
|
237
|
+
}
|
|
238
|
+
function We(e) {
|
|
239
|
+
let { x: t, y: n, width: r, height: i } = e;
|
|
240
|
+
return {
|
|
241
|
+
width: r,
|
|
242
|
+
height: i,
|
|
243
|
+
top: n,
|
|
244
|
+
left: t,
|
|
245
|
+
right: t + r,
|
|
246
|
+
bottom: n + i,
|
|
247
|
+
x: t,
|
|
248
|
+
y: n
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region node_modules/.pnpm/@floating-ui+core@1.7.5/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
253
|
+
function Ge(e, t, n) {
|
|
254
|
+
let { reference: r, floating: i } = e, a = P(t), o = je(t), s = Ae(o), c = N(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
|
|
255
|
+
switch (c) {
|
|
256
|
+
case "top":
|
|
257
|
+
p = {
|
|
258
|
+
x: u,
|
|
259
|
+
y: r.y - i.height
|
|
260
|
+
};
|
|
261
|
+
break;
|
|
262
|
+
case "bottom":
|
|
263
|
+
p = {
|
|
264
|
+
x: u,
|
|
265
|
+
y: r.y + r.height
|
|
266
|
+
};
|
|
267
|
+
break;
|
|
268
|
+
case "right":
|
|
269
|
+
p = {
|
|
270
|
+
x: r.x + r.width,
|
|
271
|
+
y: d
|
|
272
|
+
};
|
|
273
|
+
break;
|
|
274
|
+
case "left":
|
|
275
|
+
p = {
|
|
276
|
+
x: r.x - i.width,
|
|
277
|
+
y: d
|
|
278
|
+
};
|
|
279
|
+
break;
|
|
280
|
+
default: p = {
|
|
281
|
+
x: r.x,
|
|
282
|
+
y: r.y
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
switch (Oe(t)) {
|
|
286
|
+
case "start":
|
|
287
|
+
p[o] -= f * (n && l ? -1 : 1);
|
|
288
|
+
break;
|
|
289
|
+
case "end":
|
|
290
|
+
p[o] += f * (n && l ? -1 : 1);
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
return p;
|
|
294
|
+
}
|
|
295
|
+
async function Ke(e, t) {
|
|
296
|
+
t === void 0 && (t = {});
|
|
297
|
+
let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = De(t, e), p = Ue(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = We(await i.getClippingRect({
|
|
298
|
+
element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
|
|
299
|
+
boundary: c,
|
|
300
|
+
rootBoundary: l,
|
|
301
|
+
strategy: s
|
|
302
|
+
})), g = u === "floating" ? {
|
|
303
|
+
x: n,
|
|
304
|
+
y: r,
|
|
305
|
+
width: a.floating.width,
|
|
306
|
+
height: a.floating.height
|
|
307
|
+
} : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
|
|
308
|
+
x: 1,
|
|
309
|
+
y: 1
|
|
310
|
+
}, y = We(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
311
|
+
elements: o,
|
|
312
|
+
rect: g,
|
|
313
|
+
offsetParent: _,
|
|
314
|
+
strategy: s
|
|
315
|
+
}) : g);
|
|
316
|
+
return {
|
|
317
|
+
top: (h.top - y.top + p.top) / v.y,
|
|
318
|
+
bottom: (y.bottom - h.bottom + p.bottom) / v.y,
|
|
319
|
+
left: (h.left - y.left + p.left) / v.x,
|
|
320
|
+
right: (y.right - h.right + p.right) / v.x
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
var qe = 50, Je = async (e, t, n) => {
|
|
324
|
+
let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
|
|
325
|
+
...o,
|
|
326
|
+
detectOverflow: Ke
|
|
327
|
+
}, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
|
|
328
|
+
reference: e,
|
|
329
|
+
floating: t,
|
|
330
|
+
strategy: i
|
|
331
|
+
}), { x: u, y: d } = Ge(l, r, c), f = r, p = 0, m = {};
|
|
332
|
+
for (let n = 0; n < a.length; n++) {
|
|
333
|
+
let h = a[n];
|
|
334
|
+
if (!h) continue;
|
|
335
|
+
let { name: g, fn: _ } = h, { x: v, y, data: b, reset: x } = await _({
|
|
336
|
+
x: u,
|
|
337
|
+
y: d,
|
|
338
|
+
initialPlacement: r,
|
|
339
|
+
placement: f,
|
|
340
|
+
strategy: i,
|
|
341
|
+
middlewareData: m,
|
|
342
|
+
rects: l,
|
|
343
|
+
platform: s,
|
|
344
|
+
elements: {
|
|
345
|
+
reference: e,
|
|
346
|
+
floating: t
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
u = v ?? u, d = y ?? d, m[g] = {
|
|
350
|
+
...m[g],
|
|
351
|
+
...b
|
|
352
|
+
}, x && p < qe && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
|
|
353
|
+
reference: e,
|
|
354
|
+
floating: t,
|
|
355
|
+
strategy: i
|
|
356
|
+
}) : x.rects), {x: u, y: d} = Ge(l, f, c)), n = -1);
|
|
357
|
+
}
|
|
358
|
+
return {
|
|
359
|
+
x: u,
|
|
360
|
+
y: d,
|
|
361
|
+
placement: f,
|
|
362
|
+
strategy: i,
|
|
363
|
+
middlewareData: m
|
|
364
|
+
};
|
|
365
|
+
}, Ye = function(e) {
|
|
366
|
+
return e === void 0 && (e = {}), {
|
|
367
|
+
name: "flip",
|
|
368
|
+
options: e,
|
|
369
|
+
async fn(t) {
|
|
370
|
+
var n;
|
|
371
|
+
let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = De(e, t);
|
|
372
|
+
if ((n = i.arrow) != null && n.alignmentOffset) return {};
|
|
373
|
+
let g = N(r), _ = P(o), v = N(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [Ve(o)] : Ne(o)), x = p !== "none";
|
|
374
|
+
!d && x && b.push(...Be(o, m, p, y));
|
|
375
|
+
let S = [o, ...b], C = await s.detectOverflow(t, h), w = [], T = i.flip?.overflows || [];
|
|
376
|
+
if (l && w.push(C[g]), u) {
|
|
377
|
+
let e = Me(r, a, y);
|
|
378
|
+
w.push(C[e[0]], C[e[1]]);
|
|
379
|
+
}
|
|
380
|
+
if (T = [...T, {
|
|
381
|
+
placement: r,
|
|
382
|
+
overflows: w
|
|
383
|
+
}], !w.every((e) => e <= 0)) {
|
|
384
|
+
let e = (i.flip?.index || 0) + 1, t = S[e];
|
|
385
|
+
if (t && (!(u === "alignment" && _ !== P(t)) || T.every((e) => P(e.placement) === _ ? e.overflows[0] > 0 : !0))) return {
|
|
386
|
+
data: {
|
|
387
|
+
index: e,
|
|
388
|
+
overflows: T
|
|
389
|
+
},
|
|
390
|
+
reset: { placement: t }
|
|
391
|
+
};
|
|
392
|
+
let n = T.filter((e) => e.overflows[0] <= 0).sort((e, t) => e.overflows[1] - t.overflows[1])[0]?.placement;
|
|
393
|
+
if (!n) switch (f) {
|
|
394
|
+
case "bestFit": {
|
|
395
|
+
let e = T.filter((e) => {
|
|
396
|
+
if (x) {
|
|
397
|
+
let t = P(e.placement);
|
|
398
|
+
return t === _ || t === "y";
|
|
399
|
+
}
|
|
400
|
+
return !0;
|
|
401
|
+
}).map((e) => [e.placement, e.overflows.filter((e) => e > 0).reduce((e, t) => e + t, 0)]).sort((e, t) => e[1] - t[1])[0]?.[0];
|
|
402
|
+
e && (n = e);
|
|
403
|
+
break;
|
|
404
|
+
}
|
|
405
|
+
case "initialPlacement":
|
|
406
|
+
n = o;
|
|
407
|
+
break;
|
|
408
|
+
}
|
|
409
|
+
if (r !== n) return { reset: { placement: n } };
|
|
410
|
+
}
|
|
411
|
+
return {};
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
}, Xe = /*#__PURE__*/ new Set(["left", "top"]);
|
|
415
|
+
async function Ze(e, t) {
|
|
416
|
+
let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = N(n), s = Oe(n), c = P(n) === "y", l = Xe.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = De(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
|
|
417
|
+
mainAxis: d,
|
|
418
|
+
crossAxis: 0,
|
|
419
|
+
alignmentAxis: null
|
|
420
|
+
} : {
|
|
421
|
+
mainAxis: d.mainAxis || 0,
|
|
422
|
+
crossAxis: d.crossAxis || 0,
|
|
423
|
+
alignmentAxis: d.alignmentAxis
|
|
424
|
+
};
|
|
425
|
+
return s && typeof m == "number" && (p = s === "end" ? m * -1 : m), c ? {
|
|
426
|
+
x: p * u,
|
|
427
|
+
y: f * l
|
|
428
|
+
} : {
|
|
429
|
+
x: f * l,
|
|
430
|
+
y: p * u
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
var Qe = function(e) {
|
|
434
|
+
return e === void 0 && (e = 0), {
|
|
435
|
+
name: "offset",
|
|
436
|
+
options: e,
|
|
437
|
+
async fn(t) {
|
|
438
|
+
var n;
|
|
439
|
+
let { x: r, y: i, placement: a, middlewareData: o } = t, s = await Ze(t, e);
|
|
440
|
+
return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
|
|
441
|
+
x: r + s.x,
|
|
442
|
+
y: i + s.y,
|
|
443
|
+
data: {
|
|
444
|
+
...s,
|
|
445
|
+
placement: a
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
};
|
|
450
|
+
}, $e = function(e) {
|
|
451
|
+
return e === void 0 && (e = {}), {
|
|
452
|
+
name: "shift",
|
|
453
|
+
options: e,
|
|
454
|
+
async fn(t) {
|
|
455
|
+
let { x: n, y: r, placement: i, platform: a } = t, { mainAxis: o = !0, crossAxis: s = !1, limiter: c = { fn: (e) => {
|
|
456
|
+
let { x: t, y: n } = e;
|
|
457
|
+
return {
|
|
458
|
+
x: t,
|
|
459
|
+
y: n
|
|
460
|
+
};
|
|
461
|
+
} }, ...l } = De(e, t), u = {
|
|
462
|
+
x: n,
|
|
463
|
+
y: r
|
|
464
|
+
}, d = await a.detectOverflow(t, l), f = P(N(i)), p = ke(f), m = u[p], h = u[f];
|
|
465
|
+
if (o) {
|
|
466
|
+
let e = p === "y" ? "top" : "left", t = p === "y" ? "bottom" : "right", n = m + d[e], r = m - d[t];
|
|
467
|
+
m = Ee(n, m, r);
|
|
468
|
+
}
|
|
469
|
+
if (s) {
|
|
470
|
+
let e = f === "y" ? "top" : "left", t = f === "y" ? "bottom" : "right", n = h + d[e], r = h - d[t];
|
|
471
|
+
h = Ee(n, h, r);
|
|
472
|
+
}
|
|
473
|
+
let g = c.fn({
|
|
474
|
+
...t,
|
|
475
|
+
[p]: m,
|
|
476
|
+
[f]: h
|
|
477
|
+
});
|
|
478
|
+
return {
|
|
479
|
+
...g,
|
|
480
|
+
data: {
|
|
481
|
+
x: g.x - n,
|
|
482
|
+
y: g.y - r,
|
|
483
|
+
enabled: {
|
|
484
|
+
[p]: o,
|
|
485
|
+
[f]: s
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
//#endregion
|
|
493
|
+
//#region node_modules/.pnpm/@floating-ui+utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
494
|
+
function et() {
|
|
495
|
+
return typeof window < "u";
|
|
496
|
+
}
|
|
497
|
+
function F(e) {
|
|
498
|
+
return tt(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
499
|
+
}
|
|
500
|
+
function I(e) {
|
|
501
|
+
var t;
|
|
502
|
+
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
503
|
+
}
|
|
504
|
+
function L(e) {
|
|
505
|
+
return ((tt(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
|
|
506
|
+
}
|
|
507
|
+
function tt(e) {
|
|
508
|
+
return et() ? e instanceof Node || e instanceof I(e).Node : !1;
|
|
509
|
+
}
|
|
510
|
+
function R(e) {
|
|
511
|
+
return et() ? e instanceof Element || e instanceof I(e).Element : !1;
|
|
512
|
+
}
|
|
513
|
+
function z(e) {
|
|
514
|
+
return et() ? e instanceof HTMLElement || e instanceof I(e).HTMLElement : !1;
|
|
515
|
+
}
|
|
516
|
+
function nt(e) {
|
|
517
|
+
return !et() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof I(e).ShadowRoot;
|
|
518
|
+
}
|
|
519
|
+
function rt(e) {
|
|
520
|
+
let { overflow: t, overflowX: n, overflowY: r, display: i } = V(e);
|
|
521
|
+
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
|
|
522
|
+
}
|
|
523
|
+
function it(e) {
|
|
524
|
+
return /^(table|td|th)$/.test(F(e));
|
|
525
|
+
}
|
|
526
|
+
function at(e) {
|
|
527
|
+
try {
|
|
528
|
+
if (e.matches(":popover-open")) return !0;
|
|
529
|
+
} catch {}
|
|
530
|
+
try {
|
|
531
|
+
return e.matches(":modal");
|
|
532
|
+
} catch {
|
|
533
|
+
return !1;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
var ot = /transform|translate|scale|rotate|perspective|filter/, st = /paint|layout|strict|content/, B = (e) => !!e && e !== "none", ct;
|
|
537
|
+
function lt(e) {
|
|
538
|
+
let t = R(e) ? V(e) : e;
|
|
539
|
+
return B(t.transform) || B(t.translate) || B(t.scale) || B(t.rotate) || B(t.perspective) || !dt() && (B(t.backdropFilter) || B(t.filter)) || ot.test(t.willChange || "") || st.test(t.contain || "");
|
|
540
|
+
}
|
|
541
|
+
function ut(e) {
|
|
542
|
+
let t = H(e);
|
|
543
|
+
for (; z(t) && !ft(t);) {
|
|
544
|
+
if (lt(t)) return t;
|
|
545
|
+
if (at(t)) return null;
|
|
546
|
+
t = H(t);
|
|
547
|
+
}
|
|
548
|
+
return null;
|
|
549
|
+
}
|
|
550
|
+
function dt() {
|
|
551
|
+
return ct ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), ct;
|
|
552
|
+
}
|
|
553
|
+
function ft(e) {
|
|
554
|
+
return /^(html|body|#document)$/.test(F(e));
|
|
555
|
+
}
|
|
556
|
+
function V(e) {
|
|
557
|
+
return I(e).getComputedStyle(e);
|
|
558
|
+
}
|
|
559
|
+
function pt(e) {
|
|
560
|
+
return R(e) ? {
|
|
561
|
+
scrollLeft: e.scrollLeft,
|
|
562
|
+
scrollTop: e.scrollTop
|
|
563
|
+
} : {
|
|
564
|
+
scrollLeft: e.scrollX,
|
|
565
|
+
scrollTop: e.scrollY
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
function H(e) {
|
|
569
|
+
if (F(e) === "html") return e;
|
|
570
|
+
let t = e.assignedSlot || e.parentNode || nt(e) && e.host || L(e);
|
|
571
|
+
return nt(t) ? t.host : t;
|
|
572
|
+
}
|
|
573
|
+
function mt(e) {
|
|
574
|
+
let t = H(e);
|
|
575
|
+
return ft(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : z(t) && rt(t) ? t : mt(t);
|
|
576
|
+
}
|
|
577
|
+
function ht(e, t, n) {
|
|
578
|
+
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
579
|
+
let r = mt(e), i = r === e.ownerDocument?.body, a = I(r);
|
|
580
|
+
if (i) {
|
|
581
|
+
let e = gt(a);
|
|
582
|
+
return t.concat(a, a.visualViewport || [], rt(r) ? r : [], e && n ? ht(e) : []);
|
|
583
|
+
} else return t.concat(r, ht(r, [], n));
|
|
584
|
+
}
|
|
585
|
+
function gt(e) {
|
|
586
|
+
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
587
|
+
}
|
|
588
|
+
//#endregion
|
|
589
|
+
//#region node_modules/.pnpm/@floating-ui+dom@1.7.6/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
590
|
+
function _t(e) {
|
|
591
|
+
let t = V(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = z(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = we(n) !== a || we(r) !== o;
|
|
592
|
+
return s && (n = a, r = o), {
|
|
593
|
+
width: n,
|
|
594
|
+
height: r,
|
|
595
|
+
$: s
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
function vt(e) {
|
|
599
|
+
return R(e) ? e : e.contextElement;
|
|
600
|
+
}
|
|
601
|
+
function yt(e) {
|
|
602
|
+
let t = vt(e);
|
|
603
|
+
if (!z(t)) return M(1);
|
|
604
|
+
let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = _t(t), o = (a ? we(n.width) : n.width) / r, s = (a ? we(n.height) : n.height) / i;
|
|
605
|
+
return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
|
|
606
|
+
x: o,
|
|
607
|
+
y: s
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
var bt = /*#__PURE__*/ M(0);
|
|
611
|
+
function xt(e) {
|
|
612
|
+
let t = I(e);
|
|
613
|
+
return !dt() || !t.visualViewport ? bt : {
|
|
614
|
+
x: t.visualViewport.offsetLeft,
|
|
615
|
+
y: t.visualViewport.offsetTop
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
function St(e, t, n) {
|
|
619
|
+
return t === void 0 && (t = !1), !n || t && n !== I(e) ? !1 : t;
|
|
620
|
+
}
|
|
621
|
+
function Ct(e, t, n, r) {
|
|
622
|
+
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
623
|
+
let i = e.getBoundingClientRect(), a = vt(e), o = M(1);
|
|
624
|
+
t && (r ? R(r) && (o = yt(r)) : o = yt(e));
|
|
625
|
+
let s = St(a, n, r) ? xt(a) : M(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
|
|
626
|
+
if (a) {
|
|
627
|
+
let e = I(a), t = r && R(r) ? I(r) : r, n = e, i = gt(n);
|
|
628
|
+
for (; i && r && t !== n;) {
|
|
629
|
+
let e = yt(i), t = i.getBoundingClientRect(), r = V(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
|
|
630
|
+
c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = I(i), i = gt(n);
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
return We({
|
|
634
|
+
width: u,
|
|
635
|
+
height: d,
|
|
636
|
+
x: c,
|
|
637
|
+
y: l
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
function wt(e, t) {
|
|
641
|
+
let n = pt(e).scrollLeft;
|
|
642
|
+
return t ? t.left + n : Ct(L(e)).left + n;
|
|
643
|
+
}
|
|
644
|
+
function Tt(e, t) {
|
|
645
|
+
let n = e.getBoundingClientRect();
|
|
646
|
+
return {
|
|
647
|
+
x: n.left + t.scrollLeft - wt(e, n),
|
|
648
|
+
y: n.top + t.scrollTop
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
function Et(e) {
|
|
652
|
+
let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = L(r), s = t ? at(t.floating) : !1;
|
|
653
|
+
if (r === o || s && a) return n;
|
|
654
|
+
let c = {
|
|
655
|
+
scrollLeft: 0,
|
|
656
|
+
scrollTop: 0
|
|
657
|
+
}, l = M(1), u = M(0), d = z(r);
|
|
658
|
+
if ((d || !d && !a) && ((F(r) !== "body" || rt(o)) && (c = pt(r)), d)) {
|
|
659
|
+
let e = Ct(r);
|
|
660
|
+
l = yt(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
|
|
661
|
+
}
|
|
662
|
+
let f = o && !d && !a ? Tt(o, c) : M(0);
|
|
663
|
+
return {
|
|
664
|
+
width: n.width * l.x,
|
|
665
|
+
height: n.height * l.y,
|
|
666
|
+
x: n.x * l.x - c.scrollLeft * l.x + u.x + f.x,
|
|
667
|
+
y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
|
|
668
|
+
};
|
|
669
|
+
}
|
|
670
|
+
function Dt(e) {
|
|
671
|
+
return Array.from(e.getClientRects());
|
|
672
|
+
}
|
|
673
|
+
function Ot(e) {
|
|
674
|
+
let t = L(e), n = pt(e), r = e.ownerDocument.body, i = Ce(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = Ce(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + wt(e), s = -n.scrollTop;
|
|
675
|
+
return V(r).direction === "rtl" && (o += Ce(t.clientWidth, r.clientWidth) - i), {
|
|
676
|
+
width: i,
|
|
677
|
+
height: a,
|
|
678
|
+
x: o,
|
|
679
|
+
y: s
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
var kt = 25;
|
|
683
|
+
function At(e, t) {
|
|
684
|
+
let n = I(e), r = L(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
|
|
685
|
+
if (i) {
|
|
686
|
+
a = i.width, o = i.height;
|
|
687
|
+
let e = dt();
|
|
688
|
+
(!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
|
|
689
|
+
}
|
|
690
|
+
let l = wt(r);
|
|
691
|
+
if (l <= 0) {
|
|
692
|
+
let e = r.ownerDocument, t = e.body, n = getComputedStyle(t), i = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, o = Math.abs(r.clientWidth - t.clientWidth - i);
|
|
693
|
+
o <= kt && (a -= o);
|
|
694
|
+
} else l <= kt && (a += l);
|
|
695
|
+
return {
|
|
696
|
+
width: a,
|
|
697
|
+
height: o,
|
|
698
|
+
x: s,
|
|
699
|
+
y: c
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
function jt(e, t) {
|
|
703
|
+
let n = Ct(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = z(e) ? yt(e) : M(1);
|
|
704
|
+
return {
|
|
705
|
+
width: e.clientWidth * a.x,
|
|
706
|
+
height: e.clientHeight * a.y,
|
|
707
|
+
x: i * a.x,
|
|
708
|
+
y: r * a.y
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
function Mt(e, t, n) {
|
|
712
|
+
let r;
|
|
713
|
+
if (t === "viewport") r = At(e, n);
|
|
714
|
+
else if (t === "document") r = Ot(L(e));
|
|
715
|
+
else if (R(t)) r = jt(t, n);
|
|
716
|
+
else {
|
|
717
|
+
let n = xt(e);
|
|
718
|
+
r = {
|
|
719
|
+
x: t.x - n.x,
|
|
720
|
+
y: t.y - n.y,
|
|
721
|
+
width: t.width,
|
|
722
|
+
height: t.height
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
return We(r);
|
|
726
|
+
}
|
|
727
|
+
function Nt(e, t) {
|
|
728
|
+
let n = H(e);
|
|
729
|
+
return n === t || !R(n) || ft(n) ? !1 : V(n).position === "fixed" || Nt(n, t);
|
|
730
|
+
}
|
|
731
|
+
function Pt(e, t) {
|
|
732
|
+
let n = t.get(e);
|
|
733
|
+
if (n) return n;
|
|
734
|
+
let r = ht(e, [], !1).filter((e) => R(e) && F(e) !== "body"), i = null, a = V(e).position === "fixed", o = a ? H(e) : e;
|
|
735
|
+
for (; R(o) && !ft(o);) {
|
|
736
|
+
let t = V(o), n = lt(o);
|
|
737
|
+
!n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && (i.position === "absolute" || i.position === "fixed") || rt(o) && !n && Nt(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = H(o);
|
|
738
|
+
}
|
|
739
|
+
return t.set(e, r), r;
|
|
740
|
+
}
|
|
741
|
+
function Ft(e) {
|
|
742
|
+
let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? at(t) ? [] : Pt(t, this._c) : [].concat(n), r], o = Mt(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
|
|
743
|
+
for (let e = 1; e < a.length; e++) {
|
|
744
|
+
let n = Mt(t, a[e], i);
|
|
745
|
+
s = Ce(n.top, s), c = Se(n.right, c), l = Se(n.bottom, l), u = Ce(n.left, u);
|
|
746
|
+
}
|
|
747
|
+
return {
|
|
748
|
+
width: c - u,
|
|
749
|
+
height: l - s,
|
|
750
|
+
x: u,
|
|
751
|
+
y: s
|
|
752
|
+
};
|
|
753
|
+
}
|
|
754
|
+
function It(e) {
|
|
755
|
+
let { width: t, height: n } = _t(e);
|
|
756
|
+
return {
|
|
757
|
+
width: t,
|
|
758
|
+
height: n
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
function Lt(e, t, n) {
|
|
762
|
+
let r = z(t), i = L(t), a = n === "fixed", o = Ct(e, !0, a, t), s = {
|
|
763
|
+
scrollLeft: 0,
|
|
764
|
+
scrollTop: 0
|
|
765
|
+
}, c = M(0);
|
|
766
|
+
function l() {
|
|
767
|
+
c.x = wt(i);
|
|
768
|
+
}
|
|
769
|
+
if (r || !r && !a) if ((F(t) !== "body" || rt(i)) && (s = pt(t)), r) {
|
|
770
|
+
let e = Ct(t, !0, a, t);
|
|
771
|
+
c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
|
|
772
|
+
} else i && l();
|
|
773
|
+
a && !r && i && l();
|
|
774
|
+
let u = i && !r && !a ? Tt(i, s) : M(0);
|
|
775
|
+
return {
|
|
776
|
+
x: o.left + s.scrollLeft - c.x - u.x,
|
|
777
|
+
y: o.top + s.scrollTop - c.y - u.y,
|
|
778
|
+
width: o.width,
|
|
779
|
+
height: o.height
|
|
780
|
+
};
|
|
781
|
+
}
|
|
782
|
+
function Rt(e) {
|
|
783
|
+
return V(e).position === "static";
|
|
784
|
+
}
|
|
785
|
+
function zt(e, t) {
|
|
786
|
+
if (!z(e) || V(e).position === "fixed") return null;
|
|
787
|
+
if (t) return t(e);
|
|
788
|
+
let n = e.offsetParent;
|
|
789
|
+
return L(e) === n && (n = n.ownerDocument.body), n;
|
|
790
|
+
}
|
|
791
|
+
function Bt(e, t) {
|
|
792
|
+
let n = I(e);
|
|
793
|
+
if (at(e)) return n;
|
|
794
|
+
if (!z(e)) {
|
|
795
|
+
let t = H(e);
|
|
796
|
+
for (; t && !ft(t);) {
|
|
797
|
+
if (R(t) && !Rt(t)) return t;
|
|
798
|
+
t = H(t);
|
|
799
|
+
}
|
|
800
|
+
return n;
|
|
801
|
+
}
|
|
802
|
+
let r = zt(e, t);
|
|
803
|
+
for (; r && it(r) && Rt(r);) r = zt(r, t);
|
|
804
|
+
return r && ft(r) && Rt(r) && !lt(r) ? n : r || ut(e) || n;
|
|
805
|
+
}
|
|
806
|
+
var Vt = async function(e) {
|
|
807
|
+
let t = this.getOffsetParent || Bt, n = this.getDimensions, r = await n(e.floating);
|
|
808
|
+
return {
|
|
809
|
+
reference: Lt(e.reference, await t(e.floating), e.strategy),
|
|
810
|
+
floating: {
|
|
811
|
+
x: 0,
|
|
812
|
+
y: 0,
|
|
813
|
+
width: r.width,
|
|
814
|
+
height: r.height
|
|
815
|
+
}
|
|
816
|
+
};
|
|
817
|
+
};
|
|
818
|
+
function Ht(e) {
|
|
819
|
+
return V(e).direction === "rtl";
|
|
820
|
+
}
|
|
821
|
+
var Ut = {
|
|
822
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Et,
|
|
823
|
+
getDocumentElement: L,
|
|
824
|
+
getClippingRect: Ft,
|
|
825
|
+
getOffsetParent: Bt,
|
|
826
|
+
getElementRects: Vt,
|
|
827
|
+
getClientRects: Dt,
|
|
828
|
+
getDimensions: It,
|
|
829
|
+
getScale: yt,
|
|
830
|
+
isElement: R,
|
|
831
|
+
isRTL: Ht
|
|
832
|
+
}, Wt = Qe, Gt = $e, Kt = Ye, qt = (e, t, n) => {
|
|
833
|
+
let r = /* @__PURE__ */ new Map(), i = {
|
|
834
|
+
platform: Ut,
|
|
835
|
+
...n
|
|
836
|
+
}, a = {
|
|
837
|
+
...i.platform,
|
|
838
|
+
_c: r
|
|
839
|
+
};
|
|
840
|
+
return Je(e, t, {
|
|
841
|
+
...i,
|
|
842
|
+
platform: a
|
|
843
|
+
});
|
|
844
|
+
}, U = /* @__PURE__ */ le({
|
|
845
|
+
Vue: () => e,
|
|
846
|
+
Vue2: () => void 0,
|
|
847
|
+
del: () => Zt,
|
|
848
|
+
install: () => Yt,
|
|
849
|
+
isVue2: () => !1,
|
|
850
|
+
isVue3: () => !0,
|
|
851
|
+
set: () => Xt
|
|
852
|
+
});
|
|
853
|
+
import * as Jt from "vue";
|
|
854
|
+
de(U, Jt);
|
|
855
|
+
function Yt() {}
|
|
856
|
+
function Xt(e, t, n) {
|
|
857
|
+
return Array.isArray(e) ? (e.length = Math.max(e.length, t), e.splice(t, 1, n), n) : (e[t] = n, n);
|
|
858
|
+
}
|
|
859
|
+
function Zt(e, t) {
|
|
860
|
+
if (Array.isArray(e)) {
|
|
861
|
+
e.splice(t, 1);
|
|
862
|
+
return;
|
|
863
|
+
}
|
|
864
|
+
delete e[t];
|
|
865
|
+
}
|
|
866
|
+
//#endregion
|
|
867
|
+
//#region node_modules/.pnpm/@floating-ui+vue@1.1.11_vue@3.5.35_typescript@6.0.3_/node_modules/@floating-ui/vue/dist/floating-ui.vue.mjs
|
|
868
|
+
function Qt(e) {
|
|
869
|
+
return typeof e == "object" && !!e && "$el" in e;
|
|
870
|
+
}
|
|
871
|
+
function $t(e) {
|
|
872
|
+
if (Qt(e)) {
|
|
873
|
+
let t = e.$el;
|
|
874
|
+
return tt(t) && F(t) === "#comment" ? null : t;
|
|
875
|
+
}
|
|
876
|
+
return e;
|
|
877
|
+
}
|
|
878
|
+
function en(e) {
|
|
879
|
+
return typeof e == "function" ? e() : (0, U.unref)(e);
|
|
880
|
+
}
|
|
881
|
+
function tn(e) {
|
|
882
|
+
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
883
|
+
}
|
|
884
|
+
function nn(e, t) {
|
|
885
|
+
let n = tn(e);
|
|
886
|
+
return Math.round(t * n) / n;
|
|
887
|
+
}
|
|
888
|
+
function rn(e, t, n) {
|
|
889
|
+
n === void 0 && (n = {});
|
|
890
|
+
let r = n.whileElementsMounted, i = (0, U.computed)(() => en(n.open) ?? !0), a = (0, U.computed)(() => en(n.middleware)), o = (0, U.computed)(() => en(n.placement) ?? "bottom"), s = (0, U.computed)(() => en(n.strategy) ?? "absolute"), c = (0, U.computed)(() => en(n.transform) ?? !0), l = (0, U.computed)(() => $t(e.value)), u = (0, U.computed)(() => $t(t.value)), d = (0, U.ref)(0), f = (0, U.ref)(0), p = (0, U.ref)(s.value), m = (0, U.ref)(o.value), h = (0, U.shallowRef)({}), g = (0, U.ref)(!1), _ = (0, U.computed)(() => {
|
|
891
|
+
let e = {
|
|
892
|
+
position: p.value,
|
|
893
|
+
left: "0",
|
|
894
|
+
top: "0"
|
|
895
|
+
};
|
|
896
|
+
if (!u.value) return e;
|
|
897
|
+
let t = nn(u.value, d.value), n = nn(u.value, f.value);
|
|
898
|
+
return c.value ? {
|
|
899
|
+
...e,
|
|
900
|
+
transform: "translate(" + t + "px, " + n + "px)",
|
|
901
|
+
...tn(u.value) >= 1.5 && { willChange: "transform" }
|
|
902
|
+
} : {
|
|
903
|
+
position: p.value,
|
|
904
|
+
left: t + "px",
|
|
905
|
+
top: n + "px"
|
|
906
|
+
};
|
|
907
|
+
}), v;
|
|
908
|
+
function y() {
|
|
909
|
+
if (l.value == null || u.value == null) return;
|
|
910
|
+
let e = i.value;
|
|
911
|
+
qt(l.value, u.value, {
|
|
912
|
+
middleware: a.value,
|
|
913
|
+
placement: o.value,
|
|
914
|
+
strategy: s.value
|
|
915
|
+
}).then((t) => {
|
|
916
|
+
d.value = t.x, f.value = t.y, p.value = t.strategy, m.value = t.placement, h.value = t.middlewareData, g.value = e !== !1;
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
function b() {
|
|
920
|
+
typeof v == "function" && (v(), v = void 0);
|
|
921
|
+
}
|
|
922
|
+
function x() {
|
|
923
|
+
if (b(), r === void 0) {
|
|
924
|
+
y();
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
if (l.value != null && u.value != null) {
|
|
928
|
+
v = r(l.value, u.value, y);
|
|
929
|
+
return;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
function S() {
|
|
933
|
+
i.value || (g.value = !1);
|
|
934
|
+
}
|
|
935
|
+
return (0, U.watch)([
|
|
936
|
+
a,
|
|
937
|
+
o,
|
|
938
|
+
s,
|
|
939
|
+
i
|
|
940
|
+
], y, { flush: "sync" }), (0, U.watch)([l, u], x, { flush: "sync" }), (0, U.watch)(i, S, { flush: "sync" }), (0, U.getCurrentScope)() && (0, U.onScopeDispose)(b), {
|
|
941
|
+
x: (0, U.shallowReadonly)(d),
|
|
942
|
+
y: (0, U.shallowReadonly)(f),
|
|
943
|
+
strategy: (0, U.shallowReadonly)(p),
|
|
944
|
+
placement: (0, U.shallowReadonly)(m),
|
|
945
|
+
middlewareData: (0, U.shallowReadonly)(h),
|
|
946
|
+
isPositioned: (0, U.shallowReadonly)(g),
|
|
947
|
+
floatingStyles: _,
|
|
948
|
+
update: y
|
|
949
|
+
};
|
|
950
|
+
}
|
|
951
|
+
//#endregion
|
|
952
|
+
//#region src/composables/useTooltip.ts
|
|
953
|
+
function an() {
|
|
954
|
+
let e = x(null), t = ee("floatingEl"), n = x(!1), r = x(void 0), { floatingStyles: i } = rn(e, t, {
|
|
955
|
+
placement: "top-start",
|
|
956
|
+
strategy: "fixed",
|
|
957
|
+
middleware: [
|
|
958
|
+
Wt(4),
|
|
959
|
+
Kt(),
|
|
960
|
+
Gt({ padding: 8 })
|
|
961
|
+
]
|
|
962
|
+
});
|
|
963
|
+
function a(t, i) {
|
|
964
|
+
e.value = t.currentTarget, r.value = i, n.value = !0;
|
|
965
|
+
}
|
|
966
|
+
function o() {
|
|
967
|
+
n.value = !1;
|
|
968
|
+
}
|
|
969
|
+
return {
|
|
970
|
+
floatingStyles: i,
|
|
971
|
+
visible: n,
|
|
972
|
+
activeText: r,
|
|
973
|
+
show: a,
|
|
974
|
+
hide: o
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
//#endregion
|
|
978
|
+
//#region src/components/PFolder.vue
|
|
979
|
+
var on = /* @__PURE__ */ u({
|
|
980
|
+
__name: "PFolder",
|
|
981
|
+
props: /*@__PURE__*/ p({
|
|
982
|
+
title: {},
|
|
983
|
+
tooltip: {},
|
|
984
|
+
id: {},
|
|
985
|
+
disabled: { type: Boolean }
|
|
986
|
+
}, {
|
|
987
|
+
expanded: {
|
|
988
|
+
type: Boolean,
|
|
989
|
+
default: void 0
|
|
990
|
+
},
|
|
991
|
+
expandedModifiers: {}
|
|
992
|
+
}),
|
|
993
|
+
emits: ["update:expanded"],
|
|
994
|
+
setup(e) {
|
|
995
|
+
let t = O(e, "expanded"), r = e.id ?? e.title, l = j(), u = x(null), { isExpanded: d, toggle: f } = be(u, t, r ? `vp-folder-${r}` : void 0), { floatingStyles: p, visible: m, activeText: _, show: v, hide: b } = an();
|
|
996
|
+
return (t, r) => (y(), o("div", { class: h(["vp-folder vp-container", {
|
|
997
|
+
"vp-folder--expanded": E(d),
|
|
998
|
+
"vp--disabled": e.disabled
|
|
999
|
+
}]) }, [
|
|
1000
|
+
s("button", {
|
|
1001
|
+
class: "vp-folder__title",
|
|
1002
|
+
onClick: r[2] ||= (...e) => E(f) && E(f)(...e)
|
|
1003
|
+
}, [s("div", {
|
|
1004
|
+
class: "vp-folder__title-text",
|
|
1005
|
+
onMouseenter: r[0] ||= (t) => e.tooltip && E(v)(t, e.tooltip),
|
|
1006
|
+
onMouseleave: r[1] ||= (...e) => E(b) && E(b)(...e)
|
|
1007
|
+
}, [c(T(e.title) + " ", 1), e.tooltip && E(l).tooltipIcon ? (y(), i(w(E(l).tooltipIcon), { key: 0 })) : a("", !0)], 32), r[3] ||= s("div", { class: "vp-folder__chevron" }, null, -1)]),
|
|
1008
|
+
r[4] ||= s("div", { class: "vp-folder__indent" }, null, -1),
|
|
1009
|
+
s("div", {
|
|
1010
|
+
ref_key: "containerRef",
|
|
1011
|
+
ref: u,
|
|
1012
|
+
class: "vp-folder__content"
|
|
1013
|
+
}, [C(t.$slots, "default")], 512),
|
|
1014
|
+
e.tooltip ? (y(), i(n, {
|
|
1015
|
+
key: 0,
|
|
1016
|
+
to: "body"
|
|
1017
|
+
}, [E(m) ? (y(), o("div", {
|
|
1018
|
+
key: 0,
|
|
1019
|
+
ref: "floatingEl",
|
|
1020
|
+
class: "vp-tooltip",
|
|
1021
|
+
style: g(E(p))
|
|
1022
|
+
}, T(E(_)), 5)) : a("", !0)])) : a("", !0)
|
|
1023
|
+
], 2));
|
|
1024
|
+
}
|
|
1025
|
+
}), sn = { class: "vp-label__text" }, cn = { class: "vp-label__value" }, W = /* @__PURE__ */ u({
|
|
1026
|
+
__name: "PLabel",
|
|
1027
|
+
props: {
|
|
1028
|
+
label: {},
|
|
1029
|
+
tooltip: {}
|
|
1030
|
+
},
|
|
1031
|
+
setup(e) {
|
|
1032
|
+
let { floatingStyles: t, visible: r, activeText: l, show: u, hide: d } = an(), f = j();
|
|
1033
|
+
return (p, m) => (y(), o("div", { class: h(["vp-label", { "vp-label--no-label": !e.label }]) }, [
|
|
1034
|
+
s("div", sn, [c(T(e.label) + " ", 1), e.tooltip && E(f).tooltipIcon ? (y(), i(w(E(f).tooltipIcon), {
|
|
1035
|
+
key: 0,
|
|
1036
|
+
onMouseenter: m[0] ||= (t) => e.tooltip && E(u)(t, e.tooltip),
|
|
1037
|
+
onMouseleave: E(d)
|
|
1038
|
+
}, null, 40, ["onMouseleave"])) : a("", !0)]),
|
|
1039
|
+
s("div", cn, [C(p.$slots, "default")]),
|
|
1040
|
+
e.tooltip ? (y(), i(n, {
|
|
1041
|
+
key: 0,
|
|
1042
|
+
to: "body"
|
|
1043
|
+
}, [E(r) ? (y(), o("div", {
|
|
1044
|
+
key: 0,
|
|
1045
|
+
ref: "floatingEl",
|
|
1046
|
+
class: "vp-tooltip",
|
|
1047
|
+
style: g(E(t))
|
|
1048
|
+
}, T(E(l)), 5)) : a("", !0)])) : a("", !0)
|
|
1049
|
+
], 2));
|
|
1050
|
+
}
|
|
1051
|
+
}), ln = { class: "vp-text" }, un = ["value"], dn = /* @__PURE__ */ u({
|
|
1052
|
+
__name: "PText",
|
|
1053
|
+
props: /*@__PURE__*/ p({
|
|
1054
|
+
label: {},
|
|
1055
|
+
tooltip: {}
|
|
1056
|
+
}, {
|
|
1057
|
+
modelValue: { required: !0 },
|
|
1058
|
+
modelModifiers: {}
|
|
1059
|
+
}),
|
|
1060
|
+
emits: ["update:modelValue"],
|
|
1061
|
+
setup(e) {
|
|
1062
|
+
let t = O(e, "modelValue");
|
|
1063
|
+
return (n, r) => (y(), i(W, {
|
|
1064
|
+
label: e.label,
|
|
1065
|
+
tooltip: e.tooltip
|
|
1066
|
+
}, {
|
|
1067
|
+
default: A(() => [s("div", ln, [s("input", {
|
|
1068
|
+
class: "vp-text__input",
|
|
1069
|
+
type: "text",
|
|
1070
|
+
value: t.value,
|
|
1071
|
+
onInput: r[0] ||= (e) => t.value = e.target.value
|
|
1072
|
+
}, null, 40, un)])]),
|
|
1073
|
+
_: 1
|
|
1074
|
+
}, 8, ["label", "tooltip"]));
|
|
1075
|
+
}
|
|
1076
|
+
}), fn = { class: "vp-text__guide" }, pn = ["d"], mn = ["d"], hn = /* @__PURE__ */ u({
|
|
1077
|
+
__name: "PNumber",
|
|
1078
|
+
props: /*@__PURE__*/ p({
|
|
1079
|
+
label: {},
|
|
1080
|
+
tooltip: {},
|
|
1081
|
+
min: {},
|
|
1082
|
+
max: {},
|
|
1083
|
+
step: { default: 1 }
|
|
1084
|
+
}, {
|
|
1085
|
+
modelValue: { required: !0 },
|
|
1086
|
+
modelModifiers: {}
|
|
1087
|
+
}),
|
|
1088
|
+
emits: ["update:modelValue"],
|
|
1089
|
+
setup(e) {
|
|
1090
|
+
let t = O(e, "modelValue"), n = x(!1), a = x(!1), c = x(String(t.value)), l = x(0);
|
|
1091
|
+
k(t, (e) => {
|
|
1092
|
+
a.value || (c.value = String(e));
|
|
1093
|
+
});
|
|
1094
|
+
function u(t) {
|
|
1095
|
+
return e.min !== void 0 && (t = Math.max(e.min, t)), e.max !== void 0 && (t = Math.min(e.max, t)), t;
|
|
1096
|
+
}
|
|
1097
|
+
function d(t) {
|
|
1098
|
+
return Math.round(t / e.step) * e.step;
|
|
1099
|
+
}
|
|
1100
|
+
let f = r(() => `M 0,4 L${l.value},4`), p = r(() => {
|
|
1101
|
+
let e = l.value;
|
|
1102
|
+
if (e === 0) return "";
|
|
1103
|
+
let t = e + (e > 0 ? -1 : 1), n = Math.max(-4, Math.min(4, -t));
|
|
1104
|
+
return `M ${t + n},0 L${t},4 L${t + n},8 M ${e},-1 L${e},9`;
|
|
1105
|
+
}), m = r(() => {
|
|
1106
|
+
let n = e.step < 1 ? String(e.step).split(".")[1]?.length ?? 0 : 0;
|
|
1107
|
+
return t.value.toFixed(n);
|
|
1108
|
+
});
|
|
1109
|
+
function _() {
|
|
1110
|
+
a.value = !0;
|
|
1111
|
+
}
|
|
1112
|
+
function v() {
|
|
1113
|
+
a.value = !1;
|
|
1114
|
+
let e = parseFloat(c.value);
|
|
1115
|
+
isNaN(e) ? c.value = String(t.value) : t.value = u(e);
|
|
1116
|
+
}
|
|
1117
|
+
function b(n) {
|
|
1118
|
+
if (n.key === "Enter") n.target.blur();
|
|
1119
|
+
else if (n.key === "ArrowUp") {
|
|
1120
|
+
n.preventDefault();
|
|
1121
|
+
let r = n.shiftKey ? 10 : 1;
|
|
1122
|
+
t.value = u(t.value + e.step * r);
|
|
1123
|
+
} else if (n.key === "ArrowDown") {
|
|
1124
|
+
n.preventDefault();
|
|
1125
|
+
let r = n.shiftKey ? 10 : 1;
|
|
1126
|
+
t.value = u(t.value - e.step * r);
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
let S = 0, C = 0;
|
|
1130
|
+
function w(e) {
|
|
1131
|
+
e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId), n.value = !0, S = e.clientX, C = t.value, l.value = 0, document.body.style.cursor = "ew-resize";
|
|
1132
|
+
}
|
|
1133
|
+
function E(e) {
|
|
1134
|
+
if (!n.value) return;
|
|
1135
|
+
let r = e.clientX - S;
|
|
1136
|
+
l.value = r, t.value = u(d(C + r));
|
|
1137
|
+
}
|
|
1138
|
+
function D() {
|
|
1139
|
+
n.value = !1, l.value = 0, document.body.style.cursor = "";
|
|
1140
|
+
}
|
|
1141
|
+
return (t, r) => (y(), i(W, {
|
|
1142
|
+
label: e.label,
|
|
1143
|
+
tooltip: e.tooltip
|
|
1144
|
+
}, {
|
|
1145
|
+
default: A(() => [s("div", { class: h(["vp-text vp-text--number", { "vp-text--dragging": n.value }]) }, [re(s("input", {
|
|
1146
|
+
"onUpdate:modelValue": r[0] ||= (e) => c.value = e,
|
|
1147
|
+
class: "vp-text__input",
|
|
1148
|
+
type: "text",
|
|
1149
|
+
onFocus: _,
|
|
1150
|
+
onBlur: v,
|
|
1151
|
+
onKeydown: b
|
|
1152
|
+
}, null, 544), [[te, c.value]]), s("div", {
|
|
1153
|
+
class: "vp-text__knob",
|
|
1154
|
+
onPointerdown: w,
|
|
1155
|
+
onPointermove: E,
|
|
1156
|
+
onPointerup: D,
|
|
1157
|
+
onPointercancel: D
|
|
1158
|
+
}, [(y(), o("svg", fn, [s("path", {
|
|
1159
|
+
class: "vp-text__guide-body",
|
|
1160
|
+
d: f.value
|
|
1161
|
+
}, null, 8, pn), s("path", {
|
|
1162
|
+
class: "vp-text__guide-head",
|
|
1163
|
+
d: p.value
|
|
1164
|
+
}, null, 8, mn)])), s("div", {
|
|
1165
|
+
class: "vp-text__drag-tooltip",
|
|
1166
|
+
style: g({ left: `${l.value}px` })
|
|
1167
|
+
}, T(m.value), 5)], 32)], 2)]),
|
|
1168
|
+
_: 1
|
|
1169
|
+
}, 8, ["label", "tooltip"]));
|
|
1170
|
+
}
|
|
1171
|
+
}), gn = { class: "vp-button" }, _n = { class: "vp-button__label" }, vn = /* @__PURE__ */ u({
|
|
1172
|
+
__name: "PButton",
|
|
1173
|
+
props: {
|
|
1174
|
+
label: {},
|
|
1175
|
+
tooltip: {}
|
|
1176
|
+
},
|
|
1177
|
+
emits: ["click"],
|
|
1178
|
+
setup(e, { emit: t }) {
|
|
1179
|
+
let r = t, { floatingStyles: l, visible: u, activeText: d, show: f, hide: p } = an(), m = j();
|
|
1180
|
+
return (t, h) => (y(), o("div", gn, [s("button", {
|
|
1181
|
+
class: "vp-button__btn",
|
|
1182
|
+
onClick: h[1] ||= (e) => r("click")
|
|
1183
|
+
}, [s("span", _n, [c(T(e.label) + " ", 1), e.tooltip && E(m).tooltipIcon ? (y(), i(w(E(m).tooltipIcon), {
|
|
1184
|
+
key: 0,
|
|
1185
|
+
onMouseenter: h[0] ||= (t) => e.tooltip && E(f)(t, e.tooltip),
|
|
1186
|
+
onMouseleave: E(p)
|
|
1187
|
+
}, null, 40, ["onMouseleave"])) : a("", !0)])]), e.tooltip ? (y(), i(n, {
|
|
1188
|
+
key: 0,
|
|
1189
|
+
to: "body"
|
|
1190
|
+
}, [E(u) ? (y(), o("div", {
|
|
1191
|
+
key: 0,
|
|
1192
|
+
ref: "floatingEl",
|
|
1193
|
+
class: "vp-tooltip",
|
|
1194
|
+
style: g(E(l))
|
|
1195
|
+
}, T(E(d)), 5)) : a("", !0)])) : a("", !0)]));
|
|
1196
|
+
}
|
|
1197
|
+
}), yn = {}, bn = { class: "vp-separator" };
|
|
1198
|
+
function xn(e, t) {
|
|
1199
|
+
return y(), o("div", bn, [...t[0] ||= [s("hr", { class: "vp-separator__rule" }, null, -1)]]);
|
|
1200
|
+
}
|
|
1201
|
+
var Sn = /*#__PURE__*/ fe(yn, [["render", xn]]), Cn = { class: "vp-checkbox" }, wn = { class: "vp-checkbox__label" }, Tn = ["checked"], En = /* @__PURE__ */ u({
|
|
1202
|
+
__name: "PCheckbox",
|
|
1203
|
+
props: /*@__PURE__*/ p({
|
|
1204
|
+
label: {},
|
|
1205
|
+
tooltip: {}
|
|
1206
|
+
}, {
|
|
1207
|
+
modelValue: {
|
|
1208
|
+
type: Boolean,
|
|
1209
|
+
required: !0
|
|
1210
|
+
},
|
|
1211
|
+
modelModifiers: {}
|
|
1212
|
+
}),
|
|
1213
|
+
emits: ["update:modelValue"],
|
|
1214
|
+
setup(e) {
|
|
1215
|
+
let t = O(e, "modelValue");
|
|
1216
|
+
return (n, r) => (y(), i(W, {
|
|
1217
|
+
label: e.label,
|
|
1218
|
+
tooltip: e.tooltip
|
|
1219
|
+
}, {
|
|
1220
|
+
default: A(() => [s("div", Cn, [s("label", wn, [s("input", {
|
|
1221
|
+
class: "vp-checkbox__input",
|
|
1222
|
+
type: "checkbox",
|
|
1223
|
+
checked: t.value,
|
|
1224
|
+
onChange: r[0] ||= (e) => t.value = e.target.checked
|
|
1225
|
+
}, null, 40, Tn), r[1] ||= s("div", { class: "vp-checkbox__box" }, [s("svg", { viewBox: "0 0 16 16" }, [s("path", { d: "M2 8l4 4l8 -8" })])], -1)])])]),
|
|
1226
|
+
_: 1
|
|
1227
|
+
}, 8, ["label", "tooltip"]));
|
|
1228
|
+
}
|
|
1229
|
+
}), Dn = { class: "vp-select" }, On = ["value"], kn = ["value"], An = /* @__PURE__ */ u({
|
|
1230
|
+
__name: "PSelect",
|
|
1231
|
+
props: /*@__PURE__*/ p({
|
|
1232
|
+
label: {},
|
|
1233
|
+
tooltip: {},
|
|
1234
|
+
options: {}
|
|
1235
|
+
}, {
|
|
1236
|
+
modelValue: { required: !0 },
|
|
1237
|
+
modelModifiers: {}
|
|
1238
|
+
}),
|
|
1239
|
+
emits: ["update:modelValue"],
|
|
1240
|
+
setup(e) {
|
|
1241
|
+
let n = O(e, "modelValue");
|
|
1242
|
+
return (r, a) => (y(), i(W, {
|
|
1243
|
+
label: e.label,
|
|
1244
|
+
tooltip: e.tooltip
|
|
1245
|
+
}, {
|
|
1246
|
+
default: A(() => [s("div", Dn, [s("select", {
|
|
1247
|
+
class: "vp-select__input",
|
|
1248
|
+
value: n.value,
|
|
1249
|
+
onChange: a[0] ||= (e) => n.value = e.target.value
|
|
1250
|
+
}, [(y(!0), o(t, null, S(e.options, (e) => (y(), o("option", {
|
|
1251
|
+
key: e.value,
|
|
1252
|
+
value: e.value
|
|
1253
|
+
}, T(e.label), 9, kn))), 128))], 40, On), a[1] ||= s("div", { class: "vp-select__arrow" }, [s("svg", { viewBox: "0 0 16 16" }, [s("path", { d: "M 2 5 L 8 11 L 14 5" })])], -1)])]),
|
|
1254
|
+
_: 1
|
|
1255
|
+
}, 8, ["label", "tooltip"]));
|
|
1256
|
+
}
|
|
1257
|
+
}), jn = { class: "vp-monitor" }, Mn = { class: "vp-monitor__value" }, Nn = /* @__PURE__ */ u({
|
|
1258
|
+
__name: "PMonitor",
|
|
1259
|
+
props: {
|
|
1260
|
+
value: {},
|
|
1261
|
+
label: {},
|
|
1262
|
+
tooltip: {}
|
|
1263
|
+
},
|
|
1264
|
+
setup(e) {
|
|
1265
|
+
return (t, n) => (y(), i(W, {
|
|
1266
|
+
label: e.label,
|
|
1267
|
+
tooltip: e.tooltip
|
|
1268
|
+
}, {
|
|
1269
|
+
default: A(() => [s("div", jn, [s("div", Mn, T(e.value), 1)])]),
|
|
1270
|
+
_: 1
|
|
1271
|
+
}, 8, ["label", "tooltip"]));
|
|
1272
|
+
}
|
|
1273
|
+
}), Pn = { class: "vp-monitor-multi" }, Fn = ["value"], In = /* @__PURE__ */ u({
|
|
1274
|
+
__name: "PMonitorMulti",
|
|
1275
|
+
props: {
|
|
1276
|
+
value: {},
|
|
1277
|
+
label: {},
|
|
1278
|
+
tooltip: {}
|
|
1279
|
+
},
|
|
1280
|
+
setup(e) {
|
|
1281
|
+
return (t, n) => (y(), i(W, {
|
|
1282
|
+
label: e.label,
|
|
1283
|
+
tooltip: e.tooltip
|
|
1284
|
+
}, {
|
|
1285
|
+
default: A(() => [s("div", Pn, [s("textarea", {
|
|
1286
|
+
class: "vp-monitor-multi__value",
|
|
1287
|
+
readonly: "",
|
|
1288
|
+
value: String(e.value)
|
|
1289
|
+
}, null, 8, Fn)])]),
|
|
1290
|
+
_: 1
|
|
1291
|
+
}, 8, ["label", "tooltip"]));
|
|
1292
|
+
}
|
|
1293
|
+
}), Ln = { class: "vp-slider" }, Rn = /* @__PURE__ */ u({
|
|
1294
|
+
__name: "PSlider",
|
|
1295
|
+
props: /*@__PURE__*/ p({
|
|
1296
|
+
label: {},
|
|
1297
|
+
tooltip: {},
|
|
1298
|
+
min: { default: 0 },
|
|
1299
|
+
max: { default: 1 },
|
|
1300
|
+
step: { default: null }
|
|
1301
|
+
}, {
|
|
1302
|
+
modelValue: { required: !0 },
|
|
1303
|
+
modelModifiers: {}
|
|
1304
|
+
}),
|
|
1305
|
+
emits: ["update:modelValue"],
|
|
1306
|
+
setup(e) {
|
|
1307
|
+
let t = O(e, "modelValue"), n = x(null), a = x(!1), o = r(() => {
|
|
1308
|
+
let n = e.max - e.min;
|
|
1309
|
+
return n === 0 ? 0 : (t.value - e.min) / n * 100;
|
|
1310
|
+
});
|
|
1311
|
+
function c(t) {
|
|
1312
|
+
return Math.max(e.min, Math.min(e.max, t));
|
|
1313
|
+
}
|
|
1314
|
+
function l(r) {
|
|
1315
|
+
let i = n.value;
|
|
1316
|
+
if (!i) return t.value;
|
|
1317
|
+
let a = i.getBoundingClientRect(), o = (r.clientX - a.left) / a.width, s = e.min + o * (e.max - e.min);
|
|
1318
|
+
return e.step === null ? c(s) : c(Math.round(s / e.step) * e.step);
|
|
1319
|
+
}
|
|
1320
|
+
function u(e) {
|
|
1321
|
+
e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId), a.value = !0, t.value = l(e);
|
|
1322
|
+
}
|
|
1323
|
+
function d(e) {
|
|
1324
|
+
a.value && (t.value = l(e));
|
|
1325
|
+
}
|
|
1326
|
+
function f() {
|
|
1327
|
+
a.value = !1;
|
|
1328
|
+
}
|
|
1329
|
+
function p(n) {
|
|
1330
|
+
let r = e.step ?? (e.max - e.min) / 100;
|
|
1331
|
+
n.key === "ArrowRight" || n.key === "ArrowUp" ? (n.preventDefault(), t.value = c(t.value + r * (n.shiftKey ? 10 : 1))) : (n.key === "ArrowLeft" || n.key === "ArrowDown") && (n.preventDefault(), t.value = c(t.value - r * (n.shiftKey ? 10 : 1)));
|
|
1332
|
+
}
|
|
1333
|
+
return (t, r) => (y(), i(W, {
|
|
1334
|
+
label: e.label,
|
|
1335
|
+
tooltip: e.tooltip
|
|
1336
|
+
}, {
|
|
1337
|
+
default: A(() => [s("div", Ln, [s("div", {
|
|
1338
|
+
ref_key: "trackRef",
|
|
1339
|
+
ref: n,
|
|
1340
|
+
class: "vp-slider__track",
|
|
1341
|
+
tabindex: "0",
|
|
1342
|
+
onPointerdown: u,
|
|
1343
|
+
onPointermove: d,
|
|
1344
|
+
onPointerup: f,
|
|
1345
|
+
onPointercancel: f,
|
|
1346
|
+
onKeydown: p
|
|
1347
|
+
}, [s("div", {
|
|
1348
|
+
class: "vp-slider__knob",
|
|
1349
|
+
style: g({ left: o.value + "%" })
|
|
1350
|
+
}, null, 4)], 544)])]),
|
|
1351
|
+
_: 1
|
|
1352
|
+
}, 8, ["label", "tooltip"]));
|
|
1353
|
+
}
|
|
1354
|
+
}), zn = { class: "vp-tab" }, Bn = { class: "vp-tab__title-bar" }, Vn = ["onClick"], Hn = { class: "vp-tab-item__label" }, Un = { class: "vp-tab__content" }, Wn = { class: "vp-tab-page__content" }, Gn = /* @__PURE__ */ u({
|
|
1355
|
+
__name: "PTab",
|
|
1356
|
+
props: /*@__PURE__*/ p({
|
|
1357
|
+
tabs: {},
|
|
1358
|
+
tooltips: {}
|
|
1359
|
+
}, {
|
|
1360
|
+
modelValue: { default: 0 },
|
|
1361
|
+
modelModifiers: {}
|
|
1362
|
+
}),
|
|
1363
|
+
emits: ["update:modelValue"],
|
|
1364
|
+
setup(e) {
|
|
1365
|
+
let r = O(e, "modelValue"), { floatingStyles: l, visible: u, activeText: d, show: f, hide: p } = an(), m = j();
|
|
1366
|
+
function _(e) {
|
|
1367
|
+
r.value = e;
|
|
1368
|
+
}
|
|
1369
|
+
return (v, b) => (y(), o("div", zn, [
|
|
1370
|
+
s("div", Bn, [(y(!0), o(t, null, S(e.tabs, (t, n) => (y(), o("div", {
|
|
1371
|
+
key: n,
|
|
1372
|
+
class: h(["vp-tab-item", { "vp-tab-item--selected": n === r.value }])
|
|
1373
|
+
}, [s("button", {
|
|
1374
|
+
class: "vp-tab-item__btn",
|
|
1375
|
+
onClick: (e) => _(n)
|
|
1376
|
+
}, [s("span", Hn, [c(T(t) + " ", 1), e.tooltips?.[n] && E(m).tooltipIcon ? (y(), i(w(E(m).tooltipIcon), {
|
|
1377
|
+
key: 0,
|
|
1378
|
+
onMouseenter: (t) => e.tooltips?.[n] && E(f)(t, e.tooltips[n]),
|
|
1379
|
+
onMouseleave: E(p)
|
|
1380
|
+
}, null, 40, ["onMouseenter", "onMouseleave"])) : a("", !0)])], 8, Vn)], 2))), 128))]),
|
|
1381
|
+
(y(), i(n, { to: "body" }, [E(u) ? (y(), o("div", {
|
|
1382
|
+
key: 0,
|
|
1383
|
+
ref: "floatingEl",
|
|
1384
|
+
class: "vp-tooltip",
|
|
1385
|
+
style: g(E(l))
|
|
1386
|
+
}, T(E(d)), 5)) : a("", !0)])),
|
|
1387
|
+
b[0] ||= s("div", { class: "vp-tab__indent" }, null, -1),
|
|
1388
|
+
s("div", Un, [(y(!0), o(t, null, S(e.tabs, (e, t) => re((y(), o("div", {
|
|
1389
|
+
key: t,
|
|
1390
|
+
class: "vp-tab-page"
|
|
1391
|
+
}, [s("div", Wn, [C(v.$slots, e)])])), [[ne, t === r.value]])), 128))])
|
|
1392
|
+
]));
|
|
1393
|
+
}
|
|
1394
|
+
});
|
|
1395
|
+
//#endregion
|
|
1396
|
+
//#region node_modules/.pnpm/vue-color@3.3.3_vue@3.5.35_typescript@6.0.3_/node_modules/vue-color/dist/vue-color.js
|
|
1397
|
+
function Kn(e) {
|
|
1398
|
+
"@babel/helpers - typeof";
|
|
1399
|
+
return Kn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
1400
|
+
return typeof e;
|
|
1401
|
+
} : function(e) {
|
|
1402
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
1403
|
+
}, Kn(e);
|
|
1404
|
+
}
|
|
1405
|
+
var qn = /^\s+/, Jn = /\s+$/;
|
|
1406
|
+
function G(e, t) {
|
|
1407
|
+
if (e ||= "", t ||= {}, e instanceof G) return e;
|
|
1408
|
+
if (!(this instanceof G)) return new G(e, t);
|
|
1409
|
+
var n = Yn(e);
|
|
1410
|
+
this._originalInput = e, this._r = n.r, this._g = n.g, this._b = n.b, this._a = n.a, this._roundA = Math.round(100 * this._a) / 100, this._format = t.format || n.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 = n.ok;
|
|
1411
|
+
}
|
|
1412
|
+
G.prototype = {
|
|
1413
|
+
isDark: function() {
|
|
1414
|
+
return this.getBrightness() < 128;
|
|
1415
|
+
},
|
|
1416
|
+
isLight: function() {
|
|
1417
|
+
return !this.isDark();
|
|
1418
|
+
},
|
|
1419
|
+
isValid: function() {
|
|
1420
|
+
return this._ok;
|
|
1421
|
+
},
|
|
1422
|
+
getOriginalInput: function() {
|
|
1423
|
+
return this._originalInput;
|
|
1424
|
+
},
|
|
1425
|
+
getFormat: function() {
|
|
1426
|
+
return this._format;
|
|
1427
|
+
},
|
|
1428
|
+
getAlpha: function() {
|
|
1429
|
+
return this._a;
|
|
1430
|
+
},
|
|
1431
|
+
getBrightness: function() {
|
|
1432
|
+
var e = this.toRgb();
|
|
1433
|
+
return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3;
|
|
1434
|
+
},
|
|
1435
|
+
getLuminance: function() {
|
|
1436
|
+
var e = this.toRgb(), t, n, r, i, a, o;
|
|
1437
|
+
return t = e.r / 255, n = e.g / 255, r = e.b / 255, i = t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4, a = n <= .03928 ? n / 12.92 : ((n + .055) / 1.055) ** 2.4, o = r <= .03928 ? r / 12.92 : ((r + .055) / 1.055) ** 2.4, .2126 * i + .7152 * a + .0722 * o;
|
|
1438
|
+
},
|
|
1439
|
+
setAlpha: function(e) {
|
|
1440
|
+
return this._a = yr(e), this._roundA = Math.round(100 * this._a) / 100, this;
|
|
1441
|
+
},
|
|
1442
|
+
toHsv: function() {
|
|
1443
|
+
var e = $n(this._r, this._g, this._b);
|
|
1444
|
+
return {
|
|
1445
|
+
h: e.h * 360,
|
|
1446
|
+
s: e.s,
|
|
1447
|
+
v: e.v,
|
|
1448
|
+
a: this._a
|
|
1449
|
+
};
|
|
1450
|
+
},
|
|
1451
|
+
toHsvString: function() {
|
|
1452
|
+
var e = $n(this._r, this._g, this._b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.v * 100);
|
|
1453
|
+
return this._a == 1 ? "hsv(" + t + ", " + n + "%, " + r + "%)" : "hsva(" + t + ", " + n + "%, " + r + "%, " + this._roundA + ")";
|
|
1454
|
+
},
|
|
1455
|
+
toHsl: function() {
|
|
1456
|
+
var e = Zn(this._r, this._g, this._b);
|
|
1457
|
+
return {
|
|
1458
|
+
h: e.h * 360,
|
|
1459
|
+
s: e.s,
|
|
1460
|
+
l: e.l,
|
|
1461
|
+
a: this._a
|
|
1462
|
+
};
|
|
1463
|
+
},
|
|
1464
|
+
toHslString: function() {
|
|
1465
|
+
var e = Zn(this._r, this._g, this._b), t = Math.round(e.h * 360), n = Math.round(e.s * 100), r = Math.round(e.l * 100);
|
|
1466
|
+
return this._a == 1 ? "hsl(" + t + ", " + n + "%, " + r + "%)" : "hsla(" + t + ", " + n + "%, " + r + "%, " + this._roundA + ")";
|
|
1467
|
+
},
|
|
1468
|
+
toHex: function(e) {
|
|
1469
|
+
return tr(this._r, this._g, this._b, e);
|
|
1470
|
+
},
|
|
1471
|
+
toHexString: function(e) {
|
|
1472
|
+
return "#" + this.toHex(e);
|
|
1473
|
+
},
|
|
1474
|
+
toHex8: function(e) {
|
|
1475
|
+
return nr(this._r, this._g, this._b, this._a, e);
|
|
1476
|
+
},
|
|
1477
|
+
toHex8String: function(e) {
|
|
1478
|
+
return "#" + this.toHex8(e);
|
|
1479
|
+
},
|
|
1480
|
+
toRgb: function() {
|
|
1481
|
+
return {
|
|
1482
|
+
r: Math.round(this._r),
|
|
1483
|
+
g: Math.round(this._g),
|
|
1484
|
+
b: Math.round(this._b),
|
|
1485
|
+
a: this._a
|
|
1486
|
+
};
|
|
1487
|
+
},
|
|
1488
|
+
toRgbString: function() {
|
|
1489
|
+
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 + ")";
|
|
1490
|
+
},
|
|
1491
|
+
toPercentageRgb: function() {
|
|
1492
|
+
return {
|
|
1493
|
+
r: Math.round(K(this._r, 255) * 100) + "%",
|
|
1494
|
+
g: Math.round(K(this._g, 255) * 100) + "%",
|
|
1495
|
+
b: Math.round(K(this._b, 255) * 100) + "%",
|
|
1496
|
+
a: this._a
|
|
1497
|
+
};
|
|
1498
|
+
},
|
|
1499
|
+
toPercentageRgbString: function() {
|
|
1500
|
+
return this._a == 1 ? "rgb(" + Math.round(K(this._r, 255) * 100) + "%, " + Math.round(K(this._g, 255) * 100) + "%, " + Math.round(K(this._b, 255) * 100) + "%)" : "rgba(" + Math.round(K(this._r, 255) * 100) + "%, " + Math.round(K(this._g, 255) * 100) + "%, " + Math.round(K(this._b, 255) * 100) + "%, " + this._roundA + ")";
|
|
1501
|
+
},
|
|
1502
|
+
toName: function() {
|
|
1503
|
+
return this._a === 0 ? "transparent" : this._a < 1 ? !1 : _r[tr(this._r, this._g, this._b, !0)] || !1;
|
|
1504
|
+
},
|
|
1505
|
+
toFilter: function(e) {
|
|
1506
|
+
var t = "#" + rr(this._r, this._g, this._b, this._a), n = t, r = this._gradientType ? "GradientType = 1, " : "";
|
|
1507
|
+
if (e) {
|
|
1508
|
+
var i = G(e);
|
|
1509
|
+
n = "#" + rr(i._r, i._g, i._b, i._a);
|
|
1510
|
+
}
|
|
1511
|
+
return "progid:DXImageTransform.Microsoft.gradient(" + r + "startColorstr=" + t + ",endColorstr=" + n + ")";
|
|
1512
|
+
},
|
|
1513
|
+
toString: function(e) {
|
|
1514
|
+
var t = !!e;
|
|
1515
|
+
e ||= this._format;
|
|
1516
|
+
var n = !1, r = this._a < 1 && this._a >= 0;
|
|
1517
|
+
return !t && r && (e === "hex" || e === "hex6" || e === "hex3" || e === "hex4" || e === "hex8" || e === "name") ? e === "name" && this._a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (n = this.toRgbString()), e === "prgb" && (n = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (n = this.toHexString()), e === "hex3" && (n = this.toHexString(!0)), e === "hex4" && (n = this.toHex8String(!0)), e === "hex8" && (n = this.toHex8String()), e === "name" && (n = this.toName()), e === "hsl" && (n = this.toHslString()), e === "hsv" && (n = this.toHsvString()), n || this.toHexString());
|
|
1518
|
+
},
|
|
1519
|
+
clone: function() {
|
|
1520
|
+
return G(this.toString());
|
|
1521
|
+
},
|
|
1522
|
+
_applyModification: function(e, t) {
|
|
1523
|
+
var n = e.apply(null, [this].concat([].slice.call(t)));
|
|
1524
|
+
return this._r = n._r, this._g = n._g, this._b = n._b, this.setAlpha(n._a), this;
|
|
1525
|
+
},
|
|
1526
|
+
lighten: function() {
|
|
1527
|
+
return this._applyModification(sr, arguments);
|
|
1528
|
+
},
|
|
1529
|
+
brighten: function() {
|
|
1530
|
+
return this._applyModification(cr, arguments);
|
|
1531
|
+
},
|
|
1532
|
+
darken: function() {
|
|
1533
|
+
return this._applyModification(lr, arguments);
|
|
1534
|
+
},
|
|
1535
|
+
desaturate: function() {
|
|
1536
|
+
return this._applyModification(ir, arguments);
|
|
1537
|
+
},
|
|
1538
|
+
saturate: function() {
|
|
1539
|
+
return this._applyModification(ar, arguments);
|
|
1540
|
+
},
|
|
1541
|
+
greyscale: function() {
|
|
1542
|
+
return this._applyModification(or, arguments);
|
|
1543
|
+
},
|
|
1544
|
+
spin: function() {
|
|
1545
|
+
return this._applyModification(ur, arguments);
|
|
1546
|
+
},
|
|
1547
|
+
_applyCombination: function(e, t) {
|
|
1548
|
+
return e.apply(null, [this].concat([].slice.call(t)));
|
|
1549
|
+
},
|
|
1550
|
+
analogous: function() {
|
|
1551
|
+
return this._applyCombination(mr, arguments);
|
|
1552
|
+
},
|
|
1553
|
+
complement: function() {
|
|
1554
|
+
return this._applyCombination(dr, arguments);
|
|
1555
|
+
},
|
|
1556
|
+
monochromatic: function() {
|
|
1557
|
+
return this._applyCombination(hr, arguments);
|
|
1558
|
+
},
|
|
1559
|
+
splitcomplement: function() {
|
|
1560
|
+
return this._applyCombination(pr, arguments);
|
|
1561
|
+
},
|
|
1562
|
+
triad: function() {
|
|
1563
|
+
return this._applyCombination(fr, [3]);
|
|
1564
|
+
},
|
|
1565
|
+
tetrad: function() {
|
|
1566
|
+
return this._applyCombination(fr, [4]);
|
|
1567
|
+
}
|
|
1568
|
+
}, G.fromRatio = function(e, t) {
|
|
1569
|
+
if (Kn(e) == "object") {
|
|
1570
|
+
var n = {};
|
|
1571
|
+
for (var r in e) e.hasOwnProperty(r) && (r === "a" ? n[r] = e[r] : n[r] = Cr(e[r]));
|
|
1572
|
+
e = n;
|
|
1573
|
+
}
|
|
1574
|
+
return G(e, t);
|
|
1575
|
+
};
|
|
1576
|
+
function Yn(e) {
|
|
1577
|
+
var t = {
|
|
1578
|
+
r: 0,
|
|
1579
|
+
g: 0,
|
|
1580
|
+
b: 0
|
|
1581
|
+
}, n = 1, r = null, i = null, a = null, o = !1, s = !1;
|
|
1582
|
+
return typeof e == "string" && (e = Er(e)), Kn(e) == "object" && (X(e.r) && X(e.g) && X(e.b) ? (t = Xn(e.r, e.g, e.b), o = !0, s = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : X(e.h) && X(e.s) && X(e.v) ? (r = Cr(e.s), i = Cr(e.v), t = er(e.h, r, i), o = !0, s = "hsv") : X(e.h) && X(e.s) && X(e.l) && (r = Cr(e.s), a = Cr(e.l), t = Qn(e.h, r, a), o = !0, s = "hsl"), e.hasOwnProperty("a") && (n = e.a)), n = yr(n), {
|
|
1583
|
+
ok: o,
|
|
1584
|
+
format: e.format || s,
|
|
1585
|
+
r: Math.min(255, Math.max(t.r, 0)),
|
|
1586
|
+
g: Math.min(255, Math.max(t.g, 0)),
|
|
1587
|
+
b: Math.min(255, Math.max(t.b, 0)),
|
|
1588
|
+
a: n
|
|
1589
|
+
};
|
|
1590
|
+
}
|
|
1591
|
+
function Xn(e, t, n) {
|
|
1592
|
+
return {
|
|
1593
|
+
r: K(e, 255) * 255,
|
|
1594
|
+
g: K(t, 255) * 255,
|
|
1595
|
+
b: K(n, 255) * 255
|
|
1596
|
+
};
|
|
1597
|
+
}
|
|
1598
|
+
function Zn(e, t, n) {
|
|
1599
|
+
e = K(e, 255), t = K(t, 255), n = K(n, 255);
|
|
1600
|
+
var r = Math.max(e, t, n), i = Math.min(e, t, n), a, o, s = (r + i) / 2;
|
|
1601
|
+
if (r == i) a = o = 0;
|
|
1602
|
+
else {
|
|
1603
|
+
var c = r - i;
|
|
1604
|
+
switch (o = s > .5 ? c / (2 - r - i) : c / (r + i), r) {
|
|
1605
|
+
case e:
|
|
1606
|
+
a = (t - n) / c + (t < n ? 6 : 0);
|
|
1607
|
+
break;
|
|
1608
|
+
case t:
|
|
1609
|
+
a = (n - e) / c + 2;
|
|
1610
|
+
break;
|
|
1611
|
+
case n:
|
|
1612
|
+
a = (e - t) / c + 4;
|
|
1613
|
+
break;
|
|
1614
|
+
}
|
|
1615
|
+
a /= 6;
|
|
1616
|
+
}
|
|
1617
|
+
return {
|
|
1618
|
+
h: a,
|
|
1619
|
+
s: o,
|
|
1620
|
+
l: s
|
|
1621
|
+
};
|
|
1622
|
+
}
|
|
1623
|
+
function Qn(e, t, n) {
|
|
1624
|
+
var r, i, a;
|
|
1625
|
+
e = K(e, 360), t = K(t, 100), n = K(n, 100);
|
|
1626
|
+
function o(e, t, n) {
|
|
1627
|
+
return n < 0 && (n += 1), n > 1 && --n, n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e;
|
|
1628
|
+
}
|
|
1629
|
+
if (t === 0) r = i = a = n;
|
|
1630
|
+
else {
|
|
1631
|
+
var s = n < .5 ? n * (1 + t) : n + t - n * t, c = 2 * n - s;
|
|
1632
|
+
r = o(c, s, e + 1 / 3), i = o(c, s, e), a = o(c, s, e - 1 / 3);
|
|
1633
|
+
}
|
|
1634
|
+
return {
|
|
1635
|
+
r: r * 255,
|
|
1636
|
+
g: i * 255,
|
|
1637
|
+
b: a * 255
|
|
1638
|
+
};
|
|
1639
|
+
}
|
|
1640
|
+
function $n(e, t, n) {
|
|
1641
|
+
e = K(e, 255), t = K(t, 255), n = K(n, 255);
|
|
1642
|
+
var r = Math.max(e, t, n), i = Math.min(e, t, n), a, o, s = r, c = r - i;
|
|
1643
|
+
if (o = r === 0 ? 0 : c / r, r == i) a = 0;
|
|
1644
|
+
else {
|
|
1645
|
+
switch (r) {
|
|
1646
|
+
case e:
|
|
1647
|
+
a = (t - n) / c + (t < n ? 6 : 0);
|
|
1648
|
+
break;
|
|
1649
|
+
case t:
|
|
1650
|
+
a = (n - e) / c + 2;
|
|
1651
|
+
break;
|
|
1652
|
+
case n:
|
|
1653
|
+
a = (e - t) / c + 4;
|
|
1654
|
+
break;
|
|
1655
|
+
}
|
|
1656
|
+
a /= 6;
|
|
1657
|
+
}
|
|
1658
|
+
return {
|
|
1659
|
+
h: a,
|
|
1660
|
+
s: o,
|
|
1661
|
+
v: s
|
|
1662
|
+
};
|
|
1663
|
+
}
|
|
1664
|
+
function er(e, t, n) {
|
|
1665
|
+
e = K(e, 360) * 6, t = K(t, 100), n = K(n, 100);
|
|
1666
|
+
var r = Math.floor(e), i = e - r, a = n * (1 - t), o = n * (1 - i * t), s = n * (1 - (1 - i) * t), c = r % 6, l = [
|
|
1667
|
+
n,
|
|
1668
|
+
o,
|
|
1669
|
+
a,
|
|
1670
|
+
a,
|
|
1671
|
+
s,
|
|
1672
|
+
n
|
|
1673
|
+
][c], u = [
|
|
1674
|
+
s,
|
|
1675
|
+
n,
|
|
1676
|
+
n,
|
|
1677
|
+
o,
|
|
1678
|
+
a,
|
|
1679
|
+
a
|
|
1680
|
+
][c], d = [
|
|
1681
|
+
a,
|
|
1682
|
+
a,
|
|
1683
|
+
s,
|
|
1684
|
+
n,
|
|
1685
|
+
n,
|
|
1686
|
+
o
|
|
1687
|
+
][c];
|
|
1688
|
+
return {
|
|
1689
|
+
r: l * 255,
|
|
1690
|
+
g: u * 255,
|
|
1691
|
+
b: d * 255
|
|
1692
|
+
};
|
|
1693
|
+
}
|
|
1694
|
+
function tr(e, t, n, r) {
|
|
1695
|
+
var i = [
|
|
1696
|
+
J(Math.round(e).toString(16)),
|
|
1697
|
+
J(Math.round(t).toString(16)),
|
|
1698
|
+
J(Math.round(n).toString(16))
|
|
1699
|
+
];
|
|
1700
|
+
return r && 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("");
|
|
1701
|
+
}
|
|
1702
|
+
function nr(e, t, n, r, i) {
|
|
1703
|
+
var a = [
|
|
1704
|
+
J(Math.round(e).toString(16)),
|
|
1705
|
+
J(Math.round(t).toString(16)),
|
|
1706
|
+
J(Math.round(n).toString(16)),
|
|
1707
|
+
J(wr(r))
|
|
1708
|
+
];
|
|
1709
|
+
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("");
|
|
1710
|
+
}
|
|
1711
|
+
function rr(e, t, n, r) {
|
|
1712
|
+
return [
|
|
1713
|
+
J(wr(r)),
|
|
1714
|
+
J(Math.round(e).toString(16)),
|
|
1715
|
+
J(Math.round(t).toString(16)),
|
|
1716
|
+
J(Math.round(n).toString(16))
|
|
1717
|
+
].join("");
|
|
1718
|
+
}
|
|
1719
|
+
G.equals = function(e, t) {
|
|
1720
|
+
return !e || !t ? !1 : G(e).toRgbString() == G(t).toRgbString();
|
|
1721
|
+
}, G.random = function() {
|
|
1722
|
+
return G.fromRatio({
|
|
1723
|
+
r: Math.random(),
|
|
1724
|
+
g: Math.random(),
|
|
1725
|
+
b: Math.random()
|
|
1726
|
+
});
|
|
1727
|
+
};
|
|
1728
|
+
function ir(e, t) {
|
|
1729
|
+
t = t === 0 ? 0 : t || 10;
|
|
1730
|
+
var n = G(e).toHsl();
|
|
1731
|
+
return n.s -= t / 100, n.s = br(n.s), G(n);
|
|
1732
|
+
}
|
|
1733
|
+
function ar(e, t) {
|
|
1734
|
+
t = t === 0 ? 0 : t || 10;
|
|
1735
|
+
var n = G(e).toHsl();
|
|
1736
|
+
return n.s += t / 100, n.s = br(n.s), G(n);
|
|
1737
|
+
}
|
|
1738
|
+
function or(e) {
|
|
1739
|
+
return G(e).desaturate(100);
|
|
1740
|
+
}
|
|
1741
|
+
function sr(e, t) {
|
|
1742
|
+
t = t === 0 ? 0 : t || 10;
|
|
1743
|
+
var n = G(e).toHsl();
|
|
1744
|
+
return n.l += t / 100, n.l = br(n.l), G(n);
|
|
1745
|
+
}
|
|
1746
|
+
function cr(e, t) {
|
|
1747
|
+
t = t === 0 ? 0 : t || 10;
|
|
1748
|
+
var n = G(e).toRgb();
|
|
1749
|
+
return n.r = Math.max(0, Math.min(255, n.r - Math.round(255 * -(t / 100)))), n.g = Math.max(0, Math.min(255, n.g - Math.round(255 * -(t / 100)))), n.b = Math.max(0, Math.min(255, n.b - Math.round(255 * -(t / 100)))), G(n);
|
|
1750
|
+
}
|
|
1751
|
+
function lr(e, t) {
|
|
1752
|
+
t = t === 0 ? 0 : t || 10;
|
|
1753
|
+
var n = G(e).toHsl();
|
|
1754
|
+
return n.l -= t / 100, n.l = br(n.l), G(n);
|
|
1755
|
+
}
|
|
1756
|
+
function ur(e, t) {
|
|
1757
|
+
var n = G(e).toHsl(), r = (n.h + t) % 360;
|
|
1758
|
+
return n.h = r < 0 ? 360 + r : r, G(n);
|
|
1759
|
+
}
|
|
1760
|
+
function dr(e) {
|
|
1761
|
+
var t = G(e).toHsl();
|
|
1762
|
+
return t.h = (t.h + 180) % 360, G(t);
|
|
1763
|
+
}
|
|
1764
|
+
function fr(e, t) {
|
|
1765
|
+
if (isNaN(t) || t <= 0) throw Error("Argument to polyad must be a positive number");
|
|
1766
|
+
for (var n = G(e).toHsl(), r = [G(e)], i = 360 / t, a = 1; a < t; a++) r.push(G({
|
|
1767
|
+
h: (n.h + a * i) % 360,
|
|
1768
|
+
s: n.s,
|
|
1769
|
+
l: n.l
|
|
1770
|
+
}));
|
|
1771
|
+
return r;
|
|
1772
|
+
}
|
|
1773
|
+
function pr(e) {
|
|
1774
|
+
var t = G(e).toHsl(), n = t.h;
|
|
1775
|
+
return [
|
|
1776
|
+
G(e),
|
|
1777
|
+
G({
|
|
1778
|
+
h: (n + 72) % 360,
|
|
1779
|
+
s: t.s,
|
|
1780
|
+
l: t.l
|
|
1781
|
+
}),
|
|
1782
|
+
G({
|
|
1783
|
+
h: (n + 216) % 360,
|
|
1784
|
+
s: t.s,
|
|
1785
|
+
l: t.l
|
|
1786
|
+
})
|
|
1787
|
+
];
|
|
1788
|
+
}
|
|
1789
|
+
function mr(e, t, n) {
|
|
1790
|
+
t ||= 6, n ||= 30;
|
|
1791
|
+
var r = G(e).toHsl(), i = 360 / n, a = [G(e)];
|
|
1792
|
+
for (r.h = (r.h - (i * t >> 1) + 720) % 360; --t;) r.h = (r.h + i) % 360, a.push(G(r));
|
|
1793
|
+
return a;
|
|
1794
|
+
}
|
|
1795
|
+
function hr(e, t) {
|
|
1796
|
+
t ||= 6;
|
|
1797
|
+
for (var n = G(e).toHsv(), r = n.h, i = n.s, a = n.v, o = [], s = 1 / t; t--;) o.push(G({
|
|
1798
|
+
h: r,
|
|
1799
|
+
s: i,
|
|
1800
|
+
v: a
|
|
1801
|
+
})), a = (a + s) % 1;
|
|
1802
|
+
return o;
|
|
1803
|
+
}
|
|
1804
|
+
G.mix = function(e, t, n) {
|
|
1805
|
+
n = n === 0 ? 0 : n || 50;
|
|
1806
|
+
var r = G(e).toRgb(), i = G(t).toRgb(), a = n / 100;
|
|
1807
|
+
return G({
|
|
1808
|
+
r: (i.r - r.r) * a + r.r,
|
|
1809
|
+
g: (i.g - r.g) * a + r.g,
|
|
1810
|
+
b: (i.b - r.b) * a + r.b,
|
|
1811
|
+
a: (i.a - r.a) * a + r.a
|
|
1812
|
+
});
|
|
1813
|
+
}, G.readability = function(e, t) {
|
|
1814
|
+
var n = G(e), r = G(t);
|
|
1815
|
+
return (Math.max(n.getLuminance(), r.getLuminance()) + .05) / (Math.min(n.getLuminance(), r.getLuminance()) + .05);
|
|
1816
|
+
}, G.isReadable = function(e, t, n) {
|
|
1817
|
+
var r = G.readability(e, t), i, a;
|
|
1818
|
+
switch (a = !1, i = Dr(n), i.level + i.size) {
|
|
1819
|
+
case "AAsmall":
|
|
1820
|
+
case "AAAlarge":
|
|
1821
|
+
a = r >= 4.5;
|
|
1822
|
+
break;
|
|
1823
|
+
case "AAlarge":
|
|
1824
|
+
a = r >= 3;
|
|
1825
|
+
break;
|
|
1826
|
+
case "AAAsmall":
|
|
1827
|
+
a = r >= 7;
|
|
1828
|
+
break;
|
|
1829
|
+
}
|
|
1830
|
+
return a;
|
|
1831
|
+
}, G.mostReadable = function(e, t, n) {
|
|
1832
|
+
var r = null, i = 0, a, o, s, c;
|
|
1833
|
+
n ||= {}, o = n.includeFallbackColors, s = n.level, c = n.size;
|
|
1834
|
+
for (var l = 0; l < t.length; l++) a = G.readability(e, t[l]), a > i && (i = a, r = G(t[l]));
|
|
1835
|
+
return G.isReadable(e, r, {
|
|
1836
|
+
level: s,
|
|
1837
|
+
size: c
|
|
1838
|
+
}) || !o ? r : (n.includeFallbackColors = !1, G.mostReadable(e, ["#fff", "#000"], n));
|
|
1839
|
+
};
|
|
1840
|
+
var gr = G.names = {
|
|
1841
|
+
aliceblue: "f0f8ff",
|
|
1842
|
+
antiquewhite: "faebd7",
|
|
1843
|
+
aqua: "0ff",
|
|
1844
|
+
aquamarine: "7fffd4",
|
|
1845
|
+
azure: "f0ffff",
|
|
1846
|
+
beige: "f5f5dc",
|
|
1847
|
+
bisque: "ffe4c4",
|
|
1848
|
+
black: "000",
|
|
1849
|
+
blanchedalmond: "ffebcd",
|
|
1850
|
+
blue: "00f",
|
|
1851
|
+
blueviolet: "8a2be2",
|
|
1852
|
+
brown: "a52a2a",
|
|
1853
|
+
burlywood: "deb887",
|
|
1854
|
+
burntsienna: "ea7e5d",
|
|
1855
|
+
cadetblue: "5f9ea0",
|
|
1856
|
+
chartreuse: "7fff00",
|
|
1857
|
+
chocolate: "d2691e",
|
|
1858
|
+
coral: "ff7f50",
|
|
1859
|
+
cornflowerblue: "6495ed",
|
|
1860
|
+
cornsilk: "fff8dc",
|
|
1861
|
+
crimson: "dc143c",
|
|
1862
|
+
cyan: "0ff",
|
|
1863
|
+
darkblue: "00008b",
|
|
1864
|
+
darkcyan: "008b8b",
|
|
1865
|
+
darkgoldenrod: "b8860b",
|
|
1866
|
+
darkgray: "a9a9a9",
|
|
1867
|
+
darkgreen: "006400",
|
|
1868
|
+
darkgrey: "a9a9a9",
|
|
1869
|
+
darkkhaki: "bdb76b",
|
|
1870
|
+
darkmagenta: "8b008b",
|
|
1871
|
+
darkolivegreen: "556b2f",
|
|
1872
|
+
darkorange: "ff8c00",
|
|
1873
|
+
darkorchid: "9932cc",
|
|
1874
|
+
darkred: "8b0000",
|
|
1875
|
+
darksalmon: "e9967a",
|
|
1876
|
+
darkseagreen: "8fbc8f",
|
|
1877
|
+
darkslateblue: "483d8b",
|
|
1878
|
+
darkslategray: "2f4f4f",
|
|
1879
|
+
darkslategrey: "2f4f4f",
|
|
1880
|
+
darkturquoise: "00ced1",
|
|
1881
|
+
darkviolet: "9400d3",
|
|
1882
|
+
deeppink: "ff1493",
|
|
1883
|
+
deepskyblue: "00bfff",
|
|
1884
|
+
dimgray: "696969",
|
|
1885
|
+
dimgrey: "696969",
|
|
1886
|
+
dodgerblue: "1e90ff",
|
|
1887
|
+
firebrick: "b22222",
|
|
1888
|
+
floralwhite: "fffaf0",
|
|
1889
|
+
forestgreen: "228b22",
|
|
1890
|
+
fuchsia: "f0f",
|
|
1891
|
+
gainsboro: "dcdcdc",
|
|
1892
|
+
ghostwhite: "f8f8ff",
|
|
1893
|
+
gold: "ffd700",
|
|
1894
|
+
goldenrod: "daa520",
|
|
1895
|
+
gray: "808080",
|
|
1896
|
+
green: "008000",
|
|
1897
|
+
greenyellow: "adff2f",
|
|
1898
|
+
grey: "808080",
|
|
1899
|
+
honeydew: "f0fff0",
|
|
1900
|
+
hotpink: "ff69b4",
|
|
1901
|
+
indianred: "cd5c5c",
|
|
1902
|
+
indigo: "4b0082",
|
|
1903
|
+
ivory: "fffff0",
|
|
1904
|
+
khaki: "f0e68c",
|
|
1905
|
+
lavender: "e6e6fa",
|
|
1906
|
+
lavenderblush: "fff0f5",
|
|
1907
|
+
lawngreen: "7cfc00",
|
|
1908
|
+
lemonchiffon: "fffacd",
|
|
1909
|
+
lightblue: "add8e6",
|
|
1910
|
+
lightcoral: "f08080",
|
|
1911
|
+
lightcyan: "e0ffff",
|
|
1912
|
+
lightgoldenrodyellow: "fafad2",
|
|
1913
|
+
lightgray: "d3d3d3",
|
|
1914
|
+
lightgreen: "90ee90",
|
|
1915
|
+
lightgrey: "d3d3d3",
|
|
1916
|
+
lightpink: "ffb6c1",
|
|
1917
|
+
lightsalmon: "ffa07a",
|
|
1918
|
+
lightseagreen: "20b2aa",
|
|
1919
|
+
lightskyblue: "87cefa",
|
|
1920
|
+
lightslategray: "789",
|
|
1921
|
+
lightslategrey: "789",
|
|
1922
|
+
lightsteelblue: "b0c4de",
|
|
1923
|
+
lightyellow: "ffffe0",
|
|
1924
|
+
lime: "0f0",
|
|
1925
|
+
limegreen: "32cd32",
|
|
1926
|
+
linen: "faf0e6",
|
|
1927
|
+
magenta: "f0f",
|
|
1928
|
+
maroon: "800000",
|
|
1929
|
+
mediumaquamarine: "66cdaa",
|
|
1930
|
+
mediumblue: "0000cd",
|
|
1931
|
+
mediumorchid: "ba55d3",
|
|
1932
|
+
mediumpurple: "9370db",
|
|
1933
|
+
mediumseagreen: "3cb371",
|
|
1934
|
+
mediumslateblue: "7b68ee",
|
|
1935
|
+
mediumspringgreen: "00fa9a",
|
|
1936
|
+
mediumturquoise: "48d1cc",
|
|
1937
|
+
mediumvioletred: "c71585",
|
|
1938
|
+
midnightblue: "191970",
|
|
1939
|
+
mintcream: "f5fffa",
|
|
1940
|
+
mistyrose: "ffe4e1",
|
|
1941
|
+
moccasin: "ffe4b5",
|
|
1942
|
+
navajowhite: "ffdead",
|
|
1943
|
+
navy: "000080",
|
|
1944
|
+
oldlace: "fdf5e6",
|
|
1945
|
+
olive: "808000",
|
|
1946
|
+
olivedrab: "6b8e23",
|
|
1947
|
+
orange: "ffa500",
|
|
1948
|
+
orangered: "ff4500",
|
|
1949
|
+
orchid: "da70d6",
|
|
1950
|
+
palegoldenrod: "eee8aa",
|
|
1951
|
+
palegreen: "98fb98",
|
|
1952
|
+
paleturquoise: "afeeee",
|
|
1953
|
+
palevioletred: "db7093",
|
|
1954
|
+
papayawhip: "ffefd5",
|
|
1955
|
+
peachpuff: "ffdab9",
|
|
1956
|
+
peru: "cd853f",
|
|
1957
|
+
pink: "ffc0cb",
|
|
1958
|
+
plum: "dda0dd",
|
|
1959
|
+
powderblue: "b0e0e6",
|
|
1960
|
+
purple: "800080",
|
|
1961
|
+
rebeccapurple: "663399",
|
|
1962
|
+
red: "f00",
|
|
1963
|
+
rosybrown: "bc8f8f",
|
|
1964
|
+
royalblue: "4169e1",
|
|
1965
|
+
saddlebrown: "8b4513",
|
|
1966
|
+
salmon: "fa8072",
|
|
1967
|
+
sandybrown: "f4a460",
|
|
1968
|
+
seagreen: "2e8b57",
|
|
1969
|
+
seashell: "fff5ee",
|
|
1970
|
+
sienna: "a0522d",
|
|
1971
|
+
silver: "c0c0c0",
|
|
1972
|
+
skyblue: "87ceeb",
|
|
1973
|
+
slateblue: "6a5acd",
|
|
1974
|
+
slategray: "708090",
|
|
1975
|
+
slategrey: "708090",
|
|
1976
|
+
snow: "fffafa",
|
|
1977
|
+
springgreen: "00ff7f",
|
|
1978
|
+
steelblue: "4682b4",
|
|
1979
|
+
tan: "d2b48c",
|
|
1980
|
+
teal: "008080",
|
|
1981
|
+
thistle: "d8bfd8",
|
|
1982
|
+
tomato: "ff6347",
|
|
1983
|
+
turquoise: "40e0d0",
|
|
1984
|
+
violet: "ee82ee",
|
|
1985
|
+
wheat: "f5deb3",
|
|
1986
|
+
white: "fff",
|
|
1987
|
+
whitesmoke: "f5f5f5",
|
|
1988
|
+
yellow: "ff0",
|
|
1989
|
+
yellowgreen: "9acd32"
|
|
1990
|
+
}, _r = G.hexNames = vr(gr);
|
|
1991
|
+
function vr(e) {
|
|
1992
|
+
var t = {};
|
|
1993
|
+
for (var n in e) e.hasOwnProperty(n) && (t[e[n]] = n);
|
|
1994
|
+
return t;
|
|
1995
|
+
}
|
|
1996
|
+
function yr(e) {
|
|
1997
|
+
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
|
|
1998
|
+
}
|
|
1999
|
+
function K(e, t) {
|
|
2000
|
+
xr(e) && (e = "100%");
|
|
2001
|
+
var n = Sr(e);
|
|
2002
|
+
return e = Math.min(t, Math.max(0, parseFloat(e))), n && (e = parseInt(e * t, 10) / 100), Math.abs(e - t) < 1e-6 ? 1 : e % t / parseFloat(t);
|
|
2003
|
+
}
|
|
2004
|
+
function br(e) {
|
|
2005
|
+
return Math.min(1, Math.max(0, e));
|
|
2006
|
+
}
|
|
2007
|
+
function q(e) {
|
|
2008
|
+
return parseInt(e, 16);
|
|
2009
|
+
}
|
|
2010
|
+
function xr(e) {
|
|
2011
|
+
return typeof e == "string" && e.indexOf(".") != -1 && parseFloat(e) === 1;
|
|
2012
|
+
}
|
|
2013
|
+
function Sr(e) {
|
|
2014
|
+
return typeof e == "string" && e.indexOf("%") != -1;
|
|
2015
|
+
}
|
|
2016
|
+
function J(e) {
|
|
2017
|
+
return e.length == 1 ? "0" + e : "" + e;
|
|
2018
|
+
}
|
|
2019
|
+
function Cr(e) {
|
|
2020
|
+
return e <= 1 && (e = e * 100 + "%"), e;
|
|
2021
|
+
}
|
|
2022
|
+
function wr(e) {
|
|
2023
|
+
return Math.round(parseFloat(e) * 255).toString(16);
|
|
2024
|
+
}
|
|
2025
|
+
function Tr(e) {
|
|
2026
|
+
return q(e) / 255;
|
|
2027
|
+
}
|
|
2028
|
+
var Y = function() {
|
|
2029
|
+
var e = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)", t = "[\\s|\\(]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")\\s*\\)?", n = "[\\s|\\(]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")[,|\\s]+(" + e + ")\\s*\\)?";
|
|
2030
|
+
return {
|
|
2031
|
+
CSS_UNIT: new RegExp(e),
|
|
2032
|
+
rgb: RegExp("rgb" + t),
|
|
2033
|
+
rgba: RegExp("rgba" + n),
|
|
2034
|
+
hsl: RegExp("hsl" + t),
|
|
2035
|
+
hsla: RegExp("hsla" + n),
|
|
2036
|
+
hsv: RegExp("hsv" + t),
|
|
2037
|
+
hsva: RegExp("hsva" + n),
|
|
2038
|
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
2039
|
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
2040
|
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
2041
|
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
2042
|
+
};
|
|
2043
|
+
}();
|
|
2044
|
+
function X(e) {
|
|
2045
|
+
return !!Y.CSS_UNIT.exec(e);
|
|
2046
|
+
}
|
|
2047
|
+
function Er(e) {
|
|
2048
|
+
e = e.replace(qn, "").replace(Jn, "").toLowerCase();
|
|
2049
|
+
var t = !1;
|
|
2050
|
+
if (gr[e]) e = gr[e], t = !0;
|
|
2051
|
+
else if (e == "transparent") return {
|
|
2052
|
+
r: 0,
|
|
2053
|
+
g: 0,
|
|
2054
|
+
b: 0,
|
|
2055
|
+
a: 0,
|
|
2056
|
+
format: "name"
|
|
2057
|
+
};
|
|
2058
|
+
var n;
|
|
2059
|
+
return (n = Y.rgb.exec(e)) ? {
|
|
2060
|
+
r: n[1],
|
|
2061
|
+
g: n[2],
|
|
2062
|
+
b: n[3]
|
|
2063
|
+
} : (n = Y.rgba.exec(e)) ? {
|
|
2064
|
+
r: n[1],
|
|
2065
|
+
g: n[2],
|
|
2066
|
+
b: n[3],
|
|
2067
|
+
a: n[4]
|
|
2068
|
+
} : (n = Y.hsl.exec(e)) ? {
|
|
2069
|
+
h: n[1],
|
|
2070
|
+
s: n[2],
|
|
2071
|
+
l: n[3]
|
|
2072
|
+
} : (n = Y.hsla.exec(e)) ? {
|
|
2073
|
+
h: n[1],
|
|
2074
|
+
s: n[2],
|
|
2075
|
+
l: n[3],
|
|
2076
|
+
a: n[4]
|
|
2077
|
+
} : (n = Y.hsv.exec(e)) ? {
|
|
2078
|
+
h: n[1],
|
|
2079
|
+
s: n[2],
|
|
2080
|
+
v: n[3]
|
|
2081
|
+
} : (n = Y.hsva.exec(e)) ? {
|
|
2082
|
+
h: n[1],
|
|
2083
|
+
s: n[2],
|
|
2084
|
+
v: n[3],
|
|
2085
|
+
a: n[4]
|
|
2086
|
+
} : (n = Y.hex8.exec(e)) ? {
|
|
2087
|
+
r: q(n[1]),
|
|
2088
|
+
g: q(n[2]),
|
|
2089
|
+
b: q(n[3]),
|
|
2090
|
+
a: Tr(n[4]),
|
|
2091
|
+
format: t ? "name" : "hex8"
|
|
2092
|
+
} : (n = Y.hex6.exec(e)) ? {
|
|
2093
|
+
r: q(n[1]),
|
|
2094
|
+
g: q(n[2]),
|
|
2095
|
+
b: q(n[3]),
|
|
2096
|
+
format: t ? "name" : "hex"
|
|
2097
|
+
} : (n = Y.hex4.exec(e)) ? {
|
|
2098
|
+
r: q(n[1] + "" + n[1]),
|
|
2099
|
+
g: q(n[2] + "" + n[2]),
|
|
2100
|
+
b: q(n[3] + "" + n[3]),
|
|
2101
|
+
a: Tr(n[4] + "" + n[4]),
|
|
2102
|
+
format: t ? "name" : "hex8"
|
|
2103
|
+
} : (n = Y.hex3.exec(e)) ? {
|
|
2104
|
+
r: q(n[1] + "" + n[1]),
|
|
2105
|
+
g: q(n[2] + "" + n[2]),
|
|
2106
|
+
b: q(n[3] + "" + n[3]),
|
|
2107
|
+
format: t ? "name" : "hex"
|
|
2108
|
+
} : !1;
|
|
2109
|
+
}
|
|
2110
|
+
function Dr(e) {
|
|
2111
|
+
var t, n;
|
|
2112
|
+
return e ||= {
|
|
2113
|
+
level: "AA",
|
|
2114
|
+
size: "small"
|
|
2115
|
+
}, t = (e.level || "AA").toUpperCase(), n = (e.size || "small").toLowerCase(), t !== "AA" && t !== "AAA" && (t = "AA"), n !== "small" && n !== "large" && (n = "small"), {
|
|
2116
|
+
level: t,
|
|
2117
|
+
size: n
|
|
2118
|
+
};
|
|
2119
|
+
}
|
|
2120
|
+
var Or = (e, t, n = !1) => {
|
|
2121
|
+
if (n) switch (t) {
|
|
2122
|
+
case "rgb": return e.toRgb();
|
|
2123
|
+
case "prgb": return e.toPercentageRgb();
|
|
2124
|
+
case "hsl": return e.toHsl();
|
|
2125
|
+
case "hsv": return e.toHsv();
|
|
2126
|
+
default: return null;
|
|
2127
|
+
}
|
|
2128
|
+
else {
|
|
2129
|
+
let n = t;
|
|
2130
|
+
t === "hex" && e.getAlpha() < 1 && (n = "hex8");
|
|
2131
|
+
let r = e.toString(n);
|
|
2132
|
+
try {
|
|
2133
|
+
r = JSON.parse(r);
|
|
2134
|
+
} catch {}
|
|
2135
|
+
return r;
|
|
2136
|
+
}
|
|
2137
|
+
}, kr = (e, t) => !!(Object.prototype.hasOwnProperty.call(e, t) && typeof e[t] < "u"), Ar = (e) => typeof e > "u", Z = [
|
|
2138
|
+
"update:tinyColor",
|
|
2139
|
+
"update:modelValue",
|
|
2140
|
+
"input"
|
|
2141
|
+
];
|
|
2142
|
+
function jr(e, t, n) {
|
|
2143
|
+
let i, a, o = r({
|
|
2144
|
+
get: () => {
|
|
2145
|
+
let { modelValue: t, tinyColor: n, value: r } = e, o = n ?? t ?? r;
|
|
2146
|
+
return Ar(a) && (Ar(r) || (a = G(r).getFormat()), Ar(t) || (a = G(t).getFormat())), Ar(i) && (typeof r == "object" && !(r instanceof G) && (i = !0), typeof t == "object" && (i = !0)), G(o);
|
|
2147
|
+
},
|
|
2148
|
+
set: (e) => {
|
|
2149
|
+
s(e);
|
|
2150
|
+
}
|
|
2151
|
+
}), s = (n) => {
|
|
2152
|
+
let r = G(n);
|
|
2153
|
+
kr(e, "tinyColor") && t("update:tinyColor", r), kr(e, "modelValue") && t("update:modelValue", Or(r, a, i)), kr(e, "value") && t("input", Or(r, a, i));
|
|
2154
|
+
};
|
|
2155
|
+
return o;
|
|
2156
|
+
}
|
|
2157
|
+
var Mr = (e) => {
|
|
2158
|
+
let t = {
|
|
2159
|
+
x: 0,
|
|
2160
|
+
y: 0
|
|
2161
|
+
};
|
|
2162
|
+
return e instanceof MouseEvent && (t.x = e.pageX, t.y = e.pageY), typeof TouchEvent < "u" && e instanceof TouchEvent && (t.x = e.touches?.[0] ? e.touches[0].pageX : e.changedTouches?.[0] ? e.changedTouches[0].pageX : 0, t.y = e.touches?.[0] ? e.touches[0].pageY : e.changedTouches?.[0] ? e.changedTouches[0].pageY : 0), t;
|
|
2163
|
+
}, Nr = () => ({
|
|
2164
|
+
x: window.scrollX || window.pageXOffset || document.documentElement.scrollLeft || 0,
|
|
2165
|
+
y: window.scrollY || window.pageYOffset || document.documentElement.scrollTop || 0
|
|
2166
|
+
}), Pr = (e) => {
|
|
2167
|
+
let { x: t, y: n } = Nr(), r = e.getBoundingClientRect();
|
|
2168
|
+
return {
|
|
2169
|
+
x: r.left + t,
|
|
2170
|
+
y: r.top + n
|
|
2171
|
+
};
|
|
2172
|
+
}, Fr = (e) => e.code === "ArrowUp" || e.keyCode === 38 ? "up" : e.code === "ArrowDown" || e.keyCode === 40 ? "down" : e.code === "ArrowLeft" || e.keyCode === 37 ? "left" : e.code === "ArrowRight" || e.keyCode === 39 ? "right" : null;
|
|
2173
|
+
function Ir(e) {
|
|
2174
|
+
let t = e.toString();
|
|
2175
|
+
return t.indexOf(".") === -1 ? 0 : t.split(".")[1].length;
|
|
2176
|
+
}
|
|
2177
|
+
function Lr(e, t, n) {
|
|
2178
|
+
return Math.min(Math.max(e, t), n);
|
|
2179
|
+
}
|
|
2180
|
+
var Rr = (e, t = 20) => {
|
|
2181
|
+
let n, r, i;
|
|
2182
|
+
return (...a) => {
|
|
2183
|
+
n ? (clearTimeout(r), r = setTimeout(() => {
|
|
2184
|
+
Date.now() - i >= t && (e(...a), i = Date.now());
|
|
2185
|
+
}, Math.max(t - (Date.now() - i), 0))) : (e(...a), i = Date.now(), n = !0);
|
|
2186
|
+
};
|
|
2187
|
+
}, zr = ["aria-valuetext"], Br = /* @__PURE__ */ u({
|
|
2188
|
+
__name: "SaturationSlider",
|
|
2189
|
+
props: {
|
|
2190
|
+
hue: {},
|
|
2191
|
+
tinyColor: {},
|
|
2192
|
+
modelValue: {},
|
|
2193
|
+
value: {}
|
|
2194
|
+
},
|
|
2195
|
+
emits: ["change"].concat(Z),
|
|
2196
|
+
setup(e, { emit: t }) {
|
|
2197
|
+
let n = t, i = e, a = x(0), c = jr(i, n), l = r(() => c.value.toHsv()), u = r(() => i.hue ?? l.value.h), d = r(() => `hsl(${u.value}, 100%, 50%)`), f = r(() => -(l.value.v * 100) + 1 + 100 + "%"), p = r(() => l.value.v <= .01 ? a.value * 100 + "%" : l.value.s * 100 + "%"), m = x(null);
|
|
2198
|
+
function h(e) {
|
|
2199
|
+
let t = m.value;
|
|
2200
|
+
if (!t) return;
|
|
2201
|
+
let n = t.clientWidth, r = t.clientHeight, { x: i, y: o } = Pr(t), { x: s, y: c } = Mr(e), d = Lr(s - i, 0, n), f = Lr(c - o, 0, r), p = d / n, h = Lr(1 - f / r, 0, 1);
|
|
2202
|
+
a.value = p;
|
|
2203
|
+
let g = Math.round(p * 100), v = Math.round(h * 100);
|
|
2204
|
+
g === 1 && (g = .01), v === 1 && (v = .01), _({
|
|
2205
|
+
h: u.value,
|
|
2206
|
+
s: g,
|
|
2207
|
+
v,
|
|
2208
|
+
a: l.value.a
|
|
2209
|
+
});
|
|
2210
|
+
}
|
|
2211
|
+
function _(e) {
|
|
2212
|
+
c.value = e;
|
|
2213
|
+
}
|
|
2214
|
+
let b = Rr(h, 20);
|
|
2215
|
+
function S(e) {
|
|
2216
|
+
e.preventDefault(), e.type.startsWith("mouse") ? (window.addEventListener("mousemove", b), window.addEventListener("mouseup", b), window.addEventListener("mouseup", C)) : e.type.startsWith("touch") && (window.addEventListener("touchmove", b), window.addEventListener("touchend", b), window.addEventListener("touchend", C));
|
|
2217
|
+
}
|
|
2218
|
+
function C() {
|
|
2219
|
+
w();
|
|
2220
|
+
}
|
|
2221
|
+
function w() {
|
|
2222
|
+
window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", b), window.removeEventListener("mouseup", C), window.removeEventListener("touchmove", b), window.removeEventListener("touchend", b), window.removeEventListener("touchend", C);
|
|
2223
|
+
}
|
|
2224
|
+
function T(e) {
|
|
2225
|
+
switch (e.preventDefault(), Fr(e)) {
|
|
2226
|
+
case "left": {
|
|
2227
|
+
let e = l.value.s - .01;
|
|
2228
|
+
_({
|
|
2229
|
+
...l.value,
|
|
2230
|
+
s: e >= 0 ? e : 0
|
|
2231
|
+
});
|
|
2232
|
+
break;
|
|
2233
|
+
}
|
|
2234
|
+
case "right": {
|
|
2235
|
+
let e = l.value.s + .01;
|
|
2236
|
+
_({
|
|
2237
|
+
...l.value,
|
|
2238
|
+
s: e > 1 ? 1 : e
|
|
2239
|
+
});
|
|
2240
|
+
break;
|
|
2241
|
+
}
|
|
2242
|
+
case "up": {
|
|
2243
|
+
let e = l.value.v + .01;
|
|
2244
|
+
_({
|
|
2245
|
+
...l.value,
|
|
2246
|
+
v: e > 1 ? 1 : e
|
|
2247
|
+
});
|
|
2248
|
+
break;
|
|
2249
|
+
}
|
|
2250
|
+
case "down": {
|
|
2251
|
+
let e = l.value.v - .01;
|
|
2252
|
+
_({
|
|
2253
|
+
...l.value,
|
|
2254
|
+
v: e < 0 ? 0 : e
|
|
2255
|
+
});
|
|
2256
|
+
break;
|
|
2257
|
+
}
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
return v(() => {
|
|
2261
|
+
w();
|
|
2262
|
+
}), (e, t) => (y(), o("div", {
|
|
2263
|
+
class: "vc-saturation-slider bg",
|
|
2264
|
+
style: g({ background: d.value }),
|
|
2265
|
+
ref_key: "containerRef",
|
|
2266
|
+
ref: m,
|
|
2267
|
+
onMousedown: S,
|
|
2268
|
+
onTouchstart: S,
|
|
2269
|
+
role: "application",
|
|
2270
|
+
"aria-label": "Saturation and brightness picker"
|
|
2271
|
+
}, [
|
|
2272
|
+
t[1] ||= s("div", { class: "bg white" }, null, -1),
|
|
2273
|
+
t[2] ||= s("div", { class: "bg black" }, null, -1),
|
|
2274
|
+
s("div", {
|
|
2275
|
+
class: "picker-wrap",
|
|
2276
|
+
style: g({
|
|
2277
|
+
top: f.value,
|
|
2278
|
+
left: p.value
|
|
2279
|
+
}),
|
|
2280
|
+
role: "slider",
|
|
2281
|
+
tabindex: "0",
|
|
2282
|
+
"aria-valuemin": "0",
|
|
2283
|
+
"aria-valuemax": "1",
|
|
2284
|
+
"aria-label": "press arrow to change saturation or brightness",
|
|
2285
|
+
"aria-valuenow": "?",
|
|
2286
|
+
"aria-valuetext": `saturation: ${l.value.s.toFixed(0)}%, brightness: ${l.value.v.toFixed(0)}%`,
|
|
2287
|
+
onKeydown: T
|
|
2288
|
+
}, t[0] ||= [s("div", { class: "picker" }, null, -1)], 44, zr)
|
|
2289
|
+
], 36));
|
|
2290
|
+
}
|
|
2291
|
+
}), Q = (e, t) => {
|
|
2292
|
+
let n = e.__vccOpts || e;
|
|
2293
|
+
for (let [e, r] of t) n[e] = r;
|
|
2294
|
+
return n;
|
|
2295
|
+
}, Vr = /* @__PURE__ */ Q(Br, [["__scopeId", "data-v-4d048d6e"]]), Hr = (e) => typeof e < "u", Ur = { class: "vc-base-slider" }, Wr = {
|
|
2296
|
+
key: 0,
|
|
2297
|
+
class: "background"
|
|
2298
|
+
}, Gr = [
|
|
2299
|
+
"aria-label",
|
|
2300
|
+
"aria-valuemax",
|
|
2301
|
+
"aria-valuenow"
|
|
2302
|
+
], Kr = /* @__PURE__ */ Q(/* @__PURE__ */ u({
|
|
2303
|
+
__name: "BaseSlider",
|
|
2304
|
+
props: {
|
|
2305
|
+
direction: { default: "horizontal" },
|
|
2306
|
+
modelValue: { default: 0 },
|
|
2307
|
+
value: { default: 0 },
|
|
2308
|
+
max: { default: 100 },
|
|
2309
|
+
step: {},
|
|
2310
|
+
ariaLabel: { default: "slider" }
|
|
2311
|
+
},
|
|
2312
|
+
emits: ["input", "update:modelValue"],
|
|
2313
|
+
setup(e, { emit: t }) {
|
|
2314
|
+
let n = e, i = t, c = r(() => n.modelValue ?? n.value), l = r(() => {
|
|
2315
|
+
let e = c.value / n.max;
|
|
2316
|
+
return n.direction === "vertical" && (e = 1 - e), 100 * e + "%";
|
|
2317
|
+
}), u = x(null);
|
|
2318
|
+
function d(e) {
|
|
2319
|
+
Hr(e) && (i("input", e), i("update:modelValue", e));
|
|
2320
|
+
}
|
|
2321
|
+
function f(e) {
|
|
2322
|
+
let { direction: t, max: r } = n, i = u.value;
|
|
2323
|
+
if (!i) return;
|
|
2324
|
+
let a = i.clientWidth, o = i.clientHeight, { x: s, y: c } = Pr(i), { x: l, y: f } = Mr(e), p = l - s, m = f - c, h;
|
|
2325
|
+
h = t === "vertical" ? m < 0 ? r : m > o ? 0 : (1 - m / o) * r : p < 0 ? 0 : p > a ? r : p / a * r, d(h);
|
|
2326
|
+
}
|
|
2327
|
+
let p = Rr(f);
|
|
2328
|
+
function m(e) {
|
|
2329
|
+
f(e), e.type.startsWith("mouse") ? (window.addEventListener("mousemove", p), window.addEventListener("mouseup", _)) : (window.addEventListener("touchmove", p), window.addEventListener("touchend", _));
|
|
2330
|
+
}
|
|
2331
|
+
function _() {
|
|
2332
|
+
b();
|
|
2333
|
+
}
|
|
2334
|
+
function b() {
|
|
2335
|
+
window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", _), window.removeEventListener("touchmove", p), window.removeEventListener("touchend", _);
|
|
2336
|
+
}
|
|
2337
|
+
function S(e) {
|
|
2338
|
+
e.preventDefault();
|
|
2339
|
+
let { direction: t, max: r } = n, i = Fr(e), a = n.step ?? r / 100, o = c.value, s;
|
|
2340
|
+
switch (i) {
|
|
2341
|
+
case "left":
|
|
2342
|
+
if (t !== "horizontal") return;
|
|
2343
|
+
s = o - a < 0 ? 0 : o - a;
|
|
2344
|
+
break;
|
|
2345
|
+
case "right":
|
|
2346
|
+
if (t !== "horizontal") return;
|
|
2347
|
+
s = o + a > r ? r : o + a;
|
|
2348
|
+
break;
|
|
2349
|
+
case "down":
|
|
2350
|
+
if (t !== "vertical") return;
|
|
2351
|
+
s = o - a < 0 ? 0 : o - a;
|
|
2352
|
+
break;
|
|
2353
|
+
case "up":
|
|
2354
|
+
if (t !== "vertical") return;
|
|
2355
|
+
s = o + a > r ? r : o + a;
|
|
2356
|
+
break;
|
|
2357
|
+
}
|
|
2358
|
+
d(s);
|
|
2359
|
+
}
|
|
2360
|
+
return v(() => {
|
|
2361
|
+
b();
|
|
2362
|
+
}), (e, t) => (y(), o("div", Ur, [e.$slots.background ? (y(), o("div", Wr, [C(e.$slots, "background", {}, void 0, !0)])) : a("", !0), s("div", {
|
|
2363
|
+
class: h({
|
|
2364
|
+
slider: !0,
|
|
2365
|
+
horizontal: e.direction === "horizontal",
|
|
2366
|
+
vertical: e.direction === "vertical"
|
|
2367
|
+
}),
|
|
2368
|
+
ref_key: "containerRef",
|
|
2369
|
+
ref: u,
|
|
2370
|
+
onMousedown: m,
|
|
2371
|
+
onTouchstart: m,
|
|
2372
|
+
role: "slider",
|
|
2373
|
+
"aria-label": e.ariaLabel,
|
|
2374
|
+
"aria-valuemax": e.max,
|
|
2375
|
+
"aria-valuemin": "0",
|
|
2376
|
+
"aria-valuenow": c.value.toFixed(1),
|
|
2377
|
+
tabindex: "0",
|
|
2378
|
+
onKeydown: S
|
|
2379
|
+
}, [s("div", {
|
|
2380
|
+
class: "picker-wrap",
|
|
2381
|
+
style: g({
|
|
2382
|
+
left: e.direction === "horizontal" ? l.value : 0,
|
|
2383
|
+
top: e.direction === "vertical" ? l.value : 0
|
|
2384
|
+
}),
|
|
2385
|
+
role: "presentation"
|
|
2386
|
+
}, [C(e.$slots, "picker", {}, () => [t[0] ||= s("div", { class: "picker" }, null, -1)], !0)], 4)], 42, Gr)]));
|
|
2387
|
+
}
|
|
2388
|
+
}), [["__scopeId", "data-v-972b0fad"]]), qr = /* @__PURE__ */ Q(/* @__PURE__ */ u({
|
|
2389
|
+
__name: "HueSlider",
|
|
2390
|
+
props: {
|
|
2391
|
+
direction: { default: "horizontal" },
|
|
2392
|
+
modelValue: { default: 0 }
|
|
2393
|
+
},
|
|
2394
|
+
emits: ["update:modelValue"],
|
|
2395
|
+
setup(e, { emit: t }) {
|
|
2396
|
+
D((e) => ({ "2f44f39d": o.value }));
|
|
2397
|
+
let n = e, a = t, o = r(() => `linear-gradient(to ${n.direction === "horizontal" ? "right" : "top"}, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)`), c = r(() => {
|
|
2398
|
+
let e = Number(n.modelValue);
|
|
2399
|
+
return Number.isNaN(e) ? 0 : e;
|
|
2400
|
+
}), l = x();
|
|
2401
|
+
k(c, (e, t) => {
|
|
2402
|
+
e !== 0 && e - t > 0 && (l.value = "right"), e !== 0 && e - t < 0 && (l.value = "left");
|
|
2403
|
+
});
|
|
2404
|
+
let u = r(() => n.direction === "vertical" ? c.value === 0 && l.value === "right" ? 0 : c.value : n.direction === "horizontal" ? c.value === 0 && l.value === "right" ? 360 : c.value : 0);
|
|
2405
|
+
function d(e) {
|
|
2406
|
+
f(Math.round(e));
|
|
2407
|
+
}
|
|
2408
|
+
function f(e) {
|
|
2409
|
+
a("update:modelValue", e);
|
|
2410
|
+
}
|
|
2411
|
+
return (e, t) => (y(), i(Kr, {
|
|
2412
|
+
class: "vc-hue-slider",
|
|
2413
|
+
max: 360,
|
|
2414
|
+
step: 1,
|
|
2415
|
+
modelValue: u.value,
|
|
2416
|
+
direction: e.direction,
|
|
2417
|
+
"onUpdate:modelValue": d,
|
|
2418
|
+
"aria-label": "Hue"
|
|
2419
|
+
}, {
|
|
2420
|
+
background: A(() => t[0] ||= [s("div", { class: "gradient" }, null, -1)]),
|
|
2421
|
+
picker: A(() => [C(e.$slots, "default", {}, void 0, !0)]),
|
|
2422
|
+
_: 3
|
|
2423
|
+
}, 8, ["modelValue", "direction"]));
|
|
2424
|
+
}
|
|
2425
|
+
}), [["__scopeId", "data-v-5367c985"]]), Jr = /* @__PURE__ */ Q(/* @__PURE__ */ u({
|
|
2426
|
+
__name: "CheckerboardBG",
|
|
2427
|
+
props: {
|
|
2428
|
+
size: { default: 8 },
|
|
2429
|
+
white: { default: "#fff" },
|
|
2430
|
+
grey: { default: "#e6e6e6" }
|
|
2431
|
+
},
|
|
2432
|
+
setup(e) {
|
|
2433
|
+
let t = e;
|
|
2434
|
+
function n(e, t, n) {
|
|
2435
|
+
if (typeof document > "u") return null;
|
|
2436
|
+
var r = document.createElement("canvas");
|
|
2437
|
+
r.width = r.height = n * 2;
|
|
2438
|
+
var i = r.getContext("2d");
|
|
2439
|
+
return i ? (i.fillStyle = e, i.fillRect(0, 0, r.width, r.height), i.fillStyle = t, i.fillRect(0, 0, n, n), i.translate(n, n), i.fillRect(0, 0, n, n), r.toDataURL()) : null;
|
|
2440
|
+
}
|
|
2441
|
+
function i(e, t, r) {
|
|
2442
|
+
return n(e, t, r);
|
|
2443
|
+
}
|
|
2444
|
+
let a = r(() => `url(${i(t.white, t.grey, t.size)})`);
|
|
2445
|
+
return (e, t) => (y(), o("div", {
|
|
2446
|
+
class: "vc-checkerboard",
|
|
2447
|
+
style: g({ backgroundImage: a.value })
|
|
2448
|
+
}, null, 4));
|
|
2449
|
+
}
|
|
2450
|
+
}), [["__scopeId", "data-v-37d61ccd"]]), Yr = /* @__PURE__ */ Q(/* @__PURE__ */ u({
|
|
2451
|
+
__name: "AlphaSlider",
|
|
2452
|
+
props: {
|
|
2453
|
+
tinyColor: {},
|
|
2454
|
+
modelValue: {},
|
|
2455
|
+
value: {}
|
|
2456
|
+
},
|
|
2457
|
+
emits: Z,
|
|
2458
|
+
setup(e, { emit: t }) {
|
|
2459
|
+
let n = jr(e, t), a = r(() => {
|
|
2460
|
+
let e = n.value.toRgb(), t = [
|
|
2461
|
+
e.r,
|
|
2462
|
+
e.g,
|
|
2463
|
+
e.b
|
|
2464
|
+
].join(",");
|
|
2465
|
+
return "linear-gradient(to right, rgba(" + t + ", 0) 0%, rgba(" + t + ", 1) 100%)";
|
|
2466
|
+
}), o = r(() => n.value.getAlpha());
|
|
2467
|
+
function c(e) {
|
|
2468
|
+
n.value = n.value.setAlpha(e).clone();
|
|
2469
|
+
}
|
|
2470
|
+
return (e, t) => (y(), i(Kr, {
|
|
2471
|
+
class: "vc-alpha-slider",
|
|
2472
|
+
modelValue: o.value,
|
|
2473
|
+
max: 1,
|
|
2474
|
+
"aria-label": "Transparency",
|
|
2475
|
+
"onUpdate:modelValue": c
|
|
2476
|
+
}, {
|
|
2477
|
+
background: A(() => [l(Jr), s("div", {
|
|
2478
|
+
class: "gradient",
|
|
2479
|
+
style: g({ background: a.value })
|
|
2480
|
+
}, null, 4)]),
|
|
2481
|
+
_: 1
|
|
2482
|
+
}, 8, ["modelValue"]));
|
|
2483
|
+
}
|
|
2484
|
+
}), [["__scopeId", "data-v-07dd346b"]]), Xr = { class: "vc-editable-input" }, Zr = ["value", "aria-label"], Qr = {
|
|
2485
|
+
key: 0,
|
|
2486
|
+
class: "vc-input-desc",
|
|
2487
|
+
"aria-hidden": "true"
|
|
2488
|
+
}, $ = /* @__PURE__ */ Q(/* @__PURE__ */ u({
|
|
2489
|
+
__name: "EditableInput",
|
|
2490
|
+
props: {
|
|
2491
|
+
value: {},
|
|
2492
|
+
label: {},
|
|
2493
|
+
desc: {},
|
|
2494
|
+
max: {},
|
|
2495
|
+
min: {},
|
|
2496
|
+
step: { default: 1 },
|
|
2497
|
+
a11y: {}
|
|
2498
|
+
},
|
|
2499
|
+
emits: ["change", "blur"],
|
|
2500
|
+
setup(e, { emit: t }) {
|
|
2501
|
+
let n = e, r = t, i = n.a11y?.label ?? n.label, c = `input__label__${i}__${Math.random().toString().slice(2, 5)}`;
|
|
2502
|
+
function l(e) {
|
|
2503
|
+
let { min: t, max: i } = n;
|
|
2504
|
+
if (Hr(i) && +e > i) {
|
|
2505
|
+
r("change", i);
|
|
2506
|
+
return;
|
|
2507
|
+
}
|
|
2508
|
+
if (Hr(t) && +e < t) {
|
|
2509
|
+
r("change", t);
|
|
2510
|
+
return;
|
|
2511
|
+
}
|
|
2512
|
+
r("change", e);
|
|
2513
|
+
}
|
|
2514
|
+
function u(e) {
|
|
2515
|
+
l(e.target?.value);
|
|
2516
|
+
}
|
|
2517
|
+
function d(e) {
|
|
2518
|
+
r("blur", e);
|
|
2519
|
+
}
|
|
2520
|
+
function f(e) {
|
|
2521
|
+
let t = Number(n.value);
|
|
2522
|
+
if (!isNaN(t)) {
|
|
2523
|
+
let r = n.step, i = Ir(r), a = Fr(e);
|
|
2524
|
+
a === "up" && (l((t + r).toFixed(i)), e.preventDefault()), a === "down" && (l((t - r).toFixed(i)), e.preventDefault());
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
return (e, t) => (y(), o("div", Xr, [
|
|
2528
|
+
s("input", {
|
|
2529
|
+
class: "vc-input-input",
|
|
2530
|
+
value: n.value,
|
|
2531
|
+
onKeydown: f,
|
|
2532
|
+
onInput: u,
|
|
2533
|
+
onBlur: d,
|
|
2534
|
+
"aria-label": E(i),
|
|
2535
|
+
id: c
|
|
2536
|
+
}, null, 40, Zr),
|
|
2537
|
+
s("label", {
|
|
2538
|
+
for: c,
|
|
2539
|
+
class: "vc-input-label",
|
|
2540
|
+
"aria-hidden": "true"
|
|
2541
|
+
}, T(n.label), 1),
|
|
2542
|
+
e.desc ? (y(), o("span", Qr, T(e.desc), 1)) : a("", !0)
|
|
2543
|
+
]));
|
|
2544
|
+
}
|
|
2545
|
+
}), [["__scopeId", "data-v-9c267b2b"]]), $r = (e) => G(e).isValid(), ei = /* @__PURE__ */ u({
|
|
2546
|
+
__name: "HexInput",
|
|
2547
|
+
props: {
|
|
2548
|
+
value: {},
|
|
2549
|
+
label: {},
|
|
2550
|
+
desc: {},
|
|
2551
|
+
a11y: {},
|
|
2552
|
+
type: { default: "hex" },
|
|
2553
|
+
withHash: {
|
|
2554
|
+
type: Boolean,
|
|
2555
|
+
default: !1
|
|
2556
|
+
}
|
|
2557
|
+
},
|
|
2558
|
+
emits: ["change"],
|
|
2559
|
+
setup(e, { emit: t }) {
|
|
2560
|
+
let n = e, r = t, a = {
|
|
2561
|
+
label: n.type === "hex" ? "Hex" : "Hex with transparency",
|
|
2562
|
+
...n.a11y
|
|
2563
|
+
}, o = (e, t = "hex") => {
|
|
2564
|
+
let r = "";
|
|
2565
|
+
return t === "hex" && (r = G(e).toHexString()), t === "hex8" && (r = G(e).toHex8String()), n.withHash !== !0 && (r = r.replace("#", "")), r;
|
|
2566
|
+
}, s = x(o(n.value, n.type));
|
|
2567
|
+
k(() => n.value, (e) => {
|
|
2568
|
+
G.equals(e, s.value) || (s.value = o(e, n.type));
|
|
2569
|
+
});
|
|
2570
|
+
let c = (e) => {
|
|
2571
|
+
if (!e) return;
|
|
2572
|
+
s.value = e;
|
|
2573
|
+
let t = e.length;
|
|
2574
|
+
e[0] === "#" && --t, !(n.type === "hex" && t % 3 != 0 && t !== 8) && (n.type === "hex8" && t !== 8 || $r(e) && r("change", e));
|
|
2575
|
+
}, l = () => {
|
|
2576
|
+
let e = s.value.length;
|
|
2577
|
+
s.value[0] === "#" && --e, !($r(s.value) && (n.type === "hex" && e === 6 || n.type === "hex8" && e === 8)) && (s.value = o(n.value, n.type));
|
|
2578
|
+
};
|
|
2579
|
+
return (e, t) => (y(), i($, {
|
|
2580
|
+
label: n.label,
|
|
2581
|
+
a11y: a,
|
|
2582
|
+
value: s.value,
|
|
2583
|
+
onChange: c,
|
|
2584
|
+
onBlur: l
|
|
2585
|
+
}, null, 8, ["label", "value"]));
|
|
2586
|
+
}
|
|
2587
|
+
});
|
|
2588
|
+
function ti() {
|
|
2589
|
+
let e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
2590
|
+
return e.charAt(Math.floor(Math.random() * 62)) + e.charAt(Math.floor(Math.random() * 62));
|
|
2591
|
+
}
|
|
2592
|
+
var ni = (e) => {
|
|
2593
|
+
let t = x(0), n = `__from__vc__hue__${ti()}`;
|
|
2594
|
+
return k(e, (e) => {
|
|
2595
|
+
if (e[n]) return;
|
|
2596
|
+
let r = e.toHsl().h;
|
|
2597
|
+
r === 0 && t.value !== 0 || (t.value = r);
|
|
2598
|
+
}, { immediate: !0 }), {
|
|
2599
|
+
hueRef: t,
|
|
2600
|
+
updateHueRef: (r) => {
|
|
2601
|
+
let i = G({
|
|
2602
|
+
...e.value.toHsl(),
|
|
2603
|
+
h: r
|
|
2604
|
+
});
|
|
2605
|
+
i[n] = !0, e.value = i, t.value = r;
|
|
2606
|
+
}
|
|
2607
|
+
};
|
|
2608
|
+
}, ri = { class: "saturation" }, ii = { class: "body" }, ai = { class: "controls" }, oi = { class: "color-wrap" }, si = ["aria-label"], ci = { class: "sliders" }, li = { class: "hue-wrap" }, ui = {
|
|
2609
|
+
key: 0,
|
|
2610
|
+
class: "alpha-wrap"
|
|
2611
|
+
}, di = {
|
|
2612
|
+
key: 0,
|
|
2613
|
+
class: "fieldsWrap",
|
|
2614
|
+
"data-testid": "fields"
|
|
2615
|
+
}, fi = {
|
|
2616
|
+
key: 0,
|
|
2617
|
+
class: "fields"
|
|
2618
|
+
}, pi = { class: "field" }, mi = { class: "field" }, hi = { class: "field" }, gi = {
|
|
2619
|
+
key: 0,
|
|
2620
|
+
class: "field"
|
|
2621
|
+
}, _i = {
|
|
2622
|
+
key: 1,
|
|
2623
|
+
class: "fields"
|
|
2624
|
+
}, vi = { class: "field" }, yi = {
|
|
2625
|
+
key: 2,
|
|
2626
|
+
class: "fields"
|
|
2627
|
+
}, bi = { class: "field" }, xi = { class: "field" }, Si = { class: "field" }, Ci = {
|
|
2628
|
+
key: 0,
|
|
2629
|
+
class: "field"
|
|
2630
|
+
}, wi = {
|
|
2631
|
+
class: "toggle-icon",
|
|
2632
|
+
role: "presentation"
|
|
2633
|
+
}, Ti = {
|
|
2634
|
+
style: {
|
|
2635
|
+
width: "24px",
|
|
2636
|
+
height: "24px"
|
|
2637
|
+
},
|
|
2638
|
+
viewBox: "0 0 24 24"
|
|
2639
|
+
}, Ei = {
|
|
2640
|
+
class: "toggle-icon_highlighted",
|
|
2641
|
+
role: "presentation"
|
|
2642
|
+
}, Di = /* @__PURE__ */ Q(/* @__PURE__ */ u({
|
|
2643
|
+
__name: "ChromePicker",
|
|
2644
|
+
props: {
|
|
2645
|
+
disableAlpha: { type: Boolean },
|
|
2646
|
+
disableFields: { type: Boolean },
|
|
2647
|
+
formats: { default: () => [
|
|
2648
|
+
"rgb",
|
|
2649
|
+
"hex",
|
|
2650
|
+
"hsl"
|
|
2651
|
+
] },
|
|
2652
|
+
tinyColor: {},
|
|
2653
|
+
modelValue: {},
|
|
2654
|
+
value: {}
|
|
2655
|
+
},
|
|
2656
|
+
emits: Z,
|
|
2657
|
+
setup(e, { emit: t }) {
|
|
2658
|
+
let n = e, c = jr(n, t), { hueRef: u, updateHueRef: d } = ni(c), p = x(0), m = x(!1), _ = r(() => {
|
|
2659
|
+
let e = c.value.toRgb();
|
|
2660
|
+
return "rgba(" + [
|
|
2661
|
+
e.r,
|
|
2662
|
+
e.g,
|
|
2663
|
+
e.b,
|
|
2664
|
+
c.value.getAlpha()
|
|
2665
|
+
].join(",") + ")";
|
|
2666
|
+
}), v = r(() => {
|
|
2667
|
+
let { h: e, s: t, l: n } = c.value.toHsl();
|
|
2668
|
+
return {
|
|
2669
|
+
h: e.toFixed(),
|
|
2670
|
+
s: `${(t * 100).toFixed()}%`,
|
|
2671
|
+
l: `${(n * 100).toFixed()}%`
|
|
2672
|
+
};
|
|
2673
|
+
}), b = r(() => c.value.toRgb()), S = r(() => Number(c.value.getAlpha().toFixed(2))), C = /* @__PURE__ */ new Set([
|
|
2674
|
+
"hex",
|
|
2675
|
+
"hsl",
|
|
2676
|
+
"rgb"
|
|
2677
|
+
]), w = r(() => {
|
|
2678
|
+
let e = /* @__PURE__ */ new Set(), t = [], r = n.formats;
|
|
2679
|
+
for (let n of r) if (C.has(n)) {
|
|
2680
|
+
let r = n;
|
|
2681
|
+
e.has(r) || (e.add(r), t.push(r));
|
|
2682
|
+
}
|
|
2683
|
+
return t;
|
|
2684
|
+
}), T = r(() => {
|
|
2685
|
+
let { disableFields: e, formats: t } = n;
|
|
2686
|
+
return !(e === !0 || !Array.isArray(t) || w.value.length === 0);
|
|
2687
|
+
}), D = (e) => w.value.includes(e), O = (e) => w.value.indexOf(e), ee = (e) => {
|
|
2688
|
+
c.value = e;
|
|
2689
|
+
}, te = (e, t) => {
|
|
2690
|
+
if (!t || isNaN(Number(t))) return;
|
|
2691
|
+
let n = { [e]: t };
|
|
2692
|
+
c.value = {
|
|
2693
|
+
...b.value,
|
|
2694
|
+
a: S.value,
|
|
2695
|
+
...n
|
|
2696
|
+
};
|
|
2697
|
+
}, k = (e, t) => {
|
|
2698
|
+
if (!t) return;
|
|
2699
|
+
let n = { [e]: +t };
|
|
2700
|
+
(e === "s" || e === "l") && (n[e] = t.replace("%", "") / 100), c.value = {
|
|
2701
|
+
...c.value.toHsl(),
|
|
2702
|
+
a: S.value,
|
|
2703
|
+
...n
|
|
2704
|
+
};
|
|
2705
|
+
}, A = () => {
|
|
2706
|
+
if (p.value === w.value.length - 1) {
|
|
2707
|
+
p.value = 0;
|
|
2708
|
+
return;
|
|
2709
|
+
}
|
|
2710
|
+
p.value++;
|
|
2711
|
+
}, ae = () => {
|
|
2712
|
+
m.value = !0;
|
|
2713
|
+
}, oe = () => {
|
|
2714
|
+
m.value = !1;
|
|
2715
|
+
};
|
|
2716
|
+
return (e, t) => (y(), o("div", {
|
|
2717
|
+
role: "application",
|
|
2718
|
+
"aria-label": "Chrome Color Picker",
|
|
2719
|
+
class: h(["vc-chrome-picker", e.disableAlpha ? "alpha-disabled" : ""])
|
|
2720
|
+
}, [s("div", ri, [l(Vr, {
|
|
2721
|
+
tinyColor: E(c),
|
|
2722
|
+
"onUpdate:tinyColor": t[0] ||= (e) => f(c) ? c.value = e : null,
|
|
2723
|
+
hue: E(u)
|
|
2724
|
+
}, null, 8, ["tinyColor", "hue"])]), s("div", ii, [s("div", ai, [s("div", oi, [s("div", {
|
|
2725
|
+
class: "active-color",
|
|
2726
|
+
style: g({ backgroundColor: _.value }),
|
|
2727
|
+
role: "presentation",
|
|
2728
|
+
"aria-live": "polite",
|
|
2729
|
+
"aria-label": `Current color is ${_.value}`
|
|
2730
|
+
}, null, 12, si), n.disableAlpha ? a("", !0) : (y(), i(Jr, { key: 0 }))]), s("div", ci, [s("div", li, [l(qr, {
|
|
2731
|
+
modelValue: E(u),
|
|
2732
|
+
"onUpdate:modelValue": E(d)
|
|
2733
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])]), n.disableAlpha ? a("", !0) : (y(), o("div", ui, [l(Yr, {
|
|
2734
|
+
tinyColor: E(c),
|
|
2735
|
+
"onUpdate:tinyColor": t[1] ||= (e) => f(c) ? c.value = e : null
|
|
2736
|
+
}, null, 8, ["tinyColor"])]))])]), T.value ? (y(), o("div", di, [
|
|
2737
|
+
D("rgb") ? re((y(), o("div", fi, [
|
|
2738
|
+
s("div", pi, [l($, {
|
|
2739
|
+
label: "r",
|
|
2740
|
+
value: b.value.r,
|
|
2741
|
+
onChange: t[2] ||= (e) => te("r", e),
|
|
2742
|
+
a11y: { label: "Red" }
|
|
2743
|
+
}, null, 8, ["value"])]),
|
|
2744
|
+
s("div", mi, [l($, {
|
|
2745
|
+
label: "g",
|
|
2746
|
+
value: b.value.g,
|
|
2747
|
+
onChange: t[3] ||= (e) => te("g", e),
|
|
2748
|
+
a11y: { label: "Green" }
|
|
2749
|
+
}, null, 8, ["value"])]),
|
|
2750
|
+
s("div", hi, [l($, {
|
|
2751
|
+
label: "b",
|
|
2752
|
+
value: b.value.b,
|
|
2753
|
+
onChange: t[4] ||= (e) => te("b", e),
|
|
2754
|
+
a11y: { label: "Blue" }
|
|
2755
|
+
}, null, 8, ["value"])]),
|
|
2756
|
+
e.disableAlpha ? a("", !0) : (y(), o("div", gi, [l($, {
|
|
2757
|
+
label: "a",
|
|
2758
|
+
value: S.value,
|
|
2759
|
+
step: .01,
|
|
2760
|
+
max: 1,
|
|
2761
|
+
onChange: t[5] ||= (e) => te("a", e),
|
|
2762
|
+
a11y: { label: "Transparency" }
|
|
2763
|
+
}, null, 8, ["value"])]))
|
|
2764
|
+
], 512)), [[ne, p.value === O("rgb")]]) : a("", !0),
|
|
2765
|
+
D("hex") ? re((y(), o("div", _i, [s("div", vi, [l(ei, {
|
|
2766
|
+
type: S.value === 1 ? "hex" : "hex8",
|
|
2767
|
+
label: "hex",
|
|
2768
|
+
value: E(c).toHex8String(),
|
|
2769
|
+
onChange: ee,
|
|
2770
|
+
"with-hash": !0
|
|
2771
|
+
}, null, 8, ["type", "value"])])], 512)), [[ne, p.value === O("hex")]]) : a("", !0),
|
|
2772
|
+
D("hsl") ? re((y(), o("div", yi, [
|
|
2773
|
+
s("div", bi, [l($, {
|
|
2774
|
+
label: "h",
|
|
2775
|
+
value: E(u).toFixed(),
|
|
2776
|
+
onChange: t[6] ||= (e) => k("h", e),
|
|
2777
|
+
a11y: { label: "Hue" }
|
|
2778
|
+
}, null, 8, ["value"])]),
|
|
2779
|
+
s("div", xi, [l($, {
|
|
2780
|
+
label: "s",
|
|
2781
|
+
value: v.value.s,
|
|
2782
|
+
onChange: t[7] ||= (e) => k("s", e),
|
|
2783
|
+
a11y: { label: "Saturation" }
|
|
2784
|
+
}, null, 8, ["value"])]),
|
|
2785
|
+
s("div", Si, [l($, {
|
|
2786
|
+
label: "l",
|
|
2787
|
+
value: v.value.l,
|
|
2788
|
+
onChange: t[8] ||= (e) => k("l", e),
|
|
2789
|
+
a11y: { label: "Lightness" }
|
|
2790
|
+
}, null, 8, ["value"])]),
|
|
2791
|
+
e.disableAlpha ? a("", !0) : (y(), o("div", Ci, [l($, {
|
|
2792
|
+
label: "a",
|
|
2793
|
+
value: S.value,
|
|
2794
|
+
step: .01,
|
|
2795
|
+
max: 1,
|
|
2796
|
+
onChange: t[9] ||= (e) => k("a", e),
|
|
2797
|
+
a11y: { label: "Transparency" }
|
|
2798
|
+
}, null, 8, ["value"])]))
|
|
2799
|
+
], 512)), [[ne, p.value === O("hsl")]]) : a("", !0),
|
|
2800
|
+
w.value.length > 1 ? (y(), o("div", {
|
|
2801
|
+
key: 3,
|
|
2802
|
+
class: "toggle-btn",
|
|
2803
|
+
onClick: A,
|
|
2804
|
+
onKeydown: [ie(A, ["enter"]), ie(A, ["space"])],
|
|
2805
|
+
onMouseover: ae,
|
|
2806
|
+
onMouseenter: ae,
|
|
2807
|
+
onMouseout: oe,
|
|
2808
|
+
onFocus: ae,
|
|
2809
|
+
onBlur: oe,
|
|
2810
|
+
role: "button",
|
|
2811
|
+
"aria-label": "Change color format",
|
|
2812
|
+
tabindex: "0"
|
|
2813
|
+
}, [s("div", wi, [(y(), o("svg", Ti, t[10] ||= [s("path", {
|
|
2814
|
+
fill: "currentColor",
|
|
2815
|
+
d: "M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"
|
|
2816
|
+
}, null, -1)]))]), re(s("div", Ei, null, 512), [[ne, E(m)]])], 32)) : a("", !0)
|
|
2817
|
+
])) : a("", !0)])], 2));
|
|
2818
|
+
}
|
|
2819
|
+
}), [["__scopeId", "data-v-dfdde7e0"]]);
|
|
2820
|
+
["change"].concat(Z), ["change"].concat(Z), Z.concat([
|
|
2821
|
+
"ok",
|
|
2822
|
+
"cancel",
|
|
2823
|
+
"reset"
|
|
2824
|
+
]), ["change"].concat(Z);
|
|
2825
|
+
var Oi = { class: "vp-color" }, ki = { class: "vp-color__header" }, Ai = { class: "vp-color__text" }, ji = ["value"], Mi = /* @__PURE__ */ u({
|
|
2826
|
+
__name: "PColor",
|
|
2827
|
+
props: /*@__PURE__*/ p({
|
|
2828
|
+
label: {},
|
|
2829
|
+
tooltip: {},
|
|
2830
|
+
alpha: {
|
|
2831
|
+
type: Boolean,
|
|
2832
|
+
default: !1
|
|
2833
|
+
}
|
|
2834
|
+
}, {
|
|
2835
|
+
modelValue: { required: !0 },
|
|
2836
|
+
modelModifiers: {}
|
|
2837
|
+
}),
|
|
2838
|
+
emits: ["update:modelValue"],
|
|
2839
|
+
setup(e) {
|
|
2840
|
+
let t = O(e, "modelValue"), r = x(!1), c = x(null), u = x(null), { floatingStyles: d } = rn(c, u, {
|
|
2841
|
+
placement: "bottom-start",
|
|
2842
|
+
strategy: "fixed",
|
|
2843
|
+
middleware: [
|
|
2844
|
+
Wt(4),
|
|
2845
|
+
Kt(),
|
|
2846
|
+
Gt({ padding: 8 })
|
|
2847
|
+
]
|
|
2848
|
+
});
|
|
2849
|
+
function f() {
|
|
2850
|
+
r.value = !r.value;
|
|
2851
|
+
}
|
|
2852
|
+
function p(n) {
|
|
2853
|
+
let r = G(n);
|
|
2854
|
+
r.isValid() && (t.value = e.alpha ? r.toHex8String() : r.toHexString());
|
|
2855
|
+
}
|
|
2856
|
+
function m(n) {
|
|
2857
|
+
let r = n.target.value, i = G(r);
|
|
2858
|
+
i.isValid() && (t.value = e.alpha ? i.toHex8String() : i.toHexString());
|
|
2859
|
+
}
|
|
2860
|
+
function h(e) {
|
|
2861
|
+
if (!r.value) return;
|
|
2862
|
+
let t = e.target;
|
|
2863
|
+
c.value?.contains(t) || u.value?.contains(t) || (r.value = !1);
|
|
2864
|
+
}
|
|
2865
|
+
return _(() => document.addEventListener("pointerdown", h)), v(() => document.removeEventListener("pointerdown", h)), (h, _) => (y(), i(W, {
|
|
2866
|
+
label: e.label,
|
|
2867
|
+
tooltip: e.tooltip
|
|
2868
|
+
}, {
|
|
2869
|
+
default: A(() => [s("div", Oi, [s("div", ki, [s("div", {
|
|
2870
|
+
ref_key: "swatchRef",
|
|
2871
|
+
ref: c,
|
|
2872
|
+
class: "vp-color__swatch"
|
|
2873
|
+
}, [s("button", {
|
|
2874
|
+
class: "vp-color__swatch-btn",
|
|
2875
|
+
onClick: f
|
|
2876
|
+
}, [s("div", {
|
|
2877
|
+
class: "vp-color__swatch-btn__color",
|
|
2878
|
+
style: g({ background: t.value })
|
|
2879
|
+
}, null, 4)])], 512), s("div", Ai, [s("input", {
|
|
2880
|
+
class: "vp-text__input",
|
|
2881
|
+
type: "text",
|
|
2882
|
+
value: t.value,
|
|
2883
|
+
onChange: m
|
|
2884
|
+
}, null, 40, ji)])]), (y(), i(n, { to: "body" }, [r.value ? (y(), o("div", {
|
|
2885
|
+
key: 0,
|
|
2886
|
+
ref_key: "pickerRef",
|
|
2887
|
+
ref: u,
|
|
2888
|
+
class: "vp-color__popup",
|
|
2889
|
+
style: g(E(d))
|
|
2890
|
+
}, [l(E(Di), {
|
|
2891
|
+
"model-value": t.value,
|
|
2892
|
+
"disable-alpha": !e.alpha,
|
|
2893
|
+
"onUpdate:modelValue": p
|
|
2894
|
+
}, null, 8, ["model-value", "disable-alpha"])], 4)) : a("", !0)]))])]),
|
|
2895
|
+
_: 1
|
|
2896
|
+
}, 8, ["label", "tooltip"]));
|
|
2897
|
+
}
|
|
2898
|
+
}), Ni = { class: "vp-graph" }, Pi = {
|
|
2899
|
+
class: "vp-graph__svg",
|
|
2900
|
+
viewBox: "0 0 100 100",
|
|
2901
|
+
preserveAspectRatio: "none"
|
|
2902
|
+
}, Fi = ["points"], Ii = /* @__PURE__ */ u({
|
|
2903
|
+
__name: "PGraph",
|
|
2904
|
+
props: {
|
|
2905
|
+
values: {},
|
|
2906
|
+
label: {},
|
|
2907
|
+
tooltip: {},
|
|
2908
|
+
min: {},
|
|
2909
|
+
max: {}
|
|
2910
|
+
},
|
|
2911
|
+
setup(e) {
|
|
2912
|
+
let t = r(() => {
|
|
2913
|
+
if (!e.values.length) return "";
|
|
2914
|
+
let t = e.min ?? Math.min(...e.values), n = (e.max ?? Math.max(...e.values)) - t || 1;
|
|
2915
|
+
return e.values.map((r, i) => `${i / (e.values.length - 1) * 100},${100 - (r - t) / n * 100}`).join(" ");
|
|
2916
|
+
});
|
|
2917
|
+
return (n, r) => (y(), i(W, {
|
|
2918
|
+
label: e.label,
|
|
2919
|
+
tooltip: e.tooltip
|
|
2920
|
+
}, {
|
|
2921
|
+
default: A(() => [s("div", Ni, [(y(), o("svg", Pi, [s("polyline", { points: t.value }, null, 8, Fi)]))])]),
|
|
2922
|
+
_: 1
|
|
2923
|
+
}, 8, ["label", "tooltip"]));
|
|
2924
|
+
}
|
|
2925
|
+
});
|
|
2926
|
+
//#endregion
|
|
2927
|
+
//#region src/composables/usePickerFold.ts
|
|
2928
|
+
function Li(e, t) {
|
|
2929
|
+
let n = x(!1);
|
|
2930
|
+
return k(t, (t) => {
|
|
2931
|
+
let r = e.value;
|
|
2932
|
+
if (r) if (n.value = !1, t) {
|
|
2933
|
+
r.style.transition = "none", r.style.height = "auto", r.offsetHeight;
|
|
2934
|
+
let e = r.clientHeight;
|
|
2935
|
+
r.style.height = "0", r.offsetHeight, r.style.transition = "", r.offsetHeight, r.style.height = e + "px", r.addEventListener("transitionend", (e) => {
|
|
2936
|
+
e.propertyName === "height" && (r.style.height = "auto", n.value = !0);
|
|
2937
|
+
}, { once: !0 });
|
|
2938
|
+
} else r.style.transition = "none", r.style.height = r.clientHeight + "px", r.offsetHeight, r.style.transition = "", r.offsetHeight, r.style.height = "0", r.addEventListener("transitionend", (e) => {
|
|
2939
|
+
e.propertyName === "height" && (r.style.height = "");
|
|
2940
|
+
}, { once: !0 });
|
|
2941
|
+
}), n;
|
|
2942
|
+
}
|
|
2943
|
+
//#endregion
|
|
2944
|
+
//#region src/components/PPoint2d.vue?vue&type=script&setup=true&lang.ts
|
|
2945
|
+
var Ri = { class: "vp-point-2d__header" }, zi = { class: "vp-point-2d__inputs" }, Bi = { style: {
|
|
2946
|
+
display: "flex",
|
|
2947
|
+
gap: "2px"
|
|
2948
|
+
} }, Vi = {
|
|
2949
|
+
class: "vp-text vp-text--number vp-text--first",
|
|
2950
|
+
style: { flex: "1" }
|
|
2951
|
+
}, Hi = ["value"], Ui = {
|
|
2952
|
+
class: "vp-text vp-text--number vp-text--last",
|
|
2953
|
+
style: { flex: "1" }
|
|
2954
|
+
}, Wi = ["value"], Gi = { class: "vp-point-2d__picker-wrap" }, Ki = 160, qi = /* @__PURE__ */ u({
|
|
2955
|
+
__name: "PPoint2d",
|
|
2956
|
+
props: /*@__PURE__*/ p({
|
|
2957
|
+
label: {},
|
|
2958
|
+
tooltip: {},
|
|
2959
|
+
min: { default: () => -1 },
|
|
2960
|
+
max: { default: 1 }
|
|
2961
|
+
}, {
|
|
2962
|
+
modelValue: { required: !0 },
|
|
2963
|
+
modelModifiers: {}
|
|
2964
|
+
}),
|
|
2965
|
+
emits: ["update:modelValue"],
|
|
2966
|
+
setup(e) {
|
|
2967
|
+
let t = O(e, "modelValue"), n = x(!1), a = x(null), o = x(null), c = Li(a, n), l = r(() => t.value.x.toFixed(3)), u = r(() => t.value.y.toFixed(3));
|
|
2968
|
+
function d(t) {
|
|
2969
|
+
return Math.max(e.min, Math.min(e.max, t));
|
|
2970
|
+
}
|
|
2971
|
+
function f(e) {
|
|
2972
|
+
let n = parseFloat(e.target.value);
|
|
2973
|
+
isNaN(n) || (t.value = {
|
|
2974
|
+
x: d(n),
|
|
2975
|
+
y: t.value.y
|
|
2976
|
+
});
|
|
2977
|
+
}
|
|
2978
|
+
function p(e) {
|
|
2979
|
+
let n = parseFloat(e.target.value);
|
|
2980
|
+
isNaN(n) || (t.value = {
|
|
2981
|
+
x: t.value.x,
|
|
2982
|
+
y: d(n)
|
|
2983
|
+
});
|
|
2984
|
+
}
|
|
2985
|
+
function m() {
|
|
2986
|
+
n.value = !n.value;
|
|
2987
|
+
}
|
|
2988
|
+
function v() {
|
|
2989
|
+
let e = o.value;
|
|
2990
|
+
if (!e) return;
|
|
2991
|
+
let t = e.getContext("2d"), n = Ki;
|
|
2992
|
+
t.clearRect(0, 0, n, n), t.fillStyle = "rgba(0,0,0,0.3)", t.fillRect(0, 0, n, n), t.strokeStyle = "rgba(255,255,255,0.1)", t.lineWidth = 1, t.beginPath(), t.moveTo(n / 2, 0), t.lineTo(n / 2, n), t.moveTo(0, n / 2), t.lineTo(n, n / 2), t.stroke();
|
|
2993
|
+
}
|
|
2994
|
+
_(() => {
|
|
2995
|
+
v();
|
|
2996
|
+
});
|
|
2997
|
+
let b = r(() => {
|
|
2998
|
+
let n = e.max - e.min;
|
|
2999
|
+
return (t.value.x - e.min) / n * Ki;
|
|
3000
|
+
}), S = r(() => {
|
|
3001
|
+
let n = e.max - e.min;
|
|
3002
|
+
return Ki - (t.value.y - e.min) / n * Ki;
|
|
3003
|
+
}), C = !1;
|
|
3004
|
+
function w(t) {
|
|
3005
|
+
let n = o.value.getBoundingClientRect(), r = (t.clientX - n.left) / n.width, i = 1 - (t.clientY - n.top) / n.height, a = e.max - e.min;
|
|
3006
|
+
return {
|
|
3007
|
+
x: d(e.min + r * a),
|
|
3008
|
+
y: d(e.min + i * a)
|
|
3009
|
+
};
|
|
3010
|
+
}
|
|
3011
|
+
function T(e) {
|
|
3012
|
+
e.preventDefault(), e.currentTarget.setPointerCapture(e.pointerId), C = !0, t.value = w(e);
|
|
3013
|
+
}
|
|
3014
|
+
function D(e) {
|
|
3015
|
+
C && (t.value = w(e));
|
|
3016
|
+
}
|
|
3017
|
+
function ee() {
|
|
3018
|
+
C = !1;
|
|
3019
|
+
}
|
|
3020
|
+
return (t, r) => (y(), i(W, {
|
|
3021
|
+
label: e.label,
|
|
3022
|
+
tooltip: e.tooltip
|
|
3023
|
+
}, {
|
|
3024
|
+
default: A(() => [s("div", { class: h(["vp-point-2d", {
|
|
3025
|
+
"vp-point-2d--expanded": n.value,
|
|
3026
|
+
"vp-point-2d--complete": E(c)
|
|
3027
|
+
}]) }, [s("div", Ri, [s("button", {
|
|
3028
|
+
class: "vp-point-2d__btn",
|
|
3029
|
+
onClick: m
|
|
3030
|
+
}, [...r[2] ||= [s("svg", { viewBox: "0 0 16 16" }, [s("path", { d: "M8 2 L8 14 M2 8 L14 8" }), s("circle", {
|
|
3031
|
+
cx: "8",
|
|
3032
|
+
cy: "8",
|
|
3033
|
+
r: "1.5"
|
|
3034
|
+
})], -1)]]), s("div", zi, [s("div", Bi, [s("div", Vi, [s("input", {
|
|
3035
|
+
class: "vp-text__input",
|
|
3036
|
+
type: "text",
|
|
3037
|
+
value: l.value,
|
|
3038
|
+
onBlur: f,
|
|
3039
|
+
onKeydown: r[0] ||= ie((e) => e.target.blur(), ["enter"])
|
|
3040
|
+
}, null, 40, Hi)]), s("div", Ui, [s("input", {
|
|
3041
|
+
class: "vp-text__input",
|
|
3042
|
+
type: "text",
|
|
3043
|
+
value: u.value,
|
|
3044
|
+
onBlur: p,
|
|
3045
|
+
onKeydown: r[1] ||= ie((e) => e.target.blur(), ["enter"])
|
|
3046
|
+
}, null, 40, Wi)])])])]), s("div", {
|
|
3047
|
+
ref_key: "panelRef",
|
|
3048
|
+
ref: a,
|
|
3049
|
+
class: "vp-point-2d__picker-panel"
|
|
3050
|
+
}, [s("div", Gi, [
|
|
3051
|
+
s("canvas", {
|
|
3052
|
+
ref_key: "canvasRef",
|
|
3053
|
+
ref: o,
|
|
3054
|
+
class: "vp-point-2d__canvas",
|
|
3055
|
+
height: Ki,
|
|
3056
|
+
width: Ki,
|
|
3057
|
+
onPointerdown: T,
|
|
3058
|
+
onPointermove: D,
|
|
3059
|
+
onPointerup: ee,
|
|
3060
|
+
onPointercancel: ee
|
|
3061
|
+
}, null, 544),
|
|
3062
|
+
s("div", {
|
|
3063
|
+
class: "vp-point-2d__crosshair-h",
|
|
3064
|
+
style: g({ top: S.value + "px" })
|
|
3065
|
+
}, null, 4),
|
|
3066
|
+
s("div", {
|
|
3067
|
+
class: "vp-point-2d__crosshair-v",
|
|
3068
|
+
style: g({ left: b.value + "px" })
|
|
3069
|
+
}, null, 4)
|
|
3070
|
+
])], 512)], 2)]),
|
|
3071
|
+
_: 1
|
|
3072
|
+
}, 8, ["label", "tooltip"]));
|
|
3073
|
+
}
|
|
3074
|
+
});
|
|
3075
|
+
//#endregion
|
|
3076
|
+
export { vn as PButton, En as PCheckbox, Mi as PColor, on as PFolder, Ii as PGraph, W as PLabel, Nn as PMonitor, In as PMonitorMulti, hn as PNumber, qi as PPoint2d, An as PSelect, Sn as PSeparator, Rn as PSlider, Gn as PTab, dn as PText, xe as VPane, j as usePaneConfig };
|