@synnaxlabs/x 0.46.2 → 0.48.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 (78) hide show
  1. package/.turbo/turbo-build.log +18 -18
  2. package/dist/{bounds-DeUXrllt.js → bounds-4BWKPqaP.js} +1 -4
  3. package/dist/bounds.js +1 -1
  4. package/dist/{index-C452Pas0.js → compare-Bnx9CdjS.js} +37 -47
  5. package/dist/compare-GPoFaKRW.cjs +1 -0
  6. package/dist/compare.cjs +1 -1
  7. package/dist/compare.js +34 -2
  8. package/dist/eslint.config.d.ts +3 -0
  9. package/dist/eslint.config.d.ts.map +1 -0
  10. package/dist/{index-D4NCYiQB.js → index-Bv029kh3.js} +2 -2
  11. package/dist/{index-udOjA9d-.cjs → index-CqisIWWC.cjs} +1 -1
  12. package/dist/index.cjs +3 -3
  13. package/dist/index.js +489 -465
  14. package/dist/{scale-BBWhTUqJ.js → scale-DJCMZbfU.js} +1 -1
  15. package/dist/scale.js +1 -1
  16. package/dist/series-B7l2au4y.cjs +6 -0
  17. package/dist/{series-Clbw-fZI.js → series-TpAaBlEg.js} +172 -145
  18. package/dist/spatial.js +2 -2
  19. package/dist/src/array/nullable.d.ts.map +1 -1
  20. package/dist/src/compare/binary.d.ts +25 -0
  21. package/dist/src/compare/binary.d.ts.map +1 -0
  22. package/dist/src/compare/binary.spec.d.ts +2 -0
  23. package/dist/src/compare/binary.spec.d.ts.map +1 -0
  24. package/dist/src/compare/external.d.ts +3 -0
  25. package/dist/src/compare/external.d.ts.map +1 -0
  26. package/dist/src/compare/index.d.ts +1 -1
  27. package/dist/src/compare/index.d.ts.map +1 -1
  28. package/dist/src/csv/csv.d.ts +11 -0
  29. package/dist/src/csv/csv.d.ts.map +1 -0
  30. package/dist/src/csv/csv.spec.d.ts +2 -0
  31. package/dist/src/csv/csv.spec.d.ts.map +1 -0
  32. package/dist/src/csv/index.d.ts +2 -0
  33. package/dist/src/csv/index.d.ts.map +1 -0
  34. package/dist/src/index.d.ts +1 -0
  35. package/dist/src/index.d.ts.map +1 -1
  36. package/dist/src/migrate/migrate.d.ts +1 -1
  37. package/dist/src/migrate/migrate.d.ts.map +1 -1
  38. package/dist/src/spatial/bounds/bounds.d.ts.map +1 -1
  39. package/dist/src/spatial/box/box.d.ts +5 -5
  40. package/dist/src/spatial/box/box.d.ts.map +1 -1
  41. package/dist/src/spatial/scale/scale.d.ts +6 -6
  42. package/dist/src/spatial/scale/scale.d.ts.map +1 -1
  43. package/dist/src/telem/telem.d.ts +14 -0
  44. package/dist/src/telem/telem.d.ts.map +1 -1
  45. package/dist/telem.cjs +1 -1
  46. package/dist/telem.js +1 -1
  47. package/dist/unique.cjs +1 -1
  48. package/dist/unique.js +1 -1
  49. package/package.json +9 -9
  50. package/src/array/nullable.ts +9 -0
  51. package/src/compare/binary.spec.ts +308 -0
  52. package/src/compare/binary.ts +50 -0
  53. package/src/compare/external.ts +11 -0
  54. package/src/compare/index.ts +1 -1
  55. package/src/csv/csv.spec.ts +28 -0
  56. package/src/csv/csv.ts +26 -0
  57. package/src/csv/index.ts +10 -0
  58. package/src/index.ts +1 -0
  59. package/src/jsonrpc/jsonrpc.spec.ts +9 -0
  60. package/src/math/round.spec.ts +2 -1
  61. package/src/migrate/migrate.spec.ts +238 -0
  62. package/src/migrate/migrate.ts +62 -4
  63. package/src/spatial/bounds/bounds.spec.ts +1 -1
  64. package/src/spatial/bounds/bounds.ts +9 -12
  65. package/src/spatial/box/box.spec.ts +3 -3
  66. package/src/spatial/box/box.ts +5 -5
  67. package/src/spatial/dimensions/dimensions.spec.ts +1 -1
  68. package/src/spatial/direction/direction.spec.ts +1 -1
  69. package/src/spatial/location/location.spec.ts +1 -1
  70. package/src/spatial/scale/scale.spec.ts +1 -1
  71. package/src/spatial/scale/scale.ts +7 -7
  72. package/src/telem/telem.spec.ts +87 -0
  73. package/src/telem/telem.ts +48 -0
  74. package/tsconfig.json +1 -1
  75. package/tsconfig.tsbuildinfo +1 -1
  76. package/dist/index-xaxa1hoa.cjs +0 -1
  77. package/dist/series-B2zqvP8A.cjs +0 -6
  78. /package/{eslint.config.js → eslint.config.ts} +0 -0
