@eslint-react/jsx 1.5.20-next.8 → 1.5.21-next.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 (3) hide show
  1. package/dist/index.js +52 -2153
  2. package/dist/index.mjs +52 -2153
  3. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -3,12 +3,10 @@
3
3
  var types = require('@typescript-eslint/types');
4
4
  var ast = require('@eslint-react/ast');
5
5
  var _var = require('@eslint-react/var');
6
+ var effect = require('effect');
7
+ var tsPattern = require('ts-pattern');
6
8
 
7
- var __defProp = Object.defineProperty;
8
- var __export = (target, all3) => {
9
- for (var name in all3)
10
- __defProp(target, name, { get: all3[name], enumerable: true });
11
- };
9
+ // src/element/element-type.ts
12
10
  function resolveMemberExpressions(object, property) {
13
11
  if (object.type === types.AST_NODE_TYPES.JSXMemberExpression) {
14
12
  return `${resolveMemberExpressions(object.object, object.property)}.${property.name}`;
@@ -32,2104 +30,9 @@ function elementType(node) {
32
30
  }
33
31
  return name.name;
34
32
  }
35
-
36
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Function.js
37
- var Function_exports = {};
38
- __export(Function_exports, {
39
- SK: () => SK,
40
- absurd: () => absurd,
41
- apply: () => apply,
42
- compose: () => compose,
43
- constFalse: () => constFalse,
44
- constNull: () => constNull,
45
- constTrue: () => constTrue,
46
- constUndefined: () => constUndefined,
47
- constVoid: () => constVoid,
48
- constant: () => constant,
49
- dual: () => dual,
50
- flip: () => flip,
51
- flow: () => flow,
52
- hole: () => hole,
53
- identity: () => identity,
54
- isFunction: () => isFunction,
55
- pipe: () => pipe,
56
- satisfies: () => satisfies,
57
- tupled: () => tupled,
58
- unsafeCoerce: () => unsafeCoerce,
59
- untupled: () => untupled
60
- });
61
- var isFunction = (input) => typeof input === "function";
62
- var dual = function(arity, body) {
63
- if (typeof arity === "function") {
64
- return function() {
65
- if (arity(arguments)) {
66
- return body.apply(this, arguments);
67
- }
68
- return (self) => body(self, ...arguments);
69
- };
70
- }
71
- switch (arity) {
72
- case 0:
73
- case 1:
74
- throw new RangeError(`Invalid arity ${arity}`);
75
- case 2:
76
- return function(a2, b2) {
77
- if (arguments.length >= 2) {
78
- return body(a2, b2);
79
- }
80
- return function(self) {
81
- return body(self, a2);
82
- };
83
- };
84
- case 3:
85
- return function(a2, b2, c2) {
86
- if (arguments.length >= 3) {
87
- return body(a2, b2, c2);
88
- }
89
- return function(self) {
90
- return body(self, a2, b2);
91
- };
92
- };
93
- case 4:
94
- return function(a2, b2, c2, d2) {
95
- if (arguments.length >= 4) {
96
- return body(a2, b2, c2, d2);
97
- }
98
- return function(self) {
99
- return body(self, a2, b2, c2);
100
- };
101
- };
102
- case 5:
103
- return function(a2, b2, c2, d2, e2) {
104
- if (arguments.length >= 5) {
105
- return body(a2, b2, c2, d2, e2);
106
- }
107
- return function(self) {
108
- return body(self, a2, b2, c2, d2);
109
- };
110
- };
111
- default:
112
- return function() {
113
- if (arguments.length >= arity) {
114
- return body.apply(this, arguments);
115
- }
116
- const args = arguments;
117
- return function(self) {
118
- return body(self, ...args);
119
- };
120
- };
121
- }
122
- };
123
- var apply = (a2) => (self) => self(a2);
124
- var identity = (a2) => a2;
125
- var satisfies = () => (b2) => b2;
126
- var unsafeCoerce = identity;
127
- var constant = (value) => () => value;
128
- var constTrue = /* @__PURE__ */ constant(true);
129
- var constFalse = /* @__PURE__ */ constant(false);
130
- var constNull = /* @__PURE__ */ constant(null);
131
- var constUndefined = /* @__PURE__ */ constant(void 0);
132
- var constVoid = constUndefined;
133
- var flip = (f2) => (...b2) => (...a2) => f2(...a2)(...b2);
134
- var compose = /* @__PURE__ */ dual(2, (ab, bc) => (a2) => bc(ab(a2)));
135
- var absurd = (_2) => {
136
- throw new Error("Called `absurd` function which should be uncallable");
137
- };
138
- var tupled = (f2) => (a2) => f2(...a2);
139
- var untupled = (f2) => (...a2) => f2(a2);
140
- function pipe(a2, ab, bc, cd, de, ef, fg, gh, hi) {
141
- switch (arguments.length) {
142
- case 1:
143
- return a2;
144
- case 2:
145
- return ab(a2);
146
- case 3:
147
- return bc(ab(a2));
148
- case 4:
149
- return cd(bc(ab(a2)));
150
- case 5:
151
- return de(cd(bc(ab(a2))));
152
- case 6:
153
- return ef(de(cd(bc(ab(a2)))));
154
- case 7:
155
- return fg(ef(de(cd(bc(ab(a2))))));
156
- case 8:
157
- return gh(fg(ef(de(cd(bc(ab(a2)))))));
158
- case 9:
159
- return hi(gh(fg(ef(de(cd(bc(ab(a2))))))));
160
- default: {
161
- let ret = arguments[0];
162
- for (let i2 = 1; i2 < arguments.length; i2++) {
163
- ret = arguments[i2](ret);
164
- }
165
- return ret;
166
- }
167
- }
168
- }
169
- function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
170
- switch (arguments.length) {
171
- case 1:
172
- return ab;
173
- case 2:
174
- return function() {
175
- return bc(ab.apply(this, arguments));
176
- };
177
- case 3:
178
- return function() {
179
- return cd(bc(ab.apply(this, arguments)));
180
- };
181
- case 4:
182
- return function() {
183
- return de(cd(bc(ab.apply(this, arguments))));
184
- };
185
- case 5:
186
- return function() {
187
- return ef(de(cd(bc(ab.apply(this, arguments)))));
188
- };
189
- case 6:
190
- return function() {
191
- return fg(ef(de(cd(bc(ab.apply(this, arguments))))));
192
- };
193
- case 7:
194
- return function() {
195
- return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));
196
- };
197
- case 8:
198
- return function() {
199
- return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));
200
- };
201
- case 9:
202
- return function() {
203
- return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));
204
- };
205
- }
206
- return;
207
- }
208
- var hole = /* @__PURE__ */ unsafeCoerce(absurd);
209
- var SK = (_2, b2) => b2;
210
-
211
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Array.js
212
- var Array_exports = {};
213
- __export(Array_exports, {
214
- Do: () => Do2,
215
- allocate: () => allocate,
216
- append: () => append,
217
- appendAll: () => appendAll,
218
- bind: () => bind3,
219
- bindTo: () => bindTo3,
220
- cartesian: () => cartesian,
221
- cartesianWith: () => cartesianWith,
222
- chop: () => chop,
223
- chunksOf: () => chunksOf,
224
- contains: () => contains2,
225
- containsWith: () => containsWith2,
226
- copy: () => copy,
227
- dedupe: () => dedupe,
228
- dedupeAdjacent: () => dedupeAdjacent,
229
- dedupeAdjacentWith: () => dedupeAdjacentWith,
230
- dedupeWith: () => dedupeWith,
231
- difference: () => difference,
232
- differenceWith: () => differenceWith,
233
- drop: () => drop,
234
- dropRight: () => dropRight,
235
- dropWhile: () => dropWhile,
236
- empty: () => empty2,
237
- ensure: () => ensure,
238
- every: () => every2,
239
- extend: () => extend,
240
- filter: () => filter2,
241
- filterMap: () => filterMap2,
242
- filterMapWhile: () => filterMapWhile,
243
- findFirst: () => findFirst2,
244
- findFirstIndex: () => findFirstIndex,
245
- findLast: () => findLast,
246
- findLastIndex: () => findLastIndex,
247
- flatMap: () => flatMap2,
248
- flatMapNullable: () => flatMapNullable2,
249
- flatten: () => flatten2,
250
- forEach: () => forEach,
251
- fromIterable: () => fromIterable2,
252
- fromNullable: () => fromNullable2,
253
- fromOption: () => fromOption2,
254
- fromRecord: () => fromRecord,
255
- get: () => get,
256
- getEquivalence: () => getEquivalence2,
257
- getLefts: () => getLefts,
258
- getOrder: () => getOrder2,
259
- getRights: () => getRights,
260
- getSomes: () => getSomes,
261
- group: () => group,
262
- groupBy: () => groupBy,
263
- groupWith: () => groupWith,
264
- head: () => head,
265
- headNonEmpty: () => headNonEmpty,
266
- init: () => init,
267
- initNonEmpty: () => initNonEmpty,
268
- insertAt: () => insertAt,
269
- intersection: () => intersection,
270
- intersectionWith: () => intersectionWith,
271
- intersperse: () => intersperse,
272
- isArray: () => isArray,
273
- isEmptyArray: () => isEmptyArray,
274
- isEmptyReadonlyArray: () => isEmptyReadonlyArray,
275
- isNonEmptyArray: () => isNonEmptyArray2,
276
- isNonEmptyReadonlyArray: () => isNonEmptyReadonlyArray,
277
- join: () => join,
278
- last: () => last,
279
- lastNonEmpty: () => lastNonEmpty,
280
- length: () => length,
281
- let: () => let_3,
282
- liftEither: () => liftEither,
283
- liftNullable: () => liftNullable2,
284
- liftOption: () => liftOption,
285
- liftPredicate: () => liftPredicate2,
286
- make: () => make4,
287
- makeBy: () => makeBy,
288
- map: () => map2,
289
- mapAccum: () => mapAccum,
290
- match: () => match2,
291
- matchLeft: () => matchLeft,
292
- matchRight: () => matchRight,
293
- max: () => max2,
294
- min: () => min2,
295
- modify: () => modify,
296
- modifyNonEmptyHead: () => modifyNonEmptyHead,
297
- modifyNonEmptyLast: () => modifyNonEmptyLast,
298
- modifyOption: () => modifyOption,
299
- of: () => of,
300
- partition: () => partition,
301
- partitionMap: () => partitionMap2,
302
- prepend: () => prepend,
303
- prependAll: () => prependAll,
304
- range: () => range,
305
- reduce: () => reduce,
306
- reduceRight: () => reduceRight,
307
- remove: () => remove,
308
- replace: () => replace,
309
- replaceOption: () => replaceOption,
310
- replicate: () => replicate,
311
- reverse: () => reverse,
312
- rotate: () => rotate,
313
- scan: () => scan,
314
- scanRight: () => scanRight,
315
- separate: () => separate,
316
- setNonEmptyHead: () => setNonEmptyHead,
317
- setNonEmptyLast: () => setNonEmptyLast,
318
- some: () => some4,
319
- sort: () => sort,
320
- sortBy: () => sortBy,
321
- sortWith: () => sortWith,
322
- span: () => span,
323
- split: () => split,
324
- splitAt: () => splitAt,
325
- splitNonEmptyAt: () => splitNonEmptyAt,
326
- splitWhere: () => splitWhere,
327
- tail: () => tail,
328
- tailNonEmpty: () => tailNonEmpty,
329
- take: () => take,
330
- takeRight: () => takeRight,
331
- takeWhile: () => takeWhile,
332
- unappend: () => unappend,
333
- unfold: () => unfold,
334
- union: () => union,
335
- unionWith: () => unionWith,
336
- unprepend: () => unprepend,
337
- unsafeGet: () => unsafeGet,
338
- unzip: () => unzip,
339
- zip: () => zip,
340
- zipWith: () => zipWith2
341
- });
342
-
343
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Equivalence.js
344
- var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
345
- var array = (item) => make((self, that) => {
346
- if (self.length !== that.length) {
347
- return false;
348
- }
349
- for (let i2 = 0; i2 < self.length; i2++) {
350
- const isEq = item(self[i2], that[i2]);
351
- if (!isEq) {
352
- return false;
353
- }
354
- }
355
- return true;
356
- });
357
-
358
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/doNotation.js
359
- var let_ = (map3) => dual(3, (self, name, f2) => map3(self, (a2) => Object.assign({}, a2, {
360
- [name]: f2(a2)
361
- })));
362
- var bindTo = (map3) => dual(2, (self, name) => map3(self, (a2) => ({
363
- [name]: a2
364
- })));
365
- var bind = (map3, flatMap3) => dual(3, (self, name, f2) => flatMap3(self, (a2) => map3(f2(a2), (b2) => Object.assign({}, a2, {
366
- [name]: b2
367
- }))));
368
-
369
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/version.js
370
- var moduleVersion = "3.4.6";
371
- var getCurrentVersion = () => moduleVersion;
372
-
373
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/GlobalValue.js
374
- var globalStoreId = /* @__PURE__ */ Symbol.for(`effect/GlobalValue/globalStoreId/${/* @__PURE__ */ getCurrentVersion()}`);
375
- if (!(globalStoreId in globalThis)) {
376
- globalThis[globalStoreId] = /* @__PURE__ */ new Map();
377
- }
378
- var globalStore = globalThis[globalStoreId];
379
- var globalValue = (id, compute) => {
380
- if (!globalStore.has(id)) {
381
- globalStore.set(id, compute());
382
- }
383
- return globalStore.get(id);
384
- };
385
-
386
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Predicate.js
387
- var Predicate_exports = {};
388
- __export(Predicate_exports, {
389
- all: () => all,
390
- and: () => and,
391
- compose: () => compose2,
392
- eqv: () => eqv,
393
- every: () => every,
394
- hasProperty: () => hasProperty,
395
- implies: () => implies,
396
- isBigInt: () => isBigInt,
397
- isBoolean: () => isBoolean,
398
- isDate: () => isDate,
399
- isError: () => isError,
400
- isFunction: () => isFunction2,
401
- isIterable: () => isIterable,
402
- isMap: () => isMap,
403
- isNever: () => isNever,
404
- isNotNull: () => isNotNull,
405
- isNotNullable: () => isNotNullable,
406
- isNotUndefined: () => isNotUndefined,
407
- isNull: () => isNull,
408
- isNullable: () => isNullable,
409
- isNumber: () => isNumber,
410
- isObject: () => isObject,
411
- isPromise: () => isPromise,
412
- isPromiseLike: () => isPromiseLike,
413
- isReadonlyRecord: () => isReadonlyRecord,
414
- isRecord: () => isRecord,
415
- isSet: () => isSet,
416
- isString: () => isString,
417
- isSymbol: () => isSymbol,
418
- isTagged: () => isTagged,
419
- isTruthy: () => isTruthy,
420
- isTupleOf: () => isTupleOf,
421
- isTupleOfAtLeast: () => isTupleOfAtLeast,
422
- isUint8Array: () => isUint8Array,
423
- isUndefined: () => isUndefined,
424
- isUnknown: () => isUnknown,
425
- mapInput: () => mapInput,
426
- nand: () => nand,
427
- nor: () => nor,
428
- not: () => not,
429
- or: () => or,
430
- product: () => product,
431
- productMany: () => productMany,
432
- some: () => some,
433
- struct: () => struct,
434
- tuple: () => tuple,
435
- xor: () => xor
436
- });
437
- var mapInput = /* @__PURE__ */ dual(2, (self, f2) => (b2) => self(f2(b2)));
438
- var isTupleOf = /* @__PURE__ */ dual(2, (self, n2) => self.length === n2);
439
- var isTupleOfAtLeast = /* @__PURE__ */ dual(2, (self, n2) => self.length >= n2);
440
- var isTruthy = (input) => !!input;
441
- var isSet = (input) => input instanceof Set;
442
- var isMap = (input) => input instanceof Map;
443
- var isString = (input) => typeof input === "string";
444
- var isNumber = (input) => typeof input === "number";
445
- var isBoolean = (input) => typeof input === "boolean";
446
- var isBigInt = (input) => typeof input === "bigint";
447
- var isSymbol = (input) => typeof input === "symbol";
448
- var isFunction2 = isFunction;
449
- var isUndefined = (input) => input === void 0;
450
- var isNotUndefined = (input) => input !== void 0;
451
- var isNull = (input) => input === null;
452
- var isNotNull = (input) => input !== null;
453
- var isNever = (_2) => false;
454
- var isUnknown = (_2) => true;
455
- var isRecordOrArray = (input) => typeof input === "object" && input !== null;
456
- var isObject = (input) => isRecordOrArray(input) || isFunction2(input);
457
- var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObject(self) && property in self);
458
- var isTagged = /* @__PURE__ */ dual(2, (self, tag) => hasProperty(self, "_tag") && self["_tag"] === tag);
459
- var isNullable = (input) => input === null || input === void 0;
460
- var isNotNullable = (input) => input !== null && input !== void 0;
461
- var isError = (input) => input instanceof Error;
462
- var isUint8Array = (input) => input instanceof Uint8Array;
463
- var isDate = (input) => input instanceof Date;
464
- var isIterable = (input) => hasProperty(input, Symbol.iterator);
465
- var isRecord = (input) => isRecordOrArray(input) && !Array.isArray(input);
466
- var isReadonlyRecord = isRecord;
467
- var isPromise = (input) => hasProperty(input, "then") && "catch" in input && isFunction2(input.then) && isFunction2(input.catch);
468
- var isPromiseLike = (input) => hasProperty(input, "then") && isFunction2(input.then);
469
- var compose2 = /* @__PURE__ */ dual(2, (ab, bc) => (a2) => ab(a2) && bc(a2));
470
- var product = (self, that) => ([a2, b2]) => self(a2) && that(b2);
471
- var all = (collection) => {
472
- return (as2) => {
473
- let collectionIndex = 0;
474
- for (const p2 of collection) {
475
- if (collectionIndex >= as2.length) {
476
- break;
477
- }
478
- if (p2(as2[collectionIndex]) === false) {
479
- return false;
480
- }
481
- collectionIndex++;
482
- }
483
- return true;
484
- };
485
- };
486
- var productMany = (self, collection) => {
487
- const rest = all(collection);
488
- return ([head2, ...tail2]) => self(head2) === false ? false : rest(tail2);
489
- };
490
- var tuple = (...elements) => all(elements);
491
- var struct = (fields) => {
492
- const keys2 = Object.keys(fields);
493
- return (a2) => {
494
- for (const key of keys2) {
495
- if (!fields[key](a2[key])) {
496
- return false;
497
- }
498
- }
499
- return true;
500
- };
501
- };
502
- var not = (self) => (a2) => !self(a2);
503
- var or = /* @__PURE__ */ dual(2, (self, that) => (a2) => self(a2) || that(a2));
504
- var and = /* @__PURE__ */ dual(2, (self, that) => (a2) => self(a2) && that(a2));
505
- var xor = /* @__PURE__ */ dual(2, (self, that) => (a2) => self(a2) !== that(a2));
506
- var eqv = /* @__PURE__ */ dual(2, (self, that) => (a2) => self(a2) === that(a2));
507
- var implies = /* @__PURE__ */ dual(2, (antecedent, consequent) => (a2) => antecedent(a2) ? consequent(a2) : true);
508
- var nor = /* @__PURE__ */ dual(2, (self, that) => (a2) => !(self(a2) || that(a2)));
509
- var nand = /* @__PURE__ */ dual(2, (self, that) => (a2) => !(self(a2) && that(a2)));
510
- var every = (collection) => (a2) => {
511
- for (const p2 of collection) {
512
- if (!p2(a2)) {
513
- return false;
514
- }
515
- }
516
- return true;
517
- };
518
- var some = (collection) => (a2) => {
519
- for (const p2 of collection) {
520
- if (p2(a2)) {
521
- return true;
522
- }
523
- }
524
- return false;
525
- };
526
-
527
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/errors.js
528
- var getBugErrorMessage = (message) => `BUG: ${message} - please report an issue at https://github.com/Effect-TS/effect/issues`;
529
-
530
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Utils.js
531
- var GenKindTypeId = /* @__PURE__ */ Symbol.for("effect/Gen/GenKind");
532
- var isGenKind = (u2) => isObject(u2) && GenKindTypeId in u2;
533
- var GenKindImpl = class {
534
- value;
535
- constructor(value) {
536
- this.value = value;
537
- }
538
- /**
539
- * @since 2.0.0
540
- */
541
- get _F() {
542
- return identity;
543
- }
544
- /**
545
- * @since 2.0.0
546
- */
547
- get _R() {
548
- return (_2) => _2;
549
- }
550
- /**
551
- * @since 2.0.0
552
- */
553
- get _O() {
554
- return (_2) => _2;
555
- }
556
- /**
557
- * @since 2.0.0
558
- */
559
- get _E() {
560
- return (_2) => _2;
561
- }
562
- /**
563
- * @since 2.0.0
564
- */
565
- [GenKindTypeId] = GenKindTypeId;
566
- /**
567
- * @since 2.0.0
568
- */
569
- [Symbol.iterator]() {
570
- return new SingleShotGen(this);
571
- }
572
- };
573
- var SingleShotGen = class _SingleShotGen {
574
- self;
575
- called = false;
576
- constructor(self) {
577
- this.self = self;
578
- }
579
- /**
580
- * @since 2.0.0
581
- */
582
- next(a2) {
583
- return this.called ? {
584
- value: a2,
585
- done: true
586
- } : (this.called = true, {
587
- value: this.self,
588
- done: false
589
- });
590
- }
591
- /**
592
- * @since 2.0.0
593
- */
594
- return(a2) {
595
- return {
596
- value: a2,
597
- done: true
598
- };
599
- }
600
- /**
601
- * @since 2.0.0
602
- */
603
- throw(e2) {
604
- throw e2;
605
- }
606
- /**
607
- * @since 2.0.0
608
- */
609
- [Symbol.iterator]() {
610
- return new _SingleShotGen(this.self);
611
- }
612
- };
613
- var adapter = () => function() {
614
- let x2 = arguments[0];
615
- for (let i2 = 1; i2 < arguments.length; i2++) {
616
- x2 = arguments[i2](x2);
617
- }
618
- return new GenKindImpl(x2);
619
- };
620
- var YieldWrapTypeId = /* @__PURE__ */ Symbol.for("effect/Utils/YieldWrap");
621
- var YieldWrap = class {
622
- /**
623
- * @since 3.0.6
624
- */
625
- #value;
626
- constructor(value) {
627
- this.#value = value;
628
- }
629
- /**
630
- * @since 3.0.6
631
- */
632
- [YieldWrapTypeId]() {
633
- return this.#value;
634
- }
635
- };
636
- function yieldWrapGet(self) {
637
- if (typeof self === "object" && self !== null && YieldWrapTypeId in self) {
638
- return self[YieldWrapTypeId]();
639
- }
640
- throw new Error(getBugErrorMessage("yieldWrapGet"));
641
- }
642
- var structuralRegionState = /* @__PURE__ */ globalValue("effect/Utils/isStructuralRegion", () => ({
643
- enabled: false,
644
- tester: void 0
645
- }));
646
-
647
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Hash.js
648
- var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => /* @__PURE__ */ new WeakMap());
649
- var symbol = /* @__PURE__ */ Symbol.for("effect/Hash");
650
- var hash = (self) => {
651
- if (structuralRegionState.enabled === true) {
652
- return 0;
653
- }
654
- switch (typeof self) {
655
- case "number":
656
- return number(self);
657
- case "bigint":
658
- return string(self.toString(10));
659
- case "boolean":
660
- return string(String(self));
661
- case "symbol":
662
- return string(String(self));
663
- case "string":
664
- return string(self);
665
- case "undefined":
666
- return string("undefined");
667
- case "function":
668
- case "object": {
669
- if (self === null) {
670
- return string("null");
671
- } else if (self instanceof Date) {
672
- return hash(self.toISOString());
673
- } else if (isHash(self)) {
674
- return self[symbol]();
675
- } else {
676
- return random(self);
677
- }
678
- }
679
- default:
680
- throw new Error(`BUG: unhandled typeof ${typeof self} - please report an issue at https://github.com/Effect-TS/effect/issues`);
681
- }
682
- };
683
- var random = (self) => {
684
- if (!randomHashCache.has(self)) {
685
- randomHashCache.set(self, number(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER)));
686
- }
687
- return randomHashCache.get(self);
688
- };
689
- var combine = (b2) => (self) => self * 53 ^ b2;
690
- var optimize = (n2) => n2 & 3221225471 | n2 >>> 1 & 1073741824;
691
- var isHash = (u2) => hasProperty(u2, symbol);
692
- var number = (n2) => {
693
- if (n2 !== n2 || n2 === Infinity) {
694
- return 0;
695
- }
696
- let h2 = n2 | 0;
697
- if (h2 !== n2) {
698
- h2 ^= n2 * 4294967295;
699
- }
700
- while (n2 > 4294967295) {
701
- h2 ^= n2 /= 4294967295;
702
- }
703
- return optimize(n2);
704
- };
705
- var string = (str) => {
706
- let h2 = 5381, i2 = str.length;
707
- while (i2) {
708
- h2 = h2 * 33 ^ str.charCodeAt(--i2);
709
- }
710
- return optimize(h2);
711
- };
712
- var cached = function() {
713
- if (arguments.length === 1) {
714
- const self2 = arguments[0];
715
- return function(hash3) {
716
- Object.defineProperty(self2, symbol, {
717
- value() {
718
- return hash3;
719
- },
720
- enumerable: false
721
- });
722
- return hash3;
723
- };
724
- }
725
- const self = arguments[0];
726
- const hash2 = arguments[1];
727
- Object.defineProperty(self, symbol, {
728
- value() {
729
- return hash2;
730
- },
731
- enumerable: false
732
- });
733
- return hash2;
734
- };
735
-
736
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Equal.js
737
- var symbol2 = /* @__PURE__ */ Symbol.for("effect/Equal");
738
- function equals() {
739
- if (arguments.length === 1) {
740
- return (self) => compareBoth(self, arguments[0]);
741
- }
742
- return compareBoth(arguments[0], arguments[1]);
743
- }
744
- function compareBoth(self, that) {
745
- if (self === that) {
746
- return true;
747
- }
748
- const selfType = typeof self;
749
- if (selfType !== typeof that) {
750
- return false;
751
- }
752
- if (selfType === "object" || selfType === "function") {
753
- if (self !== null && that !== null) {
754
- if (isEqual(self) && isEqual(that)) {
755
- if (hash(self) === hash(that) && self[symbol2](that)) {
756
- return true;
757
- } else {
758
- return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
759
- }
760
- } else if (self instanceof Date && that instanceof Date) {
761
- return self.toISOString() === that.toISOString();
762
- }
763
- }
764
- if (structuralRegionState.enabled) {
765
- if (Array.isArray(self) && Array.isArray(that)) {
766
- return self.length === that.length && self.every((v2, i2) => compareBoth(v2, that[i2]));
767
- }
768
- if (Object.getPrototypeOf(self) === Object.prototype && Object.getPrototypeOf(self) === Object.prototype) {
769
- const keysSelf = Object.keys(self);
770
- const keysThat = Object.keys(that);
771
- if (keysSelf.length === keysThat.length) {
772
- for (const key of keysSelf) {
773
- if (!(key in that && compareBoth(self[key], that[key]))) {
774
- return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
775
- }
776
- }
777
- return true;
778
- }
779
- }
780
- return structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
781
- }
782
- }
783
- return structuralRegionState.enabled && structuralRegionState.tester ? structuralRegionState.tester(self, that) : false;
784
- }
785
- var isEqual = (u2) => hasProperty(u2, symbol2);
786
- var equivalence = () => equals;
787
-
788
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Inspectable.js
789
- var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
790
- var toJSON = (x2) => {
791
- if (hasProperty(x2, "toJSON") && isFunction2(x2["toJSON"]) && x2["toJSON"].length === 0) {
792
- return x2.toJSON();
793
- } else if (Array.isArray(x2)) {
794
- return x2.map(toJSON);
795
- }
796
- return x2;
797
- };
798
- var format = (x2) => JSON.stringify(x2, null, 2);
799
-
800
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Pipeable.js
801
- var pipeArguments = (self, args) => {
802
- switch (args.length) {
803
- case 1:
804
- return args[0](self);
805
- case 2:
806
- return args[1](args[0](self));
807
- case 3:
808
- return args[2](args[1](args[0](self)));
809
- case 4:
810
- return args[3](args[2](args[1](args[0](self))));
811
- case 5:
812
- return args[4](args[3](args[2](args[1](args[0](self)))));
813
- case 6:
814
- return args[5](args[4](args[3](args[2](args[1](args[0](self))))));
815
- case 7:
816
- return args[6](args[5](args[4](args[3](args[2](args[1](args[0](self)))))));
817
- case 8:
818
- return args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self))))))));
819
- case 9:
820
- return args[8](args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self)))))))));
821
- default: {
822
- let ret = self;
823
- for (let i2 = 0, len = args.length; i2 < len; i2++) {
824
- ret = args[i2](ret);
825
- }
826
- return ret;
827
- }
828
- }
829
- };
830
-
831
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/effectable.js
832
- var EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
833
- var StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
834
- var SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
835
- var ChannelTypeId = /* @__PURE__ */ Symbol.for("effect/Channel");
836
- var effectVariance = {
837
- /* c8 ignore next */
838
- _R: (_2) => _2,
839
- /* c8 ignore next */
840
- _E: (_2) => _2,
841
- /* c8 ignore next */
842
- _A: (_2) => _2,
843
- _V: /* @__PURE__ */ getCurrentVersion()
844
- };
845
- var sinkVariance = {
846
- /* c8 ignore next */
847
- _A: (_2) => _2,
848
- /* c8 ignore next */
849
- _In: (_2) => _2,
850
- /* c8 ignore next */
851
- _L: (_2) => _2,
852
- /* c8 ignore next */
853
- _E: (_2) => _2,
854
- /* c8 ignore next */
855
- _R: (_2) => _2
856
- };
857
- var channelVariance = {
858
- /* c8 ignore next */
859
- _Env: (_2) => _2,
860
- /* c8 ignore next */
861
- _InErr: (_2) => _2,
862
- /* c8 ignore next */
863
- _InElem: (_2) => _2,
864
- /* c8 ignore next */
865
- _InDone: (_2) => _2,
866
- /* c8 ignore next */
867
- _OutErr: (_2) => _2,
868
- /* c8 ignore next */
869
- _OutElem: (_2) => _2,
870
- /* c8 ignore next */
871
- _OutDone: (_2) => _2
872
- };
873
- var EffectPrototype = {
874
- [EffectTypeId]: effectVariance,
875
- [StreamTypeId]: effectVariance,
876
- [SinkTypeId]: sinkVariance,
877
- [ChannelTypeId]: channelVariance,
878
- [symbol2](that) {
879
- return this === that;
880
- },
881
- [symbol]() {
882
- return cached(this, random(this));
883
- },
884
- [Symbol.iterator]() {
885
- return new SingleShotGen(new YieldWrap(this));
886
- },
887
- pipe() {
888
- return pipeArguments(this, arguments);
889
- }
890
- };
891
-
892
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/option.js
893
- var TypeId = /* @__PURE__ */ Symbol.for("effect/Option");
894
- var CommonProto = {
895
- ...EffectPrototype,
896
- [TypeId]: {
897
- _A: (_2) => _2
898
- },
899
- [NodeInspectSymbol]() {
900
- return this.toJSON();
901
- },
902
- toString() {
903
- return format(this.toJSON());
904
- }
905
- };
906
- var SomeProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto), {
907
- _tag: "Some",
908
- _op: "Some",
909
- [symbol2](that) {
910
- return isOption(that) && isSome(that) && equals(this.value, that.value);
911
- },
912
- [symbol]() {
913
- return cached(this, combine(hash(this._tag))(hash(this.value)));
914
- },
915
- toJSON() {
916
- return {
917
- _id: "Option",
918
- _tag: this._tag,
919
- value: toJSON(this.value)
920
- };
921
- }
922
- });
923
- var NoneHash = /* @__PURE__ */ hash("None");
924
- var NoneProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto), {
925
- _tag: "None",
926
- _op: "None",
927
- [symbol2](that) {
928
- return isOption(that) && isNone(that);
929
- },
930
- [symbol]() {
931
- return NoneHash;
932
- },
933
- toJSON() {
934
- return {
935
- _id: "Option",
936
- _tag: this._tag
937
- };
938
- }
939
- });
940
- var isOption = (input) => hasProperty(input, TypeId);
941
- var isNone = (fa) => fa._tag === "None";
942
- var isSome = (fa) => fa._tag === "Some";
943
- var none = /* @__PURE__ */ Object.create(NoneProto);
944
- var some2 = (value) => {
945
- const a2 = Object.create(SomeProto);
946
- a2.value = value;
947
- return a2;
948
- };
949
-
950
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/either.js
951
- var TypeId2 = /* @__PURE__ */ Symbol.for("effect/Either");
952
- var CommonProto2 = {
953
- ...EffectPrototype,
954
- [TypeId2]: {
955
- _R: (_2) => _2
956
- },
957
- [NodeInspectSymbol]() {
958
- return this.toJSON();
959
- },
960
- toString() {
961
- return format(this.toJSON());
962
- }
963
- };
964
- var RightProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
965
- _tag: "Right",
966
- _op: "Right",
967
- [symbol2](that) {
968
- return isEither(that) && isRight(that) && equals(this.right, that.right);
969
- },
970
- [symbol]() {
971
- return combine(hash(this._tag))(hash(this.right));
972
- },
973
- toJSON() {
974
- return {
975
- _id: "Either",
976
- _tag: this._tag,
977
- right: toJSON(this.right)
978
- };
979
- }
980
- });
981
- var LeftProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
982
- _tag: "Left",
983
- _op: "Left",
984
- [symbol2](that) {
985
- return isEither(that) && isLeft(that) && equals(this.left, that.left);
986
- },
987
- [symbol]() {
988
- return combine(hash(this._tag))(hash(this.left));
989
- },
990
- toJSON() {
991
- return {
992
- _id: "Either",
993
- _tag: this._tag,
994
- left: toJSON(this.left)
995
- };
996
- }
997
- });
998
- var isEither = (input) => hasProperty(input, TypeId2);
999
- var isLeft = (ma) => ma._tag === "Left";
1000
- var isRight = (ma) => ma._tag === "Right";
1001
- var left = (left2) => {
1002
- const a2 = Object.create(LeftProto);
1003
- a2.left = left2;
1004
- return a2;
1005
- };
1006
- var right = (right2) => {
1007
- const a2 = Object.create(RightProto);
1008
- a2.right = right2;
1009
- return a2;
1010
- };
1011
- var getLeft = (self) => isRight(self) ? none : some2(self.left);
1012
- var getRight = (self) => isLeft(self) ? none : some2(self.right);
1013
-
1014
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Either.js
1015
- var isLeft2 = isLeft;
1016
- var isRight2 = isRight;
1017
-
1018
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/internal/array.js
1019
- var isNonEmptyArray = (self) => self.length > 0;
1020
-
1021
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Option.js
1022
- var Option_exports = {};
1023
- __export(Option_exports, {
1024
- Do: () => Do,
1025
- TypeId: () => TypeId3,
1026
- all: () => all2,
1027
- andThen: () => andThen,
1028
- ap: () => ap,
1029
- as: () => as,
1030
- asVoid: () => asVoid,
1031
- bind: () => bind2,
1032
- bindTo: () => bindTo2,
1033
- composeK: () => composeK,
1034
- contains: () => contains,
1035
- containsWith: () => containsWith,
1036
- exists: () => exists,
1037
- filter: () => filter,
1038
- filterMap: () => filterMap,
1039
- firstSomeOf: () => firstSomeOf,
1040
- flatMap: () => flatMap,
1041
- flatMapNullable: () => flatMapNullable,
1042
- flatten: () => flatten,
1043
- fromIterable: () => fromIterable,
1044
- fromNullable: () => fromNullable,
1045
- gen: () => gen,
1046
- getEquivalence: () => getEquivalence,
1047
- getLeft: () => getLeft2,
1048
- getOrElse: () => getOrElse,
1049
- getOrNull: () => getOrNull,
1050
- getOrThrow: () => getOrThrow,
1051
- getOrThrowWith: () => getOrThrowWith,
1052
- getOrUndefined: () => getOrUndefined,
1053
- getOrder: () => getOrder,
1054
- getRight: () => getRight2,
1055
- isNone: () => isNone2,
1056
- isOption: () => isOption2,
1057
- isSome: () => isSome2,
1058
- let: () => let_2,
1059
- lift2: () => lift2,
1060
- liftNullable: () => liftNullable,
1061
- liftPredicate: () => liftPredicate,
1062
- liftThrowable: () => liftThrowable,
1063
- map: () => map,
1064
- match: () => match,
1065
- none: () => none2,
1066
- orElse: () => orElse,
1067
- orElseEither: () => orElseEither,
1068
- orElseSome: () => orElseSome,
1069
- partitionMap: () => partitionMap,
1070
- product: () => product2,
1071
- productMany: () => productMany2,
1072
- reduceCompact: () => reduceCompact,
1073
- some: () => some3,
1074
- tap: () => tap,
1075
- toArray: () => toArray,
1076
- toRefinement: () => toRefinement,
1077
- void: () => void_,
1078
- zipLeft: () => zipLeft,
1079
- zipRight: () => zipRight,
1080
- zipWith: () => zipWith
1081
- });
1082
-
1083
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Order.js
1084
- var make2 = (compare) => (self, that) => self === that ? 0 : compare(self, that);
1085
- var number2 = /* @__PURE__ */ make2((self, that) => self < that ? -1 : 1);
1086
- var combineMany = /* @__PURE__ */ dual(2, (self, collection) => make2((a1, a2) => {
1087
- let out = self(a1, a2);
1088
- if (out !== 0) {
1089
- return out;
1090
- }
1091
- for (const O2 of collection) {
1092
- out = O2(a1, a2);
1093
- if (out !== 0) {
1094
- return out;
1095
- }
1096
- }
1097
- return out;
1098
- }));
1099
- var empty = () => make2(() => 0);
1100
- var combineAll = (collection) => combineMany(empty(), collection);
1101
- var mapInput2 = /* @__PURE__ */ dual(2, (self, f2) => make2((b1, b2) => self(f2(b1), f2(b2))));
1102
- var array2 = (O2) => make2((self, that) => {
1103
- const aLen = self.length;
1104
- const bLen = that.length;
1105
- const len = Math.min(aLen, bLen);
1106
- for (let i2 = 0; i2 < len; i2++) {
1107
- const o2 = O2(self[i2], that[i2]);
1108
- if (o2 !== 0) {
1109
- return o2;
1110
- }
1111
- }
1112
- return number2(aLen, bLen);
1113
- });
1114
- var min = (O2) => dual(2, (self, that) => self === that || O2(self, that) < 1 ? self : that);
1115
- var max = (O2) => dual(2, (self, that) => self === that || O2(self, that) > -1 ? self : that);
1116
-
1117
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Option.js
1118
- var TypeId3 = /* @__PURE__ */ Symbol.for("effect/Option");
1119
- var none2 = () => none;
1120
- var some3 = some2;
1121
- var isOption2 = isOption;
1122
- var isNone2 = isNone;
1123
- var isSome2 = isSome;
1124
- var match = /* @__PURE__ */ dual(2, (self, {
1125
- onNone,
1126
- onSome
1127
- }) => isNone2(self) ? onNone() : onSome(self.value));
1128
- var toRefinement = (f2) => (a2) => isSome2(f2(a2));
1129
- var fromIterable = (collection) => {
1130
- for (const a2 of collection) {
1131
- return some3(a2);
1132
- }
1133
- return none2();
1134
- };
1135
- var getRight2 = getRight;
1136
- var getLeft2 = getLeft;
1137
- var getOrElse = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? onNone() : self.value);
1138
- var orElse = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? that() : self);
1139
- var orElseSome = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? some3(onNone()) : self);
1140
- var orElseEither = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? map(that(), right) : map(self, left));
1141
- var firstSomeOf = (collection) => {
1142
- let out = none2();
1143
- for (out of collection) {
1144
- if (isSome2(out)) {
1145
- return out;
1146
- }
1147
- }
1148
- return out;
1149
- };
1150
- var fromNullable = (nullableValue) => nullableValue == null ? none2() : some3(nullableValue);
1151
- var liftNullable = (f2) => (...a2) => fromNullable(f2(...a2));
1152
- var getOrNull = /* @__PURE__ */ getOrElse(constNull);
1153
- var getOrUndefined = /* @__PURE__ */ getOrElse(constUndefined);
1154
- var liftThrowable = (f2) => (...a2) => {
1155
- try {
1156
- return some3(f2(...a2));
1157
- } catch (e2) {
1158
- return none2();
1159
- }
1160
- };
1161
- var getOrThrowWith = /* @__PURE__ */ dual(2, (self, onNone) => {
1162
- if (isSome2(self)) {
1163
- return self.value;
1164
- }
1165
- throw onNone();
1166
- });
1167
- var getOrThrow = /* @__PURE__ */ getOrThrowWith(() => new Error("getOrThrow called on a None"));
1168
- var map = /* @__PURE__ */ dual(2, (self, f2) => isNone2(self) ? none2() : some3(f2(self.value)));
1169
- var as = /* @__PURE__ */ dual(2, (self, b2) => map(self, () => b2));
1170
- var asVoid = /* @__PURE__ */ as(void 0);
1171
- var void_ = /* @__PURE__ */ some3(void 0);
1172
- var flatMap = /* @__PURE__ */ dual(2, (self, f2) => isNone2(self) ? none2() : f2(self.value));
1173
- var andThen = /* @__PURE__ */ dual(2, (self, f2) => flatMap(self, (a2) => {
1174
- const b2 = isFunction(f2) ? f2(a2) : f2;
1175
- return isOption2(b2) ? b2 : some3(b2);
1176
- }));
1177
- var flatMapNullable = /* @__PURE__ */ dual(2, (self, f2) => isNone2(self) ? none2() : fromNullable(f2(self.value)));
1178
- var flatten = /* @__PURE__ */ flatMap(identity);
1179
- var zipRight = /* @__PURE__ */ dual(2, (self, that) => flatMap(self, () => that));
1180
- var composeK = /* @__PURE__ */ dual(2, (afb, bfc) => (a2) => flatMap(afb(a2), bfc));
1181
- var zipLeft = /* @__PURE__ */ dual(2, (self, that) => tap(self, () => that));
1182
- var tap = /* @__PURE__ */ dual(2, (self, f2) => flatMap(self, (a2) => map(f2(a2), () => a2)));
1183
- var product2 = (self, that) => isSome2(self) && isSome2(that) ? some3([self.value, that.value]) : none2();
1184
- var productMany2 = (self, collection) => {
1185
- if (isNone2(self)) {
1186
- return none2();
1187
- }
1188
- const out = [self.value];
1189
- for (const o2 of collection) {
1190
- if (isNone2(o2)) {
1191
- return none2();
1192
- }
1193
- out.push(o2.value);
1194
- }
1195
- return some3(out);
1196
- };
1197
- var all2 = (input) => {
1198
- if (Symbol.iterator in input) {
1199
- const out2 = [];
1200
- for (const o2 of input) {
1201
- if (isNone2(o2)) {
1202
- return none2();
1203
- }
1204
- out2.push(o2.value);
1205
- }
1206
- return some3(out2);
1207
- }
1208
- const out = {};
1209
- for (const key of Object.keys(input)) {
1210
- const o2 = input[key];
1211
- if (isNone2(o2)) {
1212
- return none2();
1213
- }
1214
- out[key] = o2.value;
1215
- }
1216
- return some3(out);
1217
- };
1218
- var zipWith = /* @__PURE__ */ dual(3, (self, that, f2) => map(product2(self, that), ([a2, b2]) => f2(a2, b2)));
1219
- var ap = /* @__PURE__ */ dual(2, (self, that) => zipWith(self, that, (f2, a2) => f2(a2)));
1220
- var reduceCompact = /* @__PURE__ */ dual(3, (self, b2, f2) => {
1221
- let out = b2;
1222
- for (const oa of self) {
1223
- if (isSome2(oa)) {
1224
- out = f2(out, oa.value);
1225
- }
1226
- }
1227
- return out;
1228
- });
1229
- var toArray = (self) => isNone2(self) ? [] : [self.value];
1230
- var partitionMap = /* @__PURE__ */ dual(2, (self, f2) => {
1231
- if (isNone2(self)) {
1232
- return [none2(), none2()];
1233
- }
1234
- const e2 = f2(self.value);
1235
- return isLeft(e2) ? [some3(e2.left), none2()] : [none2(), some3(e2.right)];
1236
- });
1237
- var filterMap = /* @__PURE__ */ dual(2, (self, f2) => isNone2(self) ? none2() : f2(self.value));
1238
- var filter = /* @__PURE__ */ dual(2, (self, predicate) => filterMap(self, (b2) => predicate(b2) ? some2(b2) : none));
1239
- var getEquivalence = (isEquivalent) => make((x2, y2) => isNone2(x2) ? isNone2(y2) : isNone2(y2) ? false : isEquivalent(x2.value, y2.value));
1240
- var getOrder = (O2) => make2((self, that) => isSome2(self) ? isSome2(that) ? O2(self.value, that.value) : 1 : -1);
1241
- var lift2 = (f2) => dual(2, (self, that) => zipWith(self, that, f2));
1242
- var liftPredicate = /* @__PURE__ */ dual(2, (b2, predicate) => predicate(b2) ? some3(b2) : none2());
1243
- var containsWith = (isEquivalent) => dual(2, (self, a2) => isNone2(self) ? false : isEquivalent(self.value, a2));
1244
- var _equivalence = /* @__PURE__ */ equivalence();
1245
- var contains = /* @__PURE__ */ containsWith(_equivalence);
1246
- var exists = /* @__PURE__ */ dual(2, (self, refinement) => isNone2(self) ? false : refinement(self.value));
1247
- var bindTo2 = /* @__PURE__ */ bindTo(map);
1248
- var let_2 = /* @__PURE__ */ let_(map);
1249
- var bind2 = /* @__PURE__ */ bind(map, flatMap);
1250
- var Do = /* @__PURE__ */ some3({});
1251
- var adapter2 = /* @__PURE__ */ adapter();
1252
- var gen = (...args) => {
1253
- let f2;
1254
- if (args.length === 1) {
1255
- f2 = args[0];
1256
- } else {
1257
- f2 = args[1].bind(args[0]);
1258
- }
1259
- const iterator = f2(adapter2);
1260
- let state = iterator.next();
1261
- if (state.done) {
1262
- return some3(state.value);
1263
- } else {
1264
- let current = state.value;
1265
- if (isGenKind(current)) {
1266
- current = current.value;
1267
- } else {
1268
- current = yieldWrapGet(current);
1269
- }
1270
- if (isNone2(current)) {
1271
- return current;
1272
- }
1273
- while (!state.done) {
1274
- state = iterator.next(current.value);
1275
- if (!state.done) {
1276
- current = state.value;
1277
- if (isGenKind(current)) {
1278
- current = current.value;
1279
- } else {
1280
- current = yieldWrapGet(current);
1281
- }
1282
- if (isNone2(current)) {
1283
- return current;
1284
- }
1285
- }
1286
- }
1287
- return some3(state.value);
1288
- }
1289
- };
1290
-
1291
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Tuple.js
1292
- var make3 = (...elements) => elements;
1293
-
1294
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Iterable.js
1295
- var findFirst = /* @__PURE__ */ dual(2, (self, f2) => {
1296
- let i2 = 0;
1297
- for (const a2 of self) {
1298
- const o2 = f2(a2, i2);
1299
- if (isBoolean(o2)) {
1300
- if (o2) {
1301
- return some3(a2);
1302
- }
1303
- } else {
1304
- if (isSome2(o2)) {
1305
- return o2;
1306
- }
1307
- }
1308
- i2++;
1309
- }
1310
- return none2();
1311
- });
1312
-
1313
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Record.js
1314
- var collect = /* @__PURE__ */ dual(2, (self, f2) => {
1315
- const out = [];
1316
- for (const key of keys(self)) {
1317
- out.push(f2(key, self[key]));
1318
- }
1319
- return out;
1320
- });
1321
- var toEntries = /* @__PURE__ */ collect((key, value) => [key, value]);
1322
- var keys = (self) => Object.keys(self);
1323
-
1324
- // ../../../node_modules/.pnpm/effect@3.4.6/node_modules/effect/dist/esm/Array.js
1325
- var make4 = (...elements) => elements;
1326
- var allocate = (n2) => new Array(n2);
1327
- var makeBy = (n2, f2) => {
1328
- const max3 = Math.max(1, Math.floor(n2));
1329
- const out = new Array(max3);
1330
- for (let i2 = 0; i2 < max3; i2++) {
1331
- out[i2] = f2(i2);
1332
- }
1333
- return out;
1334
- };
1335
- var range = (start, end) => start <= end ? makeBy(end - start + 1, (i2) => start + i2) : [start];
1336
- var replicate = /* @__PURE__ */ dual(2, (a2, n2) => makeBy(n2, () => a2));
1337
- var fromIterable2 = (collection) => Array.isArray(collection) ? collection : Array.from(collection);
1338
- var ensure = (self) => Array.isArray(self) ? self : [self];
1339
- var fromRecord = toEntries;
1340
- var fromOption2 = toArray;
1341
- var match2 = /* @__PURE__ */ dual(2, (self, {
1342
- onEmpty,
1343
- onNonEmpty
1344
- }) => isNonEmptyReadonlyArray(self) ? onNonEmpty(self) : onEmpty());
1345
- var matchLeft = /* @__PURE__ */ dual(2, (self, {
1346
- onEmpty,
1347
- onNonEmpty
1348
- }) => isNonEmptyReadonlyArray(self) ? onNonEmpty(headNonEmpty(self), tailNonEmpty(self)) : onEmpty());
1349
- var matchRight = /* @__PURE__ */ dual(2, (self, {
1350
- onEmpty,
1351
- onNonEmpty
1352
- }) => isNonEmptyReadonlyArray(self) ? onNonEmpty(initNonEmpty(self), lastNonEmpty(self)) : onEmpty());
1353
- var prepend = /* @__PURE__ */ dual(2, (self, head2) => [head2, ...self]);
1354
- var prependAll = /* @__PURE__ */ dual(2, (self, that) => fromIterable2(that).concat(fromIterable2(self)));
1355
- var append = /* @__PURE__ */ dual(2, (self, last2) => [...self, last2]);
1356
- var appendAll = /* @__PURE__ */ dual(2, (self, that) => fromIterable2(self).concat(fromIterable2(that)));
1357
- var scan = /* @__PURE__ */ dual(3, (self, b2, f2) => {
1358
- const out = [b2];
1359
- let i2 = 0;
1360
- for (const a2 of self) {
1361
- out[i2 + 1] = f2(out[i2], a2);
1362
- i2++;
1363
- }
1364
- return out;
1365
- });
1366
- var scanRight = /* @__PURE__ */ dual(3, (self, b2, f2) => {
1367
- const input = fromIterable2(self);
1368
- const out = new Array(input.length + 1);
1369
- out[input.length] = b2;
1370
- for (let i2 = input.length - 1; i2 >= 0; i2--) {
1371
- out[i2] = f2(out[i2 + 1], input[i2]);
1372
- }
1373
- return out;
1374
- });
1375
- var isArray = Array.isArray;
1376
- var isEmptyArray = (self) => self.length === 0;
1377
- var isEmptyReadonlyArray = isEmptyArray;
1378
- var isNonEmptyArray2 = isNonEmptyArray;
1379
- var isNonEmptyReadonlyArray = isNonEmptyArray;
1380
- var length = (self) => self.length;
1381
- var isOutOfBound = (i2, as2) => i2 < 0 || i2 >= as2.length;
1382
- var clamp = (i2, as2) => Math.floor(Math.min(Math.max(0, i2), as2.length));
1383
- var get = /* @__PURE__ */ dual(2, (self, index) => {
1384
- const i2 = Math.floor(index);
1385
- return isOutOfBound(i2, self) ? none2() : some3(self[i2]);
1386
- });
1387
- var unsafeGet = /* @__PURE__ */ dual(2, (self, index) => {
1388
- const i2 = Math.floor(index);
1389
- if (isOutOfBound(i2, self)) {
1390
- throw new Error(`Index ${i2} out of bounds`);
1391
- }
1392
- return self[i2];
1393
- });
1394
- var unprepend = (self) => [headNonEmpty(self), tailNonEmpty(self)];
1395
- var unappend = (self) => [initNonEmpty(self), lastNonEmpty(self)];
1396
- var head = /* @__PURE__ */ get(0);
1397
- var headNonEmpty = /* @__PURE__ */ unsafeGet(0);
1398
- var last = (self) => isNonEmptyReadonlyArray(self) ? some3(lastNonEmpty(self)) : none2();
1399
- var lastNonEmpty = (self) => self[self.length - 1];
1400
- var tail = (self) => {
1401
- const input = fromIterable2(self);
1402
- return isNonEmptyReadonlyArray(input) ? some3(tailNonEmpty(input)) : none2();
1403
- };
1404
- var tailNonEmpty = (self) => self.slice(1);
1405
- var init = (self) => {
1406
- const input = fromIterable2(self);
1407
- return isNonEmptyReadonlyArray(input) ? some3(initNonEmpty(input)) : none2();
1408
- };
1409
- var initNonEmpty = (self) => self.slice(0, -1);
1410
- var take = /* @__PURE__ */ dual(2, (self, n2) => {
1411
- const input = fromIterable2(self);
1412
- return input.slice(0, clamp(n2, input));
1413
- });
1414
- var takeRight = /* @__PURE__ */ dual(2, (self, n2) => {
1415
- const input = fromIterable2(self);
1416
- const i2 = clamp(n2, input);
1417
- return i2 === 0 ? [] : input.slice(-i2);
1418
- });
1419
- var takeWhile = /* @__PURE__ */ dual(2, (self, predicate) => {
1420
- let i2 = 0;
1421
- const out = [];
1422
- for (const a2 of self) {
1423
- if (!predicate(a2, i2)) {
1424
- break;
1425
- }
1426
- out.push(a2);
1427
- i2++;
1428
- }
1429
- return out;
1430
- });
1431
- var spanIndex = (self, predicate) => {
1432
- let i2 = 0;
1433
- for (const a2 of self) {
1434
- if (!predicate(a2, i2)) {
1435
- break;
1436
- }
1437
- i2++;
1438
- }
1439
- return i2;
1440
- };
1441
- var span = /* @__PURE__ */ dual(2, (self, predicate) => splitAt(self, spanIndex(self, predicate)));
1442
- var drop = /* @__PURE__ */ dual(2, (self, n2) => {
1443
- const input = fromIterable2(self);
1444
- return input.slice(clamp(n2, input), input.length);
1445
- });
1446
- var dropRight = /* @__PURE__ */ dual(2, (self, n2) => {
1447
- const input = fromIterable2(self);
1448
- return input.slice(0, input.length - clamp(n2, input));
1449
- });
1450
- var dropWhile = /* @__PURE__ */ dual(2, (self, predicate) => fromIterable2(self).slice(spanIndex(self, predicate)));
1451
- var findFirstIndex = /* @__PURE__ */ dual(2, (self, predicate) => {
1452
- let i2 = 0;
1453
- for (const a2 of self) {
1454
- if (predicate(a2, i2)) {
1455
- return some3(i2);
1456
- }
1457
- i2++;
1458
- }
1459
- return none2();
1460
- });
1461
- var findLastIndex = /* @__PURE__ */ dual(2, (self, predicate) => {
1462
- const input = fromIterable2(self);
1463
- for (let i2 = input.length - 1; i2 >= 0; i2--) {
1464
- if (predicate(input[i2], i2)) {
1465
- return some3(i2);
1466
- }
1467
- }
1468
- return none2();
1469
- });
1470
- var findFirst2 = findFirst;
1471
- var findLast = /* @__PURE__ */ dual(2, (self, f2) => {
1472
- const input = fromIterable2(self);
1473
- for (let i2 = input.length - 1; i2 >= 0; i2--) {
1474
- const a2 = input[i2];
1475
- const o2 = f2(a2, i2);
1476
- if (isBoolean(o2)) {
1477
- if (o2) {
1478
- return some3(a2);
1479
- }
1480
- } else {
1481
- if (isSome2(o2)) {
1482
- return o2;
1483
- }
1484
- }
1485
- }
1486
- return none2();
1487
- });
1488
- var insertAt = /* @__PURE__ */ dual(3, (self, i2, b2) => {
1489
- const out = Array.from(self);
1490
- if (i2 < 0 || i2 > out.length) {
1491
- return none2();
1492
- }
1493
- out.splice(i2, 0, b2);
1494
- return some3(out);
1495
- });
1496
- var replace = /* @__PURE__ */ dual(3, (self, i2, b2) => modify(self, i2, () => b2));
1497
- var replaceOption = /* @__PURE__ */ dual(3, (self, i2, b2) => modifyOption(self, i2, () => b2));
1498
- var modify = /* @__PURE__ */ dual(3, (self, i2, f2) => getOrElse(modifyOption(self, i2, f2), () => Array.from(self)));
1499
- var modifyOption = /* @__PURE__ */ dual(3, (self, i2, f2) => {
1500
- const out = Array.from(self);
1501
- if (isOutOfBound(i2, out)) {
1502
- return none2();
1503
- }
1504
- const next = f2(out[i2]);
1505
- out[i2] = next;
1506
- return some3(out);
1507
- });
1508
- var remove = /* @__PURE__ */ dual(2, (self, i2) => {
1509
- const out = Array.from(self);
1510
- if (isOutOfBound(i2, out)) {
1511
- return out;
1512
- }
1513
- out.splice(i2, 1);
1514
- return out;
1515
- });
1516
- var reverse = (self) => Array.from(self).reverse();
1517
- var sort = /* @__PURE__ */ dual(2, (self, O2) => {
1518
- const out = Array.from(self);
1519
- out.sort(O2);
1520
- return out;
1521
- });
1522
- var sortWith = /* @__PURE__ */ dual(3, (self, f2, order) => sort(self, mapInput2(order, f2)));
1523
- var sortBy = (...orders) => {
1524
- const sortByAll = sort(combineAll(orders));
1525
- return (self) => {
1526
- const input = fromIterable2(self);
1527
- if (isNonEmptyReadonlyArray(input)) {
1528
- return sortByAll(input);
1529
- }
1530
- return [];
1531
- };
1532
- };
1533
- var zip = /* @__PURE__ */ dual(2, (self, that) => zipWith2(self, that, make3));
1534
- var zipWith2 = /* @__PURE__ */ dual(3, (self, that, f2) => {
1535
- const as2 = fromIterable2(self);
1536
- const bs = fromIterable2(that);
1537
- if (isNonEmptyReadonlyArray(as2) && isNonEmptyReadonlyArray(bs)) {
1538
- const out = [f2(headNonEmpty(as2), headNonEmpty(bs))];
1539
- const len = Math.min(as2.length, bs.length);
1540
- for (let i2 = 1; i2 < len; i2++) {
1541
- out[i2] = f2(as2[i2], bs[i2]);
1542
- }
1543
- return out;
1544
- }
1545
- return [];
1546
- });
1547
- var unzip = (self) => {
1548
- const input = fromIterable2(self);
1549
- if (isNonEmptyReadonlyArray(input)) {
1550
- const fa = [input[0][0]];
1551
- const fb = [input[0][1]];
1552
- for (let i2 = 1; i2 < input.length; i2++) {
1553
- fa[i2] = input[i2][0];
1554
- fb[i2] = input[i2][1];
1555
- }
1556
- return [fa, fb];
1557
- }
1558
- return [[], []];
1559
- };
1560
- var intersperse = /* @__PURE__ */ dual(2, (self, middle) => {
1561
- const input = fromIterable2(self);
1562
- if (isNonEmptyReadonlyArray(input)) {
1563
- const out = [headNonEmpty(input)];
1564
- const tail2 = tailNonEmpty(input);
1565
- for (let i2 = 0; i2 < tail2.length; i2++) {
1566
- if (i2 < tail2.length) {
1567
- out.push(middle);
1568
- }
1569
- out.push(tail2[i2]);
1570
- }
1571
- return out;
1572
- }
1573
- return [];
1574
- });
1575
- var modifyNonEmptyHead = /* @__PURE__ */ dual(2, (self, f2) => [f2(headNonEmpty(self)), ...tailNonEmpty(self)]);
1576
- var setNonEmptyHead = /* @__PURE__ */ dual(2, (self, b2) => modifyNonEmptyHead(self, () => b2));
1577
- var modifyNonEmptyLast = /* @__PURE__ */ dual(2, (self, f2) => append(initNonEmpty(self), f2(lastNonEmpty(self))));
1578
- var setNonEmptyLast = /* @__PURE__ */ dual(2, (self, b2) => modifyNonEmptyLast(self, () => b2));
1579
- var rotate = /* @__PURE__ */ dual(2, (self, n2) => {
1580
- const input = fromIterable2(self);
1581
- if (isNonEmptyReadonlyArray(input)) {
1582
- const len = input.length;
1583
- const m2 = Math.round(n2) % len;
1584
- if (isOutOfBound(Math.abs(m2), input) || m2 === 0) {
1585
- return copy(input);
1586
- }
1587
- if (m2 < 0) {
1588
- const [f2, s2] = splitNonEmptyAt(input, -m2);
1589
- return appendAll(s2, f2);
1590
- } else {
1591
- return rotate(self, m2 - len);
1592
- }
1593
- }
1594
- return [];
1595
- });
1596
- var containsWith2 = (isEquivalent) => dual(2, (self, a2) => {
1597
- for (const i2 of self) {
1598
- if (isEquivalent(a2, i2)) {
1599
- return true;
1600
- }
1601
- }
1602
- return false;
1603
- });
1604
- var _equivalence2 = /* @__PURE__ */ equivalence();
1605
- var contains2 = /* @__PURE__ */ containsWith2(_equivalence2);
1606
- var chop = /* @__PURE__ */ dual(2, (self, f2) => {
1607
- const input = fromIterable2(self);
1608
- if (isNonEmptyReadonlyArray(input)) {
1609
- const [b2, rest] = f2(input);
1610
- const out = [b2];
1611
- let next = rest;
1612
- while (isNonEmptyArray(next)) {
1613
- const [b3, rest2] = f2(next);
1614
- out.push(b3);
1615
- next = rest2;
1616
- }
1617
- return out;
1618
- }
1619
- return [];
1620
- });
1621
- var splitAt = /* @__PURE__ */ dual(2, (self, n2) => {
1622
- const input = Array.from(self);
1623
- const _n = Math.floor(n2);
1624
- if (isNonEmptyReadonlyArray(input)) {
1625
- if (_n >= 1) {
1626
- return splitNonEmptyAt(input, _n);
1627
- }
1628
- return [[], input];
1629
- }
1630
- return [input, []];
1631
- });
1632
- var splitNonEmptyAt = /* @__PURE__ */ dual(2, (self, n2) => {
1633
- const _n = Math.max(1, Math.floor(n2));
1634
- return _n >= self.length ? [copy(self), []] : [prepend(self.slice(1, _n), headNonEmpty(self)), self.slice(_n)];
1635
- });
1636
- var split = /* @__PURE__ */ dual(2, (self, n2) => {
1637
- const input = fromIterable2(self);
1638
- return chunksOf(input, Math.ceil(input.length / Math.floor(n2)));
1639
- });
1640
- var splitWhere = /* @__PURE__ */ dual(2, (self, predicate) => span(self, (a2, i2) => !predicate(a2, i2)));
1641
- var copy = (self) => self.slice();
1642
- var chunksOf = /* @__PURE__ */ dual(2, (self, n2) => {
1643
- const input = fromIterable2(self);
1644
- if (isNonEmptyReadonlyArray(input)) {
1645
- return chop(input, splitNonEmptyAt(n2));
1646
- }
1647
- return [];
1648
- });
1649
- var groupWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => chop(self, (as2) => {
1650
- const h2 = headNonEmpty(as2);
1651
- const out = [h2];
1652
- let i2 = 1;
1653
- for (; i2 < as2.length; i2++) {
1654
- const a2 = as2[i2];
1655
- if (isEquivalent(a2, h2)) {
1656
- out.push(a2);
1657
- } else {
1658
- break;
1659
- }
1660
- }
1661
- return [out, as2.slice(i2)];
1662
- }));
1663
- var group = /* @__PURE__ */ groupWith(/* @__PURE__ */ equivalence());
1664
- var groupBy = /* @__PURE__ */ dual(2, (self, f2) => {
1665
- const out = {};
1666
- for (const a2 of self) {
1667
- const k2 = f2(a2);
1668
- if (Object.prototype.hasOwnProperty.call(out, k2)) {
1669
- out[k2].push(a2);
1670
- } else {
1671
- out[k2] = [a2];
1672
- }
1673
- }
1674
- return out;
1675
- });
1676
- var unionWith = /* @__PURE__ */ dual(3, (self, that, isEquivalent) => {
1677
- const a2 = fromIterable2(self);
1678
- const b2 = fromIterable2(that);
1679
- if (isNonEmptyReadonlyArray(a2)) {
1680
- if (isNonEmptyReadonlyArray(b2)) {
1681
- const dedupe2 = dedupeWith(isEquivalent);
1682
- return dedupe2(appendAll(a2, b2));
1683
- }
1684
- return a2;
1685
- }
1686
- return b2;
1687
- });
1688
- var union = /* @__PURE__ */ dual(2, (self, that) => unionWith(self, that, _equivalence2));
1689
- var intersectionWith = (isEquivalent) => {
1690
- const has = containsWith2(isEquivalent);
1691
- return dual(2, (self, that) => fromIterable2(self).filter((a2) => has(that, a2)));
1692
- };
1693
- var intersection = /* @__PURE__ */ intersectionWith(_equivalence2);
1694
- var differenceWith = (isEquivalent) => {
1695
- const has = containsWith2(isEquivalent);
1696
- return dual(2, (self, that) => fromIterable2(self).filter((a2) => !has(that, a2)));
1697
- };
1698
- var difference = /* @__PURE__ */ differenceWith(_equivalence2);
1699
- var empty2 = () => [];
1700
- var of = (a2) => [a2];
1701
- var map2 = /* @__PURE__ */ dual(2, (self, f2) => self.map(f2));
1702
- var flatMap2 = /* @__PURE__ */ dual(2, (self, f2) => {
1703
- if (isEmptyReadonlyArray(self)) {
1704
- return [];
1705
- }
1706
- const out = [];
1707
- for (let i2 = 0; i2 < self.length; i2++) {
1708
- const inner = f2(self[i2], i2);
1709
- for (let j2 = 0; j2 < inner.length; j2++) {
1710
- out.push(inner[j2]);
1711
- }
1712
- }
1713
- return out;
1714
- });
1715
- var flatten2 = /* @__PURE__ */ flatMap2(identity);
1716
- var filterMap2 = /* @__PURE__ */ dual(2, (self, f2) => {
1717
- const as2 = fromIterable2(self);
1718
- const out = [];
1719
- for (let i2 = 0; i2 < as2.length; i2++) {
1720
- const o2 = f2(as2[i2], i2);
1721
- if (isSome2(o2)) {
1722
- out.push(o2.value);
1723
- }
1724
- }
1725
- return out;
1726
- });
1727
- var filterMapWhile = /* @__PURE__ */ dual(2, (self, f2) => {
1728
- let i2 = 0;
1729
- const out = [];
1730
- for (const a2 of self) {
1731
- const b2 = f2(a2, i2);
1732
- if (isSome2(b2)) {
1733
- out.push(b2.value);
1734
- } else {
1735
- break;
1736
- }
1737
- i2++;
1738
- }
1739
- return out;
1740
- });
1741
- var partitionMap2 = /* @__PURE__ */ dual(2, (self, f2) => {
1742
- const left2 = [];
1743
- const right2 = [];
1744
- const as2 = fromIterable2(self);
1745
- for (let i2 = 0; i2 < as2.length; i2++) {
1746
- const e2 = f2(as2[i2], i2);
1747
- if (isLeft2(e2)) {
1748
- left2.push(e2.left);
1749
- } else {
1750
- right2.push(e2.right);
1751
- }
1752
- }
1753
- return [left2, right2];
1754
- });
1755
- var getSomes = /* @__PURE__ */ filterMap2(identity);
1756
- var getLefts = (self) => {
1757
- const out = [];
1758
- for (const a2 of self) {
1759
- if (isLeft2(a2)) {
1760
- out.push(a2.left);
1761
- }
1762
- }
1763
- return out;
1764
- };
1765
- var getRights = (self) => {
1766
- const out = [];
1767
- for (const a2 of self) {
1768
- if (isRight2(a2)) {
1769
- out.push(a2.right);
1770
- }
1771
- }
1772
- return out;
1773
- };
1774
- var filter2 = /* @__PURE__ */ dual(2, (self, predicate) => {
1775
- const as2 = fromIterable2(self);
1776
- const out = [];
1777
- for (let i2 = 0; i2 < as2.length; i2++) {
1778
- if (predicate(as2[i2], i2)) {
1779
- out.push(as2[i2]);
1780
- }
1781
- }
1782
- return out;
1783
- });
1784
- var partition = /* @__PURE__ */ dual(2, (self, predicate) => {
1785
- const left2 = [];
1786
- const right2 = [];
1787
- const as2 = fromIterable2(self);
1788
- for (let i2 = 0; i2 < as2.length; i2++) {
1789
- if (predicate(as2[i2], i2)) {
1790
- right2.push(as2[i2]);
1791
- } else {
1792
- left2.push(as2[i2]);
1793
- }
1794
- }
1795
- return [left2, right2];
1796
- });
1797
- var separate = /* @__PURE__ */ partitionMap2(identity);
1798
- var reduce = /* @__PURE__ */ dual(3, (self, b2, f2) => fromIterable2(self).reduce((b3, a2, i2) => f2(b3, a2, i2), b2));
1799
- var reduceRight = /* @__PURE__ */ dual(3, (self, b2, f2) => fromIterable2(self).reduceRight((b3, a2, i2) => f2(b3, a2, i2), b2));
1800
- var liftPredicate2 = (predicate) => (b2) => predicate(b2) ? [b2] : [];
1801
- var liftOption = (f2) => (...a2) => fromOption2(f2(...a2));
1802
- var fromNullable2 = (a2) => a2 == null ? empty2() : [a2];
1803
- var liftNullable2 = (f2) => (...a2) => fromNullable2(f2(...a2));
1804
- var flatMapNullable2 = /* @__PURE__ */ dual(2, (self, f2) => flatMap2(self, (a2) => fromNullable2(f2(a2))));
1805
- var liftEither = (f2) => (...a2) => {
1806
- const e2 = f2(...a2);
1807
- return isLeft2(e2) ? [] : [e2.right];
1808
- };
1809
- var every2 = /* @__PURE__ */ dual(2, (self, refinement) => self.every(refinement));
1810
- var some4 = /* @__PURE__ */ dual(2, (self, predicate) => self.some(predicate));
1811
- var extend = /* @__PURE__ */ dual(2, (self, f2) => self.map((_2, i2, as2) => f2(as2.slice(i2))));
1812
- var min2 = /* @__PURE__ */ dual(2, (self, O2) => self.reduce(min(O2)));
1813
- var max2 = /* @__PURE__ */ dual(2, (self, O2) => self.reduce(max(O2)));
1814
- var unfold = (b2, f2) => {
1815
- const out = [];
1816
- let next = b2;
1817
- let o2;
1818
- while (isSome2(o2 = f2(next))) {
1819
- const [a2, b3] = o2.value;
1820
- out.push(a2);
1821
- next = b3;
1822
- }
1823
- return out;
1824
- };
1825
- var getOrder2 = array2;
1826
- var getEquivalence2 = array;
1827
- var forEach = /* @__PURE__ */ dual(2, (self, f2) => fromIterable2(self).forEach((a2, i2) => f2(a2, i2)));
1828
- var dedupeWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
1829
- const input = fromIterable2(self);
1830
- if (isNonEmptyReadonlyArray(input)) {
1831
- const out = [headNonEmpty(input)];
1832
- const rest = tailNonEmpty(input);
1833
- for (const r2 of rest) {
1834
- if (out.every((a2) => !isEquivalent(r2, a2))) {
1835
- out.push(r2);
1836
- }
1837
- }
1838
- return out;
1839
- }
1840
- return [];
1841
- });
1842
- var dedupe = (self) => dedupeWith(self, equivalence());
1843
- var dedupeAdjacentWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
1844
- const out = [];
1845
- let lastA = none2();
1846
- for (const a2 of self) {
1847
- if (isNone2(lastA) || !isEquivalent(a2, lastA.value)) {
1848
- out.push(a2);
1849
- lastA = some3(a2);
1850
- }
1851
- }
1852
- return out;
1853
- });
1854
- var dedupeAdjacent = /* @__PURE__ */ dedupeAdjacentWith(/* @__PURE__ */ equivalence());
1855
- var join = /* @__PURE__ */ dual(2, (self, sep) => fromIterable2(self).join(sep));
1856
- var mapAccum = /* @__PURE__ */ dual(3, (self, s2, f2) => {
1857
- let i2 = 0;
1858
- let s1 = s2;
1859
- const out = [];
1860
- for (const a2 of self) {
1861
- const r2 = f2(s1, a2, i2);
1862
- s1 = r2[0];
1863
- out.push(r2[1]);
1864
- i2++;
1865
- }
1866
- return [s1, out];
1867
- });
1868
- var cartesianWith = /* @__PURE__ */ dual(3, (self, that, f2) => flatMap2(self, (a2) => map2(that, (b2) => f2(a2, b2))));
1869
- var cartesian = /* @__PURE__ */ dual(2, (self, that) => cartesianWith(self, that, (a2, b2) => [a2, b2]));
1870
- var Do2 = /* @__PURE__ */ of({});
1871
- var bind3 = /* @__PURE__ */ bind(map2, flatMap2);
1872
- var bindTo3 = /* @__PURE__ */ bindTo(map2);
1873
- var let_3 = /* @__PURE__ */ let_(map2);
1874
-
1875
- // ../../../node_modules/.pnpm/ts-pattern@5.2.0/node_modules/ts-pattern/dist/index.js
1876
- var t = Symbol.for("@ts-pattern/matcher");
1877
- var e = Symbol.for("@ts-pattern/isVariadic");
1878
- var n = "@ts-pattern/anonymous-select-key";
1879
- var r = (t2) => Boolean(t2 && "object" == typeof t2);
1880
- var i = (e2) => e2 && !!e2[t];
1881
- var o = (n2, s2, c2) => {
1882
- if (i(n2)) {
1883
- const e2 = n2[t](), { matched: r2, selections: i2 } = e2.match(s2);
1884
- return r2 && i2 && Object.keys(i2).forEach((t2) => c2(t2, i2[t2])), r2;
1885
- }
1886
- if (r(n2)) {
1887
- if (!r(s2)) return false;
1888
- if (Array.isArray(n2)) {
1889
- if (!Array.isArray(s2)) return false;
1890
- let t2 = [], r2 = [], a2 = [];
1891
- for (const o2 of n2.keys()) {
1892
- const s3 = n2[o2];
1893
- i(s3) && s3[e] ? a2.push(s3) : a2.length ? r2.push(s3) : t2.push(s3);
1894
- }
1895
- if (a2.length) {
1896
- if (a2.length > 1) throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");
1897
- if (s2.length < t2.length + r2.length) return false;
1898
- const e2 = s2.slice(0, t2.length), n3 = 0 === r2.length ? [] : s2.slice(-r2.length), i2 = s2.slice(t2.length, 0 === r2.length ? Infinity : -r2.length);
1899
- return t2.every((t3, n4) => o(t3, e2[n4], c2)) && r2.every((t3, e3) => o(t3, n3[e3], c2)) && (0 === a2.length || o(a2[0], i2, c2));
1900
- }
1901
- return n2.length === s2.length && n2.every((t3, e2) => o(t3, s2[e2], c2));
1902
- }
1903
- return Object.keys(n2).every((e2) => {
1904
- const r2 = n2[e2];
1905
- return (e2 in s2 || i(a2 = r2) && "optional" === a2[t]().matcherType) && o(r2, s2[e2], c2);
1906
- var a2;
1907
- });
1908
- }
1909
- return Object.is(s2, n2);
1910
- };
1911
- var s = (e2) => {
1912
- var n2, o2, a2;
1913
- return r(e2) ? i(e2) ? null != (n2 = null == (o2 = (a2 = e2[t]()).getSelectionKeys) ? void 0 : o2.call(a2)) ? n2 : [] : Array.isArray(e2) ? c(e2, s) : c(Object.values(e2), s) : [];
1914
- };
1915
- var c = (t2, e2) => t2.reduce((t3, n2) => t3.concat(e2(n2)), []);
1916
- function a(...t2) {
1917
- if (1 === t2.length) {
1918
- const [e2] = t2;
1919
- return (t3) => o(e2, t3, () => {
1920
- });
1921
- }
1922
- if (2 === t2.length) {
1923
- const [e2, n2] = t2;
1924
- return o(e2, n2, () => {
1925
- });
1926
- }
1927
- throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t2.length}.`);
1928
- }
1929
- function u(t2) {
1930
- return Object.assign(t2, { optional: () => l(t2), and: (e2) => m(t2, e2), or: (e2) => d(t2, e2), select: (e2) => void 0 === e2 ? p(t2) : p(e2, t2) });
1931
- }
1932
- function h(t2) {
1933
- return Object.assign(((t3) => Object.assign(t3, { [Symbol.iterator]() {
1934
- let n2 = 0;
1935
- const r2 = [{ value: Object.assign(t3, { [e]: true }), done: false }, { done: true, value: void 0 }];
1936
- return { next: () => {
1937
- var t4;
1938
- return null != (t4 = r2[n2++]) ? t4 : r2.at(-1);
1939
- } };
1940
- } }))(t2), { optional: () => h(l(t2)), select: (e2) => h(void 0 === e2 ? p(t2) : p(e2, t2)) });
1941
- }
1942
- function l(e2) {
1943
- return u({ [t]: () => ({ match: (t2) => {
1944
- let n2 = {};
1945
- const r2 = (t3, e3) => {
1946
- n2[t3] = e3;
1947
- };
1948
- return void 0 === t2 ? (s(e2).forEach((t3) => r2(t3, void 0)), { matched: true, selections: n2 }) : { matched: o(e2, t2, r2), selections: n2 };
1949
- }, getSelectionKeys: () => s(e2), matcherType: "optional" }) });
1950
- }
1951
- var f = (t2, e2) => {
1952
- for (const n2 of t2) if (!e2(n2)) return false;
1953
- return true;
1954
- };
1955
- var g = (t2, e2) => {
1956
- for (const [n2, r2] of t2.entries()) if (!e2(r2, n2)) return false;
1957
- return true;
1958
- };
1959
- function m(...e2) {
1960
- return u({ [t]: () => ({ match: (t2) => {
1961
- let n2 = {};
1962
- const r2 = (t3, e3) => {
1963
- n2[t3] = e3;
1964
- };
1965
- return { matched: e2.every((e3) => o(e3, t2, r2)), selections: n2 };
1966
- }, getSelectionKeys: () => c(e2, s), matcherType: "and" }) });
1967
- }
1968
- function d(...e2) {
1969
- return u({ [t]: () => ({ match: (t2) => {
1970
- let n2 = {};
1971
- const r2 = (t3, e3) => {
1972
- n2[t3] = e3;
1973
- };
1974
- return c(e2, s).forEach((t3) => r2(t3, void 0)), { matched: e2.some((e3) => o(e3, t2, r2)), selections: n2 };
1975
- }, getSelectionKeys: () => c(e2, s), matcherType: "or" }) });
1976
- }
1977
- function y(e2) {
1978
- return { [t]: () => ({ match: (t2) => ({ matched: Boolean(e2(t2)) }) }) };
1979
- }
1980
- function p(...e2) {
1981
- const r2 = "string" == typeof e2[0] ? e2[0] : void 0, i2 = 2 === e2.length ? e2[1] : "string" == typeof e2[0] ? void 0 : e2[0];
1982
- return u({ [t]: () => ({ match: (t2) => {
1983
- let e3 = { [null != r2 ? r2 : n]: t2 };
1984
- return { matched: void 0 === i2 || o(i2, t2, (t3, n2) => {
1985
- e3[t3] = n2;
1986
- }), selections: e3 };
1987
- }, getSelectionKeys: () => [null != r2 ? r2 : n].concat(void 0 === i2 ? [] : s(i2)) }) });
1988
- }
1989
- function v(t2) {
1990
- return "number" == typeof t2;
1991
- }
1992
- function b(t2) {
1993
- return "string" == typeof t2;
1994
- }
1995
- function w(t2) {
1996
- return "bigint" == typeof t2;
1997
- }
1998
- var S = u(y(function(t2) {
1999
- return true;
2000
- }));
2001
- var O = S;
2002
- var j = (t2) => Object.assign(u(t2), { startsWith: (e2) => {
2003
- return j(m(t2, (n2 = e2, y((t3) => b(t3) && t3.startsWith(n2)))));
2004
- var n2;
2005
- }, endsWith: (e2) => {
2006
- return j(m(t2, (n2 = e2, y((t3) => b(t3) && t3.endsWith(n2)))));
2007
- var n2;
2008
- }, minLength: (e2) => j(m(t2, ((t3) => y((e3) => b(e3) && e3.length >= t3))(e2))), length: (e2) => j(m(t2, ((t3) => y((e3) => b(e3) && e3.length === t3))(e2))), maxLength: (e2) => j(m(t2, ((t3) => y((e3) => b(e3) && e3.length <= t3))(e2))), includes: (e2) => {
2009
- return j(m(t2, (n2 = e2, y((t3) => b(t3) && t3.includes(n2)))));
2010
- var n2;
2011
- }, regex: (e2) => {
2012
- return j(m(t2, (n2 = e2, y((t3) => b(t3) && Boolean(t3.match(n2))))));
2013
- var n2;
2014
- } });
2015
- var E = j(y(b));
2016
- var K = (t2) => Object.assign(u(t2), { between: (e2, n2) => K(m(t2, ((t3, e3) => y((n3) => v(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 < t3))(e2))), gt: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 > t3))(e2))), lte: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 <= t3))(e2))), gte: (e2) => K(m(t2, ((t3) => y((e3) => v(e3) && e3 >= t3))(e2))), int: () => K(m(t2, y((t3) => v(t3) && Number.isInteger(t3)))), finite: () => K(m(t2, y((t3) => v(t3) && Number.isFinite(t3)))), positive: () => K(m(t2, y((t3) => v(t3) && t3 > 0))), negative: () => K(m(t2, y((t3) => v(t3) && t3 < 0))) });
2017
- var x = K(y(v));
2018
- var A = (t2) => Object.assign(u(t2), { between: (e2, n2) => A(m(t2, ((t3, e3) => y((n3) => w(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 < t3))(e2))), gt: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 > t3))(e2))), lte: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 <= t3))(e2))), gte: (e2) => A(m(t2, ((t3) => y((e3) => w(e3) && e3 >= t3))(e2))), positive: () => A(m(t2, y((t3) => w(t3) && t3 > 0))), negative: () => A(m(t2, y((t3) => w(t3) && t3 < 0))) });
2019
- var P = A(y(w));
2020
- var T = u(y(function(t2) {
2021
- return "boolean" == typeof t2;
2022
- }));
2023
- var k = u(y(function(t2) {
2024
- return "symbol" == typeof t2;
2025
- }));
2026
- var B = u(y(function(t2) {
2027
- return null == t2;
2028
- }));
2029
- var _ = u(y(function(t2) {
2030
- return null != t2;
2031
- }));
2032
- var N = { __proto__: null, matcher: t, optional: l, array: function(...e2) {
2033
- return h({ [t]: () => ({ match: (t2) => {
2034
- if (!Array.isArray(t2)) return { matched: false };
2035
- if (0 === e2.length) return { matched: true };
2036
- const n2 = e2[0];
2037
- let r2 = {};
2038
- if (0 === t2.length) return s(n2).forEach((t3) => {
2039
- r2[t3] = [];
2040
- }), { matched: true, selections: r2 };
2041
- const i2 = (t3, e3) => {
2042
- r2[t3] = (r2[t3] || []).concat([e3]);
2043
- };
2044
- return { matched: t2.every((t3) => o(n2, t3, i2)), selections: r2 };
2045
- }, getSelectionKeys: () => 0 === e2.length ? [] : s(e2[0]) }) });
2046
- }, set: function(...e2) {
2047
- return u({ [t]: () => ({ match: (t2) => {
2048
- if (!(t2 instanceof Set)) return { matched: false };
2049
- let n2 = {};
2050
- if (0 === t2.size) return { matched: true, selections: n2 };
2051
- if (0 === e2.length) return { matched: true };
2052
- const r2 = (t3, e3) => {
2053
- n2[t3] = (n2[t3] || []).concat([e3]);
2054
- }, i2 = e2[0];
2055
- return { matched: f(t2, (t3) => o(i2, t3, r2)), selections: n2 };
2056
- }, getSelectionKeys: () => 0 === e2.length ? [] : s(e2[0]) }) });
2057
- }, map: function(...e2) {
2058
- return u({ [t]: () => ({ match: (t2) => {
2059
- if (!(t2 instanceof Map)) return { matched: false };
2060
- let n2 = {};
2061
- if (0 === t2.size) return { matched: true, selections: n2 };
2062
- const r2 = (t3, e3) => {
2063
- n2[t3] = (n2[t3] || []).concat([e3]);
2064
- };
2065
- if (0 === e2.length) return { matched: true };
2066
- var i2;
2067
- if (1 === e2.length) throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null == (i2 = e2[0]) ? void 0 : i2.toString()}`);
2068
- const [s2, c2] = e2;
2069
- return { matched: g(t2, (t3, e3) => {
2070
- const n3 = o(s2, e3, r2), i3 = o(c2, t3, r2);
2071
- return n3 && i3;
2072
- }), selections: n2 };
2073
- }, getSelectionKeys: () => 0 === e2.length ? [] : [...s(e2[0]), ...s(e2[1])] }) });
2074
- }, intersection: m, union: d, not: function(e2) {
2075
- return u({ [t]: () => ({ match: (t2) => ({ matched: !o(e2, t2, () => {
2076
- }) }), getSelectionKeys: () => [], matcherType: "not" }) });
2077
- }, when: y, select: p, any: S, _: O, string: E, number: x, bigint: P, boolean: T, symbol: k, nullish: B, nonNullable: _, instanceOf: function(t2) {
2078
- return u(y(/* @__PURE__ */ function(t3) {
2079
- return (e2) => e2 instanceof t3;
2080
- }(t2)));
2081
- }, shape: function(t2) {
2082
- return u(y(a(t2)));
2083
- } };
2084
- var W = { matched: false, value: void 0 };
2085
- function $(t2) {
2086
- return new z(t2, W);
2087
- }
2088
- var z = class _z {
2089
- constructor(t2, e2) {
2090
- this.input = void 0, this.state = void 0, this.input = t2, this.state = e2;
2091
- }
2092
- with(...t2) {
2093
- if (this.state.matched) return this;
2094
- const e2 = t2[t2.length - 1], r2 = [t2[0]];
2095
- let i2;
2096
- 3 === t2.length && "function" == typeof t2[1] ? i2 = t2[1] : t2.length > 2 && r2.push(...t2.slice(1, t2.length - 1));
2097
- let s2 = false, c2 = {};
2098
- const a2 = (t3, e3) => {
2099
- s2 = true, c2[t3] = e3;
2100
- }, u2 = !r2.some((t3) => o(t3, this.input, a2)) || i2 && !Boolean(i2(this.input)) ? W : { matched: true, value: e2(s2 ? n in c2 ? c2[n] : c2 : this.input, this.input) };
2101
- return new _z(this.input, u2);
2102
- }
2103
- when(t2, e2) {
2104
- if (this.state.matched) return this;
2105
- const n2 = Boolean(t2(this.input));
2106
- return new _z(this.input, n2 ? { matched: true, value: e2(this.input, this.input) } : W);
2107
- }
2108
- otherwise(t2) {
2109
- return this.state.matched ? this.state.value : t2(this.input);
2110
- }
2111
- exhaustive() {
2112
- if (this.state.matched) return this.state.value;
2113
- let t2;
2114
- try {
2115
- t2 = JSON.stringify(this.input);
2116
- } catch (e2) {
2117
- t2 = this.input;
2118
- }
2119
- throw new Error(`Pattern matching error: no pattern matches value ${t2}`);
2120
- }
2121
- run() {
2122
- return this.exhaustive();
2123
- }
2124
- returnType() {
2125
- return this;
2126
- }
2127
- };
2128
-
2129
- // src/prop/get-prop.ts
2130
33
  var { getStaticValue } = ast.ESLintCommunityESLintUtils;
