clanka 0.16.1 → 0.17.1

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 (85) hide show
  1. package/README.md +61 -0
  2. package/dist/Agent.d.ts.map +1 -1
  3. package/dist/Agent.js +5 -1
  4. package/dist/Agent.js.map +1 -1
  5. package/dist/AgentCallerConfig.test.js +5 -3
  6. package/dist/AgentCallerConfig.test.js.map +1 -1
  7. package/dist/ChunkRepo.d.ts +1 -1
  8. package/dist/ClaudeAgent.d.ts +111 -0
  9. package/dist/ClaudeAgent.d.ts.map +1 -0
  10. package/dist/ClaudeAgent.js +772 -0
  11. package/dist/ClaudeAgent.js.map +1 -0
  12. package/dist/ClaudeAgent.test.d.ts +2 -0
  13. package/dist/ClaudeAgent.test.d.ts.map +1 -0
  14. package/dist/ClaudeAgent.test.js +416 -0
  15. package/dist/ClaudeAgent.test.js.map +1 -0
  16. package/dist/Compaction.test.js +2 -1
  17. package/dist/Compaction.test.js.map +1 -1
  18. package/dist/CompactionTokens.test.js +15 -8
  19. package/dist/CompactionTokens.test.js.map +1 -1
  20. package/dist/ModelLayer.d.ts +2 -2
  21. package/dist/ModelLayer.d.ts.map +1 -1
  22. package/dist/ModelLayer.js +13 -7
  23. package/dist/ModelLayer.js.map +1 -1
  24. package/dist/ModelLayer.test.js +3 -0
  25. package/dist/ModelLayer.test.js.map +1 -1
  26. package/dist/ModelsRepo.d.ts +7 -6
  27. package/dist/ModelsRepo.d.ts.map +1 -1
  28. package/dist/ModelsRepo.js +44 -27
  29. package/dist/ModelsRepo.js.map +1 -1
  30. package/dist/ModelsRepo.test.js +47 -3
  31. package/dist/ModelsRepo.test.js.map +1 -1
  32. package/dist/bin/{Effect-4B1lzxy4.mjs → Effect-DNYYQ84C.mjs} +467 -365
  33. package/dist/bin/Effect-DNYYQ84C.mjs.map +1 -0
  34. package/dist/bin/Latch-BSlIwuxI.mjs +7 -0
  35. package/dist/bin/Latch-BSlIwuxI.mjs.map +1 -0
  36. package/dist/bin/{McpClient-DMfHHEx3.mjs → McpClient-C7ctqJWo.mjs} +4 -5
  37. package/dist/bin/{McpClient-DMfHHEx3.mjs.map → McpClient-C7ctqJWo.mjs.map} +1 -1
  38. package/dist/bin/{OutputFormatter-DRycCEdr.mjs → OutputFormatter-DXej05JW.mjs} +8 -13
  39. package/dist/bin/{OutputFormatter-DRycCEdr.mjs.map → OutputFormatter-DXej05JW.mjs.map} +1 -1
  40. package/dist/bin/{Schema-D4fxUgEU.mjs → Schema-CSQN_Zso.mjs} +754 -800
  41. package/dist/bin/Schema-CSQN_Zso.mjs.map +1 -0
  42. package/dist/bin/{SemanticSearch-BcLFv9qz.mjs → SemanticSearch-BiwCnpKX.mjs} +241 -148
  43. package/dist/bin/SemanticSearch-BiwCnpKX.mjs.map +1 -0
  44. package/dist/bin/{Stream-i37nF1ep.mjs → Stream-Dwvj9X5X.mjs} +244 -120
  45. package/dist/bin/Stream-Dwvj9X5X.mjs.map +1 -0
  46. package/dist/bin/cli.mjs +5122 -15959
  47. package/dist/bin/cli.mjs.map +1 -1
  48. package/dist/bin/helpers-CljL9OKa.mjs +7157 -0
  49. package/dist/bin/helpers-CljL9OKa.mjs.map +1 -0
  50. package/dist/bin/index.min-ClUfQ5ji.mjs +3782 -0
  51. package/dist/bin/index.min-ClUfQ5ji.mjs.map +1 -0
  52. package/dist/bin/{rolldown-runtime-zY4HT0JA.mjs → rolldown-runtime-5zChB7MF.mjs} +15 -3
  53. package/dist/bin/server-HlLriZxF.mjs +319 -0
  54. package/dist/bin/server-HlLriZxF.mjs.map +1 -0
  55. package/dist/bin/{turndown.cjs-LntFxFyd.mjs → turndown.cjs-C2WBxeA-.mjs} +56 -110
  56. package/dist/bin/{turndown.cjs-LntFxFyd.mjs.map → turndown.cjs-C2WBxeA-.mjs.map} +1 -1
  57. package/dist/bin/types-LcwjLVkt.mjs +5260 -0
  58. package/dist/bin/types-LcwjLVkt.mjs.map +1 -0
  59. package/dist/bin/upgrade-BSNjCnra.mjs +342 -0
  60. package/dist/bin/upgrade-BSNjCnra.mjs.map +1 -0
  61. package/dist/cli.js +4 -0
  62. package/dist/cli.js.map +1 -1
  63. package/dist/index.d.ts +4 -0
  64. package/dist/index.d.ts.map +1 -1
  65. package/dist/index.js +4 -0
  66. package/dist/index.js.map +1 -1
  67. package/package.json +15 -13
  68. package/src/Agent.ts +7 -1
  69. package/src/AgentCallerConfig.test.ts +5 -3
  70. package/src/ClaudeAgent.test.ts +526 -0
  71. package/src/ClaudeAgent.ts +1113 -0
  72. package/src/Compaction.test.ts +2 -1
  73. package/src/CompactionTokens.test.ts +15 -11
  74. package/src/ModelLayer.test.ts +4 -0
  75. package/src/ModelLayer.ts +21 -15
  76. package/src/ModelsRepo.test.ts +69 -3
  77. package/src/ModelsRepo.ts +24 -8
  78. package/src/cli.ts +4 -0
  79. package/src/index.ts +5 -0
  80. package/dist/bin/Effect-4B1lzxy4.mjs.map +0 -1
  81. package/dist/bin/Schema-D4fxUgEU.mjs.map +0 -1
  82. package/dist/bin/SemanticSearch-BcLFv9qz.mjs.map +0 -1
  83. package/dist/bin/Stream-i37nF1ep.mjs.map +0 -1
  84. package/dist/bin/index.min-Bkz7vIWv.mjs +0 -3300
  85. package/dist/bin/index.min-Bkz7vIWv.mjs.map +0 -1
@@ -1,8 +1,7 @@
1
- import { $o as Tuple$1, $s as isNotNullish, $t as tryPromise, Ao as getOrNull, As as redact$2, Ba as isFailure, Bi as iterateConcurrent, Bs as optimize, Ci as currentTimeMillis$1, Da as map$3, Ds as formatPath, Ea as makeEquivalence$3, Ec as pipeArguments, Eo as fromNullOr, Es as formatJson, F as failCauseSync, Fa as fail$1, Fo as isSome, Fs as symbol$2, Gi as map$2, Go as Date$3, Gs as hasProperty, H as fnUntracedEager, Ha as map$6, Ho as some, Hs as structure, Io as liftThrowable, Is as array, It as runSyncExit, Jo as isGreaterThan$1, Js as isError, Ki as monotonicTimeNanos$1, Ko as Number$4, Ks as isBigInt, Kt as suspend$1, L as flatMap, La as flatMap$1, Lo as map$4, Ls as combine, M as exit, Ms as asEquivalence, N as fail$2, No as isNone, Os as formatPropertyKey, Po as isOption, Ps as equals, Qo as make$10, R as flatMapEager, Ra as getOrThrow, Ro as match, Rs as hash, Sa as isReadonlyArrayNonEmpty, Sc as memoizeIdempotent, So as filter, Ss as NodeInspectSymbol, Tc as Prototype, To as flatten, Ts as formatDate, Ua as match$1, Us as structureKeys, Ut as succeed$3, Va as isSuccess$1, Vi as iterateEager, Vs as string$1, Wa as succeed$1, Wn as remainder, Wo as BigInt$4, Ws as symbol$1, Wt as succeedNone, Xa as isDuration, Xo as isLessThan$1, Y as fromResult, Ya as infinity, Yi as resolveConcurrency, Yo as isGreaterThanOrEqualTo$1, Ys as isFunction, Za as isFinite$2, Zo as isLessThanOrEqualTo$1, Zs as isNever$1, _r as makeInterruptReason, _s as assignProperty$1, aa as encode$1, ac as isObjectKeyword, ao as toMillis, as as PipeInspectableProto, ba as isArrayNonEmpty, bc as identity, bs as BaseProto, cc as isSymbol, ci as failCause, co as Reference, ct as mapBothEager, dc as isUnknown, di as isExit, do as empty$3, dt as mapErrorEager, ec as isNotUndefined, en as try_, eo as millis, er as die$1, es as make$9, fa as dedupe, fo as get, fr as isFailReason, gi as ClockRef, gr as makeFailReason, gs as assignProperties, hi as void_$1, hr as makeDieReason, ic as isObject, io as seconds, is as Error$3, js as symbolRedactable, k as die, ks as currentFiberTypeId, lc as isTagged, lt as mapEager, m as catchCause, mi as succeed$2, no as nanos, oc as isPropertyKey, oo as toSeconds, or as fromReasons, os as TaggedError$2, pa as empty$4, pi as isSuccess, pr as isReason, qa as fromInputUnsafe, qn as IllegalArgumentError, qo as String$4, qs as isBoolean, rc as isNumber, ro as negativeInfinity, sc as isString$1, si as fail$3, sn as void_$2, ss as args, ts as strictEqual, ua as append, ur as isCause, va as fromIterable$1, vc as dual, vr as map$5, vs as getStackTraceLimit, wc as Class$2, wi as effectIsExit, ws as format$1, xc as memoize, ys as setStackTraceLimit, zo as none, zs as number$1 } from "./Effect-4B1lzxy4.mjs";
2
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Tuple.js
1
+ import { $i as resolveConcurrency, $o as some, Aa as isReadonlyArrayNonEmpty, As as getStackTraceLimit, Bs as formatPropertyKey, Di as currentTimeMillis$1, Fa as map$3, Fc as memoizeIdempotent, Ga as flatMap$1, Gi as iterateEager, Go as isOption, H as fnUntracedEager, Hs as redact$2, Io as flatten, Is as format$1, Ja as isFailure, Jo as map$4, Js as array, Ka as getOrThrow, Ko as isSome, Ks as equals, Kt as succeed$3, L as flatMap, Lc as Class$2, Lo as fromNullOr, Ls as formatDate, M as fail$2, Ms as BaseProto, Nc as identity, No as filter, O as die, Oa as isArrayNonEmpty, Oi as effectIsExit, Os as assignProperties, P as failCauseSync, Pa as makeEquivalence$3, Pc as memoize, Ps as NodeInspectSymbol, Qa as succeed$1, Qs as optimize, R as flatMapEager, Rc as Prototype, Rs as formatJson, Sc as isTagged, So as get, Ta as fromIterable$1, Ua as fail$1, Us as symbolRedactable, Vo as getOrNull, Vs as currentFiberTypeId, Wi as iterateConcurrent, Wo as isNone, Ws as asEquivalence, X as fromResult, Xa as map$6, Xi as monotonicTimeNanos$1, Xn as IllegalArgumentError, Xo as none, Xs as hash, Ya as isSuccess$1, Yi as map$2, Yo as match, Ys as combine, Yt as suspend$1, Za as match$1, Zs as number$1, _c as isObject, _i as isSuccess, _s as PipeInspectableProto, ac as isBigInt, ao as infinity, as as isGreaterThan$1, bc as isString$1, bi as ClockRef, br as makeInterruptReason, cc as isFunction, cr as fromReasons, cs as isLessThanOrEqualTo$1, da as encode$1, di as fail$3, dn as void_$2, ds as Tuple$1, dt as mapEager, ec as string$1, fc as isNotNullish, fi as failCause, fo as nanos, fr as isCause, fs as make$9, ga as append, gc as isNumber, go as toSeconds, gr as isReason, gs as Error$3, hi as isExit, ho as toMillis, hr as isFailReason, ic as hasProperty, in as try_, is as String$4, j as exit, jc as dual, js as setStackTraceLimit, ks as assignProperty$1, ls as make$10, m as catchCause, mo as seconds, nc as structureKeys, ns as Date$3, oc as isBoolean, oo as isDuration, os as isGreaterThanOrEqualTo$1, pc as isNotUndefined, po as negativeInfinity, ps as strictEqual, pt as mapErrorEager, qn as remainder, qo as liftThrowable, qs as symbol$2, qt as succeedNone, rc as symbol$1, rn as tryPromise, ro as fromInputUnsafe, rr as die$1, rs as Number$4, sc as isError, so as isFinite$2, ss as isLessThan$1, tc as structure, ts as BigInt$4, uc as isNever$1, uo as millis, ut as mapBothEager, va as dedupe, vc as isObjectKeyword, vi as succeed$2, vo as Reference, vr as makeDieReason, vs as TaggedError$2, wc as isUnknown, xc as isSymbol, xo as empty$3, xr as map$5, ya as empty$4, yc as isPropertyKey, yi as void_$1, yr as makeFailReason, ys as args, zc as pipeArguments, zs as formatPath, zt as runSyncExit } from "./Effect-DNYYQ84C.mjs";
2
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Tuple.js
3
3
  const makeEquivalence$2 = Tuple$1;
4
- //#endregion
5
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Record.js
4
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Record.js
6
5
  const has = dual(2, (self, key) => Object.hasOwn(self, key));
