@synnaxlabs/x 0.44.0 → 0.44.2

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.
Files changed (65) hide show
  1. package/.turbo/turbo-build.log +24 -24
  2. package/dist/box-CO_2_DGG.js +209 -0
  3. package/dist/box-Cxki783Y.cjs +1 -0
  4. package/dist/box.cjs +1 -1
  5. package/dist/box.js +1 -1
  6. package/dist/compare.cjs +1 -1
  7. package/dist/compare.js +1 -1
  8. package/dist/deep.cjs +1 -1
  9. package/dist/deep.js +56 -46
  10. package/dist/{external-BFgJjMcS.js → external-Birv9jaY.js} +1 -1
  11. package/dist/{external-mffsMzJx.cjs → external-DsmsSN1Y.cjs} +1 -1
  12. package/dist/{index-PNh31WTW.js → index-CBMHFqs4.js} +34 -33
  13. package/dist/index-DOJlZHqJ.cjs +1 -0
  14. package/dist/index.cjs +1 -1
  15. package/dist/index.js +9 -9
  16. package/dist/path-BeMr8xWN.cjs +1 -0
  17. package/dist/path-DVFrKaNI.js +107 -0
  18. package/dist/{position-DAL0Qqdf.cjs → position-DSy2hONH.cjs} +1 -1
  19. package/dist/{position-bA6pUwLn.js → position-PQ6op54I.js} +1 -1
  20. package/dist/position.cjs +1 -1
  21. package/dist/position.js +1 -1
  22. package/dist/{scale-Bzn1Cl0r.cjs → scale-C6qKDbRb.cjs} +1 -1
  23. package/dist/{scale-CdTNWu-d.js → scale-EWNUk-bn.js} +2 -2
  24. package/dist/scale.cjs +1 -1
  25. package/dist/scale.js +1 -1
  26. package/dist/{series-anlpaR_I.cjs → series-CcA_WjbJ.cjs} +1 -1
  27. package/dist/{series-BeJyqCoP.js → series-EA1uaEDj.js} +4 -4
  28. package/dist/spatial.cjs +1 -1
  29. package/dist/spatial.js +4 -4
  30. package/dist/src/deep/copy.d.ts.map +1 -1
  31. package/dist/src/deep/path.d.ts +1 -0
  32. package/dist/src/deep/path.d.ts.map +1 -1
  33. package/dist/src/observe/observe.d.ts +1 -0
  34. package/dist/src/observe/observe.d.ts.map +1 -1
  35. package/dist/src/primitive/primitive.d.ts +13 -1
  36. package/dist/src/primitive/primitive.d.ts.map +1 -1
  37. package/dist/src/spatial/box/box.d.ts +1 -0
  38. package/dist/src/spatial/box/box.d.ts.map +1 -1
  39. package/dist/src/spatial/xy/xy.d.ts +1 -0
  40. package/dist/src/spatial/xy/xy.d.ts.map +1 -1
  41. package/dist/telem.cjs +1 -1
  42. package/dist/telem.js +1 -1
  43. package/dist/xy-CUE3QDNn.cjs +1 -0
  44. package/dist/{xy-D_LqxaGt.js → xy-C_-hb3Q2.js} +27 -22
  45. package/dist/xy.cjs +1 -1
  46. package/dist/xy.js +1 -1
  47. package/dist/zod.cjs +1 -1
  48. package/dist/zod.js +1 -1
  49. package/package.json +3 -3
  50. package/src/deep/copy.ts +12 -1
  51. package/src/deep/path.spec.ts +27 -0
  52. package/src/deep/path.ts +10 -0
  53. package/src/observe/observe.ts +2 -0
  54. package/src/primitive/primitive.spec.ts +7 -4
  55. package/src/primitive/primitive.ts +17 -1
  56. package/src/spatial/box/box.ts +5 -0
  57. package/src/spatial/xy/xy.ts +5 -0
  58. package/src/testutil/testutil.spec.ts +6 -3
  59. package/tsconfig.tsbuildinfo +1 -1
  60. package/dist/box-BcGdqkt4.cjs +0 -1
  61. package/dist/box-D_qdUyEe.js +0 -205
  62. package/dist/index-B1m2qvBT.cjs +0 -1
  63. package/dist/path-BXdMenka.js +0 -101
  64. package/dist/path-st_E5-LJ.cjs +0 -1
  65. package/dist/xy-B7065J2S.cjs +0 -1
@@ -1,5 +1,5 @@
1
1
 
2
- > @synnaxlabs/x@0.44.0 build /home/runner/work/synnax/synnax/x/ts
2
+ > @synnaxlabs/x@0.44.2 build /home/runner/work/synnax/synnax/x/ts
3
3
  > tsc --noEmit && vite build
4
4
 
5
5
   Synnax - Production mode
@@ -38,10 +38,10 @@ computing gzip size...
38
38
  dist/link.js  0.44 kB │ gzip: 0.34 kB
39
39
  dist/index-D4NCYiQB.js  0.45 kB │ gzip: 0.30 kB
40
40
  dist/record-CAcQ5PNX.js  0.51 kB │ gzip: 0.32 kB
41
- dist/spatial.js  0.58 kB │ gzip: 0.28 kB
41
+ dist/spatial.js  0.58 kB │ gzip: 0.29 kB
42
42
  dist/direction-8etxfKaR.js  0.67 kB │ gzip: 0.38 kB
43
43
  dist/external-BYuXBYJh.js  0.79 kB │ gzip: 0.34 kB
44
- dist/external-BFgJjMcS.js  0.86 kB │ gzip: 0.52 kB
44
+ dist/external-Birv9jaY.js  0.86 kB │ gzip: 0.52 kB
45
45
  dist/worker.js  0.87 kB │ gzip: 0.40 kB
