@synnaxlabs/x 0.44.3 → 0.44.4

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 (91) hide show
  1. package/.turbo/turbo-build.log +31 -35
  2. package/dist/base-BLNViP3D.cjs +1 -0
  3. package/dist/{base-DFq0vvGn.js → base-BORMP3mH.js} +14 -11
  4. package/dist/{bounds-8OC_obRs.js → bounds-BQqppNFf.js} +1 -1
  5. package/dist/{bounds-CRK04jp7.cjs → bounds-BXbqBINt.cjs} +1 -1
  6. package/dist/bounds.cjs +1 -1
  7. package/dist/bounds.js +1 -1
  8. package/dist/{box-CO_2_DGG.js → box-DRH5SOaY.js} +67 -73
  9. package/dist/box-qgxWXNhm.cjs +1 -0
  10. package/dist/box.cjs +1 -1
  11. package/dist/box.js +1 -1
  12. package/dist/{dimensions-CRgergMS.js → dimensions-RaRkesPq.js} +1 -1
  13. package/dist/{dimensions-D2QGoNXO.cjs → dimensions-qY12pyfC.cjs} +1 -1
  14. package/dist/dimensions.cjs +1 -1
  15. package/dist/dimensions.js +1 -1
  16. package/dist/direction-DKdfJwj7.js +19 -0
  17. package/dist/direction-XCdrc4is.cjs +1 -0
  18. package/dist/direction.cjs +1 -1
  19. package/dist/direction.js +1 -1
  20. package/dist/index.cjs +3 -3
  21. package/dist/index.js +59 -61
  22. package/dist/{location-Ar5y2DX2.js → location-CGLioInQ.js} +16 -21
  23. package/dist/location-DJ_K4SlP.cjs +1 -0
  24. package/dist/location.cjs +1 -1
  25. package/dist/location.js +1 -1
  26. package/dist/record-BwjIgrpU.cjs +1 -0
  27. package/dist/record-tSFQKmdG.js +19 -0
  28. package/dist/record.cjs +1 -1
  29. package/dist/record.js +1 -1
  30. package/dist/{scale-C3fEtXxW.cjs → scale-76Azh2EE.cjs} +1 -1
  31. package/dist/{scale-Db1Gunj0.js → scale-BhIvACdB.js} +4 -4
  32. package/dist/scale.cjs +1 -1
  33. package/dist/scale.js +1 -1
  34. package/dist/{series-Cl3Vh_u-.js → series-kgnLXSDr.js} +55 -39
  35. package/dist/{series-BcF7A8Je.cjs → series-tAhThbnz.cjs} +3 -3
  36. package/dist/{spatial-DGpZ2sO3.cjs → spatial-BsGadoUr.cjs} +1 -1
  37. package/dist/{spatial-BSWPzMkK.js → spatial-QY891r0E.js} +1 -1
  38. package/dist/spatial.cjs +1 -1
  39. package/dist/spatial.js +14 -16
  40. package/dist/src/record/record.d.ts +18 -0
  41. package/dist/src/record/record.d.ts.map +1 -1
  42. package/dist/src/spatial/base.d.ts +12 -0
  43. package/dist/src/spatial/base.d.ts.map +1 -1
  44. package/dist/src/spatial/direction/direction.d.ts +5 -1
  45. package/dist/src/spatial/direction/direction.d.ts.map +1 -1
  46. package/dist/src/spatial/external.d.ts +0 -1
  47. package/dist/src/spatial/external.d.ts.map +1 -1
  48. package/dist/src/spatial/xy/xy.d.ts +3 -0
  49. package/dist/src/spatial/xy/xy.d.ts.map +1 -1
  50. package/dist/src/telem/telem.d.ts +8 -0
  51. package/dist/src/telem/telem.d.ts.map +1 -1
  52. package/dist/telem.cjs +1 -1
  53. package/dist/telem.js +1 -1
  54. package/dist/xy-BKIJiLu_.cjs +1 -0
  55. package/dist/{xy-C_-hb3Q2.js → xy-CBuhMaIo.js} +41 -31
  56. package/dist/xy.cjs +1 -1
  57. package/dist/xy.js +1 -1
  58. package/package.json +3 -8
  59. package/src/record/record.spec.ts +31 -0
  60. package/src/record/record.ts +23 -0
  61. package/src/spatial/base.ts +4 -0
  62. package/src/spatial/direction/direction.spec.ts +35 -1
  63. package/src/spatial/direction/direction.ts +12 -0
  64. package/src/spatial/external.ts +0 -1
  65. package/src/spatial/xy/xy.spec.ts +124 -7
  66. package/src/spatial/xy/xy.ts +15 -2
  67. package/src/telem/telem.spec.ts +50 -0
  68. package/src/telem/telem.ts +25 -0
  69. package/tsconfig.tsbuildinfo +1 -1
  70. package/vite.config.ts +0 -1
  71. package/dist/base-BAM2mqCy.cjs +0 -1
  72. package/dist/box-Cxki783Y.cjs +0 -1
  73. package/dist/direction-386XDm2w.cjs +0 -1
  74. package/dist/direction-8etxfKaR.js +0 -17
  75. package/dist/location-DZi8ftXp.cjs +0 -1
  76. package/dist/position-DSy2hONH.cjs +0 -1
  77. package/dist/position-PQ6op54I.js +0 -85
  78. package/dist/position.cjs +0 -1
  79. package/dist/position.js +0 -4
  80. package/dist/record-CAcQ5PNX.js +0 -14
  81. package/dist/record-YvCh7bzB.cjs +0 -1
  82. package/dist/src/spatial/position/index.d.ts +0 -2
  83. package/dist/src/spatial/position/index.d.ts.map +0 -1
  84. package/dist/src/spatial/position/position.d.ts +0 -20
  85. package/dist/src/spatial/position/position.d.ts.map +0 -1
  86. package/dist/src/spatial/position/position.spec.d.ts +0 -2
  87. package/dist/src/spatial/position/position.spec.d.ts.map +0 -1
  88. package/dist/xy-CUE3QDNn.cjs +0 -1
  89. package/src/spatial/position/index.ts +0 -10
  90. package/src/spatial/position/position.spec.ts +0 -211
  91. package/src/spatial/position/position.ts +0 -157
@@ -1,11 +1,11 @@
1
1
 
2
- > @synnaxlabs/x@0.44.3 build /home/runner/work/synnax/synnax/x/ts
2
+ > @synnaxlabs/x@0.44.4 build /home/runner/work/synnax/synnax/x/ts
3
3
  > tsc --noEmit && vite build
4
4
 
5
5
   Synnax - Production mode
6
6
  vite v7.0.4 building for production...
7
7
  transforming...
8
- ✓ 147 modules transformed.
8
+ ✓ 145 modules transformed.
9
9
  Generated an empty chunk: "destructor".
10
10
  rendering chunks...
11
11
 
@@ -28,45 +28,43 @@ computing gzip size...
28
28
  dist/caseconv.js  0.07 kB │ gzip: 0.09 kB
29
29
  dist/runtime.js  0.08 kB │ gzip: 0.09 kB
30
30
  dist/dimensions.js  0.08 kB │ gzip: 0.08 kB
31
- dist/position.js  0.08 kB │ gzip: 0.09 kB
32
31
  dist/identity.js  0.10 kB │ gzip: 0.11 kB
33
32
  dist/array.js  0.24 kB │ gzip: 0.20 kB