package/dist/index.js CHANGED
@@ -1,56 +1,57 @@
1
- import { n as xe } from "./external-Du5qzfYv.js";
2
- import { e as tn } from "./external-Du5qzfYv.js";
3
- import { J as Te } from "./index-yz34Wc2p.js";
4
- import { c as nn } from "./index-yz34Wc2p.js";
5
- import h, { z as a } from "zod";
6
- import { h as $e, j as je, k as Ne, l as Ee, m as Ie, o as Oe, p as Ae, q as ke, r as Pe, s as Re, u as Ze, v as Ce, w as Le, x as Ue, y as qe, a as _, T as X, z as We } from "./series-Clbw-fZI.js";
7
- import { c as on, D as an, M as cn, R as ln, S as un, d as fn, b as dn, g as hn, f as mn, A as pn, B as gn, i as bn, e as _n, n as yn, t as wn, C as Mn } from "./series-Clbw-fZI.js";
8
- import { a as vn } from "./index-qmkoZBNO.js";
9
- import { c as Tn } from "./change-DLl6DccR.js";
10
- import { c as jn, s as Nn } from "./scale-BBWhTUqJ.js";
11
- import { a as ze, b as De, c as Be, L as R, G as Z, E as Fe } from "./index-C452Pas0.js";
12
- import { d as In, p as On } from "./index-C452Pas0.js";
13
- import { debounce as kn, throttle as Pn } from "./debounce.js";
14
- import { deep as Zn } from "./deep.js";
15
- import { isObject as Ln } from "./identity.js";
16
- import { e as qn } from "./external-BYuXBYJh.js";
17
- import { link as zn } from "./link.js";
18
- import { i as G, j as Ve, a as He, k as Xe, d as Ge, l as Je, n as Qe, o as Ye, p as Ke, m as et, r as tt, s as rt } from "./bounds-DeUXrllt.js";
19
- import { b as Bn } from "./bounds-DeUXrllt.js";
20
- import { observe as Vn } from "./observe.js";
21
- import { r as Xn } from "./record-tSFQKmdG.js";
22
- import { e as Jn } from "./external-B80i4ymZ.js";
23
- import { b as Yn } from "./box-BXWXSkKu.js";
24
- import { d as es } from "./dimensions-DC0uLPwn.js";
25
- import { d as rs } from "./direction-C_b4tfRN.js";
26
- import { l as ss } from "./location-BIzpxczO.js";
27
- import { s as is } from "./spatial-DnsaOypA.js";
28
- import { x as cs } from "./xy-DnrCAZaw.js";
29
- import { u as us } from "./index-D4NCYiQB.js";
30
- import { URL as ds, buildQueryString as hs } from "./url.js";
31
- import { RoutedWorker as ps, TypedWorker as gs, createMockWorkers as bs } from "./worker.js";
32
- import { e as ys } from "./external-2YWy569j.js";
33
- const L = 2, U = 3, J = 2, nt = (e, t) => {
1
+ import { n as je } from "./external-Du5qzfYv.js";
2
+ import { e as cn } from "./external-Du5qzfYv.js";
3
+ import { J as Ne } from "./index-yz34Wc2p.js";
4
+ import { c as un } from "./index-yz34Wc2p.js";
5
+ import m, { z as c } from "zod";
6
+ import { h as Ie, j as Ee, k as Oe, l as Ae, m as ke, o as Pe, p as Re, q as Ze, r as Ce, s as Le, u as Ue, v as qe, w as ze, x as We, y as De, a as M, T as J, z as Be } from "./series-TpAaBlEg.js";
7
+ import { c as dn, D as mn, M as hn, R as pn, S as gn, d as bn, b as _n, g as yn, f as wn, A as Mn, B as vn, i as Sn, e as xn, n as Tn, t as $n, C as jn } from "./series-TpAaBlEg.js";
8
+ import { a as In } from "./index-qmkoZBNO.js";
9
+ import { c as On } from "./change-DLl6DccR.js";
10
+ import { c as kn, s as Pn } from "./scale-DJCMZbfU.js";
11
+ import { compare as Zn } from "./compare.js";
12
+ import { debounce as Ln, throttle as Un } from "./debounce.js";
13
+ import { deep as zn } from "./deep.js";
14
+ import { isObject as Dn } from "./identity.js";
15
+ import { e as Fn } from "./external-BYuXBYJh.js";
16
+ import { link as Hn } from "./link.js";
17
+ import { i as Q, j as Fe, a as Ve, k as He, d as Xe, l as Ge, n as Je, o as Qe, p as Ye, m as Ke, r as et, s as tt } from "./bounds-4BWKPqaP.js";
18
+ import { b as Gn } from "./bounds-4BWKPqaP.js";
19
+ import { a as rt, b as nt, c as st, L as p, G as g, E as Y } from "./compare-Bnx9CdjS.js";
20
+ import { p as Qn } from "./compare-Bnx9CdjS.js";
21
+ import { observe as Kn } from "./observe.js";
22
+ import { r as ts } from "./record-tSFQKmdG.js";
23
+ import { e as ns } from "./external-B80i4ymZ.js";
24
+ import { b as os } from "./box-BXWXSkKu.js";
25
+ import { d as as } from "./dimensions-DC0uLPwn.js";
26
+ import { d as ls } from "./direction-C_b4tfRN.js";
27
+ import { l as fs } from "./location-BIzpxczO.js";
28
+ import { s as ms } from "./spatial-DnsaOypA.js";
29
+ import { x as ps } from "./xy-DnrCAZaw.js";
30
+ import { a as bs } from "./index-Bv029kh3.js";
31
+ import { URL as ys, buildQueryString as ws } from "./url.js";
32
+ import { RoutedWorker as vs, TypedWorker as Ss, createMockWorkers as xs } from "./worker.js";
33
+ import { e as $s } from "./external-2YWy569j.js";
34
+ const L = 2, U = 3, K = 2, ot = (e, t) => {
34
35
  if (Number.isNaN(e) || !Number.isFinite(e)) return e;
35
- const r = G(t);
36
+ const r = Q(t);
36
37
  if (r == 0) return e;
37
38
  let n;
38
- r >= 1e3 ? n = L : r >= 1 ? n = U : n = Math.ceil(-Math.log10(r)) + J;
39
+ r >= 1e3 ? n = L : r >= 1 ? n = U : n = Math.ceil(-Math.log10(r)) + K;
39
40
  const s = 10 ** n;
40
41
  return Math.round(e * s) / s;
41
- }, st = 5, ot = 1e-10, it = (e, t) => {
42
+ }, it = 5, at = 1e-10, ct = (e, t) => {
42
43
  if (Number.isNaN(e) || !Number.isFinite(e)) return e;
43
44
  const r = Math.abs(e);
44
45
  if (r === 0) return 0;
45
46
  let n = !1, s = 0;
46
47
  if (t != null) {
47
- s = G(t);
48
+ s = Q(t);
48
49
  const i = s / r;
49
- n = s > 0 && i > ot;
50
+ n = s > 0 && i > at;
50
51
  }
51
52
  if (n) {
52
53
  let i;
53
- s >= 1e3 ? i = L : s >= 1 ? i = U : i = Math.ceil(-Math.log10(s)) + J;
54
+ s >= 1e3 ? i = L : s >= 1 ? i = U : i = Math.ceil(-Math.log10(s)) + K;
54
55
  const l = 10 ** i;
55
56
  return Math.round(e * l) / l;
56
57
  }
@@ -62,55 +63,55 @@ const L = 2, U = 3, J = 2, nt = (e, t) => {
62
63
  const i = 10 ** U;
63
64
  return Math.round(e * i) / i;
64
65
  }
65
- const o = Math.floor(Math.log10(r)), f = 10 ** (st - o - 1);
66
+ const o = Math.floor(Math.log10(r)), f = 10 ** (it - o - 1);
66
67
  return Math.round(e * f) / f;
67
- }, kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
68
+ }, Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
68
69
  __proto__: null,
69
- MAX_INT16: $e,
70
- MAX_INT32: je,
71
- MAX_INT64: Ne,
72
- MAX_INT64_NUMBER: Ee,
73
- MAX_INT8: Ie,
74
- MAX_UINT16: Oe,
75
- MAX_UINT32: Ae,
76
- MAX_UINT64: ke,
77
- MAX_UINT64_NUMBER: Pe,
78
- MAX_UINT8: Re,
79
- MIN_INT16: Ze,
80
- MIN_INT32: Ce,
81
- MIN_INT64: Le,
82
- MIN_INT64_NUMBER: Ue,
83
- MIN_INT8: qe,
84
- abs: Ve,
85
- add: He,
86
- closeTo: Xe,
87
- div: Ge,
88
- equal: Je,
89
- isInteger: Qe,
90
- max: Ye,
91
- min: Ke,
92
- mult: et,
93
- roundBySpan: nt,
94
- roundToNearestMagnitude: tt,
95
- smartRound: it,
96
- sub: rt
97
- }, Symbol.toStringTag, { value: "Module" })), Q = async (e) => await new Promise(
98
- (t) => setTimeout(t, _.fromMilliseconds(e).milliseconds)
99
- ), Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
70
+ MAX_INT16: Ie,
71
+ MAX_INT32: Ee,
72
+ MAX_INT64: Oe,
73
+ MAX_INT64_NUMBER: Ae,
74
+ MAX_INT8: ke,
75
+ MAX_UINT16: Pe,
76
+ MAX_UINT32: Re,
77
+ MAX_UINT64: Ze,
78
+ MAX_UINT64_NUMBER: Ce,
79
+ MAX_UINT8: Le,
80
+ MIN_INT16: Ue,
81
+ MIN_INT32: qe,
82
+ MIN_INT64: ze,
83
+ MIN_INT64_NUMBER: We,
84
+ MIN_INT8: De,
85
+ abs: Fe,
86
+ add: Ve,
87
+ closeTo: He,
88
+ div: Xe,
89
+ equal: Ge,
90
+ isInteger: Je,
91
+ max: Qe,
92
+ min: Ye,
93
+ mult: Ke,
94
+ roundBySpan: ot,
95
+ roundToNearestMagnitude: et,
96
+ smartRound: ct,
97
+ sub: tt
98
+ }, Symbol.toStringTag, { value: "Module" })), ee = async (e) => await new Promise(
99
+ (t) => setTimeout(t, M.fromMilliseconds(e).milliseconds)
100
+ ), Ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
100
101
  __proto__: null,
101
- sleep: Q
102
+ sleep: ee
102
103
  }, Symbol.toStringTag, { value: "Module" }));
