@synnaxlabs/drift 0.38.1 → 0.39.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.
- package/dist/electron.cjs +1 -1
- package/dist/electron.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +11 -11
- package/dist/react.cjs +1 -1
- package/dist/react.js +2 -2
- package/dist/{selectors-CYHEOjO4.cjs → selectors-BOlMfPQR.cjs} +1 -1
- package/dist/{selectors-DwAh3Dt_.js → selectors-ChR2waHK.js} +1 -1
- package/dist/src/configureStore.d.ts.map +1 -1
- package/dist/src/debug.d.ts.map +1 -1
- package/dist/src/electron/index.d.ts.map +1 -1
- package/dist/src/middleware.d.ts.map +1 -1
- package/dist/src/react/Provider.d.ts.map +1 -1
- package/dist/src/react/hooks.d.ts.map +1 -1
- package/dist/src/react/selectors.d.ts.map +1 -1
- package/dist/src/selectors.d.ts.map +1 -1
- package/dist/src/serialization/index.d.ts.map +1 -1
- package/dist/src/state.d.ts.map +1 -1
- package/dist/src/sugar.d.ts.map +1 -1
- package/dist/src/sync.d.ts.map +1 -1
- package/dist/src/validate.d.ts.map +1 -1
- package/dist/state-5JemPjJN.cjs +13 -0
- package/dist/{state-B8DVhsB5.js → state-B4NiJdX7.js} +1248 -1209
- package/dist/tauri.cjs +1 -1
- package/dist/tauri.js +103 -100
- package/package.json +13 -12
- package/dist/state-Nl_4DIvw.cjs +0 -13
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { createSlice as
|
|
2
|
-
const
|
|
1
|
+
import { createSlice as Nr } from "@reduxjs/toolkit";
|
|
2
|
+
const dt = (n = !1, ...e) => {
|
|
3
3
|
n && console.log(...e);
|
|
4
|
-
},
|
|
4
|
+
}, Ir = (n = !1, ...e) => {
|
|
5
5
|
n && console.group(...e);
|
|
6
|
-
},
|
|
6
|
+
}, hn = (n) => {
|
|
7
7
|
n && console.groupEnd();
|
|
8
|
-
},
|
|
8
|
+
}, kr = (n) => {
|
|
9
9
|
const e = n.replace(/_[a-z]/g, (t) => t[1].toUpperCase());
|
|
10
10
|
return e.length > 1 && e[0] === e[0].toUpperCase() && e[1] === e[1].toUpperCase() || e.length === 0 ? e : e[0].toLowerCase() + e.slice(1);
|
|
11
|
-
},
|
|
11
|
+
}, Cn = (n) => {
|
|
12
12
|
const e = (t, r = Zt) => {
|
|
13
13
|
if (typeof t == "string") return n(t);
|
|
14
14
|
if (Array.isArray(t)) return t.map((a) => e(a, r));
|
|
15
15
|
if (!Ct(t)) return t;
|
|
16
|
-
r =
|
|
16
|
+
r = $r(r);
|
|
17
17
|
const s = {}, i = t;
|
|
18
18
|
return Object.keys(i).forEach((a) => {
|
|
19
19
|
let o = i[a];
|
|
20
20
|
const c = n(a);
|
|
21
|
-
r.recursive && (Ct(o) ? pn(o, r.keepTypesOnRecursion) || (o = e(o, r)) : r.recursiveInArray &&
|
|
22
|
-
let
|
|
23
|
-
return Ct(l) ? pn(
|
|
21
|
+
r.recursive && (Ct(o) ? pn(o, r.keepTypesOnRecursion) || (o = e(o, r)) : r.recursiveInArray && fn(o) && (o = [...o].map((l) => {
|
|
22
|
+
let p = l;
|
|
23
|
+
return Ct(l) ? pn(p, r.keepTypesOnRecursion) || (p = e(l, r)) : fn(l) && (p = e({ key: l }, r).key), p;
|
|
24
24
|
}))), s[c] = o;
|
|
25
25
|
}), s;
|
|
26
26
|
};
|
|
27
27
|
return e;
|
|
28
|
-
},
|
|
28
|
+
}, Rn = Cn(kr), Ar = (n) => (
|
|
29
29
|
// Don't convert the first character and don't convert a character that is after a
|
|
30
30
|
// non-alphanumeric character
|
|
31
31
|
n.replace(
|
|
32
32
|
/([a-z0-9])([A-Z])/g,
|
|
33
33
|
(e, t, r) => `${t}_${r.toLowerCase()}`
|
|
34
34
|
)
|
|
35
|
-
),
|
|
35
|
+
), Er = Cn(Ar), Zt = {
|
|
36
36
|
recursive: !0,
|
|
37
37
|
recursiveInArray: !0,
|
|
38
38
|
keepTypesOnRecursion: [Number, String, Uint8Array]
|
|
39
|
-
},
|
|
40
|
-
var
|
|
41
|
-
let
|
|
39
|
+
}, $r = (n = Zt) => (n.recursive == null ? n = Zt : n.recursiveInArray ?? (n.recursiveInArray = !1), n), fn = (n) => n != null && Array.isArray(n), Ct = (n) => n != null && typeof n == "object" && !Array.isArray(n), pn = (n, e) => (e || []).some((t) => n instanceof t), Fe = (n) => n != null && typeof n == "object" && !Array.isArray(n);
|
|
40
|
+
var Cr = Object.defineProperty, Rr = (n, e, t) => e in n ? Cr(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, Ye = (n, e, t) => Rr(n, typeof e != "symbol" ? e + "" : e, t);
|
|
41
|
+
let Mr = class {
|
|
42
42
|
constructor() {
|
|
43
|
-
|
|
43
|
+
Ye(this, "contentType", "application/json"), Ye(this, "decoder"), Ye(this, "encoder"), this.decoder = new TextDecoder(), this.encoder = new TextEncoder();
|
|
44
44
|
}
|
|
45
45
|
encode(e) {
|
|
46
46
|
return this.encoder.encode(this.encodeString(e)).buffer;
|
|
@@ -49,18 +49,18 @@ let Cr = class {
|
|
|
49
49
|
return this.decodeString(this.decoder.decode(e), t);
|
|
50
50
|
}
|
|
51
51
|
decodeString(e, t) {
|
|
52
|
-
const r = JSON.parse(e), s =
|
|
52
|
+
const r = JSON.parse(e), s = Rn(r);
|
|
53
53
|
return t != null ? t.parse(s) : s;
|
|
54
54
|
}
|
|
55
55
|
encodeString(e) {
|
|
56
|
-
const t =
|
|
57
|
-
return JSON.stringify(t, (r, s) => ArrayBuffer.isView(s) ? Array.from(s) :
|
|
56
|
+
const t = Er(e);
|
|
57
|
+
return JSON.stringify(t, (r, s) => ArrayBuffer.isView(s) ? Array.from(s) : Fe(s) && "encode_value" in s ? typeof s.value == "bigint" ? s.value.toString() : s.value : typeof s == "bigint" ? s.toString() : s);
|
|
58
58
|
}
|
|
59
59
|
static registerCustomType() {
|
|
60
60
|
}
|
|
61
|
-
},
|
|
61
|
+
}, jr = class {
|
|
62
62
|
constructor() {
|
|
63
|
-
|
|
63
|
+
Ye(this, "contentType", "text/csv");
|
|
64
64
|
}
|
|
65
65
|
encode(e) {
|
|
66
66
|
const t = this.encodeString(e);
|
|
@@ -71,7 +71,7 @@ let Cr = class {
|
|
|
71
71
|
return this.decodeString(r, t);
|
|
72
72
|
}
|
|
73
73
|
encodeString(e) {
|
|
74
|
-
if (!Array.isArray(e) || e.length === 0 || !
|
|
74
|
+
if (!Array.isArray(e) || e.length === 0 || !Fe(e[0]))
|
|
75
75
|
throw new Error("Payload must be an array of objects");
|
|
76
76
|
const t = Object.keys(e[0]), r = [t.join(",")];
|
|
77
77
|
return e.forEach((s) => {
|
|
@@ -90,9 +90,9 @@ let Cr = class {
|
|
|
90
90
|
a[o] = [];
|
|
91
91
|
}), s.forEach((o) => {
|
|
92
92
|
const c = o.split(",").map((l) => l.trim());
|
|
93
|
-
i.forEach((l,
|
|
94
|
-
const
|
|
95
|
-
|
|
93
|
+
i.forEach((l, p) => {
|
|
94
|
+
const y = this.parseValue(c[p]);
|
|
95
|
+
y != null && a[l].push(y);
|
|
96
96
|
});
|
|
97
97
|
}), t != null ? t.parse(a) : a;
|
|
98
98
|
}
|
|
@@ -103,9 +103,9 @@ let Cr = class {
|
|
|
103
103
|
}
|
|
104
104
|
static registerCustomType() {
|
|
105
105
|
}
|
|
106
|
-
},
|
|
106
|
+
}, Zr = class {
|
|
107
107
|
constructor() {
|
|
108
|
-
|
|
108
|
+
Ye(this, "contentType", "text/plain");
|
|
109
109
|
}
|
|
110
110
|
encode(e) {
|
|
111
111
|
return new TextEncoder().encode(e).buffer;
|
|
@@ -115,9 +115,9 @@ let Cr = class {
|
|
|
115
115
|
return t != null ? t.parse(r) : r;
|
|
116
116
|
}
|
|
117
117
|
};
|
|
118
|
-
const
|
|
119
|
-
new
|
|
120
|
-
new
|
|
118
|
+
const pt = new Mr();
|
|
119
|
+
new jr();
|
|
120
|
+
new Zr();
|
|
121
121
|
var S;
|
|
122
122
|
(function(n) {
|
|
123
123
|
n.assertEqual = (s) => s;
|
|
@@ -162,7 +162,7 @@ var Bt;
|
|
|
162
162
|
// second overwrites first
|
|
163
163
|
});
|
|
164
164
|
})(Bt || (Bt = {}));
|
|
165
|
-
const
|
|
165
|
+
const g = S.arrayToEnum([
|
|
166
166
|
"string",
|
|
167
167
|
"nan",
|
|
168
168
|
"number",
|
|
@@ -183,28 +183,28 @@ const y = S.arrayToEnum([
|
|
|
183
183
|
"never",
|
|
184
184
|
"map",
|
|
185
185
|
"set"
|
|
186
|
-
]),
|
|
186
|
+
]), se = (n) => {
|
|
187
187
|
switch (typeof n) {
|
|
188
188
|
case "undefined":
|
|
189
|
-
return
|
|
189
|
+
return g.undefined;
|
|
190
190
|
case "string":
|
|
191
|
-
return
|
|
191
|
+
return g.string;
|
|
192
192
|
case "number":
|
|
193
|
-
return isNaN(n) ?
|
|
193
|
+
return isNaN(n) ? g.nan : g.number;
|
|
194
194
|
case "boolean":
|
|
195
|
-
return
|
|
195
|
+
return g.boolean;
|
|
196
196
|
case "function":
|
|
197
|
-
return
|
|
197
|
+
return g.function;
|
|
198
198
|
case "bigint":
|
|
199
|
-
return
|
|
199
|
+
return g.bigint;
|
|
200
200
|
case "symbol":
|
|
201
|
-
return
|
|
201
|
+
return g.symbol;
|
|
202
202
|
case "object":
|
|
203
|
-
return Array.isArray(n) ?
|
|
203
|
+
return Array.isArray(n) ? g.array : n === null ? g.null : n.then && typeof n.then == "function" && n.catch && typeof n.catch == "function" ? g.promise : typeof Map < "u" && n instanceof Map ? g.map : typeof Set < "u" && n instanceof Set ? g.set : typeof Date < "u" && n instanceof Date ? g.date : g.object;
|
|
204
204
|
default:
|
|
205
|
-
return
|
|
205
|
+
return g.unknown;
|
|
206
206
|
}
|
|
207
|
-
},
|
|
207
|
+
}, f = S.arrayToEnum([
|
|
208
208
|
"invalid_type",
|
|
209
209
|
"invalid_literal",
|
|
210
210
|
"custom",
|
|
@@ -221,8 +221,8 @@ const y = S.arrayToEnum([
|
|
|
221
221
|
"invalid_intersection_types",
|
|
222
222
|
"not_multiple_of",
|
|
223
223
|
"not_finite"
|
|
224
|
-
]),
|
|
225
|
-
class
|
|
224
|
+
]), Br = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
225
|
+
class W extends Error {
|
|
226
226
|
get errors() {
|
|
227
227
|
return this.issues;
|
|
228
228
|
}
|
|
@@ -259,7 +259,7 @@ class z extends Error {
|
|
|
259
259
|
return s(this), r;
|
|
260
260
|
}
|
|
261
261
|
static assert(e) {
|
|
262
|
-
if (!(e instanceof
|
|
262
|
+
if (!(e instanceof W))
|
|
263
263
|
throw new Error(`Not a ZodError: ${e}`);
|
|
264
264
|
}
|
|
265
265
|
toString() {
|
|
@@ -281,56 +281,56 @@ class z extends Error {
|
|
|
281
281
|
return this.flatten();
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
|
-
|
|
284
|
+
W.create = (n) => new W(n);
|
|
285
285
|
const $e = (n, e) => {
|
|
286
286
|
let t;
|
|
287
287
|
switch (n.code) {
|
|
288
|
-
case
|
|
289
|
-
n.received ===
|
|
288
|
+
case f.invalid_type:
|
|
289
|
+
n.received === g.undefined ? t = "Required" : t = `Expected ${n.expected}, received ${n.received}`;
|
|
290
290
|
break;
|
|
291
|
-
case
|
|
291
|
+
case f.invalid_literal:
|
|
292
292
|
t = `Invalid literal value, expected ${JSON.stringify(n.expected, S.jsonStringifyReplacer)}`;
|
|
293
293
|
break;
|
|
294
|
-
case
|
|
294
|
+
case f.unrecognized_keys:
|
|
295
295
|
t = `Unrecognized key(s) in object: ${S.joinValues(n.keys, ", ")}`;
|
|
296
296
|
break;
|
|
297
|
-
case
|
|
297
|
+
case f.invalid_union:
|
|
298
298
|
t = "Invalid input";
|
|
299
299
|
break;
|
|
300
|
-
case
|
|
300
|
+
case f.invalid_union_discriminator:
|
|
301
301
|
t = `Invalid discriminator value. Expected ${S.joinValues(n.options)}`;
|
|
302
302
|
break;
|
|
303
|
-
case
|
|
303
|
+
case f.invalid_enum_value:
|
|
304
304
|
t = `Invalid enum value. Expected ${S.joinValues(n.options)}, received '${n.received}'`;
|
|
305
305
|
break;
|
|
306
|
-
case
|
|
306
|
+
case f.invalid_arguments:
|
|
307
307
|
t = "Invalid function arguments";
|
|
308
308
|
break;
|
|
309
|
-
case
|
|
309
|
+
case f.invalid_return_type:
|
|
310
310
|
t = "Invalid function return type";
|
|
311
311
|
break;
|
|
312
|
-
case
|
|
312
|
+
case f.invalid_date:
|
|
313
313
|
t = "Invalid date";
|
|
314
314
|
break;
|
|
315
|
-
case
|
|
315
|
+
case f.invalid_string:
|
|
316
316
|
typeof n.validation == "object" ? "includes" in n.validation ? (t = `Invalid input: must include "${n.validation.includes}"`, typeof n.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${n.validation.position}`)) : "startsWith" in n.validation ? t = `Invalid input: must start with "${n.validation.startsWith}"` : "endsWith" in n.validation ? t = `Invalid input: must end with "${n.validation.endsWith}"` : S.assertNever(n.validation) : n.validation !== "regex" ? t = `Invalid ${n.validation}` : t = "Invalid";
|
|
317
317
|
break;
|
|
318
|
-
case
|
|
318
|
+
case f.too_small:
|
|
319
319
|
n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "more than"} ${n.minimum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "over"} ${n.minimum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${n.minimum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(n.minimum))}` : t = "Invalid input";
|
|
320
320
|
break;
|
|
321
|
-
case
|
|
321
|
+
case f.too_big:
|
|
322
322
|
n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "less than"} ${n.maximum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "under"} ${n.maximum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "bigint" ? t = `BigInt must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly" : n.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(n.maximum))}` : t = "Invalid input";
|
|
323
323
|
break;
|
|
324
|
-
case
|
|
324
|
+
case f.custom:
|
|
325
325
|
t = "Invalid input";
|
|
326
326
|
break;
|
|
327
|
-
case
|
|
327
|
+
case f.invalid_intersection_types:
|
|
328
328
|
t = "Intersection results could not be merged";
|
|
329
329
|
break;
|
|
330
|
-
case
|
|
330
|
+
case f.not_multiple_of:
|
|
331
331
|
t = `Number must be a multiple of ${n.multipleOf}`;
|
|
332
332
|
break;
|
|
333
|
-
case
|
|
333
|
+
case f.not_finite:
|
|
334
334
|
t = "Number must be finite";
|
|
335
335
|
break;
|
|
336
336
|
default:
|
|
@@ -338,12 +338,12 @@ const $e = (n, e) => {
|
|
|
338
338
|
}
|
|
339
339
|
return { message: t };
|
|
340
340
|
};
|
|
341
|
-
let
|
|
342
|
-
function
|
|
343
|
-
|
|
341
|
+
let Mn = $e;
|
|
342
|
+
function Ur(n) {
|
|
343
|
+
Mn = n;
|
|
344
344
|
}
|
|
345
345
|
function wt() {
|
|
346
|
-
return
|
|
346
|
+
return Mn;
|
|
347
347
|
}
|
|
348
348
|
const bt = (n) => {
|
|
349
349
|
const { data: e, path: t, errorMaps: r, issueData: s } = n, i = [...t, ...s.path || []], a = {
|
|
@@ -365,8 +365,8 @@ const bt = (n) => {
|
|
|
365
365
|
path: i,
|
|
366
366
|
message: o
|
|
367
367
|
};
|
|
368
|
-
},
|
|
369
|
-
function
|
|
368
|
+
}, Dr = [];
|
|
369
|
+
function m(n, e) {
|
|
370
370
|
const t = wt(), r = bt({
|
|
371
371
|
issueData: e,
|
|
372
372
|
data: n.data,
|
|
@@ -384,7 +384,7 @@ function p(n, e) {
|
|
|
384
384
|
});
|
|
385
385
|
n.common.issues.push(r);
|
|
386
386
|
}
|
|
387
|
-
class
|
|
387
|
+
class L {
|
|
388
388
|
constructor() {
|
|
389
389
|
this.value = "valid";
|
|
390
390
|
}
|
|
@@ -412,7 +412,7 @@ class D {
|
|
|
412
412
|
value: a
|
|
413
413
|
});
|
|
414
414
|
}
|
|
415
|
-
return
|
|
415
|
+
return L.mergeObjectSync(e, r);
|
|
416
416
|
}
|
|
417
417
|
static mergeObjectSync(e, t) {
|
|
418
418
|
const r = {};
|
|
@@ -427,12 +427,12 @@ class D {
|
|
|
427
427
|
}
|
|
428
428
|
const x = Object.freeze({
|
|
429
429
|
status: "aborted"
|
|
430
|
-
}), ke = (n) => ({ status: "dirty", value: n }),
|
|
430
|
+
}), ke = (n) => ({ status: "dirty", value: n }), z = (n) => ({ status: "valid", value: n }), Ut = (n) => n.status === "aborted", Dt = (n) => n.status === "dirty", _e = (n) => n.status === "valid", Ge = (n) => typeof Promise < "u" && n instanceof Promise;
|
|
431
431
|
function xt(n, e, t, r) {
|
|
432
432
|
if (typeof e == "function" ? n !== e || !0 : !e.has(n)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
433
433
|
return e.get(n);
|
|
434
434
|
}
|
|
435
|
-
function
|
|
435
|
+
function jn(n, e, t, r, s) {
|
|
436
436
|
if (typeof e == "function" ? n !== e || !0 : !e.has(n)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
437
437
|
return e.set(n, t), t;
|
|
438
438
|
}
|
|
@@ -450,7 +450,7 @@ class K {
|
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
const mn = (n, e) => {
|
|
453
|
-
if (
|
|
453
|
+
if (_e(e))
|
|
454
454
|
return { success: !0, data: e.value };
|
|
455
455
|
if (!n.common.issues.length)
|
|
456
456
|
throw new Error("Validation failed but no issues detected.");
|
|
@@ -459,7 +459,7 @@ const mn = (n, e) => {
|
|
|
459
459
|
get error() {
|
|
460
460
|
if (this._error)
|
|
461
461
|
return this._error;
|
|
462
|
-
const t = new
|
|
462
|
+
const t = new W(n.common.issues);
|
|
463
463
|
return this._error = t, this._error;
|
|
464
464
|
}
|
|
465
465
|
};
|
|
@@ -472,8 +472,8 @@ function _(n) {
|
|
|
472
472
|
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
473
473
|
return e ? { errorMap: e, description: s } : { errorMap: (a, o) => {
|
|
474
474
|
var c, l;
|
|
475
|
-
const { message:
|
|
476
|
-
return a.code === "invalid_enum_value" ? { message:
|
|
475
|
+
const { message: p } = n;
|
|
476
|
+
return a.code === "invalid_enum_value" ? { message: p ?? o.defaultError } : typeof o.data > "u" ? { message: (c = p ?? r) !== null && c !== void 0 ? c : o.defaultError } : a.code !== "invalid_type" ? { message: o.defaultError } : { message: (l = p ?? t) !== null && l !== void 0 ? l : o.defaultError };
|
|
477
477
|
}, description: s };
|
|
478
478
|
}
|
|
479
479
|
class O {
|
|
@@ -481,13 +481,13 @@ class O {
|
|
|
481
481
|
return this._def.description;
|
|
482
482
|
}
|
|
483
483
|
_getType(e) {
|
|
484
|
-
return
|
|
484
|
+
return se(e.data);
|
|
485
485
|
}
|
|
486
486
|
_getOrReturnCtx(e, t) {
|
|
487
487
|
return t || {
|
|
488
488
|
common: e.parent.common,
|
|
489
489
|
data: e.data,
|
|
490
|
-
parsedType:
|
|
490
|
+
parsedType: se(e.data),
|
|
491
491
|
schemaErrorMap: this._def.errorMap,
|
|
492
492
|
path: e.path,
|
|
493
493
|
parent: e.parent
|
|
@@ -495,11 +495,11 @@ class O {
|
|
|
495
495
|
}
|
|
496
496
|
_processInputParams(e) {
|
|
497
497
|
return {
|
|
498
|
-
status: new
|
|
498
|
+
status: new L(),
|
|
499
499
|
ctx: {
|
|
500
500
|
common: e.parent.common,
|
|
501
501
|
data: e.data,
|
|
502
|
-
parsedType:
|
|
502
|
+
parsedType: se(e.data),
|
|
503
503
|
schemaErrorMap: this._def.errorMap,
|
|
504
504
|
path: e.path,
|
|
505
505
|
parent: e.parent
|
|
@@ -508,7 +508,7 @@ class O {
|
|
|
508
508
|
}
|
|
509
509
|
_parseSync(e) {
|
|
510
510
|
const t = this._parse(e);
|
|
511
|
-
if (
|
|
511
|
+
if (Ge(t))
|
|
512
512
|
throw new Error("Synchronous parse encountered promise.");
|
|
513
513
|
return t;
|
|
514
514
|
}
|
|
@@ -534,7 +534,7 @@ class O {
|
|
|
534
534
|
schemaErrorMap: this._def.errorMap,
|
|
535
535
|
parent: null,
|
|
536
536
|
data: e,
|
|
537
|
-
parsedType:
|
|
537
|
+
parsedType: se(e)
|
|
538
538
|
}, i = this._parseSync({ data: e, path: s.path, parent: s });
|
|
539
539
|
return mn(s, i);
|
|
540
540
|
}
|
|
@@ -549,12 +549,12 @@ class O {
|
|
|
549
549
|
schemaErrorMap: this._def.errorMap,
|
|
550
550
|
parent: null,
|
|
551
551
|
data: e,
|
|
552
|
-
parsedType:
|
|
552
|
+
parsedType: se(e)
|
|
553
553
|
};
|
|
554
554
|
if (!this["~standard"].async)
|
|
555
555
|
try {
|
|
556
556
|
const i = this._parseSync({ data: e, path: [], parent: s });
|
|
557
|
-
return
|
|
557
|
+
return _e(i) ? {
|
|
558
558
|
value: i.value
|
|
559
559
|
} : {
|
|
560
560
|
issues: s.common.issues
|
|
@@ -565,7 +565,7 @@ class O {
|
|
|
565
565
|
async: !0
|
|
566
566
|
};
|
|
567
567
|
}
|
|
568
|
-
return this._parseAsync({ data: e, path: [], parent: s }).then((i) =>
|
|
568
|
+
return this._parseAsync({ data: e, path: [], parent: s }).then((i) => _e(i) ? {
|
|
569
569
|
value: i.value
|
|
570
570
|
} : {
|
|
571
571
|
issues: s.common.issues
|
|
@@ -588,15 +588,15 @@ class O {
|
|
|
588
588
|
schemaErrorMap: this._def.errorMap,
|
|
589
589
|
parent: null,
|
|
590
590
|
data: e,
|
|
591
|
-
parsedType:
|
|
592
|
-
}, s = this._parse({ data: e, path: r.path, parent: r }), i = await (
|
|
591
|
+
parsedType: se(e)
|
|
592
|
+
}, s = this._parse({ data: e, path: r.path, parent: r }), i = await (Ge(s) ? s : Promise.resolve(s));
|
|
593
593
|
return mn(r, i);
|
|
594
594
|
}
|
|
595
595
|
refine(e, t) {
|
|
596
596
|
const r = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
|
|
597
597
|
return this._refinement((s, i) => {
|
|
598
598
|
const a = e(s), o = () => i.addIssue({
|
|
599
|
-
code:
|
|
599
|
+
code: f.custom,
|
|
600
600
|
...r(s)
|
|
601
601
|
});
|
|
602
602
|
return typeof Promise < "u" && a instanceof Promise ? a.then((c) => c ? !0 : (o(), !1)) : a ? !0 : (o(), !1);
|
|
@@ -626,7 +626,7 @@ class O {
|
|
|
626
626
|
return X.create(this, this._def);
|
|
627
627
|
}
|
|
628
628
|
nullable() {
|
|
629
|
-
return
|
|
629
|
+
return pe.create(this, this._def);
|
|
630
630
|
}
|
|
631
631
|
nullish() {
|
|
632
632
|
return this.nullable().optional();
|
|
@@ -638,10 +638,10 @@ class O {
|
|
|
638
638
|
return Re.create(this, this._def);
|
|
639
639
|
}
|
|
640
640
|
or(e) {
|
|
641
|
-
return
|
|
641
|
+
return Ke.create([this, e], this._def);
|
|
642
642
|
}
|
|
643
643
|
and(e) {
|
|
644
|
-
return
|
|
644
|
+
return Qe.create(this, e, this._def);
|
|
645
645
|
}
|
|
646
646
|
transform(e) {
|
|
647
647
|
return new Y({
|
|
@@ -653,7 +653,7 @@ class O {
|
|
|
653
653
|
}
|
|
654
654
|
default(e) {
|
|
655
655
|
const t = typeof e == "function" ? e : () => e;
|
|
656
|
-
return new
|
|
656
|
+
return new st({
|
|
657
657
|
..._(this._def),
|
|
658
658
|
innerType: this,
|
|
659
659
|
defaultValue: t,
|
|
@@ -669,7 +669,7 @@ class O {
|
|
|
669
669
|
}
|
|
670
670
|
catch(e) {
|
|
671
671
|
const t = typeof e == "function" ? e : () => e;
|
|
672
|
-
return new
|
|
672
|
+
return new it({
|
|
673
673
|
..._(this._def),
|
|
674
674
|
innerType: this,
|
|
675
675
|
catchValue: t,
|
|
@@ -684,10 +684,10 @@ class O {
|
|
|
684
684
|
});
|
|
685
685
|
}
|
|
686
686
|
pipe(e) {
|
|
687
|
-
return
|
|
687
|
+
return ct.create(this, e);
|
|
688
688
|
}
|
|
689
689
|
readonly() {
|
|
690
|
-
return
|
|
690
|
+
return at.create(this);
|
|
691
691
|
}
|
|
692
692
|
isOptional() {
|
|
693
693
|
return this.safeParse(void 0).success;
|
|
@@ -696,26 +696,26 @@ class O {
|
|
|
696
696
|
return this.safeParse(null).success;
|
|
697
697
|
}
|
|
698
698
|
}
|
|
699
|
-
const
|
|
699
|
+
const Lr = /^c[^\s-]{8,}$/i, Pr = /^[0-9a-z]+$/, zr = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Wr = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Vr = /^[a-z0-9_-]{21}$/i, qr = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Fr = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Yr = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Gr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
700
700
|
let Rt;
|
|
701
|
-
const
|
|
702
|
-
function
|
|
701
|
+
const Jr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Hr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Xr = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Kr = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Qr = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, es = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Zn = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", ts = new RegExp(`^${Zn}$`);
|
|
702
|
+
function Bn(n) {
|
|
703
703
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
704
704
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
705
705
|
}
|
|
706
|
-
function
|
|
707
|
-
return new RegExp(`^${
|
|
706
|
+
function ns(n) {
|
|
707
|
+
return new RegExp(`^${Bn(n)}$`);
|
|
708
708
|
}
|
|
709
|
-
function
|
|
710
|
-
let e = `${
|
|
709
|
+
function Un(n) {
|
|
710
|
+
let e = `${Zn}T${Bn(n)}`;
|
|
711
711
|
const t = [];
|
|
712
712
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
return !!((e === "v4" || !e) &&
|
|
714
|
+
function rs(n, e) {
|
|
715
|
+
return !!((e === "v4" || !e) && Jr.test(n) || (e === "v6" || !e) && Xr.test(n));
|
|
716
716
|
}
|
|
717
|
-
function
|
|
718
|
-
if (!
|
|
717
|
+
function ss(n, e) {
|
|
718
|
+
if (!qr.test(n))
|
|
719
719
|
return !1;
|
|
720
720
|
try {
|
|
721
721
|
const [t] = n.split("."), r = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), s = JSON.parse(atob(r));
|
|
@@ -724,25 +724,25 @@ function ns(n, e) {
|
|
|
724
724
|
return !1;
|
|
725
725
|
}
|
|
726
726
|
}
|
|
727
|
-
function
|
|
728
|
-
return !!((e === "v4" || !e) &&
|
|
727
|
+
function is(n, e) {
|
|
728
|
+
return !!((e === "v4" || !e) && Hr.test(n) || (e === "v6" || !e) && Kr.test(n));
|
|
729
729
|
}
|
|
730
730
|
class q extends O {
|
|
731
731
|
_parse(e) {
|
|
732
|
-
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !==
|
|
732
|
+
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== g.string) {
|
|
733
733
|
const i = this._getOrReturnCtx(e);
|
|
734
|
-
return
|
|
735
|
-
code:
|
|
736
|
-
expected:
|
|
734
|
+
return m(i, {
|
|
735
|
+
code: f.invalid_type,
|
|
736
|
+
expected: g.string,
|
|
737
737
|
received: i.parsedType
|
|
738
738
|
}), x;
|
|
739
739
|
}
|
|
740
|
-
const r = new
|
|
740
|
+
const r = new L();
|
|
741
741
|
let s;
|
|
742
742
|
for (const i of this._def.checks)
|
|
743
743
|
if (i.kind === "min")
|
|
744
|
-
e.data.length < i.value && (s = this._getOrReturnCtx(e, s),
|
|
745
|
-
code:
|
|
744
|
+
e.data.length < i.value && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
745
|
+
code: f.too_small,
|
|
746
746
|
minimum: i.value,
|
|
747
747
|
type: "string",
|
|
748
748
|
inclusive: !0,
|
|
@@ -750,8 +750,8 @@ class q extends O {
|
|
|
750
750
|
message: i.message
|
|
751
751
|
}), r.dirty());
|
|
752
752
|
else if (i.kind === "max")
|
|
753
|
-
e.data.length > i.value && (s = this._getOrReturnCtx(e, s),
|
|
754
|
-
code:
|
|
753
|
+
e.data.length > i.value && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
754
|
+
code: f.too_big,
|
|
755
755
|
maximum: i.value,
|
|
756
756
|
type: "string",
|
|
757
757
|
inclusive: !0,
|
|
@@ -760,15 +760,15 @@ class q extends O {
|
|
|
760
760
|
}), r.dirty());
|
|
761
761
|
else if (i.kind === "length") {
|
|
762
762
|
const a = e.data.length > i.value, o = e.data.length < i.value;
|
|
763
|
-
(a || o) && (s = this._getOrReturnCtx(e, s), a ?
|
|
764
|
-
code:
|
|
763
|
+
(a || o) && (s = this._getOrReturnCtx(e, s), a ? m(s, {
|
|
764
|
+
code: f.too_big,
|
|
765
765
|
maximum: i.value,
|
|
766
766
|
type: "string",
|
|
767
767
|
inclusive: !0,
|
|
768
768
|
exact: !0,
|
|
769
769
|
message: i.message
|
|
770
|
-
}) : o &&
|
|
771
|
-
code:
|
|
770
|
+
}) : o && m(s, {
|
|
771
|
+
code: f.too_small,
|
|
772
772
|
minimum: i.value,
|
|
773
773
|
type: "string",
|
|
774
774
|
inclusive: !0,
|
|
@@ -776,108 +776,108 @@ class q extends O {
|
|
|
776
776
|
message: i.message
|
|
777
777
|
}), r.dirty());
|
|
778
778
|
} else if (i.kind === "email")
|
|
779
|
-
|
|
779
|
+
Yr.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
780
780
|
validation: "email",
|
|
781
|
-
code:
|
|
781
|
+
code: f.invalid_string,
|
|
782
782
|
message: i.message
|
|
783
783
|
}), r.dirty());
|
|
784
784
|
else if (i.kind === "emoji")
|
|
785
|
-
Rt || (Rt = new RegExp(
|
|
785
|
+
Rt || (Rt = new RegExp(Gr, "u")), Rt.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
786
786
|
validation: "emoji",
|
|
787
|
-
code:
|
|
787
|
+
code: f.invalid_string,
|
|
788
788
|
message: i.message
|
|
789
789
|
}), r.dirty());
|
|
790
790
|
else if (i.kind === "uuid")
|
|
791
|
-
|
|
791
|
+
Wr.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
792
792
|
validation: "uuid",
|
|
793
|
-
code:
|
|
793
|
+
code: f.invalid_string,
|
|
794
794
|
message: i.message
|
|
795
795
|
}), r.dirty());
|
|
796
796
|
else if (i.kind === "nanoid")
|
|
797
|
-
|
|
797
|
+
Vr.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
798
798
|
validation: "nanoid",
|
|
799
|
-
code:
|
|
799
|
+
code: f.invalid_string,
|
|
800
800
|
message: i.message
|
|
801
801
|
}), r.dirty());
|
|
802
802
|
else if (i.kind === "cuid")
|
|
803
|
-
|
|
803
|
+
Lr.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
804
804
|
validation: "cuid",
|
|
805
|
-
code:
|
|
805
|
+
code: f.invalid_string,
|
|
806
806
|
message: i.message
|
|
807
807
|
}), r.dirty());
|
|
808
808
|
else if (i.kind === "cuid2")
|
|
809
|
-
|
|
809
|
+
Pr.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
810
810
|
validation: "cuid2",
|
|
811
|
-
code:
|
|
811
|
+
code: f.invalid_string,
|
|
812
812
|
message: i.message
|
|
813
813
|
}), r.dirty());
|
|
814
814
|
else if (i.kind === "ulid")
|
|
815
|
-
|
|
815
|
+
zr.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
816
816
|
validation: "ulid",
|
|
817
|
-
code:
|
|
817
|
+
code: f.invalid_string,
|
|
818
818
|
message: i.message
|
|
819
819
|
}), r.dirty());
|
|
820
820
|
else if (i.kind === "url")
|
|
821
821
|
try {
|
|
822
822
|
new URL(e.data);
|
|
823
823
|
} catch {
|
|
824
|
-
s = this._getOrReturnCtx(e, s),
|
|
824
|
+
s = this._getOrReturnCtx(e, s), m(s, {
|
|
825
825
|
validation: "url",
|
|
826
|
-
code:
|
|
826
|
+
code: f.invalid_string,
|
|
827
827
|
message: i.message
|
|
828
828
|
}), r.dirty();
|
|
829
829
|
}
|
|
830
|
-
else i.kind === "regex" ? (i.regex.lastIndex = 0, i.regex.test(e.data) || (s = this._getOrReturnCtx(e, s),
|
|
830
|
+
else i.kind === "regex" ? (i.regex.lastIndex = 0, i.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
831
831
|
validation: "regex",
|
|
832
|
-
code:
|
|
832
|
+
code: f.invalid_string,
|
|
833
833
|
message: i.message
|
|
834
|
-
}), r.dirty())) : i.kind === "trim" ? e.data = e.data.trim() : i.kind === "includes" ? e.data.includes(i.value, i.position) || (s = this._getOrReturnCtx(e, s),
|
|
835
|
-
code:
|
|
834
|
+
}), r.dirty())) : i.kind === "trim" ? e.data = e.data.trim() : i.kind === "includes" ? e.data.includes(i.value, i.position) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
835
|
+
code: f.invalid_string,
|
|
836
836
|
validation: { includes: i.value, position: i.position },
|
|
837
837
|
message: i.message
|
|
838
|
-
}), r.dirty()) : i.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : i.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : i.kind === "startsWith" ? e.data.startsWith(i.value) || (s = this._getOrReturnCtx(e, s),
|
|
839
|
-
code:
|
|
838
|
+
}), r.dirty()) : i.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : i.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : i.kind === "startsWith" ? e.data.startsWith(i.value) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
839
|
+
code: f.invalid_string,
|
|
840
840
|
validation: { startsWith: i.value },
|
|
841
841
|
message: i.message
|
|
842
|
-
}), r.dirty()) : i.kind === "endsWith" ? e.data.endsWith(i.value) || (s = this._getOrReturnCtx(e, s),
|
|
843
|
-
code:
|
|
842
|
+
}), r.dirty()) : i.kind === "endsWith" ? e.data.endsWith(i.value) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
843
|
+
code: f.invalid_string,
|
|
844
844
|
validation: { endsWith: i.value },
|
|
845
845
|
message: i.message
|
|
846
|
-
}), r.dirty()) : i.kind === "datetime" ?
|
|
847
|
-
code:
|
|
846
|
+
}), r.dirty()) : i.kind === "datetime" ? Un(i).test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
847
|
+
code: f.invalid_string,
|
|
848
848
|
validation: "datetime",
|
|
849
849
|
message: i.message
|
|
850
|
-
}), r.dirty()) : i.kind === "date" ?
|
|
851
|
-
code:
|
|
850
|
+
}), r.dirty()) : i.kind === "date" ? ts.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
851
|
+
code: f.invalid_string,
|
|
852
852
|
validation: "date",
|
|
853
853
|
message: i.message
|
|
854
|
-
}), r.dirty()) : i.kind === "time" ?
|
|
855
|
-
code:
|
|
854
|
+
}), r.dirty()) : i.kind === "time" ? ns(i).test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
855
|
+
code: f.invalid_string,
|
|
856
856
|
validation: "time",
|
|
857
857
|
message: i.message
|
|
858
|
-
}), r.dirty()) : i.kind === "duration" ?
|
|
858
|
+
}), r.dirty()) : i.kind === "duration" ? Fr.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
859
859
|
validation: "duration",
|
|
860
|
-
code:
|
|
860
|
+
code: f.invalid_string,
|
|
861
861
|
message: i.message
|
|
862
|
-
}), r.dirty()) : i.kind === "ip" ?
|
|
862
|
+
}), r.dirty()) : i.kind === "ip" ? rs(e.data, i.version) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
863
863
|
validation: "ip",
|
|
864
|
-
code:
|
|
864
|
+
code: f.invalid_string,
|
|
865
865
|
message: i.message
|
|
866
|
-
}), r.dirty()) : i.kind === "jwt" ?
|
|
866
|
+
}), r.dirty()) : i.kind === "jwt" ? ss(e.data, i.alg) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
867
867
|
validation: "jwt",
|
|
868
|
-
code:
|
|
868
|
+
code: f.invalid_string,
|
|
869
869
|
message: i.message
|
|
870
|
-
}), r.dirty()) : i.kind === "cidr" ?
|
|
870
|
+
}), r.dirty()) : i.kind === "cidr" ? is(e.data, i.version) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
871
871
|
validation: "cidr",
|
|
872
|
-
code:
|
|
872
|
+
code: f.invalid_string,
|
|
873
873
|
message: i.message
|
|
874
|
-
}), r.dirty()) : i.kind === "base64" ?
|
|
874
|
+
}), r.dirty()) : i.kind === "base64" ? Qr.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
875
875
|
validation: "base64",
|
|
876
|
-
code:
|
|
876
|
+
code: f.invalid_string,
|
|
877
877
|
message: i.message
|
|
878
|
-
}), r.dirty()) : i.kind === "base64url" ?
|
|
878
|
+
}), r.dirty()) : i.kind === "base64url" ? es.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
879
879
|
validation: "base64url",
|
|
880
|
-
code:
|
|
880
|
+
code: f.invalid_string,
|
|
881
881
|
message: i.message
|
|
882
882
|
}), r.dirty()) : S.assertNever(i);
|
|
883
883
|
return { status: r.value, value: e.data };
|
|
@@ -885,7 +885,7 @@ class q extends O {
|
|
|
885
885
|
_regex(e, t, r) {
|
|
886
886
|
return this.refinement((s) => e.test(s), {
|
|
887
887
|
validation: t,
|
|
888
|
-
code:
|
|
888
|
+
code: f.invalid_string,
|
|
889
889
|
...v.errToObj(r)
|
|
890
890
|
});
|
|
891
891
|
}
|
|
@@ -1114,51 +1114,51 @@ q.create = (n) => {
|
|
|
1114
1114
|
..._(n)
|
|
1115
1115
|
});
|
|
1116
1116
|
};
|
|
1117
|
-
function
|
|
1117
|
+
function as(n, e) {
|
|
1118
1118
|
const t = (n.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, s = t > r ? t : r, i = parseInt(n.toFixed(s).replace(".", "")), a = parseInt(e.toFixed(s).replace(".", ""));
|
|
1119
1119
|
return i % a / Math.pow(10, s);
|
|
1120
1120
|
}
|
|
1121
|
-
class
|
|
1121
|
+
class de extends O {
|
|
1122
1122
|
constructor() {
|
|
1123
1123
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
1124
1124
|
}
|
|
1125
1125
|
_parse(e) {
|
|
1126
|
-
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !==
|
|
1126
|
+
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== g.number) {
|
|
1127
1127
|
const i = this._getOrReturnCtx(e);
|
|
1128
|
-
return
|
|
1129
|
-
code:
|
|
1130
|
-
expected:
|
|
1128
|
+
return m(i, {
|
|
1129
|
+
code: f.invalid_type,
|
|
1130
|
+
expected: g.number,
|
|
1131
1131
|
received: i.parsedType
|
|
1132
1132
|
}), x;
|
|
1133
1133
|
}
|
|
1134
1134
|
let r;
|
|
1135
|
-
const s = new
|
|
1135
|
+
const s = new L();
|
|
1136
1136
|
for (const i of this._def.checks)
|
|
1137
|
-
i.kind === "int" ? S.isInteger(e.data) || (r = this._getOrReturnCtx(e, r),
|
|
1138
|
-
code:
|
|
1137
|
+
i.kind === "int" ? S.isInteger(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
1138
|
+
code: f.invalid_type,
|
|
1139
1139
|
expected: "integer",
|
|
1140
1140
|
received: "float",
|
|
1141
1141
|
message: i.message
|
|
1142
|
-
}), s.dirty()) : i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (r = this._getOrReturnCtx(e, r),
|
|
1143
|
-
code:
|
|
1142
|
+
}), s.dirty()) : i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (r = this._getOrReturnCtx(e, r), m(r, {
|
|
1143
|
+
code: f.too_small,
|
|
1144
1144
|
minimum: i.value,
|
|
1145
1145
|
type: "number",
|
|
1146
1146
|
inclusive: i.inclusive,
|
|
1147
1147
|
exact: !1,
|
|
1148
1148
|
message: i.message
|
|
1149
|
-
}), s.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (r = this._getOrReturnCtx(e, r),
|
|
1150
|
-
code:
|
|
1149
|
+
}), s.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (r = this._getOrReturnCtx(e, r), m(r, {
|
|
1150
|
+
code: f.too_big,
|
|
1151
1151
|
maximum: i.value,
|
|
1152
1152
|
type: "number",
|
|
1153
1153
|
inclusive: i.inclusive,
|
|
1154
1154
|
exact: !1,
|
|
1155
1155
|
message: i.message
|
|
1156
|
-
}), s.dirty()) : i.kind === "multipleOf" ?
|
|
1157
|
-
code:
|
|
1156
|
+
}), s.dirty()) : i.kind === "multipleOf" ? as(e.data, i.value) !== 0 && (r = this._getOrReturnCtx(e, r), m(r, {
|
|
1157
|
+
code: f.not_multiple_of,
|
|
1158
1158
|
multipleOf: i.value,
|
|
1159
1159
|
message: i.message
|
|
1160
|
-
}), s.dirty()) : i.kind === "finite" ? Number.isFinite(e.data) || (r = this._getOrReturnCtx(e, r),
|
|
1161
|
-
code:
|
|
1160
|
+
}), s.dirty()) : i.kind === "finite" ? Number.isFinite(e.data) || (r = this._getOrReturnCtx(e, r), m(r, {
|
|
1161
|
+
code: f.not_finite,
|
|
1162
1162
|
message: i.message
|
|
1163
1163
|
}), s.dirty()) : S.assertNever(i);
|
|
1164
1164
|
return { status: s.value, value: e.data };
|
|
@@ -1176,7 +1176,7 @@ class le extends O {
|
|
|
1176
1176
|
return this.setLimit("max", e, !1, v.toString(t));
|
|
1177
1177
|
}
|
|
1178
1178
|
setLimit(e, t, r, s) {
|
|
1179
|
-
return new
|
|
1179
|
+
return new de({
|
|
1180
1180
|
...this._def,
|
|
1181
1181
|
checks: [
|
|
1182
1182
|
...this._def.checks,
|
|
@@ -1190,7 +1190,7 @@ class le extends O {
|
|
|
1190
1190
|
});
|
|
1191
1191
|
}
|
|
1192
1192
|
_addCheck(e) {
|
|
1193
|
-
return new
|
|
1193
|
+
return new de({
|
|
1194
1194
|
...this._def,
|
|
1195
1195
|
checks: [...this._def.checks, e]
|
|
1196
1196
|
});
|
|
@@ -1284,13 +1284,13 @@ class le extends O {
|
|
|
1284
1284
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1285
1285
|
}
|
|
1286
1286
|
}
|
|
1287
|
-
|
|
1287
|
+
de.create = (n) => new de({
|
|
1288
1288
|
checks: [],
|
|
1289
1289
|
typeName: b.ZodNumber,
|
|
1290
1290
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1291
1291
|
..._(n)
|
|
1292
1292
|
});
|
|
1293
|
-
class
|
|
1293
|
+
class he extends O {
|
|
1294
1294
|
constructor() {
|
|
1295
1295
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1296
1296
|
}
|
|
@@ -1301,25 +1301,25 @@ class de extends O {
|
|
|
1301
1301
|
} catch {
|
|
1302
1302
|
return this._getInvalidInput(e);
|
|
1303
1303
|
}
|
|
1304
|
-
if (this._getType(e) !==
|
|
1304
|
+
if (this._getType(e) !== g.bigint)
|
|
1305
1305
|
return this._getInvalidInput(e);
|
|
1306
1306
|
let r;
|
|
1307
|
-
const s = new
|
|
1307
|
+
const s = new L();
|
|
1308
1308
|
for (const i of this._def.checks)
|
|
1309
|
-
i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (r = this._getOrReturnCtx(e, r),
|
|
1310
|
-
code:
|
|
1309
|
+
i.kind === "min" ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (r = this._getOrReturnCtx(e, r), m(r, {
|
|
1310
|
+
code: f.too_small,
|
|
1311
1311
|
type: "bigint",
|
|
1312
1312
|
minimum: i.value,
|
|
1313
1313
|
inclusive: i.inclusive,
|
|
1314
1314
|
message: i.message
|
|
1315
|
-
}), s.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (r = this._getOrReturnCtx(e, r),
|
|
1316
|
-
code:
|
|
1315
|
+
}), s.dirty()) : i.kind === "max" ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (r = this._getOrReturnCtx(e, r), m(r, {
|
|
1316
|
+
code: f.too_big,
|
|
1317
1317
|
type: "bigint",
|
|
1318
1318
|
maximum: i.value,
|
|
1319
1319
|
inclusive: i.inclusive,
|
|
1320
1320
|
message: i.message
|
|
1321
|
-
}), s.dirty()) : i.kind === "multipleOf" ? e.data % i.value !== BigInt(0) && (r = this._getOrReturnCtx(e, r),
|
|
1322
|
-
code:
|
|
1321
|
+
}), s.dirty()) : i.kind === "multipleOf" ? e.data % i.value !== BigInt(0) && (r = this._getOrReturnCtx(e, r), m(r, {
|
|
1322
|
+
code: f.not_multiple_of,
|
|
1323
1323
|
multipleOf: i.value,
|
|
1324
1324
|
message: i.message
|
|
1325
1325
|
}), s.dirty()) : S.assertNever(i);
|
|
@@ -1327,9 +1327,9 @@ class de extends O {
|
|
|
1327
1327
|
}
|
|
1328
1328
|
_getInvalidInput(e) {
|
|
1329
1329
|
const t = this._getOrReturnCtx(e);
|
|
1330
|
-
return
|
|
1331
|
-
code:
|
|
1332
|
-
expected:
|
|
1330
|
+
return m(t, {
|
|
1331
|
+
code: f.invalid_type,
|
|
1332
|
+
expected: g.bigint,
|
|
1333
1333
|
received: t.parsedType
|
|
1334
1334
|
}), x;
|
|
1335
1335
|
}
|
|
@@ -1346,7 +1346,7 @@ class de extends O {
|
|
|
1346
1346
|
return this.setLimit("max", e, !1, v.toString(t));
|
|
1347
1347
|
}
|
|
1348
1348
|
setLimit(e, t, r, s) {
|
|
1349
|
-
return new
|
|
1349
|
+
return new he({
|
|
1350
1350
|
...this._def,
|
|
1351
1351
|
checks: [
|
|
1352
1352
|
...this._def.checks,
|
|
@@ -1360,7 +1360,7 @@ class de extends O {
|
|
|
1360
1360
|
});
|
|
1361
1361
|
}
|
|
1362
1362
|
_addCheck(e) {
|
|
1363
|
-
return new
|
|
1363
|
+
return new he({
|
|
1364
1364
|
...this._def,
|
|
1365
1365
|
checks: [...this._def.checks, e]
|
|
1366
1366
|
});
|
|
@@ -1417,61 +1417,61 @@ class de extends O {
|
|
|
1417
1417
|
return e;
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
|
-
|
|
1420
|
+
he.create = (n) => {
|
|
1421
1421
|
var e;
|
|
1422
|
-
return new
|
|
1422
|
+
return new he({
|
|
1423
1423
|
checks: [],
|
|
1424
1424
|
typeName: b.ZodBigInt,
|
|
1425
1425
|
coerce: (e = n == null ? void 0 : n.coerce) !== null && e !== void 0 ? e : !1,
|
|
1426
1426
|
..._(n)
|
|
1427
1427
|
});
|
|
1428
1428
|
};
|
|
1429
|
-
class
|
|
1429
|
+
class Je extends O {
|
|
1430
1430
|
_parse(e) {
|
|
1431
|
-
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !==
|
|
1431
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== g.boolean) {
|
|
1432
1432
|
const r = this._getOrReturnCtx(e);
|
|
1433
|
-
return
|
|
1434
|
-
code:
|
|
1435
|
-
expected:
|
|
1433
|
+
return m(r, {
|
|
1434
|
+
code: f.invalid_type,
|
|
1435
|
+
expected: g.boolean,
|
|
1436
1436
|
received: r.parsedType
|
|
1437
1437
|
}), x;
|
|
1438
1438
|
}
|
|
1439
|
-
return
|
|
1439
|
+
return z(e.data);
|
|
1440
1440
|
}
|
|
1441
1441
|
}
|
|
1442
|
-
|
|
1442
|
+
Je.create = (n) => new Je({
|
|
1443
1443
|
typeName: b.ZodBoolean,
|
|
1444
1444
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1445
1445
|
..._(n)
|
|
1446
1446
|
});
|
|
1447
|
-
class
|
|
1447
|
+
class Te extends O {
|
|
1448
1448
|
_parse(e) {
|
|
1449
|
-
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !==
|
|
1449
|
+
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== g.date) {
|
|
1450
1450
|
const i = this._getOrReturnCtx(e);
|
|
1451
|
-
return
|
|
1452
|
-
code:
|
|
1453
|
-
expected:
|
|
1451
|
+
return m(i, {
|
|
1452
|
+
code: f.invalid_type,
|
|
1453
|
+
expected: g.date,
|
|
1454
1454
|
received: i.parsedType
|
|
1455
1455
|
}), x;
|
|
1456
1456
|
}
|
|
1457
1457
|
if (isNaN(e.data.getTime())) {
|
|
1458
1458
|
const i = this._getOrReturnCtx(e);
|
|
1459
|
-
return
|
|
1460
|
-
code:
|
|
1459
|
+
return m(i, {
|
|
1460
|
+
code: f.invalid_date
|
|
1461
1461
|
}), x;
|
|
1462
1462
|
}
|
|
1463
|
-
const r = new
|
|
1463
|
+
const r = new L();
|
|
1464
1464
|
let s;
|
|
1465
1465
|
for (const i of this._def.checks)
|
|
1466
|
-
i.kind === "min" ? e.data.getTime() < i.value && (s = this._getOrReturnCtx(e, s),
|
|
1467
|
-
code:
|
|
1466
|
+
i.kind === "min" ? e.data.getTime() < i.value && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
1467
|
+
code: f.too_small,
|
|
1468
1468
|
message: i.message,
|
|
1469
1469
|
inclusive: !0,
|
|
1470
1470
|
exact: !1,
|
|
1471
1471
|
minimum: i.value,
|
|
1472
1472
|
type: "date"
|
|
1473
|
-
}), r.dirty()) : i.kind === "max" ? e.data.getTime() > i.value && (s = this._getOrReturnCtx(e, s),
|
|
1474
|
-
code:
|
|
1473
|
+
}), r.dirty()) : i.kind === "max" ? e.data.getTime() > i.value && (s = this._getOrReturnCtx(e, s), m(s, {
|
|
1474
|
+
code: f.too_big,
|
|
1475
1475
|
message: i.message,
|
|
1476
1476
|
inclusive: !0,
|
|
1477
1477
|
exact: !1,
|
|
@@ -1484,7 +1484,7 @@ class _e extends O {
|
|
|
1484
1484
|
};
|
|
1485
1485
|
}
|
|
1486
1486
|
_addCheck(e) {
|
|
1487
|
-
return new
|
|
1487
|
+
return new Te({
|
|
1488
1488
|
...this._def,
|
|
1489
1489
|
checks: [...this._def.checks, e]
|
|
1490
1490
|
});
|
|
@@ -1516,7 +1516,7 @@ class _e extends O {
|
|
|
1516
1516
|
return e != null ? new Date(e) : null;
|
|
1517
1517
|
}
|
|
1518
1518
|
}
|
|
1519
|
-
|
|
1519
|
+
Te.create = (n) => new Te({
|
|
1520
1520
|
checks: [],
|
|
1521
1521
|
coerce: (n == null ? void 0 : n.coerce) || !1,
|
|
1522
1522
|
typeName: b.ZodDate,
|
|
@@ -1524,52 +1524,52 @@ _e.create = (n) => new _e({
|
|
|
1524
1524
|
});
|
|
1525
1525
|
class _t extends O {
|
|
1526
1526
|
_parse(e) {
|
|
1527
|
-
if (this._getType(e) !==
|
|
1527
|
+
if (this._getType(e) !== g.symbol) {
|
|
1528
1528
|
const r = this._getOrReturnCtx(e);
|
|
1529
|
-
return
|
|
1530
|
-
code:
|
|
1531
|
-
expected:
|
|
1529
|
+
return m(r, {
|
|
1530
|
+
code: f.invalid_type,
|
|
1531
|
+
expected: g.symbol,
|
|
1532
1532
|
received: r.parsedType
|
|
1533
1533
|
}), x;
|
|
1534
1534
|
}
|
|
1535
|
-
return
|
|
1535
|
+
return z(e.data);
|
|
1536
1536
|
}
|
|
1537
1537
|
}
|
|
1538
1538
|
_t.create = (n) => new _t({
|
|
1539
1539
|
typeName: b.ZodSymbol,
|
|
1540
1540
|
..._(n)
|
|
1541
1541
|
});
|
|
1542
|
-
class
|
|
1542
|
+
class He extends O {
|
|
1543
1543
|
_parse(e) {
|
|
1544
|
-
if (this._getType(e) !==
|
|
1544
|
+
if (this._getType(e) !== g.undefined) {
|
|
1545
1545
|
const r = this._getOrReturnCtx(e);
|
|
1546
|
-
return
|
|
1547
|
-
code:
|
|
1548
|
-
expected:
|
|
1546
|
+
return m(r, {
|
|
1547
|
+
code: f.invalid_type,
|
|
1548
|
+
expected: g.undefined,
|
|
1549
1549
|
received: r.parsedType
|
|
1550
1550
|
}), x;
|
|
1551
1551
|
}
|
|
1552
|
-
return
|
|
1552
|
+
return z(e.data);
|
|
1553
1553
|
}
|
|
1554
1554
|
}
|
|
1555
|
-
|
|
1555
|
+
He.create = (n) => new He({
|
|
1556
1556
|
typeName: b.ZodUndefined,
|
|
1557
1557
|
..._(n)
|
|
1558
1558
|
});
|
|
1559
|
-
class
|
|
1559
|
+
class Xe extends O {
|
|
1560
1560
|
_parse(e) {
|
|
1561
|
-
if (this._getType(e) !==
|
|
1561
|
+
if (this._getType(e) !== g.null) {
|
|
1562
1562
|
const r = this._getOrReturnCtx(e);
|
|
1563
|
-
return
|
|
1564
|
-
code:
|
|
1565
|
-
expected:
|
|
1563
|
+
return m(r, {
|
|
1564
|
+
code: f.invalid_type,
|
|
1565
|
+
expected: g.null,
|
|
1566
1566
|
received: r.parsedType
|
|
1567
1567
|
}), x;
|
|
1568
1568
|
}
|
|
1569
|
-
return
|
|
1569
|
+
return z(e.data);
|
|
1570
1570
|
}
|
|
1571
1571
|
}
|
|
1572
|
-
|
|
1572
|
+
Xe.create = (n) => new Xe({
|
|
1573
1573
|
typeName: b.ZodNull,
|
|
1574
1574
|
..._(n)
|
|
1575
1575
|
});
|
|
@@ -1578,50 +1578,50 @@ class Ce extends O {
|
|
|
1578
1578
|
super(...arguments), this._any = !0;
|
|
1579
1579
|
}
|
|
1580
1580
|
_parse(e) {
|
|
1581
|
-
return
|
|
1581
|
+
return z(e.data);
|
|
1582
1582
|
}
|
|
1583
1583
|
}
|
|
1584
1584
|
Ce.create = (n) => new Ce({
|
|
1585
1585
|
typeName: b.ZodAny,
|
|
1586
1586
|
..._(n)
|
|
1587
1587
|
});
|
|
1588
|
-
class
|
|
1588
|
+
class ve extends O {
|
|
1589
1589
|
constructor() {
|
|
1590
1590
|
super(...arguments), this._unknown = !0;
|
|
1591
1591
|
}
|
|
1592
1592
|
_parse(e) {
|
|
1593
|
-
return
|
|
1593
|
+
return z(e.data);
|
|
1594
1594
|
}
|
|
1595
1595
|
}
|
|
1596
|
-
|
|
1596
|
+
ve.create = (n) => new ve({
|
|
1597
1597
|
typeName: b.ZodUnknown,
|
|
1598
1598
|
..._(n)
|
|
1599
1599
|
});
|
|
1600
|
-
class
|
|
1600
|
+
class ae extends O {
|
|
1601
1601
|
_parse(e) {
|
|
1602
1602
|
const t = this._getOrReturnCtx(e);
|
|
1603
|
-
return
|
|
1604
|
-
code:
|
|
1605
|
-
expected:
|
|
1603
|
+
return m(t, {
|
|
1604
|
+
code: f.invalid_type,
|
|
1605
|
+
expected: g.never,
|
|
1606
1606
|
received: t.parsedType
|
|
1607
1607
|
}), x;
|
|
1608
1608
|
}
|
|
1609
1609
|
}
|
|
1610
|
-
|
|
1610
|
+
ae.create = (n) => new ae({
|
|
1611
1611
|
typeName: b.ZodNever,
|
|
1612
1612
|
..._(n)
|
|
1613
1613
|
});
|
|
1614
1614
|
class Tt extends O {
|
|
1615
1615
|
_parse(e) {
|
|
1616
|
-
if (this._getType(e) !==
|
|
1616
|
+
if (this._getType(e) !== g.undefined) {
|
|
1617
1617
|
const r = this._getOrReturnCtx(e);
|
|
1618
|
-
return
|
|
1619
|
-
code:
|
|
1620
|
-
expected:
|
|
1618
|
+
return m(r, {
|
|
1619
|
+
code: f.invalid_type,
|
|
1620
|
+
expected: g.void,
|
|
1621
1621
|
received: r.parsedType
|
|
1622
1622
|
}), x;
|
|
1623
1623
|
}
|
|
1624
|
-
return
|
|
1624
|
+
return z(e.data);
|
|
1625
1625
|
}
|
|
1626
1626
|
}
|
|
1627
1627
|
Tt.create = (n) => new Tt({
|
|
@@ -1631,16 +1631,16 @@ Tt.create = (n) => new Tt({
|
|
|
1631
1631
|
class F extends O {
|
|
1632
1632
|
_parse(e) {
|
|
1633
1633
|
const { ctx: t, status: r } = this._processInputParams(e), s = this._def;
|
|
1634
|
-
if (t.parsedType !==
|
|
1635
|
-
return
|
|
1636
|
-
code:
|
|
1637
|
-
expected:
|
|
1634
|
+
if (t.parsedType !== g.array)
|
|
1635
|
+
return m(t, {
|
|
1636
|
+
code: f.invalid_type,
|
|
1637
|
+
expected: g.array,
|
|
1638
1638
|
received: t.parsedType
|
|
1639
1639
|
}), x;
|
|
1640
1640
|
if (s.exactLength !== null) {
|
|
1641
1641
|
const a = t.data.length > s.exactLength.value, o = t.data.length < s.exactLength.value;
|
|
1642
|
-
(a || o) && (
|
|
1643
|
-
code: a ?
|
|
1642
|
+
(a || o) && (m(t, {
|
|
1643
|
+
code: a ? f.too_big : f.too_small,
|
|
1644
1644
|
minimum: o ? s.exactLength.value : void 0,
|
|
1645
1645
|
maximum: a ? s.exactLength.value : void 0,
|
|
1646
1646
|
type: "array",
|
|
@@ -1649,24 +1649,24 @@ class F extends O {
|
|
|
1649
1649
|
message: s.exactLength.message
|
|
1650
1650
|
}), r.dirty());
|
|
1651
1651
|
}
|
|
1652
|
-
if (s.minLength !== null && t.data.length < s.minLength.value && (
|
|
1653
|
-
code:
|
|
1652
|
+
if (s.minLength !== null && t.data.length < s.minLength.value && (m(t, {
|
|
1653
|
+
code: f.too_small,
|
|
1654
1654
|
minimum: s.minLength.value,
|
|
1655
1655
|
type: "array",
|
|
1656
1656
|
inclusive: !0,
|
|
1657
1657
|
exact: !1,
|
|
1658
1658
|
message: s.minLength.message
|
|
1659
|
-
}), r.dirty()), s.maxLength !== null && t.data.length > s.maxLength.value && (
|
|
1660
|
-
code:
|
|
1659
|
+
}), r.dirty()), s.maxLength !== null && t.data.length > s.maxLength.value && (m(t, {
|
|
1660
|
+
code: f.too_big,
|
|
1661
1661
|
maximum: s.maxLength.value,
|
|
1662
1662
|
type: "array",
|
|
1663
1663
|
inclusive: !0,
|
|
1664
1664
|
exact: !1,
|
|
1665
1665
|
message: s.maxLength.message
|
|
1666
1666
|
}), r.dirty()), t.common.async)
|
|
1667
|
-
return Promise.all([...t.data].map((a, o) => s.type._parseAsync(new K(t, a, t.path, o)))).then((a) =>
|
|
1667
|
+
return Promise.all([...t.data].map((a, o) => s.type._parseAsync(new K(t, a, t.path, o)))).then((a) => L.mergeArray(r, a));
|
|
1668
1668
|
const i = [...t.data].map((a, o) => s.type._parseSync(new K(t, a, t.path, o)));
|
|
1669
|
-
return
|
|
1669
|
+
return L.mergeArray(r, i);
|
|
1670
1670
|
}
|
|
1671
1671
|
get element() {
|
|
1672
1672
|
return this._def.type;
|
|
@@ -1715,7 +1715,7 @@ function Ie(n) {
|
|
|
1715
1715
|
} else return n instanceof F ? new F({
|
|
1716
1716
|
...n._def,
|
|
1717
1717
|
type: Ie(n.element)
|
|
1718
|
-
}) : n instanceof X ? X.create(Ie(n.unwrap())) : n instanceof
|
|
1718
|
+
}) : n instanceof X ? X.create(Ie(n.unwrap())) : n instanceof pe ? pe.create(Ie(n.unwrap())) : n instanceof Q ? Q.create(n.items.map((e) => Ie(e))) : n;
|
|
1719
1719
|
}
|
|
1720
1720
|
class R extends O {
|
|
1721
1721
|
constructor() {
|
|
@@ -1728,67 +1728,67 @@ class R extends O {
|
|
|
1728
1728
|
return this._cached = { shape: e, keys: t };
|
|
1729
1729
|
}
|
|
1730
1730
|
_parse(e) {
|
|
1731
|
-
if (this._getType(e) !==
|
|
1731
|
+
if (this._getType(e) !== g.object) {
|
|
1732
1732
|
const l = this._getOrReturnCtx(e);
|
|
1733
|
-
return
|
|
1734
|
-
code:
|
|
1735
|
-
expected:
|
|
1733
|
+
return m(l, {
|
|
1734
|
+
code: f.invalid_type,
|
|
1735
|
+
expected: g.object,
|
|
1736
1736
|
received: l.parsedType
|
|
1737
1737
|
}), x;
|
|
1738
1738
|
}
|
|
1739
1739
|
const { status: r, ctx: s } = this._processInputParams(e), { shape: i, keys: a } = this._getCached(), o = [];
|
|
1740
|
-
if (!(this._def.catchall instanceof
|
|
1740
|
+
if (!(this._def.catchall instanceof ae && this._def.unknownKeys === "strip"))
|
|
1741
1741
|
for (const l in s.data)
|
|
1742
1742
|
a.includes(l) || o.push(l);
|
|
1743
1743
|
const c = [];
|
|
1744
1744
|
for (const l of a) {
|
|
1745
|
-
const
|
|
1745
|
+
const p = i[l], y = s.data[l];
|
|
1746
1746
|
c.push({
|
|
1747
1747
|
key: { status: "valid", value: l },
|
|
1748
|
-
value:
|
|
1748
|
+
value: p._parse(new K(s, y, s.path, l)),
|
|
1749
1749
|
alwaysSet: l in s.data
|
|
1750
1750
|
});
|
|
1751
1751
|
}
|
|
1752
|
-
if (this._def.catchall instanceof
|
|
1752
|
+
if (this._def.catchall instanceof ae) {
|
|
1753
1753
|
const l = this._def.unknownKeys;
|
|
1754
1754
|
if (l === "passthrough")
|
|
1755
|
-
for (const
|
|
1755
|
+
for (const p of o)
|
|
1756
1756
|
c.push({
|
|
1757
|
-
key: { status: "valid", value:
|
|
1758
|
-
value: { status: "valid", value: s.data[
|
|
1757
|
+
key: { status: "valid", value: p },
|
|
1758
|
+
value: { status: "valid", value: s.data[p] }
|
|
1759
1759
|
});
|
|
1760
1760
|
else if (l === "strict")
|
|
1761
|
-
o.length > 0 && (
|
|
1762
|
-
code:
|
|
1761
|
+
o.length > 0 && (m(s, {
|
|
1762
|
+
code: f.unrecognized_keys,
|
|
1763
1763
|
keys: o
|
|
1764
1764
|
}), r.dirty());
|
|
1765
1765
|
else if (l !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
1766
1766
|
} else {
|
|
1767
1767
|
const l = this._def.catchall;
|
|
1768
|
-
for (const
|
|
1769
|
-
const
|
|
1768
|
+
for (const p of o) {
|
|
1769
|
+
const y = s.data[p];
|
|
1770
1770
|
c.push({
|
|
1771
|
-
key: { status: "valid", value:
|
|
1771
|
+
key: { status: "valid", value: p },
|
|
1772
1772
|
value: l._parse(
|
|
1773
|
-
new K(s,
|
|
1773
|
+
new K(s, y, s.path, p)
|
|
1774
1774
|
//, ctx.child(key), value, getParsedType(value)
|
|
1775
1775
|
),
|
|
1776
|
-
alwaysSet:
|
|
1776
|
+
alwaysSet: p in s.data
|
|
1777
1777
|
});
|
|
1778
1778
|
}
|
|
1779
1779
|
}
|
|
1780
1780
|
return s.common.async ? Promise.resolve().then(async () => {
|
|
1781
1781
|
const l = [];
|
|
1782
|
-
for (const
|
|
1783
|
-
const
|
|
1782
|
+
for (const p of c) {
|
|
1783
|
+
const y = await p.key, j = await p.value;
|
|
1784
1784
|
l.push({
|
|
1785
|
-
key:
|
|
1786
|
-
value:
|
|
1787
|
-
alwaysSet:
|
|
1785
|
+
key: y,
|
|
1786
|
+
value: j,
|
|
1787
|
+
alwaysSet: p.alwaysSet
|
|
1788
1788
|
});
|
|
1789
1789
|
}
|
|
1790
1790
|
return l;
|
|
1791
|
-
}).then((l) =>
|
|
1791
|
+
}).then((l) => L.mergeObjectSync(r, l)) : L.mergeObjectSync(r, c);
|
|
1792
1792
|
}
|
|
1793
1793
|
get shape() {
|
|
1794
1794
|
return this._def.shape();
|
|
@@ -1986,25 +1986,25 @@ class R extends O {
|
|
|
1986
1986
|
R.create = (n, e) => new R({
|
|
1987
1987
|
shape: () => n,
|
|
1988
1988
|
unknownKeys: "strip",
|
|
1989
|
-
catchall:
|
|
1989
|
+
catchall: ae.create(),
|
|
1990
1990
|
typeName: b.ZodObject,
|
|
1991
1991
|
..._(e)
|
|
1992
1992
|
});
|
|
1993
1993
|
R.strictCreate = (n, e) => new R({
|
|
1994
1994
|
shape: () => n,
|
|
1995
1995
|
unknownKeys: "strict",
|
|
1996
|
-
catchall:
|
|
1996
|
+
catchall: ae.create(),
|
|
1997
1997
|
typeName: b.ZodObject,
|
|
1998
1998
|
..._(e)
|
|
1999
1999
|
});
|
|
2000
2000
|
R.lazycreate = (n, e) => new R({
|
|
2001
2001
|
shape: n,
|
|
2002
2002
|
unknownKeys: "strip",
|
|
2003
|
-
catchall:
|
|
2003
|
+
catchall: ae.create(),
|
|
2004
2004
|
typeName: b.ZodObject,
|
|
2005
2005
|
..._(e)
|
|
2006
2006
|
});
|
|
2007
|
-
class
|
|
2007
|
+
class Ke extends O {
|
|
2008
2008
|
_parse(e) {
|
|
2009
2009
|
const { ctx: t } = this._processInputParams(e), r = this._def.options;
|
|
2010
2010
|
function s(i) {
|
|
@@ -2014,9 +2014,9 @@ class Xe extends O {
|
|
|
2014
2014
|
for (const o of i)
|
|
2015
2015
|
if (o.result.status === "dirty")
|
|
2016
2016
|
return t.common.issues.push(...o.ctx.common.issues), o.result;
|
|
2017
|
-
const a = i.map((o) => new
|
|
2018
|
-
return
|
|
2019
|
-
code:
|
|
2017
|
+
const a = i.map((o) => new W(o.ctx.common.issues));
|
|
2018
|
+
return m(t, {
|
|
2019
|
+
code: f.invalid_union,
|
|
2020
2020
|
unionErrors: a
|
|
2021
2021
|
}), x;
|
|
2022
2022
|
}
|
|
@@ -2050,20 +2050,20 @@ class Xe extends O {
|
|
|
2050
2050
|
issues: []
|
|
2051
2051
|
},
|
|
2052
2052
|
parent: null
|
|
2053
|
-
},
|
|
2053
|
+
}, p = c._parseSync({
|
|
2054
2054
|
data: t.data,
|
|
2055
2055
|
path: t.path,
|
|
2056
2056
|
parent: l
|
|
2057
2057
|
});
|
|
2058
|
-
if (
|
|
2059
|
-
return
|
|
2060
|
-
|
|
2058
|
+
if (p.status === "valid")
|
|
2059
|
+
return p;
|
|
2060
|
+
p.status === "dirty" && !i && (i = { result: p, ctx: l }), l.common.issues.length && a.push(l.common.issues);
|
|
2061
2061
|
}
|
|
2062
2062
|
if (i)
|
|
2063
2063
|
return t.common.issues.push(...i.ctx.common.issues), i.result;
|
|
2064
|
-
const o = a.map((c) => new
|
|
2065
|
-
return
|
|
2066
|
-
code:
|
|
2064
|
+
const o = a.map((c) => new W(c));
|
|
2065
|
+
return m(t, {
|
|
2066
|
+
code: f.invalid_union,
|
|
2067
2067
|
unionErrors: o
|
|
2068
2068
|
}), x;
|
|
2069
2069
|
}
|
|
@@ -2072,19 +2072,19 @@ class Xe extends O {
|
|
|
2072
2072
|
return this._def.options;
|
|
2073
2073
|
}
|
|
2074
2074
|
}
|
|
2075
|
-
|
|
2075
|
+
Ke.create = (n, e) => new Ke({
|
|
2076
2076
|
options: n,
|
|
2077
2077
|
typeName: b.ZodUnion,
|
|
2078
2078
|
..._(e)
|
|
2079
2079
|
});
|
|
2080
|
-
const
|
|
2080
|
+
const ne = (n) => n instanceof tt ? ne(n.schema) : n instanceof Y ? ne(n.innerType()) : n instanceof nt ? [n.value] : n instanceof fe ? n.options : n instanceof rt ? S.objectValues(n.enum) : n instanceof st ? ne(n._def.innerType) : n instanceof He ? [void 0] : n instanceof Xe ? [null] : n instanceof X ? [void 0, ...ne(n.unwrap())] : n instanceof pe ? [null, ...ne(n.unwrap())] : n instanceof Kt || n instanceof at ? ne(n.unwrap()) : n instanceof it ? ne(n._def.innerType) : [];
|
|
2081
2081
|
class It extends O {
|
|
2082
2082
|
_parse(e) {
|
|
2083
2083
|
const { ctx: t } = this._processInputParams(e);
|
|
2084
|
-
if (t.parsedType !==
|
|
2085
|
-
return
|
|
2086
|
-
code:
|
|
2087
|
-
expected:
|
|
2084
|
+
if (t.parsedType !== g.object)
|
|
2085
|
+
return m(t, {
|
|
2086
|
+
code: f.invalid_type,
|
|
2087
|
+
expected: g.object,
|
|
2088
2088
|
received: t.parsedType
|
|
2089
2089
|
}), x;
|
|
2090
2090
|
const r = this.discriminator, s = t.data[r], i = this.optionsMap.get(s);
|
|
@@ -2096,8 +2096,8 @@ class It extends O {
|
|
|
2096
2096
|
data: t.data,
|
|
2097
2097
|
path: t.path,
|
|
2098
2098
|
parent: t
|
|
2099
|
-
}) : (
|
|
2100
|
-
code:
|
|
2099
|
+
}) : (m(t, {
|
|
2100
|
+
code: f.invalid_union_discriminator,
|
|
2101
2101
|
options: Array.from(this.optionsMap.keys()),
|
|
2102
2102
|
path: [r]
|
|
2103
2103
|
}), x);
|
|
@@ -2122,7 +2122,7 @@ class It extends O {
|
|
|
2122
2122
|
static create(e, t, r) {
|
|
2123
2123
|
const s = /* @__PURE__ */ new Map();
|
|
2124
2124
|
for (const i of t) {
|
|
2125
|
-
const a =
|
|
2125
|
+
const a = ne(i.shape[e]);
|
|
2126
2126
|
if (!a.length)
|
|
2127
2127
|
throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
|
|
2128
2128
|
for (const o of a) {
|
|
@@ -2141,10 +2141,10 @@ class It extends O {
|
|
|
2141
2141
|
}
|
|
2142
2142
|
}
|
|
2143
2143
|
function Lt(n, e) {
|
|
2144
|
-
const t =
|
|
2144
|
+
const t = se(n), r = se(e);
|
|
2145
2145
|
if (n === e)
|
|
2146
2146
|
return { valid: !0, data: n };
|
|
2147
|
-
if (t ===
|
|
2147
|
+
if (t === g.object && r === g.object) {
|
|
2148
2148
|
const s = S.objectKeys(e), i = S.objectKeys(n).filter((o) => s.indexOf(o) !== -1), a = { ...n, ...e };
|
|
2149
2149
|
for (const o of i) {
|
|
2150
2150
|
const c = Lt(n[o], e[o]);
|
|
@@ -2153,7 +2153,7 @@ function Lt(n, e) {
|
|
|
2153
2153
|
a[o] = c.data;
|
|
2154
2154
|
}
|
|
2155
2155
|
return { valid: !0, data: a };
|
|
2156
|
-
} else if (t ===
|
|
2156
|
+
} else if (t === g.array && r === g.array) {
|
|
2157
2157
|
if (n.length !== e.length)
|
|
2158
2158
|
return { valid: !1 };
|
|
2159
2159
|
const s = [];
|
|
@@ -2164,16 +2164,16 @@ function Lt(n, e) {
|
|
|
2164
2164
|
s.push(c.data);
|
|
2165
2165
|
}
|
|
2166
2166
|
return { valid: !0, data: s };
|
|
2167
|
-
} else return t ===
|
|
2167
|
+
} else return t === g.date && r === g.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
|
|
2168
2168
|
}
|
|
2169
|
-
class
|
|
2169
|
+
class Qe extends O {
|
|
2170
2170
|
_parse(e) {
|
|
2171
2171
|
const { status: t, ctx: r } = this._processInputParams(e), s = (i, a) => {
|
|
2172
|
-
if (
|
|
2172
|
+
if (Ut(i) || Ut(a))
|
|
2173
2173
|
return x;
|
|
2174
2174
|
const o = Lt(i.value, a.value);
|
|
2175
|
-
return o.valid ? ((
|
|
2176
|
-
code:
|
|
2175
|
+
return o.valid ? ((Dt(i) || Dt(a)) && t.dirty(), { status: t.value, value: o.data }) : (m(r, {
|
|
2176
|
+
code: f.invalid_intersection_types
|
|
2177
2177
|
}), x);
|
|
2178
2178
|
};
|
|
2179
2179
|
return r.common.async ? Promise.all([
|
|
@@ -2198,7 +2198,7 @@ class Ke extends O {
|
|
|
2198
2198
|
}));
|
|
2199
2199
|
}
|
|
2200
2200
|
}
|
|
2201
|
-
|
|
2201
|
+
Qe.create = (n, e, t) => new Qe({
|
|
2202
2202
|
left: n,
|
|
2203
2203
|
right: e,
|
|
2204
2204
|
typeName: b.ZodIntersection,
|
|
@@ -2207,22 +2207,22 @@ Ke.create = (n, e, t) => new Ke({
|
|
|
2207
2207
|
class Q extends O {
|
|
2208
2208
|
_parse(e) {
|
|
2209
2209
|
const { status: t, ctx: r } = this._processInputParams(e);
|
|
2210
|
-
if (r.parsedType !==
|
|
2211
|
-
return
|
|
2212
|
-
code:
|
|
2213
|
-
expected:
|
|
2210
|
+
if (r.parsedType !== g.array)
|
|
2211
|
+
return m(r, {
|
|
2212
|
+
code: f.invalid_type,
|
|
2213
|
+
expected: g.array,
|
|
2214
2214
|
received: r.parsedType
|
|
2215
2215
|
}), x;
|
|
2216
2216
|
if (r.data.length < this._def.items.length)
|
|
2217
|
-
return
|
|
2218
|
-
code:
|
|
2217
|
+
return m(r, {
|
|
2218
|
+
code: f.too_small,
|
|
2219
2219
|
minimum: this._def.items.length,
|
|
2220
2220
|
inclusive: !0,
|
|
2221
2221
|
exact: !1,
|
|
2222
2222
|
type: "array"
|
|
2223
2223
|
}), x;
|
|
2224
|
-
!this._def.rest && r.data.length > this._def.items.length && (
|
|
2225
|
-
code:
|
|
2224
|
+
!this._def.rest && r.data.length > this._def.items.length && (m(r, {
|
|
2225
|
+
code: f.too_big,
|
|
2226
2226
|
maximum: this._def.items.length,
|
|
2227
2227
|
inclusive: !0,
|
|
2228
2228
|
exact: !1,
|
|
@@ -2232,7 +2232,7 @@ class Q extends O {
|
|
|
2232
2232
|
const c = this._def.items[o] || this._def.rest;
|
|
2233
2233
|
return c ? c._parse(new K(r, a, r.path, o)) : null;
|
|
2234
2234
|
}).filter((a) => !!a);
|
|
2235
|
-
return r.common.async ? Promise.all(i).then((a) =>
|
|
2235
|
+
return r.common.async ? Promise.all(i).then((a) => L.mergeArray(t, a)) : L.mergeArray(t, i);
|
|
2236
2236
|
}
|
|
2237
2237
|
get items() {
|
|
2238
2238
|
return this._def.items;
|
|
@@ -2254,7 +2254,7 @@ Q.create = (n, e) => {
|
|
|
2254
2254
|
..._(e)
|
|
2255
2255
|
});
|
|
2256
2256
|
};
|
|
2257
|
-
class
|
|
2257
|
+
class et extends O {
|
|
2258
2258
|
get keySchema() {
|
|
2259
2259
|
return this._def.keyType;
|
|
2260
2260
|
}
|
|
@@ -2263,10 +2263,10 @@ class Qe extends O {
|
|
|
2263
2263
|
}
|
|
2264
2264
|
_parse(e) {
|
|
2265
2265
|
const { status: t, ctx: r } = this._processInputParams(e);
|
|
2266
|
-
if (r.parsedType !==
|
|
2267
|
-
return
|
|
2268
|
-
code:
|
|
2269
|
-
expected:
|
|
2266
|
+
if (r.parsedType !== g.object)
|
|
2267
|
+
return m(r, {
|
|
2268
|
+
code: f.invalid_type,
|
|
2269
|
+
expected: g.object,
|
|
2270
2270
|
received: r.parsedType
|
|
2271
2271
|
}), x;
|
|
2272
2272
|
const s = [], i = this._def.keyType, a = this._def.valueType;
|
|
@@ -2276,18 +2276,18 @@ class Qe extends O {
|
|
|
2276
2276
|
value: a._parse(new K(r, r.data[o], r.path, o)),
|
|
2277
2277
|
alwaysSet: o in r.data
|
|
2278
2278
|
});
|
|
2279
|
-
return r.common.async ?
|
|
2279
|
+
return r.common.async ? L.mergeObjectAsync(t, s) : L.mergeObjectSync(t, s);
|
|
2280
2280
|
}
|
|
2281
2281
|
get element() {
|
|
2282
2282
|
return this._def.valueType;
|
|
2283
2283
|
}
|
|
2284
2284
|
static create(e, t, r) {
|
|
2285
|
-
return t instanceof O ? new
|
|
2285
|
+
return t instanceof O ? new et({
|
|
2286
2286
|
keyType: e,
|
|
2287
2287
|
valueType: t,
|
|
2288
2288
|
typeName: b.ZodRecord,
|
|
2289
2289
|
..._(r)
|
|
2290
|
-
}) : new
|
|
2290
|
+
}) : new et({
|
|
2291
2291
|
keyType: q.create(),
|
|
2292
2292
|
valueType: e,
|
|
2293
2293
|
typeName: b.ZodRecord,
|
|
@@ -2304,10 +2304,10 @@ class Ot extends O {
|
|
|
2304
2304
|
}
|
|
2305
2305
|
_parse(e) {
|
|
2306
2306
|
const { status: t, ctx: r } = this._processInputParams(e);
|
|
2307
|
-
if (r.parsedType !==
|
|
2308
|
-
return
|
|
2309
|
-
code:
|
|
2310
|
-
expected:
|
|
2307
|
+
if (r.parsedType !== g.map)
|
|
2308
|
+
return m(r, {
|
|
2309
|
+
code: f.invalid_type,
|
|
2310
|
+
expected: g.map,
|
|
2311
2311
|
received: r.parsedType
|
|
2312
2312
|
}), x;
|
|
2313
2313
|
const s = this._def.keyType, i = this._def.valueType, a = [...r.data.entries()].map(([o, c], l) => ({
|
|
@@ -2318,20 +2318,20 @@ class Ot extends O {
|
|
|
2318
2318
|
const o = /* @__PURE__ */ new Map();
|
|
2319
2319
|
return Promise.resolve().then(async () => {
|
|
2320
2320
|
for (const c of a) {
|
|
2321
|
-
const l = await c.key,
|
|
2322
|
-
if (l.status === "aborted" ||
|
|
2321
|
+
const l = await c.key, p = await c.value;
|
|
2322
|
+
if (l.status === "aborted" || p.status === "aborted")
|
|
2323
2323
|
return x;
|
|
2324
|
-
(l.status === "dirty" ||
|
|
2324
|
+
(l.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(l.value, p.value);
|
|
2325
2325
|
}
|
|
2326
2326
|
return { status: t.value, value: o };
|
|
2327
2327
|
});
|
|
2328
2328
|
} else {
|
|
2329
2329
|
const o = /* @__PURE__ */ new Map();
|
|
2330
2330
|
for (const c of a) {
|
|
2331
|
-
const l = c.key,
|
|
2332
|
-
if (l.status === "aborted" ||
|
|
2331
|
+
const l = c.key, p = c.value;
|
|
2332
|
+
if (l.status === "aborted" || p.status === "aborted")
|
|
2333
2333
|
return x;
|
|
2334
|
-
(l.status === "dirty" ||
|
|
2334
|
+
(l.status === "dirty" || p.status === "dirty") && t.dirty(), o.set(l.value, p.value);
|
|
2335
2335
|
}
|
|
2336
2336
|
return { status: t.value, value: o };
|
|
2337
2337
|
}
|
|
@@ -2343,25 +2343,25 @@ Ot.create = (n, e, t) => new Ot({
|
|
|
2343
2343
|
typeName: b.ZodMap,
|
|
2344
2344
|
..._(t)
|
|
2345
2345
|
});
|
|
2346
|
-
class
|
|
2346
|
+
class Oe extends O {
|
|
2347
2347
|
_parse(e) {
|
|
2348
2348
|
const { status: t, ctx: r } = this._processInputParams(e);
|
|
2349
|
-
if (r.parsedType !==
|
|
2350
|
-
return
|
|
2351
|
-
code:
|
|
2352
|
-
expected:
|
|
2349
|
+
if (r.parsedType !== g.set)
|
|
2350
|
+
return m(r, {
|
|
2351
|
+
code: f.invalid_type,
|
|
2352
|
+
expected: g.set,
|
|
2353
2353
|
received: r.parsedType
|
|
2354
2354
|
}), x;
|
|
2355
2355
|
const s = this._def;
|
|
2356
|
-
s.minSize !== null && r.data.size < s.minSize.value && (
|
|
2357
|
-
code:
|
|
2356
|
+
s.minSize !== null && r.data.size < s.minSize.value && (m(r, {
|
|
2357
|
+
code: f.too_small,
|
|
2358
2358
|
minimum: s.minSize.value,
|
|
2359
2359
|
type: "set",
|
|
2360
2360
|
inclusive: !0,
|
|
2361
2361
|
exact: !1,
|
|
2362
2362
|
message: s.minSize.message
|
|
2363
|
-
}), t.dirty()), s.maxSize !== null && r.data.size > s.maxSize.value && (
|
|
2364
|
-
code:
|
|
2363
|
+
}), t.dirty()), s.maxSize !== null && r.data.size > s.maxSize.value && (m(r, {
|
|
2364
|
+
code: f.too_big,
|
|
2365
2365
|
maximum: s.maxSize.value,
|
|
2366
2366
|
type: "set",
|
|
2367
2367
|
inclusive: !0,
|
|
@@ -2371,10 +2371,10 @@ class Te extends O {
|
|
|
2371
2371
|
const i = this._def.valueType;
|
|
2372
2372
|
function a(c) {
|
|
2373
2373
|
const l = /* @__PURE__ */ new Set();
|
|
2374
|
-
for (const
|
|
2375
|
-
if (
|
|
2374
|
+
for (const p of c) {
|
|
2375
|
+
if (p.status === "aborted")
|
|
2376
2376
|
return x;
|
|
2377
|
-
|
|
2377
|
+
p.status === "dirty" && t.dirty(), l.add(p.value);
|
|
2378
2378
|
}
|
|
2379
2379
|
return { status: t.value, value: l };
|
|
2380
2380
|
}
|
|
@@ -2382,13 +2382,13 @@ class Te extends O {
|
|
|
2382
2382
|
return r.common.async ? Promise.all(o).then((c) => a(c)) : a(o);
|
|
2383
2383
|
}
|
|
2384
2384
|
min(e, t) {
|
|
2385
|
-
return new
|
|
2385
|
+
return new Oe({
|
|
2386
2386
|
...this._def,
|
|
2387
2387
|
minSize: { value: e, message: v.toString(t) }
|
|
2388
2388
|
});
|
|
2389
2389
|
}
|
|
2390
2390
|
max(e, t) {
|
|
2391
|
-
return new
|
|
2391
|
+
return new Oe({
|
|
2392
2392
|
...this._def,
|
|
2393
2393
|
maxSize: { value: e, message: v.toString(t) }
|
|
2394
2394
|
});
|
|
@@ -2400,7 +2400,7 @@ class Te extends O {
|
|
|
2400
2400
|
return this.min(1, e);
|
|
2401
2401
|
}
|
|
2402
2402
|
}
|
|
2403
|
-
|
|
2403
|
+
Oe.create = (n, e) => new Oe({
|
|
2404
2404
|
valueType: n,
|
|
2405
2405
|
minSize: null,
|
|
2406
2406
|
maxSize: null,
|
|
@@ -2413,10 +2413,10 @@ class Ee extends O {
|
|
|
2413
2413
|
}
|
|
2414
2414
|
_parse(e) {
|
|
2415
2415
|
const { ctx: t } = this._processInputParams(e);
|
|
2416
|
-
if (t.parsedType !==
|
|
2417
|
-
return
|
|
2418
|
-
code:
|
|
2419
|
-
expected:
|
|
2416
|
+
if (t.parsedType !== g.function)
|
|
2417
|
+
return m(t, {
|
|
2418
|
+
code: f.invalid_type,
|
|
2419
|
+
expected: g.function,
|
|
2420
2420
|
received: t.parsedType
|
|
2421
2421
|
}), x;
|
|
2422
2422
|
function r(o, c) {
|
|
@@ -2430,7 +2430,7 @@ class Ee extends O {
|
|
|
2430
2430
|
$e
|
|
2431
2431
|
].filter((l) => !!l),
|
|
2432
2432
|
issueData: {
|
|
2433
|
-
code:
|
|
2433
|
+
code: f.invalid_arguments,
|
|
2434
2434
|
argumentsError: c
|
|
2435
2435
|
}
|
|
2436
2436
|
});
|
|
@@ -2446,7 +2446,7 @@ class Ee extends O {
|
|
|
2446
2446
|
$e
|
|
2447
2447
|
].filter((l) => !!l),
|
|
2448
2448
|
issueData: {
|
|
2449
|
-
code:
|
|
2449
|
+
code: f.invalid_return_type,
|
|
2450
2450
|
returnTypeError: c
|
|
2451
2451
|
}
|
|
2452
2452
|
});
|
|
@@ -2454,24 +2454,24 @@ class Ee extends O {
|
|
|
2454
2454
|
const i = { errorMap: t.common.contextualErrorMap }, a = t.data;
|
|
2455
2455
|
if (this._def.returns instanceof Re) {
|
|
2456
2456
|
const o = this;
|
|
2457
|
-
return
|
|
2458
|
-
const l = new
|
|
2459
|
-
throw l.addIssue(r(c,
|
|
2460
|
-
}),
|
|
2461
|
-
return await o._def.returns._def.type.parseAsync(
|
|
2462
|
-
throw l.addIssue(s(
|
|
2457
|
+
return z(async function(...c) {
|
|
2458
|
+
const l = new W([]), p = await o._def.args.parseAsync(c, i).catch((U) => {
|
|
2459
|
+
throw l.addIssue(r(c, U)), l;
|
|
2460
|
+
}), y = await Reflect.apply(a, this, p);
|
|
2461
|
+
return await o._def.returns._def.type.parseAsync(y, i).catch((U) => {
|
|
2462
|
+
throw l.addIssue(s(y, U)), l;
|
|
2463
2463
|
});
|
|
2464
2464
|
});
|
|
2465
2465
|
} else {
|
|
2466
2466
|
const o = this;
|
|
2467
|
-
return
|
|
2467
|
+
return z(function(...c) {
|
|
2468
2468
|
const l = o._def.args.safeParse(c, i);
|
|
2469
2469
|
if (!l.success)
|
|
2470
|
-
throw new
|
|
2471
|
-
const
|
|
2472
|
-
if (!
|
|
2473
|
-
throw new
|
|
2474
|
-
return
|
|
2470
|
+
throw new W([r(c, l.error)]);
|
|
2471
|
+
const p = Reflect.apply(a, this, l.data), y = o._def.returns.safeParse(p, i);
|
|
2472
|
+
if (!y.success)
|
|
2473
|
+
throw new W([s(p, y.error)]);
|
|
2474
|
+
return y.data;
|
|
2475
2475
|
});
|
|
2476
2476
|
}
|
|
2477
2477
|
}
|
|
@@ -2484,7 +2484,7 @@ class Ee extends O {
|
|
|
2484
2484
|
args(...e) {
|
|
2485
2485
|
return new Ee({
|
|
2486
2486
|
...this._def,
|
|
2487
|
-
args: Q.create(e).rest(
|
|
2487
|
+
args: Q.create(e).rest(ve.create())
|
|
2488
2488
|
});
|
|
2489
2489
|
}
|
|
2490
2490
|
returns(e) {
|
|
@@ -2501,14 +2501,14 @@ class Ee extends O {
|
|
|
2501
2501
|
}
|
|
2502
2502
|
static create(e, t, r) {
|
|
2503
2503
|
return new Ee({
|
|
2504
|
-
args: e || Q.create([]).rest(
|
|
2505
|
-
returns: t ||
|
|
2504
|
+
args: e || Q.create([]).rest(ve.create()),
|
|
2505
|
+
returns: t || ve.create(),
|
|
2506
2506
|
typeName: b.ZodFunction,
|
|
2507
2507
|
..._(r)
|
|
2508
2508
|
});
|
|
2509
2509
|
}
|
|
2510
2510
|
}
|
|
2511
|
-
class
|
|
2511
|
+
class tt extends O {
|
|
2512
2512
|
get schema() {
|
|
2513
2513
|
return this._def.getter();
|
|
2514
2514
|
}
|
|
@@ -2517,18 +2517,18 @@ class et extends O {
|
|
|
2517
2517
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
2518
2518
|
}
|
|
2519
2519
|
}
|
|
2520
|
-
|
|
2520
|
+
tt.create = (n, e) => new tt({
|
|
2521
2521
|
getter: n,
|
|
2522
2522
|
typeName: b.ZodLazy,
|
|
2523
2523
|
..._(e)
|
|
2524
2524
|
});
|
|
2525
|
-
class
|
|
2525
|
+
class nt extends O {
|
|
2526
2526
|
_parse(e) {
|
|
2527
2527
|
if (e.data !== this._def.value) {
|
|
2528
2528
|
const t = this._getOrReturnCtx(e);
|
|
2529
|
-
return
|
|
2529
|
+
return m(t, {
|
|
2530
2530
|
received: t.data,
|
|
2531
|
-
code:
|
|
2531
|
+
code: f.invalid_literal,
|
|
2532
2532
|
expected: this._def.value
|
|
2533
2533
|
}), x;
|
|
2534
2534
|
}
|
|
@@ -2538,7 +2538,7 @@ class tt extends O {
|
|
|
2538
2538
|
return this._def.value;
|
|
2539
2539
|
}
|
|
2540
2540
|
}
|
|
2541
|
-
|
|
2541
|
+
nt.create = (n, e) => new nt({
|
|
2542
2542
|
value: n,
|
|
2543
2543
|
typeName: b.ZodLiteral,
|
|
2544
2544
|
..._(e)
|
|
@@ -2557,21 +2557,21 @@ class fe extends O {
|
|
|
2557
2557
|
_parse(e) {
|
|
2558
2558
|
if (typeof e.data != "string") {
|
|
2559
2559
|
const t = this._getOrReturnCtx(e), r = this._def.values;
|
|
2560
|
-
return
|
|
2560
|
+
return m(t, {
|
|
2561
2561
|
expected: S.joinValues(r),
|
|
2562
2562
|
received: t.parsedType,
|
|
2563
|
-
code:
|
|
2563
|
+
code: f.invalid_type
|
|
2564
2564
|
}), x;
|
|
2565
2565
|
}
|
|
2566
|
-
if (xt(this, je) ||
|
|
2566
|
+
if (xt(this, je) || jn(this, je, new Set(this._def.values)), !xt(this, je).has(e.data)) {
|
|
2567
2567
|
const t = this._getOrReturnCtx(e), r = this._def.values;
|
|
2568
|
-
return
|
|
2568
|
+
return m(t, {
|
|
2569
2569
|
received: t.data,
|
|
2570
|
-
code:
|
|
2570
|
+
code: f.invalid_enum_value,
|
|
2571
2571
|
options: r
|
|
2572
2572
|
}), x;
|
|
2573
2573
|
}
|
|
2574
|
-
return
|
|
2574
|
+
return z(e.data);
|
|
2575
2575
|
}
|
|
2576
2576
|
get options() {
|
|
2577
2577
|
return this._def.values;
|
|
@@ -2609,36 +2609,36 @@ class fe extends O {
|
|
|
2609
2609
|
}
|
|
2610
2610
|
je = /* @__PURE__ */ new WeakMap();
|
|
2611
2611
|
fe.create = Dn;
|
|
2612
|
-
class
|
|
2612
|
+
class rt extends O {
|
|
2613
2613
|
constructor() {
|
|
2614
2614
|
super(...arguments), Ze.set(this, void 0);
|
|
2615
2615
|
}
|
|
2616
2616
|
_parse(e) {
|
|
2617
2617
|
const t = S.getValidEnumValues(this._def.values), r = this._getOrReturnCtx(e);
|
|
2618
|
-
if (r.parsedType !==
|
|
2618
|
+
if (r.parsedType !== g.string && r.parsedType !== g.number) {
|
|
2619
2619
|
const s = S.objectValues(t);
|
|
2620
|
-
return
|
|
2620
|
+
return m(r, {
|
|
2621
2621
|
expected: S.joinValues(s),
|
|
2622
2622
|
received: r.parsedType,
|
|
2623
|
-
code:
|
|
2623
|
+
code: f.invalid_type
|
|
2624
2624
|
}), x;
|
|
2625
2625
|
}
|
|
2626
|
-
if (xt(this, Ze) ||
|
|
2626
|
+
if (xt(this, Ze) || jn(this, Ze, new Set(S.getValidEnumValues(this._def.values))), !xt(this, Ze).has(e.data)) {
|
|
2627
2627
|
const s = S.objectValues(t);
|
|
2628
|
-
return
|
|
2628
|
+
return m(r, {
|
|
2629
2629
|
received: r.data,
|
|
2630
|
-
code:
|
|
2630
|
+
code: f.invalid_enum_value,
|
|
2631
2631
|
options: s
|
|
2632
2632
|
}), x;
|
|
2633
2633
|
}
|
|
2634
|
-
return
|
|
2634
|
+
return z(e.data);
|
|
2635
2635
|
}
|
|
2636
2636
|
get enum() {
|
|
2637
2637
|
return this._def.values;
|
|
2638
2638
|
}
|
|
2639
2639
|
}
|
|
2640
2640
|
Ze = /* @__PURE__ */ new WeakMap();
|
|
2641
|
-
|
|
2641
|
+
rt.create = (n, e) => new rt({
|
|
2642
2642
|
values: n,
|
|
2643
2643
|
typeName: b.ZodNativeEnum,
|
|
2644
2644
|
..._(e)
|
|
@@ -2649,14 +2649,14 @@ class Re extends O {
|
|
|
2649
2649
|
}
|
|
2650
2650
|
_parse(e) {
|
|
2651
2651
|
const { ctx: t } = this._processInputParams(e);
|
|
2652
|
-
if (t.parsedType !==
|
|
2653
|
-
return
|
|
2654
|
-
code:
|
|
2655
|
-
expected:
|
|
2652
|
+
if (t.parsedType !== g.promise && t.common.async === !1)
|
|
2653
|
+
return m(t, {
|
|
2654
|
+
code: f.invalid_type,
|
|
2655
|
+
expected: g.promise,
|
|
2656
2656
|
received: t.parsedType
|
|
2657
2657
|
}), x;
|
|
2658
|
-
const r = t.parsedType ===
|
|
2659
|
-
return
|
|
2658
|
+
const r = t.parsedType === g.promise ? t.data : Promise.resolve(t.data);
|
|
2659
|
+
return z(r.then((s) => this._def.type.parseAsync(s, {
|
|
2660
2660
|
path: t.path,
|
|
2661
2661
|
errorMap: t.common.contextualErrorMap
|
|
2662
2662
|
})));
|
|
@@ -2677,7 +2677,7 @@ class Y extends O {
|
|
|
2677
2677
|
_parse(e) {
|
|
2678
2678
|
const { status: t, ctx: r } = this._processInputParams(e), s = this._def.effect || null, i = {
|
|
2679
2679
|
addIssue: (a) => {
|
|
2680
|
-
|
|
2680
|
+
m(r, a), a.fatal ? t.abort() : t.dirty();
|
|
2681
2681
|
},
|
|
2682
2682
|
get path() {
|
|
2683
2683
|
return r.path;
|
|
@@ -2733,14 +2733,14 @@ class Y extends O {
|
|
|
2733
2733
|
path: r.path,
|
|
2734
2734
|
parent: r
|
|
2735
2735
|
});
|
|
2736
|
-
if (!
|
|
2736
|
+
if (!_e(a))
|
|
2737
2737
|
return a;
|
|
2738
2738
|
const o = s.transform(a.value, i);
|
|
2739
2739
|
if (o instanceof Promise)
|
|
2740
2740
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2741
2741
|
return { status: t.value, value: o };
|
|
2742
2742
|
} else
|
|
2743
|
-
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((a) =>
|
|
2743
|
+
return this._def.schema._parseAsync({ data: r.data, path: r.path, parent: r }).then((a) => _e(a) ? Promise.resolve(s.transform(a.value, i)).then((o) => ({ status: t.value, value: o })) : a);
|
|
2744
2744
|
S.assertNever(s);
|
|
2745
2745
|
}
|
|
2746
2746
|
}
|
|
@@ -2758,7 +2758,7 @@ Y.createWithPreprocess = (n, e, t) => new Y({
|
|
|
2758
2758
|
});
|
|
2759
2759
|
class X extends O {
|
|
2760
2760
|
_parse(e) {
|
|
2761
|
-
return this._getType(e) ===
|
|
2761
|
+
return this._getType(e) === g.undefined ? z(void 0) : this._def.innerType._parse(e);
|
|
2762
2762
|
}
|
|
2763
2763
|
unwrap() {
|
|
2764
2764
|
return this._def.innerType;
|
|
@@ -2769,24 +2769,24 @@ X.create = (n, e) => new X({
|
|
|
2769
2769
|
typeName: b.ZodOptional,
|
|
2770
2770
|
..._(e)
|
|
2771
2771
|
});
|
|
2772
|
-
class
|
|
2772
|
+
class pe extends O {
|
|
2773
2773
|
_parse(e) {
|
|
2774
|
-
return this._getType(e) ===
|
|
2774
|
+
return this._getType(e) === g.null ? z(null) : this._def.innerType._parse(e);
|
|
2775
2775
|
}
|
|
2776
2776
|
unwrap() {
|
|
2777
2777
|
return this._def.innerType;
|
|
2778
2778
|
}
|
|
2779
2779
|
}
|
|
2780
|
-
|
|
2780
|
+
pe.create = (n, e) => new pe({
|
|
2781
2781
|
innerType: n,
|
|
2782
2782
|
typeName: b.ZodNullable,
|
|
2783
2783
|
..._(e)
|
|
2784
2784
|
});
|
|
2785
|
-
class
|
|
2785
|
+
class st extends O {
|
|
2786
2786
|
_parse(e) {
|
|
2787
2787
|
const { ctx: t } = this._processInputParams(e);
|
|
2788
2788
|
let r = t.data;
|
|
2789
|
-
return t.parsedType ===
|
|
2789
|
+
return t.parsedType === g.undefined && (r = this._def.defaultValue()), this._def.innerType._parse({
|
|
2790
2790
|
data: r,
|
|
2791
2791
|
path: t.path,
|
|
2792
2792
|
parent: t
|
|
@@ -2796,13 +2796,13 @@ class rt extends O {
|
|
|
2796
2796
|
return this._def.innerType;
|
|
2797
2797
|
}
|
|
2798
2798
|
}
|
|
2799
|
-
|
|
2799
|
+
st.create = (n, e) => new st({
|
|
2800
2800
|
innerType: n,
|
|
2801
2801
|
typeName: b.ZodDefault,
|
|
2802
2802
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
2803
2803
|
..._(e)
|
|
2804
2804
|
});
|
|
2805
|
-
class
|
|
2805
|
+
class it extends O {
|
|
2806
2806
|
_parse(e) {
|
|
2807
2807
|
const { ctx: t } = this._processInputParams(e), r = {
|
|
2808
2808
|
...t,
|
|
@@ -2817,11 +2817,11 @@ class st extends O {
|
|
|
2817
2817
|
...r
|
|
2818
2818
|
}
|
|
2819
2819
|
});
|
|
2820
|
-
return
|
|
2820
|
+
return Ge(s) ? s.then((i) => ({
|
|
2821
2821
|
status: "valid",
|
|
2822
2822
|
value: i.status === "valid" ? i.value : this._def.catchValue({
|
|
2823
2823
|
get error() {
|
|
2824
|
-
return new
|
|
2824
|
+
return new W(r.common.issues);
|
|
2825
2825
|
},
|
|
2826
2826
|
input: r.data
|
|
2827
2827
|
})
|
|
@@ -2829,7 +2829,7 @@ class st extends O {
|
|
|
2829
2829
|
status: "valid",
|
|
2830
2830
|
value: s.status === "valid" ? s.value : this._def.catchValue({
|
|
2831
2831
|
get error() {
|
|
2832
|
-
return new
|
|
2832
|
+
return new W(r.common.issues);
|
|
2833
2833
|
},
|
|
2834
2834
|
input: r.data
|
|
2835
2835
|
})
|
|
@@ -2839,7 +2839,7 @@ class st extends O {
|
|
|
2839
2839
|
return this._def.innerType;
|
|
2840
2840
|
}
|
|
2841
2841
|
}
|
|
2842
|
-
|
|
2842
|
+
it.create = (n, e) => new it({
|
|
2843
2843
|
innerType: n,
|
|
2844
2844
|
typeName: b.ZodCatch,
|
|
2845
2845
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
@@ -2847,11 +2847,11 @@ st.create = (n, e) => new st({
|
|
|
2847
2847
|
});
|
|
2848
2848
|
class St extends O {
|
|
2849
2849
|
_parse(e) {
|
|
2850
|
-
if (this._getType(e) !==
|
|
2850
|
+
if (this._getType(e) !== g.nan) {
|
|
2851
2851
|
const r = this._getOrReturnCtx(e);
|
|
2852
|
-
return
|
|
2853
|
-
code:
|
|
2854
|
-
expected:
|
|
2852
|
+
return m(r, {
|
|
2853
|
+
code: f.invalid_type,
|
|
2854
|
+
expected: g.nan,
|
|
2855
2855
|
received: r.parsedType
|
|
2856
2856
|
}), x;
|
|
2857
2857
|
}
|
|
@@ -2862,7 +2862,7 @@ St.create = (n) => new St({
|
|
|
2862
2862
|
typeName: b.ZodNaN,
|
|
2863
2863
|
..._(n)
|
|
2864
2864
|
});
|
|
2865
|
-
const
|
|
2865
|
+
const os = Symbol("zod_brand");
|
|
2866
2866
|
class Kt extends O {
|
|
2867
2867
|
_parse(e) {
|
|
2868
2868
|
const { ctx: t } = this._processInputParams(e), r = t.data;
|
|
@@ -2876,7 +2876,7 @@ class Kt extends O {
|
|
|
2876
2876
|
return this._def.type;
|
|
2877
2877
|
}
|
|
2878
2878
|
}
|
|
2879
|
-
class
|
|
2879
|
+
class ct extends O {
|
|
2880
2880
|
_parse(e) {
|
|
2881
2881
|
const { status: t, ctx: r } = this._processInputParams(e);
|
|
2882
2882
|
if (r.common.async)
|
|
@@ -2909,173 +2909,186 @@ class ut extends O {
|
|
|
2909
2909
|
}
|
|
2910
2910
|
}
|
|
2911
2911
|
static create(e, t) {
|
|
2912
|
-
return new
|
|
2912
|
+
return new ct({
|
|
2913
2913
|
in: e,
|
|
2914
2914
|
out: t,
|
|
2915
2915
|
typeName: b.ZodPipeline
|
|
2916
2916
|
});
|
|
2917
2917
|
}
|
|
2918
2918
|
}
|
|
2919
|
-
class
|
|
2919
|
+
class at extends O {
|
|
2920
2920
|
_parse(e) {
|
|
2921
|
-
const t = this._def.innerType._parse(e), r = (s) => (
|
|
2922
|
-
return
|
|
2921
|
+
const t = this._def.innerType._parse(e), r = (s) => (_e(s) && (s.value = Object.freeze(s.value)), s);
|
|
2922
|
+
return Ge(t) ? t.then((s) => r(s)) : r(t);
|
|
2923
2923
|
}
|
|
2924
2924
|
unwrap() {
|
|
2925
2925
|
return this._def.innerType;
|
|
2926
2926
|
}
|
|
2927
2927
|
}
|
|
2928
|
-
|
|
2928
|
+
at.create = (n, e) => new at({
|
|
2929
2929
|
innerType: n,
|
|
2930
2930
|
typeName: b.ZodReadonly,
|
|
2931
2931
|
..._(e)
|
|
2932
2932
|
});
|
|
2933
|
-
function
|
|
2933
|
+
function yn(n, e) {
|
|
2934
|
+
const t = typeof n == "function" ? n(e) : typeof n == "string" ? { message: n } : n;
|
|
2935
|
+
return typeof t == "string" ? { message: t } : t;
|
|
2936
|
+
}
|
|
2937
|
+
function Ln(n, e = {}, t) {
|
|
2934
2938
|
return n ? Ce.create().superRefine((r, s) => {
|
|
2935
2939
|
var i, a;
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2940
|
+
const o = n(r);
|
|
2941
|
+
if (o instanceof Promise)
|
|
2942
|
+
return o.then((c) => {
|
|
2943
|
+
var l, p;
|
|
2944
|
+
if (!c) {
|
|
2945
|
+
const y = yn(e, r), j = (p = (l = y.fatal) !== null && l !== void 0 ? l : t) !== null && p !== void 0 ? p : !0;
|
|
2946
|
+
s.addIssue({ code: "custom", ...y, fatal: j });
|
|
2947
|
+
}
|
|
2948
|
+
});
|
|
2949
|
+
if (!o) {
|
|
2950
|
+
const c = yn(e, r), l = (a = (i = c.fatal) !== null && i !== void 0 ? i : t) !== null && a !== void 0 ? a : !0;
|
|
2951
|
+
s.addIssue({ code: "custom", ...c, fatal: l });
|
|
2939
2952
|
}
|
|
2940
2953
|
}) : Ce.create();
|
|
2941
2954
|
}
|
|
2942
|
-
const
|
|
2955
|
+
const us = {
|
|
2943
2956
|
object: R.lazycreate
|
|
2944
2957
|
};
|
|
2945
2958
|
var b;
|
|
2946
2959
|
(function(n) {
|
|
2947
2960
|
n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
|
|
2948
2961
|
})(b || (b = {}));
|
|
2949
|
-
const
|
|
2962
|
+
const cs = (n, e = {
|
|
2950
2963
|
message: `Input not instance of ${n.name}`
|
|
2951
|
-
}) =>
|
|
2964
|
+
}) => Ln((t) => t instanceof n, e), Pn = q.create, zn = de.create, ls = St.create, ds = he.create, Wn = Je.create, hs = Te.create, fs = _t.create, ps = He.create, ms = Xe.create, ys = Ce.create, gs = ve.create, vs = ae.create, ws = Tt.create, bs = F.create, xs = R.create, _s = R.strictCreate, Ts = Ke.create, Os = It.create, Ss = Qe.create, Ns = Q.create, Is = et.create, ks = Ot.create, As = Oe.create, Es = Ee.create, $s = tt.create, Cs = nt.create, Rs = fe.create, Ms = rt.create, js = Re.create, gn = Y.create, Zs = X.create, Bs = pe.create, Us = Y.createWithPreprocess, Ds = ct.create, Ls = () => Pn().optional(), Ps = () => zn().optional(), zs = () => Wn().optional(), Ws = {
|
|
2952
2965
|
string: (n) => q.create({ ...n, coerce: !0 }),
|
|
2953
|
-
number: (n) =>
|
|
2954
|
-
boolean: (n) =>
|
|
2966
|
+
number: (n) => de.create({ ...n, coerce: !0 }),
|
|
2967
|
+
boolean: (n) => Je.create({
|
|
2955
2968
|
...n,
|
|
2956
2969
|
coerce: !0
|
|
2957
2970
|
}),
|
|
2958
|
-
bigint: (n) =>
|
|
2959
|
-
date: (n) =>
|
|
2960
|
-
},
|
|
2971
|
+
bigint: (n) => he.create({ ...n, coerce: !0 }),
|
|
2972
|
+
date: (n) => Te.create({ ...n, coerce: !0 })
|
|
2973
|
+
}, Vs = x;
|
|
2961
2974
|
var u = /* @__PURE__ */ Object.freeze({
|
|
2962
2975
|
__proto__: null,
|
|
2963
2976
|
defaultErrorMap: $e,
|
|
2964
|
-
setErrorMap:
|
|
2977
|
+
setErrorMap: Ur,
|
|
2965
2978
|
getErrorMap: wt,
|
|
2966
2979
|
makeIssue: bt,
|
|
2967
|
-
EMPTY_PATH:
|
|
2968
|
-
addIssueToContext:
|
|
2969
|
-
ParseStatus:
|
|
2980
|
+
EMPTY_PATH: Dr,
|
|
2981
|
+
addIssueToContext: m,
|
|
2982
|
+
ParseStatus: L,
|
|
2970
2983
|
INVALID: x,
|
|
2971
2984
|
DIRTY: ke,
|
|
2972
|
-
OK:
|
|
2973
|
-
isAborted:
|
|
2974
|
-
isDirty:
|
|
2975
|
-
isValid:
|
|
2976
|
-
isAsync:
|
|
2985
|
+
OK: z,
|
|
2986
|
+
isAborted: Ut,
|
|
2987
|
+
isDirty: Dt,
|
|
2988
|
+
isValid: _e,
|
|
2989
|
+
isAsync: Ge,
|
|
2977
2990
|
get util() {
|
|
2978
2991
|
return S;
|
|
2979
2992
|
},
|
|
2980
2993
|
get objectUtil() {
|
|
2981
2994
|
return Bt;
|
|
2982
2995
|
},
|
|
2983
|
-
ZodParsedType:
|
|
2984
|
-
getParsedType:
|
|
2996
|
+
ZodParsedType: g,
|
|
2997
|
+
getParsedType: se,
|
|
2985
2998
|
ZodType: O,
|
|
2986
|
-
datetimeRegex:
|
|
2999
|
+
datetimeRegex: Un,
|
|
2987
3000
|
ZodString: q,
|
|
2988
|
-
ZodNumber:
|
|
2989
|
-
ZodBigInt:
|
|
2990
|
-
ZodBoolean:
|
|
2991
|
-
ZodDate:
|
|
3001
|
+
ZodNumber: de,
|
|
3002
|
+
ZodBigInt: he,
|
|
3003
|
+
ZodBoolean: Je,
|
|
3004
|
+
ZodDate: Te,
|
|
2992
3005
|
ZodSymbol: _t,
|
|
2993
|
-
ZodUndefined:
|
|
2994
|
-
ZodNull:
|
|
3006
|
+
ZodUndefined: He,
|
|
3007
|
+
ZodNull: Xe,
|
|
2995
3008
|
ZodAny: Ce,
|
|
2996
|
-
ZodUnknown:
|
|
2997
|
-
ZodNever:
|
|
3009
|
+
ZodUnknown: ve,
|
|
3010
|
+
ZodNever: ae,
|
|
2998
3011
|
ZodVoid: Tt,
|
|
2999
3012
|
ZodArray: F,
|
|
3000
3013
|
ZodObject: R,
|
|
3001
|
-
ZodUnion:
|
|
3014
|
+
ZodUnion: Ke,
|
|
3002
3015
|
ZodDiscriminatedUnion: It,
|
|
3003
|
-
ZodIntersection:
|
|
3016
|
+
ZodIntersection: Qe,
|
|
3004
3017
|
ZodTuple: Q,
|
|
3005
|
-
ZodRecord:
|
|
3018
|
+
ZodRecord: et,
|
|
3006
3019
|
ZodMap: Ot,
|
|
3007
|
-
ZodSet:
|
|
3020
|
+
ZodSet: Oe,
|
|
3008
3021
|
ZodFunction: Ee,
|
|
3009
|
-
ZodLazy:
|
|
3010
|
-
ZodLiteral:
|
|
3022
|
+
ZodLazy: tt,
|
|
3023
|
+
ZodLiteral: nt,
|
|
3011
3024
|
ZodEnum: fe,
|
|
3012
|
-
ZodNativeEnum:
|
|
3025
|
+
ZodNativeEnum: rt,
|
|
3013
3026
|
ZodPromise: Re,
|
|
3014
3027
|
ZodEffects: Y,
|
|
3015
3028
|
ZodTransformer: Y,
|
|
3016
3029
|
ZodOptional: X,
|
|
3017
|
-
ZodNullable:
|
|
3018
|
-
ZodDefault:
|
|
3019
|
-
ZodCatch:
|
|
3030
|
+
ZodNullable: pe,
|
|
3031
|
+
ZodDefault: st,
|
|
3032
|
+
ZodCatch: it,
|
|
3020
3033
|
ZodNaN: St,
|
|
3021
|
-
BRAND:
|
|
3034
|
+
BRAND: os,
|
|
3022
3035
|
ZodBranded: Kt,
|
|
3023
|
-
ZodPipeline:
|
|
3024
|
-
ZodReadonly:
|
|
3025
|
-
custom:
|
|
3036
|
+
ZodPipeline: ct,
|
|
3037
|
+
ZodReadonly: at,
|
|
3038
|
+
custom: Ln,
|
|
3026
3039
|
Schema: O,
|
|
3027
3040
|
ZodSchema: O,
|
|
3028
|
-
late:
|
|
3041
|
+
late: us,
|
|
3029
3042
|
get ZodFirstPartyTypeKind() {
|
|
3030
3043
|
return b;
|
|
3031
3044
|
},
|
|
3032
|
-
coerce:
|
|
3033
|
-
any:
|
|
3034
|
-
array:
|
|
3035
|
-
bigint:
|
|
3036
|
-
boolean:
|
|
3037
|
-
date:
|
|
3038
|
-
discriminatedUnion:
|
|
3039
|
-
effect:
|
|
3040
|
-
enum:
|
|
3041
|
-
function:
|
|
3042
|
-
instanceof:
|
|
3043
|
-
intersection:
|
|
3044
|
-
lazy:
|
|
3045
|
-
literal:
|
|
3046
|
-
map:
|
|
3047
|
-
nan:
|
|
3048
|
-
nativeEnum:
|
|
3049
|
-
never:
|
|
3050
|
-
null:
|
|
3051
|
-
nullable:
|
|
3052
|
-
number:
|
|
3053
|
-
object:
|
|
3054
|
-
oboolean:
|
|
3055
|
-
onumber:
|
|
3056
|
-
optional:
|
|
3057
|
-
ostring:
|
|
3058
|
-
pipeline:
|
|
3059
|
-
preprocess:
|
|
3060
|
-
promise:
|
|
3061
|
-
record:
|
|
3062
|
-
set:
|
|
3063
|
-
strictObject:
|
|
3064
|
-
string:
|
|
3065
|
-
symbol:
|
|
3066
|
-
transformer:
|
|
3067
|
-
tuple:
|
|
3068
|
-
undefined:
|
|
3069
|
-
union:
|
|
3070
|
-
unknown:
|
|
3071
|
-
void:
|
|
3072
|
-
NEVER:
|
|
3073
|
-
ZodIssueCode:
|
|
3074
|
-
quotelessJson:
|
|
3075
|
-
ZodError:
|
|
3045
|
+
coerce: Ws,
|
|
3046
|
+
any: ys,
|
|
3047
|
+
array: bs,
|
|
3048
|
+
bigint: ds,
|
|
3049
|
+
boolean: Wn,
|
|
3050
|
+
date: hs,
|
|
3051
|
+
discriminatedUnion: Os,
|
|
3052
|
+
effect: gn,
|
|
3053
|
+
enum: Rs,
|
|
3054
|
+
function: Es,
|
|
3055
|
+
instanceof: cs,
|
|
3056
|
+
intersection: Ss,
|
|
3057
|
+
lazy: $s,
|
|
3058
|
+
literal: Cs,
|
|
3059
|
+
map: ks,
|
|
3060
|
+
nan: ls,
|
|
3061
|
+
nativeEnum: Ms,
|
|
3062
|
+
never: vs,
|
|
3063
|
+
null: ms,
|
|
3064
|
+
nullable: Bs,
|
|
3065
|
+
number: zn,
|
|
3066
|
+
object: xs,
|
|
3067
|
+
oboolean: zs,
|
|
3068
|
+
onumber: Ps,
|
|
3069
|
+
optional: Zs,
|
|
3070
|
+
ostring: Ls,
|
|
3071
|
+
pipeline: Ds,
|
|
3072
|
+
preprocess: Us,
|
|
3073
|
+
promise: js,
|
|
3074
|
+
record: Is,
|
|
3075
|
+
set: As,
|
|
3076
|
+
strictObject: _s,
|
|
3077
|
+
string: Pn,
|
|
3078
|
+
symbol: fs,
|
|
3079
|
+
transformer: gn,
|
|
3080
|
+
tuple: Ns,
|
|
3081
|
+
undefined: ps,
|
|
3082
|
+
union: Ts,
|
|
3083
|
+
unknown: gs,
|
|
3084
|
+
void: ws,
|
|
3085
|
+
NEVER: Vs,
|
|
3086
|
+
ZodIssueCode: f,
|
|
3087
|
+
quotelessJson: Br,
|
|
3088
|
+
ZodError: W
|
|
3076
3089
|
});
|
|
3077
|
-
const
|
|
3078
|
-
const t =
|
|
3090
|
+
const qs = (n) => n != null && typeof n == "object" && "toString" in n, Fs = (n, e = !1) => {
|
|
3091
|
+
const t = qs(n) ? "stringer" : typeof n;
|
|
3079
3092
|
let r;
|
|
3080
3093
|
switch (t) {
|
|
3081
3094
|
case "string":
|
|
@@ -3099,91 +3112,91 @@ const Ws = (n) => n != null && typeof n == "object" && "toString" in n, Vs = (n,
|
|
|
3099
3112
|
default:
|
|
3100
3113
|
return console.warn(`sortFunc: unknown type ${t}`), () => -1;
|
|
3101
3114
|
}
|
|
3102
|
-
return e ?
|
|
3103
|
-
},
|
|
3115
|
+
return e ? Ys(r) : r;
|
|
3116
|
+
}, Ys = (n) => (e, t) => n(t, e), kt = u.tuple([u.number(), u.number()]);
|
|
3104
3117
|
u.tuple([u.bigint(), u.bigint()]);
|
|
3105
|
-
const Qt = u.object({ width: u.number(), height: u.number() }),
|
|
3118
|
+
const Qt = u.object({ width: u.number(), height: u.number() }), Gs = u.object({
|
|
3106
3119
|
signedWidth: u.number(),
|
|
3107
3120
|
signedHeight: u.number()
|
|
3108
|
-
}),
|
|
3109
|
-
u.enum(Ys);
|
|
3110
|
-
const Gs = ["start", "center", "end"], Js = ["signedWidth", "signedHeight"];
|
|
3121
|
+
}), Js = ["width", "height"];
|
|
3111
3122
|
u.enum(Js);
|
|
3112
|
-
const
|
|
3113
|
-
u.enum(Fn);
|
|
3114
|
-
const en = ["left", "right"], Yn = u.enum(en), tn = ["top", "bottom"], Gn = u.enum(tn), Jn = ["center"], gn = u.enum(Jn), Hs = [...Fn, ...Jn], Hn = u.enum(Hs);
|
|
3115
|
-
u.enum(Gs);
|
|
3116
|
-
const Xs = ["first", "last"];
|
|
3123
|
+
const Hs = ["start", "center", "end"], Xs = ["signedWidth", "signedHeight"];
|
|
3117
3124
|
u.enum(Xs);
|
|
3118
|
-
const
|
|
3119
|
-
u.
|
|
3120
|
-
u.
|
|
3121
|
-
u.
|
|
3122
|
-
|
|
3123
|
-
|
|
3125
|
+
const ot = u.object({ x: u.number(), y: u.number() }), Vn = u.object({ clientX: u.number(), clientY: u.number() }), qn = ["x", "y"], Fn = u.enum(qn), Yn = ["top", "right", "bottom", "left"];
|
|
3126
|
+
u.enum(Yn);
|
|
3127
|
+
const en = ["left", "right"], Gn = u.enum(en), tn = ["top", "bottom"], Jn = u.enum(tn), Hn = ["center"], vn = u.enum(Hn), Ks = [...Yn, ...Hn], Xn = u.enum(Ks);
|
|
3128
|
+
u.enum(Hs);
|
|
3129
|
+
const Qs = ["first", "last"];
|
|
3130
|
+
u.enum(Qs);
|
|
3131
|
+
const ei = u.object({ lower: u.number(), upper: u.number() }), ti = u.object({ lower: u.bigint(), upper: u.bigint() });
|
|
3132
|
+
u.union([ei, kt]);
|
|
3133
|
+
u.union([ti, kt]);
|
|
3134
|
+
u.enum([...Fn.options, ...Xn.options]);
|
|
3135
|
+
u.union([Fn, Xn, u.instanceof(String)]);
|
|
3136
|
+
const ni = (n) => typeof n == "bigint" || n instanceof BigInt, Ne = (n, e) => ni(n) ? n.valueOf() * BigInt(e.valueOf()) : n.valueOf() * Number(e.valueOf()), we = (n, e) => {
|
|
3124
3137
|
const t = {};
|
|
3125
3138
|
if (typeof n == "number" || typeof n == "bigint")
|
|
3126
3139
|
e != null ? (t.lower = n, t.upper = e) : (t.lower = typeof n == "bigint" ? 0n : 0, t.upper = n);
|
|
3127
3140
|
else if (Array.isArray(n)) {
|
|
3128
3141
|
if (n.length !== 2) throw new Error("bounds: expected array of length 2");
|
|
3129
3142
|
[t.lower, t.upper] = n;
|
|
3130
|
-
} else return
|
|
3131
|
-
return
|
|
3132
|
-
},
|
|
3133
|
-
const t =
|
|
3143
|
+
} else return wn(n);
|
|
3144
|
+
return wn(t);
|
|
3145
|
+
}, wn = (n) => n.lower > n.upper ? { lower: n.upper, upper: n.lower } : n, bn = (n, e) => {
|
|
3146
|
+
const t = we(n);
|
|
3134
3147
|
return e < t.lower ? t.lower : e >= t.upper ? t.upper - (typeof t.upper == "number" ? 1 : 1n) : e;
|
|
3135
|
-
}, nn = (n) =>
|
|
3148
|
+
}, nn = (n) => qn.includes(n) ? n : tn.includes(n) ? "y" : "x";
|
|
3136
3149
|
u.object({
|
|
3137
|
-
x:
|
|
3138
|
-
y:
|
|
3150
|
+
x: Gn.or(vn),
|
|
3151
|
+
y: Jn.or(vn)
|
|
3139
3152
|
});
|
|
3140
|
-
const
|
|
3153
|
+
const ri = u.object({ x: Gn, y: Jn }), rn = Object.freeze({ x: "left", y: "top" }), si = Object.freeze({ x: "right", y: "top" }), Kn = Object.freeze({ x: "left", y: "bottom" }), ii = Object.freeze({ x: "right", y: "bottom" }), Qn = (n, e) => n.x === e.x && n.y === e.y, ai = (n) => [n.x, n.y], Pt = u.union([
|
|
3141
3154
|
u.number(),
|
|
3142
|
-
|
|
3155
|
+
ot,
|
|
3143
3156
|
kt,
|
|
3144
3157
|
Qt,
|
|
3145
|
-
|
|
3146
|
-
|
|
3158
|
+
Gs,
|
|
3159
|
+
Vn
|
|
3147
3160
|
]), C = (n, e) => {
|
|
3148
3161
|
if (typeof n == "string") {
|
|
3149
3162
|
if (e === void 0) throw new Error("The y coordinate must be given.");
|
|
3150
3163
|
return n === "x" ? { x: e, y: 0 } : { x: 0, y: e };
|
|
3151
3164
|
}
|
|
3152
3165
|
return typeof n == "number" ? { x: n, y: e ?? n } : Array.isArray(n) ? { x: n[0], y: n[1] } : "signedWidth" in n ? { x: n.signedWidth, y: n.signedHeight } : "clientX" in n ? { x: n.clientX, y: n.clientY } : "width" in n ? { x: n.width, y: n.height } : { x: n.x, y: n.y };
|
|
3153
|
-
}, ee = Object.freeze({ x: 0, y: 0 }),
|
|
3166
|
+
}, ee = Object.freeze({ x: 0, y: 0 }), er = Object.freeze({ x: 1, y: 1 }), oi = Object.freeze({ x: 1 / 0, y: 1 / 0 }), ui = Object.freeze({ x: NaN, y: NaN }), Nt = (n, e, t = 0) => {
|
|
3154
3167
|
const r = C(n), s = C(e);
|
|
3155
3168
|
return t === 0 ? r.x === s.x && r.y === s.y : Math.abs(r.x - s.x) <= t && Math.abs(r.y - s.y) <= t;
|
|
3156
|
-
},
|
|
3169
|
+
}, ci = (n) => Nt(n, ee), sn = (n, e, t) => {
|
|
3157
3170
|
const r = C(n), s = C(e, t);
|
|
3158
3171
|
return { x: r.x * s.x, y: r.y * s.y };
|
|
3159
|
-
},
|
|
3172
|
+
}, tr = (n, e) => {
|
|
3160
3173
|
const t = C(n);
|
|
3161
3174
|
return { x: t.x + e, y: t.y };
|
|
3162
|
-
},
|
|
3175
|
+
}, nr = (n, e) => {
|
|
3163
3176
|
const t = C(n);
|
|
3164
3177
|
return { x: t.x, y: t.y + e };
|
|
3165
|
-
},
|
|
3178
|
+
}, ut = (n, e, t, ...r) => typeof e == "string" && typeof t == "number" ? e === "x" ? tr(n, t) : nr(n, t) : [n, e, t ?? ee, ...r].reduce((s, i) => {
|
|
3166
3179
|
const a = C(i);
|
|
3167
3180
|
return { x: s.x + a.x, y: s.y + a.y };
|
|
3168
|
-
}, ee),
|
|
3181
|
+
}, ee), li = (n, e, t) => {
|
|
3169
3182
|
const r = C(n);
|
|
3170
3183
|
return e === "x" ? { x: t, y: r.y } : { x: r.x, y: t };
|
|
3171
|
-
},
|
|
3184
|
+
}, di = (n, e) => {
|
|
3172
3185
|
const t = C(n), r = C(e);
|
|
3173
3186
|
return Math.sqrt((t.x - r.x) ** 2 + (t.y - r.y) ** 2);
|
|
3174
|
-
},
|
|
3187
|
+
}, hi = (n, e) => {
|
|
3175
3188
|
const t = C(n), r = C(e);
|
|
3176
3189
|
return { x: r.x - t.x, y: r.y - t.y };
|
|
3177
|
-
},
|
|
3190
|
+
}, fi = (n) => {
|
|
3178
3191
|
const e = C(n);
|
|
3179
3192
|
return Number.isNaN(e.x) || Number.isNaN(e.y);
|
|
3180
|
-
},
|
|
3193
|
+
}, pi = (n) => {
|
|
3181
3194
|
const e = C(n);
|
|
3182
3195
|
return Number.isFinite(e.x) && Number.isFinite(e.y);
|
|
3183
|
-
},
|
|
3196
|
+
}, mi = (n) => {
|
|
3184
3197
|
const e = C(n);
|
|
3185
3198
|
return [e.x, e.y];
|
|
3186
|
-
},
|
|
3199
|
+
}, yi = (n) => {
|
|
3187
3200
|
const e = C(n);
|
|
3188
3201
|
return { left: e.x, top: e.y };
|
|
3189
3202
|
}, zt = (n, e = 0) => {
|
|
@@ -3192,81 +3205,81 @@ const ti = u.object({ x: Yn, y: Gn }), rn = Object.freeze({ x: "left", y: "top"
|
|
|
3192
3205
|
}, Be = (n, e) => {
|
|
3193
3206
|
const t = C(n), r = C(e);
|
|
3194
3207
|
return { x: t.x - r.x, y: t.y - r.y };
|
|
3195
|
-
},
|
|
3208
|
+
}, Ue = (n) => {
|
|
3196
3209
|
const e = C(n), t = Math.hypot(e.x, e.y);
|
|
3197
3210
|
return t === 0 ? { x: 0, y: 0 } : { x: -e.y / t, y: e.x / t };
|
|
3198
|
-
},
|
|
3211
|
+
}, rr = (n) => {
|
|
3199
3212
|
const e = C(n), t = Math.hypot(e.x, e.y);
|
|
3200
3213
|
return t === 0 ? { x: 0, y: 0 } : { x: e.x / t, y: e.y / t };
|
|
3201
|
-
},
|
|
3202
|
-
const e = n.reduce((t, r) =>
|
|
3214
|
+
}, sr = (...n) => {
|
|
3215
|
+
const e = n.reduce((t, r) => ut(t, r), ee);
|
|
3203
3216
|
return sn(e, 1 / n.length);
|
|
3204
|
-
},
|
|
3217
|
+
}, gi = (n, e) => {
|
|
3205
3218
|
const t = [];
|
|
3206
3219
|
for (let r = 0; r < n.length; r++) {
|
|
3207
3220
|
const s = n[r];
|
|
3208
3221
|
let i, a, o, c;
|
|
3209
3222
|
if (r === 0) {
|
|
3210
|
-
const l = n[r + 1],
|
|
3211
|
-
a =
|
|
3223
|
+
const l = n[r + 1], p = Be(l, s);
|
|
3224
|
+
a = Ue(p), o = a, c = e;
|
|
3212
3225
|
} else if (r === n.length - 1) {
|
|
3213
|
-
const l = n[r - 1],
|
|
3214
|
-
i =
|
|
3226
|
+
const l = n[r - 1], p = Be(s, l);
|
|
3227
|
+
i = Ue(p), o = i, c = e;
|
|
3215
3228
|
} else {
|
|
3216
|
-
const l = n[r - 1],
|
|
3217
|
-
i =
|
|
3218
|
-
const
|
|
3219
|
-
(
|
|
3220
|
-
), Me = Math.sin(
|
|
3221
|
-
Me === 0 ? c = e : c = e / Me, o =
|
|
3229
|
+
const l = n[r - 1], p = n[r + 1], y = Be(s, l), j = Be(p, s);
|
|
3230
|
+
i = Ue(y), a = Ue(j);
|
|
3231
|
+
const U = Math.acos(
|
|
3232
|
+
(y.x * j.x + y.y * j.y) / (Math.hypot(y.x, y.y) * Math.hypot(j.x, j.y))
|
|
3233
|
+
), Me = Math.sin(U / 2);
|
|
3234
|
+
Me === 0 ? c = e : c = e / Me, o = rr(sr(i, a));
|
|
3222
3235
|
}
|
|
3223
3236
|
t.push(sn(o, c));
|
|
3224
3237
|
}
|
|
3225
3238
|
return t;
|
|
3226
3239
|
}, Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3227
3240
|
__proto__: null,
|
|
3228
|
-
INFINITY:
|
|
3229
|
-
NAN:
|
|
3230
|
-
ONE:
|
|
3241
|
+
INFINITY: oi,
|
|
3242
|
+
NAN: ui,
|
|
3243
|
+
ONE: er,
|
|
3231
3244
|
ZERO: ee,
|
|
3232
|
-
average:
|
|
3233
|
-
calculateMiters:
|
|
3234
|
-
clientXY:
|
|
3245
|
+
average: sr,
|
|
3246
|
+
calculateMiters: gi,
|
|
3247
|
+
clientXY: Vn,
|
|
3235
3248
|
construct: C,
|
|
3236
|
-
couple:
|
|
3249
|
+
couple: mi,
|
|
3237
3250
|
crudeZ: Pt,
|
|
3238
|
-
css:
|
|
3239
|
-
distance:
|
|
3251
|
+
css: yi,
|
|
3252
|
+
distance: di,
|
|
3240
3253
|
equals: Nt,
|
|
3241
|
-
isFinite:
|
|
3242
|
-
isNan:
|
|
3243
|
-
isZero:
|
|
3244
|
-
normal:
|
|
3245
|
-
normalize:
|
|
3254
|
+
isFinite: pi,
|
|
3255
|
+
isNan: fi,
|
|
3256
|
+
isZero: ci,
|
|
3257
|
+
normal: Ue,
|
|
3258
|
+
normalize: rr,
|
|
3246
3259
|
scale: sn,
|
|
3247
|
-
set:
|
|
3260
|
+
set: li,
|
|
3248
3261
|
sub: Be,
|
|
3249
|
-
translate:
|
|
3250
|
-
translateX:
|
|
3251
|
-
translateY:
|
|
3252
|
-
translation:
|
|
3262
|
+
translate: ut,
|
|
3263
|
+
translateX: tr,
|
|
3264
|
+
translateY: nr,
|
|
3265
|
+
translation: hi,
|
|
3253
3266
|
truncate: zt,
|
|
3254
|
-
xy:
|
|
3255
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3256
|
-
top:
|
|
3257
|
-
left:
|
|
3258
|
-
width:
|
|
3259
|
-
height:
|
|
3260
|
-
}),
|
|
3267
|
+
xy: ot
|
|
3268
|
+
}, Symbol.toStringTag, { value: "Module" })), ht = u.union([u.number(), u.string()]), vi = u.object({
|
|
3269
|
+
top: ht,
|
|
3270
|
+
left: ht,
|
|
3271
|
+
width: ht,
|
|
3272
|
+
height: ht
|
|
3273
|
+
}), wi = u.object({
|
|
3261
3274
|
left: u.number(),
|
|
3262
3275
|
top: u.number(),
|
|
3263
3276
|
right: u.number(),
|
|
3264
3277
|
bottom: u.number()
|
|
3265
|
-
}),
|
|
3266
|
-
one:
|
|
3267
|
-
two:
|
|
3268
|
-
root:
|
|
3269
|
-
}),
|
|
3278
|
+
}), bi = u.object({
|
|
3279
|
+
one: ot,
|
|
3280
|
+
two: ot,
|
|
3281
|
+
root: ri
|
|
3282
|
+
}), ir = { one: ee, two: ee, root: rn }, xi = { one: ee, two: er, root: Kn }, ar = (n, e) => ({
|
|
3270
3283
|
one: n.one,
|
|
3271
3284
|
two: n.two,
|
|
3272
3285
|
root: e ?? n.root
|
|
@@ -3288,7 +3301,7 @@ const ti = u.object({ x: Yn, y: Gn }), rn = Object.freeze({ x: "left", y: "top"
|
|
|
3288
3301
|
x: i.one.x + e.signedWidth,
|
|
3289
3302
|
y: i.one.y + e.signedHeight
|
|
3290
3303
|
} : i.two = e, i));
|
|
3291
|
-
},
|
|
3304
|
+
}, _i = (n, e, t) => {
|
|
3292
3305
|
const r = $(n);
|
|
3293
3306
|
if (typeof e == "string") {
|
|
3294
3307
|
if (t == null) throw new Error("Invalid arguments for resize");
|
|
@@ -3296,69 +3309,69 @@ const ti = u.object({ x: Yn, y: Gn }), rn = Object.freeze({ x: "left", y: "top"
|
|
|
3296
3309
|
return $(
|
|
3297
3310
|
r.one,
|
|
3298
3311
|
void 0,
|
|
3299
|
-
s === "x" ? t :
|
|
3300
|
-
s === "y" ? t :
|
|
3312
|
+
s === "x" ? t : me(r),
|
|
3313
|
+
s === "y" ? t : ye(r),
|
|
3301
3314
|
r.root
|
|
3302
3315
|
);
|
|
3303
3316
|
}
|
|
3304
3317
|
return $(r.one, e, void 0, void 0, r.root);
|
|
3305
|
-
},
|
|
3318
|
+
}, Ti = (n, e, t = !0) => {
|
|
3306
3319
|
const r = $(n);
|
|
3307
3320
|
let s = (i, a) => i < a;
|
|
3308
|
-
return t && (s = (i, a) => i <= a), "one" in e ? s(
|
|
3309
|
-
},
|
|
3310
|
-
width:
|
|
3311
|
-
height:
|
|
3312
|
-
}),
|
|
3321
|
+
return t && (s = (i, a) => i <= a), "one" in e ? s(ce(r), ce(e)) && s(be(e), be(r)) && s(le(r), le(e)) && s(xe(e), xe(r)) : s(ce(r), e.x) && s(e.x, be(r)) && s(le(r), e.y) && s(e.y, xe(r));
|
|
3322
|
+
}, Oi = (n, e) => Nt(n.one, e.one) && Nt(n.two, e.two) && Qn(n.root, e.root), or = (n) => ({
|
|
3323
|
+
width: me(n),
|
|
3324
|
+
height: ye(n)
|
|
3325
|
+
}), Si = (n) => ({
|
|
3313
3326
|
signedWidth: At(n),
|
|
3314
3327
|
signedHeight: Et(n)
|
|
3315
|
-
}),
|
|
3316
|
-
top:
|
|
3317
|
-
left:
|
|
3318
|
-
width:
|
|
3319
|
-
height:
|
|
3328
|
+
}), Ni = (n) => ({
|
|
3329
|
+
top: le(n),
|
|
3330
|
+
left: ce(n),
|
|
3331
|
+
width: me(n),
|
|
3332
|
+
height: ye(n)
|
|
3320
3333
|
}), an = (n, e, t = !1) => {
|
|
3321
3334
|
const r = nn(e) === "y" ? Et(n) : At(n);
|
|
3322
3335
|
return t ? r : Math.abs(r);
|
|
3323
|
-
},
|
|
3336
|
+
}, lt = (n, e) => {
|
|
3324
3337
|
const t = $(n);
|
|
3325
3338
|
return {
|
|
3326
|
-
x: e.x === "center" ? Vt(t).x :
|
|
3327
|
-
y: e.y === "center" ? Vt(t).y :
|
|
3339
|
+
x: e.x === "center" ? Vt(t).x : Se(t, e.x),
|
|
3340
|
+
y: e.y === "center" ? Vt(t).y : Se(t, e.y)
|
|
3328
3341
|
};
|
|
3329
|
-
},
|
|
3330
|
-
const t = $(n), r =
|
|
3342
|
+
}, Se = (n, e) => {
|
|
3343
|
+
const t = $(n), r = ai(t.root).includes(e) ? Math.min : Math.max;
|
|
3331
3344
|
return en.includes(e) ? r(t.one.x, t.two.x) : r(t.one.y, t.two.y);
|
|
3332
|
-
},
|
|
3345
|
+
}, Ii = (n) => n.one.x === n.two.x && n.one.y === n.two.y, me = (n) => an(n, "x"), ye = (n) => an(n, "y"), At = (n) => {
|
|
3333
3346
|
const e = $(n);
|
|
3334
3347
|
return e.two.x - e.one.x;
|
|
3335
3348
|
}, Et = (n) => {
|
|
3336
3349
|
const e = $(n);
|
|
3337
3350
|
return e.two.y - e.one.y;
|
|
3338
|
-
},
|
|
3351
|
+
}, ur = (n) => lt(n, rn), ki = (n) => lt(n, si), Ai = (n) => lt(n, Kn), Ei = (n) => lt(n, ii), be = (n) => Se(n, "right"), xe = (n) => Se(n, "bottom"), ce = (n) => Se(n, "left"), le = (n) => Se(n, "top"), Vt = (n) => ut(ur(n), {
|
|
3339
3352
|
x: At(n) / 2,
|
|
3340
3353
|
y: Et(n) / 2
|
|
3341
3354
|
}), on = (n) => {
|
|
3342
3355
|
const e = $(n);
|
|
3343
|
-
return e.root.x === "left" ?
|
|
3356
|
+
return e.root.x === "left" ? ce(e) : be(e);
|
|
3344
3357
|
}, un = (n) => {
|
|
3345
3358
|
const e = $(n);
|
|
3346
|
-
return e.root.y === "top" ?
|
|
3347
|
-
},
|
|
3359
|
+
return e.root.y === "top" ? le(e) : xe(e);
|
|
3360
|
+
}, $i = (n) => ({ x: on(n), y: un(n) }), mt = (n) => {
|
|
3348
3361
|
const e = $(n);
|
|
3349
3362
|
return { lower: e.one.x, upper: e.two.x };
|
|
3350
|
-
},
|
|
3363
|
+
}, yt = (n) => {
|
|
3351
3364
|
const e = $(n);
|
|
3352
3365
|
return { lower: e.one.y, upper: e.two.y };
|
|
3353
|
-
},
|
|
3366
|
+
}, Ci = (n, e) => ar(n, e), Ri = (n, e) => {
|
|
3354
3367
|
const t = $(n), r = en.includes(e) ? "x" : tn.includes(e) ? "y" : null;
|
|
3355
3368
|
if (r === null) throw new Error(`Invalid location: ${e}`);
|
|
3356
3369
|
const s = e === "top" || e === "left" ? Math.min : Math.max, i = { ...t.one }, a = { ...t.two };
|
|
3357
3370
|
return i[r] = s(t.one[r], t.two[r]), a[r] = s(t.one[r], t.two[r]), [i, a];
|
|
3358
|
-
},
|
|
3359
|
-
const t = $(n), r = $(e), s = on(r) + (
|
|
3360
|
-
return $({ x: s, y: i },
|
|
3361
|
-
},
|
|
3371
|
+
}, Mi = (n, e) => {
|
|
3372
|
+
const t = $(n), r = $(e), s = on(r) + (me(r) - me(t)) / 2, i = un(r) + (ye(r) - ye(t)) / 2;
|
|
3373
|
+
return $({ x: s, y: i }, or(t));
|
|
3374
|
+
}, cr = (n) => typeof n != "object" || n == null ? !1 : "one" in n && "two" in n && "root" in n, ji = (n) => me(n) / ye(n), Zi = (n, e, t) => {
|
|
3362
3375
|
if (typeof e == "string") {
|
|
3363
3376
|
if (t == null) throw new Error("Undefined amount passed into box.translate");
|
|
3364
3377
|
const s = nn(e);
|
|
@@ -3366,16 +3379,16 @@ const ti = u.object({ x: Yn, y: Gn }), rn = Object.freeze({ x: "left", y: "top"
|
|
|
3366
3379
|
}
|
|
3367
3380
|
const r = $(n);
|
|
3368
3381
|
return $(
|
|
3369
|
-
|
|
3370
|
-
|
|
3382
|
+
ut(r.one, e),
|
|
3383
|
+
ut(r.two, e),
|
|
3371
3384
|
void 0,
|
|
3372
3385
|
void 0,
|
|
3373
3386
|
r.root
|
|
3374
3387
|
);
|
|
3375
|
-
},
|
|
3376
|
-
const t = Math.max(
|
|
3377
|
-
return t > s || r > i ?
|
|
3378
|
-
},
|
|
3388
|
+
}, Bi = (n, e) => {
|
|
3389
|
+
const t = Math.max(ce(n), ce(e)), r = Math.max(le(n), le(e)), s = Math.min(be(n), be(e)), i = Math.min(xe(n), xe(e));
|
|
3390
|
+
return t > s || r > i ? ir : $({ x: t, y: r }, { x: s, y: i }, void 0, void 0, n.root);
|
|
3391
|
+
}, Ui = (n) => me(n) * ye(n), Di = (n, e) => {
|
|
3379
3392
|
const t = $(n);
|
|
3380
3393
|
return $(
|
|
3381
3394
|
zt(t.one, e),
|
|
@@ -3384,121 +3397,121 @@ const ti = u.object({ x: Yn, y: Gn }), rn = Object.freeze({ x: "left", y: "top"
|
|
|
3384
3397
|
void 0,
|
|
3385
3398
|
t.root
|
|
3386
3399
|
);
|
|
3387
|
-
},
|
|
3400
|
+
}, Li = (n, e, t, r, s, i) => {
|
|
3388
3401
|
const a = { x: n, y: e }, o = { x: n + t, y: e + r };
|
|
3389
3402
|
return s.x !== i.x && (s.x === "center" ? (a.x -= t / 2, o.x -= t / 2) : (a.x -= t, o.x -= t)), s.y !== i.y && (s.y === "center" ? (a.y -= r / 2, o.y -= r / 2) : (a.y -= r, o.y -= r)), $(a, o, void 0, void 0, i);
|
|
3390
3403
|
}, ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3391
3404
|
__proto__: null,
|
|
3392
|
-
DECIMAL:
|
|
3393
|
-
ZERO:
|
|
3394
|
-
area:
|
|
3395
|
-
areaIsZero:
|
|
3396
|
-
aspect:
|
|
3397
|
-
bottom:
|
|
3398
|
-
bottomLeft:
|
|
3399
|
-
bottomRight:
|
|
3400
|
-
box:
|
|
3405
|
+
DECIMAL: xi,
|
|
3406
|
+
ZERO: ir,
|
|
3407
|
+
area: Ui,
|
|
3408
|
+
areaIsZero: Ii,
|
|
3409
|
+
aspect: ji,
|
|
3410
|
+
bottom: xe,
|
|
3411
|
+
bottomLeft: Ai,
|
|
3412
|
+
bottomRight: Ei,
|
|
3413
|
+
box: bi,
|
|
3401
3414
|
center: Vt,
|
|
3402
3415
|
construct: $,
|
|
3403
|
-
constructWithAlternateRoot:
|
|
3404
|
-
contains:
|
|
3405
|
-
copy:
|
|
3406
|
-
css:
|
|
3407
|
-
cssBox:
|
|
3416
|
+
constructWithAlternateRoot: Li,
|
|
3417
|
+
contains: Ti,
|
|
3418
|
+
copy: ar,
|
|
3419
|
+
css: Ni,
|
|
3420
|
+
cssBox: vi,
|
|
3408
3421
|
dim: an,
|
|
3409
|
-
dims:
|
|
3410
|
-
domRect:
|
|
3411
|
-
edgePoints:
|
|
3412
|
-
equals:
|
|
3413
|
-
height:
|
|
3414
|
-
intersection:
|
|
3415
|
-
isBox:
|
|
3416
|
-
left:
|
|
3417
|
-
loc:
|
|
3418
|
-
positionInCenter:
|
|
3419
|
-
reRoot:
|
|
3420
|
-
resize:
|
|
3421
|
-
right:
|
|
3422
|
-
root:
|
|
3423
|
-
signedDims:
|
|
3422
|
+
dims: or,
|
|
3423
|
+
domRect: wi,
|
|
3424
|
+
edgePoints: Ri,
|
|
3425
|
+
equals: Oi,
|
|
3426
|
+
height: ye,
|
|
3427
|
+
intersection: Bi,
|
|
3428
|
+
isBox: cr,
|
|
3429
|
+
left: ce,
|
|
3430
|
+
loc: Se,
|
|
3431
|
+
positionInCenter: Mi,
|
|
3432
|
+
reRoot: Ci,
|
|
3433
|
+
resize: _i,
|
|
3434
|
+
right: be,
|
|
3435
|
+
root: $i,
|
|
3436
|
+
signedDims: Si,
|
|
3424
3437
|
signedHeight: Et,
|
|
3425
3438
|
signedWidth: At,
|
|
3426
|
-
top:
|
|
3427
|
-
topLeft:
|
|
3428
|
-
topRight:
|
|
3429
|
-
translate:
|
|
3430
|
-
truncate:
|
|
3431
|
-
width:
|
|
3439
|
+
top: le,
|
|
3440
|
+
topLeft: ur,
|
|
3441
|
+
topRight: ki,
|
|
3442
|
+
translate: Zi,
|
|
3443
|
+
truncate: Di,
|
|
3444
|
+
width: me,
|
|
3432
3445
|
x: on,
|
|
3433
|
-
xBounds:
|
|
3434
|
-
xyLoc:
|
|
3446
|
+
xBounds: mt,
|
|
3447
|
+
xyLoc: lt,
|
|
3435
3448
|
y: un,
|
|
3436
|
-
yBounds:
|
|
3437
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3449
|
+
yBounds: yt
|
|
3450
|
+
}, Symbol.toStringTag, { value: "Module" })), lr = u.object({ signedWidth: u.number(), signedHeight: u.number() }), Pi = u.union([Qt, lr, ot, kt]), zi = { width: 0, height: 0 }, Wi = { width: 1, height: 1 }, G = (n, e) => typeof n == "number" ? { width: n, height: e ?? n } : Array.isArray(n) ? { width: n[0], height: n[1] } : "x" in n ? { width: n.x, height: n.y } : "signedWidth" in n ? { width: n.signedWidth, height: n.signedHeight } : { ...n }, Vi = (n, e) => {
|
|
3438
3451
|
if (e == null) return !1;
|
|
3439
3452
|
const t = G(n), r = G(e);
|
|
3440
3453
|
return t.width === r.width && t.height === r.height;
|
|
3441
|
-
},
|
|
3454
|
+
}, qi = (n) => {
|
|
3442
3455
|
const e = G(n);
|
|
3443
3456
|
return { width: e.height, height: e.width };
|
|
3444
|
-
},
|
|
3457
|
+
}, Fi = (n) => {
|
|
3445
3458
|
const e = G(n);
|
|
3446
3459
|
return `0 0 ${e.width} ${e.height}`;
|
|
3447
|
-
},
|
|
3460
|
+
}, Yi = (n) => {
|
|
3448
3461
|
const e = G(n);
|
|
3449
3462
|
return [e.width, e.height];
|
|
3450
|
-
},
|
|
3463
|
+
}, Gi = (n) => ({
|
|
3451
3464
|
width: Math.max(...n.map((e) => G(e).width)),
|
|
3452
3465
|
height: Math.max(...n.map((e) => G(e).height))
|
|
3453
|
-
}),
|
|
3466
|
+
}), Ji = (n) => ({
|
|
3454
3467
|
width: Math.min(...n.map((e) => G(e).width)),
|
|
3455
3468
|
height: Math.min(...n.map((e) => G(e).height))
|
|
3456
|
-
}),
|
|
3469
|
+
}), Hi = (n, e) => {
|
|
3457
3470
|
const t = G(n);
|
|
3458
3471
|
return { width: t.width * e, height: t.height * e };
|
|
3459
3472
|
}, Mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3460
3473
|
__proto__: null,
|
|
3461
|
-
DECIMAL:
|
|
3462
|
-
ZERO:
|
|
3474
|
+
DECIMAL: Wi,
|
|
3475
|
+
ZERO: zi,
|
|
3463
3476
|
construct: G,
|
|
3464
|
-
couple:
|
|
3465
|
-
crude:
|
|
3477
|
+
couple: Yi,
|
|
3478
|
+
crude: Pi,
|
|
3466
3479
|
dimensions: Qt,
|
|
3467
|
-
equals:
|
|
3468
|
-
max:
|
|
3469
|
-
min:
|
|
3470
|
-
scale:
|
|
3471
|
-
signed:
|
|
3472
|
-
svgViewBox:
|
|
3473
|
-
swap:
|
|
3480
|
+
equals: Vi,
|
|
3481
|
+
max: Gi,
|
|
3482
|
+
min: Ji,
|
|
3483
|
+
scale: Hi,
|
|
3484
|
+
signed: lr,
|
|
3485
|
+
svgViewBox: Fi,
|
|
3486
|
+
swap: qi
|
|
3474
3487
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3475
|
-
var
|
|
3476
|
-
const
|
|
3488
|
+
var Xi = Object.defineProperty, Ki = (n, e, t) => e in n ? Xi(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, ie = (n, e, t) => Ki(n, typeof e != "symbol" ? e + "" : e, t);
|
|
3489
|
+
const Qi = (n, e, t) => e !== void 0 && n < e ? e : t !== void 0 && n > t ? t : n;
|
|
3477
3490
|
u.object({ offset: Pt, scale: Pt });
|
|
3478
3491
|
u.object({ offset: u.number(), scale: u.number() });
|
|
3479
|
-
const
|
|
3492
|
+
const ea = (n) => (e, t, r, s) => t === "dimension" ? [e, r] : [
|
|
3480
3493
|
e,
|
|
3481
3494
|
s ? r - n : r + n
|
|
3482
|
-
],
|
|
3495
|
+
], ta = (n) => (e, t, r, s) => [
|
|
3483
3496
|
e,
|
|
3484
3497
|
s ? r / n : r * n
|
|
3485
|
-
],
|
|
3498
|
+
], na = (n) => (e, t, r) => {
|
|
3486
3499
|
if (e === null) return [n, r];
|
|
3487
3500
|
const { lower: s, upper: i } = e, { lower: a, upper: o } = n, c = i - s, l = o - a;
|
|
3488
3501
|
if (t === "dimension") return [n, r * (l / c)];
|
|
3489
|
-
const
|
|
3490
|
-
return [n,
|
|
3491
|
-
},
|
|
3502
|
+
const p = (r - s) * (l / c) + a;
|
|
3503
|
+
return [n, p];
|
|
3504
|
+
}, ra = (n) => (e, t, r) => [n, r], sa = () => (n, e, t) => {
|
|
3492
3505
|
if (n === null) throw new Error("cannot invert without bounds");
|
|
3493
3506
|
if (e === "dimension") return [n, t];
|
|
3494
3507
|
const { lower: r, upper: s } = n;
|
|
3495
3508
|
return [n, s - (t - r)];
|
|
3496
|
-
},
|
|
3509
|
+
}, ia = (n) => (e, t, r) => {
|
|
3497
3510
|
const { lower: s, upper: i } = n;
|
|
3498
|
-
return r =
|
|
3499
|
-
}, qt = class
|
|
3511
|
+
return r = Qi(r, s, i), [e, r];
|
|
3512
|
+
}, qt = class De {
|
|
3500
3513
|
constructor() {
|
|
3501
|
-
|
|
3514
|
+
ie(this, "ops", []), ie(this, "currBounds", null), ie(this, "currType", null), ie(this, "reversed", !1), this.ops = [];
|
|
3502
3515
|
}
|
|
3503
3516
|
/**
|
|
3504
3517
|
* @returns a new scale with a translation as its first operation. Any number provided
|
|
@@ -3506,7 +3519,7 @@ const Ki = (n) => (e, t, r, s) => t === "dimension" ? [e, r] : [
|
|
|
3506
3519
|
* @param value - The amount to translate by.
|
|
3507
3520
|
*/
|
|
3508
3521
|
static translate(e) {
|
|
3509
|
-
return new
|
|
3522
|
+
return new De().translate(e);
|
|
3510
3523
|
}
|
|
3511
3524
|
/**
|
|
3512
3525
|
* @returns a new scale with a magnification as its first operation. Any number provided
|
|
@@ -3514,10 +3527,10 @@ const Ki = (n) => (e, t, r, s) => t === "dimension" ? [e, r] : [
|
|
|
3514
3527
|
* @param value - The amount to translate by.
|
|
3515
3528
|
*/
|
|
3516
3529
|
static magnify(e) {
|
|
3517
|
-
return new
|
|
3530
|
+
return new De().magnify(e);
|
|
3518
3531
|
}
|
|
3519
3532
|
static scale(e, t) {
|
|
3520
|
-
return new
|
|
3533
|
+
return new De().scale(e, t);
|
|
3521
3534
|
}
|
|
3522
3535
|
/**
|
|
3523
3536
|
* @returns a copy of the scale with a translation as its next operation. Any
|
|
@@ -3526,7 +3539,7 @@ const Ki = (n) => (e, t, r, s) => t === "dimension" ? [e, r] : [
|
|
|
3526
3539
|
* @param value - The amount to translate by.
|
|
3527
3540
|
*/
|
|
3528
3541
|
translate(e) {
|
|
3529
|
-
const t = this.new(), r =
|
|
3542
|
+
const t = this.new(), r = ea(e);
|
|
3530
3543
|
return r.type = "translate", t.ops.push(r), t;
|
|
3531
3544
|
}
|
|
3532
3545
|
/**
|
|
@@ -3536,23 +3549,23 @@ const Ki = (n) => (e, t, r, s) => t === "dimension" ? [e, r] : [
|
|
|
3536
3549
|
* @param value - The amount to magnify by.
|
|
3537
3550
|
*/
|
|
3538
3551
|
magnify(e) {
|
|
3539
|
-
const t = this.new(), r =
|
|
3552
|
+
const t = this.new(), r = ta(e);
|
|
3540
3553
|
return r.type = "magnify", t.ops.push(r), t;
|
|
3541
3554
|
}
|
|
3542
3555
|
scale(e, t) {
|
|
3543
|
-
const r =
|
|
3556
|
+
const r = we(e, t), s = this.new(), i = na(r);
|
|
3544
3557
|
return i.type = "scale", s.ops.push(i), s;
|
|
3545
3558
|
}
|
|
3546
3559
|
clamp(e, t) {
|
|
3547
|
-
const r =
|
|
3560
|
+
const r = we(e, t), s = this.new(), i = ia(r);
|
|
3548
3561
|
return i.type = "clamp", s.ops.push(i), s;
|
|
3549
3562
|
}
|
|
3550
3563
|
reBound(e, t) {
|
|
3551
|
-
const r =
|
|
3564
|
+
const r = we(e, t), s = this.new(), i = ra(r);
|
|
3552
3565
|
return i.type = "re-bound", s.ops.push(i), s;
|
|
3553
3566
|
}
|
|
3554
3567
|
invert() {
|
|
3555
|
-
const e =
|
|
3568
|
+
const e = sa();
|
|
3556
3569
|
e.type = "invert";
|
|
3557
3570
|
const t = this.new();
|
|
3558
3571
|
return t.ops.push(e), t;
|
|
@@ -3564,7 +3577,7 @@ const Ki = (n) => (e, t, r, s) => t === "dimension" ? [e, r] : [
|
|
|
3564
3577
|
return this.exec("dimension", e);
|
|
3565
3578
|
}
|
|
3566
3579
|
new() {
|
|
3567
|
-
const e = new
|
|
3580
|
+
const e = new De();
|
|
3568
3581
|
return e.ops = this.ops.slice(), e.reversed = this.reversed, e;
|
|
3569
3582
|
}
|
|
3570
3583
|
exec(e, t) {
|
|
@@ -3591,32 +3604,32 @@ const Ki = (n) => (e, t, r, s) => t === "dimension" ? [e, r] : [
|
|
|
3591
3604
|
return { scale: this.dim(1), offset: this.pos(0) };
|
|
3592
3605
|
}
|
|
3593
3606
|
};
|
|
3594
|
-
|
|
3595
|
-
let
|
|
3596
|
-
const
|
|
3597
|
-
constructor(e = new
|
|
3598
|
-
|
|
3607
|
+
ie(qt, "IDENTITY", new qt());
|
|
3608
|
+
let xn = qt;
|
|
3609
|
+
const _n = class re {
|
|
3610
|
+
constructor(e = new xn(), t = new xn(), r = null) {
|
|
3611
|
+
ie(this, "x"), ie(this, "y"), ie(this, "currRoot"), this.x = e, this.y = t, this.currRoot = r;
|
|
3599
3612
|
}
|
|
3600
3613
|
static translate(e, t) {
|
|
3601
|
-
return new
|
|
3614
|
+
return new re().translate(e, t);
|
|
3602
3615
|
}
|
|
3603
3616
|
static translateX(e) {
|
|
3604
|
-
return new
|
|
3617
|
+
return new re().translateX(e);
|
|
3605
3618
|
}
|
|
3606
3619
|
static translateY(e) {
|
|
3607
|
-
return new
|
|
3620
|
+
return new re().translateY(e);
|
|
3608
3621
|
}
|
|
3609
3622
|
static clamp(e) {
|
|
3610
|
-
return new
|
|
3623
|
+
return new re().clamp(e);
|
|
3611
3624
|
}
|
|
3612
3625
|
static magnify(e) {
|
|
3613
|
-
return new
|
|
3626
|
+
return new re().magnify(e);
|
|
3614
3627
|
}
|
|
3615
3628
|
static scale(e) {
|
|
3616
|
-
return new
|
|
3629
|
+
return new re().scale(e);
|
|
3617
3630
|
}
|
|
3618
3631
|
static reBound(e) {
|
|
3619
|
-
return new
|
|
3632
|
+
return new re().reBound(e);
|
|
3620
3633
|
}
|
|
3621
3634
|
translate(e, t) {
|
|
3622
3635
|
const r = C(e, t), s = this.copy();
|
|
@@ -3636,22 +3649,22 @@ const xn = class ne {
|
|
|
3636
3649
|
}
|
|
3637
3650
|
scale(e) {
|
|
3638
3651
|
const t = this.copy();
|
|
3639
|
-
if (
|
|
3652
|
+
if (cr(e)) {
|
|
3640
3653
|
const r = this.currRoot;
|
|
3641
|
-
return t.currRoot = e.root, r != null && !
|
|
3654
|
+
return t.currRoot = e.root, r != null && !Qn(r, e.root) && (r.x !== e.root.x && (t.x = t.x.invert()), r.y !== e.root.y && (t.y = t.y.invert())), t.x = t.x.scale(mt(e)), t.y = t.y.scale(yt(e)), t;
|
|
3642
3655
|
}
|
|
3643
3656
|
return t.x = t.x.scale(e.width), t.y = t.y.scale(e.height), t;
|
|
3644
3657
|
}
|
|
3645
3658
|
reBound(e) {
|
|
3646
3659
|
const t = this.copy();
|
|
3647
|
-
return t.x = this.x.reBound(
|
|
3660
|
+
return t.x = this.x.reBound(mt(e)), t.y = this.y.reBound(yt(e)), t;
|
|
3648
3661
|
}
|
|
3649
3662
|
clamp(e) {
|
|
3650
3663
|
const t = this.copy();
|
|
3651
|
-
return t.x = this.x.clamp(
|
|
3664
|
+
return t.x = this.x.clamp(mt(e)), t.y = this.y.clamp(yt(e)), t;
|
|
3652
3665
|
}
|
|
3653
3666
|
copy() {
|
|
3654
|
-
const e = new
|
|
3667
|
+
const e = new re();
|
|
3655
3668
|
return e.currRoot = this.currRoot, e.x = this.x, e.y = this.y, e;
|
|
3656
3669
|
}
|
|
3657
3670
|
reverse() {
|
|
@@ -3680,85 +3693,18 @@ const xn = class ne {
|
|
|
3680
3693
|
};
|
|
3681
3694
|
}
|
|
3682
3695
|
};
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
return r.map((s, i) => {
|
|
3687
|
-
const a = e(s, i, r);
|
|
3688
|
-
return a == null ? null : typeof a == "string" ? a : a.join(t);
|
|
3689
|
-
}).filter((s) => s != null).join(t);
|
|
3690
|
-
}, lr = (n, e, t = { optional: !1, separator: "." }) => {
|
|
3691
|
-
t.separator ?? (t.separator = ".");
|
|
3692
|
-
const { optional: r, getter: s = (o, c) => o[c] } = t, i = e.split(t.separator);
|
|
3693
|
-
if (i.length === 1 && i[0] === "") return n;
|
|
3694
|
-
let a = n;
|
|
3695
|
-
for (const o of i) {
|
|
3696
|
-
const c = s(a, o);
|
|
3697
|
-
if (c == null) {
|
|
3698
|
-
if (r) return null;
|
|
3699
|
-
throw new Error(`Path ${e} does not exist. ${o} is null`);
|
|
3700
|
-
}
|
|
3701
|
-
a = c;
|
|
3702
|
-
}
|
|
3703
|
-
return a;
|
|
3704
|
-
}, ia = (n, e, t) => {
|
|
3705
|
-
const r = e.split(".");
|
|
3706
|
-
let s = n;
|
|
3707
|
-
for (let i = 0; i < r.length - 1; i++) {
|
|
3708
|
-
const a = r[i];
|
|
3709
|
-
s[a] ?? (s[a] = {}), s = s[a];
|
|
3710
|
-
}
|
|
3711
|
-
try {
|
|
3712
|
-
s[r[r.length - 1]] = t;
|
|
3713
|
-
} catch (i) {
|
|
3714
|
-
throw console.error("failed to set value", t, "at path", e, "on object", n), i;
|
|
3715
|
-
}
|
|
3716
|
-
}, aa = (n, e) => {
|
|
3717
|
-
const t = e.split(".");
|
|
3718
|
-
let r = n;
|
|
3719
|
-
for (let s = 0; s < t.length - 1; s++) {
|
|
3720
|
-
const i = t[s];
|
|
3721
|
-
if (r[i] == null) return;
|
|
3722
|
-
r = r[i];
|
|
3723
|
-
}
|
|
3724
|
-
if (Array.isArray(r)) {
|
|
3725
|
-
const s = parseInt(t[t.length - 1]);
|
|
3726
|
-
if (isNaN(s)) return;
|
|
3727
|
-
r.splice(s, 1);
|
|
3728
|
-
return;
|
|
3729
|
-
}
|
|
3730
|
-
delete r[t[t.length - 1]];
|
|
3731
|
-
}, oa = (n, e) => {
|
|
3732
|
-
const t = n.split(".");
|
|
3733
|
-
return e < 0 ? t[t.length + e] : t[e];
|
|
3734
|
-
}, ua = (n, e) => {
|
|
3735
|
-
try {
|
|
3736
|
-
return lr(n, e), !0;
|
|
3737
|
-
} catch {
|
|
3738
|
-
return !1;
|
|
3739
|
-
}
|
|
3740
|
-
}, ca = (n, e) => {
|
|
3741
|
-
if (e.length === 0) return !0;
|
|
3742
|
-
const t = n.split("."), r = e.split(".");
|
|
3743
|
-
if (r.length > t.length) return !1;
|
|
3744
|
-
for (let s = 0; s < r.length; s++) {
|
|
3745
|
-
const i = t[s], a = r[s];
|
|
3746
|
-
if (a !== "*" && i !== a)
|
|
3747
|
-
return !1;
|
|
3748
|
-
}
|
|
3749
|
-
return !0;
|
|
3750
|
-
}, la = u.bigint().or(u.string().transform(BigInt));
|
|
3751
|
-
var da = Object.defineProperty, fa = (n, e, t) => e in n ? da(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, f = (n, e, t) => fa(n, typeof e != "symbol" ? e + "" : e, t);
|
|
3752
|
-
let ha = (n, e = 21) => (t = e) => {
|
|
3696
|
+
ie(_n, "IDENTITY", new _n());
|
|
3697
|
+
var aa = Object.defineProperty, oa = (n, e, t) => e in n ? aa(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, h = (n, e, t) => oa(n, typeof e != "symbol" ? e + "" : e, t);
|
|
3698
|
+
let ua = (n, e = 21) => (t = e) => {
|
|
3753
3699
|
let r = "", s = t | 0;
|
|
3754
3700
|
for (; s--; )
|
|
3755
3701
|
r += n[Math.random() * n.length | 0];
|
|
3756
3702
|
return r;
|
|
3757
3703
|
};
|
|
3758
|
-
const
|
|
3704
|
+
const ca = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", la = ua(ca, 11), dr = () => la(), Ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3759
3705
|
__proto__: null,
|
|
3760
|
-
|
|
3761
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3706
|
+
create: dr
|
|
3707
|
+
}, Symbol.toStringTag, { value: "Module" })), da = u.enum(["static", "dynamic"]), hr = (n, e) => {
|
|
3762
3708
|
const t = new E(e);
|
|
3763
3709
|
if (![
|
|
3764
3710
|
A.DAY,
|
|
@@ -3776,7 +3722,7 @@ const pa = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", dr
|
|
|
3776
3722
|
return n instanceof E ? new E(r) : new A(r);
|
|
3777
3723
|
}, I = class w {
|
|
3778
3724
|
constructor(e, t = "UTC") {
|
|
3779
|
-
if (
|
|
3725
|
+
if (h(this, "value"), h(this, "encodeValue", !0), e == null) this.value = w.now().valueOf();
|
|
3780
3726
|
else if (e instanceof Date)
|
|
3781
3727
|
this.value = BigInt(e.getTime()) * w.MILLISECOND.valueOf();
|
|
3782
3728
|
else if (typeof e == "string")
|
|
@@ -4072,7 +4018,7 @@ const pa = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", dr
|
|
|
4072
4018
|
* @example TimeStamp.now().remainder(TimeStamp.DAY) // => TimeStamp representing the current day
|
|
4073
4019
|
*/
|
|
4074
4020
|
remainder(e) {
|
|
4075
|
-
return
|
|
4021
|
+
return hr(this, e);
|
|
4076
4022
|
}
|
|
4077
4023
|
/** @returns true if the day portion TimeStamp is today, false otherwise. */
|
|
4078
4024
|
get isToday() {
|
|
@@ -4134,17 +4080,17 @@ const pa = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", dr
|
|
|
4134
4080
|
return w.hours(e * 24);
|
|
4135
4081
|
}
|
|
4136
4082
|
};
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4083
|
+
h(I, "NANOSECOND", I.nanoseconds(1)), /** One microsecond after the unix epoch */
|
|
4084
|
+
h(I, "MICROSECOND", I.microseconds(1)), /** One millisecond after the unix epoch */
|
|
4085
|
+
h(I, "MILLISECOND", I.milliseconds(1)), /** One second after the unix epoch */
|
|
4086
|
+
h(I, "SECOND", I.seconds(1)), /** One minute after the unix epoch */
|
|
4087
|
+
h(I, "MINUTE", I.minutes(1)), /** One hour after the unix epoch */
|
|
4088
|
+
h(I, "HOUR", I.hours(1)), /** One day after the unix epoch */
|
|
4089
|
+
h(I, "DAY", I.days(1)), /** The maximum possible value for a timestamp */
|
|
4090
|
+
h(I, "MAX", new I((1n << 63n) - 1n)), /** The minimum possible value for a timestamp */
|
|
4091
|
+
h(I, "MIN", new I(0)), /** The unix epoch */
|
|
4092
|
+
h(I, "ZERO", new I(0)), /** A zod schema for validating timestamps */
|
|
4093
|
+
h(I, "z", u.union([
|
|
4148
4094
|
u.object({ value: u.bigint() }).transform((n) => new I(n.value)),
|
|
4149
4095
|
u.string().transform((n) => new I(BigInt(n))),
|
|
4150
4096
|
u.instanceof(Number).transform((n) => new I(n)),
|
|
@@ -4154,13 +4100,13 @@ f(I, "z", u.union([
|
|
|
4154
4100
|
let E = I;
|
|
4155
4101
|
const k = class T {
|
|
4156
4102
|
constructor(e) {
|
|
4157
|
-
|
|
4103
|
+
h(this, "value"), h(this, "encodeValue", !0), typeof e == "number" && (e = Math.trunc(e.valueOf())), this.value = BigInt(e.valueOf());
|
|
4158
4104
|
}
|
|
4159
4105
|
static fromSeconds(e) {
|
|
4160
|
-
return e instanceof T ? e : e instanceof
|
|
4106
|
+
return e instanceof T ? e : e instanceof Tn ? e.period : e instanceof E ? new T(e) : ["number", "bigint"].includes(typeof e) ? T.seconds(e) : new T(e);
|
|
4161
4107
|
}
|
|
4162
4108
|
static fromMilliseconds(e) {
|
|
4163
|
-
return e instanceof T ? e : e instanceof
|
|
4109
|
+
return e instanceof T ? e : e instanceof Tn ? e.period : e instanceof E ? new T(e) : ["number", "bigint"].includes(typeof e) ? T.milliseconds(e) : new T(e);
|
|
4164
4110
|
}
|
|
4165
4111
|
encode() {
|
|
4166
4112
|
return this.value.toString();
|
|
@@ -4181,7 +4127,7 @@ const k = class T {
|
|
|
4181
4127
|
return this.valueOf() >= new T(e).valueOf();
|
|
4182
4128
|
}
|
|
4183
4129
|
remainder(e) {
|
|
4184
|
-
return
|
|
4130
|
+
return hr(this, e);
|
|
4185
4131
|
}
|
|
4186
4132
|
truncate(e) {
|
|
4187
4133
|
return new T(
|
|
@@ -4189,9 +4135,9 @@ const k = class T {
|
|
|
4189
4135
|
);
|
|
4190
4136
|
}
|
|
4191
4137
|
toString() {
|
|
4192
|
-
const e = this.truncate(T.DAY), t = this.truncate(T.HOUR), r = this.truncate(T.MINUTE), s = this.truncate(T.SECOND), i = this.truncate(T.MILLISECOND), a = this.truncate(T.MICROSECOND), o = this.truncate(T.NANOSECOND), c = e, l = t.sub(e),
|
|
4193
|
-
let
|
|
4194
|
-
return c.isZero || (
|
|
4138
|
+
const e = this.truncate(T.DAY), t = this.truncate(T.HOUR), r = this.truncate(T.MINUTE), s = this.truncate(T.SECOND), i = this.truncate(T.MILLISECOND), a = this.truncate(T.MICROSECOND), o = this.truncate(T.NANOSECOND), c = e, l = t.sub(e), p = r.sub(t), y = s.sub(r), j = i.sub(s), U = a.sub(i), Me = o.sub(a);
|
|
4139
|
+
let oe = "";
|
|
4140
|
+
return c.isZero || (oe += `${c.days}d `), l.isZero || (oe += `${l.hours}h `), p.isZero || (oe += `${p.minutes}m `), y.isZero || (oe += `${y.seconds}s `), j.isZero || (oe += `${j.milliseconds}ms `), U.isZero || (oe += `${U.microseconds}µs `), Me.isZero || (oe += `${Me.nanoseconds}ns`), oe.trim();
|
|
4195
4141
|
}
|
|
4196
4142
|
mult(e) {
|
|
4197
4143
|
return new T(this.valueOf() * BigInt(e));
|
|
@@ -4270,7 +4216,7 @@ const k = class T {
|
|
|
4270
4216
|
* @returns A TimeSpan representing the given number of microseconds.
|
|
4271
4217
|
*/
|
|
4272
4218
|
static microseconds(e = 1) {
|
|
4273
|
-
return T.nanoseconds(
|
|
4219
|
+
return T.nanoseconds(Ne(e, 1e3));
|
|
4274
4220
|
}
|
|
4275
4221
|
/**
|
|
4276
4222
|
* Creates a TimeSpan representing the given number of milliseconds.
|
|
@@ -4279,7 +4225,7 @@ const k = class T {
|
|
|
4279
4225
|
* @returns A TimeSpan representing the given number of milliseconds.
|
|
4280
4226
|
*/
|
|
4281
4227
|
static milliseconds(e = 1) {
|
|
4282
|
-
return T.microseconds(
|
|
4228
|
+
return T.microseconds(Ne(e, 1e3));
|
|
4283
4229
|
}
|
|
4284
4230
|
/**
|
|
4285
4231
|
* Creates a TimeSpan representing the given number of seconds.
|
|
@@ -4288,7 +4234,7 @@ const k = class T {
|
|
|
4288
4234
|
* @returns A TimeSpan representing the given number of seconds.
|
|
4289
4235
|
*/
|
|
4290
4236
|
static seconds(e = 1) {
|
|
4291
|
-
return T.milliseconds(
|
|
4237
|
+
return T.milliseconds(Ne(e, 1e3));
|
|
4292
4238
|
}
|
|
4293
4239
|
/**
|
|
4294
4240
|
* Creates a TimeSpan representing the given number of minutes.
|
|
@@ -4297,7 +4243,7 @@ const k = class T {
|
|
|
4297
4243
|
* @returns A TimeSpan representing the given number of minutes.
|
|
4298
4244
|
*/
|
|
4299
4245
|
static minutes(e = 1) {
|
|
4300
|
-
return T.seconds(
|
|
4246
|
+
return T.seconds(Ne(e, 60));
|
|
4301
4247
|
}
|
|
4302
4248
|
/**
|
|
4303
4249
|
* Creates a TimeSpan representing the given number of hours.
|
|
@@ -4306,7 +4252,7 @@ const k = class T {
|
|
|
4306
4252
|
* @returns A TimeSpan representing the given number of hours.
|
|
4307
4253
|
*/
|
|
4308
4254
|
static hours(e) {
|
|
4309
|
-
return T.minutes(
|
|
4255
|
+
return T.minutes(Ne(e, 60));
|
|
4310
4256
|
}
|
|
4311
4257
|
/**
|
|
4312
4258
|
* Creates a TimeSpan representing the given number of days.
|
|
@@ -4315,20 +4261,20 @@ const k = class T {
|
|
|
4315
4261
|
* @returns A TimeSpan representing the given number of days.
|
|
4316
4262
|
*/
|
|
4317
4263
|
static days(e) {
|
|
4318
|
-
return T.hours(
|
|
4264
|
+
return T.hours(Ne(e, 24));
|
|
4319
4265
|
}
|
|
4320
4266
|
};
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4267
|
+
h(k, "NANOSECOND", k.nanoseconds(1)), /** A microsecond. */
|
|
4268
|
+
h(k, "MICROSECOND", k.microseconds(1)), /** A millisecond. */
|
|
4269
|
+
h(k, "MILLISECOND", k.milliseconds(1)), /** A second. */
|
|
4270
|
+
h(k, "SECOND", k.seconds(1)), /** A minute. */
|
|
4271
|
+
h(k, "MINUTE", k.minutes(1)), /** Represents an hour. */
|
|
4272
|
+
h(k, "HOUR", k.hours(1)), /** Represents a day. */
|
|
4273
|
+
h(k, "DAY", k.days(1)), /** The maximum possible value for a TimeSpan. */
|
|
4274
|
+
h(k, "MAX", new k((1n << 63n) - 1n)), /** The minimum possible value for a TimeSpan. */
|
|
4275
|
+
h(k, "MIN", new k(0)), /** The zero value for a TimeSpan. */
|
|
4276
|
+
h(k, "ZERO", new k(0)), /** A zod schema for validating and transforming timespans */
|
|
4277
|
+
h(k, "z", u.union([
|
|
4332
4278
|
u.object({ value: u.bigint() }).transform((n) => new k(n.value)),
|
|
4333
4279
|
u.string().transform((n) => new k(BigInt(n))),
|
|
4334
4280
|
u.instanceof(Number).transform((n) => new k(n)),
|
|
@@ -4336,7 +4282,7 @@ f(k, "z", u.union([
|
|
|
4336
4282
|
u.instanceof(k)
|
|
4337
4283
|
]));
|
|
4338
4284
|
let A = k;
|
|
4339
|
-
const Le = class
|
|
4285
|
+
const Le = class gt extends Number {
|
|
4340
4286
|
constructor(e) {
|
|
4341
4287
|
e instanceof Number ? super(e.valueOf()) : super(e);
|
|
4342
4288
|
}
|
|
@@ -4346,7 +4292,7 @@ const Le = class yt extends Number {
|
|
|
4346
4292
|
}
|
|
4347
4293
|
/** @returns The number of seconds in the Rate. */
|
|
4348
4294
|
equals(e) {
|
|
4349
|
-
return this.valueOf() === new
|
|
4295
|
+
return this.valueOf() === new gt(e).valueOf();
|
|
4350
4296
|
}
|
|
4351
4297
|
/**
|
|
4352
4298
|
* Calculates the period of the Rate as a TimeSpan.
|
|
@@ -4373,7 +4319,7 @@ const Le = class yt extends Number {
|
|
|
4373
4319
|
* @returns The number of bytes in the given TimeSpan at this rate.
|
|
4374
4320
|
*/
|
|
4375
4321
|
byteCount(e, t) {
|
|
4376
|
-
return this.sampleCount(e) * new
|
|
4322
|
+
return this.sampleCount(e) * new P(t).valueOf();
|
|
4377
4323
|
}
|
|
4378
4324
|
/**
|
|
4379
4325
|
* Calculates a TimeSpan given the number of samples at this rate.
|
|
@@ -4401,7 +4347,7 @@ const Le = class yt extends Number {
|
|
|
4401
4347
|
* @returns A Rate representing the given number of Hz.
|
|
4402
4348
|
*/
|
|
4403
4349
|
static hz(e) {
|
|
4404
|
-
return new
|
|
4350
|
+
return new gt(e);
|
|
4405
4351
|
}
|
|
4406
4352
|
/**
|
|
4407
4353
|
* Creates a Rate representing the given number of kHz.
|
|
@@ -4410,16 +4356,16 @@ const Le = class yt extends Number {
|
|
|
4410
4356
|
* @returns A Rate representing the given number of kHz.
|
|
4411
4357
|
*/
|
|
4412
4358
|
static khz(e) {
|
|
4413
|
-
return
|
|
4359
|
+
return gt.hz(e * 1e3);
|
|
4414
4360
|
}
|
|
4415
4361
|
};
|
|
4416
|
-
|
|
4362
|
+
h(Le, "z", u.union([
|
|
4417
4363
|
u.number().transform((n) => new Le(n)),
|
|
4418
4364
|
u.instanceof(Number).transform((n) => new Le(n)),
|
|
4419
4365
|
u.instanceof(Le)
|
|
4420
4366
|
]));
|
|
4421
|
-
let
|
|
4422
|
-
const
|
|
4367
|
+
let Tn = Le;
|
|
4368
|
+
const B = class extends Number {
|
|
4423
4369
|
/**
|
|
4424
4370
|
* Creates a Density representing the given number of bytes per value.
|
|
4425
4371
|
*
|
|
@@ -4437,19 +4383,19 @@ const Z = class extends Number {
|
|
|
4437
4383
|
return new Yt(e * this.valueOf());
|
|
4438
4384
|
}
|
|
4439
4385
|
};
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
u.number().transform((n) => new
|
|
4448
|
-
u.instanceof(Number).transform((n) => new
|
|
4449
|
-
u.instanceof(
|
|
4386
|
+
h(B, "UNKNOWN", new B(0)), /** 128 bits per value. */
|
|
4387
|
+
h(B, "BIT128", new B(16)), /** 64 bits per value. */
|
|
4388
|
+
h(B, "BIT64", new B(8)), /** 32 bits per value. */
|
|
4389
|
+
h(B, "BIT32", new B(4)), /** 16 bits per value. */
|
|
4390
|
+
h(B, "BIT16", new B(2)), /** 8 bits per value. */
|
|
4391
|
+
h(B, "BIT8", new B(1)), /** A zod schema for validating and transforming densities */
|
|
4392
|
+
h(B, "z", u.union([
|
|
4393
|
+
u.number().transform((n) => new B(n)),
|
|
4394
|
+
u.instanceof(Number).transform((n) => new B(n)),
|
|
4395
|
+
u.instanceof(B)
|
|
4450
4396
|
]));
|
|
4451
|
-
let
|
|
4452
|
-
const J = class
|
|
4397
|
+
let P = B;
|
|
4398
|
+
const J = class vt {
|
|
4453
4399
|
/**
|
|
4454
4400
|
* Creates a TimeRange from the given start and end TimeStamps.
|
|
4455
4401
|
*
|
|
@@ -4457,7 +4403,7 @@ const J = class gt {
|
|
|
4457
4403
|
* @param end - A TimeStamp representing the end of the range.
|
|
4458
4404
|
*/
|
|
4459
4405
|
constructor(e, t) {
|
|
4460
|
-
|
|
4406
|
+
h(this, "start"), h(this, "end"), typeof e == "object" && "start" in e ? (this.start = new E(e.start), this.end = new E(e.end)) : (this.start = new E(e), this.end = new E(t));
|
|
4461
4407
|
}
|
|
4462
4408
|
/** @returns The TimeSpan occupied by the TimeRange. */
|
|
4463
4409
|
get span() {
|
|
@@ -4499,7 +4445,7 @@ const J = class gt {
|
|
|
4499
4445
|
* @returns A TimeRange with the start and end swapped.
|
|
4500
4446
|
*/
|
|
4501
4447
|
swap() {
|
|
4502
|
-
return new
|
|
4448
|
+
return new vt(this.end, this.start);
|
|
4503
4449
|
}
|
|
4504
4450
|
/**
|
|
4505
4451
|
* Checks if the TimeRange is equal to the given TimeRange.
|
|
@@ -4537,17 +4483,17 @@ const J = class gt {
|
|
|
4537
4483
|
return r < 0 && (r = -r), s < 0 && (s = -s), r <= t.valueOf() && s <= t.valueOf();
|
|
4538
4484
|
}
|
|
4539
4485
|
contains(e) {
|
|
4540
|
-
return e instanceof
|
|
4486
|
+
return e instanceof vt ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
|
|
4541
4487
|
}
|
|
4542
4488
|
boundBy(e) {
|
|
4543
|
-
const t = new
|
|
4489
|
+
const t = new vt(this.start, this.end);
|
|
4544
4490
|
return e.start.after(this.start) && (t.start = e.start), e.start.after(this.end) && (t.end = e.start), e.end.before(this.end) && (t.end = e.end), e.end.before(this.start) && (t.start = e.end), t;
|
|
4545
4491
|
}
|
|
4546
4492
|
};
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4493
|
+
h(J, "MAX", new J(E.MIN, E.MAX)), /** The minimum possible time range. */
|
|
4494
|
+
h(J, "MIN", new J(E.MAX, E.MIN)), /** A zero time range. */
|
|
4495
|
+
h(J, "ZERO", new J(E.ZERO, E.ZERO)), /** A zod schema for validating and transforming time ranges */
|
|
4496
|
+
h(J, "z", u.union([
|
|
4551
4497
|
u.object({ start: E.z, end: E.z }).transform((n) => new J(n.start, n.end)),
|
|
4552
4498
|
u.instanceof(J)
|
|
4553
4499
|
]));
|
|
@@ -4638,24 +4584,24 @@ const d = class M extends String {
|
|
|
4638
4584
|
return M.BIG_INT_TYPES.some((e) => e.equals(this));
|
|
4639
4585
|
}
|
|
4640
4586
|
};
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4587
|
+
h(d, "UNKNOWN", new d("unknown")), /** Represents a 64-bit floating point value. */
|
|
4588
|
+
h(d, "FLOAT64", new d("float64")), /** Represents a 32-bit floating point value. */
|
|
4589
|
+
h(d, "FLOAT32", new d("float32")), /** Represents a 64-bit signed integer value. */
|
|
4590
|
+
h(d, "INT64", new d("int64")), /** Represents a 32-bit signed integer value. */
|
|
4591
|
+
h(d, "INT32", new d("int32")), /** Represents a 16-bit signed integer value. */
|
|
4592
|
+
h(d, "INT16", new d("int16")), /** Represents a 8-bit signed integer value. */
|
|
4593
|
+
h(d, "INT8", new d("int8")), /** Represents a 64-bit unsigned integer value. */
|
|
4594
|
+
h(d, "UINT64", new d("uint64")), /** Represents a 32-bit unsigned integer value. */
|
|
4595
|
+
h(d, "UINT32", new d("uint32")), /** Represents a 16-bit unsigned integer value. */
|
|
4596
|
+
h(d, "UINT16", new d("uint16")), /** Represents a 8-bit unsigned integer value. */
|
|
4597
|
+
h(d, "UINT8", new d("uint8")), /** Represents a boolean value. Alias for UINT8. */
|
|
4598
|
+
h(d, "BOOLEAN", d.UINT8), /** Represents a 64-bit unix epoch. */
|
|
4599
|
+
h(d, "TIMESTAMP", new d("timestamp")), /** Represents a UUID data type */
|
|
4600
|
+
h(d, "UUID", new d("uuid")), /** Represents a string data type. Strings have an unknown density, and are separate
|
|
4655
4601
|
* by a newline character. */
|
|
4656
|
-
|
|
4602
|
+
h(d, "STRING", new d("string")), /** Represents a JSON data type. JSON has an unknown density, and is separated by a
|
|
4657
4603
|
* newline character. */
|
|
4658
|
-
|
|
4604
|
+
h(d, "JSON", new d("json")), h(d, "ARRAY_CONSTRUCTORS", /* @__PURE__ */ new Map([
|
|
4659
4605
|
[d.UINT8.toString(), Uint8Array],
|
|
4660
4606
|
[d.UINT16.toString(), Uint16Array],
|
|
4661
4607
|
[d.UINT32.toString(), Uint32Array],
|
|
@@ -4670,7 +4616,7 @@ f(d, "JSON", new d("json")), f(d, "ARRAY_CONSTRUCTORS", /* @__PURE__ */ new Map(
|
|
|
4670
4616
|
[d.STRING.toString(), Uint8Array],
|
|
4671
4617
|
[d.JSON.toString(), Uint8Array],
|
|
4672
4618
|
[d.UUID.toString(), Uint8Array]
|
|
4673
|
-
])),
|
|
4619
|
+
])), h(d, "ARRAY_CONSTRUCTOR_DATA_TYPES", /* @__PURE__ */ new Map([
|
|
4674
4620
|
[Uint8Array.name, d.UINT8],
|
|
4675
4621
|
[Uint16Array.name, d.UINT16],
|
|
4676
4622
|
[Uint32Array.name, d.UINT32],
|
|
@@ -4681,23 +4627,23 @@ f(d, "JSON", new d("json")), f(d, "ARRAY_CONSTRUCTORS", /* @__PURE__ */ new Map(
|
|
|
4681
4627
|
[Int16Array.name, d.INT16],
|
|
4682
4628
|
[Int32Array.name, d.INT32],
|
|
4683
4629
|
[BigInt64Array.name, d.INT64]
|
|
4684
|
-
])),
|
|
4685
|
-
[d.UINT8.toString(),
|
|
4686
|
-
[d.UINT16.toString(),
|
|
4687
|
-
[d.UINT32.toString(),
|
|
4688
|
-
[d.UINT64.toString(),
|
|
4689
|
-
[d.FLOAT32.toString(),
|
|
4690
|
-
[d.FLOAT64.toString(),
|
|
4691
|
-
[d.INT8.toString(),
|
|
4692
|
-
[d.INT16.toString(),
|
|
4693
|
-
[d.INT32.toString(),
|
|
4694
|
-
[d.INT64.toString(),
|
|
4695
|
-
[d.TIMESTAMP.toString(),
|
|
4696
|
-
[d.STRING.toString(),
|
|
4697
|
-
[d.JSON.toString(),
|
|
4698
|
-
[d.UUID.toString(),
|
|
4630
|
+
])), h(d, "DENSITIES", /* @__PURE__ */ new Map([
|
|
4631
|
+
[d.UINT8.toString(), P.BIT8],
|
|
4632
|
+
[d.UINT16.toString(), P.BIT16],
|
|
4633
|
+
[d.UINT32.toString(), P.BIT32],
|
|
4634
|
+
[d.UINT64.toString(), P.BIT64],
|
|
4635
|
+
[d.FLOAT32.toString(), P.BIT32],
|
|
4636
|
+
[d.FLOAT64.toString(), P.BIT64],
|
|
4637
|
+
[d.INT8.toString(), P.BIT8],
|
|
4638
|
+
[d.INT16.toString(), P.BIT16],
|
|
4639
|
+
[d.INT32.toString(), P.BIT32],
|
|
4640
|
+
[d.INT64.toString(), P.BIT64],
|
|
4641
|
+
[d.TIMESTAMP.toString(), P.BIT64],
|
|
4642
|
+
[d.STRING.toString(), P.UNKNOWN],
|
|
4643
|
+
[d.JSON.toString(), P.UNKNOWN],
|
|
4644
|
+
[d.UUID.toString(), P.BIT128]
|
|
4699
4645
|
])), /** All the data types. */
|
|
4700
|
-
|
|
4646
|
+
h(d, "ALL", [
|
|
4701
4647
|
d.UNKNOWN,
|
|
4702
4648
|
d.FLOAT64,
|
|
4703
4649
|
d.FLOAT32,
|
|
@@ -4713,13 +4659,13 @@ f(d, "ALL", [
|
|
|
4713
4659
|
d.UUID,
|
|
4714
4660
|
d.STRING,
|
|
4715
4661
|
d.JSON
|
|
4716
|
-
]),
|
|
4717
|
-
|
|
4662
|
+
]), h(d, "BIG_INT_TYPES", [d.INT64, d.UINT64, d.TIMESTAMP]), /** A zod schema for a DataType. */
|
|
4663
|
+
h(d, "z", u.union([
|
|
4718
4664
|
u.string().transform((n) => new d(n)),
|
|
4719
4665
|
u.instanceof(d)
|
|
4720
4666
|
]));
|
|
4721
4667
|
let N = d;
|
|
4722
|
-
const
|
|
4668
|
+
const D = class Z extends Number {
|
|
4723
4669
|
constructor(e) {
|
|
4724
4670
|
super(e.valueOf());
|
|
4725
4671
|
}
|
|
@@ -4732,33 +4678,33 @@ const B = class j extends Number {
|
|
|
4732
4678
|
return this.valueOf() < e.valueOf();
|
|
4733
4679
|
}
|
|
4734
4680
|
add(e) {
|
|
4735
|
-
return
|
|
4681
|
+
return Z.bytes(this.valueOf() + e.valueOf());
|
|
4736
4682
|
}
|
|
4737
4683
|
sub(e) {
|
|
4738
|
-
return
|
|
4684
|
+
return Z.bytes(this.valueOf() - e.valueOf());
|
|
4739
4685
|
}
|
|
4740
4686
|
truncate(e) {
|
|
4741
|
-
return new
|
|
4687
|
+
return new Z(Math.trunc(this.valueOf() / e.valueOf()) * e.valueOf());
|
|
4742
4688
|
}
|
|
4743
4689
|
remainder(e) {
|
|
4744
|
-
return
|
|
4690
|
+
return Z.bytes(this.valueOf() % e.valueOf());
|
|
4745
4691
|
}
|
|
4746
4692
|
get gigabytes() {
|
|
4747
|
-
return this.valueOf() /
|
|
4693
|
+
return this.valueOf() / Z.GIGABYTE.valueOf();
|
|
4748
4694
|
}
|
|
4749
4695
|
get megabytes() {
|
|
4750
|
-
return this.valueOf() /
|
|
4696
|
+
return this.valueOf() / Z.MEGABYTE.valueOf();
|
|
4751
4697
|
}
|
|
4752
4698
|
get kilobytes() {
|
|
4753
|
-
return this.valueOf() /
|
|
4699
|
+
return this.valueOf() / Z.KILOBYTE.valueOf();
|
|
4754
4700
|
}
|
|
4755
4701
|
get terabytes() {
|
|
4756
|
-
return this.valueOf() /
|
|
4702
|
+
return this.valueOf() / Z.TERABYTE.valueOf();
|
|
4757
4703
|
}
|
|
4758
4704
|
toString() {
|
|
4759
|
-
const e = this.truncate(
|
|
4760
|
-
let
|
|
4761
|
-
return a.isZero || (
|
|
4705
|
+
const e = this.truncate(Z.TERABYTE), t = this.truncate(Z.GIGABYTE), r = this.truncate(Z.MEGABYTE), s = this.truncate(Z.KILOBYTE), i = this.truncate(Z.BYTE), a = e, o = t.sub(e), c = r.sub(t), l = s.sub(r), p = i.sub(s);
|
|
4706
|
+
let y = "";
|
|
4707
|
+
return a.isZero || (y += `${a.terabytes}TB `), o.isZero || (y += `${o.gigabytes}GB `), c.isZero || (y += `${c.megabytes}MB `), l.isZero || (y += `${l.kilobytes}KB `), (!p.isZero || y === "") && (y += `${p.valueOf()}B`), y.trim();
|
|
4762
4708
|
}
|
|
4763
4709
|
/**
|
|
4764
4710
|
* Creates a Size from the given number of bytes.
|
|
@@ -4767,7 +4713,7 @@ const B = class j extends Number {
|
|
|
4767
4713
|
* @returns A Size representing the given number of bytes.
|
|
4768
4714
|
*/
|
|
4769
4715
|
static bytes(e = 1) {
|
|
4770
|
-
return new
|
|
4716
|
+
return new Z(e);
|
|
4771
4717
|
}
|
|
4772
4718
|
/**
|
|
4773
4719
|
* Creates a Size from the given number if kilobytes.
|
|
@@ -4776,7 +4722,7 @@ const B = class j extends Number {
|
|
|
4776
4722
|
* @returns A Size representing the given number of kilobytes.
|
|
4777
4723
|
*/
|
|
4778
4724
|
static kilobytes(e = 1) {
|
|
4779
|
-
return
|
|
4725
|
+
return Z.bytes(e.valueOf() * 1e3);
|
|
4780
4726
|
}
|
|
4781
4727
|
/**
|
|
4782
4728
|
* Creates a Size from the given number of megabytes.
|
|
@@ -4785,7 +4731,7 @@ const B = class j extends Number {
|
|
|
4785
4731
|
* @returns A Size representing the given number of megabytes.
|
|
4786
4732
|
*/
|
|
4787
4733
|
static megabytes(e = 1) {
|
|
4788
|
-
return
|
|
4734
|
+
return Z.kilobytes(e.valueOf() * 1e3);
|
|
4789
4735
|
}
|
|
4790
4736
|
/**
|
|
4791
4737
|
* Creates a Size from the given number of gigabytes.
|
|
@@ -4794,7 +4740,7 @@ const B = class j extends Number {
|
|
|
4794
4740
|
* @returns A Size representing the given number of gigabytes.
|
|
4795
4741
|
*/
|
|
4796
4742
|
static gigabytes(e = 1) {
|
|
4797
|
-
return
|
|
4743
|
+
return Z.megabytes(e.valueOf() * 1e3);
|
|
4798
4744
|
}
|
|
4799
4745
|
/**
|
|
4800
4746
|
* Creates a Size from the given number of terabytes.
|
|
@@ -4803,23 +4749,23 @@ const B = class j extends Number {
|
|
|
4803
4749
|
* @returns A Size representing the given number of terabytes.
|
|
4804
4750
|
*/
|
|
4805
4751
|
static terabytes(e) {
|
|
4806
|
-
return
|
|
4752
|
+
return Z.gigabytes(e.valueOf() * 1e3);
|
|
4807
4753
|
}
|
|
4808
4754
|
get isZero() {
|
|
4809
4755
|
return this.valueOf() === 0;
|
|
4810
4756
|
}
|
|
4811
4757
|
};
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
u.number().transform((n) => new
|
|
4820
|
-
u.instanceof(
|
|
4758
|
+
h(D, "BYTE", new D(1)), /** A kilobyte */
|
|
4759
|
+
h(D, "KILOBYTE", D.kilobytes(1)), /** A megabyte */
|
|
4760
|
+
h(D, "MEGABYTE", D.megabytes(1)), /** A gigabyte */
|
|
4761
|
+
h(D, "GIGABYTE", D.gigabytes(1)), /** A terabyte. */
|
|
4762
|
+
h(D, "TERABYTE", D.terabytes(1)), /** The zero value for Size */
|
|
4763
|
+
h(D, "ZERO", new D(0)), /** A zod schema for a Size. */
|
|
4764
|
+
h(D, "z", u.union([
|
|
4765
|
+
u.number().transform((n) => new D(n)),
|
|
4766
|
+
u.instanceof(D)
|
|
4821
4767
|
]));
|
|
4822
|
-
let Yt =
|
|
4768
|
+
let Yt = D;
|
|
4823
4769
|
u.union([
|
|
4824
4770
|
u.instanceof(Uint8Array),
|
|
4825
4771
|
u.instanceof(Uint16Array),
|
|
@@ -4832,16 +4778,16 @@ u.union([
|
|
|
4832
4778
|
u.instanceof(Int32Array),
|
|
4833
4779
|
u.instanceof(BigInt64Array)
|
|
4834
4780
|
]);
|
|
4835
|
-
const
|
|
4781
|
+
const fr = (n) => {
|
|
4836
4782
|
const e = typeof n;
|
|
4837
4783
|
return e === "string" || e === "number" || e === "boolean" || e === "bigint" || n instanceof E || n instanceof A || n instanceof Date;
|
|
4838
|
-
},
|
|
4784
|
+
}, ha = (n, e, t, r = 0) => n.usesBigInt && !e.usesBigInt ? Number(t) - Number(r) : !n.usesBigInt && e.usesBigInt ? BigInt(t.valueOf()) - BigInt(r.valueOf()) : Pe(t, -r).valueOf(), Pe = (n, e) => typeof n == "bigint" && typeof e == "bigint" || typeof n == "number" && typeof e == "number" ? n + e : e === 0 ? n : n === 0 ? e : Number(n) + Number(e), fa = (n) => n == null ? !1 : Array.isArray(n) || n instanceof ArrayBuffer || ArrayBuffer.isView(n) && !(n instanceof DataView) || n instanceof ya ? !0 : fr(n), ue = -1, pa = u.string().transform(
|
|
4839
4785
|
(n) => new Uint8Array(
|
|
4840
4786
|
atob(n).split("").map((e) => e.charCodeAt(0))
|
|
4841
4787
|
).buffer
|
|
4842
|
-
),
|
|
4788
|
+
), ma = u.union([u.null(), u.undefined()]).transform(() => new Uint8Array().buffer), Gt = 10, ze = class H {
|
|
4843
4789
|
constructor(e) {
|
|
4844
|
-
|
|
4790
|
+
h(this, "key", ""), h(this, "isSynnaxSeries", !0), h(this, "dataType"), h(this, "sampleOffset"), h(this, "gl"), h(this, "_data"), h(this, "_timeRange"), h(this, "alignment", 0n), h(this, "_cachedMin"), h(this, "_cachedMax"), h(this, "writePos", ue), h(this, "_refCount", 0), h(this, "_cachedLength"), h(this, "_cachedIndexes"), fa(e) && (e = { data: e });
|
|
4845
4791
|
const {
|
|
4846
4792
|
dataType: t,
|
|
4847
4793
|
timeRange: r,
|
|
@@ -4851,50 +4797,54 @@ const hr = (n) => {
|
|
|
4851
4797
|
key: o = dr()
|
|
4852
4798
|
} = e, c = e.data ?? [];
|
|
4853
4799
|
if (c instanceof H || typeof c == "object" && "isSynnaxSeries" in c && c.isSynnaxSeries === !0) {
|
|
4854
|
-
const
|
|
4855
|
-
this.key =
|
|
4800
|
+
const y = c;
|
|
4801
|
+
this.key = y.key, this.dataType = y.dataType, this.sampleOffset = y.sampleOffset, this.gl = y.gl, this._data = y._data, this._timeRange = y._timeRange, this.alignment = y.alignment, this._cachedMin = y._cachedMin, this._cachedMax = y._cachedMax, this.writePos = y.writePos, this._refCount = y._refCount, this._cachedLength = y._cachedLength;
|
|
4856
4802
|
return;
|
|
4857
4803
|
}
|
|
4858
|
-
const l =
|
|
4804
|
+
const l = fr(c), p = Array.isArray(c);
|
|
4859
4805
|
if (t != null) this.dataType = new N(t);
|
|
4860
4806
|
else {
|
|
4861
4807
|
if (c instanceof ArrayBuffer)
|
|
4862
4808
|
throw new Error(
|
|
4863
4809
|
"cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type."
|
|
4864
4810
|
);
|
|
4865
|
-
if (
|
|
4866
|
-
let
|
|
4811
|
+
if (p || l) {
|
|
4812
|
+
let y = c;
|
|
4867
4813
|
if (!l) {
|
|
4868
4814
|
if (c.length === 0)
|
|
4869
4815
|
throw new Error(
|
|
4870
4816
|
"cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type."
|
|
4871
4817
|
);
|
|
4872
|
-
|
|
4818
|
+
y = c[0];
|
|
4873
4819
|
}
|
|
4874
|
-
if (typeof
|
|
4875
|
-
else if (typeof
|
|
4876
|
-
else if (typeof
|
|
4877
|
-
else if (typeof
|
|
4878
|
-
else if (
|
|
4820
|
+
if (typeof y == "string") this.dataType = N.STRING;
|
|
4821
|
+
else if (typeof y == "number") this.dataType = N.FLOAT64;
|
|
4822
|
+
else if (typeof y == "bigint") this.dataType = N.INT64;
|
|
4823
|
+
else if (typeof y == "boolean") this.dataType = N.BOOLEAN;
|
|
4824
|
+
else if (y instanceof E || y instanceof Date || y instanceof E)
|
|
4879
4825
|
this.dataType = N.TIMESTAMP;
|
|
4880
|
-
else if (typeof
|
|
4826
|
+
else if (typeof y == "object") this.dataType = N.JSON;
|
|
4881
4827
|
else
|
|
4882
4828
|
throw new Error(
|
|
4883
|
-
`cannot infer data type of ${typeof
|
|
4829
|
+
`cannot infer data type of ${typeof y} when constructing a Series from a JS array`
|
|
4884
4830
|
);
|
|
4885
4831
|
} else this.dataType = new N(c);
|
|
4886
4832
|
}
|
|
4887
|
-
if (!
|
|
4833
|
+
if (!p && !l) this._data = c;
|
|
4888
4834
|
else {
|
|
4889
|
-
let
|
|
4890
|
-
const
|
|
4891
|
-
(
|
|
4835
|
+
let y = l ? [c] : c;
|
|
4836
|
+
const j = y[0];
|
|
4837
|
+
(j instanceof E || j instanceof Date || j instanceof A) && (y = y.map((U) => new E(U).valueOf())), this.dataType.equals(N.STRING) ? (this._cachedLength = y.length, this._data = new TextEncoder().encode(`${y.join(`
|
|
4892
4838
|
`)}
|
|
4893
|
-
`).buffer) : this.dataType.equals(N.JSON) ? (this._cachedLength =
|
|
4894
|
-
`${
|
|
4839
|
+
`).buffer) : this.dataType.equals(N.JSON) ? (this._cachedLength = y.length, this._data = new TextEncoder().encode(
|
|
4840
|
+
`${y.map((U) => pt.encodeString(U)).join(`
|
|
4895
4841
|
`)}
|
|
4896
4842
|
`
|
|
4897
|
-
).buffer) : this._data = new this.dataType.Array(
|
|
4843
|
+
).buffer) : this.dataType.usesBigInt && typeof j == "number" ? this._data = new this.dataType.Array(
|
|
4844
|
+
y.map((U) => BigInt(Math.round(U)))
|
|
4845
|
+
).buffer : !this.dataType.usesBigInt && typeof j == "bigint" ? this._data = new this.dataType.Array(
|
|
4846
|
+
y.map((U) => Number(U))
|
|
4847
|
+
).buffer : this._data = new this.dataType.Array(y).buffer;
|
|
4898
4848
|
}
|
|
4899
4849
|
this.key = o, this.alignment = a, this.sampleOffset = s ?? 0, this._timeRange = r, this.gl = {
|
|
4900
4850
|
control: null,
|
|
@@ -4913,7 +4863,7 @@ const hr = (n) => {
|
|
|
4913
4863
|
});
|
|
4914
4864
|
return i.writePos = 0, i;
|
|
4915
4865
|
}
|
|
4916
|
-
static
|
|
4866
|
+
static createTimestamps(e, t, r) {
|
|
4917
4867
|
const s = r.spanRange(t.span(e)), i = new BigInt64Array(e);
|
|
4918
4868
|
for (let a = 0; a < e; a++)
|
|
4919
4869
|
i[a] = BigInt(r.add(t.span(a)).valueOf());
|
|
@@ -4932,7 +4882,7 @@ const hr = (n) => {
|
|
|
4932
4882
|
}
|
|
4933
4883
|
static fromJSON(e, t) {
|
|
4934
4884
|
const r = new TextEncoder().encode(
|
|
4935
|
-
`${e.map((s) =>
|
|
4885
|
+
`${e.map((s) => pt.encodeString(s)).join(`
|
|
4936
4886
|
`)}
|
|
4937
4887
|
`
|
|
4938
4888
|
);
|
|
@@ -4961,12 +4911,12 @@ const hr = (n) => {
|
|
|
4961
4911
|
return this.dataType.isVariable ? this.writeVariable(e) : this.writeFixed(e);
|
|
4962
4912
|
}
|
|
4963
4913
|
writeVariable(e) {
|
|
4964
|
-
if (this.writePos ===
|
|
4914
|
+
if (this.writePos === ue) return 0;
|
|
4965
4915
|
const t = this.byteCapacity.valueOf() - this.writePos, r = e.subBytes(0, t);
|
|
4966
4916
|
return this.writeToUnderlyingData(r), this.writePos += r.byteLength.valueOf(), this._cachedLength != null && (this._cachedLength += r.length, this.calculateCachedLength()), r.length;
|
|
4967
4917
|
}
|
|
4968
4918
|
writeFixed(e) {
|
|
4969
|
-
if (this.writePos ===
|
|
4919
|
+
if (this.writePos === ue) return 0;
|
|
4970
4920
|
const t = this.capacity - this.writePos, r = e.sub(0, t);
|
|
4971
4921
|
return this.writeToUnderlyingData(r), this._cachedLength = void 0, this.maybeRecomputeMinMax(r), this.writePos += r.length, r.length;
|
|
4972
4922
|
}
|
|
@@ -4985,7 +4935,7 @@ const hr = (n) => {
|
|
|
4985
4935
|
}
|
|
4986
4936
|
/** @returns a native typed array with the proper data type. */
|
|
4987
4937
|
get data() {
|
|
4988
|
-
return this.writePos ===
|
|
4938
|
+
return this.writePos === ue ? this.underlyingData : new this.dataType.Array(this._data, 0, this.writePos);
|
|
4989
4939
|
}
|
|
4990
4940
|
toStrings() {
|
|
4991
4941
|
if (!this.dataType.matches(N.STRING, N.UUID))
|
|
@@ -5010,7 +4960,7 @@ const hr = (n) => {
|
|
|
5010
4960
|
if (!this.dataType.equals(N.JSON))
|
|
5011
4961
|
throw new Error("cannot parse non-JSON series as JSON");
|
|
5012
4962
|
return new TextDecoder().decode(this.underlyingData).split(`
|
|
5013
|
-
`).slice(0, -1).map((t) => e.parse(
|
|
4963
|
+
`).slice(0, -1).map((t) => e.parse(pt.decodeString(t)));
|
|
5014
4964
|
}
|
|
5015
4965
|
/** @returns the time range of this array. */
|
|
5016
4966
|
get timeRange() {
|
|
@@ -5027,11 +4977,11 @@ const hr = (n) => {
|
|
|
5027
4977
|
}
|
|
5028
4978
|
/** @returns the length of the series in bytes. */
|
|
5029
4979
|
get byteLength() {
|
|
5030
|
-
return this.writePos ===
|
|
4980
|
+
return this.writePos === ue ? this.byteCapacity : this.dataType.isVariable ? new Yt(this.writePos) : this.dataType.density.size(this.writePos);
|
|
5031
4981
|
}
|
|
5032
4982
|
/** @returns the number of samples in this array. */
|
|
5033
4983
|
get length() {
|
|
5034
|
-
return this._cachedLength != null ? this._cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos ===
|
|
4984
|
+
return this._cachedLength != null ? this._cachedLength : this.dataType.isVariable ? this.calculateCachedLength() : this.writePos === ue ? this.data.length : this.writePos;
|
|
5035
4985
|
}
|
|
5036
4986
|
calculateCachedLength() {
|
|
5037
4987
|
if (!this.dataType.isVariable)
|
|
@@ -5055,7 +5005,7 @@ const hr = (n) => {
|
|
|
5055
5005
|
if (this.dataType.equals(e)) return this;
|
|
5056
5006
|
const r = new e.Array(this.length);
|
|
5057
5007
|
for (let s = 0; s < this.length; s++)
|
|
5058
|
-
r[s] =
|
|
5008
|
+
r[s] = ha(this.dataType, e, this.data[s], t);
|
|
5059
5009
|
return new H({
|
|
5060
5010
|
data: r.buffer,
|
|
5061
5011
|
dataType: e,
|
|
@@ -5082,7 +5032,7 @@ const hr = (n) => {
|
|
|
5082
5032
|
get max() {
|
|
5083
5033
|
if (this.dataType.isVariable)
|
|
5084
5034
|
throw new Error("cannot calculate maximum on a variable length data type");
|
|
5085
|
-
return this.writePos === 0 ? -1 / 0 : (this._cachedMax ?? (this._cachedMax = this.calcRawMax()),
|
|
5035
|
+
return this.writePos === 0 ? -1 / 0 : (this._cachedMax ?? (this._cachedMax = this.calcRawMax()), Pe(this._cachedMax, this.sampleOffset));
|
|
5086
5036
|
}
|
|
5087
5037
|
calcRawMin() {
|
|
5088
5038
|
if (this.length === 0) return 1 / 0;
|
|
@@ -5100,11 +5050,11 @@ const hr = (n) => {
|
|
|
5100
5050
|
get min() {
|
|
5101
5051
|
if (this.dataType.isVariable)
|
|
5102
5052
|
throw new Error("cannot calculate minimum on a variable length data type");
|
|
5103
|
-
return this.writePos === 0 ? 1 / 0 : (this._cachedMin ?? (this._cachedMin = this.calcRawMin()),
|
|
5053
|
+
return this.writePos === 0 ? 1 / 0 : (this._cachedMin ?? (this._cachedMin = this.calcRawMin()), Pe(this._cachedMin, this.sampleOffset));
|
|
5104
5054
|
}
|
|
5105
5055
|
/** @returns the bounds of this array. */
|
|
5106
5056
|
get bounds() {
|
|
5107
|
-
return
|
|
5057
|
+
return we(Number(this.min), Number(this.max));
|
|
5108
5058
|
}
|
|
5109
5059
|
maybeRecomputeMinMax(e) {
|
|
5110
5060
|
if (this._cachedMin != null) {
|
|
@@ -5120,7 +5070,7 @@ const hr = (n) => {
|
|
|
5120
5070
|
this.max, this.min;
|
|
5121
5071
|
}
|
|
5122
5072
|
get range() {
|
|
5123
|
-
return
|
|
5073
|
+
return Pe(this.max, -this.min);
|
|
5124
5074
|
}
|
|
5125
5075
|
atAlignment(e, t) {
|
|
5126
5076
|
const r = Number(e - this.alignment);
|
|
@@ -5138,7 +5088,7 @@ const hr = (n) => {
|
|
|
5138
5088
|
if (t === !0) throw new Error(`[series] - no value at index ${e}`);
|
|
5139
5089
|
return;
|
|
5140
5090
|
}
|
|
5141
|
-
return
|
|
5091
|
+
return Pe(r, this.sampleOffset);
|
|
5142
5092
|
}
|
|
5143
5093
|
atVariable(e, t) {
|
|
5144
5094
|
let r = 0, s = 0;
|
|
@@ -5160,7 +5110,7 @@ const hr = (n) => {
|
|
|
5160
5110
|
}
|
|
5161
5111
|
}
|
|
5162
5112
|
const i = this.data.slice(r, s);
|
|
5163
|
-
return this.dataType.equals(N.STRING) ? new TextDecoder().decode(i) :
|
|
5113
|
+
return this.dataType.equals(N.STRING) ? new TextDecoder().decode(i) : Rn(JSON.parse(new TextDecoder().decode(i)));
|
|
5164
5114
|
}
|
|
5165
5115
|
/**
|
|
5166
5116
|
* @returns the index of the first sample that is greater than or equal to the given value.
|
|
@@ -5169,7 +5119,7 @@ const hr = (n) => {
|
|
|
5169
5119
|
*/
|
|
5170
5120
|
binarySearch(e) {
|
|
5171
5121
|
let t = 0, r = this.length - 1;
|
|
5172
|
-
const s =
|
|
5122
|
+
const s = Fs(e);
|
|
5173
5123
|
for (; t <= r; ) {
|
|
5174
5124
|
const i = Math.floor((t + r) / 2), a = s(this.at(i, !0), e);
|
|
5175
5125
|
if (a === 0) return i;
|
|
@@ -5182,7 +5132,7 @@ const hr = (n) => {
|
|
|
5182
5132
|
throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");
|
|
5183
5133
|
const { buffer: t, bufferUsage: r, prevBuffer: s } = this.gl;
|
|
5184
5134
|
if (t == null && (this.gl.buffer = e.createBuffer()), this.writePos !== s)
|
|
5185
|
-
if (e.bindBuffer(e.ARRAY_BUFFER, this.gl.buffer), this.writePos !==
|
|
5135
|
+
if (e.bindBuffer(e.ARRAY_BUFFER, this.gl.buffer), this.writePos !== ue) {
|
|
5186
5136
|
s === 0 && e.bufferData(e.ARRAY_BUFFER, this.byteCapacity.valueOf(), e.STATIC_DRAW);
|
|
5187
5137
|
const i = this.dataType.density.size(s).valueOf(), a = this.underlyingData.slice(this.gl.prevBuffer, this.writePos);
|
|
5188
5138
|
e.bufferSubData(e.ARRAY_BUFFER, i, a.buffer), this.gl.prevBuffer = this.writePos;
|
|
@@ -5191,7 +5141,7 @@ const hr = (n) => {
|
|
|
5191
5141
|
e.ARRAY_BUFFER,
|
|
5192
5142
|
this.buffer,
|
|
5193
5143
|
r === "static" ? e.STATIC_DRAW : e.DYNAMIC_DRAW
|
|
5194
|
-
), this.gl.prevBuffer =
|
|
5144
|
+
), this.gl.prevBuffer = ue;
|
|
5195
5145
|
}
|
|
5196
5146
|
as(e) {
|
|
5197
5147
|
if (e === "string") {
|
|
@@ -5224,8 +5174,8 @@ const hr = (n) => {
|
|
|
5224
5174
|
dataType: this.dataType.toString(),
|
|
5225
5175
|
sampleOffset: this.sampleOffset,
|
|
5226
5176
|
alignment: {
|
|
5227
|
-
lower:
|
|
5228
|
-
upper:
|
|
5177
|
+
lower: An(this.alignmentBounds.lower),
|
|
5178
|
+
upper: An(this.alignmentBounds.upper)
|
|
5229
5179
|
},
|
|
5230
5180
|
timeRange: (e = this._timeRange) == null ? void 0 : e.toString(),
|
|
5231
5181
|
length: this.length,
|
|
@@ -5241,7 +5191,7 @@ const hr = (n) => {
|
|
|
5241
5191
|
};
|
|
5242
5192
|
}
|
|
5243
5193
|
get alignmentBounds() {
|
|
5244
|
-
return
|
|
5194
|
+
return we(this.alignment, this.alignment + BigInt(this.length));
|
|
5245
5195
|
}
|
|
5246
5196
|
maybeGarbageCollectGLBuffer(e) {
|
|
5247
5197
|
this.gl.buffer != null && (e.deleteBuffer(this.gl.buffer), this.gl.buffer = null, this.gl.prevBuffer = 0, this.gl.control = null);
|
|
@@ -5252,10 +5202,10 @@ const hr = (n) => {
|
|
|
5252
5202
|
}
|
|
5253
5203
|
[Symbol.iterator]() {
|
|
5254
5204
|
if (this.dataType.isVariable) {
|
|
5255
|
-
const e = new
|
|
5256
|
-
return this.dataType.equals(N.JSON) ? new
|
|
5205
|
+
const e = new ga(this);
|
|
5206
|
+
return this.dataType.equals(N.JSON) ? new va(e) : e;
|
|
5257
5207
|
}
|
|
5258
|
-
return new
|
|
5208
|
+
return new wa(this);
|
|
5259
5209
|
}
|
|
5260
5210
|
slice(e, t) {
|
|
5261
5211
|
return this.sliceSub(!1, e, t);
|
|
@@ -5264,10 +5214,10 @@ const hr = (n) => {
|
|
|
5264
5214
|
return this.sliceSub(!0, e, t);
|
|
5265
5215
|
}
|
|
5266
5216
|
subIterator(e, t) {
|
|
5267
|
-
return new
|
|
5217
|
+
return new On(this, e, t ?? this.length);
|
|
5268
5218
|
}
|
|
5269
5219
|
subAlignmentIterator(e, t) {
|
|
5270
|
-
return new
|
|
5220
|
+
return new On(
|
|
5271
5221
|
this,
|
|
5272
5222
|
Number(e - this.alignment),
|
|
5273
5223
|
Number(t - this.alignment)
|
|
@@ -5308,24 +5258,24 @@ const hr = (n) => {
|
|
|
5308
5258
|
});
|
|
5309
5259
|
}
|
|
5310
5260
|
};
|
|
5311
|
-
|
|
5261
|
+
h(ze, "crudeZ", u.object({
|
|
5312
5262
|
timeRange: cn.z.optional(),
|
|
5313
5263
|
dataType: N.z,
|
|
5314
|
-
alignment:
|
|
5264
|
+
alignment: u.coerce.bigint().optional(),
|
|
5315
5265
|
data: u.union([
|
|
5316
|
-
|
|
5317
|
-
|
|
5266
|
+
pa,
|
|
5267
|
+
ma,
|
|
5318
5268
|
u.instanceof(ArrayBuffer),
|
|
5319
5269
|
u.instanceof(Uint8Array)
|
|
5320
5270
|
]),
|
|
5321
|
-
glBufferUsage:
|
|
5322
|
-
})),
|
|
5323
|
-
let
|
|
5324
|
-
class
|
|
5271
|
+
glBufferUsage: da.optional().default("static").optional()
|
|
5272
|
+
})), h(ze, "z", ze.crudeZ.transform((n) => new ze(n)));
|
|
5273
|
+
let ya = ze;
|
|
5274
|
+
class On {
|
|
5325
5275
|
constructor(e, t, r) {
|
|
5326
|
-
|
|
5327
|
-
const s =
|
|
5328
|
-
this.end =
|
|
5276
|
+
h(this, "series"), h(this, "end"), h(this, "index"), this.series = e;
|
|
5277
|
+
const s = we(0, e.length);
|
|
5278
|
+
this.end = bn(s, r), this.index = bn(s, t);
|
|
5329
5279
|
}
|
|
5330
5280
|
next() {
|
|
5331
5281
|
return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
|
|
@@ -5334,9 +5284,9 @@ class Tn {
|
|
|
5334
5284
|
return this;
|
|
5335
5285
|
}
|
|
5336
5286
|
}
|
|
5337
|
-
class
|
|
5287
|
+
class ga {
|
|
5338
5288
|
constructor(e) {
|
|
5339
|
-
if (
|
|
5289
|
+
if (h(this, "series"), h(this, "index"), h(this, "decoder"), !e.dataType.isVariable)
|
|
5340
5290
|
throw new Error(
|
|
5341
5291
|
"cannot create a variable series iterator for a non-variable series"
|
|
5342
5292
|
);
|
|
@@ -5352,26 +5302,26 @@ class xa {
|
|
|
5352
5302
|
return this;
|
|
5353
5303
|
}
|
|
5354
5304
|
}
|
|
5355
|
-
var
|
|
5356
|
-
class
|
|
5305
|
+
var Sn, Nn;
|
|
5306
|
+
class va {
|
|
5357
5307
|
constructor(e) {
|
|
5358
|
-
|
|
5308
|
+
h(this, "wrapped"), h(this, Sn, "JSONSeriesIterator"), this.wrapped = e;
|
|
5359
5309
|
}
|
|
5360
5310
|
next() {
|
|
5361
5311
|
const e = this.wrapped.next();
|
|
5362
5312
|
return e.done === !0 ? { done: !0, value: void 0 } : {
|
|
5363
5313
|
done: !1,
|
|
5364
|
-
value:
|
|
5314
|
+
value: pt.decodeString(e.value)
|
|
5365
5315
|
};
|
|
5366
5316
|
}
|
|
5367
|
-
[(
|
|
5317
|
+
[(Nn = Symbol.iterator, Sn = Symbol.toStringTag, Nn)]() {
|
|
5368
5318
|
return this;
|
|
5369
5319
|
}
|
|
5370
5320
|
}
|
|
5371
|
-
var
|
|
5372
|
-
class
|
|
5321
|
+
var In, kn;
|
|
5322
|
+
class wa {
|
|
5373
5323
|
constructor(e) {
|
|
5374
|
-
|
|
5324
|
+
h(this, "series"), h(this, "index"), h(this, In, "SeriesIterator"), this.series = e, this.index = 0;
|
|
5375
5325
|
}
|
|
5376
5326
|
next() {
|
|
5377
5327
|
return this.index >= this.series.length ? { done: !0, value: void 0 } : {
|
|
@@ -5379,20 +5329,86 @@ class Ta {
|
|
|
5379
5329
|
value: this.series.at(this.index++, !0)
|
|
5380
5330
|
};
|
|
5381
5331
|
}
|
|
5382
|
-
[(
|
|
5332
|
+
[(kn = Symbol.iterator, In = Symbol.toStringTag, kn)]() {
|
|
5383
5333
|
return this;
|
|
5384
5334
|
}
|
|
5385
5335
|
}
|
|
5386
|
-
const
|
|
5336
|
+
const An = (n) => {
|
|
5387
5337
|
const e = n >> 32n, t = n & 0xffffffffn;
|
|
5388
5338
|
return { domain: e, sample: t };
|
|
5389
|
-
},
|
|
5339
|
+
}, ba = (n, e, t = ".") => {
|
|
5340
|
+
const r = n.split(t);
|
|
5341
|
+
return r.map((s, i) => {
|
|
5342
|
+
const a = e(s, i, r);
|
|
5343
|
+
return a == null ? null : typeof a == "string" ? a : a.join(t);
|
|
5344
|
+
}).filter((s) => s != null).join(t);
|
|
5345
|
+
}, pr = (n, e, t = { optional: !1, separator: "." }) => {
|
|
5346
|
+
t.separator ?? (t.separator = ".");
|
|
5347
|
+
const { optional: r, getter: s = (o, c) => o[c] } = t, i = e.split(t.separator);
|
|
5348
|
+
if (i.length === 1 && i[0] === "") return n;
|
|
5349
|
+
let a = n;
|
|
5350
|
+
for (const o of i) {
|
|
5351
|
+
const c = s(a, o);
|
|
5352
|
+
if (c == null) {
|
|
5353
|
+
if (r) return null;
|
|
5354
|
+
throw new Error(`Path ${e} does not exist. ${o} is null`);
|
|
5355
|
+
}
|
|
5356
|
+
a = c;
|
|
5357
|
+
}
|
|
5358
|
+
return a;
|
|
5359
|
+
}, xa = (n, e, t) => {
|
|
5360
|
+
const r = e.split(".");
|
|
5361
|
+
let s = n;
|
|
5362
|
+
for (let i = 0; i < r.length - 1; i++) {
|
|
5363
|
+
const a = r[i];
|
|
5364
|
+
s[a] ?? (s[a] = {}), s = s[a];
|
|
5365
|
+
}
|
|
5366
|
+
try {
|
|
5367
|
+
s[r[r.length - 1]] = t;
|
|
5368
|
+
} catch (i) {
|
|
5369
|
+
throw console.error("failed to set value", t, "at path", e, "on object", n), i;
|
|
5370
|
+
}
|
|
5371
|
+
}, _a = (n, e) => {
|
|
5372
|
+
const t = e.split(".");
|
|
5373
|
+
let r = n;
|
|
5374
|
+
for (let s = 0; s < t.length - 1; s++) {
|
|
5375
|
+
const i = t[s];
|
|
5376
|
+
if (r[i] == null) return;
|
|
5377
|
+
r = r[i];
|
|
5378
|
+
}
|
|
5379
|
+
if (Array.isArray(r)) {
|
|
5380
|
+
const s = parseInt(t[t.length - 1]);
|
|
5381
|
+
if (isNaN(s)) return;
|
|
5382
|
+
r.splice(s, 1);
|
|
5383
|
+
return;
|
|
5384
|
+
}
|
|
5385
|
+
delete r[t[t.length - 1]];
|
|
5386
|
+
}, Ta = (n, e) => {
|
|
5387
|
+
const t = n.split(".");
|
|
5388
|
+
return e < 0 ? t[t.length + e] : t[e];
|
|
5389
|
+
}, Oa = (n, e) => {
|
|
5390
|
+
try {
|
|
5391
|
+
return pr(n, e), !0;
|
|
5392
|
+
} catch {
|
|
5393
|
+
return !1;
|
|
5394
|
+
}
|
|
5395
|
+
}, Sa = (n, e) => {
|
|
5396
|
+
if (e.length === 0) return !0;
|
|
5397
|
+
const t = n.split("."), r = e.split(".");
|
|
5398
|
+
if (r.length > t.length) return !1;
|
|
5399
|
+
for (let s = 0; s < r.length; s++) {
|
|
5400
|
+
const i = t[s], a = r[s];
|
|
5401
|
+
if (a !== "*" && i !== a)
|
|
5402
|
+
return !1;
|
|
5403
|
+
}
|
|
5404
|
+
return !0;
|
|
5405
|
+
}, Na = (n) => JSON.parse(JSON.stringify(n)), Ia = (n, ...e) => (e.forEach((t) => {
|
|
5390
5406
|
let r = n;
|
|
5391
5407
|
const s = t.split(".");
|
|
5392
5408
|
s.forEach((i, a) => {
|
|
5393
5409
|
a === s.length - 1 ? delete r[i] : i in r && (r = r[i]);
|
|
5394
5410
|
});
|
|
5395
|
-
}), n),
|
|
5411
|
+
}), n), ka = (n, e, t = "") => {
|
|
5396
5412
|
const r = {}, s = (i, a, o) => {
|
|
5397
5413
|
if (typeof i != typeof a || i === null || a === null) {
|
|
5398
5414
|
r[o] = [i, a];
|
|
@@ -5433,69 +5449,72 @@ const ze = (n, e) => typeof n == "bigint" && typeof e == "bigint" || typeof n ==
|
|
|
5433
5449
|
} else if (o !== c) return !1;
|
|
5434
5450
|
}
|
|
5435
5451
|
return !0;
|
|
5436
|
-
},
|
|
5452
|
+
}, mr = (n, e) => {
|
|
5437
5453
|
if (typeof n != "object" || n == null) return n === e;
|
|
5438
5454
|
const t = Object.keys(n), r = Object.keys(e);
|
|
5439
5455
|
if (r.length > t.length) return !1;
|
|
5440
5456
|
for (const s of r) {
|
|
5441
5457
|
const i = n[s], a = e[s];
|
|
5442
5458
|
if (typeof i == "object" && typeof a == "object") {
|
|
5443
|
-
if (!
|
|
5459
|
+
if (!mr(i, a)) return !1;
|
|
5444
5460
|
} else if (i !== a) return !1;
|
|
5445
5461
|
}
|
|
5446
5462
|
return !0;
|
|
5447
5463
|
}, Ht = (n, ...e) => {
|
|
5448
5464
|
if (e.length === 0) return n;
|
|
5449
5465
|
const t = e.shift();
|
|
5450
|
-
if (
|
|
5466
|
+
if (Fe(n) && Fe(t))
|
|
5451
5467
|
for (const r in t)
|
|
5452
5468
|
try {
|
|
5453
|
-
|
|
5469
|
+
Fe(t[r]) ? (r in n || Object.assign(n, { [r]: {} }), Ht(n[r], t[r])) : Object.assign(n, { [r]: t[r] });
|
|
5454
5470
|
} catch (s) {
|
|
5455
5471
|
throw s instanceof TypeError ? new TypeError(`.${r}: ${s.message}`) : s;
|
|
5456
5472
|
}
|
|
5457
5473
|
return Ht(n, ...e);
|
|
5458
|
-
},
|
|
5474
|
+
}, Aa = (n, e, t) => {
|
|
5459
5475
|
const r = (s, i, a) => {
|
|
5460
5476
|
for (const o in i) {
|
|
5461
|
-
const c = i[o];
|
|
5462
|
-
if (
|
|
5463
|
-
const
|
|
5464
|
-
|
|
5477
|
+
const c = i[o], l = yr(a);
|
|
5478
|
+
if (l != null && l[o]) {
|
|
5479
|
+
const p = l[o].safeParse(c);
|
|
5480
|
+
p.success && (s[o] = p.data);
|
|
5465
5481
|
} else typeof c == "object" && !Array.isArray(c) && c !== null && a && a.shape && a.shape[o] && (s[o] || (s[o] = {}), r(s[o], c, a.shape[o]));
|
|
5466
5482
|
}
|
|
5467
5483
|
return s;
|
|
5468
5484
|
};
|
|
5469
5485
|
return r({ ...n }, e, t);
|
|
5470
|
-
},
|
|
5486
|
+
}, yr = (n) => {
|
|
5487
|
+
var e;
|
|
5488
|
+
return ((e = n._def) == null ? void 0 : e.typeName) === "ZodEffects" ? yr(n._def.schema) : n == null ? void 0 : n.shape;
|
|
5489
|
+
}, gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5471
5490
|
__proto__: null,
|
|
5472
|
-
copy:
|
|
5473
|
-
deleteD:
|
|
5474
|
-
difference:
|
|
5475
|
-
element:
|
|
5491
|
+
copy: Na,
|
|
5492
|
+
deleteD: Ia,
|
|
5493
|
+
difference: ka,
|
|
5494
|
+
element: Ta,
|
|
5476
5495
|
equal: Jt,
|
|
5477
|
-
get:
|
|
5478
|
-
has:
|
|
5496
|
+
get: pr,
|
|
5497
|
+
has: Oa,
|
|
5479
5498
|
override: Ht,
|
|
5480
|
-
overrideValidItems:
|
|
5481
|
-
partialEqual:
|
|
5482
|
-
pathsMatch:
|
|
5483
|
-
remove:
|
|
5484
|
-
set:
|
|
5485
|
-
transformPath:
|
|
5499
|
+
overrideValidItems: Aa,
|
|
5500
|
+
partialEqual: mr,
|
|
5501
|
+
pathsMatch: Sa,
|
|
5502
|
+
remove: _a,
|
|
5503
|
+
set: xa,
|
|
5504
|
+
transformPath: ba
|
|
5486
5505
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
5487
5506
|
u.object({ key: u.string(), value: u.string() });
|
|
5488
5507
|
u.record(
|
|
5489
5508
|
u.union([u.number(), u.string(), u.symbol()]),
|
|
5490
5509
|
u.unknown()
|
|
5491
5510
|
);
|
|
5492
|
-
const
|
|
5511
|
+
const vr = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", Ea = vr(), wr = ["macOS", "Windows", "Linux"], $a = ["macos", "windows", "linux"], Ca = {
|
|
5493
5512
|
macos: "macOS",
|
|
5494
5513
|
windows: "Windows",
|
|
5495
5514
|
linux: "Linux"
|
|
5496
|
-
},
|
|
5497
|
-
u.enum(
|
|
5498
|
-
),
|
|
5515
|
+
}, Ra = u.enum(wr).or(
|
|
5516
|
+
u.enum($a).transform((n) => Ca[n])
|
|
5517
|
+
), Ma = () => {
|
|
5499
5518
|
if (typeof window > "u") return;
|
|
5500
5519
|
const n = window.navigator.userAgent.toLowerCase();
|
|
5501
5520
|
if (n.includes("mac")) return "macOS";
|
|
@@ -5503,19 +5522,19 @@ const yr = () => typeof process < "u" && process.versions != null && process.ver
|
|
|
5503
5522
|
if (n.includes("linux")) return "Linux";
|
|
5504
5523
|
};
|
|
5505
5524
|
let jt;
|
|
5506
|
-
const
|
|
5525
|
+
const ja = (n = {}) => {
|
|
5507
5526
|
const { force: e, default: t } = n;
|
|
5508
|
-
return e ?? jt ?? (jt =
|
|
5509
|
-
},
|
|
5527
|
+
return e ?? jt ?? (jt = Ma(), jt ?? t);
|
|
5528
|
+
}, Bo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5510
5529
|
__proto__: null,
|
|
5511
|
-
OPERATING_SYSTEMS:
|
|
5512
|
-
RUNTIME:
|
|
5513
|
-
detect:
|
|
5514
|
-
getOS:
|
|
5515
|
-
osZ:
|
|
5530
|
+
OPERATING_SYSTEMS: wr,
|
|
5531
|
+
RUNTIME: Ea,
|
|
5532
|
+
detect: vr,
|
|
5533
|
+
getOS: ja,
|
|
5534
|
+
osZ: Ra
|
|
5516
5535
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
5517
|
-
var
|
|
5518
|
-
const
|
|
5536
|
+
var Za = Object.defineProperty, Ba = (n, e, t) => e in n ? Za(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, We = (n, e, t) => Ba(n, typeof e != "symbol" ? e + "" : e, t);
|
|
5537
|
+
const Ua = (...n) => n.map(br).join(""), br = (n) => (n.endsWith("/") || (n += "/"), n.startsWith("/") && (n = n.slice(1)), n), Da = (n) => n.endsWith("/") ? n.slice(0, -1) : n, En = class Xt {
|
|
5519
5538
|
/**
|
|
5520
5539
|
* @param host - The hostname or IP address of the server.
|
|
5521
5540
|
* @param port - The port number of the server.
|
|
@@ -5523,7 +5542,7 @@ const Za = (...n) => n.map(vr).join(""), vr = (n) => (n.endsWith("/") || (n += "
|
|
|
5523
5542
|
* @param pathPrefix - A path prefix to use for all requests. Defaults to "".
|
|
5524
5543
|
*/
|
|
5525
5544
|
constructor({ host: e, port: t, protocol: r = "", pathPrefix: s = "" }) {
|
|
5526
|
-
We(this, "protocol"), We(this, "host"), We(this, "port"), We(this, "path"), this.protocol = r, this.host = e, this.port = t, this.path =
|
|
5545
|
+
We(this, "protocol"), We(this, "host"), We(this, "port"), We(this, "path"), this.protocol = r, this.host = e, this.port = t, this.path = br(s);
|
|
5527
5546
|
}
|
|
5528
5547
|
/**
|
|
5529
5548
|
* Replaces creates a new URL with the specified properties replaced.
|
|
@@ -5546,46 +5565,66 @@ const Za = (...n) => n.map(vr).join(""), vr = (n) => (n.endsWith("/") || (n += "
|
|
|
5546
5565
|
child(e) {
|
|
5547
5566
|
return new Xt({
|
|
5548
5567
|
...this,
|
|
5549
|
-
pathPrefix:
|
|
5568
|
+
pathPrefix: Ua(this.path, e)
|
|
5550
5569
|
});
|
|
5551
5570
|
}
|
|
5552
5571
|
/** @returns a string representation of the url */
|
|
5553
5572
|
toString() {
|
|
5554
|
-
return
|
|
5573
|
+
return Da(
|
|
5555
5574
|
`${this.protocol}://${this.host}:${this.port}/${this.path}`
|
|
5556
5575
|
);
|
|
5557
5576
|
}
|
|
5558
5577
|
};
|
|
5559
|
-
We(
|
|
5560
|
-
|
|
5578
|
+
We(En, "UNKNOWN", new En({ host: "unknown", port: 0 }));
|
|
5579
|
+
const La = -128, Pa = 127;
|
|
5580
|
+
u.number().int().min(La).max(Pa);
|
|
5581
|
+
const za = -32768, Wa = 32767;
|
|
5582
|
+
u.number().int().min(za).max(Wa);
|
|
5583
|
+
const Va = -2147483648, qa = 2147483647;
|
|
5584
|
+
u.number().int().min(Va).max(qa);
|
|
5585
|
+
const Fa = -9223372036854775808n, Ya = 9223372036854775807n;
|
|
5586
|
+
u.bigint().min(Fa).max(Ya);
|
|
5587
|
+
const Ga = 255;
|
|
5588
|
+
u.number().int().min(0).max(Ga);
|
|
5589
|
+
const Ja = 65535;
|
|
5590
|
+
u.number().int().min(0).max(Ja);
|
|
5591
|
+
const Ha = 4294967295;
|
|
5592
|
+
u.number().int().min(0).max(Ha);
|
|
5593
|
+
const Xa = 18446744073709551615n;
|
|
5594
|
+
u.bigint().min(0n).max(Xa);
|
|
5595
|
+
var Ka = Object.defineProperty, Qa = (n, e, t) => e in n ? Ka(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, Ve = (n, e, t) => Qa(n, typeof e != "symbol" ? e + "" : e, t);
|
|
5561
5596
|
u.object({
|
|
5562
5597
|
interval: A.z.optional(),
|
|
5563
5598
|
maxRetries: u.number().optional(),
|
|
5564
5599
|
scale: u.number().optional()
|
|
5565
5600
|
});
|
|
5566
|
-
const
|
|
5601
|
+
const te = class extends Number {
|
|
5567
5602
|
};
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5603
|
+
Ve(te, "ABSOLUTE", 255), Ve(te, "MINIMUM", 0), Ve(te, "BOUNDS", {
|
|
5604
|
+
lower: te.MINIMUM,
|
|
5605
|
+
// upper bound is exclusive, so we add 1
|
|
5606
|
+
upper: te.ABSOLUTE + 1
|
|
5607
|
+
}), Ve(te, "z", u.union([
|
|
5608
|
+
u.instanceof(te),
|
|
5609
|
+
u.number().int().min(0).max(255).transform((n) => new te(n)),
|
|
5610
|
+
u.instanceof(Number).transform((n) => new te(n))
|
|
5572
5611
|
]));
|
|
5573
5612
|
u.object({
|
|
5574
5613
|
name: u.string(),
|
|
5575
5614
|
key: u.string()
|
|
5576
5615
|
});
|
|
5577
|
-
const
|
|
5616
|
+
const xr = class qe extends Error {
|
|
5578
5617
|
constructor() {
|
|
5579
|
-
super(
|
|
5618
|
+
super(qe.MESSAGE);
|
|
5580
5619
|
}
|
|
5581
5620
|
/** Returns true if the error or message is a cancellation error" */
|
|
5582
5621
|
matches(e) {
|
|
5583
|
-
return typeof e == "string" ? e.includes(
|
|
5622
|
+
return typeof e == "string" ? e.includes(qe.MESSAGE) : e instanceof qe || e.message.includes(qe.MESSAGE);
|
|
5584
5623
|
}
|
|
5585
5624
|
};
|
|
5586
|
-
|
|
5587
|
-
let
|
|
5588
|
-
new
|
|
5625
|
+
Ve(xr, "MESSAGE", "canceled");
|
|
5626
|
+
let eo = xr;
|
|
5627
|
+
new eo();
|
|
5589
5628
|
u.string().regex(/^\d+\.\d+\.\d+$/);
|
|
5590
5629
|
const Ae = "main", ln = "prerender", dn = {
|
|
5591
5630
|
stage: "creating",
|
|
@@ -5593,11 +5632,11 @@ const Ae = "main", ln = "prerender", dn = {
|
|
|
5593
5632
|
reserved: !1,
|
|
5594
5633
|
focusCount: 0,
|
|
5595
5634
|
centerCount: 0
|
|
5596
|
-
},
|
|
5635
|
+
}, _r = {
|
|
5597
5636
|
...dn,
|
|
5598
5637
|
key: ln,
|
|
5599
5638
|
visible: !1
|
|
5600
|
-
},
|
|
5639
|
+
}, Do = u.object({
|
|
5601
5640
|
key: u.string(),
|
|
5602
5641
|
url: u.string().optional(),
|
|
5603
5642
|
title: u.string().optional(),
|
|
@@ -5617,7 +5656,7 @@ const Ae = "main", ln = "prerender", dn = {
|
|
|
5617
5656
|
fileDropEnabled: u.boolean().optional(),
|
|
5618
5657
|
transparent: u.boolean().optional(),
|
|
5619
5658
|
alwaysOnTop: u.boolean().optional()
|
|
5620
|
-
}),
|
|
5659
|
+
}), to = A.milliseconds(50), Tr = () => setTimeout(() => window.location.reload(), to.milliseconds), no = {
|
|
5621
5660
|
label: Ae,
|
|
5622
5661
|
config: {
|
|
5623
5662
|
enablePrerender: !0,
|
|
@@ -5637,17 +5676,17 @@ const Ae = "main", ln = "prerender", dn = {
|
|
|
5637
5676
|
keyLabels: {
|
|
5638
5677
|
main: Ae
|
|
5639
5678
|
}
|
|
5640
|
-
},
|
|
5641
|
-
if (n.type ===
|
|
5642
|
-
return e.label !== Ae || (n.payload.label = Ft.
|
|
5679
|
+
}, Lo = (n, e) => {
|
|
5680
|
+
if (n.type === Ao.type)
|
|
5681
|
+
return e.label !== Ae || (n.payload.label = Ft.create(), n.payload.prerenderLabel = Ft.create()), n;
|
|
5643
5682
|
if ("label" in n.payload) return n;
|
|
5644
5683
|
let t = e.label;
|
|
5645
5684
|
const r = n.payload;
|
|
5646
5685
|
return r.key != null && (r.key in e.windows ? t = r.key : t = e.keyLabels[r.key]), n.payload = { ...n.payload, label: t }, n;
|
|
5647
|
-
},
|
|
5686
|
+
}, V = (n) => (e, t) => {
|
|
5648
5687
|
if (!("label" in t.payload)) throw new Error("Missing label");
|
|
5649
5688
|
n(e, t);
|
|
5650
|
-
},
|
|
5689
|
+
}, ge = (n, e = !1) => V((t, r) => {
|
|
5651
5690
|
let s = e;
|
|
5652
5691
|
const i = t.windows[r.payload.label];
|
|
5653
5692
|
if (i != null) {
|
|
@@ -5664,189 +5703,189 @@ const Ae = "main", ln = "prerender", dn = {
|
|
|
5664
5703
|
...s,
|
|
5665
5704
|
[n]: s[n] + (e ? -1 : 1)
|
|
5666
5705
|
});
|
|
5667
|
-
},
|
|
5706
|
+
}, ro = (n) => Object.values(n.windows).some((e) => e.key === ln && !e.reserved), Or = "drift", so = (n, e, t) => n.position != null && n.size != null && e == null ? ft.topLeft(
|
|
5668
5707
|
ft.positionInCenter(
|
|
5669
5708
|
ft.construct(Wt.ZERO, t ?? Wt.ZERO),
|
|
5670
5709
|
ft.construct(n.position, n.size)
|
|
5671
5710
|
)
|
|
5672
|
-
) : e,
|
|
5711
|
+
) : e, io = (n, { payload: e }) => {
|
|
5673
5712
|
if (e.key === ln) return;
|
|
5674
5713
|
const { key: t, label: r, prerenderLabel: s } = e;
|
|
5675
5714
|
if (r == null || s == null)
|
|
5676
5715
|
throw new Error("[drift] - bug - missing label and prerender label");
|
|
5677
|
-
console.log(n.config.debug),
|
|
5716
|
+
console.log(n.config.debug), Ir(n.config.debug, "reducer create window");
|
|
5678
5717
|
const i = n.windows.main;
|
|
5679
|
-
if (e.position =
|
|
5680
|
-
|
|
5718
|
+
if (e.position = so(i, e.position, e.size), t in n.keyLabels) {
|
|
5719
|
+
dt(n.config.debug, "window already exists, un-minimize and focus it");
|
|
5681
5720
|
const c = n.keyLabels[e.key];
|
|
5682
|
-
n.windows[c].visible = !0, n.windows[c].focusCount += 1, n.windows[c].minimized = !1, n.windows[c].position = e.position,
|
|
5721
|
+
n.windows[c].visible = !0, n.windows[c].focusCount += 1, n.windows[c].minimized = !1, n.windows[c].position = e.position, hn(n.config.debug);
|
|
5683
5722
|
return;
|
|
5684
5723
|
}
|
|
5685
5724
|
const [a, o] = Object.entries(n.windows).find(
|
|
5686
5725
|
([, c]) => !c.reserved
|
|
5687
5726
|
) ?? [null, null];
|
|
5688
|
-
a != null ? (
|
|
5727
|
+
a != null ? (dt(n.config.debug, "using available pre-rendered window"), n.windows[a] = {
|
|
5689
5728
|
...o,
|
|
5690
5729
|
visible: !0,
|
|
5691
5730
|
reserved: !0,
|
|
5692
5731
|
focusCount: 1,
|
|
5693
5732
|
focus: !0,
|
|
5694
5733
|
...e
|
|
5695
|
-
}, n.labelKeys[a] = e.key, n.keyLabels[e.key] = a) : (
|
|
5734
|
+
}, n.labelKeys[a] = e.key, n.keyLabels[e.key] = a) : (dt(n.config.debug, "creating new window"), n.windows[r] = {
|
|
5696
5735
|
...n.config.defaultWindowProps,
|
|
5697
5736
|
...dn,
|
|
5698
5737
|
...e,
|
|
5699
5738
|
reserved: !0
|
|
5700
|
-
}, n.labelKeys[r] = t, n.keyLabels[t] = r), n.config.enablePrerender && !
|
|
5739
|
+
}, n.labelKeys[r] = t, n.keyLabels[t] = r), n.config.enablePrerender && !ro(n) && (dt(n.config.debug, "creating pre-render window"), n.windows[s] = gr.copy({
|
|
5701
5740
|
...n.config.defaultWindowProps,
|
|
5702
|
-
...
|
|
5703
|
-
})),
|
|
5704
|
-
},
|
|
5741
|
+
..._r
|
|
5742
|
+
})), hn(n.config.debug);
|
|
5743
|
+
}, ao = V((n, e) => {
|
|
5705
5744
|
const t = n.windows[e.payload.label];
|
|
5706
5745
|
t != null && (t.stage = e.payload.stage);
|
|
5707
|
-
}),
|
|
5746
|
+
}), oo = V(
|
|
5708
5747
|
(n, { payload: { label: e } }) => {
|
|
5709
5748
|
const t = n.windows[e];
|
|
5710
5749
|
t == null || t.processCount > 0 || (t.stage = "closing", delete n.windows[e], delete n.labelKeys[e], delete n.keyLabels[t.key]);
|
|
5711
5750
|
}
|
|
5712
|
-
),
|
|
5751
|
+
), uo = V((n, e) => {
|
|
5713
5752
|
const t = n.windows[e.payload.label];
|
|
5714
|
-
t == null || t.processCount > 0 || (t.stage = "reloading",
|
|
5715
|
-
}),
|
|
5753
|
+
t == null || t.processCount > 0 || (t.stage = "reloading", Tr());
|
|
5754
|
+
}), co = V(
|
|
5716
5755
|
$t("processCount")
|
|
5717
|
-
),
|
|
5756
|
+
), lo = V((n, e) => {
|
|
5718
5757
|
$t("processCount", !0)(n, e);
|
|
5719
5758
|
const t = n.windows[e.payload.label];
|
|
5720
|
-
t != null && t.processCount === 0 && (t.stage === "reloading" ?
|
|
5721
|
-
}),
|
|
5759
|
+
t != null && t.processCount === 0 && (t.stage === "reloading" ? Tr() : (n.windows[e.payload.label].visible = !1, delete n.windows[e.payload.label], delete n.labelKeys[e.payload.label], delete n.keyLabels[t.key]));
|
|
5760
|
+
}), ho = (n, e) => {
|
|
5722
5761
|
const t = n.windows[e.payload.key];
|
|
5723
5762
|
t != null && (t.error = e.payload.message);
|
|
5724
|
-
},
|
|
5763
|
+
}, fo = V((n, e) => {
|
|
5725
5764
|
const t = n.windows[e.payload.label];
|
|
5726
5765
|
t != null && (t.visible !== !0 && (t.visible = !0), $t("focusCount")(n, e));
|
|
5727
|
-
}),
|
|
5766
|
+
}), po = ge("minimized"), mo = ge("maximized"), yo = ge("visible", !0), go = ge("fullscreen", !0), vo = V(
|
|
5728
5767
|
$t("centerCount")
|
|
5729
|
-
),
|
|
5768
|
+
), wo = V((n, e) => {
|
|
5730
5769
|
n.windows[e.payload.label].position = e.payload.position;
|
|
5731
|
-
}),
|
|
5770
|
+
}), bo = V((n, e) => {
|
|
5732
5771
|
n.windows[e.payload.label].size = e.payload.size;
|
|
5733
|
-
}),
|
|
5772
|
+
}), xo = V((n, e) => {
|
|
5734
5773
|
n.windows[e.payload.label].minSize = e.payload.size;
|
|
5735
|
-
}),
|
|
5774
|
+
}), _o = V((n, e) => {
|
|
5736
5775
|
n.windows[e.payload.label].maxSize = e.payload.size;
|
|
5737
|
-
}),
|
|
5776
|
+
}), To = ge("resizable"), Oo = ge("skipTaskbar"), So = ge("alwaysOnTop"), No = V((n, e) => {
|
|
5738
5777
|
n.windows[e.payload.label].title = e.payload.title;
|
|
5739
|
-
}),
|
|
5778
|
+
}), Io = ge("decorations"), $n = (n, e) => {
|
|
5740
5779
|
const t = n.windows[e.payload.label];
|
|
5741
|
-
|
|
5742
|
-
},
|
|
5780
|
+
gr.partialEqual(t, e.payload) || (n.windows[e.payload.label] = { ...t, ...e.payload });
|
|
5781
|
+
}, ko = (n, e) => {
|
|
5743
5782
|
if (n.config = { ...n.config, ...e.payload }, n.label = e.payload.label, n.label === Ae && n.config.enablePrerender) {
|
|
5744
|
-
const t = Ft.
|
|
5783
|
+
const t = Ft.create();
|
|
5745
5784
|
n.windows[t] = {
|
|
5746
5785
|
...n.config.defaultWindowProps,
|
|
5747
|
-
...
|
|
5786
|
+
..._r
|
|
5748
5787
|
};
|
|
5749
5788
|
}
|
|
5750
|
-
},
|
|
5751
|
-
name:
|
|
5752
|
-
initialState:
|
|
5789
|
+
}, Sr = Nr({
|
|
5790
|
+
name: Or,
|
|
5791
|
+
initialState: no,
|
|
5753
5792
|
reducers: {
|
|
5754
|
-
internalSetInitial:
|
|
5755
|
-
createWindow:
|
|
5756
|
-
setWindowStage:
|
|
5757
|
-
closeWindow:
|
|
5758
|
-
registerProcess:
|
|
5759
|
-
completeProcess:
|
|
5760
|
-
setWindowError:
|
|
5761
|
-
focusWindow:
|
|
5762
|
-
reloadWindow:
|
|
5763
|
-
setWindowMinimized:
|
|
5764
|
-
setWindowMaximized:
|
|
5765
|
-
setWindowVisible:
|
|
5766
|
-
setWindowFullscreen:
|
|
5767
|
-
centerWindow:
|
|
5768
|
-
setWindowPosition:
|
|
5769
|
-
setWindowSize:
|
|
5770
|
-
setWindowMinSize:
|
|
5771
|
-
setWindowMaxSize:
|
|
5772
|
-
setWindowResizable:
|
|
5773
|
-
setWindowSkipTaskbar:
|
|
5774
|
-
setWindowAlwaysOnTop:
|
|
5775
|
-
setWindowTitle:
|
|
5776
|
-
setWindowDecorations:
|
|
5777
|
-
runtimeSetWindowProps:
|
|
5778
|
-
setWindowProps:
|
|
5793
|
+
internalSetInitial: ko,
|
|
5794
|
+
createWindow: io,
|
|
5795
|
+
setWindowStage: ao,
|
|
5796
|
+
closeWindow: oo,
|
|
5797
|
+
registerProcess: co,
|
|
5798
|
+
completeProcess: lo,
|
|
5799
|
+
setWindowError: ho,
|
|
5800
|
+
focusWindow: fo,
|
|
5801
|
+
reloadWindow: uo,
|
|
5802
|
+
setWindowMinimized: po,
|
|
5803
|
+
setWindowMaximized: mo,
|
|
5804
|
+
setWindowVisible: yo,
|
|
5805
|
+
setWindowFullscreen: go,
|
|
5806
|
+
centerWindow: vo,
|
|
5807
|
+
setWindowPosition: wo,
|
|
5808
|
+
setWindowSize: bo,
|
|
5809
|
+
setWindowMinSize: xo,
|
|
5810
|
+
setWindowMaxSize: _o,
|
|
5811
|
+
setWindowResizable: To,
|
|
5812
|
+
setWindowSkipTaskbar: Oo,
|
|
5813
|
+
setWindowAlwaysOnTop: So,
|
|
5814
|
+
setWindowTitle: No,
|
|
5815
|
+
setWindowDecorations: Io,
|
|
5816
|
+
runtimeSetWindowProps: $n,
|
|
5817
|
+
setWindowProps: $n
|
|
5779
5818
|
}
|
|
5780
5819
|
}), {
|
|
5781
5820
|
actions: {
|
|
5782
|
-
runtimeSetWindowProps:
|
|
5783
|
-
setWindowProps:
|
|
5784
|
-
createWindow:
|
|
5785
|
-
internalSetInitial:
|
|
5786
|
-
setWindowStage:
|
|
5787
|
-
closeWindow:
|
|
5788
|
-
registerProcess:
|
|
5789
|
-
completeProcess:
|
|
5790
|
-
setWindowError:
|
|
5791
|
-
focusWindow:
|
|
5792
|
-
reloadWindow:
|
|
5793
|
-
setWindowMinimized:
|
|
5794
|
-
setWindowMaximized:
|
|
5795
|
-
setWindowVisible:
|
|
5796
|
-
setWindowFullscreen:
|
|
5797
|
-
centerWindow:
|
|
5798
|
-
setWindowPosition:
|
|
5799
|
-
setWindowSize:
|
|
5800
|
-
setWindowMinSize:
|
|
5801
|
-
setWindowMaxSize:
|
|
5802
|
-
setWindowResizable:
|
|
5803
|
-
setWindowSkipTaskbar:
|
|
5804
|
-
setWindowAlwaysOnTop:
|
|
5805
|
-
setWindowTitle:
|
|
5806
|
-
setWindowDecorations:
|
|
5807
|
-
}
|
|
5808
|
-
} =
|
|
5821
|
+
runtimeSetWindowProps: Po,
|
|
5822
|
+
setWindowProps: zo,
|
|
5823
|
+
createWindow: Ao,
|
|
5824
|
+
internalSetInitial: Eo,
|
|
5825
|
+
setWindowStage: Wo,
|
|
5826
|
+
closeWindow: Vo,
|
|
5827
|
+
registerProcess: qo,
|
|
5828
|
+
completeProcess: Fo,
|
|
5829
|
+
setWindowError: Yo,
|
|
5830
|
+
focusWindow: Go,
|
|
5831
|
+
reloadWindow: Jo,
|
|
5832
|
+
setWindowMinimized: Ho,
|
|
5833
|
+
setWindowMaximized: Xo,
|
|
5834
|
+
setWindowVisible: Ko,
|
|
5835
|
+
setWindowFullscreen: Qo,
|
|
5836
|
+
centerWindow: eu,
|
|
5837
|
+
setWindowPosition: tu,
|
|
5838
|
+
setWindowSize: nu,
|
|
5839
|
+
setWindowMinSize: ru,
|
|
5840
|
+
setWindowMaxSize: su,
|
|
5841
|
+
setWindowResizable: iu,
|
|
5842
|
+
setWindowSkipTaskbar: au,
|
|
5843
|
+
setWindowAlwaysOnTop: ou,
|
|
5844
|
+
setWindowTitle: uu,
|
|
5845
|
+
setWindowDecorations: cu
|
|
5846
|
+
}
|
|
5847
|
+
} = Sr, lu = Sr.reducer, du = (n) => n.startsWith(Or), $o = [Eo.type], hu = (n, e) => !n && !$o.includes(e);
|
|
5809
5848
|
export {
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5849
|
+
iu as A,
|
|
5850
|
+
nu as B,
|
|
5851
|
+
au as C,
|
|
5852
|
+
uu as D,
|
|
5853
|
+
Ko as E,
|
|
5854
|
+
Do as F,
|
|
5816
5855
|
Wt as G,
|
|
5817
5856
|
A as H,
|
|
5818
5857
|
dn as I,
|
|
5819
|
-
|
|
5820
|
-
|
|
5858
|
+
Bo as J,
|
|
5859
|
+
gr as K,
|
|
5860
|
+
ft as L,
|
|
5821
5861
|
Ae as M,
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
za as Z,
|
|
5862
|
+
Or as S,
|
|
5863
|
+
no as Z,
|
|
5825
5864
|
Mt as _,
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5865
|
+
hn as a,
|
|
5866
|
+
Jo as b,
|
|
5867
|
+
Lo as c,
|
|
5868
|
+
Yo as d,
|
|
5869
|
+
Eo as e,
|
|
5870
|
+
Wo as f,
|
|
5871
|
+
Ir as g,
|
|
5872
|
+
Vo as h,
|
|
5873
|
+
du as i,
|
|
5874
|
+
Fo as j,
|
|
5875
|
+
Ao as k,
|
|
5876
|
+
dt as l,
|
|
5877
|
+
Go as m,
|
|
5878
|
+
lu as n,
|
|
5879
|
+
qo as o,
|
|
5880
|
+
ou as p,
|
|
5881
|
+
cu as q,
|
|
5882
|
+
Po as r,
|
|
5883
|
+
hu as s,
|
|
5884
|
+
Qo as t,
|
|
5885
|
+
su as u,
|
|
5886
|
+
Xo as v,
|
|
5887
|
+
ru as w,
|
|
5888
|
+
Ho as x,
|
|
5889
|
+
tu as y,
|
|
5890
|
+
zo as z
|
|
5852
5891
|
};
|