46
46
  dist/external-BPgtxa8d.js  0.99 kB │ gzip: 0.56 kB
47
47
  dist/observe.js  1.10 kB │ gzip: 0.48 kB
@@ -49,24 +49,24 @@ computing gzip size...
49
49
  dist/dimensions-CRgergMS.js  1.49 kB │ gzip: 0.66 kB
50
50
  dist/url.js  1.70 kB │ gzip: 0.76 kB
51
51
  dist/index-D2xcvEO5.js  1.86 kB │ gzip: 0.89 kB
52
- dist/position-bA6pUwLn.js  2.23 kB │ gzip: 1.06 kB
53
- dist/path-BXdMenka.js  2.44 kB │ gzip: 0.89 kB
52
+ dist/position-PQ6op54I.js  2.23 kB │ gzip: 1.06 kB
54
53
  dist/index-B5l_quQn.js  2.56 kB │ gzip: 1.00 kB
54
+ dist/path-DVFrKaNI.js  2.63 kB │ gzip: 0.94 kB
55
55
  dist/location-Ar5y2DX2.js  2.86 kB │ gzip: 1.18 kB
56
- dist/index-PNh31WTW.js  3.58 kB │ gzip: 1.36 kB
57
- dist/deep.js  3.71 kB │ gzip: 1.42 kB
58
- dist/xy-D_LqxaGt.js  3.84 kB │ gzip: 1.45 kB
56
+ dist/index-CBMHFqs4.js  3.62 kB │ gzip: 1.37 kB
57
+ dist/deep.js  3.93 kB │ gzip: 1.52 kB
58
+ dist/xy-C_-hb3Q2.js  3.94 kB │ gzip: 1.47 kB
59
59
  dist/bounds-Dj9nG39I.js  6.04 kB │ gzip: 2.00 kB
60
- dist/box-D_qdUyEe.js  6.33 kB │ gzip: 2.23 kB
61
- dist/scale-CdTNWu-d.js  6.49 kB │ gzip: 1.89 kB
60
+ dist/box-CO_2_DGG.js  6.44 kB │ gzip: 2.26 kB
61
+ dist/scale-EWNUk-bn.js  6.49 kB │ gzip: 1.89 kB
62
62
  dist/index.js 26.85 kB │ gzip: 8.64 kB
63
- dist/series-BeJyqCoP.js 87.74 kB │ gzip: 18.83 kB
64
- [vite:dts] Declaration files built in 5106ms.
63
+ dist/series-EA1uaEDj.js 87.74 kB │ gzip: 18.83 kB
64
+ [vite:dts] Declaration files built in 4679ms.
65
65
 
66
66
  Generated an empty chunk: "destructor".
67
67
  dist/destructor.cjs  0.01 kB │ gzip: 0.03 kB
68
- dist/xy.cjs  0.13 kB │ gzip: 0.15 kB
69
- dist/box.cjs  0.14 kB │ gzip: 0.14 kB
68
+ dist/xy.cjs  0.13 kB │ gzip: 0.14 kB
69
+ dist/box.cjs  0.14 kB │ gzip: 0.15 kB
70
70
  dist/scale.cjs  0.14 kB │ gzip: 0.15 kB
71
71
  dist/binary.cjs  0.14 kB │ gzip: 0.15 kB
72
72
  dist/unique.cjs  0.15 kB │ gzip: 0.15 kB
@@ -94,7 +94,7 @@ computing gzip size...
94
94
  dist/direction-386XDm2w.cjs  0.56 kB │ gzip: 0.35 kB
95
95
  dist/external-B9AAGv50.cjs  0.58 kB │ gzip: 0.30 kB
96
96
  dist/spatial.cjs  0.63 kB │ gzip: 0.33 kB
97
- dist/external-mffsMzJx.cjs  0.67 kB │ gzip: 0.45 kB
97
+ dist/external-DsmsSN1Y.cjs  0.67 kB │ gzip: 0.45 kB
98
98
  dist/worker.cjs  0.71 kB │ gzip: 0.39 kB
99
99
  dist/observe.cjs  0.76 kB │ gzip: 0.36 kB
100
100
  dist/external-uXk0Avrg.cjs  0.79 kB │ gzip: 0.49 kB
@@ -102,16 +102,16 @@ computing gzip size...
102
102
  dist/dimensions-D2QGoNXO.cjs  1.17 kB │ gzip: 0.58 kB
103
103
  dist/index-DdhM_E4k.cjs  1.35 kB │ gzip: 0.72 kB
104
104
  dist/base-BAM2mqCy.cjs  1.40 kB │ gzip: 0.58 kB
105
- dist/position-DAL0Qqdf.cjs  1.70 kB │ gzip: 0.94 kB
106
- dist/path-st_E5-LJ.cjs  1.78 kB │ gzip: 0.79 kB
105
+ dist/position-DSy2hONH.cjs  1.70 kB │ gzip: 0.94 kB
106
+ dist/path-BeMr8xWN.cjs  1.93 kB │ gzip: 0.84 kB
107
107
  dist/index-BQe8OIgm.cjs  1.98 kB │ gzip: 0.90 kB
108
108
  dist/location-DZi8ftXp.cjs  2.49 kB │ gzip: 1.06 kB
109
- dist/index-B1m2qvBT.cjs  2.52 kB │ gzip: 1.10 kB
110
- dist/deep.cjs  2.62 kB │ gzip: 1.19 kB
111
- dist/xy-B7065J2S.cjs  2.79 kB │ gzip: 1.29 kB
112
- dist/scale-Bzn1Cl0r.cjs  4.11 kB │ gzip: 1.47 kB
109
+ dist/index-DOJlZHqJ.cjs  2.54 kB │ gzip: 1.12 kB
110
+ dist/deep.cjs  2.79 kB │ gzip: 1.27 kB
111
+ dist/xy-CUE3QDNn.cjs  2.88 kB │ gzip: 1.31 kB
112
+ dist/scale-C6qKDbRb.cjs  4.11 kB │ gzip: 1.47 kB
113
113
  dist/bounds-D6e9xoHt.cjs  4.56 kB │ gzip: 1.77 kB