7
6
  const map$1 = dual(2, (self, f) => {
8
7
  const out = { ...self };
@@ -19,8 +18,7 @@ const makeEquivalence$1 = (equivalence) => {
19
18
  const is = isSubrecordBy(equivalence);
20
19
  return (self, that) => is(self, that) && is(that, self);
21
20
  };
22
- //#endregion
23
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Data.js
21
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Data.js
24
22
  const Class$1 = class extends Class$2 {
25
23
  constructor(props) {
26
24
  super();
@@ -50,19 +48,16 @@ function taggedMatch() {
50
48
  }
51
49
  const Error$2 = Error$3;
52
50
  const TaggedError$1 = TaggedError$2;
53
- //#endregion
54
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/encoding/EncodingError.js
51
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/encoding/EncodingError.js
55
52
  const EncodingErrorTypeId = "~effect/encoding/EncodingError";
56
53
  var EncodingError = class extends TaggedError$1("EncodingError") {
57
54
  [EncodingErrorTypeId] = EncodingErrorTypeId;
58
55
  };
59
- //#endregion
60
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Clock.js
56
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Clock.js
61
57
  const Clock = ClockRef;
62
58
  const currentTimeMillis = currentTimeMillis$1;
63
59
  const monotonicTimeNanos = monotonicTimeNanos$1;
64
- //#endregion
65
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/dateTime.js
60
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/dateTime.js
66
61
  const TypeId$12 = "~effect/DateTime";
67
62
  const TimeZoneTypeId = "~effect/DateTime/TimeZone";
68
63
  const Proto$4 = {
@@ -149,17 +144,47 @@ const ProtoTimeZoneOffset = {
149
144
  };
150
145
  }
151
146
  };
147
+ const cacheSlot = {
148
+ value: void 0,
149
+ enumerable: false,
150
+ writable: true
151
+ };
152
+ const sealedCaches = new WeakMap();
153
+ const cacheAccessor = (key, slots) => ({
154
+ get() {
155
+ return Object.isExtensible(this) ? void 0 : sealedCaches.get(this)?.[key];
156
+ },
157
+ set(value) {
158
+ if (Object.isExtensible(this)) {
159
+ for (const slot of slots) Object.defineProperty(this, slot, cacheSlot);
160
+ this[key] = value;
161
+ } else {
162
+ let caches = sealedCaches.get(this);
163
+ if (caches === void 0) {
164
+ caches = {};
165
+ sealedCaches.set(this, caches);
166
+ }
167
+ caches[key] = value;
168
+ }
169
+ }
170
+ });
171
+ const zonedSlots = [
172
+ "partsUtc",
173
+ "adjustedEpochMilliseconds",
174
+ "partsAdjusted"
175
+ ];
176
+ Object.defineProperty(ProtoUtc, "partsUtc", cacheAccessor("partsUtc", ["partsUtc"]));
177
+ Object.defineProperties(ProtoZoned, {
178
+ partsUtc: cacheAccessor("partsUtc", zonedSlots),
179
+ adjustedEpochMilliseconds: cacheAccessor("adjustedEpochMilliseconds", zonedSlots),
180
+ partsAdjusted: cacheAccessor("partsAdjusted", zonedSlots)
181
+ });
152
182
  const isDateTime$1 = (u) => hasProperty(u, TypeId$12);
153
183
  const isTimeZone = (u) => hasProperty(u, TimeZoneTypeId);
154
184
  const isUtc$1 = (self) => self._tag === "Utc";
155
185
  const makeUtc = (epochMillis) => {
156
186
  const self = Object.create(ProtoUtc);
157
187
  self.epochMilliseconds = epochMillis;
158
- Object.defineProperty(self, "partsUtc", {
159
- value: void 0,
160
- enumerable: false,
161
- writable: true
162
- });
163
188
  return self;
164
189
  };
165
190
  const fromDateUnsafe$1 = (date) => {
@@ -178,7 +203,7 @@ const makeUnsafe$1 = (input) => {
178
203
  } else if (typeof input === "string" && !hasZone(input)) return fromDateUnsafe$1(new Date(input + "Z"));
179
204
  return fromDateUnsafe$1(new Date(input));
180
205
  };
181
- const hasZone = (input) => /Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(input);
206
+ const hasZone = (input) => /Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(input) || /z$|gmt$/i.test(input);
182
207
  const make$8 = liftThrowable(makeUnsafe$1);
183
208
  const now$1 = map$2(currentTimeMillis, makeUtc);
184
209
  const toUtc$1 = (self) => makeUtc(self.epochMilliseconds);
@@ -187,9 +212,17 @@ const toDate = (self) => {
187
212
  if (self._tag === "Utc") return new Date(self.epochMilliseconds);
188
213
  else if (self.zone._tag === "Offset") return new Date(self.epochMilliseconds + self.zone.offset);
189
214
  else if (self.adjustedEpochMilliseconds !== void 0) return new Date(self.adjustedEpochMilliseconds);
190
- const parts = self.zone.format.formatToParts(self.epochMilliseconds).filter((_) => _.type !== "literal");
215
+ let bc = false;
216
+ const parts = self.zone.format.formatToParts(self.epochMilliseconds).filter((_) => {
217
+ if (_.type === "era") {
218
+ bc = _.value === "BC";
219
+ return false;
220
+ }
221
+ return _.type !== "literal";
222
+ });
223
+ const year = Number(parts[2].value);
191
224
  const date = new Date(0);
192
- date.setUTCFullYear(Number(parts[2].value), Number(parts[0].value) - 1, Number(parts[1].value));
225
+ date.setUTCFullYear(bc ? 1 - year : year, Number(parts[0].value) - 1, Number(parts[1].value));
193
226
  date.setUTCHours(Number(parts[3].value), Number(parts[4].value), Number(parts[5].value), parts[6]?.type === "fractionalSecond" ? Number(parts[6].value) : (self.epochMilliseconds % 1e3 + 1e3) % 1e3);
194
227
  self.adjustedEpochMilliseconds = date.getTime();
195
228
  return date;
@@ -226,22 +259,20 @@ const setPartsDate = (date, parts) => {
226
259
  };
227
260
  const withDate = dual(2, (self, f) => f(toDate(self)));
228
261
  const formatIso$1 = (self) => toDateUtc$1(self).toISOString();
229
- const formatIsoDate$1 = (self) => toDate(self).toISOString().slice(0, 10);
262
+ const formatIsoDate$1 = (self) => toDate(self).toISOString().split("T")[0];
230
263
  const formatIsoOffset = (self) => {
231
264
  const date = toDate(self);
232
265
  return self._tag === "Utc" ? date.toISOString() : `${date.toISOString().slice(0, -1)}${zonedOffsetIso(self)}`;
233
266
  };
234
267
  const formatIsoZoned = (self) => self.zone._tag === "Offset" ? formatIsoOffset(self) : `${formatIsoOffset(self)}[${self.zone.id}]`;
235
- //#endregion
236
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/redacted.js
268
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/redacted.js
237
269
  const redactedRegistry = new WeakMap();
238
270
  const value$1 = (self) => {
239
271
  if (redactedRegistry.has(self)) return redactedRegistry.get(self);
240
272
  else throw new Error("Unable to get redacted value" + (self.label ? ` with label: "${self.label}"` : ""));
241
273
  };
242
274
  const stringOrRedacted = (val) => typeof val === "string" ? val : value$1(val);
243
- //#endregion
244
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Redacted.js
275
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Redacted.js
245
276
  const TypeId$11 = "~effect/Redacted";
246
277
  const isRedacted = (u) => hasProperty(u, TypeId$11);
247
278
  const make$7 = (value, options) => {
@@ -269,8 +300,7 @@ const Proto$3 = {
269
300
  };
270
301
  const value = value$1;
271
302
  const makeEquivalence = (isEquivalent) => make$9((x, y) => isEquivalent(value(x), value(y)));
272
- //#endregion
273
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/BigDecimal.js
303
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/BigDecimal.js
274
304
  const TypeId$10 = "~effect/BigDecimal";
275
305
  const BigDecimalProto = {
276
306
  [TypeId$10]: TypeId$10,
@@ -320,13 +350,17 @@ const normalize = (self) => {
320
350
  if (self.value === bigint0) self.normalized = zero;
321
351
  else {
322
352
  const digits = `${self.value}`;
323
- let end = digits.length;
324
- while (digits[end - 1] === "0") end--;
325
- self.normalized = makeNormalized(BigInt(digits.slice(0, end)), self.scale - (digits.length - end));
353
+ const zeros = trailingZeros(digits);
354
+ self.normalized = makeNormalized(BigInt(digits.slice(0, digits.length - zeros)), self.scale - zeros);
326
355
  }
327
356
  }
328
357
  return self.normalized;
329
358
  };
359
+ const trailingZeros = (digits) => {
360
+ let end = digits.length;
361
+ while (digits[end - 1] === "0") end--;
362
+ return digits.length - end;
363
+ };
330
364
  const MAX_COMPARISON_SCALE_ALIGNMENT = 100;
331
365
  const comparisonPowersOfTen = [bigint1];
332
366
  const compareBigInt = (self, that) => self === that ? 0 : self < that ? -1 : 1;
@@ -373,22 +407,7 @@ const toExponential = (n) => {
373
407
  return `${head}${tail === "" ? "" : `.${tail}`}e${exp >= 0 ? "+" : ""}${exp}`;
374
408
  };
375
409
  const isZero = (n) => n.value === bigint0;
376
- //#endregion
377
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/DateTime.js
378
- const isDateTime = isDateTime$1;
379
- const isUtc = isUtc$1;
380
- const fromDateUnsafe = fromDateUnsafe$1;
381
- const makeUnsafe = makeUnsafe$1;
382
- const make$5 = make$8;
383
- const now = now$1;
384
- const toUtc = toUtc$1;
385
- const toDateUtc = toDateUtc$1;
386
- const toEpochMillis = toEpochMillis$1;
387
- const removeTime = removeTime$1;
388
- const formatIso = formatIso$1;
389
- const formatIsoDate = formatIsoDate$1;
390
- //#endregion
391
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/encoding/Base64.js
410
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/encoding/Base64.js
392
411
  const encode = (input) => encodeBytes(typeof input === "string" ? encoder$1.encode(input) : input);
393
412
  const decode = (str) => {
394
413
  const stripped = stripCrlf(str);
@@ -426,6 +445,12 @@ const decode = (str) => {
426
445
  }
427
446
  };
428
447
  const encodeBytes = (bytes) => {
448
+ const length = bytes.length;
449
+ const toBase64 = Uint8Array.prototype.toBase64;
450
+ if (length >= 32 && typeof toBase64 === "function") return toBase64.call(bytes);
451
+ return length < 128 ? encodeShort(bytes) : encodeLong(bytes);
452
+ };
453
+ const encodeShort = (bytes) => {
429
454
  const length = bytes.length;
430
455
  let result = "";
431
456
  let i = 2;
@@ -448,9 +473,37 @@ const encodeBytes = (bytes) => {
448
473
  }
449
474
  return result;
450
475
  };
476
+ const encodeLong = (bytes) => {
477
+ const length = bytes.length;
478
+ const result = new Uint8Array(Math.ceil(length / 3) * 4);
479
+ let i;
480
+ let j = 0;
481
+ for (i = 2; i < length; i += 3, j += 4) {
482
+ result[j] = alphabetCodes[bytes[i - 2] >> 2];
483
+ result[j + 1] = alphabetCodes[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
484
+ result[j + 2] = alphabetCodes[(bytes[i - 1] & 15) << 2 | bytes[i] >> 6];
485
+ result[j + 3] = alphabetCodes[bytes[i] & 63];
486
+ }
487
+ if (i === length + 1) {
488
+ result[j] = alphabetCodes[bytes[i - 2] >> 2];
489
+ result[j + 1] = alphabetCodes[(bytes[i - 2] & 3) << 4];
490
+ result[j + 2] = paddingCode;
491
+ result[j + 3] = paddingCode;
492
+ }
493
+ if (i === length) {
494
+ result[j] = alphabetCodes[bytes[i - 2] >> 2];
495
+ result[j + 1] = alphabetCodes[(bytes[i - 2] & 3) << 4 | bytes[i - 1] >> 4];
496
+ result[j + 2] = alphabetCodes[(bytes[i - 1] & 15) << 2];
497
+ result[j + 3] = paddingCode;
498
+ }
499
+ return decoder.decode(result);
500
+ };
451
501
  const encoder$1 = new TextEncoder();
502
+ const decoder = new TextDecoder();
452
503
  const stripCrlf = (str) => str.replace(/[\n\r]/g, "");
453
504
  const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
505
+ const alphabetCodes = encoder$1.encode(alphabet);
506
+ const paddingCode = "=".charCodeAt(0);
454
507
  const codes = new Uint8Array(123).fill(255);
455
508
  for (let i = 0; i < 64; i++) codes[alphabet.charCodeAt(i)] = i;
456
509
  codes["=".charCodeAt(0)] = 0;
@@ -458,8 +511,20 @@ const getCode = (charCode) => {
458
511
  if (charCode >= codes.length || codes[charCode] === 255) throw new TypeError(`Invalid character ${String.fromCharCode(charCode)}`);
459
512
  return codes[charCode];
460
513
  };
461
- //#endregion
462
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/http/Cookies.js
514
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/DateTime.js
515
+ const isDateTime = isDateTime$1;
516
+ const isUtc = isUtc$1;
517
+ const fromDateUnsafe = fromDateUnsafe$1;
518
+ const makeUnsafe = makeUnsafe$1;
519
+ const make$5 = make$8;
520
+ const now = now$1;
521
+ const toUtc = toUtc$1;
522
+ const toDateUtc = toDateUtc$1;
523
+ const toEpochMillis = toEpochMillis$1;
524
+ const removeTime = removeTime$1;
525
+ const formatIso = formatIso$1;
526
+ const formatIsoDate = formatIsoDate$1;
527
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/http/Cookies.js
463
528
  const TypeId$9 = "~effect/http/Cookies";
464
529
  const isCookies = (u) => hasProperty(u, TypeId$9);
465
530
  const CookieTypeId = "~effect/http/Cookies/Cookie";
@@ -515,9 +580,9 @@ function parseSetCookie(header) {
515
580
  if (parts.length === 0) return;
516
581
  const firstEqual = parts[0].indexOf("=");
517
582
  if (firstEqual === -1) return;
518
- const name = parts[0].slice(0, firstEqual);
583
+ const name = parts[0].slice(0, firstEqual).replace(cookieWhitespaceRegExp, "");
519
584
  if (!cookieNameRegExp.test(name)) return;
520
- const valueEncoded = parts[0].slice(firstEqual + 1);
585
+ const valueEncoded = parts[0].slice(firstEqual + 1).replace(cookieWhitespaceRegExp, "");
521
586
  const value = tryDecodeURIComponent(valueEncoded);
522
587
  if (parts.length === 1) return Object.assign(Object.create(CookieProto), {
523
588
  name,
@@ -543,12 +608,10 @@ function parseSetCookie(header) {
543
608
  if (!isNaN(date.getTime())) options.expires = date;
544
609
  break;
545
610
  }
546
- case "max-age": {
547
- if (value === void 0) break;
548
- const maxAge = parseInt(value, 10);
549
- if (!isNaN(maxAge)) options.maxAge = seconds(maxAge);
611
+ case "max-age":
612
+ if (value === void 0 || !maxAgeRegExp.test(value)) break;
613
+ options.maxAge = seconds(parseInt(value, 10));
550
614
  break;
551
- }
552
615
  case "path":
553
616
  if (value === void 0) break;
554
617
  if (value[0] === "/") options.path = value;
@@ -597,6 +660,8 @@ function parseSetCookie(header) {
597
660
  const empty$2 = fromIterable([]);
598
661
  const fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
599
662
  const cookieNameRegExp = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
663
+ const cookieWhitespaceRegExp = /^[\t ]+|[\t ]+$/g;
664
+ const maxAgeRegExp = /^-?[0-9]+$/;
600
665
  const cookieDomainRegExp = /^[\u0009\u0020-\u003a\u003c-\u007e\u0080-\u00ff]+$/;
601
666
  const cookiePathRegExp = /^[\u0020-\u003a\u003c-\u007e]+$/;
602
667
  const CookieProto = {
@@ -640,7 +705,7 @@ function serializeCookie(self) {
640
705
  const maxAge = toSeconds(fromInputUnsafe(options.maxAge));
641
706
  str += "; Max-Age=" + Math.trunc(maxAge);
642
707
  }
643
- if (options.domain !== void 0) str += "; Domain=" + options.domain;
708
+ if (options.domain !== void 0 && !options.hostOnly) str += "; Domain=" + options.domain;
644
709
  if (options.path !== void 0) str += "; Path=" + options.path;
645
710
  if (options.priority !== void 0) switch (options.priority) {
646
711
  case "low":
@@ -683,8 +748,7 @@ const tryDecodeURIComponent = (str) => {
683
748
  return str;
684
749
  }
685
750
  };
686
- //#endregion
687
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/http/Headers.js
751
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/http/Headers.js
688
752
  const TypeId$8 = Symbol.for("~effect/http/Headers");
689
753
  const Proto$1 = Object.defineProperties(Object.create(null), {
690
754
  [TypeId$8]: { value: TypeId$8 },
@@ -695,7 +759,7 @@ const Proto$1 = Object.defineProperties(Object.create(null), {
695
759
  return redact$2(this);
696
760
  } },
697
761
  [symbol$2]: { value(that) {
698
- return Equivalence$1(this, that);
762
+ return Equivalence$2(this, that);
699
763
  } },
700
764
  [symbol$1]: { value() {
701
765
  return structure(this);
@@ -704,7 +768,7 @@ const Proto$1 = Object.defineProperties(Object.create(null), {
704
768
  [NodeInspectSymbol]: { value: BaseProto[NodeInspectSymbol] }
705
769
  });
706
770
  const make$4 = (input) => Object.assign(Object.create(Proto$1), input);
707
- const Equivalence$1 = makeEquivalence$1(strictEqual());
771
+ const Equivalence$2 = makeEquivalence$1(strictEqual());
708
772
  const empty$1 = Object.create(Proto$1);
709
773
  const fromInput$1 = (input) => {
710
774
  if (input === void 0) return empty$1;
@@ -766,11 +830,82 @@ const CurrentRedactedNames$1 = Reference("effect/Headers/CurrentRedactedNames",
766
830
  "set-cookie",
767
831
  "x-api-key"
768
832
  ] });
769
- //#endregion
770
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/http/internal/urlParams.js
833
+ const HeaderParseErrorTypeId = "~effect/http/Headers/HeaderParseError";
834
+ var HeaderParseErrorReason = class extends Error$2 {};
835
+ var HeaderParseError = class HeaderParseError extends TaggedError$1("HeaderParseError") {
836
+ static fromReason(reason, input) {
837
+ return new HeaderParseError({ reason: new HeaderParseErrorReason({
838
+ _tag: reason,
839
+ input
840
+ }) });
841
+ }
842
+ [HeaderParseErrorTypeId] = HeaderParseErrorTypeId;
843
+ get message() {
844
+ return `${this.reason._tag}: ${JSON.stringify(this.reason.input)}`;
845
+ }
846
+ };
847
+ const monthNames = [
848
+ "jan",
849
+ "feb",
850
+ "mar",
851
+ "apr",
852
+ "may",
853
+ "jun",
854
+ "jul",
855
+ "aug",
856
+ "sep",
857
+ "oct",
858
+ "nov",
859
+ "dec"
860
+ ];
861
+ const httpDateFormats = [
862
+ /^(?:mon|tue|wed|thu|fri|sat|sun), (?<day>\d{2}) (?<month>[a-z]{3}) (?<year>\d{4}) (?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2}) gmt$/i,
863
+ /^(?:monday|tuesday|wednesday|thursday|friday|saturday|sunday), (?<day>\d{2})-(?<month>[a-z]{3})-(?<year>\d{2}) (?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2}) gmt$/i,
864
+ /^(?:mon|tue|wed|thu|fri|sat|sun) (?<month>[a-z]{3}) (?<day> \d|\d{2}) (?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2}) (?<year>\d{4})$/i
865
+ ];
866
+ const httpDateToMillis = (input) => {
867
+ for (const format of httpDateFormats) {
868
+ const groups = format.exec(input)?.groups;
869
+ if (groups === void 0) continue;
870
+ const month = monthNames.indexOf(groups.month.toLowerCase());
871
+ const hour = Number(groups.hour);
872
+ const minute = Number(groups.minute);
873
+ const second = Number(groups.second);
874
+ if (month === -1 || hour > 23 || minute > 59 || second > 60) return;
875
+ let year = Number(groups.year);
876
+ if (groups.year.length === 2) year += year < 70 ? 2e3 : 1900;
877
+ const day = Number(groups.day);
878
+ const date = new Date(0);
879
+ date.setUTCFullYear(year, month, day);
880
+ if (date.getUTCFullYear() !== year || date.getUTCMonth() !== month || date.getUTCDate() !== day) return;
881
+ return date.getTime() + ((hour * 60 + minute) * 60 + second) * 1e3;
882
+ }
883
+ };
884
+ const retryAfterDateTime = (dateTime) => ({
885
+ _tag: "DateTime",
886
+ dateTime
887
+ });
888
+ const wholeSeconds = /^\d+$/;
889
+ const nanosPerSecond = BigInt(1e9);
890
+ const parseRetryAfter = (input) => {
891
+ const trimmed = input.trim();
892
+ if (wholeSeconds.test(trimmed)) {
893
+ const seconds$1 = Number(trimmed);
894
+ const duration = Number.isSafeInteger(seconds$1 * 1e3) ? seconds(seconds$1) : nanos(BigInt(trimmed) * nanosPerSecond);
895
+ return succeed$1({
896
+ _tag: "Duration",
897
+ duration
898
+ });
899
+ }
900
+ const millis = httpDateToMillis(trimmed);
901
+ return millis === void 0 ? fail$1(HeaderParseError.fromReason("InvalidRetryAfter", input)) : succeed$1(retryAfterDateTime(makeUnsafe(millis)));
902
+ };
903
+ const retryAfterDelay = (self, now) => self._tag === "Duration" ? self.duration : millis(Math.max(0, toEpochMillis(self.dateTime) - now));
904
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/http/internal/urlParams.js
771
905
  const unwrap = (value$6) => typeof value$6 === "string" ? value$6 : value(value$6);
772
- //#endregion
773
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/http/UrlParams.js
906
+ const bodyDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
907
+ const fromBody = (bytes) => new URLSearchParams(bodyDecoder.decode(bytes).replace(/^\?/, "%3F"));
908
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/http/UrlParams.js
774
909
  const TypeId$7 = "~effect/http/UrlParams";
775
910
  const isUrlParams = (u) => hasProperty(u, TypeId$7);
776
911
  const Proto = {
@@ -789,7 +924,7 @@ const Proto = {
789
924
  return redact$2(this);
790
925
  },
791
926
  [symbol$2](that) {
792
- return Equivalence(this, that);
927
+ return Equivalence$1(this, that);
793
928
  },
794
929
  [symbol$1]() {
795
930
  return array(this.params.flat());
@@ -822,7 +957,7 @@ const fromInputNested = (input) => {
822
957
  return out;
823
958
  };
824
959
  const coerce = (value) => isRedacted(value) ? value : String(value);
825
- const Equivalence = make$9((a, b) => arrayEquivalence(a.params, b.params));
960
+ const Equivalence$1 = make$9((a, b) => arrayEquivalence(a.params, b.params));
826
961
  const arrayEquivalence = makeEquivalence$3(makeEquivalence$2([strictEqual(), asEquivalence()]));
827
962
  const empty = make$3([]);
828
963
  const setAll = dual(2, (self, input) => {
@@ -899,13 +1034,15 @@ const decodeQueryKey = (key) => {
899
1034
  };
900
1035
  const currentRedactedNames = () => get(globalThis["~effect/Fiber/currentFiber"]?.context ?? empty$3(), CurrentRedactedNames);
901
1036
  const CurrentRedactedNames = Reference("effect/http/UrlParams/CurrentRedactedNames", { defaultValue: () => [
1037
+ "X-Amz-Signature",
1038
+ "X-Amz-Credential",
1039
+ "X-Amz-Security-Token",
902
1040
  "AWSAccessKeyId",
903
1041
  "Signature",
904
1042
  "sig",
905
1043
  "X-Goog-Signature"
906
1044
  ] });
907
- //#endregion
908
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/schema/annotations.js
1045
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/schema/annotations.js
909
1046
  function resolve$1(ast) {
910
1047
  return ast.checks ? ast.checks[ast.checks.length - 1].annotations : ast.annotations;
911
1048
  }
@@ -951,16 +1088,14 @@ const annotationExcludedKeys = new Set([
951
1088
  "toCodecIso",
952
1089
  "toCodecArbitrary"
953
1090
  ]);
954
- //#endregion
955
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/schema/parser.js
1091
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/schema/parser.js
956
1092
  const missing = Symbol();
957
1093
  const succeed = succeed$2;
958
1094
  const missingExit = succeed(missing);
959
1095
  const sameExit = succeed(missing);
960
1096
  const toOption = (value) => value === missing ? none() : some(value);
961
1097
  const fromOptionExit = (option) => option._tag === "None" ? missingExit : succeed(option.value);
962
- //#endregion
963
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/SchemaIssue.js
1098
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/SchemaIssue.js
964
1099
  const TypeId$6 = "~effect/SchemaIssue/Issue";
965
1100
  function isIssue(u) {
966
1101
  return hasProperty(u, TypeId$6) && u[TypeId$6] === TypeId$6;
@@ -1118,7 +1253,7 @@ const defaultLeafHook = (issue) => {
1118
1253
  }
1119
1254
  }
1120
1255
  };
1121
- const defaultCheckHook = (issue) => findMessage(issue.issue) ?? findMessage(issue);
1256
+ const defaultCheckHook = (issue) => findMessage(issue) ?? findMessage(issue.issue);
1122
1257
  function formatInput(issue) {
1123
1258
  return hasInput(issue) ? format$1(issue.input) : void 0;
1124
1259
  }
@@ -1130,6 +1265,12 @@ function getExpectedMessage(expected, issue) {
1130
1265
  const input = formatInput(issue);
1131
1266
  return input === void 0 ? `Expected ${expected}` : `Expected ${expected}, got ${input}`;
1132
1267
  }
1268
+ function getFilterMessage(issue, checkHook) {
1269
+ const message = checkHook(issue);
1270
+ if (message !== void 0 || issue.issue._tag !== "InvalidValue") return message;
1271
+ const expected = findExpected(issue.issue);
1272
+ return expected === void 0 ? getExpectedMessage(formatCheck(issue.filter), issue) : getExpectedMessage(expected, issue.issue);
1273
+ }
1133
1274
  function formatCheck(check) {
1134
1275
  const expected = check.annotations?.expected;
1135
1276
  if (typeof expected === "string") return expected;
@@ -1142,38 +1283,28 @@ function makeFormatterDefault() {
1142
1283
  return (issue) => formatIssue(issue, "");
1143
1284
  }
1144
1285
  const defaultFormatter = makeFormatterDefault();
1145
- function formatIssue(issue, path) {
1286
+ function formatIssue(issue, path, messageOverride) {
1146
1287
  let message;
1147
1288
  switch (issue._tag) {
1148
- case "Filter": {
1149
- const annotated = defaultCheckHook(issue);
1150
- if (annotated !== void 0) message = annotated;
1151
- else {
1152
- if (issue.issue._tag !== "InvalidValue") return formatIssue(issue.issue, path);
1153
- const expected = findExpected(issue.issue);
1154
- message = expected === void 0 ? getExpectedMessage(formatCheck(issue.filter), issue) : getExpectedMessage(expected, issue.issue);
1155
- }
1156
- break;
1157
- }
1158
- case "Encoding": return formatIssue(issue.issue, path);
1159
- case "Pointer": return formatIssue(issue.issue, path + formatPath(issue.path));
1289
+ case "Filter": return formatIssue(issue.issue, path, messageOverride ?? getFilterMessage(issue, defaultCheckHook));
1290
+ case "Encoding": return formatIssue(issue.issue, path, messageOverride);
1291
+ case "Pointer": return formatIssue(issue.issue, path + formatPath(issue.path), messageOverride);
1160
1292
  case "Composite":
1161
1293
  case "AnyOf":
1162
- if (issue._tag === "Composite" || issue.issues.length > 0) return issue.issues.map((issue) => formatIssue(issue, path)).join("\n");
1163
- message = findMessage(issue) ?? getExpectedMessage(getExpected(issue.ast), issue);
1294
+ if (issue._tag === "Composite" || issue.issues.length > 0) return issue.issues.map((issue) => formatIssue(issue, path, messageOverride)).join("\n");
1295
+ message = messageOverride ?? findMessage(issue) ?? getExpectedMessage(getExpected(issue.ast), issue);
1164
1296
  break;
1165
- default: message = defaultLeafHook(issue);
1297
+ default: message = messageOverride ?? defaultLeafHook(issue);
1166
1298
  }
1167
1299
  return path ? `${message}\n at ${path}` : message;
1168
1300
  }
1169
1301
  function findMessage(issue) {
1170
- if (issue._tag === "Pointer") return;
1302
+ if (issue._tag === "Pointer" || issue._tag === "Composite") return;
1171
1303
  if (issue._tag === "Encoding") return findMessage(issue.issue);
1172
1304
  const message = (issue._tag === "Filter" ? issue.filter.annotations : "annotations" in issue ? issue.annotations : issue.ast.annotations)?.[issue._tag === "MissingKey" ? "messageMissingKey" : issue._tag === "UnexpectedKey" ? "messageUnexpectedKey" : "message"];
1173
1305
  if (typeof message === "string") return message;
1174
1306
  }
1175
- //#endregion
1176
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/schema/cause.js
1307
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/schema/cause.js
1177
1308
  function getSchemaIssue(cause) {
1178
1309
  let issue;
1179
1310
  for (const reason of cause.reasons) {
@@ -1187,8 +1318,7 @@ function getSchemaIssueOrThrow(cause, message) {
1187
1318
  if (issue === void 0) throw new Error(message, { cause });
1188
1319
  return issue;
1189
1320
  }
1190
- //#endregion
1191
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/SchemaGetter.js
1321
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/SchemaGetter.js
1192
1322
  const runGetter = (self, input, options) => {
1193
1323
  switch (self._tag) {
1194
1324
  case "Passthrough": return succeed$3(input);
@@ -1283,7 +1413,13 @@ function Number$3() {
1283
1413
  return transform$1(globalThis.Number);
1284
1414
  }
1285
1415
  function BigInt$3() {
1286
- return transform$1(globalThis.BigInt);
1416
+ return transformEffect$1((input, options) => {
1417
+ try {
1418
+ return succeed$3(globalThis.BigInt(input));
1419
+ } catch {
1420
+ return fail$2(new InvalidValue({ expected: "a value that can be converted to a bigint" }, input, options));
1421
+ }
1422
+ });
1287
1423
  }
1288
1424
  function Date$2() {
1289
1425
  return transform$1((u) => new globalThis.Date(u));
@@ -1318,8 +1454,16 @@ function dateTimeUtcFromInput$1() {
1318
1454
  });
1319
1455
  });
1320
1456
  }
1321
- //#endregion
1322
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/SchemaTransformation.js
1457
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/schema/content.js
1458
+ const ContentTypeId = Symbol.for("~effect/Schema/content");
1459
+ function setContent(operation, content) {
1460
+ Object.defineProperty(operation, ContentTypeId, { value: content });
1461
+ return operation;
1462
+ }
1463
+ function getContent(operation) {
1464
+ return operation[ContentTypeId];
1465
+ }
1466
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/SchemaTransformation.js
1323
1467
  const Middleware = class extends Class$2 {
1324
1468
  _tag = "Middleware";
1325
1469
  decode;
@@ -1432,10 +1576,12 @@ const urlFromString = transformEffect({
1432
1576
  });
1433
1577
  const uint8ArrayFromBase64String = new Transformation(decodeBase64(), encodeBase64());
1434
1578
  function fromJsonString$1(options) {
1435
- return new Transformation(parseJson(options ?? {}), stringifyJson(options));
1579
+ return new Transformation(parseJson(options ?? {}), setContent(stringifyJson(options), {
1580
+ mediaType: "application/json",
1581
+ preserveSchema: options?.reviver === void 0 && options?.replacer === void 0
1582
+ }));
1436
1583
  }
1437
- //#endregion
1438
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/SchemaAST.js
1584
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/SchemaAST.js
1439
1585
  function makeGuard(tag) {
1440
1586
  return (ast) => ast._tag === tag;
1441
1587
  }
@@ -1502,7 +1648,12 @@ const Declaration = class extends ASTNodeImpl {
1502
1648
  let run;
1503
1649
  return (input, options) => {
1504
1650
  if (input === missing) return missingExit;
1505
- return (run ??= this.run(this.typeParameters))(input, this, options);
1651
+ run ??= this.run(this.typeParameters);
1652
+ try {
1653
+ return run(input, this, options);
1654
+ } catch (error) {
1655
+ return die(error);
1656
+ }
1506
1657
  };
1507
1658
  }
1508
1659
  _rebuild(recur, checks, encodingChecks, run, encodingRun) {
@@ -1548,8 +1699,8 @@ const undefined_ = new Undefined$1();
1548
1699
  const Void$1 = class extends ASTNodeImpl {
1549
1700
  _tag = "Void";
1550
1701
  getParser() {
1551
- const succeed$5 = succeed(void 0);
1552
- return (input) => input === missing ? missingExit : succeed$5;
1702
+ const succeed$4 = succeed(void 0);
1703
+ return (input) => input === missing ? missingExit : succeed$4;
1553
1704
  }
1554
1705
  toCodecJson() {
1555
1706
  return replaceEncoding(this, [undefinedToNull]);
@@ -1589,140 +1740,6 @@ const Unknown$1 = class extends ASTNodeImpl {
1589
1740
  }
1590
1741
  };
1591
1742
  const unknown = new Unknown$1();
1592
- const ObjectKeyword$1 = class extends ASTNodeImpl {
1593
- _tag = "ObjectKeyword";
1594
- getParser() {
1595
- return fromRefinement(this, isObjectKeyword);
1596
- }
1597
- getExpected() {
1598
- return "object | array | function";
1599
- }
1600
- };
1601
- const objectKeyword = new ObjectKeyword$1();
1602
- const Enum$1 = class extends ASTNodeImpl {
1603
- _tag = "Enum";
1604
- enums;
1605
- constructor(enums, annotations, checks, encoding, context) {
1606
- super(annotations, checks, encoding, context);
1607
- for (const [, value] of enums) if (typeof value === "number" && !globalThis.Number.isFinite(value)) throw new Error(`A numeric enum value must be finite, got ${format$1(value)}`);
1608
- this.enums = enums;
1609
- }
1610
- getParser() {
1611
- const values = new Set(this.enums.map(([, v]) => v));
1612
- return fromRefinement(this, (input) => values.has(input));
1613
- }
1614
- toCodecStringTree() {
1615
- if (this.enums.some(([_, v]) => typeof v === "number")) {
1616
- const coercions = Object.fromEntries(this.enums.map(([_, v]) => [globalThis.String(v), v]));
1617
- return replaceEncoding(this, [new Link(new Union$1(Object.keys(coercions).map((k) => new Literal$1(k))), new Transformation(transform$1((s) => coercions[s]), String$3()))]);
1618
- }
1619
- return this;
1620
- }
1621
- getExpected() {
1622
- return this.enums.map(([_, value]) => JSON.stringify(value)).join(" | ");
1623
- }
1624
- };
1625
- function formatTemplateLiteralPath(path) {
1626
- return typeof path === "number" ? `parts[${path}]` : path;
1627
- }
1628
- function isTemplateLiteralPart(ast, path, validated) {
1629
- if (validated.has(ast)) return true;
1630
- if (ast.encoding) throw new Error(`TemplateLiteral parts cannot have an encoding at ${formatTemplateLiteralPath(path)}`);
1631
- let valid;
1632
- switch (ast._tag) {
1633
- case "String":
1634
- case "Number":
1635
- case "BigInt":
1636
- valid = true;
1637
- break;
1638
- case "Literal":
1639
- valid = !ast.checks;
1640
- break;
1641
- case "TemplateLiteral": {
1642
- const currentPath = formatTemplateLiteralPath(path);
1643
- valid = !ast.checks && ast.parts.every((part, index) => isTemplateLiteralPart(part, `${currentPath}.parts[${index}]`, validated));
1644
- break;
1645
- }
1646
- case "Union": {
1647
- const currentPath = formatTemplateLiteralPath(path);
1648
- valid = !ast.checks && ast.types.every((part, index) => isTemplateLiteralPart(part, `${currentPath}.types[${index}]`, validated));
1649
- break;
1650
- }
1651
- default: return false;
1652
- }
1653
- if (valid) validated.add(ast);
1654
- return valid;
1655
- }
1656
- const TemplateLiteral$1 = class extends ASTNodeImpl {
1657
- _tag = "TemplateLiteral";
1658
- parts;
1659
- encodedParts;
1660
- literals;
1661
- suffixLengths;
1662
- constructor(parts, annotations, checks, encoding, context) {
1663
- super(annotations, checks, encoding, context);
1664
- const encodedParts = [];
1665
- const literals = [];
1666
- const validated = new Set();
1667
- for (let index = 0; index < parts.length; index++) {
1668
- const part = parts[index];
1669
- if (!isTemplateLiteralPart(part, index, validated)) throw new Error(`Invalid TemplateLiteral part ${part._tag}`);
1670
- encodedParts.push(part);
1671
- literals.push(part._tag === "Literal" ? globalThis.String(part.literal) : void 0);
1672
- }
1673
- const suffixLengths = new Array(encodedParts.length + 1);
1674
- suffixLengths[encodedParts.length] = 0;
1675
- for (let i = encodedParts.length - 1; i >= 0; i--) suffixLengths[i] = suffixLengths[i + 1] + (literals[i]?.length ?? 0);
1676
- this.parts = parts;
1677
- this.encodedParts = encodedParts;
1678
- this.literals = literals;
1679
- this.suffixLengths = suffixLengths;
1680
- }
1681
- getParser(compile) {
1682
- const tuple = new Arrays(false, this.parts.map(partFromString), []);
1683
- const parser = compile(decodeTo$1(string, tuple, templateLiteralTransformation(this)));
1684
- return (input, options) => {
1685
- if (input === missing) return missingExit;
1686
- const result = parser(input, options);
1687
- if (result._tag === "Success") return sameExit;
1688
- return mapBothEager(result, {
1689
- onSuccess: () => input,
1690
- onFailure: (issue) => new Composite(this, [issue], input, options)
1691
- });
1692
- };
1693
- }
1694
- getExpected() {
1695
- return "string";
1696
- }
1697
- matchPart(s, options) {
1698
- return segmentTemplateLiteralParts(this, s, options) === void 0 ? void 0 : s;
1699
- }
1700
- };
1701
- function templateLiteralTransformation(template) {
1702
- return new Transformation(transformEffect$1((s, options) => {
1703
- const segments = segmentTemplateLiteralParts(template, s, options);
1704
- if (segments) return succeed$3(segments);
1705
- return fail$2(new InvalidValue({ expected: "a string matching template literal parts" }, s, options));
1706
- }), transform$1((parts) => parts.join("")));
1707
- }
1708
- const UniqueSymbol$1 = class extends ASTNodeImpl {
1709
- _tag = "UniqueSymbol";
1710
- symbol;
1711
- constructor(symbol, annotations, checks, encoding, context) {
1712
- super(annotations, checks, encoding, context);
1713
- this.symbol = symbol;
1714
- }
1715
- getParser() {
1716
- return fromConst(this, this.symbol);
1717
- }
1718
- toCodecStringTree() {
1719
- const key = globalThis.Symbol.keyFor(this.symbol);
1720
- return replaceEncoding(this, [new Link(key === void 0 ? never : new Literal$1(globalThis.String(this.symbol)), symbolToString.transformation)]);
1721
- }
1722
- getExpected() {
1723
- return globalThis.String(this.symbol);
1724
- }
1725
- };
1726
1743
  const Literal$1 = class extends ASTNodeImpl {
1727
1744
  _tag = "Literal";
1728
1745
  literal;
@@ -1894,7 +1911,7 @@ const Arrays = class extends ASTNodeImpl {
1894
1911
  input,
1895
1912
  len,
1896
1913
  tailThreshold: Math.max(elementLen, len - tailLen),
1897
- output: new globalThis.Array(len),
1914
+ output: [],
1898
1915
  issues: void 0,
1899
1916
  options
1900
1917
  };
@@ -1981,7 +1998,7 @@ const wrapPropertyKeyIssue = (s, ast, key, exit) => {
1981
1998
  else s.issues = [pointer];
1982
1999
  } else return fail$3(new Composite(ast, [pointer], s.input, s.options));
1983
2000
  };
1984
- const FINITE_PATTERN = "[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?";
2001
+ const FINITE_PATTERN = "[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[Ee][+-]?\\d+)?";
1985
2002
  function getIndexSignatureKeys(input, parameter, options = defaultParseOptions) {
1986
2003
  let stringKeys;
1987
2004
  let symbolKeys;
@@ -2036,7 +2053,7 @@ const IndexSignature = class {
2036
2053
  if (!isIndexSignatureParameter(parameter)) throw new Error(`Invalid index signature parameter ${parameter._tag}`);
2037
2054
  this.parameter = parameter;
2038
2055
  this.type = type;
2039
- if (isOptional(type) && !containsUndefined(type)) throw new Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.");
2056
+ if (isOptional(type) || type.encoding !== void 0 && isOptional(toEncoded$1(type))) throw new Error("Cannot use `Schema.optionalKey` or `Schema.optional` with index signatures. Index signatures already allow keys to be absent; use `Schema.UndefinedOr` to allow `undefined` values.");
2040
2057
  }
2041
2058
  };
2042
2059
  const Objects = class extends ASTNodeImpl {
@@ -2168,9 +2185,13 @@ const Objects = class extends ASTNodeImpl {
2168
2185
  };
2169
2186
  if (indexCount) return makeFallback();
2170
2187
  let fallback;
2171
- const resume = (state, index, pending) => {
2188
+ const resume = (snapshot, index, pending) => {
2172
2189
  const property = properties[index];
2173
2190
  return flatMap(exit(pending), (exit) => {
2191
+ const state = {
2192
+ ...snapshot,
2193
+ out: { ...snapshot.out }
2194
+ };
2174
2195
  const terminal = stepProperty(state, property, exit);
2175
2196
  if (terminal) return terminal;
2176
2197
  const done = () => succeed(state.out);
@@ -2851,11 +2872,6 @@ const optionalKey$1 = memoizeIdempotent((ast) => {
2851
2872
  });
2852
2873
  const optionalKeyLastLink = applyToLastLink(optionalKey$1);
2853
2874
  const optional$1 = memoize((ast) => optionalKey$1(new Union$1([ast, undefined_])));
2854
- const mutableKey$1 = memoizeIdempotent((ast) => {
2855
- const context = ast.context ? ast.context.isMutable === false ? new Context(ast.context.isOptional, true, ast.context.constructorDefault, ast.context.annotations) : ast.context : new Context(false, true);
2856
- return mutableKeyLastLink(replaceContext(ast, context));
2857
- });
2858
- const mutableKeyLastLink = applyToLastLink(mutableKey$1);
2859
2875
  function withConstructorDefault$1(ast, defaultValue) {
2860
2876
  return replaceContext(ast, ast.context ? new Context(ast.context.isOptional, ast.context.isMutable, defaultValue, ast.context.annotations) : new Context(false, false, defaultValue));
2861
2877
  }
@@ -2865,13 +2881,19 @@ function decodeTo$1(from, to, transformation) {
2865
2881
  function parseParameter(ast) {
2866
2882
  const literals = [];
2867
2883
  const parameters = [];
2884
+ function addLiteral(literal) {
2885
+ if (!literals.includes(literal)) literals.push(literal);
2886
+ }
2868
2887
  function go(ast) {
2869
2888
  switch (ast._tag) {
2870
2889
  case "Literal":
2871
- if (isPropertyKey(ast.literal) && !literals.includes(ast.literal)) literals.push(ast.literal);
2890
+ if (isPropertyKey(ast.literal)) addLiteral(ast.literal);
2872
2891
  return;
2873
2892
  case "UniqueSymbol":
2874
- if (!literals.includes(ast.symbol)) literals.push(ast.symbol);
2893
+ addLiteral(ast.symbol);
2894
+ return;
2895
+ case "Enum":
2896
+ for (const [, value] of ast.enums) addLiteral(value);
2875
2897
  return;
2876
2898
  case "Never": return;
2877
2899
  case "Union":
@@ -2955,18 +2977,11 @@ const flip = memoize((ast) => {
2955
2977
  }
2956
2978
  return "flip" in ast ? ast.flip(flip) : "recur" in ast ? ast.recur(flip) : ast;
2957
2979
  });
2958
- function containsUndefined(ast) {
2959
- switch (ast._tag) {
2960
- case "Undefined": return true;
2961
- case "Union": return ast.types.some(containsUndefined);
2962
- default: return false;
2963
- }
2964
- }
2965
2980
  function fromConst(ast, value) {
2966
- const succeed$4 = value === 0 ? sameExit : succeed(value);
2981
+ const succeed$5 = value === 0 ? sameExit : succeed(value);
2967
2982
  return (input, options) => {
2968
2983
  if (input === missing) return missingExit;
2969
- if (input === value) return succeed$4;
2984
+ if (input === value) return succeed$5;
2970
2985
  return fail$2(new InvalidType(ast, input, options));
2971
2986
  };
2972
2987
  }
@@ -2977,53 +2992,6 @@ function fromRefinement(ast, refinement) {
2977
2992
  return fail$2(new InvalidType(ast, input, options));
2978
2993
  };
2979
2994
  }
2980
- function segmentTemplateLiteralParts(ast, input, options) {
2981
- const parts = ast.encodedParts;
2982
- const literals = ast.literals;
2983
- const inputLength = input.length;
2984
- for (let i = 0; i < literals.length; i++) {
2985
- const literal = literals[i];
2986
- if (literal && !input.includes(literal)) return void 0;
2987
- }
2988
- if (ast.suffixLengths[0] > inputLength) return void 0;
2989
- const out = new Array(parts.length);
2990
- let failures;
2991
- function go(i, pos) {
2992
- if (i === parts.length) return pos === inputLength;
2993
- if (failures?.has(i * (inputLength + 1) + pos)) return false;
2994
- const part = parts[i];
2995
- if (i === parts.length - 1) {
2996
- const s = input.slice(pos);
2997
- if (part.matchPart(s, options) !== void 0) {
2998
- out[i] = s;
2999
- return true;
3000
- }
3001
- } else if (part._tag === "Literal") {
3002
- const s = literals[i];
3003
- if (input.startsWith(s, pos) && go(i + 1, pos + s.length)) {
3004
- out[i] = s;
3005
- return true;
3006
- }
3007
- } else {
3008
- const maximumEnd = inputLength - ast.suffixLengths[i + 1];
3009
- const anchor = literals[i + 1];
3010
- let end = anchor === void 0 ? maximumEnd : input.lastIndexOf(anchor, maximumEnd);
3011
- while (end >= pos) {
3012
- const s = input.slice(pos, end);
3013
- if (part.matchPart(s, options) !== void 0 && go(i + 1, end)) {
3014
- out[i] = s;
3015
- return true;
3016
- }
3017
- if (end === 0) break;
3018
- end = anchor === void 0 ? end - 1 : input.lastIndexOf(anchor, end - 1);
3019
- }
3020
- }
3021
- failures ??= new Set();
3022
- failures.add(i * (inputLength + 1) + pos);
3023
- return false;
3024
- }
3025
- return go(0, 0) ? out : void 0;
3026
- }
3027
2995
  const parameterFromPropertyKey = applyToSelfOrLastLinkEncodingIdempotent((ast) => {
3028
2996
  switch (ast._tag) {
3029
2997
  default: return ast;
@@ -3039,15 +3007,6 @@ const parameterFromString = applyToSelfOrLastLinkEncodingIdempotent((ast) => {
3039
3007
  case "Union": return ast.recur(parameterFromString);
3040
3008
  }
3041
3009
  });
3042
- const partFromString = applyToSelfOrLastLinkEncodingIdempotent((ast) => {
3043
- switch (ast._tag) {
3044
- default: return ast;
3045
- case "Number":
3046
- case "Literal":
3047
- case "BigInt": return ast.toCodecStringTree();
3048
- case "Union": return ast.recur(partFromString);
3049
- }
3050
- });
3051
3010
  const STRING_PATTERN = "[\\s\\S]*?";
3052
3011
  const isStringFiniteRegExp = new globalThis.RegExp(`^${FINITE_PATTERN}$`);
3053
3012
  const isStringNumberRegExp = new globalThis.RegExp(`^(?:${FINITE_PATTERN}|Infinity|-Infinity|NaN)$`);
@@ -3196,10 +3155,19 @@ const StringTree = new Declaration([], () => (input, ast, options) => isStringTr
3196
3155
  toCodecStringTree: () => void 0
3197
3156
  });
3198
3157
  const unknownToStringTree = new Link(StringTree, passthrough());
3199
- //#endregion
3200
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/schema/interpreter.js
3158
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/schema/interpreter.js
3201
3159
  const flatMapTransformation = (result, current, f) => result === sameExit ? f(current) : flatMapEager(result, f);
3202
3160
  function compileTransformation(transformation) {
3161
+ const apply = compileTransformationUnsafe(transformation);
3162
+ return (result, current, options) => {
3163
+ try {
3164
+ return apply(result, current, options);
3165
+ } catch (error) {
3166
+ return die(error);
3167
+ }
3168
+ };
3169
+ }
3170
+ function compileTransformationUnsafe(transformation) {
3203
3171
  if (transformation._tag === "Middleware") return (result, current, options) => {
3204
3172
  const transformed = result === sameExit ? transformation.decode(succeed(toOption(current)), options) : transformation.decode(mapEager(result, toOption), options);
3205
3173
  return fromOptionalEffect(transformed);
@@ -3262,40 +3230,44 @@ function compile(ast, compile, compileField, base, specialize) {
3262
3230
  let encodingParsers;
3263
3231
  const parseChecks = (input, options) => {
3264
3232
  let result = parser(input, options);
3265
- if (encodingChecks && !options.disableChecks) {
3266
- if (effectIsExit(result)) {
3267
- if (result._tag === "Success") {
3268
- const output = result === sameExit ? input : result[args];
3269
- if (input !== missing && output !== missing) {
3233
+ try {
3234
+ if (encodingChecks && !options.disableChecks) {
3235
+ if (effectIsExit(result)) {
3236
+ if (result._tag === "Success") {
3237
+ const output = result === sameExit ? input : result[args];
3238
+ if (input !== missing && output !== missing) {
3239
+ const issues = collectIssues(encodingChecks, input, void 0, ast, options);
3240
+ if (issues) result = fail$2(new Composite(ast, issues, input, options));
3241
+ }
3242
+ }
3243
+ } else result = flatMap(result, (value) => {
3244
+ if (input !== missing && value !== missing) {
3270
3245
  const issues = collectIssues(encodingChecks, input, void 0, ast, options);
3271
- if (issues) result = fail$2(new Composite(ast, issues, input, options));
3246
+ if (issues) return fail$2(new Composite(ast, issues, input, options));
3272
3247
  }
3273
- }
3274
- } else result = flatMap(result, (value) => {
3275
- if (input !== missing && value !== missing) {
3276
- const issues = collectIssues(encodingChecks, input, void 0, ast, options);
3277
- if (issues) return fail$2(new Composite(ast, issues, input, options));
3278
- }
3279
- return succeed$3(value);
3280
- });
3281
- }
3282
- if (checks && !options.disableChecks) {
3283
- if (effectIsExit(result)) {
3284
- if (result._tag === "Success") {
3285
- const value = result === sameExit ? input : result[args];
3286
- if (value === missing) return result;
3287
- const issues = collectIssues(checks, value, void 0, ast, options);
3288
- if (issues) result = fail$2(new Composite(ast, issues, value, options));
3289
- }
3290
- } else result = flatMap(result, (value) => {
3291
- if (value !== missing) {
3292
- const issues = collectIssues(checks, value, void 0, ast, options);
3293
- if (issues) return fail$2(new Composite(ast, issues, value, options));
3294
- }
3295
- return succeed$3(value);
3296
- });
3248
+ return succeed$3(value);
3249
+ });
3250
+ }
3251
+ if (checks && !options.disableChecks) {
3252
+ if (effectIsExit(result)) {
3253
+ if (result._tag === "Success") {
3254
+ const value = result === sameExit ? input : result[args];
3255
+ if (value === missing) return result;
3256
+ const issues = collectIssues(checks, value, void 0, ast, options);
3257
+ if (issues) result = fail$2(new Composite(ast, issues, value, options));
3258
+ }
3259
+ } else result = flatMap(result, (value) => {
3260
+ if (value !== missing) {
3261
+ const issues = collectIssues(checks, value, void 0, ast, options);
3262
+ if (issues) return fail$2(new Composite(ast, issues, value, options));
3263
+ }
3264
+ return succeed$3(value);
3265
+ });
3266
+ }
3267
+ return result;
3268
+ } catch (error) {
3269
+ return die(error);
3297
3270
  }
3298
- return result;
3299
3271
  };
3300
3272
  const parseLocal = specialize === void 0 ? parseChecks : specialize(parseChecks);
3301
3273
  if (!links) return parseLocal;
@@ -3328,8 +3300,7 @@ function compile(ast, compile, compileField, base, specialize) {
3328
3300
  });
3329
3301
  };
3330
3302
  }
3331
- //#endregion
3332
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/schema/compilerRegistry.js
3303
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/schema/compilerRegistry.js
3333
3304
  const invalid = Symbol();
3334
3305
  const cache = new WeakMap();
3335
3306
  let compiler;
@@ -3377,6 +3348,9 @@ var CompilerEntry = class extends InterpretedEntry {
3377
3348
  get make() {
3378
3349
  return this.save("make", this.operation("make"));
3379
3350
  }
3351
+ get compiledMakeEffect() {
3352
+ return this.save("compiledMakeEffect", this.operation("makeEffect"));
3353
+ }
3380
3354
  get decodeEffect() {
3381
3355
  return this.save("decodeEffect", this.operation("decodeEffect") ?? compile(this.ast, (ast) => lazyParser(this.resolve, ast, "parser")));
3382
3356
  }
@@ -3385,7 +3359,7 @@ var CompilerEntry = class extends InterpretedEntry {
3385
3359
  return decode === void 0 ? this.decodeEffect : this.save("parser", withDecode(decode, () => this.decodeEffect));
3386
3360
  }
3387
3361
  get makeEffect() {
3388
- const makeEffect = this.operation("makeEffect");
3362
+ const makeEffect = this.compiledMakeEffect;
3389
3363
  if (makeEffect !== void 0) return this.save("makeEffect", makeEffect);
3390
3364
  const child = (ast) => lazyParser(this.resolve, ast, "makeEffect");
3391
3365
  return this.save("makeEffect", compile(this.ast, child, (ast) => compileField(ast, child)));
@@ -3416,8 +3390,7 @@ function resolve(ast) {
3416
3390
  cache.set(ast, entry);
3417
3391
  return entry;
3418
3392
  }
3419
- //#endregion
3420
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/SchemaParser.js
3393
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/SchemaParser.js
3421
3394
  function makeEffect(schema) {
3422
3395
  const ast = schema.ast;
3423
3396
  let parser;
@@ -3497,9 +3470,6 @@ const decodeEffect$1 = decodeUnknownEffect$1;
3497
3470
  function decodeUnknownOption$1(schema, options) {
3498
3471
  return asOption(decodeUnknownEffect$1(schema, options));
3499
3472
  }
3500
- function decodeUnknownResult(schema, options) {
3501
- return asResult(decodeUnknownEffect$1(schema, options));
3502
- }
3503
3473
  function encodeUnknownEffect$1(schema, options) {
3504
3474
  const parser = run(flip(schema.ast));
3505
3475
  return options === void 0 ? parser : (input, overrideOptions) => parser(input, mergeParseOptions(options, overrideOptions));
@@ -3542,47 +3512,52 @@ function asOption(parser) {
3542
3512
  return none();
3543
3513
  };
3544
3514
  }
3545
- function asResult(parser) {
3546
- const parserExit = asExit(parser);
3547
- return (input, options) => {
3548
- const exit = parserExit(input, options);
3549
- if (isSuccess(exit)) return succeed$1(exit.value);
3550
- return fail$1(getSchemaIssueOrThrow(exit.cause, "Result adapter can only return schema issues"));
3551
- };
3552
- }
3553
3515
  function runSync(effect, message) {
3554
3516
  const exit = runSyncExit(effect);
3555
3517
  if (isSuccess(exit)) return exit.value;
3556
3518
  const issue = getSchemaIssueOrThrow(exit.cause, message);
3557
3519
  throw new Error("Schema validation failed", { cause: issue });
3558
3520
  }
3521
+ const constructorDefectMessage = "Constructor adapter can only throw schema issues";
3522
+ function throwConstructorDefect(error) {
3523
+ throw new Error(constructorDefectMessage, { cause: die$1(error) });
3524
+ }
3559
3525
  function makeConstructorSync(ast) {
3560
3526
  let entry;
3561
- let parser;
3562
- return (input, options) => {
3563
- entry ??= resolve(ast);
3564
- const parseOptions = options?.disableChecks ? options.parseOptions ? {
3565
- ...options.parseOptions,
3566
- disableChecks: true
3567
- } : { disableChecks: true } : options?.parseOptions ?? defaultParseOptions;
3568
- const make = entry.make;
3569
- if (make !== void 0 && input !== missing) {
3570
- let output;
3571
- try {
3572
- output = make(input, parseOptions);
3573
- } catch (error) {
3574
- getSchemaIssueOrThrow(die$1(error), "Constructor adapter can only throw schema issues");
3575
- throw error;
3576
- }
3577
- if (output !== invalid && output !== missing) return output;
3527
+ return (input, options) => constructSync(entry ??= resolve(ast), input, options);
3528
+ }
3529
+ function constructSync(entry, input, options) {
3530
+ const parseOptions = options?.disableChecks ? options.parseOptions ? {
3531
+ ...options.parseOptions,
3532
+ disableChecks: true
3533
+ } : { disableChecks: true } : options?.parseOptions ?? defaultParseOptions;
3534
+ const make = entry.make;
3535
+ if (make !== void 0 && input !== missing) {
3536
+ let output;
3537
+ try {
3538
+ output = make(input, parseOptions);
3539
+ } catch (error) {
3540
+ throwConstructorDefect(error);
3578
3541
  }
3579
- return runSync(parserResult((parser ??= entry.makeEffect)(input, parseOptions), input), "Constructor adapter can only throw schema issues");
3580
- };
3542
+ if (output !== invalid && output !== missing) return output;
3543
+ }
3544
+ return runSync(parserResult(entry.makeEffect(input, parseOptions), input), constructorDefectMessage);
3545
+ }
3546
+ function makeClassSync(ast, input, options, construct) {
3547
+ const entry = resolve(ast);
3548
+ const descriptor = getConstructorDescriptor(ast);
3549
+ if (descriptor === void 0 || entry.make !== void 0 || entry.compiledMakeEffect !== void 0) return constructSync(entry, input, options);
3550
+ if (descriptor.isConstructed(input)) return input;
3551
+ const fields = constructSync((entry.resolve ?? resolve)(descriptor.link.to), input, options);
3552
+ try {
3553
+ return construct(fields);
3554
+ } catch (error) {
3555
+ throwConstructorDefect(error);
3556
+ }
3581
3557
  }
3582
3558
  const normalCompiler = (ast) => resolve(ast).parser;
3583
3559
  const constructorCompiler = (ast) => resolve(ast).makeEffect;
3584
- //#endregion
3585
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/schema/make.js
3560
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/schema/make.js
3586
3561
  const TypeId$3 = "~effect/Schema/Schema";
3587
3562
  const RebuildOptions = Symbol();
3588
3563
  const SchemaProto = {
@@ -3636,8 +3611,31 @@ function make$1(ast, options) {
3636
3611
  self.ast = ast;
3637
3612
  return self;
3638
3613
  }
3639
- //#endregion
3640
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/JsonPointer.js
3614
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/jsonSchema.js
3615
+ function getSubschemaKind(keyword) {
3616
+ switch (keyword) {
3617
+ case "$defs":
3618
+ case "properties":
3619
+ case "patternProperties":
3620
+ case "dependentSchemas": return "map";
3621
+ case "allOf":
3622
+ case "anyOf":
3623
+ case "oneOf":
3624
+ case "prefixItems": return "array";
3625
+ case "not":
3626
+ case "additionalProperties":
3627
+ case "propertyNames":
3628
+ case "unevaluatedProperties":
3629
+ case "items":
3630
+ case "contains":
3631
+ case "unevaluatedItems":
3632
+ case "if":
3633
+ case "then":
3634
+ case "else":
3635
+ case "contentSchema": return "schema";
3636
+ }
3637
+ }
3638
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/JsonPointer.js
3641
3639
  function escapeToken(token) {
3642
3640
  return token.replace(/~/g, "~0").replace(/\//g, "~1");
3643
3641
  }
@@ -3666,8 +3664,7 @@ function parseUriFragment(fragment) {
3666
3664
  function formatUriFragment(path) {
3667
3665
  return path.reduce((fragment, token) => `${fragment}/${formatUriFragmentToken(token)}`, "#");
3668
3666
  }
3669
- //#endregion
3670
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/JsonSchema.js
3667
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/JsonSchema.js
3671
3668
  const META_SCHEMA_URI_DRAFT_07 = "http://json-schema.org/draft-07/schema#";
3672
3669
  const META_SCHEMA_URI_DRAFT_2020_12 = "https://json-schema.org/draft/2020-12/schema";
3673
3670
  function isMetaSchemaUri(value, uri) {
@@ -3697,30 +3694,14 @@ function transformSchema(node, transform) {
3697
3694
  for (const key of Object.keys(node)) {
3698
3695
  const value = node[key];
3699
3696
  let transformed = value;
3700
- switch (key) {
3701
- case "$defs":
3702
- case "properties":
3703
- case "patternProperties":
3704
- case "dependentSchemas":
3697
+ switch (getSubschemaKind(key)) {
3698
+ case "map":
3705
3699
  transformed = mapObject(value, (value) => walk(value, inEmbeddedResource)) ?? value;
3706
3700
  break;
3707
- case "allOf":
3708
- case "anyOf":
3709
- case "oneOf":
3710
- case "prefixItems":
3701
+ case "array":
3711
3702
  transformed = Array.isArray(value) ? value.map((value) => walk(value, inEmbeddedResource)) : value;
3712
3703
  break;
3713
- case "not":
3714
- case "additionalProperties":
3715
- case "propertyNames":
3716
- case "unevaluatedProperties":
3717
- case "items":
3718
- case "contains":
3719
- case "unevaluatedItems":
3720
- case "if":
3721
- case "then":
3722
- case "else":
3723
- case "contentSchema": transformed = walk(value, inEmbeddedResource);
3704
+ case "schema": transformed = walk(value, inEmbeddedResource);
3724
3705
  }
3725
3706
  assignProperty$1(out, key, transformed);
3726
3707
  }
@@ -4006,17 +3987,25 @@ function unsupported(keyword, dialect, details) {
4006
3987
  function rejectKeywordCollisions(source, keywords, targetDialect, sourceDialect) {
4007
3988
  for (const keyword of keywords) if (Object.hasOwn(source, keyword)) unsupported(keyword, targetDialect, `it is not active in ${sourceDialect} but would become active in the target`);
4008
3989
  }
4009
- //#endregion
4010
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/schema/toCodec.js
3990
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/schema/toCodec.js
4011
3991
  function toCodecJson$1(schema) {
4012
3992
  return make$1(toCodecJsonAST(schema.ast), { schema });
4013
3993
  }
4014
- const toCodecJsonAST = applyToSelfOrLastLinkEncodingIdempotent((ast) => {
4015
- const out = toCodecJsonASTStep(ast, toCodecJsonAST);
4016
- const context = ast.context;
4017
- if (out === ast || context === void 0) return out;
4018
- return replaceContextLastLink(out, withoutConstructorDefault(context));
4019
- });
3994
+ const toCodecJsonAST = makeCodecDerivation(toCodecJsonASTStep);
3995
+ function makeCodecDerivation(step, options) {
3996
+ const deriveBody = memoize((owner) => {
3997
+ const body = replaceContext(owner, void 0);
3998
+ const out = step(body, recur);
3999
+ return out === body ? null : out;
4000
+ });
4001
+ const recur = applyToSelfOrLastLinkEncodingIdempotent((ast) => {
4002
+ const derived = deriveBody(getContextOwner(ast));
4003
+ if (derived === null) return ast;
4004
+ const out = replaceContext(derived, ast.context);
4005
+ return ast.context === void 0 ? out : replaceContextLastLink(out, withoutConstructorDefault(ast.context));
4006
+ }, options);
4007
+ return recur;
4008
+ }
4020
4009
  function withoutConstructorDefault(context) {
4021
4010
  return context.constructorDefault === void 0 ? context : new Context(context.isOptional, context.isMutable, void 0, context.annotations);
4022
4011
  }
@@ -4125,25 +4114,18 @@ const nullToString = new Link(new Literal$1("null"), new Transformation(transfor
4125
4114
  const booleanToString = new Link(new Union$1([new Literal$1("true"), new Literal$1("false")]), new Transformation(transform$1((s) => s === "true"), String$3()));
4126
4115
  const arrayFromSingleTransformation = new Transformation(transform$1((input) => typeof input === "string" ? [input] : input), passthrough$1());
4127
4116
  const isCodecArrayFromSingleLink = (link) => link.transformation === arrayFromSingleTransformation;
4128
- const toCodecStringTreeAST = applyToSelfOrLastLinkEncodingIdempotent((ast) => {
4129
- const out = toCodecStringTreeASTStep(ast, toCodecStringTreeAST, (ast) => {
4130
- throw new globalThis.Error("Missing structural codec for StringTree", { cause: ast });
4131
- });
4132
- if (out !== ast && ast.context !== void 0) return replaceContextLastLink(out, withoutConstructorDefault(ast.context));
4133
- return out;
4134
- }, { stopAt: isCodecArrayFromSingleLink });
4135
- //#endregion
4136
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/RegExp.js
4117
+ const toCodecStringTreeAST = makeCodecDerivation((ast, recur) => toCodecStringTreeASTStep(ast, recur, (ast) => {
4118
+ throw new globalThis.Error("Missing structural codec for StringTree", { cause: ast });
4119
+ }), { stopAt: isCodecArrayFromSingleLink });
4120
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/RegExp.js
4137
4121
  const RegExp$1 = globalThis.RegExp;
4138
4122
  const escape = (string) => string.replace(/[/\\^$*+?.()|[\]{}]/g, "\\$&");
4139
- //#endregion
4140
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/errors.js
4123
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/errors.js
4141
4124
  function errorWithPath(message, path) {
4142
4125
  if (path.length > 0) message += `\n at ${formatPath(path)}`;
4143
4126
  return new Error(message);
4144
4127
  }
4145
- //#endregion
4146
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/schema/toJsonSchemaDocument.js
4128
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/schema/toJsonSchemaDocument.js
4147
4129
  function formatDefinitionReference(key) {
4148
4130
  return `#/$defs/${formatUriFragmentToken(key)}`;
4149
4131
  }
@@ -4155,26 +4137,26 @@ const jsonSchemaAnnotationExcludedKeys = new Set([
4155
4137
  function collectJsonSchemaAnnotations(annotations, options) {
4156
4138
  if (annotations === void 0) return void 0;
4157
4139
  const out = {};
4158
- const title = annotations.title;
4159
- if (typeof title === "string") out.title = title;
4160
- const description = annotations.description;
4140
+ for (const key of [
4141
+ "title",
4142
+ "description",
4143
+ "format",
4144
+ "contentEncoding",
4145
+ "contentMediaType"
4146
+ ]) {
4147
+ const value = annotations[key];
4148
+ if (typeof value === "string") out[key] = value;
4149
+ }
4150
+ for (const key of ["readOnly", "writeOnly"]) {
4151
+ const value = annotations[key];
4152
+ if (typeof value === "boolean") out[key] = value;
4153
+ }
4161
4154
  const expected = annotations.expected;
4162
- if (typeof description === "string") out.description = description;
4163
- else if (options?.generateDescriptions === true && typeof expected === "string") out.description = expected;
4155
+ if (out.description === void 0 && options?.generateDescriptions === true && typeof expected === "string") out.description = expected;
4164
4156
  const defaultValue = annotations.default;
4165
4157
  if (isJson(defaultValue)) out.default = defaultValue;
4166
4158
  const examples = annotations.examples;
4167
4159
  if (Array.isArray(examples) && isJson(examples)) out.examples = examples;
4168
- const readOnly = annotations.readOnly;
4169
- if (typeof readOnly === "boolean") out.readOnly = readOnly;
4170
- const writeOnly = annotations.writeOnly;
4171
- if (typeof writeOnly === "boolean") out.writeOnly = writeOnly;
4172
- const format = annotations.format;
4173
- if (typeof format === "string") out.format = format;
4174
- const contentEncoding = annotations.contentEncoding;
4175
- if (typeof contentEncoding === "string") out.contentEncoding = contentEncoding;
4176
- const contentMediaType = annotations.contentMediaType;
4177
- if (typeof contentMediaType === "string") out.contentMediaType = contentMediaType;
4178
4160
  const contentSchema = annotations.contentSchema;
4179
4161
  if (isJson(contentSchema)) out.contentSchema = contentSchema;
4180
4162
  if (options?.includeAnnotationKey !== void 0) for (const [key, value] of Object.entries(annotations)) {
@@ -4297,6 +4279,7 @@ function isApproximateCheckOutput(output) {
4297
4279
  return Array.isArray(output);
4298
4280
  }
4299
4281
  function compileJsonSchema(representations, rootPaths, references, options) {
4282
+ const numberKeyPattern = `^(?:${FINITE_PATTERN}|Infinity|-Infinity|NaN)$`;
4300
4283
  const compiledDefinitions = new Map();
4301
4284
  const definitionAliases = new Map();
4302
4285
  const compiledRepresentations = new WeakMap();
@@ -4305,7 +4288,7 @@ function compileJsonSchema(representations, rootPaths, references, options) {
4305
4288
  const referenceKeys = Object.keys(references);
4306
4289
  for (const key of referenceKeys) compileDefinition(key, ["references", key]);
4307
4290
  const compiledSchemas = map$3(representations, (representation, index) => recur(representation, rootPaths[index], []));
4308
- for (const [branches, schemas] of pendingOneOf.values()) if (!isExact(branches)) {
4291
+ for (const { branches, schemas } of pendingOneOf.values()) if (!isExact(branches)) {
4309
4292
  for (const schema of schemas) if (Array.isArray(schema.oneOf)) {
4310
4293
  schema.anyOf = schema.oneOf;
4311
4294
  delete schema.oneOf;
@@ -4315,9 +4298,9 @@ function compileJsonSchema(representations, rootPaths, references, options) {
4315
4298
  const representation = references[key];
4316
4299
  const fallback = getIdentifierFallback(representation);
4317
4300
  if (fallback === void 0) continue;
4318
- const schema = compiledDefinitions.get(key)[0];
4301
+ const schema = compiledDefinitions.get(key).schema;
4319
4302
  const candidates = fallbackDefinitions.get(fallback);
4320
- const match = candidates?.find((candidate) => equals(compiledDefinitions.get(candidate)[0], schema));
4303
+ const match = candidates?.find((candidate) => equals(compiledDefinitions.get(candidate).schema, schema));
4321
4304
  if (match === void 0) {
4322
4305
  if (candidates === void 0) fallbackDefinitions.set(fallback, [key]);
4323
4306
  else candidates.push(key);
@@ -4325,23 +4308,31 @@ function compileJsonSchema(representations, rootPaths, references, options) {
4325
4308
  }
4326
4309
  const schemas = map$3(compiledSchemas, finalizeJsonSchema);
4327
4310
  const definitions = {};
4328
- for (const key of referenceKeys) if (!definitionAliases.has(key)) assignProperty$1(definitions, key, finalizeJsonSchema(compiledDefinitions.get(key)[0]));
4311
+ for (const key of referenceKeys) if (!definitionAliases.has(key)) assignProperty$1(definitions, key, finalizeJsonSchema(compiledDefinitions.get(key).schema));
4329
4312
  return {
4330
4313
  dialect: "draft-2020-12",
4331
4314
  schemas,
4332
4315
  definitions
4333
4316
  };
4334
4317
  function registerPendingOneOf(schema) {
4335
- if (Array.isArray(schema.oneOf)) pendingOneOf.get(schema.oneOf)?.[1].push(schema);
4318
+ if (Array.isArray(schema.oneOf)) pendingOneOf.get(schema.oneOf)?.schemas.push(schema);
4336
4319
  return schema;
4337
4320
  }
4321
+ function compileAnnotatedMember(member, path, dependencies) {
4322
+ const schema = recur(member.type, [...path, "type"], dependencies);
4323
+ const annotations = collectJsonSchemaAnnotations(member.annotations, options);
4324
+ return annotations === void 0 ? schema : registerPendingOneOf(appendJsonSchema(schema, annotations));
4325
+ }
4338
4326
  function compileDefinition(key, path) {
4339
4327
  if (!Object.hasOwn(references, key)) throw errorWithPath(`Invalid reference ${key}`, [...path, "$ref"]);
4340
4328
  const cached = compiledDefinitions.get(key);
4341
4329
  if (cached !== void 0) return cached;
4342
- const result = [{}, []];
4330
+ const result = {
4331
+ schema: {},
4332
+ dependencies: []
4333
+ };
4343
4334
  compiledDefinitions.set(key, result);
4344
- result[0] = recur(references[key], ["references", key], result[1]);
4335
+ result.schema = recur(references[key], ["references", key], result.dependencies);
4345
4336
  return result;
4346
4337
  }
4347
4338
  function finalizeJsonSchema(schema) {
@@ -4409,22 +4400,30 @@ function compileJsonSchema(representations, rootPaths, references, options) {
4409
4400
  }
4410
4401
  function recur(representation, path, dependencies) {
4411
4402
  if (representation._tag === "Reference") {
4412
- dependencies.push(compileDefinition(representation.$ref, path)[1]);
4403
+ dependencies.push(compileDefinition(representation.$ref, path).dependencies);
4413
4404
  return { $ref: formatDefinitionReference(representation.$ref) };
4414
4405
  }
4415
4406
  const cached = compiledRepresentations.get(representation);
4416
4407
  if (cached !== void 0) {
4417
- dependencies.push(cached[1]);
4418
- return cached[0];
4408
+ dependencies.push(cached.dependencies);
4409
+ return cached.schema;
4419
4410
  }
4420
4411
  const local = [];
4421
4412
  dependencies.push(local);
4422
- let output = on(representation, path, local);
4423
- const ordinary = collectJsonSchemaAnnotations(representation.annotations, options);
4424
- if (ordinary !== void 0) output = {
4425
- ...output,
4426
- ...ordinary
4413
+ let output = {
4414
+ ...on(representation, path, local),
4415
+ ...collectJsonSchemaAnnotations(representation.annotations, options)
4427
4416
  };
4417
+ if (representation._tag === "String" && representation.content !== void 0) {
4418
+ const content = representation.content;
4419
+ output.contentMediaType = content.mediaType;
4420
+ delete output.contentSchema;
4421
+ if (content.schema !== void 0) output.contentSchema = recur(content.schema, [
4422
+ ...path,
4423
+ "content",
4424
+ "schema"
4425
+ ], []);
4426
+ }
4428
4427
  for (let index = 0; index < representation.checks.length; index++) {
4429
4428
  const type = typeof output.type === "string" && isJsonSchemaType(output.type) ? output.type : void 0;
4430
4429
  const check = compileCheck(representation.checks[index], type, [
@@ -4434,7 +4433,10 @@ function compileJsonSchema(representations, rootPaths, references, options) {
4434
4433
  ], local);
4435
4434
  if (check !== void 0) output = appendJsonSchema(output, ...check);
4436
4435
  }
4437
- compiledRepresentations.set(representation, [output, local]);
4436
+ compiledRepresentations.set(representation, {
4437
+ schema: output,
4438
+ dependencies: local
4439
+ });
4438
4440
  return registerPendingOneOf(output);
4439
4441
  }
4440
4442
  function on(representation, path, dependencies) {
@@ -4483,39 +4485,31 @@ function compileJsonSchema(representations, rootPaths, references, options) {
4483
4485
  };
4484
4486
  }
4485
4487
  case "Enum": {
4486
- const types = representation.enums.map(([title, literal], index) => {
4487
- if (typeof literal === "number" && !globalThis.Number.isFinite(literal)) throw errorWithPath(`Invalid numeric enum value ${globalThis.String(literal)}`, [
4488
- ...path,
4489
- "enums",
4490
- index,
4491
- 1
4492
- ]);
4493
- return {
4494
- type: typeof literal,
4495
- enum: [literal],
4496
- title
4497
- };
4498
- });
4488
+ const types = representation.enums.map(([title, literal]) => ({
4489
+ type: typeof literal,
4490
+ enum: [literal],
4491
+ title
4492
+ }));
4499
4493
  return types.length === 0 ? { not: {} } : { anyOf: types };
4500
4494
  }
4501
- case "TemplateLiteral": return {
4502
- type: "string",
4503
- pattern: `^${representation.parts.map(getPartPattern).join("")}$`
4504
- };
4495
+ case "TemplateLiteral": {
4496
+ const { exact, pattern } = getTemplateLiteralPattern(representation.parts);
4497
+ if (!exact) dependencies.push(false);
4498
+ return {
4499
+ type: "string",
4500
+ pattern
4501
+ };
4502
+ }
4505
4503
  case "Arrays": {
4506
- if (representation.rest.length > 1) throw errorWithPath("Invalid schema representation document", [...path, "rest"]);
4507
4504
  const out = { type: "array" };
4508
4505
  let minItems = representation.elements.length;
4509
4506
  const prefixItems = representation.elements.map((element, index) => {
4510
4507
  if (element.isOptional) minItems--;
4511
- const schema = recur(element.type, [
4508
+ return compileAnnotatedMember(element, [
4512
4509
  ...path,
4513
4510
  "elements",
4514
- index,
4515
- "type"
4511
+ index
4516
4512
  ], dependencies);
4517
- const annotations = collectJsonSchemaAnnotations(element.annotations, options);
4518
- return annotations === void 0 ? schema : registerPendingOneOf(appendJsonSchema(schema, annotations));
4519
4513
  });
4520
4514
  if (prefixItems.length > 0) {
4521
4515
  out.prefixItems = prefixItems;
@@ -4531,92 +4525,15 @@ function compileJsonSchema(representations, rootPaths, references, options) {
4531
4525
  ], dependencies);
4532
4526
  if (Object.keys(rest).length > 0) out.items = rest;
4533
4527
  else delete out.items;
4528
+ } else if (representation.rest.length > 1) {
4529
+ delete out.maxItems;
4530
+ delete out.items;
4531
+ out.minItems = minItems + representation.rest.length - 1;
4532
+ dependencies.push(false);
4534
4533
  }
4535
4534
  return out;
4536
4535
  }
4537
- case "Objects": {
4538
- if (representation.propertySignatures.length === 0 && representation.indexSignatures.length === 0) return { not: { type: "null" } };
4539
- const out = { type: "object" };
4540
- const properties = {};
4541
- const required = [];
4542
- for (let index = 0; index < representation.propertySignatures.length; index++) {
4543
- const property = representation.propertySignatures[index];
4544
- if (typeof property.name !== "string") throw errorWithPath("Invalid schema representation document", [
4545
- ...path,
4546
- "propertySignatures",
4547
- index,
4548
- "name"
4549
- ]);
4550
- const name = property.name;
4551
- const schema = recur(property.type, [
4552
- ...path,
4553
- "propertySignatures",
4554
- index,
4555
- "type"
4556
- ], dependencies);
4557
- const annotations = collectJsonSchemaAnnotations(property.annotations, options);
4558
- assignProperty$1(properties, name, annotations === void 0 ? schema : registerPendingOneOf(appendJsonSchema(schema, annotations)));
4559
- if (!property.isOptional) required.push(name);
4560
- }
4561
- if (representation.propertySignatures.length > 0) out.properties = properties;
4562
- if (required.length > 0) out.required = required;
4563
- const patternProperties = {};
4564
- const additionalPropertySchemas = [];
4565
- const indexValueSchemas = [];
4566
- let hasUnrepresentableIndexPattern = false;
4567
- for (let index = 0; index < representation.indexSignatures.length; index++) {
4568
- const signature = representation.indexSignatures[index];
4569
- let type = recur(signature.type, [
4570
- ...path,
4571
- "indexSignatures",
4572
- index,
4573
- "type"
4574
- ], dependencies);
4575
- if (equals(type, { not: {} })) type = false;
4576
- indexValueSchemas.push(type);
4577
- const patterns = getParameterPatterns(signature.parameter, [
4578
- ...path,
4579
- "indexSignatures",
4580
- index,
4581
- "parameter"
4582
- ], new Set());
4583
- if (patterns === void 0) {
4584
- hasUnrepresentableIndexPattern = true;
4585
- dependencies.push(false);
4586
- continue;
4587
- }
4588
- if (patterns.length === 0) additionalPropertySchemas.push(type);
4589
- else for (const pattern of patterns) {
4590
- const previous = patternProperties[pattern];
4591
- assignProperty$1(patternProperties, pattern, previous === void 0 ? type : previous === false || type === false ? false : registerPendingOneOf(appendJsonSchema(previous, type)));
4592
- }
4593
- }
4594
- const hasPatternProperties = Object.keys(patternProperties).length > 0;
4595
- if (hasPatternProperties) out.patternProperties = patternProperties;
4596
- if (hasUnrepresentableIndexPattern && options?.onExcessProperty === "error") {
4597
- const propertyNames = [];
4598
- if (representation.propertySignatures.length > 0) propertyNames.push({ enum: Object.keys(properties) });
4599
- for (let index = 0; index < representation.indexSignatures.length; index++) propertyNames.push(recur(representation.indexSignatures[index].parameter, [
4600
- ...path,
4601
- "indexSignatures",
4602
- index,
4603
- "parameter"
4604
- ], dependencies));
4605
- out.propertyNames = propertyNames.length === 1 ? propertyNames[0] : { anyOf: propertyNames };
4606
- out.additionalProperties = indexValueSchemas.length === 1 ? indexValueSchemas[0] : { anyOf: indexValueSchemas };
4607
- if (additionalPropertySchemas.length > 0) out.allOf = additionalPropertySchemas.map((type) => ({
4608
- type: "object",
4609
- additionalProperties: type
4610
- }));
4611
- } else if (additionalPropertySchemas.length === 0) out.additionalProperties = hasUnrepresentableIndexPattern || options?.onExcessProperty !== "error";
4612
- else if (additionalPropertySchemas.length === 1 && representation.propertySignatures.length === 0 && !hasPatternProperties) out.additionalProperties = additionalPropertySchemas[0];
4613
- else if (additionalPropertySchemas.length > 0) out.allOf = additionalPropertySchemas.map((type) => ({
4614
- type: "object",
4615
- additionalProperties: type
4616
- }));
4617
- if (typeof out.additionalProperties === "object" && out.additionalProperties !== null && Object.keys(out.additionalProperties).length === 0) delete out.additionalProperties;
4618
- return out;
4619
- }
4536
+ case "Objects": return compileObjects(representation, path, dependencies);
4620
4537
  case "Union": {
4621
4538
  const branches = [];
4622
4539
  const types = representation.types.map((type, index) => recur(type, [
@@ -4626,20 +4543,104 @@ function compileJsonSchema(representations, rootPaths, references, options) {
4626
4543
  ], branches));
4627
4544
  dependencies.push(branches);
4628
4545
  if (types.length === 0) return { not: {} };
4629
- const mode = representation.options?.mode ?? "anyOf";
4630
- if (mode === "anyOf" && types.length > 1) {
4546
+ if (representation.options?.mode === "oneOf") {
4547
+ pendingOneOf.set(types, {
4548
+ branches,
4549
+ schemas: []
4550
+ });
4551
+ return { oneOf: types };
4552
+ }
4553
+ if (types.length > 1) {
4631
4554
  const compacted = compactEnums(types);
4632
4555
  if (compacted !== void 0) return compacted;
4633
4556
  }
4634
- if (mode === "oneOf") pendingOneOf.set(types, [branches, []]);
4635
- return { [mode]: types };
4557
+ return { anyOf: types.flatMap((type) => Array.isArray(type.anyOf) && Object.keys(type).length === 1 ? type.anyOf : [type]) };
4636
4558
  }
4637
4559
  }
4638
4560
  }
4561
+ function compileObjects(representation, path, dependencies) {
4562
+ const { indexSignatures, propertySignatures } = representation;
4563
+ if (propertySignatures.length === 0 && indexSignatures.length === 0) return { not: { type: "null" } };
4564
+ const out = { type: "object" };
4565
+ const properties = {};
4566
+ const required = [];
4567
+ for (const [index, property] of propertySignatures.entries()) {
4568
+ const propertyPath = [
4569
+ ...path,
4570
+ "propertySignatures",
4571
+ index
4572
+ ];
4573
+ if (typeof property.name !== "string") throw errorWithPath("Objects property names must be strings", [...propertyPath, "name"]);
4574
+ assignProperty$1(properties, property.name, compileAnnotatedMember(property, propertyPath, dependencies));
4575
+ if (!property.isOptional) required.push(property.name);
4576
+ }
4577
+ if (propertySignatures.length > 0) out.properties = properties;
4578
+ if (required.length > 0) out.required = required;
4579
+ const indexes = indexSignatures.map((signature, index) => {
4580
+ const indexPath = [
4581
+ ...path,
4582
+ "indexSignatures",
4583
+ index
4584
+ ];
4585
+ const schema = recur(signature.type, [...indexPath, "type"], dependencies);
4586
+ const type = equals(schema, { not: {} }) ? false : schema;
4587
+ const patterns = getParameterPatterns(signature.parameter, [...indexPath, "parameter"], new Set());
4588
+ if (patterns === void 0) dependencies.push(false);
4589
+ return {
4590
+ type,
4591
+ patterns
4592
+ };
4593
+ });
4594
+ const patternProperties = {};
4595
+ for (const { patterns, type } of indexes) for (const pattern of patterns ?? []) {
4596
+ const previous = patternProperties[pattern];
4597
+ assignProperty$1(patternProperties, pattern, previous === void 0 ? type : previous === false || type === false ? false : registerPendingOneOf(appendJsonSchema(previous, type)));
4598
+ }
4599
+ const hasPatternProperties = Object.keys(patternProperties).length > 0;
4600
+ if (hasPatternProperties) out.patternProperties = patternProperties;
4601
+ const additionalPropertySchemas = indexes.filter(({ patterns }) => patterns?.length === 0).map(({ type }) => type);
4602
+ const hasUnrepresentableIndexPattern = indexes.some(({ patterns }) => patterns === void 0);
4603
+ if (hasUnrepresentableIndexPattern && options?.onExcessProperty === "error") {
4604
+ const propertyNames = [];
4605
+ if (propertySignatures.length > 0) propertyNames.push({ enum: Object.keys(properties) });
4606
+ for (const [index, signature] of indexSignatures.entries()) propertyNames.push(getPropertyNameSchema(signature.parameter, [
4607
+ ...path,
4608
+ "indexSignatures",
4609
+ index,
4610
+ "parameter"
4611
+ ], dependencies, new Set()));
4612
+ out.propertyNames = propertyNames.length === 1 ? propertyNames[0] : { anyOf: propertyNames };
4613
+ const values = indexes.map(({ type }) => type);
4614
+ out.additionalProperties = values.length === 1 ? values[0] : { anyOf: values };
4615
+ if (additionalPropertySchemas.length > 0) out.allOf = additionalPropertySchemas.map((type) => ({
4616
+ type: "object",
4617
+ additionalProperties: type
4618
+ }));
4619
+ } else if (additionalPropertySchemas.length === 0) out.additionalProperties = hasUnrepresentableIndexPattern || options?.onExcessProperty !== "error";
4620
+ else if (additionalPropertySchemas.length === 1 && propertySignatures.length === 0 && !hasPatternProperties) out.additionalProperties = additionalPropertySchemas[0];
4621
+ else out.allOf = additionalPropertySchemas.map((type) => ({
4622
+ type: "object",
4623
+ additionalProperties: type
4624
+ }));
4625
+ if (typeof out.additionalProperties === "object" && out.additionalProperties !== null && Object.keys(out.additionalProperties).length === 0) delete out.additionalProperties;
4626
+ return out;
4627
+ }
4628
+ function getPropertyNameSchema(parameter, path, dependencies, seenReferences) {
4629
+ switch (parameter._tag) {
4630
+ case "Number": return {
4631
+ type: "string",
4632
+ pattern: numberKeyPattern
4633
+ };
4634
+ case "Reference":
4635
+ if (seenReferences.has(parameter.$ref)) return { type: "string" };
4636
+ return getPropertyNameSchema(references[parameter.$ref], ["references", parameter.$ref], dependencies, new Set(seenReferences).add(parameter.$ref));
4637
+ case "Union": return { anyOf: parameter.types.map((type) => getPropertyNameSchema(type, path, dependencies, seenReferences)) };
4638
+ default: return recur(parameter, path, dependencies);
4639
+ }
4640
+ }
4639
4641
  function getParameterPatterns(parameter, path, seenReferences) {
4640
4642
  switch (parameter._tag) {
4641
4643
  case "Reference": {
4642
- if (!Object.hasOwn(references, parameter.$ref)) throw errorWithPath(`Invalid reference ${parameter.$ref}`, [...path, "$ref"]);
4643
4644
  compileDefinition(parameter.$ref, path);
4644
4645
  if (seenReferences.has(parameter.$ref)) return void 0;
4645
4646
  const next = new Set(seenReferences).add(parameter.$ref);
@@ -4653,7 +4654,11 @@ function compileJsonSchema(representations, rootPaths, references, options) {
4653
4654
  if (!isExact(dependencies)) return void 0;
4654
4655
  return schema.type === "string" && typeof schema.pattern === "string" && hasOnlyKeywords(schema, "|type|pattern|title|description|default|examples|readOnly|writeOnly|") ? [schema.pattern] : void 0;
4655
4656
  }
4656
- case "TemplateLiteral": return parameter.checks.length === 0 ? [`^${parameter.parts.map(getPartPattern).join("")}$`] : void 0;
4657
+ case "TemplateLiteral": {
4658
+ if (parameter.checks.length > 0) return void 0;
4659
+ const { exact, pattern } = getTemplateLiteralPattern(parameter.parts);
4660
+ return exact ? [pattern] : void 0;
4661
+ }
4657
4662
  case "Union": {
4658
4663
  if (parameter.types.length === 0 || parameter.checks.length > 0 || parameter.options?.mode === "oneOf") return;
4659
4664
  const patterns = [];
@@ -4669,7 +4674,39 @@ function compileJsonSchema(representations, rootPaths, references, options) {
4669
4674
  }
4670
4675
  return patterns;
4671
4676
  }
4672
- default: throw errorWithPath("Invalid schema representation document", path);
4677
+ case "Number": return parameter.checks.length === 0 ? [numberKeyPattern] : void 0;
4678
+ default: throw errorWithPath(`Invalid index signature parameter ${parameter._tag}`, path);
4679
+ }
4680
+ }
4681
+ function getTemplateLiteralPattern(parts) {
4682
+ const activeReferences = new Set();
4683
+ let exact = true;
4684
+ return {
4685
+ pattern: `^${parts.map(getPartPattern).join("")}$`,
4686
+ exact
4687
+ };
4688
+ function getPartPattern(part) {
4689
+ if (part._tag !== "Reference" && part.checks.length > 0) exact = false;
4690
+ switch (part._tag) {
4691
+ case "Reference": {
4692
+ if (!Object.hasOwn(references, part.$ref)) throw errorWithPath(`Invalid reference ${part.$ref}`, []);
4693
+ if (activeReferences.has(part.$ref)) throw errorWithPath(`Invalid recursive TemplateLiteral part ${part.$ref}`, []);
4694
+ activeReferences.add(part.$ref);
4695
+ const pattern = getPartPattern(references[part.$ref]);
4696
+ activeReferences.delete(part.$ref);
4697
+ return pattern;
4698
+ }
4699
+ case "Literal": return escape(globalThis.String(part.literal));
4700
+ case "String": return STRING_PATTERN;
4701
+ case "Number": return FINITE_PATTERN;
4702
+ case "BigInt": return "-?\\d+";
4703
+ case "TemplateLiteral": return part.parts.map(getPartPattern).join("");
4704
+ case "Union":
4705
+ if (part.types.length === 0) return "(?!)";
4706
+ if (part.options?.mode === "oneOf") exact = false;
4707
+ return `(?:${part.types.map(getPartPattern).join("|")})`;
4708
+ default: throw errorWithPath(`Invalid TemplateLiteral part ${part._tag}`, []);
4709
+ }
4673
4710
  }
4674
4711
  }
4675
4712
  }
@@ -4693,16 +4730,6 @@ function compactEnums(schemas) {
4693
4730
  enum: values
4694
4731
  };
4695
4732
  }
4696
- function getPartPattern(part) {
4697
- switch (part._tag) {
4698
- case "Literal": return escape(globalThis.String(part.literal));
4699
- case "String": return STRING_PATTERN;
4700
- case "Number": return FINITE_PATTERN;
4701
- case "TemplateLiteral": return part.parts.map(getPartPattern).join("");
4702
- case "Union": return `(?:${part.types.map(getPartPattern).join("|")})`;
4703
- default: throw errorWithPath("Invalid schema representation document", []);
4704
- }
4705
- }
4706
4733
  function toJsonSchemaDocument$1(document, options) {
4707
4734
  const output = compileJsonSchema([document.representation], [["representation"]], document.references, options);
4708
4735
  return {
@@ -4711,8 +4738,7 @@ function toJsonSchemaDocument$1(document, options) {
4711
4738
  definitions: output.definitions
4712
4739
  };
4713
4740
  }
4714
- //#endregion
4715
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/schema/toRepresentation.js
4741
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/schema/toRepresentation.js
4716
4742
  const defaultReferencePolicy = ({ identifier }) => identifier;
4717
4743
  function annotationsField(annotations) {
4718
4744
  return annotations === void 0 ? void 0 : { annotations };
@@ -4726,33 +4752,28 @@ function toRepresentation(ast, options) {
4726
4752
  }
4727
4753
  function toRepresentations(asts, options) {
4728
4754
  const references = {};
4729
- const referenceOwners = new Map();
4730
- const buildingReferences = new Set();
4755
+ const usedReferences = new Set();
4731
4756
  const candidates = new Map();
4732
- const visitingCandidates = new Set();
4733
4757
  for (const ast of asts) visit(ast);
4734
4758
  const referencePolicy = options?.referencePolicy ?? defaultReferencePolicy;
4735
- for (const candidatesByIdentifier of candidates.values()) for (const candidate of candidatesByIdentifier.values()) {
4759
+ for (const variants of candidates.values()) for (const candidate of variants) {
4736
4760
  const requestedReference = referencePolicy({
4737
4761
  ast: candidate.ast,
4738
4762
  occurrences: candidate.occurrences,
4739
4763
  identifier: candidate.identifier
4740
4764
  });
4741
- if (requestedReference !== void 0) candidate.reference = getReference(requestedReference, candidate, requestedReference === candidate.identifier || !requestedReference.endsWith("_") ? "_" : "");
4742
- else if (candidate.isRecursive) candidate.reference = getReference(`${candidate.ast._tag}_`, candidate, "");
4765
+ if (requestedReference !== void 0) candidate.reference = getReference(requestedReference, requestedReference === candidate.identifier || !requestedReference.endsWith("_") ? "_" : "");
4766
+ else if (candidate.isRecursive) candidate.reference = getReference(`${candidate.ast._tag}_`, "");
4743
4767
  }
4744
4768
  return {
4745
- representations: map$3(asts, (ast) => recur(ast)),
4769
+ representations: map$3(asts, recur),
4746
4770
  references
4747
4771
  };
4748
- function getReference(prefix, owner, separator = "_") {
4772
+ function getReference(prefix, separator) {
4749
4773
  let candidate = prefix;
4750
4774
  let suffix = 0;
4751
- while (referenceOwners.has(candidate)) {
4752
- if (referenceOwners.get(candidate) === owner) return candidate;
4753
- candidate = `${prefix}${separator}${++suffix}`;
4754
- }
4755
- referenceOwners.set(candidate, owner);
4775
+ while (usedReferences.has(candidate)) candidate = `${prefix}${separator}${++suffix}`;
4776
+ usedReferences.add(candidate);
4756
4777
  return candidate;
4757
4778
  }
4758
4779
  function annotateReference(ast, candidate, reference) {
@@ -4760,70 +4781,68 @@ function toRepresentations(asts, options) {
4760
4781
  if (fallback !== void 0) return resolveIdentifierFallback(ast) === fallback ? ast : annotate(ast, { [IDENTIFIER_FALLBACK_KEY]: fallback });
4761
4782
  return reference === candidate.identifier ? ast : annotate(ast, { identifier: reference });
4762
4783
  }
4763
- function makeReference(reference, ast) {
4764
- if (!Object.hasOwn(references, reference) && !buildingReferences.has(reference)) {
4765
- buildingReferences.add(reference);
4766
- const representation = on(ast);
4767
- buildingReferences.delete(reference);
4768
- assignProperty$1(references, reference, representation);
4784
+ function getCandidate(input, encodingLength = input.encoding?.length ?? 0) {
4785
+ let ast = input;
4786
+ let content;
4787
+ while (ast.encoding !== void 0 && encodingLength > 0) {
4788
+ const last = ast.encoding[encodingLength - 1];
4789
+ if (last.to.encoding === void 0 && last.to._tag === "String") {
4790
+ const metadata = getContent(last.transformation.encode);
4791
+ if (metadata !== void 0) content = {
4792
+ mediaType: metadata.mediaType,
4793
+ schema: metadata.preserveSchema ? getCandidate(ast, encodingLength - 1) : void 0
4794
+ };
4795
+ }
4796
+ ast = last.to;
4797
+ encodingLength = ast.encoding?.length ?? 0;
4769
4798
  }
4770
- return {
4771
- _tag: "Reference",
4772
- $ref: reference
4773
- };
4774
- }
4775
- function getCandidate(input) {
4776
- const ast = getLastEncoding(input);
4777
4799
  const owner = getContextOwner(ast);
4778
4800
  let identifier = resolveIdentifier$1(ast);
4779
4801
  const fallback = identifier === void 0 ? (ast !== input ? resolveIdentifier$1(input) : void 0) ?? resolveIdentifierFallback(ast) : void 0;
4780
4802
  if (fallback !== void 0) identifier = `${fallback}Encoded`;
4781
- let candidatesByIdentifier = candidates.get(owner);
4782
- if (candidatesByIdentifier === void 0) {
4783
- candidatesByIdentifier = new Map();
4784
- candidates.set(owner, candidatesByIdentifier);
4803
+ let variants = candidates.get(owner);
4804
+ if (variants === void 0) {
4805
+ variants = [];
4806
+ candidates.set(owner, variants);
4785
4807
  }
4786
- let candidate = candidatesByIdentifier.get(identifier);
4808
+ let candidate = variants.find((candidate) => candidate.identifier === identifier && candidate.content?.mediaType === content?.mediaType && candidate.content?.schema === content?.schema);
4787
4809
  if (candidate === void 0) {
4788
4810
  candidate = {
4789
4811
  ast: owner,
4790
4812
  identifier,
4791
4813
  fallback,
4792
- occurrences: 0,
4793
- isRecursive: false,
4794
- reference: void 0
4814
+ content,
4815
+ occurrences: 0
4795
4816
  };
4796
- candidatesByIdentifier.set(identifier, candidate);
4817
+ variants.push(candidate);
4797
4818
  }
4798
4819
  return candidate;
4799
4820
  }
4800
4821
  function visit(input) {
4801
- const candidate = getCandidate(input);
4822
+ visitCandidate(getCandidate(input));
4823
+ return input;
4824
+ }
4825
+ function visitCandidate(candidate) {
4802
4826
  const ast = candidate.ast;
4803
4827
  candidate.occurrences++;
4804
- if (visitingCandidates.has(candidate)) {
4828
+ if (candidate.visiting) {
4805
4829
  candidate.isRecursive = true;
4806
4830
  return;
4807
4831
  }
4808
4832
  if (candidate.occurrences > 1) return;
4809
- visitingCandidates.add(candidate);
4833
+ candidate.visiting = true;
4834
+ if (candidate.content?.schema !== void 0) visitCandidate(candidate.content.schema);
4810
4835
  visitChecks(ast.checks);
4811
4836
  switch (ast._tag) {
4812
- case "Declaration":
4813
- case "Arrays":
4814
- case "Objects":
4815
- case "Union":
4816
- ast.recur((child) => {
4817
- visit(child);
4818
- return child;
4819
- });
4837
+ default:
4838
+ if ("recur" in ast) ast.recur(visit);
4820
4839
  break;
4821
4840
  case "TemplateLiteral":
4822
4841
  ast.parts.forEach(visit);
4823
4842
  break;
4824
4843
  case "Suspend": visit(ast.thunk());
4825
4844
  }
4826
- visitingCandidates.delete(candidate);
4845
+ candidate.visiting = false;
4827
4846
  }
4828
4847
  function visitChecks(checks) {
4829
4848
  checks?.forEach((check) => {
@@ -4832,63 +4851,65 @@ function toRepresentations(asts, options) {
4832
4851
  });
4833
4852
  }
4834
4853
  function recur(input) {
4835
- const candidate = getCandidate(input);
4854
+ return recurCandidate(getCandidate(input));
4855
+ }
4856
+ function recurCandidate(candidate) {
4836
4857
  const ast = candidate.ast;
4837
4858
  const reference = candidate.reference;
4838
- if (reference !== void 0) return makeReference(reference, candidate.identifier === void 0 ? ast : annotateReference(ast, candidate, reference));
4839
- return on(ast);
4859
+ if (reference !== void 0) {
4860
+ if (!candidate.emitted) {
4861
+ candidate.emitted = true;
4862
+ const representation = on(candidate.identifier === void 0 ? ast : annotateReference(ast, candidate, reference), candidate.content);
4863
+ assignProperty$1(references, reference, representation);
4864
+ }
4865
+ return {
4866
+ _tag: "Reference",
4867
+ $ref: reference
4868
+ };
4869
+ }
4870
+ return on(ast, candidate.content);
4840
4871
  }
4841
- function on(ast) {
4842
- const checks = fromChecks(ast.checks);
4872
+ function on(ast, content) {
4873
+ const common = {
4874
+ checks: ast.checks?.map(fromCheck) ?? [],
4875
+ ...ast._tag === "Declaration" ? fromAnnotations(ast.annotations) : annotationsField(ast.annotations)
4876
+ };
4843
4877
  switch (ast._tag) {
4844
4878
  case "Declaration": return {
4845
- _tag: "Declaration",
4846
- typeParameters: ast.typeParameters.map((ast) => recur(ast)),
4847
- checks,
4848
- ...fromDeclarationAnnotations(ast.annotations)
4879
+ _tag: ast._tag,
4880
+ typeParameters: ast.typeParameters.map(recur),
4881
+ ...common
4849
4882
  };
4850
- case "Null":
4851
- case "Undefined":
4852
- case "Void":
4853
- case "Never":
4854
- case "Unknown":
4855
- case "Any":
4856
- case "String":
4857
- case "Boolean":
4858
- case "Number":
4859
- case "BigInt":
4860
- case "Symbol":
4861
- case "ObjectKeyword": return {
4883
+ default: return {
4862
4884
  _tag: ast._tag,
4863
- checks,
4864
- ...annotationsField(ast.annotations)
4885
+ ...content === void 0 ? void 0 : { content: {
4886
+ mediaType: content.mediaType,
4887
+ ...content.schema === void 0 ? void 0 : { schema: recurCandidate(content.schema) }
4888
+ } },
4889
+ ...common
4865
4890
  };
4866
4891
  case "Literal": return {
4867
- _tag: "Literal",
4892
+ _tag: ast._tag,
4868
4893
  literal: ast.literal,
4869
- checks,
4870
- ...annotationsField(ast.annotations)
4894
+ ...common
4871
4895
  };
4872
4896
  case "UniqueSymbol": return {
4873
- _tag: "UniqueSymbol",
4897
+ _tag: ast._tag,
4874
4898
  symbol: ast.symbol,
4875
- checks,
4876
- ...annotationsField(ast.annotations)
4899
+ ...common
4877
4900
  };
4878
4901
  case "Enum": return {
4879
- _tag: "Enum",
4902
+ _tag: ast._tag,
4880
4903
  enums: ast.enums,
4881
- checks,
4882
- ...annotationsField(ast.annotations)
4904
+ ...common
4883
4905
  };
4884
4906
  case "TemplateLiteral": return {
4885
- _tag: "TemplateLiteral",
4886
- parts: ast.parts.map((ast) => recur(ast)),
4887
- checks,
4888
- ...annotationsField(ast.annotations)
4907
+ _tag: ast._tag,
4908
+ parts: ast.parts.map(recur),
4909
+ ...common
4889
4910
  };
4890
4911
  case "Arrays": return {
4891
- _tag: "Arrays",
4912
+ _tag: ast._tag,
4892
4913
  elements: ast.elements.map((element) => {
4893
4914
  const projected = getLastEncoding(element);
4894
4915
  const annotations = projected.context?.annotations;
@@ -4898,12 +4919,11 @@ function toRepresentations(asts, options) {
4898
4919
  ...annotationsField(annotations)
4899
4920
  };
4900
4921
  }),
4901
- rest: ast.rest.map((ast) => recur(ast)),
4902
- checks,
4903
- ...annotationsField(ast.annotations)
4922
+ rest: ast.rest.map(recur),
4923
+ ...common
4904
4924
  };
4905
4925
  case "Objects": return {
4906
- _tag: "Objects",
4926
+ _tag: ast._tag,
4907
4927
  propertySignatures: ast.propertySignatures.map((property) => {
4908
4928
  const projected = getLastEncoding(property.type);
4909
4929
  const annotations = projected.context?.annotations;
@@ -4919,64 +4939,48 @@ function toRepresentations(asts, options) {
4919
4939
  parameter: recur(index.parameter),
4920
4940
  type: recur(index.type)
4921
4941
  })),
4922
- checks,
4923
- ...annotationsField(ast.annotations)
4942
+ ...common
4924
4943
  };
4925
4944
  case "Union": return {
4926
- _tag: "Union",
4927
- types: ast.types.map((ast) => recur(ast)),
4945
+ _tag: ast._tag,
4946
+ types: ast.types.map(recur),
4928
4947
  ...ast.options === void 0 ? {} : { options: ast.options },
4929
- checks,
4930
- ...annotationsField(ast.annotations)
4948
+ ...common
4931
4949
  };
4932
4950
  case "Suspend": return {
4933
- _tag: "Suspend",
4951
+ _tag: ast._tag,
4952
+ ...common,
4934
4953
  checks: [],
4935
- thunk: recur(ast.thunk()),
4936
- ...annotationsField(ast.annotations)
4954
+ thunk: recur(ast.thunk())
4937
4955
  };
4938
4956
  }
4939
4957
  }
4940
- function fromChecks(checks) {
4941
- return checks?.map(fromCheck) ?? [];
4942
- }
4943
4958
  function fromCheck(check) {
4944
- switch (check._tag) {
4945
- case "Filter": return {
4946
- _tag: "Filter",
4947
- aborted: check.aborted,
4948
- ...fromCheckAnnotations(check.annotations)
4949
- };
4950
- case "FilterGroup": return {
4951
- _tag: "FilterGroup",
4952
- checks: map$3(check.checks, fromCheck),
4953
- ...fromCheckAnnotations(check.annotations)
4954
- };
4955
- }
4956
- }
4957
- function fromDeclarationAnnotations(annotations) {
4958
- if (annotations === void 0) return void 0;
4959
- const { representation, ...ordinary } = annotations;
4960
4959
  return {
4961
- ...representation === void 0 ? void 0 : { representation },
4962
- ...Object.keys(ordinary).length === 0 ? void 0 : { annotations: ordinary }
4960
+ ...check._tag === "Filter" ? {
4961
+ _tag: check._tag,
4962
+ aborted: check.aborted
4963
+ } : {
4964
+ _tag: check._tag,
4965
+ checks: map$3(check.checks, fromCheck)
4966
+ },
4967
+ ...fromAnnotations(check.annotations, true)
4963
4968
  };
4964
4969
  }
4965
- function fromCheckAnnotations(annotations) {
4970
+ function fromAnnotations(annotations, projectSchemas = false) {
4966
4971
  if (annotations === void 0) return void 0;
4967
4972
  const { representation, ...ordinary } = annotations;
4968
- const projected = representation === void 0 ? void 0 : representation.schemas === void 0 ? representation : {
4973
+ const projected = projectSchemas && representation?.schemas !== void 0 ? {
4969
4974
  ...representation,
4970
4975
  schemas: representation.schemas.map((schema) => recur(toType$1(schema)))
4971
- };
4976
+ } : representation;
4972
4977
  return {
4973
4978
  ...projected === void 0 ? void 0 : { representation: projected },
4974
4979
  ...Object.keys(ordinary).length === 0 ? void 0 : { annotations: ordinary }
4975
4980
  };
4976
4981
  }
4977
4982
  }
4978
- //#endregion
4979
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Struct.js
4983
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Struct.js
4980
4984
  const omit = dual(2, (self, keys) => {
4981
4985
  return buildStruct(self, (k, v) => !hasPropertyKey(keys, k) ? [k, v] : void 0);
4982
4986
  });
@@ -4999,14 +5003,18 @@ function buildStruct(source, f) {
4999
5003
  }
5000
5004
  return out;
5001
5005
  }
5002
- //#endregion
5003
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/schemaError.js
5006
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/schemaError.js
5004
5007
  const SchemaErrorTypeId = "~effect/Schema/SchemaError";
5005
5008
  function isSchemaError$1(u) {
5006
5009
  return hasProperty(u, "~effect/Schema/SchemaError") && u["~effect/Schema/SchemaError"] === "~effect/Schema/SchemaError";
5007
5010
  }
5008
- //#endregion
5009
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/net/NetAddress.js
5011
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Bytes.js
5012
+ const Equivalence = make$9((self, that) => {
5013
+ if (self.length !== that.length) return false;
5014
+ for (let i = 0; i < self.length; i++) if (self[i] !== that[i]) return false;
5015
+ return true;
5016
+ });
5017
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/net/NetAddress.js
5010
5018
  const TypeId$2 = "~effect/net/NetAddress";
5011
5019
  const ipv4Value = (self) => self.value;
5012
5020
  const ipv6Words = (self) => self;
@@ -5065,7 +5073,7 @@ const MacProto = {
5065
5073
  _tag: "MacAddress",
5066
5074
  [TypeId$2]: TypeId$2,
5067
5075
  [symbol$2](that) {
5068
- return isMacAddress(that) && bytesEqual(getMacBytes(this), getMacBytes(that));
5076
+ return isMacAddress(that) && Equivalence(getMacBytes(this), getMacBytes(that));
5069
5077
  },
5070
5078
  [symbol$1]() {
5071
5079
  return combine(macHashSeed, array(getMacBytes(this)));
@@ -5077,11 +5085,6 @@ const MacProto = {
5077
5085
  return this.toString();
5078
5086
  }
5079
5087
  };
5080
- const bytesEqual = (self, that) => {
5081
- if (self.length !== that.length) return false;
5082
- for (let index = 0; index < self.length; index++) if (self[index] !== that[index]) return false;
5083
- return true;
5084
- };
5085
5088
  const ipv4HashSeed = string$1("Ipv4Address");
5086
5089
  const ipv6HashSeed = string$1("Ipv6Address");
5087
5090
  const macHashSeed = string$1("MacAddress");
@@ -5267,8 +5270,7 @@ const UnixPathProto = {
5267
5270
  return this.toString();
5268
5271
  }
5269
5272
  };
5270
- //#endregion
5271
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/net/Host.js
5273
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/net/Host.js
5272
5274
  const TypeId$1 = "~effect/net/Host";
5273
5275
  const labelPattern = /^[a-z0-9_](?:[a-z0-9_-]{0,61}[a-z0-9_])?$/;
5274
5276
  const numericLabel = /^(?:\d+|0x[0-9a-f]*)$/;
@@ -5309,8 +5311,7 @@ const formatHostPort = (self) => {
5309
5311
  const host = formatHost(self.host);
5310
5312
  return host.includes(":") ? `[${host}]:${self.port}` : `${host}:${self.port}`;
5311
5313
  };
5312
- //#endregion
5313
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/net/Dns.js
5314
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/net/Dns.js
5314
5315
  const RecordTypeId = "~effect/net/Dns/DnsRecord";
5315
5316
  const isUint8 = (u) => Number.isInteger(u) && u >= 0 && u <= 255;
5316
5317
  const isUint16 = (u) => Number.isInteger(u) && u >= 0 && u <= 65535;
@@ -5447,8 +5448,7 @@ const formatRecord = (self) => {
5447
5448
  case "TXT": return `TXT ${self.chunks.map(quote).join(" ")}`;
5448
5449
  }
5449
5450
  };
5450
- //#endregion
5451
- //#region node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/Schema.js
5451
+ // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Schema.js
5452
5452
  const TypeId = TypeId$3;
5453
5453
  function declareConstructor() {
5454
5454
  return (typeParameters, run, annotations) => {
@@ -5541,7 +5541,6 @@ const optional = lambda((self) => {
5541
5541
  const schema = UndefinedOr(self);
5542
5542
  return make(optional$1(self.ast), { schema });
5543
5543
  });
5544
- const mutableKey = lambda((schema) => make(mutableKey$1(schema.ast), { schema }));
5545
5544
  const toType = lambda((schema) => make(toType$1(schema.ast), { schema }));
5546
5545
  const toEncoded = lambda((schema) => make(toEncoded$1(schema.ast), { schema }));
5547
5546
  function Literal(literal) {
@@ -5556,15 +5555,6 @@ function Literal(literal) {
5556
5555
  });
5557
5556
  return out;
5558
5557
  }
5559
- function templateLiteralParts(parts) {
5560
- return parts.map((part) => isSchema(part) ? part.ast : new Literal$1(part));
5561
- }
5562
- function TemplateLiteral(parts) {
5563
- return make(new TemplateLiteral$1(templateLiteralParts(parts)), { parts });
5564
- }
5565
- function Enum(enums) {
5566
- return make(new Enum$1(Object.keys(enums).filter((key) => typeof enums[enums[key]] !== "number").map((key) => [key, enums[key]])), { enums });
5567
- }
5568
5558
  const Never = make(never);
5569
5559
  const Any = make(any);
5570
5560
  const Unknown = make(unknown);
@@ -5577,10 +5567,6 @@ const Boolean = make(boolean);
5577
5567
  const Symbol$1 = make(symbol);
5578
5568
  const BigInt$1 = make(bigInt);
5579
5569
  const Void = make(void_);
5580
- const ObjectKeyword = make(objectKeyword);
5581
- function UniqueSymbol(symbol) {
5582
- return make(new UniqueSymbol$1(symbol));
5583
- }
5584
5570
  function makeStruct(ast, fields) {
5585
5571
  return make(ast, {
5586
5572
  fields,
@@ -5839,7 +5825,7 @@ function isPattern(regExp, annotations) {
5839
5825
  const source = regExp.source;
5840
5826
  const flags = regExp.flags;
5841
5827
  const canExport = /^[dg]*uy?$/.test(flags);
5842
- const runtimeRegExp = flags === "" ? `new RegExp(${format$1(source)})` : `new RegExp(${format$1(source)}, ${format$1(flags)})`;
5828
+ const runtimeRegExp = flags === "" ? `new globalThis.RegExp(${format$1(source)})` : `new globalThis.RegExp(${format$1(source)}, ${format$1(flags)})`;
5843
5829
  return isPattern$1(regExp, {
5844
5830
  toJsonSchema: () => canExport ? { pattern: flags.endsWith("y") ? `^(?:${source})` : source } : [{}, true],
5845
5831
  toCode: () => ({ runtime: `Schema.isPattern(${runtimeRegExp})` }),
@@ -5867,14 +5853,19 @@ function isUUID(version, annotations) {
5867
5853
  });
5868
5854
  }
5869
5855
  function isBase64(annotations) {
5870
- const regExp = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
5871
- return isPattern(regExp, {
5856
+ const pattern = "^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$";
5857
+ const regExp = /^[0-9a-zA-Z+/]*={0,2}$/;
5858
+ return makeFilter((s) => s.length % 4 === 0 && regExp.test(s), {
5872
5859
  expected: "a base64 encoded string",
5873
5860
  representation: {
5874
5861
  id: "effect/schema/isBase64",
5875
5862
  payload: null
5876
5863
  },
5877
- toJsonSchema: () => ({ pattern: regExp.source }),
5864
+ toJsonSchema: () => ({ pattern }),
5865
+ arbitraryConstraint: { patterns: [{
5866
+ source: pattern,
5867
+ flags: ""
5868
+ }] },
5878
5869
  toCode: () => ({ runtime: "Schema.isBase64()" }),
5879
5870
  ...annotations
5880
5871
  });
@@ -6137,7 +6128,7 @@ function encodeDatePayload(date) {
6137
6128
  return date.toISOString();
6138
6129
  }
6139
6130
  function formatDateRuntime(date) {
6140
- return `new Date(${format$1(date.getTime())})`;
6131
+ return `new globalThis.Date(${format$1(date.getTime())})`;
6141
6132
  }
6142
6133
  const isGreaterThanDate = makeIsGreaterThan({
6143
6134
  order: Date$3,
@@ -6647,10 +6638,7 @@ const Date$1 = declare((input) => input instanceof globalThis.Date && !globalThi
6647
6638
  expected: "a valid Date",
6648
6639
  toCodecJson: () => link()(DateString, dateFromString)
6649
6640
  });
6650
- const JsonString = String$1.annotate({
6651
- expected: "a string that will be decoded as JSON",
6652
- contentMediaType: "application/json"
6653
- });
6641
+ const JsonString = String$1.annotate({ expected: "a string that will be decoded as JSON" });
6654
6642
  function fromJsonString(schema, options) {
6655
6643
  return JsonString.pipe(decodeTo(schema, fromJsonString$1(options)));
6656
6644
  }
@@ -6694,42 +6682,6 @@ const File = instanceOf(globalThis.File, {
6694
6682
  })
6695
6683
  }))
6696
6684
  });
6697
- const FormData$1 = instanceOf(globalThis.FormData, {
6698
- representation: {
6699
- id: "effect/schema/FormData",
6700
- payload: null
6701
- },
6702
- toCode: () => ({
6703
- runtime: `Schema.FormData`,
6704
- Type: `globalThis.FormData`
6705
- }),
6706
- expected: "FormData",
6707
- toCodecJson: () => link()(ArraySchema(Tuple([String$1, Union([Struct({
6708
- _tag: tag("String"),
6709
- value: String$1
6710
- }), Struct({
6711
- _tag: tag("File"),
6712
- value: File
6713
- })])])), transformEffect({
6714
- decode: (e) => {
6715
- const out = new globalThis.FormData();
6716
- for (const [key, entry] of e) out.append(key, entry.value);
6717
- return succeed$3(out);
6718
- },
6719
- encode: (formData) => {
6720
- return succeed$3(globalThis.Array.from(formData.entries()).map(([key, value]) => {
6721
- if (typeof value === "string") return [key, {
6722
- _tag: "String",
6723
- value
6724
- }];
6725
- else return [key, {
6726
- _tag: "File",
6727
- value
6728
- }];
6729
- }));
6730
- }
6731
- }))
6732
- });
6733
6685
  const URLSearchParams$1 = instanceOf(globalThis.URLSearchParams, {
6734
6686
  representation: {
6735
6687
  id: "effect/schema/URLSearchParams",
@@ -6863,7 +6815,7 @@ function Cause(error, defect) {
6863
6815
  if (!isCause(input)) return fail$2(new InvalidType(ast, input, options));
6864
6816
  return mapBothEager(decodeUnknownEffect$1(failures)(input.reasons, options), {
6865
6817
  onSuccess: fromReasons,
6866
- onFailure: (issue) => makeCompositeAtKey(ast, "failures", issue, input, options)
6818
+ onFailure: (issue) => makeCompositeAtKey(ast, "reasons", issue, input, options)
6867
6819
  });
6868
6820
  };
6869
6821
  }, {
@@ -7168,7 +7120,7 @@ const UrlParams = declare(isUrlParams, {
7168
7120
  importDeclarations: [`import * as UrlParams from "effect/http/UrlParams"`]
7169
7121
  }),
7170
7122
  expected: "UrlParams",
7171
- toEquivalence: () => Equivalence,
7123
+ toEquivalence: () => Equivalence$1,
7172
7124
  toCodec: () => link()(ArraySchema(Tuple([String$1, String$1])), transform({
7173
7125
  decode: make$3,
7174
7126
  encode: (self) => self.params.map(([key, value]) => [key, unwrap(value)])
@@ -7181,7 +7133,7 @@ const RecordFromUrlParams = UrlParams.pipe(decodeTo(Record(String$1, Union([Stri
7181
7133
  function OptionFromOptional(schema) {
7182
7134
  return optional(schema).pipe(decodeTo(Option(toType(schema)), optionFromOptional()));
7183
7135
  }
7184
- function Redacted(value$4, options) {
7136
+ function Redacted(value$3, options) {
7185
7137
  const label = typeof options?.label === "string" ? options.label : void 0;
7186
7138
  const disallowJsonEncode = options?.disallowJsonEncode === true;
7187
7139
  const normalizedOptions = label !== void 0 ? disallowJsonEncode ? {
@@ -7189,10 +7141,10 @@ function Redacted(value$4, options) {
7189
7141
  disallowJsonEncode: true
7190
7142
  } : { label } : disallowJsonEncode ? { disallowJsonEncode: true } : void 0;
7191
7143
  const decodeLabel = label !== void 0 ? decodeUnknownEffect$1(Literal(label)) : void 0;
7192
- const schema = declareConstructor()([value$4], ([value$3]) => (input, ast, poptions) => {
7144
+ const schema = declareConstructor()([value$3], ([value$5]) => (input, ast, poptions) => {
7193
7145
  if (isRedacted(input)) {
7194
7146
  const label = decodeLabel !== void 0 ? mapErrorEager(decodeLabel(input.label, poptions), (issue) => new Pointer(["label"], issue)) : void_$2;
7195
- return flatMapEager(label, () => mapBothEager(decodeUnknownEffect$1(value$3)(value(input), poptions), {
7147
+ return flatMapEager(label, () => mapBothEager(decodeUnknownEffect$1(value$5)(value(input), poptions), {
7196
7148
  onSuccess: (value) => make$7(value, { label: input.label }),
7197
7149
  onFailure: () => {
7198
7150
  return new Composite(ast, [new Pointer(["value"], new InvalidValue(void 0, input, poptions))], input, poptions);
@@ -7211,22 +7163,22 @@ function Redacted(value$4, options) {
7211
7163
  importDeclarations: [`import * as Redacted from "effect/Redacted"`]
7212
7164
  }),
7213
7165
  expected: "Redacted",
7214
- toCodecJson: ([value$5]) => link()(value$5, {
7166
+ toCodecJson: ([value$2]) => link()(value$2, {
7215
7167
  decode: transform$1((e) => make$7(e, { label })),
7216
7168
  encode: disallowJsonEncode ? forbidden((oe) => "Cannot serialize Redacted" + (isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : transform$1(value)
7217
7169
  }),
7218
7170
  toEquivalence: ([value]) => makeEquivalence(value)
7219
7171
  });
7220
- return make(schema.ast, { value: value$4 });
7172
+ return make(schema.ast, { value: value$3 });
7221
7173
  }
7222
- function RedactedFromValue(value$2, options) {
7223
- return decodeTo(Redacted(toType(value$2), {
7174
+ function RedactedFromValue(value$4, options) {
7175
+ return decodeTo(Redacted(toType(value$4), {
7224
7176
  label: options?.label,
7225
7177
  disallowJsonEncode: options?.disallowEncode
7226
7178
  }), {
7227
7179
  decode: transform$1((t) => make$7(t, { label: options?.label })),
7228
7180
  encode: options?.disallowEncode ? forbidden((oe) => "Cannot encode Redacted" + (isSome(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : transform$1(value)
7229
- })(value$2);
7181
+ })(value$4);
7230
7182
  }
7231
7183
  const immerable = globalThis.Symbol.for("immer-draftable");
7232
7184
  const payloadToken = {};
@@ -7263,7 +7215,7 @@ function makeClass(Inherited, identifier, struct$1, annotations, proto) {
7263
7215
  return getClassSchema(this).rebuild(ast);
7264
7216
  }
7265
7217
  static make(input, options) {
7266
- return make$2(getClassSchema(this))(input ?? {}, options);
7218
+ return makeClassSync(toType$1(getClassSchema(this).ast), input ?? {}, options, (fields) => makeClassTrusted(this, fields));
7267
7219
  }
7268
7220
  static makeOption(input, options) {
7269
7221
  return makeOption(getClassSchema(this))(input ?? {}, options);
@@ -7298,11 +7250,14 @@ function makeClass(Inherited, identifier, struct$1, annotations, proto) {
7298
7250
  if (proto !== void 0) Object.assign(out.prototype, proto(identifier));
7299
7251
  return out;
7300
7252
  }
7301
- function getClassTransformation(self) {
7302
- return new Transformation(transform$1((input) => new self(input, { "~payload": {
7253
+ function makeClassTrusted(self, fields) {
7254
+ return new self(fields, { "~payload": {
7303
7255
  token: payloadToken,
7304
- value: input
7305
- } })), passthrough$1());
7256
+ value: fields
7257
+ } });
7258
+ }
7259
+ function getClassTransformation(self) {
7260
+ return new Transformation(transform$1((input) => makeClassTrusted(self, input)), passthrough$1());
7306
7261
  }
7307
7262
  function getClassTypeId(identifier) {
7308
7263
  return `~effect/Schema/Class/${identifier}`;
@@ -7376,7 +7331,6 @@ const MutableJson = make(annotate(MutableJson$1, { toCode: () => ({
7376
7331
  runtime: "Schema.MutableJson",
7377
7332
  Type: "Schema.MutableJson"
7378
7333
  }) }));
7379
- //#endregion
7380
- export { TupleWithRest as $, null_ as $n, currentTimeMillis as $r, isMinLength as $t, NonEmptyString as A, toCodecJson$1 as An, CurrentRedactedNames$1 as Ar, isBetweenProperties as At, RedactedFromValue as B, Filter as Bn, fromSetCookie as Br, isIncluding as Bt, JsonObject as C, toType as Cn, CurrentRedactedNames as Cr, instanceOf as Ct, Natural as D, evolve as Dn, setAll as Dr, isBetweenCodePoints as Dt, MutableJson as E, withDecodingDefaultKey as En, redactUrl as Er, isBetweenBigInt as Et, Option as F, decodeEffect$1 as Fn, merge as Fr, isGreaterThanBigInt as Ft, StructWithRest as G, Suspend as Gn, fromDateUnsafe as Gr, isLessThanOrEqualTo as Gt, String$1 as H, Literal$1 as Hn, encode as Hr, isLessThan as Ht, OptionFromNullOr as I, decodeUnknownEffect$1 as In, remove as Ir, isGreaterThanDate as It, TaggedError as J, decodeTo$1 as Jn, isRedacted as Jr, isMaxCodePoints as Jt, Symbol$1 as K, Union$1 as Kn, now as Kr, isLessThanOrEqualToBigInt as Kt, OptionFromOptional as L, decodeUnknownResult as Ln, set as Lr, isGreaterThanOrEqualTo as Lt, NullOr as M, fromSchemaDraft2020_12 as Mn, fromInput$1 as Mr, isEndingWith as Mt, Number$1 as N, getReferenceKey as Nn, fromRecordUnsafe as Nr, isFinite as Nt, Never as O, omit as On, toString as Or, isBetweenDate as Ot, ObjectKeyword as P, _is as Pn, isRedactedName$1 as Pr, isGreaterThan as Pt, Tuple as Q, mapOrSame as Qn, Clock as Qr, isMinCodePoints as Qt, Record as R, encodeEffect$1 as Rn, setAll$1 as Rr, isGreaterThanOrEqualToBigInt as Rt, Json as S, toJsonSchemaDocument as Sn, Pointer as Sr, fromJsonString as St, Literals as T, withDecodingDefault as Tn, fromInput as Tr, isBetween as Tt, StringForLiteralAutocomplete as U, Objects as Un, formatIso as Ur, isLessThanBigInt as Ut, SchemaError as V, FilterGroup as Vn, decode as Vr, isInt as Vt, Struct as W, PropertySignature as Wn, formatIsoDate as Wr, isLessThanDate as Wt, TemplateLiteral as X, isNever as Xn, value as Xr, isMaxProperties as Xt, TaggedUnion as Y, isJson as Yn, make$7 as Yr, isMaxLength as Yt, TrueLiterals as Z, isOptional as Zn, stringOrRedacted as Zr, isMaxSize as Zt, Error$1 as _, suspend as _n, passthroughSubtype as _r, decodeUnknownOption as _t, BooleanFromBit as a, taggedEnum as ai, isSchema as an, string as ar, UndefinedOr as at, Finite as b, toCodecStringTree as bn, transformOptional$1 as br, encodeTo as bt, Date$1 as c, isUUID as cn, unknown as cr, Unknown as ct, DateTimeUtcFromMillis as d, makeFilter as dn, transform as dr, check as dt, monotonicTimeNanos as ei, isMinProperties as en, optionalKey$1 as er, URL$1 as et, DateTimeUtcFromString as f, makeFilterGroup as fn, transformEffect as fr, declare as ft, Enum as g, optionalKey as gn, passthrough$1 as gr, decodeUnknownEffect as gt, DurationFromMillis as h, optional as hn, map as hr, decodeTo as ht, Boolean as i, TaggedError$1 as ii, isPropertyNames as in, resolveIdentifier as ir, Undefined as it, Null as j, fromSchemaDraft07 as jn, empty$1 as jr, isBetweenSize as jt, NonEmptyArray as k, errorWithPath as kn, unwrap as kr, isBetweenLength as kt, DateTimeUtc as l, isUnique as ln, Transformation as lr, Void as lt, Duration as m, mutableKey as mn, dateTimeUtcFromInput$1 as mr, decodeSync as mt, ArraySchema as n, Error$2 as ni, isMultipleOf as nn, resolveAt as nr, Uint8Array$1 as nt, BooleanLiterals as o, assignProperty as oi, isSchemaError as on, toEncoded$1 as or, Union as ot, Defect as p, mutable as pn, transformOptional as pr, decodeEffect as pt, TaggedClass as q, applyToSelfOrLastLinkEncoding as qn, removeTime as qr, isLessThanOrEqualToDate as qt, BigInt$1 as r, TaggedClass$1 as ri, isPattern as rn, resolveDescription as rr, Uint8ArrayFromBase64 as rt, Class as s, map$1 as si, isStartingWith as sn, toType$1 as sr, UniqueSymbol as st, Any as t, EncodingError as ti, isMinSize as tn, replaceChecks as tr, URLFromString as tt, DateTimeUtcFromDate as u, make as un, passthrough as ur, brand as ut, Exit as v, tag as vn, transform$1 as vr, decodeUnknownSync as vt, Literal as w, withConstructorDefault as wn, empty as wr, is as wt, Int as x, toEncoded as xn, InvalidValue as xr, encodeUnknownEffect as xt, FalseLiterals as y, toCodecJson as yn, transformEffect$1 as yr, encodeEffect as yt, Redacted as z, Arrays as zn, empty$2 as zr, isGreaterThanOrEqualToDate as zt };
7334
+ export { URLFromString as $, replaceChecks as $n, value as $r, isPattern as $t, Null as A, parseUriFragment as An, unwrap as Ar, isGreaterThan as At, String$1 as B, PropertySignature as Bn, set as Br, isLessThanDate as Bt, Literal as C, evolve as Cn, CurrentRedactedNames as Cr, isBetweenCodePoints as Ct, Never as D, fromSchemaDraft2020_12 as Dn, setAll as Dr, isBetweenSize as Dt, Natural as E, fromSchemaDraft07 as En, redactUrl as Er, isBetweenProperties as Et, OptionFromOptional as F, Arrays as Fn, isRedactedName$1 as Fr, isGreaterThanOrEqualToDate as Ft, TaggedClass as G, defaultParseOptions as Gn, formatIsoDate as Gr, isMaxLength as Gt, Struct as H, Union$1 as Hn, empty$2 as Hr, isLessThanOrEqualToBigInt as Ht, Record as I, Filter as In, merge as Ir, isIncluding as It, TaggedUnion as J, isNever as Jn, removeTime as Jr, isMinCodePoints as Jt, TaggedError as K, getIndexSignatureKeys as Kn, fromDateUnsafe as Kr, isMaxProperties as Kt, Redacted as L, FilterGroup as Ln, parseRetryAfter as Lr, isInt as Lt, Number$1 as M, decodeEffect$1 as Mn, empty$1 as Mr, isGreaterThanDate as Mt, Option as N, decodeUnknownEffect$1 as Nn, fromInput$1 as Nr, isGreaterThanOrEqualTo as Nt, NonEmptyArray as O, getReferenceKey as On, toString as Or, isEndingWith as Ot, OptionFromNullOr as P, encodeEffect$1 as Pn, fromRecordUnsafe as Pr, isGreaterThanOrEqualToBigInt as Pt, URL$1 as Q, optionalKey$1 as Qn, make$7 as Qr, isMultipleOf as Qt, RedactedFromValue as R, Literal$1 as Rn, remove as Rr, isLessThan as Rt, JsonObject as S, withDecodingDefaultKey as Sn, jsonSchemaAnnotationKeys as Sr, isBetweenBigInt as St, MutableJson as T, errorWithPath as Tn, fromInput as Tr, isBetweenLength as Tt, StructWithRest as U, applyToSelfOrLastLinkEncoding as Un, fromSetCookie as Ur, isLessThanOrEqualToDate as Ut, StringForLiteralAutocomplete as V, Suspend as Vn, setAll$1 as Vr, isLessThanOrEqualTo as Vt, Symbol$1 as W, decodeTo$1 as Wn, formatIso as Wr, isMaxCodePoints as Wt, Tuple as X, mapOrSame as Xn, encode as Xr, isMinProperties as Xt, TrueLiterals as Y, isOptional as Yn, decode as Yr, isMinLength as Yt, TupleWithRest as Z, null_ as Zn, isRedacted as Zr, isMinSize as Zt, Exit as _, toEncoded as _n, transformEffect$1 as _r, encodeUnknownEffect as _t, BooleanFromBit as a, Error$2 as ai, isUnique as an, toType$1 as ar, Void as at, Int as b, withConstructorDefault as bn, Pointer as br, is as bt, Date$1 as c, taggedEnum as ci, makeFilter as cn, passthrough as cr, declare as ct, DateTimeUtcFromMillis as d, optional as dn, transformOptional as dr, decodeTo as dt, stringOrRedacted as ei, isPropertyNames as en, resolveAt as er, Uint8Array$1 as et, DateTimeUtcFromString as f, optionalKey as fn, dateTimeUtcFromInput$1 as fr, decodeUnknownEffect as ft, Error$1 as g, toCodecStringTree as gn, transform$1 as gr, encodeTo as gt, DurationFromMillis as h, toCodecJson as hn, passthroughSubtype as hr, encodeEffect as ht, Boolean as i, EncodingError as ii, isUUID as in, toEncoded$1 as ir, Unknown as it, NullOr as j, getSubschemaKind as jn, CurrentRedactedNames$1 as jr, isGreaterThanBigInt as jt, NonEmptyString as k, escapeToken as kn, fromBody as kr, isFinite as kt, DateTimeUtc as l, assignProperty as li, makeFilterGroup as ln, transform as lr, decodeEffect as lt, Duration as m, tag as mn, passthrough$1 as mr, decodeUnknownSync as mt, ArraySchema as n, currentTimeMillis as ni, isSchemaError as nn, resolveIdentifier as nr, UndefinedOr as nt, BooleanLiterals as o, TaggedClass$1 as oi, link as on, unknown as or, brand as ot, Defect as p, suspend as pn, map as pr, decodeUnknownOption as pt, TaggedStruct as q, isJson as qn, now as qr, isMaxSize as qt, BigInt$1 as r, monotonicTimeNanos as ri, isStartingWith as rn, string as rr, Union as rt, Class as s, TaggedError$1 as si, make as sn, Transformation as sr, check as st, Any as t, Clock as ti, isSchema as tn, resolveDescription as tr, Uint8ArrayFromBase64 as tt, DateTimeUtcFromDate as u, map$1 as ui, mutable as un, transformEffect as ur, decodeSync as ut, FalseLiterals as v, toJsonSchemaDocument as vn, transformOptional$1 as vr, fromJsonString as vt, Literals as w, omit as wn, empty as wr, isBetweenDate as wt, Json as x, withDecodingDefault as xn, annotationExcludedKeys as xr, isBetween as xt, Finite as y, toType as yn, InvalidValue as yr, instanceOf as yt, SchemaError as z, Objects as zn, retryAfterDelay as zr, isLessThanBigInt as zt };
7381
7335
 
7382
- //# sourceMappingURL=Schema-D4fxUgEU.mjs.map
7336
+ //# sourceMappingURL=Schema-CSQN_Zso.mjs.map