@alfe.ai/openclaw 0.0.16 → 0.0.18

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.
Files changed (3) hide show
  1. package/dist/index.js +3955 -2
  2. package/dist/plugin2.js +2779 -2
  3. package/package.json +6 -5
package/dist/plugin2.js CHANGED
@@ -1,11 +1,2788 @@
1
+ import { createRequire } from "node:module";
1
2
  import { join } from "node:path";
2
3
  import { homedir } from "node:os";
3
- import { Type } from "@sinclair/typebox";
4
4
  import { resolveConfig } from "@alfe.ai/config";
5
5
  import { createConnection } from "node:net";
6
6
  import { randomUUID } from "node:crypto";
7
7
  import { EventEmitter } from "node:events";
8
8
  import { createLogger } from "@auriclabs/logger";
9
+ //#region \0rolldown/runtime.js
10
+ var __create = Object.create;
11
+ var __defProp = Object.defineProperty;
12
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
+ var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
15
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
16
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
17
+ var __exportAll = (all, no_symbols) => {
18
+ let target = {};
19
+ for (var name in all) __defProp(target, name, {
20
+ get: all[name],
21
+ enumerable: true
22
+ });
23
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
24
+ return target;
25
+ };
26
+ var __copyProps = (to, from, except, desc) => {
27
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
28
+ key = keys[i];
29
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
30
+ get: ((k) => from[k]).bind(null, key),
31
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
32
+ });
33
+ }
34
+ return to;
35
+ };
36
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
37
+ value: mod,
38
+ enumerable: true
39
+ }) : target, mod));
40
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
41
+ //#endregion
42
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
43
+ /** Returns true if this value is an async iterator */
44
+ function IsAsyncIterator$2(value) {
45
+ return IsObject$3(value) && !IsArray$3(value) && !IsUint8Array$2(value) && Symbol.asyncIterator in value;
46
+ }
47
+ /** Returns true if this value is an array */
48
+ function IsArray$3(value) {
49
+ return Array.isArray(value);
50
+ }
51
+ /** Returns true if this value is bigint */
52
+ function IsBigInt$2(value) {
53
+ return typeof value === "bigint";
54
+ }
55
+ /** Returns true if this value is a boolean */
56
+ function IsBoolean$2(value) {
57
+ return typeof value === "boolean";
58
+ }
59
+ /** Returns true if this value is a Date object */
60
+ function IsDate$2(value) {
61
+ return value instanceof globalThis.Date;
62
+ }
63
+ /** Returns true if this value is a function */
64
+ function IsFunction$2(value) {
65
+ return typeof value === "function";
66
+ }
67
+ /** Returns true if this value is an iterator */
68
+ function IsIterator$2(value) {
69
+ return IsObject$3(value) && !IsArray$3(value) && !IsUint8Array$2(value) && Symbol.iterator in value;
70
+ }
71
+ /** Returns true if this value is null */
72
+ function IsNull$2(value) {
73
+ return value === null;
74
+ }
75
+ /** Returns true if this value is number */
76
+ function IsNumber$3(value) {
77
+ return typeof value === "number";
78
+ }
79
+ /** Returns true if this value is an object */
80
+ function IsObject$3(value) {
81
+ return typeof value === "object" && value !== null;
82
+ }
83
+ /** Returns true if this value is RegExp */
84
+ function IsRegExp$2(value) {
85
+ return value instanceof globalThis.RegExp;
86
+ }
87
+ /** Returns true if this value is string */
88
+ function IsString$2(value) {
89
+ return typeof value === "string";
90
+ }
91
+ /** Returns true if this value is symbol */
92
+ function IsSymbol$2(value) {
93
+ return typeof value === "symbol";
94
+ }
95
+ /** Returns true if this value is a Uint8Array */
96
+ function IsUint8Array$2(value) {
97
+ return value instanceof globalThis.Uint8Array;
98
+ }
99
+ /** Returns true if this value is undefined */
100
+ function IsUndefined$3(value) {
101
+ return value === void 0;
102
+ }
103
+ //#endregion
104
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/clone/value.mjs
105
+ function ArrayType(value) {
106
+ return value.map((value) => Visit$2(value));
107
+ }
108
+ function DateType(value) {
109
+ return new Date(value.getTime());
110
+ }
111
+ function Uint8ArrayType(value) {
112
+ return new Uint8Array(value);
113
+ }
114
+ function RegExpType(value) {
115
+ return new RegExp(value.source, value.flags);
116
+ }
117
+ function ObjectType(value) {
118
+ const result = {};
119
+ for (const key of Object.getOwnPropertyNames(value)) result[key] = Visit$2(value[key]);
120
+ for (const key of Object.getOwnPropertySymbols(value)) result[key] = Visit$2(value[key]);
121
+ return result;
122
+ }
123
+ function Visit$2(value) {
124
+ return IsArray$3(value) ? ArrayType(value) : IsDate$2(value) ? DateType(value) : IsUint8Array$2(value) ? Uint8ArrayType(value) : IsRegExp$2(value) ? RegExpType(value) : IsObject$3(value) ? ObjectType(value) : value;
125
+ }
126
+ /** Clones a value */
127
+ function Clone(value) {
128
+ return Visit$2(value);
129
+ }
130
+ //#endregion
131
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/clone/type.mjs
132
+ /** Clones a Type */
133
+ function CloneType(schema, options) {
134
+ return options === void 0 ? Clone(schema) : Clone({
135
+ ...options,
136
+ ...schema
137
+ });
138
+ }
139
+ //#endregion
140
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/value/guard/guard.mjs
141
+ /** Returns true of this value is an object type */
142
+ function IsObject$2(value) {
143
+ return value !== null && typeof value === "object";
144
+ }
145
+ /** Returns true if this value is an array, but not a typed array */
146
+ function IsArray$2(value) {
147
+ return globalThis.Array.isArray(value) && !globalThis.ArrayBuffer.isView(value);
148
+ }
149
+ /** Returns true if this value is an undefined */
150
+ function IsUndefined$2(value) {
151
+ return value === void 0;
152
+ }
153
+ /** Returns true if this value is an number */
154
+ function IsNumber$2(value) {
155
+ return typeof value === "number";
156
+ }
157
+ //#endregion
158
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/system/policy.mjs
159
+ var TypeSystemPolicy;
160
+ (function(TypeSystemPolicy) {
161
+ /**
162
+ * Configures the instantiation behavior of TypeBox types. The `default` option assigns raw JavaScript
163
+ * references for embedded types, which may cause side effects if type properties are explicitly updated
164
+ * outside the TypeBox type builder. The `clone` option creates copies of any shared types upon creation,
165
+ * preventing unintended side effects. The `freeze` option applies `Object.freeze()` to the type, making
166
+ * it fully readonly and immutable. Implementations should use `default` whenever possible, as it is the
167
+ * fastest way to instantiate types. The default setting is `default`.
168
+ */
169
+ TypeSystemPolicy.InstanceMode = "default";
170
+ /** Sets whether TypeBox should assert optional properties using the TypeScript `exactOptionalPropertyTypes` assertion policy. The default is `false` */
171
+ TypeSystemPolicy.ExactOptionalPropertyTypes = false;
172
+ /** Sets whether arrays should be treated as a kind of objects. The default is `false` */
173
+ TypeSystemPolicy.AllowArrayObject = false;
174
+ /** Sets whether `NaN` or `Infinity` should be treated as valid numeric values. The default is `false` */
175
+ TypeSystemPolicy.AllowNaN = false;
176
+ /** Sets whether `null` should validate for void types. The default is `false` */
177
+ TypeSystemPolicy.AllowNullVoid = false;
178
+ /** Checks this value using the ExactOptionalPropertyTypes policy */
179
+ function IsExactOptionalProperty(value, key) {
180
+ return TypeSystemPolicy.ExactOptionalPropertyTypes ? key in value : value[key] !== void 0;
181
+ }
182
+ TypeSystemPolicy.IsExactOptionalProperty = IsExactOptionalProperty;
183
+ /** Checks this value using the AllowArrayObjects policy */
184
+ function IsObjectLike(value) {
185
+ const isObject = IsObject$2(value);
186
+ return TypeSystemPolicy.AllowArrayObject ? isObject : isObject && !IsArray$2(value);
187
+ }
188
+ TypeSystemPolicy.IsObjectLike = IsObjectLike;
189
+ /** Checks this value as a record using the AllowArrayObjects policy */
190
+ function IsRecordLike(value) {
191
+ return IsObjectLike(value) && !(value instanceof Date) && !(value instanceof Uint8Array);
192
+ }
193
+ TypeSystemPolicy.IsRecordLike = IsRecordLike;
194
+ /** Checks this value using the AllowNaN policy */
195
+ function IsNumberLike(value) {
196
+ return TypeSystemPolicy.AllowNaN ? IsNumber$2(value) : Number.isFinite(value);
197
+ }
198
+ TypeSystemPolicy.IsNumberLike = IsNumberLike;
199
+ /** Checks this value using the AllowVoidNull policy */
200
+ function IsVoidLike(value) {
201
+ const isUndefined = IsUndefined$2(value);
202
+ return TypeSystemPolicy.AllowNullVoid ? isUndefined || value === null : isUndefined;
203
+ }
204
+ TypeSystemPolicy.IsVoidLike = IsVoidLike;
205
+ })(TypeSystemPolicy || (TypeSystemPolicy = {}));
206
+ //#endregion
207
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/create/immutable.mjs
208
+ function ImmutableArray(value) {
209
+ return globalThis.Object.freeze(value).map((value) => Immutable(value));
210
+ }
211
+ function ImmutableDate(value) {
212
+ return value;
213
+ }
214
+ function ImmutableUint8Array(value) {
215
+ return value;
216
+ }
217
+ function ImmutableRegExp(value) {
218
+ return value;
219
+ }
220
+ function ImmutableObject(value) {
221
+ const result = {};
222
+ for (const key of Object.getOwnPropertyNames(value)) result[key] = Immutable(value[key]);
223
+ for (const key of Object.getOwnPropertySymbols(value)) result[key] = Immutable(value[key]);
224
+ return globalThis.Object.freeze(result);
225
+ }
226
+ /** Specialized deep immutable value. Applies freeze recursively to the given value */
227
+ function Immutable(value) {
228
+ return IsArray$3(value) ? ImmutableArray(value) : IsDate$2(value) ? ImmutableDate(value) : IsUint8Array$2(value) ? ImmutableUint8Array(value) : IsRegExp$2(value) ? ImmutableRegExp(value) : IsObject$3(value) ? ImmutableObject(value) : value;
229
+ }
230
+ //#endregion
231
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/create/type.mjs
232
+ /** Creates TypeBox schematics using the configured InstanceMode */
233
+ function CreateType(schema, options) {
234
+ const result = options !== void 0 ? {
235
+ ...options,
236
+ ...schema
237
+ } : schema;
238
+ switch (TypeSystemPolicy.InstanceMode) {
239
+ case "freeze": return Immutable(result);
240
+ case "clone": return Clone(result);
241
+ default: return result;
242
+ }
243
+ }
244
+ //#endregion
245
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/error/error.mjs
246
+ /** The base Error type thrown for all TypeBox exceptions */
247
+ var TypeBoxError = class extends Error {
248
+ constructor(message) {
249
+ super(message);
250
+ }
251
+ };
252
+ //#endregion
253
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.mjs
254
+ /** Symbol key applied to transform types */
255
+ const TransformKind = Symbol.for("TypeBox.Transform");
256
+ /** Symbol key applied to readonly types */
257
+ const ReadonlyKind = Symbol.for("TypeBox.Readonly");
258
+ /** Symbol key applied to optional types */
259
+ const OptionalKind = Symbol.for("TypeBox.Optional");
260
+ /** Symbol key applied to types */
261
+ const Hint = Symbol.for("TypeBox.Hint");
262
+ /** Symbol key applied to types */
263
+ const Kind = Symbol.for("TypeBox.Kind");
264
+ //#endregion
265
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/guard/kind.mjs
266
+ /** `[Kind-Only]` Returns true if this value has a Readonly symbol */
267
+ function IsReadonly(value) {
268
+ return IsObject$3(value) && value[ReadonlyKind] === "Readonly";
269
+ }
270
+ /** `[Kind-Only]` Returns true if this value has a Optional symbol */
271
+ function IsOptional$1(value) {
272
+ return IsObject$3(value) && value[OptionalKind] === "Optional";
273
+ }
274
+ /** `[Kind-Only]` Returns true if the given value is TAny */
275
+ function IsAny$1(value) {
276
+ return IsKindOf$1(value, "Any");
277
+ }
278
+ /** `[Kind-Only]` Returns true if the given value is TArgument */
279
+ function IsArgument$1(value) {
280
+ return IsKindOf$1(value, "Argument");
281
+ }
282
+ /** `[Kind-Only]` Returns true if the given value is TArray */
283
+ function IsArray$1(value) {
284
+ return IsKindOf$1(value, "Array");
285
+ }
286
+ /** `[Kind-Only]` Returns true if the given value is TAsyncIterator */
287
+ function IsAsyncIterator$1(value) {
288
+ return IsKindOf$1(value, "AsyncIterator");
289
+ }
290
+ /** `[Kind-Only]` Returns true if the given value is TBigInt */
291
+ function IsBigInt$1(value) {
292
+ return IsKindOf$1(value, "BigInt");
293
+ }
294
+ /** `[Kind-Only]` Returns true if the given value is TBoolean */
295
+ function IsBoolean$1(value) {
296
+ return IsKindOf$1(value, "Boolean");
297
+ }
298
+ /** `[Kind-Only]` Returns true if the given value is TComputed */
299
+ function IsComputed$1(value) {
300
+ return IsKindOf$1(value, "Computed");
301
+ }
302
+ /** `[Kind-Only]` Returns true if the given value is TConstructor */
303
+ function IsConstructor$1(value) {
304
+ return IsKindOf$1(value, "Constructor");
305
+ }
306
+ /** `[Kind-Only]` Returns true if the given value is TDate */
307
+ function IsDate$1(value) {
308
+ return IsKindOf$1(value, "Date");
309
+ }
310
+ /** `[Kind-Only]` Returns true if the given value is TFunction */
311
+ function IsFunction$1(value) {
312
+ return IsKindOf$1(value, "Function");
313
+ }
314
+ /** `[Kind-Only]` Returns true if the given value is TInteger */
315
+ function IsInteger$1(value) {
316
+ return IsKindOf$1(value, "Integer");
317
+ }
318
+ /** `[Kind-Only]` Returns true if the given value is TIntersect */
319
+ function IsIntersect$1(value) {
320
+ return IsKindOf$1(value, "Intersect");
321
+ }
322
+ /** `[Kind-Only]` Returns true if the given value is TIterator */
323
+ function IsIterator$1(value) {
324
+ return IsKindOf$1(value, "Iterator");
325
+ }
326
+ /** `[Kind-Only]` Returns true if the given value is a TKind with the given name. */
327
+ function IsKindOf$1(value, kind) {
328
+ return IsObject$3(value) && Kind in value && value[Kind] === kind;
329
+ }
330
+ /** `[Kind-Only]` Returns true if the given value is TLiteralValue */
331
+ function IsLiteralValue$1(value) {
332
+ return IsBoolean$2(value) || IsNumber$3(value) || IsString$2(value);
333
+ }
334
+ /** `[Kind-Only]` Returns true if the given value is TLiteral */
335
+ function IsLiteral$1(value) {
336
+ return IsKindOf$1(value, "Literal");
337
+ }
338
+ /** `[Kind-Only]` Returns true if the given value is a TMappedKey */
339
+ function IsMappedKey$1(value) {
340
+ return IsKindOf$1(value, "MappedKey");
341
+ }
342
+ /** `[Kind-Only]` Returns true if the given value is TMappedResult */
343
+ function IsMappedResult$1(value) {
344
+ return IsKindOf$1(value, "MappedResult");
345
+ }
346
+ /** `[Kind-Only]` Returns true if the given value is TNever */
347
+ function IsNever$1(value) {
348
+ return IsKindOf$1(value, "Never");
349
+ }
350
+ /** `[Kind-Only]` Returns true if the given value is TNot */
351
+ function IsNot$1(value) {
352
+ return IsKindOf$1(value, "Not");
353
+ }
354
+ /** `[Kind-Only]` Returns true if the given value is TNull */
355
+ function IsNull$1(value) {
356
+ return IsKindOf$1(value, "Null");
357
+ }
358
+ /** `[Kind-Only]` Returns true if the given value is TNumber */
359
+ function IsNumber$1(value) {
360
+ return IsKindOf$1(value, "Number");
361
+ }
362
+ /** `[Kind-Only]` Returns true if the given value is TObject */
363
+ function IsObject$1(value) {
364
+ return IsKindOf$1(value, "Object");
365
+ }
366
+ /** `[Kind-Only]` Returns true if the given value is TPromise */
367
+ function IsPromise$1(value) {
368
+ return IsKindOf$1(value, "Promise");
369
+ }
370
+ /** `[Kind-Only]` Returns true if the given value is TRecord */
371
+ function IsRecord$1(value) {
372
+ return IsKindOf$1(value, "Record");
373
+ }
374
+ /** `[Kind-Only]` Returns true if the given value is TRef */
375
+ function IsRef$1(value) {
376
+ return IsKindOf$1(value, "Ref");
377
+ }
378
+ /** `[Kind-Only]` Returns true if the given value is TRegExp */
379
+ function IsRegExp$1(value) {
380
+ return IsKindOf$1(value, "RegExp");
381
+ }
382
+ /** `[Kind-Only]` Returns true if the given value is TString */
383
+ function IsString$1(value) {
384
+ return IsKindOf$1(value, "String");
385
+ }
386
+ /** `[Kind-Only]` Returns true if the given value is TSymbol */
387
+ function IsSymbol$1(value) {
388
+ return IsKindOf$1(value, "Symbol");
389
+ }
390
+ /** `[Kind-Only]` Returns true if the given value is TTemplateLiteral */
391
+ function IsTemplateLiteral$1(value) {
392
+ return IsKindOf$1(value, "TemplateLiteral");
393
+ }
394
+ /** `[Kind-Only]` Returns true if the given value is TThis */
395
+ function IsThis$1(value) {
396
+ return IsKindOf$1(value, "This");
397
+ }
398
+ /** `[Kind-Only]` Returns true of this value is TTransform */
399
+ function IsTransform$1(value) {
400
+ return IsObject$3(value) && TransformKind in value;
401
+ }
402
+ /** `[Kind-Only]` Returns true if the given value is TTuple */
403
+ function IsTuple$1(value) {
404
+ return IsKindOf$1(value, "Tuple");
405
+ }
406
+ /** `[Kind-Only]` Returns true if the given value is TUndefined */
407
+ function IsUndefined$1(value) {
408
+ return IsKindOf$1(value, "Undefined");
409
+ }
410
+ /** `[Kind-Only]` Returns true if the given value is TUnion */
411
+ function IsUnion$1(value) {
412
+ return IsKindOf$1(value, "Union");
413
+ }
414
+ /** `[Kind-Only]` Returns true if the given value is TUint8Array */
415
+ function IsUint8Array$1(value) {
416
+ return IsKindOf$1(value, "Uint8Array");
417
+ }
418
+ /** `[Kind-Only]` Returns true if the given value is TUnknown */
419
+ function IsUnknown$1(value) {
420
+ return IsKindOf$1(value, "Unknown");
421
+ }
422
+ /** `[Kind-Only]` Returns true if the given value is a raw TUnsafe */
423
+ function IsUnsafe$1(value) {
424
+ return IsKindOf$1(value, "Unsafe");
425
+ }
426
+ /** `[Kind-Only]` Returns true if the given value is TVoid */
427
+ function IsVoid$1(value) {
428
+ return IsKindOf$1(value, "Void");
429
+ }
430
+ /** `[Kind-Only]` Returns true if the given value is TKind */
431
+ function IsKind$1(value) {
432
+ return IsObject$3(value) && Kind in value && IsString$2(value[Kind]);
433
+ }
434
+ /** `[Kind-Only]` Returns true if the given value is TSchema */
435
+ function IsSchema$1(value) {
436
+ return IsAny$1(value) || IsArgument$1(value) || IsArray$1(value) || IsBoolean$1(value) || IsBigInt$1(value) || IsAsyncIterator$1(value) || IsComputed$1(value) || IsConstructor$1(value) || IsDate$1(value) || IsFunction$1(value) || IsInteger$1(value) || IsIntersect$1(value) || IsIterator$1(value) || IsLiteral$1(value) || IsMappedKey$1(value) || IsMappedResult$1(value) || IsNever$1(value) || IsNot$1(value) || IsNull$1(value) || IsNumber$1(value) || IsObject$1(value) || IsPromise$1(value) || IsRecord$1(value) || IsRef$1(value) || IsRegExp$1(value) || IsString$1(value) || IsSymbol$1(value) || IsTemplateLiteral$1(value) || IsThis$1(value) || IsTuple$1(value) || IsUndefined$1(value) || IsUnion$1(value) || IsUint8Array$1(value) || IsUnknown$1(value) || IsUnsafe$1(value) || IsVoid$1(value) || IsKind$1(value);
437
+ }
438
+ //#endregion
439
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/guard/type.mjs
440
+ const KnownTypes = [
441
+ "Argument",
442
+ "Any",
443
+ "Array",
444
+ "AsyncIterator",
445
+ "BigInt",
446
+ "Boolean",
447
+ "Computed",
448
+ "Constructor",
449
+ "Date",
450
+ "Enum",
451
+ "Function",
452
+ "Integer",
453
+ "Intersect",
454
+ "Iterator",
455
+ "Literal",
456
+ "MappedKey",
457
+ "MappedResult",
458
+ "Not",
459
+ "Null",
460
+ "Number",
461
+ "Object",
462
+ "Promise",
463
+ "Record",
464
+ "Ref",
465
+ "RegExp",
466
+ "String",
467
+ "Symbol",
468
+ "TemplateLiteral",
469
+ "This",
470
+ "Tuple",
471
+ "Undefined",
472
+ "Union",
473
+ "Uint8Array",
474
+ "Unknown",
475
+ "Void"
476
+ ];
477
+ function IsPattern(value) {
478
+ try {
479
+ new RegExp(value);
480
+ return true;
481
+ } catch {
482
+ return false;
483
+ }
484
+ }
485
+ function IsControlCharacterFree(value) {
486
+ if (!IsString$2(value)) return false;
487
+ for (let i = 0; i < value.length; i++) {
488
+ const code = value.charCodeAt(i);
489
+ if (code >= 7 && code <= 13 || code === 27 || code === 127) return false;
490
+ }
491
+ return true;
492
+ }
493
+ function IsAdditionalProperties(value) {
494
+ return IsOptionalBoolean(value) || IsSchema(value);
495
+ }
496
+ function IsOptionalBigInt(value) {
497
+ return IsUndefined$3(value) || IsBigInt$2(value);
498
+ }
499
+ function IsOptionalNumber(value) {
500
+ return IsUndefined$3(value) || IsNumber$3(value);
501
+ }
502
+ function IsOptionalBoolean(value) {
503
+ return IsUndefined$3(value) || IsBoolean$2(value);
504
+ }
505
+ function IsOptionalString(value) {
506
+ return IsUndefined$3(value) || IsString$2(value);
507
+ }
508
+ function IsOptionalPattern(value) {
509
+ return IsUndefined$3(value) || IsString$2(value) && IsControlCharacterFree(value) && IsPattern(value);
510
+ }
511
+ function IsOptionalFormat(value) {
512
+ return IsUndefined$3(value) || IsString$2(value) && IsControlCharacterFree(value);
513
+ }
514
+ function IsOptionalSchema(value) {
515
+ return IsUndefined$3(value) || IsSchema(value);
516
+ }
517
+ /** Returns true if this value has a Optional symbol */
518
+ function IsOptional(value) {
519
+ return IsObject$3(value) && value[OptionalKind] === "Optional";
520
+ }
521
+ /** Returns true if the given value is TAny */
522
+ function IsAny(value) {
523
+ return IsKindOf(value, "Any") && IsOptionalString(value.$id);
524
+ }
525
+ /** Returns true if the given value is TArgument */
526
+ function IsArgument(value) {
527
+ return IsKindOf(value, "Argument") && IsNumber$3(value.index);
528
+ }
529
+ /** Returns true if the given value is TArray */
530
+ function IsArray(value) {
531
+ return IsKindOf(value, "Array") && value.type === "array" && IsOptionalString(value.$id) && IsSchema(value.items) && IsOptionalNumber(value.minItems) && IsOptionalNumber(value.maxItems) && IsOptionalBoolean(value.uniqueItems) && IsOptionalSchema(value.contains) && IsOptionalNumber(value.minContains) && IsOptionalNumber(value.maxContains);
532
+ }
533
+ /** Returns true if the given value is TAsyncIterator */
534
+ function IsAsyncIterator(value) {
535
+ return IsKindOf(value, "AsyncIterator") && value.type === "AsyncIterator" && IsOptionalString(value.$id) && IsSchema(value.items);
536
+ }
537
+ /** Returns true if the given value is TBigInt */
538
+ function IsBigInt(value) {
539
+ return IsKindOf(value, "BigInt") && value.type === "bigint" && IsOptionalString(value.$id) && IsOptionalBigInt(value.exclusiveMaximum) && IsOptionalBigInt(value.exclusiveMinimum) && IsOptionalBigInt(value.maximum) && IsOptionalBigInt(value.minimum) && IsOptionalBigInt(value.multipleOf);
540
+ }
541
+ /** Returns true if the given value is TBoolean */
542
+ function IsBoolean(value) {
543
+ return IsKindOf(value, "Boolean") && value.type === "boolean" && IsOptionalString(value.$id);
544
+ }
545
+ /** Returns true if the given value is TComputed */
546
+ function IsComputed(value) {
547
+ return IsKindOf(value, "Computed") && IsString$2(value.target) && IsArray$3(value.parameters) && value.parameters.every((schema) => IsSchema(schema));
548
+ }
549
+ /** Returns true if the given value is TConstructor */
550
+ function IsConstructor(value) {
551
+ return IsKindOf(value, "Constructor") && value.type === "Constructor" && IsOptionalString(value.$id) && IsArray$3(value.parameters) && value.parameters.every((schema) => IsSchema(schema)) && IsSchema(value.returns);
552
+ }
553
+ /** Returns true if the given value is TDate */
554
+ function IsDate(value) {
555
+ return IsKindOf(value, "Date") && value.type === "Date" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximumTimestamp) && IsOptionalNumber(value.exclusiveMinimumTimestamp) && IsOptionalNumber(value.maximumTimestamp) && IsOptionalNumber(value.minimumTimestamp) && IsOptionalNumber(value.multipleOfTimestamp);
556
+ }
557
+ /** Returns true if the given value is TFunction */
558
+ function IsFunction(value) {
559
+ return IsKindOf(value, "Function") && value.type === "Function" && IsOptionalString(value.$id) && IsArray$3(value.parameters) && value.parameters.every((schema) => IsSchema(schema)) && IsSchema(value.returns);
560
+ }
561
+ /** Returns true if the given value is TInteger */
562
+ function IsInteger(value) {
563
+ return IsKindOf(value, "Integer") && value.type === "integer" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
564
+ }
565
+ /** Returns true if the given schema is TProperties */
566
+ function IsProperties(value) {
567
+ return IsObject$3(value) && Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema(schema));
568
+ }
569
+ /** Returns true if the given value is TIntersect */
570
+ function IsIntersect(value) {
571
+ return IsKindOf(value, "Intersect") && (IsString$2(value.type) && value.type !== "object" ? false : true) && IsArray$3(value.allOf) && value.allOf.every((schema) => IsSchema(schema) && !IsTransform(schema)) && IsOptionalString(value.type) && (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && IsOptionalString(value.$id);
572
+ }
573
+ /** Returns true if the given value is TIterator */
574
+ function IsIterator(value) {
575
+ return IsKindOf(value, "Iterator") && value.type === "Iterator" && IsOptionalString(value.$id) && IsSchema(value.items);
576
+ }
577
+ /** Returns true if the given value is a TKind with the given name. */
578
+ function IsKindOf(value, kind) {
579
+ return IsObject$3(value) && Kind in value && value[Kind] === kind;
580
+ }
581
+ /** Returns true if the given value is TLiteral<string> */
582
+ function IsLiteralString(value) {
583
+ return IsLiteral(value) && IsString$2(value.const);
584
+ }
585
+ /** Returns true if the given value is TLiteral<number> */
586
+ function IsLiteralNumber(value) {
587
+ return IsLiteral(value) && IsNumber$3(value.const);
588
+ }
589
+ /** Returns true if the given value is TLiteral<boolean> */
590
+ function IsLiteralBoolean(value) {
591
+ return IsLiteral(value) && IsBoolean$2(value.const);
592
+ }
593
+ /** Returns true if the given value is TLiteral */
594
+ function IsLiteral(value) {
595
+ return IsKindOf(value, "Literal") && IsOptionalString(value.$id) && IsLiteralValue(value.const);
596
+ }
597
+ /** Returns true if the given value is a TLiteralValue */
598
+ function IsLiteralValue(value) {
599
+ return IsBoolean$2(value) || IsNumber$3(value) || IsString$2(value);
600
+ }
601
+ /** Returns true if the given value is a TMappedKey */
602
+ function IsMappedKey(value) {
603
+ return IsKindOf(value, "MappedKey") && IsArray$3(value.keys) && value.keys.every((key) => IsNumber$3(key) || IsString$2(key));
604
+ }
605
+ /** Returns true if the given value is TMappedResult */
606
+ function IsMappedResult(value) {
607
+ return IsKindOf(value, "MappedResult") && IsProperties(value.properties);
608
+ }
609
+ /** Returns true if the given value is TNever */
610
+ function IsNever(value) {
611
+ return IsKindOf(value, "Never") && IsObject$3(value.not) && Object.getOwnPropertyNames(value.not).length === 0;
612
+ }
613
+ /** Returns true if the given value is TNot */
614
+ function IsNot(value) {
615
+ return IsKindOf(value, "Not") && IsSchema(value.not);
616
+ }
617
+ /** Returns true if the given value is TNull */
618
+ function IsNull(value) {
619
+ return IsKindOf(value, "Null") && value.type === "null" && IsOptionalString(value.$id);
620
+ }
621
+ /** Returns true if the given value is TNumber */
622
+ function IsNumber(value) {
623
+ return IsKindOf(value, "Number") && value.type === "number" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
624
+ }
625
+ /** Returns true if the given value is TObject */
626
+ function IsObject(value) {
627
+ return IsKindOf(value, "Object") && value.type === "object" && IsOptionalString(value.$id) && IsProperties(value.properties) && IsAdditionalProperties(value.additionalProperties) && IsOptionalNumber(value.minProperties) && IsOptionalNumber(value.maxProperties);
628
+ }
629
+ /** Returns true if the given value is TPromise */
630
+ function IsPromise(value) {
631
+ return IsKindOf(value, "Promise") && value.type === "Promise" && IsOptionalString(value.$id) && IsSchema(value.item);
632
+ }
633
+ /** Returns true if the given value is TRecord */
634
+ function IsRecord(value) {
635
+ return IsKindOf(value, "Record") && value.type === "object" && IsOptionalString(value.$id) && IsAdditionalProperties(value.additionalProperties) && IsObject$3(value.patternProperties) && ((schema) => {
636
+ const keys = Object.getOwnPropertyNames(schema.patternProperties);
637
+ return keys.length === 1 && IsPattern(keys[0]) && IsObject$3(schema.patternProperties) && IsSchema(schema.patternProperties[keys[0]]);
638
+ })(value);
639
+ }
640
+ /** Returns true if the given value is TRef */
641
+ function IsRef(value) {
642
+ return IsKindOf(value, "Ref") && IsOptionalString(value.$id) && IsString$2(value.$ref);
643
+ }
644
+ /** Returns true if the given value is TRegExp */
645
+ function IsRegExp(value) {
646
+ return IsKindOf(value, "RegExp") && IsOptionalString(value.$id) && IsString$2(value.source) && IsString$2(value.flags) && IsOptionalNumber(value.maxLength) && IsOptionalNumber(value.minLength);
647
+ }
648
+ /** Returns true if the given value is TString */
649
+ function IsString(value) {
650
+ return IsKindOf(value, "String") && value.type === "string" && IsOptionalString(value.$id) && IsOptionalNumber(value.minLength) && IsOptionalNumber(value.maxLength) && IsOptionalPattern(value.pattern) && IsOptionalFormat(value.format);
651
+ }
652
+ /** Returns true if the given value is TSymbol */
653
+ function IsSymbol(value) {
654
+ return IsKindOf(value, "Symbol") && value.type === "symbol" && IsOptionalString(value.$id);
655
+ }
656
+ /** Returns true if the given value is TTemplateLiteral */
657
+ function IsTemplateLiteral(value) {
658
+ return IsKindOf(value, "TemplateLiteral") && value.type === "string" && IsString$2(value.pattern) && value.pattern[0] === "^" && value.pattern[value.pattern.length - 1] === "$";
659
+ }
660
+ /** Returns true if the given value is TThis */
661
+ function IsThis(value) {
662
+ return IsKindOf(value, "This") && IsOptionalString(value.$id) && IsString$2(value.$ref);
663
+ }
664
+ /** Returns true of this value is TTransform */
665
+ function IsTransform(value) {
666
+ return IsObject$3(value) && TransformKind in value;
667
+ }
668
+ /** Returns true if the given value is TTuple */
669
+ function IsTuple(value) {
670
+ return IsKindOf(value, "Tuple") && value.type === "array" && IsOptionalString(value.$id) && IsNumber$3(value.minItems) && IsNumber$3(value.maxItems) && value.minItems === value.maxItems && (IsUndefined$3(value.items) && IsUndefined$3(value.additionalItems) && value.minItems === 0 || IsArray$3(value.items) && value.items.every((schema) => IsSchema(schema)));
671
+ }
672
+ /** Returns true if the given value is TUndefined */
673
+ function IsUndefined(value) {
674
+ return IsKindOf(value, "Undefined") && value.type === "undefined" && IsOptionalString(value.$id);
675
+ }
676
+ /** Returns true if the given value is TUnion */
677
+ function IsUnion(value) {
678
+ return IsKindOf(value, "Union") && IsOptionalString(value.$id) && IsObject$3(value) && IsArray$3(value.anyOf) && value.anyOf.every((schema) => IsSchema(schema));
679
+ }
680
+ /** Returns true if the given value is TUint8Array */
681
+ function IsUint8Array(value) {
682
+ return IsKindOf(value, "Uint8Array") && value.type === "Uint8Array" && IsOptionalString(value.$id) && IsOptionalNumber(value.minByteLength) && IsOptionalNumber(value.maxByteLength);
683
+ }
684
+ /** Returns true if the given value is TUnknown */
685
+ function IsUnknown(value) {
686
+ return IsKindOf(value, "Unknown") && IsOptionalString(value.$id);
687
+ }
688
+ /** Returns true if the given value is a raw TUnsafe */
689
+ function IsUnsafe(value) {
690
+ return IsKindOf(value, "Unsafe");
691
+ }
692
+ /** Returns true if the given value is TVoid */
693
+ function IsVoid(value) {
694
+ return IsKindOf(value, "Void") && value.type === "void" && IsOptionalString(value.$id);
695
+ }
696
+ /** Returns true if the given value is TKind */
697
+ function IsKind(value) {
698
+ return IsObject$3(value) && Kind in value && IsString$2(value[Kind]) && !KnownTypes.includes(value[Kind]);
699
+ }
700
+ /** Returns true if the given value is TSchema */
701
+ function IsSchema(value) {
702
+ return IsObject$3(value) && (IsAny(value) || IsArgument(value) || IsArray(value) || IsBoolean(value) || IsBigInt(value) || IsAsyncIterator(value) || IsComputed(value) || IsConstructor(value) || IsDate(value) || IsFunction(value) || IsInteger(value) || IsIntersect(value) || IsIterator(value) || IsLiteral(value) || IsMappedKey(value) || IsMappedResult(value) || IsNever(value) || IsNot(value) || IsNull(value) || IsNumber(value) || IsObject(value) || IsPromise(value) || IsRecord(value) || IsRef(value) || IsRegExp(value) || IsString(value) || IsSymbol(value) || IsTemplateLiteral(value) || IsThis(value) || IsTuple(value) || IsUndefined(value) || IsUnion(value) || IsUint8Array(value) || IsUnknown(value) || IsUnsafe(value) || IsVoid(value) || IsKind(value));
703
+ }
704
+ //#endregion
705
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.mjs
706
+ const PatternBoolean = "(true|false)";
707
+ const PatternNumber = "(0|[1-9][0-9]*)";
708
+ const PatternString = "(.*)";
709
+ const PatternNever = "(?!.*)";
710
+ `${PatternBoolean}`;
711
+ const PatternNumberExact = `^${PatternNumber}$`;
712
+ const PatternStringExact = `^${PatternString}$`;
713
+ const PatternNeverExact = `^${PatternNever}$`;
714
+ //#endregion
715
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/sets/set.mjs
716
+ /** Returns true if element right is in the set of left */
717
+ function SetIncludes(T, S) {
718
+ return T.includes(S);
719
+ }
720
+ /** Returns a distinct set of elements */
721
+ function SetDistinct(T) {
722
+ return [...new Set(T)];
723
+ }
724
+ /** Returns the Intersect of the given sets */
725
+ function SetIntersect(T, S) {
726
+ return T.filter((L) => S.includes(L));
727
+ }
728
+ function SetIntersectManyResolve(T, Init) {
729
+ return T.reduce((Acc, L) => {
730
+ return SetIntersect(Acc, L);
731
+ }, Init);
732
+ }
733
+ function SetIntersectMany(T) {
734
+ return T.length === 1 ? T[0] : T.length > 1 ? SetIntersectManyResolve(T.slice(1), T[0]) : [];
735
+ }
736
+ /** Returns the Union of multiple sets */
737
+ function SetUnionMany(T) {
738
+ const Acc = [];
739
+ for (const L of T) Acc.push(...L);
740
+ return Acc;
741
+ }
742
+ //#endregion
743
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/any/any.mjs
744
+ /** `[Json]` Creates an Any type */
745
+ function Any(options) {
746
+ return CreateType({ [Kind]: "Any" }, options);
747
+ }
748
+ //#endregion
749
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/array/array.mjs
750
+ /** `[Json]` Creates an Array type */
751
+ function Array$1(items, options) {
752
+ return CreateType({
753
+ [Kind]: "Array",
754
+ type: "array",
755
+ items
756
+ }, options);
757
+ }
758
+ //#endregion
759
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/argument/argument.mjs
760
+ /** `[JavaScript]` Creates an Argument Type. */
761
+ function Argument(index) {
762
+ return CreateType({
763
+ [Kind]: "Argument",
764
+ index
765
+ });
766
+ }
767
+ //#endregion
768
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.mjs
769
+ /** `[JavaScript]` Creates a AsyncIterator type */
770
+ function AsyncIterator(items, options) {
771
+ return CreateType({
772
+ [Kind]: "AsyncIterator",
773
+ type: "AsyncIterator",
774
+ items
775
+ }, options);
776
+ }
777
+ //#endregion
778
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/computed/computed.mjs
779
+ /** `[Internal]` Creates a deferred computed type. This type is used exclusively in modules to defer resolution of computable types that contain interior references */
780
+ function Computed(target, parameters, options) {
781
+ return CreateType({
782
+ [Kind]: "Computed",
783
+ target,
784
+ parameters
785
+ }, options);
786
+ }
787
+ //#endregion
788
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
789
+ function DiscardKey(value, key) {
790
+ const { [key]: _, ...rest } = value;
791
+ return rest;
792
+ }
793
+ /** Discards property keys from the given value. This function returns a shallow Clone. */
794
+ function Discard(value, keys) {
795
+ return keys.reduce((acc, key) => DiscardKey(acc, key), value);
796
+ }
797
+ //#endregion
798
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
799
+ /** `[Json]` Creates a Never type */
800
+ function Never(options) {
801
+ return CreateType({
802
+ [Kind]: "Never",
803
+ not: {}
804
+ }, options);
805
+ }
806
+ //#endregion
807
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.mjs
808
+ function MappedResult(properties) {
809
+ return CreateType({
810
+ [Kind]: "MappedResult",
811
+ properties
812
+ });
813
+ }
814
+ //#endregion
815
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.mjs
816
+ /** `[JavaScript]` Creates a Constructor type */
817
+ function Constructor(parameters, returns, options) {
818
+ return CreateType({
819
+ [Kind]: "Constructor",
820
+ type: "Constructor",
821
+ parameters,
822
+ returns
823
+ }, options);
824
+ }
825
+ //#endregion
826
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/function/function.mjs
827
+ /** `[JavaScript]` Creates a Function type */
828
+ function Function(parameters, returns, options) {
829
+ return CreateType({
830
+ [Kind]: "Function",
831
+ type: "Function",
832
+ parameters,
833
+ returns
834
+ }, options);
835
+ }
836
+ //#endregion
837
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/union/union-create.mjs
838
+ function UnionCreate(T, options) {
839
+ return CreateType({
840
+ [Kind]: "Union",
841
+ anyOf: T
842
+ }, options);
843
+ }
844
+ //#endregion
845
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.mjs
846
+ function IsUnionOptional(types) {
847
+ return types.some((type) => IsOptional$1(type));
848
+ }
849
+ function RemoveOptionalFromRest$1(types) {
850
+ return types.map((left) => IsOptional$1(left) ? RemoveOptionalFromType$1(left) : left);
851
+ }
852
+ function RemoveOptionalFromType$1(T) {
853
+ return Discard(T, [OptionalKind]);
854
+ }
855
+ function ResolveUnion(types, options) {
856
+ return IsUnionOptional(types) ? Optional(UnionCreate(RemoveOptionalFromRest$1(types), options)) : UnionCreate(RemoveOptionalFromRest$1(types), options);
857
+ }
858
+ /** `[Json]` Creates an evaluated Union type */
859
+ function UnionEvaluated(T, options) {
860
+ return T.length === 1 ? CreateType(T[0], options) : T.length === 0 ? Never(options) : ResolveUnion(T, options);
861
+ }
862
+ //#endregion
863
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/union/union.mjs
864
+ /** `[Json]` Creates a Union type */
865
+ function Union(types, options) {
866
+ return types.length === 0 ? Never(options) : types.length === 1 ? CreateType(types[0], options) : UnionCreate(types, options);
867
+ }
868
+ //#endregion
869
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.mjs
870
+ var TemplateLiteralParserError = class extends TypeBoxError {};
871
+ function Unescape(pattern) {
872
+ return pattern.replace(/\\\$/g, "$").replace(/\\\*/g, "*").replace(/\\\^/g, "^").replace(/\\\|/g, "|").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
873
+ }
874
+ function IsNonEscaped(pattern, index, char) {
875
+ return pattern[index] === char && pattern.charCodeAt(index - 1) !== 92;
876
+ }
877
+ function IsOpenParen(pattern, index) {
878
+ return IsNonEscaped(pattern, index, "(");
879
+ }
880
+ function IsCloseParen(pattern, index) {
881
+ return IsNonEscaped(pattern, index, ")");
882
+ }
883
+ function IsSeparator(pattern, index) {
884
+ return IsNonEscaped(pattern, index, "|");
885
+ }
886
+ function IsGroup(pattern) {
887
+ if (!(IsOpenParen(pattern, 0) && IsCloseParen(pattern, pattern.length - 1))) return false;
888
+ let count = 0;
889
+ for (let index = 0; index < pattern.length; index++) {
890
+ if (IsOpenParen(pattern, index)) count += 1;
891
+ if (IsCloseParen(pattern, index)) count -= 1;
892
+ if (count === 0 && index !== pattern.length - 1) return false;
893
+ }
894
+ return true;
895
+ }
896
+ function InGroup(pattern) {
897
+ return pattern.slice(1, pattern.length - 1);
898
+ }
899
+ function IsPrecedenceOr(pattern) {
900
+ let count = 0;
901
+ for (let index = 0; index < pattern.length; index++) {
902
+ if (IsOpenParen(pattern, index)) count += 1;
903
+ if (IsCloseParen(pattern, index)) count -= 1;
904
+ if (IsSeparator(pattern, index) && count === 0) return true;
905
+ }
906
+ return false;
907
+ }
908
+ function IsPrecedenceAnd(pattern) {
909
+ for (let index = 0; index < pattern.length; index++) if (IsOpenParen(pattern, index)) return true;
910
+ return false;
911
+ }
912
+ function Or(pattern) {
913
+ let [count, start] = [0, 0];
914
+ const expressions = [];
915
+ for (let index = 0; index < pattern.length; index++) {
916
+ if (IsOpenParen(pattern, index)) count += 1;
917
+ if (IsCloseParen(pattern, index)) count -= 1;
918
+ if (IsSeparator(pattern, index) && count === 0) {
919
+ const range = pattern.slice(start, index);
920
+ if (range.length > 0) expressions.push(TemplateLiteralParse(range));
921
+ start = index + 1;
922
+ }
923
+ }
924
+ const range = pattern.slice(start);
925
+ if (range.length > 0) expressions.push(TemplateLiteralParse(range));
926
+ if (expressions.length === 0) return {
927
+ type: "const",
928
+ const: ""
929
+ };
930
+ if (expressions.length === 1) return expressions[0];
931
+ return {
932
+ type: "or",
933
+ expr: expressions
934
+ };
935
+ }
936
+ function And(pattern) {
937
+ function Group(value, index) {
938
+ if (!IsOpenParen(value, index)) throw new TemplateLiteralParserError(`TemplateLiteralParser: Index must point to open parens`);
939
+ let count = 0;
940
+ for (let scan = index; scan < value.length; scan++) {
941
+ if (IsOpenParen(value, scan)) count += 1;
942
+ if (IsCloseParen(value, scan)) count -= 1;
943
+ if (count === 0) return [index, scan];
944
+ }
945
+ throw new TemplateLiteralParserError(`TemplateLiteralParser: Unclosed group parens in expression`);
946
+ }
947
+ function Range(pattern, index) {
948
+ for (let scan = index; scan < pattern.length; scan++) if (IsOpenParen(pattern, scan)) return [index, scan];
949
+ return [index, pattern.length];
950
+ }
951
+ const expressions = [];
952
+ for (let index = 0; index < pattern.length; index++) if (IsOpenParen(pattern, index)) {
953
+ const [start, end] = Group(pattern, index);
954
+ const range = pattern.slice(start, end + 1);
955
+ expressions.push(TemplateLiteralParse(range));
956
+ index = end;
957
+ } else {
958
+ const [start, end] = Range(pattern, index);
959
+ const range = pattern.slice(start, end);
960
+ if (range.length > 0) expressions.push(TemplateLiteralParse(range));
961
+ index = end - 1;
962
+ }
963
+ return expressions.length === 0 ? {
964
+ type: "const",
965
+ const: ""
966
+ } : expressions.length === 1 ? expressions[0] : {
967
+ type: "and",
968
+ expr: expressions
969
+ };
970
+ }
971
+ /** Parses a pattern and returns an expression tree */
972
+ function TemplateLiteralParse(pattern) {
973
+ return IsGroup(pattern) ? TemplateLiteralParse(InGroup(pattern)) : IsPrecedenceOr(pattern) ? Or(pattern) : IsPrecedenceAnd(pattern) ? And(pattern) : {
974
+ type: "const",
975
+ const: Unescape(pattern)
976
+ };
977
+ }
978
+ /** Parses a pattern and strips forward and trailing ^ and $ */
979
+ function TemplateLiteralParseExact(pattern) {
980
+ return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));
981
+ }
982
+ //#endregion
983
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.mjs
984
+ var TemplateLiteralFiniteError = class extends TypeBoxError {};
985
+ function IsNumberExpression(expression) {
986
+ 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]*";
987
+ }
988
+ function IsBooleanExpression(expression) {
989
+ 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";
990
+ }
991
+ function IsStringExpression(expression) {
992
+ return expression.type === "const" && expression.const === ".*";
993
+ }
994
+ function IsTemplateLiteralExpressionFinite(expression) {
995
+ 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 : (() => {
996
+ throw new TemplateLiteralFiniteError(`Unknown expression type`);
997
+ })();
998
+ }
999
+ /** Returns true if this TemplateLiteral resolves to a finite set of values */
1000
+ function IsTemplateLiteralFinite(schema) {
1001
+ return IsTemplateLiteralExpressionFinite(TemplateLiteralParseExact(schema.pattern));
1002
+ }
1003
+ //#endregion
1004
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.mjs
1005
+ var TemplateLiteralGenerateError = class extends TypeBoxError {};
1006
+ function* GenerateReduce(buffer) {
1007
+ if (buffer.length === 1) return yield* buffer[0];
1008
+ for (const left of buffer[0]) for (const right of GenerateReduce(buffer.slice(1))) yield `${left}${right}`;
1009
+ }
1010
+ function* GenerateAnd(expression) {
1011
+ return yield* GenerateReduce(expression.expr.map((expr) => [...TemplateLiteralExpressionGenerate(expr)]));
1012
+ }
1013
+ function* GenerateOr(expression) {
1014
+ for (const expr of expression.expr) yield* TemplateLiteralExpressionGenerate(expr);
1015
+ }
1016
+ function* GenerateConst(expression) {
1017
+ return yield expression.const;
1018
+ }
1019
+ function* TemplateLiteralExpressionGenerate(expression) {
1020
+ return expression.type === "and" ? yield* GenerateAnd(expression) : expression.type === "or" ? yield* GenerateOr(expression) : expression.type === "const" ? yield* GenerateConst(expression) : (() => {
1021
+ throw new TemplateLiteralGenerateError("Unknown expression");
1022
+ })();
1023
+ }
1024
+ /** Generates a tuple of strings from the given TemplateLiteral. Returns an empty tuple if infinite. */
1025
+ function TemplateLiteralGenerate(schema) {
1026
+ const expression = TemplateLiteralParseExact(schema.pattern);
1027
+ return IsTemplateLiteralExpressionFinite(expression) ? [...TemplateLiteralExpressionGenerate(expression)] : [];
1028
+ }
1029
+ //#endregion
1030
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/literal/literal.mjs
1031
+ /** `[Json]` Creates a Literal type */
1032
+ function Literal(value, options) {
1033
+ return CreateType({
1034
+ [Kind]: "Literal",
1035
+ const: value,
1036
+ type: typeof value
1037
+ }, options);
1038
+ }
1039
+ //#endregion
1040
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.mjs
1041
+ /** `[Json]` Creates a Boolean type */
1042
+ function Boolean(options) {
1043
+ return CreateType({
1044
+ [Kind]: "Boolean",
1045
+ type: "boolean"
1046
+ }, options);
1047
+ }
1048
+ //#endregion
1049
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.mjs
1050
+ /** `[JavaScript]` Creates a BigInt type */
1051
+ function BigInt(options) {
1052
+ return CreateType({
1053
+ [Kind]: "BigInt",
1054
+ type: "bigint"
1055
+ }, options);
1056
+ }
1057
+ //#endregion
1058
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/number/number.mjs
1059
+ /** `[Json]` Creates a Number type */
1060
+ function Number$1(options) {
1061
+ return CreateType({
1062
+ [Kind]: "Number",
1063
+ type: "number"
1064
+ }, options);
1065
+ }
1066
+ //#endregion
1067
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/string/string.mjs
1068
+ /** `[Json]` Creates a String type */
1069
+ function String$1(options) {
1070
+ return CreateType({
1071
+ [Kind]: "String",
1072
+ type: "string"
1073
+ }, options);
1074
+ }
1075
+ //#endregion
1076
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.mjs
1077
+ function* FromUnion$9(syntax) {
1078
+ const trim = syntax.trim().replace(/"|'/g, "");
1079
+ return trim === "boolean" ? yield Boolean() : trim === "number" ? yield Number$1() : trim === "bigint" ? yield BigInt() : trim === "string" ? yield String$1() : yield (() => {
1080
+ const literals = trim.split("|").map((literal) => Literal(literal.trim()));
1081
+ return literals.length === 0 ? Never() : literals.length === 1 ? literals[0] : UnionEvaluated(literals);
1082
+ })();
1083
+ }
1084
+ function* FromTerminal(syntax) {
1085
+ if (syntax[1] !== "{") return yield* [Literal("$"), ...FromSyntax(syntax.slice(1))];
1086
+ for (let i = 2; i < syntax.length; i++) if (syntax[i] === "}") {
1087
+ const L = FromUnion$9(syntax.slice(2, i));
1088
+ const R = FromSyntax(syntax.slice(i + 1));
1089
+ return yield* [...L, ...R];
1090
+ }
1091
+ yield Literal(syntax);
1092
+ }
1093
+ function* FromSyntax(syntax) {
1094
+ for (let i = 0; i < syntax.length; i++) if (syntax[i] === "$") return yield* [Literal(syntax.slice(0, i)), ...FromTerminal(syntax.slice(i))];
1095
+ yield Literal(syntax);
1096
+ }
1097
+ /** Parses TemplateLiteralSyntax and returns a tuple of TemplateLiteralKinds */
1098
+ function TemplateLiteralSyntax(syntax) {
1099
+ return [...FromSyntax(syntax)];
1100
+ }
1101
+ //#endregion
1102
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.mjs
1103
+ var TemplateLiteralPatternError = class extends TypeBoxError {};
1104
+ function Escape(value) {
1105
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1106
+ }
1107
+ function Visit$1(schema, acc) {
1108
+ return IsTemplateLiteral$1(schema) ? schema.pattern.slice(1, schema.pattern.length - 1) : IsUnion$1(schema) ? `(${schema.anyOf.map((schema) => Visit$1(schema, acc)).join("|")})` : IsNumber$1(schema) ? `${acc}${PatternNumber}` : IsInteger$1(schema) ? `${acc}${PatternNumber}` : IsBigInt$1(schema) ? `${acc}${PatternNumber}` : IsString$1(schema) ? `${acc}${PatternString}` : IsLiteral$1(schema) ? `${acc}${Escape(schema.const.toString())}` : IsBoolean$1(schema) ? `${acc}${PatternBoolean}` : (() => {
1109
+ throw new TemplateLiteralPatternError(`Unexpected Kind '${schema[Kind]}'`);
1110
+ })();
1111
+ }
1112
+ function TemplateLiteralPattern(kinds) {
1113
+ return `^${kinds.map((schema) => Visit$1(schema, "")).join("")}\$`;
1114
+ }
1115
+ //#endregion
1116
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.mjs
1117
+ /** Returns a Union from the given TemplateLiteral */
1118
+ function TemplateLiteralToUnion(schema) {
1119
+ return UnionEvaluated(TemplateLiteralGenerate(schema).map((S) => Literal(S)));
1120
+ }
1121
+ //#endregion
1122
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.mjs
1123
+ /** `[Json]` Creates a TemplateLiteral type */
1124
+ function TemplateLiteral(unresolved, options) {
1125
+ const pattern = IsString$2(unresolved) ? TemplateLiteralPattern(TemplateLiteralSyntax(unresolved)) : TemplateLiteralPattern(unresolved);
1126
+ return CreateType({
1127
+ [Kind]: "TemplateLiteral",
1128
+ type: "string",
1129
+ pattern
1130
+ }, options);
1131
+ }
1132
+ //#endregion
1133
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
1134
+ function FromTemplateLiteral$2(templateLiteral) {
1135
+ return TemplateLiteralGenerate(templateLiteral).map((key) => key.toString());
1136
+ }
1137
+ function FromUnion$8(types) {
1138
+ const result = [];
1139
+ for (const type of types) result.push(...IndexPropertyKeys(type));
1140
+ return result;
1141
+ }
1142
+ function FromLiteral$1(literalValue) {
1143
+ return [literalValue.toString()];
1144
+ }
1145
+ /** Returns a tuple of PropertyKeys derived from the given TSchema */
1146
+ function IndexPropertyKeys(type) {
1147
+ return [...new Set(IsTemplateLiteral$1(type) ? FromTemplateLiteral$2(type) : IsUnion$1(type) ? FromUnion$8(type.anyOf) : IsLiteral$1(type) ? FromLiteral$1(type.const) : IsNumber$1(type) ? ["[number]"] : IsInteger$1(type) ? ["[number]"] : [])];
1148
+ }
1149
+ //#endregion
1150
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.mjs
1151
+ function FromProperties$18(type, properties, options) {
1152
+ const result = {};
1153
+ for (const K2 of Object.getOwnPropertyNames(properties)) result[K2] = Index(type, IndexPropertyKeys(properties[K2]), options);
1154
+ return result;
1155
+ }
1156
+ function FromMappedResult$11(type, mappedResult, options) {
1157
+ return FromProperties$18(type, mappedResult.properties, options);
1158
+ }
1159
+ function IndexFromMappedResult(type, mappedResult, options) {
1160
+ return MappedResult(FromMappedResult$11(type, mappedResult, options));
1161
+ }
1162
+ //#endregion
1163
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
1164
+ function FromRest$6(types, key) {
1165
+ return types.map((type) => IndexFromPropertyKey(type, key));
1166
+ }
1167
+ function FromIntersectRest(types) {
1168
+ return types.filter((type) => !IsNever$1(type));
1169
+ }
1170
+ function FromIntersect$7(types, key) {
1171
+ return IntersectEvaluated(FromIntersectRest(FromRest$6(types, key)));
1172
+ }
1173
+ function FromUnionRest(types) {
1174
+ return types.some((L) => IsNever$1(L)) ? [] : types;
1175
+ }
1176
+ function FromUnion$7(types, key) {
1177
+ return UnionEvaluated(FromUnionRest(FromRest$6(types, key)));
1178
+ }
1179
+ function FromTuple$4(types, key) {
1180
+ return key in types ? types[key] : key === "[number]" ? UnionEvaluated(types) : Never();
1181
+ }
1182
+ function FromArray$5(type, key) {
1183
+ return key === "[number]" ? type : Never();
1184
+ }
1185
+ function FromProperty$2(properties, propertyKey) {
1186
+ return propertyKey in properties ? properties[propertyKey] : Never();
1187
+ }
1188
+ function IndexFromPropertyKey(type, propertyKey) {
1189
+ return IsIntersect$1(type) ? FromIntersect$7(type.allOf, propertyKey) : IsUnion$1(type) ? FromUnion$7(type.anyOf, propertyKey) : IsTuple$1(type) ? FromTuple$4(type.items ?? [], propertyKey) : IsArray$1(type) ? FromArray$5(type.items, propertyKey) : IsObject$1(type) ? FromProperty$2(type.properties, propertyKey) : Never();
1190
+ }
1191
+ function IndexFromPropertyKeys(type, propertyKeys) {
1192
+ return propertyKeys.map((propertyKey) => IndexFromPropertyKey(type, propertyKey));
1193
+ }
1194
+ function FromSchema(type, propertyKeys) {
1195
+ return UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys));
1196
+ }
1197
+ /** `[Json]` Returns an Indexed property type for the given keys */
1198
+ function Index(type, key, options) {
1199
+ if (IsRef$1(type) || IsRef$1(key)) {
1200
+ const error = `Index types using Ref parameters require both Type and Key to be of TSchema`;
1201
+ if (!IsSchema$1(type) || !IsSchema$1(key)) throw new TypeBoxError(error);
1202
+ return Computed("Index", [type, key]);
1203
+ }
1204
+ if (IsMappedResult$1(key)) return IndexFromMappedResult(type, key, options);
1205
+ if (IsMappedKey$1(key)) return IndexFromMappedKey(type, key, options);
1206
+ return CreateType(IsSchema$1(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
1207
+ }
1208
+ //#endregion
1209
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
1210
+ function MappedIndexPropertyKey(type, key, options) {
1211
+ return { [key]: Index(type, [key], Clone(options)) };
1212
+ }
1213
+ function MappedIndexPropertyKeys(type, propertyKeys, options) {
1214
+ return propertyKeys.reduce((result, left) => {
1215
+ return {
1216
+ ...result,
1217
+ ...MappedIndexPropertyKey(type, left, options)
1218
+ };
1219
+ }, {});
1220
+ }
1221
+ function MappedIndexProperties(type, mappedKey, options) {
1222
+ return MappedIndexPropertyKeys(type, mappedKey.keys, options);
1223
+ }
1224
+ function IndexFromMappedKey(type, mappedKey, options) {
1225
+ return MappedResult(MappedIndexProperties(type, mappedKey, options));
1226
+ }
1227
+ //#endregion
1228
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.mjs
1229
+ /** `[JavaScript]` Creates an Iterator type */
1230
+ function Iterator(items, options) {
1231
+ return CreateType({
1232
+ [Kind]: "Iterator",
1233
+ type: "Iterator",
1234
+ items
1235
+ }, options);
1236
+ }
1237
+ //#endregion
1238
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
1239
+ /** Creates a RequiredArray derived from the given TProperties value. */
1240
+ function RequiredArray(properties) {
1241
+ return globalThis.Object.keys(properties).filter((key) => !IsOptional$1(properties[key]));
1242
+ }
1243
+ /** `[Json]` Creates an Object type */
1244
+ function _Object(properties, options) {
1245
+ const required = RequiredArray(properties);
1246
+ return CreateType(required.length > 0 ? {
1247
+ [Kind]: "Object",
1248
+ type: "object",
1249
+ required,
1250
+ properties
1251
+ } : {
1252
+ [Kind]: "Object",
1253
+ type: "object",
1254
+ properties
1255
+ }, options);
1256
+ }
1257
+ /** `[Json]` Creates an Object type */
1258
+ var Object$1 = _Object;
1259
+ //#endregion
1260
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/promise/promise.mjs
1261
+ /** `[JavaScript]` Creates a Promise type */
1262
+ function Promise$1(item, options) {
1263
+ return CreateType({
1264
+ [Kind]: "Promise",
1265
+ type: "Promise",
1266
+ item
1267
+ }, options);
1268
+ }
1269
+ //#endregion
1270
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.mjs
1271
+ function RemoveReadonly(schema) {
1272
+ return CreateType(Discard(schema, [ReadonlyKind]));
1273
+ }
1274
+ function AddReadonly(schema) {
1275
+ return CreateType({
1276
+ ...schema,
1277
+ [ReadonlyKind]: "Readonly"
1278
+ });
1279
+ }
1280
+ function ReadonlyWithFlag(schema, F) {
1281
+ return F === false ? RemoveReadonly(schema) : AddReadonly(schema);
1282
+ }
1283
+ /** `[Json]` Creates a Readonly property */
1284
+ function Readonly(schema, enable) {
1285
+ const F = enable ?? true;
1286
+ return IsMappedResult$1(schema) ? ReadonlyFromMappedResult(schema, F) : ReadonlyWithFlag(schema, F);
1287
+ }
1288
+ //#endregion
1289
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.mjs
1290
+ function FromProperties$17(K, F) {
1291
+ const Acc = {};
1292
+ for (const K2 of globalThis.Object.getOwnPropertyNames(K)) Acc[K2] = Readonly(K[K2], F);
1293
+ return Acc;
1294
+ }
1295
+ function FromMappedResult$10(R, F) {
1296
+ return FromProperties$17(R.properties, F);
1297
+ }
1298
+ function ReadonlyFromMappedResult(R, F) {
1299
+ return MappedResult(FromMappedResult$10(R, F));
1300
+ }
1301
+ //#endregion
1302
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.mjs
1303
+ /** `[Json]` Creates a Tuple type */
1304
+ function Tuple(types, options) {
1305
+ return CreateType(types.length > 0 ? {
1306
+ [Kind]: "Tuple",
1307
+ type: "array",
1308
+ items: types,
1309
+ additionalItems: false,
1310
+ minItems: types.length,
1311
+ maxItems: types.length
1312
+ } : {
1313
+ [Kind]: "Tuple",
1314
+ type: "array",
1315
+ minItems: types.length,
1316
+ maxItems: types.length
1317
+ }, options);
1318
+ }
1319
+ //#endregion
1320
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.mjs
1321
+ function FromMappedResult$9(K, P) {
1322
+ return K in P ? FromSchemaType(K, P[K]) : MappedResult(P);
1323
+ }
1324
+ function MappedKeyToKnownMappedResultProperties(K) {
1325
+ return { [K]: Literal(K) };
1326
+ }
1327
+ function MappedKeyToUnknownMappedResultProperties(P) {
1328
+ const Acc = {};
1329
+ for (const L of P) Acc[L] = Literal(L);
1330
+ return Acc;
1331
+ }
1332
+ function MappedKeyToMappedResultProperties(K, P) {
1333
+ return SetIncludes(P, K) ? MappedKeyToKnownMappedResultProperties(K) : MappedKeyToUnknownMappedResultProperties(P);
1334
+ }
1335
+ function FromMappedKey$3(K, P) {
1336
+ return FromMappedResult$9(K, MappedKeyToMappedResultProperties(K, P));
1337
+ }
1338
+ function FromRest$5(K, T) {
1339
+ return T.map((L) => FromSchemaType(K, L));
1340
+ }
1341
+ function FromProperties$16(K, T) {
1342
+ const Acc = {};
1343
+ for (const K2 of globalThis.Object.getOwnPropertyNames(T)) Acc[K2] = FromSchemaType(K, T[K2]);
1344
+ return Acc;
1345
+ }
1346
+ function FromSchemaType(K, T) {
1347
+ const options = { ...T };
1348
+ return IsOptional$1(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) : IsReadonly(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) : IsMappedResult$1(T) ? FromMappedResult$9(K, T.properties) : IsMappedKey$1(T) ? FromMappedKey$3(K, T.keys) : IsConstructor$1(T) ? Constructor(FromRest$5(K, T.parameters), FromSchemaType(K, T.returns), options) : IsFunction$1(T) ? Function(FromRest$5(K, T.parameters), FromSchemaType(K, T.returns), options) : IsAsyncIterator$1(T) ? AsyncIterator(FromSchemaType(K, T.items), options) : IsIterator$1(T) ? Iterator(FromSchemaType(K, T.items), options) : IsIntersect$1(T) ? Intersect(FromRest$5(K, T.allOf), options) : IsUnion$1(T) ? Union(FromRest$5(K, T.anyOf), options) : IsTuple$1(T) ? Tuple(FromRest$5(K, T.items ?? []), options) : IsObject$1(T) ? Object$1(FromProperties$16(K, T.properties), options) : IsArray$1(T) ? Array$1(FromSchemaType(K, T.items), options) : IsPromise$1(T) ? Promise$1(FromSchemaType(K, T.item), options) : T;
1349
+ }
1350
+ function MappedFunctionReturnType(K, T) {
1351
+ const Acc = {};
1352
+ for (const L of K) Acc[L] = FromSchemaType(L, T);
1353
+ return Acc;
1354
+ }
1355
+ /** `[Json]` Creates a Mapped object type */
1356
+ function Mapped(key, map, options) {
1357
+ const K = IsSchema$1(key) ? IndexPropertyKeys(key) : key;
1358
+ return Object$1(MappedFunctionReturnType(K, map({
1359
+ [Kind]: "MappedKey",
1360
+ keys: K
1361
+ })), options);
1362
+ }
1363
+ //#endregion
1364
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/optional/optional.mjs
1365
+ function RemoveOptional(schema) {
1366
+ return CreateType(Discard(schema, [OptionalKind]));
1367
+ }
1368
+ function AddOptional(schema) {
1369
+ return CreateType({
1370
+ ...schema,
1371
+ [OptionalKind]: "Optional"
1372
+ });
1373
+ }
1374
+ function OptionalWithFlag(schema, F) {
1375
+ return F === false ? RemoveOptional(schema) : AddOptional(schema);
1376
+ }
1377
+ /** `[Json]` Creates a Optional property */
1378
+ function Optional(schema, enable) {
1379
+ const F = enable ?? true;
1380
+ return IsMappedResult$1(schema) ? OptionalFromMappedResult(schema, F) : OptionalWithFlag(schema, F);
1381
+ }
1382
+ //#endregion
1383
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.mjs
1384
+ function FromProperties$15(P, F) {
1385
+ const Acc = {};
1386
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P)) Acc[K2] = Optional(P[K2], F);
1387
+ return Acc;
1388
+ }
1389
+ function FromMappedResult$8(R, F) {
1390
+ return FromProperties$15(R.properties, F);
1391
+ }
1392
+ function OptionalFromMappedResult(R, F) {
1393
+ return MappedResult(FromMappedResult$8(R, F));
1394
+ }
1395
+ //#endregion
1396
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.mjs
1397
+ function IntersectCreate(T, options = {}) {
1398
+ const allObjects = T.every((schema) => IsObject$1(schema));
1399
+ const clonedUnevaluatedProperties = IsSchema$1(options.unevaluatedProperties) ? { unevaluatedProperties: options.unevaluatedProperties } : {};
1400
+ return CreateType(options.unevaluatedProperties === false || IsSchema$1(options.unevaluatedProperties) || allObjects ? {
1401
+ ...clonedUnevaluatedProperties,
1402
+ [Kind]: "Intersect",
1403
+ type: "object",
1404
+ allOf: T
1405
+ } : {
1406
+ ...clonedUnevaluatedProperties,
1407
+ [Kind]: "Intersect",
1408
+ allOf: T
1409
+ }, options);
1410
+ }
1411
+ //#endregion
1412
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.mjs
1413
+ function IsIntersectOptional(types) {
1414
+ return types.every((left) => IsOptional$1(left));
1415
+ }
1416
+ function RemoveOptionalFromType(type) {
1417
+ return Discard(type, [OptionalKind]);
1418
+ }
1419
+ function RemoveOptionalFromRest(types) {
1420
+ return types.map((left) => IsOptional$1(left) ? RemoveOptionalFromType(left) : left);
1421
+ }
1422
+ function ResolveIntersect(types, options) {
1423
+ return IsIntersectOptional(types) ? Optional(IntersectCreate(RemoveOptionalFromRest(types), options)) : IntersectCreate(RemoveOptionalFromRest(types), options);
1424
+ }
1425
+ /** `[Json]` Creates an evaluated Intersect type */
1426
+ function IntersectEvaluated(types, options = {}) {
1427
+ if (types.length === 1) return CreateType(types[0], options);
1428
+ if (types.length === 0) return Never(options);
1429
+ if (types.some((schema) => IsTransform$1(schema))) throw new Error("Cannot intersect transform types");
1430
+ return ResolveIntersect(types, options);
1431
+ }
1432
+ //#endregion
1433
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.mjs
1434
+ /** `[Json]` Creates an evaluated Intersect type */
1435
+ function Intersect(types, options) {
1436
+ if (types.length === 1) return CreateType(types[0], options);
1437
+ if (types.length === 0) return Never(options);
1438
+ if (types.some((schema) => IsTransform$1(schema))) throw new Error("Cannot intersect transform types");
1439
+ return IntersectCreate(types, options);
1440
+ }
1441
+ //#endregion
1442
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/ref/ref.mjs
1443
+ /** `[Json]` Creates a Ref type. The referenced type must contain a $id */
1444
+ function Ref(...args) {
1445
+ const [$ref, options] = typeof args[0] === "string" ? [args[0], args[1]] : [args[0].$id, args[1]];
1446
+ if (typeof $ref !== "string") throw new TypeBoxError("Ref: $ref must be a string");
1447
+ return CreateType({
1448
+ [Kind]: "Ref",
1449
+ $ref
1450
+ }, options);
1451
+ }
1452
+ //#endregion
1453
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.mjs
1454
+ function FromComputed$4(target, parameters) {
1455
+ return Computed("Awaited", [Computed(target, parameters)]);
1456
+ }
1457
+ function FromRef$3($ref) {
1458
+ return Computed("Awaited", [Ref($ref)]);
1459
+ }
1460
+ function FromIntersect$6(types) {
1461
+ return Intersect(FromRest$4(types));
1462
+ }
1463
+ function FromUnion$6(types) {
1464
+ return Union(FromRest$4(types));
1465
+ }
1466
+ function FromPromise$2(type) {
1467
+ return Awaited(type);
1468
+ }
1469
+ function FromRest$4(types) {
1470
+ return types.map((type) => Awaited(type));
1471
+ }
1472
+ /** `[JavaScript]` Constructs a type by recursively unwrapping Promise types */
1473
+ function Awaited(type, options) {
1474
+ return CreateType(IsComputed$1(type) ? FromComputed$4(type.target, type.parameters) : IsIntersect$1(type) ? FromIntersect$6(type.allOf) : IsUnion$1(type) ? FromUnion$6(type.anyOf) : IsPromise$1(type) ? FromPromise$2(type.item) : IsRef$1(type) ? FromRef$3(type.$ref) : type, options);
1475
+ }
1476
+ //#endregion
1477
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.mjs
1478
+ function FromRest$3(types) {
1479
+ const result = [];
1480
+ for (const L of types) result.push(KeyOfPropertyKeys(L));
1481
+ return result;
1482
+ }
1483
+ function FromIntersect$5(types) {
1484
+ return SetUnionMany(FromRest$3(types));
1485
+ }
1486
+ function FromUnion$5(types) {
1487
+ return SetIntersectMany(FromRest$3(types));
1488
+ }
1489
+ function FromTuple$3(types) {
1490
+ return types.map((_, indexer) => indexer.toString());
1491
+ }
1492
+ function FromArray$4(_) {
1493
+ return ["[number]"];
1494
+ }
1495
+ function FromProperties$14(T) {
1496
+ return globalThis.Object.getOwnPropertyNames(T);
1497
+ }
1498
+ function FromPatternProperties(patternProperties) {
1499
+ if (!includePatternProperties) return [];
1500
+ return globalThis.Object.getOwnPropertyNames(patternProperties).map((key) => {
1501
+ return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
1502
+ });
1503
+ }
1504
+ /** Returns a tuple of PropertyKeys derived from the given TSchema. */
1505
+ function KeyOfPropertyKeys(type) {
1506
+ return IsIntersect$1(type) ? FromIntersect$5(type.allOf) : IsUnion$1(type) ? FromUnion$5(type.anyOf) : IsTuple$1(type) ? FromTuple$3(type.items ?? []) : IsArray$1(type) ? FromArray$4(type.items) : IsObject$1(type) ? FromProperties$14(type.properties) : IsRecord$1(type) ? FromPatternProperties(type.patternProperties) : [];
1507
+ }
1508
+ let includePatternProperties = false;
1509
+ //#endregion
1510
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.mjs
1511
+ function FromComputed$3(target, parameters) {
1512
+ return Computed("KeyOf", [Computed(target, parameters)]);
1513
+ }
1514
+ function FromRef$2($ref) {
1515
+ return Computed("KeyOf", [Ref($ref)]);
1516
+ }
1517
+ function KeyOfFromType(type, options) {
1518
+ return CreateType(UnionEvaluated(KeyOfPropertyKeysToRest(KeyOfPropertyKeys(type))), options);
1519
+ }
1520
+ function KeyOfPropertyKeysToRest(propertyKeys) {
1521
+ return propertyKeys.map((L) => L === "[number]" ? Number$1() : Literal(L));
1522
+ }
1523
+ /** `[Json]` Creates a KeyOf type */
1524
+ function KeyOf(type, options) {
1525
+ return IsComputed$1(type) ? FromComputed$3(type.target, type.parameters) : IsRef$1(type) ? FromRef$2(type.$ref) : IsMappedResult$1(type) ? KeyOfFromMappedResult(type, options) : KeyOfFromType(type, options);
1526
+ }
1527
+ //#endregion
1528
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.mjs
1529
+ function FromProperties$13(properties, options) {
1530
+ const result = {};
1531
+ for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) result[K2] = KeyOf(properties[K2], Clone(options));
1532
+ return result;
1533
+ }
1534
+ function FromMappedResult$7(mappedResult, options) {
1535
+ return FromProperties$13(mappedResult.properties, options);
1536
+ }
1537
+ function KeyOfFromMappedResult(mappedResult, options) {
1538
+ return MappedResult(FromMappedResult$7(mappedResult, options));
1539
+ }
1540
+ //#endregion
1541
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/composite/composite.mjs
1542
+ function CompositeKeys(T) {
1543
+ const Acc = [];
1544
+ for (const L of T) Acc.push(...KeyOfPropertyKeys(L));
1545
+ return SetDistinct(Acc);
1546
+ }
1547
+ function FilterNever(T) {
1548
+ return T.filter((L) => !IsNever$1(L));
1549
+ }
1550
+ function CompositeProperty(T, K) {
1551
+ const Acc = [];
1552
+ for (const L of T) Acc.push(...IndexFromPropertyKeys(L, [K]));
1553
+ return FilterNever(Acc);
1554
+ }
1555
+ function CompositeProperties(T, K) {
1556
+ const Acc = {};
1557
+ for (const L of K) Acc[L] = IntersectEvaluated(CompositeProperty(T, L));
1558
+ return Acc;
1559
+ }
1560
+ function Composite(T, options) {
1561
+ return Object$1(CompositeProperties(T, CompositeKeys(T)), options);
1562
+ }
1563
+ //#endregion
1564
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/date/date.mjs
1565
+ /** `[JavaScript]` Creates a Date type */
1566
+ function Date$1(options) {
1567
+ return CreateType({
1568
+ [Kind]: "Date",
1569
+ type: "Date"
1570
+ }, options);
1571
+ }
1572
+ //#endregion
1573
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/null/null.mjs
1574
+ /** `[Json]` Creates a Null type */
1575
+ function Null(options) {
1576
+ return CreateType({
1577
+ [Kind]: "Null",
1578
+ type: "null"
1579
+ }, options);
1580
+ }
1581
+ //#endregion
1582
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.mjs
1583
+ /** `[JavaScript]` Creates a Symbol type */
1584
+ function Symbol$1(options) {
1585
+ return CreateType({
1586
+ [Kind]: "Symbol",
1587
+ type: "symbol"
1588
+ }, options);
1589
+ }
1590
+ //#endregion
1591
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.mjs
1592
+ /** `[JavaScript]` Creates a Undefined type */
1593
+ function Undefined(options) {
1594
+ return CreateType({
1595
+ [Kind]: "Undefined",
1596
+ type: "undefined"
1597
+ }, options);
1598
+ }
1599
+ //#endregion
1600
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.mjs
1601
+ /** `[JavaScript]` Creates a Uint8Array type */
1602
+ function Uint8Array$1(options) {
1603
+ return CreateType({
1604
+ [Kind]: "Uint8Array",
1605
+ type: "Uint8Array"
1606
+ }, options);
1607
+ }
1608
+ //#endregion
1609
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.mjs
1610
+ /** `[Json]` Creates an Unknown type */
1611
+ function Unknown(options) {
1612
+ return CreateType({ [Kind]: "Unknown" }, options);
1613
+ }
1614
+ //#endregion
1615
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/const/const.mjs
1616
+ function FromArray$3(T) {
1617
+ return T.map((L) => FromValue(L, false));
1618
+ }
1619
+ function FromProperties$12(value) {
1620
+ const Acc = {};
1621
+ for (const K of globalThis.Object.getOwnPropertyNames(value)) Acc[K] = Readonly(FromValue(value[K], false));
1622
+ return Acc;
1623
+ }
1624
+ function ConditionalReadonly(T, root) {
1625
+ return root === true ? T : Readonly(T);
1626
+ }
1627
+ function FromValue(value, root) {
1628
+ return IsAsyncIterator$2(value) ? ConditionalReadonly(Any(), root) : IsIterator$2(value) ? ConditionalReadonly(Any(), root) : IsArray$3(value) ? Readonly(Tuple(FromArray$3(value))) : IsUint8Array$2(value) ? Uint8Array$1() : IsDate$2(value) ? Date$1() : IsObject$3(value) ? ConditionalReadonly(Object$1(FromProperties$12(value)), root) : IsFunction$2(value) ? ConditionalReadonly(Function([], Unknown()), root) : IsUndefined$3(value) ? Undefined() : IsNull$2(value) ? Null() : IsSymbol$2(value) ? Symbol$1() : IsBigInt$2(value) ? BigInt() : IsNumber$3(value) ? Literal(value) : IsBoolean$2(value) ? Literal(value) : IsString$2(value) ? Literal(value) : Object$1({});
1629
+ }
1630
+ /** `[JavaScript]` Creates a readonly const type from the given value. */
1631
+ function Const(T, options) {
1632
+ return CreateType(FromValue(T, true), options);
1633
+ }
1634
+ //#endregion
1635
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.mjs
1636
+ /** `[JavaScript]` Extracts the ConstructorParameters from the given Constructor type */
1637
+ function ConstructorParameters(schema, options) {
1638
+ return IsConstructor$1(schema) ? Tuple(schema.parameters, options) : Never(options);
1639
+ }
1640
+ //#endregion
1641
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/enum/enum.mjs
1642
+ /** `[Json]` Creates a Enum type */
1643
+ function Enum(item, options) {
1644
+ if (IsUndefined$3(item)) throw new Error("Enum undefined or empty");
1645
+ const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
1646
+ return Union([...new Set(values1)].map((value) => Literal(value)), {
1647
+ ...options,
1648
+ [Hint]: "Enum"
1649
+ });
1650
+ }
1651
+ //#endregion
1652
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.mjs
1653
+ var ExtendsResolverError = class extends TypeBoxError {};
1654
+ var ExtendsResult;
1655
+ (function(ExtendsResult) {
1656
+ ExtendsResult[ExtendsResult["Union"] = 0] = "Union";
1657
+ ExtendsResult[ExtendsResult["True"] = 1] = "True";
1658
+ ExtendsResult[ExtendsResult["False"] = 2] = "False";
1659
+ })(ExtendsResult || (ExtendsResult = {}));
1660
+ function IntoBooleanResult(result) {
1661
+ return result === ExtendsResult.False ? result : ExtendsResult.True;
1662
+ }
1663
+ function Throw(message) {
1664
+ throw new ExtendsResolverError(message);
1665
+ }
1666
+ function IsStructuralRight(right) {
1667
+ return IsNever(right) || IsIntersect(right) || IsUnion(right) || IsUnknown(right) || IsAny(right);
1668
+ }
1669
+ function StructuralRight(left, right) {
1670
+ return IsNever(right) ? FromNeverRight(left, right) : IsIntersect(right) ? FromIntersectRight(left, right) : IsUnion(right) ? FromUnionRight(left, right) : IsUnknown(right) ? FromUnknownRight(left, right) : IsAny(right) ? FromAnyRight(left, right) : Throw("StructuralRight");
1671
+ }
1672
+ function FromAnyRight(left, right) {
1673
+ return ExtendsResult.True;
1674
+ }
1675
+ function FromAny(left, right) {
1676
+ return IsIntersect(right) ? FromIntersectRight(left, right) : IsUnion(right) && right.anyOf.some((schema) => IsAny(schema) || IsUnknown(schema)) ? ExtendsResult.True : IsUnion(right) ? ExtendsResult.Union : IsUnknown(right) ? ExtendsResult.True : IsAny(right) ? ExtendsResult.True : ExtendsResult.Union;
1677
+ }
1678
+ function FromArrayRight(left, right) {
1679
+ return IsUnknown(left) ? ExtendsResult.False : IsAny(left) ? ExtendsResult.Union : IsNever(left) ? ExtendsResult.True : ExtendsResult.False;
1680
+ }
1681
+ function FromArray$2(left, right) {
1682
+ return IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : !IsArray(right) ? ExtendsResult.False : IntoBooleanResult(Visit(left.items, right.items));
1683
+ }
1684
+ function FromAsyncIterator$2(left, right) {
1685
+ return IsStructuralRight(right) ? StructuralRight(left, right) : !IsAsyncIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit(left.items, right.items));
1686
+ }
1687
+ function FromBigInt(left, right) {
1688
+ return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsBigInt(right) ? ExtendsResult.True : ExtendsResult.False;
1689
+ }
1690
+ function FromBooleanRight(left, right) {
1691
+ return IsLiteralBoolean(left) ? ExtendsResult.True : IsBoolean(left) ? ExtendsResult.True : ExtendsResult.False;
1692
+ }
1693
+ function FromBoolean(left, right) {
1694
+ return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsBoolean(right) ? ExtendsResult.True : ExtendsResult.False;
1695
+ }
1696
+ function FromConstructor$2(left, right) {
1697
+ return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : !IsConstructor(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit(left.returns, right.returns));
1698
+ }
1699
+ function FromDate(left, right) {
1700
+ return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsDate(right) ? ExtendsResult.True : ExtendsResult.False;
1701
+ }
1702
+ function FromFunction$2(left, right) {
1703
+ return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : !IsFunction(right) ? ExtendsResult.False : left.parameters.length > right.parameters.length ? ExtendsResult.False : !left.parameters.every((schema, index) => IntoBooleanResult(Visit(right.parameters[index], schema)) === ExtendsResult.True) ? ExtendsResult.False : IntoBooleanResult(Visit(left.returns, right.returns));
1704
+ }
1705
+ function FromIntegerRight(left, right) {
1706
+ return IsLiteral(left) && IsNumber$3(left.const) ? ExtendsResult.True : IsNumber(left) || IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
1707
+ }
1708
+ function FromInteger(left, right) {
1709
+ return IsInteger(right) || IsNumber(right) ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : ExtendsResult.False;
1710
+ }
1711
+ function FromIntersectRight(left, right) {
1712
+ return right.allOf.every((schema) => Visit(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1713
+ }
1714
+ function FromIntersect$4(left, right) {
1715
+ return left.allOf.some((schema) => Visit(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1716
+ }
1717
+ function FromIterator$2(left, right) {
1718
+ return IsStructuralRight(right) ? StructuralRight(left, right) : !IsIterator(right) ? ExtendsResult.False : IntoBooleanResult(Visit(left.items, right.items));
1719
+ }
1720
+ function FromLiteral(left, right) {
1721
+ return IsLiteral(right) && right.const === left.const ? ExtendsResult.True : IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsString(right) ? FromStringRight(left, right) : IsNumber(right) ? FromNumberRight(left, right) : IsInteger(right) ? FromIntegerRight(left, right) : IsBoolean(right) ? FromBooleanRight(left, right) : ExtendsResult.False;
1722
+ }
1723
+ function FromNeverRight(left, right) {
1724
+ return ExtendsResult.False;
1725
+ }
1726
+ function FromNever(left, right) {
1727
+ return ExtendsResult.True;
1728
+ }
1729
+ function UnwrapTNot(schema) {
1730
+ let [current, depth] = [schema, 0];
1731
+ while (true) {
1732
+ if (!IsNot(current)) break;
1733
+ current = current.not;
1734
+ depth += 1;
1735
+ }
1736
+ return depth % 2 === 0 ? current : Unknown();
1737
+ }
1738
+ function FromNot(left, right) {
1739
+ return IsNot(left) ? Visit(UnwrapTNot(left), right) : IsNot(right) ? Visit(left, UnwrapTNot(right)) : Throw("Invalid fallthrough for Not");
1740
+ }
1741
+ function FromNull(left, right) {
1742
+ return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsNull(right) ? ExtendsResult.True : ExtendsResult.False;
1743
+ }
1744
+ function FromNumberRight(left, right) {
1745
+ return IsLiteralNumber(left) ? ExtendsResult.True : IsNumber(left) || IsInteger(left) ? ExtendsResult.True : ExtendsResult.False;
1746
+ }
1747
+ function FromNumber(left, right) {
1748
+ return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsInteger(right) || IsNumber(right) ? ExtendsResult.True : ExtendsResult.False;
1749
+ }
1750
+ function IsObjectPropertyCount(schema, count) {
1751
+ return Object.getOwnPropertyNames(schema.properties).length === count;
1752
+ }
1753
+ function IsObjectStringLike(schema) {
1754
+ return IsObjectArrayLike(schema);
1755
+ }
1756
+ function IsObjectSymbolLike(schema) {
1757
+ return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "description" in schema.properties && IsUnion(schema.properties.description) && schema.properties.description.anyOf.length === 2 && (IsString(schema.properties.description.anyOf[0]) && IsUndefined(schema.properties.description.anyOf[1]) || IsString(schema.properties.description.anyOf[1]) && IsUndefined(schema.properties.description.anyOf[0]));
1758
+ }
1759
+ function IsObjectNumberLike(schema) {
1760
+ return IsObjectPropertyCount(schema, 0);
1761
+ }
1762
+ function IsObjectBooleanLike(schema) {
1763
+ return IsObjectPropertyCount(schema, 0);
1764
+ }
1765
+ function IsObjectBigIntLike(schema) {
1766
+ return IsObjectPropertyCount(schema, 0);
1767
+ }
1768
+ function IsObjectDateLike(schema) {
1769
+ return IsObjectPropertyCount(schema, 0);
1770
+ }
1771
+ function IsObjectUint8ArrayLike(schema) {
1772
+ return IsObjectArrayLike(schema);
1773
+ }
1774
+ function IsObjectFunctionLike(schema) {
1775
+ const length = Number$1();
1776
+ return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit(schema.properties["length"], length)) === ExtendsResult.True;
1777
+ }
1778
+ function IsObjectConstructorLike(schema) {
1779
+ return IsObjectPropertyCount(schema, 0);
1780
+ }
1781
+ function IsObjectArrayLike(schema) {
1782
+ const length = Number$1();
1783
+ return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "length" in schema.properties && IntoBooleanResult(Visit(schema.properties["length"], length)) === ExtendsResult.True;
1784
+ }
1785
+ function IsObjectPromiseLike(schema) {
1786
+ const then = Function([Any()], Any());
1787
+ return IsObjectPropertyCount(schema, 0) || IsObjectPropertyCount(schema, 1) && "then" in schema.properties && IntoBooleanResult(Visit(schema.properties["then"], then)) === ExtendsResult.True;
1788
+ }
1789
+ function Property(left, right) {
1790
+ return Visit(left, right) === ExtendsResult.False ? ExtendsResult.False : IsOptional(left) && !IsOptional(right) ? ExtendsResult.False : ExtendsResult.True;
1791
+ }
1792
+ function FromObjectRight(left, right) {
1793
+ return IsUnknown(left) ? ExtendsResult.False : IsAny(left) ? ExtendsResult.Union : IsNever(left) || IsLiteralString(left) && IsObjectStringLike(right) || IsLiteralNumber(left) && IsObjectNumberLike(right) || IsLiteralBoolean(left) && IsObjectBooleanLike(right) || IsSymbol(left) && IsObjectSymbolLike(right) || IsBigInt(left) && IsObjectBigIntLike(right) || IsString(left) && IsObjectStringLike(right) || IsSymbol(left) && IsObjectSymbolLike(right) || IsNumber(left) && IsObjectNumberLike(right) || IsInteger(left) && IsObjectNumberLike(right) || IsBoolean(left) && IsObjectBooleanLike(right) || IsUint8Array(left) && IsObjectUint8ArrayLike(right) || IsDate(left) && IsObjectDateLike(right) || IsConstructor(left) && IsObjectConstructorLike(right) || IsFunction(left) && IsObjectFunctionLike(right) ? ExtendsResult.True : IsRecord(left) && IsString(RecordKey$1(left)) ? right[Hint] === "Record" ? ExtendsResult.True : ExtendsResult.False : IsRecord(left) && IsNumber(RecordKey$1(left)) ? IsObjectPropertyCount(right, 0) ? ExtendsResult.True : ExtendsResult.False : ExtendsResult.False;
1794
+ }
1795
+ function FromObject$6(left, right) {
1796
+ return IsStructuralRight(right) ? StructuralRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : !IsObject(right) ? ExtendsResult.False : (() => {
1797
+ for (const key of Object.getOwnPropertyNames(right.properties)) {
1798
+ if (!(key in left.properties) && !IsOptional(right.properties[key])) return ExtendsResult.False;
1799
+ if (IsOptional(right.properties[key])) return ExtendsResult.True;
1800
+ if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) return ExtendsResult.False;
1801
+ }
1802
+ return ExtendsResult.True;
1803
+ })();
1804
+ }
1805
+ function FromPromise$1(left, right) {
1806
+ return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) && IsObjectPromiseLike(right) ? ExtendsResult.True : !IsPromise(right) ? ExtendsResult.False : IntoBooleanResult(Visit(left.item, right.item));
1807
+ }
1808
+ function RecordKey$1(schema) {
1809
+ return PatternNumberExact in schema.patternProperties ? Number$1() : PatternStringExact in schema.patternProperties ? String$1() : Throw("Unknown record key pattern");
1810
+ }
1811
+ function RecordValue$1(schema) {
1812
+ return PatternNumberExact in schema.patternProperties ? schema.patternProperties[PatternNumberExact] : PatternStringExact in schema.patternProperties ? schema.patternProperties[PatternStringExact] : Throw("Unable to get record value schema");
1813
+ }
1814
+ function FromRecordRight(left, right) {
1815
+ const [Key, Value] = [RecordKey$1(right), RecordValue$1(right)];
1816
+ return IsLiteralString(left) && IsNumber(Key) && IntoBooleanResult(Visit(left, Value)) === ExtendsResult.True ? ExtendsResult.True : IsUint8Array(left) && IsNumber(Key) ? Visit(left, Value) : IsString(left) && IsNumber(Key) ? Visit(left, Value) : IsArray(left) && IsNumber(Key) ? Visit(left, Value) : IsObject(left) ? (() => {
1817
+ for (const key of Object.getOwnPropertyNames(left.properties)) if (Property(Value, left.properties[key]) === ExtendsResult.False) return ExtendsResult.False;
1818
+ return ExtendsResult.True;
1819
+ })() : ExtendsResult.False;
1820
+ }
1821
+ function FromRecord$2(left, right) {
1822
+ return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : !IsRecord(right) ? ExtendsResult.False : Visit(RecordValue$1(left), RecordValue$1(right));
1823
+ }
1824
+ function FromRegExp(left, right) {
1825
+ return Visit(IsRegExp(left) ? String$1() : left, IsRegExp(right) ? String$1() : right);
1826
+ }
1827
+ function FromStringRight(left, right) {
1828
+ return IsLiteral(left) && IsString$2(left.const) ? ExtendsResult.True : IsString(left) ? ExtendsResult.True : ExtendsResult.False;
1829
+ }
1830
+ function FromString(left, right) {
1831
+ return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsString(right) ? ExtendsResult.True : ExtendsResult.False;
1832
+ }
1833
+ function FromSymbol(left, right) {
1834
+ return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsSymbol(right) ? ExtendsResult.True : ExtendsResult.False;
1835
+ }
1836
+ function FromTemplateLiteral$1(left, right) {
1837
+ return IsTemplateLiteral(left) ? Visit(TemplateLiteralToUnion(left), right) : IsTemplateLiteral(right) ? Visit(left, TemplateLiteralToUnion(right)) : Throw("Invalid fallthrough for TemplateLiteral");
1838
+ }
1839
+ function IsArrayOfTuple(left, right) {
1840
+ return IsArray(right) && left.items !== void 0 && left.items.every((schema) => Visit(schema, right.items) === ExtendsResult.True);
1841
+ }
1842
+ function FromTupleRight(left, right) {
1843
+ return IsNever(left) ? ExtendsResult.True : IsUnknown(left) ? ExtendsResult.False : IsAny(left) ? ExtendsResult.Union : ExtendsResult.False;
1844
+ }
1845
+ function FromTuple$2(left, right) {
1846
+ return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) && IsObjectArrayLike(right) ? ExtendsResult.True : IsArray(right) && IsArrayOfTuple(left, right) ? ExtendsResult.True : !IsTuple(right) ? ExtendsResult.False : IsUndefined$3(left.items) && !IsUndefined$3(right.items) || !IsUndefined$3(left.items) && IsUndefined$3(right.items) ? ExtendsResult.False : IsUndefined$3(left.items) && !IsUndefined$3(right.items) ? ExtendsResult.True : left.items.every((schema, index) => Visit(schema, right.items[index]) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1847
+ }
1848
+ function FromUint8Array(left, right) {
1849
+ return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsUint8Array(right) ? ExtendsResult.True : ExtendsResult.False;
1850
+ }
1851
+ function FromUndefined(left, right) {
1852
+ return IsStructuralRight(right) ? StructuralRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsRecord(right) ? FromRecordRight(left, right) : IsVoid(right) ? FromVoidRight(left, right) : IsUndefined(right) ? ExtendsResult.True : ExtendsResult.False;
1853
+ }
1854
+ function FromUnionRight(left, right) {
1855
+ return right.anyOf.some((schema) => Visit(left, schema) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1856
+ }
1857
+ function FromUnion$4(left, right) {
1858
+ return left.anyOf.every((schema) => Visit(schema, right) === ExtendsResult.True) ? ExtendsResult.True : ExtendsResult.False;
1859
+ }
1860
+ function FromUnknownRight(left, right) {
1861
+ return ExtendsResult.True;
1862
+ }
1863
+ function FromUnknown(left, right) {
1864
+ return IsNever(right) ? FromNeverRight(left, right) : IsIntersect(right) ? FromIntersectRight(left, right) : IsUnion(right) ? FromUnionRight(left, right) : IsAny(right) ? FromAnyRight(left, right) : IsString(right) ? FromStringRight(left, right) : IsNumber(right) ? FromNumberRight(left, right) : IsInteger(right) ? FromIntegerRight(left, right) : IsBoolean(right) ? FromBooleanRight(left, right) : IsArray(right) ? FromArrayRight(left, right) : IsTuple(right) ? FromTupleRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsUnknown(right) ? ExtendsResult.True : ExtendsResult.False;
1865
+ }
1866
+ function FromVoidRight(left, right) {
1867
+ return IsUndefined(left) ? ExtendsResult.True : IsUndefined(left) ? ExtendsResult.True : ExtendsResult.False;
1868
+ }
1869
+ function FromVoid(left, right) {
1870
+ return IsIntersect(right) ? FromIntersectRight(left, right) : IsUnion(right) ? FromUnionRight(left, right) : IsUnknown(right) ? FromUnknownRight(left, right) : IsAny(right) ? FromAnyRight(left, right) : IsObject(right) ? FromObjectRight(left, right) : IsVoid(right) ? ExtendsResult.True : ExtendsResult.False;
1871
+ }
1872
+ function Visit(left, right) {
1873
+ return IsTemplateLiteral(left) || IsTemplateLiteral(right) ? FromTemplateLiteral$1(left, right) : IsRegExp(left) || IsRegExp(right) ? FromRegExp(left, right) : IsNot(left) || IsNot(right) ? FromNot(left, right) : IsAny(left) ? FromAny(left, right) : IsArray(left) ? FromArray$2(left, right) : IsBigInt(left) ? FromBigInt(left, right) : IsBoolean(left) ? FromBoolean(left, right) : IsAsyncIterator(left) ? FromAsyncIterator$2(left, right) : IsConstructor(left) ? FromConstructor$2(left, right) : IsDate(left) ? FromDate(left, right) : IsFunction(left) ? FromFunction$2(left, right) : IsInteger(left) ? FromInteger(left, right) : IsIntersect(left) ? FromIntersect$4(left, right) : IsIterator(left) ? FromIterator$2(left, right) : IsLiteral(left) ? FromLiteral(left, right) : IsNever(left) ? FromNever(left, right) : IsNull(left) ? FromNull(left, right) : IsNumber(left) ? FromNumber(left, right) : IsObject(left) ? FromObject$6(left, right) : IsRecord(left) ? FromRecord$2(left, right) : IsString(left) ? FromString(left, right) : IsSymbol(left) ? FromSymbol(left, right) : IsTuple(left) ? FromTuple$2(left, right) : IsPromise(left) ? FromPromise$1(left, right) : IsUint8Array(left) ? FromUint8Array(left, right) : IsUndefined(left) ? FromUndefined(left, right) : IsUnion(left) ? FromUnion$4(left, right) : IsUnknown(left) ? FromUnknown(left, right) : IsVoid(left) ? FromVoid(left, right) : Throw(`Unknown left type operand '${left[Kind]}'`);
1874
+ }
1875
+ function ExtendsCheck(left, right) {
1876
+ return Visit(left, right);
1877
+ }
1878
+ //#endregion
1879
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.mjs
1880
+ function FromProperties$11(P, Right, True, False, options) {
1881
+ const Acc = {};
1882
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P)) Acc[K2] = Extends(P[K2], Right, True, False, Clone(options));
1883
+ return Acc;
1884
+ }
1885
+ function FromMappedResult$6(Left, Right, True, False, options) {
1886
+ return FromProperties$11(Left.properties, Right, True, False, options);
1887
+ }
1888
+ function ExtendsFromMappedResult(Left, Right, True, False, options) {
1889
+ return MappedResult(FromMappedResult$6(Left, Right, True, False, options));
1890
+ }
1891
+ //#endregion
1892
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/extends/extends.mjs
1893
+ function ExtendsResolve(left, right, trueType, falseType) {
1894
+ const R = ExtendsCheck(left, right);
1895
+ return R === ExtendsResult.Union ? Union([trueType, falseType]) : R === ExtendsResult.True ? trueType : falseType;
1896
+ }
1897
+ /** `[Json]` Creates a Conditional type */
1898
+ function Extends(L, R, T, F, options) {
1899
+ return IsMappedResult$1(L) ? ExtendsFromMappedResult(L, R, T, F, options) : IsMappedKey$1(L) ? CreateType(ExtendsFromMappedKey(L, R, T, F, options)) : CreateType(ExtendsResolve(L, R, T, F), options);
1900
+ }
1901
+ //#endregion
1902
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.mjs
1903
+ function FromPropertyKey$2(K, U, L, R, options) {
1904
+ return { [K]: Extends(Literal(K), U, L, R, Clone(options)) };
1905
+ }
1906
+ function FromPropertyKeys$2(K, U, L, R, options) {
1907
+ return K.reduce((Acc, LK) => {
1908
+ return {
1909
+ ...Acc,
1910
+ ...FromPropertyKey$2(LK, U, L, R, options)
1911
+ };
1912
+ }, {});
1913
+ }
1914
+ function FromMappedKey$2(K, U, L, R, options) {
1915
+ return FromPropertyKeys$2(K.keys, U, L, R, options);
1916
+ }
1917
+ function ExtendsFromMappedKey(T, U, L, R, options) {
1918
+ return MappedResult(FromMappedKey$2(T, U, L, R, options));
1919
+ }
1920
+ //#endregion
1921
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.mjs
1922
+ function ExcludeFromTemplateLiteral(L, R) {
1923
+ return Exclude(TemplateLiteralToUnion(L), R);
1924
+ }
1925
+ //#endregion
1926
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.mjs
1927
+ function ExcludeRest(L, R) {
1928
+ const excluded = L.filter((inner) => ExtendsCheck(inner, R) === ExtendsResult.False);
1929
+ return excluded.length === 1 ? excluded[0] : Union(excluded);
1930
+ }
1931
+ /** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */
1932
+ function Exclude(L, R, options = {}) {
1933
+ if (IsTemplateLiteral$1(L)) return CreateType(ExcludeFromTemplateLiteral(L, R), options);
1934
+ if (IsMappedResult$1(L)) return CreateType(ExcludeFromMappedResult(L, R), options);
1935
+ return CreateType(IsUnion$1(L) ? ExcludeRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? Never() : L, options);
1936
+ }
1937
+ //#endregion
1938
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.mjs
1939
+ function FromProperties$10(P, U) {
1940
+ const Acc = {};
1941
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P)) Acc[K2] = Exclude(P[K2], U);
1942
+ return Acc;
1943
+ }
1944
+ function FromMappedResult$5(R, T) {
1945
+ return FromProperties$10(R.properties, T);
1946
+ }
1947
+ function ExcludeFromMappedResult(R, T) {
1948
+ return MappedResult(FromMappedResult$5(R, T));
1949
+ }
1950
+ //#endregion
1951
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.mjs
1952
+ function ExtractFromTemplateLiteral(L, R) {
1953
+ return Extract(TemplateLiteralToUnion(L), R);
1954
+ }
1955
+ //#endregion
1956
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/extract/extract.mjs
1957
+ function ExtractRest(L, R) {
1958
+ const extracted = L.filter((inner) => ExtendsCheck(inner, R) !== ExtendsResult.False);
1959
+ return extracted.length === 1 ? extracted[0] : Union(extracted);
1960
+ }
1961
+ /** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */
1962
+ function Extract(L, R, options) {
1963
+ if (IsTemplateLiteral$1(L)) return CreateType(ExtractFromTemplateLiteral(L, R), options);
1964
+ if (IsMappedResult$1(L)) return CreateType(ExtractFromMappedResult(L, R), options);
1965
+ return CreateType(IsUnion$1(L) ? ExtractRest(L.anyOf, R) : ExtendsCheck(L, R) !== ExtendsResult.False ? L : Never(), options);
1966
+ }
1967
+ //#endregion
1968
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.mjs
1969
+ function FromProperties$9(P, T) {
1970
+ const Acc = {};
1971
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P)) Acc[K2] = Extract(P[K2], T);
1972
+ return Acc;
1973
+ }
1974
+ function FromMappedResult$4(R, T) {
1975
+ return FromProperties$9(R.properties, T);
1976
+ }
1977
+ function ExtractFromMappedResult(R, T) {
1978
+ return MappedResult(FromMappedResult$4(R, T));
1979
+ }
1980
+ //#endregion
1981
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.mjs
1982
+ /** `[JavaScript]` Extracts the InstanceType from the given Constructor type */
1983
+ function InstanceType(schema, options) {
1984
+ return IsConstructor$1(schema) ? CreateType(schema.returns, options) : Never(options);
1985
+ }
1986
+ //#endregion
1987
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.mjs
1988
+ /** `[Json]` Creates a Readonly and Optional property */
1989
+ function ReadonlyOptional(schema) {
1990
+ return Readonly(Optional(schema));
1991
+ }
1992
+ //#endregion
1993
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/record/record.mjs
1994
+ function RecordCreateFromPattern(pattern, T, options) {
1995
+ return CreateType({
1996
+ [Kind]: "Record",
1997
+ type: "object",
1998
+ patternProperties: { [pattern]: T }
1999
+ }, options);
2000
+ }
2001
+ function RecordCreateFromKeys(K, T, options) {
2002
+ const result = {};
2003
+ for (const K2 of K) result[K2] = T;
2004
+ return Object$1(result, {
2005
+ ...options,
2006
+ [Hint]: "Record"
2007
+ });
2008
+ }
2009
+ function FromTemplateLiteralKey(K, T, options) {
2010
+ return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
2011
+ }
2012
+ function FromUnionKey(key, type, options) {
2013
+ return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
2014
+ }
2015
+ function FromLiteralKey(key, type, options) {
2016
+ return RecordCreateFromKeys([key.toString()], type, options);
2017
+ }
2018
+ function FromRegExpKey(key, type, options) {
2019
+ return RecordCreateFromPattern(key.source, type, options);
2020
+ }
2021
+ function FromStringKey(key, type, options) {
2022
+ return RecordCreateFromPattern(IsUndefined$3(key.pattern) ? PatternStringExact : key.pattern, type, options);
2023
+ }
2024
+ function FromAnyKey(_, type, options) {
2025
+ return RecordCreateFromPattern(PatternStringExact, type, options);
2026
+ }
2027
+ function FromNeverKey(_key, type, options) {
2028
+ return RecordCreateFromPattern(PatternNeverExact, type, options);
2029
+ }
2030
+ function FromBooleanKey(_key, type, options) {
2031
+ return Object$1({
2032
+ true: type,
2033
+ false: type
2034
+ }, options);
2035
+ }
2036
+ function FromIntegerKey(_key, type, options) {
2037
+ return RecordCreateFromPattern(PatternNumberExact, type, options);
2038
+ }
2039
+ function FromNumberKey(_, type, options) {
2040
+ return RecordCreateFromPattern(PatternNumberExact, type, options);
2041
+ }
2042
+ /** `[Json]` Creates a Record type */
2043
+ function Record(key, type, options = {}) {
2044
+ return IsUnion$1(key) ? FromUnionKey(key.anyOf, type, options) : IsTemplateLiteral$1(key) ? FromTemplateLiteralKey(key, type, options) : IsLiteral$1(key) ? FromLiteralKey(key.const, type, options) : IsBoolean$1(key) ? FromBooleanKey(key, type, options) : IsInteger$1(key) ? FromIntegerKey(key, type, options) : IsNumber$1(key) ? FromNumberKey(key, type, options) : IsRegExp$1(key) ? FromRegExpKey(key, type, options) : IsString$1(key) ? FromStringKey(key, type, options) : IsAny$1(key) ? FromAnyKey(key, type, options) : IsNever$1(key) ? FromNeverKey(key, type, options) : Never(options);
2045
+ }
2046
+ /** Gets the Records Pattern */
2047
+ function RecordPattern(record) {
2048
+ return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
2049
+ }
2050
+ /** Gets the Records Key Type */
2051
+ function RecordKey(type) {
2052
+ const pattern = RecordPattern(type);
2053
+ return pattern === PatternStringExact ? String$1() : pattern === PatternNumberExact ? Number$1() : String$1({ pattern });
2054
+ }
2055
+ /** Gets a Record Value Type */
2056
+ function RecordValue(type) {
2057
+ return type.patternProperties[RecordPattern(type)];
2058
+ }
2059
+ //#endregion
2060
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.mjs
2061
+ function FromConstructor$1(args, type) {
2062
+ type.parameters = FromTypes$1(args, type.parameters);
2063
+ type.returns = FromType$1(args, type.returns);
2064
+ return type;
2065
+ }
2066
+ function FromFunction$1(args, type) {
2067
+ type.parameters = FromTypes$1(args, type.parameters);
2068
+ type.returns = FromType$1(args, type.returns);
2069
+ return type;
2070
+ }
2071
+ function FromIntersect$3(args, type) {
2072
+ type.allOf = FromTypes$1(args, type.allOf);
2073
+ return type;
2074
+ }
2075
+ function FromUnion$3(args, type) {
2076
+ type.anyOf = FromTypes$1(args, type.anyOf);
2077
+ return type;
2078
+ }
2079
+ function FromTuple$1(args, type) {
2080
+ if (IsUndefined$3(type.items)) return type;
2081
+ type.items = FromTypes$1(args, type.items);
2082
+ return type;
2083
+ }
2084
+ function FromArray$1(args, type) {
2085
+ type.items = FromType$1(args, type.items);
2086
+ return type;
2087
+ }
2088
+ function FromAsyncIterator$1(args, type) {
2089
+ type.items = FromType$1(args, type.items);
2090
+ return type;
2091
+ }
2092
+ function FromIterator$1(args, type) {
2093
+ type.items = FromType$1(args, type.items);
2094
+ return type;
2095
+ }
2096
+ function FromPromise(args, type) {
2097
+ type.item = FromType$1(args, type.item);
2098
+ return type;
2099
+ }
2100
+ function FromObject$5(args, type) {
2101
+ const mappedProperties = FromProperties$8(args, type.properties);
2102
+ return {
2103
+ ...type,
2104
+ ...Object$1(mappedProperties)
2105
+ };
2106
+ }
2107
+ function FromRecord$1(args, type) {
2108
+ const result = Record(FromType$1(args, RecordKey(type)), FromType$1(args, RecordValue(type)));
2109
+ return {
2110
+ ...type,
2111
+ ...result
2112
+ };
2113
+ }
2114
+ function FromArgument(args, argument) {
2115
+ return argument.index in args ? args[argument.index] : Unknown();
2116
+ }
2117
+ function FromProperty$1(args, type) {
2118
+ const isReadonly = IsReadonly(type);
2119
+ const isOptional = IsOptional$1(type);
2120
+ const mapped = FromType$1(args, type);
2121
+ return isReadonly && isOptional ? ReadonlyOptional(mapped) : isReadonly && !isOptional ? Readonly(mapped) : !isReadonly && isOptional ? Optional(mapped) : mapped;
2122
+ }
2123
+ function FromProperties$8(args, properties) {
2124
+ return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => {
2125
+ return {
2126
+ ...result,
2127
+ [key]: FromProperty$1(args, properties[key])
2128
+ };
2129
+ }, {});
2130
+ }
2131
+ function FromTypes$1(args, types) {
2132
+ return types.map((type) => FromType$1(args, type));
2133
+ }
2134
+ function FromType$1(args, type) {
2135
+ return IsConstructor$1(type) ? FromConstructor$1(args, type) : IsFunction$1(type) ? FromFunction$1(args, type) : IsIntersect$1(type) ? FromIntersect$3(args, type) : IsUnion$1(type) ? FromUnion$3(args, type) : IsTuple$1(type) ? FromTuple$1(args, type) : IsArray$1(type) ? FromArray$1(args, type) : IsAsyncIterator$1(type) ? FromAsyncIterator$1(args, type) : IsIterator$1(type) ? FromIterator$1(args, type) : IsPromise$1(type) ? FromPromise(args, type) : IsObject$1(type) ? FromObject$5(args, type) : IsRecord$1(type) ? FromRecord$1(args, type) : IsArgument$1(type) ? FromArgument(args, type) : type;
2136
+ }
2137
+ /** `[JavaScript]` Instantiates a type with the given parameters */
2138
+ function Instantiate(type, args) {
2139
+ return FromType$1(args, CloneType(type));
2140
+ }
2141
+ //#endregion
2142
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/integer/integer.mjs
2143
+ /** `[Json]` Creates an Integer type */
2144
+ function Integer(options) {
2145
+ return CreateType({
2146
+ [Kind]: "Integer",
2147
+ type: "integer"
2148
+ }, options);
2149
+ }
2150
+ //#endregion
2151
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.mjs
2152
+ function MappedIntrinsicPropertyKey(K, M, options) {
2153
+ return { [K]: Intrinsic(Literal(K), M, Clone(options)) };
2154
+ }
2155
+ function MappedIntrinsicPropertyKeys(K, M, options) {
2156
+ return K.reduce((Acc, L) => {
2157
+ return {
2158
+ ...Acc,
2159
+ ...MappedIntrinsicPropertyKey(L, M, options)
2160
+ };
2161
+ }, {});
2162
+ }
2163
+ function MappedIntrinsicProperties(T, M, options) {
2164
+ return MappedIntrinsicPropertyKeys(T["keys"], M, options);
2165
+ }
2166
+ function IntrinsicFromMappedKey(T, M, options) {
2167
+ return MappedResult(MappedIntrinsicProperties(T, M, options));
2168
+ }
2169
+ //#endregion
2170
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.mjs
2171
+ function ApplyUncapitalize(value) {
2172
+ const [first, rest] = [value.slice(0, 1), value.slice(1)];
2173
+ return [first.toLowerCase(), rest].join("");
2174
+ }
2175
+ function ApplyCapitalize(value) {
2176
+ const [first, rest] = [value.slice(0, 1), value.slice(1)];
2177
+ return [first.toUpperCase(), rest].join("");
2178
+ }
2179
+ function ApplyUppercase(value) {
2180
+ return value.toUpperCase();
2181
+ }
2182
+ function ApplyLowercase(value) {
2183
+ return value.toLowerCase();
2184
+ }
2185
+ function FromTemplateLiteral(schema, mode, options) {
2186
+ const expression = TemplateLiteralParseExact(schema.pattern);
2187
+ if (!IsTemplateLiteralExpressionFinite(expression)) return {
2188
+ ...schema,
2189
+ pattern: FromLiteralValue(schema.pattern, mode)
2190
+ };
2191
+ return TemplateLiteral([Union(FromRest$2([...TemplateLiteralExpressionGenerate(expression)].map((value) => Literal(value)), mode))], options);
2192
+ }
2193
+ function FromLiteralValue(value, mode) {
2194
+ return typeof value === "string" ? mode === "Uncapitalize" ? ApplyUncapitalize(value) : mode === "Capitalize" ? ApplyCapitalize(value) : mode === "Uppercase" ? ApplyUppercase(value) : mode === "Lowercase" ? ApplyLowercase(value) : value : value.toString();
2195
+ }
2196
+ function FromRest$2(T, M) {
2197
+ return T.map((L) => Intrinsic(L, M));
2198
+ }
2199
+ /** Applies an intrinsic string manipulation to the given type. */
2200
+ function Intrinsic(schema, mode, options = {}) {
2201
+ return IsMappedKey$1(schema) ? IntrinsicFromMappedKey(schema, mode, options) : IsTemplateLiteral$1(schema) ? FromTemplateLiteral(schema, mode, options) : IsUnion$1(schema) ? Union(FromRest$2(schema.anyOf, mode), options) : IsLiteral$1(schema) ? Literal(FromLiteralValue(schema.const, mode), options) : CreateType(schema, options);
2202
+ }
2203
+ //#endregion
2204
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.mjs
2205
+ /** `[Json]` Intrinsic function to Capitalize LiteralString types */
2206
+ function Capitalize(T, options = {}) {
2207
+ return Intrinsic(T, "Capitalize", options);
2208
+ }
2209
+ //#endregion
2210
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.mjs
2211
+ /** `[Json]` Intrinsic function to Lowercase LiteralString types */
2212
+ function Lowercase(T, options = {}) {
2213
+ return Intrinsic(T, "Lowercase", options);
2214
+ }
2215
+ //#endregion
2216
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.mjs
2217
+ /** `[Json]` Intrinsic function to Uncapitalize LiteralString types */
2218
+ function Uncapitalize(T, options = {}) {
2219
+ return Intrinsic(T, "Uncapitalize", options);
2220
+ }
2221
+ //#endregion
2222
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.mjs
2223
+ /** `[Json]` Intrinsic function to Uppercase LiteralString types */
2224
+ function Uppercase(T, options = {}) {
2225
+ return Intrinsic(T, "Uppercase", options);
2226
+ }
2227
+ //#endregion
2228
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.mjs
2229
+ function FromProperties$7(properties, propertyKeys, options) {
2230
+ const result = {};
2231
+ for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) result[K2] = Omit(properties[K2], propertyKeys, Clone(options));
2232
+ return result;
2233
+ }
2234
+ function FromMappedResult$3(mappedResult, propertyKeys, options) {
2235
+ return FromProperties$7(mappedResult.properties, propertyKeys, options);
2236
+ }
2237
+ function OmitFromMappedResult(mappedResult, propertyKeys, options) {
2238
+ return MappedResult(FromMappedResult$3(mappedResult, propertyKeys, options));
2239
+ }
2240
+ //#endregion
2241
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/omit/omit.mjs
2242
+ function FromIntersect$2(types, propertyKeys) {
2243
+ return types.map((type) => OmitResolve(type, propertyKeys));
2244
+ }
2245
+ function FromUnion$2(types, propertyKeys) {
2246
+ return types.map((type) => OmitResolve(type, propertyKeys));
2247
+ }
2248
+ function FromProperty(properties, key) {
2249
+ const { [key]: _, ...R } = properties;
2250
+ return R;
2251
+ }
2252
+ function FromProperties$6(properties, propertyKeys) {
2253
+ return propertyKeys.reduce((T, K2) => FromProperty(T, K2), properties);
2254
+ }
2255
+ function FromObject$4(type, propertyKeys, properties) {
2256
+ const options = Discard(type, [
2257
+ TransformKind,
2258
+ "$id",
2259
+ "required",
2260
+ "properties"
2261
+ ]);
2262
+ return Object$1(FromProperties$6(properties, propertyKeys), options);
2263
+ }
2264
+ function UnionFromPropertyKeys$1(propertyKeys) {
2265
+ return Union(propertyKeys.reduce((result, key) => IsLiteralValue$1(key) ? [...result, Literal(key)] : result, []));
2266
+ }
2267
+ function OmitResolve(type, propertyKeys) {
2268
+ return IsIntersect$1(type) ? Intersect(FromIntersect$2(type.allOf, propertyKeys)) : IsUnion$1(type) ? Union(FromUnion$2(type.anyOf, propertyKeys)) : IsObject$1(type) ? FromObject$4(type, propertyKeys, type.properties) : Object$1({});
2269
+ }
2270
+ /** `[Json]` Constructs a type whose keys are picked from the given type */
2271
+ function Omit(type, key, options) {
2272
+ const typeKey = IsArray$3(key) ? UnionFromPropertyKeys$1(key) : key;
2273
+ const propertyKeys = IsSchema$1(key) ? IndexPropertyKeys(key) : key;
2274
+ const isTypeRef = IsRef$1(type);
2275
+ const isKeyRef = IsRef$1(key);
2276
+ return IsMappedResult$1(type) ? OmitFromMappedResult(type, propertyKeys, options) : IsMappedKey$1(key) ? OmitFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Omit", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Omit", [type, typeKey], options) : CreateType({
2277
+ ...OmitResolve(type, propertyKeys),
2278
+ ...options
2279
+ });
2280
+ }
2281
+ //#endregion
2282
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs
2283
+ function FromPropertyKey$1(type, key, options) {
2284
+ return { [key]: Omit(type, [key], Clone(options)) };
2285
+ }
2286
+ function FromPropertyKeys$1(type, propertyKeys, options) {
2287
+ return propertyKeys.reduce((Acc, LK) => {
2288
+ return {
2289
+ ...Acc,
2290
+ ...FromPropertyKey$1(type, LK, options)
2291
+ };
2292
+ }, {});
2293
+ }
2294
+ function FromMappedKey$1(type, mappedKey, options) {
2295
+ return FromPropertyKeys$1(type, mappedKey.keys, options);
2296
+ }
2297
+ function OmitFromMappedKey(type, mappedKey, options) {
2298
+ return MappedResult(FromMappedKey$1(type, mappedKey, options));
2299
+ }
2300
+ //#endregion
2301
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.mjs
2302
+ function FromProperties$5(properties, propertyKeys, options) {
2303
+ const result = {};
2304
+ for (const K2 of globalThis.Object.getOwnPropertyNames(properties)) result[K2] = Pick(properties[K2], propertyKeys, Clone(options));
2305
+ return result;
2306
+ }
2307
+ function FromMappedResult$2(mappedResult, propertyKeys, options) {
2308
+ return FromProperties$5(mappedResult.properties, propertyKeys, options);
2309
+ }
2310
+ function PickFromMappedResult(mappedResult, propertyKeys, options) {
2311
+ return MappedResult(FromMappedResult$2(mappedResult, propertyKeys, options));
2312
+ }
2313
+ //#endregion
2314
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/pick/pick.mjs
2315
+ function FromIntersect$1(types, propertyKeys) {
2316
+ return types.map((type) => PickResolve(type, propertyKeys));
2317
+ }
2318
+ function FromUnion$1(types, propertyKeys) {
2319
+ return types.map((type) => PickResolve(type, propertyKeys));
2320
+ }
2321
+ function FromProperties$4(properties, propertyKeys) {
2322
+ const result = {};
2323
+ for (const K2 of propertyKeys) if (K2 in properties) result[K2] = properties[K2];
2324
+ return result;
2325
+ }
2326
+ function FromObject$3(Type, keys, properties) {
2327
+ const options = Discard(Type, [
2328
+ TransformKind,
2329
+ "$id",
2330
+ "required",
2331
+ "properties"
2332
+ ]);
2333
+ return Object$1(FromProperties$4(properties, keys), options);
2334
+ }
2335
+ function UnionFromPropertyKeys(propertyKeys) {
2336
+ return Union(propertyKeys.reduce((result, key) => IsLiteralValue$1(key) ? [...result, Literal(key)] : result, []));
2337
+ }
2338
+ function PickResolve(type, propertyKeys) {
2339
+ return IsIntersect$1(type) ? Intersect(FromIntersect$1(type.allOf, propertyKeys)) : IsUnion$1(type) ? Union(FromUnion$1(type.anyOf, propertyKeys)) : IsObject$1(type) ? FromObject$3(type, propertyKeys, type.properties) : Object$1({});
2340
+ }
2341
+ /** `[Json]` Constructs a type whose keys are picked from the given type */
2342
+ function Pick(type, key, options) {
2343
+ const typeKey = IsArray$3(key) ? UnionFromPropertyKeys(key) : key;
2344
+ const propertyKeys = IsSchema$1(key) ? IndexPropertyKeys(key) : key;
2345
+ const isTypeRef = IsRef$1(type);
2346
+ const isKeyRef = IsRef$1(key);
2347
+ return IsMappedResult$1(type) ? PickFromMappedResult(type, propertyKeys, options) : IsMappedKey$1(key) ? PickFromMappedKey(type, key, options) : isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : !isTypeRef && isKeyRef ? Computed("Pick", [type, typeKey], options) : isTypeRef && !isKeyRef ? Computed("Pick", [type, typeKey], options) : CreateType({
2348
+ ...PickResolve(type, propertyKeys),
2349
+ ...options
2350
+ });
2351
+ }
2352
+ //#endregion
2353
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs
2354
+ function FromPropertyKey(type, key, options) {
2355
+ return { [key]: Pick(type, [key], Clone(options)) };
2356
+ }
2357
+ function FromPropertyKeys(type, propertyKeys, options) {
2358
+ return propertyKeys.reduce((result, leftKey) => {
2359
+ return {
2360
+ ...result,
2361
+ ...FromPropertyKey(type, leftKey, options)
2362
+ };
2363
+ }, {});
2364
+ }
2365
+ function FromMappedKey(type, mappedKey, options) {
2366
+ return FromPropertyKeys(type, mappedKey.keys, options);
2367
+ }
2368
+ function PickFromMappedKey(type, mappedKey, options) {
2369
+ return MappedResult(FromMappedKey(type, mappedKey, options));
2370
+ }
2371
+ //#endregion
2372
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/partial/partial.mjs
2373
+ function FromComputed$2(target, parameters) {
2374
+ return Computed("Partial", [Computed(target, parameters)]);
2375
+ }
2376
+ function FromRef$1($ref) {
2377
+ return Computed("Partial", [Ref($ref)]);
2378
+ }
2379
+ function FromProperties$3(properties) {
2380
+ const partialProperties = {};
2381
+ for (const K of globalThis.Object.getOwnPropertyNames(properties)) partialProperties[K] = Optional(properties[K]);
2382
+ return partialProperties;
2383
+ }
2384
+ function FromObject$2(type, properties) {
2385
+ const options = Discard(type, [
2386
+ TransformKind,
2387
+ "$id",
2388
+ "required",
2389
+ "properties"
2390
+ ]);
2391
+ return Object$1(FromProperties$3(properties), options);
2392
+ }
2393
+ function FromRest$1(types) {
2394
+ return types.map((type) => PartialResolve(type));
2395
+ }
2396
+ function PartialResolve(type) {
2397
+ return IsComputed$1(type) ? FromComputed$2(type.target, type.parameters) : IsRef$1(type) ? FromRef$1(type.$ref) : IsIntersect$1(type) ? Intersect(FromRest$1(type.allOf)) : IsUnion$1(type) ? Union(FromRest$1(type.anyOf)) : IsObject$1(type) ? FromObject$2(type, type.properties) : IsBigInt$1(type) ? type : IsBoolean$1(type) ? type : IsInteger$1(type) ? type : IsLiteral$1(type) ? type : IsNull$1(type) ? type : IsNumber$1(type) ? type : IsString$1(type) ? type : IsSymbol$1(type) ? type : IsUndefined$1(type) ? type : Object$1({});
2398
+ }
2399
+ /** `[Json]` Constructs a type where all properties are optional */
2400
+ function Partial(type, options) {
2401
+ if (IsMappedResult$1(type)) return PartialFromMappedResult(type, options);
2402
+ else return CreateType({
2403
+ ...PartialResolve(type),
2404
+ ...options
2405
+ });
2406
+ }
2407
+ //#endregion
2408
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.mjs
2409
+ function FromProperties$2(K, options) {
2410
+ const Acc = {};
2411
+ for (const K2 of globalThis.Object.getOwnPropertyNames(K)) Acc[K2] = Partial(K[K2], Clone(options));
2412
+ return Acc;
2413
+ }
2414
+ function FromMappedResult$1(R, options) {
2415
+ return FromProperties$2(R.properties, options);
2416
+ }
2417
+ function PartialFromMappedResult(R, options) {
2418
+ return MappedResult(FromMappedResult$1(R, options));
2419
+ }
2420
+ //#endregion
2421
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/required/required.mjs
2422
+ function FromComputed$1(target, parameters) {
2423
+ return Computed("Required", [Computed(target, parameters)]);
2424
+ }
2425
+ function FromRef($ref) {
2426
+ return Computed("Required", [Ref($ref)]);
2427
+ }
2428
+ function FromProperties$1(properties) {
2429
+ const requiredProperties = {};
2430
+ for (const K of globalThis.Object.getOwnPropertyNames(properties)) requiredProperties[K] = Discard(properties[K], [OptionalKind]);
2431
+ return requiredProperties;
2432
+ }
2433
+ function FromObject$1(type, properties) {
2434
+ const options = Discard(type, [
2435
+ TransformKind,
2436
+ "$id",
2437
+ "required",
2438
+ "properties"
2439
+ ]);
2440
+ return Object$1(FromProperties$1(properties), options);
2441
+ }
2442
+ function FromRest(types) {
2443
+ return types.map((type) => RequiredResolve(type));
2444
+ }
2445
+ function RequiredResolve(type) {
2446
+ return IsComputed$1(type) ? FromComputed$1(type.target, type.parameters) : IsRef$1(type) ? FromRef(type.$ref) : IsIntersect$1(type) ? Intersect(FromRest(type.allOf)) : IsUnion$1(type) ? Union(FromRest(type.anyOf)) : IsObject$1(type) ? FromObject$1(type, type.properties) : IsBigInt$1(type) ? type : IsBoolean$1(type) ? type : IsInteger$1(type) ? type : IsLiteral$1(type) ? type : IsNull$1(type) ? type : IsNumber$1(type) ? type : IsString$1(type) ? type : IsSymbol$1(type) ? type : IsUndefined$1(type) ? type : Object$1({});
2447
+ }
2448
+ /** `[Json]` Constructs a type where all properties are required */
2449
+ function Required(type, options) {
2450
+ if (IsMappedResult$1(type)) return RequiredFromMappedResult(type, options);
2451
+ else return CreateType({
2452
+ ...RequiredResolve(type),
2453
+ ...options
2454
+ });
2455
+ }
2456
+ //#endregion
2457
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.mjs
2458
+ function FromProperties(P, options) {
2459
+ const Acc = {};
2460
+ for (const K2 of globalThis.Object.getOwnPropertyNames(P)) Acc[K2] = Required(P[K2], options);
2461
+ return Acc;
2462
+ }
2463
+ function FromMappedResult(R, options) {
2464
+ return FromProperties(R.properties, options);
2465
+ }
2466
+ function RequiredFromMappedResult(R, options) {
2467
+ return MappedResult(FromMappedResult(R, options));
2468
+ }
2469
+ //#endregion
2470
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/module/compute.mjs
2471
+ function DereferenceParameters(moduleProperties, types) {
2472
+ return types.map((type) => {
2473
+ return IsRef$1(type) ? Dereference(moduleProperties, type.$ref) : FromType(moduleProperties, type);
2474
+ });
2475
+ }
2476
+ function Dereference(moduleProperties, ref) {
2477
+ return ref in moduleProperties ? IsRef$1(moduleProperties[ref]) ? Dereference(moduleProperties, moduleProperties[ref].$ref) : FromType(moduleProperties, moduleProperties[ref]) : Never();
2478
+ }
2479
+ function FromAwaited(parameters) {
2480
+ return Awaited(parameters[0]);
2481
+ }
2482
+ function FromIndex(parameters) {
2483
+ return Index(parameters[0], parameters[1]);
2484
+ }
2485
+ function FromKeyOf(parameters) {
2486
+ return KeyOf(parameters[0]);
2487
+ }
2488
+ function FromPartial(parameters) {
2489
+ return Partial(parameters[0]);
2490
+ }
2491
+ function FromOmit(parameters) {
2492
+ return Omit(parameters[0], parameters[1]);
2493
+ }
2494
+ function FromPick(parameters) {
2495
+ return Pick(parameters[0], parameters[1]);
2496
+ }
2497
+ function FromRequired(parameters) {
2498
+ return Required(parameters[0]);
2499
+ }
2500
+ function FromComputed(moduleProperties, target, parameters) {
2501
+ const dereferenced = DereferenceParameters(moduleProperties, parameters);
2502
+ 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();
2503
+ }
2504
+ function FromArray(moduleProperties, type) {
2505
+ return Array$1(FromType(moduleProperties, type));
2506
+ }
2507
+ function FromAsyncIterator(moduleProperties, type) {
2508
+ return AsyncIterator(FromType(moduleProperties, type));
2509
+ }
2510
+ function FromConstructor(moduleProperties, parameters, instanceType) {
2511
+ return Constructor(FromTypes(moduleProperties, parameters), FromType(moduleProperties, instanceType));
2512
+ }
2513
+ function FromFunction(moduleProperties, parameters, returnType) {
2514
+ return Function(FromTypes(moduleProperties, parameters), FromType(moduleProperties, returnType));
2515
+ }
2516
+ function FromIntersect(moduleProperties, types) {
2517
+ return Intersect(FromTypes(moduleProperties, types));
2518
+ }
2519
+ function FromIterator(moduleProperties, type) {
2520
+ return Iterator(FromType(moduleProperties, type));
2521
+ }
2522
+ function FromObject(moduleProperties, properties) {
2523
+ return Object$1(globalThis.Object.keys(properties).reduce((result, key) => {
2524
+ return {
2525
+ ...result,
2526
+ [key]: FromType(moduleProperties, properties[key])
2527
+ };
2528
+ }, {}));
2529
+ }
2530
+ function FromRecord(moduleProperties, type) {
2531
+ const [value, pattern] = [FromType(moduleProperties, RecordValue(type)), RecordPattern(type)];
2532
+ const result = CloneType(type);
2533
+ result.patternProperties[pattern] = value;
2534
+ return result;
2535
+ }
2536
+ function FromTransform(moduleProperties, transform) {
2537
+ return IsRef$1(transform) ? {
2538
+ ...Dereference(moduleProperties, transform.$ref),
2539
+ [TransformKind]: transform[TransformKind]
2540
+ } : transform;
2541
+ }
2542
+ function FromTuple(moduleProperties, types) {
2543
+ return Tuple(FromTypes(moduleProperties, types));
2544
+ }
2545
+ function FromUnion(moduleProperties, types) {
2546
+ return Union(FromTypes(moduleProperties, types));
2547
+ }
2548
+ function FromTypes(moduleProperties, types) {
2549
+ return types.map((type) => FromType(moduleProperties, type));
2550
+ }
2551
+ function FromType(moduleProperties, type) {
2552
+ return IsOptional$1(type) ? CreateType(FromType(moduleProperties, Discard(type, [OptionalKind])), type) : IsReadonly(type) ? CreateType(FromType(moduleProperties, Discard(type, [ReadonlyKind])), type) : IsTransform$1(type) ? CreateType(FromTransform(moduleProperties, type), type) : IsArray$1(type) ? CreateType(FromArray(moduleProperties, type.items), type) : IsAsyncIterator$1(type) ? CreateType(FromAsyncIterator(moduleProperties, type.items), type) : IsComputed$1(type) ? CreateType(FromComputed(moduleProperties, type.target, type.parameters)) : IsConstructor$1(type) ? CreateType(FromConstructor(moduleProperties, type.parameters, type.returns), type) : IsFunction$1(type) ? CreateType(FromFunction(moduleProperties, type.parameters, type.returns), type) : IsIntersect$1(type) ? CreateType(FromIntersect(moduleProperties, type.allOf), type) : IsIterator$1(type) ? CreateType(FromIterator(moduleProperties, type.items), type) : IsObject$1(type) ? CreateType(FromObject(moduleProperties, type.properties), type) : IsRecord$1(type) ? CreateType(FromRecord(moduleProperties, type)) : IsTuple$1(type) ? CreateType(FromTuple(moduleProperties, type.items || []), type) : IsUnion$1(type) ? CreateType(FromUnion(moduleProperties, type.anyOf), type) : type;
2553
+ }
2554
+ function ComputeType(moduleProperties, key) {
2555
+ return key in moduleProperties ? FromType(moduleProperties, moduleProperties[key]) : Never();
2556
+ }
2557
+ function ComputeModuleProperties(moduleProperties) {
2558
+ return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => {
2559
+ return {
2560
+ ...result,
2561
+ [key]: ComputeType(moduleProperties, key)
2562
+ };
2563
+ }, {});
2564
+ }
2565
+ //#endregion
2566
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/module/module.mjs
2567
+ var TModule = class {
2568
+ constructor($defs) {
2569
+ const computed = ComputeModuleProperties($defs);
2570
+ this.$defs = this.WithIdentifiers(computed);
2571
+ }
2572
+ /** `[Json]` Imports a Type by Key. */
2573
+ Import(key, options) {
2574
+ const $defs = {
2575
+ ...this.$defs,
2576
+ [key]: CreateType(this.$defs[key], options)
2577
+ };
2578
+ return CreateType({
2579
+ [Kind]: "Import",
2580
+ $defs,
2581
+ $ref: key
2582
+ });
2583
+ }
2584
+ WithIdentifiers($defs) {
2585
+ return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => {
2586
+ return {
2587
+ ...result,
2588
+ [key]: {
2589
+ ...$defs[key],
2590
+ $id: key
2591
+ }
2592
+ };
2593
+ }, {});
2594
+ }
2595
+ };
2596
+ /** `[Json]` Creates a Type Definition Module. */
2597
+ function Module(properties) {
2598
+ return new TModule(properties);
2599
+ }
2600
+ //#endregion
2601
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/not/not.mjs
2602
+ /** `[Json]` Creates a Not type */
2603
+ function Not(type, options) {
2604
+ return CreateType({
2605
+ [Kind]: "Not",
2606
+ not: type
2607
+ }, options);
2608
+ }
2609
+ //#endregion
2610
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.mjs
2611
+ /** `[JavaScript]` Extracts the Parameters from the given Function type */
2612
+ function Parameters(schema, options) {
2613
+ return IsFunction$1(schema) ? Tuple(schema.parameters, options) : Never();
2614
+ }
2615
+ //#endregion
2616
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.mjs
2617
+ let Ordinal = 0;
2618
+ /** `[Json]` Creates a Recursive type */
2619
+ function Recursive(callback, options = {}) {
2620
+ if (IsUndefined$3(options.$id)) options.$id = `T${Ordinal++}`;
2621
+ const thisType = CloneType(callback({
2622
+ [Kind]: "This",
2623
+ $ref: `${options.$id}`
2624
+ }));
2625
+ thisType.$id = options.$id;
2626
+ return CreateType({
2627
+ [Hint]: "Recursive",
2628
+ ...thisType
2629
+ }, options);
2630
+ }
2631
+ //#endregion
2632
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.mjs
2633
+ /** `[JavaScript]` Creates a RegExp type */
2634
+ function RegExp$1(unresolved, options) {
2635
+ const expr = IsString$2(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
2636
+ return CreateType({
2637
+ [Kind]: "RegExp",
2638
+ type: "RegExp",
2639
+ source: expr.source,
2640
+ flags: expr.flags
2641
+ }, options);
2642
+ }
2643
+ //#endregion
2644
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/rest/rest.mjs
2645
+ function RestResolve(T) {
2646
+ return IsIntersect$1(T) ? T.allOf : IsUnion$1(T) ? T.anyOf : IsTuple$1(T) ? T.items ?? [] : [];
2647
+ }
2648
+ /** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */
2649
+ function Rest(T) {
2650
+ return RestResolve(T);
2651
+ }
2652
+ //#endregion
2653
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.mjs
2654
+ /** `[JavaScript]` Extracts the ReturnType from the given Function type */
2655
+ function ReturnType(schema, options) {
2656
+ return IsFunction$1(schema) ? CreateType(schema.returns, options) : Never(options);
2657
+ }
2658
+ //#endregion
2659
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/transform/transform.mjs
2660
+ var TransformDecodeBuilder = class {
2661
+ constructor(schema) {
2662
+ this.schema = schema;
2663
+ }
2664
+ Decode(decode) {
2665
+ return new TransformEncodeBuilder(this.schema, decode);
2666
+ }
2667
+ };
2668
+ var TransformEncodeBuilder = class {
2669
+ constructor(schema, decode) {
2670
+ this.schema = schema;
2671
+ this.decode = decode;
2672
+ }
2673
+ EncodeTransform(encode, schema) {
2674
+ const Encode = (value) => schema[TransformKind].Encode(encode(value));
2675
+ const Decode = (value) => this.decode(schema[TransformKind].Decode(value));
2676
+ const Codec = {
2677
+ Encode,
2678
+ Decode
2679
+ };
2680
+ return {
2681
+ ...schema,
2682
+ [TransformKind]: Codec
2683
+ };
2684
+ }
2685
+ EncodeSchema(encode, schema) {
2686
+ const Codec = {
2687
+ Decode: this.decode,
2688
+ Encode: encode
2689
+ };
2690
+ return {
2691
+ ...schema,
2692
+ [TransformKind]: Codec
2693
+ };
2694
+ }
2695
+ Encode(encode) {
2696
+ return IsTransform$1(this.schema) ? this.EncodeTransform(encode, this.schema) : this.EncodeSchema(encode, this.schema);
2697
+ }
2698
+ };
2699
+ /** `[Json]` Creates a Transform type */
2700
+ function Transform(schema) {
2701
+ return new TransformDecodeBuilder(schema);
2702
+ }
2703
+ //#endregion
2704
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.mjs
2705
+ /** `[Json]` Creates a Unsafe type that will infers as the generic argument T */
2706
+ function Unsafe(options = {}) {
2707
+ return CreateType({ [Kind]: options[Kind] ?? "Unsafe" }, options);
2708
+ }
2709
+ //#endregion
2710
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/void/void.mjs
2711
+ /** `[JavaScript]` Creates a Void type */
2712
+ function Void(options) {
2713
+ return CreateType({
2714
+ [Kind]: "Void",
2715
+ type: "void"
2716
+ }, options);
2717
+ }
2718
+ //#endregion
2719
+ //#region ../../node_modules/.pnpm/@sinclair+typebox@0.34.48/node_modules/@sinclair/typebox/build/esm/type/type/index.mjs
2720
+ /** JavaScript Type Builder with Static Resolution for TypeScript */
2721
+ const Type = /* @__PURE__ */ __exportAll({
2722
+ Any: () => Any,
2723
+ Argument: () => Argument,
2724
+ Array: () => Array$1,
2725
+ AsyncIterator: () => AsyncIterator,
2726
+ Awaited: () => Awaited,
2727
+ BigInt: () => BigInt,
2728
+ Boolean: () => Boolean,
2729
+ Capitalize: () => Capitalize,
2730
+ Composite: () => Composite,
2731
+ Const: () => Const,
2732
+ Constructor: () => Constructor,
2733
+ ConstructorParameters: () => ConstructorParameters,
2734
+ Date: () => Date$1,
2735
+ Enum: () => Enum,
2736
+ Exclude: () => Exclude,
2737
+ Extends: () => Extends,
2738
+ Extract: () => Extract,
2739
+ Function: () => Function,
2740
+ Index: () => Index,
2741
+ InstanceType: () => InstanceType,
2742
+ Instantiate: () => Instantiate,
2743
+ Integer: () => Integer,
2744
+ Intersect: () => Intersect,
2745
+ Iterator: () => Iterator,
2746
+ KeyOf: () => KeyOf,
2747
+ Literal: () => Literal,
2748
+ Lowercase: () => Lowercase,
2749
+ Mapped: () => Mapped,
2750
+ Module: () => Module,
2751
+ Never: () => Never,
2752
+ Not: () => Not,
2753
+ Null: () => Null,
2754
+ Number: () => Number$1,
2755
+ Object: () => Object$1,
2756
+ Omit: () => Omit,
2757
+ Optional: () => Optional,
2758
+ Parameters: () => Parameters,
2759
+ Partial: () => Partial,
2760
+ Pick: () => Pick,
2761
+ Promise: () => Promise$1,
2762
+ Readonly: () => Readonly,
2763
+ ReadonlyOptional: () => ReadonlyOptional,
2764
+ Record: () => Record,
2765
+ Recursive: () => Recursive,
2766
+ Ref: () => Ref,
2767
+ RegExp: () => RegExp$1,
2768
+ Required: () => Required,
2769
+ Rest: () => Rest,
2770
+ ReturnType: () => ReturnType,
2771
+ String: () => String$1,
2772
+ Symbol: () => Symbol$1,
2773
+ TemplateLiteral: () => TemplateLiteral,
2774
+ Transform: () => Transform,
2775
+ Tuple: () => Tuple,
2776
+ Uint8Array: () => Uint8Array$1,
2777
+ Uncapitalize: () => Uncapitalize,
2778
+ Undefined: () => Undefined,
2779
+ Union: () => Union,
2780
+ Unknown: () => Unknown,
2781
+ Unsafe: () => Unsafe,
2782
+ Uppercase: () => Uppercase,
2783
+ Void: () => Void
2784
+ });
2785
+ //#endregion
9
2786
  //#region src/types.ts
10
2787
  function isIPCRequest(msg) {
11
2788
  return typeof msg === "object" && msg !== null && msg.type === "req" && typeof msg.id === "string" && typeof msg.method === "string";
@@ -467,4 +3244,4 @@ const plugin = {
467
3244
  }
468
3245
  };
469
3246
  //#endregion
470
- export { isIPCEvent as a, PROTOCOL_VERSION as i, registerWithDaemon as n, isIPCRequest as o, IPCClient as r, isIPCResponse as s, plugin as t };
3247
+ export { isIPCEvent as a, __commonJSMin as c, PROTOCOL_VERSION as i, __require as l, registerWithDaemon as n, isIPCRequest as o, IPCClient as r, isIPCResponse as s, plugin as t, __toESM as u };