34
- dist/spatial-BSWPzMkK.js  0.28 kB │ gzip: 0.23 kB
33
+ dist/spatial-QY891r0E.js  0.28 kB │ gzip: 0.23 kB
35
34
  dist/change-DLl6DccR.js  0.30 kB │ gzip: 0.23 kB
36
35
  dist/debounce.js  0.36 kB │ gzip: 0.18 kB
37
36
  dist/telem.js  0.41 kB │ gzip: 0.25 kB
38
37
  dist/link.js  0.44 kB │ gzip: 0.34 kB
39
38
  dist/index-D4NCYiQB.js  0.45 kB │ gzip: 0.30 kB
40
- dist/record-CAcQ5PNX.js  0.51 kB │ gzip: 0.32 kB
41
- dist/spatial.js  0.58 kB │ gzip: 0.29 kB
42
- dist/direction-8etxfKaR.js  0.67 kB │ gzip: 0.38 kB
39
+ dist/spatial.js  0.51 kB │ gzip: 0.26 kB
40
+ dist/record-tSFQKmdG.js  0.61 kB │ gzip: 0.37 kB
41
+ dist/direction-DKdfJwj7.js  0.76 kB │ gzip: 0.42 kB
43
42
  dist/external-BYuXBYJh.js  0.79 kB │ gzip: 0.34 kB
44
43
  dist/worker.js  0.87 kB │ gzip: 0.40 kB
45
44
  dist/external-BM_NS5yM.js  0.87 kB │ gzip: 0.52 kB
46
45
  dist/external-BPgtxa8d.js  0.99 kB │ gzip: 0.56 kB
47
46
  dist/observe.js  1.10 kB │ gzip: 0.48 kB
48
- dist/base-DFq0vvGn.js  1.23 kB │ gzip: 0.52 kB
49
- dist/dimensions-CRgergMS.js  1.49 kB │ gzip: 0.66 kB
47
+ dist/base-BORMP3mH.js  1.30 kB │ gzip: 0.54 kB
48
+ dist/dimensions-RaRkesPq.js  1.49 kB │ gzip: 0.66 kB
50
49
  dist/url.js  1.70 kB │ gzip: 0.76 kB
51
50
  dist/index-D2xcvEO5.js  1.86 kB │ gzip: 0.89 kB
52
- dist/position-PQ6op54I.js  2.23 kB │ gzip: 1.06 kB
53
51
  dist/index-B5l_quQn.js  2.56 kB │ gzip: 1.00 kB
54
52
  dist/path-Blh4wJuA.js  2.72 kB │ gzip: 0.97 kB
55
- dist/location-Ar5y2DX2.js  2.86 kB │ gzip: 1.18 kB
53
+ dist/location-CGLioInQ.js  2.80 kB │ gzip: 1.16 kB
56
54
  dist/index-CBMHFqs4.js  3.62 kB │ gzip: 1.37 kB
57
55
  dist/deep.js  3.93 kB │ gzip: 1.52 kB
58
- dist/xy-C_-hb3Q2.js  3.94 kB │ gzip: 1.47 kB
59
- dist/bounds-8OC_obRs.js  6.20 kB │ gzip: 2.09 kB
60
- dist/box-CO_2_DGG.js  6.44 kB │ gzip: 2.26 kB
61
- dist/scale-Db1Gunj0.js  6.49 kB │ gzip: 1.89 kB
62
- dist/index.js 27.17 kB │ gzip: 8.74 kB
63
- dist/series-Cl3Vh_u-.js 91.29 kB │ gzip: 19.32 kB
64
- [vite:dts] Declaration files built in 4531ms.
56
+ dist/xy-CBuhMaIo.js  4.31 kB │ gzip: 1.59 kB
57
+ dist/bounds-BQqppNFf.js  6.20 kB │ gzip: 2.09 kB
58
+ dist/box-DRH5SOaY.js  6.38 kB │ gzip: 2.23 kB
59
+ dist/scale-BhIvACdB.js  6.49 kB │ gzip: 1.89 kB
60
+ dist/index.js 27.11 kB │ gzip: 8.73 kB
61
+ dist/series-kgnLXSDr.js 91.88 kB │ gzip: 19.48 kB
62
+ [vite:dts] Declaration files built in 4552ms.
65
63
 
66
64
  Generated an empty chunk: "destructor".
67
65
  dist/destructor.cjs  0.01 kB │ gzip: 0.03 kB
68
66
  dist/xy.cjs  0.13 kB │ gzip: 0.14 kB
69
- dist/box.cjs  0.14 kB │ gzip: 0.15 kB
67
+ dist/box.cjs  0.14 kB │ gzip: 0.14 kB
70
68
  dist/scale.cjs  0.14 kB │ gzip: 0.15 kB
71
69
  dist/binary.cjs  0.14 kB │ gzip: 0.15 kB
72
70
  dist/unique.cjs  0.15 kB │ gzip: 0.15 kB
@@ -79,39 +77,37 @@ computing gzip size...
79
77
  dist/caseconv.cjs  0.15 kB │ gzip: 0.15 kB
80
78
  dist/runtime.cjs  0.15 kB │ gzip: 0.15 kB
81
79
  dist/location.cjs  0.15 kB │ gzip: 0.15 kB
82
- dist/position.cjs  0.15 kB │ gzip: 0.15 kB
83
80
  dist/direction.cjs  0.16 kB │ gzip: 0.15 kB
84
81
  dist/dimensions.cjs  0.16 kB │ gzip: 0.15 kB
85
82
  dist/identity.cjs  0.16 kB │ gzip: 0.15 kB
86
83
  dist/change-C-YELKx6.cjs  0.23 kB │ gzip: 0.20 kB
87
- dist/spatial-DGpZ2sO3.cjs  0.24 kB │ gzip: 0.21 kB
84
+ dist/spatial-BsGadoUr.cjs  0.24 kB │ gzip: 0.21 kB
88
85
  dist/array.cjs  0.25 kB │ gzip: 0.18 kB
89
86
  dist/index-udOjA9d-.cjs  0.32 kB │ gzip: 0.25 kB
90
87
  dist/debounce.cjs  0.33 kB │ gzip: 0.22 kB
91
- dist/record-YvCh7bzB.cjs  0.41 kB │ gzip: 0.28 kB
92
88
  dist/link.cjs  0.42 kB │ gzip: 0.30 kB
89
+ dist/record-BwjIgrpU.cjs  0.49 kB │ gzip: 0.33 kB
93
90
  dist/telem.cjs  0.54 kB │ gzip: 0.27 kB
94
- dist/direction-386XDm2w.cjs  0.56 kB │ gzip: 0.35 kB
91
+ dist/spatial.cjs  0.57 kB │ gzip: 0.31 kB
95
92
  dist/external-B9AAGv50.cjs  0.58 kB │ gzip: 0.30 kB
96
- dist/spatial.cjs  0.63 kB │ gzip: 0.33 kB
93
+ dist/direction-XCdrc4is.cjs  0.62 kB │ gzip: 0.38 kB
97
94
  dist/external-E3ErJeeM.cjs  0.68 kB │ gzip: 0.45 kB
98
95
  dist/worker.cjs  0.71 kB │ gzip: 0.39 kB
99
96
  dist/observe.cjs  0.76 kB │ gzip: 0.36 kB
100
97
  dist/external-uXk0Avrg.cjs  0.79 kB │ gzip: 0.49 kB
101
98
  dist/url.cjs  0.88 kB │ gzip: 0.51 kB
