@synnaxlabs/x 0.40.0 → 0.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +22 -22
- package/dist/{bounds-azUOoVVR.js → bounds-DQrjn60Q.js} +83 -86
- package/dist/bounds-M-SZ3X1Z.cjs +1 -0
- package/dist/bounds.cjs +1 -1
- package/dist/bounds.js +1 -1
- package/dist/box-0YrQibkB.cjs +1 -0
- package/dist/box-Cc8IzcNo.js +205 -0
- package/dist/box.cjs +1 -1
- package/dist/box.js +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +235 -198
- package/dist/location-BGl5Ddds.cjs +1 -0
- package/dist/{location-BuYbIFHD.js → location-C3aeu046.js} +16 -12
- package/dist/location.cjs +1 -1
- package/dist/location.js +1 -1
- package/dist/{position-DTrNGtrm.cjs → position-Cai5-wi1.cjs} +1 -1
- package/dist/{position-DemzGvAY.js → position-DIglP1l2.js} +2 -2
- package/dist/position.cjs +1 -1
- package/dist/position.js +1 -1
- package/dist/{scale-DpJM6__6.cjs → scale-DL9VFGhL.cjs} +1 -1
- package/dist/{scale-C0EllH-1.js → scale-DQwBWnwc.js} +4 -4
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/series-BMma2b5q.cjs +11 -0
- package/dist/{series-CXnO-P0V.js → series-D0zxMWxP.js} +285 -297
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +6 -6
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/math/external.d.ts +3 -0
- package/dist/src/math/external.d.ts.map +1 -0
- package/dist/src/math/index.d.ts +1 -1
- package/dist/src/math/index.d.ts.map +1 -1
- package/dist/src/math/round.d.ts +40 -0
- package/dist/src/math/round.d.ts.map +1 -0
- package/dist/src/math/round.spec.d.ts +2 -0
- package/dist/src/math/round.spec.d.ts.map +1 -0
- package/dist/src/notation/index.d.ts +2 -0
- package/dist/src/notation/index.d.ts.map +1 -0
- package/dist/src/notation/notation.d.ts +33 -0
- package/dist/src/notation/notation.d.ts.map +1 -0
- package/dist/src/notation/notation.spec.d.ts +2 -0
- package/dist/src/notation/notation.spec.d.ts.map +1 -0
- package/dist/src/spatial/box/box.d.ts +4 -0
- package/dist/src/spatial/box/box.d.ts.map +1 -1
- package/dist/src/spatial/location/location.d.ts +2 -2
- package/dist/src/spatial/xy/xy.d.ts +10 -0
- package/dist/src/spatial/xy/xy.d.ts.map +1 -1
- 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/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/dist/{xy-DyQSETQZ.cjs → xy-B7065J2S.cjs} +1 -1
- package/dist/{xy-DHBO1dG_.js → xy-D_LqxaGt.js} +8 -4
- package/dist/xy.cjs +1 -1
- package/dist/xy.js +1 -1
- package/package.json +8 -8
- package/src/index.ts +1 -0
- package/src/math/external.ts +11 -0
- package/src/math/index.ts +1 -1
- package/src/math/round.spec.ts +81 -0
- package/src/math/round.ts +68 -0
- package/src/notation/index.ts +10 -0
- package/src/notation/notation.spec.ts +88 -0
- package/src/notation/notation.ts +61 -0
- package/src/spatial/box/box.spec.ts +3 -3
- package/src/spatial/box/box.ts +8 -0
- package/src/spatial/location/location.ts +4 -4
- package/src/spatial/position/position.spec.ts +10 -10
- package/src/spatial/xy/xy.spec.ts +8 -0
- package/src/spatial/xy/xy.ts +14 -0
- package/src/telem/series.spec.ts +39 -0
- package/src/telem/series.ts +15 -27
- package/src/telem/telem.ts +8 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/bounds-Dwq6ZFHm.cjs +0 -1
- package/dist/box-Bzya27QS.cjs +0 -1
- package/dist/box-DrsrRNSe.js +0 -201
- package/dist/location-BgpQ3rN2.cjs +0 -1
- package/dist/series-BgoCtU71.cjs +0 -11
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
> @synnaxlabs/x@0.
|
|
2
|
+
> @synnaxlabs/x@0.41.0 build /home/runner/work/synnax/synnax/x/ts
|
|
3
3
|
> tsc --noEmit && vite build
|
|
4
4
|
|
|
5
5
|
[34m Synnax - Production mode[0m
|
|
6
|
-
[36mvite v6.2.
|
|
6
|
+
[36mvite v6.2.5 [32mbuilding for production...[36m[39m
|
|
7
7
|
transforming...
|
|
8
|
-
[32m✓[39m
|
|
8
|
+
[32m✓[39m 101 modules transformed.
|
|
9
9
|
[33mGenerated an empty chunk: "destructor".[39m
|
|
10
10
|
rendering chunks...
|
|
11
11
|
|
|
@@ -50,22 +50,22 @@ computing gzip size...
|
|
|
50
50
|
[2mdist/[22m[36mpath-DD6ytXzr.js [39m[1m[2m 1.79 kB[22m[1m[22m[2m │ gzip: 0.72 kB[22m
|
|
51
51
|
[2mdist/[22m[36mindex-DizUWH6z.js [39m[1m[2m 1.89 kB[22m[1m[22m[2m │ gzip: 0.88 kB[22m
|
|
52
52
|
[2mdist/[22m[36murl.js [39m[1m[2m 1.98 kB[22m[1m[22m[2m │ gzip: 0.87 kB[22m
|
|
53
|
-
[2mdist/[22m[36mposition-
|
|
54
|
-
[2mdist/[22m[36mlocation-
|
|
53
|
+
[2mdist/[22m[36mposition-DIglP1l2.js [39m[1m[2m 2.25 kB[22m[1m[22m[2m │ gzip: 1.07 kB[22m
|
|
54
|
+
[2mdist/[22m[36mlocation-C3aeu046.js [39m[1m[2m 2.86 kB[22m[1m[22m[2m │ gzip: 1.18 kB[22m
|
|
55
55
|
[2mdist/[22m[36mindex-BVC_8Cg9.js [39m[1m[2m 2.91 kB[22m[1m[22m[2m │ gzip: 1.15 kB[22m
|
|
56
56
|
[2mdist/[22m[36mindex-C3QzbIwt.js [39m[1m[2m 2.95 kB[22m[1m[22m[2m │ gzip: 1.12 kB[22m
|
|
57
57
|
[2mdist/[22m[36mdeep.js [39m[1m[2m 3.37 kB[22m[1m[22m[2m │ gzip: 1.36 kB[22m
|
|
58
|
-
[2mdist/[22m[36mxy-
|
|
59
|
-
[2mdist/[22m[36mbox-
|
|
60
|
-
[2mdist/[22m[36mbounds-
|
|
61
|
-
[2mdist/[22m[36mscale-
|
|
62
|
-
[2mdist/[22m[36mindex.js [39m[1m[
|
|
63
|
-
[2mdist/[22m[36mseries-
|
|
64
|
-
[vite:dts] Declaration files built in
|
|
58
|
+
[2mdist/[22m[36mxy-D_LqxaGt.js [39m[1m[2m 3.84 kB[22m[1m[22m[2m │ gzip: 1.45 kB[22m
|
|
59
|
+
[2mdist/[22m[36mbox-Cc8IzcNo.js [39m[1m[2m 6.33 kB[22m[1m[22m[2m │ gzip: 2.23 kB[22m
|
|
60
|
+
[2mdist/[22m[36mbounds-DQrjn60Q.js [39m[1m[2m 6.34 kB[22m[1m[22m[2m │ gzip: 2.01 kB[22m
|
|
61
|
+
[2mdist/[22m[36mscale-DQwBWnwc.js [39m[1m[2m 6.82 kB[22m[1m[22m[2m │ gzip: 2.03 kB[22m
|
|
62
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m11.83 kB[22m[1m[22m[2m │ gzip: 4.27 kB[22m
|
|
63
|
+
[2mdist/[22m[36mseries-D0zxMWxP.js [39m[1m[2m63.77 kB[22m[1m[22m[2m │ gzip: 14.01 kB[22m
|
|
64
|
+
[vite:dts] Declaration files built in 4720ms.
|
|
65
65
|
|
|
66
66
|
[33mGenerated an empty chunk: "destructor".[39m
|
|
67
67
|
[2mdist/[22m[36mdestructor.cjs [39m[1m[2m 0.01 kB[22m[1m[22m[2m │ gzip: 0.03 kB[22m
|
|
68
|
-
[2mdist/[22m[36mxy.cjs [39m[1m[2m 0.13 kB[22m[1m[22m[2m │ gzip: 0.
|
|
68
|
+
[2mdist/[22m[36mxy.cjs [39m[1m[2m 0.13 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
69
69
|
[2mdist/[22m[36mbox.cjs [39m[1m[2m 0.14 kB[22m[1m[22m[2m │ gzip: 0.14 kB[22m
|
|
70
70
|
[2mdist/[22m[36mscale.cjs [39m[1m[2m 0.14 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
71
71
|
[2mdist/[22m[36munique.cjs [39m[1m[2m 0.15 kB[22m[1m[22m[2m │ gzip: 0.15 kB[22m
|
|
@@ -103,15 +103,15 @@ computing gzip size...
|
|
|
103
103
|
[2mdist/[22m[36mpath-1tZLZ4AN.cjs [39m[1m[2m 1.35 kB[22m[1m[22m[2m │ gzip: 0.66 kB[22m
|
|
104
104
|
[2mdist/[22m[36mindex-Dd8DLyMx.cjs [39m[1m[2m 1.38 kB[22m[1m[22m[2m │ gzip: 0.71 kB[22m
|
|
105
105
|
[2mdist/[22m[36mbase-BAM2mqCy.cjs [39m[1m[2m 1.40 kB[22m[1m[22m[2m │ gzip: 0.58 kB[22m
|
|
106
|
-
[2mdist/[22m[36mposition-
|
|
106
|
+
[2mdist/[22m[36mposition-Cai5-wi1.cjs [39m[1m[2m 1.71 kB[22m[1m[22m[2m │ gzip: 0.94 kB[22m
|
|
107
107
|
[2mdist/[22m[36mindex-BG3Scw3G.cjs [39m[1m[2m 2.24 kB[22m[1m[22m[2m │ gzip: 1.04 kB[22m
|
|
108
108
|
[2mdist/[22m[36mindex-CnclyYpG.cjs [39m[1m[2m 2.30 kB[22m[1m[22m[2m │ gzip: 1.01 kB[22m
|
|
109
|
-
[2mdist/[22m[36mlocation-
|
|
109
|
+
[2mdist/[22m[36mlocation-BGl5Ddds.cjs [39m[1m[2m 2.49 kB[22m[1m[22m[2m │ gzip: 1.06 kB[22m
|
|
110
110
|
[2mdist/[22m[36mdeep.cjs [39m[1m[2m 2.50 kB[22m[1m[22m[2m │ gzip: 1.15 kB[22m
|
|
111
|
-
[2mdist/[22m[36mxy-
|
|
112
|
-
[2mdist/[22m[36mscale-
|
|
113
|
-
[2mdist/[22m[
|
|
114
|
-
[2mdist/[22m[
|
|
115
|
-
[2mdist/[22m[36mindex.cjs [39m[1m[2m
|
|
116
|
-
[2mdist/[22m[36mseries-
|
|
117
|
-
[32m✓ built in 5.
|
|
111
|
+
[2mdist/[22m[36mxy-B7065J2S.cjs [39m[1m[2m 2.79 kB[22m[1m[22m[2m │ gzip: 1.29 kB[22m
|
|
112
|
+
[2mdist/[22m[36mscale-DL9VFGhL.cjs [39m[1m[2m 4.37 kB[22m[1m[22m[2m │ gzip: 1.59 kB[22m
|
|
113
|
+
[2mdist/[22m[36mbounds-M-SZ3X1Z.cjs [39m[1m[2m 4.86 kB[22m[1m[22m[2m │ gzip: 1.79 kB[22m
|
|
114
|
+
[2mdist/[22m[36mbox-0YrQibkB.cjs [39m[1m[2m 4.90 kB[22m[1m[22m[2m │ gzip: 2.00 kB[22m
|
|
115
|
+
[2mdist/[22m[36mindex.cjs [39m[1m[2m 9.45 kB[22m[1m[22m[2m │ gzip: 3.70 kB[22m
|
|
116
|
+
[2mdist/[22m[36mseries-BMma2b5q.cjs [39m[1m[2m36.63 kB[22m[1m[22m[2m │ gzip: 9.71 kB[22m
|
|
117
|
+
[32m✓ built in 5.31s[39m
|
|
@@ -1,34 +1,22 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
const c = (e) => typeof e == "bigint" || e instanceof BigInt,
|
|
1
|
+
import { j as b } from "./base-DFq0vvGn.js";
|
|
2
|
+
const c = (e) => typeof e == "bigint" || e instanceof BigInt, v = (e, r) => c(e) ? e.valueOf() - BigInt(r.valueOf().valueOf()) : e.valueOf() - Number(r.valueOf()), B = (e, r) => c(e) ? e.valueOf() + BigInt(r.valueOf().valueOf()) : e + Number(r.valueOf()), C = (e, r, n = 1e-4) => Math.abs(e - r) < n, g = (e, r) => c(e) ? e === BigInt(r.valueOf().valueOf()) : e === Number(r.valueOf()), R = (e) => {
|
|
3
3
|
const r = 10 ** Math.floor(Math.log10(e));
|
|
4
4
|
return Math.round(e / r) * r;
|
|
5
|
-
},
|
|
6
|
-
__proto__: null,
|
|
7
|
-
abs: B,
|
|
8
|
-
add: b,
|
|
9
|
-
closeTo: x,
|
|
10
|
-
div: j,
|
|
11
|
-
equal: O,
|
|
12
|
-
max: N,
|
|
13
|
-
min: y,
|
|
14
|
-
mult: M,
|
|
15
|
-
roundToNearestMagnitude: _,
|
|
16
|
-
sub: m
|
|
17
|
-
}, Symbol.toStringTag, { value: "Module" })), i = (e, r) => {
|
|
5
|
+
}, h = (e, r) => c(e) ? e.valueOf() < BigInt(r.valueOf()) ? e : BigInt(r.valueOf()) : e.valueOf() < Number(r.valueOf()) ? e : Number(r.valueOf()), U = (e, r) => c(e) ? e.valueOf() > BigInt(r.valueOf()) ? e : BigInt(r.valueOf()) : e.valueOf() > Number(r.valueOf()) ? e : Number(r.valueOf()), x = (e) => c(e) || e instanceof BigInt ? e.valueOf() < 0n ? -e : e : e.valueOf() < 0 ? -e : e, V = (e, r) => c(e) ? e.valueOf() * BigInt(r.valueOf()) : e.valueOf() * Number(r.valueOf()), W = (e, r) => c(e) ? e.valueOf() / BigInt(r.valueOf()) : e.valueOf() / Number(r.valueOf()), i = (e, r) => {
|
|
18
6
|
const n = {};
|
|
19
7
|
if (typeof e == "number" || typeof e == "bigint")
|
|
20
8
|
r != null ? (n.lower = e, n.upper = r) : (n.lower = typeof e == "bigint" ? 0n : 0, n.upper = e);
|
|
21
9
|
else if (Array.isArray(e)) {
|
|
22
10
|
if (e.length !== 2) throw new Error("bounds: expected array of length 2");
|
|
23
11
|
[n.lower, n.upper] = e;
|
|
24
|
-
} else return
|
|
25
|
-
return
|
|
26
|
-
},
|
|
12
|
+
} else return O(e);
|
|
13
|
+
return O(n);
|
|
14
|
+
}, y = Object.freeze({ lower: 0, upper: 0 }), N = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), _ = Object.freeze({ lower: 0, upper: 1 }), M = Object.freeze({ lower: -1, upper: 1 }), A = (e, r) => {
|
|
27
15
|
if (e == null && r == null) return !0;
|
|
28
16
|
if (e == null || r == null) return !1;
|
|
29
17
|
const n = i(e), t = i(r);
|
|
30
18
|
return (n == null ? void 0 : n.lower) === (t == null ? void 0 : t.lower) && (n == null ? void 0 : n.upper) === (t == null ? void 0 : t.upper);
|
|
31
|
-
},
|
|
19
|
+
}, O = (e) => e.lower > e.upper ? { lower: e.upper, upper: e.lower } : e, j = (e, r) => {
|
|
32
20
|
const n = i(e);
|
|
33
21
|
return r < n.lower ? n.lower : r >= n.upper ? n.upper - (typeof n.upper == "number" ? 1 : 1n) : r;
|
|
34
22
|
}, a = (e, r) => {
|
|
@@ -37,35 +25,35 @@ const c = (e) => typeof e == "bigint" || e instanceof BigInt, m = (e, r) => c(e)
|
|
|
37
25
|
return r >= n.lower && r < n.upper;
|
|
38
26
|
const t = i(r);
|
|
39
27
|
return t.lower >= n.lower && t.upper <= n.upper;
|
|
40
|
-
},
|
|
28
|
+
}, P = (e, r) => {
|
|
41
29
|
const n = i(e), t = i(r);
|
|
42
30
|
return n.lower === t.lower ? !0 : t.upper === n.lower || t.lower === n.upper ? !1 : a(n, t.upper) || a(n, t.lower) || a(t, n.upper) || a(t, n.lower);
|
|
43
31
|
}, w = (e) => {
|
|
44
32
|
const r = i(e);
|
|
45
33
|
return r.upper - r.lower;
|
|
46
|
-
},
|
|
34
|
+
}, z = (e) => {
|
|
47
35
|
const r = i(e);
|
|
48
36
|
return typeof r.lower == "bigint" ? r.lower === 0n && r.upper === 0n : r.lower === 0 && r.upper === 0;
|
|
49
|
-
},
|
|
37
|
+
}, E = (e) => {
|
|
50
38
|
const r = w(e);
|
|
51
39
|
return typeof r == "number" ? r === 0 : r === 0n;
|
|
52
|
-
},
|
|
40
|
+
}, D = (e) => {
|
|
53
41
|
const r = i(e);
|
|
54
42
|
return typeof r.lower == "bigint" ? !0 : Number.isFinite(r.lower) && Number.isFinite(r.upper);
|
|
55
|
-
},
|
|
43
|
+
}, F = (e) => {
|
|
56
44
|
const r = i(e);
|
|
57
45
|
return (r.upper + r.lower) / 2;
|
|
58
|
-
},
|
|
46
|
+
}, L = (e) => ({
|
|
59
47
|
lower: Math.min(...e.map((r) => i(r).lower)),
|
|
60
48
|
upper: Math.max(...e.map((r) => i(r).upper))
|
|
61
|
-
}),
|
|
49
|
+
}), T = (e) => ({
|
|
62
50
|
lower: Math.max(...e.map((r) => i(r).lower)),
|
|
63
51
|
upper: Math.min(...e.map((r) => i(r).upper))
|
|
64
|
-
}),
|
|
52
|
+
}), Z = (e) => {
|
|
65
53
|
const r = i(e), n = typeof r.lower == "bigint";
|
|
66
54
|
return Array.from({ length: Number(w(e)) }, (t, o) => n ? r.lower + BigInt(o) : r.lower + o);
|
|
67
55
|
}, I = (e, r) => {
|
|
68
|
-
const n = e.map((
|
|
56
|
+
const n = e.map((s) => i(s)), t = n.findIndex((s) => a(s, r) || r < s.lower);
|
|
69
57
|
if (t === -1) return { index: e.length, position: 0 };
|
|
70
58
|
const o = n[t];
|
|
71
59
|
return a(o, r) ? { index: t, position: Number(r - o.lower) } : { index: t, position: 0 };
|
|
@@ -74,102 +62,111 @@ const c = (e) => typeof e == "bigint" || e instanceof BigInt, m = (e, r) => c(e)
|
|
|
74
62
|
removeAfter: 0,
|
|
75
63
|
insertInto: 0,
|
|
76
64
|
deleteInBetween: 0
|
|
77
|
-
},
|
|
65
|
+
}, S = (e, r) => {
|
|
78
66
|
const n = e.map((p) => i(p)), t = i(r);
|
|
79
67
|
if (n.length === 0) return d;
|
|
80
|
-
const o = I(n, t.lower),
|
|
68
|
+
const o = I(n, t.lower), s = I(n, t.upper);
|
|
81
69
|
if (o.index === e.length) return { ...d, insertInto: e.length };
|
|
82
|
-
if (
|
|
83
|
-
if (o.index ===
|
|
84
|
-
return o.position !== 0 &&
|
|
85
|
-
removeAfter:
|
|
70
|
+
if (s.index === 0) return { ...d, removeAfter: s.position };
|
|
71
|
+
if (o.index === s.index)
|
|
72
|
+
return o.position !== 0 && s.position !== 0 ? null : {
|
|
73
|
+
removeAfter: s.position,
|
|
86
74
|
removeBefore: o.position,
|
|
87
75
|
insertInto: o.index,
|
|
88
76
|
deleteInBetween: 0
|
|
89
77
|
};
|
|
90
|
-
let u =
|
|
91
|
-
return o.position !== 0 ? (u -= 1, f += 1) :
|
|
92
|
-
removeBefore:
|
|
93
|
-
removeAfter:
|
|
78
|
+
let u = s.index - o.index, f = o.index, l = v(Number(w(n[o.index])), o.position);
|
|
79
|
+
return o.position !== 0 ? (u -= 1, f += 1) : l = 0, {
|
|
80
|
+
removeBefore: l,
|
|
81
|
+
removeAfter: s.position,
|
|
94
82
|
insertInto: f,
|
|
95
83
|
deleteInBetween: u
|
|
96
84
|
};
|
|
97
|
-
},
|
|
85
|
+
}, $ = (e, r, n) => {
|
|
98
86
|
const t = e.map((f) => i(f)), o = n > 0 ? 1 : n < 0 ? -1 : 0;
|
|
99
87
|
if (o === 0) return r;
|
|
100
|
-
let
|
|
101
|
-
for (;
|
|
102
|
-
const f = t.findIndex((
|
|
88
|
+
let s = n, u = r;
|
|
89
|
+
for (; g(s, 0) === !1; ) {
|
|
90
|
+
const f = t.findIndex((l) => o > 0 ? u >= l.lower && u < l.upper : u > l.lower && u <= l.upper);
|
|
103
91
|
if (f !== -1) {
|
|
104
|
-
const
|
|
92
|
+
const l = t[f];
|
|
105
93
|
let p;
|
|
106
|
-
if (o > 0 ? p =
|
|
107
|
-
const
|
|
108
|
-
if (u =
|
|
94
|
+
if (o > 0 ? p = v(l.upper, u) : p = v(u, l.lower), p > 0) {
|
|
95
|
+
const m = h(x(s), p);
|
|
96
|
+
if (u = B(
|
|
109
97
|
u,
|
|
110
|
-
o > 0 ?
|
|
111
|
-
),
|
|
98
|
+
o > 0 ? m : -m
|
|
99
|
+
), s = v(s, o > 0 ? m : -m), g(s, 0)) return u;
|
|
112
100
|
continue;
|
|
113
101
|
}
|
|
114
102
|
}
|
|
115
103
|
if (o > 0) {
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
104
|
+
const l = t.filter((p) => p.lower > u);
|
|
105
|
+
if (l.length > 0) u = l[0].lower;
|
|
118
106
|
else return u;
|
|
119
107
|
} else {
|
|
120
|
-
const
|
|
121
|
-
if (
|
|
122
|
-
u =
|
|
108
|
+
const l = t.filter((p) => p.upper < u);
|
|
109
|
+
if (l.length > 0)
|
|
110
|
+
u = l[l.length - 1].upper;
|
|
123
111
|
else return u;
|
|
124
112
|
}
|
|
125
113
|
}
|
|
126
114
|
return u;
|
|
127
|
-
},
|
|
115
|
+
}, k = (e, r, n) => {
|
|
128
116
|
const t = e.map((u) => i(u));
|
|
129
117
|
if (r === n) return typeof r == "bigint" ? 0n : 0;
|
|
130
118
|
const o = r < n ? i([r, n]) : i([n, r]);
|
|
131
|
-
let
|
|
119
|
+
let s = typeof r == "bigint" ? 0n : 0;
|
|
132
120
|
for (const u of t) {
|
|
133
|
-
const f = u.lower > o.lower ? u.lower : o.lower,
|
|
134
|
-
if (f <
|
|
135
|
-
const p =
|
|
136
|
-
|
|
121
|
+
const f = u.lower > o.lower ? u.lower : o.lower, l = u.upper < o.upper ? u.upper : o.upper;
|
|
122
|
+
if (f < l) {
|
|
123
|
+
const p = l - f;
|
|
124
|
+
s = s + p;
|
|
137
125
|
}
|
|
138
126
|
}
|
|
139
|
-
return
|
|
140
|
-
},
|
|
127
|
+
return s;
|
|
128
|
+
}, G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
141
129
|
__proto__: null,
|
|
142
|
-
CLIP:
|
|
143
|
-
DECIMAL:
|
|
144
|
-
INFINITE:
|
|
145
|
-
ZERO:
|
|
146
|
-
bounds:
|
|
147
|
-
buildInsertionPlan:
|
|
148
|
-
clamp:
|
|
130
|
+
CLIP: M,
|
|
131
|
+
DECIMAL: _,
|
|
132
|
+
INFINITE: N,
|
|
133
|
+
ZERO: y,
|
|
134
|
+
bounds: b,
|
|
135
|
+
buildInsertionPlan: S,
|
|
136
|
+
clamp: j,
|
|
149
137
|
construct: i,
|
|
150
138
|
contains: a,
|
|
151
|
-
distance:
|
|
152
|
-
equals:
|
|
139
|
+
distance: k,
|
|
140
|
+
equals: A,
|
|
153
141
|
findInsertPosition: I,
|
|
154
|
-
isFinite:
|
|
155
|
-
isZero:
|
|
156
|
-
linspace:
|
|
157
|
-
makeValid:
|
|
158
|
-
max:
|
|
159
|
-
mean:
|
|
160
|
-
min:
|
|
161
|
-
overlapsWith:
|
|
142
|
+
isFinite: D,
|
|
143
|
+
isZero: z,
|
|
144
|
+
linspace: Z,
|
|
145
|
+
makeValid: O,
|
|
146
|
+
max: L,
|
|
147
|
+
mean: F,
|
|
148
|
+
min: T,
|
|
149
|
+
overlapsWith: P,
|
|
162
150
|
span: w,
|
|
163
|
-
spanIsZero:
|
|
164
|
-
traverse:
|
|
151
|
+
spanIsZero: E,
|
|
152
|
+
traverse: $
|
|
165
153
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
166
154
|
export {
|
|
167
|
-
|
|
168
|
-
|
|
155
|
+
j as a,
|
|
156
|
+
G as b,
|
|
169
157
|
i as c,
|
|
170
158
|
a as d,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
159
|
+
k as e,
|
|
160
|
+
x as f,
|
|
161
|
+
B as g,
|
|
162
|
+
C as h,
|
|
163
|
+
W as i,
|
|
164
|
+
g as j,
|
|
165
|
+
U as k,
|
|
166
|
+
h as l,
|
|
167
|
+
V as m,
|
|
168
|
+
v as n,
|
|
169
|
+
R as r,
|
|
170
|
+
w as s,
|
|
171
|
+
$ as t
|
|
175
172
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const _=require("./base-BAM2mqCy.cjs"),a=e=>typeof e=="bigint"||e instanceof BigInt,m=(e,r)=>a(e)?e.valueOf()-BigInt(r.valueOf().valueOf()):e.valueOf()-Number(r.valueOf()),b=(e,r)=>a(e)?e.valueOf()+BigInt(r.valueOf().valueOf()):e+Number(r.valueOf()),M=(e,r,n=1e-4)=>Math.abs(e-r)<n,O=(e,r)=>a(e)?e===BigInt(r.valueOf().valueOf()):e===Number(r.valueOf()),A=e=>{const r=10**Math.floor(Math.log10(e));return Math.round(e/r)*r},B=(e,r)=>a(e)?e.valueOf()<BigInt(r.valueOf())?e:BigInt(r.valueOf()):e.valueOf()<Number(r.valueOf())?e:Number(r.valueOf()),j=(e,r)=>a(e)?e.valueOf()>BigInt(r.valueOf())?e:BigInt(r.valueOf()):e.valueOf()>Number(r.valueOf())?e:Number(r.valueOf()),h=e=>a(e)||e instanceof BigInt?e.valueOf()<0n?-e:e:e.valueOf()<0?-e:e,P=(e,r)=>a(e)?e.valueOf()*BigInt(r.valueOf()):e.valueOf()*Number(r.valueOf()),T=(e,r)=>a(e)?e.valueOf()/BigInt(r.valueOf()):e.valueOf()/Number(r.valueOf()),i=(e,r)=>{const n={};if(typeof e=="number"||typeof e=="bigint")r!=null?(n.lower=e,n.upper=r):(n.lower=typeof e=="bigint"?0n:0,n.upper=e);else if(Array.isArray(e)){if(e.length!==2)throw new Error("bounds: expected array of length 2");[n.lower,n.upper]=e}else return I(e);return I(n)},z=Object.freeze({lower:0,upper:0}),E=Object.freeze({lower:-1/0,upper:1/0}),q=Object.freeze({lower:0,upper:1}),D=Object.freeze({lower:-1,upper:1}),F=(e,r)=>{if(e==null&&r==null)return!0;if(e==null||r==null)return!1;const n=i(e),t=i(r);return(n==null?void 0:n.lower)===(t==null?void 0:t.lower)&&(n==null?void 0:n.upper)===(t==null?void 0:t.upper)},I=e=>e.lower>e.upper?{lower:e.upper,upper:e.lower}:e,x=(e,r)=>{const n=i(e);return r<n.lower?n.lower:r>=n.upper?n.upper-(typeof n.upper=="number"?1:1n):r},c=(e,r)=>{const n=i(e);if(typeof r=="number"||typeof r=="bigint")return r>=n.lower&&r<n.upper;const t=i(r);return t.lower>=n.lower&&t.upper<=n.upper},L=(e,r)=>{const n=i(e),t=i(r);return n.lower===t.lower?!0:t.upper===n.lower||t.lower===n.upper?!1:c(n,t.upper)||c(n,t.lower)||c(t,n.upper)||c(t,n.lower)},v=e=>{const r=i(e);return r.upper-r.lower},Z=e=>{const r=i(e);return typeof r.lower=="bigint"?r.lower===0n&&r.upper===0n:r.lower===0&&r.upper===0},S=e=>{const r=v(e);return typeof r=="number"?r===0:r===0n},C=e=>{const r=i(e);return typeof r.lower=="bigint"?!0:Number.isFinite(r.lower)&&Number.isFinite(r.upper)},R=e=>{const r=i(e);return(r.upper+r.lower)/2},$=e=>({lower:Math.min(...e.map(r=>i(r).lower)),upper:Math.max(...e.map(r=>i(r).upper))}),k=e=>({lower:Math.max(...e.map(r=>i(r).lower)),upper:Math.min(...e.map(r=>i(r).upper))}),U=e=>{const r=i(e),n=typeof r.lower=="bigint";return Array.from({length:Number(v(e))},(t,o)=>n?r.lower+BigInt(o):r.lower+o)},g=(e,r)=>{const n=e.map(l=>i(l)),t=n.findIndex(l=>c(l,r)||r<l.lower);if(t===-1)return{index:e.length,position:0};const o=n[t];return c(o,r)?{index:t,position:Number(r-o.lower)}:{index:t,position:0}},w={removeBefore:0,removeAfter:0,insertInto:0,deleteInBetween:0},V=(e,r)=>{const n=e.map(p=>i(p)),t=i(r);if(n.length===0)return w;const o=g(n,t.lower),l=g(n,t.upper);if(o.index===e.length)return{...w,insertInto:e.length};if(l.index===0)return{...w,removeAfter:l.position};if(o.index===l.index)return o.position!==0&&l.position!==0?null:{removeAfter:l.position,removeBefore:o.position,insertInto:o.index,deleteInBetween:0};let u=l.index-o.index,f=o.index,s=m(Number(v(n[o.index])),o.position);return o.position!==0?(u-=1,f+=1):s=0,{removeBefore:s,removeAfter:l.position,insertInto:f,deleteInBetween:u}},y=(e,r,n)=>{const t=e.map(f=>i(f)),o=n>0?1:n<0?-1:0;if(o===0)return r;let l=n,u=r;for(;O(l,0)===!1;){const f=t.findIndex(s=>o>0?u>=s.lower&&u<s.upper:u>s.lower&&u<=s.upper);if(f!==-1){const s=t[f];let p;if(o>0?p=m(s.upper,u):p=m(u,s.lower),p>0){const d=B(h(l),p);if(u=b(u,o>0?d:-d),l=m(l,o>0?d:-d),O(l,0))return u;continue}}if(o>0){const s=t.filter(p=>p.lower>u);if(s.length>0)u=s[0].lower;else return u}else{const s=t.filter(p=>p.upper<u);if(s.length>0)u=s[s.length-1].upper;else return u}}return u},N=(e,r,n)=>{const t=e.map(u=>i(u));if(r===n)return typeof r=="bigint"?0n:0;const o=r<n?i([r,n]):i([n,r]);let l=typeof r=="bigint"?0n:0;for(const u of t){const f=u.lower>o.lower?u.lower:o.lower,s=u.upper<o.upper?u.upper:o.upper;if(f<s){const p=s-f;l=l+p}}return l},W=Object.freeze(Object.defineProperty({__proto__:null,CLIP:D,DECIMAL:q,INFINITE:E,ZERO:z,bounds:_.bounds,buildInsertionPlan:V,clamp:x,construct:i,contains:c,distance:N,equals:F,findInsertPosition:g,isFinite:C,isZero:Z,linspace:U,makeValid:I,max:$,mean:R,min:k,overlapsWith:L,span:v,spanIsZero:S,traverse:y},Symbol.toStringTag,{value:"Module"}));exports.abs=h;exports.add=b;exports.bounds=W;exports.clamp=x;exports.closeTo=M;exports.construct=i;exports.contains=c;exports.distance=N;exports.div=T;exports.equal=O;exports.max=j;exports.min=B;exports.mult=P;exports.roundToNearestMagnitude=A;exports.span=v;exports.sub=m;exports.traverse=y;
|
package/dist/bounds.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bounds-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bounds-M-SZ3X1Z.cjs");exports.bounds=e.bounds;
|
package/dist/bounds.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("zod"),R=require("./direction-C-b6XTeU.cjs"),x=require("./location-BGl5Ddds.cjs"),i=require("./xy-B7065J2S.cjs"),m=require("./base-BAM2mqCy.cjs"),p=u.z.union([u.z.number(),u.z.string()]),H=u.z.object({top:p,left:p,width:p,height:p}),W=u.z.object({left:u.z.number(),top:u.z.number(),right:u.z.number(),bottom:u.z.number()}),S=u.z.object({one:m.xy,two:m.xy,root:x.corner}),B={one:i.ZERO,two:i.ZERO,root:x.TOP_LEFT},v={one:i.ZERO,two:i.ONE,root:x.BOTTOM_LEFT},C=(t,o)=>({one:t.one,two:t.two,root:o??t.root}),c=(t,o,e=0,n=0,s)=>{const r={one:{...i.ZERO},two:{...i.ZERO},root:s??x.TOP_LEFT};if(typeof t=="number"){if(typeof o!="number")throw new Error("Box constructor called with invalid arguments");return r.one={x:t,y:o},r.two={x:r.one.x+e,y:r.one.y+n},r}return"one"in t&&"two"in t&&"root"in t?{...t,root:s??t.root}:("getBoundingClientRect"in t&&(t=t.getBoundingClientRect()),"left"in t?(r.one={x:t.left,y:t.top},r.two={x:t.right,y:t.bottom},r):(r.one=t,o==null?r.two={x:r.one.x+e,y:r.one.y+n}:typeof o=="number"?r.two={x:r.one.x+o,y:r.one.y+e}:"width"in o?r.two={x:r.one.x+o.width,y:r.one.y+o.height}:"signedWidth"in o?r.two={x:r.one.x+o.signedWidth,y:r.one.y+o.signedHeight}:r.two=o,r))},G=(t,o,e)=>{const n=c(t);if(typeof o=="string"){if(e==null)throw new Error("Invalid arguments for resize");const s=R.construct(o);return c(n.one,void 0,s==="x"?e:w(n),s==="y"?e:d(n),n.root)}return c(n.one,o,void 0,void 0,n.root)},D=(t,o,e=!0)=>{const n=c(t);let s=(r,y)=>r<y;return e&&(s=(r,y)=>r<=y),"one"in o?s(a(n),a(o))&&s(h(o),h(n))&&s(f(n),f(o))&&s(_(o),_(n)):s(a(n),o.x)&&s(o.x,h(n))&&s(f(n),o.y)&&s(o.y,_(n))},X=(t,o)=>i.equals(t.one,o.one)&&i.equals(t.two,o.two)&&x.xyEquals(t.root,o.root),I=t=>({width:w(t),height:d(t)}),$=t=>({signedWidth:O(t),signedHeight:E(t)}),U=t=>({top:f(t),left:a(t),width:w(t),height:d(t)}),L=(t,o,e=!1)=>{const n=R.construct(o)==="y"?E(t):O(t);return e?n:Math.abs(n)},l=(t,o)=>{const e=c(t);return{x:o.x==="center"?b(e).x:g(e,o.x),y:o.y==="center"?b(e).y:g(e,o.y)}},g=(t,o)=>{const e=c(t),n=x.xyCouple(e.root).includes(o)?Math.min:Math.max;return m.X_LOCATIONS.includes(o)?n(e.one.x,e.two.x):n(e.one.y,e.two.y)},Y=t=>t.one.x===t.two.x&&t.one.y===t.two.y,w=t=>L(t,"x"),d=t=>L(t,"y"),O=t=>{const o=c(t);return o.two.x-o.one.x},E=t=>{const o=c(t);return o.two.y-o.one.y},q=t=>l(t,x.TOP_LEFT),k=t=>l(t,x.TOP_CENTER),J=t=>l(t,x.TOP_RIGHT),K=t=>l(t,x.BOTTOM_LEFT),Q=t=>l(t,x.BOTTOM_CENTER),V=t=>l(t,x.BOTTOM_RIGHT),tt=t=>l(t,x.CENTER_LEFT),ot=t=>l(t,x.CENTER_RIGHT),h=t=>g(t,"right"),_=t=>g(t,"bottom"),a=t=>g(t,"left"),f=t=>g(t,"top"),b=t=>i.translate(q(t),{x:O(t)/2,y:E(t)/2}),M=t=>{const o=c(t);return o.root.x==="left"?a(o):h(o)},z=t=>{const o=c(t);return o.root.y==="top"?f(o):_(o)},nt=t=>({x:M(t),y:z(t)}),N=t=>{const o=c(t);return{lower:o.one.x,upper:o.two.x}},P=t=>{const o=c(t);return{lower:o.one.y,upper:o.two.y}},et=(t,o)=>C(t,o),rt=(t,o)=>{const e=c(t),n=m.X_LOCATIONS.includes(o)?"x":m.Y_LOCATIONS.includes(o)?"y":null;if(n===null)throw new Error(`Invalid location: ${o}`);const s=o==="top"||o==="left"?Math.min:Math.max,r={...e.one},y={...e.two};return r[n]=s(e.one[n],e.two[n]),y[n]=s(e.one[n],e.two[n]),[r,y]},st=(t,o)=>{const e=c(t),n=c(o),s=M(n)+(w(n)-w(e))/2,r=z(n)+(d(n)-d(e))/2;return c({x:s,y:r},I(e))},Z=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,ct=t=>w(t)/d(t),it=(t,o,e)=>{if(typeof o=="string"){if(e==null)throw new Error("Undefined amount passed into box.translate");const s=R.construct(o);o=i.construct(s,e)}const n=c(t);return c(i.translate(n.one,o),i.translate(n.two,o),void 0,void 0,n.root)},j=(t,o)=>{const e=Math.max(a(t),a(o)),n=Math.max(f(t),f(o)),s=Math.min(h(t),h(o)),r=Math.min(_(t),_(o));return e>s||n>r?B:c({x:e,y:n},{x:s,y:r},void 0,void 0,t.root)},A=t=>w(t)*d(t),xt=(t,o)=>{const e=c(t);return c(i.truncate(e.one,o),i.truncate(e.two,o),void 0,void 0,e.root)},F=(t,o,e,n,s,r)=>{const y={x:t,y:o},T={x:t+e,y:o+n};return s.x!==r.x&&(s.x==="center"?(y.x-=e/2,T.x-=e/2):(y.x-=e,T.x-=e)),s.y!==r.y&&(s.y==="center"?(y.y-=n/2,T.y-=n/2):(y.y-=n,T.y-=n)),c(y,T,void 0,void 0,r)},yt=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:v,ZERO:B,area:A,areaIsZero:Y,aspect:ct,bottom:_,bottomCenter:Q,bottomLeft:K,bottomRight:V,box:S,center:b,centerLeft:tt,centerRight:ot,construct:c,constructWithAlternateRoot:F,contains:D,copy:C,css:U,cssBox:H,dim:L,dims:I,domRect:W,edgePoints:rt,equals:X,height:d,intersection:j,isBox:Z,left:a,loc:g,positionInCenter:st,reRoot:et,resize:G,right:h,root:nt,signedDims:$,signedHeight:E,signedWidth:O,top:f,topCenter:k,topLeft:q,topRight:J,translate:it,truncate:xt,width:w,x:M,xBounds:N,xyLoc:l,y:z,yBounds:P},Symbol.toStringTag,{value:"Module"}));exports.area=A;exports.box=yt;exports.construct=c;exports.constructWithAlternateRoot=F;exports.height=d;exports.intersection=j;exports.isBox=Z;exports.width=w;exports.xBounds=N;exports.xyLoc=l;exports.yBounds=P;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { z as x } from "zod";
|
|
2
|
+
import { c as O } from "./direction-BL0PhD1k.js";
|
|
3
|
+
import { c as A, T as M, B as j, b as S, d as Z, e as q, f as v, g as F, h as G, i as D, j as X } from "./location-C3aeu046.js";
|
|
4
|
+
import { Z as g, O as Y, e as I, t as b, c as U, a as L } from "./xy-D_LqxaGt.js";
|
|
5
|
+
import { x as $, X as N, Y as k } from "./base-DFq0vvGn.js";
|
|
6
|
+
const h = x.union([x.number(), x.string()]), J = x.object({
|
|
7
|
+
top: h,
|
|
8
|
+
left: h,
|
|
9
|
+
width: h,
|
|
10
|
+
height: h
|
|
11
|
+
}), K = x.object({
|
|
12
|
+
left: x.number(),
|
|
13
|
+
top: x.number(),
|
|
14
|
+
right: x.number(),
|
|
15
|
+
bottom: x.number()
|
|
16
|
+
}), Q = x.object({
|
|
17
|
+
one: $,
|
|
18
|
+
two: $,
|
|
19
|
+
root: A
|
|
20
|
+
}), H = { one: g, two: g, root: M }, V = { one: g, two: Y, root: j }, P = (t, o) => ({
|
|
21
|
+
one: t.one,
|
|
22
|
+
two: t.two,
|
|
23
|
+
root: o ?? t.root
|
|
24
|
+
}), c = (t, o, e = 0, n = 0, r) => {
|
|
25
|
+
const s = {
|
|
26
|
+
one: { ...g },
|
|
27
|
+
two: { ...g },
|
|
28
|
+
root: r ?? M
|
|
29
|
+
};
|
|
30
|
+
if (typeof t == "number") {
|
|
31
|
+
if (typeof o != "number")
|
|
32
|
+
throw new Error("Box constructor called with invalid arguments");
|
|
33
|
+
return s.one = { x: t, y: o }, s.two = { x: s.one.x + e, y: s.one.y + n }, s;
|
|
34
|
+
}
|
|
35
|
+
return "one" in t && "two" in t && "root" in t ? { ...t, root: r ?? t.root } : ("getBoundingClientRect" in t && (t = t.getBoundingClientRect()), "left" in t ? (s.one = { x: t.left, y: t.top }, s.two = { x: t.right, y: t.bottom }, s) : (s.one = t, o == null ? s.two = { x: s.one.x + e, y: s.one.y + n } : typeof o == "number" ? s.two = { x: s.one.x + o, y: s.one.y + e } : "width" in o ? s.two = {
|
|
36
|
+
x: s.one.x + o.width,
|
|
37
|
+
y: s.one.y + o.height
|
|
38
|
+
} : "signedWidth" in o ? s.two = {
|
|
39
|
+
x: s.one.x + o.signedWidth,
|
|
40
|
+
y: s.one.y + o.signedHeight
|
|
41
|
+
} : s.two = o, s));
|
|
42
|
+
}, tt = (t, o, e) => {
|
|
43
|
+
const n = c(t);
|
|
44
|
+
if (typeof o == "string") {
|
|
45
|
+
if (e == null) throw new Error("Invalid arguments for resize");
|
|
46
|
+
const r = O(o);
|
|
47
|
+
return c(
|
|
48
|
+
n.one,
|
|
49
|
+
void 0,
|
|
50
|
+
r === "x" ? e : f(n),
|
|
51
|
+
r === "y" ? e : w(n),
|
|
52
|
+
n.root
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return c(n.one, o, void 0, void 0, n.root);
|
|
56
|
+
}, ot = (t, o, e = !0) => {
|
|
57
|
+
const n = c(t);
|
|
58
|
+
let r = (s, i) => s < i;
|
|
59
|
+
return e && (r = (s, i) => s <= i), "one" in o ? r(a(n), a(o)) && r(l(o), l(n)) && r(u(n), u(o)) && r(m(o), m(n)) : r(a(n), o.x) && r(o.x, l(n)) && r(u(n), o.y) && r(o.y, m(n));
|
|
60
|
+
}, nt = (t, o) => I(t.one, o.one) && I(t.two, o.two) && S(t.root, o.root), W = (t) => ({
|
|
61
|
+
width: f(t),
|
|
62
|
+
height: w(t)
|
|
63
|
+
}), et = (t) => ({
|
|
64
|
+
signedWidth: _(t),
|
|
65
|
+
signedHeight: T(t)
|
|
66
|
+
}), st = (t) => ({
|
|
67
|
+
top: u(t),
|
|
68
|
+
left: a(t),
|
|
69
|
+
width: f(t),
|
|
70
|
+
height: w(t)
|
|
71
|
+
}), C = (t, o, e = !1) => {
|
|
72
|
+
const n = O(o) === "y" ? T(t) : _(t);
|
|
73
|
+
return e ? n : Math.abs(n);
|
|
74
|
+
}, y = (t, o) => {
|
|
75
|
+
const e = c(t);
|
|
76
|
+
return {
|
|
77
|
+
x: o.x === "center" ? E(e).x : d(e, o.x),
|
|
78
|
+
y: o.y === "center" ? E(e).y : d(e, o.y)
|
|
79
|
+
};
|
|
80
|
+
}, d = (t, o) => {
|
|
81
|
+
const e = c(t), n = Z(e.root).includes(o) ? Math.min : Math.max;
|
|
82
|
+
return N.includes(o) ? n(e.one.x, e.two.x) : n(e.one.y, e.two.y);
|
|
83
|
+
}, rt = (t) => t.one.x === t.two.x && t.one.y === t.two.y, f = (t) => C(t, "x"), w = (t) => C(t, "y"), _ = (t) => {
|
|
84
|
+
const o = c(t);
|
|
85
|
+
return o.two.x - o.one.x;
|
|
86
|
+
}, T = (t) => {
|
|
87
|
+
const o = c(t);
|
|
88
|
+
return o.two.y - o.one.y;
|
|
89
|
+
}, z = (t) => y(t, M), ct = (t) => y(t, q), it = (t) => y(t, v), xt = (t) => y(t, j), yt = (t) => y(t, F), at = (t) => y(t, G), ut = (t) => y(t, D), ft = (t) => y(t, X), l = (t) => d(t, "right"), m = (t) => d(t, "bottom"), a = (t) => d(t, "left"), u = (t) => d(t, "top"), E = (t) => b(z(t), {
|
|
90
|
+
x: _(t) / 2,
|
|
91
|
+
y: T(t) / 2
|
|
92
|
+
}), B = (t) => {
|
|
93
|
+
const o = c(t);
|
|
94
|
+
return o.root.x === "left" ? a(o) : l(o);
|
|
95
|
+
}, R = (t) => {
|
|
96
|
+
const o = c(t);
|
|
97
|
+
return o.root.y === "top" ? u(o) : m(o);
|
|
98
|
+
}, wt = (t) => ({ x: B(t), y: R(t) }), lt = (t) => {
|
|
99
|
+
const o = c(t);
|
|
100
|
+
return { lower: o.one.x, upper: o.two.x };
|
|
101
|
+
}, mt = (t) => {
|
|
102
|
+
const o = c(t);
|
|
103
|
+
return { lower: o.one.y, upper: o.two.y };
|
|
104
|
+
}, dt = (t, o) => P(t, o), pt = (t, o) => {
|
|
105
|
+
const e = c(t), n = N.includes(o) ? "x" : k.includes(o) ? "y" : null;
|
|
106
|
+
if (n === null) throw new Error(`Invalid location: ${o}`);
|
|
107
|
+
const r = o === "top" || o === "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
|
+
}, gt = (t, o) => {
|
|
110
|
+
const e = c(t), n = c(o), r = B(n) + (f(n) - f(e)) / 2, s = R(n) + (w(n) - w(e)) / 2;
|
|
111
|
+
return c({ x: r, y: s }, W(e));
|
|
112
|
+
}, ht = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, _t = (t) => f(t) / w(t), Tt = (t, o, e) => {
|
|
113
|
+
if (typeof o == "string") {
|
|
114
|
+
if (e == null) throw new Error("Undefined amount passed into box.translate");
|
|
115
|
+
const r = O(o);
|
|
116
|
+
o = U(r, e);
|
|
117
|
+
}
|
|
118
|
+
const n = c(t);
|
|
119
|
+
return c(
|
|
120
|
+
b(n.one, o),
|
|
121
|
+
b(n.two, o),
|
|
122
|
+
void 0,
|
|
123
|
+
void 0,
|
|
124
|
+
n.root
|
|
125
|
+
);
|
|
126
|
+
}, bt = (t, o) => {
|
|
127
|
+
const e = Math.max(a(t), a(o)), n = Math.max(u(t), u(o)), r = Math.min(l(t), l(o)), s = Math.min(m(t), m(o));
|
|
128
|
+
return e > r || n > s ? H : c({ x: e, y: n }, { x: r, y: s }, void 0, void 0, t.root);
|
|
129
|
+
}, Et = (t) => f(t) * w(t), Ot = (t, o) => {
|
|
130
|
+
const e = c(t);
|
|
131
|
+
return c(
|
|
132
|
+
L(e.one, o),
|
|
133
|
+
L(e.two, o),
|
|
134
|
+
void 0,
|
|
135
|
+
void 0,
|
|
136
|
+
e.root
|
|
137
|
+
);
|
|
138
|
+
}, Mt = (t, o, e, n, r, s) => {
|
|
139
|
+
const i = { x: t, y: o }, p = { x: t + e, y: o + n };
|
|
140
|
+
return r.x !== s.x && (r.x === "center" ? (i.x -= e / 2, p.x -= e / 2) : (i.x -= e, p.x -= e)), r.y !== s.y && (r.y === "center" ? (i.y -= n / 2, p.y -= n / 2) : (i.y -= n, p.y -= n)), c(i, p, void 0, void 0, s);
|
|
141
|
+
}, $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
142
|
+
__proto__: null,
|
|
143
|
+
DECIMAL: V,
|
|
144
|
+
ZERO: H,
|
|
145
|
+
area: Et,
|
|
146
|
+
areaIsZero: rt,
|
|
147
|
+
aspect: _t,
|
|
148
|
+
bottom: m,
|
|
149
|
+
bottomCenter: yt,
|
|
150
|
+
bottomLeft: xt,
|
|
151
|
+
bottomRight: at,
|
|
152
|
+
box: Q,
|
|
153
|
+
center: E,
|
|
154
|
+
centerLeft: ut,
|
|
155
|
+
centerRight: ft,
|
|
156
|
+
construct: c,
|
|
157
|
+
constructWithAlternateRoot: Mt,
|
|
158
|
+
contains: ot,
|
|
159
|
+
copy: P,
|
|
160
|
+
css: st,
|
|
161
|
+
cssBox: J,
|
|
162
|
+
dim: C,
|
|
163
|
+
dims: W,
|
|
164
|
+
domRect: K,
|
|
165
|
+
edgePoints: pt,
|
|
166
|
+
equals: nt,
|
|
167
|
+
height: w,
|
|
168
|
+
intersection: bt,
|
|
169
|
+
isBox: ht,
|
|
170
|
+
left: a,
|
|
171
|
+
loc: d,
|
|
172
|
+
positionInCenter: gt,
|
|
173
|
+
reRoot: dt,
|
|
174
|
+
resize: tt,
|
|
175
|
+
right: l,
|
|
176
|
+
root: wt,
|
|
177
|
+
signedDims: et,
|
|
178
|
+
signedHeight: T,
|
|
179
|
+
signedWidth: _,
|
|
180
|
+
top: u,
|
|
181
|
+
topCenter: ct,
|
|
182
|
+
topLeft: z,
|
|
183
|
+
topRight: it,
|
|
184
|
+
translate: Tt,
|
|
185
|
+
truncate: Ot,
|
|
186
|
+
width: f,
|
|
187
|
+
x: B,
|
|
188
|
+
xBounds: lt,
|
|
189
|
+
xyLoc: y,
|
|
190
|
+
y: R,
|
|
191
|
+
yBounds: mt
|
|
192
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
193
|
+
export {
|
|
194
|
+
Mt as a,
|
|
195
|
+
$t as b,
|
|
196
|
+
c,
|
|
197
|
+
Et as d,
|
|
198
|
+
ht as e,
|
|
199
|
+
lt as f,
|
|
200
|
+
w as h,
|
|
201
|
+
bt as i,
|
|
202
|
+
f as w,
|
|
203
|
+
y as x,
|
|
204
|
+
mt as y
|
|
205
|
+
};
|
package/dist/box.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./box-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./box-0YrQibkB.cjs");exports.box=e.box;
|
package/dist/box.js
CHANGED