@synnaxlabs/x 0.50.0 → 0.52.4
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/.turbo/turbo-build.log +7 -7
- package/dist/eslint.config.d.ts +2 -2
- package/dist/eslint.config.d.ts.map +1 -1
- package/dist/src/color/color.d.ts +26 -2
- package/dist/src/color/color.d.ts.map +1 -1
- package/dist/src/color/gradient.d.ts +10 -0
- package/dist/src/color/gradient.d.ts.map +1 -1
- package/dist/src/color/palette.d.ts +22 -2
- package/dist/src/color/palette.d.ts.map +1 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/label/label.d.ts +15 -1
- package/dist/src/label/label.d.ts.map +1 -1
- package/dist/src/record/record.d.ts +10 -0
- package/dist/src/record/record.d.ts.map +1 -1
- package/dist/src/status/status.d.ts +5 -0
- package/dist/src/status/status.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +68 -13
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/x.cjs +10 -7
- package/dist/x.js +1234 -1171
- package/eslint.config.ts +2 -2
- package/package.json +8 -7
- package/src/color/color.spec.ts +26 -1
- package/src/color/color.ts +9 -3
- package/src/index.ts +0 -1
- package/src/label/label.ts +3 -1
- package/src/record/record.ts +15 -0
- package/src/status/status.spec.ts +167 -0
- package/src/status/status.ts +46 -0
- package/src/telem/telem.spec.ts +117 -1
- package/src/telem/telem.ts +116 -13
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +0 -1
- package/dist/src/jsonrpc/index.d.ts +0 -2
- package/dist/src/jsonrpc/index.d.ts.map +0 -1
- package/dist/src/jsonrpc/jsonrpc.d.ts +0 -70
- package/dist/src/jsonrpc/jsonrpc.d.ts.map +0 -1
- package/dist/src/jsonrpc/jsonrpc.spec.d.ts +0 -2
- package/dist/src/jsonrpc/jsonrpc.spec.d.ts.map +0 -1
- package/src/jsonrpc/index.ts +0 -10
- package/src/jsonrpc/jsonrpc.spec.ts +0 -135
- package/src/jsonrpc/jsonrpc.ts +0 -125
package/dist/x.js
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
import L, { z as c } from "zod";
|
|
2
|
+
const gn = (e) => L.union([
|
|
3
|
+
L.union([L.null(), L.undefined()]).transform(() => []),
|
|
4
4
|
e.array()
|
|
5
|
-
]),
|
|
5
|
+
]), Vr = (e) => Array.isArray(e) ? e : e == null ? [] : [e], yn = (e, t) => {
|
|
6
6
|
if (Array.isArray(t))
|
|
7
|
-
return t.reduce((s, i) =>
|
|
7
|
+
return t.reduce((s, i) => yn(s, i), e ?? []);
|
|
8
8
|
if (e == null) return [t];
|
|
9
9
|
const n = e.findIndex((s) => s == t), r = [...e];
|
|
10
10
|
return n === -1 ? r.push(t) : r[n] = t, r;
|
|
11
|
-
},
|
|
11
|
+
}, Wr = ((e, t) => {
|
|
12
12
|
if (e != null)
|
|
13
13
|
return Array.isArray(t) ? e.filter((n) => !t.includes(n)) : e.filter((n) => n != t);
|
|
14
|
-
}),
|
|
14
|
+
}), mn = (e, t) => {
|
|
15
15
|
if (Array.isArray(t))
|
|
16
|
-
return t.reduce((s, i) =>
|
|
16
|
+
return t.reduce((s, i) => mn(s, i), e ?? []);
|
|
17
17
|
if (e == null) return [t];
|
|
18
18
|
const n = e.findIndex((s) => s.key === t.key), r = [...e];
|
|
19
19
|
return n === -1 ? r.push(t) : r[n] = t, r;
|
|
20
|
-
},
|
|
20
|
+
}, Yr = ((e, t) => {
|
|
21
21
|
if (e != null)
|
|
22
22
|
return Array.isArray(t) ? e.filter((n) => !t.includes(n.key)) : e.filter((n) => n.key !== t);
|
|
23
|
-
}),
|
|
23
|
+
}), uu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
24
24
|
__proto__: null,
|
|
25
|
-
nullableZ:
|
|
26
|
-
remove:
|
|
27
|
-
removeKeyed:
|
|
28
|
-
toArray:
|
|
29
|
-
upsert:
|
|
30
|
-
upsertKeyed:
|
|
31
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
25
|
+
nullableZ: gn,
|
|
26
|
+
remove: Wr,
|
|
27
|
+
removeKeyed: Yr,
|
|
28
|
+
toArray: Vr,
|
|
29
|
+
upsert: yn,
|
|
30
|
+
upsertKeyed: mn
|
|
31
|
+
}, Symbol.toStringTag, { value: "Module" })), zr = (e) => {
|
|
32
32
|
const t = e.replace(/_[a-z]/g, (n) => n[1].toUpperCase());
|
|
33
33
|
return t.length > 1 && t[0] === t[0].toUpperCase() && t[1] === t[1].toUpperCase() || t.length === 0 ? t : t[0].toLowerCase() + t.slice(1);
|
|
34
|
-
},
|
|
34
|
+
}, zt = (e) => {
|
|
35
35
|
const t = (n, r = oe) => {
|
|
36
36
|
if (typeof n == "string") return e(n);
|
|
37
37
|
if (Array.isArray(n)) return n.map((o) => t(o, r));
|
|
38
38
|
if (!ee(n)) return n;
|
|
39
|
-
r =
|
|
39
|
+
r = Dr(r);
|
|
40
40
|
const s = {}, i = n;
|
|
41
41
|
return "toJSON" in i && typeof i.toJSON == "function" ? t(i.toJSON(), r) : (Object.keys(i).forEach((o) => {
|
|
42
42
|
let a = i[o];
|
|
43
43
|
const u = e(o);
|
|
44
|
-
r.recursive && (ee(a) ?
|
|
44
|
+
r.recursive && (ee(a) ? sn(a) || (a = t(a, r)) : r.recursiveInArray && rn(a) && (a = [...a].map((l) => {
|
|
45
45
|
let h = l;
|
|
46
|
-
return ee(l) ?
|
|
46
|
+
return ee(l) ? sn(h) || (h = t(l, r)) : rn(l) && (h = t({ key: l }, r).key), h;
|
|
47
47
|
}))), s[u] = a;
|
|
48
48
|
}), s);
|
|
49
49
|
};
|
|
50
50
|
return t;
|
|
51
|
-
}, Ae =
|
|
51
|
+
}, Ae = zt(zr), Gr = (e) => (
|
|
52
52
|
// Don't convert the first character and don't convert a character that is after a
|
|
53
53
|
// non-alphanumeric character
|
|
54
54
|
e.replace(
|
|
55
55
|
/([a-z0-9])([A-Z])/g,
|
|
56
56
|
(t, n, r) => `${n}_${r.toLowerCase()}`
|
|
57
57
|
)
|
|
58
|
-
),
|
|
58
|
+
), pn = zt(Gr), bn = (e) => e.length === 0 ? e : e[0].toUpperCase() + e.slice(1), Hr = [Number, String, Uint8Array], oe = {
|
|
59
59
|
recursive: !0,
|
|
60
60
|
recursiveInArray: !0
|
|
61
|
-
},
|
|
61
|
+
}, Dr = (e = oe) => (e.recursive == null ? e = oe : e.recursiveInArray ??= !1, e), rn = (e) => e != null && Array.isArray(e), ee = (e) => e != null && typeof e == "object" && !Array.isArray(e), sn = (e) => Hr.some((t) => e instanceof t), Jr = (e) => e.replace(/[\s_]+/g, "-").replace(
|
|
62
62
|
/([a-z0-9])([A-Z])/g,
|
|
63
63
|
(t, n, r) => `${n}-${r.toLowerCase()}`
|
|
64
|
-
).toLowerCase(),
|
|
64
|
+
).toLowerCase(), Xr = zt(Jr), Kr = (e) => {
|
|
65
65
|
if (e.length === 0) return e;
|
|
66
66
|
let t = e.replace(/[_-]/g, " ");
|
|
67
67
|
return t = t.replace(
|
|
@@ -71,18 +71,18 @@ const dn = (e) => b.union([
|
|
|
71
71
|
/([A-Z]+)([A-Z][a-z])/g,
|
|
72
72
|
(n, r, s) => `${r} ${s}`
|
|
73
73
|
), t = t.replace(/\s+/g, " ").trim(), t = t.replace(/\b\w/g, (n) => n.toUpperCase()), t;
|
|
74
|
-
},
|
|
74
|
+
}, Qr = zt(Kr), lu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
75
75
|
__proto__: null,
|
|
76
|
-
camelToSnake:
|
|
77
|
-
capitalize:
|
|
76
|
+
camelToSnake: pn,
|
|
77
|
+
capitalize: bn,
|
|
78
78
|
snakeToCamel: Ae,
|
|
79
|
-
toKebab:
|
|
80
|
-
toProperNoun:
|
|
81
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
79
|
+
toKebab: Xr,
|
|
80
|
+
toProperNoun: Qr
|
|
81
|
+
}, Symbol.toStringTag, { value: "Module" })), at = (e) => e != null && typeof e == "object" && !Array.isArray(e), fu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
82
82
|
__proto__: null,
|
|
83
|
-
isObject:
|
|
83
|
+
isObject: at
|
|
84
84
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
85
|
-
class
|
|
85
|
+
class wn {
|
|
86
86
|
contentType = "application/json";
|
|
87
87
|
decoder;
|
|
88
88
|
encoder;
|
|
@@ -100,11 +100,11 @@ class bn {
|
|
|
100
100
|
return n != null ? n.parse(s) : s;
|
|
101
101
|
}
|
|
102
102
|
encodeString(t) {
|
|
103
|
-
const n =
|
|
103
|
+
const n = pn(t);
|
|
104
104
|
return JSON.stringify(n, (r, s) => ArrayBuffer.isView(s) ? Array.from(s) : typeof s == "bigint" ? s.toString() : s);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
class
|
|
107
|
+
class On {
|
|
108
108
|
contentType = "text/csv";
|
|
109
109
|
encode(t) {
|
|
110
110
|
const n = this.encodeString(t);
|
|
@@ -115,7 +115,7 @@ class wn {
|
|
|
115
115
|
return this.decodeString(r, n);
|
|
116
116
|
}
|
|
117
117
|
encodeString(t) {
|
|
118
|
-
if (!Array.isArray(t) || t.length === 0 || !
|
|
118
|
+
if (!Array.isArray(t) || t.length === 0 || !at(t[0]))
|
|
119
119
|
throw new Error("Payload must be an array of objects");
|
|
120
120
|
const n = Object.keys(t[0]), r = [n.join(",")];
|
|
121
121
|
return t.forEach((s) => {
|
|
@@ -146,7 +146,7 @@ class wn {
|
|
|
146
146
|
return isNaN(n) ? t.startsWith('"') && t.endsWith('"') ? t.slice(1, -1) : t : n;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
class
|
|
149
|
+
class xn {
|
|
150
150
|
contentType = "text/plain";
|
|
151
151
|
encode(t) {
|
|
152
152
|
if (typeof t != "string")
|
|
@@ -158,17 +158,17 @@ class On {
|
|
|
158
158
|
return n != null ? n.parse(r) : r;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
const
|
|
161
|
+
const xt = new wn(), ts = new On(), es = new xn(), ns = [xt], hu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
162
162
|
__proto__: null,
|
|
163
|
-
CSVCodec:
|
|
164
|
-
CSV_CODEC:
|
|
165
|
-
ENCODERS:
|
|
166
|
-
JSONCodec:
|
|
167
|
-
JSON_CODEC:
|
|
168
|
-
TEXT_CODEC:
|
|
169
|
-
TextCodec:
|
|
170
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
171
|
-
class
|
|
163
|
+
CSVCodec: On,
|
|
164
|
+
CSV_CODEC: ts,
|
|
165
|
+
ENCODERS: ns,
|
|
166
|
+
JSONCodec: wn,
|
|
167
|
+
JSON_CODEC: xt,
|
|
168
|
+
TEXT_CODEC: es,
|
|
169
|
+
TextCodec: xn
|
|
170
|
+
}, Symbol.toStringTag, { value: "Module" })), C = (e) => e != null && typeof e == "object" && "value" in e;
|
|
171
|
+
class st {
|
|
172
172
|
/** The underlying primitive value */
|
|
173
173
|
value;
|
|
174
174
|
constructor(t) {
|
|
@@ -188,7 +188,7 @@ class rt {
|
|
|
188
188
|
return this.value.toString();
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
const Ee = (e) => e != null && typeof e == "object" && "toString" in e,
|
|
191
|
+
const Ee = (e) => e != null && typeof e == "object" && "toString" in e, In = (e) => {
|
|
192
192
|
if (Ee(e)) return e?.toString().length === 0;
|
|
193
193
|
switch (typeof e) {
|
|
194
194
|
case "string":
|
|
@@ -206,14 +206,14 @@ const Ee = (e) => e != null && typeof e == "object" && "toString" in e, xn = (e)
|
|
|
206
206
|
default:
|
|
207
207
|
return !1;
|
|
208
208
|
}
|
|
209
|
-
},
|
|
209
|
+
}, rs = (e) => !In(e), du = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
210
210
|
__proto__: null,
|
|
211
|
-
ValueExtension:
|
|
212
|
-
isCrudeValueExtension:
|
|
213
|
-
isNonZero:
|
|
211
|
+
ValueExtension: st,
|
|
212
|
+
isCrudeValueExtension: C,
|
|
213
|
+
isNonZero: rs,
|
|
214
214
|
isStringer: Ee,
|
|
215
|
-
isZero:
|
|
216
|
-
}, Symbol.toStringTag, { value: "Module" })), ce = (e) => [...new Set(e)],
|
|
215
|
+
isZero: In
|
|
216
|
+
}, Symbol.toStringTag, { value: "Module" })), ce = (e) => [...new Set(e)], ss = (e, t, n = !0) => {
|
|
217
217
|
const r = /* @__PURE__ */ new Map();
|
|
218
218
|
return e.forEach((s) => {
|
|
219
219
|
const i = t(s);
|
|
@@ -223,9 +223,9 @@ const Ee = (e) => e != null && typeof e == "object" && "toString" in e, xn = (e)
|
|
|
223
223
|
}
|
|
224
224
|
r.set(i, s);
|
|
225
225
|
}), Array.from(r.values());
|
|
226
|
-
},
|
|
226
|
+
}, gu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
227
227
|
__proto__: null,
|
|
228
|
-
by:
|
|
228
|
+
by: ss,
|
|
229
229
|
unique: ce
|
|
230
230
|
}, Symbol.toStringTag, { value: "Module" })), At = (e, t = !1) => {
|
|
231
231
|
const n = Ee(e) ? "stringer" : typeof e;
|
|
@@ -252,19 +252,19 @@ const Ee = (e) => e != null && typeof e == "object" && "toString" in e, xn = (e)
|
|
|
252
252
|
default:
|
|
253
253
|
return console.warn(`sortFunc: unknown type ${n}`), () => -1;
|
|
254
254
|
}
|
|
255
|
-
return t ?
|
|
256
|
-
},
|
|
255
|
+
return t ? vn(r) : r;
|
|
256
|
+
}, is = (e, t, n) => {
|
|
257
257
|
const r = At(t[e], n);
|
|
258
258
|
return (s, i) => r(s[e], i[e]);
|
|
259
|
-
},
|
|
259
|
+
}, os = (e, t) => e.length !== t.length ? e.length - t.length : e.every((n, r) => n === t[r]) ? 0 : -1, Nn = (e, t) => {
|
|
260
260
|
if (e.length !== t.length) return e.length - t.length;
|
|
261
261
|
if (e.length === 0) return 0;
|
|
262
262
|
const n = At(e[0]), r = [...e].sort(n), s = [...t].sort(n);
|
|
263
263
|
return r.every((i, o) => i === s[o]) ? 0 : -1;
|
|
264
|
-
},
|
|
264
|
+
}, cs = (e, t) => {
|
|
265
265
|
const n = ce(e), r = ce(t);
|
|
266
|
-
return
|
|
267
|
-
},
|
|
266
|
+
return Nn(n, r);
|
|
267
|
+
}, as = (e, t) => e === t ? 0 : e === "first" && t === "last" ? 1 : -1, vn = (e) => (t, n) => e(n, t), it = 0, Y = -1, z = 1, Mn = (e) => e < it, An = (e) => e > it, us = (e) => e >= it, En = (e) => e === it, ls = (e, t) => {
|
|
268
268
|
const n = /([a-zA-Z]+)|(\d+)/g, r = e.replace(/[\s_.-]+/g, "").match(n), s = t.replace(/[\s_.-]+/g, "").match(n);
|
|
269
269
|
if (!r || !s) return 0;
|
|
270
270
|
for (let i = 0; i < Math.min(r.length, s.length); i++) {
|
|
@@ -278,7 +278,7 @@ const Ee = (e) => e != null && typeof e == "object" && "toString" in e, xn = (e)
|
|
|
278
278
|
} else return isNaN(Number(o)) ? -1 : 1;
|
|
279
279
|
}
|
|
280
280
|
return r.length - s.length;
|
|
281
|
-
},
|
|
281
|
+
}, Sn = (e, t, n) => {
|
|
282
282
|
let r = 0, s = e.length;
|
|
283
283
|
const i = n ?? At(t);
|
|
284
284
|
for (; r < s; ) {
|
|
@@ -287,60 +287,60 @@ const Ee = (e) => e != null && typeof e == "object" && "toString" in e, xn = (e)
|
|
|
287
287
|
a < 0 ? r = o + 1 : s = o;
|
|
288
288
|
}
|
|
289
289
|
return r;
|
|
290
|
-
},
|
|
291
|
-
const r =
|
|
290
|
+
}, fs = (e, t, n) => {
|
|
291
|
+
const r = Sn(e, t, n);
|
|
292
292
|
e.splice(r, 0, t);
|
|
293
|
-
},
|
|
293
|
+
}, yu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
294
294
|
__proto__: null,
|
|
295
|
-
EQUAL:
|
|
296
|
-
GREATER_THAN:
|
|
297
|
-
LESS_THAN:
|
|
298
|
-
insert:
|
|
299
|
-
isEqualTo:
|
|
300
|
-
isGreaterThan:
|
|
301
|
-
isGreaterThanEqual:
|
|
302
|
-
isLessThan:
|
|
295
|
+
EQUAL: it,
|
|
296
|
+
GREATER_THAN: z,
|
|
297
|
+
LESS_THAN: Y,
|
|
298
|
+
insert: fs,
|
|
299
|
+
isEqualTo: En,
|
|
300
|
+
isGreaterThan: An,
|
|
301
|
+
isGreaterThanEqual: us,
|
|
302
|
+
isLessThan: Mn,
|
|
303
303
|
newF: At,
|
|
304
|
-
newFieldF:
|
|
305
|
-
order:
|
|
306
|
-
primitiveArrays:
|
|
307
|
-
reverseF:
|
|
308
|
-
search:
|
|
309
|
-
stringsWithNumbers:
|
|
310
|
-
uniqueUnorderedPrimitiveArrays:
|
|
311
|
-
unorderedPrimitiveArrays:
|
|
304
|
+
newFieldF: is,
|
|
305
|
+
order: as,
|
|
306
|
+
primitiveArrays: os,
|
|
307
|
+
reverseF: vn,
|
|
308
|
+
search: Sn,
|
|
309
|
+
stringsWithNumbers: ls,
|
|
310
|
+
uniqueUnorderedPrimitiveArrays: cs,
|
|
311
|
+
unorderedPrimitiveArrays: Nn
|
|
312
312
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
313
|
-
let
|
|
313
|
+
let Tn = (e, t = 21) => (n = t) => {
|
|
314
314
|
let r = "", s = n | 0;
|
|
315
315
|
for (; s--; )
|
|
316
316
|
r += e[Math.random() * e.length | 0];
|
|
317
317
|
return r;
|
|
318
318
|
};
|
|
319
|
-
const
|
|
319
|
+
const $n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", hs = `0123456789${$n}`, Un = 11, ds = Tn($n, 1), gs = Tn(hs, Un - 1), Se = () => `${ds()}${gs()}`, mu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
320
320
|
__proto__: null,
|
|
321
|
-
LENGTH:
|
|
321
|
+
LENGTH: Un,
|
|
322
322
|
create: Se
|
|
323
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
323
|
+
}, Symbol.toStringTag, { value: "Module" })), jn = (e, t) => (n) => n instanceof t || typeof n == "object" && n !== null && "discriminator" in n && n.discriminator === e, pu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
324
324
|
__proto__: null,
|
|
325
|
-
createMatcher:
|
|
326
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
325
|
+
createMatcher: jn
|
|
326
|
+
}, Symbol.toStringTag, { value: "Module" })), ys = 2 ** 8 - 1, Cn = 2 ** 12 - 1, ms = 2 ** 16 - 1, ps = 2 ** 32 - 1, bs = 2n ** 64n - 1n, ws = 2 ** 64 - 1, Os = -128, xs = 2 ** 7 - 1, Is = -32768, Ns = 2 ** 15 - 1, vs = -2147483648, Ms = 2 ** 31 - 1, As = -(2n ** 63n), qt = 2n ** 63n - 1n, Es = -9223372036854776e3, Bn = 2 ** 63 - 1, lt = (e) => (t, n) => {
|
|
327
327
|
if (typeof t == "bigint") {
|
|
328
|
-
if (
|
|
328
|
+
if (Ft(n))
|
|
329
329
|
return e(t, BigInt(n));
|
|
330
330
|
const r = e(Number(t), Number(n));
|
|
331
331
|
return typeof r == "number" ? BigInt(Math.round(r)) : r;
|
|
332
332
|
}
|
|
333
333
|
return e(Number(t), Number(n));
|
|
334
|
-
}, F = lt((e, t) => e - t), G = lt((e, t) => e + t),
|
|
334
|
+
}, F = lt((e, t) => e - t), G = lt((e, t) => e + t), Ss = (e, t, n = 1e-4) => Math.abs(e - t) < n, ae = (e, t) => {
|
|
335
335
|
const n = typeof e == "bigint", r = typeof t == "bigint";
|
|
336
|
-
return n && r ? e === t : n &&
|
|
337
|
-
},
|
|
336
|
+
return n && r ? e === t : n && Ft(t) ? e === BigInt(t) : r && Ft(e) ? t === BigInt(e) : e === t;
|
|
337
|
+
}, Ts = (e) => {
|
|
338
338
|
const t = 10 ** Math.floor(Math.log10(e));
|
|
339
339
|
return Math.round(e / t) * t;
|
|
340
|
-
},
|
|
340
|
+
}, Pn = lt((e, t) => e <= t ? e : t), Ft = (e) => typeof e == "bigint" ? !0 : Number.isInteger(e), $s = lt((e, t) => e >= t ? e : t), Rn = (e) => typeof e == "bigint" ? e < 0n ? -e : e : e < 0 ? -e : e, R = lt((e, t) => e * t), Et = lt((e, t) => e / t), Ln = c.tuple([c.number(), c.number()]), Te = c.object({ width: c.number(), height: c.number() }), Us = c.object({
|
|
341
341
|
signedWidth: c.number(),
|
|
342
342
|
signedHeight: c.number()
|
|
343
|
-
}),
|
|
343
|
+
}), kn = ["start", "center", "end"], ut = c.object({ x: c.number(), y: c.number() }), Zn = c.object({ clientX: c.number(), clientY: c.number() }), Gt = ["x", "y"], $e = c.enum(Gt), Ue = ["top", "right", "bottom", "left"], js = c.enum(Ue), Ht = ["left", "right"], je = c.enum(Ht), Dt = ["top", "bottom"], Ce = c.enum(Dt), Be = ["center"], ue = c.enum(Be), Cs = [...Ue, ...Be], Pe = c.enum(Cs), Bs = c.enum(kn), _n = ["first", "last"], Ps = c.enum(_n), Rs = c.object({ lower: c.number(), upper: c.number() }), Ls = c.enum([...$e.options, ...Pe.options]), ks = c.union([$e, Pe, c.instanceof(String)]), b = (e, t, n) => {
|
|
344
344
|
const r = {};
|
|
345
345
|
if (typeof t == "object" && (n = t, t = void 0), n = { makeValid: !0, ...n }, typeof e == "number" || typeof e == "bigint")
|
|
346
346
|
t != null ? (r.lower = e, r.upper = t) : (r.lower = typeof e == "bigint" ? 0n : 0, r.upper = e);
|
|
@@ -349,50 +349,50 @@ const Tn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", ys = `0123456
|
|
|
349
349
|
[r.lower, r.upper] = e;
|
|
350
350
|
} else
|
|
351
351
|
r.lower = e.lower, r.upper = e.upper;
|
|
352
|
-
return n?.makeValid ?
|
|
353
|
-
},
|
|
352
|
+
return n?.makeValid ? qn(r) : r;
|
|
353
|
+
}, Zs = Object.freeze({ lower: 0, upper: 0 }), _s = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), qs = Object.freeze({ lower: 0, upper: 1 }), Fs = Object.freeze({ lower: -1, upper: 1 }), Vs = (e, t) => {
|
|
354
354
|
if (e == null && t == null) return !0;
|
|
355
355
|
if (e == null || t == null) return !1;
|
|
356
|
-
const n =
|
|
356
|
+
const n = b(e), r = b(t);
|
|
357
357
|
return n?.lower === r?.lower && n?.upper === r?.upper;
|
|
358
|
-
},
|
|
359
|
-
const n =
|
|
358
|
+
}, qn = (e) => e.lower > e.upper ? { lower: e.upper, upper: e.lower } : e, le = (e, t) => {
|
|
359
|
+
const n = b(e);
|
|
360
360
|
return t < n.lower ? n.lower : t >= n.upper ? n.upper - (typeof n.upper == "number" ? 1 : 1n) : t;
|
|
361
361
|
}, k = (e, t) => {
|
|
362
|
-
const n =
|
|
362
|
+
const n = b(e);
|
|
363
363
|
if (typeof t == "number" || typeof t == "bigint")
|
|
364
364
|
return t >= n.lower && t < n.upper;
|
|
365
|
-
const r =
|
|
365
|
+
const r = b(t);
|
|
366
366
|
return r.lower >= n.lower && r.upper <= n.upper;
|
|
367
|
-
},
|
|
368
|
-
const n =
|
|
367
|
+
}, Ws = (e, t) => {
|
|
368
|
+
const n = b(e), r = b(t);
|
|
369
369
|
return n.lower === r.lower ? !0 : r.upper === n.lower || r.lower === n.upper ? !1 : k(n, r.upper) || k(n, r.lower) || k(r, n.upper) || k(r, n.lower);
|
|
370
370
|
}, ft = (e) => {
|
|
371
|
-
const t =
|
|
371
|
+
const t = b(e);
|
|
372
372
|
return t.upper - t.lower;
|
|
373
|
-
},
|
|
374
|
-
const t =
|
|
373
|
+
}, Ys = (e) => {
|
|
374
|
+
const t = b(e);
|
|
375
375
|
return typeof t.lower == "bigint" ? t.lower === 0n && t.upper === 0n : t.lower === 0 && t.upper === 0;
|
|
376
|
-
},
|
|
376
|
+
}, zs = (e) => {
|
|
377
377
|
const t = ft(e);
|
|
378
378
|
return typeof t == "number" ? t === 0 : t === 0n;
|
|
379
|
-
},
|
|
380
|
-
const t =
|
|
379
|
+
}, Gs = (e) => {
|
|
380
|
+
const t = b(e);
|
|
381
381
|
return typeof t.lower == "bigint" ? !0 : Number.isFinite(t.lower) && Number.isFinite(t.upper);
|
|
382
|
-
},
|
|
383
|
-
const t =
|
|
382
|
+
}, Hs = (e) => {
|
|
383
|
+
const t = b(e);
|
|
384
384
|
return (t.upper + t.lower) / 2;
|
|
385
|
-
},
|
|
386
|
-
lower: Math.min(...e.map((t) =>
|
|
387
|
-
upper: Math.max(...e.map((t) =>
|
|
388
|
-
}),
|
|
389
|
-
lower: Math.max(...e.map((t) =>
|
|
390
|
-
upper: Math.min(...e.map((t) =>
|
|
391
|
-
}),
|
|
392
|
-
const t =
|
|
385
|
+
}, Fn = (e) => ({
|
|
386
|
+
lower: Math.min(...e.map((t) => b(t).lower)),
|
|
387
|
+
upper: Math.max(...e.map((t) => b(t).upper))
|
|
388
|
+
}), Ds = (e) => ({
|
|
389
|
+
lower: Math.max(...e.map((t) => b(t).lower)),
|
|
390
|
+
upper: Math.min(...e.map((t) => b(t).upper))
|
|
391
|
+
}), Js = (e) => {
|
|
392
|
+
const t = b(e), n = typeof t.lower == "bigint";
|
|
393
393
|
return Array.from({ length: Number(ft(e)) }, (r, s) => n ? t.lower + BigInt(s) : t.lower + s);
|
|
394
394
|
}, fe = (e, t) => {
|
|
395
|
-
const n = e.map((i) =>
|
|
395
|
+
const n = e.map((i) => b(i)), r = n.findIndex((i) => k(i, t) || t < i.lower);
|
|
396
396
|
if (r === -1) return { index: e.length, position: 0 };
|
|
397
397
|
const s = n[r];
|
|
398
398
|
return k(s, t) ? { index: r, position: Number(t - s.lower) } : { index: r, position: 0 };
|
|
@@ -401,8 +401,8 @@ const Tn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", ys = `0123456
|
|
|
401
401
|
removeAfter: 0,
|
|
402
402
|
insertInto: 0,
|
|
403
403
|
deleteInBetween: 0
|
|
404
|
-
},
|
|
405
|
-
const n = e.map((l) =>
|
|
404
|
+
}, Xs = (e, t) => {
|
|
405
|
+
const n = e.map((l) => b(l)), r = b(t);
|
|
406
406
|
if (n.length === 0) return ne;
|
|
407
407
|
const s = fe(n, r.lower), i = fe(n, r.upper);
|
|
408
408
|
if (s.index === e.length) return { ...ne, insertInto: e.length };
|
|
@@ -421,8 +421,8 @@ const Tn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", ys = `0123456
|
|
|
421
421
|
insertInto: a,
|
|
422
422
|
deleteInBetween: o
|
|
423
423
|
};
|
|
424
|
-
},
|
|
425
|
-
const r = e.map((a) =>
|
|
424
|
+
}, Vn = (e, t, n) => {
|
|
425
|
+
const r = e.map((a) => b(a)), s = n > 0 ? 1 : n < 0 ? -1 : 0;
|
|
426
426
|
if (s === 0) return t;
|
|
427
427
|
let i = n, o = t;
|
|
428
428
|
for (; ae(i, 0) === !1; ) {
|
|
@@ -431,7 +431,7 @@ const Tn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", ys = `0123456
|
|
|
431
431
|
const u = r[a];
|
|
432
432
|
let l;
|
|
433
433
|
if (s > 0 ? l = F(u.upper, o) : l = F(o, u.lower), l > 0) {
|
|
434
|
-
const h =
|
|
434
|
+
const h = Pn(Rn(i), l);
|
|
435
435
|
if (o = G(o, s > 0 ? h : -h), i = F(i, s > 0 ? h : -h), ae(i, 0)) return o;
|
|
436
436
|
continue;
|
|
437
437
|
}
|
|
@@ -448,10 +448,10 @@ const Tn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", ys = `0123456
|
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
return o;
|
|
451
|
-
},
|
|
452
|
-
const r = e.map((o) =>
|
|
451
|
+
}, Wn = (e, t, n) => {
|
|
452
|
+
const r = e.map((o) => b(o));
|
|
453
453
|
if (t === n) return typeof t == "bigint" ? 0n : 0;
|
|
454
|
-
const s = t < n ?
|
|
454
|
+
const s = t < n ? b([t, n]) : b([n, t]);
|
|
455
455
|
let i = typeof t == "bigint" ? 0n : 0;
|
|
456
456
|
for (const o of r) {
|
|
457
457
|
const a = o.lower > s.lower ? o.lower : s.lower, u = o.upper < s.upper ? o.upper : s.upper;
|
|
@@ -461,40 +461,40 @@ const Tn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", ys = `0123456
|
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
463
|
return i;
|
|
464
|
-
},
|
|
464
|
+
}, bu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
465
465
|
__proto__: null,
|
|
466
|
-
CLIP:
|
|
467
|
-
DECIMAL:
|
|
468
|
-
INFINITE:
|
|
469
|
-
ZERO:
|
|
470
|
-
bounds:
|
|
471
|
-
buildInsertionPlan:
|
|
466
|
+
CLIP: Fs,
|
|
467
|
+
DECIMAL: qs,
|
|
468
|
+
INFINITE: _s,
|
|
469
|
+
ZERO: Zs,
|
|
470
|
+
bounds: Rs,
|
|
471
|
+
buildInsertionPlan: Xs,
|
|
472
472
|
clamp: le,
|
|
473
|
-
construct:
|
|
473
|
+
construct: b,
|
|
474
474
|
contains: k,
|
|
475
|
-
distance:
|
|
476
|
-
equals:
|
|
475
|
+
distance: Wn,
|
|
476
|
+
equals: Vs,
|
|
477
477
|
findInsertPosition: fe,
|
|
478
|
-
isFinite:
|
|
479
|
-
isZero:
|
|
480
|
-
linspace:
|
|
481
|
-
makeValid:
|
|
482
|
-
max:
|
|
483
|
-
mean:
|
|
484
|
-
min:
|
|
485
|
-
overlapsWith:
|
|
478
|
+
isFinite: Gs,
|
|
479
|
+
isZero: Ys,
|
|
480
|
+
linspace: Js,
|
|
481
|
+
makeValid: qn,
|
|
482
|
+
max: Fn,
|
|
483
|
+
mean: Hs,
|
|
484
|
+
min: Ds,
|
|
485
|
+
overlapsWith: Ws,
|
|
486
486
|
span: ft,
|
|
487
|
-
spanIsZero:
|
|
488
|
-
traverse:
|
|
489
|
-
}, Symbol.toStringTag, { value: "Module" })), he = 2, de = 3,
|
|
487
|
+
spanIsZero: zs,
|
|
488
|
+
traverse: Vn
|
|
489
|
+
}, Symbol.toStringTag, { value: "Module" })), he = 2, de = 3, Yn = 2, Ks = (e, t) => {
|
|
490
490
|
if (Number.isNaN(e) || !Number.isFinite(e)) return e;
|
|
491
491
|
const n = ft(t);
|
|
492
492
|
if (n == 0) return e;
|
|
493
493
|
let r;
|
|
494
|
-
n >= 1e3 ? r = he : n >= 1 ? r = de : r = Math.ceil(-Math.log10(n)) +
|
|
494
|
+
n >= 1e3 ? r = he : n >= 1 ? r = de : r = Math.ceil(-Math.log10(n)) + Yn;
|
|
495
495
|
const s = 10 ** r;
|
|
496
496
|
return Math.round(e * s) / s;
|
|
497
|
-
},
|
|
497
|
+
}, Qs = 5, ti = 1e-10, ei = (e, t) => {
|
|
498
498
|
if (Number.isNaN(e) || !Number.isFinite(e)) return e;
|
|
499
499
|
const n = Math.abs(e);
|
|
500
500
|
if (n === 0) return 0;
|
|
@@ -502,11 +502,11 @@ const Tn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", ys = `0123456
|
|
|
502
502
|
if (t != null) {
|
|
503
503
|
s = ft(t);
|
|
504
504
|
const u = s / n;
|
|
505
|
-
r = s > 0 && u >
|
|
505
|
+
r = s > 0 && u > ti;
|
|
506
506
|
}
|
|
507
507
|
if (r) {
|
|
508
508
|
let u;
|
|
509
|
-
s >= 1e3 ? u = he : s >= 1 ? u = de : u = Math.ceil(-Math.log10(s)) +
|
|
509
|
+
s >= 1e3 ? u = he : s >= 1 ? u = de : u = Math.ceil(-Math.log10(s)) + Yn;
|
|
510
510
|
const l = 10 ** u;
|
|
511
511
|
return Math.round(e * l) / l;
|
|
512
512
|
}
|
|
@@ -518,206 +518,206 @@ const Tn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", ys = `0123456
|
|
|
518
518
|
const u = 10 ** de;
|
|
519
519
|
return Math.round(e * u) / u;
|
|
520
520
|
}
|
|
521
|
-
const i = Math.floor(Math.log10(n)), a = 10 ** (
|
|
521
|
+
const i = Math.floor(Math.log10(n)), a = 10 ** (Qs - i - 1);
|
|
522
522
|
return Math.round(e * a) / a;
|
|
523
|
-
},
|
|
523
|
+
}, wu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
524
524
|
__proto__: null,
|
|
525
|
-
MAX_INT16:
|
|
526
|
-
MAX_INT32:
|
|
527
|
-
MAX_INT64:
|
|
528
|
-
MAX_INT64_NUMBER:
|
|
529
|
-
MAX_INT8:
|
|
530
|
-
MAX_UINT12:
|
|
531
|
-
MAX_UINT16:
|
|
532
|
-
MAX_UINT32:
|
|
533
|
-
MAX_UINT64:
|
|
534
|
-
MAX_UINT64_NUMBER:
|
|
535
|
-
MAX_UINT8:
|
|
536
|
-
MIN_INT16:
|
|
537
|
-
MIN_INT32:
|
|
538
|
-
MIN_INT64:
|
|
539
|
-
MIN_INT64_NUMBER:
|
|
540
|
-
MIN_INT8:
|
|
525
|
+
MAX_INT16: Ns,
|
|
526
|
+
MAX_INT32: Ms,
|
|
527
|
+
MAX_INT64: qt,
|
|
528
|
+
MAX_INT64_NUMBER: Bn,
|
|
529
|
+
MAX_INT8: xs,
|
|
530
|
+
MAX_UINT12: Cn,
|
|
531
|
+
MAX_UINT16: ms,
|
|
532
|
+
MAX_UINT32: ps,
|
|
533
|
+
MAX_UINT64: bs,
|
|
534
|
+
MAX_UINT64_NUMBER: ws,
|
|
535
|
+
MAX_UINT8: ys,
|
|
536
|
+
MIN_INT16: Is,
|
|
537
|
+
MIN_INT32: vs,
|
|
538
|
+
MIN_INT64: As,
|
|
539
|
+
MIN_INT64_NUMBER: Es,
|
|
540
|
+
MIN_INT8: Os,
|
|
541
541
|
abs: Rn,
|
|
542
542
|
add: G,
|
|
543
|
-
closeTo:
|
|
543
|
+
closeTo: Ss,
|
|
544
544
|
div: Et,
|
|
545
545
|
equal: ae,
|
|
546
|
-
isInteger:
|
|
547
|
-
max:
|
|
548
|
-
min:
|
|
549
|
-
mult:
|
|
550
|
-
roundBySpan:
|
|
551
|
-
roundToNearestMagnitude:
|
|
552
|
-
smartRound:
|
|
546
|
+
isInteger: Ft,
|
|
547
|
+
max: $s,
|
|
548
|
+
min: Pn,
|
|
549
|
+
mult: R,
|
|
550
|
+
roundBySpan: Ks,
|
|
551
|
+
roundToNearestMagnitude: Ts,
|
|
552
|
+
smartRound: ei,
|
|
553
553
|
sub: F
|
|
554
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
554
|
+
}, Symbol.toStringTag, { value: "Module" })), zn = Ls, _ = (e) => Gt.includes(e) ? e : Dt.includes(e) ? "y" : "x", ni = (e) => _(e) === "x" ? "y" : "x", ri = (e) => _(e) === "x" ? "width" : "height", si = (e) => _(e) === "x" ? "left" : "top", ii = (e) => zn.safeParse(e).success, oi = (e) => _(e) === "x" ? "signedWidth" : "signedHeight", ci = (e) => e === "center" ? !1 : _(e) === "x", ai = (e) => _(e) === "y", Ou = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
555
555
|
__proto__: null,
|
|
556
|
-
DIRECTIONS:
|
|
556
|
+
DIRECTIONS: Gt,
|
|
557
557
|
construct: _,
|
|
558
|
-
crude:
|
|
559
|
-
dimension:
|
|
558
|
+
crude: zn,
|
|
559
|
+
dimension: ri,
|
|
560
560
|
direction: $e,
|
|
561
|
-
isDirection:
|
|
562
|
-
isX:
|
|
563
|
-
isY:
|
|
564
|
-
location:
|
|
565
|
-
signedDimension:
|
|
566
|
-
swap:
|
|
567
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
561
|
+
isDirection: ii,
|
|
562
|
+
isX: ci,
|
|
563
|
+
isY: ai,
|
|
564
|
+
location: si,
|
|
565
|
+
signedDimension: oi,
|
|
566
|
+
swap: ni
|
|
567
|
+
}, Symbol.toStringTag, { value: "Module" })), ui = je, li = Ce, fi = ue, hi = {
|
|
568
568
|
top: "bottom",
|
|
569
569
|
right: "left",
|
|
570
570
|
bottom: "top",
|
|
571
571
|
left: "right",
|
|
572
572
|
center: "center"
|
|
573
|
-
},
|
|
573
|
+
}, di = {
|
|
574
574
|
top: { clockwise: "left", counterclockwise: "right" },
|
|
575
575
|
right: { clockwise: "top", counterclockwise: "bottom" },
|
|
576
576
|
bottom: { clockwise: "right", counterclockwise: "left" },
|
|
577
577
|
left: { clockwise: "bottom", counterclockwise: "top" }
|
|
578
|
-
},
|
|
579
|
-
const t =
|
|
578
|
+
}, gi = ks, nt = (e) => e instanceof String || !Gt.includes(e) ? e : e === "x" ? "left" : "top", yi = (e) => hi[nt(e)], mi = (e, t) => di[e][t], It = (e) => {
|
|
579
|
+
const t = nt(e);
|
|
580
580
|
return t === "top" || t === "bottom" ? "y" : "x";
|
|
581
|
-
},
|
|
581
|
+
}, pi = c.object({
|
|
582
582
|
x: je.or(ue),
|
|
583
583
|
y: Ce.or(ue)
|
|
584
|
-
}),
|
|
585
|
-
|
|
584
|
+
}), Re = c.object({ x: je, y: Ce }), ht = Object.freeze({ x: "left", y: "top" }), Le = Object.freeze({ x: "right", y: "top" }), Jt = Object.freeze({ x: "left", y: "bottom" }), ke = Object.freeze({ x: "right", y: "bottom" }), Ze = Object.freeze({ x: "center", y: "center" }), _e = Object.freeze({ x: "center", y: "top" }), qe = Object.freeze({ x: "center", y: "bottom" }), Fe = Object.freeze({ x: "right", y: "center" }), Ve = Object.freeze({ x: "left", y: "center" }), bi = Object.freeze([
|
|
585
|
+
Ve,
|
|
586
586
|
Fe,
|
|
587
587
|
_e,
|
|
588
588
|
qe,
|
|
589
589
|
ht,
|
|
590
590
|
Le,
|
|
591
|
-
|
|
591
|
+
Jt,
|
|
592
592
|
ke,
|
|
593
593
|
Ze
|
|
594
|
-
]),
|
|
594
|
+
]), We = (e, t) => e.x === t.x && e.y === t.y, wi = (e, t) => {
|
|
595
595
|
if (typeof t == "object") {
|
|
596
596
|
let n = !0;
|
|
597
597
|
return "x" in t && (e.x === t.x || (n = !1)), "y" in t && (e.y === t.y || (n = !1)), n;
|
|
598
598
|
}
|
|
599
599
|
return e.x === t || e.y === t;
|
|
600
|
-
},
|
|
600
|
+
}, Gn = (e) => [e.x, e.y], Rt = (e) => It(nt(e)) === "x", Oi = (e) => It(nt(e)) === "y", xi = (e) => `${e.x}${bn(e.y)}`, Ii = (e, t) => {
|
|
601
601
|
let n, r;
|
|
602
|
-
if (typeof e == "object" && "x" in e ? (n = e.x, r = e.y) : (n =
|
|
602
|
+
if (typeof e == "object" && "x" in e ? (n = e.x, r = e.y) : (n = nt(e), r = nt(t ?? e)), It(n) === It(r) && n !== "center" && r !== "center")
|
|
603
603
|
throw new Error(
|
|
604
604
|
`[XYLocation] - encountered two locations with the same direction: ${n.toString()} - ${r.toString()}`
|
|
605
605
|
);
|
|
606
606
|
const s = { ...Ze };
|
|
607
607
|
return n === "center" ? Rt(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r] : r === "center" ? Rt(n) ? [s.x, s.y] = [n, r] : [s.x, s.y] = [r, n] : Rt(n) ? [s.x, s.y] = [n, r] : [s.x, s.y] = [r, n], s;
|
|
608
|
-
},
|
|
608
|
+
}, xu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
609
609
|
__proto__: null,
|
|
610
610
|
BOTTOM_CENTER: qe,
|
|
611
|
-
BOTTOM_LEFT:
|
|
611
|
+
BOTTOM_LEFT: Jt,
|
|
612
612
|
BOTTOM_RIGHT: ke,
|
|
613
613
|
CENTER: Ze,
|
|
614
|
-
CENTER_LEFT:
|
|
614
|
+
CENTER_LEFT: Ve,
|
|
615
615
|
CENTER_LOCATIONS: Be,
|
|
616
616
|
CENTER_RIGHT: Fe,
|
|
617
617
|
OUTER_LOCATIONS: Ue,
|
|
618
618
|
TOP_CENTER: _e,
|
|
619
619
|
TOP_LEFT: ht,
|
|
620
620
|
TOP_RIGHT: Le,
|
|
621
|
-
XY_LOCATIONS:
|
|
622
|
-
X_LOCATIONS:
|
|
623
|
-
Y_LOCATIONS:
|
|
624
|
-
center:
|
|
625
|
-
construct:
|
|
626
|
-
constructXY:
|
|
627
|
-
corner:
|
|
628
|
-
crude:
|
|
621
|
+
XY_LOCATIONS: bi,
|
|
622
|
+
X_LOCATIONS: Ht,
|
|
623
|
+
Y_LOCATIONS: Dt,
|
|
624
|
+
center: fi,
|
|
625
|
+
construct: nt,
|
|
626
|
+
constructXY: Ii,
|
|
627
|
+
corner: Re,
|
|
628
|
+
crude: gi,
|
|
629
629
|
direction: It,
|
|
630
630
|
isX: Rt,
|
|
631
|
-
isY:
|
|
632
|
-
location:
|
|
633
|
-
outer:
|
|
634
|
-
rotate:
|
|
635
|
-
swap:
|
|
636
|
-
x:
|
|
637
|
-
xy:
|
|
638
|
-
xyCouple:
|
|
639
|
-
xyEquals:
|
|
640
|
-
xyMatches:
|
|
641
|
-
xyToString:
|
|
642
|
-
y:
|
|
631
|
+
isY: Oi,
|
|
632
|
+
location: Pe,
|
|
633
|
+
outer: js,
|
|
634
|
+
rotate: mi,
|
|
635
|
+
swap: yi,
|
|
636
|
+
x: ui,
|
|
637
|
+
xy: pi,
|
|
638
|
+
xyCouple: Gn,
|
|
639
|
+
xyEquals: We,
|
|
640
|
+
xyMatches: wi,
|
|
641
|
+
xyToString: xi,
|
|
642
|
+
y: li
|
|
643
643
|
}, Symbol.toStringTag, { value: "Module" })), ge = c.union([
|
|
644
644
|
c.number(),
|
|
645
645
|
ut,
|
|
646
|
-
|
|
646
|
+
Ln,
|
|
647
647
|
Te,
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
]),
|
|
648
|
+
Us,
|
|
649
|
+
Zn
|
|
650
|
+
]), x = (e, t) => {
|
|
651
651
|
if (typeof e == "string") {
|
|
652
652
|
if (t === void 0) throw new Error("The y coordinate must be given.");
|
|
653
653
|
return e === "x" ? { x: t, y: 0 } : { x: 0, y: t };
|
|
654
654
|
}
|
|
655
655
|
return typeof e == "number" ? { x: e, y: t ?? e } : Array.isArray(e) ? { x: e[0], y: e[1] } : "signedWidth" in e ? { x: e.signedWidth, y: e.signedHeight } : "clientX" in e ? { x: e.clientX, y: e.clientY } : "width" in e ? { x: e.width, y: e.height } : { x: e.x, y: e.y };
|
|
656
|
-
},
|
|
657
|
-
const r =
|
|
656
|
+
}, V = Object.freeze({ x: 0, y: 0 }), Hn = Object.freeze({ x: 1, y: 1 }), Ni = Object.freeze({ x: 1 / 0, y: 1 / 0 }), vi = Object.freeze({ x: NaN, y: NaN }), Vt = (e, t, n = 0) => {
|
|
657
|
+
const r = x(e), s = x(t);
|
|
658
658
|
return n === 0 ? r.x === s.x && r.y === s.y : Math.abs(r.x - s.x) <= n && Math.abs(r.y - s.y) <= n;
|
|
659
|
-
},
|
|
660
|
-
const r =
|
|
659
|
+
}, Mi = (e) => Vt(e, V), Ye = (e, t, n) => {
|
|
660
|
+
const r = x(e), s = x(t, n);
|
|
661
661
|
return { x: r.x * s.x, y: r.y * s.y };
|
|
662
|
-
}, Hn = (e, t) => {
|
|
663
|
-
const n = I(e);
|
|
664
|
-
return { x: n.x + t, y: n.y };
|
|
665
662
|
}, Dn = (e, t) => {
|
|
666
|
-
const n =
|
|
663
|
+
const n = x(e);
|
|
664
|
+
return { x: n.x + t, y: n.y };
|
|
665
|
+
}, Jn = (e, t) => {
|
|
666
|
+
const n = x(e);
|
|
667
667
|
return { x: n.x, y: n.y + t };
|
|
668
668
|
}, Nt = (e, t, n, ...r) => {
|
|
669
669
|
if (typeof t == "string") {
|
|
670
670
|
if (typeof n != "number") throw new Error("The value must be a number.");
|
|
671
|
-
return t === "x" ?
|
|
671
|
+
return t === "x" ? Dn(e, n) : Jn(e, n);
|
|
672
672
|
}
|
|
673
673
|
if (typeof t == "object" && "x" in t && typeof t.x == "string") {
|
|
674
|
-
const s =
|
|
674
|
+
const s = x(n), i = x(e);
|
|
675
675
|
return t.x === "left" ? s.x = -s.x : t.x === "center" && (s.x = 0), t.y === "top" ? s.y = -s.y : t.y === "center" && (s.y = 0), { x: i.x + s.x, y: i.y + s.y };
|
|
676
676
|
}
|
|
677
|
-
return [e, t, n ??
|
|
678
|
-
const o =
|
|
677
|
+
return [e, t, n ?? V, ...r].reduce((s, i) => {
|
|
678
|
+
const o = x(i);
|
|
679
679
|
return { x: s.x + o.x, y: s.y + o.y };
|
|
680
|
-
},
|
|
681
|
-
},
|
|
682
|
-
const r =
|
|
680
|
+
}, V);
|
|
681
|
+
}, Ai = (e, t, n) => {
|
|
682
|
+
const r = x(e);
|
|
683
683
|
return _(t) === "x" ? { x: n, y: r.y } : { x: r.x, y: n };
|
|
684
|
-
},
|
|
685
|
-
const n =
|
|
684
|
+
}, Ei = (e, t) => {
|
|
685
|
+
const n = x(e), r = x(t);
|
|
686
686
|
return Math.sqrt((n.x - r.x) ** 2 + (n.y - r.y) ** 2);
|
|
687
|
-
},
|
|
688
|
-
const n =
|
|
687
|
+
}, Si = (e, t) => {
|
|
688
|
+
const n = x(e), r = x(t);
|
|
689
689
|
return { x: r.x - n.x, y: r.y - n.y };
|
|
690
|
-
},
|
|
691
|
-
const t =
|
|
690
|
+
}, Ti = (e) => {
|
|
691
|
+
const t = x(e);
|
|
692
692
|
return Number.isNaN(t.x) || Number.isNaN(t.y);
|
|
693
|
-
},
|
|
694
|
-
const t =
|
|
693
|
+
}, $i = (e) => {
|
|
694
|
+
const t = x(e);
|
|
695
695
|
return Number.isFinite(t.x) && Number.isFinite(t.y);
|
|
696
|
-
},
|
|
697
|
-
const t =
|
|
696
|
+
}, Ui = (e) => {
|
|
697
|
+
const t = x(e);
|
|
698
698
|
return [t.x, t.y];
|
|
699
|
-
},
|
|
700
|
-
const t =
|
|
699
|
+
}, ji = (e) => {
|
|
700
|
+
const t = x(e);
|
|
701
701
|
return { left: t.x, top: t.y };
|
|
702
|
-
},
|
|
703
|
-
const n =
|
|
702
|
+
}, Wt = (e, t = 0) => {
|
|
703
|
+
const n = x(e);
|
|
704
704
|
return {
|
|
705
705
|
x: Number(n.x.toFixed(t)),
|
|
706
706
|
y: Number(n.y.toFixed(t))
|
|
707
707
|
};
|
|
708
708
|
}, gt = (e, t) => {
|
|
709
|
-
const n =
|
|
709
|
+
const n = x(e), r = x(t);
|
|
710
710
|
return { x: n.x - r.x, y: n.y - r.y };
|
|
711
711
|
}, yt = (e) => {
|
|
712
|
-
const t =
|
|
712
|
+
const t = x(e), n = Math.hypot(t.x, t.y);
|
|
713
713
|
return n === 0 ? { x: 0, y: 0 } : { x: -t.y / n, y: t.x / n };
|
|
714
|
-
},
|
|
715
|
-
const t =
|
|
714
|
+
}, Xn = (e) => {
|
|
715
|
+
const t = x(e), n = Math.hypot(t.x, t.y);
|
|
716
716
|
return n === 0 ? { x: 0, y: 0 } : { x: t.x / n, y: t.y / n };
|
|
717
|
-
},
|
|
718
|
-
const t = e.reduce((n, r) => Nt(n, r),
|
|
719
|
-
return
|
|
720
|
-
},
|
|
717
|
+
}, Kn = (...e) => {
|
|
718
|
+
const t = e.reduce((n, r) => Nt(n, r), V);
|
|
719
|
+
return Ye(t, 1 / e.length);
|
|
720
|
+
}, Ci = (e, t) => {
|
|
721
721
|
const n = [];
|
|
722
722
|
for (let r = 0; r < e.length; r++) {
|
|
723
723
|
const s = e[r];
|
|
@@ -731,84 +731,84 @@ const Tn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", ys = `0123456
|
|
|
731
731
|
} else {
|
|
732
732
|
const l = e[r - 1], h = e[r + 1], y = gt(s, l), m = gt(h, s);
|
|
733
733
|
i = yt(y), o = yt(m);
|
|
734
|
-
const
|
|
734
|
+
const M = Math.acos(
|
|
735
735
|
(y.x * m.x + y.y * m.y) / (Math.hypot(y.x, y.y) * Math.hypot(m.x, m.y))
|
|
736
|
-
),
|
|
737
|
-
|
|
736
|
+
), S = Math.sin(M / 2);
|
|
737
|
+
S === 0 ? u = t : u = t / S, a = Xn(Kn(i, o));
|
|
738
738
|
}
|
|
739
|
-
n.push(
|
|
739
|
+
n.push(Ye(a, u));
|
|
740
740
|
}
|
|
741
741
|
return n;
|
|
742
|
-
},
|
|
743
|
-
const t =
|
|
742
|
+
}, Bi = (e) => {
|
|
743
|
+
const t = x(e);
|
|
744
744
|
return { x: t.y, y: t.x };
|
|
745
745
|
}, ye = (e) => {
|
|
746
|
-
const t =
|
|
746
|
+
const t = x(e);
|
|
747
747
|
return { x: Math.round(t.x), y: Math.round(t.y) };
|
|
748
|
-
},
|
|
749
|
-
const t =
|
|
748
|
+
}, Pi = (e) => {
|
|
749
|
+
const t = x(e);
|
|
750
750
|
return { x: 1 / t.x, y: 1 / t.y };
|
|
751
|
-
},
|
|
752
|
-
const r =
|
|
751
|
+
}, Ri = (e, t, n) => {
|
|
752
|
+
const r = x(e), s = x(t), i = n === "clockwise" ? Math.PI / 2 : -Math.PI / 2, o = r.x - s.x, a = r.y - s.y, u = o * Math.cos(i) - a * Math.sin(i), l = o * Math.sin(i) + a * Math.cos(i);
|
|
753
753
|
return {
|
|
754
754
|
x: u + s.x,
|
|
755
755
|
y: l + s.y
|
|
756
756
|
};
|
|
757
|
-
},
|
|
757
|
+
}, Iu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
758
758
|
__proto__: null,
|
|
759
|
-
INFINITY:
|
|
760
|
-
NAN:
|
|
761
|
-
ONE:
|
|
762
|
-
ZERO:
|
|
763
|
-
average:
|
|
764
|
-
calculateMiters:
|
|
765
|
-
clientXY:
|
|
766
|
-
construct:
|
|
767
|
-
couple:
|
|
759
|
+
INFINITY: Ni,
|
|
760
|
+
NAN: vi,
|
|
761
|
+
ONE: Hn,
|
|
762
|
+
ZERO: V,
|
|
763
|
+
average: Kn,
|
|
764
|
+
calculateMiters: Ci,
|
|
765
|
+
clientXY: Zn,
|
|
766
|
+
construct: x,
|
|
767
|
+
couple: Ui,
|
|
768
768
|
crudeZ: ge,
|
|
769
|
-
css:
|
|
770
|
-
distance:
|
|
771
|
-
equals:
|
|
772
|
-
isFinite:
|
|
773
|
-
isNan:
|
|
774
|
-
isZero:
|
|
769
|
+
css: ji,
|
|
770
|
+
distance: Ei,
|
|
771
|
+
equals: Vt,
|
|
772
|
+
isFinite: $i,
|
|
773
|
+
isNan: Ti,
|
|
774
|
+
isZero: Mi,
|
|
775
775
|
normal: yt,
|
|
776
|
-
normalize:
|
|
777
|
-
reciprocal:
|
|
778
|
-
rotate:
|
|
776
|
+
normalize: Xn,
|
|
777
|
+
reciprocal: Pi,
|
|
778
|
+
rotate: Ri,
|
|
779
779
|
round: ye,
|
|
780
|
-
scale:
|
|
781
|
-
set:
|
|
780
|
+
scale: Ye,
|
|
781
|
+
set: Ai,
|
|
782
782
|
sub: gt,
|
|
783
|
-
swap:
|
|
783
|
+
swap: Bi,
|
|
784
784
|
translate: Nt,
|
|
785
|
-
translateX:
|
|
786
|
-
translateY:
|
|
787
|
-
translation:
|
|
788
|
-
truncate:
|
|
785
|
+
translateX: Dn,
|
|
786
|
+
translateY: Jn,
|
|
787
|
+
translation: Si,
|
|
788
|
+
truncate: Wt,
|
|
789
789
|
xy: ut
|
|
790
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
791
|
-
top:
|
|
792
|
-
left:
|
|
793
|
-
width:
|
|
794
|
-
height:
|
|
795
|
-
}),
|
|
790
|
+
}, Symbol.toStringTag, { value: "Module" })), Ut = c.union([c.number(), c.string()]), Li = c.object({
|
|
791
|
+
top: Ut,
|
|
792
|
+
left: Ut,
|
|
793
|
+
width: Ut,
|
|
794
|
+
height: Ut
|
|
795
|
+
}), ki = c.object({
|
|
796
796
|
left: c.number(),
|
|
797
797
|
top: c.number(),
|
|
798
798
|
right: c.number(),
|
|
799
799
|
bottom: c.number()
|
|
800
|
-
}),
|
|
800
|
+
}), Zi = c.object({
|
|
801
801
|
one: ut,
|
|
802
802
|
two: ut,
|
|
803
|
-
root:
|
|
804
|
-
}),
|
|
803
|
+
root: Re
|
|
804
|
+
}), Qn = { one: V, two: V, root: ht }, _i = { one: V, two: Hn, root: Jt }, tr = (e, t) => ({
|
|
805
805
|
one: e.one,
|
|
806
806
|
two: e.two,
|
|
807
807
|
root: t ?? e.root
|
|
808
|
-
}),
|
|
808
|
+
}), N = (e, t, n = 0, r = 0, s) => {
|
|
809
809
|
const i = {
|
|
810
|
-
one: { ...
|
|
811
|
-
two: { ...
|
|
810
|
+
one: { ...V },
|
|
811
|
+
two: { ...V },
|
|
812
812
|
root: s ?? ht
|
|
813
813
|
};
|
|
814
814
|
if (typeof e == "number") {
|
|
@@ -823,219 +823,219 @@ const Tn = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", ys = `0123456
|
|
|
823
823
|
x: i.one.x + t.signedWidth,
|
|
824
824
|
y: i.one.y + t.signedHeight
|
|
825
825
|
} : i.two = t, i));
|
|
826
|
-
},
|
|
827
|
-
const r =
|
|
826
|
+
}, qi = (e, t, n) => {
|
|
827
|
+
const r = N(e);
|
|
828
828
|
if (typeof t == "string") {
|
|
829
829
|
if (n == null) throw new Error("Invalid arguments for resize");
|
|
830
830
|
const s = _(t);
|
|
831
|
-
return
|
|
831
|
+
return N(
|
|
832
832
|
r.one,
|
|
833
833
|
void 0,
|
|
834
|
-
s === "x" ? n :
|
|
835
|
-
s === "y" ? n :
|
|
834
|
+
s === "x" ? n : $(r),
|
|
835
|
+
s === "y" ? n : U(r),
|
|
836
836
|
r.root
|
|
837
837
|
);
|
|
838
838
|
}
|
|
839
|
-
return
|
|
840
|
-
},
|
|
841
|
-
const r =
|
|
839
|
+
return N(r.one, t, void 0, void 0, r.root);
|
|
840
|
+
}, Fi = (e, t, n = !0) => {
|
|
841
|
+
const r = N(e);
|
|
842
842
|
let s = (i, o) => i < o;
|
|
843
|
-
return n && (s = (i, o) => i <= o), "one" in t ? s(
|
|
844
|
-
},
|
|
845
|
-
width:
|
|
846
|
-
height:
|
|
847
|
-
}),
|
|
848
|
-
signedWidth:
|
|
849
|
-
signedHeight:
|
|
850
|
-
}),
|
|
851
|
-
top:
|
|
852
|
-
left:
|
|
853
|
-
width:
|
|
854
|
-
height:
|
|
855
|
-
}),
|
|
856
|
-
const r = _(t) === "y" ?
|
|
843
|
+
return n && (s = (i, o) => i <= o), "one" in t ? s(X(r), X(t)) && s(tt(t), tt(r)) && s(K(r), K(t)) && s(et(t), et(r)) : s(X(r), t.x) && s(t.x, tt(r)) && s(K(r), t.y) && s(t.y, et(r));
|
|
844
|
+
}, Vi = (e, t) => Vt(e.one, t.one) && Vt(e.two, t.two) && We(e.root, t.root), er = (e) => ({
|
|
845
|
+
width: $(e),
|
|
846
|
+
height: U(e)
|
|
847
|
+
}), Wi = (e) => ({
|
|
848
|
+
signedWidth: Xt(e),
|
|
849
|
+
signedHeight: Kt(e)
|
|
850
|
+
}), Yi = (e) => ({
|
|
851
|
+
top: K(e),
|
|
852
|
+
left: X(e),
|
|
853
|
+
width: $(e),
|
|
854
|
+
height: U(e)
|
|
855
|
+
}), ze = (e, t, n = !1) => {
|
|
856
|
+
const r = _(t) === "y" ? Kt(e) : Xt(e);
|
|
857
857
|
return n ? r : Math.abs(r);
|
|
858
|
-
},
|
|
859
|
-
const n =
|
|
858
|
+
}, D = (e, t) => {
|
|
859
|
+
const n = N(e);
|
|
860
860
|
return {
|
|
861
|
-
x: t.x === "center" ? me(n).x :
|
|
862
|
-
y: t.y === "center" ? me(n).y :
|
|
861
|
+
x: t.x === "center" ? me(n).x : rt(n, t.x),
|
|
862
|
+
y: t.y === "center" ? me(n).y : rt(n, t.y)
|
|
863
863
|
};
|
|
864
|
-
},
|
|
865
|
-
const n =
|
|
866
|
-
return
|
|
867
|
-
},
|
|
868
|
-
const t =
|
|
864
|
+
}, rt = (e, t) => {
|
|
865
|
+
const n = N(e), r = Gn(n.root).includes(t) ? Math.min : Math.max;
|
|
866
|
+
return Ht.includes(t) ? r(n.one.x, n.two.x) : r(n.one.y, n.two.y);
|
|
867
|
+
}, zi = (e) => sr(e) === 0, $ = (e) => ze(e, "x"), U = (e) => ze(e, "y"), Xt = (e) => {
|
|
868
|
+
const t = N(e);
|
|
869
869
|
return t.two.x - t.one.x;
|
|
870
|
-
},
|
|
871
|
-
const t =
|
|
870
|
+
}, Kt = (e) => {
|
|
871
|
+
const t = N(e);
|
|
872
872
|
return t.two.y - t.one.y;
|
|
873
|
-
},
|
|
874
|
-
x:
|
|
875
|
-
y:
|
|
873
|
+
}, nr = (e) => D(e, ht), Gi = (e) => D(e, _e), Hi = (e) => D(e, Le), Di = (e) => D(e, Jt), Ji = (e) => D(e, qe), Xi = (e) => D(e, ke), Ki = (e) => D(e, Ve), Qi = (e) => D(e, Fe), tt = (e) => rt(e, "right"), et = (e) => rt(e, "bottom"), X = (e) => rt(e, "left"), K = (e) => rt(e, "top"), me = (e) => Nt(nr(e), {
|
|
874
|
+
x: Xt(e) / 2,
|
|
875
|
+
y: Kt(e) / 2
|
|
876
876
|
}), Ge = (e) => {
|
|
877
|
-
const t =
|
|
878
|
-
return t.root.x === "left" ?
|
|
877
|
+
const t = N(e);
|
|
878
|
+
return t.root.x === "left" ? X(t) : tt(t);
|
|
879
879
|
}, He = (e) => {
|
|
880
|
-
const t =
|
|
881
|
-
return t.root.y === "top" ?
|
|
882
|
-
},
|
|
883
|
-
const t =
|
|
880
|
+
const t = N(e);
|
|
881
|
+
return t.root.y === "top" ? K(t) : et(t);
|
|
882
|
+
}, to = (e) => ({ x: Ge(e), y: He(e) }), Lt = (e) => {
|
|
883
|
+
const t = N(e);
|
|
884
884
|
return { lower: t.one.x, upper: t.two.x };
|
|
885
|
-
},
|
|
886
|
-
const t =
|
|
885
|
+
}, kt = (e) => {
|
|
886
|
+
const t = N(e);
|
|
887
887
|
return { lower: t.one.y, upper: t.two.y };
|
|
888
|
-
},
|
|
889
|
-
const n =
|
|
888
|
+
}, eo = (e, t) => tr(e, t), no = (e, t) => {
|
|
889
|
+
const n = N(e), r = Ht.includes(t) ? "x" : Dt.includes(t) ? "y" : null;
|
|
890
890
|
if (r === null) throw new Error(`Invalid location: ${t}`);
|
|
891
891
|
const s = t === "top" || t === "left" ? Math.min : Math.max, i = { ...n.one }, o = { ...n.two };
|
|
892
892
|
return i[r] = s(n.one[r], n.two[r]), o[r] = s(n.one[r], n.two[r]), [i, o];
|
|
893
|
-
},
|
|
894
|
-
const n =
|
|
895
|
-
return
|
|
896
|
-
},
|
|
893
|
+
}, ro = (e, t) => {
|
|
894
|
+
const n = N(e), r = N(t), s = Ge(r) + ($(r) - $(n)) / 2, i = He(r) + (U(r) - U(n)) / 2;
|
|
895
|
+
return N({ x: s, y: i }, er(n));
|
|
896
|
+
}, rr = (e) => typeof e != "object" || e == null ? !1 : "one" in e && "two" in e && "root" in e, so = (e) => $(e) / U(e), io = (e, t, n) => {
|
|
897
897
|
if (typeof t == "string") {
|
|
898
898
|
if (n == null) throw new Error("Undefined amount passed into box.translate");
|
|
899
899
|
const s = _(t);
|
|
900
|
-
t =
|
|
900
|
+
t = x(s, n);
|
|
901
901
|
}
|
|
902
|
-
const r =
|
|
903
|
-
return
|
|
902
|
+
const r = N(e);
|
|
903
|
+
return N(
|
|
904
904
|
Nt(r.one, t),
|
|
905
905
|
Nt(r.two, t),
|
|
906
906
|
void 0,
|
|
907
907
|
void 0,
|
|
908
908
|
r.root
|
|
909
909
|
);
|
|
910
|
-
},
|
|
911
|
-
const n = Math.max(
|
|
912
|
-
return n > s || r > i ?
|
|
913
|
-
},
|
|
914
|
-
const n =
|
|
915
|
-
return
|
|
916
|
-
|
|
917
|
-
|
|
910
|
+
}, oo = (e, t) => {
|
|
911
|
+
const n = Math.max(X(e), X(t)), r = Math.max(K(e), K(t)), s = Math.min(tt(e), tt(t)), i = Math.min(et(e), et(t));
|
|
912
|
+
return n > s || r > i ? Qn : N({ x: n, y: r }, { x: s, y: i }, void 0, void 0, e.root);
|
|
913
|
+
}, sr = (e) => $(e) * U(e), co = (e, t) => {
|
|
914
|
+
const n = N(e);
|
|
915
|
+
return N(
|
|
916
|
+
Wt(n.one, t),
|
|
917
|
+
Wt(n.two, t),
|
|
918
918
|
void 0,
|
|
919
919
|
void 0,
|
|
920
920
|
n.root
|
|
921
921
|
);
|
|
922
|
-
},
|
|
922
|
+
}, ao = (e, t, n, r, s, i) => {
|
|
923
923
|
const o = { x: e, y: t }, a = { x: e + n, y: t + r };
|
|
924
|
-
return s.x !== i.x && (s.x === "center" ? (o.x -= n / 2, a.x -= n / 2) : (o.x -= n, a.x -= n)), s.y !== i.y && (s.y === "center" ? (o.y -= r / 2, a.y -= r / 2) : (o.y -= r, a.y -= r)),
|
|
925
|
-
},
|
|
926
|
-
const t =
|
|
927
|
-
return
|
|
928
|
-
},
|
|
924
|
+
return s.x !== i.x && (s.x === "center" ? (o.x -= n / 2, a.x -= n / 2) : (o.x -= n, a.x -= n)), s.y !== i.y && (s.y === "center" ? (o.y -= r / 2, a.y -= r / 2) : (o.y -= r, a.y -= r)), N(o, a, void 0, void 0, i);
|
|
925
|
+
}, uo = (e) => {
|
|
926
|
+
const t = N(e);
|
|
927
|
+
return N(ye(t.one), ye(t.two), void 0, void 0, t.root);
|
|
928
|
+
}, Nu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
929
929
|
__proto__: null,
|
|
930
|
-
DECIMAL:
|
|
931
|
-
ZERO:
|
|
932
|
-
area:
|
|
933
|
-
areaIsZero:
|
|
934
|
-
aspect:
|
|
935
|
-
bottom:
|
|
936
|
-
bottomCenter:
|
|
937
|
-
bottomLeft:
|
|
938
|
-
bottomRight:
|
|
939
|
-
box:
|
|
930
|
+
DECIMAL: _i,
|
|
931
|
+
ZERO: Qn,
|
|
932
|
+
area: sr,
|
|
933
|
+
areaIsZero: zi,
|
|
934
|
+
aspect: so,
|
|
935
|
+
bottom: et,
|
|
936
|
+
bottomCenter: Ji,
|
|
937
|
+
bottomLeft: Di,
|
|
938
|
+
bottomRight: Xi,
|
|
939
|
+
box: Zi,
|
|
940
940
|
center: me,
|
|
941
|
-
centerLeft:
|
|
942
|
-
centerRight:
|
|
943
|
-
construct:
|
|
944
|
-
constructWithAlternateRoot:
|
|
945
|
-
contains:
|
|
946
|
-
copy:
|
|
947
|
-
css:
|
|
948
|
-
cssBox:
|
|
949
|
-
dim:
|
|
950
|
-
dims:
|
|
951
|
-
domRect:
|
|
952
|
-
edgePoints:
|
|
953
|
-
equals:
|
|
954
|
-
height:
|
|
955
|
-
intersection:
|
|
956
|
-
isBox:
|
|
957
|
-
left:
|
|
958
|
-
loc:
|
|
959
|
-
positionInCenter:
|
|
960
|
-
reRoot:
|
|
961
|
-
resize:
|
|
962
|
-
right:
|
|
963
|
-
root:
|
|
964
|
-
round:
|
|
965
|
-
signedDims:
|
|
966
|
-
signedHeight:
|
|
967
|
-
signedWidth:
|
|
968
|
-
top:
|
|
969
|
-
topCenter:
|
|
970
|
-
topLeft:
|
|
971
|
-
topRight:
|
|
972
|
-
translate:
|
|
973
|
-
truncate:
|
|
974
|
-
width:
|
|
941
|
+
centerLeft: Ki,
|
|
942
|
+
centerRight: Qi,
|
|
943
|
+
construct: N,
|
|
944
|
+
constructWithAlternateRoot: ao,
|
|
945
|
+
contains: Fi,
|
|
946
|
+
copy: tr,
|
|
947
|
+
css: Yi,
|
|
948
|
+
cssBox: Li,
|
|
949
|
+
dim: ze,
|
|
950
|
+
dims: er,
|
|
951
|
+
domRect: ki,
|
|
952
|
+
edgePoints: no,
|
|
953
|
+
equals: Vi,
|
|
954
|
+
height: U,
|
|
955
|
+
intersection: oo,
|
|
956
|
+
isBox: rr,
|
|
957
|
+
left: X,
|
|
958
|
+
loc: rt,
|
|
959
|
+
positionInCenter: ro,
|
|
960
|
+
reRoot: eo,
|
|
961
|
+
resize: qi,
|
|
962
|
+
right: tt,
|
|
963
|
+
root: to,
|
|
964
|
+
round: uo,
|
|
965
|
+
signedDims: Wi,
|
|
966
|
+
signedHeight: Kt,
|
|
967
|
+
signedWidth: Xt,
|
|
968
|
+
top: K,
|
|
969
|
+
topCenter: Gi,
|
|
970
|
+
topLeft: nr,
|
|
971
|
+
topRight: Hi,
|
|
972
|
+
translate: io,
|
|
973
|
+
truncate: co,
|
|
974
|
+
width: $,
|
|
975
975
|
x: Ge,
|
|
976
|
-
xBounds:
|
|
977
|
-
xyLoc:
|
|
976
|
+
xBounds: Lt,
|
|
977
|
+
xyLoc: D,
|
|
978
978
|
y: He,
|
|
979
|
-
yBounds:
|
|
980
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
979
|
+
yBounds: kt
|
|
980
|
+
}, Symbol.toStringTag, { value: "Module" })), ir = c.object({ signedWidth: c.number(), signedHeight: c.number() }), lo = c.union([Te, ir, ut, Ln]), fo = { width: 0, height: 0 }, ho = { width: 1, height: 1 }, Z = (e, t) => typeof e == "number" ? { width: e, height: t ?? e } : Array.isArray(e) ? { width: e[0], height: e[1] } : "x" in e ? { width: e.x, height: e.y } : "signedWidth" in e ? { width: e.signedWidth, height: e.signedHeight } : { ...e }, go = (e, t) => {
|
|
981
981
|
if (t == null) return !1;
|
|
982
982
|
const n = Z(e), r = Z(t);
|
|
983
983
|
return n.width === r.width && n.height === r.height;
|
|
984
|
-
},
|
|
984
|
+
}, yo = (e) => {
|
|
985
985
|
const t = Z(e);
|
|
986
986
|
return { width: t.height, height: t.width };
|
|
987
|
-
},
|
|
987
|
+
}, mo = (e) => {
|
|
988
988
|
const t = Z(e);
|
|
989
989
|
return `0 0 ${t.width} ${t.height}`;
|
|
990
|
-
},
|
|
990
|
+
}, po = (e) => {
|
|
991
991
|
const t = Z(e);
|
|
992
992
|
return [t.width, t.height];
|
|
993
|
-
},
|
|
993
|
+
}, bo = (e) => ({
|
|
994
994
|
width: Math.max(...e.map((t) => Z(t).width)),
|
|
995
995
|
height: Math.max(...e.map((t) => Z(t).height))
|
|
996
|
-
}),
|
|
996
|
+
}), wo = (e) => ({
|
|
997
997
|
width: Math.min(...e.map((t) => Z(t).width)),
|
|
998
998
|
height: Math.min(...e.map((t) => Z(t).height))
|
|
999
|
-
}),
|
|
999
|
+
}), Oo = (e, t) => {
|
|
1000
1000
|
const n = Z(e);
|
|
1001
1001
|
return { width: n.width * t, height: n.height * t };
|
|
1002
|
-
},
|
|
1002
|
+
}, vu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1003
1003
|
__proto__: null,
|
|
1004
|
-
DECIMAL:
|
|
1005
|
-
ZERO:
|
|
1004
|
+
DECIMAL: ho,
|
|
1005
|
+
ZERO: fo,
|
|
1006
1006
|
construct: Z,
|
|
1007
|
-
couple:
|
|
1008
|
-
crude:
|
|
1007
|
+
couple: po,
|
|
1008
|
+
crude: lo,
|
|
1009
1009
|
dimensions: Te,
|
|
1010
|
-
equals:
|
|
1011
|
-
max:
|
|
1012
|
-
min:
|
|
1013
|
-
scale:
|
|
1014
|
-
signed:
|
|
1015
|
-
svgViewBox:
|
|
1016
|
-
swap:
|
|
1017
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1010
|
+
equals: go,
|
|
1011
|
+
max: bo,
|
|
1012
|
+
min: wo,
|
|
1013
|
+
scale: Oo,
|
|
1014
|
+
signed: ir,
|
|
1015
|
+
svgViewBox: mo,
|
|
1016
|
+
swap: yo
|
|
1017
|
+
}, Symbol.toStringTag, { value: "Module" })), xo = (e, t, n) => t !== void 0 && e < t ? t : n !== void 0 && e > n ? n : e, Io = c.object({ offset: ge, scale: ge }), No = c.object({ offset: c.number(), scale: c.number() }), vo = (e) => (t, n, r, s) => n === "dimension" ? [t, r] : [
|
|
1018
1018
|
t,
|
|
1019
1019
|
s ? r - e : r + e
|
|
1020
|
-
],
|
|
1020
|
+
], Mo = (e) => (t, n, r, s) => [
|
|
1021
1021
|
t,
|
|
1022
1022
|
s ? r / e : r * e
|
|
1023
|
-
],
|
|
1023
|
+
], Ao = (e) => (t, n, r) => {
|
|
1024
1024
|
if (t === null) return [e, r];
|
|
1025
1025
|
const { lower: s, upper: i } = t, { lower: o, upper: a } = e, u = i - s, l = a - o;
|
|
1026
1026
|
if (n === "dimension") return [e, r * (l / u)];
|
|
1027
1027
|
const h = (r - s) * (l / u) + o;
|
|
1028
1028
|
return [e, h];
|
|
1029
|
-
},
|
|
1029
|
+
}, Eo = (e) => (t, n, r) => [e, r], So = () => (e, t, n) => {
|
|
1030
1030
|
if (e === null) throw new Error("cannot invert without bounds");
|
|
1031
1031
|
if (t === "dimension") return [e, n];
|
|
1032
1032
|
const { lower: r, upper: s } = e;
|
|
1033
1033
|
return [e, s - (n - r)];
|
|
1034
|
-
},
|
|
1034
|
+
}, To = (e) => (t, n, r) => {
|
|
1035
1035
|
const { lower: s, upper: i } = e;
|
|
1036
|
-
return r =
|
|
1036
|
+
return r = xo(r, s, i), [t, r];
|
|
1037
1037
|
};
|
|
1038
|
-
class
|
|
1038
|
+
class W {
|
|
1039
1039
|
ops = [];
|
|
1040
1040
|
currBounds = null;
|
|
1041
1041
|
currType = null;
|
|
@@ -1049,7 +1049,7 @@ class V {
|
|
|
1049
1049
|
* @param value - The amount to translate by.
|
|
1050
1050
|
*/
|
|
1051
1051
|
static translate(t) {
|
|
1052
|
-
return new
|
|
1052
|
+
return new W().translate(t);
|
|
1053
1053
|
}
|
|
1054
1054
|
/**
|
|
1055
1055
|
* @returns a new scale with a magnification as its first operation. Any number provided
|
|
@@ -1057,10 +1057,10 @@ class V {
|
|
|
1057
1057
|
* @param value - The amount to translate by.
|
|
1058
1058
|
*/
|
|
1059
1059
|
static magnify(t) {
|
|
1060
|
-
return new
|
|
1060
|
+
return new W().magnify(t);
|
|
1061
1061
|
}
|
|
1062
1062
|
static scale(t, n) {
|
|
1063
|
-
return new
|
|
1063
|
+
return new W().scale(t, n);
|
|
1064
1064
|
}
|
|
1065
1065
|
/**
|
|
1066
1066
|
* @returns a copy of the scale with a translation as its next operation. Any
|
|
@@ -1069,7 +1069,7 @@ class V {
|
|
|
1069
1069
|
* @param value - The amount to translate by.
|
|
1070
1070
|
*/
|
|
1071
1071
|
translate(t) {
|
|
1072
|
-
const n = this.new(), r =
|
|
1072
|
+
const n = this.new(), r = vo(t);
|
|
1073
1073
|
return r.type = "translate", n.ops.push(r), n;
|
|
1074
1074
|
}
|
|
1075
1075
|
/**
|
|
@@ -1079,23 +1079,23 @@ class V {
|
|
|
1079
1079
|
* @param value - The amount to magnify by.
|
|
1080
1080
|
*/
|
|
1081
1081
|
magnify(t) {
|
|
1082
|
-
const n = this.new(), r =
|
|
1082
|
+
const n = this.new(), r = Mo(t);
|
|
1083
1083
|
return r.type = "magnify", n.ops.push(r), n;
|
|
1084
1084
|
}
|
|
1085
1085
|
scale(t, n) {
|
|
1086
|
-
const r =
|
|
1086
|
+
const r = b(t, n), s = this.new(), i = Ao(r);
|
|
1087
1087
|
return i.type = "scale", s.ops.push(i), s;
|
|
1088
1088
|
}
|
|
1089
1089
|
clamp(t, n) {
|
|
1090
|
-
const r =
|
|
1090
|
+
const r = b(t, n), s = this.new(), i = To(r);
|
|
1091
1091
|
return i.type = "clamp", s.ops.push(i), s;
|
|
1092
1092
|
}
|
|
1093
1093
|
reBound(t, n) {
|
|
1094
|
-
const r =
|
|
1094
|
+
const r = b(t, n), s = this.new(), i = Eo(r);
|
|
1095
1095
|
return i.type = "re-bound", s.ops.push(i), s;
|
|
1096
1096
|
}
|
|
1097
1097
|
invert() {
|
|
1098
|
-
const t =
|
|
1098
|
+
const t = So();
|
|
1099
1099
|
t.type = "invert";
|
|
1100
1100
|
const n = this.new();
|
|
1101
1101
|
return n.ops.push(t), n;
|
|
@@ -1107,7 +1107,7 @@ class V {
|
|
|
1107
1107
|
return this.exec("dimension", t);
|
|
1108
1108
|
}
|
|
1109
1109
|
new() {
|
|
1110
|
-
const t = new
|
|
1110
|
+
const t = new W();
|
|
1111
1111
|
return t.ops = this.ops.slice(), t.reversed = this.reversed, t;
|
|
1112
1112
|
}
|
|
1113
1113
|
exec(t, n) {
|
|
@@ -1133,13 +1133,13 @@ class V {
|
|
|
1133
1133
|
get transform() {
|
|
1134
1134
|
return { scale: this.dim(1), offset: this.pos(0) };
|
|
1135
1135
|
}
|
|
1136
|
-
static IDENTITY = new
|
|
1136
|
+
static IDENTITY = new W();
|
|
1137
1137
|
}
|
|
1138
1138
|
class P {
|
|
1139
1139
|
x;
|
|
1140
1140
|
y;
|
|
1141
1141
|
currRoot;
|
|
1142
|
-
constructor(t = new
|
|
1142
|
+
constructor(t = new W(), n = new W(), r = null) {
|
|
1143
1143
|
this.x = t, this.y = n, this.currRoot = r;
|
|
1144
1144
|
}
|
|
1145
1145
|
static translate(t, n) {
|
|
@@ -1164,7 +1164,7 @@ class P {
|
|
|
1164
1164
|
return new P().reBound(t);
|
|
1165
1165
|
}
|
|
1166
1166
|
translate(t, n) {
|
|
1167
|
-
const r =
|
|
1167
|
+
const r = x(t, n), s = this.copy();
|
|
1168
1168
|
return s.x = this.x.translate(r.x), s.y = this.y.translate(r.y), s;
|
|
1169
1169
|
}
|
|
1170
1170
|
translateX(t) {
|
|
@@ -1181,19 +1181,19 @@ class P {
|
|
|
1181
1181
|
}
|
|
1182
1182
|
scale(t) {
|
|
1183
1183
|
const n = this.copy();
|
|
1184
|
-
if (
|
|
1184
|
+
if (rr(t)) {
|
|
1185
1185
|
const r = this.currRoot;
|
|
1186
|
-
return n.currRoot = t.root, r != null && !
|
|
1186
|
+
return n.currRoot = t.root, r != null && !We(r, t.root) && (r.x !== t.root.x && (n.x = n.x.invert()), r.y !== t.root.y && (n.y = n.y.invert())), n.x = n.x.scale(Lt(t)), n.y = n.y.scale(kt(t)), n;
|
|
1187
1187
|
}
|
|
1188
1188
|
return n.x = n.x.scale(t.width), n.y = n.y.scale(t.height), n;
|
|
1189
1189
|
}
|
|
1190
1190
|
reBound(t) {
|
|
1191
1191
|
const n = this.copy();
|
|
1192
|
-
return n.x = this.x.reBound(
|
|
1192
|
+
return n.x = this.x.reBound(Lt(t)), n.y = this.y.reBound(kt(t)), n;
|
|
1193
1193
|
}
|
|
1194
1194
|
clamp(t) {
|
|
1195
1195
|
const n = this.copy();
|
|
1196
|
-
return n.x = this.x.clamp(
|
|
1196
|
+
return n.x = this.x.clamp(Lt(t)), n.y = this.y.clamp(kt(t)), n;
|
|
1197
1197
|
}
|
|
1198
1198
|
copy() {
|
|
1199
1199
|
const t = new P();
|
|
@@ -1210,7 +1210,7 @@ class P {
|
|
|
1210
1210
|
return { x: this.x.dim(t.x), y: this.y.dim(t.y) };
|
|
1211
1211
|
}
|
|
1212
1212
|
box(t) {
|
|
1213
|
-
return
|
|
1213
|
+
return N(
|
|
1214
1214
|
this.pos(t.one),
|
|
1215
1215
|
this.pos(t.two),
|
|
1216
1216
|
0,
|
|
@@ -1226,35 +1226,35 @@ class P {
|
|
|
1226
1226
|
}
|
|
1227
1227
|
static IDENTITY = new P();
|
|
1228
1228
|
}
|
|
1229
|
-
const
|
|
1229
|
+
const Mu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1230
1230
|
__proto__: null,
|
|
1231
|
-
Scale:
|
|
1231
|
+
Scale: W,
|
|
1232
1232
|
XY: P,
|
|
1233
|
-
crudeXYTransform:
|
|
1234
|
-
transform:
|
|
1235
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1233
|
+
crudeXYTransform: Io,
|
|
1234
|
+
transform: No
|
|
1235
|
+
}, Symbol.toStringTag, { value: "Module" })), Au = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1236
1236
|
__proto__: null,
|
|
1237
|
-
ALIGNMENTS:
|
|
1238
|
-
ORDERS:
|
|
1239
|
-
alignment:
|
|
1240
|
-
order:
|
|
1241
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1242
|
-
root:
|
|
1243
|
-
units:
|
|
1244
|
-
x:
|
|
1245
|
-
y:
|
|
1237
|
+
ALIGNMENTS: kn,
|
|
1238
|
+
ORDERS: _n,
|
|
1239
|
+
alignment: Bs,
|
|
1240
|
+
order: Ps
|
|
1241
|
+
}, Symbol.toStringTag, { value: "Module" })), or = ut.extend({
|
|
1242
|
+
root: Re,
|
|
1243
|
+
units: L.object({
|
|
1244
|
+
x: L.enum(["px", "decimal"]),
|
|
1245
|
+
y: L.enum(["px", "decimal"])
|
|
1246
1246
|
})
|
|
1247
|
-
}),
|
|
1247
|
+
}), $o = or.partial({ root: !0, units: !0 }), Uo = (e) => {
|
|
1248
1248
|
const t = {};
|
|
1249
1249
|
return t[e.root?.x ?? "left"] = e?.units?.x === "px" ? `${e.x}px` : `${e.x * 100}%`, t[e.root?.y ?? "top"] = e?.units?.y === "px" ? `${e.y}px` : `${e.y * 100}%`, t;
|
|
1250
|
-
},
|
|
1250
|
+
}, jo = ({
|
|
1251
1251
|
position: e,
|
|
1252
1252
|
element: t,
|
|
1253
1253
|
container: n
|
|
1254
1254
|
}) => {
|
|
1255
1255
|
const r = { x: e.x, y: e.y };
|
|
1256
|
-
return e.units?.x === "decimal" ? e.root?.x === "right" && (r.x = 1 - e.x) : e.root?.x === "right" ? r.x = 1 - (e.x +
|
|
1257
|
-
},
|
|
1256
|
+
return e.units?.x === "decimal" ? e.root?.x === "right" && (r.x = 1 - e.x) : e.root?.x === "right" ? r.x = 1 - (e.x + $(t)) / $(n) : r.x /= $(n), e.units?.y === "decimal" ? e.root?.y === "bottom" && (r.y = 1 - e.y) : e.root?.y === "bottom" ? r.y = 1 - (e.y + U(t)) / U(n) : r.y /= U(n), r;
|
|
1257
|
+
}, Co = ({
|
|
1258
1258
|
position: e,
|
|
1259
1259
|
element: t,
|
|
1260
1260
|
container: n,
|
|
@@ -1267,19 +1267,19 @@ const Tu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1267
1267
|
root: { ...ht },
|
|
1268
1268
|
units: { x: "px", y: "px" }
|
|
1269
1269
|
};
|
|
1270
|
-
return e.x > s ? (i.x = (1 - e.x) *
|
|
1271
|
-
},
|
|
1270
|
+
return e.x > s ? (i.x = (1 - e.x) * $(n) - $(t), i.root.x = "right") : e.x < r ? i.x = e.x * $(n) : i.units.x = "decimal", e.y > s ? (i.y = (1 - e.y) * U(n) - U(t), i.root.y = "bottom") : e.y < r ? i.y = e.y * U(n) : i.units.y = "decimal", i.x = Math.round(i.x * 100) / 100, { ...i, ...Wt(i, 3) };
|
|
1271
|
+
}, Eu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1272
1272
|
__proto__: null,
|
|
1273
|
-
calculate:
|
|
1274
|
-
completeXY:
|
|
1275
|
-
toCSS:
|
|
1276
|
-
toDecimal:
|
|
1277
|
-
xy:
|
|
1278
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1273
|
+
calculate: Co,
|
|
1274
|
+
completeXY: or,
|
|
1275
|
+
toCSS: Uo,
|
|
1276
|
+
toDecimal: jo,
|
|
1277
|
+
xy: $o
|
|
1278
|
+
}, Symbol.toStringTag, { value: "Module" })), Bo = c.enum(["static", "dynamic"]), on = 365, jt = 30, Po = c.union([
|
|
1279
1279
|
c.tuple([c.int()]),
|
|
1280
1280
|
c.tuple([c.int(), c.int().min(1).max(12)]),
|
|
1281
1281
|
c.tuple([c.int(), c.int().min(1).max(12), c.int().min(1).max(31)])
|
|
1282
|
-
]),
|
|
1282
|
+
]), cr = (e, t) => {
|
|
1283
1283
|
const n = new d(t);
|
|
1284
1284
|
if (![
|
|
1285
1285
|
g.DAY,
|
|
@@ -1296,7 +1296,7 @@ const Tu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1296
1296
|
const r = e.valueOf() % n.valueOf();
|
|
1297
1297
|
return e instanceof d ? new d(r) : new g(r);
|
|
1298
1298
|
};
|
|
1299
|
-
class d extends
|
|
1299
|
+
class d extends st {
|
|
1300
1300
|
constructor(t, n = "UTC") {
|
|
1301
1301
|
if (t == null) super(d.now().valueOf());
|
|
1302
1302
|
else if (t instanceof Date)
|
|
@@ -1306,7 +1306,7 @@ class d extends rt {
|
|
|
1306
1306
|
else if (Array.isArray(t)) super(d.parseDate(t));
|
|
1307
1307
|
else {
|
|
1308
1308
|
let r = 0n;
|
|
1309
|
-
t instanceof Number && (t = t.valueOf()), n === "local" && (r = d.utcOffset.valueOf()), typeof t == "number" && (isFinite(t) ? t ===
|
|
1309
|
+
t instanceof Number && (t = t.valueOf()), n === "local" && (r = d.utcOffset.valueOf()), typeof t == "number" && (isFinite(t) ? t === Bn ? t = qt : t = Math.trunc(t) : (isNaN(t) && (t = 0), t === 1 / 0 ? t = d.MAX : t = d.MIN)), C(t) && (t = t.value), super(BigInt(t.valueOf()) + r);
|
|
1310
1310
|
}
|
|
1311
1311
|
}
|
|
1312
1312
|
static parseDate([t = 1970, n = 1, r = 1]) {
|
|
@@ -1403,7 +1403,7 @@ class d extends rt {
|
|
|
1403
1403
|
* valid, regardless of the TimeStamp order.
|
|
1404
1404
|
*/
|
|
1405
1405
|
range(t) {
|
|
1406
|
-
return new
|
|
1406
|
+
return new A(this, t).makeValid();
|
|
1407
1407
|
}
|
|
1408
1408
|
/**
|
|
1409
1409
|
* Creates a TimeRange starting at the TimeStamp and spanning the given
|
|
@@ -1528,42 +1528,82 @@ class d extends rt {
|
|
|
1528
1528
|
get nanoseconds() {
|
|
1529
1529
|
return Number(this.valueOf());
|
|
1530
1530
|
}
|
|
1531
|
-
/** @returns the integer year that the timestamp corresponds to. */
|
|
1531
|
+
/** @returns the integer year that the timestamp corresponds to in UTC. */
|
|
1532
1532
|
get year() {
|
|
1533
1533
|
return this.date().getUTCFullYear();
|
|
1534
1534
|
}
|
|
1535
|
+
/** @returns the integer year that the timestamp corresponds to in local time. */
|
|
1536
|
+
get localYear() {
|
|
1537
|
+
return this.date().getFullYear();
|
|
1538
|
+
}
|
|
1535
1539
|
/**
|
|
1536
|
-
* @returns a copy of the timestamp with the year changed.
|
|
1540
|
+
* @returns a copy of the timestamp with the year changed in UTC.
|
|
1537
1541
|
* @param year the value to set the year to.
|
|
1538
1542
|
*/
|
|
1539
1543
|
setYear(t) {
|
|
1540
1544
|
const n = this.date();
|
|
1541
1545
|
return n.setUTCFullYear(t), new d(n);
|
|
1542
1546
|
}
|
|
1543
|
-
/**
|
|
1547
|
+
/**
|
|
1548
|
+
* @returns a copy of the timestamp with the year changed in local time.
|
|
1549
|
+
* @param year the value to set the year to.
|
|
1550
|
+
*/
|
|
1551
|
+
setLocalYear(t) {
|
|
1552
|
+
const n = this.date();
|
|
1553
|
+
return n.setFullYear(t), new d(n);
|
|
1554
|
+
}
|
|
1555
|
+
/** @returns the integer month that the timestamp corresponds to within its year in
|
|
1556
|
+
* UTC. */
|
|
1544
1557
|
get month() {
|
|
1545
1558
|
return this.date().getUTCMonth();
|
|
1546
1559
|
}
|
|
1560
|
+
/** @returns the integer month that the timestamp corresponds to within its year in
|
|
1561
|
+
* local time. */
|
|
1562
|
+
get localMonth() {
|
|
1563
|
+
return this.date().getMonth();
|
|
1564
|
+
}
|
|
1547
1565
|
/**
|
|
1548
|
-
* @returns a copy of the timestamp with the month changed.
|
|
1566
|
+
* @returns a copy of the timestamp with the month changed in UTC.
|
|
1549
1567
|
* @param month the value to set the month to.
|
|
1550
1568
|
*/
|
|
1551
1569
|
setMonth(t) {
|
|
1552
1570
|
const n = this.date();
|
|
1553
1571
|
return n.setUTCMonth(t), new d(n);
|
|
1554
1572
|
}
|
|
1555
|
-
/**
|
|
1573
|
+
/**
|
|
1574
|
+
* @returns a copy of the timestamp with the month changed in local time.
|
|
1575
|
+
* @param month the value to set the month to.
|
|
1576
|
+
*/
|
|
1577
|
+
setLocalMonth(t) {
|
|
1578
|
+
const n = this.date();
|
|
1579
|
+
return n.setMonth(t), new d(n);
|
|
1580
|
+
}
|
|
1581
|
+
/** @returns the integer day that the timestamp corresponds to within its month in
|
|
1582
|
+
* UTC. */
|
|
1556
1583
|
get day() {
|
|
1557
1584
|
return this.date().getUTCDate();
|
|
1558
1585
|
}
|
|
1586
|
+
/** @returns the integer day that the timestamp corresponds to within its month in
|
|
1587
|
+
* local time. */
|
|
1588
|
+
get localDay() {
|
|
1589
|
+
return this.date().getDate();
|
|
1590
|
+
}
|
|
1559
1591
|
/**
|
|
1560
|
-
* @returns a copy of the timestamp with the day changed.
|
|
1592
|
+
* @returns a copy of the timestamp with the day changed in UTC.
|
|
1561
1593
|
* @param day the value the set the day to.
|
|
1562
1594
|
*/
|
|
1563
1595
|
setDay(t) {
|
|
1564
1596
|
const n = this.date();
|
|
1565
1597
|
return n.setUTCDate(t), new d(n);
|
|
1566
1598
|
}
|
|
1599
|
+
/**
|
|
1600
|
+
* @returns a copy of the timestamp with the day changed in local time.
|
|
1601
|
+
* @param day the value to set the day to.
|
|
1602
|
+
*/
|
|
1603
|
+
setLocalDay(t) {
|
|
1604
|
+
const n = this.date();
|
|
1605
|
+
return n.setDate(t), new d(n);
|
|
1606
|
+
}
|
|
1567
1607
|
/**
|
|
1568
1608
|
* @returns the integer hour that the timestamp corresponds to within its day.
|
|
1569
1609
|
*/
|
|
@@ -1571,7 +1611,8 @@ class d extends rt {
|
|
|
1571
1611
|
return this.date().getUTCHours();
|
|
1572
1612
|
}
|
|
1573
1613
|
/**
|
|
1574
|
-
* @returns the integer hour that the timestamp corresponds to within its day in local
|
|
1614
|
+
* @returns the integer hour that the timestamp corresponds to within its day in local
|
|
1615
|
+
* time.
|
|
1575
1616
|
*/
|
|
1576
1617
|
get localHour() {
|
|
1577
1618
|
return this.date().getHours();
|
|
@@ -1592,48 +1633,92 @@ class d extends rt {
|
|
|
1592
1633
|
const n = this.date();
|
|
1593
1634
|
return n.setUTCHours(t), new d(n);
|
|
1594
1635
|
}
|
|
1595
|
-
/** @returns the integer minute that the timestamp corresponds to within its hour
|
|
1636
|
+
/** @returns the integer minute that the timestamp corresponds to within its hour in
|
|
1637
|
+
* UTC. */
|
|
1596
1638
|
get minute() {
|
|
1597
1639
|
return this.date().getUTCMinutes();
|
|
1598
1640
|
}
|
|
1641
|
+
/** @returns the integer minute that the timestamp corresponds to within its hour in
|
|
1642
|
+
* local time. */
|
|
1643
|
+
get localMinute() {
|
|
1644
|
+
return this.date().getMinutes();
|
|
1645
|
+
}
|
|
1599
1646
|
/**
|
|
1600
|
-
* @returns a copy of the timestamp with the minute changed.
|
|
1647
|
+
* @returns a copy of the timestamp with the minute changed in UTC.
|
|
1601
1648
|
* @param minute the value to set the minute to.
|
|
1602
1649
|
*/
|
|
1603
1650
|
setMinute(t) {
|
|
1604
1651
|
const n = this.date();
|
|
1605
1652
|
return n.setUTCMinutes(t), new d(n);
|
|
1606
1653
|
}
|
|
1654
|
+
/**
|
|
1655
|
+
* @returns a copy of the timestamp with the minute changed in local time.
|
|
1656
|
+
* @param minute the value to set the minute to.
|
|
1657
|
+
*/
|
|
1658
|
+
setLocalMinute(t) {
|
|
1659
|
+
const n = this.date();
|
|
1660
|
+
return n.setMinutes(t), new d(n);
|
|
1661
|
+
}
|
|
1607
1662
|
/**
|
|
1608
1663
|
* @returns the integer second that the timestamp corresponds to within its
|
|
1609
|
-
* minute.
|
|
1664
|
+
* minute in UTC.
|
|
1610
1665
|
*/
|
|
1611
1666
|
get second() {
|
|
1612
1667
|
return this.date().getUTCSeconds();
|
|
1613
1668
|
}
|
|
1614
1669
|
/**
|
|
1615
|
-
* @returns
|
|
1670
|
+
* @returns the integer second that the timestamp corresponds to within its minute in
|
|
1671
|
+
* local time.
|
|
1672
|
+
*/
|
|
1673
|
+
get localSecond() {
|
|
1674
|
+
return this.date().getSeconds();
|
|
1675
|
+
}
|
|
1676
|
+
/**
|
|
1677
|
+
* @returns a copy of the timestamp with the second changed in UTC.
|
|
1616
1678
|
* @param second the value to set the second to.
|
|
1617
1679
|
*/
|
|
1618
1680
|
setSecond(t) {
|
|
1619
1681
|
const n = this.date();
|
|
1620
1682
|
return n.setUTCSeconds(t), new d(n);
|
|
1621
1683
|
}
|
|
1684
|
+
/**
|
|
1685
|
+
* @returns a copy of the timestamp with the second changed in local time.
|
|
1686
|
+
* @param second the value to set the second to.
|
|
1687
|
+
*/
|
|
1688
|
+
setLocalSecond(t) {
|
|
1689
|
+
const n = this.date();
|
|
1690
|
+
return n.setSeconds(t), new d(n);
|
|
1691
|
+
}
|
|
1622
1692
|
/**
|
|
1623
1693
|
* @returns the integer millisecond that the timestamp corresponds to within its
|
|
1624
|
-
* second.
|
|
1694
|
+
* second in UTC.
|
|
1625
1695
|
*/
|
|
1626
1696
|
get millisecond() {
|
|
1627
1697
|
return this.date().getUTCMilliseconds();
|
|
1628
1698
|
}
|
|
1629
1699
|
/**
|
|
1630
|
-
* @returns
|
|
1700
|
+
* @returns the integer millisecond that the timestamp corresponds to within its
|
|
1701
|
+
* second in local time.
|
|
1702
|
+
*/
|
|
1703
|
+
get localMillisecond() {
|
|
1704
|
+
return this.date().getMilliseconds();
|
|
1705
|
+
}
|
|
1706
|
+
/**
|
|
1707
|
+
* @returns a copy of the timestamp with the milliseconds changed in UTC.
|
|
1631
1708
|
* @param millisecond the value to set the millisecond to.
|
|
1632
1709
|
*/
|
|
1633
1710
|
setMillisecond(t) {
|
|
1634
1711
|
const n = this.date();
|
|
1635
1712
|
return n.setUTCMilliseconds(t), new d(n);
|
|
1636
1713
|
}
|
|
1714
|
+
/**
|
|
1715
|
+
* @returns a copy of the timestamp with the milliseconds changed in local time.
|
|
1716
|
+
* @param millisecond the value to set the millisecond to.
|
|
1717
|
+
*/
|
|
1718
|
+
setLocalMillisecond(t) {
|
|
1719
|
+
const n = this.date();
|
|
1720
|
+
return n.setMilliseconds(t), new d(n);
|
|
1721
|
+
}
|
|
1637
1722
|
/**
|
|
1638
1723
|
* Returns a string representation of the TimeStamp.
|
|
1639
1724
|
*
|
|
@@ -1673,7 +1758,7 @@ class d extends rt {
|
|
|
1673
1758
|
* @example TimeStamp.now().remainder(TimeStamp.DAY) // => TimeStamp representing the current day
|
|
1674
1759
|
*/
|
|
1675
1760
|
remainder(t) {
|
|
1676
|
-
return
|
|
1761
|
+
return cr(this, t);
|
|
1677
1762
|
}
|
|
1678
1763
|
/** @returns true if the day portion TimeStamp is today, false otherwise. */
|
|
1679
1764
|
get isToday() {
|
|
@@ -1788,7 +1873,7 @@ class d extends rt {
|
|
|
1788
1873
|
/** One day after the unix epoch */
|
|
1789
1874
|
static DAY = d.days(1);
|
|
1790
1875
|
/** The maximum possible value for a timestamp */
|
|
1791
|
-
static MAX = new d(
|
|
1876
|
+
static MAX = new d(qt);
|
|
1792
1877
|
/** The minimum possible value for a timestamp */
|
|
1793
1878
|
static MIN = new d(0);
|
|
1794
1879
|
/** The unix epoch */
|
|
@@ -1802,7 +1887,7 @@ class d extends rt {
|
|
|
1802
1887
|
c.bigint().transform((t) => new d(t)),
|
|
1803
1888
|
c.date().transform((t) => new d(t)),
|
|
1804
1889
|
c.custom((t) => t instanceof g).transform((t) => new d(t)),
|
|
1805
|
-
|
|
1890
|
+
Po.transform((t) => new d(t))
|
|
1806
1891
|
]);
|
|
1807
1892
|
/**
|
|
1808
1893
|
* Sorts two timestamps.
|
|
@@ -1816,9 +1901,9 @@ class d extends rt {
|
|
|
1816
1901
|
return Number(t.valueOf() - n.valueOf());
|
|
1817
1902
|
}
|
|
1818
1903
|
}
|
|
1819
|
-
class g extends
|
|
1904
|
+
class g extends st {
|
|
1820
1905
|
constructor(t) {
|
|
1821
|
-
typeof t == "number" && (t = Math.trunc(t.valueOf())),
|
|
1906
|
+
typeof t == "number" && (t = Math.trunc(t.valueOf())), C(t) && (t = t.value), super(BigInt(t.valueOf()));
|
|
1822
1907
|
}
|
|
1823
1908
|
/**
|
|
1824
1909
|
* Creates a TimeSpan representing the given number of seconds.
|
|
@@ -1827,7 +1912,7 @@ class g extends rt {
|
|
|
1827
1912
|
* @returns A TimeSpan representing the given number of seconds.
|
|
1828
1913
|
*/
|
|
1829
1914
|
static fromSeconds(t) {
|
|
1830
|
-
return t instanceof g ? t : t instanceof
|
|
1915
|
+
return t instanceof g ? t : t instanceof T ? t.period : t instanceof d ? new g(t) : (C(t) && (t = t.value), ["number", "bigint"].includes(typeof t) ? g.seconds(t) : new g(t));
|
|
1831
1916
|
}
|
|
1832
1917
|
/**
|
|
1833
1918
|
* Creates a TimeSpan representing the given number of milliseconds.
|
|
@@ -1836,7 +1921,7 @@ class g extends rt {
|
|
|
1836
1921
|
* @returns A TimeSpan representing the given number of milliseconds.
|
|
1837
1922
|
*/
|
|
1838
1923
|
static fromMilliseconds(t) {
|
|
1839
|
-
return t instanceof g ? t : t instanceof
|
|
1924
|
+
return t instanceof g ? t : t instanceof T ? t.period : t instanceof d ? new g(t) : (C(t) && (t = t.value), ["number", "bigint"].includes(typeof t) ? g.milliseconds(t) : new g(t));
|
|
1840
1925
|
}
|
|
1841
1926
|
/**
|
|
1842
1927
|
* @returns the primitive value of the TimeSpan. Overrides standard JS valueOf()
|
|
@@ -1888,7 +1973,7 @@ class g extends rt {
|
|
|
1888
1973
|
* @returns A new TimeSpan representing the remainder.
|
|
1889
1974
|
*/
|
|
1890
1975
|
remainder(t) {
|
|
1891
|
-
return
|
|
1976
|
+
return cr(this, t);
|
|
1892
1977
|
}
|
|
1893
1978
|
/**
|
|
1894
1979
|
* Truncates the TimeSpan to the nearest multiple of the given span.
|
|
@@ -1911,65 +1996,65 @@ class g extends rt {
|
|
|
1911
1996
|
*/
|
|
1912
1997
|
toString(t = "full") {
|
|
1913
1998
|
if (t === "semantic") return this.toSemanticString();
|
|
1914
|
-
const n = this.truncate(g.DAY), r = this.truncate(g.HOUR), s = this.truncate(g.MINUTE), i = this.truncate(g.SECOND), o = this.truncate(g.MILLISECOND), a = this.truncate(g.MICROSECOND), u = this.truncate(g.NANOSECOND), l = n, h = r.sub(n), y = s.sub(r), m = i.sub(s),
|
|
1915
|
-
let
|
|
1916
|
-
return l.isZero || (
|
|
1999
|
+
const n = this.truncate(g.DAY), r = this.truncate(g.HOUR), s = this.truncate(g.MINUTE), i = this.truncate(g.SECOND), o = this.truncate(g.MILLISECOND), a = this.truncate(g.MICROSECOND), u = this.truncate(g.NANOSECOND), l = n, h = r.sub(n), y = s.sub(r), m = i.sub(s), M = o.sub(i), S = a.sub(o), B = u.sub(a);
|
|
2000
|
+
let w = "";
|
|
2001
|
+
return l.isZero || (w += `${l.days}d `), h.isZero || (w += `${h.hours}h `), y.isZero || (w += `${y.minutes}m `), m.isZero || (w += `${m.seconds}s `), M.isZero || (w += `${M.milliseconds}ms `), S.isZero || (w += `${S.microseconds}µs `), B.isZero || (w += `${B.nanoseconds}ns`), w.trim();
|
|
1917
2002
|
}
|
|
1918
2003
|
toSemanticString() {
|
|
1919
2004
|
const t = this.valueOf() < 0n ? -this.valueOf() : this.valueOf(), n = new g(t), r = this.valueOf() < 0n;
|
|
1920
2005
|
if (n.valueOf() === 0n) return "0s";
|
|
1921
2006
|
if (n.lessThan(g.SECOND)) return "< 1s";
|
|
1922
|
-
const s = n.days, i = n.hours, o = n.minutes, a = n.seconds, u = Math.floor(s /
|
|
2007
|
+
const s = n.days, i = n.hours, o = n.minutes, a = n.seconds, u = Math.floor(s / on), l = Math.floor(s / jt), h = Math.floor(s / 7), y = Math.floor(s), m = Math.floor(i), M = Math.floor(o), S = Math.floor(a), B = r ? "-" : "";
|
|
1923
2008
|
if (u >= 1) {
|
|
1924
|
-
let
|
|
2009
|
+
let w = `${u}y`;
|
|
1925
2010
|
if (u < 2) {
|
|
1926
|
-
const
|
|
1927
|
-
s %
|
|
2011
|
+
const v = Math.floor(
|
|
2012
|
+
s % on / jt
|
|
1928
2013
|
);
|
|
1929
|
-
|
|
2014
|
+
v > 0 && (w += ` ${v}mo`);
|
|
1930
2015
|
}
|
|
1931
|
-
return
|
|
2016
|
+
return B + w;
|
|
1932
2017
|
}
|
|
1933
|
-
if (h >= 1 && s <
|
|
1934
|
-
let
|
|
1935
|
-
const
|
|
1936
|
-
return h < 2 && (
|
|
2018
|
+
if (h >= 1 && s < jt && s % 7 === 0) {
|
|
2019
|
+
let w = `${h}w`;
|
|
2020
|
+
const v = Math.floor(s % 7), Q = Math.floor(i - h * 7 * 24);
|
|
2021
|
+
return h < 2 && (v > 0 ? w += ` ${v}d` : Q > 0 && Q < 24 && (w += ` ${Q}h`)), B + w;
|
|
1937
2022
|
}
|
|
1938
2023
|
if (l >= 1) {
|
|
1939
|
-
let
|
|
2024
|
+
let w = `${l}mo`;
|
|
1940
2025
|
if (l < 3) {
|
|
1941
|
-
const
|
|
1942
|
-
|
|
2026
|
+
const v = Math.floor(s % jt);
|
|
2027
|
+
v > 0 && (w += ` ${v}d`);
|
|
1943
2028
|
}
|
|
1944
|
-
return
|
|
2029
|
+
return B + w;
|
|
1945
2030
|
}
|
|
1946
2031
|
if (h >= 1) {
|
|
1947
|
-
let
|
|
1948
|
-
const
|
|
1949
|
-
return h < 2 && (
|
|
2032
|
+
let w = `${h}w`;
|
|
2033
|
+
const v = Math.floor(s % 7), Q = Math.floor(i - h * 7 * 24);
|
|
2034
|
+
return h < 2 && (v > 0 ? w += ` ${v}d` : Q > 0 && Q < 24 && (w += ` ${Q}h`)), B + w;
|
|
1950
2035
|
}
|
|
1951
2036
|
if (y >= 1) {
|
|
1952
|
-
let
|
|
1953
|
-
const
|
|
1954
|
-
return y < 2 &&
|
|
2037
|
+
let w = `${y}d`;
|
|
2038
|
+
const v = Math.floor(i - y * 24);
|
|
2039
|
+
return y < 2 && v > 0 && (w += ` ${v}h`), B + w;
|
|
1955
2040
|
}
|
|
1956
2041
|
if (m >= 1) {
|
|
1957
|
-
let
|
|
2042
|
+
let w = `${m}h`;
|
|
1958
2043
|
if (m < 3) {
|
|
1959
|
-
const
|
|
1960
|
-
|
|
2044
|
+
const v = Math.floor(o - m * 60);
|
|
2045
|
+
v > 0 && (w += ` ${v}m`);
|
|
1961
2046
|
}
|
|
1962
|
-
return
|
|
2047
|
+
return B + w;
|
|
1963
2048
|
}
|
|
1964
|
-
if (
|
|
1965
|
-
let
|
|
1966
|
-
if (
|
|
1967
|
-
const
|
|
1968
|
-
|
|
2049
|
+
if (M >= 1) {
|
|
2050
|
+
let w = `${M}m`;
|
|
2051
|
+
if (M < 5) {
|
|
2052
|
+
const v = Math.floor(a - M * 60);
|
|
2053
|
+
v > 0 && (w += ` ${v}s`);
|
|
1969
2054
|
}
|
|
1970
|
-
return
|
|
2055
|
+
return B + w;
|
|
1971
2056
|
}
|
|
1972
|
-
return `${
|
|
2057
|
+
return `${B}${S}s`;
|
|
1973
2058
|
}
|
|
1974
2059
|
/**
|
|
1975
2060
|
* Multiplies the TimeSpan by a scalar value.
|
|
@@ -1978,7 +2063,7 @@ class g extends rt {
|
|
|
1978
2063
|
* @returns A new TimeSpan that is this TimeSpan multiplied by the provided value.
|
|
1979
2064
|
*/
|
|
1980
2065
|
mult(t) {
|
|
1981
|
-
return new g(
|
|
2066
|
+
return new g(R(this.valueOf(), t));
|
|
1982
2067
|
}
|
|
1983
2068
|
/**
|
|
1984
2069
|
* Divides the TimeSpan by a scalar value.
|
|
@@ -2067,7 +2152,7 @@ class g extends rt {
|
|
|
2067
2152
|
* @returns A TimeSpan representing the given number of microseconds.
|
|
2068
2153
|
*/
|
|
2069
2154
|
static microseconds(t = 1) {
|
|
2070
|
-
return g.nanoseconds(
|
|
2155
|
+
return g.nanoseconds(R(t, 1e3));
|
|
2071
2156
|
}
|
|
2072
2157
|
/** A microsecond. */
|
|
2073
2158
|
static MICROSECOND = g.microseconds(1);
|
|
@@ -2078,7 +2163,7 @@ class g extends rt {
|
|
|
2078
2163
|
* @returns A TimeSpan representing the given number of milliseconds.
|
|
2079
2164
|
*/
|
|
2080
2165
|
static milliseconds(t = 1) {
|
|
2081
|
-
return g.microseconds(
|
|
2166
|
+
return g.microseconds(R(t, 1e3));
|
|
2082
2167
|
}
|
|
2083
2168
|
/** A millisecond. */
|
|
2084
2169
|
static MILLISECOND = g.milliseconds(1);
|
|
@@ -2089,7 +2174,7 @@ class g extends rt {
|
|
|
2089
2174
|
* @returns A TimeSpan representing the given number of seconds.
|
|
2090
2175
|
*/
|
|
2091
2176
|
static seconds(t = 1) {
|
|
2092
|
-
return g.milliseconds(
|
|
2177
|
+
return g.milliseconds(R(t, 1e3));
|
|
2093
2178
|
}
|
|
2094
2179
|
/** A second. */
|
|
2095
2180
|
static SECOND = g.seconds(1);
|
|
@@ -2100,7 +2185,7 @@ class g extends rt {
|
|
|
2100
2185
|
* @returns A TimeSpan representing the given number of minutes.
|
|
2101
2186
|
*/
|
|
2102
2187
|
static minutes(t = 1) {
|
|
2103
|
-
return g.seconds(
|
|
2188
|
+
return g.seconds(R(t, 60));
|
|
2104
2189
|
}
|
|
2105
2190
|
/** A minute. */
|
|
2106
2191
|
static MINUTE = g.minutes(1);
|
|
@@ -2111,7 +2196,7 @@ class g extends rt {
|
|
|
2111
2196
|
* @returns A TimeSpan representing the given number of hours.
|
|
2112
2197
|
*/
|
|
2113
2198
|
static hours(t) {
|
|
2114
|
-
return g.minutes(
|
|
2199
|
+
return g.minutes(R(t, 60));
|
|
2115
2200
|
}
|
|
2116
2201
|
/** Represents an hour. */
|
|
2117
2202
|
static HOUR = g.hours(1);
|
|
@@ -2122,12 +2207,12 @@ class g extends rt {
|
|
|
2122
2207
|
* @returns A TimeSpan representing the given number of days.
|
|
2123
2208
|
*/
|
|
2124
2209
|
static days(t) {
|
|
2125
|
-
return g.hours(
|
|
2210
|
+
return g.hours(R(t, 24));
|
|
2126
2211
|
}
|
|
2127
2212
|
/** Represents a day. */
|
|
2128
2213
|
static DAY = g.days(1);
|
|
2129
2214
|
/** The maximum possible value for a TimeSpan. */
|
|
2130
|
-
static MAX = new g(
|
|
2215
|
+
static MAX = new g(qt);
|
|
2131
2216
|
/** The minimum possible value for a TimeSpan. */
|
|
2132
2217
|
static MIN = new g(0);
|
|
2133
2218
|
/** The zero value for a TimeSpan. */
|
|
@@ -2140,12 +2225,12 @@ class g extends rt {
|
|
|
2140
2225
|
c.bigint().transform((t) => new g(t)),
|
|
2141
2226
|
c.instanceof(g),
|
|
2142
2227
|
c.instanceof(d).transform((t) => new g(t)),
|
|
2143
|
-
c.custom((t) => t instanceof
|
|
2228
|
+
c.custom((t) => t instanceof T).transform((t) => new g(t))
|
|
2144
2229
|
]);
|
|
2145
2230
|
}
|
|
2146
|
-
class
|
|
2231
|
+
class T extends st {
|
|
2147
2232
|
constructor(t) {
|
|
2148
|
-
|
|
2233
|
+
C(t) && (t = t.value), super(t.valueOf());
|
|
2149
2234
|
}
|
|
2150
2235
|
/** @returns a pretty string representation of the rate in the format "X Hz". */
|
|
2151
2236
|
toString() {
|
|
@@ -2153,7 +2238,7 @@ class $ extends rt {
|
|
|
2153
2238
|
}
|
|
2154
2239
|
/** @returns The number of seconds in the Rate. */
|
|
2155
2240
|
equals(t) {
|
|
2156
|
-
return this.valueOf() === new
|
|
2241
|
+
return this.valueOf() === new T(t).valueOf();
|
|
2157
2242
|
}
|
|
2158
2243
|
/**
|
|
2159
2244
|
* Calculates the period of the Rate as a TimeSpan.
|
|
@@ -2180,7 +2265,7 @@ class $ extends rt {
|
|
|
2180
2265
|
* @returns The number of bytes in the given TimeSpan at this rate.
|
|
2181
2266
|
*/
|
|
2182
2267
|
byteCount(t, n) {
|
|
2183
|
-
return this.sampleCount(t) * new
|
|
2268
|
+
return this.sampleCount(t) * new O(n).valueOf();
|
|
2184
2269
|
}
|
|
2185
2270
|
/**
|
|
2186
2271
|
* Calculates a TimeSpan given the number of samples at this rate.
|
|
@@ -2199,7 +2284,7 @@ class $ extends rt {
|
|
|
2199
2284
|
* @returns A TimeSpan that corresponds to the given number of bytes.
|
|
2200
2285
|
*/
|
|
2201
2286
|
byteSpan(t, n) {
|
|
2202
|
-
return this.span(t.valueOf() / new
|
|
2287
|
+
return this.span(t.valueOf() / new O(n).valueOf());
|
|
2203
2288
|
}
|
|
2204
2289
|
/**
|
|
2205
2290
|
* Adds another Rate to this Rate.
|
|
@@ -2208,7 +2293,7 @@ class $ extends rt {
|
|
|
2208
2293
|
* @returns A new Rate representing the sum of the two rates.
|
|
2209
2294
|
*/
|
|
2210
2295
|
add(t) {
|
|
2211
|
-
return new
|
|
2296
|
+
return new T(G(this.valueOf(), new T(t).valueOf()));
|
|
2212
2297
|
}
|
|
2213
2298
|
/**
|
|
2214
2299
|
* Subtracts another Rate from this Rate.
|
|
@@ -2217,7 +2302,7 @@ class $ extends rt {
|
|
|
2217
2302
|
* @returns A new Rate representing the difference of the two rates.
|
|
2218
2303
|
*/
|
|
2219
2304
|
sub(t) {
|
|
2220
|
-
return new
|
|
2305
|
+
return new T(F(this.valueOf(), new T(t).valueOf()));
|
|
2221
2306
|
}
|
|
2222
2307
|
/**
|
|
2223
2308
|
* Multiplies this Rate by a scalar value.
|
|
@@ -2226,7 +2311,7 @@ class $ extends rt {
|
|
|
2226
2311
|
* @returns A new Rate representing this Rate multiplied by the value.
|
|
2227
2312
|
*/
|
|
2228
2313
|
mult(t) {
|
|
2229
|
-
return new
|
|
2314
|
+
return new T(R(this.valueOf(), t));
|
|
2230
2315
|
}
|
|
2231
2316
|
/**
|
|
2232
2317
|
* Divides this Rate by a scalar value.
|
|
@@ -2235,7 +2320,7 @@ class $ extends rt {
|
|
|
2235
2320
|
* @returns A new Rate representing this Rate divided by the value.
|
|
2236
2321
|
*/
|
|
2237
2322
|
div(t) {
|
|
2238
|
-
return new
|
|
2323
|
+
return new T(Et(this.valueOf(), t));
|
|
2239
2324
|
}
|
|
2240
2325
|
/**
|
|
2241
2326
|
* Creates a Rate representing the given number of Hz.
|
|
@@ -2244,7 +2329,7 @@ class $ extends rt {
|
|
|
2244
2329
|
* @returns A Rate representing the given number of Hz.
|
|
2245
2330
|
*/
|
|
2246
2331
|
static hz(t) {
|
|
2247
|
-
return new
|
|
2332
|
+
return new T(t);
|
|
2248
2333
|
}
|
|
2249
2334
|
/**
|
|
2250
2335
|
* Creates a Rate representing the given number of kHz.
|
|
@@ -2253,15 +2338,15 @@ class $ extends rt {
|
|
|
2253
2338
|
* @returns A Rate representing the given number of kHz.
|
|
2254
2339
|
*/
|
|
2255
2340
|
static khz(t) {
|
|
2256
|
-
return
|
|
2341
|
+
return T.hz(t * 1e3);
|
|
2257
2342
|
}
|
|
2258
2343
|
/** A zod schema for validating and transforming rates */
|
|
2259
2344
|
static z = c.union([
|
|
2260
|
-
c.number().transform((t) => new
|
|
2261
|
-
c.instanceof(
|
|
2345
|
+
c.number().transform((t) => new T(t)),
|
|
2346
|
+
c.instanceof(T)
|
|
2262
2347
|
]);
|
|
2263
2348
|
}
|
|
2264
|
-
class
|
|
2349
|
+
class O extends st {
|
|
2265
2350
|
/**
|
|
2266
2351
|
* Creates a Density representing the given number of bytes per value.
|
|
2267
2352
|
*
|
|
@@ -2270,7 +2355,7 @@ class x extends rt {
|
|
|
2270
2355
|
* @returns A Density representing the given number of bytes per value.
|
|
2271
2356
|
*/
|
|
2272
2357
|
constructor(t) {
|
|
2273
|
-
|
|
2358
|
+
C(t) && (t = t.value), super(t.valueOf());
|
|
2274
2359
|
}
|
|
2275
2360
|
/**
|
|
2276
2361
|
* Calculates the number of values in the given Size.
|
|
@@ -2297,7 +2382,7 @@ class x extends rt {
|
|
|
2297
2382
|
* @returns A new Density representing the sum of the two densities.
|
|
2298
2383
|
*/
|
|
2299
2384
|
add(t) {
|
|
2300
|
-
return new
|
|
2385
|
+
return new O(G(this.valueOf(), new O(t).valueOf()));
|
|
2301
2386
|
}
|
|
2302
2387
|
/**
|
|
2303
2388
|
* Subtracts another Density from this Density.
|
|
@@ -2306,7 +2391,7 @@ class x extends rt {
|
|
|
2306
2391
|
* @returns A new Density representing the difference of the two densities.
|
|
2307
2392
|
*/
|
|
2308
2393
|
sub(t) {
|
|
2309
|
-
return new
|
|
2394
|
+
return new O(F(this.valueOf(), new O(t).valueOf()));
|
|
2310
2395
|
}
|
|
2311
2396
|
/**
|
|
2312
2397
|
* Multiplies this Density by a scalar value.
|
|
@@ -2315,7 +2400,7 @@ class x extends rt {
|
|
|
2315
2400
|
* @returns A new Density representing this Density multiplied by the value.
|
|
2316
2401
|
*/
|
|
2317
2402
|
mult(t) {
|
|
2318
|
-
return new
|
|
2403
|
+
return new O(R(this.valueOf(), t));
|
|
2319
2404
|
}
|
|
2320
2405
|
/**
|
|
2321
2406
|
* Divides this Density by a scalar value.
|
|
@@ -2324,27 +2409,27 @@ class x extends rt {
|
|
|
2324
2409
|
* @returns A new Density representing this Density divided by the value.
|
|
2325
2410
|
*/
|
|
2326
2411
|
div(t) {
|
|
2327
|
-
return new
|
|
2412
|
+
return new O(Et(this.valueOf(), t));
|
|
2328
2413
|
}
|
|
2329
2414
|
/** Unknown/Invalid Density. */
|
|
2330
|
-
static UNKNOWN = new
|
|
2415
|
+
static UNKNOWN = new O(0);
|
|
2331
2416
|
/** 128 bits per value. */
|
|
2332
|
-
static BIT128 = new
|
|
2417
|
+
static BIT128 = new O(16);
|
|
2333
2418
|
/** 64 bits per value. */
|
|
2334
|
-
static BIT64 = new
|
|
2419
|
+
static BIT64 = new O(8);
|
|
2335
2420
|
/** 32 bits per value. */
|
|
2336
|
-
static BIT32 = new
|
|
2421
|
+
static BIT32 = new O(4);
|
|
2337
2422
|
/** 16 bits per value. */
|
|
2338
|
-
static BIT16 = new
|
|
2423
|
+
static BIT16 = new O(2);
|
|
2339
2424
|
/** 8 bits per value. */
|
|
2340
|
-
static BIT8 = new
|
|
2425
|
+
static BIT8 = new O(1);
|
|
2341
2426
|
/** A zod schema for validating and transforming densities */
|
|
2342
2427
|
static z = c.union([
|
|
2343
|
-
c.number().transform((t) => new
|
|
2344
|
-
c.instanceof(
|
|
2428
|
+
c.number().transform((t) => new O(t)),
|
|
2429
|
+
c.instanceof(O)
|
|
2345
2430
|
]);
|
|
2346
2431
|
}
|
|
2347
|
-
class
|
|
2432
|
+
class A {
|
|
2348
2433
|
/**
|
|
2349
2434
|
* The starting TimeStamp of the TimeRange.
|
|
2350
2435
|
*
|
|
@@ -2412,7 +2497,7 @@ class E {
|
|
|
2412
2497
|
* @returns A TimeRange with the start and end swapped.
|
|
2413
2498
|
*/
|
|
2414
2499
|
swap() {
|
|
2415
|
-
return new
|
|
2500
|
+
return new A(this.end, this.start);
|
|
2416
2501
|
}
|
|
2417
2502
|
get numericBounds() {
|
|
2418
2503
|
return {
|
|
@@ -2468,7 +2553,7 @@ class E {
|
|
|
2468
2553
|
return i.before(s) ? !1 : new g(i.sub(s)).greaterThanOrEqual(n);
|
|
2469
2554
|
}
|
|
2470
2555
|
contains(t) {
|
|
2471
|
-
return t instanceof
|
|
2556
|
+
return t instanceof A ? this.contains(t.start) && this.contains(t.end) : this.start.beforeEq(t) && this.end.after(t);
|
|
2472
2557
|
}
|
|
2473
2558
|
/**
|
|
2474
2559
|
* Returns a new TimeRange that is bound by the given TimeRange.
|
|
@@ -2482,23 +2567,23 @@ class E {
|
|
|
2482
2567
|
* console.log(bounded); // TimeRange(1500, 2000)
|
|
2483
2568
|
*/
|
|
2484
2569
|
boundBy(t) {
|
|
2485
|
-
const n = new
|
|
2570
|
+
const n = new A(this.start, this.end);
|
|
2486
2571
|
return t.start.after(this.start) && (n.start = t.start), t.start.after(this.end) && (n.end = t.start), t.end.before(this.end) && (n.end = t.end), t.end.before(this.start) && (n.start = t.end), n;
|
|
2487
2572
|
}
|
|
2488
2573
|
static max(...t) {
|
|
2489
|
-
return new
|
|
2574
|
+
return new A(
|
|
2490
2575
|
d.min(...t.map((n) => n.start)),
|
|
2491
2576
|
d.max(...t.map((n) => n.end))
|
|
2492
2577
|
);
|
|
2493
2578
|
}
|
|
2494
2579
|
/** The maximum possible time range. */
|
|
2495
|
-
static MAX = new
|
|
2580
|
+
static MAX = new A(d.MIN, d.MAX);
|
|
2496
2581
|
/** A time range whose start and end are both zero. */
|
|
2497
|
-
static ZERO = new
|
|
2582
|
+
static ZERO = new A(d.ZERO, d.ZERO);
|
|
2498
2583
|
/** A zod schema for validating and transforming time ranges */
|
|
2499
2584
|
static z = c.union([
|
|
2500
|
-
c.object({ start: d.z, end: d.z }).transform((t) => new
|
|
2501
|
-
c.instanceof(
|
|
2585
|
+
c.object({ start: d.z, end: d.z }).transform((t) => new A(t.start, t.end)),
|
|
2586
|
+
c.instanceof(A)
|
|
2502
2587
|
]);
|
|
2503
2588
|
/**
|
|
2504
2589
|
* Sorts two time ranges. The range with the earlier start time is considered less than
|
|
@@ -2522,12 +2607,12 @@ class E {
|
|
|
2522
2607
|
* is the minimum of the start times and the end is the maximum of the end times.
|
|
2523
2608
|
*/
|
|
2524
2609
|
static merge(...t) {
|
|
2525
|
-
return
|
|
2610
|
+
return A.max(...t.map((n) => new A(n).makeValid()));
|
|
2526
2611
|
}
|
|
2527
2612
|
}
|
|
2528
|
-
class f extends
|
|
2613
|
+
class f extends st {
|
|
2529
2614
|
constructor(t) {
|
|
2530
|
-
if (
|
|
2615
|
+
if (C(t) && (t = t.value), t instanceof f || typeof t == "string" || typeof t.valueOf() == "string")
|
|
2531
2616
|
super(t.valueOf());
|
|
2532
2617
|
else {
|
|
2533
2618
|
const n = f.ARRAY_CONSTRUCTOR_DATA_TYPES.get(t.constructor.name);
|
|
@@ -2705,20 +2790,20 @@ class f extends rt {
|
|
|
2705
2790
|
[BigInt64Array.name, f.INT64]
|
|
2706
2791
|
]);
|
|
2707
2792
|
static DENSITIES = /* @__PURE__ */ new Map([
|
|
2708
|
-
[f.UINT8.toString(),
|
|
2709
|
-
[f.UINT16.toString(),
|
|
2710
|
-
[f.UINT32.toString(),
|
|
2711
|
-
[f.UINT64.toString(),
|
|
2712
|
-
[f.FLOAT32.toString(),
|
|
2713
|
-
[f.FLOAT64.toString(),
|
|
2714
|
-
[f.INT8.toString(),
|
|
2715
|
-
[f.INT16.toString(),
|
|
2716
|
-
[f.INT32.toString(),
|
|
2717
|
-
[f.INT64.toString(),
|
|
2718
|
-
[f.TIMESTAMP.toString(),
|
|
2719
|
-
[f.STRING.toString(),
|
|
2720
|
-
[f.JSON.toString(),
|
|
2721
|
-
[f.UUID.toString(),
|
|
2793
|
+
[f.UINT8.toString(), O.BIT8],
|
|
2794
|
+
[f.UINT16.toString(), O.BIT16],
|
|
2795
|
+
[f.UINT32.toString(), O.BIT32],
|
|
2796
|
+
[f.UINT64.toString(), O.BIT64],
|
|
2797
|
+
[f.FLOAT32.toString(), O.BIT32],
|
|
2798
|
+
[f.FLOAT64.toString(), O.BIT64],
|
|
2799
|
+
[f.INT8.toString(), O.BIT8],
|
|
2800
|
+
[f.INT16.toString(), O.BIT16],
|
|
2801
|
+
[f.INT32.toString(), O.BIT32],
|
|
2802
|
+
[f.INT64.toString(), O.BIT64],
|
|
2803
|
+
[f.TIMESTAMP.toString(), O.BIT64],
|
|
2804
|
+
[f.STRING.toString(), O.UNKNOWN],
|
|
2805
|
+
[f.JSON.toString(), O.UNKNOWN],
|
|
2806
|
+
[f.UUID.toString(), O.BIT128]
|
|
2722
2807
|
]);
|
|
2723
2808
|
/** All the data types. */
|
|
2724
2809
|
static ALL = [
|
|
@@ -2762,25 +2847,25 @@ class f extends rt {
|
|
|
2762
2847
|
c.instanceof(f)
|
|
2763
2848
|
]);
|
|
2764
2849
|
}
|
|
2765
|
-
class p extends
|
|
2850
|
+
class p extends st {
|
|
2766
2851
|
constructor(t) {
|
|
2767
|
-
|
|
2852
|
+
C(t) && (t = t.value), super(t.valueOf());
|
|
2768
2853
|
}
|
|
2769
2854
|
/** @returns true if the Size is larger than the other size. */
|
|
2770
2855
|
largerThan(t) {
|
|
2771
|
-
return
|
|
2856
|
+
return C(t) && (t = t.value), this.valueOf() > t.valueOf();
|
|
2772
2857
|
}
|
|
2773
2858
|
/** @returns true if the Size is smaller than the other size. */
|
|
2774
2859
|
smallerThan(t) {
|
|
2775
|
-
return
|
|
2860
|
+
return C(t) && (t = t.value), this.valueOf() < t.valueOf();
|
|
2776
2861
|
}
|
|
2777
2862
|
/** @returns a new Size representing the sum of the two Sizes. */
|
|
2778
2863
|
add(t) {
|
|
2779
|
-
return
|
|
2864
|
+
return C(t) && (t = t.value), new p(G(this.valueOf(), t.valueOf()));
|
|
2780
2865
|
}
|
|
2781
2866
|
/** @returns a new Size representing the difference of the two Sizes. */
|
|
2782
2867
|
sub(t) {
|
|
2783
|
-
return
|
|
2868
|
+
return C(t) && (t = t.value), new p(F(this.valueOf(), t.valueOf()));
|
|
2784
2869
|
}
|
|
2785
2870
|
/**
|
|
2786
2871
|
* Multiplies this Size by a scalar value.
|
|
@@ -2789,7 +2874,7 @@ class p extends rt {
|
|
|
2789
2874
|
* @returns A new Size representing this Size multiplied by the value.
|
|
2790
2875
|
*/
|
|
2791
2876
|
mult(t) {
|
|
2792
|
-
return new p(
|
|
2877
|
+
return new p(R(this.valueOf(), t));
|
|
2793
2878
|
}
|
|
2794
2879
|
/**
|
|
2795
2880
|
* Divides this Size by a scalar value.
|
|
@@ -2899,10 +2984,10 @@ class p extends rt {
|
|
|
2899
2984
|
return this.valueOf() === 0;
|
|
2900
2985
|
}
|
|
2901
2986
|
}
|
|
2902
|
-
const
|
|
2987
|
+
const Su = c.object({
|
|
2903
2988
|
start: c.number(),
|
|
2904
2989
|
end: c.number()
|
|
2905
|
-
}),
|
|
2990
|
+
}), Tu = c.union([
|
|
2906
2991
|
c.instanceof(Uint8Array),
|
|
2907
2992
|
c.instanceof(Uint16Array),
|
|
2908
2993
|
c.instanceof(Uint32Array),
|
|
@@ -2913,64 +2998,64 @@ const ju = c.object({
|
|
|
2913
2998
|
c.instanceof(Int16Array),
|
|
2914
2999
|
c.instanceof(Int32Array),
|
|
2915
3000
|
c.instanceof(BigInt64Array)
|
|
2916
|
-
]),
|
|
3001
|
+
]), ar = (e) => {
|
|
2917
3002
|
const t = typeof e;
|
|
2918
3003
|
return t === "string" || t === "number" || t === "boolean" || t === "bigint" || e instanceof d || e instanceof g || e instanceof Date;
|
|
2919
|
-
},
|
|
2920
|
-
function
|
|
2921
|
-
return typeof e == "string" &&
|
|
3004
|
+
}, Ro = (e, t, n, r = 0) => e.usesBigInt && !t.usesBigInt ? Number(n) - Number(r) : !e.usesBigInt && t.usesBigInt ? BigInt(n.valueOf()) - BigInt(r.valueOf()) : F(n, r), Lo = "00000000-0000-0000-0000-000000000000", ko = /^(?:[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;
|
|
3005
|
+
function Zo(e) {
|
|
3006
|
+
return typeof e == "string" && ko.test(e);
|
|
2922
3007
|
}
|
|
2923
|
-
const
|
|
3008
|
+
const E = [];
|
|
2924
3009
|
for (let e = 0; e < 256; ++e)
|
|
2925
|
-
|
|
2926
|
-
function
|
|
2927
|
-
return (
|
|
3010
|
+
E.push((e + 256).toString(16).slice(1));
|
|
3011
|
+
function ur(e, t = 0) {
|
|
3012
|
+
return (E[e[t + 0]] + E[e[t + 1]] + E[e[t + 2]] + E[e[t + 3]] + "-" + E[e[t + 4]] + E[e[t + 5]] + "-" + E[e[t + 6]] + E[e[t + 7]] + "-" + E[e[t + 8]] + E[e[t + 9]] + "-" + E[e[t + 10]] + E[e[t + 11]] + E[e[t + 12]] + E[e[t + 13]] + E[e[t + 14]] + E[e[t + 15]]).toLowerCase();
|
|
2928
3013
|
}
|
|
2929
|
-
function
|
|
2930
|
-
const n =
|
|
2931
|
-
if (!
|
|
3014
|
+
function _o(e, t = 0) {
|
|
3015
|
+
const n = ur(e, t);
|
|
3016
|
+
if (!Zo(n))
|
|
2932
3017
|
throw TypeError("Stringified UUID is invalid");
|
|
2933
3018
|
return n;
|
|
2934
3019
|
}
|
|
2935
3020
|
let re;
|
|
2936
|
-
const
|
|
2937
|
-
function
|
|
3021
|
+
const qo = new Uint8Array(16);
|
|
3022
|
+
function Fo() {
|
|
2938
3023
|
if (!re) {
|
|
2939
3024
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
2940
3025
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
2941
3026
|
re = crypto.getRandomValues.bind(crypto);
|
|
2942
3027
|
}
|
|
2943
|
-
return re(
|
|
3028
|
+
return re(qo);
|
|
2944
3029
|
}
|
|
2945
|
-
const
|
|
2946
|
-
function
|
|
3030
|
+
const Vo = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), cn = { randomUUID: Vo };
|
|
3031
|
+
function Wo(e, t, n) {
|
|
2947
3032
|
e = e || {};
|
|
2948
|
-
const r = e.random ?? e.rng?.() ??
|
|
3033
|
+
const r = e.random ?? e.rng?.() ?? Fo();
|
|
2949
3034
|
if (r.length < 16)
|
|
2950
3035
|
throw new Error("Random bytes length must be >= 16");
|
|
2951
|
-
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128,
|
|
3036
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, ur(r);
|
|
2952
3037
|
}
|
|
2953
|
-
function
|
|
2954
|
-
return
|
|
3038
|
+
function Yo(e, t, n) {
|
|
3039
|
+
return cn.randomUUID && !e ? cn.randomUUID() : Wo(e);
|
|
2955
3040
|
}
|
|
2956
|
-
const
|
|
3041
|
+
const zo = () => Yo(), De = (e, t) => _o(e, t), Go = Lo, $u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2957
3042
|
__proto__: null,
|
|
2958
|
-
ZERO:
|
|
2959
|
-
create:
|
|
3043
|
+
ZERO: Go,
|
|
3044
|
+
create: zo,
|
|
2960
3045
|
parse: De
|
|
2961
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3046
|
+
}, Symbol.toStringTag, { value: "Module" })), J = -1, pe = {
|
|
2962
3047
|
[Symbol.iterator]: () => pe,
|
|
2963
3048
|
next: () => ({ done: !0, value: void 0 })
|
|
2964
|
-
},
|
|
3049
|
+
}, Ho = c.string().transform(
|
|
2965
3050
|
(e) => new Uint8Array(
|
|
2966
3051
|
atob(e).split("").map((t) => t.charCodeAt(0))
|
|
2967
3052
|
).buffer
|
|
2968
|
-
),
|
|
3053
|
+
), Do = c.union([c.null(), c.undefined()]).transform(() => new Uint8Array().buffer), be = 10, lr = (e, t) => {
|
|
2969
3054
|
if (e === "number" && !t.isNumeric)
|
|
2970
3055
|
throw new Error(`cannot convert series of type ${t.toString()} to number`);
|
|
2971
3056
|
if (e === "bigint" && !t.usesBigInt)
|
|
2972
3057
|
throw new Error(`cannot convert series of type ${t.toString()} to bigint`);
|
|
2973
|
-
},
|
|
3058
|
+
}, fr = "sy_x_telem_series";
|
|
2974
3059
|
class q {
|
|
2975
3060
|
/**
|
|
2976
3061
|
* A unique identifier for the series. If specified by the user, it is their
|
|
@@ -2982,7 +3067,7 @@ class q {
|
|
|
2982
3067
|
* A discriminator used for identifying instances of the series class even
|
|
2983
3068
|
* when bundlers mangle the class name.
|
|
2984
3069
|
*/
|
|
2985
|
-
discriminator =
|
|
3070
|
+
discriminator = fr;
|
|
2986
3071
|
/** The data type of the series. */
|
|
2987
3072
|
dataType;
|
|
2988
3073
|
/**
|
|
@@ -2998,7 +3083,7 @@ class q {
|
|
|
2998
3083
|
/** The underlying data. */
|
|
2999
3084
|
_data;
|
|
3000
3085
|
/** The time range occupied by the series' data. */
|
|
3001
|
-
timeRange =
|
|
3086
|
+
timeRange = A.ZERO;
|
|
3002
3087
|
/**
|
|
3003
3088
|
* Alignment defines the location of the series relative to other series in a logical
|
|
3004
3089
|
* group. Useful for defining the position of the series within a channel's data.
|
|
@@ -3015,7 +3100,7 @@ class q {
|
|
|
3015
3100
|
/** A cached maximum value. */
|
|
3016
3101
|
cachedMax;
|
|
3017
3102
|
/** The write position of the buffer. */
|
|
3018
|
-
writePos =
|
|
3103
|
+
writePos = J;
|
|
3019
3104
|
/** Tracks the number of entities currently using this array. */
|
|
3020
3105
|
_refCount = 0;
|
|
3021
3106
|
/** Caches the length of the array for variable length data types. */
|
|
@@ -3027,16 +3112,16 @@ class q {
|
|
|
3027
3112
|
* can be constructed into a series.
|
|
3028
3113
|
*/
|
|
3029
3114
|
static crudeZ = c.object({
|
|
3030
|
-
timeRange:
|
|
3115
|
+
timeRange: A.z.optional(),
|
|
3031
3116
|
dataType: f.z,
|
|
3032
3117
|
alignment: c.coerce.bigint().optional(),
|
|
3033
3118
|
data: c.union([
|
|
3034
|
-
|
|
3035
|
-
|
|
3119
|
+
Ho,
|
|
3120
|
+
Do,
|
|
3036
3121
|
c.instanceof(ArrayBuffer),
|
|
3037
3122
|
c.instanceof(Uint8Array)
|
|
3038
3123
|
]),
|
|
3039
|
-
glBufferUsage:
|
|
3124
|
+
glBufferUsage: Bo.default("static").optional()
|
|
3040
3125
|
});
|
|
3041
3126
|
/**
|
|
3042
3127
|
* A zod schema that validates and constructs a series from it's crude
|
|
@@ -3117,7 +3202,7 @@ class q {
|
|
|
3117
3202
|
* @throws Error if data type cannot be inferred from input
|
|
3118
3203
|
*/
|
|
3119
3204
|
constructor(t) {
|
|
3120
|
-
|
|
3205
|
+
Jo(t) && (t = { data: t }), t.data ??= [];
|
|
3121
3206
|
const {
|
|
3122
3207
|
dataType: n,
|
|
3123
3208
|
timeRange: r,
|
|
@@ -3128,12 +3213,12 @@ class q {
|
|
|
3128
3213
|
key: u = Se(),
|
|
3129
3214
|
data: l
|
|
3130
3215
|
} = t;
|
|
3131
|
-
if (
|
|
3216
|
+
if (hr(l)) {
|
|
3132
3217
|
const m = l;
|
|
3133
3218
|
this.key = m.key, this.dataType = m.dataType, this.sampleOffset = m.sampleOffset, this.gl = m.gl, this._data = m._data, this.timeRange = m.timeRange, this.alignment = m.alignment, this.alignmentMultiple = m.alignmentMultiple, this.cachedMin = m.cachedMin, this.cachedMax = m.cachedMax, this.writePos = m.writePos, this._refCount = m._refCount, this.cachedLength = m.cachedLength;
|
|
3134
3219
|
return;
|
|
3135
3220
|
}
|
|
3136
|
-
const h =
|
|
3221
|
+
const h = ar(l), y = Array.isArray(l);
|
|
3137
3222
|
if (n != null) this.dataType = new f(n);
|
|
3138
3223
|
else {
|
|
3139
3224
|
if (l instanceof ArrayBuffer)
|
|
@@ -3167,20 +3252,20 @@ class q {
|
|
|
3167
3252
|
this._data = new this.dataType.Array([]).buffer;
|
|
3168
3253
|
else {
|
|
3169
3254
|
let m = h ? [l] : l;
|
|
3170
|
-
const
|
|
3171
|
-
(
|
|
3255
|
+
const M = m[0];
|
|
3256
|
+
(M instanceof d || M instanceof Date || M instanceof g) && (m = m.map((S) => new d(S).valueOf())), this.dataType.equals(f.STRING) ? (this.cachedLength = m.length, this._data = new TextEncoder().encode(`${m.join(`
|
|
3172
3257
|
`)}
|
|
3173
3258
|
`).buffer) : this.dataType.equals(f.JSON) ? (this.cachedLength = m.length, this._data = new TextEncoder().encode(
|
|
3174
|
-
`${m.map((
|
|
3259
|
+
`${m.map((S) => xt.encodeString(S)).join(`
|
|
3175
3260
|
`)}
|
|
3176
3261
|
`
|
|
3177
|
-
).buffer) : this.dataType.usesBigInt && typeof
|
|
3178
|
-
m.map((
|
|
3179
|
-
).buffer : !this.dataType.usesBigInt && typeof
|
|
3262
|
+
).buffer) : this.dataType.usesBigInt && typeof M == "number" ? this._data = new this.dataType.Array(
|
|
3263
|
+
m.map((S) => BigInt(Math.round(S)))
|
|
3264
|
+
).buffer : !this.dataType.usesBigInt && typeof M == "bigint" ? this._data = new this.dataType.Array(
|
|
3180
3265
|
m.map(Number)
|
|
3181
3266
|
).buffer : this._data = new this.dataType.Array(m).buffer;
|
|
3182
3267
|
}
|
|
3183
|
-
this.key = u, this.alignment = o, this.alignmentMultiple = a, this.sampleOffset = s ?? 0, this.timeRange = r ??
|
|
3268
|
+
this.key = u, this.alignment = o, this.alignmentMultiple = a, this.sampleOffset = s ?? 0, this.timeRange = r ?? A.ZERO, this.gl = {
|
|
3184
3269
|
control: null,
|
|
3185
3270
|
buffer: null,
|
|
3186
3271
|
prevBuffer: 0,
|
|
@@ -3240,12 +3325,12 @@ class q {
|
|
|
3240
3325
|
return this.dataType.isVariable ? this.writeVariable(t) : this.writeFixed(t);
|
|
3241
3326
|
}
|
|
3242
3327
|
writeVariable(t) {
|
|
3243
|
-
if (this.writePos ===
|
|
3328
|
+
if (this.writePos === J) return 0;
|
|
3244
3329
|
const n = this.byteCapacity.valueOf() - this.writePos, r = t.subBytes(0, n);
|
|
3245
3330
|
return this.writeToUnderlyingData(r), this.writePos += r.byteLength.valueOf(), this.cachedLength != null && (this.cachedLength += r.length, this.calculateCachedLength()), r.length;
|
|
3246
3331
|
}
|
|
3247
3332
|
writeFixed(t) {
|
|
3248
|
-
if (this.writePos ===
|
|
3333
|
+
if (this.writePos === J) return 0;
|
|
3249
3334
|
const n = this.capacity - this.writePos, r = t.sub(0, n);
|
|
3250
3335
|
return this.writeToUnderlyingData(r), this.cachedLength = void 0, this.maybeRecomputeMinMax(r), this.writePos += r.length, r.length;
|
|
3251
3336
|
}
|
|
@@ -3268,7 +3353,7 @@ class q {
|
|
|
3268
3353
|
* @returns A typed array containing the series data.
|
|
3269
3354
|
*/
|
|
3270
3355
|
get data() {
|
|
3271
|
-
return this.writePos ===
|
|
3356
|
+
return this.writePos === J ? this.underlyingData : new this.dataType.Array(this._data, 0, this.writePos);
|
|
3272
3357
|
}
|
|
3273
3358
|
/**
|
|
3274
3359
|
* Returns an array of the values in the series as strings.
|
|
@@ -3289,7 +3374,7 @@ class q {
|
|
|
3289
3374
|
parseJSON(t) {
|
|
3290
3375
|
if (!this.dataType.equals(f.JSON))
|
|
3291
3376
|
throw new Error("cannot parse non-JSON series as JSON");
|
|
3292
|
-
return this.toStrings().map((n) => t.parse(
|
|
3377
|
+
return this.toStrings().map((n) => t.parse(xt.decodeString(n)));
|
|
3293
3378
|
}
|
|
3294
3379
|
/**
|
|
3295
3380
|
* Returns the capacity of the series in bytes.
|
|
@@ -3312,7 +3397,7 @@ class q {
|
|
|
3312
3397
|
* @returns The size of the data in bytes.
|
|
3313
3398
|
*/
|
|
3314
3399
|
get byteLength() {
|
|
3315
|
-
return this.writePos ===
|
|
3400
|
+
return this.writePos === J ? this.byteCapacity : this.dataType.isVariable ? new p(this.writePos) : this.dataType.density.size(this.writePos);
|
|
3316
3401
|
}
|
|
3317
3402
|
/**
|
|
3318
3403
|
* Returns the number of samples in this array.
|
|
@@ -3320,7 +3405,7 @@ class q {
|
|
|
3320
3405
|
* @returns The number of samples in the series.
|
|
3321
3406
|
*/
|
|
3322
3407
|
get length() {
|
|
3323
|
-
return this.cachedLength != null ? this.cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos ===
|
|
3408
|
+
return this.cachedLength != null ? this.cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos === J ? this.byteCapacity.valueOf() / this.dataType.density.valueOf() : this.writePos;
|
|
3324
3409
|
}
|
|
3325
3410
|
calculateCachedLength() {
|
|
3326
3411
|
if (!this.dataType.isVariable)
|
|
@@ -3344,7 +3429,7 @@ class q {
|
|
|
3344
3429
|
if (this.dataType.equals(t)) return this;
|
|
3345
3430
|
const r = new t.Array(this.length);
|
|
3346
3431
|
for (let s = 0; s < this.length; s++)
|
|
3347
|
-
r[s] =
|
|
3432
|
+
r[s] = Ro(this.dataType, t, this.data[s], n);
|
|
3348
3433
|
return new q({
|
|
3349
3434
|
data: r.buffer,
|
|
3350
3435
|
dataType: t,
|
|
@@ -3399,7 +3484,7 @@ class q {
|
|
|
3399
3484
|
}
|
|
3400
3485
|
/** @returns the bounds of the series. */
|
|
3401
3486
|
get bounds() {
|
|
3402
|
-
return
|
|
3487
|
+
return b(Number(this.min), Number(this.max), { makeValid: !1 });
|
|
3403
3488
|
}
|
|
3404
3489
|
maybeRecomputeMinMax(t) {
|
|
3405
3490
|
if (this.cachedMin != null) {
|
|
@@ -3490,7 +3575,7 @@ class q {
|
|
|
3490
3575
|
throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");
|
|
3491
3576
|
const { buffer: n, bufferUsage: r, prevBuffer: s } = this.gl;
|
|
3492
3577
|
if (n == null && (this.gl.buffer = t.createBuffer()), this.writePos !== s)
|
|
3493
|
-
if (t.bindBuffer(t.ARRAY_BUFFER, this.gl.buffer), this.writePos !==
|
|
3578
|
+
if (t.bindBuffer(t.ARRAY_BUFFER, this.gl.buffer), this.writePos !== J) {
|
|
3494
3579
|
s === 0 && t.bufferData(t.ARRAY_BUFFER, this.byteCapacity.valueOf(), t.STATIC_DRAW);
|
|
3495
3580
|
const i = this.dataType.density.size(s).valueOf(), o = this.underlyingData.slice(this.gl.prevBuffer, this.writePos);
|
|
3496
3581
|
t.bufferSubData(t.ARRAY_BUFFER, i, o.buffer), this.gl.prevBuffer = this.writePos;
|
|
@@ -3499,10 +3584,10 @@ class q {
|
|
|
3499
3584
|
t.ARRAY_BUFFER,
|
|
3500
3585
|
this.buffer,
|
|
3501
3586
|
r === "static" ? t.STATIC_DRAW : t.DYNAMIC_DRAW
|
|
3502
|
-
), this.gl.prevBuffer =
|
|
3587
|
+
), this.gl.prevBuffer = J;
|
|
3503
3588
|
}
|
|
3504
3589
|
as(t) {
|
|
3505
|
-
return
|
|
3590
|
+
return lr(t, this.dataType), this;
|
|
3506
3591
|
}
|
|
3507
3592
|
/** @returns a digest containing information about the series. */
|
|
3508
3593
|
get digest() {
|
|
@@ -3511,8 +3596,8 @@ class q {
|
|
|
3511
3596
|
dataType: this.dataType.toString(),
|
|
3512
3597
|
sampleOffset: this.sampleOffset,
|
|
3513
3598
|
alignment: {
|
|
3514
|
-
lower:
|
|
3515
|
-
upper:
|
|
3599
|
+
lower: un(this.alignmentBounds.lower),
|
|
3600
|
+
upper: un(this.alignmentBounds.upper),
|
|
3516
3601
|
multiple: this.alignmentMultiple
|
|
3517
3602
|
},
|
|
3518
3603
|
timeRange: this.timeRange.toString(),
|
|
@@ -3530,7 +3615,7 @@ class q {
|
|
|
3530
3615
|
* is exclusive.
|
|
3531
3616
|
*/
|
|
3532
3617
|
get alignmentBounds() {
|
|
3533
|
-
return
|
|
3618
|
+
return b(
|
|
3534
3619
|
this.alignment,
|
|
3535
3620
|
this.alignment + BigInt(this.length) * this.alignmentMultiple
|
|
3536
3621
|
);
|
|
@@ -3550,10 +3635,10 @@ class q {
|
|
|
3550
3635
|
}
|
|
3551
3636
|
[Symbol.iterator]() {
|
|
3552
3637
|
if (this.dataType.isVariable) {
|
|
3553
|
-
const t = new
|
|
3638
|
+
const t = new Xo(this);
|
|
3554
3639
|
return this.dataType.equals(f.JSON) ? new Je(t) : t;
|
|
3555
3640
|
}
|
|
3556
|
-
return this.dataType.equals(f.UUID) ? new
|
|
3641
|
+
return this.dataType.equals(f.UUID) ? new Ko(this) : new Qo(this);
|
|
3557
3642
|
}
|
|
3558
3643
|
/**
|
|
3559
3644
|
* Returns a slice of the series from start to end.
|
|
@@ -3580,7 +3665,7 @@ class q {
|
|
|
3580
3665
|
* @returns An iterator over the specified range.
|
|
3581
3666
|
*/
|
|
3582
3667
|
subIterator(t, n) {
|
|
3583
|
-
return new
|
|
3668
|
+
return new an(this, t, n ?? this.length);
|
|
3584
3669
|
}
|
|
3585
3670
|
/**
|
|
3586
3671
|
* Returns an iterator over a portion of the series based on alignment.
|
|
@@ -3594,7 +3679,7 @@ class q {
|
|
|
3594
3679
|
), s = Math.ceil(
|
|
3595
3680
|
Number(n - this.alignment) / Number(this.alignmentMultiple)
|
|
3596
3681
|
);
|
|
3597
|
-
return new
|
|
3682
|
+
return new an(this, r, s);
|
|
3598
3683
|
}
|
|
3599
3684
|
subBytes(t, n) {
|
|
3600
3685
|
if (t >= 0 && (n == null || n >= this.byteLength.valueOf())) return this;
|
|
@@ -3629,7 +3714,7 @@ class q {
|
|
|
3629
3714
|
return new q({
|
|
3630
3715
|
data: this.buffer,
|
|
3631
3716
|
dataType: this.dataType,
|
|
3632
|
-
timeRange:
|
|
3717
|
+
timeRange: A.ZERO,
|
|
3633
3718
|
sampleOffset: this.sampleOffset,
|
|
3634
3719
|
glBufferUsage: "static",
|
|
3635
3720
|
alignment: t
|
|
@@ -3653,21 +3738,21 @@ class q {
|
|
|
3653
3738
|
return t += "])", t;
|
|
3654
3739
|
}
|
|
3655
3740
|
}
|
|
3656
|
-
const
|
|
3657
|
-
class
|
|
3741
|
+
const Jo = (e) => e == null ? !1 : Array.isArray(e) || e instanceof ArrayBuffer || ArrayBuffer.isView(e) && !(e instanceof DataView) || e instanceof q ? !0 : ar(e), hr = jn(fr, q);
|
|
3742
|
+
class an {
|
|
3658
3743
|
series;
|
|
3659
3744
|
end;
|
|
3660
3745
|
index;
|
|
3661
3746
|
constructor(t, n, r) {
|
|
3662
3747
|
this.series = t;
|
|
3663
|
-
const s =
|
|
3748
|
+
const s = b(0, t.length + 1);
|
|
3664
3749
|
this.end = le(s, r), this.index = le(s, n);
|
|
3665
3750
|
}
|
|
3666
3751
|
next() {
|
|
3667
3752
|
return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
|
|
3668
3753
|
}
|
|
3669
3754
|
}
|
|
3670
|
-
class
|
|
3755
|
+
class Xo {
|
|
3671
3756
|
series;
|
|
3672
3757
|
index;
|
|
3673
3758
|
decoder;
|
|
@@ -3695,11 +3780,11 @@ class Je {
|
|
|
3695
3780
|
const t = this.wrapped.next();
|
|
3696
3781
|
return t.done === !0 ? { done: !0, value: void 0 } : {
|
|
3697
3782
|
done: !1,
|
|
3698
|
-
value:
|
|
3783
|
+
value: xt.decodeString(t.value, Je.schema)
|
|
3699
3784
|
};
|
|
3700
3785
|
}
|
|
3701
3786
|
}
|
|
3702
|
-
class
|
|
3787
|
+
class Ko {
|
|
3703
3788
|
series;
|
|
3704
3789
|
index;
|
|
3705
3790
|
data;
|
|
@@ -3715,7 +3800,7 @@ class ec {
|
|
|
3715
3800
|
return this.index++, { done: !1, value: t };
|
|
3716
3801
|
}
|
|
3717
3802
|
}
|
|
3718
|
-
class
|
|
3803
|
+
class Qo {
|
|
3719
3804
|
series;
|
|
3720
3805
|
index;
|
|
3721
3806
|
constructor(t) {
|
|
@@ -3728,7 +3813,7 @@ class nc {
|
|
|
3728
3813
|
};
|
|
3729
3814
|
}
|
|
3730
3815
|
}
|
|
3731
|
-
class
|
|
3816
|
+
class Uu {
|
|
3732
3817
|
/** The array of series in this collection */
|
|
3733
3818
|
series;
|
|
3734
3819
|
/**
|
|
@@ -3781,7 +3866,7 @@ class Ru {
|
|
|
3781
3866
|
this.series = t;
|
|
3782
3867
|
}
|
|
3783
3868
|
as(t) {
|
|
3784
|
-
return
|
|
3869
|
+
return lr(t, this.dataType), this;
|
|
3785
3870
|
}
|
|
3786
3871
|
/**
|
|
3787
3872
|
* Returns the data type of the series in this collection. If the collection is empty,
|
|
@@ -3796,7 +3881,7 @@ class Ru {
|
|
|
3796
3881
|
* series to the end of the last series.
|
|
3797
3882
|
*/
|
|
3798
3883
|
get timeRange() {
|
|
3799
|
-
return this.series.length === 0 ?
|
|
3884
|
+
return this.series.length === 0 ? A.ZERO : new A(
|
|
3800
3885
|
this.series[0].timeRange.start,
|
|
3801
3886
|
this.series[this.series.length - 1].timeRange.end
|
|
3802
3887
|
);
|
|
@@ -3814,7 +3899,7 @@ class Ru {
|
|
|
3814
3899
|
* series + its length. If the collection is empty, returns bounds.construct(0n, 0n).
|
|
3815
3900
|
*/
|
|
3816
3901
|
get alignmentBounds() {
|
|
3817
|
-
return this.series.length === 0 ?
|
|
3902
|
+
return this.series.length === 0 ? b(0n, 0n) : b(
|
|
3818
3903
|
this.series[0].alignmentBounds.lower,
|
|
3819
3904
|
this.series[this.series.length - 1].alignmentBounds.upper
|
|
3820
3905
|
);
|
|
@@ -3823,7 +3908,7 @@ class Ru {
|
|
|
3823
3908
|
const n = () => new Error(
|
|
3824
3909
|
`cannot push a ${t.dataType.toString()} series to a ${this.dataType.toString()} multi-series`
|
|
3825
3910
|
), r = t.dataType.equals(this.dataType);
|
|
3826
|
-
if (
|
|
3911
|
+
if (hr(t)) {
|
|
3827
3912
|
if (this.series.length !== 0 && !r) throw n();
|
|
3828
3913
|
this.series.push(t);
|
|
3829
3914
|
} else {
|
|
@@ -3929,7 +4014,7 @@ class Ru {
|
|
|
3929
4014
|
* Returns the bounds containing the minimum and maximum values across all series.
|
|
3930
4015
|
*/
|
|
3931
4016
|
get bounds() {
|
|
3932
|
-
return
|
|
4017
|
+
return Fn(this.series.map((t) => t.bounds));
|
|
3933
4018
|
}
|
|
3934
4019
|
/**
|
|
3935
4020
|
* Returns the sum of the byte lengths of all series.
|
|
@@ -3956,7 +4041,7 @@ class Ru {
|
|
|
3956
4041
|
*/
|
|
3957
4042
|
traverseAlignment(t, n) {
|
|
3958
4043
|
const r = this.series.map((s) => s.alignmentBounds);
|
|
3959
|
-
return
|
|
4044
|
+
return Vn(r, t, n);
|
|
3960
4045
|
}
|
|
3961
4046
|
/**
|
|
3962
4047
|
* Acquires a reference to the WebGL buffer for all series.
|
|
@@ -3979,7 +4064,7 @@ class Ru {
|
|
|
3979
4064
|
*/
|
|
3980
4065
|
distance(t, n) {
|
|
3981
4066
|
const r = this.series.map((s) => s.alignmentBounds);
|
|
3982
|
-
return
|
|
4067
|
+
return Wn(r, t, n);
|
|
3983
4068
|
}
|
|
3984
4069
|
/**
|
|
3985
4070
|
* Parses a JSON multi-series into an array of values using the provided zod schema.
|
|
@@ -4002,7 +4087,7 @@ class Ru {
|
|
|
4002
4087
|
next() {
|
|
4003
4088
|
return { done: !0, value: void 0 };
|
|
4004
4089
|
}
|
|
4005
|
-
} : new
|
|
4090
|
+
} : new tc(this.series);
|
|
4006
4091
|
}
|
|
4007
4092
|
/**
|
|
4008
4093
|
* Returns an array of the values in the multi-series as strings.
|
|
@@ -4013,7 +4098,7 @@ class Ru {
|
|
|
4013
4098
|
return this.series.flatMap((t) => t.toStrings());
|
|
4014
4099
|
}
|
|
4015
4100
|
}
|
|
4016
|
-
class
|
|
4101
|
+
class tc {
|
|
4017
4102
|
series;
|
|
4018
4103
|
seriesIndex;
|
|
4019
4104
|
internal;
|
|
@@ -4042,16 +4127,16 @@ class se {
|
|
|
4042
4127
|
return this;
|
|
4043
4128
|
}
|
|
4044
4129
|
}
|
|
4045
|
-
const
|
|
4130
|
+
const un = (e) => {
|
|
4046
4131
|
const t = e >> 32n, n = e & 0xffffffffn;
|
|
4047
4132
|
return { domain: t, sample: n };
|
|
4048
|
-
},
|
|
4133
|
+
}, dr = async (e) => await new Promise(
|
|
4049
4134
|
(t) => setTimeout(t, g.fromMilliseconds(e).milliseconds)
|
|
4050
|
-
),
|
|
4135
|
+
), ju = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4051
4136
|
__proto__: null,
|
|
4052
|
-
sleep:
|
|
4137
|
+
sleep: dr
|
|
4053
4138
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4054
|
-
class
|
|
4139
|
+
class ec {
|
|
4055
4140
|
config;
|
|
4056
4141
|
retries;
|
|
4057
4142
|
interval;
|
|
@@ -4060,7 +4145,7 @@ class sc {
|
|
|
4060
4145
|
baseInterval: new g(t?.baseInterval ?? g.seconds(1)),
|
|
4061
4146
|
maxRetries: t?.maxRetries ?? 5,
|
|
4062
4147
|
scale: t?.scale ?? 1,
|
|
4063
|
-
sleepFn: t?.sleepFn ??
|
|
4148
|
+
sleepFn: t?.sleepFn ?? dr
|
|
4064
4149
|
}, this.retries = 0, this.interval = new g(this.config.baseInterval);
|
|
4065
4150
|
}
|
|
4066
4151
|
async wait() {
|
|
@@ -4074,80 +4159,80 @@ class sc {
|
|
|
4074
4159
|
this.retries = 0, this.interval = this.config.baseInterval;
|
|
4075
4160
|
}
|
|
4076
4161
|
}
|
|
4077
|
-
const
|
|
4162
|
+
const nc = c.object({
|
|
4078
4163
|
baseInterval: g.z.optional(),
|
|
4079
4164
|
maxRetries: c.number().optional(),
|
|
4080
4165
|
scale: c.number().optional()
|
|
4081
|
-
}),
|
|
4166
|
+
}), Cu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4082
4167
|
__proto__: null,
|
|
4083
|
-
Breaker:
|
|
4084
|
-
breakerConfigZ:
|
|
4085
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4168
|
+
Breaker: ec,
|
|
4169
|
+
breakerConfigZ: nc
|
|
4170
|
+
}, Symbol.toStringTag, { value: "Module" })), rc = (e) => c.object({
|
|
4086
4171
|
variant: c.enum(["set", "delete"]),
|
|
4087
4172
|
key: c.string(),
|
|
4088
4173
|
value: e
|
|
4089
|
-
}),
|
|
4174
|
+
}), Bu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4090
4175
|
__proto__: null,
|
|
4091
|
-
Z:
|
|
4092
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4176
|
+
Z: rc
|
|
4177
|
+
}, Symbol.toStringTag, { value: "Module" })), sc = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Yt = c.string().regex(sc), H = c.number().min(0).max(255), Xe = c.number().min(0).max(1), Qt = c.tuple([H, H, H, Xe]), ic = c.tuple([H, H, H]), oc = c.object({ rgba255: Qt }), cc = c.object({ r: H, g: H, b: H, a: Xe }), ac = c.number().min(0).max(360), uc = c.number().min(0).max(100), lc = c.number().min(0).max(100), gr = c.tuple([ac, uc, lc, Xe]), te = c.union([Yt, ic, Qt, gr, oc, cc]), St = te.transform((e) => I(e)), fc = (e) => St.safeParse(e).success, hc = (e) => Qt.safeParse(e).success, dc = ((e) => {
|
|
4093
4178
|
if (e == null) return;
|
|
4094
|
-
const t =
|
|
4179
|
+
const t = St.safeParse(e);
|
|
4095
4180
|
if (t.success) return mr(t.data);
|
|
4096
4181
|
if (typeof e == "string") return e;
|
|
4097
4182
|
throw t.error;
|
|
4098
|
-
}),
|
|
4099
|
-
if (e =
|
|
4183
|
+
}), I = (e, t = 1) => {
|
|
4184
|
+
if (e = te.parse(e), typeof e == "string") return Zt(e, t);
|
|
4100
4185
|
if (Array.isArray(e)) {
|
|
4101
4186
|
if (e.length < 3 || e.length > 4)
|
|
4102
4187
|
throw new Error(`Invalid color: [${e.join(", ")}]`);
|
|
4103
4188
|
return e.length === 3 ? [...e, t] : e;
|
|
4104
4189
|
}
|
|
4105
|
-
return e.rgba255;
|
|
4190
|
+
return "a" in e && "r" in e ? [e.r, e.g, e.b, e.a] : e.rgba255;
|
|
4106
4191
|
}, yr = (e, t) => {
|
|
4107
4192
|
if (e == null || t == null) return e == t;
|
|
4108
|
-
const n =
|
|
4193
|
+
const n = I(e), r = I(t);
|
|
4109
4194
|
return n.every((s, i) => s === r[i]);
|
|
4110
|
-
},
|
|
4195
|
+
}, gc = ((e) => {
|
|
4111
4196
|
if (e == null) return;
|
|
4112
|
-
const [t, n, r, s] =
|
|
4113
|
-
return `#${
|
|
4197
|
+
const [t, n, r, s] = I(e), i = Math.round(s * 255);
|
|
4198
|
+
return `#${Ct(t)}${Ct(n)}${Ct(r)}${i === 255 ? "" : Ct(i)}`;
|
|
4114
4199
|
}), mr = (e) => {
|
|
4115
|
-
const [t, n, r, s] =
|
|
4200
|
+
const [t, n, r, s] = I(e);
|
|
4116
4201
|
return `rgba(${t}, ${n}, ${r}, ${s})`;
|
|
4117
|
-
},
|
|
4118
|
-
const [t, n, r] =
|
|
4202
|
+
}, yc = (e) => `rgb(${pr(e)})`, pr = (e) => {
|
|
4203
|
+
const [t, n, r] = I(e);
|
|
4119
4204
|
return `${t}, ${n}, ${r}`;
|
|
4120
|
-
},
|
|
4205
|
+
}, mc = (e) => [...Ke(e), Ot(e)], Ke = (e) => [
|
|
4206
|
+
pt(e) / 255,
|
|
4121
4207
|
bt(e) / 255,
|
|
4122
|
-
wt(e) / 255
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
const [n, r, s] = N(e);
|
|
4208
|
+
wt(e) / 255
|
|
4209
|
+
], pt = (e) => I(e)[0], bt = (e) => I(e)[1], wt = (e) => I(e)[2], Ot = (e) => I(e)[3], pc = (e) => yr(Qe, e), bc = (e) => Ec(I(e)), wc = (e, t) => {
|
|
4210
|
+
const [n, r, s] = I(e);
|
|
4126
4211
|
if (t > 100)
|
|
4127
4212
|
throw new Error(`Color opacity must be between 0 and 100, got ${t}`);
|
|
4128
4213
|
return t > 1 && (t /= 100), [n, r, s, t];
|
|
4129
4214
|
}, vt = (e) => {
|
|
4130
|
-
const [t, n, r] =
|
|
4215
|
+
const [t, n, r] = Ke(e).map(
|
|
4131
4216
|
(s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
|
|
4132
4217
|
);
|
|
4133
4218
|
return Number((0.2126 * t + 0.7152 * n + 0.0722 * r).toFixed(3));
|
|
4134
|
-
},
|
|
4135
|
-
const [t, n, r] =
|
|
4219
|
+
}, Oc = (e) => {
|
|
4220
|
+
const [t, n, r] = Ke(e);
|
|
4136
4221
|
return 1 - (Math.max(t, n, r) - Math.min(t, n, r));
|
|
4137
4222
|
}, we = (e, t) => {
|
|
4138
|
-
const n =
|
|
4223
|
+
const n = I(e), r = I(t), s = vt(n), i = vt(r);
|
|
4139
4224
|
return (Math.max(s, i) + 0.5) / (Math.min(s, i) + 0.5);
|
|
4140
|
-
},
|
|
4225
|
+
}, xc = (e, ...t) => {
|
|
4141
4226
|
if (t.length === 0)
|
|
4142
4227
|
throw new Error("[Color.pickByContrast] - must provide at least one color");
|
|
4143
|
-
const n =
|
|
4144
|
-
return
|
|
4145
|
-
},
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
e.length === 8 ?
|
|
4150
|
-
]),
|
|
4228
|
+
const n = I(e), [r] = t.sort((s, i) => we(n, i) - we(n, s));
|
|
4229
|
+
return I(r);
|
|
4230
|
+
}, Ic = (e) => vt(e) < 0.5, Nc = (e) => vt(e) > 0.5, Zt = (e, t = 1) => (e = Yt.parse(e), e = vc(e), [
|
|
4231
|
+
Bt(e, 0),
|
|
4232
|
+
Bt(e, 2),
|
|
4233
|
+
Bt(e, 4),
|
|
4234
|
+
e.length === 8 ? Bt(e, 6) / 255 : t
|
|
4235
|
+
]), Qe = [0, 0, 0, 0], Ct = (e) => Math.floor(e).toString(16).padStart(2, "0"), Bt = (e, t) => parseInt(e.slice(t, t + 2), 16), vc = (e) => e.startsWith("#") ? e.slice(1) : e, ln = {
|
|
4151
4236
|
black: "#000000",
|
|
4152
4237
|
white: "#ffffff",
|
|
4153
4238
|
red: "#ff0000",
|
|
@@ -4179,16 +4264,16 @@ const ic = c.object({
|
|
|
4179
4264
|
khaki: "#f0e68c",
|
|
4180
4265
|
crimson: "#dc143c",
|
|
4181
4266
|
transparent: "transparent"
|
|
4182
|
-
},
|
|
4267
|
+
}, Mc = (e) => {
|
|
4183
4268
|
if (!e) return;
|
|
4184
4269
|
const t = e.trim().toLowerCase();
|
|
4185
4270
|
if (!(t === "transparent" || t === "none")) {
|
|
4186
4271
|
if (t.startsWith("#")) {
|
|
4187
4272
|
if (t.length === 4) {
|
|
4188
4273
|
const n = t[1], r = t[2], s = t[3], i = `#${n}${n}${r}${r}${s}${s}`;
|
|
4189
|
-
if (
|
|
4274
|
+
if (Yt.safeParse(i).success) return Zt(i);
|
|
4190
4275
|
}
|
|
4191
|
-
return (t.length === 7 || t.length === 9) &&
|
|
4276
|
+
return (t.length === 7 || t.length === 9) && Yt.safeParse(t).success ? Zt(t) : void 0;
|
|
4192
4277
|
}
|
|
4193
4278
|
if (t.startsWith("rgb")) {
|
|
4194
4279
|
const n = t.match(
|
|
@@ -4199,9 +4284,9 @@ const ic = c.object({
|
|
|
4199
4284
|
return [parseInt(r), parseInt(s), parseInt(i), o ? parseFloat(o) : 1];
|
|
4200
4285
|
}
|
|
4201
4286
|
}
|
|
4202
|
-
if (
|
|
4287
|
+
if (ln[t]) return Zt(ln[t]);
|
|
4203
4288
|
}
|
|
4204
|
-
},
|
|
4289
|
+
}, Ac = (e) => {
|
|
4205
4290
|
e = gr.parse(e);
|
|
4206
4291
|
let [t, n, r] = e;
|
|
4207
4292
|
const s = e[3];
|
|
@@ -4214,8 +4299,8 @@ const ic = c.object({
|
|
|
4214
4299
|
i = ie(l, u, t + 1 / 3), o = ie(l, u, t), a = ie(l, u, t - 1 / 3);
|
|
4215
4300
|
}
|
|
4216
4301
|
return [Math.round(i * 255), Math.round(o * 255), Math.round(a * 255), s];
|
|
4217
|
-
}, ie = (e, t, n) => (n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e),
|
|
4218
|
-
e =
|
|
4302
|
+
}, ie = (e, t, n) => (n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? e + (t - e) * 6 * n : n < 1 / 2 ? t : n < 2 / 3 ? e + (t - e) * (2 / 3 - n) * 6 : e), Ec = (e) => {
|
|
4303
|
+
e = Qt.parse(e);
|
|
4219
4304
|
let [t, n, r] = e;
|
|
4220
4305
|
const s = e[3];
|
|
4221
4306
|
t /= 255, n /= 255, r /= 255;
|
|
@@ -4228,76 +4313,76 @@ const ic = c.object({
|
|
|
4228
4313
|
u = l > 0.5 ? h / (2 - i - o) : h / (i + o), i === t ? a = (n - r) / h + (n < r ? 6 : 0) : i === n ? a = (r - t) / h + 2 : a = (t - n) / h + 4, a /= 6;
|
|
4229
4314
|
}
|
|
4230
4315
|
return a *= 360, u *= 100, l *= 100, [Math.round(a), Math.round(u), Math.round(l), s];
|
|
4231
|
-
},
|
|
4316
|
+
}, Sc = I("#000000"), Tc = I("#ffffff"), br = c.object({
|
|
4232
4317
|
key: c.string(),
|
|
4233
|
-
color:
|
|
4318
|
+
color: te,
|
|
4234
4319
|
position: c.number(),
|
|
4235
4320
|
switched: c.boolean().optional()
|
|
4236
|
-
}),
|
|
4237
|
-
if (e.length === 0) return
|
|
4238
|
-
if (e = e.slice().sort((n, r) => n.position - r.position), t <= e[0].position) return
|
|
4321
|
+
}), $c = c.array(br), Uc = (e, t) => {
|
|
4322
|
+
if (e.length === 0) return Qe;
|
|
4323
|
+
if (e = e.slice().sort((n, r) => n.position - r.position), t <= e[0].position) return I(e[0].color);
|
|
4239
4324
|
if (t >= e[e.length - 1].position)
|
|
4240
|
-
return
|
|
4325
|
+
return I(e[e.length - 1].color);
|
|
4241
4326
|
for (let n = 0; n < e.length - 1; n++) {
|
|
4242
4327
|
const r = e[n], s = e[n + 1];
|
|
4243
4328
|
if (t < r.position || t > s.position) continue;
|
|
4244
|
-
if (t === r.position) return
|
|
4245
|
-
if (t === s.position) return
|
|
4246
|
-
const i = (t - r.position) / (s.position - r.position), o =
|
|
4247
|
-
|
|
4329
|
+
if (t === r.position) return I(r.color);
|
|
4330
|
+
if (t === s.position) return I(s.color);
|
|
4331
|
+
const i = (t - r.position) / (s.position - r.position), o = I(r.color), a = I(s.color), u = Math.round(
|
|
4332
|
+
pt(o) + i * (pt(a) - pt(o))
|
|
4248
4333
|
), l = Math.round(
|
|
4249
|
-
|
|
4334
|
+
bt(o) + i * (bt(a) - bt(o))
|
|
4250
4335
|
), h = Math.round(
|
|
4251
|
-
|
|
4252
|
-
), y =
|
|
4253
|
-
return
|
|
4336
|
+
wt(o) + i * (wt(a) - wt(o))
|
|
4337
|
+
), y = Ot(o) + i * (Ot(a) - Ot(o));
|
|
4338
|
+
return I([u, l, h, y]);
|
|
4254
4339
|
}
|
|
4255
|
-
return
|
|
4256
|
-
},
|
|
4340
|
+
return I(e[e.length - 1].color);
|
|
4341
|
+
}, jc = c.object({
|
|
4257
4342
|
key: c.string(),
|
|
4258
4343
|
name: c.string(),
|
|
4259
|
-
color:
|
|
4260
|
-
}),
|
|
4344
|
+
color: St
|
|
4345
|
+
}), Cc = c.object({
|
|
4261
4346
|
key: c.string(),
|
|
4262
4347
|
name: c.string(),
|
|
4263
|
-
swatches: c.array(
|
|
4264
|
-
}),
|
|
4348
|
+
swatches: c.array(jc)
|
|
4349
|
+
}), Pu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4265
4350
|
__proto__: null,
|
|
4266
|
-
BLACK:
|
|
4267
|
-
WHITE:
|
|
4268
|
-
ZERO:
|
|
4269
|
-
aValue:
|
|
4270
|
-
bValue:
|
|
4271
|
-
colorZ:
|
|
4272
|
-
construct:
|
|
4351
|
+
BLACK: Sc,
|
|
4352
|
+
WHITE: Tc,
|
|
4353
|
+
ZERO: Qe,
|
|
4354
|
+
aValue: Ot,
|
|
4355
|
+
bValue: wt,
|
|
4356
|
+
colorZ: St,
|
|
4357
|
+
construct: I,
|
|
4273
4358
|
contrast: we,
|
|
4274
|
-
crudeZ:
|
|
4275
|
-
cssString:
|
|
4359
|
+
crudeZ: te,
|
|
4360
|
+
cssString: dc,
|
|
4276
4361
|
equals: yr,
|
|
4277
|
-
fromCSS:
|
|
4278
|
-
fromGradient:
|
|
4279
|
-
fromHSLA:
|
|
4280
|
-
gValue:
|
|
4281
|
-
gradientZ:
|
|
4282
|
-
grayness:
|
|
4283
|
-
hex:
|
|
4284
|
-
hsla:
|
|
4285
|
-
isColor:
|
|
4286
|
-
isCrude:
|
|
4287
|
-
isDark:
|
|
4288
|
-
isLight:
|
|
4289
|
-
isZero:
|
|
4362
|
+
fromCSS: Mc,
|
|
4363
|
+
fromGradient: Uc,
|
|
4364
|
+
fromHSLA: Ac,
|
|
4365
|
+
gValue: bt,
|
|
4366
|
+
gradientZ: $c,
|
|
4367
|
+
grayness: Oc,
|
|
4368
|
+
hex: gc,
|
|
4369
|
+
hsla: bc,
|
|
4370
|
+
isColor: hc,
|
|
4371
|
+
isCrude: fc,
|
|
4372
|
+
isDark: Ic,
|
|
4373
|
+
isLight: Nc,
|
|
4374
|
+
isZero: pc,
|
|
4290
4375
|
luminance: vt,
|
|
4291
|
-
paletteZ:
|
|
4292
|
-
pickByContrast:
|
|
4293
|
-
rValue:
|
|
4294
|
-
rgbCSS:
|
|
4376
|
+
paletteZ: Cc,
|
|
4377
|
+
pickByContrast: xc,
|
|
4378
|
+
rValue: pt,
|
|
4379
|
+
rgbCSS: yc,
|
|
4295
4380
|
rgbString: pr,
|
|
4296
|
-
rgba1:
|
|
4381
|
+
rgba1: mc,
|
|
4297
4382
|
rgbaCSS: mr,
|
|
4298
|
-
setAlpha:
|
|
4383
|
+
setAlpha: wc,
|
|
4299
4384
|
stopZ: br
|
|
4300
|
-
}, Symbol.toStringTag, { value: "Module" })), wr = c.int().min(0).max(255), Or = 255, xr = 0,
|
|
4385
|
+
}, Symbol.toStringTag, { value: "Module" })), wr = c.int().min(0).max(255), Or = 255, xr = 0, Bc = {
|
|
4301
4386
|
lower: xr,
|
|
4302
4387
|
upper: Or + 1
|
|
4303
4388
|
}, Ir = c.object({
|
|
@@ -4307,7 +4392,7 @@ const ic = c.object({
|
|
|
4307
4392
|
subject: Ir,
|
|
4308
4393
|
resource: e,
|
|
4309
4394
|
authority: wr
|
|
4310
|
-
}),
|
|
4395
|
+
}), Pc = (...e) => (t) => t.filter((n) => {
|
|
4311
4396
|
let r = !1;
|
|
4312
4397
|
return n.to != null && (r = e.includes(n.to.resource)), n.from != null && !r && (r = e.includes(n.from.resource)), r;
|
|
4313
4398
|
}), Nr = (e) => c.object({
|
|
@@ -4316,26 +4401,26 @@ const ic = c.object({
|
|
|
4316
4401
|
}), vr = (e) => c.object({
|
|
4317
4402
|
from: c.null(),
|
|
4318
4403
|
to: Mt(e)
|
|
4319
|
-
}),
|
|
4404
|
+
}), Rc = (e) => c.union([
|
|
4320
4405
|
Nr(e),
|
|
4321
4406
|
vr(e),
|
|
4322
4407
|
c.object({
|
|
4323
4408
|
from: Mt(e),
|
|
4324
4409
|
to: Mt(e)
|
|
4325
4410
|
})
|
|
4326
|
-
]),
|
|
4411
|
+
]), Ru = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4327
4412
|
__proto__: null,
|
|
4328
4413
|
ABSOLUTE_AUTHORITY: Or,
|
|
4329
|
-
AUTHORITY_BOUNDS:
|
|
4414
|
+
AUTHORITY_BOUNDS: Bc,
|
|
4330
4415
|
ZERO_AUTHORITY: xr,
|
|
4331
4416
|
acquireZ: vr,
|
|
4332
4417
|
authorityZ: wr,
|
|
4333
|
-
filterTransfersByChannelKey:
|
|
4418
|
+
filterTransfersByChannelKey: Pc,
|
|
4334
4419
|
releaseZ: Nr,
|
|
4335
4420
|
stateZ: Mt,
|
|
4336
4421
|
subjectZ: Ir,
|
|
4337
|
-
transferZ:
|
|
4338
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4422
|
+
transferZ: Rc
|
|
4423
|
+
}, Symbol.toStringTag, { value: "Module" })), Lc = (e) => {
|
|
4339
4424
|
switch (typeof e) {
|
|
4340
4425
|
case "bigint":
|
|
4341
4426
|
case "number":
|
|
@@ -4347,26 +4432,26 @@ const ic = c.object({
|
|
|
4347
4432
|
case "string":
|
|
4348
4433
|
case "symbol":
|
|
4349
4434
|
case "function":
|
|
4350
|
-
return
|
|
4435
|
+
return fn(e.toString());
|
|
4351
4436
|
case "object":
|
|
4352
|
-
return e == null ? "" :
|
|
4437
|
+
return e == null ? "" : fn(JSON.stringify(e));
|
|
4353
4438
|
}
|
|
4354
|
-
},
|
|
4439
|
+
}, kc = /[",\n]/, fn = (e) => kc.test(e) ? `"${e.replace(/"/g, '""')}"` : e, Lu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4355
4440
|
__proto__: null,
|
|
4356
|
-
formatValue:
|
|
4357
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4441
|
+
formatValue: Lc
|
|
4442
|
+
}, Symbol.toStringTag, { value: "Module" })), ku = (e, t) => {
|
|
4358
4443
|
let n = null;
|
|
4359
4444
|
return t === 0 ? e : (...s) => {
|
|
4360
4445
|
n !== null && (clearTimeout(n), n = null), n = setTimeout(() => e(...s), t);
|
|
4361
4446
|
};
|
|
4362
|
-
},
|
|
4447
|
+
}, Zu = (e, t) => {
|
|
4363
4448
|
let n = null;
|
|
4364
4449
|
return t === 0 ? e : (...s) => {
|
|
4365
4450
|
n === null && (n = setTimeout(() => {
|
|
4366
4451
|
e(...s), n = null;
|
|
4367
4452
|
}, t));
|
|
4368
4453
|
};
|
|
4369
|
-
},
|
|
4454
|
+
}, Zc = (e) => {
|
|
4370
4455
|
try {
|
|
4371
4456
|
return structuredClone(e);
|
|
4372
4457
|
} catch {
|
|
@@ -4375,7 +4460,7 @@ const ic = c.object({
|
|
|
4375
4460
|
e
|
|
4376
4461
|
), console.trace(), JSON.parse(JSON.stringify(e));
|
|
4377
4462
|
}
|
|
4378
|
-
},
|
|
4463
|
+
}, _c = (e, t, n = "") => {
|
|
4379
4464
|
const r = {}, s = (i, o, a) => {
|
|
4380
4465
|
if (typeof i != typeof o || i === null || o === null) {
|
|
4381
4466
|
r[a] = [i, o];
|
|
@@ -4431,7 +4516,7 @@ const ic = c.object({
|
|
|
4431
4516
|
} else if (i !== o) return !1;
|
|
4432
4517
|
}
|
|
4433
4518
|
return !0;
|
|
4434
|
-
},
|
|
4519
|
+
}, j = ".", Ar = (e, t, n = j) => {
|
|
4435
4520
|
const r = e.split(n);
|
|
4436
4521
|
return r.map((i, o) => {
|
|
4437
4522
|
const a = t(i, o, r);
|
|
@@ -4444,17 +4529,17 @@ const ic = c.object({
|
|
|
4444
4529
|
const r = e[0];
|
|
4445
4530
|
if (typeof r == "object" && "key" in r)
|
|
4446
4531
|
return e.find((s) => s.key === t);
|
|
4447
|
-
},
|
|
4448
|
-
const n = e.split(
|
|
4532
|
+
}, qc = (e, t) => {
|
|
4533
|
+
const n = e.split(j);
|
|
4449
4534
|
return n.forEach((r, s) => {
|
|
4450
4535
|
t = dt(t, r), t != null && typeof t == "object" && "key" in t && (n[s] = t.key);
|
|
4451
|
-
}), n.join(
|
|
4452
|
-
},
|
|
4453
|
-
const n = e.split(
|
|
4536
|
+
}), n.join(j);
|
|
4537
|
+
}, Fc = (e, t) => {
|
|
4538
|
+
const n = e.split(j);
|
|
4454
4539
|
return t < 0 ? n[n.length + t] : n[t];
|
|
4455
|
-
},
|
|
4540
|
+
}, Vc = (e, t) => {
|
|
4456
4541
|
if (t.length === 0) return !0;
|
|
4457
|
-
const n = e.split(
|
|
4542
|
+
const n = e.split(j), r = t.split(j);
|
|
4458
4543
|
if (r.length > n.length) return !1;
|
|
4459
4544
|
for (let s = 0; s < r.length; s++) {
|
|
4460
4545
|
const i = n[s], o = r[s];
|
|
@@ -4462,19 +4547,19 @@ const ic = c.object({
|
|
|
4462
4547
|
return !1;
|
|
4463
4548
|
}
|
|
4464
4549
|
return !0;
|
|
4465
|
-
},
|
|
4550
|
+
}, ot = (e) => {
|
|
4466
4551
|
const t = parseInt(e);
|
|
4467
4552
|
return isNaN(t) || t < 0 || t.toString() !== e ? null : t;
|
|
4468
4553
|
}, xe = (e, t) => {
|
|
4469
4554
|
for (let n = 1; n <= t.length; n++) {
|
|
4470
|
-
const r = t.slice(0, n).join(
|
|
4555
|
+
const r = t.slice(0, n).join(j);
|
|
4471
4556
|
if (dt(e, r) != null) return [r, n];
|
|
4472
4557
|
}
|
|
4473
4558
|
return null;
|
|
4474
|
-
},
|
|
4559
|
+
}, tn = ((e, t, n = { optional: !1 }) => {
|
|
4475
4560
|
const { optional: r, getter: s = dt } = n;
|
|
4476
4561
|
if (t === "") return e;
|
|
4477
|
-
const i = t.split(
|
|
4562
|
+
const i = t.split(j);
|
|
4478
4563
|
if (i.length === 1) {
|
|
4479
4564
|
const a = s(e, i[0]);
|
|
4480
4565
|
if (a === void 0) {
|
|
@@ -4486,7 +4571,7 @@ const ic = c.object({
|
|
|
4486
4571
|
const o = (a, u) => {
|
|
4487
4572
|
if (u >= i.length) return a;
|
|
4488
4573
|
for (let l = i.length - u; l >= 1; l--) {
|
|
4489
|
-
const h = i.slice(u, u + l).join(
|
|
4574
|
+
const h = i.slice(u, u + l).join(j), y = s(a, h);
|
|
4490
4575
|
if (y !== void 0) {
|
|
4491
4576
|
if (u + l === i.length) return y;
|
|
4492
4577
|
if (y === null) {
|
|
@@ -4500,18 +4585,18 @@ const ic = c.object({
|
|
|
4500
4585
|
throw new Error(`Path ${t} does not exist. ${i[u]} is undefined`);
|
|
4501
4586
|
};
|
|
4502
4587
|
return o(e, 0);
|
|
4503
|
-
}),
|
|
4588
|
+
}), Wc = (e, t) => tn(e, t, { optional: !0 }) !== null, Ie = (e, ...t) => {
|
|
4504
4589
|
if (t.length === 0) return e;
|
|
4505
4590
|
const n = t.shift();
|
|
4506
|
-
if (
|
|
4591
|
+
if (at(e) && at(n))
|
|
4507
4592
|
for (const r in n)
|
|
4508
4593
|
try {
|
|
4509
|
-
|
|
4594
|
+
at(n[r]) ? (r in e || Object.assign(e, { [r]: {} }), Ie(e[r], n[r])) : Object.assign(e, { [r]: n[r] });
|
|
4510
4595
|
} catch (s) {
|
|
4511
4596
|
throw s instanceof TypeError ? new TypeError(`.${r}: ${s.message}`) : s;
|
|
4512
4597
|
}
|
|
4513
4598
|
return Ie(e, ...t);
|
|
4514
|
-
},
|
|
4599
|
+
}, Yc = (e, t, n) => {
|
|
4515
4600
|
const r = (s, i, o) => {
|
|
4516
4601
|
if (o.def?.type === "union")
|
|
4517
4602
|
return o.def.options.reduce(
|
|
@@ -4541,8 +4626,8 @@ const ic = c.object({
|
|
|
4541
4626
|
return s;
|
|
4542
4627
|
};
|
|
4543
4628
|
return r({ ...e }, t, n);
|
|
4544
|
-
},
|
|
4545
|
-
const n = t.split(
|
|
4629
|
+
}, zc = (e, t) => {
|
|
4630
|
+
const n = t.split(j);
|
|
4546
4631
|
let r = e, s = 0;
|
|
4547
4632
|
for (; s < n.length; ) {
|
|
4548
4633
|
if (s === n.length - 1) {
|
|
@@ -4571,7 +4656,7 @@ const ic = c.object({
|
|
|
4571
4656
|
const o = r[0];
|
|
4572
4657
|
if (typeof o == "object" && "key" in o)
|
|
4573
4658
|
for (let a = n.length - s; a >= 1; a--) {
|
|
4574
|
-
const u = n.slice(s, s + a).join(
|
|
4659
|
+
const u = n.slice(s, s + a).join(j), l = r.find((h) => h.key === u);
|
|
4575
4660
|
if (l != null) {
|
|
4576
4661
|
if (s + a === n.length) {
|
|
4577
4662
|
const h = r.findIndex((y) => y.key === u);
|
|
@@ -4585,7 +4670,7 @@ const ic = c.object({
|
|
|
4585
4670
|
}
|
|
4586
4671
|
if (!i)
|
|
4587
4672
|
for (let o = n.length - s; o >= 1; o--) {
|
|
4588
|
-
const a = n.slice(s, s + o).join(
|
|
4673
|
+
const a = n.slice(s, s + o).join(j);
|
|
4589
4674
|
if (!Array.isArray(r) && typeof r == "object" && r !== null && a in r) {
|
|
4590
4675
|
if (s + o === n.length) {
|
|
4591
4676
|
delete r[a];
|
|
@@ -4601,8 +4686,8 @@ const ic = c.object({
|
|
|
4601
4686
|
r = o, s++;
|
|
4602
4687
|
}
|
|
4603
4688
|
}
|
|
4604
|
-
},
|
|
4605
|
-
const r = t.split(
|
|
4689
|
+
}, Gc = (e, t, n) => {
|
|
4690
|
+
const r = t.split(j);
|
|
4606
4691
|
let s = e, i = 0;
|
|
4607
4692
|
for (; i < r.length - 1; ) {
|
|
4608
4693
|
const o = xe(s, r.slice(i, r.length - 1));
|
|
@@ -4611,23 +4696,23 @@ const ic = c.object({
|
|
|
4611
4696
|
let u = dt(s, a);
|
|
4612
4697
|
if (u == null) {
|
|
4613
4698
|
const l = r[i];
|
|
4614
|
-
let h =
|
|
4615
|
-
h == null && l.startsWith("-") &&
|
|
4699
|
+
let h = ot(l);
|
|
4700
|
+
h == null && l.startsWith("-") && ot(l.substring(1)) != null && (h = 0), u = h != null ? [] : {}, s[a] = u;
|
|
4616
4701
|
}
|
|
4617
4702
|
s = u;
|
|
4618
4703
|
}
|
|
4619
4704
|
try {
|
|
4620
4705
|
const o = r[r.length - 1];
|
|
4621
4706
|
if (Array.isArray(s)) {
|
|
4622
|
-
let u =
|
|
4707
|
+
let u = ot(o);
|
|
4623
4708
|
if (u == null) {
|
|
4624
4709
|
if (o.startsWith("-")) {
|
|
4625
|
-
const l =
|
|
4710
|
+
const l = ot(o.substring(1));
|
|
4626
4711
|
l != null && (u = s.length - l);
|
|
4627
4712
|
}
|
|
4628
4713
|
if (u == null) {
|
|
4629
4714
|
if (s.length === 0) {
|
|
4630
|
-
const h =
|
|
4715
|
+
const h = ot(o);
|
|
4631
4716
|
if (h != null) {
|
|
4632
4717
|
s[h] = n;
|
|
4633
4718
|
return;
|
|
@@ -4656,47 +4741,47 @@ const ic = c.object({
|
|
|
4656
4741
|
} catch (o) {
|
|
4657
4742
|
throw console.error("failed to set value", n, "at path", t, "on object", e), o;
|
|
4658
4743
|
}
|
|
4659
|
-
},
|
|
4744
|
+
}, _u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4660
4745
|
__proto__: null,
|
|
4661
|
-
SEPARATOR:
|
|
4662
|
-
copy:
|
|
4746
|
+
SEPARATOR: j,
|
|
4747
|
+
copy: Zc,
|
|
4663
4748
|
defaultGetter: dt,
|
|
4664
|
-
difference:
|
|
4665
|
-
element:
|
|
4749
|
+
difference: _c,
|
|
4750
|
+
element: Fc,
|
|
4666
4751
|
equal: Oe,
|
|
4667
4752
|
findBestKey: xe,
|
|
4668
|
-
get:
|
|
4669
|
-
getIndex:
|
|
4670
|
-
has:
|
|
4753
|
+
get: tn,
|
|
4754
|
+
getIndex: ot,
|
|
4755
|
+
has: Wc,
|
|
4671
4756
|
override: Ie,
|
|
4672
|
-
overrideValidItems:
|
|
4757
|
+
overrideValidItems: Yc,
|
|
4673
4758
|
partialEqual: Mr,
|
|
4674
|
-
pathsMatch:
|
|
4675
|
-
remove:
|
|
4676
|
-
resolvePath:
|
|
4677
|
-
set:
|
|
4759
|
+
pathsMatch: Vc,
|
|
4760
|
+
remove: zc,
|
|
4761
|
+
resolvePath: qc,
|
|
4762
|
+
set: Gc,
|
|
4678
4763
|
transformPath: Ar
|
|
4679
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4764
|
+
}, Symbol.toStringTag, { value: "Module" })), qu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4680
4765
|
__proto__: null
|
|
4681
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4766
|
+
}, Symbol.toStringTag, { value: "Module" })), Hc = (e) => Object.getOwnPropertySymbols(globalThis).includes(e), Dc = (e, t) => {
|
|
4682
4767
|
const n = Symbol.for(e);
|
|
4683
|
-
if (!
|
|
4768
|
+
if (!Hc(n)) {
|
|
4684
4769
|
const r = t();
|
|
4685
4770
|
Object.defineProperty(globalThis, n, { value: r });
|
|
4686
4771
|
}
|
|
4687
4772
|
return () => globalThis[n];
|
|
4688
|
-
}, Er = "sy_x_error",
|
|
4773
|
+
}, Er = "sy_x_error", Jc = (e) => (t) => t != null && typeof t == "object" && "type" in t && typeof t.type == "string" ? t.type.startsWith(e) : t instanceof Error ? t.message.startsWith(e) : typeof t != "string" ? !1 : t.startsWith(e), Tt = (e) => class mt extends Error {
|
|
4689
4774
|
static discriminator = Er;
|
|
4690
4775
|
discriminator = mt.discriminator;
|
|
4691
4776
|
static TYPE = e;
|
|
4692
4777
|
type = mt.TYPE;
|
|
4693
|
-
static matches =
|
|
4778
|
+
static matches = Jc(e);
|
|
4694
4779
|
matches = mt.matches;
|
|
4695
4780
|
constructor(n, r) {
|
|
4696
4781
|
super(n, r), this.name = mt.TYPE;
|
|
4697
4782
|
}
|
|
4698
4783
|
static sub(n) {
|
|
4699
|
-
return
|
|
4784
|
+
return Tt(`${e}.${n}`);
|
|
4700
4785
|
}
|
|
4701
4786
|
}, Sr = (e) => {
|
|
4702
4787
|
if (e == null || typeof e != "object") return !1;
|
|
@@ -4707,8 +4792,8 @@ const ic = c.object({
|
|
|
4707
4792
|
`X Error is missing its type property: ${JSON.stringify(t)}`
|
|
4708
4793
|
);
|
|
4709
4794
|
return !0;
|
|
4710
|
-
},
|
|
4711
|
-
class
|
|
4795
|
+
}, ct = "unknown", Ne = "nil";
|
|
4796
|
+
class Xc {
|
|
4712
4797
|
providers = [];
|
|
4713
4798
|
register(t) {
|
|
4714
4799
|
this.providers.push(t);
|
|
@@ -4720,17 +4805,17 @@ class Qc {
|
|
|
4720
4805
|
const r = n.encode(t);
|
|
4721
4806
|
if (r != null) return r;
|
|
4722
4807
|
}
|
|
4723
|
-
if (t instanceof Error) return { type:
|
|
4724
|
-
if (typeof t == "string") return { type:
|
|
4808
|
+
if (t instanceof Error) return { type: ct, data: t.message };
|
|
4809
|
+
if (typeof t == "string") return { type: ct, data: t };
|
|
4725
4810
|
try {
|
|
4726
|
-
return { type:
|
|
4811
|
+
return { type: ct, data: JSON.stringify(t) };
|
|
4727
4812
|
} catch {
|
|
4728
|
-
return { type:
|
|
4813
|
+
return { type: ct, data: "unable to encode error information" };
|
|
4729
4814
|
}
|
|
4730
4815
|
}
|
|
4731
4816
|
decode(t) {
|
|
4732
4817
|
if (t == null || t.type === Ne) return null;
|
|
4733
|
-
if (t.type ===
|
|
4818
|
+
if (t.type === ct) return new ve(t.data);
|
|
4734
4819
|
for (const n of this.providers) {
|
|
4735
4820
|
const r = n.decode(t);
|
|
4736
4821
|
if (r != null) return r;
|
|
@@ -4738,85 +4823,29 @@ class Qc {
|
|
|
4738
4823
|
return new ve(t.data);
|
|
4739
4824
|
}
|
|
4740
4825
|
}
|
|
4741
|
-
const
|
|
4742
|
-
class ve extends
|
|
4826
|
+
const en = Dc("synnax-error-registry", () => new Xc()), Kc = ({ encode: e, decode: t }) => en().register({ encode: e, decode: t }), Qc = (e) => en().encode(e), ta = (e) => e == null ? null : en().decode(e);
|
|
4827
|
+
class ve extends Tt("unknown") {
|
|
4743
4828
|
}
|
|
4744
|
-
const
|
|
4745
|
-
class
|
|
4829
|
+
const ea = c.object({ type: c.string(), data: c.string() });
|
|
4830
|
+
class na extends Tt("canceled") {
|
|
4746
4831
|
}
|
|
4747
|
-
class
|
|
4832
|
+
class ra extends Tt("not_implemented") {
|
|
4748
4833
|
}
|
|
4749
|
-
const
|
|
4834
|
+
const Fu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4750
4835
|
__proto__: null,
|
|
4751
|
-
Canceled:
|
|
4836
|
+
Canceled: na,
|
|
4752
4837
|
NONE: Ne,
|
|
4753
|
-
NotImplemented:
|
|
4754
|
-
UNKNOWN:
|
|
4838
|
+
NotImplemented: ra,
|
|
4839
|
+
UNKNOWN: ct,
|
|
4755
4840
|
Unknown: ve,
|
|
4756
|
-
createTyped:
|
|
4757
|
-
decode:
|
|
4758
|
-
encode:
|
|
4841
|
+
createTyped: Tt,
|
|
4842
|
+
decode: ta,
|
|
4843
|
+
encode: Qc,
|
|
4759
4844
|
isTyped: Sr,
|
|
4760
|
-
payloadZ:
|
|
4761
|
-
register:
|
|
4762
|
-
}, Symbol.toStringTag, { value: "Module" })), Tr = b.object({
|
|
4763
|
-
jsonrpc: b.literal("2.0"),
|
|
4764
|
-
method: b.string(),
|
|
4765
|
-
// params should be z.union([z.record(z.string(), z.json()),
|
|
4766
|
-
// z.array(z.json())]).optional() but the VSCode JSON RPC implementation uses a looser
|
|
4767
|
-
// definition of params then in the JSON-RPC spec.
|
|
4768
|
-
params: b.any().optional(),
|
|
4769
|
-
id: b.union([b.string(), b.number(), b.null()]).optional()
|
|
4770
|
-
}), $r = b.object({
|
|
4771
|
-
jsonrpc: b.literal("2.0"),
|
|
4772
|
-
id: b.union([b.string(), b.number(), b.null()])
|
|
4773
|
-
}), oa = $r.extend({
|
|
4774
|
-
result: b.json()
|
|
4775
|
-
}), ca = $r.extend({
|
|
4776
|
-
error: b.object({
|
|
4777
|
-
code: b.number().int(),
|
|
4778
|
-
// This should be z.string(), but the VSCode JSON RPC implementation uses a looser
|
|
4779
|
-
// definition of error than the JSON-RPC spec.
|
|
4780
|
-
message: b.string().optional(),
|
|
4781
|
-
data: b.json().optional()
|
|
4782
|
-
})
|
|
4783
|
-
}), Ur = b.union([oa, ca]), jr = b.union([Tr, Ur]), aa = (e) => {
|
|
4784
|
-
const t = new TextDecoder();
|
|
4785
|
-
let n = new Uint8Array(0), r = null;
|
|
4786
|
-
return (s) => {
|
|
4787
|
-
let i;
|
|
4788
|
-
typeof s == "string" ? i = new TextEncoder().encode(s) : s instanceof ArrayBuffer ? i = new Uint8Array(s) : i = s;
|
|
4789
|
-
const o = new Uint8Array(n.length + i.length);
|
|
4790
|
-
for (o.set(n), o.set(i, n.length), n = o; n.length > 0; ) {
|
|
4791
|
-
if (r === null) {
|
|
4792
|
-
const u = t.decode(n).match(/^Content-Length: (\d+)\r?\n\r?\n/);
|
|
4793
|
-
if (!u) break;
|
|
4794
|
-
r = parseInt(u[1]);
|
|
4795
|
-
const l = new TextEncoder().encode(u[0]).length;
|
|
4796
|
-
n = n.slice(l);
|
|
4797
|
-
}
|
|
4798
|
-
if (r !== null && n.length >= r) {
|
|
4799
|
-
const a = n.slice(0, r);
|
|
4800
|
-
n = n.slice(r), r = null;
|
|
4801
|
-
const u = t.decode(a), l = at.decodeString(u, jr);
|
|
4802
|
-
e(l);
|
|
4803
|
-
} else break;
|
|
4804
|
-
}
|
|
4805
|
-
};
|
|
4806
|
-
}, ua = (e) => {
|
|
4807
|
-
const t = JSON.stringify(e);
|
|
4808
|
-
return `Content-Length: ${new TextEncoder().encode(t).length}\r
|
|
4809
|
-
\r
|
|
4810
|
-
` + t;
|
|
4811
|
-
}, Gu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4812
|
-
__proto__: null,
|
|
4813
|
-
encodeMessage: ua,
|
|
4814
|
-
messageZ: jr,
|
|
4815
|
-
requestZ: Tr,
|
|
4816
|
-
responseZ: Ur,
|
|
4817
|
-
streamDecodeChunks: aa
|
|
4845
|
+
payloadZ: ea,
|
|
4846
|
+
register: Kc
|
|
4818
4847
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4819
|
-
class
|
|
4848
|
+
class sa {
|
|
4820
4849
|
store = /* @__PURE__ */ new Map();
|
|
4821
4850
|
async get(t) {
|
|
4822
4851
|
return this.store.get(t) ?? null;
|
|
@@ -4834,7 +4863,7 @@ class la {
|
|
|
4834
4863
|
this.store.clear();
|
|
4835
4864
|
}
|
|
4836
4865
|
}
|
|
4837
|
-
class
|
|
4866
|
+
class ia {
|
|
4838
4867
|
store = /* @__PURE__ */ new Map();
|
|
4839
4868
|
get(t) {
|
|
4840
4869
|
return this.store.get(t) ?? null;
|
|
@@ -4846,67 +4875,67 @@ class fa {
|
|
|
4846
4875
|
this.store.delete(t);
|
|
4847
4876
|
}
|
|
4848
4877
|
}
|
|
4849
|
-
const
|
|
4878
|
+
const oa = c.object({ key: c.string(), value: c.string() }), Vu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4850
4879
|
__proto__: null,
|
|
4851
|
-
MockAsync:
|
|
4852
|
-
MockSync:
|
|
4853
|
-
stringPairZ:
|
|
4854
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4855
|
-
key:
|
|
4856
|
-
name:
|
|
4857
|
-
color:
|
|
4858
|
-
}),
|
|
4880
|
+
MockAsync: sa,
|
|
4881
|
+
MockSync: ia,
|
|
4882
|
+
stringPairZ: oa
|
|
4883
|
+
}, Symbol.toStringTag, { value: "Module" })), Tr = L.uuid(), $r = L.object({
|
|
4884
|
+
key: Tr,
|
|
4885
|
+
name: L.string().min(1),
|
|
4886
|
+
color: St
|
|
4887
|
+
}), Wu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4859
4888
|
__proto__: null,
|
|
4860
|
-
keyZ:
|
|
4861
|
-
labelZ:
|
|
4862
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4889
|
+
keyZ: Tr,
|
|
4890
|
+
labelZ: $r
|
|
4891
|
+
}, Symbol.toStringTag, { value: "Module" })), ca = new RegExp(
|
|
4863
4892
|
"^(https?:\\/\\/)?((([a-zA-Z0-9][a-zA-Z0-9-]*\\.)+[a-zA-Z]{2,})|localhost|(\\d{1,3}\\.){3}\\d{1,3})(\\:\\d+)?(\\/[-a-zA-Z0-9@:%._\\+~#=]*)*(\\?[;&a-zA-Z0-9%_.,~+=-]*)?(#[-a-zA-Z0-9_]*)?$"
|
|
4864
4893
|
// fragment identifier (optional)
|
|
4865
|
-
),
|
|
4894
|
+
), aa = (e) => ca.test(e), Yu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4866
4895
|
__proto__: null,
|
|
4867
|
-
is:
|
|
4868
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4896
|
+
is: aa
|
|
4897
|
+
}, Symbol.toStringTag, { value: "Module" })), ua = (e, t, n) => {
|
|
4869
4898
|
const r = e.get(t);
|
|
4870
4899
|
return r === void 0 ? (e.set(t, n), n) : r;
|
|
4871
|
-
},
|
|
4900
|
+
}, zu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4872
4901
|
__proto__: null,
|
|
4873
|
-
getOrSetDefault:
|
|
4874
|
-
}, Symbol.toStringTag, { value: "Module" })), Me = c.string().regex(/^\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/),
|
|
4902
|
+
getOrSetDefault: ua
|
|
4903
|
+
}, Symbol.toStringTag, { value: "Module" })), Me = c.string().regex(/^\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/), la = (e, t) => {
|
|
4875
4904
|
const n = e.split("."), r = t.split("."), s = Math.max(n.length, r.length);
|
|
4876
4905
|
for (let i = 0; i < s; i++) {
|
|
4877
4906
|
const o = n[i], a = r[i];
|
|
4878
|
-
if (o === void 0) return
|
|
4879
|
-
if (a === void 0) return
|
|
4907
|
+
if (o === void 0) return Y;
|
|
4908
|
+
if (a === void 0) return z;
|
|
4880
4909
|
const u = /^\d+$/.test(o), l = /^\d+$/.test(a);
|
|
4881
|
-
if (u && !l) return
|
|
4882
|
-
if (!u && l) return
|
|
4910
|
+
if (u && !l) return Y;
|
|
4911
|
+
if (!u && l) return z;
|
|
4883
4912
|
if (u && l) {
|
|
4884
4913
|
const h = parseInt(o), y = parseInt(a);
|
|
4885
|
-
if (h < y) return
|
|
4886
|
-
if (h > y) return
|
|
4914
|
+
if (h < y) return Y;
|
|
4915
|
+
if (h > y) return z;
|
|
4887
4916
|
} else {
|
|
4888
|
-
if (o < a) return
|
|
4889
|
-
if (o > a) return
|
|
4917
|
+
if (o < a) return Y;
|
|
4918
|
+
if (o > a) return z;
|
|
4890
4919
|
}
|
|
4891
4920
|
}
|
|
4892
|
-
return
|
|
4893
|
-
},
|
|
4921
|
+
return it;
|
|
4922
|
+
}, $t = ((e, t, n = {}) => {
|
|
4894
4923
|
n.checkMajor ??= !0, n.checkMinor ??= !0, n.checkPatch ??= !0;
|
|
4895
|
-
const r = Me.parse(e), s = Me.parse(t), [i, o] = r.split("-"), [a, u] = s.split("-"), [l, h, y] = i.split(".").map(Number), [m,
|
|
4924
|
+
const r = Me.parse(e), s = Me.parse(t), [i, o] = r.split("-"), [a, u] = s.split("-"), [l, h, y] = i.split(".").map(Number), [m, M, S] = a.split(".").map(Number);
|
|
4896
4925
|
if (n.checkMajor) {
|
|
4897
|
-
if (l < m) return
|
|
4898
|
-
if (l > m) return
|
|
4926
|
+
if (l < m) return Y;
|
|
4927
|
+
if (l > m) return z;
|
|
4899
4928
|
}
|
|
4900
4929
|
if (n.checkMinor) {
|
|
4901
|
-
if (h <
|
|
4902
|
-
if (h >
|
|
4930
|
+
if (h < M) return Y;
|
|
4931
|
+
if (h > M) return z;
|
|
4903
4932
|
}
|
|
4904
4933
|
if (n.checkPatch) {
|
|
4905
|
-
if (y <
|
|
4906
|
-
if (y >
|
|
4934
|
+
if (y < S) return Y;
|
|
4935
|
+
if (y > S) return z;
|
|
4907
4936
|
}
|
|
4908
|
-
return o === void 0 && u === void 0 ?
|
|
4909
|
-
}),
|
|
4937
|
+
return o === void 0 && u === void 0 ? it : o === void 0 ? z : u === void 0 ? Y : la(o, u);
|
|
4938
|
+
}), fa = (e, t, n = {}) => En($t(e, t, n)), Ur = (e, t, n = {}) => An($t(e, t, n)), ha = (e, t, n = {}) => Mn($t(e, t, n)), da = ({
|
|
4910
4939
|
name: e,
|
|
4911
4940
|
migrate: t
|
|
4912
4941
|
}) => (n) => {
|
|
@@ -4916,14 +4945,14 @@ const ha = c.object({ key: c.string(), value: c.string() }), Hu = /* @__PURE__ *
|
|
|
4916
4945
|
} catch (r) {
|
|
4917
4946
|
throw console.log(`${e} failed to migrate from ${n.version}`), console.error(r), r;
|
|
4918
4947
|
}
|
|
4919
|
-
},
|
|
4948
|
+
}, ga = ({
|
|
4920
4949
|
name: e,
|
|
4921
4950
|
migrations: t,
|
|
4922
4951
|
targetSchema: n,
|
|
4923
4952
|
defaultVersion: r,
|
|
4924
4953
|
def: s
|
|
4925
4954
|
}) => {
|
|
4926
|
-
const i = Object.keys(t).sort(
|
|
4955
|
+
const i = Object.keys(t).sort($t).pop();
|
|
4927
4956
|
if (i == null)
|
|
4928
4957
|
return (l) => {
|
|
4929
4958
|
if (l.version ??= r, l.version !== s.version)
|
|
@@ -4942,7 +4971,7 @@ const ha = c.object({ key: c.string(), value: c.string() }), Hu = /* @__PURE__ *
|
|
|
4942
4971
|
let a = !1;
|
|
4943
4972
|
const u = (l) => {
|
|
4944
4973
|
try {
|
|
4945
|
-
if (o === 0 ||
|
|
4974
|
+
if (o === 0 || Ur(l.version, i))
|
|
4946
4975
|
return console.log(a ? `${e} ${l.version} now up to date` : `${e} version ${l.version} is up to date with target version ${s.version}`), l;
|
|
4947
4976
|
const h = l.version, y = t[h], m = y(l);
|
|
4948
4977
|
return a = !0, u(m);
|
|
@@ -4968,16 +4997,16 @@ const ha = c.object({ key: c.string(), value: c.string() }), Hu = /* @__PURE__ *
|
|
|
4968
4997
|
return console.log(`${e} failed to parse final result. Exiting with default`), console.error(h), s;
|
|
4969
4998
|
}
|
|
4970
4999
|
};
|
|
4971
|
-
},
|
|
5000
|
+
}, Gu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4972
5001
|
__proto__: null,
|
|
4973
|
-
compareSemVer:
|
|
4974
|
-
createMigration:
|
|
4975
|
-
migrator:
|
|
4976
|
-
semVerNewer:
|
|
4977
|
-
semVerOlder:
|
|
5002
|
+
compareSemVer: $t,
|
|
5003
|
+
createMigration: da,
|
|
5004
|
+
migrator: ga,
|
|
5005
|
+
semVerNewer: Ur,
|
|
5006
|
+
semVerOlder: ha,
|
|
4978
5007
|
semVerZ: Me,
|
|
4979
|
-
versionsEqual:
|
|
4980
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
5008
|
+
versionsEqual: fa
|
|
5009
|
+
}, Symbol.toStringTag, { value: "Module" })), jr = ["standard", "scientific", "engineering"], ya = c.enum(jr), ma = (e, t, n) => {
|
|
4981
5010
|
if (Number.isNaN(e)) return "NaN";
|
|
4982
5011
|
if (e === 1 / 0) return "∞";
|
|
4983
5012
|
if (e === -1 / 0) return "-∞";
|
|
@@ -4986,13 +5015,13 @@ const ha = c.object({ key: c.string(), value: c.string() }), Hu = /* @__PURE__ *
|
|
|
4986
5015
|
return t === 0 ? "0ᴇ0" : `0.${"0".repeat(t)}ᴇ0`;
|
|
4987
5016
|
let r;
|
|
4988
5017
|
return n === "scientific" ? r = Math.floor(Math.log10(Math.abs(e))) : r = Math.floor(Math.log10(Math.abs(e)) / 3) * 3, `${(e / 10 ** r).toFixed(t)}ᴇ${r}`;
|
|
4989
|
-
},
|
|
5018
|
+
}, Hu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4990
5019
|
__proto__: null,
|
|
4991
|
-
NOTATIONS:
|
|
4992
|
-
notationZ:
|
|
4993
|
-
stringifyNumber:
|
|
5020
|
+
NOTATIONS: jr,
|
|
5021
|
+
notationZ: ya,
|
|
5022
|
+
stringifyNumber: ma
|
|
4994
5023
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4995
|
-
class
|
|
5024
|
+
class pa {
|
|
4996
5025
|
handlers;
|
|
4997
5026
|
transform;
|
|
4998
5027
|
closer;
|
|
@@ -5020,7 +5049,7 @@ class Na {
|
|
|
5020
5049
|
return await this.closer?.();
|
|
5021
5050
|
}
|
|
5022
5051
|
}
|
|
5023
|
-
class
|
|
5052
|
+
class ba {
|
|
5024
5053
|
handlers;
|
|
5025
5054
|
constructor(t) {
|
|
5026
5055
|
this.handlers = t ?? /* @__PURE__ */ new Map();
|
|
@@ -5032,115 +5061,150 @@ class va {
|
|
|
5032
5061
|
this.handlers.forEach((n, r) => r(t));
|
|
5033
5062
|
}
|
|
5034
5063
|
}
|
|
5035
|
-
const
|
|
5064
|
+
const Du = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5036
5065
|
__proto__: null,
|
|
5037
|
-
BaseObserver:
|
|
5038
|
-
Observer:
|
|
5039
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
5066
|
+
BaseObserver: ba,
|
|
5067
|
+
Observer: pa
|
|
5068
|
+
}, Symbol.toStringTag, { value: "Module" })), Ju = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5040
5069
|
__proto__: null
|
|
5041
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
5070
|
+
}, Symbol.toStringTag, { value: "Module" })), Cr = c.union([c.string(), c.number()]), Br = c.record(Cr, c.unknown()), wa = () => c.union([
|
|
5071
|
+
c.union([c.null(), c.undefined()]).transform(() => ({})),
|
|
5072
|
+
Br
|
|
5073
|
+
]), nn = (e) => Object.entries(e), Oa = (e, t) => Object.fromEntries(nn(e).map(([n, r]) => [n, t(r, n)])), xa = (e) => Object.fromEntries(nn(e).filter(([t, n]) => n !== void 0)), Ia = (e, ...t) => {
|
|
5042
5074
|
const n = { ...e };
|
|
5043
5075
|
for (const r of t) delete n[r];
|
|
5044
5076
|
return n;
|
|
5045
|
-
},
|
|
5077
|
+
}, Xu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5046
5078
|
__proto__: null,
|
|
5047
|
-
entries:
|
|
5048
|
-
keyZ:
|
|
5049
|
-
map:
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5079
|
+
entries: nn,
|
|
5080
|
+
keyZ: Cr,
|
|
5081
|
+
map: Oa,
|
|
5082
|
+
nullishToEmpty: wa,
|
|
5083
|
+
omit: Ia,
|
|
5084
|
+
purgeUndefined: xa,
|
|
5085
|
+
unknownZ: Br
|
|
5086
|
+
}, Symbol.toStringTag, { value: "Module" })), Pr = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", Na = Pr(), Rr = ["macOS", "Windows", "Linux"], va = ["macos", "windows", "linux"], Ma = {
|
|
5054
5087
|
macos: "macOS",
|
|
5055
5088
|
windows: "Windows",
|
|
5056
5089
|
linux: "Linux"
|
|
5057
|
-
},
|
|
5058
|
-
c.enum(
|
|
5059
|
-
),
|
|
5090
|
+
}, Aa = c.enum(Rr).or(
|
|
5091
|
+
c.enum(va).transform((e) => Ma[e])
|
|
5092
|
+
), Ea = () => {
|
|
5060
5093
|
if (typeof window > "u") return;
|
|
5061
5094
|
const e = window.navigator.userAgent.toLowerCase();
|
|
5062
5095
|
if (e.includes("mac")) return "macOS";
|
|
5063
5096
|
if (e.includes("win")) return "Windows";
|
|
5064
5097
|
if (e.includes("linux")) return "Linux";
|
|
5065
5098
|
};
|
|
5066
|
-
let
|
|
5067
|
-
const
|
|
5099
|
+
let Pt;
|
|
5100
|
+
const Sa = ((e = {}) => {
|
|
5068
5101
|
const { force: t, default: n } = e;
|
|
5069
|
-
return t ??
|
|
5070
|
-
}),
|
|
5102
|
+
return t ?? Pt ?? (Pt = Ea(), Pt ?? n);
|
|
5103
|
+
}), Ku = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5071
5104
|
__proto__: null,
|
|
5072
|
-
OPERATING_SYSTEMS:
|
|
5073
|
-
RUNTIME:
|
|
5074
|
-
detect:
|
|
5075
|
-
getOS:
|
|
5076
|
-
osZ:
|
|
5077
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
5105
|
+
OPERATING_SYSTEMS: Rr,
|
|
5106
|
+
RUNTIME: Na,
|
|
5107
|
+
detect: Pr,
|
|
5108
|
+
getOS: Sa,
|
|
5109
|
+
osZ: Aa
|
|
5110
|
+
}, Symbol.toStringTag, { value: "Module" })), Ta = () => Promise.resolve(), $a = () => new Promise((e) => setTimeout(e, 0)), Qu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5078
5111
|
__proto__: null,
|
|
5079
|
-
flushMicrotasks:
|
|
5080
|
-
flushTaskQueue:
|
|
5081
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
5112
|
+
flushMicrotasks: Ta,
|
|
5113
|
+
flushTaskQueue: $a
|
|
5114
|
+
}, Symbol.toStringTag, { value: "Module" })), Ua = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e, tl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5082
5115
|
__proto__: null,
|
|
5083
|
-
copy:
|
|
5084
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
5116
|
+
copy: Ua
|
|
5117
|
+
}, Symbol.toStringTag, { value: "Module" })), Lr = c.enum([
|
|
5085
5118
|
"success",
|
|
5086
5119
|
"info",
|
|
5087
5120
|
"warning",
|
|
5088
5121
|
"error",
|
|
5089
5122
|
"loading",
|
|
5090
5123
|
"disabled"
|
|
5091
|
-
]),
|
|
5124
|
+
]), ja = (e) => c.object({
|
|
5092
5125
|
key: c.string(),
|
|
5093
5126
|
name: c.string().default(""),
|
|
5094
|
-
variant:
|
|
5127
|
+
variant: Lr,
|
|
5095
5128
|
message: c.string(),
|
|
5096
5129
|
description: c.string().optional(),
|
|
5097
5130
|
time: d.z,
|
|
5098
|
-
labels:
|
|
5131
|
+
labels: gn($r).optional(),
|
|
5099
5132
|
details: e ?? c.unknown().optional()
|
|
5100
|
-
}),
|
|
5133
|
+
}), Ca = c.object({
|
|
5101
5134
|
stack: c.string(),
|
|
5102
5135
|
error: c.instanceof(Error)
|
|
5103
|
-
}),
|
|
5136
|
+
}), Ba = (e, t) => {
|
|
5104
5137
|
if (!(e instanceof Error)) throw e;
|
|
5105
|
-
return
|
|
5138
|
+
return kr({
|
|
5106
5139
|
variant: "error",
|
|
5107
5140
|
message: t ?? e.message,
|
|
5108
5141
|
description: t != null ? e.message : void 0,
|
|
5109
5142
|
details: { stack: e.stack ?? "", error: e }
|
|
5110
5143
|
});
|
|
5111
|
-
},
|
|
5144
|
+
}, kr = (e) => ({
|
|
5112
5145
|
key: Se(),
|
|
5113
5146
|
time: d.now(),
|
|
5114
5147
|
name: "",
|
|
5115
5148
|
...e
|
|
5116
|
-
}),
|
|
5149
|
+
}), Pa = (e, t = []) => {
|
|
5117
5150
|
if (e != null)
|
|
5118
5151
|
return Array.isArray(t) ? t.includes(e) ? e : void 0 : t === e ? e : void 0;
|
|
5119
|
-
},
|
|
5152
|
+
}, Ra = (e, t = []) => {
|
|
5120
5153
|
if (e != null)
|
|
5121
5154
|
return Array.isArray(t) ? t.includes(e) ? void 0 : e : t === e ? void 0 : e;
|
|
5122
|
-
},
|
|
5155
|
+
}, La = {
|
|
5156
|
+
includeTimestamp: !1,
|
|
5157
|
+
includeName: !0
|
|
5158
|
+
}, ka = (e, t = {}) => {
|
|
5159
|
+
const n = { ...La, ...t }, r = [];
|
|
5160
|
+
let s = e.variant.toUpperCase();
|
|
5161
|
+
if (n.includeName && e.name.length > 0 && (s += ` [${e.name}]`), s += `: ${e.message}`, n.includeTimestamp && (s += ` (${e.time.toString("dateTime", "local")})`), r.push(s), e.description != null) {
|
|
5162
|
+
let i;
|
|
5163
|
+
try {
|
|
5164
|
+
const o = JSON.parse(e.description);
|
|
5165
|
+
i = `Description:
|
|
5166
|
+
${JSON.stringify(o, null, 2)}`;
|
|
5167
|
+
} catch {
|
|
5168
|
+
i = `Description: ${e.description}`;
|
|
5169
|
+
}
|
|
5170
|
+
r.push(i);
|
|
5171
|
+
}
|
|
5172
|
+
if ("details" in e && at(e.details)) {
|
|
5173
|
+
const i = e.details;
|
|
5174
|
+
"stack" in i && r.push(`Stack Trace:
|
|
5175
|
+
${String(i.stack)}`);
|
|
5176
|
+
const o = Object.fromEntries(
|
|
5177
|
+
Object.entries(i).filter(([a]) => a !== "stack" && a !== "error")
|
|
5178
|
+
);
|
|
5179
|
+
Object.keys(o).length > 0 && r.push(`Details:
|
|
5180
|
+
${JSON.stringify(o, null, 2)}`);
|
|
5181
|
+
}
|
|
5182
|
+
return r.join(`
|
|
5183
|
+
|
|
5184
|
+
`);
|
|
5185
|
+
}, el = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5123
5186
|
__proto__: null,
|
|
5124
|
-
create:
|
|
5125
|
-
exceptionDetailsSchema:
|
|
5126
|
-
fromException:
|
|
5127
|
-
keepVariants:
|
|
5128
|
-
removeVariants:
|
|
5129
|
-
statusZ:
|
|
5130
|
-
|
|
5131
|
-
|
|
5187
|
+
create: kr,
|
|
5188
|
+
exceptionDetailsSchema: Ca,
|
|
5189
|
+
fromException: Ba,
|
|
5190
|
+
keepVariants: Pa,
|
|
5191
|
+
removeVariants: Ra,
|
|
5192
|
+
statusZ: ja,
|
|
5193
|
+
toString: ka,
|
|
5194
|
+
variantZ: Lr
|
|
5195
|
+
}, Symbol.toStringTag, { value: "Module" })), Za = (e, t) => {
|
|
5132
5196
|
if (!t.has(e)) return e;
|
|
5133
5197
|
let n = e, r = 1, s = e;
|
|
5134
5198
|
for (; t.has(s); ) {
|
|
5135
|
-
const i = s.match(
|
|
5199
|
+
const i = s.match(_a);
|
|
5136
5200
|
i ? (n = s.slice(0, i.index).trim(), r = parseInt(i[1]) + 1) : (n = s, r = 1), s = `${n} (${r})`;
|
|
5137
5201
|
}
|
|
5138
5202
|
return s;
|
|
5139
|
-
},
|
|
5203
|
+
}, _a = /\((\d+)\)$/, qa = (e, t = "") => {
|
|
5140
5204
|
if (typeof e == "string") return e;
|
|
5141
5205
|
const n = e.length;
|
|
5142
5206
|
return n === 0 ? t : n === 1 ? e[0] : n === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e[n - 1]}`;
|
|
5143
|
-
},
|
|
5207
|
+
}, Fa = (e) => {
|
|
5144
5208
|
const t = e.split(" "), n = /* @__PURE__ */ new Set(), r = t.map((u) => u.charAt(0).toLowerCase()).join("");
|
|
5145
5209
|
n.add(r.replace(/-/g, "_")), n.add(r.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_"));
|
|
5146
5210
|
const s = /\d+/g;
|
|
@@ -5158,14 +5222,14 @@ const Ba = ((e = {}) => {
|
|
|
5158
5222
|
return n.add(o.join("").replace(/-/g, "_")), n.add(o.join("_").replace(/-/g, "_")), Array.from(n).filter(
|
|
5159
5223
|
(u) => u.length >= 2 && u.length <= 12 && !/^\d/.test(u)
|
|
5160
5224
|
);
|
|
5161
|
-
},
|
|
5225
|
+
}, Va = (e, t) => e.startsWith(t) ? e.slice(t.length) : e, nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5162
5226
|
__proto__: null,
|
|
5163
|
-
createShortIdentifiers:
|
|
5164
|
-
deduplicateFileName:
|
|
5165
|
-
naturalLanguageJoin:
|
|
5166
|
-
trimPrefix:
|
|
5167
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
5168
|
-
var
|
|
5227
|
+
createShortIdentifiers: Fa,
|
|
5228
|
+
deduplicateFileName: Za,
|
|
5229
|
+
naturalLanguageJoin: qa,
|
|
5230
|
+
trimPrefix: Va
|
|
5231
|
+
}, Symbol.toStringTag, { value: "Module" })), Wa = new Error("request for lock canceled");
|
|
5232
|
+
var Ya = function(e, t, n, r) {
|
|
5169
5233
|
function s(i) {
|
|
5170
5234
|
return i instanceof n ? i : new n(function(o) {
|
|
5171
5235
|
o(i);
|
|
@@ -5192,20 +5256,20 @@ var Da = function(e, t, n, r) {
|
|
|
5192
5256
|
l((r = r.apply(e, t || [])).next());
|
|
5193
5257
|
});
|
|
5194
5258
|
};
|
|
5195
|
-
class
|
|
5196
|
-
constructor(t, n =
|
|
5259
|
+
class za {
|
|
5260
|
+
constructor(t, n = Wa) {
|
|
5197
5261
|
this._value = t, this._cancelError = n, this._queue = [], this._weightedWaiters = [];
|
|
5198
5262
|
}
|
|
5199
5263
|
acquire(t = 1, n = 0) {
|
|
5200
5264
|
if (t <= 0)
|
|
5201
5265
|
throw new Error(`invalid weight ${t}: must be positive`);
|
|
5202
5266
|
return new Promise((r, s) => {
|
|
5203
|
-
const i = { resolve: r, reject: s, weight: t, priority: n }, o =
|
|
5267
|
+
const i = { resolve: r, reject: s, weight: t, priority: n }, o = Zr(this._queue, (a) => n <= a.priority);
|
|
5204
5268
|
o === -1 && t <= this._value ? this._dispatchItem(i) : this._queue.splice(o + 1, 0, i);
|
|
5205
5269
|
});
|
|
5206
5270
|
}
|
|
5207
5271
|
runExclusive(t) {
|
|
5208
|
-
return
|
|
5272
|
+
return Ya(this, arguments, void 0, function* (n, r = 1, s = 0) {
|
|
5209
5273
|
const [i, o] = yield this.acquire(r, s);
|
|
5210
5274
|
try {
|
|
5211
5275
|
return yield n(i);
|
|
@@ -5218,7 +5282,7 @@ class Ja {
|
|
|
5218
5282
|
if (t <= 0)
|
|
5219
5283
|
throw new Error(`invalid weight ${t}: must be positive`);
|
|
5220
5284
|
return this._couldLockImmediately(t, n) ? Promise.resolve() : new Promise((r) => {
|
|
5221
|
-
this._weightedWaiters[t - 1] || (this._weightedWaiters[t - 1] = []),
|
|
5285
|
+
this._weightedWaiters[t - 1] || (this._weightedWaiters[t - 1] = []), Ga(this._weightedWaiters[t - 1], { resolve: r, priority: n });
|
|
5222
5286
|
});
|
|
5223
5287
|
}
|
|
5224
5288
|
isLocked() {
|
|
@@ -5273,17 +5337,17 @@ class Ja {
|
|
|
5273
5337
|
return (this._queue.length === 0 || this._queue[0].priority < n) && t <= this._value;
|
|
5274
5338
|
}
|
|
5275
5339
|
}
|
|
5276
|
-
function
|
|
5277
|
-
const n =
|
|
5340
|
+
function Ga(e, t) {
|
|
5341
|
+
const n = Zr(e, (r) => t.priority <= r.priority);
|
|
5278
5342
|
e.splice(n + 1, 0, t);
|
|
5279
5343
|
}
|
|
5280
|
-
function
|
|
5344
|
+
function Zr(e, t) {
|
|
5281
5345
|
for (let n = e.length - 1; n >= 0; n--)
|
|
5282
5346
|
if (t(e[n]))
|
|
5283
5347
|
return n;
|
|
5284
5348
|
return -1;
|
|
5285
5349
|
}
|
|
5286
|
-
var
|
|
5350
|
+
var Ha = function(e, t, n, r) {
|
|
5287
5351
|
function s(i) {
|
|
5288
5352
|
return i instanceof n ? i : new n(function(o) {
|
|
5289
5353
|
o(i);
|
|
@@ -5310,12 +5374,12 @@ var Ka = function(e, t, n, r) {
|
|
|
5310
5374
|
l((r = r.apply(e, t || [])).next());
|
|
5311
5375
|
});
|
|
5312
5376
|
};
|
|
5313
|
-
class
|
|
5377
|
+
class Da {
|
|
5314
5378
|
constructor(t) {
|
|
5315
|
-
this._semaphore = new
|
|
5379
|
+
this._semaphore = new za(1, t);
|
|
5316
5380
|
}
|
|
5317
5381
|
acquire() {
|
|
5318
|
-
return
|
|
5382
|
+
return Ha(this, arguments, void 0, function* (t = 0) {
|
|
5319
5383
|
const [, n] = yield this._semaphore.acquire(1, t);
|
|
5320
5384
|
return n;
|
|
5321
5385
|
});
|
|
@@ -5336,25 +5400,25 @@ class Qa {
|
|
|
5336
5400
|
return this._semaphore.cancel();
|
|
5337
5401
|
}
|
|
5338
5402
|
}
|
|
5339
|
-
class
|
|
5403
|
+
class _r extends Da {
|
|
5340
5404
|
constructor(t) {
|
|
5341
5405
|
super(), Object.assign(this, t);
|
|
5342
5406
|
}
|
|
5343
5407
|
}
|
|
5344
|
-
const
|
|
5408
|
+
const Ja = (e) => new _r(e), rl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5345
5409
|
__proto__: null,
|
|
5346
|
-
mutex:
|
|
5347
|
-
newMutex:
|
|
5348
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
5410
|
+
mutex: _r,
|
|
5411
|
+
newMutex: Ja
|
|
5412
|
+
}, Symbol.toStringTag, { value: "Module" })), Xa = (e) => JSON.stringify(e, (t, n) => typeof n == "bigint" ? n.toString() : n), Ka = async (e, t = 200, n = 20) => {
|
|
5349
5413
|
const r = Date.now();
|
|
5350
5414
|
for (; Date.now() - r < t; )
|
|
5351
5415
|
await e(), await new Promise((s) => setTimeout(s, n));
|
|
5352
|
-
},
|
|
5416
|
+
}, sl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5353
5417
|
__proto__: null,
|
|
5354
|
-
expectAlways:
|
|
5355
|
-
toString:
|
|
5356
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
5357
|
-
class
|
|
5418
|
+
expectAlways: Ka,
|
|
5419
|
+
toString: Xa
|
|
5420
|
+
}, Symbol.toStringTag, { value: "Module" })), Qa = (...e) => e.map(qr).join(""), qr = (e) => (e.endsWith("/") || (e += "/"), e.startsWith("/") && (e = e.slice(1)), e), tu = (e) => e.endsWith("/") ? e.slice(0, -1) : e, il = (e, t = "") => e === null ? "" : `?${Object.entries(e).filter(([, n]) => n == null ? !1 : Array.isArray(n) ? n.length > 0 : !0).map(([n, r]) => `${t}${n}=${r}`).join("&")}`;
|
|
5421
|
+
class _t {
|
|
5358
5422
|
protocol;
|
|
5359
5423
|
host;
|
|
5360
5424
|
port;
|
|
@@ -5366,7 +5430,7 @@ class Zt {
|
|
|
5366
5430
|
* @param pathPrefix - A path prefix to use for all requests. Defaults to "".
|
|
5367
5431
|
*/
|
|
5368
5432
|
constructor({ host: t, port: n, protocol: r = "", pathPrefix: s = "" }) {
|
|
5369
|
-
this.protocol = r, this.host = t, this.port = n, this.path =
|
|
5433
|
+
this.protocol = r, this.host = t, this.port = n, this.path = qr(s);
|
|
5370
5434
|
}
|
|
5371
5435
|
/**
|
|
5372
5436
|
* Replaces creates a new URL with the specified properties replaced.
|
|
@@ -5374,7 +5438,7 @@ class Zt {
|
|
|
5374
5438
|
* @returns a new URL.
|
|
5375
5439
|
*/
|
|
5376
5440
|
replace(t) {
|
|
5377
|
-
return new
|
|
5441
|
+
return new _t({
|
|
5378
5442
|
host: t.host ?? this.host,
|
|
5379
5443
|
port: t.port ?? this.port,
|
|
5380
5444
|
protocol: t.protocol ?? this.protocol,
|
|
@@ -5387,20 +5451,20 @@ class Zt {
|
|
|
5387
5451
|
* @returns a new URL.
|
|
5388
5452
|
*/
|
|
5389
5453
|
child(t) {
|
|
5390
|
-
return new
|
|
5454
|
+
return new _t({
|
|
5391
5455
|
...this,
|
|
5392
|
-
pathPrefix:
|
|
5456
|
+
pathPrefix: Qa(this.path, t)
|
|
5393
5457
|
});
|
|
5394
5458
|
}
|
|
5395
5459
|
/** @returns a string representation of the url */
|
|
5396
5460
|
toString() {
|
|
5397
|
-
return
|
|
5461
|
+
return tu(
|
|
5398
5462
|
`${this.protocol}://${this.host}:${this.port}/${this.path}`
|
|
5399
5463
|
);
|
|
5400
5464
|
}
|
|
5401
|
-
static UNKNOWN = new
|
|
5465
|
+
static UNKNOWN = new _t({ host: "unknown", port: 0 });
|
|
5402
5466
|
}
|
|
5403
|
-
class
|
|
5467
|
+
class hn {
|
|
5404
5468
|
sender;
|
|
5405
5469
|
handlers;
|
|
5406
5470
|
constructor(t) {
|
|
@@ -5411,12 +5475,12 @@ class fn {
|
|
|
5411
5475
|
n == null ? console.warn(`No handler for ${t.type}`) : n(t.payload);
|
|
5412
5476
|
}
|
|
5413
5477
|
route(t) {
|
|
5414
|
-
const n =
|
|
5478
|
+
const n = eu(t, this.sender), r = new nu(n);
|
|
5415
5479
|
return this.handlers.set(t, r), r;
|
|
5416
5480
|
}
|
|
5417
5481
|
}
|
|
5418
|
-
const
|
|
5419
|
-
class
|
|
5482
|
+
const eu = (e, t) => (n, r) => t({ type: e, payload: n }, r);
|
|
5483
|
+
class nu {
|
|
5420
5484
|
_send;
|
|
5421
5485
|
handler;
|
|
5422
5486
|
constructor(t) {
|
|
@@ -5429,102 +5493,101 @@ class ou {
|
|
|
5429
5493
|
this.handler = t;
|
|
5430
5494
|
}
|
|
5431
5495
|
}
|
|
5432
|
-
const
|
|
5496
|
+
const ol = () => {
|
|
5433
5497
|
let e, t;
|
|
5434
5498
|
const n = (s) => {
|
|
5435
5499
|
t.handle({ data: s });
|
|
5436
5500
|
}, r = (s) => {
|
|
5437
5501
|
e.handle({ data: s });
|
|
5438
5502
|
};
|
|
5439
|
-
return e = new
|
|
5440
|
-
},
|
|
5503
|
+
return e = new hn(n), t = new hn(r), [e, t];
|
|
5504
|
+
}, ru = (e) => e.nullable().transform((t) => t === null ? void 0 : t).optional(), su = c.int().min(0).max(Cn), iu = (e) => L.array(e).or(e.transform((t) => [t])), ou = (e) => e._zod.def.output, Fr = (e) => Ar(e, (t, n, r) => {
|
|
5441
5505
|
const s = n === r.length - 1, i = !isNaN(parseInt(t)), o = !isNaN(parseInt(r[n + 1]));
|
|
5442
5506
|
return i && (t = "element"), s || o ? t : [t, "shape"];
|
|
5443
|
-
}),
|
|
5507
|
+
}), dn = (e, t) => {
|
|
5444
5508
|
if (e == null) return null;
|
|
5445
5509
|
const n = e[t];
|
|
5446
5510
|
return n == null && typeof e == "object" && "sourceType" in e ? e.sourceType()[t] : n;
|
|
5447
|
-
},
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
{ ...n, getter:
|
|
5451
|
-
)),
|
|
5511
|
+
}, cu = ((e, t, n) => t === "" ? e : tn(
|
|
5512
|
+
dn(e, "shape"),
|
|
5513
|
+
Fr(t),
|
|
5514
|
+
{ ...n, getter: dn }
|
|
5515
|
+
)), cl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5452
5516
|
__proto__: null,
|
|
5453
|
-
functionOutput:
|
|
5454
|
-
getFieldSchema:
|
|
5455
|
-
getFieldSchemaPath:
|
|
5456
|
-
nullToUndefined:
|
|
5457
|
-
toArray:
|
|
5458
|
-
uint12:
|
|
5517
|
+
functionOutput: ou,
|
|
5518
|
+
getFieldSchema: cu,
|
|
5519
|
+
getFieldSchemaPath: Fr,
|
|
5520
|
+
nullToUndefined: ru,
|
|
5521
|
+
toArray: iu,
|
|
5522
|
+
uint12: su
|
|
5459
5523
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
5460
5524
|
export {
|
|
5461
5525
|
f as DataType,
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5526
|
+
O as Density,
|
|
5527
|
+
Uu as MultiSeries,
|
|
5528
|
+
T as Rate,
|
|
5529
|
+
hn as RoutedWorker,
|
|
5466
5530
|
q as Series,
|
|
5467
5531
|
p as Size,
|
|
5468
|
-
|
|
5532
|
+
A as TimeRange,
|
|
5469
5533
|
g as TimeSpan,
|
|
5470
5534
|
d as TimeStamp,
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
hl as zod
|
|
5535
|
+
nu as TypedWorker,
|
|
5536
|
+
_t as URL,
|
|
5537
|
+
uu as array,
|
|
5538
|
+
hu as binary,
|
|
5539
|
+
bu as bounds,
|
|
5540
|
+
Nu as box,
|
|
5541
|
+
Cu as breaker,
|
|
5542
|
+
il as buildQueryString,
|
|
5543
|
+
lu as caseconv,
|
|
5544
|
+
Bu as change,
|
|
5545
|
+
xo as clamp,
|
|
5546
|
+
Pu as color,
|
|
5547
|
+
yu as compare,
|
|
5548
|
+
Ru as control,
|
|
5549
|
+
Ro as convertDataType,
|
|
5550
|
+
ol as createMockWorkers,
|
|
5551
|
+
Lu as csv,
|
|
5552
|
+
ku as debounce,
|
|
5553
|
+
_u as deep,
|
|
5554
|
+
qu as destructor,
|
|
5555
|
+
vu as dimensions,
|
|
5556
|
+
Ou as direction,
|
|
5557
|
+
Fu as errors,
|
|
5558
|
+
mu as id,
|
|
5559
|
+
pu as instance,
|
|
5560
|
+
Jo as isCrudeSeries,
|
|
5561
|
+
ar as isTelemValue,
|
|
5562
|
+
Vu as kv,
|
|
5563
|
+
Wu as label,
|
|
5564
|
+
Yu as link,
|
|
5565
|
+
xu as location,
|
|
5566
|
+
zu as map,
|
|
5567
|
+
wu as math,
|
|
5568
|
+
Gu as migrate,
|
|
5569
|
+
fu as narrow,
|
|
5570
|
+
Hu as notation,
|
|
5571
|
+
Su as numericTimeRangeZ,
|
|
5572
|
+
Du as observe,
|
|
5573
|
+
Ju as optional,
|
|
5574
|
+
du as primitive,
|
|
5575
|
+
Xu as record,
|
|
5576
|
+
Ku as runtime,
|
|
5577
|
+
Mu as scale,
|
|
5578
|
+
Qu as scheduler,
|
|
5579
|
+
tl as shallow,
|
|
5580
|
+
ju as sleep,
|
|
5581
|
+
Au as spatial,
|
|
5582
|
+
el as status,
|
|
5583
|
+
Eu as sticky,
|
|
5584
|
+
nl as strings,
|
|
5585
|
+
rl as sync,
|
|
5586
|
+
sl as testutil,
|
|
5587
|
+
Zu as throttle,
|
|
5588
|
+
Tu as typedArrayZ,
|
|
5589
|
+
gu as unique,
|
|
5590
|
+
$u as uuid,
|
|
5591
|
+
Iu as xy,
|
|
5592
|
+
cl as zod
|
|
5530
5593
|
};
|