103
- class at {
104
+ class lt {
104
105
  config;
105
106
  retries;
106
107
  interval;
107
108
  constructor(t) {
108
109
  this.config = {
109
- baseInterval: new _(t?.baseInterval ?? _.seconds(1)),
110
+ baseInterval: new M(t?.baseInterval ?? M.seconds(1)),
110
111
  maxRetries: t?.maxRetries ?? 5,
111
112
  scale: t?.scale ?? 1,
112
- sleepFn: t?.sleepFn ?? Q
113
- }, this.retries = 0, this.interval = new _(this.config.baseInterval);
113
+ sleepFn: t?.sleepFn ?? ee
114
+ }, this.retries = 0, this.interval = new M(this.config.baseInterval);
114
115
  }
115
116
  async wait() {
116
117
  const { maxRetries: t, scale: r, sleepFn: n } = this.config;
@@ -123,73 +124,73 @@ class at {
123
124
  this.retries = 0, this.interval = this.config.baseInterval;
124
125
  }
125
126
  }
126
- const ct = a.object({
127
- baseInterval: _.z.optional(),
128
- maxRetries: a.number().optional(),
129
- scale: a.number().optional()
130
- }), Rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
127
+ const ut = c.object({
128
+ baseInterval: M.z.optional(),
129
+ maxRetries: c.number().optional(),
130
+ scale: c.number().optional()
131
+ }), qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
131
132
  __proto__: null,
132
- Breaker: at,
133
- breakerConfigZ: ct
134
- }, Symbol.toStringTag, { value: "Module" })), lt = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, I = a.string().regex(lt), g = a.number().min(0).max(255), Y = a.number().min(0).max(1), O = a.tuple([g, g, g, Y]), ut = a.tuple([g, g, g]), ft = a.object({ rgba255: O }), dt = a.number().min(0).max(360), ht = a.number().min(0).max(100), mt = a.number().min(0).max(100), K = a.tuple([dt, ht, mt, Y]), A = a.union([I, ut, O, K, ft]), k = A.transform((e) => d(e)), pt = (e) => k.safeParse(e).success, gt = (e) => O.safeParse(e).success, bt = ((e) => {
133
+ Breaker: lt,
134
+ breakerConfigZ: ut
135
+ }, Symbol.toStringTag, { value: "Module" })), ft = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, k = c.string().regex(ft), y = c.number().min(0).max(255), te = c.number().min(0).max(1), P = c.tuple([y, y, y, te]), dt = c.tuple([y, y, y]), mt = c.object({ rgba255: P }), ht = c.number().min(0).max(360), pt = c.number().min(0).max(100), gt = c.number().min(0).max(100), re = c.tuple([ht, pt, gt, te]), R = c.union([k, dt, P, re, mt]), Z = R.transform((e) => d(e)), bt = (e) => Z.safeParse(e).success, _t = (e) => P.safeParse(e).success, yt = ((e) => {
135
136
  if (e == null) return;
136
- const t = k.safeParse(e);
137
- if (t.success) return te(t.data);
137
+ const t = Z.safeParse(e);
138
+ if (t.success) return se(t.data);
138
139
  if (typeof e == "string") return e;
139
140
  throw t.error;
140
141
  }), d = (e, t = 1) => {
141
- if (e = A.parse(e), typeof e == "string") return E(e, t);
142
+ if (e = R.parse(e), typeof e == "string") return A(e, t);
142
143
  if (Array.isArray(e)) {
143
144
  if (e.length < 3 || e.length > 4)
144
145
  throw new Error(`Invalid color: [${e.join(", ")}]`);
145
146
  return e.length === 3 ? [...e, t] : e;
146
147
  }
147
148
  return e.rgba255;
148
- }, ee = (e, t) => {
149
+ }, ne = (e, t) => {
149
150
  if (e == null || t == null) return e == t;
150
151
  const r = d(e), n = d(t);
151
152
  return r.every((s, o) => s === n[o]);
152
- }, _t = ((e) => {
153
+ }, wt = ((e) => {
153
154
  if (e == null) return;
154
155
  const [t, r, n, s] = d(e);
155
- return `#${j(t)}${j(r)}${j(n)}${s === 1 ? "" : j(s * 255)}`;
156
- }), te = (e) => {
156
+ return `#${E(t)}${E(r)}${E(n)}${s === 1 ? "" : E(s * 255)}`;
157
+ }), se = (e) => {
157
158
  const [t, r, n, s] = d(e);
158
159
  return `rgba(${t}, ${r}, ${n}, ${s})`;
159
- }, yt = (e) => `rgb(${re(e)})`, re = (e) => {
160
+ }, Mt = (e) => `rgb(${oe(e)})`, oe = (e) => {
160
161
  const [t, r, n] = d(e);
161
162
  return `${t}, ${r}, ${n}`;
162
- }, wt = (e) => [...B(e), S(e)], B = (e) => [
163
- y(e) / 255,
164
- w(e) / 255,
165
- M(e) / 255
166
- ], y = (e) => d(e)[0], w = (e) => d(e)[1], M = (e) => d(e)[2], S = (e) => d(e)[3], Mt = (e) => ee(F, e), St = (e) => Ot(d(e)), vt = (e, t) => {
163
+ }, vt = (e) => [...B(e), T(e)], B = (e) => [
164
+ v(e) / 255,
165
+ S(e) / 255,
166
+ x(e) / 255
167
+ ], v = (e) => d(e)[0], S = (e) => d(e)[1], x = (e) => d(e)[2], T = (e) => d(e)[3], St = (e) => ne(F, e), xt = (e) => kt(d(e)), Tt = (e, t) => {
167
168
  const [r, n, s] = d(e);
168
169
  if (t > 100)
169
170
  throw new Error(`Color opacity must be between 0 and 100, got ${t}`);
170
171
  return t > 1 && (t /= 100), [r, n, s, t];
171
- }, v = (e) => {
172
+ }, $ = (e) => {
172
173
  const [t, r, n] = B(e).map(
173
174
  (s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
174
175
  );
175
176
  return Number((0.2126 * t + 0.7152 * r + 0.0722 * n).toFixed(3));
176
- }, xt = (e) => {
177
+ }, $t = (e) => {
177
178
  const [t, r, n] = B(e);
178
179
  return 1 - (Math.max(t, r, n) - Math.min(t, r, n));
179
180
  }, q = (e, t) => {
180
- const r = d(e), n = d(t), s = v(r), o = v(n);
181
+ const r = d(e), n = d(t), s = $(r), o = $(n);
181
182
  return (Math.max(s, o) + 0.5) / (Math.min(s, o) + 0.5);
182
- }, Tt = (e, ...t) => {
183
+ }, jt = (e, ...t) => {
183
184
  if (t.length === 0)
184
185
  throw new Error("[Color.pickByContrast] - must provide at least one color");
185
186
  const r = d(e), [n] = t.sort((s, o) => q(r, o) - q(r, s));
186
187
  return d(n);
187
- }, $t = (e) => v(e) < 0.5, jt = (e) => v(e) > 0.5, E = (e, t = 1) => (e = I.parse(e), e = Nt(e), [
188
- N(e, 0),
189
- N(e, 2),
190
- N(e, 4),
191
- e.length === 8 ? N(e, 6) / 255 : t
192
- ]), F = [0, 0, 0, 0], j = (e) => Math.floor(e).toString(16).padStart(2, "0"), N = (e, t) => parseInt(e.slice(t, t + 2), 16), Nt = (e) => e.startsWith("#") ? e.slice(1) : e, H = {
188
+ }, Nt = (e) => $(e) < 0.5, It = (e) => $(e) > 0.5, A = (e, t = 1) => (e = k.parse(e), e = Et(e), [
189
+ O(e, 0),
190
+ O(e, 2),
191
+ O(e, 4),
192
+ e.length === 8 ? O(e, 6) / 255 : t
193
+ ]), F = [0, 0, 0, 0], E = (e) => Math.floor(e).toString(16).padStart(2, "0"), O = (e, t) => parseInt(e.slice(t, t + 2), 16), Et = (e) => e.startsWith("#") ? e.slice(1) : e, G = {
193
194
  black: "#000000",
194
195
  white: "#ffffff",
195
196
  red: "#ff0000",
@@ -221,61 +222,61 @@ const ct = a.object({
221
222
  khaki: "#f0e68c",
222
223
  crimson: "#dc143c",
223
224
  transparent: "transparent"
224
- }, Et = (e) => {
225
+ }, Ot = (e) => {
225
226
  if (!e) return;
226
227
  const t = e.trim().toLowerCase();
227
228
  if (!(t === "transparent" || t === "none")) {
228
229
  if (t.startsWith("#")) {
229
230
  if (t.length === 4) {
230
231
  const r = t[1], n = t[2], s = t[3], o = `#${r}${r}${n}${n}${s}${s}`;
231
- if (I.safeParse(o).success) return E(o);
232
+ if (k.safeParse(o).success) return A(o);
232
233
  }
233
- return (t.length === 7 || t.length === 9) && I.safeParse(t).success ? E(t) : void 0;
234
+ return (t.length === 7 || t.length === 9) && k.safeParse(t).success ? A(t) : void 0;
234
235
  }
235
236
  if (t.startsWith("rgb")) {
236
237
  const r = t.match(
237
238
  /rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/
238
239
  );
239
240
  if (r) {
240
- const [, n, s, o, c] = r;
241
- return [parseInt(n), parseInt(s), parseInt(o), c ? parseFloat(c) : 1];
241
+ const [, n, s, o, a] = r;
242
+ return [parseInt(n), parseInt(s), parseInt(o), a ? parseFloat(a) : 1];
242
243
  }
243
244
  }
244
- if (H[t]) return E(H[t]);
245
+ if (G[t]) return A(G[t]);
245
246
  }
246
- }, It = (e) => {
247
- e = K.parse(e);
247
+ }, At = (e) => {
248
+ e = re.parse(e);
248
249
  let [t, r, n] = e;
249
250
  const s = e[3];
250
251
  t /= 360, r /= 100, n /= 100;
251
- let o, c, f;
252
+ let o, a, f;
252
253
  if (r === 0)
253
- o = c = f = n;
254
+ o = a = f = n;
254
255
  else {
255
256
  const i = n < 0.5 ? n * (1 + r) : n + r - n * r, l = 2 * n - i;
256
- o = C(l, i, t + 1 / 3), c = C(l, i, t), f = C(l, i, t - 1 / 3);
257
+ o = C(l, i, t + 1 / 3), a = C(l, i, t), f = C(l, i, t - 1 / 3);
257
258
  }
258
- return [Math.round(o * 255), Math.round(c * 255), Math.round(f * 255), s];
259
- }, C = (e, t, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? e + (t - e) * 6 * r : r < 1 / 2 ? t : r < 2 / 3 ? e + (t - e) * (2 / 3 - r) * 6 : e), Ot = (e) => {
260
- e = O.parse(e);
259
+ return [Math.round(o * 255), Math.round(a * 255), Math.round(f * 255), s];
260
+ }, C = (e, t, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? e + (t - e) * 6 * r : r < 1 / 2 ? t : r < 2 / 3 ? e + (t - e) * (2 / 3 - r) * 6 : e), kt = (e) => {
261
+ e = P.parse(e);
261
262
  let [t, r, n] = e;
262
263
  const s = e[3];
263
264
  t /= 255, r /= 255, n /= 255;
264
- const o = Math.max(t, r, n), c = Math.min(t, r, n);
265
- let f, i, l = (o + c) / 2;
266
- if (o === c)
265
+ const o = Math.max(t, r, n), a = Math.min(t, r, n);
266
+ let f, i, l = (o + a) / 2;
267
+ if (o === a)
267
268
  f = i = 0;
268
269
  else {
269
- const u = o - c;
270
- i = l > 0.5 ? u / (2 - o - c) : u / (o + c), o === t ? f = (r - n) / u + (r < n ? 6 : 0) : o === r ? f = (n - t) / u + 2 : f = (t - r) / u + 4, f /= 6;
270
+ const u = o - a;
271
+ i = l > 0.5 ? u / (2 - o - a) : u / (o + a), o === t ? f = (r - n) / u + (r < n ? 6 : 0) : o === r ? f = (n - t) / u + 2 : f = (t - r) / u + 4, f /= 6;
271
272
  }
272
273
  return f *= 360, i *= 100, l *= 100, [Math.round(f), Math.round(i), Math.round(l), s];
273
- }, At = d("#000000"), kt = d("#ffffff"), ne = a.object({
274
- key: a.string(),
275
- color: A,
276
- position: a.number(),
277
- switched: a.boolean().optional()
278
- }), Pt = a.array(ne), Rt = (e, t) => {
274
+ }, Pt = d("#000000"), Rt = d("#ffffff"), ie = c.object({
275
+ key: c.string(),
276
+ color: R,
277
+ position: c.number(),
278
+ switched: c.boolean().optional()
279
+ }), Zt = c.array(ie), Ct = (e, t) => {
279
280
  if (e.length === 0) return F;
280
281
  if (e = e.slice().sort((r, n) => r.position - n.position), t <= e[0].position) return d(e[0].color);
281
282
  if (t >= e[e.length - 1].position)
@@ -285,208 +286,211 @@ const ct = a.object({
285
286
  if (t < n.position || t > s.position) continue;
286
287
  if (t === n.position) return d(n.color);
287
288
  if (t === s.position) return d(s.color);
288
- const o = (t - n.position) / (s.position - n.position), c = d(n.color), f = d(s.color), i = Math.round(
289
- y(c) + o * (y(f) - y(c))
289
+ const o = (t - n.position) / (s.position - n.position), a = d(n.color), f = d(s.color), i = Math.round(
290
+ v(a) + o * (v(f) - v(a))
290
291
  ), l = Math.round(
291
- w(c) + o * (w(f) - w(c))
292
+ S(a) + o * (S(f) - S(a))
292
293
  ), u = Math.round(
293
- M(c) + o * (M(f) - M(c))
294
- ), m = S(c) + o * (S(f) - S(c));
295
- return d([i, l, u, m]);
294
+ x(a) + o * (x(f) - x(a))
295
+ ), h = T(a) + o * (T(f) - T(a));
296
+ return d([i, l, u, h]);
296
297
  }
297
298
  return d(e[e.length - 1].color);
298
- }, Zt = a.object({
299
- key: a.string(),
300
- name: a.string(),
301
- color: k
302
- }), Ct = a.object({
303
- key: a.string(),
304
- name: a.string(),
305
- swatches: a.array(Zt)
306
- }), Zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
299
+ }, Lt = c.object({
300
+ key: c.string(),
301
+ name: c.string(),
302
+ color: Z
303
+ }), Ut = c.object({
304
+ key: c.string(),
305
+ name: c.string(),
306
+ swatches: c.array(Lt)
307
+ }), zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
307
308
  __proto__: null,
308
- BLACK: At,
309
- WHITE: kt,
309
+ BLACK: Pt,
310
+ WHITE: Rt,
310
311
  ZERO: F,
311
- aValue: S,
312
- bValue: M,
313
- colorZ: k,
312
+ aValue: T,
313
+ bValue: x,
314
+ colorZ: Z,
314
315
  construct: d,
315
316
  contrast: q,
316
- crudeZ: A,
317
- cssString: bt,
318
- equals: ee,
319
- fromCSS: Et,
320
- fromGradient: Rt,
321
- fromHSLA: It,
322
- gValue: w,
323
- gradientZ: Pt,
324
- grayness: xt,
325
- hex: _t,
326
- hsla: St,
327
- isColor: gt,
328
- isCrude: pt,
329
- isDark: $t,
330
- isLight: jt,
331
- isZero: Mt,
332
- luminance: v,
333
- paletteZ: Ct,
334
- pickByContrast: Tt,
335
- rValue: y,
336
- rgbCSS: yt,
337
- rgbString: re,
338
- rgba1: wt,
339
- rgbaCSS: te,
340
- setAlpha: vt,
341
- stopZ: ne
342
- }, Symbol.toStringTag, { value: "Module" })), se = a.int().min(0).max(255), oe = 255, ie = 0, Lt = {
343
- lower: ie,
344
- upper: oe + 1
345
- }, ae = a.object({
346
- name: a.string(),
347
- key: a.string()
348
- }), x = (e) => a.object({
349
- subject: ae,
317
+ crudeZ: R,
318
+ cssString: yt,
319
+ equals: ne,
320
+ fromCSS: Ot,
321
+ fromGradient: Ct,
322
+ fromHSLA: At,
323
+ gValue: S,
324
+ gradientZ: Zt,
325
+ grayness: $t,
326
+ hex: wt,
327
+ hsla: xt,
328
+ isColor: _t,
329
+ isCrude: bt,
330
+ isDark: Nt,
331
+ isLight: It,
332
+ isZero: St,
333
+ luminance: $,
334
+ paletteZ: Ut,
335
+ pickByContrast: jt,
336
+ rValue: v,
337
+ rgbCSS: Mt,
338
+ rgbString: oe,
339
+ rgba1: vt,
340
+ rgbaCSS: se,
341
+ setAlpha: Tt,
342
+ stopZ: ie
343
+ }, Symbol.toStringTag, { value: "Module" })), ae = c.int().min(0).max(255), ce = 255, le = 0, qt = {
344
+ lower: le,
345
+ upper: ce + 1
346
+ }, ue = c.object({
347
+ name: c.string(),
348
+ key: c.string()
349
+ }), j = (e) => c.object({
350
+ subject: ue,
350
351
  resource: e,
351
- authority: se
352
- }), Ut = (...e) => (t) => t.filter((r) => {
352
+ authority: ae
353
+ }), zt = (...e) => (t) => t.filter((r) => {
353
354
  let n = !1;
354
355
  return r.to != null && (n = e.includes(r.to.resource)), r.from != null && !n && (n = e.includes(r.from.resource)), n;
355
- }), ce = (e) => a.object({
356
- from: x(e),
357
- to: a.null()
358
- }), le = (e) => a.object({
359
- from: a.null(),
360
- to: x(e)
361
- }), qt = (e) => a.union([
362
- ce(e),
363
- le(e),
364
- a.object({
365
- from: x(e),
366
- to: x(e)
356
+ }), fe = (e) => c.object({
357
+ from: j(e),
358
+ to: c.null()
359
+ }), de = (e) => c.object({
360
+ from: c.null(),
361
+ to: j(e)
362
+ }), Wt = (e) => c.union([
363
+ fe(e),
364
+ de(e),
365
+ c.object({
366
+ from: j(e),
367
+ to: j(e)
367
368
  })
368
- ]), Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
369
+ ]), Wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
369
370
  __proto__: null,
