@foldkit/oxlint-plugin 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +639 -390
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ var __export = (target, all5) => {
4
4
  __defProp(target, name, { get: all5[name], enumerable: true });
5
5
  };
6
6
 
7
- // ../../node_modules/.pnpm/effect-oxlint@0.3.2_effect@4.0.0-beta.88/node_modules/effect-oxlint/dist/chunk.js
7
+ // ../../node_modules/.pnpm/effect-oxlint@0.3.2_effect@4.0.0-beta.102/node_modules/effect-oxlint/dist/chunk.js
8
8
  var __defProp2 = Object.defineProperty;
9
9
  var __exportAll = (all5, no_symbols) => {
10
10
  let target = {};
@@ -16,7 +16,7 @@ var __exportAll = (all5, no_symbols) => {
16
16
  return target;
17
17
  };
18
18
 
19
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Effect.js
19
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Effect.js
20
20
  var Effect_exports = {};
21
21
  __export(Effect_exports, {
22
22
  Do: () => Do5,
@@ -155,6 +155,7 @@ __export(Effect_exports, {
155
155
  raceAll: () => raceAll2,
156
156
  raceAllFirst: () => raceAllFirst2,
157
157
  raceFirst: () => raceFirst2,
158
+ reduce: () => reduce3,
158
159
  repeat: () => repeat2,
159
160
  repeatOrElse: () => repeatOrElse2,
160
161
  replicate: () => replicate3,
@@ -187,6 +188,7 @@ __export(Effect_exports, {
187
188
  scopedWith: () => scopedWith2,
188
189
  service: () => service2,
189
190
  serviceOption: () => serviceOption2,
191
+ setContext: () => setContext2,
190
192
  sleep: () => sleep2,
191
193
  spanAnnotations: () => spanAnnotations2,
192
194
  spanLinks: () => spanLinks2,
@@ -223,12 +225,12 @@ __export(Effect_exports, {
223
225
  unwrapReason: () => unwrapReason2,
224
226
  updateContext: () => updateContext2,
225
227
  updateService: () => updateService2,
228
+ updateServiceScoped: () => updateServiceScoped2,
226
229
  useSpan: () => useSpan2,
227
230
  validate: () => validate2,
228
231
  void: () => void_5,
229
232
  when: () => when2,
230
233
  whileLoop: () => whileLoop2,
231
- withConcurrency: () => withConcurrency2,
232
234
  withErrorReporting: () => withErrorReporting2,
233
235
  withExecutionPlan: () => withExecutionPlan2,
234
236
  withFiber: () => withFiber2,
@@ -246,7 +248,7 @@ __export(Effect_exports, {
246
248
  zipWith: () => zipWith4
247
249
  });
248
250
 
249
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Pipeable.js
251
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Pipeable.js
250
252
  var pipeArguments = (self, args2) => {
251
253
  switch (args2.length) {
252
254
  case 0:
@@ -290,7 +292,7 @@ var Class = /* @__PURE__ */ (function() {
290
292
  return PipeableBase;
291
293
  })();
292
294
 
293
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Function.js
295
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Function.js
294
296
  var dual = function(arity, body) {
295
297
  if (typeof arity === "function") {
296
298
  return function() {
@@ -353,7 +355,7 @@ function memoize(f) {
353
355
  };
354
356
  }
355
357
 
356
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/equal.js
358
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/equal.js
357
359
  var getAllObjectKeys = (obj) => {
358
360
  const keys2 = new Set(Reflect.ownKeys(obj));
359
361
  if (obj.constructor === Object) return keys2;
@@ -376,7 +378,7 @@ var getAllObjectKeys = (obj) => {
376
378
  };
377
379
  var byReferenceInstances = /* @__PURE__ */ new WeakSet();
378
380
 
379
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Predicate.js
381
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Predicate.js
380
382
  function isString(input) {
381
383
  return typeof input === "string";
382
384
  }
@@ -410,7 +412,7 @@ function isIterable(input) {
410
412
  return hasProperty(input, Symbol.iterator) || isString(input);
411
413
  }
412
414
 
413
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Hash.js
415
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Hash.js
414
416
  var symbol = "~effect/interfaces/Hash";
415
417
  var hash = (self) => {
416
418
  switch (typeof self) {
@@ -529,7 +531,7 @@ function withVisitedTracking(obj, fn3) {
529
531
  return result3;
530
532
  }
531
533
 
532
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Equal.js
534
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Equal.js
533
535
  var symbol2 = "~effect/interfaces/Equal";
534
536
  function equals() {
535
537
  if (arguments.length === 1) {
@@ -711,7 +713,7 @@ var byReferenceUnsafe = (obj) => {
711
713
  return obj;
712
714
  };
713
715
 
714
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Redactable.js
716
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Redactable.js
715
717
  var symbolRedactable = /* @__PURE__ */ Symbol.for("~effect/Redactable");
716
718
  var isRedactable = (u) => hasProperty(u, symbolRedactable);
717
719
  function redact(u) {
@@ -730,7 +732,7 @@ var emptyContext = {
730
732
  }
731
733
  };
732
734
 
733
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Formatter.js
735
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Formatter.js
734
736
  function format(input, options) {
735
737
  const space = options?.space ?? 0;
736
738
  const seen = /* @__PURE__ */ new WeakSet();
@@ -829,7 +831,7 @@ function formatJson(input, options) {
829
831
  }, options?.space);
830
832
  }
831
833
 
832
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Inspectable.js
834
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Inspectable.js
833
835
  var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
834
836
  var toJson = (input) => {
835
837
  try {
@@ -893,7 +895,7 @@ var Class2 = class {
893
895
  }
894
896
  };
895
897
 
896
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Utils.js
898
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Utils.js
897
899
  var SingleShotGen = class _SingleShotGen {
898
900
  called = false;
899
901
  self;
@@ -953,7 +955,29 @@ var pickInternalCall = () => {
953
955
  };
954
956
  var internalCall = /* @__PURE__ */ pickInternalCall();
955
957
 
956
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/core.js
958
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/record.js
959
+ function assignProperty(self, key, value) {
960
+ if (key === "__proto__") {
961
+ Object.defineProperty(self, key, {
962
+ value,
963
+ writable: true,
964
+ enumerable: true,
965
+ configurable: true
966
+ });
967
+ } else {
968
+ ;
969
+ self[key] = value;
970
+ }
971
+ }
972
+ function assignProperties(self, source) {
973
+ for (const key of Reflect.ownKeys(source)) {
974
+ if (Object.prototype.propertyIsEnumerable.call(source, key)) {
975
+ assignProperty(self, key, source[key]);
976
+ }
977
+ }
978
+ }
979
+
980
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/core.js
957
981
  var EffectTypeId = `~effect/Effect`;
958
982
  var ExitTypeId = `~effect/Exit`;
959
983
  var effectVariance = {
@@ -996,7 +1020,7 @@ var StructuralProto = {
996
1020
  const thatKeys = Object.keys(that);
997
1021
  if (selfKeys.length !== thatKeys.length) return false;
998
1022
  for (let i = 0; i < selfKeys.length; i++) {
999
- if (selfKeys[i] !== thatKeys[i] && !equals(this[selfKeys[i]], that[selfKeys[i]])) {
1023
+ if (selfKeys[i] !== thatKeys[i] || !equals(this[selfKeys[i]], that[selfKeys[i]])) {
1000
1024
  return false;
1001
1025
  }
1002
1026
  }
@@ -1227,7 +1251,7 @@ var exitFailCause = /* @__PURE__ */ makeExit({
1227
1251
  while (fiber3.interruptible && fiber3._interruptedCause && cont) {
1228
1252
  cont = fiber3.getCont(contE);
1229
1253
  }
1230
- return cont ? cont[contE](cause, fiber3, annotated ? void 0 : this) : fiber3.yieldWith(annotated ? this : exitFailCause(cause));
1254
+ return cont ? cont[contE](cause, fiber3, annotated ? void 0 : this) : fiber3.yieldWith(annotated ? exitFailCause(cause) : this);
1231
1255
  }
1232
1256
  });
1233
1257
  var exitFail = (e) => exitFailCause(causeFail(e));
@@ -1259,7 +1283,7 @@ var Error2 = /* @__PURE__ */ (function() {
1259
1283
  cause: args2.cause
1260
1284
  } : void 0);
1261
1285
  if (args2) {
1262
- Object.assign(this, args2);
1286
+ assignProperties(this, args2);
1263
1287
  Object.defineProperty(this, plainArgsSymbol, {
1264
1288
  value: args2,
1265
1289
  enumerable: false
@@ -1313,22 +1337,19 @@ var done = (value) => {
1313
1337
  return exitFail(Done(value));
1314
1338
  };
1315
1339
 
1316
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Effectable.js
1340
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Effectable.js
1317
1341
  var Prototype2 = (options) => makePrimitiveProto({
1318
1342
  op: options.label,
1319
1343
  [evaluate]: options.evaluate
1320
1344
  });
1321
1345
 
1322
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/stackTraceLimit.js
1323
- var ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1324
- var ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
1325
- var ObjectIsExtensible = Object.isExtensible;
1346
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/stackTraceLimit.js
1326
1347
  var isStackTraceLimitWritable = () => {
1327
- const desc = ObjectGetOwnPropertyDescriptor(Error, "stackTraceLimit");
1348
+ const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
1328
1349
  if (desc === void 0) {
1329
- return ObjectIsExtensible(Error);
1350
+ return Object.isExtensible(Error);
1330
1351
  }
1331
- return ObjectPrototypeHasOwnProperty.call(desc, "writable") ? desc.writable === true : desc.set !== void 0;
1352
+ return Object.hasOwn(desc, "writable") ? desc.writable === true : desc.set !== void 0;
1332
1353
  };
1333
1354
  var canWriteStackTraceLimit = /* @__PURE__ */ isStackTraceLimitWritable();
1334
1355
  var getStackTraceLimit = () => Error.stackTraceLimit;
@@ -1339,7 +1360,7 @@ var setStackTraceLimit = (value) => {
1339
1360
  }
1340
1361
  };
1341
1362
 
1342
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Option.js
1363
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Option.js
1343
1364
  var Option_exports = {};
1344
1365
  __export(Option_exports, {
1345
1366
  Do: () => Do,
@@ -1404,14 +1425,14 @@ __export(Option_exports, {
1404
1425
  zipWith: () => zipWith
1405
1426
  });
1406
1427
 
1407
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Combiner.js
1428
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Combiner.js
1408
1429
  function make(combine2) {
1409
1430
  return {
1410
1431
  combine: combine2
1411
1432
  };
1412
1433
  }
1413
1434
 
1414
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Reducer.js
1435
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Reducer.js
1415
1436
  function make2(combine2, initialValue, combineAll2) {
1416
1437
  return {
1417
1438
  combine: combine2,
@@ -1426,7 +1447,7 @@ function make2(combine2, initialValue, combineAll2) {
1426
1447
  };
1427
1448
  }
1428
1449
 
1429
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Equivalence.js
1450
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Equivalence.js
1430
1451
  var make3 = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
1431
1452
  function Array_(item) {
1432
1453
  return make3((self, that) => {
@@ -1438,7 +1459,7 @@ function Array_(item) {
1438
1459
  });
1439
1460
  }
1440
1461
 
1441
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/doNotation.js
1462
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/doNotation.js
1442
1463
  var let_ = (map8) => dual(3, (self, name, f) => map8(self, (a) => ({
1443
1464
  ...a,
1444
1465
  [name]: f(a)
@@ -1451,7 +1472,7 @@ var bind = (map8, flatMap6) => dual(3, (self, name, f) => flatMap6(self, (a) =>
1451
1472
  [name]: b
1452
1473
  }))));
1453
1474
 
1454
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/option.js
1475
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/option.js
1455
1476
  var TypeId = "~effect/data/Option";
1456
1477
  var CommonProto = {
1457
1478
  [TypeId]: {
@@ -1517,7 +1538,7 @@ var some = (value) => {
1517
1538
  return a;
1518
1539
  };
1519
1540
 
1520
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/result.js
1541
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/result.js
1521
1542
  var TypeId2 = "~effect/data/Result";
1522
1543
  var CommonProto2 = {
1523
1544
  [TypeId2]: {
@@ -1587,7 +1608,7 @@ var getFailure = (self) => isSuccess(self) ? none : some(self.failure);
1587
1608
  var getSuccess = (self) => isFailure(self) ? none : some(self.success);
1588
1609
  var fromOption = /* @__PURE__ */ dual(2, (self, onNone) => isNone(self) ? fail(onNone()) : succeed(self.value));
1589
1610
 
1590
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Order.js
1611
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Order.js
1591
1612
  function make4(compare) {
1592
1613
  return (self, that) => self === that ? 0 : compare(self, that);
1593
1614
  }
@@ -1610,7 +1631,6 @@ function combineAll(collection) {
1610
1631
  });
1611
1632
  }
1612
1633
  var mapInput = /* @__PURE__ */ dual(2, (self, f) => make4((b1, b2) => self(f(b1), f(b2))));
1613
- var Date2 = /* @__PURE__ */ mapInput(Number2, (date) => date.getTime());
1614
1634
  function Array_2(O) {
1615
1635
  return make4((self, that) => {
1616
1636
  const aLen = self.length;
@@ -1629,7 +1649,7 @@ var isGreaterThan = (O) => dual(2, (self, that) => O(self, that) === 1);
1629
1649
  var min = (O) => dual(2, (self, that) => self === that || O(self, that) < 1 ? self : that);
1630
1650
  var max = (O) => dual(2, (self, that) => self === that || O(self, that) > -1 ? self : that);
1631
1651
 
1632
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Option.js
1652
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Option.js
1633
1653
  var none2 = () => none;
1634
1654
  var some2 = some;
1635
1655
  var isOption2 = isOption;
@@ -1727,7 +1747,7 @@ var all = (input) => {
1727
1747
  if (isNone2(o)) {
1728
1748
  return none2();
1729
1749
  }
1730
- out[key] = o.value;
1750
+ assignProperty(out, key, o.value);
1731
1751
  }
1732
1752
  return some2(out);
1733
1753
  };
@@ -1807,7 +1827,7 @@ function makeReducerFailFast(reducer2) {
1807
1827
  });
1808
1828
  }
1809
1829
 
1810
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Context.js
1830
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Context.js
1811
1831
  var ServiceTypeId = "~effect/Context/Service";
1812
1832
  var Service = function() {
1813
1833
  const prevLimit = getStackTraceLimit();
@@ -1911,12 +1931,7 @@ var make5 = (key, service3) => makeUnsafe(/* @__PURE__ */ new Map([[key.key, ser
1911
1931
  var add = /* @__PURE__ */ dual(3, (self, key, service3) => withMapUnsafe(self, (map8) => {
1912
1932
  map8.set(key.key, service3);
1913
1933
  }));
1914
- var getOrElse2 = /* @__PURE__ */ dual(3, (self, key, orElse3) => {
1915
- if (self.mapUnsafe.has(key.key)) {
1916
- return self.mapUnsafe.get(key.key);
1917
- }
1918
- return isReference(key) ? getDefaultValue(key) : orElse3();
1919
- });
1934
+ var getOrUndefined2 = /* @__PURE__ */ dual(2, (self, key) => self.mapUnsafe.get(key.key));
1920
1935
  var getUnsafe = /* @__PURE__ */ dual(2, (self, service3) => {
1921
1936
  if (!self.mapUnsafe.has(service3.key)) {
1922
1937
  if (ReferenceTypeId in service3) return getDefaultValue(service3);
@@ -1989,7 +2004,7 @@ var withMapUnsafe = (self, f) => {
1989
2004
  };
1990
2005
  var Reference = Service;
1991
2006
 
1992
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Duration.js
2007
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Duration.js
1993
2008
  var TypeId4 = "~effect/time/Duration";
1994
2009
  var bigint0 = /* @__PURE__ */ BigInt(0);
1995
2010
  var bigint1 = /* @__PURE__ */ BigInt(1);
@@ -2236,7 +2251,7 @@ var subtract = /* @__PURE__ */ dual(2, (self, that) => matchPair(self, that, {
2236
2251
  }));
2237
2252
  var equals2 = /* @__PURE__ */ dual(2, (self, that) => Equivalence(self, that));
2238
2253
 
2239
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Array.js
2254
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Array.js
2240
2255
  var Array_exports = {};
2241
2256
  __export(Array_exports, {
2242
2257
  Array: () => Array2,
@@ -2374,10 +2389,10 @@ __export(Array_exports, {
2374
2389
  zipWith: () => zipWith2
2375
2390
  });
2376
2391
 
2377
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/array.js
2392
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/array.js
2378
2393
  var isArrayNonEmpty = (self) => self.length > 0;
2379
2394
 
2380
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Result.js
2395
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Result.js
2381
2396
  var Result_exports = {};
2382
2397
  __export(Result_exports, {
2383
2398
  Do: () => Do2,
@@ -2394,11 +2409,11 @@ __export(Result_exports, {
2394
2409
  fromOption: () => fromOption2,
2395
2410
  gen: () => gen2,
2396
2411
  getFailure: () => getFailure3,
2397
- getOrElse: () => getOrElse3,
2412
+ getOrElse: () => getOrElse2,
2398
2413
  getOrNull: () => getOrNull2,
2399
2414
  getOrThrow: () => getOrThrow2,
2400
2415
  getOrThrowWith: () => getOrThrowWith2,
2401
- getOrUndefined: () => getOrUndefined2,
2416
+ getOrUndefined: () => getOrUndefined3,
2402
2417
  getSuccess: () => getSuccess3,
2403
2418
  isFailure: () => isFailure2,
2404
2419
  isResult: () => isResult2,
@@ -2464,9 +2479,9 @@ var merge2 = /* @__PURE__ */ match3({
2464
2479
  onFailure: identity,
2465
2480
  onSuccess: identity
2466
2481
  });
2467
- var getOrElse3 = /* @__PURE__ */ dual(2, (self, onFailure) => isFailure2(self) ? onFailure(self.failure) : self.success);
2468
- var getOrNull2 = /* @__PURE__ */ getOrElse3(constNull);
2469
- var getOrUndefined2 = /* @__PURE__ */ getOrElse3(constUndefined);
2482
+ var getOrElse2 = /* @__PURE__ */ dual(2, (self, onFailure) => isFailure2(self) ? onFailure(self.failure) : self.success);
2483
+ var getOrNull2 = /* @__PURE__ */ getOrElse2(constNull);
2484
+ var getOrUndefined3 = /* @__PURE__ */ getOrElse2(constUndefined);
2470
2485
  var getOrThrowWith2 = /* @__PURE__ */ dual(2, (self, onFailure) => {
2471
2486
  if (isSuccess2(self)) {
2472
2487
  return self.success;
@@ -2497,7 +2512,7 @@ var all2 = (input) => {
2497
2512
  if (isFailure2(e)) {
2498
2513
  return e;
2499
2514
  }
2500
- out[key] = e.success;
2515
+ assignProperty(out, key, e.success);
2501
2516
  }
2502
2517
  return succeed2(out);
2503
2518
  };
@@ -2532,10 +2547,10 @@ var tap2 = /* @__PURE__ */ dual(2, (self, f) => {
2532
2547
  return self;
2533
2548
  });
2534
2549
 
2535
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Tuple.js
2550
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Tuple.js
2536
2551
  var make7 = (...elements) => elements;
2537
2552
 
2538
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Iterable.js
2553
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Iterable.js
2539
2554
  var findFirst = /* @__PURE__ */ dual(2, (self, f) => {
2540
2555
  let i = 0;
2541
2556
  for (const a of self) {
@@ -2578,7 +2593,7 @@ var filter2 = /* @__PURE__ */ dual(2, (self, predicate) => ({
2578
2593
  }
2579
2594
  }));
2580
2595
 
2581
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Record.js
2596
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Record.js
2582
2597
  var empty2 = () => ({});
2583
2598
  var isEmptyRecord = (self) => Object.keys(self).length === 0;
2584
2599
  var fromEntries = Object.fromEntries;
@@ -2596,7 +2611,7 @@ var map3 = /* @__PURE__ */ dual(2, (self, f) => {
2596
2611
  ...self
2597
2612
  };
2598
2613
  for (const key of keys(self)) {
2599
- out[key] = f(self[key], key);
2614
+ assignProperty(out, key, f(self[key], key));
2600
2615
  }
2601
2616
  return out;
2602
2617
  });
@@ -2615,20 +2630,20 @@ var union = /* @__PURE__ */ dual(3, (self, that, combine2) => {
2615
2630
  const out = empty2();
2616
2631
  for (const key of keys(self)) {
2617
2632
  if (has(that, key)) {
2618
- out[key] = combine2(self[key], that[key]);
2633
+ assignProperty(out, key, combine2(self[key], that[key]));
2619
2634
  } else {
2620
- out[key] = self[key];
2635
+ assignProperty(out, key, self[key]);
2621
2636
  }
2622
2637
  }
2623
2638
  for (const key of keys(that)) {
2624
2639
  if (!has(out, key)) {
2625
- out[key] = that[key];
2640
+ assignProperty(out, key, that[key]);
2626
2641
  }
2627
2642
  }
2628
2643
  return out;
2629
2644
  });
2630
2645
 
2631
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Array.js
2646
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Array.js
2632
2647
  var Array2 = globalThis.Array;
2633
2648
  var make8 = (...elements) => elements;
2634
2649
  var allocate = (n) => new Array2(n);
@@ -2951,7 +2966,7 @@ var rotate = /* @__PURE__ */ dual(2, (self, n) => {
2951
2966
  const [f, s] = splitAtNonEmpty(input, -m);
2952
2967
  return appendAll(s, f);
2953
2968
  } else {
2954
- return rotate(self, m - len);
2969
+ return rotate(input, m - len);
2955
2970
  }
2956
2971
  }
2957
2972
  return [];
@@ -3045,11 +3060,45 @@ var groupBy = /* @__PURE__ */ dual(2, (self, f) => {
3045
3060
  if (Object.hasOwn(out, k)) {
3046
3061
  out[k].push(a);
3047
3062
  } else {
3048
- out[k] = [a];
3063
+ assignProperty(out, k, [a]);
3049
3064
  }
3050
3065
  }
3051
3066
  return out;
3052
3067
  });
3068
+ var hashBucketsAdd = (buckets, value) => {
3069
+ const hash2 = hash(value);
3070
+ const bucket = buckets.get(hash2);
3071
+ if (bucket === void 0) {
3072
+ buckets.set(hash2, [value]);
3073
+ return true;
3074
+ }
3075
+ for (const previous of bucket) {
3076
+ if (equals(previous, value)) {
3077
+ return false;
3078
+ }
3079
+ }
3080
+ bucket.push(value);
3081
+ return true;
3082
+ };
3083
+ var makeHashBuckets = (values) => {
3084
+ const buckets = /* @__PURE__ */ new Map();
3085
+ for (const value of values) {
3086
+ hashBucketsAdd(buckets, value);
3087
+ }
3088
+ return buckets;
3089
+ };
3090
+ var hashBucketsHas = (buckets, value) => {
3091
+ const bucket = buckets.get(hash(value));
3092
+ if (bucket === void 0) {
3093
+ return false;
3094
+ }
3095
+ for (const candidate of bucket) {
3096
+ if (equals(candidate, value)) {
3097
+ return true;
3098
+ }
3099
+ }
3100
+ return false;
3101
+ };
3053
3102
  var unionWith = /* @__PURE__ */ dual(3, (self, that, isEquivalent) => {
3054
3103
  const a = fromIterable2(self);
3055
3104
  const b = fromIterable2(that);
@@ -3062,7 +3111,14 @@ var unionWith = /* @__PURE__ */ dual(3, (self, that, isEquivalent) => {
3062
3111
  }
3063
3112
  return b;
3064
3113
  });
3065
- var union2 = /* @__PURE__ */ dual(2, (self, that) => unionWith(self, that, asEquivalence()));
3114
+ var union2 = /* @__PURE__ */ dual(2, (self, that) => {
3115
+ const a = fromIterable2(self);
3116
+ const b = fromIterable2(that);
3117
+ if (isReadonlyArrayNonEmpty(a)) {
3118
+ return isReadonlyArrayNonEmpty(b) ? dedupe(appendAll(a, b)) : a;
3119
+ }
3120
+ return b;
3121
+ });
3066
3122
  var intersectionWith = (isEquivalent) => {
3067
3123
  const has2 = containsWith2(isEquivalent);
3068
3124
  return dual(2, (self, that) => {
@@ -3070,7 +3126,15 @@ var intersectionWith = (isEquivalent) => {
3070
3126
  return fromIterable2(self).filter((a) => has2(thatArray, a));
3071
3127
  });
3072
3128
  };
3073
- var intersection = /* @__PURE__ */ intersectionWith(/* @__PURE__ */ asEquivalence());
3129
+ var intersection = /* @__PURE__ */ dual(2, (self, that) => {
3130
+ const thatArray = fromIterable2(that);
3131
+ const selfArray = fromIterable2(self);
3132
+ if (selfArray.length === 0 || thatArray.length === 0) {
3133
+ return [];
3134
+ }
3135
+ const buckets = makeHashBuckets(thatArray);
3136
+ return selfArray.filter((value) => hashBucketsHas(buckets, value));
3137
+ });
3074
3138
  var differenceWith = (isEquivalent) => {
3075
3139
  const has2 = containsWith2(isEquivalent);
3076
3140
  return dual(2, (self, that) => {
@@ -3078,7 +3142,18 @@ var differenceWith = (isEquivalent) => {
3078
3142
  return fromIterable2(self).filter((a) => !has2(thatArray, a));
3079
3143
  });
3080
3144
  };
3081
- var difference = /* @__PURE__ */ differenceWith(/* @__PURE__ */ asEquivalence());
3145
+ var difference = /* @__PURE__ */ dual(2, (self, that) => {
3146
+ const thatArray = fromIterable2(that);
3147
+ const selfArray = fromIterable2(self);
3148
+ if (selfArray.length === 0) {
3149
+ return [];
3150
+ }
3151
+ if (thatArray.length === 0) {
3152
+ return selfArray.filter(() => true);
3153
+ }
3154
+ const buckets = makeHashBuckets(thatArray);
3155
+ return selfArray.filter((value) => !hashBucketsHas(buckets, value));
3156
+ });
3082
3157
  var empty3 = () => [];
3083
3158
  var of = (a) => [a];
3084
3159
  var map4 = /* @__PURE__ */ dual(2, (self, f) => self.map(f));
@@ -3206,7 +3281,20 @@ var dedupeWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
3206
3281
  }
3207
3282
  return [];
3208
3283
  });
3209
- var dedupe = (self) => dedupeWith(self, asEquivalence());
3284
+ var dedupe = (self) => {
3285
+ const input = fromIterable2(self);
3286
+ if (input.length < 2) {
3287
+ return [...input];
3288
+ }
3289
+ const buckets = /* @__PURE__ */ new Map();
3290
+ const out = [];
3291
+ for (const value of input) {
3292
+ if (hashBucketsAdd(buckets, value)) {
3293
+ out.push(value);
3294
+ }
3295
+ }
3296
+ return out;
3297
+ };
3210
3298
  var dedupeAdjacentWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
3211
3299
  const out = [];
3212
3300
  let lastA = none2();
@@ -3257,7 +3345,7 @@ var countBy = /* @__PURE__ */ dual(2, (self, f) => {
3257
3345
  return count;
3258
3346
  });
3259
3347
 
3260
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Filter.js
3348
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Filter.js
3261
3349
  var composePassthrough = /* @__PURE__ */ dual(2, (left, right) => (input) => {
3262
3350
  const leftOut = left(input);
3263
3351
  if (isFailure2(leftOut)) return fail2(input);
@@ -3266,7 +3354,7 @@ var composePassthrough = /* @__PURE__ */ dual(2, (left, right) => (input) => {
3266
3354
  return rightOut;
3267
3355
  });
3268
3356
 
3269
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Scheduler.js
3357
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Scheduler.js
3270
3358
  var Scheduler = /* @__PURE__ */ Reference("effect/Scheduler", {
3271
3359
  defaultValue: () => new MixedScheduler()
3272
3360
  });
@@ -3391,7 +3479,7 @@ var PreventSchedulerYield = /* @__PURE__ */ Reference("effect/Scheduler/PreventS
3391
3479
  defaultValue: () => false
3392
3480
  });
3393
3481
 
3394
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Tracer.js
3482
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Tracer.js
3395
3483
  var ParentSpanKey = "effect/Tracer/ParentSpan";
3396
3484
  var ParentSpan = class extends (/* @__PURE__ */ Service()(ParentSpanKey)) {
3397
3485
  };
@@ -3471,13 +3559,10 @@ var randomHexString = /* @__PURE__ */ (function() {
3471
3559
  };
3472
3560
  })();
3473
3561
 
3474
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/metric.js
3562
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/metric.js
3475
3563
  var FiberRuntimeMetricsKey = "effect/observability/Metric/FiberRuntimeMetricsKey";
3476
3564
 
3477
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/references.js
3478
- var CurrentConcurrency = /* @__PURE__ */ Reference("effect/References/CurrentConcurrency", {
3479
- defaultValue: () => "unbounded"
3480
- });
3565
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/references.js
3481
3566
  var CurrentErrorReporters = /* @__PURE__ */ Reference("effect/ErrorReporter/CurrentErrorReporters", {
3482
3567
  defaultValue: () => /* @__PURE__ */ new Set()
3483
3568
  });
@@ -3509,7 +3594,7 @@ var CurrentLogSpans = /* @__PURE__ */ Reference("effect/References/CurrentLogSpa
3509
3594
  defaultValue: () => []
3510
3595
  });
3511
3596
 
3512
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/tracer.js
3597
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/tracer.js
3513
3598
  var addSpanStackTrace = (options) => {
3514
3599
  if (options?.captureStackTrace === false) {
3515
3600
  return options;
@@ -3540,10 +3625,10 @@ var makeStackCleaner = (line) => (stack) => {
3540
3625
  };
3541
3626
  var spanCleaner = /* @__PURE__ */ makeStackCleaner(3);
3542
3627
 
3543
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/version.js
3628
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/version.js
3544
3629
  var version = "dev";
3545
3630
 
3546
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/effect.js
3631
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/effect.js
3547
3632
  var Interrupt = class extends ReasonBase {
3548
3633
  fiberId;
3549
3634
  constructor(fiberId3, annotations = constEmptyAnnotations) {
@@ -3640,7 +3725,7 @@ var causeSquash = (self) => {
3640
3725
  }
3641
3726
  return new globalThis.Error("Empty cause");
3642
3727
  };
3643
- var causePrettyErrors = (self) => {
3728
+ var causePrettyErrors = (self, options) => {
3644
3729
  const errors = [];
3645
3730
  const interrupts = [];
3646
3731
  if (self.reasons.length === 0) return errors;
@@ -3651,7 +3736,7 @@ var causePrettyErrors = (self) => {
3651
3736
  interrupts.push(failure);
3652
3737
  continue;
3653
3738
  }
3654
- errors.push(causePrettyError(failure._tag === "Die" ? failure.defect : failure.error, failure.annotations));
3739
+ errors.push(causePrettyError(failure._tag === "Die" ? failure.defect : failure.error, failure.annotations, options));
3655
3740
  }
3656
3741
  if (errors.length === 0) {
3657
3742
  const cause = new Error("The fiber was interrupted by:");
@@ -3662,12 +3747,12 @@ var causePrettyErrors = (self) => {
3662
3747
  });
3663
3748
  error.name = "InterruptError";
3664
3749
  error.stack = `${error.name}: ${error.message}`;
3665
- errors.push(causePrettyError(error, interrupts[0].annotations));
3750
+ errors.push(causePrettyError(error, interrupts[0].annotations, options));
3666
3751
  }
3667
3752
  setStackTraceLimit(prevStackLimit);
3668
3753
  return errors;
3669
3754
  };
3670
- var causePrettyError = (original, annotations) => {
3755
+ var causePrettyError = (original, annotations, options) => {
3671
3756
  const kind = typeof original;
3672
3757
  let error;
3673
3758
  if (original && kind === "object") {
@@ -3683,6 +3768,9 @@ var causePrettyError = (original, annotations) => {
3683
3768
  const stack = `${error.name}: ${error.message}`;
3684
3769
  error.stack = annotations ? addStackAnnotations(stack, annotations) : stack;
3685
3770
  }
3771
+ if (options?.includeCauseInStack) {
3772
+ error.stack = renderPrettyError(error);
3773
+ }
3686
3774
  for (const key of Object.keys(original)) {
3687
3775
  if (!(key in error)) {
3688
3776
  ;
@@ -3760,9 +3848,10 @@ var currentStackTrace = (frame) => {
3760
3848
  }
3761
3849
  return out.join("\n");
3762
3850
  };
3763
- var causePretty = (cause) => causePrettyErrors(cause).map((e) => e.cause ? `${e.stack} {
3851
+ var causePretty = (cause) => causePrettyErrors(cause).map(renderPrettyError).join("\n");
3852
+ var renderPrettyError = (e) => e.cause ? `${e.stack} {
3764
3853
  ${renderErrorCause(e.cause, " ")}
3765
- }` : e.stack).join("\n");
3854
+ }` : e.stack;
3766
3855
  var renderErrorCause = (cause, prefix) => {
3767
3856
  const lines = cause.stack.split("\n");
3768
3857
  let stack = `${prefix}[cause]: ${lines[0]}`;
@@ -3792,7 +3881,6 @@ var FiberImpl = class {
3792
3881
  this.setContext(context3);
3793
3882
  this.id = ++fiberIdStore.id;
3794
3883
  this.currentOpCount = 0;
3795
- this.currentLoopCount = 0;
3796
3884
  this.interruptible = interruptible3;
3797
3885
  this._stack = [];
3798
3886
  this._observers = [];
@@ -3800,20 +3888,22 @@ var FiberImpl = class {
3800
3888
  this._children = void 0;
3801
3889
  this._interruptedCause = void 0;
3802
3890
  this._yielded = void 0;
3891
+ this._running = false;
3892
+ this._deferredInterrupt = false;
3803
3893
  this.runtimeMetrics?.recordFiberStart(this.context);
3804
3894
  }
3805
3895
  [FiberTypeId];
3806
3896
  id;
3807
3897
  interruptible;
3808
3898
  currentOpCount;
3809
- currentLoopCount;
3810
3899
  _stack;
3811
3900
  _observers;
3812
3901
  _exit;
3813
- _currentExit;
3814
3902
  _children;
3815
3903
  _interruptedCause;
3816
3904
  _yielded;
3905
+ _running;
3906
+ _deferredInterrupt;
3817
3907
  // set in setContext
3818
3908
  context;
3819
3909
  currentScheduler;
@@ -3858,7 +3948,11 @@ var FiberImpl = class {
3858
3948
  }
3859
3949
  this._interruptedCause = this._interruptedCause ? causeCombine(this._interruptedCause, cause) : cause;
3860
3950
  if (this.interruptible) {
3861
- this.evaluate(failCause(this._interruptedCause));
3951
+ if (this._running) {
3952
+ this._deferredInterrupt = true;
3953
+ } else {
3954
+ this.evaluate(failCause(this._interruptedCause));
3955
+ }
3862
3956
  }
3863
3957
  }
3864
3958
  pollUnsafe() {
@@ -3886,16 +3980,24 @@ var FiberImpl = class {
3886
3980
  this._observers[i](exit3);
3887
3981
  }
3888
3982
  this._observers.length = 0;
3983
+ this._stack.length = 0;
3984
+ this._children = void 0;
3985
+ this.context = empty();
3889
3986
  }
3890
3987
  runLoop(effect) {
3891
3988
  const prevFiber = globalThis[currentFiberTypeId];
3892
3989
  globalThis[currentFiberTypeId] = this;
3990
+ const prevRunning = this._running;
3991
+ this._running = true;
3893
3992
  let yielding = false;
3894
3993
  let current = effect;
3895
3994
  this.currentOpCount = 0;
3896
- const currentLoop = ++this.currentLoopCount;
3897
3995
  try {
3898
3996
  while (true) {
3997
+ if (this._deferredInterrupt) {
3998
+ this._deferredInterrupt = false;
3999
+ current = failCause(this._interruptedCause);
4000
+ }
3899
4001
  this.currentOpCount++;
3900
4002
  if (!yielding && !this.currentPreventYield && this.currentScheduler.shouldYield(this)) {
3901
4003
  yielding = true;
@@ -3903,13 +4005,16 @@ var FiberImpl = class {
3903
4005
  current = flatMap4(yieldNow, () => prev);
3904
4006
  }
3905
4007
  current = this.currentTracerContext ? this.currentTracerContext(current, this) : current[evaluate](this);
3906
- if (currentLoop !== this.currentLoopCount) {
3907
- return Yield;
3908
- } else if (current === Yield) {
4008
+ if (current === Yield) {
3909
4009
  const yielded = this._yielded;
3910
4010
  if (ExitTypeId in yielded) {
4011
+ this._deferredInterrupt = false;
3911
4012
  this._yielded = void 0;
3912
4013
  return yielded;
4014
+ } else if (this._deferredInterrupt) {
4015
+ this._yielded = void 0;
4016
+ yielded();
4017
+ continue;
3913
4018
  }
3914
4019
  return Yield;
3915
4020
  }
@@ -3920,11 +4025,15 @@ var FiberImpl = class {
3920
4025
  }
3921
4026
  return this.runLoop(exitDie(error));
3922
4027
  } finally {
3923
- ;
4028
+ this._running = prevRunning;
3924
4029
  globalThis[currentFiberTypeId] = prevFiber;
3925
4030
  }
3926
4031
  }
3927
4032
  getCont(symbol4) {
4033
+ if (this._deferredInterrupt) {
4034
+ this._deferredInterrupt = false;
4035
+ return deferredInterruptCont;
4036
+ }
3928
4037
  while (true) {
3929
4038
  const op = this._stack.pop();
3930
4039
  if (!op) return void 0;
@@ -3968,13 +4077,21 @@ var FiberImpl = class {
3968
4077
  return this.currentSpan?._tag === "Span" ? this.currentSpan : void 0;
3969
4078
  }
3970
4079
  };
4080
+ var deferredInterruptCont = {
4081
+ [contA](_value, fiber3) {
4082
+ return failCause(fiber3._interruptedCause);
4083
+ },
4084
+ [contE](_cause, fiber3) {
4085
+ return failCause(fiber3._interruptedCause);
4086
+ }
4087
+ };
3971
4088
  var fiberMiddleware = {
3972
4089
  interruptChildren: void 0
3973
4090
  };
3974
4091
  var fiberStackAnnotations = (fiber3) => {
3975
4092
  if (!fiber3.currentStackFrame) return void 0;
3976
4093
  const annotations = /* @__PURE__ */ new Map();
3977
- annotations.set(StackTraceKey.key, fiber3.currentStackFrame);
4094
+ annotations.set(InterruptorStackTrace.key, fiber3.currentStackFrame);
3978
4095
  return makeUnsafe(annotations);
3979
4096
  };
3980
4097
  var fiberInterruptChildren = (fiber3) => {
@@ -4023,10 +4140,12 @@ var fiberInterruptAs = /* @__PURE__ */ dual((args2) => hasProperty(args2[0], Fib
4023
4140
  }));
4024
4141
  var fiberInterruptAll = (fibers) => withFiber((parent) => {
4025
4142
  const annotations = fiberStackAnnotations(parent);
4143
+ let fiberArr = empty3();
4026
4144
  for (const fiber3 of fibers) {
4027
4145
  fiber3.interruptUnsafe(parent.id, annotations);
4146
+ fiberArr.push(fiber3);
4028
4147
  }
4029
- return asVoid2(fiberAwaitAll(fibers));
4148
+ return asVoid2(fiberAwaitAll(fiberArr));
4030
4149
  });
4031
4150
  var succeed3 = exitSucceed;
4032
4151
  var failCause = exitFailCause;
@@ -4045,10 +4164,7 @@ var suspend = /* @__PURE__ */ makePrimitive({
4045
4164
  return this[args]();
4046
4165
  }
4047
4166
  });
4048
- var fromOption4 = /* @__PURE__ */ match({
4049
- onNone: () => fail3(new NoSuchElementError("Effect.fromOption: Option.none")),
4050
- onSome: succeed3
4051
- });
4167
+ var fromOption4 = /* @__PURE__ */ dual((args2) => args2.length >= 2 || isOption2(args2[0]), (option3, onNone) => isNone2(option3) ? fail3(onNone ? onNone() : new NoSuchElementError("Effect.fromOption: Option.none")) : succeed3(option3.value));
4052
4168
  var fromResult = /* @__PURE__ */ match3({
4053
4169
  onFailure: fail3,
4054
4170
  onSuccess: succeed3
@@ -4442,9 +4558,27 @@ var updateService = /* @__PURE__ */ dual(3, (self, service3, f) => updateContext
4442
4558
  if (prev === next) return s;
4443
4559
  return add(s, service3, next);
4444
4560
  }));
4561
+ var updateServiceScoped = (service3, update3, options) => uninterruptible(withFiber((fiber3) => {
4562
+ const original = getUnsafe(fiber3.context, service3);
4563
+ const updated = update3(original);
4564
+ fiber3.setContext(add(fiber3.context, service3, updated));
4565
+ return scopeAddFinalizerExit(getUnsafe(fiber3.context, scopeTag), (_) => {
4566
+ const current = getUnsafe(fiber3.context, service3);
4567
+ let next;
4568
+ if (options?.reset === void 0) {
4569
+ if (current !== updated) return void_3;
4570
+ next = original;
4571
+ } else {
4572
+ next = options.reset(original, updated, current);
4573
+ }
4574
+ fiber3.setContext(add(fiber3.context, service3, next));
4575
+ return void_3;
4576
+ });
4577
+ }));
4445
4578
  var context = () => getContext;
4446
4579
  var getContext = /* @__PURE__ */ withFiber((fiber3) => succeed3(fiber3.context));
4447
4580
  var contextWith = (f) => withFiber((fiber3) => f(fiber3.context));
4581
+ var setContext = /* @__PURE__ */ dual(2, (self, context3) => updateContext(self, constant(context3)));
4448
4582
  var provideContext = /* @__PURE__ */ dual(2, (self, context3) => {
4449
4583
  if (effectIsExit(self)) return self;
4450
4584
  return updateContext(self, merge(context3));
@@ -4461,7 +4595,6 @@ var provideServiceImpl = (self, service3, implementation) => updateContext(self,
4461
4595
  return add(s, service3, implementation);
4462
4596
  });
4463
4597
  var provideServiceEffect = /* @__PURE__ */ dual(3, (self, service3, acquire) => flatMap4(acquire, (implementation) => provideService(self, service3, implementation)));
4464
- var withConcurrency = /* @__PURE__ */ provideService(CurrentConcurrency);
4465
4598
  var zip2 = /* @__PURE__ */ dual((args2) => isEffect(args2[1]), (self, that, options) => zipWith3(self, that, (a, a2) => [a, a2], options));
4466
4599
  var zipWith3 = /* @__PURE__ */ dual((args2) => isEffect(args2[1]), (self, that, f, options) => options?.concurrent ? map5(all3([self, that], {
4467
4600
  concurrency: 2
@@ -4865,7 +4998,7 @@ var acquireUseRelease = (acquire, use, release) => uninterruptibleMask((restore)
4865
4998
  var acquireDisposable = (acquire) => acquireRelease(acquire, (resource) => hasProperty(resource, Symbol.asyncDispose) ? promise(() => resource[Symbol.asyncDispose]()) : sync(() => resource[Symbol.dispose]()));
4866
4999
  var cachedInvalidateWithTTL = /* @__PURE__ */ dual(2, (self, ttl) => sync(() => {
4867
5000
  const ttlMillis = toMillis(fromInputUnsafe(ttl));
4868
- const isFinite = Number.isFinite(ttlMillis);
5001
+ const isFinite2 = Number.isFinite(ttlMillis);
4869
5002
  const latch = makeLatchUnsafe(false);
4870
5003
  let expiresAt = 0;
4871
5004
  let running = false;
@@ -4873,7 +5006,7 @@ var cachedInvalidateWithTTL = /* @__PURE__ */ dual(2, (self, ttl) => sync(() =>
4873
5006
  const wait = flatMap4(latch.await, () => exit3);
4874
5007
  return [withFiber((fiber3) => {
4875
5008
  const clock = fiber3.getRef(ClockRef);
4876
- const now = isFinite ? clock.currentTimeMillisUnsafe() : 0;
5009
+ const now = isFinite2 ? clock.currentTimeMillisUnsafe() : 0;
4877
5010
  if (running || now < expiresAt) return exit3 ?? wait;
4878
5011
  running = true;
4879
5012
  latch.closeUnsafe();
@@ -4910,12 +5043,14 @@ var setInterruptible = /* @__PURE__ */ makePrimitive({
4910
5043
  });
4911
5044
  var setInterruptibleTrue = /* @__PURE__ */ setInterruptible(true);
4912
5045
  var setInterruptibleFalse = /* @__PURE__ */ setInterruptible(false);
4913
- var interruptible = (self) => withFiber((fiber3) => {
4914
- if (fiber3.interruptible) return self;
5046
+ var setFiberInterruptible = (fiber3) => {
4915
5047
  fiber3.interruptible = true;
4916
5048
  fiber3._stack.push(setInterruptibleFalse);
4917
5049
  if (fiber3._interruptedCause) return failCause(fiber3._interruptedCause);
4918
- return self;
5050
+ };
5051
+ var interruptible = (self) => withFiber((fiber3) => {
5052
+ if (fiber3.interruptible) return self;
5053
+ return setFiberInterruptible(fiber3) ?? self;
4919
5054
  });
4920
5055
  var uninterruptibleMask = (f) => withFiber((fiber3) => {
4921
5056
  if (!fiber3.interruptible) return f(identity);
@@ -4925,9 +5060,9 @@ var uninterruptibleMask = (f) => withFiber((fiber3) => {
4925
5060
  });
4926
5061
  var interruptibleMask = (f) => withFiber((fiber3) => {
4927
5062
  if (fiber3.interruptible) return f(identity);
4928
- fiber3.interruptible = true;
4929
- fiber3._stack.push(setInterruptibleFalse);
4930
- return f(uninterruptible);
5063
+ const interrupted = setFiberInterruptible(fiber3);
5064
+ const effect = f(uninterruptible);
5065
+ return interrupted ?? effect;
4931
5066
  });
4932
5067
  var abortSignal = /* @__PURE__ */ map5(/* @__PURE__ */ acquireRelease(/* @__PURE__ */ sync(() => new AbortController()), (controller) => sync(() => controller.abort())), (_) => _.signal);
4933
5068
  var all3 = (arg, options) => {
@@ -4939,7 +5074,7 @@ var all3 = (arg, options) => {
4939
5074
  return suspend(() => {
4940
5075
  const out = {};
4941
5076
  return as2(forEach2(Object.entries(arg), ([key, effect]) => map5(options?.mode === "result" ? result(effect) : effect, (value) => {
4942
- out[key] = value;
5077
+ assignProperty(out, key, value);
4943
5078
  }), {
4944
5079
  discard: true,
4945
5080
  concurrency: options?.concurrency
@@ -4947,6 +5082,22 @@ var all3 = (arg, options) => {
4947
5082
  });
4948
5083
  };
4949
5084
  var partition2 = /* @__PURE__ */ dual((args2) => isIterable(args2[0]) && !isEffect(args2[0]), (elements, f, options) => map5(forEach2(elements, (a, i) => result(f(a, i)), options), (results) => partition(results, identity)));
5085
+ var reduce2 = /* @__PURE__ */ dual(3, (elements, zero2, f) => {
5086
+ const arr = fromIterable2(elements);
5087
+ if (arr.length === 0) return sync(zero2);
5088
+ return suspend(() => {
5089
+ let index = 0;
5090
+ let state = zero2();
5091
+ return map5(whileLoop({
5092
+ while: () => index < arr.length,
5093
+ body: () => f(state, arr[index], index),
5094
+ step(next) {
5095
+ state = next;
5096
+ index++;
5097
+ }
5098
+ }), () => state);
5099
+ });
5100
+ });
4950
5101
  var validate = /* @__PURE__ */ dual((args2) => isIterable(args2[0]) && !isEffect(args2[0]), (elements, f, options) => flatMap4(partition2(elements, f, {
4951
5102
  concurrency: options?.concurrency
4952
5103
  }), ([excluded, satisfying]) => {
@@ -5009,8 +5160,8 @@ var whileLoop = /* @__PURE__ */ makePrimitive({
5009
5160
  return exitVoid;
5010
5161
  }
5011
5162
  });
5012
- var forEach2 = /* @__PURE__ */ dual((args2) => typeof args2[1] === "function", (iterable, f, options) => withFiber((parent) => {
5013
- const concurrencyOption = options?.concurrency === "inherit" ? parent.getRef(CurrentConcurrency) : options?.concurrency ?? 1;
5163
+ var forEach2 = /* @__PURE__ */ dual((args2) => typeof args2[1] === "function", (iterable, f, options) => suspend(() => {
5164
+ const concurrencyOption = options?.concurrency ?? 1;
5014
5165
  const concurrency = concurrencyOption === "unbounded" ? Number.POSITIVE_INFINITY : Math.max(1, concurrencyOption);
5015
5166
  if (concurrency === 1) {
5016
5167
  return forEachSequential(iterable, f, options);
@@ -5050,6 +5201,7 @@ var iterateEagerImpl = (options) => {
5050
5201
  let index = opts?.start ?? 0;
5051
5202
  const end = opts?.end ?? items.length;
5052
5203
  const concurrency = opts?.concurrency ?? 1;
5204
+ const orderedStep = opts?.orderedStep === true && concurrency > 1;
5053
5205
  let done4 = false;
5054
5206
  let parentFiber;
5055
5207
  let fibers;
@@ -5057,26 +5209,54 @@ var iterateEagerImpl = (options) => {
5057
5209
  let interrupted = false;
5058
5210
  let terminal;
5059
5211
  let effect;
5212
+ let nextIndex = index;
5213
+ const exits = orderedStep ? new Array(end) : void 0;
5214
+ const failDefect = (error) => {
5215
+ const defect = exitDie(error);
5216
+ terminal = defect;
5217
+ done4 = true;
5218
+ interrupted = true;
5219
+ return fibers && fibers.size > 0 ? flatMap4(uninterruptible(fiberInterruptAll(Array.from(fibers))), () => defect) : defect;
5220
+ };
5221
+ const runStep = (item, exit3, currentIndex) => {
5222
+ if (!orderedStep) return step(state, item, exit3, currentIndex);
5223
+ if (terminal) return terminal;
5224
+ exits[currentIndex] = exit3;
5225
+ while (nextIndex < end) {
5226
+ const nextExit = exits[nextIndex];
5227
+ if (nextExit === void 0) return;
5228
+ exits[nextIndex] = void 0;
5229
+ const index2 = nextIndex++;
5230
+ const result3 = step(state, items[index2], nextExit, index2);
5231
+ if (result3) return result3;
5232
+ }
5233
+ };
5060
5234
  const go = () => {
5061
5235
  let paused = false;
5062
5236
  for (; !terminal && index < end; index++) {
5063
5237
  const item = items[index];
5064
5238
  const eff = effect ?? onItem(state, item, index);
5065
5239
  if (effectIsExit(eff)) {
5066
- terminal = step(state, item, eff, index);
5240
+ terminal = runStep(item, eff, index);
5067
5241
  if (terminal) break;
5068
5242
  } else if (concurrency === 1) {
5069
5243
  return flatMap4(exit(eff), (exit3) => {
5070
- terminal = step(state, item, exit3, index);
5244
+ terminal = runStep(item, exit3, index);
5071
5245
  index++;
5072
5246
  return terminal ?? go() ?? void_3;
5073
5247
  });
5074
5248
  } else if (!parentFiber) {
5075
5249
  return callback((cb) => {
5076
5250
  parentFiber = getCurrentFiber();
5251
+ fibers = /* @__PURE__ */ new Set();
5077
5252
  effect = eff;
5078
5253
  resume = cb;
5079
- const result3 = go();
5254
+ let result3;
5255
+ try {
5256
+ result3 = go();
5257
+ } catch (error) {
5258
+ return cb(failDefect(error));
5259
+ }
5080
5260
  if (result3) return cb(result3);
5081
5261
  return suspend(() => {
5082
5262
  terminal = exitVoid;
@@ -5088,39 +5268,42 @@ var iterateEagerImpl = (options) => {
5088
5268
  effect = void 0;
5089
5269
  const fiber3 = forkUnsafe(parentFiber, eff, true, true, "inherit");
5090
5270
  if (fiber3._exit) {
5091
- terminal = step(state, item, fiber3._exit, index);
5271
+ terminal = runStep(item, fiber3._exit, index);
5092
5272
  if (terminal) break;
5093
5273
  continue;
5094
5274
  }
5095
- if (fibers) fibers.add(fiber3);
5096
- else fibers = /* @__PURE__ */ new Set([fiber3]);
5275
+ fibers.add(fiber3);
5097
5276
  const currentIndex = index;
5098
5277
  fiber3.addObserver((exit3) => {
5099
5278
  fibers.delete(fiber3);
5100
- if (terminal) {
5101
- if (!interrupted && exit3._tag === "Failure") {
5102
- for (const reason of exit3.cause.reasons) {
5103
- if (reason._tag === "Interrupt") continue;
5104
- else if (terminal._tag === "Failure") {
5105
- ;
5106
- terminal.cause.reasons.push(reason);
5107
- } else {
5108
- terminal = exitFailCause(causeFromReasons([reason]));
5279
+ try {
5280
+ if (terminal) {
5281
+ if (!interrupted && exit3._tag === "Failure") {
5282
+ for (const reason of exit3.cause.reasons) {
5283
+ if (reason._tag === "Interrupt") continue;
5284
+ else if (terminal._tag === "Failure") {
5285
+ ;
5286
+ terminal.cause.reasons.push(reason);
5287
+ } else {
5288
+ terminal = exitFailCause(causeFromReasons([reason]));
5289
+ }
5109
5290
  }
5110
5291
  }
5292
+ } else {
5293
+ const result3 = runStep(item, exit3, currentIndex);
5294
+ if (result3) {
5295
+ terminal = result3._tag === "Failure" ? exitFailCause(causeFromReasons(result3.cause.reasons.slice())) : result3;
5296
+ go();
5297
+ }
5111
5298
  }
5112
- } else {
5113
- const result3 = step(state, item, exit3, currentIndex);
5114
- if (result3) {
5115
- terminal = result3._tag === "Failure" ? exitFailCause(causeFromReasons(result3.cause.reasons.slice())) : result3;
5116
- go();
5299
+ if (paused) {
5300
+ const eff2 = go();
5301
+ if (eff2) resume(eff2);
5302
+ } else if (done4 && fibers.size === 0) {
5303
+ resume(terminal ?? void_3);
5117
5304
  }
5118
- }
5119
- if (paused) {
5120
- const eff2 = go();
5121
- if (eff2) resume(eff2);
5122
- } else if (done4 && fibers.size === 0) {
5123
- resume(terminal ?? void_3);
5305
+ } catch (error) {
5306
+ resume(failDefect(error));
5124
5307
  }
5125
5308
  });
5126
5309
  if (fibers.size < concurrency) continue;
@@ -5231,13 +5414,13 @@ var forkUnsafe = (parent, effect, immediate = false, daemon = false, uninterrupt
5231
5414
  };
5232
5415
  var forkDetach = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, options) => withFiber((fiber3) => succeed3(forkUnsafe(fiber3, self, options?.startImmediately, true, options?.uninterruptible))));
5233
5416
  var awaitAllChildren = (self) => withFiber((fiber3) => {
5234
- const initialChildren = fiber3._children && fromIterable2(fiber3._children);
5417
+ const initialChildren = fiber3._children && new Set(fiber3._children);
5235
5418
  return onExit(self, (_) => {
5236
5419
  let children = fiber3._children;
5237
5420
  if (children === void 0 || children.size === 0) {
5238
5421
  return void_3;
5239
5422
  } else if (initialChildren) {
5240
- children = filter2(children, (child) => !initialChildren.includes(child));
5423
+ children = filter2(children, (child) => !initialChildren.has(child));
5241
5424
  }
5242
5425
  return asVoid2(fiberAwaitAll(children));
5243
5426
  });
@@ -5319,7 +5502,7 @@ var runSyncExitWith = (context3) => {
5319
5502
  const fiber3 = runFork3(effect, {
5320
5503
  scheduler
5321
5504
  });
5322
- fiber3.currentDispatcher?.flush();
5505
+ fiber3._dispatcher?.flush();
5323
5506
  return fiber3._exit ?? exitDie(new AsyncFiberError(fiber3));
5324
5507
  };
5325
5508
  };
@@ -5337,27 +5520,42 @@ var succeedTrue = /* @__PURE__ */ succeed3(true);
5337
5520
  var succeedFalse = /* @__PURE__ */ succeed3(false);
5338
5521
  var Latch = class {
5339
5522
  waiters = [];
5340
- scheduled = false;
5523
+ scheduled = void 0;
5341
5524
  _isOpen;
5342
5525
  constructor(isOpen) {
5343
5526
  this._isOpen = isOpen;
5344
5527
  }
5345
5528
  scheduleUnsafe(fiber3) {
5346
- if (this.scheduled || this.waiters.length === 0) {
5529
+ if (this.waiters.length === 0) {
5347
5530
  return succeedTrue;
5348
5531
  }
5349
- this.scheduled = true;
5350
- fiber3.currentDispatcher.scheduleTask(this.flushWaiters, 0);
5532
+ if (this.scheduled === void 0) {
5533
+ this.scheduled = this.waiters;
5534
+ fiber3.currentDispatcher.scheduleTask(this.flushScheduled, 0);
5535
+ } else {
5536
+ for (let i = 0; i < this.waiters.length; i++) {
5537
+ this.scheduled.push(this.waiters[i]);
5538
+ }
5539
+ }
5540
+ this.waiters = [];
5351
5541
  return succeedTrue;
5352
5542
  }
5353
- flushWaiters = () => {
5354
- this.scheduled = false;
5543
+ flushScheduled = () => {
5544
+ if (this.scheduled === void 0) return;
5545
+ const waiters = this.scheduled;
5546
+ this.scheduled = void 0;
5547
+ for (let i = 0; i < waiters.length; i++) {
5548
+ waiters[i](exitVoid);
5549
+ }
5550
+ };
5551
+ flushWaiters() {
5355
5552
  const waiters = this.waiters;
5356
5553
  this.waiters = [];
5554
+ this.flushScheduled();
5357
5555
  for (let i = 0; i < waiters.length; i++) {
5358
5556
  waiters[i](exitVoid);
5359
5557
  }
5360
- };
5558
+ }
5361
5559
  open = /* @__PURE__ */ withFiber((fiber3) => {
5362
5560
  if (this._isOpen) return succeedFalse;
5363
5561
  this._isOpen = true;
@@ -5376,9 +5574,14 @@ var Latch = class {
5376
5574
  }
5377
5575
  this.waiters.push(resume);
5378
5576
  return sync(() => {
5379
- const index = this.waiters.indexOf(resume);
5577
+ let index = this.waiters.indexOf(resume);
5380
5578
  if (index !== -1) {
5381
5579
  this.waiters.splice(index, 1);
5580
+ } else if (this.scheduled !== void 0) {
5581
+ index = this.scheduled.indexOf(resume);
5582
+ if (index !== -1) {
5583
+ this.scheduled.splice(index, 1);
5584
+ }
5382
5585
  }
5383
5586
  });
5384
5587
  });
@@ -5546,13 +5749,16 @@ var withSpan = function() {
5546
5749
  return (self, ...args2) => useSpan(name, fnArg ? fnArg(...args2) : options, (span2) => withParentSpan(self, span2, traceOptions));
5547
5750
  };
5548
5751
  var annotateSpans = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (effect, ...args2) => updateService(effect, TracerSpanAnnotations, (annotations) => {
5549
- const newAnnotations = {
5752
+ const newAnnotations = args2.length === 1 ? {
5753
+ ...annotations,
5754
+ ...args2[0]
5755
+ } : {
5550
5756
  ...annotations
5551
5757
  };
5552
5758
  if (args2.length === 1) {
5553
- Object.assign(newAnnotations, args2[0]);
5759
+ return newAnnotations;
5554
5760
  } else {
5555
- newAnnotations[args2[0]] = args2[1];
5761
+ assignProperty(newAnnotations, args2[0], args2[1]);
5556
5762
  }
5557
5763
  return newAnnotations;
5558
5764
  }));
@@ -5588,11 +5794,14 @@ var ClockImpl = class {
5588
5794
  }
5589
5795
  currentTimeNanos = /* @__PURE__ */ sync(() => this.currentTimeNanosUnsafe());
5590
5796
  sleep(duration) {
5591
- const millis2 = toMillis(duration);
5797
+ return this.sleepMillis(toMillis(duration));
5798
+ }
5799
+ sleepMillis(millis2) {
5592
5800
  if (millis2 <= 0) return yieldNow;
5801
+ else if (!Number.isFinite(millis2)) return never;
5593
5802
  return callback((resume) => {
5594
- if (millis2 > MAX_TIMER_MILLIS) return;
5595
- const handle = setTimeout(() => resume(void_3), millis2);
5803
+ const continuation = millis2 > MAX_TIMER_MILLIS ? this.sleepMillis(millis2 - MAX_TIMER_MILLIS) : void_3;
5804
+ const handle = setTimeout(() => resume(continuation), Math.min(millis2, MAX_TIMER_MILLIS));
5596
5805
  return sync(() => clearTimeout(handle));
5597
5806
  });
5598
5807
  }
@@ -5706,7 +5915,7 @@ var annotateLogsScoped = function() {
5706
5915
  };
5707
5916
  for (let i = 0; i < entries.length; i++) {
5708
5917
  const [key, value] = entries[i];
5709
- next[key] = value;
5918
+ assignProperty(next, key, value);
5710
5919
  }
5711
5920
  fiber3.setContext(add(fiber3.context, CurrentLogAnnotations, next));
5712
5921
  return scopeAddFinalizerExit(getUnsafe(fiber3.context, scopeTag), (_) => {
@@ -5717,8 +5926,8 @@ var annotateLogsScoped = function() {
5717
5926
  for (let i = 0; i < entries.length; i++) {
5718
5927
  const [key, value] = entries[i];
5719
5928
  if (current[key] !== value) continue;
5720
- if (key in prev) {
5721
- next2[key] = prev[key];
5929
+ if (Object.hasOwn(prev, key)) {
5930
+ assignProperty(next2, key, prev[key]);
5722
5931
  } else {
5723
5932
  delete next2[key];
5724
5933
  }
@@ -5848,7 +6057,7 @@ var tracerLogger = /* @__PURE__ */ loggerMake(({
5848
6057
  if (span2 === void 0 || span2._tag === "ExternalSpan") return;
5849
6058
  const attributes = {};
5850
6059
  for (const [key, value] of Object.entries(annotations)) {
5851
- attributes[key] = value;
6060
+ assignProperty(attributes, key, value);
5852
6061
  }
5853
6062
  attributes["effect.fiberId"] = fiber3.id;
5854
6063
  attributes["effect.logLevel"] = logLevel.toUpperCase();
@@ -5877,13 +6086,13 @@ var reportCauseUnsafe = (fiber3, cause, defectsOnly) => {
5877
6086
  reporters.forEach((reporter) => reporter.report(opts));
5878
6087
  };
5879
6088
 
5880
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Exit.js
6089
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Exit.js
5881
6090
  var failCause2 = exitFailCause;
5882
6091
  var fail4 = exitFail;
5883
6092
  var void_4 = exitVoid;
5884
6093
  var isSuccess4 = exitIsSuccess;
5885
6094
 
5886
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Deferred.js
6095
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Deferred.js
5887
6096
  var TypeId5 = "~effect/Deferred";
5888
6097
  var DeferredProto = {
5889
6098
  [TypeId5]: {
@@ -5923,16 +6132,16 @@ var doneUnsafe = (self, effect) => {
5923
6132
  return true;
5924
6133
  };
5925
6134
 
5926
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/References.js
6135
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/References.js
5927
6136
  var CurrentLogAnnotations2 = CurrentLogAnnotations;
5928
6137
  var CurrentLogSpans2 = CurrentLogSpans;
5929
6138
 
5930
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Scope.js
6139
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Scope.js
5931
6140
  var makeUnsafe3 = scopeMakeUnsafe;
5932
6141
  var forkUnsafe2 = scopeForkUnsafe;
5933
6142
  var close = scopeClose;
5934
6143
 
5935
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Layer.js
6144
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Layer.js
5936
6145
  var TypeId6 = "~effect/Layer";
5937
6146
  var MemoMapTypeId = "~effect/Layer/MemoMap";
5938
6147
  var memoMapReuse = (entry, scope3) => {
@@ -6005,11 +6214,15 @@ var MemoMapImpl = class {
6005
6214
  }
6006
6215
  };
6007
6216
  var makeMemoMapUnsafe = () => new MemoMapImpl();
6008
- var CurrentMemoMap = class extends (/* @__PURE__ */ Service()("effect/Layer/CurrentMemoMap")) {
6009
- static getOrCreate = /* @__PURE__ */ getOrElse2(this, makeMemoMapUnsafe);
6217
+ var forkMemoMapUnsafe = (parent) => new MemoMapImpl(parent);
6218
+ var CurrentMemoMap = class _CurrentMemoMap extends (/* @__PURE__ */ Service()("effect/Layer/CurrentMemoMap")) {
6219
+ static forkOrCreate(self) {
6220
+ const current = getOrUndefined2(self, _CurrentMemoMap);
6221
+ return current ? forkMemoMapUnsafe(current) : makeMemoMapUnsafe();
6222
+ }
6010
6223
  };
6011
6224
  var buildWithMemoMap = /* @__PURE__ */ dual(3, (self, memoMap, scope3) => provideService(map5(self.build(memoMap, scope3), add(CurrentMemoMap, memoMap)), CurrentMemoMap, memoMap));
6012
- var buildWithScope = /* @__PURE__ */ dual(2, (self, scope3) => withFiber((fiber3) => buildWithMemoMap(self, CurrentMemoMap.getOrCreate(fiber3.context), scope3)));
6225
+ var buildWithScope = /* @__PURE__ */ dual(2, (self, scope3) => withFiber((fiber3) => buildWithMemoMap(self, CurrentMemoMap.forkOrCreate(fiber3.context), scope3)));
6013
6226
  var succeedContext = (context3) => fromBuildUnsafe(constant(succeed3(context3)));
6014
6227
  var mergeAllEffect = (layers, memoMap, scope3) => {
6015
6228
  const parentScope = forkUnsafe2(scope3, "parallel");
@@ -6021,7 +6234,7 @@ var mergeAll2 = (...layers) => fromBuild((memoMap, scope3) => mergeAllEffect(lay
6021
6234
  var provideWith = (self, that, f) => fromBuild((memoMap, scope3) => flatMap4(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope3) : that.build(memoMap, scope3), (context3) => self.build(memoMap, scope3).pipe(provideContext(context3), map5((merged) => f(merged, context3)))));
6022
6235
  var provide2 = /* @__PURE__ */ dual(2, (self, that) => provideWith(self, that, identity));
6023
6236
 
6024
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/ExecutionPlan.js
6237
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/ExecutionPlan.js
6025
6238
  var TypeId7 = "~effect/ExecutionPlan";
6026
6239
  var Proto2 = {
6027
6240
  [TypeId7]: TypeId7,
@@ -6048,17 +6261,17 @@ var CurrentMetadata = /* @__PURE__ */ Reference("effect/ExecutionPlan/CurrentMet
6048
6261
  })
6049
6262
  });
6050
6263
 
6051
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Cause.js
6264
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Cause.js
6052
6265
  var isFailReason2 = isFailReason;
6053
6266
  var map6 = causeMap;
6054
6267
  var findError2 = findError;
6055
6268
  var isDone2 = isDone;
6056
6269
  var done3 = done;
6057
6270
 
6058
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Data.js
6271
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Data.js
6059
6272
  var TaggedError2 = TaggedError;
6060
6273
 
6061
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Pull.js
6274
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Pull.js
6062
6275
  var catchDone = /* @__PURE__ */ dual(2, (effect, f) => catchCauseFilter(effect, filterDoneLeftover, (l) => f(l)));
6063
6276
  var filterDone = /* @__PURE__ */ composePassthrough(findError2, (e) => isDone2(e) ? succeed2(e) : fail2(e));
6064
6277
  var filterDoneLeftover = /* @__PURE__ */ composePassthrough(findError2, (e) => isDone2(e) ? succeed2(e.value) : fail2(e));
@@ -6070,7 +6283,7 @@ var matchEffect2 = /* @__PURE__ */ dual(2, (self, options) => matchCauseEffect(s
6070
6283
  }
6071
6284
  }));
6072
6285
 
6073
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Schedule.js
6286
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Schedule.js
6074
6287
  var TypeId8 = "~effect/Schedule";
6075
6288
  var CurrentMetadata2 = /* @__PURE__ */ Reference("effect/Schedule/CurrentMetadata", {
6076
6289
  defaultValue: /* @__PURE__ */ constant({
@@ -6162,11 +6375,11 @@ var while_ = /* @__PURE__ */ dual(2, (self, predicate) => fromStep(map5(toStep(s
6162
6375
  })));
6163
6376
  var forever2 = /* @__PURE__ */ spaced(zero);
6164
6377
 
6165
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/layer.js
6378
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/layer.js
6166
6379
  var provideLayer = (self, layer, options) => scopedWith((scope3) => flatMap4(options?.local ? buildWithMemoMap(layer, makeMemoMapUnsafe(), scope3) : buildWithScope(layer, scope3), (context3) => provideContext(self, context3)));
6167
6380
  var provide3 = /* @__PURE__ */ dual((args2) => isEffect(args2[0]), (self, source, options) => isContext(source) ? provideContext(self, source) : provideLayer(self, Array.isArray(source) ? mergeAll2(...source) : source, options));
6168
6381
 
6169
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/schedule.js
6382
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/schedule.js
6170
6383
  var repeatOrElse = /* @__PURE__ */ dual(3, (self, schedule2, orElse3) => flatMap4(toStepWithMetadata(schedule2), (step) => {
6171
6384
  let meta2 = CurrentMetadata2.defaultValue();
6172
6385
  return catch_(forever(tap3(flatMap4(suspend(() => provideService(self, CurrentMetadata2, meta2)), step), (meta_) => sync(() => {
@@ -6237,7 +6450,7 @@ var buildFromOptions = (options) => {
6237
6450
  return schedule2;
6238
6451
  };
6239
6452
 
6240
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/executionPlan.js
6453
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/executionPlan.js
6241
6454
  var withExecutionPlan = /* @__PURE__ */ dual(2, (self, plan) => suspend(() => {
6242
6455
  let i = 0;
6243
6456
  let meta2 = {
@@ -6296,7 +6509,7 @@ var scheduleFromStep = (step, first) => {
6296
6509
  };
6297
6510
  var scheduleOnce = /* @__PURE__ */ recurs(1);
6298
6511
 
6299
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Request.js
6512
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Request.js
6300
6513
  var TypeId9 = "~effect/Request";
6301
6514
  var requestVariance = /* @__PURE__ */ byReferenceUnsafe({
6302
6515
  /* c8 ignore next */
@@ -6312,7 +6525,7 @@ var RequestPrototype = {
6312
6525
  };
6313
6526
  var makeEntry = (options) => options;
6314
6527
 
6315
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/request.js
6528
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/request.js
6316
6529
  var request = /* @__PURE__ */ dual(2, (self, resolver) => {
6317
6530
  const withResolver = (resolver2) => callback((resume) => {
6318
6531
  const entry = addEntry(resolver2, self, resume, getCurrentFiber());
@@ -6405,7 +6618,7 @@ var removeEntryUnsafe = (resolver, entry) => {
6405
6618
  if (entry.uninterruptible) return;
6406
6619
  const batchMap = pendingBatches.get(resolver);
6407
6620
  if (!batchMap) return;
6408
- const key = resolver.batchKey(entry.request);
6621
+ const key = resolver.batchKey(entry);
6409
6622
  const batch = batchMap.get(key);
6410
6623
  if (!batch) return;
6411
6624
  batch.entries.delete(entry);
@@ -6422,7 +6635,7 @@ function runBatch(batch) {
6422
6635
  return batch.run;
6423
6636
  }
6424
6637
 
6425
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Metric.js
6638
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Metric.js
6426
6639
  var CurrentMetricAttributesKey = "effect/Metric/CurrentMetricAttributes";
6427
6640
  var CurrentMetricAttributes = /* @__PURE__ */ Reference(CurrentMetricAttributesKey, {
6428
6641
  defaultValue: () => ({})
@@ -6518,18 +6731,19 @@ function mergeAttributes(self, other) {
6518
6731
  function attributesToRecord(attributes) {
6519
6732
  if (isNotUndefined(attributes) && Array.isArray(attributes)) {
6520
6733
  return attributes.reduce((acc, [key, value]) => {
6521
- acc[key] = value;
6734
+ assignProperty(acc, key, value);
6522
6735
  return acc;
6523
6736
  }, {});
6524
6737
  }
6525
6738
  return attributes;
6526
6739
  }
6527
6740
 
6528
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Effect.js
6741
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Effect.js
6529
6742
  var TypeId11 = EffectTypeId;
6530
6743
  var isEffect2 = isEffect;
6531
6744
  var all4 = all3;
6532
6745
  var partition3 = partition2;
6746
+ var reduce3 = reduce2;
6533
6747
  var validate2 = validate;
6534
6748
  var findFirst4 = findFirst3;
6535
6749
  var findFirstFilter2 = findFirstFilter;
@@ -6641,13 +6855,14 @@ var context2 = context;
6641
6855
  var contextWith2 = contextWith;
6642
6856
  var provide4 = provide3;
6643
6857
  var provideContext2 = provideContext;
6858
+ var setContext2 = setContext;
6644
6859
  var service2 = service;
6645
6860
  var serviceOption2 = serviceOption;
6646
6861
  var updateContext2 = updateContext;
6647
6862
  var updateService2 = updateService;
6863
+ var updateServiceScoped2 = updateServiceScoped;
6648
6864
  var provideService2 = provideService;
6649
6865
  var provideServiceEffect2 = provideServiceEffect;
6650
- var withConcurrency2 = withConcurrency;
6651
6866
  var scope2 = scope;
6652
6867
  var scoped2 = scoped;
6653
6868
  var scopedWith2 = scopedWith;
@@ -6731,13 +6946,16 @@ var logDebug = /* @__PURE__ */ logWithLevel("Debug");
6731
6946
  var logTrace = /* @__PURE__ */ logWithLevel("Trace");
6732
6947
  var withLogger = /* @__PURE__ */ dual(2, (effect, logger) => updateService(effect, CurrentLoggers, (loggers) => /* @__PURE__ */ new Set([...loggers, logger])));
6733
6948
  var annotateLogs = /* @__PURE__ */ dual((args2) => isEffect2(args2[0]), (effect, ...args2) => updateService(effect, CurrentLogAnnotations2, (annotations) => {
6734
- const newAnnotations = {
6949
+ const newAnnotations = args2.length === 1 ? {
6950
+ ...annotations,
6951
+ ...args2[0]
6952
+ } : {
6735
6953
  ...annotations
6736
6954
  };
6737
6955
  if (args2.length === 1) {
6738
- Object.assign(newAnnotations, args2[0]);
6956
+ return newAnnotations;
6739
6957
  } else {
6740
- newAnnotations[args2[0]] = args2[1];
6958
+ assignProperty(newAnnotations, args2[0], args2[1]);
6741
6959
  }
6742
6960
  return newAnnotations;
6743
6961
  }));
@@ -6875,7 +7093,7 @@ var flatMapEager2 = flatMapEager;
6875
7093
  var catchEager2 = catchEager;
6876
7094
  var fnUntracedEager2 = fnUntracedEager;
6877
7095
 
6878
- // ../../node_modules/.pnpm/effect-oxlint@0.3.2_effect@4.0.0-beta.88/node_modules/effect-oxlint/dist/RuleContext.js
7096
+ // ../../node_modules/.pnpm/effect-oxlint@0.3.2_effect@4.0.0-beta.102/node_modules/effect-oxlint/dist/RuleContext.js
6879
7097
  var RuleContextBase = Service()("effect-oxlint/RuleContext");
6880
7098
  var RuleContext = class extends RuleContextBase {
6881
7099
  };
@@ -6896,7 +7114,7 @@ service2(RuleContext).pipe(map7((ctx) => ctx.sourceCode));
6896
7114
  service2(RuleContext).pipe(map7((ctx) => ctx.sourceCode.text));
6897
7115
  service2(RuleContext).pipe(map7((ctx) => ctx.sourceCode.ast));
6898
7116
 
6899
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Encoding.js
7117
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Encoding.js
6900
7118
  var EncodingErrorTypeId = "~effect/encoding/EncodingError";
6901
7119
  var EncodingError = class extends (/* @__PURE__ */ TaggedError2("EncodingError")) {
6902
7120
  /**
@@ -6988,13 +7206,15 @@ function getBase64Code(charCode) {
6988
7206
  var base64abc = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/"];
6989
7207
  var base64codes = [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 0, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255, 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51];
6990
7208
 
6991
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/schema/annotations.js
7209
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/schema/annotations.js
6992
7210
  function resolve(ast) {
6993
7211
  return ast.checks ? ast.checks[ast.checks.length - 1].annotations : ast.annotations;
6994
7212
  }
6995
7213
  function resolveAt(key) {
6996
7214
  return (ast) => resolve(ast)?.[key];
6997
7215
  }
7216
+ var STRUCTURAL_ANNOTATION_KEY = "~structural";
7217
+ var SENTINELS_ANNOTATION_KEY = "~sentinels";
6998
7218
  var resolveIdentifier = /* @__PURE__ */ resolveAt("identifier");
6999
7219
  var getExpected = /* @__PURE__ */ memoize((ast) => {
7000
7220
  const identifier2 = resolveIdentifier(ast);
@@ -7002,25 +7222,10 @@ var getExpected = /* @__PURE__ */ memoize((ast) => {
7002
7222
  return ast.getExpected(getExpected);
7003
7223
  });
7004
7224
 
7005
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/record.js
7006
- function set(self, key, value) {
7007
- if (key === "__proto__") {
7008
- Object.defineProperty(self, key, {
7009
- value,
7010
- writable: true,
7011
- enumerable: true,
7012
- configurable: true
7013
- });
7014
- } else {
7015
- self[key] = value;
7016
- }
7017
- return self;
7018
- }
7019
-
7020
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/SchemaIssue.js
7225
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/SchemaIssue.js
7021
7226
  var TypeId12 = "~effect/SchemaIssue/Issue";
7022
7227
  function isIssue(u) {
7023
- return hasProperty(u, TypeId12);
7228
+ return hasProperty(u, TypeId12) && u[TypeId12] === TypeId12;
7024
7229
  }
7025
7230
  var Base = class {
7026
7231
  [TypeId12] = TypeId12;
@@ -7367,7 +7572,7 @@ function formatOption(actual) {
7367
7572
  return format(actual.value);
7368
7573
  }
7369
7574
 
7370
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/schema/cause.js
7575
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/schema/cause.js
7371
7576
  function getSchemaIssue(cause) {
7372
7577
  let issue;
7373
7578
  for (const reason of cause.reasons) {
@@ -7388,7 +7593,7 @@ function getSchemaIssueOrThrow(cause, message) {
7388
7593
  return issue;
7389
7594
  }
7390
7595
 
7391
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/SchemaGetter.js
7596
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/SchemaGetter.js
7392
7597
  var Getter = class _Getter extends Class {
7393
7598
  run;
7394
7599
  constructor(run2) {
@@ -7439,9 +7644,6 @@ function String2() {
7439
7644
  function Number3() {
7440
7645
  return transform(globalThis.Number);
7441
7646
  }
7442
- function Date3() {
7443
- return transform((u) => new globalThis.Date(u));
7444
- }
7445
7647
  function encodeBase642() {
7446
7648
  return transform(encodeBase64);
7447
7649
  }
@@ -7451,7 +7653,7 @@ function decodeBase642() {
7451
7653
  })));
7452
7654
  }
7453
7655
 
7454
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/SchemaTransformation.js
7656
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/SchemaTransformation.js
7455
7657
  var TypeId13 = "~effect/SchemaTransformation/Transformation";
7456
7658
  var Transformation = class _Transformation {
7457
7659
  [TypeId13] = TypeId13;
@@ -7470,7 +7672,7 @@ var Transformation = class _Transformation {
7470
7672
  }
7471
7673
  };
7472
7674
  function isTransformation(u) {
7473
- return hasProperty(u, TypeId13);
7675
+ return hasProperty(u, TypeId13) && u[TypeId13] === TypeId13;
7474
7676
  }
7475
7677
  var make11 = (options) => {
7476
7678
  if (isTransformation(options)) {
@@ -7489,7 +7691,6 @@ function passthrough3() {
7489
7691
  return passthrough_2;
7490
7692
  }
7491
7693
  var numberFromString = /* @__PURE__ */ new Transformation(/* @__PURE__ */ Number3(), /* @__PURE__ */ String2());
7492
- var dateFromString = /* @__PURE__ */ new Transformation(/* @__PURE__ */ Date3(), /* @__PURE__ */ transform(formatDate));
7493
7694
  var urlFromString = /* @__PURE__ */ transformOrFail2({
7494
7695
  decode: (s) => URL.canParse(s) ? succeed4(new URL(s)) : fail5(new InvalidValue(some2(s), {
7495
7696
  message: `Invalid URL string: ${s}`
@@ -7498,7 +7699,7 @@ var urlFromString = /* @__PURE__ */ transformOrFail2({
7498
7699
  });
7499
7700
  var uint8ArrayFromBase64String = /* @__PURE__ */ new Transformation(/* @__PURE__ */ decodeBase642(), /* @__PURE__ */ encodeBase642());
7500
7701
 
7501
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/SchemaAST.js
7702
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/SchemaAST.js
7502
7703
  function makeGuard(tag2) {
7503
7704
  return (ast) => ast._tag === tag2;
7504
7705
  }
@@ -7667,14 +7868,14 @@ var Number4 = class extends Base2 {
7667
7868
  }
7668
7869
  /** @internal */
7669
7870
  toCodecJson() {
7670
- if (this.checks && (hasCheck(this.checks, "isFinite") || hasCheck(this.checks, "isInt"))) {
7871
+ if (this.checks && (hasCheck(this.checks, "effect/schema/isFinite") || hasCheck(this.checks, "effect/schema/isInt"))) {
7671
7872
  return this;
7672
7873
  }
7673
- return replaceEncoding(this, [numberToJson]);
7874
+ return replaceEncoding(this, [numberToJson(this.checks)]);
7674
7875
  }
7675
7876
  /** @internal */
7676
7877
  toCodecStringTree() {
7677
- if (this.checks && (hasCheck(this.checks, "isFinite") || hasCheck(this.checks, "isInt"))) {
7878
+ if (this.toCodecJson() === this) {
7678
7879
  return replaceEncoding(this, [finiteToString]);
7679
7880
  }
7680
7881
  return replaceEncoding(this, [numberToString]);
@@ -7684,15 +7885,12 @@ var Number4 = class extends Base2 {
7684
7885
  return "number";
7685
7886
  }
7686
7887
  };
7687
- function hasCheck(checks, tag2) {
7688
- return checks.some((c) => {
7689
- switch (c._tag) {
7690
- case "Filter":
7691
- return c.annotations?.meta?._tag === tag2;
7692
- case "FilterGroup":
7693
- return hasCheck(c.checks, tag2);
7694
- }
7695
- });
7888
+ function hasCheck(checks, id) {
7889
+ return checks.some((check) => check.annotations?.representation?.id === id || check._tag === "FilterGroup" && hasCheck(check.checks, id));
7890
+ }
7891
+ function numberToJson(checks) {
7892
+ const encodedFinite = checks === void 0 ? finite : appendChecks(finite, checks);
7893
+ return new Link(new Union([encodedFinite, nonFiniteLiterals], "anyOf"), new Transformation(Number3(), transform((n) => globalThis.Number.isFinite(n) ? n : globalThis.String(n))));
7696
7894
  }
7697
7895
  var number2 = /* @__PURE__ */ new Number4();
7698
7896
  var Arrays = class _Arrays extends Base2 {
@@ -7967,9 +8165,9 @@ var Objects = class _Objects extends Base2 {
7967
8165
  const v2 = exitValue.value.value;
7968
8166
  if (is2.merge && is2.merge.decode && Object.hasOwn(s.out, k2)) {
7969
8167
  const [k, v] = is2.merge.decode.combine([k2, s.out[k2]], [k2, v2]);
7970
- set(s.out, k, v);
8168
+ assignProperty(s.out, k, v);
7971
8169
  } else {
7972
- set(s.out, k2, v2);
8170
+ assignProperty(s.out, k2, v2);
7973
8171
  }
7974
8172
  }
7975
8173
  }),
@@ -8014,7 +8212,7 @@ var Objects = class _Objects extends Base2 {
8014
8212
  return yield* fail5(new Composite(ast, oinput, [issue]));
8015
8213
  }
8016
8214
  } else {
8017
- set(out, key, input[key]);
8215
+ assignProperty(out, key, input[key]);
8018
8216
  }
8019
8217
  }
8020
8218
  }
@@ -8043,7 +8241,7 @@ var Objects = class _Objects extends Base2 {
8043
8241
  const preserved = {};
8044
8242
  for (const key of keys2) {
8045
8243
  if (Object.hasOwn(out, key)) {
8046
- set(preserved, key, out[key]);
8244
+ assignProperty(preserved, key, out[key]);
8047
8245
  }
8048
8246
  }
8049
8247
  return some2(preserved);
@@ -8087,7 +8285,7 @@ var parseProperties = /* @__PURE__ */ iterateEager()({
8087
8285
  if (exit3._tag === "Failure") {
8088
8286
  return wrapPropertyKeyIssue(s, s.ast, p.name, exit3);
8089
8287
  } else if (exit3.value._tag === "Some") {
8090
- set(s.out, p.name, exit3.value.value);
8288
+ assignProperty(s.out, p.name, exit3.value.value);
8091
8289
  } else if (!isOptional(p.type)) {
8092
8290
  const issue = new Pointer([p.name], new MissingKey(p.type.context?.annotations));
8093
8291
  if (s.options.errors === "all") {
@@ -8124,7 +8322,6 @@ function getCandidateTypes(ast) {
8124
8322
  case "Null":
8125
8323
  return ["null"];
8126
8324
  case "Undefined":
8127
- case "Void":
8128
8325
  return ["undefined"];
8129
8326
  case "String":
8130
8327
  case "TemplateLiteral":
@@ -8143,7 +8340,7 @@ function getCandidateTypes(ast) {
8143
8340
  case "ObjectKeyword":
8144
8341
  return ["object", "array", "function"];
8145
8342
  case "Objects":
8146
- return ast.propertySignatures.length || ast.indexSignatures.length ? ["object"] : ["object", "array"];
8343
+ return ast.propertySignatures.length || ast.indexSignatures.length ? ["object"] : ["string", "number", "boolean", "symbol", "bigint", "object", "array", "function"];
8147
8344
  case "Enum":
8148
8345
  return Array.from(new Set(ast.enums.map(([, v]) => typeof v)));
8149
8346
  case "Literal":
@@ -8159,7 +8356,7 @@ function collectSentinels(ast) {
8159
8356
  default:
8160
8357
  return [];
8161
8358
  case "Declaration": {
8162
- const s = ast.annotations?.["~sentinels"];
8359
+ const s = ast.annotations?.[SENTINELS_ANNOTATION_KEY];
8163
8360
  return Array.isArray(s) ? s : [];
8164
8361
  }
8165
8362
  case "Objects":
@@ -8197,13 +8394,14 @@ function getIndex(types) {
8197
8394
  let idx = candidateIndexCache.get(types);
8198
8395
  if (idx) return idx;
8199
8396
  idx = {};
8200
- for (const a of types) {
8397
+ for (let i = 0; i < types.length; i++) {
8398
+ const a = types[i];
8201
8399
  const encoded = toEncoded(a);
8202
8400
  if (isNever2(encoded)) continue;
8203
- const types2 = getCandidateTypes(encoded);
8401
+ const candidateTypes = getCandidateTypes(encoded);
8204
8402
  const sentinels = collectSentinels(encoded);
8205
8403
  idx.byType ??= {};
8206
- for (const t of types2) (idx.byType[t] ??= []).push(a);
8404
+ for (const t of candidateTypes) (idx.byType[t] ??= []).push(i);
8207
8405
  if (sentinels.length > 0) {
8208
8406
  idx.bySentinel ??= /* @__PURE__ */ new Map();
8209
8407
  for (const {
@@ -8214,11 +8412,11 @@ function getIndex(types) {
8214
8412
  if (!m) idx.bySentinel.set(key, m = /* @__PURE__ */ new Map());
8215
8413
  let arr = m.get(literal);
8216
8414
  if (!arr) m.set(literal, arr = []);
8217
- arr.push(a);
8415
+ arr.push(i);
8218
8416
  }
8219
8417
  } else {
8220
8418
  idx.otherwise ??= {};
8221
- for (const t of types2) (idx.otherwise[t] ??= []).push(a);
8419
+ for (const t of candidateTypes) (idx.otherwise[t] ??= []).push(i);
8222
8420
  }
8223
8421
  }
8224
8422
  candidateIndexCache.set(types, idx);
@@ -8236,16 +8434,20 @@ function getCandidates(input, types) {
8236
8434
  if (idx.bySentinel) {
8237
8435
  const base = idx.otherwise?.[runtimeType] ?? [];
8238
8436
  if (runtimeType === "object" || runtimeType === "array") {
8437
+ const selected = new Set(base);
8239
8438
  for (const [k, m] of idx.bySentinel) {
8240
8439
  if (Object.hasOwn(input, k)) {
8241
8440
  const match7 = m.get(input[k]);
8242
- if (match7) return [...match7, ...base].filter(filterLiterals(input));
8441
+ if (match7) {
8442
+ for (const candidate of match7) selected.add(candidate);
8443
+ }
8243
8444
  }
8244
8445
  }
8446
+ return Array.from(selected).sort((a, b) => a - b).map((i) => types[i]).filter(filterLiterals(input));
8245
8447
  }
8246
- return base;
8448
+ return base.map((i) => types[i]);
8247
8449
  }
8248
- return (idx.byType?.[runtimeType] ?? []).filter(filterLiterals(input));
8450
+ return (idx.byType?.[runtimeType] ?? []).map((i) => types[i]).filter(filterLiterals(input));
8249
8451
  }
8250
8452
  var Union = class _Union extends Base2 {
8251
8453
  _tag = "Union";
@@ -8278,7 +8480,10 @@ var Union = class _Union extends Base2 {
8278
8480
  options
8279
8481
  };
8280
8482
  const concurrency = resolveConcurrency(options?.concurrency);
8281
- const eff = parseUnion(state, candidates, concurrency);
8483
+ const eff = parseUnion(state, candidates, concurrency ? {
8484
+ ...concurrency,
8485
+ orderedStep: true
8486
+ } : void 0);
8282
8487
  if (!eff) {
8283
8488
  return state.out ? succeed4(state.out) : fail5(new AnyOf(ast, input, state.issues ?? []));
8284
8489
  }
@@ -8362,7 +8567,6 @@ var parseUnion = /* @__PURE__ */ iterateEager()({
8362
8567
  }
8363
8568
  });
8364
8569
  var nonFiniteLiterals = /* @__PURE__ */ new Union([/* @__PURE__ */ new Literal("Infinity"), /* @__PURE__ */ new Literal("-Infinity"), /* @__PURE__ */ new Literal("NaN")], "anyOf");
8365
- var numberToJson = /* @__PURE__ */ new Link(/* @__PURE__ */ new Union([number2, nonFiniteLiterals], "anyOf"), /* @__PURE__ */ new Transformation(/* @__PURE__ */ Number3(), /* @__PURE__ */ transform((n) => globalThis.Number.isFinite(n) ? n : globalThis.String(n))));
8366
8570
  function formatIsMutable(isMutable) {
8367
8571
  return isMutable ? "" : "readonly ";
8368
8572
  }
@@ -8418,14 +8622,43 @@ var FilterGroup = class _FilterGroup extends Class {
8418
8622
  function makeFilter(filter7, annotations, aborted = false) {
8419
8623
  return new Filter2((input, ast, options) => make10(input, ast, filter7(input, ast, options)), annotations, aborted);
8420
8624
  }
8625
+ function isFinite(annotations) {
8626
+ return makeFilter((n) => globalThis.Number.isFinite(n), {
8627
+ expected: "a finite number",
8628
+ representation: {
8629
+ id: "effect/schema/isFinite",
8630
+ payload: null
8631
+ },
8632
+ toJsonSchema: () => ({
8633
+ type: "number"
8634
+ }),
8635
+ toCode: () => ({
8636
+ runtime: "Schema.isFinite()"
8637
+ }),
8638
+ arbitrary: {
8639
+ constraint: {
8640
+ noInfinity: true,
8641
+ noNaN: true
8642
+ }
8643
+ },
8644
+ ...annotations
8645
+ });
8646
+ }
8647
+ var finite = /* @__PURE__ */ appendChecks(number2, [/* @__PURE__ */ isFinite()]);
8421
8648
  function isPattern(regExp, annotations) {
8422
8649
  const source = regExp.source;
8423
8650
  return makeFilter((s) => regExp.test(s), {
8424
8651
  expected: `a string matching the RegExp ${source}`,
8425
- meta: {
8426
- _tag: "isPattern",
8427
- regExp
8652
+ representation: {
8653
+ id: "effect/schema/isPattern",
8654
+ payload: {
8655
+ source,
8656
+ flags: regExp.flags
8657
+ }
8428
8658
  },
8659
+ toJsonSchema: () => ({
8660
+ pattern: source
8661
+ }),
8429
8662
  arbitrary: {
8430
8663
  constraint: {
8431
8664
  patterns: [regExp.source]
@@ -8481,14 +8714,15 @@ function replaceChecks(ast, checks) {
8481
8714
  function appendChecks(ast, checks) {
8482
8715
  return replaceChecks(ast, combineChecks(ast.checks, checks));
8483
8716
  }
8717
+ function mapLink(link2, f) {
8718
+ const to = f(link2.to);
8719
+ return to === link2.to ? link2 : new Link(to, link2.transformation);
8720
+ }
8484
8721
  function updateLastLink(encoding, f) {
8485
8722
  const links = encoding;
8486
8723
  const last2 = links[links.length - 1];
8487
- const to = f(last2.to);
8488
- if (to !== last2.to) {
8489
- return append(encoding.slice(0, encoding.length - 1), new Link(to, last2.transformation));
8490
- }
8491
- return encoding;
8724
+ const out = mapLink(last2, f);
8725
+ return out === last2 ? encoding : append(encoding.slice(0, encoding.length - 1), out);
8492
8726
  }
8493
8727
  function applyToSelfOrLastLinkEncoding(f) {
8494
8728
  function out(ast) {
@@ -8532,6 +8766,17 @@ function decodeTo(from, to, transformation) {
8532
8766
  function isOptional(ast) {
8533
8767
  return ast.context?.isOptional ?? false;
8534
8768
  }
8769
+ function isStructuralCheck(check) {
8770
+ return check.annotations?.[STRUCTURAL_ANNOTATION_KEY] === true || check._tag === "FilterGroup" && check.checks.every(isStructuralCheck);
8771
+ }
8772
+ function extractStructuralChecks(checks) {
8773
+ function extract(check) {
8774
+ if (isStructuralCheck(check)) return [check];
8775
+ return check._tag === "FilterGroup" ? check.checks.flatMap(extract) : [];
8776
+ }
8777
+ const out = checks.flatMap(extract);
8778
+ return isArrayNonEmpty2(out) ? out : void 0;
8779
+ }
8535
8780
  var toType = /* @__PURE__ */ memoize((ast) => {
8536
8781
  if (ast.encoding) {
8537
8782
  return toType(replaceEncoding(ast, void 0));
@@ -8540,11 +8785,10 @@ var toType = /* @__PURE__ */ memoize((ast) => {
8540
8785
  const type = out.recur?.(toType) ?? out;
8541
8786
  const encodingChecks = type.encodingChecks;
8542
8787
  if (encodingChecks) {
8788
+ const checks = type === ast ? encodingChecks : isArrays(type) || isObjects(type) || isDeclaration(type) && type.typeParameters.length > 0 ? extractStructuralChecks(encodingChecks) : void 0;
8543
8789
  return modifyOwnPropertyDescriptors(type, (d) => {
8544
8790
  d.encodingChecks.value = void 0;
8545
- if (type === ast) {
8546
- d.checks.value = combineChecks(type.checks, encodingChecks);
8547
- }
8791
+ d.checks.value = combineChecks(type.checks, checks);
8548
8792
  });
8549
8793
  }
8550
8794
  return type;
@@ -8618,14 +8862,17 @@ var parameterFromPropertyKey = /* @__PURE__ */ applyToSelfOrLastLinkEncoding((as
8618
8862
  }
8619
8863
  });
8620
8864
  var isStringFiniteRegExp = /* @__PURE__ */ new globalThis.RegExp(`^${FINITE_PATTERN}$`);
8621
- var isStringNumberRegExp = /* @__PURE__ */ new globalThis.RegExp(`(?:${FINITE_PATTERN}|Infinity|-Infinity|NaN)`);
8865
+ var isStringNumberRegExp = /* @__PURE__ */ new globalThis.RegExp(`^(?:${FINITE_PATTERN}|Infinity|-Infinity|NaN)$`);
8622
8866
  function isStringFinite(annotations) {
8623
8867
  return isPattern(isStringFiniteRegExp, {
8624
8868
  expected: "a string representing a finite number",
8625
- meta: {
8626
- _tag: "isStringFinite",
8627
- regExp: isStringFiniteRegExp
8869
+ representation: {
8870
+ id: "effect/schema/isStringFinite",
8871
+ payload: null
8628
8872
  },
8873
+ toJsonSchema: () => ({
8874
+ pattern: isStringFiniteRegExp.source
8875
+ }),
8629
8876
  ...annotations
8630
8877
  });
8631
8878
  }
@@ -8653,20 +8900,35 @@ function collectIssues(checks, value, issues, ast, options) {
8653
8900
  }
8654
8901
  }
8655
8902
  var ClassTypeId = "~effect/Schema/Class";
8656
- var STRUCTURAL_ANNOTATION_KEY = "~structural";
8657
8903
 
8658
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Struct.js
8659
- var lambda = (f) => f;
8904
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/SchemaError.js
8905
+ var TypeId15 = "~effect/SchemaError/SchemaError";
8906
+ var SchemaError = class extends (/* @__PURE__ */ TaggedError2("SchemaError")) {
8907
+ [TypeId15] = TypeId15;
8908
+ constructor(issue) {
8909
+ super({
8910
+ issue
8911
+ });
8912
+ }
8913
+ get message() {
8914
+ return this.issue.toString();
8915
+ }
8916
+ toString() {
8917
+ return `SchemaError(${this.message})`;
8918
+ }
8919
+ };
8920
+ function isSchemaError(u) {
8921
+ return hasProperty(u, TypeId15) && u[TypeId15] === TypeId15;
8922
+ }
8660
8923
 
8661
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/SchemaParser.js
8662
- var recurDefaults = /* @__PURE__ */ memoize((ast) => {
8924
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/SchemaParser.js
8925
+ var toConstructorAST = /* @__PURE__ */ memoize((ast) => {
8663
8926
  switch (ast._tag) {
8664
8927
  case "Declaration": {
8665
8928
  const getLink = ast.annotations?.[ClassTypeId];
8666
8929
  if (isFunction(getLink)) {
8667
8930
  const link2 = getLink(ast.typeParameters);
8668
- const to = recurDefaults(link2.to);
8669
- return replaceEncoding(ast, to === link2.to ? [link2] : [new Link(to, link2.transformation)]);
8931
+ return replaceEncoding(ast, [mapLink(link2, toConstructorAST)]);
8670
8932
  }
8671
8933
  return ast;
8672
8934
  }
@@ -8675,18 +8937,19 @@ var recurDefaults = /* @__PURE__ */ memoize((ast) => {
8675
8937
  return ast.recur((ast2) => {
8676
8938
  const defaultValue = ast2.context?.defaultValue;
8677
8939
  if (defaultValue) {
8678
- return replaceEncoding(recurDefaults(ast2), defaultValue);
8940
+ const out = toConstructorAST(ast2);
8941
+ return replaceEncoding(out, out.encoding ? [...out.encoding, ...defaultValue] : defaultValue);
8679
8942
  }
8680
- return recurDefaults(ast2);
8943
+ return toConstructorAST(ast2);
8681
8944
  });
8682
8945
  case "Suspend":
8683
- return ast.recur(recurDefaults);
8946
+ return ast.recur(toConstructorAST);
8684
8947
  default:
8685
8948
  return ast;
8686
8949
  }
8687
8950
  });
8688
8951
  function makeEffect(schema) {
8689
- const ast = recurDefaults(toType(schema.ast));
8952
+ const ast = toConstructorAST(toType(schema.ast));
8690
8953
  const parser = run(ast);
8691
8954
  return (input, options) => {
8692
8955
  return parser(input, options?.disableChecks ? options?.parseOptions ? {
@@ -8761,8 +9024,6 @@ var recur = /* @__PURE__ */ memoize((ast) => {
8761
9024
  return parser(ou, options);
8762
9025
  };
8763
9026
  }
8764
- const isStructural = isArrays(ast) || isObjects(ast) || isDeclaration(ast) && ast.typeParameters.length > 0;
8765
- const structuralChecks = checks && isStructural ? checks.filter((check) => check.annotations?.[STRUCTURAL_ANNOTATION_KEY]) : void 0;
8766
9027
  return (ou, options) => {
8767
9028
  if (astOptions) {
8768
9029
  options = {
@@ -8802,14 +9063,6 @@ var recur = /* @__PURE__ */ memoize((ast) => {
8802
9063
  });
8803
9064
  }
8804
9065
  if (checks && !options?.disableChecks) {
8805
- if (options?.errors === "all" && structuralChecks && structuralChecks.length > 0 && isSome2(localOu)) {
8806
- sroa2 = mapSchemaIssueEffect(sroa2, (issue) => {
8807
- const issues = [];
8808
- collectIssues(structuralChecks, localOu.value, issues, ast, options);
8809
- const out = isArrayNonEmpty2(issues) ? issue._tag === "Composite" && issue.ast === ast ? new Composite(ast, issue.actual, [...issue.issues, ...issues]) : new Composite(ast, localOu, [issue, ...issues]) : issue;
8810
- return out;
8811
- });
8812
- }
8813
9066
  sroa2 = flatMapEager2(sroa2, (oa) => {
8814
9067
  if (isSome2(oa)) {
8815
9068
  const value = oa.value;
@@ -8829,10 +9082,10 @@ var recur = /* @__PURE__ */ memoize((ast) => {
8829
9082
  };
8830
9083
  });
8831
9084
 
8832
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/internal/schema/schema.js
8833
- var TypeId15 = "~effect/Schema/Schema";
9085
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/schema/schema.js
9086
+ var TypeId16 = "~effect/Schema/Schema";
8834
9087
  var SchemaProto = {
8835
- [TypeId15]: TypeId15,
9088
+ [TypeId16]: TypeId16,
8836
9089
  pipe() {
8837
9090
  return pipeArguments(this, arguments);
8838
9091
  },
@@ -8847,40 +9100,27 @@ var SchemaProto = {
8847
9100
  }
8848
9101
  };
8849
9102
  function make13(ast, options) {
8850
- const self = Object.create(SchemaProto);
8851
- if (options) {
8852
- Object.assign(self, options);
9103
+ function Schema() {
8853
9104
  }
9105
+ const self = Object.defineProperties(Object.setPrototypeOf(Schema, SchemaProto), Object.getOwnPropertyDescriptors({
9106
+ ...options
9107
+ }));
8854
9108
  self.ast = ast;
8855
9109
  self.rebuild = (ast2) => make13(ast2, options);
8856
- self.makeEffect = (input, options2) => mapSchemaIssueEffect2(makeEffect(self)(input, options2));
9110
+ const makeEffect2 = makeEffect(self);
9111
+ self.makeEffect = (input, options2) => fromIssueEffect(makeEffect2(input, options2));
8857
9112
  self.make = make12(self);
8858
9113
  self.makeOption = makeOption(self);
8859
9114
  return self;
8860
9115
  }
8861
- var SchemaErrorTypeId = "~effect/Schema/SchemaError";
8862
- var SchemaError = class extends (/* @__PURE__ */ TaggedError2("SchemaError")) {
8863
- [SchemaErrorTypeId] = SchemaErrorTypeId;
8864
- constructor(issue) {
8865
- super({
8866
- issue
8867
- });
8868
- }
8869
- get message() {
8870
- return this.issue.toString();
8871
- }
8872
- toString() {
8873
- return `SchemaError(${this.message})`;
8874
- }
8875
- };
8876
- function mapSchemaIssueEffect2(self) {
9116
+ function fromIssueEffect(self) {
8877
9117
  return catchCause2(self, (cause) => failCauseSync2(() => map6(cause, (issue) => new SchemaError(issue))));
8878
9118
  }
8879
- function mapSchemaErrorEffect(self) {
8880
- return catchCause2(self, (cause) => failCauseSync2(() => map6(cause, (error) => error.issue)));
8881
- }
8882
9119
 
8883
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Schema.js
9120
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Struct.js
9121
+ var lambda = (f) => f;
9122
+
9123
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Schema.js
8884
9124
  function declareConstructor() {
8885
9125
  return (typeParameters, run2, annotations) => {
8886
9126
  return make14(new Declaration(typeParameters.map(getAST), (typeParameters2) => run2(typeParameters2.map((ast) => make14(ast))), annotations));
@@ -8889,13 +9129,10 @@ function declareConstructor() {
8889
9129
  function declare(is2, annotations) {
8890
9130
  return declareConstructor()([], () => (input, ast) => is2(input) ? succeed4(input) : fail5(new InvalidType(ast, some2(input))), annotations);
8891
9131
  }
8892
- function isSchemaError(u) {
8893
- return hasProperty(u, SchemaErrorTypeId);
8894
- }
8895
9132
  function decodeUnknownEffect2(schema, options) {
8896
9133
  const parser = decodeUnknownEffect(schema, options);
8897
9134
  return (input, options2) => {
8898
- return mapSchemaIssueEffect2(parser(input, options2));
9135
+ return fromIssueEffect(parser(input, options2));
8899
9136
  };
8900
9137
  }
8901
9138
  function getSchemaErrorOrThrow(cause, message) {
@@ -8991,10 +9228,13 @@ function decodeTo2(to, transformation) {
8991
9228
  };
8992
9229
  }
8993
9230
  function withConstructorDefault2(defaultValue) {
8994
- return (schema) => make14(withConstructorDefault(schema.ast, mapSchemaErrorEffect(defaultValue)), {
9231
+ return (schema) => make14(withConstructorDefault(schema.ast, toIssueEffect(defaultValue)), {
8995
9232
  schema
8996
9233
  });
8997
9234
  }
9235
+ function toIssueEffect(self) {
9236
+ return catchCause2(self, (cause) => failCauseSync2(() => map6(cause, (error) => error.issue)));
9237
+ }
8998
9238
  function tag(literal) {
8999
9239
  return Literal2(literal).pipe(withConstructorDefault2(succeed4(literal)));
9000
9240
  }
@@ -9006,26 +9246,66 @@ function link() {
9006
9246
  return new Link(encodeTo.ast, make11(transformation));
9007
9247
  };
9008
9248
  }
9009
- var isPattern2 = isPattern;
9249
+ var makeFilter2 = makeFilter;
9250
+ function isPattern2(regExp, annotations) {
9251
+ const source = regExp.source;
9252
+ const flags = regExp.flags;
9253
+ const runtimeRegExp = flags === "" ? `new RegExp(${format(source)})` : `new RegExp(${format(source)}, ${format(flags)})`;
9254
+ return isPattern(regExp, {
9255
+ toCode: () => ({
9256
+ runtime: `Schema.isPattern(${runtimeRegExp})`
9257
+ }),
9258
+ ...annotations
9259
+ });
9260
+ }
9010
9261
  function isBase64(annotations) {
9011
9262
  const regExp = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
9012
9263
  return isPattern2(regExp, {
9013
9264
  expected: "a base64 encoded string",
9014
- meta: {
9015
- _tag: "isBase64",
9016
- regExp
9265
+ representation: {
9266
+ id: "effect/schema/isBase64",
9267
+ payload: null
9017
9268
  },
9269
+ toJsonSchema: () => ({
9270
+ pattern: regExp.source
9271
+ }),
9272
+ toCode: () => ({
9273
+ runtime: "Schema.isBase64()"
9274
+ }),
9018
9275
  ...annotations
9019
9276
  });
9020
9277
  }
9278
+ function isInt(annotations) {
9279
+ return makeFilter2((n) => globalThis.Number.isSafeInteger(n), {
9280
+ expected: "an integer",
9281
+ representation: {
9282
+ id: "effect/schema/isInt",
9283
+ payload: null
9284
+ },
9285
+ toJsonSchema: () => ({
9286
+ type: "integer"
9287
+ }),
9288
+ toCode: () => ({
9289
+ runtime: "Schema.isInt()"
9290
+ }),
9291
+ arbitrary: {
9292
+ constraint: {
9293
+ integer: true
9294
+ }
9295
+ },
9296
+ ...annotations
9297
+ });
9298
+ }
9299
+ var Int = /* @__PURE__ */ Number5.check(/* @__PURE__ */ isInt());
9021
9300
  var RegExp2 = /* @__PURE__ */ instanceOf(globalThis.RegExp, {
9022
- typeConstructor: {
9023
- _tag: "RegExp"
9301
+ representation: {
9302
+ id: "effect/schema/RegExp",
9303
+ payload: null
9024
9304
  },
9025
- generation: {
9305
+ toCode: () => ({
9026
9306
  runtime: `Schema.RegExp`,
9027
9307
  Type: `globalThis.RegExp`
9028
- },
9308
+ }),
9029
9309
  expected: "RegExp",
9030
9310
  toCodecJson: () => link()(Struct({
9031
9311
  source: String4,
@@ -9063,71 +9343,34 @@ var URLString = /* @__PURE__ */ String4.annotate({
9063
9343
  expected: "a string that will be decoded as a URL"
9064
9344
  });
9065
9345
  var URL2 = /* @__PURE__ */ instanceOf(globalThis.URL, {
9066
- typeConstructor: {
9067
- _tag: "URL"
9346
+ representation: {
9347
+ id: "effect/schema/URL",
9348
+ payload: null
9068
9349
  },
9069
- generation: {
9350
+ toCode: () => ({
9070
9351
  runtime: `Schema.URL`,
9071
9352
  Type: `globalThis.URL`
9072
- },
9353
+ }),
9073
9354
  expected: "URL",
9074
9355
  toCodecJson: () => link()(URLString, urlFromString),
9075
9356
  toArbitrary: () => (fc) => fc.webUrl().map((s) => new globalThis.URL(s)),
9076
9357
  toEquivalence: () => (a, b) => a.toString() === b.toString()
9077
9358
  });
9078
- function dateArbitraryConstraints(constraint, ordered, base, toDate) {
9079
- const out = {
9080
- ...base
9081
- };
9082
- delete out.valid;
9083
- if (base?.valid || constraint?.valid) {
9084
- out.noInvalidDate = true;
9085
- }
9086
- if (ordered?.minimum !== void 0) {
9087
- const minimum = toDate === void 0 ? ordered.minimum : toDate(ordered.minimum);
9088
- const nextMin = ordered.exclusiveMinimum ? new globalThis.Date(minimum.getTime() + 1) : minimum;
9089
- if (out.min === void 0 || nextMin.getTime() > out.min.getTime()) {
9090
- out.min = nextMin;
9091
- }
9092
- }
9093
- if (ordered?.maximum !== void 0) {
9094
- const maximum = toDate === void 0 ? ordered.maximum : toDate(ordered.maximum);
9095
- const nextMax = ordered.exclusiveMaximum ? new globalThis.Date(maximum.getTime() - 1) : maximum;
9096
- if (out.max === void 0 || nextMax.getTime() < out.max.getTime()) {
9097
- out.max = nextMax;
9098
- }
9099
- }
9100
- return out;
9101
- }
9102
- var DateString = /* @__PURE__ */ String4.annotate({
9103
- expected: "a string in ISO 8601 format that will be decoded as a Date"
9104
- });
9105
- var Date4 = /* @__PURE__ */ instanceOf(globalThis.Date, {
9106
- typeConstructor: {
9107
- _tag: "Date"
9108
- },
9109
- generation: {
9110
- runtime: `Schema.Date`,
9111
- Type: `globalThis.Date`
9112
- },
9113
- expected: "Date",
9114
- toCodecJson: () => link()(DateString, dateFromString),
9115
- toArbitrary: () => (fc, ctx) => fc.date(dateArbitraryConstraints(ctx?.constraint, ctx?.constraint?.ordered?.order === Date2 ? ctx.constraint.ordered : void 0))
9116
- });
9117
9359
  var File = /* @__PURE__ */ instanceOf(globalThis.File, {
9118
- typeConstructor: {
9119
- _tag: "File"
9360
+ representation: {
9361
+ id: "effect/schema/File",
9362
+ payload: null
9120
9363
  },
9121
- generation: {
9364
+ toCode: () => ({
9122
9365
  runtime: `Schema.File`,
9123
9366
  Type: `globalThis.File`
9124
- },
9367
+ }),
9125
9368
  expected: "File",
9126
9369
  toCodecJson: () => link()(Struct({
9127
9370
  data: String4.check(isBase64()),
9128
9371
  type: String4,
9129
9372
  name: String4,
9130
- lastModified: Number5
9373
+ lastModified: Int
9131
9374
  }), transformOrFail2({
9132
9375
  decode: (e) => match3(decodeBase64(e.data), {
9133
9376
  onFailure: (error) => fail5(new InvalidValue(some2(e.data), {
@@ -9158,13 +9401,14 @@ var File = /* @__PURE__ */ instanceOf(globalThis.File, {
9158
9401
  }))
9159
9402
  });
9160
9403
  var FormData2 = /* @__PURE__ */ instanceOf(globalThis.FormData, {
9161
- typeConstructor: {
9162
- _tag: "FormData"
9404
+ representation: {
9405
+ id: "effect/schema/FormData",
9406
+ payload: null
9163
9407
  },
9164
- generation: {
9408
+ toCode: () => ({
9165
9409
  runtime: `Schema.FormData`,
9166
9410
  Type: `globalThis.FormData`
9167
- },
9411
+ }),
9168
9412
  expected: "FormData",
9169
9413
  toCodecJson: () => link()(ArraySchema(Tuple([String4, Union2([Struct({
9170
9414
  _tag: tag("String"),
@@ -9198,13 +9442,14 @@ var FormData2 = /* @__PURE__ */ instanceOf(globalThis.FormData, {
9198
9442
  }))
9199
9443
  });
9200
9444
  var URLSearchParams2 = /* @__PURE__ */ instanceOf(globalThis.URLSearchParams, {
9201
- typeConstructor: {
9202
- _tag: "URLSearchParams"
9445
+ representation: {
9446
+ id: "effect/schema/URLSearchParams",
9447
+ payload: null
9203
9448
  },
9204
- generation: {
9449
+ toCode: () => ({
9205
9450
  runtime: `Schema.URLSearchParams`,
9206
9451
  Type: `globalThis.URLSearchParams`
9207
- },
9452
+ }),
9208
9453
  expected: "URLSearchParams",
9209
9454
  toCodecJson: () => link()(String4.annotate({
9210
9455
  expected: "a query string that will be decoded as URLSearchParams"
@@ -9219,19 +9464,20 @@ var Base64String = /* @__PURE__ */ String4.annotate({
9219
9464
  contentEncoding: "base64"
9220
9465
  });
9221
9466
  var Uint8Array2 = /* @__PURE__ */ instanceOf(globalThis.Uint8Array, {
9222
- typeConstructor: {
9223
- _tag: "Uint8Array"
9467
+ representation: {
9468
+ id: "effect/schema/Uint8Array",
9469
+ payload: null
9224
9470
  },
9225
- generation: {
9471
+ toCode: () => ({
9226
9472
  runtime: `Schema.Uint8Array`,
9227
9473
  Type: `globalThis.Uint8Array`
9228
- },
9474
+ }),
9229
9475
  expected: "Uint8Array",
9230
9476
  toCodecJson: () => link()(Base64String, uint8ArrayFromBase64String),
9231
9477
  toArbitrary: () => (fc) => fc.uint8Array()
9232
9478
  });
9233
9479
 
9234
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Ref.js
9480
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Ref.js
9235
9481
  var Ref_exports = {};
9236
9482
  __export(Ref_exports, {
9237
9483
  get: () => get3,
@@ -9243,7 +9489,7 @@ __export(Ref_exports, {
9243
9489
  makeUnsafe: () => makeUnsafe4,
9244
9490
  modify: () => modify2,
9245
9491
  modifySome: () => modifySome,
9246
- set: () => set3,
9492
+ set: () => set2,
9247
9493
  setAndGet: () => setAndGet,
9248
9494
  update: () => update2,
9249
9495
  updateAndGet: () => updateAndGet,
@@ -9251,10 +9497,10 @@ __export(Ref_exports, {
9251
9497
  updateSomeAndGet: () => updateSomeAndGet
9252
9498
  });
9253
9499
 
9254
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/MutableRef.js
9255
- var TypeId16 = "~effect/MutableRef";
9500
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/MutableRef.js
9501
+ var TypeId17 = "~effect/MutableRef";
9256
9502
  var MutableRefProto = {
9257
- [TypeId16]: TypeId16,
9503
+ [TypeId17]: TypeId17,
9258
9504
  ...PipeInspectableProto,
9259
9505
  toJSON() {
9260
9506
  return {
@@ -9268,15 +9514,15 @@ var make15 = (value) => {
9268
9514
  ref.current = value;
9269
9515
  return ref;
9270
9516
  };
9271
- var set2 = /* @__PURE__ */ dual(2, (self, value) => {
9517
+ var set = /* @__PURE__ */ dual(2, (self, value) => {
9272
9518
  self.current = value;
9273
9519
  return self;
9274
9520
  });
9275
9521
 
9276
- // ../../node_modules/.pnpm/effect@4.0.0-beta.88/node_modules/effect/dist/Ref.js
9277
- var TypeId17 = "~effect/Ref";
9522
+ // ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Ref.js
9523
+ var TypeId18 = "~effect/Ref";
9278
9524
  var RefProto = {
9279
- [TypeId17]: {
9525
+ [TypeId18]: {
9280
9526
  _A: identity
9281
9527
  },
9282
9528
  ...PipeInspectableProto,
@@ -9294,7 +9540,7 @@ var makeUnsafe4 = (value) => {
9294
9540
  };
9295
9541
  var make16 = (value) => sync2(() => makeUnsafe4(value));
9296
9542
  var get3 = (self) => sync2(() => self.ref.current);
9297
- var set3 = /* @__PURE__ */ dual(2, (self, value) => sync2(() => set2(self.ref, value)));
9543
+ var set2 = /* @__PURE__ */ dual(2, (self, value) => sync2(() => set(self.ref, value)));
9298
9544
  var getAndSet = /* @__PURE__ */ dual(2, (self, value) => sync2(() => {
9299
9545
  const current = self.ref.current;
9300
9546
  self.ref.current = value;
@@ -9342,7 +9588,7 @@ var updateSomeAndGet = /* @__PURE__ */ dual(2, (self, pf) => sync2(() => {
9342
9588
  }));
9343
9589
  var getUnsafe3 = (self) => self.ref.current;
9344
9590
 
9345
- // ../../node_modules/.pnpm/effect-oxlint@0.3.2_effect@4.0.0-beta.88/node_modules/effect-oxlint/dist/index.js
9591
+ // ../../node_modules/.pnpm/effect-oxlint@0.3.2_effect@4.0.0-beta.102/node_modules/effect-oxlint/dist/index.js
9346
9592
  var AST_exports = /* @__PURE__ */ __exportAll({
9347
9593
  calleeIdentifier: () => calleeIdentifier,
9348
9594
  calleeName: () => calleeName,
@@ -9753,6 +9999,9 @@ var firstStringArgument = (node) => {
9753
9999
  // src/rules/command-binding-matches-name.ts
9754
10000
  var innerCommandDefineCall = (node) => {
9755
10001
  if (!isCallExpression(node)) return void 0;
10002
+ if (AST_exports.isCallOf(node, "Command", "define")) {
10003
+ return node;
10004
+ }
9756
10005
  const callee = node.callee;
9757
10006
  if (!isCallExpression(callee)) return void 0;
9758
10007
  if (!AST_exports.isCallOf(callee, "Command", "define")) return void 0;