@cydm/pie 1.0.4 → 1.0.6

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.
@@ -1,126 +1,74 @@
1
1
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
2
- var __defProp = Object.defineProperty;
3
- var __export = (target, all) => {
4
- for (var name in all)
5
- __defProp(target, name, { get: all[name], enumerable: true });
6
- };
2
+ import {
3
+ __export
4
+ } from "./chunk-TG2EQLX2.js";
7
5
 
8
- // ../../node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
9
- var value_exports = {};
10
- __export(value_exports, {
11
- HasPropertyKey: () => HasPropertyKey,
12
- IsArray: () => IsArray,
13
- IsAsyncIterator: () => IsAsyncIterator,
14
- IsBigInt: () => IsBigInt,
15
- IsBoolean: () => IsBoolean,
16
- IsDate: () => IsDate,
17
- IsFunction: () => IsFunction,
18
- IsIterator: () => IsIterator,
19
- IsNull: () => IsNull,
20
- IsNumber: () => IsNumber,
21
- IsObject: () => IsObject,
22
- IsRegExp: () => IsRegExp,
23
- IsString: () => IsString,
24
- IsSymbol: () => IsSymbol,
25
- IsUint8Array: () => IsUint8Array,
26
- IsUndefined: () => IsUndefined
27
- });
28
- function HasPropertyKey(value, key) {
29
- return key in value;
30
- }
6
+ // ../../node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
31
7
  function IsAsyncIterator(value) {
32
- return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value;
33
- }
34
- function IsArray(value) {
35
- return Array.isArray(value);
36
- }
37
- function IsBigInt(value) {
38
- return typeof value === "bigint";
39
- }
40
- function IsBoolean(value) {
41
- return typeof value === "boolean";
42
- }
43
- function IsDate(value) {
44
- return value instanceof globalThis.Date;
45
- }
46
- function IsFunction(value) {
47
- return typeof value === "function";
8
+ return IsObject(value) && globalThis.Symbol.asyncIterator in value;
48
9
  }
49
10
  function IsIterator(value) {
50
- return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.iterator in value;
11
+ return IsObject(value) && globalThis.Symbol.iterator in value;
51
12
  }
