@synnaxlabs/pluto 0.44.0 → 0.44.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Animated-Owbkpo6B.js → Animated-D5cL3URg.js} +2 -2
- package/dist/{Animated-CCN9ByY6.cjs → Animated-DnsZ5vvU.cjs} +1 -1
- package/dist/{Menu-DZ-gh1ky.js → Menu-C-MABQ1r.js} +3 -3
- package/dist/{Menu-BSLsdSQe.cjs → Menu-vR5-lqo4.cjs} +1 -1
- package/dist/{Toggle-BWcSF1BX.cjs → Toggle-Ckdi4fKV.cjs} +1 -1
- package/dist/{Toggle-BUJcWkDS.js → Toggle-Dol9oHzM.js} +1 -1
- package/dist/{Video-BcSAFYkH.cjs → Video-BidrtYj_.cjs} +1 -1
- package/dist/{Video-DqCXiObt.js → Video-Cm8ZBqid.js} +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/css-9yccD6t_.cjs +8 -0
- package/dist/{css-Cg4qHNg7.js → css-Dl9aM7Jz.js} +694 -686
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{eraser-DeKDbhe4.cjs → eraser-CLWNvWDn.cjs} +20 -20
- package/dist/{eraser-BPrMJQSi.js → eraser-CZknVTjw.js} +11 -11
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +6 -6
- package/dist/{external-ZbSTG-v-.js → external-B5RyMtMy.js} +3 -3
- package/dist/{external-BZs08bQT.js → external-B8qSW3N8.js} +3 -3
- package/dist/{external-D9Mbu0wy.cjs → external-BGCkpetp.cjs} +1 -1
- package/dist/{external-D2eCxMkQ.cjs → external-BJ91nMtQ.cjs} +6 -6
- package/dist/{external-CO49SSMt.js → external-BYJw6DJV.js} +3 -3
- package/dist/{external-JZqEUnPB.js → external-B_NFroo8.js} +4 -4
- package/dist/{external-DCftrpz2.js → external-CJZTgfAH.js} +4 -4
- package/dist/{external-Be6wSMuJ.cjs → external-CS6l_QN4.cjs} +1 -1
- package/dist/{external-bO6dVXFd.js → external-CU_XHLqP.js} +151 -143
- package/dist/{external-SZ8meWoz.js → external-CVNscTLA.js} +3 -3
- package/dist/{external-CcIlyM7a.cjs → external-CY2bvy20.cjs} +1 -1
- package/dist/{external-Cdszmp1I.cjs → external-CkvXTCCL.cjs} +1 -1
- package/dist/{external-DVV0t11f.cjs → external-ClD4VLgc.cjs} +1 -1
- package/dist/external-CtooTI5M.cjs +1 -0
- package/dist/{external-C4JmDQou.cjs → external-DFsKdN71.cjs} +1 -1
- package/dist/{external-E3bYM0JI.cjs → external-DNHOS3w0.cjs} +1 -1
- package/dist/{external-BhHJuw2t.js → external-DOd9BcLC.js} +2 -2
- package/dist/{external-CmXsU6yu.cjs → external-DPqPAgoV.cjs} +1 -1
- package/dist/{external-BHiMn0_8.cjs → external-DXY1bIut.cjs} +1 -1
- package/dist/{external-D7fvHJwL.cjs → external-DZqxSCvz.cjs} +1 -1
- package/dist/{external-Dd9YnYGw.js → external-DnnHYQqD.js} +3 -3
- package/dist/{external-fKroctog.js → external-Ylv9Wts9.js} +15 -15
- package/dist/{external-O7GBl914.cjs → external-_eEnQPcq.cjs} +1 -1
- package/dist/{external-CwWs_qf4.js → external-b2X_jilF.js} +2 -2
- package/dist/{external-BXXtl81l.js → external-pm79tCDD.js} +3 -3
- package/dist/{external-Dr1KTRgM.js → external-xfHaehZH.js} +27 -27
- package/dist/flex.cjs +1 -1
- package/dist/flex.js +1 -1
- package/dist/{fontString-BCV37JOn.js → fontString-Bm52S4Lo.js} +2 -2
- package/dist/{fontString-DUff-KJe.cjs → fontString-BptzSQcY.cjs} +1 -1
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +4636 -4601
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/{provider-Y8rmJd2z.js → provider-Bp-CLkh2.js} +1734 -1624
- package/dist/provider-DBSsDoFS.cjs +53 -0
- package/dist/src/channel/LinePlot.d.ts +2 -0
- package/dist/src/channel/LinePlot.d.ts.map +1 -1
- package/dist/src/dialog/Dialog.d.ts.map +1 -1
- package/dist/src/dialog/Frame.d.ts.map +1 -1
- package/dist/src/icon/registry.d.ts +1 -0
- package/dist/src/icon/registry.d.ts.map +1 -1
- package/dist/src/input/Text.d.ts +3 -2
- package/dist/src/input/Text.d.ts.map +1 -1
- package/dist/src/list/useStaticData.d.ts.map +1 -1
- package/dist/src/select/MultipleTrigger.d.ts.map +1 -1
- package/dist/src/select/Static.d.ts +1 -1
- package/dist/src/select/Static.d.ts.map +1 -1
- package/dist/src/telem/aether/transformers.d.ts +28 -2
- package/dist/src/telem/aether/transformers.d.ts.map +1 -1
- package/dist/src/vis/diagram/Diagram.d.ts +6 -0
- package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
- package/dist/src/vis/line/aether/line.d.ts +9 -2
- package/dist/src/vis/line/aether/line.d.ts.map +1 -1
- package/dist/symbols-B15FeAg9.cjs +92 -0
- package/dist/{symbols-DT8-7-NW.js → symbols-Lz5vQQDw.js} +7416 -7399
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text.cjs +1 -1
- package/dist/text.js +2 -2
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/dist/{units-DR4EJndw.cjs → units-BGkvnLO-.cjs} +1 -1
- package/dist/{units-ts2tUMPH.js → units-HcS_zslH.js} +1 -1
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +4 -4
- package/dist/css-BR-Ih764.cjs +0 -8
- package/dist/external-BKWucUPD.cjs +0 -1
- package/dist/provider-Dx_qX7Wi.cjs +0 -53
- package/dist/symbols-BtW1eE35.cjs +0 -92
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import x, { z as a } from "zod";
|
|
2
|
+
const tn = (t) => {
|
|
3
3
|
const e = t.replace(/_[a-z]/g, (r) => r[1].toUpperCase());
|
|
4
4
|
return e.length > 1 && e[0] === e[0].toUpperCase() && e[1] === e[1].toUpperCase() || e.length === 0 ? e : e[0].toLowerCase() + e.slice(1);
|
|
5
|
-
},
|
|
5
|
+
}, lt = (t) => {
|
|
6
6
|
const e = (r, n = Ge) => {
|
|
7
7
|
if (typeof r == "string") return t(r);
|
|
8
8
|
if (Array.isArray(r)) return r.map((o) => e(o, n));
|
|
9
9
|
if (!Fe(r)) return r;
|
|
10
|
-
n =
|
|
10
|
+
n = sn(n);
|
|
11
11
|
const s = {}, i = r;
|
|
12
12
|
return "toJSON" in i && typeof i.toJSON == "function" ? e(i.toJSON(), n) : (Object.keys(i).forEach((o) => {
|
|
13
13
|
let c = i[o];
|
|
14
14
|
const l = t(o);
|
|
15
|
-
n.recursive && (Fe(c) ?
|
|
15
|
+
n.recursive && (Fe(c) ? Rt(c) || (c = e(c, n)) : n.recursiveInArray && jt(c) && (c = [...c].map((f) => {
|
|
16
16
|
let p = f;
|
|
17
|
-
return Fe(f) ?
|
|
17
|
+
return Fe(f) ? Rt(p) || (p = e(f, n)) : jt(f) && (p = e({ key: f }, n).key), p;
|
|
18
18
|
}))), s[l] = c;
|
|
19
19
|
}), s);
|
|
20
20
|
};
|
|
21
21
|
return e;
|
|
22
|
-
},
|
|
22
|
+
}, ct = lt(tn), rn = (t) => (
|
|
23
23
|
// Don't convert the first character and don't convert a character that is after a
|
|
24
24
|
// non-alphanumeric character
|
|
25
25
|
t.replace(
|
|
26
26
|
/([a-z0-9])([A-Z])/g,
|
|
27
27
|
(e, r, n) => `${r}_${n.toLowerCase()}`
|
|
28
28
|
)
|
|
29
|
-
),
|
|
29
|
+
), Ft = lt(rn), Zt = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), nn = [Number, String, Uint8Array], Ge = {
|
|
30
30
|
recursive: !0,
|
|
31
31
|
recursiveInArray: !0
|
|
32
|
-
},
|
|
32
|
+
}, sn = (t = Ge) => (t.recursive == null ? t = Ge : t.recursiveInArray ??= !1, t), jt = (t) => t != null && Array.isArray(t), Fe = (t) => t != null && typeof t == "object" && !Array.isArray(t), Rt = (t) => nn.some((e) => t instanceof e), an = (t) => t.replace(/\s+/g, "-").replace(
|
|
33
33
|
/([a-z0-9])([A-Z])/g,
|
|
34
34
|
(e, r, n) => `${r}-${n.toLowerCase()}`
|
|
35
|
-
).toLowerCase(),
|
|
35
|
+
).toLowerCase(), on = lt(an), uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
36
36
|
__proto__: null,
|
|
37
|
-
camelToSnake:
|
|
38
|
-
capitalize:
|
|
39
|
-
snakeToCamel:
|
|
40
|
-
toKebab:
|
|
37
|
+
camelToSnake: Ft,
|
|
38
|
+
capitalize: Zt,
|
|
39
|
+
snakeToCamel: ct,
|
|
40
|
+
toKebab: on
|
|
41
41
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
42
|
-
let
|
|
42
|
+
let un = class {
|
|
43
43
|
contentType = "application/json";
|
|
44
44
|
decoder;
|
|
45
45
|
encoder;
|
|
@@ -53,15 +53,15 @@ let on = class {
|
|
|
53
53
|
return this.decodeString(this.decoder.decode(e), r);
|
|
54
54
|
}
|
|
55
55
|
decodeString(e, r) {
|
|
56
|
-
const n = JSON.parse(e), s =
|
|
56
|
+
const n = JSON.parse(e), s = ct(n);
|
|
57
57
|
return r != null ? r.parse(s) : s;
|
|
58
58
|
}
|
|
59
59
|
encodeString(e) {
|
|
60
|
-
const r =
|
|
60
|
+
const r = Ft(e);
|
|
61
61
|
return JSON.stringify(r, (n, s) => ArrayBuffer.isView(s) ? Array.from(s) : typeof s == "bigint" ? s.toString() : s);
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
-
const He = new
|
|
64
|
+
const He = new un(), Je = (t) => [...new Set(t)], ln = (t, e, r = !0) => {
|
|
65
65
|
const n = /* @__PURE__ */ new Map();
|
|
66
66
|
return t.forEach((s) => {
|
|
67
67
|
const i = e(s);
|
|
@@ -71,9 +71,9 @@ const He = new on(), Je = (t) => [...new Set(t)], un = (t, e, r = !0) => {
|
|
|
71
71
|
}
|
|
72
72
|
n.set(i, s);
|
|
73
73
|
}), Array.from(n.values());
|
|
74
|
-
},
|
|
74
|
+
}, co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
75
75
|
__proto__: null,
|
|
76
|
-
by:
|
|
76
|
+
by: ln,
|
|
77
77
|
unique: Je
|
|
78
78
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
79
79
|
let J = class {
|
|
@@ -96,8 +96,8 @@ let J = class {
|
|
|
96
96
|
return this.value.toString();
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
-
const
|
|
100
|
-
if (
|
|
99
|
+
const ht = (t) => t != null && typeof t == "object" && "toString" in t, cn = (t) => {
|
|
100
|
+
if (ht(t)) return t?.toString().length === 0;
|
|
101
101
|
switch (typeof t) {
|
|
102
102
|
case "string":
|
|
103
103
|
return t.length === 0;
|
|
@@ -114,13 +114,13 @@ const ct = (t) => t != null && typeof t == "object" && "toString" in t, ln = (t)
|
|
|
114
114
|
default:
|
|
115
115
|
return !1;
|
|
116
116
|
}
|
|
117
|
-
},
|
|
117
|
+
}, fo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
118
118
|
__proto__: null,
|
|
119
119
|
ValueExtension: J,
|
|
120
|
-
isStringer:
|
|
121
|
-
isZero:
|
|
120
|
+
isStringer: ht,
|
|
121
|
+
isZero: cn
|
|
122
122
|
}, Symbol.toStringTag, { value: "Module" })), Be = (t, e = !1) => {
|
|
123
|
-
const r =
|
|
123
|
+
const r = ht(t) ? "stringer" : typeof t;
|
|
124
124
|
let n;
|
|
125
125
|
switch (r) {
|
|
126
126
|
case "string":
|
|
@@ -144,19 +144,19 @@ const ct = (t) => t != null && typeof t == "object" && "toString" in t, ln = (t)
|
|
|
144
144
|
default:
|
|
145
145
|
return console.warn(`sortFunc: unknown type ${r}`), () => -1;
|
|
146
146
|
}
|
|
147
|
-
return e ?
|
|
148
|
-
},
|
|
147
|
+
return e ? Vt(n) : n;
|
|
148
|
+
}, hn = (t, e, r) => {
|
|
149
149
|
const n = Be(e[t], r);
|
|
150
150
|
return (s, i) => n(s[t], i[t]);
|
|
151
|
-
},
|
|
151
|
+
}, fn = (t, e) => t.length !== e.length ? t.length - e.length : t.every((r, n) => r === e[n]) ? 0 : -1, Yt = (t, e) => {
|
|
152
152
|
if (t.length !== e.length) return t.length - e.length;
|
|
153
153
|
if (t.length === 0) return 0;
|
|
154
154
|
const r = Be(t[0]), n = [...t].sort(r), s = [...e].sort(r);
|
|
155
155
|
return n.every((i, o) => i === s[o]) ? 0 : -1;
|
|
156
|
-
},
|
|
156
|
+
}, dn = (t, e) => {
|
|
157
157
|
const r = Je(t), n = Je(e);
|
|
158
|
-
return
|
|
159
|
-
},
|
|
158
|
+
return Yt(r, n);
|
|
159
|
+
}, gn = (t, e) => t === e ? 0 : t === "first" && e === "last" ? 1 : -1, Vt = (t) => (e, r) => t(r, e), ee = 0, xe = -1, $e = 1, Wt = (t) => t < ee, Gt = (t) => t > ee, pn = (t) => t >= ee, Ht = (t) => t === ee, yn = (t, e) => {
|
|
160
160
|
const r = /([a-zA-Z]+)|(\d+)/g, n = t.replace(/[\s_.-]+/g, "").match(r), s = e.replace(/[\s_.-]+/g, "").match(r);
|
|
161
161
|
if (!n || !s) return 0;
|
|
162
162
|
for (let i = 0; i < Math.min(n.length, s.length); i++) {
|
|
@@ -170,43 +170,43 @@ const ct = (t) => t != null && typeof t == "object" && "toString" in t, ln = (t)
|
|
|
170
170
|
} else return isNaN(Number(o)) ? -1 : 1;
|
|
171
171
|
}
|
|
172
172
|
return n.length - s.length;
|
|
173
|
-
},
|
|
173
|
+
}, go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
174
174
|
__proto__: null,
|
|
175
175
|
EQUAL: ee,
|
|
176
|
-
GREATER_THAN:
|
|
177
|
-
LESS_THAN:
|
|
178
|
-
isEqualTo:
|
|
179
|
-
isGreaterThan:
|
|
180
|
-
isGreaterThanEqual:
|
|
181
|
-
isLessThan:
|
|
176
|
+
GREATER_THAN: $e,
|
|
177
|
+
LESS_THAN: xe,
|
|
178
|
+
isEqualTo: Ht,
|
|
179
|
+
isGreaterThan: Gt,
|
|
180
|
+
isGreaterThanEqual: pn,
|
|
181
|
+
isLessThan: Wt,
|
|
182
182
|
newF: Be,
|
|
183
|
-
newFieldF:
|
|
184
|
-
order:
|
|
185
|
-
primitiveArrays:
|
|
186
|
-
reverseF:
|
|
187
|
-
stringsWithNumbers:
|
|
188
|
-
uniqueUnorderedPrimitiveArrays:
|
|
189
|
-
unorderedPrimitiveArrays:
|
|
183
|
+
newFieldF: hn,
|
|
184
|
+
order: gn,
|
|
185
|
+
primitiveArrays: fn,
|
|
186
|
+
reverseF: Vt,
|
|
187
|
+
stringsWithNumbers: yn,
|
|
188
|
+
uniqueUnorderedPrimitiveArrays: dn,
|
|
189
|
+
unorderedPrimitiveArrays: Yt
|
|
190
190
|
}, Symbol.toStringTag, { value: "Module" })), Ue = a.tuple([a.number(), a.number()]);
|
|
191
191
|
a.tuple([a.bigint(), a.bigint()]);
|
|
192
|
-
const
|
|
192
|
+
const ft = a.object({ width: a.number(), height: a.number() }), mn = a.object({
|
|
193
193
|
signedWidth: a.number(),
|
|
194
194
|
signedHeight: a.number()
|
|
195
|
-
}),
|
|
196
|
-
a.enum(mn);
|
|
197
|
-
const bn = ["start", "center", "end"], wn = ["signedWidth", "signedHeight"];
|
|
198
|
-
a.enum(wn);
|
|
199
|
-
const he = a.object({ x: a.number(), y: a.number() }), Ht = a.object({ clientX: a.number(), clientY: a.number() }), Ce = ["x", "y"], ft = a.enum(Ce), Jt = ["top", "right", "bottom", "left"], On = a.enum(Jt), je = ["left", "right"], dt = a.enum(je), Re = ["top", "bottom"], gt = a.enum(Re), pt = ["center"], Xe = a.enum(pt), $n = [...Jt, ...pt], yt = a.enum($n);
|
|
195
|
+
}), bn = ["width", "height"];
|
|
200
196
|
a.enum(bn);
|
|
201
|
-
const
|
|
202
|
-
a.enum(
|
|
203
|
-
const
|
|
204
|
-
a.
|
|
205
|
-
|
|
206
|
-
|
|
197
|
+
const wn = ["start", "center", "end"], On = ["signedWidth", "signedHeight"];
|
|
198
|
+
a.enum(On);
|
|
199
|
+
const he = a.object({ x: a.number(), y: a.number() }), Jt = a.object({ clientX: a.number(), clientY: a.number() }), Ce = ["x", "y"], dt = a.enum(Ce), Xt = ["top", "right", "bottom", "left"], vn = a.enum(Xt), je = ["left", "right"], gt = a.enum(je), Re = ["top", "bottom"], pt = a.enum(Re), yt = ["center"], Xe = a.enum(yt), Tn = [...Xt, ...yt], mt = a.enum(Tn);
|
|
200
|
+
a.enum(wn);
|
|
201
|
+
const xn = ["first", "last"];
|
|
202
|
+
a.enum(xn);
|
|
203
|
+
const Kt = a.object({ lower: a.number(), upper: a.number() }), $n = a.object({ lower: a.bigint(), upper: a.bigint() });
|
|
204
|
+
a.union([Kt, Ue]);
|
|
205
|
+
a.union([$n, Ue]);
|
|
206
|
+
const Sn = a.enum([...dt.options, ...mt.options]), Nn = a.union([dt, mt, a.instanceof(String)]), ae = (t, e) => typeof t == "bigint" ? t - BigInt(e) : t - Number(e), Qt = (t, e) => typeof t == "bigint" ? t + BigInt(e) : t + Number(e), In = (t, e, r = 1e-4) => Math.abs(t - e) < r, Ke = (t, e) => typeof t == "bigint" ? t === BigInt(e) : t === Number(e), Mn = (t) => {
|
|
207
207
|
const e = 10 ** Math.floor(Math.log10(t));
|
|
208
208
|
return Math.round(t / e) * e;
|
|
209
|
-
},
|
|
209
|
+
}, _t = (t, e) => t <= e ? t : typeof t == "bigint" ? t <= e ? t : BigInt(e) : t <= e ? t : Number(e), En = (t, e) => typeof t == "bigint" ? t >= e ? t : BigInt(e) : t >= e ? t : Number(e), er = (t) => t < 0 ? -t : t, Y = (t, e) => typeof t == "bigint" ? t * BigInt(e) : t * Number(e), An = (t, e) => typeof t == "bigint" ? t / BigInt(e) : t / Number(e), y = (t, e, r) => {
|
|
210
210
|
const n = {};
|
|
211
211
|
if (typeof e == "object" && (r = e, e = void 0), r = { makeValid: !0, ...r }, typeof t == "number" || typeof t == "bigint")
|
|
212
212
|
e != null ? (n.lower = t, n.upper = e) : (n.lower = typeof t == "bigint" ? 0n : 0, n.upper = t);
|
|
@@ -215,13 +215,13 @@ const xn = a.enum([...ft.options, ...yt.options]), Sn = a.union([ft, yt, a.insta
|
|
|
215
215
|
[n.lower, n.upper] = t;
|
|
216
216
|
} else
|
|
217
217
|
n.lower = t.lower, n.upper = t.upper;
|
|
218
|
-
return r?.makeValid ?
|
|
219
|
-
},
|
|
218
|
+
return r?.makeValid ? tr(n) : n;
|
|
219
|
+
}, Bn = Object.freeze({ lower: 0, upper: 0 }), Un = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), Cn = Object.freeze({ lower: 0, upper: 1 }), jn = Object.freeze({ lower: -1, upper: 1 }), Rn = (t, e) => {
|
|
220
220
|
if (t == null && e == null) return !0;
|
|
221
221
|
if (t == null || e == null) return !1;
|
|
222
222
|
const r = y(t), n = y(e);
|
|
223
223
|
return r?.lower === n?.lower && r?.upper === n?.upper;
|
|
224
|
-
},
|
|
224
|
+
}, tr = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, Qe = (t, e) => {
|
|
225
225
|
const r = y(t);
|
|
226
226
|
return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
|
|
227
227
|
}, I = (t, e) => {
|
|
@@ -230,31 +230,31 @@ const xn = a.enum([...ft.options, ...yt.options]), Sn = a.union([ft, yt, a.insta
|
|
|
230
230
|
return e >= r.lower && e < r.upper;
|
|
231
231
|
const n = y(e);
|
|
232
232
|
return n.lower >= r.lower && n.upper <= r.upper;
|
|
233
|
-
},
|
|
233
|
+
}, Ln = (t, e) => {
|
|
234
234
|
const r = y(t), n = y(e);
|
|
235
235
|
return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : I(r, n.upper) || I(r, n.lower) || I(n, r.upper) || I(n, r.lower);
|
|
236
236
|
}, ye = (t) => {
|
|
237
237
|
const e = y(t);
|
|
238
238
|
return e.upper - e.lower;
|
|
239
|
-
},
|
|
239
|
+
}, Dn = (t) => {
|
|
240
240
|
const e = y(t);
|
|
241
241
|
return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
|
|
242
|
-
},
|
|
242
|
+
}, Pn = (t) => {
|
|
243
243
|
const e = ye(t);
|
|
244
244
|
return typeof e == "number" ? e === 0 : e === 0n;
|
|
245
|
-
},
|
|
245
|
+
}, qn = (t) => {
|
|
246
246
|
const e = y(t);
|
|
247
247
|
return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
|
|
248
|
-
},
|
|
248
|
+
}, kn = (t) => {
|
|
249
249
|
const e = y(t);
|
|
250
250
|
return (e.upper + e.lower) / 2;
|
|
251
|
-
},
|
|
251
|
+
}, rr = (t) => ({
|
|
252
252
|
lower: Math.min(...t.map((e) => y(e).lower)),
|
|
253
253
|
upper: Math.max(...t.map((e) => y(e).upper))
|
|
254
|
-
}),
|
|
254
|
+
}), zn = (t) => ({
|
|
255
255
|
lower: Math.max(...t.map((e) => y(e).lower)),
|
|
256
256
|
upper: Math.min(...t.map((e) => y(e).upper))
|
|
257
|
-
}),
|
|
257
|
+
}), Fn = (t) => {
|
|
258
258
|
const e = y(t), r = typeof e.lower == "bigint";
|
|
259
259
|
return Array.from({ length: Number(ye(t)) }, (n, s) => r ? e.lower + BigInt(s) : e.lower + s);
|
|
260
260
|
}, _e = (t, e) => {
|
|
@@ -267,7 +267,7 @@ const xn = a.enum([...ft.options, ...yt.options]), Sn = a.union([ft, yt, a.insta
|
|
|
267
267
|
removeAfter: 0,
|
|
268
268
|
insertInto: 0,
|
|
269
269
|
deleteInBetween: 0
|
|
270
|
-
},
|
|
270
|
+
}, Zn = (t, e) => {
|
|
271
271
|
const r = t.map((f) => y(f)), n = y(e);
|
|
272
272
|
if (r.length === 0) return Ze;
|
|
273
273
|
const s = _e(r, n.lower), i = _e(r, n.upper);
|
|
@@ -287,7 +287,7 @@ const xn = a.enum([...ft.options, ...yt.options]), Sn = a.union([ft, yt, a.insta
|
|
|
287
287
|
insertInto: c,
|
|
288
288
|
deleteInBetween: o
|
|
289
289
|
};
|
|
290
|
-
},
|
|
290
|
+
}, nr = (t, e, r) => {
|
|
291
291
|
const n = t.map((c) => y(c)), s = r > 0 ? 1 : r < 0 ? -1 : 0;
|
|
292
292
|
if (s === 0) return e;
|
|
293
293
|
let i = r, o = e;
|
|
@@ -297,8 +297,8 @@ const xn = a.enum([...ft.options, ...yt.options]), Sn = a.union([ft, yt, a.insta
|
|
|
297
297
|
const l = n[c];
|
|
298
298
|
let f;
|
|
299
299
|
if (s > 0 ? f = ae(l.upper, o) : f = ae(o, l.lower), f > 0) {
|
|
300
|
-
const p =
|
|
301
|
-
if (o =
|
|
300
|
+
const p = _t(er(i), f);
|
|
301
|
+
if (o = Qt(
|
|
302
302
|
o,
|
|
303
303
|
s > 0 ? p : -p
|
|
304
304
|
), i = ae(i, s > 0 ? p : -p), Ke(i, 0)) return o;
|
|
@@ -317,7 +317,7 @@ const xn = a.enum([...ft.options, ...yt.options]), Sn = a.union([ft, yt, a.insta
|
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
return o;
|
|
320
|
-
},
|
|
320
|
+
}, sr = (t, e, r) => {
|
|
321
321
|
const n = t.map((o) => y(o));
|
|
322
322
|
if (e === r) return typeof e == "bigint" ? 0n : 0;
|
|
323
323
|
const s = e < r ? y([e, r]) : y([r, e]);
|
|
@@ -330,183 +330,183 @@ const xn = a.enum([...ft.options, ...yt.options]), Sn = a.union([ft, yt, a.insta
|
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
return i;
|
|
333
|
-
},
|
|
333
|
+
}, po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
334
334
|
__proto__: null,
|
|
335
|
-
CLIP:
|
|
336
|
-
DECIMAL:
|
|
337
|
-
INFINITE:
|
|
338
|
-
ZERO:
|
|
339
|
-
bounds:
|
|
340
|
-
buildInsertionPlan:
|
|
335
|
+
CLIP: jn,
|
|
336
|
+
DECIMAL: Cn,
|
|
337
|
+
INFINITE: Un,
|
|
338
|
+
ZERO: Bn,
|
|
339
|
+
bounds: Kt,
|
|
340
|
+
buildInsertionPlan: Zn,
|
|
341
341
|
clamp: Qe,
|
|
342
342
|
construct: y,
|
|
343
343
|
contains: I,
|
|
344
|
-
distance:
|
|
345
|
-
equals:
|
|
344
|
+
distance: sr,
|
|
345
|
+
equals: Rn,
|
|
346
346
|
findInsertPosition: _e,
|
|
347
|
-
isFinite:
|
|
348
|
-
isZero:
|
|
349
|
-
linspace:
|
|
350
|
-
makeValid:
|
|
351
|
-
max:
|
|
352
|
-
mean:
|
|
353
|
-
min:
|
|
354
|
-
overlapsWith:
|
|
347
|
+
isFinite: qn,
|
|
348
|
+
isZero: Dn,
|
|
349
|
+
linspace: Fn,
|
|
350
|
+
makeValid: tr,
|
|
351
|
+
max: rr,
|
|
352
|
+
mean: kn,
|
|
353
|
+
min: zn,
|
|
354
|
+
overlapsWith: Ln,
|
|
355
355
|
span: ye,
|
|
356
|
-
spanIsZero:
|
|
357
|
-
traverse:
|
|
358
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
356
|
+
spanIsZero: Pn,
|
|
357
|
+
traverse: nr
|
|
358
|
+
}, Symbol.toStringTag, { value: "Module" })), ir = Sn, Z = (t) => Ce.includes(t) ? t : Re.includes(t) ? "y" : "x", Yn = (t) => Z(t) === "x" ? "y" : "x", Vn = (t) => Z(t) === "x" ? "width" : "height", Wn = (t) => Z(t) === "x" ? "left" : "top", Gn = (t) => ir.safeParse(t).success, Hn = (t) => Z(t) === "x" ? "signedWidth" : "signedHeight", Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
359
359
|
__proto__: null,
|
|
360
360
|
DIRECTIONS: Ce,
|
|
361
361
|
construct: Z,
|
|
362
|
-
crude:
|
|
363
|
-
dimension:
|
|
364
|
-
direction:
|
|
365
|
-
isDirection:
|
|
366
|
-
location:
|
|
367
|
-
signedDimension:
|
|
368
|
-
swap:
|
|
369
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
362
|
+
crude: ir,
|
|
363
|
+
dimension: Vn,
|
|
364
|
+
direction: dt,
|
|
365
|
+
isDirection: Gn,
|
|
366
|
+
location: Wn,
|
|
367
|
+
signedDimension: Hn,
|
|
368
|
+
swap: Yn
|
|
369
|
+
}, Symbol.toStringTag, { value: "Module" })), Xn = gt, Kn = pt, Qn = Xe, _n = {
|
|
370
370
|
top: "bottom",
|
|
371
371
|
right: "left",
|
|
372
372
|
bottom: "top",
|
|
373
373
|
left: "right",
|
|
374
374
|
center: "center"
|
|
375
|
-
},
|
|
375
|
+
}, es = {
|
|
376
376
|
top: "left",
|
|
377
377
|
right: "top",
|
|
378
378
|
bottom: "right",
|
|
379
379
|
left: "bottom",
|
|
380
380
|
center: "center"
|
|
381
|
-
},
|
|
381
|
+
}, ts = Nn, k = (t) => t instanceof String || !Ce.includes(t) ? t : t === "x" ? "left" : "top", rs = (t) => _n[k(t)], ns = (t) => es[k(t)], fe = (t) => {
|
|
382
382
|
const e = k(t);
|
|
383
383
|
return e === "top" || e === "bottom" ? "y" : "x";
|
|
384
|
-
},
|
|
385
|
-
x:
|
|
386
|
-
y:
|
|
387
|
-
}),
|
|
384
|
+
}, ss = a.object({
|
|
385
|
+
x: gt.or(Xe),
|
|
386
|
+
y: pt.or(Xe)
|
|
387
|
+
}), ar = a.object({ x: gt, y: pt }), me = Object.freeze({ x: "left", y: "top" }), bt = Object.freeze({ x: "right", y: "top" }), Le = Object.freeze({ x: "left", y: "bottom" }), wt = Object.freeze({ x: "right", y: "bottom" }), Ot = Object.freeze({ x: "center", y: "center" }), vt = Object.freeze({ x: "center", y: "top" }), Tt = Object.freeze({ x: "center", y: "bottom" }), xt = Object.freeze({ x: "right", y: "center" }), $t = Object.freeze({ x: "left", y: "center" }), is = Object.freeze([
|
|
388
|
+
$t,
|
|
389
|
+
xt,
|
|
388
390
|
vt,
|
|
389
391
|
Tt,
|
|
390
|
-
Ot,
|
|
391
|
-
$t,
|
|
392
392
|
me,
|
|
393
|
-
mt,
|
|
394
|
-
Le,
|
|
395
393
|
bt,
|
|
396
|
-
|
|
397
|
-
|
|
394
|
+
Le,
|
|
395
|
+
wt,
|
|
396
|
+
Ot
|
|
397
|
+
]), St = (t, e) => t.x === e.x && t.y === e.y, as = (t, e) => {
|
|
398
398
|
if (typeof e == "object") {
|
|
399
399
|
let r = !0;
|
|
400
400
|
return "x" in e && (t.x === e.x || (r = !1)), "y" in e && (t.y === e.y || (r = !1)), r;
|
|
401
401
|
}
|
|
402
402
|
return t.x === e || t.y === e;
|
|
403
|
-
},
|
|
403
|
+
}, or = (t) => [t.x, t.y], Se = (t) => fe(k(t)) === "x", os = (t) => fe(k(t)) === "y", us = (t) => `${t.x}${Zt(t.y)}`, ls = (t, e) => {
|
|
404
404
|
let r, n;
|
|
405
405
|
if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = k(t), n = k(e ?? t)), fe(r) === fe(n) && r !== "center" && n !== "center")
|
|
406
406
|
throw new Error(
|
|
407
407
|
`[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`
|
|
408
408
|
);
|
|
409
|
-
const s = { ...
|
|
409
|
+
const s = { ...Ot };
|
|
410
410
|
return r === "center" ? Se(n) ? [s.x, s.y] = [n, r] : [s.x, s.y] = [r, n] : n === "center" ? Se(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r] : Se(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r], s;
|
|
411
|
-
},
|
|
411
|
+
}, cs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
412
412
|
__proto__: null,
|
|
413
|
-
BOTTOM_CENTER:
|
|
413
|
+
BOTTOM_CENTER: Tt,
|
|
414
414
|
BOTTOM_LEFT: Le,
|
|
415
|
-
BOTTOM_RIGHT:
|
|
416
|
-
CENTER:
|
|
417
|
-
CENTER_LEFT:
|
|
418
|
-
CENTER_LOCATIONS:
|
|
419
|
-
CENTER_RIGHT:
|
|
420
|
-
TOP_CENTER:
|
|
415
|
+
BOTTOM_RIGHT: wt,
|
|
416
|
+
CENTER: Ot,
|
|
417
|
+
CENTER_LEFT: $t,
|
|
418
|
+
CENTER_LOCATIONS: yt,
|
|
419
|
+
CENTER_RIGHT: xt,
|
|
420
|
+
TOP_CENTER: vt,
|
|
421
421
|
TOP_LEFT: me,
|
|
422
|
-
TOP_RIGHT:
|
|
423
|
-
XY_LOCATIONS:
|
|
422
|
+
TOP_RIGHT: bt,
|
|
423
|
+
XY_LOCATIONS: is,
|
|
424
424
|
X_LOCATIONS: je,
|
|
425
425
|
Y_LOCATIONS: Re,
|
|
426
|
-
center:
|
|
426
|
+
center: Qn,
|
|
427
427
|
construct: k,
|
|
428
|
-
constructXY:
|
|
429
|
-
corner:
|
|
430
|
-
crude:
|
|
428
|
+
constructXY: ls,
|
|
429
|
+
corner: ar,
|
|
430
|
+
crude: ts,
|
|
431
431
|
direction: fe,
|
|
432
432
|
isX: Se,
|
|
433
|
-
isY:
|
|
434
|
-
location:
|
|
435
|
-
outer:
|
|
436
|
-
rotate90:
|
|
437
|
-
swap:
|
|
438
|
-
x:
|
|
439
|
-
xy:
|
|
440
|
-
xyCouple:
|
|
441
|
-
xyEquals:
|
|
442
|
-
xyMatches:
|
|
443
|
-
xyToString:
|
|
444
|
-
y:
|
|
433
|
+
isY: os,
|
|
434
|
+
location: mt,
|
|
435
|
+
outer: vn,
|
|
436
|
+
rotate90: ns,
|
|
437
|
+
swap: rs,
|
|
438
|
+
x: Xn,
|
|
439
|
+
xy: ss,
|
|
440
|
+
xyCouple: or,
|
|
441
|
+
xyEquals: St,
|
|
442
|
+
xyMatches: as,
|
|
443
|
+
xyToString: us,
|
|
444
|
+
y: Kn
|
|
445
445
|
}, Symbol.toStringTag, { value: "Module" })), et = a.union([
|
|
446
446
|
a.number(),
|
|
447
447
|
he,
|
|
448
448
|
Ue,
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
]),
|
|
449
|
+
ft,
|
|
450
|
+
mn,
|
|
451
|
+
Jt
|
|
452
|
+
]), v = (t, e) => {
|
|
453
453
|
if (typeof t == "string") {
|
|
454
454
|
if (e === void 0) throw new Error("The y coordinate must be given.");
|
|
455
455
|
return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
|
|
456
456
|
}
|
|
457
457
|
return typeof t == "number" ? { x: t, y: e ?? t } : Array.isArray(t) ? { x: t[0], y: t[1] } : "signedWidth" in t ? { x: t.signedWidth, y: t.signedHeight } : "clientX" in t ? { x: t.clientX, y: t.clientY } : "width" in t ? { x: t.width, y: t.height } : { x: t.x, y: t.y };
|
|
458
|
-
}, U = Object.freeze({ x: 0, y: 0 }),
|
|
459
|
-
const n =
|
|
458
|
+
}, U = Object.freeze({ x: 0, y: 0 }), ur = Object.freeze({ x: 1, y: 1 }), hs = Object.freeze({ x: 1 / 0, y: 1 / 0 }), fs = Object.freeze({ x: NaN, y: NaN }), Ae = (t, e, r = 0) => {
|
|
459
|
+
const n = v(t), s = v(e);
|
|
460
460
|
return r === 0 ? n.x === s.x && n.y === s.y : Math.abs(n.x - s.x) <= r && Math.abs(n.y - s.y) <= r;
|
|
461
|
-
},
|
|
462
|
-
const n =
|
|
461
|
+
}, ds = (t) => Ae(t, U), Nt = (t, e, r) => {
|
|
462
|
+
const n = v(t), s = v(e, r);
|
|
463
463
|
return { x: n.x * s.x, y: n.y * s.y };
|
|
464
|
-
}, ur = (t, e) => {
|
|
465
|
-
const r = $(t);
|
|
466
|
-
return { x: r.x + e, y: r.y };
|
|
467
464
|
}, lr = (t, e) => {
|
|
468
|
-
const r =
|
|
465
|
+
const r = v(t);
|
|
466
|
+
return { x: r.x + e, y: r.y };
|
|
467
|
+
}, cr = (t, e) => {
|
|
468
|
+
const r = v(t);
|
|
469
469
|
return { x: r.x, y: r.y + e };
|
|
470
|
-
}, de = (t, e, r, ...n) => typeof e == "string" && typeof r == "number" ? e === "x" ?
|
|
471
|
-
const o =
|
|
470
|
+
}, de = (t, e, r, ...n) => typeof e == "string" && typeof r == "number" ? e === "x" ? lr(t, r) : cr(t, r) : [t, e, r ?? U, ...n].reduce((s, i) => {
|
|
471
|
+
const o = v(i);
|
|
472
472
|
return { x: s.x + o.x, y: s.y + o.y };
|
|
473
|
-
}, U),
|
|
474
|
-
const n =
|
|
473
|
+
}, U), gs = (t, e, r) => {
|
|
474
|
+
const n = v(t);
|
|
475
475
|
return e === "x" ? { x: r, y: n.y } : { x: n.x, y: r };
|
|
476
|
-
}, gs = (t, e) => {
|
|
477
|
-
const r = $(t), n = $(e);
|
|
478
|
-
return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
|
|
479
476
|
}, ps = (t, e) => {
|
|
480
|
-
const r =
|
|
477
|
+
const r = v(t), n = v(e);
|
|
478
|
+
return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
|
|
479
|
+
}, ys = (t, e) => {
|
|
480
|
+
const r = v(t), n = v(e);
|
|
481
481
|
return { x: n.x - r.x, y: n.y - r.y };
|
|
482
|
-
}, ys = (t) => {
|
|
483
|
-
const e = $(t);
|
|
484
|
-
return Number.isNaN(e.x) || Number.isNaN(e.y);
|
|
485
482
|
}, ms = (t) => {
|
|
486
|
-
const e =
|
|
487
|
-
return Number.
|
|
483
|
+
const e = v(t);
|
|
484
|
+
return Number.isNaN(e.x) || Number.isNaN(e.y);
|
|
488
485
|
}, bs = (t) => {
|
|
489
|
-
const e =
|
|
490
|
-
return
|
|
486
|
+
const e = v(t);
|
|
487
|
+
return Number.isFinite(e.x) && Number.isFinite(e.y);
|
|
491
488
|
}, ws = (t) => {
|
|
492
|
-
const e =
|
|
489
|
+
const e = v(t);
|
|
490
|
+
return [e.x, e.y];
|
|
491
|
+
}, Os = (t) => {
|
|
492
|
+
const e = v(t);
|
|
493
493
|
return { left: e.x, top: e.y };
|
|
494
494
|
}, tt = (t, e = 0) => {
|
|
495
|
-
const r =
|
|
495
|
+
const r = v(t);
|
|
496
496
|
return { x: Number(r.x.toFixed(e)), y: Number(r.y.toFixed(e)) };
|
|
497
497
|
}, ne = (t, e) => {
|
|
498
|
-
const r =
|
|
498
|
+
const r = v(t), n = v(e);
|
|
499
499
|
return { x: r.x - n.x, y: r.y - n.y };
|
|
500
500
|
}, se = (t) => {
|
|
501
|
-
const e =
|
|
501
|
+
const e = v(t), r = Math.hypot(e.x, e.y);
|
|
502
502
|
return r === 0 ? { x: 0, y: 0 } : { x: -e.y / r, y: e.x / r };
|
|
503
|
-
},
|
|
504
|
-
const e =
|
|
503
|
+
}, hr = (t) => {
|
|
504
|
+
const e = v(t), r = Math.hypot(e.x, e.y);
|
|
505
505
|
return r === 0 ? { x: 0, y: 0 } : { x: e.x / r, y: e.y / r };
|
|
506
|
-
},
|
|
506
|
+
}, fr = (...t) => {
|
|
507
507
|
const e = t.reduce((r, n) => de(r, n), U);
|
|
508
|
-
return
|
|
509
|
-
},
|
|
508
|
+
return Nt(e, 1 / t.length);
|
|
509
|
+
}, vs = (t, e) => {
|
|
510
510
|
const r = [];
|
|
511
511
|
for (let n = 0; n < t.length; n++) {
|
|
512
512
|
const s = t[n];
|
|
@@ -523,63 +523,67 @@ const xn = a.enum([...ft.options, ...yt.options]), Sn = a.union([ft, yt, a.insta
|
|
|
523
523
|
const E = Math.acos(
|
|
524
524
|
(g.x * S.x + g.y * S.y) / (Math.hypot(g.x, g.y) * Math.hypot(S.x, S.y))
|
|
525
525
|
), te = Math.sin(E / 2);
|
|
526
|
-
te === 0 ? l = e : l = e / te, c =
|
|
526
|
+
te === 0 ? l = e : l = e / te, c = hr(fr(i, o));
|
|
527
527
|
}
|
|
528
|
-
r.push(
|
|
528
|
+
r.push(Nt(c, l));
|
|
529
529
|
}
|
|
530
530
|
return r;
|
|
531
|
-
},
|
|
532
|
-
const e =
|
|
531
|
+
}, Ts = (t) => {
|
|
532
|
+
const e = v(t);
|
|
533
533
|
return { x: e.y, y: e.x };
|
|
534
|
-
},
|
|
534
|
+
}, rt = (t) => {
|
|
535
|
+
const e = v(t);
|
|
536
|
+
return { x: Math.round(e.x), y: Math.round(e.y) };
|
|
537
|
+
}, yo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
535
538
|
__proto__: null,
|
|
536
|
-
INFINITY:
|
|
537
|
-
NAN:
|
|
538
|
-
ONE:
|
|
539
|
+
INFINITY: hs,
|
|
540
|
+
NAN: fs,
|
|
541
|
+
ONE: ur,
|
|
539
542
|
ZERO: U,
|
|
540
|
-
average:
|
|
541
|
-
calculateMiters:
|
|
542
|
-
clientXY:
|
|
543
|
-
construct:
|
|
544
|
-
couple:
|
|
543
|
+
average: fr,
|
|
544
|
+
calculateMiters: vs,
|
|
545
|
+
clientXY: Jt,
|
|
546
|
+
construct: v,
|
|
547
|
+
couple: ws,
|
|
545
548
|
crudeZ: et,
|
|
546
|
-
css:
|
|
547
|
-
distance:
|
|
549
|
+
css: Os,
|
|
550
|
+
distance: ps,
|
|
548
551
|
equals: Ae,
|
|
549
|
-
isFinite:
|
|
550
|
-
isNan:
|
|
551
|
-
isZero:
|
|
552
|
+
isFinite: bs,
|
|
553
|
+
isNan: ms,
|
|
554
|
+
isZero: ds,
|
|
552
555
|
normal: se,
|
|
553
|
-
normalize:
|
|
554
|
-
|
|
555
|
-
|
|
556
|
+
normalize: hr,
|
|
557
|
+
round: rt,
|
|
558
|
+
scale: Nt,
|
|
559
|
+
set: gs,
|
|
556
560
|
sub: ne,
|
|
557
|
-
swap:
|
|
561
|
+
swap: Ts,
|
|
558
562
|
translate: de,
|
|
559
|
-
translateX:
|
|
560
|
-
translateY:
|
|
561
|
-
translation:
|
|
563
|
+
translateX: lr,
|
|
564
|
+
translateY: cr,
|
|
565
|
+
translation: ys,
|
|
562
566
|
truncate: tt,
|
|
563
567
|
xy: he
|
|
564
|
-
}, Symbol.toStringTag, { value: "Module" })), we = a.union([a.number(), a.string()]),
|
|
568
|
+
}, Symbol.toStringTag, { value: "Module" })), we = a.union([a.number(), a.string()]), xs = a.object({
|
|
565
569
|
top: we,
|
|
566
570
|
left: we,
|
|
567
571
|
width: we,
|
|
568
572
|
height: we
|
|
569
|
-
}),
|
|
573
|
+
}), $s = a.object({
|
|
570
574
|
left: a.number(),
|
|
571
575
|
top: a.number(),
|
|
572
576
|
right: a.number(),
|
|
573
577
|
bottom: a.number()
|
|
574
|
-
}),
|
|
578
|
+
}), Ss = a.object({
|
|
575
579
|
one: he,
|
|
576
580
|
two: he,
|
|
577
|
-
root:
|
|
578
|
-
}),
|
|
581
|
+
root: ar
|
|
582
|
+
}), dr = { one: U, two: U, root: me }, Ns = { one: U, two: ur, root: Le }, gr = (t, e) => ({
|
|
579
583
|
one: t.one,
|
|
580
584
|
two: t.two,
|
|
581
585
|
root: e ?? t.root
|
|
582
|
-
}),
|
|
586
|
+
}), O = (t, e, r = 0, n = 0, s) => {
|
|
583
587
|
const i = {
|
|
584
588
|
one: { ...U },
|
|
585
589
|
two: { ...U },
|
|
@@ -597,12 +601,12 @@ const xn = a.enum([...ft.options, ...yt.options]), Sn = a.union([ft, yt, a.insta
|
|
|
597
601
|
x: i.one.x + e.signedWidth,
|
|
598
602
|
y: i.one.y + e.signedHeight
|
|
599
603
|
} : i.two = e, i));
|
|
600
|
-
},
|
|
601
|
-
const n =
|
|
604
|
+
}, Is = (t, e, r) => {
|
|
605
|
+
const n = O(t);
|
|
602
606
|
if (typeof e == "string") {
|
|
603
607
|
if (r == null) throw new Error("Invalid arguments for resize");
|
|
604
608
|
const s = Z(e);
|
|
605
|
-
return
|
|
609
|
+
return O(
|
|
606
610
|
n.one,
|
|
607
611
|
void 0,
|
|
608
612
|
s === "x" ? r : z(n),
|
|
@@ -610,202 +614,206 @@ const xn = a.enum([...ft.options, ...yt.options]), Sn = a.union([ft, yt, a.insta
|
|
|
610
614
|
n.root
|
|
611
615
|
);
|
|
612
616
|
}
|
|
613
|
-
return
|
|
614
|
-
},
|
|
615
|
-
const n =
|
|
617
|
+
return O(n.one, e, void 0, void 0, n.root);
|
|
618
|
+
}, Ms = (t, e, r = !0) => {
|
|
619
|
+
const n = O(t);
|
|
616
620
|
let s = (i, o) => i < o;
|
|
617
621
|
return r && (s = (i, o) => i <= o), "one" in e ? s(P(n), P(e)) && s(W(e), W(n)) && s(q(n), q(e)) && s(G(e), G(n)) : s(P(n), e.x) && s(e.x, W(n)) && s(q(n), e.y) && s(e.y, G(n));
|
|
618
|
-
},
|
|
622
|
+
}, Es = (t, e) => Ae(t.one, e.one) && Ae(t.two, e.two) && St(t.root, e.root), pr = (t) => ({
|
|
619
623
|
width: z(t),
|
|
620
624
|
height: F(t)
|
|
621
|
-
}),
|
|
625
|
+
}), As = (t) => ({
|
|
622
626
|
signedWidth: De(t),
|
|
623
627
|
signedHeight: Pe(t)
|
|
624
|
-
}),
|
|
628
|
+
}), Bs = (t) => ({
|
|
625
629
|
top: q(t),
|
|
626
630
|
left: P(t),
|
|
627
631
|
width: z(t),
|
|
628
632
|
height: F(t)
|
|
629
|
-
}),
|
|
633
|
+
}), It = (t, e, r = !1) => {
|
|
630
634
|
const n = Z(e) === "y" ? Pe(t) : De(t);
|
|
631
635
|
return r ? n : Math.abs(n);
|
|
632
636
|
}, j = (t, e) => {
|
|
633
|
-
const r =
|
|
637
|
+
const r = O(t);
|
|
634
638
|
return {
|
|
635
|
-
x: e.x === "center" ?
|
|
636
|
-
y: e.y === "center" ?
|
|
639
|
+
x: e.x === "center" ? nt(r).x : H(r, e.x),
|
|
640
|
+
y: e.y === "center" ? nt(r).y : H(r, e.y)
|
|
637
641
|
};
|
|
638
642
|
}, H = (t, e) => {
|
|
639
|
-
const r =
|
|
643
|
+
const r = O(t), n = or(r.root).includes(e) ? Math.min : Math.max;
|
|
640
644
|
return je.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
|
|
641
|
-
},
|
|
642
|
-
const e =
|
|
645
|
+
}, Us = (t) => t.one.x === t.two.x && t.one.y === t.two.y, z = (t) => It(t, "x"), F = (t) => It(t, "y"), De = (t) => {
|
|
646
|
+
const e = O(t);
|
|
643
647
|
return e.two.x - e.one.x;
|
|
644
648
|
}, Pe = (t) => {
|
|
645
|
-
const e =
|
|
649
|
+
const e = O(t);
|
|
646
650
|
return e.two.y - e.one.y;
|
|
647
|
-
},
|
|
651
|
+
}, yr = (t) => j(t, me), Cs = (t) => j(t, vt), js = (t) => j(t, bt), Rs = (t) => j(t, Le), Ls = (t) => j(t, Tt), Ds = (t) => j(t, wt), Ps = (t) => j(t, $t), qs = (t) => j(t, xt), W = (t) => H(t, "right"), G = (t) => H(t, "bottom"), P = (t) => H(t, "left"), q = (t) => H(t, "top"), nt = (t) => de(yr(t), {
|
|
648
652
|
x: De(t) / 2,
|
|
649
653
|
y: Pe(t) / 2
|
|
650
|
-
}),
|
|
651
|
-
const e =
|
|
654
|
+
}), Mt = (t) => {
|
|
655
|
+
const e = O(t);
|
|
652
656
|
return e.root.x === "left" ? P(e) : W(e);
|
|
653
|
-
},
|
|
654
|
-
const e =
|
|
657
|
+
}, Et = (t) => {
|
|
658
|
+
const e = O(t);
|
|
655
659
|
return e.root.y === "top" ? q(e) : G(e);
|
|
656
|
-
},
|
|
657
|
-
const e =
|
|
660
|
+
}, ks = (t) => ({ x: Mt(t), y: Et(t) }), Ne = (t) => {
|
|
661
|
+
const e = O(t);
|
|
658
662
|
return { lower: e.one.x, upper: e.two.x };
|
|
659
663
|
}, Ie = (t) => {
|
|
660
|
-
const e =
|
|
664
|
+
const e = O(t);
|
|
661
665
|
return { lower: e.one.y, upper: e.two.y };
|
|
662
|
-
},
|
|
663
|
-
const r =
|
|
666
|
+
}, zs = (t, e) => gr(t, e), Fs = (t, e) => {
|
|
667
|
+
const r = O(t), n = je.includes(e) ? "x" : Re.includes(e) ? "y" : null;
|
|
664
668
|
if (n === null) throw new Error(`Invalid location: ${e}`);
|
|
665
669
|
const s = e === "top" || e === "left" ? Math.min : Math.max, i = { ...r.one }, o = { ...r.two };
|
|
666
670
|
return i[n] = s(r.one[n], r.two[n]), o[n] = s(r.one[n], r.two[n]), [i, o];
|
|
667
|
-
},
|
|
668
|
-
const r =
|
|
669
|
-
return
|
|
670
|
-
},
|
|
671
|
+
}, Zs = (t, e) => {
|
|
672
|
+
const r = O(t), n = O(e), s = Mt(n) + (z(n) - z(r)) / 2, i = Et(n) + (F(n) - F(r)) / 2;
|
|
673
|
+
return O({ x: s, y: i }, pr(r));
|
|
674
|
+
}, mr = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, Ys = (t) => z(t) / F(t), Vs = (t, e, r) => {
|
|
671
675
|
if (typeof e == "string") {
|
|
672
676
|
if (r == null) throw new Error("Undefined amount passed into box.translate");
|
|
673
677
|
const s = Z(e);
|
|
674
|
-
e =
|
|
678
|
+
e = v(s, r);
|
|
675
679
|
}
|
|
676
|
-
const n =
|
|
677
|
-
return
|
|
680
|
+
const n = O(t);
|
|
681
|
+
return O(
|
|
678
682
|
de(n.one, e),
|
|
679
683
|
de(n.two, e),
|
|
680
684
|
void 0,
|
|
681
685
|
void 0,
|
|
682
686
|
n.root
|
|
683
687
|
);
|
|
684
|
-
},
|
|
688
|
+
}, Ws = (t, e) => {
|
|
685
689
|
const r = Math.max(P(t), P(e)), n = Math.max(q(t), q(e)), s = Math.min(W(t), W(e)), i = Math.min(G(t), G(e));
|
|
686
|
-
return r > s || n > i ?
|
|
687
|
-
},
|
|
688
|
-
const r =
|
|
689
|
-
return
|
|
690
|
+
return r > s || n > i ? dr : O({ x: r, y: n }, { x: s, y: i }, void 0, void 0, t.root);
|
|
691
|
+
}, Gs = (t) => z(t) * F(t), Hs = (t, e) => {
|
|
692
|
+
const r = O(t);
|
|
693
|
+
return O(
|
|
690
694
|
tt(r.one, e),
|
|
691
695
|
tt(r.two, e),
|
|
692
696
|
void 0,
|
|
693
697
|
void 0,
|
|
694
698
|
r.root
|
|
695
699
|
);
|
|
696
|
-
},
|
|
700
|
+
}, Js = (t, e, r, n, s, i) => {
|
|
697
701
|
const o = { x: t, y: e }, c = { x: t + r, y: e + n };
|
|
698
|
-
return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2, c.x -= r / 2) : (o.x -= r, c.x -= r)), s.y !== i.y && (s.y === "center" ? (o.y -= n / 2, c.y -= n / 2) : (o.y -= n, c.y -= n)),
|
|
699
|
-
},
|
|
702
|
+
return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2, c.x -= r / 2) : (o.x -= r, c.x -= r)), s.y !== i.y && (s.y === "center" ? (o.y -= n / 2, c.y -= n / 2) : (o.y -= n, c.y -= n)), O(o, c, void 0, void 0, i);
|
|
703
|
+
}, Xs = (t) => {
|
|
704
|
+
const e = O(t);
|
|
705
|
+
return O(rt(e.one), rt(e.two), void 0, void 0, e.root);
|
|
706
|
+
}, mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
700
707
|
__proto__: null,
|
|
701
|
-
DECIMAL:
|
|
702
|
-
ZERO:
|
|
703
|
-
area:
|
|
704
|
-
areaIsZero:
|
|
705
|
-
aspect:
|
|
708
|
+
DECIMAL: Ns,
|
|
709
|
+
ZERO: dr,
|
|
710
|
+
area: Gs,
|
|
711
|
+
areaIsZero: Us,
|
|
712
|
+
aspect: Ys,
|
|
706
713
|
bottom: G,
|
|
707
|
-
bottomCenter:
|
|
708
|
-
bottomLeft:
|
|
709
|
-
bottomRight:
|
|
710
|
-
box:
|
|
711
|
-
center:
|
|
712
|
-
centerLeft:
|
|
713
|
-
centerRight:
|
|
714
|
-
construct:
|
|
715
|
-
constructWithAlternateRoot:
|
|
716
|
-
contains:
|
|
717
|
-
copy:
|
|
718
|
-
css:
|
|
719
|
-
cssBox:
|
|
720
|
-
dim:
|
|
721
|
-
dims:
|
|
722
|
-
domRect:
|
|
723
|
-
edgePoints:
|
|
724
|
-
equals:
|
|
714
|
+
bottomCenter: Ls,
|
|
715
|
+
bottomLeft: Rs,
|
|
716
|
+
bottomRight: Ds,
|
|
717
|
+
box: Ss,
|
|
718
|
+
center: nt,
|
|
719
|
+
centerLeft: Ps,
|
|
720
|
+
centerRight: qs,
|
|
721
|
+
construct: O,
|
|
722
|
+
constructWithAlternateRoot: Js,
|
|
723
|
+
contains: Ms,
|
|
724
|
+
copy: gr,
|
|
725
|
+
css: Bs,
|
|
726
|
+
cssBox: xs,
|
|
727
|
+
dim: It,
|
|
728
|
+
dims: pr,
|
|
729
|
+
domRect: $s,
|
|
730
|
+
edgePoints: Fs,
|
|
731
|
+
equals: Es,
|
|
725
732
|
height: F,
|
|
726
|
-
intersection:
|
|
727
|
-
isBox:
|
|
733
|
+
intersection: Ws,
|
|
734
|
+
isBox: mr,
|
|
728
735
|
left: P,
|
|
729
736
|
loc: H,
|
|
730
|
-
positionInCenter:
|
|
731
|
-
reRoot:
|
|
732
|
-
resize:
|
|
737
|
+
positionInCenter: Zs,
|
|
738
|
+
reRoot: zs,
|
|
739
|
+
resize: Is,
|
|
733
740
|
right: W,
|
|
734
|
-
root:
|
|
735
|
-
|
|
741
|
+
root: ks,
|
|
742
|
+
round: Xs,
|
|
743
|
+
signedDims: As,
|
|
736
744
|
signedHeight: Pe,
|
|
737
745
|
signedWidth: De,
|
|
738
746
|
top: q,
|
|
739
|
-
topCenter:
|
|
740
|
-
topLeft:
|
|
741
|
-
topRight:
|
|
742
|
-
translate:
|
|
743
|
-
truncate:
|
|
747
|
+
topCenter: Cs,
|
|
748
|
+
topLeft: yr,
|
|
749
|
+
topRight: js,
|
|
750
|
+
translate: Vs,
|
|
751
|
+
truncate: Hs,
|
|
744
752
|
width: z,
|
|
745
|
-
x:
|
|
753
|
+
x: Mt,
|
|
746
754
|
xBounds: Ne,
|
|
747
755
|
xyLoc: j,
|
|
748
|
-
y:
|
|
756
|
+
y: Et,
|
|
749
757
|
yBounds: Ie
|
|
750
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
758
|
+
}, Symbol.toStringTag, { value: "Module" })), br = a.object({ signedWidth: a.number(), signedHeight: a.number() }), Ks = a.union([ft, br, he, Ue]), Qs = { width: 0, height: 0 }, _s = { width: 1, height: 1 }, M = (t, e) => typeof t == "number" ? { width: t, height: e ?? t } : Array.isArray(t) ? { width: t[0], height: t[1] } : "x" in t ? { width: t.x, height: t.y } : "signedWidth" in t ? { width: t.signedWidth, height: t.signedHeight } : { ...t }, ei = (t, e) => {
|
|
751
759
|
if (e == null) return !1;
|
|
752
760
|
const r = M(t), n = M(e);
|
|
753
761
|
return r.width === n.width && r.height === n.height;
|
|
754
|
-
},
|
|
762
|
+
}, ti = (t) => {
|
|
755
763
|
const e = M(t);
|
|
756
764
|
return { width: e.height, height: e.width };
|
|
757
|
-
},
|
|
765
|
+
}, ri = (t) => {
|
|
758
766
|
const e = M(t);
|
|
759
767
|
return `0 0 ${e.width} ${e.height}`;
|
|
760
|
-
},
|
|
768
|
+
}, ni = (t) => {
|
|
761
769
|
const e = M(t);
|
|
762
770
|
return [e.width, e.height];
|
|
763
|
-
},
|
|
771
|
+
}, si = (t) => ({
|
|
764
772
|
width: Math.max(...t.map((e) => M(e).width)),
|
|
765
773
|
height: Math.max(...t.map((e) => M(e).height))
|
|
766
|
-
}),
|
|
774
|
+
}), ii = (t) => ({
|
|
767
775
|
width: Math.min(...t.map((e) => M(e).width)),
|
|
768
776
|
height: Math.min(...t.map((e) => M(e).height))
|
|
769
|
-
}),
|
|
777
|
+
}), ai = (t, e) => {
|
|
770
778
|
const r = M(t);
|
|
771
779
|
return { width: r.width * e, height: r.height * e };
|
|
772
|
-
},
|
|
780
|
+
}, bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
773
781
|
__proto__: null,
|
|
774
|
-
DECIMAL:
|
|
775
|
-
ZERO:
|
|
782
|
+
DECIMAL: _s,
|
|
783
|
+
ZERO: Qs,
|
|
776
784
|
construct: M,
|
|
777
|
-
couple:
|
|
778
|
-
crude:
|
|
779
|
-
dimensions:
|
|
780
|
-
equals:
|
|
781
|
-
max:
|
|
782
|
-
min:
|
|
783
|
-
scale:
|
|
784
|
-
signed:
|
|
785
|
-
svgViewBox:
|
|
786
|
-
swap:
|
|
787
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
785
|
+
couple: ni,
|
|
786
|
+
crude: Ks,
|
|
787
|
+
dimensions: ft,
|
|
788
|
+
equals: ei,
|
|
789
|
+
max: si,
|
|
790
|
+
min: ii,
|
|
791
|
+
scale: ai,
|
|
792
|
+
signed: br,
|
|
793
|
+
svgViewBox: ri,
|
|
794
|
+
swap: ti
|
|
795
|
+
}, Symbol.toStringTag, { value: "Module" })), oi = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, ui = a.object({ offset: et, scale: et }), li = a.object({ offset: a.number(), scale: a.number() }), ci = (t) => (e, r, n, s) => r === "dimension" ? [e, n] : [
|
|
788
796
|
e,
|
|
789
797
|
s ? n - t : n + t
|
|
790
|
-
],
|
|
798
|
+
], hi = (t) => (e, r, n, s) => [
|
|
791
799
|
e,
|
|
792
800
|
s ? n / t : n * t
|
|
793
|
-
],
|
|
801
|
+
], fi = (t) => (e, r, n) => {
|
|
794
802
|
if (e === null) return [t, n];
|
|
795
803
|
const { lower: s, upper: i } = e, { lower: o, upper: c } = t, l = i - s, f = c - o;
|
|
796
804
|
if (r === "dimension") return [t, n * (f / l)];
|
|
797
805
|
const p = (n - s) * (f / l) + o;
|
|
798
806
|
return [t, p];
|
|
799
|
-
},
|
|
807
|
+
}, di = (t) => (e, r, n) => [t, n], gi = () => (t, e, r) => {
|
|
800
808
|
if (t === null) throw new Error("cannot invert without bounds");
|
|
801
809
|
if (e === "dimension") return [t, r];
|
|
802
810
|
const { lower: n, upper: s } = t;
|
|
803
811
|
return [t, s - (r - n)];
|
|
804
|
-
},
|
|
812
|
+
}, pi = (t) => (e, r, n) => {
|
|
805
813
|
const { lower: s, upper: i } = t;
|
|
806
|
-
return n =
|
|
814
|
+
return n = oi(n, s, i), [e, n];
|
|
807
815
|
};
|
|
808
|
-
let
|
|
816
|
+
let st = class K {
|
|
809
817
|
ops = [];
|
|
810
818
|
currBounds = null;
|
|
811
819
|
currType = null;
|
|
@@ -839,7 +847,7 @@ let nt = class K {
|
|
|
839
847
|
* @param value - The amount to translate by.
|
|
840
848
|
*/
|
|
841
849
|
translate(e) {
|
|
842
|
-
const r = this.new(), n =
|
|
850
|
+
const r = this.new(), n = ci(e);
|
|
843
851
|
return n.type = "translate", r.ops.push(n), r;
|
|
844
852
|
}
|
|
845
853
|
/**
|
|
@@ -849,23 +857,23 @@ let nt = class K {
|
|
|
849
857
|
* @param value - The amount to magnify by.
|
|
850
858
|
*/
|
|
851
859
|
magnify(e) {
|
|
852
|
-
const r = this.new(), n =
|
|
860
|
+
const r = this.new(), n = hi(e);
|
|
853
861
|
return n.type = "magnify", r.ops.push(n), r;
|
|
854
862
|
}
|
|
855
863
|
scale(e, r) {
|
|
856
|
-
const n = y(e, r), s = this.new(), i =
|
|
864
|
+
const n = y(e, r), s = this.new(), i = fi(n);
|
|
857
865
|
return i.type = "scale", s.ops.push(i), s;
|
|
858
866
|
}
|
|
859
867
|
clamp(e, r) {
|
|
860
|
-
const n = y(e, r), s = this.new(), i =
|
|
868
|
+
const n = y(e, r), s = this.new(), i = pi(n);
|
|
861
869
|
return i.type = "clamp", s.ops.push(i), s;
|
|
862
870
|
}
|
|
863
871
|
reBound(e, r) {
|
|
864
|
-
const n = y(e, r), s = this.new(), i =
|
|
872
|
+
const n = y(e, r), s = this.new(), i = di(n);
|
|
865
873
|
return i.type = "re-bound", s.ops.push(i), s;
|
|
866
874
|
}
|
|
867
875
|
invert() {
|
|
868
|
-
const e =
|
|
876
|
+
const e = gi();
|
|
869
877
|
e.type = "invert";
|
|
870
878
|
const r = this.new();
|
|
871
879
|
return r.ops.push(e), r;
|
|
@@ -904,11 +912,11 @@ let nt = class K {
|
|
|
904
912
|
return { scale: this.dim(1), offset: this.pos(0) };
|
|
905
913
|
}
|
|
906
914
|
static IDENTITY = new K();
|
|
907
|
-
},
|
|
915
|
+
}, yi = class A {
|
|
908
916
|
x;
|
|
909
917
|
y;
|
|
910
918
|
currRoot;
|
|
911
|
-
constructor(e = new
|
|
919
|
+
constructor(e = new st(), r = new st(), n = null) {
|
|
912
920
|
this.x = e, this.y = r, this.currRoot = n;
|
|
913
921
|
}
|
|
914
922
|
static translate(e, r) {
|
|
@@ -933,7 +941,7 @@ let nt = class K {
|
|
|
933
941
|
return new A().reBound(e);
|
|
934
942
|
}
|
|
935
943
|
translate(e, r) {
|
|
936
|
-
const n =
|
|
944
|
+
const n = v(e, r), s = this.copy();
|
|
937
945
|
return s.x = this.x.translate(n.x), s.y = this.y.translate(n.y), s;
|
|
938
946
|
}
|
|
939
947
|
translateX(e) {
|
|
@@ -950,9 +958,9 @@ let nt = class K {
|
|
|
950
958
|
}
|
|
951
959
|
scale(e) {
|
|
952
960
|
const r = this.copy();
|
|
953
|
-
if (
|
|
961
|
+
if (mr(e)) {
|
|
954
962
|
const n = this.currRoot;
|
|
955
|
-
return r.currRoot = e.root, n != null && !
|
|
963
|
+
return r.currRoot = e.root, n != null && !St(n, e.root) && (n.x !== e.root.x && (r.x = r.x.invert()), n.y !== e.root.y && (r.y = r.y.invert())), r.x = r.x.scale(Ne(e)), r.y = r.y.scale(Ie(e)), r;
|
|
956
964
|
}
|
|
957
965
|
return r.x = r.x.scale(e.width), r.y = r.y.scale(e.height), r;
|
|
958
966
|
}
|
|
@@ -979,7 +987,7 @@ let nt = class K {
|
|
|
979
987
|
return { x: this.x.dim(e.x), y: this.y.dim(e.y) };
|
|
980
988
|
}
|
|
981
989
|
box(e) {
|
|
982
|
-
return
|
|
990
|
+
return O(
|
|
983
991
|
this.pos(e.one),
|
|
984
992
|
this.pos(e.two),
|
|
985
993
|
0,
|
|
@@ -995,28 +1003,28 @@ let nt = class K {
|
|
|
995
1003
|
}
|
|
996
1004
|
static IDENTITY = new A();
|
|
997
1005
|
};
|
|
998
|
-
const
|
|
1006
|
+
const wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
999
1007
|
__proto__: null,
|
|
1000
|
-
Scale:
|
|
1001
|
-
XY:
|
|
1002
|
-
crudeXYTransform:
|
|
1003
|
-
transform:
|
|
1008
|
+
Scale: st,
|
|
1009
|
+
XY: yi,
|
|
1010
|
+
crudeXYTransform: ui,
|
|
1011
|
+
transform: li
|
|
1004
1012
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1005
|
-
let
|
|
1013
|
+
let mi = (t, e = 21) => (r = e) => {
|
|
1006
1014
|
let n = "", s = r | 0;
|
|
1007
1015
|
for (; s--; )
|
|
1008
1016
|
n += t[Math.random() * t.length | 0];
|
|
1009
1017
|
return n;
|
|
1010
1018
|
};
|
|
1011
|
-
const
|
|
1019
|
+
const bi = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", wr = 11, wi = mi(bi, wr), At = () => wi(), Oo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1012
1020
|
__proto__: null,
|
|
1013
|
-
LENGTH:
|
|
1014
|
-
create:
|
|
1015
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1021
|
+
LENGTH: wr,
|
|
1022
|
+
create: At
|
|
1023
|
+
}, Symbol.toStringTag, { value: "Module" })), Oi = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, vi = a.enum(["static", "dynamic"]), Ti = a.union([
|
|
1016
1024
|
a.tuple([a.int()]),
|
|
1017
1025
|
a.tuple([a.int(), a.int().min(1).max(12)]),
|
|
1018
1026
|
a.tuple([a.int(), a.int().min(1).max(12), a.int().min(1).max(31)])
|
|
1019
|
-
]),
|
|
1027
|
+
]), Or = (t, e) => {
|
|
1020
1028
|
const r = new b(e);
|
|
1021
1029
|
if (![
|
|
1022
1030
|
h.DAY,
|
|
@@ -1389,7 +1397,7 @@ let b = class d extends J {
|
|
|
1389
1397
|
* @example TimeStamp.now().remainder(TimeStamp.DAY) // => TimeStamp representing the current day
|
|
1390
1398
|
*/
|
|
1391
1399
|
remainder(e) {
|
|
1392
|
-
return
|
|
1400
|
+
return Or(this, e);
|
|
1393
1401
|
}
|
|
1394
1402
|
/** @returns true if the day portion TimeStamp is today, false otherwise. */
|
|
1395
1403
|
get isToday() {
|
|
@@ -1502,7 +1510,7 @@ let b = class d extends J {
|
|
|
1502
1510
|
a.bigint().transform((e) => new d(e)),
|
|
1503
1511
|
a.date().transform((e) => new d(e)),
|
|
1504
1512
|
a.custom((e) => e instanceof h).transform((e) => new d(e)),
|
|
1505
|
-
|
|
1513
|
+
Ti.transform((e) => new d(e))
|
|
1506
1514
|
]);
|
|
1507
1515
|
/**
|
|
1508
1516
|
* Sorts two timestamps.
|
|
@@ -1527,7 +1535,7 @@ class h extends J {
|
|
|
1527
1535
|
* @returns A TimeSpan representing the given number of seconds.
|
|
1528
1536
|
*/
|
|
1529
1537
|
static fromSeconds(e) {
|
|
1530
|
-
return e instanceof h ? e : e instanceof
|
|
1538
|
+
return e instanceof h ? e : e instanceof Lt ? e.period : e instanceof b ? new h(e) : ["number", "bigint"].includes(typeof e) ? h.seconds(e) : new h(e);
|
|
1531
1539
|
}
|
|
1532
1540
|
/**
|
|
1533
1541
|
* Creates a TimeSpan representing the given number of milliseconds.
|
|
@@ -1536,7 +1544,7 @@ class h extends J {
|
|
|
1536
1544
|
* @returns A TimeSpan representing the given number of milliseconds.
|
|
1537
1545
|
*/
|
|
1538
1546
|
static fromMilliseconds(e) {
|
|
1539
|
-
return e instanceof h ? e : e instanceof
|
|
1547
|
+
return e instanceof h ? e : e instanceof Lt ? e.period : e instanceof b ? new h(e) : ["number", "bigint"].includes(typeof e) ? h.milliseconds(e) : new h(e);
|
|
1540
1548
|
}
|
|
1541
1549
|
/**
|
|
1542
1550
|
* @returns the primitive value of the TimeSpan. Overrides standard JS valueOf()
|
|
@@ -1588,7 +1596,7 @@ class h extends J {
|
|
|
1588
1596
|
* @returns A new TimeSpan representing the remainder.
|
|
1589
1597
|
*/
|
|
1590
1598
|
remainder(e) {
|
|
1591
|
-
return
|
|
1599
|
+
return Or(this, e);
|
|
1592
1600
|
}
|
|
1593
1601
|
/**
|
|
1594
1602
|
* Truncates the TimeSpan to the nearest multiple of the given span.
|
|
@@ -1771,7 +1779,7 @@ class h extends J {
|
|
|
1771
1779
|
a.instanceof(h)
|
|
1772
1780
|
]);
|
|
1773
1781
|
}
|
|
1774
|
-
let
|
|
1782
|
+
let Lt = class Q extends J {
|
|
1775
1783
|
constructor(e) {
|
|
1776
1784
|
super(e.valueOf());
|
|
1777
1785
|
}
|
|
@@ -2070,7 +2078,7 @@ let Rt = class Q extends J {
|
|
|
2070
2078
|
static sort(e, r) {
|
|
2071
2079
|
return b.sort(e.start, r.start) || b.sort(e.end, r.end);
|
|
2072
2080
|
}
|
|
2073
|
-
},
|
|
2081
|
+
}, T = class u extends J {
|
|
2074
2082
|
constructor(e) {
|
|
2075
2083
|
if (e instanceof u || typeof e == "string" || typeof e.valueOf() == "string")
|
|
2076
2084
|
super(e.valueOf());
|
|
@@ -2406,7 +2414,7 @@ class m extends J {
|
|
|
2406
2414
|
return this.valueOf() === 0;
|
|
2407
2415
|
}
|
|
2408
2416
|
}
|
|
2409
|
-
const
|
|
2417
|
+
const vo = a.union([
|
|
2410
2418
|
a.instanceof(Uint8Array),
|
|
2411
2419
|
a.instanceof(Uint16Array),
|
|
2412
2420
|
a.instanceof(Uint32Array),
|
|
@@ -2417,40 +2425,40 @@ const wo = a.union([
|
|
|
2417
2425
|
a.instanceof(Int16Array),
|
|
2418
2426
|
a.instanceof(Int32Array),
|
|
2419
2427
|
a.instanceof(BigInt64Array)
|
|
2420
|
-
]),
|
|
2428
|
+
]), vr = (t) => {
|
|
2421
2429
|
const e = typeof t;
|
|
2422
2430
|
return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof b || t instanceof h || t instanceof Date;
|
|
2423
|
-
},
|
|
2424
|
-
function
|
|
2425
|
-
return typeof t == "string" &&
|
|
2431
|
+
}, xi = (t, e, r, n = 0) => t.usesBigInt && !e.usesBigInt ? Number(r) - Number(n) : !t.usesBigInt && e.usesBigInt ? BigInt(r.valueOf()) - BigInt(n.valueOf()) : Me(r, -n), Me = (t, e) => e == 0 ? t : t == 0 ? e : typeof t == "bigint" && typeof e == "bigint" || typeof t == "number" && typeof e == "number" ? t + e : Number(t) + Number(e), $i = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
|
|
2432
|
+
function Si(t) {
|
|
2433
|
+
return typeof t == "string" && $i.test(t);
|
|
2426
2434
|
}
|
|
2427
|
-
const
|
|
2435
|
+
const $ = [];
|
|
2428
2436
|
for (let t = 0; t < 256; ++t)
|
|
2429
|
-
|
|
2430
|
-
function
|
|
2431
|
-
return (
|
|
2437
|
+
$.push((t + 256).toString(16).slice(1));
|
|
2438
|
+
function Ni(t, e = 0) {
|
|
2439
|
+
return ($[t[e + 0]] + $[t[e + 1]] + $[t[e + 2]] + $[t[e + 3]] + "-" + $[t[e + 4]] + $[t[e + 5]] + "-" + $[t[e + 6]] + $[t[e + 7]] + "-" + $[t[e + 8]] + $[t[e + 9]] + "-" + $[t[e + 10]] + $[t[e + 11]] + $[t[e + 12]] + $[t[e + 13]] + $[t[e + 14]] + $[t[e + 15]]).toLowerCase();
|
|
2432
2440
|
}
|
|
2433
|
-
function
|
|
2434
|
-
const r =
|
|
2435
|
-
if (!
|
|
2441
|
+
function Ii(t, e = 0) {
|
|
2442
|
+
const r = Ni(t, e);
|
|
2443
|
+
if (!Si(r))
|
|
2436
2444
|
throw TypeError("Stringified UUID is invalid");
|
|
2437
2445
|
return r;
|
|
2438
2446
|
}
|
|
2439
2447
|
typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
2440
|
-
const
|
|
2441
|
-
[Symbol.iterator]: () =>
|
|
2448
|
+
const Tr = (t, e) => Ii(t, e), L = -1, it = {
|
|
2449
|
+
[Symbol.iterator]: () => it,
|
|
2442
2450
|
next: () => ({ done: !0, value: void 0 })
|
|
2443
|
-
},
|
|
2451
|
+
}, Mi = a.string().transform(
|
|
2444
2452
|
(t) => new Uint8Array(
|
|
2445
2453
|
atob(t).split("").map((e) => e.charCodeAt(0))
|
|
2446
2454
|
).buffer
|
|
2447
|
-
),
|
|
2455
|
+
), Ei = a.union([a.null(), a.undefined()]).transform(() => new Uint8Array().buffer), at = 10, xr = (t, e) => {
|
|
2448
2456
|
if (t === "number" && !e.isNumeric)
|
|
2449
2457
|
throw new Error(`cannot convert series of type ${e.toString()} to number`);
|
|
2450
2458
|
if (t === "bigint" && !e.usesBigInt)
|
|
2451
2459
|
throw new Error(`cannot convert series of type ${e.toString()} to bigint`);
|
|
2452
|
-
},
|
|
2453
|
-
let
|
|
2460
|
+
}, $r = "sy_x_telem_series";
|
|
2461
|
+
let Sr = class D {
|
|
2454
2462
|
/**
|
|
2455
2463
|
* A unique identifier for the series. If specified by the user, it is their
|
|
2456
2464
|
* responsibility to ensure that it is unique. If not specified, a new ID will be
|
|
@@ -2461,7 +2469,7 @@ let xr = class D {
|
|
|
2461
2469
|
* A discriminator used for identifying instances of the series class even
|
|
2462
2470
|
* when bundlers mangle the class name.
|
|
2463
2471
|
*/
|
|
2464
|
-
discriminator =
|
|
2472
|
+
discriminator = $r;
|
|
2465
2473
|
/** The data type of the series. */
|
|
2466
2474
|
dataType;
|
|
2467
2475
|
/**
|
|
@@ -2501,15 +2509,15 @@ let xr = class D {
|
|
|
2501
2509
|
*/
|
|
2502
2510
|
static crudeZ = a.object({
|
|
2503
2511
|
timeRange: V.z.optional(),
|
|
2504
|
-
dataType:
|
|
2512
|
+
dataType: T.z,
|
|
2505
2513
|
alignment: a.coerce.bigint().optional(),
|
|
2506
2514
|
data: a.union([
|
|
2507
|
-
|
|
2508
|
-
|
|
2515
|
+
Mi,
|
|
2516
|
+
Ei,
|
|
2509
2517
|
a.instanceof(ArrayBuffer),
|
|
2510
2518
|
a.instanceof(Uint8Array)
|
|
2511
2519
|
]),
|
|
2512
|
-
glBufferUsage:
|
|
2520
|
+
glBufferUsage: vi.optional().default("static").optional()
|
|
2513
2521
|
});
|
|
2514
2522
|
/**
|
|
2515
2523
|
* A zod schema that validates and constructs a series from it's crude
|
|
@@ -2590,23 +2598,23 @@ let xr = class D {
|
|
|
2590
2598
|
* @throws Error if data type cannot be inferred from input
|
|
2591
2599
|
*/
|
|
2592
2600
|
constructor(e) {
|
|
2593
|
-
|
|
2601
|
+
Ai(e) && (e = { data: e }), e.data ??= [];
|
|
2594
2602
|
const {
|
|
2595
2603
|
dataType: r,
|
|
2596
2604
|
timeRange: n,
|
|
2597
2605
|
sampleOffset: s = 0,
|
|
2598
2606
|
glBufferUsage: i = "static",
|
|
2599
2607
|
alignment: o = 0n,
|
|
2600
|
-
key: c =
|
|
2608
|
+
key: c = At(),
|
|
2601
2609
|
data: l
|
|
2602
2610
|
} = e;
|
|
2603
|
-
if (
|
|
2611
|
+
if (Nr(l)) {
|
|
2604
2612
|
const g = l;
|
|
2605
2613
|
this.key = g.key, this.dataType = g.dataType, this.sampleOffset = g.sampleOffset, this.gl = g.gl, this._data = g._data, this.timeRange = g.timeRange, this.alignment = g.alignment, this.cachedMin = g.cachedMin, this.cachedMax = g.cachedMax, this.writePos = g.writePos, this._refCount = g._refCount, this.cachedLength = g.cachedLength;
|
|
2606
2614
|
return;
|
|
2607
2615
|
}
|
|
2608
|
-
const f =
|
|
2609
|
-
if (r != null) this.dataType = new
|
|
2616
|
+
const f = vr(l), p = Array.isArray(l);
|
|
2617
|
+
if (r != null) this.dataType = new T(r);
|
|
2610
2618
|
else {
|
|
2611
2619
|
if (l instanceof ArrayBuffer)
|
|
2612
2620
|
throw new Error(
|
|
@@ -2621,18 +2629,18 @@ let xr = class D {
|
|
|
2621
2629
|
);
|
|
2622
2630
|
g = l[0];
|
|
2623
2631
|
}
|
|
2624
|
-
if (typeof g == "string") this.dataType =
|
|
2625
|
-
else if (typeof g == "number") this.dataType =
|
|
2626
|
-
else if (typeof g == "bigint") this.dataType =
|
|
2627
|
-
else if (typeof g == "boolean") this.dataType =
|
|
2632
|
+
if (typeof g == "string") this.dataType = T.STRING;
|
|
2633
|
+
else if (typeof g == "number") this.dataType = T.FLOAT64;
|
|
2634
|
+
else if (typeof g == "bigint") this.dataType = T.INT64;
|
|
2635
|
+
else if (typeof g == "boolean") this.dataType = T.BOOLEAN;
|
|
2628
2636
|
else if (g instanceof b || g instanceof Date || g instanceof b)
|
|
2629
|
-
this.dataType =
|
|
2630
|
-
else if (typeof g == "object") this.dataType =
|
|
2637
|
+
this.dataType = T.TIMESTAMP;
|
|
2638
|
+
else if (typeof g == "object") this.dataType = T.JSON;
|
|
2631
2639
|
else
|
|
2632
2640
|
throw new Error(
|
|
2633
2641
|
`cannot infer data type of ${typeof g} when constructing a Series from a JS array`
|
|
2634
2642
|
);
|
|
2635
|
-
} else this.dataType = new
|
|
2643
|
+
} else this.dataType = new T(l);
|
|
2636
2644
|
}
|
|
2637
2645
|
if (!p && !f) this._data = l;
|
|
2638
2646
|
else if (p && l.length === 0)
|
|
@@ -2640,9 +2648,9 @@ let xr = class D {
|
|
|
2640
2648
|
else {
|
|
2641
2649
|
let g = f ? [l] : l;
|
|
2642
2650
|
const S = g[0];
|
|
2643
|
-
(S instanceof b || S instanceof Date || S instanceof h) && (g = g.map((E) => new b(E).valueOf())), this.dataType.equals(
|
|
2651
|
+
(S instanceof b || S instanceof Date || S instanceof h) && (g = g.map((E) => new b(E).valueOf())), this.dataType.equals(T.STRING) ? (this.cachedLength = g.length, this._data = new TextEncoder().encode(`${g.join(`
|
|
2644
2652
|
`)}
|
|
2645
|
-
`).buffer) : this.dataType.equals(
|
|
2653
|
+
`).buffer) : this.dataType.equals(T.JSON) ? (this.cachedLength = g.length, this._data = new TextEncoder().encode(
|
|
2646
2654
|
`${g.map((E) => He.encodeString(E)).join(`
|
|
2647
2655
|
`)}
|
|
2648
2656
|
`
|
|
@@ -2669,7 +2677,7 @@ let xr = class D {
|
|
|
2669
2677
|
static alloc({ capacity: e, dataType: r, ...n }) {
|
|
2670
2678
|
if (e === 0)
|
|
2671
2679
|
throw new Error("[Series] - cannot allocate an array of length 0");
|
|
2672
|
-
const s = new new
|
|
2680
|
+
const s = new new T(r).Array(e), i = new D({ data: s.buffer, dataType: r, ...n });
|
|
2673
2681
|
return i.writePos = 0, i;
|
|
2674
2682
|
}
|
|
2675
2683
|
/**
|
|
@@ -2759,7 +2767,7 @@ let xr = class D {
|
|
|
2759
2767
|
* @returns An array of values parsed from the JSON series.
|
|
2760
2768
|
*/
|
|
2761
2769
|
parseJSON(e) {
|
|
2762
|
-
if (!this.dataType.equals(
|
|
2770
|
+
if (!this.dataType.equals(T.JSON))
|
|
2763
2771
|
throw new Error("cannot parse non-JSON series as JSON");
|
|
2764
2772
|
return this.toStrings().map((r) => e.parse(He.decodeString(r)));
|
|
2765
2773
|
}
|
|
@@ -2800,7 +2808,7 @@ let xr = class D {
|
|
|
2800
2808
|
let e = 0;
|
|
2801
2809
|
const r = [0];
|
|
2802
2810
|
return this.data.forEach((n, s) => {
|
|
2803
|
-
n ===
|
|
2811
|
+
n === at && (e++, r.push(s + 1));
|
|
2804
2812
|
}), this._cachedIndexes = r, this.cachedLength = e, e;
|
|
2805
2813
|
}
|
|
2806
2814
|
/**
|
|
@@ -2816,7 +2824,7 @@ let xr = class D {
|
|
|
2816
2824
|
if (this.dataType.equals(e)) return this;
|
|
2817
2825
|
const n = new e.Array(this.length);
|
|
2818
2826
|
for (let s = 0; s < this.length; s++)
|
|
2819
|
-
n[s] =
|
|
2827
|
+
n[s] = xi(this.dataType, e, this.data[s], r);
|
|
2820
2828
|
return new D({
|
|
2821
2829
|
data: n.buffer,
|
|
2822
2830
|
dataType: e,
|
|
@@ -2828,7 +2836,7 @@ let xr = class D {
|
|
|
2828
2836
|
}
|
|
2829
2837
|
calcRawMax() {
|
|
2830
2838
|
if (this.length === 0) return -1 / 0;
|
|
2831
|
-
if (this.dataType.equals(
|
|
2839
|
+
if (this.dataType.equals(T.TIMESTAMP))
|
|
2832
2840
|
this.cachedMax = this.data[this.data.length - 1];
|
|
2833
2841
|
else if (this.dataType.usesBigInt) {
|
|
2834
2842
|
const e = this.data;
|
|
@@ -2850,7 +2858,7 @@ let xr = class D {
|
|
|
2850
2858
|
}
|
|
2851
2859
|
calcRawMin() {
|
|
2852
2860
|
if (this.length === 0) return 1 / 0;
|
|
2853
|
-
if (this.dataType.equals(
|
|
2861
|
+
if (this.dataType.equals(T.TIMESTAMP)) this.cachedMin = this.data[0];
|
|
2854
2862
|
else if (this.dataType.usesBigInt) {
|
|
2855
2863
|
const e = this.data;
|
|
2856
2864
|
this.cachedMin = e.reduce((r, n) => r < n ? r : n);
|
|
@@ -2893,7 +2901,7 @@ let xr = class D {
|
|
|
2893
2901
|
}
|
|
2894
2902
|
at(e, r = !1) {
|
|
2895
2903
|
if (this.dataType.isVariable) return this.atVariable(e, r ?? !1);
|
|
2896
|
-
if (this.dataType.equals(
|
|
2904
|
+
if (this.dataType.equals(T.UUID)) return this.atUUID(e, r);
|
|
2897
2905
|
e < 0 && (e = this.length + e);
|
|
2898
2906
|
const n = this.data[e];
|
|
2899
2907
|
if (n == null) {
|
|
@@ -2904,7 +2912,7 @@ let xr = class D {
|
|
|
2904
2912
|
}
|
|
2905
2913
|
atUUID(e, r) {
|
|
2906
2914
|
e < 0 && (e = this.length + e);
|
|
2907
|
-
const n =
|
|
2915
|
+
const n = Tr(
|
|
2908
2916
|
new Uint8Array(this.buffer, e * this.dataType.density.valueOf())
|
|
2909
2917
|
);
|
|
2910
2918
|
if (n == null) {
|
|
@@ -2920,7 +2928,7 @@ let xr = class D {
|
|
|
2920
2928
|
else {
|
|
2921
2929
|
e < 0 && (e = this.length + e);
|
|
2922
2930
|
for (let o = 0; o < this.data.length; o++)
|
|
2923
|
-
if (this.data[o] ===
|
|
2931
|
+
if (this.data[o] === at) {
|
|
2924
2932
|
if (e === 0) {
|
|
2925
2933
|
s = o;
|
|
2926
2934
|
break;
|
|
@@ -2933,7 +2941,7 @@ let xr = class D {
|
|
|
2933
2941
|
}
|
|
2934
2942
|
}
|
|
2935
2943
|
const i = this.data.slice(n, s);
|
|
2936
|
-
return this.dataType.equals(
|
|
2944
|
+
return this.dataType.equals(T.STRING) ? new TextDecoder().decode(i) : ct(JSON.parse(new TextDecoder().decode(i)));
|
|
2937
2945
|
}
|
|
2938
2946
|
/**
|
|
2939
2947
|
* @returns the index of the first sample that is greater than or equal to the given value.
|
|
@@ -2958,7 +2966,7 @@ let xr = class D {
|
|
|
2958
2966
|
* be the same buffer previously passed to {@method acquire} or {@method updateGLBuffer}.
|
|
2959
2967
|
*/
|
|
2960
2968
|
updateGLBuffer(e) {
|
|
2961
|
-
if (this.gl.control = e, !this.dataType.equals(
|
|
2969
|
+
if (this.gl.control = e, !this.dataType.equals(T.FLOAT32) && !this.dataType.equals(T.UINT8))
|
|
2962
2970
|
throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");
|
|
2963
2971
|
const { buffer: r, bufferUsage: n, prevBuffer: s } = this.gl;
|
|
2964
2972
|
if (r == null && (this.gl.buffer = e.createBuffer()), this.writePos !== s)
|
|
@@ -2974,7 +2982,7 @@ let xr = class D {
|
|
|
2974
2982
|
), this.gl.prevBuffer = L;
|
|
2975
2983
|
}
|
|
2976
2984
|
as(e) {
|
|
2977
|
-
return
|
|
2985
|
+
return xr(e, this.dataType), this;
|
|
2978
2986
|
}
|
|
2979
2987
|
/** @returns a digest containing information about the series. */
|
|
2980
2988
|
get digest() {
|
|
@@ -2983,8 +2991,8 @@ let xr = class D {
|
|
|
2983
2991
|
dataType: this.dataType.toString(),
|
|
2984
2992
|
sampleOffset: this.sampleOffset,
|
|
2985
2993
|
alignment: {
|
|
2986
|
-
lower:
|
|
2987
|
-
upper:
|
|
2994
|
+
lower: Pt(this.alignmentBounds.lower),
|
|
2995
|
+
upper: Pt(this.alignmentBounds.upper)
|
|
2988
2996
|
},
|
|
2989
2997
|
timeRange: this.timeRange.toString(),
|
|
2990
2998
|
length: this.length,
|
|
@@ -3018,10 +3026,10 @@ let xr = class D {
|
|
|
3018
3026
|
}
|
|
3019
3027
|
[Symbol.iterator]() {
|
|
3020
3028
|
if (this.dataType.isVariable) {
|
|
3021
|
-
const e = new
|
|
3022
|
-
return this.dataType.equals(
|
|
3029
|
+
const e = new Bi(this);
|
|
3030
|
+
return this.dataType.equals(T.JSON) ? new Ui(e) : e;
|
|
3023
3031
|
}
|
|
3024
|
-
return this.dataType.equals(
|
|
3032
|
+
return this.dataType.equals(T.UUID) ? new Ci(this) : new ji(this);
|
|
3025
3033
|
}
|
|
3026
3034
|
/**
|
|
3027
3035
|
* Returns a slice of the series from start to end.
|
|
@@ -3048,7 +3056,7 @@ let xr = class D {
|
|
|
3048
3056
|
* @returns An iterator over the specified range.
|
|
3049
3057
|
*/
|
|
3050
3058
|
subIterator(e, r) {
|
|
3051
|
-
return new
|
|
3059
|
+
return new Dt(this, e, r ?? this.length);
|
|
3052
3060
|
}
|
|
3053
3061
|
/**
|
|
3054
3062
|
* Returns an iterator over a portion of the series based on alignment.
|
|
@@ -3057,7 +3065,7 @@ let xr = class D {
|
|
|
3057
3065
|
* @returns An iterator over the specified alignment range.
|
|
3058
3066
|
*/
|
|
3059
3067
|
subAlignmentIterator(e, r) {
|
|
3060
|
-
return new
|
|
3068
|
+
return new Dt(
|
|
3061
3069
|
this,
|
|
3062
3070
|
Number(e - this.alignment),
|
|
3063
3071
|
Number(r - this.alignment)
|
|
@@ -3120,8 +3128,8 @@ let xr = class D {
|
|
|
3120
3128
|
return e += "])", e;
|
|
3121
3129
|
}
|
|
3122
3130
|
};
|
|
3123
|
-
const
|
|
3124
|
-
let
|
|
3131
|
+
const Ai = (t) => t == null ? !1 : Array.isArray(t) || t instanceof ArrayBuffer || ArrayBuffer.isView(t) && !(t instanceof DataView) || t instanceof Sr ? !0 : vr(t), Nr = Oi($r, Sr);
|
|
3132
|
+
let Dt = class {
|
|
3125
3133
|
series;
|
|
3126
3134
|
end;
|
|
3127
3135
|
index;
|
|
@@ -3134,7 +3142,7 @@ let Lt = class {
|
|
|
3134
3142
|
return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
|
|
3135
3143
|
}
|
|
3136
3144
|
};
|
|
3137
|
-
class
|
|
3145
|
+
class Bi {
|
|
3138
3146
|
series;
|
|
3139
3147
|
index;
|
|
3140
3148
|
decoder;
|
|
@@ -3147,12 +3155,12 @@ class Ei {
|
|
|
3147
3155
|
}
|
|
3148
3156
|
next() {
|
|
3149
3157
|
const e = this.index, r = this.series.data;
|
|
3150
|
-
for (; this.index < r.length && r[this.index] !==
|
|
3158
|
+
for (; this.index < r.length && r[this.index] !== at; ) this.index++;
|
|
3151
3159
|
const n = this.index;
|
|
3152
3160
|
return e === n ? { done: !0, value: void 0 } : (this.index++, { done: !1, value: this.decoder.decode(this.series.buffer.slice(e, n)) });
|
|
3153
3161
|
}
|
|
3154
3162
|
}
|
|
3155
|
-
let
|
|
3163
|
+
let Ui = class Ir {
|
|
3156
3164
|
wrapped;
|
|
3157
3165
|
static schema = a.record(a.string(), a.unknown());
|
|
3158
3166
|
constructor(e) {
|
|
@@ -3162,25 +3170,25 @@ let Ai = class Nr {
|
|
|
3162
3170
|
const e = this.wrapped.next();
|
|
3163
3171
|
return e.done === !0 ? { done: !0, value: void 0 } : {
|
|
3164
3172
|
done: !1,
|
|
3165
|
-
value: He.decodeString(e.value,
|
|
3173
|
+
value: He.decodeString(e.value, Ir.schema)
|
|
3166
3174
|
};
|
|
3167
3175
|
}
|
|
3168
|
-
},
|
|
3176
|
+
}, Ci = class {
|
|
3169
3177
|
series;
|
|
3170
3178
|
index;
|
|
3171
3179
|
data;
|
|
3172
3180
|
density;
|
|
3173
3181
|
constructor(e) {
|
|
3174
|
-
if (!e.dataType.equals(
|
|
3182
|
+
if (!e.dataType.equals(T.UUID))
|
|
3175
3183
|
throw new Error("cannot create a UUID series iterator for a non-UUID series");
|
|
3176
|
-
this.series = e, this.index = 0, this.data = new Uint8Array(e.buffer), this.density =
|
|
3184
|
+
this.series = e, this.index = 0, this.data = new Uint8Array(e.buffer), this.density = T.UUID.density.valueOf();
|
|
3177
3185
|
}
|
|
3178
3186
|
next() {
|
|
3179
3187
|
if (this.index >= this.series.length) return { done: !0, value: void 0 };
|
|
3180
|
-
const e =
|
|
3188
|
+
const e = Tr(this.data, this.index * this.density);
|
|
3181
3189
|
return this.index++, { done: !1, value: e };
|
|
3182
3190
|
}
|
|
3183
|
-
},
|
|
3191
|
+
}, ji = class {
|
|
3184
3192
|
series;
|
|
3185
3193
|
index;
|
|
3186
3194
|
constructor(e) {
|
|
@@ -3192,7 +3200,7 @@ let Ai = class Nr {
|
|
|
3192
3200
|
value: this.series.at(this.index++, !0)
|
|
3193
3201
|
};
|
|
3194
3202
|
}
|
|
3195
|
-
},
|
|
3203
|
+
}, So = class {
|
|
3196
3204
|
/** The array of series in this collection */
|
|
3197
3205
|
series;
|
|
3198
3206
|
/**
|
|
@@ -3245,14 +3253,14 @@ let Ai = class Nr {
|
|
|
3245
3253
|
this.series = e;
|
|
3246
3254
|
}
|
|
3247
3255
|
as(e) {
|
|
3248
|
-
return
|
|
3256
|
+
return xr(e, this.dataType), this;
|
|
3249
3257
|
}
|
|
3250
3258
|
/**
|
|
3251
3259
|
* Returns the data type of the series in this collection. If the collection is empty,
|
|
3252
3260
|
* returns DataType.UNKNOWN.
|
|
3253
3261
|
*/
|
|
3254
3262
|
get dataType() {
|
|
3255
|
-
return this.series.length === 0 ?
|
|
3263
|
+
return this.series.length === 0 ? T.UNKNOWN : this.series[0].dataType;
|
|
3256
3264
|
}
|
|
3257
3265
|
/**
|
|
3258
3266
|
* Returns the combined time range of all series in the collection. If the collection
|
|
@@ -3287,7 +3295,7 @@ let Ai = class Nr {
|
|
|
3287
3295
|
const r = () => new Error(
|
|
3288
3296
|
`cannot push a ${e.dataType.toString()} series to a ${this.dataType.toString()} multi-series`
|
|
3289
3297
|
), n = e.dataType.equals(this.dataType);
|
|
3290
|
-
if (
|
|
3298
|
+
if (Nr(e)) {
|
|
3291
3299
|
if (this.series.length !== 0 && !n) throw r();
|
|
3292
3300
|
this.series.push(e);
|
|
3293
3301
|
} else {
|
|
@@ -3334,7 +3342,7 @@ let Ai = class Nr {
|
|
|
3334
3342
|
*/
|
|
3335
3343
|
subAlignmentIterator(e, r) {
|
|
3336
3344
|
if (e >= this.alignmentBounds.upper || r <= this.alignmentBounds.lower)
|
|
3337
|
-
return
|
|
3345
|
+
return it;
|
|
3338
3346
|
let n = 0;
|
|
3339
3347
|
for (let i = 0; i < this.series.length; i++) {
|
|
3340
3348
|
const o = this.series[i];
|
|
@@ -3364,7 +3372,7 @@ let Ai = class Nr {
|
|
|
3364
3372
|
* @returns An iterator over the specified range.
|
|
3365
3373
|
*/
|
|
3366
3374
|
subAlignmentSpanIterator(e, r) {
|
|
3367
|
-
if (e >= this.alignmentBounds.upper) return
|
|
3375
|
+
if (e >= this.alignmentBounds.upper) return it;
|
|
3368
3376
|
r = Math.min(r, Number(this.distance(e, this.alignmentBounds.upper)));
|
|
3369
3377
|
let n = 0;
|
|
3370
3378
|
for (let s = 0; s < this.series.length; s++) {
|
|
@@ -3389,7 +3397,7 @@ let Ai = class Nr {
|
|
|
3389
3397
|
* Returns the bounds containing the minimum and maximum values across all series.
|
|
3390
3398
|
*/
|
|
3391
3399
|
get bounds() {
|
|
3392
|
-
return
|
|
3400
|
+
return rr(this.series.map((e) => e.bounds));
|
|
3393
3401
|
}
|
|
3394
3402
|
/**
|
|
3395
3403
|
* Returns the sum of the byte lengths of all series.
|
|
@@ -3416,7 +3424,7 @@ let Ai = class Nr {
|
|
|
3416
3424
|
*/
|
|
3417
3425
|
traverseAlignment(e, r) {
|
|
3418
3426
|
const n = this.series.map((s) => s.alignmentBounds);
|
|
3419
|
-
return
|
|
3427
|
+
return nr(n, e, r);
|
|
3420
3428
|
}
|
|
3421
3429
|
/**
|
|
3422
3430
|
* Acquires a reference to the WebGL buffer for all series.
|
|
@@ -3439,7 +3447,7 @@ let Ai = class Nr {
|
|
|
3439
3447
|
*/
|
|
3440
3448
|
distance(e, r) {
|
|
3441
3449
|
const n = this.series.map((s) => s.alignmentBounds);
|
|
3442
|
-
return
|
|
3450
|
+
return sr(n, e, r);
|
|
3443
3451
|
}
|
|
3444
3452
|
/**
|
|
3445
3453
|
* Parses a JSON multi-series into an array of values using the provided zod schema.
|
|
@@ -3449,7 +3457,7 @@ let Ai = class Nr {
|
|
|
3449
3457
|
* @returns An array of values parsed from the JSON series.
|
|
3450
3458
|
*/
|
|
3451
3459
|
parseJSON(e) {
|
|
3452
|
-
if (!this.dataType.equals(
|
|
3460
|
+
if (!this.dataType.equals(T.JSON))
|
|
3453
3461
|
throw new Error("cannot parse non-JSON series as JSON");
|
|
3454
3462
|
return this.series.flatMap((r) => r.parseJSON(e));
|
|
3455
3463
|
}
|
|
@@ -3462,7 +3470,7 @@ let Ai = class Nr {
|
|
|
3462
3470
|
next() {
|
|
3463
3471
|
return { done: !0, value: void 0 };
|
|
3464
3472
|
}
|
|
3465
|
-
} : new
|
|
3473
|
+
} : new Ri(this.series);
|
|
3466
3474
|
}
|
|
3467
3475
|
/**
|
|
3468
3476
|
* Returns an array of the values in the multi-series as strings.
|
|
@@ -3472,7 +3480,7 @@ let Ai = class Nr {
|
|
|
3472
3480
|
toStrings() {
|
|
3473
3481
|
return this.series.flatMap((e) => e.toStrings());
|
|
3474
3482
|
}
|
|
3475
|
-
},
|
|
3483
|
+
}, Ri = class {
|
|
3476
3484
|
series;
|
|
3477
3485
|
seriesIndex;
|
|
3478
3486
|
internal;
|
|
@@ -3500,27 +3508,27 @@ let Ai = class Nr {
|
|
|
3500
3508
|
return this;
|
|
3501
3509
|
}
|
|
3502
3510
|
};
|
|
3503
|
-
const
|
|
3511
|
+
const Pt = (t) => {
|
|
3504
3512
|
const e = t >> 32n, r = t & 0xffffffffn;
|
|
3505
3513
|
return { domain: e, sample: r };
|
|
3506
3514
|
};
|
|
3507
3515
|
a.object({ key: a.string(), value: a.string() });
|
|
3508
|
-
const
|
|
3516
|
+
const Li = a.record(
|
|
3509
3517
|
a.union([a.number(), a.string(), a.symbol()]),
|
|
3510
3518
|
a.unknown()
|
|
3511
|
-
),
|
|
3519
|
+
), Bt = (t) => Object.entries(t), Di = (t, e) => Object.fromEntries(Bt(t).map(([r, n]) => [r, e(n, r)])), Pi = (t) => Object.fromEntries(Bt(t).filter(([e, r]) => r !== void 0)), Eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3512
3520
|
__proto__: null,
|
|
3513
|
-
entries:
|
|
3514
|
-
map:
|
|
3515
|
-
purgeUndefined:
|
|
3516
|
-
unknownZ:
|
|
3517
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3521
|
+
entries: Bt,
|
|
3522
|
+
map: Di,
|
|
3523
|
+
purgeUndefined: Pi,
|
|
3524
|
+
unknownZ: Li
|
|
3525
|
+
}, Symbol.toStringTag, { value: "Module" })), Mr = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", qi = Mr(), Er = ["macOS", "Windows", "Linux"], ki = ["macos", "windows", "linux"], zi = {
|
|
3518
3526
|
macos: "macOS",
|
|
3519
3527
|
windows: "Windows",
|
|
3520
3528
|
linux: "Linux"
|
|
3521
|
-
},
|
|
3522
|
-
a.enum(
|
|
3523
|
-
),
|
|
3529
|
+
}, Fi = a.enum(Er).or(
|
|
3530
|
+
a.enum(ki).transform((t) => zi[t])
|
|
3531
|
+
), Zi = () => {
|
|
3524
3532
|
if (typeof window > "u") return;
|
|
3525
3533
|
const t = window.navigator.userAgent.toLowerCase();
|
|
3526
3534
|
if (t.includes("mac")) return "macOS";
|
|
@@ -3528,17 +3536,17 @@ const ji = a.record(
|
|
|
3528
3536
|
if (t.includes("linux")) return "Linux";
|
|
3529
3537
|
};
|
|
3530
3538
|
let Ve;
|
|
3531
|
-
const
|
|
3539
|
+
const Yi = (t = {}) => {
|
|
3532
3540
|
const { force: e, default: r } = t;
|
|
3533
|
-
return e ?? Ve ?? (Ve =
|
|
3534
|
-
},
|
|
3541
|
+
return e ?? Ve ?? (Ve = Zi(), Ve ?? r);
|
|
3542
|
+
}, Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3535
3543
|
__proto__: null,
|
|
3536
|
-
OPERATING_SYSTEMS:
|
|
3537
|
-
RUNTIME:
|
|
3538
|
-
detect:
|
|
3539
|
-
getOS:
|
|
3540
|
-
osZ:
|
|
3541
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3544
|
+
OPERATING_SYSTEMS: Er,
|
|
3545
|
+
RUNTIME: qi,
|
|
3546
|
+
detect: Mr,
|
|
3547
|
+
getOS: Yi,
|
|
3548
|
+
osZ: Fi
|
|
3549
|
+
}, Symbol.toStringTag, { value: "Module" })), Vi = (...t) => t.map(Ar).join(""), Ar = (t) => (t.endsWith("/") || (t += "/"), t.startsWith("/") && (t = t.slice(1)), t), Wi = (t) => t.endsWith("/") ? t.slice(0, -1) : t;
|
|
3542
3550
|
class Ee {
|
|
3543
3551
|
protocol;
|
|
3544
3552
|
host;
|
|
@@ -3551,7 +3559,7 @@ class Ee {
|
|
|
3551
3559
|
* @param pathPrefix - A path prefix to use for all requests. Defaults to "".
|
|
3552
3560
|
*/
|
|
3553
3561
|
constructor({ host: e, port: r, protocol: n = "", pathPrefix: s = "" }) {
|
|
3554
|
-
this.protocol = n, this.host = e, this.port = r, this.path =
|
|
3562
|
+
this.protocol = n, this.host = e, this.port = r, this.path = Ar(s);
|
|
3555
3563
|
}
|
|
3556
3564
|
/**
|
|
3557
3565
|
* Replaces creates a new URL with the specified properties replaced.
|
|
@@ -3574,37 +3582,37 @@ class Ee {
|
|
|
3574
3582
|
child(e) {
|
|
3575
3583
|
return new Ee({
|
|
3576
3584
|
...this,
|
|
3577
|
-
pathPrefix:
|
|
3585
|
+
pathPrefix: Vi(this.path, e)
|
|
3578
3586
|
});
|
|
3579
3587
|
}
|
|
3580
3588
|
/** @returns a string representation of the url */
|
|
3581
3589
|
toString() {
|
|
3582
|
-
return
|
|
3590
|
+
return Wi(
|
|
3583
3591
|
`${this.protocol}://${this.host}:${this.port}/${this.path}`
|
|
3584
3592
|
);
|
|
3585
3593
|
}
|
|
3586
3594
|
static UNKNOWN = new Ee({ host: "unknown", port: 0 });
|
|
3587
3595
|
}
|
|
3588
|
-
const
|
|
3596
|
+
const Gi = 2, Hi = 3, Ji = 2, Xi = (t, e) => {
|
|
3589
3597
|
if (Number.isNaN(t) || !Number.isFinite(t)) return t;
|
|
3590
3598
|
const r = ye(e);
|
|
3591
3599
|
if (r == 0) return t;
|
|
3592
3600
|
let n;
|
|
3593
|
-
r >= 1e3 ? n =
|
|
3601
|
+
r >= 1e3 ? n = Gi : r >= 1 ? n = Hi : n = Math.ceil(-Math.log10(r)) + Ji;
|
|
3594
3602
|
const s = 10 ** n;
|
|
3595
3603
|
return Math.round(t * s) / s;
|
|
3596
|
-
},
|
|
3604
|
+
}, Bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3597
3605
|
__proto__: null,
|
|
3598
|
-
abs:
|
|
3599
|
-
add:
|
|
3600
|
-
closeTo:
|
|
3601
|
-
div:
|
|
3606
|
+
abs: er,
|
|
3607
|
+
add: Qt,
|
|
3608
|
+
closeTo: In,
|
|
3609
|
+
div: An,
|
|
3602
3610
|
equal: Ke,
|
|
3603
|
-
max:
|
|
3604
|
-
min:
|
|
3611
|
+
max: En,
|
|
3612
|
+
min: _t,
|
|
3605
3613
|
mult: Y,
|
|
3606
|
-
roundBySpan:
|
|
3607
|
-
roundToNearestMagnitude:
|
|
3614
|
+
roundBySpan: Xi,
|
|
3615
|
+
roundToNearestMagnitude: Mn,
|
|
3608
3616
|
sub: ae
|
|
3609
3617
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3610
3618
|
a.object({
|
|
@@ -3612,66 +3620,66 @@ a.object({
|
|
|
3612
3620
|
maxRetries: a.number().optional(),
|
|
3613
3621
|
scale: a.number().optional()
|
|
3614
3622
|
});
|
|
3615
|
-
const
|
|
3623
|
+
const Ki = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Br = a.string().regex(Ki), _ = a.number().min(0).max(255), Ur = a.number().min(0).max(1), qe = a.tuple([_, _, _, Ur]), Qi = a.tuple([_, _, _]), _i = a.object({ rgba255: qe }), ea = a.number().min(0).max(360), ta = a.number().min(0).max(100), ra = a.number().min(0).max(100), Cr = a.tuple([ea, ta, ra, Ur]), ke = a.union([Br, Qi, qe, Cr, _i]), ze = ke.transform((t) => w(t)), na = (t) => ze.safeParse(t).success, sa = (t) => qe.safeParse(t).success, ia = (t) => {
|
|
3616
3624
|
if (t == null) return;
|
|
3617
3625
|
const e = ze.safeParse(t);
|
|
3618
|
-
if (e.success) return
|
|
3626
|
+
if (e.success) return Rr(e.data);
|
|
3619
3627
|
if (typeof t == "string") return t;
|
|
3620
3628
|
throw e.error;
|
|
3621
3629
|
}, w = (t, e = 1) => {
|
|
3622
|
-
if (t = ke.parse(t), typeof t == "string") return
|
|
3630
|
+
if (t = ke.parse(t), typeof t == "string") return ya(t, e);
|
|
3623
3631
|
if (Array.isArray(t)) {
|
|
3624
3632
|
if (t.length < 3 || t.length > 4)
|
|
3625
3633
|
throw new Error(`Invalid color: [${t.join(", ")}]`);
|
|
3626
3634
|
return t.length === 3 ? [...t, e] : t;
|
|
3627
3635
|
}
|
|
3628
3636
|
return t.rgba255;
|
|
3629
|
-
},
|
|
3637
|
+
}, jr = (t, e) => {
|
|
3630
3638
|
if (t == null || e == null) return t == e;
|
|
3631
3639
|
const r = w(t), n = w(e);
|
|
3632
3640
|
return r.every((s, i) => s === n[i]);
|
|
3633
|
-
},
|
|
3641
|
+
}, aa = (t) => {
|
|
3634
3642
|
if (t == null) return;
|
|
3635
3643
|
const [e, r, n, s] = w(t);
|
|
3636
3644
|
return `#${Oe(e)}${Oe(r)}${Oe(n)}${s === 1 ? "" : Oe(s * 255)}`;
|
|
3637
|
-
},
|
|
3645
|
+
}, Rr = (t) => {
|
|
3638
3646
|
const [e, r, n, s] = w(t);
|
|
3639
3647
|
return `rgba(${e}, ${r}, ${n}, ${s})`;
|
|
3640
|
-
},
|
|
3648
|
+
}, oa = (t) => `rgb(${Lr(t)})`, Lr = (t) => {
|
|
3641
3649
|
const [e, r, n] = w(t);
|
|
3642
3650
|
return `${e}, ${r}, ${n}`;
|
|
3643
|
-
},
|
|
3651
|
+
}, ua = (t) => [...Ut(t), ce(t)], Ut = (t) => [
|
|
3644
3652
|
oe(t) / 255,
|
|
3645
3653
|
ue(t) / 255,
|
|
3646
3654
|
le(t) / 255
|
|
3647
|
-
], oe = (t) => w(t)[0], ue = (t) => w(t)[1], le = (t) => w(t)[2], ce = (t) => w(t)[3],
|
|
3655
|
+
], oe = (t) => w(t)[0], ue = (t) => w(t)[1], le = (t) => w(t)[2], ce = (t) => w(t)[3], la = (t) => jr(Ct, t), ca = (t) => wa(w(t)), ha = (t, e) => {
|
|
3648
3656
|
const [r, n, s] = w(t);
|
|
3649
3657
|
if (e > 100)
|
|
3650
3658
|
throw new Error(`Color opacity must be between 0 and 100, got ${e}`);
|
|
3651
3659
|
return e > 1 && (e /= 100), [r, n, s, e];
|
|
3652
3660
|
}, ge = (t) => {
|
|
3653
|
-
const [e, r, n] =
|
|
3661
|
+
const [e, r, n] = Ut(t).map(
|
|
3654
3662
|
(s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
|
|
3655
3663
|
);
|
|
3656
3664
|
return Number((0.2126 * e + 0.7152 * r + 0.0722 * n).toFixed(3));
|
|
3657
|
-
},
|
|
3658
|
-
const [e, r, n] =
|
|
3665
|
+
}, fa = (t) => {
|
|
3666
|
+
const [e, r, n] = Ut(t);
|
|
3659
3667
|
return 1 - (Math.max(e, r, n) - Math.min(e, r, n));
|
|
3660
|
-
},
|
|
3668
|
+
}, ot = (t, e) => {
|
|
3661
3669
|
const r = w(t), n = w(e), s = ge(r), i = ge(n);
|
|
3662
3670
|
return (Math.max(s, i) + 0.5) / (Math.min(s, i) + 0.5);
|
|
3663
|
-
},
|
|
3671
|
+
}, da = (t, ...e) => {
|
|
3664
3672
|
if (e.length === 0)
|
|
3665
3673
|
throw new Error("[Color.pickByContrast] - must provide at least one color");
|
|
3666
|
-
const r = w(t), [n] = e.sort((s, i) =>
|
|
3674
|
+
const r = w(t), [n] = e.sort((s, i) => ot(r, i) - ot(r, s));
|
|
3667
3675
|
return w(n);
|
|
3668
|
-
},
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
t.length === 8 ?
|
|
3673
|
-
]),
|
|
3674
|
-
t =
|
|
3676
|
+
}, ga = (t) => ge(t) < 0.5, pa = (t) => ge(t) > 0.5, ya = (t, e = 1) => (t = Br.parse(t), t = ma(t), [
|
|
3677
|
+
ve(t, 0),
|
|
3678
|
+
ve(t, 2),
|
|
3679
|
+
ve(t, 4),
|
|
3680
|
+
t.length === 8 ? ve(t, 6) / 255 : e
|
|
3681
|
+
]), Ct = [0, 0, 0, 0], Oe = (t) => Math.floor(t).toString(16).padStart(2, "0"), ve = (t, e) => parseInt(t.slice(e, e + 2), 16), ma = (t) => t.startsWith("#") ? t.slice(1) : t, ba = (t) => {
|
|
3682
|
+
t = Cr.parse(t);
|
|
3675
3683
|
let [e, r, n] = t;
|
|
3676
3684
|
const s = t[3];
|
|
3677
3685
|
e /= 360, r /= 100, n /= 100;
|
|
@@ -3683,7 +3691,7 @@ const Ji = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Ar = a.string().regex(Ji), _ = a.nu
|
|
|
3683
3691
|
i = We(f, l, e + 1 / 3), o = We(f, l, e), c = We(f, l, e - 1 / 3);
|
|
3684
3692
|
}
|
|
3685
3693
|
return [Math.round(i * 255), Math.round(o * 255), Math.round(c * 255), s];
|
|
3686
|
-
}, We = (t, e, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * 6 * r : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t),
|
|
3694
|
+
}, We = (t, e, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * 6 * r : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t), wa = (t) => {
|
|
3687
3695
|
t = qe.parse(t);
|
|
3688
3696
|
let [e, r, n] = t;
|
|
3689
3697
|
const s = t[3];
|
|
@@ -3697,13 +3705,13 @@ const Ji = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Ar = a.string().regex(Ji), _ = a.nu
|
|
|
3697
3705
|
l = f > 0.5 ? p / (2 - i - o) : p / (i + o), i === e ? c = (r - n) / p + (r < n ? 6 : 0) : i === r ? c = (n - e) / p + 2 : c = (e - r) / p + 4, c /= 6;
|
|
3698
3706
|
}
|
|
3699
3707
|
return c *= 360, l *= 100, f *= 100, [Math.round(c), Math.round(l), Math.round(f), s];
|
|
3700
|
-
},
|
|
3708
|
+
}, Oa = w("#000000"), va = w("#ffffff"), Dr = a.object({
|
|
3701
3709
|
key: a.string(),
|
|
3702
3710
|
color: ke,
|
|
3703
3711
|
position: a.number(),
|
|
3704
3712
|
switched: a.boolean().optional()
|
|
3705
|
-
}),
|
|
3706
|
-
if (t.length === 0) return
|
|
3713
|
+
}), Ta = a.array(Dr), xa = (t, e) => {
|
|
3714
|
+
if (t.length === 0) return Ct;
|
|
3707
3715
|
if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return w(t[0].color);
|
|
3708
3716
|
if (e >= t[t.length - 1].position)
|
|
3709
3717
|
return w(t[t.length - 1].color);
|
|
@@ -3722,125 +3730,125 @@ const Ji = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Ar = a.string().regex(Ji), _ = a.nu
|
|
|
3722
3730
|
return w([l, f, p, g]);
|
|
3723
3731
|
}
|
|
3724
3732
|
return w(t[t.length - 1].color);
|
|
3725
|
-
},
|
|
3733
|
+
}, $a = a.object({
|
|
3726
3734
|
key: a.string(),
|
|
3727
3735
|
name: a.string(),
|
|
3728
3736
|
color: ze
|
|
3729
|
-
}),
|
|
3737
|
+
}), Sa = a.object({
|
|
3730
3738
|
key: a.string(),
|
|
3731
3739
|
name: a.string(),
|
|
3732
|
-
swatches: a.array(
|
|
3733
|
-
}),
|
|
3740
|
+
swatches: a.array($a)
|
|
3741
|
+
}), Na = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3734
3742
|
__proto__: null,
|
|
3735
|
-
BLACK:
|
|
3736
|
-
WHITE:
|
|
3737
|
-
ZERO:
|
|
3743
|
+
BLACK: Oa,
|
|
3744
|
+
WHITE: va,
|
|
3745
|
+
ZERO: Ct,
|
|
3738
3746
|
aValue: ce,
|
|
3739
3747
|
bValue: le,
|
|
3740
3748
|
colorZ: ze,
|
|
3741
3749
|
construct: w,
|
|
3742
|
-
contrast:
|
|
3750
|
+
contrast: ot,
|
|
3743
3751
|
crudeZ: ke,
|
|
3744
|
-
cssString:
|
|
3745
|
-
equals:
|
|
3746
|
-
fromGradient:
|
|
3747
|
-
fromHSLA:
|
|
3752
|
+
cssString: ia,
|
|
3753
|
+
equals: jr,
|
|
3754
|
+
fromGradient: xa,
|
|
3755
|
+
fromHSLA: ba,
|
|
3748
3756
|
gValue: ue,
|
|
3749
|
-
gradientZ:
|
|
3750
|
-
grayness:
|
|
3751
|
-
hex:
|
|
3752
|
-
hsla:
|
|
3753
|
-
isColor:
|
|
3754
|
-
isCrude:
|
|
3755
|
-
isDark:
|
|
3756
|
-
isLight:
|
|
3757
|
-
isZero:
|
|
3757
|
+
gradientZ: Ta,
|
|
3758
|
+
grayness: fa,
|
|
3759
|
+
hex: aa,
|
|
3760
|
+
hsla: ca,
|
|
3761
|
+
isColor: sa,
|
|
3762
|
+
isCrude: na,
|
|
3763
|
+
isDark: ga,
|
|
3764
|
+
isLight: pa,
|
|
3765
|
+
isZero: la,
|
|
3758
3766
|
luminance: ge,
|
|
3759
|
-
paletteZ:
|
|
3760
|
-
pickByContrast:
|
|
3767
|
+
paletteZ: Sa,
|
|
3768
|
+
pickByContrast: da,
|
|
3761
3769
|
rValue: oe,
|
|
3762
|
-
rgbCSS:
|
|
3763
|
-
rgbString:
|
|
3764
|
-
rgba1:
|
|
3765
|
-
rgbaCSS:
|
|
3766
|
-
setAlpha:
|
|
3767
|
-
stopZ:
|
|
3768
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3769
|
-
lower:
|
|
3770
|
-
upper:
|
|
3771
|
-
},
|
|
3770
|
+
rgbCSS: oa,
|
|
3771
|
+
rgbString: Lr,
|
|
3772
|
+
rgba1: ua,
|
|
3773
|
+
rgbaCSS: Rr,
|
|
3774
|
+
setAlpha: ha,
|
|
3775
|
+
stopZ: Dr
|
|
3776
|
+
}, Symbol.toStringTag, { value: "Module" })), Pr = a.int().min(0).max(255), qr = 255, kr = 0, Ia = {
|
|
3777
|
+
lower: kr,
|
|
3778
|
+
upper: qr + 1
|
|
3779
|
+
}, zr = a.object({
|
|
3772
3780
|
name: a.string(),
|
|
3773
3781
|
key: a.string()
|
|
3774
3782
|
}), pe = (t) => a.object({
|
|
3775
|
-
subject:
|
|
3783
|
+
subject: zr,
|
|
3776
3784
|
resource: t,
|
|
3777
|
-
authority:
|
|
3778
|
-
}),
|
|
3785
|
+
authority: Pr
|
|
3786
|
+
}), Ma = (...t) => (e) => e.filter((r) => {
|
|
3779
3787
|
let n = !1;
|
|
3780
3788
|
return r.to != null && (n = t.includes(r.to.resource)), r.from != null && !n && (n = t.includes(r.from.resource)), n;
|
|
3781
|
-
}),
|
|
3789
|
+
}), Fr = (t) => a.object({
|
|
3782
3790
|
from: pe(t),
|
|
3783
3791
|
to: a.null()
|
|
3784
|
-
}),
|
|
3792
|
+
}), Zr = (t) => a.object({
|
|
3785
3793
|
from: a.null(),
|
|
3786
3794
|
to: pe(t)
|
|
3787
|
-
}),
|
|
3788
|
-
zr(t),
|
|
3795
|
+
}), Ea = (t) => a.union([
|
|
3789
3796
|
Fr(t),
|
|
3797
|
+
Zr(t),
|
|
3790
3798
|
a.object({
|
|
3791
3799
|
from: pe(t),
|
|
3792
3800
|
to: pe(t)
|
|
3793
3801
|
})
|
|
3794
|
-
]),
|
|
3802
|
+
]), Uo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3795
3803
|
__proto__: null,
|
|
3796
|
-
ABSOLUTE_AUTHORITY:
|
|
3797
|
-
AUTHORITY_BOUNDS:
|
|
3798
|
-
ZERO_AUTHORITY:
|
|
3799
|
-
acquireZ:
|
|
3800
|
-
authorityZ:
|
|
3801
|
-
filterTransfersByChannelKey:
|
|
3802
|
-
releaseZ:
|
|
3804
|
+
ABSOLUTE_AUTHORITY: qr,
|
|
3805
|
+
AUTHORITY_BOUNDS: Ia,
|
|
3806
|
+
ZERO_AUTHORITY: kr,
|
|
3807
|
+
acquireZ: Zr,
|
|
3808
|
+
authorityZ: Pr,
|
|
3809
|
+
filterTransfersByChannelKey: Ma,
|
|
3810
|
+
releaseZ: Fr,
|
|
3803
3811
|
stateZ: pe,
|
|
3804
|
-
subjectZ:
|
|
3805
|
-
transferZ:
|
|
3806
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3812
|
+
subjectZ: zr,
|
|
3813
|
+
transferZ: Ea
|
|
3814
|
+
}, Symbol.toStringTag, { value: "Module" })), Aa = (t) => Object.getOwnPropertySymbols(globalThis).includes(t), Ba = (t, e) => {
|
|
3807
3815
|
const r = Symbol.for(t);
|
|
3808
|
-
if (!
|
|
3816
|
+
if (!Aa(r)) {
|
|
3809
3817
|
const n = e();
|
|
3810
3818
|
Object.defineProperty(globalThis, r, { value: n });
|
|
3811
3819
|
}
|
|
3812
3820
|
return () => globalThis[r];
|
|
3813
|
-
},
|
|
3814
|
-
static discriminator =
|
|
3821
|
+
}, Yr = "sy_x_error", Ua = (t) => (e) => e != null && typeof e == "object" && "type" in e && typeof e.type == "string" ? e.type.startsWith(t) : e instanceof Error ? e.message.startsWith(t) : typeof e != "string" ? !1 : e.startsWith(t), Vr = (t) => class ie extends Error {
|
|
3822
|
+
static discriminator = Yr;
|
|
3815
3823
|
discriminator = ie.discriminator;
|
|
3816
3824
|
static TYPE = t;
|
|
3817
3825
|
type = ie.TYPE;
|
|
3818
|
-
static matches =
|
|
3826
|
+
static matches = Ua(t);
|
|
3819
3827
|
matches = ie.matches;
|
|
3820
3828
|
constructor(r, n) {
|
|
3821
3829
|
super(r, n), this.name = ie.TYPE;
|
|
3822
3830
|
}
|
|
3823
3831
|
static sub(r) {
|
|
3824
|
-
return
|
|
3832
|
+
return Vr(`${t}.${r}`);
|
|
3825
3833
|
}
|
|
3826
|
-
},
|
|
3834
|
+
}, Ca = (t) => {
|
|
3827
3835
|
if (t == null || typeof t != "object") return !1;
|
|
3828
3836
|
const e = t;
|
|
3829
|
-
if (e.discriminator !==
|
|
3837
|
+
if (e.discriminator !== Yr) return !1;
|
|
3830
3838
|
if (!("type" in e))
|
|
3831
3839
|
throw new Error(
|
|
3832
3840
|
`X Error is missing its type property: ${JSON.stringify(e)}`
|
|
3833
3841
|
);
|
|
3834
3842
|
return !0;
|
|
3835
|
-
}, re = "unknown",
|
|
3836
|
-
class
|
|
3843
|
+
}, re = "unknown", qt = "nil";
|
|
3844
|
+
class ja {
|
|
3837
3845
|
providers = [];
|
|
3838
3846
|
register(e) {
|
|
3839
3847
|
this.providers.push(e);
|
|
3840
3848
|
}
|
|
3841
3849
|
encode(e) {
|
|
3842
|
-
if (e == null) return { type:
|
|
3843
|
-
if (
|
|
3850
|
+
if (e == null) return { type: qt, data: "" };
|
|
3851
|
+
if (Ca(e))
|
|
3844
3852
|
for (const r of this.providers) {
|
|
3845
3853
|
const n = r.encode(e);
|
|
3846
3854
|
if (n != null) return n;
|
|
@@ -3854,65 +3862,65 @@ class Ua {
|
|
|
3854
3862
|
}
|
|
3855
3863
|
}
|
|
3856
3864
|
decode(e) {
|
|
3857
|
-
if (e == null || e.type ===
|
|
3858
|
-
if (e.type === re) return new
|
|
3865
|
+
if (e == null || e.type === qt) return null;
|
|
3866
|
+
if (e.type === re) return new kt(e.data);
|
|
3859
3867
|
for (const r of this.providers) {
|
|
3860
3868
|
const n = r.decode(e);
|
|
3861
3869
|
if (n != null) return n;
|
|
3862
3870
|
}
|
|
3863
|
-
return new
|
|
3871
|
+
return new kt(e.data);
|
|
3864
3872
|
}
|
|
3865
3873
|
}
|
|
3866
|
-
|
|
3867
|
-
class
|
|
3874
|
+
Ba("synnax-error-registry", () => new ja());
|
|
3875
|
+
class kt extends Vr("unknown") {
|
|
3868
3876
|
}
|
|
3869
3877
|
a.object({ type: a.string(), data: a.string() });
|
|
3870
|
-
const
|
|
3871
|
-
jsonrpc:
|
|
3872
|
-
method:
|
|
3878
|
+
const Co = () => new Promise((t) => setTimeout(t, 0)), jo = (t) => t ? -1 : 1, Ra = x.object({
|
|
3879
|
+
jsonrpc: x.literal("2.0"),
|
|
3880
|
+
method: x.string(),
|
|
3873
3881
|
// params should be z.union([z.record(z.string(), z.json()),
|
|
3874
3882
|
// z.array(z.json())]).optional() but the VSCode JSON RPC implementation uses a looser
|
|
3875
3883
|
// definition of params then in the JSON-RPC spec.
|
|
3876
|
-
params:
|
|
3877
|
-
id:
|
|
3878
|
-
}),
|
|
3879
|
-
jsonrpc:
|
|
3880
|
-
id:
|
|
3881
|
-
}),
|
|
3882
|
-
result:
|
|
3883
|
-
}),
|
|
3884
|
-
error:
|
|
3885
|
-
code:
|
|
3884
|
+
params: x.any().optional(),
|
|
3885
|
+
id: x.union([x.string(), x.number(), x.null()]).optional()
|
|
3886
|
+
}), Wr = x.object({
|
|
3887
|
+
jsonrpc: x.literal("2.0"),
|
|
3888
|
+
id: x.union([x.string(), x.number(), x.null()])
|
|
3889
|
+
}), La = Wr.extend({
|
|
3890
|
+
result: x.json()
|
|
3891
|
+
}), Da = Wr.extend({
|
|
3892
|
+
error: x.object({
|
|
3893
|
+
code: x.number().int(),
|
|
3886
3894
|
// This should be z.string(), but the VSCode JSON RPC implementation uses a looser
|
|
3887
3895
|
// definition of error than the JSON-RPC spec.
|
|
3888
|
-
message:
|
|
3889
|
-
data:
|
|
3896
|
+
message: x.string().optional(),
|
|
3897
|
+
data: x.json().optional()
|
|
3890
3898
|
})
|
|
3891
|
-
}),
|
|
3892
|
-
|
|
3893
|
-
const
|
|
3899
|
+
}), Pa = x.union([La, Da]);
|
|
3900
|
+
x.union([Ra, Pa]);
|
|
3901
|
+
const qa = (t, e, r) => {
|
|
3894
3902
|
const n = t.get(e);
|
|
3895
3903
|
return n === void 0 ? (t.set(e, r), r) : n;
|
|
3896
|
-
},
|
|
3904
|
+
}, Ro = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3897
3905
|
__proto__: null,
|
|
3898
|
-
getOrSetDefault:
|
|
3899
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3906
|
+
getOrSetDefault: qa
|
|
3907
|
+
}, Symbol.toStringTag, { value: "Module" })), ut = a.string().regex(/^\d+\.\d+\.\d+$/), be = (t, e, r = {}) => {
|
|
3900
3908
|
r.checkMajor ??= !0, r.checkMinor ??= !0, r.checkPatch ??= !0;
|
|
3901
|
-
const n =
|
|
3909
|
+
const n = ut.parse(t), s = ut.parse(e), [i, o, c] = n.split(".").map(Number), [l, f, p] = s.split(".").map(Number);
|
|
3902
3910
|
if (r.checkMajor) {
|
|
3903
|
-
if (i < l) return
|
|
3904
|
-
if (i > l) return
|
|
3911
|
+
if (i < l) return xe;
|
|
3912
|
+
if (i > l) return $e;
|
|
3905
3913
|
}
|
|
3906
3914
|
if (r.checkMinor) {
|
|
3907
|
-
if (o < f) return
|
|
3908
|
-
if (o > f) return
|
|
3915
|
+
if (o < f) return xe;
|
|
3916
|
+
if (o > f) return $e;
|
|
3909
3917
|
}
|
|
3910
3918
|
if (r.checkPatch) {
|
|
3911
|
-
if (c < p) return
|
|
3912
|
-
if (c > p) return
|
|
3919
|
+
if (c < p) return xe;
|
|
3920
|
+
if (c > p) return $e;
|
|
3913
3921
|
}
|
|
3914
3922
|
return ee;
|
|
3915
|
-
},
|
|
3923
|
+
}, ka = (t, e, r = {}) => Ht(be(t, e, r)), Gr = (t, e, r = {}) => Gt(be(t, e, r)), za = (t, e, r = {}) => Wt(be(t, e, r)), Fa = ({
|
|
3916
3924
|
name: t,
|
|
3917
3925
|
migrate: e
|
|
3918
3926
|
}) => (r) => {
|
|
@@ -3922,7 +3930,7 @@ const Da = (t, e, r) => {
|
|
|
3922
3930
|
} catch (n) {
|
|
3923
3931
|
throw console.log(`${t} failed to migrate from ${r.version}`), console.error(n), n;
|
|
3924
3932
|
}
|
|
3925
|
-
},
|
|
3933
|
+
}, Za = ({
|
|
3926
3934
|
name: t,
|
|
3927
3935
|
migrations: e,
|
|
3928
3936
|
targetSchema: r,
|
|
@@ -3948,7 +3956,7 @@ const Da = (t, e, r) => {
|
|
|
3948
3956
|
let c = !1;
|
|
3949
3957
|
const l = (f) => {
|
|
3950
3958
|
try {
|
|
3951
|
-
if (o === 0 ||
|
|
3959
|
+
if (o === 0 || Gr(f.version, i))
|
|
3952
3960
|
return console.log(c ? `${t} ${f.version} now up to date` : `${t} version ${f.version} is up to date with target version ${s.version}`), f;
|
|
3953
3961
|
const p = f.version, g = e[p], S = g(f);
|
|
3954
3962
|
return c = !0, l(S);
|
|
@@ -3974,16 +3982,16 @@ const Da = (t, e, r) => {
|
|
|
3974
3982
|
return console.log(`${t} failed to parse final result. Exiting with default`), console.error(p), s;
|
|
3975
3983
|
}
|
|
3976
3984
|
};
|
|
3977
|
-
},
|
|
3985
|
+
}, Lo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3978
3986
|
__proto__: null,
|
|
3979
3987
|
compareSemVer: be,
|
|
3980
|
-
createMigration:
|
|
3981
|
-
migrator:
|
|
3982
|
-
semVerNewer:
|
|
3983
|
-
semVerOlder:
|
|
3984
|
-
semVerZ:
|
|
3985
|
-
versionsEqual:
|
|
3986
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3988
|
+
createMigration: Fa,
|
|
3989
|
+
migrator: Za,
|
|
3990
|
+
semVerNewer: Gr,
|
|
3991
|
+
semVerOlder: za,
|
|
3992
|
+
semVerZ: ut,
|
|
3993
|
+
versionsEqual: ka
|
|
3994
|
+
}, Symbol.toStringTag, { value: "Module" })), Hr = ["standard", "scientific", "engineering"], Ya = a.enum(Hr), Va = (t, e, r) => {
|
|
3987
3995
|
if (Number.isNaN(t)) return "NaN";
|
|
3988
3996
|
if (t === 1 / 0) return "∞";
|
|
3989
3997
|
if (t === -1 / 0) return "-∞";
|
|
@@ -3992,28 +4000,28 @@ const Da = (t, e, r) => {
|
|
|
3992
4000
|
return e === 0 ? "0ᴇ0" : `0.${"0".repeat(e)}ᴇ0`;
|
|
3993
4001
|
let n;
|
|
3994
4002
|
return r === "scientific" ? n = Math.floor(Math.log10(Math.abs(t))) : n = Math.floor(Math.log10(Math.abs(t)) / 3) * 3, `${(t / 10 ** n).toFixed(e)}ᴇ${n}`;
|
|
3995
|
-
},
|
|
4003
|
+
}, Do = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3996
4004
|
__proto__: null,
|
|
3997
|
-
NOTATIONS:
|
|
3998
|
-
notationZ:
|
|
3999
|
-
stringifyNumber:
|
|
4000
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4005
|
+
NOTATIONS: Hr,
|
|
4006
|
+
notationZ: Ya,
|
|
4007
|
+
stringifyNumber: Va
|
|
4008
|
+
}, Symbol.toStringTag, { value: "Module" })), Po = (t) => Array.isArray(t) ? [...t] : typeof t == "object" && t !== null ? { ...t } : t, Jr = a.enum([
|
|
4001
4009
|
"success",
|
|
4002
4010
|
"info",
|
|
4003
4011
|
"warning",
|
|
4004
4012
|
"error",
|
|
4005
4013
|
"loading",
|
|
4006
4014
|
"disabled"
|
|
4007
|
-
]),
|
|
4015
|
+
]), Wa = (t) => a.object({
|
|
4008
4016
|
key: a.string(),
|
|
4009
|
-
variant:
|
|
4017
|
+
variant: Jr,
|
|
4010
4018
|
message: a.string(),
|
|
4011
4019
|
description: a.string().optional(),
|
|
4012
4020
|
time: b.z,
|
|
4013
4021
|
details: t ?? a.unknown().optional()
|
|
4014
|
-
}),
|
|
4022
|
+
}), Ga = (t, e) => {
|
|
4015
4023
|
if (!(t instanceof Error)) throw t;
|
|
4016
|
-
return
|
|
4024
|
+
return Xr({
|
|
4017
4025
|
variant: "error",
|
|
4018
4026
|
message: e ?? t.message,
|
|
4019
4027
|
description: e != null ? t.message : void 0,
|
|
@@ -4021,18 +4029,18 @@ const Da = (t, e, r) => {
|
|
|
4021
4029
|
stack: t.stack ?? ""
|
|
4022
4030
|
}
|
|
4023
4031
|
});
|
|
4024
|
-
},
|
|
4025
|
-
key:
|
|
4032
|
+
}, Xr = (t) => ({
|
|
4033
|
+
key: At(),
|
|
4026
4034
|
time: b.now(),
|
|
4027
4035
|
...t
|
|
4028
|
-
}),
|
|
4036
|
+
}), qo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4029
4037
|
__proto__: null,
|
|
4030
|
-
create:
|
|
4031
|
-
fromException:
|
|
4032
|
-
statusZ:
|
|
4033
|
-
variantZ:
|
|
4034
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4035
|
-
var
|
|
4038
|
+
create: Xr,
|
|
4039
|
+
fromException: Ga,
|
|
4040
|
+
statusZ: Wa,
|
|
4041
|
+
variantZ: Jr
|
|
4042
|
+
}, Symbol.toStringTag, { value: "Module" })), Ha = new Error("request for lock canceled");
|
|
4043
|
+
var Ja = function(t, e, r, n) {
|
|
4036
4044
|
function s(i) {
|
|
4037
4045
|
return i instanceof r ? i : new r(function(o) {
|
|
4038
4046
|
o(i);
|
|
@@ -4059,20 +4067,20 @@ var Ga = function(t, e, r, n) {
|
|
|
4059
4067
|
f((n = n.apply(t, e || [])).next());
|
|
4060
4068
|
});
|
|
4061
4069
|
};
|
|
4062
|
-
class
|
|
4063
|
-
constructor(e, r =
|
|
4070
|
+
class Xa {
|
|
4071
|
+
constructor(e, r = Ha) {
|
|
4064
4072
|
this._value = e, this._cancelError = r, this._queue = [], this._weightedWaiters = [];
|
|
4065
4073
|
}
|
|
4066
4074
|
acquire(e = 1, r = 0) {
|
|
4067
4075
|
if (e <= 0)
|
|
4068
4076
|
throw new Error(`invalid weight ${e}: must be positive`);
|
|
4069
4077
|
return new Promise((n, s) => {
|
|
4070
|
-
const i = { resolve: n, reject: s, weight: e, priority: r }, o =
|
|
4078
|
+
const i = { resolve: n, reject: s, weight: e, priority: r }, o = Kr(this._queue, (c) => r <= c.priority);
|
|
4071
4079
|
o === -1 && e <= this._value ? this._dispatchItem(i) : this._queue.splice(o + 1, 0, i);
|
|
4072
4080
|
});
|
|
4073
4081
|
}
|
|
4074
4082
|
runExclusive(e) {
|
|
4075
|
-
return
|
|
4083
|
+
return Ja(this, arguments, void 0, function* (r, n = 1, s = 0) {
|
|
4076
4084
|
const [i, o] = yield this.acquire(n, s);
|
|
4077
4085
|
try {
|
|
4078
4086
|
return yield r(i);
|
|
@@ -4085,7 +4093,7 @@ class Ha {
|
|
|
4085
4093
|
if (e <= 0)
|
|
4086
4094
|
throw new Error(`invalid weight ${e}: must be positive`);
|
|
4087
4095
|
return this._couldLockImmediately(e, r) ? Promise.resolve() : new Promise((n) => {
|
|
4088
|
-
this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []),
|
|
4096
|
+
this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), Ka(this._weightedWaiters[e - 1], { resolve: n, priority: r });
|
|
4089
4097
|
});
|
|
4090
4098
|
}
|
|
4091
4099
|
isLocked() {
|
|
@@ -4140,17 +4148,17 @@ class Ha {
|
|
|
4140
4148
|
return (this._queue.length === 0 || this._queue[0].priority < r) && e <= this._value;
|
|
4141
4149
|
}
|
|
4142
4150
|
}
|
|
4143
|
-
function
|
|
4144
|
-
const r =
|
|
4151
|
+
function Ka(t, e) {
|
|
4152
|
+
const r = Kr(t, (n) => e.priority <= n.priority);
|
|
4145
4153
|
t.splice(r + 1, 0, e);
|
|
4146
4154
|
}
|
|
4147
|
-
function
|
|
4155
|
+
function Kr(t, e) {
|
|
4148
4156
|
for (let r = t.length - 1; r >= 0; r--)
|
|
4149
4157
|
if (e(t[r]))
|
|
4150
4158
|
return r;
|
|
4151
4159
|
return -1;
|
|
4152
4160
|
}
|
|
4153
|
-
var
|
|
4161
|
+
var Qa = function(t, e, r, n) {
|
|
4154
4162
|
function s(i) {
|
|
4155
4163
|
return i instanceof r ? i : new r(function(o) {
|
|
4156
4164
|
o(i);
|
|
@@ -4177,12 +4185,12 @@ var Xa = function(t, e, r, n) {
|
|
|
4177
4185
|
f((n = n.apply(t, e || [])).next());
|
|
4178
4186
|
});
|
|
4179
4187
|
};
|
|
4180
|
-
class
|
|
4188
|
+
class _a {
|
|
4181
4189
|
constructor(e) {
|
|
4182
|
-
this._semaphore = new
|
|
4190
|
+
this._semaphore = new Xa(1, e);
|
|
4183
4191
|
}
|
|
4184
4192
|
acquire() {
|
|
4185
|
-
return
|
|
4193
|
+
return Qa(this, arguments, void 0, function* (e = 0) {
|
|
4186
4194
|
const [, r] = yield this._semaphore.acquire(1, e);
|
|
4187
4195
|
return r;
|
|
4188
4196
|
});
|
|
@@ -4203,34 +4211,34 @@ class Ka {
|
|
|
4203
4211
|
return this._semaphore.cancel();
|
|
4204
4212
|
}
|
|
4205
4213
|
}
|
|
4206
|
-
class
|
|
4214
|
+
class Qr extends _a {
|
|
4207
4215
|
constructor(e) {
|
|
4208
4216
|
super(), Object.assign(this, e);
|
|
4209
4217
|
}
|
|
4210
4218
|
}
|
|
4211
|
-
const
|
|
4219
|
+
const eo = (t) => new Qr(t), ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4212
4220
|
__proto__: null,
|
|
4213
|
-
mutex:
|
|
4214
|
-
newMutex:
|
|
4221
|
+
mutex: Qr,
|
|
4222
|
+
newMutex: eo
|
|
4215
4223
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4216
|
-
function
|
|
4224
|
+
function _r(t) {
|
|
4217
4225
|
var e, r, n = "";
|
|
4218
4226
|
if (typeof t == "string" || typeof t == "number") n += t;
|
|
4219
4227
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
4220
4228
|
var s = t.length;
|
|
4221
|
-
for (e = 0; e < s; e++) t[e] && (r =
|
|
4229
|
+
for (e = 0; e < s; e++) t[e] && (r = _r(t[e])) && (n && (n += " "), n += r);
|
|
4222
4230
|
} else for (r in t) t[r] && (n && (n += " "), n += r);
|
|
4223
4231
|
return n;
|
|
4224
4232
|
}
|
|
4225
|
-
function
|
|
4226
|
-
for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e =
|
|
4233
|
+
function to() {
|
|
4234
|
+
for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e = _r(t)) && (n && (n += " "), n += e);
|
|
4227
4235
|
return n;
|
|
4228
4236
|
}
|
|
4229
|
-
const
|
|
4230
|
-
const e = (...r) =>
|
|
4231
|
-
return e.B = (...r) => t + X + r.join(X), e.E = (r) => t +
|
|
4237
|
+
const ro = to, X = "-", zt = "__", Te = "--", en = (t) => {
|
|
4238
|
+
const e = (...r) => ro(...r);
|
|
4239
|
+
return e.B = (...r) => t + X + r.join(X), e.E = (r) => t + zt + r, e.M = (...r) => t + Te + r.join("-"), e.BM = (r, ...n) => e.B(r) + Te + n.join("-"), e.BE = (r, ...n) => e.B(r) + zt + n.join(X), e.BEM = (r, n, ...s) => e.BE(r, n) + Te + s.join(X), e.extend = (r) => en(e.B(r)), e.var = (...r) => Te + t + X + r.join(X), e;
|
|
4232
4240
|
};
|
|
4233
|
-
class
|
|
4241
|
+
class no {
|
|
4234
4242
|
rows = [];
|
|
4235
4243
|
columns = [];
|
|
4236
4244
|
prefix;
|
|
@@ -4259,71 +4267,71 @@ class to {
|
|
|
4259
4267
|
};
|
|
4260
4268
|
}
|
|
4261
4269
|
}
|
|
4262
|
-
const
|
|
4270
|
+
const so = (t, e) => Object.entries(e).forEach(
|
|
4263
4271
|
([r, n]) => n != null && t.style.setProperty(r, `${n}`)
|
|
4264
|
-
),
|
|
4272
|
+
), io = (t, e) => Array.from(t.style).forEach((r) => {
|
|
4265
4273
|
r.startsWith(e) && t.style.removeProperty(r);
|
|
4266
|
-
}),
|
|
4267
|
-
const e =
|
|
4268
|
-
return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location",
|
|
4274
|
+
}), ao = (t) => {
|
|
4275
|
+
const e = en(t);
|
|
4276
|
+
return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location", cs.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M("direction", Jn.construct(r)), e.sharp = (r) => r !== !1 && e.M("sharp"), e.rounded = (r) => r !== !1 && e.M("rounded"), e.bordered = (r) => typeof r == "boolean" ? r && e.M("bordered") : r != null ? e.M(`bordered-${r.toString()}`) : e.M("bordered"), e.selected = (r) => r && e.M("selected"), e.altColor = (r) => r && e.M("alt-color"), e.editable = (r) => r && e.M("editable"), e.noSelect = e.M("no-select"), e.applyVars = so, e.removeVars = io, e.newGridBuilder = (r) => new no(r), e.dropRegion = (r) => r && e.B("haul-drop-region"), e.px = (r) => `${r}px`, e.inheritDims = (r = !0) => r && e.M("inherit-dims"), e.shade = (r) => r != null && e.M(`shade-${r}`), e.colorVar = (r) => {
|
|
4269
4277
|
if (!(r == null || r === !1))
|
|
4270
|
-
return typeof r == "number" ? `var(--${t}-gray-l${r})` :
|
|
4278
|
+
return typeof r == "number" ? `var(--${t}-gray-l${r})` : Na.cssString(r);
|
|
4271
4279
|
}, e.levelSizeVar = (r) => `var(--${t}-${r}-size)`, e.level = (r) => e.M(`level-${r}`), e;
|
|
4272
|
-
},
|
|
4280
|
+
}, zo = ao("pluto");
|
|
4273
4281
|
export {
|
|
4274
|
-
|
|
4282
|
+
Oo as $,
|
|
4275
4283
|
Z as A,
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4284
|
+
is as B,
|
|
4285
|
+
zo as C,
|
|
4286
|
+
as as D,
|
|
4287
|
+
Lt as E,
|
|
4288
|
+
fo as F,
|
|
4289
|
+
St as G,
|
|
4290
|
+
mo as H,
|
|
4291
|
+
Sr as I,
|
|
4292
|
+
Ot as J,
|
|
4293
|
+
yo as K,
|
|
4294
|
+
O as L,
|
|
4287
4295
|
j as M,
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4296
|
+
Js as N,
|
|
4297
|
+
go as O,
|
|
4298
|
+
rs as P,
|
|
4291
4299
|
F as Q,
|
|
4292
|
-
|
|
4293
|
-
|
|
4300
|
+
oi as R,
|
|
4301
|
+
Ao as S,
|
|
4294
4302
|
me as T,
|
|
4295
4303
|
z as U,
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4304
|
+
So as V,
|
|
4305
|
+
po as W,
|
|
4306
|
+
Gs as X,
|
|
4307
|
+
vo as Y,
|
|
4308
|
+
Ws as Z,
|
|
4309
|
+
qo as _,
|
|
4310
|
+
wo as a,
|
|
4311
|
+
jo as a0,
|
|
4312
|
+
Po as b,
|
|
4313
|
+
co as c,
|
|
4314
|
+
bo as d,
|
|
4307
4315
|
b as e,
|
|
4308
4316
|
h as f,
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4317
|
+
Jn as g,
|
|
4318
|
+
m as h,
|
|
4319
|
+
Na as i,
|
|
4320
|
+
Bo as j,
|
|
4321
|
+
ko as k,
|
|
4322
|
+
Uo as l,
|
|
4323
|
+
Do as m,
|
|
4324
|
+
en as n,
|
|
4325
|
+
cs as o,
|
|
4326
|
+
to as p,
|
|
4327
|
+
Lo as q,
|
|
4328
|
+
T as r,
|
|
4329
|
+
Ro as s,
|
|
4330
|
+
Eo as t,
|
|
4331
|
+
Co as u,
|
|
4324
4332
|
N as v,
|
|
4325
4333
|
V as w,
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4334
|
+
ss as x,
|
|
4335
|
+
mt as y,
|
|
4336
|
+
uo as z
|
|
4329
4337
|
};
|