@synnaxlabs/x 0.46.0 → 0.46.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +6 -6
- package/dist/index.cjs +3 -3
- package/dist/index.js +501 -467
- package/dist/src/math/round.d.ts +10 -0
- package/dist/src/math/round.d.ts.map +1 -1
- package/dist/src/status/status.d.ts +1 -0
- package/dist/src/status/status.d.ts.map +1 -1
- package/dist/src/strings/deduplicateFileName.d.ts +2 -0
- package/dist/src/strings/deduplicateFileName.d.ts.map +1 -0
- package/dist/src/strings/deduplicateFileName.spec.d.ts +2 -0
- package/dist/src/strings/deduplicateFileName.spec.d.ts.map +1 -0
- package/dist/src/strings/external.d.ts +3 -0
- package/dist/src/strings/external.d.ts.map +1 -0
- package/dist/src/strings/index.d.ts +1 -1
- package/dist/src/strings/index.d.ts.map +1 -1
- package/dist/src/strings/strings.d.ts +0 -1
- package/dist/src/strings/strings.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/math/round.spec.ts +168 -0
- package/src/math/round.ts +48 -0
- package/src/status/status.spec.ts +55 -0
- package/src/status/status.ts +2 -3
- package/src/strings/deduplicateFileName.spec.ts +84 -0
- package/src/strings/deduplicateFileName.ts +32 -0
- package/src/strings/external.ts +11 -0
- package/src/strings/index.ts +1 -1
- package/src/strings/strings.spec.ts +0 -42
- package/src/strings/strings.ts +0 -14
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -1,79 +1,106 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { e as
|
|
3
|
-
import { J as
|
|
4
|
-
import { c as
|
|
5
|
-
import h, { z as
|
|
6
|
-
import { h as
|
|
7
|
-
import { c as
|
|
8
|
-
import { a as
|
|
9
|
-
import { c as
|
|
10
|
-
import { c as
|
|
11
|
-
import { a as
|
|
12
|
-
import { d as
|
|
13
|
-
import { debounce as
|
|
14
|
-
import { deep as
|
|
15
|
-
import { isObject as
|
|
16
|
-
import { e as
|
|
17
|
-
import { link as
|
|
18
|
-
import { i as
|
|
19
|
-
import { b as
|
|
20
|
-
import { observe as
|
|
21
|
-
import { r as
|
|
22
|
-
import { e as
|
|
23
|
-
import { b as
|
|
24
|
-
import { d as
|
|
25
|
-
import { d as
|
|
26
|
-
import { l as
|
|
27
|
-
import { s as
|
|
28
|
-
import { x as
|
|
29
|
-
import { u as
|
|
30
|
-
import { URL as
|
|
31
|
-
import { RoutedWorker as
|
|
32
|
-
import { e as
|
|
33
|
-
const
|
|
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) => {
|
|
34
34
|
if (Number.isNaN(e) || !Number.isFinite(e)) return e;
|
|
35
|
-
const r =
|
|
35
|
+
const r = G(t);
|
|
36
36
|
if (r == 0) return e;
|
|
37
37
|
let n;
|
|
38
|
-
r >= 1e3 ? n =
|
|
38
|
+
r >= 1e3 ? n = L : r >= 1 ? n = U : n = Math.ceil(-Math.log10(r)) + J;
|
|
39
39
|
const s = 10 ** n;
|
|
40
40
|
return Math.round(e * s) / s;
|
|
41
|
-
},
|
|
41
|
+
}, st = 5, ot = 1e-10, it = (e, t) => {
|
|
42
|
+
if (Number.isNaN(e) || !Number.isFinite(e)) return e;
|
|
43
|
+
const r = Math.abs(e);
|
|
44
|
+
if (r === 0) return 0;
|
|
45
|
+
let n = !1, s = 0;
|
|
46
|
+
if (t != null) {
|
|
47
|
+
s = G(t);
|
|
48
|
+
const i = s / r;
|
|
49
|
+
n = s > 0 && i > ot;
|
|
50
|
+
}
|
|
51
|
+
if (n) {
|
|
52
|
+
let i;
|
|
53
|
+
s >= 1e3 ? i = L : s >= 1 ? i = U : i = Math.ceil(-Math.log10(s)) + J;
|
|
54
|
+
const l = 10 ** i;
|
|
55
|
+
return Math.round(e * l) / l;
|
|
56
|
+
}
|
|
57
|
+
if (r >= 1e3) {
|
|
58
|
+
const i = 10 ** L;
|
|
59
|
+
return Math.round(e * i) / i;
|
|
60
|
+
}
|
|
61
|
+
if (r >= 1) {
|
|
62
|
+
const i = 10 ** U;
|
|
63
|
+
return Math.round(e * i) / i;
|
|
64
|
+
}
|
|
65
|
+
const o = Math.floor(Math.log10(r)), f = 10 ** (st - o - 1);
|
|
66
|
+
return Math.round(e * f) / f;
|
|
67
|
+
}, kr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
42
68
|
__proto__: null,
|
|
43
|
-
MAX_INT16:
|
|
44
|
-
MAX_INT32:
|
|
45
|
-
MAX_INT64:
|
|
46
|
-
MAX_INT64_NUMBER:
|
|
47
|
-
MAX_INT8:
|
|
48
|
-
MAX_UINT16:
|
|
49
|
-
MAX_UINT32:
|
|
50
|
-
MAX_UINT64:
|
|
51
|
-
MAX_UINT64_NUMBER:
|
|
52
|
-
MAX_UINT8:
|
|
53
|
-
MIN_INT16:
|
|
54
|
-
MIN_INT32:
|
|
55
|
-
MIN_INT64:
|
|
56
|
-
MIN_INT64_NUMBER:
|
|
57
|
-
MIN_INT8:
|
|
58
|
-
abs:
|
|
59
|
-
add:
|
|
60
|
-
closeTo:
|
|
61
|
-
div:
|
|
62
|
-
equal:
|
|
63
|
-
isInteger:
|
|
64
|
-
max:
|
|
65
|
-
min:
|
|
66
|
-
mult:
|
|
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,
|
|
67
93
|
roundBySpan: nt,
|
|
68
|
-
roundToNearestMagnitude:
|
|
69
|
-
|
|
70
|
-
|
|
94
|
+
roundToNearestMagnitude: tt,
|
|
95
|
+
smartRound: it,
|
|
96
|
+
sub: rt
|
|
97
|
+
}, Symbol.toStringTag, { value: "Module" })), Q = async (e) => await new Promise(
|
|
71
98
|
(t) => setTimeout(t, _.fromMilliseconds(e).milliseconds)
|
|
72
|
-
),
|
|
99
|
+
), Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
73
100
|
__proto__: null,
|
|
74
|
-
sleep:
|
|
101
|
+
sleep: Q
|
|
75
102
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
76
|
-
class
|
|
103
|
+
class at {
|
|
77
104
|
config;
|
|
78
105
|
retries;
|
|
79
106
|
interval;
|
|
@@ -82,7 +109,7 @@ class st {
|
|
|
82
109
|
baseInterval: new _(t?.baseInterval ?? _.seconds(1)),
|
|
83
110
|
maxRetries: t?.maxRetries ?? 5,
|
|
84
111
|
scale: t?.scale ?? 1,
|
|
85
|
-
sleepFn: t?.sleepFn ??
|
|
112
|
+
sleepFn: t?.sleepFn ?? Q
|
|
86
113
|
}, this.retries = 0, this.interval = new _(this.config.baseInterval);
|
|
87
114
|
}
|
|
88
115
|
async wait() {
|
|
@@ -96,73 +123,73 @@ class st {
|
|
|
96
123
|
this.retries = 0, this.interval = this.config.baseInterval;
|
|
97
124
|
}
|
|
98
125
|
}
|
|
99
|
-
const
|
|
126
|
+
const ct = a.object({
|
|
100
127
|
baseInterval: _.z.optional(),
|
|
101
|
-
maxRetries:
|
|
102
|
-
scale:
|
|
103
|
-
}),
|
|
128
|
+
maxRetries: a.number().optional(),
|
|
129
|
+
scale: a.number().optional()
|
|
130
|
+
}), Rr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
104
131
|
__proto__: null,
|
|
105
|
-
Breaker:
|
|
106
|
-
breakerConfigZ:
|
|
107
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
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) => {
|
|
108
135
|
if (e == null) return;
|
|
109
|
-
const t =
|
|
110
|
-
if (t.success) return
|
|
136
|
+
const t = k.safeParse(e);
|
|
137
|
+
if (t.success) return te(t.data);
|
|
111
138
|
if (typeof e == "string") return e;
|
|
112
139
|
throw t.error;
|
|
113
140
|
}), d = (e, t = 1) => {
|
|
114
|
-
if (e =
|
|
141
|
+
if (e = A.parse(e), typeof e == "string") return E(e, t);
|
|
115
142
|
if (Array.isArray(e)) {
|
|
116
143
|
if (e.length < 3 || e.length > 4)
|
|
117
144
|
throw new Error(`Invalid color: [${e.join(", ")}]`);
|
|
118
145
|
return e.length === 3 ? [...e, t] : e;
|
|
119
146
|
}
|
|
120
147
|
return e.rgba255;
|
|
121
|
-
},
|
|
148
|
+
}, ee = (e, t) => {
|
|
122
149
|
if (e == null || t == null) return e == t;
|
|
123
150
|
const r = d(e), n = d(t);
|
|
124
151
|
return r.every((s, o) => s === n[o]);
|
|
125
|
-
},
|
|
152
|
+
}, _t = ((e) => {
|
|
126
153
|
if (e == null) return;
|
|
127
154
|
const [t, r, n, s] = d(e);
|
|
128
155
|
return `#${j(t)}${j(r)}${j(n)}${s === 1 ? "" : j(s * 255)}`;
|
|
129
|
-
}),
|
|
156
|
+
}), te = (e) => {
|
|
130
157
|
const [t, r, n, s] = d(e);
|
|
131
158
|
return `rgba(${t}, ${r}, ${n}, ${s})`;
|
|
132
|
-
},
|
|
159
|
+
}, yt = (e) => `rgb(${re(e)})`, re = (e) => {
|
|
133
160
|
const [t, r, n] = d(e);
|
|
134
161
|
return `${t}, ${r}, ${n}`;
|
|
135
|
-
},
|
|
162
|
+
}, wt = (e) => [...B(e), S(e)], B = (e) => [
|
|
136
163
|
y(e) / 255,
|
|
137
164
|
w(e) / 255,
|
|
138
|
-
|
|
139
|
-
], y = (e) => d(e)[0], w = (e) => d(e)[1],
|
|
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) => {
|
|
140
167
|
const [r, n, s] = d(e);
|
|
141
168
|
if (t > 100)
|
|
142
169
|
throw new Error(`Color opacity must be between 0 and 100, got ${t}`);
|
|
143
170
|
return t > 1 && (t /= 100), [r, n, s, t];
|
|
144
|
-
},
|
|
145
|
-
const [t, r, n] =
|
|
171
|
+
}, v = (e) => {
|
|
172
|
+
const [t, r, n] = B(e).map(
|
|
146
173
|
(s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
|
|
147
174
|
);
|
|
148
175
|
return Number((0.2126 * t + 0.7152 * r + 0.0722 * n).toFixed(3));
|
|
149
|
-
},
|
|
150
|
-
const [t, r, n] =
|
|
176
|
+
}, xt = (e) => {
|
|
177
|
+
const [t, r, n] = B(e);
|
|
151
178
|
return 1 - (Math.max(t, r, n) - Math.min(t, r, n));
|
|
152
|
-
},
|
|
153
|
-
const r = d(e), n = d(t), s =
|
|
179
|
+
}, q = (e, t) => {
|
|
180
|
+
const r = d(e), n = d(t), s = v(r), o = v(n);
|
|
154
181
|
return (Math.max(s, o) + 0.5) / (Math.min(s, o) + 0.5);
|
|
155
|
-
},
|
|
182
|
+
}, Tt = (e, ...t) => {
|
|
156
183
|
if (t.length === 0)
|
|
157
184
|
throw new Error("[Color.pickByContrast] - must provide at least one color");
|
|
158
|
-
const r = d(e), [n] = t.sort((s, o) =>
|
|
185
|
+
const r = d(e), [n] = t.sort((s, o) => q(r, o) - q(r, s));
|
|
159
186
|
return d(n);
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
e.length === 8 ?
|
|
165
|
-
]),
|
|
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 = {
|
|
166
193
|
black: "#000000",
|
|
167
194
|
white: "#ffffff",
|
|
168
195
|
red: "#ff0000",
|
|
@@ -194,62 +221,62 @@ const ot = i.object({
|
|
|
194
221
|
khaki: "#f0e68c",
|
|
195
222
|
crimson: "#dc143c",
|
|
196
223
|
transparent: "transparent"
|
|
197
|
-
},
|
|
224
|
+
}, Et = (e) => {
|
|
198
225
|
if (!e) return;
|
|
199
226
|
const t = e.trim().toLowerCase();
|
|
200
227
|
if (!(t === "transparent" || t === "none")) {
|
|
201
228
|
if (t.startsWith("#")) {
|
|
202
229
|
if (t.length === 4) {
|
|
203
230
|
const r = t[1], n = t[2], s = t[3], o = `#${r}${r}${n}${n}${s}${s}`;
|
|
204
|
-
if (I.safeParse(o).success) return
|
|
231
|
+
if (I.safeParse(o).success) return E(o);
|
|
205
232
|
}
|
|
206
|
-
return (t.length === 7 || t.length === 9) && I.safeParse(t).success ?
|
|
233
|
+
return (t.length === 7 || t.length === 9) && I.safeParse(t).success ? E(t) : void 0;
|
|
207
234
|
}
|
|
208
235
|
if (t.startsWith("rgb")) {
|
|
209
236
|
const r = t.match(
|
|
210
237
|
/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/
|
|
211
238
|
);
|
|
212
239
|
if (r) {
|
|
213
|
-
const [, n, s, o,
|
|
214
|
-
return [parseInt(n), parseInt(s), parseInt(o),
|
|
240
|
+
const [, n, s, o, c] = r;
|
|
241
|
+
return [parseInt(n), parseInt(s), parseInt(o), c ? parseFloat(c) : 1];
|
|
215
242
|
}
|
|
216
243
|
}
|
|
217
|
-
if (
|
|
244
|
+
if (H[t]) return E(H[t]);
|
|
218
245
|
}
|
|
219
|
-
},
|
|
220
|
-
e =
|
|
246
|
+
}, It = (e) => {
|
|
247
|
+
e = K.parse(e);
|
|
221
248
|
let [t, r, n] = e;
|
|
222
249
|
const s = e[3];
|
|
223
250
|
t /= 360, r /= 100, n /= 100;
|
|
224
|
-
let o,
|
|
251
|
+
let o, c, f;
|
|
225
252
|
if (r === 0)
|
|
226
|
-
o =
|
|
253
|
+
o = c = f = n;
|
|
227
254
|
else {
|
|
228
|
-
const
|
|
229
|
-
o = C(
|
|
255
|
+
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);
|
|
230
257
|
}
|
|
231
|
-
return [Math.round(o * 255), Math.round(
|
|
232
|
-
}, 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),
|
|
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) => {
|
|
233
260
|
e = O.parse(e);
|
|
234
261
|
let [t, r, n] = e;
|
|
235
262
|
const s = e[3];
|
|
236
263
|
t /= 255, r /= 255, n /= 255;
|
|
237
|
-
const o = Math.max(t, r, n),
|
|
238
|
-
let f,
|
|
239
|
-
if (o ===
|
|
240
|
-
f =
|
|
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)
|
|
267
|
+
f = i = 0;
|
|
241
268
|
else {
|
|
242
|
-
const u = o -
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
return f *= 360,
|
|
246
|
-
},
|
|
247
|
-
key:
|
|
248
|
-
color:
|
|
249
|
-
position:
|
|
250
|
-
switched:
|
|
251
|
-
}),
|
|
252
|
-
if (e.length === 0) return
|
|
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;
|
|
271
|
+
}
|
|
272
|
+
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) => {
|
|
279
|
+
if (e.length === 0) return F;
|
|
253
280
|
if (e = e.slice().sort((r, n) => r.position - n.position), t <= e[0].position) return d(e[0].color);
|
|
254
281
|
if (t >= e[e.length - 1].position)
|
|
255
282
|
return d(e[e.length - 1].color);
|
|
@@ -258,111 +285,111 @@ const ot = i.object({
|
|
|
258
285
|
if (t < n.position || t > s.position) continue;
|
|
259
286
|
if (t === n.position) return d(n.color);
|
|
260
287
|
if (t === s.position) return d(s.color);
|
|
261
|
-
const o = (t - n.position) / (s.position - n.position),
|
|
262
|
-
y(
|
|
263
|
-
),
|
|
264
|
-
w(
|
|
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))
|
|
290
|
+
), l = Math.round(
|
|
291
|
+
w(c) + o * (w(f) - w(c))
|
|
265
292
|
), u = Math.round(
|
|
266
|
-
|
|
267
|
-
),
|
|
268
|
-
return d([
|
|
293
|
+
M(c) + o * (M(f) - M(c))
|
|
294
|
+
), m = S(c) + o * (S(f) - S(c));
|
|
295
|
+
return d([i, l, u, m]);
|
|
269
296
|
}
|
|
270
297
|
return d(e[e.length - 1].color);
|
|
271
|
-
},
|
|
272
|
-
key:
|
|
273
|
-
name:
|
|
274
|
-
color:
|
|
275
|
-
}),
|
|
276
|
-
key:
|
|
277
|
-
name:
|
|
278
|
-
swatches:
|
|
279
|
-
}),
|
|
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({
|
|
280
307
|
__proto__: null,
|
|
281
|
-
BLACK:
|
|
282
|
-
WHITE:
|
|
283
|
-
ZERO:
|
|
308
|
+
BLACK: At,
|
|
309
|
+
WHITE: kt,
|
|
310
|
+
ZERO: F,
|
|
284
311
|
aValue: S,
|
|
285
|
-
bValue:
|
|
286
|
-
colorZ:
|
|
312
|
+
bValue: M,
|
|
313
|
+
colorZ: k,
|
|
287
314
|
construct: d,
|
|
288
|
-
contrast:
|
|
289
|
-
crudeZ:
|
|
290
|
-
cssString:
|
|
291
|
-
equals:
|
|
292
|
-
fromCSS:
|
|
293
|
-
fromGradient:
|
|
294
|
-
fromHSLA:
|
|
315
|
+
contrast: q,
|
|
316
|
+
crudeZ: A,
|
|
317
|
+
cssString: bt,
|
|
318
|
+
equals: ee,
|
|
319
|
+
fromCSS: Et,
|
|
320
|
+
fromGradient: Rt,
|
|
321
|
+
fromHSLA: It,
|
|
295
322
|
gValue: w,
|
|
296
|
-
gradientZ:
|
|
297
|
-
grayness:
|
|
298
|
-
hex:
|
|
299
|
-
hsla:
|
|
300
|
-
isColor:
|
|
301
|
-
isCrude:
|
|
302
|
-
isDark:
|
|
303
|
-
isLight:
|
|
304
|
-
isZero:
|
|
305
|
-
luminance:
|
|
306
|
-
paletteZ:
|
|
307
|
-
pickByContrast:
|
|
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,
|
|
308
335
|
rValue: y,
|
|
309
|
-
rgbCSS:
|
|
310
|
-
rgbString:
|
|
311
|
-
rgba1:
|
|
312
|
-
rgbaCSS:
|
|
313
|
-
setAlpha:
|
|
314
|
-
stopZ:
|
|
315
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
316
|
-
lower:
|
|
317
|
-
upper:
|
|
318
|
-
},
|
|
319
|
-
name:
|
|
320
|
-
key:
|
|
321
|
-
}), x = (e) =>
|
|
322
|
-
subject:
|
|
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,
|
|
323
350
|
resource: e,
|
|
324
|
-
authority:
|
|
325
|
-
}),
|
|
351
|
+
authority: se
|
|
352
|
+
}), Ut = (...e) => (t) => t.filter((r) => {
|
|
326
353
|
let n = !1;
|
|
327
354
|
return r.to != null && (n = e.includes(r.to.resource)), r.from != null && !n && (n = e.includes(r.from.resource)), n;
|
|
328
|
-
}),
|
|
355
|
+
}), ce = (e) => a.object({
|
|
329
356
|
from: x(e),
|
|
330
|
-
to:
|
|
331
|
-
}),
|
|
332
|
-
from:
|
|
357
|
+
to: a.null()
|
|
358
|
+
}), le = (e) => a.object({
|
|
359
|
+
from: a.null(),
|
|
333
360
|
to: x(e)
|
|
334
|
-
}),
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
361
|
+
}), qt = (e) => a.union([
|
|
362
|
+
ce(e),
|
|
363
|
+
le(e),
|
|
364
|
+
a.object({
|
|
338
365
|
from: x(e),
|
|
339
366
|
to: x(e)
|
|
340
367
|
})
|
|
341
|
-
]),
|
|
368
|
+
]), Cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
342
369
|
__proto__: null,
|
|
343
|
-
ABSOLUTE_AUTHORITY:
|
|
344
|
-
AUTHORITY_BOUNDS:
|
|
345
|
-
ZERO_AUTHORITY:
|
|
346
|
-
acquireZ:
|
|
347
|
-
authorityZ:
|
|
348
|
-
filterTransfersByChannelKey:
|
|
349
|
-
releaseZ:
|
|
370
|
+
ABSOLUTE_AUTHORITY: oe,
|
|
371
|
+
AUTHORITY_BOUNDS: Lt,
|
|
372
|
+
ZERO_AUTHORITY: ie,
|
|
373
|
+
acquireZ: le,
|
|
374
|
+
authorityZ: se,
|
|
375
|
+
filterTransfersByChannelKey: Ut,
|
|
376
|
+
releaseZ: ce,
|
|
350
377
|
stateZ: x,
|
|
351
|
-
subjectZ:
|
|
352
|
-
transferZ:
|
|
353
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
378
|
+
subjectZ: ae,
|
|
379
|
+
transferZ: qt
|
|
380
|
+
}, Symbol.toStringTag, { value: "Module" })), Wt = (e) => Object.getOwnPropertySymbols(globalThis).includes(e), zt = (e, t) => {
|
|
354
381
|
const r = Symbol.for(e);
|
|
355
|
-
if (!
|
|
382
|
+
if (!Wt(r)) {
|
|
356
383
|
const n = t();
|
|
357
384
|
Object.defineProperty(globalThis, r, { value: n });
|
|
358
385
|
}
|
|
359
386
|
return () => globalThis[r];
|
|
360
|
-
},
|
|
361
|
-
static discriminator =
|
|
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;
|
|
362
389
|
discriminator = b.discriminator;
|
|
363
390
|
static TYPE = e;
|
|
364
391
|
type = b.TYPE;
|
|
365
|
-
static matches =
|
|
392
|
+
static matches = Dt(e);
|
|
366
393
|
matches = b.matches;
|
|
367
394
|
constructor(r, n) {
|
|
368
395
|
super(r, n), this.name = b.TYPE;
|
|
@@ -370,68 +397,68 @@ const ot = i.object({
|
|
|
370
397
|
static sub(r) {
|
|
371
398
|
return T(`${e}.${r}`);
|
|
372
399
|
}
|
|
373
|
-
},
|
|
400
|
+
}, fe = (e) => {
|
|
374
401
|
if (e == null || typeof e != "object") return !1;
|
|
375
402
|
const t = e;
|
|
376
|
-
if (t.discriminator !==
|
|
403
|
+
if (t.discriminator !== ue) return !1;
|
|
377
404
|
if (!("type" in t))
|
|
378
405
|
throw new Error(
|
|
379
406
|
`X Error is missing its type property: ${JSON.stringify(t)}`
|
|
380
407
|
);
|
|
381
408
|
return !0;
|
|
382
|
-
},
|
|
383
|
-
class
|
|
409
|
+
}, p = "unknown", W = "nil";
|
|
410
|
+
class Bt {
|
|
384
411
|
providers = [];
|
|
385
412
|
register(t) {
|
|
386
413
|
this.providers.push(t);
|
|
387
414
|
}
|
|
388
415
|
encode(t) {
|
|
389
|
-
if (t == null) return { type:
|
|
390
|
-
if (
|
|
416
|
+
if (t == null) return { type: W, data: "" };
|
|
417
|
+
if (fe(t))
|
|
391
418
|
for (const r of this.providers) {
|
|
392
419
|
const n = r.encode(t);
|
|
393
420
|
if (n != null) return n;
|
|
394
421
|
}
|
|
395
|
-
if (t instanceof Error) return { type:
|
|
396
|
-
if (typeof t == "string") return { type:
|
|
422
|
+
if (t instanceof Error) return { type: p, data: t.message };
|
|
423
|
+
if (typeof t == "string") return { type: p, data: t };
|
|
397
424
|
try {
|
|
398
|
-
return { type:
|
|
425
|
+
return { type: p, data: JSON.stringify(t) };
|
|
399
426
|
} catch {
|
|
400
|
-
return { type:
|
|
427
|
+
return { type: p, data: "unable to encode error information" };
|
|
401
428
|
}
|
|
402
429
|
}
|
|
403
430
|
decode(t) {
|
|
404
|
-
if (t == null || t.type ===
|
|
405
|
-
if (t.type ===
|
|
431
|
+
if (t == null || t.type === W) return null;
|
|
432
|
+
if (t.type === p) return new z(t.data);
|
|
406
433
|
for (const r of this.providers) {
|
|
407
434
|
const n = r.decode(t);
|
|
408
435
|
if (n != null) return n;
|
|
409
436
|
}
|
|
410
|
-
return new
|
|
437
|
+
return new z(t.data);
|
|
411
438
|
}
|
|
412
439
|
}
|
|
413
|
-
const
|
|
414
|
-
class
|
|
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") {
|
|
415
442
|
}
|
|
416
|
-
const
|
|
417
|
-
class
|
|
443
|
+
const Xt = a.object({ type: a.string(), data: a.string() });
|
|
444
|
+
class Gt extends T("canceled") {
|
|
418
445
|
}
|
|
419
|
-
class
|
|
446
|
+
class Jt extends T("not_implemented") {
|
|
420
447
|
}
|
|
421
|
-
const
|
|
448
|
+
const Lr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
422
449
|
__proto__: null,
|
|
423
|
-
Canceled:
|
|
424
|
-
NONE:
|
|
425
|
-
NotImplemented:
|
|
426
|
-
UNKNOWN:
|
|
427
|
-
Unknown:
|
|
450
|
+
Canceled: Gt,
|
|
451
|
+
NONE: W,
|
|
452
|
+
NotImplemented: Jt,
|
|
453
|
+
UNKNOWN: p,
|
|
454
|
+
Unknown: z,
|
|
428
455
|
createTyped: T,
|
|
429
|
-
decode:
|
|
430
|
-
encode:
|
|
431
|
-
isTyped:
|
|
432
|
-
payloadZ:
|
|
433
|
-
register:
|
|
434
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
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({
|
|
435
462
|
jsonrpc: h.literal("2.0"),
|
|
436
463
|
method: h.string(),
|
|
437
464
|
// params should be z.union([z.record(z.string(), z.json()),
|
|
@@ -439,12 +466,12 @@ const Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
439
466
|
// definition of params then in the JSON-RPC spec.
|
|
440
467
|
params: h.any().optional(),
|
|
441
468
|
id: h.union([h.string(), h.number(), h.null()]).optional()
|
|
442
|
-
}),
|
|
469
|
+
}), he = h.object({
|
|
443
470
|
jsonrpc: h.literal("2.0"),
|
|
444
471
|
id: h.union([h.string(), h.number(), h.null()])
|
|
445
|
-
}),
|
|
472
|
+
}), Qt = he.extend({
|
|
446
473
|
result: h.json()
|
|
447
|
-
}),
|
|
474
|
+
}), Yt = he.extend({
|
|
448
475
|
error: h.object({
|
|
449
476
|
code: h.number().int(),
|
|
450
477
|
// This should be z.string(), but the VSCode JSON RPC implementation uses a looser
|
|
@@ -452,72 +479,72 @@ const Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
452
479
|
message: h.string().optional(),
|
|
453
480
|
data: h.json().optional()
|
|
454
481
|
})
|
|
455
|
-
}),
|
|
482
|
+
}), me = h.union([Qt, Yt]), pe = h.union([de, me]), Kt = (e) => {
|
|
456
483
|
const t = new TextDecoder();
|
|
457
484
|
let r = new Uint8Array(0), n = null;
|
|
458
485
|
return (s) => {
|
|
459
486
|
let o;
|
|
460
487
|
typeof s == "string" ? o = new TextEncoder().encode(s) : s instanceof ArrayBuffer ? o = new Uint8Array(s) : o = s;
|
|
461
|
-
const
|
|
462
|
-
for (
|
|
488
|
+
const c = new Uint8Array(r.length + o.length);
|
|
489
|
+
for (c.set(r), c.set(o, r.length), r = c; r.length > 0; ) {
|
|
463
490
|
if (n === null) {
|
|
464
|
-
const
|
|
465
|
-
if (!
|
|
466
|
-
n = parseInt(
|
|
467
|
-
const
|
|
468
|
-
r = r.slice(
|
|
491
|
+
const i = t.decode(r).match(/^Content-Length: (\d+)\r?\n\r?\n/);
|
|
492
|
+
if (!i) break;
|
|
493
|
+
n = parseInt(i[1]);
|
|
494
|
+
const l = new TextEncoder().encode(i[0]).length;
|
|
495
|
+
r = r.slice(l);
|
|
469
496
|
}
|
|
470
497
|
if (n !== null && r.length >= n) {
|
|
471
498
|
const f = r.slice(0, n);
|
|
472
499
|
r = r.slice(n), n = null;
|
|
473
|
-
const
|
|
474
|
-
e(
|
|
500
|
+
const i = t.decode(f), l = Te.decodeString(i, pe);
|
|
501
|
+
e(l);
|
|
475
502
|
} else break;
|
|
476
503
|
}
|
|
477
504
|
};
|
|
478
|
-
},
|
|
505
|
+
}, er = (e) => {
|
|
479
506
|
const t = JSON.stringify(e);
|
|
480
507
|
return `Content-Length: ${new TextEncoder().encode(t).length}\r
|
|
481
508
|
\r
|
|
482
509
|
` + t;
|
|
483
|
-
},
|
|
510
|
+
}, zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
484
511
|
__proto__: null,
|
|
485
|
-
encodeMessage:
|
|
486
|
-
messageZ:
|
|
487
|
-
requestZ:
|
|
488
|
-
responseZ:
|
|
489
|
-
streamDecodeChunks:
|
|
490
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
491
|
-
key:
|
|
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,
|
|
492
519
|
name: h.string().min(1),
|
|
493
520
|
color: h.string()
|
|
494
|
-
}),
|
|
521
|
+
}), Dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
495
522
|
__proto__: null,
|
|
496
|
-
keyZ:
|
|
497
|
-
labelZ:
|
|
498
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
523
|
+
keyZ: ge,
|
|
524
|
+
labelZ: be
|
|
525
|
+
}, Symbol.toStringTag, { value: "Module" })), tr = (e, t, r) => {
|
|
499
526
|
const n = e.get(t);
|
|
500
527
|
return n === void 0 ? (e.set(t, r), r) : n;
|
|
501
|
-
},
|
|
528
|
+
}, Br = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
502
529
|
__proto__: null,
|
|
503
|
-
getOrSetDefault:
|
|
504
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
530
|
+
getOrSetDefault: tr
|
|
531
|
+
}, Symbol.toStringTag, { value: "Module" })), D = a.string().regex(/^\d+\.\d+\.\d+$/), $ = ((e, t, r = {}) => {
|
|
505
532
|
r.checkMajor ??= !0, r.checkMinor ??= !0, r.checkPatch ??= !0;
|
|
506
|
-
const n =
|
|
533
|
+
const n = D.parse(e), s = D.parse(t), [o, c, f] = n.split(".").map(Number), [i, l, u] = s.split(".").map(Number);
|
|
507
534
|
if (r.checkMajor) {
|
|
508
|
-
if (o <
|
|
509
|
-
if (o >
|
|
535
|
+
if (o < i) return R;
|
|
536
|
+
if (o > i) return Z;
|
|
510
537
|
}
|
|
511
538
|
if (r.checkMinor) {
|
|
512
|
-
if (
|
|
513
|
-
if (
|
|
539
|
+
if (c < l) return R;
|
|
540
|
+
if (c > l) return Z;
|
|
514
541
|
}
|
|
515
542
|
if (r.checkPatch) {
|
|
516
|
-
if (f < u) return
|
|
517
|
-
if (f > u) return
|
|
543
|
+
if (f < u) return R;
|
|
544
|
+
if (f > u) return Z;
|
|
518
545
|
}
|
|
519
|
-
return
|
|
520
|
-
}),
|
|
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 = ({
|
|
521
548
|
name: e,
|
|
522
549
|
migrate: t
|
|
523
550
|
}) => (r) => {
|
|
@@ -527,7 +554,7 @@ const Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
527
554
|
} catch (n) {
|
|
528
555
|
throw console.log(`${e} failed to migrate from ${r.version}`), console.error(n), n;
|
|
529
556
|
}
|
|
530
|
-
},
|
|
557
|
+
}, or = ({
|
|
531
558
|
name: e,
|
|
532
559
|
migrations: t,
|
|
533
560
|
targetSchema: r,
|
|
@@ -536,59 +563,59 @@ const Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
536
563
|
}) => {
|
|
537
564
|
const o = Object.keys(t).sort($).pop();
|
|
538
565
|
if (o == null)
|
|
539
|
-
return (
|
|
540
|
-
if (
|
|
566
|
+
return (l) => {
|
|
567
|
+
if (l.version ??= n, l.version !== s.version)
|
|
541
568
|
return console.log(
|
|
542
|
-
`${e} version ${
|
|
569
|
+
`${e} version ${l.version} is newer than latest version of ${s.version}.
|
|
543
570
|
Returning default instead.
|
|
544
571
|
`
|
|
545
572
|
), s;
|
|
546
573
|
try {
|
|
547
|
-
return r != null ? r.parse(
|
|
574
|
+
return r != null ? r.parse(l) : l;
|
|
548
575
|
} catch (u) {
|
|
549
576
|
return console.log(`${e} failed to parse default. Exiting with default`), console.error(u), s;
|
|
550
577
|
}
|
|
551
578
|
};
|
|
552
|
-
const
|
|
579
|
+
const c = Object.keys(t).length;
|
|
553
580
|
let f = !1;
|
|
554
|
-
const
|
|
581
|
+
const i = (l) => {
|
|
555
582
|
try {
|
|
556
|
-
if (
|
|
557
|
-
return console.log(f ? `${e} ${
|
|
558
|
-
const u =
|
|
559
|
-
return f = !0,
|
|
583
|
+
if (c === 0 || _e(l.version, o))
|
|
584
|
+
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);
|
|
560
587
|
} catch (u) {
|
|
561
588
|
return console.log(
|
|
562
|
-
`${e} failed to migrate from ${
|
|
589
|
+
`${e} failed to migrate from ${l.version} to ${o}`
|
|
563
590
|
), console.error(u), s;
|
|
564
591
|
}
|
|
565
592
|
};
|
|
566
|
-
return (
|
|
593
|
+
return (l) => {
|
|
567
594
|
try {
|
|
568
|
-
if (
|
|
595
|
+
if (l.version == null)
|
|
569
596
|
if (n != null)
|
|
570
597
|
console.log(
|
|
571
598
|
`${e} version is null. Setting version to default of ${n}`
|
|
572
|
-
),
|
|
599
|
+
), l.version = n;
|
|
573
600
|
else
|
|
574
601
|
return console.log(
|
|
575
602
|
`${e} version is null and no default version set. Exiting with default`
|
|
576
603
|
), s;
|
|
577
|
-
return l
|
|
604
|
+
return i(l);
|
|
578
605
|
} catch (u) {
|
|
579
606
|
return console.log(`${e} failed to parse final result. Exiting with default`), console.error(u), s;
|
|
580
607
|
}
|
|
581
608
|
};
|
|
582
|
-
},
|
|
609
|
+
}, Fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
583
610
|
__proto__: null,
|
|
584
611
|
compareSemVer: $,
|
|
585
|
-
createMigration:
|
|
586
|
-
migrator:
|
|
587
|
-
semVerNewer:
|
|
588
|
-
semVerOlder:
|
|
589
|
-
semVerZ:
|
|
590
|
-
versionsEqual:
|
|
591
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
612
|
+
createMigration: sr,
|
|
613
|
+
migrator: or,
|
|
614
|
+
semVerNewer: _e,
|
|
615
|
+
semVerOlder: nr,
|
|
616
|
+
semVerZ: D,
|
|
617
|
+
versionsEqual: rr
|
|
618
|
+
}, Symbol.toStringTag, { value: "Module" })), ye = ["standard", "scientific", "engineering"], ir = a.enum(ye), ar = (e, t, r) => {
|
|
592
619
|
if (Number.isNaN(e)) return "NaN";
|
|
593
620
|
if (e === 1 / 0) return "∞";
|
|
594
621
|
if (e === -1 / 0) return "-∞";
|
|
@@ -597,139 +624,146 @@ const Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
597
624
|
return t === 0 ? "0ᴇ0" : `0.${"0".repeat(t)}ᴇ0`;
|
|
598
625
|
let n;
|
|
599
626
|
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}`;
|
|
600
|
-
},
|
|
627
|
+
}, Vr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
601
628
|
__proto__: null,
|
|
602
|
-
NOTATIONS:
|
|
603
|
-
notationZ:
|
|
604
|
-
stringifyNumber:
|
|
605
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
629
|
+
NOTATIONS: ye,
|
|
630
|
+
notationZ: ir,
|
|
631
|
+
stringifyNumber: ar
|
|
632
|
+
}, Symbol.toStringTag, { value: "Module" })), Hr = (e) => {
|
|
606
633
|
if (e === void 0 || typeof e == "string" || typeof e == "number")
|
|
607
634
|
return e;
|
|
608
635
|
if (e.toString === void 0) throw new Error("invalid renderer");
|
|
609
636
|
return e.toString();
|
|
610
|
-
},
|
|
637
|
+
}, Xr = (e) => Array.isArray(e) ? [...e] : typeof e == "object" && e !== null ? { ...e } : e, we = a.enum([
|
|
611
638
|
"success",
|
|
612
639
|
"info",
|
|
613
640
|
"warning",
|
|
614
641
|
"error",
|
|
615
642
|
"loading",
|
|
616
643
|
"disabled"
|
|
617
|
-
]),
|
|
618
|
-
key:
|
|
619
|
-
name:
|
|
620
|
-
variant:
|
|
621
|
-
message:
|
|
622
|
-
description:
|
|
623
|
-
time:
|
|
624
|
-
labels:
|
|
625
|
-
details: e ??
|
|
626
|
-
}),
|
|
627
|
-
stack:
|
|
628
|
-
|
|
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) => {
|
|
629
657
|
if (!(e instanceof Error)) throw e;
|
|
630
|
-
return
|
|
658
|
+
return Me({
|
|
631
659
|
variant: "error",
|
|
632
660
|
message: t ?? e.message,
|
|
633
661
|
description: t != null ? e.message : void 0,
|
|
634
|
-
details: {
|
|
635
|
-
stack: e.stack ?? ""
|
|
636
|
-
}
|
|
662
|
+
details: { stack: e.stack ?? "", error: e }
|
|
637
663
|
});
|
|
638
|
-
},
|
|
639
|
-
key:
|
|
640
|
-
time:
|
|
664
|
+
}, Me = (e) => ({
|
|
665
|
+
key: We(),
|
|
666
|
+
time: X.now(),
|
|
641
667
|
name: "",
|
|
642
668
|
...e
|
|
643
|
-
}),
|
|
669
|
+
}), fr = (e, t = []) => {
|
|
644
670
|
if (e != null)
|
|
645
671
|
return Array.isArray(t) ? t.includes(e) ? e : void 0 : t === e ? e : void 0;
|
|
646
|
-
},
|
|
672
|
+
}, dr = (e, t = []) => {
|
|
647
673
|
if (e != null)
|
|
648
674
|
return Array.isArray(t) ? t.includes(e) ? void 0 : e : t === e ? void 0 : e;
|
|
649
|
-
},
|
|
675
|
+
}, Gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
650
676
|
__proto__: null,
|
|
651
|
-
create:
|
|
652
|
-
exceptionDetailsSchema:
|
|
653
|
-
fromException:
|
|
654
|
-
keepVariants:
|
|
655
|
-
removeVariants:
|
|
656
|
-
statusZ:
|
|
657
|
-
variantZ:
|
|
658
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
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) => {
|
|
685
|
+
if (!t.has(e)) return e;
|
|
686
|
+
let r = e, n = 1, s = e;
|
|
687
|
+
for (; t.has(s); ) {
|
|
688
|
+
const o = s.match(mr);
|
|
689
|
+
o ? (r = s.slice(0, o.index).trim(), n = parseInt(o[1]) + 1) : (r = s, n = 1), s = `${r} (${n})`;
|
|
690
|
+
}
|
|
691
|
+
return s;
|
|
692
|
+
}, mr = /\((\d+)\)$/, pr = (e, t = "") => {
|
|
659
693
|
if (typeof e == "string") return e;
|
|
660
694
|
const r = e.length;
|
|
661
695
|
return r === 0 ? t : r === 1 ? e[0] : r === 2 ? `${e[0]} and ${e[1]}` : `${e.slice(0, -1).join(", ")}, and ${e[r - 1]}`;
|
|
662
|
-
},
|
|
663
|
-
const t = e.split(" "), r = /* @__PURE__ */ new Set(), n = t.map((
|
|
696
|
+
}, gr = (e) => {
|
|
697
|
+
const t = e.split(" "), r = /* @__PURE__ */ new Set(), n = t.map((i) => i.charAt(0).toLowerCase()).join("");
|
|
664
698
|
r.add(n.replace(/-/g, "_")), r.add(n.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_"));
|
|
665
699
|
const s = /\d+/g;
|
|
666
|
-
e.match(s) && t.forEach((
|
|
667
|
-
if (s.test(
|
|
668
|
-
const u = t.map((
|
|
700
|
+
e.match(s) && t.forEach((i, l) => {
|
|
701
|
+
if (s.test(i)) {
|
|
702
|
+
const u = t.map((m, P) => P !== l ? m.charAt(0).toLowerCase() : m).join("");
|
|
669
703
|
r.add(u.replace(/-/g, "_")), r.add(
|
|
670
704
|
u.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_")
|
|
671
705
|
);
|
|
672
706
|
}
|
|
673
707
|
});
|
|
674
|
-
const
|
|
675
|
-
(
|
|
708
|
+
const c = t.map(
|
|
709
|
+
(i) => (i.length > 3 ? i.substring(0, 3) : i).toLowerCase()
|
|
676
710
|
);
|
|
677
|
-
return r.add(
|
|
678
|
-
(
|
|
711
|
+
return r.add(c.join("").replace(/-/g, "_")), r.add(c.join("_").replace(/-/g, "_")), Array.from(r).filter(
|
|
712
|
+
(i) => i.length >= 2 && i.length <= 12 && !/^\d/.test(i)
|
|
679
713
|
);
|
|
680
|
-
},
|
|
714
|
+
}, br = (e, t) => e.startsWith(t) ? e.slice(t.length) : e, Jr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
681
715
|
__proto__: null,
|
|
682
|
-
createShortIdentifiers:
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
trimPrefix:
|
|
686
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
687
|
-
var
|
|
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) {
|
|
688
722
|
function s(o) {
|
|
689
|
-
return o instanceof r ? o : new r(function(
|
|
690
|
-
|
|
723
|
+
return o instanceof r ? o : new r(function(c) {
|
|
724
|
+
c(o);
|
|
691
725
|
});
|
|
692
726
|
}
|
|
693
|
-
return new (r || (r = Promise))(function(o,
|
|
727
|
+
return new (r || (r = Promise))(function(o, c) {
|
|
694
728
|
function f(u) {
|
|
695
729
|
try {
|
|
696
|
-
|
|
697
|
-
} catch (
|
|
698
|
-
|
|
730
|
+
l(n.next(u));
|
|
731
|
+
} catch (m) {
|
|
732
|
+
c(m);
|
|
699
733
|
}
|
|
700
734
|
}
|
|
701
|
-
function
|
|
735
|
+
function i(u) {
|
|
702
736
|
try {
|
|
703
|
-
|
|
704
|
-
} catch (
|
|
705
|
-
|
|
737
|
+
l(n.throw(u));
|
|
738
|
+
} catch (m) {
|
|
739
|
+
c(m);
|
|
706
740
|
}
|
|
707
741
|
}
|
|
708
|
-
function
|
|
709
|
-
u.done ? o(u.value) : s(u.value).then(f,
|
|
742
|
+
function l(u) {
|
|
743
|
+
u.done ? o(u.value) : s(u.value).then(f, i);
|
|
710
744
|
}
|
|
711
|
-
|
|
745
|
+
l((n = n.apply(e, t || [])).next());
|
|
712
746
|
});
|
|
713
747
|
};
|
|
714
|
-
class
|
|
715
|
-
constructor(t, r =
|
|
748
|
+
class wr {
|
|
749
|
+
constructor(t, r = _r) {
|
|
716
750
|
this._value = t, this._cancelError = r, this._queue = [], this._weightedWaiters = [];
|
|
717
751
|
}
|
|
718
752
|
acquire(t = 1, r = 0) {
|
|
719
753
|
if (t <= 0)
|
|
720
754
|
throw new Error(`invalid weight ${t}: must be positive`);
|
|
721
755
|
return new Promise((n, s) => {
|
|
722
|
-
const o = { resolve: n, reject: s, weight: t, priority: r },
|
|
723
|
-
|
|
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);
|
|
724
758
|
});
|
|
725
759
|
}
|
|
726
760
|
runExclusive(t) {
|
|
727
|
-
return
|
|
728
|
-
const [o,
|
|
761
|
+
return yr(this, arguments, void 0, function* (r, n = 1, s = 0) {
|
|
762
|
+
const [o, c] = yield this.acquire(n, s);
|
|
729
763
|
try {
|
|
730
764
|
return yield r(o);
|
|
731
765
|
} finally {
|
|
732
|
-
|
|
766
|
+
c();
|
|
733
767
|
}
|
|
734
768
|
});
|
|
735
769
|
}
|
|
@@ -737,7 +771,7 @@ class mr {
|
|
|
737
771
|
if (t <= 0)
|
|
738
772
|
throw new Error(`invalid weight ${t}: must be positive`);
|
|
739
773
|
return this._couldLockImmediately(t, r) ? Promise.resolve() : new Promise((n) => {
|
|
740
|
-
this._weightedWaiters[t - 1] || (this._weightedWaiters[t - 1] = []),
|
|
774
|
+
this._weightedWaiters[t - 1] || (this._weightedWaiters[t - 1] = []), Mr(this._weightedWaiters[t - 1], { resolve: n, priority: r });
|
|
741
775
|
});
|
|
742
776
|
}
|
|
743
777
|
isLocked() {
|
|
@@ -792,49 +826,49 @@ class mr {
|
|
|
792
826
|
return (this._queue.length === 0 || this._queue[0].priority < r) && t <= this._value;
|
|
793
827
|
}
|
|
794
828
|
}
|
|
795
|
-
function
|
|
796
|
-
const r =
|
|
829
|
+
function Mr(e, t) {
|
|
830
|
+
const r = Se(e, (n) => t.priority <= n.priority);
|
|
797
831
|
e.splice(r + 1, 0, t);
|
|
798
832
|
}
|
|
799
|
-
function
|
|
833
|
+
function Se(e, t) {
|
|
800
834
|
for (let r = e.length - 1; r >= 0; r--)
|
|
801
835
|
if (t(e[r]))
|
|
802
836
|
return r;
|
|
803
837
|
return -1;
|
|
804
838
|
}
|
|
805
|
-
var
|
|
839
|
+
var Sr = function(e, t, r, n) {
|
|
806
840
|
function s(o) {
|
|
807
|
-
return o instanceof r ? o : new r(function(
|
|
808
|
-
|
|
841
|
+
return o instanceof r ? o : new r(function(c) {
|
|
842
|
+
c(o);
|
|
809
843
|
});
|
|
810
844
|
}
|
|
811
|
-
return new (r || (r = Promise))(function(o,
|
|
845
|
+
return new (r || (r = Promise))(function(o, c) {
|
|
812
846
|
function f(u) {
|
|
813
847
|
try {
|
|
814
|
-
|
|
815
|
-
} catch (
|
|
816
|
-
|
|
848
|
+
l(n.next(u));
|
|
849
|
+
} catch (m) {
|
|
850
|
+
c(m);
|
|
817
851
|
}
|
|
818
852
|
}
|
|
819
|
-
function
|
|
853
|
+
function i(u) {
|
|
820
854
|
try {
|
|
821
|
-
|
|
822
|
-
} catch (
|
|
823
|
-
|
|
855
|
+
l(n.throw(u));
|
|
856
|
+
} catch (m) {
|
|
857
|
+
c(m);
|
|
824
858
|
}
|
|
825
859
|
}
|
|
826
|
-
function
|
|
827
|
-
u.done ? o(u.value) : s(u.value).then(f,
|
|
860
|
+
function l(u) {
|
|
861
|
+
u.done ? o(u.value) : s(u.value).then(f, i);
|
|
828
862
|
}
|
|
829
|
-
|
|
863
|
+
l((n = n.apply(e, t || [])).next());
|
|
830
864
|
});
|
|
831
865
|
};
|
|
832
|
-
class
|
|
866
|
+
class vr {
|
|
833
867
|
constructor(t) {
|
|
834
|
-
this._semaphore = new
|
|
868
|
+
this._semaphore = new wr(1, t);
|
|
835
869
|
}
|
|
836
870
|
acquire() {
|
|
837
|
-
return
|
|
871
|
+
return Sr(this, arguments, void 0, function* (t = 0) {
|
|
838
872
|
const [, r] = yield this._semaphore.acquire(1, t);
|
|
839
873
|
return r;
|
|
840
874
|
});
|
|
@@ -855,92 +889,92 @@ class yr {
|
|
|
855
889
|
return this._semaphore.cancel();
|
|
856
890
|
}
|
|
857
891
|
}
|
|
858
|
-
class
|
|
892
|
+
class ve extends vr {
|
|
859
893
|
constructor(t) {
|
|
860
894
|
super(), Object.assign(this, t);
|
|
861
895
|
}
|
|
862
896
|
}
|
|
863
|
-
const
|
|
897
|
+
const xr = (e) => new ve(e), Qr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
864
898
|
__proto__: null,
|
|
865
|
-
mutex:
|
|
866
|
-
newMutex:
|
|
867
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
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) => {
|
|
868
902
|
const n = Date.now();
|
|
869
903
|
for (; Date.now() - n < t; )
|
|
870
904
|
await e(), await new Promise((s) => setTimeout(s, r));
|
|
871
|
-
},
|
|
905
|
+
}, Yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
872
906
|
__proto__: null,
|
|
873
|
-
expectAlways:
|
|
874
|
-
toString:
|
|
907
|
+
expectAlways: $r,
|
|
908
|
+
toString: Tr
|
|
875
909
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
876
910
|
export {
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
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,
|
|
885
919
|
_ as TimeSpan,
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
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
|
|
946
980
|
};
|