@synnaxlabs/x 0.24.1 → 0.25.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.
Files changed (161) hide show
  1. package/.turbo/turbo-build.log +40 -41
  2. package/dist/binary.cjs +3 -3
  3. package/dist/binary.js +35 -35
  4. package/dist/bounds-CpboA0q6.js +127 -0
  5. package/dist/bounds-ZZc1c-_Z.cjs +1 -0
  6. package/dist/bounds.cjs +1 -1
  7. package/dist/bounds.js +1 -1
  8. package/dist/{box-m3dlc1kR.cjs → box-BcFruCBW.cjs} +1 -1
  9. package/dist/{box-C92jYSNY.js → box-DC5oviHL.js} +5 -8
  10. package/dist/box.cjs +1 -1
  11. package/dist/box.js +1 -1
  12. package/dist/caseconv.cjs +1 -1
  13. package/dist/caseconv.js +1 -1
  14. package/dist/compare.cjs +1 -1
  15. package/dist/compare.js +1 -1
  16. package/dist/deep.cjs +1 -1
  17. package/dist/deep.js +35 -51
  18. package/dist/{dimensions-BAuHfd-b.js → dimensions-D-1PnJVI.js} +1 -2
  19. package/dist/dimensions.js +1 -1
  20. package/dist/{external-DI9122wF.js → external-CO221aaF.js} +4 -8
  21. package/dist/index-2SfxIaaU.cjs +1 -0
  22. package/dist/index-CQk9JICS.js +41 -0
  23. package/dist/{index-BhEWuRmo.cjs → index-CvHP07Bs.cjs} +1 -1
  24. package/dist/{index-IGDDLWef.js → index-DCwgKLH_.js} +7 -13
  25. package/dist/index.cjs +2 -2
  26. package/dist/index.js +135 -120
  27. package/dist/{location-CfP9TAnW.js → location-D4yS2DfR.js} +1 -1
  28. package/dist/{location-c3g6WKs-.cjs → location-wMqTcQ0n.cjs} +1 -1
  29. package/dist/location.cjs +1 -1
  30. package/dist/location.js +1 -1
  31. package/dist/observe.cjs +1 -1
  32. package/dist/observe.js +2 -3
  33. package/dist/path-Coj1BKMh.cjs +1 -0
  34. package/dist/path-DH9iaDDf.js +58 -0
  35. package/dist/{position-BBnkwGX1.cjs → position-DolPXOLe.cjs} +1 -1
  36. package/dist/{position-B_aphAR0.js → position-DvsYXRzE.js} +4 -6
  37. package/dist/position.cjs +1 -1
  38. package/dist/position.js +1 -1
  39. package/dist/runtime.js +1 -1
  40. package/dist/{scale-CgtgqlYU.js → scale-6y6-BcVI.js} +42 -40
  41. package/dist/scale-D_uVU2Fw.cjs +1 -0
  42. package/dist/scale.cjs +1 -1
  43. package/dist/scale.js +1 -1
  44. package/dist/search.js +1 -2
  45. package/dist/{series-w7kOJP17.js → series-B3wKdjpi.js} +118 -141
  46. package/dist/series-PoUlr-RX.cjs +11 -0
  47. package/dist/spatial.cjs +1 -1
  48. package/dist/spatial.js +7 -7
  49. package/dist/src/binary/encoder.d.ts.map +1 -1
  50. package/dist/src/caseconv/caseconv.d.ts +41 -4
  51. package/dist/src/caseconv/caseconv.d.ts.map +1 -1
  52. package/dist/src/caseconv/caseconv.spec.d.ts +2 -0
  53. package/dist/src/caseconv/caseconv.spec.d.ts.map +1 -0
  54. package/dist/src/change/change.d.ts.map +1 -1
  55. package/dist/src/clamp/clamp.d.ts +3 -1
  56. package/dist/src/clamp/clamp.d.ts.map +1 -1
  57. package/dist/src/compare/compare.d.ts +1 -1
  58. package/dist/src/compare/compare.d.ts.map +1 -1
  59. package/dist/src/control/control.d.ts.map +1 -1
  60. package/dist/src/debounce/debounce.d.ts.map +1 -1
  61. package/dist/src/deep/copy.d.ts.map +1 -1
  62. package/dist/src/deep/delete.d.ts.map +1 -1
  63. package/dist/src/deep/difference.d.ts.map +1 -1
  64. package/dist/src/deep/equal.d.ts +8 -2
  65. package/dist/src/deep/equal.d.ts.map +1 -1
  66. package/dist/src/deep/merge.d.ts +1 -1
  67. package/dist/src/deep/merge.d.ts.map +1 -1
  68. package/dist/src/deep/path.d.ts +1 -3
  69. package/dist/src/deep/path.d.ts.map +1 -1
  70. package/dist/src/errors/errors.d.ts +12 -0
  71. package/dist/src/errors/errors.d.ts.map +1 -0
  72. package/dist/src/errors/index.d.ts +2 -0
  73. package/dist/src/errors/index.d.ts.map +1 -0
  74. package/dist/src/id/id.d.ts +4 -0
  75. package/dist/src/id/id.d.ts.map +1 -0
  76. package/dist/src/id/index.d.ts +2 -0
  77. package/dist/src/id/index.d.ts.map +1 -0
  78. package/dist/src/identity.d.ts.map +1 -1
  79. package/dist/src/index.d.ts +2 -0
  80. package/dist/src/index.d.ts.map +1 -1
  81. package/dist/src/math/math.d.ts.map +1 -1
  82. package/dist/src/migrate/migrate.d.ts +3 -3
  83. package/dist/src/migrate/migrate.d.ts.map +1 -1
  84. package/dist/src/mock/MockGLBufferController.d.ts +1 -1
  85. package/dist/src/numeric/index.d.ts +2 -0
  86. package/dist/src/numeric/index.d.ts.map +1 -0
  87. package/dist/src/numeric/numeric.d.ts +3 -0
  88. package/dist/src/numeric/numeric.d.ts.map +1 -0
  89. package/dist/src/record.d.ts +1 -1
  90. package/dist/src/record.d.ts.map +1 -1
  91. package/dist/src/runtime/os.d.ts.map +1 -1
  92. package/dist/src/search.d.ts +1 -1
  93. package/dist/src/search.d.ts.map +1 -1
  94. package/dist/src/shallowCopy.d.ts.map +1 -1
  95. package/dist/src/spatial/bounds/bounds.d.ts +19 -17
  96. package/dist/src/spatial/bounds/bounds.d.ts.map +1 -1
  97. package/dist/src/spatial/box/box.d.ts +1 -14
  98. package/dist/src/spatial/box/box.d.ts.map +1 -1
  99. package/dist/src/spatial/dimensions/dimensions.d.ts +1 -1
  100. package/dist/src/spatial/direction/direction.d.ts +1 -1
  101. package/dist/src/spatial/direction/direction.d.ts.map +1 -1
  102. package/dist/src/spatial/location/location.d.ts +3 -3
  103. package/dist/src/spatial/location/location.d.ts.map +1 -1
  104. package/dist/src/spatial/position/position.d.ts +2 -2
  105. package/dist/src/spatial/position/position.d.ts.map +1 -1
  106. package/dist/src/spatial/scale/scale.d.ts +27 -23
  107. package/dist/src/spatial/scale/scale.d.ts.map +1 -1
  108. package/dist/src/spatial/xy/xy.d.ts +1 -1
  109. package/dist/src/spatial/xy/xy.d.ts.map +1 -1
  110. package/dist/src/telem/series.d.ts +3 -3
  111. package/dist/src/telem/series.d.ts.map +1 -1
  112. package/dist/src/telem/telem.d.ts +2 -2
  113. package/dist/src/telem/telem.d.ts.map +1 -1
  114. package/dist/src/toArray.d.ts.map +1 -1
  115. package/dist/src/unique.d.ts.map +1 -1
  116. package/dist/src/url/url.d.ts.map +1 -1
  117. package/dist/src/zodutil/zodutil.d.ts +1 -1
  118. package/dist/telem.cjs +1 -1
  119. package/dist/telem.js +1 -1
  120. package/dist/url.cjs +1 -1
  121. package/dist/url.js +1 -1
  122. package/dist/worker.cjs +1 -1
  123. package/dist/worker.js +1 -1
  124. package/dist/{xy-D1ZbIqpT.js → xy-CrgPnICw.js} +1 -2
  125. package/dist/xy.js +1 -1
  126. package/dist/zodutil.cjs +1 -1
  127. package/dist/zodutil.js +2 -3
  128. package/package.json +7 -7
  129. package/src/binary/encoder.spec.ts +1 -1
  130. package/src/binary/encoder.ts +4 -2
  131. package/src/caseconv/caseconv.spec.ts +121 -0
  132. package/src/caseconv/caseconv.ts +114 -14
  133. package/src/clamp/clamp.ts +5 -3
  134. package/src/compare/compare.ts +2 -2
  135. package/src/deep/delete.spec.ts +38 -1
  136. package/src/deep/delete.ts +1 -2
  137. package/src/deep/path.ts +0 -7
  138. package/src/errors/errors.ts +17 -0
  139. package/src/errors/index.ts +1 -0
  140. package/src/id/id.ts +14 -0
  141. package/src/id/index.ts +10 -0
  142. package/src/index.ts +2 -0
  143. package/src/numeric/index.ts +1 -0
  144. package/src/numeric/numeric.ts +6 -0
  145. package/src/record.ts +1 -1
  146. package/src/spatial/bounds/bounds.spec.ts +47 -0
  147. package/src/spatial/bounds/bounds.ts +36 -20
  148. package/src/spatial/scale/scale.spec.ts +5 -5
  149. package/src/spatial/scale/scale.ts +75 -59
  150. package/src/telem/series.ts +9 -6
  151. package/src/telem/telem.spec.ts +24 -1
  152. package/src/telem/telem.ts +1 -1
  153. package/tsconfig.tsbuildinfo +1 -1
  154. package/dist/bounds-Bh_QBZZK.cjs +0 -1
  155. package/dist/bounds-Dmn-hd_-.js +0 -129
  156. package/dist/index-BpCPHf78.cjs +0 -1
  157. package/dist/index-BwkQTA-j.js +0 -360
  158. package/dist/path-BO4pyGZf.cjs +0 -1
  159. package/dist/path-nTHmt_4i.js +0 -65
  160. package/dist/scale-C8axypQ2.cjs +0 -1
  161. package/dist/series-Cgjkfl5S.cjs +0 -11