102
- dist/dimensions-D2QGoNXO.cjs  1.17 kB │ gzip: 0.58 kB
99
+ dist/dimensions-qY12pyfC.cjs  1.17 kB │ gzip: 0.58 kB
103
100
  dist/index-DdhM_E4k.cjs  1.35 kB │ gzip: 0.72 kB
104
- dist/base-BAM2mqCy.cjs  1.40 kB │ gzip: 0.58 kB
105
- dist/position-DSy2hONH.cjs  1.70 kB │ gzip: 0.94 kB
101
+ dist/base-BLNViP3D.cjs  1.47 kB │ gzip: 0.59 kB
106
102
  dist/index-BQe8OIgm.cjs  1.98 kB │ gzip: 0.90 kB
107
103
  dist/path-CPSfCjde.cjs  2.00 kB │ gzip: 0.88 kB
108
- dist/location-DZi8ftXp.cjs  2.49 kB │ gzip: 1.06 kB
104
+ dist/location-DJ_K4SlP.cjs  2.40 kB │ gzip: 1.04 kB
109
105
  dist/index-DOJlZHqJ.cjs  2.54 kB │ gzip: 1.12 kB
110
106
  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-C3fEtXxW.cjs  4.11 kB │ gzip: 1.47 kB
113
- dist/bounds-CRK04jp7.cjs  4.67 kB │ gzip: 1.85 kB
114
- dist/box-Cxki783Y.cjs  4.99 kB │ gzip: 2.02 kB
115
- dist/index.cjs 20.62 kB │ gzip: 7.68 kB
116
- dist/series-BcF7A8Je.cjs 38.89 kB │ gzip: 10.27 kB
117
- ✓ built in 5.37s
107
+ dist/xy-BKIJiLu_.cjs  3.14 kB │ gzip: 1.41 kB
108
+ dist/scale-76Azh2EE.cjs  4.11 kB │ gzip: 1.47 kB
109
+ dist/bounds-BXbqBINt.cjs  4.67 kB │ gzip: 1.85 kB
110
+ dist/box-qgxWXNhm.cjs  4.87 kB │ gzip: 1.99 kB
111
+ dist/index.cjs 20.56 kB │ gzip: 7.65 kB
112
+ dist/series-tAhThbnz.cjs 39.15 kB │ gzip: 10.36 kB
113
+ ✓ built in 5.33s
@@ -0,0 +1 @@
1
+ "use strict";const n=require("zod"),t=n.z.tuple([n.z.number(),n.z.number()]);n.z.tuple([n.z.bigint(),n.z.bigint()]);const d=n.z.object({width:n.z.number(),height:n.z.number()}),O=n.z.object({signedWidth:n.z.number(),signedHeight:n.z.number()}),g=["width","height"];n.z.enum(g);const c=["start","center","end"],N=["signedWidth","signedHeight"];n.z.enum(N);const L=n.z.object({x:n.z.number(),y:n.z.number()}),S=n.z.object({clientX:n.z.number(),clientY:n.z.number()}),s=["x","y"],o=n.z.enum(s),u=["top","right","bottom","left"],I=n.z.enum(u),r=["left","right"],l=n.z.enum(r),z=["top","bottom"],a=n.z.enum(z),e=["center"],T=n.z.enum(e),C=[...u,...e],i=n.z.enum(C),E=n.z.enum(c),m=["first","last"],h=n.z.enum(m),b=n.z.object({lower:n.z.number(),upper:n.z.number()}),p=n.z.object({lower:n.z.bigint(),upper:n.z.bigint()});n.z.union([b,t]);n.z.union([p,t]);const D=n.z.enum([...o.options,...i.options]);n.z.enum(["x","left","right"]);n.z.enum(["y","top","bottom"]);const A=n.z.union([o,i,n.z.instanceof(String)]);exports.ALIGNMENTS=c;exports.CENTER_LOCATIONS=e;exports.DIRECTIONS=s;exports.ORDERS=m;exports.X_LOCATIONS=r;exports.Y_LOCATIONS=z;exports.alignment=E;exports.bounds=b;exports.centerLocation=T;exports.clientXY=S;exports.crudeDirection=D;exports.crudeLocation=A;exports.dimensions=d;exports.direction=o;exports.location=i;exports.numberCouple=t;exports.order=h;exports.outerLocation=I;exports.signedDimensions=O;exports.xLocation=l;exports.xy=L;exports.yLocation=a;
@@ -1,38 +1,41 @@
1
1
  import { z as n } from "zod";
2
2
  const t = n.tuple([n.number(), n.number()]);
3
3
  n.tuple([n.bigint(), n.bigint()]);
