@synnaxlabs/x 0.37.0 → 0.38.1
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 +38 -34
- package/dist/binary.js +1 -1
- package/dist/box-DPJAbf32.js +201 -0
- package/dist/box-Daep7oxr.cjs +1 -0
- package/dist/box.cjs +1 -1
- package/dist/box.js +1 -1
- package/dist/caseconv.js +1 -1
- package/dist/compare.cjs +1 -1
- package/dist/compare.js +1 -1
- package/dist/external-C-dNgNQw.cjs +1 -0
- package/dist/external-CtAt3tnU.js +29 -0
- package/dist/external-DSKjMZ7J.cjs +1 -0
- package/dist/external-DqPrWKvU.js +47 -0
- package/dist/index-BG3Scw3G.cjs +1 -0
- package/dist/{index-HQonyH7n.js → index-BVC_8Cg9.js} +1 -1
- package/dist/{index-OHIRoCei.js → index-C3QzbIwt.js} +1 -1
- package/dist/index-D4NCYiQB.js +19 -0
- package/dist/{index-BfDeGfej.js → index-DizUWH6z.js} +8 -2
- package/dist/index-udOjA9d-.cjs +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +57 -55
- package/dist/kv.cjs +1 -1
- package/dist/kv.js +2 -2
- package/dist/link.cjs +1 -0
- package/dist/link.js +10 -0
- package/dist/{location-C5Ot4MVG.js → location-BVkZhfQG.js} +1 -1
- package/dist/location.js +1 -1
- package/dist/position-96CBRKEd.cjs +1 -0
- package/dist/position-uVDP52PM.js +85 -0
- package/dist/position.cjs +1 -1
- package/dist/position.js +1 -1
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +1 -1
- package/dist/{scale-BESJN9LG.cjs → scale-Bzjm1mhv.cjs} +1 -1
- package/dist/{scale-CV3O6tkY.js → scale-D_UMXSZN.js} +3 -3
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/{series-C_B2hAp9.js → series-Cwc_z2OS.js} +296 -286
- package/dist/series-DuOxifEy.cjs +11 -0
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +5 -5
- package/dist/src/breaker/breaker.d.ts.map +1 -1
- package/dist/src/breaker/index.d.ts.map +1 -1
- package/dist/src/caseconv/caseconv.d.ts.map +1 -1
- package/dist/src/deep/path.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/kv/external.d.ts +3 -0
- package/dist/src/kv/external.d.ts.map +1 -0
- package/dist/src/kv/index.d.ts +1 -1
- package/dist/src/kv/index.d.ts.map +1 -1
- package/dist/src/kv/mock.d.ts +24 -0
- package/dist/src/kv/mock.d.ts.map +1 -0
- package/dist/src/kv/mock.spec.d.ts +2 -0
- package/dist/src/kv/mock.spec.d.ts.map +1 -0
- package/dist/src/kv/types.d.ts +18 -18
- package/dist/src/kv/types.d.ts.map +1 -1
- package/dist/src/link/index.d.ts +2 -0
- package/dist/src/link/index.d.ts.map +1 -0
- package/dist/src/link/link.d.ts +2 -0
- package/dist/src/link/link.d.ts.map +1 -0
- package/dist/src/link/link.spec.d.ts +2 -0
- package/dist/src/link/link.spec.d.ts.map +1 -0
- package/dist/src/runtime/os.d.ts +7 -7
- package/dist/src/runtime/os.d.ts.map +1 -1
- package/dist/src/sleep/index.d.ts.map +1 -1
- package/dist/src/sleep/sleep.d.ts.map +1 -1
- package/dist/src/telem/index.d.ts +1 -1
- package/dist/src/telem/index.d.ts.map +1 -1
- package/dist/src/telem/series.d.ts +1 -0
- package/dist/src/telem/series.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +2 -0
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/src/testutil/index.d.ts +2 -0
- package/dist/src/testutil/index.d.ts.map +1 -0
- package/dist/src/testutil/testutil.d.ts +2 -0
- package/dist/src/testutil/testutil.d.ts.map +1 -0
- package/dist/src/unique/index.d.ts +2 -0
- package/dist/src/unique/index.d.ts.map +1 -0
- package/dist/src/unique/unique.d.ts +42 -0
- package/dist/src/unique/unique.d.ts.map +1 -0
- package/dist/src/unique/unique.spec.d.ts +2 -0
- package/dist/src/unique/unique.spec.d.ts.map +1 -0
- package/dist/src/url/url.d.ts +1 -1
- package/dist/src/url/url.d.ts.map +1 -1
- package/dist/src/zodutil/index.d.ts.map +1 -1
- package/dist/src/zodutil/zodutil.d.ts +1 -16
- package/dist/src/zodutil/zodutil.d.ts.map +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/dist/unique.cjs +1 -1
- package/dist/unique.js +2 -2
- package/dist/url.cjs +1 -1
- package/dist/url.js +5 -5
- package/dist/{xy-LADI2wVU.cjs → xy-Budz-qz-.cjs} +1 -1
- package/dist/{xy-DQdccWlc.js → xy-DxjPL2DZ.js} +4 -4
- package/dist/xy.cjs +1 -1
- package/dist/xy.js +1 -1
- package/dist/zodutil-BfrF8jE3.js +23 -0
- package/dist/zodutil-DFJyyQd2.cjs +1 -0
- package/dist/zodutil.cjs +1 -1
- package/dist/zodutil.js +1 -1
- package/eslint.config.js +1 -1
- package/package.json +7 -9
- package/src/binary/encoder.spec.ts +1 -1
- package/src/binary/encoder.ts +1 -1
- package/src/binary/index.ts +1 -1
- package/src/breaker/breaker.spec.ts +9 -0
- package/src/breaker/breaker.ts +9 -0
- package/src/breaker/index.ts +9 -0
- package/src/caseconv/caseconv.spec.ts +5 -21
- package/src/caseconv/caseconv.ts +16 -8
- package/src/caseconv/index.ts +1 -1
- package/src/change/change.ts +1 -1
- package/src/change/index.ts +1 -1
- package/src/clamp/clamp.ts +1 -1
- package/src/clamp/index.ts +1 -1
- package/src/compare/compare.spec.ts +1 -1
- package/src/compare/compare.ts +3 -3
- package/src/compare/index.ts +1 -1
- package/src/control/control.ts +1 -1
- package/src/control/index.ts +1 -1
- package/src/debounce/debounce.spec.ts +1 -1
- package/src/debounce/debounce.ts +1 -1
- package/src/debounce/index.ts +1 -1
- package/src/deep/copy.ts +1 -1
- package/src/deep/delete.spec.ts +1 -1
- package/src/deep/delete.ts +1 -1
- package/src/deep/difference.spec.ts +1 -1
- package/src/deep/difference.ts +1 -1
- package/src/deep/equal.spec.ts +1 -1
- package/src/deep/equal.ts +1 -1
- package/src/deep/external.ts +1 -1
- package/src/deep/index.ts +1 -1
- package/src/deep/merge.spec.ts +1 -1
- package/src/deep/merge.ts +1 -1
- package/src/deep/partial.ts +1 -1
- package/src/deep/path.spec.ts +2 -3
- package/src/deep/path.ts +4 -4
- package/src/destructor.ts +1 -1
- package/src/errors/errors.ts +1 -1
- package/src/errors/index.ts +1 -1
- package/src/id/id.ts +6 -6
- package/src/id/index.ts +1 -1
- package/src/identity.ts +1 -1
- package/src/index.ts +2 -1
- package/src/invert.ts +1 -1
- package/src/join.ts +1 -1
- package/src/{unique.ts → kv/external.ts} +3 -2
- package/src/kv/index.ts +2 -2
- package/src/kv/mock.spec.ts +101 -0
- package/src/kv/mock.ts +58 -0
- package/src/kv/types.ts +23 -29
- package/src/link/index.ts +10 -0
- package/src/link/link.spec.ts +68 -0
- package/src/link/link.ts +21 -0
- package/src/math/index.ts +1 -1
- package/src/math/math.spec.ts +1 -1
- package/src/math/math.ts +1 -1
- package/src/migrate/index.ts +1 -1
- package/src/migrate/migrate.spec.ts +1 -1
- package/src/migrate/migrate.ts +1 -1
- package/src/mock/MockGLBufferController.ts +1 -1
- package/src/mock/index.ts +1 -1
- package/src/numeric/index.ts +1 -1
- package/src/numeric/numeric.ts +1 -1
- package/src/observe/index.ts +1 -1
- package/src/observe/observe.ts +1 -1
- package/src/observe/obsever.spec.ts +1 -1
- package/src/optional.ts +1 -1
- package/src/primitive.ts +1 -1
- package/src/record.spec.ts +9 -0
- package/src/record.ts +1 -1
- package/src/renderable.ts +1 -1
- package/src/runtime/detect.ts +3 -3
- package/src/runtime/external.ts +1 -1
- package/src/runtime/index.ts +1 -1
- package/src/runtime/os.ts +21 -21
- package/src/search.ts +1 -1
- package/src/shallowCopy.ts +1 -1
- package/src/sleep/index.ts +9 -0
- package/src/sleep/sleep.ts +9 -0
- package/src/spatial/base.ts +1 -1
- package/src/spatial/bounds/bounds.spec.ts +4 -3
- package/src/spatial/bounds/bounds.ts +4 -4
- package/src/spatial/bounds/index.ts +1 -1
- package/src/spatial/box/box.spec.ts +1 -1
- package/src/spatial/box/box.ts +2 -2
- package/src/spatial/box/index.ts +1 -1
- package/src/spatial/dimensions/dimensions.spec.ts +1 -1
- package/src/spatial/dimensions/dimensions.ts +1 -1
- package/src/spatial/dimensions/index.ts +1 -1
- package/src/spatial/direction/direction.spec.ts +1 -1
- package/src/spatial/direction/direction.ts +1 -1
- package/src/spatial/direction/index.ts +1 -1
- package/src/spatial/external.ts +1 -1
- package/src/spatial/index.ts +1 -1
- package/src/spatial/location/index.ts +1 -1
- package/src/spatial/location/location.spec.ts +1 -1
- package/src/spatial/location/location.ts +2 -2
- package/src/spatial/position/index.ts +1 -1
- package/src/spatial/position/position.spec.ts +1 -1
- package/src/spatial/position/position.ts +1 -1
- package/src/spatial/scale/index.ts +1 -1
- package/src/spatial/scale/scale.spec.ts +1 -1
- package/src/spatial/scale/scale.ts +2 -2
- package/src/spatial/spatial.ts +1 -1
- package/src/spatial/xy/index.ts +1 -1
- package/src/spatial/xy/xy.spec.ts +1 -1
- package/src/spatial/xy/xy.ts +1 -1
- package/src/strings/index.ts +1 -1
- package/src/strings/strings.spec.ts +1 -1
- package/src/strings/strings.ts +1 -1
- package/src/telem/generate.ts +1 -1
- package/src/telem/gl.ts +1 -1
- package/src/telem/index.ts +2 -2
- package/src/telem/series.spec.ts +22 -1
- package/src/telem/series.ts +19 -12
- package/src/telem/telem.spec.ts +2 -2
- package/src/telem/telem.ts +35 -11
- package/src/testutil/index.ts +10 -0
- package/src/testutil/testutil.ts +14 -0
- package/src/toArray.ts +1 -1
- package/src/transform.ts +1 -1
- package/src/unique/index.ts +10 -0
- package/src/unique/unique.spec.ts +192 -0
- package/src/unique/unique.ts +67 -0
- package/src/url/index.ts +1 -1
- package/src/url/url.spec.ts +1 -1
- package/src/url/url.ts +2 -2
- package/src/worker/index.ts +1 -1
- package/src/worker/worker.spec.ts +1 -1
- package/src/worker/worker.ts +1 -1
- package/src/zodutil/index.ts +2 -2
- package/src/zodutil/zodutil.spec.ts +1 -1
- package/src/zodutil/zodutil.ts +3 -31
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +7 -9
- package/dist/box-BHIyGhI_.cjs +0 -1
- package/dist/box-CfhGfJJH.js +0 -201
- package/dist/external-CghVMqCA.cjs +0 -1
- package/dist/external-DKQKvgIi.js +0 -30
- package/dist/index-h-QAL9T1.cjs +0 -1
- package/dist/position-BXFz7I9G.js +0 -85
- package/dist/position-CFiSGTz9.cjs +0 -1
- package/dist/series-BbxR21uO.cjs +0 -11
- package/dist/src/unique.d.ts +0 -2
- package/dist/src/unique.d.ts.map +0 -1
- package/dist/types-BpAJW2TM.js +0 -11
- package/dist/types-zRwnQ1hc.cjs +0 -1
- package/dist/zodutil-BRjUdYAv.cjs +0 -1
- package/dist/zodutil-DI4gVZkT.js +0 -27
package/dist/box-CfhGfJJH.js
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import { z as x } from "zod";
|
|
2
|
-
import { c as M } from "./direction-CScbfCdT.js";
|
|
3
|
-
import { c as S, T as E, B as H, b as Z, d as q, e as v, f as N, l as D } from "./location-C5Ot4MVG.js";
|
|
4
|
-
import { Z as p, O as F, e as $, t as O, c as G, a as C } from "./xy-DQdccWlc.js";
|
|
5
|
-
import { x as j, X as P, Y as X } from "./base-DnZzEvvz.js";
|
|
6
|
-
const h = x.union([x.number(), x.string()]), Y = x.object({
|
|
7
|
-
top: h,
|
|
8
|
-
left: h,
|
|
9
|
-
width: h,
|
|
10
|
-
height: h
|
|
11
|
-
}), U = x.object({
|
|
12
|
-
left: x.number(),
|
|
13
|
-
top: x.number(),
|
|
14
|
-
right: x.number(),
|
|
15
|
-
bottom: x.number()
|
|
16
|
-
}), k = x.object({
|
|
17
|
-
one: j,
|
|
18
|
-
two: j,
|
|
19
|
-
root: S
|
|
20
|
-
}), R = { one: p, two: p, root: E }, J = { one: p, two: F, root: H }, W = (o, t) => ({
|
|
21
|
-
one: o.one,
|
|
22
|
-
two: o.two,
|
|
23
|
-
root: t ?? o.root
|
|
24
|
-
}), c = (o, t, e = 0, n = 0, r) => {
|
|
25
|
-
const s = {
|
|
26
|
-
one: { ...p },
|
|
27
|
-
two: { ...p },
|
|
28
|
-
root: r ?? E
|
|
29
|
-
};
|
|
30
|
-
if (typeof o == "number") {
|
|
31
|
-
if (typeof t != "number")
|
|
32
|
-
throw new Error("Box constructor called with invalid arguments");
|
|
33
|
-
return s.one = { x: o, y: t }, s.two = { x: s.one.x + e, y: s.one.y + n }, s;
|
|
34
|
-
}
|
|
35
|
-
return "one" in o && "two" in o && "root" in o ? { ...o, root: r ?? o.root } : ("getBoundingClientRect" in o && (o = o.getBoundingClientRect()), "left" in o ? (s.one = { x: o.left, y: o.top }, s.two = { x: o.right, y: o.bottom }, s) : (s.one = o, t == null ? s.two = { x: s.one.x + e, y: s.one.y + n } : typeof t == "number" ? s.two = { x: s.one.x + t, y: s.one.y + e } : "width" in t ? s.two = {
|
|
36
|
-
x: s.one.x + t.width,
|
|
37
|
-
y: s.one.y + t.height
|
|
38
|
-
} : "signedWidth" in t ? s.two = {
|
|
39
|
-
x: s.one.x + t.signedWidth,
|
|
40
|
-
y: s.one.y + t.signedHeight
|
|
41
|
-
} : s.two = t, s));
|
|
42
|
-
}, K = (o, t, e) => {
|
|
43
|
-
const n = c(o);
|
|
44
|
-
if (typeof t == "string") {
|
|
45
|
-
if (e == null) throw new Error("Invalid arguments for resize");
|
|
46
|
-
const r = M(t);
|
|
47
|
-
return c(
|
|
48
|
-
n.one,
|
|
49
|
-
void 0,
|
|
50
|
-
r === "x" ? e : u(n),
|
|
51
|
-
r === "y" ? e : l(n),
|
|
52
|
-
n.root
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
return c(n.one, t, void 0, void 0, n.root);
|
|
56
|
-
}, Q = (o, t, e = !0) => {
|
|
57
|
-
const n = c(o);
|
|
58
|
-
let r = (s, i) => s < i;
|
|
59
|
-
return e && (r = (s, i) => s <= i), "one" in t ? r(y(n), y(t)) && r(w(t), w(n)) && r(a(n), a(t)) && r(f(t), f(n)) : r(y(n), t.x) && r(t.x, w(n)) && r(a(n), t.y) && r(t.y, f(n));
|
|
60
|
-
}, V = (o, t) => $(o.one, t.one) && $(o.two, t.two) && Z(o.root, t.root), z = (o) => ({
|
|
61
|
-
width: u(o),
|
|
62
|
-
height: l(o)
|
|
63
|
-
}), oo = (o) => ({
|
|
64
|
-
signedWidth: _(o),
|
|
65
|
-
signedHeight: b(o)
|
|
66
|
-
}), to = (o) => ({
|
|
67
|
-
top: a(o),
|
|
68
|
-
left: y(o),
|
|
69
|
-
width: u(o),
|
|
70
|
-
height: l(o)
|
|
71
|
-
}), B = (o, t, e = !1) => {
|
|
72
|
-
const n = M(t) === "y" ? b(o) : _(o);
|
|
73
|
-
return e ? n : Math.abs(n);
|
|
74
|
-
}, g = (o, t) => {
|
|
75
|
-
const e = c(o);
|
|
76
|
-
return {
|
|
77
|
-
x: t.x === "center" ? T(e).x : d(e, t.x),
|
|
78
|
-
y: t.y === "center" ? T(e).y : d(e, t.y)
|
|
79
|
-
};
|
|
80
|
-
}, d = (o, t) => {
|
|
81
|
-
const e = c(o), n = q(e.root).includes(t) ? Math.min : Math.max;
|
|
82
|
-
return P.includes(t) ? n(e.one.x, e.two.x) : n(e.one.y, e.two.y);
|
|
83
|
-
}, no = (o) => o.one.x === o.two.x && o.one.y === o.two.y, u = (o) => B(o, "x"), l = (o) => B(o, "y"), _ = (o) => {
|
|
84
|
-
const t = c(o);
|
|
85
|
-
return t.two.x - t.one.x;
|
|
86
|
-
}, b = (o) => {
|
|
87
|
-
const t = c(o);
|
|
88
|
-
return t.two.y - t.one.y;
|
|
89
|
-
}, A = (o) => g(o, E), eo = (o) => g(o, v), so = (o) => g(o, H), ro = (o) => g(o, N), w = (o) => d(o, "right"), f = (o) => d(o, "bottom"), y = (o) => d(o, "left"), a = (o) => d(o, "top"), T = (o) => O(A(o), {
|
|
90
|
-
x: _(o) / 2,
|
|
91
|
-
y: b(o) / 2
|
|
92
|
-
}), I = (o) => {
|
|
93
|
-
const t = c(o);
|
|
94
|
-
return t.root.x === "left" ? y(t) : w(t);
|
|
95
|
-
}, L = (o) => {
|
|
96
|
-
const t = c(o);
|
|
97
|
-
return t.root.y === "top" ? a(t) : f(t);
|
|
98
|
-
}, co = (o) => ({ x: I(o), y: L(o) }), io = (o) => {
|
|
99
|
-
const t = c(o);
|
|
100
|
-
return { lower: t.one.x, upper: t.two.x };
|
|
101
|
-
}, xo = (o) => {
|
|
102
|
-
const t = c(o);
|
|
103
|
-
return { lower: t.one.y, upper: t.two.y };
|
|
104
|
-
}, yo = (o, t) => W(o, t), ao = (o, t) => {
|
|
105
|
-
const e = c(o), n = P.includes(t) ? "x" : X.includes(t) ? "y" : null;
|
|
106
|
-
if (n === null) throw new Error(`Invalid location: ${D}`);
|
|
107
|
-
const r = t === "top" || t === "left" ? Math.min : Math.max, s = { ...e.one }, i = { ...e.two };
|
|
108
|
-
return s[n] = r(e.one[n], e.two[n]), i[n] = r(e.one[n], e.two[n]), [s, i];
|
|
109
|
-
}, uo = (o, t) => {
|
|
110
|
-
const e = c(o), n = c(t), r = I(n) + (u(n) - u(e)) / 2, s = L(n) + (l(n) - l(e)) / 2;
|
|
111
|
-
return c({ x: r, y: s }, z(e));
|
|
112
|
-
}, lo = (o) => typeof o != "object" || o == null ? !1 : "one" in o && "two" in o && "root" in o, wo = (o) => u(o) / l(o), fo = (o, t, e) => {
|
|
113
|
-
if (typeof t == "string") {
|
|
114
|
-
if (e == null) throw new Error("Undefined amount passed into box.translate");
|
|
115
|
-
const r = M(t);
|
|
116
|
-
t = G(r, e);
|
|
117
|
-
}
|
|
118
|
-
const n = c(o);
|
|
119
|
-
return c(
|
|
120
|
-
O(n.one, t),
|
|
121
|
-
O(n.two, t),
|
|
122
|
-
void 0,
|
|
123
|
-
void 0,
|
|
124
|
-
n.root
|
|
125
|
-
);
|
|
126
|
-
}, mo = (o, t) => {
|
|
127
|
-
const e = Math.max(y(o), y(t)), n = Math.max(a(o), a(t)), r = Math.min(w(o), w(t)), s = Math.min(f(o), f(t));
|
|
128
|
-
return e > r || n > s ? R : c({ x: e, y: n }, { x: r, y: s }, void 0, void 0, o.root);
|
|
129
|
-
}, po = (o) => u(o) * l(o), go = (o, t) => {
|
|
130
|
-
const e = c(o);
|
|
131
|
-
return c(
|
|
132
|
-
C(e.one, t),
|
|
133
|
-
C(e.two, t),
|
|
134
|
-
void 0,
|
|
135
|
-
void 0,
|
|
136
|
-
e.root
|
|
137
|
-
);
|
|
138
|
-
}, ho = (o, t, e, n, r, s) => {
|
|
139
|
-
const i = { x: o, y: t }, m = { x: o + e, y: t + n };
|
|
140
|
-
return r.x !== s.x && (r.x === "center" ? (i.x -= e / 2, m.x -= e / 2) : (i.x -= e, m.x -= e)), r.y !== s.y && (r.y === "center" ? (i.y -= n / 2, m.y -= n / 2) : (i.y -= n, m.y -= n)), c(i, m, void 0, void 0, s);
|
|
141
|
-
}, Eo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
142
|
-
__proto__: null,
|
|
143
|
-
DECIMAL: J,
|
|
144
|
-
ZERO: R,
|
|
145
|
-
area: po,
|
|
146
|
-
areaIsZero: no,
|
|
147
|
-
aspect: wo,
|
|
148
|
-
bottom: f,
|
|
149
|
-
bottomLeft: so,
|
|
150
|
-
bottomRight: ro,
|
|
151
|
-
box: k,
|
|
152
|
-
center: T,
|
|
153
|
-
construct: c,
|
|
154
|
-
constructWithAlternateRoot: ho,
|
|
155
|
-
contains: Q,
|
|
156
|
-
copy: W,
|
|
157
|
-
css: to,
|
|
158
|
-
cssBox: Y,
|
|
159
|
-
dim: B,
|
|
160
|
-
dims: z,
|
|
161
|
-
domRect: U,
|
|
162
|
-
edgePoints: ao,
|
|
163
|
-
equals: V,
|
|
164
|
-
height: l,
|
|
165
|
-
intersection: mo,
|
|
166
|
-
isBox: lo,
|
|
167
|
-
left: y,
|
|
168
|
-
loc: d,
|
|
169
|
-
positionInCenter: uo,
|
|
170
|
-
reRoot: yo,
|
|
171
|
-
resize: K,
|
|
172
|
-
right: w,
|
|
173
|
-
root: co,
|
|
174
|
-
signedDims: oo,
|
|
175
|
-
signedHeight: b,
|
|
176
|
-
signedWidth: _,
|
|
177
|
-
top: a,
|
|
178
|
-
topLeft: A,
|
|
179
|
-
topRight: eo,
|
|
180
|
-
translate: fo,
|
|
181
|
-
truncate: go,
|
|
182
|
-
width: u,
|
|
183
|
-
x: I,
|
|
184
|
-
xBounds: io,
|
|
185
|
-
xyLoc: g,
|
|
186
|
-
y: L,
|
|
187
|
-
yBounds: xo
|
|
188
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
189
|
-
export {
|
|
190
|
-
ho as a,
|
|
191
|
-
Eo as b,
|
|
192
|
-
c,
|
|
193
|
-
po as d,
|
|
194
|
-
lo as e,
|
|
195
|
-
io as f,
|
|
196
|
-
l as h,
|
|
197
|
-
mo as i,
|
|
198
|
-
u as w,
|
|
199
|
-
g as x,
|
|
200
|
-
xo as y
|
|
201
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("zod"),t=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null?"node":typeof window>"u"||window.document===void 0?"webworker":"browser",u=t(),s=["MacOS","Windows","Linux","Docker"],c=["macos","windows","linux","docker"],d={macos:"MacOS",windows:"Windows",linux:"Linux",docker:"Docker"},l=r.z.enum(s).or(r.z.enum(c).transform(e=>d[e]));let n;const f=()=>{if(typeof window>"u")return;const e=window.navigator.userAgent.toLowerCase();if(e.includes("mac"))return"MacOS";if(e.includes("win"))return"Windows";if(e.includes("linux"))return"Linux"},w=(e={})=>{const{force:o,default:i}=e;return o??n??(n=f(),n??i)},a=Object.freeze(Object.defineProperty({__proto__:null,OPERATING_SYSTEMS:s,RUNTIME:u,detect:t,getOS:w,osZ:l},Symbol.toStringTag,{value:"Module"}));exports.external=a;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { z as r } from "zod";
|
|
2
|
-
const t = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", u = t(), i = ["MacOS", "Windows", "Linux", "Docker"], c = ["macos", "windows", "linux", "docker"], d = {
|
|
3
|
-
macos: "MacOS",
|
|
4
|
-
windows: "Windows",
|
|
5
|
-
linux: "Linux",
|
|
6
|
-
docker: "Docker"
|
|
7
|
-
}, l = r.enum(i).or(
|
|
8
|
-
r.enum(c).transform((e) => d[e])
|
|
9
|
-
);
|
|
10
|
-
let n;
|
|
11
|
-
const f = () => {
|
|
12
|
-
if (typeof window > "u") return;
|
|
13
|
-
const e = window.navigator.userAgent.toLowerCase();
|
|
14
|
-
if (e.includes("mac")) return "MacOS";
|
|
15
|
-
if (e.includes("win")) return "Windows";
|
|
16
|
-
if (e.includes("linux")) return "Linux";
|
|
17
|
-
}, w = (e = {}) => {
|
|
18
|
-
const { force: o, default: s } = e;
|
|
19
|
-
return o ?? n ?? (n = f(), n ?? s);
|
|
20
|
-
}, S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
21
|
-
__proto__: null,
|
|
22
|
-
OPERATING_SYSTEMS: i,
|
|
23
|
-
RUNTIME: u,
|
|
24
|
-
detect: t,
|
|
25
|
-
getOS: w,
|
|
26
|
-
osZ: l
|
|
27
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
28
|
-
export {
|
|
29
|
-
S as e
|
|
30
|
-
};
|
package/dist/index-h-QAL9T1.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const m=require("./unique.cjs"),l=e=>e!=null&&typeof e=="object"&&"toString"in e,T=e=>{if(l(e))return(e==null?void 0:e.toString().length)===0;switch(typeof e){case"string":return e.length===0;case"number":return e===0;case"bigint":return e===0n;case"boolean":return!e;case"undefined":return!0;case"object":return e===null}},g=(e,t=!1)=>{const o=l(e)?"stringer":typeof e;let r;switch(o){case"string":r=(n,s)=>n.localeCompare(s);break;case"stringer":r=(n,s)=>n.toString().localeCompare(s.toString());break;case"number":r=(n,s)=>Number(n)-Number(s);break;case"bigint":r=(n,s)=>BigInt(n)-BigInt(s)>0n?1:-1;break;case"boolean":r=(n,s)=>Number(n)-Number(s);break;case"undefined":r=()=>0;break;default:return console.warn(`sortFunc: unknown type ${o}`),()=>-1}return t?h(r):r},A=(e,t,o)=>{const r=g(t[e],o);return(n,s)=>r(n[e],s[e])},E=(e,t)=>e.length!==t.length?e.length-t.length:e.every((o,r)=>o===t[r])?0:-1,b=(e,t)=>{if(e.length!==t.length)return e.length-t.length;if(e.length===0)return 0;const o=g(e[0]),r=[...e].sort(o),n=[...t].sort(o);return r.every((s,i)=>s===n[i])?0:-1},q=(e,t)=>{const o=m.unique(e),r=m.unique(t);return b(o,r)},_=(e,t)=>e===t?0:e==="first"&&t==="last"?1:-1,h=e=>(t,o)=>e(o,t),c=0,N=-1,f=1,p=e=>e<c,d=e=>e>c,y=e=>e>=c,S=e=>e===c,w=(e,t)=>{const o=/([a-zA-Z]+)|(\d+)/g,r=e.replace(/[\s_.-]+/g,"").match(o),n=t.replace(/[\s_.-]+/g,"").match(o);if(!r||!n)return 0;for(let s=0;s<Math.min(r.length,n.length);s++){const i=r[s],a=n[s];if(isNaN(Number(i))&&isNaN(Number(a))){const u=i.localeCompare(a);if(u!==0)return u}else if(!isNaN(Number(i))&&!isNaN(Number(a))){const u=Number(i)-Number(a);if(u!==0)return u}else return isNaN(Number(i))?-1:1}return r.length-n.length},F=Object.freeze(Object.defineProperty({__proto__:null,EQUAL:c,GREATER_THAN:f,LESS_THAN:N,isEqualTo:S,isGreaterThan:d,isGreaterThanEqual:y,isLessThan:p,newF:g,newFieldF:A,order:_,primitiveArrays:E,reverseF:h,stringsWithNumbers:w,uniqueUnorderedPrimitiveArrays:q,unorderedPrimitiveArrays:b},Symbol.toStringTag,{value:"Module"}));exports.EQUAL=c;exports.GREATER_THAN=f;exports.LESS_THAN=N;exports.compare=F;exports.isEqualTo=S;exports.isGreaterThan=d;exports.isLessThan=p;exports.isStringer=l;exports.newF=g;exports.primitiveIsZero=T;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { c as g, x as v, a as I, h as M, w as N, d as X, i as j } from "./box-CfhGfJJH.js";
|
|
2
|
-
import { c as w } from "./direction-CScbfCdT.js";
|
|
3
|
-
import { x as B, a as h, b as C, C as O, T as R, s as m, X as S } from "./location-C5Ot4MVG.js";
|
|
4
|
-
import { l as Y } from "./base-DnZzEvvz.js";
|
|
5
|
-
const P = (t) => {
|
|
6
|
-
if (t == null) return { x: void 0, y: void 0 };
|
|
7
|
-
const s = B.safeParse(t);
|
|
8
|
-
if (s.success) return s.data;
|
|
9
|
-
const o = Y.safeParse(t);
|
|
10
|
-
return o.success ? w(o.data) === "x" ? { x: o.data, y: void 0 } : { x: void 0, y: o.data } : t;
|
|
11
|
-
}, D = ({
|
|
12
|
-
container: t,
|
|
13
|
-
target: s,
|
|
14
|
-
dialog: o,
|
|
15
|
-
initial: c,
|
|
16
|
-
prefer: a,
|
|
17
|
-
alignments: d = ["start"],
|
|
18
|
-
disable: f = []
|
|
19
|
-
}) => {
|
|
20
|
-
const n = P(c);
|
|
21
|
-
let u = S;
|
|
22
|
-
if (a != null) {
|
|
23
|
-
const e = a.map((r) => P(r));
|
|
24
|
-
u = u.slice().sort((r, x) => {
|
|
25
|
-
const i = e.findIndex((y) => h(r, y)), p = e.findIndex((y) => h(x, y));
|
|
26
|
-
return i > -1 && p > -1 ? i - p : i > -1 ? -1 : p > -1 ? 1 : 0;
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
const T = u.filter(
|
|
30
|
-
(e) => !C(e, O) && (n.x == null || e.x === n.x) && (n.y == null || e.y === n.y) && !f.some((r) => h(e, r))
|
|
31
|
-
).map((e) => d == null ? void 0 : d.map((r) => [e, r])).flat(), E = g(t), b = g(s), _ = g(o);
|
|
32
|
-
let L = -1 / 0;
|
|
33
|
-
const l = { location: O, adjustedDialog: _ };
|
|
34
|
-
return T.forEach(([e, r]) => {
|
|
35
|
-
const [x, i] = G({
|
|
36
|
-
option: e,
|
|
37
|
-
alignment: r,
|
|
38
|
-
container: E,
|
|
39
|
-
target: b,
|
|
40
|
-
dialog: _
|
|
41
|
-
});
|
|
42
|
-
i > L && (L = i, l.location = e, l.adjustedDialog = x);
|
|
43
|
-
}), l;
|
|
44
|
-
}, G = ({
|
|
45
|
-
option: t,
|
|
46
|
-
alignment: s,
|
|
47
|
-
container: o,
|
|
48
|
-
target: c,
|
|
49
|
-
dialog: a
|
|
50
|
-
}) => {
|
|
51
|
-
const d = A(t, s), f = v(c, t), n = I(
|
|
52
|
-
f.x,
|
|
53
|
-
f.y,
|
|
54
|
-
N(a),
|
|
55
|
-
M(a),
|
|
56
|
-
d,
|
|
57
|
-
R
|
|
58
|
-
), u = X(j(n, o));
|
|
59
|
-
return [n, u];
|
|
60
|
-
}, $ = {
|
|
61
|
-
start: "left",
|
|
62
|
-
center: "center",
|
|
63
|
-
end: "right"
|
|
64
|
-
}, q = {
|
|
65
|
-
start: "bottom",
|
|
66
|
-
center: "center",
|
|
67
|
-
end: "top"
|
|
68
|
-
}, A = (t, s) => {
|
|
69
|
-
const o = { x: "center", y: "center" };
|
|
70
|
-
if (t.y !== "center") {
|
|
71
|
-
o.y = m(t.y);
|
|
72
|
-
const c = t.x === "left" ? m : (a) => a;
|
|
73
|
-
o.x = c($[s]);
|
|
74
|
-
} else
|
|
75
|
-
o.x = m(t.x), o.y = q[s];
|
|
76
|
-
return o;
|
|
77
|
-
}, H = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
78
|
-
__proto__: null,
|
|
79
|
-
dialog: D,
|
|
80
|
-
getRoot: A,
|
|
81
|
-
parseLocationOptions: P
|
|
82
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
83
|
-
export {
|
|
84
|
-
H as p
|
|
85
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("./box-BHIyGhI_.cjs"),T=require("./direction-D7qoo_GJ.cjs"),r=require("./location-BIet4Mig.cjs"),b=require("./base-B48bPNx5.cjs"),P=t=>{if(t==null)return{x:void 0,y:void 0};const s=r.xy.safeParse(t);if(s.success)return s.data;const e=b.location.safeParse(t);return e.success?T.construct(e.data)==="x"?{x:e.data,y:void 0}:{x:void 0,y:e.data}:t},N=({container:t,target:s,dialog:e,initial:u,prefer:a,alignments:l=["start"],disable:f=[]})=>{const i=P(u);let x=r.XY_LOCATIONS;if(a!=null){const o=a.map(c=>P(c));x=x.slice().sort((c,p)=>{const d=o.findIndex(g=>r.xyMatches(c,g)),h=o.findIndex(g=>r.xyMatches(p,g));return d>-1&&h>-1?d-h:d>-1?-1:h>-1?1:0})}const O=x.filter(o=>!r.xyEquals(o,r.CENTER)&&(i.x==null||o.x===i.x)&&(i.y==null||o.y===i.y)&&!f.some(c=>r.xyMatches(o,c))).map(o=>l==null?void 0:l.map(c=>[o,c])).flat(),A=n.construct(t),M=n.construct(s),_=n.construct(e);let E=-1/0;const y={location:r.CENTER,adjustedDialog:_};return O.forEach(([o,c])=>{const[p,d]=v({option:o,alignment:c,container:A,target:M,dialog:_});d>E&&(E=d,y.location=o,y.adjustedDialog=p)}),y},v=({option:t,alignment:s,container:e,target:u,dialog:a})=>{const l=L(t,s),f=n.xyLoc(u,t),i=n.constructWithAlternateRoot(f.x,f.y,n.width(a),n.height(a),l,r.TOP_LEFT),x=n.area(n.intersection(i,e));return[i,x]},I={start:"left",center:"center",end:"right"},j={start:"bottom",center:"center",end:"top"},L=(t,s)=>{const e={x:"center",y:"center"};if(t.y!=="center"){e.y=r.swap(t.y);const u=t.x==="left"?r.swap:a=>a;e.x=u(I[s])}else e.x=r.swap(t.x),e.y=j[s];return e},q=Object.freeze(Object.defineProperty({__proto__:null,dialog:N,getRoot:L,parseLocationOptions:P},Symbol.toStringTag,{value:"Module"}));exports.position=q;
|
package/dist/series-BbxR21uO.cjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";var tt=Object.defineProperty;var et=(o,t,e)=>t in o?tt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var s=(o,t,e)=>et(o,typeof t!="symbol"?t+"":t,e);const l=require("zod"),L=require("./index-CnclyYpG.cjs"),rt=require("./index-Dd8DLyMx.cjs"),nt=require("./index-h-QAL9T1.cjs"),w=require("./bounds-8aFLdbEj.cjs");require("./box-BHIyGhI_.cjs");require("./dimensions-zMcb9pMk.cjs");require("./base-B48bPNx5.cjs");require("./location-BIet4Mig.cjs");require("./scale-BESJN9LG.cjs");require("./xy-LADI2wVU.cjs");const st=require("./zodutil-BRjUdYAv.cjs");let it=(o,t=21)=>(e=t)=>{let r="",i=e|0;for(;i--;)r+=o[Math.random()*o.length|0];return r};const at="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",K=it(at,11),ut=Object.freeze(Object.defineProperty({__proto__:null,id:K},Symbol.toStringTag,{value:"Module"})),ot=l.z.enum(["static","dynamic"]),X=(o,t)=>{const e=new m(t);if(![O.DAY,O.HOUR,O.MINUTE,O.SECOND,O.MILLISECOND,O.MICROSECOND,O.NANOSECOND].some(i=>i.equals(e)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const r=o.valueOf()%e.valueOf();return o instanceof m?new m(r):new O(r)},a=class a{constructor(t,e="UTC"){s(this,"value");s(this,"encodeValue",!0);if(t==null)this.value=a.now().valueOf();else if(t instanceof Date)this.value=BigInt(t.getTime())*a.MILLISECOND.valueOf();else if(typeof t=="string")this.value=a.parseDateTimeString(t,e).valueOf();else if(Array.isArray(t))this.value=a.parseDate(t);else{let r=BigInt(0);t instanceof Number&&(t=t.valueOf()),e==="local"&&(r=a.utcOffset.valueOf()),typeof t=="number"&&(isFinite(t)?t=Math.trunc(t):(isNaN(t)&&(t=0),t===1/0?t=a.MAX:t=a.MIN)),this.value=BigInt(t.valueOf())+r}}static parseDate([t=1970,e=1,r=1]){const i=new Date(t,e-1,r,0,0,0,0);return new a(BigInt(i.getTime())*a.MILLISECOND.valueOf()).truncate(a.DAY).valueOf()}encode(){return this.value.toString()}valueOf(){return this.value}static parseTimeString(t,e="UTC"){const[r,i,c]=t.split(":");let h="00",v="00";c!=null&&([h,v]=c.split("."));let y=a.hours(parseInt(r??"00")).add(a.minutes(parseInt(i??"00"))).add(a.seconds(parseInt(h??"00"))).add(a.milliseconds(parseInt(v??"00")));return e==="local"&&(y=y.add(a.utcOffset)),y.valueOf()}static parseDateTimeString(t,e="UTC"){if(!t.includes("/")&&!t.includes("-"))return a.parseTimeString(t,e);const r=new Date(t);return t.includes(":")||r.setUTCHours(0,0,0,0),new a(BigInt(r.getTime())*a.MILLISECOND.valueOf(),e).valueOf()}fString(t="ISO",e="UTC"){switch(t){case"ISODate":return this.toISOString(e).slice(0,10);case"ISOTime":return this.toISOString(e).slice(11,23);case"time":return this.timeString(!1,e);case"preciseTime":return this.timeString(!0,e);case"date":return this.dateString();case"preciseDate":return`${this.dateString()} ${this.timeString(!0,e)}`;case"dateTime":return`${this.dateString()} ${this.timeString(!1,e)}`;default:return this.toISOString(e)}}toISOString(t="UTC"){return t==="UTC"?this.date().toISOString():this.sub(a.utcOffset).date().toISOString()}timeString(t=!1,e="UTC"){const r=this.toISOString(e);return t?r.slice(11,23):r.slice(11,19)}dateString(){const t=this.date(),e=t.toLocaleString("default",{month:"short"}),r=t.toLocaleString("default",{day:"numeric"});return`${e} ${r}`}static get utcOffset(){return new O(BigInt(new Date().getTimezoneOffset())*a.MINUTE.valueOf())}static since(t){return new a().span(t)}date(){return new Date(this.milliseconds)}equals(t){return this.valueOf()===new a(t).valueOf()}span(t){return this.range(t).span}range(t){return new M(this,t).makeValid()}spanRange(t){return this.range(this.add(t)).makeValid()}get isZero(){return this.valueOf()===BigInt(0)}after(t){return this.valueOf()>new a(t).valueOf()}afterEq(t){return this.valueOf()>=new a(t).valueOf()}before(t){return this.valueOf()<new a(t).valueOf()}beforeEq(t){return this.valueOf()<=new a(t).valueOf()}add(t){return new a(this.valueOf()+BigInt(t.valueOf()))}sub(t){return new a(this.valueOf()-BigInt(t.valueOf()))}get hours(){return Number(this.valueOf())/Number(O.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(O.MINUTE.valueOf())}get days(){return Number(this.valueOf())/Number(O.DAY.valueOf())}get seconds(){return Number(this.valueOf())/Number(O.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(a.MILLISECOND.valueOf())}get year(){return this.date().getFullYear()}setYear(t){const e=this.date();return e.setFullYear(t),new a(e)}get month(){return this.date().getMonth()}setMonth(t){const e=this.date();return e.setMonth(t),new a(e)}get day(){return this.date().getDate()}setDay(t){const e=this.date();return e.setDate(t),new a(e)}get hour(){return this.date().getHours()}setHour(t){const e=this.date();return e.setHours(t),new a(e)}get minute(){return this.date().getMinutes()}setMinute(t){const e=this.date();return e.setMinutes(t),new a(e)}get second(){return this.date().getSeconds()}setSecond(t){const e=this.date();return e.setSeconds(t),new a(e)}get millisecond(){return this.date().getMilliseconds()}setMillisecond(t){const e=this.date();return e.setMilliseconds(t),new a(e)}toString(){return this.date().toISOString()}remainder(t){return X(this,t)}get isToday(){return this.truncate(O.DAY).equals(a.now().truncate(O.DAY))}truncate(t){return this.sub(this.remainder(t))}static now(){return new a(new Date)}static max(...t){let e=a.MIN;for(const r of t){const i=new a(r);i.after(e)&&(e=i)}return e}static min(...t){let e=a.MAX;for(const r of t){const i=new a(r);i.before(e)&&(e=i)}return e}static nanoseconds(t){return new a(t)}static microseconds(t){return a.nanoseconds(t*1e3)}static milliseconds(t){return a.microseconds(t*1e3)}static seconds(t){return a.milliseconds(t*1e3)}static minutes(t){return a.seconds(t*60)}static hours(t){return a.minutes(t*60)}static days(t){return a.hours(t*24)}};s(a,"NANOSECOND",a.nanoseconds(1)),s(a,"MICROSECOND",a.microseconds(1)),s(a,"MILLISECOND",a.milliseconds(1)),s(a,"SECOND",a.seconds(1)),s(a,"MINUTE",a.minutes(1)),s(a,"HOUR",a.hours(1)),s(a,"DAY",a.days(1)),s(a,"MAX",new a((1n<<63n)-1n)),s(a,"MIN",new a(0)),s(a,"ZERO",new a(0)),s(a,"z",l.z.union([l.z.object({value:l.z.bigint()}).transform(t=>new a(t.value)),l.z.string().transform(t=>new a(BigInt(t))),l.z.instanceof(Number).transform(t=>new a(t)),l.z.number().transform(t=>new a(t)),l.z.instanceof(a)]));let m=a;const u=class u{constructor(t){s(this,"value");s(this,"encodeValue",!0);typeof t=="number"&&(t=Math.trunc(t.valueOf())),this.value=BigInt(t.valueOf())}static fromSeconds(t){return t instanceof u?t:t instanceof D?t.period:t instanceof m?new u(t):["number","bigint"].includes(typeof t)?u.seconds(t):new u(t)}static fromMilliseconds(t){return t instanceof u?t:t instanceof D?t.period:t instanceof m?new u(t):["number","bigint"].includes(typeof t)?u.milliseconds(t):new u(t)}encode(){return this.value.toString()}valueOf(){return this.value}lessThan(t){return this.valueOf()<new u(t).valueOf()}greaterThan(t){return this.valueOf()>new u(t).valueOf()}lessThanOrEqual(t){return this.valueOf()<=new u(t).valueOf()}greaterThanOrEqual(t){return this.valueOf()>=new u(t).valueOf()}remainder(t){return X(this,t)}truncate(t){return new u(BigInt(Math.trunc(Number(this.valueOf()/t.valueOf())))*t.valueOf())}toString(){const t=this.truncate(u.DAY),e=this.truncate(u.HOUR),r=this.truncate(u.MINUTE),i=this.truncate(u.SECOND),c=this.truncate(u.MILLISECOND),h=this.truncate(u.MICROSECOND),v=this.truncate(u.NANOSECOND),y=t,S=e.sub(t),A=r.sub(e),f=i.sub(r),R=c.sub(i),C=h.sub(c),Y=v.sub(h);let B="";return y.isZero||(B+=`${y.days}d `),S.isZero||(B+=`${S.hours}h `),A.isZero||(B+=`${A.minutes}m `),f.isZero||(B+=`${f.seconds}s `),R.isZero||(B+=`${R.milliseconds}ms `),C.isZero||(B+=`${C.microseconds}µs `),Y.isZero||(B+=`${Y.nanoseconds}ns`),B.trim()}mult(t){return new u(this.valueOf()*BigInt(t))}get days(){return Number(this.valueOf())/Number(u.DAY.valueOf())}get hours(){return Number(this.valueOf())/Number(u.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(u.MINUTE.valueOf())}get seconds(){return Number(this.valueOf())/Number(u.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(u.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(u.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get isZero(){return this.valueOf()===BigInt(0)}equals(t){return this.valueOf()===new u(t).valueOf()}add(t){return new u(this.valueOf()+new u(t).valueOf())}sub(t){return new u(this.valueOf()-new u(t).valueOf())}static nanoseconds(t=1){return new u(t)}static microseconds(t=1){return u.nanoseconds(w.mult(t,1e3))}static milliseconds(t=1){return u.microseconds(w.mult(t,1e3))}static seconds(t=1){return u.milliseconds(w.mult(t,1e3))}static minutes(t=1){return u.seconds(w.mult(t,60))}static hours(t){return u.minutes(w.mult(t,60))}static days(t){return u.hours(w.mult(t,24))}};s(u,"NANOSECOND",u.nanoseconds(1)),s(u,"MICROSECOND",u.microseconds(1)),s(u,"MILLISECOND",u.milliseconds(1)),s(u,"SECOND",u.seconds(1)),s(u,"MINUTE",u.minutes(1)),s(u,"HOUR",u.hours(1)),s(u,"DAY",u.days(1)),s(u,"MAX",new u((1n<<63n)-1n)),s(u,"MIN",new u(0)),s(u,"ZERO",new u(0)),s(u,"z",l.z.union([l.z.object({value:l.z.bigint()}).transform(t=>new u(t.value)),l.z.string().transform(t=>new u(BigInt(t))),l.z.instanceof(Number).transform(t=>new u(t)),l.z.number().transform(t=>new u(t)),l.z.instanceof(u)]));let O=u;const p=class p extends Number{constructor(t){t instanceof Number?super(t.valueOf()):super(t)}toString(){return`${this.valueOf()} Hz`}equals(t){return this.valueOf()===new p(t).valueOf()}get period(){return O.seconds(1/this.valueOf())}sampleCount(t){return new O(t).seconds*this.valueOf()}byteCount(t,e){return this.sampleCount(t)*new I(e).valueOf()}span(t){return O.seconds(t/this.valueOf())}byteSpan(t,e){return this.span(t.valueOf()/e.valueOf())}static hz(t){return new p(t)}static khz(t){return p.hz(t*1e3)}};s(p,"z",l.z.union([l.z.number().transform(t=>new p(t)),l.z.instanceof(Number).transform(t=>new p(t)),l.z.instanceof(p)]));let D=p;const b=class b extends Number{constructor(t){t instanceof Number?super(t.valueOf()):super(t)}length(t){return t.valueOf()/this.valueOf()}size(t){return new U(t*this.valueOf())}};s(b,"UNKNOWN",new b(0)),s(b,"BIT128",new b(16)),s(b,"BIT64",new b(8)),s(b,"BIT32",new b(4)),s(b,"BIT16",new b(2)),s(b,"BIT8",new b(1)),s(b,"z",l.z.union([l.z.number().transform(t=>new b(t)),l.z.instanceof(Number).transform(t=>new b(t)),l.z.instanceof(b)]));let I=b;const N=class N{constructor(t,e){s(this,"start");s(this,"end");typeof t=="object"&&"start"in t?(this.start=new m(t.start),this.end=new m(t.end)):(this.start=new m(t),this.end=new m(e))}get span(){return new O(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.span.isZero}get numeric(){return{start:Number(this.start.valueOf()),end:Number(this.end.valueOf())}}swap(){return new N(this.end,this.start)}equals(t){return this.start.equals(t.start)&&this.end.equals(t.end)}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.fString("preciseDate")} - ${this.span.toString()}`}overlapsWith(t,e=O.ZERO){t=t.makeValid();const r=this.makeValid();if(this.equals(t))return!0;if(t.end.equals(r.start)||r.end.equals(t.start))return!1;const i=m.max(r.start,t.start),c=m.min(r.end,t.end);return c.before(i)?!1:new O(c.sub(i)).greaterThanOrEqual(e)}roughlyEquals(t,e){let r=this.start.sub(t.start).valueOf(),i=this.end.sub(t.end).valueOf();return r<0&&(r=-r),i<0&&(i=-i),r<=e.valueOf()&&i<=e.valueOf()}contains(t){return t instanceof N?this.contains(t.start)&&this.contains(t.end):this.start.beforeEq(t)&&this.end.after(t)}boundBy(t){const e=new N(this.start,this.end);return t.start.after(this.start)&&(e.start=t.start),t.start.after(this.end)&&(e.end=t.start),t.end.before(this.end)&&(e.end=t.end),t.end.before(this.start)&&(e.start=t.end),e}};s(N,"MAX",new N(m.MIN,m.MAX)),s(N,"MIN",new N(m.MAX,m.MIN)),s(N,"ZERO",new N(m.ZERO,m.ZERO)),s(N,"z",l.z.union([l.z.object({start:m.z,end:m.z}).transform(t=>new N(t.start,t.end)),l.z.instanceof(N)]));let M=N;const lt=(o,t)=>o.start.before(t.start)?-1:o.start.after(t.start)?1:o.end.before(t.end)?-1:o.end.after(t.end)?1:0,n=class n extends String{constructor(t){if(t instanceof n||typeof t=="string"||typeof t.valueOf()=="string"){super(t.valueOf());return}const e=n.ARRAY_CONSTRUCTOR_DATA_TYPES.get(t.constructor.name);if(e!=null){super(e.valueOf());return}throw super(n.UNKNOWN.valueOf()),new Error(`unable to find data type for ${t.toString()}`)}get Array(){const t=n.ARRAY_CONSTRUCTORS.get(this.toString());if(t==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return t}equals(t){return this.valueOf()===t.valueOf()}matches(...t){return t.some(e=>this.equals(e))}toString(){return this.valueOf()}get isVariable(){return this.equals(n.JSON)||this.equals(n.STRING)}get isNumeric(){return!this.isVariable&&!this.equals(n.UUID)}get isInteger(){return this.toString().startsWith("int")}get isFloat(){return this.toString().startsWith("float")}get density(){const t=n.DENSITIES.get(this.toString());if(t==null)throw new Error(`unable to find density for ${this.valueOf()}`);return t}canSafelyCastTo(t){return this.equals(t)?!0:this.isVariable&&!t.isVariable||!this.isVariable&&t.isVariable?!1:this.isFloat&&t.isInteger||this.isInteger&&t.isFloat?this.density.valueOf()<t.density.valueOf():this.isFloat&&t.isFloat||this.isInteger&&t.isInteger?this.density.valueOf()<=t.density.valueOf():!1}canCastTo(t){return this.isNumeric&&t.isNumeric?!0:this.equals(t)}checkArray(t){return t.constructor===this.Array}toJSON(){return this.toString()}get usesBigInt(){return n.BIG_INT_TYPES.some(t=>t.equals(this))}};s(n,"UNKNOWN",new n("unknown")),s(n,"FLOAT64",new n("float64")),s(n,"FLOAT32",new n("float32")),s(n,"INT64",new n("int64")),s(n,"INT32",new n("int32")),s(n,"INT16",new n("int16")),s(n,"INT8",new n("int8")),s(n,"UINT64",new n("uint64")),s(n,"UINT32",new n("uint32")),s(n,"UINT16",new n("uint16")),s(n,"UINT8",new n("uint8")),s(n,"BOOLEAN",n.UINT8),s(n,"TIMESTAMP",new n("timestamp")),s(n,"UUID",new n("uuid")),s(n,"STRING",new n("string")),s(n,"JSON",new n("json")),s(n,"ARRAY_CONSTRUCTORS",new Map([[n.UINT8.toString(),Uint8Array],[n.UINT16.toString(),Uint16Array],[n.UINT32.toString(),Uint32Array],[n.UINT64.toString(),BigUint64Array],[n.FLOAT32.toString(),Float32Array],[n.FLOAT64.toString(),Float64Array],[n.INT8.toString(),Int8Array],[n.INT16.toString(),Int16Array],[n.INT32.toString(),Int32Array],[n.INT64.toString(),BigInt64Array],[n.TIMESTAMP.toString(),BigInt64Array],[n.STRING.toString(),Uint8Array],[n.JSON.toString(),Uint8Array],[n.UUID.toString(),Uint8Array]])),s(n,"ARRAY_CONSTRUCTOR_DATA_TYPES",new Map([[Uint8Array.name,n.UINT8],[Uint16Array.name,n.UINT16],[Uint32Array.name,n.UINT32],[BigUint64Array.name,n.UINT64],[Float32Array.name,n.FLOAT32],[Float64Array.name,n.FLOAT64],[Int8Array.name,n.INT8],[Int16Array.name,n.INT16],[Int32Array.name,n.INT32],[BigInt64Array.name,n.INT64]])),s(n,"DENSITIES",new Map([[n.UINT8.toString(),I.BIT8],[n.UINT16.toString(),I.BIT16],[n.UINT32.toString(),I.BIT32],[n.UINT64.toString(),I.BIT64],[n.FLOAT32.toString(),I.BIT32],[n.FLOAT64.toString(),I.BIT64],[n.INT8.toString(),I.BIT8],[n.INT16.toString(),I.BIT16],[n.INT32.toString(),I.BIT32],[n.INT64.toString(),I.BIT64],[n.TIMESTAMP.toString(),I.BIT64],[n.STRING.toString(),I.UNKNOWN],[n.JSON.toString(),I.UNKNOWN],[n.UUID.toString(),I.BIT128]])),s(n,"ALL",[n.UNKNOWN,n.FLOAT64,n.FLOAT32,n.INT64,n.INT32,n.INT16,n.INT8,n.UINT64,n.UINT32,n.UINT16,n.UINT8,n.TIMESTAMP,n.UUID,n.STRING,n.JSON]),s(n,"BIG_INT_TYPES",[n.INT64,n.UINT64,n.TIMESTAMP]),s(n,"z",l.z.union([l.z.string().transform(t=>new n(t)),l.z.instanceof(n)]));let g=n;const d=class d extends Number{constructor(t){super(t.valueOf())}largerThan(t){return this.valueOf()>t.valueOf()}smallerThan(t){return this.valueOf()<t.valueOf()}add(t){return d.bytes(this.valueOf()+t.valueOf())}sub(t){return d.bytes(this.valueOf()-t.valueOf())}truncate(t){return new d(Math.trunc(this.valueOf()/t.valueOf())*t.valueOf())}remainder(t){return d.bytes(this.valueOf()%t.valueOf())}get gigabytes(){return this.valueOf()/d.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/d.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/d.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/d.TERABYTE.valueOf()}toString(){const t=this.truncate(d.TERABYTE),e=this.truncate(d.GIGABYTE),r=this.truncate(d.MEGABYTE),i=this.truncate(d.KILOBYTE),c=this.truncate(d.BYTE),h=t,v=e.sub(t),y=r.sub(e),S=i.sub(r),A=c.sub(i);let f="";return h.isZero||(f+=`${h.terabytes}TB `),v.isZero||(f+=`${v.gigabytes}GB `),y.isZero||(f+=`${y.megabytes}MB `),S.isZero||(f+=`${S.kilobytes}KB `),(!A.isZero||f==="")&&(f+=`${A.valueOf()}B`),f.trim()}static bytes(t=1){return new d(t)}static kilobytes(t=1){return d.bytes(t.valueOf()*1e3)}static megabytes(t=1){return d.kilobytes(t.valueOf()*1e3)}static gigabytes(t=1){return d.megabytes(t.valueOf()*1e3)}static terabytes(t){return d.gigabytes(t.valueOf()*1e3)}get isZero(){return this.valueOf()===0}};s(d,"BYTE",new d(1)),s(d,"KILOBYTE",d.kilobytes(1)),s(d,"MEGABYTE",d.megabytes(1)),s(d,"GIGABYTE",d.gigabytes(1)),s(d,"TERABYTE",d.terabytes(1)),s(d,"ZERO",new d(0)),s(d,"z",l.z.union([l.z.number().transform(t=>new d(t)),l.z.instanceof(d)]));let U=d;const ct=l.z.union([l.z.instanceof(Uint8Array),l.z.instanceof(Uint16Array),l.z.instanceof(Uint32Array),l.z.instanceof(BigUint64Array),l.z.instanceof(Float32Array),l.z.instanceof(Float64Array),l.z.instanceof(Int8Array),l.z.instanceof(Int16Array),l.z.instanceof(Int32Array),l.z.instanceof(BigInt64Array)]),P=o=>{const t=typeof o;return t==="string"||t==="number"||t==="boolean"||t==="bigint"||o instanceof m||o instanceof O||o instanceof Date},Q=(o,t,e,r=0)=>o.usesBigInt&&!t.usesBigInt?Number(e)-Number(r):!o.usesBigInt&&t.usesBigInt?BigInt(e.valueOf())-BigInt(r.valueOf()):x(e,-r).valueOf(),_=o=>o==null?!1:Array.isArray(o)||o instanceof ArrayBuffer||ArrayBuffer.isView(o)&&!(o instanceof DataView)||o instanceof z?!0:P(o),E=-1,$={[Symbol.iterator]:()=>$,next:()=>({done:!0,value:void 0})},ft=l.z.string().transform(o=>new Uint8Array(atob(o).split("").map(t=>t.charCodeAt(0))).buffer),ht=l.z.union([l.z.null(),l.z.undefined()]).transform(()=>new Uint8Array().buffer),F=10,T=class T{constructor(t){s(this,"key","");s(this,"isSynnaxSeries",!0);s(this,"dataType");s(this,"sampleOffset");s(this,"gl");s(this,"_data");s(this,"_timeRange");s(this,"alignment",0n);s(this,"_cachedMin");s(this,"_cachedMax");s(this,"writePos",E);s(this,"_refCount",0);s(this,"_cachedLength");s(this,"_cachedIndexes");_(t)&&(t={data:t});const{dataType:e,timeRange:r,sampleOffset:i=0,glBufferUsage:c="static",alignment:h=0n,key:v=K()}=t,y=t.data??[];if(y instanceof T||typeof y=="object"&&"isSynnaxSeries"in y&&y.isSynnaxSeries===!0){const f=y;this.key=f.key,this.dataType=f.dataType,this.sampleOffset=f.sampleOffset,this.gl=f.gl,this._data=f._data,this._timeRange=f._timeRange,this.alignment=f.alignment,this._cachedMin=f._cachedMin,this._cachedMax=f._cachedMax,this.writePos=f.writePos,this._refCount=f._refCount,this._cachedLength=f._cachedLength;return}const S=P(y),A=Array.isArray(y);if(e!=null)this.dataType=new g(e);else{if(y instanceof ArrayBuffer)throw new Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");if(A||S){let f=y;if(!S){if(y.length===0)throw new Error("cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type.");f=y[0]}if(typeof f=="string")this.dataType=g.STRING;else if(typeof f=="number")this.dataType=g.FLOAT64;else if(typeof f=="bigint")this.dataType=g.INT64;else if(typeof f=="boolean")this.dataType=g.BOOLEAN;else if(f instanceof m||f instanceof Date||f instanceof m)this.dataType=g.TIMESTAMP;else if(typeof f=="object")this.dataType=g.JSON;else throw new Error(`cannot infer data type of ${typeof f} when constructing a Series from a JS array`)}else this.dataType=new g(y)}if(!A&&!S)this._data=y;else{let f=S?[y]:y;const R=f[0];(R instanceof m||R instanceof Date||R instanceof O)&&(f=f.map(C=>new m(C).valueOf())),this.dataType.equals(g.STRING)?(this._cachedLength=f.length,this._data=new TextEncoder().encode(`${f.join(`
|
|
2
|
-
`)}
|
|
3
|
-
`).buffer):this.dataType.equals(g.JSON)?(this._cachedLength=f.length,this._data=new TextEncoder().encode(`${f.map(C=>L.JSON_CODEC.encodeString(C)).join(`
|
|
4
|
-
`)}
|
|
5
|
-
`).buffer):this._data=new this.dataType.Array(f).buffer}this.key=v,this.alignment=h,this.sampleOffset=i??0,this._timeRange=r,this.gl={control:null,buffer:null,prevBuffer:0,bufferUsage:c}}static alloc({capacity:t,dataType:e,...r}){if(t===0)throw new Error("[Series] - cannot allocate an array of length 0");const i=new new g(e).Array(t),c=new T({data:i.buffer,dataType:e,...r});return c.writePos=0,c}static generateTimestamps(t,e,r){const i=r.spanRange(e.span(t)),c=new BigInt64Array(t);for(let h=0;h<t;h++)c[h]=BigInt(r.add(e.span(h)).valueOf());return new T({data:c,dataType:g.TIMESTAMP,timeRange:i})}get refCount(){return this._refCount}static fromStrings(t,e){const r=new TextEncoder().encode(`${t.join(`
|
|
6
|
-
`)}
|
|
7
|
-
`);return new T({data:r,dataType:g.STRING,timeRange:e})}static fromJSON(t,e){const r=new TextEncoder().encode(`${t.map(i=>L.JSON_CODEC.encodeString(i)).join(`
|
|
8
|
-
`)}
|
|
9
|
-
`);return new T({data:r,dataType:g.JSON,timeRange:e})}acquire(t){this._refCount++,t!=null&&this.updateGLBuffer(t)}release(){if(this._refCount--,this._refCount===0&&this.gl.control!=null)this.maybeGarbageCollectGLBuffer(this.gl.control);else if(this._refCount<0)throw new Error("cannot release an array with a negative reference count")}write(t){if(!t.dataType.equals(this.dataType))throw new Error("buffer must be of the same type as this array");return this.dataType.isVariable?this.writeVariable(t):this.writeFixed(t)}writeVariable(t){if(this.writePos===E)return 0;const e=this.byteCapacity.valueOf()-this.writePos,r=t.subBytes(0,e);return this.writeToUnderlyingData(r),this.writePos+=r.byteLength.valueOf(),this._cachedLength!=null&&(this._cachedLength+=r.length,this.calculateCachedLength()),r.length}writeFixed(t){if(this.writePos===E)return 0;const e=this.capacity-this.writePos,r=t.sub(0,e);return this.writeToUnderlyingData(r),this._cachedLength=void 0,this.maybeRecomputeMinMax(r),this.writePos+=r.length,r.length}writeToUnderlyingData(t){this.underlyingData.set(t.data,this.writePos)}get buffer(){return typeof this._data=="object"&&"buffer"in this._data?this._data.buffer:this._data}get underlyingData(){return new this.dataType.Array(this._data)}get data(){return this.writePos===E?this.underlyingData:new this.dataType.Array(this._data,0,this.writePos)}toStrings(){if(!this.dataType.matches(g.STRING,g.UUID))throw new Error("cannot convert non-string series to strings");return new TextDecoder().decode(this.underlyingData).split(`
|
|
10
|
-
`).slice(0,-1)}toUUIDs(){if(!this.dataType.equals(g.UUID))throw new Error("cannot convert non-uuid series to uuids");const t=g.UUID.density.valueOf(),e=Array(this.length);for(let r=0;r<this.length;r++){const i=this.underlyingData.slice(r*t,(r+1)*t),c=Array.from(new Uint8Array(i.buffer),h=>h.toString(16).padStart(2,"0")).join("").replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5");e[r]=c}return e}parseJSON(t){if(!this.dataType.equals(g.JSON))throw new Error("cannot convert non-string series to strings");return new TextDecoder().decode(this.underlyingData).split(`
|
|
11
|
-
`).slice(0,-1).map(e=>t.parse(L.JSON_CODEC.decodeString(e)))}get timeRange(){if(this._timeRange==null)throw new Error("time range not set on series");return this._timeRange}get byteCapacity(){return new U(this.underlyingData.byteLength)}get capacity(){return this.dataType.isVariable?this.byteCapacity.valueOf():this.dataType.density.length(this.byteCapacity)}get byteLength(){return this.writePos===E?this.byteCapacity:this.dataType.isVariable?new U(this.writePos):this.dataType.density.size(this.writePos)}get length(){return this._cachedLength!=null?this._cachedLength:this.dataType.isVariable?this.calculateCachedLength():this.writePos===E?this.data.length:this.writePos}calculateCachedLength(){if(!this.dataType.isVariable)throw new Error("cannot calculate length of a non-variable length data type");let t=0;const e=[0];return this.data.forEach((r,i)=>{r===F&&(t++,e.push(i+1))}),this._cachedIndexes=e,this._cachedLength=t,t}convert(t,e=0){if(this.dataType.equals(t))return this;const r=new t.Array(this.length);for(let i=0;i<this.length;i++)r[i]=Q(this.dataType,t,this.data[i],e);return new T({data:r.buffer,dataType:t,timeRange:this._timeRange,sampleOffset:e,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment})}calcRawMax(){if(this.length===0)return-1/0;if(this.dataType.equals(g.TIMESTAMP))this._cachedMax=this.data[this.data.length-1];else if(this.dataType.usesBigInt){const t=this.data;this._cachedMax=t.reduce((e,r)=>e>r?e:r)}else{const t=this.data;this._cachedMax=t.reduce((e,r)=>e>r?e:r)}return this._cachedMax}get max(){if(this.dataType.isVariable)throw new Error("cannot calculate maximum on a variable length data type");return this.writePos===0?-1/0:(this._cachedMax??(this._cachedMax=this.calcRawMax()),x(this._cachedMax,this.sampleOffset))}calcRawMin(){if(this.length===0)return 1/0;if(this.dataType.equals(g.TIMESTAMP))this._cachedMin=this.data[0];else if(this.dataType.usesBigInt){const t=this.data;this._cachedMin=t.reduce((e,r)=>e<r?e:r)}else{const t=this.data;this._cachedMin=t.reduce((e,r)=>e<r?e:r)}return this._cachedMin}get min(){if(this.dataType.isVariable)throw new Error("cannot calculate minimum on a variable length data type");return this.writePos===0?1/0:(this._cachedMin??(this._cachedMin=this.calcRawMin()),x(this._cachedMin,this.sampleOffset))}get bounds(){return w.construct(Number(this.min),Number(this.max))}maybeRecomputeMinMax(t){if(this._cachedMin!=null){const e=t._cachedMin??t.calcRawMin();e<this._cachedMin&&(this._cachedMin=e)}if(this._cachedMax!=null){const e=t._cachedMax??t.calcRawMax();e>this._cachedMax&&(this._cachedMax=e)}}enrich(){this.max,this.min}get range(){return x(this.max,-this.min)}atAlignment(t,e){const r=Number(t-this.alignment);if(r<0||r>=this.length){if(e===!0)throw new Error(`[series] - no value at index ${r}`);return}return this.at(r,e)}at(t,e){if(this.dataType.isVariable)return this.atVariable(t,e??!1);t<0&&(t=this.length+t);const r=this.data[t];if(r==null){if(e===!0)throw new Error(`[series] - no value at index ${t}`);return}return x(r,this.sampleOffset)}atVariable(t,e){let r=0,i=0;if(this._cachedIndexes!=null)r=this._cachedIndexes[t],i=this._cachedIndexes[t+1]-1;else{t<0&&(t=this.length+t);for(let h=0;h<this.data.length;h++)if(this.data[h]===F){if(t===0){i=h;break}r=h+1,t--}if(i===0&&(i=this.data.length),r>=i||t>0){if(e)throw new Error(`[series] - no value at index ${t}`);return}}const c=this.data.slice(r,i);return this.dataType.equals(g.STRING)?new TextDecoder().decode(c):rt.snakeToCamel(JSON.parse(new TextDecoder().decode(c)))}binarySearch(t){let e=0,r=this.length-1;const i=nt.newF(t);for(;e<=r;){const c=Math.floor((e+r)/2),h=i(this.at(c,!0),t);if(h===0)return c;h<0?e=c+1:r=c-1}return e}updateGLBuffer(t){if(this.gl.control=t,!this.dataType.equals(g.FLOAT32))throw new Error("Only FLOAT32 arrays can be used in WebGL");const{buffer:e,bufferUsage:r,prevBuffer:i}=this.gl;if(e==null&&(this.gl.buffer=t.createBuffer()),this.writePos!==i)if(t.bindBuffer(t.ARRAY_BUFFER,this.gl.buffer),this.writePos!==E){i===0&&t.bufferData(t.ARRAY_BUFFER,this.byteCapacity.valueOf(),t.STATIC_DRAW);const c=this.dataType.density.size(i).valueOf(),h=this.underlyingData.slice(this.gl.prevBuffer,this.writePos);t.bufferSubData(t.ARRAY_BUFFER,c,h.buffer),this.gl.prevBuffer=this.writePos}else t.bufferData(t.ARRAY_BUFFER,this.buffer,r==="static"?t.STATIC_DRAW:t.DYNAMIC_DRAW),this.gl.prevBuffer=E}as(t){if(t==="string"){if(!this.dataType.equals(g.STRING))throw new Error(`cannot convert series of type ${this.dataType.toString()} to string`);return this}if(t==="number"){if(!this.dataType.isNumeric)throw new Error(`cannot convert series of type ${this.dataType.toString()} to number`);return this}if(t==="bigint"){if(!this.dataType.equals(g.INT64))throw new Error(`cannot convert series of type ${this.dataType.toString()} to bigint`);return this}throw new Error(`cannot convert series to ${t}`)}get digest(){var t;return{key:this.key,dataType:this.dataType.toString(),sampleOffset:this.sampleOffset,alignment:{lower:Z(this.alignmentBounds.lower),upper:Z(this.alignmentBounds.upper)},timeRange:(t=this._timeRange)==null?void 0:t.toString(),length:this.length,capacity:this.capacity}}get memInfo(){return{key:this.key,length:this.length,byteLength:this.byteLength,glBuffer:this.gl.buffer!=null}}get alignmentBounds(){return w.construct(this.alignment,this.alignment+BigInt(this.length))}maybeGarbageCollectGLBuffer(t){this.gl.buffer!=null&&(t.deleteBuffer(this.gl.buffer),this.gl.buffer=null,this.gl.prevBuffer=0,this.gl.control=null)}get glBuffer(){if(this.gl.buffer==null)throw new Error("gl buffer not initialized");return this.gl.prevBuffer!==this.writePos&&console.warn("buffer not updated"),this.gl.buffer}[Symbol.iterator](){if(this.dataType.isVariable){const t=new dt(this);return this.dataType.equals(g.JSON)?new gt(t):t}return new mt(this)}slice(t,e){return this.sliceSub(!1,t,e)}sub(t,e){return this.sliceSub(!0,t,e)}subIterator(t,e){return new V(this,t,e??this.length)}subAlignmentIterator(t,e){return new V(this,Number(t-this.alignment),Number(e-this.alignment))}subBytes(t,e){if(t>=0&&(e==null||e>=this.byteLength.valueOf()))return this;const r=this.data.subarray(t,e);return new T({data:r,dataType:this.dataType,timeRange:this._timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(t)})}sliceSub(t,e,r){if(e<=0&&(r==null||r>=this.length))return this;let i;return t?i=this.data.subarray(e,r):i=this.data.slice(e,r),new T({data:i,dataType:this.dataType,timeRange:this._timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(e)})}reAlign(t){return new T({data:this.buffer,dataType:this.dataType,timeRange:M.ZERO,sampleOffset:this.sampleOffset,glBufferUsage:"static",alignment:t})}};s(T,"crudeZ",l.z.object({timeRange:M.z.optional(),dataType:g.z,alignment:st.bigInt.optional(),data:l.z.union([ft,ht,l.z.instanceof(ArrayBuffer),l.z.instanceof(Uint8Array)]),glBufferUsage:ot.optional().default("static").optional()})),s(T,"z",T.crudeZ.transform(t=>new T(t)));let z=T;class V{constructor(t,e,r){s(this,"series");s(this,"end");s(this,"index");this.series=t;const i=w.construct(0,t.length);this.end=w.clamp(i,r),this.index=w.clamp(i,e)}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[Symbol.iterator](){return this}}class dt{constructor(t){s(this,"series");s(this,"index");s(this,"decoder");if(!t.dataType.isVariable)throw new Error("cannot create a variable series iterator for a non-variable series");this.series=t,this.index=0,this.decoder=new TextDecoder}next(){const t=this.index,e=this.series.data;for(;this.index<e.length&&e[this.index]!==F;)this.index++;const r=this.index;return t===r?{done:!0,value:void 0}:(this.index++,{done:!1,value:this.decoder.decode(this.series.buffer.slice(t,r))})}[Symbol.iterator](){return this}}var k,G;class gt{constructor(t){s(this,"wrapped");s(this,k,"JSONSeriesIterator");this.wrapped=t}next(){const t=this.wrapped.next();return t.done===!0?{done:!0,value:void 0}:{done:!1,value:L.JSON_CODEC.decodeString(t.value)}}[(G=Symbol.iterator,k=Symbol.toStringTag,G)](){return this}}var J,W;class mt{constructor(t){s(this,"series");s(this,"index");s(this,J,"SeriesIterator");this.series=t,this.index=0}next(){return this.index>=this.series.length?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[(W=Symbol.iterator,J=Symbol.toStringTag,W)](){return this}}const x=(o,t)=>typeof o=="bigint"&&typeof t=="bigint"||typeof o=="number"&&typeof t=="number"?o+t:t===0?o:o===0?t:Number(o)+Number(t);class Ot{constructor(t){s(this,"series");if(t.length!==0){const e=t[0].dataType;for(let r=1;r<t.length;r++)if(!t[r].dataType.equals(e))throw new Error("[multi-series] - series must have the same data type")}this.series=t}as(t){if(!new g(t).equals(this.dataType))throw new Error(`cannot convert series of type ${this.dataType.toString()} to ${t.toString()}`);return this}get dataType(){return this.series.length===0?g.UNKNOWN:this.series[0].dataType}get timeRange(){return this.series.length===0?M.ZERO:new M(this.series[0].timeRange.start,this.series[this.series.length-1].timeRange.end)}get alignment(){return this.series.length===0?0n:this.series[0].alignment}get alignmentBounds(){return this.series.length===0?w.construct(0n,0n):w.construct(this.series[0].alignmentBounds.lower,this.series[this.series.length-1].alignmentBounds.upper)}push(t){this.series.push(t)}get length(){return this.series.reduce((t,e)=>t+e.length,0)}atAlignment(t,e){if(this.series.length===0){if(e)throw new Error(`[series] - no value at alignment ${t}`);return}for(const r of this.series)if(w.contains(r.alignmentBounds,t))return r.atAlignment(t,e);if(e)throw new Error(`[series] - no value at alignment ${t}`)}at(t,e=!1){t<0&&(t=this.length+t);for(const r of this.series){if(t<r.length)return r.at(t,e);t-=r.length}if(e)throw new Error(`[series] - no value at index ${t}`)}subIterator(t,e){return new q(this,t,e??this.length)}subAlignmentIterator(t,e){if(t>=this.alignmentBounds.upper||e<=this.alignmentBounds.lower)return $;let r=0;for(let c=0;c<this.series.length;c++){const h=this.series[c];if(t<h.alignment)break;if(t>=h.alignmentBounds.upper)r+=h.length;else if(w.contains(h.alignmentBounds,t)){r+=Number(t-h.alignment);break}}let i=0;for(let c=0;c<this.series.length;c++){const h=this.series[c];if(e<h.alignment)break;if(e>=h.alignmentBounds.upper)i+=h.length;else if(w.contains(h.alignmentBounds,e)){i+=Number(e-h.alignment);break}}return new q(this,r,i)}subAlignmentSpanIterator(t,e){if(t>=this.alignmentBounds.upper)return $;let r=0;for(let i=0;i<this.series.length;i++){const c=this.series[i];if(t<c.alignment)break;if(t>=c.alignmentBounds.upper)r+=c.length;else if(w.contains(c.alignmentBounds,t)){r+=Number(t-c.alignment);break}}return new q(this,r,r+e)}get byteLength(){return new U(this.series.reduce((t,e)=>t+e.byteLength.valueOf(),0))}get data(){const t=new this.dataType.Array(this.length);let e=0;for(const r of this.series)t.set(r.data,e),e+=r.length;return new this.dataType.Array(t.buffer)}traverseAlignment(t,e){const r=this.series.map(i=>i.alignmentBounds);return w.traverse(r,t,e)}distance(t,e){const r=this.series.map(i=>i.alignmentBounds);return w.distance(r,t,e)}[Symbol.iterator](){return this.series.length===0?{next(){return{done:!0,value:void 0}}}:new yt(this.series)}}var j,H;class yt{constructor(t){s(this,"series");s(this,"seriesIndex");s(this,"internal");s(this,j,"MultiSeriesIterator");this.series=t,this.seriesIndex=0,this.internal=t[0][Symbol.iterator]()}next(){const t=this.internal.next();return t.done===!1?t:this.seriesIndex===this.series.length-1?{done:!0,value:void 0}:(this.internal=this.series[++this.seriesIndex][Symbol.iterator](),this.next())}[(H=Symbol.iterator,j=Symbol.toStringTag,H)](){return this}}class q{constructor(t,e,r){s(this,"series");s(this,"index");s(this,"end");this.series=t,this.end=r,this.index=e}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[Symbol.iterator](){return this}}const Z=o=>{const t=o>>32n,e=o&0xffffffffn;return{domain:t,sample:e}};exports.DataType=g;exports.Density=I;exports.MultiSeries=Ot;exports.Rate=D;exports.Series=z;exports.Size=U;exports.TimeRange=M;exports.TimeSpan=O;exports.TimeStamp=m;exports.addSamples=x;exports.convertDataType=Q;exports.id=ut;exports.isCrudeSeries=_;exports.isTelemValue=P;exports.sortTimeRange=lt;exports.typedArrayZ=ct;
|
package/dist/src/unique.d.ts
DELETED
package/dist/src/unique.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unique.d.ts","sourceRoot":"","sources":["../../src/unique.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM,GAAI,CAAC,UAAU,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,KAAG,CAAC,EAA0B,CAAC"}
|
package/dist/types-BpAJW2TM.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { z as t } from "zod";
|
|
2
|
-
const e = t.object({
|
|
3
|
-
key: t.string(),
|
|
4
|
-
value: t.string()
|
|
5
|
-
}), r = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6
|
-
__proto__: null,
|
|
7
|
-
stringPairZ: e
|
|
8
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
9
|
-
export {
|
|
10
|
-
r as t
|
|
11
|
-
};
|
package/dist/types-zRwnQ1hc.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("zod"),t=e.z.object({key:e.z.string(),value:e.z.string()}),r=Object.freeze(Object.defineProperty({__proto__:null,stringPairZ:t},Symbol.toStringTag,{value:"Module"}));exports.types=r;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const o=require("zod"),u=require("./path-1tZLZ4AN.cjs"),l=e=>u.transformPath(e,(t,r,n)=>{const s=r===n.length-1,c=!isNaN(parseInt(t)),f=!isNaN(parseInt(n[r+1]));return c&&(t="element"),s||f?t:[t,"shape"]}),i=(e,t)=>{if(e==null)return null;const r=e[t];return r==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:r},g=(e,t,r)=>u.get(i(e,"shape"),l(t),{...r,getter:i}),m=(e,t)=>r=>{const n=t.find(s=>s.safeParse(r).success);return n==null?null:e(n.parse(r))},a=o.z.bigint().or(o.z.string().transform(BigInt)),h=Object.freeze(Object.defineProperty({__proto__:null,bigInt:a,getFieldSchema:g,getFieldSchemaPath:l,transformer:m},Symbol.toStringTag,{value:"Module"}));exports.bigInt=a;exports.zodutil=h;
|
package/dist/zodutil-DI4gVZkT.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { z as c } from "zod";
|
|
2
|
-
import { t as l, g as f } from "./path-DD6ytXzr.js";
|
|
3
|
-
const u = (e) => l(e, (t, r, n) => {
|
|
4
|
-
const s = r === n.length - 1, o = !isNaN(parseInt(t)), a = !isNaN(parseInt(n[r + 1]));
|
|
5
|
-
return o && (t = "element"), s || a ? t : [t, "shape"];
|
|
6
|
-
}), i = (e, t) => {
|
|
7
|
-
if (e == null) return null;
|
|
8
|
-
const r = e[t];
|
|
9
|
-
return r == null && typeof e == "object" && "sourceType" in e ? e.sourceType()[t] : r;
|
|
10
|
-
}, m = (e, t, r) => f(
|
|
11
|
-
i(e, "shape"),
|
|
12
|
-
u(t),
|
|
13
|
-
{ ...r, getter: i }
|
|
14
|
-
), g = (e, t) => (r) => {
|
|
15
|
-
const n = t.find((s) => s.safeParse(r).success);
|
|
16
|
-
return n == null ? null : e(n.parse(r));
|
|
17
|
-
}, p = c.bigint().or(c.string().transform(BigInt)), N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
18
|
-
__proto__: null,
|
|
19
|
-
bigInt: p,
|
|
20
|
-
getFieldSchema: m,
|
|
21
|
-
getFieldSchemaPath: u,
|
|
22
|
-
transformer: g
|
|
23
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
24
|
-
export {
|
|
25
|
-
p as b,
|
|
26
|
-
N as z
|
|
27
|
-
};
|