52
- function IsNull(value) {
53
- return value === null;
13
+ function IsStandardObject(value) {
14
+ return IsObject(value) && (globalThis.Object.getPrototypeOf(value) === Object.prototype || globalThis.Object.getPrototypeOf(value) === null);
54
15
  }
55
- function IsNumber(value) {
56
- return typeof value === "number";
16
+ function IsPromise(value) {
17
+ return value instanceof globalThis.Promise;
57
18
  }
58
- function IsObject(value) {
59
- return typeof value === "object" && value !== null;
19
+ function IsDate(value) {
20
+ return value instanceof Date && globalThis.Number.isFinite(value.getTime());
60
21
  }
61
- function IsRegExp(value) {
62
- return value instanceof globalThis.RegExp;
22
+ function IsMap(value) {
23
+ return value instanceof globalThis.Map;
63
24
  }
64
- function IsString(value) {
65
- return typeof value === "string";
25
+ function IsSet(value) {
26
+ return value instanceof globalThis.Set;
66
27
  }
67
- function IsSymbol(value) {
68
- return typeof value === "symbol";
28
+ function IsTypedArray(value) {
29
+ return globalThis.ArrayBuffer.isView(value);
69
30
  }
70
31
  function IsUint8Array(value) {
71
32
  return value instanceof globalThis.Uint8Array;
72
33
  }
73
- function IsUndefined(value) {
74
- return value === void 0;
34
+ function HasPropertyKey(value, key) {
35
+ return key in value;
75
36
  }
76
-
77
- // ../../node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs
78
- function ArrayType(value) {
79
- return value.map((value2) => Visit(value2));
37
+ function IsObject(value) {
38
+ return value !== null && typeof value === "object";
80
39
  }
81
- function DateType(value) {
82
- return new Date(value.getTime());
40
+ function IsArray(value) {
41
+ return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value);
83
42
  }
84
- function Uint8ArrayType(value) {
85
- return new Uint8Array(value);
43
+ function IsUndefined(value) {
44
+ return value === void 0;
86
45
  }
87
- function RegExpType(value) {
88
- return new RegExp(value.source, value.flags);
46
+ function IsNull(value) {
47
+ return value === null;
89
48
  }
90
- function ObjectType(value) {
91
- const result = {};
92
- for (const key of Object.getOwnPropertyNames(value)) {
93
- result[key] = Visit(value[key]);
94
- }
95
- for (const key of Object.getOwnPropertySymbols(value)) {
96
- result[key] = Visit(value[key]);
97
- }
98
- return result;
49
+ function IsBoolean(value) {
50
+ return typeof value === "boolean";
99
51
  }
100
- function Visit(value) {
101
- return IsArray(value) ? ArrayType(value) : IsDate(value) ? DateType(value) : IsUint8Array(value) ? Uint8ArrayType(value) : IsRegExp(value) ? RegExpType(value) : IsObject(value) ? ObjectType(value) : value;
52
+ function IsNumber(value) {
53
+ return typeof value === "number";
102
54
  }
103
- function Clone(value) {
104
- return Visit(value);
55
+ function IsInteger(value) {
56
+ return globalThis.Number.isInteger(value);
105
57
  }
106
-
107
- // ../../node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
108
- function CloneType(schema, options) {
109
- return options === void 0 ? Clone(schema) : Clone({ ...options, ...schema });
58
+ function IsBigInt(value) {
59
+ return typeof value === "bigint";
110
60
  }
111
-
112
- // ../../node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
113
- function IsObject2(value) {
114
- return value !== null && typeof value === "object";
61
+ function IsString(value) {
62
+ return typeof value === "string";
115
63
  }
116
- function IsArray2(value) {
117
- return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value);
64
+ function IsFunction(value) {
65
+ return typeof value === "function";
118
66
  }
119
- function IsUndefined2(value) {
120
- return value === void 0;
67
+ function IsSymbol(value) {
68
+ return typeof value === "symbol";
121
69
  }
122
- function IsNumber2(value) {
123
- return typeof value === "number";
70
+ function IsValueType(value) {
71
+ return IsBigInt(value) || IsBoolean(value) || IsNull(value) || IsNumber(value) || IsString(value) || IsSymbol(value) || IsUndefined(value);
124
72
  }
125
73
 
126
74
  // ../../node_modules/@sinclair/typebox/build/esm/system/policy.mjs
@@ -136,8 +84,8 @@ var TypeSystemPolicy;
136
84
  }
137
85
  TypeSystemPolicy2.IsExactOptionalProperty = IsExactOptionalProperty;
138
86
  function IsObjectLike(value) {
139
- const isObject = IsObject2(value);
140
- return TypeSystemPolicy2.AllowArrayObject ? isObject : isObject && !IsArray2(value);
87
+ const isObject = IsObject(value);
88
+ return TypeSystemPolicy2.AllowArrayObject ? isObject : isObject && !IsArray(value);
141
89
  }
142
90
  TypeSystemPolicy2.IsObjectLike = IsObjectLike;
143
91
  function IsRecordLike(value) {
@@ -145,16 +93,85 @@ var TypeSystemPolicy;
145
93
  }
146
94
  TypeSystemPolicy2.IsRecordLike = IsRecordLike;
147
95
  function IsNumberLike(value) {
148
- return TypeSystemPolicy2.AllowNaN ? IsNumber2(value) : Number.isFinite(value);
96
+ return TypeSystemPolicy2.AllowNaN ? IsNumber(value) : Number.isFinite(value);
149
97
  }
150
98
  TypeSystemPolicy2.IsNumberLike = IsNumberLike;
151
99
  function IsVoidLike(value) {
152
- const isUndefined = IsUndefined2(value);
100
+ const isUndefined = IsUndefined(value);
153
101
  return TypeSystemPolicy2.AllowNullVoid ? isUndefined || value === null : isUndefined;
154
102
  }
155
103
  TypeSystemPolicy2.IsVoidLike = IsVoidLike;
156
104
  })(TypeSystemPolicy || (TypeSystemPolicy = {}));
157
105
 
106
+ // ../../node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
107
+ var value_exports = {};
108
+ __export(value_exports, {
109
+ HasPropertyKey: () => HasPropertyKey2,
110
+ IsArray: () => IsArray2,
111
+ IsAsyncIterator: () => IsAsyncIterator2,
112
+ IsBigInt: () => IsBigInt2,
113
+ IsBoolean: () => IsBoolean2,
114
+ IsDate: () => IsDate2,
115
+ IsFunction: () => IsFunction2,
116
+ IsIterator: () => IsIterator2,
117
+ IsNull: () => IsNull2,
118
+ IsNumber: () => IsNumber2,
119
+ IsObject: () => IsObject2,
120
+ IsRegExp: () => IsRegExp,
121
+ IsString: () => IsString2,
122
+ IsSymbol: () => IsSymbol2,
123
+ IsUint8Array: () => IsUint8Array2,
124
+ IsUndefined: () => IsUndefined2
125
+ });
126
+ function HasPropertyKey2(value, key) {
127
+ return key in value;
128
+ }
129
+ function IsAsyncIterator2(value) {
130
+ return IsObject2(value) && !IsArray2(value) && !IsUint8Array2(value) && Symbol.asyncIterator in value;
131
+ }
132
+ function IsArray2(value) {
133
+ return Array.isArray(value);
134
+ }
135
+ function IsBigInt2(value) {
136
+ return typeof value === "bigint";
137
+ }
138
+ function IsBoolean2(value) {
139
+ return typeof value === "boolean";
140
+ }
141
+ function IsDate2(value) {
142
+ return value instanceof globalThis.Date;
143
+ }
144
+ function IsFunction2(value) {
145
+ return typeof value === "function";
146
+ }
147
+ function IsIterator2(value) {
148
+ return IsObject2(value) && !IsArray2(value) && !IsUint8Array2(value) && Symbol.iterator in value;
149
+ }
150
+ function IsNull2(value) {
151
+ return value === null;
152
+ }
153
+ function IsNumber2(value) {
154
+ return typeof value === "number";
155
+ }
156
+ function IsObject2(value) {
157
+ return typeof value === "object" && value !== null;
158
+ }
159
+ function IsRegExp(value) {
160
+ return value instanceof globalThis.RegExp;
161
+ }
162
+ function IsString2(value) {
163
+ return typeof value === "string";
164
+ }
165
+ function IsSymbol2(value) {
166
+ return typeof value === "symbol";
167
+ }
168
+ function IsUint8Array2(value) {
169
+ return value instanceof globalThis.Uint8Array;
170
+ }
171
+ function IsUndefined2(value) {
172
+ return value === void 0;
173
+ }
174
+
158
175
  // ../../node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs
159
176
  function ImmutableArray(value) {
160
177
  return globalThis.Object.freeze(value).map((value2) => Immutable(value2));
@@ -179,7 +196,37 @@ function ImmutableObject(value) {
179
196
  return globalThis.Object.freeze(result);
180
197
  }
181
198
  function Immutable(value) {
182
- return IsArray(value) ? ImmutableArray(value) : IsDate(value) ? ImmutableDate(value) : IsUint8Array(value) ? ImmutableUint8Array(value) : IsRegExp(value) ? ImmutableRegExp(value) : IsObject(value) ? ImmutableObject(value) : value;
199
+ return IsArray2(value) ? ImmutableArray(value) : IsDate2(value) ? ImmutableDate(value) : IsUint8Array2(value) ? ImmutableUint8Array(value) : IsRegExp(value) ? ImmutableRegExp(value) : IsObject2(value) ? ImmutableObject(value) : value;
200
+ }
201
+
202
+ // ../../node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs
203
+ function ArrayType(value) {
204
+ return value.map((value2) => Visit(value2));
205
+ }
206
+ function DateType(value) {
207
+ return new Date(value.getTime());
208
+ }
209
+ function Uint8ArrayType(value) {
210
+ return new Uint8Array(value);
211
+ }
212
+ function RegExpType(value) {
213
+ return new RegExp(value.source, value.flags);
214
+ }
215
+ function ObjectType(value) {
216
+ const result = {};
217
+ for (const key of Object.getOwnPropertyNames(value)) {
218
+ result[key] = Visit(value[key]);
219
+ }
220
+ for (const key of Object.getOwnPropertySymbols(value)) {
221
+ result[key] = Visit(value[key]);
222
+ }
223
+ return result;
224
+ }
225
+ function Visit(value) {
226
+ return IsArray2(value) ? ArrayType(value) : IsDate2(value) ? DateType(value) : IsUint8Array2(value) ? Uint8ArrayType(value) : IsRegExp(value) ? RegExpType(value) : IsObject2(value) ? ObjectType(value) : value;
227
+ }
228
+ function Clone(value) {
229
+ return Visit(value);
183
230
  }
184
231
 
185
232
  // ../../node_modules/@sinclair/typebox/build/esm/type/create/type.mjs
@@ -195,6 +242,65 @@ function CreateType(schema, options) {
195
242
  }
196
243
  }
197
244
 
245
+ // ../../node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs
246
+ var TransformKind = Symbol.for("TypeBox.Transform");
247
+ var ReadonlyKind = Symbol.for("TypeBox.Readonly");
248
+ var OptionalKind = Symbol.for("TypeBox.Optional");
249
+ var Hint = Symbol.for("TypeBox.Hint");
250
+ var Kind = Symbol.for("TypeBox.Kind");
251
+
252
+ // ../../node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
253
+ function Any(options) {
254
+ return CreateType({ [Kind]: "Any" }, options);
255
+ }
256
+
257
+ // ../../node_modules/@sinclair/typebox/build/esm/type/array/array.mjs
258
+ function Array2(items, options) {
259
+ return CreateType({ [Kind]: "Array", type: "array", items }, options);
260
+ }
261
+
262
+ // ../../node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
263
+ function Boolean(options) {
264
+ return CreateType({ [Kind]: "Boolean", type: "boolean" }, options);
265
+ }
266
+
267
+ // ../../node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
268
+ function DiscardKey(value, key) {
269
+ const { [key]: _, ...rest } = value;
270
+ return rest;
271
+ }
272
+ function Discard(value, keys) {
273
+ return keys.reduce((acc, key) => DiscardKey(acc, key), value);
274
+ }
275
+
276
+ // ../../node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
277
+ function Never(options) {
278
+ return CreateType({ [Kind]: "Never", not: {} }, options);
279
+ }
280
+
281
+ // ../../node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs
282
+ function MappedResult(properties) {
283
+ return CreateType({
284
+ [Kind]: "MappedResult",
285
+ properties
286
+ });
287
+ }
288
+
289
+ // ../../node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
290
+ function AsyncIterator(items, options) {
291
+ return CreateType({ [Kind]: "AsyncIterator", type: "AsyncIterator", items }, options);
292
+ }
293
+
294
+ // ../../node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs
295
+ function Constructor(parameters, returns, options) {
296
+ return CreateType({ [Kind]: "Constructor", type: "Constructor", parameters, returns }, options);
297
+ }
298
+
299
+ // ../../node_modules/@sinclair/typebox/build/esm/type/function/function.mjs
300
+ function Function(parameters, returns, options) {
301
+ return CreateType({ [Kind]: "Function", type: "Function", parameters, returns }, options);
302
+ }
303
+
198
304
  // ../../node_modules/@sinclair/typebox/build/esm/type/error/error.mjs
199
305
  var TypeBoxError = class extends Error {
200
306
  constructor(message) {
@@ -202,19 +308,22 @@ var TypeBoxError = class extends Error {
202
308
  }
203
309
  };
204
310
 
205
- // ../../node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs
206
- var TransformKind = Symbol.for("TypeBox.Transform");
207
- var ReadonlyKind = Symbol.for("TypeBox.Readonly");
208
- var OptionalKind = Symbol.for("TypeBox.Optional");
209
- var Hint = Symbol.for("TypeBox.Hint");
210
- var Kind = Symbol.for("TypeBox.Kind");
311
+ // ../../node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs
312
+ function Computed(target, parameters, options) {
313
+ return CreateType({ [Kind]: "Computed", target, parameters }, options);
314
+ }
315
+
316
+ // ../../node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs
317
+ function UnionCreate(T, options) {
318
+ return CreateType({ [Kind]: "Union", anyOf: T }, options);
319
+ }
211
320
 
212
321
  // ../../node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs
213
322
  function IsReadonly(value) {
214
- return IsObject(value) && value[ReadonlyKind] === "Readonly";
323
+ return IsObject2(value) && value[ReadonlyKind] === "Readonly";
215
324
  }
216
325
  function IsOptional(value) {
217
- return IsObject(value) && value[OptionalKind] === "Optional";
326
+ return IsObject2(value) && value[OptionalKind] === "Optional";
218
327
  }
219
328
  function IsAny(value) {
220
329
  return IsKindOf(value, "Any");
@@ -225,13 +334,13 @@ function IsArgument(value) {
225
334
  function IsArray3(value) {
226
335
  return IsKindOf(value, "Array");
227
336
  }
228
- function IsAsyncIterator2(value) {
337
+ function IsAsyncIterator3(value) {
229
338
  return IsKindOf(value, "AsyncIterator");
230
339
  }
231
- function IsBigInt2(value) {
340
+ function IsBigInt3(value) {
232
341
  return IsKindOf(value, "BigInt");
233
342
  }
234
- function IsBoolean2(value) {
343
+ function IsBoolean3(value) {
235
344
  return IsKindOf(value, "Boolean");
236
345
  }
237
346
  function IsComputed(value) {
@@ -240,26 +349,26 @@ function IsComputed(value) {
240
349
  function IsConstructor(value) {
241
350
  return IsKindOf(value, "Constructor");
242
351
  }
243
- function IsDate2(value) {
352
+ function IsDate3(value) {
244
353
  return IsKindOf(value, "Date");
245
354
  }
246
- function IsFunction2(value) {
355
+ function IsFunction3(value) {
247
356
  return IsKindOf(value, "Function");
248
357
  }
249
- function IsInteger(value) {
358
+ function IsInteger2(value) {
250
359
  return IsKindOf(value, "Integer");
251
360
  }
252
361
  function IsIntersect(value) {
253
362
  return IsKindOf(value, "Intersect");
254
363
  }
255
- function IsIterator2(value) {
364
+ function IsIterator3(value) {
256
365
  return IsKindOf(value, "Iterator");
257
366
  }
258
367
  function IsKindOf(value, kind) {
259
- return IsObject(value) && Kind in value && value[Kind] === kind;
368
+ return IsObject2(value) && Kind in value && value[Kind] === kind;
260
369
  }
261
370
  function IsLiteralValue(value) {
262
- return IsBoolean(value) || IsNumber(value) || IsString(value);
371
+ return IsBoolean2(value) || IsNumber2(value) || IsString2(value);
263
372
  }
264
373
  function IsLiteral(value) {
265
374
  return IsKindOf(value, "Literal");
@@ -276,7 +385,7 @@ function IsNever(value) {
276
385
  function IsNot(value) {
277
386
  return IsKindOf(value, "Not");
278
387
  }
279
- function IsNull2(value) {
388
+ function IsNull3(value) {
280
389
  return IsKindOf(value, "Null");
281
390
  }
282
391
  function IsNumber3(value) {
@@ -285,7 +394,7 @@ function IsNumber3(value) {
285
394
  function IsObject3(value) {
286
395
  return IsKindOf(value, "Object");
287
396
  }
288
- function IsPromise(value) {
397
+ function IsPromise2(value) {
289
398
  return IsKindOf(value, "Promise");
290
399
  }
291
400
  function IsRecord(value) {
@@ -297,10 +406,10 @@ function IsRef(value) {
297
406
  function IsRegExp2(value) {
298
407
  return IsKindOf(value, "RegExp");
299
408
  }
300
- function IsString2(value) {
409
+ function IsString3(value) {
301
410
  return IsKindOf(value, "String");
302
411
  }
303
- function IsSymbol2(value) {
412
+ function IsSymbol3(value) {
304
413
  return IsKindOf(value, "Symbol");
305
414
  }
306
415
  function IsTemplateLiteral(value) {
@@ -310,7 +419,7 @@ function IsThis(value) {
310
419
  return IsKindOf(value, "This");
311
420
  }
312
421
  function IsTransform(value) {
313
- return IsObject(value) && TransformKind in value;
422
+ return IsObject2(value) && TransformKind in value;
314
423
  }
315
424
  function IsTuple(value) {
316
425
  return IsKindOf(value, "Tuple");
@@ -321,7 +430,7 @@ function IsUndefined3(value) {
321
430
  function IsUnion(value) {
322
431
  return IsKindOf(value, "Union");
323
432
  }
324
- function IsUint8Array2(value) {
433
+ function IsUint8Array3(value) {
325
434
  return IsKindOf(value, "Uint8Array");
326
435
  }
327
436
  function IsUnknown(value) {
@@ -334,302 +443,272 @@ function IsVoid(value) {
334
443
  return IsKindOf(value, "Void");
335
444
  }
336
445
  function IsKind(value) {
337
- return IsObject(value) && Kind in value && IsString(value[Kind]);
446
+ return IsObject2(value) && Kind in value && IsString2(value[Kind]);
338
447
  }
339
448
  function IsSchema(value) {
340
- return IsAny(value) || IsArgument(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);
449
+ return IsAny(value) || IsArgument(value) || IsArray3(value) || IsBoolean3(value) || IsBigInt3(value) || IsAsyncIterator3(value) || IsComputed(value) || IsConstructor(value) || IsDate3(value) || IsFunction3(value) || IsInteger2(value) || IsIntersect(value) || IsIterator3(value) || IsLiteral(value) || IsMappedKey(value) || IsMappedResult(value) || IsNever(value) || IsNot(value) || IsNull3(value) || IsNumber3(value) || IsObject3(value) || IsPromise2(value) || IsRecord(value) || IsRef(value) || IsRegExp2(value) || IsString3(value) || IsSymbol3(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined3(value) || IsUnion(value) || IsUint8Array3(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value);
341
450
  }
342
451
 
343
- // ../../node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
344
- var type_exports = {};
345
- __export(type_exports, {
346
- IsAny: () => IsAny2,
347
- IsArgument: () => IsArgument2,
348
- IsArray: () => IsArray4,
349
- IsAsyncIterator: () => IsAsyncIterator3,
350
- IsBigInt: () => IsBigInt3,
351
- IsBoolean: () => IsBoolean3,
352
- IsComputed: () => IsComputed2,
353
- IsConstructor: () => IsConstructor2,
354
- IsDate: () => IsDate3,
355
- IsFunction: () => IsFunction3,
356
- IsImport: () => IsImport,
357
- IsInteger: () => IsInteger2,
358
- IsIntersect: () => IsIntersect2,
359
- IsIterator: () => IsIterator3,
360
- IsKind: () => IsKind2,
361
- IsKindOf: () => IsKindOf2,
362
- IsLiteral: () => IsLiteral2,
363
- IsLiteralBoolean: () => IsLiteralBoolean,
364
- IsLiteralNumber: () => IsLiteralNumber,
365
- IsLiteralString: () => IsLiteralString,
366
- IsLiteralValue: () => IsLiteralValue2,
367
- IsMappedKey: () => IsMappedKey2,
368
- IsMappedResult: () => IsMappedResult2,
369
- IsNever: () => IsNever2,
370
- IsNot: () => IsNot2,
371
- IsNull: () => IsNull3,
372
- IsNumber: () => IsNumber4,
373
- IsObject: () => IsObject4,
374
- IsOptional: () => IsOptional2,
375
- IsPromise: () => IsPromise2,
376
- IsProperties: () => IsProperties,
377
- IsReadonly: () => IsReadonly2,
378
- IsRecord: () => IsRecord2,
379
- IsRecursive: () => IsRecursive,
380
- IsRef: () => IsRef2,
381
- IsRegExp: () => IsRegExp3,
382
- IsSchema: () => IsSchema2,
383
- IsString: () => IsString3,
384
- IsSymbol: () => IsSymbol3,
385
- IsTemplateLiteral: () => IsTemplateLiteral2,
386
- IsThis: () => IsThis2,
387
- IsTransform: () => IsTransform2,
388
- IsTuple: () => IsTuple2,
389
- IsUint8Array: () => IsUint8Array3,
390
- IsUndefined: () => IsUndefined4,
391
- IsUnion: () => IsUnion2,
392
- IsUnionLiteral: () => IsUnionLiteral,
393
- IsUnknown: () => IsUnknown2,
394
- IsUnsafe: () => IsUnsafe2,
395
- IsVoid: () => IsVoid2,
396
- TypeGuardUnknownTypeError: () => TypeGuardUnknownTypeError
397
- });
398
- var TypeGuardUnknownTypeError = class extends TypeBoxError {
399
- };
400
- var KnownTypes = [
401
- "Argument",
402
- "Any",
403
- "Array",
404
- "AsyncIterator",
405
- "BigInt",
406
- "Boolean",
407
- "Computed",
408
- "Constructor",
409
- "Date",
410
- "Enum",
411
- "Function",
412
- "Integer",
413
- "Intersect",
414
- "Iterator",
415
- "Literal",
416
- "MappedKey",
417
- "MappedResult",
418
- "Not",
419
- "Null",
420
- "Number",
421
- "Object",
422
- "Promise",
423
- "Record",
424
- "Ref",
425
- "RegExp",
426
- "String",
427
- "Symbol",
428
- "TemplateLiteral",
429
- "This",
430
- "Tuple",
431
- "Undefined",
432
- "Union",
433
- "Uint8Array",
434
- "Unknown",
435
- "Void"
436
- ];
437
- function IsPattern(value) {
438
- try {
439
- new RegExp(value);
440
- return true;
441
- } catch {
442
- return false;
443
- }
444
- }
445
- function IsControlCharacterFree(value) {
446
- if (!IsString(value))
447
- return false;
448
- for (let i = 0; i < value.length; i++) {
449
- const code = value.charCodeAt(i);
450
- if (code >= 7 && code <= 13 || code === 27 || code === 127) {
451
- return false;
452
- }
453
- }
454
- return true;
455
- }
456
- function IsAdditionalProperties(value) {
457
- return IsOptionalBoolean(value) || IsSchema2(value);
458
- }
459
- function IsOptionalBigInt(value) {
460
- return IsUndefined(value) || IsBigInt(value);
461
- }
462
- function IsOptionalNumber(value) {
463
- return IsUndefined(value) || IsNumber(value);
464
- }
465
- function IsOptionalBoolean(value) {
466
- return IsUndefined(value) || IsBoolean(value);
467
- }
468
- function IsOptionalString(value) {
469
- return IsUndefined(value) || IsString(value);
470
- }
471
- function IsOptionalPattern(value) {
472
- return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value) && IsPattern(value);
473
- }
474
- function IsOptionalFormat(value) {
475
- return IsUndefined(value) || IsString(value) && IsControlCharacterFree(value);
476
- }
477
- function IsOptionalSchema(value) {
478
- return IsUndefined(value) || IsSchema2(value);
479
- }
480
- function IsReadonly2(value) {
481
- return IsObject(value) && value[ReadonlyKind] === "Readonly";
482
- }
483
- function IsOptional2(value) {
484
- return IsObject(value) && value[OptionalKind] === "Optional";
485
- }
486
- function IsAny2(value) {
487
- return IsKindOf2(value, "Any") && IsOptionalString(value.$id);
488
- }
489
- function IsArgument2(value) {
490
- return IsKindOf2(value, "Argument") && IsNumber(value.index);
491
- }
492
- function IsArray4(value) {
493
- 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);
452
+ // ../../node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs
453
+ function IsUnionOptional(types) {
454
+ return types.some((type) => IsOptional(type));
494
455
  }
495
- function IsAsyncIterator3(value) {
496
- return IsKindOf2(value, "AsyncIterator") && value.type === "AsyncIterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
456
+ function RemoveOptionalFromRest(types) {
457
+ return types.map((left) => IsOptional(left) ? RemoveOptionalFromType(left) : left);
497
458
  }
498
- function IsBigInt3(value) {
499
- return IsKindOf2(value, "BigInt") && value.type === "bigint" && IsOptionalString(value.$id) && IsOptionalBigInt(value.exclusiveMaximum) && IsOptionalBigInt(value.exclusiveMinimum) && IsOptionalBigInt(value.maximum) && IsOptionalBigInt(value.minimum) && IsOptionalBigInt(value.multipleOf);
459
+ function RemoveOptionalFromType(T) {
460
+ return Discard(T, [OptionalKind]);
500
461
  }
501
- function IsBoolean3(value) {
502
- return IsKindOf2(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id);
462
+ function ResolveUnion(types, options) {
463
+ const isOptional = IsUnionOptional(types);
464
+ return isOptional ? Optional(UnionCreate(RemoveOptionalFromRest(types), options)) : UnionCreate(RemoveOptionalFromRest(types), options);
503
465
  }
504
- function IsComputed2(value) {
505
- return IsKindOf2(value, "Computed") && IsString(value.target) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema));
466
+ function UnionEvaluated(T, options) {
467
+ return T.length === 1 ? CreateType(T[0], options) : T.length === 0 ? Never(options) : ResolveUnion(T, options);
506
468
  }
507
- function IsConstructor2(value) {
508
- return IsKindOf2(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
469
+
470
+ // ../../node_modules/@sinclair/typebox/build/esm/type/union/union.mjs
471
+ function Union(types, options) {
472
+ return types.length === 0 ? Never(options) : types.length === 1 ? CreateType(types[0], options) : UnionCreate(types, options);
509
473
  }
510
- function IsDate3(value) {
511
- return IsKindOf2(value, "Date") && value.type === "Date" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximumTimestamp) && IsOptionalNumber(value.exclusiveMinimumTimestamp) && IsOptionalNumber(value.maximumTimestamp) && IsOptionalNumber(value.minimumTimestamp) && IsOptionalNumber(value.multipleOfTimestamp);
474
+
475
+ // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs
476
+ var TemplateLiteralParserError = class extends TypeBoxError {
477
+ };
478
+ function Unescape(pattern) {
479
+ return pattern.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
512
480
  }
513
- function IsFunction3(value) {
514
- return IsKindOf2(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
481
+ function IsNonEscaped(pattern, index, char) {
482
+ return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92;
515
483
  }
516
- function IsImport(value) {
517
- return IsKindOf2(value, "Import") && HasPropertyKey(value, "$defs") && IsObject(value.$defs) && IsProperties(value.$defs) && HasPropertyKey(value, "$ref") && IsString(value.$ref) && value.$ref in value.$defs;
484
+ function IsOpenParen(pattern, index) {
485
+ return IsNonEscaped(pattern, index, "(");
518
486
  }
519
- function IsInteger2(value) {
520
- 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);
487
+ function IsCloseParen(pattern, index) {
488
+ return IsNonEscaped(pattern, index, ")");
521
489
  }
522
- function IsProperties(value) {
523
- return IsObject(value) && Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema2(schema));
490
+ function IsSeparator(pattern, index) {
491
+ return IsNonEscaped(pattern, index, "|");
524
492
  }
525
- function IsIntersect2(value) {
526
- return IsKindOf2(value, "Intersect") && (IsString(value.type) && value.type !== "object" ? false : true) && IsArray(value.allOf) && value.allOf.every((schema) => IsSchema2(schema) && !IsTransform2(schema)) && IsOptionalString(value.type) && (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && IsOptionalString(value.$id);
493
+ function IsGroup(pattern) {
494
+ if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1)))
495
+ return false;
496
+ let count = 0;
497
+ for (let index = 0; index < pattern.length; index++) {
498
+ if (IsOpenParen(pattern, index))
499
+ count += 1;
500
+ if (IsCloseParen(pattern, index))
501
+ count -= 1;
502
+ if (count === 0 && index !== pattern.length - 1)
503
+ return false;
504
+ }
505
+ return true;
527
506
  }
528
- function IsIterator3(value) {
529
- return IsKindOf2(value, "Iterator") && value.type === "Iterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
507
+ function InGroup(pattern) {
508
+ return pattern.slice(1, pattern.length - 1);
530
509
  }
531
- function IsKindOf2(value, kind) {
532
- return IsObject(value) && Kind in value && value[Kind] === kind;
510
+ function IsPrecedenceOr(pattern) {
511
+ let count = 0;
512
+ for (let index = 0; index < pattern.length; index++) {
513
+ if (IsOpenParen(pattern, index))
514
+ count += 1;
515
+ if (IsCloseParen(pattern, index))
516
+ count -= 1;
517
+ if (IsSeparator(pattern, index) && count === 0)
518
+ return true;
519
+ }
520
+ return false;
533
521
  }
534
- function IsLiteralString(value) {
535
- return IsLiteral2(value) && IsString(value.const);
522
+ function IsPrecedenceAnd(pattern) {
523
+ for (let index = 0; index < pattern.length; index++) {
524
+ if (IsOpenParen(pattern, index))
525
+ return true;
526
+ }
527
+ return false;
536
528
  }
537
- function IsLiteralNumber(value) {
538
- return IsLiteral2(value) && IsNumber(value.const);
529
+ function Or(pattern) {
530
+ let [count, start] = [0, 0];
531
+ const expressions = [];
532
+ for (let index = 0; index < pattern.length; index++) {
533
+ if (IsOpenParen(pattern, index))
534
+ count += 1;
535
+ if (IsCloseParen(pattern, index))
536
+ count -= 1;
537
+ if (IsSeparator(pattern, index) && count === 0) {
538
+ const range2 = pattern.slice(start, index);
539
+ if (range2.length > 0)
540
+ expressions.push(TemplateLiteralParse(range2));
541
+ start = index + 1;
542
+ }
543
+ }
544
+ const range = pattern.slice(start);
545
+ if (range.length > 0)
546
+ expressions.push(TemplateLiteralParse(range));
547
+ if (expressions.length === 0)
548
+ return { type: "const", const: "" };
549
+ if (expressions.length === 1)
550
+ return expressions[0];
551
+ return { type: "or", expr: expressions };
539
552
  }
540
- function IsLiteralBoolean(value) {
541
- return IsLiteral2(value) && IsBoolean(value.const);
542
- }
543
- function IsLiteral2(value) {
544
- return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue2(value.const);
545
- }
546
- function IsLiteralValue2(value) {
547
- return IsBoolean(value) || IsNumber(value) || IsString(value);
548
- }
549
- function IsMappedKey2(value) {
550
- return IsKindOf2(value, "MappedKey") && IsArray(value.keys) && value.keys.every((key) => IsNumber(key) || IsString(key));
551
- }
552
- function IsMappedResult2(value) {
553
- return IsKindOf2(value, "MappedResult") && IsProperties(value.properties);
554
- }
555
- function IsNever2(value) {
556
- return IsKindOf2(value, "Never") && IsObject(value.not) && Object.getOwnPropertyNames(value.not).length === 0;
557
- }
558
- function IsNot2(value) {
559
- return IsKindOf2(value, "Not") && IsSchema2(value.not);
560
- }
561
- function IsNull3(value) {
562
- return IsKindOf2(value, "Null") && value.type === "null" && IsOptionalString(value.$id);
563
- }
564
- function IsNumber4(value) {
565
- 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);
553
+ function And(pattern) {
554
+ function Group(value, index) {
555
+ if (!IsOpenParen(value, index))
556
+ throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`);
557
+ let count = 0;
558
+ for (let scan = index; scan < value.length; scan++) {
559
+ if (IsOpenParen(value, scan))
560
+ count += 1;
561
+ if (IsCloseParen(value, scan))
562
+ count -= 1;
563
+ if (count === 0)
564
+ return [index, scan];
565
+ }
566
+ throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`);
567
+ }
568
+ function Range(pattern2, index) {
569
+ for (let scan = index; scan < pattern2.length; scan++) {
570
+ if (IsOpenParen(pattern2, scan))
571
+ return [index, scan];
572
+ }
573
+ return [index, pattern2.length];
574
+ }
575
+ const expressions = [];
576
+ for (let index = 0; index < pattern.length; index++) {
577
+ if (IsOpenParen(pattern, index)) {
578
+ const [start, end] = Group(pattern, index);
579
+ const range = pattern.slice(start, end + 1);
580
+ expressions.push(TemplateLiteralParse(range));
581
+ index = end;
582
+ } else {
583
+ const [start, end] = Range(pattern, index);
584
+ const range = pattern.slice(start, end);
585
+ if (range.length > 0)
586
+ expressions.push(TemplateLiteralParse(range));
587
+ index = end - 1;
588
+ }
589
+ }
590
+ return expressions.length === 0 ? { type: "const", const: "" } : expressions.length === 1 ? expressions[0] : { type: "and", expr: expressions };
566
591
  }
567
- function IsObject4(value) {
568
- return IsKindOf2(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);
592
+ function TemplateLiteralParse(pattern) {
593
+ return IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : IsPrecedenceOr(pattern) ? Or(pattern) : IsPrecedenceAnd(pattern) ? And(pattern) : { type: "const", const: Unescape(pattern) };
569
594
  }
570
- function IsPromise2(value) {
571
- return IsKindOf2(value, "Promise") && value.type === "Promise" && IsOptionalString(value.$id) && IsSchema2(value.item);
595
+ function TemplateLiteralParseExact(pattern) {
596
+ return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));
572
597
  }
573
- function IsRecord2(value) {
574
- return IsKindOf2(value, "Record") && value.type === "object" && IsOptionalString(value.$id) && IsAdditionalProperties(value.additionalProperties) && IsObject(value.patternProperties) && ((schema) => {
575
- const keys = Object.getOwnPropertyNames(schema.patternProperties);
576
- return keys.length === 1 && IsPattern(keys[0]) && IsObject(schema.patternProperties) && IsSchema2(schema.patternProperties[keys[0]]);
577
- })(value);
598
+
599
+ // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs
600
+ var TemplateLiteralFiniteError = class extends TypeBoxError {
601
+ };
602
+ function IsNumberExpression(expression) {
603
+ return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "0" && expression.expr[1].type === "const" && expression.expr[1].const === "[1-9][0-9]*";
578
604
  }
579
- function IsRecursive(value) {
580
- return IsObject(value) && Hint in value && value[Hint] === "Recursive";
605
+ function IsBooleanExpression(expression) {
606
+ return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "true" && expression.expr[1].type === "const" && expression.expr[1].const === "false";
581
607
  }
582
- function IsRef2(value) {
583
- return IsKindOf2(value, "Ref") && IsOptionalString(value.$id) && IsString(value.$ref);
608
+ function IsStringExpression(expression) {
609
+ return expression.type === "const" && expression.const === ".*";
584
610
  }
585
- function IsRegExp3(value) {
586
- return IsKindOf2(value, "RegExp") && IsOptionalString(value.$id) && IsString(value.source) && IsString(value.flags) && IsOptionalNumber(value.maxLength) && IsOptionalNumber(value.minLength);
611
+ function IsTemplateLiteralExpressionFinite(expression) {
612
+ return IsNumberExpression(expression) || IsStringExpression(expression) ? false : IsBooleanExpression(expression) ? true : expression.type === "and" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "or" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "const" ? true : (() => {
613
+ throw new TemplateLiteralFiniteError(`Unknown expression type`);
614
+ })();
587
615
  }
588
- function IsString3(value) {
589
- return IsKindOf2(value, "String") && value.type === "string" && IsOptionalString(value.$id) && IsOptionalNumber(value.minLength) && IsOptionalNumber(value.maxLength) && IsOptionalPattern(value.pattern) && IsOptionalFormat(value.format);
616
+ function IsTemplateLiteralFinite(schema) {
617
+ const expression = TemplateLiteralParseExact(schema.pattern);
618
+ return IsTemplateLiteralExpressionFinite(expression);
590
619
  }
591
- function IsSymbol3(value) {
592
- return IsKindOf2(value, "Symbol") && value.type === "symbol" && IsOptionalString(value.$id);
620
+
621
+ // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs
622
+ var TemplateLiteralGenerateError = class extends TypeBoxError {
623
+ };
624
+ function* GenerateReduce(buffer) {
625
+ if (buffer.length === 1)
626
+ return yield* buffer[0];
627
+ for (const left of buffer[0]) {
628
+ for (const right of GenerateReduce(buffer.slice(1))) {
629
+ yield `${left}${right}`;
630
+ }
631
+ }
593
632
  }
594
- function IsTemplateLiteral2(value) {
595
- return IsKindOf2(value, "TemplateLiteral") && value.type === "string" && IsString(value.pattern) && value.pattern[0] === "^" && value.pattern[value.pattern.length - 1] === "$";
633
+ function* GenerateAnd(expression) {
634
+ return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)]));
596
635
  }
597
- function IsThis2(value) {
598
- return IsKindOf2(value, "This") && IsOptionalString(value.$id) && IsString(value.$ref);
636
+ function* GenerateOr(expression) {
637
+ for (const expr of expression.expr)
638
+ yield* TemplateLiteralExpressionGenerate(expr);
599
639
  }
600
- function IsTransform2(value) {
601
- return IsObject(value) && TransformKind in value;
640
+ function* GenerateConst(expression) {
641
+ return yield expression.const;
602
642
  }
603
- function IsTuple2(value) {
604
- return IsKindOf2(value, "Tuple") && value.type === "array" && IsOptionalString(value.$id) && IsNumber(value.minItems) && IsNumber(value.maxItems) && value.minItems === value.maxItems && // empty
605
- (IsUndefined(value.items) && IsUndefined(value.additionalItems) && value.minItems === 0 || IsArray(value.items) && value.items.every((schema) => IsSchema2(schema)));
643
+ function* TemplateLiteralExpressionGenerate(expression) {
644
+ return expression.type === "and" ? yield* GenerateAnd(expression) : expression.type === "or" ? yield* GenerateOr(expression) : expression.type === "const" ? yield* GenerateConst(expression) : (() => {
645
+ throw new TemplateLiteralGenerateError("Unknown expression");
646
+ })();
606
647
  }
607
- function IsUndefined4(value) {
608
- return IsKindOf2(value, "Undefined") && value.type === "undefined" && IsOptionalString(value.$id);
648
+ function TemplateLiteralGenerate(schema) {
649
+ const expression = TemplateLiteralParseExact(schema.pattern);
650
+ return IsTemplateLiteralExpressionFinite(expression) ? [...TemplateLiteralExpressionGenerate(expression)] : [];
609
651
  }
610
- function IsUnionLiteral(value) {
611
- return IsUnion2(value) && value.anyOf.every((schema) => IsLiteralString(schema) || IsLiteralNumber(schema));
652
+
653
+ // ../../node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs
654
+ function Literal(value, options) {
655
+ return CreateType({
656
+ [Kind]: "Literal",
657
+ const: value,
658
+ type: typeof value
659
+ }, options);
612
660
  }
613
- function IsUnion2(value) {
614
- return IsKindOf2(value, "Union") && IsOptionalString(value.$id) && IsObject(value) && IsArray(value.anyOf) && value.anyOf.every((schema) => IsSchema2(schema));
661
+
662
+ // ../../node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
663
+ function BigInt(options) {
664
+ return CreateType({ [Kind]: "BigInt", type: "bigint" }, options);
615
665
  }
616
- function IsUint8Array3(value) {
617
- return IsKindOf2(value, "Uint8Array") && value.type === "Uint8Array" && IsOptionalString(value.$id) && IsOptionalNumber(value.minByteLength) && IsOptionalNumber(value.maxByteLength);
666
+
667
+ // ../../node_modules/@sinclair/typebox/build/esm/type/number/number.mjs
668
+ function Number2(options) {
669
+ return CreateType({ [Kind]: "Number", type: "number" }, options);
618
670
  }
619
- function IsUnknown2(value) {
620
- return IsKindOf2(value, "Unknown") && IsOptionalString(value.$id);
671
+
672
+ // ../../node_modules/@sinclair/typebox/build/esm/type/string/string.mjs
673
+ function String(options) {
674
+ return CreateType({ [Kind]: "String", type: "string" }, options);
621
675
  }
622
- function IsUnsafe2(value) {
623
- return IsKindOf2(value, "Unsafe");
676
+
677
+ // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
678
+ function* FromUnion(syntax) {
679
+ const trim = syntax.trim().replace(/"|'/g, "");
680
+ return trim === "boolean" ? yield Boolean() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String() : yield (() => {
681
+ const literals = trim.split("|").map((literal) => Literal(literal.trim()));
682
+ return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
683
+ })();
624
684
  }
625
- function IsVoid2(value) {
626
- return IsKindOf2(value, "Void") && value.type === "void" && IsOptionalString(value.$id);
685
+ function* FromTerminal(syntax) {
686
+ if (syntax[1] !== "{") {
687
+ const L = Literal("$");
688
+ const R = FromSyntax(syntax.slice(1));
689
+ return yield* [L, ...R];
690
+ }
691
+ for (let i = 2; i < syntax.length; i++) {
692
+ if (syntax[i] === "}") {
693
+ const L = FromUnion(syntax.slice(2, i));
694
+ const R = FromSyntax(syntax.slice(i + 1));
695
+ return yield* [...L, ...R];
696
+ }
697
+ }
698
+ yield Literal(syntax);
627
699
  }
628
- function IsKind2(value) {
629
- return IsObject(value) && Kind in value && IsString(value[Kind]) && !KnownTypes.includes(value[Kind]);
700
+ function* FromSyntax(syntax) {
701
+ for (let i = 0; i < syntax.length; i++) {
702
+ if (syntax[i] === "$") {
703
+ const L = Literal(syntax.slice(0, i));
704
+ const R = FromTerminal(syntax.slice(i));
705
+ return yield* [L, ...R];
706
+ }
707
+ }
708
+ yield Literal(syntax);
630
709
  }
631
- function IsSchema2(value) {
632
- return IsObject(value) && (IsAny2(value) || IsArgument2(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));
710
+ function TemplateLiteralSyntax(syntax) {
711
+ return [...FromSyntax(syntax)];
633
712
  }
634
713
 
635
714
  // ../../node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs
@@ -642,867 +721,809 @@ var PatternNumberExact = `^${PatternNumber}$`;
642
721
  var PatternStringExact = `^${PatternString}$`;
643
722
  var PatternNeverExact = `^${PatternNever}$`;
644
723
 
645
- // ../../node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs
646
- function SetIncludes(T, S) {
647
- return T.includes(S);
648
- }
649
- function SetDistinct(T) {
650
- return [...new Set(T)];
651
- }
652
- function SetIntersect(T, S) {
653
- return T.filter((L) => S.includes(L));
654
- }
655
- function SetIntersectManyResolve(T, Init) {
656
- return T.reduce((Acc, L) => {
657
- return SetIntersect(Acc, L);
658
- }, Init);
724
+ // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs
725
+ var TemplateLiteralPatternError = class extends TypeBoxError {
726
+ };
727
+ function Escape(value) {
728
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
659
729
  }
660
- function SetIntersectMany(T) {
661
- return T.length === 1 ? T[0] : T.length > 1 ? SetIntersectManyResolve(T.slice(1), T[0]) : [];
730
+ function Visit2(schema, acc) {
731
+ 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}` : IsInteger2(schema) ? `${acc}${PatternNumber}` : IsBigInt3(schema) ? `${acc}${PatternNumber}` : IsString3(schema) ? `${acc}${PatternString}` : IsLiteral(schema) ? `${acc}${Escape(schema.const.toString())}` : IsBoolean3(schema) ? `${acc}${PatternBoolean}` : (() => {
732
+ throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
733
+ })();
662
734
  }
663
- function SetUnionMany(T) {
664
- const Acc = [];
665
- for (const L of T)
666
- Acc.push(...L);
667
- return Acc;
735
+ function TemplateLiteralPattern(kinds) {
736
+ return `^${kinds.map((schema) => Visit2(schema, "")).join("")}$`;
668
737
  }
669
738
 
670
- // ../../node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
671
- function Any(options) {
672
- return CreateType({ [Kind]: "Any" }, options);
739
+ // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs
740
+ function TemplateLiteralToUnion(schema) {
741
+ const R = TemplateLiteralGenerate(schema);
742
+ const L = R.map((S) => Literal(S));
743
+ return UnionEvaluated(L);
673
744
  }
674
745
 
675
- // ../../node_modules/@sinclair/typebox/build/esm/type/array/array.mjs
676
- function Array2(items, options) {
677
- return CreateType({ [Kind]: "Array", type: "array", items }, options);
746
+ // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
747
+ function TemplateLiteral(unresolved, options) {
748
+ const pattern = IsString2(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
749
+ return CreateType({ [Kind]: "TemplateLiteral", type: "string", pattern }, options);
678
750
  }
679
751
 
680
- // ../../node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs
681
- function Argument(index) {
682
- return CreateType({ [Kind]: "Argument", index });
752
+ // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
753
+ function FromTemplateLiteral(templateLiteral) {
754
+ const keys = TemplateLiteralGenerate(templateLiteral);
755
+ return keys.map((key) => key.toString());
683
756
  }
684
-
685
- // ../../node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
686
- function AsyncIterator(items, options) {
687
- return CreateType({ [Kind]: "AsyncIterator", type: "AsyncIterator", items }, options);
757
+ function FromUnion2(types) {
758
+ const result = [];
759
+ for (const type of types)
760
+ result.push(...IndexPropertyKeys(type));
761
+ return result;
688
762
  }
689
-
690
- // ../../node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs
691
- function Computed(target, parameters, options) {
692
- return CreateType({ [Kind]: "Computed", target, parameters }, options);
763
+ function FromLiteral(literalValue) {
764
+ return [literalValue.toString()];
765
+ }
766
+ function IndexPropertyKeys(type) {
767
+ return [...new Set(IsTemplateLiteral(type) ? FromTemplateLiteral(type) : IsUnion(type) ? FromUnion2(type.anyOf) : IsLiteral(type) ? FromLiteral(type.const) : IsNumber3(type) ? ["[number]"] : IsInteger2(type) ? ["[number]"] : [])];
693
768
  }
694
769
 
695
- // ../../node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
696
- function DiscardKey(value, key) {
697
- const { [key]: _, ...rest } = value;
698
- return rest;
770
+ // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
771
+ function FromProperties(type, properties, options) {
772
+ const result = {};
773
+ for (const K2 of Object.getOwnPropertyNames(properties)) {
774
+ result[K2] = Index(type, IndexPropertyKeys(properties[K2]), options);
775
+ }
776
+ return result;
699
777
  }
700
- function Discard(value, keys) {
701
- return keys.reduce((acc, key) => DiscardKey(acc, key), value);
778
+ function FromMappedResult(type, mappedResult, options) {
779
+ return FromProperties(type, mappedResult.properties, options);
702
780
  }
703
-
704
- // ../../node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
705
- function Never(options) {
706
- return CreateType({ [Kind]: "Never", not: {} }, options);
781
+ function IndexFromMappedResult(type, mappedResult, options) {
782
+ const properties = FromMappedResult(type, mappedResult, options);
783
+ return MappedResult(properties);
707
784
  }
708
785
 
709
- // ../../node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs
710
- function MappedResult(properties) {
711
- return CreateType({
712
- [Kind]: "MappedResult",
713
- properties
714
- });
786
+ // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
787
+ function FromRest(types, key) {
788
+ return types.map((type) => IndexFromPropertyKey(type, key));
715
789
  }
716
-
717
- // ../../node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs
718
- function Constructor(parameters, returns, options) {
719
- return CreateType({ [Kind]: "Constructor", type: "Constructor", parameters, returns }, options);
790
+ function FromIntersectRest(types) {
791
+ return types.filter((type) => !IsNever(type));
720
792
  }
721
-
722
- // ../../node_modules/@sinclair/typebox/build/esm/type/function/function.mjs
723
- function Function(parameters, returns, options) {
724
- return CreateType({ [Kind]: "Function", type: "Function", parameters, returns }, options);
793
+ function FromIntersect(types, key) {
794
+ return IntersectEvaluated(FromIntersectRest(FromRest(types, key)));
725
795
  }
726
-
727
- // ../../node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs
728
- function UnionCreate(T, options) {
729
- return CreateType({ [Kind]: "Union", anyOf: T }, options);
796
+ function FromUnionRest(types) {
797
+ return types.some((L) => IsNever(L)) ? [] : types;
730
798
  }
731
-
732
- // ../../node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs
733
- function IsUnionOptional(types) {
734
- return types.some((type) => IsOptional(type));
799
+ function FromUnion3(types, key) {
800
+ return UnionEvaluated(FromUnionRest(FromRest(types, key)));
735
801
  }
736
- function RemoveOptionalFromRest(types) {
737
- return types.map((left) => IsOptional(left) ? RemoveOptionalFromType(left) : left);
802
+ function FromTuple(types, key) {
803
+ return key in types ? types[key] : key === "[number]" ? UnionEvaluated(types) : Never();
738
804
  }
739
- function RemoveOptionalFromType(T) {
740
- return Discard(T, [OptionalKind]);
805
+ function FromArray(type, key) {
806
+ return key === "[number]" ? type : Never();
741
807
  }
742
- function ResolveUnion(types, options) {
743
- const isOptional = IsUnionOptional(types);
744
- return isOptional ? Optional(UnionCreate(RemoveOptionalFromRest(types), options)) : UnionCreate(RemoveOptionalFromRest(types), options);
808
+ function FromProperty(properties, propertyKey) {
809
+ return propertyKey in properties ? properties[propertyKey] : Never();
745
810
  }
746
- function UnionEvaluated(T, options) {
747
- return T.length === 1 ? CreateType(T[0], options) : T.length === 0 ? Never(options) : ResolveUnion(T, options);
811
+ function IndexFromPropertyKey(type, propertyKey) {
812
+ 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();
748
813
  }
749
-
750
- // ../../node_modules/@sinclair/typebox/build/esm/type/union/union.mjs
751
- function Union(types, options) {
752
- return types.length === 0 ? Never(options) : types.length === 1 ? CreateType(types[0], options) : UnionCreate(types, options);
814
+ function IndexFromPropertyKeys(type, propertyKeys) {
815
+ return propertyKeys.map((propertyKey) => IndexFromPropertyKey(type, propertyKey));
816
+ }
817
+ function FromSchema(type, propertyKeys) {
818
+ return UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys));
819
+ }
820
+ function Index(type, key, options) {
821
+ if (IsRef(type) || IsRef(key)) {
822
+ const error = `Index types using Ref parameters require both Type and Key to be of TSchema`;
823
+ if (!IsSchema(type) || !IsSchema(key))
824
+ throw new TypeBoxError(error);
825
+ return Computed("Index", [type, key]);
826
+ }
827
+ if (IsMappedResult(key))
828
+ return IndexFromMappedResult(type, key, options);
829
+ if (IsMappedKey(key))
830
+ return IndexFromMappedKey(type, key, options);
831
+ return CreateType(IsSchema(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
753
832
  }
754
833
 
755
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs
756
- var TemplateLiteralParserError = class extends TypeBoxError {
757
- };
758
- function Unescape(pattern) {
759
- return pattern.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
834
+ // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
835
+ function MappedIndexPropertyKey(type, key, options) {
836
+ return { [key]: Index(type, [key], Clone(options)) };
760
837
  }
761
- function IsNonEscaped(pattern, index, char) {
762
- return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92;
838
+ function MappedIndexPropertyKeys(type, propertyKeys, options) {
839
+ return propertyKeys.reduce((result, left) => {
840
+ return { ...result, ...MappedIndexPropertyKey(type, left, options) };
841
+ }, {});
763
842
  }
764
- function IsOpenParen(pattern, index) {
765
- return IsNonEscaped(pattern, index, "(");
843
+ function MappedIndexProperties(type, mappedKey, options) {
844
+ return MappedIndexPropertyKeys(type, mappedKey.keys, options);
766
845
  }
767
- function IsCloseParen(pattern, index) {
768
- return IsNonEscaped(pattern, index, ")");
846
+ function IndexFromMappedKey(type, mappedKey, options) {
847
+ const properties = MappedIndexProperties(type, mappedKey, options);
848
+ return MappedResult(properties);
769
849
  }
770
- function IsSeparator(pattern, index) {
771
- return IsNonEscaped(pattern, index, "|");
850
+
851
+ // ../../node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs
852
+ function Iterator(items, options) {
853
+ return CreateType({ [Kind]: "Iterator", type: "Iterator", items }, options);
772
854
  }
773
- function IsGroup(pattern) {
774
- if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1)))
775
- return false;
776
- let count = 0;
777
- for (let index = 0; index < pattern.length; index++) {
778
- if (IsOpenParen(pattern, index))
779
- count += 1;
780
- if (IsCloseParen(pattern, index))
781
- count -= 1;
782
- if (count === 0 && index !== pattern.length - 1)
783
- return false;
784
- }
785
- return true;
855
+
856
+ // ../../node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
857
+ function RequiredArray(properties) {
858
+ return globalThis.Object.keys(properties).filter((key) => !IsOptional(properties[key]));
786
859
  }
787
- function InGroup(pattern) {
788
- return pattern.slice(1, pattern.length - 1);
860
+ function _Object(properties, options) {
861
+ const required = RequiredArray(properties);
862
+ const schema = required.length > 0 ? { [Kind]: "Object", type: "object", required, properties } : { [Kind]: "Object", type: "object", properties };
863
+ return CreateType(schema, options);
789
864
  }
790
- function IsPrecedenceOr(pattern) {
791
- let count = 0;
792
- for (let index = 0; index < pattern.length; index++) {
793
- if (IsOpenParen(pattern, index))
794
- count += 1;
795
- if (IsCloseParen(pattern, index))
796
- count -= 1;
797
- if (IsSeparator(pattern, index) && count === 0)
798
- return true;
799
- }
800
- return false;
865
+ var Object2 = _Object;
866
+
867
+ // ../../node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs
868
+ function Promise2(item, options) {
869
+ return CreateType({ [Kind]: "Promise", type: "Promise", item }, options);
801
870
  }
802
- function IsPrecedenceAnd(pattern) {
803
- for (let index = 0; index < pattern.length; index++) {
804
- if (IsOpenParen(pattern, index))
805
- return true;
806
- }
807
- return false;
871
+
872
+ // ../../node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs
873
+ function RemoveReadonly(schema) {
874
+ return CreateType(Discard(schema, [ReadonlyKind]));
808
875
  }
809
- function Or(pattern) {
810
- let [count, start] = [0, 0];
811
- const expressions = [];
812
- for (let index = 0; index < pattern.length; index++) {
813
- if (IsOpenParen(pattern, index))
814
- count += 1;
815
- if (IsCloseParen(pattern, index))
816
- count -= 1;
817
- if (IsSeparator(pattern, index) && count === 0) {
818
- const range2 = pattern.slice(start, index);
819
- if (range2.length > 0)
820
- expressions.push(TemplateLiteralParse(range2));
821
- start = index + 1;
822
- }
823
- }
824
- const range = pattern.slice(start);
825
- if (range.length > 0)
826
- expressions.push(TemplateLiteralParse(range));
827
- if (expressions.length === 0)
828
- return { type: "const", const: "" };
829
- if (expressions.length === 1)
830
- return expressions[0];
831
- return { type: "or", expr: expressions };
876
+ function AddReadonly(schema) {
877
+ return CreateType({ ...schema, [ReadonlyKind]: "Readonly" });
832
878
  }
833
- function And(pattern) {
834
- function Group(value, index) {
835
- if (!IsOpenParen(value, index))
836
- throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`);
837
- let count = 0;
838
- for (let scan = index; scan < value.length; scan++) {
839
- if (IsOpenParen(value, scan))
840
- count += 1;
841
- if (IsCloseParen(value, scan))
842
- count -= 1;
843
- if (count === 0)
844
- return [index, scan];
845
- }
846
- throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`);
847
- }
848
- function Range(pattern2, index) {
849
- for (let scan = index; scan < pattern2.length; scan++) {
850
- if (IsOpenParen(pattern2, scan))
851
- return [index, scan];
852
- }
853
- return [index, pattern2.length];
854
- }
855
- const expressions = [];
856
- for (let index = 0; index < pattern.length; index++) {
857
- if (IsOpenParen(pattern, index)) {
858
- const [start, end] = Group(pattern, index);
859
- const range = pattern.slice(start, end + 1);
860
- expressions.push(TemplateLiteralParse(range));
861
- index = end;
862
- } else {
863
- const [start, end] = Range(pattern, index);
864
- const range = pattern.slice(start, end);
865
- if (range.length > 0)
866
- expressions.push(TemplateLiteralParse(range));
867
- index = end - 1;
868
- }
869
- }
870
- return expressions.length === 0 ? { type: "const", const: "" } : expressions.length === 1 ? expressions[0] : { type: "and", expr: expressions };
879
+ function ReadonlyWithFlag(schema, F) {
880
+ return F === false ? RemoveReadonly(schema) : AddReadonly(schema);
871
881
  }
872
- function TemplateLiteralParse(pattern) {
873
- return IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : IsPrecedenceOr(pattern) ? Or(pattern) : IsPrecedenceAnd(pattern) ? And(pattern) : { type: "const", const: Unescape(pattern) };
882
+ function Readonly(schema, enable) {
883
+ const F = enable ?? true;
884
+ return IsMappedResult(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F);
874
885
  }
875
- function TemplateLiteralParseExact(pattern) {
876
- return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));
886
+
887
+ // ../../node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs
888
+ function FromProperties2(K, F) {
889
+ const Acc = {};
890
+ for (const K2 of globalThis.Object.getOwnPropertyNames(K))
891
+ Acc[K2] = Readonly(K[K2], F);
892
+ return Acc;
893
+ }
894
+ function FromMappedResult2(R, F) {
895
+ return FromProperties2(R.properties, F);
896
+ }
897
+ function ReadonlyFromMappedResult(R, F) {
898
+ const P = FromMappedResult2(R, F);
899
+ return MappedResult(P);
900
+ }
901
+
902
+ // ../../node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs
903
+ function Tuple(types, options) {
904
+ 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);
877
905
  }
878
906
 
879
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs
880
- var TemplateLiteralFiniteError = class extends TypeBoxError {
881
- };
882
- function IsNumberExpression(expression) {
883
- return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "0" && expression.expr[1].type === "const" && expression.expr[1].const === "[1-9][0-9]*";
907
+ // ../../node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs
908
+ function SetIncludes(T, S) {
909
+ return T.includes(S);
884
910
  }
885
- function IsBooleanExpression(expression) {
886
- return expression.type === "or" && expression.expr.length === 2 && expression.expr[0].type === "const" && expression.expr[0].const === "true" && expression.expr[1].type === "const" && expression.expr[1].const === "false";
911
+ function SetDistinct(T) {
912
+ return [...new Set(T)];
887
913
  }
888
- function IsStringExpression(expression) {
889
- return expression.type === "const" && expression.const === ".*";
914
+ function SetIntersect(T, S) {
915
+ return T.filter((L) => S.includes(L));
890
916
  }
891
- function IsTemplateLiteralExpressionFinite(expression) {
892
- return IsNumberExpression(expression) || IsStringExpression(expression) ? false : IsBooleanExpression(expression) ? true : expression.type === "and" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "or" ? expression.expr.every((expr) => IsTemplateLiteralExpressionFinite(expr)) : expression.type === "const" ? true : (() => {
893
- throw new TemplateLiteralFiniteError(`Unknown expression type`);
894
- })();
917
+ function SetIntersectManyResolve(T, Init) {
918
+ return T.reduce((Acc, L) => {
919
+ return SetIntersect(Acc, L);
920
+ }, Init);
895
921
  }
896
- function IsTemplateLiteralFinite(schema) {
897
- const expression = TemplateLiteralParseExact(schema.pattern);
898
- return IsTemplateLiteralExpressionFinite(expression);
922
+ function SetIntersectMany(T) {
923
+ return T.length === 1 ? T[0] : T.length > 1 ? SetIntersectManyResolve(T.slice(1), T[0]) : [];
899
924
  }
900
-
901
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs
902
- var TemplateLiteralGenerateError = class extends TypeBoxError {
903
- };
904
- function* GenerateReduce(buffer) {
905
- if (buffer.length === 1)
906
- return yield* buffer[0];
907
- for (const left of buffer[0]) {
908
- for (const right of GenerateReduce(buffer.slice(1))) {
909
- yield `${left}${right}`;
910
- }
911
- }
925
+ function SetUnionMany(T) {
926
+ const Acc = [];
927
+ for (const L of T)
928
+ Acc.push(...L);
929
+ return Acc;
912
930
  }
913
- function* GenerateAnd(expression) {
914
- return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)]));
931
+
932
+ // ../../node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs
933
+ function FromMappedResult3(K, P) {
934
+ return K in P ? FromSchemaType(K, P[K]) : MappedResult(P);
915
935
  }
916
- function* GenerateOr(expression) {
917
- for (const expr of expression.expr)
918
- yield* TemplateLiteralExpressionGenerate(expr);
936
+ function MappedKeyToKnownMappedResultProperties(K) {
937
+ return { [K]: Literal(K) };
919
938
  }
920
- function* GenerateConst(expression) {
921
- return yield expression.const;
939
+ function MappedKeyToUnknownMappedResultProperties(P) {
940
+ const Acc = {};
941
+ for (const L of P)
942
+ Acc[L] = Literal(L);
943
+ return Acc;
922
944
  }
923
- function* TemplateLiteralExpressionGenerate(expression) {
924
- return expression.type === "and" ? yield* GenerateAnd(expression) : expression.type === "or" ? yield* GenerateOr(expression) : expression.type === "const" ? yield* GenerateConst(expression) : (() => {
925
- throw new TemplateLiteralGenerateError("Unknown expression");
926
- })();
945
+ function MappedKeyToMappedResultProperties(K, P) {
946
+ return SetIncludes(P, K) ? MappedKeyToKnownMappedResultProperties(K) : MappedKeyToUnknownMappedResultProperties(P);
927
947
  }
928
- function TemplateLiteralGenerate(schema) {
929
- const expression = TemplateLiteralParseExact(schema.pattern);
930
- return IsTemplateLiteralExpressionFinite(expression) ? [...TemplateLiteralExpressionGenerate(expression)] : [];
948
+ function FromMappedKey(K, P) {
949
+ const R = MappedKeyToMappedResultProperties(K, P);
950
+ return FromMappedResult3(K, R);
931
951
  }
932
-
933
- // ../../node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs
934
- function Literal(value, options) {
935
- return CreateType({
936
- [Kind]: "Literal",
937
- const: value,
938
- type: typeof value
939
- }, options);
952
+ function FromRest2(K, T) {
953
+ return T.map((L) => FromSchemaType(K, L));
940
954
  }
941
-
942
- // ../../node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
943
- function Boolean(options) {
944
- return CreateType({ [Kind]: "Boolean", type: "boolean" }, options);
955
+ function FromProperties3(K, T) {
956
+ const Acc = {};
957
+ for (const K2 of globalThis.Object.getOwnPropertyNames(T))
958
+ Acc[K2] = FromSchemaType(K, T[K2]);
959
+ return Acc;
945
960
  }
946
-
947
- // ../../node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
948
- function BigInt(options) {
949
- return CreateType({ [Kind]: "BigInt", type: "bigint" }, options);
961
+ function FromSchemaType(K, T) {
962
+ const options = { ...T };
963
+ return (
964
+ // unevaluated modifier types
965
+ IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : (
966
+ // unevaluated mapped types
967
+ IsMappedResult(T) ? FromMappedResult3(K, T.properties) : IsMappedKey(T) ? FromMappedKey(K, T.keys) : (
968
+ // unevaluated types
969
+ IsConstructor(T) ? Constructor(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsFunction3(T) ? Function(FromRest2(K, T.parameters), FromSchemaType(K, T.returns), options) : IsAsyncIterator3(T) ? AsyncIterator(FromSchemaType(K, T.items), options) : IsIterator3(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) : IsPromise2(T) ? Promise2(FromSchemaType(K, T.item), options) : T
970
+ )
971
+ )
972
+ );
950
973
  }
951
-
952
- // ../../node_modules/@sinclair/typebox/build/esm/type/number/number.mjs
953
- function Number2(options) {
954
- return CreateType({ [Kind]: "Number", type: "number" }, options);
974
+ function MappedFunctionReturnType(K, T) {
975
+ const Acc = {};
976
+ for (const L of K)
977
+ Acc[L] = FromSchemaType(L, T);
978
+ return Acc;
955
979
  }
956
-
957
- // ../../node_modules/@sinclair/typebox/build/esm/type/string/string.mjs
958
- function String2(options) {
959
- return CreateType({ [Kind]: "String", type: "string" }, options);
980
+ function Mapped(key, map, options) {
981
+ const K = IsSchema(key) ? IndexPropertyKeys(key) : key;
982
+ const RT = map({ [Kind]: "MappedKey", keys: K });
983
+ const R = MappedFunctionReturnType(K, RT);
984
+ return Object2(R, options);
960
985
  }
961
986
 
962
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
963
- function* FromUnion(syntax) {
964
- const trim = syntax.trim().replace(/"|'/g, "");
965
- return trim === "boolean" ? yield Boolean() : trim === "number" ? yield Number2() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String2() : yield (() => {
966
- const literals = trim.split("|").map((literal) => Literal(literal.trim()));
967
- return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
968
- })();
987
+ // ../../node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
988
+ function RemoveOptional(schema) {
989
+ return CreateType(Discard(schema, [OptionalKind]));
969
990
  }
970
- function* FromTerminal(syntax) {
971
- if (syntax[1] !== "{") {
972
- const L = Literal("$");
973
- const R = FromSyntax(syntax.slice(1));
974
- return yield* [L, ...R];
975
- }
976
- for (let i = 2; i < syntax.length; i++) {
977
- if (syntax[i] === "}") {
978
- const L = FromUnion(syntax.slice(2, i));
979
- const R = FromSyntax(syntax.slice(i + 1));
980
- return yield* [...L, ...R];
981
- }
982
- }
983
- yield Literal(syntax);
991
+ function AddOptional(schema) {
992
+ return CreateType({ ...schema, [OptionalKind]: "Optional" });
984
993
  }
985
- function* FromSyntax(syntax) {
986
- for (let i = 0; i < syntax.length; i++) {
987
- if (syntax[i] === "$") {
988
- const L = Literal(syntax.slice(0, i));
989
- const R = FromTerminal(syntax.slice(i));
990
- return yield* [L, ...R];
991
- }
992
- }
993
- yield Literal(syntax);
994
+ function OptionalWithFlag(schema, F) {
995
+ return F === false ? RemoveOptional(schema) : AddOptional(schema);
994
996
  }
995
- function TemplateLiteralSyntax(syntax) {
996
- return [...FromSyntax(syntax)];
997
+ function Optional(schema, enable) {
998
+ const F = enable ?? true;
999
+ return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);
997
1000
  }
998
1001
 
999
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs
1000
- var TemplateLiteralPatternError = class extends TypeBoxError {
1001
- };
1002
- function Escape(value) {
1003
- return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1002
+ // ../../node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs
1003
+ function FromProperties4(P, F) {
1004
+ const Acc = {};
1005
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1006
+ Acc[K2] = Optional(P[K2], F);
1007
+ return Acc;
1004
1008
  }
1005
- function Visit2(schema, acc) {
1006
- 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}` : (() => {
1007
- throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
1008
- })();
1009
+ function FromMappedResult4(R, F) {
1010
+ return FromProperties4(R.properties, F);
1009
1011
  }
1010
- function TemplateLiteralPattern(kinds) {
1011
- return `^${kinds.map((schema) => Visit2(schema, "")).join("")}$`;
1012
+ function OptionalFromMappedResult(R, F) {
1013
+ const P = FromMappedResult4(R, F);
1014
+ return MappedResult(P);
1012
1015
  }
1013
1016
 
1014
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs
1015
- function TemplateLiteralToUnion(schema) {
1016
- const R = TemplateLiteralGenerate(schema);
1017
- const L = R.map((S) => Literal(S));
1018
- return UnionEvaluated(L);
1017
+ // ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs
1018
+ function IntersectCreate(T, options = {}) {
1019
+ const allObjects = T.every((schema) => IsObject3(schema));
1020
+ const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {};
1021
+ return CreateType(options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: T } : { ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: T }, options);
1019
1022
  }
1020
1023
 
1021
- // ../../node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
1022
- function TemplateLiteral(unresolved, options) {
1023
- const pattern = IsString(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
1024
- return CreateType({ [Kind]: "TemplateLiteral", type: "string", pattern }, options);
1024
+ // ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs
1025
+ function IsIntersectOptional(types) {
1026
+ return types.every((left) => IsOptional(left));
1025
1027
  }
1026
-
1027
- // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
1028
- function FromTemplateLiteral(templateLiteral) {
1029
- const keys = TemplateLiteralGenerate(templateLiteral);
1030
- return keys.map((key) => key.toString());
1028
+ function RemoveOptionalFromType2(type) {
1029
+ return Discard(type, [OptionalKind]);
1031
1030
  }
1032
- function FromUnion2(types) {
1033
- const result = [];
1034
- for (const type of types)
1035
- result.push(...IndexPropertyKeys(type));
1036
- return result;
1031
+ function RemoveOptionalFromRest2(types) {
1032
+ return types.map((left) => IsOptional(left) ? RemoveOptionalFromType2(left) : left);
1037
1033
  }
1038
- function FromLiteral(literalValue) {
1039
- return [literalValue.toString()];
1034
+ function ResolveIntersect(types, options) {
1035
+ return IsIntersectOptional(types) ? Optional(IntersectCreate(RemoveOptionalFromRest2(types), options)) : IntersectCreate(RemoveOptionalFromRest2(types), options);
1040
1036
  }
1041
- function IndexPropertyKeys(type) {
1042
- return [...new Set(IsTemplateLiteral(type) ? FromTemplateLiteral(type) : IsUnion(type) ? FromUnion2(type.anyOf) : IsLiteral(type) ? FromLiteral(type.const) : IsNumber3(type) ? ["[number]"] : IsInteger(type) ? ["[number]"] : [])];
1037
+ function IntersectEvaluated(types, options = {}) {
1038
+ if (types.length === 1)
1039
+ return CreateType(types[0], options);
1040
+ if (types.length === 0)
1041
+ return Never(options);
1042
+ if (types.some((schema) => IsTransform(schema)))
1043
+ throw new Error("Cannot intersect transform types");
1044
+ return ResolveIntersect(types, options);
1043
1045
  }
1044
1046
 
1045
- // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
1046
- function FromProperties(type, properties, options) {
1047
- const result = {};
1048
- for (const K2 of Object.getOwnPropertyNames(properties)) {
1049
- result[K2] = Index(type, IndexPropertyKeys(properties[K2]), options);
1050
- }
1051
- return result;
1052
- }
1053
- function FromMappedResult(type, mappedResult, options) {
1054
- return FromProperties(type, mappedResult.properties, options);
1055
- }
1056
- function IndexFromMappedResult(type, mappedResult, options) {
1057
- const properties = FromMappedResult(type, mappedResult, options);
1058
- return MappedResult(properties);
1047
+ // ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs
1048
+ function Intersect(types, options) {
1049
+ if (types.length === 1)
1050
+ return CreateType(types[0], options);
1051
+ if (types.length === 0)
1052
+ return Never(options);
1053
+ if (types.some((schema) => IsTransform(schema)))
1054
+ throw new Error("Cannot intersect transform types");
1055
+ return IntersectCreate(types, options);
1059
1056
  }
1060
1057
 
1061
- // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
1062
- function FromRest(types, key) {
1063
- return types.map((type) => IndexFromPropertyKey(type, key));
1064
- }
1065
- function FromIntersectRest(types) {
1066
- return types.filter((type) => !IsNever(type));
1067
- }
1068
- function FromIntersect(types, key) {
1069
- return IntersectEvaluated(FromIntersectRest(FromRest(types, key)));
1058
+ // ../../node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
1059
+ function Ref(...args) {
1060
+ const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]];
1061
+ if (typeof $ref !== "string")
1062
+ throw new TypeBoxError("Ref: $ref must be a string");
1063
+ return CreateType({ [Kind]: "Ref", $ref }, options);
1070
1064
  }
1071
- function FromUnionRest(types) {
1072
- return types.some((L) => IsNever(L)) ? [] : types;
1065
+
1066
+ // ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs
1067
+ function FromRest3(types) {
1068
+ const result = [];
1069
+ for (const L of types)
1070
+ result.push(KeyOfPropertyKeys(L));
1071
+ return result;
1073
1072
  }
1074
- function FromUnion3(types, key) {
1075
- return UnionEvaluated(FromUnionRest(FromRest(types, key)));
1073
+ function FromIntersect2(types) {
1074
+ const propertyKeysArray = FromRest3(types);
1075
+ const propertyKeys = SetUnionMany(propertyKeysArray);
1076
+ return propertyKeys;
1076
1077
  }
1077
- function FromTuple(types, key) {
1078
- return key in types ? types[key] : key === "[number]" ? UnionEvaluated(types) : Never();
1078
+ function FromUnion4(types) {
1079
+ const propertyKeysArray = FromRest3(types);
1080
+ const propertyKeys = SetIntersectMany(propertyKeysArray);
1081
+ return propertyKeys;
1079
1082
  }
1080
- function FromArray(type, key) {
1081
- return key === "[number]" ? type : Never();
1083
+ function FromTuple2(types) {
1084
+ return types.map((_, indexer) => indexer.toString());
1082
1085
  }
1083
- function FromProperty(properties, propertyKey) {
1084
- return propertyKey in properties ? properties[propertyKey] : Never();
1086
+ function FromArray2(_) {
1087
+ return ["[number]"];
1085
1088
  }
1086
- function IndexFromPropertyKey(type, propertyKey) {
1087
- 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();
1089
+ function FromProperties5(T) {
1090
+ return globalThis.Object.getOwnPropertyNames(T);
1088
1091
  }
1089
- function IndexFromPropertyKeys(type, propertyKeys) {
1090
- return propertyKeys.map((propertyKey) => IndexFromPropertyKey(type, propertyKey));
1092
+ function FromPatternProperties(patternProperties) {
1093
+ if (!includePatternProperties)
1094
+ return [];
1095
+ const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties);
1096
+ return patternPropertyKeys.map((key) => {
1097
+ return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
1098
+ });
1091
1099
  }
1092
- function FromSchema(type, propertyKeys) {
1093
- return UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys));
1100
+ function KeyOfPropertyKeys(type) {
1101
+ return IsIntersect(type) ? FromIntersect2(type.allOf) : IsUnion(type) ? FromUnion4(type.anyOf) : IsTuple(type) ? FromTuple2(type.items ?? []) : IsArray3(type) ? FromArray2(type.items) : IsObject3(type) ? FromProperties5(type.properties) : IsRecord(type) ? FromPatternProperties(type.patternProperties) : [];
1094
1102
  }
1095
- function Index(type, key, options) {
1096
- if (IsRef(type) || IsRef(key)) {
1097
- const error = `Index types using Ref parameters require both Type and Key to be of TSchema`;
1098
- if (!IsSchema(type) || !IsSchema(key))
1099
- throw new TypeBoxError(error);
1100
- return Computed("Index", [type, key]);
1101
- }
1102
- if (IsMappedResult(key))
1103
- return IndexFromMappedResult(type, key, options);
1104
- if (IsMappedKey(key))
1105
- return IndexFromMappedKey(type, key, options);
1106
- return CreateType(IsSchema(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
1103
+ var includePatternProperties = false;
1104
+ function KeyOfPattern(schema) {
1105
+ includePatternProperties = true;
1106
+ const keys = KeyOfPropertyKeys(schema);
1107
+ includePatternProperties = false;
1108
+ const pattern = keys.map((key) => `(${key})`);
1109
+ return `^(${pattern.join("|")})$`;
1107
1110
  }
1108
1111
 
1109
- // ../../node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
1110
- function MappedIndexPropertyKey(type, key, options) {
1111
- return { [key]: Index(type, [key], Clone(options)) };
1112
+ // ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
1113
+ function FromComputed(target, parameters) {
1114
+ return Computed("KeyOf", [Computed(target, parameters)]);
1112
1115
  }
1113
- function MappedIndexPropertyKeys(type, propertyKeys, options) {
1114
- return propertyKeys.reduce((result, left) => {
1115
- return { ...result, ...MappedIndexPropertyKey(type, left, options) };
1116
- }, {});
1116
+ function FromRef($ref) {
1117
+ return Computed("KeyOf", [Ref($ref)]);
1117
1118
  }
1118
- function MappedIndexProperties(type, mappedKey, options) {
1119
- return MappedIndexPropertyKeys(type, mappedKey.keys, options);
1119
+ function KeyOfFromType(type, options) {
1120
+ const propertyKeys = KeyOfPropertyKeys(type);
1121
+ const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys);
1122
+ const result = UnionEvaluated(propertyKeyTypes);
1123
+ return CreateType(result, options);
1120
1124
  }
1121
- function IndexFromMappedKey(type, mappedKey, options) {
1122
- const properties = MappedIndexProperties(type, mappedKey, options);
1123
- return MappedResult(properties);
1125
+ function KeyOfPropertyKeysToRest(propertyKeys) {
1126
+ return propertyKeys.map((L) => L === "[number]" ? Number2() : Literal(L));
1124
1127
  }
1125
-
1126
- // ../../node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs
1127
- function Iterator(items, options) {
1128
- return CreateType({ [Kind]: "Iterator", type: "Iterator", items }, options);
1128
+ function KeyOf(type, options) {
1129
+ return IsComputed(type) ? FromComputed(type.target, type.parameters) : IsRef(type) ? FromRef(type.$ref) : IsMappedResult(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options);
1129
1130
  }
1130
1131
 
1131
- // ../../node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
1132
- function RequiredArray(properties) {
1133
- return globalThis.Object.keys(properties).filter((key) => !IsOptional(properties[key]));
1132
+ // ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs
1133
+ function FromProperties6(properties, options) {
1134
+ const result = {};
1135
+ for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
1136
+ result[K2] = KeyOf(properties[K2], Clone(options));
1137
+ return result;
1134
1138
  }
1135
- function _Object(properties, options) {
1136
- const required = RequiredArray(properties);
1137
- const schema = required.length > 0 ? { [Kind]: "Object", type: "object", required, properties } : { [Kind]: "Object", type: "object", properties };
1138
- return CreateType(schema, options);
1139
+ function FromMappedResult5(mappedResult, options) {
1140
+ return FromProperties6(mappedResult.properties, options);
1139
1141
  }
1140
- var Object2 = _Object;
1141
-
1142
- // ../../node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs
1143
- function Promise2(item, options) {
1144
- return CreateType({ [Kind]: "Promise", type: "Promise", item }, options);
1142
+ function KeyOfFromMappedResult(mappedResult, options) {
1143
+ const properties = FromMappedResult5(mappedResult, options);
1144
+ return MappedResult(properties);
1145
1145
  }
1146
1146
 
1147
- // ../../node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs
1148
- function RemoveReadonly(schema) {
1149
- return CreateType(Discard(schema, [ReadonlyKind]));
1150
- }
1151
- function AddReadonly(schema) {
1152
- return CreateType({ ...schema, [ReadonlyKind]: "Readonly" });
1147
+ // ../../node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
1148
+ function CompositeKeys(T) {
1149
+ const Acc = [];
1150
+ for (const L of T)
1151
+ Acc.push(...KeyOfPropertyKeys(L));
1152
+ return SetDistinct(Acc);
1153
1153
  }
1154
- function ReadonlyWithFlag(schema, F) {
1155
- return F === false ? RemoveReadonly(schema) : AddReadonly(schema);
1154
+ function FilterNever(T) {
1155
+ return T.filter((L) => !IsNever(L));
1156
1156
  }
1157
- function Readonly(schema, enable) {
1158
- const F = enable ?? true;
1159
- return IsMappedResult(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F);
1157
+ function CompositeProperty(T, K) {
1158
+ const Acc = [];
1159
+ for (const L of T)
1160
+ Acc.push(...IndexFromPropertyKeys(L, [K]));
1161
+ return FilterNever(Acc);
1160
1162
  }
1161
-
1162
- // ../../node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs
1163
- function FromProperties2(K, F) {
1163
+ function CompositeProperties(T, K) {
1164
1164
  const Acc = {};
1165
- for (const K2 of globalThis.Object.getOwnPropertyNames(K))
1166
- Acc[K2] = Readonly(K[K2], F);
1165
+ for (const L of K) {
1166
+ Acc[L] = IntersectEvaluated(CompositeProperty(T, L));
1167
+ }
1167
1168
  return Acc;
1168
1169
  }
1169
- function FromMappedResult2(R, F) {
1170
- return FromProperties2(R.properties, F);
1170
+ function Composite(T, options) {
1171
+ const K = CompositeKeys(T);
1172
+ const P = CompositeProperties(T, K);
1173
+ const R = Object2(P, options);
1174
+ return R;
1171
1175
  }
1172
- function ReadonlyFromMappedResult(R, F) {
1173
- const P = FromMappedResult2(R, F);
1174
- return MappedResult(P);
1176
+
1177
+ // ../../node_modules/@sinclair/typebox/build/esm/type/date/date.mjs
1178
+ function Date2(options) {
1179
+ return CreateType({ [Kind]: "Date", type: "Date" }, options);
1175
1180
  }
1176
1181
 
1177
- // ../../node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs
1178
- function Tuple(types, options) {
1179
- 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);
1182
+ // ../../node_modules/@sinclair/typebox/build/esm/type/null/null.mjs
1183
+ function Null(options) {
1184
+ return CreateType({ [Kind]: "Null", type: "null" }, options);
1180
1185
  }
1181
1186
 
1182
- // ../../node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs
1183
- function FromMappedResult3(K, P) {
1184
- return K in P ? FromSchemaType(K, P[K]) : MappedResult(P);
1187
+ // ../../node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs
1188
+ function Symbol2(options) {
1189
+ return CreateType({ [Kind]: "Symbol", type: "symbol" }, options);
1185
1190
  }
1186
- function MappedKeyToKnownMappedResultProperties(K) {
1187
- return { [K]: Literal(K) };
1191
+
1192
+ // ../../node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs
1193
+ function Undefined(options) {
1194
+ return CreateType({ [Kind]: "Undefined", type: "undefined" }, options);
1188
1195
  }
1189
- function MappedKeyToUnknownMappedResultProperties(P) {
1196
+
1197
+ // ../../node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs
1198
+ function Uint8Array2(options) {
1199
+ return CreateType({ [Kind]: "Uint8Array", type: "Uint8Array" }, options);
1200
+ }
1201
+
1202
+ // ../../node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs
1203
+ function Unknown(options) {
1204
+ return CreateType({ [Kind]: "Unknown" }, options);
1205
+ }
1206
+
1207
+ // ../../node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
1208
+ function FromArray3(T) {
1209
+ return T.map((L) => FromValue(L, false));
1210
+ }
1211
+ function FromProperties7(value) {
1190
1212
  const Acc = {};
1191
- for (const L of P)
1192
- Acc[L] = Literal(L);
1213
+ for (const K of globalThis.Object.getOwnPropertyNames(value))
1214
+ Acc[K] = Readonly(FromValue(value[K], false));
1193
1215
  return Acc;
1194
1216
  }
1195
- function MappedKeyToMappedResultProperties(K, P) {
1196
- return SetIncludes(P, K) ? MappedKeyToKnownMappedResultProperties(K) : MappedKeyToUnknownMappedResultProperties(P);
1217
+ function ConditionalReadonly(T, root) {
1218
+ return root === true ? T : Readonly(T);
1197
1219
  }
1198
- function FromMappedKey(K, P) {
1199
- const R = MappedKeyToMappedResultProperties(K, P);
1200
- return FromMappedResult3(K, R);
1220
+ function FromValue(value, root) {
1221
+ return IsAsyncIterator2(value) ? ConditionalReadonly(Any(), root) : IsIterator2(value) ? ConditionalReadonly(Any(), root) : IsArray2(value) ? Readonly(Tuple(FromArray3(value))) : IsUint8Array2(value) ? Uint8Array2() : IsDate2(value) ? Date2() : IsObject2(value) ? ConditionalReadonly(Object2(FromProperties7(value)), root) : IsFunction2(value) ? ConditionalReadonly(Function([], Unknown()), root) : IsUndefined2(value) ? Undefined() : IsNull2(value) ? Null() : IsSymbol2(value) ? Symbol2() : IsBigInt2(value) ? BigInt() : IsNumber2(value) ? Literal(value) : IsBoolean2(value) ? Literal(value) : IsString2(value) ? Literal(value) : Object2({});
1201
1222
  }
1202
- function FromRest2(K, T) {
1203
- return T.map((L) => FromSchemaType(K, L));
1223
+ function Const(T, options) {
1224
+ return CreateType(FromValue(T, true), options);
1204
1225
  }
1205
- function FromProperties3(K, T) {
1206
- const Acc = {};
1207
- for (const K2 of globalThis.Object.getOwnPropertyNames(T))
1208
- Acc[K2] = FromSchemaType(K, T[K2]);
1209
- return Acc;
1226
+
1227
+ // ../../node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
1228
+ function Enum(item, options) {
1229
+ if (IsUndefined2(item))
1230
+ throw new Error("Enum undefined or empty");
1231
+ const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
1232
+ const values2 = [...new Set(values1)];
1233
+ const anyOf = values2.map((value) => Literal(value));
1234
+ return Union(anyOf, { ...options, [Hint]: "Enum" });
1235
+ }
1236
+
1237
+ // ../../node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
1238
+ var type_exports = {};
1239
+ __export(type_exports, {
1240
+ IsAny: () => IsAny2,
1241
+ IsArgument: () => IsArgument2,
1242
+ IsArray: () => IsArray4,
1243
+ IsAsyncIterator: () => IsAsyncIterator4,
1244
+ IsBigInt: () => IsBigInt4,
1245
+ IsBoolean: () => IsBoolean4,
1246
+ IsComputed: () => IsComputed2,
1247
+ IsConstructor: () => IsConstructor2,
1248
+ IsDate: () => IsDate4,
1249
+ IsFunction: () => IsFunction4,
1250
+ IsImport: () => IsImport,
1251
+ IsInteger: () => IsInteger3,
1252
+ IsIntersect: () => IsIntersect2,
1253
+ IsIterator: () => IsIterator4,
1254
+ IsKind: () => IsKind2,
1255
+ IsKindOf: () => IsKindOf2,
1256
+ IsLiteral: () => IsLiteral2,
1257
+ IsLiteralBoolean: () => IsLiteralBoolean,
1258
+ IsLiteralNumber: () => IsLiteralNumber,
1259
+ IsLiteralString: () => IsLiteralString,
1260
+ IsLiteralValue: () => IsLiteralValue2,
1261
+ IsMappedKey: () => IsMappedKey2,
1262
+ IsMappedResult: () => IsMappedResult2,
1263
+ IsNever: () => IsNever2,
1264
+ IsNot: () => IsNot2,
1265
+ IsNull: () => IsNull4,
1266
+ IsNumber: () => IsNumber4,
1267
+ IsObject: () => IsObject4,
1268
+ IsOptional: () => IsOptional2,
1269
+ IsPromise: () => IsPromise3,
1270
+ IsProperties: () => IsProperties,
1271
+ IsReadonly: () => IsReadonly2,
1272
+ IsRecord: () => IsRecord2,
1273
+ IsRecursive: () => IsRecursive,
1274
+ IsRef: () => IsRef2,
1275
+ IsRegExp: () => IsRegExp3,
1276
+ IsSchema: () => IsSchema2,
1277
+ IsString: () => IsString4,
1278
+ IsSymbol: () => IsSymbol4,
1279
+ IsTemplateLiteral: () => IsTemplateLiteral2,
1280
+ IsThis: () => IsThis2,
1281
+ IsTransform: () => IsTransform2,
1282
+ IsTuple: () => IsTuple2,
1283
+ IsUint8Array: () => IsUint8Array4,
1284
+ IsUndefined: () => IsUndefined4,
1285
+ IsUnion: () => IsUnion2,
1286
+ IsUnionLiteral: () => IsUnionLiteral,
1287
+ IsUnknown: () => IsUnknown2,
1288
+ IsUnsafe: () => IsUnsafe2,
1289
+ IsVoid: () => IsVoid2,
1290
+ TypeGuardUnknownTypeError: () => TypeGuardUnknownTypeError
1291
+ });
1292
+ var TypeGuardUnknownTypeError = class extends TypeBoxError {
1293
+ };
1294
+ var KnownTypes = [
1295
+ "Argument",
1296
+ "Any",
1297
+ "Array",
1298
+ "AsyncIterator",
1299
+ "BigInt",
1300
+ "Boolean",
1301
+ "Computed",
1302
+ "Constructor",
1303
+ "Date",
1304
+ "Enum",
1305
+ "Function",
1306
+ "Integer",
1307
+ "Intersect",
1308
+ "Iterator",
1309
+ "Literal",
1310
+ "MappedKey",
1311
+ "MappedResult",
1312
+ "Not",
1313
+ "Null",
1314
+ "Number",
1315
+ "Object",
1316
+ "Promise",
1317
+ "Record",
1318
+ "Ref",
1319
+ "RegExp",
1320
+ "String",
1321
+ "Symbol",
1322
+ "TemplateLiteral",
1323
+ "This",
1324
+ "Tuple",
1325
+ "Undefined",
1326
+ "Union",
1327
+ "Uint8Array",
1328
+ "Unknown",
1329
+ "Void"
1330
+ ];
1331
+ function IsPattern(value) {
1332
+ try {
1333
+ new RegExp(value);
1334
+ return true;
1335
+ } catch {
1336
+ return false;
1337
+ }
1210
1338
  }
1211
- function FromSchemaType(K, T) {
1212
- const options = { ...T };
1213
- return (
1214
- // unevaluated modifier types
1215
- IsOptional(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : (
1216
- // unevaluated mapped types
1217
- IsMappedResult(T) ? FromMappedResult3(K, T.properties) : IsMappedKey(T) ? FromMappedKey(K, T.keys) : (
1218
- // unevaluated types
1219
- 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
1220
- )
1221
- )
1222
- );
1339
+ function IsControlCharacterFree(value) {
1340
+ if (!IsString2(value))
1341
+ return false;
1342
+ for (let i = 0; i < value.length; i++) {
1343
+ const code = value.charCodeAt(i);
1344
+ if (code >= 7 && code <= 13 || code === 27 || code === 127) {
1345
+ return false;
1346
+ }
1347
+ }
1348
+ return true;
1223
1349
  }
1224
- function MappedFunctionReturnType(K, T) {
1225
- const Acc = {};
1226
- for (const L of K)
1227
- Acc[L] = FromSchemaType(L, T);
1228
- return Acc;
1350
+ function IsAdditionalProperties(value) {
1351
+ return IsOptionalBoolean(value) || IsSchema2(value);
1229
1352
  }
1230
- function Mapped(key, map, options) {
1231
- const K = IsSchema(key) ? IndexPropertyKeys(key) : key;
1232
- const RT = map({ [Kind]: "MappedKey", keys: K });
1233
- const R = MappedFunctionReturnType(K, RT);
1234
- return Object2(R, options);
1353
+ function IsOptionalBigInt(value) {
1354
+ return IsUndefined2(value) || IsBigInt2(value);
1235
1355
  }
1236
-
1237
- // ../../node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
1238
- function RemoveOptional(schema) {
1239
- return CreateType(Discard(schema, [OptionalKind]));
1356
+ function IsOptionalNumber(value) {
1357
+ return IsUndefined2(value) || IsNumber2(value);
1240
1358
  }
1241
- function AddOptional(schema) {
1242
- return CreateType({ ...schema, [OptionalKind]: "Optional" });
1359
+ function IsOptionalBoolean(value) {
1360
+ return IsUndefined2(value) || IsBoolean2(value);
1243
1361
  }
1244
- function OptionalWithFlag(schema, F) {
1245
- return F === false ? RemoveOptional(schema) : AddOptional(schema);
1362
+ function IsOptionalString(value) {
1363
+ return IsUndefined2(value) || IsString2(value);
1246
1364
  }
1247
- function Optional(schema, enable) {
1248
- const F = enable ?? true;
1249
- return IsMappedResult(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);
1365
+ function IsOptionalPattern(value) {
1366
+ return IsUndefined2(value) || IsString2(value) && IsControlCharacterFree(value) && IsPattern(value);
1250
1367
  }
1251
-
1252
- // ../../node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs
1253
- function FromProperties4(P, F) {
1254
- const Acc = {};
1255
- for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1256
- Acc[K2] = Optional(P[K2], F);
1257
- return Acc;
1368
+ function IsOptionalFormat(value) {
1369
+ return IsUndefined2(value) || IsString2(value) && IsControlCharacterFree(value);
1258
1370
  }
1259
- function FromMappedResult4(R, F) {
1260
- return FromProperties4(R.properties, F);
1371
+ function IsOptionalSchema(value) {
1372
+ return IsUndefined2(value) || IsSchema2(value);
1261
1373
  }
1262
- function OptionalFromMappedResult(R, F) {
1263
- const P = FromMappedResult4(R, F);
1264
- return MappedResult(P);
1374
+ function IsReadonly2(value) {
1375
+ return IsObject2(value) && value[ReadonlyKind] === "Readonly";
1265
1376
  }
1266
-
1267
- // ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs
1268
- function IntersectCreate(T, options = {}) {
1269
- const allObjects = T.every((schema) => IsObject3(schema));
1270
- const clonedUnevaluatedProperties = IsSchema(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {};
1271
- return CreateType(options.unevaluatedProperties === false || IsSchema(options.unevaluatedProperties) || allObjects ? { ...clonedUnevaluatedProperties, [Kind]: "Intersect", type: "object", allOf: T } : { ...clonedUnevaluatedProperties, [Kind]: "Intersect", allOf: T }, options);
1377
+ function IsOptional2(value) {
1378
+ return IsObject2(value) && value[OptionalKind] === "Optional";
1272
1379
  }
1273
-
1274
- // ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs
1275
- function IsIntersectOptional(types) {
1276
- return types.every((left) => IsOptional(left));
1380
+ function IsAny2(value) {
1381
+ return IsKindOf2(value, "Any") && IsOptionalString(value.$id);
1277
1382
  }
1278
- function RemoveOptionalFromType2(type) {
1279
- return Discard(type, [OptionalKind]);
1383
+ function IsArgument2(value) {
1384
+ return IsKindOf2(value, "Argument") && IsNumber2(value.index);
1280
1385
  }
1281
- function RemoveOptionalFromRest2(types) {
1282
- return types.map((left) => IsOptional(left) ? RemoveOptionalFromType2(left) : left);
1386
+ function IsArray4(value) {
1387
+ 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);
1283
1388
  }
1284
- function ResolveIntersect(types, options) {
1285
- return IsIntersectOptional(types) ? Optional(IntersectCreate(RemoveOptionalFromRest2(types), options)) : IntersectCreate(RemoveOptionalFromRest2(types), options);
1389
+ function IsAsyncIterator4(value) {
1390
+ return IsKindOf2(value, "AsyncIterator") && value.type === "AsyncIterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
1286
1391
  }
1287
- function IntersectEvaluated(types, options = {}) {
1288
- if (types.length === 1)
1289
- return CreateType(types[0], options);
1290
- if (types.length === 0)
1291
- return Never(options);
1292
- if (types.some((schema) => IsTransform(schema)))
1293
- throw new Error("Cannot intersect transform types");
1294
- return ResolveIntersect(types, options);
1392
+ function IsBigInt4(value) {
1393
+ return IsKindOf2(value, "BigInt") && value.type === "bigint" && IsOptionalString(value.$id) && IsOptionalBigInt(value.exclusiveMaximum) && IsOptionalBigInt(value.exclusiveMinimum) && IsOptionalBigInt(value.maximum) && IsOptionalBigInt(value.minimum) && IsOptionalBigInt(value.multipleOf);
1295
1394
  }
1296
-
1297
- // ../../node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs
1298
- function Intersect(types, options) {
1299
- if (types.length === 1)
1300
- return CreateType(types[0], options);
1301
- if (types.length === 0)
1302
- return Never(options);
1303
- if (types.some((schema) => IsTransform(schema)))
1304
- throw new Error("Cannot intersect transform types");
1305
- return IntersectCreate(types, options);
1395
+ function IsBoolean4(value) {
1396
+ return IsKindOf2(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id);
1306
1397
  }
1307
-
1308
- // ../../node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
1309
- function Ref(...args) {
1310
- const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]];
1311
- if (typeof $ref !== "string")
1312
- throw new TypeBoxError("Ref: $ref must be a string");
1313
- return CreateType({ [Kind]: "Ref", $ref }, options);
1398
+ function IsComputed2(value) {
1399
+ return IsKindOf2(value, "Computed") && IsString2(value.target) && IsArray2(value.parameters) && value.parameters.every((schema) => IsSchema2(schema));
1314
1400
  }
1315
-
1316
- // ../../node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
1317
- function FromComputed(target, parameters) {
1318
- return Computed("Awaited", [Computed(target, parameters)]);
1401
+ function IsConstructor2(value) {
1402
+ return IsKindOf2(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray2(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
1319
1403
  }
1320
- function FromRef($ref) {
1321
- return Computed("Awaited", [Ref($ref)]);
1404
+ function IsDate4(value) {
1405
+ return IsKindOf2(value, "Date") && value.type === "Date" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximumTimestamp) && IsOptionalNumber(value.exclusiveMinimumTimestamp) && IsOptionalNumber(value.maximumTimestamp) && IsOptionalNumber(value.minimumTimestamp) && IsOptionalNumber(value.multipleOfTimestamp);
1322
1406
  }
1323
- function FromIntersect2(types) {
1324
- return Intersect(FromRest3(types));
1407
+ function IsFunction4(value) {
1408
+ return IsKindOf2(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray2(value.parameters) && value.parameters.every((schema) => IsSchema2(schema)) && IsSchema2(value.returns);
1325
1409
  }
1326
- function FromUnion4(types) {
1327
- return Union(FromRest3(types));
1410
+ function IsImport(value) {
1411
+ return IsKindOf2(value, "Import") && HasPropertyKey2(value, "$defs") && IsObject2(value.$defs) && IsProperties(value.$defs) && HasPropertyKey2(value, "$ref") && IsString2(value.$ref) && value.$ref in value.$defs;
1328
1412
  }
1329
- function FromPromise(type) {
1330
- return Awaited(type);
1413
+ function IsInteger3(value) {
1414
+ 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);
1331
1415
  }
1332
- function FromRest3(types) {
1333
- return types.map((type) => Awaited(type));
1416
+ function IsProperties(value) {
1417
+ return IsObject2(value) && Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema2(schema));
1334
1418
  }
1335
- function Awaited(type, options) {
1336
- 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);
1419
+ function IsIntersect2(value) {
1420
+ return IsKindOf2(value, "Intersect") && (IsString2(value.type) && value.type !== "object" ? false : true) && IsArray2(value.allOf) && value.allOf.every((schema) => IsSchema2(schema) && !IsTransform2(schema)) && IsOptionalString(value.type) && (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && IsOptionalString(value.$id);
1337
1421
  }
1338
-
1339
- // ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs
1340
- function FromRest4(types) {
1341
- const result = [];
1342
- for (const L of types)
1343
- result.push(KeyOfPropertyKeys(L));
1344
- return result;
1422
+ function IsIterator4(value) {
1423
+ return IsKindOf2(value, "Iterator") && value.type === "Iterator" && IsOptionalString(value.$id) && IsSchema2(value.items);
1345
1424
  }
1346
- function FromIntersect3(types) {
1347
- const propertyKeysArray = FromRest4(types);
1348
- const propertyKeys = SetUnionMany(propertyKeysArray);
1349
- return propertyKeys;
1425
+ function IsKindOf2(value, kind) {
1426
+ return IsObject2(value) && Kind in value && value[Kind] === kind;
1350
1427
  }
1351
- function FromUnion5(types) {
1352
- const propertyKeysArray = FromRest4(types);
1353
- const propertyKeys = SetIntersectMany(propertyKeysArray);
1354
- return propertyKeys;
1428
+ function IsLiteralString(value) {
1429
+ return IsLiteral2(value) && IsString2(value.const);
1355
1430
  }
1356
- function FromTuple2(types) {
1357
- return types.map((_, indexer) => indexer.toString());
1431
+ function IsLiteralNumber(value) {
1432
+ return IsLiteral2(value) && IsNumber2(value.const);
1358
1433
  }
1359
- function FromArray2(_) {
1360
- return ["[number]"];
1434
+ function IsLiteralBoolean(value) {
1435
+ return IsLiteral2(value) && IsBoolean2(value.const);
1361
1436
  }
1362
- function FromProperties5(T) {
1363
- return globalThis.Object.getOwnPropertyNames(T);
1437
+ function IsLiteral2(value) {
1438
+ return IsKindOf2(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue2(value.const);
1364
1439
  }
1365
- function FromPatternProperties(patternProperties) {
1366
- if (!includePatternProperties)
1367
- return [];
1368
- const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties);
1369
- return patternPropertyKeys.map((key) => {
1370
- return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
1371
- });
1440
+ function IsLiteralValue2(value) {
1441
+ return IsBoolean2(value) || IsNumber2(value) || IsString2(value);
1372
1442
  }
1373
- function KeyOfPropertyKeys(type) {
1374
- 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) : [];
1443
+ function IsMappedKey2(value) {
1444
+ return IsKindOf2(value, "MappedKey") && IsArray2(value.keys) && value.keys.every((key) => IsNumber2(key) || IsString2(key));
1375
1445
  }
1376
- var includePatternProperties = false;
1377
-
1378
- // ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
1379
- function FromComputed2(target, parameters) {
1380
- return Computed("KeyOf", [Computed(target, parameters)]);
1446
+ function IsMappedResult2(value) {
1447
+ return IsKindOf2(value, "MappedResult") && IsProperties(value.properties);
1381
1448
  }
1382
- function FromRef2($ref) {
1383
- return Computed("KeyOf", [Ref($ref)]);
1449
+ function IsNever2(value) {
1450
+ return IsKindOf2(value, "Never") && IsObject2(value.not) && Object.getOwnPropertyNames(value.not).length === 0;
1384
1451
  }
1385
- function KeyOfFromType(type, options) {
1386
- const propertyKeys = KeyOfPropertyKeys(type);
1387
- const propertyKeyTypes = KeyOfPropertyKeysToRest(propertyKeys);
1388
- const result = UnionEvaluated(propertyKeyTypes);
1389
- return CreateType(result, options);
1452
+ function IsNot2(value) {
1453
+ return IsKindOf2(value, "Not") && IsSchema2(value.not);
1390
1454
  }
1391
- function KeyOfPropertyKeysToRest(propertyKeys) {
1392
- return propertyKeys.map((L) => L === "[number]" ? Number2() : Literal(L));
1455
+ function IsNull4(value) {
1456
+ return IsKindOf2(value, "Null") && value.type === "null" && IsOptionalString(value.$id);
1393
1457
  }
1394
- function KeyOf(type, options) {
1395
- return IsComputed(type) ? FromComputed2(type.target, type.parameters) : IsRef(type) ? FromRef2(type.$ref) : IsMappedResult(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options);
1458
+ function IsNumber4(value) {
1459
+ 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);
1396
1460
  }
1397
-
1398
- // ../../node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs
1399
- function FromProperties6(properties, options) {
1400
- const result = {};
1401
- for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
1402
- result[K2] = KeyOf(properties[K2], Clone(options));
1403
- return result;
1461
+ function IsObject4(value) {
1462
+ return IsKindOf2(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);
1404
1463
  }
1405
- function FromMappedResult5(mappedResult, options) {
1406
- return FromProperties6(mappedResult.properties, options);
1464
+ function IsPromise3(value) {
1465
+ return IsKindOf2(value, "Promise") && value.type === "Promise" && IsOptionalString(value.$id) && IsSchema2(value.item);
1407
1466
  }
1408
- function KeyOfFromMappedResult(mappedResult, options) {
1409
- const properties = FromMappedResult5(mappedResult, options);
1410
- return MappedResult(properties);
1467
+ function IsRecord2(value) {
1468
+ return IsKindOf2(value, "Record") && value.type === "object" && IsOptionalString(value.$id) && IsAdditionalProperties(value.additionalProperties) && IsObject2(value.patternProperties) && ((schema) => {
1469
+ const keys = Object.getOwnPropertyNames(schema.patternProperties);
1470
+ return keys.length === 1 && IsPattern(keys[0]) && IsObject2(schema.patternProperties) && IsSchema2(schema.patternProperties[keys[0]]);
1471
+ })(value);
1411
1472
  }
1412
-
1413
- // ../../node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
1414
- function CompositeKeys(T) {
1415
- const Acc = [];
1416
- for (const L of T)
1417
- Acc.push(...KeyOfPropertyKeys(L));
1418
- return SetDistinct(Acc);
1473
+ function IsRecursive(value) {
1474
+ return IsObject2(value) && Hint in value && value[Hint] === "Recursive";
1419
1475
  }
1420
- function FilterNever(T) {
1421
- return T.filter((L) => !IsNever(L));
1476
+ function IsRef2(value) {
1477
+ return IsKindOf2(value, "Ref") && IsOptionalString(value.$id) && IsString2(value.$ref);
1422
1478
  }
1423
- function CompositeProperty(T, K) {
1424
- const Acc = [];
1425
- for (const L of T)
1426
- Acc.push(...IndexFromPropertyKeys(L, [K]));
1427
- return FilterNever(Acc);
1479
+ function IsRegExp3(value) {
1480
+ return IsKindOf2(value, "RegExp") && IsOptionalString(value.$id) && IsString2(value.source) && IsString2(value.flags) && IsOptionalNumber(value.maxLength) && IsOptionalNumber(value.minLength);
1428
1481
  }
1429
- function CompositeProperties(T, K) {
1430
- const Acc = {};
1431
- for (const L of K) {
1432
- Acc[L] = IntersectEvaluated(CompositeProperty(T, L));
1433
- }
1434
- return Acc;
1482
+ function IsString4(value) {
1483
+ return IsKindOf2(value, "String") && value.type === "string" && IsOptionalString(value.$id) && IsOptionalNumber(value.minLength) && IsOptionalNumber(value.maxLength) && IsOptionalPattern(value.pattern) && IsOptionalFormat(value.format);
1435
1484
  }
1436
- function Composite(T, options) {
1437
- const K = CompositeKeys(T);
1438
- const P = CompositeProperties(T, K);
1439
- const R = Object2(P, options);
1440
- return R;
1485
+ function IsSymbol4(value) {
1486
+ return IsKindOf2(value, "Symbol") && value.type === "symbol" && IsOptionalString(value.$id);
1441
1487
  }
1442
-
1443
- // ../../node_modules/@sinclair/typebox/build/esm/type/date/date.mjs
1444
- function Date2(options) {
1445
- return CreateType({ [Kind]: "Date", type: "Date" }, options);
1488
+ function IsTemplateLiteral2(value) {
1489
+ return IsKindOf2(value, "TemplateLiteral") && value.type === "string" && IsString2(value.pattern) && value.pattern[0] === "^" && value.pattern[value.pattern.length - 1] === "$";
1446
1490
  }
1447
-
1448
- // ../../node_modules/@sinclair/typebox/build/esm/type/null/null.mjs
1449
- function Null(options) {
1450
- return CreateType({ [Kind]: "Null", type: "null" }, options);
1491
+ function IsThis2(value) {
1492
+ return IsKindOf2(value, "This") && IsOptionalString(value.$id) && IsString2(value.$ref);
1451
1493
  }
1452
-
1453
- // ../../node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs
1454
- function Symbol2(options) {
1455
- return CreateType({ [Kind]: "Symbol", type: "symbol" }, options);
1494
+ function IsTransform2(value) {
1495
+ return IsObject2(value) && TransformKind in value;
1456
1496
  }
1457
-
1458
- // ../../node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs
1459
- function Undefined(options) {
1460
- return CreateType({ [Kind]: "Undefined", type: "undefined" }, options);
1497
+ function IsTuple2(value) {
1498
+ return IsKindOf2(value, "Tuple") && value.type === "array" && IsOptionalString(value.$id) && IsNumber2(value.minItems) && IsNumber2(value.maxItems) && value.minItems === value.maxItems && // empty
1499
+ (IsUndefined2(value.items) && IsUndefined2(value.additionalItems) && value.minItems === 0 || IsArray2(value.items) && value.items.every((schema) => IsSchema2(schema)));
1461
1500
  }
1462
-
1463
- // ../../node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs
1464
- function Uint8Array2(options) {
1465
- return CreateType({ [Kind]: "Uint8Array", type: "Uint8Array" }, options);
1501
+ function IsUndefined4(value) {
1502
+ return IsKindOf2(value, "Undefined") && value.type === "undefined" && IsOptionalString(value.$id);
1466
1503
  }
1467
-
1468
- // ../../node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs
1469
- function Unknown(options) {
1470
- return CreateType({ [Kind]: "Unknown" }, options);
1504
+ function IsUnionLiteral(value) {
1505
+ return IsUnion2(value) && value.anyOf.every((schema) => IsLiteralString(schema) || IsLiteralNumber(schema));
1471
1506
  }
1472
-
1473
- // ../../node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
1474
- function FromArray3(T) {
1475
- return T.map((L) => FromValue(L, false));
1507
+ function IsUnion2(value) {
1508
+ return IsKindOf2(value, "Union") && IsOptionalString(value.$id) && IsObject2(value) && IsArray2(value.anyOf) && value.anyOf.every((schema) => IsSchema2(schema));
1476
1509
  }
1477
- function FromProperties7(value) {
1478
- const Acc = {};
1479
- for (const K of globalThis.Object.getOwnPropertyNames(value))
1480
- Acc[K] = Readonly(FromValue(value[K], false));
1481
- return Acc;
1510
+ function IsUint8Array4(value) {
1511
+ return IsKindOf2(value, "Uint8Array") && value.type === "Uint8Array" && IsOptionalString(value.$id) && IsOptionalNumber(value.minByteLength) && IsOptionalNumber(value.maxByteLength);
1482
1512
  }
1483
- function ConditionalReadonly(T, root) {
1484
- return root === true ? T : Readonly(T);
1513
+ function IsUnknown2(value) {
1514
+ return IsKindOf2(value, "Unknown") && IsOptionalString(value.$id);
1485
1515
  }
1486
- function FromValue(value, root) {
1487
- 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({});
1516
+ function IsUnsafe2(value) {
1517
+ return IsKindOf2(value, "Unsafe");
1488
1518
  }
1489
- function Const(T, options) {
1490
- return CreateType(FromValue(T, true), options);
1519
+ function IsVoid2(value) {
1520
+ return IsKindOf2(value, "Void") && value.type === "void" && IsOptionalString(value.$id);
1491
1521
  }
1492
-
1493
- // ../../node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
1494
- function ConstructorParameters(schema, options) {
1495
- return IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options);
1522
+ function IsKind2(value) {
1523
+ return IsObject2(value) && Kind in value && IsString2(value[Kind]) && !KnownTypes.includes(value[Kind]);
1496
1524
  }
1497
-
1498
- // ../../node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
1499
- function Enum(item, options) {
1500
- if (IsUndefined(item))
1501
- throw new Error("Enum undefined or empty");
1502
- const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
1503
- const values2 = [...new Set(values1)];
1504
- const anyOf = values2.map((value) => Literal(value));
1505
- return Union(anyOf, { ...options, [Hint]: "Enum" });
1525
+ function IsSchema2(value) {
1526
+ return IsObject2(value) && (IsAny2(value) || IsArgument2(value) || IsArray4(value) || IsBoolean4(value) || IsBigInt4(value) || IsAsyncIterator4(value) || IsComputed2(value) || IsConstructor2(value) || IsDate4(value) || IsFunction4(value) || IsInteger3(value) || IsIntersect2(value) || IsIterator4(value) || IsLiteral2(value) || IsMappedKey2(value) || IsMappedResult2(value) || IsNever2(value) || IsNot2(value) || IsNull4(value) || IsNumber4(value) || IsObject4(value) || IsPromise3(value) || IsRecord2(value) || IsRef2(value) || IsRegExp3(value) || IsString4(value) || IsSymbol4(value) || IsTemplateLiteral2(value) || IsThis2(value) || IsTuple2(value) || IsUndefined4(value) || IsUnion2(value) || IsUint8Array4(value) || IsUnknown2(value) || IsUnsafe2(value) || IsVoid2(value) || IsKind2(value));
1506
1527
  }
1507
1528
 
1508
1529
  // ../../node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs
@@ -1568,7 +1589,7 @@ function FromInteger(left, right) {
1568
1589
  function FromIntersectRight(left, right) {
1569
1590
  return right.allOf.every((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1570
1591
  }
1571
- function FromIntersect4(left, right) {
1592
+ function FromIntersect3(left, right) {
1572
1593
  return left.allOf.some((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1573
1594
  }
1574
1595
  function FromIterator(left, right) {
@@ -1670,11 +1691,11 @@ function FromObject(left, right) {
1670
1691
  return ExtendsResult.True;
1671
1692
  })();
1672
1693
  }
1673
- function FromPromise2(left, right) {
1694
+ function FromPromise(left, right) {
1674
1695
  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));
1675
1696
  }
1676
1697
  function RecordKey(schema) {
1677
- return PatternNumberExact in schema.patternProperties ? Number2() : PatternStringExact in schema.patternProperties ? String2() : Throw("Unknown record key pattern");
1698
+ return PatternNumberExact in schema.patternProperties ? Number2() : PatternStringExact in schema.patternProperties ? String() : Throw("Unknown record key pattern");
1678
1699
  }
1679
1700
  function RecordValue(schema) {
1680
1701
  return PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] : PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] : Throw("Unable to get record value schema");
@@ -1694,8 +1715,8 @@ function FromRecord(left, right) {
1694
1715
  return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsObject(right) ? FromObjectRight(left, right) : !type_exports.IsRecord(right) ? ExtendsResult.False : Visit3(RecordValue(left), RecordValue(right));
1695
1716
  }
1696
1717
  function FromRegExp(left, right) {
1697
- const L = type_exports.IsRegExp(left) ? String2() : left;
1698
- const R = type_exports.IsRegExp(right) ? String2() : right;
1718
+ const L = type_exports.IsRegExp(left) ? String() : left;
1719
+ const R = type_exports.IsRegExp(right) ? String() : right;
1699
1720
  return Visit3(L, R);
1700
1721
  }
1701
1722
  function FromStringRight(left, right) {
@@ -1728,7 +1749,7 @@ function FromUndefined(left, right) {
1728
1749
  function FromUnionRight(left, right) {
1729
1750
  return right.anyOf.some((schema) => Visit3(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1730
1751
  }
1731
- function FromUnion6(left, right) {
1752
+ function FromUnion5(left, right) {
1732
1753
  return left.anyOf.every((schema) => Visit3(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1733
1754
  }
1734
1755
  function FromUnknownRight(left, right) {
@@ -1748,7 +1769,7 @@ function Visit3(left, right) {
1748
1769
  // resolvable
1749
1770
  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) : (
1750
1771
  // standard
1751
- 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]}'`)
1772
+ 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) ? FromIntersect3(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) ? FromPromise(left, right) : type_exports.IsUint8Array(left) ? FromUint8Array(left, right) : type_exports.IsUndefined(left) ? FromUndefined(left, right) : type_exports.IsUnion(left) ? FromUnion5(left, right) : type_exports.IsUnknown(left) ? FromUnknown(left, right) : type_exports.IsVoid(left) ? FromVoid(left, right) : Throw(`Unknown left type operand '${left[Kind]}'`)
1752
1773
  )
1753
1774
  );
1754
1775
  }
@@ -1805,204 +1826,64 @@ function ExcludeFromTemplateLiteral(L, R) {
1805
1826
  }
1806
1827
 
1807
1828
  // ../../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs
1808
- function ExcludeRest(L, R) {
1809
- const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False);
1810
- return excluded.length === 1 ? excluded[0] : Union(excluded);
1811
- }
1812
- function Exclude(L, R, options = {}) {
1813
- if (IsTemplateLiteral(L))
1814
- return CreateType(ExcludeFromTemplateLiteral(L, R), options);
1815
- if (IsMappedResult(L))
1816
- return CreateType(ExcludeFromMappedResult(L, R), options);
1817
- return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
1818
- }
1819
-
1820
- // ../../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
1821
- function FromProperties9(P, U) {
1822
- const Acc = {};
1823
- for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1824
- Acc[K2] = Exclude(P[K2], U);
1825
- return Acc;
1826
- }
1827
- function FromMappedResult7(R, T) {
1828
- return FromProperties9(R.properties, T);
1829
- }
1830
- function ExcludeFromMappedResult(R, T) {
1831
- const P = FromMappedResult7(R, T);
1832
- return MappedResult(P);
1833
- }
1834
-
1835
- // ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs
1836
- function ExtractFromTemplateLiteral(L, R) {
1837
- return Extract(TemplateLiteralToUnion(L), R);
1838
- }
1839
-
1840
- // ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs
1841
- function ExtractRest(L, R) {
1842
- const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
1843
- return extracted.length === 1 ? extracted[0] : Union(extracted);
1844
- }
1845
- function Extract(L, R, options) {
1846
- if (IsTemplateLiteral(L))
1847
- return CreateType(ExtractFromTemplateLiteral(L, R), options);
1848
- if (IsMappedResult(L))
1849
- return CreateType(ExtractFromMappedResult(L, R), options);
1850
- return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
1851
- }
1852
-
1853
- // ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
1854
- function FromProperties10(P, T) {
1855
- const Acc = {};
1856
- for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1857
- Acc[K2] = Extract(P[K2], T);
1858
- return Acc;
1859
- }
1860
- function FromMappedResult8(R, T) {
1861
- return FromProperties10(R.properties, T);
1862
- }
1863
- function ExtractFromMappedResult(R, T) {
1864
- const P = FromMappedResult8(R, T);
1865
- return MappedResult(P);
1866
- }
1867
-
1868
- // ../../node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
1869
- function InstanceType(schema, options) {
1870
- return IsConstructor(schema) ? CreateType(schema.returns, options) : Never(options);
1871
- }
1872
-
1873
- // ../../node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
1874
- function ReadonlyOptional(schema) {
1875
- return Readonly(Optional(schema));
1876
- }
1877
-
1878
- // ../../node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
1879
- function RecordCreateFromPattern(pattern, T, options) {
1880
- return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options);
1881
- }
1882
- function RecordCreateFromKeys(K, T, options) {
1883
- const result = {};
1884
- for (const K2 of K)
1885
- result[K2] = T;
1886
- return Object2(result, { ...options, [Hint]: "Record" });
1887
- }
1888
- function FromTemplateLiteralKey(K, T, options) {
1889
- return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
1890
- }
1891
- function FromUnionKey(key, type, options) {
1892
- return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
1893
- }
1894
- function FromLiteralKey(key, type, options) {
1895
- return RecordCreateFromKeys([key.toString()], type, options);
1896
- }
1897
- function FromRegExpKey(key, type, options) {
1898
- return RecordCreateFromPattern(key.source, type, options);
1899
- }
1900
- function FromStringKey(key, type, options) {
1901
- const pattern = IsUndefined(key.pattern) ? PatternStringExact : key.pattern;
1902
- return RecordCreateFromPattern(pattern, type, options);
1903
- }
1904
- function FromAnyKey(_, type, options) {
1905
- return RecordCreateFromPattern(PatternStringExact, type, options);
1906
- }
1907
- function FromNeverKey(_key, type, options) {
1908
- return RecordCreateFromPattern(PatternNeverExact, type, options);
1909
- }
1910
- function FromBooleanKey(_key, type, options) {
1911
- return Object2({ true: type, false: type }, options);
1912
- }
1913
- function FromIntegerKey(_key, type, options) {
1914
- return RecordCreateFromPattern(PatternNumberExact, type, options);
1915
- }
1916
- function FromNumberKey(_, type, options) {
1917
- return RecordCreateFromPattern(PatternNumberExact, type, options);
1918
- }
1919
- function Record(key, type, options = {}) {
1920
- return IsUnion(key) ? FromUnionKey(key.anyOf, type, options) : IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type, options) : IsLiteral(key) ? FromLiteralKey(key.const, type, options) : IsBoolean2(key) ? FromBooleanKey(key, 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);
1921
- }
1922
- function RecordPattern(record) {
1923
- return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
1924
- }
1925
- function RecordKey2(type) {
1926
- const pattern = RecordPattern(type);
1927
- return pattern === PatternStringExact ? String2() : pattern === PatternNumberExact ? Number2() : String2({ pattern });
1928
- }
1929
- function RecordValue2(type) {
1930
- return type.patternProperties[RecordPattern(type)];
1931
- }
1932
-
1933
- // ../../node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs
1934
- function FromConstructor2(args, type) {
1935
- type.parameters = FromTypes(args, type.parameters);
1936
- type.returns = FromType(args, type.returns);
1937
- return type;
1938
- }
1939
- function FromFunction2(args, type) {
1940
- type.parameters = FromTypes(args, type.parameters);
1941
- type.returns = FromType(args, type.returns);
1942
- return type;
1943
- }
1944
- function FromIntersect5(args, type) {
1945
- type.allOf = FromTypes(args, type.allOf);
1946
- return type;
1947
- }
1948
- function FromUnion7(args, type) {
1949
- type.anyOf = FromTypes(args, type.anyOf);
1950
- return type;
1951
- }
1952
- function FromTuple4(args, type) {
1953
- if (IsUndefined(type.items))
1954
- return type;
1955
- type.items = FromTypes(args, type.items);
1956
- return type;
1957
- }
1958
- function FromArray5(args, type) {
1959
- type.items = FromType(args, type.items);
1960
- return type;
1961
- }
1962
- function FromAsyncIterator2(args, type) {
1963
- type.items = FromType(args, type.items);
1964
- return type;
1829
+ function ExcludeRest(L, R) {
1830
+ const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False);
1831
+ return excluded.length === 1 ? excluded[0] : Union(excluded);
1965
1832
  }
1966
- function FromIterator2(args, type) {
1967
- type.items = FromType(args, type.items);
1968
- return type;
1833
+ function Exclude(L, R, options = {}) {
1834
+ if (IsTemplateLiteral(L))
1835
+ return CreateType(ExcludeFromTemplateLiteral(L, R), options);
1836
+ if (IsMappedResult(L))
1837
+ return CreateType(ExcludeFromMappedResult(L, R), options);
1838
+ return CreateType(IsUnion(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
1969
1839
  }
1970
- function FromPromise3(args, type) {
1971
- type.item = FromType(args, type.item);
1972
- return type;
1840
+
1841
+ // ../../node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
1842
+ function FromProperties9(P, U) {
1843
+ const Acc = {};
1844
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1845
+ Acc[K2] = Exclude(P[K2], U);
1846
+ return Acc;
1973
1847
  }
1974
- function FromObject2(args, type) {
1975
- const mappedProperties = FromProperties11(args, type.properties);
1976
- return { ...type, ...Object2(mappedProperties) };
1848
+ function FromMappedResult7(R, T) {
1849
+ return FromProperties9(R.properties, T);
1977
1850
  }
1978
- function FromRecord2(args, type) {
1979
- const mappedKey = FromType(args, RecordKey2(type));
1980
- const mappedValue = FromType(args, RecordValue2(type));
1981
- const result = Record(mappedKey, mappedValue);
1982
- return { ...type, ...result };
1851
+ function ExcludeFromMappedResult(R, T) {
1852
+ const P = FromMappedResult7(R, T);
1853
+ return MappedResult(P);
1983
1854
  }
1984
- function FromArgument(args, argument) {
1985
- return argument.index in args ? args[argument.index] : Unknown();
1855
+
1856
+ // ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs
1857
+ function ExtractFromTemplateLiteral(L, R) {
1858
+ return Extract(TemplateLiteralToUnion(L), R);
1986
1859
  }
1987
- function FromProperty2(args, type) {
1988
- const isReadonly = IsReadonly(type);
1989
- const isOptional = IsOptional(type);
1990
- const mapped = FromType(args, type);
1991
- return isReadonly && isOptional ? ReadonlyOptional(mapped) : isReadonly && !isOptional ? Readonly(mapped) : !isReadonly && isOptional ? Optional(mapped) : mapped;
1860
+
1861
+ // ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs
1862
+ function ExtractRest(L, R) {
1863
+ const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
1864
+ return extracted.length === 1 ? extracted[0] : Union(extracted);
1992
1865
  }
1993
- function FromProperties11(args, properties) {
1994
- return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => {
1995
- return { ...result, [key]: FromProperty2(args, properties[key]) };
1996
- }, {});
1866
+ function Extract(L, R, options) {
1867
+ if (IsTemplateLiteral(L))
1868
+ return CreateType(ExtractFromTemplateLiteral(L, R), options);
1869
+ if (IsMappedResult(L))
1870
+ return CreateType(ExtractFromMappedResult(L, R), options);
1871
+ return CreateType(IsUnion(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
1997
1872
  }
1998
- function FromTypes(args, types) {
1999
- return types.map((type) => FromType(args, type));
1873
+
1874
+ // ../../node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
1875
+ function FromProperties10(P, T) {
1876
+ const Acc = {};
1877
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P))
1878
+ Acc[K2] = Extract(P[K2], T);
1879
+ return Acc;
2000
1880
  }
2001
- function FromType(args, type) {
2002
- return IsConstructor(type) ? FromConstructor2(args, type) : IsFunction2(type) ? FromFunction2(args, type) : IsIntersect(type) ? FromIntersect5(args, type) : IsUnion(type) ? FromUnion7(args, type) : IsTuple(type) ? FromTuple4(args, type) : IsArray3(type) ? FromArray5(args, type) : IsAsyncIterator2(type) ? FromAsyncIterator2(args, type) : IsIterator2(type) ? FromIterator2(args, type) : IsPromise(type) ? FromPromise3(args, type) : IsObject3(type) ? FromObject2(args, type) : IsRecord(type) ? FromRecord2(args, type) : IsArgument(type) ? FromArgument(args, type) : type;
1881
+ function FromMappedResult8(R, T) {
1882
+ return FromProperties10(R.properties, T);
2003
1883
  }
2004
- function Instantiate(type, args) {
2005
- return FromType(args, CloneType(type));
1884
+ function ExtractFromMappedResult(R, T) {
1885
+ const P = FromMappedResult8(R, T);
1886
+ return MappedResult(P);
2006
1887
  }
2007
1888
 
2008
1889
  // ../../node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs
@@ -2052,14 +1933,14 @@ function FromTemplateLiteral3(schema, mode, options) {
2052
1933
  return { ...schema, pattern: FromLiteralValue(schema.pattern, mode) };
2053
1934
  const strings = [...TemplateLiteralExpressionGenerate(expression)];
2054
1935
  const literals = strings.map((value) => Literal(value));
2055
- const mapped = FromRest5(literals, mode);
1936
+ const mapped = FromRest4(literals, mode);
2056
1937
  const union = Union(mapped);
2057
1938
  return TemplateLiteral([union], options);
2058
1939
  }
2059
1940
  function FromLiteralValue(value, mode) {
2060
1941
  return typeof value === "string" ? mode === "Uncapitalize" ? ApplyUncapitalize(value) : mode === "Capitalize" ? ApplyCapitalize(value) : mode === "Uppercase" ? ApplyUppercase(value) : mode === "Lowercase" ? ApplyLowercase(value) : value : value.toString();
2061
1942
  }
2062
- function FromRest5(T, M) {
1943
+ function FromRest4(T, M) {
2063
1944
  return T.map((L) => Intrinsic(L, M));
2064
1945
  }
2065
1946
  function Intrinsic(schema, mode, options = {}) {
@@ -2067,7 +1948,7 @@ function Intrinsic(schema, mode, options = {}) {
2067
1948
  // Intrinsic-Mapped-Inference
2068
1949
  IsMappedKey(schema) ? IntrinsicFromMappedKey(schema, mode, options) : (
2069
1950
  // Standard-Inference
2070
- IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode, options) : IsUnion(schema) ? Union(FromRest5(schema.anyOf, mode), options) : IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : (
1951
+ IsTemplateLiteral(schema) ? FromTemplateLiteral3(schema, mode, options) : IsUnion(schema) ? Union(FromRest4(schema.anyOf, mode), options) : IsLiteral(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : (
2071
1952
  // Default Type
2072
1953
  CreateType(schema, options)
2073
1954
  )
@@ -2095,15 +1976,48 @@ function Uppercase(T, options = {}) {
2095
1976
  return Intrinsic(T, "Uppercase", options);
2096
1977
  }
2097
1978
 
1979
+ // ../../node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
1980
+ function Not(type, options) {
1981
+ return CreateType({ [Kind]: "Not", not: type }, options);
1982
+ }
1983
+
1984
+ // ../../node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
1985
+ function CloneType(schema, options) {
1986
+ return options === void 0 ? Clone(schema) : Clone({ ...options, ...schema });
1987
+ }
1988
+
1989
+ // ../../node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
1990
+ function FromComputed2(target, parameters) {
1991
+ return Computed("Awaited", [Computed(target, parameters)]);
1992
+ }
1993
+ function FromRef2($ref) {
1994
+ return Computed("Awaited", [Ref($ref)]);
1995
+ }
1996
+ function FromIntersect4(types) {
1997
+ return Intersect(FromRest5(types));
1998
+ }
1999
+ function FromUnion6(types) {
2000
+ return Union(FromRest5(types));
2001
+ }
2002
+ function FromPromise2(type) {
2003
+ return Awaited(type);
2004
+ }
2005
+ function FromRest5(types) {
2006
+ return types.map((type) => Awaited(type));
2007
+ }
2008
+ function Awaited(type, options) {
2009
+ return CreateType(IsComputed(type) ? FromComputed2(type.target, type.parameters) : IsIntersect(type) ? FromIntersect4(type.allOf) : IsUnion(type) ? FromUnion6(type.anyOf) : IsPromise2(type) ? FromPromise2(type.item) : IsRef(type) ? FromRef2(type.$ref) : type, options);
2010
+ }
2011
+
2098
2012
  // ../../node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs
2099
- function FromProperties12(properties, propertyKeys, options) {
2013
+ function FromProperties11(properties, propertyKeys, options) {
2100
2014
  const result = {};
2101
2015
  for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
2102
2016
  result[K2] = Omit(properties[K2], propertyKeys, Clone(options));
2103
2017
  return result;
2104
2018
  }
2105
2019
  function FromMappedResult9(mappedResult, propertyKeys, options) {
2106
- return FromProperties12(mappedResult.properties, propertyKeys, options);
2020
+ return FromProperties11(mappedResult.properties, propertyKeys, options);
2107
2021
  }
2108
2022
  function OmitFromMappedResult(mappedResult, propertyKeys, options) {
2109
2023
  const properties = FromMappedResult9(mappedResult, propertyKeys, options);
@@ -2111,22 +2025,22 @@ function OmitFromMappedResult(mappedResult, propertyKeys, options) {
2111
2025
  }
2112
2026
 
2113
2027
  // ../../node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
2114
- function FromIntersect6(types, propertyKeys) {
2028
+ function FromIntersect5(types, propertyKeys) {
2115
2029
  return types.map((type) => OmitResolve(type, propertyKeys));
2116
2030
  }
2117
- function FromUnion8(types, propertyKeys) {
2031
+ function FromUnion7(types, propertyKeys) {
2118
2032
  return types.map((type) => OmitResolve(type, propertyKeys));
2119
2033
  }
2120
- function FromProperty3(properties, key) {
2034
+ function FromProperty2(properties, key) {
2121
2035
  const { [key]: _, ...R } = properties;
2122
2036
  return R;
2123
2037
  }
2124
- function FromProperties13(properties, propertyKeys) {
2125
- return propertyKeys.reduce((T, K2) => FromProperty3(T, K2), properties);
2038
+ function FromProperties12(properties, propertyKeys) {
2039
+ return propertyKeys.reduce((T, K2) => FromProperty2(T, K2), properties);
2126
2040
  }
2127
- function FromObject3(type, propertyKeys, properties) {
2041
+ function FromObject2(type, propertyKeys, properties) {
2128
2042
  const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
2129
- const mappedProperties = FromProperties13(properties, propertyKeys);
2043
+ const mappedProperties = FromProperties12(properties, propertyKeys);
2130
2044
  return Object2(mappedProperties, options);
2131
2045
  }
2132
2046
  function UnionFromPropertyKeys(propertyKeys) {
@@ -2134,10 +2048,10 @@ function UnionFromPropertyKeys(propertyKeys) {
2134
2048
  return Union(result);
2135
2049
  }
2136
2050
  function OmitResolve(type, propertyKeys) {
2137
- return IsIntersect(type) ? Intersect(FromIntersect6(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion8(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject3(type, propertyKeys, type.properties) : Object2({});
2051
+ return IsIntersect(type) ? Intersect(FromIntersect5(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion7(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject2(type, propertyKeys, type.properties) : Object2({});
2138
2052
  }
2139
2053
  function Omit(type, key, options) {
2140
- const typeKey = IsArray(key) ? UnionFromPropertyKeys(key) : key;
2054
+ const typeKey = IsArray2(key) ? UnionFromPropertyKeys(key) : key;
2141
2055
  const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
2142
2056
  const isTypeRef = IsRef(type);
2143
2057
  const isKeyRef = IsRef(key);
@@ -2162,14 +2076,14 @@ function OmitFromMappedKey(type, mappedKey, options) {
2162
2076
  }
2163
2077
 
2164
2078
  // ../../node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
2165
- function FromProperties14(properties, propertyKeys, options) {
2079
+ function FromProperties13(properties, propertyKeys, options) {
2166
2080
  const result = {};
2167
2081
  for (const K2 of globalThis.Object.getOwnPropertyNames(properties))
2168
2082
  result[K2] = Pick(properties[K2], propertyKeys, Clone(options));
2169
2083
  return result;
2170
2084
  }
2171
2085
  function FromMappedResult10(mappedResult, propertyKeys, options) {
2172
- return FromProperties14(mappedResult.properties, propertyKeys, options);
2086
+ return FromProperties13(mappedResult.properties, propertyKeys, options);
2173
2087
  }
2174
2088
  function PickFromMappedResult(mappedResult, propertyKeys, options) {
2175
2089
  const properties = FromMappedResult10(mappedResult, propertyKeys, options);
@@ -2177,22 +2091,22 @@ function PickFromMappedResult(mappedResult, propertyKeys, options) {
2177
2091
  }
2178
2092
 
2179
2093
  // ../../node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
2180
- function FromIntersect7(types, propertyKeys) {
2094
+ function FromIntersect6(types, propertyKeys) {
2181
2095
  return types.map((type) => PickResolve(type, propertyKeys));
2182
2096
  }
2183
- function FromUnion9(types, propertyKeys) {
2097
+ function FromUnion8(types, propertyKeys) {
2184
2098
  return types.map((type) => PickResolve(type, propertyKeys));
2185
2099
  }
2186
- function FromProperties15(properties, propertyKeys) {
2100
+ function FromProperties14(properties, propertyKeys) {
2187
2101
  const result = {};
2188
2102
  for (const K2 of propertyKeys)
2189
2103
  if (K2 in properties)
2190
2104
  result[K2] = properties[K2];
2191
2105
  return result;
2192
2106
  }
2193
- function FromObject4(Type2, keys, properties) {
2107
+ function FromObject3(Type2, keys, properties) {
2194
2108
  const options = Discard(Type2, [TransformKind, "$id", "required", "properties"]);
2195
- const mappedProperties = FromProperties15(properties, keys);
2109
+ const mappedProperties = FromProperties14(properties, keys);
2196
2110
  return Object2(mappedProperties, options);
2197
2111
  }
2198
2112
  function UnionFromPropertyKeys2(propertyKeys) {
@@ -2200,10 +2114,10 @@ function UnionFromPropertyKeys2(propertyKeys) {
2200
2114
  return Union(result);
2201
2115
  }
2202
2116
  function PickResolve(type, propertyKeys) {
2203
- return IsIntersect(type) ? Intersect(FromIntersect7(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion9(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject4(type, propertyKeys, type.properties) : Object2({});
2117
+ return IsIntersect(type) ? Intersect(FromIntersect6(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion8(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject3(type, propertyKeys, type.properties) : Object2({});
2204
2118
  }
2205
2119
  function Pick(type, key, options) {
2206
- const typeKey = IsArray(key) ? UnionFromPropertyKeys2(key) : key;
2120
+ const typeKey = IsArray2(key) ? UnionFromPropertyKeys2(key) : key;
2207
2121
  const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
2208
2122
  const isTypeRef = IsRef(type);
2209
2123
  const isKeyRef = IsRef(key);
@@ -2236,15 +2150,15 @@ function FromComputed3(target, parameters) {
2236
2150
  function FromRef3($ref) {
2237
2151
  return Computed("Partial", [Ref($ref)]);
2238
2152
  }
2239
- function FromProperties16(properties) {
2153
+ function FromProperties15(properties) {
2240
2154
  const partialProperties = {};
2241
2155
  for (const K of globalThis.Object.getOwnPropertyNames(properties))
2242
2156
  partialProperties[K] = Optional(properties[K]);
2243
2157
  return partialProperties;
2244
2158
  }
2245
- function FromObject5(type, properties) {
2159
+ function FromObject4(type, properties) {
2246
2160
  const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
2247
- const mappedProperties = FromProperties16(properties);
2161
+ const mappedProperties = FromProperties15(properties);
2248
2162
  return Object2(mappedProperties, options);
2249
2163
  }
2250
2164
  function FromRest6(types) {
@@ -2253,9 +2167,9 @@ function FromRest6(types) {
2253
2167
  function PartialResolve(type) {
2254
2168
  return (
2255
2169
  // Mappable
2256
- 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) ? FromObject5(type, type.properties) : (
2170
+ 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, type.properties) : (
2257
2171
  // Intrinsic
2258
- IsBigInt2(type) ? type : IsBoolean2(type) ? type : IsInteger(type) ? type : IsLiteral(type) ? type : IsNull2(type) ? type : IsNumber3(type) ? type : IsString2(type) ? type : IsSymbol2(type) ? type : IsUndefined3(type) ? type : (
2172
+ IsBigInt3(type) ? type : IsBoolean3(type) ? type : IsInteger2(type) ? type : IsLiteral(type) ? type : IsNull3(type) ? type : IsNumber3(type) ? type : IsString3(type) ? type : IsSymbol3(type) ? type : IsUndefined3(type) ? type : (
2259
2173
  // Passthrough
2260
2174
  Object2({})
2261
2175
  )
@@ -2271,20 +2185,75 @@ function Partial(type, options) {
2271
2185
  }
2272
2186
 
2273
2187
  // ../../node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
2274
- function FromProperties17(K, options) {
2188
+ function FromProperties16(K, options) {
2275
2189
  const Acc = {};
2276
2190
  for (const K2 of globalThis.Object.getOwnPropertyNames(K))
2277
2191
  Acc[K2] = Partial(K[K2], Clone(options));
2278
2192
  return Acc;
2279
2193
  }
2280
2194
  function FromMappedResult11(R, options) {
2281
- return FromProperties17(R.properties, options);
2195
+ return FromProperties16(R.properties, options);
2282
2196
  }
2283
2197
  function PartialFromMappedResult(R, options) {
2284
2198
  const P = FromMappedResult11(R, options);
2285
2199
  return MappedResult(P);
2286
2200
  }
2287
2201
 
2202
+ // ../../node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
2203
+ function RecordCreateFromPattern(pattern, T, options) {
2204
+ return CreateType({ [Kind]: "Record", type: "object", patternProperties: { [pattern]: T } }, options);
2205
+ }
2206
+ function RecordCreateFromKeys(K, T, options) {
2207
+ const result = {};
2208
+ for (const K2 of K)
2209
+ result[K2] = T;
2210
+ return Object2(result, { ...options, [Hint]: "Record" });
2211
+ }
2212
+ function FromTemplateLiteralKey(K, T, options) {
2213
+ return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
2214
+ }
2215
+ function FromUnionKey(key, type, options) {
2216
+ return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
2217
+ }
2218
+ function FromLiteralKey(key, type, options) {
2219
+ return RecordCreateFromKeys([key.toString()], type, options);
2220
+ }
2221
+ function FromRegExpKey(key, type, options) {
2222
+ return RecordCreateFromPattern(key.source, type, options);
2223
+ }
2224
+ function FromStringKey(key, type, options) {
2225
+ const pattern = IsUndefined2(key.pattern) ? PatternStringExact : key.pattern;
2226
+ return RecordCreateFromPattern(pattern, type, options);
2227
+ }
2228
+ function FromAnyKey(_, type, options) {
2229
+ return RecordCreateFromPattern(PatternStringExact, type, options);
2230
+ }
2231
+ function FromNeverKey(_key, type, options) {
2232
+ return RecordCreateFromPattern(PatternNeverExact, type, options);
2233
+ }
2234
+ function FromBooleanKey(_key, type, options) {
2235
+ return Object2({ true: type, false: type }, options);
2236
+ }
2237
+ function FromIntegerKey(_key, type, options) {
2238
+ return RecordCreateFromPattern(PatternNumberExact, type, options);
2239
+ }
2240
+ function FromNumberKey(_, type, options) {
2241
+ return RecordCreateFromPattern(PatternNumberExact, type, options);
2242
+ }
2243
+ function Record(key, type, options = {}) {
2244
+ return IsUnion(key) ? FromUnionKey(key.anyOf, type, options) : IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type, options) : IsLiteral(key) ? FromLiteralKey(key.const, type, options) : IsBoolean3(key) ? FromBooleanKey(key, type, options) : IsInteger2(key) ? FromIntegerKey(key, type, options) : IsNumber3(key) ? FromNumberKey(key, type, options) : IsRegExp2(key) ? FromRegExpKey(key, type, options) : IsString3(key) ? FromStringKey(key, type, options) : IsAny(key) ? FromAnyKey(key, type, options) : IsNever(key) ? FromNeverKey(key, type, options) : Never(options);
2245
+ }
2246
+ function RecordPattern(record) {
2247
+ return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
2248
+ }
2249
+ function RecordKey2(type) {
2250
+ const pattern = RecordPattern(type);
2251
+ return pattern === PatternStringExact ? String() : pattern === PatternNumberExact ? Number2() : String({ pattern });
2252
+ }
2253
+ function RecordValue2(type) {
2254
+ return type.patternProperties[RecordPattern(type)];
2255
+ }
2256
+
2288
2257
  // ../../node_modules/@sinclair/typebox/build/esm/type/required/required.mjs
2289
2258
  function FromComputed4(target, parameters) {
2290
2259
  return Computed("Required", [Computed(target, parameters)]);
@@ -2292,15 +2261,15 @@ function FromComputed4(target, parameters) {
2292
2261
  function FromRef4($ref) {
2293
2262
  return Computed("Required", [Ref($ref)]);
2294
2263
  }
2295
- function FromProperties18(properties) {
2264
+ function FromProperties17(properties) {
2296
2265
  const requiredProperties = {};
2297
2266
  for (const K of globalThis.Object.getOwnPropertyNames(properties))
2298
2267
  requiredProperties[K] = Discard(properties[K], [OptionalKind]);
2299
2268
  return requiredProperties;
2300
2269
  }
2301
- function FromObject6(type, properties) {
2270
+ function FromObject5(type, properties) {
2302
2271
  const options = Discard(type, [TransformKind, "$id", "required", "properties"]);
2303
- const mappedProperties = FromProperties18(properties);
2272
+ const mappedProperties = FromProperties17(properties);
2304
2273
  return Object2(mappedProperties, options);
2305
2274
  }
2306
2275
  function FromRest7(types) {
@@ -2309,9 +2278,9 @@ function FromRest7(types) {
2309
2278
  function RequiredResolve(type) {
2310
2279
  return (
2311
2280
  // Mappable
2312
- 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) ? FromObject6(type, type.properties) : (
2281
+ 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, type.properties) : (
2313
2282
  // Intrinsic
2314
- IsBigInt2(type) ? type : IsBoolean2(type) ? type : IsInteger(type) ? type : IsLiteral(type) ? type : IsNull2(type) ? type : IsNumber3(type) ? type : IsString2(type) ? type : IsSymbol2(type) ? type : IsUndefined3(type) ? type : (
2283
+ IsBigInt3(type) ? type : IsBoolean3(type) ? type : IsInteger2(type) ? type : IsLiteral(type) ? type : IsNull3(type) ? type : IsNumber3(type) ? type : IsString3(type) ? type : IsSymbol3(type) ? type : IsUndefined3(type) ? type : (
2315
2284
  // Passthrough
2316
2285
  Object2({})
2317
2286
  )
@@ -2327,14 +2296,14 @@ function Required(type, options) {
2327
2296
  }
2328
2297
 
2329
2298
  // ../../node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs
2330
- function FromProperties19(P, options) {
2299
+ function FromProperties18(P, options) {
2331
2300
  const Acc = {};
2332
2301
  for (const K2 of globalThis.Object.getOwnPropertyNames(P))
2333
2302
  Acc[K2] = Required(P[K2], options);
2334
2303
  return Acc;
2335
2304
  }
2336
2305
  function FromMappedResult12(R, options) {
2337
- return FromProperties19(R.properties, options);
2306
+ return FromProperties18(R.properties, options);
2338
2307
  }
2339
2308
  function RequiredFromMappedResult(R, options) {
2340
2309
  const P = FromMappedResult12(R, options);
@@ -2344,11 +2313,11 @@ function RequiredFromMappedResult(R, options) {
2344
2313
  // ../../node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs
2345
2314
  function DereferenceParameters(moduleProperties, types) {
2346
2315
  return types.map((type) => {
2347
- return IsRef(type) ? Dereference(moduleProperties, type.$ref) : FromType2(moduleProperties, type);
2316
+ return IsRef(type) ? Dereference(moduleProperties, type.$ref) : FromType(moduleProperties, type);
2348
2317
  });
2349
2318
  }
2350
2319
  function Dereference(moduleProperties, ref) {
2351
- return ref in moduleProperties ? IsRef(moduleProperties[ref]) ? Dereference(moduleProperties, moduleProperties[ref].$ref) : FromType2(moduleProperties, moduleProperties[ref]) : Never();
2320
+ return ref in moduleProperties ? IsRef(moduleProperties[ref]) ? Dereference(moduleProperties, moduleProperties[ref].$ref) : FromType(moduleProperties, moduleProperties[ref]) : Never();
2352
2321
  }
2353
2322
  function FromAwaited(parameters) {
2354
2323
  return Awaited(parameters[0]);
@@ -2375,31 +2344,31 @@ function FromComputed5(moduleProperties, target, parameters) {
2375
2344
  const dereferenced = DereferenceParameters(moduleProperties, parameters);
2376
2345
  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 === "Required" ? FromRequired(dereferenced) : Never();
2377
2346
  }
2378
- function FromArray6(moduleProperties, type) {
2379
- return Array2(FromType2(moduleProperties, type));
2347
+ function FromArray5(moduleProperties, type) {
2348
+ return Array2(FromType(moduleProperties, type));
2380
2349
  }
2381
- function FromAsyncIterator3(moduleProperties, type) {
2382
- return AsyncIterator(FromType2(moduleProperties, type));
2350
+ function FromAsyncIterator2(moduleProperties, type) {
2351
+ return AsyncIterator(FromType(moduleProperties, type));
2383
2352
  }
2384
- function FromConstructor3(moduleProperties, parameters, instanceType) {
2385
- return Constructor(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, instanceType));
2353
+ function FromConstructor2(moduleProperties, parameters, instanceType) {
2354
+ return Constructor(FromTypes(moduleProperties, parameters), FromType(moduleProperties, instanceType));
2386
2355
  }
2387
- function FromFunction3(moduleProperties, parameters, returnType) {
2388
- return Function(FromTypes2(moduleProperties, parameters), FromType2(moduleProperties, returnType));
2356
+ function FromFunction2(moduleProperties, parameters, returnType) {
2357
+ return Function(FromTypes(moduleProperties, parameters), FromType(moduleProperties, returnType));
2389
2358
  }
2390
- function FromIntersect8(moduleProperties, types) {
2391
- return Intersect(FromTypes2(moduleProperties, types));
2359
+ function FromIntersect7(moduleProperties, types) {
2360
+ return Intersect(FromTypes(moduleProperties, types));
2392
2361
  }
2393
- function FromIterator3(moduleProperties, type) {
2394
- return Iterator(FromType2(moduleProperties, type));
2362
+ function FromIterator2(moduleProperties, type) {
2363
+ return Iterator(FromType(moduleProperties, type));
2395
2364
  }
2396
- function FromObject7(moduleProperties, properties) {
2365
+ function FromObject6(moduleProperties, properties) {
2397
2366
  return Object2(globalThis.Object.keys(properties).reduce((result, key) => {
2398
- return { ...result, [key]: FromType2(moduleProperties, properties[key]) };
2367
+ return { ...result, [key]: FromType(moduleProperties, properties[key]) };
2399
2368
  }, {}));
2400
2369
  }
2401
- function FromRecord3(moduleProperties, type) {
2402
- const [value, pattern] = [FromType2(moduleProperties, RecordValue2(type)), RecordPattern(type)];
2370
+ function FromRecord2(moduleProperties, type) {
2371
+ const [value, pattern] = [FromType(moduleProperties, RecordValue2(type)), RecordPattern(type)];
2403
2372
  const result = CloneType(type);
2404
2373
  result.patternProperties[pattern] = value;
2405
2374
  return result;
@@ -2407,29 +2376,29 @@ function FromRecord3(moduleProperties, type) {
2407
2376
  function FromTransform(moduleProperties, transform) {
2408
2377
  return IsRef(transform) ? { ...Dereference(moduleProperties, transform.$ref), [TransformKind]: transform[TransformKind] } : transform;
2409
2378
  }
2410
- function FromTuple5(moduleProperties, types) {
2411
- return Tuple(FromTypes2(moduleProperties, types));
2379
+ function FromTuple4(moduleProperties, types) {
2380
+ return Tuple(FromTypes(moduleProperties, types));
2412
2381
  }
2413
- function FromUnion10(moduleProperties, types) {
2414
- return Union(FromTypes2(moduleProperties, types));
2382
+ function FromUnion9(moduleProperties, types) {
2383
+ return Union(FromTypes(moduleProperties, types));
2415
2384
  }
2416
- function FromTypes2(moduleProperties, types) {
2417
- return types.map((type) => FromType2(moduleProperties, type));
2385
+ function FromTypes(moduleProperties, types) {
2386
+ return types.map((type) => FromType(moduleProperties, type));
2418
2387
  }
2419
- function FromType2(moduleProperties, type) {
2388
+ function FromType(moduleProperties, type) {
2420
2389
  return (
2421
2390
  // Modifiers
2422
- IsOptional(type) ? CreateType(FromType2(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType2(moduleProperties, Discard(type, [ReadonlyKind])), type) : (
2391
+ IsOptional(type) ? CreateType(FromType(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType(moduleProperties, Discard(type, [ReadonlyKind])), type) : (
2423
2392
  // Transform
2424
2393
  IsTransform(type) ? CreateType(FromTransform(moduleProperties, type), type) : (
2425
2394
  // Types
2426
- IsArray3(type) ? CreateType(FromArray6(moduleProperties, type.items), type) : IsAsyncIterator2(type) ? CreateType(FromAsyncIterator3(moduleProperties, type.items), type) : IsComputed(type) ? CreateType(FromComputed5(moduleProperties, type.target, type.parameters)) : IsConstructor(type) ? CreateType(FromConstructor3(moduleProperties, type.parameters, type.returns), type) : IsFunction2(type) ? CreateType(FromFunction3(moduleProperties, type.parameters, type.returns), type) : IsIntersect(type) ? CreateType(FromIntersect8(moduleProperties, type.allOf), type) : IsIterator2(type) ? CreateType(FromIterator3(moduleProperties, type.items), type) : IsObject3(type) ? CreateType(FromObject7(moduleProperties, type.properties), type) : IsRecord(type) ? CreateType(FromRecord3(moduleProperties, type)) : IsTuple(type) ? CreateType(FromTuple5(moduleProperties, type.items || []), type) : IsUnion(type) ? CreateType(FromUnion10(moduleProperties, type.anyOf), type) : type
2395
+ IsArray3(type) ? CreateType(FromArray5(moduleProperties, type.items), type) : IsAsyncIterator3(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) : IsFunction3(type) ? CreateType(FromFunction2(moduleProperties, type.parameters, type.returns), type) : IsIntersect(type) ? CreateType(FromIntersect7(moduleProperties, type.allOf), type) : IsIterator3(type) ? CreateType(FromIterator2(moduleProperties, type.items), type) : IsObject3(type) ? CreateType(FromObject6(moduleProperties, type.properties), type) : IsRecord(type) ? CreateType(FromRecord2(moduleProperties, type)) : IsTuple(type) ? CreateType(FromTuple4(moduleProperties, type.items || []), type) : IsUnion(type) ? CreateType(FromUnion9(moduleProperties, type.anyOf), type) : type
2427
2396
  )
2428
2397
  )
2429
2398
  );
2430
2399
  }
2431
2400
  function ComputeType(moduleProperties, key) {
2432
- return key in moduleProperties ? FromType2(moduleProperties, moduleProperties[key]) : Never();
2401
+ return key in moduleProperties ? FromType(moduleProperties, moduleProperties[key]) : Never();
2433
2402
  }
2434
2403
  function ComputeModuleProperties(moduleProperties) {
2435
2404
  return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => {
@@ -2460,32 +2429,21 @@ function Module(properties) {
2460
2429
  return new TModule(properties);
2461
2430
  }
2462
2431
 
2463
- // ../../node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
2464
- function Not(type, options) {
2465
- return CreateType({ [Kind]: "Not", not: type }, options);
2466
- }
2467
-
2468
- // ../../node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
2469
- function Parameters(schema, options) {
2470
- return IsFunction2(schema) ? Tuple(schema.parameters, options) : Never();
2432
+ // ../../node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
2433
+ function ReadonlyOptional(schema) {
2434
+ return Readonly(Optional(schema));
2471
2435
  }
2472
2436
 
2473
2437
  // ../../node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
2474
2438
  var Ordinal = 0;
2475
2439
  function Recursive(callback, options = {}) {
2476
- if (IsUndefined(options.$id))
2440
+ if (IsUndefined2(options.$id))
2477
2441
  options.$id = `T${Ordinal++}`;
2478
2442
  const thisType = CloneType(callback({ [Kind]: "This", $ref: `${options.$id}` }));
2479
2443
  thisType.$id = options.$id;
2480
2444
  return CreateType({ [Hint]: "Recursive", ...thisType }, options);
2481
2445
  }
2482
2446
 
2483
- // ../../node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
2484
- function RegExp2(unresolved, options) {
2485
- const expr = IsString(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
2486
- return CreateType({ [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags }, options);
2487
- }
2488
-
2489
2447
  // ../../node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs
2490
2448
  function RestResolve(T) {
2491
2449
  return IsIntersect(T) ? T.allOf : IsUnion(T) ? T.anyOf : IsTuple(T) ? T.items ?? [] : [];
@@ -2494,11 +2452,6 @@ function Rest(T) {
2494
2452
  return RestResolve(T);
2495
2453
  }
2496
2454
 
2497
- // ../../node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
2498
- function ReturnType(schema, options) {
2499
- return IsFunction2(schema) ? CreateType(schema.returns, options) : Never(options);
2500
- }
2501
-
2502
2455
  // ../../node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
2503
2456
  var TransformDecodeBuilder = class {
2504
2457
  constructor(schema) {
@@ -2536,11 +2489,6 @@ function Unsafe(options = {}) {
2536
2489
  return CreateType({ [Kind]: options[Kind] ?? "Unsafe" }, options);
2537
2490
  }
2538
2491
 
2539
- // ../../node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
2540
- function Void(options) {
2541
- return CreateType({ [Kind]: "Void", type: "void" }, options);
2542
- }
2543
-
2544
2492
  // ../../node_modules/@sinclair/typebox/build/esm/type/type/type.mjs
2545
2493
  var type_exports2 = {};
2546
2494
  __export(type_exports2, {
@@ -2593,7 +2541,7 @@ __export(type_exports2, {
2593
2541
  Required: () => Required,
2594
2542
  Rest: () => Rest,
2595
2543
  ReturnType: () => ReturnType,
2596
- String: () => String2,
2544
+ String: () => String,
2597
2545
  Symbol: () => Symbol2,
2598
2546
  TemplateLiteral: () => TemplateLiteral,
2599
2547
  Transform: () => Transform,
@@ -2608,146 +2556,163 @@ __export(type_exports2, {
2608
2556
  Void: () => Void
2609
2557
  });
2610
2558
 
2559
+ // ../../node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs
2560
+ function Argument(index) {
2561
+ return CreateType({ [Kind]: "Argument", index });
2562
+ }
2563
+
2564
+ // ../../node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
2565
+ function ConstructorParameters(schema, options) {
2566
+ return IsConstructor(schema) ? Tuple(schema.parameters, options) : Never(options);
2567
+ }
2568
+
2569
+ // ../../node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
2570
+ function InstanceType(schema, options) {
2571
+ return IsConstructor(schema) ? CreateType(schema.returns, options) : Never(options);
2572
+ }
2573
+
2574
+ // ../../node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs
2575
+ function FromConstructor3(args, type) {
2576
+ type.parameters = FromTypes2(args, type.parameters);
2577
+ type.returns = FromType2(args, type.returns);
2578
+ return type;
2579
+ }
2580
+ function FromFunction3(args, type) {
2581
+ type.parameters = FromTypes2(args, type.parameters);
2582
+ type.returns = FromType2(args, type.returns);
2583
+ return type;
2584
+ }
2585
+ function FromIntersect8(args, type) {
2586
+ type.allOf = FromTypes2(args, type.allOf);
2587
+ return type;
2588
+ }
2589
+ function FromUnion10(args, type) {
2590
+ type.anyOf = FromTypes2(args, type.anyOf);
2591
+ return type;
2592
+ }
2593
+ function FromTuple5(args, type) {
2594
+ if (IsUndefined2(type.items))
2595
+ return type;
2596
+ type.items = FromTypes2(args, type.items);
2597
+ return type;
2598
+ }
2599
+ function FromArray6(args, type) {
2600
+ type.items = FromType2(args, type.items);
2601
+ return type;
2602
+ }
2603
+ function FromAsyncIterator3(args, type) {
2604
+ type.items = FromType2(args, type.items);
2605
+ return type;
2606
+ }
2607
+ function FromIterator3(args, type) {
2608
+ type.items = FromType2(args, type.items);
2609
+ return type;
2610
+ }
2611
+ function FromPromise3(args, type) {
2612
+ type.item = FromType2(args, type.item);
2613
+ return type;
2614
+ }
2615
+ function FromObject7(args, type) {
2616
+ const mappedProperties = FromProperties19(args, type.properties);
2617
+ return { ...type, ...Object2(mappedProperties) };
2618
+ }
2619
+ function FromRecord3(args, type) {
2620
+ const mappedKey = FromType2(args, RecordKey2(type));
2621
+ const mappedValue = FromType2(args, RecordValue2(type));
2622
+ const result = Record(mappedKey, mappedValue);
2623
+ return { ...type, ...result };
2624
+ }
2625
+ function FromArgument(args, argument) {
2626
+ return argument.index in args ? args[argument.index] : Unknown();
2627
+ }
2628
+ function FromProperty3(args, type) {
2629
+ const isReadonly = IsReadonly(type);
2630
+ const isOptional = IsOptional(type);
2631
+ const mapped = FromType2(args, type);
2632
+ return isReadonly && isOptional ? ReadonlyOptional(mapped) : isReadonly && !isOptional ? Readonly(mapped) : !isReadonly && isOptional ? Optional(mapped) : mapped;
2633
+ }
2634
+ function FromProperties19(args, properties) {
2635
+ return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => {
2636
+ return { ...result, [key]: FromProperty3(args, properties[key]) };
2637
+ }, {});
2638
+ }
2639
+ function FromTypes2(args, types) {
2640
+ return types.map((type) => FromType2(args, type));
2641
+ }
2642
+ function FromType2(args, type) {
2643
+ return IsConstructor(type) ? FromConstructor3(args, type) : IsFunction3(type) ? FromFunction3(args, type) : IsIntersect(type) ? FromIntersect8(args, type) : IsUnion(type) ? FromUnion10(args, type) : IsTuple(type) ? FromTuple5(args, type) : IsArray3(type) ? FromArray6(args, type) : IsAsyncIterator3(type) ? FromAsyncIterator3(args, type) : IsIterator3(type) ? FromIterator3(args, type) : IsPromise2(type) ? FromPromise3(args, type) : IsObject3(type) ? FromObject7(args, type) : IsRecord(type) ? FromRecord3(args, type) : IsArgument(type) ? FromArgument(args, type) : type;
2644
+ }
2645
+ function Instantiate(type, args) {
2646
+ return FromType2(args, CloneType(type));
2647
+ }
2648
+
2649
+ // ../../node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
2650
+ function Parameters(schema, options) {
2651
+ return IsFunction3(schema) ? Tuple(schema.parameters, options) : Never();
2652
+ }
2653
+
2654
+ // ../../node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
2655
+ function RegExp2(unresolved, options) {
2656
+ const expr = IsString2(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
2657
+ return CreateType({ [Kind]: "RegExp", type: "RegExp", source: expr.source, flags: expr.flags }, options);
2658
+ }
2659
+
2660
+ // ../../node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
2661
+ function ReturnType(schema, options) {
2662
+ return IsFunction3(schema) ? CreateType(schema.returns, options) : Never(options);
2663
+ }
2664
+
2665
+ // ../../node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
2666
+ function Void(options) {
2667
+ return CreateType({ [Kind]: "Void", type: "void" }, options);
2668
+ }
2669
+
2611
2670
  // ../../node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
2612
2671
  var Type = type_exports2;
2613
2672
 
2614
- // builtin/extensions/questionnaire/index.ts
2615
- var QuestionnaireParams = Type.Object({
2616
- prompt: Type.String({
2617
- description: "REQUIRED: The question text to display to the user (e.g., 'What is your favorite color?')"
2618
- }),
2619
- options: Type.Array(
2620
- Type.String({ description: "An option label" }),
2621
- { description: "REQUIRED: Array of option strings (e.g., ['Red', 'Blue', 'Green']). Must have at least 2 items." }
2622
- ),
2623
- allowOther: Type.Optional(Type.Boolean({
2624
- description: "Whether to show '\u270F\uFE0F Other' option for custom input (default: true)",
2625
- default: true
2626
- }))
2627
- });
2628
- function questionnaireExtension(ctx) {
2629
- ctx.log("Questionnaire extension loaded");
2630
- ctx.registerTool({
2631
- name: "questionnaire",
2632
- label: "Questionnaire",
2633
- description: `INTERACTIVE QUESTION TOOL - Ask the user a multiple-choice question with optional "Other" input.
2634
-
2635
- WHEN TO USE:
2636
- - Asking the user to choose from multiple options
2637
- - Getting user confirmation (Yes/No)
2638
- - Interactive questionnaires or surveys
2639
- - When you need a definitive answer from the user
2640
-
2641
- FEATURES:
2642
- - Auto "\u270F\uFE0F Other" option (default: true) - user can type custom answer
2643
- - Arrow key navigation (up/down)
2644
- - Letter shortcuts (A, B, C...)
2645
-
2646
- PARAMETERS:
2647
- - prompt: Question text (required)
2648
- - options: Array of options, min 2 items (required)
2649
- - allowOther: Show "Other" option (default: true)
2650
-
2651
- EXAMPLES:
2652
- 1. With auto "Other":
2653
- {"prompt": "Favorite color?", "options": ["Red", "Blue"]}
2654
- \u2192 Shows: A. Red, B. Blue, C. \u270F\uFE0F Other
2655
-
2656
- 2. Yes/No only:
2657
- {"prompt": "Proceed?", "options": ["Yes", "No"], "allowOther": false}
2658
-
2659
- 3. Multiple questions (call tool multiple times):
2660
- Q1: {"prompt": "Language?", "options": ["Python", "JS"]}
2661
- Q2: {"prompt": "Framework?", "options": ["React", "Vue"]}`,
2662
- parameters: QuestionnaireParams,
2663
- async execute(args) {
2664
- ctx.log(`[questionnaire] Called with args: ${JSON.stringify(args)}`);
2665
- const { prompt, options, allowOther = true } = args;
2666
- if (!prompt || typeof prompt !== "string") {
2667
- return {
2668
- content: [{
2669
- type: "text",
2670
- text: "Error: 'prompt' parameter is required and must be a string. Example: prompt: 'What is your favorite color?'"
2671
- }],
2672
- isError: true
2673
- };
2674
- }
2675
- if (!Array.isArray(options) || options.length < 2) {
2676
- return {
2677
- content: [{
2678
- type: "text",
2679
- text: "Error: 'options' parameter is required and must be an array with at least 2 items. Example: options: ['Red', 'Blue', 'Green']"
2680
- }],
2681
- isError: true
2682
- };
2683
- }
2684
- if (!ctx.hasUI) {
2685
- const otherText = allowOther ? " / Other" : "";
2686
- return {
2687
- content: [{
2688
- type: "text",
2689
- text: `${prompt}
2690
- Options: ${options.join(", ")}${otherText}
2691
-
2692
- Please reply with your choice.`
2693
- }],
2694
- isError: false
2695
- };
2696
- }
2697
- let displayOptions = [...options];
2698
- if (allowOther !== false) {
2699
- displayOptions.push("\u270F\uFE0F Other (type your own)");
2700
- }
2701
- const optionLabels = displayOptions.map(
2702
- (opt, idx) => `${String.fromCharCode(65 + idx)}. ${opt}`
2703
- );
2704
- const selection = await ctx.ui.select(prompt, optionLabels);
2705
- if (selection === void 0) {
2706
- return {
2707
- content: [{ type: "text", text: "User cancelled the questionnaire" }],
2708
- details: { cancelled: true }
2709
- };
2710
- }
2711
- const selectedIndex = optionLabels.indexOf(selection);
2712
- const selectedValue = displayOptions[selectedIndex];
2713
- if (selectedValue === "\u270F\uFE0F Other (type your own)") {
2714
- const customAnswer = await ctx.ui.input(`${prompt} (Other)`, "Please specify...");
2715
- if (customAnswer === void 0) {
2716
- return {
2717
- content: [{ type: "text", text: "User cancelled" }],
2718
- details: { cancelled: true }
2719
- };
2720
- }
2721
- return {
2722
- content: [{
2723
- type: "text",
2724
- text: `Other: ${customAnswer}`
2725
- }],
2726
- details: {
2727
- prompt,
2728
- selectedValue: customAnswer,
2729
- isOther: true,
2730
- cancelled: false
2731
- }
2732
- };
2733
- }
2734
- return {
2735
- content: [{
2736
- type: "text",
2737
- text: `${String.fromCharCode(65 + selectedIndex)}. ${selectedValue}`
2738
- }],
2739
- details: {
2740
- prompt,
2741
- selectedValue,
2742
- selectedIndex: selectedIndex + 1,
2743
- isOther: false,
2744
- cancelled: false
2745
- }
2746
- };
2747
- }
2748
- });
2749
- ctx.ui.notify("\u2753 Questionnaire extension loaded", "info");
2750
- }
2751
2673
  export {
2752
- questionnaireExtension as default
2674
+ IsAsyncIterator,
2675
+ IsIterator,
2676
+ IsStandardObject,
2677
+ IsPromise,
2678
+ IsDate,
2679
+ IsMap,
2680
+ IsSet,
2681
+ IsTypedArray,
2682
+ IsUint8Array,
2683
+ HasPropertyKey,
2684
+ IsObject,
2685
+ IsArray,
2686
+ IsUndefined,
2687
+ IsNull,
2688
+ IsBoolean,
2689
+ IsNumber,
2690
+ IsInteger,
2691
+ IsBigInt,
2692
+ IsString,
2693
+ IsFunction,
2694
+ IsSymbol,
2695
+ IsValueType,
2696
+ TypeSystemPolicy,
2697
+ TypeBoxError,
2698
+ TransformKind,
2699
+ Kind,
2700
+ IsTransform,
2701
+ IsUndefined3 as IsUndefined2,
2702
+ IsKind,
2703
+ IsSchema,
2704
+ IsSchema2,
2705
+ Never,
2706
+ Union,
2707
+ IsTemplateLiteralFinite,
2708
+ TemplateLiteralGenerate,
2709
+ Literal,
2710
+ String,
2711
+ IndexFromPropertyKeys,
2712
+ Object2 as Object,
2713
+ Ref,
2714
+ KeyOfPropertyKeys,
2715
+ KeyOfPattern,
2716
+ Unknown,
2717
+ Type
2753
2718
  };