package/dist/deep.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { isObject as y } from "./identity.js";
2
- import { e as g, g as j, h, j as A, p as d, a as k, b as O, s as V, t as E } from "./path-nTHmt_4i.js";
3
- const $ = (t) => JSON.parse(JSON.stringify(t)), T = (t, ...n) => (n.forEach((i) => {
2
+ import { e as g, g as j, h, j as A, p as d, s as O, t as k } from "./path-DH9iaDDf.js";
3
+ const V = (t) => JSON.parse(JSON.stringify(t)), E = (t, ...n) => (n.forEach((i) => {
4
4
  let s = t;
5
5
  const f = i.split(".");
6
6
  f.forEach((r, e) => {
7
- e === f.length - 1 ? delete s[r] : s = s[r];
7
+ e === f.length - 1 ? delete s[r] : r in s && (s = s[r]);
8
8
  });
9
- }), t), q = (t, n, i = "") => {
9
+ }), t), $ = (t, n, i = "") => {
10
10
  const s = {}, f = (r, e, o) => {
11
11
  if (typeof r != typeof e || r === null || e === null) {
12
12
  s[o] = [r, e];
@@ -28,94 +28,78 @@ const $ = (t) => JSON.parse(JSON.stringify(t)), T = (t, ...n) => (n.forEach((i)
28
28
  r !== e && (s[o] = [r, e]);
29
29
  };
30
30
  return f(t, n, i), s;
31
- }, a = (t, n) => {
31
+ }, p = (t, n) => {
32
32
  const i = Array.isArray(t), s = Array.isArray(n);
33
- if (i !== s)
34
- return !1;
33
+ if (i !== s) return !1;
35
34
  if (i && s) {
36
35
  const e = t, o = n;
37
- if (e.length !== o.length)
38
- return !1;
39
- for (let l = 0; l < e.length; l++)
40
- if (!a(e[l], o[l]))
41
- return !1;
36
+ if (e.length !== o.length) return !1;
37
+ for (let l = 0; l < e.length; l++) if (!p(e[l], o[l])) return !1;
42
38
  return !0;
43
39
  }
44
40
  if (t == null || n == null || typeof t != "object" || typeof n != "object")
45
41
  return t === n;
46
- if ("equals" in t)
47
- return t.equals(n);
42
+ if ("equals" in t) return t.equals(n);
48
43
  const f = Object.keys(t), r = Object.keys(n);
49
- if (f.length !== r.length)
50
- return !1;
44
+ if (f.length !== r.length) return !1;
51
45
  for (const e of f) {
52
46
  const o = t[e], l = n[e];
53
47
  if (typeof o == "object" && typeof l == "object") {
54
- if (!a(o, l))
55
- return !1;
56
- } else if (o !== l)
57
- return !1;
48
+ if (!p(o, l)) return !1;
49
+ } else if (o !== l) return !1;
58
50
  }
59
51
  return !0;
60
- }, u = (t, n) => {
61
- if (typeof t != "object" || t == null)
62
- return t === n;
52
+ }, a = (t, n) => {
53
+ if (typeof t != "object" || t == null) return t === n;
63
54
  const i = Object.keys(t), s = Object.keys(n);
64
- if (s.length > i.length)
65
- return !1;
55
+ if (s.length > i.length) return !1;
66
56
  for (const f of s) {
67
57
  const r = t[f], e = n[f];
68
58
  if (typeof r == "object" && typeof e == "object") {
69
- if (!u(r, e))
70
- return !1;
71
- } else if (r !== e)
72
- return !1;
59
+ if (!a(r, e)) return !1;
60
+ } else if (r !== e) return !1;
73
61
  }
74
62
  return !0;
75
- }, p = (t, ...n) => {
76
- if (n.length === 0)
77
- return t;
63
+ }, u = (t, ...n) => {
64
+ if (n.length === 0) return t;
78
65
  const i = n.shift();
79
66
  if (y(t) && y(i))
80
67
  for (const s in i)
81
68
  try {
82
- y(i[s]) ? (s in t || Object.assign(t, { [s]: {} }), p(t[s], i[s])) : Object.assign(t, { [s]: i[s] });
69
+ y(i[s]) ? (s in t || Object.assign(t, { [s]: {} }), u(t[s], i[s])) : Object.assign(t, { [s]: i[s] });
83
70
  } catch (f) {
84
71
  throw f instanceof TypeError ? new TypeError(`.${s}: ${f.message}`) : f;
85
72
  }
86
- return p(t, ...n);
87
- }, w = (t, n, i) => {
73
+ return u(t, ...n);
74
+ }, q = (t, n, i) => {
88
75
  const s = (f, r, e) => {
89
76
  for (const o in r) {
90
77
  const l = r[o];
91
78
  if (e != null && e.shape[o]) {
92
79
  const c = e.shape[o].safeParse(l);
93
80
  c.success && (f[o] = c.data);
94
- } else
95
- typeof l == "object" && !Array.isArray(l) && l !== null && e && e.shape && e.shape[o] && (f[o] || (f[o] = {}), s(f[o], l, e.shape[o]));
81
+ } else typeof l == "object" && !Array.isArray(l) && l !== null && e && e.shape && e.shape[o] && (f[o] || (f[o] = {}), s(f[o], l, e.shape[o]));
96
82
  }
97
83
  return f;
98
84
  };
99
85
  return s({ ...t }, n, i);
100
- }, m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
86
+ }, _ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
101
87
  __proto__: null,
