@eslint-react/jsx 1.5.3 → 1.5.4-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/dist/index.js +1369 -1228
  2. package/dist/index.mjs +1366 -1229
  3. package/package.json +8 -8
  4. package/dist/index.cjs +0 -1656
package/dist/index.js CHANGED
@@ -5,71 +5,50 @@ var shared = require('@eslint-react/shared');
5
5
  var memo = require('micro-memoize');
6
6
  var _var = require('@eslint-react/var');
7
7
  var types = require('@typescript-eslint/types');
8
+ require('@typescript-eslint/utils');
8
9
 
9
- /**
10
- * Tests if a value is a `function`.
11
- *
12
- * @param input - The value to test.
13
- *
14
- * @example
15
- * import { isFunction } from 'effect/Predicate'
16
- *
17
- * assert.deepStrictEqual(isFunction(isFunction), true)
18
- * assert.deepStrictEqual(isFunction("function"), false)
19
- *
20
- * @category guards
21
- * @since 2.0.0
22
- */
23
- const isFunction$1 = input => typeof input === "function";
24
- /**
25
- * Creates a function that can be used in a data-last (aka `pipe`able) or
26
- * data-first style.
27
- *
28
- * The first parameter to `dual` is either the arity of the uncurried function
29
- * or a predicate that determines if the function is being used in a data-first
30
- * or data-last style.
31
- *
32
- * Using the arity is the most common use case, but there are some cases where
33
- * you may want to use a predicate. For example, if you have a function that
34
- * takes an optional argument, you can use a predicate to determine if the
35
- * function is being used in a data-first or data-last style.
36
- *
37
- * @param arity - Either the arity of the uncurried function or a predicate
38
- * which determines if the function is being used in a data-first
39
- * or data-last style.
40
- * @param body - The definition of the uncurried function.
41
- *
42
- * @example
43
- * import { dual, pipe } from "effect/Function"
44
- *
45
- * // Exampe using arity to determine data-first or data-last style
46
- * const sum: {
47
- * (that: number): (self: number) => number
48
- * (self: number, that: number): number
49
- * } = dual(2, (self: number, that: number): number => self + that)
50
- *
51
- * assert.deepStrictEqual(sum(2, 3), 5)
52
- * assert.deepStrictEqual(pipe(2, sum(3)), 5)
53
- *
54
- * // Example using a predicate to determine data-first or data-last style
55
- * const sum2: {
56
- * (that: number): (self: number) => number
57
- * (self: number, that: number): number
58
- * } = dual((args) => args.length === 1, (self: number, that: number): number => self + that)
59
- *
60
- * assert.deepStrictEqual(sum(2, 3), 5)
61
- * assert.deepStrictEqual(pipe(2, sum(3)), 5)
62
- *
63
- * @since 2.0.0
64
- */
65
- const dual = function (arity, body) {
10
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
11
+
12
+ var memo__default = /*#__PURE__*/_interopDefault(memo);
13
+
14
+ var __defProp = Object.defineProperty;
15
+ var __export = (target, all3) => {
16
+ for (var name in all3)
17
+ __defProp(target, name, { get: all3[name], enumerable: true });
18
+ };
19
+
20
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/Function.js
21
+ var Function_exports = {};
22
+ __export(Function_exports, {
23
+ SK: () => SK,
24
+ absurd: () => absurd,
25
+ apply: () => apply,
26
+ compose: () => compose,
27
+ constFalse: () => constFalse,
28
+ constNull: () => constNull,
29
+ constTrue: () => constTrue,
30
+ constUndefined: () => constUndefined,
31
+ constVoid: () => constVoid,
32
+ constant: () => constant,
33
+ dual: () => dual,
34
+ flip: () => flip,
35
+ flow: () => flow,
36
+ hole: () => hole,
37
+ identity: () => identity,
38
+ isFunction: () => isFunction,
39
+ pipe: () => pipe,
40
+ tupled: () => tupled,
41
+ unsafeCoerce: () => unsafeCoerce,
42
+ untupled: () => untupled
43
+ });
44
+ var isFunction = (input) => typeof input === "function";
45
+ var dual = function(arity, body) {
66
46
  if (typeof arity === "function") {
67
- return function () {
47
+ return function() {
68
48
  if (arity(arguments)) {
69
- // @ts-expect-error
70
49
  return body.apply(this, arguments);
71
50
  }
72
- return self => body(self, ...arguments);
51
+ return (self) => body(self, ...arguments);
73
52
  };
74
53
  }
75
54
  switch (arity) {
@@ -77,251 +56,388 @@ const dual = function (arity, body) {
77
56
  case 1:
78
57
  throw new RangeError(`Invalid arity ${arity}`);
79
58
  case 2:
80
- return function (a, b) {
59
+ return function(a2, b2) {
81
60
  if (arguments.length >= 2) {
82
- return body(a, b);
61
+ return body(a2, b2);
83
62
  }
84
- return function (self) {
85
- return body(self, a);
63
+ return function(self) {
64
+ return body(self, a2);
86
65
  };
87
66
  };
88
67
  case 3:
89
- return function (a, b, c) {
68
+ return function(a2, b2, c2) {
90
69
  if (arguments.length >= 3) {
91
- return body(a, b, c);
70
+ return body(a2, b2, c2);
92
71
  }
93
- return function (self) {
94
- return body(self, a, b);
72
+ return function(self) {
73
+ return body(self, a2, b2);
95
74
  };
96
75
  };
97
76
  case 4:
98
- return function (a, b, c, d) {
77
+ return function(a2, b2, c2, d2) {
99
78
  if (arguments.length >= 4) {
100
- return body(a, b, c, d);
79
+ return body(a2, b2, c2, d2);
101
80
  }
102
- return function (self) {
103
- return body(self, a, b, c);
81
+ return function(self) {
82
+ return body(self, a2, b2, c2);
104
83
  };
105
84
  };
106
85
  case 5:
107
- return function (a, b, c, d, e) {
86
+ return function(a2, b2, c2, d2, e2) {
108
87
  if (arguments.length >= 5) {
109
- return body(a, b, c, d, e);
88
+ return body(a2, b2, c2, d2, e2);
110
89
  }
111
- return function (self) {
112
- return body(self, a, b, c, d);
90
+ return function(self) {
91
+ return body(self, a2, b2, c2, d2);
113
92
  };
114
93
  };
115
94
  default:
116
- return function () {
95
+ return function() {
117
96
  if (arguments.length >= arity) {
118
- // @ts-expect-error
119
97
  return body.apply(this, arguments);
120
98
  }
121
99
  const args = arguments;
122
- return function (self) {
100
+ return function(self) {
123
101
  return body(self, ...args);
124
102
  };
125
103
  };
126
104
  }
127
105
  };
128
- /**
129
- * Creates a constant value that never changes.
130
- *
131
- * This is useful when you want to pass a value to a higher-order function (a function that takes another function as its argument)
132
- * and want that inner function to always use the same value, no matter how many times it is called.
133
- *
134
- * @param value - The constant value to be returned.
135
- *
136
- * @example
137
- * import { constant } from "effect/Function"
138
- *
139
- * const constNull = constant(null)
140
- *
141
- * assert.deepStrictEqual(constNull(), null)
142
- * assert.deepStrictEqual(constNull(), null)
143
- *
144
- * @since 2.0.0
145
- */
146
- const constant = value => () => value;
147
- /**
148
- * A thunk that returns always `true`.
149
- *
150
- * @example
151
- * import { constTrue } from "effect/Function"
152
- *
153
- * assert.deepStrictEqual(constTrue(), true)
154
- *
155
- * @since 2.0.0
156
- */
157
- const constTrue = /*#__PURE__*/constant(true);
158
- /**
159
- * A thunk that returns always `false`.
160
- *
161
- * @example
162
- * import { constFalse } from "effect/Function"
163
- *
164
- * assert.deepStrictEqual(constFalse(), false)
165
- *
166
- * @since 2.0.0
167
- */
168
- const constFalse = /*#__PURE__*/constant(false);
169
- function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
106
+ var apply = (a2) => (self) => self(a2);
107
+ var identity = (a2) => a2;
108
+ var unsafeCoerce = identity;
109
+ var constant = (value) => () => value;
110
+ var constTrue = /* @__PURE__ */ constant(true);
111
+ var constFalse = /* @__PURE__ */ constant(false);
112
+ var constNull = /* @__PURE__ */ constant(null);
113
+ var constUndefined = /* @__PURE__ */ constant(void 0);
114
+ var constVoid = constUndefined;
115
+ var flip = (f2) => (...b2) => (...a2) => f2(...a2)(...b2);
116
+ var compose = /* @__PURE__ */ dual(2, (ab, bc) => (a2) => bc(ab(a2)));
117
+ var absurd = (_2) => {
118
+ throw new Error("Called `absurd` function which should be uncallable");
119
+ };
120
+ var tupled = (f2) => (a2) => f2(...a2);
121
+ var untupled = (f2) => (...a2) => f2(a2);
122
+ function pipe(a2, ab, bc, cd, de, ef, fg, gh, hi) {
170
123
  switch (arguments.length) {
171
124
  case 1:
172
- return a;
125
+ return a2;
173
126
  case 2:
174
- return ab(a);
127
+ return ab(a2);
175
128
  case 3:
176
- return bc(ab(a));
129
+ return bc(ab(a2));
177
130
  case 4:
178
- return cd(bc(ab(a)));
131
+ return cd(bc(ab(a2)));
179
132
  case 5:
180
- return de(cd(bc(ab(a))));
133
+ return de(cd(bc(ab(a2))));
181
134
  case 6:
182
- return ef(de(cd(bc(ab(a)))));
135
+ return ef(de(cd(bc(ab(a2)))));
183
136
  case 7:
184
- return fg(ef(de(cd(bc(ab(a))))));
137
+ return fg(ef(de(cd(bc(ab(a2))))));
185
138
  case 8:
186
- return gh(fg(ef(de(cd(bc(ab(a)))))));
139
+ return gh(fg(ef(de(cd(bc(ab(a2)))))));
187
140
  case 9:
188
- return hi(gh(fg(ef(de(cd(bc(ab(a))))))));
189
- default:
190
- {
191
- let ret = arguments[0];
192
- for (let i = 1; i < arguments.length; i++) {
193
- ret = arguments[i](ret);
194
- }
195
- return ret;
141
+ return hi(gh(fg(ef(de(cd(bc(ab(a2))))))));
142
+ default: {
143
+ let ret = arguments[0];
144
+ for (let i2 = 1; i2 < arguments.length; i2++) {
145
+ ret = arguments[i2](ret);
196
146
  }
147
+ return ret;
148
+ }
197
149
  }
198
150
  }
151
+ function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
152
+ switch (arguments.length) {
153
+ case 1:
154
+ return ab;
155
+ case 2:
156
+ return function() {
157
+ return bc(ab.apply(this, arguments));
158
+ };
159
+ case 3:
160
+ return function() {
161
+ return cd(bc(ab.apply(this, arguments)));
162
+ };
163
+ case 4:
164
+ return function() {
165
+ return de(cd(bc(ab.apply(this, arguments))));
166
+ };
167
+ case 5:
168
+ return function() {
169
+ return ef(de(cd(bc(ab.apply(this, arguments)))));
170
+ };
171
+ case 6:
172
+ return function() {
173
+ return fg(ef(de(cd(bc(ab.apply(this, arguments))))));
174
+ };
175
+ case 7:
176
+ return function() {
177
+ return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));
178
+ };
179
+ case 8:
180
+ return function() {
181
+ return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));
182
+ };
183
+ case 9:
184
+ return function() {
185
+ return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));
186
+ };
187
+ }
188
+ return;
189
+ }
190
+ var hole = /* @__PURE__ */ unsafeCoerce(absurd);
191
+ var SK = (_2, b2) => b2;
199
192
 
200
- const moduleVersion = "2.3.1";
193
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/internal/version.js
194
+ var moduleVersion = "2.3.3";
201
195
 
202
- /**
203
- * @since 2.0.0
204
- */
205
- const globalStoreId = /*#__PURE__*/Symbol.for(`effect/GlobalValue/globalStoreId/${moduleVersion}`);
196
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/GlobalValue.js
197
+ var globalStoreId = /* @__PURE__ */ Symbol.for(`effect/GlobalValue/globalStoreId/${moduleVersion}`);
206
198
  if (!(globalStoreId in globalThis)) {
207
- globalThis[globalStoreId] = /*#__PURE__*/new Map();
199
+ globalThis[globalStoreId] = /* @__PURE__ */ new Map();
208
200
  }
209
- const globalStore = globalThis[globalStoreId];
210
- /**
211
- * @since 2.0.0
212
- */
213
- const globalValue = (id, compute) => {
201
+ var globalStore = globalThis[globalStoreId];
202
+ var globalValue = (id, compute) => {
214
203
  if (!globalStore.has(id)) {
215
204
  globalStore.set(id, compute());
216
205
  }
217
206
  return globalStore.get(id);
218
207
  };
219
208
 
220
- /**
221
- * @since 2.0.0
222
- */
223
- /**
224
- * Tests if a value is a `string`.
225
- *
226
- * @param input - The value to test.
227
- *
228
- * @example
229
- * import { isString } from "effect/Predicate"
230
- *
231
- * assert.deepStrictEqual(isString("a"), true)
232
- *
233
- * assert.deepStrictEqual(isString(1), false)
234
- *
235
- * @category guards
236
- * @since 2.0.0
237
- */
238
- const isString = input => typeof input === "string";
239
- /**
240
- * Tests if a value is a `function`.
241
- *
242
- * @param input - The value to test.
243
- *
244
- * @example
245
- * import { isFunction } from "effect/Predicate"
246
- *
247
- * assert.deepStrictEqual(isFunction(isFunction), true)
248
- *
249
- * assert.deepStrictEqual(isFunction("function"), false)
250
- *
251
- * @category guards
252
- * @since 2.0.0
253
- */
254
- const isFunction = isFunction$1;
255
- const isRecordOrArray = input => typeof input === "object" && input !== null;
256
- /**
257
- * Tests if a value is an `object`.
258
- *
259
- * @param input - The value to test.
260
- *
261
- * @example
262
- * import { isObject } from "effect/Predicate"
263
- *
264
- * assert.deepStrictEqual(isObject({}), true)
265
- * assert.deepStrictEqual(isObject([]), true)
266
- *
267
- * assert.deepStrictEqual(isObject(null), false)
268
- * assert.deepStrictEqual(isObject(undefined), false)
269
- *
270
- * @category guards
271
- * @since 2.0.0
272
- */
273
- const isObject = input => isRecordOrArray(input) || isFunction(input);
274
- /**
275
- * Checks whether a value is an `object` containing a specified property key.
276
- *
277
- * @param property - The field to check within the object.
278
- * @param self - The value to examine.
279
- *
280
- * @category guards
281
- * @since 2.0.0
282
- */
283
- const hasProperty = /*#__PURE__*/dual(2, (self, property) => isObject(self) && property in self);
284
- /**
285
- * A guard that succeeds when the input is `null` or `undefined`.
286
- *
287
- * @param input - The value to test.
288
- *
289
- * @example
290
- * import { isNullable } from "effect/Predicate"
291
- *
292
- * assert.deepStrictEqual(isNullable(null), true)
293
- * assert.deepStrictEqual(isNullable(undefined), true)
294
- *
295
- * assert.deepStrictEqual(isNullable({}), false)
296
- * assert.deepStrictEqual(isNullable([]), false)
297
- *
298
- * @category guards
299
- * @since 2.0.0
300
- */
301
- const isNullable = input => input === null || input === undefined;
209
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/Predicate.js
210
+ var Predicate_exports = {};
211
+ __export(Predicate_exports, {
212
+ all: () => all,
213
+ and: () => and,
214
+ compose: () => compose2,
215
+ eqv: () => eqv,
216
+ every: () => every,
217
+ hasProperty: () => hasProperty,
218
+ implies: () => implies,
219
+ isBigInt: () => isBigInt,
220
+ isBoolean: () => isBoolean,
221
+ isDate: () => isDate,
222
+ isError: () => isError,
223
+ isFunction: () => isFunction2,
224
+ isIterable: () => isIterable,
225
+ isNever: () => isNever,
226
+ isNotNull: () => isNotNull,
227
+ isNotNullable: () => isNotNullable,
228
+ isNotUndefined: () => isNotUndefined,
229
+ isNull: () => isNull,
230
+ isNullable: () => isNullable,
231
+ isNumber: () => isNumber,
232
+ isObject: () => isObject,
233
+ isPromise: () => isPromise,
234
+ isReadonlyRecord: () => isReadonlyRecord,
235
+ isRecord: () => isRecord,
236
+ isString: () => isString,
237
+ isSymbol: () => isSymbol,
238
+ isTagged: () => isTagged,
239
+ isUint8Array: () => isUint8Array,
240
+ isUndefined: () => isUndefined,
241
+ isUnknown: () => isUnknown,
242
+ mapInput: () => mapInput,
243
+ nand: () => nand,
244
+ nor: () => nor,
245
+ not: () => not,
246
+ or: () => or,
247
+ product: () => product,
248
+ productMany: () => productMany,
249
+ some: () => some,
250
+ struct: () => struct,
251
+ tuple: () => tuple,
252
+ xor: () => xor
253
+ });
254
+ var mapInput = /* @__PURE__ */ dual(2, (self, f2) => (b2) => self(f2(b2)));
255
+ var isString = (input) => typeof input === "string";
256
+ var isNumber = (input) => typeof input === "number";
257
+ var isBoolean = (input) => typeof input === "boolean";
258
+ var isBigInt = (input) => typeof input === "bigint";
259
+ var isSymbol = (input) => typeof input === "symbol";
260
+ var isFunction2 = isFunction;
261
+ var isUndefined = (input) => input === void 0;
262
+ var isNotUndefined = (input) => input !== void 0;
263
+ var isNull = (input) => input === null;
264
+ var isNotNull = (input) => input !== null;
265
+ var isNever = (_2) => false;
266
+ var isUnknown = (_2) => true;
267
+ var isRecordOrArray = (input) => typeof input === "object" && input !== null;
268
+ var isObject = (input) => isRecordOrArray(input) || isFunction2(input);
269
+ var hasProperty = /* @__PURE__ */ dual(2, (self, property) => isObject(self) && property in self);
270
+ var isTagged = /* @__PURE__ */ dual(2, (self, tag) => hasProperty(self, "_tag") && self["_tag"] === tag);
271
+ var isNullable = (input) => input === null || input === void 0;
272
+ var isNotNullable = (input) => input !== null && input !== void 0;
273
+ var isError = (input) => input instanceof Error;
274
+ var isUint8Array = (input) => input instanceof Uint8Array;
275
+ var isDate = (input) => input instanceof Date;
276
+ var isIterable = (input) => hasProperty(input, Symbol.iterator);
277
+ var isRecord = (input) => isRecordOrArray(input) && !Array.isArray(input);
278
+ var isReadonlyRecord = isRecord;
279
+ var isPromise = (input) => hasProperty(input, "then") && "catch" in input && isFunction2(input.then) && isFunction2(input.catch);
280
+ var compose2 = /* @__PURE__ */ dual(2, (ab, bc) => (a2) => ab(a2) && bc(a2));
281
+ var product = (self, that) => ([a2, b2]) => self(a2) && that(b2);
282
+ var all = (collection) => {
283
+ return (as2) => {
284
+ let collectionIndex = 0;
285
+ for (const p2 of collection) {
286
+ if (collectionIndex >= as2.length) {
287
+ break;
288
+ }
289
+ if (p2(as2[collectionIndex]) === false) {
290
+ return false;
291
+ }
292
+ collectionIndex++;
293
+ }
294
+ return true;
295
+ };
296
+ };
297
+ var productMany = (self, collection) => {
298
+ const rest = all(collection);
299
+ return ([head, ...tail]) => self(head) === false ? false : rest(tail);
300
+ };
301
+ var tuple = (...elements) => all(elements);
302
+ var struct = (fields) => {
303
+ const keys = Object.keys(fields);
304
+ return (a2) => {
305
+ for (const key of keys) {
306
+ if (!fields[key](a2[key])) {
307
+ return false;
308
+ }
309
+ }
310
+ return true;
311
+ };
312
+ };
313
+ var not = (self) => (a2) => !self(a2);
314
+ var or = /* @__PURE__ */ dual(2, (self, that) => (a2) => self(a2) || that(a2));
315
+ var and = /* @__PURE__ */ dual(2, (self, that) => (a2) => self(a2) && that(a2));
316
+ var xor = /* @__PURE__ */ dual(2, (self, that) => (a2) => self(a2) !== that(a2));
317
+ var eqv = /* @__PURE__ */ dual(2, (self, that) => (a2) => self(a2) === that(a2));
318
+ var implies = /* @__PURE__ */ dual(2, (self, that) => (a2) => self(a2) ? that(a2) : true);
319
+ var nor = /* @__PURE__ */ dual(2, (self, that) => (a2) => !(self(a2) || that(a2)));
320
+ var nand = /* @__PURE__ */ dual(2, (self, that) => (a2) => !(self(a2) && that(a2)));
321
+ var every = (collection) => (a2) => {
322
+ for (const p2 of collection) {
323
+ if (!p2(a2)) {
324
+ return false;
325
+ }
326
+ }
327
+ return true;
328
+ };
329
+ var some = (collection) => (a2) => {
330
+ for (const p2 of collection) {
331
+ if (p2(a2)) {
332
+ return true;
333
+ }
334
+ }
335
+ return false;
336
+ };
302
337
 
303
- /**
304
- * @since 2.0.0
305
- */
306
- const defaultIncHi = 0x14057b7e;
307
- const defaultIncLo = 0xf767814f;
308
- const MUL_HI = 0x5851f42d >>> 0;
309
- const MUL_LO = 0x4c957f2d >>> 0;
310
- const BIT_53 = 9007199254740992.0;
311
- const BIT_27 = 134217728.0;
312
- /**
313
- * PCG is a family of simple fast space-efficient statistically good algorithms
314
- * for random number generation. Unlike many general-purpose RNGs, they are also
315
- * hard to predict.
316
- *
317
- * @category model
318
- * @since 2.0.0
319
- */
320
- class PCGRandom {
338
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/Utils.js
339
+ var GenKindTypeId = /* @__PURE__ */ Symbol.for("effect/Gen/GenKind");
340
+ var GenKindImpl = class {
341
+ value;
342
+ constructor(value) {
343
+ this.value = value;
344
+ }
345
+ /**
346
+ * @since 2.0.0
347
+ */
348
+ get _F() {
349
+ return identity;
350
+ }
351
+ /**
352
+ * @since 2.0.0
353
+ */
354
+ get _R() {
355
+ return (_2) => _2;
356
+ }
357
+ /**
358
+ * @since 2.0.0
359
+ */
360
+ get _O() {
361
+ return (_2) => _2;
362
+ }
363
+ /**
364
+ * @since 2.0.0
365
+ */
366
+ get _E() {
367
+ return (_2) => _2;
368
+ }
369
+ /**
370
+ * @since 2.0.0
371
+ */
372
+ [GenKindTypeId] = GenKindTypeId;
373
+ /**
374
+ * @since 2.0.0
375
+ */
376
+ [Symbol.iterator]() {
377
+ return new SingleShotGen(this);
378
+ }
379
+ };
380
+ var SingleShotGen = class _SingleShotGen {
381
+ self;
382
+ called = false;
383
+ constructor(self) {
384
+ this.self = self;
385
+ }
386
+ /**
387
+ * @since 2.0.0
388
+ */
389
+ next(a2) {
390
+ return this.called ? {
391
+ value: a2,
392
+ done: true
393
+ } : (this.called = true, {
394
+ value: this.self,
395
+ done: false
396
+ });
397
+ }
398
+ /**
399
+ * @since 2.0.0
400
+ */
401
+ return(a2) {
402
+ return {
403
+ value: a2,
404
+ done: true
405
+ };
406
+ }
407
+ /**
408
+ * @since 2.0.0
409
+ */
410
+ throw(e2) {
411
+ throw e2;
412
+ }
413
+ /**
414
+ * @since 2.0.0
415
+ */
416
+ [Symbol.iterator]() {
417
+ return new _SingleShotGen(this.self);
418
+ }
419
+ };
420
+ var adapter = () => (
421
+ // @ts-expect-error
422
+ function() {
423
+ let x2 = arguments[0];
424
+ for (let i2 = 1; i2 < arguments.length; i2++) {
425
+ x2 = arguments[i2](x2);
426
+ }
427
+ return new GenKindImpl(x2);
428
+ }
429
+ );
430
+ var defaultIncHi = 335903614;
431
+ var defaultIncLo = 4150755663;
432
+ var MUL_HI = 1481765933 >>> 0;
433
+ var MUL_LO = 1284865837 >>> 0;
434
+ var BIT_53 = 9007199254740992;
435
+ var BIT_27 = 134217728;
436
+ var PCGRandom = class {
321
437
  _state;
322
438
  constructor(seedHi, seedLo, incHi, incLo) {
323
439
  if (isNullable(seedLo) && isNullable(seedHi)) {
324
- seedLo = Math.random() * 0xffffffff >>> 0;
440
+ seedLo = Math.random() * 4294967295 >>> 0;
325
441
  seedHi = 0;
326
442
  } else if (isNullable(seedLo)) {
327
443
  seedLo = seedHi;
@@ -373,13 +489,11 @@ class PCGRandom {
373
489
  }
374
490
  max = max >>> 0;
375
491
  if ((max & max - 1) === 0) {
376
- return this._next() & max - 1; // fast path for power of 2
492
+ return this._next() & max - 1;
377
493
  }
378
494
  let num = 0;
379
495
  const skew = (-max >>> 0) % max >>> 0;
380
496
  for (num = this._next(); num < skew; num = this._next()) {
381
- // this loop will rarely execute more than twice,
382
- // and is intentionally empty
383
497
  }
384
498
  return num % max;
385
499
  }
@@ -391,35 +505,30 @@ class PCGRandom {
391
505
  * @since 2.0.0
392
506
  */
393
507
  number() {
394
- const hi = (this._next() & 0x03ffffff) * 1.0;
395
- const lo = (this._next() & 0x07ffffff) * 1.0;
508
+ const hi = (this._next() & 67108863) * 1;
509
+ const lo = (this._next() & 134217727) * 1;
396
510
  return (hi * BIT_27 + lo) / BIT_53;
397
511
  }
398
512
  /** @internal */
399
513
  _next() {
400
- // save current state (what we'll use for this number)
401
514
  const oldHi = this._state[0] >>> 0;
402
515
  const oldLo = this._state[1] >>> 0;
403
- // churn LCG.
404
516
  mul64(this._state, oldHi, oldLo, MUL_HI, MUL_LO);
405
517
  add64(this._state, this._state[0], this._state[1], this._state[2], this._state[3]);
406
- // get least sig. 32 bits of ((oldstate >> 18) ^ oldstate) >> 27
407
518
  let xsHi = oldHi >>> 18;
408
519
  let xsLo = (oldLo >>> 18 | oldHi << 14) >>> 0;
409
520
  xsHi = (xsHi ^ oldHi) >>> 0;
410
521
  xsLo = (xsLo ^ oldLo) >>> 0;
411
522
  const xorshifted = (xsLo >>> 27 | xsHi << 5) >>> 0;
412
- // rotate xorshifted right a random amount, based on the most sig. 5 bits
413
- // bits of the old state.
414
523
  const rot = oldHi >>> 27;
415
524
  const rot2 = (-rot >>> 0 & 31) >>> 0;
416
525
  return (xorshifted >>> rot | xorshifted << rot2) >>> 0;
417
526
  }
418
- }
527
+ };
419
528
  function mul64(out, aHi, aLo, bHi, bLo) {
420
- let c1 = (aLo >>> 16) * (bLo & 0xffff) >>> 0;
421
- let c0 = (aLo & 0xffff) * (bLo >>> 16) >>> 0;
422
- let lo = (aLo & 0xffff) * (bLo & 0xffff) >>> 0;
529
+ let c1 = (aLo >>> 16) * (bLo & 65535) >>> 0;
530
+ let c0 = (aLo & 65535) * (bLo >>> 16) >>> 0;
531
+ let lo = (aLo & 65535) * (bLo & 65535) >>> 0;
423
532
  let hi = (aLo >>> 16) * (bLo >>> 16) + ((c0 >>> 16) + (c1 >>> 16)) >>> 0;
424
533
  c0 = c0 << 16 >>> 0;
425
534
  lo = lo + c0 >>> 0;
@@ -436,7 +545,6 @@ function mul64(out, aHi, aLo, bHi, bLo) {
436
545
  out[0] = hi;
437
546
  out[1] = lo;
438
547
  }
439
- // add two 64 bit numbers (given in parts), and store the result in `out`.
440
548
  function add64(out, aHi, aLo, bHi, bLo) {
441
549
  let hi = aHi + bHi >>> 0;
442
550
  const lo = aLo + bLo >>> 0;
@@ -447,23 +555,11 @@ function add64(out, aHi, aLo, bHi, bLo) {
447
555
  out[1] = lo;
448
556
  }
449
557
 
450
- /**
451
- * @since 2.0.0
452
- */
453
- /** @internal */
454
- const randomHashCache = /*#__PURE__*/globalValue( /*#__PURE__*/Symbol.for("effect/Hash/randomHashCache"), () => new WeakMap());
455
- /** @internal */
456
- const pcgr = /*#__PURE__*/globalValue( /*#__PURE__*/Symbol.for("effect/Hash/pcgr"), () => new PCGRandom());
457
- /**
458
- * @since 2.0.0
459
- * @category symbols
460
- */
461
- const symbol$1 = /*#__PURE__*/Symbol.for("effect/Hash");
462
- /**
463
- * @since 2.0.0
464
- * @category hashing
465
- */
466
- const hash = self => {
558
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/Hash.js
559
+ var randomHashCache = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/randomHashCache"), () => /* @__PURE__ */ new WeakMap());
560
+ var pcgr = /* @__PURE__ */ globalValue(/* @__PURE__ */ Symbol.for("effect/Hash/pcgr"), () => new PCGRandom());
561
+ var symbol = /* @__PURE__ */ Symbol.for("effect/Hash");
562
+ var hash = (self) => {
467
563
  switch (typeof self) {
468
564
  case "number":
469
565
  return number(self);
@@ -478,84 +574,55 @@ const hash = self => {
478
574
  case "undefined":
479
575
  return string("undefined");
480
576
  case "function":
481
- case "object":
482
- {
483
- if (self === null) {
484
- return string("null");
485
- }
486
- if (isHash(self)) {
487
- return self[symbol$1]();
488
- } else {
489
- return random(self);
490
- }
577
+ case "object": {
578
+ if (self === null) {
579
+ return string("null");
491
580
  }
581
+ if (isHash(self)) {
582
+ return self[symbol]();
583
+ } else {
584
+ return random(self);
585
+ }
586
+ }
492
587
  default:
493
588
  throw new Error(`BUG: unhandled typeof ${typeof self} - please report an issue at https://github.com/Effect-TS/effect/issues`);
494
589
  }
495
590
  };
496
- /**
497
- * @since 2.0.0
498
- * @category hashing
499
- */
500
- const random = self => {
591
+ var random = (self) => {
501
592
  if (!randomHashCache.has(self)) {
502
593
  randomHashCache.set(self, number(pcgr.integer(Number.MAX_SAFE_INTEGER)));
503
594
  }
504
595
  return randomHashCache.get(self);
505
596
  };
506
- /**
507
- * @since 2.0.0
508
- * @category hashing
509
- */
510
- const combine = b => self => self * 53 ^ b;
511
- /**
512
- * @since 2.0.0
513
- * @category hashing
514
- */
515
- const optimize = n => n & 0xbfffffff | n >>> 1 & 0x40000000;
516
- /**
517
- * @since 2.0.0
518
- * @category guards
519
- */
520
- const isHash = u => hasProperty(u, symbol$1);
521
- /**
522
- * @since 2.0.0
523
- * @category hashing
524
- */
525
- const number = n => {
526
- if (n !== n || n === Infinity) {
597
+ var combine = (b2) => (self) => self * 53 ^ b2;
598
+ var optimize = (n2) => n2 & 3221225471 | n2 >>> 1 & 1073741824;
599
+ var isHash = (u2) => hasProperty(u2, symbol);
600
+ var number = (n2) => {
601
+ if (n2 !== n2 || n2 === Infinity) {
527
602
  return 0;
528
603
  }
529
- let h = n | 0;
530
- if (h !== n) {
531
- h ^= n * 0xffffffff;
604
+ let h2 = n2 | 0;
605
+ if (h2 !== n2) {
606
+ h2 ^= n2 * 4294967295;
532
607
  }
533
- while (n > 0xffffffff) {
534
- h ^= n /= 0xffffffff;
608
+ while (n2 > 4294967295) {
609
+ h2 ^= n2 /= 4294967295;
535
610
  }
536
- return optimize(n);
611
+ return optimize(n2);
537
612
  };
538
- /**
539
- * @since 2.0.0
540
- * @category hashing
541
- */
542
- const string = str => {
543
- let h = 5381,
544
- i = str.length;
545
- while (i) {
546
- h = h * 33 ^ str.charCodeAt(--i);
547
- }
548
- return optimize(h);
613
+ var string = (str) => {
614
+ let h2 = 5381, i2 = str.length;
615
+ while (i2) {
616
+ h2 = h2 * 33 ^ str.charCodeAt(--i2);
617
+ }
618
+ return optimize(h2);
549
619
  };
550
620
 
551
- /**
552
- * @since 2.0.0
553
- * @category symbols
554
- */
555
- const symbol = /*#__PURE__*/Symbol.for("effect/Equal");
621
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/Equal.js
622
+ var symbol2 = /* @__PURE__ */ Symbol.for("effect/Equal");
556
623
  function equals() {
557
624
  if (arguments.length === 1) {
558
- return self => compareBoth(self, arguments[0]);
625
+ return (self) => compareBoth(self, arguments[0]);
559
626
  }
560
627
  return compareBoth(arguments[0], arguments[1]);
561
628
  }
@@ -569,48 +636,93 @@ function compareBoth(self, that) {
569
636
  }
570
637
  if ((selfType === "object" || selfType === "function") && self !== null && that !== null) {
571
638
  if (isEqual(self) && isEqual(that)) {
572
- return hash(self) === hash(that) && self[symbol](that);
639
+ return hash(self) === hash(that) && self[symbol2](that);
573
640
  }
574
641
  }
575
642
  return false;
576
643
  }
577
- /**
578
- * @since 2.0.0
579
- * @category guards
580
- */
581
- const isEqual = u => hasProperty(u, symbol);
644
+ var isEqual = (u2) => hasProperty(u2, symbol2);
645
+ var equivalence = () => (self, that) => equals(self, that);
582
646
 
583
- /**
584
- * @since 2.0.0
585
- */
586
- /**
587
- * @since 2.0.0
588
- * @category symbols
589
- */
590
- const NodeInspectSymbol = /*#__PURE__*/Symbol.for("nodejs.util.inspect.custom");
591
- /**
592
- * @since 2.0.0
593
- */
594
- const toJSON = x => {
595
- if (hasProperty(x, "toJSON") && isFunction(x["toJSON"]) && x["toJSON"].length === 0) {
596
- return x.toJSON();
597
- } else if (Array.isArray(x)) {
598
- return x.map(toJSON);
599
- }
600
- return x;
647
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/Equivalence.js
648
+ var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
649
+
650
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/Inspectable.js
651
+ var NodeInspectSymbol = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom");
652
+ var toJSON = (x2) => {
653
+ if (hasProperty(x2, "toJSON") && isFunction2(x2["toJSON"]) && x2["toJSON"].length === 0) {
654
+ return x2.toJSON();
655
+ } else if (Array.isArray(x2)) {
656
+ return x2.map(toJSON);
657
+ }
658
+ return x2;
601
659
  };
602
- /**
603
- * @since 2.0.0
604
- */
605
- const format = x => JSON.stringify(x, null, 2);
660
+ var format = (x2) => JSON.stringify(x2, null, 2);
606
661
 
607
- /**
608
- * @since 2.0.0
609
- */
610
- /**
611
- * @since 2.0.0
612
- */
613
- const pipeArguments = (self, args) => {
662
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/Option.js
663
+ var Option_exports = {};
664
+ __export(Option_exports, {
665
+ Do: () => Do,
666
+ TypeId: () => TypeId3,
667
+ all: () => all2,
668
+ andThen: () => andThen,
669
+ ap: () => ap,
670
+ as: () => as,
671
+ asUnit: () => asUnit,
672
+ bind: () => bind,
673
+ bindTo: () => bindTo,
674
+ composeK: () => composeK,
675
+ contains: () => contains,
676
+ containsWith: () => containsWith,
677
+ exists: () => exists,
678
+ filter: () => filter,
679
+ filterMap: () => filterMap,
680
+ firstSomeOf: () => firstSomeOf,
681
+ flatMap: () => flatMap,
682
+ flatMapNullable: () => flatMapNullable,
683
+ flatten: () => flatten,
684
+ fromIterable: () => fromIterable,
685
+ fromNullable: () => fromNullable,
686
+ gen: () => gen,
687
+ getEquivalence: () => getEquivalence,
688
+ getLeft: () => getLeft2,
689
+ getOrElse: () => getOrElse,
690
+ getOrNull: () => getOrNull,
691
+ getOrThrow: () => getOrThrow,
692
+ getOrThrowWith: () => getOrThrowWith,
693
+ getOrUndefined: () => getOrUndefined,
694
+ getOrder: () => getOrder,
695
+ getRight: () => getRight2,
696
+ isNone: () => isNone2,
697
+ isOption: () => isOption2,
698
+ isSome: () => isSome2,
699
+ let: () => let_,
700
+ lift2: () => lift2,
701
+ liftNullable: () => liftNullable,
702
+ liftPredicate: () => liftPredicate,
703
+ liftThrowable: () => liftThrowable,
704
+ map: () => map,
705
+ match: () => match,
706
+ none: () => none2,
707
+ orElse: () => orElse,
708
+ orElseEither: () => orElseEither,
709
+ orElseSome: () => orElseSome,
710
+ partitionMap: () => partitionMap,
711
+ product: () => product2,
712
+ productMany: () => productMany2,
713
+ reduceCompact: () => reduceCompact,
714
+ some: () => some3,
715
+ tap: () => tap,
716
+ toArray: () => toArray,
717
+ toRefinement: () => toRefinement,
718
+ unit: () => unit,
719
+ zipLeft: () => zipLeft,
720
+ zipRight: () => zipRight,
721
+ zipWith: () => zipWith
722
+ });
723
+
724
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/Pipeable.js
725
+ var pipeArguments = (self, args) => {
614
726
  switch (args.length) {
615
727
  case 1:
616
728
  return args[0](self);
@@ -630,73 +742,67 @@ const pipeArguments = (self, args) => {
630
742
  return args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self))))))));
631
743
  case 9:
632
744
  return args[8](args[7](args[6](args[5](args[4](args[3](args[2](args[1](args[0](self)))))))));
633
- default:
634
- {
635
- let ret = self;
636
- for (let i = 0, len = args.length; i < len; i++) {
637
- ret = args[i](ret);
638
- }
639
- return ret;
745
+ default: {
746
+ let ret = self;
747
+ for (let i2 = 0, len = args.length; i2 < len; i2++) {
748
+ ret = args[i2](ret);
640
749
  }
750
+ return ret;
751
+ }
641
752
  }
642
753
  };
643
754
 
644
- /** @internal */
645
- const EffectTypeId = /*#__PURE__*/Symbol.for("effect/Effect");
646
- /** @internal */
647
- const StreamTypeId = /*#__PURE__*/Symbol.for("effect/Stream");
648
- /** @internal */
649
- const SinkTypeId = /*#__PURE__*/Symbol.for("effect/Sink");
650
- /** @internal */
651
- const ChannelTypeId = /*#__PURE__*/Symbol.for("effect/Channel");
652
- /** @internal */
653
- const effectVariance = {
755
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/internal/effectable.js
756
+ var EffectTypeId = /* @__PURE__ */ Symbol.for("effect/Effect");
757
+ var StreamTypeId = /* @__PURE__ */ Symbol.for("effect/Stream");
758
+ var SinkTypeId = /* @__PURE__ */ Symbol.for("effect/Sink");
759
+ var ChannelTypeId = /* @__PURE__ */ Symbol.for("effect/Channel");
760
+ var effectVariance = {
654
761
  /* c8 ignore next */
655
- _R: _ => _,
762
+ _R: (_2) => _2,
656
763
  /* c8 ignore next */
657
- _E: _ => _,
764
+ _E: (_2) => _2,
658
765
  /* c8 ignore next */
659
- _A: _ => _,
766
+ _A: (_2) => _2,
660
767
  _V: moduleVersion
661
768
  };
662
- const sinkVariance = {
769
+ var sinkVariance = {
663
770
  /* c8 ignore next */
664
- _A: _ => _,
771
+ _A: (_2) => _2,
665
772
  /* c8 ignore next */
666
- _In: _ => _,
773
+ _In: (_2) => _2,
667
774
  /* c8 ignore next */
668
- _L: _ => _,
775
+ _L: (_2) => _2,
669
776
  /* c8 ignore next */
670
- _E: _ => _,
777
+ _E: (_2) => _2,
671
778
  /* c8 ignore next */
672
- _R: _ => _
779
+ _R: (_2) => _2
673
780
  };
674
- const channelVariance = {
781
+ var channelVariance = {
675
782
  /* c8 ignore next */
676
- _Env: _ => _,
783
+ _Env: (_2) => _2,
677
784
  /* c8 ignore next */
678
- _InErr: _ => _,
785
+ _InErr: (_2) => _2,
679
786
  /* c8 ignore next */
680
- _InElem: _ => _,
787
+ _InElem: (_2) => _2,
681
788
  /* c8 ignore next */
682
- _InDone: _ => _,
789
+ _InDone: (_2) => _2,
683
790
  /* c8 ignore next */
684
- _OutErr: _ => _,
791
+ _OutErr: (_2) => _2,
685
792
  /* c8 ignore next */
686
- _OutElem: _ => _,
793
+ _OutElem: (_2) => _2,
687
794
  /* c8 ignore next */
688
- _OutDone: _ => _
795
+ _OutDone: (_2) => _2
689
796
  };
690
- /** @internal */
691
- const EffectPrototype = {
797
+ var EffectPrototype = {
692
798
  [EffectTypeId]: effectVariance,
693
799
  [StreamTypeId]: effectVariance,
694
800
  [SinkTypeId]: sinkVariance,
695
801
  [ChannelTypeId]: channelVariance,
696
- [symbol](that) {
802
+ [symbol2](that) {
697
803
  return this === that;
698
804
  },
699
- [symbol$1]() {
805
+ [symbol]() {
700
806
  return random(this);
701
807
  },
702
808
  pipe() {
@@ -704,14 +810,12 @@ const EffectPrototype = {
704
810
  }
705
811
  };
706
812
 
707
- /**
708
- * @since 2.0.0
709
- */
710
- const TypeId = /*#__PURE__*/Symbol.for("effect/Option");
711
- const CommonProto = {
813
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/internal/option.js
814
+ var TypeId = /* @__PURE__ */ Symbol.for("effect/Option");
815
+ var CommonProto = {
712
816
  ...EffectPrototype,
713
817
  [TypeId]: {
714
- _A: _ => _
818
+ _A: (_2) => _2
715
819
  },
716
820
  [NodeInspectSymbol]() {
717
821
  return this.toJSON();
@@ -720,13 +824,13 @@ const CommonProto = {
720
824
  return format(this.toJSON());
721
825
  }
722
826
  };
723
- const SomeProto = /*#__PURE__*/Object.assign( /*#__PURE__*/Object.create(CommonProto), {
827
+ var SomeProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto), {
724
828
  _tag: "Some",
725
829
  _op: "Some",
726
- [symbol](that) {
727
- return isOption(that) && isSome$1(that) && equals(that.value, this.value);
830
+ [symbol2](that) {
831
+ return isOption(that) && isSome(that) && equals(that.value, this.value);
728
832
  },
729
- [symbol$1]() {
833
+ [symbol]() {
730
834
  return combine(hash(this._tag))(hash(this.value));
731
835
  },
732
836
  toJSON() {
@@ -737,13 +841,13 @@ const SomeProto = /*#__PURE__*/Object.assign( /*#__PURE__*/Object.create(CommonP
737
841
  };
738
842
  }
739
843
  });
740
- const NoneProto = /*#__PURE__*/Object.assign( /*#__PURE__*/Object.create(CommonProto), {
844
+ var NoneProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto), {
741
845
  _tag: "None",
742
846
  _op: "None",
743
- [symbol](that) {
744
- return isOption(that) && isNone$1(that);
847
+ [symbol2](that) {
848
+ return isOption(that) && isNone(that);
745
849
  },
746
- [symbol$1]() {
850
+ [symbol]() {
747
851
  return combine(hash(this._tag));
748
852
  },
749
853
  toJSON() {
@@ -753,865 +857,902 @@ const NoneProto = /*#__PURE__*/Object.assign( /*#__PURE__*/Object.create(CommonP
753
857
  };
754
858
  }
755
859
  });
756
- /** @internal */
757
- const isOption = input => hasProperty(input, TypeId);
758
- /** @internal */
759
- const isNone$1 = fa => fa._tag === "None";
760
- /** @internal */
761
- const isSome$1 = fa => fa._tag === "Some";
762
- /** @internal */
763
- const none$1 = /*#__PURE__*/Object.create(NoneProto);
764
- /** @internal */
765
- const some$1 = value => {
766
- const a = Object.create(SomeProto);
767
- a.value = value;
768
- return a;
860
+ var isOption = (input) => hasProperty(input, TypeId);
861
+ var isNone = (fa) => fa._tag === "None";
862
+ var isSome = (fa) => fa._tag === "Some";
863
+ var none = /* @__PURE__ */ Object.create(NoneProto);
864
+ var some2 = (value) => {
865
+ const a2 = Object.create(SomeProto);
866
+ a2.value = value;
867
+ return a2;
769
868
  };
770
869
 
771
- /**
772
- * Creates a new `Option` that represents the absence of a value.
773
- *
774
- * @category constructors
775
- * @since 2.0.0
776
- */
777
- const none = () => none$1;
778
- /**
779
- * Creates a new `Option` that wraps the given value.
780
- *
781
- * @param value - The value to wrap.
782
- *
783
- * @category constructors
784
- * @since 2.0.0
785
- */
786
- const some = some$1;
787
- /**
788
- * Determine if a `Option` is a `None`.
789
- *
790
- * @param self - The `Option` to check.
791
- *
792
- * @example
793
- * import { some, none, isNone } from 'effect/Option'
794
- *
795
- * assert.deepStrictEqual(isNone(some(1)), false)
796
- * assert.deepStrictEqual(isNone(none()), true)
797
- *
798
- * @category guards
799
- * @since 2.0.0
800
- */
801
- const isNone = isNone$1;
802
- /**
803
- * Determine if a `Option` is a `Some`.
804
- *
805
- * @param self - The `Option` to check.
806
- *
807
- * @example
808
- * import { some, none, isSome } from 'effect/Option'
809
- *
810
- * assert.deepStrictEqual(isSome(some(1)), true)
811
- * assert.deepStrictEqual(isSome(none()), false)
812
- *
813
- * @category guards
814
- * @since 2.0.0
815
- */
816
- const isSome = isSome$1;
817
- /**
818
- * Returns the value of the `Option` if it is `Some`, otherwise returns `onNone`
819
- *
820
- * @param self - The `Option` to get the value of.
821
- * @param onNone - Function that returns the default value to return if the `Option` is `None`.
822
- *
823
- * @example
824
- * import { some, none, getOrElse } from 'effect/Option'
825
- * import { pipe } from "effect/Function"
826
- *
827
- * assert.deepStrictEqual(pipe(some(1), getOrElse(() => 0)), 1)
828
- * assert.deepStrictEqual(pipe(none(), getOrElse(() => 0)), 0)
829
- *
830
- * @category getters
831
- * @since 2.0.0
832
- */
833
- const getOrElse = /*#__PURE__*/dual(2, (self, onNone) => isNone(self) ? onNone() : self.value);
834
- /**
835
- * Returns the provided `Option` `that` if `self` is `None`, otherwise returns `self`.
836
- *
837
- * @param self - The first `Option` to be checked.
838
- * @param that - The `Option` to return if `self` is `None`.
839
- *
840
- * @example
841
- * import * as O from "effect/Option"
842
- * import { pipe } from "effect/Function"
843
- *
844
- * assert.deepStrictEqual(
845
- * pipe(
846
- * O.none(),
847
- * O.orElse(() => O.none())
848
- * ),
849
- * O.none()
850
- * )
851
- * assert.deepStrictEqual(
852
- * pipe(
853
- * O.some('a'),
854
- * O.orElse(() => O.none())
855
- * ),
856
- * O.some('a')
857
- * )
858
- * assert.deepStrictEqual(
859
- * pipe(
860
- * O.none(),
861
- * O.orElse(() => O.some('b'))
862
- * ),
863
- * O.some('b')
864
- * )
865
- * assert.deepStrictEqual(
866
- * pipe(
867
- * O.some('a'),
868
- * O.orElse(() => O.some('b'))
869
- * ),
870
- * O.some('a')
871
- * )
872
- *
873
- * @category error handling
874
- * @since 2.0.0
875
- */
876
- const orElse = /*#__PURE__*/dual(2, (self, that) => isNone(self) ? that() : self);
877
- /**
878
- * Constructs a new `Option` from a nullable type. If the value is `null` or `undefined`, returns `None`, otherwise
879
- * returns the value wrapped in a `Some`.
880
- *
881
- * @param nullableValue - The nullable value to be converted to an `Option`.
882
- *
883
- * @example
884
- * import * as O from "effect/Option"
885
- *
886
- * assert.deepStrictEqual(O.fromNullable(undefined), O.none())
887
- * assert.deepStrictEqual(O.fromNullable(null), O.none())
888
- * assert.deepStrictEqual(O.fromNullable(1), O.some(1))
889
- *
890
- * @category conversions
891
- * @since 2.0.0
892
- */
893
- const fromNullable = nullableValue => nullableValue == null ? none() : some(nullableValue);
894
- /**
895
- * Maps the `Some` side of an `Option` value to a new `Option` value.
896
- *
897
- * @param self - An `Option` to map
898
- * @param f - The function to map over the value of the `Option`
899
- *
900
- * @category mapping
901
- * @since 2.0.0
902
- */
903
- const map = /*#__PURE__*/dual(2, (self, f) => isNone(self) ? none() : some(f(self.value)));
904
- /**
905
- * Applies a function to the value of an `Option` and flattens the result, if the input is `Some`.
906
- *
907
- * @category sequencing
908
- * @since 2.0.0
909
- */
910
- const flatMap = /*#__PURE__*/dual(2, (self, f) => isNone(self) ? none() : f(self.value));
911
- /**
912
- * This is `flatMap` + `fromNullable`, useful when working with optional values.
913
- *
914
- * @example
915
- * import { some, none, flatMapNullable } from 'effect/Option'
916
- * import { pipe } from "effect/Function"
917
- *
918
- * interface Employee {
919
- * company?: {
920
- * address?: {
921
- * street?: {
922
- * name?: string
923
- * }
924
- * }
925
- * }
926
- * }
927
- *
928
- * const employee1: Employee = { company: { address: { street: { name: 'high street' } } } }
929
- *
930
- * assert.deepStrictEqual(
931
- * pipe(
932
- * some(employee1),
933
- * flatMapNullable(employee => employee.company?.address?.street?.name),
934
- * ),
935
- * some('high street')
936
- * )
937
- *
938
- * const employee2: Employee = { company: { address: { street: {} } } }
939
- *
940
- * assert.deepStrictEqual(
941
- * pipe(
942
- * some(employee2),
943
- * flatMapNullable(employee => employee.company?.address?.street?.name),
944
- * ),
945
- * none()
946
- * )
947
- *
948
- * @category sequencing
949
- * @since 2.0.0
950
- */
951
- const flatMapNullable = /*#__PURE__*/dual(2, (self, f) => isNone(self) ? none() : fromNullable(f(self.value)));
952
- /**
953
- * @category combining
954
- * @since 2.0.0
955
- */
956
- const product = (self, that) => isSome(self) && isSome(that) ? some([self.value, that.value]) : none();
957
- /**
958
- * Zips two `Option` values together using a provided function, returning a new `Option` of the result.
959
- *
960
- * @param self - The left-hand side of the zip operation
961
- * @param that - The right-hand side of the zip operation
962
- * @param f - The function used to combine the values of the two `Option`s
963
- *
964
- * @example
965
- * import * as O from "effect/Option"
966
- *
967
- * type Complex = [real: number, imaginary: number]
968
- *
969
- * const complex = (real: number, imaginary: number): Complex => [real, imaginary]
970
- *
971
- * assert.deepStrictEqual(O.zipWith(O.none(), O.none(), complex), O.none())
972
- * assert.deepStrictEqual(O.zipWith(O.some(1), O.none(), complex), O.none())
973
- * assert.deepStrictEqual(O.zipWith(O.none(), O.some(1), complex), O.none())
974
- * assert.deepStrictEqual(O.zipWith(O.some(1), O.some(2), complex), O.some([1, 2]))
975
- *
976
- * assert.deepStrictEqual(O.zipWith(O.some(1), complex)(O.some(2)), O.some([2, 1]))
977
- *
978
- * @category zipping
979
- * @since 2.0.0
980
- */
981
- const zipWith = /*#__PURE__*/dual(3, (self, that, f) => map(product(self, that), ([a, b]) => f(a, b)));
982
- /**
983
- * Maps over the value of an `Option` and filters out `None`s.
984
- *
985
- * Useful when in addition to filtering you also want to change the type of the `Option`.
986
- *
987
- * @param self - The `Option` to map over.
988
- * @param f - A function to apply to the value of the `Option`.
989
- *
990
- * @example
991
- * import * as O from "effect/Option"
992
- *
993
- * const evenNumber = (n: number) => n % 2 === 0 ? O.some(n) : O.none()
994
- *
995
- * assert.deepStrictEqual(O.filterMap(O.none(), evenNumber), O.none())
996
- * assert.deepStrictEqual(O.filterMap(O.some(3), evenNumber), O.none())
997
- * assert.deepStrictEqual(O.filterMap(O.some(2), evenNumber), O.some(2))
998
- *
999
- * @category filtering
1000
- * @since 2.0.0
1001
- */
1002
- const filterMap = /*#__PURE__*/dual(2, (self, f) => isNone(self) ? none() : f(self.value));
1003
- /**
1004
- * Filters an `Option` using a predicate. If the predicate is not satisfied or the `Option` is `None` returns `None`.
1005
- *
1006
- * If you need to change the type of the `Option` in addition to filtering, see `filterMap`.
1007
- *
1008
- * @param predicate - A predicate function to apply to the `Option` value.
1009
- * @param fb - The `Option` to filter.
1010
- *
1011
- * @example
1012
- * import * as O from "effect/Option"
1013
- *
1014
- * // predicate
1015
- * const isEven = (n: number) => n % 2 === 0
1016
- *
1017
- * assert.deepStrictEqual(O.filter(O.none(), isEven), O.none())
1018
- * assert.deepStrictEqual(O.filter(O.some(3), isEven), O.none())
1019
- * assert.deepStrictEqual(O.filter(O.some(2), isEven), O.some(2))
1020
- *
1021
- * // refinement
1022
- * const isNumber = (v: unknown): v is number => typeof v === "number"
1023
- *
1024
- * assert.deepStrictEqual(O.filter(O.none(), isNumber), O.none())
1025
- * assert.deepStrictEqual(O.filter(O.some('hello'), isNumber), O.none())
1026
- * assert.deepStrictEqual(O.filter(O.some(2), isNumber), O.some(2))
1027
- *
1028
- * @category filtering
1029
- * @since 2.0.0
1030
- */
1031
- const filter = /*#__PURE__*/dual(2, (self, predicate) => filterMap(self, b => predicate(b) ? some$1(b) : none$1));
1032
- /**
1033
- * Transforms a `Predicate` function into a `Some` of the input value if the predicate returns `true` or `None`
1034
- * if the predicate returns `false`.
1035
- *
1036
- * @param predicate - A `Predicate` function that takes in a value of type `A` and returns a boolean.
1037
- *
1038
- * @example
1039
- * import * as O from "effect/Option"
1040
- *
1041
- * const getOption = O.liftPredicate((n: number) => n >= 0)
1042
- *
1043
- * assert.deepStrictEqual(getOption(-1), O.none())
1044
- * assert.deepStrictEqual(getOption(1), O.some(1))
1045
- *
1046
- * @category lifting
1047
- * @since 2.0.0
1048
- */
1049
- const liftPredicate = predicate => b => predicate(b) ? some(b) : none();
1050
- /**
1051
- * Check if a value in an `Option` type meets a certain predicate.
1052
- *
1053
- * @param self - The `Option` to check.
1054
- * @param predicate - The condition to check.
1055
- *
1056
- * @example
1057
- * import { some, none, exists } from 'effect/Option'
1058
- * import { pipe } from "effect/Function"
1059
- *
1060
- * const isEven = (n: number) => n % 2 === 0
1061
- *
1062
- * assert.deepStrictEqual(pipe(some(2), exists(isEven)), true)
1063
- * assert.deepStrictEqual(pipe(some(1), exists(isEven)), false)
1064
- * assert.deepStrictEqual(pipe(none(), exists(isEven)), false)
1065
- *
1066
- * @since 2.0.0
1067
- */
1068
- const exists = /*#__PURE__*/dual(2, (self, refinement) => isNone(self) ? false : refinement(self.value));
870
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/internal/either.js
871
+ var TypeId2 = /* @__PURE__ */ Symbol.for("effect/Either");
872
+ var CommonProto2 = {
873
+ ...EffectPrototype,
874
+ [TypeId2]: {
875
+ _A: (_2) => _2
876
+ },
877
+ [NodeInspectSymbol]() {
878
+ return this.toJSON();
879
+ },
880
+ toString() {
881
+ return format(this.toJSON());
882
+ }
883
+ };
884
+ var RightProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
885
+ _tag: "Right",
886
+ _op: "Right",
887
+ [symbol2](that) {
888
+ return isEither(that) && isRight(that) && equals(that.right, this.right);
889
+ },
890
+ [symbol]() {
891
+ return combine(hash(this._tag))(hash(this.right));
892
+ },
893
+ toJSON() {
894
+ return {
895
+ _id: "Either",
896
+ _tag: this._tag,
897
+ right: toJSON(this.right)
898
+ };
899
+ }
900
+ });
901
+ var LeftProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(CommonProto2), {
902
+ _tag: "Left",
903
+ _op: "Left",
904
+ [symbol2](that) {
905
+ return isEither(that) && isLeft(that) && equals(that.left, this.left);
906
+ },
907
+ [symbol]() {
908
+ return combine(hash(this._tag))(hash(this.left));
909
+ },
910
+ toJSON() {
911
+ return {
912
+ _id: "Either",
913
+ _tag: this._tag,
914
+ left: toJSON(this.left)
915
+ };
916
+ }
917
+ });
918
+ var isEither = (input) => hasProperty(input, TypeId2);
919
+ var isLeft = (ma) => ma._tag === "Left";
920
+ var isRight = (ma) => ma._tag === "Right";
921
+ var left = (left2) => {
922
+ const a2 = Object.create(LeftProto);
923
+ a2.left = left2;
924
+ return a2;
925
+ };
926
+ var right = (right2) => {
927
+ const a2 = Object.create(RightProto);
928
+ a2.right = right2;
929
+ return a2;
930
+ };
931
+ var getLeft = (self) => isRight(self) ? none : some2(self.left);
932
+ var getRight = (self) => isLeft(self) ? none : some2(self.right);
1069
933
 
1070
- /**
1071
- * Bun currently has a bug where `setTimeout` doesn't behave correctly with a 0ms delay.
1072
- *
1073
- * @see https://github.com/oven-sh/bun/issues/3333
1074
- */
1075
- /** @internal */
1076
- typeof process === "undefined" ? false : !!process?.isBun;
934
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/Order.js
935
+ var make2 = (compare) => (self, that) => self === that ? 0 : compare(self, that);
1077
936
 
1078
- const RE_JSX_ANNOTATION_REGEX = /@jsx\s+(\S+)/u;
1079
- // Does not check for reserved keywords or unicode characters
1080
- const RE_JS_IDENTIFIER_REGEX = /^[$A-Z_a-z][\w$]*$/u;
937
+ // ../../../node_modules/.pnpm/effect@2.3.3/node_modules/effect/dist/esm/Option.js
938
+ var TypeId3 = /* @__PURE__ */ Symbol.for("effect/Option");
939
+ var none2 = () => none;
940
+ var some3 = some2;
941
+ var isOption2 = isOption;
942
+ var isNone2 = isNone;
943
+ var isSome2 = isSome;
944
+ var match = /* @__PURE__ */ dual(2, (self, {
945
+ onNone,
946
+ onSome
947
+ }) => isNone2(self) ? onNone() : onSome(self.value));
948
+ var toRefinement = (f2) => (a2) => isSome2(f2(a2));
949
+ var fromIterable = (collection) => {
950
+ for (const a2 of collection) {
951
+ return some3(a2);
952
+ }
953
+ return none2();
954
+ };
955
+ var getRight2 = getRight;
956
+ var getLeft2 = getLeft;
957
+ var getOrElse = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? onNone() : self.value);
958
+ var orElse = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? that() : self);
959
+ var orElseSome = /* @__PURE__ */ dual(2, (self, onNone) => isNone2(self) ? some3(onNone()) : self);
960
+ var orElseEither = /* @__PURE__ */ dual(2, (self, that) => isNone2(self) ? map(that(), right) : map(self, left));
961
+ var firstSomeOf = (collection) => {
962
+ let out = none2();
963
+ for (out of collection) {
964
+ if (isSome2(out)) {
965
+ return out;
966
+ }
967
+ }
968
+ return out;
969
+ };
970
+ var fromNullable = (nullableValue) => nullableValue == null ? none2() : some3(nullableValue);
971
+ var liftNullable = (f2) => (...a2) => fromNullable(f2(...a2));
972
+ var getOrNull = /* @__PURE__ */ getOrElse(constNull);
973
+ var getOrUndefined = /* @__PURE__ */ getOrElse(constUndefined);
974
+ var liftThrowable = (f2) => (...a2) => {
975
+ try {
976
+ return some3(f2(...a2));
977
+ } catch (e2) {
978
+ return none2();
979
+ }
980
+ };
981
+ var getOrThrowWith = /* @__PURE__ */ dual(2, (self, onNone) => {
982
+ if (isSome2(self)) {
983
+ return self.value;
984
+ }
985
+ throw onNone();
986
+ });
987
+ var getOrThrow = /* @__PURE__ */ getOrThrowWith(() => new Error("getOrThrow called on a None"));
988
+ var map = /* @__PURE__ */ dual(2, (self, f2) => isNone2(self) ? none2() : some3(f2(self.value)));
989
+ var as = /* @__PURE__ */ dual(2, (self, b2) => map(self, () => b2));
990
+ var asUnit = /* @__PURE__ */ as(void 0);
991
+ var unit = /* @__PURE__ */ some3(void 0);
992
+ var flatMap = /* @__PURE__ */ dual(2, (self, f2) => isNone2(self) ? none2() : f2(self.value));
993
+ var andThen = /* @__PURE__ */ dual(2, (self, f2) => flatMap(self, (a2) => {
994
+ const b2 = isFunction(f2) ? f2(a2) : f2;
995
+ return isOption2(b2) ? b2 : some3(b2);
996
+ }));
997
+ var flatMapNullable = /* @__PURE__ */ dual(2, (self, f2) => isNone2(self) ? none2() : fromNullable(f2(self.value)));
998
+ var flatten = /* @__PURE__ */ flatMap(identity);
999
+ var zipRight = /* @__PURE__ */ dual(2, (self, that) => flatMap(self, () => that));
1000
+ var composeK = /* @__PURE__ */ dual(2, (afb, bfc) => (a2) => flatMap(afb(a2), bfc));
1001
+ var zipLeft = /* @__PURE__ */ dual(2, (self, that) => tap(self, () => that));
1002
+ var tap = /* @__PURE__ */ dual(2, (self, f2) => flatMap(self, (a2) => map(f2(a2), () => a2)));
1003
+ var product2 = (self, that) => isSome2(self) && isSome2(that) ? some3([self.value, that.value]) : none2();
1004
+ var productMany2 = (self, collection) => {
1005
+ if (isNone2(self)) {
1006
+ return none2();
1007
+ }
1008
+ const out = [self.value];
1009
+ for (const o2 of collection) {
1010
+ if (isNone2(o2)) {
1011
+ return none2();
1012
+ }
1013
+ out.push(o2.value);
1014
+ }
1015
+ return some3(out);
1016
+ };
1017
+ var all2 = (input) => {
1018
+ if (Symbol.iterator in input) {
1019
+ const out2 = [];
1020
+ for (const o2 of input) {
1021
+ if (isNone2(o2)) {
1022
+ return none2();
1023
+ }
1024
+ out2.push(o2.value);
1025
+ }
1026
+ return some3(out2);
1027
+ }
1028
+ const out = {};
1029
+ for (const key of Object.keys(input)) {
1030
+ const o2 = input[key];
1031
+ if (isNone2(o2)) {
1032
+ return none2();
1033
+ }
1034
+ out[key] = o2.value;
1035
+ }
1036
+ return some3(out);
1037
+ };
1038
+ var zipWith = /* @__PURE__ */ dual(3, (self, that, f2) => map(product2(self, that), ([a2, b2]) => f2(a2, b2)));
1039
+ var ap = /* @__PURE__ */ dual(2, (self, that) => zipWith(self, that, (f2, a2) => f2(a2)));
1040
+ var reduceCompact = /* @__PURE__ */ dual(3, (self, b2, f2) => {
1041
+ let out = b2;
1042
+ for (const oa of self) {
1043
+ if (isSome2(oa)) {
1044
+ out = f2(out, oa.value);
1045
+ }
1046
+ }
1047
+ return out;
1048
+ });
1049
+ var toArray = (self) => isNone2(self) ? [] : [self.value];
1050
+ var partitionMap = /* @__PURE__ */ dual(2, (self, f2) => {
1051
+ if (isNone2(self)) {
1052
+ return [none2(), none2()];
1053
+ }
1054
+ const e2 = f2(self.value);
1055
+ return isLeft(e2) ? [some3(e2.left), none2()] : [none2(), some3(e2.right)];
1056
+ });
1057
+ var filterMap = /* @__PURE__ */ dual(2, (self, f2) => isNone2(self) ? none2() : f2(self.value));
1058
+ var filter = /* @__PURE__ */ dual(2, (self, predicate) => filterMap(self, (b2) => predicate(b2) ? some2(b2) : none));
1059
+ var getEquivalence = (isEquivalent) => make((x2, y2) => x2 === y2 || (isNone2(x2) ? isNone2(y2) : isNone2(y2) ? false : isEquivalent(x2.value, y2.value)));
1060
+ var getOrder = (O2) => make2((self, that) => isSome2(self) ? isSome2(that) ? O2(self.value, that.value) : 1 : -1);
1061
+ var lift2 = (f2) => dual(2, (self, that) => zipWith(self, that, f2));
1062
+ var liftPredicate = (predicate) => (b2) => predicate(b2) ? some3(b2) : none2();
1063
+ var containsWith = (isEquivalent) => dual(2, (self, a2) => isNone2(self) ? false : isEquivalent(self.value, a2));
1064
+ var _equivalence = /* @__PURE__ */ equivalence();
1065
+ var contains = /* @__PURE__ */ containsWith(_equivalence);
1066
+ var exists = /* @__PURE__ */ dual(2, (self, refinement) => isNone2(self) ? false : refinement(self.value));
1067
+ var bindTo = /* @__PURE__ */ dual(2, (self, name) => map(self, (a2) => ({
1068
+ [name]: a2
1069
+ })));
1070
+ var let_ = /* @__PURE__ */ dual(3, (self, name, f2) => map(self, (a2) => Object.assign({}, a2, {
1071
+ [name]: f2(a2)
1072
+ })));
1073
+ var bind = /* @__PURE__ */ dual(3, (self, name, f2) => flatMap(self, (a2) => map(f2(a2), (b2) => Object.assign({}, a2, {
1074
+ [name]: b2
1075
+ }))));
1076
+ var Do = /* @__PURE__ */ some3({});
1077
+ var adapter2 = /* @__PURE__ */ adapter();
1078
+ var gen = (f2) => {
1079
+ const iterator = f2(adapter2);
1080
+ let state = iterator.next();
1081
+ if (state.done) {
1082
+ return some3(state.value);
1083
+ } else {
1084
+ let current = state.value.value;
1085
+ if (isNone2(current)) {
1086
+ return current;
1087
+ }
1088
+ while (!state.done) {
1089
+ state = iterator.next(current.value);
1090
+ if (!state.done) {
1091
+ current = state.value.value;
1092
+ if (isNone2(current)) {
1093
+ return current;
1094
+ }
1095
+ }
1096
+ }
1097
+ return some3(state.value);
1098
+ }
1099
+ };
1100
+ var RE_JSX_ANNOTATION_REGEX = /@jsx\s+(\S+)/u;
1101
+ var RE_JS_IDENTIFIER_REGEX = /^[$A-Z_a-z][\w$]*$/u;
1081
1102
  function getFragmentFromContext(context) {
1082
- const settings = shared.parseSchema(shared.ESLintSettingsSchema, context.settings);
1083
- const fragment = settings.reactOptions?.jsxPragmaFrag;
1084
- if (isString(fragment) && RE_JS_IDENTIFIER_REGEX.test(fragment)) return fragment;
1085
- return "Fragment";
1103
+ const settings = shared.parseSchema(shared.ESLintSettingsSchema, context.settings);
1104
+ const fragment = settings.reactOptions?.jsxPragmaFrag;
1105
+ if (Predicate_exports.isString(fragment) && RE_JS_IDENTIFIER_REGEX.test(fragment))
1106
+ return fragment;
1107
+ return "Fragment";
1086
1108
  }
1087
- const getPragmaFromContext = memo((context)=>{
1109
+ var getPragmaFromContext = memo__default.default(
1110
+ (context) => {
1088
1111
  const settings = shared.parseSchema(shared.ESLintSettingsSchema, context.settings);
1089
1112
  const pragma = settings.reactOptions?.jsxPragma;
1090
1113
  const { sourceCode } = context;
1091
- const pragmaNode = sourceCode.getAllComments().find((node)=>RE_JSX_ANNOTATION_REGEX.test(node.value));
1092
- return pipe(orElse(fromNullable(pragma), ()=>pipe(fromNullable(pragmaNode), map(({ value })=>RE_JSX_ANNOTATION_REGEX.exec(value)), flatMapNullable((matches)=>matches?.[1]?.split(".")[0]))), flatMap(liftPredicate((x)=>RE_JS_IDENTIFIER_REGEX.test(x))), getOrElse(constant("React")));
1093
- });
1094
-
1095
- const t=Symbol.for("@ts-pattern/matcher"),e=Symbol.for("@ts-pattern/isVariadic"),n="@ts-pattern/anonymous-select-key",r=t=>Boolean(t&&"object"==typeof t),i=e=>e&&!!e[t],s=(n,o,c)=>{if(i(n)){const e=n[t](),{matched:r,selections:i}=e.match(o);return r&&i&&Object.keys(i).forEach(t=>c(t,i[t])),r}if(r(n)){if(!r(o))return !1;if(Array.isArray(n)){if(!Array.isArray(o))return !1;let t=[],r=[],a=[];for(const s of n.keys()){const o=n[s];i(o)&&o[e]?a.push(o):a.length?r.push(o):t.push(o);}if(a.length){if(a.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(o.length<t.length+r.length)return !1;const e=o.slice(0,t.length),n=0===r.length?[]:o.slice(-r.length),i=o.slice(t.length,0===r.length?Infinity:-r.length);return t.every((t,n)=>s(t,e[n],c))&&r.every((t,e)=>s(t,n[e],c))&&(0===a.length||s(a[0],i,c))}return n.length===o.length&&n.every((t,e)=>s(t,o[e],c))}return Object.keys(n).every(e=>{const r=n[e];return (e in o||i(a=r)&&"optional"===a[t]().matcherType)&&s(r,o[e],c);var a;})}return Object.is(o,n)},o=e=>{var n,s,a;return r(e)?i(e)?null!=(n=null==(s=(a=e[t]()).getSelectionKeys)?void 0:s.call(a))?n:[]:Array.isArray(e)?c(e,o):c(Object.values(e),o):[]},c=(t,e)=>t.reduce((t,n)=>t.concat(e(n)),[]);function a(...t){if(1===t.length){const[e]=t;return t=>s(e,t,()=>{})}if(2===t.length){const[e,n]=t;return s(e,n,()=>{})}throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t.length}.`)}function u(t){return Object.assign(t,{optional:()=>l(t),and:e=>m(t,e),or:e=>y(t,e),select:e=>void 0===e?p(t):p(e,t)})}function h(t){return Object.assign((t=>Object.assign(t,{*[Symbol.iterator](){yield Object.assign(t,{[e]:!0});}}))(t),{optional:()=>h(l(t)),select:e=>h(void 0===e?p(t):p(e,t))})}function l(e){return u({[t]:()=>({match:t=>{let n={};const r=(t,e)=>{n[t]=e;};return void 0===t?(o(e).forEach(t=>r(t,void 0)),{matched:!0,selections:n}):{matched:s(e,t,r),selections:n}},getSelectionKeys:()=>o(e),matcherType:"optional"})})}const f=(t,e)=>{for(const n of t)if(!e(n))return !1;return !0},g=(t,e)=>{for(const[n,r]of t.entries())if(!e(r,n))return !1;return !0};function m(...e){return u({[t]:()=>({match:t=>{let n={};const r=(t,e)=>{n[t]=e;};return {matched:e.every(e=>s(e,t,r)),selections:n}},getSelectionKeys:()=>c(e,o),matcherType:"and"})})}function y(...e){return u({[t]:()=>({match:t=>{let n={};const r=(t,e)=>{n[t]=e;};return c(e,o).forEach(t=>r(t,void 0)),{matched:e.some(e=>s(e,t,r)),selections:n}},getSelectionKeys:()=>c(e,o),matcherType:"or"})})}function d(e){return {[t]:()=>({match:t=>({matched:Boolean(e(t))})})}}function p(...e){const r="string"==typeof e[0]?e[0]:void 0,i=2===e.length?e[1]:"string"==typeof e[0]?void 0:e[0];return u({[t]:()=>({match:t=>{let e={[null!=r?r:n]:t};return {matched:void 0===i||s(i,t,(t,n)=>{e[t]=n;}),selections:e}},getSelectionKeys:()=>[null!=r?r:n].concat(void 0===i?[]:o(i))})})}function v(t){return "number"==typeof t}function b(t){return "string"==typeof t}function w(t){return "bigint"==typeof t}const S=u(d(function(t){return !0})),O=S,j=t=>Object.assign(u(t),{startsWith:e=>{return j(m(t,(n=e,d(t=>b(t)&&t.startsWith(n)))));var n;},endsWith:e=>{return j(m(t,(n=e,d(t=>b(t)&&t.endsWith(n)))));var n;},minLength:e=>j(m(t,(t=>d(e=>b(e)&&e.length>=t))(e))),maxLength:e=>j(m(t,(t=>d(e=>b(e)&&e.length<=t))(e))),includes:e=>{return j(m(t,(n=e,d(t=>b(t)&&t.includes(n)))));var n;},regex:e=>{return j(m(t,(n=e,d(t=>b(t)&&Boolean(t.match(n))))));var n;}}),E=j(d(b)),K=t=>Object.assign(u(t),{between:(e,n)=>K(m(t,((t,e)=>d(n=>v(n)&&t<=n&&e>=n))(e,n))),lt:e=>K(m(t,(t=>d(e=>v(e)&&e<t))(e))),gt:e=>K(m(t,(t=>d(e=>v(e)&&e>t))(e))),lte:e=>K(m(t,(t=>d(e=>v(e)&&e<=t))(e))),gte:e=>K(m(t,(t=>d(e=>v(e)&&e>=t))(e))),int:()=>K(m(t,d(t=>v(t)&&Number.isInteger(t)))),finite:()=>K(m(t,d(t=>v(t)&&Number.isFinite(t)))),positive:()=>K(m(t,d(t=>v(t)&&t>0))),negative:()=>K(m(t,d(t=>v(t)&&t<0)))}),A=K(d(v)),x=t=>Object.assign(u(t),{between:(e,n)=>x(m(t,((t,e)=>d(n=>w(n)&&t<=n&&e>=n))(e,n))),lt:e=>x(m(t,(t=>d(e=>w(e)&&e<t))(e))),gt:e=>x(m(t,(t=>d(e=>w(e)&&e>t))(e))),lte:e=>x(m(t,(t=>d(e=>w(e)&&e<=t))(e))),gte:e=>x(m(t,(t=>d(e=>w(e)&&e>=t))(e))),positive:()=>x(m(t,d(t=>w(t)&&t>0))),negative:()=>x(m(t,d(t=>w(t)&&t<0)))}),P=x(d(w)),T=u(d(function(t){return "boolean"==typeof t})),k=u(d(function(t){return "symbol"==typeof t})),B=u(d(function(t){return null==t}));var _={__proto__:null,matcher:t,optional:l,array:function(...e){return h({[t]:()=>({match:t=>{if(!Array.isArray(t))return {matched:!1};if(0===e.length)return {matched:!0};const n=e[0];let r={};if(0===t.length)return o(n).forEach(t=>{r[t]=[];}),{matched:!0,selections:r};const i=(t,e)=>{r[t]=(r[t]||[]).concat([e]);};return {matched:t.every(t=>s(n,t,i)),selections:r}},getSelectionKeys:()=>0===e.length?[]:o(e[0])})})},set:function(...e){return u({[t]:()=>({match:t=>{if(!(t instanceof Set))return {matched:!1};let n={};if(0===t.size)return {matched:!0,selections:n};if(0===e.length)return {matched:!0};const r=(t,e)=>{n[t]=(n[t]||[]).concat([e]);},i=e[0];return {matched:f(t,t=>s(i,t,r)),selections:n}},getSelectionKeys:()=>0===e.length?[]:o(e[0])})})},map:function(...e){return u({[t]:()=>({match:t=>{if(!(t instanceof Map))return {matched:!1};let n={};if(0===t.size)return {matched:!0,selections:n};const r=(t,e)=>{n[t]=(n[t]||[]).concat([e]);};if(0===e.length)return {matched:!0};var i;if(1===e.length)throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null==(i=e[0])?void 0:i.toString()}`);const[o,c]=e;return {matched:g(t,(t,e)=>{const n=s(o,e,r),i=s(c,t,r);return n&&i}),selections:n}},getSelectionKeys:()=>0===e.length?[]:[...o(e[0]),...o(e[1])]})})},intersection:m,union:y,not:function(e){return u({[t]:()=>({match:t=>({matched:!s(e,t,()=>{})}),getSelectionKeys:()=>[],matcherType:"not"})})},when:d,select:p,any:S,_:O,string:E,number:A,bigint:P,boolean:T,symbol:k,nullish:B,instanceOf:function(t){return u(d(function(t){return e=>e instanceof t}(t)))},shape:function(t){return u(d(a(t)))}};const W={matched:!1,value:void 0};function N(t){return new $(t,W)}class ${constructor(t,e){this.input=void 0,this.state=void 0,this.input=t,this.state=e;}with(...t){if(this.state.matched)return this;const e=t[t.length-1],r=[t[0]];let i;3===t.length&&"function"==typeof t[1]?i=t[1]:t.length>2&&r.push(...t.slice(1,t.length-1));let o=!1,c={};const a=(t,e)=>{o=!0,c[t]=e;},u=!r.some(t=>s(t,this.input,a))||i&&!Boolean(i(this.input))?W:{matched:!0,value:e(o?n in c?c[n]:c:this.input,this.input)};return new $(this.input,u)}when(t,e){if(this.state.matched)return this;const n=Boolean(t(this.input));return new $(this.input,n?{matched:!0,value:e(this.input,this.input)}:W)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;let t;try{t=JSON.stringify(this.input);}catch(e){t=this.input;}throw new Error(`Pattern matching error: no pattern matches value ${t}`)}run(){return this.exhaustive()}returnType(){return this}}
1114
+ const pragmaNode = sourceCode.getAllComments().find((node) => RE_JSX_ANNOTATION_REGEX.test(node.value));
1115
+ return Function_exports.pipe(
1116
+ Option_exports.orElse(Option_exports.fromNullable(pragma), () => Function_exports.pipe(
1117
+ Option_exports.fromNullable(pragmaNode),
1118
+ Option_exports.map(({ value }) => RE_JSX_ANNOTATION_REGEX.exec(value)),
1119
+ Option_exports.flatMapNullable((matches) => matches?.[1]?.split(".")[0])
1120
+ )),
1121
+ Option_exports.flatMap(Option_exports.liftPredicate((x2) => RE_JS_IDENTIFIER_REGEX.test(x2))),
1122
+ Option_exports.getOrElse(Function_exports.constant("React"))
1123
+ );
1124
+ }
1125
+ );
1096
1126
 
1097
- function isInitializedFromPragma(variableName, context, initialScope, pragma = getPragmaFromContext(context)) {
1098
- const maybeVariable = _var.findVariable(variableName, initialScope);
1099
- const maybeLatestDef = flatMapNullable(maybeVariable, (variable)=>variable.defs.at(-1));
1100
- if (isNone(maybeLatestDef)) return false;
1101
- const latestDef = maybeLatestDef.value;
1102
- const { node, parent } = latestDef;
1103
- if (node.type === ast.NodeType.VariableDeclarator && node.init) {
1104
- const { init } = node;
1105
- // check for: `variable = pragma.variable`
1106
- if (a({
1107
- type: "MemberExpression",
1108
- object: {
1109
- type: "Identifier",
1110
- name: pragma
1111
- }
1112
- }, init)) return true;
1113
- // check for: `{ variable } = pragma`
1114
- if (a({
1115
- type: "Identifier",
1116
- name: pragma
1117
- }, init)) return true;
1118
- // check if from a require call: `require("react")`
1119
- const maybeRequireExpression = N(init).with({
1120
- type: ast.NodeType.CallExpression,
1121
- callee: {
1122
- type: ast.NodeType.Identifier,
1123
- name: "require"
1124
- }
1125
- }, (exp)=>some(exp)).with({
1126
- type: ast.NodeType.MemberExpression,
1127
- object: {
1128
- type: ast.NodeType.CallExpression,
1129
- callee: {
1130
- type: ast.NodeType.Identifier,
1131
- name: "require"
1132
- }
1133
- }
1134
- }, ({ object })=>some(object)).otherwise(none);
1135
- if (isNone(maybeRequireExpression)) return false;
1136
- const requireExpression = maybeRequireExpression.value;
1137
- const [firstArg] = requireExpression.arguments;
1138
- if (firstArg?.type !== ast.NodeType.Literal) return false;
1139
- return firstArg.value === pragma.toLowerCase();
1127
+ // ../../../node_modules/.pnpm/ts-pattern@5.0.6/node_modules/ts-pattern/dist/index.js
1128
+ var t = Symbol.for("@ts-pattern/matcher");
1129
+ var e = Symbol.for("@ts-pattern/isVariadic");
1130
+ var n = "@ts-pattern/anonymous-select-key";
1131
+ var r = (t2) => Boolean(t2 && "object" == typeof t2);
1132
+ var i = (e2) => e2 && !!e2[t];
1133
+ var s = (n2, o2, c2) => {
1134
+ if (i(n2)) {
1135
+ const e2 = n2[t](), { matched: r2, selections: i2 } = e2.match(o2);
1136
+ return r2 && i2 && Object.keys(i2).forEach((t2) => c2(t2, i2[t2])), r2;
1137
+ }
1138
+ if (r(n2)) {
1139
+ if (!r(o2))
1140
+ return false;
1141
+ if (Array.isArray(n2)) {
1142
+ if (!Array.isArray(o2))
1143
+ return false;
1144
+ let t2 = [], r2 = [], a2 = [];
1145
+ for (const s2 of n2.keys()) {
1146
+ const o3 = n2[s2];
1147
+ i(o3) && o3[e] ? a2.push(o3) : a2.length ? r2.push(o3) : t2.push(o3);
1148
+ }
1149
+ if (a2.length) {
1150
+ if (a2.length > 1)
1151
+ throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");
1152
+ if (o2.length < t2.length + r2.length)
1153
+ return false;
1154
+ const e2 = o2.slice(0, t2.length), n3 = 0 === r2.length ? [] : o2.slice(-r2.length), i2 = o2.slice(t2.length, 0 === r2.length ? Infinity : -r2.length);
1155
+ return t2.every((t3, n4) => s(t3, e2[n4], c2)) && r2.every((t3, e3) => s(t3, n3[e3], c2)) && (0 === a2.length || s(a2[0], i2, c2));
1156
+ }
1157
+ return n2.length === o2.length && n2.every((t3, e2) => s(t3, o2[e2], c2));
1140
1158
  }
1141
- // latest definition is an import declaration: import { variable } from 'react'
1142
- return a({
1143
- type: "ImportDeclaration",
1144
- source: {
1145
- value: pragma.toLowerCase()
1146
- }
1147
- }, parent);
1148
- }
1149
- function isPropertyOfPragma(name, context, pragma = getPragmaFromContext(context)) {
1150
- const isMatch = a({
1151
- type: ast.NodeType.MemberExpression,
1152
- object: {
1153
- type: ast.NodeType.Identifier,
1154
- name: pragma
1155
- },
1156
- property: {
1157
- name
1158
- }
1159
+ return Object.keys(n2).every((e2) => {
1160
+ const r2 = n2[e2];
1161
+ return (e2 in o2 || i(a2 = r2) && "optional" === a2[t]().matcherType) && s(r2, o2[e2], c2);
1162
+ var a2;
1163
+ });
1164
+ }
1165
+ return Object.is(o2, n2);
1166
+ };
1167
+ var o = (e2) => {
1168
+ var n2, s2, a2;
1169
+ return r(e2) ? i(e2) ? null != (n2 = null == (s2 = (a2 = e2[t]()).getSelectionKeys) ? void 0 : s2.call(a2)) ? n2 : [] : Array.isArray(e2) ? c(e2, o) : c(Object.values(e2), o) : [];
1170
+ };
1171
+ var c = (t2, e2) => t2.reduce((t3, n2) => t3.concat(e2(n2)), []);
1172
+ function a(...t2) {
1173
+ if (1 === t2.length) {
1174
+ const [e2] = t2;
1175
+ return (t3) => s(e2, t3, () => {
1159
1176
  });
1160
- return isMatch;
1177
+ }
1178
+ if (2 === t2.length) {
1179
+ const [e2, n2] = t2;
1180
+ return s(e2, n2, () => {
1181
+ });
1182
+ }
1183
+ throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t2.length}.`);
1161
1184
  }
1162
- /**
1163
- * Checks if the given node is a call expression to the given function or method of the pragma
1164
- * @param name The name of the function or method to check
1165
- * @returns A predicate that checks if the given node is a call expression to the given function or method
1166
- */ function isFromPragma(name) {
1167
- return (node, context)=>{
1168
- const initialScope = context.sourceCode.getScope?.(node) ?? context.getScope();
1169
- if (node.type === ast.NodeType.MemberExpression) return isPropertyOfPragma(name, context)(node);
1170
- if (node.name === name) return isInitializedFromPragma(name, context, initialScope);
1171
- return false;
1185
+ function u(t2) {
1186
+ return Object.assign(t2, { optional: () => l(t2), and: (e2) => m(t2, e2), or: (e2) => y(t2, e2), select: (e2) => void 0 === e2 ? p(t2) : p(e2, t2) });
1187
+ }
1188
+ function h(t2) {
1189
+ return Object.assign(((t3) => Object.assign(t3, { *[Symbol.iterator]() {
1190
+ yield Object.assign(t3, { [e]: true });
1191
+ } }))(t2), { optional: () => h(l(t2)), select: (e2) => h(void 0 === e2 ? p(t2) : p(e2, t2)) });
1192
+ }
1193
+ function l(e2) {
1194
+ return u({ [t]: () => ({ match: (t2) => {
1195
+ let n2 = {};
1196
+ const r2 = (t3, e3) => {
1197
+ n2[t3] = e3;
1172
1198
  };
1199
+ return void 0 === t2 ? (o(e2).forEach((t3) => r2(t3, void 0)), { matched: true, selections: n2 }) : { matched: s(e2, t2, r2), selections: n2 };
1200
+ }, getSelectionKeys: () => o(e2), matcherType: "optional" }) });
1173
1201
  }
1174
- /**
1175
- * @internal
1176
- * @param pragmaMemberName
1177
- * @param name
1178
- * @returns A function that checks if a given node is a member expression of a Pragma member.
1179
- */ function isFromPragmaMember(pragmaMemberName, name) {
1180
- return (node, context, pragma = getPragmaFromContext(context))=>{
1181
- const initialScope = context.sourceCode.getScope?.(node) ?? context.getScope();
1182
- if (node.property.type !== ast.NodeType.Identifier || node.property.name !== name) return false;
1183
- if (node.object.type === ast.NodeType.Identifier && node.object.name === pragmaMemberName) {
1184
- return isInitializedFromPragma(node.object.name, context, initialScope, pragma);
1185
- }
1186
- if (node.object.type === ast.NodeType.MemberExpression && node.object.object.type === ast.NodeType.Identifier && node.object.object.name === pragma && node.object.property.type === ast.NodeType.Identifier) {
1187
- return node.object.property.name === pragmaMemberName;
1188
- }
1189
- return false;
1202
+ var f = (t2, e2) => {
1203
+ for (const n2 of t2)
1204
+ if (!e2(n2))
1205
+ return false;
1206
+ return true;
1207
+ };
1208
+ var g = (t2, e2) => {
1209
+ for (const [n2, r2] of t2.entries())
1210
+ if (!e2(r2, n2))
1211
+ return false;
1212
+ return true;
1213
+ };
1214
+ function m(...e2) {
1215
+ return u({ [t]: () => ({ match: (t2) => {
1216
+ let n2 = {};
1217
+ const r2 = (t3, e3) => {
1218
+ n2[t3] = e3;
1190
1219
  };
1220
+ return { matched: e2.every((e3) => s(e3, t2, r2)), selections: n2 };
1221
+ }, getSelectionKeys: () => c(e2, o), matcherType: "and" }) });
1191
1222
  }
1192
- function isCallFromPragma(name) {
1193
- return (node, context)=>{
1194
- if (!ast.isOneOf([
1195
- ast.NodeType.Identifier,
1196
- ast.NodeType.MemberExpression
1197
- ])(node.callee)) return false;
1198
- return isFromPragma(name)(node.callee, context);
1223
+ function y(...e2) {
1224
+ return u({ [t]: () => ({ match: (t2) => {
1225
+ let n2 = {};
1226
+ const r2 = (t3, e3) => {
1227
+ n2[t3] = e3;
1199
1228
  };
1229
+ return c(e2, o).forEach((t3) => r2(t3, void 0)), { matched: e2.some((e3) => s(e3, t2, r2)), selections: n2 };
1230
+ }, getSelectionKeys: () => c(e2, o), matcherType: "or" }) });
1200
1231
  }
1201
- function isCallFromPragmaMember(pragmaMemberName, name) {
1202
- return (node, context)=>{
1203
- if (!ast.is(ast.NodeType.MemberExpression)(node.callee)) return false;
1204
- return isFromPragmaMember(pragmaMemberName, name)(node.callee, context);
1232
+ function d(e2) {
1233
+ return { [t]: () => ({ match: (t2) => ({ matched: Boolean(e2(t2)) }) }) };
1234
+ }
1235
+ function p(...e2) {
1236
+ const r2 = "string" == typeof e2[0] ? e2[0] : void 0, i2 = 2 === e2.length ? e2[1] : "string" == typeof e2[0] ? void 0 : e2[0];
1237
+ return u({ [t]: () => ({ match: (t2) => {
1238
+ let e3 = { [null != r2 ? r2 : n]: t2 };
1239
+ return { matched: void 0 === i2 || s(i2, t2, (t3, n2) => {
1240
+ e3[t3] = n2;
1241
+ }), selections: e3 };
1242
+ }, getSelectionKeys: () => [null != r2 ? r2 : n].concat(void 0 === i2 ? [] : o(i2)) }) });
1243
+ }
1244
+ function v(t2) {
1245
+ return "number" == typeof t2;
1246
+ }
1247
+ function b(t2) {
1248
+ return "string" == typeof t2;
1249
+ }
1250
+ function w(t2) {
1251
+ return "bigint" == typeof t2;
1252
+ }
1253
+ var S = u(d(function(t2) {
1254
+ return true;
1255
+ }));
1256
+ var O = S;
1257
+ var j = (t2) => Object.assign(u(t2), { startsWith: (e2) => {
1258
+ return j(m(t2, (n2 = e2, d((t3) => b(t3) && t3.startsWith(n2)))));
1259
+ var n2;
1260
+ }, endsWith: (e2) => {
1261
+ return j(m(t2, (n2 = e2, d((t3) => b(t3) && t3.endsWith(n2)))));
1262
+ var n2;
1263
+ }, minLength: (e2) => j(m(t2, ((t3) => d((e3) => b(e3) && e3.length >= t3))(e2))), maxLength: (e2) => j(m(t2, ((t3) => d((e3) => b(e3) && e3.length <= t3))(e2))), includes: (e2) => {
1264
+ return j(m(t2, (n2 = e2, d((t3) => b(t3) && t3.includes(n2)))));
1265
+ var n2;
1266
+ }, regex: (e2) => {
1267
+ return j(m(t2, (n2 = e2, d((t3) => b(t3) && Boolean(t3.match(n2))))));
1268
+ var n2;
1269
+ } });
1270
+ var E = j(d(b));
1271
+ var K = (t2) => Object.assign(u(t2), { between: (e2, n2) => K(m(t2, ((t3, e3) => d((n3) => v(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => K(m(t2, ((t3) => d((e3) => v(e3) && e3 < t3))(e2))), gt: (e2) => K(m(t2, ((t3) => d((e3) => v(e3) && e3 > t3))(e2))), lte: (e2) => K(m(t2, ((t3) => d((e3) => v(e3) && e3 <= t3))(e2))), gte: (e2) => K(m(t2, ((t3) => d((e3) => v(e3) && e3 >= t3))(e2))), int: () => K(m(t2, d((t3) => v(t3) && Number.isInteger(t3)))), finite: () => K(m(t2, d((t3) => v(t3) && Number.isFinite(t3)))), positive: () => K(m(t2, d((t3) => v(t3) && t3 > 0))), negative: () => K(m(t2, d((t3) => v(t3) && t3 < 0))) });
1272
+ var A = K(d(v));
1273
+ var x = (t2) => Object.assign(u(t2), { between: (e2, n2) => x(m(t2, ((t3, e3) => d((n3) => w(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => x(m(t2, ((t3) => d((e3) => w(e3) && e3 < t3))(e2))), gt: (e2) => x(m(t2, ((t3) => d((e3) => w(e3) && e3 > t3))(e2))), lte: (e2) => x(m(t2, ((t3) => d((e3) => w(e3) && e3 <= t3))(e2))), gte: (e2) => x(m(t2, ((t3) => d((e3) => w(e3) && e3 >= t3))(e2))), positive: () => x(m(t2, d((t3) => w(t3) && t3 > 0))), negative: () => x(m(t2, d((t3) => w(t3) && t3 < 0))) });
1274
+ var P = x(d(w));
1275
+ var T = u(d(function(t2) {
1276
+ return "boolean" == typeof t2;
1277
+ }));
1278
+ var k = u(d(function(t2) {
1279
+ return "symbol" == typeof t2;
1280
+ }));
1281
+ var B = u(d(function(t2) {
1282
+ return null == t2;
1283
+ }));
1284
+ var _ = { __proto__: null, matcher: t, optional: l, array: function(...e2) {
1285
+ return h({ [t]: () => ({ match: (t2) => {
1286
+ if (!Array.isArray(t2))
1287
+ return { matched: false };
1288
+ if (0 === e2.length)
1289
+ return { matched: true };
1290
+ const n2 = e2[0];
1291
+ let r2 = {};
1292
+ if (0 === t2.length)
1293
+ return o(n2).forEach((t3) => {
1294
+ r2[t3] = [];
1295
+ }), { matched: true, selections: r2 };
1296
+ const i2 = (t3, e3) => {
1297
+ r2[t3] = (r2[t3] || []).concat([e3]);
1205
1298
  };
1299
+ return { matched: t2.every((t3) => s(n2, t3, i2)), selections: r2 };
1300
+ }, getSelectionKeys: () => 0 === e2.length ? [] : o(e2[0]) }) });
1301
+ }, set: function(...e2) {
1302
+ return u({ [t]: () => ({ match: (t2) => {
1303
+ if (!(t2 instanceof Set))
1304
+ return { matched: false };
1305
+ let n2 = {};
1306
+ if (0 === t2.size)
1307
+ return { matched: true, selections: n2 };
1308
+ if (0 === e2.length)
1309
+ return { matched: true };
1310
+ const r2 = (t3, e3) => {
1311
+ n2[t3] = (n2[t3] || []).concat([e3]);
1312
+ }, i2 = e2[0];
1313
+ return { matched: f(t2, (t3) => s(i2, t3, r2)), selections: n2 };
1314
+ }, getSelectionKeys: () => 0 === e2.length ? [] : o(e2[0]) }) });
1315
+ }, map: function(...e2) {
1316
+ return u({ [t]: () => ({ match: (t2) => {
1317
+ if (!(t2 instanceof Map))
1318
+ return { matched: false };
1319
+ let n2 = {};
1320
+ if (0 === t2.size)
1321
+ return { matched: true, selections: n2 };
1322
+ const r2 = (t3, e3) => {
1323
+ n2[t3] = (n2[t3] || []).concat([e3]);
1324
+ };
1325
+ if (0 === e2.length)
1326
+ return { matched: true };
1327
+ var i2;
1328
+ if (1 === e2.length)
1329
+ throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null == (i2 = e2[0]) ? void 0 : i2.toString()}`);
1330
+ const [o2, c2] = e2;
1331
+ return { matched: g(t2, (t3, e3) => {
1332
+ const n3 = s(o2, e3, r2), i3 = s(c2, t3, r2);
1333
+ return n3 && i3;
1334
+ }), selections: n2 };
1335
+ }, getSelectionKeys: () => 0 === e2.length ? [] : [...o(e2[0]), ...o(e2[1])] }) });
1336
+ }, intersection: m, union: y, not: function(e2) {
1337
+ return u({ [t]: () => ({ match: (t2) => ({ matched: !s(e2, t2, () => {
1338
+ }) }), getSelectionKeys: () => [], matcherType: "not" }) });
1339
+ }, when: d, select: p, any: S, _: O, string: E, number: A, bigint: P, boolean: T, symbol: k, nullish: B, instanceOf: function(t2) {
1340
+ return u(d(/* @__PURE__ */ function(t3) {
1341
+ return (e2) => e2 instanceof t3;
1342
+ }(t2)));
1343
+ }, shape: function(t2) {
1344
+ return u(d(a(t2)));
1345
+ } };
1346
+ var W = { matched: false, value: void 0 };
1347
+ function N(t2) {
1348
+ return new $(t2, W);
1206
1349
  }
1207
-
1208
- const isCreateElement = isFromPragma("createElement");
1209
- const isCreateElementCall = (node, context)=>{
1210
- if (!ast.isOneOf([
1211
- ast.NodeType.Identifier,
1212
- ast.NodeType.MemberExpression
1213
- ])(node.callee)) return false;
1214
- return isCreateElement(node.callee, context);
1215
- };
1216
- const isCloneElement = isFromPragma("cloneElement");
1217
- const isCloneElementCall = (node, context)=>{
1218
- if (!ast.isOneOf([
1219
- ast.NodeType.Identifier,
1220
- ast.NodeType.MemberExpression
1221
- ])(node.callee)) return false;
1222
- return isCloneElement(node.callee, context);
1350
+ var $ = class _$ {
1351
+ constructor(t2, e2) {
1352
+ this.input = void 0, this.state = void 0, this.input = t2, this.state = e2;
1353
+ }
1354
+ with(...t2) {
1355
+ if (this.state.matched)
1356
+ return this;
1357
+ const e2 = t2[t2.length - 1], r2 = [t2[0]];
1358
+ let i2;
1359
+ 3 === t2.length && "function" == typeof t2[1] ? i2 = t2[1] : t2.length > 2 && r2.push(...t2.slice(1, t2.length - 1));
1360
+ let o2 = false, c2 = {};
1361
+ const a2 = (t3, e3) => {
1362
+ o2 = true, c2[t3] = e3;
1363
+ }, u2 = !r2.some((t3) => s(t3, this.input, a2)) || i2 && !Boolean(i2(this.input)) ? W : { matched: true, value: e2(o2 ? n in c2 ? c2[n] : c2 : this.input, this.input) };
1364
+ return new _$(this.input, u2);
1365
+ }
1366
+ when(t2, e2) {
1367
+ if (this.state.matched)
1368
+ return this;
1369
+ const n2 = Boolean(t2(this.input));
1370
+ return new _$(this.input, n2 ? { matched: true, value: e2(this.input, this.input) } : W);
1371
+ }
1372
+ otherwise(t2) {
1373
+ return this.state.matched ? this.state.value : t2(this.input);
1374
+ }
1375
+ exhaustive() {
1376
+ if (this.state.matched)
1377
+ return this.state.value;
1378
+ let t2;
1379
+ try {
1380
+ t2 = JSON.stringify(this.input);
1381
+ } catch (e2) {
1382
+ t2 = this.input;
1383
+ }
1384
+ throw new Error(`Pattern matching error: no pattern matches value ${t2}`);
1385
+ }
1386
+ run() {
1387
+ return this.exhaustive();
1388
+ }
1389
+ returnType() {
1390
+ return this;
1391
+ }
1223
1392
  };
1224
1393
 
1225
- function resolveMemberExpressions(object, property) {
1226
- if (object.type === types.AST_NODE_TYPES.JSXMemberExpression) {
1227
- return `${resolveMemberExpressions(object.object, object.property)}.${property.name}`;
1228
- }
1229
- if (object.type === types.AST_NODE_TYPES.JSXNamespacedName) {
1230
- return `${object.namespace.name}:${object.name.name}.${property.name}`;
1231
- }
1232
- return `${object.name}.${property.name}`;
1394
+ // src/pragma/is-from-pragma.ts
1395
+ function isInitializedFromPragma(variableName, context, initialScope, pragma = getPragmaFromContext(context)) {
1396
+ const maybeVariable = _var.findVariable(variableName, initialScope);
1397
+ const maybeLatestDef = Option_exports.flatMapNullable(maybeVariable, (variable) => variable.defs.at(-1));
1398
+ if (Option_exports.isNone(maybeLatestDef))
1399
+ return false;
1400
+ const latestDef = maybeLatestDef.value;
1401
+ const { node, parent } = latestDef;
1402
+ if (node.type === ast.NodeType.VariableDeclarator && node.init) {
1403
+ const { init } = node;
1404
+ if (a({ type: "MemberExpression", object: { type: "Identifier", name: pragma } }, init))
1405
+ return true;
1406
+ if (a({ type: "Identifier", name: pragma }, init))
1407
+ return true;
1408
+ const maybeRequireExpression = N(init).with({
1409
+ type: ast.NodeType.CallExpression,
1410
+ callee: { type: ast.NodeType.Identifier, name: "require" }
1411
+ }, (exp) => Option_exports.some(exp)).with(
1412
+ {
1413
+ type: ast.NodeType.MemberExpression,
1414
+ object: {
1415
+ type: ast.NodeType.CallExpression,
1416
+ callee: { type: ast.NodeType.Identifier, name: "require" }
1417
+ }
1418
+ },
1419
+ ({ object }) => Option_exports.some(object)
1420
+ ).otherwise(Option_exports.none);
1421
+ if (Option_exports.isNone(maybeRequireExpression))
1422
+ return false;
1423
+ const requireExpression = maybeRequireExpression.value;
1424
+ const [firstArg] = requireExpression.arguments;
1425
+ if (firstArg?.type !== ast.NodeType.Literal)
1426
+ return false;
1427
+ return firstArg.value === pragma.toLowerCase();
1428
+ }
1429
+ return a({ type: "ImportDeclaration", source: { value: pragma.toLowerCase() } }, parent);
1233
1430
  }
1234
- /**
1235
- * Returns the tag name associated with a JSXOpeningElement.
1236
- * @param node The visited JSXOpeningElement node object.
1237
- * @returns The element's tag name.
1238
- */ function elementType(node) {
1239
- if (node.type === types.AST_NODE_TYPES.JSXOpeningFragment) {
1240
- return "<>";
1431
+ function isPropertyOfPragma(name, context, pragma = getPragmaFromContext(context)) {
1432
+ const isMatch = a({
1433
+ type: ast.NodeType.MemberExpression,
1434
+ object: {
1435
+ type: ast.NodeType.Identifier,
1436
+ name: pragma
1437
+ },
1438
+ property: {
1439
+ name
1241
1440
  }
1242
- const { name } = node;
1243
- if (name.type === types.AST_NODE_TYPES.JSXMemberExpression) {
1244
- const { object, property } = name;
1245
- return resolveMemberExpressions(object, property);
1441
+ });
1442
+ return isMatch;
1443
+ }
1444
+ function isFromPragma(name) {
1445
+ return (node, context) => {
1446
+ const initialScope = context.sourceCode.getScope?.(node) ?? context.getScope();
1447
+ if (node.type === ast.NodeType.MemberExpression)
1448
+ return isPropertyOfPragma(name, context)(node);
1449
+ if (node.name === name)
1450
+ return isInitializedFromPragma(name, context, initialScope);
1451
+ return false;
1452
+ };
1453
+ }
1454
+ function isFromPragmaMember(pragmaMemberName, name) {
1455
+ return (node, context, pragma = getPragmaFromContext(context)) => {
1456
+ const initialScope = context.sourceCode.getScope?.(node) ?? context.getScope();
1457
+ if (node.property.type !== ast.NodeType.Identifier || node.property.name !== name)
1458
+ return false;
1459
+ if (node.object.type === ast.NodeType.Identifier && node.object.name === pragmaMemberName) {
1460
+ return isInitializedFromPragma(node.object.name, context, initialScope, pragma);
1246
1461
  }
1247
- if (name.type === types.AST_NODE_TYPES.JSXNamespacedName) {
1248
- return `${name.namespace.name}:${name.name.name}`;
1462
+ if (node.object.type === ast.NodeType.MemberExpression && node.object.object.type === ast.NodeType.Identifier && node.object.object.name === pragma && node.object.property.type === ast.NodeType.Identifier) {
1463
+ return node.object.property.name === pragmaMemberName;
1249
1464
  }
1250
- return name.name;
1465
+ return false;
1466
+ };
1467
+ }
1468
+ function isCallFromPragma(name) {
1469
+ return (node, context) => {
1470
+ if (!ast.isOneOf([ast.NodeType.Identifier, ast.NodeType.MemberExpression])(node.callee))
1471
+ return false;
1472
+ return isFromPragma(name)(node.callee, context);
1473
+ };
1474
+ }
1475
+ function isCallFromPragmaMember(pragmaMemberName, name) {
1476
+ return (node, context) => {
1477
+ if (!ast.is(ast.NodeType.MemberExpression)(node.callee))
1478
+ return false;
1479
+ return isFromPragmaMember(pragmaMemberName, name)(node.callee, context);
1480
+ };
1251
1481
  }
1252
1482
 
1253
- /**
1254
- * Determines whether inside createElement's props.
1255
- * @param node The AST node to check
1256
- * @param context The rule context
1257
- * @returns `true` if the node is inside createElement's props
1258
- */ function isInsideCreateElementProps(node, context) {
1259
- return pipe(ast.traverseUp(node, (n)=>ast.is(ast.NodeType.CallExpression)(n) && isCreateElementCall(n, context)), filter(ast.is(ast.NodeType.CallExpression)), flatMapNullable((c)=>c.arguments.at(1)), filter(ast.is(ast.NodeType.ObjectExpression)), zipWith(ast.traverseUp(node, ast.is(ast.NodeType.ObjectExpression)), (a, b)=>a === b), getOrElse(constFalse));
1483
+ // src/element/api.ts
1484
+ var isCreateElement = isFromPragma("createElement");
1485
+ var isCreateElementCall = (node, context) => {
1486
+ if (!ast.isOneOf([ast.NodeType.Identifier, ast.NodeType.MemberExpression])(node.callee))
1487
+ return false;
1488
+ return isCreateElement(node.callee, context);
1489
+ };
1490
+ var isCloneElement = isFromPragma("cloneElement");
1491
+ var isCloneElementCall = (node, context) => {
1492
+ if (!ast.isOneOf([ast.NodeType.Identifier, ast.NodeType.MemberExpression])(node.callee))
1493
+ return false;
1494
+ return isCloneElement(node.callee, context);
1495
+ };
1496
+ function resolveMemberExpressions(object, property) {
1497
+ if (object.type === types.AST_NODE_TYPES.JSXMemberExpression) {
1498
+ return `${resolveMemberExpressions(object.object, object.property)}.${property.name}`;
1499
+ }
1500
+ if (object.type === types.AST_NODE_TYPES.JSXNamespacedName) {
1501
+ return `${object.namespace.name}:${object.name.name}.${property.name}`;
1502
+ }
1503
+ return `${object.name}.${property.name}`;
1504
+ }
1505
+ function elementType(node) {
1506
+ if (node.type === types.AST_NODE_TYPES.JSXOpeningFragment) {
1507
+ return "<>";
1508
+ }
1509
+ const { name } = node;
1510
+ if (name.type === types.AST_NODE_TYPES.JSXMemberExpression) {
1511
+ const { object, property } = name;
1512
+ return resolveMemberExpressions(object, property);
1513
+ }
1514
+ if (name.type === types.AST_NODE_TYPES.JSXNamespacedName) {
1515
+ return `${name.namespace.name}:${name.name.name}`;
1516
+ }
1517
+ return name.name;
1518
+ }
1519
+ function isInsideCreateElementProps(node, context) {
1520
+ return Function_exports.pipe(
1521
+ ast.traverseUp(node, (n2) => ast.is(ast.NodeType.CallExpression)(n2) && isCreateElementCall(n2, context)),
1522
+ Option_exports.filter(ast.is(ast.NodeType.CallExpression)),
1523
+ Option_exports.flatMapNullable((c2) => c2.arguments.at(1)),
1524
+ Option_exports.filter(ast.is(ast.NodeType.ObjectExpression)),
1525
+ Option_exports.zipWith(ast.traverseUp(node, ast.is(ast.NodeType.ObjectExpression)), (a2, b2) => a2 === b2),
1526
+ Option_exports.getOrElse(Function_exports.constFalse)
1527
+ );
1260
1528
  }
1261
1529
  function isChildrenOfCreateElement(node, context) {
1262
- return pipe(fromNullable(node.parent), filter(ast.is(ast.NodeType.CallExpression)), filter((n)=>isCreateElementCall(n, context)), exists((n)=>n.arguments.slice(2).some((arg)=>arg === node)));
1530
+ return Function_exports.pipe(
1531
+ Option_exports.fromNullable(node.parent),
1532
+ Option_exports.filter(ast.is(ast.NodeType.CallExpression)),
1533
+ Option_exports.filter((n2) => isCreateElementCall(n2, context)),
1534
+ Option_exports.exists(
1535
+ (n2) => n2.arguments.slice(2).some((arg) => arg === node)
1536
+ )
1537
+ );
1263
1538
  }
1264
- /**
1265
- * Check if a `JSXElement` or `JSXFragment` has children
1266
- * @param node The AST node to check
1267
- * @param predicate A predicate to filter the children
1268
- * @returns `true` if the node has children
1269
- */ function hasChildren(node, predicate) {
1270
- if (isFunction(predicate)) return node.children.some(predicate);
1271
- return node.children.length > 0;
1539
+ function hasChildren(node, predicate) {
1540
+ if (Predicate_exports.isFunction(predicate))
1541
+ return node.children.some(predicate);
1542
+ return node.children.length > 0;
1272
1543
  }
1273
- /**
1274
- * Check if a node is a child of a `JSXElement`
1275
- * @param node The AST node to check
1276
- * @returns `true` if the node is a child of a `JSXElement`
1277
- */ function isChildOfJSXElement(node) {
1278
- return node.parent?.type === ast.NodeType.JSXElement && node.parent.children.some((child)=>child === node);
1544
+ function isChildOfJSXElement(node) {
1545
+ return node.parent?.type === ast.NodeType.JSXElement && node.parent.children.some((child) => child === node);
1279
1546
  }
1280
-
1281
- /**
1282
- * Check if a node is a `JSXElement` of `User-Defined Component` type
1283
- * @param node The AST node to check
1284
- * @returns `true` if the node is a `JSXElement` of `User-Defined Component` type
1285
- */ function isJSXElementOfUserDefinedComponent(node) {
1286
- return node.openingElement.name.type === ast.NodeType.JSXIdentifier && /^[A-Z]/u.test(node.openingElement.name.name);
1547
+ function isJSXElementOfUserDefinedComponent(node) {
1548
+ return node.openingElement.name.type === ast.NodeType.JSXIdentifier && /^[A-Z]/u.test(node.openingElement.name.name);
1287
1549
  }
1288
- /**
1289
- * Check if a node is a `JSXFragment` of `Built-in Component` type
1290
- * @param node The AST node to check
1291
- * @returns `true` if the node is a `JSXFragment` of `Built-in Component` type
1292
- */ function isJSXElementOfBuiltinComponent(node) {
1293
- 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);
1550
+ function isJSXElementOfBuiltinComponent(node) {
1551
+ 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);
1294
1552
  }
1295
-
1296
- const isFragment = (node, pragma, fragment)=>{
1297
- if (!ast.isOneOf([
1298
- ast.NodeType.JSXElement,
1299
- ast.NodeType.JSXFragment
1300
- ])(node)) return false;
1301
- return isFragmentSyntax(node) || isFragmentElement(node, pragma, fragment);
1553
+ var isFragment = (node, pragma, fragment) => {
1554
+ if (!ast.isOneOf([ast.NodeType.JSXElement, ast.NodeType.JSXFragment])(node))
1555
+ return false;
1556
+ return isFragmentSyntax(node) || isFragmentElement(node, pragma, fragment);
1302
1557
  };
1303
- /**
1304
- * Check if a node is `<></>`
1305
- */ const isFragmentSyntax = ast.is(ast.NodeType.JSXFragment);
1306
- /**
1307
- * Check if a node is `<Fragment></Fragment>` or `<Pragma.Fragment></Pragma.Fragment>`
1308
- * @param node
1309
- * @param pragma
1310
- * @param fragment
1311
- */ function isFragmentElement(node, pragma, fragment) {
1312
- const { name } = node.openingElement;
1313
- // <Fragment>
1314
- if (name.type === ast.NodeType.JSXIdentifier && name.name === fragment) return true;
1315
- // <Pragma.Fragment>
1316
- return name.type === ast.NodeType.JSXMemberExpression && name.object.type === ast.NodeType.JSXIdentifier && name.object.name === pragma && name.property.name === fragment;
1558
+ var isFragmentSyntax = ast.is(ast.NodeType.JSXFragment);
1559
+ function isFragmentElement(node, pragma, fragment) {
1560
+ const { name } = node.openingElement;
1561
+ if (name.type === ast.NodeType.JSXIdentifier && name.name === fragment)
1562
+ return true;
1563
+ return name.type === ast.NodeType.JSXMemberExpression && name.object.type === ast.NodeType.JSXIdentifier && name.object.name === pragma && name.property.name === fragment;
1317
1564
  }
1318
-
1319
- // type ReactNode =
1320
- // | ReactElement
1321
- // | string
1322
- // | number
1323
- // | Iterable<ReactNode>
1324
- // | ReactPortal
1325
- // | boolean
1326
- // | null
1327
- // | undefined
1328
- // | DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES[
1329
- // keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_REACT_NODES
1330
- // ];
1331
- /* eslint-disable perfectionist/sort-objects */ const JSXValueHint = {
1332
- None: 0n,
1333
- SkipNullLiteral: 1n << 0n,
1334
- SkipUndefinedLiteral: 1n << 1n,
1335
- SkipBooleanLiteral: 1n << 2n,
1336
- SkipStringLiteral: 1n << 3n,
1337
- SkipNumberLiteral: 1n << 4n,
1338
- SkipCreateElement: 1n << 5n,
1339
- StrictArray: 1n << 6n,
1340
- StrictLogical: 1n << 7n,
1341
- StrictConditional: 1n << 8n
1565
+ var JSXValueHint = {
1566
+ None: 0n,
1567
+ SkipNullLiteral: 1n << 0n,
1568
+ SkipUndefinedLiteral: 1n << 1n,
1569
+ SkipBooleanLiteral: 1n << 2n,
1570
+ SkipStringLiteral: 1n << 3n,
1571
+ SkipNumberLiteral: 1n << 4n,
1572
+ SkipCreateElement: 1n << 5n,
1573
+ StrictArray: 1n << 6n,
1574
+ StrictLogical: 1n << 7n,
1575
+ StrictConditional: 1n << 8n
1342
1576
  };
1343
- /* eslint-enable perfectionist/sort-objects */ const DEFAULT_JSX_VALUE_HINT = JSXValueHint.SkipUndefinedLiteral | JSXValueHint.SkipBooleanLiteral;
1344
- /**
1345
- * Check if a node is a JSX value
1346
- * @param node The AST node to check
1347
- * @param context The rule context
1348
- * @param hint The `JSXValueHint` to use
1349
- * @returns boolean
1350
- */ function isJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
1351
- if (!node) return false;
1352
- return N(node).with({
1353
- type: ast.NodeType.JSXElement
1354
- }, constTrue).with({
1355
- type: ast.NodeType.JSXFragment
1356
- }, constTrue).with({
1357
- type: ast.NodeType.JSXMemberExpression
1358
- }, constTrue).with({
1359
- type: ast.NodeType.JSXNamespacedName
1360
- }, constTrue).with({
1361
- type: ast.NodeType.Literal
1362
- }, (node)=>{
1363
- return N(node.value).with(null, ()=>!(hint & JSXValueHint.SkipNullLiteral)).with(_.boolean, ()=>!(hint & JSXValueHint.SkipBooleanLiteral)).with(_.string, ()=>!(hint & JSXValueHint.SkipStringLiteral)).with(_.number, ()=>!(hint & JSXValueHint.SkipNumberLiteral)).otherwise(constFalse);
1364
- }).with({
1365
- type: ast.NodeType.TemplateLiteral
1366
- }, ()=>!(hint & JSXValueHint.SkipStringLiteral)).with({
1367
- type: ast.NodeType.ArrayExpression
1368
- }, (node)=>{
1369
- if (hint & JSXValueHint.StrictArray) return node.elements.every((n)=>isJSXValue(n, context, hint));
1370
- return node.elements.some((n)=>isJSXValue(n, context, hint));
1371
- }).with({
1372
- type: ast.NodeType.ConditionalExpression
1373
- }, (node)=>{
1374
- function leftHasJSX(node) {
1375
- if (Array.isArray(node.consequent)) {
1376
- if (hint & JSXValueHint.StrictArray) {
1377
- return node.consequent.every((n)=>isJSXValue(n, context, hint));
1378
- }
1379
- return node.consequent.some((n)=>isJSXValue(n, context, hint));
1380
- }
1381
- return isJSXValue(node.consequent, context, hint);
1382
- }
1383
- function rightHasJSX(node) {
1384
- return isJSXValue(node.alternate, context, hint);
1385
- }
1386
- if (hint & JSXValueHint.StrictConditional) {
1387
- return leftHasJSX(node) && rightHasJSX(node);
1577
+ var DEFAULT_JSX_VALUE_HINT = JSXValueHint.SkipUndefinedLiteral | JSXValueHint.SkipBooleanLiteral;
1578
+ function isJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
1579
+ if (!node)
1580
+ return false;
1581
+ return N(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) => {
1582
+ return N(node2.value).with(null, () => !(hint & JSXValueHint.SkipNullLiteral)).with(_.boolean, () => !(hint & JSXValueHint.SkipBooleanLiteral)).with(_.string, () => !(hint & JSXValueHint.SkipStringLiteral)).with(_.number, () => !(hint & JSXValueHint.SkipNumberLiteral)).otherwise(Function_exports.constFalse);
1583
+ }).with({ type: ast.NodeType.TemplateLiteral }, () => !(hint & JSXValueHint.SkipStringLiteral)).with({ type: ast.NodeType.ArrayExpression }, (node2) => {
1584
+ if (hint & JSXValueHint.StrictArray)
1585
+ return node2.elements.every((n2) => isJSXValue(n2, context, hint));
1586
+ return node2.elements.some((n2) => isJSXValue(n2, context, hint));
1587
+ }).with({ type: ast.NodeType.ConditionalExpression }, (node2) => {
1588
+ function leftHasJSX(node3) {
1589
+ if (Array.isArray(node3.consequent)) {
1590
+ if (hint & JSXValueHint.StrictArray) {
1591
+ return node3.consequent.every((n2) => isJSXValue(n2, context, hint));
1388
1592
  }
1389
- return leftHasJSX(node) || rightHasJSX(node);
1390
- }).with({
1391
- type: ast.NodeType.LogicalExpression
1392
- }, (node)=>{
1393
- return isJSXValue(node.left, context, hint) || isJSXValue(node.right, context, hint);
1394
- }).with({
1395
- type: ast.NodeType.SequenceExpression
1396
- }, (node)=>{
1397
- const exp = node.expressions.at(-1);
1398
- return isJSXValue(exp, context, hint);
1399
- }).with({
1400
- type: ast.NodeType.CallExpression
1401
- }, (node)=>{
1402
- if (hint & JSXValueHint.SkipCreateElement) return false;
1403
- return isCreateElementCall(node, context);
1404
- }).with({
1405
- type: ast.NodeType.Identifier
1406
- }, (node)=>{
1407
- const { name } = node;
1408
- if (name === "undefined") return !(hint & JSXValueHint.SkipUndefinedLiteral);
1409
- if (ast.isJSXTagNameExpression(node)) return true;
1410
- const initialScope = context.sourceCode.getScope?.(node) ?? context.getScope();
1411
- const maybeVariable = _var.findVariable(name, initialScope);
1412
- return pipe(maybeVariable, flatMap(_var.getVariableInit(0)), exists((n)=>isJSXValue(n, context, hint)));
1413
- }).otherwise(constFalse);
1414
- }
1415
-
1416
- /**
1417
- * Check if function is returning JSX
1418
- * @param node The return statement node to check
1419
- * @param context The rule context
1420
- * @param hint The `JSXValueHint` to use
1421
- * @returns boolean
1422
- */ function isFunctionReturningJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
1423
- if (node.body.type !== ast.NodeType.BlockStatement) {
1424
- return isJSXValue(node.body, context, hint);
1593
+ return node3.consequent.some((n2) => isJSXValue(n2, context, hint));
1594
+ }
1595
+ return isJSXValue(node3.consequent, context, hint);
1596
+ }
1597
+ function rightHasJSX(node3) {
1598
+ return isJSXValue(node3.alternate, context, hint);
1425
1599
  }
1426
- const statements = ast.getNestedReturnStatements(node.body);
1427
- return statements.some((statement)=>isJSXValue(statement.argument, context, hint));
1600
+ if (hint & JSXValueHint.StrictConditional) {
1601
+ return leftHasJSX(node2) && rightHasJSX(node2);
1602
+ }
1603
+ return leftHasJSX(node2) || rightHasJSX(node2);
1604
+ }).with({ type: ast.NodeType.LogicalExpression }, (node2) => {
1605
+ return isJSXValue(node2.left, context, hint) || isJSXValue(node2.right, context, hint);
1606
+ }).with({ type: ast.NodeType.SequenceExpression }, (node2) => {
1607
+ const exp = node2.expressions.at(-1);
1608
+ return isJSXValue(exp, context, hint);
1609
+ }).with({ type: ast.NodeType.CallExpression }, (node2) => {
1610
+ if (hint & JSXValueHint.SkipCreateElement)
1611
+ return false;
1612
+ return isCreateElementCall(node2, context);
1613
+ }).with({ type: ast.NodeType.Identifier }, (node2) => {
1614
+ const { name } = node2;
1615
+ if (name === "undefined")
1616
+ return !(hint & JSXValueHint.SkipUndefinedLiteral);
1617
+ if (ast.isJSXTagNameExpression(node2))
1618
+ return true;
1619
+ const initialScope = context.sourceCode.getScope?.(node2) ?? context.getScope();
1620
+ const maybeVariable = _var.findVariable(name, initialScope);
1621
+ return Function_exports.pipe(
1622
+ maybeVariable,
1623
+ Option_exports.flatMap(_var.getVariableInit(0)),
1624
+ Option_exports.exists((n2) => isJSXValue(n2, context, hint))
1625
+ );
1626
+ }).otherwise(Function_exports.constFalse);
1428
1627
  }
1429
1628
 
1430
- const { getStaticValue } = ast.ESLintCommunityESLintUtils;
1431
- /**
1432
- * Get the name of a JSX attribute with namespace
1433
- * @param node The JSX attribute node
1434
- * @returns string
1435
- */ function getPropName(node) {
1436
- return N(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();
1629
+ // src/misc.ts
1630
+ function isFunctionReturningJSXValue(node, context, hint = DEFAULT_JSX_VALUE_HINT) {
1631
+ if (node.body.type !== ast.NodeType.BlockStatement) {
1632
+ return isJSXValue(node.body, context, hint);
1633
+ }
1634
+ const statements = ast.getNestedReturnStatements(node.body);
1635
+ return statements.some((statement) => isJSXValue(statement.argument, context, hint));
1636
+ }
1637
+ var { getStaticValue } = ast.ESLintCommunityESLintUtils;
1638
+ function getPropName(node) {
1639
+ return N(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();
1437
1640
  }
1438
1641
  function getProp(props, propName, context, initialScope) {
1439
- return findPropInAttributes(props, context, initialScope)(propName);
1642
+ return findPropInAttributes(props, context, initialScope)(propName);
1440
1643
  }
1441
- /**
1442
- * Gets and resolves the static value of a JSX attribute
1443
- * @param attribute The JSX attribute to get the value of
1444
- * @param context The rule context
1445
- * @returns The static value of the given JSX attribute
1446
- */ function getPropValue(attribute, context) {
1447
- const initialScope = context.sourceCode.getScope?.(attribute) ?? context.getScope();
1448
- if (attribute.type === ast.NodeType.JSXAttribute && "value" in attribute) {
1449
- const { value } = attribute;
1450
- if (value === null) return none();
1451
- if (value.type === ast.NodeType.Literal) return some(getStaticValue(value, initialScope));
1452
- if (value.type === ast.NodeType.JSXExpressionContainer) return some(getStaticValue(value.expression, initialScope));
1453
- return none();
1454
- }
1455
- const { argument } = attribute;
1456
- return some(getStaticValue(argument, initialScope));
1644
+ function getPropValue(attribute, context) {
1645
+ const initialScope = context.sourceCode.getScope?.(attribute) ?? context.getScope();
1646
+ if (attribute.type === ast.NodeType.JSXAttribute && "value" in attribute) {
1647
+ const { value } = attribute;
1648
+ if (value === null)
1649
+ return Option_exports.none();
1650
+ if (value.type === ast.NodeType.Literal)
1651
+ return Option_exports.some(getStaticValue(value, initialScope));
1652
+ if (value.type === ast.NodeType.JSXExpressionContainer)
1653
+ return Option_exports.some(getStaticValue(value.expression, initialScope));
1654
+ return Option_exports.none();
1655
+ }
1656
+ const { argument } = attribute;
1657
+ return Option_exports.some(getStaticValue(argument, initialScope));
1457
1658
  }
1458
- /**
1459
- * @param properties The properties to search in
1460
- * @param context The rule context
1461
- * @param initialScope
1462
- * @param seenProps The properties that have already been seen
1463
- * @returns A function that searches for a property in the given properties
1464
- */ function findPropInProperties(properties, context, initialScope, seenProps = []) {
1465
- /**
1466
- * Search for a property in the given properties
1467
- * @param propName The name of the property to search for
1468
- * @returns The property if found
1469
- */ return (propName)=>{
1470
- return fromNullable(properties.find((prop)=>{
1471
- return N(prop).when(ast.is(ast.NodeType.Property), (prop)=>{
1472
- return "name" in prop.key && prop.key.name === propName;
1473
- }).when(ast.is(ast.NodeType.SpreadElement), (prop)=>{
1474
- return N(prop.argument).when(ast.is(ast.NodeType.Identifier), (argument)=>{
1475
- const { name } = argument;
1476
- const maybeInit = flatMap(_var.findVariable(name, initialScope), _var.getVariableInit(0));
1477
- if (isNone(maybeInit)) return false;
1478
- const init = maybeInit.value;
1479
- if (init.type !== ast.NodeType.ObjectExpression) return false;
1480
- if (seenProps.includes(name)) return false;
1481
- return isSome(findPropInProperties(init.properties, context, initialScope, [
1482
- ...seenProps,
1483
- name
1484
- ])(propName));
1485
- }).when(ast.is(ast.NodeType.ObjectExpression), (argument)=>{
1486
- return isSome(findPropInProperties(argument.properties, context, initialScope, seenProps)(propName));
1487
- }).when(ast.is(ast.NodeType.MemberExpression), ()=>{
1488
- // Not implemented
1489
- }).when(ast.is(ast.NodeType.CallExpression), ()=>{
1490
- // Not implemented
1491
- }).otherwise(constFalse);
1492
- }).when(ast.is(ast.NodeType.RestElement), ()=>{
1493
- // Not implemented
1494
- return false;
1495
- }).otherwise(constFalse);
1496
- }));
1497
- };
1659
+ function findPropInProperties(properties, context, initialScope, seenProps = []) {
1660
+ return (propName) => {
1661
+ return Option_exports.fromNullable(
1662
+ properties.find((prop) => {
1663
+ return N(prop).when(ast.is(ast.NodeType.Property), (prop2) => {
1664
+ return "name" in prop2.key && prop2.key.name === propName;
1665
+ }).when(ast.is(ast.NodeType.SpreadElement), (prop2) => {
1666
+ return N(prop2.argument).when(ast.is(ast.NodeType.Identifier), (argument) => {
1667
+ const { name } = argument;
1668
+ const maybeInit = Option_exports.flatMap(
1669
+ _var.findVariable(name, initialScope),
1670
+ _var.getVariableInit(0)
1671
+ );
1672
+ if (Option_exports.isNone(maybeInit))
1673
+ return false;
1674
+ const init = maybeInit.value;
1675
+ if (init.type !== ast.NodeType.ObjectExpression)
1676
+ return false;
1677
+ if (seenProps.includes(name))
1678
+ return false;
1679
+ return Option_exports.isSome(
1680
+ findPropInProperties(init.properties, context, initialScope, [...seenProps, name])(propName)
1681
+ );
1682
+ }).when(ast.is(ast.NodeType.ObjectExpression), (argument) => {
1683
+ return Option_exports.isSome(findPropInProperties(argument.properties, context, initialScope, seenProps)(propName));
1684
+ }).when(ast.is(ast.NodeType.MemberExpression), () => {
1685
+ }).when(ast.is(ast.NodeType.CallExpression), () => {
1686
+ }).otherwise(Function_exports.constFalse);
1687
+ }).when(ast.is(ast.NodeType.RestElement), () => {
1688
+ return false;
1689
+ }).otherwise(Function_exports.constFalse);
1690
+ })
1691
+ );
1692
+ };
1498
1693
  }
1499
- /**
1500
- * @param attributes The attributes to search in
1501
- * @param context The rule context
1502
- * @param initialScope
1503
- * @returns A function that searches for a property in the given attributes
1504
- */ function findPropInAttributes(attributes, context, initialScope) {
1505
- /**
1506
- * Search for a property in the given attributes
1507
- * @param propName The name of the property to search for
1508
- * @returns The property if found
1509
- */ return (propName)=>{
1510
- return fromNullable(attributes.find((attr)=>{
1511
- return N(attr).when(ast.is(ast.NodeType.JSXAttribute), (attr)=>getPropName(attr) === propName).when(ast.is(ast.NodeType.JSXSpreadAttribute), (attr)=>{
1512
- return N(attr.argument).with({
1513
- type: ast.NodeType.Identifier
1514
- }, (argument)=>{
1515
- const { name } = argument;
1516
- const maybeInit = flatMap(_var.findVariable(name, initialScope), _var.getVariableInit(0));
1517
- if (isNone(maybeInit)) return false;
1518
- const init = maybeInit.value;
1519
- if (!("properties" in init)) return false;
1520
- return isSome(findPropInProperties(init.properties, context, initialScope)(propName));
1521
- }).when(ast.is(ast.NodeType.ObjectExpression), (argument)=>{
1522
- return isSome(findPropInProperties(argument.properties, context, initialScope)(propName));
1523
- }).when(ast.is(ast.NodeType.MemberExpression), ()=>{
1524
- // Not implemented
1525
- return false;
1526
- }).when(ast.is(ast.NodeType.CallExpression), ()=>{
1527
- // Not implemented
1528
- return false;
1529
- }).otherwise(constFalse);
1530
- }).otherwise(constFalse);
1531
- }));
1532
- };
1694
+ function findPropInAttributes(attributes, context, initialScope) {
1695
+ return (propName) => {
1696
+ return Option_exports.fromNullable(
1697
+ attributes.find((attr) => {
1698
+ return N(attr).when(ast.is(ast.NodeType.JSXAttribute), (attr2) => getPropName(attr2) === propName).when(ast.is(ast.NodeType.JSXSpreadAttribute), (attr2) => {
1699
+ return N(attr2.argument).with({ type: ast.NodeType.Identifier }, (argument) => {
1700
+ const { name } = argument;
1701
+ const maybeInit = Option_exports.flatMap(
1702
+ _var.findVariable(name, initialScope),
1703
+ _var.getVariableInit(0)
1704
+ );
1705
+ if (Option_exports.isNone(maybeInit))
1706
+ return false;
1707
+ const init = maybeInit.value;
1708
+ if (!("properties" in init))
1709
+ return false;
1710
+ return Option_exports.isSome(findPropInProperties(init.properties, context, initialScope)(propName));
1711
+ }).when(ast.is(ast.NodeType.ObjectExpression), (argument) => {
1712
+ return Option_exports.isSome(findPropInProperties(argument.properties, context, initialScope)(propName));
1713
+ }).when(ast.is(ast.NodeType.MemberExpression), () => {
1714
+ return false;
1715
+ }).when(ast.is(ast.NodeType.CallExpression), () => {
1716
+ return false;
1717
+ }).otherwise(Function_exports.constFalse);
1718
+ }).otherwise(Function_exports.constFalse);
1719
+ })
1720
+ );
1721
+ };
1533
1722
  }
1534
1723
 
1535
- /**
1536
- * Check if the given prop name is present in the given attributes
1537
- * @param attributes The attributes to search in
1538
- * @param propName The prop name to search for
1539
- * @param context The rule context
1540
- * @param initialScope
1541
- * @returns `true` if the given prop name is present in the given properties
1542
- */ function hasProp(attributes, propName, context, initialScope) {
1543
- return isSome(findPropInAttributes(attributes, context, initialScope)(propName));
1724
+ // src/prop/has-prop.ts
1725
+ function hasProp(attributes, propName, context, initialScope) {
1726
+ return Option_exports.isSome(findPropInAttributes(attributes, context, initialScope)(propName));
1544
1727
  }
1545
- /**
1546
- * Check if any of the given prop names are present in the given attributes
1547
- * @param attributes The attributes to search in
1548
- * @param propNames The prop names to search for
1549
- * @param context The rule context
1550
- * @param initialScope
1551
- * @returns `true` if any of the given prop names are present in the given attributes
1552
- */ function hasAnyProp(attributes, propNames, context, initialScope) {
1553
- return propNames.some((propName)=>hasProp(attributes, propName, context, initialScope));
1728
+ function hasAnyProp(attributes, propNames, context, initialScope) {
1729
+ return propNames.some((propName) => hasProp(attributes, propName, context, initialScope));
1554
1730
  }
1555
- /**
1556
- * Check if all of the given prop names are present in the given attributes
1557
- * @param attributes The attributes to search in
1558
- * @param propNames The prop names to search for
1559
- * @param context The rule context
1560
- * @param initialScope
1561
- * @returns `true` if all of the given prop names are present in the given attributes
1562
- */ function hasEveryProp(attributes, propNames, context, initialScope) {
1563
- return propNames.every((propName)=>hasProp(attributes, propName, context, initialScope));
1731
+ function hasEveryProp(attributes, propNames, context, initialScope) {
1732
+ return propNames.every((propName) => hasProp(attributes, propName, context, initialScope));
1564
1733
  }
1565
-
1566
- /**
1567
- * Traverses up prop node
1568
- * @param node The AST node to start traversing from
1569
- * @param predicate The predicate to check each node
1570
- * @returns prop node if found
1571
- */ function traverseUpProp(node, predicate = constTrue) {
1572
- const guard = (node)=>{
1573
- return node.type === ast.NodeType.JSXAttribute && predicate(node);
1574
- };
1575
- return ast.traverseUpGuard(node, guard);
1734
+ function traverseUpProp(node, predicate = Function_exports.constTrue) {
1735
+ const guard = (node2) => {
1736
+ return node2.type === ast.NodeType.JSXAttribute && predicate(node2);
1737
+ };
1738
+ return ast.traverseUpGuard(node, guard);
1576
1739
  }
1577
1740
 
1578
- /**
1579
- * Checks if the node is inside a prop's value
1580
- * @param node The AST node to check
1581
- * @returns `true` if the node is inside a prop's value
1582
- */ function isInsidePropValue(node) {
1583
- if (ast.isStringLiteral(node)) return node.parent.type === ast.NodeType.JSXAttribute;
1584
- return isSome(traverseUpProp(node, (n)=>n.value?.type === ast.NodeType.JSXExpressionContainer));
1741
+ // src/prop/misc.ts
1742
+ function isInsidePropValue(node) {
1743
+ if (ast.isStringLiteral(node))
1744
+ return node.parent.type === ast.NodeType.JSXAttribute;
1745
+ return Option_exports.isSome(traverseUpProp(node, (n2) => n2.value?.type === ast.NodeType.JSXExpressionContainer));
1585
1746
  }
1586
-
1587
- /**
1588
- * Check if a node is a Literal or JSXText
1589
- * @param node The AST node to check
1590
- * @returns boolean `true` if the node is a Literal or JSXText
1591
- */ const isLiteral = ast.isOneOf([
1592
- ast.NodeType.Literal,
1593
- ast.NodeType.JSXText
1594
- ]);
1595
- /**
1596
- * Check if a Literal or JSXText node is whitespace
1597
- * @param node The AST node to check
1598
- * @returns boolean `true` if the node is whitespace
1599
- */ function isWhiteSpace(node) {
1600
- return isString(node.value) && node.value.trim() === "";
1747
+ var isLiteral = ast.isOneOf([ast.NodeType.Literal, ast.NodeType.JSXText]);
1748
+ function isWhiteSpace(node) {
1749
+ return Predicate_exports.isString(node.value) && node.value.trim() === "";
1601
1750
  }
1602
- /**
1603
- * Check if a Literal or JSXText node is a line break
1604
- * @param node The AST node to check
1605
- * @returns boolean
1606
- */ function isLineBreak(node) {
1607
- return isLiteral(node) && isWhiteSpace(node) && ast.isMultiLine(node);
1751
+ function isLineBreak(node) {
1752
+ return isLiteral(node) && isWhiteSpace(node) && ast.isMultiLine(node);
1608
1753
  }
1609
- /**
1610
- * Check if a Literal or JSXText node is padding spaces
1611
- * @param node The AST node to check
1612
- * @returns boolean
1613
- */ function isPaddingSpaces(node) {
1614
- return isLiteral(node) && isWhiteSpace(node) && node.raw.includes("\n");
1754
+ function isPaddingSpaces(node) {
1755
+ return isLiteral(node) && isWhiteSpace(node) && node.raw.includes("\n");
1615
1756
  }
1616
1757
 
1617
1758
  exports.DEFAULT_JSX_VALUE_HINT = DEFAULT_JSX_VALUE_HINT;