4
- const S = n.object({ width: n.number(), height: n.number() }), h = n.object({
4
+ const p = n.object({ width: n.number(), height: n.number() }), N = n.object({
5
5
  signedWidth: n.number(),
6
6
  signedHeight: n.number()
7
7
  }), c = ["width", "height"];
8
8
  n.enum(c);
9
9
  const u = ["start", "center", "end"], r = ["signedWidth", "signedHeight"];
10
10
  n.enum(r);
11
- const p = n.object({ x: n.number(), y: n.number() }), I = n.object({ clientX: n.number(), clientY: n.number() }), a = ["x", "y"], o = n.enum(a), e = ["top", "right", "bottom", "left"], L = n.enum(e), m = ["left", "right"], C = n.enum(m), b = ["top", "bottom"], E = n.enum(b), s = ["center"], T = n.enum(s), g = [...e, ...s], i = n.enum(g), D = n.enum(u), d = ["first", "last"], j = n.enum(d), O = n.object({ lower: n.number(), upper: n.number() }), l = n.object({ lower: n.bigint(), upper: n.bigint() });
11
+ const S = n.object({ x: n.number(), y: n.number() }), I = n.object({ clientX: n.number(), clientY: n.number() }), m = ["x", "y"], o = n.enum(m), e = ["top", "right", "bottom", "left"], L = n.enum(e), a = ["left", "right"], C = n.enum(a), b = ["top", "bottom"], E = n.enum(b), s = ["center"], T = n.enum(s), g = [...e, ...s], i = n.enum(g), D = n.enum(u), d = ["first", "last"], f = n.enum(d), O = n.object({ lower: n.number(), upper: n.number() }), l = n.object({ lower: n.bigint(), upper: n.bigint() });
12
12
  n.union([O, t]);
13
13
  n.union([l, t]);
14
- const A = n.enum([...o.options, ...i.options]), f = n.union([o, i, n.instanceof(String)]);
14
+ const j = n.enum([...o.options, ...i.options]);
15
+ n.enum(["x", "left", "right"]);
16
+ n.enum(["y", "top", "bottom"]);
17
+ const x = n.union([o, i, n.instanceof(String)]);
15
18
  export {
16
19
  u as A,
17
20
  s as C,
18
- a as D,
21
+ m as D,
19
22
  d as O,
20
- m as X,
23
+ a as X,
21
24
  b as Y,
22
25
  D as a,
23
26
  o as b,
24
- A as c,
25
- S as d,
27
+ j as c,
28
+ p as d,
26
29
  C as e,
27
30
  T as f,
28
- f as g,
31
+ x as g,
29
32
  L as h,
30
33
  I as i,
31
34
  O as j,
32
35
  i as l,
33
36
  t as n,
34
- j as o,
35
- h as s,
36
- p as x,
37
+ f as o,
38
+ N as s,
39
+ S as x,
37
40
  E as y
38
41
  };
@@ -1,4 +1,4 @@
1
- import { j as x } from "./base-DFq0vvGn.js";
1
+ import { j as x } from "./base-BORMP3mH.js";
2
2
  const a = (r) => (e, n) => {
3
3
  if (typeof e == "bigint") {
4
4
  if (g(n))
@@ -1 +1 @@
1
- "use strict";const O=require("./base-BAM2mqCy.cjs"),d=r=>(e,n)=>{if(typeof e=="bigint"){if(b(n))return r(e,BigInt(n));const t=r(Number(e),Number(n));return typeof t=="number"?BigInt(Math.round(t)):t}return r(Number(e),Number(n))},m=d((r,e)=>r-e),h=d((r,e)=>r+e),j=(r,e,n=1e-4)=>Math.abs(r-e)<n,I=(r,e)=>{const n=typeof r=="bigint",t=typeof e=="bigint";return n&&t?r===e:n&&b(e)?r===BigInt(e):t&&b(r)?e===BigInt(r):r===e},P=r=>{const e=10**Math.floor(Math.log10(r));return Math.round(r/e)*e},x=d((r,e)=>r<=e?r:e),b=r=>typeof r=="bigint"?!0:Number.isInteger(r),T=d((r,e)=>r>=e?r:e),v=r=>typeof r=="bigint"?r<0n?-r:r:r<0?-r:r,z=d((r,e)=>r*e),E=d((r,e)=>r/e),u=(r,e,n)=>{const t={};if(typeof e=="object"&&(n=e,e=void 0),n={makeValid:!0,...n},typeof r=="number"||typeof r=="bigint")e!=null?(t.lower=r,t.upper=e):(t.lower=typeof r=="bigint"?0n:0,t.upper=r);else if(Array.isArray(r)){if(r.length!==2)throw new Error("bounds: expected array of length 2");[t.lower,t.upper]=r}else t.lower=r.lower,t.upper=r.upper;return n?.makeValid?B(t):t},q=Object.freeze({lower:0,upper:0}),D=Object.freeze({lower:-1/0,upper:1/0}),F=Object.freeze({lower:0,upper:1}),L=Object.freeze({lower:-1,upper:1}),Z=(r,e)=>{if(r==null&&e==null)return!0;if(r==null||e==null)return!1;const n=u(r),t=u(e);return n?.lower===t?.lower&&n?.upper===t?.upper},B=r=>r.lower>r.upper?{lower:r.upper,upper:r.lower}:r,_=(r,e)=>{const n=u(r);return e<n.lower?n.lower:e>=n.upper?n.upper-(typeof n.upper=="number"?1:1n):e},f=(r,e)=>{const n=u(r);if(typeof e=="number"||typeof e=="bigint")return e>=n.lower&&e<n.upper;const t=u(e);return t.lower>=n.lower&&t.upper<=n.upper},k=(r,e)=>{const n=u(r),t=u(e);return n.lower===t.lower?!0:t.upper===n.lower||t.lower===n.upper?!1:f(n,t.upper)||f(n,t.lower)||f(t,n.upper)||f(t,n.lower)},w=r=>{const e=u(r);return e.upper-e.lower},C=r=>{const e=u(r);return typeof e.lower=="bigint"?e.lower===0n&&e.upper===0n:e.lower===0&&e.upper===0},S=r=>{const e=w(r);return typeof e=="number"?e===0:e===0n},V=r=>{const e=u(r);return typeof e.lower=="bigint"?!0:Number.isFinite(e.lower)&&Number.isFinite(e.upper)},$=r=>{const e=u(r);return(e.upper+e.lower)/2},N=r=>({lower:Math.min(...r.map(e=>u(e).lower)),upper:Math.max(...r.map(e=>u(e).upper))}),R=r=>({lower:Math.max(...r.map(e=>u(e).lower)),upper:Math.min(...r.map(e=>u(e).upper))}),U=r=>{const e=u(r),n=typeof e.lower=="bigint";return Array.from({length:Number(w(r))},(t,o)=>n?e.lower+BigInt(o):e.lower+o)},y=(r,e)=>{const n=r.map(s=>u(s)),t=n.findIndex(s=>f(s,e)||e<s.lower);if(t===-1)return{index:r.length,position:0};const o=n[t];return f(o,e)?{index:t,position:Number(e-o.lower)}:{index:t,position:0}},g={removeBefore:0,removeAfter:0,insertInto:0,deleteInBetween:0},W=(r,e)=>{const n=r.map(l=>u(l)),t=u(e);if(n.length===0)return g;const o=y(n,t.lower),s=y(n,t.upper);if(o.index===r.length)return{...g,insertInto:r.length};if(s.index===0)return{...g,removeAfter:s.position};if(o.index===s.index)return o.position!==0&&s.position!==0?null:{removeAfter:s.position,removeBefore:o.position,insertInto:o.index,deleteInBetween:0};let i=s.index-o.index,c=o.index,p=m(Number(w(n[o.index])),o.position);return o.position!==0?(i-=1,c+=1):p=0,{removeBefore:p,removeAfter:s.position,insertInto:c,deleteInBetween:i}},M=(r,e,n)=>{const t=r.map(c=>u(c)),o=n>0?1:n<0?-1:0;if(o===0)return e;let s=n,i=e;for(;I(s,0)===!1;){const c=t.findIndex(p=>o>0?i>=p.lower&&i<p.upper:i>p.lower&&i<=p.upper);if(c!==-1){const p=t[c];let l;if(o>0?l=m(p.upper,i):l=m(i,p.lower),l>0){const a=x(v(s),l);if(i=h(i,o>0?a:-a),s=m(s,o>0?a:-a),I(s,0))return i;continue}}if(o>0){const p=t.filter(l=>l.lower>i);if(p.length>0)i=p[0].lower;else return i}else{const p=t.filter(l=>l.upper<i);if(p.length>0)i=p[p.length-1].upper;else return i}}return i},A=(r,e,n)=>{const t=r.map(i=>u(i));if(e===n)return typeof e=="bigint"?0n:0;const o=e<n?u([e,n]):u([n,e]);let s=typeof e=="bigint"?0n:0;for(const i of t){const c=i.lower>o.lower?i.lower:o.lower,p=i.upper<o.upper?i.upper:o.upper;if(c<p){const l=p-c;s=s+l}}return s},G=Object.freeze(Object.defineProperty({__proto__:null,CLIP:L,DECIMAL:F,INFINITE:D,ZERO:q,bounds:O.bounds,buildInsertionPlan:W,clamp:_,construct:u,contains:f,distance:A,equals:Z,findInsertPosition:y,isFinite:V,isZero:C,linspace:U,makeValid:B,max:N,mean:$,min:R,overlapsWith:k,span:w,spanIsZero:S,traverse:M},Symbol.toStringTag,{value:"Module"}));exports.abs=v;exports.add=h;exports.bounds=G;exports.clamp=_;exports.closeTo=j;exports.construct=u;exports.contains=f;exports.distance=A;exports.div=E;exports.equal=I;exports.isInteger=b;exports.max=N;exports.max$1=T;exports.min=x;exports.mult=z;exports.roundToNearestMagnitude=P;exports.span=w;exports.sub=m;exports.traverse=M;
1
+ "use strict";const O=require("./base-BLNViP3D.cjs"),d=r=>(e,n)=>{if(typeof e=="bigint"){if(b(n))return r(e,BigInt(n));const t=r(Number(e),Number(n));return typeof t=="number"?BigInt(Math.round(t)):t}return r(Number(e),Number(n))},m=d((r,e)=>r-e),h=d((r,e)=>r+e),j=(r,e,n=1e-4)=>Math.abs(r-e)<n,I=(r,e)=>{const n=typeof r=="bigint",t=typeof e=="bigint";return n&&t?r===e:n&&b(e)?r===BigInt(e):t&&b(r)?e===BigInt(r):r===e},P=r=>{const e=10**Math.floor(Math.log10(r));return Math.round(r/e)*e},x=d((r,e)=>r<=e?r:e),b=r=>typeof r=="bigint"?!0:Number.isInteger(r),T=d((r,e)=>r>=e?r:e),v=r=>typeof r=="bigint"?r<0n?-r:r:r<0?-r:r,z=d((r,e)=>r*e),E=d((r,e)=>r/e),u=(r,e,n)=>{const t={};if(typeof e=="object"&&(n=e,e=void 0),n={makeValid:!0,...n},typeof r=="number"||typeof r=="bigint")e!=null?(t.lower=r,t.upper=e):(t.lower=typeof r=="bigint"?0n:0,t.upper=r);else if(Array.isArray(r)){if(r.length!==2)throw new Error("bounds: expected array of length 2");[t.lower,t.upper]=r}else t.lower=r.lower,t.upper=r.upper;return n?.makeValid?B(t):t},q=Object.freeze({lower:0,upper:0}),D=Object.freeze({lower:-1/0,upper:1/0}),F=Object.freeze({lower:0,upper:1}),L=Object.freeze({lower:-1,upper:1}),Z=(r,e)=>{if(r==null&&e==null)return!0;if(r==null||e==null)return!1;const n=u(r),t=u(e);return n?.lower===t?.lower&&n?.upper===t?.upper},B=r=>r.lower>r.upper?{lower:r.upper,upper:r.lower}:r,_=(r,e)=>{const n=u(r);return e<n.lower?n.lower:e>=n.upper?n.upper-(typeof n.upper=="number"?1:1n):e},f=(r,e)=>{const n=u(r);if(typeof e=="number"||typeof e=="bigint")return e>=n.lower&&e<n.upper;const t=u(e);return t.lower>=n.lower&&t.upper<=n.upper},k=(r,e)=>{const n=u(r),t=u(e);return n.lower===t.lower?!0:t.upper===n.lower||t.lower===n.upper?!1:f(n,t.upper)||f(n,t.lower)||f(t,n.upper)||f(t,n.lower)},w=r=>{const e=u(r);return e.upper-e.lower},C=r=>{const e=u(r);return typeof e.lower=="bigint"?e.lower===0n&&e.upper===0n:e.lower===0&&e.upper===0},S=r=>{const e=w(r);return typeof e=="number"?e===0:e===0n},V=r=>{const e=u(r);return typeof e.lower=="bigint"?!0:Number.isFinite(e.lower)&&Number.isFinite(e.upper)},$=r=>{const e=u(r);return(e.upper+e.lower)/2},N=r=>({lower:Math.min(...r.map(e=>u(e).lower)),upper:Math.max(...r.map(e=>u(e).upper))}),R=r=>({lower:Math.max(...r.map(e=>u(e).lower)),upper:Math.min(...r.map(e=>u(e).upper))}),U=r=>{const e=u(r),n=typeof e.lower=="bigint";return Array.from({length:Number(w(r))},(t,o)=>n?e.lower+BigInt(o):e.lower+o)},y=(r,e)=>{const n=r.map(s=>u(s)),t=n.findIndex(s=>f(s,e)||e<s.lower);if(t===-1)return{index:r.length,position:0};const o=n[t];return f(o,e)?{index:t,position:Number(e-o.lower)}:{index:t,position:0}},g={removeBefore:0,removeAfter:0,insertInto:0,deleteInBetween:0},W=(r,e)=>{const n=r.map(l=>u(l)),t=u(e);if(n.length===0)return g;const o=y(n,t.lower),s=y(n,t.upper);if(o.index===r.length)return{...g,insertInto:r.length};if(s.index===0)return{...g,removeAfter:s.position};if(o.index===s.index)return o.position!==0&&s.position!==0?null:{removeAfter:s.position,removeBefore:o.position,insertInto:o.index,deleteInBetween:0};let i=s.index-o.index,c=o.index,p=m(Number(w(n[o.index])),o.position);return o.position!==0?(i-=1,c+=1):p=0,{removeBefore:p,removeAfter:s.position,insertInto:c,deleteInBetween:i}},M=(r,e,n)=>{const t=r.map(c=>u(c)),o=n>0?1:n<0?-1:0;if(o===0)return e;let s=n,i=e;for(;I(s,0)===!1;){const c=t.findIndex(p=>o>0?i>=p.lower&&i<p.upper:i>p.lower&&i<=p.upper);if(c!==-1){const p=t[c];let l;if(o>0?l=m(p.upper,i):l=m(i,p.lower),l>0){const a=x(v(s),l);if(i=h(i,o>0?a:-a),s=m(s,o>0?a:-a),I(s,0))return i;continue}}if(o>0){const p=t.filter(l=>l.lower>i);if(p.length>0)i=p[0].lower;else return i}else{const p=t.filter(l=>l.upper<i);if(p.length>0)i=p[p.length-1].upper;else return i}}return i},A=(r,e,n)=>{const t=r.map(i=>u(i));if(e===n)return typeof e=="bigint"?0n:0;const o=e<n?u([e,n]):u([n,e]);let s=typeof e=="bigint"?0n:0;for(const i of t){const c=i.lower>o.lower?i.lower:o.lower,p=i.upper<o.upper?i.upper:o.upper;if(c<p){const l=p-c;s=s+l}}return s},G=Object.freeze(Object.defineProperty({__proto__:null,CLIP:L,DECIMAL:F,INFINITE:D,ZERO:q,bounds:O.bounds,buildInsertionPlan:W,clamp:_,construct:u,contains:f,distance:A,equals:Z,findInsertPosition:y,isFinite:V,isZero:C,linspace:U,makeValid:B,max:N,mean:$,min:R,overlapsWith:k,span:w,spanIsZero:S,traverse:M},Symbol.toStringTag,{value:"Module"}));exports.abs=v;exports.add=h;exports.bounds=G;exports.clamp=_;exports.closeTo=j;exports.construct=u;exports.contains=f;exports.distance=A;exports.div=E;exports.equal=I;exports.isInteger=b;exports.max=N;exports.max$1=T;exports.min=x;exports.mult=z;exports.roundToNearestMagnitude=P;exports.span=w;exports.sub=m;exports.traverse=M;
package/dist/bounds.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bounds-CRK04jp7.cjs");exports.bounds=e.bounds;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bounds-BXbqBINt.cjs");exports.bounds=e.bounds;
package/dist/bounds.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b as r } from "./bounds-8OC_obRs.js";
1
+ import { b as r } from "./bounds-BQqppNFf.js";
2
2
  export {
3
3
  r as bounds
4
4
  };
@@ -1,75 +1,75 @@
1
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
2
+ import { c as O } from "./direction-DKdfJwj7.js";
3
+ import { c as A, T as C, B as j, x as S, a as Z, b as q, d as F, e as G, f as D, C as X, g as Y } from "./location-CGLioInQ.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-CBuhMaIo.js";
5
+ import { x as N, X as H, Y as J } from "./base-BORMP3mH.js";
6
+ const _ = x.union([x.number(), x.string()]), K = x.object({
7
+ top: _,
8
+ left: _,
9
+ width: _,
10
+ height: _
11
11
  }), Q = x.object({
12
12
  left: x.number(),
13
13
  top: x.number(),
14
14
  right: x.number(),
15
15
  bottom: x.number()
16
16
  }), V = x.object({
17
- one: j,
18
- two: j,
17
+ one: N,
18
+ two: N,
19
19
  root: A
20
- }), P = { one: g, two: g, root: M }, oo = { one: g, two: U, root: N }, v = (o, t) => ({
20
+ }), P = { one: g, two: g, root: C }, oo = { one: g, two: U, root: j }, v = (o, t) => ({
21
21
  one: o.one,
22
22
  two: o.two,
23
23
  root: t ?? o.root
24
- }), c = (o, t, e = 0, n = 0, r) => {
25
- const s = {
24
+ }), c = (o, t, e = 0, n = 0, s) => {
25
+ const r = {
26
26
  one: { ...g },
27
27
  two: { ...g },
28
- root: r ?? M
28
+ root: s ?? C
29
29
  };
30
30
  if (typeof o == "number") {
31
31
  if (typeof t != "number")
32
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;
33
+ return r.one = { x: o, y: t }, r.two = { x: r.one.x + e, y: r.one.y + n }, r;
34
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));
35
+ return "one" in o && "two" in o && "root" in o ? { ...o, root: s ?? o.root } : ("getBoundingClientRect" in o && (o = o.getBoundingClientRect()), "left" in o ? (r.one = { x: o.left, y: o.top }, r.two = { x: o.right, y: o.bottom }, r) : (r.one = o, t == null ? r.two = { x: r.one.x + e, y: r.one.y + n } : typeof t == "number" ? r.two = { x: r.one.x + t, y: r.one.y + e } : "width" in t ? r.two = {
36
+ x: r.one.x + t.width,
37
+ y: r.one.y + t.height
38
+ } : "signedWidth" in t ? r.two = {
39
+ x: r.one.x + t.signedWidth,
40
+ y: r.one.y + t.signedHeight
41
+ } : r.two = t, r));
42
42
  }, to = (o, t, e) => {
43
43
  const n = c(o);
44
44
  if (typeof t == "string") {
45
45
  if (e == null) throw new Error("Invalid arguments for resize");
46
- const r = O(t);
46
+ const s = O(t);
47
47
  return c(
48
48
  n.one,
49
49
  void 0,
50
- r === "x" ? e : w(n),
51
- r === "y" ? e : d(n),
50
+ s === "x" ? e : w(n),
51
+ s === "y" ? e : d(n),
52
52
  n.root
53
53
  );
54
54
  }
55
55
  return c(n.one, t, void 0, void 0, n.root);
56
56
  }, no = (o, t, e = !0) => {
57
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));
58
+ let s = (r, i) => r < i;
59
+ return e && (s = (r, i) => r <= i), "one" in t ? s(u(n), u(t)) && s(f(t), f(n)) && s(a(n), a(t)) && s(l(t), l(n)) : s(u(n), t.x) && s(t.x, f(n)) && s(a(n), t.y) && s(t.y, l(n));
60
60
  }, eo = (o, t) => I(o.one, t.one) && I(o.two, t.two) && S(o.root, t.root), W = (o) => ({
61
61
  width: w(o),
62
62
  height: d(o)
63
- }), so = (o) => ({
64
- signedWidth: _(o),
65
- signedHeight: b(o)
66
63
  }), ro = (o) => ({
67
- top: u(o),
68
- left: a(o),
64
+ signedWidth: h(o),
65
+ signedHeight: b(o)
66
+ }), so = (o) => ({
67
+ top: a(o),
68
+ left: u(o),
69
69
  width: w(o),
70
70
  height: d(o)
71
- }), C = (o, t, e = !1) => {
72
- const n = O(t) === "y" ? b(o) : _(o);
71
+ }), M = (o, t, e = !1) => {
72
+ const n = O(t) === "y" ? b(o) : h(o);
73
73
  return e ? n : Math.abs(n);
74
74
  }, y = (o, t) => {
75
75
  const e = c(o);
@@ -80,40 +80,40 @@ const h = x.union([x.number(), x.string()]), K = x.object({
80
80
  }, m = (o, t) => {
81
81
  const e = c(o), n = Z(e.root).includes(t) ? Math.min : Math.max;
82
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) => {
83
+ }, co = (o) => o.one.x === o.two.x && o.one.y === o.two.y, w = (o) => M(o, "x"), d = (o) => M(o, "y"), h = (o) => {
84
84
  const t = c(o);
85
85
  return t.two.x - t.one.x;
86
86
  }, b = (o) => {
87
87
  const t = c(o);
88
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,
89
+ }, z = (o) => y(o, C), io = (o) => y(o, q), xo = (o) => y(o, F), yo = (o) => y(o, j), uo = (o) => y(o, G), ao = (o) => y(o, D), wo = (o) => y(o, X), fo = (o) => y(o, Y), f = (o) => m(o, "right"), l = (o) => m(o, "bottom"), u = (o) => m(o, "left"), a = (o) => m(o, "top"), E = (o) => T(z(o), {
90
+ x: h(o) / 2,
91
91
  y: b(o) / 2
92
92
  }), B = (o) => {
93
93
  const t = c(o);
94
- return t.root.x === "left" ? a(t) : f(t);
94
+ return t.root.x === "left" ? u(t) : f(t);
95
95
  }, R = (o) => {
96
96
  const t = c(o);
97
- return t.root.y === "top" ? u(t) : l(t);
97
+ return t.root.y === "top" ? a(t) : l(t);
98
98
  }, lo = (o) => ({ x: B(o), y: R(o) }), mo = (o) => {
99
99
  const t = c(o);
100
100
  return { lower: t.one.x, upper: t.two.x };
101
101
  }, po = (o) => {
102
102
  const t = c(o);
103
103
  return { lower: t.one.y, upper: t.two.y };
104
- }, go = (o, t) => v(o, t), ho = (o, t) => {
104
+ }, go = (o, t) => v(o, t), _o = (o, t) => {
105
105
  const e = c(o), n = H.includes(t) ? "x" : J.includes(t) ? "y" : null;
106
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));
107
+ const s = t === "top" || t === "left" ? Math.min : Math.max, r = { ...e.one }, i = { ...e.two };
108
+ return r[n] = s(e.one[n], e.two[n]), i[n] = s(e.one[n], e.two[n]), [r, i];
109
+ }, ho = (o, t) => {
110
+ const e = c(o), n = c(t), s = B(n) + (w(n) - w(e)) / 2, r = R(n) + (d(n) - d(e)) / 2;
111
+ return c({ x: s, y: r }, W(e));
112
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
113
  if (typeof t == "string") {
114
114
  if (e == null) throw new Error("Undefined amount passed into box.translate");
115
- const r = O(t);
116
- t = k(r, e);
115
+ const s = O(t);
116
+ t = k(s, e);
117
117
  }
118
118
  const n = c(o);
119
119
  return c(
@@ -124,9 +124,9 @@ const h = x.union([x.number(), x.string()]), K = x.object({
124
124
  n.root
125
125
  );
126
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) => {
127
+ const e = Math.max(u(o), u(t)), n = Math.max(a(o), a(t)), s = Math.min(f(o), f(t)), r = Math.min(l(o), l(t));
128
+ return e > s || n > r ? P : c({ x: e, y: n }, { x: s, y: r }, void 0, void 0, o.root);
129
+ }, Co = (o) => w(o) * d(o), Mo = (o, t) => {
130
130
  const e = c(o);
131
131
  return c(
132
132
  L(e.one, t),
@@ -135,9 +135,9 @@ const h = x.union([x.number(), x.string()]), K = x.object({
135
135
  void 0,
136
136
  e.root
137
137
  );
138
- }, Bo = (o, t, e, n, r, s) => {
138
+ }, Bo = (o, t, e, n, s, r) => {
139
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);
140
+ return s.x !== r.x && (s.x === "center" ? (i.x -= e / 2, p.x -= e / 2) : (i.x -= e, p.x -= e)), s.y !== r.y && (s.y === "center" ? (i.y -= n / 2, p.y -= n / 2) : (i.y -= n, p.y -= n)), c(i, p, void 0, void 0, r);
141
141
  }, Ro = (o) => {
142
142
  const t = c(o);
143
143
  return c($(t.one), $(t.two), void 0, void 0, t.root);
@@ -145,13 +145,13 @@ const h = x.union([x.number(), x.string()]), K = x.object({
145
145
  __proto__: null,
146
146
  DECIMAL: oo,
147
147
  ZERO: P,
148
- area: Mo,
148
+ area: Co,
149
149
  areaIsZero: co,
150
150
  aspect: To,
151
151
  bottom: l,
152
- bottomCenter: ao,
152
+ bottomCenter: uo,
153
153
  bottomLeft: yo,
154
- bottomRight: uo,
154
+ bottomRight: ao,
155
155
  box: V,
156
156
  center: E,
157
157
  centerLeft: wo,
@@ -160,33 +160,33 @@ const h = x.union([x.number(), x.string()]), K = x.object({
160
160
  constructWithAlternateRoot: Bo,
161
161
  contains: no,
162
162
  copy: v,
163
- css: ro,
163
+ css: so,
164
164
  cssBox: K,
165
- dim: C,
165
+ dim: M,
166
166
  dims: W,
167
167
  domRect: Q,
168
- edgePoints: ho,
168
+ edgePoints: _o,
169
169
  equals: eo,
170
170
  height: d,
171
171
  intersection: Oo,
172
172
  isBox: bo,
173
- left: a,
173
+ left: u,
174
174
  loc: m,
175
- positionInCenter: _o,
175
+ positionInCenter: ho,
176
176
  reRoot: go,
177
177
  resize: to,
178
178
  right: f,
179
179
  root: lo,
180
180
  round: Ro,
181
- signedDims: so,
181
+ signedDims: ro,
182
182
  signedHeight: b,
183
- signedWidth: _,
184
- top: u,
183
+ signedWidth: h,
184
+ top: a,
185
185
  topCenter: io,
186
186
  topLeft: z,
187
187
  topRight: xo,
188
188
  translate: Eo,
189
- truncate: Co,
189
+ truncate: Mo,
190
190
  width: w,
191
191
  x: B,
192
192
  xBounds: mo,
@@ -195,15 +195,9 @@ const h = x.union([x.number(), x.string()]), K = x.object({
195
195
  yBounds: po
196
196
  }, Symbol.toStringTag, { value: "Module" }));
197
197
  export {
198
- Bo as a,
199
198
  Ho as b,
200
199
  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,
200
+ bo as i,
201
+ mo as x,
208
202
  po as y
209
203
  };
@@ -0,0 +1 @@
1
+ "use strict";const y=require("zod"),M=require("./direction-XCdrc4is.cjs"),u=require("./location-DJ_K4SlP.cjs"),i=require("./xy-BKIJiLu_.cjs"),m=require("./base-BLNViP3D.cjs"),p=y.z.union([y.z.number(),y.z.string()]),j=y.z.object({top:p,left:p,width:p,height:p}),F=y.z.object({left:y.z.number(),top:y.z.number(),right:y.z.number(),bottom:y.z.number()}),H=y.z.object({one:m.xy,two:m.xy,root:u.corner}),C={one:i.ZERO,two:i.ZERO,root:u.TOP_LEFT},v={one:i.ZERO,two:i.ONE,root:u.BOTTOM_LEFT},L=(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))},A=(t,o,e)=>{const n=c(t);if(typeof o=="string"){if(e==null)throw new Error("Invalid arguments for resize");const s=M.construct(o);return c(n.one,void 0,s==="x"?e:f(n),s==="y"?e:_(n),n.root)}return c(n.one,o,void 0,void 0,n.root)},S=(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(l(n),l(o))&&s(a(o),a(n))&&s(w(n),w(o))&&s(g(o),g(n)):s(l(n),o.x)&&s(o.x,a(n))&&s(w(n),o.y)&&s(o.y,g(n))},W=(t,o)=>i.equals(t.one,o.one)&&i.equals(t.two,o.two)&&u.xyEquals(t.root,o.root),I=t=>({width:f(t),height:_(t)}),G=t=>({signedWidth:O(t),signedHeight:E(t)}),D=t=>({top:w(t),left:l(t),width:f(t),height:_(t)}),R=(t,o,e=!1)=>{const n=M.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:T(e,o.x),y:o.y==="center"?b(e).y:T(e,o.y)}},T=(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)},X=t=>t.one.x===t.two.x&&t.one.y===t.two.y,f=t=>R(t,"x"),_=t=>R(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),$=t=>d(t,u.TOP_CENTER),U=t=>d(t,u.TOP_RIGHT),Y=t=>d(t,u.BOTTOM_LEFT),k=t=>d(t,u.BOTTOM_CENTER),J=t=>d(t,u.BOTTOM_RIGHT),K=t=>d(t,u.CENTER_LEFT),Q=t=>d(t,u.CENTER_RIGHT),a=t=>T(t,"right"),g=t=>T(t,"bottom"),l=t=>T(t,"left"),w=t=>T(t,"top"),b=t=>i.translate(q(t),{x:O(t)/2,y:E(t)/2}),z=t=>{const o=c(t);return o.root.x==="left"?l(o):a(o)},B=t=>{const o=c(t);return o.root.y==="top"?w(o):g(o)},V=t=>({x:z(t),y:B(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}},tt=(t,o)=>L(t,o),ot=(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]},nt=(t,o)=>{const e=c(t),n=c(o),s=z(n)+(f(n)-f(e))/2,r=B(n)+(_(n)-_(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,et=t=>f(t)/_(t),rt=(t,o,e)=>{if(typeof o=="string"){if(e==null)throw new Error("Undefined amount passed into box.translate");const s=M.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)},st=(t,o)=>{const e=Math.max(l(t),l(o)),n=Math.max(w(t),w(o)),s=Math.min(a(t),a(o)),r=Math.min(g(t),g(o));return e>s||n>r?C:c({x:e,y:n},{x:s,y:r},void 0,void 0,t.root)},ct=t=>f(t)*_(t),it=(t,o)=>{const e=c(t);return c(i.truncate(e.one,o),i.truncate(e.two,o),void 0,void 0,e.root)},ut=(t,o,e,n,s,r)=>{const x={x:t,y:o},h={x:t+e,y:o+n};return s.x!==r.x&&(s.x==="center"?(x.x-=e/2,h.x-=e/2):(x.x-=e,h.x-=e)),s.y!==r.y&&(s.y==="center"?(x.y-=n/2,h.y-=n/2):(x.y-=n,h.y-=n)),c(x,h,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:v,ZERO:C,area:ct,areaIsZero:X,aspect:et,bottom:g,bottomCenter:k,bottomLeft:Y,bottomRight:J,box:H,center:b,centerLeft:K,centerRight:Q,construct:c,constructWithAlternateRoot:ut,contains:S,copy:L,css:D,cssBox:j,dim:R,dims:I,domRect:F,edgePoints:ot,equals:W,height:_,intersection:st,isBox:Z,left:l,loc:T,positionInCenter:nt,reRoot:tt,resize:A,right:a,root:V,round:xt,signedDims:G,signedHeight:E,signedWidth:O,top:w,topCenter:$,topLeft:q,topRight:U,translate:rt,truncate:it,width:f,x:z,xBounds:N,xyLoc:d,y:B,yBounds:P},Symbol.toStringTag,{value:"Module"}));exports.box=yt;exports.construct=c;exports.isBox=Z;exports.xBounds=N;exports.yBounds=P;
package/dist/box.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./box-Cxki783Y.cjs");exports.box=e.box;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./box-qgxWXNhm.cjs");exports.box=e.box;
package/dist/box.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b as r } from "./box-CO_2_DGG.js";
1
+ import { b as r } from "./box-DRH5SOaY.js";
2
2
  export {
3
3
  r as box
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import { z as h } from "zod";
2
- import { d as o, x as g, n as a } from "./base-DFq0vvGn.js";
2
+ import { d as o, x as g, n as a } from "./base-BORMP3mH.js";
3
3
  const r = h.object({ signedWidth: h.number(), signedHeight: h.number() }), c = h.union([o, r, g, a]), u = { width: 0, height: 0 }, m = { width: 1, height: 1 }, n = (t, e) => typeof t == "number" ? { width: t, height: e ?? t } : Array.isArray(t) ? { width: t[0], height: t[1] } : "x" in t ? { width: t.x, height: t.y } : "signedWidth" in t ? { width: t.signedWidth, height: t.signedHeight } : { ...t }, d = (t, e) => {
4
4
  if (e == null) return !1;
5
5
  const i = n(t), s = n(e);
@@ -1 +1 @@
1
- "use strict";const h=require("zod"),s=require("./base-BAM2mqCy.cjs"),o=h.z.object({signedWidth:h.z.number(),signedHeight:h.z.number()}),g=h.z.union([s.dimensions,o,s.xy,s.numberCouple]),c={width:0,height:0},u={width:1,height:1},n=(t,e)=>typeof t=="number"?{width:t,height:e??t}:Array.isArray(t)?{width:t[0],height:t[1]}:"x"in t?{width:t.x,height:t.y}:"signedWidth"in t?{width:t.signedWidth,height:t.signedHeight}:{...t},a=(t,e)=>{if(e==null)return!1;const i=n(t),r=n(e);return i.width===r.width&&i.height===r.height},d=t=>{const e=n(t);return{width:e.height,height:e.width}},m=t=>{const e=n(t);return`0 0 ${e.width} ${e.height}`},l=t=>{const e=n(t);return[e.width,e.height]},p=t=>({width:Math.max(...t.map(e=>n(e).width)),height:Math.max(...t.map(e=>n(e).height))}),b=t=>({width:Math.min(...t.map(e=>n(e).width)),height:Math.min(...t.map(e=>n(e).height))}),f=(t,e)=>{const i=n(t);return{width:i.width*e,height:i.height*e}},w=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:u,ZERO:c,construct:n,couple:l,crude:g,dimensions:s.dimensions,equals:a,max:p,min:b,scale:f,signed:o,svgViewBox:m,swap:d},Symbol.toStringTag,{value:"Module"}));exports.dimensions=w;
1
+ "use strict";const h=require("zod"),s=require("./base-BLNViP3D.cjs"),o=h.z.object({signedWidth:h.z.number(),signedHeight:h.z.number()}),g=h.z.union([s.dimensions,o,s.xy,s.numberCouple]),c={width:0,height:0},u={width:1,height:1},n=(t,e)=>typeof t=="number"?{width:t,height:e??t}:Array.isArray(t)?{width:t[0],height:t[1]}:"x"in t?{width:t.x,height:t.y}:"signedWidth"in t?{width:t.signedWidth,height:t.signedHeight}:{...t},a=(t,e)=>{if(e==null)return!1;const i=n(t),r=n(e);return i.width===r.width&&i.height===r.height},d=t=>{const e=n(t);return{width:e.height,height:e.width}},m=t=>{const e=n(t);return`0 0 ${e.width} ${e.height}`},l=t=>{const e=n(t);return[e.width,e.height]},p=t=>({width:Math.max(...t.map(e=>n(e).width)),height:Math.max(...t.map(e=>n(e).height))}),b=t=>({width:Math.min(...t.map(e=>n(e).width)),height:Math.min(...t.map(e=>n(e).height))}),f=(t,e)=>{const i=n(t);return{width:i.width*e,height:i.height*e}},w=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:u,ZERO:c,construct:n,couple:l,crude:g,dimensions:s.dimensions,equals:a,max:p,min:b,scale:f,signed:o,svgViewBox:m,swap:d},Symbol.toStringTag,{value:"Module"}));exports.dimensions=w;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dimensions-D2QGoNXO.cjs");exports.dimensions=e.dimensions;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dimensions-qY12pyfC.cjs");exports.dimensions=e.dimensions;
@@ -1,4 +1,4 @@
1
- import { d } from "./dimensions-CRgergMS.js";
1
+ import { d } from "./dimensions-RaRkesPq.js";
2
2
  export {
3
3
  d as dimensions
4
4
  };