370
- ABSOLUTE_AUTHORITY: oe,
371
- AUTHORITY_BOUNDS: Lt,
372
- ZERO_AUTHORITY: ie,
373
- acquireZ: le,
374
- authorityZ: se,
375
- filterTransfersByChannelKey: Ut,
376
- releaseZ: ce,
377
- stateZ: x,
378
- subjectZ: ae,
379
- transferZ: qt
380
- }, Symbol.toStringTag, { value: "Module" })), Wt = (e) => Object.getOwnPropertySymbols(globalThis).includes(e), zt = (e, t) => {
371
+ ABSOLUTE_AUTHORITY: ce,
372
+ AUTHORITY_BOUNDS: qt,
373
+ ZERO_AUTHORITY: le,
374
+ acquireZ: de,
375
+ authorityZ: ae,
376
+ filterTransfersByChannelKey: zt,
377
+ releaseZ: fe,
378
+ stateZ: j,
379
+ subjectZ: ue,
380
+ transferZ: Wt
381
+ }, Symbol.toStringTag, { value: "Module" })), Dt = /[",\n]/, Bt = (e) => Dt.test(e) ? `"${e.replace(/"/g, '""')}"` : e, Dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
382
+ __proto__: null,
383
+ maybeEscapeField: Bt
384
+ }, Symbol.toStringTag, { value: "Module" })), Ft = (e) => Object.getOwnPropertySymbols(globalThis).includes(e), Vt = (e, t) => {
381
385
  const r = Symbol.for(e);
382
- if (!Wt(r)) {
386
+ if (!Ft(r)) {
383
387
  const n = t();
384
388
  Object.defineProperty(globalThis, r, { value: n });
385
389
  }
386
390
  return () => globalThis[r];
387
- }, ue = "sy_x_error", Dt = (e) => (t) => t != null && typeof t == "object" && "type" in t && typeof t.type == "string" ? t.type.startsWith(e) : t instanceof Error ? t.message.startsWith(e) : typeof t != "string" ? !1 : t.startsWith(e), T = (e) => class b extends Error {
388
- static discriminator = ue;
389
- discriminator = b.discriminator;
391
+ }, me = "sy_x_error", Ht = (e) => (t) => t != null && typeof t == "object" && "type" in t && typeof t.type == "string" ? t.type.startsWith(e) : t instanceof Error ? t.message.startsWith(e) : typeof t != "string" ? !1 : t.startsWith(e), N = (e) => class w extends Error {
392
+ static discriminator = me;
393
+ discriminator = w.discriminator;
390
394
  static TYPE = e;
391
- type = b.TYPE;
392
- static matches = Dt(e);
393
- matches = b.matches;
395
+ type = w.TYPE;
396
+ static matches = Ht(e);
397
+ matches = w.matches;
394
398
  constructor(r, n) {
395
- super(r, n), this.name = b.TYPE;
399
+ super(r, n), this.name = w.TYPE;
396
400
  }
397
401
  static sub(r) {
398
- return T(`${e}.${r}`);
402
+ return N(`${e}.${r}`);
399
403
  }
400
- }, fe = (e) => {
404
+ }, he = (e) => {
401
405
  if (e == null || typeof e != "object") return !1;
402
406
  const t = e;
403
- if (t.discriminator !== ue) return !1;
407
+ if (t.discriminator !== me) return !1;
404
408
  if (!("type" in t))
405
409
  throw new Error(
406
410
  `X Error is missing its type property: ${JSON.stringify(t)}`
407
411
  );
408
412
  return !0;
409
- }, p = "unknown", W = "nil";
410
- class Bt {
413
+ }, _ = "unknown", z = "nil";
414
+ class Xt {
411
415
  providers = [];
412
416
  register(t) {
413
417
  this.providers.push(t);
414
418
  }
415
419
  encode(t) {
416
- if (t == null) return { type: W, data: "" };
417
- if (fe(t))
420
+ if (t == null) return { type: z, data: "" };
421
+ if (he(t))
418
422
  for (const r of this.providers) {
419
423
  const n = r.encode(t);
420
424
  if (n != null) return n;
421
425
  }
422
- if (t instanceof Error) return { type: p, data: t.message };
423
- if (typeof t == "string") return { type: p, data: t };
426
+ if (t instanceof Error) return { type: _, data: t.message };
427
+ if (typeof t == "string") return { type: _, data: t };
424
428
  try {
425
- return { type: p, data: JSON.stringify(t) };
429
+ return { type: _, data: JSON.stringify(t) };
426
430
  } catch {
427
- return { type: p, data: "unable to encode error information" };
431
+ return { type: _, data: "unable to encode error information" };
428
432
  }
429
433
  }
430
434
  decode(t) {
431
- if (t == null || t.type === W) return null;
432
- if (t.type === p) return new z(t.data);
435
+ if (t == null || t.type === z) return null;
436
+ if (t.type === _) return new W(t.data);
433
437
  for (const r of this.providers) {
434
438
  const n = r.decode(t);
435
439
  if (n != null) return n;
436
440
  }
437
- return new z(t.data);
441
+ return new W(t.data);
438
442
  }
439
443
  }
440
- const V = zt("synnax-error-registry", () => new Bt()), Ft = ({ encode: e, decode: t }) => V().register({ encode: e, decode: t }), Vt = (e) => V().encode(e), Ht = (e) => e == null ? null : V().decode(e);
441
- class z extends T("unknown") {
444
+ const V = Vt("synnax-error-registry", () => new Xt()), Gt = ({ encode: e, decode: t }) => V().register({ encode: e, decode: t }), Jt = (e) => V().encode(e), Qt = (e) => e == null ? null : V().decode(e);
445
+ class W extends N("unknown") {
442
446
  }
443
- const Xt = a.object({ type: a.string(), data: a.string() });
444
- class Gt extends T("canceled") {
447
+ const Yt = c.object({ type: c.string(), data: c.string() });
448
+ class Kt extends N("canceled") {
445
449
  }
446
- class Jt extends T("not_implemented") {
450
+ class er extends N("not_implemented") {
447
451
  }
448
- const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
452
+ const Br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
449
453
  __proto__: null,
450
- Canceled: Gt,
451
- NONE: W,
452
- NotImplemented: Jt,
453
- UNKNOWN: p,
454
- Unknown: z,
455
- createTyped: T,
456
- decode: Ht,
457
- encode: Vt,
458
- isTyped: fe,
459
- payloadZ: Xt,
460
- register: Ft
461
- }, Symbol.toStringTag, { value: "Module" })), Ur = () => Promise.resolve(), qr = () => new Promise((e) => setTimeout(e, 0)), Wr = (e) => e ? -1 : 1, de = h.object({
462
- jsonrpc: h.literal("2.0"),
463
- method: h.string(),
454
+ Canceled: Kt,
455
+ NONE: z,
456
+ NotImplemented: er,
457
+ UNKNOWN: _,
458
+ Unknown: W,
459
+ createTyped: N,
460
+ decode: Qt,
461
+ encode: Jt,
462
+ isTyped: he,
463
+ payloadZ: Yt,
464
+ register: Gt
465
+ }, Symbol.toStringTag, { value: "Module" })), Fr = () => Promise.resolve(), Vr = () => new Promise((e) => setTimeout(e, 0)), Hr = (e) => e ? -1 : 1, pe = m.object({
466
+ jsonrpc: m.literal("2.0"),
467
+ method: m.string(),
464
468
  // params should be z.union([z.record(z.string(), z.json()),
465
469
  // z.array(z.json())]).optional() but the VSCode JSON RPC implementation uses a looser
466
470
  // definition of params then in the JSON-RPC spec.
467
- params: h.any().optional(),
468
- id: h.union([h.string(), h.number(), h.null()]).optional()
469
- }), he = h.object({
470
- jsonrpc: h.literal("2.0"),
471
- id: h.union([h.string(), h.number(), h.null()])
472
- }), Qt = he.extend({
473
- result: h.json()
474
- }), Yt = he.extend({
475
- error: h.object({
476
- code: h.number().int(),
471
+ params: m.any().optional(),
472
+ id: m.union([m.string(), m.number(), m.null()]).optional()
473
+ }), ge = m.object({
474
+ jsonrpc: m.literal("2.0"),
475
+ id: m.union([m.string(), m.number(), m.null()])
476
+ }), tr = ge.extend({
477
+ result: m.json()
478
+ }), rr = ge.extend({
479
+ error: m.object({
480
+ code: m.number().int(),
477
481
  // This should be z.string(), but the VSCode JSON RPC implementation uses a looser
478
482
  // definition of error than the JSON-RPC spec.
479
- message: h.string().optional(),
480
- data: h.json().optional()
483
+ message: m.string().optional(),
484
+ data: m.json().optional()
481
485
  })
482
- }), me = h.union([Qt, Yt]), pe = h.union([de, me]), Kt = (e) => {
486
+ }), be = m.union([tr, rr]), _e = m.union([pe, be]), nr = (e) => {
483
487
  const t = new TextDecoder();
484
488
  let r = new Uint8Array(0), n = null;
485
489
  return (s) => {
486
490
  let o;
487
491
  typeof s == "string" ? o = new TextEncoder().encode(s) : s instanceof ArrayBuffer ? o = new Uint8Array(s) : o = s;
488
- const c = new Uint8Array(r.length + o.length);
489
- for (c.set(r), c.set(o, r.length), r = c; r.length > 0; ) {
492
+ const a = new Uint8Array(r.length + o.length);
493
+ for (a.set(r), a.set(o, r.length), r = a; r.length > 0; ) {
490
494
  if (n === null) {
491
495
  const i = t.decode(r).match(/^Content-Length: (\d+)\r?\n\r?\n/);
492
496
  if (!i) break;
@@ -497,54 +501,73 @@ const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
497
501
  if (n !== null && r.length >= n) {
498
502
  const f = r.slice(0, n);
499
503
  r = r.slice(n), n = null;
500
- const i = t.decode(f), l = Te.decodeString(i, pe);
504
+ const i = t.decode(f), l = Ne.decodeString(i, _e);
501
505
  e(l);
502
506
  } else break;
503
507
  }
504
508
  };
505
- }, er = (e) => {
509
+ }, sr = (e) => {
506
510
  const t = JSON.stringify(e);
507
511
  return `Content-Length: ${new TextEncoder().encode(t).length}\r
508
512
  \r
509
513
  ` + t;
510
- }, zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
514
+ }, Xr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
511
515
  __proto__: null,
512
- encodeMessage: er,
513
- messageZ: pe,
514
- requestZ: de,
515
- responseZ: me,
516
- streamDecodeChunks: Kt
517
- }, Symbol.toStringTag, { value: "Module" })), ge = h.uuid(), be = h.object({
518
- key: ge,
519
- name: h.string().min(1),
520
- color: h.string()
521
- }), Dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
516
+ encodeMessage: sr,
517
+ messageZ: _e,
518
+ requestZ: pe,
519
+ responseZ: be,
520
+ streamDecodeChunks: nr
521
+ }, Symbol.toStringTag, { value: "Module" })), ye = m.uuid(), we = m.object({
522
+ key: ye,
523
+ name: m.string().min(1),
524
+ color: m.string()
525
+ }), Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
522
526
  __proto__: null,
523
- keyZ: ge,
524
- labelZ: be
525
- }, Symbol.toStringTag, { value: "Module" })), tr = (e, t, r) => {
527
+ keyZ: ye,
528
+ labelZ: we
529
+ }, Symbol.toStringTag, { value: "Module" })), or = (e, t, r) => {
526
530
  const n = e.get(t);
527
531
  return n === void 0 ? (e.set(t, r), r) : n;
528
- }, Br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
532
+ }, Jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
529
533
  __proto__: null,
530
- getOrSetDefault: tr
531
- }, Symbol.toStringTag, { value: "Module" })), D = a.string().regex(/^\d+\.\d+\.\d+$/), $ = ((e, t, r = {}) => {
534
+ getOrSetDefault: or
535
+ }, Symbol.toStringTag, { value: "Module" })), D = c.string().regex(/^\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?$/), ir = (e, t) => {
536
+ const r = e.split("."), n = t.split("."), s = Math.max(r.length, n.length);
537
+ for (let o = 0; o < s; o++) {
538
+ const a = r[o], f = n[o];
539
+ if (a === void 0) return p;
540
+ if (f === void 0) return g;
541
+ const i = /^\d+$/.test(a), l = /^\d+$/.test(f);
542
+ if (i && !l) return p;
543
+ if (!i && l) return g;
544
+ if (i && l) {
545
+ const u = parseInt(a), h = parseInt(f);
546
+ if (u < h) return p;
547
+ if (u > h) return g;
548
+ } else {
549
+ if (a < f) return p;
550
+ if (a > f) return g;
551
+ }
552
+ }
553
+ return Y;
554
+ }, I = ((e, t, r = {}) => {
532
555
  r.checkMajor ??= !0, r.checkMinor ??= !0, r.checkPatch ??= !0;
533
- const n = D.parse(e), s = D.parse(t), [o, c, f] = n.split(".").map(Number), [i, l, u] = s.split(".").map(Number);
556
+ const n = D.parse(e), s = D.parse(t), [o, a] = n.split("-"), [f, i] = s.split("-"), [l, u, h] = o.split(".").map(Number), [b, H, X] = f.split(".").map(Number);
534
557
  if (r.checkMajor) {
535
- if (o < i) return R;
536
- if (o > i) return Z;
558
+ if (l < b) return p;
559
+ if (l > b) return g;
537
560
  }
538
561
  if (r.checkMinor) {
539
- if (c < l) return R;
540
- if (c > l) return Z;
562
+ if (u < H) return p;
563
+ if (u > H) return g;
541
564
  }
542
565
  if (r.checkPatch) {
543
- if (f < u) return R;
544
- if (f > u) return Z;
566
+ if (h < X) return p;
567
+ if (h > X) return g;
545
568
  }
546
- return Fe;
547
- }), rr = (e, t, r = {}) => ze($(e, t, r)), _e = (e, t, r = {}) => De($(e, t, r)), nr = (e, t, r = {}) => Be($(e, t, r)), sr = ({
569
+ return a === void 0 && i === void 0 ? Y : a === void 0 ? g : i === void 0 ? p : ir(a, i);
570
+ }), ar = (e, t, r = {}) => rt(I(e, t, r)), Me = (e, t, r = {}) => nt(I(e, t, r)), cr = (e, t, r = {}) => st(I(e, t, r)), lr = ({
548
571
  name: e,
549
572
  migrate: t
550
573
  }) => (r) => {
@@ -554,14 +577,14 @@ const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
554
577
  } catch (n) {
555
578
  throw console.log(`${e} failed to migrate from ${r.version}`), console.error(n), n;
556
579
  }
557
- }, or = ({
580
+ }, ur = ({
558
581
  name: e,
559
582
  migrations: t,
560
583
  targetSchema: r,
561
584
  defaultVersion: n,
562
585
  def: s
563
586
  }) => {
564
- const o = Object.keys(t).sort($).pop();
587
+ const o = Object.keys(t).sort(I).pop();
565
588
  if (o == null)
566
589
  return (l) => {
567
590
  if (l.version ??= n, l.version !== s.version)
@@ -576,14 +599,14 @@ const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
576
599
  return console.log(`${e} failed to parse default. Exiting with default`), console.error(u), s;
577
600
  }
578
601
  };
579
- const c = Object.keys(t).length;
602
+ const a = Object.keys(t).length;
580
603
  let f = !1;
581
604
  const i = (l) => {
582
605
  try {
583
- if (c === 0 || _e(l.version, o))
606
+ if (a === 0 || Me(l.version, o))
584
607
  return console.log(f ? `${e} ${l.version} now up to date` : `${e} version ${l.version} is up to date with target version ${s.version}`), l;
585
- const u = l.version, m = t[u], P = m(l);
586
- return f = !0, i(P);
608
+ const u = l.version, h = t[u], b = h(l);
609
+ return f = !0, i(b);
587
610
  } catch (u) {
588
611
  return console.log(
589
612
  `${e} failed to migrate from ${l.version} to ${o}`
@@ -606,16 +629,16 @@ const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
606
629
  return console.log(`${e} failed to parse final result. Exiting with default`), console.error(u), s;
607
630
  }
608
631
  };
609
- }, Fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
632
+ }, Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
610
633
  __proto__: null,
611
- compareSemVer: $,
612
- createMigration: sr,
613
- migrator: or,
614
- semVerNewer: _e,
615
- semVerOlder: nr,
634
+ compareSemVer: I,
635
+ createMigration: lr,
636
+ migrator: ur,
637
+ semVerNewer: Me,
638
+ semVerOlder: cr,
616
639
  semVerZ: D,
617
- versionsEqual: rr
618
- }, Symbol.toStringTag, { value: "Module" })), ye = ["standard", "scientific", "engineering"], ir = a.enum(ye), ar = (e, t, r) => {
640
+ versionsEqual: ar
641
+ }, Symbol.toStringTag, { value: "Module" })), ve = ["standard", "scientific", "engineering"], fr = c.enum(ve), dr = (e, t, r) => {
619
642
  if (Number.isNaN(e)) return "NaN";
620
643
  if (e === 1 / 0) return "∞";
621
644
  if (e === -1 / 0) return "-∞";
@@ -624,119 +647,119 @@ const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
624
647
  return t === 0 ? "0ᴇ0" : `0.${"0".repeat(t)}ᴇ0`;
625
648
  let n;
626
649
  return r === "scientific" ? n = Math.floor(Math.log10(Math.abs(e))) : n = Math.floor(Math.log10(Math.abs(e)) / 3) * 3, `${(e / 10 ** n).toFixed(t)}ᴇ${n}`;
627
- }, Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
650
+ }, Yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
628
651
  __proto__: null,
629
- NOTATIONS: ye,
630
- notationZ: ir,
631
- stringifyNumber: ar
632
- }, Symbol.toStringTag, { value: "Module" })), Hr = (e) => {
652
+ NOTATIONS: ve,
653
+ notationZ: fr,
654
+ stringifyNumber: dr
655
+ }, Symbol.toStringTag, { value: "Module" })), Kr = (e) => {
633
656
  if (e === void 0 || typeof e == "string" || typeof e == "number")
634
657
  return e;
635
658
  if (e.toString === void 0) throw new Error("invalid renderer");
636
659
  return e.toString();
637
- }, Xr = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e, we = a.enum([
660
+ }, en = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e, Se = c.enum([
638
661
  "success",
639
662
  "info",
640
663
  "warning",
641
664
  "error",
642
665
  "loading",
643
666
  "disabled"
644
- ]), cr = (e) => a.object({
645
- key: a.string(),
646
- name: a.string().default(""),
647
- variant: we,
648
- message: a.string(),
649
- description: a.string().optional(),
650
- time: X.z,
651
- labels: xe(be).optional(),
652
- details: e ?? a.unknown().optional()
653
- }), lr = a.object({
654
- stack: a.string(),
655
- error: a.instanceof(Error)
656
- }), ur = (e, t) => {
667
+ ]), mr = (e) => c.object({
668
+ key: c.string(),
669
+ name: c.string().default(""),
670
+ variant: Se,
671
+ message: c.string(),
672
+ description: c.string().optional(),
673
+ time: J.z,
674
+ labels: je(we).optional(),
675
+ details: e ?? c.unknown().optional()
676
+ }), hr = c.object({
677
+ stack: c.string(),
678
+ error: c.instanceof(Error)
679
+ }), pr = (e, t) => {
657
680
  if (!(e instanceof Error)) throw e;
658
- return Me({
681
+ return xe({
659
682
  variant: "error",
660
683
  message: t ?? e.message,
661
684
  description: t != null ? e.message : void 0,
662
685
  details: { stack: e.stack ?? "", error: e }
663
686
  });
664
- }, Me = (e) => ({
665
- key: We(),
666
- time: X.now(),
687
+ }, xe = (e) => ({
688
+ key: Be(),
689
+ time: J.now(),
667
690
  name: "",
668
691
  ...e
669
- }), fr = (e, t = []) => {
692
+ }), gr = (e, t = []) => {
670
693
  if (e != null)
671
694
  return Array.isArray(t) ? t.includes(e) ? e : void 0 : t === e ? e : void 0;
672
- }, dr = (e, t = []) => {
695
+ }, br = (e, t = []) => {
673
696
  if (e != null)
674
697
  return Array.isArray(t) ? t.includes(e) ? void 0 : e : t === e ? void 0 : e;
675
- }, Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
698
+ }, tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
676
699
  __proto__: null,
677
- create: Me,
678
- exceptionDetailsSchema: lr,
679
- fromException: ur,
680
- keepVariants: fr,
681
- removeVariants: dr,
682
- statusZ: cr,
683
- variantZ: we
684
- }, Symbol.toStringTag, { value: "Module" })), hr = (e, t) => {
700
+ create: xe,
701
+ exceptionDetailsSchema: hr,
702
+ fromException: pr,
703
+ keepVariants: gr,
704
+ removeVariants: br,
705
+ statusZ: mr,
706
+ variantZ: Se
707
+ }, Symbol.toStringTag, { value: "Module" })), _r = (e, t) => {
685
708
  if (!t.has(e)) return e;
686
709
  let r = e, n = 1, s = e;
687
710
  for (; t.has(s); ) {
688
- const o = s.match(mr);
711
+ const o = s.match(yr);
689
712
  o ? (r = s.slice(0, o.index).trim(), n = parseInt(o[1]) + 1) : (r = s, n = 1), s = `${r} (${n})`;
690
713
  }
691
714
  return s;
692
- }, mr = /\((\d+)\)$/, pr = (e, t = "") => {
715
+ }, yr = /\((\d+)\)$/, wr = (e, t = "") => {
693
716
  if (typeof e == "string") return e;
694
717
  const r = e.length;
695
718
  return r === 0 ? t : r === 1 ? e[0] : r === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e[r - 1]}`;
696
- }, gr = (e) => {
719
+ }, Mr = (e) => {
697
720
  const t = e.split(" "), r = /* @__PURE__ */ new Set(), n = t.map((i) => i.charAt(0).toLowerCase()).join("");
698
721
  r.add(n.replace(/-/g, "_")), r.add(n.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_"));
699
722
  const s = /\d+/g;
700
723
  e.match(s) && t.forEach((i, l) => {
701
724
  if (s.test(i)) {
702
- const u = t.map((m, P) => P !== l ? m.charAt(0).toLowerCase() : m).join("");
725
+ const u = t.map((h, b) => b !== l ? h.charAt(0).toLowerCase() : h).join("");
703
726
  r.add(u.replace(/-/g, "_")), r.add(
704
727
  u.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_")
705
728
  );
706
729
  }
707
730
  });
708
- const c = t.map(
731
+ const a = t.map(
709
732
  (i) => (i.length > 3 ? i.substring(0, 3) : i).toLowerCase()
710
733
  );
711
- return r.add(c.join("").replace(/-/g, "_")), r.add(c.join("_").replace(/-/g, "_")), Array.from(r).filter(
734
+ return r.add(a.join("").replace(/-/g, "_")), r.add(a.join("_").replace(/-/g, "_")), Array.from(r).filter(
712
735
  (i) => i.length >= 2 && i.length <= 12 && !/^\d/.test(i)
713
736
  );
714
- }, br = (e, t) => e.startsWith(t) ? e.slice(t.length) : e, Jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
737
+ }, vr = (e, t) => e.startsWith(t) ? e.slice(t.length) : e, rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
715
738
  __proto__: null,
716
- createShortIdentifiers: gr,
717
- deduplicateFileName: hr,
718
- naturalLanguageJoin: pr,
719
- trimPrefix: br
720
- }, Symbol.toStringTag, { value: "Module" })), _r = new Error("request for lock canceled");
721
- var yr = function(e, t, r, n) {
739
+ createShortIdentifiers: Mr,
740
+ deduplicateFileName: _r,
741
+ naturalLanguageJoin: wr,
742
+ trimPrefix: vr
743
+ }, Symbol.toStringTag, { value: "Module" })), Sr = new Error("request for lock canceled");
744
+ var xr = function(e, t, r, n) {
722
745
  function s(o) {
723
- return o instanceof r ? o : new r(function(c) {
724
- c(o);
746
+ return o instanceof r ? o : new r(function(a) {
747
+ a(o);
725
748
  });
726
749
  }
727
- return new (r || (r = Promise))(function(o, c) {
750
+ return new (r || (r = Promise))(function(o, a) {
728
751
  function f(u) {
729
752
  try {
730
753
  l(n.next(u));
731
- } catch (m) {
732
- c(m);
754
+ } catch (h) {
755
+ a(h);
733
756
  }
734
757
  }
735
758
  function i(u) {
736
759
  try {
737
760
  l(n.throw(u));
738
- } catch (m) {
739
- c(m);
761
+ } catch (h) {
762
+ a(h);
740
763
  }
741
764
  }
742
765
  function l(u) {
@@ -745,25 +768,25 @@ var yr = function(e, t, r, n) {
745
768
  l((n = n.apply(e, t || [])).next());
746
769
  });
747
770
  };
748
- class wr {
749
- constructor(t, r = _r) {
771
+ class Tr {
772
+ constructor(t, r = Sr) {
750
773
  this._value = t, this._cancelError = r, this._queue = [], this._weightedWaiters = [];
751
774
  }
752
775
  acquire(t = 1, r = 0) {
753
776
  if (t <= 0)
754
777
  throw new Error(`invalid weight ${t}: must be positive`);
755
778
  return new Promise((n, s) => {
756
- const o = { resolve: n, reject: s, weight: t, priority: r }, c = Se(this._queue, (f) => r <= f.priority);
757
- c === -1 && t <= this._value ? this._dispatchItem(o) : this._queue.splice(c + 1, 0, o);
779
+ const o = { resolve: n, reject: s, weight: t, priority: r }, a = Te(this._queue, (f) => r <= f.priority);
780
+ a === -1 && t <= this._value ? this._dispatchItem(o) : this._queue.splice(a + 1, 0, o);
758
781
  });
759
782
  }
760
783
  runExclusive(t) {
761
- return yr(this, arguments, void 0, function* (r, n = 1, s = 0) {
762
- const [o, c] = yield this.acquire(n, s);
784
+ return xr(this, arguments, void 0, function* (r, n = 1, s = 0) {
785
+ const [o, a] = yield this.acquire(n, s);
763
786
  try {
764
787
  return yield r(o);
765
788
  } finally {
766
- c();
789
+ a();
767
790
  }
768
791
  });
769
792
  }
@@ -771,7 +794,7 @@ class wr {
771
794
  if (t <= 0)
772
795
  throw new Error(`invalid weight ${t}: must be positive`);
773
796
  return this._couldLockImmediately(t, r) ? Promise.resolve() : new Promise((n) => {
774
- this._weightedWaiters[t - 1] || (this._weightedWaiters[t - 1] = []), Mr(this._weightedWaiters[t - 1], { resolve: n, priority: r });
797
+ this._weightedWaiters[t - 1] || (this._weightedWaiters[t - 1] = []), $r(this._weightedWaiters[t - 1], { resolve: n, priority: r });
775
798
  });
776
799
  }
777
800
  isLocked() {
@@ -826,35 +849,35 @@ class wr {
826
849
  return (this._queue.length === 0 || this._queue[0].priority < r) && t <= this._value;
827
850
  }
828
851
  }
829
- function Mr(e, t) {
830
- const r = Se(e, (n) => t.priority <= n.priority);
852
+ function $r(e, t) {
853
+ const r = Te(e, (n) => t.priority <= n.priority);
831
854
  e.splice(r + 1, 0, t);
832
855
  }
833
- function Se(e, t) {
856
+ function Te(e, t) {
834
857
  for (let r = e.length - 1; r >= 0; r--)
835
858
  if (t(e[r]))
836
859
  return r;
837
860
  return -1;
838
861
  }
839
- var Sr = function(e, t, r, n) {
862
+ var jr = function(e, t, r, n) {
840
863
  function s(o) {
841
- return o instanceof r ? o : new r(function(c) {
842
- c(o);
864
+ return o instanceof r ? o : new r(function(a) {
865
+ a(o);
843
866
  });
844
867
  }
845
- return new (r || (r = Promise))(function(o, c) {
868
+ return new (r || (r = Promise))(function(o, a) {
846
869
  function f(u) {
847
870
  try {
848
871
  l(n.next(u));
849
- } catch (m) {
850
- c(m);
872
+ } catch (h) {
873
+ a(h);
851
874
  }
852
875
  }
853
876
  function i(u) {
854
877
  try {
855
878
  l(n.throw(u));
856
- } catch (m) {
857
- c(m);
879
+ } catch (h) {
880
+ a(h);
858
881
  }
859
882
  }
860
883
  function l(u) {
@@ -863,12 +886,12 @@ var Sr = function(e, t, r, n) {
863
886
  l((n = n.apply(e, t || [])).next());
864
887
  });
865
888
  };
866
- class vr {
889
+ class Nr {
867
890
  constructor(t) {
868
- this._semaphore = new wr(1, t);
891
+ this._semaphore = new Tr(1, t);
869
892
  }
870
893
  acquire() {
871
- return Sr(this, arguments, void 0, function* (t = 0) {
894
+ return jr(this, arguments, void 0, function* (t = 0) {
872
895
  const [, r] = yield this._semaphore.acquire(1, t);
873
896
  return r;
874
897
  });
@@ -889,92 +912,93 @@ class vr {
889
912
  return this._semaphore.cancel();
890
913
  }
891
914
  }
892
- class ve extends vr {
915
+ class $e extends Nr {
893
916
  constructor(t) {
894
917
  super(), Object.assign(this, t);
895
918
  }
896
919
  }
897
- const xr = (e) => new ve(e), Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
920
+ const Ir = (e) => new $e(e), nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
898
921
  __proto__: null,
899
- mutex: ve,
900
- newMutex: xr
901
- }, Symbol.toStringTag, { value: "Module" })), Tr = (e) => JSON.stringify(e, (t, r) => typeof r == "bigint" ? r.toString() : r), $r = async (e, t = 200, r = 20) => {
922
+ mutex: $e,
923
+ newMutex: Ir
924
+ }, Symbol.toStringTag, { value: "Module" })), Er = (e) => JSON.stringify(e, (t, r) => typeof r == "bigint" ? r.toString() : r), Or = async (e, t = 200, r = 20) => {
902
925
  const n = Date.now();
903
926
  for (; Date.now() - n < t; )
904
927
  await e(), await new Promise((s) => setTimeout(s, r));
905
- }, Yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
928
+ }, sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
906
929
  __proto__: null,
907
- expectAlways: $r,
908
- toString: Tr
930
+ expectAlways: Or,
931
+ toString: Er
909
932
  }, Symbol.toStringTag, { value: "Module" }));
910
933
  export {
911
- on as DataType,
912
- an as Density,
913
- cn as MultiSeries,
914
- ln as Rate,
915
- ps as RoutedWorker,
916
- un as Series,
917
- fn as Size,
918
- dn as TimeRange,
919
- _ as TimeSpan,
920
- X as TimeStamp,
921
- gs as TypedWorker,
922
- ds as URL,
923
- hn as addSamples,
924
- tn as array,
925
- nn as binary,
926
- Bn as bounds,
927
- Yn as box,
928
- Rr as breaker,
929
- hs as buildQueryString,
930
- vn as caseconv,
931
- Tn as change,
932
- jn as clamp,
933
- Zr as color,
934
- In as compare,
935
- Cr as control,
936
- mn as convertDataType,
937
- Hr as convertRenderV,
938
- bs as createMockWorkers,
939
- kn as debounce,
940
- Zn as deep,
941
- es as dimensions,
942
- rs as direction,
943
- Lr as errors,
944
- Ur as flushMicrotasks,
945
- qr as flushTaskQueue,
946
- pn as id,
947
- gn as instance,
948
- Wr as invert,
949
- bn as isCrudeSeries,
950
- Ln as isObject,
951
- _n as isTelemValue,
952
- zr as jsonRPC,
953
- qn as kv,
954
- Dr as label,
955
- zn as link,
956
- ss as location,
957
- Br as map,
958
- kr as math,
959
- Fr as migrate,
960
- Vr as notation,
961
- yn as numericTimeRangeZ,
962
- Vn as observe,
963
- On as primitive,
964
- Xn as record,
965
- Jn as runtime,
966
- Nn as scale,
967
- Xr as shallowCopy,
968
- Pr as sleep,
969
- is as spatial,
970
- Gr as status,
971
- Jr as strings,
972
- Qr as sync,
973
- Yr as testutil,
974
- Pn as throttle,
975
- wn as typedArrayZ,
976
- us as unique,
977
- Mn as uuid,
978
- cs as xy,
979
- ys as zod
934
+ dn as DataType,
935
+ mn as Density,
936
+ hn as MultiSeries,
937
+ pn as Rate,
938
+ vs as RoutedWorker,
939
+ gn as Series,
940
+ bn as Size,
941
+ _n as TimeRange,
942
+ M as TimeSpan,
943
+ J as TimeStamp,
944
+ Ss as TypedWorker,
945
+ ys as URL,
946
+ yn as addSamples,
947
+ cn as array,
948
+ un as binary,
949
+ Gn as bounds,
950
+ os as box,
951
+ qr as breaker,
952
+ ws as buildQueryString,
953
+ In as caseconv,
954
+ On as change,
955
+ kn as clamp,
956
+ zr as color,
957
+ Zn as compare,
958
+ Wr as control,
959
+ wn as convertDataType,
960
+ Kr as convertRenderV,
961
+ xs as createMockWorkers,
962
+ Dr as csv,
963
+ Ln as debounce,
964
+ zn as deep,
965
+ as as dimensions,
966
+ ls as direction,
967
+ Br as errors,
968
+ Fr as flushMicrotasks,
969
+ Vr as flushTaskQueue,
970
+ Mn as id,
971
+ vn as instance,
972
+ Hr as invert,
973
+ Sn as isCrudeSeries,
974
+ Dn as isObject,
975
+ xn as isTelemValue,
976
+ Xr as jsonRPC,
977
+ Fn as kv,
978
+ Gr as label,
979
+ Hn as link,
980
+ fs as location,
981
+ Jr as map,
982
+ Lr as math,
983
+ Qr as migrate,
984
+ Yr as notation,
985
+ Tn as numericTimeRangeZ,
986
+ Kn as observe,
987
+ Qn as primitive,
988
+ ts as record,
989
+ ns as runtime,
990
+ Pn as scale,
991
+ en as shallowCopy,
992
+ Ur as sleep,
993
+ ms as spatial,
994
+ tn as status,
995
+ rn as strings,
996
+ nn as sync,
997
+ sn as testutil,
998
+ Un as throttle,
999
+ $n as typedArrayZ,
1000
+ bs as unique,
1001
+ jn as uuid,
1002
+ ps as xy,
1003
+ $s as zod
980
1004
  };