114
- dist/box-BcGdqkt4.cjs  4.90 kB │ gzip: 2.00 kB
114
+ dist/box-Cxki783Y.cjs  4.99 kB │ gzip: 2.02 kB
115
115
  dist/index.cjs 20.35 kB │ gzip: 7.58 kB
116
- dist/series-anlpaR_I.cjs 37.82 kB │ gzip: 10.09 kB
117
- ✓ built in 6.06s
116
+ dist/series-CcA_WjbJ.cjs 37.82 kB │ gzip: 10.09 kB
117
+ ✓ built in 5.60s
@@ -0,0 +1,209 @@
1
+ import { z as x } from "zod";
2
+ import { c as O } from "./direction-8etxfKaR.js";
3
+ import { c as A, T as M, B as N, b as S, d as Z, e as q, f as F, g as G, h as D, i as X, j as Y } from "./location-Ar5y2DX2.js";
4
+ import { Z as g, O as U, e as I, t as T, c as k, a as L, r as $ } from "./xy-C_-hb3Q2.js";
5
+ import { x as j, X as H, Y as J } from "./base-DFq0vvGn.js";
6
+ const h = x.union([x.number(), x.string()]), K = x.object({
7
+ top: h,
8
+ left: h,
9
+ width: h,
10
+ height: h
11
+ }), Q = x.object({
12
+ left: x.number(),
13
+ top: x.number(),
14
+ right: x.number(),
15
+ bottom: x.number()
16
+ }), V = x.object({
17
+ one: j,
18
+ two: j,
19
+ root: A
20
+ }), P = { one: g, two: g, root: M }, oo = { one: g, two: U, root: N }, v = (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: { ...g },
27
+ two: { ...g },
28
+ root: r ?? M
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
+ }, to = (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 = O(t);
47
+ return c(
48
+ n.one,
49
+ void 0,
50
+ r === "x" ? e : w(n),
51
+ r === "y" ? e : d(n),
52
+ n.root
53
+ );
54
+ }
55
+ return c(n.one, t, void 0, void 0, n.root);
56
+ }, no = (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(a(n), a(t)) && r(f(t), f(n)) && r(u(n), u(t)) && r(l(t), l(n)) : r(a(n), t.x) && r(t.x, f(n)) && r(u(n), t.y) && r(t.y, l(n));
60
+ }, eo = (o, t) => I(o.one, t.one) && I(o.two, t.two) && S(o.root, t.root), W = (o) => ({
61
+ width: w(o),
62
+ height: d(o)
63
+ }), so = (o) => ({
64
+ signedWidth: _(o),
65
+ signedHeight: b(o)
66
+ }), ro = (o) => ({
67
+ top: u(o),
68
+ left: a(o),
69
+ width: w(o),
70
+ height: d(o)
71
+ }), C = (o, t, e = !1) => {
72
+ const n = O(t) === "y" ? b(o) : _(o);
73
+ return e ? n : Math.abs(n);
74
+ }, y = (o, t) => {
75
+ const e = c(o);
76
+ return {
77
+ x: t.x === "center" ? E(e).x : m(e, t.x),
78
+ y: t.y === "center" ? E(e).y : m(e, t.y)
79
+ };
80
+ }, m = (o, t) => {
81
+ const e = c(o), n = Z(e.root).includes(t) ? Math.min : Math.max;
82
+ return H.includes(t) ? n(e.one.x, e.two.x) : n(e.one.y, e.two.y);
83
+ }, co = (o) => o.one.x === o.two.x && o.one.y === o.two.y, w = (o) => C(o, "x"), d = (o) => C(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
+ }, z = (o) => y(o, M), io = (o) => y(o, q), xo = (o) => y(o, F), yo = (o) => y(o, N), ao = (o) => y(o, G), uo = (o) => y(o, D), wo = (o) => y(o, X), fo = (o) => y(o, Y), f = (o) => m(o, "right"), l = (o) => m(o, "bottom"), a = (o) => m(o, "left"), u = (o) => m(o, "top"), E = (o) => T(z(o), {
90
+ x: _(o) / 2,
91
+ y: b(o) / 2
92
+ }), B = (o) => {
93
+ const t = c(o);
94
+ return t.root.x === "left" ? a(t) : f(t);
95
+ }, R = (o) => {
96
+ const t = c(o);
97
+ return t.root.y === "top" ? u(t) : l(t);
98
+ }, lo = (o) => ({ x: B(o), y: R(o) }), mo = (o) => {
99
+ const t = c(o);
100
+ return { lower: t.one.x, upper: t.two.x };
101
+ }, po = (o) => {
102
+ const t = c(o);
103
+ return { lower: t.one.y, upper: t.two.y };
104
+ }, go = (o, t) => v(o, t), ho = (o, t) => {
105
+ const e = c(o), n = H.includes(t) ? "x" : J.includes(t) ? "y" : null;
106
+ if (n === null) throw new Error(`Invalid location: ${t}`);
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
+ }, _o = (o, t) => {
110
+ const e = c(o), n = c(t), r = B(n) + (w(n) - w(e)) / 2, s = R(n) + (d(n) - d(e)) / 2;
111
+ return c({ x: r, y: s }, W(e));
112
+ }, bo = (o) => typeof o != "object" || o == null ? !1 : "one" in o && "two" in o && "root" in o, To = (o) => w(o) / d(o), Eo = (o, t, e) => {
113
+ if (typeof t == "string") {
114
+ if (e == null) throw new Error("Undefined amount passed into box.translate");
115
+ const r = O(t);
116
+ t = k(r, e);
117
+ }
118
+ const n = c(o);
119
+ return c(
120
+ T(n.one, t),
121
+ T(n.two, t),
122
+ void 0,
123
+ void 0,
124
+ n.root
125
+ );
126
+ }, Oo = (o, t) => {
127
+ const e = Math.max(a(o), a(t)), n = Math.max(u(o), u(t)), r = Math.min(f(o), f(t)), s = Math.min(l(o), l(t));
128
+ return e > r || n > s ? P : c({ x: e, y: n }, { x: r, y: s }, void 0, void 0, o.root);
129
+ }, Mo = (o) => w(o) * d(o), Co = (o, t) => {
130
+ const e = c(o);
131
+ return c(
132
+ L(e.one, t),
133
+ L(e.two, t),
134
+ void 0,
135
+ void 0,
136
+ e.root
137
+ );
138
+ }, Bo = (o, t, e, n, r, s) => {
139
+ const i = { x: o, y: t }, p = { x: o + e, y: t + n };
140
+ return r.x !== s.x && (r.x === "center" ? (i.x -= e / 2, p.x -= e / 2) : (i.x -= e, p.x -= e)), r.y !== s.y && (r.y === "center" ? (i.y -= n / 2, p.y -= n / 2) : (i.y -= n, p.y -= n)), c(i, p, void 0, void 0, s);
141
+ }, Ro = (o) => {
142
+ const t = c(o);
143
+ return c($(t.one), $(t.two), void 0, void 0, t.root);
144
+ }, Ho = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
145
+ __proto__: null,
146
+ DECIMAL: oo,
147
+ ZERO: P,
148
+ area: Mo,
149
+ areaIsZero: co,
150
+ aspect: To,
151
+ bottom: l,
152
+ bottomCenter: ao,
153
+ bottomLeft: yo,
154
+ bottomRight: uo,
155
+ box: V,
156
+ center: E,
157
+ centerLeft: wo,
158
+ centerRight: fo,
159
+ construct: c,
160
+ constructWithAlternateRoot: Bo,
161
+ contains: no,
162
+ copy: v,
163
+ css: ro,
164
+ cssBox: K,
165
+ dim: C,
166
+ dims: W,
167
+ domRect: Q,
168
+ edgePoints: ho,
169
+ equals: eo,
170
+ height: d,
171
+ intersection: Oo,
172
+ isBox: bo,
173
+ left: a,
174
+ loc: m,
175
+ positionInCenter: _o,
176
+ reRoot: go,
177
+ resize: to,
178
+ right: f,
179
+ root: lo,
180
+ round: Ro,
181
+ signedDims: so,
182
+ signedHeight: b,
183
+ signedWidth: _,
184
+ top: u,
185
+ topCenter: io,
186
+ topLeft: z,
187
+ topRight: xo,
188
+ translate: Eo,
189
+ truncate: Co,
190
+ width: w,
191
+ x: B,
192
+ xBounds: mo,
193
+ xyLoc: y,
194
+ y: R,
195
+ yBounds: po
196
+ }, Symbol.toStringTag, { value: "Module" }));
197
+ export {
198
+ Bo as a,
199
+ Ho as b,
200
+ c,
201
+ Mo as d,
202
+ bo as e,
203
+ mo as f,
204
+ d as h,
205
+ Oo as i,
206
+ w,
207
+ y as x,
208
+ po as y
209
+ };
@@ -0,0 +1 @@
1
+ "use strict";const y=require("zod"),R=require("./direction-386XDm2w.cjs"),u=require("./location-DZi8ftXp.cjs"),i=require("./xy-CUE3QDNn.cjs"),m=require("./base-BAM2mqCy.cjs"),p=y.z.union([y.z.number(),y.z.string()]),H=y.z.object({top:p,left:p,width:p,height:p}),W=y.z.object({left:y.z.number(),top:y.z.number(),right:y.z.number(),bottom:y.z.number()}),v=y.z.object({one:m.xy,two:m.xy,root:u.corner}),B={one:i.ZERO,two:i.ZERO,root:u.TOP_LEFT},S={one:i.ZERO,two:i.ONE,root:u.BOTTOM_LEFT},C=(t,o)=>({one:t.one,two:t.two,root:o??t.root}),c=(t,o,e=0,n=0,s)=>{const r={one:{...i.ZERO},two:{...i.ZERO},root:s??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))},G=(t,o,e)=>{const n=c(t);if(typeof o=="string"){if(e==null)throw new Error("Invalid arguments for resize");const s=R.construct(o);return c(n.one,void 0,s==="x"?e:l(n),s==="y"?e:w(n),n.root)}return c(n.one,o,void 0,void 0,n.root)},D=(t,o,e=!0)=>{const n=c(t);let s=(r,x)=>r<x;return e&&(s=(r,x)=>r<=x),"one"in o?s(a(n),a(o))&&s(_(o),_(n))&&s(f(n),f(o))&&s(h(o),h(n)):s(a(n),o.x)&&s(o.x,_(n))&&s(f(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),I=t=>({width:l(t),height:w(t)}),$=t=>({signedWidth:O(t),signedHeight:E(t)}),U=t=>({top:f(t),left:a(t),width:l(t),height:w(t)}),L=(t,o,e=!1)=>{const n=R.construct(o)==="y"?E(t):O(t);return e?n:Math.abs(n)},d=(t,o)=>{const e=c(t);return{x:o.x==="center"?b(e).x:g(e,o.x),y:o.y==="center"?b(e).y:g(e,o.y)}},g=(t,o)=>{const e=c(t),n=u.xyCouple(e.root).includes(o)?Math.min:Math.max;return m.X_LOCATIONS.includes(o)?n(e.one.x,e.two.x):n(e.one.y,e.two.y)},Y=t=>t.one.x===t.two.x&&t.one.y===t.two.y,l=t=>L(t,"x"),w=t=>L(t,"y"),O=t=>{const o=c(t);return o.two.x-o.one.x},E=t=>{const o=c(t);return o.two.y-o.one.y},q=t=>d(t,u.TOP_LEFT),k=t=>d(t,u.TOP_CENTER),J=t=>d(t,u.TOP_RIGHT),K=t=>d(t,u.BOTTOM_LEFT),Q=t=>d(t,u.BOTTOM_CENTER),V=t=>d(t,u.BOTTOM_RIGHT),tt=t=>d(t,u.CENTER_LEFT),ot=t=>d(t,u.CENTER_RIGHT),_=t=>g(t,"right"),h=t=>g(t,"bottom"),a=t=>g(t,"left"),f=t=>g(t,"top"),b=t=>i.translate(q(t),{x:O(t)/2,y:E(t)/2}),M=t=>{const o=c(t);return o.root.x==="left"?a(o):_(o)},z=t=>{const o=c(t);return o.root.y==="top"?f(o):h(o)},nt=t=>({x:M(t),y:z(t)}),N=t=>{const o=c(t);return{lower:o.one.x,upper:o.two.x}},P=t=>{const o=c(t);return{lower:o.one.y,upper:o.two.y}},et=(t,o)=>C(t,o),rt=(t,o)=>{const e=c(t),n=m.X_LOCATIONS.includes(o)?"x":m.Y_LOCATIONS.includes(o)?"y":null;if(n===null)throw new Error(`Invalid location: ${o}`);const s=o==="top"||o==="left"?Math.min:Math.max,r={...e.one},x={...e.two};return r[n]=s(e.one[n],e.two[n]),x[n]=s(e.one[n],e.two[n]),[r,x]},st=(t,o)=>{const e=c(t),n=c(o),s=M(n)+(l(n)-l(e))/2,r=z(n)+(w(n)-w(e))/2;return c({x:s,y:r},I(e))},Z=t=>typeof t!="object"||t==null?!1:"one"in t&&"two"in t&&"root"in t,ct=t=>l(t)/w(t),it=(t,o,e)=>{if(typeof o=="string"){if(e==null)throw new Error("Undefined amount passed into box.translate");const s=R.construct(o);o=i.construct(s,e)}const n=c(t);return c(i.translate(n.one,o),i.translate(n.two,o),void 0,void 0,n.root)},j=(t,o)=>{const e=Math.max(a(t),a(o)),n=Math.max(f(t),f(o)),s=Math.min(_(t),_(o)),r=Math.min(h(t),h(o));return e>s||n>r?B:c({x:e,y:n},{x:s,y:r},void 0,void 0,t.root)},A=t=>l(t)*w(t),ut=(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},T={x:t+e,y:o+n};return s.x!==r.x&&(s.x==="center"?(x.x-=e/2,T.x-=e/2):(x.x-=e,T.x-=e)),s.y!==r.y&&(s.y==="center"?(x.y-=n/2,T.y-=n/2):(x.y-=n,T.y-=n)),c(x,T,void 0,void 0,r)},xt=t=>{const o=c(t);return c(i.round(o.one),i.round(o.two),void 0,void 0,o.root)},yt=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:S,ZERO:B,area:A,areaIsZero:Y,aspect:ct,bottom:h,bottomCenter:Q,bottomLeft:K,bottomRight:V,box:v,center:b,centerLeft:tt,centerRight:ot,construct:c,constructWithAlternateRoot:F,contains:D,copy:C,css:U,cssBox:H,dim:L,dims:I,domRect:W,edgePoints:rt,equals:X,height:w,intersection:j,isBox:Z,left:a,loc:g,positionInCenter:st,reRoot:et,resize:G,right:_,root:nt,round:xt,signedDims:$,signedHeight:E,signedWidth:O,top:f,topCenter:k,topLeft:q,topRight:J,translate:it,truncate:ut,width:l,x:M,xBounds:N,xyLoc:d,y:z,yBounds:P},Symbol.toStringTag,{value:"Module"}));exports.area=A;exports.box=yt;exports.construct=c;exports.constructWithAlternateRoot=F;exports.height=w;exports.intersection=j;exports.isBox=Z;exports.width=l;exports.xBounds=N;exports.xyLoc=d;exports.yBounds=P;
package/dist/box.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./box-BcGdqkt4.cjs");exports.box=e.box;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./box-Cxki783Y.cjs");exports.box=e.box;
package/dist/box.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b as r } from "./box-D_qdUyEe.js";
1
+ import { b as r } from "./box-CO_2_DGG.js";
2
2
  export {
3
3
  r as box
4
4
  };