102
- copy: $,
103
- deleteD: T,
104
- difference: q,
88
+ copy: V,
89
+ deleteD: E,
90
+ difference: $,
105
91
  element: g,
106
- equal: a,
92
+ equal: p,
107
93
  get: j,
108
94
  has: h,
109
95
  join: A,
110
- override: p,
111
- overrideValidItems: w,
112
- partialEqual: u,
113
- pathToCamel: d,
114
- pathToSnake: k,
115
- pathsMatch: O,
116
- set: V,
117
- transformPath: E
96
+ override: u,
97
+ overrideValidItems: q,
98
+ partialEqual: a,
99
+ pathsMatch: d,
100
+ set: O,
101
+ transformPath: k
118
102
  }, Symbol.toStringTag, { value: "Module" }));
119
103
  export {
120
- m as deep
104
+ _ as deep
121
105
  };
@@ -1,8 +1,7 @@
1
1
  import { z as h } from "zod";
2
2
  import { d as o, x as g, n as a } from "./base-DnZzEvvz.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
- if (e == null)
5
- return !1;
4
+ if (e == null) return !1;
6
5
  const i = n(t), s = n(e);
7
6
  return i.width === s.width && i.height === s.height;
8
7
  }, p = (t) => {
@@ -1,4 +1,4 @@
1
- import { d } from "./dimensions-BAuHfd-b.js";
1
+ import { d } from "./dimensions-D-1PnJVI.js";
2
2
  export {
3
3
  d as dimensions
4
4
  };
@@ -2,15 +2,11 @@ import { z as s } from "zod";
2
2
  const r = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", u = r(), t = ["MacOS", "Windows", "Linux", "Docker"], d = s.enum(t);
3
3
  let n;
4
4
  const c = () => {
5
- if (typeof window > "u")
6
- return;
5
+ if (typeof window > "u") return;
7
6
  const e = window.navigator.userAgent.toLowerCase();
8
- if (e.includes("mac"))
9
- return "MacOS";
10
- if (e.includes("win"))
11
- return "Windows";
12
- if (e.includes("linux"))
13
- return "Linux";
7
+ if (e.includes("mac")) return "MacOS";
8
+ if (e.includes("win")) return "Windows";
9
+ if (e.includes("linux")) return "Linux";
14
10
  }, l = (e = {}) => {
15
11
  const { force: o, default: i } = e;
16
12
  return o ?? n ?? (n = c(), n ?? i);
@@ -0,0 +1 @@
1
+ "use strict";const C=e=>{const r=e.replace(/_[a-z]/g,n=>n[1].toUpperCase());return r.length>1&&r[0]===r[0].toUpperCase()&&r[1]===r[1].toUpperCase()?r:r[0].toLowerCase()+r.slice(1)},p=e=>{const r=(n,s=u)=>{if(typeof n=="string")return e(n);if(Array.isArray(n))return n.map(c=>r(c,s));if(!l(n))return null;s=T(s);const f={};return Object.keys(n).forEach(c=>{let t=n[c];const v=e(c);s.recursive&&(l(t)?y(t,s.keepTypesOnRecursion)||(t=r(t,s)):s.recursiveInArray&&o(t)&&(t=[...t].map(a=>{let i=a;return l(a)?y(i,s.keepTypesOnRecursion)||(i=r(a,s)):o(a)&&(i=r({key:a},s).key),i}))),f[v]=t}),f};return r},m=p(C),O=e=>e.replace(/([a-z0-9])([A-Z])/g,(r,n,s)=>`${n}_${s.toLowerCase()}`),A=p(O),k=e=>e[0].toUpperCase()+e.slice(1),u={recursive:!0,recursiveInArray:!0,keepTypesOnRecursion:[Number,String,Uint8Array]},T=(e=u)=>(e.recursive==null?e=u:e.recursiveInArray==null&&(e.recursiveInArray=!1),e),o=e=>e!=null&&Array.isArray(e),l=e=>e!=null&&typeof e=="object"&&!Array.isArray(e),y=(e,r)=>(r||[]).some(n=>e instanceof n),g=Object.freeze(Object.defineProperty({__proto__:null,belongToTypes:y,camelToSnake:A,capitalize:k,defaultOptions:u,isArrayObject:o,isValidObject:l,snakeToCamel:m,validateOptions:T},Symbol.toStringTag,{value:"Module"}));exports.camelToSnake=A;exports.capitalize=k;exports.caseconv=g;exports.snakeToCamel=m;
@@ -0,0 +1,41 @@
1
+ const k = (e) => {
2
+ const r = e.replace(/_[a-z]/g, (n) => n[1].toUpperCase());
3
+ return r.length > 1 && r[0] === r[0].toUpperCase() && r[1] === r[1].toUpperCase() ? r : r[0].toLowerCase() + r.slice(1);
4
+ }, p = (e) => {
5
+ const r = (n, s = u) => {
6
+ if (typeof n == "string") return e(n);
7
+ if (Array.isArray(n)) return n.map((c) => r(c, s));
8
+ if (!l(n)) return null;
9
+ s = A(s);
10
+ const f = {};
11
+ return Object.keys(n).forEach((c) => {
12
+ let t = n[c];
13
+ const m = e(c);
14
+ s.recursive && (l(t) ? y(t, s.keepTypesOnRecursion) || (t = r(t, s)) : s.recursiveInArray && o(t) && (t = [...t].map((a) => {
15
+ let i = a;
16
+ return l(a) ? y(i, s.keepTypesOnRecursion) || (i = r(a, s)) : o(a) && (i = r({ key: a }, s).key), i;
17
+ }))), f[m] = t;
18
+ }), f;
19
+ };
20
+ return r;
21
+ }, O = p(k), T = (e) => e.replace(/([a-z0-9])([A-Z])/g, (r, n, s) => `${n}_${s.toLowerCase()}`), v = p(T), C = (e) => e[0].toUpperCase() + e.slice(1), u = {
22
+ recursive: !0,
23
+ recursiveInArray: !0,
24
+ keepTypesOnRecursion: [Number, String, Uint8Array]
25
+ }, A = (e = u) => (e.recursive == null ? e = u : e.recursiveInArray == null && (e.recursiveInArray = !1), e), o = (e) => e != null && Array.isArray(e), l = (e) => e != null && typeof e == "object" && !Array.isArray(e), y = (e, r) => (r || []).some((n) => e instanceof n), S = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
26
+ __proto__: null,
27
+ belongToTypes: y,
28
+ camelToSnake: v,
29
+ capitalize: C,
30
+ defaultOptions: u,
31
+ isArrayObject: o,
32
+ isValidObject: l,
33
+ snakeToCamel: O,
34
+ validateOptions: A
35
+ }, Symbol.toStringTag, { value: "Module" }));
36
+ export {
37
+ S as a,
38
+ v as b,
39
+ C as c,
40
+ O as s
41
+ };
@@ -1 +1 @@
1
- "use strict";const g=e=>e!=null&&typeof e=="object"&&"toString"in e,h=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}},u=(e,t=!1)=>{const o=g(e)?"stringer":typeof e;let r;switch(o){case"string":r=(n,s)=>n.localeCompare(s);break;case"stringer":r=(n,s)=>n.toString().localeCompare(s.toString());break;case"number":r=(n,s)=>Number(n)-Number(s);break;case"bigint":r=(n,s)=>BigInt(n)-BigInt(s)>0n?1:-1;break;case"boolean":r=(n,s)=>Number(n)-Number(s);break;case"undefined":r=()=>0;break;default:return console.warn(`sortFunc: unknown type ${o}`),()=>-1}return t?l(r):r},N=(e,t,o)=>{const r=u(t[e],o);return(n,s)=>r(n[e],s[e])},f=(e,t)=>e.length!==t.length?e.length-t.length:e.every((o,r)=>o===t[r])?0:-1,p=(e,t)=>{if(e.length!==t.length)return e.length-t.length;if(e.length===0)return 0;const o=u(e[0]),r=[...e].sort(o),n=[...t].sort(o);return r.every((s,i)=>s===n[i])?0:-1},d=(e,t)=>e===t?0:e==="first"&&t==="last"?1:-1,l=e=>(t,o)=>e(o,t);const m=e=>e<0,b=e=>e>0,A=e=>e>=0,S=(e,t)=>{const o=/([a-zA-Z]+)|(\d+)/g,r=e.replace(/[\s_.\-]+/g,"").match(o),n=t.replace(/[\s_.\-]+/g,"").match(o);if(!r||!n)return 0;for(let s=0;s<Math.min(r.length,n.length);s++){const i=r[s],a=n[s];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 r.length-n.length},E=Object.freeze(Object.defineProperty({__proto__:null,EQUAL:0,GREATER_THAN:1,LESS_THAN:-1,isGreaterThan:b,isGreaterThanEqual:A,isLessThan:m,newF:u,newFieldF:N,order:d,primitiveArrays:f,reverseF:l,stringsWithNumbers:S,unorderedPrimitiveArrays:p},Symbol.toStringTag,{value:"Module"}));exports.compare=E;exports.isGreaterThan=b;exports.isLessThan=m;exports.isStringer=g;exports.newF=u;exports.primitiveIsZero=h;
1
+ "use strict";const g=e=>e!=null&&typeof e=="object"&&"toString"in e,h=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}},u=(e,t=!1)=>{const o=g(e)?"stringer":typeof e;let r;switch(o){case"string":r=(n,s)=>n.localeCompare(s);break;case"stringer":r=(n,s)=>n.toString().localeCompare(s.toString());break;case"number":r=(n,s)=>Number(n)-Number(s);break;case"bigint":r=(n,s)=>BigInt(n)-BigInt(s)>0n?1:-1;break;case"boolean":r=(n,s)=>Number(n)-Number(s);break;case"undefined":r=()=>0;break;default:return console.warn(`sortFunc: unknown type ${o}`),()=>-1}return t?l(r):r},N=(e,t,o)=>{const r=u(t[e],o);return(n,s)=>r(n[e],s[e])},f=(e,t)=>e.length!==t.length?e.length-t.length:e.every((o,r)=>o===t[r])?0:-1,p=(e,t)=>{if(e.length!==t.length)return e.length-t.length;if(e.length===0)return 0;const o=u(e[0]),r=[...e].sort(o),n=[...t].sort(o);return r.every((s,i)=>s===n[i])?0:-1},d=(e,t)=>e===t?0:e==="first"&&t==="last"?1:-1,l=e=>(t,o)=>e(o,t);const m=e=>e<0,b=e=>e>0,A=e=>e>=0,S=(e,t)=>{const o=/([a-zA-Z]+)|(\d+)/g,r=e.replace(/[\s_.-]+/g,"").match(o),n=t.replace(/[\s_.-]+/g,"").match(o);if(!r||!n)return 0;for(let s=0;s<Math.min(r.length,n.length);s++){const i=r[s],a=n[s];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 r.length-n.length},E=Object.freeze(Object.defineProperty({__proto__:null,EQUAL:0,GREATER_THAN:1,LESS_THAN:-1,isGreaterThan:b,isGreaterThanEqual:A,isLessThan:m,newF:u,newFieldF:N,order:d,primitiveArrays:f,reverseF:l,stringsWithNumbers:S,unorderedPrimitiveArrays:p},Symbol.toStringTag,{value:"Module"}));exports.compare=E;exports.isGreaterThan=b;exports.isLessThan=m;exports.isStringer=g;exports.newF=u;exports.primitiveIsZero=h;
@@ -1,6 +1,5 @@
1
1
  const g = (e) => e != null && typeof e == "object" && "toString" in e, S = (e) => {
2
- if (g(e))
3
- return (e == null ? void 0 : e.toString().length) === 0;
2
+ if (g(e)) return (e == null ? void 0 : e.toString().length) === 0;
4
3
  switch (typeof e) {
5
4
  case "string":
6
5
  return e.length === 0;
@@ -45,27 +44,22 @@ const g = (e) => e != null && typeof e == "object" && "toString" in e, S = (e) =
45
44
  const r = u(t[e], o);
46
45
  return (n, s) => r(n[e], s[e]);
47
46
  }, b = (e, t) => e.length !== t.length ? e.length - t.length : e.every((o, r) => o === t[r]) ? 0 : -1, N = (e, t) => {
48
- if (e.length !== t.length)
49
- return e.length - t.length;
50
- if (e.length === 0)
51
- return 0;
47
+ if (e.length !== t.length) return e.length - t.length;
48
+ if (e.length === 0) return 0;
52
49
  const o = u(e[0]), r = [...e].sort(o), n = [...t].sort(o);
53
50
  return r.every((s, i) => s === n[i]) ? 0 : -1;
54
51
  }, h = (e, t) => e === t ? 0 : e === "first" && t === "last" ? 1 : -1, l = (e) => (t, o) => e(o, t);
55
52
  const f = (e) => e < 0, p = (e) => e > 0, d = (e) => e >= 0, A = (e, t) => {
56
- const o = /([a-zA-Z]+)|(\d+)/g, r = e.replace(/[\s_.\-]+/g, "").match(o), n = t.replace(/[\s_.\-]+/g, "").match(o);
57
- if (!r || !n)
58
- return 0;
53
+ const o = /([a-zA-Z]+)|(\d+)/g, r = e.replace(/[\s_.-]+/g, "").match(o), n = t.replace(/[\s_.-]+/g, "").match(o);
54
+ if (!r || !n) return 0;
59
55
  for (let s = 0; s < Math.min(r.length, n.length); s++) {
60
56
  const i = r[s], a = n[s];
61
57
  if (isNaN(Number(i)) && isNaN(Number(a))) {
62
58
  const c = i.localeCompare(a);
63
- if (c !== 0)
64
- return c;
59
+ if (c !== 0) return c;
65
60
  } else if (!isNaN(Number(i)) && !isNaN(Number(a))) {
66
61
  const c = Number(i) - Number(a);
67
- if (c !== 0)
68
- return c;
62
+ if (c !== 0) return c;
69
63
  } else
70
64
  return isNaN(Number(i)) ? -1 : 1;
71
65
  }
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";var R=Object.defineProperty;var j=(e,r,o)=>r in e?R(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o;var g=(e,r,o)=>(j(e,typeof r!="symbol"?r+"":r,o),o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./binary.cjs"),V=require("./index-BpCPHf78.cjs"),Z=require("./change-C-YELKx6.cjs"),q=require("./scale-C8axypQ2.cjs"),d=require("./index-BhEWuRmo.cjs"),c=require("zod"),S=require("./debounce.cjs"),A=require("./deep.cjs"),D=require("./identity.cjs"),W=require("./kv.cjs"),h=require("./bounds-Bh_QBZZK.cjs"),C=require("./observe.cjs"),T=require("./record.cjs"),E=require("./external-B-DoBvh7.cjs"),N=require("./search.cjs"),P=require("./box-m3dlc1kR.cjs"),L=require("./dimensions-zMcb9pMk.cjs"),_=require("./direction-DZbN47uL.cjs"),B=require("./location-c3g6WKs-.cjs"),I=require("./position-BBnkwGX1.cjs"),Q=require("./spatial-BOhaO8xN.cjs"),U=require("./xy-cP-FXJtR.cjs"),i=require("./series-Cgjkfl5S.cjs"),$=require("./toArray.cjs"),G=require("./unique.cjs"),k=require("./url.cjs"),v=require("./worker.cjs"),a=class a extends Number{};g(a,"Absolute",255),g(a,"Default",1),g(a,"z",c.z.union([c.z.instanceof(a),c.z.number().int().min(0).max(255).transform(r=>new a(r)),c.z.instanceof(Number).transform(r=>new a(r))]));let y=a;const w=c.z.object({name:c.z.string(),key:c.z.string()}),K=e=>c.z.object({subject:w,resource:e,authority:y.z}),F=(...e)=>r=>r.filter(o=>{let t=!1;return o.to!=null&&(t=e.includes(o.to.resource)),o.from!=null&&!t&&(t=e.includes(o.from.resource)),t}),H=Object.freeze(Object.defineProperty({__proto__:null,Authority:y,filterTransfersByChannelKey:F,stateZ:K,subjectZ:w},Symbol.toStringTag,{value:"Module"})),J=e=>e?-1:1,b=c.z.string().regex(/^\d+\.\d+\.\d+$/),f=(e,r)=>{const o=b.parse(e),t=b.parse(r),[u,p,m]=o.split(".").map(Number),[l,n,s]=t.split(".").map(Number);return u!==l?u-l:p!==n?p-n:m-s},z=(e,r)=>d.isGreaterThan(f(e,r)),X=(e,r)=>d.isLessThan(f(e,r)),Y=({name:e,migrate:r})=>o=>{try{const t=r(o);return console.log(`${e} migrated: ${o.version} -> ${t.version}`),t}catch(t){throw console.log(`${e} failed to migrate from ${o.version}`),console.error(t),t}},ee=({name:e,migrations:r,targetSchema:o,def:t})=>{const u=Object.keys(r).sort(f).pop();if(u==null)return n=>{if(n.version!==t.version)return console.log(`${e} version ${n.version} is newer than latest version of ${t.version}.
1
+ "use strict";var A=Object.defineProperty;var R=(e,r,o)=>r in e?A(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o;var p=(e,r,o)=>R(e,typeof r!="symbol"?r+"":r,o);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("./binary.cjs"),V=require("./index-2SfxIaaU.cjs"),Z=require("./change-C-YELKx6.cjs"),h=require("./scale-D_uVU2Fw.cjs"),m=require("./index-CvHP07Bs.cjs"),c=require("zod"),T=require("./debounce.cjs"),D=require("./deep.cjs"),s=require("./series-PoUlr-RX.cjs"),N=require("./identity.cjs"),P=require("./kv.cjs"),$=require("./bounds-ZZc1c-_Z.cjs"),W=require("./observe.cjs"),k=require("./record.cjs"),C=require("./external-B-DoBvh7.cjs"),G=require("./search.cjs"),L=require("./box-BcFruCBW.cjs"),B=require("./dimensions-zMcb9pMk.cjs"),I=require("./direction-DZbN47uL.cjs"),Q=require("./location-wMqTcQ0n.cjs"),U=require("./position-DolPXOLe.cjs"),_=require("./spatial-BOhaO8xN.cjs"),K=require("./xy-cP-FXJtR.cjs"),w=require("./toArray.cjs"),F=require("./unique.cjs"),M=require("./url.cjs"),q=require("./worker.cjs"),a=class a extends Number{};p(a,"Absolute",255),p(a,"Default",1),p(a,"z",c.z.union([c.z.instanceof(a),c.z.number().int().min(0).max(255).transform(r=>new a(r)),c.z.instanceof(Number).transform(r=>new a(r))]));let f=a;const z=c.z.object({name:c.z.string(),key:c.z.string()}),H=e=>c.z.object({subject:z,resource:e,authority:f.z}),J=(...e)=>r=>r.filter(o=>{let t=!1;return o.to!=null&&(t=e.includes(o.to.resource)),o.from!=null&&!t&&(t=e.includes(o.from.resource)),t}),X=Object.freeze(Object.defineProperty({__proto__:null,Authority:f,filterTransfersByChannelKey:J,stateZ:H,subjectZ:z},Symbol.toStringTag,{value:"Module"})),u=class u extends Error{constructor(){super(u.MESSAGE)}matches(r){return typeof r=="string"?r.includes(u.MESSAGE):r instanceof u||r.message.includes(u.MESSAGE)}};p(u,"MESSAGE","canceled");let S=u;const Y=new S,ee=Object.freeze(Object.defineProperty({__proto__:null,CANCELED:Y},Symbol.toStringTag,{value:"Module"})),re=e=>e?-1:1,v=c.z.string().regex(/^\d+\.\d+\.\d+$/),b=(e,r)=>{const o=v.parse(e),t=v.parse(r),[l,g,y]=o.split(".").map(Number),[d,n,i]=t.split(".").map(Number);return l!==d?l-d:g!==n?g-n:y-i},E=(e,r)=>m.isGreaterThan(b(e,r)),te=(e,r)=>m.isLessThan(b(e,r)),oe=({name:e,migrate:r})=>o=>{try{const t=r(o);return console.log(`${e} migrated: ${o.version} -> ${t.version}`),t}catch(t){throw console.log(`${e} failed to migrate from ${o.version}`),console.error(t),t}},ne=({name:e,migrations:r,targetSchema:o,def:t})=>{const l=Object.keys(r).sort(b).pop();if(l==null)return n=>{if(n.version!==t.version)return console.log(`${e} version ${n.version} is newer than latest version of ${t.version}.
2
2
  Returning default instead.
3
- `),t;try{return o!=null?o.parse(n):n}catch(s){return console.log(`${e} failed to parse default. Exiting with default`),console.error(s),t}};const p=Object.keys(r).length;let m=!1;const l=n=>{try{if(p===0||z(n.version,u))return console.log(m?`${e} ${n.version} now up to date`:`${e} version ${n.version} is up to date with target version ${t.version}`),n;const s=n.version,x=r[s],M=x(n);return m=!0,l(M)}catch(s){return console.log(`${e} failed to migrate from ${n.version} to ${u}`),console.error(s),t}};return n=>{try{return l(n)}catch(s){return console.log(`${e} failed to parse final result. Exiting with default`),console.error(s),t}}},re=Object.freeze(Object.defineProperty({__proto__:null,compareSemVer:f,createMigration:Y,migrator:ee,semVerNewer:z,semVerOlder:X,semVerZ:b},Symbol.toStringTag,{value:"Module"})),te=e=>{if(e===void 0||typeof e=="string"||typeof e=="number")return e;if(e.toString===void 0)throw new Error("invalid renderer");return e.toString()},oe=e=>Array.isArray(e)?[...e]:typeof e=="object"&&e!==null?{...e}:e;exports.binary=O.binary;exports.caseconv=V.caseconv;exports.change=Z.change;exports.clamp=q.clamp;exports.scale=q.scale;exports.compare=d.compare;exports.isStringer=d.isStringer;exports.primitiveIsZero=d.primitiveIsZero;exports.debounce=S.debounce;exports.throttle=S.throttle;exports.deep=A.deep;exports.isObject=D.isObject;exports.kv=W.kv;exports.bounds=h.bounds;exports.math=h.math;exports.observe=C.observe;exports.getEntries=T.getEntries;exports.unknownRecordZ=T.unknownRecordZ;exports.runtime=E.external;exports.Search=N.Search;exports.box=P.box;exports.dimensions=L.dimensions;exports.direction=_.direction;exports.location=B.location;exports.position=I.position;exports.spatial=Q.spatial;exports.xy=U.xy;exports.DataType=i.DataType;exports.Density=i.Density;exports.MultiSeries=i.MultiSeries;exports.Rate=i.Rate;exports.Series=i.Series;exports.Size=i.Size;exports.TimeRange=i.TimeRange;exports.TimeSpan=i.TimeSpan;exports.TimeStamp=i.TimeStamp;exports.addSamples=i.addSamples;exports.convertDataType=i.convertDataType;exports.isCrudeSeries=i.isCrudeSeries;exports.isTelemValue=i.isTelemValue;exports.typedArrayZ=i.typedArrayZ;exports.nullToArr=$.nullToArr;exports.toArray=$.toArray;exports.unique=G.unique;exports.URL=k.URL;exports.buildQueryString=k.buildQueryString;exports.RoutedWorker=v.RoutedWorker;exports.TypedWorker=v.TypedWorker;exports.createMockWorkers=v.createMockWorkers;exports.control=H;exports.convertRenderV=te;exports.invert=J;exports.migrate=re;exports.shallowCopy=oe;
3
+ `),t;try{return o!=null?o.parse(n):n}catch(i){return console.log(`${e} failed to parse default. Exiting with default`),console.error(i),t}};const g=Object.keys(r).length;let y=!1;const d=n=>{try{if(g===0||E(n.version,l))return console.log(y?`${e} ${n.version} now up to date`:`${e} version ${n.version} is up to date with target version ${t.version}`),n;const i=n.version,x=r[i],j=x(n);return y=!0,d(j)}catch(i){return console.log(`${e} failed to migrate from ${n.version} to ${l}`),console.error(i),t}};return n=>{try{return d(n)}catch(i){return console.log(`${e} failed to parse final result. Exiting with default`),console.error(i),t}}},se=Object.freeze(Object.defineProperty({__proto__:null,compareSemVer:b,createMigration:oe,migrator:ne,semVerNewer:E,semVerOlder:te,semVerZ:v},Symbol.toStringTag,{value:"Module"})),ie=e=>{if(e===void 0||typeof e=="string"||typeof e=="number")return e;if(e.toString===void 0)throw new Error("invalid renderer");return e.toString()},ce=e=>Array.isArray(e)?[...e]:typeof e=="object"&&e!==null?{...e}:e;exports.binary=O.binary;exports.caseconv=V.caseconv;exports.change=Z.change;exports.clamp=h.clamp;exports.scale=h.scale;exports.compare=m.compare;exports.isStringer=m.isStringer;exports.primitiveIsZero=m.primitiveIsZero;exports.debounce=T.debounce;exports.throttle=T.throttle;exports.deep=D.deep;exports.DataType=s.DataType;exports.Density=s.Density;exports.MultiSeries=s.MultiSeries;exports.Rate=s.Rate;exports.Series=s.Series;exports.Size=s.Size;exports.TimeRange=s.TimeRange;exports.TimeSpan=s.TimeSpan;exports.TimeStamp=s.TimeStamp;exports.addSamples=s.addSamples;exports.convertDataType=s.convertDataType;exports.id=s.id;exports.isCrudeSeries=s.isCrudeSeries;exports.isTelemValue=s.isTelemValue;exports.typedArrayZ=s.typedArrayZ;exports.isObject=N.isObject;exports.kv=P.kv;exports.bounds=$.bounds;exports.math=$.math;exports.observe=W.observe;exports.getEntries=k.getEntries;exports.unknownRecordZ=k.unknownRecordZ;exports.runtime=C.external;exports.Search=G.Search;exports.box=L.box;exports.dimensions=B.dimensions;exports.direction=I.direction;exports.location=Q.location;exports.position=U.position;exports.spatial=_.spatial;exports.xy=K.xy;exports.nullToArr=w.nullToArr;exports.toArray=w.toArray;exports.unique=F.unique;exports.URL=M.URL;exports.buildQueryString=M.buildQueryString;exports.RoutedWorker=q.RoutedWorker;exports.TypedWorker=q.TypedWorker;exports.createMockWorkers=q.createMockWorkers;exports.control=X;exports.convertRenderV=ie;exports.errors=ee;exports.invert=re;exports.migrate=se;exports.shallowCopy=ce;
package/dist/index.js CHANGED
@@ -1,62 +1,76 @@
1
1
  var $ = Object.defineProperty;
2
- var h = (e, r, t) => r in e ? $(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
- var p = (e, r, t) => (h(e, typeof r != "symbol" ? r + "" : r, t), t);
4
- import { binary as L } from "./binary.js";
5
- import { b as _ } from "./index-BwkQTA-j.js";
6
- import { c as q } from "./change-DLl6DccR.js";
7
- import { c as I, s as K } from "./scale-CgtgqlYU.js";
8
- import { i as S, a as w } from "./index-IGDDLWef.js";
9
- import { c as U, b as F, p as H } from "./index-IGDDLWef.js";
2
+ var M = (e, r, t) => r in e ? $(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
+ var m = (e, r, t) => M(e, typeof r != "symbol" ? r + "" : r, t);
4
+ import { binary as _ } from "./binary.js";
5
+ import { a as I } from "./index-CQk9JICS.js";
6
+ import { c as Q } from "./change-DLl6DccR.js";
7
+ import { c as F, s as H } from "./scale-6y6-BcVI.js";
8
+ import { i as w, a as E } from "./index-DCwgKLH_.js";
9
+ import { c as X, b as Y, p as ee } from "./index-DCwgKLH_.js";
10
10
  import { z as i } from "zod";
11
- import { debounce as X, throttle as Y } from "./debounce.js";
12
- import { deep as re } from "./deep.js";
13
- import { isObject as te } from "./identity.js";
14
- import { kv as ne } from "./kv.js";
15
- import { b as ae, m as ce } from "./bounds-Dmn-hd_-.js";
16
- import { observe as fe } from "./observe.js";
17
- import { getEntries as pe, unknownRecordZ as ue } from "./record.js";
18
- import { e as xe } from "./external-DI9122wF.js";
19
- import { Search as be } from "./search.js";
20
- import { b as ve } from "./box-C92jYSNY.js";
21
- import { d as he } from "./dimensions-BAuHfd-b.js";
22
- import { d as we } from "./direction-CScbfCdT.js";
23
- import { l as Me } from "./location-CfP9TAnW.js";
24
- import { p as je } from "./position-B_aphAR0.js";
25
- import { s as Re } from "./spatial-DozyssiN.js";
26
- import { x as ze } from "./xy-D1ZbIqpT.js";
27
- import { d as De, D as Ne, M as Ae, R as Ee, S as Pe, e as Ce, c as Le, b as We, T as _e, a as Be, g as qe, i as Ge, f as Ie, t as Ke } from "./series-w7kOJP17.js";
28
- import { nullToArr as Ue, toArray as Fe } from "./toArray.js";
29
- import { unique as Je } from "./unique.js";
30
- import { URL as Ye, buildQueryString as er } from "./url.js";
31
- import { RoutedWorker as or, TypedWorker as tr, createMockWorkers as sr } from "./worker.js";
11
+ import { debounce as oe, throttle as te } from "./debounce.js";
12
+ import { deep as ne } from "./deep.js";
13
+ import { d as ae, D as ce, M as le, R as fe, S as me, e as pe, c as ue, b as ge, T as de, a as xe, g as be, h as ye, i as Se, f as ve, t as he } from "./series-B3wKdjpi.js";
14
+ import { isObject as Me } from "./identity.js";
15
+ import { kv as Ee } from "./kv.js";
16
+ import { b as je, m as ke } from "./bounds-CpboA0q6.js";
17
+ import { observe as Ae } from "./observe.js";
18
+ import { getEntries as ze, unknownRecordZ as Ve } from "./record.js";
19
+ import { e as Ne } from "./external-CO221aaF.js";
20
+ import { Search as Ge } from "./search.js";
21
+ import { b as Le } from "./box-DC5oviHL.js";
22
+ import { d as We } from "./dimensions-D-1PnJVI.js";
23
+ import { d as _e } from "./direction-CScbfCdT.js";
24
+ import { l as Ie } from "./location-D4yS2DfR.js";
25
+ import { p as Qe } from "./position-DvsYXRzE.js";
26
+ import { s as Fe } from "./spatial-DozyssiN.js";
27
+ import { x as Je } from "./xy-CrgPnICw.js";
28
+ import { nullToArr as Ye, toArray as er } from "./toArray.js";
29
+ import { unique as or } from "./unique.js";
30
+ import { URL as sr, buildQueryString as nr } from "./url.js";
31
+ import { RoutedWorker as ar, TypedWorker as cr, createMockWorkers as lr } from "./worker.js";
32
32
  const a = class a extends Number {
33
33
  };
34
- p(a, "Absolute", 255), p(a, "Default", 1), p(a, "z", i.union([
34
+ m(a, "Absolute", 255), m(a, "Default", 1), m(a, "z", i.union([
35
35
  i.instanceof(a),
36
36
  i.number().int().min(0).max(255).transform((r) => new a(r)),
37
37
  i.instanceof(Number).transform((r) => new a(r))
38
38
  ]));
39
- let u = a;
40
- const d = i.object({
39
+ let g = a;
40
+ const y = i.object({
41
41
  name: i.string(),
42
42
  key: i.string()
43
43
  }), T = (e) => i.object({
44
- subject: d,
44
+ subject: y,
45
45
  resource: e,
46
- authority: u.z
47
- }), M = (...e) => (r) => r.filter((t) => {
46
+ authority: g.z
47
+ }), j = (...e) => (r) => r.filter((t) => {
48
48
  let o = !1;
49
49
  return t.to != null && (o = e.includes(t.to.resource)), t.from != null && !o && (o = e.includes(t.from.resource)), o;
50
- }), Z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
50
+ }), N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
51
51
  __proto__: null,
52
- Authority: u,
53
- filterTransfersByChannelKey: M,
52
+ Authority: g,
53
+ filterTransfersByChannelKey: j,
54
54
  stateZ: T,
55
- subjectZ: d
56
- }, Symbol.toStringTag, { value: "Module" })), D = (e) => e ? -1 : 1, x = i.string().regex(/^\d+\.\d+\.\d+$/), g = (e, r) => {
57
- const t = x.parse(e), o = x.parse(r), [c, f, m] = t.split(".").map(Number), [l, s, n] = o.split(".").map(Number);
58
- return c !== l ? c - l : f !== s ? f - s : m - n;
59
- }, b = (e, r) => S(g(e, r)), k = (e, r) => w(g(e, r)), j = ({
55
+ subjectZ: y
56
+ }, Symbol.toStringTag, { value: "Module" })), c = class c extends Error {
57
+ constructor() {
58
+ super(c.MESSAGE);
59
+ }
60
+ /** Returns true if the error or message is a cancellation error" */
61
+ matches(r) {
62
+ return typeof r == "string" ? r.includes(c.MESSAGE) : r instanceof c || r.message.includes(c.MESSAGE);
63
+ }
64
+ };
65
+ m(c, "MESSAGE", "canceled");
66
+ let x = c;
67
+ const k = new x(), Z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
68
+ __proto__: null,
69
+ CANCELED: k
70
+ }, Symbol.toStringTag, { value: "Module" })), G = (e) => e ? -1 : 1, b = i.string().regex(/^\d+\.\d+\.\d+$/), d = (e, r) => {
71
+ const t = b.parse(e), o = b.parse(r), [l, p, u] = t.split(".").map(Number), [f, s, n] = o.split(".").map(Number);
72
+ return l !== f ? l - f : p !== s ? p - s : u - n;
73
+ }, S = (e, r) => w(d(e, r)), O = (e, r) => E(d(e, r)), A = ({
60
74
  name: e,
61
75
  migrate: r
62
76
  }) => (t) => {
@@ -66,14 +80,14 @@ const d = i.object({
66
80
  } catch (o) {
67
81
  throw console.log(`${e} failed to migrate from ${t.version}`), console.error(o), o;
68
82
  }
69
- }, O = ({
83
+ }, R = ({
70
84
  name: e,
71
85
  migrations: r,
72
86
  targetSchema: t,
73
87
  def: o
74
88
  }) => {
75
- const c = Object.keys(r).sort(g).pop();
76
- if (c == null)
89
+ const l = Object.keys(r).sort(d).pop();
90
+ if (l == null)
77
91
  return (s) => {
78
92
  if (s.version !== o.version)
79
93
  return console.log(
@@ -87,95 +101,96 @@ const d = i.object({
87
101
  return console.log(`${e} failed to parse default. Exiting with default`), console.error(n), o;
88
102
  }
89
103
  };
90
- const f = Object.keys(r).length;
91
- let m = !1;
92
- const l = (s) => {
104
+ const p = Object.keys(r).length;
105
+ let u = !1;
106
+ const f = (s) => {
93
107
  try {
94
- if (f === 0 || b(s.version, c))
95
- return console.log(m ? `${e} ${s.version} now up to date` : `${e} version ${s.version} is up to date with target version ${o.version}`), s;
96
- const n = s.version, y = r[n], v = y(s);
97
- return m = !0, l(v);
108
+ if (p === 0 || S(s.version, l))
109
+ return console.log(u ? `${e} ${s.version} now up to date` : `${e} version ${s.version} is up to date with target version ${o.version}`), s;
110
+ const n = s.version, v = r[n], h = v(s);
111
+ return u = !0, f(h);
98
112
  } catch (n) {
99
113
  return console.log(
100
- `${e} failed to migrate from ${s.version} to ${c}`
114
+ `${e} failed to migrate from ${s.version} to ${l}`
101
115
  ), console.error(n), o;
102
116
  }
103
117
  };
104
118
  return (s) => {
105
119
  try {
106
- return l(s);
120
+ return f(s);
107
121
  } catch (n) {
108
122
  return console.log(`${e} failed to parse final result. Exiting with default`), console.error(n), o;
109
123
  }
110
124
  };
111
- }, N = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
125
+ }, P = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
112
126
  __proto__: null,
113
- compareSemVer: g,
114
- createMigration: j,
115
- migrator: O,
116
- semVerNewer: b,
117
- semVerOlder: k,
118
- semVerZ: x
119
- }, Symbol.toStringTag, { value: "Module" })), A = (e) => {
127
+ compareSemVer: d,
128
+ createMigration: A,
129
+ migrator: R,
130
+ semVerNewer: S,
131
+ semVerOlder: O,
132
+ semVerZ: b
133
+ }, Symbol.toStringTag, { value: "Module" })), L = (e) => {
120
134
  if (e === void 0 || typeof e == "string" || typeof e == "number")
121
135
  return e;
122
- if (e.toString === void 0)
123
- throw new Error("invalid renderer");
136
+ if (e.toString === void 0) throw new Error("invalid renderer");
124
137
  return e.toString();
125
- }, E = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e;
138
+ }, C = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e;
126
139
  export {
127
- De as DataType,
128
- Ne as Density,
129
- Ae as MultiSeries,
130
- Ee as Rate,
131
- or as RoutedWorker,
132
- be as Search,
133
- Pe as Series,
134
- Ce as Size,
135
- Le as TimeRange,
136
- We as TimeSpan,
137
- _e as TimeStamp,
138
- tr as TypedWorker,
139
- Ye as URL,
140
- Be as addSamples,
141
- L as binary,
142
- ae as bounds,
143
- ve as box,
144
- er as buildQueryString,
145
- _ as caseconv,
146
- q as change,
147
- I as clamp,
148
- U as compare,
149
- Z as control,
150
- qe as convertDataType,
151
- A as convertRenderV,
152
- sr as createMockWorkers,
153
- X as debounce,
154
- re as deep,
155
- he as dimensions,
156
- we as direction,
157
- pe as getEntries,
158
- D as invert,
159
- Ge as isCrudeSeries,
160
- te as isObject,
161
- F as isStringer,
162
- Ie as isTelemValue,
163
- ne as kv,
164
- Me as location,
165
- ce as math,
166
- N as migrate,
167
- Ue as nullToArr,
168
- fe as observe,
169
- je as position,
170
- H as primitiveIsZero,
171
- xe as runtime,
172
- K as scale,
173
- E as shallowCopy,
174
- Re as spatial,
175
- Y as throttle,
176
- Fe as toArray,
177
- Ke as typedArrayZ,
178
- Je as unique,
179
- ue as unknownRecordZ,
180
- ze as xy
140
+ ae as DataType,
141
+ ce as Density,
142
+ le as MultiSeries,
143
+ fe as Rate,
144
+ ar as RoutedWorker,
145
+ Ge as Search,
146
+ me as Series,
147
+ pe as Size,
148
+ ue as TimeRange,
149
+ ge as TimeSpan,
150
+ de as TimeStamp,
151
+ cr as TypedWorker,
152
+ sr as URL,
153
+ xe as addSamples,
154
+ _ as binary,
155
+ je as bounds,
156
+ Le as box,
157
+ nr as buildQueryString,
158
+ I as caseconv,
159
+ Q as change,
160
+ F as clamp,
161
+ X as compare,
162
+ N as control,
163
+ be as convertDataType,
164
+ L as convertRenderV,
165
+ lr as createMockWorkers,
166
+ oe as debounce,
167
+ ne as deep,
168
+ We as dimensions,
169
+ _e as direction,
170
+ Z as errors,
171
+ ze as getEntries,
172
+ ye as id,
173
+ G as invert,
174
+ Se as isCrudeSeries,
175
+ Me as isObject,
176
+ Y as isStringer,
177
+ ve as isTelemValue,
178
+ Ee as kv,
179
+ Ie as location,
180
+ ke as math,
181
+ P as migrate,
182
+ Ye as nullToArr,
183
+ Ae as observe,
184
+ Qe as position,
185
+ ee as primitiveIsZero,
186
+ Ne as runtime,
187
+ H as scale,
188
+ C as shallowCopy,
189
+ Fe as spatial,
190
+ te as throttle,
191
+ er as toArray,
192
+ he as typedArrayZ,
193
+ or as unique,
194
+ Ve as unknownRecordZ,
195
+ Je as xy
181
196
  };
@@ -1,5 +1,5 @@
1
1
  import { z as O } from "zod";
2
- import { c as m } from "./index-BwkQTA-j.js";
2
+ import { c as m } from "./index-CQk9JICS.js";
3
3
  import { e as f, f as x, y as a, g, D as C, C as z, X as L, Y as h, l as S, h as d } from "./base-DnZzEvvz.js";
4
4
  const N = f, R = a, I = {
5
5
  top: "bottom",