@synnaxlabs/x 0.31.0 → 0.33.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 +24 -24
- package/dist/binary.cjs +1 -1
- package/dist/binary.js +1 -1
- package/dist/bounds-CCueigU3.js +171 -0
- package/dist/bounds-Cudf5M4H.cjs +1 -0
- package/dist/bounds.cjs +1 -1
- package/dist/bounds.js +1 -1
- package/dist/box-CZVdKCOc.cjs +1 -0
- package/dist/box-hAkmDC3K.js +201 -0
- package/dist/box.cjs +1 -1
- package/dist/box.js +1 -1
- package/dist/caseconv.cjs +1 -1
- package/dist/caseconv.js +1 -1
- package/dist/index-By0n2R_b.cjs +1 -0
- package/dist/{index-DgaYJC35.cjs → index-DQZfhLnw.cjs} +1 -1
- package/dist/{index-Duv1uH08.js → index-q_1Jz5rY.js} +5 -5
- package/dist/{index-B5THJ1eb.js → index-zsix_qnl.js} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +212 -178
- package/dist/{location-DjcaXEps.js → location-B5rSnQP3.js} +1 -1
- package/dist/{location-gPB1RtfA.cjs → location-YGxhLPDy.cjs} +1 -1
- package/dist/location.cjs +1 -1
- package/dist/location.js +1 -1
- package/dist/{position-DkON65EZ.js → position-BZOTg74V.js} +2 -2
- package/dist/{position-C71OiHiw.cjs → position-CjNCcq8X.cjs} +1 -1
- package/dist/position.cjs +1 -1
- package/dist/position.js +1 -1
- package/dist/{scale-COPgp55a.cjs → scale-BvbW9p2C.cjs} +1 -1
- package/dist/{scale-qw6vRO4s.js → scale-C7_4I3pa.js} +3 -3
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/series-BId9slhU.cjs +11 -0
- package/dist/{series-B5eA90Ci.js → series-CZw97Bq2.js} +619 -456
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +5 -5
- package/dist/src/caseconv/caseconv.d.ts.map +1 -1
- package/dist/src/deep/path.d.ts +1 -1
- package/dist/src/deep/path.d.ts.map +1 -1
- package/dist/src/id/id.d.ts +1 -2
- package/dist/src/id/id.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/math/math.d.ts +26 -6
- package/dist/src/math/math.d.ts.map +1 -1
- package/dist/src/math/math.spec.d.ts +2 -0
- package/dist/src/math/math.spec.d.ts.map +1 -0
- package/dist/src/migrate/migrate.d.ts +4 -1
- package/dist/src/migrate/migrate.d.ts.map +1 -1
- package/dist/src/record.d.ts +4 -0
- package/dist/src/record.d.ts.map +1 -1
- package/dist/src/spatial/bounds/bounds.d.ts +204 -2
- package/dist/src/spatial/bounds/bounds.d.ts.map +1 -1
- package/dist/src/spatial/box/box.d.ts +4 -4
- package/dist/src/spatial/box/box.d.ts.map +1 -1
- package/dist/src/strings/index.d.ts +2 -0
- package/dist/src/strings/index.d.ts.map +1 -0
- package/dist/src/strings/strings.d.ts +32 -0
- package/dist/src/strings/strings.d.ts.map +1 -0
- package/dist/src/strings/strings.spec.d.ts +2 -0
- package/dist/src/strings/strings.spec.d.ts.map +1 -0
- package/dist/src/telem/series.d.ts +35 -10
- package/dist/src/telem/series.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +12 -10
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/package.json +9 -9
- package/src/caseconv/caseconv.ts +1 -0
- package/src/deep/path.ts +1 -1
- package/src/id/id.ts +2 -2
- package/src/index.ts +1 -0
- package/src/math/math.spec.ts +149 -0
- package/src/math/math.ts +60 -9
- package/src/migrate/migrate.ts +23 -4
- package/src/record.ts +5 -0
- package/src/spatial/bounds/bounds.spec.ts +135 -270
- package/src/spatial/bounds/bounds.ts +290 -25
- package/src/spatial/box/box.ts +9 -5
- package/src/strings/index.ts +10 -0
- package/src/strings/strings.spec.ts +68 -0
- package/src/strings/strings.ts +87 -0
- package/src/telem/series.spec.ts +235 -0
- package/src/telem/series.ts +271 -52
- package/src/telem/telem.spec.ts +22 -0
- package/src/telem/telem.ts +44 -20
- package/src/zodutil/zodutil.spec.ts +5 -7
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/bounds-CpboA0q6.js +0 -127
- package/dist/bounds-ZZc1c-_Z.cjs +0 -1
- package/dist/box-BQID-0jO.cjs +0 -1
- package/dist/box-xRqO6NvI.js +0 -202
- package/dist/index-xk130iQA.cjs +0 -1
- package/dist/series-CJ65b1Uz.cjs +0 -11
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
> @synnaxlabs/x@0.
|
|
2
|
+
> @synnaxlabs/x@0.33.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 v5.4.
|
|
6
|
+
[36mvite v5.4.8 [32mbuilding for production...[36m[39m
|
|
7
7
|
transforming...
|
|
8
|
-
[32m✓[39m
|
|
8
|
+
[32m✓[39m 84 modules transformed.
|
|
9
9
|
Generated an empty chunk: "destructor".
|
|
10
10
|
rendering chunks...
|
|
11
11
|
|
|
@@ -46,20 +46,20 @@ computing gzip size...
|
|
|
46
46
|
[2mdist/[22m[36mobserve.js [39m[1m[2m 1.41 kB[22m[1m[22m[2m │ gzip: 0.60 kB[22m
|
|
47
47
|
[2mdist/[22m[36mdimensions-D-1PnJVI.js [39m[1m[2m 1.49 kB[22m[1m[22m[2m │ gzip: 0.66 kB[22m
|
|
48
48
|
[2mdist/[22m[36mpath-B-1-i3qC.js [39m[1m[2m 1.69 kB[22m[1m[22m[2m │ gzip: 0.68 kB[22m
|
|
49
|
-
[2mdist/[22m[36mindex-
|
|
49
|
+
[2mdist/[22m[36mindex-q_1Jz5rY.js [39m[1m[2m 1.71 kB[22m[1m[22m[2m │ gzip: 0.81 kB[22m
|
|
50
50
|
[2mdist/[22m[36murl.js [39m[1m[2m 1.98 kB[22m[1m[22m[2m │ gzip: 0.87 kB[22m
|
|
51
|
-
[2mdist/[22m[36mposition-
|
|
51
|
+
[2mdist/[22m[36mposition-BZOTg74V.js [39m[1m[2m 2.25 kB[22m[1m[22m[2m │ gzip: 1.06 kB[22m
|
|
52
52
|
[2mdist/[22m[36mxy-CrgPnICw.js [39m[1m[2m 2.61 kB[22m[1m[22m[2m │ gzip: 1.05 kB[22m
|
|
53
|
-
[2mdist/[22m[36mlocation-
|
|
53
|
+
[2mdist/[22m[36mlocation-B5rSnQP3.js [39m[1m[2m 2.80 kB[22m[1m[22m[2m │ gzip: 1.17 kB[22m
|
|
54
54
|
[2mdist/[22m[36mindex-B3BUDIdi.js [39m[1m[2m 2.91 kB[22m[1m[22m[2m │ gzip: 1.14 kB[22m
|
|
55
|
-
[2mdist/[22m[36mindex-
|
|
55
|
+
[2mdist/[22m[36mindex-zsix_qnl.js [39m[1m[2m 2.95 kB[22m[1m[22m[2m │ gzip: 1.12 kB[22m
|
|
56
56
|
[2mdist/[22m[36mdeep.js [39m[1m[2m 3.24 kB[22m[1m[22m[2m │ gzip: 1.27 kB[22m
|
|
57
|
-
[2mdist/[22m[
|
|
58
|
-
[2mdist/[22m[
|
|
59
|
-
[2mdist/[22m[
|
|
60
|
-
[2mdist/[22m[36mindex.js [39m[1m[2m
|
|
61
|
-
[2mdist/[22m[36mseries-
|
|
62
|
-
[vite:dts] Declaration files built in
|
|
57
|
+
[2mdist/[22m[36mscale-C7_4I3pa.js [39m[1m[2m 5.64 kB[22m[1m[22m[2m │ gzip: 1.77 kB[22m
|
|
58
|
+
[2mdist/[22m[36mbox-hAkmDC3K.js [39m[1m[2m 6.14 kB[22m[1m[22m[2m │ gzip: 2.18 kB[22m
|
|
59
|
+
[2mdist/[22m[36mbounds-CCueigU3.js [39m[1m[2m 6.45 kB[22m[1m[22m[2m │ gzip: 2.05 kB[22m
|
|
60
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m 8.24 kB[22m[1m[22m[2m │ gzip: 3.10 kB[22m
|
|
61
|
+
[2mdist/[22m[36mseries-CZw97Bq2.js [39m[1m[2m60.53 kB[22m[1m[22m[2m │ gzip: 13.45 kB[22m
|
|
62
|
+
[vite:dts] Declaration files built in 3776ms.
|
|
63
63
|
|
|
64
64
|
Generated an empty chunk: "destructor".
|
|
65
65
|
[2mdist/[22m[36mdestructor.cjs [39m[1m[2m 0.01 kB[22m[1m[22m[2m │ gzip: 0.03 kB[22m
|
|
@@ -88,7 +88,7 @@ Generated an empty chunk: "destructor".
|
|
|
88
88
|
[2mdist/[22m[36mrecord.cjs [39m[1m[2m 0.25 kB[22m[1m[22m[2m │ gzip: 0.20 kB[22m
|
|
89
89
|
[2mdist/[22m[36mdebounce.cjs [39m[1m[2m 0.33 kB[22m[1m[22m[2m │ gzip: 0.22 kB[22m
|
|
90
90
|
[2mdist/[22m[36mdirection-DZbN47uL.cjs [39m[1m[2m 0.53 kB[22m[1m[22m[2m │ gzip: 0.34 kB[22m
|
|
91
|
-
[2mdist/[22m[36mtelem.cjs [39m[1m[2m 0.54 kB[22m[1m[22m[2m │ gzip: 0.
|
|
91
|
+
[2mdist/[22m[36mtelem.cjs [39m[1m[2m 0.54 kB[22m[1m[22m[2m │ gzip: 0.27 kB[22m
|
|
92
92
|
[2mdist/[22m[36mspatial.cjs [39m[1m[2m 0.63 kB[22m[1m[22m[2m │ gzip: 0.33 kB[22m
|
|
93
93
|
[2mdist/[22m[36mexternal-B-DoBvh7.cjs [39m[1m[2m 0.68 kB[22m[1m[22m[2m │ gzip: 0.45 kB[22m
|
|
94
94
|
[2mdist/[22m[36mzodutil-BWvwKcpb.cjs [39m[1m[2m 0.72 kB[22m[1m[22m[2m │ gzip: 0.46 kB[22m
|
|
@@ -97,17 +97,17 @@ Generated an empty chunk: "destructor".
|
|
|
97
97
|
[2mdist/[22m[36murl.cjs [39m[1m[2m 1.10 kB[22m[1m[22m[2m │ gzip: 0.60 kB[22m
|
|
98
98
|
[2mdist/[22m[36mdimensions-zMcb9pMk.cjs [39m[1m[2m 1.17 kB[22m[1m[22m[2m │ gzip: 0.58 kB[22m
|
|
99
99
|
[2mdist/[22m[36mpath-577Fmn5N.cjs [39m[1m[2m 1.27 kB[22m[1m[22m[2m │ gzip: 0.62 kB[22m
|
|
100
|
-
[2mdist/[22m[36mindex-
|
|
100
|
+
[2mdist/[22m[36mindex-By0n2R_b.cjs [39m[1m[2m 1.35 kB[22m[1m[22m[2m │ gzip: 0.72 kB[22m
|
|
101
101
|
[2mdist/[22m[36mbase-B48bPNx5.cjs [39m[1m[2m 1.38 kB[22m[1m[22m[2m │ gzip: 0.57 kB[22m
|
|
102
|
-
[2mdist/[22m[36mposition-
|
|
102
|
+
[2mdist/[22m[36mposition-CjNCcq8X.cjs [39m[1m[2m 1.71 kB[22m[1m[22m[2m │ gzip: 0.94 kB[22m
|
|
103
103
|
[2mdist/[22m[36mxy-cP-FXJtR.cjs [39m[1m[2m 2.00 kB[22m[1m[22m[2m │ gzip: 0.96 kB[22m
|
|
104
104
|
[2mdist/[22m[36mindex-h-QAL9T1.cjs [39m[1m[2m 2.23 kB[22m[1m[22m[2m │ gzip: 1.02 kB[22m
|
|
105
|
-
[2mdist/[22m[36mindex-
|
|
106
|
-
[2mdist/[22m[36mlocation-
|
|
105
|
+
[2mdist/[22m[36mindex-DQZfhLnw.cjs [39m[1m[2m 2.30 kB[22m[1m[22m[2m │ gzip: 1.01 kB[22m
|
|
106
|
+
[2mdist/[22m[36mlocation-YGxhLPDy.cjs [39m[1m[2m 2.37 kB[22m[1m[22m[2m │ gzip: 1.04 kB[22m
|
|
107
107
|
[2mdist/[22m[36mdeep.cjs [39m[1m[2m 2.39 kB[22m[1m[22m[2m │ gzip: 1.09 kB[22m
|
|
108
|
-
[2mdist/[22m[
|
|
109
|
-
[2mdist/[22m[
|
|
110
|
-
[2mdist/[22m[
|
|
111
|
-
[2mdist/[22m[36mindex.cjs [39m[1m[2m
|
|
112
|
-
[2mdist/[22m[36mseries-
|
|
113
|
-
[32m✓ built in 4.
|
|
108
|
+
[2mdist/[22m[36mscale-BvbW9p2C.cjs [39m[1m[2m 4.22 kB[22m[1m[22m[2m │ gzip: 1.56 kB[22m
|
|
109
|
+
[2mdist/[22m[36mbox-CZVdKCOc.cjs [39m[1m[2m 4.75 kB[22m[1m[22m[2m │ gzip: 1.96 kB[22m
|
|
110
|
+
[2mdist/[22m[36mbounds-Cudf5M4H.cjs [39m[1m[2m 4.84 kB[22m[1m[22m[2m │ gzip: 1.79 kB[22m
|
|
111
|
+
[2mdist/[22m[36mindex.cjs [39m[1m[2m 6.79 kB[22m[1m[22m[2m │ gzip: 2.67 kB[22m
|
|
112
|
+
[2mdist/[22m[36mseries-BId9slhU.cjs [39m[1m[2m34.67 kB[22m[1m[22m[2m │ gzip: 9.30 kB[22m
|
|
113
|
+
[32m✓ built in 4.37s[39m
|
package/dist/binary.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DQZfhLnw.cjs");exports.binary=e.encoder;
|
package/dist/binary.js
CHANGED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { j as B } from "./base-DnZzEvvz.js";
|
|
2
|
+
const c = (e) => typeof e == "bigint" || e instanceof BigInt, m = (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()), x = (e, r, n = 1e-4) => Math.abs(e - r) < n, O = (e, r) => c(e) ? e === BigInt(r.valueOf().valueOf()) : e === Number(r.valueOf()), _ = (e) => {
|
|
3
|
+
const r = Math.pow(10, Math.floor(Math.log10(e)));
|
|
4
|
+
return Math.round(e / r) * 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()), N = (e, r) => c(e) ? e.valueOf() > BigInt(r.valueOf()) ? e : BigInt(r.valueOf()) : e.valueOf() > Number(r.valueOf()) ? e : Number(r.valueOf()), y = (e) => c(e) || e instanceof BigInt ? e.valueOf() < 0n ? -e : e : e.valueOf() < 0 ? -e : e, M = (e, r) => c(e) ? e.valueOf() * BigInt(r.valueOf()) : e.valueOf() * Number(r.valueOf()), j = (e, r) => c(e) ? e.valueOf() / BigInt(r.valueOf()) : e.valueOf() / Number(r.valueOf()), W = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6
|
+
__proto__: null,
|
|
7
|
+
abs: y,
|
|
8
|
+
add: b,
|
|
9
|
+
closeTo: x,
|
|
10
|
+
div: j,
|
|
11
|
+
equal: O,
|
|
12
|
+
max: N,
|
|
13
|
+
min: h,
|
|
14
|
+
mult: M,
|
|
15
|
+
roundToNearestMagnitude: _,
|
|
16
|
+
sub: m
|
|
17
|
+
}, Symbol.toStringTag, { value: "Module" })), i = (e, r) => {
|
|
18
|
+
const n = {};
|
|
19
|
+
if (typeof e == "number" || typeof e == "bigint")
|
|
20
|
+
r != null ? (n.lower = e, n.upper = r) : (n.lower = typeof e == "bigint" ? 0n : 0, n.upper = e);
|
|
21
|
+
else if (Array.isArray(e)) {
|
|
22
|
+
if (e.length !== 2) throw new Error("bounds: expected array of length 2");
|
|
23
|
+
[n.lower, n.upper] = e;
|
|
24
|
+
} else return g(e);
|
|
25
|
+
return g(n);
|
|
26
|
+
}, A = Object.freeze({ lower: 0, upper: 0 }), P = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), z = Object.freeze({ lower: 0, upper: 1 }), E = Object.freeze({ lower: -1, upper: 1 }), S = (e, r) => {
|
|
27
|
+
if (e == null && r == null) return !0;
|
|
28
|
+
if (e == null || r == null) return !1;
|
|
29
|
+
const n = i(e), t = i(r);
|
|
30
|
+
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
|
+
}, g = (e) => e.lower > e.upper ? { lower: e.upper, upper: e.lower } : e, T = (e, r) => {
|
|
32
|
+
const n = i(e);
|
|
33
|
+
return r < n.lower ? n.lower : r >= n.upper ? n.upper - (typeof n.upper == "number" ? 1 : 1n) : r;
|
|
34
|
+
}, a = (e, r) => {
|
|
35
|
+
const n = i(e);
|
|
36
|
+
if (typeof r == "number" || typeof r == "bigint")
|
|
37
|
+
return r >= n.lower && r < n.upper;
|
|
38
|
+
const t = i(r);
|
|
39
|
+
return t.lower >= n.lower && t.upper <= n.upper;
|
|
40
|
+
}, D = (e, r) => {
|
|
41
|
+
const n = i(e), t = i(r);
|
|
42
|
+
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
|
+
}, w = (e) => {
|
|
44
|
+
const r = i(e);
|
|
45
|
+
return r.upper - r.lower;
|
|
46
|
+
}, F = (e) => {
|
|
47
|
+
const r = i(e);
|
|
48
|
+
return typeof r.lower == "bigint" ? r.lower === 0n && r.upper === 0n : r.lower === 0 && r.upper === 0;
|
|
49
|
+
}, L = (e) => {
|
|
50
|
+
const r = w(e);
|
|
51
|
+
return typeof r == "number" ? r === 0 : r === 0n;
|
|
52
|
+
}, Z = (e) => {
|
|
53
|
+
const r = i(e);
|
|
54
|
+
return typeof r.lower == "bigint" ? !0 : Number.isFinite(r.lower) && Number.isFinite(r.upper);
|
|
55
|
+
}, $ = (e) => ({
|
|
56
|
+
lower: Math.min(...e.map((r) => i(r).lower)),
|
|
57
|
+
upper: Math.max(...e.map((r) => i(r).upper))
|
|
58
|
+
}), q = (e) => ({
|
|
59
|
+
lower: Math.max(...e.map((r) => i(r).lower)),
|
|
60
|
+
upper: Math.min(...e.map((r) => i(r).upper))
|
|
61
|
+
}), C = (e) => {
|
|
62
|
+
const r = i(e), n = typeof r.lower == "bigint";
|
|
63
|
+
return Array.from({ length: Number(w(e)) }, (t, o) => n ? r.lower + BigInt(o) : r.lower + o);
|
|
64
|
+
}, I = (e, r) => {
|
|
65
|
+
const n = e.map((l) => i(l)), t = n.findIndex((l) => a(l, r) || r < l.lower);
|
|
66
|
+
if (t === -1) return { index: e.length, position: 0 };
|
|
67
|
+
const o = n[t];
|
|
68
|
+
return a(o, r) ? { index: t, position: Number(r - o.lower) } : { index: t, position: 0 };
|
|
69
|
+
}, d = {
|
|
70
|
+
removeBefore: 0,
|
|
71
|
+
removeAfter: 0,
|
|
72
|
+
insertInto: 0,
|
|
73
|
+
deleteInBetween: 0
|
|
74
|
+
}, R = (e, r) => {
|
|
75
|
+
const n = e.map((p) => i(p)), t = i(r);
|
|
76
|
+
if (n.length === 0) return d;
|
|
77
|
+
const o = I(n, t.lower), l = I(n, t.upper);
|
|
78
|
+
if (o.index === e.length) return { ...d, insertInto: e.length };
|
|
79
|
+
if (l.index === 0) return { ...d, removeAfter: l.position };
|
|
80
|
+
if (o.index === l.index)
|
|
81
|
+
return o.position !== 0 && l.position !== 0 ? null : {
|
|
82
|
+
removeAfter: l.position,
|
|
83
|
+
removeBefore: o.position,
|
|
84
|
+
insertInto: o.index,
|
|
85
|
+
deleteInBetween: 0
|
|
86
|
+
};
|
|
87
|
+
let u = l.index - o.index, f = o.index, s = m(Number(w(n[o.index])), o.position);
|
|
88
|
+
return o.position !== 0 ? (u -= 1, f += 1) : s = 0, {
|
|
89
|
+
removeBefore: s,
|
|
90
|
+
removeAfter: l.position,
|
|
91
|
+
insertInto: f,
|
|
92
|
+
deleteInBetween: u
|
|
93
|
+
};
|
|
94
|
+
}, k = (e, r, n) => {
|
|
95
|
+
const t = e.map((f) => i(f)), o = n > 0 ? 1 : n < 0 ? -1 : 0;
|
|
96
|
+
if (o === 0) return r;
|
|
97
|
+
let l = n, u = r;
|
|
98
|
+
for (; O(l, 0) === !1; ) {
|
|
99
|
+
const f = t.findIndex((s) => o > 0 ? u >= s.lower && u < s.upper : u > s.lower && u <= s.upper);
|
|
100
|
+
if (f !== -1) {
|
|
101
|
+
const s = t[f];
|
|
102
|
+
let p;
|
|
103
|
+
if (o > 0 ? p = m(s.upper, u) : p = m(u, s.lower), p > 0) {
|
|
104
|
+
const v = h(y(l), p);
|
|
105
|
+
if (u = b(
|
|
106
|
+
u,
|
|
107
|
+
o > 0 ? v : -v
|
|
108
|
+
), l = m(l, o > 0 ? v : -v), O(l, 0)) return u;
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (o > 0) {
|
|
113
|
+
const s = t.filter((p) => p.lower > u);
|
|
114
|
+
if (s.length > 0) u = s[0].lower;
|
|
115
|
+
else return u;
|
|
116
|
+
} else {
|
|
117
|
+
const s = t.filter((p) => p.upper < u);
|
|
118
|
+
if (s.length > 0)
|
|
119
|
+
u = s[s.length - 1].upper;
|
|
120
|
+
else return u;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return u;
|
|
124
|
+
}, U = (e, r, n) => {
|
|
125
|
+
const t = e.map((u) => i(u));
|
|
126
|
+
if (r === n) return typeof r == "bigint" ? 0n : 0;
|
|
127
|
+
const o = r < n ? i([r, n]) : i([n, r]);
|
|
128
|
+
let l = typeof r == "bigint" ? 0n : 0;
|
|
129
|
+
for (const u of t) {
|
|
130
|
+
const f = u.lower > o.lower ? u.lower : o.lower, s = u.upper < o.upper ? u.upper : o.upper;
|
|
131
|
+
if (f < s) {
|
|
132
|
+
const p = s - f;
|
|
133
|
+
l = l + p;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return l;
|
|
137
|
+
}, G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
138
|
+
__proto__: null,
|
|
139
|
+
CLIP: E,
|
|
140
|
+
DECIMAL: z,
|
|
141
|
+
INFINITE: P,
|
|
142
|
+
ZERO: A,
|
|
143
|
+
bounds: B,
|
|
144
|
+
buildInsertionPlan: R,
|
|
145
|
+
clamp: T,
|
|
146
|
+
construct: i,
|
|
147
|
+
contains: a,
|
|
148
|
+
distance: U,
|
|
149
|
+
equals: S,
|
|
150
|
+
findInsertPosition: I,
|
|
151
|
+
isFinite: Z,
|
|
152
|
+
isZero: F,
|
|
153
|
+
linspace: C,
|
|
154
|
+
makeValid: g,
|
|
155
|
+
max: $,
|
|
156
|
+
min: q,
|
|
157
|
+
overlapsWith: D,
|
|
158
|
+
span: w,
|
|
159
|
+
spanIsZero: L,
|
|
160
|
+
traverse: k
|
|
161
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
162
|
+
export {
|
|
163
|
+
T as a,
|
|
164
|
+
G as b,
|
|
165
|
+
i as c,
|
|
166
|
+
a as d,
|
|
167
|
+
U as e,
|
|
168
|
+
W as f,
|
|
169
|
+
M as m,
|
|
170
|
+
k as t
|
|
171
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const M=require("./base-B48bPNx5.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()),A=(e,r,n=1e-4)=>Math.abs(e-r)<n,O=(e,r)=>a(e)?e===BigInt(r.valueOf().valueOf()):e===Number(r.valueOf()),j=e=>{const r=Math.pow(10,Math.floor(Math.log10(e)));return Math.round(e/r)*r},h=(e,r)=>a(e)?e.valueOf()<BigInt(r.valueOf())?e:BigInt(r.valueOf()):e.valueOf()<Number(r.valueOf())?e:Number(r.valueOf()),P=(e,r)=>a(e)?e.valueOf()>BigInt(r.valueOf())?e:BigInt(r.valueOf()):e.valueOf()>Number(r.valueOf())?e:Number(r.valueOf()),y=e=>a(e)||e instanceof BigInt?e.valueOf()<0n?-e:e:e.valueOf()<0?-e:e,B=(e,r)=>a(e)?e.valueOf()*BigInt(r.valueOf()):e.valueOf()*Number(r.valueOf()),z=(e,r)=>a(e)?e.valueOf()/BigInt(r.valueOf()):e.valueOf()/Number(r.valueOf()),E=Object.freeze(Object.defineProperty({__proto__:null,abs:y,add:b,closeTo:A,div:z,equal:O,max:P,min:h,mult:B,roundToNearestMagnitude:j,sub:m},Symbol.toStringTag,{value:"Module"})),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 g(e);return g(n)},S=Object.freeze({lower:0,upper:0}),T=Object.freeze({lower:-1/0,upper:1/0}),D=Object.freeze({lower:0,upper:1}),F=Object.freeze({lower:-1,upper:1}),L=(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)},g=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},Z=(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)},w=e=>{const r=i(e);return r.upper-r.lower},q=e=>{const r=i(e);return typeof r.lower=="bigint"?r.lower===0n&&r.upper===0n:r.lower===0&&r.upper===0},C=e=>{const r=w(e);return typeof r=="number"?r===0:r===0n},R=e=>{const r=i(e);return typeof r.lower=="bigint"?!0:Number.isFinite(r.lower)&&Number.isFinite(r.upper)},$=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(w(e))},(t,o)=>n?r.lower+BigInt(o):r.lower+o)},I=(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}},d={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 d;const o=I(n,t.lower),l=I(n,t.upper);if(o.index===e.length)return{...d,insertInto:e.length};if(l.index===0)return{...d,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(w(n[o.index])),o.position);return o.position!==0?(u-=1,f+=1):s=0,{removeBefore:s,removeAfter:l.position,insertInto:f,deleteInBetween:u}},_=(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 v=h(y(l),p);if(u=b(u,o>0?v:-v),l=m(l,o>0?v:-v),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:F,DECIMAL:D,INFINITE:T,ZERO:S,bounds:M.bounds,buildInsertionPlan:V,clamp:x,construct:i,contains:c,distance:N,equals:L,findInsertPosition:I,isFinite:R,isZero:q,linspace:U,makeValid:g,max:$,min:k,overlapsWith:Z,span:w,spanIsZero:C,traverse:_},Symbol.toStringTag,{value:"Module"}));exports.bounds=W;exports.clamp=x;exports.construct=i;exports.contains=c;exports.distance=N;exports.math=E;exports.mult=B;exports.traverse=_;
|
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-Cudf5M4H.cjs");exports.bounds=e.bounds;
|
package/dist/bounds.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const y=require("zod"),z=require("./direction-DZbN47uL.cjs"),u=require("./location-YGxhLPDy.cjs"),i=require("./xy-cP-FXJtR.cjs"),p=require("./base-B48bPNx5.cjs"),O=y.z.union([y.z.number(),y.z.string()]),H=y.z.object({top:O,left:O,width:O,height:O}),S=y.z.object({left:y.z.number(),top:y.z.number(),right:y.z.number(),bottom:y.z.number()}),N=y.z.object({one:p.xy,two:p.xy,root:u.corner}),I={one:i.ZERO,two:i.ZERO,root:u.TOP_LEFT},v={one:i.ZERO,two:i.ONE,root:u.BOTTOM_LEFT},R=(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??u.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))},D=(t,o,e)=>{const n=c(t);if(typeof o=="string"){if(e==null)throw new Error("Invalid arguments for resize");const s=z.construct(o);return c(n.one,void 0,s==="x"?e:l(n),s==="y"?e:w(n),n.root)}return c(n.one,o,void 0,void 0,n.root)},G=(t,o,e=!0)=>{const n=c(t);let s=(r,x)=>r<x;return e&&(s=(r,x)=>r<=x),"one"in o?s(d(n),d(o))&&s(f(o),f(n))&&s(a(n),a(o))&&s(h(o),h(n)):s(d(n),o.x)&&s(o.x,f(n))&&s(a(n),o.y)&&s(o.y,h(n))},X=(t,o)=>i.equals(t.one,o.one)&&i.equals(t.two,o.two)&&u.xyEquals(t.root,o.root),q=t=>({width:l(t),height:w(t)}),$=t=>({signedWidth:b(t),signedHeight:T(t)}),U=t=>({top:a(t),left:d(t),width:l(t),height:w(t)}),M=(t,o,e=!1)=>{const n=z.construct(o)==="y"?T(t):b(t);return e?n:Math.abs(n)},_=(t,o)=>{const e=c(t);return{x:o.x==="center"?E(e).x:g(e,o.x),y:o.y==="center"?E(e).y:g(e,o.y)}},g=(t,o)=>{const e=c(t),n=u.xyCouple(e.root).includes(o)?Math.min:Math.max;return p.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,l=t=>M(t,"x"),w=t=>M(t,"y"),b=t=>{const o=c(t);return o.two.x-o.one.x},T=t=>{const o=c(t);return o.two.y-o.one.y},C=t=>_(t,u.TOP_LEFT),k=t=>_(t,u.TOP_RIGHT),J=t=>_(t,u.BOTTOM_LEFT),K=t=>_(t,u.BOTTOM_RIGHT),f=t=>g(t,"right"),h=t=>g(t,"bottom"),d=t=>g(t,"left"),a=t=>g(t,"top"),E=t=>i.translate(C(t),{x:b(t)/2,y:T(t)/2}),B=t=>{const o=c(t);return o.root.x==="left"?d(o):f(o)},L=t=>{const o=c(t);return o.root.y==="top"?a(o):h(o)},Q=t=>({x:B(t),y:L(t)}),P=t=>{const o=c(t);return{lower:o.one.x,upper:o.two.x}},Z=t=>{const o=c(t);return{lower:o.one.y,upper:o.two.y}},V=(t,o)=>R(t,o),tt=(t,o)=>{const e=c(t),n=p.X_LOCATIONS.includes(o)?"x":p.Y_LOCATIONS.includes(o)?"y":null;if(n===null)throw new Error(`Invalid location: ${u.location}`);const s=o==="top"||o==="left"?Math.min:Math.max,r={...e.one},x={...e.two};return r[n]=s(e.one[n],e.two[n]),x[n]=s(e.one[n],e.two[n]),[r,x]},ot=(t,o)=>{const e=c(t),n=c(o),s=B(n)+(l(n)-l(e))/2,r=L(n)+(w(n)-w(e))/2;return c({x:s,y:r},q(e))},j=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,nt=t=>l(t)/w(t),et=(t,o,e)=>{if(typeof o=="string"){if(e==null)throw new Error("Undefined amount passed into box.translate");const s=z.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)},A=(t,o)=>{const e=Math.max(d(t),d(o)),n=Math.max(a(t),a(o)),s=Math.min(f(t),f(o)),r=Math.min(h(t),h(o));return e>s||n>r?I:c({x:e,y:n},{x:s,y:r},void 0,void 0,t.root)},W=t=>l(t)*w(t),rt=(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 x={x:t,y:o},m={x:t+e,y:o+n};return s.x!==r.x&&(s.x==="center"?(x.x-=e/2,m.x-=e/2):(x.x-=e,m.x-=e)),s.y!==r.y&&(s.y==="center"?(x.y-=n/2,m.y-=n/2):(x.y-=n,m.y-=n)),c(x,m,void 0,void 0,r)},st=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:v,ZERO:I,area:W,areaIsZero:Y,aspect:nt,bottom:h,bottomLeft:J,bottomRight:K,box:N,center:E,construct:c,constructWithAlternateRoot:F,contains:G,copy:R,css:U,cssBox:H,dim:M,dims:q,domRect:S,edgePoints:tt,equals:X,height:w,intersection:A,isBox:j,left:d,loc:g,positionInCenter:ot,reRoot:V,resize:D,right:f,root:Q,signedDims:$,signedHeight:T,signedWidth:b,top:a,topLeft:C,topRight:k,translate:et,truncate:rt,width:l,x:B,xBounds:P,xyLoc:_,y:L,yBounds:Z},Symbol.toStringTag,{value:"Module"}));exports.area=W;exports.box=st;exports.construct=c;exports.constructWithAlternateRoot=F;exports.height=w;exports.intersection=A;exports.isBox=j;exports.width=l;exports.xBounds=P;exports.xyLoc=_;exports.yBounds=Z;
|
|
@@ -0,0 +1,201 @@
|
|
|
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-B5rSnQP3.js";
|
|
4
|
+
import { Z as p, O as F, e as $, t as O, c as G, a as C } from "./xy-CrgPnICw.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
|
+
};
|
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-CZVdKCOc.cjs");exports.box=e.box;
|
package/dist/box.js
CHANGED
package/dist/caseconv.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-By0n2R_b.cjs");exports.caseconv=e.caseconv;
|
package/dist/caseconv.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const v=e=>{const r=e.replace(/_[a-z]/g,n=>n[1].toUpperCase());return r.length>1&&r[0]===r[0].toUpperCase()&&r[1]===r[1].toUpperCase()||r.length===0?r:r[0].toLowerCase()+r.slice(1)},m=e=>{const r=(n,s=u)=>{if(typeof n=="string")return e(n);if(Array.isArray(n))return n.map(c=>r(c,s));if(!l(n))return n;s=O(s);const f={},p=n;return Object.keys(p).forEach(c=>{let t=p[c];const g=e(c);s.recursive&&(l(t)?y(t,s.keepTypesOnRecursion)||(t=r(t,s)):s.recursiveInArray&&o(t)&&(t=[...t].map(a=>{let i=a;return l(a)?y(i,s.keepTypesOnRecursion)||(i=r(a,s)):o(a)&&(i=r({key:a},s).key),i}))),f[g]=t}),f};return r},A=m(v),C=e=>e.replace(/([a-z0-9])([A-Z])/g,(r,n,s)=>`${n}_${s.toLowerCase()}`),k=m(C),T=e=>e.length===0?e:e[0].toUpperCase()+e.slice(1),u={recursive:!0,recursiveInArray:!0,keepTypesOnRecursion:[Number,String,Uint8Array]},O=(e=u)=>(e.recursive==null?e=u:e.recursiveInArray==null&&(e.recursiveInArray=!1),e),o=e=>e!=null&&Array.isArray(e),l=e=>e!=null&&typeof e=="object"&&!Array.isArray(e),y=(e,r)=>(r||[]).some(n=>e instanceof n),S=Object.freeze(Object.defineProperty({__proto__:null,belongToTypes:y,camelToSnake:k,capitalize:T,defaultOptions:u,isArrayObject:o,isValidObject:l,snakeToCamel:A,validateOptions:O},Symbol.toStringTag,{value:"Module"}));exports.camelToSnake=k;exports.capitalize=T;exports.caseconv=S;exports.snakeToCamel=A;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var y=Object.defineProperty;var O=(o,e,t)=>e in o?y(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var i=(o,e,t)=>O(o,typeof e!="symbol"?e+"":e,t);const f=require("./index-
|
|
1
|
+
"use strict";var y=Object.defineProperty;var O=(o,e,t)=>e in o?y(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var i=(o,e,t)=>O(o,typeof e!="symbol"?e+"":e,t);const f=require("./index-By0n2R_b.cjs"),p=require("./identity.cjs");class S{constructor(){i(this,"contentType","application/json");i(this,"decoder");i(this,"encoder");this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(e){return this.encoder.encode(this.encodeString(e)).buffer}decode(e,t){return this.decodeString(this.decoder.decode(e),t)}decodeString(e,t){const r=JSON.parse(e),n=f.snakeToCamel(r);return t!=null?t.parse(n):n}encodeString(e){const t=f.camelToSnake(e);return JSON.stringify(t,(r,n)=>ArrayBuffer.isView(n)?Array.from(n):p.isObject(n)&&"encode_value"in n?typeof n.value=="bigint"?n.value.toString():n.value:typeof n=="bigint"?n.toString():n)}static registerCustomType(){}}class g{constructor(){i(this,"contentType","text/csv")}encode(e){const t=this.encodeString(e);return new TextEncoder().encode(t).buffer}decode(e,t){const r=new TextDecoder().decode(e);return this.decodeString(r,t)}encodeString(e){if(!Array.isArray(e)||e.length===0||!p.isObject(e[0]))throw new Error("Payload must be an array of objects");const t=Object.keys(e[0]),r=[t.join(",")];return e.forEach(n=>{const d=t.map(s=>JSON.stringify(n[s]??""));r.push(d.join(","))}),r.join(`
|
|
2
2
|
`)}decodeString(e,t){const[r,...n]=e.trim().split(`
|
|
3
3
|
`).map(c=>c.trim());if(r.length===0)return t!=null?t.parse({}):{};const d=r.split(",").map(c=>c.trim()),s={};return d.forEach(c=>{s[c]=[]}),n.forEach(c=>{const C=c.split(",").map(u=>u.trim());d.forEach((u,T)=>{const l=this.parseValue(C[T]);l!=null&&s[u].push(l)})}),t!=null?t.parse(s):s}parseValue(e){if(e==null||e.length===0)return null;const t=Number(e);return isNaN(t)?e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e:t}static registerCustomType(){}}class h{constructor(){i(this,"contentType","text/plain")}encode(e){return new TextEncoder().encode(e).buffer}decode(e,t){const r=new TextDecoder().decode(e);return t!=null?t.parse(r):r}}const a=new S,E=new g,b=new h,w=[a],m=Object.freeze(Object.defineProperty({__proto__:null,CSVCodec:g,CSV_CODEC:E,ENCODERS:w,JSONCodec:S,JSON_CODEC:a,TEXT_CODEC:b,TextCodec:h},Symbol.toStringTag,{value:"Module"}));exports.JSON_CODEC=a;exports.encoder=m;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
1
|
+
const g = (e) => {
|
|
2
2
|
const r = e.replace(/_[a-z]/g, (n) => n[1].toUpperCase());
|
|
3
|
-
return r.length > 1 && r[0] === r[0].toUpperCase() && r[1] === r[1].toUpperCase() ? r : r[0].toLowerCase() + r.slice(1);
|
|
3
|
+
return r.length > 1 && r[0] === r[0].toUpperCase() && r[1] === r[1].toUpperCase() || r.length === 0 ? r : r[0].toLowerCase() + r.slice(1);
|
|
4
4
|
}, A = (e) => {
|
|
5
5
|
const r = (n, s = u) => {
|
|
6
6
|
if (typeof n == "string") return e(n);
|
|
@@ -18,7 +18,7 @@ const k = (e) => {
|
|
|
18
18
|
}), f;
|
|
19
19
|
};
|
|
20
20
|
return r;
|
|
21
|
-
},
|
|
21
|
+
}, k = A(g), T = (e) => e.replace(/([a-z0-9])([A-Z])/g, (r, n, s) => `${n}_${s.toLowerCase()}`), v = A(T), C = (e) => e.length === 0 ? e : e[0].toUpperCase() + e.slice(1), u = {
|
|
22
22
|
recursive: !0,
|
|
23
23
|
recursiveInArray: !0,
|
|
24
24
|
keepTypesOnRecursion: [Number, String, Uint8Array]
|
|
@@ -30,12 +30,12 @@ const k = (e) => {
|
|
|
30
30
|
defaultOptions: u,
|
|
31
31
|
isArrayObject: o,
|
|
32
32
|
isValidObject: l,
|
|
33
|
-
snakeToCamel:
|
|
33
|
+
snakeToCamel: k,
|
|
34
34
|
validateOptions: m
|
|
35
35
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
36
36
|
export {
|
|
37
37
|
_ as a,
|
|
38
38
|
v as b,
|
|
39
39
|
C as c,
|
|
40
|
-
|
|
40
|
+
k as s
|
|
41
41
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var m = Object.defineProperty;
|
|
2
2
|
var C = (o, e, t) => e in o ? m(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
3
|
var i = (o, e, t) => C(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { s as y, b } from "./index-
|
|
4
|
+
import { s as y, b } from "./index-q_1Jz5rY.js";
|
|
5
5
|
import { isObject as l } from "./identity.js";
|
|
6
6
|
class f {
|
|
7
7
|
constructor() {
|
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var x=Object.defineProperty;var _=(e,t,r)=>t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var p=(e,t,r)=>_(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./index-DQZfhLnw.cjs"),O=require("./index-By0n2R_b.cjs"),L=require("./change-C-YELKx6.cjs"),$=require("./scale-BvbW9p2C.cjs"),u=require("./index-h-QAL9T1.cjs"),l=require("zod"),A=require("./debounce.cjs"),P=require("./deep.cjs"),s=require("./series-BId9slhU.cjs"),Z=require("./identity.cjs"),C=require("./types-zRwnQ1hc.cjs"),M=require("./bounds-Cudf5M4H.cjs"),D=require("./observe.cjs"),j=require("./record.cjs"),G=require("./external-B-DoBvh7.cjs"),W=require("./search.cjs"),H=require("./box-CZVdKCOc.cjs"),V=require("./dimensions-zMcb9pMk.cjs"),I=require("./direction-DZbN47uL.cjs"),Q=require("./location-YGxhLPDy.cjs"),U=require("./position-CjNCcq8X.cjs"),B=require("./spatial-BOhaO8xN.cjs"),J=require("./xy-cP-FXJtR.cjs"),k=require("./toArray.cjs"),K=require("./unique.cjs"),w=require("./url.cjs"),E=require("./worker.cjs"),F=require("./zodutil-BWvwKcpb.cjs"),d=class d extends Number{};p(d,"Absolute",255),p(d,"Default",1),p(d,"z",l.z.union([l.z.instanceof(d),l.z.number().int().min(0).max(255).transform(t=>new d(t)),l.z.instanceof(Number).transform(t=>new d(t))]));let h=d;const z=l.z.object({name:l.z.string(),key:l.z.string()}),X=e=>l.z.object({subject:z,resource:e,authority:h.z}),Y=(...e)=>t=>t.filter(r=>{let o=!1;return r.to!=null&&(o=e.includes(r.to.resource)),r.from!=null&&!o&&(o=e.includes(r.from.resource)),o}),ee=Object.freeze(Object.defineProperty({__proto__:null,Authority:h,filterTransfersByChannelKey:Y,stateZ:X,subjectZ:z},Symbol.toStringTag,{value:"Module"})),m=class m extends Error{constructor(){super(m.MESSAGE)}matches(t){return typeof t=="string"?t.includes(m.MESSAGE):t instanceof m||t.message.includes(m.MESSAGE)}};p(m,"MESSAGE","canceled");let T=m;const re=new T,te=Object.freeze(Object.defineProperty({__proto__:null,CANCELED:re},Symbol.toStringTag,{value:"Module"})),ne=e=>e?-1:1,q=l.z.string().regex(/^\d+\.\d+\.\d+$/),y=(e,t,r={})=>{r.checkMajor??(r.checkMajor=!0),r.checkMinor??(r.checkMinor=!0),r.checkPatch??(r.checkPatch=!0);const o=q.parse(e),c=q.parse(t),[f,g,b]=o.split(".").map(Number),[i,n,a]=c.split(".").map(Number);if(r.checkMajor){if(f<i)return u.LESS_THAN;if(f>i)return u.GREATER_THAN}if(r.checkMinor){if(g<n)return u.LESS_THAN;if(g>n)return u.GREATER_THAN}if(r.checkPatch){if(b<a)return u.LESS_THAN;if(b>a)return u.GREATER_THAN}return u.EQUAL},oe=(e,t,r={})=>u.isEqualTo(y(e,t,r)),R=(e,t,r={})=>u.isGreaterThan(y(e,t,r)),ie=(e,t,r={})=>u.isLessThan(y(e,t,r)),se=({name:e,migrate:t})=>r=>{try{const o=t(r);return console.log(`${e} migrated: ${r.version} -> ${o.version}`),o}catch(o){throw console.log(`${e} failed to migrate from ${r.version}`),console.error(o),o}},ce=({name:e,migrations:t,targetSchema:r,defaultVersion:o,def:c})=>{const f=Object.keys(t).sort(y).pop();if(f==null)return n=>{if(n.version==null&&(n.version=o),n.version!==c.version)return console.log(`${e} version ${n.version} is newer than latest version of ${c.version}.
|
|
2
2
|
Returning default instead.
|
|
3
|
-
`),
|
|
3
|
+
`),c;try{return r!=null?r.parse(n):n}catch(a){return console.log(`${e} failed to parse default. Exiting with default`),console.error(a),c}};const g=Object.keys(t).length;let b=!1;const i=n=>{try{if(g===0||R(n.version,f))return console.log(b?`${e} ${n.version} now up to date`:`${e} version ${n.version} is up to date with target version ${c.version}`),n;const a=n.version,S=t[a],v=S(n);return b=!0,i(v)}catch(a){return console.log(`${e} failed to migrate from ${n.version} to ${f}`),console.error(a),c}};return n=>{try{if(n.version==null)if(o!=null)console.log(`${e} version is null. Setting version to default of ${o}`),n.version=o;else return console.log(`${e} version is null and no default version set. Exiting with default`),c;return i(n)}catch(a){return console.log(`${e} failed to parse final result. Exiting with default`),console.error(a),c}}},ae=Object.freeze(Object.defineProperty({__proto__:null,compareSemVer:y,createMigration:se,migrator:ce,semVerNewer:R,semVerOlder:ie,semVerZ:q,versionsEqual:oe},Symbol.toStringTag,{value:"Module"})),ue=e=>{if(e===void 0||typeof e=="string"||typeof e=="number")return e;if(e.toString===void 0)throw new Error("invalid renderer");return e.toString()},le=e=>Array.isArray(e)?[...e]:typeof e=="object"&&e!==null?{...e}:e,de=(e,t="")=>{const r=e.length;return r===0?t:r===1?e[0]:r===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[r-1]}`},fe=e=>{const t=e.split(" "),r=new Set,o=t.map(i=>i.charAt(0).toLowerCase()).join("");r.add(o),r.add(o.replace(/(.)(.)/g,"$1_$2"));const c=/\d+/g;e.match(c)&&t.forEach((i,n)=>{if(c.test(i)){const a=t.map((S,v)=>v!==n?S.charAt(0).toLowerCase():S).join("");r.add(a),r.add(a.replace(/(.)(.)/g,"$1_$2"))}});const g=t.map(i=>(i.length>3?i.substring(0,3):i).toLowerCase());return r.add(g.join("")),r.add(g.join("_")),Array.from(r).filter(i=>i.length>=2&&i.length<=12)},ge=Object.freeze(Object.defineProperty({__proto__:null,generateShortIdentifiers:fe,naturalLanguageJoin:de},Symbol.toStringTag,{value:"Module"}));exports.binary=N.encoder;exports.caseconv=O.caseconv;exports.change=L.change;exports.clamp=$.clamp;exports.scale=$.scale;exports.compare=u.compare;exports.isStringer=u.isStringer;exports.primitiveIsZero=u.primitiveIsZero;exports.debounce=A.debounce;exports.throttle=A.throttle;exports.deep=P.deep;exports.DataType=s.DataType;exports.Density=s.Density;exports.MultiSeries=s.MultiSeries;exports.Rate=s.Rate;exports.Series=s.Series;exports.Size=s.Size;exports.TimeRange=s.TimeRange;exports.TimeSpan=s.TimeSpan;exports.TimeStamp=s.TimeStamp;exports.addSamples=s.addSamples;exports.convertDataType=s.convertDataType;exports.id=s.id;exports.isCrudeSeries=s.isCrudeSeries;exports.isTelemValue=s.isTelemValue;exports.typedArrayZ=s.typedArrayZ;exports.isObject=Z.isObject;exports.kv=C.types;exports.bounds=M.bounds;exports.math=M.math;exports.observe=D.observe;exports.getEntries=j.getEntries;exports.unknownRecordZ=j.unknownRecordZ;exports.runtime=G.external;exports.Search=W.Search;exports.box=H.box;exports.dimensions=V.dimensions;exports.direction=I.direction;exports.location=Q.location;exports.position=U.position;exports.spatial=B.spatial;exports.xy=J.xy;exports.nullToArr=k.nullToArr;exports.toArray=k.toArray;exports.unique=K.unique;exports.URL=w.URL;exports.buildQueryString=w.buildQueryString;exports.RoutedWorker=E.RoutedWorker;exports.TypedWorker=E.TypedWorker;exports.createMockWorkers=E.createMockWorkers;exports.zodutil=F.zodutil;exports.control=ee;exports.convertRenderV=ue;exports.errors=te;exports.invert=ne;exports.migrate=ae;exports.shallowCopy=le;exports.strings=ge;
|