@elysiajs/jwt 1.0.2 → 1.1.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/index.mjs ADDED
@@ -0,0 +1,2452 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ // src/index.ts
8
+ import { Elysia, ValidationError, getSchemaValidator } from "elysia";
9
+ import {
10
+ SignJWT,
11
+ jwtVerify
12
+ } from "jose";
13
+
14
+ // node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
15
+ var value_exports = {};
16
+ __export(value_exports, {
17
+ IsArray: () => IsArray,
18
+ IsAsyncIterator: () => IsAsyncIterator,
19
+ IsBigInt: () => IsBigInt,
20
+ IsBoolean: () => IsBoolean,
21
+ IsDate: () => IsDate,
22
+ IsFunction: () => IsFunction,
23
+ IsIterator: () => IsIterator,
24
+ IsNull: () => IsNull,
25
+ IsNumber: () => IsNumber,
26
+ IsObject: () => IsObject,
27
+ IsRegExp: () => IsRegExp,
28
+ IsString: () => IsString,
29
+ IsSymbol: () => IsSymbol,
30
+ IsUint8Array: () => IsUint8Array,
31
+ IsUndefined: () => IsUndefined
32
+ });
33
+ function IsAsyncIterator(value) {
34
+ return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value;
35
+ }
36
+ function IsArray(value) {
37
+ return Array.isArray(value);
38
+ }
39
+ function IsBigInt(value) {
40
+ return typeof value === "bigint";
41
+ }
42
+ function IsBoolean(value) {
43
+ return typeof value === "boolean";
44
+ }
45
+ function IsDate(value) {
46
+ return value instanceof globalThis.Date;
47
+ }
48
+ function IsFunction(value) {
49
+ return typeof value === "function";
50
+ }
51
+ function IsIterator(value) {
52
+ return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.iterator in value;
53
+ }
54
+ function IsNull(value) {
55
+ return value === null;
56
+ }
57
+ function IsNumber(value) {
58
+ return typeof value === "number";
59
+ }
60
+ function IsObject(value) {
61
+ return typeof value === "object" && value !== null;
62
+ }
63
+ function IsRegExp(value) {
64
+ return value instanceof globalThis.RegExp;
65
+ }
66
+ function IsString(value) {
67
+ return typeof value === "string";
68
+ }
69
+ function IsSymbol(value) {
70
+ return typeof value === "symbol";
71
+ }
72
+ function IsUint8Array(value) {
73
+ return value instanceof globalThis.Uint8Array;
74
+ }
75
+ function IsUndefined(value) {
76
+ return value === void 0;
77
+ }
78
+
79
+ // node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs
80
+ function ArrayType(value) {
81
+ return value.map((value2) => Visit(value2));
82
+ }
83
+ function DateType(value) {
84
+ return new Date(value.getTime());
85
+ }
86
+ function Uint8ArrayType(value) {
87
+ return new Uint8Array(value);
88
+ }
89
+ function RegExpType(value) {
90
+ return new RegExp(value.source, value.flags);
91
+ }
92
+ function ObjectType(value) {
93
+ const result = {};
94
+ for (const key of Object.getOwnPropertyNames(value)) {
95
+ result[key] = Visit(value[key]);
96
+ }
97
+ for (const key of Object.getOwnPropertySymbols(value)) {
98
+ result[key] = Visit(value[key]);
99
+ }
100
+ return result;
101
+ }
102
+ function Visit(value) {
103
+ return IsArray(value) ? ArrayType(value) : IsDate(value) ? DateType(value) : IsUint8Array(value) ? Uint8ArrayType(value) : IsRegExp(value) ? RegExpType(value) : IsObject(value) ? ObjectType(value) : value;
104
+ }
105
+ function Clone(value) {
106
+ return Visit(value);
107
+ }
108
+
109
+ // node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
110
+ function CloneRest(schemas) {
111
+ return schemas.map((schema) => CloneType(schema));
112
+ }
113
+ function CloneType(schema, options = {}) {
114
+ return { ...Clone(schema), ...options };
115
+ }
116
+
117
+ // node_modules/@sinclair/typebox/build/esm/type/error/error.mjs
118
+ var TypeBoxError = class extends Error {
119
+ constructor(message) {
120
+ super(message);
121
+ }
122
+ };
123
+
124
+ // node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs
125
+ var TransformKind = Symbol.for("TypeBox.Transform");
126
+ var ReadonlyKind = Symbol.for("TypeBox.Readonly");
127
+ var OptionalKind = Symbol.for("TypeBox.Optional");
128
+ var Hint = Symbol.for("TypeBox.Hint");
129
+ var Kind = Symbol.for("TypeBox.Kind");
130
+
131
+ // node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs
132
+ function IsReadonly(value) {
133
+ return IsObject(value) && value[ReadonlyKind] === "Readonly";
134
+ }
135
+ function IsOptional(value) {
136
+ return IsObject(value) && value[OptionalKind] === "Optional";
137
+ }
138
+ function IsAny(value) {
139
+ return IsKindOf(value, "Any");
140
+ }
141
+ function IsArray2(value) {
142
+ return IsKindOf(value, "Array");
143
+ }
144
+ function IsAsyncIterator2(value) {
145
+ return IsKindOf(value, "AsyncIterator");
146
+ }
147
+ function IsBigInt2(value) {
148
+ return IsKindOf(value, "BigInt");
149
+ }
150
+ function IsBoolean2(value) {
151
+ return IsKindOf(value, "Boolean");
152
+ }
153
+ function IsConstructor(value) {
154
+ return IsKindOf(value, "Constructor");
155
+ }
156
+ function IsDate2(value) {
157
+ return IsKindOf(value, "Date");
158
+ }
159
+ function IsFunction2(value) {
160
+ return IsKindOf(value, "Function");
161
+ }
162
+ function IsInteger(value) {
163
+ return IsKindOf(value, "Integer");
164
+ }
165
+ function IsIntersect(value) {
166
+ return IsKindOf(value, "Intersect");
167
+ }
168
+ function IsIterator2(value) {
169
+ return IsKindOf(value, "Iterator");
170
+ }
171
+ function IsKindOf(value, kind) {
172
+ return IsObject(value) && Kind in value && value[Kind] === kind;
173
+ }
174
+ function IsLiteral(value) {
175
+ return IsKindOf(value, "Literal");
176
+ }
177
+ function IsMappedKey(value) {
178
+ return IsKindOf(value, "MappedKey");
179
+ }
180
+ function IsMappedResult(value) {
181
+ return IsKindOf(value, "MappedResult");
182
+ }
183
+ function IsNever(value) {
184
+ return IsKindOf(value, "Never");
185
+ }
186
+ function IsNot(value) {
187
+ return IsKindOf(value, "Not");
188
+ }
189
+ function IsNull2(value) {
190
+ return IsKindOf(value, "Null");
191
+ }
192
+ function IsNumber2(value) {
193
+ return IsKindOf(value, "Number");
194
+ }
195
+ function IsObject2(value) {
196
+ return IsKindOf(value, "Object");
197
+ }
198
+ function IsPromise(value) {
199
+ return IsKindOf(value, "Promise");
200
+ }
201
+ function IsRecord(value) {
202
+ return IsKindOf(value, "Record");
203
+ }
204
+ function IsRef(value) {
205
+ return IsKindOf(value, "Ref");
206
+ }
207
+ function IsRegExp2(value) {
208
+ return IsKindOf(value, "RegExp");
209
+ }
210
+ function IsString2(value) {
211
+ return IsKindOf(value, "String");
212
+ }
213
+ function IsSymbol2(value) {
214
+ return IsKindOf(value, "Symbol");
215
+ }
216
+ function IsTemplateLiteral(value) {
217
+ return IsKindOf(value, "TemplateLiteral");
218
+ }
219
+ function IsThis(value) {
220
+ return IsKindOf(value, "This");
221
+ }
222
+ function IsTransform(value) {
223
+ return IsObject(value) && TransformKind in value;
224
+ }
225
+ function IsTuple(value) {
226
+ return IsKindOf(value, "Tuple");
227
+ }
228
+ function IsUndefined2(value) {
229
+ return IsKindOf(value, "Undefined");
230
+ }
231
+ function IsUnion(value) {
232
+ return IsKindOf(value, "Union");
233
+ }
234
+ function IsUint8Array2(value) {
235
+ return IsKindOf(value, "Uint8Array");
236
+ }
237
+ function IsUnknown(value) {
238
+ return IsKindOf(value, "Unknown");
239
+ }
240
+ function IsUnsafe(value) {
241
+ return IsKindOf(value, "Unsafe");
242
+ }
243
+ function IsVoid(value) {
244
+ return IsKindOf(value, "Void");
245
+ }
246
+ function IsKind(value) {
247
+ return IsObject(value) && Kind in value && IsString(value[Kind]);
248
+ }
249
+ function IsSchema(value) {
250
+ return IsAny(value) || IsArray2(value) || IsBoolean2(value) || IsBigInt2(value) || IsAsyncIterator2(value) || IsConstructor(value) || IsDate2(value) || IsFunction2(value) || IsInteger(value) || IsIntersect(value) || IsIterator2(value) || IsLiteral(value) || IsMappedKey(value) || IsMappedResult(value) || IsNever(value) || IsNot(value) || IsNull2(value) || IsNumber2(value) || IsObject2(value) || IsPromise(value) || IsRecord(value) || IsRef(value) || IsRegExp2(value) || IsString2(value) || IsSymbol2(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined2(value) || IsUnion(value) || IsUint8Array2(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value);
251
+ }
252
+
253
+ // node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
254
+ var type_exports = {};
255
+ __export(type_exports, {
256
+ IsAny: () => IsAny2,
257
+ IsArray: () => IsArray3,
258
+ IsAsyncIterator: () => IsAsyncIterator3,
259
+ IsBigInt: () => IsBigInt3,
260
+ IsBoolean: () => IsBoolean3,
261
+ IsConstructor: () => IsConstructor2,
262
+ IsDate: () => IsDate3,
263
+ IsFunction: () => IsFunction3,
264
+ IsInteger: () => IsInteger2,
265
+ IsIntersect: () => IsIntersect2,
266
+ IsIterator: () => IsIterator3,
267
+ IsKind: () => IsKind2,
268
+ IsKindOf: () => IsKindOf2,
269
+ IsLiteral: () => IsLiteral2,
270
+ IsLiteralBoolean: () => IsLiteralBoolean,
271
+ IsLiteralNumber: () => IsLiteralNumber,
272
+ IsLiteralString: () => IsLiteralString,
273
+ IsLiteralValue: () => IsLiteralValue,
274
+ IsMappedKey: () => IsMappedKey2,
275
+ IsMappedResult: () => IsMappedResult2,
276
+ IsNever: () => IsNever2,
277
+ IsNot: () => IsNot2,
278
+ IsNull: () => IsNull3,
279
+ IsNumber: () => IsNumber3,
280
+ IsObject: () => IsObject3,
281
+ IsOptional: () => IsOptional2,
282
+ IsPromise: () => IsPromise2,
283
+ IsProperties: () => IsProperties,
284
+ IsReadonly: () => IsReadonly2,
285
+ IsRecord: () => IsRecord2,
286
+ IsRecursive: () => IsRecursive,
287
+ IsRef: () => IsRef2,
288
+ IsRegExp: () => IsRegExp3,
289
+ IsSchema: () => IsSchema2,
290
+ IsString: () => IsString3,
291
+ IsSymbol: () => IsSymbol3,
292
+ IsTemplateLiteral: () => IsTemplateLiteral2,
293
+ IsThis: () => IsThis2,
294
+ IsTransform: () => IsTransform2,
295
+ IsTuple: () => IsTuple2,
296
+ IsUint8Array: () => IsUint8Array3,
297
+ IsUndefined: () => IsUndefined3,
298
+ IsUnion: () => IsUnion2,
299
+ IsUnionLiteral: () => IsUnionLiteral,
300
+ IsUnknown: () => IsUnknown2,
301
+ IsUnsafe: () => IsUnsafe2,
302
+ IsVoid: () => IsVoid2,
303
+ TypeGuardUnknownTypeError: () => TypeGuardUnknownTypeError
304
+ });
305
+ var TypeGuardUnknownTypeError = class extends TypeBoxError {
306
+ };
307
+ var KnownTypes = [
308
+ "Any",
309
+ "Array",
310
+ "AsyncIterator",
311
+ "BigInt",
312
+ "Boolean",
313
+ "Constructor",
314
+ "Date",
315
+ "Enum",
316
+ "Function",
317
+ "Integer",
318
+ "Intersect",
319
+ "Iterator",
320
+ "Literal",
321
+ "MappedKey",
322
+ "MappedResult",
323
+ "Not",
324
+ "Null",
325
+ "Number",
326
+ "Object",
327
+ "Promise",
328
+ "Record",
329
+ "Ref",
330
+ "RegExp",
331
+ "String",
332
+ "Symbol",
333
+ "TemplateLiteral",
334
+ "This",
335
+ "Tuple",
336
+ "Undefined",
337
+ "Union",
338
+ "Uint8Array",
339
+ "Unknown",
340
+ "Void"
341
+ ];
342
+ function IsPattern(value) {
343
+ try {
344
+ new RegExp(value);
345
+ return true;
346
+ } catch {
347
+ return false;
348
+ }
349
+ }
350
+ function IsControlCharacterFree(value) {
351
+ if (!IsString(value))
352
+ return false;
353
+ for (let i = 0; i < value.length; i++) {
354
+ const code = value.charCodeAt(i);
355
+ if (code >= 7 && code <= 13 || code === 27 || code === 127) {
356
+ return false;
357
+ }
358
+ }
359
+ return true;
360
+ }
361
+ function IsAdditionalProperties(value) {
362
+ return IsOptionalBoolean(value) || IsSchema2(value);
363
+ }
364
+ function IsOptionalBigInt(value) {
365
+ return IsUndefined(value) || IsBigInt(value);
366
+ }
367
+ function IsOptionalNumber(value) {
368
+ return IsUndefined(value) || IsNumber(value);
369
+ }
370
+ function IsOptionalBoolean(value) {
371
+ return IsUndefined(value) || IsBoolean(value);
372
+ }
373
+ function IsOptionalString(value) {
374
+ return IsUndefined(value) || IsString(value);
375
+ }
376
+ function IsOptionalPattern(value) {
377
+ return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value) && IsPattern(value);
378
+ }
379
+ function IsOptionalFormat(value) {
380
+ return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value);
381
+ }
382
+ function IsOptionalSchema(value) {
383
+ return IsUndefined(value) || IsSchema2(value);
384
+ }
385
+ function IsReadonly2(value) {
386
+ return IsObject(value) && value[ReadonlyKind] === "Readonly";
387
+ }
388
+ function IsOptional2(value) {
389
+ return IsObject(value) && value[OptionalKind] === "Optional";
390
+ }
391
+ function IsAny2(value) {
392
+ return IsKindOf2(value, "Any") && IsOptionalString(value.$id);
393
+ }
394
+ function IsArray3(value) {
395
+ return IsKindOf2(value, "Array") && value.type === "array" && IsOptionalString(value.$id) && IsSchema2(value.items) && IsOptionalNumber(value.minItems) && IsOptionalNumber(value.maxItems) && IsOptionalBoolean(value.uniqueItems) && IsOptionalSchema(value.contains) && IsOptionalNumber(value.minContains) && IsOptionalNumber(value.maxContains);
396
+ }
397
+ function IsAsyncIterator3(value) {
398
+ return IsKindOf2(value, "AsyncIterator") && value.type === "AsyncIterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
399
+ }
400
+ function IsBigInt3(value) {
401
+ return IsKindOf2(value, "BigInt") && value.type === "bigint" && IsOptionalString(value.$id) && IsOptionalBigInt(value.exclusiveMaximum) && IsOptionalBigInt(value.exclusiveMinimum) && IsOptionalBigInt(value.maximum) && IsOptionalBigInt(value.minimum) && IsOptionalBigInt(value.multipleOf);
402
+ }
403
+ function IsBoolean3(value) {
404
+ return IsKindOf2(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id);
405
+ }
406
+ function IsConstructor2(value) {
407
+ return IsKindOf2(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
408
+ }
409
+ function IsDate3(value) {
410
+ return IsKindOf2(value, "Date") && value.type === "Date" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximumTimestamp) && IsOptionalNumber(value.exclusiveMinimumTimestamp) && IsOptionalNumber(value.maximumTimestamp) && IsOptionalNumber(value.minimumTimestamp) && IsOptionalNumber(value.multipleOfTimestamp);
411
+ }
412
+ function IsFunction3(value) {
413
+ return IsKindOf2(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
414
+ }
415
+ function IsInteger2(value) {
416
+ return IsKindOf2(value, "Integer") && value.type === "integer" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
417
+ }
418
+ function IsProperties(value) {
419
+ return IsObject(value) && Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema2(schema));
420
+ }
421
+ function IsIntersect2(value) {
422
+ return IsKindOf2(value, "Intersect") && (IsString(value.type) && value.type !== "object" ? false : true) && IsArray(value.allOf) && value.allOf.every((schema) => IsSchema2(schema) && !IsTransform2(schema)) && IsOptionalString(value.type) && (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && IsOptionalString(value.$id);
423
+ }
424
+ function IsIterator3(value) {
425
+ return IsKindOf2(value, "Iterator") && value.type === "Iterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
426
+ }
427
+ function IsKindOf2(value, kind) {
428
+ return IsObject(value) && Kind in value && value[Kind] === kind;
429
+ }
430
+ function IsLiteralString(value) {
431
+ return IsLiteral2(value) && IsString(value.const);
432
+ }
433
+ function IsLiteralNumber(value) {
434
+ return IsLiteral2(value) && IsNumber(value.const);
435
+ }
436
+ function IsLiteralBoolean(value) {
437
+ return IsLiteral2(value) && IsBoolean(value.const);
438
+ }
439
+ function IsLiteral2(value) {
440
+ return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue(value.const);
441
+ }
442
+ function IsLiteralValue(value) {
443
+ return IsBoolean(value) || IsNumber(value) || IsString(value);
444
+ }
445
+ function IsMappedKey2(value) {
446
+ return IsKindOf2(value, "MappedKey") && IsArray(value.keys) && value.keys.every((key) => IsNumber(key) || IsString(key));
447
+ }
448
+ function IsMappedResult2(value) {
449
+ return IsKindOf2(value, "MappedResult") && IsProperties(value.properties);
450
+ }
451
+ function IsNever2(value) {
452
+ return IsKindOf2(value, "Never") && IsObject(value.not) && Object.getOwnPropertyNames(value.not).length === 0;
453
+ }
454
+ function IsNot2(value) {
455
+ return IsKindOf2(value, "Not") && IsSchema2(value.not);
456
+ }
457
+ function IsNull3(value) {
458
+ return IsKindOf2(value, "Null") && value.type === "null" && IsOptionalString(value.$id);
459
+ }
460
+ function IsNumber3(value) {
461
+ return IsKindOf2(value, "Number") && value.type === "number" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
462
+ }
463
+ function IsObject3(value) {
464
+ return IsKindOf2(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);
465
+ }
466
+ function IsPromise2(value) {
467
+ return IsKindOf2(value, "Promise") && value.type === "Promise" && IsOptionalString(value.$id) && IsSchema2(value.item);
468
+ }
469
+ function IsRecord2(value) {
470
+ return IsKindOf2(value, "Record") && value.type === "object" && IsOptionalString(value.$id) && IsAdditionalProperties(value.additionalProperties) && IsObject(value.patternProperties) && ((schema) => {
471
+ const keys = Object.getOwnPropertyNames(schema.patternProperties);
472
+ return keys.length === 1 && IsPattern(keys[0]) && IsObject(schema.patternProperties) && IsSchema2(schema.patternProperties[keys[0]]);
473
+ })(value);
474
+ }
475
+ function IsRecursive(value) {
476
+ return IsObject(value) && Hint in value && value[Hint] === "Recursive";
477
+ }
478
+ function IsRef2(value) {
479
+ return IsKindOf2(value, "Ref") && IsOptionalString(value.$id) && IsString(value.$ref);
480
+ }
481
+ function IsRegExp3(value) {
482
+ return IsKindOf2(value, "RegExp") && IsOptionalString(value.$id) && IsString(value.source) && IsString(value.flags) && IsOptionalNumber(value.maxLength) && IsOptionalNumber(value.minLength);
483
+ }
484
+ function IsString3(value) {
485
+ return IsKindOf2(value, "String") && value.type === "string" && IsOptionalString(value.$id) && IsOptionalNumber(value.minLength) && IsOptionalNumber(value.maxLength) && IsOptionalPattern(value.pattern) && IsOptionalFormat(value.format);
486
+ }
487
+ function IsSymbol3(value) {
488
+ return IsKindOf2(value, "Symbol") && value.type === "symbol" && IsOptionalString(value.$id);
489
+ }
490
+ function IsTemplateLiteral2(value) {
491
+ return IsKindOf2(value, "TemplateLiteral") && value.type === "string" && IsString(value.pattern) && value.pattern[0] === "^" && value.pattern[value.pattern.length - 1] === "$";
492
+ }
493
+ function IsThis2(value) {
494
+ return IsKindOf2(value, "This") && IsOptionalString(value.$id) && IsString(value.$ref);
495
+ }
496
+ function IsTransform2(value) {
497
+ return IsObject(value) && TransformKind in value;
498
+ }
499
+ function IsTuple2(value) {
500
+ return IsKindOf2(value, "Tuple") && value.type === "array" && IsOptionalString(value.$id) && IsNumber(value.minItems) && IsNumber(value.maxItems) && value.minItems === value.maxItems && // empty
501
+ (IsUndefined(value.items) && IsUndefined(value.additionalItems) && value.minItems === 0 || IsArray(value.items) && value.items.every((schema) => IsSchema2(schema)));
502
+ }
503
+ function IsUndefined3(value) {
504
+ return IsKindOf2(value, "Undefined") && value.type === "undefined" && IsOptionalString(value.$id);
505
+ }
506
+ function IsUnionLiteral(value) {
507
+ return IsUnion2(value) && value.anyOf.every((schema) => IsLiteralString(schema) || IsLiteralNumber(schema));
508
+ }
509
+ function IsUnion2(value) {
510
+ return IsKindOf2(value, "Union") && IsOptionalString(value.$id) && IsObject(value) && IsArray(value.anyOf) && value.anyOf.every((schema) => IsSchema2(schema));
511
+ }
512
+ function IsUint8Array3(value) {
513
+ return IsKindOf2(value, "Uint8Array") && value.type === "Uint8Array" && IsOptionalString(value.$id) && IsOptionalNumber(value.minByteLength) && IsOptionalNumber(value.maxByteLength);
514
+ }
515
+ function IsUnknown2(value) {
516
+ return IsKindOf2(value, "Unknown") && IsOptionalString(value.$id);
517
+ }
518
+ function IsUnsafe2(value) {
519
+ return IsKindOf2(value, "Unsafe");
520
+ }
521
+ function IsVoid2(value) {
522
+ return IsKindOf2(value, "Void") && value.type === "void" && IsOptionalString(value.$id);
523
+ }
524
+ function IsKind2(value) {
525
+ return IsObject(value) && Kind in value && IsString(value[Kind]) && !KnownTypes.includes(value[Kind]);
526
+ }
527
+ function IsSchema2(value) {
528
+ return IsObject(value) && (IsAny2(value) || IsArray3(value) || IsBoolean3(value) || IsBigInt3(value) || IsAsyncIterator3(value) || IsConstructor2(value) || IsDate3(value) || IsFunction3(value) || IsInteger2(value) || IsIntersect2(value) || IsIterator3(value) || IsLiteral2(value) || IsMappedKey2(value) || IsMappedResult2(value) || IsNever2(value) || IsNot2(value) || IsNull3(value) || IsNumber3(value) || IsObject3(value) || IsPromise2(value) || IsRecord2(value) || IsRef2(value) || IsRegExp3(value) || IsString3(value) || IsSymbol3(value) || IsTemplateLiteral2(value) || IsThis2(value) || IsTuple2(value) || IsUndefined3(value) || IsUnion2(value) || IsUint8Array3(value) || IsUnknown2(value) || IsUnsafe2(value) || IsVoid2(value) || IsKind2(value));
529
+ }
530
+
531
+ // node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs
532
+ var PatternBoolean = "(true|false)";
533
+ var PatternNumber = "(0|[1-9][0-9]*)";
534
+ var PatternString = "(.*)";
535
+ var PatternBooleanExact = `^${PatternBoolean}$`;
536
+ var PatternNumberExact = `^${PatternNumber}$`;
537
+ var PatternStringExact = `^${PatternString}$`;
538
+
539
+ // node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs
540
+ function SetIncludes(T, S) {
541
+ return T.includes(S);
542
+ }
543
+ function SetDistinct(T) {
544
+ return [...new Set(T)];
545
+ }
546
+ function SetIntersect(T, S) {
547
+ return T.filter((L) => S.includes(L));
548
+ }
549
+ function SetIntersectManyResolve(T, Init) {
550
+ return T.reduce((Acc, L) => {
551
+ return SetIntersect(Acc, L);
552
+ }, Init);
553
+ }
554
+ function SetIntersectMany(T) {
555
+ return T.length === 1 ? T[0] : T.length > 1 ? SetIntersectManyResolve(T.slice(1), T[0]) : [];
556
+ }
557
+ function SetUnionMany(T) {
558
+ const Acc = [];
559
+ for (const L of T)
560
+ Acc.push(...L);
561
+ return Acc;
562
+ }
563
+
564
+ // node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
565
+ function Any(options = {}) {
566
+ return { ...options, [Kind]: "Any" };
567
+ }
568
+
569
+ // node_modules/@sinclair/typebox/build/esm/type/array/array.mjs
570
+ function Array2(schema, options = {}) {
571
+ return {
572
+ ...options,
573
+ [Kind]: "Array",
574
+ type: "array",
575
+ items: CloneType(schema)
576
+ };
577
+ }
578
+
579
+ // node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
580
+ function AsyncIterator(items, options = {}) {
581
+ return {
582
+ ...options,
583
+ [Kind]: "AsyncIterator",
584
+ type: "AsyncIterator",
585
+ items: CloneType(items)
586
+ };
587
+ }
588
+
589
+ // node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
590
+ function DiscardKey(value, key) {
591
+ const { [key]: _, ...rest } = value;
592
+ return rest;
593
+ }
594
+ function Discard(value, keys) {
595
+ return keys.reduce((acc, key) => DiscardKey(acc, key), value);
596
+ }
597
+
598
+ // node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
599
+ function Never(options = {}) {
600
+ return {
601
+ ...options,
602
+ [Kind]: "Never",
603
+ not: {}
604
+ };
605
+ }
606
+
607
+ // node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs
608
+ function MappedResult(properties) {
609
+ return {
610
+ [Kind]: "MappedResult",
611
+ properties
612
+ };
613
+ }
614
+
615
+ // node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs
616
+ function Constructor(parameters, returns, options) {
617
+ return {
618
+ ...options,
619
+ [Kind]: "Constructor",
620
+ type: "Constructor",
621
+ parameters: CloneRest(parameters),
622
+ returns: CloneType(returns)
623
+ };
624
+ }
625
+
626
+ // node_modules/@sinclair/typebox/build/esm/type/function/function.mjs
627
+ function Function(parameters, returns, options) {
628
+ return {
629
+ ...options,
630
+ [Kind]: "Function",
631
+ type: "Function",
632
+ parameters: CloneRest(parameters),
633
+ returns: CloneType(returns)
634
+ };
635
+ }
636
+
637
+ // node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs
638
+ function UnionCreate(T, options) {
639
+ return { ...options, [Kind]: "Union", anyOf: CloneRest(T) };
640
+ }
641
+
642
+ // node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs
643
+ function IsUnionOptional(T) {
644
+ return T.some((L) => IsOptional(L));
645
+ }
646
+ function RemoveOptionalFromRest(T) {
647
+ return T.map((L) => IsOptional(L) ? RemoveOptionalFromType(L) : L);
648
+ }
649
+ function RemoveOptionalFromType(T) {
650
+ return Discard(T, [OptionalKind]);
651
+ }
652
+ function ResolveUnion(T, options) {
653
+ return IsUnionOptional(T) ? Optional(UnionCreate(RemoveOptionalFromRest(T), options)) : UnionCreate(RemoveOptionalFromRest(T), options);
654
+ }
655
+ function UnionEvaluated(T, options = {}) {
656
+ return T.length === 0 ? Never(options) : T.length === 1 ? CloneType(T[0], options) : ResolveUnion(T, options);
657
+ }
658
+
659
+ // node_modules/@sinclair/typebox/build/esm/type/union/union.mjs
660
+ function Union(T, options = {}) {
661
+ return T.length === 0 ? Never(options) : T.length === 1 ? CloneType(T[0], options) : UnionCreate(T, options);
662
+ }
663
+
664
+ // node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs
665
+ var TemplateLiteralParserError = class extends TypeBoxError {
666
+ };
667
+ function Unescape(pattern) {
668
+ return pattern.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
669
+ }
670
+ function IsNonEscaped(pattern, index, char) {
671
+ return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92;
672
+ }
673
+ function IsOpenParen(pattern, index) {
674
+ return IsNonEscaped(pattern, index, "(");
675
+ }
676
+ function IsCloseParen(pattern, index) {
677
+ return IsNonEscaped(pattern, index, ")");
678
+ }
679
+ function IsSeparator(pattern, index) {
680
+ return IsNonEscaped(pattern, index, "|");
681
+ }
682
+ function IsGroup(pattern) {
683
+ if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1)))
684
+ return false;
685
+ let count = 0;
686
+ for (let index = 0; index < pattern.length; index++) {
687
+ if (IsOpenParen(pattern, index))
688
+ count += 1;
689
+ if (IsCloseParen(pattern, index))
690
+ count -= 1;
691
+ if (count === 0 && index !== pattern.length - 1)
692
+ return false;
693
+ }
694
+ return true;
695
+ }
696
+ function InGroup(pattern) {
697
+ return pattern.slice(1, pattern.length - 1);
698
+ }
699
+ function IsPrecedenceOr(pattern) {
700
+ let count = 0;
701
+ for (let index = 0; index < pattern.length; index++) {
702
+ if (IsOpenParen(pattern, index))
703
+ count += 1;
704
+ if (IsCloseParen(pattern, index))
705
+ count -= 1;
706
+ if (IsSeparator(pattern, index) && count === 0)
707
+ return true;
708
+ }
709
+ return false;
710
+ }
711
+ function IsPrecedenceAnd(pattern) {
712
+ for (let index = 0; index < pattern.length; index++) {
713
+ if (IsOpenParen(pattern, index))
714
+ return true;
715
+ }
716
+ return false;
717
+ }
718
+ function Or(pattern) {
719
+ let [count, start] = [0, 0];
720
+ const expressions = [];
721
+ for (let index = 0; index < pattern.length; index++) {
722
+ if (IsOpenParen(pattern, index))
723
+ count += 1;
724
+ if (IsCloseParen(pattern, index))
725
+ count -= 1;
726
+ if (IsSeparator(pattern, index) && count === 0) {
727
+ const range2 = pattern.slice(start, index);
728
+ if (range2.length > 0)
729
+ expressions.push(TemplateLiteralParse(range2));
730
+ start = index + 1;
731
+ }
732
+ }
733
+ const range = pattern.slice(start);
734
+ if (range.length > 0)
735
+ expressions.push(TemplateLiteralParse(range));
736
+ if (expressions.length === 0)
737
+ return { type: "const", const: "" };
738
+ if (expressions.length === 1)
739
+ return expressions[0];
740
+ return { type: "or", expr: expressions };
741
+ }
742
+ function And(pattern) {
743
+ function Group(value, index) {
744
+ if (!IsOpenParen(value, index))
745
+ throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`);
746
+ let count = 0;
747
+ for (let scan = index; scan < value.length; scan++) {
748
+ if (IsOpenParen(value, scan))
749
+ count += 1;
750
+ if (IsCloseParen(value, scan))
751
+ count -= 1;
752
+ if (count === 0)
753
+ return [index, scan];
754
+ }
755
+ throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`);
756
+ }
757
+ function Range(pattern2, index) {
758
+ for (let scan = index; scan < pattern2.length; scan++) {
759
+ if (IsOpenParen(pattern2, scan))
760
+ return [index, scan];
761
+ }
762
+ return [index, pattern2.length];
763
+ }
764
+ const expressions = [];
765
+ for (let index = 0; index < pattern.length; index++) {
766
+ if (IsOpenParen(pattern, index)) {
767
+ const [start, end] = Group(pattern, index);
768
+ const range = pattern.slice(start, end + 1);
769
+ expressions.push(TemplateLiteralParse(range));
770
+ index = end;
771
+ } else {
772
+ const [start, end] = Range(pattern, index);
773
+ const range = pattern.slice(start, end);
774
+ if (range.length > 0)
775
+ expressions.push(TemplateLiteralParse(range));
776
+ index = end - 1;
777
+ }
778
+ }
779
+ return expressions.length === 0 ? { type: "const", const: "" } : expressions.length === 1 ? expressions[0] : { type: "and", expr: expressions };
780
+ }
781
+ function TemplateLiteralParse(pattern) {
782
+ return IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : IsPrecedenceOr(pattern) ? Or(pattern) : IsPrecedenceAnd(pattern) ? And(pattern) : { type: "const", const: Unescape(pattern) };
783
+ }
784
+ function TemplateLiteralParseExact(pattern) {
785
+ return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));
786
+ }
787
+
788
+ // node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs
789
+ var TemplateLiteralFiniteError = class extends TypeBoxError {
790
+ };
791
+ function IsNumberExpression(expression) {
792
+ return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "0" && expression.expr[1].type === "const" && expression.expr[1].const === "[1-9][0-9]*";
793
+ }
794
+ function IsBooleanExpression(expression) {
795
+ return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "true" && expression.expr[1].type === "const" && expression.expr[1].const === "false";
796
+ }
797
+ function IsStringExpression(expression) {
798
+ return expression.type === "const" && expression.const === ".*";
799
+ }
800
+ function IsTemplateLiteralExpressionFinite(expression) {
801
+ return IsNumberExpression(expression) || IsStringExpression(expression) ? false : IsBooleanExpression(expression) ? true : expression.type === "and" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "or" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "const" ? true : (() => {
802
+ throw new TemplateLiteralFiniteError(`Unknown expression type`);
803
+ })();
804
+ }
805
+ function IsTemplateLiteralFinite(schema) {
806
+ const expression = TemplateLiteralParseExact(schema.pattern);
807
+ return IsTemplateLiteralExpressionFinite(expression);
808
+ }
809
+
810
+ // node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs
811
+ var TemplateLiteralGenerateError = class extends TypeBoxError {
812
+ };
813
+ function* GenerateReduce(buffer) {
814
+ if (buffer.length === 1)
815
+ return yield* buffer[0];
816
+ for (const left of buffer[0]) {
817
+ for (const right of GenerateReduce(buffer.slice(1))) {
818
+ yield `${left}${right}`;
819
+ }
820
+ }
821
+ }
822
+ function* GenerateAnd(expression) {
823
+ return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)]));
824
+ }
825
+ function* GenerateOr(expression) {
826
+ for (const expr of expression.expr)
827
+ yield* TemplateLiteralExpressionGenerate(expr);
828
+ }
829
+ function* GenerateConst(expression) {
830
+ return yield expression.const;
831
+ }
832
+ function* TemplateLiteralExpressionGenerate(expression) {
833
+ return expression.type === "and" ? yield* GenerateAnd(expression) : expression.type === "or" ? yield* GenerateOr(expression) : expression.type === "const" ? yield* GenerateConst(expression) : (() => {
834
+ throw new TemplateLiteralGenerateError("Unknown expression");
835
+ })();
836
+ }
837
+ function TemplateLiteralGenerate(schema) {
838
+ const expression = TemplateLiteralParseExact(schema.pattern);
839
+ return IsTemplateLiteralExpressionFinite(expression) ? [...TemplateLiteralExpressionGenerate(expression)] : [];
840
+ }
841
+
842
+ // node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs
843
+ function Literal(value, options = {}) {
844
+ return {
845
+ ...options,
846
+ [Kind]: "Literal",
847
+ const: value,
848
+ type: typeof value
849
+ };
850
+ }
851
+
852
+ // node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
853
+ function Boolean(options = {}) {
854
+ return {
855
+ ...options,
856
+ [Kind]: "Boolean",
857
+ type: "boolean"
858
+ };
859
+ }
860
+
861
+ // node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
862
+ function BigInt(options = {}) {
863
+ return {
864
+ ...options,
865
+ [Kind]: "BigInt",
866
+ type: "bigint"
867
+ };
868
+ }
869
+
870
+ // node_modules/@sinclair/typebox/build/esm/type/number/number.mjs
871
+ function Number(options = {}) {
872
+ return {
873
+ ...options,
874
+ [Kind]: "Number",
875
+ type: "number"
876
+ };
877
+ }
878
+
879
+ // node_modules/@sinclair/typebox/build/esm/type/string/string.mjs
880
+ function String(options = {}) {
881
+ return { ...options, [Kind]: "String", type: "string" };
882
+ }
883
+
884
+ // node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
885
+ function* FromUnion(syntax) {
886
+ const trim = syntax.trim().replace(/"|'/g, "");
887
+ return trim === "boolean" ? yield Boolean() : trim === "number" ? yield Number() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String() : yield (() => {
888
+ const literals = trim.split("|").map((literal) => Literal(literal.trim()));
889
+ return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
890
+ })();
891
+ }
892
+ function* FromTerminal(syntax) {
893
+ if (syntax[1] !== "{") {
894
+ const L = Literal("$");
895
+ const R = FromSyntax(syntax.slice(1));
896
+ return yield* [L, ...R];
897
+ }
898
+ for (let i = 2; i < syntax.length; i++) {
899
+ if (syntax[i] === "}") {
900
+ const L = FromUnion(syntax.slice(2, i));
901
+ const R = FromSyntax(syntax.slice(i + 1));
902
+ return yield* [...L, ...R];
903
+ }
904
+ }
905
+ yield Literal(syntax);
906
+ }
907
+ function* FromSyntax(syntax) {
908
+ for (let i = 0; i < syntax.length; i++) {
909
+ if (syntax[i] === "$") {
910
+ const L = Literal(syntax.slice(0, i));
911
+ const R = FromTerminal(syntax.slice(i));
912
+ return yield* [L, ...R];
913
+ }
914
+ }
915
+ yield Literal(syntax);
916
+ }
917
+ function TemplateLiteralSyntax(syntax) {
918
+ return [...FromSyntax(syntax)];
919
+ }
920
+
921
+ // node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs
922
+ var TemplateLiteralPatternError = class extends TypeBoxError {
923
+ };
924
+ function Escape(value) {
925
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
926
+ }
927
+ function Visit2(schema, acc) {
928
+ return IsTemplateLiteral(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : IsUnion(schema) ? `(${schema.anyOf.map((schema2) => Visit2(schema2, acc)).join("|")})` : IsNumber2(schema) ? `${acc}${PatternNumber}` : IsInteger(schema) ? `${acc}${PatternNumber}` : IsBigInt2(schema) ? `${acc}${PatternNumber}` : IsString2(schema) ? `${acc}${PatternString}` : IsLiteral(schema) ? `${acc}${Escape(schema.const.toString())}` : IsBoolean2(schema) ? `${acc}${PatternBoolean}` : (() => {
929
+ throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
930
+ })();
931
+ }
932
+ function TemplateLiteralPattern(kinds) {
933
+ return `^${kinds.map((schema) => Visit2(schema, "")).join("")}$`;
934
+ }
935
+
936
+ // node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs
937
+ function TemplateLiteralToUnion(schema) {
938
+ const R = TemplateLiteralGenerate(schema);
939
+ const L = R.map((S) => Literal(S));
940
+ return UnionEvaluated(L);
941
+ }
942
+
943
+ // node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
944
+ function TemplateLiteral(unresolved, options = {}) {
945
+ const pattern = IsString(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
946
+ return { ...options, [Kind]: "TemplateLiteral", type: "string", pattern };
947
+ }
948
+
949
+ // node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
950
+ function FromTemplateLiteral(T) {
951
+ const R = TemplateLiteralGenerate(T);
952
+ return R.map((S) => S.toString());
953
+ }
954
+ function FromUnion2(T) {
955
+ const Acc = [];
956
+ for (const L of T)
957
+ Acc.push(...IndexPropertyKeys(L));
958
+ return Acc;
959
+ }
960
+ function FromLiteral(T) {
961
+ return [T.toString()];
962
+ }
963
+ function IndexPropertyKeys(T) {
964
+ return [...new Set(IsTemplateLiteral(T) ? FromTemplateLiteral(T) : IsUnion(T) ? FromUnion2(T.anyOf) : IsLiteral(T) ? FromLiteral(T.const) : IsNumber2(T) ? ["[number]"] : IsInteger(T) ? ["[number]"] : [])];
965
+ }
966
+
967
+ // node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
968
+ function FromProperties(T, P, options) {
969
+ const Acc = {};
970
+ for (const K2 of Object.getOwnPropertyNames(P)) {
971
+ Acc[K2] = Index(T, IndexPropertyKeys(P[K2]), options);
972
+ }
973
+ return Acc;
974
+ }
975
+ function FromMappedResult(T, R, options) {
976
+ return FromProperties(T, R.properties, options);
977
+ }
978
+ function IndexFromMappedResult(T, R, options) {
979
+ const P = FromMappedResult(T, R, options);
980
+ return MappedResult(P);
981
+ }
982
+
983
+ // node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
984
+ function FromRest(T, K) {
985
+ return T.map((L) => IndexFromPropertyKey(L, K));
986
+ }
987
+ function FromIntersectRest(T) {
988
+ return T.filter((L) => !IsNever(L));
989
+ }
990
+ function FromIntersect(T, K) {
991
+ return IntersectEvaluated(FromIntersectRest(FromRest(T, K)));
992
+ }
993
+ function FromUnionRest(T) {
994
+ return T.some((L) => IsNever(L)) ? [] : T;
995
+ }
996
+ function FromUnion3(T, K) {
997
+ return UnionEvaluated(FromUnionRest(FromRest(T, K)));
998
+ }
999
+ function FromTuple(T, K) {
1000
+ return K in T ? T[K] : K === "[number]" ? UnionEvaluated(T) : Never();
1001
+ }
1002
+ function FromArray(T, K) {
1003
+ return K === "[number]" ? T : Never();
1004
+ }
1005
+ function FromProperty(T, K) {
1006
+ return K in T ? T[K] : Never();
1007
+ }
1008
+ function IndexFromPropertyKey(T, K) {
1009
+ return IsIntersect(T) ? FromIntersect(T.allOf, K) : IsUnion(T) ? FromUnion3(T.anyOf, K) : IsTuple(T) ? FromTuple(T.items ?? [], K) : IsArray2(T) ? FromArray(T.items, K) : IsObject2(T) ? FromProperty(T.properties, K) : Never();
1010
+ }
1011
+ function IndexFromPropertyKeys(T, K) {
1012
+ return K.map((L) => IndexFromPropertyKey(T, L));
1013
+ }
1014
+ function FromSchema(T, K) {
1015
+ return UnionEvaluated(IndexFromPropertyKeys(T, K));
1016
+ }
1017
+ function Index(T, K, options = {}) {
1018
+ return IsMappedResult(K) ? CloneType(IndexFromMappedResult(T, K, options)) : IsMappedKey(K) ? CloneType(IndexFromMappedKey(T, K, options)) : IsSchema(K) ? CloneType(FromSchema(T, IndexPropertyKeys(K)), options) : CloneType(FromSchema(T, K), options);
1019
+ }
1020
+
1021
+ // node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
1022
+ function MappedIndexPropertyKey(T, K, options) {
1023
+ return { [K]: Index(T, [K], options) };
1024
+ }
1025
+ function MappedIndexPropertyKeys(T, K, options) {
1026
+ return K.reduce((Acc, L) => {
1027
+ return { ...Acc, ...MappedIndexPropertyKey(T, L, options) };
1028
+ }, {});
1029
+ }
1030
+ function MappedIndexProperties(T, K, options) {
1031
+ return MappedIndexPropertyKeys(T, K.keys, options);
1032
+ }
1033
+ function IndexFromMappedKey(T, K, options) {
1034
+ const P = MappedIndexProperties(T, K, options);
1035
+ return MappedResult(P);
1036
+ }
1037
+
1038
+ // node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs
1039
+ function Iterator(items, options = {}) {
1040
+ return {
1041
+ ...options,
1042
+ [Kind]: "Iterator",
1043
+ type: "Iterator",
1044
+ items: CloneType(items)
1045
+ };
1046
+ }
1047
+
1048
+ // node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
1049
+ function _Object(properties, options = {}) {
1050
+ const propertyKeys = globalThis.Object.getOwnPropertyNames(properties);
1051
+ const optionalKeys = propertyKeys.filter((key) => IsOptional(properties[key]));
1052
+ const requiredKeys = propertyKeys.filter((name) => !optionalKeys.includes(name));
1053
+ const clonedAdditionalProperties = IsSchema(options.additionalProperties) ? { additionalProperties: CloneType(options.additionalProperties) } : {};
1054
+ const clonedProperties = {};
1055
+ for (const key of propertyKeys)
1056
+ clonedProperties[key] = CloneType(properties[key]);
1057
+ return requiredKeys.length > 0 ? { ...options, ...clonedAdditionalProperties, [Kind]: "Object", type: "object", properties: clonedProperties, required: requiredKeys } : { ...options, ...clonedAdditionalProperties, [Kind]: "Object", type: "object", properties: clonedProperties };
1058
+ }
1059
+ var Object2 = _Object;
1060
+
1061
+ // node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs
1062
+ function Promise2(item, options = {}) {
1063
+ return {
1064
+ ...options,
1065
+ [Kind]: "Promise",
1066
+ type: "Promise",
1067
+ item: CloneType(item)
1068
+ };
1069
+ }
1070
+
1071
+ // node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs
1072
+ function RemoveReadonly(schema) {
1073
+ return Discard(CloneType(schema), [ReadonlyKind]);
1074
+ }
1075
+ function AddReadonly(schema) {
1076
+ return { ...CloneType(schema), [ReadonlyKind]: "Readonly" };
1077
+ }
1078
+ function ReadonlyWithFlag(schema, F) {
1079
+ return F === false ? RemoveReadonly(schema) : AddReadonly(schema);
1080
+ }
1081
+ function Readonly(schema, enable) {
1082
+ const F = enable ?? true;
1083
+ return IsMappedResult(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F);
1084
+ }
1085
+
1086
+ // node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs
1087
+ function FromProperties2(K, F) {
1088
+ const Acc = {};
1089
+ for (const K2 of globalThis.Object.getOwnPropertyNames(K))
1090
+ Acc[K2] = Readonly(K[K2], F);
1091
+ return Acc;
1092
+ }
1093
+ function FromMappedResult2(R, F) {
1094
+ return FromProperties2(R.properties, F);
1095
+ }
1096
+ function ReadonlyFromMappedResult(R, F) {
1097
+ const P = FromMappedResult2(R, F);
1098
+ return MappedResult(P);
1099
+ }
1100
+
1101
+ // node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs
1102
+ function Tuple(items, options = {}) {
1103
+ const [additionalItems, minItems, maxItems] = [false, items.length, items.length];
1104
+ return items.length > 0 ? { ...options, [Kind]: "Tuple", type: "array", items: CloneRest(items), additionalItems, minItems, maxItems } : { ...options, [Kind]: "Tuple", type: "array", minItems, maxItems };
1105
+ }
1106
+
1107
+ // node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs
1108
+ function FromMappedResult3(K, P) {
1109
+ return K in P ? FromSchemaType(K, P[K]) : MappedResult(P);
1110
+ }
1111
+ function MappedKeyToKnownMappedResultProperties(K) {
1112
+ return { [K]: Literal(K) };
1113
+ }
1114
+ function MappedKeyToUnknownMappedResultProperties(P) {
1115
+ const Acc = {};
1116
+ for (const L of P)
1117
+ Acc[L] = Literal(L);
1118
+ return Acc;
1119
+ }
1120
+ function MappedKeyToMappedResultProperties(K, P) {
1121
+ return SetIncludes(P, K) ? MappedKeyToKnownMappedResultProperties(K) : MappedKeyToUnknownMappedResultProperties(P);
1122
+ }
1123
+ function FromMappedKey(K, P) {
1124
+ const R = MappedKeyToMappedResultProperties(K, P);
1125
+ return FromMappedResult3(K, R);
1126
+ }
1127
+ function FromRest2(K, T) {
1128
+ return T.map((L) => FromSchemaType(K, L));
1129
+ }
1130
+ function FromProperties3(K, T) {
1131
+ const Acc = {};
1132
+ for (const K2 of globalThis.Object.getOwnPropertyNames(T))
1133
+ Acc[K2] = FromSchemaType(K, T[K2]);
1134
+ return Acc;
1135
+ }
1136
+ function FromSchemaType(K, T) {
1137
+ return (
1138
+ // unevaluated modifier types
1139
+ IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : (
1140
+ // unevaluated mapped types
1141
+ IsMappedResult(T) ? FromMappedResult3(K, T.properties) : IsMappedKey(T) ? FromMappedKey(K, T.keys) : (
1142
+ // unevaluated types
1143
+ IsConstructor(T) ? Constructor(FromRest2(K, T.parameters), FromSchemaType(K, T.returns)) : IsFunction2(T) ? Function(FromRest2(K, T.parameters), FromSchemaType(K, T.returns)) : IsAsyncIterator2(T) ? AsyncIterator(FromSchemaType(K, T.items)) : IsIterator2(T) ? Iterator(FromSchemaType(K, T.items)) : IsIntersect(T) ? Intersect(FromRest2(K, T.allOf)) : IsUnion(T) ? Union(FromRest2(K, T.anyOf)) : IsTuple(T) ? Tuple(FromRest2(K, T.items ?? [])) : IsObject2(T) ? Object2(FromProperties3(K, T.properties)) : IsArray2(T) ? Array2(FromSchemaType(K, T.items)) : IsPromise(T) ? Promise2(FromSchemaType(K, T.item)) : T
1144
+ )
1145
+ )
1146
+ );
1147
+ }
1148
+ function MappedFunctionReturnType(K, T) {
1149
+ const Acc = {};
1150
+ for (const L of K)
1151
+ Acc[L] = FromSchemaType(L, T);
1152
+ return Acc;
1153
+ }
1154
+ function Mapped(key, map, options = {}) {
1155
+ const K = IsSchema(key) ? IndexPropertyKeys(key) : key;
1156
+ const RT = map({ [Kind]: "MappedKey", keys: K });
1157
+ const R = MappedFunctionReturnType(K, RT);
1158
+ return CloneType(Object2(R), options);
1159
+ }
1160
+
1161
+ // node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
1162
+ function RemoveOptional(schema) {
1163
+ return Discard(CloneType(schema), [OptionalKind]);
1164
+ }
1165
+ function AddOptional(schema) {
1166
+ return { ...CloneType(schema), [OptionalKind]: "Optional" };
1167
+ }
1168
+ function OptionalWithFlag(schema, F) {
1169
+ return F === false ? RemoveOptional(schema) : AddOptional(schema);
1170
+ }
1171
+ function Optional(schema, enable) {
1172
+ const F = enable ?? true;
1173
+ return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);
1174
+ }
1175
+
1176
+ // node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs
1177
+ function FromProperties4(P, F) {
1178
+ const Acc = {};
1179
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1180
+ Acc[K2] = Optional(P[K2], F);
1181
+ return Acc;
1182
+ }
1183
+ function FromMappedResult4(R, F) {
1184
+ return FromProperties4(R.properties, F);
1185
+ }
1186
+ function OptionalFromMappedResult(R, F) {
1187
+ const P = FromMappedResult4(R, F);
1188
+ return MappedResult(P);
1189
+ }
1190
+
1191
+ // node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs
1192
+ function IntersectCreate(T, options) {
1193
+ const allObjects = T.every((schema) => IsObject2(schema));
1194
+ const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: CloneType(options.unevaluatedProperties) } : {};
1195
+ return options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...options, ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: CloneRest(T) } : { ...options, ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: CloneRest(T) };
1196
+ }
1197
+
1198
+ // node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs
1199
+ function IsIntersectOptional(T) {
1200
+ return T.every((L) => IsOptional(L));
1201
+ }
1202
+ function RemoveOptionalFromType2(T) {
1203
+ return Discard(T, [OptionalKind]);
1204
+ }
1205
+ function RemoveOptionalFromRest2(T) {
1206
+ return T.map((L) => IsOptional(L) ? RemoveOptionalFromType2(L) : L);
1207
+ }
1208
+ function ResolveIntersect(T, options) {
1209
+ return IsIntersectOptional(T) ? Optional(IntersectCreate(RemoveOptionalFromRest2(T), options)) : IntersectCreate(RemoveOptionalFromRest2(T), options);
1210
+ }
1211
+ function IntersectEvaluated(T, options = {}) {
1212
+ if (T.length === 0)
1213
+ return Never(options);
1214
+ if (T.length === 1)
1215
+ return CloneType(T[0], options);
1216
+ if (T.some((schema) => IsTransform(schema)))
1217
+ throw new Error("Cannot intersect transform types");
1218
+ return ResolveIntersect(T, options);
1219
+ }
1220
+
1221
+ // node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs
1222
+ function Intersect(T, options = {}) {
1223
+ if (T.length === 0)
1224
+ return Never(options);
1225
+ if (T.length === 1)
1226
+ return CloneType(T[0], options);
1227
+ if (T.some((schema) => IsTransform(schema)))
1228
+ throw new Error("Cannot intersect transform types");
1229
+ return IntersectCreate(T, options);
1230
+ }
1231
+
1232
+ // node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
1233
+ function FromRest3(T) {
1234
+ return T.map((L) => AwaitedResolve(L));
1235
+ }
1236
+ function FromIntersect2(T) {
1237
+ return Intersect(FromRest3(T));
1238
+ }
1239
+ function FromUnion4(T) {
1240
+ return Union(FromRest3(T));
1241
+ }
1242
+ function FromPromise(T) {
1243
+ return AwaitedResolve(T);
1244
+ }
1245
+ function AwaitedResolve(T) {
1246
+ return IsIntersect(T) ? FromIntersect2(T.allOf) : IsUnion(T) ? FromUnion4(T.anyOf) : IsPromise(T) ? FromPromise(T.item) : T;
1247
+ }
1248
+ function Awaited(T, options = {}) {
1249
+ return CloneType(AwaitedResolve(T), options);
1250
+ }
1251
+
1252
+ // node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs
1253
+ function FromRest4(T) {
1254
+ const Acc = [];
1255
+ for (const L of T)
1256
+ Acc.push(KeyOfPropertyKeys(L));
1257
+ return Acc;
1258
+ }
1259
+ function FromIntersect3(T) {
1260
+ const C = FromRest4(T);
1261
+ const R = SetUnionMany(C);
1262
+ return R;
1263
+ }
1264
+ function FromUnion5(T) {
1265
+ const C = FromRest4(T);
1266
+ const R = SetIntersectMany(C);
1267
+ return R;
1268
+ }
1269
+ function FromTuple2(T) {
1270
+ return T.map((_, I) => I.toString());
1271
+ }
1272
+ function FromArray2(_) {
1273
+ return ["[number]"];
1274
+ }
1275
+ function FromProperties5(T) {
1276
+ return globalThis.Object.getOwnPropertyNames(T);
1277
+ }
1278
+ function FromPatternProperties(patternProperties) {
1279
+ if (!includePatternProperties)
1280
+ return [];
1281
+ const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties);
1282
+ return patternPropertyKeys.map((key) => {
1283
+ return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
1284
+ });
1285
+ }
1286
+ function KeyOfPropertyKeys(T) {
1287
+ return IsIntersect(T) ? FromIntersect3(T.allOf) : IsUnion(T) ? FromUnion5(T.anyOf) : IsTuple(T) ? FromTuple2(T.items ?? []) : IsArray2(T) ? FromArray2(T.items) : IsObject2(T) ? FromProperties5(T.properties) : IsRecord(T) ? FromPatternProperties(T.patternProperties) : [];
1288
+ }
1289
+ var includePatternProperties = false;
1290
+
1291
+ // node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
1292
+ function KeyOfPropertyKeysToRest(T) {
1293
+ return T.map((L) => L === "[number]" ? Number() : Literal(L));
1294
+ }
1295
+ function KeyOf(T, options = {}) {
1296
+ if (IsMappedResult(T)) {
1297
+ return KeyOfFromMappedResult(T, options);
1298
+ } else {
1299
+ const K = KeyOfPropertyKeys(T);
1300
+ const S = KeyOfPropertyKeysToRest(K);
1301
+ const U = UnionEvaluated(S);
1302
+ return CloneType(U, options);
1303
+ }
1304
+ }
1305
+
1306
+ // node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs
1307
+ function FromProperties6(K, options) {
1308
+ const Acc = {};
1309
+ for (const K2 of globalThis.Object.getOwnPropertyNames(K))
1310
+ Acc[K2] = KeyOf(K[K2], options);
1311
+ return Acc;
1312
+ }
1313
+ function FromMappedResult5(R, options) {
1314
+ return FromProperties6(R.properties, options);
1315
+ }
1316
+ function KeyOfFromMappedResult(R, options) {
1317
+ const P = FromMappedResult5(R, options);
1318
+ return MappedResult(P);
1319
+ }
1320
+
1321
+ // node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
1322
+ function CompositeKeys(T) {
1323
+ const Acc = [];
1324
+ for (const L of T)
1325
+ Acc.push(...KeyOfPropertyKeys(L));
1326
+ return SetDistinct(Acc);
1327
+ }
1328
+ function FilterNever(T) {
1329
+ return T.filter((L) => !IsNever(L));
1330
+ }
1331
+ function CompositeProperty(T, K) {
1332
+ const Acc = [];
1333
+ for (const L of T)
1334
+ Acc.push(...IndexFromPropertyKeys(L, [K]));
1335
+ return FilterNever(Acc);
1336
+ }
1337
+ function CompositeProperties(T, K) {
1338
+ const Acc = {};
1339
+ for (const L of K) {
1340
+ Acc[L] = IntersectEvaluated(CompositeProperty(T, L));
1341
+ }
1342
+ return Acc;
1343
+ }
1344
+ function Composite(T, options = {}) {
1345
+ const K = CompositeKeys(T);
1346
+ const P = CompositeProperties(T, K);
1347
+ const R = Object2(P, options);
1348
+ return R;
1349
+ }
1350
+
1351
+ // node_modules/@sinclair/typebox/build/esm/type/date/date.mjs
1352
+ function Date2(options = {}) {
1353
+ return {
1354
+ ...options,
1355
+ [Kind]: "Date",
1356
+ type: "Date"
1357
+ };
1358
+ }
1359
+
1360
+ // node_modules/@sinclair/typebox/build/esm/type/null/null.mjs
1361
+ function Null(options = {}) {
1362
+ return {
1363
+ ...options,
1364
+ [Kind]: "Null",
1365
+ type: "null"
1366
+ };
1367
+ }
1368
+
1369
+ // node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs
1370
+ function Symbol2(options) {
1371
+ return { ...options, [Kind]: "Symbol", type: "symbol" };
1372
+ }
1373
+
1374
+ // node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs
1375
+ function Undefined(options = {}) {
1376
+ return { ...options, [Kind]: "Undefined", type: "undefined" };
1377
+ }
1378
+
1379
+ // node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs
1380
+ function Uint8Array2(options = {}) {
1381
+ return { ...options, [Kind]: "Uint8Array", type: "Uint8Array" };
1382
+ }
1383
+
1384
+ // node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs
1385
+ function Unknown(options = {}) {
1386
+ return {
1387
+ ...options,
1388
+ [Kind]: "Unknown"
1389
+ };
1390
+ }
1391
+
1392
+ // node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
1393
+ function FromArray3(T) {
1394
+ return T.map((L) => FromValue(L, false));
1395
+ }
1396
+ function FromProperties7(value) {
1397
+ const Acc = {};
1398
+ for (const K of globalThis.Object.getOwnPropertyNames(value))
1399
+ Acc[K] = Readonly(FromValue(value[K], false));
1400
+ return Acc;
1401
+ }
1402
+ function ConditionalReadonly(T, root) {
1403
+ return root === true ? T : Readonly(T);
1404
+ }
1405
+ function FromValue(value, root) {
1406
+ return IsAsyncIterator(value) ? ConditionalReadonly(Any(), root) : IsIterator(value) ? ConditionalReadonly(Any(), root) : IsArray(value) ? Readonly(Tuple(FromArray3(value))) : IsUint8Array(value) ? Uint8Array2() : IsDate(value) ? Date2() : IsObject(value) ? ConditionalReadonly(Object2(FromProperties7(value)), root) : IsFunction(value) ? ConditionalReadonly(Function([], Unknown()), root) : IsUndefined(value) ? Undefined() : IsNull(value) ? Null() : IsSymbol(value) ? Symbol2() : IsBigInt(value) ? BigInt() : IsNumber(value) ? Literal(value) : IsBoolean(value) ? Literal(value) : IsString(value) ? Literal(value) : Object2({});
1407
+ }
1408
+ function Const(T, options = {}) {
1409
+ return CloneType(FromValue(T, true), options);
1410
+ }
1411
+
1412
+ // node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
1413
+ function ConstructorParameters(schema, options = {}) {
1414
+ return Tuple(CloneRest(schema.parameters), { ...options });
1415
+ }
1416
+
1417
+ // node_modules/@sinclair/typebox/build/esm/type/deref/deref.mjs
1418
+ function FromRest5(schema, references) {
1419
+ return schema.map((schema2) => Deref(schema2, references));
1420
+ }
1421
+ function FromProperties8(properties, references) {
1422
+ const Acc = {};
1423
+ for (const K of globalThis.Object.getOwnPropertyNames(properties)) {
1424
+ Acc[K] = Deref(properties[K], references);
1425
+ }
1426
+ return Acc;
1427
+ }
1428
+ function FromConstructor(schema, references) {
1429
+ schema.parameters = FromRest5(schema.parameters, references);
1430
+ schema.returns = Deref(schema.returns, references);
1431
+ return schema;
1432
+ }
1433
+ function FromFunction(schema, references) {
1434
+ schema.parameters = FromRest5(schema.parameters, references);
1435
+ schema.returns = Deref(schema.returns, references);
1436
+ return schema;
1437
+ }
1438
+ function FromIntersect4(schema, references) {
1439
+ schema.allOf = FromRest5(schema.allOf, references);
1440
+ return schema;
1441
+ }
1442
+ function FromUnion6(schema, references) {
1443
+ schema.anyOf = FromRest5(schema.anyOf, references);
1444
+ return schema;
1445
+ }
1446
+ function FromTuple3(schema, references) {
1447
+ if (IsUndefined(schema.items))
1448
+ return schema;
1449
+ schema.items = FromRest5(schema.items, references);
1450
+ return schema;
1451
+ }
1452
+ function FromArray4(schema, references) {
1453
+ schema.items = Deref(schema.items, references);
1454
+ return schema;
1455
+ }
1456
+ function FromObject(schema, references) {
1457
+ schema.properties = FromProperties8(schema.properties, references);
1458
+ return schema;
1459
+ }
1460
+ function FromPromise2(schema, references) {
1461
+ schema.item = Deref(schema.item, references);
1462
+ return schema;
1463
+ }
1464
+ function FromAsyncIterator(schema, references) {
1465
+ schema.items = Deref(schema.items, references);
1466
+ return schema;
1467
+ }
1468
+ function FromIterator(schema, references) {
1469
+ schema.items = Deref(schema.items, references);
1470
+ return schema;
1471
+ }
1472
+ function FromRef(schema, references) {
1473
+ const target = references.find((remote) => remote.$id === schema.$ref);
1474
+ if (target === void 0)
1475
+ throw Error(`Unable to dereference schema with $id ${schema.$ref}`);
1476
+ const discard = Discard(target, ["$id"]);
1477
+ return Deref(discard, references);
1478
+ }
1479
+ function DerefResolve(schema, references) {
1480
+ return IsConstructor(schema) ? FromConstructor(schema, references) : IsFunction2(schema) ? FromFunction(schema, references) : IsIntersect(schema) ? FromIntersect4(schema, references) : IsUnion(schema) ? FromUnion6(schema, references) : IsTuple(schema) ? FromTuple3(schema, references) : IsArray2(schema) ? FromArray4(schema, references) : IsObject2(schema) ? FromObject(schema, references) : IsPromise(schema) ? FromPromise2(schema, references) : IsAsyncIterator2(schema) ? FromAsyncIterator(schema, references) : IsIterator2(schema) ? FromIterator(schema, references) : IsRef(schema) ? FromRef(schema, references) : schema;
1481
+ }
1482
+ function Deref(schema, references) {
1483
+ return DerefResolve(CloneType(schema), CloneRest(references));
1484
+ }
1485
+
1486
+ // node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
1487
+ function Enum(item, options = {}) {
1488
+ if (IsUndefined(item))
1489
+ throw new Error("Enum undefined or empty");
1490
+ const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
1491
+ const values2 = [...new Set(values1)];
1492
+ const anyOf = values2.map((value) => Literal(value));
1493
+ return Union(anyOf, { ...options, [Hint]: "Enum" });
1494
+ }
1495
+
1496
+ // node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs
1497
+ var ExtendsResolverError = class extends TypeBoxError {
1498
+ };
1499
+ var ExtendsResult;
1500
+ (function(ExtendsResult2) {
1501
+ ExtendsResult2[ExtendsResult2["Union"] = 0] = "Union";
1502
+ ExtendsResult2[ExtendsResult2["True"] = 1] = "True";
1503
+ ExtendsResult2[ExtendsResult2["False"] = 2] = "False";
1504
+ })(ExtendsResult || (ExtendsResult = {}));
1505
+ function IntoBooleanResult(result) {
1506
+ return result === ExtendsResult.False ? result : ExtendsResult.True;
1507
+ }
1508
+ function Throw(message) {
1509
+ throw new ExtendsResolverError(message);
1510
+ }
1511
+ function IsStructuralRight(right) {
1512
+ return type_exports.IsNever(right) || type_exports.IsIntersect(right) || type_exports.IsUnion(right) || type_exports.IsUnknown(right) || type_exports.IsAny(right);
1513
+ }
1514
+ function StructuralRight(left, right) {
1515
+ return type_exports.IsNever(right) ? FromNeverRight(left, right) : type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) ? FromUnionRight(left, right) : type_exports.IsUnknown(right) ? FromUnknownRight(left, right) : type_exports.IsAny(right) ? FromAnyRight(left, right) : Throw("StructuralRight");
1516
+ }
1517
+ function FromAnyRight(left, right) {
1518
+ return ExtendsResult.True;
1519
+ }
1520
+ function FromAny(left, right) {
1521
+ return type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) && right.anyOf.some((schema) => type_exports.IsAny(schema) || type_exports.IsUnknown(schema)) ? ExtendsResult.True : type_exports.IsUnion(right) ? ExtendsResult.Union : type_exports.IsUnknown(right) ? ExtendsResult.True : type_exports.IsAny(right) ? ExtendsResult.True : ExtendsResult.Union;
1522
+ }
1523
+ function FromArrayRight(left, right) {
1524
+ return type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : type_exports.IsNever(left) ? ExtendsResult.True : ExtendsResult.False;
1525
+ }
1526
+ function FromArray5(left, right) {
1527
+ return type_exports.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsArray(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
1528
+ }
1529
+ function FromAsyncIterator2(left, right) {
1530
+ return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsAsyncIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
1531
+ }
1532
+ function FromBigInt(left, right) {
1533
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsBigInt(right) ? ExtendsResult.True : ExtendsResult.False;
1534
+ }
1535
+ function FromBooleanRight(left, right) {
1536
+ return type_exports.IsLiteralBoolean(left) ? ExtendsResult.True : type_exports.IsBoolean(left) ? ExtendsResult.True : ExtendsResult.False;
1537
+ }
1538
+ function FromBoolean(left, right) {
1539
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsBoolean(right) ? ExtendsResult.True : ExtendsResult.False;
1540
+ }
1541
+ function FromConstructor2(left, right) {
1542
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsConstructor(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit3(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.returns, right.returns));
1543
+ }
1544
+ function FromDate(left, right) {
1545
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsDate(right) ? ExtendsResult.True : ExtendsResult.False;
1546
+ }
1547
+ function FromFunction2(left, right) {
1548
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsFunction(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit3(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.returns, right.returns));
1549
+ }
1550
+ function FromIntegerRight(left, right) {
1551
+ return type_exports.IsLiteral(left) && value_exports.IsNumber(left.const) ? ExtendsResult.True : type_exports.IsNumber(left) || type_exports.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
1552
+ }
1553
+ function FromInteger(left, right) {
1554
+ return type_exports.IsInteger(right) || type_exports.IsNumber(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : ExtendsResult.False;
1555
+ }
1556
+ function FromIntersectRight(left, right) {
1557
+ return right.allOf.every((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1558
+ }
1559
+ function FromIntersect5(left, right) {
1560
+ return left.allOf.some((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1561
+ }
1562
+ function FromIterator2(left, right) {
1563
+ return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
1564
+ }
1565
+ function FromLiteral2(left, right) {
1566
+ return type_exports.IsLiteral(right) && right.const === left.const ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsString(right) ? FromStringRight(left, right) : type_exports.IsNumber(right) ? FromNumberRight(left, right) : type_exports.IsInteger(right) ? FromIntegerRight(left, right) : type_exports.IsBoolean(right) ? FromBooleanRight(left, right) : ExtendsResult.False;
1567
+ }
1568
+ function FromNeverRight(left, right) {
1569
+ return ExtendsResult.False;
1570
+ }
1571
+ function FromNever(left, right) {
1572
+ return ExtendsResult.True;
1573
+ }
1574
+ function UnwrapTNot(schema) {
1575
+ let [current, depth] = [schema, 0];
1576
+ while (true) {
1577
+ if (!type_exports.IsNot(current))
1578
+ break;
1579
+ current = current.not;
1580
+ depth += 1;
1581
+ }
1582
+ return depth % 2 === 0 ? current : Unknown();
1583
+ }
1584
+ function FromNot(left, right) {
1585
+ return type_exports.IsNot(left) ? Visit3(UnwrapTNot(left), right) : type_exports.IsNot(right) ? Visit3(left, UnwrapTNot(right)) : Throw("Invalid fallthrough for Not");
1586
+ }
1587
+ function FromNull(left, right) {
1588
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsNull(right) ? ExtendsResult.True : ExtendsResult.False;
1589
+ }
1590
+ function FromNumberRight(left, right) {
1591
+ return type_exports.IsLiteralNumber(left) ? ExtendsResult.True : type_exports.IsNumber(left) || type_exports.IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
1592
+ }
1593
+ function FromNumber(left, right) {
1594
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsInteger(right) || type_exports.IsNumber(right) ? ExtendsResult.True : ExtendsResult.False;
1595
+ }
1596
+ function IsObjectPropertyCount(schema, count) {
1597
+ return Object.getOwnPropertyNames(schema.properties).length === count;
1598
+ }
1599
+ function IsObjectStringLike(schema) {
1600
+ return IsObjectArrayLike(schema);
1601
+ }
1602
+ function IsObjectSymbolLike(schema) {
1603
+ return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "description" in schema.properties && type_exports.IsUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && (type_exports.IsString(schema.properties.description.anyOf[0]) && type_exports.IsUndefined(schema.properties.description.anyOf[1]) || type_exports.IsString(schema.properties.description.anyOf[1]) && type_exports.IsUndefined(schema.properties.description.anyOf[0]));
1604
+ }
1605
+ function IsObjectNumberLike(schema) {
1606
+ return IsObjectPropertyCount(schema, 0);
1607
+ }
1608
+ function IsObjectBooleanLike(schema) {
1609
+ return IsObjectPropertyCount(schema, 0);
1610
+ }
1611
+ function IsObjectBigIntLike(schema) {
1612
+ return IsObjectPropertyCount(schema, 0);
1613
+ }
1614
+ function IsObjectDateLike(schema) {
1615
+ return IsObjectPropertyCount(schema, 0);
1616
+ }
1617
+ function IsObjectUint8ArrayLike(schema) {
1618
+ return IsObjectArrayLike(schema);
1619
+ }
1620
+ function IsObjectFunctionLike(schema) {
1621
+ const length = Number();
1622
+ return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
1623
+ }
1624
+ function IsObjectConstructorLike(schema) {
1625
+ return IsObjectPropertyCount(schema, 0);
1626
+ }
1627
+ function IsObjectArrayLike(schema) {
1628
+ const length = Number();
1629
+ return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
1630
+ }
1631
+ function IsObjectPromiseLike(schema) {
1632
+ const then = Function([Any()], Any());
1633
+ return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "then" in schema.properties && IntoBooleanResult(Visit3(schema.properties["then"], then)) === ExtendsResult.True;
1634
+ }
1635
+ function Property(left, right) {
1636
+ return Visit3(left, right) === ExtendsResult.False ? ExtendsResult.False : type_exports.IsOptional(left) && !type_exports.IsOptional(right) ? ExtendsResult.False : ExtendsResult.True;
1637
+ }
1638
+ function FromObjectRight(left, right) {
1639
+ return type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : type_exports.IsNever(left) || type_exports.IsLiteralString(left) && IsObjectStringLike(right) || type_exports.IsLiteralNumber(left) && IsObjectNumberLike(right) || type_exports.IsLiteralBoolean(left) && IsObjectBooleanLike(right) || type_exports.IsSymbol(left) && IsObjectSymbolLike(right) || type_exports.IsBigInt(left) && IsObjectBigIntLike(right) || type_exports.IsString(left) && IsObjectStringLike(right) || type_exports.IsSymbol(left) && IsObjectSymbolLike(right) || type_exports.IsNumber(left) && IsObjectNumberLike(right) || type_exports.IsInteger(left) && IsObjectNumberLike(right) || type_exports.IsBoolean(left) && IsObjectBooleanLike(right) || type_exports.IsUint8Array(left) && IsObjectUint8ArrayLike(right) || type_exports.IsDate(left) && IsObjectDateLike(right) || type_exports.IsConstructor(left) && IsObjectConstructorLike(right) || type_exports.IsFunction(left) && IsObjectFunctionLike(right) ? ExtendsResult.True : type_exports.IsRecord(left) && type_exports.IsString(RecordKey(left)) ? (() => {
1640
+ return right[Hint] === "Record" ? ExtendsResult.True : ExtendsResult.False;
1641
+ })() : type_exports.IsRecord(left) && type_exports.IsNumber(RecordKey(left)) ? (() => {
1642
+ return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False;
1643
+ })() : ExtendsResult.False;
1644
+ }
1645
+ function FromObject2(left, right) {
1646
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : !type_exports.IsObject(right) ? ExtendsResult.False : (() => {
1647
+ for (const key of Object.getOwnPropertyNames(right.properties)) {
1648
+ if (!(key in left.properties) && !type_exports.IsOptional(right.properties[key])) {
1649
+ return ExtendsResult.False;
1650
+ }
1651
+ if (type_exports.IsOptional(right.properties[key])) {
1652
+ return ExtendsResult.True;
1653
+ }
1654
+ if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) {
1655
+ return ExtendsResult.False;
1656
+ }
1657
+ }
1658
+ return ExtendsResult.True;
1659
+ })();
1660
+ }
1661
+ function FromPromise3(left, right) {
1662
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) && IsObjectPromiseLike(right) ? ExtendsResult.True : !type_exports.IsPromise(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.item, right.item));
1663
+ }
1664
+ function RecordKey(schema) {
1665
+ return PatternNumberExact in schema.patternProperties ? Number() : PatternStringExact in schema.patternProperties ? String() : Throw("Unknown record key pattern");
1666
+ }
1667
+ function RecordValue(schema) {
1668
+ return PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] : PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] : Throw("Unable to get record value schema");
1669
+ }
1670
+ function FromRecordRight(left, right) {
1671
+ const [Key, Value] = [RecordKey(right), RecordValue(right)];
1672
+ return type_exports.IsLiteralString(left) && type_exports.IsNumber(Key) && IntoBooleanResult(Visit3(left, Value)) === ExtendsResult.True ? ExtendsResult.True : type_exports.IsUint8Array(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsString(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsArray(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsObject(left) ? (() => {
1673
+ for (const key of Object.getOwnPropertyNames(left.properties)) {
1674
+ if (Property(Value, left.properties[key]) === ExtendsResult.False) {
1675
+ return ExtendsResult.False;
1676
+ }
1677
+ }
1678
+ return ExtendsResult.True;
1679
+ })() : ExtendsResult.False;
1680
+ }
1681
+ function FromRecord(left, right) {
1682
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsRecord(right) ? ExtendsResult.False : Visit3(RecordValue(left), RecordValue(right));
1683
+ }
1684
+ function FromRegExp(left, right) {
1685
+ const L = type_exports.IsRegExp(left) ? String() : left;
1686
+ const R = type_exports.IsRegExp(right) ? String() : right;
1687
+ return Visit3(L, R);
1688
+ }
1689
+ function FromStringRight(left, right) {
1690
+ return type_exports.IsLiteral(left) && value_exports.IsString(left.const) ? ExtendsResult.True : type_exports.IsString(left) ? ExtendsResult.True : ExtendsResult.False;
1691
+ }
1692
+ function FromString(left, right) {
1693
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsString(right) ? ExtendsResult.True : ExtendsResult.False;
1694
+ }
1695
+ function FromSymbol(left, right) {
1696
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsSymbol(right) ? ExtendsResult.True : ExtendsResult.False;
1697
+ }
1698
+ function FromTemplateLiteral2(left, right) {
1699
+ return type_exports.IsTemplateLiteral(left) ? Visit3(TemplateLiteralToUnion(left), right) : type_exports.IsTemplateLiteral(right) ? Visit3(left, TemplateLiteralToUnion(right)) : Throw("Invalid fallthrough for TemplateLiteral");
1700
+ }
1701
+ function IsArrayOfTuple(left, right) {
1702
+ return type_exports.IsArray(right) && left.items !== void 0 && left.items.every((schema) => Visit3(schema, right.items) === ExtendsResult.True);
1703
+ }
1704
+ function FromTupleRight(left, right) {
1705
+ return type_exports.IsNever(left) ? ExtendsResult.True : type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : ExtendsResult.False;
1706
+ }
1707
+ function FromTuple4(left, right) {
1708
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : type_exports.IsArray(right) && IsArrayOfTuple(left, right) ? ExtendsResult.True : !type_exports.IsTuple(right) ? ExtendsResult.False : value_exports.IsUndefined(left.items) && !value_exports.IsUndefined(right.items) || !value_exports.IsUndefined(left.items) && value_exports.IsUndefined(right.items) ? ExtendsResult.False : value_exports.IsUndefined(left.items) && !value_exports.IsUndefined(right.items) ? ExtendsResult.True : left.items.every((schema, index) => Visit3(schema, right.items[index]) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1709
+ }
1710
+ function FromUint8Array(left, right) {
1711
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsUint8Array(right) ? ExtendsResult.True : ExtendsResult.False;
1712
+ }
1713
+ function FromUndefined(left, right) {
1714
+ return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : type_exports.IsVoid(right) ? FromVoidRight(left, right) : type_exports.IsUndefined(right) ? ExtendsResult.True : ExtendsResult.False;
1715
+ }
1716
+ function FromUnionRight(left, right) {
1717
+ return right.anyOf.some((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1718
+ }
1719
+ function FromUnion7(left, right) {
1720
+ return left.anyOf.every((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1721
+ }
1722
+ function FromUnknownRight(left, right) {
1723
+ return ExtendsResult.True;
1724
+ }
1725
+ function FromUnknown(left, right) {
1726
+ return type_exports.IsNever(right) ? FromNeverRight(left, right) : type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) ? FromUnionRight(left, right) : type_exports.IsAny(right) ? FromAnyRight(left, right) : type_exports.IsString(right) ? FromStringRight(left, right) : type_exports.IsNumber(right) ? FromNumberRight(left, right) : type_exports.IsInteger(right) ? FromIntegerRight(left, right) : type_exports.IsBoolean(right) ? FromBooleanRight(left, right) : type_exports.IsArray(right) ? FromArrayRight(left, right) : type_exports.IsTuple(right) ? FromTupleRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsUnknown(right) ? ExtendsResult.True : ExtendsResult.False;
1727
+ }
1728
+ function FromVoidRight(left, right) {
1729
+ return type_exports.IsUndefined(left) ? ExtendsResult.True : type_exports.IsUndefined(left) ? ExtendsResult.True : ExtendsResult.False;
1730
+ }
1731
+ function FromVoid(left, right) {
1732
+ return type_exports.IsIntersect(right) ? FromIntersectRight(left, right) : type_exports.IsUnion(right) ? FromUnionRight(left, right) : type_exports.IsUnknown(right) ? FromUnknownRight(left, right) : type_exports.IsAny(right) ? FromAnyRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : type_exports.IsVoid(right) ? ExtendsResult.True : ExtendsResult.False;
1733
+ }
1734
+ function Visit3(left, right) {
1735
+ return (
1736
+ // resolvable
1737
+ type_exports.IsTemplateLiteral(left) || type_exports.IsTemplateLiteral(right) ? FromTemplateLiteral2(left, right) : type_exports.IsRegExp(left) || type_exports.IsRegExp(right) ? FromRegExp(left, right) : type_exports.IsNot(left) || type_exports.IsNot(right) ? FromNot(left, right) : (
1738
+ // standard
1739
+ type_exports.IsAny(left) ? FromAny(left, right) : type_exports.IsArray(left) ? FromArray5(left, right) : type_exports.IsBigInt(left) ? FromBigInt(left, right) : type_exports.IsBoolean(left) ? FromBoolean(left, right) : type_exports.IsAsyncIterator(left) ? FromAsyncIterator2(left, right) : type_exports.IsConstructor(left) ? FromConstructor2(left, right) : type_exports.IsDate(left) ? FromDate(left, right) : type_exports.IsFunction(left) ? FromFunction2(left, right) : type_exports.IsInteger(left) ? FromInteger(left, right) : type_exports.IsIntersect(left) ? FromIntersect5(left, right) : type_exports.IsIterator(left) ? FromIterator2(left, right) : type_exports.IsLiteral(left) ? FromLiteral2(left, right) : type_exports.IsNever(left) ? FromNever(left, right) : type_exports.IsNull(left) ? FromNull(left, right) : type_exports.IsNumber(left) ? FromNumber(left, right) : type_exports.IsObject(left) ? FromObject2(left, right) : type_exports.IsRecord(left) ? FromRecord(left, right) : type_exports.IsString(left) ? FromString(left, right) : type_exports.IsSymbol(left) ? FromSymbol(left, right) : type_exports.IsTuple(left) ? FromTuple4(left, right) : type_exports.IsPromise(left) ? FromPromise3(left, right) : type_exports.IsUint8Array(left) ? FromUint8Array(left, right) : type_exports.IsUndefined(left) ? FromUndefined(left, right) : type_exports.IsUnion(left) ? FromUnion7(left, right) : type_exports.IsUnknown(left) ? FromUnknown(left, right) : type_exports.IsVoid(left) ? FromVoid(left, right) : Throw(`Unknown left type operand '${left[Kind]}'`)
1740
+ )
1741
+ );
1742
+ }
1743
+ function ExtendsCheck(left, right) {
1744
+ return Visit3(left, right);
1745
+ }
1746
+
1747
+ // node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs
1748
+ function FromProperties9(P, Right, True, False, options) {
1749
+ const Acc = {};
1750
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1751
+ Acc[K2] = Extends(P[K2], Right, True, False, options);
1752
+ return Acc;
1753
+ }
1754
+ function FromMappedResult6(Left, Right, True, False, options) {
1755
+ return FromProperties9(Left.properties, Right, True, False, options);
1756
+ }
1757
+ function ExtendsFromMappedResult(Left, Right, True, False, options) {
1758
+ const P = FromMappedResult6(Left, Right, True, False, options);
1759
+ return MappedResult(P);
1760
+ }
1761
+
1762
+ // node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs
1763
+ function ExtendsResolve(left, right, trueType, falseType) {
1764
+ const R = ExtendsCheck(left, right);
1765
+ return R === ExtendsResult.Union ? Union([trueType, falseType]) : R === ExtendsResult.True ? trueType : falseType;
1766
+ }
1767
+ function Extends(L, R, T, F, options = {}) {
1768
+ return IsMappedResult(L) ? ExtendsFromMappedResult(L, R, T, F, options) : IsMappedKey(L) ? CloneType(ExtendsFromMappedKey(L, R, T, F, options)) : CloneType(ExtendsResolve(L, R, T, F), options);
1769
+ }
1770
+
1771
+ // node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs
1772
+ function FromPropertyKey(K, U, L, R, options) {
1773
+ return {
1774
+ [K]: Extends(Literal(K), U, L, R, options)
1775
+ };
1776
+ }
1777
+ function FromPropertyKeys(K, U, L, R, options) {
1778
+ return K.reduce((Acc, LK) => {
1779
+ return { ...Acc, ...FromPropertyKey(LK, U, L, R, options) };
1780
+ }, {});
1781
+ }
1782
+ function FromMappedKey2(K, U, L, R, options) {
1783
+ return FromPropertyKeys(K.keys, U, L, R, options);
1784
+ }
1785
+ function ExtendsFromMappedKey(T, U, L, R, options) {
1786
+ const P = FromMappedKey2(T, U, L, R, options);
1787
+ return MappedResult(P);
1788
+ }
1789
+
1790
+ // node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs
1791
+ function ExcludeFromTemplateLiteral(L, R) {
1792
+ return Exclude(TemplateLiteralToUnion(L), R);
1793
+ }
1794
+
1795
+ // node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs
1796
+ function ExcludeRest(L, R) {
1797
+ const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False);
1798
+ return excluded.length === 1 ? excluded[0] : Union(excluded);
1799
+ }
1800
+ function Exclude(L, R, options = {}) {
1801
+ if (IsTemplateLiteral(L))
1802
+ return CloneType(ExcludeFromTemplateLiteral(L, R), options);
1803
+ if (IsMappedResult(L))
1804
+ return CloneType(ExcludeFromMappedResult(L, R), options);
1805
+ return CloneType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
1806
+ }
1807
+
1808
+ // node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
1809
+ function FromProperties10(P, U) {
1810
+ const Acc = {};
1811
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1812
+ Acc[K2] = Exclude(P[K2], U);
1813
+ return Acc;
1814
+ }
1815
+ function FromMappedResult7(R, T) {
1816
+ return FromProperties10(R.properties, T);
1817
+ }
1818
+ function ExcludeFromMappedResult(R, T) {
1819
+ const P = FromMappedResult7(R, T);
1820
+ return MappedResult(P);
1821
+ }
1822
+
1823
+ // node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs
1824
+ function ExtractFromTemplateLiteral(L, R) {
1825
+ return Extract(TemplateLiteralToUnion(L), R);
1826
+ }
1827
+
1828
+ // node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs
1829
+ function ExtractRest(L, R) {
1830
+ const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
1831
+ return extracted.length === 1 ? extracted[0] : Union(extracted);
1832
+ }
1833
+ function Extract(L, R, options = {}) {
1834
+ if (IsTemplateLiteral(L))
1835
+ return CloneType(ExtractFromTemplateLiteral(L, R), options);
1836
+ if (IsMappedResult(L))
1837
+ return CloneType(ExtractFromMappedResult(L, R), options);
1838
+ return CloneType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
1839
+ }
1840
+
1841
+ // node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
1842
+ function FromProperties11(P, T) {
1843
+ const Acc = {};
1844
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1845
+ Acc[K2] = Extract(P[K2], T);
1846
+ return Acc;
1847
+ }
1848
+ function FromMappedResult8(R, T) {
1849
+ return FromProperties11(R.properties, T);
1850
+ }
1851
+ function ExtractFromMappedResult(R, T) {
1852
+ const P = FromMappedResult8(R, T);
1853
+ return MappedResult(P);
1854
+ }
1855
+
1856
+ // node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
1857
+ function InstanceType(schema, options = {}) {
1858
+ return CloneType(schema.returns, options);
1859
+ }
1860
+
1861
+ // node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs
1862
+ function Integer(options = {}) {
1863
+ return {
1864
+ ...options,
1865
+ [Kind]: "Integer",
1866
+ type: "integer"
1867
+ };
1868
+ }
1869
+
1870
+ // node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs
1871
+ function MappedIntrinsicPropertyKey(K, M, options) {
1872
+ return {
1873
+ [K]: Intrinsic(Literal(K), M, options)
1874
+ };
1875
+ }
1876
+ function MappedIntrinsicPropertyKeys(K, M, options) {
1877
+ return K.reduce((Acc, L) => {
1878
+ return { ...Acc, ...MappedIntrinsicPropertyKey(L, M, options) };
1879
+ }, {});
1880
+ }
1881
+ function MappedIntrinsicProperties(T, M, options) {
1882
+ return MappedIntrinsicPropertyKeys(T["keys"], M, options);
1883
+ }
1884
+ function IntrinsicFromMappedKey(T, M, options) {
1885
+ const P = MappedIntrinsicProperties(T, M, options);
1886
+ return MappedResult(P);
1887
+ }
1888
+
1889
+ // node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs
1890
+ function ApplyUncapitalize(value) {
1891
+ const [first, rest] = [value.slice(0, 1), value.slice(1)];
1892
+ return [first.toLowerCase(), rest].join("");
1893
+ }
1894
+ function ApplyCapitalize(value) {
1895
+ const [first, rest] = [value.slice(0, 1), value.slice(1)];
1896
+ return [first.toUpperCase(), rest].join("");
1897
+ }
1898
+ function ApplyUppercase(value) {
1899
+ return value.toUpperCase();
1900
+ }
1901
+ function ApplyLowercase(value) {
1902
+ return value.toLowerCase();
1903
+ }
1904
+ function FromTemplateLiteral3(schema, mode, options) {
1905
+ const expression = TemplateLiteralParseExact(schema.pattern);
1906
+ const finite = IsTemplateLiteralExpressionFinite(expression);
1907
+ if (!finite)
1908
+ return { ...schema, pattern: FromLiteralValue(schema.pattern, mode) };
1909
+ const strings = [...TemplateLiteralExpressionGenerate(expression)];
1910
+ const literals = strings.map((value) => Literal(value));
1911
+ const mapped = FromRest6(literals, mode);
1912
+ const union = Union(mapped);
1913
+ return TemplateLiteral([union], options);
1914
+ }
1915
+ function FromLiteralValue(value, mode) {
1916
+ return typeof value === "string" ? mode === "Uncapitalize" ? ApplyUncapitalize(value) : mode === "Capitalize" ? ApplyCapitalize(value) : mode === "Uppercase" ? ApplyUppercase(value) : mode === "Lowercase" ? ApplyLowercase(value) : value : value.toString();
1917
+ }
1918
+ function FromRest6(T, M) {
1919
+ return T.map((L) => Intrinsic(L, M));
1920
+ }
1921
+ function Intrinsic(schema, mode, options = {}) {
1922
+ return (
1923
+ // Intrinsic-Mapped-Inference
1924
+ IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode, options) : (
1925
+ // Standard-Inference
1926
+ IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode, schema) : IsUnion(schema) ? Union(FromRest6(schema.anyOf, mode), options) : IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : schema
1927
+ )
1928
+ );
1929
+ }
1930
+
1931
+ // node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs
1932
+ function Capitalize(T, options = {}) {
1933
+ return Intrinsic(T, "Capitalize", options);
1934
+ }
1935
+
1936
+ // node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs
1937
+ function Lowercase(T, options = {}) {
1938
+ return Intrinsic(T, "Lowercase", options);
1939
+ }
1940
+
1941
+ // node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs
1942
+ function Uncapitalize(T, options = {}) {
1943
+ return Intrinsic(T, "Uncapitalize", options);
1944
+ }
1945
+
1946
+ // node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs
1947
+ function Uppercase(T, options = {}) {
1948
+ return Intrinsic(T, "Uppercase", options);
1949
+ }
1950
+
1951
+ // node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
1952
+ function Not(schema, options) {
1953
+ return {
1954
+ ...options,
1955
+ [Kind]: "Not",
1956
+ not: CloneType(schema)
1957
+ };
1958
+ }
1959
+
1960
+ // node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs
1961
+ function FromProperties12(P, K, options) {
1962
+ const Acc = {};
1963
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1964
+ Acc[K2] = Omit(P[K2], K, options);
1965
+ return Acc;
1966
+ }
1967
+ function FromMappedResult9(R, K, options) {
1968
+ return FromProperties12(R.properties, K, options);
1969
+ }
1970
+ function OmitFromMappedResult(R, K, options) {
1971
+ const P = FromMappedResult9(R, K, options);
1972
+ return MappedResult(P);
1973
+ }
1974
+
1975
+ // node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
1976
+ function FromIntersect6(T, K) {
1977
+ return T.map((T2) => OmitResolve(T2, K));
1978
+ }
1979
+ function FromUnion8(T, K) {
1980
+ return T.map((T2) => OmitResolve(T2, K));
1981
+ }
1982
+ function FromProperty2(T, K) {
1983
+ const { [K]: _, ...R } = T;
1984
+ return R;
1985
+ }
1986
+ function FromProperties13(T, K) {
1987
+ return K.reduce((T2, K2) => FromProperty2(T2, K2), T);
1988
+ }
1989
+ function OmitResolve(T, K) {
1990
+ return IsIntersect(T) ? Intersect(FromIntersect6(T.allOf, K)) : IsUnion(T) ? Union(FromUnion8(T.anyOf, K)) : IsObject2(T) ? Object2(FromProperties13(T.properties, K)) : Object2({});
1991
+ }
1992
+ function Omit(T, K, options = {}) {
1993
+ if (IsMappedKey(K))
1994
+ return OmitFromMappedKey(T, K, options);
1995
+ if (IsMappedResult(T))
1996
+ return OmitFromMappedResult(T, K, options);
1997
+ const I = IsSchema(K) ? IndexPropertyKeys(K) : K;
1998
+ const D = Discard(T, [TransformKind, "$id", "required"]);
1999
+ const R = CloneType(OmitResolve(T, I), options);
2000
+ return { ...D, ...R };
2001
+ }
2002
+
2003
+ // node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs
2004
+ function FromPropertyKey2(T, K, options) {
2005
+ return {
2006
+ [K]: Omit(T, [K], options)
2007
+ };
2008
+ }
2009
+ function FromPropertyKeys2(T, K, options) {
2010
+ return K.reduce((Acc, LK) => {
2011
+ return { ...Acc, ...FromPropertyKey2(T, LK, options) };
2012
+ }, {});
2013
+ }
2014
+ function FromMappedKey3(T, K, options) {
2015
+ return FromPropertyKeys2(T, K.keys, options);
2016
+ }
2017
+ function OmitFromMappedKey(T, K, options) {
2018
+ const P = FromMappedKey3(T, K, options);
2019
+ return MappedResult(P);
2020
+ }
2021
+
2022
+ // node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
2023
+ function Parameters(schema, options = {}) {
2024
+ return Tuple(CloneRest(schema.parameters), { ...options });
2025
+ }
2026
+
2027
+ // node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs
2028
+ function FromRest7(T) {
2029
+ return T.map((L) => PartialResolve(L));
2030
+ }
2031
+ function FromProperties14(T) {
2032
+ const Acc = {};
2033
+ for (const K of globalThis.Object.getOwnPropertyNames(T))
2034
+ Acc[K] = Optional(T[K]);
2035
+ return Acc;
2036
+ }
2037
+ function PartialResolve(T) {
2038
+ return IsIntersect(T) ? Intersect(FromRest7(T.allOf)) : IsUnion(T) ? Union(FromRest7(T.anyOf)) : IsObject2(T) ? Object2(FromProperties14(T.properties)) : Object2({});
2039
+ }
2040
+ function Partial(T, options = {}) {
2041
+ if (IsMappedResult(T))
2042
+ return PartialFromMappedResult(T, options);
2043
+ const D = Discard(T, [TransformKind, "$id", "required"]);
2044
+ const R = CloneType(PartialResolve(T), options);
2045
+ return { ...D, ...R };
2046
+ }
2047
+
2048
+ // node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
2049
+ function FromProperties15(K, options) {
2050
+ const Acc = {};
2051
+ for (const K2 of globalThis.Object.getOwnPropertyNames(K))
2052
+ Acc[K2] = Partial(K[K2], options);
2053
+ return Acc;
2054
+ }
2055
+ function FromMappedResult10(R, options) {
2056
+ return FromProperties15(R.properties, options);
2057
+ }
2058
+ function PartialFromMappedResult(R, options) {
2059
+ const P = FromMappedResult10(R, options);
2060
+ return MappedResult(P);
2061
+ }
2062
+
2063
+ // node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
2064
+ function FromProperties16(P, K, options) {
2065
+ const Acc = {};
2066
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
2067
+ Acc[K2] = Pick(P[K2], K, options);
2068
+ return Acc;
2069
+ }
2070
+ function FromMappedResult11(R, K, options) {
2071
+ return FromProperties16(R.properties, K, options);
2072
+ }
2073
+ function PickFromMappedResult(R, K, options) {
2074
+ const P = FromMappedResult11(R, K, options);
2075
+ return MappedResult(P);
2076
+ }
2077
+
2078
+ // node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
2079
+ function FromIntersect7(T, K) {
2080
+ return T.map((T2) => PickResolve(T2, K));
2081
+ }
2082
+ function FromUnion9(T, K) {
2083
+ return T.map((T2) => PickResolve(T2, K));
2084
+ }
2085
+ function FromProperties17(T, K) {
2086
+ const Acc = {};
2087
+ for (const K2 of K)
2088
+ if (K2 in T)
2089
+ Acc[K2] = T[K2];
2090
+ return Acc;
2091
+ }
2092
+ function PickResolve(T, K) {
2093
+ return IsIntersect(T) ? Intersect(FromIntersect7(T.allOf, K)) : IsUnion(T) ? Union(FromUnion9(T.anyOf, K)) : IsObject2(T) ? Object2(FromProperties17(T.properties, K)) : Object2({});
2094
+ }
2095
+ function Pick(T, K, options = {}) {
2096
+ if (IsMappedKey(K))
2097
+ return PickFromMappedKey(T, K, options);
2098
+ if (IsMappedResult(T))
2099
+ return PickFromMappedResult(T, K, options);
2100
+ const I = IsSchema(K) ? IndexPropertyKeys(K) : K;
2101
+ const D = Discard(T, [TransformKind, "$id", "required"]);
2102
+ const R = CloneType(PickResolve(T, I), options);
2103
+ return { ...D, ...R };
2104
+ }
2105
+
2106
+ // node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs
2107
+ function FromPropertyKey3(T, K, options) {
2108
+ return {
2109
+ [K]: Pick(T, [K], options)
2110
+ };
2111
+ }
2112
+ function FromPropertyKeys3(T, K, options) {
2113
+ return K.reduce((Acc, LK) => {
2114
+ return { ...Acc, ...FromPropertyKey3(T, LK, options) };
2115
+ }, {});
2116
+ }
2117
+ function FromMappedKey4(T, K, options) {
2118
+ return FromPropertyKeys3(T, K.keys, options);
2119
+ }
2120
+ function PickFromMappedKey(T, K, options) {
2121
+ const P = FromMappedKey4(T, K, options);
2122
+ return MappedResult(P);
2123
+ }
2124
+
2125
+ // node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
2126
+ function ReadonlyOptional(schema) {
2127
+ return Readonly(Optional(schema));
2128
+ }
2129
+
2130
+ // node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
2131
+ function RecordCreateFromPattern(pattern, T, options) {
2132
+ return {
2133
+ ...options,
2134
+ [Kind]: "Record",
2135
+ type: "object",
2136
+ patternProperties: { [pattern]: CloneType(T) }
2137
+ };
2138
+ }
2139
+ function RecordCreateFromKeys(K, T, options) {
2140
+ const Acc = {};
2141
+ for (const K2 of K)
2142
+ Acc[K2] = CloneType(T);
2143
+ return Object2(Acc, { ...options, [Hint]: "Record" });
2144
+ }
2145
+ function FromTemplateLiteralKey(K, T, options) {
2146
+ return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
2147
+ }
2148
+ function FromUnionKey(K, T, options) {
2149
+ return RecordCreateFromKeys(IndexPropertyKeys(Union(K)), T, options);
2150
+ }
2151
+ function FromLiteralKey(K, T, options) {
2152
+ return RecordCreateFromKeys([K.toString()], T, options);
2153
+ }
2154
+ function FromRegExpKey(K, T, options) {
2155
+ return RecordCreateFromPattern(K.source, T, options);
2156
+ }
2157
+ function FromStringKey(K, T, options) {
2158
+ const pattern = IsUndefined(K.pattern) ? PatternStringExact : K.pattern;
2159
+ return RecordCreateFromPattern(pattern, T, options);
2160
+ }
2161
+ function FromIntegerKey(_, T, options) {
2162
+ return RecordCreateFromPattern(PatternNumberExact, T, options);
2163
+ }
2164
+ function FromNumberKey(_, T, options) {
2165
+ return RecordCreateFromPattern(PatternNumberExact, T, options);
2166
+ }
2167
+ function Record(K, T, options = {}) {
2168
+ return IsUnion(K) ? FromUnionKey(K.anyOf, T, options) : IsTemplateLiteral(K) ? FromTemplateLiteralKey(K, T, options) : IsLiteral(K) ? FromLiteralKey(K.const, T, options) : IsInteger(K) ? FromIntegerKey(K, T, options) : IsNumber2(K) ? FromNumberKey(K, T, options) : IsRegExp2(K) ? FromRegExpKey(K, T, options) : IsString2(K) ? FromStringKey(K, T, options) : Never(options);
2169
+ }
2170
+
2171
+ // node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
2172
+ var Ordinal = 0;
2173
+ function Recursive(callback, options = {}) {
2174
+ if (IsUndefined(options.$id))
2175
+ options.$id = `T${Ordinal++}`;
2176
+ const thisType = callback({ [Kind]: "This", $ref: `${options.$id}` });
2177
+ thisType.$id = options.$id;
2178
+ return CloneType({ ...options, [Hint]: "Recursive", ...thisType });
2179
+ }
2180
+
2181
+ // node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
2182
+ function Ref(unresolved, options = {}) {
2183
+ if (IsString(unresolved))
2184
+ return { ...options, [Kind]: "Ref", $ref: unresolved };
2185
+ if (IsUndefined(unresolved.$id))
2186
+ throw new Error("Reference target type must specify an $id");
2187
+ return {
2188
+ ...options,
2189
+ [Kind]: "Ref",
2190
+ $ref: unresolved.$id
2191
+ };
2192
+ }
2193
+
2194
+ // node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
2195
+ function RegExp2(unresolved, options = {}) {
2196
+ const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
2197
+ return { ...options, [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags };
2198
+ }
2199
+
2200
+ // node_modules/@sinclair/typebox/build/esm/type/required/required.mjs
2201
+ function FromRest8(T) {
2202
+ return T.map((L) => RequiredResolve(L));
2203
+ }
2204
+ function FromProperties18(T) {
2205
+ const Acc = {};
2206
+ for (const K of globalThis.Object.getOwnPropertyNames(T))
2207
+ Acc[K] = Discard(T[K], [OptionalKind]);
2208
+ return Acc;
2209
+ }
2210
+ function RequiredResolve(T) {
2211
+ return IsIntersect(T) ? Intersect(FromRest8(T.allOf)) : IsUnion(T) ? Union(FromRest8(T.anyOf)) : IsObject2(T) ? Object2(FromProperties18(T.properties)) : Object2({});
2212
+ }
2213
+ function Required(T, options = {}) {
2214
+ if (IsMappedResult(T)) {
2215
+ return RequiredFromMappedResult(T, options);
2216
+ } else {
2217
+ const D = Discard(T, [TransformKind, "$id", "required"]);
2218
+ const R = CloneType(RequiredResolve(T), options);
2219
+ return { ...D, ...R };
2220
+ }
2221
+ }
2222
+
2223
+ // node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs
2224
+ function FromProperties19(P, options) {
2225
+ const Acc = {};
2226
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
2227
+ Acc[K2] = Required(P[K2], options);
2228
+ return Acc;
2229
+ }
2230
+ function FromMappedResult12(R, options) {
2231
+ return FromProperties19(R.properties, options);
2232
+ }
2233
+ function RequiredFromMappedResult(R, options) {
2234
+ const P = FromMappedResult12(R, options);
2235
+ return MappedResult(P);
2236
+ }
2237
+
2238
+ // node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs
2239
+ function RestResolve(T) {
2240
+ return IsIntersect(T) ? CloneRest(T.allOf) : IsUnion(T) ? CloneRest(T.anyOf) : IsTuple(T) ? CloneRest(T.items ?? []) : [];
2241
+ }
2242
+ function Rest(T) {
2243
+ return CloneRest(RestResolve(T));
2244
+ }
2245
+
2246
+ // node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
2247
+ function ReturnType(schema, options = {}) {
2248
+ return CloneType(schema.returns, options);
2249
+ }
2250
+
2251
+ // node_modules/@sinclair/typebox/build/esm/type/strict/strict.mjs
2252
+ function Strict(schema) {
2253
+ return JSON.parse(JSON.stringify(schema));
2254
+ }
2255
+
2256
+ // node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
2257
+ var TransformDecodeBuilder = class {
2258
+ constructor(schema) {
2259
+ this.schema = schema;
2260
+ }
2261
+ Decode(decode) {
2262
+ return new TransformEncodeBuilder(this.schema, decode);
2263
+ }
2264
+ };
2265
+ var TransformEncodeBuilder = class {
2266
+ constructor(schema, decode) {
2267
+ this.schema = schema;
2268
+ this.decode = decode;
2269
+ }
2270
+ EncodeTransform(encode, schema) {
2271
+ const Encode = (value) => schema[TransformKind].Encode(encode(value));
2272
+ const Decode = (value) => this.decode(schema[TransformKind].Decode(value));
2273
+ const Codec = { Encode, Decode };
2274
+ return { ...schema, [TransformKind]: Codec };
2275
+ }
2276
+ EncodeSchema(encode, schema) {
2277
+ const Codec = { Decode: this.decode, Encode: encode };
2278
+ return { ...schema, [TransformKind]: Codec };
2279
+ }
2280
+ Encode(encode) {
2281
+ const schema = CloneType(this.schema);
2282
+ return IsTransform(schema) ? this.EncodeTransform(encode, schema) : this.EncodeSchema(encode, schema);
2283
+ }
2284
+ };
2285
+ function Transform(schema) {
2286
+ return new TransformDecodeBuilder(schema);
2287
+ }
2288
+
2289
+ // node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs
2290
+ function Unsafe(options = {}) {
2291
+ return {
2292
+ ...options,
2293
+ [Kind]: options[Kind] ?? "Unsafe"
2294
+ };
2295
+ }
2296
+
2297
+ // node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
2298
+ function Void(options = {}) {
2299
+ return {
2300
+ ...options,
2301
+ [Kind]: "Void",
2302
+ type: "void"
2303
+ };
2304
+ }
2305
+
2306
+ // node_modules/@sinclair/typebox/build/esm/type/type/type.mjs
2307
+ var type_exports3 = {};
2308
+ __export(type_exports3, {
2309
+ Any: () => Any,
2310
+ Array: () => Array2,
2311
+ AsyncIterator: () => AsyncIterator,
2312
+ Awaited: () => Awaited,
2313
+ BigInt: () => BigInt,
2314
+ Boolean: () => Boolean,
2315
+ Capitalize: () => Capitalize,
2316
+ Composite: () => Composite,
2317
+ Const: () => Const,
2318
+ Constructor: () => Constructor,
2319
+ ConstructorParameters: () => ConstructorParameters,
2320
+ Date: () => Date2,
2321
+ Deref: () => Deref,
2322
+ Enum: () => Enum,
2323
+ Exclude: () => Exclude,
2324
+ Extends: () => Extends,
2325
+ Extract: () => Extract,
2326
+ Function: () => Function,
2327
+ Index: () => Index,
2328
+ InstanceType: () => InstanceType,
2329
+ Integer: () => Integer,
2330
+ Intersect: () => Intersect,
2331
+ Iterator: () => Iterator,
2332
+ KeyOf: () => KeyOf,
2333
+ Literal: () => Literal,
2334
+ Lowercase: () => Lowercase,
2335
+ Mapped: () => Mapped,
2336
+ Never: () => Never,
2337
+ Not: () => Not,
2338
+ Null: () => Null,
2339
+ Number: () => Number,
2340
+ Object: () => Object2,
2341
+ Omit: () => Omit,
2342
+ Optional: () => Optional,
2343
+ Parameters: () => Parameters,
2344
+ Partial: () => Partial,
2345
+ Pick: () => Pick,
2346
+ Promise: () => Promise2,
2347
+ Readonly: () => Readonly,
2348
+ ReadonlyOptional: () => ReadonlyOptional,
2349
+ Record: () => Record,
2350
+ Recursive: () => Recursive,
2351
+ Ref: () => Ref,
2352
+ RegExp: () => RegExp2,
2353
+ Required: () => Required,
2354
+ Rest: () => Rest,
2355
+ ReturnType: () => ReturnType,
2356
+ Strict: () => Strict,
2357
+ String: () => String,
2358
+ Symbol: () => Symbol2,
2359
+ TemplateLiteral: () => TemplateLiteral,
2360
+ Transform: () => Transform,
2361
+ Tuple: () => Tuple,
2362
+ Uint8Array: () => Uint8Array2,
2363
+ Uncapitalize: () => Uncapitalize,
2364
+ Undefined: () => Undefined,
2365
+ Union: () => Union,
2366
+ Unknown: () => Unknown,
2367
+ Unsafe: () => Unsafe,
2368
+ Uppercase: () => Uppercase,
2369
+ Void: () => Void
2370
+ });
2371
+
2372
+ // node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
2373
+ var Type = type_exports3;
2374
+
2375
+ // src/index.ts
2376
+ var jwt = ({
2377
+ name = "jwt",
2378
+ secret,
2379
+ // Start JWT Header
2380
+ alg = "HS256",
2381
+ crit,
2382
+ schema,
2383
+ // End JWT Header
2384
+ // Start JWT Payload
2385
+ nbf,
2386
+ exp,
2387
+ ...payload
2388
+ }) => {
2389
+ if (!secret) throw new Error("Secret can't be empty");
2390
+ const key = typeof secret === "string" ? new TextEncoder().encode(secret) : secret;
2391
+ const validator = schema ? getSchemaValidator(
2392
+ Type.Intersect([
2393
+ schema,
2394
+ Type.Object({
2395
+ iss: Type.Optional(Type.String()),
2396
+ sub: Type.Optional(Type.String()),
2397
+ aud: Type.Optional(
2398
+ Type.Union([Type.String(), Type.Array(Type.String())])
2399
+ ),
2400
+ jti: Type.Optional(Type.String()),
2401
+ nbf: Type.Optional(Type.Union([Type.String(), Type.Number()])),
2402
+ exp: Type.Optional(Type.Union([Type.String(), Type.Number()])),
2403
+ iat: Type.Optional(Type.String())
2404
+ })
2405
+ ]),
2406
+ {}
2407
+ ) : void 0;
2408
+ return new Elysia({
2409
+ name: "@elysiajs/jwt",
2410
+ seed: {
2411
+ name,
2412
+ secret,
2413
+ alg,
2414
+ crit,
2415
+ schema,
2416
+ nbf,
2417
+ exp,
2418
+ ...payload
2419
+ }
2420
+ }).decorate(name, {
2421
+ sign(morePayload) {
2422
+ let jwt2 = new SignJWT({
2423
+ ...payload,
2424
+ ...morePayload,
2425
+ nbf: void 0,
2426
+ exp: void 0
2427
+ }).setProtectedHeader({
2428
+ alg,
2429
+ crit
2430
+ });
2431
+ if (nbf) jwt2 = jwt2.setNotBefore(nbf);
2432
+ if (exp) jwt2 = jwt2.setExpirationTime(exp);
2433
+ return jwt2.sign(key);
2434
+ },
2435
+ async verify(jwt2) {
2436
+ if (!jwt2) return false;
2437
+ try {
2438
+ const data = (await jwtVerify(jwt2, key)).payload;
2439
+ if (validator && !validator.Check(data))
2440
+ throw new ValidationError("JWT", validator, data);
2441
+ return data;
2442
+ } catch (_) {
2443
+ return false;
2444
+ }
2445
+ }
2446
+ });
2447
+ };
2448
+ var src_default = jwt;
2449
+ export {
2450
+ src_default as default,
2451
+ jwt
2452
+ };