@synnaxlabs/x 0.42.3 → 0.43.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 +93 -105
- package/.vscode/settings.json +4 -6
- package/README.md +1 -7
- package/dist/array.cjs +1 -0
- package/dist/array.js +7 -0
- package/dist/base-B5lQIJKc.js +38 -0
- package/dist/base-CTq-lhpU.cjs +1 -0
- package/dist/binary.cjs +1 -1
- package/dist/binary.js +1 -1
- package/dist/bounds.cjs +1 -1
- package/dist/bounds.js +2 -2
- package/dist/box.cjs +1 -1
- package/dist/box.js +1 -1
- package/dist/caseconv.cjs +1 -1
- package/dist/caseconv.js +2 -2
- package/dist/change.cjs +1 -1
- package/dist/change.js +10 -2
- package/dist/compare.cjs +1 -1
- package/dist/compare.js +1 -1
- package/dist/deep.cjs +1 -1
- package/dist/deep.js +92 -79
- package/dist/dimensions.cjs +1 -1
- package/dist/dimensions.js +41 -2
- package/dist/direction.cjs +1 -1
- package/dist/direction.js +1 -1
- package/dist/index-4GlOgZuh.js +99 -0
- package/dist/{direction-C-b6XTeU.cjs → index-B58dnYRu.cjs} +1 -1
- package/dist/index-BMGaoK93.cjs +1 -0
- package/dist/index-BTet04Hd.cjs +6 -0
- package/dist/{scale-DfJe9755.js → index-BUa-NXAX.js} +46 -46
- package/dist/{xy-D_LqxaGt.js → index-C-qYOegc.js} +62 -62
- package/dist/index-C07SBJhr.js +128 -0
- package/dist/{bounds-Bn5_l4Z3.js → index-C9EdKeu1.js} +77 -76
- package/dist/index-CM8ZDZ6s.cjs +1 -0
- package/dist/index-CV2JaHfw.cjs +1 -0
- package/dist/index-CeBvOwG8.cjs +3 -0
- package/dist/index-ClrGyGDp.js +205 -0
- package/dist/index-CqQXXeCI.cjs +1 -0
- package/dist/{location-C3aeu046.js → index-D6V-8SKw.js} +26 -26
- package/dist/index-DBGAIs_7.js +2492 -0
- package/dist/index-DEdq2tza.cjs +1 -0
- package/dist/index-DKMnHBGR.cjs +1 -0
- package/dist/index-Dql5FMcH.js +47 -0
- package/dist/{direction-BL0PhD1k.js → index-DxU1zwsd.js} +1 -1
- package/dist/index-WwMnwoLy.cjs +1 -0
- package/dist/index.cjs +5 -3
- package/dist/index.js +5372 -650
- package/dist/kv.cjs +1 -1
- package/dist/kv.js +45 -2
- package/dist/location.cjs +1 -1
- package/dist/location.js +1 -1
- package/dist/position.cjs +1 -1
- package/dist/position.js +83 -2
- package/dist/record.cjs +1 -1
- package/dist/record.js +8 -10
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +27 -2
- package/dist/scale.cjs +1 -1
- package/dist/scale.js +1 -1
- package/dist/schemas-55Usj0Fg.js +3998 -0
- package/dist/schemas-DbXuI2Qr.cjs +27 -0
- package/dist/spatial.cjs +1 -1
- package/dist/spatial.js +25 -18
- package/dist/src/array/index.d.ts +2 -0
- package/dist/src/array/index.d.ts.map +1 -0
- package/dist/src/array/toArray.d.ts +19 -0
- package/dist/src/array/toArray.d.ts.map +1 -0
- package/dist/src/array/toArray.spec.d.ts +2 -0
- package/dist/src/array/toArray.spec.d.ts.map +1 -0
- package/dist/src/binary/codec.d.ts +8 -16
- package/dist/src/binary/codec.d.ts.map +1 -1
- package/dist/src/breaker/breaker.d.ts +6 -6
- package/dist/src/breaker/breaker.d.ts.map +1 -1
- package/dist/src/caseconv/caseconv.d.ts +1 -1
- package/dist/src/caseconv/caseconv.d.ts.map +1 -1
- package/dist/src/change/change.d.ts +3 -3
- package/dist/src/change/change.d.ts.map +1 -1
- package/dist/src/color/color.d.ts +61 -37
- package/dist/src/color/color.d.ts.map +1 -1
- package/dist/src/color/external.d.ts +0 -1
- package/dist/src/color/external.d.ts.map +1 -1
- package/dist/src/color/gradient.d.ts +7 -7
- package/dist/src/color/gradient.d.ts.map +1 -1
- package/dist/src/color/palette.d.ts +10 -10
- package/dist/src/color/palette.d.ts.map +1 -1
- package/dist/src/compare/compare.d.ts +4 -4
- package/dist/src/compare/compare.d.ts.map +1 -1
- package/dist/src/control/control.d.ts +32 -32
- package/dist/src/control/control.d.ts.map +1 -1
- package/dist/src/debounce/debounce.d.ts +1 -1
- package/dist/src/debounce/debounce.d.ts.map +1 -1
- package/dist/src/deep/delete.d.ts +1 -1
- package/dist/src/deep/delete.d.ts.map +1 -1
- package/dist/src/deep/difference.d.ts.map +1 -1
- package/dist/src/deep/equal.d.ts +4 -4
- package/dist/src/deep/equal.d.ts.map +1 -1
- package/dist/src/deep/merge.d.ts +1 -1
- package/dist/src/deep/merge.d.ts.map +1 -1
- package/dist/src/errors/errors.d.ts +62 -36
- package/dist/src/errors/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/instance/index.d.ts +2 -0
- package/dist/src/instance/index.d.ts.map +1 -0
- package/dist/src/instance/matcher.d.ts +79 -0
- package/dist/src/instance/matcher.d.ts.map +1 -0
- package/dist/src/instance/matcher.spec.d.ts +2 -0
- package/dist/src/instance/matcher.spec.d.ts.map +1 -0
- package/dist/src/jsonrpc/jsonrpc.d.ts +40 -9
- package/dist/src/jsonrpc/jsonrpc.d.ts.map +1 -1
- package/dist/src/kv/types.d.ts +2 -2
- package/dist/src/kv/types.d.ts.map +1 -1
- package/dist/src/migrate/migrate.d.ts +5 -5
- package/dist/src/migrate/migrate.d.ts.map +1 -1
- package/dist/src/notation/notation.d.ts +1 -1
- package/dist/src/notation/notation.d.ts.map +1 -1
- package/dist/src/primitive/index.d.ts +2 -0
- package/dist/src/primitive/index.d.ts.map +1 -0
- package/dist/src/primitive/primitive.d.ts +39 -0
- package/dist/src/primitive/primitive.d.ts.map +1 -0
- package/dist/src/primitive/primitive.spec.d.ts +2 -0
- package/dist/src/primitive/primitive.spec.d.ts.map +1 -0
- package/dist/src/record.d.ts +2 -2
- package/dist/src/record.d.ts.map +1 -1
- package/dist/src/renderable.d.ts +1 -1
- package/dist/src/renderable.d.ts.map +1 -1
- package/dist/src/replace.d.ts.map +1 -1
- package/dist/src/runtime/detect.d.ts.map +1 -1
- package/dist/src/runtime/os.d.ts +1 -1
- package/dist/src/runtime/os.d.ts.map +1 -1
- package/dist/src/spatial/base.d.ts +10 -10
- package/dist/src/spatial/base.d.ts.map +1 -1
- package/dist/src/spatial/bounds/bounds.d.ts +82 -16
- package/dist/src/spatial/bounds/bounds.d.ts.map +1 -1
- package/dist/src/spatial/box/box.d.ts +7 -7
- package/dist/src/spatial/box/box.d.ts.map +1 -1
- package/dist/src/spatial/dimensions/dimensions.d.ts +5 -5
- package/dist/src/spatial/dimensions/dimensions.d.ts.map +1 -1
- package/dist/src/spatial/direction/direction.d.ts +1 -1
- package/dist/src/spatial/location/location.d.ts +4 -4
- package/dist/src/spatial/location/location.d.ts.map +1 -1
- package/dist/src/spatial/scale/scale.d.ts +11 -11
- package/dist/src/spatial/scale/scale.d.ts.map +1 -1
- package/dist/src/spatial/xy/xy.d.ts +5 -5
- package/dist/src/spatial/xy/xy.d.ts.map +1 -1
- package/dist/src/status/index.d.ts +2 -0
- package/dist/src/status/index.d.ts.map +1 -0
- package/dist/src/status/types.d.ts +11 -0
- package/dist/src/status/types.d.ts.map +1 -0
- package/dist/src/sync/index.d.ts.map +1 -1
- package/dist/src/sync/mutex.d.ts +0 -1
- package/dist/src/sync/mutex.d.ts.map +1 -1
- package/dist/src/telem/gl.d.ts +1 -1
- package/dist/src/telem/gl.d.ts.map +1 -1
- package/dist/src/telem/series.d.ts +468 -62
- package/dist/src/telem/series.d.ts.map +1 -1
- package/dist/src/telem/telem.d.ts +243 -53
- package/dist/src/telem/telem.d.ts.map +1 -1
- package/dist/src/uuid/index.d.ts +2 -0
- package/dist/src/uuid/index.d.ts.map +1 -0
- package/dist/src/uuid/uuid.d.ts +35 -0
- package/dist/src/uuid/uuid.d.ts.map +1 -0
- package/dist/src/uuid/uuid.spec.d.ts +2 -0
- package/dist/src/uuid/uuid.spec.d.ts.map +1 -0
- package/dist/src/zod/external.d.ts +1 -1
- package/dist/src/zod/external.d.ts.map +1 -1
- package/dist/src/zod/nullToUndefined.d.ts +3 -0
- package/dist/src/zod/nullToUndefined.d.ts.map +1 -0
- package/dist/src/zod/nullToUndefined.spec.d.ts +2 -0
- package/dist/src/zod/nullToUndefined.spec.d.ts.map +1 -0
- package/dist/src/zod/util.d.ts +2 -2
- package/dist/src/zod/util.d.ts.map +1 -1
- package/dist/telem.cjs +1 -1
- package/dist/telem.js +1 -1
- package/dist/xy.cjs +1 -1
- package/dist/xy.js +1 -1
- package/dist/zod.cjs +1 -1
- package/dist/zod.js +19 -2
- package/eslint.config.js +1 -1
- package/package.json +17 -15
- package/src/{toArray.ts → array/index.ts} +1 -5
- package/src/array/toArray.spec.ts +56 -0
- package/src/array/toArray.ts +28 -0
- package/src/binary/codec.spec.ts +201 -278
- package/src/binary/codec.ts +20 -76
- package/src/breaker/breaker.ts +3 -3
- package/src/caseconv/caseconv.ts +6 -4
- package/src/change/change.ts +2 -2
- package/src/color/color.spec.ts +113 -2
- package/src/color/color.ts +89 -59
- package/src/color/external.ts +0 -1
- package/src/color/gradient.ts +20 -28
- package/src/color/palette.ts +1 -1
- package/src/compare/compare.ts +5 -5
- package/src/control/control.ts +22 -19
- package/src/debounce/debounce.ts +1 -1
- package/src/deep/delete.ts +5 -4
- package/src/deep/difference.ts +6 -2
- package/src/deep/equal.spec.ts +1 -1
- package/src/deep/equal.ts +5 -5
- package/src/deep/merge.spec.ts +13 -1
- package/src/deep/merge.ts +16 -7
- package/src/deep/path.ts +1 -1
- package/src/errors/errors.ts +65 -44
- package/src/index.ts +4 -1
- package/src/instance/index.ts +10 -0
- package/src/instance/matcher.spec.ts +78 -0
- package/src/instance/matcher.ts +98 -0
- package/src/jsonrpc/jsonrpc.spec.ts +2 -1
- package/src/jsonrpc/jsonrpc.ts +36 -7
- package/src/kv/types.ts +1 -1
- package/src/migrate/migrate.spec.ts +1 -1
- package/src/migrate/migrate.ts +7 -7
- package/src/notation/notation.ts +1 -1
- package/src/primitive/index.ts +10 -0
- package/src/primitive/primitive.spec.ts +126 -0
- package/src/primitive/primitive.ts +82 -0
- package/src/record.ts +3 -5
- package/src/renderable.ts +1 -1
- package/src/replace.ts +9 -0
- package/src/runtime/detect.ts +0 -2
- package/src/runtime/os.ts +1 -1
- package/src/spatial/base.ts +1 -1
- package/src/spatial/bounds/bounds.spec.ts +20 -0
- package/src/spatial/bounds/bounds.ts +101 -18
- package/src/spatial/box/box.ts +1 -1
- package/src/spatial/dimensions/dimensions.ts +3 -3
- package/src/spatial/location/location.ts +1 -1
- package/src/spatial/scale/scale.ts +1 -1
- package/src/spatial/xy/xy.ts +1 -1
- package/src/status/index.ts +10 -0
- package/src/status/types.ts +22 -0
- package/src/sync/index.ts +9 -0
- package/src/sync/mutex.ts +9 -4
- package/src/telem/gl.ts +1 -1
- package/src/telem/series.spec.ts +735 -68
- package/src/telem/series.ts +536 -195
- package/src/telem/telem.spec.ts +60 -7
- package/src/telem/telem.ts +287 -95
- package/src/uuid/index.ts +10 -0
- package/src/uuid/uuid.spec.ts +82 -0
- package/src/uuid/uuid.ts +48 -0
- package/src/zod/external.ts +1 -1
- package/src/zod/nullToUndefined.spec.ts +31 -0
- package/src/zod/nullToUndefined.ts +23 -0
- package/src/zod/util.spec.ts +1 -1
- package/src/zod/util.ts +6 -6
- package/tsconfig.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/vite.config.ts +1 -1
- package/dist/base-BAM2mqCy.cjs +0 -1
- package/dist/base-DFq0vvGn.js +0 -38
- package/dist/bounds-BQo7rvs9.cjs +0 -1
- package/dist/box-0YrQibkB.cjs +0 -1
- package/dist/box-Cc8IzcNo.js +0 -205
- package/dist/change-C-YELKx6.cjs +0 -1
- package/dist/change-DLl6DccR.js +0 -12
- package/dist/dimensions-CRgergMS.js +0 -43
- package/dist/dimensions-D2QGoNXO.cjs +0 -1
- package/dist/external-BPgtxa8d.js +0 -29
- package/dist/external-C-dNgNQw.cjs +0 -1
- package/dist/external-C8TFju8Q.js +0 -29
- package/dist/external-DWQITF5_.cjs +0 -1
- package/dist/external-DqPrWKvU.js +0 -47
- package/dist/external-uXk0Avrg.cjs +0 -1
- package/dist/index-BywOGO8U.js +0 -1074
- package/dist/index-CYYjI7Uf.cjs +0 -1
- package/dist/index-C_6NXBlg.cjs +0 -3
- package/dist/index-Dd8DLyMx.cjs +0 -1
- package/dist/index-DizUWH6z.js +0 -47
- package/dist/index-QGplUHuy.js +0 -98
- package/dist/location-BGl5Ddds.cjs +0 -1
- package/dist/position-Cai5-wi1.cjs +0 -1
- package/dist/position-DIglP1l2.js +0 -85
- package/dist/scale-BtZINJ-A.cjs +0 -1
- package/dist/series-B9JERcqi.js +0 -1977
- package/dist/series-DqJ6f97G.cjs +0 -11
- package/dist/spatial-BSWPzMkK.js +0 -11
- package/dist/spatial-DGpZ2sO3.cjs +0 -1
- package/dist/src/color/transformColorsToHex.d.ts +0 -6
- package/dist/src/color/transformColorsToHex.d.ts.map +0 -1
- package/dist/src/primitive.d.ts +0 -9
- package/dist/src/primitive.d.ts.map +0 -1
- package/dist/src/toArray.d.ts +0 -3
- package/dist/src/toArray.d.ts.map +0 -1
- package/dist/src/zod/integer.d.ts +0 -10
- package/dist/src/zod/integer.d.ts.map +0 -1
- package/dist/src/zod/integer.spec.d.ts +0 -2
- package/dist/src/zod/integer.spec.d.ts.map +0 -1
- package/dist/toArray.cjs +0 -1
- package/dist/toArray.js +0 -5
- package/dist/xy-B7065J2S.cjs +0 -1
- package/src/color/transformColorsToHex.ts +0 -30
- package/src/primitive.ts +0 -46
- package/src/zod/integer.spec.ts +0 -148
- package/src/zod/integer.ts +0 -38
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import {
|
|
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()),
|
|
1
|
+
import { b } from "./base-B5lQIJKc.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()), q = (e, r, n = 1e-4) => Math.abs(e - r) < n, I = (e, r) => c(e) ? e === BigInt(r.valueOf().valueOf()) : e === Number(r.valueOf()), C = (e) => {
|
|
3
3
|
const r = 10 ** Math.floor(Math.log10(e));
|
|
4
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()),
|
|
6
|
-
const
|
|
7
|
-
if (typeof e == "number" || typeof e == "bigint")
|
|
8
|
-
r != null ? (
|
|
5
|
+
}, h = (e, r) => c(e) ? e.valueOf() < BigInt(r.valueOf()) ? e : BigInt(r.valueOf()) : e.valueOf() < Number(r.valueOf()) ? e : Number(r.valueOf()), R = (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, U = (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, n) => {
|
|
6
|
+
const t = {};
|
|
7
|
+
if (typeof r == "object" && (n = r, r = void 0), n = { makeValid: !0, ...n }, typeof e == "number" || typeof e == "bigint")
|
|
8
|
+
r != null ? (t.lower = e, t.upper = r) : (t.lower = typeof e == "bigint" ? 0n : 0, t.upper = e);
|
|
9
9
|
else if (Array.isArray(e)) {
|
|
10
10
|
if (e.length !== 2) throw new Error("bounds: expected array of length 2");
|
|
11
|
-
[
|
|
12
|
-
} else
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
[t.lower, t.upper] = e;
|
|
12
|
+
} else
|
|
13
|
+
t.lower = e.lower, t.upper = e.upper;
|
|
14
|
+
return n != null && n.makeValid ? g(t) : t;
|
|
15
|
+
}, x = 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) => {
|
|
15
16
|
if (e == null && r == null) return !0;
|
|
16
17
|
if (e == null || r == null) return !1;
|
|
17
18
|
const n = i(e), t = i(r);
|
|
18
19
|
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);
|
|
19
|
-
},
|
|
20
|
+
}, g = (e) => e.lower > e.upper ? { lower: e.upper, upper: e.lower } : e, j = (e, r) => {
|
|
20
21
|
const n = i(e);
|
|
21
22
|
return r < n.lower ? n.lower : r >= n.upper ? n.upper - (typeof n.upper == "number" ? 1 : 1n) : r;
|
|
22
23
|
}, a = (e, r) => {
|
|
@@ -37,23 +38,23 @@ const c = (e) => typeof e == "bigint" || e instanceof BigInt, v = (e, r) => c(e)
|
|
|
37
38
|
}, E = (e) => {
|
|
38
39
|
const r = w(e);
|
|
39
40
|
return typeof r == "number" ? r === 0 : r === 0n;
|
|
40
|
-
},
|
|
41
|
+
}, k = (e) => {
|
|
41
42
|
const r = i(e);
|
|
42
43
|
return typeof r.lower == "bigint" ? !0 : Number.isFinite(r.lower) && Number.isFinite(r.upper);
|
|
43
|
-
},
|
|
44
|
+
}, D = (e) => {
|
|
44
45
|
const r = i(e);
|
|
45
46
|
return (r.upper + r.lower) / 2;
|
|
46
|
-
},
|
|
47
|
+
}, F = (e) => ({
|
|
47
48
|
lower: Math.min(...e.map((r) => i(r).lower)),
|
|
48
49
|
upper: Math.max(...e.map((r) => i(r).upper))
|
|
49
|
-
}),
|
|
50
|
+
}), L = (e) => ({
|
|
50
51
|
lower: Math.max(...e.map((r) => i(r).lower)),
|
|
51
52
|
upper: Math.min(...e.map((r) => i(r).upper))
|
|
52
|
-
}),
|
|
53
|
+
}), T = (e) => {
|
|
53
54
|
const r = i(e), n = typeof r.lower == "bigint";
|
|
54
55
|
return Array.from({ length: Number(w(e)) }, (t, o) => n ? r.lower + BigInt(o) : r.lower + o);
|
|
55
|
-
},
|
|
56
|
-
const n = e.map((
|
|
56
|
+
}, O = (e, r) => {
|
|
57
|
+
const n = e.map((l) => i(l)), t = n.findIndex((l) => a(l, r) || r < l.lower);
|
|
57
58
|
if (t === -1) return { index: e.length, position: 0 };
|
|
58
59
|
const o = n[t];
|
|
59
60
|
return a(o, r) ? { index: t, position: Number(r - o.lower) } : { index: t, position: 0 };
|
|
@@ -62,112 +63,112 @@ const c = (e) => typeof e == "bigint" || e instanceof BigInt, v = (e, r) => c(e)
|
|
|
62
63
|
removeAfter: 0,
|
|
63
64
|
insertInto: 0,
|
|
64
65
|
deleteInBetween: 0
|
|
65
|
-
},
|
|
66
|
+
}, Z = (e, r) => {
|
|
66
67
|
const n = e.map((p) => i(p)), t = i(r);
|
|
67
68
|
if (n.length === 0) return d;
|
|
68
|
-
const o =
|
|
69
|
+
const o = O(n, t.lower), l = O(n, t.upper);
|
|
69
70
|
if (o.index === e.length) return { ...d, insertInto: e.length };
|
|
70
|
-
if (
|
|
71
|
-
if (o.index ===
|
|
72
|
-
return o.position !== 0 &&
|
|
73
|
-
removeAfter:
|
|
71
|
+
if (l.index === 0) return { ...d, removeAfter: l.position };
|
|
72
|
+
if (o.index === l.index)
|
|
73
|
+
return o.position !== 0 && l.position !== 0 ? null : {
|
|
74
|
+
removeAfter: l.position,
|
|
74
75
|
removeBefore: o.position,
|
|
75
76
|
insertInto: o.index,
|
|
76
77
|
deleteInBetween: 0
|
|
77
78
|
};
|
|
78
|
-
let u =
|
|
79
|
-
return o.position !== 0 ? (u -= 1, f += 1) :
|
|
80
|
-
removeBefore:
|
|
81
|
-
removeAfter:
|
|
79
|
+
let u = l.index - o.index, f = o.index, s = v(Number(w(n[o.index])), o.position);
|
|
80
|
+
return o.position !== 0 ? (u -= 1, f += 1) : s = 0, {
|
|
81
|
+
removeBefore: s,
|
|
82
|
+
removeAfter: l.position,
|
|
82
83
|
insertInto: f,
|
|
83
84
|
deleteInBetween: u
|
|
84
85
|
};
|
|
85
|
-
},
|
|
86
|
+
}, S = (e, r, n) => {
|
|
86
87
|
const t = e.map((f) => i(f)), o = n > 0 ? 1 : n < 0 ? -1 : 0;
|
|
87
88
|
if (o === 0) return r;
|
|
88
|
-
let
|
|
89
|
-
for (;
|
|
90
|
-
const f = t.findIndex((
|
|
89
|
+
let l = n, u = r;
|
|
90
|
+
for (; I(l, 0) === !1; ) {
|
|
91
|
+
const f = t.findIndex((s) => o > 0 ? u >= s.lower && u < s.upper : u > s.lower && u <= s.upper);
|
|
91
92
|
if (f !== -1) {
|
|
92
|
-
const
|
|
93
|
+
const s = t[f];
|
|
93
94
|
let p;
|
|
94
|
-
if (o > 0 ? p = v(
|
|
95
|
-
const m = h(
|
|
95
|
+
if (o > 0 ? p = v(s.upper, u) : p = v(u, s.lower), p > 0) {
|
|
96
|
+
const m = h(y(l), p);
|
|
96
97
|
if (u = B(
|
|
97
98
|
u,
|
|
98
99
|
o > 0 ? m : -m
|
|
99
|
-
),
|
|
100
|
+
), l = v(l, o > 0 ? m : -m), I(l, 0)) return u;
|
|
100
101
|
continue;
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
if (o > 0) {
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
105
|
+
const s = t.filter((p) => p.lower > u);
|
|
106
|
+
if (s.length > 0) u = s[0].lower;
|
|
106
107
|
else return u;
|
|
107
108
|
} else {
|
|
108
|
-
const
|
|
109
|
-
if (
|
|
110
|
-
u =
|
|
109
|
+
const s = t.filter((p) => p.upper < u);
|
|
110
|
+
if (s.length > 0)
|
|
111
|
+
u = s[s.length - 1].upper;
|
|
111
112
|
else return u;
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
return u;
|
|
115
|
-
},
|
|
116
|
+
}, V = (e, r, n) => {
|
|
116
117
|
const t = e.map((u) => i(u));
|
|
117
118
|
if (r === n) return typeof r == "bigint" ? 0n : 0;
|
|
118
119
|
const o = r < n ? i([r, n]) : i([n, r]);
|
|
119
|
-
let
|
|
120
|
+
let l = typeof r == "bigint" ? 0n : 0;
|
|
120
121
|
for (const u of t) {
|
|
121
|
-
const f = u.lower > o.lower ? u.lower : o.lower,
|
|
122
|
-
if (f <
|
|
123
|
-
const p =
|
|
124
|
-
|
|
122
|
+
const f = u.lower > o.lower ? u.lower : o.lower, s = u.upper < o.upper ? u.upper : o.upper;
|
|
123
|
+
if (f < s) {
|
|
124
|
+
const p = s - f;
|
|
125
|
+
l = l + p;
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
|
-
return
|
|
128
|
+
return l;
|
|
128
129
|
}, G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
129
130
|
__proto__: null,
|
|
130
131
|
CLIP: M,
|
|
131
132
|
DECIMAL: _,
|
|
132
133
|
INFINITE: N,
|
|
133
|
-
ZERO:
|
|
134
|
+
ZERO: x,
|
|
134
135
|
bounds: b,
|
|
135
|
-
buildInsertionPlan:
|
|
136
|
+
buildInsertionPlan: Z,
|
|
136
137
|
clamp: j,
|
|
137
138
|
construct: i,
|
|
138
139
|
contains: a,
|
|
139
|
-
distance:
|
|
140
|
+
distance: V,
|
|
140
141
|
equals: A,
|
|
141
|
-
findInsertPosition:
|
|
142
|
-
isFinite:
|
|
142
|
+
findInsertPosition: O,
|
|
143
|
+
isFinite: k,
|
|
143
144
|
isZero: z,
|
|
144
|
-
linspace:
|
|
145
|
-
makeValid:
|
|
146
|
-
max:
|
|
147
|
-
mean:
|
|
148
|
-
min:
|
|
145
|
+
linspace: T,
|
|
146
|
+
makeValid: g,
|
|
147
|
+
max: F,
|
|
148
|
+
mean: D,
|
|
149
|
+
min: L,
|
|
149
150
|
overlapsWith: P,
|
|
150
151
|
span: w,
|
|
151
152
|
spanIsZero: E,
|
|
152
|
-
traverse:
|
|
153
|
+
traverse: S
|
|
153
154
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
154
155
|
export {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
156
|
+
y as a,
|
|
157
|
+
B as b,
|
|
158
|
+
q as c,
|
|
159
|
+
W as d,
|
|
160
|
+
I as e,
|
|
161
|
+
h as f,
|
|
162
|
+
U as g,
|
|
163
|
+
v as h,
|
|
164
|
+
G as i,
|
|
165
|
+
i as j,
|
|
166
|
+
j as k,
|
|
167
|
+
a as l,
|
|
168
|
+
R as m,
|
|
169
|
+
F as n,
|
|
170
|
+
V as o,
|
|
171
|
+
C as r,
|
|
171
172
|
w as s,
|
|
172
|
-
|
|
173
|
+
S as t
|
|
173
174
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const M=require("./base-CTq-lhpU.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()),g=(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=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()),P=(e,r)=>a(e)?e.valueOf()>BigInt(r.valueOf())?e:BigInt(r.valueOf()):e.valueOf()>Number(r.valueOf())?e:Number(r.valueOf()),B=e=>a(e)||e instanceof BigInt?e.valueOf()<0n?-e:e:e.valueOf()<0?-e:e,T=(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()),i=(e,r,n)=>{const t={};if(typeof r=="object"&&(n=r,r=void 0),n={makeValid:!0,...n},typeof e=="number"||typeof e=="bigint")r!=null?(t.lower=e,t.upper=r):(t.lower=typeof e=="bigint"?0n:0,t.upper=e);else if(Array.isArray(e)){if(e.length!==2)throw new Error("bounds: expected array of length 2");[t.lower,t.upper]=e}else t.lower=e.lower,t.upper=e.upper;return n!=null&&n.makeValid?x(t):t},E=Object.freeze({lower:0,upper:0}),q=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)},x=e=>e.lower>e.upper?{lower:e.upper,upper:e.lower}:e,y=(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)},v=e=>{const r=i(e);return r.upper-r.lower},k=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},V=e=>{const r=i(e);return typeof r.lower=="bigint"?!0:Number.isFinite(r.lower)&&Number.isFinite(r.upper)},$=e=>{const r=i(e);return(r.upper+r.lower)/2},h=e=>({lower:Math.min(...e.map(r=>i(r).lower)),upper:Math.max(...e.map(r=>i(r).upper))}),C=e=>({lower:Math.max(...e.map(r=>i(r).lower)),upper:Math.min(...e.map(r=>i(r).upper))}),R=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)},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}},w={removeBefore:0,removeAfter:0,insertInto:0,deleteInBetween:0},U=(e,r)=>{const n=e.map(p=>i(p)),t=i(r);if(n.length===0)return w;const o=I(n,t.lower),l=I(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}},N=(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(B(l),p);if(u=g(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},_=(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:q,ZERO:E,bounds:M.bounds,buildInsertionPlan:U,clamp:y,construct:i,contains:c,distance:_,equals:L,findInsertPosition:I,isFinite:V,isZero:k,linspace:R,makeValid:x,max:h,mean:$,min:C,overlapsWith:Z,span:v,spanIsZero:S,traverse:N},Symbol.toStringTag,{value:"Module"}));exports.abs=B;exports.add=g;exports.bounds=W;exports.clamp=y;exports.closeTo=A;exports.construct=i;exports.contains=c;exports.distance=_;exports.div=z;exports.equal=O;exports.max=P;exports.max$1=h;exports.min=b;exports.mult=T;exports.roundToNearestMagnitude=j;exports.span=v;exports.sub=m;exports.traverse=N;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var A=Object.defineProperty;var E=(e,t,r)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var m=(e,t,r)=>E(e,typeof t!="symbol"?t+"":t,r);const h=require("./index-udOjA9d-.cjs");class b{constructor(t){m(this,"value");this.value=t}valueOf(){return this.value}toJSON(){return this.value}toString(){return this.value.toString()}}const g=e=>e!=null&&typeof e=="object"&&"toString"in e,y=e=>{if(g(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;default:return!1}},q=Object.freeze(Object.defineProperty({__proto__:null,ValueExtension:b,isStringer:g,isZero:y},Symbol.toStringTag,{value:"Module"})),l=(e,t=!1)=>{const r=g(e)?"stringer":typeof e;let n;switch(r){case"string":n=(s,o)=>s.localeCompare(o);break;case"stringer":n=(s,o)=>s.toString().localeCompare(o.toString());break;case"number":n=(s,o)=>Number(s)-Number(o);break;case"bigint":n=(s,o)=>BigInt(s)-BigInt(o)>0n?1:-1;break;case"boolean":n=(s,o)=>Number(s)-Number(o);break;case"undefined":n=()=>0;break;default:return console.warn(`sortFunc: unknown type ${r}`),()=>-1}return t?N(n):n},P=(e,t,r)=>{const n=l(t[e],r);return(s,o)=>n(s[e],o[e])},w=(e,t)=>e.length!==t.length?e.length-t.length:e.every((r,n)=>r===t[n])?0:-1,f=(e,t)=>{if(e.length!==t.length)return e.length-t.length;if(e.length===0)return 0;const r=l(e[0]),n=[...e].sort(r),s=[...t].sort(r);return n.every((o,i)=>o===s[i])?0:-1},F=(e,t)=>{const r=h.unique$1(e),n=h.unique$1(t);return f(r,n)},j=(e,t)=>e===t?0:e==="first"&&t==="last"?1:-1,N=e=>(t,r)=>e(r,t),u=0,p=-1,d=1,S=e=>e<u,T=e=>e>u,L=e=>e>=u,_=e=>e===u,O=(e,t)=>{const r=/([a-zA-Z]+)|(\d+)/g,n=e.replace(/[\s_.-]+/g,"").match(r),s=t.replace(/[\s_.-]+/g,"").match(r);if(!n||!s)return 0;for(let o=0;o<Math.min(n.length,s.length);o++){const i=n[o],a=s[o];if(isNaN(Number(i))&&isNaN(Number(a))){const c=i.localeCompare(a);if(c!==0)return c}else if(!isNaN(Number(i))&&!isNaN(Number(a))){const c=Number(i)-Number(a);if(c!==0)return c}else return isNaN(Number(i))?-1:1}return n.length-s.length},k=Object.freeze(Object.defineProperty({__proto__:null,EQUAL:u,GREATER_THAN:d,LESS_THAN:p,isEqualTo:_,isGreaterThan:T,isGreaterThanEqual:L,isLessThan:S,newF:l,newFieldF:P,order:j,primitiveArrays:w,reverseF:N,stringsWithNumbers:O,uniqueUnorderedPrimitiveArrays:F,unorderedPrimitiveArrays:f},Symbol.toStringTag,{value:"Module"}));exports.EQUAL=u;exports.GREATER_THAN=d;exports.LESS_THAN=p;exports.ValueExtension=b;exports.compare=k;exports.isEqualTo=_;exports.isGreaterThan=T;exports.isLessThan=S;exports.newF=l;exports.primitive=q;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";var E=Object.defineProperty;var T=(o,e,t)=>e in o?E(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var i=(o,e,t)=>T(o,typeof e!="symbol"?e+"":e,t);const p=require("./index-DKMnHBGR.cjs"),w=require("./identity.cjs");class f{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))}decode(e,t){return this.decodeString(this.decoder.decode(e),t)}decodeString(e,t){const n=JSON.parse(e),r=p.snakeToCamel(n);return t!=null?t.parse(r):r}encodeString(e){const t=p.camelToSnake(e);return JSON.stringify(t,(n,r)=>ArrayBuffer.isView(r)?Array.from(r):typeof r=="bigint"?r.toString():r)}}class S{constructor(){i(this,"contentType","text/csv")}encode(e){const t=this.encodeString(e);return new TextEncoder().encode(t)}decode(e,t){const n=new TextDecoder().decode(e);return this.decodeString(n,t)}encodeString(e){if(!Array.isArray(e)||e.length===0||!w.isObject(e[0]))throw new Error("Payload must be an array of objects");const t=Object.keys(e[0]),n=[t.join(",")];return e.forEach(r=>{const d=t.map(s=>JSON.stringify(r[s]??""));n.push(d.join(","))}),n.join(`
|
|
2
|
+
`)}decodeString(e,t){const[n,...r]=e.trim().split(`
|
|
3
|
+
`).map(c=>c.trim());if(n.length===0)return t!=null?t.parse({}):{};const d=n.split(",").map(c=>c.trim()),s={};return d.forEach(c=>{s[c]=[]}),r.forEach(c=>{const h=c.split(",").map(u=>u.trim());d.forEach((u,C)=>{const l=this.parseValue(h[C]);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}}class g{constructor(){i(this,"contentType","text/plain")}encode(e){if(typeof e!="string")throw new Error("TextCodec.encode payload must be a string");return new TextEncoder().encode(e)}decode(e,t){const n=new TextDecoder().decode(e);return t!=null?t.parse(n):n}}const a=new f,O=new S,y=new g,m=[a],x=Object.freeze(Object.defineProperty({__proto__:null,CSVCodec:S,CSV_CODEC:O,ENCODERS:m,JSONCodec:f,JSON_CODEC:a,TEXT_CODEC:y,TextCodec:g},Symbol.toStringTag,{value:"Module"}));exports.JSON_CODEC=a;exports.codec=x;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { c as b } from "./index-DxU1zwsd.js";
|
|
2
|
+
import { c as Z, T as C, B as H, x as q, a as v, b as z, d as F, e as G, f as D, C as X, g as Y } from "./index-D6V-8SKw.js";
|
|
3
|
+
import { Z as g, O as U, e as L, t as E, c as k, a as $ } from "./index-C-qYOegc.js";
|
|
4
|
+
import { u as J, n as p, s as K, o as M } from "./schemas-55Usj0Fg.js";
|
|
5
|
+
import { x as N, X as P, Y as Q } from "./base-B5lQIJKc.js";
|
|
6
|
+
const h = J([p(), K()]), V = M({
|
|
7
|
+
top: h,
|
|
8
|
+
left: h,
|
|
9
|
+
width: h,
|
|
10
|
+
height: h
|
|
11
|
+
}), tt = M({
|
|
12
|
+
left: p(),
|
|
13
|
+
top: p(),
|
|
14
|
+
right: p(),
|
|
15
|
+
bottom: p()
|
|
16
|
+
}), ot = M({
|
|
17
|
+
one: N,
|
|
18
|
+
two: N,
|
|
19
|
+
root: Z
|
|
20
|
+
}), W = { one: g, two: g, root: C }, nt = { one: g, two: U, root: H }, j = (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 ?? C
|
|
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
|
+
}, et = (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 = b(o);
|
|
47
|
+
return c(
|
|
48
|
+
n.one,
|
|
49
|
+
void 0,
|
|
50
|
+
r === "x" ? e : u(n),
|
|
51
|
+
r === "y" ? e : f(n),
|
|
52
|
+
n.root
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
return c(n.one, o, void 0, void 0, n.root);
|
|
56
|
+
}, st = (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(y(n), y(o)) && r(w(o), w(n)) && r(a(n), a(o)) && r(l(o), l(n)) : r(y(n), o.x) && r(o.x, w(n)) && r(a(n), o.y) && r(o.y, l(n));
|
|
60
|
+
}, rt = (t, o) => L(t.one, o.one) && L(t.two, o.two) && q(t.root, o.root), A = (t) => ({
|
|
61
|
+
width: u(t),
|
|
62
|
+
height: f(t)
|
|
63
|
+
}), ct = (t) => ({
|
|
64
|
+
signedWidth: _(t),
|
|
65
|
+
signedHeight: T(t)
|
|
66
|
+
}), it = (t) => ({
|
|
67
|
+
top: a(t),
|
|
68
|
+
left: y(t),
|
|
69
|
+
width: u(t),
|
|
70
|
+
height: f(t)
|
|
71
|
+
}), B = (t, o, e = !1) => {
|
|
72
|
+
const n = b(o) === "y" ? T(t) : _(t);
|
|
73
|
+
return e ? n : Math.abs(n);
|
|
74
|
+
}, x = (t, o) => {
|
|
75
|
+
const e = c(t);
|
|
76
|
+
return {
|
|
77
|
+
x: o.x === "center" ? O(e).x : d(e, o.x),
|
|
78
|
+
y: o.y === "center" ? O(e).y : d(e, o.y)
|
|
79
|
+
};
|
|
80
|
+
}, d = (t, o) => {
|
|
81
|
+
const e = c(t), n = v(e.root).includes(o) ? Math.min : Math.max;
|
|
82
|
+
return P.includes(o) ? n(e.one.x, e.two.x) : n(e.one.y, e.two.y);
|
|
83
|
+
}, xt = (t) => t.one.x === t.two.x && t.one.y === t.two.y, u = (t) => B(t, "x"), f = (t) => B(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
|
+
}, S = (t) => x(t, C), yt = (t) => x(t, z), at = (t) => x(t, F), ut = (t) => x(t, H), ft = (t) => x(t, G), wt = (t) => x(t, D), lt = (t) => x(t, X), dt = (t) => x(t, Y), w = (t) => d(t, "right"), l = (t) => d(t, "bottom"), y = (t) => d(t, "left"), a = (t) => d(t, "top"), O = (t) => E(S(t), {
|
|
90
|
+
x: _(t) / 2,
|
|
91
|
+
y: T(t) / 2
|
|
92
|
+
}), R = (t) => {
|
|
93
|
+
const o = c(t);
|
|
94
|
+
return o.root.x === "left" ? y(o) : w(o);
|
|
95
|
+
}, I = (t) => {
|
|
96
|
+
const o = c(t);
|
|
97
|
+
return o.root.y === "top" ? a(o) : l(o);
|
|
98
|
+
}, mt = (t) => ({ x: R(t), y: I(t) }), pt = (t) => {
|
|
99
|
+
const o = c(t);
|
|
100
|
+
return { lower: o.one.x, upper: o.two.x };
|
|
101
|
+
}, gt = (t) => {
|
|
102
|
+
const o = c(t);
|
|
103
|
+
return { lower: o.one.y, upper: o.two.y };
|
|
104
|
+
}, ht = (t, o) => j(t, o), _t = (t, o) => {
|
|
105
|
+
const e = c(t), n = P.includes(o) ? "x" : Q.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
|
+
}, Tt = (t, o) => {
|
|
110
|
+
const e = c(t), n = c(o), r = R(n) + (u(n) - u(e)) / 2, s = I(n) + (f(n) - f(e)) / 2;
|
|
111
|
+
return c({ x: r, y: s }, A(e));
|
|
112
|
+
}, Et = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, Ot = (t) => u(t) / f(t), bt = (t, o, e) => {
|
|
113
|
+
if (typeof o == "string") {
|
|
114
|
+
if (e == null) throw new Error("Undefined amount passed into box.translate");
|
|
115
|
+
const r = b(o);
|
|
116
|
+
o = k(r, e);
|
|
117
|
+
}
|
|
118
|
+
const n = c(t);
|
|
119
|
+
return c(
|
|
120
|
+
E(n.one, o),
|
|
121
|
+
E(n.two, o),
|
|
122
|
+
void 0,
|
|
123
|
+
void 0,
|
|
124
|
+
n.root
|
|
125
|
+
);
|
|
126
|
+
}, Ct = (t, o) => {
|
|
127
|
+
const e = Math.max(y(t), y(o)), n = Math.max(a(t), a(o)), r = Math.min(w(t), w(o)), s = Math.min(l(t), l(o));
|
|
128
|
+
return e > r || n > s ? W : c({ x: e, y: n }, { x: r, y: s }, void 0, void 0, t.root);
|
|
129
|
+
}, Mt = (t) => u(t) * f(t), Bt = (t, o) => {
|
|
130
|
+
const e = c(t);
|
|
131
|
+
return c(
|
|
132
|
+
$(e.one, o),
|
|
133
|
+
$(e.two, o),
|
|
134
|
+
void 0,
|
|
135
|
+
void 0,
|
|
136
|
+
e.root
|
|
137
|
+
);
|
|
138
|
+
}, Rt = (t, o, e, n, r, s) => {
|
|
139
|
+
const i = { x: t, y: o }, m = { x: t + e, y: o + 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
|
+
}, Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
142
|
+
__proto__: null,
|
|
143
|
+
DECIMAL: nt,
|
|
144
|
+
ZERO: W,
|
|
145
|
+
area: Mt,
|
|
146
|
+
areaIsZero: xt,
|
|
147
|
+
aspect: Ot,
|
|
148
|
+
bottom: l,
|
|
149
|
+
bottomCenter: ft,
|
|
150
|
+
bottomLeft: ut,
|
|
151
|
+
bottomRight: wt,
|
|
152
|
+
box: ot,
|
|
153
|
+
center: O,
|
|
154
|
+
centerLeft: lt,
|
|
155
|
+
centerRight: dt,
|
|
156
|
+
construct: c,
|
|
157
|
+
constructWithAlternateRoot: Rt,
|
|
158
|
+
contains: st,
|
|
159
|
+
copy: j,
|
|
160
|
+
css: it,
|
|
161
|
+
cssBox: V,
|
|
162
|
+
dim: B,
|
|
163
|
+
dims: A,
|
|
164
|
+
domRect: tt,
|
|
165
|
+
edgePoints: _t,
|
|
166
|
+
equals: rt,
|
|
167
|
+
height: f,
|
|
168
|
+
intersection: Ct,
|
|
169
|
+
isBox: Et,
|
|
170
|
+
left: y,
|
|
171
|
+
loc: d,
|
|
172
|
+
positionInCenter: Tt,
|
|
173
|
+
reRoot: ht,
|
|
174
|
+
resize: et,
|
|
175
|
+
right: w,
|
|
176
|
+
root: mt,
|
|
177
|
+
signedDims: ct,
|
|
178
|
+
signedHeight: T,
|
|
179
|
+
signedWidth: _,
|
|
180
|
+
top: a,
|
|
181
|
+
topCenter: yt,
|
|
182
|
+
topLeft: S,
|
|
183
|
+
topRight: at,
|
|
184
|
+
translate: bt,
|
|
185
|
+
truncate: Bt,
|
|
186
|
+
width: u,
|
|
187
|
+
x: R,
|
|
188
|
+
xBounds: pt,
|
|
189
|
+
xyLoc: x,
|
|
190
|
+
y: I,
|
|
191
|
+
yBounds: gt
|
|
192
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
193
|
+
export {
|
|
194
|
+
Rt as a,
|
|
195
|
+
Pt as b,
|
|
196
|
+
c,
|
|
197
|
+
Mt as d,
|
|
198
|
+
Et as e,
|
|
199
|
+
pt as f,
|
|
200
|
+
f as h,
|
|
201
|
+
Ct as i,
|
|
202
|
+
u as w,
|
|
203
|
+
x,
|
|
204
|
+
gt as y
|
|
205
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const S=require("./index-DKMnHBGR.cjs"),o=require("./base-CTq-lhpU.cjs"),L=require("./schemas-DbXuI2Qr.cjs"),g=o.xLocation,h=o.yLocation,z=o.centerLocation,m={top:"bottom",right:"left",bottom:"top",left:"right",center:"center"},d={top:"left",right:"top",bottom:"right",left:"bottom",center:"center"},A=o.crudeLocation,s=t=>t instanceof String||!o.DIRECTIONS.includes(t)?t:t==="x"?"left":"top",b=t=>m[s(t)],M=t=>d[s(t)],i=t=>{const c=s(t);return c==="top"||c==="bottom"?"y":"x"},C=L.object({x:o.xLocation.or(o.centerLocation),y:o.yLocation.or(o.centerLocation)}),N=L.object({x:o.xLocation,y:o.yLocation}),y=Object.freeze({x:"left",y:"top"}),f=Object.freeze({x:"right",y:"top"}),x=Object.freeze({x:"left",y:"bottom"}),E=Object.freeze({x:"right",y:"bottom"}),O=Object.freeze({x:"center",y:"center"}),_=Object.freeze({x:"center",y:"top"}),a=Object.freeze({x:"center",y:"bottom"}),u=Object.freeze({x:"right",y:"center"}),l=Object.freeze({x:"left",y:"center"}),p=Object.freeze([l,u,_,a,y,f,x,E,O]),R=(t,c)=>t.x===c.x&&t.y===c.y,j=(t,c)=>{if(typeof c=="object"){let e=!0;return"x"in c&&(t.x===c.x||(e=!1)),"y"in c&&(t.y===c.y||(e=!1)),e}return t.x===c||t.y===c},I=t=>[t.x,t.y],T=t=>i(s(t))==="x",P=t=>i(s(t))==="y",X=t=>`${t.x}${S.capitalize(t.y)}`,Y=(t,c)=>{let e,n;if(typeof t=="object"&&"x"in t?(e=t.x,n=t.y):(e=s(t),n=s(c??t)),i(e)===i(n)&&e!=="center"&&n!=="center")throw new Error(`[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${n.toString()}`);const r={...O};return e==="center"?T(n)?[r.x,r.y]=[n,e]:[r.x,r.y]=[e,n]:n==="center"?T(e)?[r.x,r.y]=[e,n]:[r.x,r.y]=[n,e]:T(e)?[r.x,r.y]=[e,n]:[r.x,r.y]=[n,e],r},w=Object.freeze(Object.defineProperty({__proto__:null,BOTTOM_CENTER:a,BOTTOM_LEFT:x,BOTTOM_RIGHT:E,CENTER:O,CENTER_LEFT:l,CENTER_LOCATIONS:o.CENTER_LOCATIONS,CENTER_RIGHT:u,TOP_CENTER:_,TOP_LEFT:y,TOP_RIGHT:f,XY_LOCATIONS:p,X_LOCATIONS:o.X_LOCATIONS,Y_LOCATIONS:o.Y_LOCATIONS,center:z,construct:s,constructXY:Y,corner:N,crude:A,direction:i,isX:T,isY:P,location:o.location,outer:o.outerLocation,rotate90:M,swap:b,x:g,xy:C,xyCouple:I,xyEquals:R,xyMatches:j,xyToString:X,y:h},Symbol.toStringTag,{value:"Module"}));exports.BOTTOM_CENTER=a;exports.BOTTOM_LEFT=x;exports.BOTTOM_RIGHT=E;exports.CENTER=O;exports.CENTER_LEFT=l;exports.CENTER_RIGHT=u;exports.TOP_CENTER=_;exports.TOP_LEFT=y;exports.TOP_RIGHT=f;exports.XY_LOCATIONS=p;exports.corner=N;exports.location=w;exports.swap=b;exports.xy=C;exports.xyCouple=I;exports.xyEquals=R;exports.xyMatches=j;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { b as m } from "./index-Dql5FMcH.js";
|
|
2
|
+
import { y as f, e as y, f as a, g, D as C, C as L, X as h, Y as z, l as S, o as d } from "./base-B5lQIJKc.js";
|
|
3
|
+
import { o as O } from "./schemas-55Usj0Fg.js";
|
|
4
4
|
const N = y, R = f, I = a, X = {
|
|
5
5
|
top: "bottom",
|
|
6
6
|
right: "left",
|
|
@@ -13,13 +13,13 @@ const N = y, R = f, I = a, X = {
|
|
|
13
13
|
bottom: "right",
|
|
14
14
|
left: "bottom",
|
|
15
15
|
center: "center"
|
|
16
|
-
}, A = g,
|
|
17
|
-
const o =
|
|
16
|
+
}, A = g, c = (t) => t instanceof String || !C.includes(t) ? t : t === "x" ? "left" : "top", P = (t) => X[c(t)], k = (t) => Y[c(t)], s = (t) => {
|
|
17
|
+
const o = c(t);
|
|
18
18
|
return o === "top" || o === "bottom" ? "y" : "x";
|
|
19
|
-
}, w = O
|
|
19
|
+
}, w = O({
|
|
20
20
|
x: y.or(a),
|
|
21
21
|
y: f.or(a)
|
|
22
|
-
}), M = O
|
|
22
|
+
}), M = O({ x: y, y: f }), T = Object.freeze({ x: "left", y: "top" }), b = Object.freeze({ x: "right", y: "top" }), l = Object.freeze({ x: "left", y: "bottom" }), u = Object.freeze({ x: "right", y: "bottom" }), x = Object.freeze({ x: "center", y: "center" }), p = Object.freeze({ x: "center", y: "top" }), _ = Object.freeze({ x: "center", y: "bottom" }), E = Object.freeze({ x: "right", y: "center" }), j = Object.freeze({ x: "left", y: "center" }), $ = Object.freeze([
|
|
23
23
|
j,
|
|
24
24
|
E,
|
|
25
25
|
p,
|
|
@@ -35,14 +35,14 @@ const N = y, R = f, I = a, X = {
|
|
|
35
35
|
return "x" in o && (t.x === o.x || (e = !1)), "y" in o && (t.y === o.y || (e = !1)), e;
|
|
36
36
|
}
|
|
37
37
|
return t.x === o || t.y === o;
|
|
38
|
-
}, F = (t) => [t.x, t.y], i = (t) => s(
|
|
38
|
+
}, F = (t) => [t.x, t.y], i = (t) => s(c(t)) === "x", G = (t) => s(c(t)) === "y", H = (t) => `${t.x}${m(t.y)}`, q = (t, o) => {
|
|
39
39
|
let e, n;
|
|
40
|
-
if (typeof t == "object" && "x" in t ? (e = t.x, n = t.y) : (e =
|
|
40
|
+
if (typeof t == "object" && "x" in t ? (e = t.x, n = t.y) : (e = c(t), n = c(o ?? t)), s(e) === s(n) && e !== "center" && n !== "center")
|
|
41
41
|
throw new Error(
|
|
42
42
|
`[XYLocation] - encountered two locations with the same direction: ${e.toString()} - ${n.toString()}`
|
|
43
43
|
);
|
|
44
|
-
const
|
|
45
|
-
return e === "center" ? i(n) ? [
|
|
44
|
+
const r = { ...x };
|
|
45
|
+
return e === "center" ? i(n) ? [r.x, r.y] = [n, e] : [r.x, r.y] = [e, n] : n === "center" ? i(e) ? [r.x, r.y] = [e, n] : [r.x, r.y] = [n, e] : i(e) ? [r.x, r.y] = [e, n] : [r.x, r.y] = [n, e], r;
|
|
46
46
|
}, K = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
47
47
|
__proto__: null,
|
|
48
48
|
BOTTOM_CENTER: _,
|
|
@@ -50,16 +50,16 @@ const N = y, R = f, I = a, X = {
|
|
|
50
50
|
BOTTOM_RIGHT: u,
|
|
51
51
|
CENTER: x,
|
|
52
52
|
CENTER_LEFT: j,
|
|
53
|
-
CENTER_LOCATIONS:
|
|
53
|
+
CENTER_LOCATIONS: L,
|
|
54
54
|
CENTER_RIGHT: E,
|
|
55
55
|
TOP_CENTER: p,
|
|
56
56
|
TOP_LEFT: T,
|
|
57
57
|
TOP_RIGHT: b,
|
|
58
58
|
XY_LOCATIONS: $,
|
|
59
|
-
X_LOCATIONS:
|
|
60
|
-
Y_LOCATIONS:
|
|
59
|
+
X_LOCATIONS: h,
|
|
60
|
+
Y_LOCATIONS: z,
|
|
61
61
|
center: I,
|
|
62
|
-
construct:
|
|
62
|
+
construct: c,
|
|
63
63
|
constructXY: q,
|
|
64
64
|
corner: M,
|
|
65
65
|
crude: A,
|
|
@@ -80,20 +80,20 @@ const N = y, R = f, I = a, X = {
|
|
|
80
80
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
81
81
|
export {
|
|
82
82
|
l as B,
|
|
83
|
-
|
|
83
|
+
j as C,
|
|
84
84
|
T,
|
|
85
85
|
$ as X,
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
F as a,
|
|
87
|
+
p as b,
|
|
88
88
|
M as c,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
b as d,
|
|
90
|
+
_ as e,
|
|
91
|
+
u as f,
|
|
92
|
+
E as g,
|
|
93
|
+
w as h,
|
|
94
|
+
D as i,
|
|
95
|
+
x as j,
|
|
96
96
|
K as l,
|
|
97
97
|
P as s,
|
|
98
|
-
|
|
98
|
+
B as x
|
|
99
99
|
};
|