@@ -0,0 +1,19 @@
1
+ import { c as i, D as n, Y as o, b as r } from "./base-BORMP3mH.js";
2
+ const s = i, t = (e) => n.includes(e) ? e : o.includes(e) ? "y" : "x", c = (e) => t(e) === "x" ? "y" : "x", d = (e) => t(e) === "x" ? "width" : "height", u = (e) => t(e) === "x" ? "left" : "top", a = (e) => s.safeParse(e).success, l = (e) => t(e) === "x" ? "signedWidth" : "signedHeight", f = (e) => e === "center" ? !1 : t(e) === "x", x = (e) => t(e) === "y", p = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3
+ __proto__: null,
4
+ DIRECTIONS: n,
5
+ construct: t,
6
+ crude: s,
7
+ dimension: d,
8
+ direction: r,
9
+ isDirection: a,
10
+ isX: f,
11
+ isY: x,
12
+ location: u,
13
+ signedDimension: l,
14
+ swap: c
15
+ }, Symbol.toStringTag, { value: "Module" }));
16
+ export {
17
+ t as c,
18
+ p as d
19
+ };
@@ -0,0 +1 @@
1
+ "use strict";const n=require("./base-BLNViP3D.cjs"),i=n.crudeDirection,t=e=>n.DIRECTIONS.includes(e)?e:n.Y_LOCATIONS.includes(e)?"y":"x",s=e=>t(e)==="x"?"y":"x",c=e=>t(e)==="x"?"width":"height",o=e=>t(e)==="x"?"left":"top",r=e=>i.safeParse(e).success,u=e=>t(e)==="x"?"signedWidth":"signedHeight",d=e=>e==="center"?!1:t(e)==="x",l=e=>t(e)==="y",a=Object.freeze(Object.defineProperty({__proto__:null,DIRECTIONS:n.DIRECTIONS,construct:t,crude:i,dimension:c,direction:n.direction,isDirection:r,isX:d,isY:l,location:o,signedDimension:u,swap:s},Symbol.toStringTag,{value:"Module"}));exports.construct=t;exports.direction=a;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./direction-386XDm2w.cjs");exports.direction=e.direction;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./direction-XCdrc4is.cjs");exports.direction=e.direction;
package/dist/direction.js CHANGED
@@ -1,4 +1,4 @@
1
- import { d } from "./direction-8etxfKaR.js";
1
+ import { d } from "./direction-DKdfJwj7.js";
2
2
  export {
3
3
  d as direction
4
4
  };