2131
34
  function getPropName(node) {
2132
- return $(node.name).when(ast.is(ast.NodeType.JSXIdentifier), (n2) => n2.name).when(ast.is(ast.NodeType.JSXNamespacedName), (n2) => `${n2.namespace.name}:${n2.name.name}`).exhaustive();
35
+ return tsPattern.match(node.name).when(ast.is(ast.NodeType.JSXIdentifier), (n) => n.name).when(ast.is(ast.NodeType.JSXNamespacedName), (n) => `${n.namespace.name}:${n.name.name}`).exhaustive();
2133
36
  }
2134
37
  function getProp(props, propName, context, initialScope) {
2135
38
  return findPropInAttributes(props, context, initialScope)(propName);
@@ -2138,77 +41,75 @@ function getPropValue(attribute, context) {
2138
41
  const initialScope = context.sourceCode.getScope(attribute);
2139
42
  if (attribute.type === ast.NodeType.JSXAttribute && "value" in attribute) {
2140
43
  const { value } = attribute;
2141
- if (value === null) return Option_exports.none();
2142
- if (value.type === ast.NodeType.Literal) return Option_exports.some(getStaticValue(value, initialScope));
2143
- if (value.type === ast.NodeType.JSXExpressionContainer) return Option_exports.some(getStaticValue(value.expression, initialScope));
2144
- return Option_exports.none();
44
+ if (value === null) return effect.Option.none();
45
+ if (value.type === ast.NodeType.Literal) return effect.Option.some(getStaticValue(value, initialScope));
46
+ if (value.type === ast.NodeType.JSXExpressionContainer) return effect.Option.some(getStaticValue(value.expression, initialScope));
47
+ return effect.Option.none();
2145
48
  }
2146
49
  const { argument } = attribute;
2147
- return Option_exports.some(getStaticValue(argument, initialScope));
50
+ return effect.Option.some(getStaticValue(argument, initialScope));
2148
51
  }
2149
52
  function findPropInProperties(properties, context, initialScope, seenProps = []) {
2150
53
  return (propName) => {
2151
- return Option_exports.fromNullable(
54
+ return effect.Option.fromNullable(
2152
55
  properties.find((prop) => {
2153
- return $(prop).when(ast.is(ast.NodeType.Property), (prop2) => {
56
+ return tsPattern.match(prop).when(ast.is(ast.NodeType.Property), (prop2) => {
2154
57
  return "name" in prop2.key && prop2.key.name === propName;
2155
58
  }).when(ast.is(ast.NodeType.SpreadElement), (prop2) => {
2156
- return $(prop2.argument).when(ast.is(ast.NodeType.Identifier), (argument) => {
59
+ return tsPattern.match(prop2.argument).when(ast.is(ast.NodeType.Identifier), (argument) => {
2157
60
  const { name } = argument;
2158
- const maybeInit = Option_exports.flatMap(
61
+ const maybeInit = effect.Option.flatMap(
2159
62
  _var.findVariable(name, initialScope),
2160
63
  _var.getVariableInit(0)
2161
64
  );
2162
- if (Option_exports.isNone(maybeInit)) return false;
2163
- const init2 = maybeInit.value;
2164
- if (init2.type !== ast.NodeType.ObjectExpression) return false;
65
+ if (effect.Option.isNone(maybeInit)) return false;
66
+ const init = maybeInit.value;
67
+ if (init.type !== ast.NodeType.ObjectExpression) return false;
2165
68
  if (seenProps.includes(name)) return false;
2166
- return Option_exports.isSome(
2167
- findPropInProperties(init2.properties, context, initialScope, [...seenProps, name])(propName)
69
+ return effect.Option.isSome(
70
+ findPropInProperties(init.properties, context, initialScope, [...seenProps, name])(propName)
2168
71
  );
2169
72
  }).when(ast.is(ast.NodeType.ObjectExpression), (argument) => {
2170
- return Option_exports.isSome(findPropInProperties(argument.properties, context, initialScope, seenProps)(propName));
73
+ return effect.Option.isSome(findPropInProperties(argument.properties, context, initialScope, seenProps)(propName));
2171
74
  }).when(ast.is(ast.NodeType.MemberExpression), () => {
2172
75
  }).when(ast.is(ast.NodeType.CallExpression), () => {
2173
- }).otherwise(Function_exports.constFalse);
76
+ }).otherwise(effect.Function.constFalse);
2174
77
  }).when(ast.is(ast.NodeType.RestElement), () => {
2175
78
  return false;
2176
- }).otherwise(Function_exports.constFalse);
79
+ }).otherwise(effect.Function.constFalse);
2177
80
  })
2178
81
  );
2179
82
  };
2180
83
  }
2181
84
  function findPropInAttributes(attributes, context, initialScope) {
2182
85
  return (propName) => {
2183
- return Option_exports.fromNullable(
86
+ return effect.Option.fromNullable(
2184
87
  attributes.find((attr) => {
2185
- return $(attr).when(ast.is(ast.NodeType.JSXAttribute), (attr2) => getPropName(attr2) === propName).when(ast.is(ast.NodeType.JSXSpreadAttribute), (attr2) => {
2186
- return $(attr2.argument).with({ type: ast.NodeType.Identifier }, (argument) => {
88
+ return tsPattern.match(attr).when(ast.is(ast.NodeType.JSXAttribute), (attr2) => getPropName(attr2) === propName).when(ast.is(ast.NodeType.JSXSpreadAttribute), (attr2) => {
89
+ return tsPattern.match(attr2.argument).with({ type: ast.NodeType.Identifier }, (argument) => {
2187
90
  const { name } = argument;
2188
- const maybeInit = Option_exports.flatMap(
91
+ const maybeInit = effect.Option.flatMap(
2189
92
  _var.findVariable(name, initialScope),
2190
93
  _var.getVariableInit(0)
2191
94
  );
2192
- if (Option_exports.isNone(maybeInit)) return false;
2193
- const init2 = maybeInit.value;
2194
- if (!("properties" in init2)) return false;
2195
- return Option_exports.isSome(findPropInProperties(init2.properties, context, initialScope)(propName));
95
+ if (effect.Option.isNone(maybeInit)) return false;
96
+ const init = maybeInit.value;
97
+ if (!("properties" in init)) return false;
98
+ return effect.Option.isSome(findPropInProperties(init.properties, context, initialScope)(propName));
2196
99
  }).when(ast.is(ast.NodeType.ObjectExpression), (argument) => {
2197
- return Option_exports.isSome(findPropInProperties(argument.properties, context, initialScope)(propName));
100
+ return effect.Option.isSome(findPropInProperties(argument.properties, context, initialScope)(propName));
2198
101
  }).when(ast.is(ast.NodeType.MemberExpression), () => {
2199
102
  return false;
2200
103
  }).when(ast.is(ast.NodeType.CallExpression), () => {
2201
104
  return false;
2202
- }).otherwise(Function_exports.constFalse);
2203
- }).otherwise(Function_exports.constFalse);
105
+ }).otherwise(effect.Function.constFalse);
106
+ }).otherwise(effect.Function.constFalse);
2204
107
  })
2205
108
  );
2206
109
  };
2207
110
  }
2208
-
2209
- // src/prop/has-prop.ts
2210
111
  function hasProp(attributes, propName, context, initialScope) {
2211
- return Option_exports.isSome(findPropInAttributes(attributes, context, initialScope)(propName));
112
+ return effect.Option.isSome(findPropInAttributes(attributes, context, initialScope)(propName));
2212
113
  }
2213
114
  function hasAnyProp(attributes, propNames, context, initialScope) {
2214
115
  return propNames.some((propName) => hasProp(attributes, propName, context, initialScope));
@@ -2216,7 +117,7 @@ function hasAnyProp(attributes, propNames, context, initialScope) {
2216
117
  function hasEveryProp(attributes, propNames, context, initialScope) {
2217
118
  return propNames.every((propName) => hasProp(attributes, propName, context, initialScope));
2218
119
  }
2219
- function traverseUpProp(node, predicate = Function_exports.constTrue) {
120
+ function traverseUpProp(node, predicate = effect.Function.constTrue) {
2220
121
  const guard = (node2) => {
2221
122
  return node2.type === ast.NodeType.JSXAttribute && predicate(node2);
2222
123
  };
@@ -2226,7 +127,7 @@ function traverseUpProp(node, predicate = Function_exports.constTrue) {
2226
127
  // src/prop/misc.ts
2227
128
  function isInsidePropValue(node) {
2228
129
  if (ast.isStringLiteral(node)) return node.parent.type === ast.NodeType.JSXAttribute;
2229
- return Option_exports.isSome(traverseUpProp(node, (n2) => n2.value?.type === ast.NodeType.JSXExpressionContainer));
130
+ return effect.Option.isSome(traverseUpProp(node, (n) => n.value?.type === ast.NodeType.JSXExpressionContainer));
2230
131
  }
2231
132
 
2232
133
  // src/element/is.ts
@@ -2242,22 +143,20 @@ function isBuiltInElement(node) {
2242
143
  if (node.type !== ast.NodeType.JSXElement) return false;
2243
144
  return node.openingElement.name.type === ast.NodeType.JSXIdentifier && node.openingElement.name.name.toLowerCase() === node.openingElement.name.name && /^[a-z]/u.test(node.openingElement.name.name);
2244
145
  }
2245
-
2246
- // src/pragma.ts
2247
146
  var RE_JSX_ANNOTATION_REGEX = /@jsx\s+(\S+)/u;
2248
147
  var RE_JS_IDENTIFIER_REGEX = /^[$A-Z_a-z][\w$]*$/u;
2249
148
  function getJSXPragmaFromContext(context) {
2250
149
  const { sourceCode } = context;
2251
- return Function_exports.pipe(
2252
- Array_exports.findFirst(sourceCode.getAllComments(), (node) => RE_JSX_ANNOTATION_REGEX.test(node.value)),
2253
- Option_exports.map(({ value }) => RE_JSX_ANNOTATION_REGEX.exec(value)),
2254
- Option_exports.flatMapNullable((matches) => matches?.[1]),
2255
- Option_exports.filter((pragma) => RE_JS_IDENTIFIER_REGEX.test(pragma))
150
+ return effect.Function.pipe(
151
+ effect.Array.findFirst(sourceCode.getAllComments(), (node) => RE_JSX_ANNOTATION_REGEX.test(node.value)),
152
+ effect.Option.map(({ value }) => RE_JSX_ANNOTATION_REGEX.exec(value)),
153
+ effect.Option.flatMapNullable((matches) => matches?.[1]),
154
+ effect.Option.filter((pragma) => RE_JS_IDENTIFIER_REGEX.test(pragma))
2256
155
  );
2257
156
  }
2258
157
  var isLiteral = ast.isOneOf([ast.NodeType.Literal, ast.NodeType.JSXText]);
2259
158
  function isWhiteSpace(node) {
2260
- return Predicate_exports.isString(node.value) && node.value.trim() === "";
159
+ return effect.Predicate.isString(node.value) && node.value.trim() === "";
2261
160
  }
2262
161
  function isLineBreak(node) {
2263
162
  return isLiteral(node) && isWhiteSpace(node) && ast.isMultiLine(node);
@@ -2281,19 +180,19 @@ var JSXValueHint = {
2281
180
  var DEFAULT_JSX_VALUE_HINT = JSXValueHint.SkipUndefinedLiteral | JSXValueHint.SkipBooleanLiteral;
2282
181
  function isJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
2283
182
  if (!node) return false;
2284
- return $(node).with({ type: ast.NodeType.JSXElement }, Function_exports.constTrue).with({ type: ast.NodeType.JSXFragment }, Function_exports.constTrue).with({ type: ast.NodeType.JSXMemberExpression }, Function_exports.constTrue).with({ type: ast.NodeType.JSXNamespacedName }, Function_exports.constTrue).with({ type: ast.NodeType.Literal }, (node2) => {
2285
- return $(node2.value).with(null, () => !(hint & JSXValueHint.SkipNullLiteral)).with(N.boolean, () => !(hint & JSXValueHint.SkipBooleanLiteral)).with(N.string, () => !(hint & JSXValueHint.SkipStringLiteral)).with(N.number, () => !(hint & JSXValueHint.SkipNumberLiteral)).otherwise(Function_exports.constFalse);
183
+ return tsPattern.match(node).with({ type: ast.NodeType.JSXElement }, effect.Function.constTrue).with({ type: ast.NodeType.JSXFragment }, effect.Function.constTrue).with({ type: ast.NodeType.JSXMemberExpression }, effect.Function.constTrue).with({ type: ast.NodeType.JSXNamespacedName }, effect.Function.constTrue).with({ type: ast.NodeType.Literal }, (node2) => {
184
+ return tsPattern.match(node2.value).with(null, () => !(hint & JSXValueHint.SkipNullLiteral)).with(tsPattern.P.boolean, () => !(hint & JSXValueHint.SkipBooleanLiteral)).with(tsPattern.P.string, () => !(hint & JSXValueHint.SkipStringLiteral)).with(tsPattern.P.number, () => !(hint & JSXValueHint.SkipNumberLiteral)).otherwise(effect.Function.constFalse);
2286
185
  }).with({ type: ast.NodeType.TemplateLiteral }, () => !(hint & JSXValueHint.SkipStringLiteral)).with({ type: ast.NodeType.ArrayExpression }, (node2) => {
2287
- if (hint & JSXValueHint.StrictArray) return node2.elements.every((n2) => isJSXValue(n2, context, hint));
2288
- return node2.elements.some((n2) => isJSXValue(n2, context, hint));
186
+ if (hint & JSXValueHint.StrictArray) return node2.elements.every((n) => isJSXValue(n, context, hint));
187
+ return node2.elements.some((n) => isJSXValue(n, context, hint));
2289
188
  }).with({ type: ast.NodeType.ConditionalExpression }, (node2) => {
2290
189
  function leftHasJSX(node3) {
2291
190
  if (Array.isArray(node3.consequent)) {
2292
191
  if (node3.consequent.length === 0) return !(hint & JSXValueHint.SkipEmptyArray);
2293
192
  if (hint & JSXValueHint.StrictArray) {
2294
- return node3.consequent.every((n2) => isJSXValue(n2, context, hint));
193
+ return node3.consequent.every((n) => isJSXValue(n, context, hint));
2295
194
  }
2296
- return node3.consequent.some((n2) => isJSXValue(n2, context, hint));
195
+ return node3.consequent.some((n) => isJSXValue(n, context, hint));
2297
196
  }
2298
197
  return isJSXValue(node3.consequent, context, hint);
2299
198
  }
@@ -2314,19 +213,19 @@ function isJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
2314
213
  return isJSXValue(exp, context, hint);
2315
214
  }).with({ type: ast.NodeType.CallExpression }, (node2) => {
2316
215
  if (hint & JSXValueHint.SkipCreateElement) return false;
2317
- return $(node2.callee).with({ type: ast.NodeType.Identifier, name: "createElement" }, Function_exports.constTrue).with({ type: ast.NodeType.MemberExpression, property: { name: "createElement" } }, Function_exports.constTrue).otherwise(Function_exports.constFalse);
216
+ return tsPattern.match(node2.callee).with({ type: ast.NodeType.Identifier, name: "createElement" }, effect.Function.constTrue).with({ type: ast.NodeType.MemberExpression, property: { name: "createElement" } }, effect.Function.constTrue).otherwise(effect.Function.constFalse);
2318
217
  }).with({ type: ast.NodeType.Identifier }, (node2) => {
2319
218
  const { name } = node2;
2320
219
  if (name === "undefined") return !(hint & JSXValueHint.SkipUndefinedLiteral);
2321
220
  if (ast.isJSXTagNameExpression(node2)) return true;
2322
221
  const initialScope = context.sourceCode.getScope(node2);
2323
222
  const maybeVariable = _var.findVariable(name, initialScope);
2324
- return Function_exports.pipe(
223
+ return effect.Function.pipe(
2325
224
  maybeVariable,
2326
- Option_exports.flatMap(_var.getVariableInit(0)),
2327
- Option_exports.exists((n2) => isJSXValue(n2, context, hint))
225
+ effect.Option.flatMap(_var.getVariableInit(0)),
226
+ effect.Option.exists((n) => isJSXValue(n, context, hint))
2328
227
  );
2329
- }).otherwise(Function_exports.constFalse);
228
+ }).otherwise(effect.Function.constFalse);
2330
229
  }
2331
230
 
2332
231
  exports.DEFAULT_JSX_VALUE_HINT = DEFAULT_JSX_VALUE_HINT;