package/dist/compare.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-B1m2qvBT.cjs");exports.compare=e.compare;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DOJlZHqJ.cjs");exports.compare=e.compare;
package/dist/compare.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as a } from "./index-PNh31WTW.js";
1
+ import { c as a } from "./index-CBMHFqs4.js";
2
2
  export {
3
3
  a as compare
4
4
  };
package/dist/deep.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./identity.cjs"),y=require("./path-st_E5-LJ.cjs"),d=t=>JSON.parse(JSON.stringify(t)),j=(t,...l)=>(l.forEach(i=>{let r=t;const f=i.split(".");f.forEach((n,e)=>{typeof r!="object"||r===null||(e===f.length-1?delete r[n]:n in r&&(r=r[n]))})}),t),A=(t,l,i="")=>{const r={},f=(n,e,s)=>{if(typeof n!=typeof e||n===null||e===null){r[s]=[n,e];return}if(typeof n=="object"&&typeof e=="object")if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length){r[s]=[n,e];return}for(let o=0;o<n.length;o++)f(n[o],e[o],`${s}[${o}]`)}else new Set([...Object.keys(n),...Object.keys(e)]).forEach(c=>{f(n[c],e[c],s!==""?`${s}.${c}`:c)});else n!==e&&(r[s]=[n,e])};return f(t,l,i),r},p=(t,l)=>{const i=Array.isArray(t),r=Array.isArray(l);if(i!==r)return!1;if(i&&r){const e=t,s=l;if(e.length!==s.length)return!1;for(let o=0;o<e.length;o++)if(!p(e[o],s[o]))return!1;return!0}if(t==null||l==null||typeof t!="object"||typeof l!="object")return t===l;if("equals"in t)return t.equals(l);const f=Object.keys(t),n=Object.keys(l);if(f.length!==n.length)return!1;for(const e of f){const s=t[e],o=l[e];if(typeof s=="object"&&typeof o=="object"){if(!p(s,o))return!1}else if(s!==o)return!1}return!0},h=(t,l)=>{if(typeof t!="object"||t==null)return t===l;const i=Object.keys(t),r=Object.keys(l);if(r.length>i.length)return!1;for(const f of r){const n=t[f],e=l[f];if(typeof n=="object"&&typeof e=="object"){if(!h(n,e))return!1}else if(n!==e)return!1}return!0},a=(t,...l)=>{if(l.length===0)return t;const i=l.shift();if(u.isObject(t)&&u.isObject(i))for(const r in i)try{u.isObject(i[r])?(r in t||Object.assign(t,{[r]:{}}),a(t[r],i[r])):Object.assign(t,{[r]:i[r]})}catch(f){throw f instanceof TypeError?new TypeError(`.${r}: ${f.message}`):f}return a(t,...l)},k=(t,l,i)=>{const r=(f,n,e)=>{if(e.def?.type==="union")return e.def.options.reduce((s,o)=>r(s,n,o),f);if(e.def?.type==="intersection"){const s=r(f,n,e.def.left);return r(s,n,e.def.right)}for(const s in n){const o=n[s];let c=e?.shape;if(c!=null)for(;c!=null;){if(c[s]!=null){const g=c[s].safeParse(o);if(g.success){f[s]=g.data;break}}c=c.def?.shape}typeof o=="object"&&!Array.isArray(o)&&o!==null&&e&&e.shape&&e.shape[s]&&(f[s]||={},r(f[s],o,e.shape[s]))}return f};return r({...t},l,i)},O=Object.freeze(Object.defineProperty({__proto__:null,copy:d,deleteD:j,difference:A,element:y.element,equal:p,get:y.get,has:y.has,override:a,overrideValidItems:k,partialEqual:h,pathsMatch:y.pathsMatch,remove:y.remove,set:y.set,transformPath:y.transformPath},Symbol.toStringTag,{value:"Module"}));exports.deep=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./identity.cjs"),y=require("./path-BeMr8xWN.cjs"),d=t=>{try{return structuredClone(t)}catch{return console.warn("Failed to deep copy object, falling back to JSON.parse(JSON.stringify)",t),console.trace(),JSON.parse(JSON.stringify(t))}},j=(t,...f)=>(f.forEach(i=>{let r=t;const l=i.split(".");l.forEach((n,e)=>{typeof r!="object"||r===null||(e===l.length-1?delete r[n]:n in r&&(r=r[n]))})}),t),A=(t,f,i="")=>{const r={},l=(n,e,s)=>{if(typeof n!=typeof e||n===null||e===null){r[s]=[n,e];return}if(typeof n=="object"&&typeof e=="object")if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length){r[s]=[n,e];return}for(let o=0;o<n.length;o++)l(n[o],e[o],`${s}[${o}]`)}else new Set([...Object.keys(n),...Object.keys(e)]).forEach(c=>{l(n[c],e[c],s!==""?`${s}.${c}`:c)});else n!==e&&(r[s]=[n,e])};return l(t,f,i),r},p=(t,f)=>{const i=Array.isArray(t),r=Array.isArray(f);if(i!==r)return!1;if(i&&r){const e=t,s=f;if(e.length!==s.length)return!1;for(let o=0;o<e.length;o++)if(!p(e[o],s[o]))return!1;return!0}if(t==null||f==null||typeof t!="object"||typeof f!="object")return t===f;if("equals"in t)return t.equals(f);const l=Object.keys(t),n=Object.keys(f);if(l.length!==n.length)return!1;for(const e of l){const s=t[e],o=f[e];if(typeof s=="object"&&typeof o=="object"){if(!p(s,o))return!1}else if(s!==o)return!1}return!0},h=(t,f)=>{if(typeof t!="object"||t==null)return t===f;const i=Object.keys(t),r=Object.keys(f);if(r.length>i.length)return!1;for(const l of r){const n=t[l],e=f[l];if(typeof n=="object"&&typeof e=="object"){if(!h(n,e))return!1}else if(n!==e)return!1}return!0},a=(t,...f)=>{if(f.length===0)return t;const i=f.shift();if(u.isObject(t)&&u.isObject(i))for(const r in i)try{u.isObject(i[r])?(r in t||Object.assign(t,{[r]:{}}),a(t[r],i[r])):Object.assign(t,{[r]:i[r]})}catch(l){throw l instanceof TypeError?new TypeError(`.${r}: ${l.message}`):l}return a(t,...f)},k=(t,f,i)=>{const r=(l,n,e)=>{if(e.def?.type==="union")return e.def.options.reduce((s,o)=>r(s,n,o),l);if(e.def?.type==="intersection"){const s=r(l,n,e.def.left);return r(s,n,e.def.right)}for(const s in n){const o=n[s];let c=e?.shape;if(c!=null)for(;c!=null;){if(c[s]!=null){const g=c[s].safeParse(o);if(g.success){l[s]=g.data;break}}c=c.def?.shape}typeof o=="object"&&!Array.isArray(o)&&o!==null&&e&&e.shape&&e.shape[s]&&(l[s]||={},r(l[s],o,e.shape[s]))}return l};return r({...t},f,i)},O=Object.freeze(Object.defineProperty({__proto__:null,copy:d,deleteD:j,difference:A,element:y.element,equal:p,get:y.get,has:y.has,override:a,overrideValidItems:k,partialEqual:h,pathsMatch:y.pathsMatch,remove:y.remove,resolvePath:y.resolvePath,set:y.set,transformPath:y.transformPath},Symbol.toStringTag,{value:"Module"}));exports.deep=O;
package/dist/deep.js CHANGED
@@ -1,13 +1,22 @@
1
1
  import { isObject as y } from "./identity.js";
