chop-logic-components 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import Ae, { useState as br } from "react";
2
- var ie = { exports: {} }, Y = {};
1
+ import Ue, { useState as de, useEffect as Er, useRef as wr } from "react";
2
+ var ve = { exports: {} }, q = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.min.js
@@ -9,25 +9,25 @@ var ie = { exports: {} }, Y = {};
9
9
  * This source code is licensed under the MIT license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
- var Pe;
13
- function gr() {
14
- if (Pe)
15
- return Y;
16
- Pe = 1;
17
- var _ = Ae, g = Symbol.for("react.element"), c = Symbol.for("react.fragment"), f = Object.prototype.hasOwnProperty, h = _.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, R = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function m(T, d, x) {
19
- var v, C = {}, O = null, P = null;
20
- x !== void 0 && (O = "" + x), d.key !== void 0 && (O = "" + d.key), d.ref !== void 0 && (P = d.ref);
21
- for (v in d)
22
- f.call(d, v) && !R.hasOwnProperty(v) && (C[v] = d[v]);
23
- if (T && T.defaultProps)
24
- for (v in d = T.defaultProps, d)
25
- C[v] === void 0 && (C[v] = d[v]);
26
- return { $$typeof: g, type: T, key: O, ref: P, props: C, _owner: h.current };
12
+ var Le;
13
+ function xr() {
14
+ if (Le)
15
+ return q;
16
+ Le = 1;
17
+ var a = Ue, u = Symbol.for("react.element"), o = Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, d = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function b(y, v, C) {
19
+ var c, x = {}, R = null, g = null;
20
+ C !== void 0 && (R = "" + C), v.key !== void 0 && (R = "" + v.key), v.ref !== void 0 && (g = v.ref);
21
+ for (c in v)
22
+ l.call(v, c) && !m.hasOwnProperty(c) && (x[c] = v[c]);
23
+ if (y && y.defaultProps)
24
+ for (c in v = y.defaultProps, v)
25
+ x[c] === void 0 && (x[c] = v[c]);
26
+ return { $$typeof: u, type: y, key: R, ref: g, props: x, _owner: d.current };
27
27
  }
28
- return Y.Fragment = c, Y.jsx = m, Y.jsxs = m, Y;
28
+ return q.Fragment = o, q.jsx = b, q.jsxs = b, q;
29
29
  }
30
- var q = {};
30
+ var K = {};
31
31
  /**
32
32
  * @license React
33
33
  * react-jsx-runtime.development.js
@@ -37,91 +37,91 @@ var q = {};
37
37
  * This source code is licensed under the MIT license found in the
38
38
  * LICENSE file in the root directory of this source tree.
39
39
  */
40
- var ke;
41
- function yr() {
42
- return ke || (ke = 1, process.env.NODE_ENV !== "production" && function() {
43
- var _ = Ae, g = Symbol.for("react.element"), c = Symbol.for("react.portal"), f = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), T = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), x = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), P = Symbol.for("react.offscreen"), U = Symbol.iterator, G = "@@iterator";
44
- function z(e) {
40
+ var We;
41
+ function Rr() {
42
+ return We || (We = 1, process.env.NODE_ENV !== "production" && function() {
43
+ var a = Ue, u = Symbol.for("react.element"), o = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), d = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), b = Symbol.for("react.provider"), y = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), x = Symbol.for("react.memo"), R = Symbol.for("react.lazy"), g = Symbol.for("react.offscreen"), T = Symbol.iterator, V = "@@iterator";
44
+ function N(e) {
45
45
  if (e === null || typeof e != "object")
46
46
  return null;
47
- var r = U && e[U] || e[G];
47
+ var r = T && e[T] || e[V];
48
48
  return typeof r == "function" ? r : null;
49
49
  }
50
- var S = _.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
- function p(e) {
50
+ var S = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
+ function E(e) {
52
52
  {
53
- for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
54
- t[n - 1] = arguments[n];
55
- Ie("error", e, t);
53
+ for (var r = arguments.length, n = new Array(r > 1 ? r - 1 : 0), t = 1; t < r; t++)
54
+ n[t - 1] = arguments[t];
55
+ Z("error", e, n);
56
56
  }
57
57
  }
58
- function Ie(e, r, t) {
58
+ function Z(e, r, n) {
59
59
  {
60
- var n = S.ReactDebugCurrentFrame, o = n.getStackAddendum();
61
- o !== "" && (r += "%s", t = t.concat([o]));
62
- var s = t.map(function(i) {
63
- return String(i);
60
+ var t = S.ReactDebugCurrentFrame, f = t.getStackAddendum();
61
+ f !== "" && (r += "%s", n = n.concat([f]));
62
+ var p = n.map(function(s) {
63
+ return String(s);
64
64
  });
65
- s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
65
+ p.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, p);
66
66
  }
67
67
  }
68
- var $e = !1, Ne = !1, We = !1, Le = !1, Ye = !1, oe;
69
- oe = Symbol.for("react.module.reference");
70
- function qe(e) {
71
- return !!(typeof e == "string" || typeof e == "function" || e === f || e === R || Ye || e === h || e === x || e === v || Le || e === P || $e || Ne || We || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === C || e.$$typeof === m || e.$$typeof === T || e.$$typeof === d || // This needs to include all possible module reference object
68
+ var ee = !1, J = !1, re = !1, Be = !1, qe = !1, pe;
69
+ pe = Symbol.for("react.module.reference");
70
+ function Ke(e) {
71
+ return !!(typeof e == "string" || typeof e == "function" || e === l || e === m || qe || e === d || e === C || e === c || Be || e === g || ee || J || re || typeof e == "object" && e !== null && (e.$$typeof === R || e.$$typeof === x || e.$$typeof === b || e.$$typeof === y || e.$$typeof === v || // This needs to include all possible module reference object
72
72
  // types supported by any Flight configuration anywhere since
73
73
  // we don't know which Flight build this will end up being used
74
74
  // with.
75
- e.$$typeof === oe || e.getModuleId !== void 0));
75
+ e.$$typeof === pe || e.getModuleId !== void 0));
76
76
  }
77
- function Me(e, r, t) {
78
- var n = e.displayName;
79
- if (n)
80
- return n;
81
- var o = r.displayName || r.name || "";
82
- return o !== "" ? t + "(" + o + ")" : t;
77
+ function Je(e, r, n) {
78
+ var t = e.displayName;
79
+ if (t)
80
+ return t;
81
+ var f = r.displayName || r.name || "";
82
+ return f !== "" ? n + "(" + f + ")" : n;
83
83
  }
84
- function se(e) {
84
+ function be(e) {
85
85
  return e.displayName || "Context";
86
86
  }
87
- function j(e) {
87
+ function P(e) {
88
88
  if (e == null)
89
89
  return null;
90
- if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
90
+ if (typeof e.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
91
91
  return e.displayName || e.name || null;
92
92
  if (typeof e == "string")
93
93
  return e;
94
94
  switch (e) {
95
- case f:
95
+ case l:
96
96
  return "Fragment";
97
- case c:
97
+ case o:
98
98
  return "Portal";
99
- case R:
99
+ case m:
100
100
  return "Profiler";
101
- case h:
101
+ case d:
102
102
  return "StrictMode";
103
- case x:
103
+ case C:
104
104
  return "Suspense";
105
- case v:
105
+ case c:
106
106
  return "SuspenseList";
107
107
  }
108
108
  if (typeof e == "object")
109
109
  switch (e.$$typeof) {
110
- case T:
110
+ case y:
111
111
  var r = e;
112
- return se(r) + ".Consumer";
113
- case m:
114
- var t = e;
115
- return se(t._context) + ".Provider";
116
- case d:
117
- return Me(e, e.render, "ForwardRef");
118
- case C:
119
- var n = e.displayName || null;
120
- return n !== null ? n : j(e.type) || "Memo";
121
- case O: {
122
- var o = e, s = o._payload, i = o._init;
112
+ return be(r) + ".Consumer";
113
+ case b:
114
+ var n = e;
115
+ return be(n._context) + ".Provider";
116
+ case v:
117
+ return Je(e, e.render, "ForwardRef");
118
+ case x:
119
+ var t = e.displayName || null;
120
+ return t !== null ? t : P(e.type) || "Memo";
121
+ case R: {
122
+ var f = e, p = f._payload, s = f._init;
123
123
  try {
124
- return j(i(s));
124
+ return P(s(p));
125
125
  } catch {
126
126
  return null;
127
127
  }
@@ -129,18 +129,18 @@ function yr() {
129
129
  }
130
130
  return null;
131
131
  }
132
- var k = Object.assign, N = 0, ue, le, ce, fe, de, ve, pe;
133
- function _e() {
132
+ var F = Object.assign, U = 0, _e, me, he, ye, ge, Ee, we;
133
+ function xe() {
134
134
  }
135
- _e.__reactDisabledLog = !0;
136
- function Ue() {
135
+ xe.__reactDisabledLog = !0;
136
+ function Ge() {
137
137
  {
138
- if (N === 0) {
139
- ue = console.log, le = console.info, ce = console.warn, fe = console.error, de = console.group, ve = console.groupCollapsed, pe = console.groupEnd;
138
+ if (U === 0) {
139
+ _e = console.log, me = console.info, he = console.warn, ye = console.error, ge = console.group, Ee = console.groupCollapsed, we = console.groupEnd;
140
140
  var e = {
141
141
  configurable: !0,
142
142
  enumerable: !0,
143
- value: _e,
143
+ value: xe,
144
144
  writable: !0
145
145
  };
146
146
  Object.defineProperties(console, {
@@ -153,336 +153,336 @@ function yr() {
153
153
  groupEnd: e
154
154
  });
155
155
  }
156
- N++;
156
+ U++;
157
157
  }
158
158
  }
159
- function Ve() {
159
+ function ze() {
160
160
  {
161
- if (N--, N === 0) {
161
+ if (U--, U === 0) {
162
162
  var e = {
163
163
  configurable: !0,
164
164
  enumerable: !0,
165
165
  writable: !0
166
166
  };
167
167
  Object.defineProperties(console, {
168
- log: k({}, e, {
169
- value: ue
168
+ log: F({}, e, {
169
+ value: _e
170
170
  }),
171
- info: k({}, e, {
172
- value: le
171
+ info: F({}, e, {
172
+ value: me
173
173
  }),
174
- warn: k({}, e, {
175
- value: ce
174
+ warn: F({}, e, {
175
+ value: he
176
176
  }),
177
- error: k({}, e, {
178
- value: fe
177
+ error: F({}, e, {
178
+ value: ye
179
179
  }),
180
- group: k({}, e, {
181
- value: de
180
+ group: F({}, e, {
181
+ value: ge
182
182
  }),
183
- groupCollapsed: k({}, e, {
184
- value: ve
183
+ groupCollapsed: F({}, e, {
184
+ value: Ee
185
185
  }),
186
- groupEnd: k({}, e, {
187
- value: pe
186
+ groupEnd: F({}, e, {
187
+ value: we
188
188
  })
189
189
  });
190
190
  }
191
- N < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
191
+ U < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
192
  }
193
193
  }
194
- var X = S.ReactCurrentDispatcher, H;
195
- function V(e, r, t) {
194
+ var ne = S.ReactCurrentDispatcher, te;
195
+ function G(e, r, n) {
196
196
  {
197
- if (H === void 0)
197
+ if (te === void 0)
198
198
  try {
199
199
  throw Error();
200
- } catch (o) {
201
- var n = o.stack.trim().match(/\n( *(at )?)/);
202
- H = n && n[1] || "";
200
+ } catch (f) {
201
+ var t = f.stack.trim().match(/\n( *(at )?)/);
202
+ te = t && t[1] || "";
203
203
  }
204
204
  return `
205
- ` + H + e;
205
+ ` + te + e;
206
206
  }
207
207
  }
208
- var Q = !1, B;
208
+ var ae = !1, z;
209
209
  {
210
- var Be = typeof WeakMap == "function" ? WeakMap : Map;
211
- B = new Be();
210
+ var Xe = typeof WeakMap == "function" ? WeakMap : Map;
211
+ z = new Xe();
212
212
  }
213
- function be(e, r) {
214
- if (!e || Q)
213
+ function Re(e, r) {
214
+ if (!e || ae)
215
215
  return "";
216
216
  {
217
- var t = B.get(e);
218
- if (t !== void 0)
219
- return t;
217
+ var n = z.get(e);
218
+ if (n !== void 0)
219
+ return n;
220
220
  }
221
- var n;
222
- Q = !0;
223
- var o = Error.prepareStackTrace;
221
+ var t;
222
+ ae = !0;
223
+ var f = Error.prepareStackTrace;
224
224
  Error.prepareStackTrace = void 0;
225
- var s;
226
- s = X.current, X.current = null, Ue();
225
+ var p;
226
+ p = ne.current, ne.current = null, Ge();
227
227
  try {
228
228
  if (r) {
229
- var i = function() {
229
+ var s = function() {
230
230
  throw Error();
231
231
  };
232
- if (Object.defineProperty(i.prototype, "props", {
232
+ if (Object.defineProperty(s.prototype, "props", {
233
233
  set: function() {
234
234
  throw Error();
235
235
  }
236
236
  }), typeof Reflect == "object" && Reflect.construct) {
237
237
  try {
238
- Reflect.construct(i, []);
239
- } catch (y) {
240
- n = y;
238
+ Reflect.construct(s, []);
239
+ } catch (O) {
240
+ t = O;
241
241
  }
242
- Reflect.construct(e, [], i);
242
+ Reflect.construct(e, [], s);
243
243
  } else {
244
244
  try {
245
- i.call();
246
- } catch (y) {
247
- n = y;
245
+ s.call();
246
+ } catch (O) {
247
+ t = O;
248
248
  }
249
- e.call(i.prototype);
249
+ e.call(s.prototype);
250
250
  }
251
251
  } else {
252
252
  try {
253
253
  throw Error();
254
- } catch (y) {
255
- n = y;
254
+ } catch (O) {
255
+ t = O;
256
256
  }
257
257
  e();
258
258
  }
259
- } catch (y) {
260
- if (y && n && typeof y.stack == "string") {
261
- for (var a = y.stack.split(`
262
- `), b = n.stack.split(`
263
- `), u = a.length - 1, l = b.length - 1; u >= 1 && l >= 0 && a[u] !== b[l]; )
264
- l--;
265
- for (; u >= 1 && l >= 0; u--, l--)
266
- if (a[u] !== b[l]) {
267
- if (u !== 1 || l !== 1)
259
+ } catch (O) {
260
+ if (O && t && typeof O.stack == "string") {
261
+ for (var i = O.stack.split(`
262
+ `), j = t.stack.split(`
263
+ `), h = i.length - 1, w = j.length - 1; h >= 1 && w >= 0 && i[h] !== j[w]; )
264
+ w--;
265
+ for (; h >= 1 && w >= 0; h--, w--)
266
+ if (i[h] !== j[w]) {
267
+ if (h !== 1 || w !== 1)
268
268
  do
269
- if (u--, l--, l < 0 || a[u] !== b[l]) {
270
- var E = `
271
- ` + a[u].replace(" at new ", " at ");
272
- return e.displayName && E.includes("<anonymous>") && (E = E.replace("<anonymous>", e.displayName)), typeof e == "function" && B.set(e, E), E;
269
+ if (h--, w--, w < 0 || i[h] !== j[w]) {
270
+ var k = `
271
+ ` + i[h].replace(" at new ", " at ");
272
+ return e.displayName && k.includes("<anonymous>") && (k = k.replace("<anonymous>", e.displayName)), typeof e == "function" && z.set(e, k), k;
273
273
  }
274
- while (u >= 1 && l >= 0);
274
+ while (h >= 1 && w >= 0);
275
275
  break;
276
276
  }
277
277
  }
278
278
  } finally {
279
- Q = !1, X.current = s, Ve(), Error.prepareStackTrace = o;
279
+ ae = !1, ne.current = p, ze(), Error.prepareStackTrace = f;
280
280
  }
281
- var I = e ? e.displayName || e.name : "", D = I ? V(I) : "";
282
- return typeof e == "function" && B.set(e, D), D;
281
+ var W = e ? e.displayName || e.name : "", A = W ? G(W) : "";
282
+ return typeof e == "function" && z.set(e, A), A;
283
283
  }
284
- function Je(e, r, t) {
285
- return be(e, !1);
284
+ function He(e, r, n) {
285
+ return Re(e, !1);
286
286
  }
287
- function Ke(e) {
287
+ function Qe(e) {
288
288
  var r = e.prototype;
289
289
  return !!(r && r.isReactComponent);
290
290
  }
291
- function J(e, r, t) {
291
+ function X(e, r, n) {
292
292
  if (e == null)
293
293
  return "";
294
294
  if (typeof e == "function")
295
- return be(e, Ke(e));
295
+ return Re(e, Qe(e));
296
296
  if (typeof e == "string")
297
- return V(e);
297
+ return G(e);
298
298
  switch (e) {
299
- case x:
300
- return V("Suspense");
301
- case v:
302
- return V("SuspenseList");
299
+ case C:
300
+ return G("Suspense");
301
+ case c:
302
+ return G("SuspenseList");
303
303
  }
304
304
  if (typeof e == "object")
305
305
  switch (e.$$typeof) {
306
- case d:
307
- return Je(e.render);
308
- case C:
309
- return J(e.type, r, t);
310
- case O: {
311
- var n = e, o = n._payload, s = n._init;
306
+ case v:
307
+ return He(e.render);
308
+ case x:
309
+ return X(e.type, r, n);
310
+ case R: {
311
+ var t = e, f = t._payload, p = t._init;
312
312
  try {
313
- return J(s(o), r, t);
313
+ return X(p(f), r, n);
314
314
  } catch {
315
315
  }
316
316
  }
317
317
  }
318
318
  return "";
319
319
  }
320
- var W = Object.prototype.hasOwnProperty, ge = {}, ye = S.ReactDebugCurrentFrame;
321
- function K(e) {
320
+ var M = Object.prototype.hasOwnProperty, Ce = {}, je = S.ReactDebugCurrentFrame;
321
+ function H(e) {
322
322
  if (e) {
323
- var r = e._owner, t = J(e.type, e._source, r ? r.type : null);
324
- ye.setExtraStackFrame(t);
323
+ var r = e._owner, n = X(e.type, e._source, r ? r.type : null);
324
+ je.setExtraStackFrame(n);
325
325
  } else
326
- ye.setExtraStackFrame(null);
326
+ je.setExtraStackFrame(null);
327
327
  }
328
- function Ge(e, r, t, n, o) {
328
+ function Ze(e, r, n, t, f) {
329
329
  {
330
- var s = Function.call.bind(W);
331
- for (var i in e)
332
- if (s(e, i)) {
333
- var a = void 0;
330
+ var p = Function.call.bind(M);
331
+ for (var s in e)
332
+ if (p(e, s)) {
333
+ var i = void 0;
334
334
  try {
335
- if (typeof e[i] != "function") {
336
- var b = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
- throw b.name = "Invariant Violation", b;
335
+ if (typeof e[s] != "function") {
336
+ var j = Error((t || "React class") + ": " + n + " type `" + s + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[s] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
+ throw j.name = "Invariant Violation", j;
338
338
  }
339
- a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
- } catch (u) {
341
- a = u;
339
+ i = e[s](r, s, t, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
+ } catch (h) {
341
+ i = h;
342
342
  }
343
- a && !(a instanceof Error) && (K(o), p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), K(null)), a instanceof Error && !(a.message in ge) && (ge[a.message] = !0, K(o), p("Failed %s type: %s", t, a.message), K(null));
343
+ i && !(i instanceof Error) && (H(f), E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", t || "React class", n, s, typeof i), H(null)), i instanceof Error && !(i.message in Ce) && (Ce[i.message] = !0, H(f), E("Failed %s type: %s", n, i.message), H(null));
344
344
  }
345
345
  }
346
346
  }
347
- var ze = Array.isArray;
348
- function Z(e) {
349
- return ze(e);
347
+ var er = Array.isArray;
348
+ function oe(e) {
349
+ return er(e);
350
350
  }
351
- function Xe(e) {
351
+ function rr(e) {
352
352
  {
353
- var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
354
- return t;
353
+ var r = typeof Symbol == "function" && Symbol.toStringTag, n = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
354
+ return n;
355
355
  }
356
356
  }
357
- function He(e) {
357
+ function nr(e) {
358
358
  try {
359
- return he(e), !1;
359
+ return Te(e), !1;
360
360
  } catch {
361
361
  return !0;
362
362
  }
363
363
  }
364
- function he(e) {
364
+ function Te(e) {
365
365
  return "" + e;
366
366
  }
367
- function me(e) {
368
- if (He(e))
369
- return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Xe(e)), he(e);
367
+ function Oe(e) {
368
+ if (nr(e))
369
+ return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", rr(e)), Te(e);
370
370
  }
371
- var L = S.ReactCurrentOwner, Qe = {
371
+ var B = S.ReactCurrentOwner, tr = {
372
372
  key: !0,
373
373
  ref: !0,
374
374
  __self: !0,
375
375
  __source: !0
376
- }, Ee, Re, ee;
377
- ee = {};
378
- function Ze(e) {
379
- if (W.call(e, "ref")) {
376
+ }, Se, ke, ie;
377
+ ie = {};
378
+ function ar(e) {
379
+ if (M.call(e, "ref")) {
380
380
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
381
381
  if (r && r.isReactWarning)
382
382
  return !1;
383
383
  }
384
384
  return e.ref !== void 0;
385
385
  }
386
- function er(e) {
387
- if (W.call(e, "key")) {
386
+ function or(e) {
387
+ if (M.call(e, "key")) {
388
388
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
389
389
  if (r && r.isReactWarning)
390
390
  return !1;
391
391
  }
392
392
  return e.key !== void 0;
393
393
  }
394
- function rr(e, r) {
395
- if (typeof e.ref == "string" && L.current && r && L.current.stateNode !== r) {
396
- var t = j(L.current.type);
397
- ee[t] || (p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', j(L.current.type), e.ref), ee[t] = !0);
394
+ function ir(e, r) {
395
+ if (typeof e.ref == "string" && B.current && r && B.current.stateNode !== r) {
396
+ var n = P(B.current.type);
397
+ ie[n] || (E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', P(B.current.type), e.ref), ie[n] = !0);
398
398
  }
399
399
  }
400
- function tr(e, r) {
400
+ function sr(e, r) {
401
401
  {
402
- var t = function() {
403
- Ee || (Ee = !0, p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
402
+ var n = function() {
403
+ Se || (Se = !0, E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
404
404
  };
405
- t.isReactWarning = !0, Object.defineProperty(e, "key", {
406
- get: t,
405
+ n.isReactWarning = !0, Object.defineProperty(e, "key", {
406
+ get: n,
407
407
  configurable: !0
408
408
  });
409
409
  }
410
410
  }
411
- function nr(e, r) {
411
+ function cr(e, r) {
412
412
  {
413
- var t = function() {
414
- Re || (Re = !0, p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
413
+ var n = function() {
414
+ ke || (ke = !0, E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
415
415
  };
416
- t.isReactWarning = !0, Object.defineProperty(e, "ref", {
417
- get: t,
416
+ n.isReactWarning = !0, Object.defineProperty(e, "ref", {
417
+ get: n,
418
418
  configurable: !0
419
419
  });
420
420
  }
421
421
  }
422
- var ar = function(e, r, t, n, o, s, i) {
423
- var a = {
422
+ var lr = function(e, r, n, t, f, p, s) {
423
+ var i = {
424
424
  // This tag allows us to uniquely identify this as a React Element
425
- $$typeof: g,
425
+ $$typeof: u,
426
426
  // Built-in properties that belong on the element
427
427
  type: e,
428
428
  key: r,
429
- ref: t,
430
- props: i,
429
+ ref: n,
430
+ props: s,
431
431
  // Record the component responsible for creating this element.
432
- _owner: s
432
+ _owner: p
433
433
  };
434
- return a._store = {}, Object.defineProperty(a._store, "validated", {
434
+ return i._store = {}, Object.defineProperty(i._store, "validated", {
435
435
  configurable: !1,
436
436
  enumerable: !1,
437
437
  writable: !0,
438
438
  value: !1
439
- }), Object.defineProperty(a, "_self", {
439
+ }), Object.defineProperty(i, "_self", {
440
440
  configurable: !1,
441
441
  enumerable: !1,
442
442
  writable: !1,
443
- value: n
444
- }), Object.defineProperty(a, "_source", {
443
+ value: t
444
+ }), Object.defineProperty(i, "_source", {
445
445
  configurable: !1,
446
446
  enumerable: !1,
447
447
  writable: !1,
448
- value: o
449
- }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
448
+ value: f
449
+ }), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
450
450
  };
451
- function ir(e, r, t, n, o) {
451
+ function ur(e, r, n, t, f) {
452
452
  {
453
- var s, i = {}, a = null, b = null;
454
- t !== void 0 && (me(t), a = "" + t), er(r) && (me(r.key), a = "" + r.key), Ze(r) && (b = r.ref, rr(r, o));
455
- for (s in r)
456
- W.call(r, s) && !Qe.hasOwnProperty(s) && (i[s] = r[s]);
453
+ var p, s = {}, i = null, j = null;
454
+ n !== void 0 && (Oe(n), i = "" + n), or(r) && (Oe(r.key), i = "" + r.key), ar(r) && (j = r.ref, ir(r, f));
455
+ for (p in r)
456
+ M.call(r, p) && !tr.hasOwnProperty(p) && (s[p] = r[p]);
457
457
  if (e && e.defaultProps) {
458
- var u = e.defaultProps;
459
- for (s in u)
460
- i[s] === void 0 && (i[s] = u[s]);
458
+ var h = e.defaultProps;
459
+ for (p in h)
460
+ s[p] === void 0 && (s[p] = h[p]);
461
461
  }
462
- if (a || b) {
463
- var l = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
464
- a && tr(i, l), b && nr(i, l);
462
+ if (i || j) {
463
+ var w = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
464
+ i && sr(s, w), j && cr(s, w);
465
465
  }
466
- return ar(e, a, b, o, n, L.current, i);
466
+ return lr(e, i, j, f, t, B.current, s);
467
467
  }
468
468
  }
469
- var re = S.ReactCurrentOwner, Te = S.ReactDebugCurrentFrame;
470
- function A(e) {
469
+ var se = S.ReactCurrentOwner, Pe = S.ReactDebugCurrentFrame;
470
+ function L(e) {
471
471
  if (e) {
472
- var r = e._owner, t = J(e.type, e._source, r ? r.type : null);
473
- Te.setExtraStackFrame(t);
472
+ var r = e._owner, n = X(e.type, e._source, r ? r.type : null);
473
+ Pe.setExtraStackFrame(n);
474
474
  } else
475
- Te.setExtraStackFrame(null);
475
+ Pe.setExtraStackFrame(null);
476
476
  }
477
- var te;
478
- te = !1;
479
- function ne(e) {
480
- return typeof e == "object" && e !== null && e.$$typeof === g;
477
+ var ce;
478
+ ce = !1;
479
+ function le(e) {
480
+ return typeof e == "object" && e !== null && e.$$typeof === u;
481
481
  }
482
- function Ce() {
482
+ function De() {
483
483
  {
484
- if (re.current) {
485
- var e = j(re.current.type);
484
+ if (se.current) {
485
+ var e = P(se.current.type);
486
486
  if (e)
487
487
  return `
488
488
 
@@ -491,169 +491,169 @@ Check the render method of \`` + e + "`.";
491
491
  return "";
492
492
  }
493
493
  }
494
- function or(e) {
494
+ function fr(e) {
495
495
  return "";
496
496
  }
497
- var we = {};
498
- function sr(e) {
497
+ var Ie = {};
498
+ function dr(e) {
499
499
  {
500
- var r = Ce();
500
+ var r = De();
501
501
  if (!r) {
502
- var t = typeof e == "string" ? e : e.displayName || e.name;
503
- t && (r = `
502
+ var n = typeof e == "string" ? e : e.displayName || e.name;
503
+ n && (r = `
504
504
 
505
- Check the top-level render call using <` + t + ">.");
505
+ Check the top-level render call using <` + n + ">.");
506
506
  }
507
507
  return r;
508
508
  }
509
509
  }
510
- function je(e, r) {
510
+ function Fe(e, r) {
511
511
  {
512
512
  if (!e._store || e._store.validated || e.key != null)
513
513
  return;
514
514
  e._store.validated = !0;
515
- var t = sr(r);
516
- if (we[t])
515
+ var n = dr(r);
516
+ if (Ie[n])
517
517
  return;
518
- we[t] = !0;
519
- var n = "";
520
- e && e._owner && e._owner !== re.current && (n = " It was passed a child from " + j(e._owner.type) + "."), A(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), A(null);
518
+ Ie[n] = !0;
519
+ var t = "";
520
+ e && e._owner && e._owner !== se.current && (t = " It was passed a child from " + P(e._owner.type) + "."), L(e), E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, t), L(null);
521
521
  }
522
522
  }
523
- function xe(e, r) {
523
+ function Ae(e, r) {
524
524
  {
525
525
  if (typeof e != "object")
526
526
  return;
527
- if (Z(e))
528
- for (var t = 0; t < e.length; t++) {
529
- var n = e[t];
530
- ne(n) && je(n, r);
527
+ if (oe(e))
528
+ for (var n = 0; n < e.length; n++) {
529
+ var t = e[n];
530
+ le(t) && Fe(t, r);
531
531
  }
532
- else if (ne(e))
532
+ else if (le(e))
533
533
  e._store && (e._store.validated = !0);
534
534
  else if (e) {
535
- var o = z(e);
536
- if (typeof o == "function" && o !== e.entries)
537
- for (var s = o.call(e), i; !(i = s.next()).done; )
538
- ne(i.value) && je(i.value, r);
535
+ var f = N(e);
536
+ if (typeof f == "function" && f !== e.entries)
537
+ for (var p = f.call(e), s; !(s = p.next()).done; )
538
+ le(s.value) && Fe(s.value, r);
539
539
  }
540
540
  }
541
541
  }
542
- function ur(e) {
542
+ function vr(e) {
543
543
  {
544
544
  var r = e.type;
545
545
  if (r == null || typeof r == "string")
546
546
  return;
547
- var t;
547
+ var n;
548
548
  if (typeof r == "function")
549
- t = r.propTypes;
550
- else if (typeof r == "object" && (r.$$typeof === d || // Note: Memo only checks outer props here.
549
+ n = r.propTypes;
550
+ else if (typeof r == "object" && (r.$$typeof === v || // Note: Memo only checks outer props here.
551
551
  // Inner props are checked in the reconciler.
552
- r.$$typeof === C))
553
- t = r.propTypes;
552
+ r.$$typeof === x))
553
+ n = r.propTypes;
554
554
  else
555
555
  return;
556
- if (t) {
557
- var n = j(r);
558
- Ge(t, e.props, "prop", n, e);
559
- } else if (r.PropTypes !== void 0 && !te) {
560
- te = !0;
561
- var o = j(r);
562
- p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
556
+ if (n) {
557
+ var t = P(r);
558
+ Ze(n, e.props, "prop", t, e);
559
+ } else if (r.PropTypes !== void 0 && !ce) {
560
+ ce = !0;
561
+ var f = P(r);
562
+ E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", f || "Unknown");
563
563
  }
564
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
564
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
565
565
  }
566
566
  }
567
- function lr(e) {
567
+ function pr(e) {
568
568
  {
569
- for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
570
- var n = r[t];
571
- if (n !== "children" && n !== "key") {
572
- A(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), A(null);
569
+ for (var r = Object.keys(e.props), n = 0; n < r.length; n++) {
570
+ var t = r[n];
571
+ if (t !== "children" && t !== "key") {
572
+ L(e), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", t), L(null);
573
573
  break;
574
574
  }
575
575
  }
576
- e.ref !== null && (A(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), A(null));
576
+ e.ref !== null && (L(e), E("Invalid attribute `ref` supplied to `React.Fragment`."), L(null));
577
577
  }
578
578
  }
579
- var Oe = {};
580
- function Se(e, r, t, n, o, s) {
579
+ var $e = {};
580
+ function Ne(e, r, n, t, f, p) {
581
581
  {
582
- var i = qe(e);
583
- if (!i) {
584
- var a = "";
585
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
586
- var b = or();
587
- b ? a += b : a += Ce();
588
- var u;
589
- e === null ? u = "null" : Z(e) ? u = "array" : e !== void 0 && e.$$typeof === g ? (u = "<" + (j(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : u = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", u, a);
582
+ var s = Ke(e);
583
+ if (!s) {
584
+ var i = "";
585
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
586
+ var j = fr();
587
+ j ? i += j : i += De();
588
+ var h;
589
+ e === null ? h = "null" : oe(e) ? h = "array" : e !== void 0 && e.$$typeof === u ? (h = "<" + (P(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : h = typeof e, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", h, i);
590
590
  }
591
- var l = ir(e, r, t, o, s);
592
- if (l == null)
593
- return l;
594
- if (i) {
595
- var E = r.children;
596
- if (E !== void 0)
597
- if (n)
598
- if (Z(E)) {
599
- for (var I = 0; I < E.length; I++)
600
- xe(E[I], e);
601
- Object.freeze && Object.freeze(E);
591
+ var w = ur(e, r, n, f, p);
592
+ if (w == null)
593
+ return w;
594
+ if (s) {
595
+ var k = r.children;
596
+ if (k !== void 0)
597
+ if (t)
598
+ if (oe(k)) {
599
+ for (var W = 0; W < k.length; W++)
600
+ Ae(k[W], e);
601
+ Object.freeze && Object.freeze(k);
602
602
  } else
603
- p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
603
+ E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
604
604
  else
605
- xe(E, e);
605
+ Ae(k, e);
606
606
  }
607
- if (W.call(r, "key")) {
608
- var D = j(e), y = Object.keys(r).filter(function(_r) {
609
- return _r !== "key";
610
- }), ae = y.length > 0 ? "{key: someKey, " + y.join(": ..., ") + ": ...}" : "{key: someKey}";
611
- if (!Oe[D + ae]) {
612
- var pr = y.length > 0 ? "{" + y.join(": ..., ") + ": ...}" : "{}";
613
- p(`A props object containing a "key" prop is being spread into JSX:
607
+ if (M.call(r, "key")) {
608
+ var A = P(e), O = Object.keys(r).filter(function(gr) {
609
+ return gr !== "key";
610
+ }), ue = O.length > 0 ? "{key: someKey, " + O.join(": ..., ") + ": ...}" : "{key: someKey}";
611
+ if (!$e[A + ue]) {
612
+ var yr = O.length > 0 ? "{" + O.join(": ..., ") + ": ...}" : "{}";
613
+ E(`A props object containing a "key" prop is being spread into JSX:
614
614
  let props = %s;
615
615
  <%s {...props} />
616
616
  React keys must be passed directly to JSX without using spread:
617
617
  let props = %s;
618
- <%s key={someKey} {...props} />`, ae, D, pr, D), Oe[D + ae] = !0;
618
+ <%s key={someKey} {...props} />`, ue, A, yr, A), $e[A + ue] = !0;
619
619
  }
620
620
  }
621
- return e === f ? lr(l) : ur(l), l;
621
+ return e === l ? pr(w) : vr(w), w;
622
622
  }
623
623
  }
624
- function cr(e, r, t) {
625
- return Se(e, r, t, !0);
624
+ function br(e, r, n) {
625
+ return Ne(e, r, n, !0);
626
626
  }
627
- function fr(e, r, t) {
628
- return Se(e, r, t, !1);
627
+ function _r(e, r, n) {
628
+ return Ne(e, r, n, !1);
629
629
  }
630
- var dr = fr, vr = cr;
631
- q.Fragment = f, q.jsx = dr, q.jsxs = vr;
632
- }()), q;
630
+ var mr = _r, hr = br;
631
+ K.Fragment = l, K.jsx = mr, K.jsxs = hr;
632
+ }()), K;
633
633
  }
634
- process.env.NODE_ENV === "production" ? ie.exports = gr() : ie.exports = yr();
635
- var w = ie.exports;
636
- const hr = "_button_dfbbq_1", mr = "_primary_dfbbq_20", Er = "_danger_dfbbq_21", Rr = "_secondary_dfbbq_44", Tr = "_text_dfbbq_51", Cr = "_disabled_dfbbq_60", $ = {
637
- button: hr,
638
- primary: mr,
639
- danger: Er,
640
- secondary: Rr,
641
- text: Tr,
642
- disabled: Cr
634
+ process.env.NODE_ENV === "production" ? ve.exports = xr() : ve.exports = Rr();
635
+ var _ = ve.exports;
636
+ const Cr = "_button_rrb70_1", jr = "_text_rrb70_21", Tr = "_primary_rrb70_26", Or = "_danger_rrb70_27", Sr = "_secondary_rrb70_50", kr = "_disabled_rrb70_66", Y = {
637
+ button: Cr,
638
+ text: jr,
639
+ primary: Tr,
640
+ danger: Or,
641
+ secondary: Sr,
642
+ disabled: kr
643
643
  };
644
- function M(_) {
645
- return _.map((c) => {
646
- if (typeof c == "string")
647
- return c.trim();
648
- if (typeof c == "object") {
649
- const f = [];
650
- for (const h in c)
651
- c[h] && f.push(h.trim());
652
- return f.join(" ");
653
- }
654
- }).filter((c) => !!c).join(" ");
644
+ function I(a) {
645
+ return a.map((o) => {
646
+ if (typeof o == "string")
647
+ return o.trim();
648
+ if (typeof o == "object") {
649
+ const l = [];
650
+ for (const d in o)
651
+ o[d] && l.push(d.trim());
652
+ return l.join(" ");
653
+ }
654
+ }).filter((o) => !!o).join(" ");
655
655
  }
656
- const wr = {
656
+ const Q = {
657
657
  CheckMark: "✓",
658
658
  Ballot: "✗",
659
659
  ClockwiseTop: "↷",
@@ -670,91 +670,246 @@ const wr = {
670
670
  Hart: "♥",
671
671
  Scissors: "✂",
672
672
  Star: "★"
673
- }, Lr = ({ disabled: _, onClick: g, text: c = "Ok", type: f = "button", view: h = "primary", icon: R, ...m }) => {
674
- const T = M([
675
- $.button,
676
- m == null ? void 0 : m.className,
673
+ }, rn = ({ disabled: a, onClick: u, text: o = "Ok", type: l = "button", view: d = "primary", icon: m, ...b }) => {
674
+ const y = I([
675
+ Y.button,
676
+ b == null ? void 0 : b.className,
677
677
  {
678
- [$.primary]: h === "primary",
679
- [$.secondary]: h === "secondary",
680
- [$.danger]: h === "danger",
681
- [$.disabled]: !!_
678
+ [Y.primary]: d === "primary",
679
+ [Y.secondary]: d === "secondary",
680
+ [Y.danger]: d === "danger",
681
+ [Y.disabled]: !!a
682
682
  }
683
683
  ]);
684
- return /* @__PURE__ */ w.jsxs("button", { type: f, className: T, onClick: _ ? void 0 : g, disabled: _, ...m, children: [
685
- R && /* @__PURE__ */ w.jsx("span", { children: `${wr[R]}` }),
686
- /* @__PURE__ */ w.jsx("span", { className: $.text, children: c })
684
+ return /* @__PURE__ */ _.jsxs("button", { type: l, className: y, onClick: a ? void 0 : u, disabled: a, ...b, children: [
685
+ m && /* @__PURE__ */ _.jsx("span", { children: `${Q[m]}` }),
686
+ /* @__PURE__ */ _.jsx("span", { className: Y.text, children: o })
687
687
  ] });
688
- }, jr = "_container_icou8_1", xr = "_wrapper_icou8_7", Or = "_input_icou8_21", Sr = "_invalid_icou8_28", Pr = "_error_icou8_48", kr = "_disabled_icou8_52", F = {
689
- container: jr,
690
- wrapper: xr,
691
- input: Or,
692
- invalid: Sr,
693
- error: Pr,
694
- disabled: kr
695
- }, Dr = "_label_1tf8i_1", Fr = "_required_1tf8i_9", De = {
696
- label: Dr,
697
- required: Fr
698
- }, Ar = ({ label: _, required: g, inputId: c, className: f }) => /* @__PURE__ */ w.jsxs("label", { htmlFor: c, className: M([De.label, f]), children: [
699
- _,
700
- g && /* @__PURE__ */ w.jsx("abbr", { title: "required", className: De.required, children: "*" })
701
- ] }), Ir = "_message_1ly5l_1", $r = "_visible_1ly5l_8", Fe = {
702
- message: Ir,
703
- visible: $r
704
- }, Nr = ({
705
- errorId: _,
706
- message: g = "Invalid input",
707
- className: c,
708
- visible: f = !1
709
- }) => /* @__PURE__ */ w.jsx("span", { id: _, className: M([Fe.message, c, { [Fe.visible]: f }]), children: g }), Yr = ({
710
- id: _,
711
- name: g,
712
- label: c,
713
- disabled: f,
714
- placeholder: h = "Type here...",
715
- valid: R = !0,
716
- required: m = !1,
717
- errorMessage: T,
718
- defaultValue: d,
719
- onChange: x,
720
- ...v
688
+ }, Pr = "_container_b5mrn_1", Dr = "_wrapper_b5mrn_7", Ir = "_input_b5mrn_21", Fr = "_invalid_b5mrn_27", Ar = "_error_b5mrn_47", $r = "_disabled_b5mrn_51", $ = {
689
+ container: Pr,
690
+ wrapper: Dr,
691
+ input: Ir,
692
+ invalid: Fr,
693
+ error: Ar,
694
+ disabled: $r
695
+ }, Nr = "_label_195p3_1", Lr = "_required_195p3_10", Ye = {
696
+ label: Nr,
697
+ required: Lr
698
+ }, Me = ({ label: a, required: u, inputId: o, className: l }) => /* @__PURE__ */ _.jsxs("label", { htmlFor: o, className: I([Ye.label, l]), children: [
699
+ a,
700
+ u && /* @__PURE__ */ _.jsx("abbr", { title: "required", className: Ye.required, children: "*" })
701
+ ] }), Wr = "_message_1ly5l_1", Yr = "_visible_1ly5l_8", Ve = {
702
+ message: Wr,
703
+ visible: Yr
704
+ }, Vr = ({
705
+ errorId: a,
706
+ message: u = "Invalid input",
707
+ className: o,
708
+ visible: l = !1
709
+ }) => /* @__PURE__ */ _.jsx("span", { id: a, className: I([Ve.message, o, { [Ve.visible]: l }]), children: u }), nn = ({
710
+ id: a,
711
+ name: u,
712
+ label: o,
713
+ disabled: l,
714
+ placeholder: d = "Type here...",
715
+ valid: m = !0,
716
+ required: b = !1,
717
+ errorMessage: y,
718
+ defaultValue: v,
719
+ onChange: C,
720
+ ...c
721
721
  }) => {
722
- const [C, O] = br(typeof d == "string" ? d : ""), P = `${_}_error`, U = M([F.container, v == null ? void 0 : v.className]), G = M([
723
- F.wrapper,
722
+ const [x, R] = de(typeof v == "string" ? v : ""), g = `${a}_error`, T = I([$.container, c == null ? void 0 : c.className]), V = I([
723
+ $.wrapper,
724
724
  {
725
- [F.disabled]: !!f,
726
- [F.invalid]: !R
725
+ [$.disabled]: !!l,
726
+ [$.invalid]: !m
727
727
  }
728
- ]), z = (S) => {
729
- const { value: p = "" } = S.target;
730
- O(p), x && x(S);
728
+ ]), N = (S) => {
729
+ const { value: E = "" } = S.target;
730
+ R(E), C && C(S);
731
731
  };
732
- return /* @__PURE__ */ w.jsxs("div", { className: U, children: [
733
- /* @__PURE__ */ w.jsxs("div", { className: G, children: [
734
- /* @__PURE__ */ w.jsx(Ar, { label: c, required: m, inputId: _, className: F.label }),
735
- /* @__PURE__ */ w.jsx(
732
+ return /* @__PURE__ */ _.jsxs("div", { className: T, children: [
733
+ /* @__PURE__ */ _.jsxs("div", { className: V, children: [
734
+ /* @__PURE__ */ _.jsx(Me, { label: o, required: b, inputId: a, className: $.label }),
735
+ /* @__PURE__ */ _.jsx(
736
736
  "input",
737
737
  {
738
- id: _,
739
- name: g,
738
+ id: a,
739
+ name: u,
740
740
  type: "text",
741
- className: F.input,
742
- disabled: f,
743
- placeholder: h,
744
- required: m,
745
- "aria-invalid": !R,
746
- "aria-errormessage": P,
747
- value: C,
748
- onChange: z,
749
- ...v
741
+ className: $.input,
742
+ disabled: l,
743
+ placeholder: d,
744
+ required: b,
745
+ "aria-invalid": !m,
746
+ "aria-errormessage": g,
747
+ value: x,
748
+ onChange: N,
749
+ ...c
750
750
  }
751
751
  )
752
752
  ] }),
753
- /* @__PURE__ */ w.jsx(Nr, { errorId: P, message: T, className: F.error, visible: !R })
753
+ /* @__PURE__ */ _.jsx(Vr, { errorId: g, message: y, className: $.error, visible: !m })
754
+ ] });
755
+ }, Ur = "_wrapper_w3i6b_1", Mr = "_combobox_w3i6b_17", Br = "_combobox_label_w3i6b_41", qr = "_dropdown_w3i6b_46", Kr = "_dropdown_opened_w3i6b_67", Jr = "_option_w3i6b_72", Gr = "_active_w3i6b_80", zr = "_disabled_w3i6b_89", D = {
756
+ wrapper: Ur,
757
+ combobox: Mr,
758
+ combobox_label: Br,
759
+ dropdown: qr,
760
+ dropdown_opened: Kr,
761
+ option: Jr,
762
+ active: Gr,
763
+ disabled: zr
764
+ }, Xr = ({ ref: a, onClickOutsideHandler: u, dependentRef: o }) => {
765
+ Er(() => {
766
+ const l = (d) => {
767
+ const m = (a == null ? void 0 : a.current) && !a.current.contains(d.target), b = o != null && o.current ? !o.current.contains(d.target) : !0;
768
+ m && b && u();
769
+ };
770
+ return document.addEventListener("mousedown", l), () => {
771
+ document.removeEventListener("mousedown", l);
772
+ };
773
+ }, [a, o, u]);
774
+ }, Hr = ({
775
+ isOpened: a,
776
+ onClick: u,
777
+ comboboxId: o,
778
+ dropdownId: l,
779
+ selected: d,
780
+ name: m,
781
+ placeholder: b,
782
+ disabled: y,
783
+ required: v
784
+ }) => /* @__PURE__ */ _.jsxs(
785
+ "button",
786
+ {
787
+ type: "button",
788
+ name: m,
789
+ value: d == null ? void 0 : d.id,
790
+ role: "combobox",
791
+ "aria-haspopup": "listbox",
792
+ "aria-label": "Select one of the options",
793
+ "aria-expanded": a,
794
+ "aria-controls": l,
795
+ id: o,
796
+ className: D.combobox,
797
+ onClick: u,
798
+ disabled: y,
799
+ "aria-required": v,
800
+ children: [
801
+ /* @__PURE__ */ _.jsx("span", { className: D.combobox_label, children: (d == null ? void 0 : d.label) ?? b }),
802
+ /* @__PURE__ */ _.jsx("span", { children: a ? Q.Upwards : Q.Downwards })
803
+ ]
804
+ }
805
+ );
806
+ function fe(a) {
807
+ const u = document.getElementById(a);
808
+ u && u.focus();
809
+ }
810
+ const Qr = ({ value: a, isSelected: u, onSelect: o }) => {
811
+ const { id: l, label: d } = a, m = I([D.option]), b = (y) => (v) => {
812
+ switch (v.key) {
813
+ case " ":
814
+ case "SpaceBar":
815
+ case "Enter":
816
+ v.preventDefault(), o(y);
817
+ break;
818
+ }
819
+ };
820
+ return /* @__PURE__ */ _.jsxs(
821
+ "li",
822
+ {
823
+ id: l,
824
+ role: "option",
825
+ className: m,
826
+ "aria-selected": u,
827
+ tabIndex: 0,
828
+ onKeyDown: b(l),
829
+ onClick: () => o(l),
830
+ children: [
831
+ /* @__PURE__ */ _.jsx("span", { children: d }),
832
+ u && /* @__PURE__ */ _.jsx("span", { children: Q.CheckMark })
833
+ ]
834
+ }
835
+ );
836
+ }, Zr = ({ values: a, isOpened: u, onClose: o, onSelect: l, dropdownId: d, comboboxId: m, selected: b }) => {
837
+ const y = I([D.dropdown, { [D.dropdown_opened]: u }]), v = (c) => {
838
+ l(c), o(), fe(m);
839
+ }, C = (c) => {
840
+ let x = "";
841
+ a.forEach((g) => {
842
+ document.getElementById(g.id) === document.activeElement && (x = g.id);
843
+ });
844
+ const R = a.findIndex((g) => g.id === x);
845
+ switch (c.key) {
846
+ case "Escape":
847
+ c.preventDefault(), o();
848
+ break;
849
+ case "ArrowUp": {
850
+ c.preventDefault();
851
+ const g = R - 1 >= 0 ? R - 1 : a.length - 1, T = a[g];
852
+ T && fe(T.id);
853
+ break;
854
+ }
855
+ case "ArrowDown":
856
+ case "Tab": {
857
+ c.preventDefault();
858
+ const g = R === a.length - 1 ? 0 : R + 1, T = a[g];
859
+ T && fe(T.id);
860
+ break;
861
+ }
862
+ }
863
+ };
864
+ return /* @__PURE__ */ _.jsx("ul", { className: y, role: "listbox", id: d, tabIndex: -1, onKeyDown: C, children: a.map((c) => /* @__PURE__ */ _.jsx(Qr, { value: c, onSelect: () => v(c.id), isSelected: c.id === (b == null ? void 0 : b.id) }, c.id)) });
865
+ }, tn = ({
866
+ id: a,
867
+ values: u,
868
+ onSelect: o,
869
+ name: l,
870
+ label: d,
871
+ required: m = !1,
872
+ placeholder: b = "Not selected",
873
+ disabled: y = !1,
874
+ ...v
875
+ }) => {
876
+ const [C, c] = de(!1), [x, R] = de(), g = `${a}_combobox`, T = `${a}_dropdown`, V = I([D.wrapper, v == null ? void 0 : v.className, { [D.disabled]: y }]), N = wr(null), S = () => c(!1), E = () => c(!C), Z = (ee) => {
877
+ const J = u.find((re) => re.id === ee);
878
+ R(J), o == null || o(J);
879
+ };
880
+ return Xr({ ref: N, onClickOutsideHandler: S }), /* @__PURE__ */ _.jsxs("div", { className: V, ref: N, children: [
881
+ /* @__PURE__ */ _.jsx(Me, { label: d, required: m, inputId: g, className: D.label }),
882
+ /* @__PURE__ */ _.jsx(
883
+ Hr,
884
+ {
885
+ name: l,
886
+ isOpened: C,
887
+ comboboxId: g,
888
+ dropdownId: T,
889
+ onClick: E,
890
+ selected: x,
891
+ placeholder: b,
892
+ disabled: y,
893
+ required: m
894
+ }
895
+ ),
896
+ /* @__PURE__ */ _.jsx(
897
+ Zr,
898
+ {
899
+ values: u,
900
+ selected: x,
901
+ isOpened: C,
902
+ onClose: S,
903
+ dropdownId: T,
904
+ comboboxId: g,
905
+ onSelect: Z
906
+ }
907
+ )
754
908
  ] });
755
909
  };
756
910
  export {
757
- Lr as ChopLogicButton,
758
- Yr as ChopLogicTextInput
911
+ rn as ChopLogicButton,
912
+ tn as ChopLogicSelect,
913
+ nn as ChopLogicTextInput
759
914
  };
760
915
  //# sourceMappingURL=index.es.js.map