@elysiajs/jwt 1.1.0 → 1.2.0-rc.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/cjs/index.js CHANGED
@@ -18,18 +18,19 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- default: () => src_default,
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ default: () => index_default,
24
24
  jwt: () => jwt
25
25
  });
26
- module.exports = __toCommonJS(src_exports);
26
+ module.exports = __toCommonJS(index_exports);
27
27
  var import_elysia = require("elysia");
28
28
  var import_jose = require("jose");
29
29
 
30
30
  // node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
31
31
  var value_exports = {};
32
32
  __export(value_exports, {
33
+ HasPropertyKey: () => HasPropertyKey,
33
34
  IsArray: () => IsArray,
34
35
  IsAsyncIterator: () => IsAsyncIterator,
35
36
  IsBigInt: () => IsBigInt,
@@ -46,6 +47,9 @@ __export(value_exports, {
46
47
  IsUint8Array: () => IsUint8Array,
47
48
  IsUndefined: () => IsUndefined
48
49
  });
50
+ function HasPropertyKey(value, key) {
51
+ return key in value;
52
+ }
49
53
  function IsAsyncIterator(value) {
50
54
  return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value;
51
55
  }
@@ -123,11 +127,94 @@ function Clone(value) {
123
127
  }
124
128
 
125
129
  // node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
126
- function CloneRest(schemas) {
127
- return schemas.map((schema) => CloneType(schema));
130
+ function CloneType(schema, options) {
131
+ return options === void 0 ? Clone(schema) : Clone({ ...options, ...schema });
132
+ }
133
+
134
+ // node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
135
+ function IsObject2(value) {
136
+ return value !== null && typeof value === "object";
137
+ }
138
+ function IsArray2(value) {
139
+ return Array.isArray(value) && !ArrayBuffer.isView(value);
140
+ }
141
+ function IsUndefined2(value) {
142
+ return value === void 0;
143
+ }
144
+ function IsNumber2(value) {
145
+ return typeof value === "number";
146
+ }
147
+
148
+ // node_modules/@sinclair/typebox/build/esm/system/policy.mjs
149
+ var TypeSystemPolicy;
150
+ (function(TypeSystemPolicy2) {
151
+ TypeSystemPolicy2.InstanceMode = "default";
152
+ TypeSystemPolicy2.ExactOptionalPropertyTypes = false;
153
+ TypeSystemPolicy2.AllowArrayObject = false;
154
+ TypeSystemPolicy2.AllowNaN = false;
155
+ TypeSystemPolicy2.AllowNullVoid = false;
156
+ function IsExactOptionalProperty(value, key) {
157
+ return TypeSystemPolicy2.ExactOptionalPropertyTypes ? key in value : value[key] !== void 0;
158
+ }
159
+ TypeSystemPolicy2.IsExactOptionalProperty = IsExactOptionalProperty;
160
+ function IsObjectLike(value) {
161
+ const isObject = IsObject2(value);
162
+ return TypeSystemPolicy2.AllowArrayObject ? isObject : isObject && !IsArray2(value);
163
+ }
164
+ TypeSystemPolicy2.IsObjectLike = IsObjectLike;
165
+ function IsRecordLike(value) {
166
+ return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array);
167
+ }
168
+ TypeSystemPolicy2.IsRecordLike = IsRecordLike;
169
+ function IsNumberLike(value) {
170
+ return TypeSystemPolicy2.AllowNaN ? IsNumber2(value) : Number.isFinite(value);
171
+ }
172
+ TypeSystemPolicy2.IsNumberLike = IsNumberLike;
173
+ function IsVoidLike(value) {
174
+ const isUndefined = IsUndefined2(value);
175
+ return TypeSystemPolicy2.AllowNullVoid ? isUndefined || value === null : isUndefined;
176
+ }
177
+ TypeSystemPolicy2.IsVoidLike = IsVoidLike;
178
+ })(TypeSystemPolicy || (TypeSystemPolicy = {}));
179
+
180
+ // node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs
181
+ function ImmutableArray(value) {
182
+ return globalThis.Object.freeze(value).map((value2) => Immutable(value2));
183
+ }
184
+ function ImmutableDate(value) {
185
+ return value;
186
+ }
187
+ function ImmutableUint8Array(value) {
188
+ return value;
128
189
  }
129
- function CloneType(schema, options = {}) {
130
- return { ...Clone(schema), ...options };
190
+ function ImmutableRegExp(value) {
191
+ return value;
192
+ }
193
+ function ImmutableObject(value) {
194
+ const result = {};
195
+ for (const key of Object.getOwnPropertyNames(value)) {
196
+ result[key] = Immutable(value[key]);
197
+ }
198
+ for (const key of Object.getOwnPropertySymbols(value)) {
199
+ result[key] = Immutable(value[key]);
200
+ }
201
+ return globalThis.Object.freeze(result);
202
+ }
203
+ function Immutable(value) {
204
+ return IsArray(value) ? ImmutableArray(value) : IsDate(value) ? ImmutableDate(value) : IsUint8Array(value) ? ImmutableUint8Array(value) : IsRegExp(value) ? ImmutableRegExp(value) : IsObject(value) ? ImmutableObject(value) : value;
205
+ }
206
+
207
+ // node_modules/@sinclair/typebox/build/esm/type/create/type.mjs
208
+ function CreateType(schema, options) {
209
+ const result = options !== void 0 ? { ...options, ...schema } : schema;
210
+ switch (TypeSystemPolicy.InstanceMode) {
211
+ case "freeze":
212
+ return Immutable(result);
213
+ case "clone":
214
+ return Clone(result);
215
+ default:
216
+ return result;
217
+ }
131
218
  }
132
219
 
133
220
  // node_modules/@sinclair/typebox/build/esm/type/error/error.mjs
@@ -154,7 +241,7 @@ function IsOptional(value) {
154
241
  function IsAny(value) {
155
242
  return IsKindOf(value, "Any");
156
243
  }
157
- function IsArray2(value) {
244
+ function IsArray3(value) {
158
245
  return IsKindOf(value, "Array");
159
246
  }
160
247
  function IsAsyncIterator2(value) {
@@ -166,6 +253,9 @@ function IsBigInt2(value) {
166
253
  function IsBoolean2(value) {
167
254
  return IsKindOf(value, "Boolean");
168
255
  }
256
+ function IsComputed(value) {
257
+ return IsKindOf(value, "Computed");
258
+ }
169
259
  function IsConstructor(value) {
170
260
  return IsKindOf(value, "Constructor");
171
261
  }
@@ -187,6 +277,9 @@ function IsIterator2(value) {
187
277
  function IsKindOf(value, kind) {
188
278
  return IsObject(value) && Kind in value && value[Kind] === kind;
189
279
  }
280
+ function IsLiteralValue(value) {
281
+ return IsBoolean(value) || IsNumber(value) || IsString(value);
282
+ }
190
283
  function IsLiteral(value) {
191
284
  return IsKindOf(value, "Literal");
192
285
  }
@@ -205,10 +298,10 @@ function IsNot(value) {
205
298
  function IsNull2(value) {
206
299
  return IsKindOf(value, "Null");
207
300
  }
208
- function IsNumber2(value) {
301
+ function IsNumber3(value) {
209
302
  return IsKindOf(value, "Number");
210
303
  }
211
- function IsObject2(value) {
304
+ function IsObject3(value) {
212
305
  return IsKindOf(value, "Object");
213
306
  }
214
307
  function IsPromise(value) {
@@ -241,7 +334,7 @@ function IsTransform(value) {
241
334
  function IsTuple(value) {
242
335
  return IsKindOf(value, "Tuple");
243
336
  }
244
- function IsUndefined2(value) {
337
+ function IsUndefined3(value) {
245
338
  return IsKindOf(value, "Undefined");
246
339
  }
247
340
  function IsUnion(value) {
@@ -263,20 +356,22 @@ function IsKind(value) {
263
356
  return IsObject(value) && Kind in value && IsString(value[Kind]);
264
357
  }
265
358
  function IsSchema(value) {
266
- 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);
359
+ return IsAny(value) || IsArray3(value) || IsBoolean2(value) || IsBigInt2(value) || IsAsyncIterator2(value) || IsComputed(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) || IsNumber3(value) || IsObject3(value) || IsPromise(value) || IsRecord(value) || IsRef(value) || IsRegExp2(value) || IsString2(value) || IsSymbol2(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined3(value) || IsUnion(value) || IsUint8Array2(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value);
267
360
  }
268
361
 
269
362
  // node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
270
363
  var type_exports = {};
271
364
  __export(type_exports, {
272
365
  IsAny: () => IsAny2,
273
- IsArray: () => IsArray3,
366
+ IsArray: () => IsArray4,
274
367
  IsAsyncIterator: () => IsAsyncIterator3,
275
368
  IsBigInt: () => IsBigInt3,
276
369
  IsBoolean: () => IsBoolean3,
370
+ IsComputed: () => IsComputed2,
277
371
  IsConstructor: () => IsConstructor2,
278
372
  IsDate: () => IsDate3,
279
373
  IsFunction: () => IsFunction3,
374
+ IsImport: () => IsImport,
280
375
  IsInteger: () => IsInteger2,
281
376
  IsIntersect: () => IsIntersect2,
282
377
  IsIterator: () => IsIterator3,
@@ -286,14 +381,14 @@ __export(type_exports, {
286
381
  IsLiteralBoolean: () => IsLiteralBoolean,
287
382
  IsLiteralNumber: () => IsLiteralNumber,
288
383
  IsLiteralString: () => IsLiteralString,
289
- IsLiteralValue: () => IsLiteralValue,
384
+ IsLiteralValue: () => IsLiteralValue2,
290
385
  IsMappedKey: () => IsMappedKey2,
291
386
  IsMappedResult: () => IsMappedResult2,
292
387
  IsNever: () => IsNever2,
293
388
  IsNot: () => IsNot2,
294
389
  IsNull: () => IsNull3,
295
- IsNumber: () => IsNumber3,
296
- IsObject: () => IsObject3,
390
+ IsNumber: () => IsNumber4,
391
+ IsObject: () => IsObject4,
297
392
  IsOptional: () => IsOptional2,
298
393
  IsPromise: () => IsPromise2,
299
394
  IsProperties: () => IsProperties,
@@ -310,7 +405,7 @@ __export(type_exports, {
310
405
  IsTransform: () => IsTransform2,
311
406
  IsTuple: () => IsTuple2,
312
407
  IsUint8Array: () => IsUint8Array3,
313
- IsUndefined: () => IsUndefined3,
408
+ IsUndefined: () => IsUndefined4,
314
409
  IsUnion: () => IsUnion2,
315
410
  IsUnionLiteral: () => IsUnionLiteral,
316
411
  IsUnknown: () => IsUnknown2,
@@ -326,6 +421,7 @@ var KnownTypes = [
326
421
  "AsyncIterator",
327
422
  "BigInt",
328
423
  "Boolean",
424
+ "Computed",
329
425
  "Constructor",
330
426
  "Date",
331
427
  "Enum",
@@ -407,7 +503,7 @@ function IsOptional2(value) {
407
503
  function IsAny2(value) {
408
504
  return IsKindOf2(value, "Any") && IsOptionalString(value.$id);
409
505
  }
410
- function IsArray3(value) {
506
+ function IsArray4(value) {
411
507
  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);
412
508
  }
413
509
  function IsAsyncIterator3(value) {
@@ -419,6 +515,9 @@ function IsBigInt3(value) {
419
515
  function IsBoolean3(value) {
420
516
  return IsKindOf2(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id);
421
517
  }
518
+ function IsComputed2(value) {
519
+ return IsKindOf2(value, "Computed") && IsString(value.target) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema));
520
+ }
422
521
  function IsConstructor2(value) {
423
522
  return IsKindOf2(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
424
523
  }
@@ -428,6 +527,9 @@ function IsDate3(value) {
428
527
  function IsFunction3(value) {
429
528
  return IsKindOf2(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
430
529
  }
530
+ function IsImport(value) {
531
+ return IsKindOf2(value, "Import") && HasPropertyKey(value, "$defs") && IsObject(value.$defs) && IsProperties(value.$defs) && HasPropertyKey(value, "$ref") && IsString(value.$ref) && value.$ref in value.$defs;
532
+ }
431
533
  function IsInteger2(value) {
432
534
  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);
433
535
  }
@@ -453,9 +555,9 @@ function IsLiteralBoolean(value) {
453
555
  return IsLiteral2(value) && IsBoolean(value.const);
454
556
  }
455
557
  function IsLiteral2(value) {
456
- return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue(value.const);
558
+ return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue2(value.const);
457
559
  }
458
- function IsLiteralValue(value) {
560
+ function IsLiteralValue2(value) {
459
561
  return IsBoolean(value) || IsNumber(value) || IsString(value);
460
562
  }
461
563
  function IsMappedKey2(value) {
@@ -473,10 +575,10 @@ function IsNot2(value) {
473
575
  function IsNull3(value) {
474
576
  return IsKindOf2(value, "Null") && value.type === "null" && IsOptionalString(value.$id);
475
577
  }
476
- function IsNumber3(value) {
578
+ function IsNumber4(value) {
477
579
  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);
478
580
  }
479
- function IsObject3(value) {
581
+ function IsObject4(value) {
480
582
  return IsKindOf2(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);
481
583
  }
482
584
  function IsPromise2(value) {
@@ -516,7 +618,7 @@ function IsTuple2(value) {
516
618
  return IsKindOf2(value, "Tuple") && value.type === "array" && IsOptionalString(value.$id) && IsNumber(value.minItems) && IsNumber(value.maxItems) && value.minItems === value.maxItems && // empty
517
619
  (IsUndefined(value.items) && IsUndefined(value.additionalItems) && value.minItems === 0 || IsArray(value.items) && value.items.every((schema) => IsSchema2(schema)));
518
620
  }
519
- function IsUndefined3(value) {
621
+ function IsUndefined4(value) {
520
622
  return IsKindOf2(value, "Undefined") && value.type === "undefined" && IsOptionalString(value.$id);
521
623
  }
522
624
  function IsUnionLiteral(value) {
@@ -541,16 +643,18 @@ function IsKind2(value) {
541
643
  return IsObject(value) && Kind in value && IsString(value[Kind]) && !KnownTypes.includes(value[Kind]);
542
644
  }
543
645
  function IsSchema2(value) {
544
- 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));
646
+ return IsObject(value) && (IsAny2(value) || IsArray4(value) || IsBoolean3(value) || IsBigInt3(value) || IsAsyncIterator3(value) || IsComputed2(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) || IsNumber4(value) || IsObject4(value) || IsPromise2(value) || IsRecord2(value) || IsRef2(value) || IsRegExp3(value) || IsString3(value) || IsSymbol3(value) || IsTemplateLiteral2(value) || IsThis2(value) || IsTuple2(value) || IsUndefined4(value) || IsUnion2(value) || IsUint8Array3(value) || IsUnknown2(value) || IsUnsafe2(value) || IsVoid2(value) || IsKind2(value));
545
647
  }
546
648
 
547
649
  // node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs
548
650
  var PatternBoolean = "(true|false)";
549
651
  var PatternNumber = "(0|[1-9][0-9]*)";
550
652
  var PatternString = "(.*)";
653
+ var PatternNever = "(?!.*)";
551
654
  var PatternBooleanExact = `^${PatternBoolean}$`;
552
655
  var PatternNumberExact = `^${PatternNumber}$`;
553
656
  var PatternStringExact = `^${PatternString}$`;
657
+ var PatternNeverExact = `^${PatternNever}$`;
554
658
 
555
659
  // node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs
556
660
  function SetIncludes(T, S) {
@@ -578,28 +682,23 @@ function SetUnionMany(T) {
578
682
  }
579
683
 
580
684
  // node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
581
- function Any(options = {}) {
582
- return { ...options, [Kind]: "Any" };
685
+ function Any(options) {
686
+ return CreateType({ [Kind]: "Any" }, options);
583
687
  }
584
688
 
585
689
  // node_modules/@sinclair/typebox/build/esm/type/array/array.mjs
586
- function Array2(schema, options = {}) {
587
- return {
588
- ...options,
589
- [Kind]: "Array",
590
- type: "array",
591
- items: CloneType(schema)
592
- };
690
+ function Array2(items, options) {
691
+ return CreateType({ [Kind]: "Array", type: "array", items }, options);
593
692
  }
594
693
 
595
694
  // node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
596
- function AsyncIterator(items, options = {}) {
597
- return {
598
- ...options,
599
- [Kind]: "AsyncIterator",
600
- type: "AsyncIterator",
601
- items: CloneType(items)
602
- };
695
+ function AsyncIterator(items, options) {
696
+ return CreateType({ [Kind]: "AsyncIterator", type: "AsyncIterator", items }, options);
697
+ }
698
+
699
+ // node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs
700
+ function Computed(target, parameters, options) {
701
+ return CreateType({ [Kind]: "Computed", target, parameters }, options);
603
702
  }
604
703
 
605
704
  // node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
@@ -612,69 +711,54 @@ function Discard(value, keys) {
612
711
  }
613
712
 
614
713
  // node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
615
- function Never(options = {}) {
616
- return {
617
- ...options,
618
- [Kind]: "Never",
619
- not: {}
620
- };
714
+ function Never(options) {
715
+ return CreateType({ [Kind]: "Never", not: {} }, options);
621
716
  }
622
717
 
623
718
  // node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs
624
719
  function MappedResult(properties) {
625
- return {
720
+ return CreateType({
626
721
  [Kind]: "MappedResult",
627
722
  properties
628
- };
723
+ });
629
724
  }
630
725
 
631
726
  // node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs
632
727
  function Constructor(parameters, returns, options) {
633
- return {
634
- ...options,
635
- [Kind]: "Constructor",
636
- type: "Constructor",
637
- parameters: CloneRest(parameters),
638
- returns: CloneType(returns)
639
- };
728
+ return CreateType({ [Kind]: "Constructor", type: "Constructor", parameters, returns }, options);
640
729
  }
641
730
 
642
731
  // node_modules/@sinclair/typebox/build/esm/type/function/function.mjs
643
732
  function Function(parameters, returns, options) {
644
- return {
645
- ...options,
646
- [Kind]: "Function",
647
- type: "Function",
648
- parameters: CloneRest(parameters),
649
- returns: CloneType(returns)
650
- };
733
+ return CreateType({ [Kind]: "Function", type: "Function", parameters, returns }, options);
651
734
  }
652
735
 
653
736
  // node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs
654
737
  function UnionCreate(T, options) {
655
- return { ...options, [Kind]: "Union", anyOf: CloneRest(T) };
738
+ return CreateType({ [Kind]: "Union", anyOf: T }, options);
656
739
  }
657
740
 
658
741
  // node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs
659
- function IsUnionOptional(T) {
660
- return T.some((L) => IsOptional(L));
742
+ function IsUnionOptional(types) {
743
+ return types.some((type) => IsOptional(type));
661
744
  }
662
- function RemoveOptionalFromRest(T) {
663
- return T.map((L) => IsOptional(L) ? RemoveOptionalFromType(L) : L);
745
+ function RemoveOptionalFromRest(types) {
746
+ return types.map((left) => IsOptional(left) ? RemoveOptionalFromType(left) : left);
664
747
  }
665
748
  function RemoveOptionalFromType(T) {
666
749
  return Discard(T, [OptionalKind]);
667
750
  }
668
- function ResolveUnion(T, options) {
669
- return IsUnionOptional(T) ? Optional(UnionCreate(RemoveOptionalFromRest(T), options)) : UnionCreate(RemoveOptionalFromRest(T), options);
751
+ function ResolveUnion(types, options) {
752
+ const isOptional = IsUnionOptional(types);
753
+ return isOptional ? Optional(UnionCreate(RemoveOptionalFromRest(types), options)) : UnionCreate(RemoveOptionalFromRest(types), options);
670
754
  }
671
- function UnionEvaluated(T, options = {}) {
672
- return T.length === 0 ? Never(options) : T.length === 1 ? CloneType(T[0], options) : ResolveUnion(T, options);
755
+ function UnionEvaluated(T, options) {
756
+ return T.length === 1 ? CreateType(T[0], options) : T.length === 0 ? Never(options) : ResolveUnion(T, options);
673
757
  }
674
758
 
675
759
  // node_modules/@sinclair/typebox/build/esm/type/union/union.mjs
676
- function Union(T, options = {}) {
677
- return T.length === 0 ? Never(options) : T.length === 1 ? CloneType(T[0], options) : UnionCreate(T, options);
760
+ function Union(types, options) {
761
+ return types.length === 0 ? Never(options) : types.length === 1 ? CreateType(types[0], options) : UnionCreate(types, options);
678
762
  }
679
763
 
680
764
  // node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs
@@ -856,51 +940,38 @@ function TemplateLiteralGenerate(schema) {
856
940
  }
857
941
 
858
942
  // node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs
859
- function Literal(value, options = {}) {
860
- return {
861
- ...options,
943
+ function Literal(value, options) {
944
+ return CreateType({
862
945
  [Kind]: "Literal",
863
946
  const: value,
864
947
  type: typeof value
865
- };
948
+ }, options);
866
949
  }
867
950
 
868
951
  // node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
869
- function Boolean(options = {}) {
870
- return {
871
- ...options,
872
- [Kind]: "Boolean",
873
- type: "boolean"
874
- };
952
+ function Boolean(options) {
953
+ return CreateType({ [Kind]: "Boolean", type: "boolean" }, options);
875
954
  }
876
955
 
877
956
  // node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
878
- function BigInt(options = {}) {
879
- return {
880
- ...options,
881
- [Kind]: "BigInt",
882
- type: "bigint"
883
- };
957
+ function BigInt(options) {
958
+ return CreateType({ [Kind]: "BigInt", type: "bigint" }, options);
884
959
  }
885
960
 
886
961
  // node_modules/@sinclair/typebox/build/esm/type/number/number.mjs
887
- function Number(options = {}) {
888
- return {
889
- ...options,
890
- [Kind]: "Number",
891
- type: "number"
892
- };
962
+ function Number2(options) {
963
+ return CreateType({ [Kind]: "Number", type: "number" }, options);
893
964
  }
894
965
 
895
966
  // node_modules/@sinclair/typebox/build/esm/type/string/string.mjs
896
- function String(options = {}) {
897
- return { ...options, [Kind]: "String", type: "string" };
967
+ function String(options) {
968
+ return CreateType({ [Kind]: "String", type: "string" }, options);
898
969
  }
899
970
 
900
971
  // node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
901
972
  function* FromUnion(syntax) {
902
973
  const trim = syntax.trim().replace(/"|'/g, "");
903
- return trim === "boolean" ? yield Boolean() : trim === "number" ? yield Number() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String() : yield (() => {
974
+ return trim === "boolean" ? yield Boolean() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String() : yield (() => {
904
975
  const literals = trim.split("|").map((literal) => Literal(literal.trim()));
905
976
  return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
906
977
  })();
@@ -941,7 +1012,7 @@ function Escape(value) {
941
1012
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
942
1013
  }
943
1014
  function Visit2(schema, acc) {
944
- 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}` : (() => {
1015
+ return IsTemplateLiteral(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : IsUnion(schema) ? `(${schema.anyOf.map((schema2) => Visit2(schema2, acc)).join("|")})` : IsNumber3(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}` : (() => {
945
1016
  throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
946
1017
  })();
947
1018
  }
@@ -957,139 +1028,142 @@ function TemplateLiteralToUnion(schema) {
957
1028
  }
958
1029
 
959
1030
  // node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
960
- function TemplateLiteral(unresolved, options = {}) {
1031
+ function TemplateLiteral(unresolved, options) {
961
1032
  const pattern = IsString(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
962
- return { ...options, [Kind]: "TemplateLiteral", type: "string", pattern };
1033
+ return CreateType({ [Kind]: "TemplateLiteral", type: "string", pattern }, options);
963
1034
  }
964
1035
 
965
1036
  // node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
966
- function FromTemplateLiteral(T) {
967
- const R = TemplateLiteralGenerate(T);
968
- return R.map((S) => S.toString());
969
- }
970
- function FromUnion2(T) {
971
- const Acc = [];
972
- for (const L of T)
973
- Acc.push(...IndexPropertyKeys(L));
974
- return Acc;
1037
+ function FromTemplateLiteral(templateLiteral) {
1038
+ const keys = TemplateLiteralGenerate(templateLiteral);
1039
+ return keys.map((key) => key.toString());
1040
+ }
1041
+ function FromUnion2(types) {
1042
+ const result = [];
1043
+ for (const type of types)
1044
+ result.push(...IndexPropertyKeys(type));
1045
+ return result;
975
1046
  }
976
- function FromLiteral(T) {
977
- return [T.toString()];
1047
+ function FromLiteral(literalValue) {
1048
+ return [literalValue.toString()];
978
1049
  }
979
- function IndexPropertyKeys(T) {
980
- return [...new Set(IsTemplateLiteral(T) ? FromTemplateLiteral(T) : IsUnion(T) ? FromUnion2(T.anyOf) : IsLiteral(T) ? FromLiteral(T.const) : IsNumber2(T) ? ["[number]"] : IsInteger(T) ? ["[number]"] : [])];
1050
+ function IndexPropertyKeys(type) {
1051
+ return [...new Set(IsTemplateLiteral(type) ? FromTemplateLiteral(type) : IsUnion(type) ? FromUnion2(type.anyOf) : IsLiteral(type) ? FromLiteral(type.const) : IsNumber3(type) ? ["[number]"] : IsInteger(type) ? ["[number]"] : [])];
981
1052
  }
982
1053
 
983
1054
  // node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
984
- function FromProperties(T, P, options) {
985
- const Acc = {};
986
- for (const K2 of Object.getOwnPropertyNames(P)) {
987
- Acc[K2] = Index(T, IndexPropertyKeys(P[K2]), options);
1055
+ function FromProperties(type, properties, options) {
1056
+ const result = {};
1057
+ for (const K2 of Object.getOwnPropertyNames(properties)) {
1058
+ result[K2] = Index(type, IndexPropertyKeys(properties[K2]), options);
988
1059
  }
989
- return Acc;
1060
+ return result;
990
1061
  }
991
- function FromMappedResult(T, R, options) {
992
- return FromProperties(T, R.properties, options);
1062
+ function FromMappedResult(type, mappedResult, options) {
1063
+ return FromProperties(type, mappedResult.properties, options);
993
1064
  }
994
- function IndexFromMappedResult(T, R, options) {
995
- const P = FromMappedResult(T, R, options);
996
- return MappedResult(P);
1065
+ function IndexFromMappedResult(type, mappedResult, options) {
1066
+ const properties = FromMappedResult(type, mappedResult, options);
1067
+ return MappedResult(properties);
997
1068
  }
998
1069
 
999
1070
  // node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
1000
- function FromRest(T, K) {
1001
- return T.map((L) => IndexFromPropertyKey(L, K));
1071
+ function FromRest(types, key) {
1072
+ return types.map((type) => IndexFromPropertyKey(type, key));
1002
1073
  }
1003
- function FromIntersectRest(T) {
1004
- return T.filter((L) => !IsNever(L));
1074
+ function FromIntersectRest(types) {
1075
+ return types.filter((type) => !IsNever(type));
1005
1076
  }
1006
- function FromIntersect(T, K) {
1007
- return IntersectEvaluated(FromIntersectRest(FromRest(T, K)));
1077
+ function FromIntersect(types, key) {
1078
+ return IntersectEvaluated(FromIntersectRest(FromRest(types, key)));
1008
1079
  }
1009
- function FromUnionRest(T) {
1010
- return T.some((L) => IsNever(L)) ? [] : T;
1080
+ function FromUnionRest(types) {
1081
+ return types.some((L) => IsNever(L)) ? [] : types;
1011
1082
  }
1012
- function FromUnion3(T, K) {
1013
- return UnionEvaluated(FromUnionRest(FromRest(T, K)));
1083
+ function FromUnion3(types, key) {
1084
+ return UnionEvaluated(FromUnionRest(FromRest(types, key)));
1014
1085
  }
1015
- function FromTuple(T, K) {
1016
- return K in T ? T[K] : K === "[number]" ? UnionEvaluated(T) : Never();
1086
+ function FromTuple(types, key) {
1087
+ return key in types ? types[key] : key === "[number]" ? UnionEvaluated(types) : Never();
1017
1088
  }
1018
- function FromArray(T, K) {
1019
- return K === "[number]" ? T : Never();
1089
+ function FromArray(type, key) {
1090
+ return key === "[number]" ? type : Never();
1020
1091
  }
1021
- function FromProperty(T, K) {
1022
- return K in T ? T[K] : Never();
1092
+ function FromProperty(properties, propertyKey) {
1093
+ return propertyKey in properties ? properties[propertyKey] : Never();
1023
1094
  }
1024
- function IndexFromPropertyKey(T, K) {
1025
- 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();
1095
+ function IndexFromPropertyKey(type, propertyKey) {
1096
+ return IsIntersect(type) ? FromIntersect(type.allOf, propertyKey) : IsUnion(type) ? FromUnion3(type.anyOf, propertyKey) : IsTuple(type) ? FromTuple(type.items ?? [], propertyKey) : IsArray3(type) ? FromArray(type.items, propertyKey) : IsObject3(type) ? FromProperty(type.properties, propertyKey) : Never();
1026
1097
  }
1027
- function IndexFromPropertyKeys(T, K) {
1028
- return K.map((L) => IndexFromPropertyKey(T, L));
1098
+ function IndexFromPropertyKeys(type, propertyKeys) {
1099
+ return propertyKeys.map((propertyKey) => IndexFromPropertyKey(type, propertyKey));
1029
1100
  }
1030
- function FromSchema(T, K) {
1031
- return UnionEvaluated(IndexFromPropertyKeys(T, K));
1101
+ function FromSchema(type, propertyKeys) {
1102
+ return UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys));
1032
1103
  }
1033
- function Index(T, K, options = {}) {
1034
- 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);
1104
+ function Index(type, key, options) {
1105
+ if (IsRef(type) || IsRef(key)) {
1106
+ const error = `Index types using Ref parameters require both Type and Key to be of TSchema`;
1107
+ if (!IsSchema(type) || !IsSchema(key))
1108
+ throw new TypeBoxError(error);
1109
+ return Computed("Index", [type, key]);
1110
+ }
1111
+ if (IsMappedResult(key))
1112
+ return IndexFromMappedResult(type, key, options);
1113
+ if (IsMappedKey(key))
1114
+ return IndexFromMappedKey(type, key, options);
1115
+ return CreateType(IsSchema(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
1035
1116
  }
1036
1117
 
1037
1118
  // node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
1038
- function MappedIndexPropertyKey(T, K, options) {
1039
- return { [K]: Index(T, [K], options) };
1119
+ function MappedIndexPropertyKey(type, key, options) {
1120
+ return { [key]: Index(type, [key], Clone(options)) };
1040
1121
  }
1041
- function MappedIndexPropertyKeys(T, K, options) {
1042
- return K.reduce((Acc, L) => {
1043
- return { ...Acc, ...MappedIndexPropertyKey(T, L, options) };
1122
+ function MappedIndexPropertyKeys(type, propertyKeys, options) {
1123
+ return propertyKeys.reduce((result, left) => {
1124
+ return { ...result, ...MappedIndexPropertyKey(type, left, options) };
1044
1125
  }, {});
1045
1126
  }
1046
- function MappedIndexProperties(T, K, options) {
1047
- return MappedIndexPropertyKeys(T, K.keys, options);
1127
+ function MappedIndexProperties(type, mappedKey, options) {
1128
+ return MappedIndexPropertyKeys(type, mappedKey.keys, options);
1048
1129
  }
1049
- function IndexFromMappedKey(T, K, options) {
1050
- const P = MappedIndexProperties(T, K, options);
1051
- return MappedResult(P);
1130
+ function IndexFromMappedKey(type, mappedKey, options) {
1131
+ const properties = MappedIndexProperties(type, mappedKey, options);
1132
+ return MappedResult(properties);
1052
1133
  }
1053
1134
 
1054
1135
  // node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs
1055
- function Iterator(items, options = {}) {
1056
- return {
1057
- ...options,
1058
- [Kind]: "Iterator",
1059
- type: "Iterator",
1060
- items: CloneType(items)
1061
- };
1136
+ function Iterator(items, options) {
1137
+ return CreateType({ [Kind]: "Iterator", type: "Iterator", items }, options);
1062
1138
  }
1063
1139
 
1064
1140
  // node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
1065
- function _Object(properties, options = {}) {
1066
- const propertyKeys = globalThis.Object.getOwnPropertyNames(properties);
1067
- const optionalKeys = propertyKeys.filter((key) => IsOptional(properties[key]));
1068
- const requiredKeys = propertyKeys.filter((name) => !optionalKeys.includes(name));
1069
- const clonedAdditionalProperties = IsSchema(options.additionalProperties) ? { additionalProperties: CloneType(options.additionalProperties) } : {};
1070
- const clonedProperties = {};
1071
- for (const key of propertyKeys)
1072
- clonedProperties[key] = CloneType(properties[key]);
1073
- return requiredKeys.length > 0 ? { ...options, ...clonedAdditionalProperties, [Kind]: "Object", type: "object", properties: clonedProperties, required: requiredKeys } : { ...options, ...clonedAdditionalProperties, [Kind]: "Object", type: "object", properties: clonedProperties };
1141
+ function RequiredKeys(properties) {
1142
+ const keys = [];
1143
+ for (let key in properties) {
1144
+ if (!IsOptional(properties[key]))
1145
+ keys.push(key);
1146
+ }
1147
+ return keys;
1148
+ }
1149
+ function _Object(properties, options) {
1150
+ const required = RequiredKeys(properties);
1151
+ const schematic = required.length > 0 ? { [Kind]: "Object", type: "object", properties, required } : { [Kind]: "Object", type: "object", properties };
1152
+ return CreateType(schematic, options);
1074
1153
  }
1075
1154
  var Object2 = _Object;
1076
1155
 
1077
1156
  // node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs
1078
- function Promise2(item, options = {}) {
1079
- return {
1080
- ...options,
1081
- [Kind]: "Promise",
1082
- type: "Promise",
1083
- item: CloneType(item)
1084
- };
1157
+ function Promise2(item, options) {
1158
+ return CreateType({ [Kind]: "Promise", type: "Promise", item }, options);
1085
1159
  }
1086
1160
 
1087
1161
  // node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs
1088
1162
  function RemoveReadonly(schema) {
1089
- return Discard(CloneType(schema), [ReadonlyKind]);
1163
+ return CreateType(Discard(schema, [ReadonlyKind]));
1090
1164
  }
1091
1165
  function AddReadonly(schema) {
1092
- return { ...CloneType(schema), [ReadonlyKind]: "Readonly" };
1166
+ return CreateType({ ...schema, [ReadonlyKind]: "Readonly" });
1093
1167
  }
1094
1168
  function ReadonlyWithFlag(schema, F) {
1095
1169
  return F === false ? RemoveReadonly(schema) : AddReadonly(schema);
@@ -1115,9 +1189,8 @@ function ReadonlyFromMappedResult(R, F) {
1115
1189
  }
1116
1190
 
1117
1191
  // node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs
1118
- function Tuple(items, options = {}) {
1119
- const [additionalItems, minItems, maxItems] = [false, items.length, items.length];
1120
- return items.length > 0 ? { ...options, [Kind]: "Tuple", type: "array", items: CloneRest(items), additionalItems, minItems, maxItems } : { ...options, [Kind]: "Tuple", type: "array", minItems, maxItems };
1192
+ function Tuple(types, options) {
1193
+ return CreateType(types.length > 0 ? { [Kind]: "Tuple", type: "array", items: types, additionalItems: false, minItems: types.length, maxItems: types.length } : { [Kind]: "Tuple", type: "array", minItems: types.length, maxItems: types.length }, options);
1121
1194
  }
1122
1195
 
1123
1196
  // node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs
@@ -1150,13 +1223,14 @@ function FromProperties3(K, T) {
1150
1223
  return Acc;
1151
1224
  }
1152
1225
  function FromSchemaType(K, T) {
1226
+ const options = { ...T };
1153
1227
  return (
1154
1228
  // unevaluated modifier types
1155
1229
  IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : (
1156
1230
  // unevaluated mapped types
1157
1231
  IsMappedResult(T) ? FromMappedResult3(K, T.properties) : IsMappedKey(T) ? FromMappedKey(K, T.keys) : (
1158
1232
  // unevaluated types
1159
- 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
1233
+ IsConstructor(T) ? Constructor(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsFunction2(T) ? Function(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsAsyncIterator2(T) ? AsyncIterator(FromSchemaType(K, T.items), options) : IsIterator2(T) ? Iterator(FromSchemaType(K, T.items), options) : IsIntersect(T) ? Intersect(FromRest2(K, T.allOf), options) : IsUnion(T) ? Union(FromRest2(K, T.anyOf), options) : IsTuple(T) ? Tuple(FromRest2(K, T.items ?? []), options) : IsObject3(T) ? Object2(FromProperties3(K, T.properties), options) : IsArray3(T) ? Array2(FromSchemaType(K, T.items), options) : IsPromise(T) ? Promise2(FromSchemaType(K, T.item), options) : T
1160
1234
  )
1161
1235
  )
1162
1236
  );
@@ -1167,19 +1241,19 @@ function MappedFunctionReturnType(K, T) {
1167
1241
  Acc[L] = FromSchemaType(L, T);
1168
1242
  return Acc;
1169
1243
  }
1170
- function Mapped(key, map, options = {}) {
1244
+ function Mapped(key, map, options) {
1171
1245
  const K = IsSchema(key) ? IndexPropertyKeys(key) : key;
1172
1246
  const RT = map({ [Kind]: "MappedKey", keys: K });
1173
1247
  const R = MappedFunctionReturnType(K, RT);
1174
- return CloneType(Object2(R), options);
1248
+ return Object2(R, options);
1175
1249
  }
1176
1250
 
1177
1251
  // node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
1178
1252
  function RemoveOptional(schema) {
1179
- return Discard(CloneType(schema), [OptionalKind]);
1253
+ return CreateType(Discard(schema, [OptionalKind]));
1180
1254
  }
1181
1255
  function AddOptional(schema) {
1182
- return { ...CloneType(schema), [OptionalKind]: "Optional" };
1256
+ return CreateType({ ...schema, [OptionalKind]: "Optional" });
1183
1257
  }
1184
1258
  function OptionalWithFlag(schema, F) {
1185
1259
  return F === false ? RemoveOptional(schema) : AddOptional(schema);
@@ -1205,85 +1279,96 @@ function OptionalFromMappedResult(R, F) {
1205
1279
  }
1206
1280
 
1207
1281
  // node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs
1208
- function IntersectCreate(T, options) {
1209
- const allObjects = T.every((schema) => IsObject2(schema));
1210
- const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: CloneType(options.unevaluatedProperties) } : {};
1211
- return options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...options, ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: CloneRest(T) } : { ...options, ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: CloneRest(T) };
1282
+ function IntersectCreate(T, options = {}) {
1283
+ const allObjects = T.every((schema) => IsObject3(schema));
1284
+ const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {};
1285
+ return CreateType(options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: T } : { ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: T }, options);
1212
1286
  }
1213
1287
 
1214
1288
  // node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs
1215
- function IsIntersectOptional(T) {
1216
- return T.every((L) => IsOptional(L));
1289
+ function IsIntersectOptional(types) {
1290
+ return types.every((left) => IsOptional(left));
1217
1291
  }
1218
- function RemoveOptionalFromType2(T) {
1219
- return Discard(T, [OptionalKind]);
1292
+ function RemoveOptionalFromType2(type) {
1293
+ return Discard(type, [OptionalKind]);
1220
1294
  }
1221
- function RemoveOptionalFromRest2(T) {
1222
- return T.map((L) => IsOptional(L) ? RemoveOptionalFromType2(L) : L);
1295
+ function RemoveOptionalFromRest2(types) {
1296
+ return types.map((left) => IsOptional(left) ? RemoveOptionalFromType2(left) : left);
1223
1297
  }
1224
- function ResolveIntersect(T, options) {
1225
- return IsIntersectOptional(T) ? Optional(IntersectCreate(RemoveOptionalFromRest2(T), options)) : IntersectCreate(RemoveOptionalFromRest2(T), options);
1298
+ function ResolveIntersect(types, options) {
1299
+ return IsIntersectOptional(types) ? Optional(IntersectCreate(RemoveOptionalFromRest2(types), options)) : IntersectCreate(RemoveOptionalFromRest2(types), options);
1226
1300
  }
1227
- function IntersectEvaluated(T, options = {}) {
1228
- if (T.length === 0)
1301
+ function IntersectEvaluated(types, options = {}) {
1302
+ if (types.length === 1)
1303
+ return CreateType(types[0], options);
1304
+ if (types.length === 0)
1229
1305
  return Never(options);
1230
- if (T.length === 1)
1231
- return CloneType(T[0], options);
1232
- if (T.some((schema) => IsTransform(schema)))
1306
+ if (types.some((schema) => IsTransform(schema)))
1233
1307
  throw new Error("Cannot intersect transform types");
1234
- return ResolveIntersect(T, options);
1308
+ return ResolveIntersect(types, options);
1235
1309
  }
1236
1310
 
1237
1311
  // node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs
1238
- function Intersect(T, options = {}) {
1239
- if (T.length === 0)
1312
+ function Intersect(types, options) {
1313
+ if (types.length === 1)
1314
+ return CreateType(types[0], options);
1315
+ if (types.length === 0)
1240
1316
  return Never(options);
1241
- if (T.length === 1)
1242
- return CloneType(T[0], options);
1243
- if (T.some((schema) => IsTransform(schema)))
1317
+ if (types.some((schema) => IsTransform(schema)))
1244
1318
  throw new Error("Cannot intersect transform types");
1245
- return IntersectCreate(T, options);
1319
+ return IntersectCreate(types, options);
1320
+ }
1321
+
1322
+ // node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
1323
+ function Ref(...args) {
1324
+ const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]];
1325
+ if (typeof $ref !== "string")
1326
+ throw new TypeBoxError("Ref: $ref must be a string");
1327
+ return CreateType({ [Kind]: "Ref", $ref }, options);
1246
1328
  }
1247
1329
 
1248
1330
  // node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
1249
- function FromRest3(T) {
1250
- return T.map((L) => AwaitedResolve(L));
1331
+ function FromComputed(target, parameters) {
1332
+ return Computed("Awaited", [Computed(target, parameters)]);
1333
+ }
1334
+ function FromRef($ref) {
1335
+ return Computed("Awaited", [Ref($ref)]);
1251
1336
  }
1252
- function FromIntersect2(T) {
1253
- return Intersect(FromRest3(T));
1337
+ function FromIntersect2(types) {
1338
+ return Intersect(FromRest3(types));
1254
1339
  }
1255
- function FromUnion4(T) {
1256
- return Union(FromRest3(T));
1340
+ function FromUnion4(types) {
1341
+ return Union(FromRest3(types));
1257
1342
  }
1258
- function FromPromise(T) {
1259
- return AwaitedResolve(T);
1343
+ function FromPromise(type) {
1344
+ return Awaited(type);
1260
1345
  }
1261
- function AwaitedResolve(T) {
1262
- return IsIntersect(T) ? FromIntersect2(T.allOf) : IsUnion(T) ? FromUnion4(T.anyOf) : IsPromise(T) ? FromPromise(T.item) : T;
1346
+ function FromRest3(types) {
1347
+ return types.map((type) => Awaited(type));
1263
1348
  }
1264
- function Awaited(T, options = {}) {
1265
- return CloneType(AwaitedResolve(T), options);
1349
+ function Awaited(type, options) {
1350
+ return CreateType(IsComputed(type) ? FromComputed(type.target, type.parameters) : IsIntersect(type) ? FromIntersect2(type.allOf) : IsUnion(type) ? FromUnion4(type.anyOf) : IsPromise(type) ? FromPromise(type.item) : IsRef(type) ? FromRef(type.$ref) : type, options);
1266
1351
  }
1267
1352
 
1268
1353
  // node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs
1269
- function FromRest4(T) {
1270
- const Acc = [];
1271
- for (const L of T)
1272
- Acc.push(KeyOfPropertyKeys(L));
1273
- return Acc;
1354
+ function FromRest4(types) {
1355
+ const result = [];
1356
+ for (const L of types)
1357
+ result.push(KeyOfPropertyKeys(L));
1358
+ return result;
1274
1359
  }
1275
- function FromIntersect3(T) {
1276
- const C = FromRest4(T);
1277
- const R = SetUnionMany(C);
1278
- return R;
1360
+ function FromIntersect3(types) {
1361
+ const propertyKeysArray = FromRest4(types);
1362
+ const propertyKeys = SetUnionMany(propertyKeysArray);
1363
+ return propertyKeys;
1279
1364
  }
1280
- function FromUnion5(T) {
1281
- const C = FromRest4(T);
1282
- const R = SetIntersectMany(C);
1283
- return R;
1365
+ function FromUnion5(types) {
1366
+ const propertyKeysArray = FromRest4(types);
1367
+ const propertyKeys = SetIntersectMany(propertyKeysArray);
1368
+ return propertyKeys;
1284
1369
  }
1285
- function FromTuple2(T) {
1286
- return T.map((_, I) => I.toString());
1370
+ function FromTuple2(types) {
1371
+ return types.map((_, indexer) => indexer.toString());
1287
1372
  }
1288
1373
  function FromArray2(_) {
1289
1374
  return ["[number]"];
@@ -1299,39 +1384,44 @@ function FromPatternProperties(patternProperties) {
1299
1384
  return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
1300
1385
  });
1301
1386
  }
1302
- function KeyOfPropertyKeys(T) {
1303
- 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) : [];
1387
+ function KeyOfPropertyKeys(type) {
1388
+ return IsIntersect(type) ? FromIntersect3(type.allOf) : IsUnion(type) ? FromUnion5(type.anyOf) : IsTuple(type) ? FromTuple2(type.items ?? []) : IsArray3(type) ? FromArray2(type.items) : IsObject3(type) ? FromProperties5(type.properties) : IsRecord(type) ? FromPatternProperties(type.patternProperties) : [];
1304
1389
  }
1305
1390
  var includePatternProperties = false;
1306
1391
 
1307
1392
  // node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
1308
- function KeyOfPropertyKeysToRest(T) {
1309
- return T.map((L) => L === "[number]" ? Number() : Literal(L));
1393
+ function FromComputed2(target, parameters) {
1394
+ return Computed("KeyOf", [Computed(target, parameters)]);
1310
1395
  }
1311
- function KeyOf(T, options = {}) {
1312
- if (IsMappedResult(T)) {
1313
- return KeyOfFromMappedResult(T, options);
1314
- } else {
1315
- const K = KeyOfPropertyKeys(T);
1316
- const S = KeyOfPropertyKeysToRest(K);
1317
- const U = UnionEvaluated(S);
1318
- return CloneType(U, options);
1319
- }
1396
+ function FromRef2($ref) {
1397
+ return Computed("KeyOf", [Ref($ref)]);
1398
+ }
1399
+ function KeyOfFromType(type, options) {
1400
+ const propertyKeys = KeyOfPropertyKeys(type);
1401
+ const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys);
1402
+ const result = UnionEvaluated(propertyKeyTypes);
1403
+ return CreateType(result, options);
1404
+ }
1405
+ function KeyOfPropertyKeysToRest(propertyKeys) {
1406
+ return propertyKeys.map((L) => L === "[number]" ? Number2() : Literal(L));
1407
+ }
1408
+ function KeyOf(type, options) {
1409
+ return IsComputed(type) ? FromComputed2(type.target, type.parameters) : IsRef(type) ? FromRef2(type.$ref) : IsMappedResult(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options);
1320
1410
  }
1321
1411
 
1322
1412
  // node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs
1323
- function FromProperties6(K, options) {
1324
- const Acc = {};
1325
- for (const K2 of globalThis.Object.getOwnPropertyNames(K))
1326
- Acc[K2] = KeyOf(K[K2], options);
1327
- return Acc;
1413
+ function FromProperties6(properties, options) {
1414
+ const result = {};
1415
+ for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
1416
+ result[K2] = KeyOf(properties[K2], Clone(options));
1417
+ return result;
1328
1418
  }
1329
- function FromMappedResult5(R, options) {
1330
- return FromProperties6(R.properties, options);
1419
+ function FromMappedResult5(mappedResult, options) {
1420
+ return FromProperties6(mappedResult.properties, options);
1331
1421
  }
1332
- function KeyOfFromMappedResult(R, options) {
1333
- const P = FromMappedResult5(R, options);
1334
- return MappedResult(P);
1422
+ function KeyOfFromMappedResult(mappedResult, options) {
1423
+ const properties = FromMappedResult5(mappedResult, options);
1424
+ return MappedResult(properties);
1335
1425
  }
1336
1426
 
1337
1427
  // node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
@@ -1357,7 +1447,7 @@ function CompositeProperties(T, K) {
1357
1447
  }
1358
1448
  return Acc;
1359
1449
  }
1360
- function Composite(T, options = {}) {
1450
+ function Composite(T, options) {
1361
1451
  const K = CompositeKeys(T);
1362
1452
  const P = CompositeProperties(T, K);
1363
1453
  const R = Object2(P, options);
@@ -1365,44 +1455,33 @@ function Composite(T, options = {}) {
1365
1455
  }
1366
1456
 
1367
1457
  // node_modules/@sinclair/typebox/build/esm/type/date/date.mjs
1368
- function Date2(options = {}) {
1369
- return {
1370
- ...options,
1371
- [Kind]: "Date",
1372
- type: "Date"
1373
- };
1458
+ function Date2(options) {
1459
+ return CreateType({ [Kind]: "Date", type: "Date" }, options);
1374
1460
  }
1375
1461
 
1376
1462
  // node_modules/@sinclair/typebox/build/esm/type/null/null.mjs
1377
- function Null(options = {}) {
1378
- return {
1379
- ...options,
1380
- [Kind]: "Null",
1381
- type: "null"
1382
- };
1463
+ function Null(options) {
1464
+ return CreateType({ [Kind]: "Null", type: "null" }, options);
1383
1465
  }
1384
1466
 
1385
1467
  // node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs
1386
1468
  function Symbol2(options) {
1387
- return { ...options, [Kind]: "Symbol", type: "symbol" };
1469
+ return CreateType({ [Kind]: "Symbol", type: "symbol" }, options);
1388
1470
  }
1389
1471
 
1390
1472
  // node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs
1391
- function Undefined(options = {}) {
1392
- return { ...options, [Kind]: "Undefined", type: "undefined" };
1473
+ function Undefined(options) {
1474
+ return CreateType({ [Kind]: "Undefined", type: "undefined" }, options);
1393
1475
  }
1394
1476
 
1395
1477
  // node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs
1396
- function Uint8Array2(options = {}) {
1397
- return { ...options, [Kind]: "Uint8Array", type: "Uint8Array" };
1478
+ function Uint8Array2(options) {
1479
+ return CreateType({ [Kind]: "Uint8Array", type: "Uint8Array" }, options);
1398
1480
  }
1399
1481
 
1400
1482
  // node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs
1401
- function Unknown(options = {}) {
1402
- return {
1403
- ...options,
1404
- [Kind]: "Unknown"
1405
- };
1483
+ function Unknown(options) {
1484
+ return CreateType({ [Kind]: "Unknown" }, options);
1406
1485
  }
1407
1486
 
1408
1487
  // node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
@@ -1421,86 +1500,17 @@ function ConditionalReadonly(T, root) {
1421
1500
  function FromValue(value, root) {
1422
1501
  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({});
1423
1502
  }
1424
- function Const(T, options = {}) {
1425
- return CloneType(FromValue(T, true), options);
1503
+ function Const(T, options) {
1504
+ return CreateType(FromValue(T, true), options);
1426
1505
  }
1427
1506
 
1428
1507
  // node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
1429
- function ConstructorParameters(schema, options = {}) {
1430
- return Tuple(CloneRest(schema.parameters), { ...options });
1431
- }
1432
-
1433
- // node_modules/@sinclair/typebox/build/esm/type/deref/deref.mjs
1434
- function FromRest5(schema, references) {
1435
- return schema.map((schema2) => Deref(schema2, references));
1436
- }
1437
- function FromProperties8(properties, references) {
1438
- const Acc = {};
1439
- for (const K of globalThis.Object.getOwnPropertyNames(properties)) {
1440
- Acc[K] = Deref(properties[K], references);
1441
- }
1442
- return Acc;
1443
- }
1444
- function FromConstructor(schema, references) {
1445
- schema.parameters = FromRest5(schema.parameters, references);
1446
- schema.returns = Deref(schema.returns, references);
1447
- return schema;
1448
- }
1449
- function FromFunction(schema, references) {
1450
- schema.parameters = FromRest5(schema.parameters, references);
1451
- schema.returns = Deref(schema.returns, references);
1452
- return schema;
1453
- }
1454
- function FromIntersect4(schema, references) {
1455
- schema.allOf = FromRest5(schema.allOf, references);
1456
- return schema;
1457
- }
1458
- function FromUnion6(schema, references) {
1459
- schema.anyOf = FromRest5(schema.anyOf, references);
1460
- return schema;
1461
- }
1462
- function FromTuple3(schema, references) {
1463
- if (IsUndefined(schema.items))
1464
- return schema;
1465
- schema.items = FromRest5(schema.items, references);
1466
- return schema;
1467
- }
1468
- function FromArray4(schema, references) {
1469
- schema.items = Deref(schema.items, references);
1470
- return schema;
1471
- }
1472
- function FromObject(schema, references) {
1473
- schema.properties = FromProperties8(schema.properties, references);
1474
- return schema;
1475
- }
1476
- function FromPromise2(schema, references) {
1477
- schema.item = Deref(schema.item, references);
1478
- return schema;
1479
- }
1480
- function FromAsyncIterator(schema, references) {
1481
- schema.items = Deref(schema.items, references);
1482
- return schema;
1483
- }
1484
- function FromIterator(schema, references) {
1485
- schema.items = Deref(schema.items, references);
1486
- return schema;
1487
- }
1488
- function FromRef(schema, references) {
1489
- const target = references.find((remote) => remote.$id === schema.$ref);
1490
- if (target === void 0)
1491
- throw Error(`Unable to dereference schema with $id ${schema.$ref}`);
1492
- const discard = Discard(target, ["$id"]);
1493
- return Deref(discard, references);
1494
- }
1495
- function DerefResolve(schema, references) {
1496
- 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;
1497
- }
1498
- function Deref(schema, references) {
1499
- return DerefResolve(CloneType(schema), CloneRest(references));
1508
+ function ConstructorParameters(schema, options) {
1509
+ return Tuple(schema.parameters, options);
1500
1510
  }
1501
1511
 
1502
1512
  // node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
1503
- function Enum(item, options = {}) {
1513
+ function Enum(item, options) {
1504
1514
  if (IsUndefined(item))
1505
1515
  throw new Error("Enum undefined or empty");
1506
1516
  const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
@@ -1539,10 +1549,10 @@ function FromAny(left, right) {
1539
1549
  function FromArrayRight(left, right) {
1540
1550
  return type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : type_exports.IsNever(left) ? ExtendsResult.True : ExtendsResult.False;
1541
1551
  }
1542
- function FromArray5(left, right) {
1552
+ function FromArray4(left, right) {
1543
1553
  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));
1544
1554
  }
1545
- function FromAsyncIterator2(left, right) {
1555
+ function FromAsyncIterator(left, right) {
1546
1556
  return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsAsyncIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
1547
1557
  }
1548
1558
  function FromBigInt(left, right) {
@@ -1554,13 +1564,13 @@ function FromBooleanRight(left, right) {
1554
1564
  function FromBoolean(left, right) {
1555
1565
  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;
1556
1566
  }
1557
- function FromConstructor2(left, right) {
1567
+ function FromConstructor(left, right) {
1558
1568
  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));
1559
1569
  }
1560
1570
  function FromDate(left, right) {
1561
1571
  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;
1562
1572
  }
1563
- function FromFunction2(left, right) {
1573
+ function FromFunction(left, right) {
1564
1574
  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));
1565
1575
  }
1566
1576
  function FromIntegerRight(left, right) {
@@ -1572,10 +1582,10 @@ function FromInteger(left, right) {
1572
1582
  function FromIntersectRight(left, right) {
1573
1583
  return right.allOf.every((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1574
1584
  }
1575
- function FromIntersect5(left, right) {
1585
+ function FromIntersect4(left, right) {
1576
1586
  return left.allOf.some((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1577
1587
  }
1578
- function FromIterator2(left, right) {
1588
+ function FromIterator(left, right) {
1579
1589
  return IsStructuralRight(right) ? StructuralRight(left, right) : !type_exports.IsIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit3(left.items, right.items));
1580
1590
  }
1581
1591
  function FromLiteral2(left, right) {
@@ -1634,14 +1644,14 @@ function IsObjectUint8ArrayLike(schema) {
1634
1644
  return IsObjectArrayLike(schema);
1635
1645
  }
1636
1646
  function IsObjectFunctionLike(schema) {
1637
- const length = Number();
1647
+ const length = Number2();
1638
1648
  return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
1639
1649
  }
1640
1650
  function IsObjectConstructorLike(schema) {
1641
1651
  return IsObjectPropertyCount(schema, 0);
1642
1652
  }
1643
1653
  function IsObjectArrayLike(schema) {
1644
- const length = Number();
1654
+ const length = Number2();
1645
1655
  return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit3(schema.properties["length"], length)) === ExtendsResult.True;
1646
1656
  }
1647
1657
  function IsObjectPromiseLike(schema) {
@@ -1658,7 +1668,7 @@ function FromObjectRight(left, right) {
1658
1668
  return IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False;
1659
1669
  })() : ExtendsResult.False;
1660
1670
  }
1661
- function FromObject2(left, right) {
1671
+ function FromObject(left, right) {
1662
1672
  return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : !type_exports.IsObject(right) ? ExtendsResult.False : (() => {
1663
1673
  for (const key of Object.getOwnPropertyNames(right.properties)) {
1664
1674
  if (!(key in left.properties) && !type_exports.IsOptional(right.properties[key])) {
@@ -1674,11 +1684,11 @@ function FromObject2(left, right) {
1674
1684
  return ExtendsResult.True;
1675
1685
  })();
1676
1686
  }
1677
- function FromPromise3(left, right) {
1687
+ function FromPromise2(left, right) {
1678
1688
  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));
1679
1689
  }
1680
1690
  function RecordKey(schema) {
1681
- return PatternNumberExact in schema.patternProperties ? Number() : PatternStringExact in schema.patternProperties ? String() : Throw("Unknown record key pattern");
1691
+ return PatternNumberExact in schema.patternProperties ? Number2() : PatternStringExact in schema.patternProperties ? String() : Throw("Unknown record key pattern");
1682
1692
  }
1683
1693
  function RecordValue(schema) {
1684
1694
  return PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] : PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] : Throw("Unable to get record value schema");
@@ -1720,7 +1730,7 @@ function IsArrayOfTuple(left, right) {
1720
1730
  function FromTupleRight(left, right) {
1721
1731
  return type_exports.IsNever(left) ? ExtendsResult.True : type_exports.IsUnknown(left) ? ExtendsResult.False : type_exports.IsAny(left) ? ExtendsResult.Union : ExtendsResult.False;
1722
1732
  }
1723
- function FromTuple4(left, right) {
1733
+ function FromTuple3(left, right) {
1724
1734
  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;
1725
1735
  }
1726
1736
  function FromUint8Array(left, right) {
@@ -1732,7 +1742,7 @@ function FromUndefined(left, right) {
1732
1742
  function FromUnionRight(left, right) {
1733
1743
  return right.anyOf.some((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1734
1744
  }
1735
- function FromUnion7(left, right) {
1745
+ function FromUnion6(left, right) {
1736
1746
  return left.anyOf.every((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1737
1747
  }
1738
1748
  function FromUnknownRight(left, right) {
@@ -1752,7 +1762,7 @@ function Visit3(left, right) {
1752
1762
  // resolvable
1753
1763
  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) : (
1754
1764
  // standard
1755
- 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]}'`)
1765
+ type_exports.IsAny(left) ? FromAny(left, right) : type_exports.IsArray(left) ? FromArray4(left, right) : type_exports.IsBigInt(left) ? FromBigInt(left, right) : type_exports.IsBoolean(left) ? FromBoolean(left, right) : type_exports.IsAsyncIterator(left) ? FromAsyncIterator(left, right) : type_exports.IsConstructor(left) ? FromConstructor(left, right) : type_exports.IsDate(left) ? FromDate(left, right) : type_exports.IsFunction(left) ? FromFunction(left, right) : type_exports.IsInteger(left) ? FromInteger(left, right) : type_exports.IsIntersect(left) ? FromIntersect4(left, right) : type_exports.IsIterator(left) ? FromIterator(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) ? FromObject(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) ? FromTuple3(left, right) : type_exports.IsPromise(left) ? FromPromise2(left, right) : type_exports.IsUint8Array(left) ? FromUint8Array(left, right) : type_exports.IsUndefined(left) ? FromUndefined(left, right) : type_exports.IsUnion(left) ? FromUnion6(left, right) : type_exports.IsUnknown(left) ? FromUnknown(left, right) : type_exports.IsVoid(left) ? FromVoid(left, right) : Throw(`Unknown left type operand '${left[Kind]}'`)
1756
1766
  )
1757
1767
  );
1758
1768
  }
@@ -1761,14 +1771,14 @@ function ExtendsCheck(left, right) {
1761
1771
  }
1762
1772
 
1763
1773
  // node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs
1764
- function FromProperties9(P, Right, True, False, options) {
1774
+ function FromProperties8(P, Right, True, False, options) {
1765
1775
  const Acc = {};
1766
1776
  for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1767
- Acc[K2] = Extends(P[K2], Right, True, False, options);
1777
+ Acc[K2] = Extends(P[K2], Right, True, False, Clone(options));
1768
1778
  return Acc;
1769
1779
  }
1770
1780
  function FromMappedResult6(Left, Right, True, False, options) {
1771
- return FromProperties9(Left.properties, Right, True, False, options);
1781
+ return FromProperties8(Left.properties, Right, True, False, options);
1772
1782
  }
1773
1783
  function ExtendsFromMappedResult(Left, Right, True, False, options) {
1774
1784
  const P = FromMappedResult6(Left, Right, True, False, options);
@@ -1780,14 +1790,14 @@ function ExtendsResolve(left, right, trueType, falseType) {
1780
1790
  const R = ExtendsCheck(left, right);
1781
1791
  return R === ExtendsResult.Union ? Union([trueType, falseType]) : R === ExtendsResult.True ? trueType : falseType;
1782
1792
  }
1783
- function Extends(L, R, T, F, options = {}) {
1784
- 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);
1793
+ function Extends(L, R, T, F, options) {
1794
+ return IsMappedResult(L) ? ExtendsFromMappedResult(L, R, T, F, options) : IsMappedKey(L) ? CreateType(ExtendsFromMappedKey(L, R, T, F, options)) : CreateType(ExtendsResolve(L, R, T, F), options);
1785
1795
  }
1786
1796
 
1787
1797
  // node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs
1788
1798
  function FromPropertyKey(K, U, L, R, options) {
1789
1799
  return {
1790
- [K]: Extends(Literal(K), U, L, R, options)
1800
+ [K]: Extends(Literal(K), U, L, R, Clone(options))
1791
1801
  };
1792
1802
  }
1793
1803
  function FromPropertyKeys(K, U, L, R, options) {
@@ -1815,21 +1825,21 @@ function ExcludeRest(L, R) {
1815
1825
  }
1816
1826
  function Exclude(L, R, options = {}) {
1817
1827
  if (IsTemplateLiteral(L))
1818
- return CloneType(ExcludeFromTemplateLiteral(L, R), options);
1828
+ return CreateType(ExcludeFromTemplateLiteral(L, R), options);
1819
1829
  if (IsMappedResult(L))
1820
- return CloneType(ExcludeFromMappedResult(L, R), options);
1821
- return CloneType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
1830
+ return CreateType(ExcludeFromMappedResult(L, R), options);
1831
+ return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
1822
1832
  }
1823
1833
 
1824
1834
  // node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
1825
- function FromProperties10(P, U) {
1835
+ function FromProperties9(P, U) {
1826
1836
  const Acc = {};
1827
1837
  for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1828
1838
  Acc[K2] = Exclude(P[K2], U);
1829
1839
  return Acc;
1830
1840
  }
1831
1841
  function FromMappedResult7(R, T) {
1832
- return FromProperties10(R.properties, T);
1842
+ return FromProperties9(R.properties, T);
1833
1843
  }
1834
1844
  function ExcludeFromMappedResult(R, T) {
1835
1845
  const P = FromMappedResult7(R, T);
@@ -1846,23 +1856,23 @@ function ExtractRest(L, R) {
1846
1856
  const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
1847
1857
  return extracted.length === 1 ? extracted[0] : Union(extracted);
1848
1858
  }
1849
- function Extract(L, R, options = {}) {
1859
+ function Extract(L, R, options) {
1850
1860
  if (IsTemplateLiteral(L))
1851
- return CloneType(ExtractFromTemplateLiteral(L, R), options);
1861
+ return CreateType(ExtractFromTemplateLiteral(L, R), options);
1852
1862
  if (IsMappedResult(L))
1853
- return CloneType(ExtractFromMappedResult(L, R), options);
1854
- return CloneType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
1863
+ return CreateType(ExtractFromMappedResult(L, R), options);
1864
+ return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
1855
1865
  }
1856
1866
 
1857
1867
  // node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
1858
- function FromProperties11(P, T) {
1868
+ function FromProperties10(P, T) {
1859
1869
  const Acc = {};
1860
1870
  for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1861
1871
  Acc[K2] = Extract(P[K2], T);
1862
1872
  return Acc;
1863
1873
  }
1864
1874
  function FromMappedResult8(R, T) {
1865
- return FromProperties11(R.properties, T);
1875
+ return FromProperties10(R.properties, T);
1866
1876
  }
1867
1877
  function ExtractFromMappedResult(R, T) {
1868
1878
  const P = FromMappedResult8(R, T);
@@ -1870,29 +1880,26 @@ function ExtractFromMappedResult(R, T) {
1870
1880
  }
1871
1881
 
1872
1882
  // node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
1873
- function InstanceType(schema, options = {}) {
1874
- return CloneType(schema.returns, options);
1883
+ function InstanceType(schema, options) {
1884
+ return CreateType(schema.returns, options);
1875
1885
  }
1876
1886
 
1877
1887
  // node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs
1878
- function Integer(options = {}) {
1879
- return {
1880
- ...options,
1881
- [Kind]: "Integer",
1882
- type: "integer"
1883
- };
1888
+ function Integer(options) {
1889
+ return CreateType({ [Kind]: "Integer", type: "integer" }, options);
1884
1890
  }
1885
1891
 
1886
1892
  // node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs
1887
1893
  function MappedIntrinsicPropertyKey(K, M, options) {
1888
1894
  return {
1889
- [K]: Intrinsic(Literal(K), M, options)
1895
+ [K]: Intrinsic(Literal(K), M, Clone(options))
1890
1896
  };
1891
1897
  }
1892
1898
  function MappedIntrinsicPropertyKeys(K, M, options) {
1893
- return K.reduce((Acc, L) => {
1899
+ const result = K.reduce((Acc, L) => {
1894
1900
  return { ...Acc, ...MappedIntrinsicPropertyKey(L, M, options) };
1895
1901
  }, {});
1902
+ return result;
1896
1903
  }
1897
1904
  function MappedIntrinsicProperties(T, M, options) {
1898
1905
  return MappedIntrinsicPropertyKeys(T["keys"], M, options);
@@ -1924,14 +1931,14 @@ function FromTemplateLiteral3(schema, mode, options) {
1924
1931
  return { ...schema, pattern: FromLiteralValue(schema.pattern, mode) };
1925
1932
  const strings = [...TemplateLiteralExpressionGenerate(expression)];
1926
1933
  const literals = strings.map((value) => Literal(value));
1927
- const mapped = FromRest6(literals, mode);
1934
+ const mapped = FromRest5(literals, mode);
1928
1935
  const union = Union(mapped);
1929
1936
  return TemplateLiteral([union], options);
1930
1937
  }
1931
1938
  function FromLiteralValue(value, mode) {
1932
1939
  return typeof value === "string" ? mode === "Uncapitalize" ? ApplyUncapitalize(value) : mode === "Capitalize" ? ApplyCapitalize(value) : mode === "Uppercase" ? ApplyUppercase(value) : mode === "Lowercase" ? ApplyLowercase(value) : value : value.toString();
1933
1940
  }
1934
- function FromRest6(T, M) {
1941
+ function FromRest5(T, M) {
1935
1942
  return T.map((L) => Intrinsic(L, M));
1936
1943
  }
1937
1944
  function Intrinsic(schema, mode, options = {}) {
@@ -1939,7 +1946,10 @@ function Intrinsic(schema, mode, options = {}) {
1939
1946
  // Intrinsic-Mapped-Inference
1940
1947
  IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode, options) : (
1941
1948
  // Standard-Inference
1942
- IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode, schema) : IsUnion(schema) ? Union(FromRest6(schema.anyOf, mode), options) : IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : schema
1949
+ IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode, options) : IsUnion(schema) ? Union(FromRest5(schema.anyOf, mode), options) : IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : (
1950
+ // Default Type
1951
+ CreateType(schema, options)
1952
+ )
1943
1953
  )
1944
1954
  );
1945
1955
  }
@@ -1964,309 +1974,428 @@ function Uppercase(T, options = {}) {
1964
1974
  return Intrinsic(T, "Uppercase", options);
1965
1975
  }
1966
1976
 
1967
- // node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
1968
- function Not(schema, options) {
1969
- return {
1970
- ...options,
1971
- [Kind]: "Not",
1972
- not: CloneType(schema)
1973
- };
1974
- }
1975
-
1976
1977
  // node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs
1977
- function FromProperties12(P, K, options) {
1978
- const Acc = {};
1979
- for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1980
- Acc[K2] = Omit(P[K2], K, options);
1981
- return Acc;
1978
+ function FromProperties11(properties, propertyKeys, options) {
1979
+ const result = {};
1980
+ for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
1981
+ result[K2] = Omit(properties[K2], propertyKeys, Clone(options));
1982
+ return result;
1982
1983
  }
1983
- function FromMappedResult9(R, K, options) {
1984
- return FromProperties12(R.properties, K, options);
1984
+ function FromMappedResult9(mappedResult, propertyKeys, options) {
1985
+ return FromProperties11(mappedResult.properties, propertyKeys, options);
1985
1986
  }
1986
- function OmitFromMappedResult(R, K, options) {
1987
- const P = FromMappedResult9(R, K, options);
1988
- return MappedResult(P);
1987
+ function OmitFromMappedResult(mappedResult, propertyKeys, options) {
1988
+ const properties = FromMappedResult9(mappedResult, propertyKeys, options);
1989
+ return MappedResult(properties);
1989
1990
  }
1990
1991
 
1991
1992
  // node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
1992
- function FromIntersect6(T, K) {
1993
- return T.map((T2) => OmitResolve(T2, K));
1993
+ function FromIntersect5(types, propertyKeys) {
1994
+ return types.map((type) => OmitResolve(type, propertyKeys));
1994
1995
  }
1995
- function FromUnion8(T, K) {
1996
- return T.map((T2) => OmitResolve(T2, K));
1996
+ function FromUnion7(types, propertyKeys) {
1997
+ return types.map((type) => OmitResolve(type, propertyKeys));
1997
1998
  }
1998
- function FromProperty2(T, K) {
1999
- const { [K]: _, ...R } = T;
1999
+ function FromProperty2(properties, key) {
2000
+ const { [key]: _, ...R } = properties;
2000
2001
  return R;
2001
2002
  }
2002
- function FromProperties13(T, K) {
2003
- return K.reduce((T2, K2) => FromProperty2(T2, K2), T);
2003
+ function FromProperties12(properties, propertyKeys) {
2004
+ return propertyKeys.reduce((T, K2) => FromProperty2(T, K2), properties);
2005
+ }
2006
+ function FromObject2(properties, propertyKeys) {
2007
+ const options = Discard(properties, [TransformKind, "$id", "required", "properties"]);
2008
+ const omittedProperties = FromProperties12(properties["properties"], propertyKeys);
2009
+ return Object2(omittedProperties, options);
2004
2010
  }
2005
- function OmitResolve(T, K) {
2006
- return IsIntersect(T) ? Intersect(FromIntersect6(T.allOf, K)) : IsUnion(T) ? Union(FromUnion8(T.anyOf, K)) : IsObject2(T) ? Object2(FromProperties13(T.properties, K)) : Object2({});
2011
+ function UnionFromPropertyKeys(propertyKeys) {
2012
+ const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
2013
+ return Union(result);
2007
2014
  }
2008
- function Omit(T, K, options = {}) {
2009
- if (IsMappedKey(K))
2010
- return OmitFromMappedKey(T, K, options);
2011
- if (IsMappedResult(T))
2012
- return OmitFromMappedResult(T, K, options);
2013
- const I = IsSchema(K) ? IndexPropertyKeys(K) : K;
2014
- const D = Discard(T, [TransformKind, "$id", "required"]);
2015
- const R = CloneType(OmitResolve(T, I), options);
2016
- return { ...D, ...R };
2015
+ function OmitResolve(properties, propertyKeys) {
2016
+ return IsIntersect(properties) ? Intersect(FromIntersect5(properties.allOf, propertyKeys)) : IsUnion(properties) ? Union(FromUnion7(properties.anyOf, propertyKeys)) : IsObject3(properties) ? FromObject2(properties, propertyKeys) : Object2({});
2017
+ }
2018
+ function Omit(type, key, options) {
2019
+ const typeKey = IsArray(key) ? UnionFromPropertyKeys(key) : key;
2020
+ const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
2021
+ const isTypeRef = IsRef(type);
2022
+ const isKeyRef = IsRef(key);
2023
+ return IsMappedResult(type) ? OmitFromMappedResult(type, propertyKeys, options) : IsMappedKey(key) ? OmitFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Omit", [type, typeKey], options) : CreateType({ ...OmitResolve(type, propertyKeys), ...options });
2017
2024
  }
2018
2025
 
2019
2026
  // node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs
2020
- function FromPropertyKey2(T, K, options) {
2021
- return {
2022
- [K]: Omit(T, [K], options)
2023
- };
2027
+ function FromPropertyKey2(type, key, options) {
2028
+ return { [key]: Omit(type, [key], Clone(options)) };
2024
2029
  }
2025
- function FromPropertyKeys2(T, K, options) {
2026
- return K.reduce((Acc, LK) => {
2027
- return { ...Acc, ...FromPropertyKey2(T, LK, options) };
2030
+ function FromPropertyKeys2(type, propertyKeys, options) {
2031
+ return propertyKeys.reduce((Acc, LK) => {
2032
+ return { ...Acc, ...FromPropertyKey2(type, LK, options) };
2028
2033
  }, {});
2029
2034
  }
2030
- function FromMappedKey3(T, K, options) {
2031
- return FromPropertyKeys2(T, K.keys, options);
2035
+ function FromMappedKey3(type, mappedKey, options) {
2036
+ return FromPropertyKeys2(type, mappedKey.keys, options);
2032
2037
  }
2033
- function OmitFromMappedKey(T, K, options) {
2034
- const P = FromMappedKey3(T, K, options);
2035
- return MappedResult(P);
2038
+ function OmitFromMappedKey(type, mappedKey, options) {
2039
+ const properties = FromMappedKey3(type, mappedKey, options);
2040
+ return MappedResult(properties);
2036
2041
  }
2037
2042
 
2038
- // node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
2039
- function Parameters(schema, options = {}) {
2040
- return Tuple(CloneRest(schema.parameters), { ...options });
2043
+ // node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
2044
+ function FromProperties13(properties, propertyKeys, options) {
2045
+ const result = {};
2046
+ for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
2047
+ result[K2] = Pick(properties[K2], propertyKeys, Clone(options));
2048
+ return result;
2049
+ }
2050
+ function FromMappedResult10(mappedResult, propertyKeys, options) {
2051
+ return FromProperties13(mappedResult.properties, propertyKeys, options);
2052
+ }
2053
+ function PickFromMappedResult(mappedResult, propertyKeys, options) {
2054
+ const properties = FromMappedResult10(mappedResult, propertyKeys, options);
2055
+ return MappedResult(properties);
2041
2056
  }
2042
2057
 
2043
- // node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs
2044
- function FromRest7(T) {
2045
- return T.map((L) => PartialResolve(L));
2058
+ // node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
2059
+ function FromIntersect6(types, propertyKeys) {
2060
+ return types.map((type) => PickResolve(type, propertyKeys));
2046
2061
  }
2047
- function FromProperties14(T) {
2048
- const Acc = {};
2049
- for (const K of globalThis.Object.getOwnPropertyNames(T))
2050
- Acc[K] = Optional(T[K]);
2051
- return Acc;
2062
+ function FromUnion8(types, propertyKeys) {
2063
+ return types.map((type) => PickResolve(type, propertyKeys));
2052
2064
  }
2053
- function PartialResolve(T) {
2054
- return IsIntersect(T) ? Intersect(FromRest7(T.allOf)) : IsUnion(T) ? Union(FromRest7(T.anyOf)) : IsObject2(T) ? Object2(FromProperties14(T.properties)) : Object2({});
2065
+ function FromProperties14(properties, propertyKeys) {
2066
+ const result = {};
2067
+ for (const K2 of propertyKeys)
2068
+ if (K2 in properties)
2069
+ result[K2] = properties[K2];
2070
+ return result;
2055
2071
  }
2056
- function Partial(T, options = {}) {
2057
- if (IsMappedResult(T))
2058
- return PartialFromMappedResult(T, options);
2059
- const D = Discard(T, [TransformKind, "$id", "required"]);
2060
- const R = CloneType(PartialResolve(T), options);
2061
- return { ...D, ...R };
2072
+ function FromObject3(T, K) {
2073
+ const options = Discard(T, [TransformKind, "$id", "required", "properties"]);
2074
+ const properties = FromProperties14(T["properties"], K);
2075
+ return Object2(properties, options);
2062
2076
  }
2063
-
2064
- // node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
2065
- function FromProperties15(K, options) {
2066
- const Acc = {};
2067
- for (const K2 of globalThis.Object.getOwnPropertyNames(K))
2068
- Acc[K2] = Partial(K[K2], options);
2069
- return Acc;
2077
+ function UnionFromPropertyKeys2(propertyKeys) {
2078
+ const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
2079
+ return Union(result);
2070
2080
  }
2071
- function FromMappedResult10(R, options) {
2072
- return FromProperties15(R.properties, options);
2081
+ function PickResolve(properties, propertyKeys) {
2082
+ return IsIntersect(properties) ? Intersect(FromIntersect6(properties.allOf, propertyKeys)) : IsUnion(properties) ? Union(FromUnion8(properties.anyOf, propertyKeys)) : IsObject3(properties) ? FromObject3(properties, propertyKeys) : Object2({});
2073
2083
  }
2074
- function PartialFromMappedResult(R, options) {
2075
- const P = FromMappedResult10(R, options);
2076
- return MappedResult(P);
2084
+ function Pick(type, key, options) {
2085
+ const typeKey = IsArray(key) ? UnionFromPropertyKeys2(key) : key;
2086
+ const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
2087
+ const isTypeRef = IsRef(type);
2088
+ const isKeyRef = IsRef(key);
2089
+ return IsMappedResult(type) ? PickFromMappedResult(type, propertyKeys, options) : IsMappedKey(key) ? PickFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Pick", [type, typeKey], options) : CreateType({ ...PickResolve(type, propertyKeys), ...options });
2077
2090
  }
2078
2091
 
2079
- // node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
2080
- function FromProperties16(P, K, options) {
2081
- const Acc = {};
2082
- for (const K2 of globalThis.Object.getOwnPropertyNames(P))
2083
- Acc[K2] = Pick(P[K2], K, options);
2084
- return Acc;
2092
+ // node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs
2093
+ function FromPropertyKey3(type, key, options) {
2094
+ return {
2095
+ [key]: Pick(type, [key], Clone(options))
2096
+ };
2085
2097
  }
2086
- function FromMappedResult11(R, K, options) {
2087
- return FromProperties16(R.properties, K, options);
2098
+ function FromPropertyKeys3(type, propertyKeys, options) {
2099
+ return propertyKeys.reduce((result, leftKey) => {
2100
+ return { ...result, ...FromPropertyKey3(type, leftKey, options) };
2101
+ }, {});
2088
2102
  }
2089
- function PickFromMappedResult(R, K, options) {
2090
- const P = FromMappedResult11(R, K, options);
2091
- return MappedResult(P);
2103
+ function FromMappedKey4(type, mappedKey, options) {
2104
+ return FromPropertyKeys3(type, mappedKey.keys, options);
2105
+ }
2106
+ function PickFromMappedKey(type, mappedKey, options) {
2107
+ const properties = FromMappedKey4(type, mappedKey, options);
2108
+ return MappedResult(properties);
2092
2109
  }
2093
2110
 
2094
- // node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
2095
- function FromIntersect7(T, K) {
2096
- return T.map((T2) => PickResolve(T2, K));
2111
+ // node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs
2112
+ function FromComputed3(target, parameters) {
2113
+ return Computed("Partial", [Computed(target, parameters)]);
2097
2114
  }
2098
- function FromUnion9(T, K) {
2099
- return T.map((T2) => PickResolve(T2, K));
2115
+ function FromRef3($ref) {
2116
+ return Computed("Partial", [Ref($ref)]);
2100
2117
  }
2101
- function FromProperties17(T, K) {
2102
- const Acc = {};
2103
- for (const K2 of K)
2104
- if (K2 in T)
2105
- Acc[K2] = T[K2];
2106
- return Acc;
2118
+ function FromProperties15(properties) {
2119
+ const partialProperties = {};
2120
+ for (const K of globalThis.Object.getOwnPropertyNames(properties))
2121
+ partialProperties[K] = Optional(properties[K]);
2122
+ return partialProperties;
2107
2123
  }
2108
- function PickResolve(T, K) {
2109
- return IsIntersect(T) ? Intersect(FromIntersect7(T.allOf, K)) : IsUnion(T) ? Union(FromUnion9(T.anyOf, K)) : IsObject2(T) ? Object2(FromProperties17(T.properties, K)) : Object2({});
2124
+ function FromObject4(T) {
2125
+ const options = Discard(T, [TransformKind, "$id", "required", "properties"]);
2126
+ const properties = FromProperties15(T["properties"]);
2127
+ return Object2(properties, options);
2110
2128
  }
2111
- function Pick(T, K, options = {}) {
2112
- if (IsMappedKey(K))
2113
- return PickFromMappedKey(T, K, options);
2114
- if (IsMappedResult(T))
2115
- return PickFromMappedResult(T, K, options);
2116
- const I = IsSchema(K) ? IndexPropertyKeys(K) : K;
2117
- const D = Discard(T, [TransformKind, "$id", "required"]);
2118
- const R = CloneType(PickResolve(T, I), options);
2119
- return { ...D, ...R };
2129
+ function FromRest6(types) {
2130
+ return types.map((type) => PartialResolve(type));
2120
2131
  }
2121
-
2122
- // node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs
2123
- function FromPropertyKey3(T, K, options) {
2124
- return {
2125
- [K]: Pick(T, [K], options)
2126
- };
2132
+ function PartialResolve(type) {
2133
+ return IsComputed(type) ? FromComputed3(type.target, type.parameters) : IsRef(type) ? FromRef3(type.$ref) : IsIntersect(type) ? Intersect(FromRest6(type.allOf)) : IsUnion(type) ? Union(FromRest6(type.anyOf)) : IsObject3(type) ? FromObject4(type) : Object2({});
2127
2134
  }
2128
- function FromPropertyKeys3(T, K, options) {
2129
- return K.reduce((Acc, LK) => {
2130
- return { ...Acc, ...FromPropertyKey3(T, LK, options) };
2131
- }, {});
2135
+ function Partial(type, options) {
2136
+ if (IsMappedResult(type)) {
2137
+ return PartialFromMappedResult(type, options);
2138
+ } else {
2139
+ return CreateType({ ...PartialResolve(type), ...options });
2140
+ }
2132
2141
  }
2133
- function FromMappedKey4(T, K, options) {
2134
- return FromPropertyKeys3(T, K.keys, options);
2142
+
2143
+ // node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
2144
+ function FromProperties16(K, options) {
2145
+ const Acc = {};
2146
+ for (const K2 of globalThis.Object.getOwnPropertyNames(K))
2147
+ Acc[K2] = Partial(K[K2], Clone(options));
2148
+ return Acc;
2135
2149
  }
2136
- function PickFromMappedKey(T, K, options) {
2137
- const P = FromMappedKey4(T, K, options);
2138
- return MappedResult(P);
2150
+ function FromMappedResult11(R, options) {
2151
+ return FromProperties16(R.properties, options);
2139
2152
  }
2140
-
2141
- // node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
2142
- function ReadonlyOptional(schema) {
2143
- return Readonly(Optional(schema));
2153
+ function PartialFromMappedResult(R, options) {
2154
+ const P = FromMappedResult11(R, options);
2155
+ return MappedResult(P);
2144
2156
  }
2145
2157
 
2146
2158
  // node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
2147
2159
  function RecordCreateFromPattern(pattern, T, options) {
2148
- return {
2149
- ...options,
2150
- [Kind]: "Record",
2151
- type: "object",
2152
- patternProperties: { [pattern]: CloneType(T) }
2153
- };
2160
+ return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options);
2154
2161
  }
2155
2162
  function RecordCreateFromKeys(K, T, options) {
2156
- const Acc = {};
2163
+ const result = {};
2157
2164
  for (const K2 of K)
2158
- Acc[K2] = CloneType(T);
2159
- return Object2(Acc, { ...options, [Hint]: "Record" });
2165
+ result[K2] = T;
2166
+ return Object2(result, { ...options, [Hint]: "Record" });
2160
2167
  }
2161
2168
  function FromTemplateLiteralKey(K, T, options) {
2162
2169
  return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
2163
2170
  }
2164
- function FromUnionKey(K, T, options) {
2165
- return RecordCreateFromKeys(IndexPropertyKeys(Union(K)), T, options);
2171
+ function FromUnionKey(key, type, options) {
2172
+ return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
2166
2173
  }
2167
- function FromLiteralKey(K, T, options) {
2168
- return RecordCreateFromKeys([K.toString()], T, options);
2174
+ function FromLiteralKey(key, type, options) {
2175
+ return RecordCreateFromKeys([key.toString()], type, options);
2169
2176
  }
2170
- function FromRegExpKey(K, T, options) {
2171
- return RecordCreateFromPattern(K.source, T, options);
2177
+ function FromRegExpKey(key, type, options) {
2178
+ return RecordCreateFromPattern(key.source, type, options);
2172
2179
  }
2173
- function FromStringKey(K, T, options) {
2174
- const pattern = IsUndefined(K.pattern) ? PatternStringExact : K.pattern;
2175
- return RecordCreateFromPattern(pattern, T, options);
2180
+ function FromStringKey(key, type, options) {
2181
+ const pattern = IsUndefined(key.pattern) ? PatternStringExact : key.pattern;
2182
+ return RecordCreateFromPattern(pattern, type, options);
2176
2183
  }
2177
- function FromIntegerKey(_, T, options) {
2178
- return RecordCreateFromPattern(PatternNumberExact, T, options);
2184
+ function FromAnyKey(_, type, options) {
2185
+ return RecordCreateFromPattern(PatternStringExact, type, options);
2179
2186
  }
2180
- function FromNumberKey(_, T, options) {
2181
- return RecordCreateFromPattern(PatternNumberExact, T, options);
2187
+ function FromNeverKey(_key, type, options) {
2188
+ return RecordCreateFromPattern(PatternNeverExact, type, options);
2182
2189
  }
2183
- function Record(K, T, options = {}) {
2184
- 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);
2190
+ function FromIntegerKey(_key, type, options) {
2191
+ return RecordCreateFromPattern(PatternNumberExact, type, options);
2185
2192
  }
2186
-
2187
- // node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
2188
- var Ordinal = 0;
2189
- function Recursive(callback, options = {}) {
2190
- if (IsUndefined(options.$id))
2191
- options.$id = `T${Ordinal++}`;
2192
- const thisType = callback({ [Kind]: "This", $ref: `${options.$id}` });
2193
- thisType.$id = options.$id;
2194
- return CloneType({ ...options, [Hint]: "Recursive", ...thisType });
2193
+ function FromNumberKey(_, type, options) {
2194
+ return RecordCreateFromPattern(PatternNumberExact, type, options);
2195
2195
  }
2196
-
2197
- // node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
2198
- function Ref(unresolved, options = {}) {
2199
- if (IsString(unresolved))
2200
- return { ...options, [Kind]: "Ref", $ref: unresolved };
2201
- if (IsUndefined(unresolved.$id))
2202
- throw new Error("Reference target type must specify an $id");
2203
- return {
2204
- ...options,
2205
- [Kind]: "Ref",
2206
- $ref: unresolved.$id
2207
- };
2208
- }
2209
-
2210
- // node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
2211
- function RegExp2(unresolved, options = {}) {
2212
- const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
2213
- return { ...options, [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags };
2196
+ function Record(key, type, options = {}) {
2197
+ return IsComputed(type) ? Computed("Record", [key, Computed(type.target, type.parameters)], options) : IsComputed(key) ? Computed("Record", [Computed(type.target, type.parameters), type], options) : IsRef(key) ? Computed("Record", [Ref(key.$ref), type]) : IsUnion(key) ? FromUnionKey(key.anyOf, type, options) : IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type, options) : IsLiteral(key) ? FromLiteralKey(key.const, type, options) : IsInteger(key) ? FromIntegerKey(key, type, options) : IsNumber3(key) ? FromNumberKey(key, type, options) : IsRegExp2(key) ? FromRegExpKey(key, type, options) : IsString2(key) ? FromStringKey(key, type, options) : IsAny(key) ? FromAnyKey(key, type, options) : IsNever(key) ? FromNeverKey(key, type, options) : Never(options);
2214
2198
  }
2215
2199
 
2216
2200
  // node_modules/@sinclair/typebox/build/esm/type/required/required.mjs
2217
- function FromRest8(T) {
2218
- return T.map((L) => RequiredResolve(L));
2201
+ function FromComputed4(target, parameters) {
2202
+ return Computed("Required", [Computed(target, parameters)]);
2219
2203
  }
2220
- function FromProperties18(T) {
2221
- const Acc = {};
2222
- for (const K of globalThis.Object.getOwnPropertyNames(T))
2223
- Acc[K] = Discard(T[K], [OptionalKind]);
2224
- return Acc;
2204
+ function FromRef4($ref) {
2205
+ return Computed("Required", [Ref($ref)]);
2206
+ }
2207
+ function FromProperties17(properties) {
2208
+ const requiredProperties = {};
2209
+ for (const K of globalThis.Object.getOwnPropertyNames(properties))
2210
+ requiredProperties[K] = Discard(properties[K], [OptionalKind]);
2211
+ return requiredProperties;
2212
+ }
2213
+ function FromObject5(type) {
2214
+ const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
2215
+ const properties = FromProperties17(type["properties"]);
2216
+ return Object2(properties, options);
2217
+ }
2218
+ function FromRest7(types) {
2219
+ return types.map((type) => RequiredResolve(type));
2225
2220
  }
2226
- function RequiredResolve(T) {
2227
- return IsIntersect(T) ? Intersect(FromRest8(T.allOf)) : IsUnion(T) ? Union(FromRest8(T.anyOf)) : IsObject2(T) ? Object2(FromProperties18(T.properties)) : Object2({});
2221
+ function RequiredResolve(type) {
2222
+ return IsComputed(type) ? FromComputed4(type.target, type.parameters) : IsRef(type) ? FromRef4(type.$ref) : IsIntersect(type) ? Intersect(FromRest7(type.allOf)) : IsUnion(type) ? Union(FromRest7(type.anyOf)) : IsObject3(type) ? FromObject5(type) : Object2({});
2228
2223
  }
2229
- function Required(T, options = {}) {
2230
- if (IsMappedResult(T)) {
2231
- return RequiredFromMappedResult(T, options);
2224
+ function Required(type, options) {
2225
+ if (IsMappedResult(type)) {
2226
+ return RequiredFromMappedResult(type, options);
2232
2227
  } else {
2233
- const D = Discard(T, [TransformKind, "$id", "required"]);
2234
- const R = CloneType(RequiredResolve(T), options);
2235
- return { ...D, ...R };
2228
+ return CreateType({ ...RequiredResolve(type), ...options });
2236
2229
  }
2237
2230
  }
2238
2231
 
2239
2232
  // node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs
2240
- function FromProperties19(P, options) {
2233
+ function FromProperties18(P, options) {
2241
2234
  const Acc = {};
2242
2235
  for (const K2 of globalThis.Object.getOwnPropertyNames(P))
2243
2236
  Acc[K2] = Required(P[K2], options);
2244
2237
  return Acc;
2245
2238
  }
2246
2239
  function FromMappedResult12(R, options) {
2247
- return FromProperties19(R.properties, options);
2240
+ return FromProperties18(R.properties, options);
2248
2241
  }
2249
2242
  function RequiredFromMappedResult(R, options) {
2250
2243
  const P = FromMappedResult12(R, options);
2251
2244
  return MappedResult(P);
2252
2245
  }
2253
2246
 
2247
+ // node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs
2248
+ function DerefParameters(moduleProperties, types) {
2249
+ return types.map((type) => {
2250
+ return IsRef(type) ? Deref(moduleProperties, type.$ref) : FromType(moduleProperties, type);
2251
+ });
2252
+ }
2253
+ function Deref(moduleProperties, ref) {
2254
+ return ref in moduleProperties ? IsRef(moduleProperties[ref]) ? Deref(moduleProperties, moduleProperties[ref].$ref) : FromType(moduleProperties, moduleProperties[ref]) : Never();
2255
+ }
2256
+ function FromAwaited(parameters) {
2257
+ return Awaited(parameters[0]);
2258
+ }
2259
+ function FromIndex(parameters) {
2260
+ return Index(parameters[0], parameters[1]);
2261
+ }
2262
+ function FromKeyOf(parameters) {
2263
+ return KeyOf(parameters[0]);
2264
+ }
2265
+ function FromPartial(parameters) {
2266
+ return Partial(parameters[0]);
2267
+ }
2268
+ function FromOmit(parameters) {
2269
+ return Omit(parameters[0], parameters[1]);
2270
+ }
2271
+ function FromPick(parameters) {
2272
+ return Pick(parameters[0], parameters[1]);
2273
+ }
2274
+ function FromRecord2(parameters) {
2275
+ return Record(parameters[0], parameters[1]);
2276
+ }
2277
+ function FromRequired(parameters) {
2278
+ return Required(parameters[0]);
2279
+ }
2280
+ function FromComputed5(moduleProperties, target, parameters) {
2281
+ const dereferenced = DerefParameters(moduleProperties, parameters);
2282
+ return target === "Awaited" ? FromAwaited(dereferenced) : target === "Index" ? FromIndex(dereferenced) : target === "KeyOf" ? FromKeyOf(dereferenced) : target === "Partial" ? FromPartial(dereferenced) : target === "Omit" ? FromOmit(dereferenced) : target === "Pick" ? FromPick(dereferenced) : target === "Record" ? FromRecord2(dereferenced) : target === "Required" ? FromRequired(dereferenced) : Never();
2283
+ }
2284
+ function FromObject6(moduleProperties, properties) {
2285
+ return Object2(globalThis.Object.keys(properties).reduce((result, key) => {
2286
+ return { ...result, [key]: FromType(moduleProperties, properties[key]) };
2287
+ }, {}));
2288
+ }
2289
+ function FromConstructor2(moduleProperties, parameters, instanceType) {
2290
+ return Constructor(FromRest8(moduleProperties, parameters), FromType(moduleProperties, instanceType));
2291
+ }
2292
+ function FromFunction2(moduleProperties, parameters, returnType) {
2293
+ return Function(FromRest8(moduleProperties, parameters), FromType(moduleProperties, returnType));
2294
+ }
2295
+ function FromTuple4(moduleProperties, types) {
2296
+ return Tuple(FromRest8(moduleProperties, types));
2297
+ }
2298
+ function FromIntersect7(moduleProperties, types) {
2299
+ return Intersect(FromRest8(moduleProperties, types));
2300
+ }
2301
+ function FromUnion9(moduleProperties, types) {
2302
+ return Union(FromRest8(moduleProperties, types));
2303
+ }
2304
+ function FromArray5(moduleProperties, type) {
2305
+ return Array2(FromType(moduleProperties, type));
2306
+ }
2307
+ function FromAsyncIterator2(moduleProperties, type) {
2308
+ return AsyncIterator(FromType(moduleProperties, type));
2309
+ }
2310
+ function FromIterator2(moduleProperties, type) {
2311
+ return Iterator(FromType(moduleProperties, type));
2312
+ }
2313
+ function FromRest8(moduleProperties, types) {
2314
+ return types.map((type) => FromType(moduleProperties, type));
2315
+ }
2316
+ function FromType(moduleProperties, type) {
2317
+ return (
2318
+ // Modifier Unwrap - Reapplied via CreateType Options
2319
+ IsOptional(type) ? CreateType(FromType(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType(moduleProperties, Discard(type, [ReadonlyKind])), type) : (
2320
+ // Traveral
2321
+ IsArray3(type) ? CreateType(FromArray5(moduleProperties, type.items), type) : IsAsyncIterator2(type) ? CreateType(FromAsyncIterator2(moduleProperties, type.items), type) : IsComputed(type) ? CreateType(FromComputed5(moduleProperties, type.target, type.parameters)) : IsConstructor(type) ? CreateType(FromConstructor2(moduleProperties, type.parameters, type.returns), type) : IsFunction2(type) ? CreateType(FromFunction2(moduleProperties, type.parameters, type.returns), type) : IsIntersect(type) ? CreateType(FromIntersect7(moduleProperties, type.allOf), type) : IsIterator2(type) ? CreateType(FromIterator2(moduleProperties, type.items), type) : IsObject3(type) ? CreateType(FromObject6(moduleProperties, type.properties), type) : IsTuple(type) ? CreateType(FromTuple4(moduleProperties, type.items || []), type) : IsUnion(type) ? CreateType(FromUnion9(moduleProperties, type.anyOf), type) : type
2322
+ )
2323
+ );
2324
+ }
2325
+ function ComputeType(moduleProperties, key) {
2326
+ return key in moduleProperties ? FromType(moduleProperties, moduleProperties[key]) : Never();
2327
+ }
2328
+ function ComputeModuleProperties(moduleProperties) {
2329
+ return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => {
2330
+ return { ...result, [key]: ComputeType(moduleProperties, key) };
2331
+ }, {});
2332
+ }
2333
+
2334
+ // node_modules/@sinclair/typebox/build/esm/type/module/module.mjs
2335
+ var TModule = class {
2336
+ constructor($defs) {
2337
+ const computed = ComputeModuleProperties($defs);
2338
+ const identified = this.WithIdentifiers(computed);
2339
+ this.$defs = identified;
2340
+ }
2341
+ /** `[Json]` Imports a Type by Key. */
2342
+ Import(key, options) {
2343
+ const $defs = { ...this.$defs, [key]: CreateType(this.$defs[key], options) };
2344
+ return CreateType({ [Kind]: "Import", $defs, $ref: key });
2345
+ }
2346
+ // prettier-ignore
2347
+ WithIdentifiers($defs) {
2348
+ return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => {
2349
+ return { ...result, [key]: { ...$defs[key], $id: key } };
2350
+ }, {});
2351
+ }
2352
+ };
2353
+ function Module(properties) {
2354
+ return new TModule(properties);
2355
+ }
2356
+
2357
+ // node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
2358
+ function Not(type, options) {
2359
+ return CreateType({ [Kind]: "Not", not: type }, options);
2360
+ }
2361
+
2362
+ // node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
2363
+ function Parameters(schema, options) {
2364
+ return Tuple(schema.parameters, options);
2365
+ }
2366
+
2367
+ // node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
2368
+ function ReadonlyOptional(schema) {
2369
+ return Readonly(Optional(schema));
2370
+ }
2371
+
2372
+ // node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
2373
+ var Ordinal = 0;
2374
+ function Recursive(callback, options = {}) {
2375
+ if (IsUndefined(options.$id))
2376
+ options.$id = `T${Ordinal++}`;
2377
+ const thisType = CloneType(callback({ [Kind]: "This", $ref: `${options.$id}` }));
2378
+ thisType.$id = options.$id;
2379
+ return CreateType({ [Hint]: "Recursive", ...thisType }, options);
2380
+ }
2381
+
2382
+ // node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
2383
+ function RegExp2(unresolved, options) {
2384
+ const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
2385
+ return CreateType({ [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags }, options);
2386
+ }
2387
+
2254
2388
  // node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs
2255
2389
  function RestResolve(T) {
2256
- return IsIntersect(T) ? CloneRest(T.allOf) : IsUnion(T) ? CloneRest(T.anyOf) : IsTuple(T) ? CloneRest(T.items ?? []) : [];
2390
+ return IsIntersect(T) ? T.allOf : IsUnion(T) ? T.anyOf : IsTuple(T) ? T.items ?? [] : [];
2257
2391
  }
2258
2392
  function Rest(T) {
2259
- return CloneRest(RestResolve(T));
2393
+ return RestResolve(T);
2260
2394
  }
2261
2395
 
2262
2396
  // node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
2263
- function ReturnType(schema, options = {}) {
2264
- return CloneType(schema.returns, options);
2265
- }
2266
-
2267
- // node_modules/@sinclair/typebox/build/esm/type/strict/strict.mjs
2268
- function Strict(schema) {
2269
- return JSON.parse(JSON.stringify(schema));
2397
+ function ReturnType(schema, options) {
2398
+ return CreateType(schema.returns, options);
2270
2399
  }
2271
2400
 
2272
2401
  // node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
@@ -2294,8 +2423,7 @@ var TransformEncodeBuilder = class {
2294
2423
  return { ...schema, [TransformKind]: Codec };
2295
2424
  }
2296
2425
  Encode(encode) {
2297
- const schema = CloneType(this.schema);
2298
- return IsTransform(schema) ? this.EncodeTransform(encode, schema) : this.EncodeSchema(encode, schema);
2426
+ return IsTransform(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema);
2299
2427
  }
2300
2428
  };
2301
2429
  function Transform(schema) {
@@ -2304,24 +2432,17 @@ function Transform(schema) {
2304
2432
 
2305
2433
  // node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs
2306
2434
  function Unsafe(options = {}) {
2307
- return {
2308
- ...options,
2309
- [Kind]: options[Kind] ?? "Unsafe"
2310
- };
2435
+ return CreateType({ [Kind]: options[Kind] ?? "Unsafe" }, options);
2311
2436
  }
2312
2437
 
2313
2438
  // node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
2314
- function Void(options = {}) {
2315
- return {
2316
- ...options,
2317
- [Kind]: "Void",
2318
- type: "void"
2319
- };
2439
+ function Void(options) {
2440
+ return CreateType({ [Kind]: "Void", type: "void" }, options);
2320
2441
  }
2321
2442
 
2322
2443
  // node_modules/@sinclair/typebox/build/esm/type/type/type.mjs
2323
- var type_exports3 = {};
2324
- __export(type_exports3, {
2444
+ var type_exports2 = {};
2445
+ __export(type_exports2, {
2325
2446
  Any: () => Any,
2326
2447
  Array: () => Array2,
2327
2448
  AsyncIterator: () => AsyncIterator,
@@ -2334,7 +2455,6 @@ __export(type_exports3, {
2334
2455
  Constructor: () => Constructor,
2335
2456
  ConstructorParameters: () => ConstructorParameters,
2336
2457
  Date: () => Date2,
2337
- Deref: () => Deref,
2338
2458
  Enum: () => Enum,
2339
2459
  Exclude: () => Exclude,
2340
2460
  Extends: () => Extends,
@@ -2349,10 +2469,11 @@ __export(type_exports3, {
2349
2469
  Literal: () => Literal,
2350
2470
  Lowercase: () => Lowercase,
2351
2471
  Mapped: () => Mapped,
2472
+ Module: () => Module,
2352
2473
  Never: () => Never,
2353
2474
  Not: () => Not,
2354
2475
  Null: () => Null,
2355
- Number: () => Number,
2476
+ Number: () => Number2,
2356
2477
  Object: () => Object2,
2357
2478
  Omit: () => Omit,
2358
2479
  Optional: () => Optional,
@@ -2369,7 +2490,6 @@ __export(type_exports3, {
2369
2490
  Required: () => Required,
2370
2491
  Rest: () => Rest,
2371
2492
  ReturnType: () => ReturnType,
2372
- Strict: () => Strict,
2373
2493
  String: () => String,
2374
2494
  Symbol: () => Symbol2,
2375
2495
  TemplateLiteral: () => TemplateLiteral,
@@ -2386,7 +2506,7 @@ __export(type_exports3, {
2386
2506
  });
2387
2507
 
2388
2508
  // node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
2389
- var Type = type_exports3;
2509
+ var Type = type_exports2;
2390
2510
 
2391
2511
  // src/index.ts
2392
2512
  var jwt = ({
@@ -2461,7 +2581,7 @@ var jwt = ({
2461
2581
  }
2462
2582
  });
2463
2583
  };
2464
- var src_default = jwt;
2584
+ var index_default = jwt;
2465
2585
  // Annotate the CommonJS export names for ESM import in node:
2466
2586
  0 && (module.exports = {
2467
2587
  jwt