2
- import { e as h, g as d, h as A, p as j, r as k, s as V, t as E } from "./path-BXdMenka.js";
3
- const $ = (t) => JSON.parse(JSON.stringify(t)), w = (t, ...l) => (l.forEach((i) => {
2
+ import { e as h, g as d, h as A, p as j, r as k, a as V, s as w, t as E } from "./path-DVFrKaNI.js";
3
+ const O = (t) => {
4
+ try {
5
+ return structuredClone(t);
6
+ } catch {
7
+ return console.warn(
8
+ "Failed to deep copy object, falling back to JSON.parse(JSON.stringify)",
9
+ t
10
+ ), console.trace(), JSON.parse(JSON.stringify(t));
11
+ }
12
+ }, $ = (t, ...f) => (f.forEach((i) => {
4
13
  let r = t;
5
- const f = i.split(".");
6
- f.forEach((s, e) => {
7
- typeof r != "object" || r === null || (e === f.length - 1 ? delete r[s] : s in r && (r = r[s]));
14
+ const l = i.split(".");
15
+ l.forEach((s, e) => {
16
+ typeof r != "object" || r === null || (e === l.length - 1 ? delete r[s] : s in r && (r = r[s]));
8
17
  });
9
- }), t), q = (t, l, i = "") => {
10
- const r = {}, f = (s, e, n) => {
18
+ }), t), _ = (t, f, i = "") => {
19
+ const r = {}, l = (s, e, n) => {
11
20
  if (typeof s != typeof e || s === null || e === null) {
12
21
  r[n] = [s, e];
13
22
  return;
@@ -18,10 +27,10 @@ const $ = (t) => JSON.parse(JSON.stringify(t)), w = (t, ...l) => (l.forEach((i)
18
27
  r[n] = [s, e];
19
28
  return;
20
29
  }
21
- for (let o = 0; o < s.length; o++) f(s[o], e[o], `${n}[${o}]`);
30
+ for (let o = 0; o < s.length; o++) l(s[o], e[o], `${n}[${o}]`);
22
31
  } else
23
32
  (/* @__PURE__ */ new Set([...Object.keys(s), ...Object.keys(e)])).forEach((c) => {
24
- f(
33
+ l(
25
34
  s[c],
26
35
  e[c],
27
36
  n !== "" ? `${n}.${c}` : c
@@ -29,59 +38,59 @@ const $ = (t) => JSON.parse(JSON.stringify(t)), w = (t, ...l) => (l.forEach((i)
29
38
  });
30
39
  else s !== e && (r[n] = [s, e]);
31
40
  };
32
- return f(t, l, i), r;
33
- }, u = (t, l) => {
34
- const i = Array.isArray(t), r = Array.isArray(l);
41
+ return l(t, f, i), r;
42
+ }, u = (t, f) => {
43
+ const i = Array.isArray(t), r = Array.isArray(f);
35
44
  if (i !== r) return !1;
36
45
  if (i && r) {
37
- const e = t, n = l;
46
+ const e = t, n = f;
38
47
  if (e.length !== n.length) return !1;
39
48
  for (let o = 0; o < e.length; o++) if (!u(e[o], n[o])) return !1;
40
49
  return !0;
41
50
  }
42
- if (t == null || l == null || typeof t != "object" || typeof l != "object")
43
- return t === l;
44
- if ("equals" in t) return t.equals(l);
45
- const f = Object.keys(t), s = Object.keys(l);
46
- if (f.length !== s.length) return !1;
47
- for (const e of f) {
48
- const n = t[e], o = l[e];
51
+ if (t == null || f == null || typeof t != "object" || typeof f != "object")
52
+ return t === f;
53
+ if ("equals" in t) return t.equals(f);
54
+ const l = Object.keys(t), s = Object.keys(f);
55
+ if (l.length !== s.length) return !1;
56
+ for (const e of l) {
57
+ const n = t[e], o = f[e];
49
58
  if (typeof n == "object" && typeof o == "object") {
50
59
  if (!u(n, o)) return !1;
51
60
  } else if (n !== o) return !1;
52
61
  }
53
62
  return !0;
54
- }, g = (t, l) => {
55
- if (typeof t != "object" || t == null) return t === l;
56
- const i = Object.keys(t), r = Object.keys(l);
63
+ }, g = (t, f) => {
64
+ if (typeof t != "object" || t == null) return t === f;
65
+ const i = Object.keys(t), r = Object.keys(f);
57
66
  if (r.length > i.length) return !1;
58
- for (const f of r) {
59
- const s = t[f], e = l[f];
67
+ for (const l of r) {
68
+ const s = t[l], e = f[l];
60
69
  if (typeof s == "object" && typeof e == "object") {
61
70
  if (!g(s, e)) return !1;
62
71
  } else if (s !== e) return !1;
63
72
  }
64
73
  return !0;
65
- }, p = (t, ...l) => {
66
- if (l.length === 0) return t;
67
- const i = l.shift();
74
+ }, p = (t, ...f) => {
75
+ if (f.length === 0) return t;
76
+ const i = f.shift();
68
77
  if (y(t) && y(i))
69
78
  for (const r in i)
70
79
  try {
71
80
  y(i[r]) ? (r in t || Object.assign(t, { [r]: {} }), p(t[r], i[r])) : Object.assign(t, { [r]: i[r] });
72
- } catch (f) {
73
- throw f instanceof TypeError ? new TypeError(`.${r}: ${f.message}`) : f;
81
+ } catch (l) {
82
+ throw l instanceof TypeError ? new TypeError(`.${r}: ${l.message}`) : l;
74
83
  }
75
- return p(t, ...l);
76
- }, K = (t, l, i) => {
77
- const r = (f, s, e) => {
84
+ return p(t, ...f);
85
+ }, q = (t, f, i) => {
86
+ const r = (l, s, e) => {
78
87
  if (e.def?.type === "union")
79
88
  return e.def.options.reduce(
80
89
  (n, o) => r(n, s, o),
81
- f
90
+ l
82
91
  );
83
92
  if (e.def?.type === "intersection") {
84
- const n = r(f, s, e.def.left);
93
+ const n = r(l, s, e.def.left);
85
94
  return r(n, s, e.def.right);
86
95
  }
87
96
  for (const n in s) {
@@ -92,34 +101,35 @@ const $ = (t) => JSON.parse(JSON.stringify(t)), w = (t, ...l) => (l.forEach((i)
92
101
  if (c[n] != null) {
93
102
  const a = c[n].safeParse(o);
94
103
  if (a.success) {
95
- f[n] = a.data;
104
+ l[n] = a.data;
96
105
  break;
97
106
  }
98
107
  }
99
108
  c = c.def?.shape;
100
109
  }
101
- typeof o == "object" && !Array.isArray(o) && o !== null && e && e.shape && e.shape[n] && (f[n] ||= {}, r(f[n], o, e.shape[n]));
110
+ typeof o == "object" && !Array.isArray(o) && o !== null && e && e.shape && e.shape[n] && (l[n] ||= {}, r(l[n], o, e.shape[n]));
102
111
  }
103
- return f;
112
+ return l;
104
113
  };
105
- return r({ ...t }, l, i);
106
- }, m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
114
+ return r({ ...t }, f, i);
115
+ }, N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
107
116
  __proto__: null,
108
- copy: $,
109
- deleteD: w,
110
- difference: q,
117
+ copy: O,
118
+ deleteD: $,
119
+ difference: _,
111
120
  element: h,
112
121
  equal: u,
113
122
  get: d,
114
123
  has: A,
115
124
  override: p,
116
- overrideValidItems: K,
125
+ overrideValidItems: q,
117
126
  partialEqual: g,
118
127
  pathsMatch: j,
119
128
  remove: k,
120
- set: V,
129
+ resolvePath: V,
130
+ set: w,
121
131
  transformPath: E
122
132
  }, Symbol.toStringTag, { value: "Module" }));
123
133
  export {
124
- m as deep
134
+ N as deep
125
135
  };
@@ -1,5 +1,5 @@
1
1
  import u from "zod";
2
- import { t as i, g as f } from "./path-BXdMenka.js";
2
+ import { t as i, g as f } from "./path-DVFrKaNI.js";
3
3
  const m = (e) => e.nullable().transform((t) => t === null ? void 0 : t).optional(), p = (e) => u.array(e).or(e.transform((t) => [t])), s = (e) => i(e, (t, r, n) => {
4
4
  const l = r === n.length - 1, a = !isNaN(parseInt(t)), c = !isNaN(parseInt(n[r + 1]));
5
5
  return a && (t = "element"), l || c ? t : [t, "shape"];
@@ -1 +1 @@
1
- "use strict";const i=require("zod"),s=require("./path-st_E5-LJ.cjs"),f=e=>e.nullable().transform(t=>t===null?void 0:t).optional(),p=e=>i.array(e).or(e.transform(t=>[t])),c=e=>s.transformPath(e,(t,r,n)=>{const l=r===n.length-1,u=!isNaN(parseInt(t)),a=!isNaN(parseInt(n[r+1]));return u&&(t="element"),l||a?t:[t,"shape"]}),o=(e,t)=>{if(e==null)return null;const r=e[t];return r==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:r},y=(e,t,r)=>s.get(o(e,"shape"),c(t),{...r,getter:o}),m=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:y,getFieldSchemaPath:c,nullToUndefined:f,toArray:p},Symbol.toStringTag,{value:"Module"}));exports.external=m;
1
+ "use strict";const i=require("zod"),s=require("./path-BeMr8xWN.cjs"),f=e=>e.nullable().transform(t=>t===null?void 0:t).optional(),p=e=>i.array(e).or(e.transform(t=>[t])),c=e=>s.transformPath(e,(t,r,n)=>{const l=r===n.length-1,u=!isNaN(parseInt(t)),a=!isNaN(parseInt(n[r+1]));return u&&(t="element"),l||a?t:[t,"shape"]}),o=(e,t)=>{if(e==null)return null;const r=e[t];return r==null&&typeof e=="object"&&"sourceType"in e?e.sourceType()[t]:r},y=(e,t,r)=>s.get(o(e,"shape"),c(t),{...r,getter:o}),m=Object.freeze(Object.defineProperty({__proto__:null,getFieldSchema:y,getFieldSchemaPath:c,nullToUndefined:f,toArray:p},Symbol.toStringTag,{value:"Module"}));exports.external=m;